From 81e0bcce1188c9c34f9ad40a6c7d9eacf7313c65 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Thu, 6 Aug 2026 14:03:09 -0700 Subject: [PATCH 01/56] Regenerate voice agents SDK and improve samples --- .../azure-ai-voiceagents/CHANGELOG.md | 7 + sdk/voiceagents/azure-ai-voiceagents/LICENSE | 21 + .../azure-ai-voiceagents/MANIFEST.in | 7 + .../azure-ai-voiceagents/README.md | 82 + .../azure-ai-voiceagents/_metadata.json | 6 + .../apiview-properties.json | 380 + .../azure-ai-voiceagents/assets.json | 6 + .../azure-ai-voiceagents/azure/__init__.py | 1 + .../azure-ai-voiceagents/azure/ai/__init__.py | 1 + .../azure/ai/voiceagents/__init__.py | 32 + .../azure/ai/voiceagents/_client.py | 122 + .../azure/ai/voiceagents/_configuration.py | 69 + .../azure/ai/voiceagents/_patch.py | 21 + .../azure/ai/voiceagents/_unions.py | 71 + .../azure/ai/voiceagents/_utils/__init__.py | 6 + .../azure/ai/voiceagents/_utils/model_base.py | 1787 +++ .../ai/voiceagents/_utils/serialization.py | 2179 +++ .../azure/ai/voiceagents/_version.py | 9 + .../azure/ai/voiceagents/aio/__init__.py | 29 + .../azure/ai/voiceagents/aio/_client.py | 125 + .../ai/voiceagents/aio/_configuration.py | 69 + .../azure/ai/voiceagents/aio/_patch.py | 74 + .../azure/ai/voiceagents/aio/_realtime.py | 756 + .../ai/voiceagents/aio/operations/__init__.py | 29 + .../voiceagents/aio/operations/_operations.py | 2854 ++++ .../ai/voiceagents/aio/operations/_patch.py | 21 + .../azure/ai/voiceagents/models/__init__.py | 680 + .../azure/ai/voiceagents/models/_enums.py | 1084 ++ .../azure/ai/voiceagents/models/_models.py | 13395 ++++++++++++++++ .../azure/ai/voiceagents/models/_patch.py | 21 + .../ai/voiceagents/operations/__init__.py | 29 + .../ai/voiceagents/operations/_operations.py | 3612 +++++ .../azure/ai/voiceagents/operations/_patch.py | 21 + .../azure/ai/voiceagents/py.typed | 1 + .../azure/ai/voiceagents/types.py | 6717 ++++++++ .../azure/ai/voiceagents/_configuration.py | 69 + .../azure-ai-voiceagents/dev_requirements.txt | 4 + .../azure-ai-voiceagents/pyproject.toml | 61 + .../azure-ai-voiceagents/pyrightconfig.json | 13 + .../azure-ai-voiceagents/pytest.ini | 2 + .../azure-ai-voiceagents/samples/README.md | 153 + .../sample_live_audio_conversation_async.py | 323 + .../sample_live_text_conversation_async.py | 250 + .../sample_create_and_manage_voice_agent.py | 115 + ...ple_create_and_manage_voice_agent_async.py | 76 + .../sample_create_voice_agent_with_tools.py | 162 + .../management/sample_generate_voice_agent.py | 64 + .../sample_manage_voice_agent_versions.py | 101 + .../management/sample_read_conversation.py | 103 + .../sample_read_conversation_audio.py | 144 + .../quickstart/sample_quickstart_async.py | 226 + .../azure-ai-voiceagents/tests/conftest.py | 15 + .../tests/live/conftest.py | 17 + .../tests/live/test_smoke_live.py | 44 + .../tests/recording/_preparer.py | 26 + .../tests/recording/conftest.py | 20 + .../recording/test_voice_agents_client.py | 58 + .../test_voice_agents_client_async.py | 50 + .../tests/unit/conftest.py | 17 + .../tests/unit/test_brotli_workaround.py | 48 + .../tests/unit/test_client_construction.py | 62 + .../tests/unit/test_configuration.py | 47 + .../azure-ai-voiceagents/tsp-location.yaml | 13 + 63 files changed, 36607 insertions(+) create mode 100644 sdk/voiceagents/azure-ai-voiceagents/CHANGELOG.md create mode 100644 sdk/voiceagents/azure-ai-voiceagents/LICENSE create mode 100644 sdk/voiceagents/azure-ai-voiceagents/MANIFEST.in create mode 100644 sdk/voiceagents/azure-ai-voiceagents/README.md create mode 100644 sdk/voiceagents/azure-ai-voiceagents/_metadata.json create mode 100644 sdk/voiceagents/azure-ai-voiceagents/apiview-properties.json create mode 100644 sdk/voiceagents/azure-ai-voiceagents/assets.json create mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/__init__.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/__init__.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/__init__.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_client.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_configuration.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_patch.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_unions.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_utils/__init__.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_utils/model_base.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_utils/serialization.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_version.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/__init__.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_client.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_configuration.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_patch.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_realtime.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/__init__.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/_operations.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/_patch.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/__init__.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/_enums.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/_models.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/_patch.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/__init__.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/_operations.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/_patch.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/py.typed create mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/types.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure_ai_voiceagents-1.0.0b1/azure/ai/voiceagents/_configuration.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/dev_requirements.txt create mode 100644 sdk/voiceagents/azure-ai-voiceagents/pyproject.toml create mode 100644 sdk/voiceagents/azure-ai-voiceagents/pyrightconfig.json create mode 100644 sdk/voiceagents/azure-ai-voiceagents/pytest.ini create mode 100644 sdk/voiceagents/azure-ai-voiceagents/samples/README.md create mode 100644 sdk/voiceagents/azure-ai-voiceagents/samples/live/sample_live_audio_conversation_async.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/samples/live/sample_live_text_conversation_async.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_create_and_manage_voice_agent.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_create_and_manage_voice_agent_async.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_create_voice_agent_with_tools.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_generate_voice_agent.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_manage_voice_agent_versions.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_read_conversation.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_read_conversation_audio.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/samples/quickstart/sample_quickstart_async.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/tests/conftest.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/tests/live/conftest.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/tests/live/test_smoke_live.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/tests/recording/_preparer.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/tests/recording/conftest.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client_async.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/tests/unit/conftest.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/tests/unit/test_brotli_workaround.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/tests/unit/test_client_construction.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/tests/unit/test_configuration.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/tsp-location.yaml diff --git a/sdk/voiceagents/azure-ai-voiceagents/CHANGELOG.md b/sdk/voiceagents/azure-ai-voiceagents/CHANGELOG.md new file mode 100644 index 000000000000..b957b2575b48 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/CHANGELOG.md @@ -0,0 +1,7 @@ +# Release History + +## 1.0.0b1 (1970-01-01) + +### Other Changes + + - Initial version \ No newline at end of file diff --git a/sdk/voiceagents/azure-ai-voiceagents/LICENSE b/sdk/voiceagents/azure-ai-voiceagents/LICENSE new file mode 100644 index 000000000000..63447fd8bbbf --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) Microsoft Corporation. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/voiceagents/azure-ai-voiceagents/MANIFEST.in b/sdk/voiceagents/azure-ai-voiceagents/MANIFEST.in new file mode 100644 index 000000000000..40653212ffad --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/MANIFEST.in @@ -0,0 +1,7 @@ +include *.md +include LICENSE +include azure/ai/voiceagents/py.typed +recursive-include tests *.py +recursive-include samples *.py *.md +include azure/__init__.py +include azure/ai/__init__.py diff --git a/sdk/voiceagents/azure-ai-voiceagents/README.md b/sdk/voiceagents/azure-ai-voiceagents/README.md new file mode 100644 index 000000000000..87782cb70376 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/README.md @@ -0,0 +1,82 @@ +# Azure Ai Voiceagents client library for Python + + +## Getting started + +### Install the package + +```bash +python -m pip install azure-ai-voiceagents +``` + +#### Prequisites + +- Python 3.10 or later is required to use this package. +- You need an [Azure subscription][azure_sub] to use this package. +- An existing Azure Ai Voiceagents instance. + +### Use with AI tools + +AI coding tools such as VS Code and GitHub Copilot can help you write and debug code that uses this library. See [Using the Azure SDK for Python with AI tools](https://aka.ms/azsdk/python/ai) for available integrations. + +#### Create with an Azure Active Directory Credential +To use an [Azure Active Directory (AAD) token credential][authenticate_with_token], +provide an instance of the desired credential type obtained from the +[azure-identity][azure_identity_credentials] library. + +To authenticate with AAD, you must first [pip][pip] install [`azure-identity`][azure_identity_pip] + +After setup, you can choose which type of [credential][azure_identity_credentials] from azure.identity to use. +As an example, [DefaultAzureCredential][default_azure_credential] can be used to authenticate the client: + +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: +`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET` + +Use the returned token credential to authenticate the client: + +```python +>>> from azure.ai.voiceagents import VoiceAgentsClient +>>> from azure.identity import DefaultAzureCredential +>>> client = VoiceAgentsClient(endpoint='', credential=DefaultAzureCredential()) +``` + +## Examples + +```python +>>> from azure.ai.voiceagents import VoiceAgentsClient +>>> from azure.identity import DefaultAzureCredential +>>> from azure.core.exceptions import HttpResponseError + +>>> client = VoiceAgentsClient(endpoint='', credential=DefaultAzureCredential()) +>>> try: + + except HttpResponseError as e: + print('service responds error: {}'.format(e.response.json())) + +``` + +## Contributing + +This project welcomes contributions and suggestions. Most contributions require +you to agree to a Contributor License Agreement (CLA) declaring that you have +the right to, and actually do, grant us the rights to use your contribution. +For details, visit https://cla.microsoft.com. + +When you submit a pull request, a CLA-bot will automatically determine whether +you need to provide a CLA and decorate the PR appropriately (e.g., label, +comment). Simply follow the instructions provided by the bot. You will only +need to do this once across all repos using our CLA. + +This project has adopted the +[Microsoft Open Source Code of Conduct][code_of_conduct]. For more information, +see the Code of Conduct FAQ or contact opencode@microsoft.com with any +additional questions or comments. + + +[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ +[authenticate_with_token]: https://docs.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#credentials +[azure_identity_pip]: https://pypi.org/project/azure-identity/ +[default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential +[pip]: https://pypi.org/project/pip/ +[azure_sub]: https://azure.microsoft.com/free/ diff --git a/sdk/voiceagents/azure-ai-voiceagents/_metadata.json b/sdk/voiceagents/azure-ai-voiceagents/_metadata.json new file mode 100644 index 000000000000..3a000fe50d57 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/_metadata.json @@ -0,0 +1,6 @@ +{ + "apiVersion": "v1", + "apiVersions": { + "Azure.AI.Projects": "v1" + } +} \ No newline at end of file diff --git a/sdk/voiceagents/azure-ai-voiceagents/apiview-properties.json b/sdk/voiceagents/azure-ai-voiceagents/apiview-properties.json new file mode 100644 index 000000000000..8d7e108d309c --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/apiview-properties.json @@ -0,0 +1,380 @@ +{ + "CrossLanguagePackageId": "Azure.AI.Projects", + "CrossLanguageDefinitionId": { + "azure.ai.voiceagents.models.A2AProtocolConfiguration": "Azure.AI.Projects.A2AProtocolConfiguration", + "azure.ai.voiceagents.models.ActivityProtocolConfiguration": "Azure.AI.Projects.ActivityProtocolConfiguration", + "azure.ai.voiceagents.models.AgentBlueprintReference": "Azure.AI.Projects.AgentBlueprintReference", + "azure.ai.voiceagents.models.AgentCard": "Azure.AI.Projects.AgentCard", + "azure.ai.voiceagents.models.AgentCardSkill": "Azure.AI.Projects.AgentCardSkill", + "azure.ai.voiceagents.models.AgentEndpointAuthorizationScheme": "Azure.AI.Projects.AgentEndpointAuthorizationScheme", + "azure.ai.voiceagents.models.AgentEndpointConfig": "Azure.AI.Projects.AgentEndpointConfig", + "azure.ai.voiceagents.models.AgentIdentity": "Azure.AI.Projects.AgentIdentity", + "azure.ai.voiceagents.models.ApiErrorResponse": "Azure.AI.Projects.ApiErrorResponse", + "azure.ai.voiceagents.models.AzureVoice": "Azure.AI.Projects.AzureVoice", + "azure.ai.voiceagents.models.AzureAvatarVoiceSyncVoice": "Azure.AI.Projects.AzureAvatarVoiceSyncVoice", + "azure.ai.voiceagents.models.AzureCustomVoice": "Azure.AI.Projects.AzureCustomVoice", + "azure.ai.voiceagents.models.AzurePersonalVoice": "Azure.AI.Projects.AzurePersonalVoice", + "azure.ai.voiceagents.models.AzureRealtimeNativeVoice": "Azure.AI.Projects.AzureRealtimeNativeVoice", + "azure.ai.voiceagents.models.AzureStandardVoice": "Azure.AI.Projects.AzureStandardVoice", + "azure.ai.voiceagents.models.BotServiceAuthorizationScheme": "Azure.AI.Projects.BotServiceAuthorizationScheme", + "azure.ai.voiceagents.models.BotServiceRbacAuthorizationScheme": "Azure.AI.Projects.BotServiceRbacAuthorizationScheme", + "azure.ai.voiceagents.models.BotServiceTenantAuthorizationScheme": "Azure.AI.Projects.BotServiceTenantAuthorizationScheme", + "azure.ai.voiceagents.models.CreateTranscriptionResponseJsonUsage": "OpenAI.CreateTranscriptionResponseJsonUsage", + "azure.ai.voiceagents.models.EntraAuthorizationScheme": "Azure.AI.Projects.EntraAuthorizationScheme", + "azure.ai.voiceagents.models.Error": "OpenAI.Error", + "azure.ai.voiceagents.models.VersionSelectionRule": "Azure.AI.Projects.VersionSelectionRule", + "azure.ai.voiceagents.models.FixedRatioVersionSelectionRule": "Azure.AI.Projects.FixedRatioVersionSelectionRule", + "azure.ai.voiceagents.models.InvocationsProtocolConfiguration": "Azure.AI.Projects.InvocationsProtocolConfiguration", + "azure.ai.voiceagents.models.InvocationsWsProtocolConfiguration": "Azure.AI.Projects.InvocationsWsProtocolConfiguration", + "azure.ai.voiceagents.models.VoiceGreetingConfig": "Azure.AI.Projects.VoiceGreetingConfig", + "azure.ai.voiceagents.models.LlmGeneratedVoiceGreetingConfig": "Azure.AI.Projects.LlmGeneratedVoiceGreetingConfig", + "azure.ai.voiceagents.models.LogProbProperties": "OpenAI.LogProbProperties", + "azure.ai.voiceagents.models.ManagedAgentIdentityBlueprintReference": "Azure.AI.Projects.ManagedAgentIdentityBlueprintReference", + "azure.ai.voiceagents.models.MCPListToolsTool": "OpenAI.MCPListToolsTool", + "azure.ai.voiceagents.models.MCPListToolsToolAnnotations": "OpenAI.MCPListToolsToolAnnotations", + "azure.ai.voiceagents.models.MCPListToolsToolInputSchema": "OpenAI.MCPListToolsToolInputSchema", + "azure.ai.voiceagents.models.McpProtocolConfiguration": "Azure.AI.Projects.McpProtocolConfiguration", + "azure.ai.voiceagents.models.Tool": "OpenAI.Tool", + "azure.ai.voiceagents.models.MCPTool": "OpenAI.MCPTool", + "azure.ai.voiceagents.models.MCPToolFilter": "OpenAI.MCPToolFilter", + "azure.ai.voiceagents.models.MCPToolRequireApproval": "OpenAI.MCPToolRequireApproval", + "azure.ai.voiceagents.models.Metadata": "OpenAI.Metadata", + "azure.ai.voiceagents.models.OpenAIVoice": "Azure.AI.Projects.OpenAIVoice", + "azure.ai.voiceagents.models.ProtocolConfiguration": "Azure.AI.Projects.ProtocolConfiguration", + "azure.ai.voiceagents.models.RaiConfig": "Azure.AI.Projects.RaiConfig", + "azure.ai.voiceagents.models.RealtimeAudioFormats": "OpenAI.RealtimeAudioFormats", + "azure.ai.voiceagents.models.RealtimeAudioFormatsAudioPcm": "OpenAI.RealtimeAudioFormatsAudioPcm", + "azure.ai.voiceagents.models.RealtimeAudioFormatsAudioPcma": "OpenAI.RealtimeAudioFormatsAudioPcma", + "azure.ai.voiceagents.models.RealtimeAudioFormatsAudioPcmu": "OpenAI.RealtimeAudioFormatsAudioPcmu", + "azure.ai.voiceagents.models.RealtimeConversationItem": "OpenAI.RealtimeConversationItem", + "azure.ai.voiceagents.models.RealtimeConversationItemFunctionCall": "OpenAI.RealtimeConversationItemFunctionCall", + "azure.ai.voiceagents.models.RealtimeConversationItemFunctionCallOutput": "OpenAI.RealtimeConversationItemFunctionCallOutput", + "azure.ai.voiceagents.models.RealtimeConversationItemMessage": "OpenAI.RealtimeConversationItemMessage", + "azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistant": "OpenAI.RealtimeConversationItemMessageAssistant", + "azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistantContent": "OpenAI.RealtimeConversationItemMessageAssistantContent", + "azure.ai.voiceagents.models.RealtimeConversationItemMessageSystem": "OpenAI.RealtimeConversationItemMessageSystem", + "azure.ai.voiceagents.models.RealtimeConversationItemMessageSystemContent": "OpenAI.RealtimeConversationItemMessageSystemContent", + "azure.ai.voiceagents.models.RealtimeConversationItemMessageUser": "OpenAI.RealtimeConversationItemMessageUser", + "azure.ai.voiceagents.models.RealtimeConversationItemMessageUserContent": "OpenAI.RealtimeConversationItemMessageUserContent", + "azure.ai.voiceagents.models.RealtimeFunctionTool": "OpenAI.RealtimeFunctionTool", + "azure.ai.voiceagents.models.RealtimeFunctionToolParameters": "OpenAI.RealtimeFunctionToolParameters", + "azure.ai.voiceagents.models.RealtimeMCPApprovalRequest": "OpenAI.RealtimeMCPApprovalRequest", + "azure.ai.voiceagents.models.RealtimeMCPApprovalResponse": "OpenAI.RealtimeMCPApprovalResponse", + "azure.ai.voiceagents.models.RealtimeMCPError": "OpenAI.RealtimeMCPError", + "azure.ai.voiceagents.models.RealtimeMCPHTTPError": "OpenAI.RealtimeMCPHTTPError", + "azure.ai.voiceagents.models.RealtimeMCPListTools": "OpenAI.RealtimeMCPListTools", + "azure.ai.voiceagents.models.RealtimeMCPProtocolError": "OpenAI.RealtimeMCPProtocolError", + "azure.ai.voiceagents.models.RealtimeMCPToolCall": "OpenAI.RealtimeMCPToolCall", + "azure.ai.voiceagents.models.RealtimeMCPToolExecutionError": "OpenAI.RealtimeMCPToolExecutionError", + "azure.ai.voiceagents.models.RealtimeReasoning": "OpenAI.RealtimeReasoning", + "azure.ai.voiceagents.models.RealtimeResponseStatusDetails": "OpenAI.RealtimeResponseStatusDetails", + "azure.ai.voiceagents.models.RealtimeResponseStatusDetailsError": "OpenAI.RealtimeResponseStatusDetailsError", + "azure.ai.voiceagents.models.RealtimeResponseUsage": "OpenAI.RealtimeResponseUsage", + "azure.ai.voiceagents.models.RealtimeResponseUsageInputTokenDetails": "OpenAI.RealtimeResponseUsageInputTokenDetails", + "azure.ai.voiceagents.models.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails": "OpenAI.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails", + "azure.ai.voiceagents.models.RealtimeResponseUsageOutputTokenDetails": "OpenAI.RealtimeResponseUsageOutputTokenDetails", + "azure.ai.voiceagents.models.RealtimeServerEvent": "OpenAI.RealtimeServerEvent", + "azure.ai.voiceagents.models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError": "OpenAI.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError", + "azure.ai.voiceagents.models.RealtimeServerEventRateLimitsUpdatedRateLimits": "OpenAI.RealtimeServerEventRateLimitsUpdatedRateLimits", + "azure.ai.voiceagents.models.RealtimeServerEventResponseContentPartAdded": "OpenAI.RealtimeServerEventResponseContentPartAdded", + "azure.ai.voiceagents.models.RealtimeServerEventResponseContentPartAddedPart": "OpenAI.RealtimeServerEventResponseContentPartAddedPart", + "azure.ai.voiceagents.models.RealtimeToolChoiceFunction": "OpenAI.RealtimeToolChoiceFunction", + "azure.ai.voiceagents.models.ResponsesProtocolConfiguration": "Azure.AI.Projects.ResponsesProtocolConfiguration", + "azure.ai.voiceagents.models.StructuredInputDefinition": "Azure.AI.Projects.StructuredInputDefinition", + "azure.ai.voiceagents.models.TemplateVoiceGreetingConfig": "Azure.AI.Projects.TemplateVoiceGreetingConfig", + "azure.ai.voiceagents.models.ToolChoiceParam": "OpenAI.ToolChoiceParam", + "azure.ai.voiceagents.models.ToolChoiceFunction": "OpenAI.ToolChoiceFunction", + "azure.ai.voiceagents.models.ToolChoiceMCP": "OpenAI.ToolChoiceMCP", + "azure.ai.voiceagents.models.ToolConfig": "Azure.AI.Projects.ToolConfig", + "azure.ai.voiceagents.models.TranscriptTextUsageDuration": "OpenAI.TranscriptTextUsageDuration", + "azure.ai.voiceagents.models.TranscriptTextUsageTokens": "OpenAI.TranscriptTextUsageTokens", + "azure.ai.voiceagents.models.TranscriptTextUsageTokensInputTokenDetails": "OpenAI.TranscriptTextUsageTokensInputTokenDetails", + "azure.ai.voiceagents.models.VersionSelector": "Azure.AI.Projects.VersionSelector", + "azure.ai.voiceagents.models.VoiceAgentAnimationConfig": "Azure.AI.Projects.VoiceAgentAnimationConfig", + "azure.ai.voiceagents.models.VoiceAgentAvatarIceServer": "Azure.AI.Projects.VoiceAgentAvatarIceServer", + "azure.ai.voiceagents.models.VoiceAgentAvatarScene": "Azure.AI.Projects.VoiceAgentAvatarScene", + "azure.ai.voiceagents.models.VoiceAgentAvatarVideoBackground": "Azure.AI.Projects.VoiceAgentAvatarVideoBackground", + "azure.ai.voiceagents.models.VoiceAgentAvatarVideoCrop": "Azure.AI.Projects.VoiceAgentAvatarVideoCrop", + "azure.ai.voiceagents.models.VoiceAgentAvatarVideoParams": "Azure.AI.Projects.VoiceAgentAvatarVideoParams", + "azure.ai.voiceagents.models.VoiceAgentAvatarVideoResolution": "Azure.AI.Projects.VoiceAgentAvatarVideoResolution", + "azure.ai.voiceagents.models.VoiceAgentAzureMultilingualSemanticVadTurnDetection": "Azure.AI.Projects.VoiceAgentAzureMultilingualSemanticVadTurnDetection", + "azure.ai.voiceagents.models.VoiceAgentAzureSemanticVadTurnDetection": "Azure.AI.Projects.VoiceAgentAzureSemanticVadTurnDetection", + "azure.ai.voiceagents.models.VoiceAgentClientEventConversationItemCreate": "Azure.AI.Projects.VoiceAgentClientEventConversationItemCreate", + "azure.ai.voiceagents.models.VoiceAgentClientEventConversationItemDelete": "Azure.AI.Projects.VoiceAgentClientEventConversationItemDelete", + "azure.ai.voiceagents.models.VoiceAgentClientEventConversationItemRetrieve": "Azure.AI.Projects.VoiceAgentClientEventConversationItemRetrieve", + "azure.ai.voiceagents.models.VoiceAgentClientEventConversationItemTruncate": "Azure.AI.Projects.VoiceAgentClientEventConversationItemTruncate", + "azure.ai.voiceagents.models.VoiceAgentClientEventInputAudioBufferAppend": "Azure.AI.Projects.VoiceAgentClientEventInputAudioBufferAppend", + "azure.ai.voiceagents.models.VoiceAgentClientEventInputAudioBufferClear": "Azure.AI.Projects.VoiceAgentClientEventInputAudioBufferClear", + "azure.ai.voiceagents.models.VoiceAgentClientEventInputAudioBufferCommit": "Azure.AI.Projects.VoiceAgentClientEventInputAudioBufferCommit", + "azure.ai.voiceagents.models.VoiceAgentClientEventOutputAudioBufferClear": "Azure.AI.Projects.VoiceAgentClientEventOutputAudioBufferClear", + "azure.ai.voiceagents.models.VoiceAgentClientEventResponseCancel": "Azure.AI.Projects.VoiceAgentClientEventResponseCancel", + "azure.ai.voiceagents.models.VoiceAgentClientEventResponseCreate": "Azure.AI.Projects.VoiceAgentClientEventResponseCreate", + "azure.ai.voiceagents.models.VoiceAgentClientEventSessionAvatarConnect": "Azure.AI.Projects.VoiceAgentClientEventSessionAvatarConnect", + "azure.ai.voiceagents.models.VoiceAgentClientEventSessionUpdate": "Azure.AI.Projects.VoiceAgentClientEventSessionUpdate", + "azure.ai.voiceagents.models.VoiceAgentDefinition": "Azure.AI.Projects.VoiceAgentDefinition", + "azure.ai.voiceagents.models.VoiceAgentEchoCancellation": "Azure.AI.Projects.VoiceAgentEchoCancellation", + "azure.ai.voiceagents.models.VoiceAgentEndOfUtteranceDetection": "Azure.AI.Projects.VoiceAgentEndOfUtteranceDetection", + "azure.ai.voiceagents.models.VoiceAgentEstimatedCost": "Azure.AI.Projects.VoiceAgentEstimatedCost", + "azure.ai.voiceagents.models.VoiceAgentFileSearchCallItem": "Azure.AI.Projects.VoiceAgentFileSearchCallItem", + "azure.ai.voiceagents.models.VoiceAgentFileSearchResult": "Azure.AI.Projects.VoiceAgentFileSearchResult", + "azure.ai.voiceagents.models.VoiceAgentHandoffEdgeConfig": "Azure.AI.Projects.VoiceAgentHandoffEdgeConfig", + "azure.ai.voiceagents.models.VoiceAgentHandoffEdgeState": "Azure.AI.Projects.VoiceAgentHandoffEdgeState", + "azure.ai.voiceagents.models.VoiceAgentHandoffGraphConfig": "Azure.AI.Projects.VoiceAgentHandoffGraphConfig", + "azure.ai.voiceagents.models.VoiceAgentHandoffNodeConfig": "Azure.AI.Projects.VoiceAgentHandoffNodeConfig", + "azure.ai.voiceagents.models.VoiceAgentHandoffNodeSessionConfig": "Azure.AI.Projects.VoiceAgentHandoffNodeSessionConfig", + "azure.ai.voiceagents.models.VoiceAgentHandoffNodeState": "Azure.AI.Projects.VoiceAgentHandoffNodeState", + "azure.ai.voiceagents.models.VoiceAgentHandoffState": "Azure.AI.Projects.VoiceAgentHandoffState", + "azure.ai.voiceagents.models.VoiceAgentInterimResponseConfig": "Azure.AI.Projects.VoiceAgentInterimResponseConfig", + "azure.ai.voiceagents.models.VoiceAgentLlmInterimResponseConfig": "Azure.AI.Projects.VoiceAgentLlmInterimResponseConfig", + "azure.ai.voiceagents.models.VoiceAgentMcpAssignedManagedIdentity": "Azure.AI.Projects.VoiceAgentMcpAssignedManagedIdentity", + "azure.ai.voiceagents.models.VoiceAgentMcpTool": "Azure.AI.Projects.VoiceAgentMcpTool", + "azure.ai.voiceagents.models.VoiceAgentObject": "Azure.AI.Projects.VoiceAgentObject", + "azure.ai.voiceagents.models.VoiceAgentObjectVersions": "Azure.AI.Projects.VoiceAgentObject.versions.anonymous", + "azure.ai.voiceagents.models.VoiceAgentRealtimeResponse": "Azure.AI.Projects.VoiceAgentRealtimeResponse", + "azure.ai.voiceagents.models.VoiceAgentResponseCreateAudio": "Azure.AI.Projects.VoiceAgentResponseCreateAudio", + "azure.ai.voiceagents.models.VoiceAgentResponseCreateParams": "Azure.AI.Projects.VoiceAgentResponseCreateParams", + "azure.ai.voiceagents.models.VoiceAgentResponseEventAudioContentPart": "Azure.AI.Projects.VoiceAgentResponseEventAudioContentPart", + "azure.ai.voiceagents.models.VoiceAgentResponseEventTextContentPart": "Azure.AI.Projects.VoiceAgentResponseEventTextContentPart", + "azure.ai.voiceagents.models.VoiceAgentSemanticVadTurnDetection": "Azure.AI.Projects.VoiceAgentSemanticVadTurnDetection", + "azure.ai.voiceagents.models.VoiceAgentServerEventConversationCreated": "Azure.AI.Projects.VoiceAgentServerEventConversationCreated", + "azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemAdded": "Azure.AI.Projects.VoiceAgentServerEventConversationItemAdded", + "azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemCreated": "Azure.AI.Projects.VoiceAgentServerEventConversationItemCreated", + "azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemDeleted": "Azure.AI.Projects.VoiceAgentServerEventConversationItemDeleted", + "azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemDone": "Azure.AI.Projects.VoiceAgentServerEventConversationItemDone", + "azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted": "Azure.AI.Projects.VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted", + "azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta": "Azure.AI.Projects.VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta", + "azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed": "Azure.AI.Projects.VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed", + "azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment": "Azure.AI.Projects.VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment", + "azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemRetrieved": "Azure.AI.Projects.VoiceAgentServerEventConversationItemRetrieved", + "azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemTruncated": "Azure.AI.Projects.VoiceAgentServerEventConversationItemTruncated", + "azure.ai.voiceagents.models.VoiceAgentServerEventError": "Azure.AI.Projects.VoiceAgentServerEventError", + "azure.ai.voiceagents.models.VoiceAgentServerEventErrorDetails": "Azure.AI.Projects.VoiceAgentServerEventErrorDetails", + "azure.ai.voiceagents.models.VoiceAgentServerEventFileSearchCallCompleted": "Azure.AI.Projects.VoiceAgentServerEventFileSearchCallCompleted", + "azure.ai.voiceagents.models.VoiceAgentServerEventFileSearchCallInProgress": "Azure.AI.Projects.VoiceAgentServerEventFileSearchCallInProgress", + "azure.ai.voiceagents.models.VoiceAgentServerEventFileSearchCallSearching": "Azure.AI.Projects.VoiceAgentServerEventFileSearchCallSearching", + "azure.ai.voiceagents.models.VoiceAgentServerEventInputAudioBufferCleared": "Azure.AI.Projects.VoiceAgentServerEventInputAudioBufferCleared", + "azure.ai.voiceagents.models.VoiceAgentServerEventInputAudioBufferCommitted": "Azure.AI.Projects.VoiceAgentServerEventInputAudioBufferCommitted", + "azure.ai.voiceagents.models.VoiceAgentServerEventInputAudioBufferSpeechStarted": "Azure.AI.Projects.VoiceAgentServerEventInputAudioBufferSpeechStarted", + "azure.ai.voiceagents.models.VoiceAgentServerEventInputAudioBufferSpeechStopped": "Azure.AI.Projects.VoiceAgentServerEventInputAudioBufferSpeechStopped", + "azure.ai.voiceagents.models.VoiceAgentServerEventInputAudioBufferTimeoutTriggered": "Azure.AI.Projects.VoiceAgentServerEventInputAudioBufferTimeoutTriggered", + "azure.ai.voiceagents.models.VoiceAgentServerEventMcpListToolsCompleted": "Azure.AI.Projects.VoiceAgentServerEventMcpListToolsCompleted", + "azure.ai.voiceagents.models.VoiceAgentServerEventMcpListToolsFailed": "Azure.AI.Projects.VoiceAgentServerEventMcpListToolsFailed", + "azure.ai.voiceagents.models.VoiceAgentServerEventMcpListToolsInProgress": "Azure.AI.Projects.VoiceAgentServerEventMcpListToolsInProgress", + "azure.ai.voiceagents.models.VoiceAgentServerEventOutputAudioBufferCleared": "Azure.AI.Projects.VoiceAgentServerEventOutputAudioBufferCleared", + "azure.ai.voiceagents.models.VoiceAgentServerEventRateLimitsUpdated": "Azure.AI.Projects.VoiceAgentServerEventRateLimitsUpdated", + "azure.ai.voiceagents.models.VoiceAgentServerEventResponseAnimationBlendshapesDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseAnimationBlendshapesDelta", + "azure.ai.voiceagents.models.VoiceAgentServerEventResponseAnimationBlendshapesDone": "Azure.AI.Projects.VoiceAgentServerEventResponseAnimationBlendshapesDone", + "azure.ai.voiceagents.models.VoiceAgentServerEventResponseAnimationVisemeDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseAnimationVisemeDelta", + "azure.ai.voiceagents.models.VoiceAgentServerEventResponseAnimationVisemeDone": "Azure.AI.Projects.VoiceAgentServerEventResponseAnimationVisemeDone", + "azure.ai.voiceagents.models.VoiceAgentServerEventResponseAudioDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseAudioDelta", + "azure.ai.voiceagents.models.VoiceAgentServerEventResponseAudioDone": "Azure.AI.Projects.VoiceAgentServerEventResponseAudioDone", + "azure.ai.voiceagents.models.VoiceAgentServerEventResponseAudioTimestampDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseAudioTimestampDelta", + "azure.ai.voiceagents.models.VoiceAgentServerEventResponseAudioTimestampDone": "Azure.AI.Projects.VoiceAgentServerEventResponseAudioTimestampDone", + "azure.ai.voiceagents.models.VoiceAgentServerEventResponseAudioTranscriptDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseAudioTranscriptDelta", + "azure.ai.voiceagents.models.VoiceAgentServerEventResponseAudioTranscriptDone": "Azure.AI.Projects.VoiceAgentServerEventResponseAudioTranscriptDone", + "azure.ai.voiceagents.models.VoiceAgentServerEventResponseContentPartDone": "Azure.AI.Projects.VoiceAgentServerEventResponseContentPartDone", + "azure.ai.voiceagents.models.VoiceAgentServerEventResponseCreated": "Azure.AI.Projects.VoiceAgentServerEventResponseCreated", + "azure.ai.voiceagents.models.VoiceAgentServerEventResponseDone": "Azure.AI.Projects.VoiceAgentServerEventResponseDone", + "azure.ai.voiceagents.models.VoiceAgentServerEventResponseFunctionCallArgumentsDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseFunctionCallArgumentsDelta", + "azure.ai.voiceagents.models.VoiceAgentServerEventResponseFunctionCallArgumentsDone": "Azure.AI.Projects.VoiceAgentServerEventResponseFunctionCallArgumentsDone", + "azure.ai.voiceagents.models.VoiceAgentServerEventResponseMcpCallArgumentsDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseMcpCallArgumentsDelta", + "azure.ai.voiceagents.models.VoiceAgentServerEventResponseMcpCallArgumentsDone": "Azure.AI.Projects.VoiceAgentServerEventResponseMcpCallArgumentsDone", + "azure.ai.voiceagents.models.VoiceAgentServerEventResponseMcpCallCompleted": "Azure.AI.Projects.VoiceAgentServerEventResponseMcpCallCompleted", + "azure.ai.voiceagents.models.VoiceAgentServerEventResponseMcpCallFailed": "Azure.AI.Projects.VoiceAgentServerEventResponseMcpCallFailed", + "azure.ai.voiceagents.models.VoiceAgentServerEventResponseMcpCallInProgress": "Azure.AI.Projects.VoiceAgentServerEventResponseMcpCallInProgress", + "azure.ai.voiceagents.models.VoiceAgentServerEventResponseOutputItemAdded": "Azure.AI.Projects.VoiceAgentServerEventResponseOutputItemAdded", + "azure.ai.voiceagents.models.VoiceAgentServerEventResponseOutputItemDone": "Azure.AI.Projects.VoiceAgentServerEventResponseOutputItemDone", + "azure.ai.voiceagents.models.VoiceAgentServerEventResponseTextDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseTextDelta", + "azure.ai.voiceagents.models.VoiceAgentServerEventResponseTextDone": "Azure.AI.Projects.VoiceAgentServerEventResponseTextDone", + "azure.ai.voiceagents.models.VoiceAgentServerEventResponseVideoDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseVideoDelta", + "azure.ai.voiceagents.models.VoiceAgentServerEventSessionAvatarConnecting": "Azure.AI.Projects.VoiceAgentServerEventSessionAvatarConnecting", + "azure.ai.voiceagents.models.VoiceAgentServerEventSessionAvatarSwitchToIdle": "Azure.AI.Projects.VoiceAgentServerEventSessionAvatarSwitchToIdle", + "azure.ai.voiceagents.models.VoiceAgentServerEventSessionAvatarSwitchToSpeaking": "Azure.AI.Projects.VoiceAgentServerEventSessionAvatarSwitchToSpeaking", + "azure.ai.voiceagents.models.VoiceAgentServerEventSessionCreated": "Azure.AI.Projects.VoiceAgentServerEventSessionCreated", + "azure.ai.voiceagents.models.VoiceAgentServerEventSessionHandoffAborted": "Azure.AI.Projects.VoiceAgentServerEventSessionHandoffAborted", + "azure.ai.voiceagents.models.VoiceAgentServerEventSessionHandoffCompleted": "Azure.AI.Projects.VoiceAgentServerEventSessionHandoffCompleted", + "azure.ai.voiceagents.models.VoiceAgentServerEventSessionHandoffStarted": "Azure.AI.Projects.VoiceAgentServerEventSessionHandoffStarted", + "azure.ai.voiceagents.models.VoiceAgentServerEventSessionUpdated": "Azure.AI.Projects.VoiceAgentServerEventSessionUpdated", + "azure.ai.voiceagents.models.VoiceAgentServerEventWarning": "Azure.AI.Projects.VoiceAgentServerEventWarning", + "azure.ai.voiceagents.models.VoiceAgentServerEventWarningDetails": "Azure.AI.Projects.VoiceAgentServerEventWarningDetails", + "azure.ai.voiceagents.models.VoiceAgentServerEventWebSearchCallCompleted": "Azure.AI.Projects.VoiceAgentServerEventWebSearchCallCompleted", + "azure.ai.voiceagents.models.VoiceAgentServerEventWebSearchCallInProgress": "Azure.AI.Projects.VoiceAgentServerEventWebSearchCallInProgress", + "azure.ai.voiceagents.models.VoiceAgentServerEventWebSearchCallSearching": "Azure.AI.Projects.VoiceAgentServerEventWebSearchCallSearching", + "azure.ai.voiceagents.models.VoiceAgentServerVadTurnDetection": "Azure.AI.Projects.VoiceAgentServerVadTurnDetection", + "azure.ai.voiceagents.models.VoiceAgentSessionAvatarConfig": "Azure.AI.Projects.VoiceAgentSessionAvatarConfig", + "azure.ai.voiceagents.models.VoiceAgentSessionMcpTool": "Azure.AI.Projects.VoiceAgentSessionMcpTool", + "azure.ai.voiceagents.models.VoiceAgentSessionResponseAudio": "Azure.AI.Projects.VoiceAgentSessionResponseAudio", + "azure.ai.voiceagents.models.VoiceAgentSessionResponseAudioInput": "Azure.AI.Projects.VoiceAgentSessionResponseAudioInput", + "azure.ai.voiceagents.models.VoiceAgentSessionResponseAudioOutput": "Azure.AI.Projects.VoiceAgentSessionResponseAudioOutput", + "azure.ai.voiceagents.models.VoiceAgentSessionResponseConfig": "Azure.AI.Projects.VoiceAgentSessionResponseConfig", + "azure.ai.voiceagents.models.VoiceAgentSessionUpdateAudio": "Azure.AI.Projects.VoiceAgentSessionUpdateAudio", + "azure.ai.voiceagents.models.VoiceAgentSessionUpdateAudioInput": "Azure.AI.Projects.VoiceAgentSessionUpdateAudioInput", + "azure.ai.voiceagents.models.VoiceAgentSessionUpdateAudioOutput": "Azure.AI.Projects.VoiceAgentSessionUpdateAudioOutput", + "azure.ai.voiceagents.models.VoiceAgentSessionUpdateConfig": "Azure.AI.Projects.VoiceAgentSessionUpdateConfig", + "azure.ai.voiceagents.models.VoiceAgentStaticInterimResponseConfig": "Azure.AI.Projects.VoiceAgentStaticInterimResponseConfig", + "azure.ai.voiceagents.models.VoiceAgentTranscriptionPhrase": "Azure.AI.Projects.VoiceAgentTranscriptionPhrase", + "azure.ai.voiceagents.models.VoiceAgentTranscriptionWord": "Azure.AI.Projects.VoiceAgentTranscriptionWord", + "azure.ai.voiceagents.models.VoiceAgentVersionObject": "Azure.AI.Projects.VoiceAgentVersionObject", + "azure.ai.voiceagents.models.VoiceAgentVoiceAdaptation": "Azure.AI.Projects.VoiceAgentVoiceAdaptation", + "azure.ai.voiceagents.models.VoiceAgentWebSearchActionFind": "Azure.AI.Projects.VoiceAgentWebSearchActionFind", + "azure.ai.voiceagents.models.VoiceAgentWebSearchActionOpenPage": "Azure.AI.Projects.VoiceAgentWebSearchActionOpenPage", + "azure.ai.voiceagents.models.VoiceAgentWebSearchActionSearch": "Azure.AI.Projects.VoiceAgentWebSearchActionSearch", + "azure.ai.voiceagents.models.VoiceAgentWebSearchCallItem": "Azure.AI.Projects.VoiceAgentWebSearchCallItem", + "azure.ai.voiceagents.models.VoiceAgentWebSearchSource": "Azure.AI.Projects.VoiceAgentWebSearchSource", + "azure.ai.voiceagents.models.VoiceAgentWorkflowActionItem": "Azure.AI.Projects.VoiceAgentWorkflowActionItem", + "azure.ai.voiceagents.models.VoiceConversationItem": "Azure.AI.Projects.VoiceConversationItem", + "azure.ai.voiceagents.models.VoiceMessageItem": "Azure.AI.Projects.VoiceMessageItem", + "azure.ai.voiceagents.models.VoiceAssistantMessageItem": "Azure.AI.Projects.VoiceAssistantMessageItem", + "azure.ai.voiceagents.models.VoiceAudioConfig": "Azure.AI.Projects.VoiceAudioConfig", + "azure.ai.voiceagents.models.VoiceAudioFormat": "Azure.AI.Projects.VoiceAudioFormat", + "azure.ai.voiceagents.models.VoiceAudioInputConfig": "Azure.AI.Projects.VoiceAudioInputConfig", + "azure.ai.voiceagents.models.VoiceAudioOutputConfig": "Azure.AI.Projects.VoiceAudioOutputConfig", + "azure.ai.voiceagents.models.VoiceAvatarConfig": "Azure.AI.Projects.VoiceAvatarConfig", + "azure.ai.voiceagents.models.VoiceEndOfUtteranceDetection": "Azure.AI.Projects.VoiceEndOfUtteranceDetection", + "azure.ai.voiceagents.models.VoiceAzureSemanticDetection": "Azure.AI.Projects.VoiceAzureSemanticDetection", + "azure.ai.voiceagents.models.VoiceAzureSemanticDetectionEn": "Azure.AI.Projects.VoiceAzureSemanticDetectionEn", + "azure.ai.voiceagents.models.VoiceAzureSemanticDetectionMultilingual": "Azure.AI.Projects.VoiceAzureSemanticDetectionMultilingual", + "azure.ai.voiceagents.models.VoiceTurnDetection": "Azure.AI.Projects.VoiceTurnDetection", + "azure.ai.voiceagents.models.VoiceAzureSemanticVadEnTurnDetection": "Azure.AI.Projects.VoiceAzureSemanticVadEnTurnDetection", + "azure.ai.voiceagents.models.VoiceAzureSemanticVadMultilingualTurnDetection": "Azure.AI.Projects.VoiceAzureSemanticVadMultilingualTurnDetection", + "azure.ai.voiceagents.models.VoiceAzureSemanticVadTurnDetection": "Azure.AI.Projects.VoiceAzureSemanticVadTurnDetection", + "azure.ai.voiceagents.models.VoiceConversation": "Azure.AI.Projects.VoiceConversation", + "azure.ai.voiceagents.models.VoiceFunctionCallItem": "Azure.AI.Projects.VoiceFunctionCallItem", + "azure.ai.voiceagents.models.VoiceFunctionCallOutputItem": "Azure.AI.Projects.VoiceFunctionCallOutputItem", + "azure.ai.voiceagents.models.VoiceInputTranscription": "Azure.AI.Projects.VoiceInputTranscription", + "azure.ai.voiceagents.models.VoiceItemAudioResponse": "Azure.AI.Projects.VoiceItemAudioResponse", + "azure.ai.voiceagents.models.VoiceMcpApprovalRequestItem": "Azure.AI.Projects.VoiceMcpApprovalRequestItem", + "azure.ai.voiceagents.models.VoiceMcpApprovalResponseItem": "Azure.AI.Projects.VoiceMcpApprovalResponseItem", + "azure.ai.voiceagents.models.VoiceMcpCallItem": "Azure.AI.Projects.VoiceMcpCallItem", + "azure.ai.voiceagents.models.VoiceMcpListToolsItem": "Azure.AI.Projects.VoiceMcpListToolsItem", + "azure.ai.voiceagents.models.VoiceNoiseReduction": "Azure.AI.Projects.VoiceNoiseReduction", + "azure.ai.voiceagents.models.VoiceRecordingChannelLayout": "Azure.AI.Projects.VoiceRecordingChannelLayout", + "azure.ai.voiceagents.models.VoiceRecordingResponse": "Azure.AI.Projects.VoiceRecordingResponse", + "azure.ai.voiceagents.models.VoiceResponse": "Azure.AI.Projects.VoiceResponse", + "azure.ai.voiceagents.models.VoiceResponseAudio": "Azure.AI.Projects.VoiceResponseAudio", + "azure.ai.voiceagents.models.VoiceResponseAudioOutput": "Azure.AI.Projects.VoiceResponseAudioOutput", + "azure.ai.voiceagents.models.VoiceSemanticVadTurnDetection": "Azure.AI.Projects.VoiceSemanticVadTurnDetection", + "azure.ai.voiceagents.models.VoiceServerVadTurnDetection": "Azure.AI.Projects.VoiceServerVadTurnDetection", + "azure.ai.voiceagents.models.VoiceSystemMessageItem": "Azure.AI.Projects.VoiceSystemMessageItem", + "azure.ai.voiceagents.models.VoiceSystemTool": "Azure.AI.Projects.VoiceSystemTool", + "azure.ai.voiceagents.models.VoiceToolboxTool": "Azure.AI.Projects.VoiceToolboxTool", + "azure.ai.voiceagents.models.VoiceUserMessageItem": "Azure.AI.Projects.VoiceUserMessageItem", + "azure.ai.voiceagents.models.VoiceAgentWebSocketSubprotocol": "Azure.AI.Projects.VoiceAgentWebSocketSubprotocol", + "azure.ai.voiceagents.models.AgentDefinitionOptInKeys": "Azure.AI.Projects.AgentDefinitionOptInKeys", + "azure.ai.voiceagents.models.VoiceConversationStatus": "Azure.AI.Projects.VoiceConversationStatus", + "azure.ai.voiceagents.models.VoiceResponseStatus": "Azure.AI.Projects.VoiceResponseStatus", + "azure.ai.voiceagents.models.VoiceConversationItemType": "Azure.AI.Projects.VoiceConversationItemType", + "azure.ai.voiceagents.models.RealtimeMcpErrorType": "OpenAI.RealtimeMcpErrorType", + "azure.ai.voiceagents.models.RealtimeConversationItemMessageType": "OpenAI.RealtimeConversationItemMessageType", + "azure.ai.voiceagents.models.VoiceIdsShared": "OpenAI.VoiceIdsShared", + "azure.ai.voiceagents.models.AzureVoiceType": "Azure.AI.Projects.AzureVoiceType", + "azure.ai.voiceagents.models.PersonalVoiceModel": "Azure.AI.Projects.PersonalVoiceModel", + "azure.ai.voiceagents.models.AzureRealtimeNativeVoiceName": "Azure.AI.Projects.AzureRealtimeNativeVoiceName", + "azure.ai.voiceagents.models.RealtimeAudioFormatsType": "OpenAI.RealtimeAudioFormatsType", + "azure.ai.voiceagents.models.PageOrder": "Azure.AI.Projects.PageOrder", + "azure.ai.voiceagents.models.VoiceAudioRole": "Azure.AI.Projects.VoiceAudioRole", + "azure.ai.voiceagents.models.VoiceAudioContainerFormat": "Azure.AI.Projects.VoiceAudioContainerFormat", + "azure.ai.voiceagents.models.VoiceAudioCodec": "Azure.AI.Projects.VoiceAudioCodec", + "azure.ai.voiceagents.models.AgentObjectType": "Azure.AI.Projects.AgentObjectType", + "azure.ai.voiceagents.models.AgentState": "Azure.AI.Projects.AgentState", + "azure.ai.voiceagents.models.AgentStateSource": "Azure.AI.Projects.AgentStateSource", + "azure.ai.voiceagents.models.VersionSelectorType": "Azure.AI.Projects.VersionSelectorType", + "azure.ai.voiceagents.models.AgentEndpointAuthorizationSchemeType": "Azure.AI.Projects.AgentEndpointAuthorizationSchemeType", + "azure.ai.voiceagents.models.AgentIdentityStatus": "Azure.AI.Projects.AgentIdentityStatus", + "azure.ai.voiceagents.models.AgentBlueprintReferenceType": "Azure.AI.Projects.AgentBlueprintReferenceType", + "azure.ai.voiceagents.models.AgentVersionStatus": "Azure.AI.Projects.AgentVersionStatus", + "azure.ai.voiceagents.models.VoiceModelType": "Azure.AI.Projects.VoiceModelType", + "azure.ai.voiceagents.models.VoiceGreetingToolChoice": "Azure.AI.Projects.VoiceGreetingToolChoice", + "azure.ai.voiceagents.models.VoiceAudioFormatType": "Azure.AI.Projects.VoiceAudioFormatType", + "azure.ai.voiceagents.models.VoiceNoiseReductionType": "Azure.AI.Projects.VoiceNoiseReductionType", + "azure.ai.voiceagents.models.VoiceTurnDetectionType": "Azure.AI.Projects.VoiceTurnDetectionType", + "azure.ai.voiceagents.models.VoiceEndOfUtteranceDetectionModel": "Azure.AI.Projects.VoiceEndOfUtteranceDetectionModel", + "azure.ai.voiceagents.models.VoiceEndOfUtteranceThresholdLevel": "Azure.AI.Projects.VoiceEndOfUtteranceThresholdLevel", + "azure.ai.voiceagents.models.VoiceInputTranscriptionModel": "Azure.AI.Projects.VoiceInputTranscriptionModel", + "azure.ai.voiceagents.models.VoiceAudioTimestampType": "Azure.AI.Projects.VoiceAudioTimestampType", + "azure.ai.voiceagents.models.VoiceOutputModality": "Azure.AI.Projects.VoiceOutputModality", + "azure.ai.voiceagents.models.VoiceAvatarType": "Azure.AI.Projects.VoiceAvatarType", + "azure.ai.voiceagents.models.VoiceAvatarOutputProtocol": "Azure.AI.Projects.VoiceAvatarOutputProtocol", + "azure.ai.voiceagents.models.ToolType": "OpenAI.ToolType", + "azure.ai.voiceagents.models.CallableToolAllowedCaller": "OpenAI.CallableToolAllowedCaller", + "azure.ai.voiceagents.models.VoiceAgentMcpResponseScheduling": "Azure.AI.Projects.VoiceAgentMcpResponseScheduling", + "azure.ai.voiceagents.models.VoiceSystemToolName": "Azure.AI.Projects.VoiceSystemToolName", + "azure.ai.voiceagents.models.VoiceAgentType": "Azure.AI.Projects.VoiceAgentType", + "azure.ai.voiceagents.models.VoiceAgentUseCase": "Azure.AI.Projects.VoiceAgentUseCase", + "azure.ai.voiceagents.models.RealtimeClientEventType": "OpenAI.RealtimeClientEventType", + "azure.ai.voiceagents.models.RealtimeConversationItemType": "OpenAI.RealtimeConversationItemType", + "azure.ai.voiceagents.models.ToolChoiceOptions": "OpenAI.ToolChoiceOptions", + "azure.ai.voiceagents.models.ToolChoiceParamType": "OpenAI.ToolChoiceParamType", + "azure.ai.voiceagents.models.RealtimeReasoningEffort": "OpenAI.RealtimeReasoningEffort", + "azure.ai.voiceagents.models.VoiceAgentInterimResponseTrigger": "Azure.AI.Projects.VoiceAgentInterimResponseTrigger", + "azure.ai.voiceagents.models.VoiceAgentEndOfUtteranceModel": "Azure.AI.Projects.VoiceAgentEndOfUtteranceModel", + "azure.ai.voiceagents.models.VoiceAgentEndOfUtteranceThresholdLevel": "Azure.AI.Projects.VoiceAgentEndOfUtteranceThresholdLevel", + "azure.ai.voiceagents.models.VoiceAgentAzureSemanticVadType": "Azure.AI.Projects.VoiceAgentAzureSemanticVadType", + "azure.ai.voiceagents.models.VoiceAgentEchoCancellationReferenceSource": "Azure.AI.Projects.VoiceAgentEchoCancellationReferenceSource", + "azure.ai.voiceagents.models.VoiceAgentAvatarType": "Azure.AI.Projects.VoiceAgentAvatarType", + "azure.ai.voiceagents.models.VoiceAgentAvatarOutputProtocol": "Azure.AI.Projects.VoiceAgentAvatarOutputProtocol", + "azure.ai.voiceagents.models.VoiceAgentAnimationOutputType": "Azure.AI.Projects.VoiceAgentAnimationOutputType", + "azure.ai.voiceagents.models.VoiceAgentMcpApprovalMode": "Azure.AI.Projects.VoiceAgentMcpApprovalMode", + "azure.ai.voiceagents.models.VoiceAgentSessionIncludeOption": "Azure.AI.Projects.VoiceAgentSessionIncludeOption", + "azure.ai.voiceagents.models.VoiceAgentHandoffReasoningEffort": "Azure.AI.Projects.VoiceAgentHandoffReasoningEffort", + "azure.ai.voiceagents.models.VoiceAgentHandoffTargetResponse": "Azure.AI.Projects.VoiceAgentHandoffTargetResponse", + "azure.ai.voiceagents.models.RealtimeServerEventType": "OpenAI.RealtimeServerEventType", + "azure.ai.voiceagents.models.VoiceAgentWebSearchCallStatus": "Azure.AI.Projects.VoiceAgentWebSearchCallStatus", + "azure.ai.voiceagents.models.VoiceAgentFileSearchCallStatus": "Azure.AI.Projects.VoiceAgentFileSearchCallStatus", + "azure.ai.voiceagents.models.CreateTranscriptionResponseJsonUsageType": "OpenAI.CreateTranscriptionResponseJsonUsageType", + "azure.ai.voiceagents.models.VoiceAgentResponseStatus": "Azure.AI.Projects.VoiceAgentResponseStatus", + "azure.ai.voiceagents.models.VoiceAgentEstimatedCostStatus": "Azure.AI.Projects.VoiceAgentEstimatedCostStatus", + "azure.ai.voiceagents.models.VoiceAgentResponseAudioFormat": "Azure.AI.Projects.VoiceAgentResponseAudioFormat", + "azure.ai.voiceagents.models.VoiceAgentPipelineFamily": "Azure.AI.Projects.VoiceAgentPipelineFamily", + "azure.ai.voiceagents.models.VoiceAgentHandoffAbortReason": "Azure.AI.Projects.VoiceAgentHandoffAbortReason", + "azure.ai.voiceagents.operations.VoiceAgentWebSocketOperations.connect_voice_agent": "Azure.AI.Projects.VoiceAgentWebSocket.connectVoiceAgent", + "azure.ai.voiceagents.aio.operations.VoiceAgentWebSocketOperations.connect_voice_agent": "Azure.AI.Projects.VoiceAgentWebSocket.connectVoiceAgent", + "azure.ai.voiceagents.operations.AgentEndpointConversationsOperations.get_agent_conversation": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversation", + "azure.ai.voiceagents.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversation", + "azure.ai.voiceagents.operations.AgentEndpointConversationsOperations.delete_agent_conversation": "Azure.AI.Projects.AgentEndpointConversations.deleteAgentConversation", + "azure.ai.voiceagents.aio.operations.AgentEndpointConversationsOperations.delete_agent_conversation": "Azure.AI.Projects.AgentEndpointConversations.deleteAgentConversation", + "azure.ai.voiceagents.operations.AgentEndpointConversationsOperations.list_agent_conversation_responses": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversationResponses", + "azure.ai.voiceagents.aio.operations.AgentEndpointConversationsOperations.list_agent_conversation_responses": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversationResponses", + "azure.ai.voiceagents.operations.AgentEndpointConversationsOperations.get_agent_conversation_response": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationResponse", + "azure.ai.voiceagents.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_response": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationResponse", + "azure.ai.voiceagents.operations.AgentEndpointConversationsOperations.list_agent_conversation_response_items": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversationResponseItems", + "azure.ai.voiceagents.aio.operations.AgentEndpointConversationsOperations.list_agent_conversation_response_items": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversationResponseItems", + "azure.ai.voiceagents.operations.AgentEndpointConversationsOperations.list_agent_conversation_items": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversationItems", + "azure.ai.voiceagents.aio.operations.AgentEndpointConversationsOperations.list_agent_conversation_items": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversationItems", + "azure.ai.voiceagents.operations.AgentEndpointConversationsOperations.get_agent_conversation_item": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItem", + "azure.ai.voiceagents.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_item": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItem", + "azure.ai.voiceagents.operations.AgentEndpointConversationsOperations.get_agent_conversation_item_audio": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItemAudio", + "azure.ai.voiceagents.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_item_audio": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItemAudio", + "azure.ai.voiceagents.operations.AgentEndpointConversationsOperations.get_agent_conversation_item_audio_content": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItemAudioContent", + "azure.ai.voiceagents.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_item_audio_content": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItemAudioContent", + "azure.ai.voiceagents.operations.AgentEndpointConversationsOperations.get_agent_conversation_audio": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationAudio", + "azure.ai.voiceagents.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_audio": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationAudio", + "azure.ai.voiceagents.operations.AgentEndpointConversationsOperations.get_agent_conversation_audio_content": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationAudioContent", + "azure.ai.voiceagents.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_audio_content": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationAudioContent", + "azure.ai.voiceagents.operations.VoiceAgentsOperations.create_voice_agent": "Azure.AI.Projects.VoiceAgents.createVoiceAgent", + "azure.ai.voiceagents.aio.operations.VoiceAgentsOperations.create_voice_agent": "Azure.AI.Projects.VoiceAgents.createVoiceAgent", + "azure.ai.voiceagents.operations.VoiceAgentsOperations.list_voice_agents": "Azure.AI.Projects.VoiceAgents.listVoiceAgents", + "azure.ai.voiceagents.aio.operations.VoiceAgentsOperations.list_voice_agents": "Azure.AI.Projects.VoiceAgents.listVoiceAgents", + "azure.ai.voiceagents.operations.VoiceAgentsOperations.get_voice_agent": "Azure.AI.Projects.VoiceAgents.getVoiceAgent", + "azure.ai.voiceagents.aio.operations.VoiceAgentsOperations.get_voice_agent": "Azure.AI.Projects.VoiceAgents.getVoiceAgent", + "azure.ai.voiceagents.operations.VoiceAgentsOperations.update_voice_agent": "Azure.AI.Projects.VoiceAgents.updateVoiceAgent", + "azure.ai.voiceagents.aio.operations.VoiceAgentsOperations.update_voice_agent": "Azure.AI.Projects.VoiceAgents.updateVoiceAgent", + "azure.ai.voiceagents.operations.VoiceAgentsOperations.delete_voice_agent": "Azure.AI.Projects.VoiceAgents.deleteVoiceAgent", + "azure.ai.voiceagents.aio.operations.VoiceAgentsOperations.delete_voice_agent": "Azure.AI.Projects.VoiceAgents.deleteVoiceAgent", + "azure.ai.voiceagents.operations.VoiceAgentsOperations.enable_voice_agent": "Azure.AI.Projects.VoiceAgents.enableVoiceAgent", + "azure.ai.voiceagents.aio.operations.VoiceAgentsOperations.enable_voice_agent": "Azure.AI.Projects.VoiceAgents.enableVoiceAgent", + "azure.ai.voiceagents.operations.VoiceAgentsOperations.disable_voice_agent": "Azure.AI.Projects.VoiceAgents.disableVoiceAgent", + "azure.ai.voiceagents.aio.operations.VoiceAgentsOperations.disable_voice_agent": "Azure.AI.Projects.VoiceAgents.disableVoiceAgent", + "azure.ai.voiceagents.operations.VoiceAgentsOperations.generate_voice_agent": "Azure.AI.Projects.VoiceAgents.generateVoiceAgent", + "azure.ai.voiceagents.aio.operations.VoiceAgentsOperations.generate_voice_agent": "Azure.AI.Projects.VoiceAgents.generateVoiceAgent", + "azure.ai.voiceagents.operations.VoiceAgentsOperations.create_voice_agent_version": "Azure.AI.Projects.VoiceAgents.createVoiceAgentVersion", + "azure.ai.voiceagents.aio.operations.VoiceAgentsOperations.create_voice_agent_version": "Azure.AI.Projects.VoiceAgents.createVoiceAgentVersion", + "azure.ai.voiceagents.operations.VoiceAgentsOperations.list_voice_agent_versions": "Azure.AI.Projects.VoiceAgents.listVoiceAgentVersions", + "azure.ai.voiceagents.aio.operations.VoiceAgentsOperations.list_voice_agent_versions": "Azure.AI.Projects.VoiceAgents.listVoiceAgentVersions", + "azure.ai.voiceagents.operations.VoiceAgentsOperations.get_voice_agent_version": "Azure.AI.Projects.VoiceAgents.getVoiceAgentVersion", + "azure.ai.voiceagents.aio.operations.VoiceAgentsOperations.get_voice_agent_version": "Azure.AI.Projects.VoiceAgents.getVoiceAgentVersion", + "azure.ai.voiceagents.operations.VoiceAgentsOperations.delete_voice_agent_version": "Azure.AI.Projects.VoiceAgents.deleteVoiceAgentVersion", + "azure.ai.voiceagents.aio.operations.VoiceAgentsOperations.delete_voice_agent_version": "Azure.AI.Projects.VoiceAgents.deleteVoiceAgentVersion" + }, + "CrossLanguageVersion": "a102b6cbed5d" +} \ No newline at end of file diff --git a/sdk/voiceagents/azure-ai-voiceagents/assets.json b/sdk/voiceagents/azure-ai-voiceagents/assets.json new file mode 100644 index 000000000000..dfa38fec545d --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/assets.json @@ -0,0 +1,6 @@ +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "python", + "TagPrefix": "python/ai/azure-ai-voiceagents", + "Tag": "python/ai/azure-ai-voiceagents_367084ae9e" +} diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/__init__.py b/sdk/voiceagents/azure-ai-voiceagents/azure/__init__.py new file mode 100644 index 000000000000..d55ccad1f573 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/__init__.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/__init__.py new file mode 100644 index 000000000000..d55ccad1f573 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/__init__.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/__init__.py new file mode 100644 index 000000000000..99bf20879f5b --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/__init__.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import VoiceAgentsClient # type: ignore +from ._version import VERSION + +__version__ = VERSION + +try: + from ._patch import __all__ as _patch_all + from ._patch import * +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "VoiceAgentsClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore + +_patch_sdk() diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_client.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_client.py new file mode 100644 index 000000000000..b378f1a3a9f9 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_client.py @@ -0,0 +1,122 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +import sys +from typing import Any, TYPE_CHECKING + +from azure.core import PipelineClient +from azure.core.pipeline import policies +from azure.core.rest import HttpRequest, HttpResponse + +from ._configuration import VoiceAgentsClientConfiguration +from ._utils.serialization import Deserializer, Serializer +from .operations import AgentEndpointConversationsOperations, VoiceAgentWebSocketOperations, VoiceAgentsOperations + +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + +if TYPE_CHECKING: + from azure.core.credentials import TokenCredential + + +class VoiceAgentsClient: # pylint: disable=docstring-keyword-should-match-keyword-only + """VoiceAgentsClient. + + :ivar voice_agent_web_socket: VoiceAgentWebSocketOperations operations + :vartype voice_agent_web_socket: azure.ai.voiceagents.operations.VoiceAgentWebSocketOperations + :ivar agent_endpoint_conversations: AgentEndpointConversationsOperations operations + :vartype agent_endpoint_conversations: + azure.ai.voiceagents.operations.AgentEndpointConversationsOperations + :ivar voice_agents: VoiceAgentsOperations operations + :vartype voice_agents: azure.ai.voiceagents.operations.VoiceAgentsOperations + :param endpoint: Foundry Project endpoint in the form + "https://{ai-services-account-name}.services.ai.azure.com/api/projects/{project-name}". If you + only have one Project in your Foundry Hub, or to target the default Project in your Hub, use + the form "https://{ai-services-account-name}.services.ai.azure.com/api/projects/_project". + Required. + :type endpoint: str + :param credential: Credential used to authenticate requests to the service. Required. + :type credential: ~azure.core.credentials.TokenCredential + :keyword api_version: The API version to use for this operation. Known values are "v1" and + None. Default value is None. If not set, the operation's default API version will be used. Note + that overriding this default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None: + _endpoint = "{endpoint}" + self._config = VoiceAgentsClientConfiguration(endpoint=endpoint, credential=credential, **kwargs) + + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: PipelineClient = PipelineClient(base_url=_endpoint, policies=_policies, **kwargs) + + self._serialize = Serializer() + self._deserialize = Deserializer() + self._serialize.client_side_validation = False + self.voice_agent_web_socket = VoiceAgentWebSocketOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.agent_endpoint_conversations = AgentEndpointConversationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.voice_agents = VoiceAgentsOperations(self._client, self._config, self._serialize, self._deserialize) + + def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client.send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.HttpResponse + """ + + request_copy = deepcopy(request) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore + + def close(self) -> None: + self._client.close() + + def __enter__(self) -> Self: + self._client.__enter__() + return self + + def __exit__(self, *exc_details: Any) -> None: + self._client.__exit__(*exc_details) diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_configuration.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_configuration.py new file mode 100644 index 000000000000..6f48c8a3aec0 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_configuration.py @@ -0,0 +1,69 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.pipeline import policies + +from ._version import VERSION + +if TYPE_CHECKING: + from azure.core.credentials import TokenCredential + + +class VoiceAgentsClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only + """Configuration for VoiceAgentsClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param endpoint: Foundry Project endpoint in the form + "https://{ai-services-account-name}.services.ai.azure.com/api/projects/{project-name}". If you + only have one Project in your Foundry Hub, or to target the default Project in your Hub, use + the form "https://{ai-services-account-name}.services.ai.azure.com/api/projects/_project". + Required. + :type endpoint: str + :param credential: Credential used to authenticate requests to the service. Required. + :type credential: ~azure.core.credentials.TokenCredential + :keyword api_version: The API version to use for this operation. Known values are "v1" and + None. Default value is None. If not set, the operation's default API version will be used. Note + that overriding this default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None: + api_version: str = kwargs.pop("api_version", "v1") + + if endpoint is None: + raise ValueError("Parameter 'endpoint' must not be None.") + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + + self.endpoint = endpoint + self.credential = credential + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://ai.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "ai-voiceagents/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_patch.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_patch.py new file mode 100644 index 000000000000..87676c65a8f0 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_patch.py @@ -0,0 +1,21 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" + + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_unions.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_unions.py new file mode 100644 index 000000000000..413865ae5ded --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_unions.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Literal, TYPE_CHECKING, Union + +if TYPE_CHECKING: + from . import models as _models +VoiceResponseVoice = Union["_models.OpenAIVoice", "_models.AzureVoice", "_models.AzureRealtimeNativeVoice"] +VoiceAgentVoice = Union["_models.OpenAIVoice", "_models.AzureVoice", "_models.AzureRealtimeNativeVoice"] +VoiceAgentTool = Union[ + "_models.RealtimeFunctionTool", "_models.VoiceAgentMcpTool", "_models.VoiceSystemTool", "_models.VoiceToolboxTool" +] +VoiceAgentRequestConversationItem = Union[ + "_models.RealtimeConversationItemMessageSystem", + "_models.RealtimeConversationItemMessageUser", + "_models.RealtimeConversationItemMessageAssistant", + "_models.RealtimeConversationItemFunctionCall", + "_models.RealtimeConversationItemFunctionCallOutput", +] +VoiceAgentCreateConversationItem = Union[ + "_unions.VoiceAgentRequestConversationItem", "_models.RealtimeMCPApprovalResponse" +] +VoiceAgentInterimResponse = Union[ + "_models.VoiceAgentStaticInterimResponseConfig", "_models.VoiceAgentLlmInterimResponseConfig" +] +VoiceAgentTurnDetection = Union[ + "_models.VoiceAgentServerVadTurnDetection", + "_models.VoiceAgentSemanticVadTurnDetection", + "_models.VoiceAgentAzureSemanticVadTurnDetection", + "_models.VoiceAgentAzureMultilingualSemanticVadTurnDetection", +] +VoiceAgentMaxOutputTokens = Union[int, Literal["inf"]] +VoiceAgentMcpApprovalPolicy = Union[str, "_models.VoiceAgentMcpApprovalMode", dict[str, list[str]]] +VoiceAgentSessionTool = Union[ + "_models.RealtimeFunctionTool", + "_models.VoiceAgentSessionMcpTool", + "_models.VoiceToolboxTool", + "_models.VoiceSystemTool", +] +VoiceAgentToolChoice = Union[str, "_models.ToolChoiceOptions", "_models.RealtimeToolChoiceFunction"] +VoiceAgentResponseMessageItem = Union[ + "_models.RealtimeConversationItemMessageSystem", + "_models.RealtimeConversationItemMessageUser", + "_models.RealtimeConversationItemMessageAssistant", +] +VoiceAgentWebSearchAction = Union[ + "_models.VoiceAgentWebSearchActionSearch", + "_models.VoiceAgentWebSearchActionOpenPage", + "_models.VoiceAgentWebSearchActionFind", +] +VoiceAgentFileSearchAttributeValue = Union[str, float, bool] +VoiceAgentResponseItem = Union[ + "_unions.VoiceAgentResponseMessageItem", + "_models.VoiceFunctionCallItem", + "_models.VoiceFunctionCallOutputItem", + "_models.VoiceMcpListToolsItem", + "_models.VoiceMcpCallItem", + "_models.VoiceMcpApprovalRequestItem", + "_models.VoiceMcpApprovalResponseItem", + "_models.VoiceAgentWorkflowActionItem", + "_models.VoiceAgentWebSearchCallItem", + "_models.VoiceAgentFileSearchCallItem", +] +VoiceAgentResponseEventContentPart = Union[ + "_models.VoiceAgentResponseEventTextContentPart", "_models.VoiceAgentResponseEventAudioContentPart" +] diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_utils/__init__.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_utils/__init__.py new file mode 100644 index 000000000000..8026245c2abc --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_utils/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_utils/model_base.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_utils/model_base.py new file mode 100644 index 000000000000..35d5fc024978 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_utils/model_base.py @@ -0,0 +1,1787 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access, broad-except + +import copy +import calendar +import decimal +import functools +import sys +import logging +import base64 +import re +import typing +import enum +import email.utils +from datetime import datetime, date, time, timedelta, timezone +from json import JSONEncoder +import xml.etree.ElementTree as ET +from collections.abc import MutableMapping +import isodate +from azure.core.exceptions import DeserializationError +from azure.core import CaseInsensitiveEnumMeta +from azure.core.pipeline import PipelineResponse +from azure.core.serialization import _Null + +from azure.core.rest import HttpResponse + +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + +_LOGGER = logging.getLogger(__name__) + +__all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] + +TZ_UTC = timezone.utc +_T = typing.TypeVar("_T") +_NONE_TYPE = type(None) + + +def _timedelta_as_isostr(td: timedelta) -> str: + """Converts a datetime.timedelta object into an ISO 8601 formatted string, e.g. 'P4DT12H30M05S' + + Function adapted from the Tin Can Python project: https://github.com/RusticiSoftware/TinCanPython + + :param timedelta td: The timedelta to convert + :rtype: str + :return: ISO8601 version of this timedelta + """ + + # Split seconds to larger units + seconds = td.total_seconds() + minutes, seconds = divmod(seconds, 60) + hours, minutes = divmod(minutes, 60) + days, hours = divmod(hours, 24) + + days, hours, minutes = list(map(int, (days, hours, minutes))) + seconds = round(seconds, 6) + + # Build date + date_str = "" + if days: + date_str = "%sD" % days + + if hours or minutes or seconds: + # Build time + time_str = "T" + + # Hours + bigger_exists = date_str or hours + if bigger_exists: + time_str += "{:02}H".format(hours) + + # Minutes + bigger_exists = bigger_exists or minutes + if bigger_exists: + time_str += "{:02}M".format(minutes) + + # Seconds + try: + if seconds.is_integer(): + seconds_string = "{:02}".format(int(seconds)) + else: + # 9 chars long w/ leading 0, 6 digits after decimal + seconds_string = "%09.6f" % seconds + # Remove trailing zeros + seconds_string = seconds_string.rstrip("0") + except AttributeError: # int.is_integer() raises + seconds_string = "{:02}".format(seconds) + + time_str += "{}S".format(seconds_string) + else: + time_str = "" + + return "P" + date_str + time_str + + +def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: + encoded = base64.b64encode(o).decode() + if format == "base64url": + return encoded.strip("=").replace("+", "-").replace("/", "_") + return encoded + + +def _serialize_duration(td: timedelta, format: typing.Optional[str] = None): + """Serialize a timedelta to its wire representation. + + For the ``seconds``/``milliseconds`` encodings the value is converted to a + numeric value, otherwise it falls back to an ISO 8601 duration string. + + :param timedelta td: The timedelta to serialize. + :param str format: The duration encoding format. + :rtype: int or float or str + :return: serialized duration + """ + seconds = td.total_seconds() + if format == "duration-seconds-int": + return int(seconds) + if format == "duration-seconds-float": + return seconds + if format == "duration-milliseconds-int": + return int(seconds * 1000) + if format == "duration-milliseconds-float": + return seconds * 1000 + return _timedelta_as_isostr(td) + + +def _serialize_datetime(o, format: typing.Optional[str] = None): + if hasattr(o, "year") and hasattr(o, "hour"): + if format == "rfc7231": + return email.utils.format_datetime(o, usegmt=True) + if format == "unix-timestamp": + return int(calendar.timegm(o.utctimetuple())) + + # astimezone() fails for naive times in Python 2.7, so make make sure o is aware (tzinfo is set) + if not o.tzinfo: + iso_formatted = o.replace(tzinfo=TZ_UTC).isoformat() + else: + iso_formatted = o.astimezone(TZ_UTC).isoformat() + # Replace the trailing "+00:00" UTC offset with "Z" (RFC 3339: https://www.ietf.org/rfc/rfc3339.txt) + return iso_formatted.replace("+00:00", "Z") + # Next try datetime.date or datetime.time + return o.isoformat() + + +def _is_readonly(p): + try: + return p._visibility == ["read"] + except AttributeError: + return False + + +class SdkJSONEncoder(JSONEncoder): + """A JSON encoder that's capable of serializing datetime objects and bytes. + + :param args: Additional positional arguments passed to the base ``JSONEncoder``. + :type args: typing.Any + :keyword exclude_readonly: Whether to exclude readonly properties. Defaults to False. + :paramtype exclude_readonly: bool + :keyword format: The format to use for serialization. Defaults to None. + :paramtype format: typing.Optional[str] + """ + + def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): + super().__init__(*args, **kwargs) + self.exclude_readonly = exclude_readonly + self.format = format + + def default(self, o): # pylint: disable=too-many-return-statements + if _is_model(o): + if self.exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + return {k: v for k, v in o.items() if k not in readonly_props} + return dict(o.items()) + try: + return super(SdkJSONEncoder, self).default(o) + except TypeError: + if isinstance(o, _Null): + return None + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, self.format) + try: + # First try datetime.datetime + return _serialize_datetime(o, self.format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _timedelta_as_isostr(o) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return super(SdkJSONEncoder, self).default(o) + + +_VALID_DATE = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" + r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") +_VALID_RFC7231 = re.compile( + r"(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s\d{2}\s" + r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" +) + +_ARRAY_ENCODE_MAPPING = { + "pipeDelimited": "|", + "spaceDelimited": " ", + "commaDelimited": ",", + "newlineDelimited": "\n", +} + + +def _deserialize_array_encoded(delimit: str, attr): + if isinstance(attr, str): + if attr == "": + return [] + return attr.split(delimit) + return attr + + +def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + attr = attr.upper() + match = _VALID_DATE.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + return date_obj # type: ignore[no-any-return] + + +def _deserialize_datetime_rfc7231(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize RFC7231 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + match = _VALID_RFC7231.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + return email.utils.parsedate_to_datetime(attr) + + +def _deserialize_datetime_unix_timestamp(attr: typing.Union[float, datetime]) -> datetime: + """Deserialize unix timestamp into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + return datetime.fromtimestamp(attr, TZ_UTC) + + +def _deserialize_date(attr: typing.Union[str, date]) -> date: + """Deserialize ISO-8601 formatted string into Date object. + :param str attr: response string to be deserialized. + :rtype: date + :returns: The date object from that input + """ + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + if isinstance(attr, date): + return attr + return isodate.parse_date(attr, defaultmonth=None, defaultday=None) # type: ignore + + +def _deserialize_time(attr: typing.Union[str, time]) -> time: + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :rtype: datetime.time + :returns: The time object from that input + """ + if isinstance(attr, time): + return attr + return isodate.parse_time(attr) # type: ignore[no-any-return] + + +def _deserialize_bytes(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + return bytes(base64.b64decode(attr)) + + +def _deserialize_bytes_base64(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return bytes(base64.b64decode(encoded)) + + +def _deserialize_duration(attr): + if isinstance(attr, timedelta): + return attr + return isodate.parse_duration(attr) + + +def _deserialize_duration_numeric(attr, unit): + if isinstance(attr, timedelta): + return attr + return timedelta(**{unit: float(attr)}) + + +def _deserialize_decimal(attr): + if isinstance(attr, decimal.Decimal): + return attr + return decimal.Decimal(str(attr)) + + +def _deserialize_int_as_str(attr): + if isinstance(attr, int): + return attr + return int(attr) + + +def _deserialize_bool_as_str(attr): + if isinstance(attr, bool): + return attr + return attr.lower() == "true" + + +_DESERIALIZE_MAPPING = { + datetime: _deserialize_datetime, + date: _deserialize_date, + time: _deserialize_time, + bytes: _deserialize_bytes, + bytearray: _deserialize_bytes, + timedelta: _deserialize_duration, + typing.Any: lambda x: x, + decimal.Decimal: _deserialize_decimal, +} + +_DESERIALIZE_MAPPING_WITHFORMAT = { + "rfc3339": _deserialize_datetime, + "rfc7231": _deserialize_datetime_rfc7231, + "unix-timestamp": _deserialize_datetime_unix_timestamp, + "base64": _deserialize_bytes, + "base64url": _deserialize_bytes_base64, + "duration-seconds-int": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-seconds-float": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-milliseconds-int": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), + "duration-milliseconds-float": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), +} + + +def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): + if annotation is int and rf and rf._format == "str": + return _deserialize_int_as_str + if annotation is bool and rf and rf._format == "str": + return _deserialize_bool_as_str + if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: + return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) + if rf and rf._format: + return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) + return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore + + +def _get_type_alias_type(module_name: str, alias_name: str): + types = { + k: v + for k, v in sys.modules[module_name].__dict__.items() + if isinstance(v, typing._GenericAlias) # type: ignore + } + if alias_name not in types: + return alias_name + return types[alias_name] + + +def _get_model(module_name: str, model_name: str): + models = {k: v for k, v in sys.modules[module_name].__dict__.items() if isinstance(v, type)} + module_end = module_name.rsplit(".", 1)[0] + models.update({k: v for k, v in sys.modules[module_end].__dict__.items() if isinstance(v, type)}) + if isinstance(model_name, str): + model_name = model_name.split(".")[-1] + if model_name not in models: + return model_name + return models[model_name] + + +_UNSET = object() + + +class _MyMutableMapping(MutableMapping[str, typing.Any]): + def __init__(self, data: dict[str, typing.Any]) -> None: + self._data = data + + def __contains__(self, key: typing.Any) -> bool: + return key in self._data + + def __getitem__(self, key: str) -> typing.Any: + # If this key has been deserialized (for mutable types), we need to handle serialization + if hasattr(self, "_attr_to_rest_field"): + cache_attr = f"_deserialized_{key}" + if hasattr(self, cache_attr): + rf = _get_rest_field(getattr(self, "_attr_to_rest_field"), key) + if rf: + value = self._data.get(key) + if isinstance(value, (dict, list, set)): + # For mutable types, serialize and return + # But also update _data with serialized form and clear flag + # so mutations via this returned value affect _data + serialized = _serialize(value, rf._format) + # If serialized form is same type (no transformation needed), + # return _data directly so mutations work + if isinstance(serialized, type(value)) and serialized == value: + return self._data.get(key) + # Otherwise return serialized copy and clear flag + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass + # Store serialized form back + self._data[key] = serialized + return serialized + return self._data.__getitem__(key) + + def __setitem__(self, key: str, value: typing.Any) -> None: + # Clear any cached deserialized value when setting through dictionary access + cache_attr = f"_deserialized_{key}" + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass + self._data.__setitem__(key, value) + + def __delitem__(self, key: str) -> None: + self._data.__delitem__(key) + + def __iter__(self) -> typing.Iterator[typing.Any]: + return self._data.__iter__() + + def __len__(self) -> int: + return self._data.__len__() + + def __ne__(self, other: typing.Any) -> bool: + return not self.__eq__(other) + + def keys(self) -> typing.KeysView[str]: + """ + :returns: a set-like object providing a view on the mapping's keys + :rtype: ~typing.KeysView + """ + return self._data.keys() + + def values(self) -> typing.ValuesView[typing.Any]: + """ + :returns: an object providing a view on the mapping's values + :rtype: ~typing.ValuesView + """ + return self._data.values() + + def items(self) -> typing.ItemsView[str, typing.Any]: + """ + :returns: a set-like object providing a view on the mapping's items + :rtype: ~typing.ItemsView + """ + return self._data.items() + + def get(self, key: str, default: typing.Any = None) -> typing.Any: + """ + Get the value for key if key is in the dictionary, else default. + :param str key: The key to look up. + :param any default: The value to return if key is not in the dictionary. Defaults to None + :returns: The value for key if key is in the dictionary, else default. + :rtype: any + """ + try: + return self[key] + except KeyError: + return default + + @typing.overload + def pop(self, key: str) -> typing.Any: ... # pylint: disable=arguments-differ + + @typing.overload + def pop(self, key: str, default: _T) -> _T: ... # pylint: disable=signature-differs + + @typing.overload + def pop(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs + + def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Removes specified key and return the corresponding value. + :param str key: The key to pop. + :param any default: The value to return if key is not in the dictionary + :returns: The value corresponding to the key. + :rtype: any + :raises KeyError: If key is not found and default is not given. + """ + if default is _UNSET: + return self._data.pop(key) + return self._data.pop(key, default) + + def popitem(self) -> tuple[str, typing.Any]: + """ + Removes and returns some (key, value) pair + :returns: The (key, value) pair. + :rtype: tuple + :raises KeyError: if the dictionary is empty. + """ + return self._data.popitem() + + def clear(self) -> None: + """ + Remove all items from the dictionary. + """ + self._data.clear() + + def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ + """ + Update the dictionary from a mapping or an iterable of key-value pairs. + :param any args: Either a mapping object or an iterable of key-value pairs. + """ + self._data.update(*args, **kwargs) + + @typing.overload + def setdefault(self, key: str, default: None = None) -> None: ... + + @typing.overload + def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs + + def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Return the value for key if key is in the dictionary; otherwise set the key to + default and return default. + :param str key: The key to look up. + :param any default: The value to set if key is not in the dictionary + :returns: The value for key if key is in the dictionary, else default. + :rtype: any + """ + if default is _UNSET: + return self._data.setdefault(key) + return self._data.setdefault(key, default) + + def __eq__(self, other: typing.Any) -> bool: + if isinstance(other, _MyMutableMapping): + return self._data == other._data + try: + other_model = self.__class__(other) + except Exception: + return False + return self._data == other_model._data + + def __repr__(self) -> str: + return str(self._data) + + +def _is_model(obj: typing.Any) -> bool: + return getattr(obj, "_is_model", False) + + +def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements + if isinstance(o, list): + if format in _ARRAY_ENCODE_MAPPING and all(isinstance(x, str) for x in o): + return _ARRAY_ENCODE_MAPPING[format].join(o) + return [_serialize(x, format) for x in o] + if isinstance(o, dict): + return {k: _serialize(v, format) for k, v in o.items()} + if isinstance(o, set): + return {_serialize(x, format) for x in o} + if isinstance(o, tuple): + return tuple(_serialize(x, format) for x in o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, format) + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, enum.Enum): + return o.value + if isinstance(o, int): + if format == "str": + return str(o) + return o + try: + # First try datetime.datetime + return _serialize_datetime(o, format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _serialize_duration(o, format) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return o + + +def _get_rest_field(attr_to_rest_field: dict[str, "_RestField"], rest_name: str) -> typing.Optional["_RestField"]: + try: + return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) + except StopIteration: + return None + + +def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typing.Any: + if not rf: + return _serialize(value, None) + if rf._is_multipart_file_input: + return value + if rf._is_model: + return _deserialize(rf._type, value) + if isinstance(value, ET.Element): + value = _deserialize(rf._type, value) + return _serialize(value, rf._format) + + +# ============================================================================ +# Fast-path scalar deserializer functions for rest_field(deserializer=...) +# These are referenced from rest_field declarations to bypass the generic +# _deserialize -> _deserialize_with_callable chain. +# Only simple/primitive types — no models or container types. +# ============================================================================ + + +def _xml_deser_str(value): + if isinstance(value, ET.Element): + return value.text or "" + return str(value) if value is not None else None + + +def _xml_deser_int(value): + if isinstance(value, ET.Element): + return int(value.text) if value.text else None + return int(value) if value is not None else None + + +def _xml_deser_float(value): + if isinstance(value, ET.Element): + return float(value.text) if value.text else None + return float(value) if value is not None else None + + +def _xml_deser_bool(value): + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + if text in (True, False): + return text + return text.lower() == "true" + + +# pylint: disable=docstring-missing-param +def _xml_deser_bytes(value): + """Deserialize bytes from XML (base64).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes(text) + + +def _xml_deser_bytes_base64url(value): + """Deserialize bytes from XML (base64url).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes_base64(text) + + +def _xml_deser_datetime(value): + """Deserialize a datetime from XML (ISO 8601 / rfc3339).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime(text) + + +def _xml_deser_datetime_rfc7231(value): + """Deserialize a datetime from XML (RFC7231 format).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_rfc7231(text) + + +def _xml_deser_datetime_unix_timestamp(value): + """Deserialize a datetime from XML (Unix timestamp).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_unix_timestamp(float(text)) + + +def _xml_deser_date(value): + """Deserialize a date from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_date(text) + + +def _xml_deser_time(value): + """Deserialize a time from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_time(text) + + +def _xml_deser_duration(value): + """Deserialize a timedelta from XML (ISO 8601 duration).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_duration(text) + + +def _xml_deser_decimal(value): + """Deserialize a Decimal from XML.""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_decimal(text) + + +def _xml_deser_enum_or_str(enum_cls, value): + """Deserialize a Union[EnumType, str] from XML.""" + text = value.text if isinstance(value, ET.Element) else value + if text is None: + return None + try: + return enum_cls(text) + except ValueError: + return text + + +def _extract_xml_model_type(rf_type): + """Extract the concrete Model class from a resolved rf._type partial chain. + + Unwraps ``Optional[Model]`` and ``_deserialize_model(Model, ...)`` + wrappers. Only handles Model and Optional[Model] — other composite + types (List, Dict, Union, etc.) return None and fall through to the + generic ``_deserialize`` path at runtime. + """ + if rf_type is None: + return None + if isinstance(rf_type, type) and _is_model(rf_type): + return rf_type + if not isinstance(rf_type, functools.partial): + return None + func = rf_type.func + args = rf_type.args + if func is _deserialize_with_optional and args: + return _extract_xml_model_type(args[0]) + if func is _deserialize_model and args: + cls = args[0] + return cls if isinstance(cls, type) and _is_model(cls) else None + return None + + +def _build_xml_field_plan( # pylint: disable=docstring-missing-return, docstring-missing-rtype, unused-variable + cls, attr_to_rest_field: dict +) -> list: + """Build a precomputed XML field plan for fast _init_from_xml iteration. + + Called once per model class in __new__. Returns a list of tuples: + (rest_name, xml_name, kind, deser, rf_type, is_optional, items_name) + + kind: 0=wrapped, 1=attribute, 2=unwrapped, 3=text + + For Model and Optional[Model] fields that lack a scalar + ``_deserializer``, this function precomputes the Model class as the + deserializer so ``_init_from_xml`` can call ``ModelClass(element)`` + directly instead of going through the expensive + ``_get_deserialize_callable_from_annotation`` chain at runtime. + """ + model_meta = getattr(cls, "_xml", {}) + model_ns = model_meta.get("ns") or model_meta.get("namespace") + plan = [] + + for rf in attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + deser = rf._deserializer + + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + is_optional = rf._is_optional + + # For Model / Optional[Model] fields without a scalar deserializer, + # precompute the Model class as the deserializer. + if deser is None and rf._type is not None: + model_cls = _extract_xml_model_type(rf._type) + if model_cls is not None: + deser = model_cls + + if prop_meta.get("attribute", False): + plan.append((rf._rest_name, xml_name, 1, deser, rf._type, is_optional, None)) + elif prop_meta.get("unwrapped", False): + items_name = prop_meta.get("itemsName") + if items_name: + items_ns = prop_meta.get("itemsNs") + if items_ns is not None: + xml_ns = items_ns + if xml_ns: + items_name = "{" + xml_ns + "}" + items_name + else: + items_name = xml_name + plan.append((rf._rest_name, xml_name, 2, deser, rf._type, is_optional, items_name)) + elif prop_meta.get("text", False): + plan.append((rf._rest_name, xml_name, 3, deser, rf._type, is_optional, None)) + else: + plan.append((rf._rest_name, xml_name, 0, deser, rf._type, is_optional, None)) + + return plan + + +# pylint: enable=docstring-missing-param +class Model(_MyMutableMapping): + _is_model = True + # label whether current class's _attr_to_rest_field has been calculated + # could not see _attr_to_rest_field directly because subclass inherits it from parent class + _calculated: set[str] = set() + + def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: + class_name = self.__class__.__name__ + if len(args) > 1: + raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") + dict_to_pass: dict[str, typing.Any] = {} + if args: + if isinstance(args[0], ET.Element): + dict_to_pass.update(self._init_from_xml(args[0])) + else: + dict_to_pass.update( + {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} + ) + else: + non_attr_kwargs = [k for k in kwargs if k not in self._attr_to_rest_field] + if non_attr_kwargs: + # actual type errors only throw the first wrong keyword arg they see, so following that. + raise TypeError(f"{class_name}.__init__() got an unexpected keyword argument '{non_attr_kwargs[0]}'") + dict_to_pass.update( + { + self._attr_to_rest_field[k]._rest_name: _create_value(self._attr_to_rest_field[k], v) + for k, v in kwargs.items() + if v is not None + } + ) + # Apply client default values for fields the caller didn't set so that + # defaults are part of `_data` and therefore included during serialization. + for rf in self._attr_to_rest_field.values(): + if rf._default is _UNSET: + continue + if rf._rest_name in dict_to_pass: + continue + dict_to_pass[rf._rest_name] = _create_value(rf, rf._default) + super().__init__(dict_to_pass) + + def _init_from_xml( # pylint: disable=too-many-branches, too-many-statements + self, element: ET.Element + ) -> dict[str, typing.Any]: + """Deserialize an XML element into a dict mapping rest field names to values. + + :param ET.Element element: The XML element to deserialize from. + :returns: A dictionary of rest_name to deserialized value pairs. + :rtype: dict + """ + result: dict[str, typing.Any] = {} + existed_attr_keys: list[str] = [] + + field_plan = getattr(self, "_xml_field_plan", None) + if field_plan: + for rest_name, xml_name, kind, deser, rf_type, is_optional, items_name in field_plan: + if kind == 0: # wrapped element (most common) + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(item) + else: + result[rest_name] = _deserialize(rf_type, item) + elif kind == 1: # attribute + attr_val = element.get(xml_name) + if attr_val is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(attr_val) + else: + result[rest_name] = attr_val + elif kind == 2: # unwrapped array + items = element.findall(items_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(items_name) + if deser: + result[rest_name] = deser(items) + else: + result[rest_name] = _deserialize(rf_type, items) + elif not is_optional: + existed_attr_keys.append(items_name) + result[rest_name] = [] + elif kind == 3: # text + if element.text is not None: + if deser: + result[rest_name] = deser(element.text) + else: + result[rest_name] = element.text + else: + model_meta = getattr(self, "_xml", {}) + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and element.get(xml_name) is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + _items_name = prop_meta.get("itemsName") + if _items_name: + xml_name = _items_name + _items_ns = prop_meta.get("itemsNs") + if _items_ns is not None: + xml_ns = _items_ns + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = element.findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, items) + elif not rf._is_optional: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = [] + continue + + # text element is primitive type + if prop_meta.get("text", False): + if element.text is not None: + result[rf._rest_name] = _deserialize(rf._type, element.text) + continue + + # wrapped element could be normal property or array + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, item) + + # rest thing is additional properties + for e in element: + if e.tag not in existed_attr_keys: + result[e.tag] = _convert_element(e) + + return result + + def copy(self) -> "Model": + return Model(self.__dict__) + + def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: + if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated: + # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', + # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' + mros = cls.__mro__[:-9][::-1] # ignore parents, and reverse the mro order + attr_to_rest_field: dict[str, _RestField] = { # map attribute name to rest_field property + k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") + } + annotations = { + k: v + for mro_class in mros + if hasattr(mro_class, "__annotations__") + for k, v in mro_class.__annotations__.items() + } + for attr, rf in attr_to_rest_field.items(): + rf._module = cls.__module__ + if not rf._type: + rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) + if not rf._rest_name_input: + rf._rest_name_input = attr + cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) + # Build XML field plan for fast _init_from_xml (only for XML models) + if getattr(cls, "_xml", None): + cls._xml_field_plan = _build_xml_field_plan(cls, attr_to_rest_field) + cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") + + return super().__new__(cls) + + def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: + for base in cls.__bases__: + if hasattr(base, "__mapping__"): + base.__mapping__[discriminator or cls.__name__] = cls # type: ignore + + @classmethod + def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: + for v in cls.__dict__.values(): + if isinstance(v, _RestField) and v._is_discriminator and v._rest_name not in exist_discriminators: + return v + return None + + @classmethod + def _deserialize(cls, data, exist_discriminators): + if not hasattr(cls, "__mapping__"): + return cls(data) + discriminator = cls._get_discriminator(exist_discriminators) + if discriminator is None: + return cls(data) + exist_discriminators.append(discriminator._rest_name) + if isinstance(data, ET.Element): + model_meta = getattr(cls, "_xml", {}) + prop_meta = getattr(discriminator, "_xml", {}) + xml_name = prop_meta.get("name", discriminator._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + if data.get(xml_name) is not None: + discriminator_value = data.get(xml_name) + else: + discriminator_value = data.find(xml_name).text # pyright: ignore + else: + discriminator_value = data.get(discriminator._rest_name) + mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member + return mapped_cls._deserialize(data, exist_discriminators) + + def as_dict(self, *, exclude_readonly: bool = False) -> dict[str, typing.Any]: + """Return a dict that can be turned into json using json.dump. + + :keyword bool exclude_readonly: Whether to remove the readonly properties. + :returns: A dict JSON compatible object + :rtype: dict + """ + + result = {} + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in self._attr_to_rest_field.values() if _is_readonly(p)] + for k, v in self.items(): + if exclude_readonly and k in readonly_props: # pyright: ignore + continue + is_multipart_file_input = False + try: + is_multipart_file_input = next( + rf for rf in self._attr_to_rest_field.values() if rf._rest_name == k + )._is_multipart_file_input + except StopIteration: + pass + result[k] = v if is_multipart_file_input else Model._as_dict_value(v, exclude_readonly=exclude_readonly) + return result + + @staticmethod + def _as_dict_value(v: typing.Any, exclude_readonly: bool = False) -> typing.Any: + if v is None or isinstance(v, _Null): + return None + if isinstance(v, (list, tuple, set)): + return type(v)(Model._as_dict_value(x, exclude_readonly=exclude_readonly) for x in v) + if isinstance(v, dict): + return {dk: Model._as_dict_value(dv, exclude_readonly=exclude_readonly) for dk, dv in v.items()} + return v.as_dict(exclude_readonly=exclude_readonly) if hasattr(v, "as_dict") else v + + +def _deserialize_model(model_deserializer: typing.Optional[typing.Callable], obj): + if _is_model(obj): + return obj + return _deserialize(model_deserializer, obj) + + +def _deserialize_with_optional(if_obj_deserializer: typing.Optional[typing.Callable], obj): + if obj is None: + return obj + return _deserialize_with_callable(if_obj_deserializer, obj) + + +def _deserialize_with_union(deserializers, obj): + for deserializer in deserializers: + try: + return _deserialize(deserializer, obj) + except DeserializationError: + pass + raise DeserializationError() + + +def _deserialize_dict( + value_deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj: dict[typing.Any, typing.Any], +): + if obj is None: + return obj + if isinstance(obj, ET.Element): + obj = {child.tag: child for child in obj} + return {k: _deserialize(value_deserializer, v, module) for k, v in obj.items()} + + +def _deserialize_multiple_sequence( + entry_deserializers: list[typing.Optional[typing.Callable]], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + return type(obj)(_deserialize(deserializer, entry, module) for entry, deserializer in zip(obj, entry_deserializers)) + + +def _is_array_encoded_deserializer(deserializer: functools.partial) -> bool: + return ( + isinstance(deserializer, functools.partial) + and isinstance(deserializer.args[0], functools.partial) + and deserializer.args[0].func == _deserialize_array_encoded # pylint: disable=comparison-with-callable + ) + + +def _deserialize_sequence( + deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + if isinstance(obj, ET.Element): + obj = list(obj) + + # encoded string may be deserialized to sequence + if isinstance(obj, str) and isinstance(deserializer, functools.partial): + # for list[str] + if _is_array_encoded_deserializer(deserializer): + return deserializer(obj) + + # for list[Union[...]] + if isinstance(deserializer.args[0], list): + for sub_deserializer in deserializer.args[0]: + if _is_array_encoded_deserializer(sub_deserializer): + return sub_deserializer(obj) + + return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) + + +def _sorted_annotations(types: list[typing.Any]) -> list[typing.Any]: + return sorted( + types, + key=lambda x: hasattr(x, "__name__") and x.__name__.lower() in ("str", "float", "int", "bool"), + ) + + +def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-statements, too-many-branches + annotation: typing.Any, + module: typing.Optional[str], + rf: typing.Optional["_RestField"] = None, +) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + if not annotation: + return None + + # is it a type alias? + if isinstance(annotation, str): + if module is not None: + annotation = _get_type_alias_type(module, annotation) + + # is it a forward ref / in quotes? + if isinstance(annotation, (str, typing.ForwardRef)): + try: + model_name = annotation.__forward_arg__ # type: ignore + except AttributeError: + model_name = annotation + if module is not None: + annotation = _get_model(module, model_name) # type: ignore + + try: + if module and _is_model(annotation): + if rf: + rf._is_model = True + + return functools.partial(_deserialize_model, annotation) # pyright: ignore + except Exception: + pass + + # is it a literal? + try: + if annotation.__origin__ is typing.Literal: # pyright: ignore + return None + except AttributeError: + pass + + # is it optional? + try: + if any(a is _NONE_TYPE for a in annotation.__args__): # pyright: ignore + if rf: + rf._is_optional = True + if len(annotation.__args__) <= 2: # pyright: ignore + if_obj_deserializer = _get_deserialize_callable_from_annotation( + next(a for a in annotation.__args__ if a is not _NONE_TYPE), module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_with_optional, if_obj_deserializer) + # the type is Optional[Union[...]], we need to remove the None type from the Union + annotation_copy = copy.copy(annotation) + annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a is not _NONE_TYPE] # pyright: ignore + return _get_deserialize_callable_from_annotation(annotation_copy, module, rf) + except AttributeError: + pass + + # is it union? + if getattr(annotation, "__origin__", None) is typing.Union: + # initial ordering is we make `string` the last deserialization option, because it is often them most generic + deserializers = [ + _get_deserialize_callable_from_annotation(arg, module, rf) + for arg in _sorted_annotations(annotation.__args__) # pyright: ignore + ] + + return functools.partial(_deserialize_with_union, deserializers) + + try: + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() == "dict": + value_deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[1], module, rf # pyright: ignore + ) + + return functools.partial( + _deserialize_dict, + value_deserializer, + module, + ) + except (AttributeError, IndexError): + pass + try: + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() in ["list", "set", "tuple", "sequence"]: + if len(annotation.__args__) > 1: # pyright: ignore + entry_deserializers = [ + _get_deserialize_callable_from_annotation(dt, module, rf) + for dt in annotation.__args__ # pyright: ignore + ] + return functools.partial(_deserialize_multiple_sequence, entry_deserializers, module) + deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[0], module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_sequence, deserializer, module) + except (TypeError, IndexError, AttributeError, SyntaxError): + pass + + def _deserialize_default( + deserializer, + obj, + ): + if obj is None: + return obj + try: + return _deserialize_with_callable(deserializer, obj) + except Exception: + pass + return obj + + if get_deserializer(annotation, rf): + return functools.partial(_deserialize_default, get_deserializer(annotation, rf)) + + return functools.partial(_deserialize_default, annotation) + + +def _deserialize_with_callable( + deserializer: typing.Optional[typing.Callable[[typing.Any], typing.Any]], + value: typing.Any, +): # pylint: disable=too-many-return-statements + try: + if value is None or isinstance(value, _Null): + return None + if isinstance(value, ET.Element): + if deserializer is str: + return value.text or "" + if deserializer is int: + return int(value.text) if value.text else None + if deserializer is float: + return float(value.text) if value.text else None + if deserializer is bool: + return value.text == "true" if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING.values(): + return deserializer(value.text) if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING_WITHFORMAT.values(): + return deserializer(value.text) if value.text else None + if deserializer is None: + return value + if deserializer in [int, float, bool]: + return deserializer(value) + if isinstance(deserializer, CaseInsensitiveEnumMeta): + try: + return deserializer(value.text if isinstance(value, ET.Element) else value) + except ValueError: + # for unknown value, return raw value + return value.text if isinstance(value, ET.Element) else value + if isinstance(deserializer, type) and issubclass(deserializer, Model): + return deserializer._deserialize(value, []) + return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) + except Exception as e: + raise DeserializationError() from e + + +def _deserialize( + deserializer: typing.Any, + value: typing.Any, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + if isinstance(value, PipelineResponse): + value = value.http_response.json() + if rf is None and format: + rf = _RestField(format=format) + if not isinstance(deserializer, functools.partial): + deserializer = _get_deserialize_callable_from_annotation(deserializer, module, rf) + return _deserialize_with_callable(deserializer, value) + + +def _failsafe_deserialize( + deserializer: typing.Any, + response: HttpResponse, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + try: + return _deserialize(deserializer, response.json(), module, rf, format) + except Exception: # pylint: disable=broad-except + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +def _failsafe_deserialize_xml( + deserializer: typing.Any, + response: HttpResponse, +) -> typing.Any: + try: + return _deserialize_xml(deserializer, response.text()) + except Exception: # pylint: disable=broad-except + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +# pylint: disable=too-many-instance-attributes +class _RestField: + def __init__( + self, + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + is_discriminator: bool = False, + visibility: typing.Optional[list[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, + xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, + ): + self._type = type + self._rest_name_input = name + self._module: typing.Optional[str] = None + self._is_discriminator = is_discriminator + self._visibility = visibility + self._is_model = False + self._is_optional = False + self._default = default + self._format = format + self._is_multipart_file_input = is_multipart_file_input + self._xml = xml if xml is not None else {} + self._deserializer = deserializer + + @property + def _class_type(self) -> typing.Any: + result = getattr(self._type, "args", [None])[0] + # type may be wrapped by nested functools.partial so we need to check for that + if isinstance(result, functools.partial): + return getattr(result, "args", [None])[0] + return result + + @property + def _rest_name(self) -> str: + if self._rest_name_input is None: + raise ValueError("Rest name was never set") + return self._rest_name_input + + def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin + # by this point, type and rest_name will have a value bc we default + # them in __new__ of the Model class + # Use _data.get() directly to avoid triggering __getitem__ which clears the cache + item = obj._data.get(self._rest_name, _UNSET) + if item is _UNSET: + # Field not set by user; return the client default if one exists, otherwise None + return self._default if self._default is not _UNSET else None + if item is None: + return item + if self._is_model: + return item + + # For mutable types, we want mutations to directly affect _data + # Check if we've already deserialized this value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + # Return the value from _data directly (it's been deserialized in place) + return obj._data.get(self._rest_name) + + # Fast path: use _deserializer directly (avoids _serialize/_deserialize chain) + if self._deserializer: + deserialized = self._deserializer(item) + else: + deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) + + # For mutable types, store the deserialized value back in _data + # so mutations directly affect _data + if isinstance(deserialized, (dict, list, set)): + obj._data[self._rest_name] = deserialized + object.__setattr__(obj, cache_attr, True) # Mark as deserialized + return deserialized + + return deserialized + + def __set__(self, obj: Model, value) -> None: + # Clear the cached deserialized object when setting a new value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + object.__delattr__(obj, cache_attr) + + if value is None: + # we want to wipe out entries if users set attr to None + try: + obj.__delitem__(self._rest_name) + except KeyError: + pass + return + if self._is_model: + if not _is_model(value): + value = _deserialize(self._type, value) + obj.__setitem__(self._rest_name, value) + return + obj.__setitem__(self._rest_name, _serialize(value, self._format)) + + def _get_deserialize_callable_from_annotation( + self, annotation: typing.Any + ) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + return _get_deserialize_callable_from_annotation(annotation, self._module, self) + + +def rest_field( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[list[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, + xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, +) -> typing.Any: + return _RestField( + name=name, + type=type, + visibility=visibility, + default=default, + format=format, + is_multipart_file_input=is_multipart_file_input, + xml=xml, + deserializer=deserializer, + ) + + +def rest_discriminator( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[list[str]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, +) -> typing.Any: + return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) + + +def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: + """Serialize a model to XML. + + :param Model model: The model to serialize. + :param bool exclude_readonly: Whether to exclude readonly properties. + :returns: The XML representation of the model. + :rtype: str + """ + return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore + + +def _get_xml_ns(meta: dict[str, typing.Any]) -> typing.Optional[str]: + """Return the XML namespace from a metadata dict, checking both 'ns' (old-style) and 'namespace' (DPG) keys. + + :param dict meta: The metadata dictionary to extract namespace from. + :returns: The namespace string if 'ns' or 'namespace' key is present, None otherwise. + :rtype: str or None + """ + ns = meta.get("ns") + if ns is None: + ns = meta.get("namespace") + return ns + + +def _resolve_xml_ns( + prop_meta: dict[str, typing.Any], model_meta: typing.Optional[dict[str, typing.Any]] = None +) -> typing.Optional[str]: + """Resolve XML namespace for a property, falling back to model namespace when appropriate. + + Checks the property metadata first; if no namespace is found and the model does not declare + an explicit prefix, falls back to the model-level namespace. + + :param dict prop_meta: The property metadata dictionary. + :param dict model_meta: The model metadata dictionary, used as fallback. + :returns: The resolved namespace string, or None. + :rtype: str or None + """ + ns = _get_xml_ns(prop_meta) + if ns is None and model_meta is not None and not model_meta.get("prefix"): + ns = _get_xml_ns(model_meta) + return ns + + +def _set_xml_attribute(element: ET.Element, name: str, value: typing.Any, prop_meta: dict[str, typing.Any]) -> None: + """Set an XML attribute on an element, handling namespace prefix registration. + + :param ET.Element element: The element to set the attribute on. + :param str name: The default attribute name (wire name). + :param any value: The attribute value. + :param dict prop_meta: The property metadata dictionary. + """ + xml_name = prop_meta.get("name", name) + _attr_ns = _get_xml_ns(prop_meta) + if _attr_ns: + _attr_prefix = prop_meta.get("prefix") + if _attr_prefix: + _safe_register_namespace(_attr_prefix, _attr_ns) + xml_name = "{" + _attr_ns + "}" + xml_name + element.set(xml_name, _get_primitive_type_value(value)) + + +def _get_element( + o: typing.Any, + exclude_readonly: bool = False, + parent_meta: typing.Optional[dict[str, typing.Any]] = None, + wrapped_element: typing.Optional[ET.Element] = None, +) -> typing.Union[ET.Element, list[ET.Element]]: + if _is_model(o): + model_meta = getattr(o, "_xml", {}) + + # if prop is a model, then use the prop element directly, else generate a wrapper of model + if wrapped_element is None: + # When serializing as an array item (parent_meta is set), check if the parent has an + # explicit itemsName. This ensures correct element names for unwrapped arrays (where + # the element tag is the property/items name, not the model type name). + _items_name = parent_meta.get("itemsName") if parent_meta is not None else None + element_name = _items_name if _items_name else (model_meta.get("name") or o.__class__.__name__) + _model_ns = _get_xml_ns(model_meta) + wrapped_element = _create_xml_element( + element_name, + model_meta.get("prefix"), + _model_ns, + ) + + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + + for k, v in o.items(): + # do not serialize readonly properties + if exclude_readonly and k in readonly_props: + continue + + prop_rest_field = _get_rest_field(o._attr_to_rest_field, k) + if prop_rest_field: + prop_meta = getattr(prop_rest_field, "_xml").copy() + # use the wire name as xml name if no specific name is set + if prop_meta.get("name") is None: + prop_meta["name"] = k + else: + # additional properties will not have rest field, use the wire name as xml name + prop_meta = {"name": k} + + # Propagate model namespace to properties only for old-style "ns"-keyed models. + # DPG-generated models use the "namespace" key and explicitly declare namespace on + # each property that needs it, so propagation is intentionally skipped for them. + if prop_meta.get("ns") is None and model_meta.get("ns"): + prop_meta["ns"] = model_meta.get("ns") + prop_meta["prefix"] = model_meta.get("prefix") + + if prop_meta.get("unwrapped", False): + # unwrapped could only set on array + wrapped_element.extend(_get_element(v, exclude_readonly, prop_meta)) + elif prop_meta.get("text", False): + # text could only set on primitive type + wrapped_element.text = _get_primitive_type_value(v) + elif prop_meta.get("attribute", False): + _set_xml_attribute(wrapped_element, k, v, prop_meta) + else: + # other wrapped prop element + wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) + return wrapped_element + if isinstance(o, list): + return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore + if isinstance(o, dict): + result = [] + _dict_ns = _get_xml_ns(parent_meta) if parent_meta else None + for k, v in o.items(): + result.append( + _get_wrapped_element( + v, + exclude_readonly, + { + "name": k, + "ns": _dict_ns, + "prefix": parent_meta.get("prefix") if parent_meta else None, + }, + ) + ) + return result + + # primitive case need to create element based on parent_meta + if parent_meta: + _items_ns = parent_meta.get("itemsNs") + if _items_ns is None: + _items_ns = _get_xml_ns(parent_meta) + return _get_wrapped_element( + o, + exclude_readonly, + { + "name": parent_meta.get("itemsName", parent_meta.get("name")), + "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), + "ns": _items_ns, + }, + ) + + raise ValueError("Could not serialize value into xml: " + o) + + +def _get_wrapped_element( + v: typing.Any, + exclude_readonly: bool, + meta: typing.Optional[dict[str, typing.Any]], +) -> ET.Element: + _meta_ns = _get_xml_ns(meta) if meta else None + wrapped_element = _create_xml_element( + meta.get("name") if meta else None, meta.get("prefix") if meta else None, _meta_ns + ) + if isinstance(v, (dict, list)): + wrapped_element.extend(_get_element(v, exclude_readonly, meta)) + elif _is_model(v): + _get_element(v, exclude_readonly, meta, wrapped_element) + else: + wrapped_element.text = _get_primitive_type_value(v) + return wrapped_element # type: ignore[no-any-return] + + +def _get_primitive_type_value(v) -> str: + if v is True: + return "true" + if v is False: + return "false" + if isinstance(v, _Null): + return "" + return str(v) + + +def _safe_register_namespace(prefix: str, ns: str) -> None: + """Register an XML namespace prefix, handling reserved prefix patterns. + + Some prefixes (e.g. 'ns2') match Python's reserved 'ns\\d+' pattern used for + auto-generated prefixes, causing register_namespace to raise ValueError. + Falls back to directly registering in the internal namespace map. + + :param str prefix: The namespace prefix to register. + :param str ns: The namespace URI. + """ + try: + ET.register_namespace(prefix, ns) + except ValueError: + _ns_map = getattr(ET, "_namespace_map", None) + if _ns_map is not None: + _ns_map[ns] = prefix + + +def _create_xml_element( + tag: typing.Any, prefix: typing.Optional[str] = None, ns: typing.Optional[str] = None +) -> ET.Element: + if prefix and ns: + _safe_register_namespace(prefix, ns) + if ns: + return ET.Element("{" + ns + "}" + tag) + return ET.Element(tag) + + +def _deserialize_xml( + deserializer: typing.Any, + value: str, +) -> typing.Any: + element = ET.fromstring(value) # nosec + if _is_model(deserializer): + return deserializer._deserialize(element, []) + return _deserialize(deserializer, element) + + +def _convert_element(e: ET.Element): + # dict case + if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: + dict_result: dict[str, typing.Any] = {} + for child in e: + if dict_result.get(child.tag) is not None: + if isinstance(dict_result[child.tag], list): + dict_result[child.tag].append(_convert_element(child)) + else: + dict_result[child.tag] = [dict_result[child.tag], _convert_element(child)] + else: + dict_result[child.tag] = _convert_element(child) + dict_result.update(e.attrib) + return dict_result + # array case + if len(e) > 0: + array_result: list[typing.Any] = [] + for child in e: + array_result.append(_convert_element(child)) + return array_result + # primitive case + return e.text diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_utils/serialization.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_utils/serialization.py new file mode 100644 index 000000000000..ae08f9d89f74 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_utils/serialization.py @@ -0,0 +1,2179 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +# pyright: reportUnnecessaryTypeIgnoreComment=false + +from base64 import b64decode, b64encode +import calendar +import datetime +import decimal +import email +from enum import Enum +import json +import logging +import re +import sys +import codecs +from typing import ( + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + MutableMapping, +) + +try: + from urllib import quote # type: ignore +except ImportError: + from urllib.parse import quote +import xml.etree.ElementTree as ET + +import isodate # type: ignore + +from azure.core.exceptions import DeserializationError, SerializationError +from azure.core.serialization import NULL as CoreNull + +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + +_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") + +JSON = MutableMapping[str, Any] + + +class RawDeserializer: + + # Accept "text" because we're open minded people... + JSON_REGEXP = re.compile(r"^(application|text)/([a-z+.]+\+)?json$") + + # Name used in context + CONTEXT_NAME = "deserialized_data" + + @classmethod + def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: + """Decode data according to content-type. + + Accept a stream of data as well, but will be load at once in memory for now. + + If no content-type, will return the string version (not bytes, not stream) + + :param data: Input, could be bytes or stream (will be decoded with UTF8) or text + :type data: str or bytes or IO + :param str content_type: The content type. + :return: The deserialized data. + :rtype: object + """ + if hasattr(data, "read"): + # Assume a stream + data = cast(IO, data).read() + + if isinstance(data, bytes): + data_as_str = data.decode(encoding="utf-8-sig") + else: + # Explain to mypy the correct type. + data_as_str = cast(str, data) + + # Remove Byte Order Mark if present in string + data_as_str = data_as_str.lstrip(_BOM) + + if content_type is None: + return data + + if cls.JSON_REGEXP.match(content_type): + try: + return json.loads(data_as_str) + except ValueError as err: + raise DeserializationError("JSON is invalid: {}".format(err), err) from err + elif "xml" in (content_type or []): + try: + + try: + if isinstance(data, unicode): # type: ignore + # If I'm Python 2.7 and unicode XML will scream if I try a "fromstring" on unicode string + data_as_str = data_as_str.encode(encoding="utf-8") # type: ignore + except NameError: + pass + + return ET.fromstring(data_as_str) # nosec + except ET.ParseError as err: + # It might be because the server has an issue, and returned JSON with + # content-type XML.... + # So let's try a JSON load, and if it's still broken + # let's flow the initial exception + def _json_attemp(data): + try: + return True, json.loads(data) + except ValueError: + return False, None # Don't care about this one + + success, json_result = _json_attemp(data) + if success: + return json_result + # If i'm here, it's not JSON, it's not XML, let's scream + # and raise the last context in this block (the XML exception) + # The function hack is because Py2.7 messes up with exception + # context otherwise. + _LOGGER.critical("Wasn't XML not JSON, failing") + raise DeserializationError("XML is invalid") from err + elif content_type.startswith("text/"): + return data_as_str + raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) + + @classmethod + def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: + """Deserialize from HTTP response. + + Use bytes and headers to NOT use any requests/aiohttp or whatever + specific implementation. + Headers will tested for "content-type" + + :param bytes body_bytes: The body of the response. + :param dict headers: The headers of the response. + :returns: The deserialized data. + :rtype: object + """ + # Try to use content-type from headers if available + content_type = None + if "content-type" in headers: + content_type = headers["content-type"].split(";")[0].strip().lower() + # Ouch, this server did not declare what it sent... + # Let's guess it's JSON... + # Also, since Autorest was considering that an empty body was a valid JSON, + # need that test as well.... + else: + content_type = "application/json" + + if body_bytes: + return cls.deserialize_from_text(body_bytes, content_type) + return None + + +_LOGGER = logging.getLogger(__name__) + +try: + _long_type = long # type: ignore +except NameError: + _long_type = int + +TZ_UTC = datetime.timezone.utc + +_FLATTEN = re.compile(r"(? None: + self.additional_properties: Optional[dict[str, Any]] = {} + for k in kwargs: # pylint: disable=consider-using-dict-items + if k not in self._attribute_map: + _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) + elif k in self._validation and self._validation[k].get("readonly", False): + _LOGGER.warning("Readonly attribute %s will be ignored in class %s", k, self.__class__) + else: + setattr(self, k, kwargs[k]) + + def __eq__(self, other: Any) -> bool: + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are equal + :rtype: bool + """ + if isinstance(other, self.__class__): + return self.__dict__ == other.__dict__ + return False + + def __ne__(self, other: Any) -> bool: + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are not equal + :rtype: bool + """ + return not self.__eq__(other) + + def __str__(self) -> str: + return str(self.__dict__) + + @classmethod + def enable_additional_properties_sending(cls) -> None: + cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} + + @classmethod + def is_xml_model(cls) -> bool: + try: + cls._xml_map # type: ignore + except AttributeError: + return False + return True + + @classmethod + def _create_xml_node(cls): + """Create XML node. + + :returns: The XML node + :rtype: xml.etree.ElementTree.Element + """ + try: + xml_map = cls._xml_map # type: ignore + except AttributeError: + xml_map = {} + + return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) + + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: + """Return the JSON that would be sent to server from this model. + + This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, keep_readonly=keep_readonly, **kwargs + ) + + def as_dict( + self, + keep_readonly: bool = True, + key_transformer: Callable[[str, dict[str, Any], Any], Any] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. + + Advanced usage might optionally use a callback as parameter: + + .. code::python + + def my_key_transformer(key, attr_desc, value): + return key + + Key is the attribute name used in Python. Attr_desc + is a dict of metadata. Currently contains 'type' with the + msrest type and 'key' with the RestAPI encoded key. + Value is the current value in this object. + + The string returned will be used to serialize the key. + If the return type is a list, this is considered hierarchical + result dict. + + See the three examples in this file: + + - attribute_transformer + - full_restapi_key_transformer + - last_restapi_key_transformer + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :param function key_transformer: A key transformer function. + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs + ) + + @classmethod + def _infer_class_models(cls): + try: + str_models = cls.__module__.rsplit(".", 1)[0] + models = sys.modules[str_models] + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + if cls.__name__ not in client_models: + raise ValueError("Not Autorest generated code") + except Exception: # pylint: disable=broad-exception-caught + # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. + client_models = {cls.__name__: cls} + return client_models + + @classmethod + def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: + """Parse a str using the RestAPI syntax and return a model. + + :param str data: A str using RestAPI structure. JSON by default. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises DeserializationError: if something went wrong + :rtype: Self + """ + deserializer = Deserializer(cls._infer_class_models()) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def from_dict( + cls, + data: Any, + key_extractors: Optional[Callable[[str, dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> Self: + """Parse a dict using given key extractor return a model. + + By default consider key + extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor + and last_rest_key_case_insensitive_extractor) + + :param dict data: A dict using RestAPI structure + :param function key_extractors: A key extractor function. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises DeserializationError: if something went wrong + :rtype: Self + """ + deserializer = Deserializer(cls._infer_class_models()) + deserializer.key_extractors = ( # type: ignore + [ # type: ignore + attribute_key_case_insensitive_extractor, + rest_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + if key_extractors is None + else key_extractors + ) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def _flatten_subtype(cls, key, objects): + if "_subtype_map" not in cls.__dict__: + return {} + result = dict(cls._subtype_map[key]) + for valuetype in cls._subtype_map[key].values(): + result |= objects[valuetype]._flatten_subtype(key, objects) # pylint: disable=protected-access + return result + + @classmethod + def _classify(cls, response, objects): + """Check the class _subtype_map for any child classes. + We want to ignore any inherited _subtype_maps. + + :param dict response: The initial data + :param dict objects: The class objects + :returns: The class to be used + :rtype: class + """ + for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): + subtype_value = None + + if not isinstance(response, ET.Element): + rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] + subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None) + else: + subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) + if subtype_value: + # Try to match base class. Can be class name only + # (bug to fix in Autorest to support x-ms-discriminator-name) + if cls.__name__ == subtype_value: + return cls + flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) + try: + return objects[flatten_mapping_type[subtype_value]] # type: ignore + except KeyError: + _LOGGER.warning( + "Subtype value %s has no mapping, use base class %s.", + subtype_value, + cls.__name__, + ) + break + else: + _LOGGER.warning("Discriminator %s is absent or null, use base class %s.", subtype_key, cls.__name__) + break + return cls + + @classmethod + def _get_rest_key_parts(cls, attr_key): + """Get the RestAPI key of this attr, split it and decode part + :param str attr_key: Attribute key must be in attribute_map. + :returns: A list of RestAPI part + :rtype: list + """ + rest_split_key = _FLATTEN.split(cls._attribute_map[attr_key]["key"]) + return [_decode_attribute_map_key(key_part) for key_part in rest_split_key] + + +def _decode_attribute_map_key(key): + """This decode a key in an _attribute_map to the actual key we want to look at + inside the received data. + + :param str key: A key string from the generated code + :returns: The decoded key + :rtype: str + """ + return key.replace("\\.", ".") + + +class Serializer: # pylint: disable=too-many-public-methods + """Request object model serializer. + + :param classes: Mapping of model names to model types, used to resolve models during serialization. + :type classes: typing.Optional[typing.Mapping[str, type]] + """ + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + _xml_basic_types_serializers = {"bool": lambda x: str(x).lower()} + days = {0: "Mon", 1: "Tue", 2: "Wed", 3: "Thu", 4: "Fri", 5: "Sat", 6: "Sun"} + months = { + 1: "Jan", + 2: "Feb", + 3: "Mar", + 4: "Apr", + 5: "May", + 6: "Jun", + 7: "Jul", + 8: "Aug", + 9: "Sep", + 10: "Oct", + 11: "Nov", + 12: "Dec", + } + validation = { + "min_length": lambda x, y: len(x) < y, + "max_length": lambda x, y: len(x) > y, + "minimum": lambda x, y: x < y, + "maximum": lambda x, y: x > y, + "minimum_ex": lambda x, y: x <= y, + "maximum_ex": lambda x, y: x >= y, + "min_items": lambda x, y: len(x) < y, + "max_items": lambda x, y: len(x) > y, + "pattern": lambda x, y: not re.match(y, x, re.UNICODE), + "unique": lambda x, y: len(x) != len(set(x)), + "multiple": lambda x, y: x % y != 0, + } + + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: + self.serialize_type = { + "iso-8601": Serializer.serialize_iso, + "rfc-1123": Serializer.serialize_rfc, + "unix-time": Serializer.serialize_unix, + "duration": Serializer.serialize_duration, + "duration-seconds-int": Serializer.serialize_duration_seconds_int, + "duration-seconds-float": Serializer.serialize_duration_seconds_float, + "duration-milliseconds-int": Serializer.serialize_duration_milliseconds_int, + "duration-milliseconds-float": Serializer.serialize_duration_milliseconds_float, + "date": Serializer.serialize_date, + "time": Serializer.serialize_time, + "decimal": Serializer.serialize_decimal, + "long": Serializer.serialize_long, + "bytearray": Serializer.serialize_bytearray, + "base64": Serializer.serialize_base64, + "object": self.serialize_object, + "[]": self.serialize_iter, + "{}": self.serialize_dict, + } + self.dependencies: dict[str, type] = dict(classes) if classes else {} + self.key_transformer = full_restapi_key_transformer + self.client_side_validation = True + + def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals + self, target_obj, data_type=None, **kwargs + ): + """Serialize data into a string according to type. + + :param object target_obj: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, dict + :raises SerializationError: if serialization fails. + :returns: The serialized data. + """ + key_transformer = kwargs.get("key_transformer", self.key_transformer) + keep_readonly = kwargs.get("keep_readonly", False) + if target_obj is None: + return None + + attr_name = None + class_name = target_obj.__class__.__name__ + + if data_type: + return self.serialize_data(target_obj, data_type, **kwargs) + + if not hasattr(target_obj, "_attribute_map"): + data_type = type(target_obj).__name__ + if data_type in self.basic_types.values(): + return self.serialize_data(target_obj, data_type, **kwargs) + + # Force "is_xml" kwargs if we detect a XML model + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + is_xml_model_serialization = kwargs.setdefault("is_xml", target_obj.is_xml_model()) + + serialized = {} + if is_xml_model_serialization: + serialized = target_obj._create_xml_node() # pylint: disable=protected-access + try: + attributes = target_obj._attribute_map # pylint: disable=protected-access + for attr, attr_desc in attributes.items(): + attr_name = attr + if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access + attr_name, {} + ).get("readonly", False): + continue + + if attr_name == "additional_properties" and attr_desc["key"] == "": + if target_obj.additional_properties is not None: + serialized |= target_obj.additional_properties + continue + try: + + orig_attr = getattr(target_obj, attr) + if is_xml_model_serialization: + pass # Don't provide "transformer" for XML for now. Keep "orig_attr" + else: # JSON + keys, orig_attr = key_transformer(attr, attr_desc.copy(), orig_attr) + keys = keys if isinstance(keys, list) else [keys] + + kwargs["serialization_ctxt"] = attr_desc + new_attr = self.serialize_data(orig_attr, attr_desc["type"], **kwargs) + + if is_xml_model_serialization: + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + xml_prefix = xml_desc.get("prefix", None) + xml_ns = xml_desc.get("ns", None) + if xml_desc.get("attr", False): + if xml_ns: + ET.register_namespace(xml_prefix, xml_ns) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + serialized.set(xml_name, new_attr) # type: ignore + continue + if xml_desc.get("text", False): + serialized.text = new_attr # type: ignore + continue + if isinstance(new_attr, list): + serialized.extend(new_attr) # type: ignore + elif isinstance(new_attr, ET.Element): + # If the down XML has no XML/Name, + # we MUST replace the tag with the local tag. But keeping the namespaces. + if "name" not in getattr(orig_attr, "_xml_map", {}): + splitted_tag = new_attr.tag.split("}") + if len(splitted_tag) == 2: # Namespace + new_attr.tag = "}".join([splitted_tag[0], xml_name]) + else: + new_attr.tag = xml_name + serialized.append(new_attr) # type: ignore + else: # That's a basic type + # Integrate namespace if necessary + local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) + local_node.text = str(new_attr) + serialized.append(local_node) # type: ignore + else: # JSON + for k in reversed(keys): # type: ignore + new_attr = {k: new_attr} + + _new_attr = new_attr + _serialized = serialized + for k in keys: # type: ignore + if k not in _serialized: + _serialized.update(_new_attr) # type: ignore + _new_attr = _new_attr[k] # type: ignore + _serialized = _serialized[k] + except ValueError as err: + if isinstance(err, SerializationError): + raise + + except (AttributeError, KeyError, TypeError) as err: + msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) + raise SerializationError(msg) from err + return serialized + + def body(self, data, data_type, **kwargs): + """Serialize data intended for a request body. + + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: dict + :raises SerializationError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized request body + """ + + # Just in case this is a dict + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + if internal_data_type and issubclass(internal_data_type, Model): + is_xml_model_serialization = kwargs.setdefault("is_xml", internal_data_type.is_xml_model()) + else: + is_xml_model_serialization = False + if internal_data_type and not isinstance(internal_data_type, Enum): + try: + deserializer = Deserializer(self.dependencies) + # Since it's on serialization, it's almost sure that format is not JSON REST + # We're not able to deal with additional properties for now. + deserializer.additional_properties_detection = False + if is_xml_model_serialization: + deserializer.key_extractors = [ # type: ignore + attribute_key_case_insensitive_extractor, + ] + else: + deserializer.key_extractors = [ + rest_key_case_insensitive_extractor, + attribute_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access + except DeserializationError as err: + raise SerializationError("Unable to build a model: " + str(err)) from err + + return self._serialize(data, data_type, **kwargs) + + def url(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL path. + + :param str name: The name of the URL path parameter. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :returns: The serialized URL path + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + """ + try: + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + + if kwargs.get("skip_quote") is True: + output = str(output) + output = output.replace("{", quote("{")).replace("}", quote("}")) + else: + output = quote(str(output), safe="") + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return output + + def query(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL query. + + :param str name: The name of the query parameter. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, list + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized query parameter + """ + try: + # Treat the list aside, since we don't want to encode the div separator + if data_type.startswith("["): + internal_data_type = data_type[1:-1] + do_quote = not kwargs.get("skip_quote", False) + return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs) + + # Not a list, regular serialization + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + if kwargs.get("skip_quote") is True: + output = str(output) + else: + output = quote(str(output), safe="") + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) + + def header(self, name, data, data_type, **kwargs): + """Serialize data intended for a request header. + + :param str name: The name of the header. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized header + """ + try: + if data_type in ["[str]"]: + data = ["" if d is None else d for d in data] + + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) + + def serialize_data(self, data, data_type, **kwargs): + """Serialize generic data according to supplied data type. + + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :raises AttributeError: if required data is None. + :raises ValueError: if data is None + :raises SerializationError: if serialization fails. + :returns: The serialized data. + :rtype: str, int, float, bool, dict, list + """ + if data is None: + raise ValueError("No value for given attribute") + + try: + if data is CoreNull: + return None + if data_type in self.basic_types.values(): + return self.serialize_basic(data, data_type, **kwargs) + + if data_type in self.serialize_type: + return self.serialize_type[data_type](data, **kwargs) + + # If dependencies is empty, try with current data class + # It has to be a subclass of Enum anyway + enum_type = self.dependencies.get(data_type, cast(type, data.__class__)) + if issubclass(enum_type, Enum): + return Serializer.serialize_enum(data, enum_obj=enum_type) + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.serialize_type: + return self.serialize_type[iter_type](data, data_type[1:-1], **kwargs) + + except (ValueError, TypeError) as err: + msg = "Unable to serialize value: {!r} as type: {!r}." + raise SerializationError(msg.format(data, data_type)) from err + return self._serialize(data, **kwargs) + + @classmethod + def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements + custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) + if custom_serializer: + return custom_serializer + if kwargs.get("is_xml", False): + return cls._xml_basic_types_serializers.get(data_type) + + @classmethod + def serialize_basic(cls, data, data_type, **kwargs): + """Serialize basic builting data type. + Serializes objects to str, int, float or bool. + + Possible kwargs: + - basic_types_serializers dict[str, callable] : If set, use the callable as serializer + - is_xml bool : If set, use xml_basic_types_serializers + + :param obj data: Object to be serialized. + :param str data_type: Type of object in the iterable. + :rtype: str, int, float, bool + :return: serialized object + :raises TypeError: raise if data_type is not one of str, int, float, bool. + """ + custom_serializer = cls._get_custom_serializers(data_type, **kwargs) + if custom_serializer: + return custom_serializer(data) + if data_type == "str": + return cls.serialize_unicode(data) + if data_type == "int": + return int(data) + if data_type == "float": + return float(data) + if data_type == "bool": + return bool(data) + raise TypeError("Unknown basic data type: {}".format(data_type)) + + @classmethod + def serialize_unicode(cls, data): + """Special handling for serializing unicode strings in Py2. + Encode to UTF-8 if unicode, otherwise handle as a str. + + :param str data: Object to be serialized. + :rtype: str + :return: serialized object + """ + try: # If I received an enum, return its value + return data.value + except AttributeError: + pass + + try: + if isinstance(data, unicode): # type: ignore + # Don't change it, JSON and XML ElementTree are totally able + # to serialize correctly u'' strings + return data + except NameError: + return str(data) + return str(data) + + def serialize_iter(self, data, iter_type, div=None, **kwargs): + """Serialize iterable. + + Supported kwargs: + - serialization_ctxt dict : The current entry of _attribute_map, or same format. + serialization_ctxt['type'] should be same as data_type. + - is_xml bool : If set, serialize as XML + + :param list data: Object to be serialized. + :param str iter_type: Type of object in the iterable. + :param str div: If set, this str will be used to combine the elements + in the iterable into a combined string. Default is 'None'. + Defaults to False. + :rtype: list, str + :return: serialized iterable + """ + if isinstance(data, str): + raise SerializationError("Refuse str type as a valid iter type.") + + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + is_xml = kwargs.get("is_xml", False) + + serialized = [] + for d in data: + try: + serialized.append(self.serialize_data(d, iter_type, **kwargs)) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized.append(None) + + if kwargs.get("do_quote", False): + serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] + + if div: + serialized = ["" if s is None else str(s) for s in serialized] + serialized = div.join(serialized) + + if "xml" in serialization_ctxt or is_xml: + # XML serialization is more complicated + xml_desc = serialization_ctxt.get("xml", {}) + xml_name = xml_desc.get("name") + if not xml_name: + xml_name = serialization_ctxt["key"] + + # Create a wrap node if necessary (use the fact that Element and list have "append") + is_wrapped = xml_desc.get("wrapped", False) + node_name = xml_desc.get("itemsName", xml_name) + if is_wrapped: + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + else: + final_result = [] + # All list elements to "local_node" + for el in serialized: + if isinstance(el, ET.Element): + el_node = el + else: + el_node = _create_xml_node(node_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + if el is not None: # Otherwise it writes "None" :-p + el_node.text = str(el) + final_result.append(el_node) + return final_result + return serialized + + def serialize_dict(self, attr, dict_type, **kwargs): + """Serialize a dictionary of objects. + + :param dict attr: Object to be serialized. + :param str dict_type: Type of object in the dictionary. + :rtype: dict + :return: serialized dictionary + """ + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized[self.serialize_unicode(key)] = None + + if "xml" in serialization_ctxt: + # XML serialization is more complicated + xml_desc = serialization_ctxt["xml"] + xml_name = xml_desc["name"] + + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + for key, value in serialized.items(): + ET.SubElement(final_result, key).text = value + return final_result + + return serialized + + def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements + """Serialize a generic object. + This will be handled as a dictionary. If object passed in is not + a basic type (str, int, float, dict, list) it will simply be + cast to str. + + :param dict attr: Object to be serialized. + :rtype: dict or str + :return: serialized object + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + return attr + obj_type = type(attr) + if obj_type in self.basic_types: + return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) + if obj_type is _long_type: + return self.serialize_long(attr) + if obj_type is str: + return self.serialize_unicode(attr) + if obj_type is datetime.datetime: + return self.serialize_iso(attr) + if obj_type is datetime.date: + return self.serialize_date(attr) + if obj_type is datetime.time: + return self.serialize_time(attr) + if obj_type is datetime.timedelta: + return self.serialize_duration(attr) + if obj_type is decimal.Decimal: + return self.serialize_decimal(attr) + + # If it's a model or I know this dependency, serialize as a Model + if obj_type in self.dependencies.values() or isinstance(attr, Model): + return self._serialize(attr) + + if obj_type == dict: + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_object(value, **kwargs) + except ValueError: + serialized[self.serialize_unicode(key)] = None + return serialized + + if obj_type == list: + serialized = [] + for obj in attr: + try: + serialized.append(self.serialize_object(obj, **kwargs)) + except ValueError: + pass + return serialized + return str(attr) + + @staticmethod + def serialize_enum(attr, enum_obj=None): + try: + result = attr.value + except AttributeError: + result = attr + try: + enum_obj(result) # type: ignore + return result + except ValueError as exc: + for enum_value in enum_obj: # type: ignore + if enum_value.value.lower() == str(attr).lower(): + return enum_value.value + error = "{!r} is not valid value for enum {!r}" + raise SerializationError(error.format(attr, enum_obj)) from exc + + @staticmethod + def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument + """Serialize bytearray into base-64 string. + + :param str attr: Object to be serialized. + :rtype: str + :return: serialized base64 + """ + return b64encode(attr).decode() + + @staticmethod + def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument + """Serialize str into base-64 string. + + :param str attr: Object to be serialized. + :rtype: str + :return: serialized base64 + """ + encoded = b64encode(attr).decode("ascii") + return encoded.strip("=").replace("+", "-").replace("/", "_") + + @staticmethod + def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Decimal object to float. + + :param decimal attr: Object to be serialized. + :rtype: float + :return: serialized decimal + """ + return float(attr) + + @staticmethod + def serialize_long(attr, **kwargs): # pylint: disable=unused-argument + """Serialize long (Py2) or int (Py3). + + :param int attr: Object to be serialized. + :rtype: int/long + :return: serialized long + """ + return _long_type(attr) + + @staticmethod + def serialize_date(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Date object into ISO-8601 formatted string. + + :param Date attr: Object to be serialized. + :rtype: str + :return: serialized date + """ + if isinstance(attr, str): + attr = isodate.parse_date(attr) + t = "{:04}-{:02}-{:02}".format(attr.year, attr.month, attr.day) + return t + + @staticmethod + def serialize_time(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Time object into ISO-8601 formatted string. + + :param datetime.time attr: Object to be serialized. + :rtype: str + :return: serialized time + """ + if isinstance(attr, str): + attr = isodate.parse_time(attr) + t = "{:02}:{:02}:{:02}".format(attr.hour, attr.minute, attr.second) + if attr.microsecond: + t += ".{:02}".format(attr.microsecond) + return t + + @staticmethod + def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into ISO-8601 formatted string. + + :param TimeDelta attr: Object to be serialized. + :rtype: str + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + return isodate.duration_isoformat(attr) + + @staticmethod + def _serialize_duration_numeric(attr, scale, as_int): + """Serialize a TimeDelta into a numeric value scaled to the wire unit. + + :param TimeDelta attr: Object to be serialized. + :param int scale: Multiplier applied to total seconds (1 for seconds, 1000 for milliseconds). + :param bool as_int: Whether to truncate the result to an int. + :rtype: int or float + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + value = attr.total_seconds() * scale if isinstance(attr, datetime.timedelta) else attr + return int(value) if as_int else float(value) + + @staticmethod + def serialize_duration_seconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, True) + + @staticmethod + def serialize_duration_seconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, False) + + @staticmethod + def serialize_duration_milliseconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, True) + + @staticmethod + def serialize_duration_milliseconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, False) + + @staticmethod + def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into RFC-1123 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises TypeError: if format invalid. + :return: serialized rfc + """ + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + except AttributeError as exc: + raise TypeError("RFC1123 object must be valid Datetime object.") from exc + + return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( + Serializer.days[utc.tm_wday], + utc.tm_mday, + Serializer.months[utc.tm_mon], + utc.tm_year, + utc.tm_hour, + utc.tm_min, + utc.tm_sec, + ) + + @staticmethod + def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into ISO-8601 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises SerializationError: if format invalid. + :return: serialized iso + """ + if isinstance(attr, str): + attr = isodate.parse_datetime(attr) + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + if utc.tm_year > 9999 or utc.tm_year < 1: + raise OverflowError("Hit max or min date") + + microseconds = str(attr.microsecond).rjust(6, "0").rstrip("0").ljust(3, "0") + if microseconds: + microseconds = "." + microseconds + date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format( + utc.tm_year, utc.tm_mon, utc.tm_mday, utc.tm_hour, utc.tm_min, utc.tm_sec + ) + return date + microseconds + "Z" + except (ValueError, OverflowError) as err: + msg = "Unable to serialize datetime object." + raise SerializationError(msg) from err + except AttributeError as err: + msg = "ISO-8601 object must be valid Datetime object." + raise TypeError(msg) from err + + @staticmethod + def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param Datetime attr: Object to be serialized. + :rtype: int + :raises SerializationError: if format invalid + :return: serialied unix + """ + if isinstance(attr, int): + return attr + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + return int(calendar.timegm(attr.utctimetuple())) + except AttributeError as exc: + raise TypeError("Unix time object must be valid Datetime object.") from exc + + +def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + key = attr_desc["key"] + working_data = data + + while "." in key: + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(list[str], _FLATTEN.split(key)) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = working_data.get(working_key, data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + return working_data.get(key) + + +def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements + attr, attr_desc, data +): + key = attr_desc["key"] + working_data = data + + while "." in key: + dict_keys = _FLATTEN.split(key) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = attribute_key_case_insensitive_extractor(working_key, None, working_data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + if working_data: + return attribute_key_case_insensitive_extractor(key, None, working_data) + + +def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_extractor(dict_keys[-1], None, data) + + +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + This is the case insensitive version of "last_rest_key_extractor" + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_case_insensitive_extractor(dict_keys[-1], None, data) + + +def attribute_key_extractor(attr, _, data): + return data.get(attr) + + +def attribute_key_case_insensitive_extractor(attr, _, data): + found_key = None + lower_attr = attr.lower() + for key in data: + if lower_attr == key.lower(): + found_key = key + break + + return data.get(found_key) + + +def _extract_name_from_internal_type(internal_type): + """Given an internal type XML description, extract correct XML name with namespace. + + :param dict internal_type: An model type + :rtype: tuple + :returns: A tuple XML name + namespace dict + """ + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + xml_name = internal_type_xml_map.get("name", internal_type.__name__) + xml_ns = internal_type_xml_map.get("ns", None) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + return xml_name + + +def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements + if isinstance(data, dict): + return None + + # Test if this model is XML ready first + if not isinstance(data, ET.Element): + return None + + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + + # Look for a children + is_iter_type = attr_desc["type"].startswith("[") + is_wrapped = xml_desc.get("wrapped", False) + internal_type = attr_desc.get("internalType", None) + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + + # Integrate namespace if necessary + xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + + # If it's an attribute, that's simple + if xml_desc.get("attr", False): + return data.get(xml_name) + + # If it's x-ms-text, that's simple too + if xml_desc.get("text", False): + return data.text + + # Scenario where I take the local name: + # - Wrapped node + # - Internal type is an enum (considered basic types) + # - Internal type has no XML/Name node + if is_wrapped or (internal_type and (issubclass(internal_type, Enum) or "name" not in internal_type_xml_map)): + children = data.findall(xml_name) + # If internal type has a local name and it's not a list, I use that name + elif not is_iter_type and internal_type and "name" in internal_type_xml_map: + xml_name = _extract_name_from_internal_type(internal_type) + children = data.findall(xml_name) + # That's an array + else: + if internal_type: # Complex type, ignore itemsName and use the complex type name + items_name = _extract_name_from_internal_type(internal_type) + else: + items_name = xml_desc.get("itemsName", xml_name) + children = data.findall(items_name) + + if len(children) == 0: + if is_iter_type: + if is_wrapped: + return None # is_wrapped no node, we want None + return [] # not wrapped, assume empty list + return None # Assume it's not there, maybe an optional node. + + # If is_iter_type and not wrapped, return all found children + if is_iter_type: + if not is_wrapped: + return children + # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( + xml_name + ) + ) + return list(children[0]) # Might be empty list and that's ok. + + # Here it's not a itertype, we should have found one element only or empty + if len(children) > 1: + raise DeserializationError("Find several XML '{}' where it was not expected".format(xml_name)) + return children[0] + + +class Deserializer: + """Response object model deserializer. + + :param dict classes: Class type dictionary for deserializing complex types. + :ivar list key_extractors: Ordered list of extractors to be used by this deserializer. + """ + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") + + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: + self.deserialize_type = { + "iso-8601": Deserializer.deserialize_iso, + "rfc-1123": Deserializer.deserialize_rfc, + "unix-time": Deserializer.deserialize_unix, + "duration": Deserializer.deserialize_duration, + "duration-seconds-int": Deserializer.deserialize_duration_seconds, + "duration-seconds-float": Deserializer.deserialize_duration_seconds, + "duration-milliseconds-int": Deserializer.deserialize_duration_milliseconds, + "duration-milliseconds-float": Deserializer.deserialize_duration_milliseconds, + "date": Deserializer.deserialize_date, + "time": Deserializer.deserialize_time, + "decimal": Deserializer.deserialize_decimal, + "long": Deserializer.deserialize_long, + "bytearray": Deserializer.deserialize_bytearray, + "base64": Deserializer.deserialize_base64, + "object": self.deserialize_object, + "[]": self.deserialize_iter, + "{}": self.deserialize_dict, + } + self.deserialize_expected_types = { + "duration": (isodate.Duration, datetime.timedelta), + "duration-seconds-int": (isodate.Duration, datetime.timedelta), + "duration-seconds-float": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-int": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-float": (isodate.Duration, datetime.timedelta), + "iso-8601": (datetime.datetime), + } + self.dependencies: dict[str, type] = dict(classes) if classes else {} + self.key_extractors = [rest_key_extractor, xml_key_extractor] + # Additional properties only works if the "rest_key_extractor" is used to + # extract the keys. Making it to work whatever the key extractor is too much + # complicated, with no real scenario for now. + # So adding a flag to disable additional properties detection. This flag should be + # used if your expect the deserialization to NOT come from a JSON REST syntax. + # Otherwise, result are unexpected + self.additional_properties_detection = True + + def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements + """Call the deserializer to process a REST response. + + :param str target_obj: Target data type to deserialize to. + :param requests.Response response_data: REST response object. + :param str content_type: Swagger "produces" if available. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + # Fast path for header deserialization: response_data is a plain str or None + # and target_obj is a simple scalar type. This avoids the expensive + # _unpack_content → _deserialize → _classify_target → deserialize_data chain. + if response_data is None: + return None + if target_obj == "str" and isinstance(response_data, str): + return response_data + if isinstance(response_data, str): + if target_obj == "int": + return int(response_data) + if target_obj == "bool": + if response_data in ("true", "1", "True"): + return True + if response_data in ("false", "0", "False"): + return False + return bool(response_data) + if target_obj == "rfc-1123": + return Deserializer.deserialize_rfc(response_data) + if target_obj == "bytearray": + return Deserializer.deserialize_bytearray(response_data) + + data = self._unpack_content(response_data, content_type) + return self._deserialize(target_obj, data) + + def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements + """Call the deserializer on a model. + + Data needs to be already deserialized as JSON or XML ElementTree + + :param str target_obj: Target data type to deserialize to. + :param object data: Object to deserialize. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + # This is already a model, go recursive just in case + if hasattr(data, "_attribute_map"): + constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] + try: + for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access + if attr in constants: + continue + value = getattr(data, attr) + if value is None: + continue + local_type = mapconfig["type"] + internal_data_type = local_type.strip("[]{}") + if internal_data_type not in self.dependencies or isinstance(internal_data_type, Enum): + continue + setattr(data, attr, self._deserialize(local_type, value)) + return data + except AttributeError: + return + + response, class_name = self._classify_target(target_obj, data) + + if isinstance(response, str): + return self.deserialize_data(data, response) + if isinstance(response, type) and issubclass(response, Enum): + return self.deserialize_enum(data, response) + + if data is None or data is CoreNull: + return data + try: + attributes = response._attribute_map # type: ignore # pylint: disable=protected-access + d_attrs = {} + for attr, attr_desc in attributes.items(): + # Check empty string. If it's not empty, someone has a real "additionalProperties"... + if attr == "additional_properties" and attr_desc["key"] == "": + continue + raw_value = None + # Enhance attr_desc with some dynamic data + attr_desc = attr_desc.copy() # Do a copy, do not change the real one + internal_data_type = attr_desc["type"].strip("[]{}") + if internal_data_type in self.dependencies: + attr_desc["internalType"] = self.dependencies[internal_data_type] + + for key_extractor in self.key_extractors: + found_value = key_extractor(attr, attr_desc, data) + if found_value is not None: + if raw_value is not None and raw_value != found_value: + msg = ( + "Ignoring extracted value '%s' from %s for key '%s'" + " (duplicate extraction, follow extractors order)" + ) + _LOGGER.warning(msg, found_value, key_extractor, attr) + continue + raw_value = found_value + + value = self.deserialize_data(raw_value, attr_desc["type"]) + d_attrs[attr] = value + except (AttributeError, TypeError, KeyError) as err: + msg = "Unable to deserialize to object: " + class_name # type: ignore + raise DeserializationError(msg) from err + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) + + def _build_additional_properties(self, attribute_map, data): + if not self.additional_properties_detection: + return None + if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != "": + # Check empty string. If it's not empty, someone has a real "additionalProperties" + return None + if isinstance(data, ET.Element): + data = {el.tag: el.text for el in data} + + known_keys = { + _decode_attribute_map_key(_FLATTEN.split(desc["key"])[0]) + for desc in attribute_map.values() + if desc["key"] != "" + } + present_keys = set(data.keys()) + missing_keys = present_keys - known_keys + return {key: data[key] for key in missing_keys} + + def _classify_target(self, target, data): + """Check to see whether the deserialization target object can + be classified into a subclass. + Once classification has been determined, initialize object. + + :param str target: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :return: The classified target object and its class name. + :rtype: tuple + """ + if target is None: + return None, None + + if isinstance(target, str): + try: + target = self.dependencies[target] + except KeyError: + return target, target + + try: + target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access + except AttributeError: + pass # Target is not a Model, no classify + return target, target.__class__.__name__ # type: ignore + + def failsafe_deserialize(self, target_obj, data, content_type=None): + """Ignores any errors encountered in deserialization, + and falls back to not deserializing the object. Recommended + for use in error deserialization, as we want to return the + HttpResponseError to users, and not have them deal with + a deserialization error. + + :param str target_obj: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :param str content_type: Swagger "produces" if available. + :return: Deserialized object. + :rtype: object + """ + try: + return self(target_obj, data, content_type=content_type) + except: # pylint: disable=bare-except + _LOGGER.debug( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + @staticmethod + def _unpack_content(raw_data, content_type=None): + """Extract the correct structure for deserialization. + + If raw_data is a PipelineResponse, try to extract the result of RawDeserializer. + if we can't, raise. Your Pipeline should have a RawDeserializer. + + If not a pipeline response and raw_data is bytes or string, use content-type + to decode it. If no content-type, try JSON. + + If raw_data is something else, bypass all logic and return it directly. + + :param obj raw_data: Data to be processed. + :param str content_type: How to parse if raw_data is a string/bytes. + :raises JSONDecodeError: If JSON is requested and parsing is impossible. + :raises UnicodeDecodeError: If bytes is not UTF8 + :rtype: object + :return: Unpacked content. + """ + # Assume this is enough to detect a Pipeline Response without importing it + context = getattr(raw_data, "context", {}) + if context: + if RawDeserializer.CONTEXT_NAME in context: + return context[RawDeserializer.CONTEXT_NAME] + raise ValueError("This pipeline didn't have the RawDeserializer policy; can't deserialize") + + # Assume this is enough to recognize universal_http.ClientResponse without importing it + if hasattr(raw_data, "body"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text(), raw_data.headers) + + # Assume this enough to recognize requests.Response without importing it. + if hasattr(raw_data, "_content_consumed"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) + + if isinstance(raw_data, (str, bytes)) or hasattr(raw_data, "read"): + return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore + return raw_data + + def _instantiate_model(self, response, attrs, additional_properties=None): + """Instantiate a response model passing in deserialized args. + + :param Response response: The response model class. + :param dict attrs: The deserialized response attributes. + :param dict additional_properties: Additional properties to be set. + :rtype: Response + :return: The instantiated response model. + """ + if callable(response): + subtype = getattr(response, "_subtype_map", {}) + try: + readonly = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("readonly") + ] + const = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("constant") + ] + kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} + response_obj = response(**kwargs) + for attr in readonly: + setattr(response_obj, attr, attrs.get(attr)) + if additional_properties: + response_obj.additional_properties = additional_properties # type: ignore + return response_obj + except TypeError as err: + msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore + raise DeserializationError(msg + str(err)) from err + else: + try: + for attr, value in attrs.items(): + setattr(response, attr, value) + return response + except Exception as exp: + msg = "Unable to populate response model. " + msg += "Type: {}, Error: {}".format(type(response), exp) + raise DeserializationError(msg) from exp + + def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements + """Process data for deserialization according to data type. + + :param str data: The response string to be deserialized. + :param str data_type: The type to deserialize to. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + if data is None: + return data + + try: + if not data_type: + return data + if data_type in self.basic_types.values(): + return self.deserialize_basic(data, data_type) + if data_type in self.deserialize_type: + if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): + return data + + is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment + "object", + "[]", + r"{}", + ] + if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: + return None + data_val = self.deserialize_type[data_type](data) + return data_val + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.deserialize_type: + return self.deserialize_type[iter_type](data, data_type[1:-1]) + + obj_type = self.dependencies[data_type] + if issubclass(obj_type, Enum): + if isinstance(data, ET.Element): + data = data.text + return self.deserialize_enum(data, obj_type) + + except (ValueError, TypeError, AttributeError) as err: + msg = "Unable to deserialize response data." + msg += " Data: {}, {}".format(data, data_type) + raise DeserializationError(msg) from err + return self._deserialize(obj_type, data) + + def deserialize_iter(self, attr, iter_type): + """Deserialize an iterable. + + :param list attr: Iterable to be deserialized. + :param str iter_type: The type of object in the iterable. + :return: Deserialized iterable. + :rtype: list + """ + if attr is None: + return None + if isinstance(attr, ET.Element): # If I receive an element here, get the children + attr = list(attr) + if not isinstance(attr, (list, set)): + raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format(iter_type, type(attr))) + return [self.deserialize_data(a, iter_type) for a in attr] + + def deserialize_dict(self, attr, dict_type): + """Deserialize a dictionary. + + :param dict/list attr: Dictionary to be deserialized. Also accepts + a list of key, value pairs. + :param str dict_type: The object type of the items in the dictionary. + :return: Deserialized dictionary. + :rtype: dict + """ + if isinstance(attr, list): + return {x["key"]: self.deserialize_data(x["value"], dict_type) for x in attr} + + if isinstance(attr, ET.Element): + # Transform value into {"Key": "value"} + attr = {el.tag: el.text for el in attr} + return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} + + def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements + """Deserialize a generic object. + This will be handled as a dictionary. + + :param dict attr: Dictionary to be deserialized. + :return: Deserialized object. + :rtype: dict + :raises TypeError: if non-builtin datatype encountered. + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + # Do no recurse on XML, just return the tree as-is + return attr + if isinstance(attr, str): + return self.deserialize_basic(attr, "str") + obj_type = type(attr) + if obj_type in self.basic_types: + return self.deserialize_basic(attr, self.basic_types[obj_type]) + if obj_type is _long_type: + return self.deserialize_long(attr) + + if obj_type == dict: + deserialized = {} + for key, value in attr.items(): + try: + deserialized[key] = self.deserialize_object(value, **kwargs) + except ValueError: + deserialized[key] = None + return deserialized + + if obj_type == list: + deserialized = [] + for obj in attr: + try: + deserialized.append(self.deserialize_object(obj, **kwargs)) + except ValueError: + pass + return deserialized + + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) + + def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements + """Deserialize basic builtin data type from string. + Will attempt to convert to str, int, float and bool. + This function will also accept '1', '0', 'true' and 'false' as + valid bool values. + + :param str attr: response string to be deserialized. + :param str data_type: deserialization data type. + :return: Deserialized basic type. + :rtype: str, int, float or bool + :raises TypeError: if string format is not valid or data_type is not one of str, int, float, bool. + """ + # If we're here, data is supposed to be a basic type. + # If it's still an XML node, take the text + if isinstance(attr, ET.Element): + attr = attr.text + if not attr: + if data_type == "str": + # None or '', node is empty string. + return "" + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None + + if data_type == "bool": + if attr in [True, False, 1, 0]: + return bool(attr) + if isinstance(attr, str): + if attr.lower() in ["true", "1"]: + return True + if attr.lower() in ["false", "0"]: + return False + raise TypeError("Invalid boolean value: {}".format(attr)) + + if data_type == "str": + return self.deserialize_unicode(attr) + if data_type == "int": + return int(attr) + if data_type == "float": + return float(attr) + raise TypeError("Unknown basic data type: {}".format(data_type)) + + @staticmethod + def deserialize_unicode(data): + """Preserve unicode objects in Python 2, otherwise return data + as a string. + + :param str data: response string to be deserialized. + :return: Deserialized string. + :rtype: str or unicode + """ + # We might be here because we have an enum modeled as string, + # and we try to deserialize a partial dict with enum inside + if isinstance(data, Enum): + return data + + # Consider this is real string + try: + if isinstance(data, unicode): # type: ignore + return data + except NameError: + return str(data) + return str(data) + + @staticmethod + def deserialize_enum(data, enum_obj): + """Deserialize string into enum object. + + If the string is not a valid enum value it will be returned as-is + and a warning will be logged. + + :param str data: Response string to be deserialized. If this value is + None or invalid it will be returned as-is. + :param Enum enum_obj: Enum object to deserialize to. + :return: Deserialized enum object. + :rtype: Enum + """ + if isinstance(data, enum_obj) or data is None: + return data + if isinstance(data, Enum): + data = data.value + if isinstance(data, int): + # Workaround. We might consider remove it in the future. + try: + return list(enum_obj.__members__.values())[data] + except IndexError as exc: + error = "{!r} is not a valid index for enum {!r}" + raise DeserializationError(error.format(data, enum_obj)) from exc + try: + return enum_obj(str(data)) + except ValueError: + for enum_value in enum_obj: + if enum_value.value.lower() == str(data).lower(): + return enum_value + # We don't fail anymore for unknown value, we deserialize as a string + _LOGGER.warning("Deserializer is not able to find %s as valid enum in %s", data, enum_obj) + return Deserializer.deserialize_unicode(data) + + @staticmethod + def deserialize_bytearray(attr): + """Deserialize string into bytearray. + + :param str attr: response string to be deserialized. + :return: Deserialized bytearray + :rtype: bytearray + :raises TypeError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return bytearray(b64decode(attr)) # type: ignore + + @staticmethod + def deserialize_base64(attr): + """Deserialize base64 encoded string into string. + + :param str attr: response string to be deserialized. + :return: Deserialized base64 string + :rtype: bytearray + :raises TypeError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return b64decode(encoded) + + @staticmethod + def deserialize_decimal(attr): + """Deserialize string into Decimal object. + + :param str attr: response string to be deserialized. + :return: Deserialized decimal + :raises DeserializationError: if string format invalid. + :rtype: decimal + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + return decimal.Decimal(str(attr)) # type: ignore + except decimal.DecimalException as err: + msg = "Invalid decimal {}".format(attr) + raise DeserializationError(msg) from err + + @staticmethod + def deserialize_long(attr): + """Deserialize string into long (Py2) or int (Py3). + + :param str attr: response string to be deserialized. + :return: Deserialized int + :rtype: long or int + :raises ValueError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return _long_type(attr) # type: ignore + + @staticmethod + def deserialize_duration(attr): + """Deserialize ISO-8601 formatted string into TimeDelta object. + + :param str attr: response string to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = isodate.parse_duration(attr) + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def _deserialize_duration_numeric(attr, unit): + """Deserialize a numeric duration value into a TimeDelta object. + + :param float attr: response value to be deserialized. + :param str unit: The wire unit, used as the ``timedelta`` keyword + (``"seconds"`` or ``"milliseconds"``). + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = datetime.timedelta(**{unit: float(attr)}) # type: ignore + except (ValueError, OverflowError, TypeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_duration_seconds(attr): + """Deserialize a numeric number of seconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "seconds") + + @staticmethod + def deserialize_duration_milliseconds(attr): + """Deserialize a numeric number of milliseconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "milliseconds") + + @staticmethod + def deserialize_date(attr): + """Deserialize ISO-8601 formatted string into Date object. + + :param str attr: response string to be deserialized. + :return: Deserialized date + :rtype: Date + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + return isodate.parse_date(attr, defaultmonth=0, defaultday=0) + + @staticmethod + def deserialize_time(attr): + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :return: Deserialized time + :rtype: datetime.time + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + return isodate.parse_time(attr) + + @staticmethod + def deserialize_rfc(attr): + """Deserialize RFC-1123 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :return: Deserialized RFC datetime + :rtype: Datetime + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + parsed_date = email.utils.parsedate_tz(attr) # type: ignore + date_obj = datetime.datetime( + *parsed_date[:6], tzinfo=datetime.timezone(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + ) + if not date_obj.tzinfo: + date_obj = date_obj.astimezone(tz=TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to rfc datetime object." + raise DeserializationError(msg) from err + return date_obj + + @staticmethod + def deserialize_iso(attr): + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :return: Deserialized ISO datetime + :rtype: Datetime + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + attr = attr.upper() # type: ignore + match = Deserializer.valid_date.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize datetime object." + raise DeserializationError(msg) from err + return date_obj + + @staticmethod + def deserialize_unix(attr): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param int attr: Object to be serialized. + :return: Deserialized datetime + :rtype: Datetime + :raises DeserializationError: if format invalid + """ + if isinstance(attr, ET.Element): + attr = int(attr.text) # type: ignore + try: + attr = int(attr) + date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to unix datetime object." + raise DeserializationError(msg) from err + return date_obj diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_version.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_version.py new file mode 100644 index 000000000000..be71c81bd282 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/__init__.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/__init__.py new file mode 100644 index 000000000000..e670329dd024 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/__init__.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import VoiceAgentsClient # type: ignore + +try: + from ._patch import __all__ as _patch_all + from ._patch import * +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "VoiceAgentsClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore + +_patch_sdk() diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_client.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_client.py new file mode 100644 index 000000000000..9af42224fc60 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_client.py @@ -0,0 +1,125 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +import sys +from typing import Any, Awaitable, TYPE_CHECKING + +from azure.core import AsyncPipelineClient +from azure.core.pipeline import policies +from azure.core.rest import AsyncHttpResponse, HttpRequest + +from .._utils.serialization import Deserializer, Serializer +from ._configuration import VoiceAgentsClientConfiguration +from .operations import AgentEndpointConversationsOperations, VoiceAgentWebSocketOperations, VoiceAgentsOperations + +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + +if TYPE_CHECKING: + from azure.core.credentials_async import AsyncTokenCredential + + +class VoiceAgentsClient: # pylint: disable=docstring-keyword-should-match-keyword-only + """VoiceAgentsClient. + + :ivar voice_agent_web_socket: VoiceAgentWebSocketOperations operations + :vartype voice_agent_web_socket: + azure.ai.voiceagents.aio.operations.VoiceAgentWebSocketOperations + :ivar agent_endpoint_conversations: AgentEndpointConversationsOperations operations + :vartype agent_endpoint_conversations: + azure.ai.voiceagents.aio.operations.AgentEndpointConversationsOperations + :ivar voice_agents: VoiceAgentsOperations operations + :vartype voice_agents: azure.ai.voiceagents.aio.operations.VoiceAgentsOperations + :param endpoint: Foundry Project endpoint in the form + "https://{ai-services-account-name}.services.ai.azure.com/api/projects/{project-name}". If you + only have one Project in your Foundry Hub, or to target the default Project in your Hub, use + the form "https://{ai-services-account-name}.services.ai.azure.com/api/projects/_project". + Required. + :type endpoint: str + :param credential: Credential used to authenticate requests to the service. Required. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :keyword api_version: The API version to use for this operation. Known values are "v1" and + None. Default value is None. If not set, the operation's default API version will be used. Note + that overriding this default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__(self, endpoint: str, credential: "AsyncTokenCredential", **kwargs: Any) -> None: + _endpoint = "{endpoint}" + self._config = VoiceAgentsClientConfiguration(endpoint=endpoint, credential=credential, **kwargs) + + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: AsyncPipelineClient = AsyncPipelineClient(base_url=_endpoint, policies=_policies, **kwargs) + + self._serialize = Serializer() + self._deserialize = Deserializer() + self._serialize.client_side_validation = False + self.voice_agent_web_socket = VoiceAgentWebSocketOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.agent_endpoint_conversations = AgentEndpointConversationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.voice_agents = VoiceAgentsOperations(self._client, self._config, self._serialize, self._deserialize) + + def send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client.send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.AsyncHttpResponse + """ + + request_copy = deepcopy(request) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> Self: + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details: Any) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_configuration.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_configuration.py new file mode 100644 index 000000000000..bbdeb569378e --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_configuration.py @@ -0,0 +1,69 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.pipeline import policies + +from .._version import VERSION + +if TYPE_CHECKING: + from azure.core.credentials_async import AsyncTokenCredential + + +class VoiceAgentsClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only + """Configuration for VoiceAgentsClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param endpoint: Foundry Project endpoint in the form + "https://{ai-services-account-name}.services.ai.azure.com/api/projects/{project-name}". If you + only have one Project in your Foundry Hub, or to target the default Project in your Hub, use + the form "https://{ai-services-account-name}.services.ai.azure.com/api/projects/_project". + Required. + :type endpoint: str + :param credential: Credential used to authenticate requests to the service. Required. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :keyword api_version: The API version to use for this operation. Known values are "v1" and + None. Default value is None. If not set, the operation's default API version will be used. Note + that overriding this default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__(self, endpoint: str, credential: "AsyncTokenCredential", **kwargs: Any) -> None: + api_version: str = kwargs.pop("api_version", "v1") + + if endpoint is None: + raise ValueError("Parameter 'endpoint' must not be None.") + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + + self.endpoint = endpoint + self.credential = credential + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://ai.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "ai-voiceagents/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_patch.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_patch.py new file mode 100644 index 000000000000..9c8be6a1f5db --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_patch.py @@ -0,0 +1,74 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import Any, Optional, TYPE_CHECKING + +from ._client import VoiceAgentsClient as _GeneratedVoiceAgentsClient +from ._realtime import AsyncRealtime, AsyncRealtimeConnection, AsyncRealtimeConnectionManager + +if TYPE_CHECKING: + from azure.core.credentials_async import AsyncTokenCredential + + +class VoiceAgentsClient(_GeneratedVoiceAgentsClient): + """VoiceAgentsClient with a realtime streaming namespace. + + Adds the :attr:`realtime` namespace on top of the generated HTTP client, exposing + ``connect(...)`` for realtime WebSocket sessions. + """ + + _realtime: Optional[AsyncRealtime] = None + + def __init__(self, endpoint: str, credential: "AsyncTokenCredential", **kwargs: Any) -> None: + # Work around an azure-core/aiohttp limitation: azure-core's AioHttpTransport + # disables aiohttp's native response decompression and only re-implements + # gzip/deflate itself (no brotli support), while aiohttp advertises + # "Accept-Encoding: br" by default. If the service responds with a + # brotli-compressed body, azure-core fails to decode it. Unless the caller + # already supplied their own transport or session, default to only + # advertising the encodings azure-core can actually decompress. + if "transport" not in kwargs and "session" not in kwargs: + try: + import aiohttp + from azure.core.pipeline.transport import AioHttpTransport + + kwargs["transport"] = AioHttpTransport( + session=aiohttp.ClientSession(auto_decompress=False, headers={"Accept-Encoding": "gzip, deflate"}) + ) + except ImportError: + pass + super().__init__(endpoint, credential, **kwargs) + + @property + def realtime(self) -> AsyncRealtime: + """Realtime streaming entry point. + + :return: The realtime namespace, exposing ``connect(...)``. + :rtype: ~azure.ai.voiceagents.aio.AsyncRealtime + """ + if self._realtime is None: + self._realtime = AsyncRealtime(self) + return self._realtime + + +__all__: list[str] = [ + "VoiceAgentsClient", + "AsyncRealtime", + "AsyncRealtimeConnection", + "AsyncRealtimeConnectionManager", +] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_realtime.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_realtime.py new file mode 100644 index 000000000000..49f64289653a --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_realtime.py @@ -0,0 +1,756 @@ +# pylint: disable=networking-import-outside-azure-core-transport +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +"""Hand-written async realtime (WebSocket) streaming client for voice agents. + +Realtime uses a fundamentally different transport (a persistent WebSocket) than the +request/response HTTP surface generated from the service's TypeSpec definition, so it is +hand-written and exposed as the ``VoiceAgentsClient.realtime`` namespace. + +The connection ergonomics follow the OpenAI Python realtime client (and this package's +sibling ``azure-ai-voicelive``) so that developers moving between the libraries get a +familiar surface: + +* :meth:`AsyncRealtime.connect` returns an async context manager. +* Entering the context yields an :class:`AsyncRealtimeConnection`. +* The connection is async-iterable over inbound, strongly-typed server events and exposes + sub-namespaces (``session``, ``input_audio_buffer``, ``output_audio_buffer``, + ``conversation``, ``response``) for sending strongly-typed outbound client events. + +Unlike the private-preview implementation, outbound and inbound events use the generated +``VoiceAgentClientEventXxx``/``VoiceAgentServerEventXxx`` models directly. ``send`` and +``recv`` still accept/return plain ``dict`` objects as a forward-compatible fallback for any +event ``type`` the generated models don't yet know about. + +``aiohttp`` is required for this feature and is *not* a hard dependency of the package; it is +imported lazily so importing the SDK never fails when it is absent. +""" +from __future__ import annotations + +import base64 +import json +from typing import Any, AsyncIterator, Dict, List, Mapping, Optional, Type, TYPE_CHECKING, Union + +from .. import models as _models +from .._utils.model_base import Model as _Model, SdkJSONEncoder + +if TYPE_CHECKING: + from aiohttp import ClientSession, ClientWebSocketResponse + from azure.core.credentials_async import AsyncTokenCredential + + from ._client import VoiceAgentsClient + + +__all__ = [ + "AsyncRealtime", + "AsyncRealtimeConnection", + "AsyncRealtimeConnectionManager", +] + +# Union of the client event models sendable over the connection, plus a raw mapping escape +# hatch for forward compatibility with event types not yet represented in the generated models. +ClientEvent = Union[ + _models.VoiceAgentClientEventConversationItemCreate, + _models.VoiceAgentClientEventConversationItemDelete, + _models.VoiceAgentClientEventConversationItemRetrieve, + _models.VoiceAgentClientEventConversationItemTruncate, + _models.VoiceAgentClientEventInputAudioBufferAppend, + _models.VoiceAgentClientEventInputAudioBufferClear, + _models.VoiceAgentClientEventInputAudioBufferCommit, + _models.VoiceAgentClientEventOutputAudioBufferClear, + _models.VoiceAgentClientEventResponseCancel, + _models.VoiceAgentClientEventResponseCreate, + _models.VoiceAgentClientEventSessionAvatarConnect, + _models.VoiceAgentClientEventSessionUpdate, + Mapping[str, Any], +] + +# The conversation item variants accepted by ``conversation.item.create``. +ConversationItem = Union[ + _models.RealtimeConversationItemMessageSystem, + _models.RealtimeConversationItemMessageUser, + _models.RealtimeConversationItemMessageAssistant, + _models.RealtimeConversationItemFunctionCall, + _models.RealtimeConversationItemFunctionCallOutput, + _models.RealtimeMCPApprovalResponse, + Mapping[str, Any], +] + +# Every server event ``type`` string mapped to its generated model, used to deserialize +# inbound frames into strongly-typed objects. Unrecognized ``type`` values fall back to a +# plain ``dict`` so newly-added service events never break an older client. +_SERVER_EVENT_TYPES: Dict[str, Type[_Model]] = { + "conversation.created": _models.VoiceAgentServerEventConversationCreated, + "conversation.item.added": _models.VoiceAgentServerEventConversationItemAdded, + "conversation.item.created": _models.VoiceAgentServerEventConversationItemCreated, + "conversation.item.deleted": _models.VoiceAgentServerEventConversationItemDeleted, + "conversation.item.done": _models.VoiceAgentServerEventConversationItemDone, + "conversation.item.input_audio_transcription.completed": ( + _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted + ), + "conversation.item.input_audio_transcription.delta": ( + _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta + ), + "conversation.item.input_audio_transcription.failed": ( + _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed + ), + "conversation.item.input_audio_transcription.segment": ( + _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment + ), + "conversation.item.retrieved": _models.VoiceAgentServerEventConversationItemRetrieved, + "conversation.item.truncated": _models.VoiceAgentServerEventConversationItemTruncated, + "error": _models.VoiceAgentServerEventError, + "input_audio_buffer.cleared": _models.VoiceAgentServerEventInputAudioBufferCleared, + "input_audio_buffer.committed": _models.VoiceAgentServerEventInputAudioBufferCommitted, + "input_audio_buffer.speech_started": _models.VoiceAgentServerEventInputAudioBufferSpeechStarted, + "input_audio_buffer.speech_stopped": _models.VoiceAgentServerEventInputAudioBufferSpeechStopped, + "input_audio_buffer.timeout_triggered": _models.VoiceAgentServerEventInputAudioBufferTimeoutTriggered, + "mcp_list_tools.completed": _models.VoiceAgentServerEventMcpListToolsCompleted, + "mcp_list_tools.failed": _models.VoiceAgentServerEventMcpListToolsFailed, + "mcp_list_tools.in_progress": _models.VoiceAgentServerEventMcpListToolsInProgress, + "output_audio_buffer.cleared": _models.VoiceAgentServerEventOutputAudioBufferCleared, + "rate_limits.updated": _models.VoiceAgentServerEventRateLimitsUpdated, + "response.animation_blendshapes.delta": _models.VoiceAgentServerEventResponseAnimationBlendshapesDelta, + "response.animation_blendshapes.done": _models.VoiceAgentServerEventResponseAnimationBlendshapesDone, + "response.animation_viseme.delta": _models.VoiceAgentServerEventResponseAnimationVisemeDelta, + "response.animation_viseme.done": _models.VoiceAgentServerEventResponseAnimationVisemeDone, + "response.audio_timestamp.delta": _models.VoiceAgentServerEventResponseAudioTimestampDelta, + "response.audio_timestamp.done": _models.VoiceAgentServerEventResponseAudioTimestampDone, + "response.content_part.added": _models.RealtimeServerEventResponseContentPartAdded, + "response.content_part.done": _models.VoiceAgentServerEventResponseContentPartDone, + "response.created": _models.VoiceAgentServerEventResponseCreated, + "response.done": _models.VoiceAgentServerEventResponseDone, + "response.file_search_call.completed": _models.VoiceAgentServerEventFileSearchCallCompleted, + "response.file_search_call.in_progress": _models.VoiceAgentServerEventFileSearchCallInProgress, + "response.file_search_call.searching": _models.VoiceAgentServerEventFileSearchCallSearching, + "response.function_call_arguments.delta": _models.VoiceAgentServerEventResponseFunctionCallArgumentsDelta, + "response.function_call_arguments.done": _models.VoiceAgentServerEventResponseFunctionCallArgumentsDone, + "response.mcp_call.completed": _models.VoiceAgentServerEventResponseMcpCallCompleted, + "response.mcp_call.failed": _models.VoiceAgentServerEventResponseMcpCallFailed, + "response.mcp_call.in_progress": _models.VoiceAgentServerEventResponseMcpCallInProgress, + "response.mcp_call_arguments.delta": _models.VoiceAgentServerEventResponseMcpCallArgumentsDelta, + "response.mcp_call_arguments.done": _models.VoiceAgentServerEventResponseMcpCallArgumentsDone, + "response.output_audio.delta": _models.VoiceAgentServerEventResponseAudioDelta, + "response.output_audio.done": _models.VoiceAgentServerEventResponseAudioDone, + "response.output_audio_transcript.delta": _models.VoiceAgentServerEventResponseAudioTranscriptDelta, + "response.output_audio_transcript.done": _models.VoiceAgentServerEventResponseAudioTranscriptDone, + "response.output_item.added": _models.VoiceAgentServerEventResponseOutputItemAdded, + "response.output_item.done": _models.VoiceAgentServerEventResponseOutputItemDone, + "response.output_text.delta": _models.VoiceAgentServerEventResponseTextDelta, + "response.output_text.done": _models.VoiceAgentServerEventResponseTextDone, + "response.video.delta": _models.VoiceAgentServerEventResponseVideoDelta, + "response.web_search_call.completed": _models.VoiceAgentServerEventWebSearchCallCompleted, + "response.web_search_call.in_progress": _models.VoiceAgentServerEventWebSearchCallInProgress, + "response.web_search_call.searching": _models.VoiceAgentServerEventWebSearchCallSearching, + "session.avatar.connecting": _models.VoiceAgentServerEventSessionAvatarConnecting, + "session.avatar.switch_to_idle": _models.VoiceAgentServerEventSessionAvatarSwitchToIdle, + "session.avatar.switch_to_speaking": _models.VoiceAgentServerEventSessionAvatarSwitchToSpeaking, + "session.created": _models.VoiceAgentServerEventSessionCreated, + "session.handoff.aborted": _models.VoiceAgentServerEventSessionHandoffAborted, + "session.handoff.completed": _models.VoiceAgentServerEventSessionHandoffCompleted, + "session.handoff.started": _models.VoiceAgentServerEventSessionHandoffStarted, + "session.updated": _models.VoiceAgentServerEventSessionUpdated, + "warning": _models.VoiceAgentServerEventWarning, +} + +# Every generated server event model, for consumers that want a precise return type. +ServerEvent = Union[ + _models.RealtimeServerEventResponseContentPartAdded, + _models.VoiceAgentServerEventConversationCreated, + _models.VoiceAgentServerEventConversationItemAdded, + _models.VoiceAgentServerEventConversationItemCreated, + _models.VoiceAgentServerEventConversationItemDeleted, + _models.VoiceAgentServerEventConversationItemDone, + _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted, + _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta, + _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed, + _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment, + _models.VoiceAgentServerEventConversationItemRetrieved, + _models.VoiceAgentServerEventConversationItemTruncated, + _models.VoiceAgentServerEventError, + _models.VoiceAgentServerEventFileSearchCallCompleted, + _models.VoiceAgentServerEventFileSearchCallInProgress, + _models.VoiceAgentServerEventFileSearchCallSearching, + _models.VoiceAgentServerEventInputAudioBufferCleared, + _models.VoiceAgentServerEventInputAudioBufferCommitted, + _models.VoiceAgentServerEventInputAudioBufferSpeechStarted, + _models.VoiceAgentServerEventInputAudioBufferSpeechStopped, + _models.VoiceAgentServerEventInputAudioBufferTimeoutTriggered, + _models.VoiceAgentServerEventMcpListToolsCompleted, + _models.VoiceAgentServerEventMcpListToolsFailed, + _models.VoiceAgentServerEventMcpListToolsInProgress, + _models.VoiceAgentServerEventOutputAudioBufferCleared, + _models.VoiceAgentServerEventRateLimitsUpdated, + _models.VoiceAgentServerEventResponseAnimationBlendshapesDelta, + _models.VoiceAgentServerEventResponseAnimationBlendshapesDone, + _models.VoiceAgentServerEventResponseAnimationVisemeDelta, + _models.VoiceAgentServerEventResponseAnimationVisemeDone, + _models.VoiceAgentServerEventResponseAudioDelta, + _models.VoiceAgentServerEventResponseAudioDone, + _models.VoiceAgentServerEventResponseAudioTimestampDelta, + _models.VoiceAgentServerEventResponseAudioTimestampDone, + _models.VoiceAgentServerEventResponseAudioTranscriptDelta, + _models.VoiceAgentServerEventResponseAudioTranscriptDone, + _models.VoiceAgentServerEventResponseContentPartDone, + _models.VoiceAgentServerEventResponseCreated, + _models.VoiceAgentServerEventResponseDone, + _models.VoiceAgentServerEventResponseFunctionCallArgumentsDelta, + _models.VoiceAgentServerEventResponseFunctionCallArgumentsDone, + _models.VoiceAgentServerEventResponseMcpCallArgumentsDelta, + _models.VoiceAgentServerEventResponseMcpCallArgumentsDone, + _models.VoiceAgentServerEventResponseMcpCallCompleted, + _models.VoiceAgentServerEventResponseMcpCallFailed, + _models.VoiceAgentServerEventResponseMcpCallInProgress, + _models.VoiceAgentServerEventResponseOutputItemAdded, + _models.VoiceAgentServerEventResponseOutputItemDone, + _models.VoiceAgentServerEventResponseTextDelta, + _models.VoiceAgentServerEventResponseTextDone, + _models.VoiceAgentServerEventResponseVideoDelta, + _models.VoiceAgentServerEventSessionAvatarConnecting, + _models.VoiceAgentServerEventSessionAvatarSwitchToIdle, + _models.VoiceAgentServerEventSessionAvatarSwitchToSpeaking, + _models.VoiceAgentServerEventSessionCreated, + _models.VoiceAgentServerEventSessionHandoffAborted, + _models.VoiceAgentServerEventSessionHandoffCompleted, + _models.VoiceAgentServerEventSessionHandoffStarted, + _models.VoiceAgentServerEventSessionUpdated, + _models.VoiceAgentServerEventWarning, + _models.VoiceAgentServerEventWebSearchCallCompleted, + _models.VoiceAgentServerEventWebSearchCallInProgress, + _models.VoiceAgentServerEventWebSearchCallSearching, + Mapping[str, Any], +] + + +def _to_ws_url(endpoint: str, agent_name: str) -> str: + """Build the realtime WebSocket URL from the HTTP project endpoint. + + :param str endpoint: The Foundry project endpoint (``https://.../api/projects/...``). + :param str agent_name: The name of the voice agent to connect to. + :return: A ``wss://``/``ws://`` URL targeting the realtime route. + :rtype: str + """ + base = endpoint.rstrip("/") + if base.startswith("https://"): + base = "wss://" + base[len("https://") :] + elif base.startswith("http://"): + base = "ws://" + base[len("http://") :] + return f"{base}/agents/{agent_name}/endpoint/protocols/voice" + + +class _BaseResource: + """Base helper that forwards typed helpers to the parent connection.""" + + def __init__(self, connection: "AsyncRealtimeConnection") -> None: + self._connection = connection + + async def _send(self, event: ClientEvent) -> None: + await self._connection.send(event) + + +class SessionResource(_BaseResource): + """Send ``session.*`` client events.""" + + async def update( + self, + *, + session: Union["_models.VoiceAgentSessionUpdateConfig", Mapping[str, Any]], + event_id: Optional[str] = None, + ) -> None: + """Update the realtime session configuration. + + :keyword session: The session configuration to apply. + :paramtype session: ~azure.ai.voiceagents.models.VoiceAgentSessionUpdateConfig or Mapping[str, Any] + :keyword event_id: Optional client-generated ID used to identify this event. + :paramtype event_id: str or None + """ + await self._send( + _models.VoiceAgentClientEventSessionUpdate( + type=_models.RealtimeClientEventType.SESSION_UPDATE, + session=session, # type: ignore[arg-type] + event_id=event_id, + ) + ) + + async def avatar_connect(self, *, client_sdp: str, event_id: Optional[str] = None) -> None: + """Negotiate an avatar media session over WebRTC. + + :keyword str client_sdp: The client's SDP offer for avatar media negotiation. + :keyword event_id: An optional client-generated event identifier. + :paramtype event_id: str or None + """ + await self._send(_models.VoiceAgentClientEventSessionAvatarConnect(client_sdp=client_sdp, event_id=event_id)) + + +class InputAudioBufferResource(_BaseResource): + """Send ``input_audio_buffer.*`` client events.""" + + async def append(self, *, audio: Union[str, bytes], event_id: Optional[str] = None) -> None: + """Append audio bytes to the input buffer. + + :keyword audio: Raw audio bytes, or an already base64-encoded string. + :paramtype audio: str or bytes + :keyword event_id: Optional client-generated ID used to identify this event. + :paramtype event_id: str or None + """ + if isinstance(audio, (bytes, bytearray)): + audio = base64.b64encode(bytes(audio)).decode("ascii") + await self._send( + _models.VoiceAgentClientEventInputAudioBufferAppend( + type=_models.RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND, + audio=audio, + event_id=event_id, + ) + ) + + async def commit(self, *, event_id: Optional[str] = None) -> None: + """Commit the buffered input audio as a user turn. + + :keyword event_id: Optional client-generated ID used to identify this event. + :paramtype event_id: str or None + """ + await self._send( + _models.VoiceAgentClientEventInputAudioBufferCommit( + type=_models.RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT, event_id=event_id + ) + ) + + async def clear(self, *, event_id: Optional[str] = None) -> None: + """Discard any buffered input audio. + + :keyword event_id: Optional client-generated ID used to identify this event. + :paramtype event_id: str or None + """ + await self._send( + _models.VoiceAgentClientEventInputAudioBufferClear( + type=_models.RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR, event_id=event_id + ) + ) + + +class OutputAudioBufferResource(_BaseResource): + """Send ``output_audio_buffer.*`` client events.""" + + async def clear(self, *, event_id: Optional[str] = None) -> None: + """Stop and clear any audio the service is currently playing back (barge-in). + + :keyword event_id: Optional client-generated ID used to identify this event. + :paramtype event_id: str or None + """ + await self._send( + _models.VoiceAgentClientEventOutputAudioBufferClear( + type=_models.RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR, event_id=event_id + ) + ) + + +class ConversationItemResource(_BaseResource): + """Send ``conversation.item.*`` client events.""" + + async def create( + self, + *, + item: ConversationItem, + previous_item_id: Optional[str] = None, + event_id: Optional[str] = None, + ) -> None: + """Insert an item into the conversation. + + :keyword item: The conversation item to create. + :paramtype item: ~azure.ai.voiceagents.models.RealtimeConversationItemMessageSystem or + ~azure.ai.voiceagents.models.RealtimeConversationItemMessageUser or + ~azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistant or + ~azure.ai.voiceagents.models.RealtimeConversationItemFunctionCall or + ~azure.ai.voiceagents.models.RealtimeConversationItemFunctionCallOutput or + ~azure.ai.voiceagents.models.RealtimeMCPApprovalResponse or Mapping[str, Any] + :keyword previous_item_id: The ID of the preceding item after which the new item will be + inserted. Default value is None. + :paramtype previous_item_id: str or None + :keyword event_id: Optional client-generated ID used to identify this event. + :paramtype event_id: str or None + """ + await self._send( + _models.VoiceAgentClientEventConversationItemCreate( + type=_models.RealtimeClientEventType.CONVERSATION_ITEM_CREATE, + item=item, # type: ignore[arg-type] + previous_item_id=previous_item_id, + event_id=event_id, + ) + ) + + async def delete(self, *, item_id: str, event_id: Optional[str] = None) -> None: + """Delete an item from the conversation. + + :keyword str item_id: The ID of the item to delete. + :keyword event_id: Optional client-generated ID used to identify this event. + :paramtype event_id: str or None + """ + await self._send( + _models.VoiceAgentClientEventConversationItemDelete( + type=_models.RealtimeClientEventType.CONVERSATION_ITEM_DELETE, item_id=item_id, event_id=event_id + ) + ) + + async def retrieve(self, *, item_id: str, event_id: Optional[str] = None) -> None: + """Ask the server to emit a ``conversation.item.retrieved`` event for an item. + + :keyword str item_id: The ID of the item to retrieve. + :keyword event_id: Optional client-generated ID used to identify this event. + :paramtype event_id: str or None + """ + await self._send( + _models.VoiceAgentClientEventConversationItemRetrieve( + type=_models.RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE, item_id=item_id, event_id=event_id + ) + ) + + async def truncate( + self, *, item_id: str, content_index: int, audio_end_ms: int, event_id: Optional[str] = None + ) -> None: + """Truncate a previously produced assistant audio item (used for barge-in). + + :keyword str item_id: The ID of the assistant message item to truncate. + :keyword int content_index: The index of the content part to truncate. Use ``0``. + :keyword int audio_end_ms: The point, in milliseconds, to truncate the audio to. + :keyword event_id: Optional client-generated ID used to identify this event. + :paramtype event_id: str or None + """ + await self._send( + _models.VoiceAgentClientEventConversationItemTruncate( + type=_models.RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE, + item_id=item_id, + content_index=content_index, + audio_end_ms=audio_end_ms, + event_id=event_id, + ) + ) + + +class ConversationResource(_BaseResource): + """Send ``conversation.*`` client events.""" + + def __init__(self, connection: "AsyncRealtimeConnection") -> None: + super().__init__(connection) + self.item: ConversationItemResource = ConversationItemResource(connection) + + +class ResponseResource(_BaseResource): + """Send ``response.*`` client events.""" + + async def create( + self, + *, + response: Optional[Union["_models.VoiceAgentResponseCreateParams", Mapping[str, Any]]] = None, + event_id: Optional[str] = None, + ) -> None: + """Ask the model to generate a response. + + :keyword response: Optional per-response overrides. Default value is None. + :paramtype response: ~azure.ai.voiceagents.models.VoiceAgentResponseCreateParams or Mapping[str, Any] or None + :keyword event_id: Optional client-generated ID used to identify this event. + :paramtype event_id: str or None + """ + await self._send( + _models.VoiceAgentClientEventResponseCreate( + type=_models.RealtimeClientEventType.RESPONSE_CREATE, + response=response, # type: ignore[arg-type] + event_id=event_id, + ) + ) + + async def cancel(self, *, response_id: Optional[str] = None, event_id: Optional[str] = None) -> None: + """Cancel an in-progress response. + + :keyword response_id: The ID of the response to cancel, if targeting a specific one. + Default value is None. + :paramtype response_id: str or None + :keyword event_id: Optional client-generated ID used to identify this event. + :paramtype event_id: str or None + """ + await self._send( + _models.VoiceAgentClientEventResponseCancel( + type=_models.RealtimeClientEventType.RESPONSE_CANCEL, response_id=response_id, event_id=event_id + ) + ) + + +class AsyncRealtimeConnection: # pylint: disable=too-many-instance-attributes + """An open realtime WebSocket connection to a voice agent. + + Iterate over the connection to receive strongly-typed server events, and use the + sub-namespaces to send strongly-typed client events:: + + async with client.realtime.connect(agent_name="my-agent") as conn: + await conn.session.update(session={"modalities": ["audio", "text"]}) + await conn.input_audio_buffer.append(audio=chunk) + await conn.input_audio_buffer.commit() + await conn.response.create() + async for event in conn: + if event.type == RealtimeServerEventType.RESPONSE_DONE: + break + """ + + def __init__(self, connection: "ClientWebSocketResponse", session: "ClientSession") -> None: + self._connection = connection + self._session = session + self.session: SessionResource = SessionResource(self) + self.input_audio_buffer: InputAudioBufferResource = InputAudioBufferResource(self) + self.output_audio_buffer: OutputAudioBufferResource = OutputAudioBufferResource(self) + self.conversation: ConversationResource = ConversationResource(self) + self.response: ResponseResource = ResponseResource(self) + + async def __aenter__(self) -> "AsyncRealtimeConnection": + return self + + async def __aexit__(self, *exc_details: Any) -> None: + await self.close() + + def __aiter__(self) -> AsyncIterator[ServerEvent]: + return self._iter() + + async def _iter(self) -> AsyncIterator[ServerEvent]: + while True: + try: + yield await self.recv() + except ConnectionResetError: + return + + async def recv(self) -> ServerEvent: + """Receive and parse the next server event. + + Known event types are returned as their strongly-typed + ``VoiceAgentServerEventXxx`` model. Event types not (yet) represented by a + generated model are returned as a plain ``dict`` for forward compatibility. + + :return: The parsed server event. + :rtype: ~azure.ai.voiceagents.aio.ServerEvent + :raises ConnectionResetError: If the connection was closed by the server. + """ + import aiohttp # pylint: disable=import-outside-toplevel + + msg = await self._connection.receive() + if msg.type in (aiohttp.WSMsgType.CLOSE, aiohttp.WSMsgType.CLOSING, aiohttp.WSMsgType.CLOSED): + raise ConnectionResetError("The realtime connection was closed.") + if msg.type == aiohttp.WSMsgType.ERROR: + raise ConnectionResetError( + "The realtime connection encountered an error." + ) from self._connection.exception() + raw = msg.data.decode("utf-8") if msg.type == aiohttp.WSMsgType.BINARY else msg.data + payload: Dict[str, Any] = json.loads(raw) + event_type = payload.get("type") + if not isinstance(event_type, str): + return payload + event_cls = _SERVER_EVENT_TYPES.get(event_type) + if event_cls is None: + return payload + return event_cls(payload) + + async def send(self, event: ClientEvent) -> None: + """Send a client event over the connection. + + :param event: A strongly-typed client event, a ready-made mapping, or a raw JSON string. + :type event: ~azure.ai.voiceagents.aio.ClientEvent or str + """ + payload = event if isinstance(event, str) else json.dumps(event, cls=SdkJSONEncoder) + await self._connection.send_str(payload) + + async def close(self, *, code: int = 1000, reason: str = "") -> None: + """Close the connection and release the underlying HTTP session. + + :keyword int code: The WebSocket close code. + :keyword str reason: The close reason. + """ + try: + await self._connection.close(code=code, message=reason.encode("utf-8")) + finally: + await self._session.close() + + +class AsyncRealtimeConnectionManager: # pylint: disable=too-many-instance-attributes + """Async context manager that opens an :class:`AsyncRealtimeConnection`. + + Returned by :meth:`AsyncRealtime.connect`; you normally use it as + ``async with client.realtime.connect(...) as conn:``. + """ + + def __init__( # pylint: disable=too-many-arguments + self, + *, + endpoint: str, + credential: "AsyncTokenCredential", + credential_scopes: List[str], + api_version: str, + agent_name: str, + foundry_features: Union[str, "_models.AgentDefinitionOptInKeys"], + agent_session_id: Optional[str] = None, + agent_version_override: Optional[str] = None, + structured_inputs: Optional[str] = None, + connection_url: Optional[str] = None, + extra_query: Optional[Mapping[str, str]] = None, + extra_headers: Optional[Mapping[str, str]] = None, + **kwargs: Any, + ) -> None: + self._endpoint = endpoint + self._credential = credential + self._credential_scopes = credential_scopes + self._api_version = api_version + self._agent_name = agent_name + self._foundry_features = foundry_features + self._agent_session_id = agent_session_id + self._agent_version_override = agent_version_override + self._structured_inputs = structured_inputs + self._connection_url = connection_url + self._extra_query = dict(extra_query or {}) + self._extra_headers = dict(extra_headers or {}) + self._kwargs = kwargs + self._connection: Optional[AsyncRealtimeConnection] = None + + async def __aenter__(self) -> AsyncRealtimeConnection: + return await self.enter() + + async def enter(self) -> AsyncRealtimeConnection: # pylint: disable=too-many-locals + """Open the connection. + + :return: The live realtime connection. + :rtype: ~azure.ai.voiceagents.aio.AsyncRealtimeConnection + """ + try: + import aiohttp # pylint: disable=import-outside-toplevel + except ImportError as exc: # pragma: no cover - dependency guard + raise RuntimeError( + "The realtime client requires `aiohttp`. Install it with `pip install aiohttp`." + ) from exc + + # ``connection_url`` fully overrides the computed route (scheme/host/path). This is the + # escape hatch used to reach a specific data-plane host/path directly. + url = self._connection_url or _to_ws_url(self._endpoint, self._agent_name) + + params: Dict[str, str] = {"api-version": self._api_version} + if self._agent_session_id is not None: + params["agent_session_id"] = self._agent_session_id + if self._agent_version_override is not None: + params["x-agent-version-override"] = self._agent_version_override + params.update(self._extra_query) + + token = await self._credential.get_token(*self._credential_scopes) + # Coerce enum members (e.g. ``AgentDefinitionOptInKeys``) to their string value so the + # header carries ``VoiceAgents=V1Preview`` rather than the enum's ``repr``/``str`` form, + # which the gateway rejects with a 403 during the WebSocket handshake. + foundry_features = getattr(self._foundry_features, "value", self._foundry_features) + headers: Dict[str, str] = { + "Authorization": f"Bearer {token.token}", + "Foundry-Features": str(foundry_features), + "Sec-WebSocket-Protocol": "realtime", + } + if self._structured_inputs is not None: + headers["x-ms-voice-structured-inputs"] = self._structured_inputs + headers.update(self._extra_headers) + + session = aiohttp.ClientSession() + try: + connection = await session.ws_connect(url, headers=headers, params=params, **self._kwargs) + except BaseException: + await session.close() + raise + self._connection = AsyncRealtimeConnection(connection, session) + return self._connection + + async def __aexit__(self, *exc_details: Any) -> None: + if self._connection is not None: + await self._connection.close() + self._connection = None + + +class AsyncRealtime: + """Realtime streaming entry point, exposed as ``client.realtime``. + + Follows the OpenAI Python realtime surface: obtain it from the HTTP client and open a + connection with :meth:`connect`:: + + from azure.ai.voiceagents.aio import VoiceAgentsClient + from azure.identity.aio import DefaultAzureCredential + + client = VoiceAgentsClient(endpoint, DefaultAzureCredential()) + async with client.realtime.connect(agent_name="my-agent") as conn: + await conn.session.update(session={"modalities": ["audio", "text"]}) + await conn.input_audio_buffer.append(audio=chunk) + await conn.input_audio_buffer.commit() + await conn.response.create() + async for event in conn: + if event.type == RealtimeServerEventType.RESPONSE_DONE: + break + + :param client: The HTTP client whose endpoint and credential are reused for the realtime + handshake. + :type client: ~azure.ai.voiceagents.aio.VoiceAgentsClient + """ + + def __init__(self, client: "VoiceAgentsClient") -> None: + self._config = client._config # pylint: disable=protected-access + + def connect( # pylint: disable=too-many-arguments + self, + *, + agent_name: str, + foundry_features: Union[ + str, "_models.AgentDefinitionOptInKeys" + ] = _models.AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW, + agent_session_id: Optional[str] = None, + agent_version_override: Optional[str] = None, + structured_inputs: Optional[str] = None, + connection_url: Optional[str] = None, + api_version: Optional[str] = None, + credential_scopes: Optional[List[str]] = None, + extra_query: Optional[Mapping[str, str]] = None, + extra_headers: Optional[Mapping[str, str]] = None, + **kwargs: Any, + ) -> AsyncRealtimeConnectionManager: + """Open a realtime WebSocket connection to a voice agent. + + :keyword str agent_name: The name of the voice agent to connect to. + :keyword foundry_features: Preview opt-in value for the ``Foundry-Features`` header. + Default value is ``AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW``. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.AgentDefinitionOptInKeys + :keyword agent_session_id: An optional identifier used to correlate the voice session. + Default value is None. + :paramtype agent_session_id: str or None + :keyword agent_version_override: Selects a specific version of the voice agent for this + session. Default value is None. + :paramtype agent_version_override: str or None + :keyword structured_inputs: A JSON object that maps structured-input names to their + values for this session. Default value is None. + :paramtype structured_inputs: str or None + :keyword connection_url: Full ``wss://``/``ws://`` URL that overrides the route computed + from the client endpoint. Query parameters are still appended. Default value is None. + :paramtype connection_url: str or None + :keyword api_version: Overrides the client's API version for the handshake. Default + value is None. + :paramtype api_version: str or None + :keyword credential_scopes: Overrides the client's token scopes for the handshake. + Default value is None. + :paramtype credential_scopes: list[str] or None + :keyword extra_query: Additional query-string parameters for the handshake. + :paramtype extra_query: Mapping[str, str] or None + :keyword extra_headers: Additional headers for the handshake. + :paramtype extra_headers: Mapping[str, str] or None + :return: An async context manager yielding an :class:`AsyncRealtimeConnection`. + :rtype: ~azure.ai.voiceagents.aio.AsyncRealtimeConnectionManager + """ + return AsyncRealtimeConnectionManager( + endpoint=self._config.endpoint, + credential=self._config.credential, + credential_scopes=credential_scopes or self._config.credential_scopes, + api_version=api_version or self._config.api_version, + agent_name=agent_name, + foundry_features=foundry_features, + agent_session_id=agent_session_id, + agent_version_override=agent_version_override, + structured_inputs=structured_inputs, + connection_url=connection_url, + extra_query=extra_query, + extra_headers=extra_headers, + **kwargs, + ) diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/__init__.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/__init__.py new file mode 100644 index 000000000000..af8ff4734a8f --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/__init__.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import VoiceAgentWebSocketOperations # type: ignore +from ._operations import AgentEndpointConversationsOperations # type: ignore +from ._operations import VoiceAgentsOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "VoiceAgentWebSocketOperations", + "AgentEndpointConversationsOperations", + "VoiceAgentsOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/_operations.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/_operations.py new file mode 100644 index 000000000000..df409bd422bf --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/_operations.py @@ -0,0 +1,2854 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from collections.abc import MutableMapping +from io import IOBase +import json +from typing import Any, AsyncIterator, Callable, IO, Literal, Optional, TYPE_CHECKING, TypeVar, Union, overload +import urllib.parse + +from azure.core import AsyncPipelineClient +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict + +from ... import models as _models, types as _types +from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from ..._utils.serialization import Deserializer, Serializer +from ...models._enums import AgentDefinitionOptInKeys +from ...operations._operations import ( + build_agent_endpoint_conversations_delete_agent_conversation_request, + build_agent_endpoint_conversations_get_agent_conversation_audio_content_request, + build_agent_endpoint_conversations_get_agent_conversation_audio_request, + build_agent_endpoint_conversations_get_agent_conversation_item_audio_content_request, + build_agent_endpoint_conversations_get_agent_conversation_item_audio_request, + build_agent_endpoint_conversations_get_agent_conversation_item_request, + build_agent_endpoint_conversations_get_agent_conversation_request, + build_agent_endpoint_conversations_get_agent_conversation_response_request, + build_agent_endpoint_conversations_list_agent_conversation_items_request, + build_agent_endpoint_conversations_list_agent_conversation_response_items_request, + build_agent_endpoint_conversations_list_agent_conversation_responses_request, + build_voice_agent_web_socket_connect_voice_agent_request, + build_voice_agents_create_voice_agent_request, + build_voice_agents_create_voice_agent_version_request, + build_voice_agents_delete_voice_agent_request, + build_voice_agents_delete_voice_agent_version_request, + build_voice_agents_disable_voice_agent_request, + build_voice_agents_enable_voice_agent_request, + build_voice_agents_generate_voice_agent_request, + build_voice_agents_get_voice_agent_request, + build_voice_agents_get_voice_agent_version_request, + build_voice_agents_list_voice_agent_versions_request, + build_voice_agents_list_voice_agents_request, + build_voice_agents_update_voice_agent_request, +) +from .._configuration import VoiceAgentsClientConfiguration + +if TYPE_CHECKING: + from ... import _unions +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] +JSON = MutableMapping[str, Any] +_Unset: Any = object() + + +class VoiceAgentWebSocketOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.voiceagents.aio.VoiceAgentsClient`'s + :attr:`voice_agent_web_socket` 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: VoiceAgentsClientConfiguration = 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_async + async def connect_voice_agent( + self, + agent_name: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + agent_session_id: Optional[str] = None, + agent_version_override: Optional[str] = None, + websocket_subprotocol: Optional[Union[str, _models.VoiceAgentWebSocketSubprotocol]] = None, + structured_inputs: Optional[str] = None, + **kwargs: Any + ) -> None: + """Connect to a voice agent. + + Connects to a voice agent over WebSocket. The client must send an HTTP GET with ``Upgrade: + websocket`` headers. The optional ``realtime`` subprotocol is the only accepted subprotocol + value. + + :param agent_name: The name of the voice agent. Required. + :type agent_name: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword agent_session_id: An optional identifier used to correlate the voice session. Default + value is None. + :paramtype agent_session_id: str + :keyword agent_version_override: Selects a specific version of the voice agent for this + session. Default value is None. + :paramtype agent_version_override: str + :keyword websocket_subprotocol: The requested WebSocket subprotocol. Omit this header or + request exactly ``realtime``. "realtime" Default value is None. + :paramtype websocket_subprotocol: str or + ~azure.ai.voiceagents.models.VoiceAgentWebSocketSubprotocol + :keyword structured_inputs: A JSON object that maps structured-input names to their values for + this session. Default value is None. + :paramtype structured_inputs: 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_voice_agent_web_socket_connect_voice_agent_request( + agent_name=agent_name, + foundry_features=foundry_features, + agent_session_id=agent_session_id, + agent_version_override=agent_version_override, + websocket_subprotocol=websocket_subprotocol, + structured_inputs=structured_inputs, + 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 [101]: + 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["Sec-WebSocket-Protocol"] = self._deserialize( + "str", response.headers.get("Sec-WebSocket-Protocol") + ) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + +class AgentEndpointConversationsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.voiceagents.aio.VoiceAgentsClient`'s + :attr:`agent_endpoint_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: VoiceAgentsClientConfiguration = 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_async + async def get_agent_conversation( + self, + agent_name: str, + conversation_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> _models.VoiceConversation: + """Get a voice agent conversation. + + Retrieves a single conversation recorded for the specified voice agent endpoint by its id. + Returns ``404`` when the conversation was not persisted (``store = false``) or does not exist. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation to retrieve. Required. + :type conversation_id: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :return: VoiceConversation. The VoiceConversation is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceConversation + :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.VoiceConversation] = kwargs.pop("cls", None) + + _request = build_agent_endpoint_conversations_get_agent_conversation_request( + agent_name=agent_name, + conversation_id=conversation_id, + foundry_features=foundry_features, + 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.VoiceConversation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete_agent_conversation( + self, + agent_name: str, + conversation_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> None: + """Delete a voice agent conversation. + + Deletes a conversation and all of its stored data — responses, items, and any audio (cascade). + This is the customer's explicit data-deletion control for voice conversations. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation to delete. Required. + :type conversation_id: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :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_agent_endpoint_conversations_delete_agent_conversation_request( + agent_name=agent_name, + conversation_id=conversation_id, + foundry_features=foundry_features, + 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_agent_conversation_responses( + self, + agent_name: str, + conversation_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.VoiceResponse"]: + """List responses in a voice agent conversation. + + Returns a paged collection of the responses (model inference turns) recorded for the specified + conversation. The per-response ``output`` projection may be omitted here; use the + response-items route for the canonical paged output. Returns ``404`` when the conversation was + not persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose responses are listed. Required. + :type conversation_id: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :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.voiceagents.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 VoiceResponse + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.voiceagents.models.VoiceResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[list[_models.VoiceResponse]] = 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_agent_endpoint_conversations_list_agent_conversation_responses_request( + agent_name=agent_name, + conversation_id=conversation_id, + foundry_features=foundry_features, + 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.VoiceResponse], + 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_agent_conversation_response( + self, + agent_name: str, + conversation_id: str, + response_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> _models.VoiceResponse: + """Get a voice agent conversation response. + + Retrieves a single response from the specified conversation by its id, including its ``output`` + items, ``usage``, and status. Returns ``404`` when the conversation or response was not + persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the response. Required. + :type conversation_id: str + :param response_id: The id of the response to retrieve. Required. + :type response_id: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :return: VoiceResponse. The VoiceResponse is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceResponse + :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.VoiceResponse] = kwargs.pop("cls", None) + + _request = build_agent_endpoint_conversations_get_agent_conversation_response_request( + agent_name=agent_name, + conversation_id=conversation_id, + response_id=response_id, + foundry_features=foundry_features, + 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.VoiceResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_agent_conversation_response_items( + self, + agent_name: str, + conversation_id: str, + response_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.VoiceConversationItem"]: + """List items produced by a voice agent conversation response. + + Returns a paged collection of the output items produced by a specific response (the response's + output projection). For the complete ordered conversation history — including user input and + client-created tool outputs — use the conversation items route instead. Returns ``404`` when + the conversation or response was not persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the response. Required. + :type conversation_id: str + :param response_id: The id of the response whose output items are listed. Required. + :type response_id: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :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.voiceagents.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 VoiceConversationItem + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.ai.voiceagents.models.VoiceConversationItem] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[list[_models.VoiceConversationItem]] = 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_agent_endpoint_conversations_list_agent_conversation_response_items_request( + agent_name=agent_name, + conversation_id=conversation_id, + response_id=response_id, + foundry_features=foundry_features, + 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.VoiceConversationItem], + 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 + def list_agent_conversation_items( + self, + agent_name: str, + conversation_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.VoiceConversationItem"]: + """List items in a voice agent conversation. + + Returns a paged collection of items — the complete ordered conversation history, including user + input, assistant output, and client-created tool outputs (transcripts + tool events). Returns + ``404`` when the conversation was not persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose items are listed. Required. + :type conversation_id: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :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.voiceagents.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 VoiceConversationItem + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.ai.voiceagents.models.VoiceConversationItem] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[list[_models.VoiceConversationItem]] = 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_agent_endpoint_conversations_list_agent_conversation_items_request( + agent_name=agent_name, + conversation_id=conversation_id, + foundry_features=foundry_features, + 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.VoiceConversationItem], + 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_agent_conversation_item( + self, + agent_name: str, + conversation_id: str, + item_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> _models.VoiceConversationItem: + """Get a voice agent conversation item. + + Retrieves a single item from the specified conversation by its id, including its transcript. An + ``input_audio``/``output_audio`` content part indicates that audio is available for the item; + the canonical per-item audio metadata is the ``/items/{item_id}/audio`` resource, and the bytes + are streamed by ``/items/{item_id}/audio/content``. Returns ``404`` when the conversation or + item was not persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item to retrieve. Required. + :type item_id: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :return: VoiceConversationItem. The VoiceConversationItem is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceConversationItem + :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.VoiceConversationItem] = kwargs.pop("cls", None) + + _request = build_agent_endpoint_conversations_get_agent_conversation_item_request( + agent_name=agent_name, + conversation_id=conversation_id, + item_id=item_id, + foundry_features=foundry_features, + 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.VoiceConversationItem, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_agent_conversation_item_audio( + self, + agent_name: str, + conversation_id: str, + item_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> _models.VoiceItemAudioResponse: + """Get a voice agent conversation item's audio metadata. + + Returns metadata for a single conversation item's audio segment, including the common playback + facts (role, format/codec, sample rate, channels, offset, duration) for both Foundry-managed + and bring-your-own-storage (BYOS) recordings; for BYOS the response additionally includes + ``blob_uri``, the URI of the recording in the customer's own storage (no SAS) that the customer + downloads with their own credentials. Requires the conversation to have persisted audio + (``store = true``); returns ``404`` when the conversation, item, or its audio was not + persisted. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose audio metadata is retrieved. Required. + :type item_id: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :return: VoiceItemAudioResponse. The VoiceItemAudioResponse is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceItemAudioResponse + :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.VoiceItemAudioResponse] = kwargs.pop("cls", None) + + _request = build_agent_endpoint_conversations_get_agent_conversation_item_audio_request( + agent_name=agent_name, + conversation_id=conversation_id, + item_id=item_id, + foundry_features=foundry_features, + 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.VoiceItemAudioResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_agent_conversation_item_audio_content( # pylint: disable=name-too-long + self, + agent_name: str, + conversation_id: str, + item_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Stream a voice agent conversation item's audio. + + Streams a single conversation item's audio as a WAV (``audio/wav``) byte stream through the + service (no SAS URL). This route serves Foundry-managed storage only. For + bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download + directly from customer storage using the ``blob_uri`` returned by the item's ``/audio`` + metadata route — so this route returns ``409 Conflict`` for BYOS recordings. Returns ``404`` + when the conversation, item, or its audio was not persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose audio is streamed. Required. + :type item_id: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :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_agent_endpoint_conversations_get_agent_conversation_item_audio_content_request( + agent_name=agent_name, + conversation_id=conversation_id, + item_id=item_id, + foundry_features=foundry_features, + 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_agent_conversation_audio( + self, + agent_name: str, + conversation_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> _models.VoiceRecordingResponse: + """Get a voice agent conversation's merged recording metadata. + + Returns metadata for the whole-call merged stereo recording (user audio on the left channel, + agent audio on the right). The common metadata (format, sample rate, channels, channel layout, + duration) is returned for both Foundry-managed and bring-your-own-storage (BYOS) recordings; + for BYOS the response additionally includes ``blob_uri``, the URI of the recording in the + customer's own storage (no SAS) that the customer downloads with their own credentials. The + recording is built once from the per-turn segments after the session ends; a request against an + in-progress session returns ``409``. Requires the conversation to have persisted audio (``store + = true``); otherwise returns ``404``. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose merged recording metadata is + retrieved. Required. + :type conversation_id: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :return: VoiceRecordingResponse. The VoiceRecordingResponse is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceRecordingResponse + :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.VoiceRecordingResponse] = kwargs.pop("cls", None) + + _request = build_agent_endpoint_conversations_get_agent_conversation_audio_request( + agent_name=agent_name, + conversation_id=conversation_id, + foundry_features=foundry_features, + 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.VoiceRecordingResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_agent_conversation_audio_content( + self, + agent_name: str, + conversation_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Stream a voice agent conversation's merged recording. + + Streams the whole-call merged stereo recording as a WAV (``audio/wav``) byte stream through the + service (no SAS URL). This route serves Foundry-managed storage only. For + bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download + directly from customer storage using the ``blob_uri`` returned by the metadata route — so this + route returns ``409 Conflict`` for BYOS recordings. A request against an in-progress session + also returns ``409`` (a distinct condition: session-not-ended versus BYOS-download-required). A + conversation without persisted audio (``store = false``) returns ``404``. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose merged recording is streamed. + Required. + :type conversation_id: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :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_agent_endpoint_conversations_get_agent_conversation_audio_content_request( + agent_name=agent_name, + conversation_id=conversation_id, + foundry_features=foundry_features, + 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 VoiceAgentsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.voiceagents.aio.VoiceAgentsClient`'s + :attr:`voice_agents` 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: VoiceAgentsClientConfiguration = 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") + + @overload + async def create_voice_agent( + self, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + name: str, + definition: _models.VoiceAgentDefinition, + content_type: str = "application/json", + state: Optional[Union[str, _models.AgentState]] = None, + metadata: Optional[dict[str, str]] = None, + description: Optional[str] = None, + blueprint_reference: Optional[_models.AgentBlueprintReference] = None, + draft: Optional[bool] = None, + agent_endpoint: Optional[_models.AgentEndpointConfig] = None, + agent_card: Optional[_models.AgentCard] = None, + **kwargs: Any + ) -> _models.VoiceAgentObject: + """Create a voice agent. + + Creates a new voice agent, or a new version of an existing one. + + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword name: The unique name that identifies the agent. Name can be used to + retrieve/update/delete the agent. + + * Must start and end with alphanumeric characters, + * Can contain hyphens in the middle + * Must not exceed 63 characters. Required. + :paramtype name: str + :keyword definition: The voice agent definition. Required. + :paramtype definition: ~azure.ai.voiceagents.models.VoiceAgentDefinition + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword state: The initial operational state of the agent. Defaults to 'enabled' if not + specified. Known values are: "enabled" and "disabled". Default value is None. + :paramtype state: str or ~azure.ai.voiceagents.models.AgentState + :keyword 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. Default value is None. + :paramtype metadata: dict[str, str] + :keyword description: A human-readable description of the agent. Default value is None. + :paramtype description: str + :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. + :paramtype blueprint_reference: ~azure.ai.voiceagents.models.AgentBlueprintReference + :keyword draft: (Preview) Whether this agent version is a draft (candidate) rather than a + release. The service defaults to ``false`` if a value is not specified by the caller. Draft + versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. + Default value is None. + :paramtype draft: bool + :keyword agent_endpoint: An optional endpoint configuration. If not specified, a default + endpoint configuration will be set for the agent. Default value is None. + :paramtype agent_endpoint: ~azure.ai.voiceagents.models.AgentEndpointConfig + :keyword agent_card: Optional agent card for the agent. Default value is None. + :paramtype agent_card: ~azure.ai.voiceagents.models.AgentCard + :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_voice_agent( + self, + body: _types.CreateVoiceAgentRequest, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VoiceAgentObject: + """Create a voice agent. + + Creates a new voice agent, or a new version of an existing one. + + :param body: Required. + :type body: ~azure.ai.voiceagents.types.CreateVoiceAgentRequest + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_voice_agent( + self, + body: IO[bytes], + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VoiceAgentObject: + """Create a voice agent. + + Creates a new voice agent, or a new version of an existing one. + + :param body: Required. + :type body: IO[bytes] + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_voice_agent( # pylint: disable=too-many-locals + self, + body: Union[JSON, _types.CreateVoiceAgentRequest, IO[bytes]] = _Unset, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + name: str = _Unset, + definition: _models.VoiceAgentDefinition = _Unset, + state: Optional[Union[str, _models.AgentState]] = None, + metadata: Optional[dict[str, str]] = None, + description: Optional[str] = None, + blueprint_reference: Optional[_models.AgentBlueprintReference] = None, + draft: Optional[bool] = None, + agent_endpoint: Optional[_models.AgentEndpointConfig] = None, + agent_card: Optional[_models.AgentCard] = None, + **kwargs: Any + ) -> _models.VoiceAgentObject: + """Create a voice agent. + + Creates a new voice agent, or a new version of an existing one. + + :param body: Is one of the following types: JSON, CreateVoiceAgentRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.voiceagents.types.CreateVoiceAgentRequest or IO[bytes] + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword name: The unique name that identifies the agent. Name can be used to + retrieve/update/delete the agent. + + * Must start and end with alphanumeric characters, + * Can contain hyphens in the middle + * Must not exceed 63 characters. Required. + :paramtype name: str + :keyword definition: The voice agent definition. Required. + :paramtype definition: ~azure.ai.voiceagents.models.VoiceAgentDefinition + :keyword state: The initial operational state of the agent. Defaults to 'enabled' if not + specified. Known values are: "enabled" and "disabled". Default value is None. + :paramtype state: str or ~azure.ai.voiceagents.models.AgentState + :keyword 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. Default value is None. + :paramtype metadata: dict[str, str] + :keyword description: A human-readable description of the agent. Default value is None. + :paramtype description: str + :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. + :paramtype blueprint_reference: ~azure.ai.voiceagents.models.AgentBlueprintReference + :keyword draft: (Preview) Whether this agent version is a draft (candidate) rather than a + release. The service defaults to ``false`` if a value is not specified by the caller. Draft + versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. + Default value is None. + :paramtype draft: bool + :keyword agent_endpoint: An optional endpoint configuration. If not specified, a default + endpoint configuration will be set for the agent. Default value is None. + :paramtype agent_endpoint: ~azure.ai.voiceagents.models.AgentEndpointConfig + :keyword agent_card: Optional agent card for the agent. Default value is None. + :paramtype agent_card: ~azure.ai.voiceagents.models.AgentCard + :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VoiceAgentObject] = kwargs.pop("cls", None) + + if body is _Unset: + if name is _Unset: + raise TypeError("missing required argument: name") + if definition is _Unset: + raise TypeError("missing required argument: definition") + body = { + "agent_card": agent_card, + "agent_endpoint": agent_endpoint, + "blueprint_reference": blueprint_reference, + "definition": definition, + "description": description, + "draft": draft, + "metadata": metadata, + "name": name, + "state": state, + } + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_voice_agents_create_voice_agent_request( + foundry_features=foundry_features, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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 [201]: + 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.VoiceAgentObject, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_voice_agents( + self, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.VoiceAgentObject"]: + """List voice agents. + + Returns a paged collection of voice agents. + + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :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.voiceagents.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 VoiceAgentObject + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.voiceagents.models.VoiceAgentObject] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[list[_models.VoiceAgentObject]] = 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_voice_agents_list_voice_agents_request( + foundry_features=foundry_features, + 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.VoiceAgentObject], + 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_voice_agent( + self, + agent_name: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> _models.VoiceAgentObject: + """Get a voice agent. + + Retrieves a voice agent by its unique name. + + :param agent_name: The name of the voice agent to retrieve. Required. + :type agent_name: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject + :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.VoiceAgentObject] = kwargs.pop("cls", None) + + _request = build_voice_agents_get_voice_agent_request( + agent_name=agent_name, + foundry_features=foundry_features, + 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.VoiceAgentObject, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update_voice_agent( + self, + agent_name: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + definition: _models.VoiceAgentDefinition, + content_type: str = "application/json", + metadata: Optional[dict[str, str]] = None, + description: Optional[str] = None, + blueprint_reference: Optional[_models.AgentBlueprintReference] = None, + **kwargs: Any + ) -> _models.VoiceAgentObject: + """Update a voice agent. + + Updates a voice agent by adding a new version if there are any changes to the agent definition. + If no changes, returns the existing agent version. + + :param agent_name: The name of the voice agent to update. Required. + :type agent_name: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword definition: The voice agent definition. Required. + :paramtype definition: ~azure.ai.voiceagents.models.VoiceAgentDefinition + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword 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. Default value is None. + :paramtype metadata: dict[str, str] + :keyword description: A human-readable description of the agent. Default value is None. + :paramtype description: str + :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. + :paramtype blueprint_reference: ~azure.ai.voiceagents.models.AgentBlueprintReference + :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_voice_agent( + self, + agent_name: str, + body: _types.UpdateVoiceAgentRequest, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VoiceAgentObject: + """Update a voice agent. + + Updates a voice agent by adding a new version if there are any changes to the agent definition. + If no changes, returns the existing agent version. + + :param agent_name: The name of the voice agent to update. Required. + :type agent_name: str + :param body: Required. + :type body: ~azure.ai.voiceagents.types.UpdateVoiceAgentRequest + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_voice_agent( + self, + agent_name: str, + body: IO[bytes], + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VoiceAgentObject: + """Update a voice agent. + + Updates a voice agent by adding a new version if there are any changes to the agent definition. + If no changes, returns the existing agent version. + + :param agent_name: The name of the voice agent to update. Required. + :type agent_name: str + :param body: Required. + :type body: IO[bytes] + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_voice_agent( + self, + agent_name: str, + body: Union[JSON, _types.UpdateVoiceAgentRequest, IO[bytes]] = _Unset, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + definition: _models.VoiceAgentDefinition = _Unset, + metadata: Optional[dict[str, str]] = None, + description: Optional[str] = None, + blueprint_reference: Optional[_models.AgentBlueprintReference] = None, + **kwargs: Any + ) -> _models.VoiceAgentObject: + """Update a voice agent. + + Updates a voice agent by adding a new version if there are any changes to the agent definition. + If no changes, returns the existing agent version. + + :param agent_name: The name of the voice agent to update. Required. + :type agent_name: str + :param body: Is one of the following types: JSON, UpdateVoiceAgentRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.voiceagents.types.UpdateVoiceAgentRequest or IO[bytes] + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword definition: The voice agent definition. Required. + :paramtype definition: ~azure.ai.voiceagents.models.VoiceAgentDefinition + :keyword 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. Default value is None. + :paramtype metadata: dict[str, str] + :keyword description: A human-readable description of the agent. Default value is None. + :paramtype description: str + :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. + :paramtype blueprint_reference: ~azure.ai.voiceagents.models.AgentBlueprintReference + :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VoiceAgentObject] = kwargs.pop("cls", None) + + if body is _Unset: + if definition is _Unset: + raise TypeError("missing required argument: definition") + body = { + "blueprint_reference": blueprint_reference, + "definition": definition, + "description": description, + "metadata": metadata, + } + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_voice_agents_update_voice_agent_request( + agent_name=agent_name, + foundry_features=foundry_features, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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.VoiceAgentObject, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete_voice_agent( + self, + agent_name: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> None: + """Delete a voice agent. + + Deletes a voice agent and all of its versions. + + :param agent_name: The name of the voice agent to delete. Required. + :type agent_name: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :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_voice_agents_delete_voice_agent_request( + agent_name=agent_name, + foundry_features=foundry_features, + 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_async + async def enable_voice_agent( + self, + agent_name: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> None: + """Enable a voice agent. + + Enables the specified voice agent, allowing it to accept new requests. This operation is + idempotent — enabling an already-enabled voice agent returns success with no side effects. + + :param agent_name: The name of the voice agent to enable. Required. + :type agent_name: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :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_voice_agents_enable_voice_agent_request( + agent_name=agent_name, + foundry_features=foundry_features, + 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_async + async def disable_voice_agent( + self, + agent_name: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> None: + """Disable a voice agent. + + Disables the specified voice agent, preventing it from accepting new requests. This operation + is idempotent — disabling an already-disabled voice agent returns success with no side effects. + + :param agent_name: The name of the voice agent to disable. Required. + :type agent_name: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :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_voice_agents_disable_voice_agent_request( + agent_name=agent_name, + foundry_features=foundry_features, + 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 + + @overload + async def generate_voice_agent( + self, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + name: str, + model_type: Union[str, _models.VoiceModelType], + model: str, + agent_type: Union[str, _models.VoiceAgentType], + use_case: Union[str, _models.VoiceAgentUseCase], + goal: str, + content_type: str = "application/json", + description: Optional[str] = None, + tools: Optional[list["_unions.VoiceAgentTool"]] = None, + draft: Optional[bool] = None, + **kwargs: Any + ) -> _models.VoiceAgentObject: + """Generate a voice agent. + + Generates and creates a voice agent from high-level inputs plus a natural-language goal. The + operation expands the goal into a full, editable definition, creates the agent through the + standard voice create path, and returns the created ``VoiceAgentObject``. The caller can edit + or override the generated fields afterward through normal versioning. + + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword name: The unique name for the agent to create. Required. + :paramtype name: str + :keyword model_type: How the model backing the generated agent is served: ``managed`` + (service-managed) or ``self_deployed`` (the customer's own deployment). Carried through to the + generated definition, not generated. Known values are: "managed" and "self_deployed". Required. + :paramtype model_type: str or ~azure.ai.voiceagents.models.VoiceModelType + :keyword model: The model paired with ``model_type``: the service-managed model name when + ``managed``, or the customer's Foundry deployment name when ``self_deployed``. Carried through, + not generated. Required. + :paramtype model: str + :keyword agent_type: The persona/tone to steer generation. Known values are: "personal" and + "business". Required. + :paramtype agent_type: str or ~azure.ai.voiceagents.models.VoiceAgentType + :keyword use_case: The scenario-template catalog entry the generator specializes for. Known + values are: "customer_support", "reception", "sales", "travel_assistant", "outreach", + "personal_assistant", "learning", "call_center", and "in_car". Required. + :paramtype use_case: str or ~azure.ai.voiceagents.models.VoiceAgentUseCase + :keyword goal: A natural-language description of what the agent should do; the seed for the + generated ``instructions``. Required. + :paramtype goal: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword description: An optional description for the agent. Generated from ``goal`` when + omitted. Default value is None. + :paramtype description: str + :keyword tools: Optional tools carried through verbatim onto the generated agent (see + ``VoiceAgentTool``). Default value is None. + :paramtype tools: list[~azure.ai.voiceagents.models.RealtimeFunctionTool or + ~azure.ai.voiceagents.models.VoiceAgentMcpTool or ~azure.ai.voiceagents.models.VoiceSystemTool + or ~azure.ai.voiceagents.models.VoiceToolboxTool] + :keyword draft: (Preview) When ``true``, the generated voice agent is created as a draft — an + editable, unpublished version the caller can review and refine before publishing it via the + standard create/version path. The service defaults to ``false`` if a value is not specified by + the caller, in which case the agent is created and published normally. Default value is None. + :paramtype draft: bool + :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def generate_voice_agent( + self, + body: _types.GenerateVoiceAgentRequest, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VoiceAgentObject: + """Generate a voice agent. + + Generates and creates a voice agent from high-level inputs plus a natural-language goal. The + operation expands the goal into a full, editable definition, creates the agent through the + standard voice create path, and returns the created ``VoiceAgentObject``. The caller can edit + or override the generated fields afterward through normal versioning. + + :param body: Required. + :type body: ~azure.ai.voiceagents.types.GenerateVoiceAgentRequest + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def generate_voice_agent( + self, + body: IO[bytes], + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VoiceAgentObject: + """Generate a voice agent. + + Generates and creates a voice agent from high-level inputs plus a natural-language goal. The + operation expands the goal into a full, editable definition, creates the agent through the + standard voice create path, and returns the created ``VoiceAgentObject``. The caller can edit + or override the generated fields afterward through normal versioning. + + :param body: Required. + :type body: IO[bytes] + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def generate_voice_agent( # pylint: disable=too-many-locals + self, + body: Union[JSON, _types.GenerateVoiceAgentRequest, IO[bytes]] = _Unset, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + name: str = _Unset, + model_type: Union[str, _models.VoiceModelType] = _Unset, + model: str = _Unset, + agent_type: Union[str, _models.VoiceAgentType] = _Unset, + use_case: Union[str, _models.VoiceAgentUseCase] = _Unset, + goal: str = _Unset, + description: Optional[str] = None, + tools: Optional[list["_unions.VoiceAgentTool"]] = None, + draft: Optional[bool] = None, + **kwargs: Any + ) -> _models.VoiceAgentObject: + """Generate a voice agent. + + Generates and creates a voice agent from high-level inputs plus a natural-language goal. The + operation expands the goal into a full, editable definition, creates the agent through the + standard voice create path, and returns the created ``VoiceAgentObject``. The caller can edit + or override the generated fields afterward through normal versioning. + + :param body: Is one of the following types: JSON, GenerateVoiceAgentRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.voiceagents.types.GenerateVoiceAgentRequest or IO[bytes] + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword name: The unique name for the agent to create. Required. + :paramtype name: str + :keyword model_type: How the model backing the generated agent is served: ``managed`` + (service-managed) or ``self_deployed`` (the customer's own deployment). Carried through to the + generated definition, not generated. Known values are: "managed" and "self_deployed". Required. + :paramtype model_type: str or ~azure.ai.voiceagents.models.VoiceModelType + :keyword model: The model paired with ``model_type``: the service-managed model name when + ``managed``, or the customer's Foundry deployment name when ``self_deployed``. Carried through, + not generated. Required. + :paramtype model: str + :keyword agent_type: The persona/tone to steer generation. Known values are: "personal" and + "business". Required. + :paramtype agent_type: str or ~azure.ai.voiceagents.models.VoiceAgentType + :keyword use_case: The scenario-template catalog entry the generator specializes for. Known + values are: "customer_support", "reception", "sales", "travel_assistant", "outreach", + "personal_assistant", "learning", "call_center", and "in_car". Required. + :paramtype use_case: str or ~azure.ai.voiceagents.models.VoiceAgentUseCase + :keyword goal: A natural-language description of what the agent should do; the seed for the + generated ``instructions``. Required. + :paramtype goal: str + :keyword description: An optional description for the agent. Generated from ``goal`` when + omitted. Default value is None. + :paramtype description: str + :keyword tools: Optional tools carried through verbatim onto the generated agent (see + ``VoiceAgentTool``). Default value is None. + :paramtype tools: list[~azure.ai.voiceagents.models.RealtimeFunctionTool or + ~azure.ai.voiceagents.models.VoiceAgentMcpTool or ~azure.ai.voiceagents.models.VoiceSystemTool + or ~azure.ai.voiceagents.models.VoiceToolboxTool] + :keyword draft: (Preview) When ``true``, the generated voice agent is created as a draft — an + editable, unpublished version the caller can review and refine before publishing it via the + standard create/version path. The service defaults to ``false`` if a value is not specified by + the caller, in which case the agent is created and published normally. Default value is None. + :paramtype draft: bool + :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VoiceAgentObject] = kwargs.pop("cls", None) + + if body is _Unset: + if name is _Unset: + raise TypeError("missing required argument: name") + if model_type is _Unset: + raise TypeError("missing required argument: model_type") + if model is _Unset: + raise TypeError("missing required argument: model") + if agent_type is _Unset: + raise TypeError("missing required argument: agent_type") + if use_case is _Unset: + raise TypeError("missing required argument: use_case") + if goal is _Unset: + raise TypeError("missing required argument: goal") + body = { + "agent_type": agent_type, + "description": description, + "draft": draft, + "goal": goal, + "model": model, + "model_type": model_type, + "name": name, + "tools": tools, + "use_case": use_case, + } + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_voice_agents_generate_voice_agent_request( + foundry_features=foundry_features, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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.VoiceAgentObject, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_voice_agent_version( + self, + agent_name: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + definition: _models.VoiceAgentDefinition, + content_type: str = "application/json", + metadata: Optional[dict[str, str]] = None, + description: Optional[str] = None, + blueprint_reference: Optional[_models.AgentBlueprintReference] = None, + draft: Optional[bool] = None, + **kwargs: Any + ) -> _models.VoiceAgentVersionObject: + """Create a voice agent version. + + Creates a new version for the specified voice agent and returns the created version resource. + + :param agent_name: The name of the voice agent. Required. + :type agent_name: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword definition: The voice agent definition. Required. + :paramtype definition: ~azure.ai.voiceagents.models.VoiceAgentDefinition + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword 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. Default value is None. + :paramtype metadata: dict[str, str] + :keyword description: A human-readable description of the agent. Default value is None. + :paramtype description: str + :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. + :paramtype blueprint_reference: ~azure.ai.voiceagents.models.AgentBlueprintReference + :keyword draft: (Preview) Whether this agent version is a draft (candidate) rather than a + release. The service defaults to ``false`` if a value is not specified by the caller. Draft + versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. + Default value is None. + :paramtype draft: bool + :return: VoiceAgentVersionObject. The VoiceAgentVersionObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentVersionObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_voice_agent_version( + self, + agent_name: str, + body: _types.CreateVoiceAgentVersionRequest, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VoiceAgentVersionObject: + """Create a voice agent version. + + Creates a new version for the specified voice agent and returns the created version resource. + + :param agent_name: The name of the voice agent. Required. + :type agent_name: str + :param body: Required. + :type body: ~azure.ai.voiceagents.types.CreateVoiceAgentVersionRequest + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: VoiceAgentVersionObject. The VoiceAgentVersionObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentVersionObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_voice_agent_version( + self, + agent_name: str, + body: IO[bytes], + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VoiceAgentVersionObject: + """Create a voice agent version. + + Creates a new version for the specified voice agent and returns the created version resource. + + :param agent_name: The name of the voice agent. Required. + :type agent_name: str + :param body: Required. + :type body: IO[bytes] + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: VoiceAgentVersionObject. The VoiceAgentVersionObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentVersionObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_voice_agent_version( + self, + agent_name: str, + body: Union[JSON, _types.CreateVoiceAgentVersionRequest, IO[bytes]] = _Unset, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + definition: _models.VoiceAgentDefinition = _Unset, + metadata: Optional[dict[str, str]] = None, + description: Optional[str] = None, + blueprint_reference: Optional[_models.AgentBlueprintReference] = None, + draft: Optional[bool] = None, + **kwargs: Any + ) -> _models.VoiceAgentVersionObject: + """Create a voice agent version. + + Creates a new version for the specified voice agent and returns the created version resource. + + :param agent_name: The name of the voice agent. Required. + :type agent_name: str + :param body: Is one of the following types: JSON, CreateVoiceAgentVersionRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.voiceagents.types.CreateVoiceAgentVersionRequest or IO[bytes] + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword definition: The voice agent definition. Required. + :paramtype definition: ~azure.ai.voiceagents.models.VoiceAgentDefinition + :keyword 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. Default value is None. + :paramtype metadata: dict[str, str] + :keyword description: A human-readable description of the agent. Default value is None. + :paramtype description: str + :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. + :paramtype blueprint_reference: ~azure.ai.voiceagents.models.AgentBlueprintReference + :keyword draft: (Preview) Whether this agent version is a draft (candidate) rather than a + release. The service defaults to ``false`` if a value is not specified by the caller. Draft + versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. + Default value is None. + :paramtype draft: bool + :return: VoiceAgentVersionObject. The VoiceAgentVersionObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentVersionObject + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VoiceAgentVersionObject] = kwargs.pop("cls", None) + + if body is _Unset: + if definition is _Unset: + raise TypeError("missing required argument: definition") + body = { + "blueprint_reference": blueprint_reference, + "definition": definition, + "description": description, + "draft": draft, + "metadata": metadata, + } + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_voice_agents_create_voice_agent_version_request( + agent_name=agent_name, + foundry_features=foundry_features, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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.VoiceAgentVersionObject, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_voice_agent_versions( + self, + agent_name: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + include_drafts: Optional[bool] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.VoiceAgentVersionObject"]: + """List voice agent versions. + + Returns a paged collection of versions for the specified voice agent. + + :param agent_name: The name of the voice agent to retrieve versions for. Required. + :type agent_name: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :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.voiceagents.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 + :keyword include_drafts: (Preview) Whether to include draft versions in the listing. The + service defaults to ``false`` if a value is not specified by the caller (only non-draft + versions are returned). Default value is None. + :paramtype include_drafts: bool + :return: An iterator like instance of VoiceAgentVersionObject + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.ai.voiceagents.models.VoiceAgentVersionObject] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[list[_models.VoiceAgentVersionObject]] = 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_voice_agents_list_voice_agent_versions_request( + agent_name=agent_name, + foundry_features=foundry_features, + limit=limit, + order=order, + after=_continuation_token, + before=before, + include_drafts=include_drafts, + 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.VoiceAgentVersionObject], + 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_voice_agent_version( + self, + agent_name: str, + agent_version: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> _models.VoiceAgentVersionObject: + """Get a voice agent version. + + Retrieves the specified version of a voice agent by its agent name and version identifier. + + :param agent_name: The name of the voice agent to retrieve. Required. + :type agent_name: str + :param agent_version: The version of the voice agent to retrieve. Required. + :type agent_version: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :return: VoiceAgentVersionObject. The VoiceAgentVersionObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentVersionObject + :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.VoiceAgentVersionObject] = kwargs.pop("cls", None) + + _request = build_voice_agents_get_voice_agent_version_request( + agent_name=agent_name, + agent_version=agent_version, + foundry_features=foundry_features, + 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.VoiceAgentVersionObject, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete_voice_agent_version( + self, + agent_name: str, + agent_version: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> None: + """Delete a voice agent version. + + Deletes a specific version of a voice agent. + + :param agent_name: The name of the voice agent to delete. Required. + :type agent_name: str + :param agent_version: The version of the voice agent to delete. Required. + :type agent_version: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :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_voice_agents_delete_voice_agent_version_request( + agent_name=agent_name, + agent_version=agent_version, + foundry_features=foundry_features, + 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 diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/_patch.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/_patch.py new file mode 100644 index 000000000000..87676c65a8f0 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/_patch.py @@ -0,0 +1,21 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" + + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/__init__.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/__init__.py new file mode 100644 index 000000000000..35ef5a6a7339 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/__init__.py @@ -0,0 +1,680 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models import ( # type: ignore + A2AProtocolConfiguration, + ActivityProtocolConfiguration, + AgentBlueprintReference, + AgentCard, + AgentCardSkill, + AgentEndpointAuthorizationScheme, + AgentEndpointConfig, + AgentIdentity, + ApiErrorResponse, + AzureAvatarVoiceSyncVoice, + AzureCustomVoice, + AzurePersonalVoice, + AzureRealtimeNativeVoice, + AzureStandardVoice, + AzureVoice, + BotServiceAuthorizationScheme, + BotServiceRbacAuthorizationScheme, + BotServiceTenantAuthorizationScheme, + CreateTranscriptionResponseJsonUsage, + EntraAuthorizationScheme, + Error, + FixedRatioVersionSelectionRule, + InvocationsProtocolConfiguration, + InvocationsWsProtocolConfiguration, + LlmGeneratedVoiceGreetingConfig, + LogProbProperties, + MCPListToolsTool, + MCPListToolsToolAnnotations, + MCPListToolsToolInputSchema, + MCPTool, + MCPToolFilter, + MCPToolRequireApproval, + ManagedAgentIdentityBlueprintReference, + McpProtocolConfiguration, + Metadata, + OpenAIVoice, + ProtocolConfiguration, + RaiConfig, + RealtimeAudioFormats, + RealtimeAudioFormatsAudioPcm, + RealtimeAudioFormatsAudioPcma, + RealtimeAudioFormatsAudioPcmu, + RealtimeConversationItem, + RealtimeConversationItemFunctionCall, + RealtimeConversationItemFunctionCallOutput, + RealtimeConversationItemMessage, + RealtimeConversationItemMessageAssistant, + RealtimeConversationItemMessageAssistantContent, + RealtimeConversationItemMessageSystem, + RealtimeConversationItemMessageSystemContent, + RealtimeConversationItemMessageUser, + RealtimeConversationItemMessageUserContent, + RealtimeFunctionTool, + RealtimeFunctionToolParameters, + RealtimeMCPApprovalRequest, + RealtimeMCPApprovalResponse, + RealtimeMCPError, + RealtimeMCPHTTPError, + RealtimeMCPListTools, + RealtimeMCPProtocolError, + RealtimeMCPToolCall, + RealtimeMCPToolExecutionError, + RealtimeReasoning, + RealtimeResponseStatusDetails, + RealtimeResponseStatusDetailsError, + RealtimeResponseUsage, + RealtimeResponseUsageInputTokenDetails, + RealtimeResponseUsageInputTokenDetailsCachedTokensDetails, + RealtimeResponseUsageOutputTokenDetails, + RealtimeServerEvent, + RealtimeServerEventConversationItemInputAudioTranscriptionFailedError, + RealtimeServerEventRateLimitsUpdatedRateLimits, + RealtimeServerEventResponseContentPartAdded, + RealtimeServerEventResponseContentPartAddedPart, + RealtimeToolChoiceFunction, + ResponsesProtocolConfiguration, + StructuredInputDefinition, + TemplateVoiceGreetingConfig, + Tool, + ToolChoiceFunction, + ToolChoiceMCP, + ToolChoiceParam, + ToolConfig, + TranscriptTextUsageDuration, + TranscriptTextUsageTokens, + TranscriptTextUsageTokensInputTokenDetails, + VersionSelectionRule, + VersionSelector, + VoiceAgentAnimationConfig, + VoiceAgentAvatarIceServer, + VoiceAgentAvatarScene, + VoiceAgentAvatarVideoBackground, + VoiceAgentAvatarVideoCrop, + VoiceAgentAvatarVideoParams, + VoiceAgentAvatarVideoResolution, + VoiceAgentAzureMultilingualSemanticVadTurnDetection, + VoiceAgentAzureSemanticVadTurnDetection, + VoiceAgentClientEventConversationItemCreate, + VoiceAgentClientEventConversationItemDelete, + VoiceAgentClientEventConversationItemRetrieve, + VoiceAgentClientEventConversationItemTruncate, + VoiceAgentClientEventInputAudioBufferAppend, + VoiceAgentClientEventInputAudioBufferClear, + VoiceAgentClientEventInputAudioBufferCommit, + VoiceAgentClientEventOutputAudioBufferClear, + VoiceAgentClientEventResponseCancel, + VoiceAgentClientEventResponseCreate, + VoiceAgentClientEventSessionAvatarConnect, + VoiceAgentClientEventSessionUpdate, + VoiceAgentDefinition, + VoiceAgentEchoCancellation, + VoiceAgentEndOfUtteranceDetection, + VoiceAgentEstimatedCost, + VoiceAgentFileSearchCallItem, + VoiceAgentFileSearchResult, + VoiceAgentHandoffEdgeConfig, + VoiceAgentHandoffEdgeState, + VoiceAgentHandoffGraphConfig, + VoiceAgentHandoffNodeConfig, + VoiceAgentHandoffNodeSessionConfig, + VoiceAgentHandoffNodeState, + VoiceAgentHandoffState, + VoiceAgentInterimResponseConfig, + VoiceAgentLlmInterimResponseConfig, + VoiceAgentMcpAssignedManagedIdentity, + VoiceAgentMcpTool, + VoiceAgentObject, + VoiceAgentObjectVersions, + VoiceAgentRealtimeResponse, + VoiceAgentResponseCreateAudio, + VoiceAgentResponseCreateParams, + VoiceAgentResponseEventAudioContentPart, + VoiceAgentResponseEventTextContentPart, + VoiceAgentSemanticVadTurnDetection, + VoiceAgentServerEventConversationCreated, + VoiceAgentServerEventConversationItemAdded, + VoiceAgentServerEventConversationItemCreated, + VoiceAgentServerEventConversationItemDeleted, + VoiceAgentServerEventConversationItemDone, + VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted, + VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta, + VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed, + VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment, + VoiceAgentServerEventConversationItemRetrieved, + VoiceAgentServerEventConversationItemTruncated, + VoiceAgentServerEventError, + VoiceAgentServerEventErrorDetails, + VoiceAgentServerEventFileSearchCallCompleted, + VoiceAgentServerEventFileSearchCallInProgress, + VoiceAgentServerEventFileSearchCallSearching, + VoiceAgentServerEventInputAudioBufferCleared, + VoiceAgentServerEventInputAudioBufferCommitted, + VoiceAgentServerEventInputAudioBufferSpeechStarted, + VoiceAgentServerEventInputAudioBufferSpeechStopped, + VoiceAgentServerEventInputAudioBufferTimeoutTriggered, + VoiceAgentServerEventMcpListToolsCompleted, + VoiceAgentServerEventMcpListToolsFailed, + VoiceAgentServerEventMcpListToolsInProgress, + VoiceAgentServerEventOutputAudioBufferCleared, + VoiceAgentServerEventRateLimitsUpdated, + VoiceAgentServerEventResponseAnimationBlendshapesDelta, + VoiceAgentServerEventResponseAnimationBlendshapesDone, + VoiceAgentServerEventResponseAnimationVisemeDelta, + VoiceAgentServerEventResponseAnimationVisemeDone, + VoiceAgentServerEventResponseAudioDelta, + VoiceAgentServerEventResponseAudioDone, + VoiceAgentServerEventResponseAudioTimestampDelta, + VoiceAgentServerEventResponseAudioTimestampDone, + VoiceAgentServerEventResponseAudioTranscriptDelta, + VoiceAgentServerEventResponseAudioTranscriptDone, + VoiceAgentServerEventResponseContentPartDone, + VoiceAgentServerEventResponseCreated, + VoiceAgentServerEventResponseDone, + VoiceAgentServerEventResponseFunctionCallArgumentsDelta, + VoiceAgentServerEventResponseFunctionCallArgumentsDone, + VoiceAgentServerEventResponseMcpCallArgumentsDelta, + VoiceAgentServerEventResponseMcpCallArgumentsDone, + VoiceAgentServerEventResponseMcpCallCompleted, + VoiceAgentServerEventResponseMcpCallFailed, + VoiceAgentServerEventResponseMcpCallInProgress, + VoiceAgentServerEventResponseOutputItemAdded, + VoiceAgentServerEventResponseOutputItemDone, + VoiceAgentServerEventResponseTextDelta, + VoiceAgentServerEventResponseTextDone, + VoiceAgentServerEventResponseVideoDelta, + VoiceAgentServerEventSessionAvatarConnecting, + VoiceAgentServerEventSessionAvatarSwitchToIdle, + VoiceAgentServerEventSessionAvatarSwitchToSpeaking, + VoiceAgentServerEventSessionCreated, + VoiceAgentServerEventSessionHandoffAborted, + VoiceAgentServerEventSessionHandoffCompleted, + VoiceAgentServerEventSessionHandoffStarted, + VoiceAgentServerEventSessionUpdated, + VoiceAgentServerEventWarning, + VoiceAgentServerEventWarningDetails, + VoiceAgentServerEventWebSearchCallCompleted, + VoiceAgentServerEventWebSearchCallInProgress, + VoiceAgentServerEventWebSearchCallSearching, + VoiceAgentServerVadTurnDetection, + VoiceAgentSessionAvatarConfig, + VoiceAgentSessionMcpTool, + VoiceAgentSessionResponseAudio, + VoiceAgentSessionResponseAudioInput, + VoiceAgentSessionResponseAudioOutput, + VoiceAgentSessionResponseConfig, + VoiceAgentSessionUpdateAudio, + VoiceAgentSessionUpdateAudioInput, + VoiceAgentSessionUpdateAudioOutput, + VoiceAgentSessionUpdateConfig, + VoiceAgentStaticInterimResponseConfig, + VoiceAgentTranscriptionPhrase, + VoiceAgentTranscriptionWord, + VoiceAgentVersionObject, + VoiceAgentVoiceAdaptation, + VoiceAgentWebSearchActionFind, + VoiceAgentWebSearchActionOpenPage, + VoiceAgentWebSearchActionSearch, + VoiceAgentWebSearchCallItem, + VoiceAgentWebSearchSource, + VoiceAgentWorkflowActionItem, + VoiceAssistantMessageItem, + VoiceAudioConfig, + VoiceAudioFormat, + VoiceAudioInputConfig, + VoiceAudioOutputConfig, + VoiceAvatarConfig, + VoiceAzureSemanticDetection, + VoiceAzureSemanticDetectionEn, + VoiceAzureSemanticDetectionMultilingual, + VoiceAzureSemanticVadEnTurnDetection, + VoiceAzureSemanticVadMultilingualTurnDetection, + VoiceAzureSemanticVadTurnDetection, + VoiceConversation, + VoiceConversationItem, + VoiceEndOfUtteranceDetection, + VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, + VoiceGreetingConfig, + VoiceInputTranscription, + VoiceItemAudioResponse, + VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem, + VoiceMcpCallItem, + VoiceMcpListToolsItem, + VoiceMessageItem, + VoiceNoiseReduction, + VoiceRecordingChannelLayout, + VoiceRecordingResponse, + VoiceResponse, + VoiceResponseAudio, + VoiceResponseAudioOutput, + VoiceSemanticVadTurnDetection, + VoiceServerVadTurnDetection, + VoiceSystemMessageItem, + VoiceSystemTool, + VoiceToolboxTool, + VoiceTurnDetection, + VoiceUserMessageItem, +) + +from ._enums import ( # type: ignore + AgentBlueprintReferenceType, + AgentDefinitionOptInKeys, + AgentEndpointAuthorizationSchemeType, + AgentIdentityStatus, + AgentObjectType, + AgentState, + AgentStateSource, + AgentVersionStatus, + AzureRealtimeNativeVoiceName, + AzureVoiceType, + CallableToolAllowedCaller, + CreateTranscriptionResponseJsonUsageType, + PageOrder, + PersonalVoiceModel, + RealtimeAudioFormatsType, + RealtimeClientEventType, + RealtimeConversationItemMessageType, + RealtimeConversationItemType, + RealtimeMcpErrorType, + RealtimeReasoningEffort, + RealtimeServerEventType, + ToolChoiceOptions, + ToolChoiceParamType, + ToolType, + VersionSelectorType, + VoiceAgentAnimationOutputType, + VoiceAgentAvatarOutputProtocol, + VoiceAgentAvatarType, + VoiceAgentAzureSemanticVadType, + VoiceAgentEchoCancellationReferenceSource, + VoiceAgentEndOfUtteranceModel, + VoiceAgentEndOfUtteranceThresholdLevel, + VoiceAgentEstimatedCostStatus, + VoiceAgentFileSearchCallStatus, + VoiceAgentHandoffAbortReason, + VoiceAgentHandoffReasoningEffort, + VoiceAgentHandoffTargetResponse, + VoiceAgentInterimResponseTrigger, + VoiceAgentMcpApprovalMode, + VoiceAgentMcpResponseScheduling, + VoiceAgentPipelineFamily, + VoiceAgentResponseAudioFormat, + VoiceAgentResponseStatus, + VoiceAgentSessionIncludeOption, + VoiceAgentType, + VoiceAgentUseCase, + VoiceAgentWebSearchCallStatus, + VoiceAgentWebSocketSubprotocol, + VoiceAudioCodec, + VoiceAudioContainerFormat, + VoiceAudioFormatType, + VoiceAudioRole, + VoiceAudioTimestampType, + VoiceAvatarOutputProtocol, + VoiceAvatarType, + VoiceConversationItemType, + VoiceConversationStatus, + VoiceEndOfUtteranceDetectionModel, + VoiceEndOfUtteranceThresholdLevel, + VoiceGreetingToolChoice, + VoiceIdsShared, + VoiceInputTranscriptionModel, + VoiceModelType, + VoiceNoiseReductionType, + VoiceOutputModality, + VoiceResponseStatus, + VoiceSystemToolName, + VoiceTurnDetectionType, +) +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "A2AProtocolConfiguration", + "ActivityProtocolConfiguration", + "AgentBlueprintReference", + "AgentCard", + "AgentCardSkill", + "AgentEndpointAuthorizationScheme", + "AgentEndpointConfig", + "AgentIdentity", + "ApiErrorResponse", + "AzureAvatarVoiceSyncVoice", + "AzureCustomVoice", + "AzurePersonalVoice", + "AzureRealtimeNativeVoice", + "AzureStandardVoice", + "AzureVoice", + "BotServiceAuthorizationScheme", + "BotServiceRbacAuthorizationScheme", + "BotServiceTenantAuthorizationScheme", + "CreateTranscriptionResponseJsonUsage", + "EntraAuthorizationScheme", + "Error", + "FixedRatioVersionSelectionRule", + "InvocationsProtocolConfiguration", + "InvocationsWsProtocolConfiguration", + "LlmGeneratedVoiceGreetingConfig", + "LogProbProperties", + "MCPListToolsTool", + "MCPListToolsToolAnnotations", + "MCPListToolsToolInputSchema", + "MCPTool", + "MCPToolFilter", + "MCPToolRequireApproval", + "ManagedAgentIdentityBlueprintReference", + "McpProtocolConfiguration", + "Metadata", + "OpenAIVoice", + "ProtocolConfiguration", + "RaiConfig", + "RealtimeAudioFormats", + "RealtimeAudioFormatsAudioPcm", + "RealtimeAudioFormatsAudioPcma", + "RealtimeAudioFormatsAudioPcmu", + "RealtimeConversationItem", + "RealtimeConversationItemFunctionCall", + "RealtimeConversationItemFunctionCallOutput", + "RealtimeConversationItemMessage", + "RealtimeConversationItemMessageAssistant", + "RealtimeConversationItemMessageAssistantContent", + "RealtimeConversationItemMessageSystem", + "RealtimeConversationItemMessageSystemContent", + "RealtimeConversationItemMessageUser", + "RealtimeConversationItemMessageUserContent", + "RealtimeFunctionTool", + "RealtimeFunctionToolParameters", + "RealtimeMCPApprovalRequest", + "RealtimeMCPApprovalResponse", + "RealtimeMCPError", + "RealtimeMCPHTTPError", + "RealtimeMCPListTools", + "RealtimeMCPProtocolError", + "RealtimeMCPToolCall", + "RealtimeMCPToolExecutionError", + "RealtimeReasoning", + "RealtimeResponseStatusDetails", + "RealtimeResponseStatusDetailsError", + "RealtimeResponseUsage", + "RealtimeResponseUsageInputTokenDetails", + "RealtimeResponseUsageInputTokenDetailsCachedTokensDetails", + "RealtimeResponseUsageOutputTokenDetails", + "RealtimeServerEvent", + "RealtimeServerEventConversationItemInputAudioTranscriptionFailedError", + "RealtimeServerEventRateLimitsUpdatedRateLimits", + "RealtimeServerEventResponseContentPartAdded", + "RealtimeServerEventResponseContentPartAddedPart", + "RealtimeToolChoiceFunction", + "ResponsesProtocolConfiguration", + "StructuredInputDefinition", + "TemplateVoiceGreetingConfig", + "Tool", + "ToolChoiceFunction", + "ToolChoiceMCP", + "ToolChoiceParam", + "ToolConfig", + "TranscriptTextUsageDuration", + "TranscriptTextUsageTokens", + "TranscriptTextUsageTokensInputTokenDetails", + "VersionSelectionRule", + "VersionSelector", + "VoiceAgentAnimationConfig", + "VoiceAgentAvatarIceServer", + "VoiceAgentAvatarScene", + "VoiceAgentAvatarVideoBackground", + "VoiceAgentAvatarVideoCrop", + "VoiceAgentAvatarVideoParams", + "VoiceAgentAvatarVideoResolution", + "VoiceAgentAzureMultilingualSemanticVadTurnDetection", + "VoiceAgentAzureSemanticVadTurnDetection", + "VoiceAgentClientEventConversationItemCreate", + "VoiceAgentClientEventConversationItemDelete", + "VoiceAgentClientEventConversationItemRetrieve", + "VoiceAgentClientEventConversationItemTruncate", + "VoiceAgentClientEventInputAudioBufferAppend", + "VoiceAgentClientEventInputAudioBufferClear", + "VoiceAgentClientEventInputAudioBufferCommit", + "VoiceAgentClientEventOutputAudioBufferClear", + "VoiceAgentClientEventResponseCancel", + "VoiceAgentClientEventResponseCreate", + "VoiceAgentClientEventSessionAvatarConnect", + "VoiceAgentClientEventSessionUpdate", + "VoiceAgentDefinition", + "VoiceAgentEchoCancellation", + "VoiceAgentEndOfUtteranceDetection", + "VoiceAgentEstimatedCost", + "VoiceAgentFileSearchCallItem", + "VoiceAgentFileSearchResult", + "VoiceAgentHandoffEdgeConfig", + "VoiceAgentHandoffEdgeState", + "VoiceAgentHandoffGraphConfig", + "VoiceAgentHandoffNodeConfig", + "VoiceAgentHandoffNodeSessionConfig", + "VoiceAgentHandoffNodeState", + "VoiceAgentHandoffState", + "VoiceAgentInterimResponseConfig", + "VoiceAgentLlmInterimResponseConfig", + "VoiceAgentMcpAssignedManagedIdentity", + "VoiceAgentMcpTool", + "VoiceAgentObject", + "VoiceAgentObjectVersions", + "VoiceAgentRealtimeResponse", + "VoiceAgentResponseCreateAudio", + "VoiceAgentResponseCreateParams", + "VoiceAgentResponseEventAudioContentPart", + "VoiceAgentResponseEventTextContentPart", + "VoiceAgentSemanticVadTurnDetection", + "VoiceAgentServerEventConversationCreated", + "VoiceAgentServerEventConversationItemAdded", + "VoiceAgentServerEventConversationItemCreated", + "VoiceAgentServerEventConversationItemDeleted", + "VoiceAgentServerEventConversationItemDone", + "VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted", + "VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta", + "VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed", + "VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment", + "VoiceAgentServerEventConversationItemRetrieved", + "VoiceAgentServerEventConversationItemTruncated", + "VoiceAgentServerEventError", + "VoiceAgentServerEventErrorDetails", + "VoiceAgentServerEventFileSearchCallCompleted", + "VoiceAgentServerEventFileSearchCallInProgress", + "VoiceAgentServerEventFileSearchCallSearching", + "VoiceAgentServerEventInputAudioBufferCleared", + "VoiceAgentServerEventInputAudioBufferCommitted", + "VoiceAgentServerEventInputAudioBufferSpeechStarted", + "VoiceAgentServerEventInputAudioBufferSpeechStopped", + "VoiceAgentServerEventInputAudioBufferTimeoutTriggered", + "VoiceAgentServerEventMcpListToolsCompleted", + "VoiceAgentServerEventMcpListToolsFailed", + "VoiceAgentServerEventMcpListToolsInProgress", + "VoiceAgentServerEventOutputAudioBufferCleared", + "VoiceAgentServerEventRateLimitsUpdated", + "VoiceAgentServerEventResponseAnimationBlendshapesDelta", + "VoiceAgentServerEventResponseAnimationBlendshapesDone", + "VoiceAgentServerEventResponseAnimationVisemeDelta", + "VoiceAgentServerEventResponseAnimationVisemeDone", + "VoiceAgentServerEventResponseAudioDelta", + "VoiceAgentServerEventResponseAudioDone", + "VoiceAgentServerEventResponseAudioTimestampDelta", + "VoiceAgentServerEventResponseAudioTimestampDone", + "VoiceAgentServerEventResponseAudioTranscriptDelta", + "VoiceAgentServerEventResponseAudioTranscriptDone", + "VoiceAgentServerEventResponseContentPartDone", + "VoiceAgentServerEventResponseCreated", + "VoiceAgentServerEventResponseDone", + "VoiceAgentServerEventResponseFunctionCallArgumentsDelta", + "VoiceAgentServerEventResponseFunctionCallArgumentsDone", + "VoiceAgentServerEventResponseMcpCallArgumentsDelta", + "VoiceAgentServerEventResponseMcpCallArgumentsDone", + "VoiceAgentServerEventResponseMcpCallCompleted", + "VoiceAgentServerEventResponseMcpCallFailed", + "VoiceAgentServerEventResponseMcpCallInProgress", + "VoiceAgentServerEventResponseOutputItemAdded", + "VoiceAgentServerEventResponseOutputItemDone", + "VoiceAgentServerEventResponseTextDelta", + "VoiceAgentServerEventResponseTextDone", + "VoiceAgentServerEventResponseVideoDelta", + "VoiceAgentServerEventSessionAvatarConnecting", + "VoiceAgentServerEventSessionAvatarSwitchToIdle", + "VoiceAgentServerEventSessionAvatarSwitchToSpeaking", + "VoiceAgentServerEventSessionCreated", + "VoiceAgentServerEventSessionHandoffAborted", + "VoiceAgentServerEventSessionHandoffCompleted", + "VoiceAgentServerEventSessionHandoffStarted", + "VoiceAgentServerEventSessionUpdated", + "VoiceAgentServerEventWarning", + "VoiceAgentServerEventWarningDetails", + "VoiceAgentServerEventWebSearchCallCompleted", + "VoiceAgentServerEventWebSearchCallInProgress", + "VoiceAgentServerEventWebSearchCallSearching", + "VoiceAgentServerVadTurnDetection", + "VoiceAgentSessionAvatarConfig", + "VoiceAgentSessionMcpTool", + "VoiceAgentSessionResponseAudio", + "VoiceAgentSessionResponseAudioInput", + "VoiceAgentSessionResponseAudioOutput", + "VoiceAgentSessionResponseConfig", + "VoiceAgentSessionUpdateAudio", + "VoiceAgentSessionUpdateAudioInput", + "VoiceAgentSessionUpdateAudioOutput", + "VoiceAgentSessionUpdateConfig", + "VoiceAgentStaticInterimResponseConfig", + "VoiceAgentTranscriptionPhrase", + "VoiceAgentTranscriptionWord", + "VoiceAgentVersionObject", + "VoiceAgentVoiceAdaptation", + "VoiceAgentWebSearchActionFind", + "VoiceAgentWebSearchActionOpenPage", + "VoiceAgentWebSearchActionSearch", + "VoiceAgentWebSearchCallItem", + "VoiceAgentWebSearchSource", + "VoiceAgentWorkflowActionItem", + "VoiceAssistantMessageItem", + "VoiceAudioConfig", + "VoiceAudioFormat", + "VoiceAudioInputConfig", + "VoiceAudioOutputConfig", + "VoiceAvatarConfig", + "VoiceAzureSemanticDetection", + "VoiceAzureSemanticDetectionEn", + "VoiceAzureSemanticDetectionMultilingual", + "VoiceAzureSemanticVadEnTurnDetection", + "VoiceAzureSemanticVadMultilingualTurnDetection", + "VoiceAzureSemanticVadTurnDetection", + "VoiceConversation", + "VoiceConversationItem", + "VoiceEndOfUtteranceDetection", + "VoiceFunctionCallItem", + "VoiceFunctionCallOutputItem", + "VoiceGreetingConfig", + "VoiceInputTranscription", + "VoiceItemAudioResponse", + "VoiceMcpApprovalRequestItem", + "VoiceMcpApprovalResponseItem", + "VoiceMcpCallItem", + "VoiceMcpListToolsItem", + "VoiceMessageItem", + "VoiceNoiseReduction", + "VoiceRecordingChannelLayout", + "VoiceRecordingResponse", + "VoiceResponse", + "VoiceResponseAudio", + "VoiceResponseAudioOutput", + "VoiceSemanticVadTurnDetection", + "VoiceServerVadTurnDetection", + "VoiceSystemMessageItem", + "VoiceSystemTool", + "VoiceToolboxTool", + "VoiceTurnDetection", + "VoiceUserMessageItem", + "AgentBlueprintReferenceType", + "AgentDefinitionOptInKeys", + "AgentEndpointAuthorizationSchemeType", + "AgentIdentityStatus", + "AgentObjectType", + "AgentState", + "AgentStateSource", + "AgentVersionStatus", + "AzureRealtimeNativeVoiceName", + "AzureVoiceType", + "CallableToolAllowedCaller", + "CreateTranscriptionResponseJsonUsageType", + "PageOrder", + "PersonalVoiceModel", + "RealtimeAudioFormatsType", + "RealtimeClientEventType", + "RealtimeConversationItemMessageType", + "RealtimeConversationItemType", + "RealtimeMcpErrorType", + "RealtimeReasoningEffort", + "RealtimeServerEventType", + "ToolChoiceOptions", + "ToolChoiceParamType", + "ToolType", + "VersionSelectorType", + "VoiceAgentAnimationOutputType", + "VoiceAgentAvatarOutputProtocol", + "VoiceAgentAvatarType", + "VoiceAgentAzureSemanticVadType", + "VoiceAgentEchoCancellationReferenceSource", + "VoiceAgentEndOfUtteranceModel", + "VoiceAgentEndOfUtteranceThresholdLevel", + "VoiceAgentEstimatedCostStatus", + "VoiceAgentFileSearchCallStatus", + "VoiceAgentHandoffAbortReason", + "VoiceAgentHandoffReasoningEffort", + "VoiceAgentHandoffTargetResponse", + "VoiceAgentInterimResponseTrigger", + "VoiceAgentMcpApprovalMode", + "VoiceAgentMcpResponseScheduling", + "VoiceAgentPipelineFamily", + "VoiceAgentResponseAudioFormat", + "VoiceAgentResponseStatus", + "VoiceAgentSessionIncludeOption", + "VoiceAgentType", + "VoiceAgentUseCase", + "VoiceAgentWebSearchCallStatus", + "VoiceAgentWebSocketSubprotocol", + "VoiceAudioCodec", + "VoiceAudioContainerFormat", + "VoiceAudioFormatType", + "VoiceAudioRole", + "VoiceAudioTimestampType", + "VoiceAvatarOutputProtocol", + "VoiceAvatarType", + "VoiceConversationItemType", + "VoiceConversationStatus", + "VoiceEndOfUtteranceDetectionModel", + "VoiceEndOfUtteranceThresholdLevel", + "VoiceGreetingToolChoice", + "VoiceIdsShared", + "VoiceInputTranscriptionModel", + "VoiceModelType", + "VoiceNoiseReductionType", + "VoiceOutputModality", + "VoiceResponseStatus", + "VoiceSystemToolName", + "VoiceTurnDetectionType", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/_enums.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/_enums.py new file mode 100644 index 000000000000..20bcab760940 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/_enums.py @@ -0,0 +1,1084 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum +from azure.core import CaseInsensitiveEnumMeta + + +class AgentBlueprintReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of AgentBlueprintReferenceType.""" + + MANAGED_AGENT_IDENTITY_BLUEPRINT = "ManagedAgentIdentityBlueprint" + """MANAGED_AGENT_IDENTITY_BLUEPRINT.""" + + +class AgentDefinitionOptInKeys(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Feature opt-in keys for agent definition operations supporting hosted or workflow agents.""" + + WORKFLOW_AGENTS_V1_PREVIEW = "WorkflowAgents=V1Preview" + """WORKFLOW_AGENTS_V1_PREVIEW.""" + EXTERNAL_AGENTS_V1_PREVIEW = "ExternalAgents=V1Preview" + """EXTERNAL_AGENTS_V1_PREVIEW.""" + DRAFT_AGENTS_V1_PREVIEW = "DraftAgents=V1Preview" + """DRAFT_AGENTS_V1_PREVIEW.""" + VOICE_AGENTS_V1_PREVIEW = "VoiceAgents=V1Preview" + """VOICE_AGENTS_V1_PREVIEW.""" + + +class AgentEndpointAuthorizationSchemeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of AgentEndpointAuthorizationSchemeType.""" + + ENTRA = "Entra" + """ENTRA.""" + BOT_SERVICE = "BotService" + """BOT_SERVICE.""" + BOT_SERVICE_RBAC = "BotServiceRbac" + """BOT_SERVICE_RBAC.""" + BOT_SERVICE_TENANT = "BotServiceTenant" + """BOT_SERVICE_TENANT.""" + + +class AgentIdentityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The status of an agent identity, applicable to both the agent instance identity and the agent + blueprint. + """ + + ACTIVE = "active" + """The agent identity is active and can be used to access resources.""" + DISABLED = "disabled" + """The agent identity is disabled and cannot be used to access resources.""" + + +class AgentObjectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of AgentObjectType.""" + + AGENT = "agent" + """AGENT.""" + AGENT_VERSION = "agent.version" + """AGENT_VERSION.""" + AGENT_DELETED = "agent.deleted" + """AGENT_DELETED.""" + AGENT_VERSION_DELETED = "agent.version.deleted" + """AGENT_VERSION_DELETED.""" + AGENT_CONTAINER = "agent.container" + """AGENT_CONTAINER.""" + + +class AgentState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The operational state of an agent.""" + + ENABLED = "enabled" + """Agent endpoint accepts requests. This is the default state on creation.""" + DISABLED = "disabled" + """Agent endpoint rejects all requests.""" + + +class AgentStateSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates the source of an agent's operational state. Empty when the state is not derived from + a specific source. + """ + + AGENT_INSTANCE_IDENTITY = "agent_instance_identity" + """The state is derived from the agent's instance identity.""" + AGENT_BLUEPRINT = "agent_blueprint" + """The state is derived from the agent's blueprint.""" + + +class AgentVersionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The provisioning status of an agent version.""" + + CREATING = "creating" + """The agent version is being provisioned.""" + ACTIVE = "active" + """The agent version is active and ready to serve requests.""" + FAILED = "failed" + """The agent version provisioning failed.""" + DELETING = "deleting" + """The agent version is being deleted.""" + DELETED = "deleted" + """The agent version has been deleted.""" + + +class AzureRealtimeNativeVoiceName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """A known Azure realtime-native voice name. This union is extensible, so additional + service-supported names do not require an SDK update. + """ + + AARTI = "aarti" + """The Aarti voice.""" + ALVARO = "alvaro" + """The Alvaro voice.""" + ANDREW = "andrew" + """The Andrew voice.""" + ANTONIO = "antonio" + """The Antonio voice.""" + AVA = "ava" + """The Ava voice.""" + CLARA = "clara" + """The Clara voice.""" + DALIA = "dalia" + """The Dalia voice.""" + DENISE = "denise" + """The Denise voice.""" + DIEGO = "diego" + """The Diego voice.""" + DIYA = "diya" + """The Diya voice.""" + ELSA = "elsa" + """The Elsa voice.""" + EMMA = "emma" + """The Emma voice.""" + FLORIAN = "florian" + """The Florian voice.""" + FRANCISCA = "francisca" + """The Francisca voice.""" + HYUNSU = "hyunsu" + """The Hyunsu voice.""" + JORGE = "jorge" + """The Jorge voice.""" + KEITA = "keita" + """The Keita voice.""" + LIAM = "liam" + """The Liam voice.""" + MEERA = "meera" + """The Meera voice.""" + NANAMI = "nanami" + """The Nanami voice.""" + NATASHA = "natasha" + """The Natasha voice.""" + NIWAT = "niwat" + """The Niwat voice.""" + PREMWADEE = "premwadee" + """The Premwadee voice.""" + REMY = "remy" + """The Remy voice.""" + RYAN = "ryan" + """The Ryan voice.""" + SERAPHINA = "seraphina" + """The Seraphina voice.""" + SONIA = "sonia" + """The Sonia voice.""" + SUNHI = "sunhi" + """The Sunhi voice.""" + SYLVIE = "sylvie" + """The Sylvie voice.""" + THIERRY = "thierry" + """The Thierry voice.""" + WILLIAM = "william" + """The William voice.""" + XIAOXIAO = "xiaoxiao" + """The Xiaoxiao voice.""" + XIMENA = "ximena" + """The Ximena voice.""" + YUNXI = "yunxi" + """The Yunxi voice.""" + + +class AzureVoiceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Azure synthesized voice kind. Additional values may be added over time.""" + + AZURE_STANDARD = "azure-standard" + """An Azure standard neural voice.""" + AZURE_CUSTOM = "azure-custom" + """An Azure custom neural voice.""" + AZURE_PERSONAL = "azure-personal" + """An Azure personal voice.""" + AVATAR_VOICE_SYNC = "avatar-voice-sync" + """An Azure avatar voice-synchronization voice.""" + + +class CallableToolAllowedCaller(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of CallableToolAllowedCaller.""" + + DIRECT = "direct" + """DIRECT.""" + PROGRAMMATIC = "programmatic" + """PROGRAMMATIC.""" + + +class CreateTranscriptionResponseJsonUsageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of CreateTranscriptionResponseJsonUsageType.""" + + TOKENS = "tokens" + """TOKENS.""" + DURATION = "duration" + """DURATION.""" + + +class PageOrder(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of PageOrder.""" + + ASC = "asc" + """ASC.""" + DESC = "desc" + """DESC.""" + + +class PersonalVoiceModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """A known neural model for an Azure personal or avatar voice. Additional values may be added over + time. + """ + + DRAGON_LATEST_NEURAL = "DragonLatestNeural" + """The latest Dragon model.""" + DRAGON_HD_OMNI_LATEST_NEURAL = "DragonHDOmniLatestNeural" + """The latest Dragon HD Omni model.""" + MAI_VOICE = "MAI-Voice" + """The MAI-Voice model.""" + + +class RealtimeAudioFormatsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of RealtimeAudioFormatsType.""" + + AUDIO_PCM = "audio/pcm" + """AUDIO_PCM.""" + AUDIO_PCMU = "audio/pcmu" + """AUDIO_PCMU.""" + AUDIO_PCMA = "audio/pcma" + """AUDIO_PCMA.""" + + +class RealtimeClientEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of RealtimeClientEventType.""" + + CONVERSATION_ITEM_CREATE = "conversation.item.create" + """CONVERSATION_ITEM_CREATE.""" + CONVERSATION_ITEM_DELETE = "conversation.item.delete" + """CONVERSATION_ITEM_DELETE.""" + CONVERSATION_ITEM_RETRIEVE = "conversation.item.retrieve" + """CONVERSATION_ITEM_RETRIEVE.""" + CONVERSATION_ITEM_TRUNCATE = "conversation.item.truncate" + """CONVERSATION_ITEM_TRUNCATE.""" + INPUT_AUDIO_BUFFER_APPEND = "input_audio_buffer.append" + """INPUT_AUDIO_BUFFER_APPEND.""" + INPUT_AUDIO_BUFFER_CLEAR = "input_audio_buffer.clear" + """INPUT_AUDIO_BUFFER_CLEAR.""" + OUTPUT_AUDIO_BUFFER_CLEAR = "output_audio_buffer.clear" + """OUTPUT_AUDIO_BUFFER_CLEAR.""" + INPUT_AUDIO_BUFFER_COMMIT = "input_audio_buffer.commit" + """INPUT_AUDIO_BUFFER_COMMIT.""" + RESPONSE_CANCEL = "response.cancel" + """RESPONSE_CANCEL.""" + RESPONSE_CREATE = "response.create" + """RESPONSE_CREATE.""" + SESSION_UPDATE = "session.update" + """SESSION_UPDATE.""" + + +class RealtimeConversationItemMessageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of RealtimeConversationItemMessageType.""" + + SYSTEM = "system" + """SYSTEM.""" + USER = "user" + """USER.""" + ASSISTANT = "assistant" + """ASSISTANT.""" + + +class RealtimeConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of RealtimeConversationItemType.""" + + FUNCTION_CALL = "function_call" + """FUNCTION_CALL.""" + FUNCTION_CALL_OUTPUT = "function_call_output" + """FUNCTION_CALL_OUTPUT.""" + MCP_APPROVAL_RESPONSE = "mcp_approval_response" + """MCP_APPROVAL_RESPONSE.""" + MCP_LIST_TOOLS = "mcp_list_tools" + """MCP_LIST_TOOLS.""" + MCP_CALL = "mcp_call" + """MCP_CALL.""" + MCP_APPROVAL_REQUEST = "mcp_approval_request" + """MCP_APPROVAL_REQUEST.""" + + +class RealtimeMcpErrorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of RealtimeMcpErrorType.""" + + PROTOCOL_ERROR = "protocol_error" + """PROTOCOL_ERROR.""" + TOOL_EXECUTION_ERROR = "tool_execution_error" + """TOOL_EXECUTION_ERROR.""" + HTTP_ERROR = "http_error" + """HTTP_ERROR.""" + + +class RealtimeReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Constrains effort on reasoning for reasoning-capable Realtime models such as + ``gpt-realtime-2``. + """ + + MINIMAL = "minimal" + """MINIMAL.""" + LOW = "low" + """LOW.""" + MEDIUM = "medium" + """MEDIUM.""" + HIGH = "high" + """HIGH.""" + XHIGH = "xhigh" + """XHIGH.""" + + +class RealtimeServerEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of RealtimeServerEventType.""" + + CONVERSATION_CREATED = "conversation.created" + """CONVERSATION_CREATED.""" + CONVERSATION_ITEM_CREATED = "conversation.item.created" + """CONVERSATION_ITEM_CREATED.""" + CONVERSATION_ITEM_DELETED = "conversation.item.deleted" + """CONVERSATION_ITEM_DELETED.""" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED = "conversation.item.input_audio_transcription.completed" + """CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED.""" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA = "conversation.item.input_audio_transcription.delta" + """CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA.""" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED = "conversation.item.input_audio_transcription.failed" + """CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED.""" + CONVERSATION_ITEM_RETRIEVED = "conversation.item.retrieved" + """CONVERSATION_ITEM_RETRIEVED.""" + CONVERSATION_ITEM_TRUNCATED = "conversation.item.truncated" + """CONVERSATION_ITEM_TRUNCATED.""" + ERROR = "error" + """ERROR.""" + INPUT_AUDIO_BUFFER_CLEARED = "input_audio_buffer.cleared" + """INPUT_AUDIO_BUFFER_CLEARED.""" + INPUT_AUDIO_BUFFER_COMMITTED = "input_audio_buffer.committed" + """INPUT_AUDIO_BUFFER_COMMITTED.""" + INPUT_AUDIO_BUFFER_DTMF_EVENT_RECEIVED = "input_audio_buffer.dtmf_event_received" + """INPUT_AUDIO_BUFFER_DTMF_EVENT_RECEIVED.""" + INPUT_AUDIO_BUFFER_SPEECH_STARTED = "input_audio_buffer.speech_started" + """INPUT_AUDIO_BUFFER_SPEECH_STARTED.""" + INPUT_AUDIO_BUFFER_SPEECH_STOPPED = "input_audio_buffer.speech_stopped" + """INPUT_AUDIO_BUFFER_SPEECH_STOPPED.""" + RATE_LIMITS_UPDATED = "rate_limits.updated" + """RATE_LIMITS_UPDATED.""" + RESPONSE_OUTPUT_AUDIO_DELTA = "response.output_audio.delta" + """RESPONSE_OUTPUT_AUDIO_DELTA.""" + RESPONSE_OUTPUT_AUDIO_DONE = "response.output_audio.done" + """RESPONSE_OUTPUT_AUDIO_DONE.""" + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA = "response.output_audio_transcript.delta" + """RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA.""" + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE = "response.output_audio_transcript.done" + """RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE.""" + RESPONSE_CONTENT_PART_ADDED = "response.content_part.added" + """RESPONSE_CONTENT_PART_ADDED.""" + RESPONSE_CONTENT_PART_DONE = "response.content_part.done" + """RESPONSE_CONTENT_PART_DONE.""" + RESPONSE_CREATED = "response.created" + """RESPONSE_CREATED.""" + RESPONSE_DONE = "response.done" + """RESPONSE_DONE.""" + RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA = "response.function_call_arguments.delta" + """RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA.""" + RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE = "response.function_call_arguments.done" + """RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE.""" + RESPONSE_OUTPUT_ITEM_ADDED = "response.output_item.added" + """RESPONSE_OUTPUT_ITEM_ADDED.""" + RESPONSE_OUTPUT_ITEM_DONE = "response.output_item.done" + """RESPONSE_OUTPUT_ITEM_DONE.""" + RESPONSE_OUTPUT_TEXT_DELTA = "response.output_text.delta" + """RESPONSE_OUTPUT_TEXT_DELTA.""" + RESPONSE_OUTPUT_TEXT_DONE = "response.output_text.done" + """RESPONSE_OUTPUT_TEXT_DONE.""" + SESSION_CREATED = "session.created" + """SESSION_CREATED.""" + SESSION_UPDATED = "session.updated" + """SESSION_UPDATED.""" + OUTPUT_AUDIO_BUFFER_STARTED = "output_audio_buffer.started" + """OUTPUT_AUDIO_BUFFER_STARTED.""" + OUTPUT_AUDIO_BUFFER_STOPPED = "output_audio_buffer.stopped" + """OUTPUT_AUDIO_BUFFER_STOPPED.""" + OUTPUT_AUDIO_BUFFER_CLEARED = "output_audio_buffer.cleared" + """OUTPUT_AUDIO_BUFFER_CLEARED.""" + CONVERSATION_ITEM_ADDED = "conversation.item.added" + """CONVERSATION_ITEM_ADDED.""" + CONVERSATION_ITEM_DONE = "conversation.item.done" + """CONVERSATION_ITEM_DONE.""" + INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED = "input_audio_buffer.timeout_triggered" + """INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED.""" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT = "conversation.item.input_audio_transcription.segment" + """CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT.""" + MCP_LIST_TOOLS_IN_PROGRESS = "mcp_list_tools.in_progress" + """MCP_LIST_TOOLS_IN_PROGRESS.""" + MCP_LIST_TOOLS_COMPLETED = "mcp_list_tools.completed" + """MCP_LIST_TOOLS_COMPLETED.""" + MCP_LIST_TOOLS_FAILED = "mcp_list_tools.failed" + """MCP_LIST_TOOLS_FAILED.""" + RESPONSE_MCP_CALL_ARGUMENTS_DELTA = "response.mcp_call_arguments.delta" + """RESPONSE_MCP_CALL_ARGUMENTS_DELTA.""" + RESPONSE_MCP_CALL_ARGUMENTS_DONE = "response.mcp_call_arguments.done" + """RESPONSE_MCP_CALL_ARGUMENTS_DONE.""" + RESPONSE_MCP_CALL_IN_PROGRESS = "response.mcp_call.in_progress" + """RESPONSE_MCP_CALL_IN_PROGRESS.""" + RESPONSE_MCP_CALL_COMPLETED = "response.mcp_call.completed" + """RESPONSE_MCP_CALL_COMPLETED.""" + RESPONSE_MCP_CALL_FAILED = "response.mcp_call.failed" + """RESPONSE_MCP_CALL_FAILED.""" + + +class ToolChoiceOptions(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Tool choice mode.""" + + NONE = "none" + """NONE.""" + AUTO = "auto" + """AUTO.""" + REQUIRED = "required" + """REQUIRED.""" + + +class ToolChoiceParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of ToolChoiceParamType.""" + + ALLOWED_TOOLS = "allowed_tools" + """ALLOWED_TOOLS.""" + FUNCTION = "function" + """FUNCTION.""" + MCP = "mcp" + """MCP.""" + CUSTOM = "custom" + """CUSTOM.""" + PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" + """PROGRAMMATIC_TOOL_CALLING.""" + APPLY_PATCH = "apply_patch" + """APPLY_PATCH.""" + SHELL = "shell" + """SHELL.""" + FILE_SEARCH = "file_search" + """FILE_SEARCH.""" + WEB_SEARCH_PREVIEW = "web_search_preview" + """WEB_SEARCH_PREVIEW.""" + COMPUTER_USE_PREVIEW = "computer_use_preview" + """COMPUTER_USE_PREVIEW.""" + WEB_SEARCH_PREVIEW2025_03_11 = "web_search_preview_2025_03_11" + """WEB_SEARCH_PREVIEW2025_03_11.""" + IMAGE_GENERATION = "image_generation" + """IMAGE_GENERATION.""" + CODE_INTERPRETER = "code_interpreter" + """CODE_INTERPRETER.""" + COMPUTER = "computer" + """COMPUTER.""" + COMPUTER_USE = "computer_use" + """COMPUTER_USE.""" + + +class ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of ToolType.""" + + FUNCTION = "function" + """FUNCTION.""" + FILE_SEARCH = "file_search" + """FILE_SEARCH.""" + COMPUTER = "computer" + """COMPUTER.""" + COMPUTER_USE_PREVIEW = "computer_use_preview" + """COMPUTER_USE_PREVIEW.""" + WEB_SEARCH = "web_search" + """WEB_SEARCH.""" + MCP = "mcp" + """MCP.""" + CODE_INTERPRETER = "code_interpreter" + """CODE_INTERPRETER.""" + PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" + """PROGRAMMATIC_TOOL_CALLING.""" + IMAGE_GENERATION = "image_generation" + """IMAGE_GENERATION.""" + LOCAL_SHELL = "local_shell" + """LOCAL_SHELL.""" + SHELL = "shell" + """SHELL.""" + CUSTOM = "custom" + """CUSTOM.""" + NAMESPACE = "namespace" + """NAMESPACE.""" + TOOL_SEARCH = "tool_search" + """TOOL_SEARCH.""" + WEB_SEARCH_PREVIEW = "web_search_preview" + """WEB_SEARCH_PREVIEW.""" + APPLY_PATCH = "apply_patch" + """APPLY_PATCH.""" + A2_A_PREVIEW = "a2a_preview" + """A2_A_PREVIEW.""" + BING_CUSTOM_SEARCH_PREVIEW = "bing_custom_search_preview" + """BING_CUSTOM_SEARCH_PREVIEW.""" + BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" + """BROWSER_AUTOMATION_PREVIEW.""" + FABRIC_DATAAGENT_PREVIEW = "fabric_dataagent_preview" + """FABRIC_DATAAGENT_PREVIEW.""" + SHAREPOINT_GROUNDING_PREVIEW = "sharepoint_grounding_preview" + """SHAREPOINT_GROUNDING_PREVIEW.""" + MEMORY_SEARCH_PREVIEW = "memory_search_preview" + """MEMORY_SEARCH_PREVIEW.""" + WORK_IQ_PREVIEW = "work_iq_preview" + """WORK_IQ_PREVIEW.""" + FABRIC_IQ_PREVIEW = "fabric_iq_preview" + """FABRIC_IQ_PREVIEW.""" + TOOLBOX_SEARCH_PREVIEW = "toolbox_search_preview" + """TOOLBOX_SEARCH_PREVIEW.""" + AZURE_AI_SEARCH = "azure_ai_search" + """AZURE_AI_SEARCH.""" + AZURE_FUNCTION = "azure_function" + """AZURE_FUNCTION.""" + BING_GROUNDING = "bing_grounding" + """BING_GROUNDING.""" + CAPTURE_STRUCTURED_OUTPUTS = "capture_structured_outputs" + """CAPTURE_STRUCTURED_OUTPUTS.""" + OPENAPI = "openapi" + """OPENAPI.""" + + +class VersionSelectorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of VersionSelectorType.""" + + FIXED_RATIO = "FixedRatio" + """FIXED_RATIO.""" + + +class VoiceAgentAnimationOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """An animation output produced by a voice-agent session.""" + + BLENDSHAPES = "blendshapes" + """BLENDSHAPES.""" + VISEME_ID = "viseme_id" + """VISEME_ID.""" + + +class VoiceAgentAvatarOutputProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The transport used to deliver avatar media.""" + + WEBSOCKET = "websocket" + """WEBSOCKET.""" + WEBSOCKET_BINARY = "websocket-binary" + """WEBSOCKET_BINARY.""" + WEBRTC = "webrtc" + """WEBRTC.""" + + +class VoiceAgentAvatarType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The avatar implementation.""" + + VIDEO_AVATAR = "video_avatar" + """VIDEO_AVATAR.""" + PHOTO_AVATAR = "photo_avatar" + """PHOTO_AVATAR.""" + + +class VoiceAgentAzureSemanticVadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The discriminator for an Azure semantic VAD configuration.""" + + DEFAULT = "azure_semantic_vad" + """DEFAULT.""" + ENGLISH = "azure_semantic_vad_en" + """ENGLISH.""" + + +class VoiceAgentEchoCancellationReferenceSource( # pylint: disable=name-too-long + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The source of reference audio used for echo cancellation.""" + + SERVER = "server" + """SERVER.""" + CLIENT = "client" + """CLIENT.""" + + +class VoiceAgentEndOfUtteranceModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """An end-of-utterance detector model.""" + + SEMANTIC_DETECTION_V1 = "semantic_detection_v1" + """SEMANTIC_DETECTION_V1.""" + SEMANTIC_DETECTION_V1_EN = "semantic_detection_v1_en" + """SEMANTIC_DETECTION_V1_EN.""" + SEMANTIC_DETECTION_V1_MULTILINGUAL = "semantic_detection_v1_multilingual" + """SEMANTIC_DETECTION_V1_MULTILINGUAL.""" + SMART_END_OF_TURN_DETECTION = "smart_end_of_turn_detection" + """SMART_END_OF_TURN_DETECTION.""" + + +class VoiceAgentEndOfUtteranceThresholdLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """A threshold preset for end-of-utterance detection.""" + + LOW = "low" + """LOW.""" + MEDIUM = "medium" + """MEDIUM.""" + HIGH = "high" + """HIGH.""" + DEFAULT = "default" + """DEFAULT.""" + + +class VoiceAgentEstimatedCostStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Completeness of a best-effort cost estimate.""" + + COMPLETE = "complete" + """COMPLETE.""" + PARTIAL = "partial" + """PARTIAL.""" + UNAVAILABLE = "unavailable" + """UNAVAILABLE.""" + + +class VoiceAgentFileSearchCallStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The status of a file-search call.""" + + IN_PROGRESS = "in_progress" + """IN_PROGRESS.""" + SEARCHING = "searching" + """SEARCHING.""" + COMPLETED = "completed" + """COMPLETED.""" + INCOMPLETE = "incomplete" + """INCOMPLETE.""" + FAILED = "failed" + """FAILED.""" + + +class VoiceAgentHandoffAbortReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Why a handoff ended before the target behavior committed.""" + + USER_INTERRUPTION = "user_interruption" + """USER_INTERRUPTION.""" + ERROR = "error" + """ERROR.""" + + +class VoiceAgentHandoffReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Reasoning effort accepted by a handoff target.""" + + NONE = "none" + """NONE.""" + MINIMAL = "minimal" + """MINIMAL.""" + LOW = "low" + """LOW.""" + MEDIUM = "medium" + """MEDIUM.""" + HIGH = "high" + """HIGH.""" + XHIGH = "xhigh" + """XHIGH.""" + + +class VoiceAgentHandoffTargetResponse(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Whether a handoff target creates a response after transfer.""" + + AUTO = "auto" + """AUTO.""" + NONE = "none" + """NONE.""" + + +class VoiceAgentInterimResponseTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """A condition that may trigger an interim response.""" + + LATENCY = "latency" + """LATENCY.""" + TOOL = "tool" + """TOOL.""" + + +class VoiceAgentMcpApprovalMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """An MCP approval mode.""" + + NEVER_REQUIRE = "never" + """NEVER_REQUIRE.""" + ALWAYS = "always" + """ALWAYS.""" + + +class VoiceAgentMcpResponseScheduling(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """When an MCP invocation creates a follow-up response. Additional values may be added over time.""" + + SILENT = "silent" + """Do not create a follow-up response after the MCP invocation completes.""" + WHEN_IDLE = "when_idle" + """Create a follow-up response when the conversation is idle.""" + INTERRUPT = "interrupt" + """Interrupt the active response and create a follow-up response.""" + SKIP_IF_BUSY = "skip_if_busy" + """Create a follow-up response only when no response is active.""" + + +class VoiceAgentPipelineFamily(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The runtime pipeline family used by an effective handoff graph.""" + + CASCADED = "cascaded" + """CASCADED.""" + REALTIME = "realtime" + """REALTIME.""" + + +class VoiceAgentResponseAudioFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """An audio format reported on a voice-agent response resource.""" + + PCM16 = "pcm16" + """PCM16.""" + PCM16_8000_HZ = "pcm16_8000hz" + """PCM16_8000_HZ.""" + PCM16_16000_HZ = "pcm16_16000hz" + """PCM16_16000_HZ.""" + PCM16_22050_HZ = "pcm16_22050hz" + """PCM16_22050_HZ.""" + PCM16_24000_HZ = "pcm16_24000hz" + """PCM16_24000_HZ.""" + PCM16_44100_HZ = "pcm16_44100hz" + """PCM16_44100_HZ.""" + PCM16_48000_HZ = "pcm16_48000hz" + """PCM16_48000_HZ.""" + G711_ULAW = "g711_ulaw" + """G711_ULAW.""" + G711_ALAW = "g711_alaw" + """G711_ALAW.""" + MP3 = "mp3" + """MP3.""" + MP3_24_KHZ48_KBPS = "mp3_24khz_48kbps" + """MP3_24_KHZ48_KBPS.""" + MP3_24_KHZ96_KBPS = "mp3_24khz_96kbps" + """MP3_24_KHZ96_KBPS.""" + MP3_24_KHZ160_KBPS = "mp3_24khz_160kbps" + """MP3_24_KHZ160_KBPS.""" + + +class VoiceAgentResponseStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The lifecycle status of a voice-agent response.""" + + IN_PROGRESS = "in_progress" + """IN_PROGRESS.""" + COMPLETED = "completed" + """COMPLETED.""" + CANCELLED = "cancelled" + """CANCELLED.""" + INCOMPLETE = "incomplete" + """INCOMPLETE.""" + FAILED = "failed" + """FAILED.""" + + +class VoiceAgentSessionIncludeOption(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Additional server-output fields that a voice-agent session may request.""" + + INPUT_AUDIO_TRANSCRIPTION_LOGPROBS = "item.input_audio_transcription.logprobs" + """INPUT_AUDIO_TRANSCRIPTION_LOGPROBS.""" + INPUT_AUDIO_TRANSCRIPTION_PHRASES = "item.input_audio_transcription.phrases" + """INPUT_AUDIO_TRANSCRIPTION_PHRASES.""" + FILE_SEARCH_CALL_RESULTS = "file_search_call.results" + """FILE_SEARCH_CALL_RESULTS.""" + + +class VoiceAgentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The persona/tone a guided-authoring request steers the generated voice agent toward.""" + + PERSONAL = "personal" + """A personal-assistant persona.""" + BUSINESS = "business" + """A business / professional persona.""" + + +class VoiceAgentUseCase(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The scenario-template catalog entry a guided-authoring request specializes the generated voice + agent for. Extensible: additional use cases may be added over time. + """ + + CUSTOMER_SUPPORT = "customer_support" + """CUSTOMER_SUPPORT.""" + RECEPTION = "reception" + """RECEPTION.""" + SALES = "sales" + """SALES.""" + TRAVEL_ASSISTANT = "travel_assistant" + """TRAVEL_ASSISTANT.""" + OUTREACH = "outreach" + """OUTREACH.""" + PERSONAL_ASSISTANT = "personal_assistant" + """PERSONAL_ASSISTANT.""" + LEARNING = "learning" + """LEARNING.""" + CALL_CENTER = "call_center" + """CALL_CENTER.""" + IN_CAR = "in_car" + """IN_CAR.""" + + +class VoiceAgentWebSearchCallStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The status of a web-search call.""" + + IN_PROGRESS = "in_progress" + """IN_PROGRESS.""" + SEARCHING = "searching" + """SEARCHING.""" + COMPLETED = "completed" + """COMPLETED.""" + FAILED = "failed" + """FAILED.""" + + +class VoiceAgentWebSocketSubprotocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The WebSocket subprotocol supported by a voice-agent connection.""" + + REALTIME = "realtime" + """REALTIME.""" + + +class VoiceAudioCodec(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """An audio codec. Additional values may be added over time.""" + + PCM16 = "pcm16" + """16-bit pulse-code modulation.""" + PCMU = "pcmu" + """G.711 mu-law.""" + PCMA = "pcma" + """G.711 A-law.""" + + +class VoiceAudioContainerFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """An audio container format. Additional values may be added over time.""" + + WAV = "wav" + """Waveform Audio File Format.""" + + +class VoiceAudioFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The audio format type. Values follow the OpenAI Realtime wire schema and are exempt from the + snake_case enum-value rule. + """ + + PCM = "audio/pcm" + """16-bit PCM.""" + PCMU = "audio/pcmu" + """G.711 mu-law (telephony).""" + PCMA = "audio/pcma" + """G.711 A-law (telephony).""" + + +class VoiceAudioRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """A voice-audio participant role. Additional values may be added over time.""" + + USER = "user" + """Audio produced by the user.""" + AGENT = "agent" + """Audio produced by the agent.""" + + +class VoiceAudioTimestampType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """An output-audio timestamp kind supported by a voice agent.""" + + WORD = "word" + """Word-level timestamps.""" + + +class VoiceAvatarOutputProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The transport used to deliver the avatar video stream.""" + + WEBRTC = "webrtc" + """WEBRTC.""" + WEBSOCKET = "websocket" + """WEBSOCKET.""" + + +class VoiceAvatarType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The avatar type.""" + + VIDEO_AVATAR = "video_avatar" + """VIDEO_AVATAR.""" + PHOTO_AVATAR = "photo_avatar" + """PHOTO_AVATAR.""" + + +class VoiceConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of a persisted voice conversation item.""" + + MESSAGE = "message" + """A message item.""" + FUNCTION_CALL = "function_call" + """A function-call request item.""" + FUNCTION_CALL_OUTPUT = "function_call_output" + """A function-call output item.""" + MCP_LIST_TOOLS = "mcp_list_tools" + """An MCP list-tools item.""" + MCP_CALL = "mcp_call" + """An MCP call item.""" + MCP_APPROVAL_REQUEST = "mcp_approval_request" + """An MCP approval request item.""" + MCP_APPROVAL_RESPONSE = "mcp_approval_response" + """An MCP approval response item.""" + + +class VoiceConversationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The lifecycle status of a persisted voice conversation.""" + + IN_PROGRESS = "in_progress" + """The conversation's live session is still in progress.""" + COMPLETED = "completed" + """The conversation's live session has ended.""" + + +class VoiceEndOfUtteranceDetectionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The semantic end-of-utterance detection model.""" + + SEMANTIC_DETECTION_V1 = "semantic_detection_v1" + """The default semantic detection model.""" + SEMANTIC_DETECTION_V1_EN = "semantic_detection_v1_en" + """The English-optimized semantic detection model.""" + SEMANTIC_DETECTION_V1_MULTILINGUAL = "semantic_detection_v1_multilingual" + """The multilingual semantic detection model.""" + + +class VoiceEndOfUtteranceThresholdLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The sensitivity threshold for semantic end-of-utterance detection.""" + + LOW = "low" + """The low sensitivity threshold.""" + MEDIUM = "medium" + """The medium sensitivity threshold.""" + HIGH = "high" + """The high sensitivity threshold.""" + DEFAULT = "default" + """The service-selected sensitivity threshold.""" + + +class VoiceGreetingToolChoice(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The tool-selection policy for an LLM-generated greeting.""" + + NONE = "none" + """Do not use tools for the opening response.""" + AUTO = "auto" + """Allow the model to select configured tools for the opening response.""" + REQUIRED = "required" + """Require the opening response to use a configured tool.""" + + +class VoiceIdsShared(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of VoiceIdsShared.""" + + ALLOY = "alloy" + """ALLOY.""" + ASH = "ash" + """ASH.""" + BALLAD = "ballad" + """BALLAD.""" + CORAL = "coral" + """CORAL.""" + ECHO = "echo" + """ECHO.""" + SAGE = "sage" + """SAGE.""" + SHIMMER = "shimmer" + """SHIMMER.""" + VERSE = "verse" + """VERSE.""" + MARIN = "marin" + """MARIN.""" + CEDAR = "cedar" + """CEDAR.""" + + +class VoiceInputTranscriptionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The input-audio transcription model. 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 added over time. + """ + + WHISPER1 = "whisper-1" + """OpenAI Whisper.""" + GPT_REALTIME_WHISPER = "gpt-realtime-whisper" + """OpenAI GPT Realtime Whisper.""" + GPT4_O_TRANSCRIBE = "gpt-4o-transcribe" + """OpenAI GPT-4o transcribe.""" + GPT4_O_MINI_TRANSCRIBE = "gpt-4o-mini-transcribe" + """OpenAI GPT-4o mini transcribe.""" + GPT4_O_TRANSCRIBE_DIARIZE = "gpt-4o-transcribe-diarize" + """OpenAI GPT-4o transcribe with speaker diarization.""" + GPT_TRANSCRIBE = "gpt-transcribe" + """OpenAI GPT Transcribe.""" + GPT_LIVE_TRANSCRIBE = "gpt-live-transcribe" + """OpenAI GPT Live Transcribe.""" + MAI_TRANSCRIBE = "mai-transcribe" + """MAI transcription.""" + AZURE_SPEECH = "azure-speech" + """Azure AI Speech to text.""" + + +class VoiceModelType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """How the model backing a voice agent is served. This is independent of the architecture + (realtime or cascaded), which the service derives from the selected model. + """ + + MANAGED = "managed" + """The service hosts and manages the named model, for example ``gpt-realtime``.""" + SELF_DEPLOYED = "self_deployed" + """The service uses the customer's own Foundry deployment named by ``model``.""" + + +class VoiceNoiseReductionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The input audio noise reduction mode.""" + + NEAR_FIELD = "near_field" + """NEAR_FIELD.""" + FAR_FIELD = "far_field" + """FAR_FIELD.""" + AZURE_DEEP_NOISE_SUPPRESSION = "azure_deep_noise_suppression" + """Azure deep noise suppression.""" + + +class VoiceOutputModality(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """An output modality the agent may produce. ``animation`` and ``avatar`` are used when an avatar + is configured. + """ + + TEXT = "text" + """TEXT.""" + AUDIO = "audio" + """AUDIO.""" + ANIMATION = "animation" + """ANIMATION.""" + AVATAR = "avatar" + """AVATAR.""" + + +class VoiceResponseStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The status of a voice response.""" + + IN_PROGRESS = "in_progress" + """IN_PROGRESS.""" + COMPLETED = "completed" + """COMPLETED.""" + CANCELLED = "cancelled" + """CANCELLED.""" + INCOMPLETE = "incomplete" + """INCOMPLETE.""" + FAILED = "failed" + """FAILED.""" + + +class VoiceSystemToolName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """A service-managed voice-session control action. Known values are stable; additional values may + be added over time. + """ + + END_CONVERSATION = "end_conversation" + """Ends the active conversation.""" + + +class VoiceTurnDetectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The turn-detection strategy. Additional values may be added over time.""" + + SERVER_VAD = "server_vad" + """Server-side voice activity detection.""" + SEMANTIC_VAD = "semantic_vad" + """Semantic voice activity detection.""" + AZURE_SEMANTIC_VAD = "azure_semantic_vad" + """Azure semantic voice activity detection.""" + AZURE_SEMANTIC_VAD_EN = "azure_semantic_vad_en" + """English-optimized Azure semantic voice activity detection.""" + AZURE_SEMANTIC_VAD_MULTILINGUAL = "azure_semantic_vad_multilingual" + """Multilingual Azure semantic voice activity detection.""" diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/_models.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/_models.py new file mode 100644 index 000000000000..5a8c269e3943 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/_models.py @@ -0,0 +1,13395 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=useless-super-delegation + +import datetime +from typing import Any, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload + +from .._utils.model_base import Model as _Model, rest_discriminator, rest_field +from ._enums import ( + AgentBlueprintReferenceType, + AgentEndpointAuthorizationSchemeType, + AgentObjectType, + AzureVoiceType, + CreateTranscriptionResponseJsonUsageType, + RealtimeAudioFormatsType, + RealtimeClientEventType, + RealtimeConversationItemMessageType, + RealtimeConversationItemType, + RealtimeMcpErrorType, + RealtimeServerEventType, + ToolChoiceParamType, + ToolType, + VersionSelectorType, + VoiceConversationItemType, + VoiceEndOfUtteranceDetectionModel, + VoiceTurnDetectionType, +) + +if TYPE_CHECKING: + from .. import _unions, models as _models + + +class A2AProtocolConfiguration(_Model): + """Configuration specific to the A2A protocol.""" + + +class ActivityProtocolConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Configuration specific to the activity protocol. + + :ivar enable_m365_public_endpoint: Whether to enable the M365 public endpoint for the activity + protocol. + :vartype enable_m365_public_endpoint: bool + """ + + enable_m365_public_endpoint: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable the M365 public endpoint for the activity protocol.""" + + @overload + def __init__( + self, + *, + enable_m365_public_endpoint: 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 AgentBlueprintReference(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """AgentBlueprintReference. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ManagedAgentIdentityBlueprintReference + + :ivar type: Required. "ManagedAgentIdentityBlueprint" + :vartype type: str or ~azure.ai.voiceagents.models.AgentBlueprintReferenceType + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. \"ManagedAgentIdentityBlueprint\"""" + + @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 AgentCard(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """AgentCard. + + :ivar version: The version of the agent card. Required. + :vartype version: str + :ivar description: The description of the agent card. + :vartype description: str + :ivar skills: The set of skills that an agent can perform. Required. + :vartype skills: list[~azure.ai.voiceagents.models.AgentCardSkill] + """ + + version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version of the agent card. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The description of the agent card.""" + skills: list["_models.AgentCardSkill"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The set of skills that an agent can perform. Required.""" + + @overload + def __init__( + self, + *, + version: str, + skills: list["_models.AgentCardSkill"], + 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 AgentCardSkill(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """AgentCardSkill. + + :ivar id: a unique identifier for the skill. Required. + :vartype id: str + :ivar name: The name of the skill. Required. + :vartype name: str + :ivar description: A description of the skill. + :vartype description: str + :ivar tags: set of tagwords describing classes of capabilities for the skill. + :vartype tags: list[str] + :ivar examples: A list of example scenarios that the skill can perform. + :vartype examples: list[str] + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """a unique identifier for the skill. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the skill. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A description of the skill.""" + tags: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """set of tagwords describing classes of capabilities for the skill.""" + examples: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A list of example scenarios that the skill can perform.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + name: str, + description: Optional[str] = None, + tags: Optional[list[str]] = None, + examples: 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 AgentEndpointAuthorizationScheme(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """AgentEndpointAuthorizationScheme. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + BotServiceAuthorizationScheme, BotServiceRbacAuthorizationScheme, + BotServiceTenantAuthorizationScheme, EntraAuthorizationScheme + + :ivar type: Required. Known values are: "Entra", "BotService", "BotServiceRbac", and + "BotServiceTenant". + :vartype type: str or ~azure.ai.voiceagents.models.AgentEndpointAuthorizationSchemeType + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"Entra\", \"BotService\", \"BotServiceRbac\", and + \"BotServiceTenant\".""" + + @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 AgentEndpointConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """AgentEndpointConfig. + + :ivar version_selector: The version selector of the agent endpoint determines how traffic is + routed to different versions of the agent. + :vartype version_selector: ~azure.ai.voiceagents.models.VersionSelector + :ivar protocol_configuration: Per-protocol configuration for the agent endpoint. + :vartype protocol_configuration: ~azure.ai.voiceagents.models.ProtocolConfiguration + :ivar authorization_schemes: The authorization schemes supported by the agent endpoint. + :vartype authorization_schemes: + list[~azure.ai.voiceagents.models.AgentEndpointAuthorizationScheme] + """ + + version_selector: Optional["_models.VersionSelector"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The version selector of the agent endpoint determines how traffic is routed to different + versions of the agent.""" + protocol_configuration: Optional["_models.ProtocolConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Per-protocol configuration for the agent endpoint.""" + authorization_schemes: Optional[list["_models.AgentEndpointAuthorizationScheme"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The authorization schemes supported by the agent endpoint.""" + + @overload + def __init__( + self, + *, + version_selector: Optional["_models.VersionSelector"] = None, + protocol_configuration: Optional["_models.ProtocolConfiguration"] = None, + authorization_schemes: Optional[list["_models.AgentEndpointAuthorizationScheme"]] = 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 AgentIdentity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """AgentIdentity. + + :ivar principal_id: The principal ID of the agent instance. Required. + :vartype principal_id: str + :ivar client_id: The client ID of the agent instance. Also referred to as the instance ID. + Required. + :vartype client_id: str + :ivar status: The status of the agent identity. Present for both the agent instance identity + and the agent blueprint. Known values are: "active" and "disabled". + :vartype status: str or ~azure.ai.voiceagents.models.AgentIdentityStatus + """ + + principal_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The principal ID of the agent instance. Required.""" + client_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The client ID of the agent instance. Also referred to as the instance ID. Required.""" + status: Optional[Union[str, "_models.AgentIdentityStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the agent identity. Present for both the agent instance identity and the agent + blueprint. Known values are: \"active\" and \"disabled\".""" + + @overload + def __init__( + self, + *, + principal_id: str, + client_id: str, + status: Optional[Union[str, "_models.AgentIdentityStatus"]] = 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 ApiErrorResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Error response for API failures. + + :ivar error: Required. + :vartype error: ~azure.ai.voiceagents.models.Error + """ + + error: "_models.Error" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + error: "_models.Error", + ) -> 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 AzureVoice(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Base configuration shared by Azure synthesized voices. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AzureAvatarVoiceSyncVoice, AzureCustomVoice, AzurePersonalVoice, AzureStandardVoice + + :ivar type: The Azure voice kind. Required. Known values are: "azure-standard", "azure-custom", + "azure-personal", and "avatar-voice-sync". + :vartype type: str or ~azure.ai.voiceagents.models.AzureVoiceType + :ivar temperature: The synthesis temperature, from 0 to 1. + :vartype temperature: float + :ivar custom_lexicon_url: The URL of a custom pronunciation lexicon. + :vartype custom_lexicon_url: str + :ivar custom_text_normalization_url: The URL of a custom text-normalization service. + :vartype custom_text_normalization_url: str + :ivar prefer_locales: Preferred BCP-47 locales that influence language accents. + :vartype prefer_locales: list[str] + :ivar locale: The enforced BCP-47 locale. When omitted, the language is detected from the text. + :vartype locale: str + :ivar style: The speaking style, such as ``cheerful`` or ``sad``. + :vartype style: str + :ivar pitch: The SSML-compatible pitch adjustment, such as ``+5%``. + :vartype pitch: str + :ivar rate: The SSML-compatible speaking-rate adjustment, such as ``+10%``. + :vartype rate: str + :ivar volume: The SSML-compatible volume adjustment, such as ``+10`` or ``-6dB``. + :vartype volume: str + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The Azure voice kind. Required. Known values are: \"azure-standard\", \"azure-custom\", + \"azure-personal\", and \"avatar-voice-sync\".""" + temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The synthesis temperature, from 0 to 1.""" + custom_lexicon_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The URL of a custom pronunciation lexicon.""" + custom_text_normalization_url: Optional[str] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The URL of a custom text-normalization service.""" + prefer_locales: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Preferred BCP-47 locales that influence language accents.""" + locale: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The enforced BCP-47 locale. When omitted, the language is detected from the text.""" + style: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The speaking style, such as ``cheerful`` or ``sad``.""" + pitch: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The SSML-compatible pitch adjustment, such as ``+5%``.""" + rate: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The SSML-compatible speaking-rate adjustment, such as ``+10%``.""" + volume: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The SSML-compatible volume adjustment, such as ``+10`` or ``-6dB``.""" + + @overload + def __init__( + self, + *, + type: str, + temperature: Optional[float] = None, + custom_lexicon_url: Optional[str] = None, + custom_text_normalization_url: Optional[str] = None, + prefer_locales: Optional[list[str]] = None, + locale: Optional[str] = None, + style: Optional[str] = None, + pitch: Optional[str] = None, + rate: Optional[str] = None, + volume: 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 AzureAvatarVoiceSyncVoice( + AzureVoice, discriminator="avatar-voice-sync" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An Azure avatar voice-synchronization configuration. The runtime derives its voice name from + the avatar character and style. + + :ivar temperature: The synthesis temperature, from 0 to 1. + :vartype temperature: float + :ivar custom_lexicon_url: The URL of a custom pronunciation lexicon. + :vartype custom_lexicon_url: str + :ivar custom_text_normalization_url: The URL of a custom text-normalization service. + :vartype custom_text_normalization_url: str + :ivar prefer_locales: Preferred BCP-47 locales that influence language accents. + :vartype prefer_locales: list[str] + :ivar locale: The enforced BCP-47 locale. When omitted, the language is detected from the text. + :vartype locale: str + :ivar style: The speaking style, such as ``cheerful`` or ``sad``. + :vartype style: str + :ivar pitch: The SSML-compatible pitch adjustment, such as ``+5%``. + :vartype pitch: str + :ivar rate: The SSML-compatible speaking-rate adjustment, such as ``+10%``. + :vartype rate: str + :ivar volume: The SSML-compatible volume adjustment, such as ``+10`` or ``-6dB``. + :vartype volume: str + :ivar type: Required. An Azure avatar voice-synchronization voice. + :vartype type: str or ~azure.ai.voiceagents.models.AVATAR_VOICE_SYNC + :ivar model: The neural model used to synthesize the avatar voice. Required. Known values are: + "DragonLatestNeural", "DragonHDOmniLatestNeural", and "MAI-Voice". + :vartype model: str or ~azure.ai.voiceagents.models.PersonalVoiceModel + """ + + type: Literal[AzureVoiceType.AVATAR_VOICE_SYNC] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. An Azure avatar voice-synchronization voice.""" + model: Union[str, "_models.PersonalVoiceModel"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The neural model used to synthesize the avatar voice. Required. Known values are: + \"DragonLatestNeural\", \"DragonHDOmniLatestNeural\", and \"MAI-Voice\".""" + + @overload + def __init__( + self, + *, + model: Union[str, "_models.PersonalVoiceModel"], + temperature: Optional[float] = None, + custom_lexicon_url: Optional[str] = None, + custom_text_normalization_url: Optional[str] = None, + prefer_locales: Optional[list[str]] = None, + locale: Optional[str] = None, + style: Optional[str] = None, + pitch: Optional[str] = None, + rate: Optional[str] = None, + volume: 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 = AzureVoiceType.AVATAR_VOICE_SYNC # type: ignore + + +class AzureCustomVoice( + AzureVoice, discriminator="azure-custom" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An Azure custom neural voice configuration. + + :ivar temperature: The synthesis temperature, from 0 to 1. + :vartype temperature: float + :ivar custom_lexicon_url: The URL of a custom pronunciation lexicon. + :vartype custom_lexicon_url: str + :ivar custom_text_normalization_url: The URL of a custom text-normalization service. + :vartype custom_text_normalization_url: str + :ivar prefer_locales: Preferred BCP-47 locales that influence language accents. + :vartype prefer_locales: list[str] + :ivar locale: The enforced BCP-47 locale. When omitted, the language is detected from the text. + :vartype locale: str + :ivar style: The speaking style, such as ``cheerful`` or ``sad``. + :vartype style: str + :ivar pitch: The SSML-compatible pitch adjustment, such as ``+5%``. + :vartype pitch: str + :ivar rate: The SSML-compatible speaking-rate adjustment, such as ``+10%``. + :vartype rate: str + :ivar volume: The SSML-compatible volume adjustment, such as ``+10`` or ``-6dB``. + :vartype volume: str + :ivar type: Required. An Azure custom neural voice. + :vartype type: str or ~azure.ai.voiceagents.models.AZURE_CUSTOM + :ivar name: The custom voice name. Required. + :vartype name: str + :ivar endpoint_id: The Azure Speech custom voice deployment endpoint ID. Required. + :vartype endpoint_id: str + """ + + type: Literal[AzureVoiceType.AZURE_CUSTOM] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. An Azure custom neural voice.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The custom voice name. Required.""" + endpoint_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Azure Speech custom voice deployment endpoint ID. Required.""" + + @overload + def __init__( + self, + *, + name: str, + endpoint_id: str, + temperature: Optional[float] = None, + custom_lexicon_url: Optional[str] = None, + custom_text_normalization_url: Optional[str] = None, + prefer_locales: Optional[list[str]] = None, + locale: Optional[str] = None, + style: Optional[str] = None, + pitch: Optional[str] = None, + rate: Optional[str] = None, + volume: 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 = AzureVoiceType.AZURE_CUSTOM # type: ignore + + +class AzurePersonalVoice( + AzureVoice, discriminator="azure-personal" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An Azure personal voice configuration. + + :ivar temperature: The synthesis temperature, from 0 to 1. + :vartype temperature: float + :ivar custom_lexicon_url: The URL of a custom pronunciation lexicon. + :vartype custom_lexicon_url: str + :ivar custom_text_normalization_url: The URL of a custom text-normalization service. + :vartype custom_text_normalization_url: str + :ivar prefer_locales: Preferred BCP-47 locales that influence language accents. + :vartype prefer_locales: list[str] + :ivar locale: The enforced BCP-47 locale. When omitted, the language is detected from the text. + :vartype locale: str + :ivar style: The speaking style, such as ``cheerful`` or ``sad``. + :vartype style: str + :ivar pitch: The SSML-compatible pitch adjustment, such as ``+5%``. + :vartype pitch: str + :ivar rate: The SSML-compatible speaking-rate adjustment, such as ``+10%``. + :vartype rate: str + :ivar volume: The SSML-compatible volume adjustment, such as ``+10`` or ``-6dB``. + :vartype volume: str + :ivar type: Required. An Azure personal voice. + :vartype type: str or ~azure.ai.voiceagents.models.AZURE_PERSONAL + :ivar name: The personal voice name. Required. + :vartype name: str + :ivar model: The neural model used by the personal voice. Required. Known values are: + "DragonLatestNeural", "DragonHDOmniLatestNeural", and "MAI-Voice". + :vartype model: str or ~azure.ai.voiceagents.models.PersonalVoiceModel + """ + + type: Literal[AzureVoiceType.AZURE_PERSONAL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. An Azure personal voice.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The personal voice name. Required.""" + model: Union[str, "_models.PersonalVoiceModel"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The neural model used by the personal voice. Required. Known values are: + \"DragonLatestNeural\", \"DragonHDOmniLatestNeural\", and \"MAI-Voice\".""" + + @overload + def __init__( + self, + *, + name: str, + model: Union[str, "_models.PersonalVoiceModel"], + temperature: Optional[float] = None, + custom_lexicon_url: Optional[str] = None, + custom_text_normalization_url: Optional[str] = None, + prefer_locales: Optional[list[str]] = None, + locale: Optional[str] = None, + style: Optional[str] = None, + pitch: Optional[str] = None, + rate: Optional[str] = None, + volume: 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 = AzureVoiceType.AZURE_PERSONAL # type: ignore + + +class AzureRealtimeNativeVoice(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An Azure realtime-native voice configuration. + + :ivar type: The voice kind. Always ``azure-realtime-native``. Required. Default value is + "azure-realtime-native". + :vartype type: str + :ivar name: The Azure realtime-native voice name. Required. Known values are: "aarti", + "alvaro", "andrew", "antonio", "ava", "clara", "dalia", "denise", "diego", "diya", "elsa", + "emma", "florian", "francisca", "hyunsu", "jorge", "keita", "liam", "meera", "nanami", + "natasha", "niwat", "premwadee", "remy", "ryan", "seraphina", "sonia", "sunhi", "sylvie", + "thierry", "william", "xiaoxiao", "ximena", and "yunxi". + :vartype name: str or ~azure.ai.voiceagents.models.AzureRealtimeNativeVoiceName + """ + + type: Literal["azure-realtime-native"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The voice kind. Always ``azure-realtime-native``. Required. Default value is + \"azure-realtime-native\".""" + name: Union[str, "_models.AzureRealtimeNativeVoiceName"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The Azure realtime-native voice name. Required. Known values are: \"aarti\", \"alvaro\", + \"andrew\", \"antonio\", \"ava\", \"clara\", \"dalia\", \"denise\", \"diego\", \"diya\", + \"elsa\", \"emma\", \"florian\", \"francisca\", \"hyunsu\", \"jorge\", \"keita\", \"liam\", + \"meera\", \"nanami\", \"natasha\", \"niwat\", \"premwadee\", \"remy\", \"ryan\", + \"seraphina\", \"sonia\", \"sunhi\", \"sylvie\", \"thierry\", \"william\", \"xiaoxiao\", + \"ximena\", and \"yunxi\".""" + + @overload + def __init__( + self, + *, + name: Union[str, "_models.AzureRealtimeNativeVoiceName"], + ) -> 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["azure-realtime-native"] = "azure-realtime-native" + + +class AzureStandardVoice( + AzureVoice, discriminator="azure-standard" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An Azure standard neural voice configuration. + + :ivar temperature: The synthesis temperature, from 0 to 1. + :vartype temperature: float + :ivar custom_lexicon_url: The URL of a custom pronunciation lexicon. + :vartype custom_lexicon_url: str + :ivar custom_text_normalization_url: The URL of a custom text-normalization service. + :vartype custom_text_normalization_url: str + :ivar prefer_locales: Preferred BCP-47 locales that influence language accents. + :vartype prefer_locales: list[str] + :ivar locale: The enforced BCP-47 locale. When omitted, the language is detected from the text. + :vartype locale: str + :ivar style: The speaking style, such as ``cheerful`` or ``sad``. + :vartype style: str + :ivar pitch: The SSML-compatible pitch adjustment, such as ``+5%``. + :vartype pitch: str + :ivar rate: The SSML-compatible speaking-rate adjustment, such as ``+10%``. + :vartype rate: str + :ivar volume: The SSML-compatible volume adjustment, such as ``+10`` or ``-6dB``. + :vartype volume: str + :ivar type: Required. An Azure standard neural voice. + :vartype type: str or ~azure.ai.voiceagents.models.AZURE_STANDARD + :ivar name: The Azure neural voice name. Required. + :vartype name: str + :ivar multi_talker_speaker_name: The speaker name used by a multi-talker voice. + :vartype multi_talker_speaker_name: str + """ + + type: Literal[AzureVoiceType.AZURE_STANDARD] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. An Azure standard neural voice.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Azure neural voice name. Required.""" + multi_talker_speaker_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The speaker name used by a multi-talker voice.""" + + @overload + def __init__( + self, + *, + name: str, + temperature: Optional[float] = None, + custom_lexicon_url: Optional[str] = None, + custom_text_normalization_url: Optional[str] = None, + prefer_locales: Optional[list[str]] = None, + locale: Optional[str] = None, + style: Optional[str] = None, + pitch: Optional[str] = None, + rate: Optional[str] = None, + volume: Optional[str] = None, + multi_talker_speaker_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 = AzureVoiceType.AZURE_STANDARD # type: ignore + + +class BotServiceAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="BotService"): + """BotServiceAuthorizationScheme. + + :ivar type: Required. BOT_SERVICE. + :vartype type: str or ~azure.ai.voiceagents.models.BOT_SERVICE + """ + + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. BOT_SERVICE.""" + + @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 = AgentEndpointAuthorizationSchemeType.BOT_SERVICE # type: ignore + + +class BotServiceRbacAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="BotServiceRbac"): + """BotServiceRbacAuthorizationScheme. + + :ivar type: Required. BOT_SERVICE_RBAC. + :vartype type: str or ~azure.ai.voiceagents.models.BOT_SERVICE_RBAC + """ + + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. BOT_SERVICE_RBAC.""" + + @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 = AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC # type: ignore + + +class BotServiceTenantAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="BotServiceTenant"): + """BotServiceTenantAuthorizationScheme. + + :ivar type: Required. BOT_SERVICE_TENANT. + :vartype type: str or ~azure.ai.voiceagents.models.BOT_SERVICE_TENANT + """ + + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. BOT_SERVICE_TENANT.""" + + @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 = AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT # type: ignore + + +class CreateTranscriptionResponseJsonUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Token usage statistics for the request. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + TranscriptTextUsageDuration, TranscriptTextUsageTokens + + :ivar type: Required. Known values are: "tokens" and "duration". + :vartype type: str or ~azure.ai.voiceagents.models.CreateTranscriptionResponseJsonUsageType + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"tokens\" and \"duration\".""" + + @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 EntraAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="Entra"): + """EntraAuthorizationScheme. + + :ivar type: Required. ENTRA. + :vartype type: str or ~azure.ai.voiceagents.models.ENTRA + """ + + type: Literal[AgentEndpointAuthorizationSchemeType.ENTRA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. ENTRA.""" + + @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 = AgentEndpointAuthorizationSchemeType.ENTRA # type: ignore + + +class Error(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Error. + + :ivar code: Required. + :vartype code: str + :ivar message: Required. + :vartype message: str + :ivar param: + :vartype param: str + :ivar type: + :vartype type: str + :ivar details: + :vartype details: list[~azure.ai.voiceagents.models.Error] + :ivar additional_info: + :vartype additional_info: dict[str, any] + :ivar debug_info: + :vartype debug_info: dict[str, any] + """ + + code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + details: Optional[list["_models.Error"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + additional_info: Optional[dict[str, Any]] = rest_field( + name="additionalInfo", visibility=["read", "create", "update", "delete", "query"] + ) + debug_info: Optional[dict[str, Any]] = rest_field( + name="debugInfo", visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + code: str, + message: str, + param: Optional[str] = None, + type: Optional[str] = None, + details: Optional[list["_models.Error"]] = None, + additional_info: Optional[dict[str, Any]] = None, + debug_info: Optional[dict[str, Any]] = 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 VersionSelectionRule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """VersionSelectionRule. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + FixedRatioVersionSelectionRule + + :ivar type: Required. "FixedRatio" + :vartype type: str or ~azure.ai.voiceagents.models.VersionSelectorType + :ivar agent_version: The agent version to route traffic to. Required. + :vartype agent_version: str + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. \"FixedRatio\"""" + agent_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The agent version to route traffic to. Required.""" + + @overload + def __init__( + self, + *, + type: str, + agent_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 FixedRatioVersionSelectionRule( + VersionSelectionRule, discriminator="FixedRatio" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """FixedRatioVersionSelectionRule. + + :ivar agent_version: The agent version to route traffic to. Required. + :vartype agent_version: str + :ivar type: Required. FIXED_RATIO. + :vartype type: str or ~azure.ai.voiceagents.models.FIXED_RATIO + :ivar traffic_percentage: The percentage of traffic to route to the version. Must be between 0 + and 100. Required. + :vartype traffic_percentage: int + """ + + type: Literal[VersionSelectorType.FIXED_RATIO] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. FIXED_RATIO.""" + traffic_percentage: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The percentage of traffic to route to the version. Must be between 0 and 100. Required.""" + + @overload + def __init__( + self, + *, + agent_version: str, + traffic_percentage: 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 = VersionSelectorType.FIXED_RATIO # type: ignore + + +class InvocationsProtocolConfiguration(_Model): + """Configuration specific to the invocations protocol.""" + + +class InvocationsWsProtocolConfiguration(_Model): + """Configuration specific to the WebSocket-based invocations protocol.""" + + +class VoiceGreetingConfig(_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: + LlmGeneratedVoiceGreetingConfig, TemplateVoiceGreetingConfig + + :ivar type: The greeting mode. 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 greeting mode. 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 LlmGeneratedVoiceGreetingConfig( + VoiceGreetingConfig, discriminator="llm_generated" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A greeting authored by the session model from a scoped opening-turn prompt. + + :ivar type: Required. Default value is "llm_generated". + :vartype type: str + :ivar prompt: The Handlebars prompt that guides the opening turn. Required. + :vartype prompt: str + :ivar fallback_text: The optional Handlebars text template synthesized when generation fails + before any greeting output. + :vartype fallback_text: str + :ivar tool_choice: The tool-selection policy for the opening response. Defaults to ``none``. + Known values are: "none", "auto", and "required". + :vartype tool_choice: str or ~azure.ai.voiceagents.models.VoiceGreetingToolChoice + """ + + type: Literal["llm_generated"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"llm_generated\".""" + prompt: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Handlebars prompt that guides the opening turn. Required.""" + fallback_text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The optional Handlebars text template synthesized when generation fails before any greeting + output.""" + tool_choice: Optional[Union[str, "_models.VoiceGreetingToolChoice"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The tool-selection policy for the opening response. Defaults to ``none``. Known values are: + \"none\", \"auto\", and \"required\".""" + + @overload + def __init__( + self, + *, + prompt: str, + fallback_text: Optional[str] = None, + tool_choice: Optional[Union[str, "_models.VoiceGreetingToolChoice"]] = 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 = "llm_generated" # type: ignore + + +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 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.voiceagents.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 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.voiceagents.models.MCPListToolsToolInputSchema + :ivar annotations: + :vartype annotations: ~azure.ai.voiceagents.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 Tool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """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: + MCPTool + + :ivar type: Required. Known values are: "function", "file_search", "computer", + "computer_use_preview", "web_search", "mcp", "code_interpreter", "programmatic_tool_calling", + "image_generation", "local_shell", "shell", "custom", "namespace", "tool_search", + "web_search_preview", "apply_patch", "a2a_preview", "bing_custom_search_preview", + "browser_automation_preview", "fabric_dataagent_preview", "sharepoint_grounding_preview", + "memory_search_preview", "work_iq_preview", "fabric_iq_preview", "toolbox_search_preview", + "azure_ai_search", "azure_function", "bing_grounding", "capture_structured_outputs", and + "openapi". + :vartype type: str or ~azure.ai.voiceagents.models.ToolType + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"function\", \"file_search\", \"computer\", + \"computer_use_preview\", \"web_search\", \"mcp\", \"code_interpreter\", + \"programmatic_tool_calling\", \"image_generation\", \"local_shell\", \"shell\", \"custom\", + \"namespace\", \"tool_search\", \"web_search_preview\", \"apply_patch\", \"a2a_preview\", + \"bing_custom_search_preview\", \"browser_automation_preview\", \"fabric_dataagent_preview\", + \"sharepoint_grounding_preview\", \"memory_search_preview\", \"work_iq_preview\", + \"fabric_iq_preview\", \"toolbox_search_preview\", \"azure_ai_search\", \"azure_function\", + \"bing_grounding\", \"capture_structured_outputs\", and \"openapi\".""" + + @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 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.voiceagents.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: + + * 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.voiceagents.models.MCPToolFilter + :ivar allowed_callers: + :vartype allowed_callers: list[str or ~azure.ai.voiceagents.models.CallableToolAllowedCaller] + :ivar require_approval: Is one of the following types: MCPToolRequireApproval, + Literal["always"], Literal["never"] + :vartype require_approval: ~azure.ai.voiceagents.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.voiceagents.models.ToolConfig] + """ + + 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 + `_. 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, + *, + 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 + 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.MCP # type: ignore + + +class MCPToolFilter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """MCP tool filter. + + :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 + """ + + 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, + *, + tool_names: Optional[list[str]] = None, + read_only: 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 MCPToolRequireApproval(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """MCPToolRequireApproval. + + :ivar always: + :vartype always: ~azure.ai.voiceagents.models.MCPToolFilter + :ivar never: + :vartype never: ~azure.ai.voiceagents.models.MCPToolFilter + """ + + 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, + *, + always: Optional["_models.MCPToolFilter"] = None, + never: Optional["_models.MCPToolFilter"] = 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 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 OpenAIVoice(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An OpenAI built-in voice configuration with an explicit type discriminator. + + :ivar type: The voice kind. Always ``openai``. Required. Default value is "openai". + :vartype type: str + :ivar name: The OpenAI built-in voice name. Required. Known values are: "alloy", "ash", + "ballad", "coral", "echo", "sage", "shimmer", "verse", "marin", and "cedar". + :vartype name: str or ~azure.ai.voiceagents.models.VoiceIdsShared + """ + + type: Literal["openai"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The voice kind. Always ``openai``. Required. Default value is \"openai\".""" + name: Union[str, "_models.VoiceIdsShared"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The OpenAI built-in voice name. Required. Known values are: \"alloy\", \"ash\", \"ballad\", + \"coral\", \"echo\", \"sage\", \"shimmer\", \"verse\", \"marin\", and \"cedar\".""" + + @overload + def __init__( + self, + *, + name: Union[str, "_models.VoiceIdsShared"], + ) -> 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["openai"] = "openai" + + +class ProtocolConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Per-protocol configuration for the agent endpoint. + + :ivar activity: Configuration for the activity protocol. + :vartype activity: ~azure.ai.voiceagents.models.ActivityProtocolConfiguration + :ivar responses: Configuration for the responses protocol. + :vartype responses: ~azure.ai.voiceagents.models.ResponsesProtocolConfiguration + :ivar a2_a: Configuration for the A2A protocol. + :vartype a2_a: ~azure.ai.voiceagents.models.A2AProtocolConfiguration + :ivar mcp: Configuration for the MCP protocol. + :vartype mcp: ~azure.ai.voiceagents.models.McpProtocolConfiguration + :ivar invocations: Configuration for the invocations protocol. + :vartype invocations: ~azure.ai.voiceagents.models.InvocationsProtocolConfiguration + :ivar invocations_ws: Configuration for the WebSocket-based invocations protocol. + :vartype invocations_ws: ~azure.ai.voiceagents.models.InvocationsWsProtocolConfiguration + """ + + 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.""" + a2_a: Optional["_models.A2AProtocolConfiguration"] = rest_field( + name="a2a", 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, + *, + activity: Optional["_models.ActivityProtocolConfiguration"] = None, + responses: Optional["_models.ResponsesProtocolConfiguration"] = None, + a2_a: Optional["_models.A2AProtocolConfiguration"] = None, + mcp: Optional["_models.McpProtocolConfiguration"] = None, + invocations: Optional["_models.InvocationsProtocolConfiguration"] = None, + invocations_ws: Optional["_models.InvocationsWsProtocolConfiguration"] = 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 RaiConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Configuration for Responsible AI (RAI) content filtering and safety features. + + :ivar rai_policy_name: The name of the RAI policy to apply. Required. + :vartype rai_policy_name: str + """ + + rai_policy_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the RAI policy to apply. Required.""" + + @overload + def __init__( + self, + *, + rai_policy_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) + + +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 + + :ivar type: Required. Known values are: "audio/pcm", "audio/pcmu", and "audio/pcma". + :vartype type: str or ~azure.ai.voiceagents.models.RealtimeAudioFormatsType + """ + + __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, + *, + 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 RealtimeAudioFormatsAudioPcm( + RealtimeAudioFormats, discriminator="audio/pcm" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeAudioFormatsAudioPcm. + + :ivar type: Required. AUDIO_PCM. + :vartype type: str or ~azure.ai.voiceagents.models.AUDIO_PCM + :ivar rate: Default value is 24000. + :vartype rate: int + """ + + 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, + *, + rate: Optional[Literal[24000]] = 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 = RealtimeAudioFormatsType.AUDIO_PCM # type: ignore + + +class RealtimeAudioFormatsAudioPcma(RealtimeAudioFormats, discriminator="audio/pcma"): + """RealtimeAudioFormatsAudioPcma. + + :ivar type: Required. AUDIO_PCMA. + :vartype type: str or ~azure.ai.voiceagents.models.AUDIO_PCMA + """ + + type: Literal[RealtimeAudioFormatsType.AUDIO_PCMA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. AUDIO_PCMA.""" + + @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 = RealtimeAudioFormatsType.AUDIO_PCMA # type: ignore + + +class RealtimeAudioFormatsAudioPcmu(RealtimeAudioFormats, discriminator="audio/pcmu"): + """RealtimeAudioFormatsAudioPcmu. + + :ivar type: Required. AUDIO_PCMU. + :vartype type: str or ~azure.ai.voiceagents.models.AUDIO_PCMU + """ + + type: Literal[RealtimeAudioFormatsType.AUDIO_PCMU] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. AUDIO_PCMU.""" + + @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 = RealtimeAudioFormatsType.AUDIO_PCMU # 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 + + :ivar type: Required. Known values are: "function_call", "function_call_output", + "mcp_approval_response", "mcp_list_tools", "mcp_call", and "mcp_approval_request". + :vartype type: str or ~azure.ai.voiceagents.models.RealtimeConversationItemType + """ + + __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\", and \"mcp_approval_request\".""" + + @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 RealtimeConversationItemFunctionCall( + RealtimeConversationItem, discriminator="function_call" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime function call item. + + :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.voiceagents.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 + """ + + 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"] + ) + """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.""" + + @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, + ) -> 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 = 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. + + :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.voiceagents.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 + """ + + 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.""" + + @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, + ) -> 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 = RealtimeConversationItemType.FUNCTION_CALL_OUTPUT # type: ignore + + +class RealtimeConversationItemMessage(_Model): # 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 + + :ivar role: Required. Known values are: "system", "user", and "assistant". + :vartype role: str or ~azure.ai.voiceagents.models.RealtimeConversationItemMessageType + """ + + __mapping__: dict[str, _Model] = {} + role: str = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"system\", \"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 RealtimeConversationItemMessageAssistant( + RealtimeConversationItemMessage, discriminator="assistant" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime assistant message item. + + :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. Default value is "message". + :vartype type: str + :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.voiceagents.models.ASSISTANT + :ivar content: The content of the message. Required. + :vartype content: + list[~azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistantContent] + """ + + 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["message"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the item. Always ``message``. Required. Default value is \"message\".""" + 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.""" + + @overload + def __init__( + self, + *, + 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 + 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 = RealtimeConversationItemMessageType.ASSISTANT # type: ignore + self.type: Literal["message"] = "message" + + +class RealtimeConversationItemMessageAssistantContent( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeConversationItemMessageAssistantContent. + + :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 + """ + + 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, + *, + type: Optional[Literal["output_text", "output_audio"]] = None, + text: Optional[str] = None, + audio: Optional[str] = None, + transcript: 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 RealtimeConversationItemMessageSystem( + RealtimeConversationItemMessage, discriminator="system" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime system message item. + + :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. Default value is "message". + :vartype type: str + :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.voiceagents.models.SYSTEM + :ivar content: The content of the message. Required. + :vartype content: + list[~azure.ai.voiceagents.models.RealtimeConversationItemMessageSystemContent] + """ + + 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["message"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the item. Always ``message``. Required. Default value is \"message\".""" + 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.""" + + @overload + def __init__( + self, + *, + 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 + 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 = RealtimeConversationItemMessageType.SYSTEM # type: ignore + self.type: Literal["message"] = "message" + + +class RealtimeConversationItemMessageSystemContent( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeConversationItemMessageSystemContent. + + :ivar type: Default value is "input_text". + :vartype type: str + :ivar text: + :vartype text: 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"]) + + @overload + def __init__( + self, + *, + type: Optional[Literal["input_text"]] = None, + 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 RealtimeConversationItemMessageUser( + RealtimeConversationItemMessage, discriminator="user" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime user message item. + + :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. Default value is "message". + :vartype type: str + :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.voiceagents.models.USER + :ivar content: The content of the message. Required. + :vartype content: list[~azure.ai.voiceagents.models.RealtimeConversationItemMessageUserContent] + """ + + 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["message"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the item. Always ``message``. Required. Default value is \"message\".""" + 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.""" + + @overload + def __init__( + self, + *, + 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 + 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 = RealtimeConversationItemMessageType.USER # type: ignore + self.type: Literal["message"] = "message" + + +class RealtimeConversationItemMessageUserContent( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeConversationItemMessageUserContent. + + :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 + """ + + 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, + *, + 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 + 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 RealtimeFunctionTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Function tool. + + :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.voiceagents.models.RealtimeFunctionToolParameters + """ + + 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, + *, + type: Optional[Literal["function"]] = None, + name: Optional[str] = None, + description: Optional[str] = None, + parameters: Optional["_models.RealtimeFunctionToolParameters"] = 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 RealtimeFunctionToolParameters(_Model): + """RealtimeFunctionToolParameters.""" + + +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.voiceagents.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 + """ + + 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.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + server_label: str, + name: str, + arguments: 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 = RealtimeConversationItemType.MCP_APPROVAL_REQUEST # type: ignore + + +class RealtimeMCPApprovalResponse( + RealtimeConversationItem, discriminator="mcp_approval_response" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime MCP approval response. + + :ivar type: The type of the item. Always ``mcp_approval_response``. Required. + MCP_APPROVAL_RESPONSE. + :vartype type: str or ~azure.ai.voiceagents.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 + """ + + 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"]) + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + approval_request_id: str, + approve: bool, + reason: 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 = RealtimeConversationItemType.MCP_APPROVAL_RESPONSE # type: ignore + + +class RealtimeMCPError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeMCPError. + + 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.voiceagents.models.RealtimeMcpErrorType + """ + + __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, + *, + 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 RealtimeMCPHTTPError( + RealtimeMCPError, discriminator="http_error" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime MCP HTTP error. + + :ivar type: Required. HTTP_ERROR. + :vartype type: str or ~azure.ai.voiceagents.models.HTTP_ERROR + :ivar code: Required. + :vartype code: int + :ivar message: Required. + :vartype message: str + """ + + 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, + *, + code: int, + 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] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeMcpErrorType.HTTP_ERROR # type: ignore + + +class RealtimeMCPListTools( + RealtimeConversationItem, discriminator="mcp_list_tools" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime MCP list tools. + + :ivar type: The type of the item. Always ``mcp_list_tools``. Required. MCP_LIST_TOOLS. + :vartype type: str or ~azure.ai.voiceagents.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.voiceagents.models.MCPListToolsTool] + """ + + 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.""" + + @overload + def __init__( + self, + *, + server_label: str, + tools: list["_models.MCPListToolsTool"], + id: Optional[str] = None, # 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) + self.type = RealtimeConversationItemType.MCP_LIST_TOOLS # type: ignore + + +class RealtimeMCPProtocolError( + RealtimeMCPError, discriminator="protocol_error" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime MCP protocol error. + + :ivar type: Required. PROTOCOL_ERROR. + :vartype type: str or ~azure.ai.voiceagents.models.PROTOCOL_ERROR + :ivar code: Required. + :vartype code: int + :ivar message: Required. + :vartype message: str + """ + + 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, + *, + code: int, + 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] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeMcpErrorType.PROTOCOL_ERROR # type: ignore + + +class RealtimeMCPToolCall( + RealtimeConversationItem, discriminator="mcp_call" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime MCP tool call. + + :ivar type: The type of the item. Always ``mcp_call``. Required. MCP_CALL. + :vartype type: str or ~azure.ai.voiceagents.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.voiceagents.models.RealtimeMCPError + """ + + 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"]) + + @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, + ) -> 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 = 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. + + :ivar type: Required. TOOL_EXECUTION_ERROR. + :vartype type: str or ~azure.ai.voiceagents.models.TOOL_EXECUTION_ERROR + :ivar message: Required. + :vartype message: str + """ + + 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, + *, + 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] + """ + + 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. + + :ivar effort: Known values are: "minimal", "low", "medium", "high", and "xhigh". + :vartype effort: str or ~azure.ai.voiceagents.models.RealtimeReasoningEffort + """ + + 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, + *, + effort: Optional[Union[str, "_models.RealtimeReasoningEffort"]] = 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 RealtimeResponseStatusDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeResponseStatusDetails. + + :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.voiceagents.models.RealtimeResponseStatusDetailsError + """ + + 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"] + ) + + @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, + ) -> 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 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 RealtimeResponseUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeResponseUsage. + + :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.voiceagents.models.RealtimeResponseUsageInputTokenDetails + :ivar output_token_details: + :vartype output_token_details: + ~azure.ai.voiceagents.models.RealtimeResponseUsageOutputTokenDetails + """ + + 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"] + ) + + @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, + ) -> 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 RealtimeResponseUsageInputTokenDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeResponseUsageInputTokenDetails. + + :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.voiceagents.models.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails + """ + + 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"] + ) + + @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, + ) -> 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 RealtimeResponseUsageInputTokenDetailsCachedTokensDetails( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeResponseUsageInputTokenDetailsCachedTokensDetails. + + :ivar text_tokens: + :vartype text_tokens: int + :ivar image_tokens: + :vartype image_tokens: int + :ivar audio_tokens: + :vartype audio_tokens: int + """ + + 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, + *, + text_tokens: Optional[int] = None, + image_tokens: Optional[int] = None, + audio_tokens: 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 RealtimeResponseUsageOutputTokenDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeResponseUsageOutputTokenDetails. + + :ivar text_tokens: + :vartype text_tokens: int + :ivar audio_tokens: + :vartype audio_tokens: int + """ + + 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, + *, + text_tokens: Optional[int] = None, + audio_tokens: 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 RealtimeServerEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A realtime server event. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + RealtimeServerEventResponseContentPartAdded + + :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", and "response.mcp_call.failed". + :vartype type: str or ~azure.ai.voiceagents.models.RealtimeServerEventType + """ + + __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\", and \"response.mcp_call.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 RealtimeServerEventConversationItemInputAudioTranscriptionFailedError( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeServerEventConversationItemInputAudioTranscriptionFailedError. + + :ivar type: + :vartype type: str + :ivar code: + :vartype code: str + :ivar message: + :vartype message: str + :ivar param: + :vartype param: str + """ + + 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, + *, + type: Optional[str] = None, + code: Optional[str] = None, + message: Optional[str] = None, + 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) + + +class RealtimeServerEventRateLimitsUpdatedRateLimits( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeServerEventRateLimitsUpdatedRateLimits. + + :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 + """ + + 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 + 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 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 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.voiceagents.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.voiceagents.models.RealtimeServerEventResponseContentPartAddedPart + """ + + 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.""" + + @overload + def __init__( + self, + *, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + part: "_models.RealtimeServerEventResponseContentPartAddedPart", + ) -> 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_CONTENT_PART_ADDED # type: ignore + + +class RealtimeServerEventResponseContentPartAddedPart( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeServerEventResponseContentPartAddedPart. + + :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 + """ + + 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, + *, + type: Optional[Literal["audio", "text"]] = None, + text: Optional[str] = None, + audio: Optional[str] = None, + transcript: 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 RealtimeToolChoiceFunction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A Realtime tool-choice object that forces the model to call a specific function. + + :ivar type: For function calling, the type is always ``function``. Required. FUNCTION. + :vartype type: str or ~azure.ai.voiceagents.models.FUNCTION + :ivar name: The name of the function to call. Required. + :vartype name: str + """ + + type: Literal[ToolChoiceParamType.FUNCTION] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """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: Literal[ToolChoiceParamType.FUNCTION], + 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) + + +class ResponsesProtocolConfiguration(_Model): + """Configuration specific to the responses protocol.""" + + +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 TemplateVoiceGreetingConfig( + VoiceGreetingConfig, discriminator="template" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A deterministic greeting rendered with the voice agent's structured inputs and synthesized + without model-authored generation. + + :ivar type: Required. Default value is "template". + :vartype type: str + :ivar text: The Handlebars text template spoken at session start. Required. + :vartype text: str + """ + + type: Literal["template"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"template\".""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Handlebars text template spoken at session start. 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 = "template" # 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: + ToolChoiceFunction, ToolChoiceMCP + + :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.voiceagents.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 ToolChoiceFunction( + ToolChoiceParam, discriminator="function" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Function tool. + + :ivar type: For function calling, the type is always ``function``. Required. FUNCTION. + :vartype type: str or ~azure.ai.voiceagents.models.FUNCTION + :ivar name: The name of the function to call. Required. + :vartype name: str + """ + + 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, + *, + 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 = ToolChoiceParamType.FUNCTION # type: ignore + + +class ToolChoiceMCP( + ToolChoiceParam, discriminator="mcp" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """MCP tool. + + :ivar type: For MCP tools, the type is always ``mcp``. Required. MCP. + :vartype type: str or ~azure.ai.voiceagents.models.MCP + :ivar server_label: The label of the MCP server to use. Required. + :vartype server_label: str + :ivar name: + :vartype name: str + """ + + 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, + *, + 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 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 TranscriptTextUsageDuration( + CreateTranscriptionResponseJsonUsage, discriminator="duration" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Duration Usage. + + :ivar type: The type of the usage object. Always ``duration`` for this variant. Required. + DURATION. + :vartype type: str or ~azure.ai.voiceagents.models.DURATION + :ivar seconds: Duration of the input audio in seconds. Required. + :vartype seconds: ~datetime.timedelta + """ + + 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, + *, + seconds: datetime.timedelta, + ) -> 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 = CreateTranscriptionResponseJsonUsageType.DURATION # type: ignore + + +class TranscriptTextUsageTokens( + CreateTranscriptionResponseJsonUsage, discriminator="tokens" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Token Usage. + + :ivar type: The type of the usage object. Always ``tokens`` for this variant. Required. TOKENS. + :vartype type: str or ~azure.ai.voiceagents.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.voiceagents.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[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, + *, + input_tokens: int, + output_tokens: int, + total_tokens: int, + input_token_details: Optional["_models.TranscriptTextUsageTokensInputTokenDetails"] = 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 = CreateTranscriptionResponseJsonUsageType.TOKENS # type: ignore + + +class TranscriptTextUsageTokensInputTokenDetails( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """TranscriptTextUsageTokensInputTokenDetails. + + :ivar text_tokens: + :vartype text_tokens: int + :ivar audio_tokens: + :vartype audio_tokens: int + """ + + 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, + *, + text_tokens: Optional[int] = None, + audio_tokens: 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 VersionSelector(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """VersionSelector. + + :ivar version_selection_rules: Required. + :vartype version_selection_rules: list[~azure.ai.voiceagents.models.VersionSelectionRule] + """ + + version_selection_rules: list["_models.VersionSelectionRule"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required.""" + + @overload + def __init__( + self, + *, + version_selection_rules: list["_models.VersionSelectionRule"], + ) -> 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 VoiceAgentAnimationConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Animation settings for a voice-agent session. + + :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.voiceagents.models.VoiceAgentAnimationOutputType] + """ + + 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"] + ) + """The requested animation output kinds.""" + + @overload + def __init__( + self, + *, + model_name: Optional[str] = None, + outputs: Optional[list[Union[str, "_models.VoiceAgentAnimationOutputType"]]] = 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 VoiceAgentAvatarIceServer(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An ICE server used for avatar WebRTC negotiation. + + :ivar urls: Required. + :vartype urls: list[str] + :ivar username: + :vartype username: str + :ivar credential: + :vartype credential: str + """ + + 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, + *, + urls: list[str], + username: Optional[str] = None, + credential: 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 VoiceAgentAvatarScene(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Avatar placement and motion settings. + + :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 + """ + + 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, + *, + 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 + 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 VoiceAgentAvatarVideoBackground(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The avatar video background. + + :ivar image_url: + :vartype image_url: str + :ivar color: + :vartype color: str + """ + + 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, + *, + image_url: Optional[str] = None, + color: 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 VoiceAgentAvatarVideoCrop(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The rectangular crop applied to avatar video. + + :ivar bottom_right: Required. + :vartype bottom_right: list[int] + :ivar top_left: Required. + :vartype top_left: list[int] + """ + + 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, + *, + bottom_right: list[int], + top_left: 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 VoiceAgentAvatarVideoParams(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Avatar video encoder and presentation settings. + + :ivar bitrate: + :vartype bitrate: int + :ivar codec: Default value is "h264". + :vartype codec: str + :ivar crop: + :vartype crop: ~azure.ai.voiceagents.models.VoiceAgentAvatarVideoCrop + :ivar resolution: + :vartype resolution: ~azure.ai.voiceagents.models.VoiceAgentAvatarVideoResolution + :ivar background: + :vartype background: ~azure.ai.voiceagents.models.VoiceAgentAvatarVideoBackground + :ivar gop_size: + :vartype gop_size: int + """ + + bitrate: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + codec: Optional[Literal["h264"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Default value is \"h264\".""" + crop: Optional["_models.VoiceAgentAvatarVideoCrop"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + 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, + *, + bitrate: Optional[int] = None, + codec: Optional[Literal["h264"]] = None, + crop: Optional["_models.VoiceAgentAvatarVideoCrop"] = None, + resolution: Optional["_models.VoiceAgentAvatarVideoResolution"] = None, + background: Optional["_models.VoiceAgentAvatarVideoBackground"] = None, + gop_size: 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 VoiceAgentAvatarVideoResolution(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The avatar video resolution. + + :ivar width: Required. + :vartype width: int + :ivar height: Required. + :vartype height: int + """ + + 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, + *, + width: int, + 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) + + +class VoiceAgentAzureMultilingualSemanticVadTurnDetection( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Azure multilingual semantic VAD turn-detection settings. + + :ivar remove_filler_words: Whether filler words are removed from transcription. + :vartype remove_filler_words: bool + :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech + stops. + :vartype auto_truncate: 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 type: Required. Multilingual Azure semantic voice activity detection. + :vartype type: str or ~azure.ai.voiceagents.models.AZURE_SEMANTIC_VAD_MULTILINGUAL + :ivar threshold: + :vartype threshold: float + :ivar prefix_padding_ms: + :vartype prefix_padding_ms: int + :ivar silence_duration_ms: + :vartype silence_duration_ms: int + :ivar idle_timeout_ms: + :vartype idle_timeout_ms: int + :ivar speech_duration_ms: + :vartype speech_duration_ms: int + :ivar end_of_utterance_detection: + :vartype end_of_utterance_detection: + ~azure.ai.voiceagents.models.VoiceAgentEndOfUtteranceDetection + :ivar languages: + :vartype languages: list[str] + """ + + remove_filler_words: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether filler words are removed from transcription.""" + auto_truncate: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the input audio buffer is truncated automatically when speech stops.""" + 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.""" + type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Multilingual Azure semantic voice activity detection.""" + threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + prefix_padding_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + silence_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + idle_timeout_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + speech_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + languages: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL], + remove_filler_words: Optional[bool] = None, + auto_truncate: Optional[bool] = None, + create_response: Optional[bool] = None, + interrupt_response: Optional[bool] = None, + threshold: Optional[float] = None, + prefix_padding_ms: Optional[int] = None, + silence_duration_ms: Optional[int] = None, + idle_timeout_ms: Optional[int] = None, + speech_duration_ms: Optional[int] = None, + end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = 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) + + +class VoiceAgentAzureSemanticVadTurnDetection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Azure semantic VAD turn-detection settings. + + :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 type: Required. Known values are: "azure_semantic_vad" and "azure_semantic_vad_en". + :vartype type: str or ~azure.ai.voiceagents.models.VoiceAgentAzureSemanticVadType + :ivar threshold: + :vartype threshold: float + :ivar prefix_padding_ms: + :vartype prefix_padding_ms: int + :ivar silence_duration_ms: + :vartype silence_duration_ms: int + :ivar idle_timeout_ms: + :vartype idle_timeout_ms: int + :ivar speech_duration_ms: + :vartype speech_duration_ms: int + :ivar end_of_utterance_detection: + :vartype end_of_utterance_detection: + ~azure.ai.voiceagents.models.VoiceAgentEndOfUtteranceDetection + :ivar remove_filler_words: + :vartype remove_filler_words: bool + :ivar languages: + :vartype languages: list[str] + :ivar auto_truncate: + :vartype auto_truncate: bool + """ + + 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.""" + type: Union[str, "_models.VoiceAgentAzureSemanticVadType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Known values are: \"azure_semantic_vad\" and \"azure_semantic_vad_en\".""" + threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + prefix_padding_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + silence_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + idle_timeout_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + speech_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + remove_filler_words: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + languages: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + auto_truncate: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + type: Union[str, "_models.VoiceAgentAzureSemanticVadType"], + create_response: Optional[bool] = None, + interrupt_response: Optional[bool] = None, + threshold: Optional[float] = None, + prefix_padding_ms: Optional[int] = None, + silence_duration_ms: Optional[int] = None, + idle_timeout_ms: Optional[int] = None, + speech_duration_ms: Optional[int] = None, + end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = None, + remove_filler_words: Optional[bool] = None, + languages: Optional[list[str]] = None, + auto_truncate: 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 VoiceAgentClientEventConversationItemCreate( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``conversation.item.create`` client event. + + :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.voiceagents.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: The conversation item to create. Required. Is either a + "_unions.VoiceAgentRequestConversationItem" type or a RealtimeMCPApprovalResponse type. + :vartype item: ~azure.ai.voiceagents.models.RealtimeConversationItemMessageSystem or + ~azure.ai.voiceagents.models.RealtimeConversationItemMessageUser or + ~azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistant or + ~azure.ai.voiceagents.models.RealtimeConversationItemFunctionCall or + ~azure.ai.voiceagents.models.RealtimeConversationItemFunctionCallOutput or + ~azure.ai.voiceagents.models.RealtimeMCPApprovalResponse + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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: "_unions.VoiceAgentCreateConversationItem" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The conversation item to create. Required. Is either a + \"_unions.VoiceAgentRequestConversationItem\" type or a RealtimeMCPApprovalResponse type.""" + + @overload + def __init__( + self, + *, + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE], + item: "_unions.VoiceAgentCreateConversationItem", + event_id: Optional[str] = None, + previous_item_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 VoiceAgentClientEventConversationItemDelete( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``conversation.item.delete`` client event. + + :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.voiceagents.models.CONVERSATION_ITEM_DELETE + :ivar item_id: The ID of the item to delete. Required. + :vartype item_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_DELETE] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE], + 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) + + +class VoiceAgentClientEventConversationItemRetrieve( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``conversation.item.retrieve`` client event. + + :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.voiceagents.models.CONVERSATION_ITEM_RETRIEVE + :ivar item_id: The ID of the item to retrieve. Required. + :vartype item_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_RETRIEVE] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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.""" + + @overload + def __init__( + self, + *, + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE], + 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) + + +class VoiceAgentClientEventConversationItemTruncate( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``conversation.item.truncate`` client event. + + :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.voiceagents.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: 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE], + item_id: str, + content_index: int, + audio_end_ms: int, + 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 VoiceAgentClientEventInputAudioBufferAppend( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``input_audio_buffer.append`` client event. + + :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.voiceagents.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: 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND], + 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) + + +class VoiceAgentClientEventInputAudioBufferClear( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``input_audio_buffer.clear`` client event. + + :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.voiceagents.models.INPUT_AUDIO_BUFFER_CLEAR + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The event type, must be ``input_audio_buffer.clear``. Required. INPUT_AUDIO_BUFFER_CLEAR.""" + + @overload + def __init__( + self, + *, + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR], + 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 VoiceAgentClientEventInputAudioBufferCommit( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``input_audio_buffer.commit`` client event. + + :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.voiceagents.models.INPUT_AUDIO_BUFFER_COMMIT + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The event type, must be ``input_audio_buffer.commit``. Required. INPUT_AUDIO_BUFFER_COMMIT.""" + + @overload + def __init__( + self, + *, + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT], + 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 VoiceAgentClientEventOutputAudioBufferClear( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``output_audio_buffer.clear`` client event. + + :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.voiceagents.models.OUTPUT_AUDIO_BUFFER_CLEAR + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The event type, must be ``output_audio_buffer.clear``. Required. OUTPUT_AUDIO_BUFFER_CLEAR.""" + + @overload + def __init__( + self, + *, + type: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR], + 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 VoiceAgentClientEventResponseCancel(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``response.cancel`` client event. + + :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.voiceagents.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: 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + type: Literal[RealtimeClientEventType.RESPONSE_CANCEL], + event_id: Optional[str] = None, + 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) + + +class VoiceAgentClientEventResponseCreate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``response.create`` client event. + + :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.voiceagents.models.RESPONSE_CREATE + :ivar response: Parameters for the new response. + :vartype response: ~azure.ai.voiceagents.models.VoiceAgentResponseCreateParams + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The event type, must be ``response.create``. Required. RESPONSE_CREATE.""" + response: Optional["_models.VoiceAgentResponseCreateParams"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Parameters for the new response.""" + + @overload + def __init__( + self, + *, + type: Literal[RealtimeClientEventType.RESPONSE_CREATE], + event_id: Optional[str] = None, + response: Optional["_models.VoiceAgentResponseCreateParams"] = 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 VoiceAgentClientEventSessionAvatarConnect( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``session.avatar.connect`` client event. + + :ivar type: The event type. Always ``session.avatar.connect``. Required. Default value is + "session.avatar.connect". + :vartype type: str + :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 + """ + + type: Literal["session.avatar.connect"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event type. Always ``session.avatar.connect``. Required. Default value is + \"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, + *, + client_sdp: 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: Literal["session.avatar.connect"] = "session.avatar.connect" + + +class VoiceAgentClientEventSessionUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``session.update`` client event. + + :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.voiceagents.models.SESSION_UPDATE + :ivar session: The stable realtime session fields to update. Required. + :vartype session: ~azure.ai.voiceagents.models.VoiceAgentSessionUpdateConfig + """ + + 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: "_models.VoiceAgentSessionUpdateConfig" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The stable realtime session fields to update. Required.""" + + @overload + def __init__( + self, + *, + type: Literal[RealtimeClientEventType.SESSION_UPDATE], + session: "_models.VoiceAgentSessionUpdateConfig", + 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 VoiceAgentDefinition(_Model): # 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. The realtime voice session is established + through a separate connect operation that is not defined in this specification. Every create or + update produces a new immutable version. + + :ivar kind: The kind discriminator for a voice agent definition. Always ``voice``. Required. + Default value is "voice". + :vartype kind: str + :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. + :vartype rai_config: ~azure.ai.voiceagents.models.RaiConfig + :ivar model_type: How the model backing this agent is served. Together with ``model``, this + selects the model up front. ``managed`` uses a service-managed model; ``self_deployed`` uses + the customer's own Foundry deployment. This is independent of the architecture (realtime or + cascaded), which the service derives from the selected model. Required. Known values are: + "managed" and "self_deployed". + :vartype model_type: str or ~azure.ai.voiceagents.models.VoiceModelType + :ivar model: The model to use for this agent, paired with ``model_type``: the service-managed + model name when ``model_type`` is ``managed``, or the customer's Foundry deployment name when + ``model_type`` is ``self_deployed``. The model must support realtime or cascaded voice. The + service derives the architecture from the selected model. Required. + :vartype model: str + :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.voiceagents.models.VoiceGreetingConfig + :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.voiceagents.models.VoiceAudioConfig + :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.voiceagents.models.VoiceOutputModality] + :ivar avatar: Optional avatar configuration. These values are session defaults and may be + overridden when connecting. + :vartype avatar: ~azure.ai.voiceagents.models.VoiceAvatarConfig + :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.voiceagents.models.RealtimeFunctionTool or + ~azure.ai.voiceagents.models.VoiceAgentMcpTool or ~azure.ai.voiceagents.models.VoiceSystemTool + or ~azure.ai.voiceagents.models.VoiceToolboxTool] + :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.voiceagents.models.StructuredInputDefinition] + :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 + """ + + kind: Literal["voice"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The kind discriminator for a voice agent definition. Always ``voice``. Required. Default value + is \"voice\".""" + rai_config: Optional["_models.RaiConfig"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Configuration for Responsible AI (RAI) content filtering and safety features.""" + model_type: Union[str, "_models.VoiceModelType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """How the model backing this agent is served. Together with ``model``, this selects the model up + front. ``managed`` uses a service-managed model; ``self_deployed`` uses the customer's own + Foundry deployment. This is independent of the architecture (realtime or cascaded), which the + service derives from the selected model. Required. Known values are: \"managed\" and + \"self_deployed\".""" + model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The model to use for this agent, paired with ``model_type``: the service-managed model name + when ``model_type`` is ``managed``, or the customer's Foundry deployment name when + ``model_type`` is ``self_deployed``. The model must support realtime or cascaded voice. The + service derives the architecture from the selected model. Required.""" + 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.VoiceGreetingConfig"] = 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.VoiceAudioConfig"] = 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.""" + avatar: Optional["_models.VoiceAvatarConfig"] = 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["_unions.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.""" + structured_inputs: Optional[dict[str, "_models.StructuredInputDefinition"]] = 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.""" + 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.""" + + @overload + def __init__( + self, + *, + model_type: Union[str, "_models.VoiceModelType"], + model: str, + rai_config: Optional["_models.RaiConfig"] = None, + instructions: Optional[str] = None, + greeting: Optional["_models.VoiceGreetingConfig"] = None, + audio: Optional["_models.VoiceAudioConfig"] = None, + output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = None, + avatar: Optional["_models.VoiceAvatarConfig"] = None, + tools: Optional[list["_unions.VoiceAgentTool"]] = None, + structured_inputs: Optional[dict[str, "_models.StructuredInputDefinition"]] = None, + store: 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.kind: Literal["voice"] = "voice" + + +class VoiceAgentEchoCancellation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Server-side echo cancellation settings for input audio. + + :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.voiceagents.models.VoiceAgentEchoCancellationReferenceSource + :ivar channels: The number of input channels. Use two interleaved channels when + ``reference_source`` is ``client``. + :vartype channels: int + """ + + 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, + *, + reference_source: Optional[Union[str, "_models.VoiceAgentEchoCancellationReferenceSource"]] = None, + channels: 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: Literal["server_echo_cancellation"] = "server_echo_cancellation" + + +class VoiceAgentEndOfUtteranceDetection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """End-of-utterance detection settings. + + :ivar 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.voiceagents.models.VoiceAgentEndOfUtteranceModel + :ivar threshold: + :vartype threshold: float + :ivar threshold_level: Known values are: "low", "medium", "high", and "default". + :vartype threshold_level: str or + ~azure.ai.voiceagents.models.VoiceAgentEndOfUtteranceThresholdLevel + :ivar timeout: + :vartype timeout: float + :ivar timeout_ms: + :vartype timeout_ms: int + """ + + model: Union[str, "_models.VoiceAgentEndOfUtteranceModel"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Known values are: \"semantic_detection_v1\", \"semantic_detection_v1_en\", + \"semantic_detection_v1_multilingual\", and \"smart_end_of_turn_detection\".""" + threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + threshold_level: Optional[Union[str, "_models.VoiceAgentEndOfUtteranceThresholdLevel"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"low\", \"medium\", \"high\", and \"default\".""" + timeout: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + timeout_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + model: Union[str, "_models.VoiceAgentEndOfUtteranceModel"], + threshold: Optional[float] = None, + threshold_level: Optional[Union[str, "_models.VoiceAgentEndOfUtteranceThresholdLevel"]] = None, + timeout: Optional[float] = None, + timeout_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) + + +class VoiceAgentEstimatedCost(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A best-effort public-retail cost estimate for a response. + + :ivar amount: The total estimated amount, when available. Required. + :vartype amount: float + :ivar input_cost: The estimated input cost. + :vartype input_cost: float + :ivar output_cost: The estimated output cost. + :vartype output_cost: float + :ivar currency: The estimate currency. Always ``USD``. Default value is "USD". + :vartype currency: str + :ivar voice_live_amount: The portion attributed to Voice Live processing. Required. + :vartype voice_live_amount: float + :ivar byom_model_amount: The portion attributed to a customer-provided model. + :vartype byom_model_amount: float + :ivar status: Whether the estimate is complete, partial, or unavailable. Required. Known values + are: "complete", "partial", and "unavailable". + :vartype status: str or ~azure.ai.voiceagents.models.VoiceAgentEstimatedCostStatus + :ivar price_version: The Voice Live price version used for the estimate. Required. + :vartype price_version: str + :ivar byom_model_price_version: The customer-provided model price version used for the + estimate. + :vartype byom_model_price_version: str + :ivar unpriced_components: Components for which no price was available. + :vartype unpriced_components: list[str] + """ + + amount: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The total estimated amount, when available. Required.""" + input_cost: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The estimated input cost.""" + output_cost: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The estimated output cost.""" + currency: Optional[Literal["USD"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The estimate currency. Always ``USD``. Default value is \"USD\".""" + voice_live_amount: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The portion attributed to Voice Live processing. Required.""" + byom_model_amount: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The portion attributed to a customer-provided model.""" + status: Union[str, "_models.VoiceAgentEstimatedCostStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Whether the estimate is complete, partial, or unavailable. Required. Known values are: + \"complete\", \"partial\", and \"unavailable\".""" + price_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Voice Live price version used for the estimate. Required.""" + byom_model_price_version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The customer-provided model price version used for the estimate.""" + unpriced_components: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Components for which no price was available.""" + + @overload + def __init__( + self, + *, + amount: float, + voice_live_amount: float, + status: Union[str, "_models.VoiceAgentEstimatedCostStatus"], + price_version: str, + input_cost: Optional[float] = None, + output_cost: Optional[float] = None, + currency: Optional[Literal["USD"]] = None, + byom_model_amount: Optional[float] = None, + byom_model_price_version: Optional[str] = None, + unpriced_components: 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 VoiceAgentFileSearchCallItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A file-search output item. + + :ivar id: Required. + :vartype id: str + :ivar type: Required. Default value is "file_search_call". + :vartype type: str + :ivar status: Required. Known values are: "in_progress", "searching", "completed", + "incomplete", and "failed". + :vartype status: str or ~azure.ai.voiceagents.models.VoiceAgentFileSearchCallStatus + :ivar queries: + :vartype queries: list[str] + :ivar results: + :vartype results: list[~azure.ai.voiceagents.models.VoiceAgentFileSearchResult] + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + type: Literal["file_search_call"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"file_search_call\".""" + status: Union[str, "_models.VoiceAgentFileSearchCallStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Known values are: \"in_progress\", \"searching\", \"completed\", \"incomplete\", and + \"failed\".""" + queries: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + results: Optional[list["_models.VoiceAgentFileSearchResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + status: Union[str, "_models.VoiceAgentFileSearchCallStatus"], + queries: Optional[list[str]] = None, + results: Optional[list["_models.VoiceAgentFileSearchResult"]] = 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["file_search_call"] = "file_search_call" + + +class VoiceAgentFileSearchResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """One result returned by a file-search call. + + :ivar attributes: + :vartype attributes: dict[str, str or float or bool] + :ivar file_id: + :vartype file_id: str + :ivar filename: + :vartype filename: str + :ivar score: + :vartype score: float + :ivar text: + :vartype text: str + """ + + attributes: Optional[dict[str, "_unions.VoiceAgentFileSearchAttributeValue"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + file_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + filename: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + score: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + attributes: Optional[dict[str, "_unions.VoiceAgentFileSearchAttributeValue"]] = None, + file_id: Optional[str] = None, + filename: Optional[str] = None, + score: Optional[float] = None, + 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 VoiceAgentHandoffEdgeConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A directed transition between handoff nodes. + + :ivar id: The edge identifier. Required. + :vartype id: str + :ivar source: The source node identifier. Required. + :vartype source: str + :ivar target: The target node identifier. Required. + :vartype target: str + :ivar description: A non-empty description used by the model to select this transition. + Required. + :vartype description: str + :ivar cancel_on_interruption: Whether user interruption cancels the transition. + :vartype cancel_on_interruption: bool + :ivar delay_ms: The delay before the target behavior is committed, in milliseconds. + :vartype delay_ms: int + :ivar transfer_message: Optional text synthesized while transferring. + :vartype transfer_message: str + :ivar target_response: Whether the target automatically creates a response after transfer. + Known values are: "auto" and "none". + :vartype target_response: str or ~azure.ai.voiceagents.models.VoiceAgentHandoffTargetResponse + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The edge identifier. Required.""" + source: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The source node identifier. Required.""" + target: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The target node identifier. Required.""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A non-empty description used by the model to select this transition. Required.""" + cancel_on_interruption: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether user interruption cancels the transition.""" + delay_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The delay before the target behavior is committed, in milliseconds.""" + transfer_message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional text synthesized while transferring.""" + target_response: Optional[Union[str, "_models.VoiceAgentHandoffTargetResponse"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Whether the target automatically creates a response after transfer. Known values are: \"auto\" + and \"none\".""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + source: str, + target: str, + description: str, + cancel_on_interruption: Optional[bool] = None, + delay_ms: Optional[int] = None, + transfer_message: Optional[str] = None, + target_response: Optional[Union[str, "_models.VoiceAgentHandoffTargetResponse"]] = 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 VoiceAgentHandoffEdgeState(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Non-sensitive metadata for an effective handoff edge. + + :ivar id: The edge identifier. Required. + :vartype id: str + :ivar source: The source node identifier. Required. + :vartype source: str + :ivar target: The target node identifier. Required. + :vartype target: str + :ivar cancel_on_interruption: Whether user interruption cancels the transition. + :vartype cancel_on_interruption: bool + :ivar delay_ms: The delay before the target behavior is committed, in milliseconds. + :vartype delay_ms: int + :ivar transfer_message: Optional text synthesized while transferring. + :vartype transfer_message: str + :ivar target_response: Whether the target automatically creates a response after transfer. + Known values are: "auto" and "none". + :vartype target_response: str or ~azure.ai.voiceagents.models.VoiceAgentHandoffTargetResponse + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The edge identifier. Required.""" + source: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The source node identifier. Required.""" + target: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The target node identifier. Required.""" + cancel_on_interruption: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether user interruption cancels the transition.""" + delay_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The delay before the target behavior is committed, in milliseconds.""" + transfer_message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional text synthesized while transferring.""" + target_response: Optional[Union[str, "_models.VoiceAgentHandoffTargetResponse"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Whether the target automatically creates a response after transfer. Known values are: \"auto\" + and \"none\".""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + source: str, + target: str, + cancel_on_interruption: Optional[bool] = None, + delay_ms: Optional[int] = None, + transfer_message: Optional[str] = None, + target_response: Optional[Union[str, "_models.VoiceAgentHandoffTargetResponse"]] = 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 VoiceAgentHandoffGraphConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A customer-supplied handoff graph. + + :ivar max_transfers: The maximum number of successful transfers in the session. + :vartype max_transfers: int + :ivar max_attempts: The maximum number of transfer attempts in the session. + :vartype max_attempts: int + :ivar nodes: The explicitly configured handoff targets. Required. + :vartype nodes: list[~azure.ai.voiceagents.models.VoiceAgentHandoffNodeConfig] + :ivar edges: The directed transitions between handoff nodes. Required. + :vartype edges: list[~azure.ai.voiceagents.models.VoiceAgentHandoffEdgeConfig] + """ + + max_transfers: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The maximum number of successful transfers in the session.""" + max_attempts: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The maximum number of transfer attempts in the session.""" + nodes: list["_models.VoiceAgentHandoffNodeConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The explicitly configured handoff targets. Required.""" + edges: list["_models.VoiceAgentHandoffEdgeConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The directed transitions between handoff nodes. Required.""" + + @overload + def __init__( + self, + *, + nodes: list["_models.VoiceAgentHandoffNodeConfig"], + edges: list["_models.VoiceAgentHandoffEdgeConfig"], + max_transfers: Optional[int] = None, + 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 VoiceAgentHandoffNodeConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A configured handoff target and its node-scoped behavior. + + :ivar id: The node identifier. Required. + :vartype id: str + :ivar description: A non-empty description used to select this target. Required. + :vartype description: str + :ivar config: Session behavior applied after transferring to this node. Required. + :vartype config: ~azure.ai.voiceagents.models.VoiceAgentHandoffNodeSessionConfig + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The node identifier. Required.""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A non-empty description used to select this target. Required.""" + config: "_models.VoiceAgentHandoffNodeSessionConfig" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Session behavior applied after transferring to this node. Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + description: str, + config: "_models.VoiceAgentHandoffNodeSessionConfig", + ) -> 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 VoiceAgentHandoffNodeSessionConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Session behavior applied at a handoff target. + + :ivar model: The target model, when different from the current node. + :vartype model: str + :ivar instructions: Instructions applied at the target node. + :vartype instructions: str + :ivar tools: Tools available at the target node. + :vartype tools: list[~azure.ai.voiceagents.models.RealtimeFunctionTool or + ~azure.ai.voiceagents.models.VoiceAgentSessionMcpTool or + ~azure.ai.voiceagents.models.VoiceToolboxTool or ~azure.ai.voiceagents.models.VoiceSystemTool] + :ivar tool_choice: Tool-selection behavior at the target node. Is either a Union[str, + "_models.ToolChoiceOptions"] type or a RealtimeToolChoiceFunction type. + :vartype tool_choice: str or ~azure.ai.voiceagents.models.ToolChoiceOptions or + ~azure.ai.voiceagents.models.RealtimeToolChoiceFunction + :ivar voice: The target node's voice. Is one of the following types: OpenAIVoice, AzureVoice, + AzureRealtimeNativeVoice + :vartype voice: ~azure.ai.voiceagents.models.OpenAIVoice or + ~azure.ai.voiceagents.models.AzureVoice or + ~azure.ai.voiceagents.models.AzureRealtimeNativeVoice + :ivar temperature: The target node's sampling temperature. + :vartype temperature: float + :ivar max_response_output_tokens: The target node's maximum output-token count. Is either a int + type or a Literal["inf"] type. + :vartype max_response_output_tokens: int or str + :ivar reasoning_effort: The reasoning effort used at the target node. Known values are: "none", + "minimal", "low", "medium", "high", and "xhigh". + :vartype reasoning_effort: str or ~azure.ai.voiceagents.models.VoiceAgentHandoffReasoningEffort + :ivar voice_adaptation: Voice adaptation applied at the target node. + :vartype voice_adaptation: ~azure.ai.voiceagents.models.VoiceAgentVoiceAdaptation + :ivar interim_response: Interim-response settings applied at the target node. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. + :vartype interim_response: ~azure.ai.voiceagents.models.VoiceAgentStaticInterimResponseConfig + or ~azure.ai.voiceagents.models.VoiceAgentLlmInterimResponseConfig + :ivar parallel_tool_calls: Whether the target model may call multiple tools in parallel. + :vartype parallel_tool_calls: bool + """ + + model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The target model, when different from the current node.""" + instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Instructions applied at the target node.""" + tools: Optional[list["_unions.VoiceAgentSessionTool"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Tools available at the target node.""" + tool_choice: Optional["_unions.VoiceAgentToolChoice"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Tool-selection behavior at the target node. Is either a Union[str, + \"_models.ToolChoiceOptions\"] type or a RealtimeToolChoiceFunction type.""" + voice: Optional["_unions.VoiceAgentVoice"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The target node's voice. Is one of the following types: OpenAIVoice, AzureVoice, + AzureRealtimeNativeVoice""" + temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The target node's sampling temperature.""" + max_response_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The target node's maximum output-token count. Is either a int type or a Literal[\"inf\"] type.""" + reasoning_effort: Optional[Union[str, "_models.VoiceAgentHandoffReasoningEffort"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The reasoning effort used at the target node. Known values are: \"none\", \"minimal\", \"low\", + \"medium\", \"high\", and \"xhigh\".""" + voice_adaptation: Optional["_models.VoiceAgentVoiceAdaptation"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Voice adaptation applied at the target node.""" + interim_response: Optional["_unions.VoiceAgentInterimResponse"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Interim-response settings applied at the target node. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type.""" + parallel_tool_calls: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the target model may call multiple tools in parallel.""" + + @overload + def __init__( + self, + *, + model: Optional[str] = None, + instructions: Optional[str] = None, + tools: Optional[list["_unions.VoiceAgentSessionTool"]] = None, + tool_choice: Optional["_unions.VoiceAgentToolChoice"] = None, + voice: Optional["_unions.VoiceAgentVoice"] = None, + temperature: Optional[float] = None, + max_response_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] = None, + reasoning_effort: Optional[Union[str, "_models.VoiceAgentHandoffReasoningEffort"]] = None, + voice_adaptation: Optional["_models.VoiceAgentVoiceAdaptation"] = None, + interim_response: Optional["_unions.VoiceAgentInterimResponse"] = 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 VoiceAgentHandoffNodeState(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Non-sensitive metadata for an effective handoff node. + + :ivar id: The node identifier. Required. + :vartype id: str + :ivar description: The node description. Required. + :vartype description: str + :ivar implicit: Whether the service implicitly created this node. + :vartype implicit: bool + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The node identifier. Required.""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The node description. Required.""" + implicit: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the service implicitly created this node.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + description: str, + implicit: 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 VoiceAgentHandoffState(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The effective handoff state returned by the service. + + :ivar pipeline_family: The runtime pipeline family. Required. Known values are: "cascaded" and + "realtime". + :vartype pipeline_family: str or ~azure.ai.voiceagents.models.VoiceAgentPipelineFamily + :ivar active_node_id: The active node identifier. Required. + :vartype active_node_id: str + :ivar node_generation: The active node generation. Required. + :vartype node_generation: int + :ivar transfer_count: The number of completed transfers. Required. + :vartype transfer_count: int + :ivar attempt_count: The number of transfer attempts. Required. + :vartype attempt_count: int + :ivar available_edge_ids: The edge identifiers currently available to the model. Required. + :vartype available_edge_ids: list[str] + :ivar transfer_tool: The function tool exposed to initiate transfers. Required. + :vartype transfer_tool: ~azure.ai.voiceagents.models.RealtimeFunctionTool + :ivar nodes: The compiled handoff nodes. Required. + :vartype nodes: list[~azure.ai.voiceagents.models.VoiceAgentHandoffNodeState] + :ivar edges: The compiled handoff edges. Required. + :vartype edges: list[~azure.ai.voiceagents.models.VoiceAgentHandoffEdgeState] + """ + + pipeline_family: Union[str, "_models.VoiceAgentPipelineFamily"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The runtime pipeline family. Required. Known values are: \"cascaded\" and \"realtime\".""" + active_node_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The active node identifier. Required.""" + node_generation: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The active node generation. Required.""" + transfer_count: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of completed transfers. Required.""" + attempt_count: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of transfer attempts. Required.""" + available_edge_ids: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The edge identifiers currently available to the model. Required.""" + transfer_tool: "_models.RealtimeFunctionTool" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The function tool exposed to initiate transfers. Required.""" + nodes: list["_models.VoiceAgentHandoffNodeState"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The compiled handoff nodes. Required.""" + edges: list["_models.VoiceAgentHandoffEdgeState"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The compiled handoff edges. Required.""" + + @overload + def __init__( + self, + *, + pipeline_family: Union[str, "_models.VoiceAgentPipelineFamily"], + active_node_id: str, + node_generation: int, + transfer_count: int, + attempt_count: int, + available_edge_ids: list[str], + transfer_tool: "_models.RealtimeFunctionTool", + nodes: list["_models.VoiceAgentHandoffNodeState"], + edges: list["_models.VoiceAgentHandoffEdgeState"], + ) -> 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 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 + + :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.voiceagents.models.VoiceAgentInterimResponseTrigger] + :ivar latency_threshold_ms: The latency threshold in milliseconds. + :vartype latency_threshold_ms: int + """ + + __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[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The latency threshold in milliseconds.""" + + @overload + def __init__( + self, + *, + type: str, + triggers: Optional[list[Union[str, "_models.VoiceAgentInterimResponseTrigger"]]] = None, + latency_threshold_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) + + +class VoiceAgentLlmInterimResponseConfig( + VoiceAgentInterimResponseConfig, discriminator="llm_interim_response" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An interim response generated by a language model. + + :ivar triggers: Conditions that may trigger one interim response. + :vartype triggers: list[str or ~azure.ai.voiceagents.models.VoiceAgentInterimResponseTrigger] + :ivar latency_threshold_ms: The latency threshold in milliseconds. + :vartype latency_threshold_ms: int + :ivar type: Required. Default value is "llm_interim_response". + :vartype type: str + :ivar model: The model used to generate interim responses. + :vartype model: str + :ivar instructions: Optional instructions for generating interim responses. + :vartype instructions: str + :ivar max_completion_tokens: The maximum completion-token count for an interim response. + :vartype max_completion_tokens: int + """ + + type: Literal["llm_interim_response"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"llm_interim_response\".""" + model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The model used to generate interim responses.""" + instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional instructions for generating interim responses.""" + max_completion_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The maximum completion-token count for an interim response.""" + + @overload + def __init__( + self, + *, + triggers: Optional[list[Union[str, "_models.VoiceAgentInterimResponseTrigger"]]] = None, + latency_threshold_ms: Optional[int] = None, + model: Optional[str] = None, + instructions: Optional[str] = None, + max_completion_tokens: 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 = "llm_interim_response" # type: ignore + + +class VoiceAgentMcpAssignedManagedIdentity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A managed identity used to authorize a voice-agent MCP connection. + + :ivar type: Required. Default value is "assigned_managed_identity". + :vartype type: str + :ivar audience: Required. + :vartype audience: str + :ivar client_id: + :vartype client_id: str + """ + + type: Literal["assigned_managed_identity"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"assigned_managed_identity\".""" + audience: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + client_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + audience: str, + client_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["assigned_managed_identity"] = "assigned_managed_identity" + + +class VoiceAgentMcpTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An MCP tool available to a voice agent. + + :ivar type: The type of the MCP tool. Always ``mcp``. Required. MCP. + :vartype type: str or ~azure.ai.voiceagents.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_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.voiceagents.models.MCPToolFilter + :ivar allowed_callers: + :vartype allowed_callers: list[str or ~azure.ai.voiceagents.models.CallableToolAllowedCaller] + :ivar require_approval: Is one of the following types: MCPToolRequireApproval, + Literal["always"], Literal["never"] + :vartype require_approval: ~azure.ai.voiceagents.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.voiceagents.models.ToolConfig] + :ivar server_url: The URL for the MCP server. + :vartype server_url: str + :ivar response_scheduling: When the MCP invocation creates a follow-up response. Defaults to + ``when_idle`` so the agent continues after the tool call completes. Known values are: "silent", + "when_idle", "interrupt", and "skip_if_busy". + :vartype response_scheduling: str or + ~azure.ai.voiceagents.models.VoiceAgentMcpResponseScheduling + """ + + type: Literal[ToolType.MCP] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """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_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.""" + server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The URL for the MCP server.""" + response_scheduling: Optional[Union[str, "_models.VoiceAgentMcpResponseScheduling"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """When the MCP invocation creates a follow-up response. Defaults to ``when_idle`` so the agent + continues after the tool call completes. Known values are: \"silent\", \"when_idle\", + \"interrupt\", and \"skip_if_busy\".""" + + @overload + def __init__( + self, + *, + type: Literal[ToolType.MCP], + server_label: str, + 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, + server_url: Optional[str] = None, + response_scheduling: Optional[Union[str, "_models.VoiceAgentMcpResponseScheduling"]] = 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 VoiceAgentObject(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A voice agent. Mirrors ``AgentObject``, but its latest version is a + ``VoiceAgentVersionObject``. + + :ivar object: The object type, which is always 'agent'. Required. AGENT. + :vartype object: str or ~azure.ai.voiceagents.models.AGENT + :ivar id: The unique identifier of the agent. Required. + :vartype id: str + :ivar name: The name of the agent. Required. + :vartype name: str + :ivar state: The operational state of the agent. Controls whether the agent endpoint accepts or + rejects requests. Required. Known values are: "enabled" and "disabled". + :vartype state: str or ~azure.ai.voiceagents.models.AgentState + :ivar state_source: The source of the agent's operational state. When the agent is disabled, + indicates where the disabled state originates from. Empty when not derived from a specific + source. Known values are: "agent_instance_identity" and "agent_blueprint". + :vartype state_source: str or ~azure.ai.voiceagents.models.AgentStateSource + :ivar agent_endpoint: The endpoint configuration for the agent. + :vartype agent_endpoint: ~azure.ai.voiceagents.models.AgentEndpointConfig + :ivar instance_identity: The instance identity of the agent. + :vartype instance_identity: ~azure.ai.voiceagents.models.AgentIdentity + :ivar blueprint: The blueprint for the agent. + :vartype blueprint: ~azure.ai.voiceagents.models.AgentIdentity + :ivar blueprint_reference: The blueprint for the agent. + :vartype blueprint_reference: ~azure.ai.voiceagents.models.AgentBlueprintReference + :ivar agent_card: + :vartype agent_card: ~azure.ai.voiceagents.models.AgentCard + :ivar versions: The latest version of the voice agent. Required. + :vartype versions: ~azure.ai.voiceagents.models.VoiceAgentObjectVersions + """ + + object: Literal[AgentObjectType.AGENT] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The object type, which is always 'agent'. Required. AGENT.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the agent. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the agent. Required.""" + state: Union[str, "_models.AgentState"] = rest_field(visibility=["read"]) + """The operational state of the agent. Controls whether the agent endpoint accepts or rejects + requests. Required. Known values are: \"enabled\" and \"disabled\".""" + state_source: Optional[Union[str, "_models.AgentStateSource"]] = rest_field(visibility=["read"]) + """The source of the agent's operational state. When the agent is disabled, indicates where the + disabled state originates from. Empty when not derived from a specific source. Known values + are: \"agent_instance_identity\" and \"agent_blueprint\".""" + agent_endpoint: Optional["_models.AgentEndpointConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The endpoint configuration for the agent.""" + instance_identity: Optional["_models.AgentIdentity"] = rest_field(visibility=["read"]) + """The instance identity of the agent.""" + blueprint: Optional["_models.AgentIdentity"] = rest_field(visibility=["read"]) + """The blueprint for the agent.""" + blueprint_reference: Optional["_models.AgentBlueprintReference"] = rest_field(visibility=["read"]) + """The blueprint for the agent.""" + agent_card: Optional["_models.AgentCard"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + versions: "_models.VoiceAgentObjectVersions" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The latest version of the voice agent. Required.""" + + @overload + def __init__( + self, + *, + object: Literal[AgentObjectType.AGENT], + id: str, # pylint: disable=redefined-builtin + name: str, + versions: "_models.VoiceAgentObjectVersions", + agent_endpoint: Optional["_models.AgentEndpointConfig"] = None, + agent_card: Optional["_models.AgentCard"] = 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 VoiceAgentObjectVersions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """VoiceAgentObjectVersions. + + :ivar latest: Required. + :vartype latest: ~azure.ai.voiceagents.models.VoiceAgentVersionObject + """ + + latest: "_models.VoiceAgentVersionObject" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + latest: "_models.VoiceAgentVersionObject", + ) -> 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 VoiceAgentRealtimeResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A realtime response returned by the voice-agent service. + + :ivar object: The object type. Always ``realtime.response``. Required. Default value is + "realtime.response". + :vartype object: str + :ivar id: The response identifier. Required. + :vartype id: str + :ivar status: The response lifecycle status. Required. Known values are: "in_progress", + "completed", "cancelled", "incomplete", and "failed". + :vartype status: str or ~azure.ai.voiceagents.models.VoiceAgentResponseStatus + :ivar status_details: Additional details for a terminal response status. Required. + :vartype status_details: ~azure.ai.voiceagents.models.RealtimeResponseStatusDetails + :ivar output: The items produced by the response. Required. + :vartype output: list[~azure.ai.voiceagents.models.RealtimeConversationItemMessageSystem or + ~azure.ai.voiceagents.models.RealtimeConversationItemMessageUser or + ~azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistant or + ~azure.ai.voiceagents.models.VoiceFunctionCallItem or + ~azure.ai.voiceagents.models.VoiceFunctionCallOutputItem or + ~azure.ai.voiceagents.models.VoiceMcpListToolsItem or + ~azure.ai.voiceagents.models.VoiceMcpCallItem or + ~azure.ai.voiceagents.models.VoiceMcpApprovalRequestItem or + ~azure.ai.voiceagents.models.VoiceMcpApprovalResponseItem or + ~azure.ai.voiceagents.models.VoiceAgentWorkflowActionItem or + ~azure.ai.voiceagents.models.VoiceAgentWebSearchCallItem or + ~azure.ai.voiceagents.models.VoiceAgentFileSearchCallItem] + :ivar usage: Token usage for the response. Required. + :vartype usage: ~azure.ai.voiceagents.models.RealtimeResponseUsage + :ivar estimated_cost: The best-effort response cost estimate. Returned only when cost output is + enabled. + :vartype estimated_cost: ~azure.ai.voiceagents.models.VoiceAgentEstimatedCost + :ivar conversation_id: The conversation identifier, or null for an out-of-band response. + :vartype conversation_id: str + :ivar modalities: The modalities used by the response. + :vartype modalities: list[str or ~azure.ai.voiceagents.models.VoiceOutputModality] + :ivar voice: The voice used by the response. Is one of the following types: OpenAIVoice, + AzureVoice, AzureRealtimeNativeVoice + :vartype voice: ~azure.ai.voiceagents.models.OpenAIVoice or + ~azure.ai.voiceagents.models.AzureVoice or + ~azure.ai.voiceagents.models.AzureRealtimeNativeVoice + :ivar output_audio_format: The output-audio format used by the response. Known values are: + "pcm16", "pcm16_8000hz", "pcm16_16000hz", "pcm16_22050hz", "pcm16_24000hz", "pcm16_44100hz", + "pcm16_48000hz", "g711_ulaw", "g711_alaw", "mp3", "mp3_24khz_48kbps", "mp3_24khz_96kbps", and + "mp3_24khz_160kbps". + :vartype output_audio_format: str or ~azure.ai.voiceagents.models.VoiceAgentResponseAudioFormat + :ivar temperature: The sampling temperature used by the response. + :vartype temperature: float + :ivar max_output_tokens: The maximum output-token count used by the response. Is either a int + type or a Literal["inf"] type. + :vartype max_output_tokens: int or str + :ivar metadata: String key-value metadata attached to the response. + :vartype metadata: dict[str, str] + """ + + object: Literal["realtime.response"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The object type. Always ``realtime.response``. Required. Default value is + \"realtime.response\".""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The response identifier. Required.""" + status: Union[str, "_models.VoiceAgentResponseStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The response lifecycle status. Required. Known values are: \"in_progress\", \"completed\", + \"cancelled\", \"incomplete\", and \"failed\".""" + status_details: "_models.RealtimeResponseStatusDetails" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Additional details for a terminal response status. Required.""" + output: list["_unions.VoiceAgentResponseItem"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The items produced by the response. Required.""" + usage: "_models.RealtimeResponseUsage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Token usage for the response. Required.""" + estimated_cost: Optional["_models.VoiceAgentEstimatedCost"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The best-effort response cost estimate. Returned only when cost output is enabled.""" + conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The conversation identifier, or null for an out-of-band response.""" + modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The modalities used by the response.""" + voice: Optional["_unions.VoiceAgentVoice"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The voice used by the response. Is one of the following types: OpenAIVoice, AzureVoice, + AzureRealtimeNativeVoice""" + output_audio_format: Optional[Union[str, "_models.VoiceAgentResponseAudioFormat"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The output-audio format used by the response. Known values are: \"pcm16\", \"pcm16_8000hz\", + \"pcm16_16000hz\", \"pcm16_22050hz\", \"pcm16_24000hz\", \"pcm16_44100hz\", \"pcm16_48000hz\", + \"g711_ulaw\", \"g711_alaw\", \"mp3\", \"mp3_24khz_48kbps\", \"mp3_24khz_96kbps\", and + \"mp3_24khz_160kbps\".""" + temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sampling temperature used by the response.""" + max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum output-token count used by the response. Is either a int type or a Literal[\"inf\"] + type.""" + metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """String key-value metadata attached to the response.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + status: Union[str, "_models.VoiceAgentResponseStatus"], + status_details: "_models.RealtimeResponseStatusDetails", + output: list["_unions.VoiceAgentResponseItem"], + usage: "_models.RealtimeResponseUsage", + estimated_cost: Optional["_models.VoiceAgentEstimatedCost"] = None, + conversation_id: Optional[str] = None, + modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = None, + voice: Optional["_unions.VoiceAgentVoice"] = None, + output_audio_format: Optional[Union[str, "_models.VoiceAgentResponseAudioFormat"]] = None, + temperature: Optional[float] = None, + max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] = None, + metadata: 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.object: Literal["realtime.response"] = "realtime.response" + + +class VoiceAgentResponseCreateAudio(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Output-audio settings applied to one ``response.create`` request. + + :ivar output: The response-specific output-audio settings. + :vartype output: ~azure.ai.voiceagents.models.VoiceAgentSessionUpdateAudioOutput + """ + + output: Optional["_models.VoiceAgentSessionUpdateAudioOutput"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The response-specific output-audio settings.""" + + @overload + def __init__( + self, + *, + output: Optional["_models.VoiceAgentSessionUpdateAudioOutput"] = 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 VoiceAgentResponseCreateParams(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Parameters accepted by a voice-agent ``response.create`` event. + + :ivar instructions: The default system instructions (i.e. system message) prepended to model + calls. This field allows the client to guide the model on desired responses. The model can be + instructed on response content and format, (e.g. "be extremely succinct", "act friendly", "here + are examples of good responses") and on audio behavior (e.g. "talk quickly", "inject emotion + into your voice", "laugh frequently"). The instructions are not guaranteed to be followed by + the model, but they provide guidance to the model on the desired behavior. Note that the server + sets default instructions which will be used if this field is not set and are visible in the + ``session.created`` event at the start of the session. + :vartype instructions: str + :ivar tools: Tools available to the model. + :vartype tools: list[~azure.ai.voiceagents.models.RealtimeFunctionTool or + ~azure.ai.voiceagents.models.MCPTool] + :ivar tool_choice: How the model chooses tools. Provide one of the string modes or force a + specific function/MCP tool. Is one of the following types: Union[str, + "_models.ToolChoiceOptions"], ToolChoiceFunction, ToolChoiceMCP + :vartype tool_choice: str or ~azure.ai.voiceagents.models.ToolChoiceOptions or + ~azure.ai.voiceagents.models.ToolChoiceFunction or ~azure.ai.voiceagents.models.ToolChoiceMCP + :ivar parallel_tool_calls: Whether the model may call multiple tools in parallel. Only + supported by reasoning Realtime models such as ``gpt-realtime-2``. + :vartype parallel_tool_calls: bool + :ivar reasoning: + :vartype reasoning: ~azure.ai.voiceagents.models.RealtimeReasoning + :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, + inclusive of tool calls. Provide an integer between 1 and 4096 to limit output tokens, or + ``inf`` for the maximum available tokens for a given model. Defaults to ``inf``. Is either a + int type or a Literal["inf"] type. + :vartype max_output_tokens: int or str + :ivar conversation: Controls which conversation the response is added to. Currently supports + ``auto`` and ``none``, with ``auto`` as the default value. The ``auto`` value means that the + contents of the response will be added to the default conversation. Set this to ``none`` to + create an out-of-band response which will not add items to default conversation. Is one of the + following types: Literal["auto"], Literal["none"], str + :vartype conversation: str or str or str + :ivar metadata: + :vartype metadata: ~azure.ai.voiceagents.models.Metadata + :ivar input: Input items to include in the prompt for the model. Using this field creates a new + context for this Response instead of using the default conversation. An empty array ``[]`` will + clear the context for this Response. Note that this can include references to items that + previously appeared in the session using their id. + :vartype input: list[~azure.ai.voiceagents.models.RealtimeConversationItem] + :ivar output_modalities: Modalities that the response may return. + :vartype output_modalities: list[str or ~azure.ai.voiceagents.models.VoiceOutputModality] + :ivar audio: Response-specific audio settings. + :vartype audio: ~azure.ai.voiceagents.models.VoiceAgentResponseCreateAudio + :ivar pre_generated_assistant_message: A pre-generated assistant message used to begin the + response. + :vartype pre_generated_assistant_message: + ~azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistant + :ivar interim_response: Interim-response settings for this response. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. + :vartype interim_response: ~azure.ai.voiceagents.models.VoiceAgentStaticInterimResponseConfig + or ~azure.ai.voiceagents.models.VoiceAgentLlmInterimResponseConfig + """ + + instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The default system instructions (i.e. system message) prepended to model calls. This field + allows the client to guide the model on desired responses. The model can be instructed on + response content and format, (e.g. \"be extremely succinct\", \"act friendly\", \"here are + examples of good responses\") and on audio behavior (e.g. \"talk quickly\", \"inject emotion + into your voice\", \"laugh frequently\"). The instructions are not guaranteed to be followed by + the model, but they provide guidance to the model on the desired behavior. Note that the server + sets default instructions which will be used if this field is not set and are visible in the + ``session.created`` event at the start of the session.""" + tools: Optional[list[Union["_models.RealtimeFunctionTool", "_models.MCPTool"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Tools available to the model.""" + tool_choice: Optional[ + Union[str, "_models.ToolChoiceOptions", "_models.ToolChoiceFunction", "_models.ToolChoiceMCP"] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """How the model chooses tools. Provide one of the string modes or force a specific function/MCP + tool. Is one of the following types: Union[str, \"_models.ToolChoiceOptions\"], + ToolChoiceFunction, ToolChoiceMCP""" + parallel_tool_calls: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the model may call multiple tools in parallel. Only supported by reasoning Realtime + models such as ``gpt-realtime-2``.""" + reasoning: Optional["_models.RealtimeReasoning"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + max_output_tokens: Optional[Union[int, Literal["inf"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Maximum number of output tokens for a single assistant response, inclusive of tool calls. + Provide an integer between 1 and 4096 to limit output tokens, or ``inf`` for the maximum + available tokens for a given model. Defaults to ``inf``. Is either a int type or a + Literal[\"inf\"] type.""" + conversation: Optional[Union[Literal["auto"], Literal["none"], str]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Controls which conversation the response is added to. Currently supports ``auto`` and ``none``, + with ``auto`` as the default value. The ``auto`` value means that the contents of the response + will be added to the default conversation. Set this to ``none`` to create an out-of-band + response which will not add items to default conversation. Is one of the following types: + Literal[\"auto\"], Literal[\"none\"], str""" + metadata: Optional["_models.Metadata"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + input: Optional[list["_models.RealtimeConversationItem"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Input items to include in the prompt for the model. Using this field creates a new context for + this Response instead of using the default conversation. An empty array ``[]`` will clear the + context for this Response. Note that this can include references to items that previously + appeared in the session using their id.""" + output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Modalities that the response may return.""" + audio: Optional["_models.VoiceAgentResponseCreateAudio"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Response-specific audio settings.""" + pre_generated_assistant_message: Optional["_models.RealtimeConversationItemMessageAssistant"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """A pre-generated assistant message used to begin the response.""" + interim_response: Optional["_unions.VoiceAgentInterimResponse"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Interim-response settings for this response. Is either a VoiceAgentStaticInterimResponseConfig + type or a VoiceAgentLlmInterimResponseConfig type.""" + + @overload + def __init__( + self, + *, + instructions: Optional[str] = None, + tools: Optional[list[Union["_models.RealtimeFunctionTool", "_models.MCPTool"]]] = None, + tool_choice: Optional[ + Union[str, "_models.ToolChoiceOptions", "_models.ToolChoiceFunction", "_models.ToolChoiceMCP"] + ] = None, + parallel_tool_calls: Optional[bool] = None, + reasoning: Optional["_models.RealtimeReasoning"] = None, + max_output_tokens: Optional[Union[int, Literal["inf"]]] = None, + conversation: Optional[Union[Literal["auto"], Literal["none"], str]] = None, + metadata: Optional["_models.Metadata"] = None, + input: Optional[list["_models.RealtimeConversationItem"]] = None, + output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = None, + audio: Optional["_models.VoiceAgentResponseCreateAudio"] = None, + pre_generated_assistant_message: Optional["_models.RealtimeConversationItemMessageAssistant"] = None, + interim_response: Optional["_unions.VoiceAgentInterimResponse"] = 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 VoiceAgentResponseEventAudioContentPart(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An audio part in a ``response.content_part.*`` server event. + + :ivar type: Required. Default value is "audio". + :vartype type: str + :ivar transcript: Required. + :vartype transcript: str + :ivar annotations: + :vartype annotations: any + :ivar audio: + :vartype audio: str + :ivar format: + :vartype format: ~azure.ai.voiceagents.models.VoiceAudioFormat + """ + + type: Literal["audio"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"audio\".""" + transcript: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + annotations: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + audio: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + format: Optional["_models.VoiceAudioFormat"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + transcript: str, + annotations: Optional[Any] = None, + audio: Optional[str] = None, + format: Optional["_models.VoiceAudioFormat"] = 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["audio"] = "audio" + + +class VoiceAgentResponseEventTextContentPart(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A text part in a ``response.content_part.*`` server event. + + :ivar type: Required. Default value is "text". + :vartype type: str + :ivar text: Required. + :vartype text: str + """ + + type: Literal["text"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"text\".""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """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["text"] = "text" + + +class VoiceAgentSemanticVadTurnDetection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """OpenAI semantic VAD turn-detection settings. + + :ivar eagerness: Is one of the following types: Literal["low"], Literal["medium"], + Literal["high"], Literal["auto"] + :vartype eagerness: str or str or str or str + :ivar create_response: + :vartype create_response: bool + :ivar interrupt_response: + :vartype interrupt_response: bool + :ivar type: Required. Semantic voice activity detection. + :vartype type: str or ~azure.ai.voiceagents.models.SEMANTIC_VAD + :ivar auto_truncate: + :vartype auto_truncate: bool + """ + + eagerness: Optional[Literal["low", "medium", "high", "auto"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is one of the following types: Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"], + Literal[\"auto\"]""" + create_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + interrupt_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Semantic voice activity detection.""" + auto_truncate: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD], + eagerness: Optional[Literal["low", "medium", "high", "auto"]] = None, + create_response: Optional[bool] = None, + interrupt_response: Optional[bool] = None, + auto_truncate: 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 VoiceAgentServerEventConversationCreated(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``conversation.created`` server event emitted when a voice-agent connection starts. + + :ivar type: Required. Default value is "conversation.created". + :vartype type: str + :ivar conversation_id: The identifier of the created conversation. Required. + :vartype conversation_id: str + """ + + type: Literal["conversation.created"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"conversation.created\".""" + conversation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The identifier of the created conversation. Required.""" + + @overload + def __init__( + self, + *, + conversation_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["conversation.created"] = "conversation.created" + + +class VoiceAgentServerEventConversationItemAdded( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``conversation.item.added`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``conversation.item.added``. Required. + CONVERSATION_ITEM_ADDED. + :vartype type: str or ~azure.ai.voiceagents.models.CONVERSATION_ITEM_ADDED + :ivar previous_item_id: + :vartype previous_item_id: str + :ivar item: The item added to the conversation. Required. Is one of the following types: + "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, + VoiceAgentFileSearchCallItem + :vartype item: ~azure.ai.voiceagents.models.RealtimeConversationItemMessageSystem or + ~azure.ai.voiceagents.models.RealtimeConversationItemMessageUser or + ~azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistant or + ~azure.ai.voiceagents.models.VoiceFunctionCallItem or + ~azure.ai.voiceagents.models.VoiceFunctionCallOutputItem or + ~azure.ai.voiceagents.models.VoiceMcpListToolsItem or + ~azure.ai.voiceagents.models.VoiceMcpCallItem or + ~azure.ai.voiceagents.models.VoiceMcpApprovalRequestItem or + ~azure.ai.voiceagents.models.VoiceMcpApprovalResponseItem or + ~azure.ai.voiceagents.models.VoiceAgentWorkflowActionItem or + ~azure.ai.voiceagents.models.VoiceAgentWebSearchCallItem or + ~azure.ai.voiceagents.models.VoiceAgentFileSearchCallItem + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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: "_unions.VoiceAgentResponseItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The item added to the conversation. Required. Is one of the following types: + \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, + VoiceAgentFileSearchCallItem""" + + @overload + def __init__( + self, + *, + event_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED], + item: "_unions.VoiceAgentResponseItem", + previous_item_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 VoiceAgentServerEventConversationItemCreated( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``conversation.item.created`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``conversation.item.created``. Required. + CONVERSATION_ITEM_CREATED. + :vartype type: str or ~azure.ai.voiceagents.models.CONVERSATION_ITEM_CREATED + :ivar previous_item_id: + :vartype previous_item_id: str + :ivar item: The created conversation item. Required. Is one of the following types: + "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, + VoiceAgentFileSearchCallItem + :vartype item: ~azure.ai.voiceagents.models.RealtimeConversationItemMessageSystem or + ~azure.ai.voiceagents.models.RealtimeConversationItemMessageUser or + ~azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistant or + ~azure.ai.voiceagents.models.VoiceFunctionCallItem or + ~azure.ai.voiceagents.models.VoiceFunctionCallOutputItem or + ~azure.ai.voiceagents.models.VoiceMcpListToolsItem or + ~azure.ai.voiceagents.models.VoiceMcpCallItem or + ~azure.ai.voiceagents.models.VoiceMcpApprovalRequestItem or + ~azure.ai.voiceagents.models.VoiceMcpApprovalResponseItem or + ~azure.ai.voiceagents.models.VoiceAgentWorkflowActionItem or + ~azure.ai.voiceagents.models.VoiceAgentWebSearchCallItem or + ~azure.ai.voiceagents.models.VoiceAgentFileSearchCallItem + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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: "_unions.VoiceAgentResponseItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The created conversation item. Required. Is one of the following types: + \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, + VoiceAgentFileSearchCallItem""" + + @overload + def __init__( + self, + *, + event_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED], + item: "_unions.VoiceAgentResponseItem", + previous_item_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 VoiceAgentServerEventConversationItemDeleted( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``conversation.item.deleted`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``conversation.item.deleted``. Required. + CONVERSATION_ITEM_DELETED. + :vartype type: str or ~azure.ai.voiceagents.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.CONVERSATION_ITEM_DELETED] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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 item that was deleted. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED], + item_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 VoiceAgentServerEventConversationItemDone( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``conversation.item.done`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``conversation.item.done``. Required. + CONVERSATION_ITEM_DONE. + :vartype type: str or ~azure.ai.voiceagents.models.CONVERSATION_ITEM_DONE + :ivar previous_item_id: + :vartype previous_item_id: str + :ivar item: The completed conversation item. Required. Is one of the following types: + "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, + VoiceAgentFileSearchCallItem + :vartype item: ~azure.ai.voiceagents.models.RealtimeConversationItemMessageSystem or + ~azure.ai.voiceagents.models.RealtimeConversationItemMessageUser or + ~azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistant or + ~azure.ai.voiceagents.models.VoiceFunctionCallItem or + ~azure.ai.voiceagents.models.VoiceFunctionCallOutputItem or + ~azure.ai.voiceagents.models.VoiceMcpListToolsItem or + ~azure.ai.voiceagents.models.VoiceMcpCallItem or + ~azure.ai.voiceagents.models.VoiceMcpApprovalRequestItem or + ~azure.ai.voiceagents.models.VoiceMcpApprovalResponseItem or + ~azure.ai.voiceagents.models.VoiceAgentWorkflowActionItem or + ~azure.ai.voiceagents.models.VoiceAgentWebSearchCallItem or + ~azure.ai.voiceagents.models.VoiceAgentFileSearchCallItem + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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: "_unions.VoiceAgentResponseItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The completed conversation item. Required. Is one of the following types: + \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, + VoiceAgentFileSearchCallItem""" + + @overload + def __init__( + self, + *, + event_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE], + item: "_unions.VoiceAgentResponseItem", + previous_item_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 VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``conversation.item.input_audio_transcription.completed`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :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.voiceagents.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 logprobs: + :vartype logprobs: list[~azure.ai.voiceagents.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.voiceagents.models.TranscriptTextUsageTokens or + ~azure.ai.voiceagents.models.TranscriptTextUsageDuration + :ivar phrases: Phrase-level transcription timing and confidence details. + :vartype phrases: list[~azure.ai.voiceagents.models.VoiceAgentTranscriptionPhrase] + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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.""" + 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, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED], + item_id: str, + content_index: int, + transcript: str, + usage: Union["_models.TranscriptTextUsageTokens", "_models.TranscriptTextUsageDuration"], + logprobs: Optional[list["_models.LogProbProperties"]] = None, + phrases: Optional[list["_models.VoiceAgentTranscriptionPhrase"]] = 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 VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``conversation.item.input_audio_transcription.delta`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :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.voiceagents.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.voiceagents.models.LogProbProperties] + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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"] + ) + + @overload + def __init__( + self, + *, + event_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA], + item_id: str, + content_index: Optional[int] = None, + delta: Optional[str] = None, + logprobs: Optional[list["_models.LogProbProperties"]] = 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 VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``conversation.item.input_audio_transcription.failed`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :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.voiceagents.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.voiceagents.models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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.""" + + @overload + def __init__( + self, + *, + event_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED], + item_id: str, + content_index: int, + error: "_models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError", + ) -> 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 VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``conversation.item.input_audio_transcription.segment`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :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.voiceagents.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.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT], + item_id: str, + content_index: int, + text: str, + id: str, # pylint: disable=redefined-builtin + speaker: str, + start: float, + end: 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 VoiceAgentServerEventConversationItemRetrieved( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``conversation.item.retrieved`` server event. + + :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.voiceagents.models.CONVERSATION_ITEM_RETRIEVED + :ivar item: The retrieved conversation item. Required. Is one of the following types: + "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, + VoiceAgentFileSearchCallItem + :vartype item: ~azure.ai.voiceagents.models.RealtimeConversationItemMessageSystem or + ~azure.ai.voiceagents.models.RealtimeConversationItemMessageUser or + ~azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistant or + ~azure.ai.voiceagents.models.VoiceFunctionCallItem or + ~azure.ai.voiceagents.models.VoiceFunctionCallOutputItem or + ~azure.ai.voiceagents.models.VoiceMcpListToolsItem or + ~azure.ai.voiceagents.models.VoiceMcpCallItem or + ~azure.ai.voiceagents.models.VoiceMcpApprovalRequestItem or + ~azure.ai.voiceagents.models.VoiceMcpApprovalResponseItem or + ~azure.ai.voiceagents.models.VoiceAgentWorkflowActionItem or + ~azure.ai.voiceagents.models.VoiceAgentWebSearchCallItem or + ~azure.ai.voiceagents.models.VoiceAgentFileSearchCallItem + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The event type, must be ``conversation.item.retrieved``. Required. CONVERSATION_ITEM_RETRIEVED.""" + item: "_unions.VoiceAgentResponseItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The retrieved conversation item. Required. Is one of the following types: + \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, + VoiceAgentFileSearchCallItem""" + + @overload + def __init__( + self, + *, + event_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED], + item: "_unions.VoiceAgentResponseItem", + ) -> 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 VoiceAgentServerEventConversationItemTruncated( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``conversation.item.truncated`` server event. + + :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.voiceagents.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.voiceagents.models.RealtimeConversationItemMessageAssistant + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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.RealtimeConversationItemMessageAssistant"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The assistant message after truncation, when the service returns the updated item.""" + + @overload + def __init__( + self, + *, + event_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED], + item_id: str, + content_index: int, + audio_end_ms: int, + item: Optional["_models.RealtimeConversationItemMessageAssistant"] = 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 VoiceAgentServerEventError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``error`` server event. + + :ivar event_id: The unique identifier of the event. Required. + :vartype event_id: str + :ivar type: Required. Default value is "error". + :vartype type: str + :ivar error: Details of the error. Required. + :vartype error: ~azure.ai.voiceagents.models.VoiceAgentServerEventErrorDetails + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the event. Required.""" + type: Literal["error"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"error\".""" + error: "_models.VoiceAgentServerEventErrorDetails" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Details of the error. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + error: "_models.VoiceAgentServerEventErrorDetails", + ) -> 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["error"] = "error" + + +class VoiceAgentServerEventErrorDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Details of a voice-agent WebSocket error. + + :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 tool_label: The configured label of a tool that could not be resolved. + :vartype tool_label: str + :ivar tool_type: The configured type of a tool that could not be resolved. + :vartype tool_type: 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"]) + tool_label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The configured label of a tool that could not be resolved.""" + tool_type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The configured type of a tool that could not be resolved.""" + + @overload + def __init__( + self, + *, + type: str, + message: str, + code: Optional[str] = None, + param: Optional[str] = None, + event_id: Optional[str] = None, + tool_label: Optional[str] = None, + tool_type: 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 VoiceAgentServerEventFileSearchCallCompleted( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.file_search_call.completed`` server event. + + :ivar type: Required. Default value is "response.file_search_call.completed". + :vartype type: str + :ivar event_id: + :vartype event_id: str + :ivar response_id: + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar sequence_number: Required. + :vartype sequence_number: int + """ + + type: Literal["response.file_search_call.completed"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Default value is \"response.file_search_call.completed\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + item_id: str, + output_index: int, + sequence_number: int, + event_id: Optional[str] = None, + 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["response.file_search_call.completed"] = "response.file_search_call.completed" + + +class VoiceAgentServerEventFileSearchCallInProgress( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.file_search_call.in_progress`` server event. + + :ivar type: Required. Default value is "response.file_search_call.in_progress". + :vartype type: str + :ivar event_id: + :vartype event_id: str + :ivar response_id: + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar sequence_number: Required. + :vartype sequence_number: int + """ + + type: Literal["response.file_search_call.in_progress"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Default value is \"response.file_search_call.in_progress\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + item_id: str, + output_index: int, + sequence_number: int, + event_id: Optional[str] = None, + 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["response.file_search_call.in_progress"] = "response.file_search_call.in_progress" + + +class VoiceAgentServerEventFileSearchCallSearching( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.file_search_call.searching`` server event. + + :ivar type: Required. Default value is "response.file_search_call.searching". + :vartype type: str + :ivar event_id: + :vartype event_id: str + :ivar response_id: + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar sequence_number: Required. + :vartype sequence_number: int + """ + + type: Literal["response.file_search_call.searching"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Default value is \"response.file_search_call.searching\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + item_id: str, + output_index: int, + sequence_number: int, + event_id: Optional[str] = None, + 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["response.file_search_call.searching"] = "response.file_search_call.searching" + + +class VoiceAgentServerEventInputAudioBufferCleared( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``input_audio_buffer.cleared`` server event. + + :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.voiceagents.models.INPUT_AUDIO_BUFFER_CLEARED + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The event type, must be ``input_audio_buffer.cleared``. Required. INPUT_AUDIO_BUFFER_CLEARED.""" + + @overload + def __init__( + self, + *, + event_id: str, + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED], + ) -> 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 VoiceAgentServerEventInputAudioBufferCommitted( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``input_audio_buffer.committed`` server event. + + :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.voiceagents.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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + event_id: str, + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED], + item_id: str, + previous_item_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 VoiceAgentServerEventInputAudioBufferSpeechStarted( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``input_audio_buffer.speech_started`` server event. + + :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.voiceagents.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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + event_id: str, + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED], + audio_start_ms: int, + item_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 VoiceAgentServerEventInputAudioBufferSpeechStopped( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``input_audio_buffer.speech_stopped`` server event. + + :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.voiceagents.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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + event_id: str, + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED], + audio_end_ms: int, + item_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 VoiceAgentServerEventInputAudioBufferTimeoutTriggered( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``input_audio_buffer.timeout_triggered`` server event. + + :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.voiceagents.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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + event_id: str, + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED], + audio_start_ms: int, + audio_end_ms: int, + item_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 VoiceAgentServerEventMcpListToolsCompleted( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``mcp_list_tools.completed`` server event. + + :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.voiceagents.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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + event_id: str, + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED], + item_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 VoiceAgentServerEventMcpListToolsFailed(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``mcp_list_tools.failed`` server event. + + :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.voiceagents.models.MCP_LIST_TOOLS_FAILED + :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_FAILED] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + event_id: str, + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED], + item_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 VoiceAgentServerEventMcpListToolsInProgress( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``mcp_list_tools.in_progress`` server event. + + :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.voiceagents.models.MCP_LIST_TOOLS_IN_PROGRESS + :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_IN_PROGRESS] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + event_id: str, + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS], + item_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 VoiceAgentServerEventOutputAudioBufferCleared( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``output_audio_buffer.cleared`` server event. + + :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.voiceagents.models.OUTPUT_AUDIO_BUFFER_CLEARED + :ivar response_id: The unique ID of the response that produced the audio. Required. + :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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + event_id: str, + type: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED], + response_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 VoiceAgentServerEventRateLimitsUpdated(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``rate_limits.updated`` server event. + + :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.voiceagents.models.RATE_LIMITS_UPDATED + :ivar rate_limits: List of rate limit information. Required. + :vartype rate_limits: + list[~azure.ai.voiceagents.models.RealtimeServerEventRateLimitsUpdatedRateLimits] + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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.""" + + @overload + def __init__( + self, + *, + event_id: str, + type: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED], + rate_limits: list["_models.RealtimeServerEventRateLimitsUpdatedRateLimits"], + ) -> 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 VoiceAgentServerEventResponseAnimationBlendshapesDelta( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.animation_blendshapes.delta`` server event. + + :ivar type: Required. Default value is "response.animation_blendshapes.delta". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int + :ivar frames: Animation frames as numeric blendshape weights or a compact encoded string. + Required. Is either a [[float]] type or a str type. + :vartype frames: list[list[float]] or str + :ivar frame_index: The index of the first frame in this delta. Required. + :vartype frame_index: int + """ + + type: Literal["response.animation_blendshapes.delta"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Default value is \"response.animation_blendshapes.delta\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + frames: Union[list[list[float]], str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Animation frames as numeric blendshape weights or a compact encoded string. Required. Is either + a [[float]] type or a str type.""" + frame_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the first frame in this delta. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + frames: Union[list[list[float]], str], + frame_index: 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: Literal["response.animation_blendshapes.delta"] = "response.animation_blendshapes.delta" + + +class VoiceAgentServerEventResponseAnimationBlendshapesDone( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.animation_blendshapes.done`` server event. + + :ivar type: Required. Default value is "response.animation_blendshapes.done". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + """ + + type: Literal["response.animation_blendshapes.done"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Default value is \"response.animation_blendshapes.done\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = 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, + ) -> 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["response.animation_blendshapes.done"] = "response.animation_blendshapes.done" + + +class VoiceAgentServerEventResponseAnimationVisemeDelta( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.animation_viseme.delta`` server event. + + :ivar type: Required. Default value is "response.animation_viseme.delta". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int + :ivar audio_offset_ms: Required. + :vartype audio_offset_ms: int + :ivar viseme_id: Required. + :vartype viseme_id: int + """ + + type: Literal["response.animation_viseme.delta"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Default value is \"response.animation_viseme.delta\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + audio_offset_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + viseme_id: int = 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, + audio_offset_ms: int, + viseme_id: 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: Literal["response.animation_viseme.delta"] = "response.animation_viseme.delta" + + +class VoiceAgentServerEventResponseAnimationVisemeDone( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.animation_viseme.done`` server event. + + :ivar type: Required. Default value is "response.animation_viseme.done". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int + """ + + type: Literal["response.animation_viseme.done"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Default value is \"response.animation_viseme.done\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + content_index: int = 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, + ) -> 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["response.animation_viseme.done"] = "response.animation_viseme.done" + + +class VoiceAgentServerEventResponseAudioDelta(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``response.output_audio.delta`` server event. + + :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.voiceagents.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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA], + response_id: str, + item_id: str, + output_index: int, + content_index: int, + delta: bytes, + ) -> 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 VoiceAgentServerEventResponseAudioDone(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``response.output_audio.done`` server event. + + :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.voiceagents.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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE], + response_id: str, + item_id: str, + output_index: int, + content_index: 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 VoiceAgentServerEventResponseAudioTimestampDelta( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.audio_timestamp.delta`` server event. + + :ivar type: Required. Default value is "response.audio_timestamp.delta". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int + :ivar audio_offset_ms: Required. + :vartype audio_offset_ms: int + :ivar audio_duration_ms: Required. + :vartype audio_duration_ms: int + :ivar text: Required. + :vartype text: str + :ivar timestamp_type: Required. Default value is "word". + :vartype timestamp_type: str + """ + + type: Literal["response.audio_timestamp.delta"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Default value is \"response.audio_timestamp.delta\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + audio_offset_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + audio_duration_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + timestamp_type: Literal["word"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"word\".""" + + @overload + def __init__( + self, + *, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + audio_offset_ms: int, + audio_duration_ms: int, + 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["response.audio_timestamp.delta"] = "response.audio_timestamp.delta" + self.timestamp_type: Literal["word"] = "word" + + +class VoiceAgentServerEventResponseAudioTimestampDone( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.audio_timestamp.done`` server event. + + :ivar type: Required. Default value is "response.audio_timestamp.done". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int + """ + + type: Literal["response.audio_timestamp.done"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Default value is \"response.audio_timestamp.done\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + content_index: int = 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, + ) -> 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["response.audio_timestamp.done"] = "response.audio_timestamp.done" + + +class VoiceAgentServerEventResponseAudioTranscriptDelta( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.output_audio_transcript.delta`` server event. + + :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.voiceagents.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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA], + response_id: str, + item_id: str, + output_index: int, + content_index: int, + delta: 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 VoiceAgentServerEventResponseAudioTranscriptDone( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.output_audio_transcript.done`` server event. + + :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.voiceagents.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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE], + response_id: str, + item_id: str, + output_index: int, + content_index: int, + transcript: 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 VoiceAgentServerEventResponseContentPartDone( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.content_part.done`` server event. + + :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.voiceagents.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 finished streaming. Required. Is either a + VoiceAgentResponseEventTextContentPart type or a VoiceAgentResponseEventAudioContentPart type. + :vartype part: ~azure.ai.voiceagents.models.VoiceAgentResponseEventTextContentPart or + ~azure.ai.voiceagents.models.VoiceAgentResponseEventAudioContentPart + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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: "_unions.VoiceAgentResponseEventContentPart" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The content part that finished streaming. Required. Is either a + VoiceAgentResponseEventTextContentPart type or a VoiceAgentResponseEventAudioContentPart type.""" + + @overload + def __init__( + self, + *, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE], + response_id: str, + item_id: str, + output_index: int, + content_index: int, + part: "_unions.VoiceAgentResponseEventContentPart", + ) -> 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 VoiceAgentServerEventResponseCreated(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``response.created`` server event. + + :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.voiceagents.models.RESPONSE_CREATED + :ivar response: The created voice-agent response. Required. + :vartype response: ~azure.ai.voiceagents.models.VoiceAgentRealtimeResponse + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The event type, must be ``response.created``. Required. RESPONSE_CREATED.""" + response: "_models.VoiceAgentRealtimeResponse" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The created voice-agent response. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_CREATED], + response: "_models.VoiceAgentRealtimeResponse", + ) -> 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 VoiceAgentServerEventResponseDone(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``response.done`` server event. + + :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.voiceagents.models.RESPONSE_DONE + :ivar response: The completed voice-agent response. Required. + :vartype response: ~azure.ai.voiceagents.models.VoiceAgentRealtimeResponse + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The event type, must be ``response.done``. Required. RESPONSE_DONE.""" + response: "_models.VoiceAgentRealtimeResponse" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The completed voice-agent response. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_DONE], + response: "_models.VoiceAgentRealtimeResponse", + ) -> 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 VoiceAgentServerEventResponseFunctionCallArgumentsDelta( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.function_call_arguments.delta`` server event. + + :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.voiceagents.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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA], + response_id: str, + item_id: str, + output_index: int, + call_id: str, + delta: 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 VoiceAgentServerEventResponseFunctionCallArgumentsDone( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.function_call_arguments.done`` server event. + + :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.voiceagents.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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE], + response_id: str, + item_id: str, + output_index: int, + call_id: str, + name: str, + arguments: 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 VoiceAgentServerEventResponseMcpCallArgumentsDelta( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.mcp_call_arguments.delta`` server event. + + :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.voiceagents.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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA], + 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) + + +class VoiceAgentServerEventResponseMcpCallArgumentsDone( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.mcp_call_arguments.done`` server event. + + :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.voiceagents.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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE], + response_id: str, + item_id: str, + output_index: int, + arguments: 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 VoiceAgentServerEventResponseMcpCallCompleted( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.mcp_call.completed`` server event. + + :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.voiceagents.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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED], + output_index: int, + item_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 VoiceAgentServerEventResponseMcpCallFailed( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.mcp_call.failed`` server event. + + :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.voiceagents.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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED], + output_index: int, + item_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 VoiceAgentServerEventResponseMcpCallInProgress( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.mcp_call.in_progress`` server event. + + :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.voiceagents.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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS], + output_index: int, + item_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 VoiceAgentServerEventResponseOutputItemAdded( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.output_item.added`` server event. + + :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.voiceagents.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: The output item that was added. Required. Is one of the following types: + "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, + VoiceAgentFileSearchCallItem + :vartype item: ~azure.ai.voiceagents.models.RealtimeConversationItemMessageSystem or + ~azure.ai.voiceagents.models.RealtimeConversationItemMessageUser or + ~azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistant or + ~azure.ai.voiceagents.models.VoiceFunctionCallItem or + ~azure.ai.voiceagents.models.VoiceFunctionCallOutputItem or + ~azure.ai.voiceagents.models.VoiceMcpListToolsItem or + ~azure.ai.voiceagents.models.VoiceMcpCallItem or + ~azure.ai.voiceagents.models.VoiceMcpApprovalRequestItem or + ~azure.ai.voiceagents.models.VoiceMcpApprovalResponseItem or + ~azure.ai.voiceagents.models.VoiceAgentWorkflowActionItem or + ~azure.ai.voiceagents.models.VoiceAgentWebSearchCallItem or + ~azure.ai.voiceagents.models.VoiceAgentFileSearchCallItem + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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: "_unions.VoiceAgentResponseItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The output item that was added. Required. Is one of the following types: + \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, + VoiceAgentFileSearchCallItem""" + + @overload + def __init__( + self, + *, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED], + response_id: str, + output_index: int, + item: "_unions.VoiceAgentResponseItem", + ) -> 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 VoiceAgentServerEventResponseOutputItemDone( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.output_item.done`` server event. + + :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.voiceagents.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: The output item that finished streaming. Required. Is one of the following types: + "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, + VoiceAgentFileSearchCallItem + :vartype item: ~azure.ai.voiceagents.models.RealtimeConversationItemMessageSystem or + ~azure.ai.voiceagents.models.RealtimeConversationItemMessageUser or + ~azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistant or + ~azure.ai.voiceagents.models.VoiceFunctionCallItem or + ~azure.ai.voiceagents.models.VoiceFunctionCallOutputItem or + ~azure.ai.voiceagents.models.VoiceMcpListToolsItem or + ~azure.ai.voiceagents.models.VoiceMcpCallItem or + ~azure.ai.voiceagents.models.VoiceMcpApprovalRequestItem or + ~azure.ai.voiceagents.models.VoiceMcpApprovalResponseItem or + ~azure.ai.voiceagents.models.VoiceAgentWorkflowActionItem or + ~azure.ai.voiceagents.models.VoiceAgentWebSearchCallItem or + ~azure.ai.voiceagents.models.VoiceAgentFileSearchCallItem + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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: "_unions.VoiceAgentResponseItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The output item that finished streaming. Required. Is one of the following types: + \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, + VoiceAgentFileSearchCallItem""" + + @overload + def __init__( + self, + *, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE], + response_id: str, + output_index: int, + item: "_unions.VoiceAgentResponseItem", + ) -> 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 VoiceAgentServerEventResponseTextDelta(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``response.output_text.delta`` server event. + + :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.voiceagents.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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA], + response_id: str, + item_id: str, + output_index: int, + content_index: int, + delta: 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 VoiceAgentServerEventResponseTextDone(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``response.output_text.done`` server event. + + :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.voiceagents.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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE], + response_id: str, + item_id: str, + output_index: int, + content_index: int, + 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) + + +class VoiceAgentServerEventResponseVideoDelta(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``response.video.delta`` server event. + + :ivar type: Required. Default value is "response.video.delta". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar codec: Required. + :vartype codec: str + :ivar delta: The base64-encoded video frame data. Required. + :vartype delta: str + """ + + type: Literal["response.video.delta"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"response.video.delta\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + codec: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The base64-encoded video frame data. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + output_index: int, + codec: str, + delta: 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["response.video.delta"] = "response.video.delta" + + +class VoiceAgentServerEventSessionAvatarConnecting( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``session.avatar.connecting`` server event. + + :ivar type: Required. Default value is "session.avatar.connecting". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar server_sdp: The server's SDP answer for avatar media negotiation. Required. + :vartype server_sdp: str + """ + + type: Literal["session.avatar.connecting"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"session.avatar.connecting\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + server_sdp: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The server's SDP answer for avatar media negotiation. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + server_sdp: 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["session.avatar.connecting"] = "session.avatar.connecting" + + +class VoiceAgentServerEventSessionAvatarSwitchToIdle( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``session.avatar.switch_to_idle`` server event. + + :ivar type: Required. Default value is "session.avatar.switch_to_idle". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar turn_id: + :vartype turn_id: str + """ + + type: Literal["session.avatar.switch_to_idle"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Default value is \"session.avatar.switch_to_idle\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + turn_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + event_id: str, + turn_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["session.avatar.switch_to_idle"] = "session.avatar.switch_to_idle" + + +class VoiceAgentServerEventSessionAvatarSwitchToSpeaking( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``session.avatar.switch_to_speaking`` server event. + + :ivar type: Required. Default value is "session.avatar.switch_to_speaking". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar turn_id: + :vartype turn_id: str + """ + + type: Literal["session.avatar.switch_to_speaking"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Default value is \"session.avatar.switch_to_speaking\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + turn_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + event_id: str, + turn_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["session.avatar.switch_to_speaking"] = "session.avatar.switch_to_speaking" + + +class VoiceAgentServerEventSessionCreated(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``session.created`` server event. + + :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.voiceagents.models.SESSION_CREATED + :ivar session: The initial effective voice-agent session configuration. Required. + :vartype session: ~azure.ai.voiceagents.models.VoiceAgentSessionResponseConfig + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The event type, must be ``session.created``. Required. SESSION_CREATED.""" + session: "_models.VoiceAgentSessionResponseConfig" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The initial effective voice-agent session configuration. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + type: Literal[RealtimeServerEventType.SESSION_CREATED], + session: "_models.VoiceAgentSessionResponseConfig", + ) -> 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 VoiceAgentServerEventSessionHandoffAborted( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``session.handoff.aborted`` server event. + + :ivar type: Required. Default value is "session.handoff.aborted". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar handoff_id: Required. + :vartype handoff_id: str + :ivar edge_id: Required. + :vartype edge_id: str + :ivar from_node_id: Required. + :vartype from_node_id: str + :ivar to_node_id: Required. + :vartype to_node_id: str + :ivar from_model: Required. + :vartype from_model: str + :ivar to_model: Required. + :vartype to_model: str + :ivar tool_call_id: Required. + :vartype tool_call_id: str + :ivar node_generation: Required. + :vartype node_generation: int + :ivar reason: The reason the handoff was aborted. Required. Known values are: + "user_interruption" and "error". + :vartype reason: str or ~azure.ai.voiceagents.models.VoiceAgentHandoffAbortReason + :ivar error: The error that aborted the handoff, when ``reason`` is ``error``. + :vartype error: ~azure.ai.voiceagents.models.VoiceAgentServerEventErrorDetails + """ + + type: Literal["session.handoff.aborted"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"session.handoff.aborted\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + handoff_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + edge_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + from_node_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + to_node_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + from_model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + to_model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + tool_call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + node_generation: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + reason: Union[str, "_models.VoiceAgentHandoffAbortReason"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The reason the handoff was aborted. Required. Known values are: \"user_interruption\" and + \"error\".""" + error: Optional["_models.VoiceAgentServerEventErrorDetails"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The error that aborted the handoff, when ``reason`` is ``error``.""" + + @overload + def __init__( + self, + *, + event_id: str, + handoff_id: str, + edge_id: str, + from_node_id: str, + to_node_id: str, + from_model: str, + to_model: str, + tool_call_id: str, + node_generation: int, + reason: Union[str, "_models.VoiceAgentHandoffAbortReason"], + error: Optional["_models.VoiceAgentServerEventErrorDetails"] = 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["session.handoff.aborted"] = "session.handoff.aborted" + + +class VoiceAgentServerEventSessionHandoffCompleted( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``session.handoff.completed`` server event. + + :ivar type: Required. Default value is "session.handoff.completed". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar handoff_id: Required. + :vartype handoff_id: str + :ivar edge_id: Required. + :vartype edge_id: str + :ivar from_node_id: Required. + :vartype from_node_id: str + :ivar to_node_id: Required. + :vartype to_node_id: str + :ivar from_model: Required. + :vartype from_model: str + :ivar to_model: Required. + :vartype to_model: str + :ivar tool_call_id: Required. + :vartype tool_call_id: str + :ivar node_generation: Required. + :vartype node_generation: int + :ivar prepare_duration_ms: The time spent preparing the target behavior, in milliseconds. + Required. + :vartype prepare_duration_ms: int + :ivar duration_ms: The total duration of the handoff, in milliseconds. Required. + :vartype duration_ms: int + """ + + type: Literal["session.handoff.completed"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"session.handoff.completed\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + handoff_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + edge_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + from_node_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + to_node_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + from_model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + to_model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + tool_call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + node_generation: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + prepare_duration_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The time spent preparing the target behavior, in milliseconds. Required.""" + duration_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The total duration of the handoff, in milliseconds. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + handoff_id: str, + edge_id: str, + from_node_id: str, + to_node_id: str, + from_model: str, + to_model: str, + tool_call_id: str, + node_generation: int, + prepare_duration_ms: int, + duration_ms: 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: Literal["session.handoff.completed"] = "session.handoff.completed" + + +class VoiceAgentServerEventSessionHandoffStarted( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``session.handoff.started`` server event. + + :ivar type: Required. Default value is "session.handoff.started". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar handoff_id: Required. + :vartype handoff_id: str + :ivar edge_id: Required. + :vartype edge_id: str + :ivar from_node_id: Required. + :vartype from_node_id: str + :ivar to_node_id: Required. + :vartype to_node_id: str + :ivar from_model: Required. + :vartype from_model: str + :ivar to_model: Required. + :vartype to_model: str + :ivar tool_call_id: Required. + :vartype tool_call_id: str + :ivar node_generation: Required. + :vartype node_generation: int + """ + + type: Literal["session.handoff.started"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"session.handoff.started\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + handoff_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + edge_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + from_node_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + to_node_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + from_model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + to_model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + tool_call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + node_generation: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + handoff_id: str, + edge_id: str, + from_node_id: str, + to_node_id: str, + from_model: str, + to_model: str, + tool_call_id: str, + node_generation: 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: Literal["session.handoff.started"] = "session.handoff.started" + + +class VoiceAgentServerEventSessionUpdated(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``session.updated`` server event. + + :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.voiceagents.models.SESSION_UPDATED + :ivar session: The effective voice-agent session configuration after the update. Required. + :vartype session: ~azure.ai.voiceagents.models.VoiceAgentSessionResponseConfig + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The event type, must be ``session.updated``. Required. SESSION_UPDATED.""" + session: "_models.VoiceAgentSessionResponseConfig" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The effective voice-agent session configuration after the update. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + type: Literal[RealtimeServerEventType.SESSION_UPDATED], + session: "_models.VoiceAgentSessionResponseConfig", + ) -> 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 VoiceAgentServerEventWarning(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``warning`` server event. + + :ivar type: Required. Default value is "warning". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar warning: Required. + :vartype warning: ~azure.ai.voiceagents.models.VoiceAgentServerEventWarningDetails + """ + + type: Literal["warning"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"warning\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + warning: "_models.VoiceAgentServerEventWarningDetails" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + warning: "_models.VoiceAgentServerEventWarningDetails", + ) -> 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["warning"] = "warning" + + +class VoiceAgentServerEventWarningDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Details of a non-fatal warning. + + :ivar message: Required. + :vartype message: str + :ivar code: + :vartype code: str + :ivar param: + :vartype param: str + """ + + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + code: 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, + *, + message: str, + code: Optional[str] = None, + 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) + + +class VoiceAgentServerEventWebSearchCallCompleted( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.web_search_call.completed`` server event. + + :ivar type: Required. Default value is "response.web_search_call.completed". + :vartype type: str + :ivar event_id: + :vartype event_id: str + :ivar response_id: + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar sequence_number: Required. + :vartype sequence_number: int + """ + + type: Literal["response.web_search_call.completed"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Default value is \"response.web_search_call.completed\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + item_id: str, + output_index: int, + sequence_number: int, + event_id: Optional[str] = None, + 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["response.web_search_call.completed"] = "response.web_search_call.completed" + + +class VoiceAgentServerEventWebSearchCallInProgress( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.web_search_call.in_progress`` server event. + + :ivar type: Required. Default value is "response.web_search_call.in_progress". + :vartype type: str + :ivar event_id: + :vartype event_id: str + :ivar response_id: + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar sequence_number: Required. + :vartype sequence_number: int + """ + + type: Literal["response.web_search_call.in_progress"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Default value is \"response.web_search_call.in_progress\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + item_id: str, + output_index: int, + sequence_number: int, + event_id: Optional[str] = None, + 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["response.web_search_call.in_progress"] = "response.web_search_call.in_progress" + + +class VoiceAgentServerEventWebSearchCallSearching( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.web_search_call.searching`` server event. + + :ivar type: Required. Default value is "response.web_search_call.searching". + :vartype type: str + :ivar event_id: + :vartype event_id: str + :ivar response_id: + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar sequence_number: Required. + :vartype sequence_number: int + """ + + type: Literal["response.web_search_call.searching"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Default value is \"response.web_search_call.searching\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + item_id: str, + output_index: int, + sequence_number: int, + event_id: Optional[str] = None, + 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["response.web_search_call.searching"] = "response.web_search_call.searching" + + +class VoiceAgentServerVadTurnDetection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Server VAD turn-detection settings. + + :ivar create_response: + :vartype create_response: bool + :ivar interrupt_response: + :vartype interrupt_response: bool + :ivar idle_timeout_ms: + :vartype idle_timeout_ms: int + :ivar type: Required. Server-side voice activity detection. + :vartype type: str or ~azure.ai.voiceagents.models.SERVER_VAD + :ivar threshold: + :vartype threshold: float + :ivar prefix_padding_ms: + :vartype prefix_padding_ms: int + :ivar silence_duration_ms: + :vartype silence_duration_ms: int + :ivar speech_duration_ms: + :vartype speech_duration_ms: int + :ivar end_of_utterance_detection: + :vartype end_of_utterance_detection: + ~azure.ai.voiceagents.models.VoiceAgentEndOfUtteranceDetection + :ivar auto_truncate: + :vartype auto_truncate: bool + """ + + create_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + interrupt_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + idle_timeout_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[VoiceTurnDetectionType.SERVER_VAD] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Server-side voice activity detection.""" + threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + prefix_padding_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + silence_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + speech_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + auto_truncate: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + type: Literal[VoiceTurnDetectionType.SERVER_VAD], + create_response: Optional[bool] = None, + interrupt_response: Optional[bool] = None, + idle_timeout_ms: Optional[int] = None, + threshold: Optional[float] = None, + prefix_padding_ms: Optional[int] = None, + silence_duration_ms: Optional[int] = None, + speech_duration_ms: Optional[int] = None, + end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = None, + auto_truncate: 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 VoiceAgentSessionAvatarConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Avatar settings accepted by the stable voice-agent WebSocket contract. + + :ivar type: Known values are: "video_avatar" and "photo_avatar". + :vartype type: str or ~azure.ai.voiceagents.models.VoiceAgentAvatarType + :ivar ice_servers: + :vartype ice_servers: list[~azure.ai.voiceagents.models.VoiceAgentAvatarIceServer] + :ivar character: Required. + :vartype character: str + :ivar style: + :vartype style: str + :ivar customized: + :vartype customized: bool + :ivar model: + :vartype model: str + :ivar video: + :vartype video: ~azure.ai.voiceagents.models.VoiceAgentAvatarVideoParams + :ivar scene: + :vartype scene: ~azure.ai.voiceagents.models.VoiceAgentAvatarScene + :ivar output_protocol: Known values are: "websocket", "websocket-binary", and "webrtc". + :vartype output_protocol: str or ~azure.ai.voiceagents.models.VoiceAgentAvatarOutputProtocol + :ivar output_audit_audio: + :vartype output_audit_audio: bool + """ + + type: Optional[Union[str, "_models.VoiceAgentAvatarType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"video_avatar\" and \"photo_avatar\".""" + ice_servers: Optional[list["_models.VoiceAgentAvatarIceServer"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + character: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + style: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + customized: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + video: Optional["_models.VoiceAgentAvatarVideoParams"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + scene: Optional["_models.VoiceAgentAvatarScene"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + output_protocol: Optional[Union[str, "_models.VoiceAgentAvatarOutputProtocol"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"websocket\", \"websocket-binary\", and \"webrtc\".""" + output_audit_audio: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + character: str, + type: Optional[Union[str, "_models.VoiceAgentAvatarType"]] = None, + ice_servers: Optional[list["_models.VoiceAgentAvatarIceServer"]] = None, + style: Optional[str] = None, + customized: Optional[bool] = None, + model: Optional[str] = None, + video: Optional["_models.VoiceAgentAvatarVideoParams"] = None, + scene: Optional["_models.VoiceAgentAvatarScene"] = None, + output_protocol: Optional[Union[str, "_models.VoiceAgentAvatarOutputProtocol"]] = None, + output_audit_audio: 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 VoiceAgentSessionMcpTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A remote MCP server available to a voice-agent session. + + :ivar type: 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: Required. + :vartype server_url: str + :ivar authorization: Is either a str type or a VoiceAgentMcpAssignedManagedIdentity type. + :vartype authorization: str or + ~azure.ai.voiceagents.models.VoiceAgentMcpAssignedManagedIdentity + :ivar headers: + :vartype headers: dict[str, str] + :ivar allowed_tools: + :vartype allowed_tools: list[str] + :ivar require_approval: Is either a Union[str, "_models.VoiceAgentMcpApprovalMode"] type or a + {str: [str]} type. + :vartype require_approval: str or ~azure.ai.voiceagents.models.VoiceAgentMcpApprovalMode or + dict[str, list[str]] + :ivar response_scheduling: Known values are: "silent", "when_idle", "interrupt", and + "skip_if_busy". + :vartype response_scheduling: str or + ~azure.ai.voiceagents.models.VoiceAgentMcpResponseScheduling + """ + + 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"]) + """A label for this MCP server, used to identify it in tool calls. Required.""" + server_url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + authorization: Optional[Union[str, "_models.VoiceAgentMcpAssignedManagedIdentity"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is either a str type or a VoiceAgentMcpAssignedManagedIdentity type.""" + headers: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + allowed_tools: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + require_approval: Optional["_unions.VoiceAgentMcpApprovalPolicy"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is either a Union[str, \"_models.VoiceAgentMcpApprovalMode\"] type or a {str: [str]} type.""" + response_scheduling: Optional[Union[str, "_models.VoiceAgentMcpResponseScheduling"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"silent\", \"when_idle\", \"interrupt\", and \"skip_if_busy\".""" + + @overload + def __init__( + self, + *, + server_label: str, + server_url: str, + authorization: Optional[Union[str, "_models.VoiceAgentMcpAssignedManagedIdentity"]] = None, + headers: Optional[dict[str, str]] = None, + allowed_tools: Optional[list[str]] = None, + require_approval: Optional["_unions.VoiceAgentMcpApprovalPolicy"] = None, + response_scheduling: Optional[Union[str, "_models.VoiceAgentMcpResponseScheduling"]] = 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["mcp"] = "mcp" + + +class VoiceAgentSessionResponseAudio(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Input- and output-audio settings returned in a stable voice-agent session event. + + :ivar input: The effective input-audio settings. + :vartype input: ~azure.ai.voiceagents.models.VoiceAgentSessionResponseAudioInput + :ivar output: The output-audio settings for the session. + :vartype output: ~azure.ai.voiceagents.models.VoiceAgentSessionResponseAudioOutput + """ + + input: Optional["_models.VoiceAgentSessionResponseAudioInput"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The effective input-audio settings.""" + output: Optional["_models.VoiceAgentSessionResponseAudioOutput"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The output-audio settings for the session.""" + + @overload + def __init__( + self, + *, + input: Optional["_models.VoiceAgentSessionResponseAudioInput"] = None, + output: Optional["_models.VoiceAgentSessionResponseAudioOutput"] = 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 VoiceAgentSessionResponseAudioInput(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Input-audio settings returned in a stable voice-agent session event. + + :ivar noise_reduction: Input noise reduction. Set to null to disable. + :vartype noise_reduction: ~azure.ai.voiceagents.models.VoiceNoiseReduction + :ivar transcription: Asynchronous input-audio transcription. Set to null to disable + transcription. + :vartype transcription: ~azure.ai.voiceagents.models.VoiceInputTranscription + :ivar format: The structured input audio format. + :vartype format: ~azure.ai.voiceagents.models.VoiceAudioFormat + :ivar turn_detection: Turn-detection settings. Set to null to disable server-side turn + detection. Is one of the following types: VoiceAgentServerVadTurnDetection, + VoiceAgentSemanticVadTurnDetection, VoiceAgentAzureSemanticVadTurnDetection, + VoiceAgentAzureMultilingualSemanticVadTurnDetection + :vartype turn_detection: ~azure.ai.voiceagents.models.VoiceAgentServerVadTurnDetection or + ~azure.ai.voiceagents.models.VoiceAgentSemanticVadTurnDetection or + ~azure.ai.voiceagents.models.VoiceAgentAzureSemanticVadTurnDetection or + ~azure.ai.voiceagents.models.VoiceAgentAzureMultilingualSemanticVadTurnDetection + :ivar echo_cancellation: Optional server-side echo cancellation settings. + :vartype echo_cancellation: ~azure.ai.voiceagents.models.VoiceAgentEchoCancellation + """ + + noise_reduction: Optional["_models.VoiceNoiseReduction"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Input noise reduction. Set to null to disable.""" + transcription: Optional["_models.VoiceInputTranscription"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Asynchronous input-audio transcription. Set to null to disable transcription.""" + format: Optional["_models.VoiceAudioFormat"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The structured input audio format.""" + turn_detection: Optional["_unions.VoiceAgentTurnDetection"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Turn-detection settings. Set to null to disable server-side turn detection. Is one of the + following types: VoiceAgentServerVadTurnDetection, VoiceAgentSemanticVadTurnDetection, + VoiceAgentAzureSemanticVadTurnDetection, VoiceAgentAzureMultilingualSemanticVadTurnDetection""" + echo_cancellation: Optional["_models.VoiceAgentEchoCancellation"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional server-side echo cancellation settings.""" + + @overload + def __init__( + self, + *, + noise_reduction: Optional["_models.VoiceNoiseReduction"] = None, + transcription: Optional["_models.VoiceInputTranscription"] = None, + format: Optional["_models.VoiceAudioFormat"] = None, + turn_detection: Optional["_unions.VoiceAgentTurnDetection"] = None, + echo_cancellation: Optional["_models.VoiceAgentEchoCancellation"] = 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 VoiceAgentSessionResponseAudioOutput(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Output-audio settings returned in a stable voice-agent session event. + + :ivar format: The output audio format. + :vartype format: ~azure.ai.voiceagents.models.VoiceAudioFormat + :ivar voice: The typed voice configuration. Is one of the following types: OpenAIVoice, + AzureVoice, AzureRealtimeNativeVoice + :vartype voice: ~azure.ai.voiceagents.models.OpenAIVoice or + ~azure.ai.voiceagents.models.AzureVoice or + ~azure.ai.voiceagents.models.AzureRealtimeNativeVoice + :ivar output_audio_timestamp_types: Timestamp kinds to include with output audio. + :vartype output_audio_timestamp_types: list[str or + ~azure.ai.voiceagents.models.VoiceAudioTimestampType] + :ivar speed: The speaking-speed multiplier. + :vartype speed: float + """ + + format: Optional["_models.VoiceAudioFormat"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The output audio format.""" + voice: Optional["_unions.VoiceAgentVoice"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The typed voice configuration. Is one of the following types: OpenAIVoice, AzureVoice, + AzureRealtimeNativeVoice""" + output_audio_timestamp_types: Optional[list[Union[str, "_models.VoiceAudioTimestampType"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Timestamp kinds to include with output audio.""" + speed: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The speaking-speed multiplier.""" + + @overload + def __init__( + self, + *, + format: Optional["_models.VoiceAudioFormat"] = None, + voice: Optional["_unions.VoiceAgentVoice"] = None, + output_audio_timestamp_types: Optional[list[Union[str, "_models.VoiceAudioTimestampType"]]] = None, + speed: 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 VoiceAgentSessionResponseConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The effective stable realtime session settings returned by the voice-agent service. + + :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 avatar: The avatar settings for the session. + :vartype avatar: ~azure.ai.voiceagents.models.VoiceAgentSessionAvatarConfig + :ivar animation: Animation settings for the session. + :vartype animation: ~azure.ai.voiceagents.models.VoiceAgentAnimationConfig + :ivar tools: Tools available to the session. + :vartype tools: list[~azure.ai.voiceagents.models.RealtimeFunctionTool or + ~azure.ai.voiceagents.models.VoiceAgentSessionMcpTool or + ~azure.ai.voiceagents.models.VoiceToolboxTool or ~azure.ai.voiceagents.models.VoiceSystemTool] + :ivar tool_choice: Tool-selection behavior for the session. Is either a Union[str, + "_models.ToolChoiceOptions"] type or a RealtimeToolChoiceFunction type. + :vartype tool_choice: str or ~azure.ai.voiceagents.models.ToolChoiceOptions or + ~azure.ai.voiceagents.models.RealtimeToolChoiceFunction + :ivar reasoning: Reasoning settings for compatible realtime models. + :vartype reasoning: ~azure.ai.voiceagents.models.RealtimeReasoning + :ivar parallel_tool_calls: Whether the model may call multiple tools in parallel. + :vartype parallel_tool_calls: bool + :ivar voice_adaptation: Voice-optimized instruction adaptation settings. + :vartype voice_adaptation: ~azure.ai.voiceagents.models.VoiceAgentVoiceAdaptation + :ivar interim_response: Interim-response settings for latency and tool execution. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. + :vartype interim_response: ~azure.ai.voiceagents.models.VoiceAgentStaticInterimResponseConfig + or ~azure.ai.voiceagents.models.VoiceAgentLlmInterimResponseConfig + :ivar response_delimiter: A delimiter appended to generated responses. + :vartype response_delimiter: str + :ivar greeting: A proactive assistant greeting started after session configuration. + :vartype greeting: ~azure.ai.voiceagents.models.VoiceGreetingConfig + :ivar object: The object type. Always ``realtime.session``. Required. Default value is + "realtime.session". + :vartype object: str + :ivar id: The session identifier. Required. + :vartype id: str + :ivar model: The selected model. Required. + :vartype model: str + :ivar expires_at: The session expiration time as a Unix timestamp in seconds. + :vartype expires_at: ~datetime.datetime + :ivar output_modalities: The output modalities enabled for the session. Required. + :vartype output_modalities: list[str or ~azure.ai.voiceagents.models.VoiceOutputModality] + :ivar audio: The effective input- and output-audio settings for the session. + :vartype audio: ~azure.ai.voiceagents.models.VoiceAgentSessionResponseAudio + :ivar handoff: The effective handoff state. + :vartype handoff: ~azure.ai.voiceagents.models.VoiceAgentHandoffState + :ivar idle_timeout: The idle timeout reported by the service, in milliseconds. + :vartype idle_timeout: int + """ + + 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.""" + 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["_unions.VoiceAgentSessionTool"]] = 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 either a Union[str, \"_models.ToolChoiceOptions\"] + type or a RealtimeToolChoiceFunction type.""" + 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.""" + voice_adaptation: Optional["_models.VoiceAgentVoiceAdaptation"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Voice-optimized instruction adaptation settings.""" + interim_response: Optional["_unions.VoiceAgentInterimResponse"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Interim-response settings for latency and tool execution. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type.""" + response_delimiter: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A delimiter appended to generated responses.""" + greeting: Optional["_models.VoiceGreetingConfig"] = rest_field( + 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.""" + output_modalities: list[Union[str, "_models.VoiceOutputModality"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The output modalities enabled for the session. Required.""" + audio: Optional["_models.VoiceAgentSessionResponseAudio"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The effective input- and output-audio settings for the session.""" + handoff: Optional["_models.VoiceAgentHandoffState"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The effective handoff state.""" + idle_timeout: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The idle timeout reported by the service, in milliseconds.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + model: str, + output_modalities: list[Union[str, "_models.VoiceOutputModality"]], + instructions: Optional[str] = None, + temperature: Optional[float] = None, + max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] = None, + avatar: Optional["_models.VoiceAgentSessionAvatarConfig"] = None, + animation: Optional["_models.VoiceAgentAnimationConfig"] = None, + tools: Optional[list["_unions.VoiceAgentSessionTool"]] = None, + tool_choice: Optional["_unions.VoiceAgentToolChoice"] = None, + reasoning: Optional["_models.RealtimeReasoning"] = None, + parallel_tool_calls: Optional[bool] = None, + voice_adaptation: Optional["_models.VoiceAgentVoiceAdaptation"] = None, + interim_response: Optional["_unions.VoiceAgentInterimResponse"] = None, + response_delimiter: Optional[str] = None, + greeting: Optional["_models.VoiceGreetingConfig"] = None, + expires_at: Optional[datetime.datetime] = None, + audio: Optional["_models.VoiceAgentSessionResponseAudio"] = None, + handoff: Optional["_models.VoiceAgentHandoffState"] = None, + idle_timeout: 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: Literal["realtime"] = "realtime" + self.object: Literal["realtime.session"] = "realtime.session" + + +class VoiceAgentSessionUpdateAudio(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Input- and output-audio settings accepted in a ``session.update`` client event. + + :ivar input: The input-audio settings for the session. + :vartype input: ~azure.ai.voiceagents.models.VoiceAgentSessionUpdateAudioInput + :ivar output: The output-audio settings for the session. + :vartype output: ~azure.ai.voiceagents.models.VoiceAgentSessionUpdateAudioOutput + """ + + input: Optional["_models.VoiceAgentSessionUpdateAudioInput"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The input-audio settings for the session.""" + output: Optional["_models.VoiceAgentSessionUpdateAudioOutput"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The output-audio settings for the session.""" + + @overload + def __init__( + self, + *, + input: Optional["_models.VoiceAgentSessionUpdateAudioInput"] = None, + output: Optional["_models.VoiceAgentSessionUpdateAudioOutput"] = 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 VoiceAgentSessionUpdateAudioInput(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Input-audio settings accepted in a stable voice-agent session. + + :ivar noise_reduction: Input noise reduction. Set to null to disable. + :vartype noise_reduction: ~azure.ai.voiceagents.models.VoiceNoiseReduction + :ivar transcription: Asynchronous input-audio transcription. Set to null to disable + transcription. + :vartype transcription: ~azure.ai.voiceagents.models.VoiceInputTranscription + :ivar format: The structured input audio format. + :vartype format: ~azure.ai.voiceagents.models.VoiceAudioFormat + :ivar turn_detection: Turn-detection settings. Set to null to disable server-side turn + detection. Is one of the following types: VoiceAgentServerVadTurnDetection, + VoiceAgentSemanticVadTurnDetection, VoiceAgentAzureSemanticVadTurnDetection, + VoiceAgentAzureMultilingualSemanticVadTurnDetection + :vartype turn_detection: ~azure.ai.voiceagents.models.VoiceAgentServerVadTurnDetection or + ~azure.ai.voiceagents.models.VoiceAgentSemanticVadTurnDetection or + ~azure.ai.voiceagents.models.VoiceAgentAzureSemanticVadTurnDetection or + ~azure.ai.voiceagents.models.VoiceAgentAzureMultilingualSemanticVadTurnDetection + :ivar echo_cancellation: Optional server-side echo cancellation settings. + :vartype echo_cancellation: ~azure.ai.voiceagents.models.VoiceAgentEchoCancellation + """ + + noise_reduction: Optional["_models.VoiceNoiseReduction"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Input noise reduction. Set to null to disable.""" + transcription: Optional["_models.VoiceInputTranscription"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Asynchronous input-audio transcription. Set to null to disable transcription.""" + format: Optional["_models.VoiceAudioFormat"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The structured input audio format.""" + turn_detection: Optional["_unions.VoiceAgentTurnDetection"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Turn-detection settings. Set to null to disable server-side turn detection. Is one of the + following types: VoiceAgentServerVadTurnDetection, VoiceAgentSemanticVadTurnDetection, + VoiceAgentAzureSemanticVadTurnDetection, VoiceAgentAzureMultilingualSemanticVadTurnDetection""" + echo_cancellation: Optional["_models.VoiceAgentEchoCancellation"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional server-side echo cancellation settings.""" + + @overload + def __init__( + self, + *, + noise_reduction: Optional["_models.VoiceNoiseReduction"] = None, + transcription: Optional["_models.VoiceInputTranscription"] = None, + format: Optional["_models.VoiceAudioFormat"] = None, + turn_detection: Optional["_unions.VoiceAgentTurnDetection"] = None, + echo_cancellation: Optional["_models.VoiceAgentEchoCancellation"] = 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 VoiceAgentSessionUpdateAudioOutput(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Output-audio settings accepted in a stable voice-agent session. + + :ivar format: The output audio format. + :vartype format: ~azure.ai.voiceagents.models.VoiceAudioFormat + :ivar voice: The typed voice configuration. Is one of the following types: OpenAIVoice, + AzureVoice, AzureRealtimeNativeVoice + :vartype voice: ~azure.ai.voiceagents.models.OpenAIVoice or + ~azure.ai.voiceagents.models.AzureVoice or + ~azure.ai.voiceagents.models.AzureRealtimeNativeVoice + :ivar output_audio_timestamp_types: Timestamp kinds to include with output audio. + :vartype output_audio_timestamp_types: list[str or + ~azure.ai.voiceagents.models.VoiceAudioTimestampType] + :ivar speed: The speaking-speed multiplier. + :vartype speed: float + """ + + format: Optional["_models.VoiceAudioFormat"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The output audio format.""" + voice: Optional["_unions.VoiceAgentVoice"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The typed voice configuration. Is one of the following types: OpenAIVoice, AzureVoice, + AzureRealtimeNativeVoice""" + output_audio_timestamp_types: Optional[list[Union[str, "_models.VoiceAudioTimestampType"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Timestamp kinds to include with output audio.""" + speed: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The speaking-speed multiplier.""" + + @overload + def __init__( + self, + *, + format: Optional["_models.VoiceAudioFormat"] = None, + voice: Optional["_unions.VoiceAgentVoice"] = None, + output_audio_timestamp_types: Optional[list[Union[str, "_models.VoiceAudioTimestampType"]]] = None, + speed: 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 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.voiceagents.models.VoiceOutputModality] + :ivar audio: The input- and output-audio settings for the session. + :vartype audio: ~azure.ai.voiceagents.models.VoiceAgentSessionUpdateAudio + :ivar avatar: The avatar settings for the session. + :vartype avatar: ~azure.ai.voiceagents.models.VoiceAgentSessionAvatarConfig + :ivar animation: Animation settings for the session. + :vartype animation: ~azure.ai.voiceagents.models.VoiceAgentAnimationConfig + :ivar tools: Tools available to the session. + :vartype tools: list[~azure.ai.voiceagents.models.RealtimeFunctionTool or + ~azure.ai.voiceagents.models.VoiceAgentSessionMcpTool or + ~azure.ai.voiceagents.models.VoiceToolboxTool or ~azure.ai.voiceagents.models.VoiceSystemTool] + :ivar tool_choice: Tool-selection behavior for the session. Is either a Union[str, + "_models.ToolChoiceOptions"] type or a RealtimeToolChoiceFunction type. + :vartype tool_choice: str or ~azure.ai.voiceagents.models.ToolChoiceOptions or + ~azure.ai.voiceagents.models.RealtimeToolChoiceFunction + :ivar reasoning: Reasoning settings for compatible realtime models. + :vartype reasoning: ~azure.ai.voiceagents.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.voiceagents.models.VoiceAgentSessionIncludeOption] + :ivar metadata: Up to 16 string key-value pairs attached to the session. + :vartype metadata: dict[str, str] + :ivar voice_adaptation: Voice-optimized instruction adaptation settings. + :vartype voice_adaptation: ~azure.ai.voiceagents.models.VoiceAgentVoiceAdaptation + :ivar interim_response: Interim-response settings for latency and tool execution. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. + :vartype interim_response: ~azure.ai.voiceagents.models.VoiceAgentStaticInterimResponseConfig + or ~azure.ai.voiceagents.models.VoiceAgentLlmInterimResponseConfig + :ivar response_delimiter: A delimiter appended to generated responses. + :vartype response_delimiter: str + :ivar greeting: A proactive assistant greeting started after session configuration. + :vartype greeting: ~azure.ai.voiceagents.models.VoiceGreetingConfig + :ivar handoff: The customer-supplied handoff graph. + :vartype handoff: ~azure.ai.voiceagents.models.VoiceAgentHandoffGraphConfig + """ + + 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.VoiceAgentSessionUpdateAudio"] = 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["_unions.VoiceAgentSessionTool"]] = 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 either a Union[str, \"_models.ToolChoiceOptions\"] + type or a RealtimeToolChoiceFunction type.""" + 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.""" + voice_adaptation: Optional["_models.VoiceAgentVoiceAdaptation"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Voice-optimized instruction adaptation settings.""" + interim_response: Optional["_unions.VoiceAgentInterimResponse"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Interim-response settings for latency and tool execution. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type.""" + response_delimiter: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A delimiter appended to generated responses.""" + greeting: Optional["_models.VoiceGreetingConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """A proactive assistant greeting started after session configuration.""" + handoff: Optional["_models.VoiceAgentHandoffGraphConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The customer-supplied handoff graph.""" + + @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.VoiceAgentSessionUpdateAudio"] = None, + avatar: Optional["_models.VoiceAgentSessionAvatarConfig"] = None, + animation: Optional["_models.VoiceAgentAnimationConfig"] = None, + tools: Optional[list["_unions.VoiceAgentSessionTool"]] = 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, + voice_adaptation: Optional["_models.VoiceAgentVoiceAdaptation"] = None, + interim_response: Optional["_unions.VoiceAgentInterimResponse"] = None, + response_delimiter: Optional[str] = None, + greeting: Optional["_models.VoiceGreetingConfig"] = None, + handoff: Optional["_models.VoiceAgentHandoffGraphConfig"] = 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" + + +class VoiceAgentStaticInterimResponseConfig( + VoiceAgentInterimResponseConfig, discriminator="static_interim_response" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A static interim response selected from configured text. + + :ivar triggers: Conditions that may trigger one interim response. + :vartype triggers: list[str or ~azure.ai.voiceagents.models.VoiceAgentInterimResponseTrigger] + :ivar latency_threshold_ms: The latency threshold in milliseconds. + :vartype latency_threshold_ms: int + :ivar type: Required. Default value is "static_interim_response". + :vartype type: str + :ivar texts: Candidate text values for the interim response. + :vartype texts: list[str] + """ + + type: Literal["static_interim_response"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"static_interim_response\".""" + texts: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Candidate text values for the interim response.""" + + @overload + def __init__( + self, + *, + triggers: Optional[list[Union[str, "_models.VoiceAgentInterimResponseTrigger"]]] = None, + latency_threshold_ms: Optional[int] = None, + texts: 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 = "static_interim_response" # type: ignore + + +class VoiceAgentTranscriptionPhrase(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A transcribed phrase with timing information. + + :ivar offset_milliseconds: The phrase offset from the beginning of the audio, in milliseconds. + Required. + :vartype offset_milliseconds: int + :ivar duration_milliseconds: The phrase duration in milliseconds. Required. + :vartype duration_milliseconds: int + :ivar text: The transcribed phrase text. Required. + :vartype text: str + :ivar words: Word-level timing details, when available. + :vartype words: list[~azure.ai.voiceagents.models.VoiceAgentTranscriptionWord] + :ivar locale: The detected locale. + :vartype locale: str + :ivar confidence: The transcription confidence score. + :vartype confidence: float + """ + + offset_milliseconds: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The phrase offset from the beginning of the audio, in milliseconds. Required.""" + duration_milliseconds: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The phrase duration in milliseconds. Required.""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The transcribed phrase text. Required.""" + words: Optional[list["_models.VoiceAgentTranscriptionWord"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Word-level timing details, when available.""" + locale: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The detected locale.""" + confidence: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The transcription confidence score.""" + + @overload + def __init__( + self, + *, + offset_milliseconds: int, + duration_milliseconds: int, + text: str, + words: Optional[list["_models.VoiceAgentTranscriptionWord"]] = None, + locale: Optional[str] = None, + confidence: 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 VoiceAgentTranscriptionWord(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A time-stamped word in an input-audio transcription. + + :ivar text: The transcribed word text. Required. + :vartype text: str + :ivar offset_milliseconds: The word offset from the beginning of the audio, in milliseconds. + Required. + :vartype offset_milliseconds: int + :ivar duration_milliseconds: The word duration in milliseconds. Required. + :vartype duration_milliseconds: int + """ + + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The transcribed word text. Required.""" + offset_milliseconds: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The word offset from the beginning of the audio, in milliseconds. Required.""" + duration_milliseconds: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The word duration in milliseconds. Required.""" + + @overload + def __init__( + self, + *, + text: str, + offset_milliseconds: int, + duration_milliseconds: 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 VoiceAgentVersionObject(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A voice agent version. Mirrors ``AgentVersionObject``, but its ``definition`` is always a + ``VoiceAgentDefinition``. + + :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 object: The object type, which is always 'agent.version'. Required. AGENT_VERSION. + :vartype object: str or ~azure.ai.voiceagents.models.AGENT_VERSION + :ivar id: The unique identifier of the agent version. Required. + :vartype id: str + :ivar name: The name of the agent. Name can be used to retrieve/update/delete the agent. + Required. + :vartype name: str + :ivar version: The version identifier of the agent. Agents are immutable and every update + creates a new version while keeping the name same. Required. + :vartype version: str + :ivar description: A human-readable description of the agent. + :vartype description: str + :ivar created_at: The Unix timestamp (seconds) when the agent was created. Required. + :vartype created_at: ~datetime.datetime + :ivar draft: Whether this agent version is a draft (candidate) rather than a release. Draft + versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. + Defaults to false. + :vartype draft: bool + :ivar status: The provisioning status of the agent version. Defaults to 'active' for non-hosted + agents. For hosted agents, reflects infrastructure readiness. Known values are: "creating", + "active", "failed", "deleting", and "deleted". + :vartype status: str or ~azure.ai.voiceagents.models.AgentVersionStatus + :ivar instance_identity: The instance identity of the agent. + :vartype instance_identity: ~azure.ai.voiceagents.models.AgentIdentity + :ivar blueprint: The blueprint for the agent. + :vartype blueprint: ~azure.ai.voiceagents.models.AgentIdentity + :ivar blueprint_reference: The blueprint for the agent. + :vartype blueprint_reference: ~azure.ai.voiceagents.models.AgentBlueprintReference + :ivar agent_guid: The unique GUID identifier of the agent. + :vartype agent_guid: str + :ivar definition: The voice agent definition for this version. Required. + :vartype definition: ~azure.ai.voiceagents.models.VoiceAgentDefinition + """ + + 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.""" + object: Literal[AgentObjectType.AGENT_VERSION] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The object type, which is always 'agent.version'. Required. AGENT_VERSION.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the agent version. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the agent. Name can be used to retrieve/update/delete the agent. Required.""" + version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version identifier of the agent. Agents are immutable and every update creates a new + version while keeping the name same. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A human-readable description of the agent.""" + created_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (seconds) when the agent was created. Required.""" + draft: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether this agent version is a draft (candidate) rather than a release. Draft versions are + recorded but excluded from default 'latest' resolution and are not auto-promoted. Defaults to + false.""" + status: Optional[Union[str, "_models.AgentVersionStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The provisioning status of the agent version. Defaults to 'active' for non-hosted agents. For + hosted agents, reflects infrastructure readiness. Known values are: \"creating\", \"active\", + \"failed\", \"deleting\", and \"deleted\".""" + instance_identity: Optional["_models.AgentIdentity"] = rest_field(visibility=["read"]) + """The instance identity of the agent.""" + blueprint: Optional["_models.AgentIdentity"] = rest_field(visibility=["read"]) + """The blueprint for the agent.""" + blueprint_reference: Optional["_models.AgentBlueprintReference"] = rest_field(visibility=["read"]) + """The blueprint for the agent.""" + agent_guid: Optional[str] = rest_field(visibility=["read"]) + """The unique GUID identifier of the agent.""" + definition: "_models.VoiceAgentDefinition" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The voice agent definition for this version. Required.""" + + @overload + def __init__( + self, + *, + metadata: dict[str, str], + object: Literal[AgentObjectType.AGENT_VERSION], + id: str, # pylint: disable=redefined-builtin + name: str, + version: str, + created_at: datetime.datetime, + definition: "_models.VoiceAgentDefinition", + description: Optional[str] = None, + draft: Optional[bool] = None, + status: Optional[Union[str, "_models.AgentVersionStatus"]] = 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 VoiceAgentVoiceAdaptation(_Model): # pylint: disable=docstring-missing-param + """Voice-optimized instruction adaptation settings. + + :ivar type: The adaptation strategy. Always ``auto``. Required. Default value is "auto". + :vartype type: str + """ + + type: Literal["auto"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The adaptation strategy. Always ``auto``. Required. Default value is \"auto\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["auto"] = "auto" + + +class VoiceAgentWebSearchActionFind(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An action that finds text on a web page. + + :ivar type: Required. Default value is "find". + :vartype type: str + :ivar pattern: Required. + :vartype pattern: str + :ivar url: Required. + :vartype url: str + """ + + type: Literal["find"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"find\".""" + pattern: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + pattern: str, + url: 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["find"] = "find" + + +class VoiceAgentWebSearchActionOpenPage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An action that opens a web page. + + :ivar type: Required. Default value is "open_page". + :vartype type: str + :ivar url: Required. + :vartype url: str + """ + + type: Literal["open_page"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"open_page\".""" + url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + url: 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["open_page"] = "open_page" + + +class VoiceAgentWebSearchActionSearch(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A web search action. + + :ivar type: Required. Default value is "search". + :vartype type: str + :ivar query: Required. + :vartype query: str + :ivar sources: + :vartype sources: list[~azure.ai.voiceagents.models.VoiceAgentWebSearchSource] + """ + + type: Literal["search"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"search\".""" + query: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + sources: Optional[list["_models.VoiceAgentWebSearchSource"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + query: str, + sources: Optional[list["_models.VoiceAgentWebSearchSource"]] = 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["search"] = "search" + + +class VoiceAgentWebSearchCallItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A web-search output item. + + :ivar id: Required. + :vartype id: str + :ivar type: Required. Default value is "web_search_call". + :vartype type: str + :ivar status: Required. Known values are: "in_progress", "searching", "completed", and + "failed". + :vartype status: str or ~azure.ai.voiceagents.models.VoiceAgentWebSearchCallStatus + :ivar action: Is one of the following types: VoiceAgentWebSearchActionSearch, + VoiceAgentWebSearchActionOpenPage, VoiceAgentWebSearchActionFind + :vartype action: ~azure.ai.voiceagents.models.VoiceAgentWebSearchActionSearch or + ~azure.ai.voiceagents.models.VoiceAgentWebSearchActionOpenPage or + ~azure.ai.voiceagents.models.VoiceAgentWebSearchActionFind + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + type: Literal["web_search_call"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"web_search_call\".""" + status: Union[str, "_models.VoiceAgentWebSearchCallStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Known values are: \"in_progress\", \"searching\", \"completed\", and \"failed\".""" + action: Optional["_unions.VoiceAgentWebSearchAction"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is one of the following types: VoiceAgentWebSearchActionSearch, + VoiceAgentWebSearchActionOpenPage, VoiceAgentWebSearchActionFind""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + status: Union[str, "_models.VoiceAgentWebSearchCallStatus"], + action: Optional["_unions.VoiceAgentWebSearchAction"] = 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["web_search_call"] = "web_search_call" + + +class VoiceAgentWebSearchSource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A web-search source URL. + + :ivar type: Required. Default value is "url". + :vartype type: str + :ivar url: Required. + :vartype url: str + """ + + type: Literal["url"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"url\".""" + url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + url: 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["url"] = "url" + + +class VoiceAgentWorkflowActionItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A workflow action output item. + + :ivar id: Required. + :vartype id: str + :ivar object: Default value is "realtime.item". + :vartype object: str + :ivar type: Required. Default value is "workflow_action". + :vartype type: str + :ivar action_id: Required. + :vartype action_id: str + :ivar status: Required. + :vartype status: str + :ivar kind: + :vartype kind: str + :ivar parent_action_id: + :vartype parent_action_id: str + :ivar previous_action_id: + :vartype previous_action_id: str + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + object: Optional[Literal["realtime.item"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Default value is \"realtime.item\".""" + type: Literal["workflow_action"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"workflow_action\".""" + action_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + kind: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + parent_action_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + previous_action_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + action_id: str, + status: str, + object: Optional[Literal["realtime.item"]] = None, + kind: Optional[str] = None, + parent_action_id: Optional[str] = None, + previous_action_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["workflow_action"] = "workflow_action" + + +class VoiceConversationItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A persisted item in a voice conversation. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + VoiceFunctionCallItem, VoiceFunctionCallOutputItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem, VoiceMcpCallItem, VoiceMcpListToolsItem, VoiceMessageItem + + :ivar type: The type of the conversation item. Required. Known values are: "message", + "function_call", "function_call_output", "mcp_list_tools", "mcp_call", "mcp_approval_request", + and "mcp_approval_response". + :vartype type: str or ~azure.ai.voiceagents.models.VoiceConversationItemType + :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 + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The type of the conversation item. Required. Known values are: \"message\", \"function_call\", + \"function_call_output\", \"mcp_list_tools\", \"mcp_call\", \"mcp_approval_request\", and + \"mcp_approval_response\".""" + created_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The id of the response that produced this item, when applicable.""" + + @overload + def __init__( + self, + *, + type: str, + created_at: Optional[datetime.datetime] = None, + 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) + + +class VoiceMessageItem( + VoiceConversationItem, discriminator="message" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A persisted message item in a voice conversation. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + VoiceAssistantMessageItem, VoiceSystemMessageItem, VoiceUserMessageItem + + :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: Required. A message item. + :vartype type: str or ~azure.ai.voiceagents.models.MESSAGE + :ivar role: The role of the message sender. Required. Known values are: "system", "user", and + "assistant". + :vartype role: str or ~azure.ai.voiceagents.models.RealtimeConversationItemMessageType + """ + + __mapping__: dict[str, _Model] = {} + type: Literal[VoiceConversationItemType.MESSAGE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. A message item.""" + role: str = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) + """The role of the message sender. Required. Known values are: \"system\", \"user\", and + \"assistant\".""" + + @overload + def __init__( + self, + *, + role: str, + created_at: Optional[datetime.datetime] = None, + 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 = VoiceConversationItemType.MESSAGE # type: ignore + + +class VoiceAssistantMessageItem( + VoiceMessageItem, discriminator="assistant" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An assistant message item. Only ``output_text`` and ``output_audio`` content are valid for + assistant messages. + + :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: Required. A message item. + :vartype type: str or ~azure.ai.voiceagents.models.MESSAGE + :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 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 content: The content of the message. Required. + :vartype content: + list[~azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistantContent] + :ivar role: Required. ASSISTANT. + :vartype role: str or ~azure.ai.voiceagents.models.ASSISTANT + """ + + __mapping__: dict[str, _Model] = {} + 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\"]""" + content: list["_models.RealtimeConversationItemMessageAssistantContent"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The content of the message. Required.""" + role: Literal[RealtimeConversationItemMessageType.ASSISTANT] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. ASSISTANT.""" + + @overload + def __init__( + self, + *, + content: list["_models.RealtimeConversationItemMessageAssistantContent"], + created_at: Optional[datetime.datetime] = None, + response_id: Optional[str] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + object: Optional[Literal["realtime.item"]] = None, + status: Optional[Literal["completed", "incomplete", "in_progress"]] = 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 = RealtimeConversationItemMessageType.ASSISTANT # type: ignore + + +class VoiceAudioConfig(_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 input: Input (microphone) audio configuration. + :vartype input: ~azure.ai.voiceagents.models.VoiceAudioInputConfig + :ivar output: Output (agent speech) audio configuration. + :vartype output: ~azure.ai.voiceagents.models.VoiceAudioOutputConfig + """ + + input: Optional["_models.VoiceAudioInputConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Input (microphone) audio configuration.""" + output: Optional["_models.VoiceAudioOutputConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Output (agent speech) audio configuration.""" + + @overload + def __init__( + self, + *, + input: Optional["_models.VoiceAudioInputConfig"] = None, + output: Optional["_models.VoiceAudioOutputConfig"] = 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 VoiceAudioFormat(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An audio format. Follows the OpenAI Realtime session schema; ``type`` carries the media + subtype. + + :ivar type: The audio format type, e.g. 'audio/pcm' (16-bit PCM), 'audio/pcmu' (G.711 mu-law), + or 'audio/pcma' (G.711 A-law). Required. Known values are: "audio/pcm", "audio/pcmu", and + "audio/pcma". + :vartype type: str or ~azure.ai.voiceagents.models.VoiceAudioFormatType + :ivar rate: The sample rate in Hz. Applies to 'audio/pcm' (e.g. 24000); omit for telephony + G.711 formats (8 kHz). + :vartype rate: int + """ + + type: Union[str, "_models.VoiceAudioFormatType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The audio format type, e.g. 'audio/pcm' (16-bit PCM), 'audio/pcmu' (G.711 mu-law), or + 'audio/pcma' (G.711 A-law). Required. Known values are: \"audio/pcm\", \"audio/pcmu\", and + \"audio/pcma\".""" + rate: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sample rate in Hz. Applies to 'audio/pcm' (e.g. 24000); omit for telephony G.711 formats (8 + kHz).""" + + @overload + def __init__( + self, + *, + type: Union[str, "_models.VoiceAudioFormatType"], + rate: 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 VoiceAudioInputConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Input audio configuration for a voice agent. + + :ivar format: The input audio format. + :vartype format: ~azure.ai.voiceagents.models.VoiceAudioFormat + :ivar noise_reduction: Input noise reduction. Set to null to disable. + :vartype noise_reduction: ~azure.ai.voiceagents.models.VoiceNoiseReduction + :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.voiceagents.models.VoiceTurnDetection + :ivar transcription: Asynchronous input-audio transcription. Set to null to disable + transcription. + :vartype transcription: ~azure.ai.voiceagents.models.VoiceInputTranscription + """ + + format: Optional["_models.VoiceAudioFormat"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The input audio format.""" + noise_reduction: Optional["_models.VoiceNoiseReduction"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Input noise reduction. Set to null to disable.""" + turn_detection: Optional["_models.VoiceTurnDetection"] = 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.""" + transcription: Optional["_models.VoiceInputTranscription"] = 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.VoiceAudioFormat"] = None, + noise_reduction: Optional["_models.VoiceNoiseReduction"] = None, + turn_detection: Optional["_models.VoiceTurnDetection"] = None, + transcription: Optional["_models.VoiceInputTranscription"] = 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 VoiceAudioOutputConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Output audio configuration for a voice agent. + + :ivar format: The output audio format. + :vartype format: ~azure.ai.voiceagents.models.VoiceAudioFormat + :ivar voice: The typed voice configuration. Is one of the following types: OpenAIVoice, + AzureVoice, AzureRealtimeNativeVoice + :vartype voice: ~azure.ai.voiceagents.models.OpenAIVoice or + ~azure.ai.voiceagents.models.AzureVoice or + ~azure.ai.voiceagents.models.AzureRealtimeNativeVoice + :ivar speed: The OpenAI-compatible speaking speed multiplier, from 0.25 to 1.5. Defaults to 1. + For Azure synthesized voices, use ``voice.rate`` instead. + :vartype speed: float + :ivar output_audio_timestamp_types: Timestamp kinds to include with output audio. + :vartype output_audio_timestamp_types: list[str or + ~azure.ai.voiceagents.models.VoiceAudioTimestampType] + """ + + format: Optional["_models.VoiceAudioFormat"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The output audio format.""" + voice: Optional["_unions.VoiceAgentVoice"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The typed voice configuration. Is one of the following types: OpenAIVoice, AzureVoice, + AzureRealtimeNativeVoice""" + speed: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The OpenAI-compatible speaking speed multiplier, from 0.25 to 1.5. Defaults to 1. For Azure + synthesized voices, use ``voice.rate`` instead.""" + output_audio_timestamp_types: Optional[list[Union[str, "_models.VoiceAudioTimestampType"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Timestamp kinds to include with output audio.""" + + @overload + def __init__( + self, + *, + format: Optional["_models.VoiceAudioFormat"] = None, + voice: Optional["_unions.VoiceAgentVoice"] = None, + speed: Optional[float] = None, + output_audio_timestamp_types: Optional[list[Union[str, "_models.VoiceAudioTimestampType"]]] = 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 VoiceAvatarConfig(_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 type: The avatar type. Required. Known values are: "video_avatar" and "photo_avatar". + :vartype type: str or ~azure.ai.voiceagents.models.VoiceAvatarType + :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.voiceagents.models.VoiceAvatarOutputProtocol + """ + + type: Union[str, "_models.VoiceAvatarType"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """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.VoiceAvatarOutputProtocol"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The transport used to deliver the avatar video stream. Known values are: \"webrtc\" and + \"websocket\".""" + + @overload + def __init__( + self, + *, + type: Union[str, "_models.VoiceAvatarType"], + character: str, + style: Optional[str] = None, + customized: Optional[bool] = None, + output_protocol: Optional[Union[str, "_models.VoiceAvatarOutputProtocol"]] = 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 VoiceEndOfUtteranceDetection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Semantic end-of-utterance detection configuration. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + VoiceAzureSemanticDetection, VoiceAzureSemanticDetectionEn, + VoiceAzureSemanticDetectionMultilingual + + :ivar model: The semantic detection model. Required. Known values are: "semantic_detection_v1", + "semantic_detection_v1_en", and "semantic_detection_v1_multilingual". + :vartype model: str or ~azure.ai.voiceagents.models.VoiceEndOfUtteranceDetectionModel + """ + + __mapping__: dict[str, _Model] = {} + model: str = rest_discriminator(name="model", visibility=["read", "create", "update", "delete", "query"]) + """The semantic detection model. Required. Known values are: \"semantic_detection_v1\", + \"semantic_detection_v1_en\", and \"semantic_detection_v1_multilingual\".""" + + @overload + def __init__( + self, + *, + model: 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 VoiceAzureSemanticDetection( + VoiceEndOfUtteranceDetection, discriminator="semantic_detection_v1" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Default Azure semantic end-of-utterance detection. + + :ivar model: Required. The default semantic detection model. + :vartype model: str or ~azure.ai.voiceagents.models.SEMANTIC_DETECTION_V1 + :ivar threshold_level: The sensitivity threshold. Known values are: "low", "medium", "high", + and "default". + :vartype threshold_level: str or ~azure.ai.voiceagents.models.VoiceEndOfUtteranceThresholdLevel + :ivar timeout_ms: The detection timeout in milliseconds. + :vartype timeout_ms: int + """ + + model: Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1] = rest_discriminator(name="model", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. The default semantic detection model.""" + threshold_level: Optional[Union[str, "_models.VoiceEndOfUtteranceThresholdLevel"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The sensitivity threshold. Known values are: \"low\", \"medium\", \"high\", and \"default\".""" + timeout_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The detection timeout in milliseconds.""" + + @overload + def __init__( + self, + *, + threshold_level: Optional[Union[str, "_models.VoiceEndOfUtteranceThresholdLevel"]] = None, + timeout_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.model = VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1 # type: ignore + + +class VoiceAzureSemanticDetectionEn( + VoiceEndOfUtteranceDetection, discriminator="semantic_detection_v1_en" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """English-optimized Azure semantic end-of-utterance detection. + + :ivar model: Required. The English-optimized semantic detection model. + :vartype model: str or ~azure.ai.voiceagents.models.SEMANTIC_DETECTION_V1_EN + :ivar threshold_level: The sensitivity threshold. Known values are: "low", "medium", "high", + and "default". + :vartype threshold_level: str or ~azure.ai.voiceagents.models.VoiceEndOfUtteranceThresholdLevel + :ivar timeout_ms: The detection timeout in milliseconds. + :vartype timeout_ms: int + """ + + model: Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1_EN] = rest_discriminator(name="model", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. The English-optimized semantic detection model.""" + threshold_level: Optional[Union[str, "_models.VoiceEndOfUtteranceThresholdLevel"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The sensitivity threshold. Known values are: \"low\", \"medium\", \"high\", and \"default\".""" + timeout_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The detection timeout in milliseconds.""" + + @overload + def __init__( + self, + *, + threshold_level: Optional[Union[str, "_models.VoiceEndOfUtteranceThresholdLevel"]] = None, + timeout_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.model = VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1_EN # type: ignore + + +class VoiceAzureSemanticDetectionMultilingual( + VoiceEndOfUtteranceDetection, discriminator="semantic_detection_v1_multilingual" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Multilingual Azure semantic end-of-utterance detection. + + :ivar model: Required. The multilingual semantic detection model. + :vartype model: str or ~azure.ai.voiceagents.models.SEMANTIC_DETECTION_V1_MULTILINGUAL + :ivar threshold_level: The sensitivity threshold. Known values are: "low", "medium", "high", + and "default". + :vartype threshold_level: str or ~azure.ai.voiceagents.models.VoiceEndOfUtteranceThresholdLevel + :ivar timeout_ms: The detection timeout in milliseconds. + :vartype timeout_ms: int + """ + + model: Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1_MULTILINGUAL] = rest_discriminator(name="model", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. The multilingual semantic detection model.""" + threshold_level: Optional[Union[str, "_models.VoiceEndOfUtteranceThresholdLevel"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The sensitivity threshold. Known values are: \"low\", \"medium\", \"high\", and \"default\".""" + timeout_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The detection timeout in milliseconds.""" + + @overload + def __init__( + self, + *, + threshold_level: Optional[Union[str, "_models.VoiceEndOfUtteranceThresholdLevel"]] = None, + timeout_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.model = VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1_MULTILINGUAL # type: ignore + + +class VoiceTurnDetection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Turn-detection configuration for a voice agent. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + VoiceAzureSemanticVadTurnDetection, VoiceAzureSemanticVadEnTurnDetection, + VoiceAzureSemanticVadMultilingualTurnDetection, VoiceSemanticVadTurnDetection, + VoiceServerVadTurnDetection + + :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.voiceagents.models.VoiceTurnDetectionType + """ + + __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\".""" + + @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 VoiceAzureSemanticVadEnTurnDetection( + VoiceTurnDetection, discriminator="azure_semantic_vad_en" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """English-optimized Azure semantic voice activity detection. + + :ivar type: Required. English-optimized Azure semantic voice activity detection. + :vartype type: str or ~azure.ai.voiceagents.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: int + :ivar silence_duration_ms: Silence required to end speech detection, in milliseconds. + :vartype silence_duration_ms: int + :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. + :vartype end_of_utterance_detection: ~azure.ai.voiceagents.models.VoiceEndOfUtteranceDetection + :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in + milliseconds. + :vartype speech_duration_ms: int + :ivar remove_filler_words: Whether filler words are removed from transcription. + :vartype remove_filler_words: bool + :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech + stops. + :vartype auto_truncate: 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[VoiceTurnDetectionType.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[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Audio to include before detected speech, in milliseconds.""" + silence_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Silence required to end speech detection, in milliseconds.""" + end_of_utterance_detection: Optional["_models.VoiceEndOfUtteranceDetection"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Semantic end-of-utterance detection configuration.""" + speech_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """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.""" + auto_truncate: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the input audio buffer is truncated automatically when speech stops.""" + 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, + *, + threshold: Optional[float] = None, + prefix_padding_ms: Optional[int] = None, + silence_duration_ms: Optional[int] = None, + end_of_utterance_detection: Optional["_models.VoiceEndOfUtteranceDetection"] = None, + speech_duration_ms: Optional[int] = None, + remove_filler_words: Optional[bool] = None, + auto_truncate: 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 = VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN # type: ignore + + +class VoiceAzureSemanticVadMultilingualTurnDetection( + VoiceTurnDetection, discriminator="azure_semantic_vad_multilingual" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Multilingual Azure semantic voice activity detection. + + :ivar type: Required. Multilingual Azure semantic voice activity detection. + :vartype type: str or ~azure.ai.voiceagents.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: int + :ivar silence_duration_ms: Silence required to end speech detection, in milliseconds. + :vartype silence_duration_ms: int + :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. + :vartype end_of_utterance_detection: ~azure.ai.voiceagents.models.VoiceEndOfUtteranceDetection + :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in + milliseconds. + :vartype speech_duration_ms: int + :ivar remove_filler_words: Whether filler words are removed from transcription. + :vartype remove_filler_words: bool + :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech + stops. + :vartype auto_truncate: 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[VoiceTurnDetectionType.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[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Audio to include before detected speech, in milliseconds.""" + silence_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Silence required to end speech detection, in milliseconds.""" + end_of_utterance_detection: Optional["_models.VoiceEndOfUtteranceDetection"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Semantic end-of-utterance detection configuration.""" + speech_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """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.""" + auto_truncate: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the input audio buffer is truncated automatically when speech stops.""" + 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, + *, + threshold: Optional[float] = None, + prefix_padding_ms: Optional[int] = None, + silence_duration_ms: Optional[int] = None, + end_of_utterance_detection: Optional["_models.VoiceEndOfUtteranceDetection"] = None, + speech_duration_ms: Optional[int] = None, + remove_filler_words: Optional[bool] = None, + auto_truncate: 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 = VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL # type: ignore + + +class VoiceAzureSemanticVadTurnDetection( + VoiceTurnDetection, discriminator="azure_semantic_vad" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Azure semantic voice activity detection. + + :ivar type: Required. Azure semantic voice activity detection. + :vartype type: str or ~azure.ai.voiceagents.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: int + :ivar silence_duration_ms: Silence required to end speech detection, in milliseconds. + :vartype silence_duration_ms: int + :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. + :vartype end_of_utterance_detection: ~azure.ai.voiceagents.models.VoiceEndOfUtteranceDetection + :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in + milliseconds. + :vartype speech_duration_ms: int + :ivar remove_filler_words: Whether filler words are removed from transcription. + :vartype remove_filler_words: bool + :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech + stops. + :vartype auto_truncate: 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[VoiceTurnDetectionType.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[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Audio to include before detected speech, in milliseconds.""" + silence_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Silence required to end speech detection, in milliseconds.""" + end_of_utterance_detection: Optional["_models.VoiceEndOfUtteranceDetection"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Semantic end-of-utterance detection configuration.""" + speech_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """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.""" + auto_truncate: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the input audio buffer is truncated automatically when speech stops.""" + 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, + *, + threshold: Optional[float] = None, + prefix_padding_ms: Optional[int] = None, + silence_duration_ms: Optional[int] = None, + end_of_utterance_detection: Optional["_models.VoiceEndOfUtteranceDetection"] = None, + speech_duration_ms: Optional[int] = None, + remove_filler_words: Optional[bool] = None, + auto_truncate: 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 = VoiceTurnDetectionType.AZURE_SEMANTIC_VAD # type: ignore + + +class VoiceConversation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A persisted voice conversation. The Foundry envelope that owns a voice agent's stored + transcript, responses, per-turn metrics, and audio. It is the parent, retention, and delete + boundary: deleting it cascades to its responses, items, metrics, and audio. + + :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" and "completed". + :vartype status: str or ~azure.ai.voiceagents.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 the conversation's session ended. + Absent while 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 usage: Aggregate token usage totals across all responses in this conversation. + :vartype usage: ~azure.ai.voiceagents.models.RealtimeResponseUsage + """ + + 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\" and + \"completed\".""" + 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 the conversation's session ended. Absent while 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.""" + usage: Optional["_models.RealtimeResponseUsage"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Aggregate token usage totals across all responses in this conversation.""" + + @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, + usage: Optional["_models.RealtimeResponseUsage"] = 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 VoiceFunctionCallItem( + VoiceConversationItem, discriminator="function_call" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A function call request item. + + :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 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 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 type: Required. A function-call request item. + :vartype type: str or ~azure.ai.voiceagents.models.FUNCTION_CALL + """ + + 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\"]""" + 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.""" + type: Literal[VoiceConversationItemType.FUNCTION_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. A function-call request item.""" + + @overload + def __init__( + self, + *, + name: str, + arguments: str, + created_at: Optional[datetime.datetime] = None, + response_id: Optional[str] = None, + 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 + 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 = VoiceConversationItemType.FUNCTION_CALL # type: ignore + + +class VoiceFunctionCallOutputItem( + VoiceConversationItem, discriminator="function_call_output" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A function call output item. + + :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 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 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 type: Required. A function-call output item. + :vartype type: str or ~azure.ai.voiceagents.models.FUNCTION_CALL_OUTPUT + :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 + """ + + 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\"]""" + 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.""" + type: Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. A function-call output item.""" + 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, + *, + call_id: str, + output: str, + created_at: Optional[datetime.datetime] = None, + response_id: Optional[str] = None, + 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 + 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 = VoiceConversationItemType.FUNCTION_CALL_OUTPUT # type: ignore + + +class VoiceInputTranscription(_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 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 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 to use. 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.voiceagents.models.VoiceInputTranscriptionModel + :ivar custom_speech: Optional custom speech model 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] + """ + + 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.""" + 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.VoiceInputTranscriptionModel"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The transcription model to use. 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 custom speech model 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, + *, + model: Union[str, "_models.VoiceInputTranscriptionModel"], + language: Optional[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 + 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 VoiceItemAudioResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Metadata for a single conversation item's audio segment. For bring-your-own-storage (BYOS), the + response includes ``blob_uri``, a direct customer-storage URI without a SAS token, that the + customer accesses with their own credentials. For Foundry-managed storage, ``blob_uri`` is + absent and the bytes are streamed through the item's ``/audio/content`` route. + + :ivar conversation_id: The id of the conversation the item belongs to. Required. + :vartype conversation_id: str + :ivar item_id: The id of the item this audio belongs to. Required. + :vartype item_id: str + :ivar role: The role the audio belongs to. Known values are: "user" and "agent". + :vartype role: str or ~azure.ai.voiceagents.models.VoiceAudioRole + :ivar format: The container format of the audio. "wav" + :vartype format: str or ~azure.ai.voiceagents.models.VoiceAudioContainerFormat + :ivar codec: The audio codec. Known values are: "pcm16", "pcmu", and "pcma". + :vartype codec: str or ~azure.ai.voiceagents.models.VoiceAudioCodec + :ivar sample_rate: The sample rate in Hz. + :vartype sample_rate: int + :ivar channels: The number of audio channels. + :vartype channels: int + :ivar start_offset_ms: The offset from the session start at which this segment begins. + :vartype start_offset_ms: ~datetime.timedelta + :ivar duration_ms: The duration of the audio segment. + :vartype duration_ms: ~datetime.timedelta + :ivar blob_uri: For bring-your-own-storage (BYOS) recordings only: the URI of the recording in + the customer's own storage, without a SAS token. The customer downloads it using their own + storage credentials. Absent for Foundry-managed storage, where the bytes are streamed via the + item's ``/audio/content`` route instead. + :vartype blob_uri: str + """ + + conversation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The id of the conversation the item belongs to. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The id of the item this audio belongs to. Required.""" + role: Optional[Union[str, "_models.VoiceAudioRole"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The role the audio belongs to. Known values are: \"user\" and \"agent\".""" + format: Optional[Union[str, "_models.VoiceAudioContainerFormat"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The container format of the audio. \"wav\"""" + codec: Optional[Union[str, "_models.VoiceAudioCodec"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The audio codec. Known values are: \"pcm16\", \"pcmu\", and \"pcma\".""" + sample_rate: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sample rate in Hz.""" + channels: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of audio channels.""" + start_offset_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """The offset from the session start at which this segment begins.""" + duration_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """The duration of the audio segment.""" + blob_uri: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """For bring-your-own-storage (BYOS) recordings only: the URI of the recording in the customer's + own storage, without a SAS token. The customer downloads it using their own storage + credentials. Absent for Foundry-managed storage, where the bytes are streamed via the item's + ``/audio/content`` route instead.""" + + @overload + def __init__( + self, + *, + conversation_id: str, + item_id: str, + role: Optional[Union[str, "_models.VoiceAudioRole"]] = None, + format: Optional[Union[str, "_models.VoiceAudioContainerFormat"]] = None, + codec: Optional[Union[str, "_models.VoiceAudioCodec"]] = None, + sample_rate: Optional[int] = None, + channels: Optional[int] = None, + start_offset_ms: Optional[datetime.timedelta] = None, + duration_ms: Optional[datetime.timedelta] = None, + blob_uri: 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 VoiceMcpApprovalRequestItem( + VoiceConversationItem, discriminator="mcp_approval_request" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An MCP approval request item. + + :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 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 type: Required. An MCP approval request item. + :vartype type: str or ~azure.ai.voiceagents.models.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.""" + type: Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. An MCP approval request item.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + server_label: str, + name: str, + arguments: str, + created_at: Optional[datetime.datetime] = None, + 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 = VoiceConversationItemType.MCP_APPROVAL_REQUEST # type: ignore + + +class VoiceMcpApprovalResponseItem( + VoiceConversationItem, discriminator="mcp_approval_response" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An MCP approval response item (client-created). + + :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 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 type: Required. An MCP approval response item. + :vartype type: str or ~azure.ai.voiceagents.models.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"]) + type: Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. An MCP approval response item.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + approval_request_id: str, + approve: bool, + created_at: Optional[datetime.datetime] = None, + response_id: Optional[str] = None, + reason: 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 = VoiceConversationItemType.MCP_APPROVAL_RESPONSE # type: ignore + + +class VoiceMcpCallItem( + VoiceConversationItem, discriminator="mcp_call" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An MCP call item. + + :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 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.voiceagents.models.RealtimeMCPError + :ivar type: Required. An MCP call item. + :vartype type: str or ~azure.ai.voiceagents.models.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"]) + type: Literal[VoiceConversationItemType.MCP_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. An MCP call item.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + server_label: str, + name: str, + arguments: str, + created_at: Optional[datetime.datetime] = None, + response_id: Optional[str] = None, + approval_request_id: Optional[str] = None, + output: Optional[str] = None, + error: Optional["_models.RealtimeMCPError"] = 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 = VoiceConversationItemType.MCP_CALL # type: ignore + + +class VoiceMcpListToolsItem( + VoiceConversationItem, discriminator="mcp_list_tools" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An MCP list-tools item. + + :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 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.voiceagents.models.MCPListToolsTool] + :ivar type: Required. An MCP list-tools item. + :vartype type: str or ~azure.ai.voiceagents.models.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.""" + type: Literal[VoiceConversationItemType.MCP_LIST_TOOLS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. An MCP list-tools item.""" + + @overload + def __init__( + self, + *, + server_label: str, + tools: list["_models.MCPListToolsTool"], + created_at: Optional[datetime.datetime] = None, + response_id: Optional[str] = None, + id: Optional[str] = None, # 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) + self.type = VoiceConversationItemType.MCP_LIST_TOOLS # type: ignore + + +class VoiceNoiseReduction(_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". + :vartype type: str or ~azure.ai.voiceagents.models.VoiceNoiseReductionType + """ + + type: Union[str, "_models.VoiceNoiseReductionType"] = 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\".""" + + @overload + def __init__( + self, + *, + type: Union[str, "_models.VoiceNoiseReductionType"], + ) -> 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 VoiceRecordingChannelLayout(_Model): # pylint: disable=docstring-missing-param + """The role assigned to each channel of a merged stereo voice recording. + + :ivar left: The role carried on the left channel. Always ``user``. Required. Default value is + "user". + :vartype left: str + :ivar right: The role carried on the right channel. Always ``agent``. Required. Default value + is "agent". + :vartype right: str + """ + + left: Literal["user"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The role carried on the left channel. Always ``user``. Required. Default value is \"user\".""" + right: Literal["agent"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The role carried on the right channel. Always ``agent``. Required. Default value is \"agent\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.left: Literal["user"] = "user" + self.right: Literal["agent"] = "agent" + + +class VoiceRecordingResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Metadata for the merged, whole-call stereo recording of a voice conversation (user audio on the + left channel, agent audio on the right). Built once from the per-turn segments after the + session ends and durably cached. The common metadata (format, sample rate, channels, channel + layout, duration) is returned for both Foundry-managed and bring-your-own-storage (BYOS) + recordings. For BYOS the response also includes ``blob_uri``, the URI of the recording in the + customer's own storage (no SAS token), which the customer downloads using their own storage + credentials. For Foundry-managed storage ``blob_uri`` is absent and the bytes are streamed via + the ``/audio/content`` route instead. + + :ivar conversation_id: The id of the conversation this recording belongs to. Required. + :vartype conversation_id: str + :ivar format: The container format of the recording. Required. "wav" + :vartype format: str or ~azure.ai.voiceagents.models.VoiceAudioContainerFormat + :ivar sample_rate: The sample rate of the recording in Hz, e.g. 24000. Required. + :vartype sample_rate: int + :ivar channels: The number of audio channels. The merged recording is stereo (``2``). Required. + :vartype channels: int + :ivar channel_layout: The role assigned to each stereo channel. Required. + :vartype channel_layout: ~azure.ai.voiceagents.models.VoiceRecordingChannelLayout + :ivar duration_ms: The total duration of the recording. Required. + :vartype duration_ms: ~datetime.timedelta + :ivar blob_uri: For bring-your-own-storage (BYOS) recordings only: the URI of the recording in + the customer's own storage, without a SAS token. The customer downloads it using their own + storage credentials. Absent for Foundry-managed storage, where the bytes are streamed via the + ``/audio/content`` route instead. + :vartype blob_uri: str + """ + + conversation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The id of the conversation this recording belongs to. Required.""" + format: Union[str, "_models.VoiceAudioContainerFormat"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The container format of the recording. Required. \"wav\"""" + sample_rate: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sample rate of the recording in Hz, e.g. 24000. Required.""" + channels: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of audio channels. The merged recording is stereo (``2``). Required.""" + channel_layout: "_models.VoiceRecordingChannelLayout" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The role assigned to each stereo channel. Required.""" + duration_ms: datetime.timedelta = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """The total duration of the recording. Required.""" + blob_uri: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """For bring-your-own-storage (BYOS) recordings only: the URI of the recording in the customer's + own storage, without a SAS token. The customer downloads it using their own storage + credentials. Absent for Foundry-managed storage, where the bytes are streamed via the + ``/audio/content`` route instead.""" + + @overload + def __init__( + self, + *, + conversation_id: str, + format: Union[str, "_models.VoiceAudioContainerFormat"], + sample_rate: int, + channels: int, + channel_layout: "_models.VoiceRecordingChannelLayout", + duration_ms: datetime.timedelta, + blob_uri: 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 VoiceResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A persisted voice response representing one model inference turn within a conversation. In list + results the ``output`` projection may be omitted; retrieve the full response (``GET + .../responses/{response_id}``) or the paged response-items route (``GET + .../responses/{response_id}/items``) for its output items. ``created_at``/``completed_at`` are + Foundry durable ordering extensions. + + :ivar id: The unique id of the response. Required. + :vartype id: str + :ivar object: The object type. Always ``realtime.response``. Required. Default value is + "realtime.response". + :vartype object: str + :ivar status: The status of the response. Required. Known values are: "in_progress", + "completed", "cancelled", "incomplete", and "failed". + :vartype status: str or ~azure.ai.voiceagents.models.VoiceResponseStatus + :ivar status_details: Additional detail about a terminal status. + :vartype status_details: ~azure.ai.voiceagents.models.RealtimeResponseStatusDetails + :ivar output: The output items produced by the response. May be omitted in list results; + retrieve the full response (GET .../responses/{response_id}) or use the paged response-items + route (GET .../responses/{response_id}/items) for its output items. Each item's ``response_id`` + also links it back to this response in the conversation-level items list. + :vartype output: list[~azure.ai.voiceagents.models.VoiceConversationItem] + :ivar usage: Token usage statistics for the response. + :vartype usage: ~azure.ai.voiceagents.models.RealtimeResponseUsage + :ivar conversation_id: The id of the conversation this response belongs to. Required. + :vartype conversation_id: str + :ivar audio: The audio configuration used for the response, including the voice and audio + format used for output. + :vartype audio: ~azure.ai.voiceagents.models.VoiceResponseAudio + :ivar output_modalities: The output modalities used for the response, e.g. ``["text", + "audio"]``. Audio output always includes a text transcript. + :vartype output_modalities: list[str or str] + :ivar temperature: The sampling temperature used for the response. + :vartype temperature: float + :ivar max_output_tokens: The maximum number of output tokens allowed for the response; an + integer or the literal ``inf``. Is either a int type or a Literal["inf"] type. + :vartype max_output_tokens: int or str + :ivar created_at: The Unix timestamp (in seconds) for when the response was created. + :vartype created_at: ~datetime.datetime + :ivar completed_at: The Unix timestamp (in seconds) for when the response completed. + :vartype completed_at: ~datetime.datetime + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique id of the response. Required.""" + object: Literal["realtime.response"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The object type. Always ``realtime.response``. Required. Default value is + \"realtime.response\".""" + status: Union[str, "_models.VoiceResponseStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the response. Required. Known values are: \"in_progress\", \"completed\", + \"cancelled\", \"incomplete\", and \"failed\".""" + status_details: Optional["_models.RealtimeResponseStatusDetails"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Additional detail about a terminal status.""" + output: Optional[list["_models.VoiceConversationItem"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The output items produced by the response. May be omitted in list results; retrieve the full + response (GET .../responses/{response_id}) or use the paged response-items route (GET + .../responses/{response_id}/items) for its output items. Each item's ``response_id`` also links + it back to this response in the conversation-level items list.""" + usage: Optional["_models.RealtimeResponseUsage"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Token usage statistics for the response.""" + conversation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The id of the conversation this response belongs to. Required.""" + audio: Optional["_models.VoiceResponseAudio"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The audio configuration used for the response, including the voice and audio format used for + output.""" + output_modalities: Optional[list[Literal["text", "audio"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The output modalities used for the response, e.g. ``[\"text\", \"audio\"]``. Audio output + always includes a text transcript.""" + temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sampling temperature used for the response.""" + max_output_tokens: Optional[Union[int, Literal["inf"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum number of output tokens allowed for the response; an integer or the literal + ``inf``. Is either a int type or a Literal[\"inf\"] type.""" + created_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the response was created.""" + completed_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the response completed.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + status: Union[str, "_models.VoiceResponseStatus"], + conversation_id: str, + status_details: Optional["_models.RealtimeResponseStatusDetails"] = None, + output: Optional[list["_models.VoiceConversationItem"]] = None, + usage: Optional["_models.RealtimeResponseUsage"] = None, + audio: Optional["_models.VoiceResponseAudio"] = None, + output_modalities: Optional[list[Literal["text", "audio"]]] = None, + temperature: Optional[float] = None, + max_output_tokens: Optional[Union[int, Literal["inf"]]] = None, + created_at: Optional[datetime.datetime] = None, + completed_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.object: Literal["realtime.response"] = "realtime.response" + + +class VoiceResponseAudio(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Audio configuration for a response. Follows the OpenAI Realtime GA ``audio`` object shape. + + :ivar output: The audio output configuration used for the response. + :vartype output: ~azure.ai.voiceagents.models.VoiceResponseAudioOutput + """ + + output: Optional["_models.VoiceResponseAudioOutput"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The audio output configuration used for the response.""" + + @overload + def __init__( + self, + *, + output: Optional["_models.VoiceResponseAudioOutput"] = 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 VoiceResponseAudioOutput(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The output audio format used for a response. Follows the OpenAI Realtime GA audio format + discriminated union. + + :ivar voice: The voice used for the response's audio output. Is one of the following types: + OpenAIVoice, AzureVoice, AzureRealtimeNativeVoice + :vartype voice: ~azure.ai.voiceagents.models.OpenAIVoice or + ~azure.ai.voiceagents.models.AzureVoice or + ~azure.ai.voiceagents.models.AzureRealtimeNativeVoice + :ivar format: The audio format used for the response's audio output. + :vartype format: ~azure.ai.voiceagents.models.RealtimeAudioFormats + """ + + voice: Optional["_unions.VoiceResponseVoice"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The voice used for the response's audio output. Is one of the following types: OpenAIVoice, + AzureVoice, AzureRealtimeNativeVoice""" + format: Optional["_models.RealtimeAudioFormats"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The audio format used for the response's audio output.""" + + @overload + def __init__( + self, + *, + voice: Optional["_unions.VoiceResponseVoice"] = None, + format: Optional["_models.RealtimeAudioFormats"] = 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 VoiceSemanticVadTurnDetection( + VoiceTurnDetection, discriminator="semantic_vad" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Semantic voice activity detection. + + :ivar eagerness: Is one of the following types: Literal["low"], Literal["medium"], + Literal["high"], Literal["auto"] + :vartype eagerness: str or str or str or str + :ivar create_response: + :vartype create_response: bool + :ivar interrupt_response: + :vartype interrupt_response: bool + :ivar type: Required. Semantic voice activity detection. + :vartype type: str or ~azure.ai.voiceagents.models.SEMANTIC_VAD + """ + + eagerness: Optional[Literal["low", "medium", "high", "auto"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is one of the following types: Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"], + Literal[\"auto\"]""" + create_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + interrupt_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Semantic voice activity detection.""" + + @overload + def __init__( + self, + *, + eagerness: Optional[Literal["low", "medium", "high", "auto"]] = 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 = VoiceTurnDetectionType.SEMANTIC_VAD # type: ignore + + +class VoiceServerVadTurnDetection( + VoiceTurnDetection, discriminator="server_vad" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Server-side voice activity detection. + + :ivar threshold: + :vartype threshold: float + :ivar prefix_padding_ms: + :vartype prefix_padding_ms: int + :ivar silence_duration_ms: + :vartype silence_duration_ms: int + :ivar create_response: + :vartype create_response: bool + :ivar interrupt_response: + :vartype interrupt_response: bool + :ivar idle_timeout_ms: + :vartype idle_timeout_ms: int + :ivar type: Required. Server-side voice activity detection. + :vartype type: str or ~azure.ai.voiceagents.models.SERVER_VAD + """ + + threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + prefix_padding_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + silence_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + create_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + interrupt_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + idle_timeout_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[VoiceTurnDetectionType.SERVER_VAD] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Server-side voice activity detection.""" + + @overload + def __init__( + self, + *, + threshold: Optional[float] = None, + prefix_padding_ms: Optional[int] = None, + silence_duration_ms: Optional[int] = None, + create_response: Optional[bool] = None, + interrupt_response: Optional[bool] = None, + idle_timeout_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 = VoiceTurnDetectionType.SERVER_VAD # type: ignore + + +class VoiceSystemMessageItem( + VoiceMessageItem, discriminator="system" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A system message item. Only ``input_text`` content is valid for system messages. + + :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: Required. A message item. + :vartype type: str or ~azure.ai.voiceagents.models.MESSAGE + :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 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 content: The content of the message. Required. + :vartype content: + list[~azure.ai.voiceagents.models.RealtimeConversationItemMessageSystemContent] + :ivar role: Required. SYSTEM. + :vartype role: str or ~azure.ai.voiceagents.models.SYSTEM + """ + + __mapping__: dict[str, _Model] = {} + 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\"]""" + content: list["_models.RealtimeConversationItemMessageSystemContent"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The content of the message. Required.""" + role: Literal[RealtimeConversationItemMessageType.SYSTEM] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. SYSTEM.""" + + @overload + def __init__( + self, + *, + content: list["_models.RealtimeConversationItemMessageSystemContent"], + created_at: Optional[datetime.datetime] = None, + response_id: Optional[str] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + object: Optional[Literal["realtime.item"]] = None, + status: Optional[Literal["completed", "incomplete", "in_progress"]] = 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 = RealtimeConversationItemMessageType.SYSTEM # type: ignore + + +class VoiceSystemTool(_Model): # 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. + + :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.voiceagents.models.VoiceSystemToolName + :ivar description: An optional description of the system tool. + :vartype description: str + """ + + type: Literal["system"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the tool. Always ``system``. Required. Default value is \"system\".""" + name: Union[str, "_models.VoiceSystemToolName"] = rest_field( + 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, + *, + name: Union[str, "_models.VoiceSystemToolName"], + 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: Literal["system"] = "system" + + +class VoiceToolboxTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A reference to a Foundry toolbox, which is a versioned bundle of tools executed through its MCP + endpoint. + + :ivar type: The type of the tool. Always ``toolbox``. Required. Default value is "toolbox". + :vartype type: str + :ivar toolbox_name: The name of the toolbox to attach. Required. + :vartype toolbox_name: str + :ivar toolbox_version: The immutable version of the toolbox to attach. Required. + :vartype toolbox_version: str + """ + + type: Literal["toolbox"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the tool. Always ``toolbox``. Required. Default value is \"toolbox\".""" + toolbox_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the toolbox to attach. Required.""" + toolbox_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The immutable version of the toolbox to attach. Required.""" + + @overload + def __init__( + self, + *, + toolbox_name: str, + toolbox_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) + self.type: Literal["toolbox"] = "toolbox" + + +class VoiceUserMessageItem( + VoiceMessageItem, discriminator="user" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A user message item. ``input_text``, ``input_audio``, and ``input_image`` content are valid for + user messages. + + :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: Required. A message item. + :vartype type: str or ~azure.ai.voiceagents.models.MESSAGE + :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 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 content: The content of the message. Required. + :vartype content: list[~azure.ai.voiceagents.models.RealtimeConversationItemMessageUserContent] + :ivar role: Required. USER. + :vartype role: str or ~azure.ai.voiceagents.models.USER + """ + + __mapping__: dict[str, _Model] = {} + 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\"]""" + content: list["_models.RealtimeConversationItemMessageUserContent"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The content of the message. Required.""" + role: Literal[RealtimeConversationItemMessageType.USER] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. USER.""" + + @overload + def __init__( + self, + *, + content: list["_models.RealtimeConversationItemMessageUserContent"], + created_at: Optional[datetime.datetime] = None, + response_id: Optional[str] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + object: Optional[Literal["realtime.item"]] = None, + status: Optional[Literal["completed", "incomplete", "in_progress"]] = 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 = RealtimeConversationItemMessageType.USER # type: ignore diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/_patch.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/_patch.py new file mode 100644 index 000000000000..87676c65a8f0 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/_patch.py @@ -0,0 +1,21 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" + + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/__init__.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/__init__.py new file mode 100644 index 000000000000..af8ff4734a8f --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/__init__.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import VoiceAgentWebSocketOperations # type: ignore +from ._operations import AgentEndpointConversationsOperations # type: ignore +from ._operations import VoiceAgentsOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "VoiceAgentWebSocketOperations", + "AgentEndpointConversationsOperations", + "VoiceAgentsOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/_operations.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/_operations.py new file mode 100644 index 000000000000..96fefa470126 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/_operations.py @@ -0,0 +1,3612 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from collections.abc import MutableMapping +from io import IOBase +import json +from typing import Any, Callable, IO, Iterator, Literal, Optional, TYPE_CHECKING, TypeVar, Union, overload +import urllib.parse + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from .. import models as _models, types as _types +from .._configuration import VoiceAgentsClientConfiguration +from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from .._utils.serialization import Deserializer, Serializer +from ..models._enums import AgentDefinitionOptInKeys + +if TYPE_CHECKING: + from .. import _unions +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] +JSON = MutableMapping[str, Any] +_Unset: Any = object() + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_voice_agent_web_socket_connect_voice_agent_request( # pylint: disable=name-too-long + agent_name: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + agent_session_id: Optional[str] = None, + agent_version_override: Optional[str] = None, + websocket_subprotocol: Optional[Union[str, _models.VoiceAgentWebSocketSubprotocol]] = None, + structured_inputs: 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")) + # Construct URL + _url = "/agents/{agent_name}/endpoint/protocols/voice" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if agent_session_id is not None: + _params["agent_session_id"] = _SERIALIZER.query("agent_session_id", agent_session_id, "str") + if agent_version_override is not None: + _params["x-agent-version-override"] = _SERIALIZER.query("agent_version_override", agent_version_override, "str") + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") + if websocket_subprotocol is not None: + _headers["Sec-WebSocket-Protocol"] = _SERIALIZER.header("websocket_subprotocol", websocket_subprotocol, "str") + if structured_inputs is not None: + _headers["x-ms-voice-structured-inputs"] = _SERIALIZER.header("structured_inputs", structured_inputs, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_agent_endpoint_conversations_get_agent_conversation_request( # pylint: disable=name-too-long + agent_name: str, + conversation_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **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/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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_agent_endpoint_conversations_delete_agent_conversation_request( # pylint: disable=name-too-long + agent_name: str, + conversation_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **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")) + # Construct URL + _url = "/agents/{agent_name}/endpoint/protocols/voice/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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_agent_endpoint_conversations_list_agent_conversation_responses_request( # pylint: disable=name-too-long + agent_name: str, + conversation_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + 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/conversations/{conversation_id}/responses" + 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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_agent_endpoint_conversations_get_agent_conversation_response_request( # pylint: disable=name-too-long + agent_name: str, + conversation_id: str, + response_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **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/conversations/{conversation_id}/responses/{response_id}" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + "response_id": _SERIALIZER.url("response_id", response_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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_agent_endpoint_conversations_list_agent_conversation_response_items_request( # pylint: disable=name-too-long + agent_name: str, + conversation_id: str, + response_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + 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/conversations/{conversation_id}/responses/{response_id}/items" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + "response_id": _SERIALIZER.url("response_id", response_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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_agent_endpoint_conversations_list_agent_conversation_items_request( # pylint: disable=name-too-long + agent_name: str, + conversation_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + 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/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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_agent_endpoint_conversations_get_agent_conversation_item_request( # pylint: disable=name-too-long + agent_name: str, + conversation_id: str, + item_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **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/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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_agent_endpoint_conversations_get_agent_conversation_item_audio_request( # pylint: disable=name-too-long + agent_name: str, + conversation_id: str, + item_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **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/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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_agent_endpoint_conversations_get_agent_conversation_item_audio_content_request( # pylint: disable=name-too-long + agent_name: str, + conversation_id: str, + item_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **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/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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_agent_endpoint_conversations_get_agent_conversation_audio_request( # pylint: disable=name-too-long + agent_name: str, + conversation_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **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/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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_agent_endpoint_conversations_get_agent_conversation_audio_content_request( # pylint: disable=name-too-long + agent_name: str, + conversation_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **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/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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_voice_agents_create_voice_agent_request( # pylint: disable=name-too-long + *, foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/voice_agents" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_voice_agents_list_voice_agents_request( # pylint: disable=name-too-long + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + 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 = "/voice_agents" + + # 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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_voice_agents_get_voice_agent_request( # pylint: disable=name-too-long + agent_name: str, *, foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], **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 = "/voice_agents/{agent_name}" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_voice_agents_update_voice_agent_request( # pylint: disable=name-too-long + agent_name: str, *, foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/voice_agents/{agent_name}" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_voice_agents_delete_voice_agent_request( # pylint: disable=name-too-long + agent_name: str, *, foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], **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")) + # Construct URL + _url = "/voice_agents/{agent_name}" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_voice_agents_enable_voice_agent_request( # pylint: disable=name-too-long + agent_name: str, *, foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], **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")) + # Construct URL + _url = "/voice_agents/{agent_name}:enable" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_voice_agents_disable_voice_agent_request( # pylint: disable=name-too-long + agent_name: str, *, foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], **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")) + # Construct URL + _url = "/voice_agents/{agent_name}:disable" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_voice_agents_generate_voice_agent_request( # pylint: disable=name-too-long + *, foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/voice_agents:generate" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_voice_agents_create_voice_agent_version_request( # pylint: disable=name-too-long + agent_name: str, *, foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/voice_agents/{agent_name}/versions" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_voice_agents_list_voice_agent_versions_request( # pylint: disable=name-too-long + agent_name: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + after: Optional[str] = None, + before: Optional[str] = None, + include_drafts: Optional[bool] = 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 = "/voice_agents/{agent_name}/versions" + 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") + if include_drafts is not None: + _params["include_drafts"] = _SERIALIZER.query("include_drafts", include_drafts, "bool") + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_voice_agents_get_voice_agent_version_request( # pylint: disable=name-too-long + agent_name: str, + agent_version: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **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 = "/voice_agents/{agent_name}/versions/{agent_version}" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "agent_version": _SERIALIZER.url("agent_version", agent_version, "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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_voice_agents_delete_voice_agent_version_request( # pylint: disable=name-too-long + agent_name: str, + agent_version: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **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")) + # Construct URL + _url = "/voice_agents/{agent_name}/versions/{agent_version}" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "agent_version": _SERIALIZER.url("agent_version", agent_version, "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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +class VoiceAgentWebSocketOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.voiceagents.VoiceAgentsClient`'s + :attr:`voice_agent_web_socket` 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: VoiceAgentsClientConfiguration = 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 connect_voice_agent( # pylint: disable=inconsistent-return-statements + self, + agent_name: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + agent_session_id: Optional[str] = None, + agent_version_override: Optional[str] = None, + websocket_subprotocol: Optional[Union[str, _models.VoiceAgentWebSocketSubprotocol]] = None, + structured_inputs: Optional[str] = None, + **kwargs: Any + ) -> None: + """Connect to a voice agent. + + Connects to a voice agent over WebSocket. The client must send an HTTP GET with ``Upgrade: + websocket`` headers. The optional ``realtime`` subprotocol is the only accepted subprotocol + value. + + :param agent_name: The name of the voice agent. Required. + :type agent_name: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword agent_session_id: An optional identifier used to correlate the voice session. Default + value is None. + :paramtype agent_session_id: str + :keyword agent_version_override: Selects a specific version of the voice agent for this + session. Default value is None. + :paramtype agent_version_override: str + :keyword websocket_subprotocol: The requested WebSocket subprotocol. Omit this header or + request exactly ``realtime``. "realtime" Default value is None. + :paramtype websocket_subprotocol: str or + ~azure.ai.voiceagents.models.VoiceAgentWebSocketSubprotocol + :keyword structured_inputs: A JSON object that maps structured-input names to their values for + this session. Default value is None. + :paramtype structured_inputs: 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_voice_agent_web_socket_connect_voice_agent_request( + agent_name=agent_name, + foundry_features=foundry_features, + agent_session_id=agent_session_id, + agent_version_override=agent_version_override, + websocket_subprotocol=websocket_subprotocol, + structured_inputs=structured_inputs, + 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 [101]: + 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["Sec-WebSocket-Protocol"] = self._deserialize( + "str", response.headers.get("Sec-WebSocket-Protocol") + ) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + +class AgentEndpointConversationsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.voiceagents.VoiceAgentsClient`'s + :attr:`agent_endpoint_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: VoiceAgentsClientConfiguration = 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 get_agent_conversation( + self, + agent_name: str, + conversation_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> _models.VoiceConversation: + """Get a voice agent conversation. + + Retrieves a single conversation recorded for the specified voice agent endpoint by its id. + Returns ``404`` when the conversation was not persisted (``store = false``) or does not exist. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation to retrieve. Required. + :type conversation_id: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :return: VoiceConversation. The VoiceConversation is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceConversation + :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.VoiceConversation] = kwargs.pop("cls", None) + + _request = build_agent_endpoint_conversations_get_agent_conversation_request( + agent_name=agent_name, + conversation_id=conversation_id, + foundry_features=foundry_features, + 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.VoiceConversation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete_agent_conversation( # pylint: disable=inconsistent-return-statements + self, + agent_name: str, + conversation_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> None: + """Delete a voice agent conversation. + + Deletes a conversation and all of its stored data — responses, items, and any audio (cascade). + This is the customer's explicit data-deletion control for voice conversations. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation to delete. Required. + :type conversation_id: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :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_agent_endpoint_conversations_delete_agent_conversation_request( + agent_name=agent_name, + conversation_id=conversation_id, + foundry_features=foundry_features, + 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_agent_conversation_responses( + self, + agent_name: str, + conversation_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.VoiceResponse"]: + """List responses in a voice agent conversation. + + Returns a paged collection of the responses (model inference turns) recorded for the specified + conversation. The per-response ``output`` projection may be omitted here; use the + response-items route for the canonical paged output. Returns ``404`` when the conversation was + not persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose responses are listed. Required. + :type conversation_id: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :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.voiceagents.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 VoiceResponse + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.voiceagents.models.VoiceResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[list[_models.VoiceResponse]] = 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_agent_endpoint_conversations_list_agent_conversation_responses_request( + agent_name=agent_name, + conversation_id=conversation_id, + foundry_features=foundry_features, + 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.VoiceResponse], + 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_agent_conversation_response( + self, + agent_name: str, + conversation_id: str, + response_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> _models.VoiceResponse: + """Get a voice agent conversation response. + + Retrieves a single response from the specified conversation by its id, including its ``output`` + items, ``usage``, and status. Returns ``404`` when the conversation or response was not + persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the response. Required. + :type conversation_id: str + :param response_id: The id of the response to retrieve. Required. + :type response_id: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :return: VoiceResponse. The VoiceResponse is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceResponse + :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.VoiceResponse] = kwargs.pop("cls", None) + + _request = build_agent_endpoint_conversations_get_agent_conversation_response_request( + agent_name=agent_name, + conversation_id=conversation_id, + response_id=response_id, + foundry_features=foundry_features, + 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.VoiceResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_agent_conversation_response_items( + self, + agent_name: str, + conversation_id: str, + response_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.VoiceConversationItem"]: + """List items produced by a voice agent conversation response. + + Returns a paged collection of the output items produced by a specific response (the response's + output projection). For the complete ordered conversation history — including user input and + client-created tool outputs — use the conversation items route instead. Returns ``404`` when + the conversation or response was not persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the response. Required. + :type conversation_id: str + :param response_id: The id of the response whose output items are listed. Required. + :type response_id: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :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.voiceagents.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 VoiceConversationItem + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.voiceagents.models.VoiceConversationItem] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[list[_models.VoiceConversationItem]] = 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_agent_endpoint_conversations_list_agent_conversation_response_items_request( + agent_name=agent_name, + conversation_id=conversation_id, + response_id=response_id, + foundry_features=foundry_features, + 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.VoiceConversationItem], + 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 list_agent_conversation_items( + self, + agent_name: str, + conversation_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.VoiceConversationItem"]: + """List items in a voice agent conversation. + + Returns a paged collection of items — the complete ordered conversation history, including user + input, assistant output, and client-created tool outputs (transcripts + tool events). Returns + ``404`` when the conversation was not persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose items are listed. Required. + :type conversation_id: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :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.voiceagents.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 VoiceConversationItem + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.voiceagents.models.VoiceConversationItem] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[list[_models.VoiceConversationItem]] = 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_agent_endpoint_conversations_list_agent_conversation_items_request( + agent_name=agent_name, + conversation_id=conversation_id, + foundry_features=foundry_features, + 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.VoiceConversationItem], + 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_agent_conversation_item( + self, + agent_name: str, + conversation_id: str, + item_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> _models.VoiceConversationItem: + """Get a voice agent conversation item. + + Retrieves a single item from the specified conversation by its id, including its transcript. An + ``input_audio``/``output_audio`` content part indicates that audio is available for the item; + the canonical per-item audio metadata is the ``/items/{item_id}/audio`` resource, and the bytes + are streamed by ``/items/{item_id}/audio/content``. Returns ``404`` when the conversation or + item was not persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item to retrieve. Required. + :type item_id: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :return: VoiceConversationItem. The VoiceConversationItem is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceConversationItem + :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.VoiceConversationItem] = kwargs.pop("cls", None) + + _request = build_agent_endpoint_conversations_get_agent_conversation_item_request( + agent_name=agent_name, + conversation_id=conversation_id, + item_id=item_id, + foundry_features=foundry_features, + 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.VoiceConversationItem, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_agent_conversation_item_audio( + self, + agent_name: str, + conversation_id: str, + item_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> _models.VoiceItemAudioResponse: + """Get a voice agent conversation item's audio metadata. + + Returns metadata for a single conversation item's audio segment, including the common playback + facts (role, format/codec, sample rate, channels, offset, duration) for both Foundry-managed + and bring-your-own-storage (BYOS) recordings; for BYOS the response additionally includes + ``blob_uri``, the URI of the recording in the customer's own storage (no SAS) that the customer + downloads with their own credentials. Requires the conversation to have persisted audio + (``store = true``); returns ``404`` when the conversation, item, or its audio was not + persisted. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose audio metadata is retrieved. Required. + :type item_id: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :return: VoiceItemAudioResponse. The VoiceItemAudioResponse is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceItemAudioResponse + :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.VoiceItemAudioResponse] = kwargs.pop("cls", None) + + _request = build_agent_endpoint_conversations_get_agent_conversation_item_audio_request( + agent_name=agent_name, + conversation_id=conversation_id, + item_id=item_id, + foundry_features=foundry_features, + 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.VoiceItemAudioResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_agent_conversation_item_audio_content( # pylint: disable=name-too-long + self, + agent_name: str, + conversation_id: str, + item_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> Iterator[bytes]: + """Stream a voice agent conversation item's audio. + + Streams a single conversation item's audio as a WAV (``audio/wav``) byte stream through the + service (no SAS URL). This route serves Foundry-managed storage only. For + bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download + directly from customer storage using the ``blob_uri`` returned by the item's ``/audio`` + metadata route — so this route returns ``409 Conflict`` for BYOS recordings. Returns ``404`` + when the conversation, item, or its audio was not persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose audio is streamed. Required. + :type item_id: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :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_agent_endpoint_conversations_get_agent_conversation_item_audio_content_request( + agent_name=agent_name, + conversation_id=conversation_id, + item_id=item_id, + foundry_features=foundry_features, + 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_agent_conversation_audio( + self, + agent_name: str, + conversation_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> _models.VoiceRecordingResponse: + """Get a voice agent conversation's merged recording metadata. + + Returns metadata for the whole-call merged stereo recording (user audio on the left channel, + agent audio on the right). The common metadata (format, sample rate, channels, channel layout, + duration) is returned for both Foundry-managed and bring-your-own-storage (BYOS) recordings; + for BYOS the response additionally includes ``blob_uri``, the URI of the recording in the + customer's own storage (no SAS) that the customer downloads with their own credentials. The + recording is built once from the per-turn segments after the session ends; a request against an + in-progress session returns ``409``. Requires the conversation to have persisted audio (``store + = true``); otherwise returns ``404``. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose merged recording metadata is + retrieved. Required. + :type conversation_id: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :return: VoiceRecordingResponse. The VoiceRecordingResponse is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceRecordingResponse + :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.VoiceRecordingResponse] = kwargs.pop("cls", None) + + _request = build_agent_endpoint_conversations_get_agent_conversation_audio_request( + agent_name=agent_name, + conversation_id=conversation_id, + foundry_features=foundry_features, + 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.VoiceRecordingResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_agent_conversation_audio_content( + self, + agent_name: str, + conversation_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> Iterator[bytes]: + """Stream a voice agent conversation's merged recording. + + Streams the whole-call merged stereo recording as a WAV (``audio/wav``) byte stream through the + service (no SAS URL). This route serves Foundry-managed storage only. For + bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download + directly from customer storage using the ``blob_uri`` returned by the metadata route — so this + route returns ``409 Conflict`` for BYOS recordings. A request against an in-progress session + also returns ``409`` (a distinct condition: session-not-ended versus BYOS-download-required). A + conversation without persisted audio (``store = false``) returns ``404``. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose merged recording is streamed. + Required. + :type conversation_id: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :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_agent_endpoint_conversations_get_agent_conversation_audio_content_request( + agent_name=agent_name, + conversation_id=conversation_id, + foundry_features=foundry_features, + 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 VoiceAgentsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.voiceagents.VoiceAgentsClient`'s + :attr:`voice_agents` 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: VoiceAgentsClientConfiguration = 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") + + @overload + def create_voice_agent( + self, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + name: str, + definition: _models.VoiceAgentDefinition, + content_type: str = "application/json", + state: Optional[Union[str, _models.AgentState]] = None, + metadata: Optional[dict[str, str]] = None, + description: Optional[str] = None, + blueprint_reference: Optional[_models.AgentBlueprintReference] = None, + draft: Optional[bool] = None, + agent_endpoint: Optional[_models.AgentEndpointConfig] = None, + agent_card: Optional[_models.AgentCard] = None, + **kwargs: Any + ) -> _models.VoiceAgentObject: + """Create a voice agent. + + Creates a new voice agent, or a new version of an existing one. + + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword name: The unique name that identifies the agent. Name can be used to + retrieve/update/delete the agent. + + * Must start and end with alphanumeric characters, + * Can contain hyphens in the middle + * Must not exceed 63 characters. Required. + :paramtype name: str + :keyword definition: The voice agent definition. Required. + :paramtype definition: ~azure.ai.voiceagents.models.VoiceAgentDefinition + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword state: The initial operational state of the agent. Defaults to 'enabled' if not + specified. Known values are: "enabled" and "disabled". Default value is None. + :paramtype state: str or ~azure.ai.voiceagents.models.AgentState + :keyword 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. Default value is None. + :paramtype metadata: dict[str, str] + :keyword description: A human-readable description of the agent. Default value is None. + :paramtype description: str + :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. + :paramtype blueprint_reference: ~azure.ai.voiceagents.models.AgentBlueprintReference + :keyword draft: (Preview) Whether this agent version is a draft (candidate) rather than a + release. The service defaults to ``false`` if a value is not specified by the caller. Draft + versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. + Default value is None. + :paramtype draft: bool + :keyword agent_endpoint: An optional endpoint configuration. If not specified, a default + endpoint configuration will be set for the agent. Default value is None. + :paramtype agent_endpoint: ~azure.ai.voiceagents.models.AgentEndpointConfig + :keyword agent_card: Optional agent card for the agent. Default value is None. + :paramtype agent_card: ~azure.ai.voiceagents.models.AgentCard + :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_voice_agent( + self, + body: _types.CreateVoiceAgentRequest, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VoiceAgentObject: + """Create a voice agent. + + Creates a new voice agent, or a new version of an existing one. + + :param body: Required. + :type body: ~azure.ai.voiceagents.types.CreateVoiceAgentRequest + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_voice_agent( + self, + body: IO[bytes], + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VoiceAgentObject: + """Create a voice agent. + + Creates a new voice agent, or a new version of an existing one. + + :param body: Required. + :type body: IO[bytes] + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_voice_agent( # pylint: disable=too-many-locals + self, + body: Union[JSON, _types.CreateVoiceAgentRequest, IO[bytes]] = _Unset, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + name: str = _Unset, + definition: _models.VoiceAgentDefinition = _Unset, + state: Optional[Union[str, _models.AgentState]] = None, + metadata: Optional[dict[str, str]] = None, + description: Optional[str] = None, + blueprint_reference: Optional[_models.AgentBlueprintReference] = None, + draft: Optional[bool] = None, + agent_endpoint: Optional[_models.AgentEndpointConfig] = None, + agent_card: Optional[_models.AgentCard] = None, + **kwargs: Any + ) -> _models.VoiceAgentObject: + """Create a voice agent. + + Creates a new voice agent, or a new version of an existing one. + + :param body: Is one of the following types: JSON, CreateVoiceAgentRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.voiceagents.types.CreateVoiceAgentRequest or IO[bytes] + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword name: The unique name that identifies the agent. Name can be used to + retrieve/update/delete the agent. + + * Must start and end with alphanumeric characters, + * Can contain hyphens in the middle + * Must not exceed 63 characters. Required. + :paramtype name: str + :keyword definition: The voice agent definition. Required. + :paramtype definition: ~azure.ai.voiceagents.models.VoiceAgentDefinition + :keyword state: The initial operational state of the agent. Defaults to 'enabled' if not + specified. Known values are: "enabled" and "disabled". Default value is None. + :paramtype state: str or ~azure.ai.voiceagents.models.AgentState + :keyword 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. Default value is None. + :paramtype metadata: dict[str, str] + :keyword description: A human-readable description of the agent. Default value is None. + :paramtype description: str + :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. + :paramtype blueprint_reference: ~azure.ai.voiceagents.models.AgentBlueprintReference + :keyword draft: (Preview) Whether this agent version is a draft (candidate) rather than a + release. The service defaults to ``false`` if a value is not specified by the caller. Draft + versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. + Default value is None. + :paramtype draft: bool + :keyword agent_endpoint: An optional endpoint configuration. If not specified, a default + endpoint configuration will be set for the agent. Default value is None. + :paramtype agent_endpoint: ~azure.ai.voiceagents.models.AgentEndpointConfig + :keyword agent_card: Optional agent card for the agent. Default value is None. + :paramtype agent_card: ~azure.ai.voiceagents.models.AgentCard + :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VoiceAgentObject] = kwargs.pop("cls", None) + + if body is _Unset: + if name is _Unset: + raise TypeError("missing required argument: name") + if definition is _Unset: + raise TypeError("missing required argument: definition") + body = { + "agent_card": agent_card, + "agent_endpoint": agent_endpoint, + "blueprint_reference": blueprint_reference, + "definition": definition, + "description": description, + "draft": draft, + "metadata": metadata, + "name": name, + "state": state, + } + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_voice_agents_create_voice_agent_request( + foundry_features=foundry_features, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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 [201]: + 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.VoiceAgentObject, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_voice_agents( + self, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.VoiceAgentObject"]: + """List voice agents. + + Returns a paged collection of voice agents. + + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :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.voiceagents.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 VoiceAgentObject + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.voiceagents.models.VoiceAgentObject] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[list[_models.VoiceAgentObject]] = 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_voice_agents_list_voice_agents_request( + foundry_features=foundry_features, + 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.VoiceAgentObject], + 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_voice_agent( + self, + agent_name: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> _models.VoiceAgentObject: + """Get a voice agent. + + Retrieves a voice agent by its unique name. + + :param agent_name: The name of the voice agent to retrieve. Required. + :type agent_name: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject + :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.VoiceAgentObject] = kwargs.pop("cls", None) + + _request = build_voice_agents_get_voice_agent_request( + agent_name=agent_name, + foundry_features=foundry_features, + 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.VoiceAgentObject, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update_voice_agent( + self, + agent_name: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + definition: _models.VoiceAgentDefinition, + content_type: str = "application/json", + metadata: Optional[dict[str, str]] = None, + description: Optional[str] = None, + blueprint_reference: Optional[_models.AgentBlueprintReference] = None, + **kwargs: Any + ) -> _models.VoiceAgentObject: + """Update a voice agent. + + Updates a voice agent by adding a new version if there are any changes to the agent definition. + If no changes, returns the existing agent version. + + :param agent_name: The name of the voice agent to update. Required. + :type agent_name: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword definition: The voice agent definition. Required. + :paramtype definition: ~azure.ai.voiceagents.models.VoiceAgentDefinition + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword 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. Default value is None. + :paramtype metadata: dict[str, str] + :keyword description: A human-readable description of the agent. Default value is None. + :paramtype description: str + :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. + :paramtype blueprint_reference: ~azure.ai.voiceagents.models.AgentBlueprintReference + :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_voice_agent( + self, + agent_name: str, + body: _types.UpdateVoiceAgentRequest, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VoiceAgentObject: + """Update a voice agent. + + Updates a voice agent by adding a new version if there are any changes to the agent definition. + If no changes, returns the existing agent version. + + :param agent_name: The name of the voice agent to update. Required. + :type agent_name: str + :param body: Required. + :type body: ~azure.ai.voiceagents.types.UpdateVoiceAgentRequest + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_voice_agent( + self, + agent_name: str, + body: IO[bytes], + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VoiceAgentObject: + """Update a voice agent. + + Updates a voice agent by adding a new version if there are any changes to the agent definition. + If no changes, returns the existing agent version. + + :param agent_name: The name of the voice agent to update. Required. + :type agent_name: str + :param body: Required. + :type body: IO[bytes] + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_voice_agent( + self, + agent_name: str, + body: Union[JSON, _types.UpdateVoiceAgentRequest, IO[bytes]] = _Unset, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + definition: _models.VoiceAgentDefinition = _Unset, + metadata: Optional[dict[str, str]] = None, + description: Optional[str] = None, + blueprint_reference: Optional[_models.AgentBlueprintReference] = None, + **kwargs: Any + ) -> _models.VoiceAgentObject: + """Update a voice agent. + + Updates a voice agent by adding a new version if there are any changes to the agent definition. + If no changes, returns the existing agent version. + + :param agent_name: The name of the voice agent to update. Required. + :type agent_name: str + :param body: Is one of the following types: JSON, UpdateVoiceAgentRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.voiceagents.types.UpdateVoiceAgentRequest or IO[bytes] + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword definition: The voice agent definition. Required. + :paramtype definition: ~azure.ai.voiceagents.models.VoiceAgentDefinition + :keyword 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. Default value is None. + :paramtype metadata: dict[str, str] + :keyword description: A human-readable description of the agent. Default value is None. + :paramtype description: str + :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. + :paramtype blueprint_reference: ~azure.ai.voiceagents.models.AgentBlueprintReference + :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VoiceAgentObject] = kwargs.pop("cls", None) + + if body is _Unset: + if definition is _Unset: + raise TypeError("missing required argument: definition") + body = { + "blueprint_reference": blueprint_reference, + "definition": definition, + "description": description, + "metadata": metadata, + } + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_voice_agents_update_voice_agent_request( + agent_name=agent_name, + foundry_features=foundry_features, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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.VoiceAgentObject, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete_voice_agent( # pylint: disable=inconsistent-return-statements + self, + agent_name: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> None: + """Delete a voice agent. + + Deletes a voice agent and all of its versions. + + :param agent_name: The name of the voice agent to delete. Required. + :type agent_name: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :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_voice_agents_delete_voice_agent_request( + agent_name=agent_name, + foundry_features=foundry_features, + 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 enable_voice_agent( # pylint: disable=inconsistent-return-statements + self, + agent_name: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> None: + """Enable a voice agent. + + Enables the specified voice agent, allowing it to accept new requests. This operation is + idempotent — enabling an already-enabled voice agent returns success with no side effects. + + :param agent_name: The name of the voice agent to enable. Required. + :type agent_name: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :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_voice_agents_enable_voice_agent_request( + agent_name=agent_name, + foundry_features=foundry_features, + 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 disable_voice_agent( # pylint: disable=inconsistent-return-statements + self, + agent_name: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> None: + """Disable a voice agent. + + Disables the specified voice agent, preventing it from accepting new requests. This operation + is idempotent — disabling an already-disabled voice agent returns success with no side effects. + + :param agent_name: The name of the voice agent to disable. Required. + :type agent_name: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :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_voice_agents_disable_voice_agent_request( + agent_name=agent_name, + foundry_features=foundry_features, + 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 + + @overload + def generate_voice_agent( + self, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + name: str, + model_type: Union[str, _models.VoiceModelType], + model: str, + agent_type: Union[str, _models.VoiceAgentType], + use_case: Union[str, _models.VoiceAgentUseCase], + goal: str, + content_type: str = "application/json", + description: Optional[str] = None, + tools: Optional[list["_unions.VoiceAgentTool"]] = None, + draft: Optional[bool] = None, + **kwargs: Any + ) -> _models.VoiceAgentObject: + """Generate a voice agent. + + Generates and creates a voice agent from high-level inputs plus a natural-language goal. The + operation expands the goal into a full, editable definition, creates the agent through the + standard voice create path, and returns the created ``VoiceAgentObject``. The caller can edit + or override the generated fields afterward through normal versioning. + + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword name: The unique name for the agent to create. Required. + :paramtype name: str + :keyword model_type: How the model backing the generated agent is served: ``managed`` + (service-managed) or ``self_deployed`` (the customer's own deployment). Carried through to the + generated definition, not generated. Known values are: "managed" and "self_deployed". Required. + :paramtype model_type: str or ~azure.ai.voiceagents.models.VoiceModelType + :keyword model: The model paired with ``model_type``: the service-managed model name when + ``managed``, or the customer's Foundry deployment name when ``self_deployed``. Carried through, + not generated. Required. + :paramtype model: str + :keyword agent_type: The persona/tone to steer generation. Known values are: "personal" and + "business". Required. + :paramtype agent_type: str or ~azure.ai.voiceagents.models.VoiceAgentType + :keyword use_case: The scenario-template catalog entry the generator specializes for. Known + values are: "customer_support", "reception", "sales", "travel_assistant", "outreach", + "personal_assistant", "learning", "call_center", and "in_car". Required. + :paramtype use_case: str or ~azure.ai.voiceagents.models.VoiceAgentUseCase + :keyword goal: A natural-language description of what the agent should do; the seed for the + generated ``instructions``. Required. + :paramtype goal: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword description: An optional description for the agent. Generated from ``goal`` when + omitted. Default value is None. + :paramtype description: str + :keyword tools: Optional tools carried through verbatim onto the generated agent (see + ``VoiceAgentTool``). Default value is None. + :paramtype tools: list[~azure.ai.voiceagents.models.RealtimeFunctionTool or + ~azure.ai.voiceagents.models.VoiceAgentMcpTool or ~azure.ai.voiceagents.models.VoiceSystemTool + or ~azure.ai.voiceagents.models.VoiceToolboxTool] + :keyword draft: (Preview) When ``true``, the generated voice agent is created as a draft — an + editable, unpublished version the caller can review and refine before publishing it via the + standard create/version path. The service defaults to ``false`` if a value is not specified by + the caller, in which case the agent is created and published normally. Default value is None. + :paramtype draft: bool + :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def generate_voice_agent( + self, + body: _types.GenerateVoiceAgentRequest, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VoiceAgentObject: + """Generate a voice agent. + + Generates and creates a voice agent from high-level inputs plus a natural-language goal. The + operation expands the goal into a full, editable definition, creates the agent through the + standard voice create path, and returns the created ``VoiceAgentObject``. The caller can edit + or override the generated fields afterward through normal versioning. + + :param body: Required. + :type body: ~azure.ai.voiceagents.types.GenerateVoiceAgentRequest + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def generate_voice_agent( + self, + body: IO[bytes], + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VoiceAgentObject: + """Generate a voice agent. + + Generates and creates a voice agent from high-level inputs plus a natural-language goal. The + operation expands the goal into a full, editable definition, creates the agent through the + standard voice create path, and returns the created ``VoiceAgentObject``. The caller can edit + or override the generated fields afterward through normal versioning. + + :param body: Required. + :type body: IO[bytes] + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def generate_voice_agent( # pylint: disable=too-many-locals + self, + body: Union[JSON, _types.GenerateVoiceAgentRequest, IO[bytes]] = _Unset, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + name: str = _Unset, + model_type: Union[str, _models.VoiceModelType] = _Unset, + model: str = _Unset, + agent_type: Union[str, _models.VoiceAgentType] = _Unset, + use_case: Union[str, _models.VoiceAgentUseCase] = _Unset, + goal: str = _Unset, + description: Optional[str] = None, + tools: Optional[list["_unions.VoiceAgentTool"]] = None, + draft: Optional[bool] = None, + **kwargs: Any + ) -> _models.VoiceAgentObject: + """Generate a voice agent. + + Generates and creates a voice agent from high-level inputs plus a natural-language goal. The + operation expands the goal into a full, editable definition, creates the agent through the + standard voice create path, and returns the created ``VoiceAgentObject``. The caller can edit + or override the generated fields afterward through normal versioning. + + :param body: Is one of the following types: JSON, GenerateVoiceAgentRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.voiceagents.types.GenerateVoiceAgentRequest or IO[bytes] + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword name: The unique name for the agent to create. Required. + :paramtype name: str + :keyword model_type: How the model backing the generated agent is served: ``managed`` + (service-managed) or ``self_deployed`` (the customer's own deployment). Carried through to the + generated definition, not generated. Known values are: "managed" and "self_deployed". Required. + :paramtype model_type: str or ~azure.ai.voiceagents.models.VoiceModelType + :keyword model: The model paired with ``model_type``: the service-managed model name when + ``managed``, or the customer's Foundry deployment name when ``self_deployed``. Carried through, + not generated. Required. + :paramtype model: str + :keyword agent_type: The persona/tone to steer generation. Known values are: "personal" and + "business". Required. + :paramtype agent_type: str or ~azure.ai.voiceagents.models.VoiceAgentType + :keyword use_case: The scenario-template catalog entry the generator specializes for. Known + values are: "customer_support", "reception", "sales", "travel_assistant", "outreach", + "personal_assistant", "learning", "call_center", and "in_car". Required. + :paramtype use_case: str or ~azure.ai.voiceagents.models.VoiceAgentUseCase + :keyword goal: A natural-language description of what the agent should do; the seed for the + generated ``instructions``. Required. + :paramtype goal: str + :keyword description: An optional description for the agent. Generated from ``goal`` when + omitted. Default value is None. + :paramtype description: str + :keyword tools: Optional tools carried through verbatim onto the generated agent (see + ``VoiceAgentTool``). Default value is None. + :paramtype tools: list[~azure.ai.voiceagents.models.RealtimeFunctionTool or + ~azure.ai.voiceagents.models.VoiceAgentMcpTool or ~azure.ai.voiceagents.models.VoiceSystemTool + or ~azure.ai.voiceagents.models.VoiceToolboxTool] + :keyword draft: (Preview) When ``true``, the generated voice agent is created as a draft — an + editable, unpublished version the caller can review and refine before publishing it via the + standard create/version path. The service defaults to ``false`` if a value is not specified by + the caller, in which case the agent is created and published normally. Default value is None. + :paramtype draft: bool + :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VoiceAgentObject] = kwargs.pop("cls", None) + + if body is _Unset: + if name is _Unset: + raise TypeError("missing required argument: name") + if model_type is _Unset: + raise TypeError("missing required argument: model_type") + if model is _Unset: + raise TypeError("missing required argument: model") + if agent_type is _Unset: + raise TypeError("missing required argument: agent_type") + if use_case is _Unset: + raise TypeError("missing required argument: use_case") + if goal is _Unset: + raise TypeError("missing required argument: goal") + body = { + "agent_type": agent_type, + "description": description, + "draft": draft, + "goal": goal, + "model": model, + "model_type": model_type, + "name": name, + "tools": tools, + "use_case": use_case, + } + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_voice_agents_generate_voice_agent_request( + foundry_features=foundry_features, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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.VoiceAgentObject, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_voice_agent_version( + self, + agent_name: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + definition: _models.VoiceAgentDefinition, + content_type: str = "application/json", + metadata: Optional[dict[str, str]] = None, + description: Optional[str] = None, + blueprint_reference: Optional[_models.AgentBlueprintReference] = None, + draft: Optional[bool] = None, + **kwargs: Any + ) -> _models.VoiceAgentVersionObject: + """Create a voice agent version. + + Creates a new version for the specified voice agent and returns the created version resource. + + :param agent_name: The name of the voice agent. Required. + :type agent_name: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword definition: The voice agent definition. Required. + :paramtype definition: ~azure.ai.voiceagents.models.VoiceAgentDefinition + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword 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. Default value is None. + :paramtype metadata: dict[str, str] + :keyword description: A human-readable description of the agent. Default value is None. + :paramtype description: str + :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. + :paramtype blueprint_reference: ~azure.ai.voiceagents.models.AgentBlueprintReference + :keyword draft: (Preview) Whether this agent version is a draft (candidate) rather than a + release. The service defaults to ``false`` if a value is not specified by the caller. Draft + versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. + Default value is None. + :paramtype draft: bool + :return: VoiceAgentVersionObject. The VoiceAgentVersionObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentVersionObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_voice_agent_version( + self, + agent_name: str, + body: _types.CreateVoiceAgentVersionRequest, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VoiceAgentVersionObject: + """Create a voice agent version. + + Creates a new version for the specified voice agent and returns the created version resource. + + :param agent_name: The name of the voice agent. Required. + :type agent_name: str + :param body: Required. + :type body: ~azure.ai.voiceagents.types.CreateVoiceAgentVersionRequest + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: VoiceAgentVersionObject. The VoiceAgentVersionObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentVersionObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_voice_agent_version( + self, + agent_name: str, + body: IO[bytes], + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.VoiceAgentVersionObject: + """Create a voice agent version. + + Creates a new version for the specified voice agent and returns the created version resource. + + :param agent_name: The name of the voice agent. Required. + :type agent_name: str + :param body: Required. + :type body: IO[bytes] + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: VoiceAgentVersionObject. The VoiceAgentVersionObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentVersionObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_voice_agent_version( + self, + agent_name: str, + body: Union[JSON, _types.CreateVoiceAgentVersionRequest, IO[bytes]] = _Unset, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + definition: _models.VoiceAgentDefinition = _Unset, + metadata: Optional[dict[str, str]] = None, + description: Optional[str] = None, + blueprint_reference: Optional[_models.AgentBlueprintReference] = None, + draft: Optional[bool] = None, + **kwargs: Any + ) -> _models.VoiceAgentVersionObject: + """Create a voice agent version. + + Creates a new version for the specified voice agent and returns the created version resource. + + :param agent_name: The name of the voice agent. Required. + :type agent_name: str + :param body: Is one of the following types: JSON, CreateVoiceAgentVersionRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.voiceagents.types.CreateVoiceAgentVersionRequest or IO[bytes] + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :keyword definition: The voice agent definition. Required. + :paramtype definition: ~azure.ai.voiceagents.models.VoiceAgentDefinition + :keyword 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. Default value is None. + :paramtype metadata: dict[str, str] + :keyword description: A human-readable description of the agent. Default value is None. + :paramtype description: str + :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. + :paramtype blueprint_reference: ~azure.ai.voiceagents.models.AgentBlueprintReference + :keyword draft: (Preview) Whether this agent version is a draft (candidate) rather than a + release. The service defaults to ``false`` if a value is not specified by the caller. Draft + versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. + Default value is None. + :paramtype draft: bool + :return: VoiceAgentVersionObject. The VoiceAgentVersionObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentVersionObject + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VoiceAgentVersionObject] = kwargs.pop("cls", None) + + if body is _Unset: + if definition is _Unset: + raise TypeError("missing required argument: definition") + body = { + "blueprint_reference": blueprint_reference, + "definition": definition, + "description": description, + "draft": draft, + "metadata": metadata, + } + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_voice_agents_create_voice_agent_version_request( + agent_name=agent_name, + foundry_features=foundry_features, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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.VoiceAgentVersionObject, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_voice_agent_versions( + self, + agent_name: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + include_drafts: Optional[bool] = None, + **kwargs: Any + ) -> ItemPaged["_models.VoiceAgentVersionObject"]: + """List voice agent versions. + + Returns a paged collection of versions for the specified voice agent. + + :param agent_name: The name of the voice agent to retrieve versions for. Required. + :type agent_name: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :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.voiceagents.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 + :keyword include_drafts: (Preview) Whether to include draft versions in the listing. The + service defaults to ``false`` if a value is not specified by the caller (only non-draft + versions are returned). Default value is None. + :paramtype include_drafts: bool + :return: An iterator like instance of VoiceAgentVersionObject + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.voiceagents.models.VoiceAgentVersionObject] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[list[_models.VoiceAgentVersionObject]] = 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_voice_agents_list_voice_agent_versions_request( + agent_name=agent_name, + foundry_features=foundry_features, + limit=limit, + order=order, + after=_continuation_token, + before=before, + include_drafts=include_drafts, + 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.VoiceAgentVersionObject], + 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_voice_agent_version( + self, + agent_name: str, + agent_version: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> _models.VoiceAgentVersionObject: + """Get a voice agent version. + + Retrieves the specified version of a voice agent by its agent name and version identifier. + + :param agent_name: The name of the voice agent to retrieve. Required. + :type agent_name: str + :param agent_version: The version of the voice agent to retrieve. Required. + :type agent_version: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :return: VoiceAgentVersionObject. The VoiceAgentVersionObject is compatible with MutableMapping + :rtype: ~azure.ai.voiceagents.models.VoiceAgentVersionObject + :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.VoiceAgentVersionObject] = kwargs.pop("cls", None) + + _request = build_voice_agents_get_voice_agent_version_request( + agent_name=agent_name, + agent_version=agent_version, + foundry_features=foundry_features, + 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.VoiceAgentVersionObject, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete_voice_agent_version( # pylint: disable=inconsistent-return-statements + self, + agent_name: str, + agent_version: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> None: + """Delete a voice agent version. + + Deletes a specific version of a voice agent. + + :param agent_name: The name of the voice agent to delete. Required. + :type agent_name: str + :param agent_version: The version of the voice agent to delete. Required. + :type agent_version: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW + :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_voice_agents_delete_voice_agent_version_request( + agent_name=agent_name, + agent_version=agent_version, + foundry_features=foundry_features, + 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 diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/_patch.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/_patch.py new file mode 100644 index 000000000000..87676c65a8f0 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/_patch.py @@ -0,0 +1,21 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" + + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/py.typed b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/types.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/types.py new file mode 100644 index 000000000000..32c498a13f7d --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/types.py @@ -0,0 +1,6717 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Literal, Optional, TYPE_CHECKING, Union +from typing_extensions import Required, TypedDict + +from .models._enums import ( + AgentBlueprintReferenceType, + AgentEndpointAuthorizationSchemeType, + AzureVoiceType, + CreateTranscriptionResponseJsonUsageType, + RealtimeClientEventType, + RealtimeConversationItemMessageType, + RealtimeConversationItemType, + RealtimeMcpErrorType, + RealtimeServerEventType, + ToolChoiceParamType, + ToolType, + VersionSelectorType, + VoiceConversationItemType, + VoiceEndOfUtteranceDetectionModel, + VoiceTurnDetectionType, +) + +if TYPE_CHECKING: + from . import _unions + from .models import ( + AgentState, + AzureRealtimeNativeVoiceName, + CallableToolAllowedCaller, + PersonalVoiceModel, + RealtimeReasoningEffort, + ToolChoiceOptions, + VoiceAgentAnimationOutputType, + VoiceAgentAvatarOutputProtocol, + VoiceAgentAvatarType, + VoiceAgentAzureSemanticVadType, + VoiceAgentEchoCancellationReferenceSource, + VoiceAgentEndOfUtteranceModel, + VoiceAgentEndOfUtteranceThresholdLevel, + VoiceAgentEstimatedCostStatus, + VoiceAgentFileSearchCallStatus, + VoiceAgentHandoffAbortReason, + VoiceAgentHandoffReasoningEffort, + VoiceAgentHandoffTargetResponse, + VoiceAgentInterimResponseTrigger, + VoiceAgentMcpResponseScheduling, + VoiceAgentPipelineFamily, + VoiceAgentResponseAudioFormat, + VoiceAgentResponseStatus, + VoiceAgentSessionIncludeOption, + VoiceAgentType, + VoiceAgentUseCase, + VoiceAgentWebSearchCallStatus, + VoiceAudioFormatType, + VoiceAudioTimestampType, + VoiceAvatarOutputProtocol, + VoiceAvatarType, + VoiceEndOfUtteranceThresholdLevel, + VoiceGreetingToolChoice, + VoiceIdsShared, + VoiceInputTranscriptionModel, + VoiceModelType, + VoiceNoiseReductionType, + VoiceOutputModality, + VoiceSystemToolName, + ) + + +class A2AProtocolConfiguration(TypedDict, total=False): + """Configuration specific to the A2A protocol.""" + + +class ActivityProtocolConfiguration(TypedDict, total=False): + """Configuration specific to the activity protocol. + + :ivar enable_m365_public_endpoint: Whether to enable the M365 public endpoint for the activity + protocol. + :vartype enable_m365_public_endpoint: bool + """ + + enable_m365_public_endpoint: bool + """Whether to enable the M365 public endpoint for the activity protocol.""" + + +class AgentCard(TypedDict, total=False): + """AgentCard. + + :ivar version: The version of the agent card. Required. + :vartype version: str + :ivar description: The description of the agent card. + :vartype description: str + :ivar skills: The set of skills that an agent can perform. Required. + :vartype skills: list["AgentCardSkill"] + """ + + version: Required[str] + """The version of the agent card. Required.""" + description: str + """The description of the agent card.""" + skills: Required[list["AgentCardSkill"]] + """The set of skills that an agent can perform. Required.""" + + +class AgentCardSkill(TypedDict, total=False): + """AgentCardSkill. + + :ivar id: a unique identifier for the skill. Required. + :vartype id: str + :ivar name: The name of the skill. Required. + :vartype name: str + :ivar description: A description of the skill. + :vartype description: str + :ivar tags: set of tagwords describing classes of capabilities for the skill. + :vartype tags: list[str] + :ivar examples: A list of example scenarios that the skill can perform. + :vartype examples: list[str] + """ + + id: Required[str] + """a unique identifier for the skill. Required.""" + name: Required[str] + """The name of the skill. Required.""" + description: str + """A description of the skill.""" + tags: list[str] + """set of tagwords describing classes of capabilities for the skill.""" + examples: list[str] + """A list of example scenarios that the skill can perform.""" + + +class AgentEndpointConfig(TypedDict, total=False): + """AgentEndpointConfig. + + :ivar version_selector: The version selector of the agent endpoint determines how traffic is + routed to different versions of the agent. + :vartype version_selector: "VersionSelector" + :ivar protocol_configuration: Per-protocol configuration for the agent endpoint. + :vartype protocol_configuration: "ProtocolConfiguration" + :ivar authorization_schemes: The authorization schemes supported by the agent endpoint. + :vartype authorization_schemes: list["AgentEndpointAuthorizationScheme"] + """ + + version_selector: "VersionSelector" + """The version selector of the agent endpoint determines how traffic is routed to different + versions of the agent.""" + protocol_configuration: "ProtocolConfiguration" + """Per-protocol configuration for the agent endpoint.""" + authorization_schemes: list["AgentEndpointAuthorizationScheme"] + """The authorization schemes supported by the agent endpoint.""" + + +class AzureAvatarVoiceSyncVoice(TypedDict, total=False): + """An Azure avatar voice-synchronization configuration. The runtime derives its voice name from + the avatar character and style. + + :ivar temperature: The synthesis temperature, from 0 to 1. + :vartype temperature: float + :ivar custom_lexicon_url: The URL of a custom pronunciation lexicon. + :vartype custom_lexicon_url: str + :ivar custom_text_normalization_url: The URL of a custom text-normalization service. + :vartype custom_text_normalization_url: str + :ivar prefer_locales: Preferred BCP-47 locales that influence language accents. + :vartype prefer_locales: list[str] + :ivar locale: The enforced BCP-47 locale. When omitted, the language is detected from the text. + :vartype locale: str + :ivar style: The speaking style, such as ``cheerful`` or ``sad``. + :vartype style: str + :ivar pitch: The SSML-compatible pitch adjustment, such as ``+5%``. + :vartype pitch: str + :ivar rate: The SSML-compatible speaking-rate adjustment, such as ``+10%``. + :vartype rate: str + :ivar volume: The SSML-compatible volume adjustment, such as ``+10`` or ``-6dB``. + :vartype volume: str + :ivar type: Required. An Azure avatar voice-synchronization voice. + :vartype type: Literal[AzureVoiceType.AVATAR_VOICE_SYNC] + :ivar model: The neural model used to synthesize the avatar voice. Required. Known values are: + "DragonLatestNeural", "DragonHDOmniLatestNeural", and "MAI-Voice". + :vartype model: Union[str, "PersonalVoiceModel"] + """ + + temperature: float + """The synthesis temperature, from 0 to 1.""" + custom_lexicon_url: str + """The URL of a custom pronunciation lexicon.""" + custom_text_normalization_url: str + """The URL of a custom text-normalization service.""" + prefer_locales: list[str] + """Preferred BCP-47 locales that influence language accents.""" + locale: str + """The enforced BCP-47 locale. When omitted, the language is detected from the text.""" + style: str + """The speaking style, such as ``cheerful`` or ``sad``.""" + pitch: str + """The SSML-compatible pitch adjustment, such as ``+5%``.""" + rate: str + """The SSML-compatible speaking-rate adjustment, such as ``+10%``.""" + volume: str + """The SSML-compatible volume adjustment, such as ``+10`` or ``-6dB``.""" + type: Required[Literal[AzureVoiceType.AVATAR_VOICE_SYNC]] + """Required. An Azure avatar voice-synchronization voice.""" + model: Required[Union[str, "PersonalVoiceModel"]] + """The neural model used to synthesize the avatar voice. Required. Known values are: + \"DragonLatestNeural\", \"DragonHDOmniLatestNeural\", and \"MAI-Voice\".""" + + +class AzureCustomVoice(TypedDict, total=False): + """An Azure custom neural voice configuration. + + :ivar temperature: The synthesis temperature, from 0 to 1. + :vartype temperature: float + :ivar custom_lexicon_url: The URL of a custom pronunciation lexicon. + :vartype custom_lexicon_url: str + :ivar custom_text_normalization_url: The URL of a custom text-normalization service. + :vartype custom_text_normalization_url: str + :ivar prefer_locales: Preferred BCP-47 locales that influence language accents. + :vartype prefer_locales: list[str] + :ivar locale: The enforced BCP-47 locale. When omitted, the language is detected from the text. + :vartype locale: str + :ivar style: The speaking style, such as ``cheerful`` or ``sad``. + :vartype style: str + :ivar pitch: The SSML-compatible pitch adjustment, such as ``+5%``. + :vartype pitch: str + :ivar rate: The SSML-compatible speaking-rate adjustment, such as ``+10%``. + :vartype rate: str + :ivar volume: The SSML-compatible volume adjustment, such as ``+10`` or ``-6dB``. + :vartype volume: str + :ivar type: Required. An Azure custom neural voice. + :vartype type: Literal[AzureVoiceType.AZURE_CUSTOM] + :ivar name: The custom voice name. Required. + :vartype name: str + :ivar endpoint_id: The Azure Speech custom voice deployment endpoint ID. Required. + :vartype endpoint_id: str + """ + + temperature: float + """The synthesis temperature, from 0 to 1.""" + custom_lexicon_url: str + """The URL of a custom pronunciation lexicon.""" + custom_text_normalization_url: str + """The URL of a custom text-normalization service.""" + prefer_locales: list[str] + """Preferred BCP-47 locales that influence language accents.""" + locale: str + """The enforced BCP-47 locale. When omitted, the language is detected from the text.""" + style: str + """The speaking style, such as ``cheerful`` or ``sad``.""" + pitch: str + """The SSML-compatible pitch adjustment, such as ``+5%``.""" + rate: str + """The SSML-compatible speaking-rate adjustment, such as ``+10%``.""" + volume: str + """The SSML-compatible volume adjustment, such as ``+10`` or ``-6dB``.""" + type: Required[Literal[AzureVoiceType.AZURE_CUSTOM]] + """Required. An Azure custom neural voice.""" + name: Required[str] + """The custom voice name. Required.""" + endpoint_id: Required[str] + """The Azure Speech custom voice deployment endpoint ID. Required.""" + + +class AzurePersonalVoice(TypedDict, total=False): + """An Azure personal voice configuration. + + :ivar temperature: The synthesis temperature, from 0 to 1. + :vartype temperature: float + :ivar custom_lexicon_url: The URL of a custom pronunciation lexicon. + :vartype custom_lexicon_url: str + :ivar custom_text_normalization_url: The URL of a custom text-normalization service. + :vartype custom_text_normalization_url: str + :ivar prefer_locales: Preferred BCP-47 locales that influence language accents. + :vartype prefer_locales: list[str] + :ivar locale: The enforced BCP-47 locale. When omitted, the language is detected from the text. + :vartype locale: str + :ivar style: The speaking style, such as ``cheerful`` or ``sad``. + :vartype style: str + :ivar pitch: The SSML-compatible pitch adjustment, such as ``+5%``. + :vartype pitch: str + :ivar rate: The SSML-compatible speaking-rate adjustment, such as ``+10%``. + :vartype rate: str + :ivar volume: The SSML-compatible volume adjustment, such as ``+10`` or ``-6dB``. + :vartype volume: str + :ivar type: Required. An Azure personal voice. + :vartype type: Literal[AzureVoiceType.AZURE_PERSONAL] + :ivar name: The personal voice name. Required. + :vartype name: str + :ivar model: The neural model used by the personal voice. Required. Known values are: + "DragonLatestNeural", "DragonHDOmniLatestNeural", and "MAI-Voice". + :vartype model: Union[str, "PersonalVoiceModel"] + """ + + temperature: float + """The synthesis temperature, from 0 to 1.""" + custom_lexicon_url: str + """The URL of a custom pronunciation lexicon.""" + custom_text_normalization_url: str + """The URL of a custom text-normalization service.""" + prefer_locales: list[str] + """Preferred BCP-47 locales that influence language accents.""" + locale: str + """The enforced BCP-47 locale. When omitted, the language is detected from the text.""" + style: str + """The speaking style, such as ``cheerful`` or ``sad``.""" + pitch: str + """The SSML-compatible pitch adjustment, such as ``+5%``.""" + rate: str + """The SSML-compatible speaking-rate adjustment, such as ``+10%``.""" + volume: str + """The SSML-compatible volume adjustment, such as ``+10`` or ``-6dB``.""" + type: Required[Literal[AzureVoiceType.AZURE_PERSONAL]] + """Required. An Azure personal voice.""" + name: Required[str] + """The personal voice name. Required.""" + model: Required[Union[str, "PersonalVoiceModel"]] + """The neural model used by the personal voice. Required. Known values are: + \"DragonLatestNeural\", \"DragonHDOmniLatestNeural\", and \"MAI-Voice\".""" + + +class AzureRealtimeNativeVoice(TypedDict, total=False): + """An Azure realtime-native voice configuration. + + :ivar type: The voice kind. Always ``azure-realtime-native``. Required. Default value is + "azure-realtime-native". + :vartype type: Literal["azure-realtime-native"] + :ivar name: The Azure realtime-native voice name. Required. Known values are: "aarti", + "alvaro", "andrew", "antonio", "ava", "clara", "dalia", "denise", "diego", "diya", "elsa", + "emma", "florian", "francisca", "hyunsu", "jorge", "keita", "liam", "meera", "nanami", + "natasha", "niwat", "premwadee", "remy", "ryan", "seraphina", "sonia", "sunhi", "sylvie", + "thierry", "william", "xiaoxiao", "ximena", and "yunxi". + :vartype name: Union[str, "AzureRealtimeNativeVoiceName"] + """ + + type: Required[Literal["azure-realtime-native"]] + """The voice kind. Always ``azure-realtime-native``. Required. Default value is + \"azure-realtime-native\".""" + name: Required[Union[str, "AzureRealtimeNativeVoiceName"]] + """The Azure realtime-native voice name. Required. Known values are: \"aarti\", \"alvaro\", + \"andrew\", \"antonio\", \"ava\", \"clara\", \"dalia\", \"denise\", \"diego\", \"diya\", + \"elsa\", \"emma\", \"florian\", \"francisca\", \"hyunsu\", \"jorge\", \"keita\", \"liam\", + \"meera\", \"nanami\", \"natasha\", \"niwat\", \"premwadee\", \"remy\", \"ryan\", + \"seraphina\", \"sonia\", \"sunhi\", \"sylvie\", \"thierry\", \"william\", \"xiaoxiao\", + \"ximena\", and \"yunxi\".""" + + +class AzureStandardVoice(TypedDict, total=False): + """An Azure standard neural voice configuration. + + :ivar temperature: The synthesis temperature, from 0 to 1. + :vartype temperature: float + :ivar custom_lexicon_url: The URL of a custom pronunciation lexicon. + :vartype custom_lexicon_url: str + :ivar custom_text_normalization_url: The URL of a custom text-normalization service. + :vartype custom_text_normalization_url: str + :ivar prefer_locales: Preferred BCP-47 locales that influence language accents. + :vartype prefer_locales: list[str] + :ivar locale: The enforced BCP-47 locale. When omitted, the language is detected from the text. + :vartype locale: str + :ivar style: The speaking style, such as ``cheerful`` or ``sad``. + :vartype style: str + :ivar pitch: The SSML-compatible pitch adjustment, such as ``+5%``. + :vartype pitch: str + :ivar rate: The SSML-compatible speaking-rate adjustment, such as ``+10%``. + :vartype rate: str + :ivar volume: The SSML-compatible volume adjustment, such as ``+10`` or ``-6dB``. + :vartype volume: str + :ivar type: Required. An Azure standard neural voice. + :vartype type: Literal[AzureVoiceType.AZURE_STANDARD] + :ivar name: The Azure neural voice name. Required. + :vartype name: str + :ivar multi_talker_speaker_name: The speaker name used by a multi-talker voice. + :vartype multi_talker_speaker_name: str + """ + + temperature: float + """The synthesis temperature, from 0 to 1.""" + custom_lexicon_url: str + """The URL of a custom pronunciation lexicon.""" + custom_text_normalization_url: str + """The URL of a custom text-normalization service.""" + prefer_locales: list[str] + """Preferred BCP-47 locales that influence language accents.""" + locale: str + """The enforced BCP-47 locale. When omitted, the language is detected from the text.""" + style: str + """The speaking style, such as ``cheerful`` or ``sad``.""" + pitch: str + """The SSML-compatible pitch adjustment, such as ``+5%``.""" + rate: str + """The SSML-compatible speaking-rate adjustment, such as ``+10%``.""" + volume: str + """The SSML-compatible volume adjustment, such as ``+10`` or ``-6dB``.""" + type: Required[Literal[AzureVoiceType.AZURE_STANDARD]] + """Required. An Azure standard neural voice.""" + name: Required[str] + """The Azure neural voice name. Required.""" + multi_talker_speaker_name: str + """The speaker name used by a multi-talker voice.""" + + +class BotServiceAuthorizationScheme(TypedDict, total=False): + """BotServiceAuthorizationScheme. + + :ivar type: Required. BOT_SERVICE. + :vartype type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE] + """ + + type: Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE]] + """Required. BOT_SERVICE.""" + + +class BotServiceRbacAuthorizationScheme(TypedDict, total=False): + """BotServiceRbacAuthorizationScheme. + + :ivar type: Required. BOT_SERVICE_RBAC. + :vartype type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC] + """ + + type: Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC]] + """Required. BOT_SERVICE_RBAC.""" + + +class BotServiceTenantAuthorizationScheme(TypedDict, total=False): + """BotServiceTenantAuthorizationScheme. + + :ivar type: Required. BOT_SERVICE_TENANT. + :vartype type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT] + """ + + type: Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT]] + """Required. BOT_SERVICE_TENANT.""" + + +class EntraAuthorizationScheme(TypedDict, total=False): + """EntraAuthorizationScheme. + + :ivar type: Required. ENTRA. + :vartype type: Literal[AgentEndpointAuthorizationSchemeType.ENTRA] + """ + + type: Required[Literal[AgentEndpointAuthorizationSchemeType.ENTRA]] + """Required. ENTRA.""" + + +class FixedRatioVersionSelectionRule(TypedDict, total=False): + """FixedRatioVersionSelectionRule. + + :ivar agent_version: The agent version to route traffic to. Required. + :vartype agent_version: str + :ivar type: Required. FIXED_RATIO. + :vartype type: Literal[VersionSelectorType.FIXED_RATIO] + :ivar traffic_percentage: The percentage of traffic to route to the version. Must be between 0 + and 100. Required. + :vartype traffic_percentage: int + """ + + agent_version: Required[str] + """The agent version to route traffic to. Required.""" + type: Required[Literal[VersionSelectorType.FIXED_RATIO]] + """Required. FIXED_RATIO.""" + traffic_percentage: Required[int] + """The percentage of traffic to route to the version. Must be between 0 and 100. Required.""" + + +class InvocationsProtocolConfiguration(TypedDict, total=False): + """Configuration specific to the invocations protocol.""" + + +class InvocationsWsProtocolConfiguration(TypedDict, total=False): + """Configuration specific to the WebSocket-based invocations protocol.""" + + +class LlmGeneratedVoiceGreetingConfig(TypedDict, total=False): + """A greeting authored by the session model from a scoped opening-turn prompt. + + :ivar type: Required. Default value is "llm_generated". + :vartype type: Literal["llm_generated"] + :ivar prompt: The Handlebars prompt that guides the opening turn. Required. + :vartype prompt: str + :ivar fallback_text: The optional Handlebars text template synthesized when generation fails + before any greeting output. + :vartype fallback_text: str + :ivar tool_choice: The tool-selection policy for the opening response. Defaults to ``none``. + Known values are: "none", "auto", and "required". + :vartype tool_choice: Union[str, "VoiceGreetingToolChoice"] + """ + + type: Required[Literal["llm_generated"]] + """Required. Default value is \"llm_generated\".""" + prompt: Required[str] + """The Handlebars prompt that guides the opening turn. Required.""" + fallback_text: str + """The optional Handlebars text template synthesized when generation fails before any greeting + output.""" + tool_choice: Union[str, "VoiceGreetingToolChoice"] + """The tool-selection policy for the opening response. Defaults to ``none``. Known values are: + \"none\", \"auto\", and \"required\".""" + + +class LogProbProperties(TypedDict, total=False): + """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: Required[str] + """The token that was used to generate the log probability. Required.""" + logprob: Required[float] + """The log probability of the token. Required.""" + bytes: Required[list[int]] + """The bytes that were used to generate the log probability. Required.""" + + +class ManagedAgentIdentityBlueprintReference(TypedDict, total=False): + """ManagedAgentIdentityBlueprintReference. + + :ivar type: Required. MANAGED_AGENT_IDENTITY_BLUEPRINT. + :vartype type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] + :ivar blueprint_id: The ID of the managed blueprint. Required. + :vartype blueprint_id: str + """ + + type: Required[Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT]] + """Required. MANAGED_AGENT_IDENTITY_BLUEPRINT.""" + blueprint_id: Required[str] + """The ID of the managed blueprint. Required.""" + + +class MCPListToolsTool(TypedDict, total=False): + """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: "MCPListToolsToolInputSchema" + :ivar annotations: + :vartype annotations: "MCPListToolsToolAnnotations" + """ + + name: Required[str] + """The name of the tool. Required.""" + description: Optional[str] + input_schema: Required["MCPListToolsToolInputSchema"] + """The JSON schema describing the tool's input. Required.""" + annotations: Optional["MCPListToolsToolAnnotations"] + + +class MCPListToolsToolAnnotations(TypedDict, total=False): + """MCPListToolsToolAnnotations.""" + + +class MCPListToolsToolInputSchema(TypedDict, total=False): + """MCPListToolsToolInputSchema.""" + + +class McpProtocolConfiguration(TypedDict, total=False): + """Configuration specific to the MCP protocol.""" + + +class MCPTool(TypedDict, total=False): + """MCP tool. + + :ivar type: The type of the MCP tool. Always ``mcp``. Required. MCP. + :vartype type: Literal[ToolType.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: + + * 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: Literal["connector_dropbox", "connector_gmail", + "connector_googlecalendar", "connector_googledrive", "connector_microsoftteams", + "connector_outlookcalendar", "connector_outlookemail", "connector_sharepoint"] + :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: Union[list[str], "MCPToolFilter"] + :ivar allowed_callers: + :vartype allowed_callers: list[Union[str, "CallableToolAllowedCaller"]] + :ivar require_approval: Is one of the following types: MCPToolRequireApproval, + Literal["always"], Literal["never"] + :vartype require_approval: Union["MCPToolRequireApproval", Literal["always"], Literal["never"]] + :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, "ToolConfig"] + """ + + type: Required[Literal[ToolType.MCP]] + """The type of the MCP tool. Always ``mcp``. Required. MCP.""" + server_label: Required[str] + """A label for this MCP server, used to identify it in tool calls. Required.""" + server_url: str + """The URL for the MCP server. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be + provided.""" + connector_id: Literal[ + "connector_dropbox", + "connector_gmail", + "connector_googlecalendar", + "connector_googledrive", + "connector_microsoftteams", + "connector_outlookcalendar", + "connector_outlookemail", + "connector_sharepoint", + ] + """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: + + * 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: str + """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: str + """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: str + """Optional description of the MCP server, used to provide more context.""" + headers: Optional[dict[str, str]] + allowed_tools: Optional[Union[list[str], "MCPToolFilter"]] + """Is either a [str] type or a MCPToolFilter type.""" + allowed_callers: Optional[list[Union[str, "CallableToolAllowedCaller"]]] + require_approval: Optional[Union["MCPToolRequireApproval", Literal["always"], Literal["never"]]] + """Is one of the following types: MCPToolRequireApproval, Literal[\"always\"], Literal[\"never\"]""" + defer_loading: bool + """Whether this MCP tool is deferred and discovered via tool search.""" + project_connection_id: str + """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: dict[str, "ToolConfig"] + """Deprecated. This property is deprecated and will be removed in a future version.""" + + +class MCPToolFilter(TypedDict, total=False): + """MCP tool filter. + + :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 + """ + + tool_names: list[str] + """MCP allowed tools.""" + read_only: bool + """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.""" + + +class MCPToolRequireApproval(TypedDict, total=False): + """MCPToolRequireApproval. + + :ivar always: + :vartype always: "MCPToolFilter" + :ivar never: + :vartype never: "MCPToolFilter" + """ + + always: "MCPToolFilter" + never: "MCPToolFilter" + + +class Metadata(TypedDict, total=False): + """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 OpenAIVoice(TypedDict, total=False): + """An OpenAI built-in voice configuration with an explicit type discriminator. + + :ivar type: The voice kind. Always ``openai``. Required. Default value is "openai". + :vartype type: Literal["openai"] + :ivar name: The OpenAI built-in voice name. Required. Known values are: "alloy", "ash", + "ballad", "coral", "echo", "sage", "shimmer", "verse", "marin", and "cedar". + :vartype name: Union[str, "VoiceIdsShared"] + """ + + type: Required[Literal["openai"]] + """The voice kind. Always ``openai``. Required. Default value is \"openai\".""" + name: Required[Union[str, "VoiceIdsShared"]] + """The OpenAI built-in voice name. Required. Known values are: \"alloy\", \"ash\", \"ballad\", + \"coral\", \"echo\", \"sage\", \"shimmer\", \"verse\", \"marin\", and \"cedar\".""" + + +class ProtocolConfiguration(TypedDict, total=False): + """Per-protocol configuration for the agent endpoint. + + :ivar activity: Configuration for the activity protocol. + :vartype activity: "ActivityProtocolConfiguration" + :ivar responses: Configuration for the responses protocol. + :vartype responses: "ResponsesProtocolConfiguration" + :ivar a2a: Configuration for the A2A protocol. + :vartype a2a: "A2AProtocolConfiguration" + :ivar mcp: Configuration for the MCP protocol. + :vartype mcp: "McpProtocolConfiguration" + :ivar invocations: Configuration for the invocations protocol. + :vartype invocations: "InvocationsProtocolConfiguration" + :ivar invocations_ws: Configuration for the WebSocket-based invocations protocol. + :vartype invocations_ws: "InvocationsWsProtocolConfiguration" + """ + + activity: "ActivityProtocolConfiguration" + """Configuration for the activity protocol.""" + responses: "ResponsesProtocolConfiguration" + """Configuration for the responses protocol.""" + a2a: "A2AProtocolConfiguration" + """Configuration for the A2A protocol.""" + mcp: "McpProtocolConfiguration" + """Configuration for the MCP protocol.""" + invocations: "InvocationsProtocolConfiguration" + """Configuration for the invocations protocol.""" + invocations_ws: "InvocationsWsProtocolConfiguration" + """Configuration for the WebSocket-based invocations protocol.""" + + +class RaiConfig(TypedDict, total=False): + """Configuration for Responsible AI (RAI) content filtering and safety features. + + :ivar rai_policy_name: The name of the RAI policy to apply. Required. + :vartype rai_policy_name: str + """ + + rai_policy_name: Required[str] + """The name of the RAI policy to apply. Required.""" + + +class RealtimeConversationItemFunctionCall(TypedDict, total=False): + """Realtime function call item. + + :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: Literal["realtime.item"] + :ivar type: The type of the item. Always ``function_call``. Required. FUNCTION_CALL. + :vartype type: Literal[RealtimeConversationItemType.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: Literal["completed", "incomplete", "in_progress"] + :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 + """ + + id: str + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Literal["realtime.item"] + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + type: Required[Literal[RealtimeConversationItemType.FUNCTION_CALL]] + """The type of the item. Always ``function_call``. Required. FUNCTION_CALL.""" + status: Literal["completed", "incomplete", "in_progress"] + """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 + """The ID of the function call.""" + name: Required[str] + """The name of the function being called. Required.""" + arguments: Required[str] + """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.""" + + +class RealtimeConversationItemFunctionCallOutput(TypedDict, total=False): # pylint: disable=name-too-long + """Realtime function call output item. + + :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: Literal["realtime.item"] + :ivar type: The type of the item. Always ``function_call_output``. Required. + FUNCTION_CALL_OUTPUT. + :vartype type: Literal[RealtimeConversationItemType.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: Literal["completed", "incomplete", "in_progress"] + :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 + """ + + id: str + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Literal["realtime.item"] + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + type: Required[Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT]] + """The type of the item. Always ``function_call_output``. Required. FUNCTION_CALL_OUTPUT.""" + status: Literal["completed", "incomplete", "in_progress"] + """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: Required[str] + """The ID of the function call this output is for. Required.""" + output: Required[str] + """The output of the function call, this is free text and can contain any information or simply be + empty. Required.""" + + +class RealtimeConversationItemMessageAssistant(TypedDict, total=False): + """Realtime assistant message item. + + :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: Literal["realtime.item"] + :ivar type: The type of the item. Always ``message``. Required. Default value is "message". + :vartype type: Literal["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: Literal["completed", "incomplete", "in_progress"] + :ivar role: The role of the message sender. Always ``assistant``. Required. ASSISTANT. + :vartype role: Literal[RealtimeConversationItemMessageType.ASSISTANT] + :ivar content: The content of the message. Required. + :vartype content: list["RealtimeConversationItemMessageAssistantContent"] + """ + + id: str + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Literal["realtime.item"] + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + type: Required[Literal["message"]] + """The type of the item. Always ``message``. Required. Default value is \"message\".""" + status: Literal["completed", "incomplete", "in_progress"] + """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: Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] + """The role of the message sender. Always ``assistant``. Required. ASSISTANT.""" + content: Required[list["RealtimeConversationItemMessageAssistantContent"]] + """The content of the message. Required.""" + + +class RealtimeConversationItemMessageAssistantContent(TypedDict, total=False): # pylint: disable=name-too-long + """RealtimeConversationItemMessageAssistantContent. + + :ivar type: Is either a Literal["output_text"] type or a Literal["output_audio"] type. + :vartype type: Literal["output_text", "output_audio"] + :ivar text: + :vartype text: str + :ivar audio: + :vartype audio: str + :ivar transcript: + :vartype transcript: str + """ + + type: Literal["output_text", "output_audio"] + """Is either a Literal[\"output_text\"] type or a Literal[\"output_audio\"] type.""" + text: str + audio: str + transcript: str + + +class RealtimeConversationItemMessageSystem(TypedDict, total=False): + """Realtime system message item. + + :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: Literal["realtime.item"] + :ivar type: The type of the item. Always ``message``. Required. Default value is "message". + :vartype type: Literal["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: Literal["completed", "incomplete", "in_progress"] + :ivar role: The role of the message sender. Always ``system``. Required. SYSTEM. + :vartype role: Literal[RealtimeConversationItemMessageType.SYSTEM] + :ivar content: The content of the message. Required. + :vartype content: list["RealtimeConversationItemMessageSystemContent"] + """ + + id: str + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Literal["realtime.item"] + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + type: Required[Literal["message"]] + """The type of the item. Always ``message``. Required. Default value is \"message\".""" + status: Literal["completed", "incomplete", "in_progress"] + """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: Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] + """The role of the message sender. Always ``system``. Required. SYSTEM.""" + content: Required[list["RealtimeConversationItemMessageSystemContent"]] + """The content of the message. Required.""" + + +class RealtimeConversationItemMessageSystemContent(TypedDict, total=False): # pylint: disable=name-too-long + """RealtimeConversationItemMessageSystemContent. + + :ivar type: Default value is "input_text". + :vartype type: Literal["input_text"] + :ivar text: + :vartype text: str + """ + + type: Literal["input_text"] + """Default value is \"input_text\".""" + text: str + + +class RealtimeConversationItemMessageUser(TypedDict, total=False): + """Realtime user message item. + + :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: Literal["realtime.item"] + :ivar type: The type of the item. Always ``message``. Required. Default value is "message". + :vartype type: Literal["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: Literal["completed", "incomplete", "in_progress"] + :ivar role: The role of the message sender. Always ``user``. Required. USER. + :vartype role: Literal[RealtimeConversationItemMessageType.USER] + :ivar content: The content of the message. Required. + :vartype content: list["RealtimeConversationItemMessageUserContent"] + """ + + id: str + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Literal["realtime.item"] + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + type: Required[Literal["message"]] + """The type of the item. Always ``message``. Required. Default value is \"message\".""" + status: Literal["completed", "incomplete", "in_progress"] + """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: Required[Literal[RealtimeConversationItemMessageType.USER]] + """The role of the message sender. Always ``user``. Required. USER.""" + content: Required[list["RealtimeConversationItemMessageUserContent"]] + """The content of the message. Required.""" + + +class RealtimeConversationItemMessageUserContent(TypedDict, total=False): # pylint: disable=name-too-long + """RealtimeConversationItemMessageUserContent. + + :ivar type: Is one of the following types: Literal["input_text"], Literal["input_audio"], + Literal["input_image"] + :vartype type: Literal["input_text", "input_audio", "input_image"] + :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: Literal["auto", "low", "high"] + :ivar transcript: + :vartype transcript: str + """ + + type: Literal["input_text", "input_audio", "input_image"] + """Is one of the following types: Literal[\"input_text\"], Literal[\"input_audio\"], + Literal[\"input_image\"]""" + text: str + audio: str + image_url: str + detail: Literal["auto", "low", "high"] + """Is one of the following types: Literal[\"auto\"], Literal[\"low\"], Literal[\"high\"]""" + transcript: str + + +class RealtimeFunctionTool(TypedDict, total=False): + """Function tool. + + :ivar type: The type of the tool, i.e. ``function``. Default value is "function". + :vartype type: Literal["function"] + :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: "RealtimeFunctionToolParameters" + """ + + type: Literal["function"] + """The type of the tool, i.e. ``function``. Default value is \"function\".""" + name: str + """The name of the function.""" + description: str + """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: "RealtimeFunctionToolParameters" + """Parameters of the function in JSON Schema.""" + + +class RealtimeFunctionToolParameters(TypedDict, total=False): + """RealtimeFunctionToolParameters.""" + + +class RealtimeMCPApprovalRequest(TypedDict, total=False): + """Realtime MCP approval request. + + :ivar type: The type of the item. Always ``mcp_approval_request``. Required. + MCP_APPROVAL_REQUEST. + :vartype type: Literal[RealtimeConversationItemType.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 + """ + + type: Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST]] + """The type of the item. Always ``mcp_approval_request``. Required. MCP_APPROVAL_REQUEST.""" + id: Required[str] + """The unique ID of the approval request. Required.""" + server_label: Required[str] + """The label of the MCP server making the request. Required.""" + name: Required[str] + """The name of the tool to run. Required.""" + arguments: Required[str] + """A JSON string of arguments for the tool. Required.""" + + +class RealtimeMCPApprovalResponse(TypedDict, total=False): + """Realtime MCP approval response. + + :ivar type: The type of the item. Always ``mcp_approval_response``. Required. + MCP_APPROVAL_RESPONSE. + :vartype type: Literal[RealtimeConversationItemType.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 + """ + + type: Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE]] + """The type of the item. Always ``mcp_approval_response``. Required. MCP_APPROVAL_RESPONSE.""" + id: Required[str] + """The unique ID of the approval response. Required.""" + approval_request_id: Required[str] + """The ID of the approval request being answered. Required.""" + approve: Required[bool] + """Whether the request was approved. Required.""" + reason: Optional[str] + + +class RealtimeMCPHTTPError(TypedDict, total=False): + """Realtime MCP HTTP error. + + :ivar type: Required. HTTP_ERROR. + :vartype type: Literal[RealtimeMcpErrorType.HTTP_ERROR] + :ivar code: Required. + :vartype code: int + :ivar message: Required. + :vartype message: str + """ + + type: Required[Literal[RealtimeMcpErrorType.HTTP_ERROR]] + """Required. HTTP_ERROR.""" + code: Required[int] + """Required.""" + message: Required[str] + """Required.""" + + +class RealtimeMCPListTools(TypedDict, total=False): + """Realtime MCP list tools. + + :ivar type: The type of the item. Always ``mcp_list_tools``. Required. MCP_LIST_TOOLS. + :vartype type: Literal[RealtimeConversationItemType.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["MCPListToolsTool"] + """ + + type: Required[Literal[RealtimeConversationItemType.MCP_LIST_TOOLS]] + """The type of the item. Always ``mcp_list_tools``. Required. MCP_LIST_TOOLS.""" + id: str + """The unique ID of the list.""" + server_label: Required[str] + """The label of the MCP server. Required.""" + tools: Required[list["MCPListToolsTool"]] + """The tools available on the server. Required.""" + + +class RealtimeMCPProtocolError(TypedDict, total=False): + """Realtime MCP protocol error. + + :ivar type: Required. PROTOCOL_ERROR. + :vartype type: Literal[RealtimeMcpErrorType.PROTOCOL_ERROR] + :ivar code: Required. + :vartype code: int + :ivar message: Required. + :vartype message: str + """ + + type: Required[Literal[RealtimeMcpErrorType.PROTOCOL_ERROR]] + """Required. PROTOCOL_ERROR.""" + code: Required[int] + """Required.""" + message: Required[str] + """Required.""" + + +class RealtimeMCPToolCall(TypedDict, total=False): + """Realtime MCP tool call. + + :ivar type: The type of the item. Always ``mcp_call``. Required. MCP_CALL. + :vartype type: Literal[RealtimeConversationItemType.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: "RealtimeMCPError" + """ + + type: Required[Literal[RealtimeConversationItemType.MCP_CALL]] + """The type of the item. Always ``mcp_call``. Required. MCP_CALL.""" + id: Required[str] + """The unique ID of the tool call. Required.""" + server_label: Required[str] + """The label of the MCP server running the tool. Required.""" + name: Required[str] + """The name of the tool that was run. Required.""" + arguments: Required[str] + """A JSON string of the arguments passed to the tool. Required.""" + approval_request_id: Optional[str] + output: Optional[str] + error: "RealtimeMCPError" + + +class RealtimeMCPToolExecutionError(TypedDict, total=False): + """Realtime MCP tool execution error. + + :ivar type: Required. TOOL_EXECUTION_ERROR. + :vartype type: Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR] + :ivar message: Required. + :vartype message: str + """ + + type: Required[Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR]] + """Required. TOOL_EXECUTION_ERROR.""" + message: Required[str] + """Required.""" + + +class RealtimeReasoning(TypedDict, total=False): + """Realtime reasoning configuration. + + :ivar effort: Known values are: "minimal", "low", "medium", "high", and "xhigh". + :vartype effort: Union[str, "RealtimeReasoningEffort"] + """ + + effort: Union[str, "RealtimeReasoningEffort"] + """Known values are: \"minimal\", \"low\", \"medium\", \"high\", and \"xhigh\".""" + + +class RealtimeResponseStatusDetails(TypedDict, total=False): + """RealtimeResponseStatusDetails. + + :ivar type: Is one of the following types: Literal["completed"], Literal["cancelled"], + Literal["failed"], Literal["incomplete"] + :vartype type: Literal["completed", "cancelled", "failed", "incomplete"] + :ivar reason: Is one of the following types: Literal["turn_detected"], + Literal["client_cancelled"], Literal["max_output_tokens"], Literal["content_filter"] + :vartype reason: Literal["turn_detected", "client_cancelled", "max_output_tokens", + "content_filter"] + :ivar error: + :vartype error: "RealtimeResponseStatusDetailsError" + """ + + type: Literal["completed", "cancelled", "failed", "incomplete"] + """Is one of the following types: Literal[\"completed\"], Literal[\"cancelled\"], + Literal[\"failed\"], Literal[\"incomplete\"]""" + reason: Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"] + """Is one of the following types: Literal[\"turn_detected\"], Literal[\"client_cancelled\"], + Literal[\"max_output_tokens\"], Literal[\"content_filter\"]""" + error: "RealtimeResponseStatusDetailsError" + + +class RealtimeResponseStatusDetailsError(TypedDict, total=False): + """RealtimeResponseStatusDetailsError. + + :ivar type: + :vartype type: str + :ivar code: + :vartype code: str + """ + + type: str + code: str + + +class RealtimeResponseUsage(TypedDict, total=False): + """RealtimeResponseUsage. + + :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: "RealtimeResponseUsageInputTokenDetails" + :ivar output_token_details: + :vartype output_token_details: "RealtimeResponseUsageOutputTokenDetails" + """ + + total_tokens: int + input_tokens: int + output_tokens: int + input_token_details: "RealtimeResponseUsageInputTokenDetails" + output_token_details: "RealtimeResponseUsageOutputTokenDetails" + + +class RealtimeResponseUsageInputTokenDetails(TypedDict, total=False): + """RealtimeResponseUsageInputTokenDetails. + + :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: "RealtimeResponseUsageInputTokenDetailsCachedTokensDetails" + """ + + cached_tokens: int + text_tokens: int + image_tokens: int + audio_tokens: int + cached_tokens_details: "RealtimeResponseUsageInputTokenDetailsCachedTokensDetails" + + +class RealtimeResponseUsageInputTokenDetailsCachedTokensDetails( + TypedDict, total=False +): # pylint: disable=name-too-long + """RealtimeResponseUsageInputTokenDetailsCachedTokensDetails. + + :ivar text_tokens: + :vartype text_tokens: int + :ivar image_tokens: + :vartype image_tokens: int + :ivar audio_tokens: + :vartype audio_tokens: int + """ + + text_tokens: int + image_tokens: int + audio_tokens: int + + +class RealtimeResponseUsageOutputTokenDetails(TypedDict, total=False): + """RealtimeResponseUsageOutputTokenDetails. + + :ivar text_tokens: + :vartype text_tokens: int + :ivar audio_tokens: + :vartype audio_tokens: int + """ + + text_tokens: int + audio_tokens: int + + +class RealtimeServerEventConversationItemInputAudioTranscriptionFailedError( + TypedDict, total=False +): # pylint: disable=name-too-long + """RealtimeServerEventConversationItemInputAudioTranscriptionFailedError. + + :ivar type: + :vartype type: str + :ivar code: + :vartype code: str + :ivar message: + :vartype message: str + :ivar param: + :vartype param: str + """ + + type: str + code: str + message: str + param: str + + +class RealtimeServerEventRateLimitsUpdatedRateLimits(TypedDict, total=False): # pylint: disable=name-too-long + """RealtimeServerEventRateLimitsUpdatedRateLimits. + + :ivar name: Is either a Literal["requests"] type or a Literal["tokens"] type. + :vartype name: Literal["requests", "tokens"] + :ivar limit: + :vartype limit: int + :ivar remaining: + :vartype remaining: int + :ivar reset_seconds: + :vartype reset_seconds: float + """ + + name: Literal["requests", "tokens"] + """Is either a Literal[\"requests\"] type or a Literal[\"tokens\"] type.""" + limit: int + remaining: int + reset_seconds: float + + +class RealtimeServerEventResponseContentPartAdded(TypedDict, total=False): # pylint: disable=name-too-long + """Returned when a new content part is added to an assistant message item 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.content_part.added``. Required. + RESPONSE_CONTENT_PART_ADDED. + :vartype type: Literal[RealtimeServerEventType.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: "RealtimeServerEventResponseContentPartAddedPart" + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED]] + """The event type, must be ``response.content_part.added``. Required. RESPONSE_CONTENT_PART_ADDED.""" + response_id: Required[str] + """The ID of the response. Required.""" + item_id: Required[str] + """The ID of the item to which the content part was added. Required.""" + output_index: Required[int] + """The index of the output item in the response. Required.""" + content_index: Required[int] + """The index of the content part in the item's content array. Required.""" + part: Required["RealtimeServerEventResponseContentPartAddedPart"] + """The content part that was added. Required.""" + + +class RealtimeServerEventResponseContentPartAddedPart(TypedDict, total=False): # pylint: disable=name-too-long + """RealtimeServerEventResponseContentPartAddedPart. + + :ivar type: Is either a Literal["audio"] type or a Literal["text"] type. + :vartype type: Literal["audio", "text"] + :ivar text: + :vartype text: str + :ivar audio: + :vartype audio: str + :ivar transcript: + :vartype transcript: str + """ + + type: Literal["audio", "text"] + """Is either a Literal[\"audio\"] type or a Literal[\"text\"] type.""" + text: str + audio: str + transcript: str + + +class RealtimeToolChoiceFunction(TypedDict, total=False): + """A Realtime tool-choice object that forces the model to call a specific function. + + :ivar type: For function calling, the type is always ``function``. Required. FUNCTION. + :vartype type: Literal[ToolChoiceParamType.FUNCTION] + :ivar name: The name of the function to call. Required. + :vartype name: str + """ + + type: Required[Literal[ToolChoiceParamType.FUNCTION]] + """For function calling, the type is always ``function``. Required. FUNCTION.""" + name: Required[str] + """The name of the function to call. Required.""" + + +class ResponsesProtocolConfiguration(TypedDict, total=False): + """Configuration specific to the responses protocol.""" + + +class StructuredInputDefinition(TypedDict, total=False): + """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: str + """A human-readable description of the input.""" + default_value: Any + """The default value for the input if no run-time value is provided.""" + schema: dict[str, Any] + """The JSON schema for the structured input (optional).""" + required: bool + """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.""" + + +class TemplateVoiceGreetingConfig(TypedDict, total=False): + """A deterministic greeting rendered with the voice agent's structured inputs and synthesized + without model-authored generation. + + :ivar type: Required. Default value is "template". + :vartype type: Literal["template"] + :ivar text: The Handlebars text template spoken at session start. Required. + :vartype text: str + """ + + type: Required[Literal["template"]] + """Required. Default value is \"template\".""" + text: Required[str] + """The Handlebars text template spoken at session start. Required.""" + + +class ToolChoiceFunction(TypedDict, total=False): + """Function tool. + + :ivar type: For function calling, the type is always ``function``. Required. FUNCTION. + :vartype type: Literal[ToolChoiceParamType.FUNCTION] + :ivar name: The name of the function to call. Required. + :vartype name: str + """ + + type: Required[Literal[ToolChoiceParamType.FUNCTION]] + """For function calling, the type is always ``function``. Required. FUNCTION.""" + name: Required[str] + """The name of the function to call. Required.""" + + +class ToolChoiceMCP(TypedDict, total=False): + """MCP tool. + + :ivar type: For MCP tools, the type is always ``mcp``. Required. MCP. + :vartype type: Literal[ToolChoiceParamType.MCP] + :ivar server_label: The label of the MCP server to use. Required. + :vartype server_label: str + :ivar name: + :vartype name: str + """ + + type: Required[Literal[ToolChoiceParamType.MCP]] + """For MCP tools, the type is always ``mcp``. Required. MCP.""" + server_label: Required[str] + """The label of the MCP server to use. Required.""" + name: Optional[str] + + +class ToolConfig(TypedDict, total=False): + """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: bool + """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: str + """Additional text indexed for tool_search. Supplements the native tool description to improve + discoverability. Does not alter ``tools/list`` output.""" + + +class TranscriptTextUsageDuration(TypedDict, total=False): + """Duration Usage. + + :ivar type: The type of the usage object. Always ``duration`` for this variant. Required. + DURATION. + :vartype type: Literal[CreateTranscriptionResponseJsonUsageType.DURATION] + :ivar seconds: Duration of the input audio in seconds. Required. + :vartype seconds: str + """ + + type: Required[Literal[CreateTranscriptionResponseJsonUsageType.DURATION]] + """The type of the usage object. Always ``duration`` for this variant. Required. DURATION.""" + seconds: Required[str] + """Duration of the input audio in seconds. Required.""" + + +class TranscriptTextUsageTokens(TypedDict, total=False): + """Token Usage. + + :ivar type: The type of the usage object. Always ``tokens`` for this variant. Required. TOKENS. + :vartype type: Literal[CreateTranscriptionResponseJsonUsageType.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: "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: Required[Literal[CreateTranscriptionResponseJsonUsageType.TOKENS]] + """The type of the usage object. Always ``tokens`` for this variant. Required. TOKENS.""" + input_tokens: Required[int] + """Number of input tokens billed for this request. Required.""" + input_token_details: "TranscriptTextUsageTokensInputTokenDetails" + """Details about the input tokens billed for this request.""" + output_tokens: Required[int] + """Number of output tokens generated. Required.""" + total_tokens: Required[int] + """Total number of tokens used (input + output). Required.""" + + +class TranscriptTextUsageTokensInputTokenDetails(TypedDict, total=False): # pylint: disable=name-too-long + """TranscriptTextUsageTokensInputTokenDetails. + + :ivar text_tokens: + :vartype text_tokens: int + :ivar audio_tokens: + :vartype audio_tokens: int + """ + + text_tokens: int + audio_tokens: int + + +class VersionSelector(TypedDict, total=False): + """VersionSelector. + + :ivar version_selection_rules: Required. + :vartype version_selection_rules: list["VersionSelectionRule"] + """ + + version_selection_rules: Required[list["VersionSelectionRule"]] + """Required.""" + + +class VoiceAgentAnimationConfig(TypedDict, total=False): + """Animation settings for a voice-agent session. + + :ivar model_name: The animation model name. + :vartype model_name: str + :ivar outputs: The requested animation output kinds. + :vartype outputs: list[Union[str, "VoiceAgentAnimationOutputType"]] + """ + + model_name: str + """The animation model name.""" + outputs: list[Union[str, "VoiceAgentAnimationOutputType"]] + """The requested animation output kinds.""" + + +class VoiceAgentAvatarIceServer(TypedDict, total=False): + """An ICE server used for avatar WebRTC negotiation. + + :ivar urls: Required. + :vartype urls: list[str] + :ivar username: + :vartype username: str + :ivar credential: + :vartype credential: str + """ + + urls: Required[list[str]] + """Required.""" + username: Optional[str] + credential: Optional[str] + + +class VoiceAgentAvatarScene(TypedDict, total=False): + """Avatar placement and motion settings. + + :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 + """ + + zoom: float + position_x: float + position_y: float + rotation_x: float + rotation_y: float + rotation_z: float + amplitude: float + + +class VoiceAgentAvatarVideoBackground(TypedDict, total=False): + """The avatar video background. + + :ivar image_url: + :vartype image_url: str + :ivar color: + :vartype color: str + """ + + image_url: Optional[str] + color: Optional[str] + + +class VoiceAgentAvatarVideoCrop(TypedDict, total=False): + """The rectangular crop applied to avatar video. + + :ivar bottom_right: Required. + :vartype bottom_right: list[int] + :ivar top_left: Required. + :vartype top_left: list[int] + """ + + bottom_right: Required[list[int]] + """Required.""" + top_left: Required[list[int]] + """Required.""" + + +class VoiceAgentAvatarVideoParams(TypedDict, total=False): + """Avatar video encoder and presentation settings. + + :ivar bitrate: + :vartype bitrate: int + :ivar codec: Default value is "h264". + :vartype codec: Literal["h264"] + :ivar crop: + :vartype crop: "VoiceAgentAvatarVideoCrop" + :ivar resolution: + :vartype resolution: "VoiceAgentAvatarVideoResolution" + :ivar background: + :vartype background: "VoiceAgentAvatarVideoBackground" + :ivar gop_size: + :vartype gop_size: int + """ + + bitrate: int + codec: Literal["h264"] + """Default value is \"h264\".""" + crop: Optional["VoiceAgentAvatarVideoCrop"] + resolution: Optional["VoiceAgentAvatarVideoResolution"] + background: Optional["VoiceAgentAvatarVideoBackground"] + gop_size: int + + +class VoiceAgentAvatarVideoResolution(TypedDict, total=False): + """The avatar video resolution. + + :ivar width: Required. + :vartype width: int + :ivar height: Required. + :vartype height: int + """ + + width: Required[int] + """Required.""" + height: Required[int] + """Required.""" + + +class VoiceAgentAzureMultilingualSemanticVadTurnDetection(TypedDict, total=False): # pylint: disable=name-too-long + """Azure multilingual semantic VAD turn-detection settings. + + :ivar remove_filler_words: Whether filler words are removed from transcription. + :vartype remove_filler_words: bool + :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech + stops. + :vartype auto_truncate: 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 type: Required. Multilingual Azure semantic voice activity detection. + :vartype type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] + :ivar threshold: + :vartype threshold: float + :ivar prefix_padding_ms: + :vartype prefix_padding_ms: int + :ivar silence_duration_ms: + :vartype silence_duration_ms: int + :ivar idle_timeout_ms: + :vartype idle_timeout_ms: int + :ivar speech_duration_ms: + :vartype speech_duration_ms: int + :ivar end_of_utterance_detection: + :vartype end_of_utterance_detection: "VoiceAgentEndOfUtteranceDetection" + :ivar languages: + :vartype languages: list[str] + """ + + remove_filler_words: bool + """Whether filler words are removed from transcription.""" + auto_truncate: bool + """Whether the input audio buffer is truncated automatically when speech stops.""" + create_response: bool + """Whether a response is created automatically when speech stops.""" + interrupt_response: bool + """Whether user speech may interrupt the agent's response.""" + type: Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL]] + """Required. Multilingual Azure semantic voice activity detection.""" + threshold: Optional[float] + prefix_padding_ms: Optional[int] + silence_duration_ms: Optional[int] + idle_timeout_ms: Optional[int] + speech_duration_ms: Optional[int] + end_of_utterance_detection: Optional["VoiceAgentEndOfUtteranceDetection"] + languages: Optional[list[str]] + + +class VoiceAgentAzureSemanticVadTurnDetection(TypedDict, total=False): + """Azure semantic VAD turn-detection settings. + + :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 type: Required. Known values are: "azure_semantic_vad" and "azure_semantic_vad_en". + :vartype type: Union[str, "VoiceAgentAzureSemanticVadType"] + :ivar threshold: + :vartype threshold: float + :ivar prefix_padding_ms: + :vartype prefix_padding_ms: int + :ivar silence_duration_ms: + :vartype silence_duration_ms: int + :ivar idle_timeout_ms: + :vartype idle_timeout_ms: int + :ivar speech_duration_ms: + :vartype speech_duration_ms: int + :ivar end_of_utterance_detection: + :vartype end_of_utterance_detection: "VoiceAgentEndOfUtteranceDetection" + :ivar remove_filler_words: + :vartype remove_filler_words: bool + :ivar languages: + :vartype languages: list[str] + :ivar auto_truncate: + :vartype auto_truncate: bool + """ + + create_response: bool + """Whether a response is created automatically when speech stops.""" + interrupt_response: bool + """Whether user speech may interrupt the agent's response.""" + type: Required[Union[str, "VoiceAgentAzureSemanticVadType"]] + """Required. Known values are: \"azure_semantic_vad\" and \"azure_semantic_vad_en\".""" + threshold: Optional[float] + prefix_padding_ms: Optional[int] + silence_duration_ms: Optional[int] + idle_timeout_ms: Optional[int] + speech_duration_ms: Optional[int] + end_of_utterance_detection: Optional["VoiceAgentEndOfUtteranceDetection"] + remove_filler_words: bool + languages: Optional[list[str]] + auto_truncate: bool + + +class VoiceAgentClientEventConversationItemCreate(TypedDict, total=False): # pylint: disable=name-too-long + """The ``conversation.item.create`` client event. + + :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: Literal[RealtimeClientEventType.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: The conversation item to create. Required. Is either a + "_unions.VoiceAgentRequestConversationItem" type or a RealtimeMCPApprovalResponse type. + :vartype item: "_unions.VoiceAgentCreateConversationItem" + """ + + event_id: str + """Optional client-generated ID used to identify this event.""" + type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE]] + """The event type, must be ``conversation.item.create``. Required. CONVERSATION_ITEM_CREATE.""" + previous_item_id: str + """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: Required["_unions.VoiceAgentCreateConversationItem"] + """The conversation item to create. Required. Is either a + \"_unions.VoiceAgentRequestConversationItem\" type or a RealtimeMCPApprovalResponse type.""" + + +class VoiceAgentClientEventConversationItemDelete(TypedDict, total=False): # pylint: disable=name-too-long + """The ``conversation.item.delete`` client event. + + :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: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE] + :ivar item_id: The ID of the item to delete. Required. + :vartype item_id: str + """ + + event_id: str + """Optional client-generated ID used to identify this event.""" + type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE]] + """The event type, must be ``conversation.item.delete``. Required. CONVERSATION_ITEM_DELETE.""" + item_id: Required[str] + """The ID of the item to delete. Required.""" + + +class VoiceAgentClientEventConversationItemRetrieve(TypedDict, total=False): # pylint: disable=name-too-long + """The ``conversation.item.retrieve`` client event. + + :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: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE] + :ivar item_id: The ID of the item to retrieve. Required. + :vartype item_id: str + """ + + event_id: str + """Optional client-generated ID used to identify this event.""" + type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE]] + """The event type, must be ``conversation.item.retrieve``. Required. CONVERSATION_ITEM_RETRIEVE.""" + item_id: Required[str] + """The ID of the item to retrieve. Required.""" + + +class VoiceAgentClientEventConversationItemTruncate(TypedDict, total=False): # pylint: disable=name-too-long + """The ``conversation.item.truncate`` client event. + + :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: Literal[RealtimeClientEventType.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 + """Optional client-generated ID used to identify this event.""" + type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE]] + """The event type, must be ``conversation.item.truncate``. Required. CONVERSATION_ITEM_TRUNCATE.""" + item_id: Required[str] + """The ID of the assistant message item to truncate. Only assistant message items can be + truncated. Required.""" + content_index: Required[int] + """The index of the content part to truncate. Set this to ``0``. Required.""" + audio_end_ms: Required[int] + """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.""" + + +class VoiceAgentClientEventInputAudioBufferAppend(TypedDict, total=False): # pylint: disable=name-too-long + """The ``input_audio_buffer.append`` client event. + + :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: Literal[RealtimeClientEventType.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 + """Optional client-generated ID used to identify this event.""" + type: Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND]] + """The event type, must be ``input_audio_buffer.append``. Required. INPUT_AUDIO_BUFFER_APPEND.""" + audio: Required[str] + """Base64-encoded audio bytes. This must be in the format specified by the ``input_audio_format`` + field in the session configuration. Required.""" + + +class VoiceAgentClientEventInputAudioBufferClear(TypedDict, total=False): # pylint: disable=name-too-long + """The ``input_audio_buffer.clear`` client event. + + :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: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR] + """ + + event_id: str + """Optional client-generated ID used to identify this event.""" + type: Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR]] + """The event type, must be ``input_audio_buffer.clear``. Required. INPUT_AUDIO_BUFFER_CLEAR.""" + + +class VoiceAgentClientEventInputAudioBufferCommit(TypedDict, total=False): # pylint: disable=name-too-long + """The ``input_audio_buffer.commit`` client event. + + :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: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT] + """ + + event_id: str + """Optional client-generated ID used to identify this event.""" + type: Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT]] + """The event type, must be ``input_audio_buffer.commit``. Required. INPUT_AUDIO_BUFFER_COMMIT.""" + + +class VoiceAgentClientEventOutputAudioBufferClear(TypedDict, total=False): # pylint: disable=name-too-long + """The ``output_audio_buffer.clear`` client event. + + :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: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR] + """ + + event_id: str + """The unique ID of the client event used for error handling.""" + type: Required[Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR]] + """The event type, must be ``output_audio_buffer.clear``. Required. OUTPUT_AUDIO_BUFFER_CLEAR.""" + + +class VoiceAgentClientEventResponseCancel(TypedDict, total=False): + """The ``response.cancel`` client event. + + :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: Literal[RealtimeClientEventType.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 + """Optional client-generated ID used to identify this event.""" + type: Required[Literal[RealtimeClientEventType.RESPONSE_CANCEL]] + """The event type, must be ``response.cancel``. Required. RESPONSE_CANCEL.""" + response_id: str + """A specific response ID to cancel - if not provided, will cancel an in-progress response in the + default conversation.""" + + +class VoiceAgentClientEventResponseCreate(TypedDict, total=False): + """The ``response.create`` client event. + + :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: Literal[RealtimeClientEventType.RESPONSE_CREATE] + :ivar response: Parameters for the new response. + :vartype response: "VoiceAgentResponseCreateParams" + """ + + event_id: str + """Optional client-generated ID used to identify this event.""" + type: Required[Literal[RealtimeClientEventType.RESPONSE_CREATE]] + """The event type, must be ``response.create``. Required. RESPONSE_CREATE.""" + response: "VoiceAgentResponseCreateParams" + """Parameters for the new response.""" + + +class VoiceAgentClientEventSessionAvatarConnect(TypedDict, total=False): # pylint: disable=name-too-long + """The ``session.avatar.connect`` client event. + + :ivar type: The event type. Always ``session.avatar.connect``. Required. Default value is + "session.avatar.connect". + :vartype type: Literal["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 + """ + + type: Required[Literal["session.avatar.connect"]] + """The event type. Always ``session.avatar.connect``. Required. Default value is + \"session.avatar.connect\".""" + event_id: str + """An optional client-generated event identifier.""" + client_sdp: Required[str] + """The client's SDP offer for avatar media negotiation. Required.""" + + +class VoiceAgentClientEventSessionUpdate(TypedDict, total=False): + """The ``session.update`` client event. + + :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: Literal[RealtimeClientEventType.SESSION_UPDATE] + :ivar session: The stable realtime session fields to update. Required. + :vartype session: "VoiceAgentSessionUpdateConfig" + """ + + event_id: str + """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: Required[Literal[RealtimeClientEventType.SESSION_UPDATE]] + """The event type, must be ``session.update``. Required. SESSION_UPDATE.""" + session: Required["VoiceAgentSessionUpdateConfig"] + """The stable realtime session fields to update. Required.""" + + +class VoiceAgentDefinition(TypedDict, total=False): + """The voice agent definition. Its configuration (model, instructions, audio, tools, and optional + avatar) drives a managed speech-to-speech experience. The realtime voice session is established + through a separate connect operation that is not defined in this specification. Every create or + update produces a new immutable version. + + :ivar kind: The kind discriminator for a voice agent definition. Always ``voice``. Required. + Default value is "voice". + :vartype kind: Literal["voice"] + :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. + :vartype rai_config: "RaiConfig" + :ivar model_type: How the model backing this agent is served. Together with ``model``, this + selects the model up front. ``managed`` uses a service-managed model; ``self_deployed`` uses + the customer's own Foundry deployment. This is independent of the architecture (realtime or + cascaded), which the service derives from the selected model. Required. Known values are: + "managed" and "self_deployed". + :vartype model_type: Union[str, "VoiceModelType"] + :ivar model: The model to use for this agent, paired with ``model_type``: the service-managed + model name when ``model_type`` is ``managed``, or the customer's Foundry deployment name when + ``model_type`` is ``self_deployed``. The model must support realtime or cascaded voice. The + service derives the architecture from the selected model. Required. + :vartype model: str + :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: "VoiceGreetingConfig" + :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: "VoiceAudioConfig" + :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[Union[str, "VoiceOutputModality"]] + :ivar avatar: Optional avatar configuration. These values are session defaults and may be + overridden when connecting. + :vartype avatar: "VoiceAvatarConfig" + :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["_unions.VoiceAgentTool"] + :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, "StructuredInputDefinition"] + :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 + """ + + kind: Required[Literal["voice"]] + """The kind discriminator for a voice agent definition. Always ``voice``. Required. Default value + is \"voice\".""" + rai_config: "RaiConfig" + """Configuration for Responsible AI (RAI) content filtering and safety features.""" + model_type: Required[Union[str, "VoiceModelType"]] + """How the model backing this agent is served. Together with ``model``, this selects the model up + front. ``managed`` uses a service-managed model; ``self_deployed`` uses the customer's own + Foundry deployment. This is independent of the architecture (realtime or cascaded), which the + service derives from the selected model. Required. Known values are: \"managed\" and + \"self_deployed\".""" + model: Required[str] + """The model to use for this agent, paired with ``model_type``: the service-managed model name + when ``model_type`` is ``managed``, or the customer's Foundry deployment name when + ``model_type`` is ``self_deployed``. The model must support realtime or cascaded voice. The + service derives the architecture from the selected model. Required.""" + instructions: str + """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: "VoiceGreetingConfig" + """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: "VoiceAudioConfig" + """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: list[Union[str, "VoiceOutputModality"]] + """The output modalities the agent produces. Defaults to ``[\"audio\"]``. ``animation`` and + ``avatar`` are available when an avatar is configured.""" + avatar: "VoiceAvatarConfig" + """Optional avatar configuration. These values are session defaults and may be overridden when + connecting.""" + tools: list["_unions.VoiceAgentTool"] + """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.""" + structured_inputs: dict[str, "StructuredInputDefinition"] + """Set of structured inputs that participate in prompt template substitution, rendered per session + before the live session starts.""" + store: bool + """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.""" + + +class VoiceAgentEchoCancellation(TypedDict, total=False): + """Server-side echo cancellation settings for input audio. + + :ivar type: The echo cancellation implementation. Always ``server_echo_cancellation``. + Required. Default value is "server_echo_cancellation". + :vartype type: Literal["server_echo_cancellation"] + :ivar reference_source: Whether reference audio comes from server playback or a client-provided + channel. Known values are: "server" and "client". + :vartype reference_source: Union[str, "VoiceAgentEchoCancellationReferenceSource"] + :ivar channels: The number of input channels. Use two interleaved channels when + ``reference_source`` is ``client``. + :vartype channels: int + """ + + type: Required[Literal["server_echo_cancellation"]] + """The echo cancellation implementation. Always ``server_echo_cancellation``. Required. Default + value is \"server_echo_cancellation\".""" + reference_source: Union[str, "VoiceAgentEchoCancellationReferenceSource"] + """Whether reference audio comes from server playback or a client-provided channel. Known values + are: \"server\" and \"client\".""" + channels: int + """The number of input channels. Use two interleaved channels when ``reference_source`` is + ``client``.""" + + +class VoiceAgentEndOfUtteranceDetection(TypedDict, total=False): + """End-of-utterance detection settings. + + :ivar model: Required. Known values are: "semantic_detection_v1", "semantic_detection_v1_en", + "semantic_detection_v1_multilingual", and "smart_end_of_turn_detection". + :vartype model: Union[str, "VoiceAgentEndOfUtteranceModel"] + :ivar threshold: + :vartype threshold: float + :ivar threshold_level: Known values are: "low", "medium", "high", and "default". + :vartype threshold_level: Union[str, "VoiceAgentEndOfUtteranceThresholdLevel"] + :ivar timeout: + :vartype timeout: float + :ivar timeout_ms: + :vartype timeout_ms: int + """ + + model: Required[Union[str, "VoiceAgentEndOfUtteranceModel"]] + """Required. Known values are: \"semantic_detection_v1\", \"semantic_detection_v1_en\", + \"semantic_detection_v1_multilingual\", and \"smart_end_of_turn_detection\".""" + threshold: Optional[float] + threshold_level: Optional[Union[str, "VoiceAgentEndOfUtteranceThresholdLevel"]] + """Known values are: \"low\", \"medium\", \"high\", and \"default\".""" + timeout: Optional[float] + timeout_ms: Optional[int] + + +class VoiceAgentEstimatedCost(TypedDict, total=False): + """A best-effort public-retail cost estimate for a response. + + :ivar amount: The total estimated amount, when available. Required. + :vartype amount: float + :ivar input_cost: The estimated input cost. + :vartype input_cost: float + :ivar output_cost: The estimated output cost. + :vartype output_cost: float + :ivar currency: The estimate currency. Always ``USD``. Default value is "USD". + :vartype currency: Literal["USD"] + :ivar voice_live_amount: The portion attributed to Voice Live processing. Required. + :vartype voice_live_amount: float + :ivar byom_model_amount: The portion attributed to a customer-provided model. + :vartype byom_model_amount: float + :ivar status: Whether the estimate is complete, partial, or unavailable. Required. Known values + are: "complete", "partial", and "unavailable". + :vartype status: Union[str, "VoiceAgentEstimatedCostStatus"] + :ivar price_version: The Voice Live price version used for the estimate. Required. + :vartype price_version: str + :ivar byom_model_price_version: The customer-provided model price version used for the + estimate. + :vartype byom_model_price_version: str + :ivar unpriced_components: Components for which no price was available. + :vartype unpriced_components: list[str] + """ + + amount: Required[Optional[float]] + """The total estimated amount, when available. Required.""" + input_cost: Optional[float] + """The estimated input cost.""" + output_cost: Optional[float] + """The estimated output cost.""" + currency: Literal["USD"] + """The estimate currency. Always ``USD``. Default value is \"USD\".""" + voice_live_amount: Required[float] + """The portion attributed to Voice Live processing. Required.""" + byom_model_amount: Optional[float] + """The portion attributed to a customer-provided model.""" + status: Required[Union[str, "VoiceAgentEstimatedCostStatus"]] + """Whether the estimate is complete, partial, or unavailable. Required. Known values are: + \"complete\", \"partial\", and \"unavailable\".""" + price_version: Required[str] + """The Voice Live price version used for the estimate. Required.""" + byom_model_price_version: Optional[str] + """The customer-provided model price version used for the estimate.""" + unpriced_components: list[str] + """Components for which no price was available.""" + + +class VoiceAgentFileSearchCallItem(TypedDict, total=False): + """A file-search output item. + + :ivar id: Required. + :vartype id: str + :ivar type: Required. Default value is "file_search_call". + :vartype type: Literal["file_search_call"] + :ivar status: Required. Known values are: "in_progress", "searching", "completed", + "incomplete", and "failed". + :vartype status: Union[str, "VoiceAgentFileSearchCallStatus"] + :ivar queries: + :vartype queries: list[str] + :ivar results: + :vartype results: list["VoiceAgentFileSearchResult"] + """ + + id: Required[str] + """Required.""" + type: Required[Literal["file_search_call"]] + """Required. Default value is \"file_search_call\".""" + status: Required[Union[str, "VoiceAgentFileSearchCallStatus"]] + """Required. Known values are: \"in_progress\", \"searching\", \"completed\", \"incomplete\", and + \"failed\".""" + queries: Optional[list[str]] + results: Optional[list["VoiceAgentFileSearchResult"]] + + +class VoiceAgentFileSearchResult(TypedDict, total=False): + """One result returned by a file-search call. + + :ivar attributes: + :vartype attributes: dict[str, "_unions.VoiceAgentFileSearchAttributeValue"] + :ivar file_id: + :vartype file_id: str + :ivar filename: + :vartype filename: str + :ivar score: + :vartype score: float + :ivar text: + :vartype text: str + """ + + attributes: Optional[dict[str, "_unions.VoiceAgentFileSearchAttributeValue"]] + file_id: Optional[str] + filename: Optional[str] + score: Optional[float] + text: Optional[str] + + +class VoiceAgentHandoffEdgeConfig(TypedDict, total=False): + """A directed transition between handoff nodes. + + :ivar id: The edge identifier. Required. + :vartype id: str + :ivar source: The source node identifier. Required. + :vartype source: str + :ivar target: The target node identifier. Required. + :vartype target: str + :ivar description: A non-empty description used by the model to select this transition. + Required. + :vartype description: str + :ivar cancel_on_interruption: Whether user interruption cancels the transition. + :vartype cancel_on_interruption: bool + :ivar delay_ms: The delay before the target behavior is committed, in milliseconds. + :vartype delay_ms: int + :ivar transfer_message: Optional text synthesized while transferring. + :vartype transfer_message: str + :ivar target_response: Whether the target automatically creates a response after transfer. + Known values are: "auto" and "none". + :vartype target_response: Union[str, "VoiceAgentHandoffTargetResponse"] + """ + + id: Required[str] + """The edge identifier. Required.""" + source: Required[str] + """The source node identifier. Required.""" + target: Required[str] + """The target node identifier. Required.""" + description: Required[str] + """A non-empty description used by the model to select this transition. Required.""" + cancel_on_interruption: bool + """Whether user interruption cancels the transition.""" + delay_ms: int + """The delay before the target behavior is committed, in milliseconds.""" + transfer_message: Optional[str] + """Optional text synthesized while transferring.""" + target_response: Union[str, "VoiceAgentHandoffTargetResponse"] + """Whether the target automatically creates a response after transfer. Known values are: \"auto\" + and \"none\".""" + + +class VoiceAgentHandoffEdgeState(TypedDict, total=False): + """Non-sensitive metadata for an effective handoff edge. + + :ivar id: The edge identifier. Required. + :vartype id: str + :ivar source: The source node identifier. Required. + :vartype source: str + :ivar target: The target node identifier. Required. + :vartype target: str + :ivar cancel_on_interruption: Whether user interruption cancels the transition. + :vartype cancel_on_interruption: bool + :ivar delay_ms: The delay before the target behavior is committed, in milliseconds. + :vartype delay_ms: int + :ivar transfer_message: Optional text synthesized while transferring. + :vartype transfer_message: str + :ivar target_response: Whether the target automatically creates a response after transfer. + Known values are: "auto" and "none". + :vartype target_response: Union[str, "VoiceAgentHandoffTargetResponse"] + """ + + id: Required[str] + """The edge identifier. Required.""" + source: Required[str] + """The source node identifier. Required.""" + target: Required[str] + """The target node identifier. Required.""" + cancel_on_interruption: bool + """Whether user interruption cancels the transition.""" + delay_ms: int + """The delay before the target behavior is committed, in milliseconds.""" + transfer_message: Optional[str] + """Optional text synthesized while transferring.""" + target_response: Union[str, "VoiceAgentHandoffTargetResponse"] + """Whether the target automatically creates a response after transfer. Known values are: \"auto\" + and \"none\".""" + + +class VoiceAgentHandoffGraphConfig(TypedDict, total=False): + """A customer-supplied handoff graph. + + :ivar max_transfers: The maximum number of successful transfers in the session. + :vartype max_transfers: int + :ivar max_attempts: The maximum number of transfer attempts in the session. + :vartype max_attempts: int + :ivar nodes: The explicitly configured handoff targets. Required. + :vartype nodes: list["VoiceAgentHandoffNodeConfig"] + :ivar edges: The directed transitions between handoff nodes. Required. + :vartype edges: list["VoiceAgentHandoffEdgeConfig"] + """ + + max_transfers: int + """The maximum number of successful transfers in the session.""" + max_attempts: Optional[int] + """The maximum number of transfer attempts in the session.""" + nodes: Required[list["VoiceAgentHandoffNodeConfig"]] + """The explicitly configured handoff targets. Required.""" + edges: Required[list["VoiceAgentHandoffEdgeConfig"]] + """The directed transitions between handoff nodes. Required.""" + + +class VoiceAgentHandoffNodeConfig(TypedDict, total=False): + """A configured handoff target and its node-scoped behavior. + + :ivar id: The node identifier. Required. + :vartype id: str + :ivar description: A non-empty description used to select this target. Required. + :vartype description: str + :ivar config: Session behavior applied after transferring to this node. Required. + :vartype config: "VoiceAgentHandoffNodeSessionConfig" + """ + + id: Required[str] + """The node identifier. Required.""" + description: Required[str] + """A non-empty description used to select this target. Required.""" + config: Required["VoiceAgentHandoffNodeSessionConfig"] + """Session behavior applied after transferring to this node. Required.""" + + +class VoiceAgentHandoffNodeSessionConfig(TypedDict, total=False): + """Session behavior applied at a handoff target. + + :ivar model: The target model, when different from the current node. + :vartype model: str + :ivar instructions: Instructions applied at the target node. + :vartype instructions: str + :ivar tools: Tools available at the target node. + :vartype tools: list["_unions.VoiceAgentSessionTool"] + :ivar tool_choice: Tool-selection behavior at the target node. Is either a Union[str, + "_models.ToolChoiceOptions"] type or a RealtimeToolChoiceFunction type. + :vartype tool_choice: "_unions.VoiceAgentToolChoice" + :ivar voice: The target node's voice. Is one of the following types: OpenAIVoice, AzureVoice, + AzureRealtimeNativeVoice + :vartype voice: "_unions.VoiceAgentVoice" + :ivar temperature: The target node's sampling temperature. + :vartype temperature: float + :ivar max_response_output_tokens: The target node's maximum output-token count. Is either a int + type or a Literal["inf"] type. + :vartype max_response_output_tokens: "_unions.VoiceAgentMaxOutputTokens" + :ivar reasoning_effort: The reasoning effort used at the target node. Known values are: "none", + "minimal", "low", "medium", "high", and "xhigh". + :vartype reasoning_effort: Union[str, "VoiceAgentHandoffReasoningEffort"] + :ivar voice_adaptation: Voice adaptation applied at the target node. + :vartype voice_adaptation: "VoiceAgentVoiceAdaptation" + :ivar interim_response: Interim-response settings applied at the target node. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. + :vartype interim_response: "_unions.VoiceAgentInterimResponse" + :ivar parallel_tool_calls: Whether the target model may call multiple tools in parallel. + :vartype parallel_tool_calls: bool + """ + + model: Optional[str] + """The target model, when different from the current node.""" + instructions: Optional[str] + """Instructions applied at the target node.""" + tools: Optional[list["_unions.VoiceAgentSessionTool"]] + """Tools available at the target node.""" + tool_choice: Optional["_unions.VoiceAgentToolChoice"] + """Tool-selection behavior at the target node. Is either a Union[str, + \"_models.ToolChoiceOptions\"] type or a RealtimeToolChoiceFunction type.""" + voice: Optional["_unions.VoiceAgentVoice"] + """The target node's voice. Is one of the following types: OpenAIVoice, AzureVoice, + AzureRealtimeNativeVoice""" + temperature: Optional[float] + """The target node's sampling temperature.""" + max_response_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] + """The target node's maximum output-token count. Is either a int type or a Literal[\"inf\"] type.""" + reasoning_effort: Optional[Union[str, "VoiceAgentHandoffReasoningEffort"]] + """The reasoning effort used at the target node. Known values are: \"none\", \"minimal\", \"low\", + \"medium\", \"high\", and \"xhigh\".""" + voice_adaptation: Optional["VoiceAgentVoiceAdaptation"] + """Voice adaptation applied at the target node.""" + interim_response: Optional["_unions.VoiceAgentInterimResponse"] + """Interim-response settings applied at the target node. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type.""" + parallel_tool_calls: bool + """Whether the target model may call multiple tools in parallel.""" + + +class VoiceAgentHandoffNodeState(TypedDict, total=False): + """Non-sensitive metadata for an effective handoff node. + + :ivar id: The node identifier. Required. + :vartype id: str + :ivar description: The node description. Required. + :vartype description: str + :ivar implicit: Whether the service implicitly created this node. + :vartype implicit: bool + """ + + id: Required[str] + """The node identifier. Required.""" + description: Required[str] + """The node description. Required.""" + implicit: bool + """Whether the service implicitly created this node.""" + + +class VoiceAgentHandoffState(TypedDict, total=False): + """The effective handoff state returned by the service. + + :ivar pipeline_family: The runtime pipeline family. Required. Known values are: "cascaded" and + "realtime". + :vartype pipeline_family: Union[str, "VoiceAgentPipelineFamily"] + :ivar active_node_id: The active node identifier. Required. + :vartype active_node_id: str + :ivar node_generation: The active node generation. Required. + :vartype node_generation: int + :ivar transfer_count: The number of completed transfers. Required. + :vartype transfer_count: int + :ivar attempt_count: The number of transfer attempts. Required. + :vartype attempt_count: int + :ivar available_edge_ids: The edge identifiers currently available to the model. Required. + :vartype available_edge_ids: list[str] + :ivar transfer_tool: The function tool exposed to initiate transfers. Required. + :vartype transfer_tool: "RealtimeFunctionTool" + :ivar nodes: The compiled handoff nodes. Required. + :vartype nodes: list["VoiceAgentHandoffNodeState"] + :ivar edges: The compiled handoff edges. Required. + :vartype edges: list["VoiceAgentHandoffEdgeState"] + """ + + pipeline_family: Required[Union[str, "VoiceAgentPipelineFamily"]] + """The runtime pipeline family. Required. Known values are: \"cascaded\" and \"realtime\".""" + active_node_id: Required[str] + """The active node identifier. Required.""" + node_generation: Required[int] + """The active node generation. Required.""" + transfer_count: Required[int] + """The number of completed transfers. Required.""" + attempt_count: Required[int] + """The number of transfer attempts. Required.""" + available_edge_ids: Required[list[str]] + """The edge identifiers currently available to the model. Required.""" + transfer_tool: Required[Optional["RealtimeFunctionTool"]] + """The function tool exposed to initiate transfers. Required.""" + nodes: Required[list["VoiceAgentHandoffNodeState"]] + """The compiled handoff nodes. Required.""" + edges: Required[list["VoiceAgentHandoffEdgeState"]] + """The compiled handoff edges. Required.""" + + +class VoiceAgentLlmInterimResponseConfig(TypedDict, total=False): + """An interim response generated by a language model. + + :ivar triggers: Conditions that may trigger one interim response. + :vartype triggers: list[Union[str, "VoiceAgentInterimResponseTrigger"]] + :ivar latency_threshold_ms: The latency threshold in milliseconds. + :vartype latency_threshold_ms: int + :ivar type: Required. Default value is "llm_interim_response". + :vartype type: Literal["llm_interim_response"] + :ivar model: The model used to generate interim responses. + :vartype model: str + :ivar instructions: Optional instructions for generating interim responses. + :vartype instructions: str + :ivar max_completion_tokens: The maximum completion-token count for an interim response. + :vartype max_completion_tokens: int + """ + + triggers: list[Union[str, "VoiceAgentInterimResponseTrigger"]] + """Conditions that may trigger one interim response.""" + latency_threshold_ms: int + """The latency threshold in milliseconds.""" + type: Required[Literal["llm_interim_response"]] + """Required. Default value is \"llm_interim_response\".""" + model: str + """The model used to generate interim responses.""" + instructions: str + """Optional instructions for generating interim responses.""" + max_completion_tokens: int + """The maximum completion-token count for an interim response.""" + + +class VoiceAgentMcpAssignedManagedIdentity(TypedDict, total=False): + """A managed identity used to authorize a voice-agent MCP connection. + + :ivar type: Required. Default value is "assigned_managed_identity". + :vartype type: Literal["assigned_managed_identity"] + :ivar audience: Required. + :vartype audience: str + :ivar client_id: + :vartype client_id: str + """ + + type: Required[Literal["assigned_managed_identity"]] + """Required. Default value is \"assigned_managed_identity\".""" + audience: Required[str] + """Required.""" + client_id: str + + +class VoiceAgentMcpTool(TypedDict, total=False): + """An MCP tool available to a voice agent. + + :ivar type: The type of the MCP tool. Always ``mcp``. Required. MCP. + :vartype type: Literal[ToolType.MCP] + :ivar server_label: A label for this MCP server, used to identify it in tool calls. Required. + :vartype server_label: 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: Union[list[str], "MCPToolFilter"] + :ivar allowed_callers: + :vartype allowed_callers: list[Union[str, "CallableToolAllowedCaller"]] + :ivar require_approval: Is one of the following types: MCPToolRequireApproval, + Literal["always"], Literal["never"] + :vartype require_approval: Union["MCPToolRequireApproval", Literal["always"], Literal["never"]] + :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, "ToolConfig"] + :ivar server_url: The URL for the MCP server. + :vartype server_url: str + :ivar response_scheduling: When the MCP invocation creates a follow-up response. Defaults to + ``when_idle`` so the agent continues after the tool call completes. Known values are: "silent", + "when_idle", "interrupt", and "skip_if_busy". + :vartype response_scheduling: Union[str, "VoiceAgentMcpResponseScheduling"] + """ + + type: Required[Literal[ToolType.MCP]] + """The type of the MCP tool. Always ``mcp``. Required. MCP.""" + server_label: Required[str] + """A label for this MCP server, used to identify it in tool calls. Required.""" + server_description: str + """Optional description of the MCP server, used to provide more context.""" + headers: Optional[dict[str, str]] + allowed_tools: Optional[Union[list[str], "MCPToolFilter"]] + """Is either a [str] type or a MCPToolFilter type.""" + allowed_callers: Optional[list[Union[str, "CallableToolAllowedCaller"]]] + require_approval: Optional[Union["MCPToolRequireApproval", Literal["always"], Literal["never"]]] + """Is one of the following types: MCPToolRequireApproval, Literal[\"always\"], Literal[\"never\"]""" + defer_loading: bool + """Whether this MCP tool is deferred and discovered via tool search.""" + project_connection_id: str + """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: dict[str, "ToolConfig"] + """Deprecated. This property is deprecated and will be removed in a future version.""" + server_url: str + """The URL for the MCP server.""" + response_scheduling: Union[str, "VoiceAgentMcpResponseScheduling"] + """When the MCP invocation creates a follow-up response. Defaults to ``when_idle`` so the agent + continues after the tool call completes. Known values are: \"silent\", \"when_idle\", + \"interrupt\", and \"skip_if_busy\".""" + + +class VoiceAgentRealtimeResponse(TypedDict, total=False): + """A realtime response returned by the voice-agent service. + + :ivar object: The object type. Always ``realtime.response``. Required. Default value is + "realtime.response". + :vartype object: Literal["realtime.response"] + :ivar id: The response identifier. Required. + :vartype id: str + :ivar status: The response lifecycle status. Required. Known values are: "in_progress", + "completed", "cancelled", "incomplete", and "failed". + :vartype status: Union[str, "VoiceAgentResponseStatus"] + :ivar status_details: Additional details for a terminal response status. Required. + :vartype status_details: "RealtimeResponseStatusDetails" + :ivar output: The items produced by the response. Required. + :vartype output: list["_unions.VoiceAgentResponseItem"] + :ivar usage: Token usage for the response. Required. + :vartype usage: "RealtimeResponseUsage" + :ivar estimated_cost: The best-effort response cost estimate. Returned only when cost output is + enabled. + :vartype estimated_cost: "VoiceAgentEstimatedCost" + :ivar conversation_id: The conversation identifier, or null for an out-of-band response. + :vartype conversation_id: str + :ivar modalities: The modalities used by the response. + :vartype modalities: list[Union[str, "VoiceOutputModality"]] + :ivar voice: The voice used by the response. Is one of the following types: OpenAIVoice, + AzureVoice, AzureRealtimeNativeVoice + :vartype voice: "_unions.VoiceAgentVoice" + :ivar output_audio_format: The output-audio format used by the response. Known values are: + "pcm16", "pcm16_8000hz", "pcm16_16000hz", "pcm16_22050hz", "pcm16_24000hz", "pcm16_44100hz", + "pcm16_48000hz", "g711_ulaw", "g711_alaw", "mp3", "mp3_24khz_48kbps", "mp3_24khz_96kbps", and + "mp3_24khz_160kbps". + :vartype output_audio_format: Union[str, "VoiceAgentResponseAudioFormat"] + :ivar temperature: The sampling temperature used by the response. + :vartype temperature: float + :ivar max_output_tokens: The maximum output-token count used by the response. Is either a int + type or a Literal["inf"] type. + :vartype max_output_tokens: "_unions.VoiceAgentMaxOutputTokens" + :ivar metadata: String key-value metadata attached to the response. + :vartype metadata: dict[str, str] + """ + + object: Required[Literal["realtime.response"]] + """The object type. Always ``realtime.response``. Required. Default value is + \"realtime.response\".""" + id: Required[str] + """The response identifier. Required.""" + status: Required[Union[str, "VoiceAgentResponseStatus"]] + """The response lifecycle status. Required. Known values are: \"in_progress\", \"completed\", + \"cancelled\", \"incomplete\", and \"failed\".""" + status_details: Required[Optional["RealtimeResponseStatusDetails"]] + """Additional details for a terminal response status. Required.""" + output: Required[list["_unions.VoiceAgentResponseItem"]] + """The items produced by the response. Required.""" + usage: Required[Optional["RealtimeResponseUsage"]] + """Token usage for the response. Required.""" + estimated_cost: "VoiceAgentEstimatedCost" + """The best-effort response cost estimate. Returned only when cost output is enabled.""" + conversation_id: Optional[str] + """The conversation identifier, or null for an out-of-band response.""" + modalities: Optional[list[Union[str, "VoiceOutputModality"]]] + """The modalities used by the response.""" + voice: Optional["_unions.VoiceAgentVoice"] + """The voice used by the response. Is one of the following types: OpenAIVoice, AzureVoice, + AzureRealtimeNativeVoice""" + output_audio_format: Optional[Union[str, "VoiceAgentResponseAudioFormat"]] + """The output-audio format used by the response. Known values are: \"pcm16\", \"pcm16_8000hz\", + \"pcm16_16000hz\", \"pcm16_22050hz\", \"pcm16_24000hz\", \"pcm16_44100hz\", \"pcm16_48000hz\", + \"g711_ulaw\", \"g711_alaw\", \"mp3\", \"mp3_24khz_48kbps\", \"mp3_24khz_96kbps\", and + \"mp3_24khz_160kbps\".""" + temperature: Optional[float] + """The sampling temperature used by the response.""" + max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] + """The maximum output-token count used by the response. Is either a int type or a Literal[\"inf\"] + type.""" + metadata: Optional[dict[str, str]] + """String key-value metadata attached to the response.""" + + +class VoiceAgentResponseCreateAudio(TypedDict, total=False): + """Output-audio settings applied to one ``response.create`` request. + + :ivar output: The response-specific output-audio settings. + :vartype output: "VoiceAgentSessionUpdateAudioOutput" + """ + + output: Optional["VoiceAgentSessionUpdateAudioOutput"] + """The response-specific output-audio settings.""" + + +class VoiceAgentResponseCreateParams(TypedDict, total=False): + """Parameters accepted by a voice-agent ``response.create`` event. + + :ivar instructions: The default system instructions (i.e. system message) prepended to model + calls. This field allows the client to guide the model on desired responses. The model can be + instructed on response content and format, (e.g. "be extremely succinct", "act friendly", "here + are examples of good responses") and on audio behavior (e.g. "talk quickly", "inject emotion + into your voice", "laugh frequently"). The instructions are not guaranteed to be followed by + the model, but they provide guidance to the model on the desired behavior. Note that the server + sets default instructions which will be used if this field is not set and are visible in the + ``session.created`` event at the start of the session. + :vartype instructions: str + :ivar tools: Tools available to the model. + :vartype tools: list[Union["RealtimeFunctionTool", "MCPTool"]] + :ivar tool_choice: How the model chooses tools. Provide one of the string modes or force a + specific function/MCP tool. Is one of the following types: Union[str, + "_models.ToolChoiceOptions"], ToolChoiceFunction, ToolChoiceMCP + :vartype tool_choice: Union[str, "ToolChoiceOptions", "ToolChoiceFunction", "ToolChoiceMCP"] + :ivar parallel_tool_calls: Whether the model may call multiple tools in parallel. Only + supported by reasoning Realtime models such as ``gpt-realtime-2``. + :vartype parallel_tool_calls: bool + :ivar reasoning: + :vartype reasoning: "RealtimeReasoning" + :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, + inclusive of tool calls. Provide an integer between 1 and 4096 to limit output tokens, or + ``inf`` for the maximum available tokens for a given model. Defaults to ``inf``. Is either a + int type or a Literal["inf"] type. + :vartype max_output_tokens: Union[int, Literal["inf"]] + :ivar conversation: Controls which conversation the response is added to. Currently supports + ``auto`` and ``none``, with ``auto`` as the default value. The ``auto`` value means that the + contents of the response will be added to the default conversation. Set this to ``none`` to + create an out-of-band response which will not add items to default conversation. Is one of the + following types: Literal["auto"], Literal["none"], str + :vartype conversation: Union[Literal["auto"], Literal["none"], str] + :ivar metadata: + :vartype metadata: "Metadata" + :ivar input: Input items to include in the prompt for the model. Using this field creates a new + context for this Response instead of using the default conversation. An empty array ``[]`` will + clear the context for this Response. Note that this can include references to items that + previously appeared in the session using their id. + :vartype input: list["RealtimeConversationItem"] + :ivar output_modalities: Modalities that the response may return. + :vartype output_modalities: list[Union[str, "VoiceOutputModality"]] + :ivar audio: Response-specific audio settings. + :vartype audio: "VoiceAgentResponseCreateAudio" + :ivar pre_generated_assistant_message: A pre-generated assistant message used to begin the + response. + :vartype pre_generated_assistant_message: "RealtimeConversationItemMessageAssistant" + :ivar interim_response: Interim-response settings for this response. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. + :vartype interim_response: "_unions.VoiceAgentInterimResponse" + """ + + instructions: str + """The default system instructions (i.e. system message) prepended to model calls. This field + allows the client to guide the model on desired responses. The model can be instructed on + response content and format, (e.g. \"be extremely succinct\", \"act friendly\", \"here are + examples of good responses\") and on audio behavior (e.g. \"talk quickly\", \"inject emotion + into your voice\", \"laugh frequently\"). The instructions are not guaranteed to be followed by + the model, but they provide guidance to the model on the desired behavior. Note that the server + sets default instructions which will be used if this field is not set and are visible in the + ``session.created`` event at the start of the session.""" + tools: list[Union["RealtimeFunctionTool", "MCPTool"]] + """Tools available to the model.""" + tool_choice: Union[str, "ToolChoiceOptions", "ToolChoiceFunction", "ToolChoiceMCP"] + """How the model chooses tools. Provide one of the string modes or force a specific function/MCP + tool. Is one of the following types: Union[str, \"_models.ToolChoiceOptions\"], + ToolChoiceFunction, ToolChoiceMCP""" + parallel_tool_calls: bool + """Whether the model may call multiple tools in parallel. Only supported by reasoning Realtime + models such as ``gpt-realtime-2``.""" + reasoning: "RealtimeReasoning" + max_output_tokens: Union[int, Literal["inf"]] + """Maximum number of output tokens for a single assistant response, inclusive of tool calls. + Provide an integer between 1 and 4096 to limit output tokens, or ``inf`` for the maximum + available tokens for a given model. Defaults to ``inf``. Is either a int type or a + Literal[\"inf\"] type.""" + conversation: Union[Literal["auto"], Literal["none"], str] + """Controls which conversation the response is added to. Currently supports ``auto`` and ``none``, + with ``auto`` as the default value. The ``auto`` value means that the contents of the response + will be added to the default conversation. Set this to ``none`` to create an out-of-band + response which will not add items to default conversation. Is one of the following types: + Literal[\"auto\"], Literal[\"none\"], str""" + metadata: Optional["Metadata"] + input: list["RealtimeConversationItem"] + """Input items to include in the prompt for the model. Using this field creates a new context for + this Response instead of using the default conversation. An empty array ``[]`` will clear the + context for this Response. Note that this can include references to items that previously + appeared in the session using their id.""" + output_modalities: list[Union[str, "VoiceOutputModality"]] + """Modalities that the response may return.""" + audio: "VoiceAgentResponseCreateAudio" + """Response-specific audio settings.""" + pre_generated_assistant_message: Optional["RealtimeConversationItemMessageAssistant"] + """A pre-generated assistant message used to begin the response.""" + interim_response: Optional["_unions.VoiceAgentInterimResponse"] + """Interim-response settings for this response. Is either a VoiceAgentStaticInterimResponseConfig + type or a VoiceAgentLlmInterimResponseConfig type.""" + + +class VoiceAgentResponseEventAudioContentPart(TypedDict, total=False): + """An audio part in a ``response.content_part.*`` server event. + + :ivar type: Required. Default value is "audio". + :vartype type: Literal["audio"] + :ivar transcript: Required. + :vartype transcript: str + :ivar annotations: + :vartype annotations: Any + :ivar audio: + :vartype audio: str + :ivar format: + :vartype format: "VoiceAudioFormat" + """ + + type: Required[Literal["audio"]] + """Required. Default value is \"audio\".""" + transcript: Required[Optional[str]] + """Required.""" + annotations: Any + audio: str + format: "VoiceAudioFormat" + + +class VoiceAgentResponseEventTextContentPart(TypedDict, total=False): + """A text part in a ``response.content_part.*`` server event. + + :ivar type: Required. Default value is "text". + :vartype type: Literal["text"] + :ivar text: Required. + :vartype text: str + """ + + type: Required[Literal["text"]] + """Required. Default value is \"text\".""" + text: Required[str] + """Required.""" + + +class VoiceAgentSemanticVadTurnDetection(TypedDict, total=False): + """OpenAI semantic VAD turn-detection settings. + + :ivar eagerness: Is one of the following types: Literal["low"], Literal["medium"], + Literal["high"], Literal["auto"] + :vartype eagerness: Literal["low", "medium", "high", "auto"] + :ivar create_response: + :vartype create_response: bool + :ivar interrupt_response: + :vartype interrupt_response: bool + :ivar type: Required. Semantic voice activity detection. + :vartype type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD] + :ivar auto_truncate: + :vartype auto_truncate: bool + """ + + eagerness: Literal["low", "medium", "high", "auto"] + """Is one of the following types: Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"], + Literal[\"auto\"]""" + create_response: bool + interrupt_response: bool + type: Required[Literal[VoiceTurnDetectionType.SEMANTIC_VAD]] + """Required. Semantic voice activity detection.""" + auto_truncate: bool + + +class VoiceAgentServerEventConversationCreated(TypedDict, total=False): + """The ``conversation.created`` server event emitted when a voice-agent connection starts. + + :ivar type: Required. Default value is "conversation.created". + :vartype type: Literal["conversation.created"] + :ivar conversation_id: The identifier of the created conversation. Required. + :vartype conversation_id: str + """ + + type: Required[Literal["conversation.created"]] + """Required. Default value is \"conversation.created\".""" + conversation_id: Required[str] + """The identifier of the created conversation. Required.""" + + +class VoiceAgentServerEventConversationItemAdded(TypedDict, total=False): # pylint: disable=name-too-long + """The ``conversation.item.added`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``conversation.item.added``. Required. + CONVERSATION_ITEM_ADDED. + :vartype type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED] + :ivar previous_item_id: + :vartype previous_item_id: str + :ivar item: The item added to the conversation. Required. Is one of the following types: + "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, + VoiceAgentFileSearchCallItem + :vartype item: "_unions.VoiceAgentResponseItem" + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED]] + """The event type, must be ``conversation.item.added``. Required. CONVERSATION_ITEM_ADDED.""" + previous_item_id: Optional[str] + item: Required["_unions.VoiceAgentResponseItem"] + """The item added to the conversation. Required. Is one of the following types: + \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, + VoiceAgentFileSearchCallItem""" + + +class VoiceAgentServerEventConversationItemCreated(TypedDict, total=False): # pylint: disable=name-too-long + """The ``conversation.item.created`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``conversation.item.created``. Required. + CONVERSATION_ITEM_CREATED. + :vartype type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED] + :ivar previous_item_id: + :vartype previous_item_id: str + :ivar item: The created conversation item. Required. Is one of the following types: + "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, + VoiceAgentFileSearchCallItem + :vartype item: "_unions.VoiceAgentResponseItem" + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED]] + """The event type, must be ``conversation.item.created``. Required. CONVERSATION_ITEM_CREATED.""" + previous_item_id: Optional[str] + item: Required["_unions.VoiceAgentResponseItem"] + """The created conversation item. Required. Is one of the following types: + \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, + VoiceAgentFileSearchCallItem""" + + +class VoiceAgentServerEventConversationItemDeleted(TypedDict, total=False): # pylint: disable=name-too-long + """The ``conversation.item.deleted`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``conversation.item.deleted``. Required. + CONVERSATION_ITEM_DELETED. + :vartype type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED] + :ivar item_id: The ID of the item that was deleted. Required. + :vartype item_id: str + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED]] + """The event type, must be ``conversation.item.deleted``. Required. CONVERSATION_ITEM_DELETED.""" + item_id: Required[str] + """The ID of the item that was deleted. Required.""" + + +class VoiceAgentServerEventConversationItemDone(TypedDict, total=False): # pylint: disable=name-too-long + """The ``conversation.item.done`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``conversation.item.done``. Required. + CONVERSATION_ITEM_DONE. + :vartype type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE] + :ivar previous_item_id: + :vartype previous_item_id: str + :ivar item: The completed conversation item. Required. Is one of the following types: + "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, + VoiceAgentFileSearchCallItem + :vartype item: "_unions.VoiceAgentResponseItem" + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE]] + """The event type, must be ``conversation.item.done``. Required. CONVERSATION_ITEM_DONE.""" + previous_item_id: Optional[str] + item: Required["_unions.VoiceAgentResponseItem"] + """The completed conversation item. Required. Is one of the following types: + \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, + VoiceAgentFileSearchCallItem""" + + +class VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted( + TypedDict, total=False +): # pylint: disable=name-too-long + """The ``conversation.item.input_audio_transcription.completed`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :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: + Literal[RealtimeServerEventType.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 logprobs: + :vartype logprobs: list["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: Union["TranscriptTextUsageTokens", "TranscriptTextUsageDuration"] + :ivar phrases: Phrase-level transcription timing and confidence details. + :vartype phrases: list["VoiceAgentTranscriptionPhrase"] + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED]] + """The event type, must be ``conversation.item.input_audio_transcription.completed``. Required. + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED.""" + item_id: Required[str] + """The ID of the item containing the audio that is being transcribed. Required.""" + content_index: Required[int] + """The index of the content part containing the audio. Required.""" + transcript: Required[str] + """The transcribed text. Required.""" + logprobs: Optional[list["LogProbProperties"]] + usage: Required[Union["TranscriptTextUsageTokens", "TranscriptTextUsageDuration"]] + """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["VoiceAgentTranscriptionPhrase"]] + """Phrase-level transcription timing and confidence details.""" + + +class VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta( + TypedDict, total=False +): # pylint: disable=name-too-long + """The ``conversation.item.input_audio_transcription.delta`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :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: + Literal[RealtimeServerEventType.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["LogProbProperties"] + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA]] + """The event type, must be ``conversation.item.input_audio_transcription.delta``. Required. + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA.""" + item_id: Required[str] + """The ID of the item containing the audio that is being transcribed. Required.""" + content_index: int + """The index of the content part in the item's content array.""" + delta: str + """The text delta.""" + logprobs: Optional[list["LogProbProperties"]] + + +class VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed( + TypedDict, total=False +): # pylint: disable=name-too-long + """The ``conversation.item.input_audio_transcription.failed`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :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: + Literal[RealtimeServerEventType.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: "RealtimeServerEventConversationItemInputAudioTranscriptionFailedError" + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED]] + """The event type, must be ``conversation.item.input_audio_transcription.failed``. Required. + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED.""" + item_id: Required[str] + """The ID of the user message item. Required.""" + content_index: Required[int] + """The index of the content part containing the audio. Required.""" + error: Required["RealtimeServerEventConversationItemInputAudioTranscriptionFailedError"] + """Details of the transcription error. Required.""" + + +class VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment( + TypedDict, total=False +): # pylint: disable=name-too-long + """The ``conversation.item.input_audio_transcription.segment`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :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: + Literal[RealtimeServerEventType.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: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT]] + """The event type, must be ``conversation.item.input_audio_transcription.segment``. Required. + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT.""" + item_id: Required[str] + """The ID of the item containing the input audio content. Required.""" + content_index: Required[int] + """The index of the input audio content part within the item. Required.""" + text: Required[str] + """The text for this segment. Required.""" + id: Required[str] + """The segment identifier. Required.""" + speaker: Required[str] + """The detected speaker label for this segment. Required.""" + start: Required[float] + """Start time of the segment in seconds. Required.""" + end: Required[float] + """End time of the segment in seconds. Required.""" + + +class VoiceAgentServerEventConversationItemRetrieved(TypedDict, total=False): # pylint: disable=name-too-long + """The ``conversation.item.retrieved`` server event. + + :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: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED] + :ivar item: The retrieved conversation item. Required. Is one of the following types: + "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, + VoiceAgentFileSearchCallItem + :vartype item: "_unions.VoiceAgentResponseItem" + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED]] + """The event type, must be ``conversation.item.retrieved``. Required. CONVERSATION_ITEM_RETRIEVED.""" + item: Required["_unions.VoiceAgentResponseItem"] + """The retrieved conversation item. Required. Is one of the following types: + \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, + VoiceAgentFileSearchCallItem""" + + +class VoiceAgentServerEventConversationItemTruncated(TypedDict, total=False): # pylint: disable=name-too-long + """The ``conversation.item.truncated`` server event. + + :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: Literal[RealtimeServerEventType.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: "RealtimeConversationItemMessageAssistant" + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED]] + """The event type, must be ``conversation.item.truncated``. Required. CONVERSATION_ITEM_TRUNCATED.""" + item_id: Required[str] + """The ID of the assistant message item that was truncated. Required.""" + content_index: Required[int] + """The index of the content part that was truncated. Required.""" + audio_end_ms: Required[int] + """The duration up to which the audio was truncated, in milliseconds. Required.""" + item: "RealtimeConversationItemMessageAssistant" + """The assistant message after truncation, when the service returns the updated item.""" + + +class VoiceAgentServerEventError(TypedDict, total=False): + """The ``error`` server event. + + :ivar event_id: The unique identifier of the event. Required. + :vartype event_id: str + :ivar type: Required. Default value is "error". + :vartype type: Literal["error"] + :ivar error: Details of the error. Required. + :vartype error: "VoiceAgentServerEventErrorDetails" + """ + + event_id: Required[str] + """The unique identifier of the event. Required.""" + type: Required[Literal["error"]] + """Required. Default value is \"error\".""" + error: Required["VoiceAgentServerEventErrorDetails"] + """Details of the error. Required.""" + + +class VoiceAgentServerEventErrorDetails(TypedDict, total=False): + """Details of a voice-agent WebSocket error. + + :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 tool_label: The configured label of a tool that could not be resolved. + :vartype tool_label: str + :ivar tool_type: The configured type of a tool that could not be resolved. + :vartype tool_type: str + """ + + type: Required[str] + """Required.""" + code: Optional[str] + message: Required[str] + """Required.""" + param: Optional[str] + event_id: Optional[str] + tool_label: str + """The configured label of a tool that could not be resolved.""" + tool_type: str + """The configured type of a tool that could not be resolved.""" + + +class VoiceAgentServerEventFileSearchCallCompleted(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.file_search_call.completed`` server event. + + :ivar type: Required. Default value is "response.file_search_call.completed". + :vartype type: Literal["response.file_search_call.completed"] + :ivar event_id: + :vartype event_id: str + :ivar response_id: + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar sequence_number: Required. + :vartype sequence_number: int + """ + + type: Required[Literal["response.file_search_call.completed"]] + """Required. Default value is \"response.file_search_call.completed\".""" + event_id: str + response_id: str + item_id: Required[str] + """Required.""" + output_index: Required[int] + """Required.""" + sequence_number: Required[int] + """Required.""" + + +class VoiceAgentServerEventFileSearchCallInProgress(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.file_search_call.in_progress`` server event. + + :ivar type: Required. Default value is "response.file_search_call.in_progress". + :vartype type: Literal["response.file_search_call.in_progress"] + :ivar event_id: + :vartype event_id: str + :ivar response_id: + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar sequence_number: Required. + :vartype sequence_number: int + """ + + type: Required[Literal["response.file_search_call.in_progress"]] + """Required. Default value is \"response.file_search_call.in_progress\".""" + event_id: str + response_id: str + item_id: Required[str] + """Required.""" + output_index: Required[int] + """Required.""" + sequence_number: Required[int] + """Required.""" + + +class VoiceAgentServerEventFileSearchCallSearching(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.file_search_call.searching`` server event. + + :ivar type: Required. Default value is "response.file_search_call.searching". + :vartype type: Literal["response.file_search_call.searching"] + :ivar event_id: + :vartype event_id: str + :ivar response_id: + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar sequence_number: Required. + :vartype sequence_number: int + """ + + type: Required[Literal["response.file_search_call.searching"]] + """Required. Default value is \"response.file_search_call.searching\".""" + event_id: str + response_id: str + item_id: Required[str] + """Required.""" + output_index: Required[int] + """Required.""" + sequence_number: Required[int] + """Required.""" + + +class VoiceAgentServerEventInputAudioBufferCleared(TypedDict, total=False): # pylint: disable=name-too-long + """The ``input_audio_buffer.cleared`` server event. + + :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: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED] + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED]] + """The event type, must be ``input_audio_buffer.cleared``. Required. INPUT_AUDIO_BUFFER_CLEARED.""" + + +class VoiceAgentServerEventInputAudioBufferCommitted(TypedDict, total=False): # pylint: disable=name-too-long + """The ``input_audio_buffer.committed`` server event. + + :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: Literal[RealtimeServerEventType.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 + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED]] + """The event type, must be ``input_audio_buffer.committed``. Required. + INPUT_AUDIO_BUFFER_COMMITTED.""" + previous_item_id: Optional[str] + item_id: Required[str] + """The ID of the user message item that will be created. Required.""" + + +class VoiceAgentServerEventInputAudioBufferSpeechStarted(TypedDict, total=False): # pylint: disable=name-too-long + """The ``input_audio_buffer.speech_started`` server event. + + :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: Literal[RealtimeServerEventType.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 + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED]] + """The event type, must be ``input_audio_buffer.speech_started``. Required. + INPUT_AUDIO_BUFFER_SPEECH_STARTED.""" + audio_start_ms: Required[int] + """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: Required[str] + """The ID of the user message item that will be created when speech stops. Required.""" + + +class VoiceAgentServerEventInputAudioBufferSpeechStopped(TypedDict, total=False): # pylint: disable=name-too-long + """The ``input_audio_buffer.speech_stopped`` server event. + + :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: Literal[RealtimeServerEventType.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 + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED]] + """The event type, must be ``input_audio_buffer.speech_stopped``. Required. + INPUT_AUDIO_BUFFER_SPEECH_STOPPED.""" + audio_end_ms: Required[int] + """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: Required[str] + """The ID of the user message item that will be created. Required.""" + + +class VoiceAgentServerEventInputAudioBufferTimeoutTriggered(TypedDict, total=False): # pylint: disable=name-too-long + """The ``input_audio_buffer.timeout_triggered`` server event. + + :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: Literal[RealtimeServerEventType.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 + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED]] + """The event type, must be ``input_audio_buffer.timeout_triggered``. Required. + INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED.""" + audio_start_ms: Required[int] + """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: Required[int] + """Millisecond offset of audio written to the input audio buffer at the time the timeout was + triggered. Required.""" + item_id: Required[str] + """The ID of the item associated with this segment. Required.""" + + +class VoiceAgentServerEventMcpListToolsCompleted(TypedDict, total=False): # pylint: disable=name-too-long + """The ``mcp_list_tools.completed`` server event. + + :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: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED] + :ivar item_id: The ID of the MCP list tools item. Required. + :vartype item_id: str + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED]] + """The event type, must be ``mcp_list_tools.completed``. Required. MCP_LIST_TOOLS_COMPLETED.""" + item_id: Required[str] + """The ID of the MCP list tools item. Required.""" + + +class VoiceAgentServerEventMcpListToolsFailed(TypedDict, total=False): + """The ``mcp_list_tools.failed`` server event. + + :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: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED] + :ivar item_id: The ID of the MCP list tools item. Required. + :vartype item_id: str + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED]] + """The event type, must be ``mcp_list_tools.failed``. Required. MCP_LIST_TOOLS_FAILED.""" + item_id: Required[str] + """The ID of the MCP list tools item. Required.""" + + +class VoiceAgentServerEventMcpListToolsInProgress(TypedDict, total=False): # pylint: disable=name-too-long + """The ``mcp_list_tools.in_progress`` server event. + + :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: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS] + :ivar item_id: The ID of the MCP list tools item. Required. + :vartype item_id: str + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS]] + """The event type, must be ``mcp_list_tools.in_progress``. Required. MCP_LIST_TOOLS_IN_PROGRESS.""" + item_id: Required[str] + """The ID of the MCP list tools item. Required.""" + + +class VoiceAgentServerEventOutputAudioBufferCleared(TypedDict, total=False): # pylint: disable=name-too-long + """The ``output_audio_buffer.cleared`` server event. + + :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: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED] + :ivar response_id: The unique ID of the response that produced the audio. Required. + :vartype response_id: str + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED]] + """The event type, must be ``output_audio_buffer.cleared``. Required. OUTPUT_AUDIO_BUFFER_CLEARED.""" + response_id: Required[str] + """The unique ID of the response that produced the audio. Required.""" + + +class VoiceAgentServerEventRateLimitsUpdated(TypedDict, total=False): + """The ``rate_limits.updated`` server event. + + :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: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED] + :ivar rate_limits: List of rate limit information. Required. + :vartype rate_limits: list["RealtimeServerEventRateLimitsUpdatedRateLimits"] + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED]] + """The event type, must be ``rate_limits.updated``. Required. RATE_LIMITS_UPDATED.""" + rate_limits: Required[list["RealtimeServerEventRateLimitsUpdatedRateLimits"]] + """List of rate limit information. Required.""" + + +class VoiceAgentServerEventResponseAnimationBlendshapesDelta(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.animation_blendshapes.delta`` server event. + + :ivar type: Required. Default value is "response.animation_blendshapes.delta". + :vartype type: Literal["response.animation_blendshapes.delta"] + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int + :ivar frames: Animation frames as numeric blendshape weights or a compact encoded string. + Required. Is either a [[float]] type or a str type. + :vartype frames: Union[list[list[float]], str] + :ivar frame_index: The index of the first frame in this delta. Required. + :vartype frame_index: int + """ + + type: Required[Literal["response.animation_blendshapes.delta"]] + """Required. Default value is \"response.animation_blendshapes.delta\".""" + event_id: Required[str] + """Required.""" + response_id: Required[str] + """Required.""" + item_id: Required[str] + """Required.""" + output_index: Required[int] + """Required.""" + content_index: Required[int] + """Required.""" + frames: Required[Union[list[list[float]], str]] + """Animation frames as numeric blendshape weights or a compact encoded string. Required. Is either + a [[float]] type or a str type.""" + frame_index: Required[int] + """The index of the first frame in this delta. Required.""" + + +class VoiceAgentServerEventResponseAnimationBlendshapesDone(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.animation_blendshapes.done`` server event. + + :ivar type: Required. Default value is "response.animation_blendshapes.done". + :vartype type: Literal["response.animation_blendshapes.done"] + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + """ + + type: Required[Literal["response.animation_blendshapes.done"]] + """Required. Default value is \"response.animation_blendshapes.done\".""" + event_id: Required[str] + """Required.""" + response_id: Required[str] + """Required.""" + item_id: Required[str] + """Required.""" + output_index: Required[int] + """Required.""" + + +class VoiceAgentServerEventResponseAnimationVisemeDelta(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.animation_viseme.delta`` server event. + + :ivar type: Required. Default value is "response.animation_viseme.delta". + :vartype type: Literal["response.animation_viseme.delta"] + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int + :ivar audio_offset_ms: Required. + :vartype audio_offset_ms: int + :ivar viseme_id: Required. + :vartype viseme_id: int + """ + + type: Required[Literal["response.animation_viseme.delta"]] + """Required. Default value is \"response.animation_viseme.delta\".""" + event_id: Required[str] + """Required.""" + response_id: Required[str] + """Required.""" + item_id: Required[str] + """Required.""" + output_index: Required[int] + """Required.""" + content_index: Required[int] + """Required.""" + audio_offset_ms: Required[int] + """Required.""" + viseme_id: Required[int] + """Required.""" + + +class VoiceAgentServerEventResponseAnimationVisemeDone(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.animation_viseme.done`` server event. + + :ivar type: Required. Default value is "response.animation_viseme.done". + :vartype type: Literal["response.animation_viseme.done"] + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int + """ + + type: Required[Literal["response.animation_viseme.done"]] + """Required. Default value is \"response.animation_viseme.done\".""" + event_id: Required[str] + """Required.""" + response_id: Required[str] + """Required.""" + item_id: Required[str] + """Required.""" + output_index: Required[int] + """Required.""" + content_index: Required[int] + """Required.""" + + +class VoiceAgentServerEventResponseAudioDelta(TypedDict, total=False): + """The ``response.output_audio.delta`` server event. + + :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: Literal[RealtimeServerEventType.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: str + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA]] + """The event type, must be ``response.output_audio.delta``. Required. RESPONSE_OUTPUT_AUDIO_DELTA.""" + response_id: Required[str] + """The ID of the response. Required.""" + item_id: Required[str] + """The ID of the item. Required.""" + output_index: Required[int] + """The index of the output item in the response. Required.""" + content_index: Required[int] + """The index of the content part in the item's content array. Required.""" + delta: Required[str] + """Base64-encoded audio data delta. Required.""" + + +class VoiceAgentServerEventResponseAudioDone(TypedDict, total=False): + """The ``response.output_audio.done`` server event. + + :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: Literal[RealtimeServerEventType.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 + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE]] + """The event type, must be ``response.output_audio.done``. Required. RESPONSE_OUTPUT_AUDIO_DONE.""" + response_id: Required[str] + """The ID of the response. Required.""" + item_id: Required[str] + """The ID of the item. Required.""" + output_index: Required[int] + """The index of the output item in the response. Required.""" + content_index: Required[int] + """The index of the content part in the item's content array. Required.""" + + +class VoiceAgentServerEventResponseAudioTimestampDelta(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.audio_timestamp.delta`` server event. + + :ivar type: Required. Default value is "response.audio_timestamp.delta". + :vartype type: Literal["response.audio_timestamp.delta"] + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int + :ivar audio_offset_ms: Required. + :vartype audio_offset_ms: int + :ivar audio_duration_ms: Required. + :vartype audio_duration_ms: int + :ivar text: Required. + :vartype text: str + :ivar timestamp_type: Required. Default value is "word". + :vartype timestamp_type: Literal["word"] + """ + + type: Required[Literal["response.audio_timestamp.delta"]] + """Required. Default value is \"response.audio_timestamp.delta\".""" + event_id: Required[str] + """Required.""" + response_id: Required[str] + """Required.""" + item_id: Required[str] + """Required.""" + output_index: Required[int] + """Required.""" + content_index: Required[int] + """Required.""" + audio_offset_ms: Required[int] + """Required.""" + audio_duration_ms: Required[int] + """Required.""" + text: Required[str] + """Required.""" + timestamp_type: Required[Literal["word"]] + """Required. Default value is \"word\".""" + + +class VoiceAgentServerEventResponseAudioTimestampDone(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.audio_timestamp.done`` server event. + + :ivar type: Required. Default value is "response.audio_timestamp.done". + :vartype type: Literal["response.audio_timestamp.done"] + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int + """ + + type: Required[Literal["response.audio_timestamp.done"]] + """Required. Default value is \"response.audio_timestamp.done\".""" + event_id: Required[str] + """Required.""" + response_id: Required[str] + """Required.""" + item_id: Required[str] + """Required.""" + output_index: Required[int] + """Required.""" + content_index: Required[int] + """Required.""" + + +class VoiceAgentServerEventResponseAudioTranscriptDelta(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.output_audio_transcript.delta`` server event. + + :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: Literal[RealtimeServerEventType.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 + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA]] + """The event type, must be ``response.output_audio_transcript.delta``. Required. + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA.""" + response_id: Required[str] + """The ID of the response. Required.""" + item_id: Required[str] + """The ID of the item. Required.""" + output_index: Required[int] + """The index of the output item in the response. Required.""" + content_index: Required[int] + """The index of the content part in the item's content array. Required.""" + delta: Required[str] + """The transcript delta. Required.""" + + +class VoiceAgentServerEventResponseAudioTranscriptDone(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.output_audio_transcript.done`` server event. + + :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: Literal[RealtimeServerEventType.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 + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE]] + """The event type, must be ``response.output_audio_transcript.done``. Required. + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE.""" + response_id: Required[str] + """The ID of the response. Required.""" + item_id: Required[str] + """The ID of the item. Required.""" + output_index: Required[int] + """The index of the output item in the response. Required.""" + content_index: Required[int] + """The index of the content part in the item's content array. Required.""" + transcript: Required[str] + """The final transcript of the audio. Required.""" + + +class VoiceAgentServerEventResponseContentPartDone(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.content_part.done`` server event. + + :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: Literal[RealtimeServerEventType.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 finished streaming. Required. Is either a + VoiceAgentResponseEventTextContentPart type or a VoiceAgentResponseEventAudioContentPart type. + :vartype part: "_unions.VoiceAgentResponseEventContentPart" + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE]] + """The event type, must be ``response.content_part.done``. Required. RESPONSE_CONTENT_PART_DONE.""" + response_id: Required[str] + """The ID of the response. Required.""" + item_id: Required[str] + """The ID of the item. Required.""" + output_index: Required[int] + """The index of the output item in the response. Required.""" + content_index: Required[int] + """The index of the content part in the item's content array. Required.""" + part: Required["_unions.VoiceAgentResponseEventContentPart"] + """The content part that finished streaming. Required. Is either a + VoiceAgentResponseEventTextContentPart type or a VoiceAgentResponseEventAudioContentPart type.""" + + +class VoiceAgentServerEventResponseCreated(TypedDict, total=False): + """The ``response.created`` server event. + + :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: Literal[RealtimeServerEventType.RESPONSE_CREATED] + :ivar response: The created voice-agent response. Required. + :vartype response: "VoiceAgentRealtimeResponse" + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_CREATED]] + """The event type, must be ``response.created``. Required. RESPONSE_CREATED.""" + response: Required["VoiceAgentRealtimeResponse"] + """The created voice-agent response. Required.""" + + +class VoiceAgentServerEventResponseDone(TypedDict, total=False): + """The ``response.done`` server event. + + :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: Literal[RealtimeServerEventType.RESPONSE_DONE] + :ivar response: The completed voice-agent response. Required. + :vartype response: "VoiceAgentRealtimeResponse" + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_DONE]] + """The event type, must be ``response.done``. Required. RESPONSE_DONE.""" + response: Required["VoiceAgentRealtimeResponse"] + """The completed voice-agent response. Required.""" + + +class VoiceAgentServerEventResponseFunctionCallArgumentsDelta(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.function_call_arguments.delta`` server event. + + :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: Literal[RealtimeServerEventType.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 + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA]] + """The event type, must be ``response.function_call_arguments.delta``. Required. + RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA.""" + response_id: Required[str] + """The ID of the response. Required.""" + item_id: Required[str] + """The ID of the function call item. Required.""" + output_index: Required[int] + """The index of the output item in the response. Required.""" + call_id: Required[str] + """The ID of the function call. Required.""" + delta: Required[str] + """The arguments delta as a JSON string. Required.""" + + +class VoiceAgentServerEventResponseFunctionCallArgumentsDone(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.function_call_arguments.done`` server event. + + :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: Literal[RealtimeServerEventType.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 + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE]] + """The event type, must be ``response.function_call_arguments.done``. Required. + RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE.""" + response_id: Required[str] + """The ID of the response. Required.""" + item_id: Required[str] + """The ID of the function call item. Required.""" + output_index: Required[int] + """The index of the output item in the response. Required.""" + call_id: Required[str] + """The ID of the function call. Required.""" + name: Required[str] + """The name of the function that was called. Required.""" + arguments: Required[str] + """The final arguments as a JSON string. Required.""" + + +class VoiceAgentServerEventResponseMcpCallArgumentsDelta(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.mcp_call_arguments.delta`` server event. + + :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: Literal[RealtimeServerEventType.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: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA]] + """The event type, must be ``response.mcp_call_arguments.delta``. Required. + RESPONSE_MCP_CALL_ARGUMENTS_DELTA.""" + response_id: Required[str] + """The ID of the response. Required.""" + item_id: Required[str] + """The ID of the MCP tool call item. Required.""" + output_index: Required[int] + """The index of the output item in the response. Required.""" + delta: Required[str] + """The JSON-encoded arguments delta. Required.""" + obfuscation: Optional[str] + + +class VoiceAgentServerEventResponseMcpCallArgumentsDone(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.mcp_call_arguments.done`` server event. + + :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: Literal[RealtimeServerEventType.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 + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE]] + """The event type, must be ``response.mcp_call_arguments.done``. Required. + RESPONSE_MCP_CALL_ARGUMENTS_DONE.""" + response_id: Required[str] + """The ID of the response. Required.""" + item_id: Required[str] + """The ID of the MCP tool call item. Required.""" + output_index: Required[int] + """The index of the output item in the response. Required.""" + arguments: Required[str] + """The final JSON-encoded arguments string. Required.""" + + +class VoiceAgentServerEventResponseMcpCallCompleted(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.mcp_call.completed`` server event. + + :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: Literal[RealtimeServerEventType.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 + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED]] + """The event type, must be ``response.mcp_call.completed``. Required. RESPONSE_MCP_CALL_COMPLETED.""" + output_index: Required[int] + """The index of the output item in the response. Required.""" + item_id: Required[str] + """The ID of the MCP tool call item. Required.""" + + +class VoiceAgentServerEventResponseMcpCallFailed(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.mcp_call.failed`` server event. + + :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: Literal[RealtimeServerEventType.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 + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED]] + """The event type, must be ``response.mcp_call.failed``. Required. RESPONSE_MCP_CALL_FAILED.""" + output_index: Required[int] + """The index of the output item in the response. Required.""" + item_id: Required[str] + """The ID of the MCP tool call item. Required.""" + + +class VoiceAgentServerEventResponseMcpCallInProgress(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.mcp_call.in_progress`` server event. + + :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: Literal[RealtimeServerEventType.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 + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS]] + """The event type, must be ``response.mcp_call.in_progress``. Required. + RESPONSE_MCP_CALL_IN_PROGRESS.""" + output_index: Required[int] + """The index of the output item in the response. Required.""" + item_id: Required[str] + """The ID of the MCP tool call item. Required.""" + + +class VoiceAgentServerEventResponseOutputItemAdded(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.output_item.added`` server event. + + :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: Literal[RealtimeServerEventType.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: The output item that was added. Required. Is one of the following types: + "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, + VoiceAgentFileSearchCallItem + :vartype item: "_unions.VoiceAgentResponseItem" + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED]] + """The event type, must be ``response.output_item.added``. Required. RESPONSE_OUTPUT_ITEM_ADDED.""" + response_id: Required[str] + """The ID of the Response to which the item belongs. Required.""" + output_index: Required[int] + """The index of the output item in the Response. Required.""" + item: Required["_unions.VoiceAgentResponseItem"] + """The output item that was added. Required. Is one of the following types: + \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, + VoiceAgentFileSearchCallItem""" + + +class VoiceAgentServerEventResponseOutputItemDone(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.output_item.done`` server event. + + :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: Literal[RealtimeServerEventType.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: The output item that finished streaming. Required. Is one of the following types: + "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, + VoiceAgentFileSearchCallItem + :vartype item: "_unions.VoiceAgentResponseItem" + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE]] + """The event type, must be ``response.output_item.done``. Required. RESPONSE_OUTPUT_ITEM_DONE.""" + response_id: Required[str] + """The ID of the Response to which the item belongs. Required.""" + output_index: Required[int] + """The index of the output item in the Response. Required.""" + item: Required["_unions.VoiceAgentResponseItem"] + """The output item that finished streaming. Required. Is one of the following types: + \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, + VoiceAgentFileSearchCallItem""" + + +class VoiceAgentServerEventResponseTextDelta(TypedDict, total=False): + """The ``response.output_text.delta`` server event. + + :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: Literal[RealtimeServerEventType.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 + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA]] + """The event type, must be ``response.output_text.delta``. Required. RESPONSE_OUTPUT_TEXT_DELTA.""" + response_id: Required[str] + """The ID of the response. Required.""" + item_id: Required[str] + """The ID of the item. Required.""" + output_index: Required[int] + """The index of the output item in the response. Required.""" + content_index: Required[int] + """The index of the content part in the item's content array. Required.""" + delta: Required[str] + """The text delta. Required.""" + + +class VoiceAgentServerEventResponseTextDone(TypedDict, total=False): + """The ``response.output_text.done`` server event. + + :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: Literal[RealtimeServerEventType.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 + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE]] + """The event type, must be ``response.output_text.done``. Required. RESPONSE_OUTPUT_TEXT_DONE.""" + response_id: Required[str] + """The ID of the response. Required.""" + item_id: Required[str] + """The ID of the item. Required.""" + output_index: Required[int] + """The index of the output item in the response. Required.""" + content_index: Required[int] + """The index of the content part in the item's content array. Required.""" + text: Required[str] + """The final text content. Required.""" + + +class VoiceAgentServerEventResponseVideoDelta(TypedDict, total=False): + """The ``response.video.delta`` server event. + + :ivar type: Required. Default value is "response.video.delta". + :vartype type: Literal["response.video.delta"] + :ivar event_id: Required. + :vartype event_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar codec: Required. + :vartype codec: str + :ivar delta: The base64-encoded video frame data. Required. + :vartype delta: str + """ + + type: Required[Literal["response.video.delta"]] + """Required. Default value is \"response.video.delta\".""" + event_id: Required[str] + """Required.""" + output_index: Required[int] + """Required.""" + codec: Required[str] + """Required.""" + delta: Required[str] + """The base64-encoded video frame data. Required.""" + + +class VoiceAgentServerEventSessionAvatarConnecting(TypedDict, total=False): # pylint: disable=name-too-long + """The ``session.avatar.connecting`` server event. + + :ivar type: Required. Default value is "session.avatar.connecting". + :vartype type: Literal["session.avatar.connecting"] + :ivar event_id: Required. + :vartype event_id: str + :ivar server_sdp: The server's SDP answer for avatar media negotiation. Required. + :vartype server_sdp: str + """ + + type: Required[Literal["session.avatar.connecting"]] + """Required. Default value is \"session.avatar.connecting\".""" + event_id: Required[str] + """Required.""" + server_sdp: Required[str] + """The server's SDP answer for avatar media negotiation. Required.""" + + +class VoiceAgentServerEventSessionAvatarSwitchToIdle(TypedDict, total=False): # pylint: disable=name-too-long + """The ``session.avatar.switch_to_idle`` server event. + + :ivar type: Required. Default value is "session.avatar.switch_to_idle". + :vartype type: Literal["session.avatar.switch_to_idle"] + :ivar event_id: Required. + :vartype event_id: str + :ivar turn_id: + :vartype turn_id: str + """ + + type: Required[Literal["session.avatar.switch_to_idle"]] + """Required. Default value is \"session.avatar.switch_to_idle\".""" + event_id: Required[str] + """Required.""" + turn_id: str + + +class VoiceAgentServerEventSessionAvatarSwitchToSpeaking(TypedDict, total=False): # pylint: disable=name-too-long + """The ``session.avatar.switch_to_speaking`` server event. + + :ivar type: Required. Default value is "session.avatar.switch_to_speaking". + :vartype type: Literal["session.avatar.switch_to_speaking"] + :ivar event_id: Required. + :vartype event_id: str + :ivar turn_id: + :vartype turn_id: str + """ + + type: Required[Literal["session.avatar.switch_to_speaking"]] + """Required. Default value is \"session.avatar.switch_to_speaking\".""" + event_id: Required[str] + """Required.""" + turn_id: str + + +class VoiceAgentServerEventSessionCreated(TypedDict, total=False): + """The ``session.created`` server event. + + :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: Literal[RealtimeServerEventType.SESSION_CREATED] + :ivar session: The initial effective voice-agent session configuration. Required. + :vartype session: "VoiceAgentSessionResponseConfig" + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.SESSION_CREATED]] + """The event type, must be ``session.created``. Required. SESSION_CREATED.""" + session: Required["VoiceAgentSessionResponseConfig"] + """The initial effective voice-agent session configuration. Required.""" + + +class VoiceAgentServerEventSessionHandoffAborted(TypedDict, total=False): # pylint: disable=name-too-long + """The ``session.handoff.aborted`` server event. + + :ivar type: Required. Default value is "session.handoff.aborted". + :vartype type: Literal["session.handoff.aborted"] + :ivar event_id: Required. + :vartype event_id: str + :ivar handoff_id: Required. + :vartype handoff_id: str + :ivar edge_id: Required. + :vartype edge_id: str + :ivar from_node_id: Required. + :vartype from_node_id: str + :ivar to_node_id: Required. + :vartype to_node_id: str + :ivar from_model: Required. + :vartype from_model: str + :ivar to_model: Required. + :vartype to_model: str + :ivar tool_call_id: Required. + :vartype tool_call_id: str + :ivar node_generation: Required. + :vartype node_generation: int + :ivar reason: The reason the handoff was aborted. Required. Known values are: + "user_interruption" and "error". + :vartype reason: Union[str, "VoiceAgentHandoffAbortReason"] + :ivar error: The error that aborted the handoff, when ``reason`` is ``error``. + :vartype error: "VoiceAgentServerEventErrorDetails" + """ + + type: Required[Literal["session.handoff.aborted"]] + """Required. Default value is \"session.handoff.aborted\".""" + event_id: Required[str] + """Required.""" + handoff_id: Required[str] + """Required.""" + edge_id: Required[str] + """Required.""" + from_node_id: Required[str] + """Required.""" + to_node_id: Required[str] + """Required.""" + from_model: Required[str] + """Required.""" + to_model: Required[str] + """Required.""" + tool_call_id: Required[str] + """Required.""" + node_generation: Required[int] + """Required.""" + reason: Required[Union[str, "VoiceAgentHandoffAbortReason"]] + """The reason the handoff was aborted. Required. Known values are: \"user_interruption\" and + \"error\".""" + error: "VoiceAgentServerEventErrorDetails" + """The error that aborted the handoff, when ``reason`` is ``error``.""" + + +class VoiceAgentServerEventSessionHandoffCompleted(TypedDict, total=False): # pylint: disable=name-too-long + """The ``session.handoff.completed`` server event. + + :ivar type: Required. Default value is "session.handoff.completed". + :vartype type: Literal["session.handoff.completed"] + :ivar event_id: Required. + :vartype event_id: str + :ivar handoff_id: Required. + :vartype handoff_id: str + :ivar edge_id: Required. + :vartype edge_id: str + :ivar from_node_id: Required. + :vartype from_node_id: str + :ivar to_node_id: Required. + :vartype to_node_id: str + :ivar from_model: Required. + :vartype from_model: str + :ivar to_model: Required. + :vartype to_model: str + :ivar tool_call_id: Required. + :vartype tool_call_id: str + :ivar node_generation: Required. + :vartype node_generation: int + :ivar prepare_duration_ms: The time spent preparing the target behavior, in milliseconds. + Required. + :vartype prepare_duration_ms: int + :ivar duration_ms: The total duration of the handoff, in milliseconds. Required. + :vartype duration_ms: int + """ + + type: Required[Literal["session.handoff.completed"]] + """Required. Default value is \"session.handoff.completed\".""" + event_id: Required[str] + """Required.""" + handoff_id: Required[str] + """Required.""" + edge_id: Required[str] + """Required.""" + from_node_id: Required[str] + """Required.""" + to_node_id: Required[str] + """Required.""" + from_model: Required[str] + """Required.""" + to_model: Required[str] + """Required.""" + tool_call_id: Required[str] + """Required.""" + node_generation: Required[int] + """Required.""" + prepare_duration_ms: Required[int] + """The time spent preparing the target behavior, in milliseconds. Required.""" + duration_ms: Required[int] + """The total duration of the handoff, in milliseconds. Required.""" + + +class VoiceAgentServerEventSessionHandoffStarted(TypedDict, total=False): # pylint: disable=name-too-long + """The ``session.handoff.started`` server event. + + :ivar type: Required. Default value is "session.handoff.started". + :vartype type: Literal["session.handoff.started"] + :ivar event_id: Required. + :vartype event_id: str + :ivar handoff_id: Required. + :vartype handoff_id: str + :ivar edge_id: Required. + :vartype edge_id: str + :ivar from_node_id: Required. + :vartype from_node_id: str + :ivar to_node_id: Required. + :vartype to_node_id: str + :ivar from_model: Required. + :vartype from_model: str + :ivar to_model: Required. + :vartype to_model: str + :ivar tool_call_id: Required. + :vartype tool_call_id: str + :ivar node_generation: Required. + :vartype node_generation: int + """ + + type: Required[Literal["session.handoff.started"]] + """Required. Default value is \"session.handoff.started\".""" + event_id: Required[str] + """Required.""" + handoff_id: Required[str] + """Required.""" + edge_id: Required[str] + """Required.""" + from_node_id: Required[str] + """Required.""" + to_node_id: Required[str] + """Required.""" + from_model: Required[str] + """Required.""" + to_model: Required[str] + """Required.""" + tool_call_id: Required[str] + """Required.""" + node_generation: Required[int] + """Required.""" + + +class VoiceAgentServerEventSessionUpdated(TypedDict, total=False): + """The ``session.updated`` server event. + + :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: Literal[RealtimeServerEventType.SESSION_UPDATED] + :ivar session: The effective voice-agent session configuration after the update. Required. + :vartype session: "VoiceAgentSessionResponseConfig" + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.SESSION_UPDATED]] + """The event type, must be ``session.updated``. Required. SESSION_UPDATED.""" + session: Required["VoiceAgentSessionResponseConfig"] + """The effective voice-agent session configuration after the update. Required.""" + + +class VoiceAgentServerEventWarning(TypedDict, total=False): + """The ``warning`` server event. + + :ivar type: Required. Default value is "warning". + :vartype type: Literal["warning"] + :ivar event_id: Required. + :vartype event_id: str + :ivar warning: Required. + :vartype warning: "VoiceAgentServerEventWarningDetails" + """ + + type: Required[Literal["warning"]] + """Required. Default value is \"warning\".""" + event_id: Required[str] + """Required.""" + warning: Required["VoiceAgentServerEventWarningDetails"] + """Required.""" + + +class VoiceAgentServerEventWarningDetails(TypedDict, total=False): + """Details of a non-fatal warning. + + :ivar message: Required. + :vartype message: str + :ivar code: + :vartype code: str + :ivar param: + :vartype param: str + """ + + message: Required[str] + """Required.""" + code: str + param: str + + +class VoiceAgentServerEventWebSearchCallCompleted(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.web_search_call.completed`` server event. + + :ivar type: Required. Default value is "response.web_search_call.completed". + :vartype type: Literal["response.web_search_call.completed"] + :ivar event_id: + :vartype event_id: str + :ivar response_id: + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar sequence_number: Required. + :vartype sequence_number: int + """ + + type: Required[Literal["response.web_search_call.completed"]] + """Required. Default value is \"response.web_search_call.completed\".""" + event_id: str + response_id: str + item_id: Required[str] + """Required.""" + output_index: Required[int] + """Required.""" + sequence_number: Required[int] + """Required.""" + + +class VoiceAgentServerEventWebSearchCallInProgress(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.web_search_call.in_progress`` server event. + + :ivar type: Required. Default value is "response.web_search_call.in_progress". + :vartype type: Literal["response.web_search_call.in_progress"] + :ivar event_id: + :vartype event_id: str + :ivar response_id: + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar sequence_number: Required. + :vartype sequence_number: int + """ + + type: Required[Literal["response.web_search_call.in_progress"]] + """Required. Default value is \"response.web_search_call.in_progress\".""" + event_id: str + response_id: str + item_id: Required[str] + """Required.""" + output_index: Required[int] + """Required.""" + sequence_number: Required[int] + """Required.""" + + +class VoiceAgentServerEventWebSearchCallSearching(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.web_search_call.searching`` server event. + + :ivar type: Required. Default value is "response.web_search_call.searching". + :vartype type: Literal["response.web_search_call.searching"] + :ivar event_id: + :vartype event_id: str + :ivar response_id: + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar sequence_number: Required. + :vartype sequence_number: int + """ + + type: Required[Literal["response.web_search_call.searching"]] + """Required. Default value is \"response.web_search_call.searching\".""" + event_id: str + response_id: str + item_id: Required[str] + """Required.""" + output_index: Required[int] + """Required.""" + sequence_number: Required[int] + """Required.""" + + +class VoiceAgentServerVadTurnDetection(TypedDict, total=False): + """Server VAD turn-detection settings. + + :ivar create_response: + :vartype create_response: bool + :ivar interrupt_response: + :vartype interrupt_response: bool + :ivar idle_timeout_ms: + :vartype idle_timeout_ms: int + :ivar type: Required. Server-side voice activity detection. + :vartype type: Literal[VoiceTurnDetectionType.SERVER_VAD] + :ivar threshold: + :vartype threshold: float + :ivar prefix_padding_ms: + :vartype prefix_padding_ms: int + :ivar silence_duration_ms: + :vartype silence_duration_ms: int + :ivar speech_duration_ms: + :vartype speech_duration_ms: int + :ivar end_of_utterance_detection: + :vartype end_of_utterance_detection: "VoiceAgentEndOfUtteranceDetection" + :ivar auto_truncate: + :vartype auto_truncate: bool + """ + + create_response: bool + interrupt_response: bool + idle_timeout_ms: Optional[int] + type: Required[Literal[VoiceTurnDetectionType.SERVER_VAD]] + """Required. Server-side voice activity detection.""" + threshold: Optional[float] + prefix_padding_ms: Optional[int] + silence_duration_ms: Optional[int] + speech_duration_ms: Optional[int] + end_of_utterance_detection: Optional["VoiceAgentEndOfUtteranceDetection"] + auto_truncate: bool + + +class VoiceAgentSessionAvatarConfig(TypedDict, total=False): + """Avatar settings accepted by the stable voice-agent WebSocket contract. + + :ivar type: Known values are: "video_avatar" and "photo_avatar". + :vartype type: Union[str, "VoiceAgentAvatarType"] + :ivar ice_servers: + :vartype ice_servers: list["VoiceAgentAvatarIceServer"] + :ivar character: Required. + :vartype character: str + :ivar style: + :vartype style: str + :ivar customized: + :vartype customized: bool + :ivar model: + :vartype model: str + :ivar video: + :vartype video: "VoiceAgentAvatarVideoParams" + :ivar scene: + :vartype scene: "VoiceAgentAvatarScene" + :ivar output_protocol: Known values are: "websocket", "websocket-binary", and "webrtc". + :vartype output_protocol: Union[str, "VoiceAgentAvatarOutputProtocol"] + :ivar output_audit_audio: + :vartype output_audit_audio: bool + """ + + type: Union[str, "VoiceAgentAvatarType"] + """Known values are: \"video_avatar\" and \"photo_avatar\".""" + ice_servers: Optional[list["VoiceAgentAvatarIceServer"]] + character: Required[str] + """Required.""" + style: Optional[str] + customized: bool + model: Optional[str] + video: Optional["VoiceAgentAvatarVideoParams"] + scene: Optional["VoiceAgentAvatarScene"] + output_protocol: Union[str, "VoiceAgentAvatarOutputProtocol"] + """Known values are: \"websocket\", \"websocket-binary\", and \"webrtc\".""" + output_audit_audio: bool + + +class VoiceAgentSessionMcpTool(TypedDict, total=False): + """A remote MCP server available to a voice-agent session. + + :ivar type: Required. Default value is "mcp". + :vartype type: Literal["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: Required. + :vartype server_url: str + :ivar authorization: Is either a str type or a VoiceAgentMcpAssignedManagedIdentity type. + :vartype authorization: Union[str, "VoiceAgentMcpAssignedManagedIdentity"] + :ivar headers: + :vartype headers: dict[str, str] + :ivar allowed_tools: + :vartype allowed_tools: list[str] + :ivar require_approval: Is either a Union[str, "_models.VoiceAgentMcpApprovalMode"] type or a + {str: [str]} type. + :vartype require_approval: "_unions.VoiceAgentMcpApprovalPolicy" + :ivar response_scheduling: Known values are: "silent", "when_idle", "interrupt", and + "skip_if_busy". + :vartype response_scheduling: Union[str, "VoiceAgentMcpResponseScheduling"] + """ + + type: Required[Literal["mcp"]] + """Required. Default value is \"mcp\".""" + server_label: Required[str] + """A label for this MCP server, used to identify it in tool calls. Required.""" + server_url: Required[str] + """Required.""" + authorization: Optional[Union[str, "VoiceAgentMcpAssignedManagedIdentity"]] + """Is either a str type or a VoiceAgentMcpAssignedManagedIdentity type.""" + headers: dict[str, str] + allowed_tools: list[str] + require_approval: "_unions.VoiceAgentMcpApprovalPolicy" + """Is either a Union[str, \"_models.VoiceAgentMcpApprovalMode\"] type or a {str: [str]} type.""" + response_scheduling: Union[str, "VoiceAgentMcpResponseScheduling"] + """Known values are: \"silent\", \"when_idle\", \"interrupt\", and \"skip_if_busy\".""" + + +class VoiceAgentSessionResponseAudio(TypedDict, total=False): + """Input- and output-audio settings returned in a stable voice-agent session event. + + :ivar input: The effective input-audio settings. + :vartype input: "VoiceAgentSessionResponseAudioInput" + :ivar output: The output-audio settings for the session. + :vartype output: "VoiceAgentSessionResponseAudioOutput" + """ + + input: Optional["VoiceAgentSessionResponseAudioInput"] + """The effective input-audio settings.""" + output: Optional["VoiceAgentSessionResponseAudioOutput"] + """The output-audio settings for the session.""" + + +class VoiceAgentSessionResponseAudioInput(TypedDict, total=False): + """Input-audio settings returned in a stable voice-agent session event. + + :ivar noise_reduction: Input noise reduction. Set to null to disable. + :vartype noise_reduction: "VoiceNoiseReduction" + :ivar transcription: Asynchronous input-audio transcription. Set to null to disable + transcription. + :vartype transcription: "VoiceInputTranscription" + :ivar format: The structured input audio format. + :vartype format: "VoiceAudioFormat" + :ivar turn_detection: Turn-detection settings. Set to null to disable server-side turn + detection. Is one of the following types: VoiceAgentServerVadTurnDetection, + VoiceAgentSemanticVadTurnDetection, VoiceAgentAzureSemanticVadTurnDetection, + VoiceAgentAzureMultilingualSemanticVadTurnDetection + :vartype turn_detection: "_unions.VoiceAgentTurnDetection" + :ivar echo_cancellation: Optional server-side echo cancellation settings. + :vartype echo_cancellation: "VoiceAgentEchoCancellation" + """ + + noise_reduction: Optional["VoiceNoiseReduction"] + """Input noise reduction. Set to null to disable.""" + transcription: Optional["VoiceInputTranscription"] + """Asynchronous input-audio transcription. Set to null to disable transcription.""" + format: Optional["VoiceAudioFormat"] + """The structured input audio format.""" + turn_detection: Optional["_unions.VoiceAgentTurnDetection"] + """Turn-detection settings. Set to null to disable server-side turn detection. Is one of the + following types: VoiceAgentServerVadTurnDetection, VoiceAgentSemanticVadTurnDetection, + VoiceAgentAzureSemanticVadTurnDetection, VoiceAgentAzureMultilingualSemanticVadTurnDetection""" + echo_cancellation: Optional["VoiceAgentEchoCancellation"] + """Optional server-side echo cancellation settings.""" + + +class VoiceAgentSessionResponseAudioOutput(TypedDict, total=False): + """Output-audio settings returned in a stable voice-agent session event. + + :ivar format: The output audio format. + :vartype format: "VoiceAudioFormat" + :ivar voice: The typed voice configuration. Is one of the following types: OpenAIVoice, + AzureVoice, AzureRealtimeNativeVoice + :vartype voice: "_unions.VoiceAgentVoice" + :ivar output_audio_timestamp_types: Timestamp kinds to include with output audio. + :vartype output_audio_timestamp_types: list[Union[str, "VoiceAudioTimestampType"]] + :ivar speed: The speaking-speed multiplier. + :vartype speed: float + """ + + format: "VoiceAudioFormat" + """The output audio format.""" + voice: "_unions.VoiceAgentVoice" + """The typed voice configuration. Is one of the following types: OpenAIVoice, AzureVoice, + AzureRealtimeNativeVoice""" + output_audio_timestamp_types: list[Union[str, "VoiceAudioTimestampType"]] + """Timestamp kinds to include with output audio.""" + speed: Optional[float] + """The speaking-speed multiplier.""" + + +class VoiceAgentSessionResponseConfig(TypedDict, total=False): + """The effective stable realtime session settings returned by the voice-agent service. + + :ivar type: The session type. Always ``realtime``. Required. Default value is "realtime". + :vartype type: Literal["realtime"] + :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: "_unions.VoiceAgentMaxOutputTokens" + :ivar avatar: The avatar settings for the session. + :vartype avatar: "VoiceAgentSessionAvatarConfig" + :ivar animation: Animation settings for the session. + :vartype animation: "VoiceAgentAnimationConfig" + :ivar tools: Tools available to the session. + :vartype tools: list["_unions.VoiceAgentSessionTool"] + :ivar tool_choice: Tool-selection behavior for the session. Is either a Union[str, + "_models.ToolChoiceOptions"] type or a RealtimeToolChoiceFunction type. + :vartype tool_choice: "_unions.VoiceAgentToolChoice" + :ivar reasoning: Reasoning settings for compatible realtime models. + :vartype reasoning: "RealtimeReasoning" + :ivar parallel_tool_calls: Whether the model may call multiple tools in parallel. + :vartype parallel_tool_calls: bool + :ivar voice_adaptation: Voice-optimized instruction adaptation settings. + :vartype voice_adaptation: "VoiceAgentVoiceAdaptation" + :ivar interim_response: Interim-response settings for latency and tool execution. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. + :vartype interim_response: "_unions.VoiceAgentInterimResponse" + :ivar response_delimiter: A delimiter appended to generated responses. + :vartype response_delimiter: str + :ivar greeting: A proactive assistant greeting started after session configuration. + :vartype greeting: "VoiceGreetingConfig" + :ivar object: The object type. Always ``realtime.session``. Required. Default value is + "realtime.session". + :vartype object: Literal["realtime.session"] + :ivar id: The session identifier. Required. + :vartype id: str + :ivar model: The selected model. Required. + :vartype model: str + :ivar expires_at: The session expiration time as a Unix timestamp in seconds. + :vartype expires_at: int + :ivar output_modalities: The output modalities enabled for the session. Required. + :vartype output_modalities: list[Union[str, "VoiceOutputModality"]] + :ivar audio: The effective input- and output-audio settings for the session. + :vartype audio: "VoiceAgentSessionResponseAudio" + :ivar handoff: The effective handoff state. + :vartype handoff: "VoiceAgentHandoffState" + :ivar idle_timeout: The idle timeout reported by the service, in milliseconds. + :vartype idle_timeout: int + """ + + type: Required[Literal["realtime"]] + """The session type. Always ``realtime``. Required. Default value is \"realtime\".""" + instructions: Optional[str] + """Instructions applied throughout the session.""" + temperature: Optional[float] + """The sampling temperature for compatible cascaded pipelines.""" + max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] + """The maximum output-token count for one response. Is either a int type or a Literal[\"inf\"] + type.""" + avatar: Optional["VoiceAgentSessionAvatarConfig"] + """The avatar settings for the session.""" + animation: Optional["VoiceAgentAnimationConfig"] + """Animation settings for the session.""" + tools: Optional[list["_unions.VoiceAgentSessionTool"]] + """Tools available to the session.""" + tool_choice: Optional["_unions.VoiceAgentToolChoice"] + """Tool-selection behavior for the session. Is either a Union[str, \"_models.ToolChoiceOptions\"] + type or a RealtimeToolChoiceFunction type.""" + reasoning: Optional["RealtimeReasoning"] + """Reasoning settings for compatible realtime models.""" + parallel_tool_calls: bool + """Whether the model may call multiple tools in parallel.""" + voice_adaptation: Optional["VoiceAgentVoiceAdaptation"] + """Voice-optimized instruction adaptation settings.""" + interim_response: Optional["_unions.VoiceAgentInterimResponse"] + """Interim-response settings for latency and tool execution. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type.""" + response_delimiter: str + """A delimiter appended to generated responses.""" + greeting: Optional["VoiceGreetingConfig"] + """A proactive assistant greeting started after session configuration.""" + object: Required[Literal["realtime.session"]] + """The object type. Always ``realtime.session``. Required. Default value is \"realtime.session\".""" + id: Required[str] + """The session identifier. Required.""" + model: Required[str] + """The selected model. Required.""" + expires_at: Optional[int] + """The session expiration time as a Unix timestamp in seconds.""" + output_modalities: Required[list[Union[str, "VoiceOutputModality"]]] + """The output modalities enabled for the session. Required.""" + audio: Optional["VoiceAgentSessionResponseAudio"] + """The effective input- and output-audio settings for the session.""" + handoff: Optional["VoiceAgentHandoffState"] + """The effective handoff state.""" + idle_timeout: Optional[int] + """The idle timeout reported by the service, in milliseconds.""" + + +class VoiceAgentSessionUpdateAudio(TypedDict, total=False): + """Input- and output-audio settings accepted in a ``session.update`` client event. + + :ivar input: The input-audio settings for the session. + :vartype input: "VoiceAgentSessionUpdateAudioInput" + :ivar output: The output-audio settings for the session. + :vartype output: "VoiceAgentSessionUpdateAudioOutput" + """ + + input: Optional["VoiceAgentSessionUpdateAudioInput"] + """The input-audio settings for the session.""" + output: Optional["VoiceAgentSessionUpdateAudioOutput"] + """The output-audio settings for the session.""" + + +class VoiceAgentSessionUpdateAudioInput(TypedDict, total=False): + """Input-audio settings accepted in a stable voice-agent session. + + :ivar noise_reduction: Input noise reduction. Set to null to disable. + :vartype noise_reduction: "VoiceNoiseReduction" + :ivar transcription: Asynchronous input-audio transcription. Set to null to disable + transcription. + :vartype transcription: "VoiceInputTranscription" + :ivar format: The structured input audio format. + :vartype format: "VoiceAudioFormat" + :ivar turn_detection: Turn-detection settings. Set to null to disable server-side turn + detection. Is one of the following types: VoiceAgentServerVadTurnDetection, + VoiceAgentSemanticVadTurnDetection, VoiceAgentAzureSemanticVadTurnDetection, + VoiceAgentAzureMultilingualSemanticVadTurnDetection + :vartype turn_detection: "_unions.VoiceAgentTurnDetection" + :ivar echo_cancellation: Optional server-side echo cancellation settings. + :vartype echo_cancellation: "VoiceAgentEchoCancellation" + """ + + noise_reduction: Optional["VoiceNoiseReduction"] + """Input noise reduction. Set to null to disable.""" + transcription: Optional["VoiceInputTranscription"] + """Asynchronous input-audio transcription. Set to null to disable transcription.""" + format: Optional["VoiceAudioFormat"] + """The structured input audio format.""" + turn_detection: Optional["_unions.VoiceAgentTurnDetection"] + """Turn-detection settings. Set to null to disable server-side turn detection. Is one of the + following types: VoiceAgentServerVadTurnDetection, VoiceAgentSemanticVadTurnDetection, + VoiceAgentAzureSemanticVadTurnDetection, VoiceAgentAzureMultilingualSemanticVadTurnDetection""" + echo_cancellation: Optional["VoiceAgentEchoCancellation"] + """Optional server-side echo cancellation settings.""" + + +class VoiceAgentSessionUpdateAudioOutput(TypedDict, total=False): + """Output-audio settings accepted in a stable voice-agent session. + + :ivar format: The output audio format. + :vartype format: "VoiceAudioFormat" + :ivar voice: The typed voice configuration. Is one of the following types: OpenAIVoice, + AzureVoice, AzureRealtimeNativeVoice + :vartype voice: "_unions.VoiceAgentVoice" + :ivar output_audio_timestamp_types: Timestamp kinds to include with output audio. + :vartype output_audio_timestamp_types: list[Union[str, "VoiceAudioTimestampType"]] + :ivar speed: The speaking-speed multiplier. + :vartype speed: float + """ + + format: "VoiceAudioFormat" + """The output audio format.""" + voice: "_unions.VoiceAgentVoice" + """The typed voice configuration. Is one of the following types: OpenAIVoice, AzureVoice, + AzureRealtimeNativeVoice""" + output_audio_timestamp_types: list[Union[str, "VoiceAudioTimestampType"]] + """Timestamp kinds to include with output audio.""" + speed: Optional[float] + """The speaking-speed multiplier.""" + + +class VoiceAgentSessionUpdateConfig(TypedDict, total=False): + """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: Literal["realtime"] + :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: "_unions.VoiceAgentMaxOutputTokens" + :ivar output_modalities: The output modalities enabled for the session. + :vartype output_modalities: list[Union[str, "VoiceOutputModality"]] + :ivar audio: The input- and output-audio settings for the session. + :vartype audio: "VoiceAgentSessionUpdateAudio" + :ivar avatar: The avatar settings for the session. + :vartype avatar: "VoiceAgentSessionAvatarConfig" + :ivar animation: Animation settings for the session. + :vartype animation: "VoiceAgentAnimationConfig" + :ivar tools: Tools available to the session. + :vartype tools: list["_unions.VoiceAgentSessionTool"] + :ivar tool_choice: Tool-selection behavior for the session. Is either a Union[str, + "_models.ToolChoiceOptions"] type or a RealtimeToolChoiceFunction type. + :vartype tool_choice: "_unions.VoiceAgentToolChoice" + :ivar reasoning: Reasoning settings for compatible realtime models. + :vartype reasoning: "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[Union[str, "VoiceAgentSessionIncludeOption"]] + :ivar metadata: Up to 16 string key-value pairs attached to the session. + :vartype metadata: dict[str, str] + :ivar voice_adaptation: Voice-optimized instruction adaptation settings. + :vartype voice_adaptation: "VoiceAgentVoiceAdaptation" + :ivar interim_response: Interim-response settings for latency and tool execution. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. + :vartype interim_response: "_unions.VoiceAgentInterimResponse" + :ivar response_delimiter: A delimiter appended to generated responses. + :vartype response_delimiter: str + :ivar greeting: A proactive assistant greeting started after session configuration. + :vartype greeting: "VoiceGreetingConfig" + :ivar handoff: The customer-supplied handoff graph. + :vartype handoff: "VoiceAgentHandoffGraphConfig" + """ + + type: Required[Literal["realtime"]] + """The session type. Always ``realtime``. Required. Default value is \"realtime\".""" + instructions: Optional[str] + """Instructions applied throughout the session.""" + temperature: Optional[float] + """The sampling temperature for compatible cascaded pipelines.""" + max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] + """The maximum output-token count for one response. Is either a int type or a Literal[\"inf\"] + type.""" + output_modalities: Optional[list[Union[str, "VoiceOutputModality"]]] + """The output modalities enabled for the session.""" + audio: Optional["VoiceAgentSessionUpdateAudio"] + """The input- and output-audio settings for the session.""" + avatar: Optional["VoiceAgentSessionAvatarConfig"] + """The avatar settings for the session.""" + animation: Optional["VoiceAgentAnimationConfig"] + """Animation settings for the session.""" + tools: Optional[list["_unions.VoiceAgentSessionTool"]] + """Tools available to the session.""" + tool_choice: Optional["_unions.VoiceAgentToolChoice"] + """Tool-selection behavior for the session. Is either a Union[str, \"_models.ToolChoiceOptions\"] + type or a RealtimeToolChoiceFunction type.""" + reasoning: Optional["RealtimeReasoning"] + """Reasoning settings for compatible realtime models.""" + parallel_tool_calls: bool + """Whether the model may call multiple tools in parallel.""" + include: Optional[list[Union[str, "VoiceAgentSessionIncludeOption"]]] + """Additional fields to include in service outputs.""" + metadata: Optional[dict[str, str]] + """Up to 16 string key-value pairs attached to the session.""" + voice_adaptation: Optional["VoiceAgentVoiceAdaptation"] + """Voice-optimized instruction adaptation settings.""" + interim_response: Optional["_unions.VoiceAgentInterimResponse"] + """Interim-response settings for latency and tool execution. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type.""" + response_delimiter: str + """A delimiter appended to generated responses.""" + greeting: Optional["VoiceGreetingConfig"] + """A proactive assistant greeting started after session configuration.""" + handoff: Optional["VoiceAgentHandoffGraphConfig"] + """The customer-supplied handoff graph.""" + + +class VoiceAgentStaticInterimResponseConfig(TypedDict, total=False): + """A static interim response selected from configured text. + + :ivar triggers: Conditions that may trigger one interim response. + :vartype triggers: list[Union[str, "VoiceAgentInterimResponseTrigger"]] + :ivar latency_threshold_ms: The latency threshold in milliseconds. + :vartype latency_threshold_ms: int + :ivar type: Required. Default value is "static_interim_response". + :vartype type: Literal["static_interim_response"] + :ivar texts: Candidate text values for the interim response. + :vartype texts: list[str] + """ + + triggers: list[Union[str, "VoiceAgentInterimResponseTrigger"]] + """Conditions that may trigger one interim response.""" + latency_threshold_ms: int + """The latency threshold in milliseconds.""" + type: Required[Literal["static_interim_response"]] + """Required. Default value is \"static_interim_response\".""" + texts: list[str] + """Candidate text values for the interim response.""" + + +class VoiceAgentTranscriptionPhrase(TypedDict, total=False): + """A transcribed phrase with timing information. + + :ivar offset_milliseconds: The phrase offset from the beginning of the audio, in milliseconds. + Required. + :vartype offset_milliseconds: int + :ivar duration_milliseconds: The phrase duration in milliseconds. Required. + :vartype duration_milliseconds: int + :ivar text: The transcribed phrase text. Required. + :vartype text: str + :ivar words: Word-level timing details, when available. + :vartype words: list["VoiceAgentTranscriptionWord"] + :ivar locale: The detected locale. + :vartype locale: str + :ivar confidence: The transcription confidence score. + :vartype confidence: float + """ + + offset_milliseconds: Required[int] + """The phrase offset from the beginning of the audio, in milliseconds. Required.""" + duration_milliseconds: Required[int] + """The phrase duration in milliseconds. Required.""" + text: Required[str] + """The transcribed phrase text. Required.""" + words: Optional[list["VoiceAgentTranscriptionWord"]] + """Word-level timing details, when available.""" + locale: Optional[str] + """The detected locale.""" + confidence: Optional[float] + """The transcription confidence score.""" + + +class VoiceAgentTranscriptionWord(TypedDict, total=False): + """A time-stamped word in an input-audio transcription. + + :ivar text: The transcribed word text. Required. + :vartype text: str + :ivar offset_milliseconds: The word offset from the beginning of the audio, in milliseconds. + Required. + :vartype offset_milliseconds: int + :ivar duration_milliseconds: The word duration in milliseconds. Required. + :vartype duration_milliseconds: int + """ + + text: Required[str] + """The transcribed word text. Required.""" + offset_milliseconds: Required[int] + """The word offset from the beginning of the audio, in milliseconds. Required.""" + duration_milliseconds: Required[int] + """The word duration in milliseconds. Required.""" + + +class VoiceAgentVoiceAdaptation(TypedDict, total=False): + """Voice-optimized instruction adaptation settings. + + :ivar type: The adaptation strategy. Always ``auto``. Required. Default value is "auto". + :vartype type: Literal["auto"] + """ + + type: Required[Literal["auto"]] + """The adaptation strategy. Always ``auto``. Required. Default value is \"auto\".""" + + +class VoiceAgentWebSearchActionFind(TypedDict, total=False): + """An action that finds text on a web page. + + :ivar type: Required. Default value is "find". + :vartype type: Literal["find"] + :ivar pattern: Required. + :vartype pattern: str + :ivar url: Required. + :vartype url: str + """ + + type: Required[Literal["find"]] + """Required. Default value is \"find\".""" + pattern: Required[str] + """Required.""" + url: Required[str] + """Required.""" + + +class VoiceAgentWebSearchActionOpenPage(TypedDict, total=False): + """An action that opens a web page. + + :ivar type: Required. Default value is "open_page". + :vartype type: Literal["open_page"] + :ivar url: Required. + :vartype url: str + """ + + type: Required[Literal["open_page"]] + """Required. Default value is \"open_page\".""" + url: Required[str] + """Required.""" + + +class VoiceAgentWebSearchActionSearch(TypedDict, total=False): + """A web search action. + + :ivar type: Required. Default value is "search". + :vartype type: Literal["search"] + :ivar query: Required. + :vartype query: str + :ivar sources: + :vartype sources: list["VoiceAgentWebSearchSource"] + """ + + type: Required[Literal["search"]] + """Required. Default value is \"search\".""" + query: Required[Optional[str]] + """Required.""" + sources: Optional[list["VoiceAgentWebSearchSource"]] + + +class VoiceAgentWebSearchCallItem(TypedDict, total=False): + """A web-search output item. + + :ivar id: Required. + :vartype id: str + :ivar type: Required. Default value is "web_search_call". + :vartype type: Literal["web_search_call"] + :ivar status: Required. Known values are: "in_progress", "searching", "completed", and + "failed". + :vartype status: Union[str, "VoiceAgentWebSearchCallStatus"] + :ivar action: Is one of the following types: VoiceAgentWebSearchActionSearch, + VoiceAgentWebSearchActionOpenPage, VoiceAgentWebSearchActionFind + :vartype action: "_unions.VoiceAgentWebSearchAction" + """ + + id: Required[str] + """Required.""" + type: Required[Literal["web_search_call"]] + """Required. Default value is \"web_search_call\".""" + status: Required[Union[str, "VoiceAgentWebSearchCallStatus"]] + """Required. Known values are: \"in_progress\", \"searching\", \"completed\", and \"failed\".""" + action: Optional["_unions.VoiceAgentWebSearchAction"] + """Is one of the following types: VoiceAgentWebSearchActionSearch, + VoiceAgentWebSearchActionOpenPage, VoiceAgentWebSearchActionFind""" + + +class VoiceAgentWebSearchSource(TypedDict, total=False): + """A web-search source URL. + + :ivar type: Required. Default value is "url". + :vartype type: Literal["url"] + :ivar url: Required. + :vartype url: str + """ + + type: Required[Literal["url"]] + """Required. Default value is \"url\".""" + url: Required[str] + """Required.""" + + +class VoiceAgentWorkflowActionItem(TypedDict, total=False): + """A workflow action output item. + + :ivar id: Required. + :vartype id: str + :ivar object: Default value is "realtime.item". + :vartype object: Literal["realtime.item"] + :ivar type: Required. Default value is "workflow_action". + :vartype type: Literal["workflow_action"] + :ivar action_id: Required. + :vartype action_id: str + :ivar status: Required. + :vartype status: str + :ivar kind: + :vartype kind: str + :ivar parent_action_id: + :vartype parent_action_id: str + :ivar previous_action_id: + :vartype previous_action_id: str + """ + + id: Required[Optional[str]] + """Required.""" + object: Literal["realtime.item"] + """Default value is \"realtime.item\".""" + type: Required[Literal["workflow_action"]] + """Required. Default value is \"workflow_action\".""" + action_id: Required[str] + """Required.""" + status: Required[str] + """Required.""" + kind: Optional[str] + parent_action_id: Optional[str] + previous_action_id: Optional[str] + + +class VoiceAssistantMessageItem(TypedDict, total=False): + """An assistant message item. Only ``output_text`` and ``output_audio`` content are valid for + assistant messages. + + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: int + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str + :ivar type: Required. A message item. + :vartype type: Literal[VoiceConversationItemType.MESSAGE] + :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: Literal["realtime.item"] + :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: Literal["completed", "incomplete", "in_progress"] + :ivar content: The content of the message. Required. + :vartype content: list["RealtimeConversationItemMessageAssistantContent"] + :ivar role: Required. ASSISTANT. + :vartype role: Literal[RealtimeConversationItemMessageType.ASSISTANT] + """ + + created_at: int + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: str + """The id of the response that produced this item, when applicable.""" + type: Required[Literal[VoiceConversationItemType.MESSAGE]] + """Required. A message item.""" + id: str + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Literal["realtime.item"] + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + status: Literal["completed", "incomplete", "in_progress"] + """The status of the item. Has no effect on the conversation. Is one of the following types: + Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" + content: Required[list["RealtimeConversationItemMessageAssistantContent"]] + """The content of the message. Required.""" + role: Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] + """Required. ASSISTANT.""" + + +class VoiceAudioConfig(TypedDict, total=False): + """The audio configuration for a voice agent. These values are session defaults and may be + overridden when connecting. + + :ivar input: Input (microphone) audio configuration. + :vartype input: "VoiceAudioInputConfig" + :ivar output: Output (agent speech) audio configuration. + :vartype output: "VoiceAudioOutputConfig" + """ + + input: "VoiceAudioInputConfig" + """Input (microphone) audio configuration.""" + output: "VoiceAudioOutputConfig" + """Output (agent speech) audio configuration.""" + + +class VoiceAudioFormat(TypedDict, total=False): + """An audio format. Follows the OpenAI Realtime session schema; ``type`` carries the media + subtype. + + :ivar type: The audio format type, e.g. 'audio/pcm' (16-bit PCM), 'audio/pcmu' (G.711 mu-law), + or 'audio/pcma' (G.711 A-law). Required. Known values are: "audio/pcm", "audio/pcmu", and + "audio/pcma". + :vartype type: Union[str, "VoiceAudioFormatType"] + :ivar rate: The sample rate in Hz. Applies to 'audio/pcm' (e.g. 24000); omit for telephony + G.711 formats (8 kHz). + :vartype rate: int + """ + + type: Required[Union[str, "VoiceAudioFormatType"]] + """The audio format type, e.g. 'audio/pcm' (16-bit PCM), 'audio/pcmu' (G.711 mu-law), or + 'audio/pcma' (G.711 A-law). Required. Known values are: \"audio/pcm\", \"audio/pcmu\", and + \"audio/pcma\".""" + rate: int + """The sample rate in Hz. Applies to 'audio/pcm' (e.g. 24000); omit for telephony G.711 formats (8 + kHz).""" + + +class VoiceAudioInputConfig(TypedDict, total=False): + """Input audio configuration for a voice agent. + + :ivar format: The input audio format. + :vartype format: "VoiceAudioFormat" + :ivar noise_reduction: Input noise reduction. Set to null to disable. + :vartype noise_reduction: "VoiceNoiseReduction" + :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: "VoiceTurnDetection" + :ivar transcription: Asynchronous input-audio transcription. Set to null to disable + transcription. + :vartype transcription: "VoiceInputTranscription" + """ + + format: "VoiceAudioFormat" + """The input audio format.""" + noise_reduction: Optional["VoiceNoiseReduction"] + """Input noise reduction. Set to null to disable.""" + turn_detection: Optional["VoiceTurnDetection"] + """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.""" + transcription: Optional["VoiceInputTranscription"] + """Asynchronous input-audio transcription. Set to null to disable transcription.""" + + +class VoiceAudioOutputConfig(TypedDict, total=False): + """Output audio configuration for a voice agent. + + :ivar format: The output audio format. + :vartype format: "VoiceAudioFormat" + :ivar voice: The typed voice configuration. Is one of the following types: OpenAIVoice, + AzureVoice, AzureRealtimeNativeVoice + :vartype voice: "_unions.VoiceAgentVoice" + :ivar speed: The OpenAI-compatible speaking speed multiplier, from 0.25 to 1.5. Defaults to 1. + For Azure synthesized voices, use ``voice.rate`` instead. + :vartype speed: float + :ivar output_audio_timestamp_types: Timestamp kinds to include with output audio. + :vartype output_audio_timestamp_types: list[Union[str, "VoiceAudioTimestampType"]] + """ + + format: "VoiceAudioFormat" + """The output audio format.""" + voice: "_unions.VoiceAgentVoice" + """The typed voice configuration. Is one of the following types: OpenAIVoice, AzureVoice, + AzureRealtimeNativeVoice""" + speed: float + """The OpenAI-compatible speaking speed multiplier, from 0.25 to 1.5. Defaults to 1. For Azure + synthesized voices, use ``voice.rate`` instead.""" + output_audio_timestamp_types: list[Union[str, "VoiceAudioTimestampType"]] + """Timestamp kinds to include with output audio.""" + + +class VoiceAvatarConfig(TypedDict, total=False): + """Avatar configuration for a voice agent. These values are session defaults and may be overridden + when connecting. + + :ivar type: The avatar type. Required. Known values are: "video_avatar" and "photo_avatar". + :vartype type: Union[str, "VoiceAvatarType"] + :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: Union[str, "VoiceAvatarOutputProtocol"] + """ + + type: Required[Union[str, "VoiceAvatarType"]] + """The avatar type. Required. Known values are: \"video_avatar\" and \"photo_avatar\".""" + character: Required[str] + """The avatar character identifier, e.g. 'lisa'. Required.""" + style: str + """The avatar style, e.g. 'casual-sitting'.""" + customized: bool + """Whether the avatar is a customer-customized avatar. Defaults to false.""" + output_protocol: Union[str, "VoiceAvatarOutputProtocol"] + """The transport used to deliver the avatar video stream. Known values are: \"webrtc\" and + \"websocket\".""" + + +class VoiceAzureSemanticDetection(TypedDict, total=False): + """Default Azure semantic end-of-utterance detection. + + :ivar model: Required. The default semantic detection model. + :vartype model: Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1] + :ivar threshold_level: The sensitivity threshold. Known values are: "low", "medium", "high", + and "default". + :vartype threshold_level: Union[str, "VoiceEndOfUtteranceThresholdLevel"] + :ivar timeout_ms: The detection timeout in milliseconds. + :vartype timeout_ms: int + """ + + model: Required[Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1]] + """Required. The default semantic detection model.""" + threshold_level: Union[str, "VoiceEndOfUtteranceThresholdLevel"] + """The sensitivity threshold. Known values are: \"low\", \"medium\", \"high\", and \"default\".""" + timeout_ms: int + """The detection timeout in milliseconds.""" + + +class VoiceAzureSemanticDetectionEn(TypedDict, total=False): + """English-optimized Azure semantic end-of-utterance detection. + + :ivar model: Required. The English-optimized semantic detection model. + :vartype model: Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1_EN] + :ivar threshold_level: The sensitivity threshold. Known values are: "low", "medium", "high", + and "default". + :vartype threshold_level: Union[str, "VoiceEndOfUtteranceThresholdLevel"] + :ivar timeout_ms: The detection timeout in milliseconds. + :vartype timeout_ms: int + """ + + model: Required[Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1_EN]] + """Required. The English-optimized semantic detection model.""" + threshold_level: Union[str, "VoiceEndOfUtteranceThresholdLevel"] + """The sensitivity threshold. Known values are: \"low\", \"medium\", \"high\", and \"default\".""" + timeout_ms: int + """The detection timeout in milliseconds.""" + + +class VoiceAzureSemanticDetectionMultilingual(TypedDict, total=False): + """Multilingual Azure semantic end-of-utterance detection. + + :ivar model: Required. The multilingual semantic detection model. + :vartype model: Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1_MULTILINGUAL] + :ivar threshold_level: The sensitivity threshold. Known values are: "low", "medium", "high", + and "default". + :vartype threshold_level: Union[str, "VoiceEndOfUtteranceThresholdLevel"] + :ivar timeout_ms: The detection timeout in milliseconds. + :vartype timeout_ms: int + """ + + model: Required[Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1_MULTILINGUAL]] + """Required. The multilingual semantic detection model.""" + threshold_level: Union[str, "VoiceEndOfUtteranceThresholdLevel"] + """The sensitivity threshold. Known values are: \"low\", \"medium\", \"high\", and \"default\".""" + timeout_ms: int + """The detection timeout in milliseconds.""" + + +class VoiceAzureSemanticVadEnTurnDetection(TypedDict, total=False): + """English-optimized Azure semantic voice activity detection. + + :ivar type: Required. English-optimized Azure semantic voice activity detection. + :vartype type: Literal[VoiceTurnDetectionType.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: int + :ivar silence_duration_ms: Silence required to end speech detection, in milliseconds. + :vartype silence_duration_ms: int + :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. + :vartype end_of_utterance_detection: "VoiceEndOfUtteranceDetection" + :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in + milliseconds. + :vartype speech_duration_ms: int + :ivar remove_filler_words: Whether filler words are removed from transcription. + :vartype remove_filler_words: bool + :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech + stops. + :vartype auto_truncate: 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: Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN]] + """Required. English-optimized Azure semantic voice activity detection.""" + threshold: float + """Activation threshold for voice activity detection, from 0 to 1.""" + prefix_padding_ms: int + """Audio to include before detected speech, in milliseconds.""" + silence_duration_ms: int + """Silence required to end speech detection, in milliseconds.""" + end_of_utterance_detection: "VoiceEndOfUtteranceDetection" + """Semantic end-of-utterance detection configuration.""" + speech_duration_ms: int + """Minimum speech duration required to trigger detection, in milliseconds.""" + remove_filler_words: bool + """Whether filler words are removed from transcription.""" + auto_truncate: bool + """Whether the input audio buffer is truncated automatically when speech stops.""" + create_response: bool + """Whether a response is created automatically when speech stops.""" + interrupt_response: bool + """Whether user speech may interrupt the agent's response.""" + + +class VoiceAzureSemanticVadMultilingualTurnDetection(TypedDict, total=False): # pylint: disable=name-too-long + """Multilingual Azure semantic voice activity detection. + + :ivar type: Required. Multilingual Azure semantic voice activity detection. + :vartype type: Literal[VoiceTurnDetectionType.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: int + :ivar silence_duration_ms: Silence required to end speech detection, in milliseconds. + :vartype silence_duration_ms: int + :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. + :vartype end_of_utterance_detection: "VoiceEndOfUtteranceDetection" + :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in + milliseconds. + :vartype speech_duration_ms: int + :ivar remove_filler_words: Whether filler words are removed from transcription. + :vartype remove_filler_words: bool + :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech + stops. + :vartype auto_truncate: 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: Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL]] + """Required. Multilingual Azure semantic voice activity detection.""" + threshold: float + """Activation threshold for voice activity detection, from 0 to 1.""" + prefix_padding_ms: int + """Audio to include before detected speech, in milliseconds.""" + silence_duration_ms: int + """Silence required to end speech detection, in milliseconds.""" + end_of_utterance_detection: "VoiceEndOfUtteranceDetection" + """Semantic end-of-utterance detection configuration.""" + speech_duration_ms: int + """Minimum speech duration required to trigger detection, in milliseconds.""" + remove_filler_words: bool + """Whether filler words are removed from transcription.""" + auto_truncate: bool + """Whether the input audio buffer is truncated automatically when speech stops.""" + create_response: bool + """Whether a response is created automatically when speech stops.""" + interrupt_response: bool + """Whether user speech may interrupt the agent's response.""" + languages: list[str] + """BCP-47 language codes used for speech detection.""" + + +class VoiceAzureSemanticVadTurnDetection(TypedDict, total=False): + """Azure semantic voice activity detection. + + :ivar type: Required. Azure semantic voice activity detection. + :vartype type: Literal[VoiceTurnDetectionType.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: int + :ivar silence_duration_ms: Silence required to end speech detection, in milliseconds. + :vartype silence_duration_ms: int + :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. + :vartype end_of_utterance_detection: "VoiceEndOfUtteranceDetection" + :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in + milliseconds. + :vartype speech_duration_ms: int + :ivar remove_filler_words: Whether filler words are removed from transcription. + :vartype remove_filler_words: bool + :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech + stops. + :vartype auto_truncate: 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: Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD]] + """Required. Azure semantic voice activity detection.""" + threshold: float + """Activation threshold for voice activity detection, from 0 to 1.""" + prefix_padding_ms: int + """Audio to include before detected speech, in milliseconds.""" + silence_duration_ms: int + """Silence required to end speech detection, in milliseconds.""" + end_of_utterance_detection: "VoiceEndOfUtteranceDetection" + """Semantic end-of-utterance detection configuration.""" + speech_duration_ms: int + """Minimum speech duration required to trigger detection, in milliseconds.""" + remove_filler_words: bool + """Whether filler words are removed from transcription.""" + auto_truncate: bool + """Whether the input audio buffer is truncated automatically when speech stops.""" + create_response: bool + """Whether a response is created automatically when speech stops.""" + interrupt_response: bool + """Whether user speech may interrupt the agent's response.""" + languages: list[str] + """BCP-47 language codes used for speech detection.""" + + +class VoiceFunctionCallItem(TypedDict, total=False): + """A function call request item. + + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: int + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_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: Literal["realtime.item"] + :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: Literal["completed", "incomplete", "in_progress"] + :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 type: Required. A function-call request item. + :vartype type: Literal[VoiceConversationItemType.FUNCTION_CALL] + """ + + created_at: int + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: str + """The id of the response that produced this item, when applicable.""" + id: str + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Literal["realtime.item"] + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + status: Literal["completed", "incomplete", "in_progress"] + """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 + """The ID of the function call.""" + name: Required[str] + """The name of the function being called. Required.""" + arguments: Required[str] + """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.""" + type: Required[Literal[VoiceConversationItemType.FUNCTION_CALL]] + """Required. A function-call request item.""" + + +class VoiceFunctionCallOutputItem(TypedDict, total=False): + """A function call output item. + + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: int + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_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: Literal["realtime.item"] + :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: Literal["completed", "incomplete", "in_progress"] + :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 type: Required. A function-call output item. + :vartype type: Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT] + :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 + """ + + created_at: int + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: str + """The id of the response that produced this item, when applicable.""" + id: str + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Literal["realtime.item"] + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + status: Literal["completed", "incomplete", "in_progress"] + """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: Required[str] + """The ID of the function call this output is for. Required.""" + output: Required[str] + """The output of the function call, this is free text and can contain any information or simply be + empty. Required.""" + type: Required[Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT]] + """Required. A function-call output item.""" + name: str + """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``.""" + + +class VoiceInputTranscription(TypedDict, total=False): + """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 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 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: Literal["minimal", "low", "medium", "high", "xhigh"] + :ivar model: The transcription model to use. 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: Union[str, "VoiceInputTranscriptionModel"] + :ivar custom_speech: Optional custom speech model 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] + """ + + language: str + """The language of the input audio. Supplying the input language in `ISO-639-1 + `_ (e.g. ``en``) format will improve + accuracy and latency.""" + prompt: str + """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: Literal["minimal", "low", "medium", "high", "xhigh"] + """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: Required[Union[str, "VoiceInputTranscriptionModel"]] + """The transcription model to use. 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: dict[str, str] + """Optional custom speech model configuration, keyed by locale.""" + phrase_list: list[str] + """Optional phrase hints that bias recognition toward domain terms.""" + + +class VoiceMcpApprovalRequestItem(TypedDict, total=False): + """An MCP approval request item. + + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: int + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str + :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 type: Required. An MCP approval request item. + :vartype type: Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST] + """ + + created_at: int + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: str + """The id of the response that produced this item, when applicable.""" + id: Required[str] + """The unique ID of the approval request. Required.""" + server_label: Required[str] + """The label of the MCP server making the request. Required.""" + name: Required[str] + """The name of the tool to run. Required.""" + arguments: Required[str] + """A JSON string of arguments for the tool. Required.""" + type: Required[Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST]] + """Required. An MCP approval request item.""" + + +class VoiceMcpApprovalResponseItem(TypedDict, total=False): + """An MCP approval response item (client-created). + + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: int + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str + :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 type: Required. An MCP approval response item. + :vartype type: Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE] + """ + + created_at: int + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: str + """The id of the response that produced this item, when applicable.""" + id: Required[str] + """The unique ID of the approval response. Required.""" + approval_request_id: Required[str] + """The ID of the approval request being answered. Required.""" + approve: Required[bool] + """Whether the request was approved. Required.""" + reason: Optional[str] + type: Required[Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE]] + """Required. An MCP approval response item.""" + + +class VoiceMcpCallItem(TypedDict, total=False): + """An MCP call item. + + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: int + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str + :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: "RealtimeMCPError" + :ivar type: Required. An MCP call item. + :vartype type: Literal[VoiceConversationItemType.MCP_CALL] + """ + + created_at: int + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: str + """The id of the response that produced this item, when applicable.""" + id: Required[str] + """The unique ID of the tool call. Required.""" + server_label: Required[str] + """The label of the MCP server running the tool. Required.""" + name: Required[str] + """The name of the tool that was run. Required.""" + arguments: Required[str] + """A JSON string of the arguments passed to the tool. Required.""" + approval_request_id: Optional[str] + output: Optional[str] + error: "RealtimeMCPError" + type: Required[Literal[VoiceConversationItemType.MCP_CALL]] + """Required. An MCP call item.""" + + +class VoiceMcpListToolsItem(TypedDict, total=False): + """An MCP list-tools item. + + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: int + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str + :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["MCPListToolsTool"] + :ivar type: Required. An MCP list-tools item. + :vartype type: Literal[VoiceConversationItemType.MCP_LIST_TOOLS] + """ + + created_at: int + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: str + """The id of the response that produced this item, when applicable.""" + id: str + """The unique ID of the list.""" + server_label: Required[str] + """The label of the MCP server. Required.""" + tools: Required[list["MCPListToolsTool"]] + """The tools available on the server. Required.""" + type: Required[Literal[VoiceConversationItemType.MCP_LIST_TOOLS]] + """Required. An MCP list-tools item.""" + + +class VoiceNoiseReduction(TypedDict, total=False): + """Input audio noise reduction configuration. + + :ivar type: The noise reduction mode. Required. Known values are: "near_field", "far_field", + and "azure_deep_noise_suppression". + :vartype type: Union[str, "VoiceNoiseReductionType"] + """ + + type: Required[Union[str, "VoiceNoiseReductionType"]] + """The noise reduction mode. Required. Known values are: \"near_field\", \"far_field\", and + \"azure_deep_noise_suppression\".""" + + +class VoiceSemanticVadTurnDetection(TypedDict, total=False): + """Semantic voice activity detection. + + :ivar eagerness: Is one of the following types: Literal["low"], Literal["medium"], + Literal["high"], Literal["auto"] + :vartype eagerness: Literal["low", "medium", "high", "auto"] + :ivar create_response: + :vartype create_response: bool + :ivar interrupt_response: + :vartype interrupt_response: bool + :ivar type: Required. Semantic voice activity detection. + :vartype type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD] + """ + + eagerness: Literal["low", "medium", "high", "auto"] + """Is one of the following types: Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"], + Literal[\"auto\"]""" + create_response: bool + interrupt_response: bool + type: Required[Literal[VoiceTurnDetectionType.SEMANTIC_VAD]] + """Required. Semantic voice activity detection.""" + + +class VoiceServerVadTurnDetection(TypedDict, total=False): + """Server-side voice activity detection. + + :ivar threshold: + :vartype threshold: float + :ivar prefix_padding_ms: + :vartype prefix_padding_ms: int + :ivar silence_duration_ms: + :vartype silence_duration_ms: int + :ivar create_response: + :vartype create_response: bool + :ivar interrupt_response: + :vartype interrupt_response: bool + :ivar idle_timeout_ms: + :vartype idle_timeout_ms: int + :ivar type: Required. Server-side voice activity detection. + :vartype type: Literal[VoiceTurnDetectionType.SERVER_VAD] + """ + + threshold: float + prefix_padding_ms: int + silence_duration_ms: int + create_response: bool + interrupt_response: bool + idle_timeout_ms: Optional[int] + type: Required[Literal[VoiceTurnDetectionType.SERVER_VAD]] + """Required. Server-side voice activity detection.""" + + +class VoiceSystemMessageItem(TypedDict, total=False): + """A system message item. Only ``input_text`` content is valid for system messages. + + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: int + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str + :ivar type: Required. A message item. + :vartype type: Literal[VoiceConversationItemType.MESSAGE] + :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: Literal["realtime.item"] + :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: Literal["completed", "incomplete", "in_progress"] + :ivar content: The content of the message. Required. + :vartype content: list["RealtimeConversationItemMessageSystemContent"] + :ivar role: Required. SYSTEM. + :vartype role: Literal[RealtimeConversationItemMessageType.SYSTEM] + """ + + created_at: int + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: str + """The id of the response that produced this item, when applicable.""" + type: Required[Literal[VoiceConversationItemType.MESSAGE]] + """Required. A message item.""" + id: str + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Literal["realtime.item"] + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + status: Literal["completed", "incomplete", "in_progress"] + """The status of the item. Has no effect on the conversation. Is one of the following types: + Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" + content: Required[list["RealtimeConversationItemMessageSystemContent"]] + """The content of the message. Required.""" + role: Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] + """Required. SYSTEM.""" + + +class VoiceSystemTool(TypedDict, total=False): + """A service-managed control that acts on the active voice session without customer code or + external authentication. + + :ivar type: The type of the tool. Always ``system``. Required. Default value is "system". + :vartype type: Literal["system"] + :ivar name: The service-managed control action. Known values are stable; additional values may + be added over time. Required. "end_conversation" + :vartype name: Union[str, "VoiceSystemToolName"] + :ivar description: An optional description of the system tool. + :vartype description: str + """ + + type: Required[Literal["system"]] + """The type of the tool. Always ``system``. Required. Default value is \"system\".""" + name: Required[Union[str, "VoiceSystemToolName"]] + """The service-managed control action. Known values are stable; additional values may be added + over time. Required. \"end_conversation\"""" + description: str + """An optional description of the system tool.""" + + +class VoiceToolboxTool(TypedDict, total=False): + """A reference to a Foundry toolbox, which is a versioned bundle of tools executed through its MCP + endpoint. + + :ivar type: The type of the tool. Always ``toolbox``. Required. Default value is "toolbox". + :vartype type: Literal["toolbox"] + :ivar toolbox_name: The name of the toolbox to attach. Required. + :vartype toolbox_name: str + :ivar toolbox_version: The immutable version of the toolbox to attach. Required. + :vartype toolbox_version: str + """ + + type: Required[Literal["toolbox"]] + """The type of the tool. Always ``toolbox``. Required. Default value is \"toolbox\".""" + toolbox_name: Required[str] + """The name of the toolbox to attach. Required.""" + toolbox_version: Required[str] + """The immutable version of the toolbox to attach. Required.""" + + +class VoiceUserMessageItem(TypedDict, total=False): + """A user message item. ``input_text``, ``input_audio``, and ``input_image`` content are valid for + user messages. + + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: int + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str + :ivar type: Required. A message item. + :vartype type: Literal[VoiceConversationItemType.MESSAGE] + :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: Literal["realtime.item"] + :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: Literal["completed", "incomplete", "in_progress"] + :ivar content: The content of the message. Required. + :vartype content: list["RealtimeConversationItemMessageUserContent"] + :ivar role: Required. USER. + :vartype role: Literal[RealtimeConversationItemMessageType.USER] + """ + + created_at: int + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: str + """The id of the response that produced this item, when applicable.""" + type: Required[Literal[VoiceConversationItemType.MESSAGE]] + """Required. A message item.""" + id: str + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Literal["realtime.item"] + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + status: Literal["completed", "incomplete", "in_progress"] + """The status of the item. Has no effect on the conversation. Is one of the following types: + Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" + content: Required[list["RealtimeConversationItemMessageUserContent"]] + """The content of the message. Required.""" + role: Required[Literal[RealtimeConversationItemMessageType.USER]] + """Required. USER.""" + + +class CreateVoiceAgentRequest(TypedDict, total=False): + """CreateVoiceAgentRequest. + + :ivar name: The unique name that identifies the agent. Name can be used to + retrieve/update/delete the agent. + + * Must start and end with alphanumeric characters, + * Can contain hyphens in the middle + * Must not exceed 63 characters. Required. + :vartype name: str + :ivar state: The initial operational state of the agent. Defaults to 'enabled' if not + specified. Known values are: "enabled" and "disabled". + :vartype state: Union[str, "AgentState"] + :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. + :vartype metadata: dict[str, str] + :ivar description: A human-readable description of the agent. + :vartype description: str + :ivar blueprint_reference: The blueprint reference for the agent. + :vartype blueprint_reference: "AgentBlueprintReference" + :ivar draft: (Preview) Whether this agent version is a draft (candidate) rather than a release. + The service defaults to ``false`` if a value is not specified by the caller. Draft versions are + recorded but excluded from default 'latest' resolution and are not auto-promoted. + :vartype draft: bool + :ivar definition: The voice agent definition. Required. + :vartype definition: "VoiceAgentDefinition" + :ivar agent_endpoint: An optional endpoint configuration. If not specified, a default endpoint + configuration will be set for the agent. + :vartype agent_endpoint: "AgentEndpointConfig" + :ivar agent_card: Optional agent card for the agent. + :vartype agent_card: "AgentCard" + """ + + name: Required[str] + """The unique name that identifies the agent. Name can be used to retrieve/update/delete the + agent. + + * Must start and end with alphanumeric characters, + * Can contain hyphens in the middle + * Must not exceed 63 characters. Required.""" + state: Union[str, "AgentState"] + """The initial operational state of the agent. Defaults to 'enabled' if not specified. Known + values are: \"enabled\" and \"disabled\".""" + metadata: dict[str, str] + """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.""" + description: str + """A human-readable description of the agent.""" + blueprint_reference: "AgentBlueprintReference" + """The blueprint reference for the agent.""" + draft: bool + """(Preview) Whether this agent version is a draft (candidate) rather than a release. The service + defaults to ``false`` if a value is not specified by the caller. Draft versions are recorded + but excluded from default 'latest' resolution and are not auto-promoted.""" + definition: Required["VoiceAgentDefinition"] + """The voice agent definition. Required.""" + agent_endpoint: "AgentEndpointConfig" + """An optional endpoint configuration. If not specified, a default endpoint configuration will be + set for the agent.""" + agent_card: "AgentCard" + """Optional agent card for the agent.""" + + +class UpdateVoiceAgentRequest(TypedDict, total=False): + """UpdateVoiceAgentRequest. + + :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. + :vartype metadata: dict[str, str] + :ivar description: A human-readable description of the agent. + :vartype description: str + :ivar blueprint_reference: The blueprint reference for the agent. + :vartype blueprint_reference: "AgentBlueprintReference" + :ivar definition: The voice agent definition. Required. + :vartype definition: "VoiceAgentDefinition" + """ + + metadata: dict[str, str] + """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.""" + description: str + """A human-readable description of the agent.""" + blueprint_reference: "AgentBlueprintReference" + """The blueprint reference for the agent.""" + definition: Required["VoiceAgentDefinition"] + """The voice agent definition. Required.""" + + +class GenerateVoiceAgentRequest(TypedDict, total=False): + """GenerateVoiceAgentRequest. + + :ivar name: The unique name for the agent to create. Required. + :vartype name: str + :ivar model_type: How the model backing the generated agent is served: ``managed`` + (service-managed) or ``self_deployed`` (the customer's own deployment). Carried through to the + generated definition, not generated. Required. Known values are: "managed" and "self_deployed". + :vartype model_type: Union[str, "VoiceModelType"] + :ivar model: The model paired with ``model_type``: the service-managed model name when + ``managed``, or the customer's Foundry deployment name when ``self_deployed``. Carried through, + not generated. Required. + :vartype model: str + :ivar agent_type: The persona/tone to steer generation. Required. Known values are: "personal" + and "business". + :vartype agent_type: Union[str, "VoiceAgentType"] + :ivar use_case: The scenario-template catalog entry the generator specializes for. Required. + Known values are: "customer_support", "reception", "sales", "travel_assistant", "outreach", + "personal_assistant", "learning", "call_center", and "in_car". + :vartype use_case: Union[str, "VoiceAgentUseCase"] + :ivar goal: A natural-language description of what the agent should do; the seed for the + generated ``instructions``. Required. + :vartype goal: str + :ivar description: An optional description for the agent. Generated from ``goal`` when omitted. + :vartype description: str + :ivar tools: Optional tools carried through verbatim onto the generated agent (see + ``VoiceAgentTool``). + :vartype tools: list["_unions.VoiceAgentTool"] + :ivar draft: (Preview) When ``true``, the generated voice agent is created as a draft — an + editable, unpublished version the caller can review and refine before publishing it via the + standard create/version path. The service defaults to ``false`` if a value is not specified by + the caller, in which case the agent is created and published normally. + :vartype draft: bool + """ + + name: Required[str] + """The unique name for the agent to create. Required.""" + model_type: Required[Union[str, "VoiceModelType"]] + """How the model backing the generated agent is served: ``managed`` (service-managed) or + ``self_deployed`` (the customer's own deployment). Carried through to the generated definition, + not generated. Required. Known values are: \"managed\" and \"self_deployed\".""" + model: Required[str] + """The model paired with ``model_type``: the service-managed model name when ``managed``, or the + customer's Foundry deployment name when ``self_deployed``. Carried through, not generated. + Required.""" + agent_type: Required[Union[str, "VoiceAgentType"]] + """The persona/tone to steer generation. Required. Known values are: \"personal\" and + \"business\".""" + use_case: Required[Union[str, "VoiceAgentUseCase"]] + """The scenario-template catalog entry the generator specializes for. Required. Known values are: + \"customer_support\", \"reception\", \"sales\", \"travel_assistant\", \"outreach\", + \"personal_assistant\", \"learning\", \"call_center\", and \"in_car\".""" + goal: Required[str] + """A natural-language description of what the agent should do; the seed for the generated + ``instructions``. Required.""" + description: str + """An optional description for the agent. Generated from ``goal`` when omitted.""" + tools: list["_unions.VoiceAgentTool"] + """Optional tools carried through verbatim onto the generated agent (see ``VoiceAgentTool``).""" + draft: bool + """(Preview) When ``true``, the generated voice agent is created as a draft — an editable, + unpublished version the caller can review and refine before publishing it via the standard + create/version path. The service defaults to ``false`` if a value is not specified by the + caller, in which case the agent is created and published normally.""" + + +class CreateVoiceAgentVersionRequest(TypedDict, total=False): + """CreateVoiceAgentVersionRequest. + + :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. + :vartype metadata: dict[str, str] + :ivar description: A human-readable description of the agent. + :vartype description: str + :ivar blueprint_reference: The blueprint reference for the agent. + :vartype blueprint_reference: "AgentBlueprintReference" + :ivar draft: (Preview) Whether this agent version is a draft (candidate) rather than a release. + The service defaults to ``false`` if a value is not specified by the caller. Draft versions are + recorded but excluded from default 'latest' resolution and are not auto-promoted. + :vartype draft: bool + :ivar definition: The voice agent definition. Required. + :vartype definition: "VoiceAgentDefinition" + """ + + metadata: dict[str, str] + """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.""" + description: str + """A human-readable description of the agent.""" + blueprint_reference: "AgentBlueprintReference" + """The blueprint reference for the agent.""" + draft: bool + """(Preview) Whether this agent version is a draft (candidate) rather than a release. The service + defaults to ``false`` if a value is not specified by the caller. Draft versions are recorded + but excluded from default 'latest' resolution and are not auto-promoted.""" + definition: Required["VoiceAgentDefinition"] + """The voice agent definition. Required.""" + + +AgentBlueprintReference = Union[ManagedAgentIdentityBlueprintReference] +AgentEndpointAuthorizationScheme = Union[ + BotServiceAuthorizationScheme, + BotServiceRbacAuthorizationScheme, + BotServiceTenantAuthorizationScheme, + EntraAuthorizationScheme, +] +AzureVoice = Union[AzureAvatarVoiceSyncVoice, AzureCustomVoice, AzurePersonalVoice, AzureStandardVoice] +CreateTranscriptionResponseJsonUsage = Union[TranscriptTextUsageDuration, TranscriptTextUsageTokens] +VersionSelectionRule = Union[FixedRatioVersionSelectionRule] +VoiceGreetingConfig = Union[LlmGeneratedVoiceGreetingConfig, TemplateVoiceGreetingConfig] +Tool = Union[MCPTool] +RealtimeConversationItem = Union[ + RealtimeConversationItemFunctionCall, + RealtimeConversationItemFunctionCallOutput, + RealtimeMCPApprovalRequest, + RealtimeMCPApprovalResponse, + RealtimeMCPToolCall, + RealtimeMCPListTools, +] +RealtimeConversationItemMessage = Union[ + RealtimeConversationItemMessageAssistant, RealtimeConversationItemMessageSystem, RealtimeConversationItemMessageUser +] +RealtimeMCPError = Union[RealtimeMCPHTTPError, RealtimeMCPProtocolError, RealtimeMCPToolExecutionError] +RealtimeServerEvent = Union[RealtimeServerEventResponseContentPartAdded] +ToolChoiceParam = Union[ToolChoiceFunction, ToolChoiceMCP] +VoiceAgentInterimResponseConfig = Union[VoiceAgentLlmInterimResponseConfig, VoiceAgentStaticInterimResponseConfig] +VoiceMessageItem = Union[VoiceAssistantMessageItem, VoiceSystemMessageItem, VoiceUserMessageItem] +VoiceConversationItem = Union[ + VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, + VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem, + VoiceMcpCallItem, + VoiceMcpListToolsItem, + VoiceMessageItem, +] +VoiceEndOfUtteranceDetection = Union[ + VoiceAzureSemanticDetection, VoiceAzureSemanticDetectionEn, VoiceAzureSemanticDetectionMultilingual +] +VoiceTurnDetection = Union[ + VoiceAzureSemanticVadTurnDetection, + VoiceAzureSemanticVadEnTurnDetection, + VoiceAzureSemanticVadMultilingualTurnDetection, + VoiceSemanticVadTurnDetection, + VoiceServerVadTurnDetection, +] diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure_ai_voiceagents-1.0.0b1/azure/ai/voiceagents/_configuration.py b/sdk/voiceagents/azure-ai-voiceagents/azure_ai_voiceagents-1.0.0b1/azure/ai/voiceagents/_configuration.py new file mode 100644 index 000000000000..6f48c8a3aec0 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/azure_ai_voiceagents-1.0.0b1/azure/ai/voiceagents/_configuration.py @@ -0,0 +1,69 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.pipeline import policies + +from ._version import VERSION + +if TYPE_CHECKING: + from azure.core.credentials import TokenCredential + + +class VoiceAgentsClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only + """Configuration for VoiceAgentsClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param endpoint: Foundry Project endpoint in the form + "https://{ai-services-account-name}.services.ai.azure.com/api/projects/{project-name}". If you + only have one Project in your Foundry Hub, or to target the default Project in your Hub, use + the form "https://{ai-services-account-name}.services.ai.azure.com/api/projects/_project". + Required. + :type endpoint: str + :param credential: Credential used to authenticate requests to the service. Required. + :type credential: ~azure.core.credentials.TokenCredential + :keyword api_version: The API version to use for this operation. Known values are "v1" and + None. Default value is None. If not set, the operation's default API version will be used. Note + that overriding this default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None: + api_version: str = kwargs.pop("api_version", "v1") + + if endpoint is None: + raise ValueError("Parameter 'endpoint' must not be None.") + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + + self.endpoint = endpoint + self.credential = credential + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://ai.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "ai-voiceagents/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/voiceagents/azure-ai-voiceagents/dev_requirements.txt b/sdk/voiceagents/azure-ai-voiceagents/dev_requirements.txt new file mode 100644 index 000000000000..ad0907b03b93 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/dev_requirements.txt @@ -0,0 +1,4 @@ +-e ../../../eng/tools/azure-sdk-tools +../../core/azure-core +../../identity/azure-identity +aiohttp \ No newline at end of file diff --git a/sdk/voiceagents/azure-ai-voiceagents/pyproject.toml b/sdk/voiceagents/azure-ai-voiceagents/pyproject.toml new file mode 100644 index 000000000000..5247f5be1ec5 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/pyproject.toml @@ -0,0 +1,61 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +[build-system] +requires = ["setuptools>=77.0.3", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "azure-ai-voiceagents" +authors = [ + { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, +] +description = "Microsoft Corporation Azure Ai Voiceagents Client Library for Python" +license = "MIT" +classifiers = [ + "Development Status :: 4 - Beta", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", +] +requires-python = ">=3.10" +keywords = ["azure", "azure sdk"] + +dependencies = [ + "isodate>=0.6.1", + "azure-core>=1.37.0", + "typing-extensions>=4.6.0", +] +dynamic = [ +"version", "readme" +] + +[project.urls] +repository = "https://github.com/Azure/azure-sdk-for-python" + +[tool.setuptools.dynamic] +version = {attr = "azure.ai.voiceagents._version.VERSION"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} + +[tool.setuptools.packages.find] +exclude = [ + "tests*", + "generated_tests*", + "samples*", + "generated_samples*", + "doc*", + "azure", + "azure.ai", +] + +[tool.setuptools.package-data] +pytyped = ["py.typed"] diff --git a/sdk/voiceagents/azure-ai-voiceagents/pyrightconfig.json b/sdk/voiceagents/azure-ai-voiceagents/pyrightconfig.json new file mode 100644 index 000000000000..66cc40d3f494 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/pyrightconfig.json @@ -0,0 +1,13 @@ +{ + "reportTypeCommentUsage": true, + "reportMissingImports": false, + "pythonVersion": "3.10", + "exclude": [ + "**/tests/**", + "azure/ai/voiceagents/_unions.py" + ], + "extraPaths": [ + "./../../core/azure-core", + "./../../identity/azure-identity" + ] +} diff --git a/sdk/voiceagents/azure-ai-voiceagents/pytest.ini b/sdk/voiceagents/azure-ai-voiceagents/pytest.ini new file mode 100644 index 000000000000..2f4c80e30750 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/pytest.ini @@ -0,0 +1,2 @@ +[pytest] +asyncio_mode = auto diff --git a/sdk/voiceagents/azure-ai-voiceagents/samples/README.md b/sdk/voiceagents/azure-ai-voiceagents/samples/README.md new file mode 100644 index 000000000000..7e65dc5fd1c2 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/samples/README.md @@ -0,0 +1,153 @@ +--- +page_type: sample +languages: + - python +products: + - azure + - azure-ai-foundry +urlFragment: voiceagents-samples +--- + +# Samples for the Azure AI Voice Agents client library for Python + +These code samples are organized **by scenario**: + +- **`quickstart/`** — the + shortest end-to-end path: generate a temporary voice agent with the management + API, hold a realtime microphone/speaker conversation with it, then delete the + agent. +- **`management/`** — + request/response scenarios with the `azure-ai-voiceagents` client: managing + voice agents, working with agent versions, and reading back persisted + conversations (transcript, items, and audio recordings). Each scenario + includes a sync sample and, where applicable, its async variant (files + suffixed `_async`). +- **`live/`** — the live voice conversation + scenario against an existing agent through the native + `client.realtime.connect(...)` API. No other SDK is required. + +> [!IMPORTANT] +> Voice agents are a **gated preview**. Every call opts in with the +> `VoiceAgents=V1Preview` feature flag (the samples pass it as `foundry_features`). +> The preview must also be **enabled for your subscription** and **served on your +> project's endpoint/region**. Until then, even a correct, authenticated request +> returns `404 NotFound` -- the route simply isn't provisioned for your project +> yet. If you hit this, confirm preview enablement and a supported region with +> your service contact rather than changing the sample code. + +## `quickstart/` -- create an agent and talk to it + +| File | Description | +| ---- | ----------- | +| [quickstart/sample_quickstart_async.py](quickstart/sample_quickstart_async.py) | Generate a temporary voice agent, stream microphone audio to it, play the spoken response through your speakers, and delete the agent when the sample exits. Requires `pyaudio`. | + +## `management/` -- manage agents and read conversations + +**Manage voice agents** -- these run standalone; you only need an endpoint. + +| File | Description | +| ---- | ----------- | +| [management/sample_create_and_manage_voice_agent.py](management/sample_create_and_manage_voice_agent.py) | Create (with a voice/audio config and conversation storage enabled), get, list, update, disable/enable, and delete a voice agent. | +| [management/sample_create_and_manage_voice_agent_async.py](management/sample_create_and_manage_voice_agent_async.py) | Async version of the create/manage lifecycle. | +| [management/sample_create_voice_agent_with_tools.py](management/sample_create_voice_agent_with_tools.py) | Create an agent with tools (`function`, `system`, `mcp`, `toolbox`), input-audio config (turn detection + transcription), and bring-your-own-model (`self_deployed`). | +| [management/sample_generate_voice_agent.py](management/sample_generate_voice_agent.py) | Guided authoring: generate and create a voice agent from a persona, use case, and a natural-language goal. | +| [management/sample_manage_voice_agent_versions.py](management/sample_manage_voice_agent_versions.py) | Create and list immutable versions of a voice agent, including draft versions. | + +**Read conversations** -- these need an existing agent and a conversation id from +a completed live session (see [Getting a conversation id](#getting-a-conversation-id)). + +| File | Description | +| ---- | ----------- | +| [management/sample_read_conversation.py](management/sample_read_conversation.py) | Read a persisted conversation, its responses (and per-response items), and its items (with single get by id). | +| [management/sample_read_conversation_audio.py](management/sample_read_conversation_audio.py) | Read the merged whole-call recording and a single turn's audio, streaming each to a WAV file. | + +## `live/` -- hold a live conversation + +| File | Description | +| ---- | ----------- | +| [live/sample_live_text_conversation_async.py](live/sample_live_text_conversation_async.py) | Converse with an **existing** agent using **typed** turns: type prompts in a loop -- each is sent via `client.realtime.connect(...)` and the spoken reply is streamed back (optionally played through your speakers). Reads the persisted conversation back at the end. Runs headless -- no microphone needed. | +| [live/sample_live_audio_conversation_async.py](live/sample_live_audio_conversation_async.py) | Converse with an **existing** agent using your **microphone**: stream live audio to the agent, let server VAD detect your turns, and talk over the agent to **barge in** (cancel its in-flight reply). Requires `pyaudio`. Runs until you press Ctrl-C. | + +## Prerequisites + +- Python 3.10 or later. +- An Azure subscription and a Foundry project endpoint. +- The following packages installed: + + ```bash + python -m pip install azure-ai-voiceagents azure-identity + # for the async samples, also install an async transport: + python -m pip install aiohttp + # optional: to hear the live samples' audio reply through your speakers, + # and to run the microphone sample: + python -m pip install pyaudio + ``` + +## Setup + +The samples read their inputs from environment variables. Every sample needs +`AZURE_VOICE_AGENTS_ENDPOINT`; the other variables depend on the scenario. + +| Variable | Required by | Description | +| -------- | ----------- | ----------- | +| `AZURE_VOICE_AGENTS_ENDPOINT` | all samples | Foundry project endpoint: `https://.services.ai.azure.com/api/projects/` | +| `AZURE_VOICE_AGENTS_MODEL` | management and quickstart samples (optional) | Realtime model deployment name. Defaults to `gpt-realtime`. | +| `AZURE_VOICE_AGENTS_MODEL_TYPE` | `sample_create_voice_agent_with_tools.py` (optional) | `managed` (default) for a service-hosted model, or `self_deployed` to bring your own Foundry deployment. | +| `AZURE_VOICE_AGENTS_AGENT_NAME` | `live/*.py`, `sample_read_conversation*.py` | Name of an existing voice agent -- create one first with a management sample using `store=True`, or use the quickstart for an automatic create-and-talk flow. | +| `AZURE_VOICE_AGENTS_CONVERSATION_ID` | `sample_read_conversation*.py` | Id of a persisted conversation (see below). | + +```bash +# bash +export AZURE_VOICE_AGENTS_ENDPOINT="https://.services.ai.azure.com/api/projects/" +``` + +```powershell +# PowerShell +$env:AZURE_VOICE_AGENTS_ENDPOINT = "https://.services.ai.azure.com/api/projects/" +``` + +The samples authenticate with +[`DefaultAzureCredential`](https://learn.microsoft.com/python/api/azure-identity/azure.identity.defaultazurecredential), +so sign in first (for example, with `az login`) or configure the appropriate +environment variables. Your identity needs access to the Foundry project. + +### Getting a conversation id + +The read samples don't create conversations -- this client can only *read* them. +A conversation is created by the **voice orchestrator during a live session**, +and it is persisted only when the agent was created with `store = true` (the +management samples turn this on). During the live session the service emits a +`conversation.created` event whose id you pass as +`AZURE_VOICE_AGENTS_CONVERSATION_ID`. Audio additionally requires the session to +have ended. + +The `live/` samples do this end to end for you against an **existing** agent +(set `AZURE_VOICE_AGENTS_AGENT_NAME`; create one first with a management sample and +`store=True`): each opens a live session with `client.realtime.connect(...)`, +captures the conversation id from that session, and reads the conversation +back -- no manual id wiring required. Use `sample_live_text_conversation_async.py` +for a headless typed turn, or `sample_live_audio_conversation_async.py` for a +hands-free microphone conversation with barge-in. + +## Running a sample + +```bash +python management/sample_create_and_manage_voice_agent.py +``` + +## Troubleshooting + +| Symptom | Likely cause and fix | +| ------- | -------------------- | +| `KeyError: 'AZURE_VOICE_AGENTS_...'` | A required environment variable is not set. See the table above. | +| `HttpResponseError` 401 / 403 | Not signed in, or your identity lacks access to the project. Run `az login` and confirm project permissions. | +| `ResourceNotFoundError` / 404 on a **management** call (create, list, generate) | The gated preview isn't enabled for your subscription, or isn't served on your project's endpoint/region yet. The request URL and auth are correct; the route just isn't provisioned. Confirm preview enablement and a supported region with your service contact. | +| `HttpResponseError` 404 on a **read** sample | The conversation was not persisted (agent ran with `store = false`) or the id is wrong. | +| `HttpResponseError` 409 on the audio sample | Either the session is still in progress, or the recording lives in your own bring-your-own-storage (BYOS) account -- its bytes aren't streamed through the service and must be downloaded directly from the `blob_uri` returned by the metadata route. Foundry-managed audio streams normally. | +| Model / deployment not found | The `gpt-realtime` default deployment doesn't exist in your project. Set `AZURE_VOICE_AGENTS_MODEL` to a valid realtime deployment name. | + +> [!NOTE] +> The management samples create and delete **real resources** in your project and +> may incur cost. Each sample deletes the agent it creates on the success path +> only; if a sample fails partway through, it may leave the agent behind, so +> check your project and delete any leftover agents manually. diff --git a/sdk/voiceagents/azure-ai-voiceagents/samples/live/sample_live_audio_conversation_async.py b/sdk/voiceagents/azure-ai-voiceagents/samples/live/sample_live_audio_conversation_async.py new file mode 100644 index 000000000000..8192e9e626c6 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/samples/live/sample_live_audio_conversation_async.py @@ -0,0 +1,323 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- + +""" +FILE: sample_live_audio_conversation_async.py + +DESCRIPTION: + End-to-end hands-free, bidirectional voice conversation against an existing + voice agent, using only azure-ai-voiceagents, through the native + ``client.realtime.connect(...)`` API. + + 1. Stream live mic audio and let the agent's server-side VAD detect your + turns: your speech is transcribed, the agent replies through the + speakers, and talking over it barges in. + 2. Read the persisted conversation back (requires the agent to have been + created with ``store=True``; see sample_create_and_manage_voice_agent.py). + + Capture and playback use non-blocking pyaudio callbacks; reply audio is + sequence-numbered so a barge-in can skip whatever is still queued. The agent + owns turn detection and noise suppression server-side. Use a headset to + avoid echo. + + Mic audio is sent as base64 PCM16; the reply arrives as typed + ``response.output_audio.*`` events, decoded to PCM16, mono, 24 kHz. Requires + ``pyaudio``. + + pip install azure-ai-voiceagents azure-identity pyaudio + +USAGE: + python sample_live_audio_conversation_async.py + + Environment variables: + 1) AZURE_VOICE_AGENTS_ENDPOINT (required) - Foundry project endpoint: + https://.services.ai.azure.com/api/projects/ + 2) AZURE_VOICE_AGENTS_AGENT_NAME (required) - name of an existing voice agent to + converse with (created with ``store=True`` to persist conversations). + + Runs until you press Ctrl-C. Authenticates with DefaultAzureCredential, so + sign in first (e.g. `az login`). +""" + +import asyncio +import os +import queue +from typing import Any, Final, Optional + +from azure.core.exceptions import HttpResponseError +from azure.identity.aio import DefaultAzureCredential + +from azure.ai.voiceagents.aio import AsyncRealtimeConnection, VoiceAgentsClient +from azure.ai.voiceagents.models import ( + AgentDefinitionOptInKeys, + VoiceAgentServerEventConversationCreated, + VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted, + VoiceAgentServerEventError, + VoiceAgentServerEventInputAudioBufferSpeechStarted, + VoiceAgentServerEventResponseAudioDelta, + VoiceAgentServerEventResponseAudioTranscriptDone, +) + +PREVIEW: Final = AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW + +# Audio is streamed both ways as PCM16, mono, 24 kHz. +_SAMPLE_RATE: Final = 24000 + +# pyaudio callback buffer size (~50 ms of PCM16 audio per callback). +_CHUNK_SAMPLES: Final = 1200 + +try: + import pyaudio # type: ignore[import-not-found] +except ImportError: # pragma: no cover - required audio dependency + pyaudio: Any = None + + +class _AudioProcessor: + """Real-time mic capture and speaker playback via non-blocking pyaudio callbacks. + + * Capture appends each raw PCM16 frame to the input buffer (the realtime + client base64-encodes it). + * Playback pulls sequence-numbered PCM16 from a queue, always returning the + exact sample count pyaudio asked for (a wrong size corrupts audio). + * ``skip_pending_audio`` bumps a base sequence number so audio queued before + a barge-in is dropped, stopping playback the instant the user speaks. + """ + + def __init__(self, connection: "AsyncRealtimeConnection") -> None: + self._conn = connection + self._loop: Optional[asyncio.AbstractEventLoop] = None + self._audio = pyaudio.PyAudio() + + # Playback with sequence numbers for interrupt handling. + self._playback_queue: "queue.Queue[tuple[int, Optional[bytes]]]" = queue.Queue() + self._playback_base = 0 + self._next_seq = 0 + self._bytes = 0 + + self._input_stream = None + self._output_stream = None + + # -- capture ----------------------------------------------------------- + + def start_capture(self) -> None: + """Start streaming microphone audio to the service via a callback.""" + if self._input_stream is not None: + return + self._loop = asyncio.get_running_loop() + + def _capture_callback(in_data, _frame_count, _time_info, _status): + # Runs on a pyaudio thread: hand the frame to the event loop to append. + assert self._loop is not None + asyncio.run_coroutine_threadsafe(self._conn.input_audio_buffer.append(audio=in_data), self._loop) + return (None, pyaudio.paContinue) + + self._input_stream = self._audio.open( + format=pyaudio.paInt16, + channels=1, + rate=_SAMPLE_RATE, + input=True, + frames_per_buffer=_CHUNK_SAMPLES, + stream_callback=_capture_callback, + ) + + # -- playback ------------------------------------------------------------ + + def start_playback(self) -> None: + """Initialize the speaker playback callback.""" + if self._output_stream is not None: + return + remaining = b"" + + def _playback_callback(_in_data, frame_count, _time_info, _status): + nonlocal remaining + wanted = frame_count * pyaudio.get_sample_size(pyaudio.paInt16) + out = remaining[:wanted] + remaining = remaining[wanted:] + + while len(out) < wanted: + try: + seq, data = self._playback_queue.get_nowait() + except queue.Empty: + out = out + bytes(wanted - len(out)) # pad with silence + continue + if not data: + break # end-of-stream marker + if seq < self._playback_base: + remaining = b"" # skipped by a barge-in + continue + take = wanted - len(out) + out = out + data[:take] + remaining = data[take:] + + return (out, pyaudio.paContinue) + + self._output_stream = self._audio.open( + format=pyaudio.paInt16, + channels=1, + rate=_SAMPLE_RATE, + output=True, + frames_per_buffer=_CHUNK_SAMPLES, + stream_callback=_playback_callback, + ) + + def _next_seq_num(self) -> int: + seq = self._next_seq + self._next_seq += 1 + return seq + + def queue_audio(self, pcm: bytes) -> None: + """Queue one decoded PCM16 chunk of the agent's reply for playback. + + :param pcm: Decoded PCM16 audio bytes. + :type pcm: bytes + """ + self._bytes += len(pcm) + self._playback_queue.put((self._next_seq_num(), pcm)) + + def skip_pending_audio(self) -> None: + """Drop audio still queued for playback (used on barge-in).""" + self._playback_base = self._next_seq_num() + + def shutdown(self) -> None: + """Stop capture and playback and release the audio device.""" + if self._input_stream is not None: + self._input_stream.stop_stream() + self._input_stream.close() + self._input_stream = None + if self._output_stream is not None: + self.skip_pending_audio() + self._playback_queue.put((self._next_seq_num(), None)) + self._output_stream.stop_stream() + self._output_stream.close() + self._output_stream = None + self._audio.terminate() + + @property + def seconds(self) -> float: + """Total reply audio received, in seconds (PCM16 = 2 bytes/sample). + + :rtype: float + """ + return self._bytes / 2 / _SAMPLE_RATE + + +async def _run_audio_conversation(client: VoiceAgentsClient, agent_name: str) -> Optional[str]: + """Hold a live, hands-free conversation with barge-in. + + :param client: The voice agents client. + :param agent_name: The existing voice agent name. + :type client: ~azure.ai.voiceagents.aio.VoiceAgentsClient + :type agent_name: str + :return: The persisted conversation id, if one is created. + :rtype: str or None + """ + if pyaudio is None: + print("This sample needs pyaudio for audio: pip install pyaudio") + return None + + conversation_id: Optional[str] = None + + # Open the realtime session on the voice agent's dedicated route. + async with client.realtime.connect(agent_name=agent_name) as conn: + # A voice agent owns its model, instructions, voice, turn detection, and + # noise suppression server-side, so this client sends no ``session.update``. + ap = _AudioProcessor(conn) + ap.start_playback() + ap.start_capture() + + print("Speak now -- the agent replies after you pause.") + print("(talk over the agent to interrupt it; press Ctrl-C to end the session)") + + try: + async for event in conn: + if isinstance(event, VoiceAgentServerEventInputAudioBufferSpeechStarted): + # Barge-in: stop the active response and drop whatever reply + # audio is still queued locally. The service only supports + # output_audio_buffer.clear in avatar mode. + await conn.response.cancel() + ap.skip_pending_audio() + print("(listening...)") + elif isinstance(event, VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted): + print(f"You: {event.transcript.strip()}") + elif isinstance(event, VoiceAgentServerEventError): + # Non-fatal errors are reported; a fatal one closes the socket. + print(f"Session error: {event.error.message}") + elif isinstance(event, VoiceAgentServerEventResponseAudioDelta): + # Each delta is a decoded PCM16 chunk; queue it. + ap.queue_audio(event.delta) + elif isinstance(event, VoiceAgentServerEventResponseAudioTranscriptDone): + print(f"Agent: {event.transcript}") + elif isinstance(event, VoiceAgentServerEventConversationCreated): + conversation_id = event.conversation_id + print(f"(conversation.created -> persisted id: {conversation_id})") + except (KeyboardInterrupt, asyncio.CancelledError): + # Ctrl-C ends the session; read back whatever was persisted so far. + print("\n(ending session...)") + finally: + print(f"(received {ap.seconds:.2f}s of reply audio this session)") + ap.shutdown() + + return conversation_id + + +async def _read_conversation(client: VoiceAgentsClient, agent_name: str, conversation_id: str) -> None: + """Read the persisted conversation back over the read-only conversation API. + + :param client: The voice agents client. + :param agent_name: The voice agent name. + :param conversation_id: The persisted conversation id. + :type client: ~azure.ai.voiceagents.aio.VoiceAgentsClient + :type agent_name: str + :type conversation_id: str + """ + conversations = client.agent_endpoint_conversations + + conversation = await conversations.get_agent_conversation(agent_name, conversation_id, foundry_features=PREVIEW) + print(f"Conversation {conversation.id}: status={conversation.status}, created_at={conversation.created_at}") + + print("Items (transcript):") + async for item in conversations.list_agent_conversation_items( + agent_name, conversation_id, foundry_features=PREVIEW + ): + role = item.get("role") or item.get("type") + # Audio turns expose ``transcript``; text turns expose ``text``. + parts = [(part.get("transcript") or part.get("text") or "").strip() for part in (item.get("content") or [])] + transcript = " ".join(p for p in parts if p) + print(f" - {role} id={item.get('id')}") + if transcript: + print(f" {transcript}") + + +async def audio_conversation() -> None: + endpoint = os.environ["AZURE_VOICE_AGENTS_ENDPOINT"] + agent_name = os.environ["AZURE_VOICE_AGENTS_AGENT_NAME"] + + async with DefaultAzureCredential() as credential, VoiceAgentsClient( + endpoint=endpoint, credential=credential + ) as client: + try: + # 1) Hold a live microphone conversation with the existing agent. + print(f"Starting realtime session with agent: {agent_name}") + conversation_id = await _run_audio_conversation(client, agent_name) + + # 2) Read the persisted conversation back. + if conversation_id: + print(f"Reading persisted conversation {conversation_id!r}...") + try: + await _read_conversation(client, agent_name, conversation_id) + except HttpResponseError as e: + print(f"Could not read conversation: {e.status_code} {e.reason}") + else: + print("No conversation id was returned; nothing to read.") + except HttpResponseError as e: + print(f"Service responded with an error: {e.status_code} {e.reason}") + + +if __name__ == "__main__": + try: + asyncio.run(audio_conversation()) + except KeyboardInterrupt: + print("\nInterrupted.") diff --git a/sdk/voiceagents/azure-ai-voiceagents/samples/live/sample_live_text_conversation_async.py b/sdk/voiceagents/azure-ai-voiceagents/samples/live/sample_live_text_conversation_async.py new file mode 100644 index 000000000000..6cdcff9d2ca7 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/samples/live/sample_live_text_conversation_async.py @@ -0,0 +1,250 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- + +""" +FILE: sample_live_text_conversation_async.py + +DESCRIPTION: + End-to-end typed conversation against an existing voice agent, using only + azure-ai-voiceagents, through the native ``client.realtime.connect(...)`` API. + + 1. Hold a typed, multi-turn conversation: each prompt is sent as a + ``RealtimeConversationItemMessageUser`` and the reply streams back as + typed audio and transcript events. Blank line (or ``exit`` / ``quit``) + ends it. + 2. Read the persisted conversation back (requires the agent to have been + created with ``store=True``; see sample_create_and_manage_voice_agent.py). + + Reply audio is PCM16, mono, 24 kHz and plays through the speakers when + ``pyaudio`` is installed; runs headless otherwise. For a hands-free mic + conversation with barge-in, see sample_live_audio_conversation_async.py. + + pip install azure-ai-voiceagents azure-identity pyaudio + +USAGE: + python sample_live_text_conversation_async.py + + Environment variables: + 1) AZURE_VOICE_AGENTS_ENDPOINT (required) - Foundry project endpoint: + https://.services.ai.azure.com/api/projects/ + 2) AZURE_VOICE_AGENTS_AGENT_NAME (required) - name of an existing voice agent to + converse with (created with ``store=True`` to persist conversations). + + Authenticates with DefaultAzureCredential, so sign in first (e.g. `az login`). +""" + +import asyncio +import os +from typing import Final, Optional + +from azure.core.exceptions import HttpResponseError +from azure.identity.aio import DefaultAzureCredential + +from azure.ai.voiceagents.aio import VoiceAgentsClient +from azure.ai.voiceagents.models import ( + AgentDefinitionOptInKeys, + RealtimeConversationItemMessageUser, + RealtimeConversationItemMessageUserContent, + VoiceAgentServerEventConversationCreated, + VoiceAgentServerEventError, + VoiceAgentServerEventResponseAudioDelta, + VoiceAgentServerEventResponseAudioTranscriptDone, + VoiceAgentServerEventResponseDone, +) + +PREVIEW: Final = AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW + +# Seconds to wait for the agent to finish its reply. +_RESPONSE_TIMEOUT: Final = 45 + +# Reply audio format: PCM16, mono, 24 kHz. +_SAMPLE_RATE: Final = 24000 + +try: + import pyaudio # type: ignore[import-not-found] +except ImportError: # pragma: no cover - optional playback dependency + pyaudio = None # type: ignore[assignment] + + +class _SpeakerPlayer: + """Play streamed PCM16 audio through the speakers with pyaudio. + + Optional: without pyaudio the player is a no-op and the sample still runs + headless, reporting how much audio it received. + """ + + def __init__(self) -> None: + self._audio = None + self._stream = None + self._bytes = 0 + if pyaudio is not None: + self._audio = pyaudio.PyAudio() + self._stream = self._audio.open( + format=pyaudio.paInt16, + channels=1, + rate=_SAMPLE_RATE, + output=True, + ) + + @property + def enabled(self) -> bool: + return self._stream is not None + + def play(self, pcm: bytes) -> None: + """Write one decoded PCM16 chunk to the speaker. + + :param pcm: Decoded PCM16 audio bytes. + :type pcm: bytes + """ + self._bytes += len(pcm) + if self._stream is not None: + self._stream.write(pcm) + + def close(self) -> None: + """Drain and release the audio device.""" + if self._stream is not None: + self._stream.stop_stream() + self._stream.close() + self._stream = None + if self._audio is not None: + self._audio.terminate() + self._audio = None + + @property + def seconds(self) -> float: + """Total audio received, in seconds (PCM16 = 2 bytes/sample). + + :rtype: float + """ + return self._bytes / 2 / _SAMPLE_RATE + + +async def _run_text_conversation(client: VoiceAgentsClient, agent_name: str) -> Optional[str]: + """Hold a typed, multi-turn conversation. + + :param client: The voice agents client. + :param agent_name: The existing voice agent name. + :type client: ~azure.ai.voiceagents.aio.VoiceAgentsClient + :type agent_name: str + :return: The persisted conversation id, if one is created. + :rtype: str or None + """ + conversation_id: Optional[str] = None + audio_delta_count = 0 + player = _SpeakerPlayer() + + try: + # Open the realtime session on the voice agent's dedicated route. + async with client.realtime.connect(agent_name=agent_name) as conn: + print("Type a message and press Enter. Blank line (or 'exit') ends the session.") + + async def pump() -> None: + nonlocal conversation_id, audio_delta_count + async for event in conn: + if isinstance(event, VoiceAgentServerEventResponseDone): + return + if isinstance(event, VoiceAgentServerEventError): + print(f"Session error: {event.error.message}") + return + if isinstance(event, VoiceAgentServerEventResponseAudioDelta): + # Each delta is a decoded PCM16 chunk; play it. + audio_delta_count += 1 + player.play(event.delta) + elif isinstance(event, VoiceAgentServerEventResponseAudioTranscriptDone): + print(f"Agent: {event.transcript}") + elif isinstance(event, VoiceAgentServerEventConversationCreated): + conversation_id = event.conversation_id + print(f"(conversation.created -> persisted id: {conversation_id})") + + while True: + # input() blocks, so read it off the loop in a worker thread. + prompt = (await asyncio.to_thread(input, "You: ")).strip() + if not prompt or prompt.lower() in ("exit", "quit"): + break + + # Send the turn and ask the agent to respond. + await conn.conversation.item.create( + item=RealtimeConversationItemMessageUser( + content=[RealtimeConversationItemMessageUserContent(type="input_text", text=prompt)] + ) + ) + await conn.response.create() + + try: + await asyncio.wait_for(pump(), timeout=_RESPONSE_TIMEOUT) + except asyncio.TimeoutError: + print("Timed out waiting for the agent's reply.") + except (KeyboardInterrupt, asyncio.CancelledError): + print("\n(ending session...)") + finally: + played = player.enabled + player.close() + + detail = "played" if played else "received" + print(f"(streamed {audio_delta_count} audio chunks, {detail} {player.seconds:.2f}s of audio)") + if not played: + print("(install pyaudio to hear the reply: pip install pyaudio)") + return conversation_id + + +async def _read_conversation(client: VoiceAgentsClient, agent_name: str, conversation_id: str) -> None: + """Read the persisted conversation back over the read-only conversation API. + + :param client: The voice agents client. + :param agent_name: The voice agent name. + :param conversation_id: The persisted conversation id. + :type client: ~azure.ai.voiceagents.aio.VoiceAgentsClient + :type agent_name: str + :type conversation_id: str + """ + conversations = client.agent_endpoint_conversations + + conversation = await conversations.get_agent_conversation(agent_name, conversation_id, foundry_features=PREVIEW) + print(f"Conversation {conversation.id}: status={conversation.status}, created_at={conversation.created_at}") + + print("Items (transcript):") + async for item in conversations.list_agent_conversation_items( + agent_name, conversation_id, foundry_features=PREVIEW + ): + role = item.get("role") or item.get("type") + # Audio turns expose ``transcript``; text turns expose ``text``. + parts = [(part.get("transcript") or part.get("text") or "").strip() for part in (item.get("content") or [])] + transcript = " ".join(p for p in parts if p) + print(f" - {role} id={item.get('id')}") + if transcript: + print(f" {transcript}") + + +async def text_conversation() -> None: + endpoint = os.environ["AZURE_VOICE_AGENTS_ENDPOINT"] + agent_name = os.environ["AZURE_VOICE_AGENTS_AGENT_NAME"] + + async with DefaultAzureCredential() as credential, VoiceAgentsClient( + endpoint=endpoint, credential=credential + ) as client: + try: + # 1) Hold the realtime conversation against the existing agent. + print(f"Starting realtime session with agent: {agent_name}") + conversation_id = await _run_text_conversation(client, agent_name) + + # 2) Read the persisted conversation back. + if conversation_id: + print(f"Reading persisted conversation {conversation_id}...") + try: + await _read_conversation(client, agent_name, conversation_id) + except HttpResponseError as e: + print(f"Could not read conversation: {e.status_code} {e.reason}") + else: + print("No conversation id was returned; nothing to read.") + except HttpResponseError as e: + print(f"Service responded with an error: {e.status_code} {e.reason}") + + +if __name__ == "__main__": + try: + asyncio.run(text_conversation()) + except KeyboardInterrupt: + print("\nInterrupted.") diff --git a/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_create_and_manage_voice_agent.py b/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_create_and_manage_voice_agent.py new file mode 100644 index 000000000000..980cb41b8628 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_create_and_manage_voice_agent.py @@ -0,0 +1,115 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- + +""" +FILE: sample_create_and_manage_voice_agent.py + +DESCRIPTION: + This sample demonstrates the voice-agent management lifecycle over the HTTP + surface: creating a voice agent (with an audio/voice configuration and + conversation storage enabled), retrieving it, listing the agents in the + project, updating it, disabling/enabling it, and deleting it. + +USAGE: + python sample_create_and_manage_voice_agent.py + + Set the environment variable before running the sample: + 1) AZURE_VOICE_AGENTS_ENDPOINT - the Foundry project endpoint, in the form + https://.services.ai.azure.com/api/projects/ + + Optional: + 2) AZURE_VOICE_AGENTS_MODEL - the realtime model deployment to use. + Defaults to "gpt-realtime". + + The sample authenticates with DefaultAzureCredential, so sign in first + (for example, with `az login`). +""" + +import os +from typing import Final + +from azure.identity import DefaultAzureCredential + +from azure.ai.voiceagents import VoiceAgentsClient +from azure.ai.voiceagents.models import ( + AgentDefinitionOptInKeys, + AzureStandardVoice, + VoiceAgentDefinition, + VoiceAudioConfig, + VoiceAudioOutputConfig, + VoiceOutputModality, +) + + +def create_and_manage_voice_agent() -> None: + endpoint = os.environ["AZURE_VOICE_AGENTS_ENDPOINT"] + model = os.environ.get("AZURE_VOICE_AGENTS_MODEL", "gpt-realtime") + agent_name = "sample-voice-agent" + + # Voice agent preview operations require this feature-flag opt-in. + preview: Final = AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW + + definition = VoiceAgentDefinition( + # `managed` uses a service-hosted model; use `self_deployed` with a Foundry + # deployment name to bring your own model. + model_type="managed", + model=model, + instructions="You are a friendly voice assistant. Keep replies short and natural.", + audio=VoiceAudioConfig( + output=VoiceAudioOutputConfig(voice=AzureStandardVoice(name="en-US-AvaNeural")), + ), + output_modalities=[VoiceOutputModality.AUDIO], + # Persist conversations so the transcript and audio can be read back later + # (see sample_read_conversation.py). Defaults to False, which stores nothing. + store=True, + ) + + with VoiceAgentsClient(endpoint=endpoint, credential=DefaultAzureCredential()) as client: + created = client.voice_agents.create_voice_agent( + name=agent_name, + definition=definition, + description="Created by the azure-ai-voiceagents sample.", + foundry_features=preview, + ) + print(f"Created voice agent: {created.name}") + + agent = client.voice_agents.get_voice_agent(agent_name, foundry_features=preview) + print(f"Retrieved voice agent: {agent.name}") + + print("Voice agents in this project:") + for item in client.voice_agents.list_voice_agents(foundry_features=preview): + print(f" - {item.name}") + + # Update the agent. Each update that changes the definition produces a new version. + # Preserve the audio and output-modality configuration from the original + # definition so the new version keeps the same voice behavior. + updated = client.voice_agents.update_voice_agent( + agent_name, + definition=VoiceAgentDefinition( + model_type="managed", + model=model, + instructions="You are a friendly voice assistant. Always greet the caller warmly.", + audio=definition.audio, + output_modalities=definition.output_modalities, + store=definition.store, + ), + description="Updated instructions.", + foundry_features=preview, + ) + print(f"Updated voice agent to version: {updated.versions.latest.version}") + + # Disable the agent so its endpoint rejects new requests, then re-enable it. + client.voice_agents.disable_voice_agent(agent_name, foundry_features=preview) + print("Disabled voice agent") + client.voice_agents.enable_voice_agent(agent_name, foundry_features=preview) + print("Enabled voice agent") + + client.voice_agents.delete_voice_agent(agent_name, foundry_features=preview) + print(f"Deleted voice agent: {agent_name}") + + +if __name__ == "__main__": + create_and_manage_voice_agent() diff --git a/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_create_and_manage_voice_agent_async.py b/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_create_and_manage_voice_agent_async.py new file mode 100644 index 000000000000..1599223f6e2f --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_create_and_manage_voice_agent_async.py @@ -0,0 +1,76 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- + +""" +FILE: sample_create_and_manage_voice_agent_async.py + +DESCRIPTION: + This sample demonstrates the voice-agent management lifecycle using the async + client: creating a voice agent, retrieving it, listing the agents in the + project, and deleting it. + +USAGE: + python sample_create_and_manage_voice_agent_async.py + + Set the environment variable before running the sample: + 1) AZURE_VOICE_AGENTS_ENDPOINT - the Foundry project endpoint, in the form + https://.services.ai.azure.com/api/projects/ + + Optional: + 2) AZURE_VOICE_AGENTS_MODEL - the realtime model deployment to use. + Defaults to "gpt-realtime". + + The sample authenticates with DefaultAzureCredential, so sign in first + (for example, with `az login`). An async HTTP transport such as aiohttp must + be installed (`pip install aiohttp`). +""" + +import asyncio +import os +from typing import Final + +from azure.identity.aio import DefaultAzureCredential + +from azure.ai.voiceagents.aio import VoiceAgentsClient +from azure.ai.voiceagents.models import AgentDefinitionOptInKeys, VoiceAgentDefinition + + +async def create_and_manage_voice_agent() -> None: + endpoint = os.environ["AZURE_VOICE_AGENTS_ENDPOINT"] + model = os.environ.get("AZURE_VOICE_AGENTS_MODEL", "gpt-realtime") + agent_name = "sample-voice-agent-async" + preview: Final = AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW + + async with DefaultAzureCredential() as credential, VoiceAgentsClient( + endpoint=endpoint, credential=credential + ) as client: + created = await client.voice_agents.create_voice_agent( + name=agent_name, + definition=VoiceAgentDefinition( + model_type="managed", + model=model, + instructions="You are a friendly voice assistant. Keep replies short and natural.", + # Persist conversations so they can be read back later. Defaults to False. + store=True, + ), + description="Created by the azure-ai-voiceagents async sample.", + foundry_features=preview, + ) + print(f"Created voice agent: {created.name}") + + agent = await client.voice_agents.get_voice_agent(agent_name, foundry_features=preview) + print(f"Retrieved voice agent: {agent.name}") + + print("Voice agents in this project:") + async for item in client.voice_agents.list_voice_agents(foundry_features=preview): + print(f" - {item.name}") + + await client.voice_agents.delete_voice_agent(agent_name, foundry_features=preview) + print(f"Deleted voice agent: {agent_name}") + + +if __name__ == "__main__": + asyncio.run(create_and_manage_voice_agent()) diff --git a/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_create_voice_agent_with_tools.py b/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_create_voice_agent_with_tools.py new file mode 100644 index 000000000000..946205a26c42 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_create_voice_agent_with_tools.py @@ -0,0 +1,162 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- + +""" +FILE: sample_create_voice_agent_with_tools.py + +DESCRIPTION: + This sample demonstrates the richer parts of a voice agent definition that the + basic create sample leaves out: + + * Input (microphone) audio configuration: audio format, server-side turn + detection (VAD), input-audio transcription, and noise reduction. + * Tools the agent may use during a live session: a client-executed `function` + tool, a service-managed `system` control tool, and (shown as constructed + objects) `mcp` and `toolbox` tools. + * Bring-your-own-model (BYOM): set `model_type="self_deployed"` to point the + agent at your own Foundry model deployment instead of a service-managed model. + + The tools and audio settings are session defaults baked into the agent; the live + realtime session that actually invokes them is reached through the + `client.realtime.connect(...)` namespace (see the live sample). + +USAGE: + python sample_create_voice_agent_with_tools.py + + Set these environment variables before running the sample: + 1) AZURE_VOICE_AGENTS_ENDPOINT - the Foundry project endpoint, in the form + https://.services.ai.azure.com/api/projects/ + 2) AZURE_VOICE_AGENTS_MODEL - optional. The realtime model (managed) or the + Foundry deployment name (BYOM). Defaults to "gpt-realtime". + 3) AZURE_VOICE_AGENTS_MODEL_TYPE - optional. "managed" (default) for a + service-hosted model, or "self_deployed" to bring your own deployment. + + The sample authenticates with DefaultAzureCredential, so sign in first + (for example, with `az login`). +""" + +import os +from typing import Any, Final, cast + +from azure.identity import DefaultAzureCredential + +from azure.ai.voiceagents import VoiceAgentsClient +from azure.ai.voiceagents.models import ( + AgentDefinitionOptInKeys, + AzureStandardVoice, + RealtimeFunctionTool, + VoiceAgentDefinition, + VoiceAgentMcpTool, + VoiceAudioConfig, + VoiceAudioFormat, + VoiceAudioInputConfig, + VoiceAudioOutputConfig, + VoiceInputTranscription, + VoiceModelType, + VoiceOutputModality, + VoiceServerVadTurnDetection, + VoiceSystemTool, + VoiceSystemToolName, + ToolType, + VoiceToolboxTool, +) + + +def create_voice_agent_with_tools() -> None: + endpoint = os.environ["AZURE_VOICE_AGENTS_ENDPOINT"] + model = os.environ.get("AZURE_VOICE_AGENTS_MODEL", "gpt-realtime") + # "managed" runs a service-hosted model; "self_deployed" (BYOM) uses your own + # Foundry deployment named by `model`. The service derives whether the model is + # realtime or cascaded; you don't set that here. + model_type = os.environ.get("AZURE_VOICE_AGENTS_MODEL_TYPE", VoiceModelType.MANAGED) + agent_name = "sample-voice-agent-with-tools" + + # Voice agent preview operations require this feature-flag opt-in. + preview: Final = AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW + + # A client-executed tool: the service forwards the function call to your app, + # and your app returns the result over the live session. + get_weather = RealtimeFunctionTool( + type="function", + name="get_weather", + description="Get the current weather for a city.", + parameters=cast(Any, { + "type": "object", + "properties": {"city": {"type": "string", "description": "City name, e.g. Seattle."}}, + "required": ["city"], + }), + ) + + # A service-managed control tool: the platform can end the call on the agent's behalf. + end_call = VoiceSystemTool(name=VoiceSystemToolName.END_CONVERSATION) + + # An MCP tool is executed by the service against a remote MCP server you own. + # It references an external server, so it is constructed here for illustration + # and not attached below. Provide one of server_url, connector_id, or tunnel_id. + _example_mcp_tool = VoiceAgentMcpTool( + type=ToolType.MCP, + server_label="my-mcp-server", + server_url="https://example.com/mcp", + require_approval="never", + ) + + # A toolbox tool references a versioned Foundry toolbox you have created. It is + # constructed here for illustration; attach it only if the toolbox exists. + _example_toolbox_tool = VoiceToolboxTool(toolbox_name="my-toolbox", toolbox_version="1") + + definition = VoiceAgentDefinition( + model_type=model_type, + model=model, + instructions="You are a helpful voice assistant. Use tools when they help answer the caller.", + audio=VoiceAudioConfig( + # Input (microphone) side: 24 kHz PCM, server-side VAD so the agent + # auto-responds when the caller stops speaking, plus input-audio + # transcription so user speech is transcribed. + input=VoiceAudioInputConfig( + format=VoiceAudioFormat(type="audio/pcm", rate=24000), + turn_detection=VoiceServerVadTurnDetection( + threshold=0.5, + prefix_padding_ms=300, + silence_duration_ms=500, + ), + transcription=VoiceInputTranscription(model="whisper-1"), + ), + # Output (agent speech) side: the voice the agent speaks with. Pass an + # AzureStandardVoice for an Azure neural voice, or a plain string such as + # "alloy" for a built-in OpenAI voice (realtime models only): + # output=VoiceAudioOutputConfig(voice="alloy"), + output=VoiceAudioOutputConfig(voice=AzureStandardVoice(name="en-US-AvaNeural")), + ), + output_modalities=[VoiceOutputModality.AUDIO], + # Attach the self-contained tools. `_example_mcp_tool` and `_example_toolbox_tool` + # reference external resources you must own, so they are left out here. + tools=[get_weather, end_call], + store=True, + ) + + with VoiceAgentsClient(endpoint=endpoint, credential=DefaultAzureCredential()) as client: + created = client.voice_agents.create_voice_agent( + name=agent_name, + definition=definition, + description="Voice agent with tools and input-audio config (azure-ai-voiceagents sample).", + foundry_features=preview, + ) + print(f"Created voice agent: {created.name} (model_type={model_type}, model={model})") + + agent = client.voice_agents.get_voice_agent(agent_name, foundry_features=preview) + tools = agent.versions.latest.definition.tools or [] + print(f"Configured {len(tools)} tool(s):") + for tool in tools: + # Tools belong to an open union, so on read they surface as mappings + # keyed by their wire fields (``type`` and, for most kinds, ``name``). + print(f" - {tool['type']}: {tool.get('name', '(unnamed)')}") + + client.voice_agents.delete_voice_agent(agent_name, foundry_features=preview) + print(f"Deleted voice agent: {agent_name}") + + +if __name__ == "__main__": + create_voice_agent_with_tools() diff --git a/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_generate_voice_agent.py b/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_generate_voice_agent.py new file mode 100644 index 000000000000..42639e720bd8 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_generate_voice_agent.py @@ -0,0 +1,64 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- + +""" +FILE: sample_generate_voice_agent.py + +DESCRIPTION: + This sample demonstrates guided authoring: generating and creating a voice + agent from a few high-level inputs plus a natural-language goal. The service + expands the goal into a full, editable definition, creates the agent, and + returns it. Every generated field can be refined afterward through the normal + update/version flow. + +USAGE: + python sample_generate_voice_agent.py + + Set the environment variable before running the sample: + 1) AZURE_VOICE_AGENTS_ENDPOINT - the Foundry project endpoint, in the form + https://.services.ai.azure.com/api/projects/ + + Optional: + 2) AZURE_VOICE_AGENTS_MODEL - the realtime model deployment to use. + Defaults to "gpt-realtime". + + The sample authenticates with DefaultAzureCredential, so sign in first + (for example, with `az login`). +""" + +import os +from typing import Final + +from azure.identity import DefaultAzureCredential + +from azure.ai.voiceagents import VoiceAgentsClient +from azure.ai.voiceagents.models import AgentDefinitionOptInKeys, VoiceAgentType, VoiceAgentUseCase + + +def generate_voice_agent() -> None: + endpoint = os.environ["AZURE_VOICE_AGENTS_ENDPOINT"] + model = os.environ.get("AZURE_VOICE_AGENTS_MODEL", "gpt-realtime") + preview: Final = AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW + + with VoiceAgentsClient(endpoint=endpoint, credential=DefaultAzureCredential()) as client: + agent = client.voice_agents.generate_voice_agent( + name="sample-generated-agent", + model_type="managed", + model=model, + agent_type=VoiceAgentType.BUSINESS, + use_case=VoiceAgentUseCase.CUSTOMER_SUPPORT, + goal="Help callers troubleshoot their internet connection and open a support ticket if needed.", + foundry_features=preview, + ) + print(f"Generated voice agent: {agent.name}") + print(f"Instructions:\n{agent.versions.latest.definition.instructions}") + + client.voice_agents.delete_voice_agent(agent.name, foundry_features=preview) + print(f"Deleted voice agent: {agent.name}") + + +if __name__ == "__main__": + generate_voice_agent() diff --git a/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_manage_voice_agent_versions.py b/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_manage_voice_agent_versions.py new file mode 100644 index 000000000000..fbbe7b3b8462 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_manage_voice_agent_versions.py @@ -0,0 +1,101 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- + +""" +FILE: sample_manage_voice_agent_versions.py + +DESCRIPTION: + This sample demonstrates working with voice-agent versions. Voice agents are + immutable: every create or update produces a new version. This sample creates + an agent, adds a new version to it, lists the versions, and reads a single + version back. + +USAGE: + python sample_manage_voice_agent_versions.py + + Set the environment variable before running the sample: + 1) AZURE_VOICE_AGENTS_ENDPOINT - the Foundry project endpoint, in the form + https://.services.ai.azure.com/api/projects/ + + Optional: + 2) AZURE_VOICE_AGENTS_MODEL - the realtime model deployment to use. + Defaults to "gpt-realtime". + + The sample authenticates with DefaultAzureCredential, so sign in first + (for example, with `az login`). +""" + +import os +from typing import Final + +from azure.identity import DefaultAzureCredential + +from azure.ai.voiceagents import VoiceAgentsClient +from azure.ai.voiceagents.models import AgentDefinitionOptInKeys, VoiceAgentDefinition + + +def manage_voice_agent_versions() -> None: + endpoint = os.environ["AZURE_VOICE_AGENTS_ENDPOINT"] + model = os.environ.get("AZURE_VOICE_AGENTS_MODEL", "gpt-realtime") + agent_name = "sample-versioned-voice-agent" + preview: Final = AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW + + def definition(instructions: str) -> VoiceAgentDefinition: + # Each version differs only by its instructions; the rest is identical. + return VoiceAgentDefinition(model_type="managed", model=model, instructions=instructions) + + with VoiceAgentsClient(endpoint=endpoint, credential=DefaultAzureCredential()) as client: + # Create the initial agent (this is version 1). + created = client.voice_agents.create_voice_agent( + name=agent_name, + definition=definition("You are a helpful voice assistant."), + foundry_features=preview, + ) + print(f"Created agent '{created.name}', latest version: {created.versions.latest.version}") + + # Create a new version with updated instructions. + new_version = client.voice_agents.create_voice_agent_version( + agent_name, + definition=definition("You are a helpful voice assistant. Always greet the caller by name."), + description="Added a personalized greeting.", + foundry_features=preview, + ) + print(f"Created new version: {new_version.version}") + + # Create a draft version. Drafts are recorded but excluded from the default + # 'latest' resolution and from version listings unless include_drafts=True. + draft_version = client.voice_agents.create_voice_agent_version( + agent_name, + definition=definition("You are a helpful voice assistant. Experimental draft persona."), + description="Candidate persona under review.", + draft=True, + foundry_features=preview, + ) + print(f"Created draft version: {draft_version.version}") + + # List released versions (drafts excluded by default). + print(f"Released versions of '{agent_name}':") + for version in client.voice_agents.list_voice_agent_versions(agent_name, foundry_features=preview): + print(f" - version {version.version} (created_at={version.created_at})") + + # List including drafts. + print(f"All versions of '{agent_name}' (including drafts):") + for version in client.voice_agents.list_voice_agent_versions( + agent_name, include_drafts=True, foundry_features=preview + ): + print(f" - version {version.version} (draft={version.draft})") + + # Read a single version back. + fetched = client.voice_agents.get_voice_agent_version(agent_name, new_version.version, foundry_features=preview) + print(f"Fetched version {fetched.version}: {fetched.definition.instructions}") + + # Clean up. + client.voice_agents.delete_voice_agent(agent_name, foundry_features=preview) + print(f"Deleted agent: {agent_name}") + + +if __name__ == "__main__": + manage_voice_agent_versions() diff --git a/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_read_conversation.py b/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_read_conversation.py new file mode 100644 index 000000000000..e86b3521aae9 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_read_conversation.py @@ -0,0 +1,103 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- + +""" +FILE: sample_read_conversation.py + +DESCRIPTION: + This sample demonstrates reading a persisted voice conversation back over the + read-only conversation API: the conversation envelope, its responses (model + inference turns), and its ordered items (the transcript). Conversations are + created and written by the voice orchestrator during a live session; this + client can only read them, and only when the agent was configured with + `store = true`. + +USAGE: + python sample_read_conversation.py + + Set these environment variables before running the sample: + 1) AZURE_VOICE_AGENTS_ENDPOINT - the Foundry project endpoint, in the form + https://.services.ai.azure.com/api/projects/ + 2) AZURE_VOICE_AGENTS_AGENT_NAME - the name of the voice agent. + 3) AZURE_VOICE_AGENTS_CONVERSATION_ID - the id of a persisted conversation + (captured from the `conversation.created` event during a live session). + + The sample authenticates with DefaultAzureCredential, so sign in first + (for example, with `az login`). +""" + +import os +from typing import Final + +from azure.core.exceptions import HttpResponseError +from azure.identity import DefaultAzureCredential + +from azure.ai.voiceagents import VoiceAgentsClient +from azure.ai.voiceagents.models import AgentDefinitionOptInKeys + + +def read_conversation() -> None: + endpoint = os.environ["AZURE_VOICE_AGENTS_ENDPOINT"] + agent_name = os.environ["AZURE_VOICE_AGENTS_AGENT_NAME"] + conversation_id = os.environ["AZURE_VOICE_AGENTS_CONVERSATION_ID"] + preview: Final = AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW + + with VoiceAgentsClient(endpoint=endpoint, credential=DefaultAzureCredential()) as client: + conversations = client.agent_endpoint_conversations + try: + # The conversation envelope: status, timestamps, aggregate usage. + conversation = conversations.get_agent_conversation(agent_name, conversation_id, foundry_features=preview) + print(f"Conversation {conversation.id}: status={conversation.status}, created_at={conversation.created_at}") + + # The responses (model inference turns) in the conversation. + print("Responses:") + for response in conversations.list_agent_conversation_responses( + agent_name, conversation_id, foundry_features=preview + ): + print(f" - {response.id}: status={response.status}") + + # Read a single response back, with its output and token usage. + detail = conversations.get_agent_conversation_response( + agent_name, conversation_id, response.id, foundry_features=preview + ) + print(f" usage={detail.usage}") + + # The items produced by this specific response. Conversation items + # belong to an open union, so on read they surface as mappings + # keyed by their wire fields (``type``, ``id``, ...). + for response_item in conversations.list_agent_conversation_response_items( + agent_name, conversation_id, response.id, foundry_features=preview + ): + print(f" item {response_item.get('type')} id={response_item.get('id')}") + + # The ordered conversation items -- the full transcript (user + assistant + tool events). + print("Items (transcript):") + for item in conversations.list_agent_conversation_items( + agent_name, conversation_id, foundry_features=preview + ): + item_id = item.get("id") + print(f" - {item.get('type')} id={item_id}") + + # Read a single item back by id. + if item_id: + single = conversations.get_agent_conversation_item( + agent_name, conversation_id, item_id, foundry_features=preview + ) + print(f" fetched item id={single.get('id')}") + + # Deleting a conversation removes it and all of its responses, items, and audio. + # This is destructive, so it is shown but not run by default. Uncomment to enable. + # deleted = conversations.delete_agent_conversation( + # agent_name, conversation_id, foundry_features=preview + # ) + # print(f"Deleted conversation {deleted.id}: deleted={deleted.deleted}") + except HttpResponseError as e: + # 404 typically means the conversation was not persisted (agent ran with `store = false`). + print(f"Service responded with an error: {e.status_code} {e.reason}") + + +if __name__ == "__main__": + read_conversation() diff --git a/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_read_conversation_audio.py b/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_read_conversation_audio.py new file mode 100644 index 000000000000..9dc60794e78f --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_read_conversation_audio.py @@ -0,0 +1,144 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- + +""" +FILE: sample_read_conversation_audio.py + +DESCRIPTION: + This sample demonstrates reading the persisted audio of a voice conversation, + both the merged whole-call recording and a single turn's audio segment. For + each it reads the metadata first, then streams the WAV bytes to a local file. + The merged recording is stereo: the caller on the left channel and the agent + on the right. + + Audio is available only after the session has ended and only when the agent + was configured with `store = true`. For bring-your-own-storage (BYOS) + accounts the metadata carries a `blob_uri` instead, and the bytes are read + from your own storage rather than streamed here. + +USAGE: + python sample_read_conversation_audio.py + + Set these environment variables before running the sample: + 1) AZURE_VOICE_AGENTS_ENDPOINT - the Foundry project endpoint, in the form + https://.services.ai.azure.com/api/projects/ + 2) AZURE_VOICE_AGENTS_AGENT_NAME - the name of the voice agent. + 3) AZURE_VOICE_AGENTS_CONVERSATION_ID - the id of a persisted conversation. + + The sample authenticates with DefaultAzureCredential, so sign in first + (for example, with `az login`). +""" + +import os +from typing import Final + +from azure.core.exceptions import HttpResponseError +from azure.identity import DefaultAzureCredential + +from azure.ai.voiceagents import VoiceAgentsClient +from azure.ai.voiceagents.models import AgentDefinitionOptInKeys + + +def read_conversation_audio() -> None: + endpoint = os.environ["AZURE_VOICE_AGENTS_ENDPOINT"] + agent_name = os.environ["AZURE_VOICE_AGENTS_AGENT_NAME"] + conversation_id = os.environ["AZURE_VOICE_AGENTS_CONVERSATION_ID"] + preview: Final = AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW + + with VoiceAgentsClient(endpoint=endpoint, credential=DefaultAzureCredential()) as client: + conversations = client.agent_endpoint_conversations + try: + read_merged_recording(conversations, agent_name, conversation_id, preview) + read_first_item_audio(conversations, agent_name, conversation_id, preview) + except HttpResponseError as e: + # 404: not persisted / not ready. 409: session still in progress. + print(f"Service responded with an error: {e.status_code} {e.reason}") + + +def stream_to_wav(stream, output_path) -> None: + """Write a streamed audio-content response to a local WAV file. + + :param stream: An iterable of audio byte chunks. + :param output_path: The local output path. + :type stream: collections.abc.Iterable[bytes] + :type output_path: str + """ + with open(output_path, "wb") as f: + for chunk in stream: + f.write(chunk) + print(f"Wrote {output_path}") + + +def read_merged_recording(conversations, agent_name, conversation_id, preview) -> None: + """Read the merged whole-call stereo recording (left=user, right=agent). + + :param conversations: The conversation operations client. + :param agent_name: The voice agent name. + :param conversation_id: The persisted conversation id. + :param preview: The preview feature opt-in value. + :type conversations: azure.ai.voiceagents.operations.AgentEndpointConversationsOperations + :type agent_name: str + :type conversation_id: str + :type preview: azure.ai.voiceagents.models.AgentDefinitionOptInKeys + """ + recording = conversations.get_agent_conversation_audio(agent_name, conversation_id, foundry_features=preview) + print( + f"Recording: format={recording.format}, sample_rate={recording.sample_rate}, " + f"channels={recording.channels}, duration_ms={recording.duration_ms}" + ) + + if recording.blob_uri: + # Bring-your-own-storage: download from your own storage using the returned URI. + print(f"Recording is stored in your own storage at: {recording.blob_uri}") + return + + # Foundry-managed storage: stream the bytes and write them to a local WAV file. + stream = conversations.get_agent_conversation_audio_content(agent_name, conversation_id, foundry_features=preview) + stream_to_wav(stream, f"{conversation_id}.wav") + + +def read_first_item_audio(conversations, agent_name, conversation_id, preview) -> None: + """Read the audio segment of the first conversation item that has one. + + :param conversations: The conversation operations client. + :param agent_name: The voice agent name. + :param conversation_id: The persisted conversation id. + :param preview: The preview feature opt-in value. + :type conversations: azure.ai.voiceagents.operations.AgentEndpointConversationsOperations + :type agent_name: str + :type conversation_id: str + :type preview: azure.ai.voiceagents.models.AgentDefinitionOptInKeys + """ + for item in conversations.list_agent_conversation_items(agent_name, conversation_id, foundry_features=preview): + item_id = item.get("id") + if not item_id: + continue + try: + metadata = conversations.get_agent_conversation_item_audio( + agent_name, conversation_id, item_id, foundry_features=preview + ) + except HttpResponseError as e: + # A 404 means this item has no persisted audio (for example, a text-only turn). + if e.status_code == 404: + continue + raise + + print(f"Item {item_id}: role={metadata.role}, duration_ms={metadata.duration_ms}") + if metadata.blob_uri: + print(f"Item audio is stored in your own storage at: {metadata.blob_uri}") + return + + stream = conversations.get_agent_conversation_item_audio_content( + agent_name, conversation_id, item_id, foundry_features=preview + ) + stream_to_wav(stream, f"{conversation_id}_{item_id}.wav") + return + + print("No conversation item with audio was found.") + + +if __name__ == "__main__": + read_conversation_audio() diff --git a/sdk/voiceagents/azure-ai-voiceagents/samples/quickstart/sample_quickstart_async.py b/sdk/voiceagents/azure-ai-voiceagents/samples/quickstart/sample_quickstart_async.py new file mode 100644 index 000000000000..058e8bc1ce71 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/samples/quickstart/sample_quickstart_async.py @@ -0,0 +1,226 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- + +""" +FILE: sample_quickstart_async.py + +DESCRIPTION: + Generate a temporary voice agent, start a live microphone/speaker realtime + conversation with it, then delete the agent when the sample exits. + + This is the shortest end-to-end path for trying voice agents with live audio: + management API for agent setup, realtime WebSocket API for the conversation. + + Requires ``pyaudio`` for microphone capture and speaker playback. + + pip install azure-ai-voiceagents azure-identity aiohttp pyaudio + +USAGE: + python sample_quickstart_async.py + + Environment variables: + 1) AZURE_VOICE_AGENTS_ENDPOINT (required) - Foundry project endpoint: + https://.services.ai.azure.com/api/projects/ + 2) AZURE_VOICE_AGENTS_MODEL (optional) - realtime model deployment name. + Defaults to "gpt-realtime". + + Runs until you press Ctrl-C. Authenticates with DefaultAzureCredential, so + sign in first (for example, with `az login`). +""" + +import asyncio +import os +import queue +import uuid +from typing import Any, Final, Optional + +from azure.core.exceptions import HttpResponseError +from azure.identity.aio import DefaultAzureCredential + +from azure.ai.voiceagents.aio import AsyncRealtimeConnection, VoiceAgentsClient +from azure.ai.voiceagents.models import ( + AgentDefinitionOptInKeys, + VoiceAgentType, + VoiceAgentUseCase, + VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted, + VoiceAgentServerEventError, + VoiceAgentServerEventInputAudioBufferSpeechStarted, + VoiceAgentServerEventResponseAudioDelta, + VoiceAgentServerEventResponseAudioTranscriptDone, + VoiceModelType, +) + +PREVIEW: Final = AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW +_SAMPLE_RATE: Final = 24000 +_CHUNK_SAMPLES: Final = 1200 + +try: + import pyaudio # type: ignore[import-not-found] +except ImportError: # pragma: no cover - required audio dependency + pyaudio: Any = None + + +class _AudioProcessor: + def __init__(self, connection: AsyncRealtimeConnection) -> None: + self._conn = connection + self._loop: Optional[asyncio.AbstractEventLoop] = None + self._audio = pyaudio.PyAudio() + self._playback_queue: "queue.Queue[tuple[int, Optional[bytes]]]" = queue.Queue() + self._playback_base = 0 + self._next_seq = 0 + self._input_stream = None + self._output_stream = None + + def start(self) -> None: + self._loop = asyncio.get_running_loop() + + def capture_callback(in_data, _frame_count, _time_info, _status): + assert self._loop is not None + asyncio.run_coroutine_threadsafe(self._conn.input_audio_buffer.append(audio=in_data), self._loop) + return (None, pyaudio.paContinue) + + self._input_stream = self._audio.open( + format=pyaudio.paInt16, + channels=1, + rate=_SAMPLE_RATE, + input=True, + frames_per_buffer=_CHUNK_SAMPLES, + stream_callback=capture_callback, + ) + + remaining = b"" + + def playback_callback(_in_data, frame_count, _time_info, _status): + nonlocal remaining + wanted = frame_count * pyaudio.get_sample_size(pyaudio.paInt16) + out = remaining[:wanted] + remaining = remaining[wanted:] + + while len(out) < wanted: + try: + seq, data = self._playback_queue.get_nowait() + except queue.Empty: + out += bytes(wanted - len(out)) + continue + if data is None: + break + if seq < self._playback_base: + remaining = b"" + continue + take = wanted - len(out) + out += data[:take] + remaining = data[take:] + + return (out, pyaudio.paContinue) + + self._output_stream = self._audio.open( + format=pyaudio.paInt16, + channels=1, + rate=_SAMPLE_RATE, + output=True, + frames_per_buffer=_CHUNK_SAMPLES, + stream_callback=playback_callback, + ) + + def queue_audio(self, pcm: bytes) -> None: + self._playback_queue.put((self._next_seq_num(), pcm)) + + def skip_pending_audio(self) -> None: + self._playback_base = self._next_seq_num() + + def close(self) -> None: + if self._input_stream is not None: + self._input_stream.stop_stream() + self._input_stream.close() + if self._output_stream is not None: + self.skip_pending_audio() + self._playback_queue.put((self._next_seq_num(), None)) + self._output_stream.stop_stream() + self._output_stream.close() + self._audio.terminate() + + def _next_seq_num(self) -> int: + seq = self._next_seq + self._next_seq += 1 + return seq + + +async def _generate_agent(client: VoiceAgentsClient, model: str) -> str: + agent_name = f"sample-quickstart-agent-{uuid.uuid4().hex[:8]}" + agent = await client.voice_agents.generate_voice_agent( + name=agent_name, + model_type=VoiceModelType.MANAGED, + model=model, + agent_type=VoiceAgentType.BUSINESS, + use_case=VoiceAgentUseCase.CUSTOMER_SUPPORT, + goal="Answer questions in a friendly voice. Keep replies short and natural.", + description="Temporary agent generated by the azure-ai-voiceagents quickstart.", + foundry_features=PREVIEW, + ) + print(f"Generated temporary voice agent: {agent.name}") + return agent.name + + +async def _delete_agent(client: VoiceAgentsClient, agent_name: str) -> None: + try: + await client.voice_agents.delete_voice_agent(agent_name, foundry_features=PREVIEW) + except HttpResponseError as exc: + if exc.response is None or exc.response.status_code != 200: + raise + print(f"Deleted temporary voice agent: {agent_name}") + + +async def _run_audio_session(client: VoiceAgentsClient, agent_name: str) -> None: + async with client.realtime.connect(agent_name=agent_name) as conn: + audio = _AudioProcessor(conn) + audio.start() + print("Speak now. Talk over the agent to interrupt it. Press Ctrl-C to stop.") + + try: + async for event in conn: + if isinstance(event, VoiceAgentServerEventInputAudioBufferSpeechStarted): + # Cancel the in-flight response before dropping audio that is + # still queued in the local speaker buffer. The service only + # supports output_audio_buffer.clear in avatar mode. + await conn.response.cancel() + audio.skip_pending_audio() + print("(listening...)") + elif isinstance(event, VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted): + print(f"You: {event.transcript.strip()}") + elif isinstance(event, VoiceAgentServerEventResponseAudioDelta): + audio.queue_audio(event.delta) + elif isinstance(event, VoiceAgentServerEventResponseAudioTranscriptDone): + print(f"Agent: {event.transcript}") + elif isinstance(event, VoiceAgentServerEventError): + print(f"Session error: {event.error.message}") + finally: + audio.close() + + +async def main() -> None: + if pyaudio is None: + print("This quickstart needs pyaudio for microphone and speaker audio: pip install pyaudio") + return + + endpoint = os.environ["AZURE_VOICE_AGENTS_ENDPOINT"] + model = os.environ.get("AZURE_VOICE_AGENTS_MODEL", "gpt-realtime") + agent_name: Optional[str] = None + + async with DefaultAzureCredential() as credential, VoiceAgentsClient( + endpoint=endpoint, credential=credential + ) as client: + try: + agent_name = await _generate_agent(client, model) + await _run_audio_session(client, agent_name) + except (KeyboardInterrupt, asyncio.CancelledError): + print("\nStopping quickstart...") + finally: + if agent_name is not None: + await _delete_agent(client, agent_name) + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/conftest.py b/sdk/voiceagents/azure-ai-voiceagents/tests/conftest.py new file mode 100644 index 000000000000..371671c2e8cd --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/tests/conftest.py @@ -0,0 +1,15 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +import pytest +from devtools_testutils import test_proxy # noqa: F401 pylint: disable=unused-import + + +@pytest.fixture(scope="session", autouse=True) +def start_proxy(test_proxy): # pylint: disable=redefined-outer-name + """Starts the test proxy server for the whole test session. + + See https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/tests.md + """ + return diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/live/conftest.py b/sdk/voiceagents/azure-ai-voiceagents/tests/live/conftest.py new file mode 100644 index 000000000000..ae8f36c9b21b --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/tests/live/conftest.py @@ -0,0 +1,17 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Overrides the parent (recorded-test) conftest for the live test suite. + +The live smoke test never goes through the test proxy (see test_smoke_live.py), +so it doesn't need the autouse ``start_proxy`` fixture from ../conftest.py. +This shadows that fixture so running ``pytest tests/live`` alone never tries +to download/start the proxy. +""" +import pytest + + +@pytest.fixture(scope="session", autouse=True) +def start_proxy(): + return diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/live/test_smoke_live.py b/sdk/voiceagents/azure-ai-voiceagents/tests/live/test_smoke_live.py new file mode 100644 index 000000000000..d869fd712ad0 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/tests/live/test_smoke_live.py @@ -0,0 +1,44 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""A single, minimal, always-live smoke test. + +Unlike the recorded suites, this test never plays back from a cassette -- it +always talks to the real service, to catch problems (auth, wire format, +serialization) that a recording could mask. It only exercises a safe, +side-effect-free read operation against a pre-existing voice agent so it can +be run repeatedly without needing cleanup. + +Run explicitly: + + $env:AZURE_TEST_RUN_LIVE = "true" + pytest tests/test_smoke_live.py -v +""" +import os + +import pytest +from azure.identity import DefaultAzureCredential + +from azure.ai.voiceagents import VoiceAgentsClient +from azure.ai.voiceagents.models import AgentDefinitionOptInKeys + +PREVIEW = AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW + +pytestmark = [ + pytest.mark.live_test_only, + pytest.mark.skipif( + os.environ.get("AZURE_TEST_RUN_LIVE", "false").lower() != "true", + reason="Live smoke test only runs when AZURE_TEST_RUN_LIVE=true.", + ), +] + + +def test_smoke_get_voice_agent(): + endpoint = os.environ["AZURE_VOICE_AGENTS_ENDPOINT"] + agent_name = os.environ["AZURE_VOICE_AGENTS_AGENT_NAME"] + + with DefaultAzureCredential() as credential, VoiceAgentsClient(endpoint=endpoint, credential=credential) as client: + agent = client.voice_agents.get_voice_agent(agent_name, foundry_features=PREVIEW) + + assert agent["name"] == agent_name diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/recording/_preparer.py b/sdk/voiceagents/azure-ai-voiceagents/tests/recording/_preparer.py new file mode 100644 index 000000000000..5a189f30208b --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/tests/recording/_preparer.py @@ -0,0 +1,26 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Shared fixtures for the recorded and live test suites in this package.""" +import functools + +from devtools_testutils import EnvironmentVariableLoader + +from azure.ai.voiceagents.models import AgentDefinitionOptInKeys + +# All voice agent operations currently require this preview feature opt-in. +PREVIEW = AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW + +# Loads the real environment variables in live mode, and sanitizes them to the +# values below when recording (so secrets/identifiers never end up in the +# checked-in cassette) and in playback (so recorded interactions can be +# matched). Kwarg names are uppercased to get the real environment variable +# name, e.g. azure_voice_agents_endpoint -> AZURE_VOICE_AGENTS_ENDPOINT. +VoiceAgentsPreparer = functools.partial( + EnvironmentVariableLoader, + "", + azure_voice_agents_endpoint="https://sanitized-account.services.ai.azure.com/api/projects/sanitized-project", + azure_voice_agents_agent_name="sanitized-agent-name", + azure_voice_agents_conversation_id="sanitized-conversation-id", +) diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/recording/conftest.py b/sdk/voiceagents/azure-ai-voiceagents/tests/recording/conftest.py new file mode 100644 index 000000000000..0aac7adf0b65 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/tests/recording/conftest.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Extra sanitization for this package's recordings. + +The test-proxy's default sanitizers redact the account-name portion of the +recorded request URI's host (e.g. "voice-live-tip-resource" -> "Sanitized"), +but they don't know about the Foundry project name embedded later in the +path ("/api/projects/{project-name}"). Without an explicit sanitizer for it, +the real project name would leak into the checked-in recording. This +sanitizer redacts that path segment regardless of what happens to the host. +""" +import pytest +from devtools_testutils import add_uri_regex_sanitizer, test_proxy # noqa: F401 pylint: disable=unused-import + + +@pytest.fixture(scope="session", autouse=True) +def add_project_name_sanitizer(test_proxy): # pylint: disable=redefined-outer-name + add_uri_regex_sanitizer(regex=r"/api/projects/[^/?]+", value="/api/projects/sanitized-project") diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client.py b/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client.py new file mode 100644 index 000000000000..4782f0c7aed0 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client.py @@ -0,0 +1,58 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Recorded functional tests for the sync VoiceAgentsClient. + +These exercise only read-only (GET/LIST) operations against a pre-existing +voice agent and a pre-existing, persisted conversation -- both supplied via +environment variables (see ../../samples/README.md). Agent/conversation creation +and deletion are intentionally out of scope: at the time this suite was +written, the create (expects 201) and delete (expects 204) operations did not +match what the live test service actually returns (200), so recording those +calls would bake an unrelated, known service issue into the checked-in +cassette. See /memories/repo notes for details. +""" +from devtools_testutils import AzureRecordedTestCase, recorded_by_proxy + +from azure.ai.voiceagents import VoiceAgentsClient + +from _preparer import PREVIEW, VoiceAgentsPreparer + + +class TestVoiceAgentsClient(AzureRecordedTestCase): + def create_client(self, endpoint: str) -> VoiceAgentsClient: + credential = self.get_credential(VoiceAgentsClient) + return self.create_client_from_credential(VoiceAgentsClient, credential=credential, endpoint=endpoint) + + @VoiceAgentsPreparer() + @recorded_by_proxy + def test_get_voice_agent(self, azure_voice_agents_endpoint, azure_voice_agents_agent_name): + with self.create_client(azure_voice_agents_endpoint) as client: + agent = client.voice_agents.get_voice_agent(azure_voice_agents_agent_name, foundry_features=PREVIEW) + + # NOTE: don't assert agent["name"]/["id"] against azure_voice_agents_agent_name -- + # the test-proxy's built-in default sanitizers always redact "id"/"name" body + # fields to a generic value in playback, regardless of our own sanitizers. + assert agent["object"] == "agent" + assert agent["state"] in ("enabled", "disabled") + + # NOTE: list_voice_agents is intentionally not recorded here. Against a shared + # test resource, it returns every agent's full definition (including real + # subscription IDs, resource groups, connection IDs, and other agents' + # instructions), which can't be generically sanitized. See the live smoke + # test / manual testing for that operation instead. + + @VoiceAgentsPreparer() + @recorded_by_proxy + def test_get_agent_conversation( + self, azure_voice_agents_endpoint, azure_voice_agents_agent_name, azure_voice_agents_conversation_id + ): + with self.create_client(azure_voice_agents_endpoint) as client: + conversation = client.agent_endpoint_conversations.get_agent_conversation( + azure_voice_agents_agent_name, azure_voice_agents_conversation_id, foundry_features=PREVIEW + ) + + # See the note in test_get_voice_agent about not asserting on "id"/"name". + assert conversation["object"] == "voice.conversation" + assert conversation["status"] is not None diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client_async.py b/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client_async.py new file mode 100644 index 000000000000..91df4889c03e --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client_async.py @@ -0,0 +1,50 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Recorded functional tests for the async VoiceAgentsClient. + +See test_voice_agents_client.py for why this suite is limited to GET/LIST +operations. +""" +from devtools_testutils import AzureRecordedTestCase +from devtools_testutils.aio import recorded_by_proxy_async + +from azure.ai.voiceagents.aio import VoiceAgentsClient + +from _preparer import PREVIEW, VoiceAgentsPreparer + + +class TestVoiceAgentsClientAsync(AzureRecordedTestCase): + def create_client(self, endpoint: str) -> VoiceAgentsClient: + credential = self.get_credential(VoiceAgentsClient, is_async=True) + return self.create_client_from_credential(VoiceAgentsClient, credential=credential, endpoint=endpoint) + + @VoiceAgentsPreparer() + @recorded_by_proxy_async + async def test_get_voice_agent(self, azure_voice_agents_endpoint, azure_voice_agents_agent_name): + async with self.create_client(azure_voice_agents_endpoint) as client: + agent = await client.voice_agents.get_voice_agent(azure_voice_agents_agent_name, foundry_features=PREVIEW) + + # NOTE: don't assert agent["name"]/["id"] against azure_voice_agents_agent_name -- + # the test-proxy's built-in default sanitizers always redact "id"/"name" body + # fields to a generic value in playback, regardless of our own sanitizers. + assert agent["object"] == "agent" + assert agent["state"] in ("enabled", "disabled") + + # NOTE: list_voice_agents is intentionally not recorded here -- see the + # comment in test_voice_agents_client.py for why. + + @VoiceAgentsPreparer() + @recorded_by_proxy_async + async def test_get_agent_conversation( + self, azure_voice_agents_endpoint, azure_voice_agents_agent_name, azure_voice_agents_conversation_id + ): + async with self.create_client(azure_voice_agents_endpoint) as client: + conversation = await client.agent_endpoint_conversations.get_agent_conversation( + azure_voice_agents_agent_name, azure_voice_agents_conversation_id, foundry_features=PREVIEW + ) + + # See the note in test_get_voice_agent about not asserting on "id"/"name". + assert conversation["object"] == "voice.conversation" + assert conversation["status"] is not None diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/unit/conftest.py b/sdk/voiceagents/azure-ai-voiceagents/tests/unit/conftest.py new file mode 100644 index 000000000000..3da6c4586041 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/tests/unit/conftest.py @@ -0,0 +1,17 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Overrides the parent (recorded-test) conftest for the unit test suite. + +Unit tests don't make any network calls, so they don't need the test-proxy +server that the recorded tests in the parent ``tests/`` directory start. This +fixture shadows the autouse ``start_proxy`` fixture from ../conftest.py so +running ``pytest tests/unit`` alone never tries to download/start the proxy. +""" +import pytest + + +@pytest.fixture(scope="session", autouse=True) +def start_proxy(): + return diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/unit/test_brotli_workaround.py b/sdk/voiceagents/azure-ai-voiceagents/tests/unit/test_brotli_workaround.py new file mode 100644 index 000000000000..0b689e1772c8 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/tests/unit/test_brotli_workaround.py @@ -0,0 +1,48 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Unit tests for the Brotli/aiohttp workaround in aio/_patch.py. No network calls. + +azure-core's AioHttpTransport disables aiohttp's native response decompression +and only re-implements gzip/deflate, while aiohttp advertises "Accept-Encoding: +br" by default. The async VoiceAgentsClient works around this by injecting its +own transport (unless the caller already supplied one) that only advertises +encodings azure-core can actually decompress. + +These tests must be `async def` because constructing the injected transport +builds an aiohttp.ClientSession, which requires a running event loop. +""" +import aiohttp +from azure.core.pipeline.transport import AioHttpTransport + +from azure.ai.voiceagents.aio import VoiceAgentsClient + +ENDPOINT = "https://example.services.ai.azure.com/api/projects/p" + + +class _FakeAsyncCredential: + async def get_token(self, *scopes, **kwargs): + raise NotImplementedError + + async def close(self): + pass + + +async def test_default_transport_only_advertises_gzip_deflate(): + async with VoiceAgentsClient(endpoint=ENDPOINT, credential=_FakeAsyncCredential()) as client: + transport = client._client._pipeline._transport + assert isinstance(transport, AioHttpTransport) + assert transport.session.headers.get("Accept-Encoding") == "gzip, deflate" + + +async def test_explicit_transport_bypasses_workaround(): + custom_session = aiohttp.ClientSession() + custom_transport = AioHttpTransport(session=custom_session) + try: + async with VoiceAgentsClient( + endpoint=ENDPOINT, credential=_FakeAsyncCredential(), transport=custom_transport + ) as client: + assert client._client._pipeline._transport is custom_transport + finally: + await custom_session.close() diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/unit/test_client_construction.py b/sdk/voiceagents/azure-ai-voiceagents/tests/unit/test_client_construction.py new file mode 100644 index 000000000000..5d8c7a0f1b44 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/tests/unit/test_client_construction.py @@ -0,0 +1,62 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Unit tests for sync/async client construction. No network calls. + +Note: constructing the async client requires a running event loop (it builds +an aiohttp.ClientSession by default -- see test_brotli_workaround.py), so the +async cases below are `async def` tests. +""" +from azure.ai.voiceagents import VoiceAgentsClient +from azure.ai.voiceagents.aio import VoiceAgentsClient as AsyncVoiceAgentsClient +from azure.ai.voiceagents.operations import ( + AgentEndpointConversationsOperations, + VoiceAgentsOperations, + VoiceAgentWebSocketOperations, +) + +ENDPOINT = "https://example.services.ai.azure.com/api/projects/p" + + +class _FakeCredential: + def get_token(self, *scopes, **kwargs): + raise NotImplementedError + + +class _FakeAsyncCredential: + async def get_token(self, *scopes, **kwargs): + raise NotImplementedError + + async def close(self): + pass + + +def test_sync_client_exposes_operation_groups(): + client = VoiceAgentsClient(endpoint=ENDPOINT, credential=_FakeCredential()) + try: + assert isinstance(client.voice_agents, VoiceAgentsOperations) + assert isinstance(client.agent_endpoint_conversations, AgentEndpointConversationsOperations) + assert isinstance(client.voice_agent_web_socket, VoiceAgentWebSocketOperations) + finally: + client.close() + + +def test_sync_client_is_a_context_manager(): + with VoiceAgentsClient(endpoint=ENDPOINT, credential=_FakeCredential()) as client: + assert client.voice_agents is not None + + +async def test_async_client_exposes_operation_groups(): + async with AsyncVoiceAgentsClient(endpoint=ENDPOINT, credential=_FakeAsyncCredential()) as client: + assert client.voice_agents is not None + assert client.agent_endpoint_conversations is not None + assert client.voice_agent_web_socket is not None + + +async def test_async_client_realtime_property_is_lazy_and_cached(): + async with AsyncVoiceAgentsClient(endpoint=ENDPOINT, credential=_FakeAsyncCredential()) as client: + assert client._realtime is None + realtime = client.realtime + assert realtime is not None + assert client.realtime is realtime # cached, not recreated on each access diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/unit/test_configuration.py b/sdk/voiceagents/azure-ai-voiceagents/tests/unit/test_configuration.py new file mode 100644 index 000000000000..56d2eb7cc2df --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/tests/unit/test_configuration.py @@ -0,0 +1,47 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Unit tests for VoiceAgentsClientConfiguration defaults. No network calls.""" +import pytest + +from azure.ai.voiceagents._configuration import VoiceAgentsClientConfiguration + +ENDPOINT = "https://example.services.ai.azure.com/api/projects/p" + + +class _FakeCredential: + def get_token(self, *scopes, **kwargs): + raise NotImplementedError + + +def test_default_api_version_is_v1(): + config = VoiceAgentsClientConfiguration(endpoint=ENDPOINT, credential=_FakeCredential()) + assert config.api_version == "v1" + + +def test_default_credential_scopes(): + config = VoiceAgentsClientConfiguration(endpoint=ENDPOINT, credential=_FakeCredential()) + assert config.credential_scopes == ["https://ai.azure.com/.default"] + + +def test_endpoint_and_credential_are_saved(): + credential = _FakeCredential() + config = VoiceAgentsClientConfiguration(endpoint=ENDPOINT, credential=credential) + assert config.endpoint == ENDPOINT + assert config.credential is credential + + +def test_endpoint_is_required(): + with pytest.raises(ValueError): + VoiceAgentsClientConfiguration(endpoint=None, credential=_FakeCredential()) + + +def test_credential_is_required(): + with pytest.raises(ValueError): + VoiceAgentsClientConfiguration(endpoint=ENDPOINT, credential=None) + + +def test_api_version_can_be_overridden(): + config = VoiceAgentsClientConfiguration(endpoint=ENDPOINT, credential=_FakeCredential(), api_version="v1") + assert config.api_version == "v1" diff --git a/sdk/voiceagents/azure-ai-voiceagents/tsp-location.yaml b/sdk/voiceagents/azure-ai-voiceagents/tsp-location.yaml new file mode 100644 index 000000000000..1ff0d06d4cdc --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/tsp-location.yaml @@ -0,0 +1,13 @@ +directory: specification/ai-foundry/data-plane/Foundry/src/sdk-python-azure-ai-voice-agents +commit: 708de4f80783992b0b9bce9394a0a9212bb14d40 +repo: yulin-li/azure-rest-api-specs +additionalDirectories: +- specification/ai-foundry/data-plane/Foundry/src/agents +- specification/ai-foundry/data-plane/Foundry/src/common +- specification/ai-foundry/data-plane/Foundry/src/memory-stores +- specification/ai-foundry/data-plane/Foundry/src/openai +- specification/ai-foundry/data-plane/Foundry/src/sdk-common +- specification/ai-foundry/data-plane/Foundry/src/skills +- specification/ai-foundry/data-plane/Foundry/src/tools +- specification/ai-foundry/data-plane/Foundry/src/toolboxes +- specification/ai-foundry/data-plane/Foundry/src/voice-agents From d90ef44f4271c4225a0aef57caed558e4a9484f6 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Thu, 6 Aug 2026 15:07:23 -0700 Subject: [PATCH 02/56] Fix voice agents validation issues --- .../azure/ai/voiceagents/_unions.py | 1 + .../azure/ai/voiceagents/aio/_realtime.py | 16 ++--- .../azure/ai/voiceagents/_configuration.py | 69 ------------------- .../sample_live_audio_conversation_async.py | 2 +- .../quickstart/sample_quickstart_async.py | 2 +- sdk/voiceagents/cspell.yaml | 9 +++ 6 files changed, 20 insertions(+), 79 deletions(-) delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure_ai_voiceagents-1.0.0b1/azure/ai/voiceagents/_configuration.py create mode 100644 sdk/voiceagents/cspell.yaml diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_unions.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_unions.py index 413865ae5ded..04c172967099 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_unions.py +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_unions.py @@ -9,6 +9,7 @@ from typing import Literal, TYPE_CHECKING, Union if TYPE_CHECKING: + from . import _unions as _unions from . import models as _models VoiceResponseVoice = Union["_models.OpenAIVoice", "_models.AzureVoice", "_models.AzureRealtimeNativeVoice"] VoiceAgentVoice = Union["_models.OpenAIVoice", "_models.AzureVoice", "_models.AzureRealtimeNativeVoice"] diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_realtime.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_realtime.py index 49f64289653a..2eb611b3fd04 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_realtime.py +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_realtime.py @@ -32,7 +32,7 @@ import base64 import json -from typing import Any, AsyncIterator, Dict, List, Mapping, Optional, Type, TYPE_CHECKING, Union +from typing import Any, AsyncIterator, cast, Dict, List, Mapping, Optional, Type, TYPE_CHECKING, Union from .. import models as _models from .._utils.model_base import Model as _Model, SdkJSONEncoder @@ -268,9 +268,9 @@ async def update( :paramtype event_id: str or None """ await self._send( - _models.VoiceAgentClientEventSessionUpdate( + cast(Any, _models.VoiceAgentClientEventSessionUpdate)( type=_models.RealtimeClientEventType.SESSION_UPDATE, - session=session, # type: ignore[arg-type] + session=session, event_id=event_id, ) ) @@ -373,9 +373,9 @@ async def create( :paramtype event_id: str or None """ await self._send( - _models.VoiceAgentClientEventConversationItemCreate( + cast(Any, _models.VoiceAgentClientEventConversationItemCreate)( type=_models.RealtimeClientEventType.CONVERSATION_ITEM_CREATE, - item=item, # type: ignore[arg-type] + item=item, previous_item_id=previous_item_id, event_id=event_id, ) @@ -454,9 +454,9 @@ async def create( :paramtype event_id: str or None """ await self._send( - _models.VoiceAgentClientEventResponseCreate( + cast(Any, _models.VoiceAgentClientEventResponseCreate)( type=_models.RealtimeClientEventType.RESPONSE_CREATE, - response=response, # type: ignore[arg-type] + response=response, event_id=event_id, ) ) @@ -655,7 +655,7 @@ async def enter(self) -> AsyncRealtimeConnection: # pylint: disable=too-many-lo except BaseException: await session.close() raise - self._connection = AsyncRealtimeConnection(connection, session) + self._connection = AsyncRealtimeConnection(cast("ClientWebSocketResponse", connection), session) return self._connection async def __aexit__(self, *exc_details: Any) -> None: diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure_ai_voiceagents-1.0.0b1/azure/ai/voiceagents/_configuration.py b/sdk/voiceagents/azure-ai-voiceagents/azure_ai_voiceagents-1.0.0b1/azure/ai/voiceagents/_configuration.py deleted file mode 100644 index 6f48c8a3aec0..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/azure_ai_voiceagents-1.0.0b1/azure/ai/voiceagents/_configuration.py +++ /dev/null @@ -1,69 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.pipeline import policies - -from ._version import VERSION - -if TYPE_CHECKING: - from azure.core.credentials import TokenCredential - - -class VoiceAgentsClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only - """Configuration for VoiceAgentsClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param endpoint: Foundry Project endpoint in the form - "https://{ai-services-account-name}.services.ai.azure.com/api/projects/{project-name}". If you - only have one Project in your Foundry Hub, or to target the default Project in your Hub, use - the form "https://{ai-services-account-name}.services.ai.azure.com/api/projects/_project". - Required. - :type endpoint: str - :param credential: Credential used to authenticate requests to the service. Required. - :type credential: ~azure.core.credentials.TokenCredential - :keyword api_version: The API version to use for this operation. Known values are "v1" and - None. Default value is None. If not set, the operation's default API version will be used. Note - that overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "v1") - - if endpoint is None: - raise ValueError("Parameter 'endpoint' must not be None.") - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - - self.endpoint = endpoint - self.credential = credential - self.api_version = api_version - self.credential_scopes = kwargs.pop("credential_scopes", ["https://ai.azure.com/.default"]) - kwargs.setdefault("sdk_moniker", "ai-voiceagents/{}".format(VERSION)) - self.polling_interval = kwargs.get("polling_interval", 30) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = policies.BearerTokenCredentialPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/voiceagents/azure-ai-voiceagents/samples/live/sample_live_audio_conversation_async.py b/sdk/voiceagents/azure-ai-voiceagents/samples/live/sample_live_audio_conversation_async.py index 8192e9e626c6..a6db0f95eb7e 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/samples/live/sample_live_audio_conversation_async.py +++ b/sdk/voiceagents/azure-ai-voiceagents/samples/live/sample_live_audio_conversation_async.py @@ -72,7 +72,7 @@ try: import pyaudio # type: ignore[import-not-found] except ImportError: # pragma: no cover - required audio dependency - pyaudio: Any = None + pyaudio: Any = None # type: ignore[no-redef] class _AudioProcessor: diff --git a/sdk/voiceagents/azure-ai-voiceagents/samples/quickstart/sample_quickstart_async.py b/sdk/voiceagents/azure-ai-voiceagents/samples/quickstart/sample_quickstart_async.py index 058e8bc1ce71..dfa465d81ce8 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/samples/quickstart/sample_quickstart_async.py +++ b/sdk/voiceagents/azure-ai-voiceagents/samples/quickstart/sample_quickstart_async.py @@ -60,7 +60,7 @@ try: import pyaudio # type: ignore[import-not-found] except ImportError: # pragma: no cover - required audio dependency - pyaudio: Any = None + pyaudio: Any = None # type: ignore[no-redef] class _AudioProcessor: diff --git a/sdk/voiceagents/cspell.yaml b/sdk/voiceagents/cspell.yaml new file mode 100644 index 000000000000..9c5eae99e399 --- /dev/null +++ b/sdk/voiceagents/cspell.yaml @@ -0,0 +1,9 @@ +# cspell configuration for this service. Words are case-insensitive and +# kept sorted alphabetically. The import of the central config is required. +import: + - ../../.vscode/cspell.json +words: + - pyaudio + - realtime + - vad + - viseme From ff732a1a5f2ee224d9ec35fe2e3efb321b9ebd60 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Thu, 6 Aug 2026 15:17:57 -0700 Subject: [PATCH 03/56] Address voice agents PR review comments --- .../azure-ai-voiceagents/CHANGELOG.md | 4 +- .../azure-ai-voiceagents/README.md | 89 +++++++++++-------- .../azure/ai/voiceagents/_unions.py | 4 +- .../azure/ai/voiceagents/aio/_realtime.py | 1 + 4 files changed, 55 insertions(+), 43 deletions(-) diff --git a/sdk/voiceagents/azure-ai-voiceagents/CHANGELOG.md b/sdk/voiceagents/azure-ai-voiceagents/CHANGELOG.md index b957b2575b48..d5783dcd33e6 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/CHANGELOG.md +++ b/sdk/voiceagents/azure-ai-voiceagents/CHANGELOG.md @@ -1,7 +1,7 @@ # Release History -## 1.0.0b1 (1970-01-01) +## 1.0.0b1 (2026-08-06) ### Other Changes - - Initial version \ No newline at end of file +- Initial version diff --git a/sdk/voiceagents/azure-ai-voiceagents/README.md b/sdk/voiceagents/azure-ai-voiceagents/README.md index 87782cb70376..f889d2310d8b 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/README.md +++ b/sdk/voiceagents/azure-ai-voiceagents/README.md @@ -1,5 +1,15 @@ -# Azure Ai Voiceagents client library for Python - +# Azure AI Voice Agents client library for Python + +The Azure AI Voice Agents client library provides APIs for creating and managing +voice agents in an Azure AI Foundry project, reading persisted voice +conversations, and connecting to a voice agent over a realtime WebSocket session. + +Use this package to: + +- Generate or create voice agents with model, instruction, voice, and tool settings. +- Manage voice agent versions and operational state. +- Stream live microphone audio to an existing voice agent and receive spoken responses. +- Read persisted conversation transcripts and audio when an agent is configured to store them. ## Getting started @@ -9,58 +19,61 @@ python -m pip install azure-ai-voiceagents ``` -#### Prequisites +### Prerequisites - Python 3.10 or later is required to use this package. -- You need an [Azure subscription][azure_sub] to use this package. -- An existing Azure Ai Voiceagents instance. - -### Use with AI tools - -AI coding tools such as VS Code and GitHub Copilot can help you write and debug code that uses this library. See [Using the Azure SDK for Python with AI tools](https://aka.ms/azsdk/python/ai) for available integrations. - -#### Create with an Azure Active Directory Credential -To use an [Azure Active Directory (AAD) token credential][authenticate_with_token], -provide an instance of the desired credential type obtained from the -[azure-identity][azure_identity_credentials] library. - -To authenticate with AAD, you must first [pip][pip] install [`azure-identity`][azure_identity_pip] +- You need an [Azure subscription][azure_sub]. +- You need an Azure AI Foundry project endpoint, for example + `https://.services.ai.azure.com/api/projects/`. +- For Microsoft Entra ID authentication, install [`azure-identity`][azure_identity_pip]. +- For realtime async WebSocket sessions, install an async transport such as `aiohttp`. -After setup, you can choose which type of [credential][azure_identity_credentials] from azure.identity to use. -As an example, [DefaultAzureCredential][default_azure_credential] can be used to authenticate the client: +### Authenticate the client -Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: -`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET` - -Use the returned token credential to authenticate the client: +The client supports token credentials from the +[`azure-identity`][azure_identity_credentials] library. For example, +[`DefaultAzureCredential`][default_azure_credential] can authenticate from your +developer environment or configured application identity. ```python ->>> from azure.ai.voiceagents import VoiceAgentsClient ->>> from azure.identity import DefaultAzureCredential ->>> client = VoiceAgentsClient(endpoint='', credential=DefaultAzureCredential()) +from azure.ai.voiceagents import VoiceAgentsClient +from azure.identity import DefaultAzureCredential + +client = VoiceAgentsClient( + endpoint="https://.services.ai.azure.com/api/projects/", + credential=DefaultAzureCredential(), +) ``` ## Examples -```python ->>> from azure.ai.voiceagents import VoiceAgentsClient ->>> from azure.identity import DefaultAzureCredential ->>> from azure.core.exceptions import HttpResponseError - ->>> client = VoiceAgentsClient(endpoint='', credential=DefaultAzureCredential()) ->>> try: - - except HttpResponseError as e: - print('service responds error: {}'.format(e.response.json())) +Create a voice agents client and list the voice agents in a project: +```python +from azure.ai.voiceagents import VoiceAgentsClient +from azure.ai.voiceagents.models import AgentDefinitionOptInKeys +from azure.identity import DefaultAzureCredential + +client = VoiceAgentsClient( + endpoint="https://.services.ai.azure.com/api/projects/", + credential=DefaultAzureCredential(), +) + +for agent in client.voice_agents.list_voice_agents( + foundry_features=AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW +): + print(agent.name) ``` +See the [samples](samples/README.md) directory for management, quickstart, and +realtime conversation examples. + ## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. -For details, visit https://cla.microsoft.com. +For details, visit . When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, @@ -69,14 +82,12 @@ need to do this once across all repos using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information, -see the Code of Conduct FAQ or contact opencode@microsoft.com with any +see the Code of Conduct FAQ or contact with any additional questions or comments. [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ -[authenticate_with_token]: https://docs.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token [azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#credentials [azure_identity_pip]: https://pypi.org/project/azure-identity/ [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential -[pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_unions.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_unions.py index 04c172967099..62e6b75a05c2 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_unions.py +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_unions.py @@ -24,7 +24,7 @@ "_models.RealtimeConversationItemFunctionCallOutput", ] VoiceAgentCreateConversationItem = Union[ - "_unions.VoiceAgentRequestConversationItem", "_models.RealtimeMCPApprovalResponse" + "VoiceAgentRequestConversationItem", "_models.RealtimeMCPApprovalResponse" ] VoiceAgentInterimResponse = Union[ "_models.VoiceAgentStaticInterimResponseConfig", "_models.VoiceAgentLlmInterimResponseConfig" @@ -56,7 +56,7 @@ ] VoiceAgentFileSearchAttributeValue = Union[str, float, bool] VoiceAgentResponseItem = Union[ - "_unions.VoiceAgentResponseMessageItem", + "VoiceAgentResponseMessageItem", "_models.VoiceFunctionCallItem", "_models.VoiceFunctionCallOutputItem", "_models.VoiceMcpListToolsItem", diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_realtime.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_realtime.py index 2eb611b3fd04..291cdc3ffe5b 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_realtime.py +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_realtime.py @@ -65,6 +65,7 @@ _models.VoiceAgentClientEventResponseCreate, _models.VoiceAgentClientEventSessionAvatarConnect, _models.VoiceAgentClientEventSessionUpdate, + str, Mapping[str, Any], ] From 89690935d0e434fe1e3441fda7210c20056cac9b Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Thu, 6 Aug 2026 16:30:04 -0700 Subject: [PATCH 04/56] Add voice agents recording and live coverage --- .../azure-ai-voiceagents/assets.json | 4 +- .../azure-ai-voiceagents/test-resources.json | 566 ++++++++++++++++++ .../tests/live/test_smoke_live.py | 44 -- .../live/test_voice_agents_management.py | 101 ++++ .../tests/live/test_voice_agents_realtime.py | 83 +++ .../recording/test_voice_agents_client.py | 42 ++ .../test_voice_agents_client_async.py | 44 ++ sdk/voiceagents/ci.yml | 37 ++ sdk/voiceagents/tests.yml | 6 + 9 files changed, 881 insertions(+), 46 deletions(-) create mode 100644 sdk/voiceagents/azure-ai-voiceagents/test-resources.json delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/tests/live/test_smoke_live.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/tests/live/test_voice_agents_management.py create mode 100644 sdk/voiceagents/azure-ai-voiceagents/tests/live/test_voice_agents_realtime.py create mode 100644 sdk/voiceagents/ci.yml create mode 100644 sdk/voiceagents/tests.yml diff --git a/sdk/voiceagents/azure-ai-voiceagents/assets.json b/sdk/voiceagents/azure-ai-voiceagents/assets.json index dfa38fec545d..3f1be8a01b32 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/assets.json +++ b/sdk/voiceagents/azure-ai-voiceagents/assets.json @@ -1,6 +1,6 @@ { "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "python", - "TagPrefix": "python/ai/azure-ai-voiceagents", - "Tag": "python/ai/azure-ai-voiceagents_367084ae9e" + "TagPrefix": "python/voiceagents/azure-ai-voiceagents", + "Tag": "python/voiceagents/azure-ai-voiceagents_fe28a40ed9" } diff --git a/sdk/voiceagents/azure-ai-voiceagents/test-resources.json b/sdk/voiceagents/azure-ai-voiceagents/test-resources.json new file mode 100644 index 000000000000..e3ca8f7e7422 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/test-resources.json @@ -0,0 +1,566 @@ +{ + "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "baseName": { + "type": "string", + "defaultValue": "[resourceGroup().name]", + "metadata": { + "description": "The base resource name for AI Services." + } + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]", + "metadata": { + "description": "The location of the resource. By default, this is the same as the resource group." + } + }, + "tenantId": { + "type": "string", + "defaultValue": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "metadata": { + "description": "The tenant ID to which the application and resources belong." + } + }, + "testApplicationOid": { + "type": "string", + "defaultValue": "b3653439-8136-4cd5-aac3-2a9460871ca6", + "metadata": { + "description": "The client OID to grant access to test resources." + } + }, + "tagValues": { + "type": "object", + "defaultValue": {} + }, + "allowProjectManagement": { + "type": "bool", + "defaultValue": true + }, + "virtualNetworkType": { + "type": "string", + "defaultValue": "None" + }, + "vnet": { + "type": "object", + "defaultValue": {} + }, + "ipRules": { + "type": "array", + "defaultValue": [] + }, + "privateEndpoints": { + "type": "array", + "defaultValue": [] + }, + "privateDnsZone": { + "type": "string", + "defaultValue": "privatelink.aiservices.azure.com" + }, + "resourceGroupName": { + "type": "string", + "defaultValue": "[resourceGroup().name]" + }, + "resourceGroupId": { + "type": "string", + "defaultValue": "[resourceGroup().id]" + }, + "uniqueId": { + "type": "string", + "defaultValue": "[newGuid()]" + }, + "defaultProjectName": { + "type": "string", + "defaultValue": "[concat(toLower(parameters('baseName')), '-ai-defaultproject')]" + }, + "identity": { + "type": "object", + "defaultValue": { + "type": "SystemAssigned" + } + }, + "userAssignedIdentityName": { + "type": "string", + "defaultValue": "" + }, + "userIdentityResourceGroupName": { + "type": "string", + "defaultValue": "" + }, + "identityType": { + "type": "string", + "defaultValue": "SystemAssigned" + }, + "encryption_status": { + "type": "string", + "defaultValue": " " + }, + "cmk_keyvault": { + "type": "string", + "defaultValue": "" + }, + "resource_cmk_uri": { + "type": "string", + "defaultValue": "" + }, + "userAssignedIdentityId": { + "type": "string", + "defaultValue": "" + }, + "keyVaultName": { + "type": "string", + "defaultValue": "" + }, + "keyVaultLocation": { + "type": "string", + "defaultValue": "" + }, + "keyVaultResourceGroupName": { + "type": "string", + "defaultValue": "" + }, + "keyVersion": { + "type": "string", + "defaultValue": "" + }, + "keyName": { + "type": "string", + "defaultValue": "" + }, + "hasRoleAssignment": { + "type": "bool", + "defaultValue": false + }, + "roleDefinitionId": { + "type": "string", + "defaultValue": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '53ca6127-db72-4b80-b1b0-d745d6d5456d')]" + }, + "enableRbac": { + "type": "bool", + "defaultValue": false + }, + "cryptoUserRoleAssignmentName": { + "type": "string", + "defaultValue": "[guid(concat(parameters('cmk_keyvault'), 'KeyVaultCryptoUser'))]" + } + }, + "variables": { + "aiServicesName": "[concat(parameters('baseName'), '-ai')]" + }, + "resources": [ + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2017-05-10", + "name": "deployVnet", + "properties": { + "mode": "Incremental", + "template": { + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": {}, + "variables": {}, + "resources": [ + { + "type": "Microsoft.Network/virtualNetworks", + "apiVersion": "2020-04-01", + "name": "[if(equals(parameters('virtualNetworkType'), 'External'), parameters('vnet').name, variables('defaultVNetName'))]", + "location": "[parameters('location')]", + "properties": { + "addressSpace": { + "addressPrefixes": "[if(equals(parameters('virtualNetworkType'), 'External'), parameters('vnet').addressPrefixes, json(concat('[{\"', variables('defaultAddressPrefix'),'\"}]')))]" + }, + "subnets": [ + { + "name": "[if(equals(parameters('virtualNetworkType'), 'External'), parameters('vnet').subnets.subnet.name, variables('defaultSubnetName'))]", + "properties": { + "serviceEndpoints": [ + { + "service": "Microsoft.CognitiveServices", + "locations": [ + "[parameters('location')]" + ] + } + ], + "addressPrefix": "[if(equals(parameters('virtualNetworkType'), 'External'), parameters('vnet').subnets.subnet.addressPrefix, variables('defaultAddressPrefix'))]" + } + } + ] + } + } + ] + }, + "parameters": {} + }, + "condition": "[and(and(not(empty(parameters('vnet'))), equals(parameters('vnet').newOrExisting, 'new')), equals(parameters('virtualNetworkType'), 'External'))]" + }, + { + "apiVersion": "2025-04-01-preview", + "name": "[variables('aiServicesName')]", + "location": "[parameters('location')]", + "type": "Microsoft.CognitiveServices/accounts", + "kind": "AIServices", + "sku": { + "name": "S0" + }, + "identity": "[parameters('identity')]", + "tags": "[if(contains(parameters('tagValues'), 'Microsoft.CognitiveServices/accounts'), parameters('tagValues')['Microsoft.CognitiveServices/accounts'], json('{}'))]", + "properties": { + "customSubDomainName": "[toLower(variables('aiServicesName'))]", + "defaultProjectName": "[toLower(variables('aiServicesName'))]", + "publicNetworkAccess": "[if(equals(parameters('virtualNetworkType'), 'Internal'), 'Disabled', 'Enabled')]", + "networkAcls": { + "defaultAction": "[if(equals(parameters('virtualNetworkType'), 'External'), 'Deny', 'Allow')]", + "virtualNetworkRules": "[if(equals(parameters('virtualNetworkType'), 'External'), json(concat('[{\"id\": \"', concat(subscription().id, '/resourceGroups/', parameters('vnet').resourceGroup, '/providers/Microsoft.Network/virtualNetworks/', parameters('vnet').name, '/subnets/', parameters('vnet').subnets.subnet.name), '\"}]')), json('[]'))]", + "ipRules": "[if(or(empty(parameters('ipRules')), empty(parameters('ipRules')[0].value)), json('[]'), parameters('ipRules'))]" + }, + "identity": "[parameters('identity')]", + "userAssignedIdentityName": "[if(equals(parameters('identity').type, 'UserAssigned'), parameters('userAssignedIdentityName'), json('null'))]", + "userIdentityResourceGroupName": "[if(equals(parameters('identity').type, 'UserAssigned'), parameters('userIdentityResourceGroupName'), json('null'))]", + "encryption_status": "[parameters('encryption_status')]", + "keyVaultName": "[parameters('keyVaultName')]", + "keyVaultLocation": "[parameters('keyVaultLocation')]", + "keyVaultResourceGroupName": "[parameters('keyVaultResourceGroupName')]", + "cmk_keyvault": "[parameters('cmk_keyvault')]", + "resource_cmk_uri": "[parameters('resource_cmk_uri')]", + "keyVersion": "[parameters('keyVersion')]", + "allowProjectManagement": "[parameters('allowProjectManagement')]" + }, + "resources": [ + { + "type": "projects", + "apiVersion": "2025-04-01-preview", + "name": "[parameters('defaultProjectName')]", + "location": "[parameters('location')]", + "identity": { + "type": "SystemAssigned" + }, + "sku": { + "name": "S0" + }, + "properties": { + "displayName": "[parameters('defaultProjectName')]", + "description": "Default project created with the resource" + }, + "dependsOn": [ + "[resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName'))]" + ] + } + ], + "dependsOn": [ + "[concat('Microsoft.Resources/deployments/', 'deployVnet')]" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "name": "[concat('patchAccessPolicy-', parameters('keyVaultName'))]", + "apiVersion": "2021-04-01", + "condition": "[and(equals(parameters('enableRbac'), bool('false')), equals(parameters('encryption_status'), 'Enabled'))]", + "resourceGroup": "[parameters('keyVaultResourceGroupName')]", + "properties": { + "mode": "Incremental", + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "resources": [ + { + "type": "Microsoft.KeyVault/vaults/accessPolicies", + "apiVersion": "2019-09-01", + "name": "[concat(parameters('keyVaultName'), '/add')]", + "properties": { + "accessPolicies": [ + { + "tenantId": "[subscription().tenantId]", + "objectId": "[reference(resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName')), '2025-04-01-preview', 'Full').identity.principalId]", + "permissions": { + "keys": [ + "get", + "wrapKey", + "unwrapKey" + ] + } + } + ] + } + } + ] + } + }, + "dependsOn": [ + "[resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName'))]" + ] + }, + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2022-04-01", + "name": "[guid(concat(parameters('cmk_keyvault'), '-', variables('aiServicesName'), 'KeyVaultCryptoUser'))]", + "scope": "[parameters('cmk_keyvault')]", + "condition": "[and(equals(parameters('hasRoleAssignment'), bool('true')), equals(parameters('enableRbac'), bool('true')))]", + "properties": { + "roleDefinitionId": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '14b46e9e-c2b7-41b4-b07b-48a6ebf60603')]", + "principalId": "[reference(resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName')), '2025-04-01-preview', 'Full').identity.principalId]" + }, + "dependsOn": [ + "[resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName'))]" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2021-04-01", + "name": "patchCMKEncryption", + "condition": "[and(equals(parameters('enableRbac'), bool('false')), equals(parameters('encryption_status'), 'Enabled'))]", + "dependsOn": [ + "[concat('patchAccessPolicy-', parameters('keyVaultName'))]" + ], + "properties": { + "mode": "Incremental", + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "resources": [ + { + "type": "Microsoft.CognitiveServices/accounts", + "apiVersion": "2025-04-01-preview", + "name": "[variables('aiServicesName')]", + "location": "[parameters('location')]", + "kind": "AIServices", + "sku": { + "name": "S0" + }, + "properties": { + "customSubDomainName": "[toLower(variables('aiServicesName'))]", + "publicNetworkAccess": "[if(equals(parameters('virtualNetworkType'), 'Internal'), 'Disabled', 'Enabled')]", + "networkAcls": { + "defaultAction": "[if(equals(parameters('virtualNetworkType'), 'External'), 'Deny', 'Allow')]", + "virtualNetworkRules": [], + "ipRules": [] + }, + "encryption": { + "status": "[parameters('encryption_status')]", + "keySource": "Microsoft.Keyvault", + "keyVaultProperties": { + "keyName": "[parameters('keyName')]", + "keyVersion": "[parameters('keyVersion')]", + "keyVaultUri": "[reference(parameters('cmk_keyvault'), '2021-04-01-preview').vaultUri]", + "identityClientId": "[json('null')]" + } + } + } + } + ] + } + } + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2021-04-01", + "name": "patchCMKEncryptionWithRbac", + "condition": "[and(equals(parameters('enableRbac'), bool('true')), equals(parameters('encryption_status'), 'Enabled'))]", + "dependsOn": [ + "[resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName'))]", + "[concat('Microsoft.KeyVault/vaults/', parameters('keyVaultName'), '/providers/Microsoft.Authorization/roleAssignments/', guid(concat(parameters('cmk_keyvault'), '-', variables('aiServicesName'), 'KeyVaultCryptoUser')))]" + ], + "properties": { + "mode": "Incremental", + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "resources": [ + { + "type": "Microsoft.CognitiveServices/accounts", + "apiVersion": "2025-04-01-preview", + "name": "[variables('aiServicesName')]", + "location": "[parameters('location')]", + "kind": "AIServices", + "sku": { + "name": "S0" + }, + "properties": { + "customSubDomainName": "[toLower(variables('aiServicesName'))]", + "publicNetworkAccess": "[if(equals(parameters('virtualNetworkType'), 'Internal'), 'Disabled', 'Enabled')]", + "networkAcls": { + "defaultAction": "[if(equals(parameters('virtualNetworkType'), 'External'), 'Deny', 'Allow')]", + "virtualNetworkRules": [], + "ipRules": [] + }, + "identity": { + "type": "SystemAssigned" + }, + "encryption": { + "status": "[parameters('encryption_status')]", + "keySource": "Microsoft.Keyvault", + "keyVaultProperties": { + "keyName": "[parameters('keyName')]", + "keyVersion": "[parameters('keyVersion')]", + "keyVaultUri": "[reference(parameters('cmk_keyvault'), '2021-04-01-preview').vaultUri]", + "identityClientId": "[json('null')]" + } + } + } + } + ] + } + } + }, + { + "apiVersion": "2018-05-01", + "name": "[concat('deployPrivateEndpoint-', parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.name)]", + "type": "Microsoft.Resources/deployments", + "resourceGroup": "[parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.resourceGroup.value.name]", + "subscriptionId": "[parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.subscription.subscriptionId]", + "dependsOn": [ + "[concat('Microsoft.CognitiveServices/accounts/', variables('aiServicesName'))]" + ], + "condition": "[equals(parameters('virtualNetworkType'), 'Internal')]", + "copy": { + "name": "privateendpointscopy", + "count": "[length(parameters('privateEndpoints'))]" + }, + "properties": { + "mode": "Incremental", + "template": { + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "resources": [ + { + "location": "[parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.location]", + "name": "[parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.name]", + "type": "Microsoft.Network/privateEndpoints", + "apiVersion": "2021-05-01", + "properties": { + "subnet": { + "id": "[parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.properties.subnet.id]" + }, + "privateLinkServiceConnections": [ + { + "name": "[parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.name]", + "properties": { + "privateLinkServiceId": "[concat(parameters('resourceGroupId'), '/providers/Microsoft.CognitiveServices/accounts/', variables('aiServicesName'))]", + "groupIds": "[parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.properties.privateLinkServiceConnections[0].properties.groupIds]" + } + } + ], + "customNetworkInterfaceName": "[concat(parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.name, '-nic')]" + }, + "tags": {} + } + ] + } + } + }, + { + "apiVersion": "2018-05-01", + "name": "[concat('deployDnsZoneGroup-', parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.name)]", + "type": "Microsoft.Resources/deployments", + "resourceGroup": "[parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.resourceGroup.value.name]", + "subscriptionId": "[parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.subscription.subscriptionId]", + "dependsOn": [ + "[concat('deployPrivateEndpoint-', parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.name)]" + ], + "condition": "[and(equals(parameters('virtualNetworkType'), 'Internal'), parameters('privateEndpoints')[copyIndex()].privateDnsZoneConfiguration.integrateWithPrivateDnsZone)]", + "copy": { + "name": "privateendpointdnscopy", + "count": "[length(parameters('privateEndpoints'))]" + }, + "properties": { + "mode": "Incremental", + "template": { + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "resources": [ + { + "type": "Microsoft.Network/privateDnsZones", + "apiVersion": "2018-09-01", + "name": "[parameters('privateDnsZone')]", + "location": "global", + "tags": {}, + "properties": {} + }, + { + "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks", + "apiVersion": "2018-09-01", + "name": "[concat(parameters('privateDnsZone'), '/', replace(uniqueString(parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.properties.subnet.id), '/subnets/default', ''))]", + "location": "global", + "dependsOn": [ + "[parameters('privateDnsZone')]" + ], + "properties": { + "virtualNetwork": { + "id": "[split(parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.properties.subnet.id, '/subnets/')[0]]" + }, + "registrationEnabled": false + } + }, + { + "apiVersion": "2017-05-10", + "name": "[concat('EndpointDnsRecords-', parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.name)]", + "type": "Microsoft.Resources/deployments", + "dependsOn": [ + "[parameters('privateDnsZone')]" + ], + "properties": { + "mode": "Incremental", + "templatelink": { + "uri": "https://go.microsoft.com/fwlink/?linkid=2264916" + }, + "parameters": { + "privateDnsName": { + "value": "[parameters('privateDnsZone')]" + }, + "privateEndpointNicResourceId": { + "value": "[concat('/subscriptions/', parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.subscription.subscriptionId, '/resourceGroups/', parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.resourceGroup.value.name, '/providers/Microsoft.Network/networkInterfaces/', parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.name, '-nic')]" + }, + "nicRecordsTemplateUri": { + "value": "https://go.microsoft.com/fwlink/?linkid=2264719" + }, + "ipConfigRecordsTemplateUri": { + "value": "https://go.microsoft.com/fwlink/?linkid=2265018" + }, + "uniqueId": { + "value": "[parameters('uniqueId')]" + }, + "existingRecords": { + "value": {} + } + } + } + }, + { + "type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups", + "apiVersion": "2020-03-01", + "name": "[concat(parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.name, '/', 'default')]", + "location": "[parameters('location')]", + "dependsOn": [ + "[parameters('privateDnsZone')]" + ], + "properties": { + "privateDnsZoneConfigs": [ + { + "name": "privatelink-cognitiveservices", + "properties": { + "privateDnsZoneId": "[concat(parameters('resourceGroupId'), '/providers/Microsoft.Network/privateDnsZones/', parameters('privateDnsZone'))]" + } + } + ] + } + } + ] + } + } + } + ], + "outputs": { + "AI_SERVICES_NAME": { + "type": "string", + "value": "[variables('aiServicesName')]" + }, + "AI_SERVICES_ENDPOINT": { + "type": "string", + "value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName'))).endpoints['AI Foundry API']]" + }, + "AI_SERVICES_KEY": { + "type": "string", + "value": "[listKeys(resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName')), '2025-04-01-preview').key1]" + } + } +} \ No newline at end of file diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/live/test_smoke_live.py b/sdk/voiceagents/azure-ai-voiceagents/tests/live/test_smoke_live.py deleted file mode 100644 index d869fd712ad0..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/tests/live/test_smoke_live.py +++ /dev/null @@ -1,44 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""A single, minimal, always-live smoke test. - -Unlike the recorded suites, this test never plays back from a cassette -- it -always talks to the real service, to catch problems (auth, wire format, -serialization) that a recording could mask. It only exercises a safe, -side-effect-free read operation against a pre-existing voice agent so it can -be run repeatedly without needing cleanup. - -Run explicitly: - - $env:AZURE_TEST_RUN_LIVE = "true" - pytest tests/test_smoke_live.py -v -""" -import os - -import pytest -from azure.identity import DefaultAzureCredential - -from azure.ai.voiceagents import VoiceAgentsClient -from azure.ai.voiceagents.models import AgentDefinitionOptInKeys - -PREVIEW = AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW - -pytestmark = [ - pytest.mark.live_test_only, - pytest.mark.skipif( - os.environ.get("AZURE_TEST_RUN_LIVE", "false").lower() != "true", - reason="Live smoke test only runs when AZURE_TEST_RUN_LIVE=true.", - ), -] - - -def test_smoke_get_voice_agent(): - endpoint = os.environ["AZURE_VOICE_AGENTS_ENDPOINT"] - agent_name = os.environ["AZURE_VOICE_AGENTS_AGENT_NAME"] - - with DefaultAzureCredential() as credential, VoiceAgentsClient(endpoint=endpoint, credential=credential) as client: - agent = client.voice_agents.get_voice_agent(agent_name, foundry_features=PREVIEW) - - assert agent["name"] == agent_name diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/live/test_voice_agents_management.py b/sdk/voiceagents/azure-ai-voiceagents/tests/live/test_voice_agents_management.py new file mode 100644 index 000000000000..13d5e21e84ee --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/tests/live/test_voice_agents_management.py @@ -0,0 +1,101 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Live management tests for voice agents. + +These tests exercise operations whose current service status codes match the +TypeSpec-generated client. Agent deletion is cleanup only because the service +currently returns 200 while the generated client expects 204. +""" +import os +import uuid + +import pytest +from azure.core.exceptions import HttpResponseError +from azure.identity import DefaultAzureCredential + +from azure.ai.voiceagents import VoiceAgentsClient +from azure.ai.voiceagents.models import ( + AgentDefinitionOptInKeys, + AzureStandardVoice, + VoiceAgentDefinition, + VoiceAgentType, + VoiceAgentUseCase, + VoiceAudioConfig, + VoiceAudioOutputConfig, + VoiceModelType, + VoiceOutputModality, +) + +PREVIEW = AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW + +pytestmark = [ + pytest.mark.live_test_only, + pytest.mark.skipif( + os.environ.get("AZURE_TEST_RUN_LIVE", "false").lower() != "true", + reason="Live tests only run when AZURE_TEST_RUN_LIVE=true.", + ), +] + + +def _endpoint() -> str: + return os.environ.get("AZURE_VOICE_AGENTS_ENDPOINT") or os.environ["AI_SERVICES_ENDPOINT"] + + +def _definition(model: str, instructions: str) -> VoiceAgentDefinition: + return VoiceAgentDefinition( + model_type=VoiceModelType.MANAGED, + model=model, + instructions=instructions, + audio=VoiceAudioConfig(output=VoiceAudioOutputConfig(voice=AzureStandardVoice(name="en-US-AvaNeural"))), + output_modalities=[VoiceOutputModality.AUDIO], + store=False, + ) + + +def _delete_agent_for_cleanup(client: VoiceAgentsClient, agent_name: str) -> None: + try: + client.voice_agents.delete_voice_agent(agent_name, foundry_features=PREVIEW) + except HttpResponseError as exc: + if exc.response is None or exc.response.status_code not in (200, 404): + raise + + +def test_generate_get_list_update_enable_disable_voice_agent(): + """Exercise supported voice agent management operations against a live project.""" + model = os.environ.get("AZURE_VOICE_AGENTS_MODEL", "gpt-realtime") + agent_name = f"test-voice-management-{uuid.uuid4().hex[:8]}" + + with DefaultAzureCredential() as credential, VoiceAgentsClient(endpoint=_endpoint(), credential=credential) as client: + try: + generated = client.voice_agents.generate_voice_agent( + name=agent_name, + model_type=VoiceModelType.MANAGED, + model=model, + agent_type=VoiceAgentType.BUSINESS, + use_case=VoiceAgentUseCase.CUSTOMER_SUPPORT, + goal="Answer questions in a friendly voice. Keep replies short and natural.", + foundry_features=PREVIEW, + ) + assert generated["name"] == agent_name + + fetched = client.voice_agents.get_voice_agent(agent_name, foundry_features=PREVIEW) + assert fetched["state"] == "enabled" + assert any(item["name"] == agent_name for item in client.voice_agents.list_voice_agents(foundry_features=PREVIEW)) + + updated = client.voice_agents.update_voice_agent( + agent_name, + definition=_definition(model, "Greet callers warmly and keep replies concise."), + description="Updated by a live management test.", + foundry_features=PREVIEW, + ) + assert updated["name"] == agent_name + + client.voice_agents.disable_voice_agent(agent_name, foundry_features=PREVIEW) + assert client.voice_agents.get_voice_agent(agent_name, foundry_features=PREVIEW)["state"] == "disabled" + + client.voice_agents.enable_voice_agent(agent_name, foundry_features=PREVIEW) + assert client.voice_agents.get_voice_agent(agent_name, foundry_features=PREVIEW)["state"] == "enabled" + finally: + _delete_agent_for_cleanup(client, agent_name) \ No newline at end of file diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/live/test_voice_agents_realtime.py b/sdk/voiceagents/azure-ai-voiceagents/tests/live/test_voice_agents_realtime.py new file mode 100644 index 000000000000..aaf301cb2fc1 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/tests/live/test_voice_agents_realtime.py @@ -0,0 +1,83 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Live realtime WebSocket tests for voice agents.""" +import asyncio +import os +import uuid + +import pytest +from azure.core.exceptions import HttpResponseError +from azure.identity.aio import DefaultAzureCredential + +from azure.ai.voiceagents.aio import VoiceAgentsClient +from azure.ai.voiceagents.models import ( + AgentDefinitionOptInKeys, + RealtimeConversationItemMessageUser, + RealtimeConversationItemMessageUserContent, + VoiceAgentServerEventError, + VoiceAgentServerEventResponseDone, + VoiceAgentType, + VoiceAgentUseCase, + VoiceModelType, +) + +PREVIEW = AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW + +pytestmark = [ + pytest.mark.live_test_only, + pytest.mark.skipif( + os.environ.get("AZURE_TEST_RUN_LIVE", "false").lower() != "true", + reason="Live tests only run when AZURE_TEST_RUN_LIVE=true.", + ), +] + + +async def _delete_agent_for_cleanup(client: VoiceAgentsClient, agent_name: str) -> None: + try: + await client.voice_agents.delete_voice_agent(agent_name, foundry_features=PREVIEW) + except HttpResponseError as exc: + if exc.response is None or exc.response.status_code not in (200, 404): + raise + + +@pytest.mark.asyncio +async def test_realtime_typed_turn(): + """Generate an agent, stream one typed turn, and receive a completed response.""" + endpoint = os.environ.get("AZURE_VOICE_AGENTS_ENDPOINT") or os.environ["AI_SERVICES_ENDPOINT"] + model = os.environ.get("AZURE_VOICE_AGENTS_MODEL", "gpt-realtime") + agent_name = f"test-voice-stream-{uuid.uuid4().hex[:8]}" + + async with DefaultAzureCredential() as credential, VoiceAgentsClient(endpoint=endpoint, credential=credential) as client: + try: + await client.voice_agents.generate_voice_agent( + name=agent_name, + model_type=VoiceModelType.MANAGED, + model=model, + agent_type=VoiceAgentType.BUSINESS, + use_case=VoiceAgentUseCase.CUSTOMER_SUPPORT, + goal="Reply with a short, friendly greeting.", + foundry_features=PREVIEW, + ) + + async with client.realtime.connect(agent_name=agent_name) as connection: + await connection.conversation.item.create( + item=RealtimeConversationItemMessageUser( + content=[RealtimeConversationItemMessageUserContent(type="input_text", text="Hello")] + ) + ) + await connection.response.create() + + async def wait_for_response_done(): + async for event in connection: + if isinstance(event, VoiceAgentServerEventError): + raise AssertionError(f"Realtime service error: {event.error.message}") + if isinstance(event, VoiceAgentServerEventResponseDone): + return event + raise AssertionError("Realtime connection closed before the response completed.") + + response = await asyncio.wait_for(wait_for_response_done(), timeout=45) + assert response.response["status"] == "completed" + finally: + await _delete_agent_for_cleanup(client, agent_name) \ No newline at end of file diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client.py b/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client.py index 4782f0c7aed0..c35e22920d78 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client.py +++ b/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client.py @@ -56,3 +56,45 @@ def test_get_agent_conversation( # See the note in test_get_voice_agent about not asserting on "id"/"name". assert conversation["object"] == "voice.conversation" assert conversation["status"] is not None + + @VoiceAgentsPreparer() + @recorded_by_proxy + def test_list_agent_conversation_items( + self, azure_voice_agents_endpoint, azure_voice_agents_agent_name, azure_voice_agents_conversation_id + ): + with self.create_client(azure_voice_agents_endpoint) as client: + items = list( + client.agent_endpoint_conversations.list_agent_conversation_items( + azure_voice_agents_agent_name, azure_voice_agents_conversation_id, foundry_features=PREVIEW + ) + ) + + assert items + + @VoiceAgentsPreparer() + @recorded_by_proxy + def test_list_agent_conversation_responses( + self, azure_voice_agents_endpoint, azure_voice_agents_agent_name, azure_voice_agents_conversation_id + ): + with self.create_client(azure_voice_agents_endpoint) as client: + responses = list( + client.agent_endpoint_conversations.list_agent_conversation_responses( + azure_voice_agents_agent_name, azure_voice_agents_conversation_id, foundry_features=PREVIEW + ) + ) + + assert responses + assert responses[0]["object"] == "realtime.response" + + @VoiceAgentsPreparer() + @recorded_by_proxy + def test_get_agent_conversation_audio_metadata( + self, azure_voice_agents_endpoint, azure_voice_agents_agent_name, azure_voice_agents_conversation_id + ): + with self.create_client(azure_voice_agents_endpoint) as client: + recording = client.agent_endpoint_conversations.get_agent_conversation_audio( + azure_voice_agents_agent_name, azure_voice_agents_conversation_id, foundry_features=PREVIEW + ) + + assert recording["format"] is not None + assert recording["sample_rate"] is not None diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client_async.py b/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client_async.py index 91df4889c03e..3bf0db40b9c1 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client_async.py +++ b/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client_async.py @@ -48,3 +48,47 @@ async def test_get_agent_conversation( # See the note in test_get_voice_agent about not asserting on "id"/"name". assert conversation["object"] == "voice.conversation" assert conversation["status"] is not None + + @VoiceAgentsPreparer() + @recorded_by_proxy_async + async def test_list_agent_conversation_items( + self, azure_voice_agents_endpoint, azure_voice_agents_agent_name, azure_voice_agents_conversation_id + ): + async with self.create_client(azure_voice_agents_endpoint) as client: + items = [ + item + async for item in client.agent_endpoint_conversations.list_agent_conversation_items( + azure_voice_agents_agent_name, azure_voice_agents_conversation_id, foundry_features=PREVIEW + ) + ] + + assert items + + @VoiceAgentsPreparer() + @recorded_by_proxy_async + async def test_list_agent_conversation_responses( + self, azure_voice_agents_endpoint, azure_voice_agents_agent_name, azure_voice_agents_conversation_id + ): + async with self.create_client(azure_voice_agents_endpoint) as client: + responses = [ + response + async for response in client.agent_endpoint_conversations.list_agent_conversation_responses( + azure_voice_agents_agent_name, azure_voice_agents_conversation_id, foundry_features=PREVIEW + ) + ] + + assert responses + assert responses[0]["object"] == "realtime.response" + + @VoiceAgentsPreparer() + @recorded_by_proxy_async + async def test_get_agent_conversation_audio_metadata( + self, azure_voice_agents_endpoint, azure_voice_agents_agent_name, azure_voice_agents_conversation_id + ): + async with self.create_client(azure_voice_agents_endpoint) as client: + recording = await client.agent_endpoint_conversations.get_agent_conversation_audio( + azure_voice_agents_agent_name, azure_voice_agents_conversation_id, foundry_features=PREVIEW + ) + + assert recording["format"] is not None + assert recording["sample_rate"] is not None diff --git a/sdk/voiceagents/ci.yml b/sdk/voiceagents/ci.yml new file mode 100644 index 000000000000..d0a209af135c --- /dev/null +++ b/sdk/voiceagents/ci.yml @@ -0,0 +1,37 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + - restapi* + paths: + include: + - sdk/voiceagents/ + - sdk/core/ + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + - restapi* + paths: + include: + - sdk/voiceagents/ + - sdk/core/ + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: voiceagents + TestProxy: true + BuildDocs: true + TestTimeoutInMinutes: 60 + Artifacts: + - name: azure-ai-voiceagents + safeName: azureaivoiceagents diff --git a/sdk/voiceagents/tests.yml b/sdk/voiceagents/tests.yml new file mode 100644 index 000000000000..1780a898a4e4 --- /dev/null +++ b/sdk/voiceagents/tests.yml @@ -0,0 +1,6 @@ +trigger: none + +extends: + template: /eng/pipelines/templates/stages/python-analyze-weekly-standalone.yml + parameters: + ServiceDirectory: voiceagents From adb3e80678af9d80de78f3de98630df051236b30 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Thu, 6 Aug 2026 17:15:34 -0700 Subject: [PATCH 05/56] Fix voice agents pipeline validation --- .../azure-ai-voiceagents/README.md | 4 +-- .../azure-ai-voiceagents/assets.json | 2 +- .../recording/test_voice_agents_client.py | 20 ++++++++++--- sdk/voiceagents/cspell.yaml | 29 +++++++++++++++++++ 4 files changed, 48 insertions(+), 7 deletions(-) diff --git a/sdk/voiceagents/azure-ai-voiceagents/README.md b/sdk/voiceagents/azure-ai-voiceagents/README.md index f889d2310d8b..7e6e2c82f869 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/README.md +++ b/sdk/voiceagents/azure-ai-voiceagents/README.md @@ -65,8 +65,8 @@ for agent in client.voice_agents.list_voice_agents( print(agent.name) ``` -See the [samples](samples/README.md) directory for management, quickstart, and -realtime conversation examples. +See the [samples on GitHub](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/voiceagents/azure-ai-voiceagents/samples) +for management, quickstart, and realtime conversation examples. ## Contributing diff --git a/sdk/voiceagents/azure-ai-voiceagents/assets.json b/sdk/voiceagents/azure-ai-voiceagents/assets.json index 3f1be8a01b32..703d21fc1f3a 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/assets.json +++ b/sdk/voiceagents/azure-ai-voiceagents/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "python", "TagPrefix": "python/voiceagents/azure-ai-voiceagents", - "Tag": "python/voiceagents/azure-ai-voiceagents_fe28a40ed9" + "Tag": "python/voiceagents/azure-ai-voiceagents_d69733ae81" } diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client.py b/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client.py index c35e22920d78..14b6f268ac96 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client.py +++ b/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client.py @@ -50,7 +50,10 @@ def test_get_agent_conversation( ): with self.create_client(azure_voice_agents_endpoint) as client: conversation = client.agent_endpoint_conversations.get_agent_conversation( - azure_voice_agents_agent_name, azure_voice_agents_conversation_id, foundry_features=PREVIEW + azure_voice_agents_agent_name, + azure_voice_agents_conversation_id, + foundry_features=PREVIEW, + headers={"Accept-Encoding": "identity"}, ) # See the note in test_get_voice_agent about not asserting on "id"/"name". @@ -65,7 +68,10 @@ def test_list_agent_conversation_items( with self.create_client(azure_voice_agents_endpoint) as client: items = list( client.agent_endpoint_conversations.list_agent_conversation_items( - azure_voice_agents_agent_name, azure_voice_agents_conversation_id, foundry_features=PREVIEW + azure_voice_agents_agent_name, + azure_voice_agents_conversation_id, + foundry_features=PREVIEW, + headers={"Accept-Encoding": "identity"}, ) ) @@ -79,7 +85,10 @@ def test_list_agent_conversation_responses( with self.create_client(azure_voice_agents_endpoint) as client: responses = list( client.agent_endpoint_conversations.list_agent_conversation_responses( - azure_voice_agents_agent_name, azure_voice_agents_conversation_id, foundry_features=PREVIEW + azure_voice_agents_agent_name, + azure_voice_agents_conversation_id, + foundry_features=PREVIEW, + headers={"Accept-Encoding": "identity"}, ) ) @@ -93,7 +102,10 @@ def test_get_agent_conversation_audio_metadata( ): with self.create_client(azure_voice_agents_endpoint) as client: recording = client.agent_endpoint_conversations.get_agent_conversation_audio( - azure_voice_agents_agent_name, azure_voice_agents_conversation_id, foundry_features=PREVIEW + azure_voice_agents_agent_name, + azure_voice_agents_conversation_id, + foundry_features=PREVIEW, + headers={"Accept-Encoding": "identity"}, ) assert recording["format"] is not None diff --git a/sdk/voiceagents/cspell.yaml b/sdk/voiceagents/cspell.yaml index 9c5eae99e399..20807788ac46 100644 --- a/sdk/voiceagents/cspell.yaml +++ b/sdk/voiceagents/cspell.yaml @@ -3,7 +3,36 @@ import: - ../../.vscode/cspell.json words: + - aarti + - aiservices + - byom + - BYOS + - CSDL + - dalia + - diya + - deser + - DTMF + - hyunsu + - keita + - MCPHTTP + - meera + - niwat + - pcma + - pcmu + - premwadee - pyaudio + - redef - realtime + - reraises + - sess + - SSML + - sunhi + - unsanitized - vad - viseme + - webrtc + - xhigh + - xiaoxiao + - ximena + - yunxi + - yulin From df85f9fc1a6ffefae8b88ebc66db5aa4e3805e70 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Fri, 7 Aug 2026 11:33:31 -0700 Subject: [PATCH 06/56] Fix voice agents validation issues --- .../azure-ai-voiceagents/README.md | 5 +- sdk/voiceagents/azure-ai-voiceagents/api.md | 9894 +++++++++++++++++ .../azure-ai-voiceagents/api.metadata.yml | 3 + .../azure/ai/voiceagents/_client.py | 7 +- .../azure/ai/voiceagents/aio/_client.py | 8 +- .../azure/ai/voiceagents/aio/_realtime.py | 12 +- .../ai/voiceagents/aio/operations/__init__.py | 2 - .../voiceagents/aio/operations/_operations.py | 110 - .../ai/voiceagents/operations/__init__.py | 2 - .../ai/voiceagents/operations/_operations.py | 110 - .../azure-ai-voiceagents/samples/README.md | 20 +- .../tests/unit/test_client_construction.py | 3 - 12 files changed, 9922 insertions(+), 254 deletions(-) create mode 100644 sdk/voiceagents/azure-ai-voiceagents/api.md create mode 100644 sdk/voiceagents/azure-ai-voiceagents/api.metadata.yml diff --git a/sdk/voiceagents/azure-ai-voiceagents/README.md b/sdk/voiceagents/azure-ai-voiceagents/README.md index 7e6e2c82f869..da97e925810e 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/README.md +++ b/sdk/voiceagents/azure-ai-voiceagents/README.md @@ -22,7 +22,7 @@ python -m pip install azure-ai-voiceagents ### Prerequisites - Python 3.10 or later is required to use this package. -- You need an [Azure subscription][azure_sub]. +- You need an Azure subscription. - You need an Azure AI Foundry project endpoint, for example `https://.services.ai.azure.com/api/projects/`. - For Microsoft Entra ID authentication, install [`azure-identity`][azure_identity_pip]. @@ -65,7 +65,7 @@ for agent in client.voice_agents.list_voice_agents( print(agent.name) ``` -See the [samples on GitHub](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/voiceagents/azure-ai-voiceagents/samples) +See the [samples on GitHub](https://github.com/Azure/azure-sdk-for-python/tree/xitzhang/voice-agent-pupr/sdk/voiceagents/azure-ai-voiceagents/samples) for management, quickstart, and realtime conversation examples. ## Contributing @@ -90,4 +90,3 @@ additional questions or comments. [azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#credentials [azure_identity_pip]: https://pypi.org/project/azure-identity/ [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential -[azure_sub]: https://azure.microsoft.com/free/ diff --git a/sdk/voiceagents/azure-ai-voiceagents/api.md b/sdk/voiceagents/azure-ai-voiceagents/api.md new file mode 100644 index 000000000000..f37c1fbdf681 --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/api.md @@ -0,0 +1,9894 @@ +```py +namespace azure.ai.voiceagents + + class azure.ai.voiceagents.VoiceAgentsClient: implements ContextManager + agent_endpoint_conversations: AgentEndpointConversationsOperations + voice_agents: VoiceAgentsOperations + + def __init__( + self, + endpoint: str, + credential: TokenCredential, + *, + api_version: str = ..., + **kwargs: Any + ) -> None: ... + + def close(self) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> HttpResponse: ... + + +namespace azure.ai.voiceagents.aio + + class azure.ai.voiceagents.aio.AsyncRealtime: + + def __init__(self, client: VoiceAgentsClient) -> None: ... + + def connect( + self, + *, + agent_name: str, + agent_session_id: Optional[str] = ..., + agent_version_override: Optional[str] = ..., + api_version: Optional[str] = ..., + connection_url: Optional[str] = ..., + credential_scopes: Optional[List[str]] = ..., + extra_headers: Optional[Mapping[str, str]] = ..., + extra_query: Optional[Mapping[str, str]] = ..., + foundry_features: Union[str, AgentDefinitionOptInKeys] = _models.AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW, + structured_inputs: Optional[str] = ..., + **kwargs: Any + ) -> AsyncRealtimeConnectionManager: ... + + + class azure.ai.voiceagents.aio.AsyncRealtimeConnection: implements AsyncContextManager + + def __aiter__(self) -> AsyncIterator[ServerEvent]: ... + + def __init__( + self, + connection: ClientWebSocketResponse, + session: ClientSession + ) -> None: ... + + async def close( + self, + *, + code: int = 1000, + reason: str = "" + ) -> None: ... + + async def recv(self) -> ServerEvent: ... + + async def send(self, event: ClientEvent) -> None: ... + + + class azure.ai.voiceagents.aio.AsyncRealtimeConnectionManager: implements AsyncContextManager + + def __init__( + self, + *, + agent_name: str, + agent_session_id: Optional[str] = ..., + agent_version_override: Optional[str] = ..., + api_version: str, + connection_url: Optional[str] = ..., + credential: AsyncTokenCredential, + credential_scopes: List[str], + endpoint: str, + extra_headers: Optional[Mapping[str, str]] = ..., + extra_query: Optional[Mapping[str, str]] = ..., + foundry_features: Union[str, AgentDefinitionOptInKeys], + structured_inputs: Optional[str] = ..., + **kwargs: Any + ) -> None: ... + + async def enter(self) -> AsyncRealtimeConnection: ... + + + class azure.ai.voiceagents.aio.VoiceAgentsClient(_GeneratedVoiceAgentsClient): implements AsyncContextManager + property realtime: AsyncRealtime # Read-only + + def __init__( + self, + endpoint: str, + credential: AsyncTokenCredential, + **kwargs: Any + ) -> None: ... + + async def close(self) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: ... + + +namespace azure.ai.voiceagents.aio.operations + + class azure.ai.voiceagents.aio.operations.AgentEndpointConversationsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def delete_agent_conversation( + self, + agent_name: str, + conversation_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def get_agent_conversation( + self, + agent_name: str, + conversation_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> VoiceConversation: ... + + @distributed_trace_async + async def get_agent_conversation_audio( + self, + agent_name: str, + conversation_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> VoiceRecordingResponse: ... + + @distributed_trace_async + async def get_agent_conversation_audio_content( + self, + agent_name: str, + conversation_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> AsyncIterator[bytes]: ... + + @distributed_trace_async + async def get_agent_conversation_item( + self, + agent_name: str, + conversation_id: str, + item_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> VoiceConversationItem: ... + + @distributed_trace_async + async def get_agent_conversation_item_audio( + self, + agent_name: str, + conversation_id: str, + item_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> VoiceItemAudioResponse: ... + + @distributed_trace_async + async def get_agent_conversation_item_audio_content( + self, + agent_name: str, + conversation_id: str, + item_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> AsyncIterator[bytes]: ... + + @distributed_trace_async + async def get_agent_conversation_response( + self, + agent_name: str, + conversation_id: str, + response_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> VoiceResponse: ... + + @distributed_trace + def list_agent_conversation_items( + self, + agent_name: str, + conversation_id: str, + *, + before: Optional[str] = ..., + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[VoiceConversationItem]: ... + + @distributed_trace + def list_agent_conversation_response_items( + self, + agent_name: str, + conversation_id: str, + response_id: str, + *, + before: Optional[str] = ..., + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[VoiceConversationItem]: ... + + @distributed_trace + def list_agent_conversation_responses( + self, + agent_name: str, + conversation_id: str, + *, + before: Optional[str] = ..., + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[VoiceResponse]: ... + + + class azure.ai.voiceagents.aio.operations.VoiceAgentsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def create_voice_agent( + self, + *, + agent_card: Optional[AgentCard] = ..., + agent_endpoint: Optional[AgentEndpointConfig] = ..., + blueprint_reference: Optional[AgentBlueprintReference] = ..., + content_type: str = "application/json", + definition: VoiceAgentDefinition, + description: Optional[str] = ..., + draft: Optional[bool] = ..., + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + metadata: Optional[dict[str, str]] = ..., + name: str, + state: Optional[Union[str, AgentState]] = ..., + **kwargs: Any + ) -> VoiceAgentObject: ... + + @overload + async def create_voice_agent( + self, + body: CreateVoiceAgentRequest, + *, + content_type: str = "application/json", + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> VoiceAgentObject: ... + + @overload + async def create_voice_agent( + self, + body: IO[bytes], + *, + content_type: str = "application/json", + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> VoiceAgentObject: ... + + @overload + async def create_voice_agent_version( + self, + agent_name: str, + *, + blueprint_reference: Optional[AgentBlueprintReference] = ..., + content_type: str = "application/json", + definition: VoiceAgentDefinition, + description: Optional[str] = ..., + draft: Optional[bool] = ..., + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + metadata: Optional[dict[str, str]] = ..., + **kwargs: Any + ) -> VoiceAgentVersionObject: ... + + @overload + async def create_voice_agent_version( + self, + agent_name: str, + body: CreateVoiceAgentVersionRequest, + *, + content_type: str = "application/json", + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> VoiceAgentVersionObject: ... + + @overload + async def create_voice_agent_version( + self, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> VoiceAgentVersionObject: ... + + @distributed_trace_async + async def delete_voice_agent( + self, + agent_name: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def delete_voice_agent_version( + self, + agent_name: str, + agent_version: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def disable_voice_agent( + self, + agent_name: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def enable_voice_agent( + self, + agent_name: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> None: ... + + @overload + async def generate_voice_agent( + self, + *, + agent_type: Union[str, VoiceAgentType], + content_type: str = "application/json", + description: Optional[str] = ..., + draft: Optional[bool] = ..., + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + goal: str, + model: str, + model_type: Union[str, VoiceModelType], + name: str, + tools: Optional[list[VoiceAgentTool]] = ..., + use_case: Union[str, VoiceAgentUseCase], + **kwargs: Any + ) -> VoiceAgentObject: ... + + @overload + async def generate_voice_agent( + self, + body: GenerateVoiceAgentRequest, + *, + content_type: str = "application/json", + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> VoiceAgentObject: ... + + @overload + async def generate_voice_agent( + self, + body: IO[bytes], + *, + content_type: str = "application/json", + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> VoiceAgentObject: ... + + @distributed_trace_async + async def get_voice_agent( + self, + agent_name: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> VoiceAgentObject: ... + + @distributed_trace_async + async def get_voice_agent_version( + self, + agent_name: str, + agent_version: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> VoiceAgentVersionObject: ... + + @distributed_trace + def list_voice_agent_versions( + self, + agent_name: str, + *, + before: Optional[str] = ..., + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + include_drafts: Optional[bool] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[VoiceAgentVersionObject]: ... + + @distributed_trace + def list_voice_agents( + self, + *, + before: Optional[str] = ..., + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[VoiceAgentObject]: ... + + @overload + async def update_voice_agent( + self, + agent_name: str, + *, + blueprint_reference: Optional[AgentBlueprintReference] = ..., + content_type: str = "application/json", + definition: VoiceAgentDefinition, + description: Optional[str] = ..., + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + metadata: Optional[dict[str, str]] = ..., + **kwargs: Any + ) -> VoiceAgentObject: ... + + @overload + async def update_voice_agent( + self, + agent_name: str, + body: UpdateVoiceAgentRequest, + *, + content_type: str = "application/json", + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> VoiceAgentObject: ... + + @overload + async def update_voice_agent( + self, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> VoiceAgentObject: ... + + +namespace azure.ai.voiceagents.models + + class azure.ai.voiceagents.models.A2AProtocolConfiguration(_Model): + + + class azure.ai.voiceagents.models.ActivityProtocolConfiguration(_Model): + enable_m365_public_endpoint: Optional[bool] + + @overload + def __init__( + self, + *, + enable_m365_public_endpoint: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.AgentBlueprintReference(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.AgentBlueprintReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MANAGED_AGENT_IDENTITY_BLUEPRINT = "ManagedAgentIdentityBlueprint" + + + class azure.ai.voiceagents.models.AgentCard(_Model): + description: Optional[str] + skills: list[AgentCardSkill] + version: str + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + skills: list[AgentCardSkill], + version: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.AgentCardSkill(_Model): + description: Optional[str] + examples: Optional[list[str]] + id: str + name: str + tags: Optional[list[str]] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + examples: Optional[list[str]] = ..., + id: str, + name: str, + tags: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.AgentDefinitionOptInKeys(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DRAFT_AGENTS_V1_PREVIEW = "DraftAgents=V1Preview" + EXTERNAL_AGENTS_V1_PREVIEW = "ExternalAgents=V1Preview" + VOICE_AGENTS_V1_PREVIEW = "VoiceAgents=V1Preview" + WORKFLOW_AGENTS_V1_PREVIEW = "WorkflowAgents=V1Preview" + + + class azure.ai.voiceagents.models.AgentEndpointAuthorizationScheme(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.AgentEndpointAuthorizationSchemeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BOT_SERVICE = "BotService" + BOT_SERVICE_RBAC = "BotServiceRbac" + BOT_SERVICE_TENANT = "BotServiceTenant" + ENTRA = "Entra" + + + class azure.ai.voiceagents.models.AgentEndpointConfig(_Model): + authorization_schemes: Optional[list[AgentEndpointAuthorizationScheme]] + protocol_configuration: Optional[ProtocolConfiguration] + version_selector: Optional[VersionSelector] + + @overload + def __init__( + self, + *, + authorization_schemes: Optional[list[AgentEndpointAuthorizationScheme]] = ..., + protocol_configuration: Optional[ProtocolConfiguration] = ..., + version_selector: Optional[VersionSelector] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.AgentIdentity(_Model): + client_id: str + principal_id: str + status: Optional[Union[str, AgentIdentityStatus]] + + @overload + def __init__( + self, + *, + client_id: str, + principal_id: str, + status: Optional[Union[str, AgentIdentityStatus]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.AgentIdentityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACTIVE = "active" + DISABLED = "disabled" + + + class azure.ai.voiceagents.models.AgentObjectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT = "agent" + AGENT_CONTAINER = "agent.container" + AGENT_DELETED = "agent.deleted" + AGENT_VERSION = "agent.version" + AGENT_VERSION_DELETED = "agent.version.deleted" + + + class azure.ai.voiceagents.models.AgentState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "disabled" + ENABLED = "enabled" + + + class azure.ai.voiceagents.models.AgentStateSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT_BLUEPRINT = "agent_blueprint" + AGENT_INSTANCE_IDENTITY = "agent_instance_identity" + + + class azure.ai.voiceagents.models.AgentVersionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACTIVE = "active" + CREATING = "creating" + DELETED = "deleted" + DELETING = "deleting" + FAILED = "failed" + + + class azure.ai.voiceagents.models.ApiErrorResponse(_Model): + error: Error + + @overload + def __init__( + self, + *, + error: Error + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.AzureAvatarVoiceSyncVoice(AzureVoice, discriminator='avatar-voice-sync'): + custom_lexicon_url: str + custom_text_normalization_url: str + locale: str + model: Union[str, PersonalVoiceModel] + pitch: str + prefer_locales: list[str] + rate: str + style: str + temperature: float + type: Literal[AzureVoiceType.AVATAR_VOICE_SYNC] + volume: str + + @overload + def __init__( + self, + *, + custom_lexicon_url: Optional[str] = ..., + custom_text_normalization_url: Optional[str] = ..., + locale: Optional[str] = ..., + model: Union[str, PersonalVoiceModel], + pitch: Optional[str] = ..., + prefer_locales: Optional[list[str]] = ..., + rate: Optional[str] = ..., + style: Optional[str] = ..., + temperature: Optional[float] = ..., + volume: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.AzureCustomVoice(AzureVoice, discriminator='azure-custom'): + custom_lexicon_url: str + custom_text_normalization_url: str + endpoint_id: str + locale: str + name: str + pitch: str + prefer_locales: list[str] + rate: str + style: str + temperature: float + type: Literal[AzureVoiceType.AZURE_CUSTOM] + volume: str + + @overload + def __init__( + self, + *, + custom_lexicon_url: Optional[str] = ..., + custom_text_normalization_url: Optional[str] = ..., + endpoint_id: str, + locale: Optional[str] = ..., + name: str, + pitch: Optional[str] = ..., + prefer_locales: Optional[list[str]] = ..., + rate: Optional[str] = ..., + style: Optional[str] = ..., + temperature: Optional[float] = ..., + volume: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.AzurePersonalVoice(AzureVoice, discriminator='azure-personal'): + custom_lexicon_url: str + custom_text_normalization_url: str + locale: str + model: Union[str, PersonalVoiceModel] + name: str + pitch: str + prefer_locales: list[str] + rate: str + style: str + temperature: float + type: Literal[AzureVoiceType.AZURE_PERSONAL] + volume: str + + @overload + def __init__( + self, + *, + custom_lexicon_url: Optional[str] = ..., + custom_text_normalization_url: Optional[str] = ..., + locale: Optional[str] = ..., + model: Union[str, PersonalVoiceModel], + name: str, + pitch: Optional[str] = ..., + prefer_locales: Optional[list[str]] = ..., + rate: Optional[str] = ..., + style: Optional[str] = ..., + temperature: Optional[float] = ..., + volume: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.AzureRealtimeNativeVoice(_Model): + name: Union[str, AzureRealtimeNativeVoiceName] + type: Literal["azure-realtime-native"] + + @overload + def __init__( + self, + *, + name: Union[str, AzureRealtimeNativeVoiceName] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.AzureRealtimeNativeVoiceName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AARTI = "aarti" + ALVARO = "alvaro" + ANDREW = "andrew" + ANTONIO = "antonio" + AVA = "ava" + CLARA = "clara" + DALIA = "dalia" + DENISE = "denise" + DIEGO = "diego" + DIYA = "diya" + ELSA = "elsa" + EMMA = "emma" + FLORIAN = "florian" + FRANCISCA = "francisca" + HYUNSU = "hyunsu" + JORGE = "jorge" + KEITA = "keita" + LIAM = "liam" + MEERA = "meera" + NANAMI = "nanami" + NATASHA = "natasha" + NIWAT = "niwat" + PREMWADEE = "premwadee" + REMY = "remy" + RYAN = "ryan" + SERAPHINA = "seraphina" + SONIA = "sonia" + SUNHI = "sunhi" + SYLVIE = "sylvie" + THIERRY = "thierry" + WILLIAM = "william" + XIAOXIAO = "xiaoxiao" + XIMENA = "ximena" + YUNXI = "yunxi" + + + class azure.ai.voiceagents.models.AzureStandardVoice(AzureVoice, discriminator='azure-standard'): + custom_lexicon_url: str + custom_text_normalization_url: str + locale: str + multi_talker_speaker_name: Optional[str] + name: str + pitch: str + prefer_locales: list[str] + rate: str + style: str + temperature: float + type: Literal[AzureVoiceType.AZURE_STANDARD] + volume: str + + @overload + def __init__( + self, + *, + custom_lexicon_url: Optional[str] = ..., + custom_text_normalization_url: Optional[str] = ..., + locale: Optional[str] = ..., + multi_talker_speaker_name: Optional[str] = ..., + name: str, + pitch: Optional[str] = ..., + prefer_locales: Optional[list[str]] = ..., + rate: Optional[str] = ..., + style: Optional[str] = ..., + temperature: Optional[float] = ..., + volume: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.AzureVoice(_Model): + custom_lexicon_url: Optional[str] + custom_text_normalization_url: Optional[str] + locale: Optional[str] + pitch: Optional[str] + prefer_locales: Optional[list[str]] + rate: Optional[str] + style: Optional[str] + temperature: Optional[float] + type: str + volume: Optional[str] + + @overload + def __init__( + self, + *, + custom_lexicon_url: Optional[str] = ..., + custom_text_normalization_url: Optional[str] = ..., + locale: Optional[str] = ..., + pitch: Optional[str] = ..., + prefer_locales: Optional[list[str]] = ..., + rate: Optional[str] = ..., + style: Optional[str] = ..., + temperature: Optional[float] = ..., + type: str, + volume: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.AzureVoiceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AVATAR_VOICE_SYNC = "avatar-voice-sync" + AZURE_CUSTOM = "azure-custom" + AZURE_PERSONAL = "azure-personal" + AZURE_STANDARD = "azure-standard" + + + class azure.ai.voiceagents.models.BotServiceAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator='BotService'): + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.BotServiceRbacAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator='BotServiceRbac'): + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.BotServiceTenantAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator='BotServiceTenant'): + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.CallableToolAllowedCaller(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DIRECT = "direct" + PROGRAMMATIC = "programmatic" + + + class azure.ai.voiceagents.models.CreateTranscriptionResponseJsonUsage(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.CreateTranscriptionResponseJsonUsageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DURATION = "duration" + TOKENS = "tokens" + + + class azure.ai.voiceagents.models.EntraAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator='Entra'): + type: Literal[AgentEndpointAuthorizationSchemeType.ENTRA] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.Error(_Model): + additional_info: Optional[dict[str, Any]] + code: str + debug_info: Optional[dict[str, Any]] + details: Optional[list[Error]] + message: str + param: Optional[str] + type: Optional[str] + + @overload + def __init__( + self, + *, + additional_info: Optional[dict[str, Any]] = ..., + code: str, + debug_info: Optional[dict[str, Any]] = ..., + details: Optional[list[Error]] = ..., + message: str, + param: Optional[str] = ..., + type: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.FixedRatioVersionSelectionRule(VersionSelectionRule, discriminator='FixedRatio'): + agent_version: str + traffic_percentage: int + type: Literal[VersionSelectorType.FIXED_RATIO] + + @overload + def __init__( + self, + *, + agent_version: str, + traffic_percentage: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.InvocationsProtocolConfiguration(_Model): + + + class azure.ai.voiceagents.models.InvocationsWsProtocolConfiguration(_Model): + + + class azure.ai.voiceagents.models.LlmGeneratedVoiceGreetingConfig(VoiceGreetingConfig, discriminator='llm_generated'): + fallback_text: Optional[str] + prompt: str + tool_choice: Optional[Union[str, VoiceGreetingToolChoice]] + type: Literal["llm_generated"] + + @overload + def __init__( + self, + *, + fallback_text: Optional[str] = ..., + prompt: str, + tool_choice: Optional[Union[str, VoiceGreetingToolChoice]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.LogProbProperties(_Model): + bytes: list[int] + logprob: float + token: str + + @overload + def __init__( + self, + *, + bytes: list[int], + logprob: float, + token: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.MCPListToolsTool(_Model): + annotations: Optional[MCPListToolsToolAnnotations] + description: Optional[str] + input_schema: MCPListToolsToolInputSchema + name: str + + @overload + def __init__( + self, + *, + annotations: Optional[MCPListToolsToolAnnotations] = ..., + description: Optional[str] = ..., + input_schema: MCPListToolsToolInputSchema, + name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.MCPListToolsToolAnnotations(_Model): + + + class azure.ai.voiceagents.models.MCPListToolsToolInputSchema(_Model): + + + class azure.ai.voiceagents.models.MCPTool(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, + *, + 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.voiceagents.models.MCPToolFilter(_Model): + read_only: Optional[bool] + tool_names: Optional[list[str]] + + @overload + def __init__( + self, + *, + read_only: Optional[bool] = ..., + tool_names: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.MCPToolRequireApproval(_Model): + always: Optional[MCPToolFilter] + never: Optional[MCPToolFilter] + + @overload + def __init__( + self, + *, + always: Optional[MCPToolFilter] = ..., + never: Optional[MCPToolFilter] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.ManagedAgentIdentityBlueprintReference(AgentBlueprintReference, discriminator='ManagedAgentIdentityBlueprint'): + blueprint_id: str + type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] + + @overload + def __init__( + self, + *, + blueprint_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.McpProtocolConfiguration(_Model): + + + class azure.ai.voiceagents.models.Metadata(_Model): + + + class azure.ai.voiceagents.models.OpenAIVoice(_Model): + name: Union[str, VoiceIdsShared] + type: Literal["openai"] + + @overload + def __init__( + self, + *, + name: Union[str, VoiceIdsShared] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.PageOrder(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ASC = "asc" + DESC = "desc" + + + class azure.ai.voiceagents.models.PersonalVoiceModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DRAGON_HD_OMNI_LATEST_NEURAL = "DragonHDOmniLatestNeural" + DRAGON_LATEST_NEURAL = "DragonLatestNeural" + MAI_VOICE = "MAI-Voice" + + + class azure.ai.voiceagents.models.ProtocolConfiguration(_Model): + a2_a: Optional[A2AProtocolConfiguration] + activity: Optional[ActivityProtocolConfiguration] + invocations: Optional[InvocationsProtocolConfiguration] + invocations_ws: Optional[InvocationsWsProtocolConfiguration] + mcp: Optional[McpProtocolConfiguration] + responses: Optional[ResponsesProtocolConfiguration] + + @overload + def __init__( + self, + *, + a2_a: Optional[A2AProtocolConfiguration] = ..., + activity: Optional[ActivityProtocolConfiguration] = ..., + invocations: Optional[InvocationsProtocolConfiguration] = ..., + invocations_ws: Optional[InvocationsWsProtocolConfiguration] = ..., + mcp: Optional[McpProtocolConfiguration] = ..., + responses: Optional[ResponsesProtocolConfiguration] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RaiConfig(_Model): + rai_policy_name: str + + @overload + def __init__( + self, + *, + rai_policy_name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeAudioFormats(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeAudioFormatsAudioPcm(RealtimeAudioFormats, discriminator='audio/pcm'): + rate: Optional[Literal[24000]] + type: Literal[RealtimeAudioFormatsType.AUDIO_PCM] + + @overload + def __init__( + self, + *, + rate: Optional[Literal[24000]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeAudioFormatsAudioPcma(RealtimeAudioFormats, discriminator='audio/pcma'): + type: Literal[RealtimeAudioFormatsType.AUDIO_PCMA] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeAudioFormatsAudioPcmu(RealtimeAudioFormats, discriminator='audio/pcmu'): + type: Literal[RealtimeAudioFormatsType.AUDIO_PCMU] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeAudioFormatsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUDIO_PCM = "audio/pcm" + AUDIO_PCMA = "audio/pcma" + AUDIO_PCMU = "audio/pcmu" + + + class azure.ai.voiceagents.models.RealtimeClientEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONVERSATION_ITEM_CREATE = "conversation.item.create" + CONVERSATION_ITEM_DELETE = "conversation.item.delete" + CONVERSATION_ITEM_RETRIEVE = "conversation.item.retrieve" + CONVERSATION_ITEM_TRUNCATE = "conversation.item.truncate" + INPUT_AUDIO_BUFFER_APPEND = "input_audio_buffer.append" + INPUT_AUDIO_BUFFER_CLEAR = "input_audio_buffer.clear" + INPUT_AUDIO_BUFFER_COMMIT = "input_audio_buffer.commit" + OUTPUT_AUDIO_BUFFER_CLEAR = "output_audio_buffer.clear" + RESPONSE_CANCEL = "response.cancel" + RESPONSE_CREATE = "response.create" + SESSION_UPDATE = "session.update" + + + class azure.ai.voiceagents.models.RealtimeConversationItem(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeConversationItemFunctionCall(RealtimeConversationItem, discriminator='function_call'): + arguments: str + call_id: Optional[str] + id: Optional[str] + name: str + object: Optional[Literal["item"]] + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Literal[RealtimeConversationItemType.FUNCTION_CALL] + + @overload + def __init__( + self, + *, + arguments: str, + call_id: Optional[str] = ..., + id: Optional[str] = ..., + name: str, + object: Optional[Literal[item]] = ..., + status: Optional[Literal[completed, incomplete, in_progress]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeConversationItemFunctionCallOutput(RealtimeConversationItem, discriminator='function_call_output'): + call_id: str + id: Optional[str] + object: Optional[Literal["item"]] + output: str + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT] + + @overload + def __init__( + self, + *, + call_id: str, + id: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + output: str, + status: Optional[Literal[completed, incomplete, in_progress]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeConversationItemMessage(_Model): + role: str + + @overload + def __init__( + self, + *, + role: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistant(RealtimeConversationItemMessage, discriminator='assistant'): + content: list[RealtimeConversationItemMessageAssistantContent] + id: Optional[str] + object: Optional[Literal["item"]] + role: Literal[RealtimeConversationItemMessageType.ASSISTANT] + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Literal["message"] + + @overload + def __init__( + self, + *, + content: list[RealtimeConversationItemMessageAssistantContent], + id: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + status: Optional[Literal[completed, incomplete, in_progress]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistantContent(_Model): + audio: Optional[str] + text: Optional[str] + transcript: Optional[str] + type: Optional[Literal["output_text", "output_audio"]] + + @overload + def __init__( + self, + *, + audio: Optional[str] = ..., + text: Optional[str] = ..., + transcript: Optional[str] = ..., + type: Optional[Literal[output_text, output_audio]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeConversationItemMessageSystem(RealtimeConversationItemMessage, discriminator='system'): + content: list[RealtimeConversationItemMessageSystemContent] + id: Optional[str] + object: Optional[Literal["item"]] + role: Literal[RealtimeConversationItemMessageType.SYSTEM] + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Literal["message"] + + @overload + def __init__( + self, + *, + content: list[RealtimeConversationItemMessageSystemContent], + id: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + status: Optional[Literal[completed, incomplete, in_progress]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeConversationItemMessageSystemContent(_Model): + text: Optional[str] + type: Optional[Literal["input_text"]] + + @overload + def __init__( + self, + *, + text: Optional[str] = ..., + type: Optional[Literal[input_text]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeConversationItemMessageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ASSISTANT = "assistant" + SYSTEM = "system" + USER = "user" + + + class azure.ai.voiceagents.models.RealtimeConversationItemMessageUser(RealtimeConversationItemMessage, discriminator='user'): + content: list[RealtimeConversationItemMessageUserContent] + id: Optional[str] + object: Optional[Literal["item"]] + role: Literal[RealtimeConversationItemMessageType.USER] + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Literal["message"] + + @overload + def __init__( + self, + *, + content: list[RealtimeConversationItemMessageUserContent], + id: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + status: Optional[Literal[completed, incomplete, in_progress]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeConversationItemMessageUserContent(_Model): + audio: Optional[str] + detail: Optional[Literal["auto", "low", "high"]] + image_url: Optional[str] + text: Optional[str] + transcript: Optional[str] + type: Optional[Literal["input_text", "input_audio", "input_image"]] + + @overload + def __init__( + self, + *, + audio: Optional[str] = ..., + detail: Optional[Literal[auto, low, high]] = ..., + image_url: Optional[str] = ..., + text: Optional[str] = ..., + transcript: Optional[str] = ..., + type: Optional[Literal[input_text, input_audio, input_image]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FUNCTION_CALL = "function_call" + FUNCTION_CALL_OUTPUT = "function_call_output" + MCP_APPROVAL_REQUEST = "mcp_approval_request" + MCP_APPROVAL_RESPONSE = "mcp_approval_response" + MCP_CALL = "mcp_call" + MCP_LIST_TOOLS = "mcp_list_tools" + + + class azure.ai.voiceagents.models.RealtimeFunctionTool(_Model): + description: Optional[str] + name: Optional[str] + parameters: Optional[RealtimeFunctionToolParameters] + type: Optional[Literal["function"]] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + name: Optional[str] = ..., + parameters: Optional[RealtimeFunctionToolParameters] = ..., + type: Optional[Literal[function]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeFunctionToolParameters(_Model): + + + class azure.ai.voiceagents.models.RealtimeMCPApprovalRequest(RealtimeConversationItem, discriminator='mcp_approval_request'): + arguments: str + id: str + name: str + server_label: str + type: Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST] + + @overload + def __init__( + self, + *, + arguments: str, + id: str, + name: str, + server_label: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeMCPApprovalResponse(RealtimeConversationItem, discriminator='mcp_approval_response'): + approval_request_id: str + approve: bool + id: str + reason: Optional[str] + type: Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE] + + @overload + def __init__( + self, + *, + approval_request_id: str, + approve: bool, + id: str, + reason: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeMCPError(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeMCPHTTPError(RealtimeMCPError, discriminator='http_error'): + code: int + message: str + type: Literal[RealtimeMcpErrorType.HTTP_ERROR] + + @overload + def __init__( + self, + *, + code: int, + message: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeMCPListTools(RealtimeConversationItem, discriminator='mcp_list_tools'): + id: Optional[str] + server_label: str + tools: list[MCPListToolsTool] + type: Literal[RealtimeConversationItemType.MCP_LIST_TOOLS] + + @overload + def __init__( + self, + *, + id: Optional[str] = ..., + server_label: str, + tools: list[MCPListToolsTool] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeMCPProtocolError(RealtimeMCPError, discriminator='protocol_error'): + code: int + message: str + type: Literal[RealtimeMcpErrorType.PROTOCOL_ERROR] + + @overload + def __init__( + self, + *, + code: int, + message: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeMCPToolCall(RealtimeConversationItem, discriminator='mcp_call'): + approval_request_id: Optional[str] + arguments: str + error: Optional[RealtimeMCPError] + id: str + name: str + output: Optional[str] + server_label: str + type: Literal[RealtimeConversationItemType.MCP_CALL] + + @overload + def __init__( + self, + *, + approval_request_id: Optional[str] = ..., + arguments: str, + error: Optional[RealtimeMCPError] = ..., + id: str, + name: str, + output: Optional[str] = ..., + server_label: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeMCPToolExecutionError(RealtimeMCPError, discriminator='tool_execution_error'): + message: str + type: Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR] + + @overload + def __init__( + self, + *, + message: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeMcpErrorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HTTP_ERROR = "http_error" + PROTOCOL_ERROR = "protocol_error" + TOOL_EXECUTION_ERROR = "tool_execution_error" + + + class azure.ai.voiceagents.models.RealtimeReasoning(_Model): + effort: Optional[Union[str, RealtimeReasoningEffort]] + + @overload + def __init__( + self, + *, + effort: Optional[Union[str, RealtimeReasoningEffort]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HIGH = "high" + LOW = "low" + MEDIUM = "medium" + MINIMAL = "minimal" + XHIGH = "xhigh" + + + class azure.ai.voiceagents.models.RealtimeResponseStatusDetails(_Model): + error: Optional[RealtimeResponseStatusDetailsError] + reason: Optional[Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"]] + type: Optional[Literal["completed", "cancelled", "failed", "incomplete"]] + + @overload + def __init__( + self, + *, + error: Optional[RealtimeResponseStatusDetailsError] = ..., + reason: Optional[Literal[turn_detected, client_cancelled, max_output_tokens, content_filter]] = ..., + type: Optional[Literal[completed, cancelled, failed, incomplete]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeResponseStatusDetailsError(_Model): + code: Optional[str] + type: Optional[str] + + @overload + def __init__( + self, + *, + code: Optional[str] = ..., + type: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeResponseUsage(_Model): + input_token_details: Optional[RealtimeResponseUsageInputTokenDetails] + input_tokens: Optional[int] + output_token_details: Optional[RealtimeResponseUsageOutputTokenDetails] + output_tokens: Optional[int] + total_tokens: Optional[int] + + @overload + def __init__( + self, + *, + input_token_details: Optional[RealtimeResponseUsageInputTokenDetails] = ..., + input_tokens: Optional[int] = ..., + output_token_details: Optional[RealtimeResponseUsageOutputTokenDetails] = ..., + output_tokens: Optional[int] = ..., + total_tokens: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeResponseUsageInputTokenDetails(_Model): + audio_tokens: Optional[int] + cached_tokens: Optional[int] + cached_tokens_details: Optional[RealtimeResponseUsageInputTokenDetailsCachedTokensDetails] + image_tokens: Optional[int] + text_tokens: Optional[int] + + @overload + def __init__( + self, + *, + audio_tokens: Optional[int] = ..., + cached_tokens: Optional[int] = ..., + cached_tokens_details: Optional[RealtimeResponseUsageInputTokenDetailsCachedTokensDetails] = ..., + image_tokens: Optional[int] = ..., + text_tokens: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails(_Model): + audio_tokens: Optional[int] + image_tokens: Optional[int] + text_tokens: Optional[int] + + @overload + def __init__( + self, + *, + audio_tokens: Optional[int] = ..., + image_tokens: Optional[int] = ..., + text_tokens: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeResponseUsageOutputTokenDetails(_Model): + audio_tokens: Optional[int] + text_tokens: Optional[int] + + @overload + def __init__( + self, + *, + audio_tokens: Optional[int] = ..., + text_tokens: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeServerEvent(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError(_Model): + code: Optional[str] + message: Optional[str] + param: Optional[str] + type: Optional[str] + + @overload + def __init__( + self, + *, + code: Optional[str] = ..., + message: Optional[str] = ..., + param: Optional[str] = ..., + type: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeServerEventRateLimitsUpdatedRateLimits(_Model): + limit: Optional[int] + name: Optional[Literal["requests", "tokens"]] + remaining: Optional[int] + reset_seconds: Optional[float] + + @overload + def __init__( + self, + *, + limit: Optional[int] = ..., + name: Optional[Literal[requests, tokens]] = ..., + remaining: Optional[int] = ..., + reset_seconds: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeServerEventResponseContentPartAdded(RealtimeServerEvent, discriminator='response.content_part.added'): + content_index: int + event_id: str + item_id: str + output_index: int + part: RealtimeServerEventResponseContentPartAddedPart + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED] + + @overload + def __init__( + self, + *, + content_index: int, + event_id: str, + item_id: str, + output_index: int, + part: RealtimeServerEventResponseContentPartAddedPart, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeServerEventResponseContentPartAddedPart(_Model): + audio: Optional[str] + text: Optional[str] + transcript: Optional[str] + type: Optional[Literal["audio", "text"]] + + @overload + def __init__( + self, + *, + audio: Optional[str] = ..., + text: Optional[str] = ..., + transcript: Optional[str] = ..., + type: Optional[Literal[audio, text]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.RealtimeServerEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONVERSATION_CREATED = "conversation.created" + CONVERSATION_ITEM_ADDED = "conversation.item.added" + CONVERSATION_ITEM_CREATED = "conversation.item.created" + CONVERSATION_ITEM_DELETED = "conversation.item.deleted" + CONVERSATION_ITEM_DONE = "conversation.item.done" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED = "conversation.item.input_audio_transcription.completed" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA = "conversation.item.input_audio_transcription.delta" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED = "conversation.item.input_audio_transcription.failed" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT = "conversation.item.input_audio_transcription.segment" + CONVERSATION_ITEM_RETRIEVED = "conversation.item.retrieved" + CONVERSATION_ITEM_TRUNCATED = "conversation.item.truncated" + ERROR = "error" + INPUT_AUDIO_BUFFER_CLEARED = "input_audio_buffer.cleared" + INPUT_AUDIO_BUFFER_COMMITTED = "input_audio_buffer.committed" + INPUT_AUDIO_BUFFER_DTMF_EVENT_RECEIVED = "input_audio_buffer.dtmf_event_received" + INPUT_AUDIO_BUFFER_SPEECH_STARTED = "input_audio_buffer.speech_started" + INPUT_AUDIO_BUFFER_SPEECH_STOPPED = "input_audio_buffer.speech_stopped" + INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED = "input_audio_buffer.timeout_triggered" + MCP_LIST_TOOLS_COMPLETED = "mcp_list_tools.completed" + MCP_LIST_TOOLS_FAILED = "mcp_list_tools.failed" + MCP_LIST_TOOLS_IN_PROGRESS = "mcp_list_tools.in_progress" + OUTPUT_AUDIO_BUFFER_CLEARED = "output_audio_buffer.cleared" + OUTPUT_AUDIO_BUFFER_STARTED = "output_audio_buffer.started" + OUTPUT_AUDIO_BUFFER_STOPPED = "output_audio_buffer.stopped" + RATE_LIMITS_UPDATED = "rate_limits.updated" + RESPONSE_CONTENT_PART_ADDED = "response.content_part.added" + RESPONSE_CONTENT_PART_DONE = "response.content_part.done" + RESPONSE_CREATED = "response.created" + RESPONSE_DONE = "response.done" + RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA = "response.function_call_arguments.delta" + RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE = "response.function_call_arguments.done" + RESPONSE_MCP_CALL_ARGUMENTS_DELTA = "response.mcp_call_arguments.delta" + RESPONSE_MCP_CALL_ARGUMENTS_DONE = "response.mcp_call_arguments.done" + RESPONSE_MCP_CALL_COMPLETED = "response.mcp_call.completed" + RESPONSE_MCP_CALL_FAILED = "response.mcp_call.failed" + RESPONSE_MCP_CALL_IN_PROGRESS = "response.mcp_call.in_progress" + RESPONSE_OUTPUT_AUDIO_DELTA = "response.output_audio.delta" + RESPONSE_OUTPUT_AUDIO_DONE = "response.output_audio.done" + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA = "response.output_audio_transcript.delta" + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE = "response.output_audio_transcript.done" + RESPONSE_OUTPUT_ITEM_ADDED = "response.output_item.added" + RESPONSE_OUTPUT_ITEM_DONE = "response.output_item.done" + RESPONSE_OUTPUT_TEXT_DELTA = "response.output_text.delta" + RESPONSE_OUTPUT_TEXT_DONE = "response.output_text.done" + SESSION_CREATED = "session.created" + SESSION_UPDATED = "session.updated" + + + class azure.ai.voiceagents.models.RealtimeToolChoiceFunction(_Model): + name: str + type: Literal[ToolChoiceParamType.FUNCTION] + + @overload + def __init__( + self, + *, + name: str, + type: Literal[ToolChoiceParamType.FUNCTION] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.ResponsesProtocolConfiguration(_Model): + + + class azure.ai.voiceagents.models.StructuredInputDefinition(_Model): + default_value: Optional[Any] + description: Optional[str] + required: Optional[bool] + schema: Optional[dict[str, Any]] + + @overload + def __init__( + self, + *, + default_value: Optional[Any] = ..., + description: Optional[str] = ..., + required: Optional[bool] = ..., + schema: Optional[dict[str, Any]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.TemplateVoiceGreetingConfig(VoiceGreetingConfig, discriminator='template'): + text: str + type: Literal["template"] + + @overload + def __init__( + self, + *, + text: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.Tool(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.ToolChoiceFunction(ToolChoiceParam, discriminator='function'): + name: str + type: Literal[ToolChoiceParamType.FUNCTION] + + @overload + def __init__( + self, + *, + name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.ToolChoiceMCP(ToolChoiceParam, discriminator='mcp'): + name: Optional[str] + server_label: str + type: Literal[ToolChoiceParamType.MCP] + + @overload + def __init__( + self, + *, + name: Optional[str] = ..., + server_label: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.ToolChoiceOptions(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "auto" + NONE = "none" + REQUIRED = "required" + + + class azure.ai.voiceagents.models.ToolChoiceParam(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.ToolChoiceParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ALLOWED_TOOLS = "allowed_tools" + APPLY_PATCH = "apply_patch" + CODE_INTERPRETER = "code_interpreter" + COMPUTER = "computer" + COMPUTER_USE = "computer_use" + COMPUTER_USE_PREVIEW = "computer_use_preview" + CUSTOM = "custom" + FILE_SEARCH = "file_search" + FUNCTION = "function" + IMAGE_GENERATION = "image_generation" + MCP = "mcp" + PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" + SHELL = "shell" + WEB_SEARCH_PREVIEW = "web_search_preview" + WEB_SEARCH_PREVIEW2025_03_11 = "web_search_preview_2025_03_11" + + + class azure.ai.voiceagents.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.voiceagents.models.ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + A2_A_PREVIEW = "a2a_preview" + APPLY_PATCH = "apply_patch" + AZURE_AI_SEARCH = "azure_ai_search" + AZURE_FUNCTION = "azure_function" + BING_CUSTOM_SEARCH_PREVIEW = "bing_custom_search_preview" + BING_GROUNDING = "bing_grounding" + BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" + CAPTURE_STRUCTURED_OUTPUTS = "capture_structured_outputs" + CODE_INTERPRETER = "code_interpreter" + COMPUTER = "computer" + COMPUTER_USE_PREVIEW = "computer_use_preview" + CUSTOM = "custom" + FABRIC_DATAAGENT_PREVIEW = "fabric_dataagent_preview" + FABRIC_IQ_PREVIEW = "fabric_iq_preview" + FILE_SEARCH = "file_search" + FUNCTION = "function" + IMAGE_GENERATION = "image_generation" + LOCAL_SHELL = "local_shell" + MCP = "mcp" + MEMORY_SEARCH_PREVIEW = "memory_search_preview" + NAMESPACE = "namespace" + OPENAPI = "openapi" + PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" + SHAREPOINT_GROUNDING_PREVIEW = "sharepoint_grounding_preview" + SHELL = "shell" + TOOLBOX_SEARCH_PREVIEW = "toolbox_search_preview" + TOOL_SEARCH = "tool_search" + WEB_SEARCH = "web_search" + WEB_SEARCH_PREVIEW = "web_search_preview" + WORK_IQ_PREVIEW = "work_iq_preview" + + + class azure.ai.voiceagents.models.TranscriptTextUsageDuration(CreateTranscriptionResponseJsonUsage, discriminator='duration'): + seconds: timedelta + type: Literal[CreateTranscriptionResponseJsonUsageType.DURATION] + + @overload + def __init__( + self, + *, + seconds: timedelta + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.TranscriptTextUsageTokens(CreateTranscriptionResponseJsonUsage, discriminator='tokens'): + input_token_details: Optional[TranscriptTextUsageTokensInputTokenDetails] + input_tokens: int + output_tokens: int + total_tokens: int + type: Literal[CreateTranscriptionResponseJsonUsageType.TOKENS] + + @overload + def __init__( + self, + *, + input_token_details: Optional[TranscriptTextUsageTokensInputTokenDetails] = ..., + input_tokens: int, + output_tokens: int, + total_tokens: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.TranscriptTextUsageTokensInputTokenDetails(_Model): + audio_tokens: Optional[int] + text_tokens: Optional[int] + + @overload + def __init__( + self, + *, + audio_tokens: Optional[int] = ..., + text_tokens: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VersionSelectionRule(_Model): + agent_version: str + type: str + + @overload + def __init__( + self, + *, + agent_version: str, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VersionSelector(_Model): + version_selection_rules: list[VersionSelectionRule] + + @overload + def __init__( + self, + *, + version_selection_rules: list[VersionSelectionRule] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VersionSelectorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FIXED_RATIO = "FixedRatio" + + + class azure.ai.voiceagents.models.VoiceAgentAnimationConfig(_Model): + model_name: Optional[str] + outputs: Optional[list[Union[str, VoiceAgentAnimationOutputType]]] + + @overload + def __init__( + self, + *, + model_name: Optional[str] = ..., + outputs: Optional[list[Union[str, VoiceAgentAnimationOutputType]]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentAnimationOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BLENDSHAPES = "blendshapes" + VISEME_ID = "viseme_id" + + + class azure.ai.voiceagents.models.VoiceAgentAvatarIceServer(_Model): + credential: Optional[str] + urls: list[str] + username: Optional[str] + + @overload + def __init__( + self, + *, + credential: Optional[str] = ..., + urls: list[str], + username: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentAvatarOutputProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + WEBRTC = "webrtc" + WEBSOCKET = "websocket" + WEBSOCKET_BINARY = "websocket-binary" + + + class azure.ai.voiceagents.models.VoiceAgentAvatarScene(_Model): + amplitude: Optional[float] + position_x: Optional[float] + position_y: Optional[float] + rotation_x: Optional[float] + rotation_y: Optional[float] + rotation_z: Optional[float] + zoom: Optional[float] + + @overload + def __init__( + self, + *, + amplitude: Optional[float] = ..., + position_x: Optional[float] = ..., + position_y: Optional[float] = ..., + rotation_x: Optional[float] = ..., + rotation_y: Optional[float] = ..., + rotation_z: Optional[float] = ..., + zoom: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentAvatarType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PHOTO_AVATAR = "photo_avatar" + VIDEO_AVATAR = "video_avatar" + + + class azure.ai.voiceagents.models.VoiceAgentAvatarVideoBackground(_Model): + color: Optional[str] + image_url: Optional[str] + + @overload + def __init__( + self, + *, + color: Optional[str] = ..., + image_url: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentAvatarVideoCrop(_Model): + bottom_right: list[int] + top_left: list[int] + + @overload + def __init__( + self, + *, + bottom_right: list[int], + top_left: list[int] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentAvatarVideoParams(_Model): + background: Optional[VoiceAgentAvatarVideoBackground] + bitrate: Optional[int] + codec: Optional[Literal["h264"]] + crop: Optional[VoiceAgentAvatarVideoCrop] + gop_size: Optional[int] + resolution: Optional[VoiceAgentAvatarVideoResolution] + + @overload + def __init__( + self, + *, + background: Optional[VoiceAgentAvatarVideoBackground] = ..., + bitrate: Optional[int] = ..., + codec: Optional[Literal[h264]] = ..., + crop: Optional[VoiceAgentAvatarVideoCrop] = ..., + gop_size: Optional[int] = ..., + resolution: Optional[VoiceAgentAvatarVideoResolution] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentAvatarVideoResolution(_Model): + height: int + width: int + + @overload + def __init__( + self, + *, + height: int, + width: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentAzureMultilingualSemanticVadTurnDetection(_Model): + auto_truncate: Optional[bool] + create_response: Optional[bool] + end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] + idle_timeout_ms: Optional[int] + interrupt_response: Optional[bool] + languages: Optional[list[str]] + prefix_padding_ms: Optional[int] + remove_filler_words: Optional[bool] + silence_duration_ms: Optional[int] + speech_duration_ms: Optional[int] + threshold: Optional[float] + type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] + + @overload + def __init__( + self, + *, + auto_truncate: Optional[bool] = ..., + create_response: Optional[bool] = ..., + end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] = ..., + idle_timeout_ms: Optional[int] = ..., + interrupt_response: Optional[bool] = ..., + languages: Optional[list[str]] = ..., + prefix_padding_ms: Optional[int] = ..., + remove_filler_words: Optional[bool] = ..., + silence_duration_ms: Optional[int] = ..., + speech_duration_ms: Optional[int] = ..., + threshold: Optional[float] = ..., + type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentAzureSemanticVadTurnDetection(_Model): + auto_truncate: Optional[bool] + create_response: Optional[bool] + end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] + idle_timeout_ms: Optional[int] + interrupt_response: Optional[bool] + languages: Optional[list[str]] + prefix_padding_ms: Optional[int] + remove_filler_words: Optional[bool] + silence_duration_ms: Optional[int] + speech_duration_ms: Optional[int] + threshold: Optional[float] + type: Union[str, VoiceAgentAzureSemanticVadType] + + @overload + def __init__( + self, + *, + auto_truncate: Optional[bool] = ..., + create_response: Optional[bool] = ..., + end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] = ..., + idle_timeout_ms: Optional[int] = ..., + interrupt_response: Optional[bool] = ..., + languages: Optional[list[str]] = ..., + prefix_padding_ms: Optional[int] = ..., + remove_filler_words: Optional[bool] = ..., + silence_duration_ms: Optional[int] = ..., + speech_duration_ms: Optional[int] = ..., + threshold: Optional[float] = ..., + type: Union[str, VoiceAgentAzureSemanticVadType] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentAzureSemanticVadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DEFAULT = "azure_semantic_vad" + ENGLISH = "azure_semantic_vad_en" + + + class azure.ai.voiceagents.models.VoiceAgentClientEventConversationItemCreate(_Model): + event_id: Optional[str] + item: VoiceAgentCreateConversationItem + previous_item_id: Optional[str] + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item: VoiceAgentCreateConversationItem, + previous_item_id: Optional[str] = ..., + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentClientEventConversationItemDelete(_Model): + event_id: Optional[str] + item_id: str + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item_id: str, + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentClientEventConversationItemRetrieve(_Model): + event_id: Optional[str] + item_id: str + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item_id: str, + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentClientEventConversationItemTruncate(_Model): + audio_end_ms: int + content_index: int + event_id: Optional[str] + item_id: str + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE] + + @overload + def __init__( + self, + *, + audio_end_ms: int, + content_index: int, + event_id: Optional[str] = ..., + item_id: str, + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentClientEventInputAudioBufferAppend(_Model): + audio: str + event_id: Optional[str] + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND] + + @overload + def __init__( + self, + *, + audio: str, + event_id: Optional[str] = ..., + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentClientEventInputAudioBufferClear(_Model): + event_id: Optional[str] + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentClientEventInputAudioBufferCommit(_Model): + event_id: Optional[str] + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentClientEventOutputAudioBufferClear(_Model): + event_id: Optional[str] + type: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + type: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentClientEventResponseCancel(_Model): + event_id: Optional[str] + response_id: Optional[str] + type: Literal[RealtimeClientEventType.RESPONSE_CANCEL] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + response_id: Optional[str] = ..., + type: Literal[RealtimeClientEventType.RESPONSE_CANCEL] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentClientEventResponseCreate(_Model): + event_id: Optional[str] + response: Optional[VoiceAgentResponseCreateParams] + type: Literal[RealtimeClientEventType.RESPONSE_CREATE] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + response: Optional[VoiceAgentResponseCreateParams] = ..., + type: Literal[RealtimeClientEventType.RESPONSE_CREATE] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentClientEventSessionAvatarConnect(_Model): + client_sdp: str + event_id: Optional[str] + type: Literal["connect"] + + @overload + def __init__( + self, + *, + client_sdp: str, + event_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentClientEventSessionUpdate(_Model): + event_id: Optional[str] + session: VoiceAgentSessionUpdateConfig + type: Literal[RealtimeClientEventType.SESSION_UPDATE] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + session: VoiceAgentSessionUpdateConfig, + type: Literal[RealtimeClientEventType.SESSION_UPDATE] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentDefinition(_Model): + audio: Optional[VoiceAudioConfig] + avatar: Optional[VoiceAvatarConfig] + greeting: Optional[VoiceGreetingConfig] + instructions: Optional[str] + kind: Literal["voice"] + model: str + model_type: Union[str, VoiceModelType] + output_modalities: Optional[list[Union[str, VoiceOutputModality]]] + rai_config: Optional[RaiConfig] + store: Optional[bool] + structured_inputs: Optional[dict[str, StructuredInputDefinition]] + tools: Optional[list[VoiceAgentTool]] + + @overload + def __init__( + self, + *, + audio: Optional[VoiceAudioConfig] = ..., + avatar: Optional[VoiceAvatarConfig] = ..., + greeting: Optional[VoiceGreetingConfig] = ..., + instructions: Optional[str] = ..., + model: str, + model_type: Union[str, VoiceModelType], + output_modalities: Optional[list[Union[str, VoiceOutputModality]]] = ..., + rai_config: Optional[RaiConfig] = ..., + store: Optional[bool] = ..., + structured_inputs: Optional[dict[str, StructuredInputDefinition]] = ..., + tools: Optional[list[VoiceAgentTool]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentEchoCancellation(_Model): + channels: Optional[int] + reference_source: Optional[Union[str, VoiceAgentEchoCancellationReferenceSource]] + type: Literal["server_echo_cancellation"] + + @overload + def __init__( + self, + *, + channels: Optional[int] = ..., + reference_source: Optional[Union[str, VoiceAgentEchoCancellationReferenceSource]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentEchoCancellationReferenceSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CLIENT = "client" + SERVER = "server" + + + class azure.ai.voiceagents.models.VoiceAgentEndOfUtteranceDetection(_Model): + model: Union[str, VoiceAgentEndOfUtteranceModel] + threshold: Optional[float] + threshold_level: Optional[Union[str, VoiceAgentEndOfUtteranceThresholdLevel]] + timeout: Optional[float] + timeout_ms: Optional[int] + + @overload + def __init__( + self, + *, + model: Union[str, VoiceAgentEndOfUtteranceModel], + threshold: Optional[float] = ..., + threshold_level: Optional[Union[str, VoiceAgentEndOfUtteranceThresholdLevel]] = ..., + timeout: Optional[float] = ..., + timeout_ms: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentEndOfUtteranceModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SEMANTIC_DETECTION_V1 = "semantic_detection_v1" + SEMANTIC_DETECTION_V1_EN = "semantic_detection_v1_en" + SEMANTIC_DETECTION_V1_MULTILINGUAL = "semantic_detection_v1_multilingual" + SMART_END_OF_TURN_DETECTION = "smart_end_of_turn_detection" + + + class azure.ai.voiceagents.models.VoiceAgentEndOfUtteranceThresholdLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DEFAULT = "default" + HIGH = "high" + LOW = "low" + MEDIUM = "medium" + + + class azure.ai.voiceagents.models.VoiceAgentEstimatedCost(_Model): + amount: float + byom_model_amount: Optional[float] + byom_model_price_version: Optional[str] + currency: Optional[Literal["USD"]] + input_cost: Optional[float] + output_cost: Optional[float] + price_version: str + status: Union[str, VoiceAgentEstimatedCostStatus] + unpriced_components: Optional[list[str]] + voice_live_amount: float + + @overload + def __init__( + self, + *, + amount: float, + byom_model_amount: Optional[float] = ..., + byom_model_price_version: Optional[str] = ..., + currency: Optional[Literal[USD]] = ..., + input_cost: Optional[float] = ..., + output_cost: Optional[float] = ..., + price_version: str, + status: Union[str, VoiceAgentEstimatedCostStatus], + unpriced_components: Optional[list[str]] = ..., + voice_live_amount: float + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentEstimatedCostStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMPLETE = "complete" + PARTIAL = "partial" + UNAVAILABLE = "unavailable" + + + class azure.ai.voiceagents.models.VoiceAgentFileSearchCallItem(_Model): + id: str + queries: Optional[list[str]] + results: Optional[list[VoiceAgentFileSearchResult]] + status: Union[str, VoiceAgentFileSearchCallStatus] + type: Literal["file_search_call"] + + @overload + def __init__( + self, + *, + id: str, + queries: Optional[list[str]] = ..., + results: Optional[list[VoiceAgentFileSearchResult]] = ..., + status: Union[str, VoiceAgentFileSearchCallStatus] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentFileSearchCallStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMPLETED = "completed" + FAILED = "failed" + INCOMPLETE = "incomplete" + IN_PROGRESS = "in_progress" + SEARCHING = "searching" + + + class azure.ai.voiceagents.models.VoiceAgentFileSearchResult(_Model): + attributes: Optional[dict[str, VoiceAgentFileSearchAttributeValue]] + file_id: Optional[str] + filename: Optional[str] + score: Optional[float] + text: Optional[str] + + @overload + def __init__( + self, + *, + attributes: Optional[dict[str, VoiceAgentFileSearchAttributeValue]] = ..., + file_id: Optional[str] = ..., + filename: Optional[str] = ..., + score: Optional[float] = ..., + text: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentHandoffAbortReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ERROR = "error" + USER_INTERRUPTION = "user_interruption" + + + class azure.ai.voiceagents.models.VoiceAgentHandoffEdgeConfig(_Model): + cancel_on_interruption: Optional[bool] + delay_ms: Optional[int] + description: str + id: str + source: str + target: str + target_response: Optional[Union[str, VoiceAgentHandoffTargetResponse]] + transfer_message: Optional[str] + + @overload + def __init__( + self, + *, + cancel_on_interruption: Optional[bool] = ..., + delay_ms: Optional[int] = ..., + description: str, + id: str, + source: str, + target: str, + target_response: Optional[Union[str, VoiceAgentHandoffTargetResponse]] = ..., + transfer_message: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentHandoffEdgeState(_Model): + cancel_on_interruption: Optional[bool] + delay_ms: Optional[int] + id: str + source: str + target: str + target_response: Optional[Union[str, VoiceAgentHandoffTargetResponse]] + transfer_message: Optional[str] + + @overload + def __init__( + self, + *, + cancel_on_interruption: Optional[bool] = ..., + delay_ms: Optional[int] = ..., + id: str, + source: str, + target: str, + target_response: Optional[Union[str, VoiceAgentHandoffTargetResponse]] = ..., + transfer_message: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentHandoffGraphConfig(_Model): + edges: list[VoiceAgentHandoffEdgeConfig] + max_attempts: Optional[int] + max_transfers: Optional[int] + nodes: list[VoiceAgentHandoffNodeConfig] + + @overload + def __init__( + self, + *, + edges: list[VoiceAgentHandoffEdgeConfig], + max_attempts: Optional[int] = ..., + max_transfers: Optional[int] = ..., + nodes: list[VoiceAgentHandoffNodeConfig] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentHandoffNodeConfig(_Model): + config: VoiceAgentHandoffNodeSessionConfig + description: str + id: str + + @overload + def __init__( + self, + *, + config: VoiceAgentHandoffNodeSessionConfig, + description: str, + id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentHandoffNodeSessionConfig(_Model): + instructions: Optional[str] + interim_response: Optional[VoiceAgentInterimResponse] + max_response_output_tokens: Optional[VoiceAgentMaxOutputTokens] + model: Optional[str] + parallel_tool_calls: Optional[bool] + reasoning_effort: Optional[Union[str, VoiceAgentHandoffReasoningEffort]] + temperature: Optional[float] + tool_choice: Optional[VoiceAgentToolChoice] + tools: Optional[list[VoiceAgentSessionTool]] + voice: Optional[VoiceAgentVoice] + voice_adaptation: Optional[VoiceAgentVoiceAdaptation] + + @overload + def __init__( + self, + *, + instructions: Optional[str] = ..., + interim_response: Optional[VoiceAgentInterimResponse] = ..., + max_response_output_tokens: Optional[VoiceAgentMaxOutputTokens] = ..., + model: Optional[str] = ..., + parallel_tool_calls: Optional[bool] = ..., + reasoning_effort: Optional[Union[str, VoiceAgentHandoffReasoningEffort]] = ..., + temperature: Optional[float] = ..., + tool_choice: Optional[VoiceAgentToolChoice] = ..., + tools: Optional[list[VoiceAgentSessionTool]] = ..., + voice: Optional[VoiceAgentVoice] = ..., + voice_adaptation: Optional[VoiceAgentVoiceAdaptation] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentHandoffNodeState(_Model): + description: str + id: str + implicit: Optional[bool] + + @overload + def __init__( + self, + *, + description: str, + id: str, + implicit: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentHandoffReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HIGH = "high" + LOW = "low" + MEDIUM = "medium" + MINIMAL = "minimal" + NONE = "none" + XHIGH = "xhigh" + + + class azure.ai.voiceagents.models.VoiceAgentHandoffState(_Model): + active_node_id: str + attempt_count: int + available_edge_ids: list[str] + edges: list[VoiceAgentHandoffEdgeState] + node_generation: int + nodes: list[VoiceAgentHandoffNodeState] + pipeline_family: Union[str, VoiceAgentPipelineFamily] + transfer_count: int + transfer_tool: RealtimeFunctionTool + + @overload + def __init__( + self, + *, + active_node_id: str, + attempt_count: int, + available_edge_ids: list[str], + edges: list[VoiceAgentHandoffEdgeState], + node_generation: int, + nodes: list[VoiceAgentHandoffNodeState], + pipeline_family: Union[str, VoiceAgentPipelineFamily], + transfer_count: int, + transfer_tool: RealtimeFunctionTool + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentHandoffTargetResponse(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "auto" + NONE = "none" + + + class azure.ai.voiceagents.models.VoiceAgentInterimResponseConfig(_Model): + latency_threshold_ms: Optional[int] + triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] + type: str + + @overload + def __init__( + self, + *, + latency_threshold_ms: Optional[int] = ..., + triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] = ..., + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentInterimResponseTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LATENCY = "latency" + TOOL = "tool" + + + class azure.ai.voiceagents.models.VoiceAgentLlmInterimResponseConfig(VoiceAgentInterimResponseConfig, discriminator='llm_interim_response'): + instructions: Optional[str] + latency_threshold_ms: int + max_completion_tokens: Optional[int] + model: Optional[str] + triggers: Union[list[str, VoiceAgentInterimResponseTrigger]] + type: Literal["llm_interim_response"] + + @overload + def __init__( + self, + *, + instructions: Optional[str] = ..., + latency_threshold_ms: Optional[int] = ..., + max_completion_tokens: Optional[int] = ..., + model: Optional[str] = ..., + triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentMcpApprovalMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ALWAYS = "always" + NEVER_REQUIRE = "never" + + + class azure.ai.voiceagents.models.VoiceAgentMcpAssignedManagedIdentity(_Model): + audience: str + client_id: Optional[str] + type: Literal["assigned_managed_identity"] + + @overload + def __init__( + self, + *, + audience: str, + client_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentMcpResponseScheduling(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INTERRUPT = "interrupt" + SILENT = "silent" + SKIP_IF_BUSY = "skip_if_busy" + WHEN_IDLE = "when_idle" + + + class azure.ai.voiceagents.models.VoiceAgentMcpTool(_Model): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] + allowed_tools: Optional[Union[list[str], MCPToolFilter]] + defer_loading: Optional[bool] + headers: Optional[dict[str, str]] + project_connection_id: Optional[str] + require_approval: Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] + response_scheduling: Optional[Union[str, VoiceAgentMcpResponseScheduling]] + server_description: Optional[str] + server_label: str + server_url: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.MCP] + + @overload + def __init__( + self, + *, + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., + allowed_tools: Optional[Union[list[str], MCPToolFilter]] = ..., + defer_loading: Optional[bool] = ..., + headers: Optional[dict[str, str]] = ..., + project_connection_id: Optional[str] = ..., + require_approval: Optional[Union[MCPToolRequireApproval, Literal[always], Literal[never]]] = ..., + response_scheduling: Optional[Union[str, VoiceAgentMcpResponseScheduling]] = ..., + server_description: Optional[str] = ..., + server_label: str, + server_url: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ..., + type: Literal[ToolType.MCP] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentObject(_Model): + agent_card: Optional[AgentCard] + agent_endpoint: Optional[AgentEndpointConfig] + blueprint: Optional[AgentIdentity] + blueprint_reference: Optional[AgentBlueprintReference] + id: str + instance_identity: Optional[AgentIdentity] + name: str + object: Literal[AgentObjectType.AGENT] + state: Union[str, AgentState] + state_source: Optional[Union[str, AgentStateSource]] + versions: VoiceAgentObjectVersions + + @overload + def __init__( + self, + *, + agent_card: Optional[AgentCard] = ..., + agent_endpoint: Optional[AgentEndpointConfig] = ..., + id: str, + name: str, + object: Literal[AgentObjectType.AGENT], + versions: VoiceAgentObjectVersions + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentObjectVersions(_Model): + latest: VoiceAgentVersionObject + + @overload + def __init__( + self, + *, + latest: VoiceAgentVersionObject + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentPipelineFamily(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CASCADED = "cascaded" + REALTIME = "realtime" + + + class azure.ai.voiceagents.models.VoiceAgentRealtimeResponse(_Model): + conversation_id: Optional[str] + estimated_cost: Optional[VoiceAgentEstimatedCost] + id: str + max_output_tokens: Optional[VoiceAgentMaxOutputTokens] + metadata: Optional[dict[str, str]] + modalities: Optional[list[Union[str, VoiceOutputModality]]] + object: Literal["response"] + output: list[VoiceAgentResponseItem] + output_audio_format: Optional[Union[str, VoiceAgentResponseAudioFormat]] + status: Union[str, VoiceAgentResponseStatus] + status_details: RealtimeResponseStatusDetails + temperature: Optional[float] + usage: RealtimeResponseUsage + voice: Optional[VoiceAgentVoice] + + @overload + def __init__( + self, + *, + conversation_id: Optional[str] = ..., + estimated_cost: Optional[VoiceAgentEstimatedCost] = ..., + id: str, + max_output_tokens: Optional[VoiceAgentMaxOutputTokens] = ..., + metadata: Optional[dict[str, str]] = ..., + modalities: Optional[list[Union[str, VoiceOutputModality]]] = ..., + output: list[VoiceAgentResponseItem], + output_audio_format: Optional[Union[str, VoiceAgentResponseAudioFormat]] = ..., + status: Union[str, VoiceAgentResponseStatus], + status_details: RealtimeResponseStatusDetails, + temperature: Optional[float] = ..., + usage: RealtimeResponseUsage, + voice: Optional[VoiceAgentVoice] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentResponseAudioFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): + G711_ALAW = "g711_alaw" + G711_ULAW = "g711_ulaw" + MP3 = "mp3" + MP3_24_KHZ160_KBPS = "mp3_24khz_160kbps" + MP3_24_KHZ48_KBPS = "mp3_24khz_48kbps" + MP3_24_KHZ96_KBPS = "mp3_24khz_96kbps" + PCM16 = "pcm16" + PCM16_16000_HZ = "pcm16_16000hz" + PCM16_22050_HZ = "pcm16_22050hz" + PCM16_24000_HZ = "pcm16_24000hz" + PCM16_44100_HZ = "pcm16_44100hz" + PCM16_48000_HZ = "pcm16_48000hz" + PCM16_8000_HZ = "pcm16_8000hz" + + + class azure.ai.voiceagents.models.VoiceAgentResponseCreateAudio(_Model): + output: Optional[VoiceAgentSessionUpdateAudioOutput] + + @overload + def __init__( + self, + *, + output: Optional[VoiceAgentSessionUpdateAudioOutput] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentResponseCreateParams(_Model): + audio: Optional[VoiceAgentResponseCreateAudio] + conversation: Optional[Union[Literal["auto"], Literal["none"], str]] + input: Optional[list[RealtimeConversationItem]] + instructions: Optional[str] + interim_response: Optional[VoiceAgentInterimResponse] + max_output_tokens: Optional[Union[int, Literal["inf"]]] + metadata: Optional[Metadata] + output_modalities: Optional[list[Union[str, VoiceOutputModality]]] + parallel_tool_calls: Optional[bool] + pre_generated_assistant_message: Optional[RealtimeConversationItemMessageAssistant] + reasoning: Optional[RealtimeReasoning] + tool_choice: Optional[Union[str, ToolChoiceOptions, ToolChoiceFunction, ToolChoiceMCP]] + tools: Optional[list[Union[RealtimeFunctionTool, MCPTool]]] + + @overload + def __init__( + self, + *, + audio: Optional[VoiceAgentResponseCreateAudio] = ..., + conversation: Optional[Union[Literal[auto], Literal[none], str]] = ..., + input: Optional[list[RealtimeConversationItem]] = ..., + instructions: Optional[str] = ..., + interim_response: Optional[VoiceAgentInterimResponse] = ..., + max_output_tokens: Optional[Union[int, Literal[inf]]] = ..., + metadata: Optional[Metadata] = ..., + output_modalities: Optional[list[Union[str, VoiceOutputModality]]] = ..., + parallel_tool_calls: Optional[bool] = ..., + pre_generated_assistant_message: Optional[RealtimeConversationItemMessageAssistant] = ..., + reasoning: Optional[RealtimeReasoning] = ..., + tool_choice: Optional[Union[str, ToolChoiceOptions, ToolChoiceFunction, ToolChoiceMCP]] = ..., + tools: Optional[list[Union[RealtimeFunctionTool, MCPTool]]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentResponseEventAudioContentPart(_Model): + annotations: Optional[Any] + audio: Optional[str] + format: Optional[VoiceAudioFormat] + transcript: str + type: Literal["audio"] + + @overload + def __init__( + self, + *, + annotations: Optional[Any] = ..., + audio: Optional[str] = ..., + format: Optional[VoiceAudioFormat] = ..., + transcript: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentResponseEventTextContentPart(_Model): + text: str + type: Literal["text"] + + @overload + def __init__( + self, + *, + text: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentResponseStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELLED = "cancelled" + COMPLETED = "completed" + FAILED = "failed" + INCOMPLETE = "incomplete" + IN_PROGRESS = "in_progress" + + + class azure.ai.voiceagents.models.VoiceAgentSemanticVadTurnDetection(_Model): + auto_truncate: Optional[bool] + create_response: Optional[bool] + eagerness: Optional[Literal["low", "medium", "high", "auto"]] + interrupt_response: Optional[bool] + type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD] + + @overload + def __init__( + self, + *, + auto_truncate: Optional[bool] = ..., + create_response: Optional[bool] = ..., + eagerness: Optional[Literal[low, medium, high, auto]] = ..., + interrupt_response: Optional[bool] = ..., + type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventConversationCreated(_Model): + conversation_id: str + type: Literal["created"] + + @overload + def __init__( + self, + *, + conversation_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemAdded(_Model): + event_id: str + item: VoiceAgentResponseItem + previous_item_id: Optional[str] + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED] + + @overload + def __init__( + self, + *, + event_id: str, + item: VoiceAgentResponseItem, + previous_item_id: Optional[str] = ..., + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemCreated(_Model): + event_id: str + item: VoiceAgentResponseItem + previous_item_id: Optional[str] + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED] + + @overload + def __init__( + self, + *, + event_id: str, + item: VoiceAgentResponseItem, + previous_item_id: Optional[str] = ..., + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemDeleted(_Model): + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED] + + @overload + def __init__( + self, + *, + event_id: str, + item_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemDone(_Model): + event_id: str + item: VoiceAgentResponseItem + previous_item_id: Optional[str] + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE] + + @overload + def __init__( + self, + *, + event_id: str, + item: VoiceAgentResponseItem, + previous_item_id: Optional[str] = ..., + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted(_Model): + content_index: int + event_id: str + item_id: str + logprobs: Optional[list[LogProbProperties]] + phrases: Optional[list[VoiceAgentTranscriptionPhrase]] + transcript: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED] + usage: Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration] + + @overload + def __init__( + self, + *, + content_index: int, + event_id: str, + item_id: str, + logprobs: Optional[list[LogProbProperties]] = ..., + phrases: Optional[list[VoiceAgentTranscriptionPhrase]] = ..., + transcript: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED], + usage: Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta(_Model): + content_index: Optional[int] + delta: Optional[str] + event_id: str + item_id: str + logprobs: Optional[list[LogProbProperties]] + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA] + + @overload + def __init__( + self, + *, + content_index: Optional[int] = ..., + delta: Optional[str] = ..., + event_id: str, + item_id: str, + logprobs: Optional[list[LogProbProperties]] = ..., + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed(_Model): + content_index: int + error: RealtimeServerEventConversationItemInputAudioTranscriptionFailedError + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED] + + @overload + def __init__( + self, + *, + content_index: int, + error: RealtimeServerEventConversationItemInputAudioTranscriptionFailedError, + event_id: str, + item_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment(_Model): + content_index: int + end: float + event_id: str + id: str + item_id: str + speaker: str + start: float + text: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT] + + @overload + def __init__( + self, + *, + content_index: int, + end: float, + event_id: str, + id: str, + item_id: str, + speaker: str, + start: float, + text: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemRetrieved(_Model): + event_id: str + item: VoiceAgentResponseItem + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED] + + @overload + def __init__( + self, + *, + event_id: str, + item: VoiceAgentResponseItem, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemTruncated(_Model): + audio_end_ms: int + content_index: int + event_id: str + item: Optional[RealtimeConversationItemMessageAssistant] + item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED] + + @overload + def __init__( + self, + *, + audio_end_ms: int, + content_index: int, + event_id: str, + item: Optional[RealtimeConversationItemMessageAssistant] = ..., + item_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventError(_Model): + error: VoiceAgentServerEventErrorDetails + event_id: str + type: Literal["error"] + + @overload + def __init__( + self, + *, + error: VoiceAgentServerEventErrorDetails, + event_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventErrorDetails(_Model): + code: Optional[str] + event_id: Optional[str] + message: str + param: Optional[str] + tool_label: Optional[str] + tool_type: Optional[str] + type: str + + @overload + def __init__( + self, + *, + code: Optional[str] = ..., + event_id: Optional[str] = ..., + message: str, + param: Optional[str] = ..., + tool_label: Optional[str] = ..., + tool_type: Optional[str] = ..., + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventFileSearchCallCompleted(_Model): + event_id: Optional[str] + item_id: str + output_index: int + response_id: Optional[str] + sequence_number: int + type: Literal["completed"] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item_id: str, + output_index: int, + response_id: Optional[str] = ..., + sequence_number: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventFileSearchCallInProgress(_Model): + event_id: Optional[str] + item_id: str + output_index: int + response_id: Optional[str] + sequence_number: int + type: Literal["in_progress"] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item_id: str, + output_index: int, + response_id: Optional[str] = ..., + sequence_number: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventFileSearchCallSearching(_Model): + event_id: Optional[str] + item_id: str + output_index: int + response_id: Optional[str] + sequence_number: int + type: Literal["searching"] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item_id: str, + output_index: int, + response_id: Optional[str] = ..., + sequence_number: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventInputAudioBufferCleared(_Model): + event_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED] + + @overload + def __init__( + self, + *, + event_id: str, + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventInputAudioBufferCommitted(_Model): + event_id: str + item_id: str + previous_item_id: Optional[str] + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED] + + @overload + def __init__( + self, + *, + event_id: str, + item_id: str, + previous_item_id: Optional[str] = ..., + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventInputAudioBufferSpeechStarted(_Model): + audio_start_ms: int + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED] + + @overload + def __init__( + self, + *, + audio_start_ms: int, + event_id: str, + item_id: str, + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventInputAudioBufferSpeechStopped(_Model): + audio_end_ms: int + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED] + + @overload + def __init__( + self, + *, + audio_end_ms: int, + event_id: str, + item_id: str, + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventInputAudioBufferTimeoutTriggered(_Model): + audio_end_ms: int + audio_start_ms: int + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED] + + @overload + def __init__( + self, + *, + audio_end_ms: int, + audio_start_ms: int, + event_id: str, + item_id: str, + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventMcpListToolsCompleted(_Model): + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED] + + @overload + def __init__( + self, + *, + event_id: str, + item_id: str, + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventMcpListToolsFailed(_Model): + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED] + + @overload + def __init__( + self, + *, + event_id: str, + item_id: str, + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventMcpListToolsInProgress(_Model): + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS] + + @overload + def __init__( + self, + *, + event_id: str, + item_id: str, + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventOutputAudioBufferCleared(_Model): + event_id: str + response_id: str + type: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED] + + @overload + def __init__( + self, + *, + event_id: str, + response_id: str, + type: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventRateLimitsUpdated(_Model): + event_id: str + rate_limits: list[RealtimeServerEventRateLimitsUpdatedRateLimits] + type: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED] + + @overload + def __init__( + self, + *, + event_id: str, + rate_limits: list[RealtimeServerEventRateLimitsUpdatedRateLimits], + type: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventResponseAnimationBlendshapesDelta(_Model): + content_index: int + event_id: str + frame_index: int + frames: Union[list[list[float]], str] + item_id: str + output_index: int + response_id: str + type: Literal["delta"] + + @overload + def __init__( + self, + *, + content_index: int, + event_id: str, + frame_index: int, + frames: Union[list[list[float]], str], + item_id: str, + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventResponseAnimationBlendshapesDone(_Model): + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal["done"] + + @overload + def __init__( + self, + *, + event_id: str, + item_id: str, + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventResponseAnimationVisemeDelta(_Model): + audio_offset_ms: int + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal["delta"] + viseme_id: int + + @overload + def __init__( + self, + *, + audio_offset_ms: int, + content_index: int, + event_id: str, + item_id: str, + output_index: int, + response_id: str, + viseme_id: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventResponseAnimationVisemeDone(_Model): + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal["done"] + + @overload + def __init__( + self, + *, + content_index: int, + event_id: str, + item_id: str, + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventResponseAudioDelta(_Model): + content_index: int + delta: bytes + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA] + + @overload + def __init__( + self, + *, + content_index: int, + delta: bytes, + event_id: str, + item_id: str, + output_index: int, + response_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventResponseAudioDone(_Model): + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE] + + @overload + def __init__( + self, + *, + content_index: int, + event_id: str, + item_id: str, + output_index: int, + response_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventResponseAudioTimestampDelta(_Model): + audio_duration_ms: int + audio_offset_ms: int + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + text: str + timestamp_type: Literal["word"] + type: Literal["delta"] + + @overload + def __init__( + self, + *, + audio_duration_ms: int, + audio_offset_ms: int, + content_index: int, + event_id: str, + item_id: str, + output_index: int, + response_id: str, + text: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventResponseAudioTimestampDone(_Model): + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal["done"] + + @overload + def __init__( + self, + *, + content_index: int, + event_id: str, + item_id: str, + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventResponseAudioTranscriptDelta(_Model): + content_index: int + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA] + + @overload + def __init__( + self, + *, + content_index: int, + delta: str, + event_id: str, + item_id: str, + output_index: int, + response_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventResponseAudioTranscriptDone(_Model): + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + transcript: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE] + + @overload + def __init__( + self, + *, + content_index: int, + event_id: str, + item_id: str, + output_index: int, + response_id: str, + transcript: str, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventResponseContentPartDone(_Model): + content_index: int + event_id: str + item_id: str + output_index: int + part: VoiceAgentResponseEventContentPart + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE] + + @overload + def __init__( + self, + *, + content_index: int, + event_id: str, + item_id: str, + output_index: int, + part: VoiceAgentResponseEventContentPart, + response_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventResponseCreated(_Model): + event_id: str + response: VoiceAgentRealtimeResponse + type: Literal[RealtimeServerEventType.RESPONSE_CREATED] + + @overload + def __init__( + self, + *, + event_id: str, + response: VoiceAgentRealtimeResponse, + type: Literal[RealtimeServerEventType.RESPONSE_CREATED] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventResponseDone(_Model): + event_id: str + response: VoiceAgentRealtimeResponse + type: Literal[RealtimeServerEventType.RESPONSE_DONE] + + @overload + def __init__( + self, + *, + event_id: str, + response: VoiceAgentRealtimeResponse, + type: Literal[RealtimeServerEventType.RESPONSE_DONE] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventResponseFunctionCallArgumentsDelta(_Model): + call_id: str + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA] + + @overload + def __init__( + self, + *, + call_id: str, + delta: str, + event_id: str, + item_id: str, + output_index: int, + response_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventResponseFunctionCallArgumentsDone(_Model): + arguments: str + call_id: str + event_id: str + item_id: str + name: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE] + + @overload + def __init__( + self, + *, + arguments: str, + call_id: str, + event_id: str, + item_id: str, + name: str, + output_index: int, + response_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventResponseMcpCallArgumentsDelta(_Model): + delta: str + event_id: str + item_id: str + obfuscation: Optional[str] + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA] + + @overload + def __init__( + self, + *, + delta: str, + event_id: str, + item_id: str, + obfuscation: Optional[str] = ..., + output_index: int, + response_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventResponseMcpCallArgumentsDone(_Model): + arguments: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE] + + @overload + def __init__( + self, + *, + arguments: str, + event_id: str, + item_id: str, + output_index: int, + response_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventResponseMcpCallCompleted(_Model): + event_id: str + item_id: str + output_index: int + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED] + + @overload + def __init__( + self, + *, + event_id: str, + item_id: str, + output_index: int, + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventResponseMcpCallFailed(_Model): + event_id: str + item_id: str + output_index: int + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED] + + @overload + def __init__( + self, + *, + event_id: str, + item_id: str, + output_index: int, + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventResponseMcpCallInProgress(_Model): + event_id: str + item_id: str + output_index: int + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS] + + @overload + def __init__( + self, + *, + event_id: str, + item_id: str, + output_index: int, + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventResponseOutputItemAdded(_Model): + event_id: str + item: VoiceAgentResponseItem + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED] + + @overload + def __init__( + self, + *, + event_id: str, + item: VoiceAgentResponseItem, + output_index: int, + response_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventResponseOutputItemDone(_Model): + event_id: str + item: VoiceAgentResponseItem + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE] + + @overload + def __init__( + self, + *, + event_id: str, + item: VoiceAgentResponseItem, + output_index: int, + response_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventResponseTextDelta(_Model): + content_index: int + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA] + + @overload + def __init__( + self, + *, + content_index: int, + delta: str, + event_id: str, + item_id: str, + output_index: int, + response_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventResponseTextDone(_Model): + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + text: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE] + + @overload + def __init__( + self, + *, + content_index: int, + event_id: str, + item_id: str, + output_index: int, + response_id: str, + text: str, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventResponseVideoDelta(_Model): + codec: str + delta: str + event_id: str + output_index: int + type: Literal["delta"] + + @overload + def __init__( + self, + *, + codec: str, + delta: str, + event_id: str, + output_index: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventSessionAvatarConnecting(_Model): + event_id: str + server_sdp: str + type: Literal["connecting"] + + @overload + def __init__( + self, + *, + event_id: str, + server_sdp: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventSessionAvatarSwitchToIdle(_Model): + event_id: str + turn_id: Optional[str] + type: Literal["switch_to_idle"] + + @overload + def __init__( + self, + *, + event_id: str, + turn_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventSessionAvatarSwitchToSpeaking(_Model): + event_id: str + turn_id: Optional[str] + type: Literal["switch_to_speaking"] + + @overload + def __init__( + self, + *, + event_id: str, + turn_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventSessionCreated(_Model): + event_id: str + session: VoiceAgentSessionResponseConfig + type: Literal[RealtimeServerEventType.SESSION_CREATED] + + @overload + def __init__( + self, + *, + event_id: str, + session: VoiceAgentSessionResponseConfig, + type: Literal[RealtimeServerEventType.SESSION_CREATED] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventSessionHandoffAborted(_Model): + edge_id: str + error: Optional[VoiceAgentServerEventErrorDetails] + event_id: str + from_model: str + from_node_id: str + handoff_id: str + node_generation: int + reason: Union[str, VoiceAgentHandoffAbortReason] + to_model: str + to_node_id: str + tool_call_id: str + type: Literal["aborted"] + + @overload + def __init__( + self, + *, + edge_id: str, + error: Optional[VoiceAgentServerEventErrorDetails] = ..., + event_id: str, + from_model: str, + from_node_id: str, + handoff_id: str, + node_generation: int, + reason: Union[str, VoiceAgentHandoffAbortReason], + to_model: str, + to_node_id: str, + tool_call_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventSessionHandoffCompleted(_Model): + duration_ms: int + edge_id: str + event_id: str + from_model: str + from_node_id: str + handoff_id: str + node_generation: int + prepare_duration_ms: int + to_model: str + to_node_id: str + tool_call_id: str + type: Literal["completed"] + + @overload + def __init__( + self, + *, + duration_ms: int, + edge_id: str, + event_id: str, + from_model: str, + from_node_id: str, + handoff_id: str, + node_generation: int, + prepare_duration_ms: int, + to_model: str, + to_node_id: str, + tool_call_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventSessionHandoffStarted(_Model): + edge_id: str + event_id: str + from_model: str + from_node_id: str + handoff_id: str + node_generation: int + to_model: str + to_node_id: str + tool_call_id: str + type: Literal["started"] + + @overload + def __init__( + self, + *, + edge_id: str, + event_id: str, + from_model: str, + from_node_id: str, + handoff_id: str, + node_generation: int, + to_model: str, + to_node_id: str, + tool_call_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventSessionUpdated(_Model): + event_id: str + session: VoiceAgentSessionResponseConfig + type: Literal[RealtimeServerEventType.SESSION_UPDATED] + + @overload + def __init__( + self, + *, + event_id: str, + session: VoiceAgentSessionResponseConfig, + type: Literal[RealtimeServerEventType.SESSION_UPDATED] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventWarning(_Model): + event_id: str + type: Literal["warning"] + warning: VoiceAgentServerEventWarningDetails + + @overload + def __init__( + self, + *, + event_id: str, + warning: VoiceAgentServerEventWarningDetails + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventWarningDetails(_Model): + code: Optional[str] + message: str + param: Optional[str] + + @overload + def __init__( + self, + *, + code: Optional[str] = ..., + message: str, + param: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventWebSearchCallCompleted(_Model): + event_id: Optional[str] + item_id: str + output_index: int + response_id: Optional[str] + sequence_number: int + type: Literal["completed"] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item_id: str, + output_index: int, + response_id: Optional[str] = ..., + sequence_number: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventWebSearchCallInProgress(_Model): + event_id: Optional[str] + item_id: str + output_index: int + response_id: Optional[str] + sequence_number: int + type: Literal["in_progress"] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item_id: str, + output_index: int, + response_id: Optional[str] = ..., + sequence_number: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerEventWebSearchCallSearching(_Model): + event_id: Optional[str] + item_id: str + output_index: int + response_id: Optional[str] + sequence_number: int + type: Literal["searching"] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item_id: str, + output_index: int, + response_id: Optional[str] = ..., + sequence_number: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentServerVadTurnDetection(_Model): + auto_truncate: Optional[bool] + create_response: Optional[bool] + end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] + idle_timeout_ms: Optional[int] + interrupt_response: Optional[bool] + prefix_padding_ms: Optional[int] + silence_duration_ms: Optional[int] + speech_duration_ms: Optional[int] + threshold: Optional[float] + type: Literal[VoiceTurnDetectionType.SERVER_VAD] + + @overload + def __init__( + self, + *, + auto_truncate: Optional[bool] = ..., + create_response: Optional[bool] = ..., + end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] = ..., + idle_timeout_ms: Optional[int] = ..., + interrupt_response: Optional[bool] = ..., + prefix_padding_ms: Optional[int] = ..., + silence_duration_ms: Optional[int] = ..., + speech_duration_ms: Optional[int] = ..., + threshold: Optional[float] = ..., + type: Literal[VoiceTurnDetectionType.SERVER_VAD] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentSessionAvatarConfig(_Model): + character: str + customized: Optional[bool] + ice_servers: Optional[list[VoiceAgentAvatarIceServer]] + model: Optional[str] + output_audit_audio: Optional[bool] + output_protocol: Optional[Union[str, VoiceAgentAvatarOutputProtocol]] + scene: Optional[VoiceAgentAvatarScene] + style: Optional[str] + type: Optional[Union[str, VoiceAgentAvatarType]] + video: Optional[VoiceAgentAvatarVideoParams] + + @overload + def __init__( + self, + *, + character: str, + customized: Optional[bool] = ..., + ice_servers: Optional[list[VoiceAgentAvatarIceServer]] = ..., + model: Optional[str] = ..., + output_audit_audio: Optional[bool] = ..., + output_protocol: Optional[Union[str, VoiceAgentAvatarOutputProtocol]] = ..., + scene: Optional[VoiceAgentAvatarScene] = ..., + style: Optional[str] = ..., + type: Optional[Union[str, VoiceAgentAvatarType]] = ..., + video: Optional[VoiceAgentAvatarVideoParams] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentSessionIncludeOption(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FILE_SEARCH_CALL_RESULTS = "file_search_call.results" + INPUT_AUDIO_TRANSCRIPTION_LOGPROBS = "item.input_audio_transcription.logprobs" + INPUT_AUDIO_TRANSCRIPTION_PHRASES = "item.input_audio_transcription.phrases" + + + class azure.ai.voiceagents.models.VoiceAgentSessionMcpTool(_Model): + allowed_tools: Optional[list[str]] + authorization: Optional[Union[str, VoiceAgentMcpAssignedManagedIdentity]] + headers: Optional[dict[str, str]] + require_approval: Optional[VoiceAgentMcpApprovalPolicy] + response_scheduling: Optional[Union[str, VoiceAgentMcpResponseScheduling]] + server_label: str + server_url: str + type: Literal["mcp"] + + @overload + def __init__( + self, + *, + allowed_tools: Optional[list[str]] = ..., + authorization: Optional[Union[str, VoiceAgentMcpAssignedManagedIdentity]] = ..., + headers: Optional[dict[str, str]] = ..., + require_approval: Optional[VoiceAgentMcpApprovalPolicy] = ..., + response_scheduling: Optional[Union[str, VoiceAgentMcpResponseScheduling]] = ..., + server_label: str, + server_url: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentSessionResponseAudio(_Model): + input: Optional[VoiceAgentSessionResponseAudioInput] + output: Optional[VoiceAgentSessionResponseAudioOutput] + + @overload + def __init__( + self, + *, + input: Optional[VoiceAgentSessionResponseAudioInput] = ..., + output: Optional[VoiceAgentSessionResponseAudioOutput] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentSessionResponseAudioInput(_Model): + echo_cancellation: Optional[VoiceAgentEchoCancellation] + format: Optional[VoiceAudioFormat] + noise_reduction: Optional[VoiceNoiseReduction] + transcription: Optional[VoiceInputTranscription] + turn_detection: Optional[VoiceAgentTurnDetection] + + @overload + def __init__( + self, + *, + echo_cancellation: Optional[VoiceAgentEchoCancellation] = ..., + format: Optional[VoiceAudioFormat] = ..., + noise_reduction: Optional[VoiceNoiseReduction] = ..., + transcription: Optional[VoiceInputTranscription] = ..., + turn_detection: Optional[VoiceAgentTurnDetection] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentSessionResponseAudioOutput(_Model): + format: Optional[VoiceAudioFormat] + output_audio_timestamp_types: Optional[list[Union[str, VoiceAudioTimestampType]]] + speed: Optional[float] + voice: Optional[VoiceAgentVoice] + + @overload + def __init__( + self, + *, + format: Optional[VoiceAudioFormat] = ..., + output_audio_timestamp_types: Optional[list[Union[str, VoiceAudioTimestampType]]] = ..., + speed: Optional[float] = ..., + voice: Optional[VoiceAgentVoice] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentSessionResponseConfig(_Model): + animation: Optional[VoiceAgentAnimationConfig] + audio: Optional[VoiceAgentSessionResponseAudio] + avatar: Optional[VoiceAgentSessionAvatarConfig] + expires_at: Optional[datetime] + greeting: Optional[VoiceGreetingConfig] + handoff: Optional[VoiceAgentHandoffState] + id: str + idle_timeout: Optional[int] + instructions: Optional[str] + interim_response: Optional[VoiceAgentInterimResponse] + max_output_tokens: Optional[VoiceAgentMaxOutputTokens] + model: str + object: Literal["session"] + output_modalities: list[Union[str, VoiceOutputModality]] + parallel_tool_calls: Optional[bool] + reasoning: Optional[RealtimeReasoning] + response_delimiter: Optional[str] + temperature: Optional[float] + tool_choice: Optional[VoiceAgentToolChoice] + tools: Optional[list[VoiceAgentSessionTool]] + type: Literal["realtime"] + voice_adaptation: Optional[VoiceAgentVoiceAdaptation] + + @overload + def __init__( + self, + *, + animation: Optional[VoiceAgentAnimationConfig] = ..., + audio: Optional[VoiceAgentSessionResponseAudio] = ..., + avatar: Optional[VoiceAgentSessionAvatarConfig] = ..., + expires_at: Optional[datetime] = ..., + greeting: Optional[VoiceGreetingConfig] = ..., + handoff: Optional[VoiceAgentHandoffState] = ..., + id: str, + idle_timeout: Optional[int] = ..., + instructions: Optional[str] = ..., + interim_response: Optional[VoiceAgentInterimResponse] = ..., + max_output_tokens: Optional[VoiceAgentMaxOutputTokens] = ..., + model: str, + output_modalities: list[Union[str, VoiceOutputModality]], + parallel_tool_calls: Optional[bool] = ..., + reasoning: Optional[RealtimeReasoning] = ..., + response_delimiter: Optional[str] = ..., + temperature: Optional[float] = ..., + tool_choice: Optional[VoiceAgentToolChoice] = ..., + tools: Optional[list[VoiceAgentSessionTool]] = ..., + voice_adaptation: Optional[VoiceAgentVoiceAdaptation] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentSessionUpdateAudio(_Model): + input: Optional[VoiceAgentSessionUpdateAudioInput] + output: Optional[VoiceAgentSessionUpdateAudioOutput] + + @overload + def __init__( + self, + *, + input: Optional[VoiceAgentSessionUpdateAudioInput] = ..., + output: Optional[VoiceAgentSessionUpdateAudioOutput] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentSessionUpdateAudioInput(_Model): + echo_cancellation: Optional[VoiceAgentEchoCancellation] + format: Optional[VoiceAudioFormat] + noise_reduction: Optional[VoiceNoiseReduction] + transcription: Optional[VoiceInputTranscription] + turn_detection: Optional[VoiceAgentTurnDetection] + + @overload + def __init__( + self, + *, + echo_cancellation: Optional[VoiceAgentEchoCancellation] = ..., + format: Optional[VoiceAudioFormat] = ..., + noise_reduction: Optional[VoiceNoiseReduction] = ..., + transcription: Optional[VoiceInputTranscription] = ..., + turn_detection: Optional[VoiceAgentTurnDetection] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentSessionUpdateAudioOutput(_Model): + format: Optional[VoiceAudioFormat] + output_audio_timestamp_types: Optional[list[Union[str, VoiceAudioTimestampType]]] + speed: Optional[float] + voice: Optional[VoiceAgentVoice] + + @overload + def __init__( + self, + *, + format: Optional[VoiceAudioFormat] = ..., + output_audio_timestamp_types: Optional[list[Union[str, VoiceAudioTimestampType]]] = ..., + speed: Optional[float] = ..., + voice: Optional[VoiceAgentVoice] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentSessionUpdateConfig(_Model): + animation: Optional[VoiceAgentAnimationConfig] + audio: Optional[VoiceAgentSessionUpdateAudio] + avatar: Optional[VoiceAgentSessionAvatarConfig] + greeting: Optional[VoiceGreetingConfig] + handoff: Optional[VoiceAgentHandoffGraphConfig] + include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] + instructions: Optional[str] + interim_response: Optional[VoiceAgentInterimResponse] + max_output_tokens: Optional[VoiceAgentMaxOutputTokens] + metadata: Optional[dict[str, str]] + output_modalities: Optional[list[Union[str, VoiceOutputModality]]] + parallel_tool_calls: Optional[bool] + reasoning: Optional[RealtimeReasoning] + response_delimiter: Optional[str] + temperature: Optional[float] + tool_choice: Optional[VoiceAgentToolChoice] + tools: Optional[list[VoiceAgentSessionTool]] + type: Literal["realtime"] + voice_adaptation: Optional[VoiceAgentVoiceAdaptation] + + @overload + def __init__( + self, + *, + animation: Optional[VoiceAgentAnimationConfig] = ..., + audio: Optional[VoiceAgentSessionUpdateAudio] = ..., + avatar: Optional[VoiceAgentSessionAvatarConfig] = ..., + greeting: Optional[VoiceGreetingConfig] = ..., + handoff: Optional[VoiceAgentHandoffGraphConfig] = ..., + include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] = ..., + instructions: Optional[str] = ..., + interim_response: Optional[VoiceAgentInterimResponse] = ..., + max_output_tokens: Optional[VoiceAgentMaxOutputTokens] = ..., + metadata: Optional[dict[str, str]] = ..., + output_modalities: Optional[list[Union[str, VoiceOutputModality]]] = ..., + parallel_tool_calls: Optional[bool] = ..., + reasoning: Optional[RealtimeReasoning] = ..., + response_delimiter: Optional[str] = ..., + temperature: Optional[float] = ..., + tool_choice: Optional[VoiceAgentToolChoice] = ..., + tools: Optional[list[VoiceAgentSessionTool]] = ..., + voice_adaptation: Optional[VoiceAgentVoiceAdaptation] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentStaticInterimResponseConfig(VoiceAgentInterimResponseConfig, discriminator='static_interim_response'): + latency_threshold_ms: int + texts: Optional[list[str]] + triggers: Union[list[str, VoiceAgentInterimResponseTrigger]] + type: Literal["static_interim_response"] + + @overload + def __init__( + self, + *, + latency_threshold_ms: Optional[int] = ..., + texts: Optional[list[str]] = ..., + triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentTranscriptionPhrase(_Model): + confidence: Optional[float] + duration_milliseconds: int + locale: Optional[str] + offset_milliseconds: int + text: str + words: Optional[list[VoiceAgentTranscriptionWord]] + + @overload + def __init__( + self, + *, + confidence: Optional[float] = ..., + duration_milliseconds: int, + locale: Optional[str] = ..., + offset_milliseconds: int, + text: str, + words: Optional[list[VoiceAgentTranscriptionWord]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentTranscriptionWord(_Model): + duration_milliseconds: int + offset_milliseconds: int + text: str + + @overload + def __init__( + self, + *, + duration_milliseconds: int, + offset_milliseconds: int, + text: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BUSINESS = "business" + PERSONAL = "personal" + + + class azure.ai.voiceagents.models.VoiceAgentUseCase(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CALL_CENTER = "call_center" + CUSTOMER_SUPPORT = "customer_support" + IN_CAR = "in_car" + LEARNING = "learning" + OUTREACH = "outreach" + PERSONAL_ASSISTANT = "personal_assistant" + RECEPTION = "reception" + SALES = "sales" + TRAVEL_ASSISTANT = "travel_assistant" + + + class azure.ai.voiceagents.models.VoiceAgentVersionObject(_Model): + agent_guid: Optional[str] + blueprint: Optional[AgentIdentity] + blueprint_reference: Optional[AgentBlueprintReference] + created_at: datetime + definition: VoiceAgentDefinition + description: Optional[str] + draft: Optional[bool] + id: str + instance_identity: Optional[AgentIdentity] + metadata: dict[str, str] + name: str + object: Literal[AgentObjectType.AGENT_VERSION] + status: Optional[Union[str, AgentVersionStatus]] + version: str + + @overload + def __init__( + self, + *, + created_at: datetime, + definition: VoiceAgentDefinition, + description: Optional[str] = ..., + draft: Optional[bool] = ..., + id: str, + metadata: dict[str, str], + name: str, + object: Literal[AgentObjectType.AGENT_VERSION], + status: Optional[Union[str, AgentVersionStatus]] = ..., + version: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentVoiceAdaptation(_Model): + type: Literal["auto"] + + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentWebSearchActionFind(_Model): + pattern: str + type: Literal["find"] + url: str + + @overload + def __init__( + self, + *, + pattern: str, + url: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentWebSearchActionOpenPage(_Model): + type: Literal["open_page"] + url: str + + @overload + def __init__( + self, + *, + url: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentWebSearchActionSearch(_Model): + query: str + sources: Optional[list[VoiceAgentWebSearchSource]] + type: Literal["search"] + + @overload + def __init__( + self, + *, + query: str, + sources: Optional[list[VoiceAgentWebSearchSource]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentWebSearchCallItem(_Model): + action: Optional[VoiceAgentWebSearchAction] + id: str + status: Union[str, VoiceAgentWebSearchCallStatus] + type: Literal["web_search_call"] + + @overload + def __init__( + self, + *, + action: Optional[VoiceAgentWebSearchAction] = ..., + id: str, + status: Union[str, VoiceAgentWebSearchCallStatus] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentWebSearchCallStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMPLETED = "completed" + FAILED = "failed" + IN_PROGRESS = "in_progress" + SEARCHING = "searching" + + + class azure.ai.voiceagents.models.VoiceAgentWebSearchSource(_Model): + type: Literal["url"] + url: str + + @overload + def __init__( + self, + *, + url: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAgentWebSocketSubprotocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + REALTIME = "realtime" + + + class azure.ai.voiceagents.models.VoiceAgentWorkflowActionItem(_Model): + action_id: str + id: str + kind: Optional[str] + object: Optional[Literal["item"]] + parent_action_id: Optional[str] + previous_action_id: Optional[str] + status: str + type: Literal["workflow_action"] + + @overload + def __init__( + self, + *, + action_id: str, + id: str, + kind: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + parent_action_id: Optional[str] = ..., + previous_action_id: Optional[str] = ..., + status: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAssistantMessageItem(VoiceMessageItem, discriminator='assistant'): + content: list[RealtimeConversationItemMessageAssistantContent] + created_at: datetime + id: Optional[str] + object: Optional[Literal["item"]] + response_id: str + role: Literal[RealtimeConversationItemMessageType.ASSISTANT] + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Union[str, azure.ai.voiceagents.models.MESSAGE] + + @overload + def __init__( + self, + *, + content: list[RealtimeConversationItemMessageAssistantContent], + created_at: Optional[datetime] = ..., + id: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + response_id: Optional[str] = ..., + status: Optional[Literal[completed, incomplete, in_progress]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAudioCodec(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PCM16 = "pcm16" + PCMA = "pcma" + PCMU = "pcmu" + + + class azure.ai.voiceagents.models.VoiceAudioConfig(_Model): + input: Optional[VoiceAudioInputConfig] + output: Optional[VoiceAudioOutputConfig] + + @overload + def __init__( + self, + *, + input: Optional[VoiceAudioInputConfig] = ..., + output: Optional[VoiceAudioOutputConfig] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAudioContainerFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): + WAV = "wav" + + + class azure.ai.voiceagents.models.VoiceAudioFormat(_Model): + rate: Optional[int] + type: Union[str, VoiceAudioFormatType] + + @overload + def __init__( + self, + *, + rate: Optional[int] = ..., + type: Union[str, VoiceAudioFormatType] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAudioFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PCM = "audio/pcm" + PCMA = "audio/pcma" + PCMU = "audio/pcmu" + + + class azure.ai.voiceagents.models.VoiceAudioInputConfig(_Model): + format: Optional[VoiceAudioFormat] + noise_reduction: Optional[VoiceNoiseReduction] + transcription: Optional[VoiceInputTranscription] + turn_detection: Optional[VoiceTurnDetection] + + @overload + def __init__( + self, + *, + format: Optional[VoiceAudioFormat] = ..., + noise_reduction: Optional[VoiceNoiseReduction] = ..., + transcription: Optional[VoiceInputTranscription] = ..., + turn_detection: Optional[VoiceTurnDetection] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAudioOutputConfig(_Model): + format: Optional[VoiceAudioFormat] + output_audio_timestamp_types: Optional[list[Union[str, VoiceAudioTimestampType]]] + speed: Optional[float] + voice: Optional[VoiceAgentVoice] + + @overload + def __init__( + self, + *, + format: Optional[VoiceAudioFormat] = ..., + output_audio_timestamp_types: Optional[list[Union[str, VoiceAudioTimestampType]]] = ..., + speed: Optional[float] = ..., + voice: Optional[VoiceAgentVoice] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAudioRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT = "agent" + USER = "user" + + + class azure.ai.voiceagents.models.VoiceAudioTimestampType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + WORD = "word" + + + class azure.ai.voiceagents.models.VoiceAvatarConfig(_Model): + character: str + customized: Optional[bool] + output_protocol: Optional[Union[str, VoiceAvatarOutputProtocol]] + style: Optional[str] + type: Union[str, VoiceAvatarType] + + @overload + def __init__( + self, + *, + character: str, + customized: Optional[bool] = ..., + output_protocol: Optional[Union[str, VoiceAvatarOutputProtocol]] = ..., + style: Optional[str] = ..., + type: Union[str, VoiceAvatarType] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAvatarOutputProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + WEBRTC = "webrtc" + WEBSOCKET = "websocket" + + + class azure.ai.voiceagents.models.VoiceAvatarType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PHOTO_AVATAR = "photo_avatar" + VIDEO_AVATAR = "video_avatar" + + + class azure.ai.voiceagents.models.VoiceAzureSemanticDetection(VoiceEndOfUtteranceDetection, discriminator='semantic_detection_v1'): + model: Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1] + threshold_level: Optional[Union[str, VoiceEndOfUtteranceThresholdLevel]] + timeout_ms: Optional[int] + + @overload + def __init__( + self, + *, + threshold_level: Optional[Union[str, VoiceEndOfUtteranceThresholdLevel]] = ..., + timeout_ms: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAzureSemanticDetectionEn(VoiceEndOfUtteranceDetection, discriminator='semantic_detection_v1_en'): + model: Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1_EN] + threshold_level: Optional[Union[str, VoiceEndOfUtteranceThresholdLevel]] + timeout_ms: Optional[int] + + @overload + def __init__( + self, + *, + threshold_level: Optional[Union[str, VoiceEndOfUtteranceThresholdLevel]] = ..., + timeout_ms: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAzureSemanticDetectionMultilingual(VoiceEndOfUtteranceDetection, discriminator='semantic_detection_v1_multilingual'): + model: Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1_MULTILINGUAL] + threshold_level: Optional[Union[str, VoiceEndOfUtteranceThresholdLevel]] + timeout_ms: Optional[int] + + @overload + def __init__( + self, + *, + threshold_level: Optional[Union[str, VoiceEndOfUtteranceThresholdLevel]] = ..., + timeout_ms: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAzureSemanticVadEnTurnDetection(VoiceTurnDetection, discriminator='azure_semantic_vad_en'): + auto_truncate: Optional[bool] + create_response: Optional[bool] + end_of_utterance_detection: Optional[VoiceEndOfUtteranceDetection] + interrupt_response: Optional[bool] + prefix_padding_ms: Optional[int] + remove_filler_words: Optional[bool] + silence_duration_ms: Optional[int] + speech_duration_ms: Optional[int] + threshold: Optional[float] + type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN] + + @overload + def __init__( + self, + *, + auto_truncate: Optional[bool] = ..., + create_response: Optional[bool] = ..., + end_of_utterance_detection: Optional[VoiceEndOfUtteranceDetection] = ..., + interrupt_response: Optional[bool] = ..., + prefix_padding_ms: Optional[int] = ..., + remove_filler_words: Optional[bool] = ..., + silence_duration_ms: Optional[int] = ..., + speech_duration_ms: Optional[int] = ..., + threshold: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAzureSemanticVadMultilingualTurnDetection(VoiceTurnDetection, discriminator='azure_semantic_vad_multilingual'): + auto_truncate: Optional[bool] + create_response: Optional[bool] + end_of_utterance_detection: Optional[VoiceEndOfUtteranceDetection] + interrupt_response: Optional[bool] + languages: Optional[list[str]] + prefix_padding_ms: Optional[int] + remove_filler_words: Optional[bool] + silence_duration_ms: Optional[int] + speech_duration_ms: Optional[int] + threshold: Optional[float] + type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] + + @overload + def __init__( + self, + *, + auto_truncate: Optional[bool] = ..., + create_response: Optional[bool] = ..., + end_of_utterance_detection: Optional[VoiceEndOfUtteranceDetection] = ..., + interrupt_response: Optional[bool] = ..., + languages: Optional[list[str]] = ..., + prefix_padding_ms: Optional[int] = ..., + remove_filler_words: Optional[bool] = ..., + silence_duration_ms: Optional[int] = ..., + speech_duration_ms: Optional[int] = ..., + threshold: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceAzureSemanticVadTurnDetection(VoiceTurnDetection, discriminator='azure_semantic_vad'): + auto_truncate: Optional[bool] + create_response: Optional[bool] + end_of_utterance_detection: Optional[VoiceEndOfUtteranceDetection] + interrupt_response: Optional[bool] + languages: Optional[list[str]] + prefix_padding_ms: Optional[int] + remove_filler_words: Optional[bool] + silence_duration_ms: Optional[int] + speech_duration_ms: Optional[int] + threshold: Optional[float] + type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD] + + @overload + def __init__( + self, + *, + auto_truncate: Optional[bool] = ..., + create_response: Optional[bool] = ..., + end_of_utterance_detection: Optional[VoiceEndOfUtteranceDetection] = ..., + interrupt_response: Optional[bool] = ..., + languages: Optional[list[str]] = ..., + prefix_padding_ms: Optional[int] = ..., + remove_filler_words: Optional[bool] = ..., + silence_duration_ms: Optional[int] = ..., + speech_duration_ms: Optional[int] = ..., + threshold: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceConversation(_Model): + completed_at: Optional[datetime] + created_at: datetime + id: str + metadata: Optional[dict[str, str]] + object: Literal["conversation"] + status: Union[str, VoiceConversationStatus] + usage: Optional[RealtimeResponseUsage] + + @overload + def __init__( + self, + *, + completed_at: Optional[datetime] = ..., + created_at: datetime, + id: str, + metadata: Optional[dict[str, str]] = ..., + status: Union[str, VoiceConversationStatus], + usage: Optional[RealtimeResponseUsage] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceConversationItem(_Model): + created_at: Optional[datetime] + response_id: Optional[str] + type: str + + @overload + def __init__( + self, + *, + created_at: Optional[datetime] = ..., + response_id: Optional[str] = ..., + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FUNCTION_CALL = "function_call" + FUNCTION_CALL_OUTPUT = "function_call_output" + MCP_APPROVAL_REQUEST = "mcp_approval_request" + MCP_APPROVAL_RESPONSE = "mcp_approval_response" + MCP_CALL = "mcp_call" + MCP_LIST_TOOLS = "mcp_list_tools" + MESSAGE = "message" + + + class azure.ai.voiceagents.models.VoiceConversationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMPLETED = "completed" + IN_PROGRESS = "in_progress" + + + class azure.ai.voiceagents.models.VoiceEndOfUtteranceDetection(_Model): + model: str + + @overload + def __init__( + self, + *, + model: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceEndOfUtteranceDetectionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SEMANTIC_DETECTION_V1 = "semantic_detection_v1" + SEMANTIC_DETECTION_V1_EN = "semantic_detection_v1_en" + SEMANTIC_DETECTION_V1_MULTILINGUAL = "semantic_detection_v1_multilingual" + + + class azure.ai.voiceagents.models.VoiceEndOfUtteranceThresholdLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DEFAULT = "default" + HIGH = "high" + LOW = "low" + MEDIUM = "medium" + + + class azure.ai.voiceagents.models.VoiceFunctionCallItem(VoiceConversationItem, discriminator='function_call'): + arguments: str + call_id: Optional[str] + created_at: datetime + id: Optional[str] + name: str + object: Optional[Literal["item"]] + response_id: str + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Literal[VoiceConversationItemType.FUNCTION_CALL] + + @overload + def __init__( + self, + *, + arguments: str, + call_id: Optional[str] = ..., + created_at: Optional[datetime] = ..., + id: Optional[str] = ..., + name: str, + object: Optional[Literal[item]] = ..., + response_id: Optional[str] = ..., + status: Optional[Literal[completed, incomplete, in_progress]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceFunctionCallOutputItem(VoiceConversationItem, discriminator='function_call_output'): + call_id: str + created_at: datetime + id: Optional[str] + name: Optional[str] + object: Optional[Literal["item"]] + output: str + response_id: str + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT] + + @overload + def __init__( + self, + *, + call_id: str, + created_at: Optional[datetime] = ..., + id: Optional[str] = ..., + name: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + output: str, + response_id: Optional[str] = ..., + status: Optional[Literal[completed, incomplete, in_progress]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceGreetingConfig(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceGreetingToolChoice(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "auto" + NONE = "none" + REQUIRED = "required" + + + class azure.ai.voiceagents.models.VoiceIdsShared(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ALLOY = "alloy" + ASH = "ash" + BALLAD = "ballad" + CEDAR = "cedar" + CORAL = "coral" + ECHO = "echo" + MARIN = "marin" + SAGE = "sage" + SHIMMER = "shimmer" + VERSE = "verse" + + + class azure.ai.voiceagents.models.VoiceInputTranscription(_Model): + custom_speech: Optional[dict[str, str]] + delay: Optional[Literal["minimal", "low", "medium", "high", "xhigh"]] + language: Optional[str] + model: Union[str, VoiceInputTranscriptionModel] + phrase_list: Optional[list[str]] + prompt: Optional[str] + + @overload + def __init__( + self, + *, + custom_speech: Optional[dict[str, str]] = ..., + delay: Optional[Literal[minimal, low, medium, high, xhigh]] = ..., + language: Optional[str] = ..., + model: Union[str, VoiceInputTranscriptionModel], + phrase_list: Optional[list[str]] = ..., + prompt: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceInputTranscriptionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_SPEECH = "azure-speech" + GPT4_O_MINI_TRANSCRIBE = "gpt-4o-mini-transcribe" + GPT4_O_TRANSCRIBE = "gpt-4o-transcribe" + GPT4_O_TRANSCRIBE_DIARIZE = "gpt-4o-transcribe-diarize" + GPT_LIVE_TRANSCRIBE = "gpt-live-transcribe" + GPT_REALTIME_WHISPER = "gpt-realtime-whisper" + GPT_TRANSCRIBE = "gpt-transcribe" + MAI_TRANSCRIBE = "mai-transcribe" + WHISPER1 = "whisper-1" + + + class azure.ai.voiceagents.models.VoiceItemAudioResponse(_Model): + blob_uri: Optional[str] + channels: Optional[int] + codec: Optional[Union[str, VoiceAudioCodec]] + conversation_id: str + duration_ms: Optional[timedelta] + format: Optional[Union[str, VoiceAudioContainerFormat]] + item_id: str + role: Optional[Union[str, VoiceAudioRole]] + sample_rate: Optional[int] + start_offset_ms: Optional[timedelta] + + @overload + def __init__( + self, + *, + blob_uri: Optional[str] = ..., + channels: Optional[int] = ..., + codec: Optional[Union[str, VoiceAudioCodec]] = ..., + conversation_id: str, + duration_ms: Optional[timedelta] = ..., + format: Optional[Union[str, VoiceAudioContainerFormat]] = ..., + item_id: str, + role: Optional[Union[str, VoiceAudioRole]] = ..., + sample_rate: Optional[int] = ..., + start_offset_ms: Optional[timedelta] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceMcpApprovalRequestItem(VoiceConversationItem, discriminator='mcp_approval_request'): + arguments: str + created_at: datetime + id: str + name: str + response_id: str + server_label: str + type: Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST] + + @overload + def __init__( + self, + *, + arguments: str, + created_at: Optional[datetime] = ..., + id: str, + name: str, + response_id: Optional[str] = ..., + server_label: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceMcpApprovalResponseItem(VoiceConversationItem, discriminator='mcp_approval_response'): + approval_request_id: str + approve: bool + created_at: datetime + id: str + reason: Optional[str] + response_id: str + type: Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE] + + @overload + def __init__( + self, + *, + approval_request_id: str, + approve: bool, + created_at: Optional[datetime] = ..., + id: str, + reason: Optional[str] = ..., + response_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceMcpCallItem(VoiceConversationItem, discriminator='mcp_call'): + approval_request_id: Optional[str] + arguments: str + created_at: datetime + error: Optional[RealtimeMCPError] + id: str + name: str + output: Optional[str] + response_id: str + server_label: str + type: Literal[VoiceConversationItemType.MCP_CALL] + + @overload + def __init__( + self, + *, + approval_request_id: Optional[str] = ..., + arguments: str, + created_at: Optional[datetime] = ..., + error: Optional[RealtimeMCPError] = ..., + id: str, + name: str, + output: Optional[str] = ..., + response_id: Optional[str] = ..., + server_label: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceMcpListToolsItem(VoiceConversationItem, discriminator='mcp_list_tools'): + created_at: datetime + id: Optional[str] + response_id: str + server_label: str + tools: list[MCPListToolsTool] + type: Literal[VoiceConversationItemType.MCP_LIST_TOOLS] + + @overload + def __init__( + self, + *, + created_at: Optional[datetime] = ..., + id: Optional[str] = ..., + response_id: Optional[str] = ..., + server_label: str, + tools: list[MCPListToolsTool] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceMessageItem(VoiceConversationItem, discriminator='message'): + created_at: datetime + response_id: str + role: str + type: Literal[VoiceConversationItemType.MESSAGE] + + @overload + def __init__( + self, + *, + created_at: Optional[datetime] = ..., + response_id: Optional[str] = ..., + role: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceModelType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MANAGED = "managed" + SELF_DEPLOYED = "self_deployed" + + + class azure.ai.voiceagents.models.VoiceNoiseReduction(_Model): + type: Union[str, VoiceNoiseReductionType] + + @overload + def __init__( + self, + *, + type: Union[str, VoiceNoiseReductionType] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceNoiseReductionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_DEEP_NOISE_SUPPRESSION = "azure_deep_noise_suppression" + FAR_FIELD = "far_field" + NEAR_FIELD = "near_field" + + + class azure.ai.voiceagents.models.VoiceOutputModality(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ANIMATION = "animation" + AUDIO = "audio" + AVATAR = "avatar" + TEXT = "text" + + + class azure.ai.voiceagents.models.VoiceRecordingChannelLayout(_Model): + left: Literal["user"] + right: Literal["agent"] + + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... + + + class azure.ai.voiceagents.models.VoiceRecordingResponse(_Model): + blob_uri: Optional[str] + channel_layout: VoiceRecordingChannelLayout + channels: int + conversation_id: str + duration_ms: timedelta + format: Union[str, VoiceAudioContainerFormat] + sample_rate: int + + @overload + def __init__( + self, + *, + blob_uri: Optional[str] = ..., + channel_layout: VoiceRecordingChannelLayout, + channels: int, + conversation_id: str, + duration_ms: timedelta, + format: Union[str, VoiceAudioContainerFormat], + sample_rate: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceResponse(_Model): + audio: Optional[VoiceResponseAudio] + completed_at: Optional[datetime] + conversation_id: str + created_at: Optional[datetime] + id: str + max_output_tokens: Optional[Union[int, Literal["inf"]]] + object: Literal["response"] + output: Optional[list[VoiceConversationItem]] + output_modalities: Optional[list[Literal["text", "audio"]]] + status: Union[str, VoiceResponseStatus] + status_details: Optional[RealtimeResponseStatusDetails] + temperature: Optional[float] + usage: Optional[RealtimeResponseUsage] + + @overload + def __init__( + self, + *, + audio: Optional[VoiceResponseAudio] = ..., + completed_at: Optional[datetime] = ..., + conversation_id: str, + created_at: Optional[datetime] = ..., + id: str, + max_output_tokens: Optional[Union[int, Literal[inf]]] = ..., + output: Optional[list[VoiceConversationItem]] = ..., + output_modalities: Optional[list[Literal[text, audio]]] = ..., + status: Union[str, VoiceResponseStatus], + status_details: Optional[RealtimeResponseStatusDetails] = ..., + temperature: Optional[float] = ..., + usage: Optional[RealtimeResponseUsage] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceResponseAudio(_Model): + output: Optional[VoiceResponseAudioOutput] + + @overload + def __init__( + self, + *, + output: Optional[VoiceResponseAudioOutput] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceResponseAudioOutput(_Model): + format: Optional[RealtimeAudioFormats] + voice: Optional[VoiceResponseVoice] + + @overload + def __init__( + self, + *, + format: Optional[RealtimeAudioFormats] = ..., + voice: Optional[VoiceResponseVoice] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceResponseStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELLED = "cancelled" + COMPLETED = "completed" + FAILED = "failed" + INCOMPLETE = "incomplete" + IN_PROGRESS = "in_progress" + + + class azure.ai.voiceagents.models.VoiceSemanticVadTurnDetection(VoiceTurnDetection, discriminator='semantic_vad'): + create_response: Optional[bool] + eagerness: Optional[Literal["low", "medium", "high", "auto"]] + interrupt_response: Optional[bool] + type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD] + + @overload + def __init__( + self, + *, + create_response: Optional[bool] = ..., + eagerness: Optional[Literal[low, medium, high, auto]] = ..., + interrupt_response: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceServerVadTurnDetection(VoiceTurnDetection, discriminator='server_vad'): + create_response: Optional[bool] + idle_timeout_ms: Optional[int] + interrupt_response: Optional[bool] + prefix_padding_ms: Optional[int] + silence_duration_ms: Optional[int] + threshold: Optional[float] + type: Literal[VoiceTurnDetectionType.SERVER_VAD] + + @overload + def __init__( + self, + *, + create_response: Optional[bool] = ..., + idle_timeout_ms: Optional[int] = ..., + interrupt_response: Optional[bool] = ..., + prefix_padding_ms: Optional[int] = ..., + silence_duration_ms: Optional[int] = ..., + threshold: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceSystemMessageItem(VoiceMessageItem, discriminator='system'): + content: list[RealtimeConversationItemMessageSystemContent] + created_at: datetime + id: Optional[str] + object: Optional[Literal["item"]] + response_id: str + role: Literal[RealtimeConversationItemMessageType.SYSTEM] + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Union[str, azure.ai.voiceagents.models.MESSAGE] + + @overload + def __init__( + self, + *, + content: list[RealtimeConversationItemMessageSystemContent], + created_at: Optional[datetime] = ..., + id: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + response_id: Optional[str] = ..., + status: Optional[Literal[completed, incomplete, in_progress]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceSystemTool(_Model): + description: Optional[str] + name: Union[str, VoiceSystemToolName] + type: Literal["system"] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + name: Union[str, VoiceSystemToolName] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceSystemToolName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + END_CONVERSATION = "end_conversation" + + + class azure.ai.voiceagents.models.VoiceToolboxTool(_Model): + toolbox_name: str + toolbox_version: str + type: Literal["toolbox"] + + @overload + def __init__( + self, + *, + toolbox_name: str, + toolbox_version: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceTurnDetection(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voiceagents.models.VoiceTurnDetectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_SEMANTIC_VAD = "azure_semantic_vad" + AZURE_SEMANTIC_VAD_EN = "azure_semantic_vad_en" + AZURE_SEMANTIC_VAD_MULTILINGUAL = "azure_semantic_vad_multilingual" + SEMANTIC_VAD = "semantic_vad" + SERVER_VAD = "server_vad" + + + class azure.ai.voiceagents.models.VoiceUserMessageItem(VoiceMessageItem, discriminator='user'): + content: list[RealtimeConversationItemMessageUserContent] + created_at: datetime + id: Optional[str] + object: Optional[Literal["item"]] + response_id: str + role: Literal[RealtimeConversationItemMessageType.USER] + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Union[str, azure.ai.voiceagents.models.MESSAGE] + + @overload + def __init__( + self, + *, + content: list[RealtimeConversationItemMessageUserContent], + created_at: Optional[datetime] = ..., + id: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + response_id: Optional[str] = ..., + status: Optional[Literal[completed, incomplete, in_progress]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + +namespace azure.ai.voiceagents.operations + + class azure.ai.voiceagents.operations.AgentEndpointConversationsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def delete_agent_conversation( + self, + agent_name: str, + conversation_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get_agent_conversation( + self, + agent_name: str, + conversation_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> VoiceConversation: ... + + @distributed_trace + def get_agent_conversation_audio( + self, + agent_name: str, + conversation_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> VoiceRecordingResponse: ... + + @distributed_trace + def get_agent_conversation_audio_content( + self, + agent_name: str, + conversation_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> Iterator[bytes]: ... + + @distributed_trace + def get_agent_conversation_item( + self, + agent_name: str, + conversation_id: str, + item_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> VoiceConversationItem: ... + + @distributed_trace + def get_agent_conversation_item_audio( + self, + agent_name: str, + conversation_id: str, + item_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> VoiceItemAudioResponse: ... + + @distributed_trace + def get_agent_conversation_item_audio_content( + self, + agent_name: str, + conversation_id: str, + item_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> Iterator[bytes]: ... + + @distributed_trace + def get_agent_conversation_response( + self, + agent_name: str, + conversation_id: str, + response_id: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> VoiceResponse: ... + + @distributed_trace + def list_agent_conversation_items( + self, + agent_name: str, + conversation_id: str, + *, + before: Optional[str] = ..., + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[VoiceConversationItem]: ... + + @distributed_trace + def list_agent_conversation_response_items( + self, + agent_name: str, + conversation_id: str, + response_id: str, + *, + before: Optional[str] = ..., + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[VoiceConversationItem]: ... + + @distributed_trace + def list_agent_conversation_responses( + self, + agent_name: str, + conversation_id: str, + *, + before: Optional[str] = ..., + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[VoiceResponse]: ... + + + class azure.ai.voiceagents.operations.VoiceAgentsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create_voice_agent( + self, + *, + agent_card: Optional[AgentCard] = ..., + agent_endpoint: Optional[AgentEndpointConfig] = ..., + blueprint_reference: Optional[AgentBlueprintReference] = ..., + content_type: str = "application/json", + definition: VoiceAgentDefinition, + description: Optional[str] = ..., + draft: Optional[bool] = ..., + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + metadata: Optional[dict[str, str]] = ..., + name: str, + state: Optional[Union[str, AgentState]] = ..., + **kwargs: Any + ) -> VoiceAgentObject: ... + + @overload + def create_voice_agent( + self, + body: CreateVoiceAgentRequest, + *, + content_type: str = "application/json", + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> VoiceAgentObject: ... + + @overload + def create_voice_agent( + self, + body: IO[bytes], + *, + content_type: str = "application/json", + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> VoiceAgentObject: ... + + @overload + def create_voice_agent_version( + self, + agent_name: str, + *, + blueprint_reference: Optional[AgentBlueprintReference] = ..., + content_type: str = "application/json", + definition: VoiceAgentDefinition, + description: Optional[str] = ..., + draft: Optional[bool] = ..., + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + metadata: Optional[dict[str, str]] = ..., + **kwargs: Any + ) -> VoiceAgentVersionObject: ... + + @overload + def create_voice_agent_version( + self, + agent_name: str, + body: CreateVoiceAgentVersionRequest, + *, + content_type: str = "application/json", + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> VoiceAgentVersionObject: ... + + @overload + def create_voice_agent_version( + self, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> VoiceAgentVersionObject: ... + + @distributed_trace + def delete_voice_agent( + self, + agent_name: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> None: ... + + @distributed_trace + def delete_voice_agent_version( + self, + agent_name: str, + agent_version: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> None: ... + + @distributed_trace + def disable_voice_agent( + self, + agent_name: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> None: ... + + @distributed_trace + def enable_voice_agent( + self, + agent_name: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> None: ... + + @overload + def generate_voice_agent( + self, + *, + agent_type: Union[str, VoiceAgentType], + content_type: str = "application/json", + description: Optional[str] = ..., + draft: Optional[bool] = ..., + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + goal: str, + model: str, + model_type: Union[str, VoiceModelType], + name: str, + tools: Optional[list[VoiceAgentTool]] = ..., + use_case: Union[str, VoiceAgentUseCase], + **kwargs: Any + ) -> VoiceAgentObject: ... + + @overload + def generate_voice_agent( + self, + body: GenerateVoiceAgentRequest, + *, + content_type: str = "application/json", + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> VoiceAgentObject: ... + + @overload + def generate_voice_agent( + self, + body: IO[bytes], + *, + content_type: str = "application/json", + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> VoiceAgentObject: ... + + @distributed_trace + def get_voice_agent( + self, + agent_name: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> VoiceAgentObject: ... + + @distributed_trace + def get_voice_agent_version( + self, + agent_name: str, + agent_version: str, + *, + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> VoiceAgentVersionObject: ... + + @distributed_trace + def list_voice_agent_versions( + self, + agent_name: str, + *, + before: Optional[str] = ..., + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + include_drafts: Optional[bool] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[VoiceAgentVersionObject]: ... + + @distributed_trace + def list_voice_agents( + self, + *, + before: Optional[str] = ..., + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[VoiceAgentObject]: ... + + @overload + def update_voice_agent( + self, + agent_name: str, + *, + blueprint_reference: Optional[AgentBlueprintReference] = ..., + content_type: str = "application/json", + definition: VoiceAgentDefinition, + description: Optional[str] = ..., + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + metadata: Optional[dict[str, str]] = ..., + **kwargs: Any + ) -> VoiceAgentObject: ... + + @overload + def update_voice_agent( + self, + agent_name: str, + body: UpdateVoiceAgentRequest, + *, + content_type: str = "application/json", + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> VoiceAgentObject: ... + + @overload + def update_voice_agent( + self, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], + **kwargs: Any + ) -> VoiceAgentObject: ... + + +namespace azure.ai.voiceagents.types + + class azure.ai.voiceagents.types.A2AProtocolConfiguration(TypedDict, total=False): + + + class azure.ai.voiceagents.types.ActivityProtocolConfiguration(TypedDict, total=False): + key "enable_m365_public_endpoint": bool + enable_m365_public_endpoint: bool + + + class azure.ai.voiceagents.types.AgentBlueprintReference(TypedDict, total=False): + key "blueprint_id": Required[str] + key "type": Required[Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT]] + blueprint_id: str + type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] + + + class azure.ai.voiceagents.types.AgentBlueprintReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MANAGED_AGENT_IDENTITY_BLUEPRINT = "ManagedAgentIdentityBlueprint" + + + class azure.ai.voiceagents.types.AgentCard(TypedDict, total=False): + key "description": str + key "skills": Required[list[AgentCardSkill]] + key "version": Required[str] + description: str + skills: list[AgentCardSkill] + version: str + + + class azure.ai.voiceagents.types.AgentCardSkill(TypedDict, total=False): + key "description": str + key "id": Required[str] + key "name": Required[str] + description: str + examples: list[str] + id: str + name: str + tags: list[str] + + + class azure.ai.voiceagents.types.AgentEndpointAuthorizationSchemeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BOT_SERVICE = "BotService" + BOT_SERVICE_RBAC = "BotServiceRbac" + BOT_SERVICE_TENANT = "BotServiceTenant" + ENTRA = "Entra" + + + class azure.ai.voiceagents.types.AgentEndpointConfig(TypedDict, total=False): + key "protocol_configuration": ForwardRef('ProtocolConfiguration', module='types') + key "version_selector": ForwardRef('VersionSelector', module='types') + authorization_schemes: list[AgentEndpointAuthorizationScheme] + protocol_configuration: ProtocolConfiguration + version_selector: VersionSelector + + + class azure.ai.voiceagents.types.AzureAvatarVoiceSyncVoice(TypedDict, total=False): + key "custom_lexicon_url": str + key "custom_text_normalization_url": str + key "locale": str + key "model": Required[Union[str, PersonalVoiceModel]] + key "pitch": str + key "rate": str + key "style": str + key "temperature": float + key "type": Required[Literal[AzureVoiceType.AVATAR_VOICE_SYNC]] + key "volume": str + custom_lexicon_url: str + custom_text_normalization_url: str + locale: str + model: Union[str, PersonalVoiceModel] + pitch: str + prefer_locales: list[str] + rate: str + style: str + temperature: float + type: Literal[AzureVoiceType.AVATAR_VOICE_SYNC] + volume: str + + + class azure.ai.voiceagents.types.AzureCustomVoice(TypedDict, total=False): + key "custom_lexicon_url": str + key "custom_text_normalization_url": str + key "endpoint_id": Required[str] + key "locale": str + key "name": Required[str] + key "pitch": str + key "rate": str + key "style": str + key "temperature": float + key "type": Required[Literal[AzureVoiceType.AZURE_CUSTOM]] + key "volume": str + custom_lexicon_url: str + custom_text_normalization_url: str + endpoint_id: str + locale: str + name: str + pitch: str + prefer_locales: list[str] + rate: str + style: str + temperature: float + type: Literal[AzureVoiceType.AZURE_CUSTOM] + volume: str + + + class azure.ai.voiceagents.types.AzurePersonalVoice(TypedDict, total=False): + key "custom_lexicon_url": str + key "custom_text_normalization_url": str + key "locale": str + key "model": Required[Union[str, PersonalVoiceModel]] + key "name": Required[str] + key "pitch": str + key "rate": str + key "style": str + key "temperature": float + key "type": Required[Literal[AzureVoiceType.AZURE_PERSONAL]] + key "volume": str + custom_lexicon_url: str + custom_text_normalization_url: str + locale: str + model: Union[str, PersonalVoiceModel] + name: str + pitch: str + prefer_locales: list[str] + rate: str + style: str + temperature: float + type: Literal[AzureVoiceType.AZURE_PERSONAL] + volume: str + + + class azure.ai.voiceagents.types.AzureRealtimeNativeVoice(TypedDict, total=False): + key "name": Required[Union[str, AzureRealtimeNativeVoiceName]] + key "type": Required[Literal["azure-realtime-native"]] + name: Union[str, AzureRealtimeNativeVoiceName] + type: Literal[azure-realtime-native] + + + class azure.ai.voiceagents.types.AzureStandardVoice(TypedDict, total=False): + key "custom_lexicon_url": str + key "custom_text_normalization_url": str + key "locale": str + key "multi_talker_speaker_name": str + key "name": Required[str] + key "pitch": str + key "rate": str + key "style": str + key "temperature": float + key "type": Required[Literal[AzureVoiceType.AZURE_STANDARD]] + key "volume": str + custom_lexicon_url: str + custom_text_normalization_url: str + locale: str + multi_talker_speaker_name: str + name: str + pitch: str + prefer_locales: list[str] + rate: str + style: str + temperature: float + type: Literal[AzureVoiceType.AZURE_STANDARD] + volume: str + + + class azure.ai.voiceagents.types.AzureVoiceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AVATAR_VOICE_SYNC = "avatar-voice-sync" + AZURE_CUSTOM = "azure-custom" + AZURE_PERSONAL = "azure-personal" + AZURE_STANDARD = "azure-standard" + + + class azure.ai.voiceagents.types.BotServiceAuthorizationScheme(TypedDict, total=False): + key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE]] + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE] + + + class azure.ai.voiceagents.types.BotServiceRbacAuthorizationScheme(TypedDict, total=False): + key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC]] + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC] + + + class azure.ai.voiceagents.types.BotServiceTenantAuthorizationScheme(TypedDict, total=False): + key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT]] + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT] + + + class azure.ai.voiceagents.types.CreateTranscriptionResponseJsonUsageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DURATION = "duration" + TOKENS = "tokens" + + + class azure.ai.voiceagents.types.CreateVoiceAgentRequest(TypedDict, total=False): + key "agent_card": ForwardRef('AgentCard', module='types') + key "agent_endpoint": ForwardRef('AgentEndpointConfig', module='types') + key "blueprint_reference": ForwardRef('AgentBlueprintReference', module='types') + key "definition": Required[VoiceAgentDefinition] + key "description": str + key "draft": bool + key "name": Required[str] + key "state": Union[str, AgentState] + agent_card: AgentCard + agent_endpoint: AgentEndpointConfig + blueprint_reference: AgentBlueprintReference + definition: VoiceAgentDefinition + description: str + draft: bool + metadata: dict[str, str] + name: str + state: Union[str, AgentState] + + + class azure.ai.voiceagents.types.CreateVoiceAgentVersionRequest(TypedDict, total=False): + key "blueprint_reference": ForwardRef('AgentBlueprintReference', module='types') + key "definition": Required[VoiceAgentDefinition] + key "description": str + key "draft": bool + blueprint_reference: AgentBlueprintReference + definition: VoiceAgentDefinition + description: str + draft: bool + metadata: dict[str, str] + + + class azure.ai.voiceagents.types.EntraAuthorizationScheme(TypedDict, total=False): + key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.ENTRA]] + type: Literal[AgentEndpointAuthorizationSchemeType.ENTRA] + + + class azure.ai.voiceagents.types.FixedRatioVersionSelectionRule(TypedDict, total=False): + key "agent_version": Required[str] + key "traffic_percentage": Required[int] + key "type": Required[Literal[VersionSelectorType.FIXED_RATIO]] + agent_version: str + traffic_percentage: int + type: Literal[VersionSelectorType.FIXED_RATIO] + + + class azure.ai.voiceagents.types.GenerateVoiceAgentRequest(TypedDict, total=False): + key "agent_type": Required[Union[str, VoiceAgentType]] + key "description": str + key "draft": bool + key "goal": Required[str] + key "model": Required[str] + key "model_type": Required[Union[str, VoiceModelType]] + key "name": Required[str] + key "use_case": Required[Union[str, VoiceAgentUseCase]] + agent_type: Union[str, VoiceAgentType] + description: str + draft: bool + goal: str + model: str + model_type: Union[str, VoiceModelType] + name: str + tools: list[VoiceAgentTool] + use_case: Union[str, VoiceAgentUseCase] + + + class azure.ai.voiceagents.types.InvocationsProtocolConfiguration(TypedDict, total=False): + + + class azure.ai.voiceagents.types.InvocationsWsProtocolConfiguration(TypedDict, total=False): + + + class azure.ai.voiceagents.types.LlmGeneratedVoiceGreetingConfig(TypedDict, total=False): + key "fallback_text": str + key "prompt": Required[str] + key "tool_choice": Union[str, VoiceGreetingToolChoice] + key "type": Required[Literal["llm_generated"]] + fallback_text: str + prompt: str + tool_choice: Union[str, VoiceGreetingToolChoice] + type: Literal[llm_generated] + + + class azure.ai.voiceagents.types.LogProbProperties(TypedDict, total=False): + key "bytes": Required[list[int]] + key "logprob": Required[float] + key "token": Required[str] + bytes: list[int] + logprob: float + token: str + + + class azure.ai.voiceagents.types.MCPListToolsTool(TypedDict, total=False): + key "annotations": Optional[MCPListToolsToolAnnotations] + key "description": Optional[str] + key "input_schema": Required[MCPListToolsToolInputSchema] + key "name": Required[str] + annotations: MCPListToolsToolAnnotations + description: str + input_schema: MCPListToolsToolInputSchema + name: str + + + class azure.ai.voiceagents.types.MCPListToolsToolAnnotations(TypedDict, total=False): + + + class azure.ai.voiceagents.types.MCPListToolsToolInputSchema(TypedDict, total=False): + + + class azure.ai.voiceagents.types.MCPTool(TypedDict, total=False): + key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] + key "allowed_tools": Optional[Union[list[str], MCPToolFilter]] + key "authorization": str + key "connector_id": Literal["connector_dropbox", "connector_gmail", "connector_googlecalendar", "connector_googledrive", "connector_microsoftteams", "connector_outlookcalendar", "connector_outlookemail", "connector_sharepoint"] + key "defer_loading": bool + key "headers": Optional[dict[str, str]] + key "project_connection_id": str + key "require_approval": Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] + key "server_description": str + key "server_label": Required[str] + key "server_url": str + key "tunnel_id": str + key "type": Required[Literal[ToolType.MCP]] + allowed_callers: list[Union[str, CallableToolAllowedCaller]] + allowed_tools: Union[list[str], MCPToolFilter] + authorization: str + connector_id: Literal[connector_dropbox, connector_gmail, connector_googlecalendar, connector_googledrive, connector_microsoftteams, + defer_loading: bool + headers: dict[str, str] + project_connection_id: str + require_approval: Union[MCPToolRequireApproval, Literal[always], Literal[never]] + server_description: str + server_label: str + server_url: str + tool_configs: dict[str, ToolConfig] + tunnel_id: str + type: Literal[ToolType.MCP] + + + class azure.ai.voiceagents.types.MCPToolFilter(TypedDict, total=False): + key "read_only": bool + read_only: bool + tool_names: list[str] + + + class azure.ai.voiceagents.types.MCPToolRequireApproval(TypedDict, total=False): + key "always": ForwardRef('MCPToolFilter', module='types') + key "never": ForwardRef('MCPToolFilter', module='types') + always: MCPToolFilter + never: MCPToolFilter + + + class azure.ai.voiceagents.types.ManagedAgentIdentityBlueprintReference(TypedDict, total=False): + key "blueprint_id": Required[str] + key "type": Required[Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT]] + blueprint_id: str + type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] + + + class azure.ai.voiceagents.types.McpProtocolConfiguration(TypedDict, total=False): + + + class azure.ai.voiceagents.types.Metadata(TypedDict, total=False): + + + class azure.ai.voiceagents.types.OpenAIVoice(TypedDict, total=False): + key "name": Required[Union[str, VoiceIdsShared]] + key "type": Required[Literal["openai"]] + name: Union[str, VoiceIdsShared] + type: Literal[openai] + + + class azure.ai.voiceagents.types.ProtocolConfiguration(TypedDict, total=False): + key "a2a": ForwardRef('A2AProtocolConfiguration', module='types') + key "activity": ForwardRef('ActivityProtocolConfiguration', module='types') + key "invocations": ForwardRef('InvocationsProtocolConfiguration', module='types') + key "invocations_ws": ForwardRef('InvocationsWsProtocolConfiguration', module='types') + key "mcp": ForwardRef('McpProtocolConfiguration', module='types') + key "responses": ForwardRef('ResponsesProtocolConfiguration', module='types') + a2a: A2AProtocolConfiguration + activity: ActivityProtocolConfiguration + invocations: InvocationsProtocolConfiguration + invocations_ws: InvocationsWsProtocolConfiguration + mcp: McpProtocolConfiguration + responses: ResponsesProtocolConfiguration + + + class azure.ai.voiceagents.types.RaiConfig(TypedDict, total=False): + key "rai_policy_name": Required[str] + rai_policy_name: str + + + class azure.ai.voiceagents.types.RealtimeClientEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONVERSATION_ITEM_CREATE = "conversation.item.create" + CONVERSATION_ITEM_DELETE = "conversation.item.delete" + CONVERSATION_ITEM_RETRIEVE = "conversation.item.retrieve" + CONVERSATION_ITEM_TRUNCATE = "conversation.item.truncate" + INPUT_AUDIO_BUFFER_APPEND = "input_audio_buffer.append" + INPUT_AUDIO_BUFFER_CLEAR = "input_audio_buffer.clear" + INPUT_AUDIO_BUFFER_COMMIT = "input_audio_buffer.commit" + OUTPUT_AUDIO_BUFFER_CLEAR = "output_audio_buffer.clear" + RESPONSE_CANCEL = "response.cancel" + RESPONSE_CREATE = "response.create" + SESSION_UPDATE = "session.update" + + + class azure.ai.voiceagents.types.RealtimeConversationItemFunctionCall(TypedDict, total=False): + key "arguments": Required[str] + key "call_id": str + key "id": str + key "name": Required[str] + key "object": Literal["item"] + key "status": Literal["completed", "incomplete", "in_progress"] + key "type": Required[Literal[RealtimeConversationItemType.FUNCTION_CALL]] + arguments: str + call_id: str + id: str + name: str + object: Literal[item] + status: Literal[completed, incomplete, in_progress] + type: Literal[RealtimeConversationItemType.FUNCTION_CALL] + + + class azure.ai.voiceagents.types.RealtimeConversationItemFunctionCallOutput(TypedDict, total=False): + key "call_id": Required[str] + key "id": str + key "object": Literal["item"] + key "output": Required[str] + key "status": Literal["completed", "incomplete", "in_progress"] + key "type": Required[Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT]] + call_id: str + id: str + object: Literal[item] + output: str + status: Literal[completed, incomplete, in_progress] + type: Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT] + + + class azure.ai.voiceagents.types.RealtimeConversationItemMessageAssistant(TypedDict, total=False): + key "content": Required[list[RealtimeConversationItemMessageAssistantContent]] + key "id": str + key "object": Literal["item"] + key "role": Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] + key "status": Literal["completed", "incomplete", "in_progress"] + key "type": Required[Literal["message"]] + content: list[RealtimeConversationItemMessageAssistantContent] + id: str + object: Literal[item] + role: Literal[RealtimeConversationItemMessageType.ASSISTANT] + status: Literal[completed, incomplete, in_progress] + type: Literal[message] + + + class azure.ai.voiceagents.types.RealtimeConversationItemMessageAssistantContent(TypedDict, total=False): + key "audio": str + key "text": str + key "transcript": str + key "type": Literal["output_text", "output_audio"] + audio: str + text: str + transcript: str + type: Literal[output_text, output_audio] + + + class azure.ai.voiceagents.types.RealtimeConversationItemMessageSystem(TypedDict, total=False): + key "content": Required[list[RealtimeConversationItemMessageSystemContent]] + key "id": str + key "object": Literal["item"] + key "role": Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] + key "status": Literal["completed", "incomplete", "in_progress"] + key "type": Required[Literal["message"]] + content: list[RealtimeConversationItemMessageSystemContent] + id: str + object: Literal[item] + role: Literal[RealtimeConversationItemMessageType.SYSTEM] + status: Literal[completed, incomplete, in_progress] + type: Literal[message] + + + class azure.ai.voiceagents.types.RealtimeConversationItemMessageSystemContent(TypedDict, total=False): + key "text": str + key "type": Literal["input_text"] + text: str + type: Literal[input_text] + + + class azure.ai.voiceagents.types.RealtimeConversationItemMessageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ASSISTANT = "assistant" + SYSTEM = "system" + USER = "user" + + + class azure.ai.voiceagents.types.RealtimeConversationItemMessageUser(TypedDict, total=False): + key "content": Required[list[RealtimeConversationItemMessageUserContent]] + key "id": str + key "object": Literal["item"] + key "role": Required[Literal[RealtimeConversationItemMessageType.USER]] + key "status": Literal["completed", "incomplete", "in_progress"] + key "type": Required[Literal["message"]] + content: list[RealtimeConversationItemMessageUserContent] + id: str + object: Literal[item] + role: Literal[RealtimeConversationItemMessageType.USER] + status: Literal[completed, incomplete, in_progress] + type: Literal[message] + + + class azure.ai.voiceagents.types.RealtimeConversationItemMessageUserContent(TypedDict, total=False): + key "audio": str + key "detail": Literal["auto", "low", "high"] + key "image_url": str + key "text": str + key "transcript": str + key "type": Literal["input_text", "input_audio", "input_image"] + audio: str + detail: Literal[auto, low, high] + image_url: str + text: str + transcript: str + type: Literal[input_text, input_audio, input_image] + + + class azure.ai.voiceagents.types.RealtimeConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FUNCTION_CALL = "function_call" + FUNCTION_CALL_OUTPUT = "function_call_output" + MCP_APPROVAL_REQUEST = "mcp_approval_request" + MCP_APPROVAL_RESPONSE = "mcp_approval_response" + MCP_CALL = "mcp_call" + MCP_LIST_TOOLS = "mcp_list_tools" + + + class azure.ai.voiceagents.types.RealtimeFunctionTool(TypedDict, total=False): + key "description": str + key "name": str + key "parameters": ForwardRef('RealtimeFunctionToolParameters', module='types') + key "type": Literal["function"] + description: str + name: str + parameters: RealtimeFunctionToolParameters + type: Literal[function] + + + class azure.ai.voiceagents.types.RealtimeFunctionToolParameters(TypedDict, total=False): + + + class azure.ai.voiceagents.types.RealtimeMCPApprovalRequest(TypedDict, total=False): + key "arguments": Required[str] + key "id": Required[str] + key "name": Required[str] + key "server_label": Required[str] + key "type": Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST]] + arguments: str + id: str + name: str + server_label: str + type: Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST] + + + class azure.ai.voiceagents.types.RealtimeMCPApprovalResponse(TypedDict, total=False): + key "approval_request_id": Required[str] + key "approve": Required[bool] + key "id": Required[str] + key "reason": Optional[str] + key "type": Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE]] + approval_request_id: str + approve: bool + id: str + reason: str + type: Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE] + + + class azure.ai.voiceagents.types.RealtimeMCPHTTPError(TypedDict, total=False): + key "code": Required[int] + key "message": Required[str] + key "type": Required[Literal[RealtimeMcpErrorType.HTTP_ERROR]] + code: int + message: str + type: Literal[RealtimeMcpErrorType.HTTP_ERROR] + + + class azure.ai.voiceagents.types.RealtimeMCPListTools(TypedDict, total=False): + key "id": str + key "server_label": Required[str] + key "tools": Required[list[MCPListToolsTool]] + key "type": Required[Literal[RealtimeConversationItemType.MCP_LIST_TOOLS]] + id: str + server_label: str + tools: list[MCPListToolsTool] + type: Literal[RealtimeConversationItemType.MCP_LIST_TOOLS] + + + class azure.ai.voiceagents.types.RealtimeMCPProtocolError(TypedDict, total=False): + key "code": Required[int] + key "message": Required[str] + key "type": Required[Literal[RealtimeMcpErrorType.PROTOCOL_ERROR]] + code: int + message: str + type: Literal[RealtimeMcpErrorType.PROTOCOL_ERROR] + + + class azure.ai.voiceagents.types.RealtimeMCPToolCall(TypedDict, total=False): + key "approval_request_id": Optional[str] + key "arguments": Required[str] + key "error": ForwardRef('RealtimeMCPError', module='types') + key "id": Required[str] + key "name": Required[str] + key "output": Optional[str] + key "server_label": Required[str] + key "type": Required[Literal[RealtimeConversationItemType.MCP_CALL]] + approval_request_id: str + arguments: str + error: RealtimeMCPError + id: str + name: str + output: str + server_label: str + type: Literal[RealtimeConversationItemType.MCP_CALL] + + + class azure.ai.voiceagents.types.RealtimeMCPToolExecutionError(TypedDict, total=False): + key "message": Required[str] + key "type": Required[Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR]] + message: str + type: Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR] + + + class azure.ai.voiceagents.types.RealtimeMcpErrorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HTTP_ERROR = "http_error" + PROTOCOL_ERROR = "protocol_error" + TOOL_EXECUTION_ERROR = "tool_execution_error" + + + class azure.ai.voiceagents.types.RealtimeReasoning(TypedDict, total=False): + key "effort": Union[str, RealtimeReasoningEffort] + effort: Union[str, RealtimeReasoningEffort] + + + class azure.ai.voiceagents.types.RealtimeResponseStatusDetails(TypedDict, total=False): + key "error": ForwardRef('RealtimeResponseStatusDetailsError', module='types') + key "reason": Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"] + key "type": Literal["completed", "cancelled", "failed", "incomplete"] + error: RealtimeResponseStatusDetailsError + reason: Literal[turn_detected, client_cancelled, max_output_tokens, content_filter] + type: Literal[completed, cancelled, failed, incomplete] + + + class azure.ai.voiceagents.types.RealtimeResponseStatusDetailsError(TypedDict, total=False): + key "code": str + key "type": str + code: str + type: str + + + class azure.ai.voiceagents.types.RealtimeResponseUsage(TypedDict, total=False): + key "input_token_details": ForwardRef('RealtimeResponseUsageInputTokenDetails', module='types') + key "input_tokens": int + key "output_token_details": ForwardRef('RealtimeResponseUsageOutputTokenDetails', module='types') + key "output_tokens": int + key "total_tokens": int + input_token_details: RealtimeResponseUsageInputTokenDetails + input_tokens: int + output_token_details: RealtimeResponseUsageOutputTokenDetails + output_tokens: int + total_tokens: int + + + class azure.ai.voiceagents.types.RealtimeResponseUsageInputTokenDetails(TypedDict, total=False): + key "audio_tokens": int + key "cached_tokens": int + key "cached_tokens_details": ForwardRef('RealtimeResponseUsageInputTokenDetailsCachedTokensDetails', module='types') + key "image_tokens": int + key "text_tokens": int + audio_tokens: int + cached_tokens: int + cached_tokens_details: RealtimeResponseUsageInputTokenDetailsCachedTokensDetails + image_tokens: int + text_tokens: int + + + class azure.ai.voiceagents.types.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails(TypedDict, total=False): + key "audio_tokens": int + key "image_tokens": int + key "text_tokens": int + audio_tokens: int + image_tokens: int + text_tokens: int + + + class azure.ai.voiceagents.types.RealtimeResponseUsageOutputTokenDetails(TypedDict, total=False): + key "audio_tokens": int + key "text_tokens": int + audio_tokens: int + text_tokens: int + + + class azure.ai.voiceagents.types.RealtimeServerEvent(TypedDict, total=False): + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "part": Required[RealtimeServerEventResponseContentPartAddedPart] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED]] + content_index: int + event_id: str + item_id: str + output_index: int + part: RealtimeServerEventResponseContentPartAddedPart + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED] + + + class azure.ai.voiceagents.types.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError(TypedDict, total=False): + key "code": str + key "message": str + key "param": str + key "type": str + code: str + message: str + param: str + type: str + + + class azure.ai.voiceagents.types.RealtimeServerEventRateLimitsUpdatedRateLimits(TypedDict, total=False): + key "limit": int + key "name": Literal["requests", "tokens"] + key "remaining": int + key "reset_seconds": float + limit: int + name: Literal[requests, tokens] + remaining: int + reset_seconds: float + + + class azure.ai.voiceagents.types.RealtimeServerEventResponseContentPartAdded(TypedDict, total=False): + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "part": Required[RealtimeServerEventResponseContentPartAddedPart] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED]] + content_index: int + event_id: str + item_id: str + output_index: int + part: RealtimeServerEventResponseContentPartAddedPart + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED] + + + class azure.ai.voiceagents.types.RealtimeServerEventResponseContentPartAddedPart(TypedDict, total=False): + key "audio": str + key "text": str + key "transcript": str + key "type": Literal["audio", "text"] + audio: str + text: str + transcript: str + type: Literal[audio, text] + + + class azure.ai.voiceagents.types.RealtimeServerEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONVERSATION_CREATED = "conversation.created" + CONVERSATION_ITEM_ADDED = "conversation.item.added" + CONVERSATION_ITEM_CREATED = "conversation.item.created" + CONVERSATION_ITEM_DELETED = "conversation.item.deleted" + CONVERSATION_ITEM_DONE = "conversation.item.done" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED = "conversation.item.input_audio_transcription.completed" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA = "conversation.item.input_audio_transcription.delta" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED = "conversation.item.input_audio_transcription.failed" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT = "conversation.item.input_audio_transcription.segment" + CONVERSATION_ITEM_RETRIEVED = "conversation.item.retrieved" + CONVERSATION_ITEM_TRUNCATED = "conversation.item.truncated" + ERROR = "error" + INPUT_AUDIO_BUFFER_CLEARED = "input_audio_buffer.cleared" + INPUT_AUDIO_BUFFER_COMMITTED = "input_audio_buffer.committed" + INPUT_AUDIO_BUFFER_DTMF_EVENT_RECEIVED = "input_audio_buffer.dtmf_event_received" + INPUT_AUDIO_BUFFER_SPEECH_STARTED = "input_audio_buffer.speech_started" + INPUT_AUDIO_BUFFER_SPEECH_STOPPED = "input_audio_buffer.speech_stopped" + INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED = "input_audio_buffer.timeout_triggered" + MCP_LIST_TOOLS_COMPLETED = "mcp_list_tools.completed" + MCP_LIST_TOOLS_FAILED = "mcp_list_tools.failed" + MCP_LIST_TOOLS_IN_PROGRESS = "mcp_list_tools.in_progress" + OUTPUT_AUDIO_BUFFER_CLEARED = "output_audio_buffer.cleared" + OUTPUT_AUDIO_BUFFER_STARTED = "output_audio_buffer.started" + OUTPUT_AUDIO_BUFFER_STOPPED = "output_audio_buffer.stopped" + RATE_LIMITS_UPDATED = "rate_limits.updated" + RESPONSE_CONTENT_PART_ADDED = "response.content_part.added" + RESPONSE_CONTENT_PART_DONE = "response.content_part.done" + RESPONSE_CREATED = "response.created" + RESPONSE_DONE = "response.done" + RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA = "response.function_call_arguments.delta" + RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE = "response.function_call_arguments.done" + RESPONSE_MCP_CALL_ARGUMENTS_DELTA = "response.mcp_call_arguments.delta" + RESPONSE_MCP_CALL_ARGUMENTS_DONE = "response.mcp_call_arguments.done" + RESPONSE_MCP_CALL_COMPLETED = "response.mcp_call.completed" + RESPONSE_MCP_CALL_FAILED = "response.mcp_call.failed" + RESPONSE_MCP_CALL_IN_PROGRESS = "response.mcp_call.in_progress" + RESPONSE_OUTPUT_AUDIO_DELTA = "response.output_audio.delta" + RESPONSE_OUTPUT_AUDIO_DONE = "response.output_audio.done" + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA = "response.output_audio_transcript.delta" + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE = "response.output_audio_transcript.done" + RESPONSE_OUTPUT_ITEM_ADDED = "response.output_item.added" + RESPONSE_OUTPUT_ITEM_DONE = "response.output_item.done" + RESPONSE_OUTPUT_TEXT_DELTA = "response.output_text.delta" + RESPONSE_OUTPUT_TEXT_DONE = "response.output_text.done" + SESSION_CREATED = "session.created" + SESSION_UPDATED = "session.updated" + + + class azure.ai.voiceagents.types.RealtimeToolChoiceFunction(TypedDict, total=False): + key "name": Required[str] + key "type": Required[Literal[ToolChoiceParamType.FUNCTION]] + name: str + type: Literal[ToolChoiceParamType.FUNCTION] + + + class azure.ai.voiceagents.types.ResponsesProtocolConfiguration(TypedDict, total=False): + + + class azure.ai.voiceagents.types.StructuredInputDefinition(TypedDict, total=False): + key "default_value": Any + key "description": str + key "required": bool + default_value: Any + description: str + required: bool + schema: dict[str, Any] + + + class azure.ai.voiceagents.types.TemplateVoiceGreetingConfig(TypedDict, total=False): + key "text": Required[str] + key "type": Required[Literal["template"]] + text: str + type: Literal[template] + + + class azure.ai.voiceagents.types.Tool(TypedDict, total=False): + key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] + key "allowed_tools": Optional[Union[list[str], MCPToolFilter]] + key "authorization": str + key "connector_id": Literal["connector_dropbox", "connector_gmail", "connector_googlecalendar", "connector_googledrive", "connector_microsoftteams", "connector_outlookcalendar", "connector_outlookemail", "connector_sharepoint"] + key "defer_loading": bool + key "headers": Optional[dict[str, str]] + key "project_connection_id": str + key "require_approval": Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] + key "server_description": str + key "server_label": Required[str] + key "server_url": str + key "tunnel_id": str + key "type": Required[Literal[ToolType.MCP]] + allowed_callers: list[Union[str, CallableToolAllowedCaller]] + allowed_tools: Union[list[str], MCPToolFilter] + authorization: str + connector_id: Literal[connector_dropbox, connector_gmail, connector_googlecalendar, connector_googledrive, connector_microsoftteams, + defer_loading: bool + headers: dict[str, str] + project_connection_id: str + require_approval: Union[MCPToolRequireApproval, Literal[always], Literal[never]] + server_description: str + server_label: str + server_url: str + tool_configs: dict[str, ToolConfig] + tunnel_id: str + type: Literal[ToolType.MCP] + + + class azure.ai.voiceagents.types.ToolChoiceFunction(TypedDict, total=False): + key "name": Required[str] + key "type": Required[Literal[ToolChoiceParamType.FUNCTION]] + name: str + type: Literal[ToolChoiceParamType.FUNCTION] + + + class azure.ai.voiceagents.types.ToolChoiceMCP(TypedDict, total=False): + key "name": Optional[str] + key "server_label": Required[str] + key "type": Required[Literal[ToolChoiceParamType.MCP]] + name: str + server_label: str + type: Literal[ToolChoiceParamType.MCP] + + + class azure.ai.voiceagents.types.ToolChoiceParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ALLOWED_TOOLS = "allowed_tools" + APPLY_PATCH = "apply_patch" + CODE_INTERPRETER = "code_interpreter" + COMPUTER = "computer" + COMPUTER_USE = "computer_use" + COMPUTER_USE_PREVIEW = "computer_use_preview" + CUSTOM = "custom" + FILE_SEARCH = "file_search" + FUNCTION = "function" + IMAGE_GENERATION = "image_generation" + MCP = "mcp" + PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" + SHELL = "shell" + WEB_SEARCH_PREVIEW = "web_search_preview" + WEB_SEARCH_PREVIEW2025_03_11 = "web_search_preview_2025_03_11" + + + class azure.ai.voiceagents.types.ToolConfig(TypedDict, total=False): + key "additional_search_text": str + key "pin": bool + additional_search_text: str + pin: bool + + + class azure.ai.voiceagents.types.ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + A2_A_PREVIEW = "a2a_preview" + APPLY_PATCH = "apply_patch" + AZURE_AI_SEARCH = "azure_ai_search" + AZURE_FUNCTION = "azure_function" + BING_CUSTOM_SEARCH_PREVIEW = "bing_custom_search_preview" + BING_GROUNDING = "bing_grounding" + BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" + CAPTURE_STRUCTURED_OUTPUTS = "capture_structured_outputs" + CODE_INTERPRETER = "code_interpreter" + COMPUTER = "computer" + COMPUTER_USE_PREVIEW = "computer_use_preview" + CUSTOM = "custom" + FABRIC_DATAAGENT_PREVIEW = "fabric_dataagent_preview" + FABRIC_IQ_PREVIEW = "fabric_iq_preview" + FILE_SEARCH = "file_search" + FUNCTION = "function" + IMAGE_GENERATION = "image_generation" + LOCAL_SHELL = "local_shell" + MCP = "mcp" + MEMORY_SEARCH_PREVIEW = "memory_search_preview" + NAMESPACE = "namespace" + OPENAPI = "openapi" + PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" + SHAREPOINT_GROUNDING_PREVIEW = "sharepoint_grounding_preview" + SHELL = "shell" + TOOLBOX_SEARCH_PREVIEW = "toolbox_search_preview" + TOOL_SEARCH = "tool_search" + WEB_SEARCH = "web_search" + WEB_SEARCH_PREVIEW = "web_search_preview" + WORK_IQ_PREVIEW = "work_iq_preview" + + + class azure.ai.voiceagents.types.TranscriptTextUsageDuration(TypedDict, total=False): + key "seconds": Required[str] + key "type": Required[Literal[CreateTranscriptionResponseJsonUsageType.DURATION]] + seconds: str + type: Literal[CreateTranscriptionResponseJsonUsageType.DURATION] + + + class azure.ai.voiceagents.types.TranscriptTextUsageTokens(TypedDict, total=False): + key "input_token_details": ForwardRef('TranscriptTextUsageTokensInputTokenDetails', module='types') + key "input_tokens": Required[int] + key "output_tokens": Required[int] + key "total_tokens": Required[int] + key "type": Required[Literal[CreateTranscriptionResponseJsonUsageType.TOKENS]] + input_token_details: TranscriptTextUsageTokensInputTokenDetails + input_tokens: int + output_tokens: int + total_tokens: int + type: Literal[CreateTranscriptionResponseJsonUsageType.TOKENS] + + + class azure.ai.voiceagents.types.TranscriptTextUsageTokensInputTokenDetails(TypedDict, total=False): + key "audio_tokens": int + key "text_tokens": int + audio_tokens: int + text_tokens: int + + + class azure.ai.voiceagents.types.UpdateVoiceAgentRequest(TypedDict, total=False): + key "blueprint_reference": ForwardRef('AgentBlueprintReference', module='types') + key "definition": Required[VoiceAgentDefinition] + key "description": str + blueprint_reference: AgentBlueprintReference + definition: VoiceAgentDefinition + description: str + metadata: dict[str, str] + + + class azure.ai.voiceagents.types.VersionSelectionRule(TypedDict, total=False): + key "agent_version": Required[str] + key "traffic_percentage": Required[int] + key "type": Required[Literal[VersionSelectorType.FIXED_RATIO]] + agent_version: str + traffic_percentage: int + type: Literal[VersionSelectorType.FIXED_RATIO] + + + class azure.ai.voiceagents.types.VersionSelector(TypedDict, total=False): + key "version_selection_rules": Required[list[VersionSelectionRule]] + version_selection_rules: list[VersionSelectionRule] + + + class azure.ai.voiceagents.types.VersionSelectorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FIXED_RATIO = "FixedRatio" + + + class azure.ai.voiceagents.types.VoiceAgentAnimationConfig(TypedDict, total=False): + key "model_name": str + model_name: str + outputs: list[Union[str, VoiceAgentAnimationOutputType]] + + + class azure.ai.voiceagents.types.VoiceAgentAvatarIceServer(TypedDict, total=False): + key "credential": Optional[str] + key "urls": Required[list[str]] + key "username": Optional[str] + credential: str + urls: list[str] + username: str + + + class azure.ai.voiceagents.types.VoiceAgentAvatarScene(TypedDict, total=False): + key "amplitude": float + key "position_x": float + key "position_y": float + key "rotation_x": float + key "rotation_y": float + key "rotation_z": float + key "zoom": float + amplitude: float + position_x: float + position_y: float + rotation_x: float + rotation_y: float + rotation_z: float + zoom: float + + + class azure.ai.voiceagents.types.VoiceAgentAvatarVideoBackground(TypedDict, total=False): + key "color": Optional[str] + key "image_url": Optional[str] + color: str + image_url: str + + + class azure.ai.voiceagents.types.VoiceAgentAvatarVideoCrop(TypedDict, total=False): + key "bottom_right": Required[list[int]] + key "top_left": Required[list[int]] + bottom_right: list[int] + top_left: list[int] + + + class azure.ai.voiceagents.types.VoiceAgentAvatarVideoParams(TypedDict, total=False): + key "background": Optional[VoiceAgentAvatarVideoBackground] + key "bitrate": int + key "codec": Literal["h264"] + key "crop": Optional[VoiceAgentAvatarVideoCrop] + key "gop_size": int + key "resolution": Optional[VoiceAgentAvatarVideoResolution] + background: VoiceAgentAvatarVideoBackground + bitrate: int + codec: Literal[h264] + crop: VoiceAgentAvatarVideoCrop + gop_size: int + resolution: VoiceAgentAvatarVideoResolution + + + class azure.ai.voiceagents.types.VoiceAgentAvatarVideoResolution(TypedDict, total=False): + key "height": Required[int] + key "width": Required[int] + height: int + width: int + + + class azure.ai.voiceagents.types.VoiceAgentAzureMultilingualSemanticVadTurnDetection(TypedDict, total=False): + key "auto_truncate": bool + key "create_response": bool + key "end_of_utterance_detection": Optional[VoiceAgentEndOfUtteranceDetection] + key "idle_timeout_ms": Optional[int] + key "interrupt_response": bool + key "languages": Optional[list[str]] + key "prefix_padding_ms": Optional[int] + key "remove_filler_words": bool + key "silence_duration_ms": Optional[int] + key "speech_duration_ms": Optional[int] + key "threshold": Optional[float] + key "type": Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL]] + auto_truncate: bool + create_response: bool + end_of_utterance_detection: VoiceAgentEndOfUtteranceDetection + idle_timeout_ms: int + interrupt_response: bool + languages: list[str] + prefix_padding_ms: int + remove_filler_words: bool + silence_duration_ms: int + speech_duration_ms: int + threshold: float + type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] + + + class azure.ai.voiceagents.types.VoiceAgentAzureSemanticVadTurnDetection(TypedDict, total=False): + key "auto_truncate": bool + key "create_response": bool + key "end_of_utterance_detection": Optional[VoiceAgentEndOfUtteranceDetection] + key "idle_timeout_ms": Optional[int] + key "interrupt_response": bool + key "languages": Optional[list[str]] + key "prefix_padding_ms": Optional[int] + key "remove_filler_words": bool + key "silence_duration_ms": Optional[int] + key "speech_duration_ms": Optional[int] + key "threshold": Optional[float] + key "type": Required[Union[str, VoiceAgentAzureSemanticVadType]] + auto_truncate: bool + create_response: bool + end_of_utterance_detection: VoiceAgentEndOfUtteranceDetection + idle_timeout_ms: int + interrupt_response: bool + languages: list[str] + prefix_padding_ms: int + remove_filler_words: bool + silence_duration_ms: int + speech_duration_ms: int + threshold: float + type: Union[str, VoiceAgentAzureSemanticVadType] + + + class azure.ai.voiceagents.types.VoiceAgentClientEventConversationItemCreate(TypedDict, total=False): + key "event_id": str + key "item": Required[VoiceAgentCreateConversationItem] + key "previous_item_id": str + key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE]] + event_id: str + item: VoiceAgentCreateConversationItem + previous_item_id: str + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE] + + + class azure.ai.voiceagents.types.VoiceAgentClientEventConversationItemDelete(TypedDict, total=False): + key "event_id": str + key "item_id": Required[str] + key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE]] + event_id: str + item_id: str + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE] + + + class azure.ai.voiceagents.types.VoiceAgentClientEventConversationItemRetrieve(TypedDict, total=False): + key "event_id": str + key "item_id": Required[str] + key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE]] + event_id: str + item_id: str + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE] + + + class azure.ai.voiceagents.types.VoiceAgentClientEventConversationItemTruncate(TypedDict, total=False): + key "audio_end_ms": Required[int] + key "content_index": Required[int] + key "event_id": str + key "item_id": Required[str] + key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE]] + audio_end_ms: int + content_index: int + event_id: str + item_id: str + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE] + + + class azure.ai.voiceagents.types.VoiceAgentClientEventInputAudioBufferAppend(TypedDict, total=False): + key "audio": Required[str] + key "event_id": str + key "type": Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND]] + audio: str + event_id: str + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND] + + + class azure.ai.voiceagents.types.VoiceAgentClientEventInputAudioBufferClear(TypedDict, total=False): + key "event_id": str + key "type": Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR]] + event_id: str + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR] + + + class azure.ai.voiceagents.types.VoiceAgentClientEventInputAudioBufferCommit(TypedDict, total=False): + key "event_id": str + key "type": Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT]] + event_id: str + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT] + + + class azure.ai.voiceagents.types.VoiceAgentClientEventOutputAudioBufferClear(TypedDict, total=False): + key "event_id": str + key "type": Required[Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR]] + event_id: str + type: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR] + + + class azure.ai.voiceagents.types.VoiceAgentClientEventResponseCancel(TypedDict, total=False): + key "event_id": str + key "response_id": str + key "type": Required[Literal[RealtimeClientEventType.RESPONSE_CANCEL]] + event_id: str + response_id: str + type: Literal[RealtimeClientEventType.RESPONSE_CANCEL] + + + class azure.ai.voiceagents.types.VoiceAgentClientEventResponseCreate(TypedDict, total=False): + key "event_id": str + key "response": ForwardRef('VoiceAgentResponseCreateParams', module='types') + key "type": Required[Literal[RealtimeClientEventType.RESPONSE_CREATE]] + event_id: str + response: VoiceAgentResponseCreateParams + type: Literal[RealtimeClientEventType.RESPONSE_CREATE] + + + class azure.ai.voiceagents.types.VoiceAgentClientEventSessionAvatarConnect(TypedDict, total=False): + key "client_sdp": Required[str] + key "event_id": str + key "type": Required[Literal["connect"]] + client_sdp: str + event_id: str + type: Literal[connect] + + + class azure.ai.voiceagents.types.VoiceAgentClientEventSessionUpdate(TypedDict, total=False): + key "event_id": str + key "session": Required[VoiceAgentSessionUpdateConfig] + key "type": Required[Literal[RealtimeClientEventType.SESSION_UPDATE]] + event_id: str + session: VoiceAgentSessionUpdateConfig + type: Literal[RealtimeClientEventType.SESSION_UPDATE] + + + class azure.ai.voiceagents.types.VoiceAgentDefinition(TypedDict, total=False): + key "audio": ForwardRef('VoiceAudioConfig', module='types') + key "avatar": ForwardRef('VoiceAvatarConfig', module='types') + key "greeting": ForwardRef('VoiceGreetingConfig', module='types') + key "instructions": str + key "kind": Required[Literal["voice"]] + key "model": Required[str] + key "model_type": Required[Union[str, VoiceModelType]] + key "rai_config": ForwardRef('RaiConfig', module='types') + key "store": bool + audio: VoiceAudioConfig + avatar: VoiceAvatarConfig + greeting: VoiceGreetingConfig + instructions: str + kind: Literal[voice] + model: str + model_type: Union[str, VoiceModelType] + output_modalities: list[Union[str, VoiceOutputModality]] + rai_config: RaiConfig + store: bool + structured_inputs: dict[str, StructuredInputDefinition] + tools: list[VoiceAgentTool] + + + class azure.ai.voiceagents.types.VoiceAgentEchoCancellation(TypedDict, total=False): + key "channels": int + key "reference_source": Union[str, VoiceAgentEchoCancellationReferenceSource] + key "type": Required[Literal["server_echo_cancellation"]] + channels: int + reference_source: Union[str, VoiceAgentEchoCancellationReferenceSource] + type: Literal[server_echo_cancellation] + + + class azure.ai.voiceagents.types.VoiceAgentEndOfUtteranceDetection(TypedDict, total=False): + key "model": Required[Union[str, VoiceAgentEndOfUtteranceModel]] + key "threshold": Optional[float] + key "threshold_level": Optional[Union[str, VoiceAgentEndOfUtteranceThresholdLevel]] + key "timeout": Optional[float] + key "timeout_ms": Optional[int] + model: Union[str, VoiceAgentEndOfUtteranceModel] + threshold: float + threshold_level: Union[str, VoiceAgentEndOfUtteranceThresholdLevel] + timeout: float + timeout_ms: int + + + class azure.ai.voiceagents.types.VoiceAgentEstimatedCost(TypedDict, total=False): + key "amount": Required[Optional[float]] + key "byom_model_amount": Optional[float] + key "byom_model_price_version": Optional[str] + key "currency": Literal["USD"] + key "input_cost": Optional[float] + key "output_cost": Optional[float] + key "price_version": Required[str] + key "status": Required[Union[str, VoiceAgentEstimatedCostStatus]] + key "voice_live_amount": Required[float] + amount: float + byom_model_amount: float + byom_model_price_version: str + currency: Literal[USD] + input_cost: float + output_cost: float + price_version: str + status: Union[str, VoiceAgentEstimatedCostStatus] + unpriced_components: list[str] + voice_live_amount: float + + + class azure.ai.voiceagents.types.VoiceAgentFileSearchCallItem(TypedDict, total=False): + key "id": Required[str] + key "queries": Optional[list[str]] + key "results": Optional[list[VoiceAgentFileSearchResult]] + key "status": Required[Union[str, VoiceAgentFileSearchCallStatus]] + key "type": Required[Literal["file_search_call"]] + id: str + queries: list[str] + results: list[VoiceAgentFileSearchResult] + status: Union[str, VoiceAgentFileSearchCallStatus] + type: Literal[file_search_call] + + + class azure.ai.voiceagents.types.VoiceAgentFileSearchResult(TypedDict, total=False): + key "attributes": Optional[dict[str, VoiceAgentFileSearchAttributeValue]] + key "file_id": Optional[str] + key "filename": Optional[str] + key "score": Optional[float] + key "text": Optional[str] + attributes: dict[str, VoiceAgentFileSearchAttributeValue] + file_id: str + filename: str + score: float + text: str + + + class azure.ai.voiceagents.types.VoiceAgentHandoffEdgeConfig(TypedDict, total=False): + key "cancel_on_interruption": bool + key "delay_ms": int + key "description": Required[str] + key "id": Required[str] + key "source": Required[str] + key "target": Required[str] + key "target_response": Union[str, VoiceAgentHandoffTargetResponse] + key "transfer_message": Optional[str] + cancel_on_interruption: bool + delay_ms: int + description: str + id: str + source: str + target: str + target_response: Union[str, VoiceAgentHandoffTargetResponse] + transfer_message: str + + + class azure.ai.voiceagents.types.VoiceAgentHandoffEdgeState(TypedDict, total=False): + key "cancel_on_interruption": bool + key "delay_ms": int + key "id": Required[str] + key "source": Required[str] + key "target": Required[str] + key "target_response": Union[str, VoiceAgentHandoffTargetResponse] + key "transfer_message": Optional[str] + cancel_on_interruption: bool + delay_ms: int + id: str + source: str + target: str + target_response: Union[str, VoiceAgentHandoffTargetResponse] + transfer_message: str + + + class azure.ai.voiceagents.types.VoiceAgentHandoffGraphConfig(TypedDict, total=False): + key "edges": Required[list[VoiceAgentHandoffEdgeConfig]] + key "max_attempts": Optional[int] + key "max_transfers": int + key "nodes": Required[list[VoiceAgentHandoffNodeConfig]] + edges: list[VoiceAgentHandoffEdgeConfig] + max_attempts: int + max_transfers: int + nodes: list[VoiceAgentHandoffNodeConfig] + + + class azure.ai.voiceagents.types.VoiceAgentHandoffNodeConfig(TypedDict, total=False): + key "config": Required[VoiceAgentHandoffNodeSessionConfig] + key "description": Required[str] + key "id": Required[str] + config: VoiceAgentHandoffNodeSessionConfig + description: str + id: str + + + class azure.ai.voiceagents.types.VoiceAgentHandoffNodeSessionConfig(TypedDict, total=False): + key "instructions": Optional[str] + key "interim_response": Optional[VoiceAgentInterimResponse] + key "max_response_output_tokens": Optional[VoiceAgentMaxOutputTokens] + key "model": Optional[str] + key "parallel_tool_calls": bool + key "reasoning_effort": Optional[Union[str, VoiceAgentHandoffReasoningEffort]] + key "temperature": Optional[float] + key "tool_choice": Optional[VoiceAgentToolChoice] + key "tools": Optional[list[VoiceAgentSessionTool]] + key "voice": Optional[VoiceAgentVoice] + key "voice_adaptation": Optional[VoiceAgentVoiceAdaptation] + instructions: str + interim_response: VoiceAgentInterimResponse + max_response_output_tokens: VoiceAgentMaxOutputTokens + model: str + parallel_tool_calls: bool + reasoning_effort: Union[str, VoiceAgentHandoffReasoningEffort] + temperature: float + tool_choice: VoiceAgentToolChoice + tools: list[VoiceAgentSessionTool] + voice: VoiceAgentVoice + voice_adaptation: VoiceAgentVoiceAdaptation + + + class azure.ai.voiceagents.types.VoiceAgentHandoffNodeState(TypedDict, total=False): + key "description": Required[str] + key "id": Required[str] + key "implicit": bool + description: str + id: str + implicit: bool + + + class azure.ai.voiceagents.types.VoiceAgentHandoffState(TypedDict, total=False): + key "active_node_id": Required[str] + key "attempt_count": Required[int] + key "available_edge_ids": Required[list[str]] + key "edges": Required[list[VoiceAgentHandoffEdgeState]] + key "node_generation": Required[int] + key "nodes": Required[list[VoiceAgentHandoffNodeState]] + key "pipeline_family": Required[Union[str, VoiceAgentPipelineFamily]] + key "transfer_count": Required[int] + key "transfer_tool": Required[Optional[RealtimeFunctionTool]] + active_node_id: str + attempt_count: int + available_edge_ids: list[str] + edges: list[VoiceAgentHandoffEdgeState] + node_generation: int + nodes: list[VoiceAgentHandoffNodeState] + pipeline_family: Union[str, VoiceAgentPipelineFamily] + transfer_count: int + transfer_tool: RealtimeFunctionTool + + + class azure.ai.voiceagents.types.VoiceAgentLlmInterimResponseConfig(TypedDict, total=False): + key "instructions": str + key "latency_threshold_ms": int + key "max_completion_tokens": int + key "model": str + key "type": Required[Literal["llm_interim_response"]] + instructions: str + latency_threshold_ms: int + max_completion_tokens: int + model: str + triggers: list[Union[str, VoiceAgentInterimResponseTrigger]] + type: Literal[llm_interim_response] + + + class azure.ai.voiceagents.types.VoiceAgentMcpAssignedManagedIdentity(TypedDict, total=False): + key "audience": Required[str] + key "client_id": str + key "type": Required[Literal["assigned_managed_identity"]] + audience: str + client_id: str + type: Literal[assigned_managed_identity] + + + class azure.ai.voiceagents.types.VoiceAgentMcpTool(TypedDict, total=False): + key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] + key "allowed_tools": Optional[Union[list[str], MCPToolFilter]] + key "defer_loading": bool + key "headers": Optional[dict[str, str]] + key "project_connection_id": str + key "require_approval": Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] + key "response_scheduling": Union[str, VoiceAgentMcpResponseScheduling] + key "server_description": str + key "server_label": Required[str] + key "server_url": str + key "type": Required[Literal[ToolType.MCP]] + allowed_callers: list[Union[str, CallableToolAllowedCaller]] + allowed_tools: Union[list[str], MCPToolFilter] + defer_loading: bool + headers: dict[str, str] + project_connection_id: str + require_approval: Union[MCPToolRequireApproval, Literal[always], Literal[never]] + response_scheduling: Union[str, VoiceAgentMcpResponseScheduling] + server_description: str + server_label: str + server_url: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolType.MCP] + + + class azure.ai.voiceagents.types.VoiceAgentRealtimeResponse(TypedDict, total=False): + key "conversation_id": Optional[str] + key "estimated_cost": ForwardRef('VoiceAgentEstimatedCost', module='types') + key "id": Required[str] + key "max_output_tokens": Optional[VoiceAgentMaxOutputTokens] + key "metadata": Optional[dict[str, str]] + key "modalities": Optional[list[Union[str, VoiceOutputModality]]] + key "object": Required[Literal["response"]] + key "output": Required[list[VoiceAgentResponseItem]] + key "output_audio_format": Optional[Union[str, VoiceAgentResponseAudioFormat]] + key "status": Required[Union[str, VoiceAgentResponseStatus]] + key "status_details": Required[Optional[RealtimeResponseStatusDetails]] + key "temperature": Optional[float] + key "usage": Required[Optional[RealtimeResponseUsage]] + key "voice": Optional[VoiceAgentVoice] + conversation_id: str + estimated_cost: VoiceAgentEstimatedCost + id: str + max_output_tokens: VoiceAgentMaxOutputTokens + metadata: dict[str, str] + modalities: list[Union[str, VoiceOutputModality]] + object: Literal[response] + output: list[VoiceAgentResponseItem] + output_audio_format: Union[str, VoiceAgentResponseAudioFormat] + status: Union[str, VoiceAgentResponseStatus] + status_details: RealtimeResponseStatusDetails + temperature: float + usage: RealtimeResponseUsage + voice: VoiceAgentVoice + + + class azure.ai.voiceagents.types.VoiceAgentResponseCreateAudio(TypedDict, total=False): + key "output": Optional[VoiceAgentSessionUpdateAudioOutput] + output: VoiceAgentSessionUpdateAudioOutput + + + class azure.ai.voiceagents.types.VoiceAgentResponseCreateParams(TypedDict, total=False): + key "audio": ForwardRef('VoiceAgentResponseCreateAudio', module='types') + key "conversation": Union[Literal["auto"], Literal["none"], str] + key "instructions": str + key "interim_response": Optional[VoiceAgentInterimResponse] + key "max_output_tokens": Union[int, Literal["inf"]] + key "metadata": Optional[Metadata] + key "parallel_tool_calls": bool + key "pre_generated_assistant_message": Optional[RealtimeConversationItemMessageAssistant] + key "reasoning": ForwardRef('RealtimeReasoning', module='types') + key "tool_choice": Union[str, ToolChoiceOptions, ToolChoiceFunction, ToolChoiceMCP] + audio: VoiceAgentResponseCreateAudio + conversation: Union[Literal[auto], Literal[none], str] + input: list[RealtimeConversationItem] + instructions: str + interim_response: VoiceAgentInterimResponse + max_output_tokens: Union[int, Literal[inf]] + metadata: Metadata + output_modalities: list[Union[str, VoiceOutputModality]] + parallel_tool_calls: bool + pre_generated_assistant_message: RealtimeConversationItemMessageAssistant + reasoning: RealtimeReasoning + tool_choice: Union[str, ToolChoiceOptions, ToolChoiceFunction, ToolChoiceMCP] + tools: list[Union[RealtimeFunctionTool, MCPTool]] + + + class azure.ai.voiceagents.types.VoiceAgentResponseEventAudioContentPart(TypedDict, total=False): + key "annotations": Any + key "audio": str + key "format": ForwardRef('VoiceAudioFormat', module='types') + key "transcript": Required[Optional[str]] + key "type": Required[Literal["audio"]] + annotations: Any + audio: str + format: VoiceAudioFormat + transcript: str + type: Literal[audio] + + + class azure.ai.voiceagents.types.VoiceAgentResponseEventTextContentPart(TypedDict, total=False): + key "text": Required[str] + key "type": Required[Literal["text"]] + text: str + type: Literal[text] + + + class azure.ai.voiceagents.types.VoiceAgentSemanticVadTurnDetection(TypedDict, total=False): + key "auto_truncate": bool + key "create_response": bool + key "eagerness": Literal["low", "medium", "high", "auto"] + key "interrupt_response": bool + key "type": Required[Literal[VoiceTurnDetectionType.SEMANTIC_VAD]] + auto_truncate: bool + create_response: bool + eagerness: Literal[low, medium, high, auto] + interrupt_response: bool + type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventConversationCreated(TypedDict, total=False): + key "conversation_id": Required[str] + key "type": Required[Literal["created"]] + conversation_id: str + type: Literal[created] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventConversationItemAdded(TypedDict, total=False): + key "event_id": Required[str] + key "item": Required[VoiceAgentResponseItem] + key "previous_item_id": Optional[str] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED]] + event_id: str + item: VoiceAgentResponseItem + previous_item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventConversationItemCreated(TypedDict, total=False): + key "event_id": Required[str] + key "item": Required[VoiceAgentResponseItem] + key "previous_item_id": Optional[str] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED]] + event_id: str + item: VoiceAgentResponseItem + previous_item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventConversationItemDeleted(TypedDict, total=False): + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED]] + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventConversationItemDone(TypedDict, total=False): + key "event_id": Required[str] + key "item": Required[VoiceAgentResponseItem] + key "previous_item_id": Optional[str] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE]] + event_id: str + item: VoiceAgentResponseItem + previous_item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted(TypedDict, total=False): + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "logprobs": Optional[list[LogProbProperties]] + key "phrases": Optional[list[VoiceAgentTranscriptionPhrase]] + key "transcript": Required[str] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED]] + key "usage": Required[Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration]] + content_index: int + event_id: str + item_id: str + logprobs: list[LogProbProperties] + phrases: list[VoiceAgentTranscriptionPhrase] + transcript: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED] + usage: Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta(TypedDict, total=False): + key "content_index": int + key "delta": str + key "event_id": Required[str] + key "item_id": Required[str] + key "logprobs": Optional[list[LogProbProperties]] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA]] + content_index: int + delta: str + event_id: str + item_id: str + logprobs: list[LogProbProperties] + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed(TypedDict, total=False): + key "content_index": Required[int] + key "error": Required[RealtimeServerEventConversationItemInputAudioTranscriptionFailedError] + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED]] + content_index: int + error: RealtimeServerEventConversationItemInputAudioTranscriptionFailedError + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment(TypedDict, total=False): + key "content_index": Required[int] + key "end": Required[float] + key "event_id": Required[str] + key "id": Required[str] + key "item_id": Required[str] + key "speaker": Required[str] + key "start": Required[float] + key "text": Required[str] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT]] + content_index: int + end: float + event_id: str + id: str + item_id: str + speaker: str + start: float + text: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventConversationItemRetrieved(TypedDict, total=False): + key "event_id": Required[str] + key "item": Required[VoiceAgentResponseItem] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED]] + event_id: str + item: VoiceAgentResponseItem + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventConversationItemTruncated(TypedDict, total=False): + key "audio_end_ms": Required[int] + key "content_index": Required[int] + key "event_id": Required[str] + key "item": ForwardRef('RealtimeConversationItemMessageAssistant', module='types') + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED]] + audio_end_ms: int + content_index: int + event_id: str + item: RealtimeConversationItemMessageAssistant + item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventError(TypedDict, total=False): + key "error": Required[VoiceAgentServerEventErrorDetails] + key "event_id": Required[str] + key "type": Required[Literal["error"]] + error: VoiceAgentServerEventErrorDetails + event_id: str + type: Literal[error] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventErrorDetails(TypedDict, total=False): + key "code": Optional[str] + key "event_id": Optional[str] + key "message": Required[str] + key "param": Optional[str] + key "tool_label": str + key "tool_type": str + key "type": Required[str] + code: str + event_id: str + message: str + param: str + tool_label: str + tool_type: str + type: str + + + class azure.ai.voiceagents.types.VoiceAgentServerEventFileSearchCallCompleted(TypedDict, total=False): + key "event_id": str + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": str + key "sequence_number": Required[int] + key "type": Required[Literal["completed"]] + event_id: str + item_id: str + output_index: int + response_id: str + sequence_number: int + type: Literal[completed] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventFileSearchCallInProgress(TypedDict, total=False): + key "event_id": str + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": str + key "sequence_number": Required[int] + key "type": Required[Literal["in_progress"]] + event_id: str + item_id: str + output_index: int + response_id: str + sequence_number: int + type: Literal[in_progress] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventFileSearchCallSearching(TypedDict, total=False): + key "event_id": str + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": str + key "sequence_number": Required[int] + key "type": Required[Literal["searching"]] + event_id: str + item_id: str + output_index: int + response_id: str + sequence_number: int + type: Literal[searching] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventInputAudioBufferCleared(TypedDict, total=False): + key "event_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED]] + event_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventInputAudioBufferCommitted(TypedDict, total=False): + key "event_id": Required[str] + key "item_id": Required[str] + key "previous_item_id": Optional[str] + key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED]] + event_id: str + item_id: str + previous_item_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventInputAudioBufferSpeechStarted(TypedDict, total=False): + key "audio_start_ms": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED]] + audio_start_ms: int + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventInputAudioBufferSpeechStopped(TypedDict, total=False): + key "audio_end_ms": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED]] + audio_end_ms: int + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventInputAudioBufferTimeoutTriggered(TypedDict, total=False): + key "audio_end_ms": Required[int] + key "audio_start_ms": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED]] + audio_end_ms: int + audio_start_ms: int + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventMcpListToolsCompleted(TypedDict, total=False): + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED]] + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventMcpListToolsFailed(TypedDict, total=False): + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED]] + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventMcpListToolsInProgress(TypedDict, total=False): + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS]] + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventOutputAudioBufferCleared(TypedDict, total=False): + key "event_id": Required[str] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED]] + event_id: str + response_id: str + type: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventRateLimitsUpdated(TypedDict, total=False): + key "event_id": Required[str] + key "rate_limits": Required[list[RealtimeServerEventRateLimitsUpdatedRateLimits]] + key "type": Required[Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED]] + event_id: str + rate_limits: list[RealtimeServerEventRateLimitsUpdatedRateLimits] + type: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventResponseAnimationBlendshapesDelta(TypedDict, total=False): + key "content_index": Required[int] + key "event_id": Required[str] + key "frame_index": Required[int] + key "frames": Required[Union[list[list[float]], str]] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal["delta"]] + content_index: int + event_id: str + frame_index: int + frames: Union[list[list[float]], str] + item_id: str + output_index: int + response_id: str + type: Literal[delta] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventResponseAnimationBlendshapesDone(TypedDict, total=False): + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal["done"]] + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[done] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventResponseAnimationVisemeDelta(TypedDict, total=False): + key "audio_offset_ms": Required[int] + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal["delta"]] + key "viseme_id": Required[int] + audio_offset_ms: int + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[delta] + viseme_id: int + + + class azure.ai.voiceagents.types.VoiceAgentServerEventResponseAnimationVisemeDone(TypedDict, total=False): + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal["done"]] + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[done] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventResponseAudioDelta(TypedDict, total=False): + key "content_index": Required[int] + key "delta": Required[str] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA]] + content_index: int + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventResponseAudioDone(TypedDict, total=False): + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE]] + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventResponseAudioTimestampDelta(TypedDict, total=False): + key "audio_duration_ms": Required[int] + key "audio_offset_ms": Required[int] + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "text": Required[str] + key "timestamp_type": Required[Literal["word"]] + key "type": Required[Literal["delta"]] + audio_duration_ms: int + audio_offset_ms: int + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + text: str + timestamp_type: Literal[word] + type: Literal[delta] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventResponseAudioTimestampDone(TypedDict, total=False): + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal["done"]] + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[done] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventResponseAudioTranscriptDelta(TypedDict, total=False): + key "content_index": Required[int] + key "delta": Required[str] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA]] + content_index: int + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventResponseAudioTranscriptDone(TypedDict, total=False): + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "transcript": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE]] + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + transcript: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventResponseContentPartDone(TypedDict, total=False): + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "part": Required[VoiceAgentResponseEventContentPart] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE]] + content_index: int + event_id: str + item_id: str + output_index: int + part: VoiceAgentResponseEventContentPart + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventResponseCreated(TypedDict, total=False): + key "event_id": Required[str] + key "response": Required[VoiceAgentRealtimeResponse] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CREATED]] + event_id: str + response: VoiceAgentRealtimeResponse + type: Literal[RealtimeServerEventType.RESPONSE_CREATED] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventResponseDone(TypedDict, total=False): + key "event_id": Required[str] + key "response": Required[VoiceAgentRealtimeResponse] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_DONE]] + event_id: str + response: VoiceAgentRealtimeResponse + type: Literal[RealtimeServerEventType.RESPONSE_DONE] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventResponseFunctionCallArgumentsDelta(TypedDict, total=False): + key "call_id": Required[str] + key "delta": Required[str] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA]] + call_id: str + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventResponseFunctionCallArgumentsDone(TypedDict, total=False): + key "arguments": Required[str] + key "call_id": Required[str] + key "event_id": Required[str] + key "item_id": Required[str] + key "name": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE]] + arguments: str + call_id: str + event_id: str + item_id: str + name: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventResponseMcpCallArgumentsDelta(TypedDict, total=False): + key "delta": Required[str] + key "event_id": Required[str] + key "item_id": Required[str] + key "obfuscation": Optional[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA]] + delta: str + event_id: str + item_id: str + obfuscation: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventResponseMcpCallArgumentsDone(TypedDict, total=False): + key "arguments": Required[str] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE]] + arguments: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventResponseMcpCallCompleted(TypedDict, total=False): + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED]] + event_id: str + item_id: str + output_index: int + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventResponseMcpCallFailed(TypedDict, total=False): + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED]] + event_id: str + item_id: str + output_index: int + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventResponseMcpCallInProgress(TypedDict, total=False): + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS]] + event_id: str + item_id: str + output_index: int + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventResponseOutputItemAdded(TypedDict, total=False): + key "event_id": Required[str] + key "item": Required[VoiceAgentResponseItem] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED]] + event_id: str + item: VoiceAgentResponseItem + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventResponseOutputItemDone(TypedDict, total=False): + key "event_id": Required[str] + key "item": Required[VoiceAgentResponseItem] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE]] + event_id: str + item: VoiceAgentResponseItem + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventResponseTextDelta(TypedDict, total=False): + key "content_index": Required[int] + key "delta": Required[str] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA]] + content_index: int + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventResponseTextDone(TypedDict, total=False): + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "text": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE]] + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + text: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventResponseVideoDelta(TypedDict, total=False): + key "codec": Required[str] + key "delta": Required[str] + key "event_id": Required[str] + key "output_index": Required[int] + key "type": Required[Literal["delta"]] + codec: str + delta: str + event_id: str + output_index: int + type: Literal[delta] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventSessionAvatarConnecting(TypedDict, total=False): + key "event_id": Required[str] + key "server_sdp": Required[str] + key "type": Required[Literal["connecting"]] + event_id: str + server_sdp: str + type: Literal[connecting] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventSessionAvatarSwitchToIdle(TypedDict, total=False): + key "event_id": Required[str] + key "turn_id": str + key "type": Required[Literal["switch_to_idle"]] + event_id: str + turn_id: str + type: Literal[switch_to_idle] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventSessionAvatarSwitchToSpeaking(TypedDict, total=False): + key "event_id": Required[str] + key "turn_id": str + key "type": Required[Literal["switch_to_speaking"]] + event_id: str + turn_id: str + type: Literal[switch_to_speaking] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventSessionCreated(TypedDict, total=False): + key "event_id": Required[str] + key "session": Required[VoiceAgentSessionResponseConfig] + key "type": Required[Literal[RealtimeServerEventType.SESSION_CREATED]] + event_id: str + session: VoiceAgentSessionResponseConfig + type: Literal[RealtimeServerEventType.SESSION_CREATED] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventSessionHandoffAborted(TypedDict, total=False): + key "edge_id": Required[str] + key "error": ForwardRef('VoiceAgentServerEventErrorDetails', module='types') + key "event_id": Required[str] + key "from_model": Required[str] + key "from_node_id": Required[str] + key "handoff_id": Required[str] + key "node_generation": Required[int] + key "reason": Required[Union[str, VoiceAgentHandoffAbortReason]] + key "to_model": Required[str] + key "to_node_id": Required[str] + key "tool_call_id": Required[str] + key "type": Required[Literal["aborted"]] + edge_id: str + error: VoiceAgentServerEventErrorDetails + event_id: str + from_model: str + from_node_id: str + handoff_id: str + node_generation: int + reason: Union[str, VoiceAgentHandoffAbortReason] + to_model: str + to_node_id: str + tool_call_id: str + type: Literal[aborted] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventSessionHandoffCompleted(TypedDict, total=False): + key "duration_ms": Required[int] + key "edge_id": Required[str] + key "event_id": Required[str] + key "from_model": Required[str] + key "from_node_id": Required[str] + key "handoff_id": Required[str] + key "node_generation": Required[int] + key "prepare_duration_ms": Required[int] + key "to_model": Required[str] + key "to_node_id": Required[str] + key "tool_call_id": Required[str] + key "type": Required[Literal["completed"]] + duration_ms: int + edge_id: str + event_id: str + from_model: str + from_node_id: str + handoff_id: str + node_generation: int + prepare_duration_ms: int + to_model: str + to_node_id: str + tool_call_id: str + type: Literal[completed] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventSessionHandoffStarted(TypedDict, total=False): + key "edge_id": Required[str] + key "event_id": Required[str] + key "from_model": Required[str] + key "from_node_id": Required[str] + key "handoff_id": Required[str] + key "node_generation": Required[int] + key "to_model": Required[str] + key "to_node_id": Required[str] + key "tool_call_id": Required[str] + key "type": Required[Literal["started"]] + edge_id: str + event_id: str + from_model: str + from_node_id: str + handoff_id: str + node_generation: int + to_model: str + to_node_id: str + tool_call_id: str + type: Literal[started] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventSessionUpdated(TypedDict, total=False): + key "event_id": Required[str] + key "session": Required[VoiceAgentSessionResponseConfig] + key "type": Required[Literal[RealtimeServerEventType.SESSION_UPDATED]] + event_id: str + session: VoiceAgentSessionResponseConfig + type: Literal[RealtimeServerEventType.SESSION_UPDATED] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventWarning(TypedDict, total=False): + key "event_id": Required[str] + key "type": Required[Literal["warning"]] + key "warning": Required[VoiceAgentServerEventWarningDetails] + event_id: str + type: Literal[warning] + warning: VoiceAgentServerEventWarningDetails + + + class azure.ai.voiceagents.types.VoiceAgentServerEventWarningDetails(TypedDict, total=False): + key "code": str + key "message": Required[str] + key "param": str + code: str + message: str + param: str + + + class azure.ai.voiceagents.types.VoiceAgentServerEventWebSearchCallCompleted(TypedDict, total=False): + key "event_id": str + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": str + key "sequence_number": Required[int] + key "type": Required[Literal["completed"]] + event_id: str + item_id: str + output_index: int + response_id: str + sequence_number: int + type: Literal[completed] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventWebSearchCallInProgress(TypedDict, total=False): + key "event_id": str + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": str + key "sequence_number": Required[int] + key "type": Required[Literal["in_progress"]] + event_id: str + item_id: str + output_index: int + response_id: str + sequence_number: int + type: Literal[in_progress] + + + class azure.ai.voiceagents.types.VoiceAgentServerEventWebSearchCallSearching(TypedDict, total=False): + key "event_id": str + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": str + key "sequence_number": Required[int] + key "type": Required[Literal["searching"]] + event_id: str + item_id: str + output_index: int + response_id: str + sequence_number: int + type: Literal[searching] + + + class azure.ai.voiceagents.types.VoiceAgentServerVadTurnDetection(TypedDict, total=False): + key "auto_truncate": bool + key "create_response": bool + key "end_of_utterance_detection": Optional[VoiceAgentEndOfUtteranceDetection] + key "idle_timeout_ms": Optional[int] + key "interrupt_response": bool + key "prefix_padding_ms": Optional[int] + key "silence_duration_ms": Optional[int] + key "speech_duration_ms": Optional[int] + key "threshold": Optional[float] + key "type": Required[Literal[VoiceTurnDetectionType.SERVER_VAD]] + auto_truncate: bool + create_response: bool + end_of_utterance_detection: VoiceAgentEndOfUtteranceDetection + idle_timeout_ms: int + interrupt_response: bool + prefix_padding_ms: int + silence_duration_ms: int + speech_duration_ms: int + threshold: float + type: Literal[VoiceTurnDetectionType.SERVER_VAD] + + + class azure.ai.voiceagents.types.VoiceAgentSessionAvatarConfig(TypedDict, total=False): + key "character": Required[str] + key "customized": bool + key "ice_servers": Optional[list[VoiceAgentAvatarIceServer]] + key "model": Optional[str] + key "output_audit_audio": bool + key "output_protocol": Union[str, VoiceAgentAvatarOutputProtocol] + key "scene": Optional[VoiceAgentAvatarScene] + key "style": Optional[str] + key "type": Union[str, VoiceAgentAvatarType] + key "video": Optional[VoiceAgentAvatarVideoParams] + character: str + customized: bool + ice_servers: list[VoiceAgentAvatarIceServer] + model: str + output_audit_audio: bool + output_protocol: Union[str, VoiceAgentAvatarOutputProtocol] + scene: VoiceAgentAvatarScene + style: str + type: Union[str, VoiceAgentAvatarType] + video: VoiceAgentAvatarVideoParams + + + class azure.ai.voiceagents.types.VoiceAgentSessionMcpTool(TypedDict, total=False): + key "authorization": Optional[Union[str, VoiceAgentMcpAssignedManagedIdentity]] + key "require_approval": ForwardRef('VoiceAgentMcpApprovalPolicy', module='types') + key "response_scheduling": Union[str, VoiceAgentMcpResponseScheduling] + key "server_label": Required[str] + key "server_url": Required[str] + key "type": Required[Literal["mcp"]] + allowed_tools: list[str] + authorization: Union[str, VoiceAgentMcpAssignedManagedIdentity] + headers: dict[str, str] + require_approval: VoiceAgentMcpApprovalPolicy + response_scheduling: Union[str, VoiceAgentMcpResponseScheduling] + server_label: str + server_url: str + type: Literal[mcp] + + + class azure.ai.voiceagents.types.VoiceAgentSessionResponseAudio(TypedDict, total=False): + key "input": Optional[VoiceAgentSessionResponseAudioInput] + key "output": Optional[VoiceAgentSessionResponseAudioOutput] + input: VoiceAgentSessionResponseAudioInput + output: VoiceAgentSessionResponseAudioOutput + + + class azure.ai.voiceagents.types.VoiceAgentSessionResponseAudioInput(TypedDict, total=False): + key "echo_cancellation": Optional[VoiceAgentEchoCancellation] + key "format": Optional[VoiceAudioFormat] + key "noise_reduction": Optional[VoiceNoiseReduction] + key "transcription": Optional[VoiceInputTranscription] + key "turn_detection": Optional[VoiceAgentTurnDetection] + echo_cancellation: VoiceAgentEchoCancellation + format: VoiceAudioFormat + noise_reduction: VoiceNoiseReduction + transcription: VoiceInputTranscription + turn_detection: VoiceAgentTurnDetection + + + class azure.ai.voiceagents.types.VoiceAgentSessionResponseAudioOutput(TypedDict, total=False): + key "format": ForwardRef('VoiceAudioFormat', module='types') + key "speed": Optional[float] + key "voice": ForwardRef('VoiceAgentVoice', module='types') + format: VoiceAudioFormat + output_audio_timestamp_types: list[Union[str, VoiceAudioTimestampType]] + speed: float + voice: VoiceAgentVoice + + + class azure.ai.voiceagents.types.VoiceAgentSessionResponseConfig(TypedDict, total=False): + key "animation": Optional[VoiceAgentAnimationConfig] + key "audio": Optional[VoiceAgentSessionResponseAudio] + key "avatar": Optional[VoiceAgentSessionAvatarConfig] + key "expires_at": Optional[int] + key "greeting": Optional[VoiceGreetingConfig] + key "handoff": Optional[VoiceAgentHandoffState] + key "id": Required[str] + key "idle_timeout": Optional[int] + key "instructions": Optional[str] + key "interim_response": Optional[VoiceAgentInterimResponse] + key "max_output_tokens": Optional[VoiceAgentMaxOutputTokens] + key "model": Required[str] + key "object": Required[Literal["session"]] + key "output_modalities": Required[list[Union[str, VoiceOutputModality]]] + key "parallel_tool_calls": bool + key "reasoning": Optional[RealtimeReasoning] + key "response_delimiter": str + key "temperature": Optional[float] + key "tool_choice": Optional[VoiceAgentToolChoice] + key "tools": Optional[list[VoiceAgentSessionTool]] + key "type": Required[Literal["realtime"]] + key "voice_adaptation": Optional[VoiceAgentVoiceAdaptation] + animation: VoiceAgentAnimationConfig + audio: VoiceAgentSessionResponseAudio + avatar: VoiceAgentSessionAvatarConfig + expires_at: int + greeting: VoiceGreetingConfig + handoff: VoiceAgentHandoffState + id: str + idle_timeout: int + instructions: str + interim_response: VoiceAgentInterimResponse + max_output_tokens: VoiceAgentMaxOutputTokens + model: str + object: Literal[session] + output_modalities: list[Union[str, VoiceOutputModality]] + parallel_tool_calls: bool + reasoning: RealtimeReasoning + response_delimiter: str + temperature: float + tool_choice: VoiceAgentToolChoice + tools: list[VoiceAgentSessionTool] + type: Literal[realtime] + voice_adaptation: VoiceAgentVoiceAdaptation + + + class azure.ai.voiceagents.types.VoiceAgentSessionUpdateAudio(TypedDict, total=False): + key "input": Optional[VoiceAgentSessionUpdateAudioInput] + key "output": Optional[VoiceAgentSessionUpdateAudioOutput] + input: VoiceAgentSessionUpdateAudioInput + output: VoiceAgentSessionUpdateAudioOutput + + + class azure.ai.voiceagents.types.VoiceAgentSessionUpdateAudioInput(TypedDict, total=False): + key "echo_cancellation": Optional[VoiceAgentEchoCancellation] + key "format": Optional[VoiceAudioFormat] + key "noise_reduction": Optional[VoiceNoiseReduction] + key "transcription": Optional[VoiceInputTranscription] + key "turn_detection": Optional[VoiceAgentTurnDetection] + echo_cancellation: VoiceAgentEchoCancellation + format: VoiceAudioFormat + noise_reduction: VoiceNoiseReduction + transcription: VoiceInputTranscription + turn_detection: VoiceAgentTurnDetection + + + class azure.ai.voiceagents.types.VoiceAgentSessionUpdateAudioOutput(TypedDict, total=False): + key "format": ForwardRef('VoiceAudioFormat', module='types') + key "speed": Optional[float] + key "voice": ForwardRef('VoiceAgentVoice', module='types') + format: VoiceAudioFormat + output_audio_timestamp_types: list[Union[str, VoiceAudioTimestampType]] + speed: float + voice: VoiceAgentVoice + + + class azure.ai.voiceagents.types.VoiceAgentSessionUpdateConfig(TypedDict, total=False): + key "animation": Optional[VoiceAgentAnimationConfig] + key "audio": Optional[VoiceAgentSessionUpdateAudio] + key "avatar": Optional[VoiceAgentSessionAvatarConfig] + key "greeting": Optional[VoiceGreetingConfig] + key "handoff": Optional[VoiceAgentHandoffGraphConfig] + key "include": Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] + key "instructions": Optional[str] + key "interim_response": Optional[VoiceAgentInterimResponse] + key "max_output_tokens": Optional[VoiceAgentMaxOutputTokens] + key "metadata": Optional[dict[str, str]] + key "output_modalities": Optional[list[Union[str, VoiceOutputModality]]] + key "parallel_tool_calls": bool + key "reasoning": Optional[RealtimeReasoning] + key "response_delimiter": str + key "temperature": Optional[float] + key "tool_choice": Optional[VoiceAgentToolChoice] + key "tools": Optional[list[VoiceAgentSessionTool]] + key "type": Required[Literal["realtime"]] + key "voice_adaptation": Optional[VoiceAgentVoiceAdaptation] + animation: VoiceAgentAnimationConfig + audio: VoiceAgentSessionUpdateAudio + avatar: VoiceAgentSessionAvatarConfig + greeting: VoiceGreetingConfig + handoff: VoiceAgentHandoffGraphConfig + include: list[Union[str, VoiceAgentSessionIncludeOption]] + instructions: str + interim_response: VoiceAgentInterimResponse + max_output_tokens: VoiceAgentMaxOutputTokens + metadata: dict[str, str] + output_modalities: list[Union[str, VoiceOutputModality]] + parallel_tool_calls: bool + reasoning: RealtimeReasoning + response_delimiter: str + temperature: float + tool_choice: VoiceAgentToolChoice + tools: list[VoiceAgentSessionTool] + type: Literal[realtime] + voice_adaptation: VoiceAgentVoiceAdaptation + + + class azure.ai.voiceagents.types.VoiceAgentStaticInterimResponseConfig(TypedDict, total=False): + key "latency_threshold_ms": int + key "type": Required[Literal["static_interim_response"]] + latency_threshold_ms: int + texts: list[str] + triggers: list[Union[str, VoiceAgentInterimResponseTrigger]] + type: Literal[static_interim_response] + + + class azure.ai.voiceagents.types.VoiceAgentTranscriptionPhrase(TypedDict, total=False): + key "confidence": Optional[float] + key "duration_milliseconds": Required[int] + key "locale": Optional[str] + key "offset_milliseconds": Required[int] + key "text": Required[str] + key "words": Optional[list[VoiceAgentTranscriptionWord]] + confidence: float + duration_milliseconds: int + locale: str + offset_milliseconds: int + text: str + words: list[VoiceAgentTranscriptionWord] + + + class azure.ai.voiceagents.types.VoiceAgentTranscriptionWord(TypedDict, total=False): + key "duration_milliseconds": Required[int] + key "offset_milliseconds": Required[int] + key "text": Required[str] + duration_milliseconds: int + offset_milliseconds: int + text: str + + + class azure.ai.voiceagents.types.VoiceAgentVoiceAdaptation(TypedDict, total=False): + key "type": Required[Literal["auto"]] + type: Literal[auto] + + + class azure.ai.voiceagents.types.VoiceAgentWebSearchActionFind(TypedDict, total=False): + key "pattern": Required[str] + key "type": Required[Literal["find"]] + key "url": Required[str] + pattern: str + type: Literal[find] + url: str + + + class azure.ai.voiceagents.types.VoiceAgentWebSearchActionOpenPage(TypedDict, total=False): + key "type": Required[Literal["open_page"]] + key "url": Required[str] + type: Literal[open_page] + url: str + + + class azure.ai.voiceagents.types.VoiceAgentWebSearchActionSearch(TypedDict, total=False): + key "query": Required[Optional[str]] + key "sources": Optional[list[VoiceAgentWebSearchSource]] + key "type": Required[Literal["search"]] + query: str + sources: list[VoiceAgentWebSearchSource] + type: Literal[search] + + + class azure.ai.voiceagents.types.VoiceAgentWebSearchCallItem(TypedDict, total=False): + key "action": Optional[VoiceAgentWebSearchAction] + key "id": Required[str] + key "status": Required[Union[str, VoiceAgentWebSearchCallStatus]] + key "type": Required[Literal["web_search_call"]] + action: VoiceAgentWebSearchAction + id: str + status: Union[str, VoiceAgentWebSearchCallStatus] + type: Literal[web_search_call] + + + class azure.ai.voiceagents.types.VoiceAgentWebSearchSource(TypedDict, total=False): + key "type": Required[Literal["url"]] + key "url": Required[str] + type: Literal[url] + url: str + + + class azure.ai.voiceagents.types.VoiceAgentWorkflowActionItem(TypedDict, total=False): + key "action_id": Required[str] + key "id": Required[Optional[str]] + key "kind": Optional[str] + key "object": Literal["item"] + key "parent_action_id": Optional[str] + key "previous_action_id": Optional[str] + key "status": Required[str] + key "type": Required[Literal["workflow_action"]] + action_id: str + id: str + kind: str + object: Literal[item] + parent_action_id: str + previous_action_id: str + status: str + type: Literal[workflow_action] + + + class azure.ai.voiceagents.types.VoiceAssistantMessageItem(TypedDict, total=False): + key "content": Required[list[RealtimeConversationItemMessageAssistantContent]] + key "created_at": int + key "id": str + key "object": Literal["item"] + key "response_id": str + key "role": Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] + key "status": Literal["completed", "incomplete", "in_progress"] + key "type": Required[Literal[VoiceConversationItemType.MESSAGE]] + content: list[RealtimeConversationItemMessageAssistantContent] + created_at: int + id: str + object: Literal[item] + response_id: str + role: Literal[RealtimeConversationItemMessageType.ASSISTANT] + status: Literal[completed, incomplete, in_progress] + type: Literal[VoiceConversationItemType.MESSAGE] + + + class azure.ai.voiceagents.types.VoiceAudioConfig(TypedDict, total=False): + key "input": ForwardRef('VoiceAudioInputConfig', module='types') + key "output": ForwardRef('VoiceAudioOutputConfig', module='types') + input: VoiceAudioInputConfig + output: VoiceAudioOutputConfig + + + class azure.ai.voiceagents.types.VoiceAudioFormat(TypedDict, total=False): + key "rate": int + key "type": Required[Union[str, VoiceAudioFormatType]] + rate: int + type: Union[str, VoiceAudioFormatType] + + + class azure.ai.voiceagents.types.VoiceAudioInputConfig(TypedDict, total=False): + key "format": ForwardRef('VoiceAudioFormat', module='types') + key "noise_reduction": Optional[VoiceNoiseReduction] + key "transcription": Optional[VoiceInputTranscription] + key "turn_detection": Optional[VoiceTurnDetection] + format: VoiceAudioFormat + noise_reduction: VoiceNoiseReduction + transcription: VoiceInputTranscription + turn_detection: VoiceTurnDetection + + + class azure.ai.voiceagents.types.VoiceAudioOutputConfig(TypedDict, total=False): + key "format": ForwardRef('VoiceAudioFormat', module='types') + key "speed": float + key "voice": ForwardRef('VoiceAgentVoice', module='types') + format: VoiceAudioFormat + output_audio_timestamp_types: list[Union[str, VoiceAudioTimestampType]] + speed: float + voice: VoiceAgentVoice + + + class azure.ai.voiceagents.types.VoiceAvatarConfig(TypedDict, total=False): + key "character": Required[str] + key "customized": bool + key "output_protocol": Union[str, VoiceAvatarOutputProtocol] + key "style": str + key "type": Required[Union[str, VoiceAvatarType]] + character: str + customized: bool + output_protocol: Union[str, VoiceAvatarOutputProtocol] + style: str + type: Union[str, VoiceAvatarType] + + + class azure.ai.voiceagents.types.VoiceAzureSemanticDetection(TypedDict, total=False): + key "model": Required[Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1]] + key "threshold_level": Union[str, VoiceEndOfUtteranceThresholdLevel] + key "timeout_ms": int + model: Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1] + threshold_level: Union[str, VoiceEndOfUtteranceThresholdLevel] + timeout_ms: int + + + class azure.ai.voiceagents.types.VoiceAzureSemanticDetectionEn(TypedDict, total=False): + key "model": Required[Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1_EN]] + key "threshold_level": Union[str, VoiceEndOfUtteranceThresholdLevel] + key "timeout_ms": int + model: Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1_EN] + threshold_level: Union[str, VoiceEndOfUtteranceThresholdLevel] + timeout_ms: int + + + class azure.ai.voiceagents.types.VoiceAzureSemanticDetectionMultilingual(TypedDict, total=False): + key "model": Required[Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1_MULTILINGUAL]] + key "threshold_level": Union[str, VoiceEndOfUtteranceThresholdLevel] + key "timeout_ms": int + model: Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1_MULTILINGUAL] + threshold_level: Union[str, VoiceEndOfUtteranceThresholdLevel] + timeout_ms: int + + + class azure.ai.voiceagents.types.VoiceAzureSemanticVadEnTurnDetection(TypedDict, total=False): + key "auto_truncate": bool + key "create_response": bool + key "end_of_utterance_detection": ForwardRef('VoiceEndOfUtteranceDetection', module='types') + key "interrupt_response": bool + key "prefix_padding_ms": int + key "remove_filler_words": bool + key "silence_duration_ms": int + key "speech_duration_ms": int + key "threshold": float + key "type": Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN]] + auto_truncate: bool + create_response: bool + end_of_utterance_detection: VoiceEndOfUtteranceDetection + interrupt_response: bool + prefix_padding_ms: int + remove_filler_words: bool + silence_duration_ms: int + speech_duration_ms: int + threshold: float + type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN] + + + class azure.ai.voiceagents.types.VoiceAzureSemanticVadMultilingualTurnDetection(TypedDict, total=False): + key "auto_truncate": bool + key "create_response": bool + key "end_of_utterance_detection": ForwardRef('VoiceEndOfUtteranceDetection', module='types') + key "interrupt_response": bool + key "prefix_padding_ms": int + key "remove_filler_words": bool + key "silence_duration_ms": int + key "speech_duration_ms": int + key "threshold": float + key "type": Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL]] + auto_truncate: bool + create_response: bool + end_of_utterance_detection: VoiceEndOfUtteranceDetection + interrupt_response: bool + languages: list[str] + prefix_padding_ms: int + remove_filler_words: bool + silence_duration_ms: int + speech_duration_ms: int + threshold: float + type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] + + + class azure.ai.voiceagents.types.VoiceAzureSemanticVadTurnDetection(TypedDict, total=False): + key "auto_truncate": bool + key "create_response": bool + key "end_of_utterance_detection": ForwardRef('VoiceEndOfUtteranceDetection', module='types') + key "interrupt_response": bool + key "prefix_padding_ms": int + key "remove_filler_words": bool + key "silence_duration_ms": int + key "speech_duration_ms": int + key "threshold": float + key "type": Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD]] + auto_truncate: bool + create_response: bool + end_of_utterance_detection: VoiceEndOfUtteranceDetection + interrupt_response: bool + languages: list[str] + prefix_padding_ms: int + remove_filler_words: bool + silence_duration_ms: int + speech_duration_ms: int + threshold: float + type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD] + + + class azure.ai.voiceagents.types.VoiceConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FUNCTION_CALL = "function_call" + FUNCTION_CALL_OUTPUT = "function_call_output" + MCP_APPROVAL_REQUEST = "mcp_approval_request" + MCP_APPROVAL_RESPONSE = "mcp_approval_response" + MCP_CALL = "mcp_call" + MCP_LIST_TOOLS = "mcp_list_tools" + MESSAGE = "message" + + + class azure.ai.voiceagents.types.VoiceEndOfUtteranceDetectionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SEMANTIC_DETECTION_V1 = "semantic_detection_v1" + SEMANTIC_DETECTION_V1_EN = "semantic_detection_v1_en" + SEMANTIC_DETECTION_V1_MULTILINGUAL = "semantic_detection_v1_multilingual" + + + class azure.ai.voiceagents.types.VoiceFunctionCallItem(TypedDict, total=False): + key "arguments": Required[str] + key "call_id": str + key "created_at": int + key "id": str + key "name": Required[str] + key "object": Literal["item"] + key "response_id": str + key "status": Literal["completed", "incomplete", "in_progress"] + key "type": Required[Literal[VoiceConversationItemType.FUNCTION_CALL]] + arguments: str + call_id: str + created_at: int + id: str + name: str + object: Literal[item] + response_id: str + status: Literal[completed, incomplete, in_progress] + type: Literal[VoiceConversationItemType.FUNCTION_CALL] + + + class azure.ai.voiceagents.types.VoiceFunctionCallOutputItem(TypedDict, total=False): + key "call_id": Required[str] + key "created_at": int + key "id": str + key "name": str + key "object": Literal["item"] + key "output": Required[str] + key "response_id": str + key "status": Literal["completed", "incomplete", "in_progress"] + key "type": Required[Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT]] + call_id: str + created_at: int + id: str + name: str + object: Literal[item] + output: str + response_id: str + status: Literal[completed, incomplete, in_progress] + type: Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT] + + + class azure.ai.voiceagents.types.VoiceInputTranscription(TypedDict, total=False): + key "delay": Literal["minimal", "low", "medium", "high", "xhigh"] + key "language": str + key "model": Required[Union[str, VoiceInputTranscriptionModel]] + key "prompt": str + custom_speech: dict[str, str] + delay: Literal[minimal, low, medium, high, xhigh] + language: str + model: Union[str, VoiceInputTranscriptionModel] + phrase_list: list[str] + prompt: str + + + class azure.ai.voiceagents.types.VoiceMcpApprovalRequestItem(TypedDict, total=False): + key "arguments": Required[str] + key "created_at": int + key "id": Required[str] + key "name": Required[str] + key "response_id": str + key "server_label": Required[str] + key "type": Required[Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST]] + arguments: str + created_at: int + id: str + name: str + response_id: str + server_label: str + type: Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST] + + + class azure.ai.voiceagents.types.VoiceMcpApprovalResponseItem(TypedDict, total=False): + key "approval_request_id": Required[str] + key "approve": Required[bool] + key "created_at": int + key "id": Required[str] + key "reason": Optional[str] + key "response_id": str + key "type": Required[Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE]] + approval_request_id: str + approve: bool + created_at: int + id: str + reason: str + response_id: str + type: Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE] + + + class azure.ai.voiceagents.types.VoiceMcpCallItem(TypedDict, total=False): + key "approval_request_id": Optional[str] + key "arguments": Required[str] + key "created_at": int + key "error": ForwardRef('RealtimeMCPError', module='types') + key "id": Required[str] + key "name": Required[str] + key "output": Optional[str] + key "response_id": str + key "server_label": Required[str] + key "type": Required[Literal[VoiceConversationItemType.MCP_CALL]] + approval_request_id: str + arguments: str + created_at: int + error: RealtimeMCPError + id: str + name: str + output: str + response_id: str + server_label: str + type: Literal[VoiceConversationItemType.MCP_CALL] + + + class azure.ai.voiceagents.types.VoiceMcpListToolsItem(TypedDict, total=False): + key "created_at": int + key "id": str + key "response_id": str + key "server_label": Required[str] + key "tools": Required[list[MCPListToolsTool]] + key "type": Required[Literal[VoiceConversationItemType.MCP_LIST_TOOLS]] + created_at: int + id: str + response_id: str + server_label: str + tools: list[MCPListToolsTool] + type: Literal[VoiceConversationItemType.MCP_LIST_TOOLS] + + + class azure.ai.voiceagents.types.VoiceNoiseReduction(TypedDict, total=False): + key "type": Required[Union[str, VoiceNoiseReductionType]] + type: Union[str, VoiceNoiseReductionType] + + + class azure.ai.voiceagents.types.VoiceSemanticVadTurnDetection(TypedDict, total=False): + key "create_response": bool + key "eagerness": Literal["low", "medium", "high", "auto"] + key "interrupt_response": bool + key "type": Required[Literal[VoiceTurnDetectionType.SEMANTIC_VAD]] + create_response: bool + eagerness: Literal[low, medium, high, auto] + interrupt_response: bool + type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD] + + + class azure.ai.voiceagents.types.VoiceServerVadTurnDetection(TypedDict, total=False): + key "create_response": bool + key "idle_timeout_ms": Optional[int] + key "interrupt_response": bool + key "prefix_padding_ms": int + key "silence_duration_ms": int + key "threshold": float + key "type": Required[Literal[VoiceTurnDetectionType.SERVER_VAD]] + create_response: bool + idle_timeout_ms: int + interrupt_response: bool + prefix_padding_ms: int + silence_duration_ms: int + threshold: float + type: Literal[VoiceTurnDetectionType.SERVER_VAD] + + + class azure.ai.voiceagents.types.VoiceSystemMessageItem(TypedDict, total=False): + key "content": Required[list[RealtimeConversationItemMessageSystemContent]] + key "created_at": int + key "id": str + key "object": Literal["item"] + key "response_id": str + key "role": Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] + key "status": Literal["completed", "incomplete", "in_progress"] + key "type": Required[Literal[VoiceConversationItemType.MESSAGE]] + content: list[RealtimeConversationItemMessageSystemContent] + created_at: int + id: str + object: Literal[item] + response_id: str + role: Literal[RealtimeConversationItemMessageType.SYSTEM] + status: Literal[completed, incomplete, in_progress] + type: Literal[VoiceConversationItemType.MESSAGE] + + + class azure.ai.voiceagents.types.VoiceSystemTool(TypedDict, total=False): + key "description": str + key "name": Required[Union[str, VoiceSystemToolName]] + key "type": Required[Literal["system"]] + description: str + name: Union[str, VoiceSystemToolName] + type: Literal[system] + + + class azure.ai.voiceagents.types.VoiceToolboxTool(TypedDict, total=False): + key "toolbox_name": Required[str] + key "toolbox_version": Required[str] + key "type": Required[Literal["toolbox"]] + toolbox_name: str + toolbox_version: str + type: Literal[toolbox] + + + class azure.ai.voiceagents.types.VoiceTurnDetectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_SEMANTIC_VAD = "azure_semantic_vad" + AZURE_SEMANTIC_VAD_EN = "azure_semantic_vad_en" + AZURE_SEMANTIC_VAD_MULTILINGUAL = "azure_semantic_vad_multilingual" + SEMANTIC_VAD = "semantic_vad" + SERVER_VAD = "server_vad" + + + class azure.ai.voiceagents.types.VoiceUserMessageItem(TypedDict, total=False): + key "content": Required[list[RealtimeConversationItemMessageUserContent]] + key "created_at": int + key "id": str + key "object": Literal["item"] + key "response_id": str + key "role": Required[Literal[RealtimeConversationItemMessageType.USER]] + key "status": Literal["completed", "incomplete", "in_progress"] + key "type": Required[Literal[VoiceConversationItemType.MESSAGE]] + content: list[RealtimeConversationItemMessageUserContent] + created_at: int + id: str + object: Literal[item] + response_id: str + role: Literal[RealtimeConversationItemMessageType.USER] + status: Literal[completed, incomplete, in_progress] + type: Literal[VoiceConversationItemType.MESSAGE] + + +``` \ No newline at end of file diff --git a/sdk/voiceagents/azure-ai-voiceagents/api.metadata.yml b/sdk/voiceagents/azure-ai-voiceagents/api.metadata.yml new file mode 100644 index 000000000000..1fb84ce7173a --- /dev/null +++ b/sdk/voiceagents/azure-ai-voiceagents/api.metadata.yml @@ -0,0 +1,3 @@ +apiMdSha256: dba6cc3ecd938031666e2951002cb5104c30ede6059603c14e68544ed4625911 +parserVersion: 0.3.30 +pythonVersion: 3.13.2 diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_client.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_client.py index b378f1a3a9f9..a1672ba29f30 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_client.py +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_client.py @@ -16,7 +16,7 @@ from ._configuration import VoiceAgentsClientConfiguration from ._utils.serialization import Deserializer, Serializer -from .operations import AgentEndpointConversationsOperations, VoiceAgentWebSocketOperations, VoiceAgentsOperations +from .operations import AgentEndpointConversationsOperations, VoiceAgentsOperations if sys.version_info >= (3, 11): from typing import Self @@ -30,8 +30,6 @@ class VoiceAgentsClient: # pylint: disable=docstring-keyword-should-match-keyword-only """VoiceAgentsClient. - :ivar voice_agent_web_socket: VoiceAgentWebSocketOperations operations - :vartype voice_agent_web_socket: azure.ai.voiceagents.operations.VoiceAgentWebSocketOperations :ivar agent_endpoint_conversations: AgentEndpointConversationsOperations operations :vartype agent_endpoint_conversations: azure.ai.voiceagents.operations.AgentEndpointConversationsOperations @@ -77,9 +75,6 @@ def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) self._serialize = Serializer() self._deserialize = Deserializer() self._serialize.client_side_validation = False - self.voice_agent_web_socket = VoiceAgentWebSocketOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.agent_endpoint_conversations = AgentEndpointConversationsOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_client.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_client.py index 9af42224fc60..9020e5ea13b4 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_client.py +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_client.py @@ -16,7 +16,7 @@ from .._utils.serialization import Deserializer, Serializer from ._configuration import VoiceAgentsClientConfiguration -from .operations import AgentEndpointConversationsOperations, VoiceAgentWebSocketOperations, VoiceAgentsOperations +from .operations import AgentEndpointConversationsOperations, VoiceAgentsOperations if sys.version_info >= (3, 11): from typing import Self @@ -30,9 +30,6 @@ class VoiceAgentsClient: # pylint: disable=docstring-keyword-should-match-keyword-only """VoiceAgentsClient. - :ivar voice_agent_web_socket: VoiceAgentWebSocketOperations operations - :vartype voice_agent_web_socket: - azure.ai.voiceagents.aio.operations.VoiceAgentWebSocketOperations :ivar agent_endpoint_conversations: AgentEndpointConversationsOperations operations :vartype agent_endpoint_conversations: azure.ai.voiceagents.aio.operations.AgentEndpointConversationsOperations @@ -78,9 +75,6 @@ def __init__(self, endpoint: str, credential: "AsyncTokenCredential", **kwargs: self._serialize = Serializer() self._deserialize = Deserializer() self._serialize.client_side_validation = False - self.voice_agent_web_socket = VoiceAgentWebSocketOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.agent_endpoint_conversations = AgentEndpointConversationsOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_realtime.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_realtime.py index 291cdc3ffe5b..db5141cbf4ba 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_realtime.py +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_realtime.py @@ -283,7 +283,13 @@ async def avatar_connect(self, *, client_sdp: str, event_id: Optional[str] = Non :keyword event_id: An optional client-generated event identifier. :paramtype event_id: str or None """ - await self._send(_models.VoiceAgentClientEventSessionAvatarConnect(client_sdp=client_sdp, event_id=event_id)) + await self._send( + _models.VoiceAgentClientEventSessionAvatarConnect( + type=_models.RealtimeClientEventType.SESSION_AVATAR_CONNECT, + client_sdp=client_sdp, + event_id=event_id, + ) + ) class InputAudioBufferResource(_BaseResource): @@ -533,6 +539,8 @@ async def recv(self) -> ServerEvent: import aiohttp # pylint: disable=import-outside-toplevel msg = await self._connection.receive() + while msg.type in (aiohttp.WSMsgType.PING, aiohttp.WSMsgType.PONG): + msg = await self._connection.receive() if msg.type in (aiohttp.WSMsgType.CLOSE, aiohttp.WSMsgType.CLOSING, aiohttp.WSMsgType.CLOSED): raise ConnectionResetError("The realtime connection was closed.") if msg.type == aiohttp.WSMsgType.ERROR: @@ -628,6 +636,8 @@ async def enter(self) -> AsyncRealtimeConnection: # pylint: disable=too-many-lo # ``connection_url`` fully overrides the computed route (scheme/host/path). This is the # escape hatch used to reach a specific data-plane host/path directly. url = self._connection_url or _to_ws_url(self._endpoint, self._agent_name) + if not url.startswith("wss://"): + raise ValueError("The realtime WebSocket URL must use wss:// to protect credentials in transit.") params: Dict[str, str] = {"api-version": self._api_version} if self._agent_session_id is not None: diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/__init__.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/__init__.py index af8ff4734a8f..0840d3975c41 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/__init__.py +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/__init__.py @@ -12,7 +12,6 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._operations import VoiceAgentWebSocketOperations # type: ignore from ._operations import AgentEndpointConversationsOperations # type: ignore from ._operations import VoiceAgentsOperations # type: ignore @@ -21,7 +20,6 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "VoiceAgentWebSocketOperations", "AgentEndpointConversationsOperations", "VoiceAgentsOperations", ] diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/_operations.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/_operations.py index df409bd422bf..8cafdd52ba21 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/_operations.py +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/_operations.py @@ -70,116 +70,6 @@ _Unset: Any = object() -class VoiceAgentWebSocketOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.voiceagents.aio.VoiceAgentsClient`'s - :attr:`voice_agent_web_socket` 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: VoiceAgentsClientConfiguration = 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_async - async def connect_voice_agent( - self, - agent_name: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - agent_session_id: Optional[str] = None, - agent_version_override: Optional[str] = None, - websocket_subprotocol: Optional[Union[str, _models.VoiceAgentWebSocketSubprotocol]] = None, - structured_inputs: Optional[str] = None, - **kwargs: Any - ) -> None: - """Connect to a voice agent. - - Connects to a voice agent over WebSocket. The client must send an HTTP GET with ``Upgrade: - websocket`` headers. The optional ``realtime`` subprotocol is the only accepted subprotocol - value. - - :param agent_name: The name of the voice agent. Required. - :type agent_name: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword agent_session_id: An optional identifier used to correlate the voice session. Default - value is None. - :paramtype agent_session_id: str - :keyword agent_version_override: Selects a specific version of the voice agent for this - session. Default value is None. - :paramtype agent_version_override: str - :keyword websocket_subprotocol: The requested WebSocket subprotocol. Omit this header or - request exactly ``realtime``. "realtime" Default value is None. - :paramtype websocket_subprotocol: str or - ~azure.ai.voiceagents.models.VoiceAgentWebSocketSubprotocol - :keyword structured_inputs: A JSON object that maps structured-input names to their values for - this session. Default value is None. - :paramtype structured_inputs: 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_voice_agent_web_socket_connect_voice_agent_request( - agent_name=agent_name, - foundry_features=foundry_features, - agent_session_id=agent_session_id, - agent_version_override=agent_version_override, - websocket_subprotocol=websocket_subprotocol, - structured_inputs=structured_inputs, - 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 [101]: - 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["Sec-WebSocket-Protocol"] = self._deserialize( - "str", response.headers.get("Sec-WebSocket-Protocol") - ) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - - class AgentEndpointConversationsOperations: # pylint: disable=docstring-missing-param """ .. warning:: diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/__init__.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/__init__.py index af8ff4734a8f..0840d3975c41 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/__init__.py +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/__init__.py @@ -12,7 +12,6 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._operations import VoiceAgentWebSocketOperations # type: ignore from ._operations import AgentEndpointConversationsOperations # type: ignore from ._operations import VoiceAgentsOperations # type: ignore @@ -21,7 +20,6 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "VoiceAgentWebSocketOperations", "AgentEndpointConversationsOperations", "VoiceAgentsOperations", ] diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/_operations.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/_operations.py index 96fefa470126..8a8be4df84d7 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/_operations.py +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/_operations.py @@ -831,116 +831,6 @@ def build_voice_agents_delete_voice_agent_version_request( # pylint: disable=na return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -class VoiceAgentWebSocketOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.voiceagents.VoiceAgentsClient`'s - :attr:`voice_agent_web_socket` 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: VoiceAgentsClientConfiguration = 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 connect_voice_agent( # pylint: disable=inconsistent-return-statements - self, - agent_name: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - agent_session_id: Optional[str] = None, - agent_version_override: Optional[str] = None, - websocket_subprotocol: Optional[Union[str, _models.VoiceAgentWebSocketSubprotocol]] = None, - structured_inputs: Optional[str] = None, - **kwargs: Any - ) -> None: - """Connect to a voice agent. - - Connects to a voice agent over WebSocket. The client must send an HTTP GET with ``Upgrade: - websocket`` headers. The optional ``realtime`` subprotocol is the only accepted subprotocol - value. - - :param agent_name: The name of the voice agent. Required. - :type agent_name: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword agent_session_id: An optional identifier used to correlate the voice session. Default - value is None. - :paramtype agent_session_id: str - :keyword agent_version_override: Selects a specific version of the voice agent for this - session. Default value is None. - :paramtype agent_version_override: str - :keyword websocket_subprotocol: The requested WebSocket subprotocol. Omit this header or - request exactly ``realtime``. "realtime" Default value is None. - :paramtype websocket_subprotocol: str or - ~azure.ai.voiceagents.models.VoiceAgentWebSocketSubprotocol - :keyword structured_inputs: A JSON object that maps structured-input names to their values for - this session. Default value is None. - :paramtype structured_inputs: 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_voice_agent_web_socket_connect_voice_agent_request( - agent_name=agent_name, - foundry_features=foundry_features, - agent_session_id=agent_session_id, - agent_version_override=agent_version_override, - websocket_subprotocol=websocket_subprotocol, - structured_inputs=structured_inputs, - 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 [101]: - 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["Sec-WebSocket-Protocol"] = self._deserialize( - "str", response.headers.get("Sec-WebSocket-Protocol") - ) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - - class AgentEndpointConversationsOperations: # pylint: disable=docstring-missing-param """ .. warning:: diff --git a/sdk/voiceagents/azure-ai-voiceagents/samples/README.md b/sdk/voiceagents/azure-ai-voiceagents/samples/README.md index 7e65dc5fd1c2..22f40474bf93 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/samples/README.md +++ b/sdk/voiceagents/azure-ai-voiceagents/samples/README.md @@ -39,7 +39,7 @@ These code samples are organized **by scenario**: | File | Description | | ---- | ----------- | -| [quickstart/sample_quickstart_async.py](quickstart/sample_quickstart_async.py) | Generate a temporary voice agent, stream microphone audio to it, play the spoken response through your speakers, and delete the agent when the sample exits. Requires `pyaudio`. | +| [quickstart/sample_quickstart_async.py](https://github.com/Azure/azure-sdk-for-python/blob/xitzhang/voice-agent-pupr/sdk/voiceagents/azure-ai-voiceagents/samples/quickstart/sample_quickstart_async.py) | Generate a temporary voice agent, stream microphone audio to it, play the spoken response through your speakers, and delete the agent when the sample exits. Requires `pyaudio`. | ## `management/` -- manage agents and read conversations @@ -47,26 +47,26 @@ These code samples are organized **by scenario**: | File | Description | | ---- | ----------- | -| [management/sample_create_and_manage_voice_agent.py](management/sample_create_and_manage_voice_agent.py) | Create (with a voice/audio config and conversation storage enabled), get, list, update, disable/enable, and delete a voice agent. | -| [management/sample_create_and_manage_voice_agent_async.py](management/sample_create_and_manage_voice_agent_async.py) | Async version of the create/manage lifecycle. | -| [management/sample_create_voice_agent_with_tools.py](management/sample_create_voice_agent_with_tools.py) | Create an agent with tools (`function`, `system`, `mcp`, `toolbox`), input-audio config (turn detection + transcription), and bring-your-own-model (`self_deployed`). | -| [management/sample_generate_voice_agent.py](management/sample_generate_voice_agent.py) | Guided authoring: generate and create a voice agent from a persona, use case, and a natural-language goal. | -| [management/sample_manage_voice_agent_versions.py](management/sample_manage_voice_agent_versions.py) | Create and list immutable versions of a voice agent, including draft versions. | +| [management/sample_create_and_manage_voice_agent.py](https://github.com/Azure/azure-sdk-for-python/blob/xitzhang/voice-agent-pupr/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_create_and_manage_voice_agent.py) | Create (with a voice/audio config and conversation storage enabled), get, list, update, disable/enable, and delete a voice agent. | +| [management/sample_create_and_manage_voice_agent_async.py](https://github.com/Azure/azure-sdk-for-python/blob/xitzhang/voice-agent-pupr/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_create_and_manage_voice_agent_async.py) | Async version of the create/manage lifecycle. | +| [management/sample_create_voice_agent_with_tools.py](https://github.com/Azure/azure-sdk-for-python/blob/xitzhang/voice-agent-pupr/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_create_voice_agent_with_tools.py) | Create an agent with tools (`function`, `system`, `mcp`, `toolbox`), input-audio config (turn detection + transcription), and bring-your-own-model (`self_deployed`). | +| [management/sample_generate_voice_agent.py](https://github.com/Azure/azure-sdk-for-python/blob/xitzhang/voice-agent-pupr/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_generate_voice_agent.py) | Guided authoring: generate and create a voice agent from a persona, use case, and a natural-language goal. | +| [management/sample_manage_voice_agent_versions.py](https://github.com/Azure/azure-sdk-for-python/blob/xitzhang/voice-agent-pupr/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_manage_voice_agent_versions.py) | Create and list immutable versions of a voice agent, including draft versions. | **Read conversations** -- these need an existing agent and a conversation id from a completed live session (see [Getting a conversation id](#getting-a-conversation-id)). | File | Description | | ---- | ----------- | -| [management/sample_read_conversation.py](management/sample_read_conversation.py) | Read a persisted conversation, its responses (and per-response items), and its items (with single get by id). | -| [management/sample_read_conversation_audio.py](management/sample_read_conversation_audio.py) | Read the merged whole-call recording and a single turn's audio, streaming each to a WAV file. | +| [management/sample_read_conversation.py](https://github.com/Azure/azure-sdk-for-python/blob/xitzhang/voice-agent-pupr/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_read_conversation.py) | Read a persisted conversation, its responses (and per-response items), and its items (with single get by id). | +| [management/sample_read_conversation_audio.py](https://github.com/Azure/azure-sdk-for-python/blob/xitzhang/voice-agent-pupr/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_read_conversation_audio.py) | Read the merged whole-call recording and a single turn's audio, streaming each to a WAV file. | ## `live/` -- hold a live conversation | File | Description | | ---- | ----------- | -| [live/sample_live_text_conversation_async.py](live/sample_live_text_conversation_async.py) | Converse with an **existing** agent using **typed** turns: type prompts in a loop -- each is sent via `client.realtime.connect(...)` and the spoken reply is streamed back (optionally played through your speakers). Reads the persisted conversation back at the end. Runs headless -- no microphone needed. | -| [live/sample_live_audio_conversation_async.py](live/sample_live_audio_conversation_async.py) | Converse with an **existing** agent using your **microphone**: stream live audio to the agent, let server VAD detect your turns, and talk over the agent to **barge in** (cancel its in-flight reply). Requires `pyaudio`. Runs until you press Ctrl-C. | +| [live/sample_live_text_conversation_async.py](https://github.com/Azure/azure-sdk-for-python/blob/xitzhang/voice-agent-pupr/sdk/voiceagents/azure-ai-voiceagents/samples/live/sample_live_text_conversation_async.py) | Converse with an **existing** agent using **typed** turns: type prompts in a loop -- each is sent via `client.realtime.connect(...)` and the spoken reply is streamed back (optionally played through your speakers). Reads the persisted conversation back at the end. Runs headless -- no microphone needed. | +| [live/sample_live_audio_conversation_async.py](https://github.com/Azure/azure-sdk-for-python/blob/xitzhang/voice-agent-pupr/sdk/voiceagents/azure-ai-voiceagents/samples/live/sample_live_audio_conversation_async.py) | Converse with an **existing** agent using your **microphone**: stream live audio to the agent, let server VAD detect your turns, and talk over the agent to **barge in** (cancel its in-flight reply). Requires `pyaudio`. Runs until you press Ctrl-C. | ## Prerequisites diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/unit/test_client_construction.py b/sdk/voiceagents/azure-ai-voiceagents/tests/unit/test_client_construction.py index 5d8c7a0f1b44..1015732de3d8 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/tests/unit/test_client_construction.py +++ b/sdk/voiceagents/azure-ai-voiceagents/tests/unit/test_client_construction.py @@ -13,7 +13,6 @@ from azure.ai.voiceagents.operations import ( AgentEndpointConversationsOperations, VoiceAgentsOperations, - VoiceAgentWebSocketOperations, ) ENDPOINT = "https://example.services.ai.azure.com/api/projects/p" @@ -37,7 +36,6 @@ def test_sync_client_exposes_operation_groups(): try: assert isinstance(client.voice_agents, VoiceAgentsOperations) assert isinstance(client.agent_endpoint_conversations, AgentEndpointConversationsOperations) - assert isinstance(client.voice_agent_web_socket, VoiceAgentWebSocketOperations) finally: client.close() @@ -51,7 +49,6 @@ async def test_async_client_exposes_operation_groups(): async with AsyncVoiceAgentsClient(endpoint=ENDPOINT, credential=_FakeAsyncCredential()) as client: assert client.voice_agents is not None assert client.agent_endpoint_conversations is not None - assert client.voice_agent_web_socket is not None async def test_async_client_realtime_property_is_lazy_and_cached(): From 895d2478c5f2eb954d8b21d0483a26d392718b9e Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Fri, 7 Aug 2026 13:11:19 -0700 Subject: [PATCH 07/56] Fix voice agents pipeline validation --- .../azure-ai-voiceagents/README.md | 24 +++++++++++++++++++ .../azure-ai-voiceagents/api.metadata.yml | 2 +- .../azure/ai/voiceagents/_unions.py | 1 - .../azure/ai/voiceagents/aio/_patch.py | 12 ++++++---- .../azure/ai/voiceagents/aio/_realtime.py | 1 - .../voiceagents/aio/operations/_operations.py | 2 -- .../ai/voiceagents/operations/_operations.py | 1 - .../quickstart/sample_quickstart_async.py | 3 ++- .../test_voice_agents_client_async.py | 20 ++++++++++++---- 9 files changed, 50 insertions(+), 16 deletions(-) diff --git a/sdk/voiceagents/azure-ai-voiceagents/README.md b/sdk/voiceagents/azure-ai-voiceagents/README.md index da97e925810e..ec5ed98133ad 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/README.md +++ b/sdk/voiceagents/azure-ai-voiceagents/README.md @@ -68,6 +68,30 @@ for agent in client.voice_agents.list_voice_agents( See the [samples on GitHub](https://github.com/Azure/azure-sdk-for-python/tree/xitzhang/voice-agent-pupr/sdk/voiceagents/azure-ai-voiceagents/samples) for management, quickstart, and realtime conversation examples. +## Key concepts + +- **Voice agents** are managed in an Azure AI Foundry project through the + `VoiceAgentsClient`. +- **Realtime sessions** connect to an agent over an asynchronous WebSocket + connection and can stream audio input and output. +- **Persisted conversations** contain transcripts and audio when conversation + storage is enabled for the agent. + +## Troubleshooting + +- Verify that `AZURE_VOICE_AGENTS_ENDPOINT` points to the Foundry project + endpoint, not the account endpoint. +- Ensure the credential has permission to access the project and its voice + agents. +- For realtime audio samples, install `aiohttp` and `pyaudio`, and verify that + the operating system has an available microphone and speaker. + +## Next steps + +- Review the [sample collection](https://github.com/Azure/azure-sdk-for-python/tree/xitzhang/voice-agent-pupr/sdk/voiceagents/azure-ai-voiceagents/samples). +- Read the [Azure AI Foundry documentation](https://learn.microsoft.com/azure/ai-foundry/). +- See the [API reference](https://github.com/Azure/azure-sdk-for-python/blob/xitzhang/voice-agent-pupr/sdk/voiceagents/azure-ai-voiceagents/api.md). + ## Contributing This project welcomes contributions and suggestions. Most contributions require diff --git a/sdk/voiceagents/azure-ai-voiceagents/api.metadata.yml b/sdk/voiceagents/azure-ai-voiceagents/api.metadata.yml index 1fb84ce7173a..4ec5d3ff11a8 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/api.metadata.yml +++ b/sdk/voiceagents/azure-ai-voiceagents/api.metadata.yml @@ -1,3 +1,3 @@ apiMdSha256: dba6cc3ecd938031666e2951002cb5104c30ede6059603c14e68544ed4625911 -parserVersion: 0.3.30 +parserVersion: 0.3.31 pythonVersion: 3.13.2 diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_unions.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_unions.py index 62e6b75a05c2..84c462f4931b 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_unions.py +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_unions.py @@ -9,7 +9,6 @@ from typing import Literal, TYPE_CHECKING, Union if TYPE_CHECKING: - from . import _unions as _unions from . import models as _models VoiceResponseVoice = Union["_models.OpenAIVoice", "_models.AzureVoice", "_models.AzureRealtimeNativeVoice"] VoiceAgentVoice = Union["_models.OpenAIVoice", "_models.AzureVoice", "_models.AzureRealtimeNativeVoice"] diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_patch.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_patch.py index 9c8be6a1f5db..5f9e0532c06f 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_patch.py +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_patch.py @@ -16,7 +16,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class VoiceAgentsClient(_GeneratedVoiceAgentsClient): +class VoiceAgentsClient(_GeneratedVoiceAgentsClient): # pylint: disable=client-accepts-api-version-keyword """VoiceAgentsClient with a realtime streaming namespace. Adds the :attr:`realtime` namespace on top of the generated HTTP client, exposing @@ -25,7 +25,9 @@ class VoiceAgentsClient(_GeneratedVoiceAgentsClient): _realtime: Optional[AsyncRealtime] = None - def __init__(self, endpoint: str, credential: "AsyncTokenCredential", **kwargs: Any) -> None: + def __init__( + self, endpoint: str, credential: "AsyncTokenCredential", *, api_version: Optional[str] = None, **kwargs: Any + ) -> None: # Work around an azure-core/aiohttp limitation: azure-core's AioHttpTransport # disables aiohttp's native response decompression and only re-implements # gzip/deflate itself (no brotli support), while aiohttp advertises @@ -36,14 +38,14 @@ def __init__(self, endpoint: str, credential: "AsyncTokenCredential", **kwargs: if "transport" not in kwargs and "session" not in kwargs: try: import aiohttp - from azure.core.pipeline.transport import AioHttpTransport + import azure.core.pipeline.transport as transport_module - kwargs["transport"] = AioHttpTransport( + kwargs["transport"] = transport_module.AioHttpTransport( session=aiohttp.ClientSession(auto_decompress=False, headers={"Accept-Encoding": "gzip, deflate"}) ) except ImportError: pass - super().__init__(endpoint, credential, **kwargs) + super().__init__(endpoint, credential, api_version=api_version, **kwargs) @property def realtime(self) -> AsyncRealtime: diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_realtime.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_realtime.py index db5141cbf4ba..e7ac89f8ade8 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_realtime.py +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_realtime.py @@ -285,7 +285,6 @@ async def avatar_connect(self, *, client_sdp: str, event_id: Optional[str] = Non """ await self._send( _models.VoiceAgentClientEventSessionAvatarConnect( - type=_models.RealtimeClientEventType.SESSION_AVATAR_CONNECT, client_sdp=client_sdp, event_id=event_id, ) diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/_operations.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/_operations.py index 8cafdd52ba21..2dc75f842b7b 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/_operations.py +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/_operations.py @@ -10,7 +10,6 @@ from io import IOBase import json from typing import Any, AsyncIterator, Callable, IO, Literal, Optional, TYPE_CHECKING, TypeVar, Union, overload -import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -46,7 +45,6 @@ build_agent_endpoint_conversations_list_agent_conversation_items_request, build_agent_endpoint_conversations_list_agent_conversation_response_items_request, build_agent_endpoint_conversations_list_agent_conversation_responses_request, - build_voice_agent_web_socket_connect_voice_agent_request, build_voice_agents_create_voice_agent_request, build_voice_agents_create_voice_agent_version_request, build_voice_agents_delete_voice_agent_request, diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/_operations.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/_operations.py index 8a8be4df84d7..28621e78532d 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/_operations.py +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/_operations.py @@ -10,7 +10,6 @@ from io import IOBase import json from typing import Any, Callable, IO, Iterator, Literal, Optional, TYPE_CHECKING, TypeVar, Union, overload -import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( diff --git a/sdk/voiceagents/azure-ai-voiceagents/samples/quickstart/sample_quickstart_async.py b/sdk/voiceagents/azure-ai-voiceagents/samples/quickstart/sample_quickstart_async.py index dfa465d81ce8..f9d2e1a02968 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/samples/quickstart/sample_quickstart_async.py +++ b/sdk/voiceagents/azure-ai-voiceagents/samples/quickstart/sample_quickstart_async.py @@ -168,7 +168,8 @@ async def _delete_agent(client: VoiceAgentsClient, agent_name: str) -> None: try: await client.voice_agents.delete_voice_agent(agent_name, foundry_features=PREVIEW) except HttpResponseError as exc: - if exc.response is None or exc.response.status_code != 200: + # Service currently returns either 200 or 204 on successful delete. + if exc.response is None or exc.response.status_code not in (200, 204): raise print(f"Deleted temporary voice agent: {agent_name}") diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client_async.py b/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client_async.py index 3bf0db40b9c1..e122ab5752f0 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client_async.py +++ b/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client_async.py @@ -42,7 +42,10 @@ async def test_get_agent_conversation( ): async with self.create_client(azure_voice_agents_endpoint) as client: conversation = await client.agent_endpoint_conversations.get_agent_conversation( - azure_voice_agents_agent_name, azure_voice_agents_conversation_id, foundry_features=PREVIEW + azure_voice_agents_agent_name, + azure_voice_agents_conversation_id, + foundry_features=PREVIEW, + headers={"Accept-Encoding": "identity"}, ) # See the note in test_get_voice_agent about not asserting on "id"/"name". @@ -58,7 +61,10 @@ async def test_list_agent_conversation_items( items = [ item async for item in client.agent_endpoint_conversations.list_agent_conversation_items( - azure_voice_agents_agent_name, azure_voice_agents_conversation_id, foundry_features=PREVIEW + azure_voice_agents_agent_name, + azure_voice_agents_conversation_id, + foundry_features=PREVIEW, + headers={"Accept-Encoding": "identity"}, ) ] @@ -73,7 +79,10 @@ async def test_list_agent_conversation_responses( responses = [ response async for response in client.agent_endpoint_conversations.list_agent_conversation_responses( - azure_voice_agents_agent_name, azure_voice_agents_conversation_id, foundry_features=PREVIEW + azure_voice_agents_agent_name, + azure_voice_agents_conversation_id, + foundry_features=PREVIEW, + headers={"Accept-Encoding": "identity"}, ) ] @@ -87,7 +96,10 @@ async def test_get_agent_conversation_audio_metadata( ): async with self.create_client(azure_voice_agents_endpoint) as client: recording = await client.agent_endpoint_conversations.get_agent_conversation_audio( - azure_voice_agents_agent_name, azure_voice_agents_conversation_id, foundry_features=PREVIEW + azure_voice_agents_agent_name, + azure_voice_agents_conversation_id, + foundry_features=PREVIEW, + headers={"Accept-Encoding": "identity"}, ) assert recording["format"] is not None From cda18215ea79aaa0613069071ab2836d6a8bf477 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 7 Aug 2026 20:24:05 +0000 Subject: [PATCH 08/56] Update voice agents API surface metadata Co-authored-by: xitzhang <11403681+xitzhang@users.noreply.github.com> --- sdk/voiceagents/azure-ai-voiceagents/api.md | 2 ++ sdk/voiceagents/azure-ai-voiceagents/api.metadata.yml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sdk/voiceagents/azure-ai-voiceagents/api.md b/sdk/voiceagents/azure-ai-voiceagents/api.md index f37c1fbdf681..cdef329f00fe 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/api.md +++ b/sdk/voiceagents/azure-ai-voiceagents/api.md @@ -100,6 +100,8 @@ namespace azure.ai.voiceagents.aio self, endpoint: str, credential: AsyncTokenCredential, + *, + api_version: Optional[str] = ..., **kwargs: Any ) -> None: ... diff --git a/sdk/voiceagents/azure-ai-voiceagents/api.metadata.yml b/sdk/voiceagents/azure-ai-voiceagents/api.metadata.yml index 4ec5d3ff11a8..c38648a54a71 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/api.metadata.yml +++ b/sdk/voiceagents/azure-ai-voiceagents/api.metadata.yml @@ -1,3 +1,3 @@ -apiMdSha256: dba6cc3ecd938031666e2951002cb5104c30ede6059603c14e68544ed4625911 +apiMdSha256: 16ab5e41e31ae5d8fdbd7dbbf7d39740a9ffd3650a21e0731a622ea1282f79f6 parserVersion: 0.3.31 pythonVersion: 3.13.2 From 728f7f59dc47f8a249806dc0bb9779d9ba8fed09 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 7 Aug 2026 20:26:52 +0000 Subject: [PATCH 09/56] Address review feedback on agentserver samples Co-authored-by: xitzhang <11403681+xitzhang@users.noreply.github.com> --- .../tests/tasks/test_contract_completeness.py | 5 ++--- .../samples/resilient_langgraph/agent.py | 2 +- .../samples/resilient_multiturn/store.py | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/sdk/agentserver/azure-ai-agentserver-core/tests/tasks/test_contract_completeness.py b/sdk/agentserver/azure-ai-agentserver-core/tests/tasks/test_contract_completeness.py index 89785185ee80..42fc2abec2d9 100644 --- a/sdk/agentserver/azure-ai-agentserver-core/tests/tasks/test_contract_completeness.py +++ b/sdk/agentserver/azure-ai-agentserver-core/tests/tasks/test_contract_completeness.py @@ -175,9 +175,8 @@ "task_metadata_flush_per_namespace_only": ("test_metadata.py::test_flush_per_namespace_only"), # — default-namespace convenience accessor "task_metadata_default_namespace_callable_and_dict": ("test_metadata.py::test_default_namespace_callable_and_dict"), - # (Underscore-namespace not-enforced-by-primitive contract is vacuous - # post-redesign — primitive now reserves leading underscore and - # raises ValueError; covered by test_metadata::test_named_namespace.) + # Underscore-namespace guard is enforced by the facade layer, not the + # primitive named-namespace accessor. # --- — Task & Streams Reconciliation ---------------------- # (etag CAS, write queue, dynamic lease, per-op 412 policy) "task_streams_etag_cas_every_patch": ("test_etag_cas.py::test_every_patch_after_first_carries_if_match"), diff --git a/sdk/agentserver/azure-ai-agentserver-invocations/samples/resilient_langgraph/agent.py b/sdk/agentserver/azure-ai-agentserver-invocations/samples/resilient_langgraph/agent.py index 7795a79e70b0..537ba6df38eb 100644 --- a/sdk/agentserver/azure-ai-agentserver-invocations/samples/resilient_langgraph/agent.py +++ b/sdk/agentserver/azure-ai-agentserver-invocations/samples/resilient_langgraph/agent.py @@ -396,7 +396,7 @@ async def langgraph_session(ctx: TaskContext[dict]) -> dict[str, Any] | None: graph_input = {"messages": [HumanMessage(content=message)], "is_complete": False} # ── Run the graph with inter-node cancellation ────────────────── - loop = asyncio.get_event_loop() + loop = asyncio.get_running_loop() def _on_node(chunk: dict) -> None: """Stream node progress events from the sync graph thread.""" diff --git a/sdk/agentserver/azure-ai-agentserver-invocations/samples/resilient_multiturn/store.py b/sdk/agentserver/azure-ai-agentserver-invocations/samples/resilient_multiturn/store.py index deef36353c33..5e377f8d8ad9 100644 --- a/sdk/agentserver/azure-ai-agentserver-invocations/samples/resilient_multiturn/store.py +++ b/sdk/agentserver/azure-ai-agentserver-invocations/samples/resilient_multiturn/store.py @@ -34,7 +34,7 @@ def save(self, key: str, data: dict[str, Any]) -> None: target = self._base / f"{key}.json" fd, tmp_path = tempfile.mkstemp(dir=str(self._base), suffix=".tmp", prefix=f"{key}_") try: - with open(fd, "w") as f: + with open(fd, "w", encoding="utf-8") as f: json.dump(data, f, indent=2) Path(tmp_path).replace(target) except BaseException: From 61ce7a8160dd39c172606ea7f7cfde14fbb03102 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 7 Aug 2026 20:28:50 +0000 Subject: [PATCH 10/56] Address response sample review feedback Co-authored-by: xitzhang <11403681+xitzhang@users.noreply.github.com> --- sdk/agentserver/azure-ai-agentserver-responses/pyproject.toml | 2 +- .../samples/sample_21_resilient_langgraph.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk/agentserver/azure-ai-agentserver-responses/pyproject.toml b/sdk/agentserver/azure-ai-agentserver-responses/pyproject.toml index 75d443f6c5c6..3833c722b164 100644 --- a/sdk/agentserver/azure-ai-agentserver-responses/pyproject.toml +++ b/sdk/agentserver/azure-ai-agentserver-responses/pyproject.toml @@ -72,5 +72,5 @@ azure-sdk-tools = { path = "../../../eng/tools/azure-sdk-tools" } [tool.azure-sdk-build] verifytypes = false latestdependency = false -# azure-ai-agentserver-core>=2.0.0b9 is not yet on PyPI +# azure-ai-agentserver-core>=2.0.0b10 is not yet on PyPI mindependency = false diff --git a/sdk/agentserver/azure-ai-agentserver-responses/samples/sample_21_resilient_langgraph.py b/sdk/agentserver/azure-ai-agentserver-responses/samples/sample_21_resilient_langgraph.py index 9bd56e4ec882..f0179af70ffb 100644 --- a/sdk/agentserver/azure-ai-agentserver-responses/samples/sample_21_resilient_langgraph.py +++ b/sdk/agentserver/azure-ai-agentserver-responses/samples/sample_21_resilient_langgraph.py @@ -389,6 +389,7 @@ async def handler( # ── Turn complete — record the stable fork point for steering ──── _record_stable(context, await graph.aget_state(thread_config)) + await context.conversation_chain_metadata.flush() yield stream.emit_completed() From 21acd8e3d99d405a15960b42aefec618ce89ebc8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 7 Aug 2026 20:30:09 +0000 Subject: [PATCH 11/56] Align invocations dependency comment Co-authored-by: xitzhang <11403681+xitzhang@users.noreply.github.com> --- sdk/agentserver/azure-ai-agentserver-invocations/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/agentserver/azure-ai-agentserver-invocations/pyproject.toml b/sdk/agentserver/azure-ai-agentserver-invocations/pyproject.toml index 1d56a4ba2618..b39c0bdc8cdc 100644 --- a/sdk/agentserver/azure-ai-agentserver-invocations/pyproject.toml +++ b/sdk/agentserver/azure-ai-agentserver-invocations/pyproject.toml @@ -72,7 +72,7 @@ mypy = true pyright = true verifytypes = false latestdependency = false -# azure-ai-agentserver-core>=2.0.0b8 is not yet on PyPI +# azure-ai-agentserver-core>=2.0.0b10 is not yet on PyPI mindependency = false pylint = true type_check_samples = false From 1984182ebd5a03cde59d1a0a9cecff3286bdb80c Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Fri, 7 Aug 2026 14:22:05 -0700 Subject: [PATCH 12/56] Fix voice agents recording test failures --- .../azure/ai/voiceagents/aio/_patch.py | 34 ++++++++----------- .../azure/ai/voiceagents/aio/_realtime.py | 3 ++ .../recording/test_voice_agents_client.py | 6 +++- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_patch.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_patch.py index 5f9e0532c06f..b9b71669367c 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_patch.py +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_patch.py @@ -10,7 +10,7 @@ from typing import Any, Optional, TYPE_CHECKING from ._client import VoiceAgentsClient as _GeneratedVoiceAgentsClient -from ._realtime import AsyncRealtime, AsyncRealtimeConnection, AsyncRealtimeConnectionManager +from ._realtime import AsyncRealtime, AsyncRealtimeConnection, AsyncRealtimeConnectionManager, ClientEvent, ConversationItem, ServerEvent if TYPE_CHECKING: from azure.core.credentials_async import AsyncTokenCredential @@ -28,24 +28,17 @@ class VoiceAgentsClient(_GeneratedVoiceAgentsClient): # pylint: disable=client- def __init__( self, endpoint: str, credential: "AsyncTokenCredential", *, api_version: Optional[str] = None, **kwargs: Any ) -> None: - # Work around an azure-core/aiohttp limitation: azure-core's AioHttpTransport - # disables aiohttp's native response decompression and only re-implements - # gzip/deflate itself (no brotli support), while aiohttp advertises - # "Accept-Encoding: br" by default. If the service responds with a - # brotli-compressed body, azure-core fails to decode it. Unless the caller - # already supplied their own transport or session, default to only - # advertising the encodings azure-core can actually decompress. - if "transport" not in kwargs and "session" not in kwargs: - try: - import aiohttp - import azure.core.pipeline.transport as transport_module - - kwargs["transport"] = transport_module.AioHttpTransport( - session=aiohttp.ClientSession(auto_decompress=False, headers={"Accept-Encoding": "gzip, deflate"}) - ) - except ImportError: - pass - super().__init__(endpoint, credential, api_version=api_version, **kwargs) + # Work around an azure-core/aiohttp limitation without eagerly creating + # an aiohttp session (which requires a running event loop). We constrain + # Accept-Encoding through default request headers so session creation + # remains lazy and loop-independent. + headers = dict(kwargs.get("headers") or {}) + headers.setdefault("Accept-Encoding", "gzip, deflate") + kwargs["headers"] = headers + if api_version is None: + super().__init__(endpoint, credential, **kwargs) + else: + super().__init__(endpoint, credential, api_version=api_version, **kwargs) @property def realtime(self) -> AsyncRealtime: @@ -64,6 +57,9 @@ def realtime(self) -> AsyncRealtime: "AsyncRealtime", "AsyncRealtimeConnection", "AsyncRealtimeConnectionManager", + "ClientEvent", + "ConversationItem", + "ServerEvent", ] # Add all objects you want publicly available to users at this package level diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_realtime.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_realtime.py index e7ac89f8ade8..76d9461d7ae0 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_realtime.py +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_realtime.py @@ -48,6 +48,9 @@ "AsyncRealtime", "AsyncRealtimeConnection", "AsyncRealtimeConnectionManager", + "ClientEvent", + "ConversationItem", + "ServerEvent", ] # Union of the client event models sendable over the connection, plus a raw mapping escape diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client.py b/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client.py index 14b6f268ac96..435988ad3097 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client.py +++ b/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client.py @@ -29,7 +29,11 @@ def create_client(self, endpoint: str) -> VoiceAgentsClient: @recorded_by_proxy def test_get_voice_agent(self, azure_voice_agents_endpoint, azure_voice_agents_agent_name): with self.create_client(azure_voice_agents_endpoint) as client: - agent = client.voice_agents.get_voice_agent(azure_voice_agents_agent_name, foundry_features=PREVIEW) + agent = client.voice_agents.get_voice_agent( + azure_voice_agents_agent_name, + foundry_features=PREVIEW, + headers={"Accept-Encoding": "identity"}, + ) # NOTE: don't assert agent["name"]/["id"] against azure_voice_agents_agent_name -- # the test-proxy's built-in default sanitizers always redact "id"/"name" body From 32fc2cd1fdf383d25864f53327db77f891c955f4 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Mon, 10 Aug 2026 13:17:43 -0700 Subject: [PATCH 13/56] Fix voiceagents recording decode and aio transport headers --- .../azure/ai/voiceagents/aio/_patch.py | 23 ++++++++++++++----- .../recording/test_voice_agents_client.py | 1 - 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_patch.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_patch.py index b9b71669367c..fe458f0569d9 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_patch.py +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_patch.py @@ -9,8 +9,18 @@ """ from typing import Any, Optional, TYPE_CHECKING +import aiohttp +from azure.core.pipeline.transport import AioHttpTransport + from ._client import VoiceAgentsClient as _GeneratedVoiceAgentsClient -from ._realtime import AsyncRealtime, AsyncRealtimeConnection, AsyncRealtimeConnectionManager, ClientEvent, ConversationItem, ServerEvent +from ._realtime import ( + AsyncRealtime, + AsyncRealtimeConnection, + AsyncRealtimeConnectionManager, + ClientEvent, + ConversationItem, + ServerEvent, +) if TYPE_CHECKING: from azure.core.credentials_async import AsyncTokenCredential @@ -30,11 +40,12 @@ def __init__( ) -> None: # Work around an azure-core/aiohttp limitation without eagerly creating # an aiohttp session (which requires a running event loop). We constrain - # Accept-Encoding through default request headers so session creation - # remains lazy and loop-independent. - headers = dict(kwargs.get("headers") or {}) - headers.setdefault("Accept-Encoding", "gzip, deflate") - kwargs["headers"] = headers + # Accept-Encoding on the transport so the session advertises only + # encodings that azure-core can decompress. + if "transport" not in kwargs: + kwargs["transport"] = AioHttpTransport( + session=aiohttp.ClientSession(headers={"Accept-Encoding": "gzip, deflate"}) + ) if api_version is None: super().__init__(endpoint, credential, **kwargs) else: diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client.py b/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client.py index 435988ad3097..5d5ca69930e4 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client.py +++ b/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client.py @@ -32,7 +32,6 @@ def test_get_voice_agent(self, azure_voice_agents_endpoint, azure_voice_agents_a agent = client.voice_agents.get_voice_agent( azure_voice_agents_agent_name, foundry_features=PREVIEW, - headers={"Accept-Encoding": "identity"}, ) # NOTE: don't assert agent["name"]/["id"] against azure_voice_agents_agent_name -- From e6fb74e9d66985c343e470f41e66b5c49edde8c1 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Mon, 10 Aug 2026 13:59:19 -0700 Subject: [PATCH 14/56] Avoid concrete transport import in aio patch --- .../azure/ai/voiceagents/aio/_patch.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_patch.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_patch.py index fe458f0569d9..cd188babb2ce 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_patch.py +++ b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_patch.py @@ -10,7 +10,6 @@ from typing import Any, Optional, TYPE_CHECKING import aiohttp -from azure.core.pipeline.transport import AioHttpTransport from ._client import VoiceAgentsClient as _GeneratedVoiceAgentsClient from ._realtime import ( @@ -38,14 +37,14 @@ class VoiceAgentsClient(_GeneratedVoiceAgentsClient): # pylint: disable=client- def __init__( self, endpoint: str, credential: "AsyncTokenCredential", *, api_version: Optional[str] = None, **kwargs: Any ) -> None: - # Work around an azure-core/aiohttp limitation without eagerly creating - # an aiohttp session (which requires a running event loop). We constrain - # Accept-Encoding on the transport so the session advertises only - # encodings that azure-core can decompress. - if "transport" not in kwargs: - kwargs["transport"] = AioHttpTransport( - session=aiohttp.ClientSession(headers={"Accept-Encoding": "gzip, deflate"}) - ) + # Work around an azure-core/aiohttp limitation: azure-core disables + # aiohttp's native decompression but only re-implements gzip/deflate, + # while aiohttp advertises "br" by default. Supplying the session that + # the default AioHttpTransport will adopt keeps Accept-Encoding limited + # to encodings azure-core can actually decompress, without importing a + # concrete transport type. + if "transport" not in kwargs and "session" not in kwargs: + kwargs["session"] = aiohttp.ClientSession(headers={"Accept-Encoding": "gzip, deflate"}) if api_version is None: super().__init__(endpoint, credential, **kwargs) else: From 1e37d81347ef097b0fd2cccea1d95c6066c27d78 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Thu, 13 Aug 2026 14:43:22 -0700 Subject: [PATCH 15/56] Emit azure-ai-projects voice agent SDK from TypeSpec, add realtime client and samples, remove azure-ai-voiceagents - Emit azure-ai-projects from TypeSpec at PR #45357 (unify voice agents with Agents API) - Add hand-written async realtime WebSocket client (AIProjectClient.realtime), ported from azure-ai-voiceagents - Add 9 new samples under samples/agents/voice/ - Update patch files, tests, README, and docs/public-methods.md for the new voice agent surface - Remove sdk/voiceagents/azure-ai-voiceagents (superseded by unified azure-ai-projects voice agents) --- sdk/ai/azure-ai-projects/README.md | 1 + sdk/ai/azure-ai-projects/api.md | 15496 ++++++++-- sdk/ai/azure-ai-projects/api.metadata.yml | 4 +- .../azure-ai-projects/apiview-properties.json | 272 +- .../azure/ai/projects/_client.py | 15 +- .../azure/ai/projects/_configuration.py | 3 +- .../azure/ai/projects/_unions.py | 38 +- .../azure/ai/projects/_utils/model_base.py | 37 +- .../azure/ai/projects/_utils/serialization.py | 6 +- .../azure/ai/projects/aio/_client.py | 15 +- .../azure/ai/projects/aio/_configuration.py | 3 +- .../azure/ai/projects/aio/_patch.py | 30 +- .../azure/ai/projects}/aio/_realtime.py | 196 +- .../ai/projects/aio/operations/__init__.py | 4 + .../ai/projects/aio/operations/_operations.py | 2282 +- .../azure/ai/projects/models/__init__.py | 485 +- .../azure/ai/projects/models/_enums.py | 574 +- .../azure/ai/projects/models/_models.py | 25590 +++++++++++----- .../azure/ai/projects/models/_patch.py | 1 + .../azure/ai/projects/operations/__init__.py | 4 + .../ai/projects/operations/_operations.py | 6337 ++-- .../azure/ai/projects/types.py | 12134 ++++++++ .../azure-ai-projects/docs/public-methods.md | 21 +- .../agents/voice/sample_voice_agent_basic.py | 104 + .../voice/sample_voice_agent_basic_async.py | 73 + .../voice/sample_voice_agent_generate.py | 44 + ...ce_agent_live_audio_conversation_async.py} | 98 +- ...ice_agent_live_text_conversation_async.py} | 82 +- .../sample_voice_agent_read_conversation.py | 88 + ...le_voice_agent_read_conversation_audio.py} | 110 +- .../voice/sample_voice_agent_versions.py | 90 + .../voice/sample_voice_agent_with_tools.py | 146 + .../foundry_features_header_test_base.py | 4 +- sdk/ai/azure-ai-projects/tsp-location.yaml | 28 + .../azure-ai-voiceagents/CHANGELOG.md | 7 - sdk/voiceagents/azure-ai-voiceagents/LICENSE | 21 - .../azure-ai-voiceagents/MANIFEST.in | 7 - .../azure-ai-voiceagents/README.md | 116 - .../azure-ai-voiceagents/_metadata.json | 6 - sdk/voiceagents/azure-ai-voiceagents/api.md | 9896 ------ .../azure-ai-voiceagents/api.metadata.yml | 3 - .../apiview-properties.json | 380 - .../azure-ai-voiceagents/assets.json | 6 - .../azure-ai-voiceagents/azure/__init__.py | 1 - .../azure-ai-voiceagents/azure/ai/__init__.py | 1 - .../azure/ai/voiceagents/__init__.py | 32 - .../azure/ai/voiceagents/_client.py | 117 - .../azure/ai/voiceagents/_configuration.py | 69 - .../azure/ai/voiceagents/_patch.py | 21 - .../azure/ai/voiceagents/_unions.py | 71 - .../azure/ai/voiceagents/_utils/__init__.py | 6 - .../azure/ai/voiceagents/_utils/model_base.py | 1787 -- .../ai/voiceagents/_utils/serialization.py | 2179 -- .../azure/ai/voiceagents/_version.py | 9 - .../azure/ai/voiceagents/aio/__init__.py | 29 - .../azure/ai/voiceagents/aio/_client.py | 119 - .../ai/voiceagents/aio/_configuration.py | 69 - .../azure/ai/voiceagents/aio/_patch.py | 82 - .../ai/voiceagents/aio/operations/__init__.py | 27 - .../voiceagents/aio/operations/_operations.py | 2742 -- .../ai/voiceagents/aio/operations/_patch.py | 21 - .../azure/ai/voiceagents/models/__init__.py | 680 - .../azure/ai/voiceagents/models/_enums.py | 1084 - .../azure/ai/voiceagents/models/_models.py | 13395 -------- .../azure/ai/voiceagents/models/_patch.py | 21 - .../ai/voiceagents/operations/__init__.py | 27 - .../ai/voiceagents/operations/_operations.py | 3501 --- .../azure/ai/voiceagents/operations/_patch.py | 21 - .../azure/ai/voiceagents/py.typed | 1 - .../azure/ai/voiceagents/types.py | 6717 ---- .../azure-ai-voiceagents/dev_requirements.txt | 4 - .../azure-ai-voiceagents/pyproject.toml | 61 - .../azure-ai-voiceagents/pyrightconfig.json | 13 - .../azure-ai-voiceagents/pytest.ini | 2 - .../azure-ai-voiceagents/samples/README.md | 153 - .../sample_create_and_manage_voice_agent.py | 115 - ...ple_create_and_manage_voice_agent_async.py | 76 - .../sample_create_voice_agent_with_tools.py | 162 - .../management/sample_generate_voice_agent.py | 64 - .../sample_manage_voice_agent_versions.py | 101 - .../management/sample_read_conversation.py | 103 - .../quickstart/sample_quickstart_async.py | 227 - .../azure-ai-voiceagents/test-resources.json | 566 - .../azure-ai-voiceagents/tests/conftest.py | 15 - .../tests/live/conftest.py | 17 - .../live/test_voice_agents_management.py | 101 - .../tests/live/test_voice_agents_realtime.py | 83 - .../tests/recording/_preparer.py | 26 - .../tests/recording/conftest.py | 20 - .../recording/test_voice_agents_client.py | 115 - .../test_voice_agents_client_async.py | 106 - .../tests/unit/conftest.py | 17 - .../tests/unit/test_brotli_workaround.py | 48 - .../tests/unit/test_client_construction.py | 59 - .../tests/unit/test_configuration.py | 47 - .../azure-ai-voiceagents/tsp-location.yaml | 13 - 96 files changed, 50805 insertions(+), 59195 deletions(-) rename sdk/{voiceagents/azure-ai-voiceagents/azure/ai/voiceagents => ai/azure-ai-projects/azure/ai/projects}/aio/_realtime.py (82%) create mode 100644 sdk/ai/azure-ai-projects/azure/ai/projects/types.py create mode 100644 sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_basic.py create mode 100644 sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_basic_async.py create mode 100644 sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_generate.py rename sdk/{voiceagents/azure-ai-voiceagents/samples/live/sample_live_audio_conversation_async.py => ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py} (79%) rename sdk/{voiceagents/azure-ai-voiceagents/samples/live/sample_live_text_conversation_async.py => ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py} (75%) create mode 100644 sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_read_conversation.py rename sdk/{voiceagents/azure-ai-voiceagents/samples/management/sample_read_conversation_audio.py => ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_read_conversation_audio.py} (56%) create mode 100644 sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_versions.py create mode 100644 sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_with_tools.py create mode 100644 sdk/ai/azure-ai-projects/tsp-location.yaml delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/CHANGELOG.md delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/LICENSE delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/MANIFEST.in delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/README.md delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/_metadata.json delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/api.md delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/api.metadata.yml delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/apiview-properties.json delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/assets.json delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/__init__.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/__init__.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/__init__.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_client.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_configuration.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_patch.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_unions.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_utils/__init__.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_utils/model_base.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_utils/serialization.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_version.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/__init__.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_client.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_configuration.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_patch.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/__init__.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/_operations.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/_patch.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/__init__.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/_enums.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/_models.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/_patch.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/__init__.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/_operations.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/_patch.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/py.typed delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/types.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/dev_requirements.txt delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/pyproject.toml delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/pyrightconfig.json delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/pytest.ini delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/samples/README.md delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_create_and_manage_voice_agent.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_create_and_manage_voice_agent_async.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_create_voice_agent_with_tools.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_generate_voice_agent.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_manage_voice_agent_versions.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_read_conversation.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/samples/quickstart/sample_quickstart_async.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/test-resources.json delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/tests/conftest.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/tests/live/conftest.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/tests/live/test_voice_agents_management.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/tests/live/test_voice_agents_realtime.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/tests/recording/_preparer.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/tests/recording/conftest.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client_async.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/tests/unit/conftest.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/tests/unit/test_brotli_workaround.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/tests/unit/test_client_construction.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/tests/unit/test_configuration.py delete mode 100644 sdk/voiceagents/azure-ai-voiceagents/tsp-location.yaml diff --git a/sdk/ai/azure-ai-projects/README.md b/sdk/ai/azure-ai-projects/README.md index 17a3fe812af0..7c9c61bdde72 100644 --- a/sdk/ai/azure-ai-projects/README.md +++ b/sdk/ai/azure-ai-projects/README.md @@ -191,6 +191,7 @@ The table below lists the operation groups supported by the client library, with | Sessions | [Manage hosted sessions](https://learn.microsoft.com/azure/foundry/agents/how-to/manage-hosted-sessions?pivots=python) | `samples/hosted_agents/` | | Skills (preview) | | `samples/skills/` | | Toolboxes | [Curate intent-based toolbox in Foundry](https://learn.microsoft.com/azure/foundry/agents/how-to/tools/toolbox?pivots=python) | `samples/hosted_agents/`, `samples/toolboxes/` | +| Voice agents (preview) | [Use the GPT Realtime API for speech and audio](https://learn.microsoft.com/azure/foundry/openai/how-to/realtime-audio) | `samples/agents/voice/` | ## Client-side tracing diff --git a/sdk/ai/azure-ai-projects/api.md b/sdk/ai/azure-ai-projects/api.md index a683fb81cd13..c49b2623eabb 100644 --- a/sdk/ai/azure-ai-projects/api.md +++ b/sdk/ai/azure-ai-projects/api.md @@ -85,6 +85,131 @@ namespace azure.ai.projects.aio namespace azure.ai.projects.aio.operations + class azure.ai.projects.aio.operations.AgentEndpointConversationsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def delete_agent_conversation( + self, + agent_name: str, + conversation_id: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def get_agent_conversation( + self, + agent_name: str, + conversation_id: str, + **kwargs: Any + ) -> VoiceConversation: ... + + @distributed_trace_async + async def get_agent_conversation_audio( + self, + agent_name: str, + conversation_id: str, + **kwargs: Any + ) -> VoiceRecordingResponse: ... + + @distributed_trace_async + async def get_agent_conversation_audio_content( + self, + agent_name: str, + conversation_id: str, + **kwargs: Any + ) -> AsyncIterator[bytes]: ... + + @distributed_trace_async + async def get_agent_conversation_item( + self, + agent_name: str, + conversation_id: str, + item_id: str, + **kwargs: Any + ) -> VoiceConversationItem: ... + + @distributed_trace_async + async def get_agent_conversation_item_audio( + self, + agent_name: str, + conversation_id: str, + item_id: str, + **kwargs: Any + ) -> VoiceItemAudioResponse: ... + + @distributed_trace_async + async def get_agent_conversation_item_audio_content( + self, + agent_name: str, + conversation_id: str, + item_id: str, + **kwargs: Any + ) -> AsyncIterator[bytes]: ... + + @distributed_trace_async + async def get_agent_conversation_response( + self, + agent_name: str, + conversation_id: str, + response_id: str, + **kwargs: Any + ) -> VoiceResponse: ... + + @distributed_trace + def list_agent_conversation_items( + self, + agent_name: str, + conversation_id: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[VoiceConversationItem]: ... + + @distributed_trace + def list_agent_conversation_response_items( + self, + agent_name: str, + conversation_id: str, + response_id: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[VoiceConversationItem]: ... + + @distributed_trace + def list_agent_conversation_responses( + self, + agent_name: str, + conversation_id: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[VoiceResponse]: ... + + @distributed_trace + def list_agent_conversations( + self, + agent_name: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[VoiceConversation]: ... + + class azure.ai.projects.aio.operations.AgentsOperations(GeneratedAgentsOperations): def __init__( @@ -108,7 +233,7 @@ namespace azure.ai.projects.aio.operations async def create_session( self, agent_name: str, - body: JSON, + body: CreateSessionRequest, *, content_type: str = "application/json", **kwargs: Any @@ -188,7 +313,7 @@ namespace azure.ai.projects.aio.operations async def create_version_from_manifest( self, agent_name: str, - body: JSON, + body: CreateAgentVersionFromManifestRequest, *, content_type: str = "application/json", **kwargs: Any @@ -275,6 +400,33 @@ namespace azure.ai.projects.aio.operations **kwargs: Any ) -> None: ... + @overload + async def generate_agent( + self, + *, + content_type: str = "application/json", + kind: Union[str, AgentKind], + **kwargs: Any + ) -> AgentDetails: ... + + @overload + async def generate_agent( + self, + body: GenerateAgentRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AgentDetails: ... + + @overload + async def generate_agent( + self, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AgentDetails: ... + @distributed_trace_async async def get( self, @@ -377,7 +529,7 @@ namespace azure.ai.projects.aio.operations async def update_details( self, agent_name: str, - body: JSON, + body: PatchAgentObjectRequest, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -393,13 +545,26 @@ namespace azure.ai.projects.aio.operations **kwargs: Any ) -> AgentDetails: ... - @distributed_trace_async + @overload async def upload_session_file( self, agent_name: str, session_id: str, content: bytes, *, + content_type: str = "application/octet-stream", + path: str, + **kwargs: Any + ) -> SessionFileWriteResult: ... + + @overload + async def upload_session_file( + self, + agent_name: str, + session_id: str, + content: IO[bytes], + *, + content_type: str = "application/octet-stream", path: str, **kwargs: Any ) -> SessionFileWriteResult: ... @@ -416,22 +581,22 @@ namespace azure.ai.projects.aio.operations @overload async def begin_create_optimization_job( self, - job: OptimizationJob, + job: AgentOptimizationJob, *, content_type: str = "application/json", operation_id: Optional[str] = ..., **kwargs: Any - ) -> AsyncLROPoller[OptimizationJobResult]: ... + ) -> AsyncLROPoller[AgentOptimizationJobResult]: ... @overload async def begin_create_optimization_job( self, - job: JSON, + job: AgentOptimizationJob, *, content_type: str = "application/json", operation_id: Optional[str] = ..., **kwargs: Any - ) -> AsyncLROPoller[OptimizationJobResult]: ... + ) -> AsyncLROPoller[AgentOptimizationJobResult]: ... @overload async def begin_create_optimization_job( @@ -441,14 +606,14 @@ namespace azure.ai.projects.aio.operations content_type: str = "application/json", operation_id: Optional[str] = ..., **kwargs: Any - ) -> AsyncLROPoller[OptimizationJobResult]: ... + ) -> AsyncLROPoller[AgentOptimizationJobResult]: ... @distributed_trace_async async def cancel_optimization_job( self, job_id: str, **kwargs: Any - ) -> OptimizationJob: ... + ) -> AgentOptimizationJob: ... @distributed_trace_async async def delete_optimization_job( @@ -462,7 +627,7 @@ namespace azure.ai.projects.aio.operations self, job_id: str, **kwargs: Any - ) -> OptimizationJob: ... + ) -> AgentOptimizationJob: ... @distributed_trace def list_optimization_jobs( @@ -474,7 +639,7 @@ namespace azure.ai.projects.aio.operations order: Optional[Union[str, PageOrder]] = ..., status: Optional[Union[str, JobStatus]] = ..., **kwargs: Any - ) -> AsyncItemPaged[OptimizationJobListItem]: ... + ) -> AsyncItemPaged[AgentOptimizationJobListItem]: ... class azure.ai.projects.aio.operations.BetaDatasetsOperations: @@ -498,7 +663,7 @@ namespace azure.ai.projects.aio.operations @overload async def begin_create_generation_job( self, - job: JSON, + job: DataGenerationJob, *, content_type: str = "application/json", operation_id: Optional[str] = ..., @@ -569,7 +734,7 @@ namespace azure.ai.projects.aio.operations async def create( self, name: str, - taxonomy: JSON, + taxonomy: EvaluationTaxonomy, *, content_type: str = "application/json", **kwargs: Any @@ -622,7 +787,7 @@ namespace azure.ai.projects.aio.operations async def update( self, name: str, - taxonomy: JSON, + taxonomy: EvaluationTaxonomy, *, content_type: str = "application/json", **kwargs: Any @@ -660,7 +825,7 @@ namespace azure.ai.projects.aio.operations @overload async def begin_create_generation_job( self, - job: JSON, + job: EvaluatorGenerationJob, *, content_type: str = "application/json", operation_id: Optional[str] = ..., @@ -698,7 +863,7 @@ namespace azure.ai.projects.aio.operations async def create_version( self, name: str, - evaluator_version: JSON, + evaluator_version: EvaluatorVersion, *, content_type: str = "application/json", **kwargs: Any @@ -745,7 +910,7 @@ namespace azure.ai.projects.aio.operations self, name: str, version: str, - credential_request: JSON, + credential_request: EvaluatorCredentialRequest, *, content_type: str = "application/json", **kwargs: Any @@ -822,7 +987,7 @@ namespace azure.ai.projects.aio.operations self, name: str, version: str, - pending_upload_request: JSON, + pending_upload_request: PendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any @@ -855,7 +1020,7 @@ namespace azure.ai.projects.aio.operations self, name: str, version: str, - evaluator_version: JSON, + evaluator_version: EvaluatorVersion, *, content_type: str = "application/json", **kwargs: Any @@ -893,7 +1058,7 @@ namespace azure.ai.projects.aio.operations @overload async def generate( self, - insight: JSON, + insight: Insight, *, content_type: str = "application/json", **kwargs: Any @@ -986,7 +1151,7 @@ namespace azure.ai.projects.aio.operations @overload async def create( self, - body: JSON, + body: CreateMemoryStoreRequest, *, content_type: str = "application/json", **kwargs: Any @@ -1017,7 +1182,7 @@ namespace azure.ai.projects.aio.operations async def create_memory( self, name: str, - body: JSON, + body: CreateMemoryRequest, *, content_type: str = "application/json", **kwargs: Any @@ -1062,7 +1227,7 @@ namespace azure.ai.projects.aio.operations async def delete_scope( self, name: str, - body: JSON, + body: DeleteScopeRequest, *, content_type: str = "application/json", **kwargs: Any @@ -1121,7 +1286,7 @@ namespace azure.ai.projects.aio.operations def list_memories( self, name: str, - body: JSON, + body: ListMemoriesRequest, *, before: Optional[str] = ..., content_type: str = "application/json", @@ -1193,7 +1358,7 @@ namespace azure.ai.projects.aio.operations async def update( self, name: str, - body: JSON, + body: UpdateMemoryStoreRequest, *, content_type: str = "application/json", **kwargs: Any @@ -1225,7 +1390,7 @@ namespace azure.ai.projects.aio.operations self, name: str, memory_id: str, - body: JSON, + body: UpdateMemoryRequest, *, content_type: str = "application/json", **kwargs: Any @@ -1317,7 +1482,7 @@ namespace azure.ai.projects.aio.operations self, name: str, version: str, - credential_request: JSON, + credential_request: ModelCredentialRequest, *, content_type: str = "application/json", **kwargs: Any @@ -1360,7 +1525,7 @@ namespace azure.ai.projects.aio.operations self, name: str, version: str, - model_version: JSON, + model_version: ModelVersion, *, content_type: str = "application/json", **kwargs: Any @@ -1393,7 +1558,7 @@ namespace azure.ai.projects.aio.operations self, name: str, version: str, - pending_upload_request: JSON, + pending_upload_request: ModelPendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any @@ -1426,7 +1591,7 @@ namespace azure.ai.projects.aio.operations self, name: str, version: str, - model_version_update: JSON, + model_version_update: UpdateModelVersionRequest, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -1484,7 +1649,7 @@ namespace azure.ai.projects.aio.operations @overload async def create( self, - red_team: JSON, + red_team: RedTeam, *, content_type: str = "application/json", **kwargs: Any @@ -1535,7 +1700,7 @@ namespace azure.ai.projects.aio.operations async def create_or_update( self, routine_name: str, - body: JSON, + body: CreateOrUpdateRoutineRequest, *, content_type: str = "application/json", **kwargs: Any @@ -1579,7 +1744,7 @@ namespace azure.ai.projects.aio.operations async def dispatch( self, routine_name: str, - body: JSON, + body: DispatchRoutineAsyncRequest, *, content_type: str = "application/json", **kwargs: Any @@ -1654,7 +1819,7 @@ namespace azure.ai.projects.aio.operations async def create_or_update( self, schedule_id: str, - schedule: JSON, + schedule: Schedule, *, content_type: str = "application/json", **kwargs: Any @@ -1735,7 +1900,7 @@ namespace azure.ai.projects.aio.operations async def create( self, name: str, - body: JSON, + body: CreateSkillVersionRequest, *, content_type: str = "application/json", **kwargs: Any @@ -1763,7 +1928,7 @@ namespace azure.ai.projects.aio.operations async def create_from_files( self, name: str, - content: JSON, + content: CreateSkillVersionFromFilesBody, **kwargs: Any ) -> SkillVersion: ... @@ -1847,7 +2012,7 @@ namespace azure.ai.projects.aio.operations async def update( self, name: str, - body: JSON, + body: UpdateSkillRequest, *, content_type: str = "application/json", **kwargs: Any @@ -1924,7 +2089,7 @@ namespace azure.ai.projects.aio.operations self, name: str, version: str, - dataset_version: JSON, + dataset_version: DatasetVersion, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -1991,7 +2156,7 @@ namespace azure.ai.projects.aio.operations self, name: str, version: str, - pending_upload_request: JSON, + pending_upload_request: PendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any @@ -2145,7 +2310,7 @@ namespace azure.ai.projects.aio.operations self, name: str, version: str, - index: JSON, + index: Index, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -2223,7 +2388,7 @@ namespace azure.ai.projects.aio.operations async def create_version( self, name: str, - body: JSON, + body: CreateToolboxVersionRequest, *, content_type: str = "application/json", **kwargs: Any @@ -2304,7 +2469,7 @@ namespace azure.ai.projects.aio.operations async def update( self, name: str, - body: JSON, + body: UpdateToolboxRequest1, *, content_type: str = "application/json", **kwargs: Any @@ -2321,6 +2486,28 @@ namespace azure.ai.projects.aio.operations ) -> ToolboxObject: ... + class azure.ai.projects.aio.operations.VoiceAgentWebSocketOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def connect_voice_agent( + self, + agent_name: str, + *, + agent_session_id: Optional[str] = ..., + agent_version_override: Optional[str] = ..., + store: Optional[bool] = ..., + structured_inputs: Optional[str] = ..., + websocket_subprotocol: Optional[Union[str, VoiceAgentWebSocketSubprotocol]] = ..., + **kwargs: Any + ) -> None: ... + + namespace azure.ai.projects.models class azure.ai.projects.models.A2APreviewTool(Tool, discriminator='a2a_preview'): @@ -2547,6 +2734,7 @@ namespace azure.ai.projects.models name: str object: Literal[AgentObjectType.AGENT] state: Union[str, AgentState] + state_source: Optional[Union[str, AgentStateSource]] versions: AgentObjectVersions @overload @@ -2611,6 +2799,7 @@ namespace azure.ai.projects.models INVOCATIONS_WS = "invocations_ws" MCP = "mcp" RESPONSES = "responses" + VOICE = "voice" class azure.ai.projects.models.AgentEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator='agent'): @@ -2659,6 +2848,7 @@ namespace azure.ai.projects.models EXTERNAL = "external" HOSTED = "hosted" PROMPT = "prompt" + VOICE = "voice" WORKFLOW = "workflow" @@ -2684,102 +2874,352 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentSessionResource(_Model): - agent_session_id: str - created_at: datetime - expires_at: datetime - last_accessed_at: datetime - status: Union[str, AgentSessionStatus] - version_indicator: VersionIndicator + class azure.ai.projects.models.AgentOptimizationCandidate(_Model): + avg_score: float + avg_tokens: float + candidate_id: Optional[str] + eval_id: Optional[str] + eval_run_id: Optional[str] + mutations: Optional[dict[str, Any]] + name: str + promotion: Optional[PromotionInfo] @overload def __init__( self, *, - agent_session_id: str, - status: Union[str, AgentSessionStatus], - version_indicator: VersionIndicator + avg_score: float, + avg_tokens: float, + candidate_id: Optional[str] = ..., + eval_id: Optional[str] = ..., + eval_run_id: Optional[str] = ..., + mutations: Optional[dict[str, Any]] = ..., + name: str, + promotion: Optional[PromotionInfo] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentSessionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ACTIVE = "active" - CREATING = "creating" - DELETED = "deleted" - DELETING = "deleting" - EXPIRED = "expired" - FAILED = "failed" - IDLE = "idle" - UPDATING = "updating" - - - class azure.ai.projects.models.AgentState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "disabled" - ENABLED = "enabled" - - - class azure.ai.projects.models.AgentTaxonomyInput(EvaluationTaxonomyInput, discriminator='agent'): - risk_categories: list[Union[str, RiskCategory]] - target: EvaluationTarget - type: Literal[EvaluationTaxonomyInputType.AGENT] + class azure.ai.projects.models.AgentOptimizationDatasetCriterion(_Model): + instruction: str + name: str @overload def __init__( self, *, - risk_categories: list[Union[str, RiskCategory]], - target: EvaluationTarget + instruction: str, + name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentVersionDetails(_Model): - agent_guid: Optional[str] - blueprint: Optional[AgentIdentity] - blueprint_reference: Optional[AgentBlueprintReference] - created_at: datetime - definition: AgentDefinition - description: Optional[str] - draft: Optional[bool] - id: str - instance_identity: Optional[AgentIdentity] - metadata: dict[str, str] - name: str - object: Literal[AgentObjectType.AGENT_VERSION] - status: Optional[Union[str, AgentVersionStatus]] - version: str + class azure.ai.projects.models.AgentOptimizationDatasetInput(_Model): + type: str @overload def __init__( self, *, - created_at: datetime, - definition: AgentDefinition, - description: Optional[str] = ..., - draft: Optional[bool] = ..., - id: str, - metadata: dict[str, str], - name: str, - object: Literal[AgentObjectType.AGENT_VERSION], - status: Optional[Union[str, AgentVersionStatus]] = ..., - version: str + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentVersionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ACTIVE = "active" - CREATING = "creating" - DELETED = "deleted" - DELETING = "deleting" - FAILED = "failed" + class azure.ai.projects.models.AgentOptimizationDatasetInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INLINE = "inline" + REFERENCE = "reference" + + + class azure.ai.projects.models.AgentOptimizationDatasetItem(_Model): + criteria: Optional[list[AgentOptimizationDatasetCriterion]] + desired_num_turns: Optional[int] + ground_truth: Optional[str] + query: Optional[str] + + @overload + def __init__( + self, + *, + criteria: Optional[list[AgentOptimizationDatasetCriterion]] = ..., + desired_num_turns: Optional[int] = ..., + ground_truth: Optional[str] = ..., + query: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentOptimizationEvaluatorRef(_Model): + name: str + version: Optional[str] + + @overload + def __init__( + self, + *, + name: str, + version: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentOptimizationInlineDatasetInput(AgentOptimizationDatasetInput, discriminator='inline'): + dataset_items: list[AgentOptimizationDatasetItem] + type: Literal[AgentOptimizationDatasetInputType.INLINE] + + @overload + def __init__( + self, + *, + dataset_items: list[AgentOptimizationDatasetItem] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentOptimizationJob(_Model): + created_at: datetime + error: Optional[ApiError] + id: str + inputs: Optional[AgentOptimizationJobInputs] + progress: Optional[AgentOptimizationJobProgress] + result: Optional[AgentOptimizationJobResult] + status: Union[str, JobStatus] + updated_at: datetime + warnings: Optional[list[str]] + + @overload + def __init__( + self, + *, + inputs: Optional[AgentOptimizationJobInputs] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentOptimizationJobInputs(_Model): + agent: OptimizedAgentIdentifier + evaluators: list[AgentOptimizationEvaluatorRef] + options: Optional[AgentOptimizationOptions] + train_dataset: AgentOptimizationDatasetInput + validation_dataset: Optional[AgentOptimizationDatasetInput] + + @overload + def __init__( + self, + *, + agent: OptimizedAgentIdentifier, + evaluators: list[AgentOptimizationEvaluatorRef], + options: Optional[AgentOptimizationOptions] = ..., + train_dataset: AgentOptimizationDatasetInput, + validation_dataset: Optional[AgentOptimizationDatasetInput] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentOptimizationJobListItem(_Model): + agent: Optional[OptimizedAgentIdentifier] + created_at: datetime + error: Optional[ApiError] + id: str + progress: Optional[AgentOptimizationJobProgress] + status: Union[str, JobStatus] + updated_at: datetime + + + class azure.ai.projects.models.AgentOptimizationJobProgress(_Model): + best_score: float + candidates_completed: int + elapsed_seconds: float + + @overload + def __init__( + self, + *, + best_score: float, + candidates_completed: int, + elapsed_seconds: float + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentOptimizationJobResult(_Model): + baseline: Optional[str] + best: Optional[str] + candidates: Optional[list[AgentOptimizationCandidate]] + + @overload + def __init__( + self, + *, + baseline: Optional[str] = ..., + best: Optional[str] = ..., + candidates: Optional[list[AgentOptimizationCandidate]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentOptimizationOptions(_Model): + eval_model: Optional[str] + evaluation_level: Optional[Union[str, EvaluationLevel]] + max_candidates: Optional[int] + max_stalls: Optional[int] + optimization_config: Optional[dict[str, Any]] + optimization_model: Optional[str] + + @overload + def __init__( + self, + *, + eval_model: Optional[str] = ..., + evaluation_level: Optional[Union[str, EvaluationLevel]] = ..., + max_candidates: Optional[int] = ..., + max_stalls: Optional[int] = ..., + optimization_config: Optional[dict[str, Any]] = ..., + optimization_model: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentOptimizationReferenceDatasetInput(AgentOptimizationDatasetInput, discriminator='reference'): + name: str + type: Literal[AgentOptimizationDatasetInputType.REFERENCE] + version: Optional[str] + + @overload + def __init__( + self, + *, + name: str, + version: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentSessionResource(_Model): + agent_session_id: str + created_at: datetime + expires_at: datetime + last_accessed_at: datetime + status: Union[str, AgentSessionStatus] + version_indicator: VersionIndicator + + @overload + def __init__( + self, + *, + agent_session_id: str, + status: Union[str, AgentSessionStatus], + version_indicator: VersionIndicator + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentSessionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACTIVE = "active" + CREATING = "creating" + DELETED = "deleted" + DELETING = "deleting" + EXPIRED = "expired" + FAILED = "failed" + IDLE = "idle" + UPDATING = "updating" + + + class azure.ai.projects.models.AgentState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "disabled" + ENABLED = "enabled" + + + class azure.ai.projects.models.AgentStateSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT_BLUEPRINT = "agent_blueprint" + AGENT_INSTANCE_IDENTITY = "agent_instance_identity" + + + class azure.ai.projects.models.AgentTaxonomyInput(EvaluationTaxonomyInput, discriminator='agent'): + risk_categories: list[Union[str, RiskCategory]] + target: EvaluationTarget + type: Literal[EvaluationTaxonomyInputType.AGENT] + + @overload + def __init__( + self, + *, + risk_categories: list[Union[str, RiskCategory]], + target: EvaluationTarget + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentVersionDetails(_Model): + agent_guid: Optional[str] + blueprint: Optional[AgentIdentity] + blueprint_reference: Optional[AgentBlueprintReference] + created_at: datetime + definition: AgentDefinition + description: Optional[str] + draft: Optional[bool] + id: str + instance_identity: Optional[AgentIdentity] + metadata: dict[str, str] + name: str + object: Literal[AgentObjectType.AGENT_VERSION] + status: Optional[Union[str, AgentVersionStatus]] + version: str + + @overload + def __init__( + self, + *, + created_at: datetime, + definition: AgentDefinition, + description: Optional[str] = ..., + draft: Optional[bool] = ..., + id: str, + metadata: dict[str, str], + name: str, + object: Literal[AgentObjectType.AGENT_VERSION], + status: Optional[Union[str, AgentVersionStatus]] = ..., + version: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentVersionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACTIVE = "active" + CREATING = "creating" + DELETED = "deleted" + DELETING = "deleting" + FAILED = "failed" class azure.ai.projects.models.AgenticIdentityPreviewCredentials(BaseCredentials, discriminator='AgenticIdentityToken_Preview'): @@ -2844,10 +3284,15 @@ namespace azure.ai.projects.models 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) -> None: ... + def __init__( + self, + *, + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ... + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... @@ -3458,7 +3903,12 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CaptureStructuredOutputsTool(Tool, discriminator='capture_structured_outputs'): + class azure.ai.projects.models.CallableToolAllowedCaller(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DIRECT = "direct" + PROGRAMMATIC = "programmatic" + + + class azure.ai.projects.models.CaptureStructuredOutputsTool(Tool, discriminator='capture_structured_outputs'): description: Optional[str] name: Optional[str] outputs: StructuredOutputDefinition @@ -3606,6 +4056,7 @@ namespace azure.ai.projects.models 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] @@ -3616,6 +4067,7 @@ namespace azure.ai.projects.models def __init__( self, *, + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., container: Optional[Union[str, AutoCodeInterpreterToolParam]] = ..., description: Optional[str] = ..., name: Optional[str] = ..., @@ -3627,6 +4079,7 @@ namespace azure.ai.projects.models class azure.ai.projects.models.CodeInterpreterToolboxTool(ToolboxTool, discriminator='code_interpreter'): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] container: Optional[Union[str, AutoCodeInterpreterToolParam]] description: str name: str @@ -3637,6 +4090,7 @@ namespace azure.ai.projects.models def __init__( self, *, + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., container: Optional[Union[str, AutoCodeInterpreterToolParam]] = ..., description: Optional[str] = ..., name: Optional[str] = ..., @@ -3947,6 +4401,25 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.CreateTranscriptionResponseJsonUsage(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.CreateTranscriptionResponseJsonUsageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DURATION = "duration" + TOKENS = "tokens" + + class azure.ai.projects.models.CredentialType(str, Enum, metaclass=CaseInsensitiveEnumMeta): AGENTIC_IDENTITY_PREVIEW = "AgenticIdentityToken_Preview" API_KEY = "ApiKey" @@ -4035,6 +4508,7 @@ namespace azure.ai.projects.models class azure.ai.projects.models.CustomToolParam(Tool, discriminator='custom'): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] defer_loading: Optional[bool] description: Optional[str] format: Optional[CustomToolParamFormat] @@ -4045,6 +4519,7 @@ namespace azure.ai.projects.models def __init__( self, *, + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., defer_loading: Optional[bool] = ..., description: Optional[str] = ..., format: Optional[CustomToolParamFormat] = ..., @@ -5454,6 +5929,7 @@ namespace azure.ai.projects.models 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] @@ -5464,6 +5940,7 @@ namespace azure.ai.projects.models def __init__( self, *, + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., description: Optional[str] = ..., environment: Optional[FunctionShellToolParamEnvironment] = ..., name: Optional[str] = ..., @@ -5525,9 +6002,11 @@ namespace azure.ai.projects.models class azure.ai.projects.models.FunctionTool(Tool, discriminator='function'): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] 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] @@ -5536,9 +6015,11 @@ namespace azure.ai.projects.models def __init__( self, *, + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., defer_loading: Optional[bool] = ..., description: Optional[str] = ..., name: str, + output_schema: Optional[dict[str, Any]] = ..., parameters: dict[str, Any], strict: bool ) -> None: ... @@ -5548,9 +6029,11 @@ namespace azure.ai.projects.models class azure.ai.projects.models.FunctionToolParam(_Model): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] defer_loading: Optional[bool] description: Optional[str] name: str + output_schema: Optional[dict[str, Any]] parameters: Optional[EmptyModelParam] strict: Optional[bool] type: Literal["function"] @@ -5559,9 +6042,11 @@ namespace azure.ai.projects.models def __init__( self, *, + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., defer_loading: Optional[bool] = ..., description: Optional[str] = ..., name: str, + output_schema: Optional[dict[str, Any]] = ..., parameters: Optional[EmptyModelParam] = ..., strict: Optional[bool] = ... ) -> None: ... @@ -6081,6 +6566,23 @@ namespace azure.ai.projects.models SUCCEEDED = "succeeded" + class azure.ai.projects.models.LlmGeneratedVoiceGreetingConfig(VoiceGreetingConfig, discriminator='llm_generated'): + prompt: str + tool_choice: Optional[VoiceAgentToolChoice] + type: Literal["llm_generated"] + + @overload + def __init__( + self, + *, + prompt: str, + tool_choice: Optional[VoiceAgentToolChoice] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.LocalShellToolParam(Tool, discriminator='local_shell'): description: Optional[str] name: Optional[str] @@ -6118,6 +6620,24 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.LogProbProperties(_Model): + bytes: list[int] + logprob: float + token: str + + @overload + def __init__( + self, + *, + bytes: list[int], + logprob: float, + token: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.LoraConfig(_Model): alpha: Optional[int] dropout: Optional[float] @@ -6138,7 +6658,34 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.MCPListToolsTool(_Model): + annotations: Optional[MCPListToolsToolAnnotations] + description: Optional[str] + input_schema: MCPListToolsToolInputSchema + name: str + + @overload + def __init__( + self, + *, + annotations: Optional[MCPListToolsToolAnnotations] = ..., + description: Optional[str] = ..., + input_schema: MCPListToolsToolInputSchema, + name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.MCPListToolsToolAnnotations(_Model): + + + class azure.ai.projects.models.MCPListToolsToolInputSchema(_Model): + + class azure.ai.projects.models.MCPTool(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"]] @@ -6150,12 +6697,14 @@ namespace azure.ai.projects.models 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, *, + 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]] = ..., @@ -6166,7 +6715,8 @@ namespace azure.ai.projects.models server_description: Optional[str] = ..., server_label: str, server_url: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + tool_configs: Optional[dict[str, ToolConfig]] = ..., + tunnel_id: Optional[str] = ... ) -> None: ... @overload @@ -6206,6 +6756,7 @@ namespace azure.ai.projects.models class azure.ai.projects.models.MCPToolboxTool(ToolboxTool, 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"]] @@ -6219,12 +6770,14 @@ namespace azure.ai.projects.models server_label: str server_url: Optional[str] tool_configs: dict[str, ToolConfig] + tunnel_id: Optional[str] type: Literal[ToolboxToolType.MCP] @overload def __init__( self, *, + 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]] = ..., @@ -6237,7 +6790,8 @@ namespace azure.ai.projects.models server_description: Optional[str] = ..., server_label: str, server_url: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + tool_configs: Optional[dict[str, ToolConfig]] = ..., + tunnel_id: Optional[str] = ... ) -> None: ... @overload @@ -6585,6 +7139,9 @@ namespace azure.ai.projects.models SUPERSEDED = "superseded" + class azure.ai.projects.models.Metadata(_Model): + + class azure.ai.projects.models.MicrosoftFabricPreviewTool(Tool, discriminator='fabric_dataagent_preview'): fabric_dataagent_preview: FabricDataAgentToolParameters type: Literal[ToolType.FABRIC_DATAAGENT_PREVIEW] @@ -6809,6 +7366,64 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.OmitPropertiesRealtimeResponse(_Model): + conversation_id: Optional[str] + id: Optional[str] + max_output_tokens: Optional[Union[int, Literal["inf"]]] + object: Optional[Literal["response"]] + output_modalities: Optional[list[Literal["text", "audio"]]] + status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] + status_details: Optional[RealtimeResponseStatusDetails] + usage: Optional[RealtimeResponseUsage] + + @overload + def __init__( + self, + *, + conversation_id: Optional[str] = ..., + id: Optional[str] = ..., + max_output_tokens: Optional[Union[int, Literal[inf]]] = ..., + object: Optional[Literal[response]] = ..., + output_modalities: Optional[list[Literal[text, audio]]] = ..., + status: Optional[Literal[completed, cancelled, failed, incomplete, in_progress]] = ..., + status_details: Optional[RealtimeResponseStatusDetails] = ..., + usage: Optional[RealtimeResponseUsage] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.OmitPropertiesRealtimeResponse1(_Model): + conversation_id: Optional[str] + id: Optional[str] + max_output_tokens: Optional[Union[int, Literal["inf"]]] + metadata: Optional[Metadata] + object: Optional[Literal["response"]] + output_modalities: Optional[list[Literal["text", "audio"]]] + status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] + status_details: Optional[RealtimeResponseStatusDetails] + usage: Optional[RealtimeResponseUsage] + + @overload + def __init__( + self, + *, + conversation_id: Optional[str] = ..., + id: Optional[str] = ..., + max_output_tokens: Optional[Union[int, Literal[inf]]] = ..., + metadata: Optional[Metadata] = ..., + object: Optional[Literal[response]] = ..., + output_modalities: Optional[list[Literal[text, audio]]] = ..., + status: Optional[Literal[completed, cancelled, failed, incomplete, in_progress]] = ..., + status_details: Optional[RealtimeResponseStatusDetails] = ..., + usage: Optional[RealtimeResponseUsage] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.OneTimeTrigger(Trigger, discriminator='OneTime'): time_zone: Optional[str] trigger_at: datetime @@ -7001,7 +7616,7 @@ namespace azure.ai.projects.models SUCCEEDED = "Succeeded" - class azure.ai.projects.models.OptimizationAgentIdentifier(_Model): + class azure.ai.projects.models.OptimizedAgentIdentifier(_Model): agent_name: str agent_version: Optional[str] @@ -7017,1557 +7632,1632 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OptimizationCandidate(_Model): - avg_score: float - avg_tokens: float - candidate_id: Optional[str] - eval_id: Optional[str] - eval_run_id: Optional[str] - mutations: Optional[dict[str, Any]] - name: str - promotion: Optional[PromotionInfo] + class azure.ai.projects.models.OtlpTelemetryEndpoint(TelemetryEndpoint, discriminator='OTLP'): + auth: TelemetryEndpointAuth + data: Union[list[str, TelemetryDataKind]] + endpoint: str + kind: Literal[TelemetryEndpointKind.OTLP] + protocol: Union[str, TelemetryTransportProtocol] @overload def __init__( self, *, - avg_score: float, - avg_tokens: float, - candidate_id: Optional[str] = ..., - eval_id: Optional[str] = ..., - eval_run_id: Optional[str] = ..., - mutations: Optional[dict[str, Any]] = ..., - name: str, - promotion: Optional[PromotionInfo] = ... + auth: Optional[TelemetryEndpointAuth] = ..., + data: list[Union[str, TelemetryDataKind]], + endpoint: str, + protocol: Union[str, TelemetryTransportProtocol] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OptimizationDatasetCriterion(_Model): - instruction: str - name: str + class azure.ai.projects.models.PageOrder(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ASC = "asc" + DESC = "desc" + + + class azure.ai.projects.models.PendingUploadRequest(_Model): + connection_name: Optional[str] + pending_upload_id: Optional[str] + pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] @overload def __init__( self, *, - instruction: str, - name: str + connection_name: Optional[str] = ..., + pending_upload_id: Optional[str] = ..., + pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OptimizationDatasetInput(_Model): - type: str + class azure.ai.projects.models.PendingUploadResponse(_Model): + blob_reference: BlobReference + pending_upload_id: str + pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] + version: Optional[str] @overload def __init__( self, *, - type: str + blob_reference: BlobReference, + pending_upload_id: str, + pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE], + version: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OptimizationDatasetInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - INLINE = "inline" - REFERENCE = "reference" + class azure.ai.projects.models.PendingUploadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BLOB_REFERENCE = "BlobReference" + NONE = "None" + TEMPORARY_BLOB_REFERENCE = "TemporaryBlobReference" - class azure.ai.projects.models.OptimizationDatasetItem(_Model): - criteria: Optional[list[OptimizationDatasetCriterion]] - desired_num_turns: Optional[int] - ground_truth: Optional[str] - query: Optional[str] + class azure.ai.projects.models.PickPropertiesVoiceAudioConfig(_Model): + output: Optional[VoiceAudioOutputConfig] @overload def __init__( self, *, - criteria: Optional[list[OptimizationDatasetCriterion]] = ..., - desired_num_turns: Optional[int] = ..., - ground_truth: Optional[str] = ..., - query: Optional[str] = ... + output: Optional[VoiceAudioOutputConfig] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OptimizationEvaluatorRef(_Model): - name: str - version: Optional[str] + class azure.ai.projects.models.ProceduralMemoryItem(MemoryItem, discriminator='procedural'): + content: str + kind: Literal[MemoryItemKind.PROCEDURAL] + memory_id: str + scope: str + updated_at: datetime @overload def __init__( self, *, - name: str, - version: Optional[str] = ... + content: str, + memory_id: str, + scope: str, + updated_at: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OptimizationInlineDatasetInput(OptimizationDatasetInput, discriminator='inline'): - dataset_items: list[OptimizationDatasetItem] - type: Literal[OptimizationDatasetInputType.INLINE] + class azure.ai.projects.models.ProgrammaticToolCallingParam(Tool, discriminator='programmatic_tool_calling'): + type: Literal[ToolType.PROGRAMMATIC_TOOL_CALLING] @overload - def __init__( - self, - *, - dataset_items: list[OptimizationDatasetItem] - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OptimizationJob(_Model): - created_at: datetime - error: Optional[ApiError] - id: str - inputs: Optional[OptimizationJobInputs] - progress: Optional[OptimizationJobProgress] - result: Optional[OptimizationJobResult] - status: Union[str, JobStatus] - updated_at: datetime - warnings: Optional[list[str]] + class azure.ai.projects.models.PromotionInfo(_Model): + agent_name: str + agent_version: str + promoted_at: datetime @overload def __init__( self, *, - inputs: Optional[OptimizationJobInputs] = ... + agent_name: str, + agent_version: str, + promoted_at: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OptimizationJobInputs(_Model): - agent: OptimizationAgentIdentifier - evaluators: list[OptimizationEvaluatorRef] - options: Optional[OptimizationOptions] - train_dataset: OptimizationDatasetInput - validation_dataset: Optional[OptimizationDatasetInput] + class azure.ai.projects.models.PromptAgentDefinition(AgentDefinition, discriminator='prompt'): + instructions: Optional[str] + kind: Literal[AgentKind.PROMPT] + model: str + rai_config: RaiConfig + reasoning: Optional[Reasoning] + structured_inputs: Optional[dict[str, StructuredInputDefinition]] + temperature: Optional[float] + text: Optional[PromptAgentDefinitionTextOptions] + tool_choice: Optional[Union[str, ToolChoiceParam]] + tools: Optional[list[Tool]] + top_p: Optional[float] @overload def __init__( self, *, - agent: OptimizationAgentIdentifier, - evaluators: list[OptimizationEvaluatorRef], - options: Optional[OptimizationOptions] = ..., - train_dataset: OptimizationDatasetInput, - validation_dataset: Optional[OptimizationDatasetInput] = ... + instructions: Optional[str] = ..., + model: str, + rai_config: Optional[RaiConfig] = ..., + reasoning: Optional[Reasoning] = ..., + structured_inputs: Optional[dict[str, StructuredInputDefinition]] = ..., + temperature: Optional[float] = ..., + text: Optional[PromptAgentDefinitionTextOptions] = ..., + tool_choice: Optional[Union[str, ToolChoiceParam]] = ..., + tools: Optional[list[Tool]] = ..., + top_p: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OptimizationJobListItem(_Model): - agent: Optional[OptimizationAgentIdentifier] - created_at: datetime - error: Optional[ApiError] - id: str - progress: Optional[OptimizationJobProgress] - status: Union[str, JobStatus] - updated_at: datetime - - - class azure.ai.projects.models.OptimizationJobProgress(_Model): - best_score: float - candidates_completed: int - elapsed_seconds: float + class azure.ai.projects.models.PromptAgentDefinitionTextOptions(_Model): + format: Optional[TextResponseFormat] @overload def __init__( self, *, - best_score: float, - candidates_completed: int, - elapsed_seconds: float + format: Optional[TextResponseFormat] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OptimizationJobResult(_Model): - baseline: Optional[str] - best: Optional[str] - candidates: Optional[list[OptimizationCandidate]] + class azure.ai.projects.models.PromptBasedEvaluatorDefinition(EvaluatorDefinition, discriminator='prompt'): + data_schema: dict[str, any] + init_parameters: dict[str, any] + metrics: dict[str, EvaluatorMetric] + prompt_text: str + type: Literal[EvaluatorDefinitionType.PROMPT] @overload def __init__( self, *, - baseline: Optional[str] = ..., - best: Optional[str] = ..., - candidates: Optional[list[OptimizationCandidate]] = ... + data_schema: Optional[dict[str, Any]] = ..., + init_parameters: Optional[dict[str, Any]] = ..., + metrics: Optional[dict[str, EvaluatorMetric]] = ..., + prompt_text: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OptimizationOptions(_Model): - eval_model: Optional[str] - evaluation_level: Optional[Union[str, EvaluationLevel]] - max_candidates: Optional[int] - max_stalls: Optional[int] - optimization_config: Optional[dict[str, Any]] - optimization_model: Optional[str] + class azure.ai.projects.models.PromptDataGenerationJobSource(DataGenerationJobSource, discriminator='prompt'): + description: str + prompt: str + type: Literal[DataGenerationJobSourceType.PROMPT] @overload def __init__( self, *, - eval_model: Optional[str] = ..., - evaluation_level: Optional[Union[str, EvaluationLevel]] = ..., - max_candidates: Optional[int] = ..., - max_stalls: Optional[int] = ..., - optimization_config: Optional[dict[str, Any]] = ..., - optimization_model: Optional[str] = ... + description: Optional[str] = ..., + prompt: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OptimizationReferenceDatasetInput(OptimizationDatasetInput, discriminator='reference'): - name: str - type: Literal[OptimizationDatasetInputType.REFERENCE] - version: Optional[str] + class azure.ai.projects.models.PromptEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator='prompt'): + description: Optional[str] + prompt: str + type: Literal[EvaluatorGenerationJobSourceType.PROMPT] @overload def __init__( self, *, - name: str, - version: Optional[str] = ... + description: Optional[str] = ..., + prompt: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OtlpTelemetryEndpoint(TelemetryEndpoint, discriminator='OTLP'): - auth: TelemetryEndpointAuth - data: Union[list[str, TelemetryDataKind]] - endpoint: str - kind: Literal[TelemetryEndpointKind.OTLP] - protocol: Union[str, TelemetryTransportProtocol] + class azure.ai.projects.models.ProtocolConfiguration(_Model): + a2a: Optional[A2AProtocolConfiguration] + activity: Optional[ActivityProtocolConfiguration] + invocations: Optional[InvocationsProtocolConfiguration] + invocations_ws: Optional[InvocationsWsProtocolConfiguration] + mcp: Optional[McpProtocolConfiguration] + responses: Optional[ResponsesProtocolConfiguration] @overload def __init__( self, *, - auth: Optional[TelemetryEndpointAuth] = ..., - data: list[Union[str, TelemetryDataKind]], - endpoint: str, - protocol: Union[str, TelemetryTransportProtocol] + a2a: Optional[A2AProtocolConfiguration] = ..., + activity: Optional[ActivityProtocolConfiguration] = ..., + invocations: Optional[InvocationsProtocolConfiguration] = ..., + invocations_ws: Optional[InvocationsWsProtocolConfiguration] = ..., + mcp: Optional[McpProtocolConfiguration] = ..., + responses: Optional[ResponsesProtocolConfiguration] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PageOrder(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ASC = "asc" - DESC = "desc" - - - class azure.ai.projects.models.PendingUploadRequest(_Model): - connection_name: Optional[str] - pending_upload_id: Optional[str] - pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] + class azure.ai.projects.models.ProtocolVersionRecord(_Model): + protocol: Union[str, AgentEndpointProtocol] + version: str @overload def __init__( self, *, - connection_name: Optional[str] = ..., - pending_upload_id: Optional[str] = ..., - pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] + protocol: Union[str, AgentEndpointProtocol], + version: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PendingUploadResponse(_Model): - blob_reference: BlobReference - pending_upload_id: str - pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] - version: Optional[str] + class azure.ai.projects.models.RaiConfig(_Model): + rai_policy_name: str @overload def __init__( self, *, - blob_reference: BlobReference, - pending_upload_id: str, - pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE], - version: Optional[str] = ... + rai_policy_name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PendingUploadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - BLOB_REFERENCE = "BlobReference" - NONE = "None" - TEMPORARY_BLOB_REFERENCE = "TemporaryBlobReference" + class azure.ai.projects.models.RankerVersionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "auto" + DEFAULT_2024_11_15 = "default-2024-11-15" - class azure.ai.projects.models.ProceduralMemoryItem(MemoryItem, discriminator='procedural'): - content: str - kind: Literal[MemoryItemKind.PROCEDURAL] - memory_id: str - scope: str - updated_at: datetime + class azure.ai.projects.models.RankingOptions(_Model): + hybrid_search: Optional[HybridSearchOptions] + ranker: Optional[Union[str, RankerVersionType]] + score_threshold: Optional[float] @overload def __init__( self, *, - content: str, - memory_id: str, - scope: str, - updated_at: datetime + hybrid_search: Optional[HybridSearchOptions] = ..., + ranker: Optional[Union[str, RankerVersionType]] = ..., + score_threshold: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PromotionInfo(_Model): - agent_name: str - agent_version: str - promoted_at: datetime + class azure.ai.projects.models.RealtimeAudioFormats(_Model): + type: str @overload def __init__( self, *, - agent_name: str, - agent_version: str, - promoted_at: datetime + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PromptAgentDefinition(AgentDefinition, discriminator='prompt'): - instructions: Optional[str] - kind: Literal[AgentKind.PROMPT] - model: str - rai_config: RaiConfig - reasoning: Optional[Reasoning] - structured_inputs: Optional[dict[str, StructuredInputDefinition]] - temperature: Optional[float] - text: Optional[PromptAgentDefinitionTextOptions] - tool_choice: Optional[Union[str, ToolChoiceParam]] - tools: Optional[list[Tool]] - top_p: Optional[float] + class azure.ai.projects.models.RealtimeAudioFormatsAudioPcm(RealtimeAudioFormats, discriminator='audio/pcm'): + rate: Optional[Literal[24000]] + type: Literal[RealtimeAudioFormatsType.AUDIO_PCM] @overload def __init__( self, *, - instructions: Optional[str] = ..., - model: str, - rai_config: Optional[RaiConfig] = ..., - reasoning: Optional[Reasoning] = ..., - structured_inputs: Optional[dict[str, StructuredInputDefinition]] = ..., - temperature: Optional[float] = ..., - text: Optional[PromptAgentDefinitionTextOptions] = ..., - tool_choice: Optional[Union[str, ToolChoiceParam]] = ..., - tools: Optional[list[Tool]] = ..., - top_p: Optional[float] = ... + rate: Optional[Literal[24000]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PromptAgentDefinitionTextOptions(_Model): - format: Optional[TextResponseFormat] + class azure.ai.projects.models.RealtimeAudioFormatsAudioPcma(RealtimeAudioFormats, discriminator='audio/pcma'): + type: Literal[RealtimeAudioFormatsType.AUDIO_PCMA] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeAudioFormatsAudioPcmu(RealtimeAudioFormats, discriminator='audio/pcmu'): + type: Literal[RealtimeAudioFormatsType.AUDIO_PCMU] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeAudioFormatsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUDIO_PCM = "audio/pcm" + AUDIO_PCMA = "audio/pcma" + AUDIO_PCMU = "audio/pcmu" + + + class azure.ai.projects.models.RealtimeClientEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONVERSATION_ITEM_CREATE = "conversation.item.create" + CONVERSATION_ITEM_DELETE = "conversation.item.delete" + CONVERSATION_ITEM_RETRIEVE = "conversation.item.retrieve" + CONVERSATION_ITEM_TRUNCATE = "conversation.item.truncate" + INPUT_AUDIO_BUFFER_APPEND = "input_audio_buffer.append" + INPUT_AUDIO_BUFFER_CLEAR = "input_audio_buffer.clear" + INPUT_AUDIO_BUFFER_COMMIT = "input_audio_buffer.commit" + OUTPUT_AUDIO_BUFFER_CLEAR = "output_audio_buffer.clear" + RESPONSE_CANCEL = "response.cancel" + RESPONSE_CREATE = "response.create" + SESSION_UPDATE = "session.update" + + + class azure.ai.projects.models.RealtimeConversationItem(_Model): + type: str @overload def __init__( self, *, - format: Optional[TextResponseFormat] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PromptBasedEvaluatorDefinition(EvaluatorDefinition, discriminator='prompt'): - data_schema: dict[str, any] - init_parameters: dict[str, any] - metrics: dict[str, EvaluatorMetric] - prompt_text: str - type: Literal[EvaluatorDefinitionType.PROMPT] + class azure.ai.projects.models.RealtimeConversationItemFunctionCall(RealtimeConversationItem, discriminator='function_call'): + arguments: str + call_id: Optional[str] + id: Optional[str] + name: str + object: Optional[Literal["item"]] + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Literal[RealtimeConversationItemType.FUNCTION_CALL] @overload def __init__( self, *, - data_schema: Optional[dict[str, Any]] = ..., - init_parameters: Optional[dict[str, Any]] = ..., - metrics: Optional[dict[str, EvaluatorMetric]] = ..., - prompt_text: str + arguments: str, + call_id: Optional[str] = ..., + id: Optional[str] = ..., + name: str, + object: Optional[Literal[item]] = ..., + status: Optional[Literal[completed, incomplete, in_progress]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PromptDataGenerationJobSource(DataGenerationJobSource, discriminator='prompt'): - description: str - prompt: str - type: Literal[DataGenerationJobSourceType.PROMPT] + class azure.ai.projects.models.RealtimeConversationItemFunctionCallOutput(RealtimeConversationItem, discriminator='function_call_output'): + call_id: str + id: Optional[str] + object: Optional[Literal["item"]] + output: str + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT] @overload def __init__( self, *, - description: Optional[str] = ..., - prompt: str + call_id: str, + id: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + output: str, + status: Optional[Literal[completed, incomplete, in_progress]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PromptEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator='prompt'): - description: Optional[str] - prompt: str - type: Literal[EvaluatorGenerationJobSourceType.PROMPT] + class azure.ai.projects.models.RealtimeConversationItemMessage(_Model): + role: str @overload def __init__( self, *, - description: Optional[str] = ..., - prompt: str + role: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ProtocolConfiguration(_Model): - a2a: Optional[A2AProtocolConfiguration] - activity: Optional[ActivityProtocolConfiguration] - invocations: Optional[InvocationsProtocolConfiguration] - invocations_ws: Optional[InvocationsWsProtocolConfiguration] - mcp: Optional[McpProtocolConfiguration] - responses: Optional[ResponsesProtocolConfiguration] + class azure.ai.projects.models.RealtimeConversationItemMessageAssistant(RealtimeConversationItemMessage, discriminator='assistant'): + content: list[RealtimeConversationItemMessageAssistantContent] + id: Optional[str] + object: Optional[Literal["item"]] + role: Literal[RealtimeConversationItemMessageType.ASSISTANT] + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Literal["message"] @overload def __init__( self, *, - a2a: Optional[A2AProtocolConfiguration] = ..., - activity: Optional[ActivityProtocolConfiguration] = ..., - invocations: Optional[InvocationsProtocolConfiguration] = ..., - invocations_ws: Optional[InvocationsWsProtocolConfiguration] = ..., - mcp: Optional[McpProtocolConfiguration] = ..., - responses: Optional[ResponsesProtocolConfiguration] = ... + content: list[RealtimeConversationItemMessageAssistantContent], + id: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + status: Optional[Literal[completed, incomplete, in_progress]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ProtocolVersionRecord(_Model): - protocol: Union[str, AgentEndpointProtocol] - version: str + class azure.ai.projects.models.RealtimeConversationItemMessageAssistantContent(_Model): + audio: Optional[str] + text: Optional[str] + transcript: Optional[str] + type: Optional[Literal["output_text", "output_audio"]] @overload def __init__( self, *, - protocol: Union[str, AgentEndpointProtocol], - version: str + audio: Optional[str] = ..., + text: Optional[str] = ..., + transcript: Optional[str] = ..., + type: Optional[Literal[output_text, output_audio]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RaiConfig(_Model): - rai_policy_name: str + class azure.ai.projects.models.RealtimeConversationItemMessageSystem(RealtimeConversationItemMessage, discriminator='system'): + content: list[RealtimeConversationItemMessageSystemContent] + id: Optional[str] + object: Optional[Literal["item"]] + role: Literal[RealtimeConversationItemMessageType.SYSTEM] + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Literal["message"] @overload def __init__( self, *, - rai_policy_name: str + content: list[RealtimeConversationItemMessageSystemContent], + id: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + status: Optional[Literal[completed, incomplete, in_progress]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RankerVersionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AUTO = "auto" - DEFAULT_2024_11_15 = "default-2024-11-15" - - - class azure.ai.projects.models.RankingOptions(_Model): - hybrid_search: Optional[HybridSearchOptions] - ranker: Optional[Union[str, RankerVersionType]] - score_threshold: Optional[float] + class azure.ai.projects.models.RealtimeConversationItemMessageSystemContent(_Model): + text: Optional[str] + type: Optional[Literal["input_text"]] @overload def __init__( self, *, - hybrid_search: Optional[HybridSearchOptions] = ..., - ranker: Optional[Union[str, RankerVersionType]] = ..., - score_threshold: Optional[float] = ... + text: Optional[str] = ..., + type: Optional[Literal[input_text]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.Reasoning(_Model): - effort: Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]] - generate_summary: Optional[Literal["auto", "concise", "detailed"]] - summary: Optional[Literal["auto", "concise", "detailed"]] + class azure.ai.projects.models.RealtimeConversationItemMessageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ASSISTANT = "assistant" + SYSTEM = "system" + USER = "user" + + + class azure.ai.projects.models.RealtimeConversationItemMessageUser(RealtimeConversationItemMessage, discriminator='user'): + content: list[RealtimeConversationItemMessageUserContent] + id: Optional[str] + object: Optional[Literal["item"]] + role: Literal[RealtimeConversationItemMessageType.USER] + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Literal["message"] @overload def __init__( self, *, - effort: Optional[Literal[none, minimal, low, medium, high, xhigh]] = ..., - generate_summary: Optional[Literal[auto, concise, detailed]] = ..., - summary: Optional[Literal[auto, concise, detailed]] = ... + content: list[RealtimeConversationItemMessageUserContent], + id: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + status: Optional[Literal[completed, incomplete, in_progress]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RecurrenceSchedule(_Model): - type: str + class azure.ai.projects.models.RealtimeConversationItemMessageUserContent(_Model): + audio: Optional[str] + detail: Optional[Literal["auto", "low", "high"]] + image_url: Optional[str] + text: Optional[str] + transcript: Optional[str] + type: Optional[Literal["input_text", "input_audio", "input_image"]] @overload def __init__( self, *, - type: str + audio: Optional[str] = ..., + detail: Optional[Literal[auto, low, high]] = ..., + image_url: Optional[str] = ..., + text: Optional[str] = ..., + transcript: Optional[str] = ..., + type: Optional[Literal[input_text, input_audio, input_image]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RecurrenceTrigger(Trigger, discriminator='Recurrence'): - end_time: Optional[datetime] - interval: int - schedule: RecurrenceSchedule - start_time: Optional[datetime] - time_zone: Optional[str] - type: Literal[TriggerType.RECURRENCE] + class azure.ai.projects.models.RealtimeConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FUNCTION_CALL = "function_call" + FUNCTION_CALL_OUTPUT = "function_call_output" + MCP_APPROVAL_REQUEST = "mcp_approval_request" + MCP_APPROVAL_RESPONSE = "mcp_approval_response" + MCP_CALL = "mcp_call" + MCP_LIST_TOOLS = "mcp_list_tools" + + + class azure.ai.projects.models.RealtimeFunctionTool(_Model): + description: Optional[str] + name: Optional[str] + parameters: Optional[RealtimeFunctionToolParameters] + type: Optional[Literal["function"]] @overload def __init__( self, *, - end_time: Optional[datetime] = ..., - interval: int, - schedule: RecurrenceSchedule, - start_time: Optional[datetime] = ..., - time_zone: Optional[str] = ... + description: Optional[str] = ..., + name: Optional[str] = ..., + parameters: Optional[RealtimeFunctionToolParameters] = ..., + type: Optional[Literal[function]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RecurrenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DAILY = "Daily" - HOURLY = "Hourly" - MONTHLY = "Monthly" - WEEKLY = "Weekly" + class azure.ai.projects.models.RealtimeFunctionToolParameters(_Model): - class azure.ai.projects.models.RedTeam(_Model): - application_scenario: Optional[str] - attack_strategies: Optional[list[Union[str, AttackStrategy]]] - display_name: Optional[str] + class azure.ai.projects.models.RealtimeMCPApprovalRequest(RealtimeConversationItem, discriminator='mcp_approval_request'): + arguments: str + id: str name: str - num_turns: Optional[int] - properties: Optional[dict[str, str]] - risk_categories: Optional[list[Union[str, RiskCategory]]] - simulation_only: Optional[bool] - status: Optional[str] - tags: Optional[dict[str, str]] - target: RedTeamTargetConfig + server_label: str + type: Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST] @overload def __init__( self, *, - application_scenario: Optional[str] = ..., - attack_strategies: Optional[list[Union[str, AttackStrategy]]] = ..., - display_name: Optional[str] = ..., - num_turns: Optional[int] = ..., - properties: Optional[dict[str, str]] = ..., - risk_categories: Optional[list[Union[str, RiskCategory]]] = ..., - simulation_only: Optional[bool] = ..., - tags: Optional[dict[str, str]] = ..., - target: RedTeamTargetConfig + arguments: str, + id: str, + name: str, + server_label: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RedTeamEvalRunDataSource(TypedDict, total=False): - key "item_generation_params": Required[Any] - key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] - key "type": Required[Literal["azure_ai_red_team"]] - - - class azure.ai.projects.models.RedTeamTargetConfig(_Model): - type: str + class azure.ai.projects.models.RealtimeMCPApprovalResponse(RealtimeConversationItem, discriminator='mcp_approval_response'): + approval_request_id: str + approve: bool + id: str + reason: Optional[str] + type: Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE] @overload def __init__( self, *, - type: str + approval_request_id: str, + approve: bool, + id: str, + reason: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ReminderPreviewToolboxTool(ToolboxTool, discriminator='reminder_preview'): - description: str - name: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.REMINDER_PREVIEW] + class azure.ai.projects.models.RealtimeMCPError(_Model): + type: str @overload def __init__( self, *, - description: Optional[str] = ..., - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ResponseRetrievalItemGenerationParams(TypedDict, total=False): - key "data_mapping": Required[Dict[str, str]] - key "max_num_turns": int - key "source": Required[Union[SourceFileContent, SourceFileID]] - key "type": Required[Literal["response_retrieval"]] - - - class azure.ai.projects.models.ResponseUsageInputTokensDetails(_Model): - cached_tokens: int + class azure.ai.projects.models.RealtimeMCPHTTPError(RealtimeMCPError, discriminator='http_error'): + code: int + message: str + type: Literal[RealtimeMcpErrorType.HTTP_ERROR] @overload def __init__( self, *, - cached_tokens: int + code: int, + message: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ResponseUsageOutputTokensDetails(_Model): - reasoning_tokens: int + class azure.ai.projects.models.RealtimeMCPListTools(RealtimeConversationItem, discriminator='mcp_list_tools'): + id: Optional[str] + server_label: str + tools: list[MCPListToolsTool] + type: Literal[RealtimeConversationItemType.MCP_LIST_TOOLS] @overload def __init__( self, *, - reasoning_tokens: int + id: Optional[str] = ..., + server_label: str, + tools: list[MCPListToolsTool] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ResponsesProtocolConfiguration(_Model): - - - class azure.ai.projects.models.RiskCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CODE_VULNERABILITY = "CodeVulnerability" - HATE_UNFAIRNESS = "HateUnfairness" - PROHIBITED_ACTIONS = "ProhibitedActions" - PROTECTED_MATERIAL = "ProtectedMaterial" - SELF_HARM = "SelfHarm" - SENSITIVE_DATA_LEAKAGE = "SensitiveDataLeakage" - SEXUAL = "Sexual" - TASK_ADHERENCE = "TaskAdherence" - UNGROUNDED_ATTRIBUTES = "UngroundedAttributes" - VIOLENCE = "Violence" - - - class azure.ai.projects.models.Routine(_Model): - action: Optional[RoutineAction] - created_at: Optional[datetime] - description: Optional[str] - enabled: bool - name: Optional[str] - triggers: Optional[dict[str, RoutineTrigger]] - updated_at: Optional[datetime] + class azure.ai.projects.models.RealtimeMCPProtocolError(RealtimeMCPError, discriminator='protocol_error'): + code: int + message: str + type: Literal[RealtimeMcpErrorType.PROTOCOL_ERROR] @overload def __init__( self, *, - action: Optional[RoutineAction] = ..., - created_at: Optional[datetime] = ..., - description: Optional[str] = ..., - enabled: bool, - name: Optional[str] = ..., - triggers: Optional[dict[str, RoutineTrigger]] = ..., - updated_at: Optional[datetime] = ... + code: int, + message: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RoutineAction(_Model): - type: str + class azure.ai.projects.models.RealtimeMCPToolCall(RealtimeConversationItem, discriminator='mcp_call'): + approval_request_id: Optional[str] + arguments: str + error: Optional[RealtimeMCPError] + id: str + name: str + output: Optional[str] + server_label: str + type: Literal[RealtimeConversationItemType.MCP_CALL] @overload def __init__( self, *, - type: str + approval_request_id: Optional[str] = ..., + arguments: str, + error: Optional[RealtimeMCPError] = ..., + id: str, + name: str, + output: Optional[str] = ..., + server_label: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RoutineActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - INVOKE_AGENT_INVOCATIONS_API = "invoke_agent_invocations_api" - INVOKE_AGENT_RESPONSES_API = "invoke_agent_responses_api" - - - class azure.ai.projects.models.RoutineAttemptSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): - EVENT_FIRE = "event_fire" - MANUAL_DISPATCH = "manual_dispatch" - QUEUED_DISPATCH = "queued_dispatch" - SCHEDULE_DELIVERY = "schedule_delivery" - TIMER_DELIVERY = "timer_delivery" - - - class azure.ai.projects.models.RoutineDispatchPayload(_Model): - type: str + class azure.ai.projects.models.RealtimeMCPToolExecutionError(RealtimeMCPError, discriminator='tool_execution_error'): + message: str + type: Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR] @overload def __init__( self, *, - type: str + message: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RoutineDispatchPayloadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - INVOKE_AGENT_INVOCATIONS_API = "invoke_agent_invocations_api" - INVOKE_AGENT_RESPONSES_API = "invoke_agent_responses_api" + class azure.ai.projects.models.RealtimeMcpErrorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HTTP_ERROR = "http_error" + PROTOCOL_ERROR = "protocol_error" + TOOL_EXECUTION_ERROR = "tool_execution_error" - class azure.ai.projects.models.RoutineRun(_Model): - action_correlation_id: Optional[str] - action_type: Optional[Union[str, RoutineActionType]] - agent_endpoint_id: Optional[str] - agent_id: Optional[str] - attempt_source: Optional[Union[str, RoutineAttemptSource]] - conversation_id: Optional[str] - dispatch_id: Optional[str] - ended_at: Optional[datetime] - error_message: Optional[str] - error_status_code: Optional[int] - error_type: Optional[str] - id: str - phase: Optional[Union[str, RoutineRunPhase]] - response_id: Optional[str] - scheduled_fire_at: Optional[datetime] - session_id: Optional[str] - started_at: Optional[datetime] - status: Optional[RoutineRunStatus] - task_id: Optional[str] - trigger_event_payload: Optional[dict[str, Any]] - trigger_name: Optional[str] - trigger_type: Optional[Union[str, RoutineTriggerType]] - triggered_at: Optional[datetime] + class azure.ai.projects.models.RealtimeReasoning(_Model): + effort: Optional[Union[str, RealtimeReasoningEffort]] @overload def __init__( self, *, - action_correlation_id: Optional[str] = ..., - action_type: Optional[Union[str, RoutineActionType]] = ..., - agent_endpoint_id: Optional[str] = ..., - agent_id: Optional[str] = ..., - attempt_source: Optional[Union[str, RoutineAttemptSource]] = ..., - conversation_id: Optional[str] = ..., - dispatch_id: Optional[str] = ..., - ended_at: Optional[datetime] = ..., - error_message: Optional[str] = ..., - error_status_code: Optional[int] = ..., - error_type: Optional[str] = ..., - phase: Optional[Union[str, RoutineRunPhase]] = ..., - response_id: Optional[str] = ..., - scheduled_fire_at: Optional[datetime] = ..., - session_id: Optional[str] = ..., - started_at: Optional[datetime] = ..., - status: Optional[RoutineRunStatus] = ..., - task_id: Optional[str] = ..., - trigger_event_payload: Optional[dict[str, Any]] = ..., - trigger_name: Optional[str] = ..., - trigger_type: Optional[Union[str, RoutineTriggerType]] = ..., - triggered_at: Optional[datetime] = ... + effort: Optional[Union[str, RealtimeReasoningEffort]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RoutineRunPhase(str, Enum, metaclass=CaseInsensitiveEnumMeta): - COMPLETED = "completed" - DISPATCHING = "dispatching" - FAILED = "failed" - QUEUED = "queued" + class azure.ai.projects.models.RealtimeReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HIGH = "high" + LOW = "low" + MEDIUM = "medium" + MINIMAL = "minimal" + XHIGH = "xhigh" - class azure.ai.projects.models.RoutineTrigger(_Model): - type: str + class azure.ai.projects.models.RealtimeResponseStatusDetails(_Model): + error: Optional[RealtimeResponseStatusDetailsError] + reason: Optional[Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"]] + type: Optional[Literal["completed", "cancelled", "failed", "incomplete"]] @overload def __init__( self, *, - type: str + error: Optional[RealtimeResponseStatusDetailsError] = ..., + reason: Optional[Literal[turn_detected, client_cancelled, max_output_tokens, content_filter]] = ..., + type: Optional[Literal[completed, cancelled, failed, incomplete]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RoutineTriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CUSTOM = "custom" - GITHUB_ISSUE = "github_issue" - SCHEDULE = "schedule" - TIMER = "timer" - - - class azure.ai.projects.models.RubricBasedEvaluatorDefinition(EvaluatorDefinition, discriminator='rubric'): - data_schema: dict[str, any] - dimensions: list[Dimension] - init_parameters: dict[str, any] - metrics: dict[str, EvaluatorMetric] - pass_threshold: Optional[float] - type: Literal[EvaluatorDefinitionType.RUBRIC] + class azure.ai.projects.models.RealtimeResponseStatusDetailsError(_Model): + code: Optional[str] + type: Optional[str] @overload def __init__( self, *, - data_schema: Optional[dict[str, Any]] = ..., - dimensions: list[Dimension], - init_parameters: Optional[dict[str, Any]] = ..., - metrics: Optional[dict[str, EvaluatorMetric]] = ..., - pass_threshold: Optional[float] = ... + code: Optional[str] = ..., + type: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RubricGenerationInputQualityWarning(_Model): - code: Union[str, RubricGenerationInputQualityWarningCode] - message: str - severity: Union[str, RubricGenerationInputQualityWarningSeverity] - source: Union[str, RubricGenerationInputQualityWarningSource] - source_index: Optional[int] + class azure.ai.projects.models.RealtimeResponseUsage(_Model): + input_token_details: Optional[RealtimeResponseUsageInputTokenDetails] + input_tokens: Optional[int] + output_token_details: Optional[RealtimeResponseUsageOutputTokenDetails] + output_tokens: Optional[int] + total_tokens: Optional[int] @overload def __init__( self, *, - code: Union[str, RubricGenerationInputQualityWarningCode], - message: str, - severity: Union[str, RubricGenerationInputQualityWarningSeverity], - source: Union[str, RubricGenerationInputQualityWarningSource], - source_index: Optional[int] = ... + input_token_details: Optional[RealtimeResponseUsageInputTokenDetails] = ..., + input_tokens: Optional[int] = ..., + output_token_details: Optional[RealtimeResponseUsageOutputTokenDetails] = ..., + output_tokens: Optional[int] = ..., + total_tokens: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RubricGenerationInputQualityWarningCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - EMPTY_AGENT_INSTRUCTIONS = "empty_agent_instructions" - EMPTY_DATASET_CONTENT = "empty_dataset_content" - EMPTY_PROMPT = "empty_prompt" - INSUFFICIENT_TOTAL_INPUT = "insufficient_total_input" - LOW_TRACE_COUNT = "low_trace_count" - SHORT_AGENT_INSTRUCTIONS = "short_agent_instructions" - SHORT_DATASET_CONTENT = "short_dataset_content" - SHORT_PROMPT = "short_prompt" - - - class azure.ai.projects.models.RubricGenerationInputQualityWarningSeverity(str, Enum, metaclass=CaseInsensitiveEnumMeta): - WARNING = "warning" + class azure.ai.projects.models.RealtimeResponseUsageInputTokenDetails(_Model): + audio_tokens: Optional[int] + cached_tokens: Optional[int] + cached_tokens_details: Optional[RealtimeResponseUsageInputTokenDetailsCachedTokensDetails] + image_tokens: Optional[int] + text_tokens: Optional[int] + @overload + def __init__( + self, + *, + audio_tokens: Optional[int] = ..., + cached_tokens: Optional[int] = ..., + cached_tokens_details: Optional[RealtimeResponseUsageInputTokenDetailsCachedTokensDetails] = ..., + image_tokens: Optional[int] = ..., + text_tokens: Optional[int] = ... + ) -> None: ... - class azure.ai.projects.models.RubricGenerationInputQualityWarningSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENT = "agent" - AGGREGATE = "aggregate" - DATASET = "dataset" - PROMPT = "prompt" + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SASCredentials(BaseCredentials, discriminator='SAS'): - sas_token: Optional[str] - type: Literal[CredentialType.SAS] + class azure.ai.projects.models.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails(_Model): + audio_tokens: Optional[int] + image_tokens: Optional[int] + text_tokens: Optional[int] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + audio_tokens: Optional[int] = ..., + image_tokens: Optional[int] = ..., + text_tokens: Optional[int] = ... + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SampleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - EVALUATION_RESULT_SAMPLE = "EvaluationResultSample" - - - class azure.ai.projects.models.Schedule(_Model): - description: Optional[str] - display_name: Optional[str] - enabled: bool - properties: Optional[dict[str, str]] - provisioning_status: Optional[Union[str, ScheduleProvisioningStatus]] - schedule_id: str - system_data: dict[str, str] - tags: Optional[dict[str, str]] - task: ScheduleTask - trigger: Trigger + class azure.ai.projects.models.RealtimeResponseUsageOutputTokenDetails(_Model): + audio_tokens: Optional[int] + text_tokens: Optional[int] @overload def __init__( self, *, - description: Optional[str] = ..., - display_name: Optional[str] = ..., - enabled: bool, - properties: Optional[dict[str, str]] = ..., - tags: Optional[dict[str, str]] = ..., - task: ScheduleTask, - trigger: Trigger + audio_tokens: Optional[int] = ..., + text_tokens: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ScheduleProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CREATING = "Creating" - DELETING = "Deleting" - FAILED = "Failed" - SUCCEEDED = "Succeeded" - UPDATING = "Updating" - - - class azure.ai.projects.models.ScheduleRoutineTrigger(RoutineTrigger, discriminator='schedule'): - cron_expression: str - time_zone: str - type: Literal[RoutineTriggerType.SCHEDULE] + class azure.ai.projects.models.RealtimeServerEvent(_Model): + type: str @overload def __init__( self, *, - cron_expression: str, - time_zone: str + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ScheduleRun(_Model): - error: Optional[str] - properties: dict[str, str] - run_id: str - schedule_id: str - success: bool - trigger_time: Optional[datetime] + class azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError(_Model): + code: Optional[str] + message: Optional[str] + param: Optional[str] + type: Optional[str] @overload def __init__( self, *, - schedule_id: str, - trigger_time: Optional[datetime] = ... + code: Optional[str] = ..., + message: Optional[str] = ..., + param: Optional[str] = ..., + type: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ScheduleTask(_Model): - configuration: Optional[dict[str, str]] - type: str + class azure.ai.projects.models.RealtimeServerEventError(_Model): + error: RealtimeServerEventErrorError + event_id: str + type: Literal["error"] @overload def __init__( self, *, - configuration: Optional[dict[str, str]] = ..., - type: str + error: RealtimeServerEventErrorError, + event_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ScheduleTaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - EVALUATION = "Evaluation" - INSIGHT = "Insight" - - - class azure.ai.projects.models.SearchContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - IMAGE = "image" - TEXT = "text" - - - class azure.ai.projects.models.SearchContextSize(str, Enum, metaclass=CaseInsensitiveEnumMeta): - HIGH = "high" - LOW = "low" - MEDIUM = "medium" - - - class azure.ai.projects.models.SessionDirectoryEntry(_Model): - is_directory: bool - modified_time: datetime - name: str - size: int + class azure.ai.projects.models.RealtimeServerEventErrorError(_Model): + code: Optional[str] + event_id: Optional[str] + message: str + param: Optional[str] + type: str @overload def __init__( self, *, - is_directory: bool, - modified_time: datetime, - name: str, - size: int + code: Optional[str] = ..., + event_id: Optional[str] = ..., + message: str, + param: Optional[str] = ..., + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SessionFileWriteResult(_Model): - bytes_written: int - path: str + class azure.ai.projects.models.RealtimeServerEventRateLimitsUpdatedRateLimits(_Model): + limit: Optional[int] + name: Optional[Literal["requests", "tokens"]] + remaining: Optional[int] + reset_seconds: Optional[float] @overload def __init__( self, *, - bytes_written: int, - path: str + limit: Optional[int] = ..., + name: Optional[Literal[requests, tokens]] = ..., + remaining: Optional[int] = ..., + reset_seconds: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SessionLogEvent(_Model): - data: str - event: Union[str, SessionLogEventType] + class azure.ai.projects.models.RealtimeServerEventResponseContentPartAdded(RealtimeServerEvent, discriminator='response.content_part.added'): + content_index: int + event_id: str + item_id: str + output_index: int + part: RealtimeServerEventResponseContentPartAddedPart + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED] @overload def __init__( self, *, - data: str, - event: Union[str, SessionLogEventType] + content_index: int, + event_id: str, + item_id: str, + output_index: int, + part: RealtimeServerEventResponseContentPartAddedPart, + response_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SessionLogEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - LOG = "log" - - - class azure.ai.projects.models.SharepointGroundingToolParameters(_Model): - project_connections: Optional[list[ToolProjectConnection]] + class azure.ai.projects.models.RealtimeServerEventResponseContentPartAddedPart(_Model): + audio: Optional[str] + text: Optional[str] + transcript: Optional[str] + type: Optional[Literal["audio", "text"]] @overload def __init__( self, *, - project_connections: Optional[list[ToolProjectConnection]] = ... + audio: Optional[str] = ..., + text: Optional[str] = ..., + transcript: Optional[str] = ..., + type: Optional[Literal[audio, text]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SharepointPreviewTool(Tool, discriminator='sharepoint_grounding_preview'): - sharepoint_grounding_preview: SharepointGroundingToolParameters - type: Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW] + class azure.ai.projects.models.RealtimeServerEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONVERSATION_CREATED = "conversation.created" + CONVERSATION_ITEM_ADDED = "conversation.item.added" + CONVERSATION_ITEM_CREATED = "conversation.item.created" + CONVERSATION_ITEM_DELETED = "conversation.item.deleted" + CONVERSATION_ITEM_DONE = "conversation.item.done" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED = "conversation.item.input_audio_transcription.completed" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA = "conversation.item.input_audio_transcription.delta" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED = "conversation.item.input_audio_transcription.failed" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT = "conversation.item.input_audio_transcription.segment" + CONVERSATION_ITEM_RETRIEVED = "conversation.item.retrieved" + CONVERSATION_ITEM_TRUNCATED = "conversation.item.truncated" + ERROR = "error" + INPUT_AUDIO_BUFFER_CLEARED = "input_audio_buffer.cleared" + INPUT_AUDIO_BUFFER_COMMITTED = "input_audio_buffer.committed" + INPUT_AUDIO_BUFFER_DTMF_EVENT_RECEIVED = "input_audio_buffer.dtmf_event_received" + INPUT_AUDIO_BUFFER_SPEECH_STARTED = "input_audio_buffer.speech_started" + INPUT_AUDIO_BUFFER_SPEECH_STOPPED = "input_audio_buffer.speech_stopped" + INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED = "input_audio_buffer.timeout_triggered" + MCP_LIST_TOOLS_COMPLETED = "mcp_list_tools.completed" + MCP_LIST_TOOLS_FAILED = "mcp_list_tools.failed" + MCP_LIST_TOOLS_IN_PROGRESS = "mcp_list_tools.in_progress" + OUTPUT_AUDIO_BUFFER_CLEARED = "output_audio_buffer.cleared" + OUTPUT_AUDIO_BUFFER_STARTED = "output_audio_buffer.started" + OUTPUT_AUDIO_BUFFER_STOPPED = "output_audio_buffer.stopped" + RATE_LIMITS_UPDATED = "rate_limits.updated" + RESPONSE_CONTENT_PART_ADDED = "response.content_part.added" + RESPONSE_CONTENT_PART_DONE = "response.content_part.done" + RESPONSE_CREATED = "response.created" + RESPONSE_DONE = "response.done" + RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA = "response.function_call_arguments.delta" + RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE = "response.function_call_arguments.done" + RESPONSE_MCP_CALL_ARGUMENTS_DELTA = "response.mcp_call_arguments.delta" + RESPONSE_MCP_CALL_ARGUMENTS_DONE = "response.mcp_call_arguments.done" + RESPONSE_MCP_CALL_COMPLETED = "response.mcp_call.completed" + RESPONSE_MCP_CALL_FAILED = "response.mcp_call.failed" + RESPONSE_MCP_CALL_IN_PROGRESS = "response.mcp_call.in_progress" + RESPONSE_OUTPUT_AUDIO_DELTA = "response.output_audio.delta" + RESPONSE_OUTPUT_AUDIO_DONE = "response.output_audio.done" + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA = "response.output_audio_transcript.delta" + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE = "response.output_audio_transcript.done" + RESPONSE_OUTPUT_ITEM_ADDED = "response.output_item.added" + RESPONSE_OUTPUT_ITEM_DONE = "response.output_item.done" + RESPONSE_OUTPUT_TEXT_DELTA = "response.output_text.delta" + RESPONSE_OUTPUT_TEXT_DONE = "response.output_text.done" + SESSION_CREATED = "session.created" + SESSION_UPDATED = "session.updated" + + + class azure.ai.projects.models.Reasoning(_Model): + context: Optional[Literal["auto", "current_turn", "all_turns"]] + effort: Optional[Union[str, ReasoningEffort]] + generate_summary: Optional[Literal["auto", "concise", "detailed"]] + mode: Optional[Union[str, ReasoningModeEnum]] + summary: Optional[Literal["auto", "concise", "detailed"]] @overload def __init__( self, *, - sharepoint_grounding_preview: SharepointGroundingToolParameters + context: Optional[Literal[auto, current_turn, all_turns]] = ..., + effort: Optional[Union[str, ReasoningEffort]] = ..., + generate_summary: Optional[Literal[auto, concise, detailed]] = ..., + mode: Optional[Union[str, ReasoningModeEnum]] = ..., + summary: Optional[Literal[auto, concise, detailed]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SimpleQnADataGenerationJobOptions(DataGenerationJobOptions, discriminator='simple_qna'): - max_samples: int - model_options: DataGenerationModelOptions - question_types: Optional[list[Union[str, SimpleQnAFineTuningQuestionType]]] - train_split: float - type: Literal[DataGenerationJobType.SIMPLE_QNA] + class azure.ai.projects.models.ReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HIGH = "high" + LOW = "low" + MAX = "max" + MEDIUM = "medium" + MINIMAL = "minimal" + NONE = "none" + XHIGH = "xhigh" + + + class azure.ai.projects.models.ReasoningModeEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PRO = "pro" + STANDARD = "standard" + + + class azure.ai.projects.models.RecurrenceSchedule(_Model): + type: str @overload def __init__( self, *, - max_samples: int, - model_options: Optional[DataGenerationModelOptions] = ..., - question_types: Optional[list[Union[str, SimpleQnAFineTuningQuestionType]]] = ..., - train_split: Optional[float] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SimpleQnAFineTuningQuestionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - LONG_ANSWER = "long_answer" - SHORT_ANSWER = "short_answer" - - - class azure.ai.projects.models.SkillDetails(_Model): - created_at: datetime - default_version: str - description: str - id: str - latest_version: str - name: str + class azure.ai.projects.models.RecurrenceTrigger(Trigger, discriminator='Recurrence'): + end_time: Optional[datetime] + interval: int + schedule: RecurrenceSchedule + start_time: Optional[datetime] + time_zone: Optional[str] + type: Literal[TriggerType.RECURRENCE] @overload def __init__( self, *, - created_at: datetime, - default_version: str, - description: str, - id: str, - latest_version: str, - name: str + end_time: Optional[datetime] = ..., + interval: int, + schedule: RecurrenceSchedule, + start_time: Optional[datetime] = ..., + time_zone: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SkillInlineContent(_Model): - allowed_tools: Optional[list[str]] - compatibility: Optional[str] - description: str - instructions: str - license: Optional[str] - metadata: Optional[dict[str, str]] + class azure.ai.projects.models.RecurrenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DAILY = "Daily" + HOURLY = "Hourly" + MONTHLY = "Monthly" + WEEKLY = "Weekly" + + + class azure.ai.projects.models.RedTeam(_Model): + application_scenario: Optional[str] + attack_strategies: Optional[list[Union[str, AttackStrategy]]] + display_name: Optional[str] + name: str + num_turns: Optional[int] + properties: Optional[dict[str, str]] + risk_categories: Optional[list[Union[str, RiskCategory]]] + simulation_only: Optional[bool] + status: Optional[str] + tags: Optional[dict[str, str]] + target: RedTeamTargetConfig @overload def __init__( self, *, - allowed_tools: Optional[list[str]] = ..., - compatibility: Optional[str] = ..., - description: str, - instructions: str, - license: Optional[str] = ..., - metadata: Optional[dict[str, str]] = ... + application_scenario: Optional[str] = ..., + attack_strategies: Optional[list[Union[str, AttackStrategy]]] = ..., + display_name: Optional[str] = ..., + num_turns: Optional[int] = ..., + properties: Optional[dict[str, str]] = ..., + risk_categories: Optional[list[Union[str, RiskCategory]]] = ..., + simulation_only: Optional[bool] = ..., + tags: Optional[dict[str, str]] = ..., + target: RedTeamTargetConfig ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SkillReferenceParam(ContainerSkill, discriminator='skill_reference'): - skill_id: str - type: Literal[ContainerSkillType.SKILL_REFERENCE] - version: Optional[str] + class azure.ai.projects.models.RedTeamEvalRunDataSource(TypedDict, total=False): + key "item_generation_params": Required[Any] + key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] + key "type": Required[Literal["azure_ai_red_team"]] + + + class azure.ai.projects.models.RedTeamTargetConfig(_Model): + type: str @overload def __init__( self, *, - skill_id: str, - version: Optional[str] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SkillVersion(_Model): - created_at: datetime + class azure.ai.projects.models.ReminderPreviewToolboxTool(ToolboxTool, discriminator='reminder_preview'): description: str - id: str name: str - skill_id: str - version: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.REMINDER_PREVIEW] @overload def __init__( self, *, - created_at: datetime, - description: str, - id: str, - name: str, - skill_id: str, - version: str + 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.SpecificApplyPatchParam(ToolChoiceParam, discriminator='apply_patch'): - type: Literal[ToolChoiceParamType.APPLY_PATCH] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.ResponseRetrievalItemGenerationParams(TypedDict, total=False): + key "data_mapping": Required[Dict[str, str]] + key "max_num_turns": int + key "source": Required[Union[SourceFileContent, SourceFileID]] + key "type": Required[Literal["response_retrieval"]] - class azure.ai.projects.models.SpecificFunctionShellParam(ToolChoiceParam, discriminator='shell'): - type: Literal[ToolChoiceParamType.SHELL] + class azure.ai.projects.models.ResponseUsageInputTokensDetails(_Model): + cache_write_tokens: int + cached_tokens: int @overload - def __init__(self) -> None: ... + 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.StructuredInputDefinition(_Model): - default_value: Optional[Any] - description: Optional[str] - required: Optional[bool] - schema: Optional[dict[str, Any]] + class azure.ai.projects.models.ResponseUsageOutputTokensDetails(_Model): + reasoning_tokens: int @overload def __init__( self, *, - default_value: Optional[Any] = ..., - description: Optional[str] = ..., - required: Optional[bool] = ..., - schema: Optional[dict[str, Any]] = ... + reasoning_tokens: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.StructuredOutputDefinition(_Model): - description: str - name: str - schema: dict[str, Any] - strict: bool + class azure.ai.projects.models.ResponsesProtocolConfiguration(_Model): + + + class azure.ai.projects.models.RiskCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CODE_VULNERABILITY = "CodeVulnerability" + HATE_UNFAIRNESS = "HateUnfairness" + PROHIBITED_ACTIONS = "ProhibitedActions" + PROTECTED_MATERIAL = "ProtectedMaterial" + SELF_HARM = "SelfHarm" + SENSITIVE_DATA_LEAKAGE = "SensitiveDataLeakage" + SEXUAL = "Sexual" + TASK_ADHERENCE = "TaskAdherence" + UNGROUNDED_ATTRIBUTES = "UngroundedAttributes" + VIOLENCE = "Violence" + + + class azure.ai.projects.models.Routine(_Model): + action: Optional[RoutineAction] + created_at: Optional[datetime] + description: Optional[str] + enabled: bool + name: Optional[str] + triggers: Optional[dict[str, RoutineTrigger]] + updated_at: Optional[datetime] @overload def __init__( self, *, - description: str, - name: str, - schema: dict[str, Any], - strict: bool + action: Optional[RoutineAction] = ..., + created_at: Optional[datetime] = ..., + description: Optional[str] = ..., + enabled: bool, + name: Optional[str] = ..., + triggers: Optional[dict[str, RoutineTrigger]] = ..., + updated_at: Optional[datetime] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TargetCompletionEvalRunDataSource(TypedDict, total=False): - key "input_messages": Required[InputMessagesItemReference] - key "source": Required[Union[SourceFileContent, SourceFileID]] - key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] - key "type": Required[Literal["azure_ai_target_completions"]] - - - class azure.ai.projects.models.TaskGenerationDataGenerationJobOptions(DataGenerationJobOptions, discriminator='task_generation'): - max_samples: int - model_options: DataGenerationModelOptions - train_split: float - type: Literal[DataGenerationJobType.TASK_GENERATION] + class azure.ai.projects.models.RoutineAction(_Model): + type: str @overload def __init__( self, *, - max_samples: int, - model_options: Optional[DataGenerationModelOptions] = ..., - train_split: Optional[float] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TaxonomyCategory(_Model): - description: Optional[str] - id: str - name: str - properties: Optional[dict[str, str]] - risk_category: Union[str, RiskCategory] - sub_categories: list[TaxonomySubCategory] + class azure.ai.projects.models.RoutineActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INVOKE_AGENT_INVOCATIONS_API = "invoke_agent_invocations_api" + INVOKE_AGENT_RESPONSES_API = "invoke_agent_responses_api" + + + class azure.ai.projects.models.RoutineAttemptSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EVENT_FIRE = "event_fire" + MANUAL_DISPATCH = "manual_dispatch" + QUEUED_DISPATCH = "queued_dispatch" + SCHEDULE_DELIVERY = "schedule_delivery" + TIMER_DELIVERY = "timer_delivery" + + + class azure.ai.projects.models.RoutineDispatchPayload(_Model): + type: str @overload def __init__( self, *, - description: Optional[str] = ..., - id: str, - name: str, - properties: Optional[dict[str, str]] = ..., - risk_category: Union[str, RiskCategory], - sub_categories: list[TaxonomySubCategory] + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TaxonomySubCategory(_Model): - description: Optional[str] - enabled: bool + class azure.ai.projects.models.RoutineDispatchPayloadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INVOKE_AGENT_INVOCATIONS_API = "invoke_agent_invocations_api" + INVOKE_AGENT_RESPONSES_API = "invoke_agent_responses_api" + + + class azure.ai.projects.models.RoutineRun(_Model): + action_correlation_id: Optional[str] + action_type: Optional[Union[str, RoutineActionType]] + agent_endpoint_id: Optional[str] + agent_id: Optional[str] + attempt_source: Optional[Union[str, RoutineAttemptSource]] + conversation_id: Optional[str] + dispatch_id: Optional[str] + ended_at: Optional[datetime] + error_message: Optional[str] + error_status_code: Optional[int] + error_type: Optional[str] id: str - name: str - properties: Optional[dict[str, str]] + phase: Optional[Union[str, RoutineRunPhase]] + response_id: Optional[str] + scheduled_fire_at: Optional[datetime] + session_id: Optional[str] + started_at: Optional[datetime] + status: Optional[RoutineRunStatus] + task_id: Optional[str] + trigger_event_payload: Optional[dict[str, Any]] + trigger_name: Optional[str] + trigger_type: Optional[Union[str, RoutineTriggerType]] + triggered_at: Optional[datetime] @overload def __init__( self, *, - description: Optional[str] = ..., - enabled: bool, - id: str, - name: str, - properties: Optional[dict[str, str]] = ... + action_correlation_id: Optional[str] = ..., + action_type: Optional[Union[str, RoutineActionType]] = ..., + agent_endpoint_id: Optional[str] = ..., + agent_id: Optional[str] = ..., + attempt_source: Optional[Union[str, RoutineAttemptSource]] = ..., + conversation_id: Optional[str] = ..., + dispatch_id: Optional[str] = ..., + ended_at: Optional[datetime] = ..., + error_message: Optional[str] = ..., + error_status_code: Optional[int] = ..., + error_type: Optional[str] = ..., + phase: Optional[Union[str, RoutineRunPhase]] = ..., + response_id: Optional[str] = ..., + scheduled_fire_at: Optional[datetime] = ..., + session_id: Optional[str] = ..., + started_at: Optional[datetime] = ..., + status: Optional[RoutineRunStatus] = ..., + task_id: Optional[str] = ..., + trigger_event_payload: Optional[dict[str, Any]] = ..., + trigger_name: Optional[str] = ..., + trigger_type: Optional[Union[str, RoutineTriggerType]] = ..., + triggered_at: Optional[datetime] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelemetryConfig(_Model): - endpoints: list[TelemetryEndpoint] + class azure.ai.projects.models.RoutineRunPhase(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMPLETED = "completed" + DISPATCHING = "dispatching" + FAILED = "failed" + QUEUED = "queued" + + + class azure.ai.projects.models.RoutineTrigger(_Model): + type: str @overload def __init__( self, *, - endpoints: list[TelemetryEndpoint] + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelemetryDataKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CONTAINER_OTEL = "ContainerOtel" - CONTAINER_STDOUT_STDERR = "ContainerStdoutStderr" - METRICS = "Metrics" + class azure.ai.projects.models.RoutineTriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CUSTOM = "custom" + GITHUB_ISSUE = "github_issue" + SCHEDULE = "schedule" + TIMER = "timer" - class azure.ai.projects.models.TelemetryEndpoint(_Model): - auth: Optional[TelemetryEndpointAuth] - data: list[Union[str, TelemetryDataKind]] - kind: str + class azure.ai.projects.models.RubricBasedEvaluatorDefinition(EvaluatorDefinition, discriminator='rubric'): + data_schema: dict[str, any] + dimensions: list[Dimension] + init_parameters: dict[str, any] + metrics: dict[str, EvaluatorMetric] + pass_threshold: Optional[float] + type: Literal[EvaluatorDefinitionType.RUBRIC] @overload def __init__( self, *, - auth: Optional[TelemetryEndpointAuth] = ..., - data: list[Union[str, TelemetryDataKind]], - kind: str + data_schema: Optional[dict[str, Any]] = ..., + dimensions: list[Dimension], + init_parameters: Optional[dict[str, Any]] = ..., + metrics: Optional[dict[str, EvaluatorMetric]] = ..., + pass_threshold: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelemetryEndpointAuth(_Model): - type: str + class azure.ai.projects.models.RubricGenerationInputQualityWarning(_Model): + code: Union[str, RubricGenerationInputQualityWarningCode] + message: str + severity: Union[str, RubricGenerationInputQualityWarningSeverity] + source: Union[str, RubricGenerationInputQualityWarningSource] + source_index: Optional[int] @overload def __init__( self, *, - type: str + code: Union[str, RubricGenerationInputQualityWarningCode], + message: str, + severity: Union[str, RubricGenerationInputQualityWarningSeverity], + source: Union[str, RubricGenerationInputQualityWarningSource], + source_index: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelemetryEndpointAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - HEADER = "header" - - - class azure.ai.projects.models.TelemetryEndpointKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - OTLP = "OTLP" + class azure.ai.projects.models.RubricGenerationInputQualityWarningCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EMPTY_AGENT_INSTRUCTIONS = "empty_agent_instructions" + EMPTY_DATASET_CONTENT = "empty_dataset_content" + EMPTY_PROMPT = "empty_prompt" + INSUFFICIENT_TOTAL_INPUT = "insufficient_total_input" + LOW_TRACE_COUNT = "low_trace_count" + SHORT_AGENT_INSTRUCTIONS = "short_agent_instructions" + SHORT_DATASET_CONTENT = "short_dataset_content" + SHORT_PROMPT = "short_prompt" - class azure.ai.projects.models.TelemetryTransportProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - GRPC = "Grpc" - HTTP = "Http" + class azure.ai.projects.models.RubricGenerationInputQualityWarningSeverity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + WARNING = "warning" - class azure.ai.projects.models.TestingCriterionAzureAIEvaluator(TypedDict, total=False): - key "data_mapping": Dict[str, str] - key "evaluator_name": Required[str] - key "evaluator_version": str - key "initialization_parameters": Dict[str, Any] - key "name": Required[str] - key "type": Required[Literal["azure_ai_evaluator"]] + class azure.ai.projects.models.RubricGenerationInputQualityWarningSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT = "agent" + AGGREGATE = "aggregate" + DATASET = "dataset" + PROMPT = "prompt" - class azure.ai.projects.models.TextResponseFormat(_Model): - type: str + class azure.ai.projects.models.SASCredentials(BaseCredentials, discriminator='SAS'): + sas_token: Optional[str] + type: Literal[CredentialType.SAS] @overload - def __init__( - self, - *, - type: str - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TextResponseFormatConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - JSON_OBJECT = "json_object" - JSON_SCHEMA = "json_schema" - TEXT = "text" - - - class azure.ai.projects.models.TextResponseFormatJsonObject(TextResponseFormat, discriminator='json_object'): - type: Literal[TextResponseFormatConfigurationType.JSON_OBJECT] - - @overload - def __init__(self) -> None: ... + class azure.ai.projects.models.SampleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EVALUATION_RESULT_SAMPLE = "EvaluationResultSample" - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.TextResponseFormatJsonSchema(TextResponseFormat, discriminator='json_schema'): + class azure.ai.projects.models.Schedule(_Model): description: Optional[str] - name: str - schema: dict[str, Any] - strict: Optional[bool] - type: Literal[TextResponseFormatConfigurationType.JSON_SCHEMA] + display_name: Optional[str] + enabled: bool + properties: Optional[dict[str, str]] + provisioning_status: Optional[Union[str, ScheduleProvisioningStatus]] + schedule_id: str + system_data: dict[str, str] + tags: Optional[dict[str, str]] + task: ScheduleTask + trigger: Trigger @overload def __init__( self, *, description: Optional[str] = ..., - name: str, - schema: dict[str, Any], - strict: Optional[bool] = ... + display_name: Optional[str] = ..., + enabled: bool, + properties: Optional[dict[str, str]] = ..., + tags: Optional[dict[str, str]] = ..., + task: ScheduleTask, + trigger: Trigger ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TextResponseFormatText(TextResponseFormat, discriminator='text'): - type: Literal[TextResponseFormatConfigurationType.TEXT] + class azure.ai.projects.models.ScheduleProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + UPDATING = "Updating" + + + class azure.ai.projects.models.ScheduleRoutineTrigger(RoutineTrigger, discriminator='schedule'): + cron_expression: str + time_zone: str + type: Literal[RoutineTriggerType.SCHEDULE] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + cron_expression: str, + time_zone: str + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TimerRoutineTrigger(RoutineTrigger, discriminator='timer'): - at: Optional[datetime] - type: Literal[RoutineTriggerType.TIMER] + class azure.ai.projects.models.ScheduleRun(_Model): + error: Optional[str] + properties: dict[str, str] + run_id: str + schedule_id: str + success: bool + trigger_time: Optional[datetime] @overload def __init__( self, *, - at: Optional[datetime] = ... + schedule_id: str, + trigger_time: Optional[datetime] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.Tool(_Model): + class azure.ai.projects.models.ScheduleTask(_Model): + configuration: Optional[dict[str, str]] type: str @overload def __init__( self, *, + configuration: Optional[dict[str, str]] = ..., type: str ) -> None: ... @@ -8575,96 +9265,150 @@ namespace azure.ai.projects.models 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]] - type: Literal[ToolChoiceParamType.ALLOWED_TOOLS] + class azure.ai.projects.models.ScheduleTaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EVALUATION = "Evaluation" + INSIGHT = "Insight" + + + class azure.ai.projects.models.SearchContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + IMAGE = "image" + TEXT = "text" + + + class azure.ai.projects.models.SearchContextSize(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HIGH = "high" + LOW = "low" + MEDIUM = "medium" + + + class azure.ai.projects.models.SessionDirectoryEntry(_Model): + is_directory: bool + modified_time: datetime + name: str + size: int @overload def __init__( self, *, - mode: Literal["auto", "required"], - tools: list[dict[str, Any]] + is_directory: bool, + modified_time: datetime, + name: str, + size: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceCodeInterpreter(ToolChoiceParam, discriminator='code_interpreter'): - type: Literal[ToolChoiceParamType.CODE_INTERPRETER] + class azure.ai.projects.models.SessionFileWriteResult(_Model): + bytes_written: int + path: str @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + bytes_written: int, + path: str + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceComputer(ToolChoiceParam, discriminator='computer'): - type: Literal[ToolChoiceParamType.COMPUTER] + class azure.ai.projects.models.SessionLogEvent(_Model): + data: str + event: Union[str, SessionLogEventType] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + data: str, + event: Union[str, SessionLogEventType] + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceComputerUse(ToolChoiceParam, discriminator='computer_use'): - type: Literal[ToolChoiceParamType.COMPUTER_USE] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.SessionLogEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LOG = "log" - class azure.ai.projects.models.ToolChoiceComputerUsePreview(ToolChoiceParam, discriminator='computer_use_preview'): - type: Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW] + class azure.ai.projects.models.SharepointGroundingToolParameters(_Model): + project_connections: Optional[list[ToolProjectConnection]] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + project_connections: Optional[list[ToolProjectConnection]] = ... + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceCustom(ToolChoiceParam, discriminator='custom'): - name: str - type: Literal[ToolChoiceParamType.CUSTOM] + class azure.ai.projects.models.SharepointPreviewTool(Tool, discriminator='sharepoint_grounding_preview'): + sharepoint_grounding_preview: SharepointGroundingToolParameters + type: Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW] @overload def __init__( self, *, - name: str + sharepoint_grounding_preview: SharepointGroundingToolParameters ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceFileSearch(ToolChoiceParam, discriminator='file_search'): - type: Literal[ToolChoiceParamType.FILE_SEARCH] + class azure.ai.projects.models.SimpleQnADataGenerationJobOptions(DataGenerationJobOptions, discriminator='simple_qna'): + max_samples: int + model_options: DataGenerationModelOptions + question_types: Optional[list[Union[str, SimpleQnAFineTuningQuestionType]]] + train_split: float + type: Literal[DataGenerationJobType.SIMPLE_QNA] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + max_samples: int, + model_options: Optional[DataGenerationModelOptions] = ..., + question_types: Optional[list[Union[str, SimpleQnAFineTuningQuestionType]]] = ..., + train_split: Optional[float] = ... + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceFunction(ToolChoiceParam, discriminator='function'): + class azure.ai.projects.models.SimpleQnAFineTuningQuestionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LONG_ANSWER = "long_answer" + SHORT_ANSWER = "short_answer" + + + class azure.ai.projects.models.SkillDetails(_Model): + created_at: datetime + default_version: str + description: str + id: str + latest_version: str name: str - type: Literal[ToolChoiceParamType.FUNCTION] @overload def __init__( self, *, + created_at: datetime, + default_version: str, + description: str, + id: str, + latest_version: str, name: str ) -> None: ... @@ -8672,66 +9416,73 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceImageGeneration(ToolChoiceParam, discriminator='image_generation'): - type: Literal[ToolChoiceParamType.IMAGE_GENERATION] + class azure.ai.projects.models.SkillInlineContent(_Model): + allowed_tools: Optional[list[str]] + compatibility: Optional[str] + description: str + instructions: str + license: Optional[str] + metadata: Optional[dict[str, str]] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + allowed_tools: Optional[list[str]] = ..., + compatibility: Optional[str] = ..., + description: str, + instructions: str, + license: Optional[str] = ..., + metadata: Optional[dict[str, str]] = ... + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceMCP(ToolChoiceParam, discriminator='mcp'): - name: Optional[str] - server_label: str - type: Literal[ToolChoiceParamType.MCP] + class azure.ai.projects.models.SkillReferenceParam(ContainerSkill, discriminator='skill_reference'): + skill_id: str + type: Literal[ContainerSkillType.SKILL_REFERENCE] + version: Optional[str] @overload def __init__( self, *, - name: Optional[str] = ..., - server_label: str + skill_id: str, + version: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceParam(_Model): - type: str + class azure.ai.projects.models.SkillVersion(_Model): + created_at: datetime + description: str + id: str + name: str + skill_id: str + version: str @overload def __init__( self, *, - type: str + created_at: datetime, + description: str, + id: str, + name: str, + skill_id: str, + version: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ALLOWED_TOOLS = "allowed_tools" - APPLY_PATCH = "apply_patch" - CODE_INTERPRETER = "code_interpreter" - COMPUTER = "computer" - COMPUTER_USE = "computer_use" - COMPUTER_USE_PREVIEW = "computer_use_preview" - CUSTOM = "custom" - FILE_SEARCH = "file_search" - FUNCTION = "function" - IMAGE_GENERATION = "image_generation" - MCP = "mcp" - SHELL = "shell" - WEB_SEARCH_PREVIEW = "web_search_preview" - WEB_SEARCH_PREVIEW_2025_03_11 = "web_search_preview_2025_03_11" - - - class azure.ai.projects.models.ToolChoiceWebSearchPreview(ToolChoiceParam, discriminator='web_search_preview'): - type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW] + class azure.ai.projects.models.SpecificApplyPatchParam(ToolChoiceParam, discriminator='apply_patch'): + type: Literal[ToolChoiceParamType.APPLY_PATCH] @overload def __init__(self) -> None: ... @@ -8740,8 +9491,8 @@ 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.SpecificFunctionShellParam(ToolChoiceParam, discriminator='shell'): + type: Literal[ToolChoiceParamType.SHELL] @overload def __init__(self) -> None: ... @@ -8750,203 +9501,167 @@ namespace azure.ai.projects.models 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.SpecificProgrammaticToolCallingParam(ToolChoiceParam, discriminator='programmatic_tool_calling'): + type: Literal[ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING] @overload - def __init__( - self, - *, - additional_search_text: Optional[str] = ..., - pin: Optional[bool] = ... - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolDescription(_Model): + class azure.ai.projects.models.StructuredInputDefinition(_Model): + default_value: Optional[Any] description: Optional[str] - name: Optional[str] + required: Optional[bool] + schema: Optional[dict[str, Any]] @overload def __init__( self, *, + default_value: Optional[Any] = ..., description: Optional[str] = ..., - name: Optional[str] = ... + required: Optional[bool] = ..., + schema: Optional[dict[str, Any]] = ... ) -> 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.ToolProjectConnection(_Model): - project_connection_id: str + class azure.ai.projects.models.StructuredOutputDefinition(_Model): + description: str + name: str + schema: dict[str, Any] + strict: bool @overload def __init__( self, *, - project_connection_id: str + description: str, + name: str, + schema: dict[str, Any], + strict: bool ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolSearchExecutionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CLIENT = "client" - SERVER = "server" + class azure.ai.projects.models.TargetCompletionEvalRunDataSource(TypedDict, total=False): + key "input_messages": Required[InputMessagesItemReference] + key "source": Required[Union[SourceFileContent, SourceFileID]] + key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] + key "type": Required[Literal["azure_ai_target_completions"]] - 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.TaskGenerationDataGenerationJobOptions(DataGenerationJobOptions, discriminator='task_generation'): + max_samples: int + model_options: DataGenerationModelOptions + train_split: float + type: Literal[DataGenerationJobType.TASK_GENERATION] @overload def __init__( self, *, - description: Optional[str] = ..., - execution: Optional[Union[str, ToolSearchExecutionType]] = ..., - parameters: Optional[EmptyModelParam] = ... + max_samples: int, + model_options: Optional[DataGenerationModelOptions] = ..., + train_split: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolSearchToolboxTool(ToolboxTool, discriminator='toolbox_search'): - description: str + class azure.ai.projects.models.TaxonomyCategory(_Model): + description: Optional[str] + id: str name: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.TOOLBOX_SEARCH] + properties: Optional[dict[str, str]] + risk_category: Union[str, RiskCategory] + sub_categories: list[TaxonomySubCategory] @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.ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - A2A_PREVIEW = "a2a_preview" - APPLY_PATCH = "apply_patch" - AZURE_AI_SEARCH = "azure_ai_search" - AZURE_FUNCTION = "azure_function" - BING_CUSTOM_SEARCH_PREVIEW = "bing_custom_search_preview" - BING_GROUNDING = "bing_grounding" - BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" - CAPTURE_STRUCTURED_OUTPUTS = "capture_structured_outputs" - CODE_INTERPRETER = "code_interpreter" - COMPUTER = "computer" - COMPUTER_USE_PREVIEW = "computer_use_preview" - CUSTOM = "custom" - FABRIC_DATAAGENT_PREVIEW = "fabric_dataagent_preview" - FABRIC_IQ_PREVIEW = "fabric_iq_preview" - FILE_SEARCH = "file_search" - FUNCTION = "function" - IMAGE_GENERATION = "image_generation" - LOCAL_SHELL = "local_shell" - MCP = "mcp" - MEMORY_SEARCH_PREVIEW = "memory_search_preview" - NAMESPACE = "namespace" - OPENAPI = "openapi" - SHAREPOINT_GROUNDING_PREVIEW = "sharepoint_grounding_preview" - SHELL = "shell" - TOOLBOX_SEARCH_PREVIEW = "toolbox_search_preview" - TOOL_SEARCH = "tool_search" - WEB_SEARCH = "web_search" - WEB_SEARCH_PREVIEW = "web_search_preview" - WORK_IQ_PREVIEW = "work_iq_preview" - - - class azure.ai.projects.models.ToolUseFineTuningDataGenerationJobOptions(DataGenerationJobOptions, discriminator='tool_use'): - max_samples: int - model_options: DataGenerationModelOptions - train_split: float - type: Literal[DataGenerationJobType.TOOL_USE] - - @overload - def __init__( - self, - *, - max_samples: int, - model_options: Optional[DataGenerationModelOptions] = ..., - train_split: Optional[float] = ... + id: str, + name: str, + properties: Optional[dict[str, str]] = ..., + risk_category: Union[str, RiskCategory], + sub_categories: list[TaxonomySubCategory] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxObject(_Model): - default_version: str + class azure.ai.projects.models.TaxonomySubCategory(_Model): + description: Optional[str] + enabled: bool id: str name: str + properties: Optional[dict[str, str]] @overload def __init__( self, *, - default_version: str, + description: Optional[str] = ..., + enabled: bool, id: str, - name: str + name: str, + properties: Optional[dict[str, str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxPolicies(_Model): - rai_config: Optional[RaiConfig] + class azure.ai.projects.models.TelemetryConfig(_Model): + endpoints: list[TelemetryEndpoint] @overload def __init__( self, *, - rai_config: Optional[RaiConfig] = ... + endpoints: list[TelemetryEndpoint] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxSearchPreviewToolboxTool(ToolboxTool, discriminator='toolbox_search_preview'): - description: str - name: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW] + class azure.ai.projects.models.TelemetryDataKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONTAINER_OTEL = "ContainerOtel" + CONTAINER_STDOUT_STDERR = "ContainerStdoutStderr" + METRICS = "Metrics" + + + class azure.ai.projects.models.TelemetryEndpoint(_Model): + auth: Optional[TelemetryEndpointAuth] + data: list[Union[str, TelemetryDataKind]] + kind: str @overload def __init__( self, *, - description: Optional[str] = ..., - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + auth: Optional[TelemetryEndpointAuth] = ..., + data: list[Union[str, TelemetryDataKind]], + kind: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxSkill(_Model): + class azure.ai.projects.models.TelemetryEndpointAuth(_Model): type: str @overload @@ -8960,36 +9675,50 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxSkillReference(ToolboxSkill, discriminator='skill_reference'): - name: str - type: Literal["skill_reference"] - version: Optional[str] + class azure.ai.projects.models.TelemetryEndpointAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HEADER = "header" + + + class azure.ai.projects.models.TelemetryEndpointKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + OTLP = "OTLP" + + + class azure.ai.projects.models.TelemetryTransportProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + GRPC = "Grpc" + HTTP = "Http" + + + class azure.ai.projects.models.TemplateVoiceGreetingConfig(VoiceGreetingConfig, discriminator='template'): + text: str + type: Literal["template"] @overload def __init__( self, *, - name: str, - version: Optional[str] = ... + text: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxTool(_Model): - description: Optional[str] - name: Optional[str] - tool_configs: Optional[dict[str, ToolConfig]] + class azure.ai.projects.models.TestingCriterionAzureAIEvaluator(TypedDict, total=False): + key "data_mapping": Dict[str, str] + key "evaluator_name": Required[str] + key "evaluator_version": str + key "initialization_parameters": Dict[str, Any] + key "name": Required[str] + key "type": Required[Literal["azure_ai_evaluator"]] + + + class azure.ai.projects.models.TextResponseFormat(_Model): type: str @overload def __init__( self, *, - description: Optional[str] = ..., - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ..., type: str ) -> None: ... @@ -8997,266 +9726,219 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - A2A_PREVIEW = "a2a_preview" - AZURE_AI_SEARCH = "azure_ai_search" - BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" - CODE_INTERPRETER = "code_interpreter" - FABRIC_IQ_PREVIEW = "fabric_iq_preview" - FILE_SEARCH = "file_search" - MCP = "mcp" - OPENAPI = "openapi" - REMINDER_PREVIEW = "reminder_preview" - TOOLBOX_SEARCH = "toolbox_search" - TOOLBOX_SEARCH_PREVIEW = "toolbox_search_preview" - WEB_SEARCH = "web_search" - WORK_IQ_PREVIEW = "work_iq_preview" + class azure.ai.projects.models.TextResponseFormatConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + JSON_OBJECT = "json_object" + JSON_SCHEMA = "json_schema" + TEXT = "text" - class azure.ai.projects.models.ToolboxVersionObject(_Model): - created_at: datetime + class azure.ai.projects.models.TextResponseFormatJsonObject(TextResponseFormat, discriminator='json_object'): + type: Literal[TextResponseFormatConfigurationType.JSON_OBJECT] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TextResponseFormatJsonSchema(TextResponseFormat, discriminator='json_schema'): description: Optional[str] - id: str - metadata: dict[str, str] name: str - policies: Optional[ToolboxPolicies] - skills: Optional[list[ToolboxSkill]] - tools: list[ToolboxTool] - version: str + schema: dict[str, Any] + strict: Optional[bool] + type: Literal[TextResponseFormatConfigurationType.JSON_SCHEMA] @overload def __init__( self, *, - created_at: datetime, description: Optional[str] = ..., - id: str, - metadata: dict[str, str], name: str, - policies: Optional[ToolboxPolicies] = ..., - skills: Optional[list[ToolboxSkill]] = ..., - tools: list[ToolboxTool], - version: str + schema: dict[str, Any], + strict: Optional[bool] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TracesDataGenerationJobOptions(DataGenerationJobOptions, discriminator='traces'): - max_samples: int - model_options: DataGenerationModelOptions - train_split: float - type: Literal[DataGenerationJobType.TRACES] + class azure.ai.projects.models.TextResponseFormatText(TextResponseFormat, discriminator='text'): + type: Literal[TextResponseFormatConfigurationType.TEXT] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TimerRoutineTrigger(RoutineTrigger, discriminator='timer'): + at: Optional[datetime] + type: Literal[RoutineTriggerType.TIMER] @overload def __init__( self, *, - max_samples: int, - model_options: Optional[DataGenerationModelOptions] = ..., - train_split: Optional[float] = ... + at: Optional[datetime] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TracesDataGenerationJobSource(DataGenerationJobSource, discriminator='traces'): - agent_id: Optional[str] - agent_name: Optional[str] - agent_version: Optional[str] - description: str - end_time: Optional[datetime] - start_time: datetime - type: Literal[DataGenerationJobSourceType.TRACES] + class azure.ai.projects.models.Tool(_Model): + type: str @overload def __init__( self, *, - agent_id: Optional[str] = ..., - agent_name: Optional[str] = ..., - agent_version: Optional[str] = ..., - description: Optional[str] = ..., - end_time: Optional[datetime] = ..., - start_time: datetime + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TracesEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator='traces'): - agent_id: Optional[str] - agent_name: Optional[str] - agent_version: Optional[str] - description: Optional[str] - end_time: Optional[datetime] - start_time: datetime - type: Literal[EvaluatorGenerationJobSourceType.TRACES] + class azure.ai.projects.models.ToolChoiceAllowed(ToolChoiceParam, discriminator='allowed_tools'): + mode: Literal["auto", "required"] + tools: list[dict[str, Any]] + type: Literal[ToolChoiceParamType.ALLOWED_TOOLS] @overload def __init__( self, *, - agent_id: Optional[str] = ..., - agent_name: Optional[str] = ..., - agent_version: Optional[str] = ..., - description: Optional[str] = ..., - end_time: Optional[datetime] = ..., - start_time: datetime + mode: Literal["auto", "required"], + tools: list[dict[str, Any]] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TracesPreviewEvalRunDataSource(TypedDict, total=False): - key "agent_id": str - key "agent_name": str - key "end_time": datetime - key "ingestion_delay_seconds": int - key "lookback_hours": int - key "max_traces": int - key "trace_ids": List[str] - key "type": Required[Literal["azure_ai_traces_preview"]] + class azure.ai.projects.models.ToolChoiceCodeInterpreter(ToolChoiceParam, discriminator='code_interpreter'): + type: Literal[ToolChoiceParamType.CODE_INTERPRETER] + @overload + def __init__(self) -> None: ... - class azure.ai.projects.models.TreatmentEffectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CHANGED = "Changed" - DEGRADED = "Degraded" - IMPROVED = "Improved" - INCONCLUSIVE = "Inconclusive" - TOO_FEW_SAMPLES = "TooFewSamples" + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.Trigger(_Model): - type: str + class azure.ai.projects.models.ToolChoiceComputer(ToolChoiceParam, discriminator='computer'): + type: Literal[ToolChoiceParamType.COMPUTER] @overload - def __init__( - self, - *, - type: str - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CRON = "Cron" - ONE_TIME = "OneTime" - RECURRENCE = "Recurrence" - + class azure.ai.projects.models.ToolChoiceComputerUse(ToolChoiceParam, discriminator='computer_use'): + type: Literal[ToolChoiceParamType.COMPUTER_USE] - class azure.ai.projects.models.UpdateMemoriesLROPoller(LROPoller[MemoryStoreUpdateCompletedResult]): - property superseded_by: Optional[str] # Read-only - property update_id: str # Read-only + @overload + def __init__(self) -> None: ... - @classmethod - def from_continuation_token( - cls, - polling_method: PollingMethod[MemoryStoreUpdateCompletedResult], - continuation_token: str, - **kwargs: Any - ) -> UpdateMemoriesLROPoller: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.UpdateModelVersionRequest(_Model): - description: Optional[str] - tags: Optional[dict[str, str]] + class azure.ai.projects.models.ToolChoiceComputerUsePreview(ToolChoiceParam, discriminator='computer_use_preview'): + type: Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW] @overload - def __init__( - self, - *, - description: Optional[str] = ..., - tags: Optional[dict[str, str]] = ... - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.UpdateToolboxRequest(_Model): - default_version: str + class azure.ai.projects.models.ToolChoiceCustom(ToolChoiceParam, discriminator='custom'): + name: str + type: Literal[ToolChoiceParamType.CUSTOM] @overload def __init__( self, *, - default_version: str + name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.UserProfileMemoryItem(MemoryItem, discriminator='user_profile'): - content: str - kind: Literal[MemoryItemKind.USER_PROFILE] - memory_id: str - scope: str - updated_at: datetime + class azure.ai.projects.models.ToolChoiceFileSearch(ToolChoiceParam, discriminator='file_search'): + type: Literal[ToolChoiceParamType.FILE_SEARCH] @overload - def __init__( - self, - *, - content: str, - memory_id: str, - scope: str, - updated_at: datetime - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VersionIndicator(_Model): - type: str + class azure.ai.projects.models.ToolChoiceFunction(ToolChoiceParam, discriminator='function'): + name: str + type: Literal[ToolChoiceParamType.FUNCTION] @overload def __init__( self, *, - type: str + name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VersionIndicatorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - VERSION_REF = "version_ref" + class azure.ai.projects.models.ToolChoiceImageGeneration(ToolChoiceParam, discriminator='image_generation'): + type: Literal[ToolChoiceParamType.IMAGE_GENERATION] + @overload + def __init__(self) -> None: ... - class azure.ai.projects.models.VersionRefIndicator(VersionIndicator, discriminator='version_ref'): - agent_version: str - type: Literal[VersionIndicatorType.VERSION_REF] + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceMCP(ToolChoiceParam, discriminator='mcp'): + name: Optional[str] + server_label: str + type: Literal[ToolChoiceParamType.MCP] @overload def __init__( self, *, - agent_version: str + name: Optional[str] = ..., + server_label: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VersionSelectionRule(_Model): - agent_version: str + class azure.ai.projects.models.ToolChoiceOptions(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "auto" + NONE = "none" + REQUIRED = "required" + + + class azure.ai.projects.models.ToolChoiceParam(_Model): type: str @overload def __init__( self, *, - agent_version: str, type: str ) -> None: ... @@ -9264,184 +9946,227 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VersionSelector(_Model): - version_selection_rules: list[VersionSelectionRule] + class azure.ai.projects.models.ToolChoiceParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ALLOWED_TOOLS = "allowed_tools" + APPLY_PATCH = "apply_patch" + CODE_INTERPRETER = "code_interpreter" + COMPUTER = "computer" + COMPUTER_USE = "computer_use" + COMPUTER_USE_PREVIEW = "computer_use_preview" + CUSTOM = "custom" + FILE_SEARCH = "file_search" + FUNCTION = "function" + IMAGE_GENERATION = "image_generation" + MCP = "mcp" + PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" + SHELL = "shell" + WEB_SEARCH_PREVIEW = "web_search_preview" + WEB_SEARCH_PREVIEW_2025_03_11 = "web_search_preview_2025_03_11" + + + class azure.ai.projects.models.ToolChoiceWebSearchPreview(ToolChoiceParam, discriminator='web_search_preview'): + type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW] @overload - def __init__( - self, - *, - version_selection_rules: list[VersionSelectionRule] - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VersionSelectorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FIXED_RATIO = "FixedRatio" + 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: ... - class azure.ai.projects.models.WebSearchApproximateLocation(_Model): - city: Optional[str] - country: Optional[str] - region: Optional[str] - timezone: Optional[str] - type: Literal["approximate"] + @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, *, - city: Optional[str] = ..., - country: Optional[str] = ..., - region: Optional[str] = ..., - timezone: Optional[str] = ... + additional_search_text: Optional[str] = ..., + pin: Optional[bool] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.WebSearchConfiguration(_Model): - instance_name: str - project_connection_id: str + class azure.ai.projects.models.ToolDescription(_Model): + description: Optional[str] + name: Optional[str] @overload def __init__( self, *, - instance_name: str, - project_connection_id: str + description: Optional[str] = ..., + name: Optional[str] = ... ) -> None: ... @overload 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] + class azure.ai.projects.models.ToolDescriptionParam(TypedDict, total=False): + key "description": str + key "name": str + + + class azure.ai.projects.models.ToolProjectConnection(_Model): + project_connection_id: str @overload def __init__( self, *, - search_content_types: Optional[list[Union[str, SearchContentType]]] = ..., - search_context_size: Optional[Union[str, SearchContextSize]] = ..., - user_location: Optional[ApproximateLocation] = ... + project_connection_id: str ) -> 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] + class azure.ai.projects.models.ToolSearchExecutionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CLIENT = "client" + SERVER = "server" + + + class azure.ai.projects.models.ToolSearchToolParam(Tool, discriminator='tool_search'): description: Optional[str] - 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] + execution: Optional[Union[str, ToolSearchExecutionType]] + parameters: Optional[EmptyModelParam] + type: Literal[ToolType.TOOL_SEARCH] @overload def __init__( self, *, - custom_search_configuration: Optional[WebSearchConfiguration] = ..., description: Optional[str] = ..., - filters: Optional[WebSearchToolFilters] = ..., - name: Optional[str] = ..., - search_context_size: Optional[Literal[low, medium, high]] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ..., - user_location: Optional[WebSearchApproximateLocation] = ... + execution: Optional[Union[str, ToolSearchExecutionType]] = ..., + parameters: Optional[EmptyModelParam] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.WebSearchToolFilters(_Model): - allowed_domains: Optional[list[str]] + 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, *, - allowed_domains: Optional[list[str]] = ... + 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.WebSearchToolboxTool(ToolboxTool, discriminator='web_search'): - custom_search_configuration: Optional[WebSearchConfiguration] - description: str - filters: Optional[WebSearchToolFilters] - name: str - search_context_size: Optional[Literal["low", "medium", "high"]] - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.WEB_SEARCH] - user_location: Optional[WebSearchApproximateLocation] + class azure.ai.projects.models.ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + A2A_PREVIEW = "a2a_preview" + APPLY_PATCH = "apply_patch" + AZURE_AI_SEARCH = "azure_ai_search" + AZURE_FUNCTION = "azure_function" + BING_CUSTOM_SEARCH_PREVIEW = "bing_custom_search_preview" + BING_GROUNDING = "bing_grounding" + BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" + CAPTURE_STRUCTURED_OUTPUTS = "capture_structured_outputs" + CODE_INTERPRETER = "code_interpreter" + COMPUTER = "computer" + COMPUTER_USE_PREVIEW = "computer_use_preview" + CUSTOM = "custom" + FABRIC_DATAAGENT_PREVIEW = "fabric_dataagent_preview" + FABRIC_IQ_PREVIEW = "fabric_iq_preview" + FILE_SEARCH = "file_search" + FUNCTION = "function" + IMAGE_GENERATION = "image_generation" + LOCAL_SHELL = "local_shell" + MCP = "mcp" + MEMORY_SEARCH_PREVIEW = "memory_search_preview" + NAMESPACE = "namespace" + OPENAPI = "openapi" + PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" + SHAREPOINT_GROUNDING_PREVIEW = "sharepoint_grounding_preview" + SHELL = "shell" + TOOLBOX_SEARCH_PREVIEW = "toolbox_search_preview" + TOOL_SEARCH = "tool_search" + WEB_SEARCH = "web_search" + WEB_SEARCH_PREVIEW = "web_search_preview" + WORK_IQ_PREVIEW = "work_iq_preview" + + + class azure.ai.projects.models.ToolUseFineTuningDataGenerationJobOptions(DataGenerationJobOptions, discriminator='tool_use'): + max_samples: int + model_options: DataGenerationModelOptions + train_split: float + type: Literal[DataGenerationJobType.TOOL_USE] @overload def __init__( self, *, - custom_search_configuration: Optional[WebSearchConfiguration] = ..., - description: Optional[str] = ..., - filters: Optional[WebSearchToolFilters] = ..., - name: Optional[str] = ..., - search_context_size: Optional[Literal[low, medium, high]] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ..., - user_location: Optional[WebSearchApproximateLocation] = ... + max_samples: int, + model_options: Optional[DataGenerationModelOptions] = ..., + train_split: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.WeeklyRecurrenceSchedule(RecurrenceSchedule, discriminator='Weekly'): - days_of_week: list[Union[str, DayOfWeek]] - type: Literal[RecurrenceType.WEEKLY] + class azure.ai.projects.models.ToolboxObject(_Model): + default_version: str + id: str + name: str @overload def __init__( self, *, - days_of_week: list[Union[str, DayOfWeek]] + default_version: str, + id: str, + name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.WorkIQPreviewTool(Tool, discriminator='work_iq_preview'): - project_connection_id: str - type: Literal[ToolType.WORK_IQ_PREVIEW] + class azure.ai.projects.models.ToolboxPolicies(_Model): + rai_config: Optional[RaiConfig] @overload def __init__( self, *, - project_connection_id: str + rai_config: Optional[RaiConfig] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.WorkIQPreviewToolboxTool(ToolboxTool, discriminator='work_iq_preview'): + class azure.ai.projects.models.ToolboxSearchPreviewToolboxTool(ToolboxTool, discriminator='toolbox_search_preview'): description: str name: str - project_connection_id: str tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.WORK_IQ_PREVIEW] + type: Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW] @overload def __init__( @@ -9449,7 +10174,6 @@ namespace azure.ai.projects.models *, description: Optional[str] = ..., name: Optional[str] = ..., - project_connection_id: str, tool_configs: Optional[dict[str, ToolConfig]] = ... ) -> None: ... @@ -9457,2284 +10181,11278 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.WorkflowAgentDefinition(AgentDefinition, discriminator='workflow'): - kind: Literal[AgentKind.WORKFLOW] - rai_config: RaiConfig - workflow: Optional[str] + class azure.ai.projects.models.ToolboxSkill(_Model): + type: str @overload def __init__( self, *, - rai_config: Optional[RaiConfig] = ..., - workflow: Optional[str] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... -namespace azure.ai.projects.operations - - class azure.ai.projects.operations.AgentsOperations(GeneratedAgentsOperations): + class azure.ai.projects.models.ToolboxSkillReference(ToolboxSkill, discriminator='skill_reference'): + name: str + type: Literal["skill_reference"] + version: Optional[str] + @overload def __init__( self, - *args, - **kwargs + *, + name: str, + version: Optional[str] = ... ) -> None: ... @overload - def create_session( - self, - agent_name: str, - *, - agent_session_id: Optional[str] = ..., - content_type: str = "application/json", - version_indicator: VersionIndicator, - **kwargs: Any - ) -> AgentSessionResource: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolboxTool(_Model): + description: Optional[str] + name: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] + type: str @overload - def create_session( + def __init__( self, - agent_name: str, - body: JSON, *, - content_type: str = "application/json", - **kwargs: Any - ) -> AgentSessionResource: ... + description: Optional[str] = ..., + name: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ..., + type: str + ) -> None: ... @overload - def create_session( - self, - agent_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AgentSessionResource: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolboxToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + A2A_PREVIEW = "a2a_preview" + AZURE_AI_SEARCH = "azure_ai_search" + BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" + CODE_INTERPRETER = "code_interpreter" + FABRIC_IQ_PREVIEW = "fabric_iq_preview" + FILE_SEARCH = "file_search" + MCP = "mcp" + OPENAPI = "openapi" + REMINDER_PREVIEW = "reminder_preview" + TOOLBOX_SEARCH = "toolbox_search" + TOOLBOX_SEARCH_PREVIEW = "toolbox_search_preview" + WEB_SEARCH = "web_search" + WORK_IQ_PREVIEW = "work_iq_preview" + + + class azure.ai.projects.models.ToolboxVersionObject(_Model): + created_at: datetime + description: Optional[str] + id: str + metadata: dict[str, str] + name: str + policies: Optional[ToolboxPolicies] + skills: Optional[list[ToolboxSkill]] + tools: list[ToolboxTool] + version: str @overload - def create_version( + def __init__( self, - agent_name: str, *, - blueprint_reference: Optional[AgentBlueprintReference] = ..., - content_type: str = "application/json", - definition: AgentDefinition, + created_at: datetime, description: Optional[str] = ..., - draft: Optional[bool] = ..., - metadata: Optional[dict[str, str]] = ..., - **kwargs: Any - ) -> AgentVersionDetails: ... + id: str, + metadata: dict[str, str], + name: str, + policies: Optional[ToolboxPolicies] = ..., + skills: Optional[list[ToolboxSkill]] = ..., + tools: list[ToolboxTool], + version: str + ) -> None: ... @overload - def create_version( - self, - agent_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AgentVersionDetails: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TracesDataGenerationJobOptions(DataGenerationJobOptions, discriminator='traces'): + max_samples: int + model_options: DataGenerationModelOptions + train_split: float + type: Literal[DataGenerationJobType.TRACES] @overload - def create_version( + def __init__( self, - agent_name: str, - body: IO[bytes], *, - content_type: str = "application/json", - **kwargs: Any - ) -> AgentVersionDetails: ... + max_samples: int, + model_options: Optional[DataGenerationModelOptions] = ..., + train_split: Optional[float] = ... + ) -> None: ... - @distributed_trace - def create_version_from_code( - self, - agent_name: str, - *, - code: IO[bytes], - code_zip_sha256: Optional[str] = ..., - definition: HostedAgentDefinition, - description: Optional[str] = ..., - metadata: Optional[dict[str, str]] = ..., - **kwargs: Any - ) -> AgentVersionDetails: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TracesDataGenerationJobSource(DataGenerationJobSource, discriminator='traces'): + agent_id: Optional[str] + agent_name: Optional[str] + agent_version: Optional[str] + description: str + end_time: Optional[datetime] + start_time: datetime + type: Literal[DataGenerationJobSourceType.TRACES] @overload - def create_version_from_manifest( + def __init__( self, - agent_name: str, *, - content_type: str = "application/json", + agent_id: Optional[str] = ..., + agent_name: Optional[str] = ..., + agent_version: Optional[str] = ..., description: Optional[str] = ..., - manifest_id: str, - metadata: Optional[dict[str, str]] = ..., - parameter_values: dict[str, Any], - **kwargs: Any - ) -> AgentVersionDetails: ... + end_time: Optional[datetime] = ..., + start_time: datetime + ) -> None: ... @overload - def create_version_from_manifest( - self, - agent_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AgentVersionDetails: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TracesEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator='traces'): + agent_id: Optional[str] + agent_name: Optional[str] + agent_version: Optional[str] + description: Optional[str] + end_time: Optional[datetime] + start_time: datetime + type: Literal[EvaluatorGenerationJobSourceType.TRACES] @overload - def create_version_from_manifest( + def __init__( self, - agent_name: str, - body: IO[bytes], *, - content_type: str = "application/json", - **kwargs: Any - ) -> AgentVersionDetails: ... + agent_id: Optional[str] = ..., + agent_name: Optional[str] = ..., + agent_version: Optional[str] = ..., + description: Optional[str] = ..., + end_time: Optional[datetime] = ..., + start_time: datetime + ) -> None: ... - @distributed_trace - def delete( - self, - agent_name: str, - *, - force: Optional[bool] = ..., - **kwargs: Any - ) -> DeleteAgentResponse: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def delete_session( - self, - agent_name: str, - session_id: str, - **kwargs: Any - ) -> None: ... - @distributed_trace - def delete_session_file( + class azure.ai.projects.models.TracesPreviewEvalRunDataSource(TypedDict, total=False): + key "agent_id": str + key "agent_name": str + key "end_time": datetime + key "ingestion_delay_seconds": int + key "lookback_hours": int + key "max_traces": int + key "trace_ids": List[str] + key "type": Required[Literal["azure_ai_traces_preview"]] + + + class azure.ai.projects.models.TranscriptTextUsageDuration(CreateTranscriptionResponseJsonUsage, discriminator='duration'): + seconds: timedelta + type: Literal[CreateTranscriptionResponseJsonUsageType.DURATION] + + @overload + def __init__( self, - agent_name: str, - session_id: str, *, - path: str, - recursive: Optional[bool] = ..., - **kwargs: Any + seconds: timedelta ) -> None: ... - @distributed_trace - def delete_version( - self, - agent_name: str, - agent_version: str, - *, - force: Optional[bool] = ..., - **kwargs: Any - ) -> DeleteAgentVersionResponse: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def disable( - self, - agent_name: str, - **kwargs: Any - ) -> None: ... - @distributed_trace - def download_code( - self, - agent_name: str, - *, - agent_version: Optional[str] = ..., - **kwargs: Any - ) -> Iterator[bytes]: ... + class azure.ai.projects.models.TranscriptTextUsageTokens(CreateTranscriptionResponseJsonUsage, discriminator='tokens'): + input_token_details: Optional[TranscriptTextUsageTokensInputTokenDetails] + input_tokens: int + output_tokens: int + total_tokens: int + type: Literal[CreateTranscriptionResponseJsonUsageType.TOKENS] - @distributed_trace - def download_session_file( + @overload + def __init__( self, - agent_name: str, - session_id: str, *, - path: str, - **kwargs: Any - ) -> Iterator[bytes]: ... - - @distributed_trace - def enable( - self, - agent_name: str, - **kwargs: Any + input_token_details: Optional[TranscriptTextUsageTokensInputTokenDetails] = ..., + input_tokens: int, + output_tokens: int, + total_tokens: int ) -> None: ... - @distributed_trace - def get( - self, - agent_name: str, - **kwargs: Any - ) -> AgentDetails: ... - - @distributed_trace - def get_session( - self, - agent_name: str, - session_id: str, - **kwargs: Any - ) -> AgentSessionResource: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def get_session_log_stream( - self, - agent_name: str, - agent_version: str, - session_id: str, - **kwargs: Any - ) -> SessionLogEvent: ... - @distributed_trace - def get_version( - self, - agent_name: str, - agent_version: str, - **kwargs: Any - ) -> AgentVersionDetails: ... + class azure.ai.projects.models.TranscriptTextUsageTokensInputTokenDetails(_Model): + audio_tokens: Optional[int] + text_tokens: Optional[int] - @distributed_trace - def list( + @overload + def __init__( self, *, - before: Optional[str] = ..., - kind: Optional[Union[str, AgentKind]] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> ItemPaged[AgentDetails]: ... + audio_tokens: Optional[int] = ..., + text_tokens: Optional[int] = ... + ) -> None: ... - @distributed_trace - def list_session_files( - self, - agent_name: str, - session_id: str, - *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - path: Optional[str] = ..., - **kwargs: Any - ) -> ItemPaged[SessionDirectoryEntry]: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def list_sessions( - self, - agent_name: str, - *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> ItemPaged[AgentSessionResource]: ... - @distributed_trace - def list_versions( - self, - agent_name: str, - *, - before: Optional[str] = ..., - include_drafts: Optional[bool] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> ItemPaged[AgentVersionDetails]: ... + class azure.ai.projects.models.TreatmentEffectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CHANGED = "Changed" + DEGRADED = "Degraded" + IMPROVED = "Improved" + INCONCLUSIVE = "Inconclusive" + TOO_FEW_SAMPLES = "TooFewSamples" - @distributed_trace - def stop_session( - self, - agent_name: str, - session_id: str, - **kwargs: Any - ) -> None: ... + + class azure.ai.projects.models.Trigger(_Model): + type: str @overload - def update_details( + def __init__( self, - agent_name: str, *, - agent_card: Optional[AgentCard] = ..., - agent_endpoint: Optional[AgentEndpointConfig] = ..., - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> AgentDetails: ... + type: str + ) -> None: ... @overload - def update_details( - self, - agent_name: str, - body: JSON, - *, - content_type: str = "application/merge-patch+json", + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CRON = "Cron" + ONE_TIME = "OneTime" + RECURRENCE = "Recurrence" + + + class azure.ai.projects.models.UpdateMemoriesLROPoller(LROPoller[MemoryStoreUpdateCompletedResult]): + property superseded_by: Optional[str] # Read-only + property update_id: str # Read-only + + @classmethod + def from_continuation_token( + cls, + polling_method: PollingMethod[MemoryStoreUpdateCompletedResult], + continuation_token: str, **kwargs: Any - ) -> AgentDetails: ... + ) -> UpdateMemoriesLROPoller: ... + + + class azure.ai.projects.models.UpdateModelVersionRequest(_Model): + description: Optional[str] + tags: Optional[dict[str, str]] @overload - def update_details( + def __init__( self, - agent_name: str, - body: IO[bytes], *, - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> AgentDetails: ... + description: Optional[str] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... - @distributed_trace - def upload_session_file( - self, - agent_name: str, - session_id: str, - content: bytes, - *, - path: str, - **kwargs: Any - ) -> SessionFileWriteResult: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.operations.BetaAgentsOperations: + class azure.ai.projects.models.UpdateToolboxRequest(_Model): + default_version: str + @overload def __init__( self, - *args, - **kwargs + *, + default_version: str ) -> None: ... @overload - def begin_create_optimization_job( - self, - job: OptimizationJob, - *, - content_type: str = "application/json", - operation_id: Optional[str] = ..., - **kwargs: Any - ) -> LROPoller[OptimizationJobResult]: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.UserProfileMemoryItem(MemoryItem, discriminator='user_profile'): + content: str + kind: Literal[MemoryItemKind.USER_PROFILE] + memory_id: str + scope: str + updated_at: datetime @overload - def begin_create_optimization_job( + def __init__( self, - job: JSON, *, - content_type: str = "application/json", - operation_id: Optional[str] = ..., - **kwargs: Any - ) -> LROPoller[OptimizationJobResult]: ... + content: str, + memory_id: str, + scope: str, + updated_at: datetime + ) -> None: ... @overload - def begin_create_optimization_job( - self, - job: IO[bytes], - *, - content_type: str = "application/json", - operation_id: Optional[str] = ..., - **kwargs: Any - ) -> LROPoller[OptimizationJobResult]: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def cancel_optimization_job( - self, - job_id: str, - **kwargs: Any - ) -> OptimizationJob: ... - @distributed_trace - def delete_optimization_job( + class azure.ai.projects.models.VersionIndicator(_Model): + type: str + + @overload + def __init__( self, - job_id: str, - **kwargs: Any + *, + type: str ) -> None: ... - @distributed_trace - def get_optimization_job( - self, - job_id: str, - **kwargs: Any - ) -> OptimizationJob: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def list_optimization_jobs( - self, - *, - agent_name: Optional[str] = ..., - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - status: Optional[Union[str, JobStatus]] = ..., - **kwargs: Any - ) -> ItemPaged[OptimizationJobListItem]: ... + class azure.ai.projects.models.VersionIndicatorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + VERSION_REF = "version_ref" - class azure.ai.projects.operations.BetaDatasetsOperations: + class azure.ai.projects.models.VersionRefIndicator(VersionIndicator, discriminator='version_ref'): + agent_version: str + type: Literal[VersionIndicatorType.VERSION_REF] + + @overload def __init__( self, - *args, - **kwargs + *, + agent_version: str ) -> None: ... @overload - def begin_create_generation_job( - self, - job: DataGenerationJob, - *, - content_type: str = "application/json", - operation_id: Optional[str] = ..., - **kwargs: Any - ) -> LROPoller[DataGenerationJobResult]: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VersionSelectionRule(_Model): + agent_version: str + type: str @overload - def begin_create_generation_job( + def __init__( self, - job: JSON, *, - content_type: str = "application/json", - operation_id: Optional[str] = ..., - **kwargs: Any - ) -> LROPoller[DataGenerationJobResult]: ... + agent_version: str, + type: str + ) -> None: ... @overload - def begin_create_generation_job( - self, - job: IO[bytes], - *, - content_type: str = "application/json", - operation_id: Optional[str] = ..., - **kwargs: Any - ) -> LROPoller[DataGenerationJobResult]: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def cancel_generation_job( - self, - job_id: str, - **kwargs: Any - ) -> DataGenerationJob: ... - @distributed_trace - def delete_generation_job( + class azure.ai.projects.models.VersionSelector(_Model): + version_selection_rules: list[VersionSelectionRule] + + @overload + def __init__( self, - job_id: str, - **kwargs: Any + *, + version_selection_rules: list[VersionSelectionRule] ) -> None: ... - @distributed_trace - def get_generation_job( - self, - job_id: str, - **kwargs: Any - ) -> DataGenerationJob: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def list_generation_jobs( + + class azure.ai.projects.models.VersionSelectorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FIXED_RATIO = "FixedRatio" + + + class azure.ai.projects.models.VoiceAgentAnimationConfig(_Model): + model_name: Optional[str] + outputs: Optional[list[Union[str, VoiceAgentAnimationOutputType]]] + + @overload + def __init__( self, *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> ItemPaged[DataGenerationJob]: ... + model_name: Optional[str] = ..., + outputs: Optional[list[Union[str, VoiceAgentAnimationOutputType]]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.operations.BetaEvaluationTaxonomiesOperations: + class azure.ai.projects.models.VoiceAgentAnimationOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BLENDSHAPES = "blendshapes" + VISEME_ID = "viseme_id" + + + class azure.ai.projects.models.VoiceAgentAvatarIceServer(_Model): + credential: Optional[str] + urls: list[str] + username: Optional[str] + @overload def __init__( self, - *args, - **kwargs + *, + credential: Optional[str] = ..., + urls: list[str], + username: Optional[str] = ... ) -> None: ... @overload - def create( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentAvatarScene(_Model): + amplitude: Optional[float] + position_x: Optional[float] + position_y: Optional[float] + rotation_x: Optional[float] + rotation_y: Optional[float] + rotation_z: Optional[float] + zoom: Optional[float] + + @overload + def __init__( self, - name: str, - taxonomy: EvaluationTaxonomy, *, - content_type: str = "application/json", - **kwargs: Any - ) -> EvaluationTaxonomy: ... + amplitude: Optional[float] = ..., + position_x: Optional[float] = ..., + position_y: Optional[float] = ..., + rotation_x: Optional[float] = ..., + rotation_y: Optional[float] = ..., + rotation_z: Optional[float] = ..., + zoom: Optional[float] = ... + ) -> None: ... @overload - def create( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentAvatarVideoBackground(_Model): + color: Optional[str] + image_url: Optional[str] + + @overload + def __init__( self, - name: str, - taxonomy: JSON, *, - content_type: str = "application/json", - **kwargs: Any - ) -> EvaluationTaxonomy: ... + color: Optional[str] = ..., + image_url: Optional[str] = ... + ) -> None: ... @overload - def create( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentAvatarVideoCrop(_Model): + bottom_right: list[int] + top_left: list[int] + + @overload + def __init__( self, - name: str, - taxonomy: IO[bytes], *, - content_type: str = "application/json", - **kwargs: Any - ) -> EvaluationTaxonomy: ... - - @distributed_trace - def delete( - self, - name: str, - **kwargs: Any + bottom_right: list[int], + top_left: list[int] ) -> None: ... - @distributed_trace - def get( - self, - name: str, - **kwargs: Any - ) -> EvaluationTaxonomy: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def list( - self, - *, - input_name: Optional[str] = ..., - input_type: Optional[str] = ..., - **kwargs: Any - ) -> ItemPaged[EvaluationTaxonomy]: ... + + class azure.ai.projects.models.VoiceAgentAvatarVideoParams(_Model): + background: Optional[VoiceAgentAvatarVideoBackground] + bitrate: Optional[int] + codec: Optional[Literal["h264"]] + crop: Optional[VoiceAgentAvatarVideoCrop] + gop_size: Optional[int] + resolution: Optional[VoiceAgentAvatarVideoResolution] @overload - def update( + def __init__( self, - name: str, - taxonomy: EvaluationTaxonomy, *, - content_type: str = "application/json", - **kwargs: Any - ) -> EvaluationTaxonomy: ... + background: Optional[VoiceAgentAvatarVideoBackground] = ..., + bitrate: Optional[int] = ..., + codec: Optional[Literal[h264]] = ..., + crop: Optional[VoiceAgentAvatarVideoCrop] = ..., + gop_size: Optional[int] = ..., + resolution: Optional[VoiceAgentAvatarVideoResolution] = ... + ) -> None: ... @overload - def update( - self, - name: str, - taxonomy: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> EvaluationTaxonomy: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentAvatarVideoResolution(_Model): + height: int + width: int @overload - def update( + def __init__( self, - name: str, - taxonomy: IO[bytes], *, - content_type: str = "application/json", - **kwargs: Any - ) -> EvaluationTaxonomy: ... + height: int, + width: int + ) -> None: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.operations.BetaEvaluatorsOperations: + class azure.ai.projects.models.VoiceAgentClientEventConversationItemCreate(_Model): + event_id: Optional[str] + item: VoiceAgentCreateConversationItem + previous_item_id: Optional[str] + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE] + + @overload def __init__( self, - *args, - **kwargs + *, + event_id: Optional[str] = ..., + item: VoiceAgentCreateConversationItem, + previous_item_id: Optional[str] = ..., + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE] ) -> None: ... @overload - def begin_create_generation_job( - self, - job: EvaluatorGenerationJob, - *, - content_type: str = "application/json", - operation_id: Optional[str] = ..., - **kwargs: Any - ) -> LROPoller[EvaluatorVersion]: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentClientEventConversationItemDelete(_Model): + event_id: Optional[str] + item_id: str + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE] @overload - def begin_create_generation_job( + def __init__( self, - job: JSON, *, - content_type: str = "application/json", - operation_id: Optional[str] = ..., - **kwargs: Any - ) -> LROPoller[EvaluatorVersion]: ... + event_id: Optional[str] = ..., + item_id: str, + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE] + ) -> None: ... @overload - def begin_create_generation_job( - self, - job: IO[bytes], - *, - content_type: str = "application/json", - operation_id: Optional[str] = ..., - **kwargs: Any - ) -> LROPoller[EvaluatorVersion]: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def cancel_generation_job( - self, - job_id: str, - **kwargs: Any - ) -> EvaluatorGenerationJob: ... + + class azure.ai.projects.models.VoiceAgentClientEventConversationItemRetrieve(_Model): + event_id: Optional[str] + item_id: str + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE] @overload - def create_version( + def __init__( self, - name: str, - evaluator_version: EvaluatorVersion, *, - content_type: str = "application/json", - **kwargs: Any - ) -> EvaluatorVersion: ... + event_id: Optional[str] = ..., + item_id: str, + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE] + ) -> None: ... @overload - def create_version( - self, - name: str, - evaluator_version: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> EvaluatorVersion: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentClientEventConversationItemTruncate(_Model): + audio_end_ms: int + content_index: int + event_id: Optional[str] + item_id: str + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE] @overload - def create_version( + def __init__( self, - name: str, - evaluator_version: IO[bytes], *, - content_type: str = "application/json", - **kwargs: Any - ) -> EvaluatorVersion: ... - - @distributed_trace - def delete_generation_job( - self, - job_id: str, - **kwargs: Any + audio_end_ms: int, + content_index: int, + event_id: Optional[str] = ..., + item_id: str, + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE] ) -> None: ... - @distributed_trace - def delete_version( - self, - name: str, - version: str, - **kwargs: Any - ) -> None: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentClientEventInputAudioBufferAppend(_Model): + audio: str + event_id: Optional[str] + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND] @overload - def get_credentials( + def __init__( self, - name: str, - version: str, - credential_request: EvaluatorCredentialRequest, *, - content_type: str = "application/json", - **kwargs: Any - ) -> DatasetCredential: ... + audio: str, + event_id: Optional[str] = ..., + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND] + ) -> None: ... @overload - def get_credentials( - self, - name: str, - version: str, - credential_request: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> DatasetCredential: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentClientEventInputAudioBufferClear(_Model): + event_id: Optional[str] + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR] @overload - def get_credentials( + def __init__( self, - name: str, - version: str, - credential_request: IO[bytes], *, - content_type: str = "application/json", - **kwargs: Any - ) -> DatasetCredential: ... + event_id: Optional[str] = ..., + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR] + ) -> None: ... - @distributed_trace - def get_generation_job( - self, - job_id: str, - **kwargs: Any - ) -> EvaluatorGenerationJob: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def get_version( - self, - name: str, - version: str, - **kwargs: Any - ) -> EvaluatorVersion: ... - @distributed_trace - def list( - self, - *, - limit: Optional[int] = ..., - type: Optional[Union[Literal[builtin], Literal[custom], Literal[all], str]] = ..., - **kwargs: Any - ) -> ItemPaged[EvaluatorVersion]: ... + class azure.ai.projects.models.VoiceAgentClientEventInputAudioBufferCommit(_Model): + event_id: Optional[str] + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT] - @distributed_trace - def list_generation_jobs( + @overload + def __init__( self, *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> ItemPaged[EvaluatorGenerationJob]: ... + event_id: Optional[str] = ..., + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def list_versions( - self, - name: str, - *, - limit: Optional[int] = ..., - type: Optional[Union[Literal[builtin], Literal[custom], Literal[all], str]] = ..., - **kwargs: Any - ) -> ItemPaged[EvaluatorVersion]: ... + + class azure.ai.projects.models.VoiceAgentClientEventOutputAudioBufferClear(_Model): + event_id: Optional[str] + type: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR] @overload - def pending_upload( + def __init__( self, - name: str, - version: str, - pending_upload_request: PendingUploadRequest, *, - content_type: str = "application/json", - **kwargs: Any - ) -> PendingUploadResponse: ... + event_id: Optional[str] = ..., + type: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR] + ) -> None: ... @overload - def pending_upload( - self, - name: str, - version: str, - pending_upload_request: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> PendingUploadResponse: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentClientEventResponseCancel(_Model): + event_id: Optional[str] + response_id: Optional[str] + type: Literal[RealtimeClientEventType.RESPONSE_CANCEL] @overload - def pending_upload( + def __init__( self, - name: str, - version: str, - pending_upload_request: IO[bytes], *, - content_type: str = "application/json", - **kwargs: Any - ) -> PendingUploadResponse: ... + event_id: Optional[str] = ..., + response_id: Optional[str] = ..., + type: Literal[RealtimeClientEventType.RESPONSE_CANCEL] + ) -> None: ... @overload - def update_version( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentClientEventResponseCreate(_Model): + event_id: Optional[str] + response: Optional[VoiceAgentResponseCreateParams] + type: Literal[RealtimeClientEventType.RESPONSE_CREATE] + + @overload + def __init__( self, - name: str, - version: str, - evaluator_version: EvaluatorVersion, *, - content_type: str = "application/json", - **kwargs: Any - ) -> EvaluatorVersion: ... + event_id: Optional[str] = ..., + response: Optional[VoiceAgentResponseCreateParams] = ..., + type: Literal[RealtimeClientEventType.RESPONSE_CREATE] + ) -> None: ... @overload - def update_version( - self, - name: str, - version: str, - evaluator_version: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> EvaluatorVersion: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentClientEventSessionAvatarConnect(_Model): + client_sdp: str + event_id: Optional[str] + type: Literal["connect"] @overload - def update_version( + def __init__( self, - name: str, - version: str, - evaluator_version: IO[bytes], *, - content_type: str = "application/json", - **kwargs: Any - ) -> EvaluatorVersion: ... + client_sdp: str, + event_id: Optional[str] = ... + ) -> None: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.operations.BetaInsightsOperations: + class azure.ai.projects.models.VoiceAgentClientEventSessionUpdate(_Model): + event_id: Optional[str] + session: VoiceAgentSessionUpdateConfig + type: Literal[RealtimeClientEventType.SESSION_UPDATE] + + @overload def __init__( self, - *args, - **kwargs + *, + event_id: Optional[str] = ..., + session: VoiceAgentSessionUpdateConfig, + type: Literal[RealtimeClientEventType.SESSION_UPDATE] ) -> None: ... @overload - def generate( - self, - insight: Insight, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Insight: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentDefinition(AgentDefinition, discriminator='voice'): + audio: Optional[VoiceAudioConfig] + avatar: Optional[VoiceAvatarConfig] + greeting: Optional[VoiceGreetingConfig] + include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] + instructions: Optional[str] + interim_response: Optional[VoiceAgentInterimResponse] + kind: Literal[AgentKind.VOICE] + max_output_tokens: Optional[VoiceAgentMaxOutputTokens] + model: str + model_type: 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]] + tool_choice: Optional[VoiceAgentToolChoice] + tools: Optional[list[VoiceAgentTool]] @overload - def generate( + def __init__( self, - insight: JSON, *, - content_type: str = "application/json", - **kwargs: Any - ) -> Insight: ... + audio: Optional[VoiceAudioConfig] = ..., + avatar: Optional[VoiceAvatarConfig] = ..., + greeting: Optional[VoiceGreetingConfig] = ..., + include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] = ..., + instructions: Optional[str] = ..., + interim_response: Optional[VoiceAgentInterimResponse] = ..., + max_output_tokens: Optional[VoiceAgentMaxOutputTokens] = ..., + model: str, + model_type: Union[str, VoiceModelType], + output_modalities: Optional[list[Union[str, VoiceOutputModality]]] = ..., + parallel_tool_calls: Optional[bool] = ..., + rai_config: Optional[RaiConfig] = ..., + store: Optional[bool] = ..., + structured_inputs: Optional[dict[str, StructuredInputDefinition]] = ..., + tool_choice: Optional[VoiceAgentToolChoice] = ..., + tools: Optional[list[VoiceAgentTool]] = ... + ) -> None: ... @overload - def generate( - self, - insight: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Insight: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def get( - self, - insight_id: str, - *, - include_coordinates: Optional[bool] = ..., - **kwargs: Any - ) -> Insight: ... - @distributed_trace - def list( + class azure.ai.projects.models.VoiceAgentEchoCancellation(_Model): + channels: Optional[int] + reference_source: Optional[Union[str, VoiceAgentEchoCancellationReferenceSource]] + type: Literal["server_echo_cancellation"] + + @overload + def __init__( self, *, - agent_name: Optional[str] = ..., - eval_id: Optional[str] = ..., - include_coordinates: Optional[bool] = ..., - run_id: Optional[str] = ..., - type: Optional[Union[str, InsightType]] = ..., - **kwargs: Any - ) -> ItemPaged[Insight]: ... + channels: Optional[int] = ..., + reference_source: Optional[Union[str, VoiceAgentEchoCancellationReferenceSource]] = ... + ) -> None: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentEchoCancellationReferenceSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CLIENT = "client" + SERVER = "server" - class azure.ai.projects.operations.BetaMemoryStoresOperations(GenerateBetaMemoryStoresOperations): + class azure.ai.projects.models.VoiceAgentFunctionTool(VoiceAgentTool, discriminator='function'): + description: Optional[str] + name: str + parameters: Optional[RealtimeFunctionToolParameters] + type: Literal["function"] + + @overload def __init__( self, - *args, - **kwargs + *, + description: Optional[str] = ..., + name: str, + parameters: Optional[RealtimeFunctionToolParameters] = ... ) -> None: ... @overload - def begin_update_memories( - self, - name: str, - *, - content_type: str = "application/json", - items: Optional[Union[str, ResponseInputParam]] = ..., - previous_update_id: Optional[str] = ..., - scope: str, - update_delay: Optional[int] = ..., - **kwargs: Any - ) -> UpdateMemoriesLROPoller: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentInterimResponseConfig(_Model): + latency_threshold_ms: Optional[int] + triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] + type: str @overload - def begin_update_memories( + def __init__( self, - name: str, - body: JSON, *, - content_type: str = "application/json", - **kwargs: Any - ) -> UpdateMemoriesLROPoller: ... + latency_threshold_ms: Optional[int] = ..., + triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] = ..., + type: str + ) -> None: ... @overload - def begin_update_memories( - self, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> UpdateMemoriesLROPoller: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentInterimResponseTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LATENCY = "latency" + TOOL = "tool" + + + class azure.ai.projects.models.VoiceAgentLlmInterimResponseConfig(VoiceAgentInterimResponseConfig, discriminator='llm_interim_response'): + instructions: Optional[str] + latency_threshold_ms: int + max_completion_tokens: Optional[int] + model: Optional[str] + triggers: Union[list[str, VoiceAgentInterimResponseTrigger]] + type: Literal["llm_interim_response"] @overload - def create( + def __init__( self, *, - content_type: str = "application/json", - definition: MemoryStoreDefinition, - description: Optional[str] = ..., - metadata: Optional[dict[str, str]] = ..., - name: str, - **kwargs: Any - ) -> MemoryStoreDetails: ... + instructions: Optional[str] = ..., + latency_threshold_ms: Optional[int] = ..., + max_completion_tokens: Optional[int] = ..., + model: Optional[str] = ..., + triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] = ... + ) -> None: ... @overload - def create( - self, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> MemoryStoreDetails: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentMcpTool(VoiceAgentTool, discriminator='mcp'): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] + allowed_tools: Optional[Union[list[str], MCPToolFilter]] + authorization: Optional[str] + defer_loading: Optional[bool] + headers: Optional[dict[str, str]] + project_connection_id: Optional[str] + require_approval: Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] + response_scheduling: Optional[Union[str, VoiceAgentToolResponseScheduling]] + server_description: Optional[str] + server_label: str + server_url: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal["mcp"] @overload - def create( + def __init__( self, - body: IO[bytes], *, - content_type: str = "application/json", - **kwargs: Any - ) -> MemoryStoreDetails: ... + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., + allowed_tools: Optional[Union[list[str], MCPToolFilter]] = ..., + authorization: Optional[str] = ..., + defer_loading: Optional[bool] = ..., + headers: Optional[dict[str, str]] = ..., + project_connection_id: Optional[str] = ..., + require_approval: Optional[Union[MCPToolRequireApproval, Literal[always], Literal[never]]] = ..., + response_scheduling: Optional[Union[str, VoiceAgentToolResponseScheduling]] = ..., + server_description: Optional[str] = ..., + server_label: str, + server_url: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... + ) -> None: ... @overload - def create_memory( - self, - name: str, - *, - content: str, - content_type: str = "application/json", - kind: Union[str, MemoryItemKind], - scope: str, - **kwargs: Any - ) -> MemoryItem: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentRealtimeResponse(OmitPropertiesRealtimeResponse1): + audio: Optional[VoiceResponseAudio] + conversation_id: str + id: str + max_output_tokens: Union[int, str] + metadata: Metadata + object: str + output: Optional[list[VoiceAgentResponseItem]] + output_modalities: Union[list[str, str]] + status: Union[str, str, str, str, str] + status_details: RealtimeResponseStatusDetails + usage: RealtimeResponseUsage @overload - def create_memory( + def __init__( self, - name: str, - body: JSON, *, - content_type: str = "application/json", - **kwargs: Any - ) -> MemoryItem: ... + audio: Optional[VoiceResponseAudio] = ..., + conversation_id: Optional[str] = ..., + id: Optional[str] = ..., + max_output_tokens: Optional[Union[int, Literal[inf]]] = ..., + metadata: Optional[Metadata] = ..., + object: Optional[Literal[response]] = ..., + output: Optional[list[VoiceAgentResponseItem]] = ..., + output_modalities: Optional[list[Literal[text, audio]]] = ..., + status: Optional[Literal[completed, cancelled, failed, incomplete, in_progress]] = ..., + status_details: Optional[RealtimeResponseStatusDetails] = ..., + usage: Optional[RealtimeResponseUsage] = ... + ) -> None: ... @overload - def create_memory( - self, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> MemoryItem: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def delete( - self, - name: str, - **kwargs: Any - ) -> DeleteMemoryStoreResult: ... - @distributed_trace - def delete_memory( - self, - name: str, - memory_id: str, - **kwargs: Any - ) -> DeleteMemoryResult: ... + class azure.ai.projects.models.VoiceAgentResponseCreateParams(_Model): + audio: Optional[PickPropertiesVoiceAudioConfig] + conversation: Optional[Union[Literal["auto"], Literal["none"], str]] + input: Optional[list[RealtimeConversationItem]] + instructions: Optional[str] + interim_response: Optional[VoiceAgentInterimResponse] + max_output_tokens: Optional[Union[int, Literal["inf"]]] + metadata: Optional[Metadata] + output_modalities: Optional[list[Union[str, VoiceOutputModality]]] + parallel_tool_calls: Optional[bool] + pre_generated_assistant_message: Optional[RealtimeConversationItemMessageAssistant] + reasoning: Optional[RealtimeReasoning] + tool_choice: Optional[Union[str, ToolChoiceOptions, ToolChoiceFunction, ToolChoiceMCP]] + tools: Optional[list[Union[RealtimeFunctionTool, MCPTool]]] @overload - def delete_scope( + def __init__( self, - name: str, *, - content_type: str = "application/json", - scope: str, - **kwargs: Any - ) -> MemoryStoreDeleteScopeResult: ... + audio: Optional[PickPropertiesVoiceAudioConfig] = ..., + conversation: Optional[Union[Literal[auto], Literal[none], str]] = ..., + input: Optional[list[RealtimeConversationItem]] = ..., + instructions: Optional[str] = ..., + interim_response: Optional[VoiceAgentInterimResponse] = ..., + max_output_tokens: Optional[Union[int, Literal[inf]]] = ..., + metadata: Optional[Metadata] = ..., + output_modalities: Optional[list[Union[str, VoiceOutputModality]]] = ..., + parallel_tool_calls: Optional[bool] = ..., + pre_generated_assistant_message: Optional[RealtimeConversationItemMessageAssistant] = ..., + reasoning: Optional[RealtimeReasoning] = ..., + tool_choice: Optional[Union[str, ToolChoiceOptions, ToolChoiceFunction, ToolChoiceMCP]] = ..., + tools: Optional[list[Union[RealtimeFunctionTool, MCPTool]]] = ... + ) -> None: ... @overload - def delete_scope( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentResponseEventContentPart(_Model): + audio: Optional[str] + format: Optional[VoiceAudioFormat] + text: Optional[str] + transcript: Optional[str] + type: Optional[Literal["audio", "text"]] + + @overload + def __init__( self, - name: str, - body: JSON, *, - content_type: str = "application/json", - **kwargs: Any - ) -> MemoryStoreDeleteScopeResult: ... + audio: Optional[str] = ..., + format: Optional[VoiceAudioFormat] = ..., + text: Optional[str] = ..., + transcript: Optional[str] = ..., + type: Optional[Literal[audio, text]] = ... + ) -> None: ... @overload - def delete_scope( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentSemanticVadTurnDetection(VoiceTurnDetection, discriminator='semantic_vad'): + auto_truncate: bool + create_response: Optional[bool] + eagerness: Optional[Literal["low", "medium", "high", "auto"]] + interrupt_response: Optional[bool] + type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD] + + @overload + def __init__( self, - name: str, - body: IO[bytes], *, - content_type: str = "application/json", - **kwargs: Any - ) -> MemoryStoreDeleteScopeResult: ... + auto_truncate: Optional[bool] = ..., + create_response: Optional[bool] = ..., + eagerness: Optional[Literal[low, medium, high, auto]] = ..., + interrupt_response: Optional[bool] = ... + ) -> None: ... - @distributed_trace - def get( - self, - name: str, - **kwargs: Any - ) -> MemoryStoreDetails: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def get_memory( - self, - name: str, - memory_id: str, - **kwargs: Any - ) -> MemoryItem: ... - @distributed_trace - def list( + class azure.ai.projects.models.VoiceAgentServerEventConversationItemAdded(_Model): + event_id: str + item: VoiceAgentResponseItem + previous_item_id: Optional[str] + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED] + + @overload + def __init__( self, *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> ItemPaged[MemoryStoreDetails]: ... + event_id: str, + item: VoiceAgentResponseItem, + previous_item_id: Optional[str] = ..., + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED] + ) -> None: ... @overload - def list_memories( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventConversationItemCreated(_Model): + event_id: str + item: VoiceAgentResponseItem + previous_item_id: Optional[str] + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED] + + @overload + def __init__( self, - name: str, *, - before: Optional[str] = ..., - content_type: str = "application/json", - kind: Optional[Union[str, MemoryItemKind]] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - scope: str, - **kwargs: Any - ) -> ItemPaged[MemoryItem]: ... + event_id: str, + item: VoiceAgentResponseItem, + previous_item_id: Optional[str] = ..., + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED] + ) -> None: ... @overload - def list_memories( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventConversationItemDeleted(_Model): + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED] + + @overload + def __init__( self, - name: str, - body: JSON, *, - before: Optional[str] = ..., - content_type: str = "application/json", - kind: Optional[Union[str, MemoryItemKind]] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> ItemPaged[MemoryItem]: ... + event_id: str, + item_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED] + ) -> None: ... @overload - def list_memories( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventConversationItemDone(_Model): + event_id: str + item: VoiceAgentResponseItem + previous_item_id: Optional[str] + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE] + + @overload + def __init__( self, - name: str, - body: IO[bytes], *, - before: Optional[str] = ..., - content_type: str = "application/json", - kind: Optional[Union[str, MemoryItemKind]] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> ItemPaged[MemoryItem]: ... + event_id: str, + item: VoiceAgentResponseItem, + previous_item_id: Optional[str] = ..., + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE] + ) -> None: ... @overload - def search_memories( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted(_Model): + content_index: int + event_id: str + item_id: str + logprobs: Optional[list[LogProbProperties]] + phrases: Optional[list[VoiceAgentTranscriptionPhrase]] + transcript: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED] + usage: Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration] + + @overload + def __init__( self, - name: str, *, - content_type: str = "application/json", - items: Optional[Union[str, ResponseInputParam]] = ..., - options: Optional[MemorySearchOptions] = ..., - previous_search_id: Optional[str] = ..., - scope: str, - **kwargs: Any - ) -> MemoryStoreSearchResult: ... + content_index: int, + event_id: str, + item_id: str, + logprobs: Optional[list[LogProbProperties]] = ..., + phrases: Optional[list[VoiceAgentTranscriptionPhrase]] = ..., + transcript: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED], + usage: Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration] + ) -> None: ... @overload - def search_memories( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta(_Model): + content_index: Optional[int] + delta: Optional[str] + event_id: str + item_id: str + logprobs: Optional[list[LogProbProperties]] + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA] + + @overload + def __init__( self, - name: str, - body: JSON, *, - content_type: str = "application/json", - **kwargs: Any - ) -> MemoryStoreSearchResult: ... + content_index: Optional[int] = ..., + delta: Optional[str] = ..., + event_id: str, + item_id: str, + logprobs: Optional[list[LogProbProperties]] = ..., + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA] + ) -> None: ... @overload - def search_memories( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed(_Model): + content_index: int + error: RealtimeServerEventConversationItemInputAudioTranscriptionFailedError + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED] + + @overload + def __init__( self, - name: str, - body: IO[bytes], *, - content_type: str = "application/json", - **kwargs: Any - ) -> MemoryStoreSearchResult: ... + content_index: int, + error: RealtimeServerEventConversationItemInputAudioTranscriptionFailedError, + event_id: str, + item_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED] + ) -> None: ... @overload - def update( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment(_Model): + content_index: int + end: float + event_id: str + id: str + item_id: str + speaker: str + start: float + text: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT] + + @overload + def __init__( self, - name: str, *, - content_type: str = "application/json", - description: Optional[str] = ..., - metadata: Optional[dict[str, str]] = ..., - **kwargs: Any - ) -> MemoryStoreDetails: ... + content_index: int, + end: float, + event_id: str, + id: str, + item_id: str, + speaker: str, + start: float, + text: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT] + ) -> None: ... @overload - def update( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventConversationItemRetrieved(_Model): + event_id: str + item: VoiceAgentResponseItem + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED] + + @overload + def __init__( self, - name: str, - body: JSON, *, - content_type: str = "application/json", - **kwargs: Any - ) -> MemoryStoreDetails: ... + event_id: str, + item: VoiceAgentResponseItem, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED] + ) -> None: ... @overload - def update( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventConversationItemTruncated(_Model): + audio_end_ms: int + content_index: int + event_id: str + item: Optional[RealtimeConversationItemMessageAssistant] + item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED] + + @overload + def __init__( self, - name: str, - body: IO[bytes], *, - content_type: str = "application/json", - **kwargs: Any - ) -> MemoryStoreDetails: ... + audio_end_ms: int, + content_index: int, + event_id: str, + item: Optional[RealtimeConversationItemMessageAssistant] = ..., + item_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED] + ) -> None: ... @overload - def update_memory( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventInputAudioBufferCleared(_Model): + event_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED] + + @overload + def __init__( self, - name: str, - memory_id: str, *, - content: str, - content_type: str = "application/json", - **kwargs: Any - ) -> MemoryItem: ... + event_id: str, + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED] + ) -> None: ... @overload - def update_memory( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventInputAudioBufferCommitted(_Model): + event_id: str + item_id: str + previous_item_id: Optional[str] + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED] + + @overload + def __init__( self, - name: str, - memory_id: str, - body: JSON, *, - content_type: str = "application/json", - **kwargs: Any - ) -> MemoryItem: ... + event_id: str, + item_id: str, + previous_item_id: Optional[str] = ..., + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED] + ) -> None: ... @overload - def update_memory( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventInputAudioBufferSpeechStarted(_Model): + audio_start_ms: int + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED] + + @overload + def __init__( self, - name: str, - memory_id: str, - body: IO[bytes], *, - content_type: str = "application/json", - **kwargs: Any - ) -> MemoryItem: ... + audio_start_ms: int, + event_id: str, + item_id: str, + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED] + ) -> None: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.operations.BetaModelsOperations(BetaModelsOperationsGenerated): + class azure.ai.projects.models.VoiceAgentServerEventInputAudioBufferSpeechStopped(_Model): + audio_end_ms: int + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED] + + @overload def __init__( self, - *args, - **kwargs + *, + audio_end_ms: int, + event_id: str, + item_id: str, + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED] ) -> None: ... @overload - def create( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventInputAudioBufferTimeoutTriggered(_Model): + audio_end_ms: int + audio_start_ms: int + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED] + + @overload + def __init__( self, *, - azcopy_path: Optional[str] = ..., - base_model: Optional[str] = ..., - description: Optional[str] = ..., - name: str, - polling_interval: float = 2.0, - polling_timeout: float = 300.0, - source: Union[str, PathLike[str]], - tags: Optional[dict[str, str]] = ..., - version: str, - wait_for_commit: Literal[True] = True, - weight_type: Optional[str] = ..., - **kwargs: Any - ) -> ModelVersion: ... + audio_end_ms: int, + audio_start_ms: int, + event_id: str, + item_id: str, + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED] + ) -> None: ... @overload - def create( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventMcpListToolsCompleted(_Model): + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED] + + @overload + def __init__( self, *, - azcopy_path: Optional[str] = ..., - base_model: Optional[str] = ..., - description: Optional[str] = ..., - name: str, - polling_interval: float = 2.0, - polling_timeout: float = 300.0, - source: Union[str, PathLike[str]], - tags: Optional[dict[str, str]] = ..., - version: str, - wait_for_commit: Literal[False], - weight_type: Optional[str] = ..., - **kwargs: Any + event_id: str, + item_id: str, + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED] ) -> None: ... - @distributed_trace - def delete( - self, - name: str, - version: str, - **kwargs: Any - ) -> None: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def get( - self, - name: str, - version: str, - **kwargs: Any - ) -> ModelVersion: ... + + class azure.ai.projects.models.VoiceAgentServerEventMcpListToolsFailed(_Model): + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED] @overload - def get_credentials( + def __init__( self, - name: str, - version: str, - credential_request: ModelCredentialRequest, *, - content_type: str = "application/json", - **kwargs: Any - ) -> DatasetCredential: ... + event_id: str, + item_id: str, + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED] + ) -> None: ... @overload - def get_credentials( - self, - name: str, - version: str, - credential_request: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> DatasetCredential: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventMcpListToolsInProgress(_Model): + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS] @overload - def get_credentials( + def __init__( self, - name: str, - version: str, - credential_request: IO[bytes], *, - content_type: str = "application/json", - **kwargs: Any - ) -> DatasetCredential: ... + event_id: str, + item_id: str, + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS] + ) -> None: ... - @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged[ModelVersion]: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def list_versions( - self, - name: str, - **kwargs: Any - ) -> ItemPaged[ModelVersion]: ... + + class azure.ai.projects.models.VoiceAgentServerEventOutputAudioBufferCleared(_Model): + event_id: str + response_id: str + type: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED] @overload - def pending_create_version( + def __init__( self, - name: str, - version: str, - model_version: ModelVersion, *, - content_type: str = "application/json", - **kwargs: Any - ) -> CreateAsyncResponse: ... + event_id: str, + response_id: str, + type: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED] + ) -> None: ... @overload - def pending_create_version( - self, - name: str, - version: str, - model_version: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> CreateAsyncResponse: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventRateLimitsUpdated(_Model): + event_id: str + rate_limits: list[RealtimeServerEventRateLimitsUpdatedRateLimits] + type: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED] @overload - def pending_create_version( + def __init__( self, - name: str, - version: str, - model_version: IO[bytes], *, - content_type: str = "application/json", - **kwargs: Any - ) -> CreateAsyncResponse: ... + event_id: str, + rate_limits: list[RealtimeServerEventRateLimitsUpdatedRateLimits], + type: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED] + ) -> None: ... @overload - def pending_upload( - self, - name: str, - version: str, - pending_upload_request: ModelPendingUploadRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> ModelPendingUploadResponse: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventResponseAnimationBlendshapesDelta(_Model): + content_index: int + event_id: str + frame_index: int + frames: list[list[float]] + item_id: str + output_index: int + response_id: str + type: Literal["delta"] @overload - def pending_upload( + def __init__( self, - name: str, - version: str, - pending_upload_request: JSON, *, - content_type: str = "application/json", - **kwargs: Any - ) -> ModelPendingUploadResponse: ... + content_index: int, + event_id: str, + frame_index: int, + frames: list[list[float]], + item_id: str, + output_index: int, + response_id: str + ) -> None: ... @overload - def pending_upload( - self, - name: str, - version: str, - pending_upload_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> ModelPendingUploadResponse: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventResponseAnimationBlendshapesDone(_Model): + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal["done"] @overload - def update( + def __init__( self, - name: str, - version: str, - model_version_update: UpdateModelVersionRequest, *, - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> ModelVersion: ... + event_id: str, + item_id: str, + output_index: int, + response_id: str + ) -> None: ... @overload - def update( - self, - name: str, - version: str, - model_version_update: JSON, - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> ModelVersion: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventResponseAnimationVisemeDelta(_Model): + audio_offset_ms: int + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal["delta"] + viseme_id: int @overload - def update( + def __init__( self, - name: str, - version: str, - model_version_update: IO[bytes], *, - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> ModelVersion: ... + audio_offset_ms: int, + content_index: int, + event_id: str, + item_id: str, + output_index: int, + response_id: str, + viseme_id: int + ) -> None: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.operations.BetaOperations(GeneratedBetaOperations): - agents: BetaAgentsOperations - datasets: BetaDatasetsOperations - evaluation_taxonomies: BetaEvaluationTaxonomiesOperations - evaluators: BetaEvaluatorsOperations - insights: BetaInsightsOperations - memory_stores: BetaMemoryStoresOperations - models: BetaModelsOperations - red_teams: BetaRedTeamsOperations - routines: BetaRoutinesOperations - schedules: BetaSchedulesOperations - skills: BetaSkillsOperations + class azure.ai.projects.models.VoiceAgentServerEventResponseAnimationVisemeDone(_Model): + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal["done"] + + @overload def __init__( self, - *args: Any, - **kwargs: Any + *, + content_index: int, + event_id: str, + item_id: str, + output_index: int, + response_id: str ) -> None: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + - class azure.ai.projects.operations.BetaRedTeamsOperations: + class azure.ai.projects.models.VoiceAgentServerEventResponseAudioDelta(_Model): + content_index: int + delta: bytes + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA] + @overload def __init__( self, - *args, - **kwargs + *, + content_index: int, + delta: bytes, + event_id: str, + item_id: str, + output_index: int, + response_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA] ) -> None: ... @overload - def create( - self, - red_team: RedTeam, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> RedTeam: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventResponseAudioDone(_Model): + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE] @overload - def create( + def __init__( self, - red_team: JSON, *, - content_type: str = "application/json", - **kwargs: Any - ) -> RedTeam: ... + content_index: int, + event_id: str, + item_id: str, + output_index: int, + response_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE] + ) -> None: ... @overload - def create( - self, - red_team: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> RedTeam: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def get( + + class azure.ai.projects.models.VoiceAgentServerEventResponseAudioTimestampDelta(_Model): + audio_duration_ms: int + audio_offset_ms: int + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + text: str + timestamp_type: Literal["word"] + type: Literal["delta"] + + @overload + def __init__( self, - name: str, - **kwargs: Any - ) -> RedTeam: ... + *, + audio_duration_ms: int, + audio_offset_ms: int, + content_index: int, + event_id: str, + item_id: str, + output_index: int, + response_id: str, + text: str + ) -> None: ... - @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged[RedTeam]: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.operations.BetaRoutinesOperations: + class azure.ai.projects.models.VoiceAgentServerEventResponseAudioTimestampDone(_Model): + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal["done"] + @overload def __init__( self, - *args, - **kwargs + *, + content_index: int, + event_id: str, + item_id: str, + output_index: int, + response_id: str ) -> None: ... @overload - def create_or_update( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventResponseAudioTranscriptDelta(_Model): + content_index: int + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA] + + @overload + def __init__( self, - routine_name: str, *, - action: Optional[RoutineAction] = ..., - content_type: str = "application/json", - description: Optional[str] = ..., - enabled: Optional[bool] = ..., - triggers: Optional[dict[str, RoutineTrigger]] = ..., - **kwargs: Any - ) -> Routine: ... + content_index: int, + delta: str, + event_id: str, + item_id: str, + output_index: int, + response_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA] + ) -> None: ... @overload - def create_or_update( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventResponseAudioTranscriptDone(_Model): + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + transcript: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE] + + @overload + def __init__( self, - routine_name: str, - body: JSON, *, - content_type: str = "application/json", - **kwargs: Any - ) -> Routine: ... + content_index: int, + event_id: str, + item_id: str, + output_index: int, + response_id: str, + transcript: str, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE] + ) -> None: ... @overload - def create_or_update( - self, - routine_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Routine: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def delete( - self, - routine_name: str, - **kwargs: Any - ) -> None: ... - @distributed_trace - def disable( - self, - routine_name: str, - **kwargs: Any - ) -> Routine: ... + class azure.ai.projects.models.VoiceAgentServerEventResponseContentPartDone(_Model): + content_index: int + event_id: str + item_id: str + output_index: int + part: VoiceAgentResponseEventContentPart + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE] @overload - def dispatch( + def __init__( self, - routine_name: str, *, - content_type: str = "application/json", - payload: Optional[RoutineDispatchPayload] = ..., - **kwargs: Any - ) -> DispatchRoutineResult: ... + content_index: int, + event_id: str, + item_id: str, + output_index: int, + part: VoiceAgentResponseEventContentPart, + response_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE] + ) -> None: ... @overload - def dispatch( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventResponseCreated(_Model): + event_id: str + response: VoiceAgentRealtimeResponse + type: Literal[RealtimeServerEventType.RESPONSE_CREATED] + + @overload + def __init__( self, - routine_name: str, - body: JSON, *, - content_type: str = "application/json", - **kwargs: Any - ) -> DispatchRoutineResult: ... + event_id: str, + response: VoiceAgentRealtimeResponse, + type: Literal[RealtimeServerEventType.RESPONSE_CREATED] + ) -> None: ... @overload - def dispatch( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventResponseDone(_Model): + event_id: str + response: VoiceAgentRealtimeResponse + type: Literal[RealtimeServerEventType.RESPONSE_DONE] + + @overload + def __init__( self, - routine_name: str, - body: IO[bytes], *, - content_type: str = "application/json", - **kwargs: Any - ) -> DispatchRoutineResult: ... + event_id: str, + response: VoiceAgentRealtimeResponse, + type: Literal[RealtimeServerEventType.RESPONSE_DONE] + ) -> None: ... - @distributed_trace - def enable( - self, - routine_name: str, - **kwargs: Any - ) -> Routine: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def get( - self, - routine_name: str, - **kwargs: Any - ) -> Routine: ... - @distributed_trace - def list( + class azure.ai.projects.models.VoiceAgentServerEventResponseFunctionCallArgumentsDelta(_Model): + call_id: str + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA] + + @overload + def __init__( self, *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[str] = ..., - **kwargs: Any - ) -> ItemPaged[Routine]: ... + call_id: str, + delta: str, + event_id: str, + item_id: str, + output_index: int, + response_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA] + ) -> None: ... - @distributed_trace - def list_runs( + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventResponseFunctionCallArgumentsDone(_Model): + arguments: str + call_id: str + event_id: str + item_id: str + name: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE] + + @overload + def __init__( self, - routine_name: str, *, - before: Optional[str] = ..., - filter: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[str] = ..., - **kwargs: Any - ) -> ItemPaged[RoutineRun]: ... + arguments: str, + call_id: str, + event_id: str, + item_id: str, + name: str, + output_index: int, + response_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.operations.BetaSchedulesOperations: + class azure.ai.projects.models.VoiceAgentServerEventResponseMcpCallArgumentsDelta(_Model): + delta: str + event_id: str + item_id: str + obfuscation: Optional[str] + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA] + @overload def __init__( self, - *args, - **kwargs + *, + delta: str, + event_id: str, + item_id: str, + obfuscation: Optional[str] = ..., + output_index: int, + response_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA] ) -> None: ... @overload - def create_or_update( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventResponseMcpCallArgumentsDone(_Model): + arguments: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE] + + @overload + def __init__( self, - schedule_id: str, - schedule: Schedule, *, - content_type: str = "application/json", - **kwargs: Any - ) -> Schedule: ... + arguments: str, + event_id: str, + item_id: str, + output_index: int, + response_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE] + ) -> None: ... @overload - def create_or_update( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventResponseMcpCallCompleted(_Model): + event_id: str + item_id: str + output_index: int + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED] + + @overload + def __init__( self, - schedule_id: str, - schedule: JSON, *, - content_type: str = "application/json", - **kwargs: Any - ) -> Schedule: ... + event_id: str, + item_id: str, + output_index: int, + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED] + ) -> None: ... @overload - def create_or_update( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventResponseMcpCallFailed(_Model): + event_id: str + item_id: str + output_index: int + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED] + + @overload + def __init__( self, - schedule_id: str, - schedule: IO[bytes], *, - content_type: str = "application/json", - **kwargs: Any - ) -> Schedule: ... + event_id: str, + item_id: str, + output_index: int, + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED] + ) -> None: ... - @distributed_trace - def delete( + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventResponseMcpCallInProgress(_Model): + event_id: str + item_id: str + output_index: int + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS] + + @overload + def __init__( self, - schedule_id: str, - **kwargs: Any + *, + event_id: str, + item_id: str, + output_index: int, + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS] ) -> None: ... - @distributed_trace - def get( - self, - schedule_id: str, - **kwargs: Any - ) -> Schedule: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def get_run( - self, - schedule_id: str, - run_id: str, - **kwargs: Any - ) -> ScheduleRun: ... - @distributed_trace - def list( + class azure.ai.projects.models.VoiceAgentServerEventResponseOutputItemAdded(_Model): + event_id: str + item: VoiceAgentResponseItem + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED] + + @overload + def __init__( self, *, - enabled: Optional[bool] = ..., - type: Optional[Union[str, ScheduleTaskType]] = ..., - **kwargs: Any - ) -> ItemPaged[Schedule]: ... + event_id: str, + item: VoiceAgentResponseItem, + output_index: int, + response_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED] + ) -> None: ... - @distributed_trace - def list_runs( + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventResponseOutputItemDone(_Model): + event_id: str + item: VoiceAgentResponseItem + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE] + + @overload + def __init__( self, - schedule_id: str, *, - enabled: Optional[bool] = ..., - type: Optional[Union[str, ScheduleTaskType]] = ..., - **kwargs: Any - ) -> ItemPaged[ScheduleRun]: ... + event_id: str, + item: VoiceAgentResponseItem, + output_index: int, + response_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE] + ) -> None: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.operations.BetaSkillsOperations: + class azure.ai.projects.models.VoiceAgentServerEventResponseTextDelta(_Model): + content_index: int + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA] + + @overload def __init__( self, - *args, - **kwargs + *, + content_index: int, + delta: str, + event_id: str, + item_id: str, + output_index: int, + response_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA] ) -> None: ... @overload - def create( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventResponseTextDone(_Model): + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + text: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE] + + @overload + def __init__( self, - name: str, *, - content_type: str = "application/json", - default: Optional[bool] = ..., - inline_content: Optional[SkillInlineContent] = ..., - **kwargs: Any - ) -> SkillVersion: ... + content_index: int, + event_id: str, + item_id: str, + output_index: int, + response_id: str, + text: str, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE] + ) -> None: ... @overload - def create( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventResponseVideoDelta(_Model): + codec: str + delta: str + event_id: str + output_index: int + type: Literal["delta"] + + @overload + def __init__( self, - name: str, - body: JSON, *, - content_type: str = "application/json", - **kwargs: Any - ) -> SkillVersion: ... + codec: str, + delta: str, + event_id: str, + output_index: int + ) -> None: ... @overload - def create( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventSessionAvatarConnecting(_Model): + event_id: str + server_sdp: str + type: Literal["connecting"] + + @overload + def __init__( self, - name: str, - body: IO[bytes], *, - content_type: str = "application/json", - **kwargs: Any - ) -> SkillVersion: ... + event_id: str, + server_sdp: str + ) -> None: ... @overload - def create_from_files( - self, - name: str, - content: CreateSkillVersionFromFilesBody, - **kwargs: Any - ) -> SkillVersion: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventSessionAvatarSwitchToIdle(_Model): + event_id: str + turn_id: Optional[str] + type: Literal["switch_to_idle"] @overload - def create_from_files( + def __init__( self, - name: str, - content: JSON, - **kwargs: Any - ) -> SkillVersion: ... + *, + event_id: str, + turn_id: Optional[str] = ... + ) -> None: ... - @distributed_trace - def delete( - self, - name: str, - **kwargs: Any - ) -> DeleteSkillResult: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def delete_version( - self, - name: str, - version: str, - **kwargs: Any - ) -> DeleteSkillVersionResult: ... - @distributed_trace - def download( - self, - name: str, - **kwargs: Any - ) -> Iterator[bytes]: ... + class azure.ai.projects.models.VoiceAgentServerEventSessionAvatarSwitchToSpeaking(_Model): + event_id: str + turn_id: Optional[str] + type: Literal["switch_to_speaking"] - @distributed_trace - def download_version( + @overload + def __init__( self, - name: str, - version: str, - **kwargs: Any - ) -> Iterator[bytes]: ... + *, + event_id: str, + turn_id: Optional[str] = ... + ) -> None: ... - @distributed_trace - def get( - self, - name: str, - **kwargs: Any - ) -> SkillDetails: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def get_version( - self, - name: str, - version: str, - **kwargs: Any - ) -> SkillVersion: ... - @distributed_trace - def list( - self, - *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> ItemPaged[SkillDetails]: ... + class azure.ai.projects.models.VoiceAgentServerEventSessionCreated(_Model): + event_id: str + session: VoiceAgentSessionResponseConfig + type: Literal[RealtimeServerEventType.SESSION_CREATED] - @distributed_trace - def list_versions( + @overload + def __init__( self, - name: str, *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> ItemPaged[SkillVersion]: ... + event_id: str, + session: VoiceAgentSessionResponseConfig, + type: Literal[RealtimeServerEventType.SESSION_CREATED] + ) -> None: ... @overload - def update( - self, - name: str, - *, - content_type: str = "application/json", - default_version: str, - **kwargs: Any - ) -> SkillDetails: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventSessionUpdated(_Model): + event_id: str + session: VoiceAgentSessionResponseConfig + type: Literal[RealtimeServerEventType.SESSION_UPDATED] @overload - def update( + def __init__( self, - name: str, - body: JSON, *, - content_type: str = "application/json", - **kwargs: Any - ) -> SkillDetails: ... + event_id: str, + session: VoiceAgentSessionResponseConfig, + type: Literal[RealtimeServerEventType.SESSION_UPDATED] + ) -> None: ... @overload - def update( - self, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> SkillDetails: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.operations.ConnectionsOperations(ConnectionsOperationsGenerated): + class azure.ai.projects.models.VoiceAgentServerEventWarning(_Model): + event_id: str + type: Literal["warning"] + warning: VoiceAgentServerEventWarningDetails + @overload def __init__( self, - *args, - **kwargs + *, + event_id: str, + warning: VoiceAgentServerEventWarningDetails ) -> None: ... - @distributed_trace - def get( - self, - name: str, - *, - include_credentials: Optional[bool] = False, - **kwargs: Any - ) -> Connection: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def get_default( - self, - connection_type: Union[str, ConnectionType], - *, - include_credentials: Optional[bool] = False, - **kwargs: Any - ) -> Connection: ... - @distributed_trace - def list( + class azure.ai.projects.models.VoiceAgentServerEventWarningDetails(_Model): + code: Optional[str] + message: str + param: Optional[str] + + @overload + def __init__( self, *, - connection_type: Optional[Union[str, ConnectionType]] = ..., - default_connection: Optional[bool] = ..., - **kwargs: Any - ) -> ItemPaged[Connection]: ... + code: Optional[str] = ..., + message: str, + param: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.operations.DatasetsOperations(DatasetsOperationsGenerated): + class azure.ai.projects.models.VoiceAgentSessionAvatarConfig(VoiceAvatarConfig): + character: str + customized: bool + ice_servers: Optional[list[VoiceAgentAvatarIceServer]] + model: str + output_audit_audio: bool + output_protocol: Union[str, VoiceAvatarOutputProtocol] + scene: VoiceAgentAvatarScene + style: str + type: Union[str, VoiceAvatarType] + video: VoiceAgentAvatarVideoParams + @overload def __init__( self, - *args, - **kwargs + *, + character: str, + customized: Optional[bool] = ..., + ice_servers: Optional[list[VoiceAgentAvatarIceServer]] = ..., + model: Optional[str] = ..., + output_audit_audio: Optional[bool] = ..., + output_protocol: Optional[Union[str, VoiceAvatarOutputProtocol]] = ..., + scene: Optional[VoiceAgentAvatarScene] = ..., + style: Optional[str] = ..., + type: Union[str, VoiceAvatarType], + video: Optional[VoiceAgentAvatarVideoParams] = ... ) -> None: ... @overload - def create_or_update( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentSessionIncludeOption(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FILE_SEARCH_CALL_RESULTS = "file_search_call.results" + INPUT_AUDIO_TRANSCRIPTION_LOGPROBS = "item.input_audio_transcription.logprobs" + INPUT_AUDIO_TRANSCRIPTION_PHRASES = "item.input_audio_transcription.phrases" + + + class azure.ai.projects.models.VoiceAgentSessionResponseConfig(_Model): + animation: Optional[VoiceAgentAnimationConfig] + audio: Optional[VoiceAudioConfig] + avatar: Optional[VoiceAgentSessionAvatarConfig] + expires_at: Optional[datetime] + greeting: Optional[VoiceGreetingConfig] + id: str + include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] + instructions: Optional[str] + interim_response: Optional[VoiceAgentInterimResponse] + max_output_tokens: Optional[VoiceAgentMaxOutputTokens] + metadata: Optional[dict[str, str]] + model: str + object: Literal["session"] + output_modalities: Optional[list[Union[str, VoiceOutputModality]]] + parallel_tool_calls: Optional[bool] + reasoning: Optional[RealtimeReasoning] + temperature: Optional[float] + tool_choice: Optional[VoiceAgentToolChoice] + tools: Optional[list[VoiceAgentTool]] + type: Literal["realtime"] + + @overload + def __init__( self, - name: str, - version: str, - dataset_version: DatasetVersion, *, - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> DatasetVersion: ... + animation: Optional[VoiceAgentAnimationConfig] = ..., + audio: Optional[VoiceAudioConfig] = ..., + avatar: Optional[VoiceAgentSessionAvatarConfig] = ..., + expires_at: Optional[datetime] = ..., + greeting: Optional[VoiceGreetingConfig] = ..., + id: str, + include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] = ..., + instructions: Optional[str] = ..., + interim_response: Optional[VoiceAgentInterimResponse] = ..., + max_output_tokens: Optional[VoiceAgentMaxOutputTokens] = ..., + metadata: Optional[dict[str, str]] = ..., + model: str, + output_modalities: Optional[list[Union[str, VoiceOutputModality]]] = ..., + parallel_tool_calls: Optional[bool] = ..., + reasoning: Optional[RealtimeReasoning] = ..., + temperature: Optional[float] = ..., + tool_choice: Optional[VoiceAgentToolChoice] = ..., + tools: Optional[list[VoiceAgentTool]] = ... + ) -> None: ... @overload - def create_or_update( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentSessionUpdateConfig(_Model): + animation: Optional[VoiceAgentAnimationConfig] + audio: Optional[VoiceAudioConfig] + avatar: Optional[VoiceAgentSessionAvatarConfig] + greeting: Optional[VoiceGreetingConfig] + include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] + instructions: Optional[str] + interim_response: Optional[VoiceAgentInterimResponse] + max_output_tokens: Optional[VoiceAgentMaxOutputTokens] + metadata: Optional[dict[str, str]] + output_modalities: Optional[list[Union[str, VoiceOutputModality]]] + parallel_tool_calls: Optional[bool] + reasoning: Optional[RealtimeReasoning] + temperature: Optional[float] + tool_choice: Optional[VoiceAgentToolChoice] + tools: Optional[list[VoiceAgentTool]] + type: Literal["realtime"] + + @overload + def __init__( self, - name: str, - version: str, - dataset_version: JSON, *, - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> DatasetVersion: ... + animation: Optional[VoiceAgentAnimationConfig] = ..., + audio: Optional[VoiceAudioConfig] = ..., + avatar: Optional[VoiceAgentSessionAvatarConfig] = ..., + greeting: Optional[VoiceGreetingConfig] = ..., + include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] = ..., + instructions: Optional[str] = ..., + interim_response: Optional[VoiceAgentInterimResponse] = ..., + max_output_tokens: Optional[VoiceAgentMaxOutputTokens] = ..., + metadata: Optional[dict[str, str]] = ..., + output_modalities: Optional[list[Union[str, VoiceOutputModality]]] = ..., + parallel_tool_calls: Optional[bool] = ..., + reasoning: Optional[RealtimeReasoning] = ..., + temperature: Optional[float] = ..., + tool_choice: Optional[VoiceAgentToolChoice] = ..., + tools: Optional[list[VoiceAgentTool]] = ... + ) -> None: ... @overload - def create_or_update( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentStaticInterimResponseConfig(VoiceAgentInterimResponseConfig, discriminator='static_interim_response'): + latency_threshold_ms: int + texts: Optional[list[str]] + triggers: Union[list[str, VoiceAgentInterimResponseTrigger]] + type: Literal["static_interim_response"] + + @overload + def __init__( self, - name: str, - version: str, - dataset_version: IO[bytes], *, - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> DatasetVersion: ... + latency_threshold_ms: Optional[int] = ..., + texts: Optional[list[str]] = ..., + triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] = ... + ) -> None: ... - @distributed_trace - def delete( + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentTool(_Model): + type: str + + @overload + def __init__( self, - name: str, - version: str, - **kwargs: Any + *, + type: str ) -> None: ... - @distributed_trace - def get( - self, - name: str, - version: str, - **kwargs: Any - ) -> DatasetVersion: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def get_credentials( - self, - name: str, - version: str, - **kwargs: Any - ) -> DatasetCredential: ... - @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged[DatasetVersion]: ... + class azure.ai.projects.models.VoiceAgentToolResponseScheduling(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INTERRUPT = "interrupt" + SILENT = "silent" + SKIP_IF_BUSY = "skip_if_busy" + WHEN_IDLE = "when_idle" - @distributed_trace - def list_versions( - self, - name: str, - **kwargs: Any - ) -> ItemPaged[DatasetVersion]: ... + + class azure.ai.projects.models.VoiceAgentTranscriptionPhrase(_Model): + confidence: Optional[float] + duration_milliseconds: int + locale: Optional[str] + offset_milliseconds: int + text: str + words: Optional[list[VoiceAgentTranscriptionWord]] @overload - def pending_upload( + def __init__( self, - name: str, - version: str, - pending_upload_request: PendingUploadRequest, *, - content_type: str = "application/json", - **kwargs: Any - ) -> PendingUploadResponse: ... + confidence: Optional[float] = ..., + duration_milliseconds: int, + locale: Optional[str] = ..., + offset_milliseconds: int, + text: str, + words: Optional[list[VoiceAgentTranscriptionWord]] = ... + ) -> None: ... @overload - def pending_upload( - self, - name: str, - version: str, - pending_upload_request: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> PendingUploadResponse: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentTranscriptionWord(_Model): + duration_milliseconds: int + offset_milliseconds: int + text: str @overload - def pending_upload( + def __init__( self, - name: str, - version: str, - pending_upload_request: IO[bytes], *, - content_type: str = "application/json", - **kwargs: Any - ) -> PendingUploadResponse: ... + duration_milliseconds: int, + offset_milliseconds: int, + text: str + ) -> None: ... - @distributed_trace - def upload_file( - self, - *, - connection_name: Optional[str] = ..., - file_path: str, - name: str, - version: str, - **kwargs: Any - ) -> FileDatasetVersion: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def upload_folder( - self, - *, - connection_name: Optional[str] = ..., - file_pattern: Optional[Pattern] = ..., - folder: str, - name: str, - version: str, - **kwargs: Any - ) -> FolderDatasetVersion: ... + class azure.ai.projects.models.VoiceAgentWebSocketSubprotocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + REALTIME = "realtime" - class azure.ai.projects.operations.DeploymentsOperations: + class azure.ai.projects.models.VoiceAssistantMessageItem(VoiceMessageItem, discriminator='assistant'): + content: list[RealtimeConversationItemMessageAssistantContent] + created_at: datetime + id: Optional[str] + object: Optional[Literal["item"]] + response_id: str + role: Literal[RealtimeConversationItemMessageType.ASSISTANT] + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Union[str, azure.ai.projects.models.MESSAGE] + + @overload def __init__( self, - *args, - **kwargs + *, + content: list[RealtimeConversationItemMessageAssistantContent], + created_at: Optional[datetime] = ..., + id: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + response_id: Optional[str] = ..., + status: Optional[Literal[completed, incomplete, in_progress]] = ... ) -> None: ... - @distributed_trace - def get( - self, - name: str, - **kwargs: Any - ) -> Deployment: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def list( - self, - *, - deployment_type: Optional[Union[str, DeploymentType]] = ..., - model_name: Optional[str] = ..., - model_publisher: Optional[str] = ..., - **kwargs: Any - ) -> ItemPaged[Deployment]: ... + class azure.ai.projects.models.VoiceAudioCodec(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PCM16 = "pcm16" + PCMA = "pcma" + PCMU = "pcmu" - class azure.ai.projects.operations.EvaluationRulesOperations(GeneratedEvaluationRulesOperations): - def __init__( - self, - *args, - **kwargs - ) -> None: ... + class azure.ai.projects.models.VoiceAudioConfig(_Model): + input: Optional[VoiceAudioInputConfig] + output: Optional[VoiceAudioOutputConfig] @overload - def create_or_update( + def __init__( self, - id: str, - evaluation_rule: EvaluationRule, *, - content_type: str = "application/json", - **kwargs: Any - ) -> EvaluationRule: ... + input: Optional[VoiceAudioInputConfig] = ..., + output: Optional[VoiceAudioOutputConfig] = ... + ) -> None: ... @overload - def create_or_update( - self, - id: str, - evaluation_rule: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> EvaluationRule: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAudioContainerFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): + WAV = "wav" + + + class azure.ai.projects.models.VoiceAudioFormat(_Model): + rate: Optional[int] + type: Union[str, VoiceAudioFormatType] @overload - def create_or_update( + def __init__( self, - id: str, - evaluation_rule: IO[bytes], *, - content_type: str = "application/json", - **kwargs: Any - ) -> EvaluationRule: ... - - @distributed_trace - def delete( - self, - id: str, - **kwargs: Any + rate: Optional[int] = ..., + type: Union[str, VoiceAudioFormatType] ) -> None: ... - @distributed_trace - def get( - self, - id: str, - **kwargs: Any - ) -> EvaluationRule: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def list( - self, - *, - action_type: Optional[Union[str, EvaluationRuleActionType]] = ..., - agent_name: Optional[str] = ..., - enabled: Optional[bool] = ..., - **kwargs: Any - ) -> ItemPaged[EvaluationRule]: ... + class azure.ai.projects.models.VoiceAudioFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PCM = "audio/pcm" + PCMA = "audio/pcma" + PCMU = "audio/pcmu" - class azure.ai.projects.operations.IndexesOperations: + class azure.ai.projects.models.VoiceAudioInputConfig(_Model): + echo_cancellation: Optional[VoiceAgentEchoCancellation] + format: Optional[VoiceAudioFormat] + noise_reduction: Optional[VoiceNoiseReduction] + transcription: Optional[VoiceInputTranscription] + turn_detection: Optional[VoiceAgentTurnDetection] + + @overload def __init__( self, - *args, - **kwargs + *, + echo_cancellation: Optional[VoiceAgentEchoCancellation] = ..., + format: Optional[VoiceAudioFormat] = ..., + noise_reduction: Optional[VoiceNoiseReduction] = ..., + transcription: Optional[VoiceInputTranscription] = ..., + turn_detection: Optional[VoiceAgentTurnDetection] = ... ) -> None: ... @overload - def create_or_update( - self, - name: str, - version: str, - index: Index, - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> Index: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAudioOutputConfig(_Model): + custom_lexicon_url: Optional[str] + custom_text_normalization_url: Optional[str] + custom_voice_endpoint_id: Optional[str] + format: Optional[VoiceAudioFormat] + output_audio_timestamp_types: Optional[list[Union[str, VoiceAudioTimestampType]]] + personal_voice_model: Optional[str] + pitch: Optional[str] + prefer_locales: Optional[list[str]] + speed: Optional[float] + style: Optional[str] + voice: Optional[str] + voice_locale: Optional[str] + voice_temperature: Optional[float] + voice_type: Optional[str] + volume: Optional[str] @overload - def create_or_update( + def __init__( self, - name: str, - version: str, - index: JSON, *, - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> Index: ... + custom_lexicon_url: Optional[str] = ..., + custom_text_normalization_url: Optional[str] = ..., + custom_voice_endpoint_id: Optional[str] = ..., + format: Optional[VoiceAudioFormat] = ..., + output_audio_timestamp_types: Optional[list[Union[str, VoiceAudioTimestampType]]] = ..., + personal_voice_model: Optional[str] = ..., + pitch: Optional[str] = ..., + prefer_locales: Optional[list[str]] = ..., + speed: Optional[float] = ..., + style: Optional[str] = ..., + voice: Optional[str] = ..., + voice_locale: Optional[str] = ..., + voice_temperature: Optional[float] = ..., + voice_type: Optional[str] = ..., + volume: Optional[str] = ... + ) -> None: ... @overload - def create_or_update( - self, - name: str, - version: str, - index: IO[bytes], - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> Index: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def delete( - self, - name: str, - version: str, - **kwargs: Any - ) -> None: ... - @distributed_trace - def get( - self, - name: str, - version: str, - **kwargs: Any - ) -> Index: ... + class azure.ai.projects.models.VoiceAudioRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT = "agent" + USER = "user" - @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged[Index]: ... - @distributed_trace - def list_versions( + class azure.ai.projects.models.VoiceAudioTimestampType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + WORD = "word" + + + class azure.ai.projects.models.VoiceAvatarConfig(_Model): + character: str + customized: Optional[bool] + model: Optional[str] + output_audit_audio: Optional[bool] + output_protocol: Optional[Union[str, VoiceAvatarOutputProtocol]] + scene: Optional[VoiceAgentAvatarScene] + style: Optional[str] + type: Union[str, VoiceAvatarType] + video: Optional[VoiceAgentAvatarVideoParams] + + @overload + def __init__( self, - name: str, - **kwargs: Any - ) -> ItemPaged[Index]: ... + *, + character: str, + customized: Optional[bool] = ..., + model: Optional[str] = ..., + output_audit_audio: Optional[bool] = ..., + output_protocol: Optional[Union[str, VoiceAvatarOutputProtocol]] = ..., + scene: Optional[VoiceAgentAvatarScene] = ..., + style: Optional[str] = ..., + type: Union[str, VoiceAvatarType], + video: Optional[VoiceAgentAvatarVideoParams] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.operations.TelemetryOperations: + class azure.ai.projects.models.VoiceAvatarOutputProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + WEBRTC = "webrtc" + WEBSOCKET = "websocket" + WEBSOCKET_BINARY = "websocket-binary" - def __init__(self, outer_instance: AIProjectClient) -> None: ... - @distributed_trace - def get_application_insights_connection_string(self) -> str: ... + class azure.ai.projects.models.VoiceAvatarType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PHOTO_AVATAR = "photo_avatar" + VIDEO_AVATAR = "video_avatar" - class azure.ai.projects.operations.ToolboxesOperations: + class azure.ai.projects.models.VoiceAzureSemanticVadEnTurnDetection(VoiceTurnDetection, discriminator='azure_semantic_vad_en'): + auto_truncate: bool + create_response: Optional[bool] + end_of_utterance_detection: Optional[VoiceEndOfUtteranceDetection] + idle_timeout_ms: Optional[timedelta] + interrupt_response: Optional[bool] + prefix_padding_ms: Optional[timedelta] + remove_filler_words: Optional[bool] + silence_duration_ms: Optional[timedelta] + speech_duration_ms: Optional[timedelta] + threshold: Optional[float] + type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN] + @overload def __init__( self, - *args, - **kwargs + *, + auto_truncate: Optional[bool] = ..., + create_response: Optional[bool] = ..., + end_of_utterance_detection: Optional[VoiceEndOfUtteranceDetection] = ..., + idle_timeout_ms: Optional[timedelta] = ..., + interrupt_response: Optional[bool] = ..., + prefix_padding_ms: Optional[timedelta] = ..., + remove_filler_words: Optional[bool] = ..., + silence_duration_ms: Optional[timedelta] = ..., + speech_duration_ms: Optional[timedelta] = ..., + threshold: Optional[float] = ... ) -> None: ... @overload - def create_version( - self, - name: str, - *, - content_type: str = "application/json", - description: Optional[str] = ..., - metadata: Optional[dict[str, str]] = ..., - policies: Optional[ToolboxPolicies] = ..., - skills: Optional[List[ToolboxSkill]] = ..., - tools: List[ToolboxTool], - **kwargs: Any - ) -> ToolboxVersionObject: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAzureSemanticVadMultilingualTurnDetection(VoiceTurnDetection, discriminator='azure_semantic_vad_multilingual'): + auto_truncate: bool + create_response: Optional[bool] + end_of_utterance_detection: Optional[VoiceEndOfUtteranceDetection] + idle_timeout_ms: Optional[timedelta] + interrupt_response: Optional[bool] + languages: Optional[list[str]] + prefix_padding_ms: Optional[timedelta] + remove_filler_words: Optional[bool] + silence_duration_ms: Optional[timedelta] + speech_duration_ms: Optional[timedelta] + threshold: Optional[float] + type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] @overload - def create_version( + def __init__( self, - name: str, - body: JSON, *, - content_type: str = "application/json", - **kwargs: Any - ) -> ToolboxVersionObject: ... + auto_truncate: Optional[bool] = ..., + create_response: Optional[bool] = ..., + end_of_utterance_detection: Optional[VoiceEndOfUtteranceDetection] = ..., + idle_timeout_ms: Optional[timedelta] = ..., + interrupt_response: Optional[bool] = ..., + languages: Optional[list[str]] = ..., + prefix_padding_ms: Optional[timedelta] = ..., + remove_filler_words: Optional[bool] = ..., + silence_duration_ms: Optional[timedelta] = ..., + speech_duration_ms: Optional[timedelta] = ..., + threshold: Optional[float] = ... + ) -> None: ... @overload - def create_version( - self, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> ToolboxVersionObject: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def delete( - self, - name: str, - **kwargs: Any - ) -> None: ... - @distributed_trace - def delete_version( + class azure.ai.projects.models.VoiceAzureSemanticVadTurnDetection(VoiceTurnDetection, discriminator='azure_semantic_vad'): + auto_truncate: bool + create_response: Optional[bool] + end_of_utterance_detection: Optional[VoiceEndOfUtteranceDetection] + idle_timeout_ms: Optional[timedelta] + interrupt_response: Optional[bool] + languages: Optional[list[str]] + prefix_padding_ms: Optional[timedelta] + remove_filler_words: Optional[bool] + silence_duration_ms: Optional[timedelta] + speech_duration_ms: Optional[timedelta] + threshold: Optional[float] + type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD] + + @overload + def __init__( self, - name: str, - version: str, - **kwargs: Any + *, + auto_truncate: Optional[bool] = ..., + create_response: Optional[bool] = ..., + end_of_utterance_detection: Optional[VoiceEndOfUtteranceDetection] = ..., + idle_timeout_ms: Optional[timedelta] = ..., + interrupt_response: Optional[bool] = ..., + languages: Optional[list[str]] = ..., + prefix_padding_ms: Optional[timedelta] = ..., + remove_filler_words: Optional[bool] = ..., + silence_duration_ms: Optional[timedelta] = ..., + speech_duration_ms: Optional[timedelta] = ..., + threshold: Optional[float] = ... ) -> None: ... - @distributed_trace - def get( - self, - name: str, - **kwargs: Any - ) -> ToolboxObject: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def get_version( + + class azure.ai.projects.models.VoiceConversation(_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[RealtimeResponseUsage] + + @overload + def __init__( self, - name: str, - version: str, - **kwargs: Any - ) -> ToolboxVersionObject: ... + *, + completed_at: Optional[datetime] = ..., + created_at: datetime, + id: str, + last_error: Optional[ApiError] = ..., + metadata: Optional[dict[str, str]] = ..., + status: Union[str, VoiceConversationStatus], + usage: Optional[RealtimeResponseUsage] = ... + ) -> None: ... - @distributed_trace - def list( + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceConversationItem(_Model): + created_at: Optional[datetime] + response_id: Optional[str] + type: str + + @overload + def __init__( self, *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> ItemPaged[ToolboxObject]: ... + created_at: Optional[datetime] = ..., + response_id: Optional[str] = ..., + type: str + ) -> None: ... - @distributed_trace - def list_versions( + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FUNCTION_CALL = "function_call" + FUNCTION_CALL_OUTPUT = "function_call_output" + MCP_APPROVAL_REQUEST = "mcp_approval_request" + MCP_APPROVAL_RESPONSE = "mcp_approval_response" + MCP_CALL = "mcp_call" + MCP_LIST_TOOLS = "mcp_list_tools" + MESSAGE = "message" + + + class azure.ai.projects.models.VoiceConversationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMPLETED = "completed" + FAILED = "failed" + IN_PROGRESS = "in_progress" + + + class azure.ai.projects.models.VoiceEndOfUtteranceDetection(_Model): + model: Union[str, VoiceEndOfUtteranceDetectionModel] + threshold_level: Optional[Union[str, VoiceEndOfUtteranceThresholdLevel]] + timeout_ms: Optional[timedelta] + + @overload + def __init__( self, - name: str, *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> ItemPaged[ToolboxVersionObject]: ... + model: Union[str, VoiceEndOfUtteranceDetectionModel], + threshold_level: Optional[Union[str, VoiceEndOfUtteranceThresholdLevel]] = ..., + timeout_ms: Optional[timedelta] = ... + ) -> None: ... @overload - def update( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceEndOfUtteranceDetectionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SEMANTIC_DETECTION_V1 = "semantic_detection_v1" + SEMANTIC_DETECTION_V1_EN = "semantic_detection_v1_en" + SEMANTIC_DETECTION_V1_MULTILINGUAL = "semantic_detection_v1_multilingual" + SMART_END_OF_TURN_DETECTION = "smart_end_of_turn_detection" + + + class azure.ai.projects.models.VoiceEndOfUtteranceThresholdLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DEFAULT = "default" + HIGH = "high" + LOW = "low" + MEDIUM = "medium" + + + class azure.ai.projects.models.VoiceFunctionCallItem(VoiceConversationItem, discriminator='function_call'): + arguments: str + call_id: Optional[str] + created_at: datetime + id: Optional[str] + name: str + object: Optional[Literal["item"]] + response_id: str + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Literal[VoiceConversationItemType.FUNCTION_CALL] + + @overload + def __init__( self, + *, + arguments: str, + call_id: Optional[str] = ..., + created_at: Optional[datetime] = ..., + id: Optional[str] = ..., name: str, + object: Optional[Literal[item]] = ..., + response_id: Optional[str] = ..., + status: Optional[Literal[completed, incomplete, in_progress]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceFunctionCallOutputItem(VoiceConversationItem, discriminator='function_call_output'): + call_id: str + created_at: datetime + id: Optional[str] + name: Optional[str] + object: Optional[Literal["item"]] + output: str + response_id: str + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT] + + @overload + def __init__( + self, *, - content_type: str = "application/json", - default_version: str, - **kwargs: Any - ) -> ToolboxObject: ... + call_id: str, + created_at: Optional[datetime] = ..., + id: Optional[str] = ..., + name: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + output: str, + response_id: Optional[str] = ..., + status: Optional[Literal[completed, incomplete, in_progress]] = ... + ) -> None: ... @overload - def update( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceGreetingConfig(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceInputTranscription(_Model): + custom_speech: Optional[dict[str, str]] + delay: Optional[Literal["minimal", "low", "medium", "high", "xhigh"]] + language: Optional[str] + model: Union[str, VoiceInputTranscriptionModel] + phrase_list: Optional[list[str]] + prompt: Optional[str] + + @overload + def __init__( + self, + *, + custom_speech: Optional[dict[str, str]] = ..., + delay: Optional[Literal[minimal, low, medium, high, xhigh]] = ..., + language: Optional[str] = ..., + model: Union[str, VoiceInputTranscriptionModel], + phrase_list: Optional[list[str]] = ..., + prompt: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceInputTranscriptionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_SPEECH = "azure-speech" + GPT4_O_MINI_TRANSCRIBE = "gpt-4o-mini-transcribe" + GPT4_O_TRANSCRIBE = "gpt-4o-transcribe" + GPT4_O_TRANSCRIBE_DIARIZE = "gpt-4o-transcribe-diarize" + GPT_LIVE_TRANSCRIBE = "gpt-live-transcribe" + GPT_REALTIME_WHISPER = "gpt-realtime-whisper" + GPT_TRANSCRIBE = "gpt-transcribe" + MAI_TRANSCRIBE = "mai-transcribe" + WHISPER1 = "whisper-1" + + + class azure.ai.projects.models.VoiceItemAudioResponse(_Model): + blob_uri: Optional[str] + channels: Optional[int] + codec: Optional[Union[str, VoiceAudioCodec]] + conversation_id: str + duration_ms: Optional[timedelta] + format: Optional[Union[str, VoiceAudioContainerFormat]] + item_id: str + role: Optional[Union[str, VoiceAudioRole]] + sample_rate: Optional[int] + start_offset_ms: Optional[timedelta] + + @overload + def __init__( + self, + *, + blob_uri: Optional[str] = ..., + channels: Optional[int] = ..., + codec: Optional[Union[str, VoiceAudioCodec]] = ..., + conversation_id: str, + duration_ms: Optional[timedelta] = ..., + format: Optional[Union[str, VoiceAudioContainerFormat]] = ..., + item_id: str, + role: Optional[Union[str, VoiceAudioRole]] = ..., + sample_rate: Optional[int] = ..., + start_offset_ms: Optional[timedelta] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceMcpApprovalRequestItem(VoiceConversationItem, discriminator='mcp_approval_request'): + arguments: str + created_at: datetime + id: str + name: str + response_id: str + server_label: str + type: Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST] + + @overload + def __init__( self, + *, + arguments: str, + created_at: Optional[datetime] = ..., + id: str, name: str, - body: JSON, + response_id: Optional[str] = ..., + server_label: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceMcpApprovalResponseItem(VoiceConversationItem, discriminator='mcp_approval_response'): + approval_request_id: str + approve: bool + created_at: datetime + id: str + reason: Optional[str] + response_id: str + type: Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE] + + @overload + def __init__( + self, *, - content_type: str = "application/json", - **kwargs: Any - ) -> ToolboxObject: ... + approval_request_id: str, + approve: bool, + created_at: Optional[datetime] = ..., + id: str, + reason: Optional[str] = ..., + response_id: Optional[str] = ... + ) -> None: ... @overload - def update( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceMcpCallItem(VoiceConversationItem, discriminator='mcp_call'): + approval_request_id: Optional[str] + arguments: str + created_at: datetime + error: Optional[RealtimeMCPError] + id: str + name: str + output: Optional[str] + response_id: str + server_label: str + type: Literal[VoiceConversationItemType.MCP_CALL] + + @overload + def __init__( self, + *, + approval_request_id: Optional[str] = ..., + arguments: str, + created_at: Optional[datetime] = ..., + error: Optional[RealtimeMCPError] = ..., + id: str, name: str, - body: IO[bytes], + output: Optional[str] = ..., + response_id: Optional[str] = ..., + server_label: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceMcpListToolsItem(VoiceConversationItem, discriminator='mcp_list_tools'): + created_at: datetime + id: Optional[str] + response_id: str + server_label: str + tools: list[MCPListToolsTool] + type: Literal[VoiceConversationItemType.MCP_LIST_TOOLS] + + @overload + def __init__( + self, *, - content_type: str = "application/json", - **kwargs: Any - ) -> ToolboxObject: ... + created_at: Optional[datetime] = ..., + id: Optional[str] = ..., + response_id: Optional[str] = ..., + server_label: str, + tools: list[MCPListToolsTool] + ) -> None: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... -namespace azure.ai.projects.telemetry - def azure.ai.projects.telemetry.trace_function(span_name: Optional[str] = None) -> Callable: ... + class azure.ai.projects.models.VoiceMessageItem(VoiceConversationItem, discriminator='message'): + created_at: datetime + response_id: str + role: str + type: Literal[VoiceConversationItemType.MESSAGE] + + @overload + def __init__( + self, + *, + created_at: Optional[datetime] = ..., + response_id: Optional[str] = ..., + role: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.telemetry.AIProjectInstrumentor: + class azure.ai.projects.models.VoiceModelType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MANAGED = "managed" + SELF_DEPLOYED = "self_deployed" - def __init__(self) -> None: ... - def instrument( + class azure.ai.projects.models.VoiceNoiseReduction(_Model): + type: Union[str, VoiceNoiseReductionType] + + @overload + def __init__( self, - enable_content_recording: Optional[bool] = None, - enable_trace_context_propagation: Optional[bool] = None, - enable_baggage_propagation: Optional[bool] = None + *, + type: Union[str, VoiceNoiseReductionType] ) -> None: ... - def is_content_recording_enabled(self) -> bool: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - def is_instrumented(self) -> bool: ... - def uninstrument(self) -> None: ... + class azure.ai.projects.models.VoiceNoiseReductionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_DEEP_NOISE_SUPPRESSION = "azure_deep_noise_suppression" + FAR_FIELD = "far_field" + NEAR_FIELD = "near_field" + + + class azure.ai.projects.models.VoiceOutputModality(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ANIMATION = "animation" + AUDIO = "audio" + AVATAR = "avatar" + TEXT = "text" + + + class azure.ai.projects.models.VoiceRecordingChannelLayout(_Model): + left: Literal["user"] + right: Literal["agent"] + + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... + + + class azure.ai.projects.models.VoiceRecordingResponse(_Model): + blob_uri: Optional[str] + channel_layout: VoiceRecordingChannelLayout + channels: int + conversation_id: str + duration_ms: timedelta + format: Union[str, VoiceAudioContainerFormat] + sample_rate: int + + @overload + def __init__( + self, + *, + blob_uri: Optional[str] = ..., + channel_layout: VoiceRecordingChannelLayout, + channels: int, + conversation_id: str, + duration_ms: timedelta, + format: Union[str, VoiceAudioContainerFormat], + sample_rate: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceResponse(OmitPropertiesRealtimeResponse): + audio: Optional[VoiceResponseAudio] + completed_at: Optional[datetime] + conversation_id: str + created_at: Optional[datetime] + id: str + max_output_tokens: Union[int, str] + metadata: Optional[dict[str, str]] + object: str + output: Optional[list[VoiceConversationItem]] + output_modalities: Union[list[str, str]] + status: Union[str, str, str, str, str] + status_details: RealtimeResponseStatusDetails + temperature: Optional[float] + usage: RealtimeResponseUsage + + @overload + def __init__( + self, + *, + audio: Optional[VoiceResponseAudio] = ..., + completed_at: Optional[datetime] = ..., + conversation_id: str, + created_at: Optional[datetime] = ..., + id: str, + max_output_tokens: Optional[Union[int, Literal[inf]]] = ..., + metadata: Optional[dict[str, str]] = ..., + object: Optional[Literal[response]] = ..., + output: Optional[list[VoiceConversationItem]] = ..., + output_modalities: Optional[list[Literal[text, audio]]] = ..., + status: Optional[Literal[completed, cancelled, failed, incomplete, in_progress]] = ..., + status_details: Optional[RealtimeResponseStatusDetails] = ..., + temperature: Optional[float] = ..., + usage: Optional[RealtimeResponseUsage] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceResponseAudio(_Model): + output: Optional[VoiceResponseAudioOutput] + + @overload + def __init__( + self, + *, + output: Optional[VoiceResponseAudioOutput] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceResponseAudioOutput(_Model): + format: Optional[RealtimeAudioFormats] + voice: Optional[str] + voice_locale: Optional[str] + voice_type: Optional[str] + + @overload + def __init__( + self, + *, + format: Optional[RealtimeAudioFormats] = ..., + voice: Optional[str] = ..., + voice_locale: Optional[str] = ..., + voice_type: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceServerVadTurnDetection(VoiceTurnDetection, discriminator='server_vad'): + auto_truncate: bool + create_response: Optional[bool] + end_of_utterance_detection: Optional[VoiceEndOfUtteranceDetection] + idle_timeout_ms: Optional[int] + interrupt_response: Optional[bool] + prefix_padding_ms: Optional[int] + silence_duration_ms: Optional[int] + speech_duration_ms: Optional[int] + threshold: Optional[float] + type: Literal[VoiceTurnDetectionType.SERVER_VAD] + + @overload + def __init__( + self, + *, + auto_truncate: Optional[bool] = ..., + create_response: Optional[bool] = ..., + end_of_utterance_detection: Optional[VoiceEndOfUtteranceDetection] = ..., + idle_timeout_ms: Optional[int] = ..., + interrupt_response: Optional[bool] = ..., + prefix_padding_ms: Optional[int] = ..., + silence_duration_ms: Optional[int] = ..., + speech_duration_ms: Optional[int] = ..., + threshold: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceSystemMessageItem(VoiceMessageItem, discriminator='system'): + content: list[RealtimeConversationItemMessageSystemContent] + created_at: datetime + id: Optional[str] + object: Optional[Literal["item"]] + response_id: str + role: Literal[RealtimeConversationItemMessageType.SYSTEM] + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Union[str, azure.ai.projects.models.MESSAGE] + + @overload + def __init__( + self, + *, + content: list[RealtimeConversationItemMessageSystemContent], + created_at: Optional[datetime] = ..., + id: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + response_id: Optional[str] = ..., + status: Optional[Literal[completed, incomplete, in_progress]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceSystemTool(VoiceAgentTool, discriminator='system'): + description: Optional[str] + name: Union[str, VoiceSystemToolName] + type: Literal["system"] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + name: Union[str, VoiceSystemToolName] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceSystemToolName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + END_CONVERSATION = "end_conversation" + + + class azure.ai.projects.models.VoiceToolboxTool(VoiceAgentTool, discriminator='toolbox'): + response_scheduling: Optional[Union[str, VoiceAgentToolResponseScheduling]] + toolbox_name: str + toolbox_version: str + type: Literal["toolbox"] + + @overload + def __init__( + self, + *, + response_scheduling: Optional[Union[str, VoiceAgentToolResponseScheduling]] = ..., + toolbox_name: str, + toolbox_version: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceTurnDetection(_Model): + auto_truncate: Optional[bool] + type: str + + @overload + def __init__( + self, + *, + auto_truncate: Optional[bool] = ..., + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceTurnDetectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_SEMANTIC_VAD = "azure_semantic_vad" + AZURE_SEMANTIC_VAD_EN = "azure_semantic_vad_en" + AZURE_SEMANTIC_VAD_MULTILINGUAL = "azure_semantic_vad_multilingual" + SEMANTIC_VAD = "semantic_vad" + SERVER_VAD = "server_vad" + + + class azure.ai.projects.models.VoiceUserMessageItem(VoiceMessageItem, discriminator='user'): + content: list[RealtimeConversationItemMessageUserContent] + created_at: datetime + id: Optional[str] + object: Optional[Literal["item"]] + response_id: str + role: Literal[RealtimeConversationItemMessageType.USER] + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Union[str, azure.ai.projects.models.MESSAGE] + + @overload + def __init__( + self, + *, + content: list[RealtimeConversationItemMessageUserContent], + created_at: Optional[datetime] = ..., + id: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + response_id: Optional[str] = ..., + status: Optional[Literal[completed, incomplete, in_progress]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.WebSearchApproximateLocation(_Model): + city: Optional[str] + country: Optional[str] + region: Optional[str] + timezone: Optional[str] + type: Literal["approximate"] + + @overload + def __init__( + self, + *, + city: Optional[str] = ..., + country: Optional[str] = ..., + region: Optional[str] = ..., + timezone: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.WebSearchConfiguration(_Model): + instance_name: str + project_connection_id: str + + @overload + def __init__( + self, + *, + instance_name: str, + project_connection_id: str + ) -> None: ... + + @overload + 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] + 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] = ..., + 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]] + + @overload + def __init__( + self, + *, + allowed_domains: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.WebSearchToolboxTool(ToolboxTool, discriminator='web_search'): + custom_search_configuration: Optional[WebSearchConfiguration] + description: str + filters: Optional[WebSearchToolFilters] + name: str + search_context_size: Optional[Literal["low", "medium", "high"]] + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.WEB_SEARCH] + user_location: Optional[WebSearchApproximateLocation] + + @overload + def __init__( + self, + *, + custom_search_configuration: Optional[WebSearchConfiguration] = ..., + description: Optional[str] = ..., + 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.WeeklyRecurrenceSchedule(RecurrenceSchedule, discriminator='Weekly'): + days_of_week: list[Union[str, DayOfWeek]] + type: Literal[RecurrenceType.WEEKLY] + + @overload + def __init__( + self, + *, + days_of_week: list[Union[str, DayOfWeek]] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.WorkIQPreviewTool(Tool, discriminator='work_iq_preview'): + project_connection_id: str + type: Literal[ToolType.WORK_IQ_PREVIEW] + + @overload + def __init__( + self, + *, + project_connection_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.WorkIQPreviewToolboxTool(ToolboxTool, discriminator='work_iq_preview'): + description: str + name: str + project_connection_id: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.WORK_IQ_PREVIEW] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + name: Optional[str] = ..., + project_connection_id: str, + tool_configs: Optional[dict[str, ToolConfig]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.WorkflowAgentDefinition(AgentDefinition, discriminator='workflow'): + kind: Literal[AgentKind.WORKFLOW] + rai_config: RaiConfig + workflow: Optional[str] + + @overload + def __init__( + self, + *, + rai_config: Optional[RaiConfig] = ..., + workflow: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + +namespace azure.ai.projects.operations + + class azure.ai.projects.operations.AgentEndpointConversationsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def delete_agent_conversation( + self, + agent_name: str, + conversation_id: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get_agent_conversation( + self, + agent_name: str, + conversation_id: str, + **kwargs: Any + ) -> VoiceConversation: ... + + @distributed_trace + def get_agent_conversation_audio( + self, + agent_name: str, + conversation_id: str, + **kwargs: Any + ) -> VoiceRecordingResponse: ... + + @distributed_trace + def get_agent_conversation_audio_content( + self, + agent_name: str, + conversation_id: str, + **kwargs: Any + ) -> Iterator[bytes]: ... + + @distributed_trace + def get_agent_conversation_item( + self, + agent_name: str, + conversation_id: str, + item_id: str, + **kwargs: Any + ) -> VoiceConversationItem: ... + + @distributed_trace + def get_agent_conversation_item_audio( + self, + agent_name: str, + conversation_id: str, + item_id: str, + **kwargs: Any + ) -> VoiceItemAudioResponse: ... + + @distributed_trace + def get_agent_conversation_item_audio_content( + self, + agent_name: str, + conversation_id: str, + item_id: str, + **kwargs: Any + ) -> Iterator[bytes]: ... + + @distributed_trace + def get_agent_conversation_response( + self, + agent_name: str, + conversation_id: str, + response_id: str, + **kwargs: Any + ) -> VoiceResponse: ... + + @distributed_trace + def list_agent_conversation_items( + self, + agent_name: str, + conversation_id: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[VoiceConversationItem]: ... + + @distributed_trace + def list_agent_conversation_response_items( + self, + agent_name: str, + conversation_id: str, + response_id: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[VoiceConversationItem]: ... + + @distributed_trace + def list_agent_conversation_responses( + self, + agent_name: str, + conversation_id: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[VoiceResponse]: ... + + @distributed_trace + def list_agent_conversations( + self, + agent_name: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[VoiceConversation]: ... + + + class azure.ai.projects.operations.AgentsOperations(GeneratedAgentsOperations): + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create_session( + self, + agent_name: str, + *, + agent_session_id: Optional[str] = ..., + content_type: str = "application/json", + version_indicator: VersionIndicator, + **kwargs: Any + ) -> AgentSessionResource: ... + + @overload + def create_session( + self, + agent_name: str, + body: CreateSessionRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AgentSessionResource: ... + + @overload + def create_session( + self, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AgentSessionResource: ... + + @overload + def create_version( + self, + agent_name: str, + *, + blueprint_reference: Optional[AgentBlueprintReference] = ..., + content_type: str = "application/json", + definition: AgentDefinition, + description: Optional[str] = ..., + draft: Optional[bool] = ..., + metadata: Optional[dict[str, str]] = ..., + **kwargs: Any + ) -> AgentVersionDetails: ... + + @overload + def create_version( + self, + agent_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AgentVersionDetails: ... + + @overload + def create_version( + self, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AgentVersionDetails: ... + + @distributed_trace + def create_version_from_code( + self, + agent_name: str, + *, + code: IO[bytes], + code_zip_sha256: Optional[str] = ..., + definition: HostedAgentDefinition, + description: Optional[str] = ..., + metadata: Optional[dict[str, str]] = ..., + **kwargs: Any + ) -> AgentVersionDetails: ... + + @overload + def create_version_from_manifest( + self, + agent_name: str, + *, + content_type: str = "application/json", + description: Optional[str] = ..., + manifest_id: str, + metadata: Optional[dict[str, str]] = ..., + parameter_values: dict[str, Any], + **kwargs: Any + ) -> AgentVersionDetails: ... + + @overload + def create_version_from_manifest( + self, + agent_name: str, + body: CreateAgentVersionFromManifestRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AgentVersionDetails: ... + + @overload + def create_version_from_manifest( + self, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AgentVersionDetails: ... + + @distributed_trace + def delete( + self, + agent_name: str, + *, + force: Optional[bool] = ..., + **kwargs: Any + ) -> DeleteAgentResponse: ... + + @distributed_trace + def delete_session( + self, + agent_name: str, + session_id: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def delete_session_file( + self, + agent_name: str, + session_id: str, + *, + path: str, + recursive: Optional[bool] = ..., + **kwargs: Any + ) -> None: ... + + @distributed_trace + def delete_version( + self, + agent_name: str, + agent_version: str, + *, + force: Optional[bool] = ..., + **kwargs: Any + ) -> DeleteAgentVersionResponse: ... + + @distributed_trace + def disable( + self, + agent_name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def download_code( + self, + agent_name: str, + *, + agent_version: Optional[str] = ..., + **kwargs: Any + ) -> Iterator[bytes]: ... + + @distributed_trace + def download_session_file( + self, + agent_name: str, + session_id: str, + *, + path: str, + **kwargs: Any + ) -> Iterator[bytes]: ... + + @distributed_trace + def enable( + self, + agent_name: str, + **kwargs: Any + ) -> None: ... + + @overload + def generate_agent( + self, + *, + content_type: str = "application/json", + kind: Union[str, AgentKind], + **kwargs: Any + ) -> AgentDetails: ... + + @overload + def generate_agent( + self, + body: GenerateAgentRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AgentDetails: ... + + @overload + def generate_agent( + self, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AgentDetails: ... + + @distributed_trace + def get( + self, + agent_name: str, + **kwargs: Any + ) -> AgentDetails: ... + + @distributed_trace + def get_session( + self, + agent_name: str, + session_id: str, + **kwargs: Any + ) -> AgentSessionResource: ... + + @distributed_trace + def get_session_log_stream( + self, + agent_name: str, + agent_version: str, + session_id: str, + **kwargs: Any + ) -> SessionLogEvent: ... + + @distributed_trace + def get_version( + self, + agent_name: str, + agent_version: str, + **kwargs: Any + ) -> AgentVersionDetails: ... + + @distributed_trace + def list( + self, + *, + before: Optional[str] = ..., + kind: Optional[Union[str, AgentKind]] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[AgentDetails]: ... + + @distributed_trace + def list_session_files( + self, + agent_name: str, + session_id: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + path: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[SessionDirectoryEntry]: ... + + @distributed_trace + def list_sessions( + self, + agent_name: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[AgentSessionResource]: ... + + @distributed_trace + def list_versions( + self, + agent_name: str, + *, + before: Optional[str] = ..., + include_drafts: Optional[bool] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[AgentVersionDetails]: ... + + @distributed_trace + def stop_session( + self, + agent_name: str, + session_id: str, + **kwargs: Any + ) -> None: ... + + @overload + def update_details( + self, + agent_name: str, + *, + agent_card: Optional[AgentCard] = ..., + agent_endpoint: Optional[AgentEndpointConfig] = ..., + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> AgentDetails: ... + + @overload + def update_details( + self, + agent_name: str, + body: PatchAgentObjectRequest, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> AgentDetails: ... + + @overload + def update_details( + self, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> AgentDetails: ... + + @overload + def upload_session_file( + self, + agent_name: str, + session_id: str, + content: bytes, + *, + content_type: str = "application/octet-stream", + path: str, + **kwargs: Any + ) -> SessionFileWriteResult: ... + + @overload + def upload_session_file( + self, + agent_name: str, + session_id: str, + content: IO[bytes], + *, + content_type: str = "application/octet-stream", + path: str, + **kwargs: Any + ) -> SessionFileWriteResult: ... + + + class azure.ai.projects.operations.BetaAgentsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_optimization_job( + self, + job: AgentOptimizationJob, + *, + content_type: str = "application/json", + operation_id: Optional[str] = ..., + **kwargs: Any + ) -> LROPoller[AgentOptimizationJobResult]: ... + + @overload + def begin_create_optimization_job( + self, + job: AgentOptimizationJob, + *, + content_type: str = "application/json", + operation_id: Optional[str] = ..., + **kwargs: Any + ) -> LROPoller[AgentOptimizationJobResult]: ... + + @overload + def begin_create_optimization_job( + self, + job: IO[bytes], + *, + content_type: str = "application/json", + operation_id: Optional[str] = ..., + **kwargs: Any + ) -> LROPoller[AgentOptimizationJobResult]: ... + + @distributed_trace + def cancel_optimization_job( + self, + job_id: str, + **kwargs: Any + ) -> AgentOptimizationJob: ... + + @distributed_trace + def delete_optimization_job( + self, + job_id: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get_optimization_job( + self, + job_id: str, + **kwargs: Any + ) -> AgentOptimizationJob: ... + + @distributed_trace + def list_optimization_jobs( + self, + *, + agent_name: Optional[str] = ..., + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + status: Optional[Union[str, JobStatus]] = ..., + **kwargs: Any + ) -> ItemPaged[AgentOptimizationJobListItem]: ... + + + class azure.ai.projects.operations.BetaDatasetsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_generation_job( + self, + job: DataGenerationJob, + *, + content_type: str = "application/json", + operation_id: Optional[str] = ..., + **kwargs: Any + ) -> LROPoller[DataGenerationJobResult]: ... + + @overload + def begin_create_generation_job( + self, + job: DataGenerationJob, + *, + content_type: str = "application/json", + operation_id: Optional[str] = ..., + **kwargs: Any + ) -> LROPoller[DataGenerationJobResult]: ... + + @overload + def begin_create_generation_job( + self, + job: IO[bytes], + *, + content_type: str = "application/json", + operation_id: Optional[str] = ..., + **kwargs: Any + ) -> LROPoller[DataGenerationJobResult]: ... + + @distributed_trace + def cancel_generation_job( + self, + job_id: str, + **kwargs: Any + ) -> DataGenerationJob: ... + + @distributed_trace + def delete_generation_job( + self, + job_id: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get_generation_job( + self, + job_id: str, + **kwargs: Any + ) -> DataGenerationJob: ... + + @distributed_trace + def list_generation_jobs( + self, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[DataGenerationJob]: ... + + + class azure.ai.projects.operations.BetaEvaluationTaxonomiesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create( + self, + name: str, + taxonomy: EvaluationTaxonomy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationTaxonomy: ... + + @overload + def create( + self, + name: str, + taxonomy: EvaluationTaxonomy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationTaxonomy: ... + + @overload + def create( + self, + name: str, + taxonomy: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationTaxonomy: ... + + @distributed_trace + def delete( + self, + name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get( + self, + name: str, + **kwargs: Any + ) -> EvaluationTaxonomy: ... + + @distributed_trace + def list( + self, + *, + input_name: Optional[str] = ..., + input_type: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[EvaluationTaxonomy]: ... + + @overload + def update( + self, + name: str, + taxonomy: EvaluationTaxonomy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationTaxonomy: ... + + @overload + def update( + self, + name: str, + taxonomy: EvaluationTaxonomy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationTaxonomy: ... + + @overload + def update( + self, + name: str, + taxonomy: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationTaxonomy: ... + + + class azure.ai.projects.operations.BetaEvaluatorsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_generation_job( + self, + job: EvaluatorGenerationJob, + *, + content_type: str = "application/json", + operation_id: Optional[str] = ..., + **kwargs: Any + ) -> LROPoller[EvaluatorVersion]: ... + + @overload + def begin_create_generation_job( + self, + job: EvaluatorGenerationJob, + *, + content_type: str = "application/json", + operation_id: Optional[str] = ..., + **kwargs: Any + ) -> LROPoller[EvaluatorVersion]: ... + + @overload + def begin_create_generation_job( + self, + job: IO[bytes], + *, + content_type: str = "application/json", + operation_id: Optional[str] = ..., + **kwargs: Any + ) -> LROPoller[EvaluatorVersion]: ... + + @distributed_trace + def cancel_generation_job( + self, + job_id: str, + **kwargs: Any + ) -> EvaluatorGenerationJob: ... + + @overload + def create_version( + self, + name: str, + evaluator_version: EvaluatorVersion, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluatorVersion: ... + + @overload + def create_version( + self, + name: str, + evaluator_version: EvaluatorVersion, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluatorVersion: ... + + @overload + def create_version( + self, + name: str, + evaluator_version: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluatorVersion: ... + + @distributed_trace + def delete_generation_job( + self, + job_id: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def delete_version( + self, + name: str, + version: str, + **kwargs: Any + ) -> None: ... + + @overload + def get_credentials( + self, + name: str, + version: str, + credential_request: EvaluatorCredentialRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DatasetCredential: ... + + @overload + def get_credentials( + self, + name: str, + version: str, + credential_request: EvaluatorCredentialRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DatasetCredential: ... + + @overload + def get_credentials( + self, + name: str, + version: str, + credential_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DatasetCredential: ... + + @distributed_trace + def get_generation_job( + self, + job_id: str, + **kwargs: Any + ) -> EvaluatorGenerationJob: ... + + @distributed_trace + def get_version( + self, + name: str, + version: str, + **kwargs: Any + ) -> EvaluatorVersion: ... + + @distributed_trace + def list( + self, + *, + limit: Optional[int] = ..., + type: Optional[Union[Literal[builtin], Literal[custom], Literal[all], str]] = ..., + **kwargs: Any + ) -> ItemPaged[EvaluatorVersion]: ... + + @distributed_trace + def list_generation_jobs( + self, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[EvaluatorGenerationJob]: ... + + @distributed_trace + def list_versions( + self, + name: str, + *, + limit: Optional[int] = ..., + type: Optional[Union[Literal[builtin], Literal[custom], Literal[all], str]] = ..., + **kwargs: Any + ) -> ItemPaged[EvaluatorVersion]: ... + + @overload + def pending_upload( + self, + name: str, + version: str, + pending_upload_request: PendingUploadRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PendingUploadResponse: ... + + @overload + def pending_upload( + self, + name: str, + version: str, + pending_upload_request: PendingUploadRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PendingUploadResponse: ... + + @overload + def pending_upload( + self, + name: str, + version: str, + pending_upload_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PendingUploadResponse: ... + + @overload + def update_version( + self, + name: str, + version: str, + evaluator_version: EvaluatorVersion, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluatorVersion: ... + + @overload + def update_version( + self, + name: str, + version: str, + evaluator_version: EvaluatorVersion, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluatorVersion: ... + + @overload + def update_version( + self, + name: str, + version: str, + evaluator_version: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluatorVersion: ... + + + class azure.ai.projects.operations.BetaInsightsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def generate( + self, + insight: Insight, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Insight: ... + + @overload + def generate( + self, + insight: Insight, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Insight: ... + + @overload + def generate( + self, + insight: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Insight: ... + + @distributed_trace + def get( + self, + insight_id: str, + *, + include_coordinates: Optional[bool] = ..., + **kwargs: Any + ) -> Insight: ... + + @distributed_trace + def list( + self, + *, + agent_name: Optional[str] = ..., + eval_id: Optional[str] = ..., + include_coordinates: Optional[bool] = ..., + run_id: Optional[str] = ..., + type: Optional[Union[str, InsightType]] = ..., + **kwargs: Any + ) -> ItemPaged[Insight]: ... + + + class azure.ai.projects.operations.BetaMemoryStoresOperations(GenerateBetaMemoryStoresOperations): + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_update_memories( + self, + name: str, + *, + content_type: str = "application/json", + items: Optional[Union[str, ResponseInputParam]] = ..., + previous_update_id: Optional[str] = ..., + scope: str, + update_delay: Optional[int] = ..., + **kwargs: Any + ) -> UpdateMemoriesLROPoller: ... + + @overload + def begin_update_memories( + self, + name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> UpdateMemoriesLROPoller: ... + + @overload + def begin_update_memories( + self, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> UpdateMemoriesLROPoller: ... + + @overload + def create( + self, + *, + content_type: str = "application/json", + definition: MemoryStoreDefinition, + description: Optional[str] = ..., + metadata: Optional[dict[str, str]] = ..., + name: str, + **kwargs: Any + ) -> MemoryStoreDetails: ... + + @overload + def create( + self, + body: CreateMemoryStoreRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryStoreDetails: ... + + @overload + def create( + self, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryStoreDetails: ... + + @overload + def create_memory( + self, + name: str, + *, + content: str, + content_type: str = "application/json", + kind: Union[str, MemoryItemKind], + scope: str, + **kwargs: Any + ) -> MemoryItem: ... + + @overload + def create_memory( + self, + name: str, + body: CreateMemoryRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryItem: ... + + @overload + def create_memory( + self, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryItem: ... + + @distributed_trace + def delete( + self, + name: str, + **kwargs: Any + ) -> DeleteMemoryStoreResult: ... + + @distributed_trace + def delete_memory( + self, + name: str, + memory_id: str, + **kwargs: Any + ) -> DeleteMemoryResult: ... + + @overload + def delete_scope( + self, + name: str, + *, + content_type: str = "application/json", + scope: str, + **kwargs: Any + ) -> MemoryStoreDeleteScopeResult: ... + + @overload + def delete_scope( + self, + name: str, + body: DeleteScopeRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryStoreDeleteScopeResult: ... + + @overload + def delete_scope( + self, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryStoreDeleteScopeResult: ... + + @distributed_trace + def get( + self, + name: str, + **kwargs: Any + ) -> MemoryStoreDetails: ... + + @distributed_trace + def get_memory( + self, + name: str, + memory_id: str, + **kwargs: Any + ) -> MemoryItem: ... + + @distributed_trace + def list( + self, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[MemoryStoreDetails]: ... + + @overload + def list_memories( + self, + name: str, + *, + before: Optional[str] = ..., + content_type: str = "application/json", + kind: Optional[Union[str, MemoryItemKind]] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + scope: str, + **kwargs: Any + ) -> ItemPaged[MemoryItem]: ... + + @overload + def list_memories( + self, + name: str, + body: ListMemoriesRequest, + *, + before: Optional[str] = ..., + content_type: str = "application/json", + kind: Optional[Union[str, MemoryItemKind]] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[MemoryItem]: ... + + @overload + def list_memories( + self, + name: str, + body: IO[bytes], + *, + before: Optional[str] = ..., + content_type: str = "application/json", + kind: Optional[Union[str, MemoryItemKind]] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[MemoryItem]: ... + + @overload + def search_memories( + self, + name: str, + *, + content_type: str = "application/json", + items: Optional[Union[str, ResponseInputParam]] = ..., + options: Optional[MemorySearchOptions] = ..., + previous_search_id: Optional[str] = ..., + scope: str, + **kwargs: Any + ) -> MemoryStoreSearchResult: ... + + @overload + def search_memories( + self, + name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryStoreSearchResult: ... + + @overload + def search_memories( + self, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryStoreSearchResult: ... + + @overload + def update( + self, + name: str, + *, + content_type: str = "application/json", + description: Optional[str] = ..., + metadata: Optional[dict[str, str]] = ..., + **kwargs: Any + ) -> MemoryStoreDetails: ... + + @overload + def update( + self, + name: str, + body: UpdateMemoryStoreRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryStoreDetails: ... + + @overload + def update( + self, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryStoreDetails: ... + + @overload + def update_memory( + self, + name: str, + memory_id: str, + *, + content: str, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryItem: ... + + @overload + def update_memory( + self, + name: str, + memory_id: str, + body: UpdateMemoryRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryItem: ... + + @overload + def update_memory( + self, + name: str, + memory_id: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryItem: ... + + + class azure.ai.projects.operations.BetaModelsOperations(BetaModelsOperationsGenerated): + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create( + self, + *, + azcopy_path: Optional[str] = ..., + base_model: Optional[str] = ..., + description: Optional[str] = ..., + name: str, + polling_interval: float = 2.0, + polling_timeout: float = 300.0, + source: Union[str, PathLike[str]], + tags: Optional[dict[str, str]] = ..., + version: str, + wait_for_commit: Literal[True] = True, + weight_type: Optional[str] = ..., + **kwargs: Any + ) -> ModelVersion: ... + + @overload + def create( + self, + *, + azcopy_path: Optional[str] = ..., + base_model: Optional[str] = ..., + description: Optional[str] = ..., + name: str, + polling_interval: float = 2.0, + polling_timeout: float = 300.0, + source: Union[str, PathLike[str]], + tags: Optional[dict[str, str]] = ..., + version: str, + wait_for_commit: Literal[False], + weight_type: Optional[str] = ..., + **kwargs: Any + ) -> None: ... + + @distributed_trace + def delete( + self, + name: str, + version: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get( + self, + name: str, + version: str, + **kwargs: Any + ) -> ModelVersion: ... + + @overload + def get_credentials( + self, + name: str, + version: str, + credential_request: ModelCredentialRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DatasetCredential: ... + + @overload + def get_credentials( + self, + name: str, + version: str, + credential_request: ModelCredentialRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DatasetCredential: ... + + @overload + def get_credentials( + self, + name: str, + version: str, + credential_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DatasetCredential: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[ModelVersion]: ... + + @distributed_trace + def list_versions( + self, + name: str, + **kwargs: Any + ) -> ItemPaged[ModelVersion]: ... + + @overload + def pending_create_version( + self, + name: str, + version: str, + model_version: ModelVersion, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> CreateAsyncResponse: ... + + @overload + def pending_create_version( + self, + name: str, + version: str, + model_version: ModelVersion, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> CreateAsyncResponse: ... + + @overload + def pending_create_version( + self, + name: str, + version: str, + model_version: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> CreateAsyncResponse: ... + + @overload + def pending_upload( + self, + name: str, + version: str, + pending_upload_request: ModelPendingUploadRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ModelPendingUploadResponse: ... + + @overload + def pending_upload( + self, + name: str, + version: str, + pending_upload_request: ModelPendingUploadRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ModelPendingUploadResponse: ... + + @overload + def pending_upload( + self, + name: str, + version: str, + pending_upload_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ModelPendingUploadResponse: ... + + @overload + def update( + self, + name: str, + version: str, + model_version_update: UpdateModelVersionRequest, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> ModelVersion: ... + + @overload + def update( + self, + name: str, + version: str, + model_version_update: UpdateModelVersionRequest, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> ModelVersion: ... + + @overload + def update( + self, + name: str, + version: str, + model_version_update: IO[bytes], + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> ModelVersion: ... + + + class azure.ai.projects.operations.BetaOperations(GeneratedBetaOperations): + agents: BetaAgentsOperations + datasets: BetaDatasetsOperations + evaluation_taxonomies: BetaEvaluationTaxonomiesOperations + evaluators: BetaEvaluatorsOperations + insights: BetaInsightsOperations + memory_stores: BetaMemoryStoresOperations + models: BetaModelsOperations + red_teams: BetaRedTeamsOperations + routines: BetaRoutinesOperations + schedules: BetaSchedulesOperations + skills: BetaSkillsOperations + + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... + + + class azure.ai.projects.operations.BetaRedTeamsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create( + self, + red_team: RedTeam, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> RedTeam: ... + + @overload + def create( + self, + red_team: RedTeam, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> RedTeam: ... + + @overload + def create( + self, + red_team: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> RedTeam: ... + + @distributed_trace + def get( + self, + name: str, + **kwargs: Any + ) -> RedTeam: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[RedTeam]: ... + + + class azure.ai.projects.operations.BetaRoutinesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create_or_update( + self, + routine_name: str, + *, + action: Optional[RoutineAction] = ..., + content_type: str = "application/json", + description: Optional[str] = ..., + enabled: Optional[bool] = ..., + triggers: Optional[dict[str, RoutineTrigger]] = ..., + **kwargs: Any + ) -> Routine: ... + + @overload + def create_or_update( + self, + routine_name: str, + body: CreateOrUpdateRoutineRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Routine: ... + + @overload + def create_or_update( + self, + routine_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Routine: ... + + @distributed_trace + def delete( + self, + routine_name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def disable( + self, + routine_name: str, + **kwargs: Any + ) -> Routine: ... + + @overload + def dispatch( + self, + routine_name: str, + *, + content_type: str = "application/json", + payload: Optional[RoutineDispatchPayload] = ..., + **kwargs: Any + ) -> DispatchRoutineResult: ... + + @overload + def dispatch( + self, + routine_name: str, + body: DispatchRoutineAsyncRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DispatchRoutineResult: ... + + @overload + def dispatch( + self, + routine_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DispatchRoutineResult: ... + + @distributed_trace + def enable( + self, + routine_name: str, + **kwargs: Any + ) -> Routine: ... + + @distributed_trace + def get( + self, + routine_name: str, + **kwargs: Any + ) -> Routine: ... + + @distributed_trace + def list( + self, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[Routine]: ... + + @distributed_trace + def list_runs( + self, + routine_name: str, + *, + before: Optional[str] = ..., + filter: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[RoutineRun]: ... + + + class azure.ai.projects.operations.BetaSchedulesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create_or_update( + self, + schedule_id: str, + schedule: Schedule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Schedule: ... + + @overload + def create_or_update( + self, + schedule_id: str, + schedule: Schedule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Schedule: ... + + @overload + def create_or_update( + self, + schedule_id: str, + schedule: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Schedule: ... + + @distributed_trace + def delete( + self, + schedule_id: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get( + self, + schedule_id: str, + **kwargs: Any + ) -> Schedule: ... + + @distributed_trace + def get_run( + self, + schedule_id: str, + run_id: str, + **kwargs: Any + ) -> ScheduleRun: ... + + @distributed_trace + def list( + self, + *, + enabled: Optional[bool] = ..., + type: Optional[Union[str, ScheduleTaskType]] = ..., + **kwargs: Any + ) -> ItemPaged[Schedule]: ... + + @distributed_trace + def list_runs( + self, + schedule_id: str, + *, + enabled: Optional[bool] = ..., + type: Optional[Union[str, ScheduleTaskType]] = ..., + **kwargs: Any + ) -> ItemPaged[ScheduleRun]: ... + + + class azure.ai.projects.operations.BetaSkillsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create( + self, + name: str, + *, + content_type: str = "application/json", + default: Optional[bool] = ..., + inline_content: Optional[SkillInlineContent] = ..., + **kwargs: Any + ) -> SkillVersion: ... + + @overload + def create( + self, + name: str, + body: CreateSkillVersionRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SkillVersion: ... + + @overload + def create( + self, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SkillVersion: ... + + @overload + def create_from_files( + self, + name: str, + content: CreateSkillVersionFromFilesBody, + **kwargs: Any + ) -> SkillVersion: ... + + @overload + def create_from_files( + self, + name: str, + content: CreateSkillVersionFromFilesBody, + **kwargs: Any + ) -> SkillVersion: ... + + @distributed_trace + def delete( + self, + name: str, + **kwargs: Any + ) -> DeleteSkillResult: ... + + @distributed_trace + def delete_version( + self, + name: str, + version: str, + **kwargs: Any + ) -> DeleteSkillVersionResult: ... + + @distributed_trace + def download( + self, + name: str, + **kwargs: Any + ) -> Iterator[bytes]: ... + + @distributed_trace + def download_version( + self, + name: str, + version: str, + **kwargs: Any + ) -> Iterator[bytes]: ... + + @distributed_trace + def get( + self, + name: str, + **kwargs: Any + ) -> SkillDetails: ... + + @distributed_trace + def get_version( + self, + name: str, + version: str, + **kwargs: Any + ) -> SkillVersion: ... + + @distributed_trace + def list( + self, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[SkillDetails]: ... + + @distributed_trace + def list_versions( + self, + name: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[SkillVersion]: ... + + @overload + def update( + self, + name: str, + *, + content_type: str = "application/json", + default_version: str, + **kwargs: Any + ) -> SkillDetails: ... + + @overload + def update( + self, + name: str, + body: UpdateSkillRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SkillDetails: ... + + @overload + def update( + self, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SkillDetails: ... + + + class azure.ai.projects.operations.ConnectionsOperations(ConnectionsOperationsGenerated): + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def get( + self, + name: str, + *, + include_credentials: Optional[bool] = False, + **kwargs: Any + ) -> Connection: ... + + @distributed_trace + def get_default( + self, + connection_type: Union[str, ConnectionType], + *, + include_credentials: Optional[bool] = False, + **kwargs: Any + ) -> Connection: ... + + @distributed_trace + def list( + self, + *, + connection_type: Optional[Union[str, ConnectionType]] = ..., + default_connection: Optional[bool] = ..., + **kwargs: Any + ) -> ItemPaged[Connection]: ... + + + class azure.ai.projects.operations.DatasetsOperations(DatasetsOperationsGenerated): + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create_or_update( + self, + name: str, + version: str, + dataset_version: DatasetVersion, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> DatasetVersion: ... + + @overload + def create_or_update( + self, + name: str, + version: str, + dataset_version: DatasetVersion, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> DatasetVersion: ... + + @overload + def create_or_update( + self, + name: str, + version: str, + dataset_version: IO[bytes], + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> DatasetVersion: ... + + @distributed_trace + def delete( + self, + name: str, + version: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get( + self, + name: str, + version: str, + **kwargs: Any + ) -> DatasetVersion: ... + + @distributed_trace + def get_credentials( + self, + name: str, + version: str, + **kwargs: Any + ) -> DatasetCredential: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[DatasetVersion]: ... + + @distributed_trace + def list_versions( + self, + name: str, + **kwargs: Any + ) -> ItemPaged[DatasetVersion]: ... + + @overload + def pending_upload( + self, + name: str, + version: str, + pending_upload_request: PendingUploadRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PendingUploadResponse: ... + + @overload + def pending_upload( + self, + name: str, + version: str, + pending_upload_request: PendingUploadRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PendingUploadResponse: ... + + @overload + def pending_upload( + self, + name: str, + version: str, + pending_upload_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PendingUploadResponse: ... + + @distributed_trace + def upload_file( + self, + *, + connection_name: Optional[str] = ..., + file_path: str, + name: str, + version: str, + **kwargs: Any + ) -> FileDatasetVersion: ... + + @distributed_trace + def upload_folder( + self, + *, + connection_name: Optional[str] = ..., + file_pattern: Optional[Pattern] = ..., + folder: str, + name: str, + version: str, + **kwargs: Any + ) -> FolderDatasetVersion: ... + + + class azure.ai.projects.operations.DeploymentsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def get( + self, + name: str, + **kwargs: Any + ) -> Deployment: ... + + @distributed_trace + def list( + self, + *, + deployment_type: Optional[Union[str, DeploymentType]] = ..., + model_name: Optional[str] = ..., + model_publisher: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[Deployment]: ... + + + class azure.ai.projects.operations.EvaluationRulesOperations(GeneratedEvaluationRulesOperations): + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create_or_update( + self, + id: str, + evaluation_rule: EvaluationRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationRule: ... + + @overload + def create_or_update( + self, + id: str, + evaluation_rule: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationRule: ... + + @overload + def create_or_update( + self, + id: str, + evaluation_rule: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationRule: ... + + @distributed_trace + def delete( + self, + id: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get( + self, + id: str, + **kwargs: Any + ) -> EvaluationRule: ... + + @distributed_trace + def list( + self, + *, + action_type: Optional[Union[str, EvaluationRuleActionType]] = ..., + agent_name: Optional[str] = ..., + enabled: Optional[bool] = ..., + **kwargs: Any + ) -> ItemPaged[EvaluationRule]: ... + + + class azure.ai.projects.operations.IndexesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create_or_update( + self, + name: str, + version: str, + index: Index, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> Index: ... + + @overload + def create_or_update( + self, + name: str, + version: str, + index: Index, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> Index: ... + + @overload + def create_or_update( + self, + name: str, + version: str, + index: IO[bytes], + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> Index: ... + + @distributed_trace + def delete( + self, + name: str, + version: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get( + self, + name: str, + version: str, + **kwargs: Any + ) -> Index: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[Index]: ... + + @distributed_trace + def list_versions( + self, + name: str, + **kwargs: Any + ) -> ItemPaged[Index]: ... + + + class azure.ai.projects.operations.TelemetryOperations: + + def __init__(self, outer_instance: AIProjectClient) -> None: ... + + @distributed_trace + def get_application_insights_connection_string(self) -> str: ... + + + class azure.ai.projects.operations.ToolboxesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create_version( + self, + name: str, + *, + content_type: str = "application/json", + description: Optional[str] = ..., + metadata: Optional[dict[str, str]] = ..., + policies: Optional[ToolboxPolicies] = ..., + skills: Optional[List[ToolboxSkill]] = ..., + tools: List[ToolboxTool], + **kwargs: Any + ) -> ToolboxVersionObject: ... + + @overload + def create_version( + self, + name: str, + body: CreateToolboxVersionRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ToolboxVersionObject: ... + + @overload + def create_version( + self, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ToolboxVersionObject: ... + + @distributed_trace + def delete( + self, + name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def delete_version( + self, + name: str, + version: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get( + self, + name: str, + **kwargs: Any + ) -> ToolboxObject: ... + + @distributed_trace + def get_version( + self, + name: str, + version: str, + **kwargs: Any + ) -> ToolboxVersionObject: ... + + @distributed_trace + def list( + self, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[ToolboxObject]: ... + + @distributed_trace + def list_versions( + self, + name: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[ToolboxVersionObject]: ... + + @overload + def update( + self, + name: str, + *, + content_type: str = "application/json", + default_version: str, + **kwargs: Any + ) -> ToolboxObject: ... + + @overload + def update( + self, + name: str, + body: UpdateToolboxRequest1, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ToolboxObject: ... + + @overload + def update( + self, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ToolboxObject: ... + + + class azure.ai.projects.operations.VoiceAgentWebSocketOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def connect_voice_agent( + self, + agent_name: str, + *, + agent_session_id: Optional[str] = ..., + agent_version_override: Optional[str] = ..., + store: Optional[bool] = ..., + structured_inputs: Optional[str] = ..., + websocket_subprotocol: Optional[Union[str, VoiceAgentWebSocketSubprotocol]] = ..., + **kwargs: Any + ) -> None: ... + + +namespace azure.ai.projects.telemetry + + def azure.ai.projects.telemetry.trace_function(span_name: Optional[str] = None) -> Callable: ... + + + class azure.ai.projects.telemetry.AIProjectInstrumentor: + + def __init__(self) -> None: ... + + def instrument( + self, + enable_content_recording: Optional[bool] = None, + enable_trace_context_propagation: Optional[bool] = None, + enable_baggage_propagation: Optional[bool] = None + ) -> None: ... + + def is_content_recording_enabled(self) -> bool: ... + + def is_instrumented(self) -> bool: ... + + def uninstrument(self) -> None: ... + + +namespace azure.ai.projects.types + + class azure.ai.projects.types.A2APreviewTool(TypedDict, total=False): + key "agent_card_path": str + key "base_url": str + key "project_connection_id": str + key "send_credentials_for_agent_card": bool + key "type": Required[Literal[ToolType.A2A_PREVIEW]] + agent_card_path: str + base_url: str + project_connection_id: str + send_credentials_for_agent_card: bool + type: Literal[ToolType.A2A_PREVIEW] + + + class azure.ai.projects.types.A2APreviewToolboxTool(TypedDict, total=False): + key "agent_card_path": str + key "base_url": str + key "description": str + key "name": str + key "project_connection_id": str + key "send_credentials_for_agent_card": bool + key "type": Required[Literal[ToolboxToolType.A2A_PREVIEW]] + agent_card_path: str + base_url: str + description: str + name: str + project_connection_id: str + send_credentials_for_agent_card: bool + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.A2A_PREVIEW] + + + class azure.ai.projects.types.A2AProtocolConfiguration(TypedDict, total=False): + + + class azure.ai.projects.types.AISearchIndexResource(TypedDict, total=False): + key "filter": str + key "index_asset_id": str + key "index_name": str + key "project_connection_id": str + key "query_type": Union[str, AzureAISearchQueryType] + key "top_k": int + filter: str + index_asset_id: str + index_name: str + project_connection_id: str + query_type: Union[str, AzureAISearchQueryType] + top_k: int + + + class azure.ai.projects.types.ActivityProtocolConfiguration(TypedDict, total=False): + key "enable_m365_public_endpoint": bool + enable_m365_public_endpoint: bool + + + class azure.ai.projects.types.AgentBlueprintReference(TypedDict, total=False): + key "blueprint_id": Required[str] + key "type": Required[Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT]] + blueprint_id: str + type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] + + + class azure.ai.projects.types.AgentBlueprintReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MANAGED_AGENT_IDENTITY_BLUEPRINT = "ManagedAgentIdentityBlueprint" + + + class azure.ai.projects.types.AgentCard(TypedDict, total=False): + key "description": str + key "skills": Required[list[AgentCardSkill]] + key "version": Required[str] + description: str + skills: list[AgentCardSkill] + version: str + + + class azure.ai.projects.types.AgentCardSkill(TypedDict, total=False): + key "description": str + key "id": Required[str] + key "name": Required[str] + description: str + examples: list[str] + id: str + name: str + tags: list[str] + + + class azure.ai.projects.types.AgentClusterInsightRequest(TypedDict, total=False): + key "agentName": Required[str] + key "modelConfiguration": ForwardRef('InsightModelConfiguration', module='types') + key "type": Required[Literal[InsightType.AGENT_CLUSTER_INSIGHT]] + agentName: str + modelConfiguration: InsightModelConfiguration + type: Literal[InsightType.AGENT_CLUSTER_INSIGHT] + + + class azure.ai.projects.types.AgentClusterInsightResult(TypedDict, total=False): + key "clusterInsight": Required[ClusterInsightResult] + key "type": Required[Literal[InsightType.AGENT_CLUSTER_INSIGHT]] + clusterInsight: ClusterInsightResult + type: Literal[InsightType.AGENT_CLUSTER_INSIGHT] + + + class azure.ai.projects.types.AgentDataGenerationJobSource(TypedDict, total=False): + key "agent_name": Required[str] + key "agent_version": str + key "description": str + key "type": Required[Literal[DataGenerationJobSourceType.AGENT]] + agent_name: str + agent_version: str + description: str + type: Literal[DataGenerationJobSourceType.AGENT] + + + class azure.ai.projects.types.AgentEndpointAuthorizationSchemeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BOT_SERVICE = "BotService" + BOT_SERVICE_RBAC = "BotServiceRbac" + BOT_SERVICE_TENANT = "BotServiceTenant" + ENTRA = "Entra" + + + class azure.ai.projects.types.AgentEndpointConfig(TypedDict, total=False): + key "protocol_configuration": ForwardRef('ProtocolConfiguration', module='types') + key "version_selector": ForwardRef('VersionSelector', module='types') + authorization_schemes: list[AgentEndpointAuthorizationScheme] + protocol_configuration: ProtocolConfiguration + version_selector: VersionSelector + + + class azure.ai.projects.types.AgentEvaluatorGenerationJobSource(TypedDict, total=False): + key "agent_name": Required[str] + key "agent_version": str + key "description": str + key "type": Required[Literal[EvaluatorGenerationJobSourceType.AGENT]] + agent_name: str + agent_version: str + description: str + type: Literal[EvaluatorGenerationJobSourceType.AGENT] + + + class azure.ai.projects.types.AgentKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EXTERNAL = "external" + HOSTED = "hosted" + PROMPT = "prompt" + VOICE = "voice" + WORKFLOW = "workflow" + + + class azure.ai.projects.types.AgentOptimizationCandidate(TypedDict, total=False): + key "avg_score": Required[float] + key "avg_tokens": Required[float] + key "candidate_id": str + key "eval_id": str + key "eval_run_id": str + key "name": Required[str] + key "promotion": ForwardRef('PromotionInfo', module='types') + avg_score: float + avg_tokens: float + candidate_id: str + eval_id: str + eval_run_id: str + mutations: dict[str, Any] + name: str + promotion: PromotionInfo + + + class azure.ai.projects.types.AgentOptimizationDatasetCriterion(TypedDict, total=False): + key "instruction": Required[str] + key "name": Required[str] + instruction: str + name: str + + + class azure.ai.projects.types.AgentOptimizationDatasetInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INLINE = "inline" + REFERENCE = "reference" + + + class azure.ai.projects.types.AgentOptimizationDatasetItem(TypedDict, total=False): + key "desired_num_turns": int + key "ground_truth": str + key "query": str + criteria: list[AgentOptimizationDatasetCriterion] + desired_num_turns: int + ground_truth: str + query: str + + + class azure.ai.projects.types.AgentOptimizationEvaluatorRef(TypedDict, total=False): + key "name": Required[str] + key "version": str + name: str + version: str + + + class azure.ai.projects.types.AgentOptimizationInlineDatasetInput(TypedDict, total=False): + key "items": Required[list[AgentOptimizationDatasetItem]] + key "type": Required[Literal[AgentOptimizationDatasetInputType.INLINE]] + items: list[AgentOptimizationDatasetItem] + type: Literal[AgentOptimizationDatasetInputType.INLINE] + + + class azure.ai.projects.types.AgentOptimizationJob(TypedDict, total=False): + key "created_at": Required[int] + key "error": ForwardRef('ApiError', module='types') + key "id": Required[str] + key "inputs": ForwardRef('AgentOptimizationJobInputs', module='types') + key "progress": ForwardRef('AgentOptimizationJobProgress', module='types') + key "result": ForwardRef('AgentOptimizationJobResult', module='types') + key "status": Required[Union[str, JobStatus]] + key "updated_at": Required[int] + created_at: int + error: ApiError + id: str + inputs: AgentOptimizationJobInputs + progress: AgentOptimizationJobProgress + result: AgentOptimizationJobResult + status: Union[str, JobStatus] + updated_at: int + warnings: list[str] + + + class azure.ai.projects.types.AgentOptimizationJobInputs(TypedDict, total=False): + key "agent": Required[OptimizedAgentIdentifier] + key "evaluators": Required[list[AgentOptimizationEvaluatorRef]] + key "options": ForwardRef('AgentOptimizationOptions', module='types') + key "train_dataset": Required[AgentOptimizationDatasetInput] + key "validation_dataset": ForwardRef('AgentOptimizationDatasetInput', module='types') + agent: OptimizedAgentIdentifier + evaluators: list[AgentOptimizationEvaluatorRef] + options: AgentOptimizationOptions + train_dataset: AgentOptimizationDatasetInput + validation_dataset: AgentOptimizationDatasetInput + + + class azure.ai.projects.types.AgentOptimizationJobProgress(TypedDict, total=False): + key "best_score": Required[float] + key "candidates_completed": Required[int] + key "elapsed_seconds": Required[float] + best_score: float + candidates_completed: int + elapsed_seconds: float + + + class azure.ai.projects.types.AgentOptimizationJobResult(TypedDict, total=False): + key "baseline": str + key "best": str + baseline: str + best: str + candidates: list[AgentOptimizationCandidate] + + + class azure.ai.projects.types.AgentOptimizationOptions(TypedDict, total=False): + key "eval_model": str + key "evaluation_level": Union[str, EvaluationLevel] + key "max_candidates": int + key "max_stalls": int + key "optimization_model": str + eval_model: str + evaluation_level: Union[str, EvaluationLevel] + max_candidates: int + max_stalls: int + optimization_config: dict[str, Any] + optimization_model: str + + + class azure.ai.projects.types.AgentOptimizationReferenceDatasetInput(TypedDict, total=False): + key "name": Required[str] + key "type": Required[Literal[AgentOptimizationDatasetInputType.REFERENCE]] + key "version": str + name: str + type: Literal[AgentOptimizationDatasetInputType.REFERENCE] + version: str + + + class azure.ai.projects.types.AgentTaxonomyInput(TypedDict, total=False): + key "riskCategories": Required[list[Union[str, RiskCategory]]] + key "target": Required[EvaluationTarget] + key "type": Required[Literal[EvaluationTaxonomyInputType.AGENT]] + riskCategories: list[Union[str, RiskCategory]] + target: EvaluationTarget + type: Literal[EvaluationTaxonomyInputType.AGENT] + + + class azure.ai.projects.types.ApiError(TypedDict, total=False): + key "code": Required[Optional[str]] + key "message": Required[str] + key "param": Optional[str] + key "type": str + additionalInfo: dict[str, Any] + code: str + debugInfo: dict[str, Any] + details: list[ApiError] + message: str + param: str + type: str + + + class azure.ai.projects.types.ApplyPatchToolParam(TypedDict, total=False): + key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] + key "type": Required[Literal[ToolType.APPLY_PATCH]] + allowed_callers: list[Union[str, CallableToolAllowedCaller]] + type: Literal[ToolType.APPLY_PATCH] + + + class azure.ai.projects.types.ApproximateLocation(TypedDict, total=False): + key "city": Optional[str] + key "country": Optional[str] + key "region": Optional[str] + key "timezone": Optional[str] + key "type": Required[Literal["approximate"]] + city: str + country: str + region: str + timezone: str + type: Literal[approximate] + + + class azure.ai.projects.types.ArtifactProfile(TypedDict, total=False): + key "category": Required[Union[str, FoundryModelArtifactProfileCategory]] + category: Union[str, FoundryModelArtifactProfileCategory] + signals: list[Union[str, FoundryModelArtifactProfileSignal]] + + + class azure.ai.projects.types.AutoCodeInterpreterToolParam(TypedDict, total=False): + key "memory_limit": Optional[Union[str, ContainerMemoryLimit]] + key "network_policy": ForwardRef('ContainerNetworkPolicyParam', module='types') + key "type": Required[Literal["auto"]] + file_ids: list[str] + memory_limit: Union[str, ContainerMemoryLimit] + network_policy: ContainerNetworkPolicyParam + type: Literal[auto] + + + class azure.ai.projects.types.AzureAIAgentTarget(TypedDict, total=False): + key "name": Required[str] + key "type": Required[Literal["azure_ai_agent"]] + key "version": str + name: str + tool_descriptions: list[ToolDescription] + tools: list[Tool] + type: Literal[azure_ai_agent] + version: str + + + class azure.ai.projects.types.AzureAIModelTarget(TypedDict, total=False): + key "model": str + key "sampling_params": ForwardRef('ModelSamplingParams', module='types') + key "type": Required[Literal["azure_ai_model"]] + model: str + sampling_params: ModelSamplingParams + type: Literal[azure_ai_model] + + + class azure.ai.projects.types.AzureAISearchIndex(TypedDict, total=False): + key "connectionName": Required[str] + key "description": str + key "fieldMapping": ForwardRef('FieldMapping', module='types') + key "id": str + key "indexName": Required[str] + key "name": Required[str] + key "type": Required[Literal[IndexType.AZURE_SEARCH]] + key "version": Required[str] + connectionName: str + description: str + fieldMapping: FieldMapping + id: str + indexName: str + name: str + tags: dict[str, str] + type: Literal[IndexType.AZURE_SEARCH] + version: str + + + class azure.ai.projects.types.AzureAISearchTool(TypedDict, total=False): + key "azure_ai_search": Required[AzureAISearchToolResource] + key "description": str + key "name": str + key "type": Required[Literal[ToolType.AZURE_AI_SEARCH]] + azure_ai_search: AzureAISearchToolResource + description: str + name: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolType.AZURE_AI_SEARCH] + + + class azure.ai.projects.types.AzureAISearchToolResource(TypedDict, total=False): + key "indexes": Required[list[AISearchIndexResource]] + indexes: list[AISearchIndexResource] + + + class azure.ai.projects.types.AzureAISearchToolboxTool(TypedDict, total=False): + key "azure_ai_search": Required[AzureAISearchToolResource] + key "description": str + key "name": str + key "type": Required[Literal[ToolboxToolType.AZURE_AI_SEARCH]] + azure_ai_search: AzureAISearchToolResource + description: str + name: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.AZURE_AI_SEARCH] + + + class azure.ai.projects.types.AzureFunctionBinding(TypedDict, total=False): + key "storage_queue": Required[AzureFunctionStorageQueue] + key "type": Required[Literal["storage_queue"]] + storage_queue: AzureFunctionStorageQueue + type: Literal[storage_queue] + + + class azure.ai.projects.types.AzureFunctionDefinition(TypedDict, total=False): + key "function": Required[AzureFunctionDefinitionFunction] + key "input_binding": Required[AzureFunctionBinding] + key "output_binding": Required[AzureFunctionBinding] + function: AzureFunctionDefinitionFunction + input_binding: AzureFunctionBinding + output_binding: AzureFunctionBinding + + + class azure.ai.projects.types.AzureFunctionDefinitionFunction(TypedDict, total=False): + key "description": str + key "name": Required[str] + key "parameters": Required[dict[str, Any]] + description: str + name: str + parameters: dict[str, Any] + + + class azure.ai.projects.types.AzureFunctionStorageQueue(TypedDict, total=False): + key "queue_name": Required[str] + key "queue_service_endpoint": Required[str] + queue_name: str + queue_service_endpoint: str + + + class azure.ai.projects.types.AzureFunctionTool(TypedDict, total=False): + key "azure_function": Required[AzureFunctionDefinition] + key "type": Required[Literal[ToolType.AZURE_FUNCTION]] + azure_function: AzureFunctionDefinition + tool_configs: dict[str, ToolConfig] + type: Literal[ToolType.AZURE_FUNCTION] + + + class azure.ai.projects.types.AzureOpenAIModelConfiguration(TypedDict, total=False): + key "modelDeploymentName": Required[str] + key "type": Required[Literal["AzureOpenAIModel"]] + modelDeploymentName: str + type: Literal[AzureOpenAIModel] + + + class azure.ai.projects.types.BingCustomSearchConfiguration(TypedDict, total=False): + key "count": int + key "freshness": str + key "instance_name": Required[str] + key "market": str + key "project_connection_id": Required[str] + key "set_lang": str + count: int + freshness: str + instance_name: str + market: str + project_connection_id: str + set_lang: str + + + class azure.ai.projects.types.BingCustomSearchPreviewTool(TypedDict, total=False): + key "bing_custom_search_preview": Required[BingCustomSearchToolParameters] + key "type": Required[Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW]] + bing_custom_search_preview: BingCustomSearchToolParameters + type: Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW] + + + class azure.ai.projects.types.BingCustomSearchToolParameters(TypedDict, total=False): + key "search_configurations": Required[list[BingCustomSearchConfiguration]] + search_configurations: list[BingCustomSearchConfiguration] + + + class azure.ai.projects.types.BingGroundingSearchConfiguration(TypedDict, total=False): + key "count": int + key "freshness": str + key "market": str + key "project_connection_id": Required[str] + key "set_lang": str + count: int + freshness: str + market: str + project_connection_id: str + set_lang: str + + + class azure.ai.projects.types.BingGroundingSearchToolParameters(TypedDict, total=False): + key "search_configurations": Required[list[BingGroundingSearchConfiguration]] + search_configurations: list[BingGroundingSearchConfiguration] + + + class azure.ai.projects.types.BingGroundingTool(TypedDict, total=False): + key "bing_grounding": Required[BingGroundingSearchToolParameters] + key "description": str + key "name": str + key "type": Required[Literal[ToolType.BING_GROUNDING]] + bing_grounding: BingGroundingSearchToolParameters + description: str + name: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolType.BING_GROUNDING] + + + class azure.ai.projects.types.BotServiceAuthorizationScheme(TypedDict, total=False): + key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE]] + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE] + + + class azure.ai.projects.types.BotServiceRbacAuthorizationScheme(TypedDict, total=False): + key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC]] + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC] + + + class azure.ai.projects.types.BotServiceTenantAuthorizationScheme(TypedDict, total=False): + key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT]] + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT] + + + class azure.ai.projects.types.BrowserAutomationPreviewTool(TypedDict, total=False): + key "browser_automation_preview": Required[BrowserAutomationToolParameters] + key "type": Required[Literal[ToolType.BROWSER_AUTOMATION_PREVIEW]] + browser_automation_preview: BrowserAutomationToolParameters + type: Literal[ToolType.BROWSER_AUTOMATION_PREVIEW] + + + class azure.ai.projects.types.BrowserAutomationPreviewToolboxTool(TypedDict, total=False): + key "browser_automation_preview": Required[BrowserAutomationToolParameters] + key "description": str + key "name": str + key "type": Required[Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW]] + browser_automation_preview: BrowserAutomationToolParameters + description: str + name: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW] + + + class azure.ai.projects.types.BrowserAutomationToolConnectionParameters(TypedDict, total=False): + key "project_connection_id": Required[str] + project_connection_id: str + + + class azure.ai.projects.types.BrowserAutomationToolParameters(TypedDict, total=False): + key "connection": Required[BrowserAutomationToolConnectionParameters] + connection: BrowserAutomationToolConnectionParameters + + + class azure.ai.projects.types.CaptureStructuredOutputsTool(TypedDict, total=False): + key "description": str + key "name": str + key "outputs": Required[StructuredOutputDefinition] + key "type": Required[Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS]] + description: str + name: str + outputs: StructuredOutputDefinition + tool_configs: dict[str, ToolConfig] + type: Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS] + + + class azure.ai.projects.types.ChartCoordinate(TypedDict, total=False): + key "size": Required[int] + key "x": Required[int] + key "y": Required[int] + size: int + x: int + y: int + + + class azure.ai.projects.types.ClusterInsightResult(TypedDict, total=False): + key "clusters": Required[list[InsightCluster]] + key "summary": Required[InsightSummary] + clusters: list[InsightCluster] + coordinates: dict[str, ChartCoordinate] + summary: InsightSummary + + + class azure.ai.projects.types.ClusterTokenUsage(TypedDict, total=False): + key "inputTokenUsage": Required[int] + key "outputTokenUsage": Required[int] + key "totalTokenUsage": Required[int] + inputTokenUsage: int + outputTokenUsage: int + totalTokenUsage: int + + + class azure.ai.projects.types.CodeBasedEvaluatorDefinition(TypedDict, total=False): + key "blob_uri": str + key "code_text": str + key "entry_point": str + key "image_tag": str + key "type": Required[Literal[EvaluatorDefinitionType.CODE]] + blob_uri: str + code_text: str + data_schema: dict[str, Any] + entry_point: str + image_tag: str + init_parameters: dict[str, Any] + metrics: dict[str, EvaluatorMetric] + type: Literal[EvaluatorDefinitionType.CODE] + + + class azure.ai.projects.types.CodeConfiguration(TypedDict, total=False): + key "content_hash": str + key "dependency_resolution": Required[Union[str, CodeDependencyResolution]] + key "entry_point": Required[list[str]] + key "runtime": Required[str] + content_hash: str + dependency_resolution: Union[str, CodeDependencyResolution] + entry_point: list[str] + runtime: str + + + class azure.ai.projects.types.CodeInterpreterTool(TypedDict, total=False): + key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] + key "container": Union[str, AutoCodeInterpreterToolParam] + key "description": str + key "name": str + key "type": Required[Literal[ToolType.CODE_INTERPRETER]] + allowed_callers: list[Union[str, CallableToolAllowedCaller]] + container: Union[str, AutoCodeInterpreterToolParam] + description: str + name: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolType.CODE_INTERPRETER] + + + class azure.ai.projects.types.CodeInterpreterToolboxTool(TypedDict, total=False): + key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] + key "container": Union[str, AutoCodeInterpreterToolParam] + key "description": str + key "name": str + key "type": Required[Literal[ToolboxToolType.CODE_INTERPRETER]] + allowed_callers: list[Union[str, CallableToolAllowedCaller]] + container: Union[str, AutoCodeInterpreterToolParam] + description: str + name: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.CODE_INTERPRETER] + + + class azure.ai.projects.types.ComparisonFilter(TypedDict, total=False): + key "key": Required[str] + key "type": Required[Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]] + key "value": Required[Union[str, float, bool, list[Union[str, float]]]] + key: str + type: Literal[eq, ne, gt, gte, lt, lte, in, nin] + value: Union[str, float, bool, list[Union[str, float]]] + + + class azure.ai.projects.types.CompoundFilter(TypedDict, total=False): + key "filters": Required[list[Union[ComparisonFilter, Any]]] + key "type": Required[Literal["and", "or"]] + filters: list[Union[ComparisonFilter, Any]] + type: Literal[and, or] + + + class azure.ai.projects.types.ComputerTool(TypedDict, total=False): + key "type": Required[Literal[ToolType.COMPUTER]] + type: Literal[ToolType.COMPUTER] + + + class azure.ai.projects.types.ComputerUsePreviewTool(TypedDict, total=False): + key "display_height": Required[int] + key "display_width": Required[int] + key "environment": Required[Union[str, ComputerEnvironment]] + key "type": Required[Literal[ToolType.COMPUTER_USE_PREVIEW]] + display_height: int + display_width: int + environment: Union[str, ComputerEnvironment] + type: Literal[ToolType.COMPUTER_USE_PREVIEW] + + + class azure.ai.projects.types.ContainerAutoParam(TypedDict, total=False): + key "memory_limit": Optional[Union[str, ContainerMemoryLimit]] + key "network_policy": ForwardRef('ContainerNetworkPolicyParam', module='types') + key "type": Required[Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO]] + file_ids: list[str] + memory_limit: Union[str, ContainerMemoryLimit] + network_policy: ContainerNetworkPolicyParam + skills: list[ContainerSkill] + type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO] + + + class azure.ai.projects.types.ContainerConfiguration(TypedDict, total=False): + key "image": Required[str] + image: str + + + class azure.ai.projects.types.ContainerNetworkPolicyAllowlistParam(TypedDict, total=False): + key "allowed_domains": Required[list[str]] + key "type": Required[Literal[ContainerNetworkPolicyParamType.ALLOWLIST]] + allowed_domains: list[str] + domain_secrets: list[ContainerNetworkPolicyDomainSecretParam] + type: Literal[ContainerNetworkPolicyParamType.ALLOWLIST] + + + class azure.ai.projects.types.ContainerNetworkPolicyDisabledParam(TypedDict, total=False): + key "type": Required[Literal[ContainerNetworkPolicyParamType.DISABLED]] + type: Literal[ContainerNetworkPolicyParamType.DISABLED] + + + class azure.ai.projects.types.ContainerNetworkPolicyDomainSecretParam(TypedDict, total=False): + key "domain": Required[str] + key "name": Required[str] + key "value": Required[str] + domain: str + name: str + value: str + + + class azure.ai.projects.types.ContainerNetworkPolicyParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ALLOWLIST = "allowlist" + DISABLED = "disabled" + + + class azure.ai.projects.types.ContainerSkillType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INLINE = "inline" + SKILL_REFERENCE = "skill_reference" + + + class azure.ai.projects.types.ContinuousEvaluationRuleAction(TypedDict, total=False): + key "evalId": Required[str] + key "maxHourlyRuns": int + key "samplingRate": float + key "type": Required[Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION]] + evalId: str + maxHourlyRuns: int + samplingRate: float + type: Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION] + + + class azure.ai.projects.types.CosmosDBIndex(TypedDict, total=False): + key "connectionName": Required[str] + key "containerName": Required[str] + key "databaseName": Required[str] + key "description": str + key "embeddingConfiguration": Required[EmbeddingConfiguration] + key "fieldMapping": Required[FieldMapping] + key "id": str + key "name": Required[str] + key "type": Required[Literal[IndexType.COSMOS_DB]] + key "version": Required[str] + connectionName: str + containerName: str + databaseName: str + description: str + embeddingConfiguration: EmbeddingConfiguration + fieldMapping: FieldMapping + id: str + name: str + tags: dict[str, str] + type: Literal[IndexType.COSMOS_DB] + version: str + + + class azure.ai.projects.types.CreateAgentVersionFromManifestRequest(TypedDict, total=False): + key "description": str + key "manifest_id": Required[str] + key "parameter_values": Required[dict[str, Any]] + description: str + manifest_id: str + metadata: dict[str, str] + parameter_values: dict[str, Any] + + + class azure.ai.projects.types.CreateAgentVersionRequest(TypedDict, total=False): + key "blueprint_reference": ForwardRef('AgentBlueprintReference', module='types') + key "definition": Required[AgentDefinition] + key "description": str + key "draft": bool + blueprint_reference: AgentBlueprintReference + definition: AgentDefinition + description: str + draft: bool + metadata: dict[str, str] + + + class azure.ai.projects.types.CreateMemoryRequest(TypedDict, total=False): + key "content": Required[str] + key "kind": Required[Union[str, MemoryItemKind]] + key "scope": Required[str] + content: str + kind: Union[str, MemoryItemKind] + scope: str + + + class azure.ai.projects.types.CreateMemoryStoreRequest(TypedDict, total=False): + key "definition": Required[MemoryStoreDefinition] + key "description": str + key "name": Required[str] + definition: MemoryStoreDefinition + description: str + metadata: dict[str, str] + name: str + + + class azure.ai.projects.types.CreateOrUpdateRoutineRequest(TypedDict, total=False): + key "action": ForwardRef('RoutineAction', module='types') + key "description": str + key "enabled": bool + action: RoutineAction + description: str + enabled: bool + triggers: dict[str, RoutineTrigger] + + + class azure.ai.projects.types.CreateSessionRequest(TypedDict, total=False): + key "agent_session_id": str + key "version_indicator": Required[VersionIndicator] + agent_session_id: str + version_indicator: VersionIndicator + + + class azure.ai.projects.types.CreateSkillVersionFromFilesBody(TypedDict, total=False): + key "default": bool + key "files": Required[list[Union[str, bytes, IO[str], IO[bytes], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]]], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]], Optional[str]]]]] + default: bool + files: list[FileType] + + + class azure.ai.projects.types.CreateSkillVersionRequest(TypedDict, total=False): + key "default": bool + key "inline_content": ForwardRef('SkillInlineContent', module='types') + default: bool + inline_content: SkillInlineContent + + + class azure.ai.projects.types.CreateToolboxVersionRequest(TypedDict, total=False): + key "description": str + key "policies": ForwardRef('ToolboxPolicies', module='types') + key "tools": Required[list[ToolboxTool]] + description: str + metadata: dict[str, str] + policies: ToolboxPolicies + skills: list[ToolboxSkill] + tools: list[ToolboxTool] + + + class azure.ai.projects.types.CreateTranscriptionResponseJsonUsageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DURATION = "duration" + TOKENS = "tokens" + + + class azure.ai.projects.types.CronTrigger(TypedDict, total=False): + key "endTime": str + key "expression": Required[str] + key "startTime": str + key "timeZone": str + key "type": Required[Literal[TriggerType.CRON]] + endTime: str + expression: str + startTime: str + timeZone: str + type: Literal[TriggerType.CRON] + + + class azure.ai.projects.types.CustomGrammarFormatParam(TypedDict, total=False): + key "definition": Required[str] + key "syntax": Required[Union[str, GrammarSyntax1]] + key "type": Required[Literal[CustomToolParamFormatType.GRAMMAR]] + definition: str + syntax: Union[str, GrammarSyntax1] + type: Literal[CustomToolParamFormatType.GRAMMAR] + + + class azure.ai.projects.types.CustomRoutineTrigger(TypedDict, total=False): + key "event_name": str + key "parameters": Required[dict[str, Any]] + key "provider": Required[str] + key "type": Required[Literal[RoutineTriggerType.CUSTOM]] + event_name: str + parameters: dict[str, Any] + provider: str + type: Literal[RoutineTriggerType.CUSTOM] + + + class azure.ai.projects.types.CustomTextFormatParam(TypedDict, total=False): + key "type": Required[Literal[CustomToolParamFormatType.TEXT]] + type: Literal[CustomToolParamFormatType.TEXT] + + + class azure.ai.projects.types.CustomToolParam(TypedDict, total=False): + key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] + key "defer_loading": bool + key "description": str + key "format": ForwardRef('CustomToolParamFormat', module='types') + key "name": Required[str] + key "type": Required[Literal[ToolType.CUSTOM]] + allowed_callers: list[Union[str, CallableToolAllowedCaller]] + defer_loading: bool + description: str + format: CustomToolParamFormat + name: str + type: Literal[ToolType.CUSTOM] + + + class azure.ai.projects.types.CustomToolParamFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + GRAMMAR = "grammar" + TEXT = "text" + + + class azure.ai.projects.types.DailyRecurrenceSchedule(TypedDict, total=False): + key "hours": Required[list[int]] + key "type": Required[Literal[RecurrenceType.DAILY]] + hours: list[int] + type: Literal[RecurrenceType.DAILY] + + + class azure.ai.projects.types.DataGenerationJob(TypedDict, total=False): + key "created_at": Required[int] + key "error": ForwardRef('ApiError', module='types') + key "finished_at": int + key "id": Required[str] + key "inputs": ForwardRef('DataGenerationJobInputs', module='types') + key "result": ForwardRef('DataGenerationJobResult', module='types') + key "status": Required[Union[str, JobStatus]] + created_at: int + error: ApiError + finished_at: int + id: str + inputs: DataGenerationJobInputs + result: DataGenerationJobResult + status: Union[str, JobStatus] + + + class azure.ai.projects.types.DataGenerationJobInputs(TypedDict, total=False): + key "name": Required[str] + key "options": Required[DataGenerationJobOptions] + key "output_options": ForwardRef('DataGenerationJobOutputOptions', module='types') + key "scenario": Required[Union[str, DataGenerationJobScenario]] + key "sources": Required[list[DataGenerationJobSource]] + name: str + options: DataGenerationJobOptions + output_options: DataGenerationJobOutputOptions + scenario: Union[str, DataGenerationJobScenario] + sources: list[DataGenerationJobSource] + + + class azure.ai.projects.types.DataGenerationJobOutputOptions(TypedDict, total=False): + key "description": str + key "name": str + description: str + name: str + tags: dict[str, str] + + + class azure.ai.projects.types.DataGenerationJobOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DATASET = "dataset" + FILE = "file" + + + class azure.ai.projects.types.DataGenerationJobResult(TypedDict, total=False): + key "generated_samples": Required[int] + key "token_usage": ForwardRef('DataGenerationTokenUsage', module='types') + generated_samples: int + outputs: list[DataGenerationJobOutput] + token_usage: DataGenerationTokenUsage + + + class azure.ai.projects.types.DataGenerationJobSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT = "agent" + FILE = "file" + PROMPT = "prompt" + TRACES = "traces" + + + class azure.ai.projects.types.DataGenerationJobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SIMPLE_QNA = "simple_qna" + TASK_GENERATION = "task_generation" + TOOL_USE = "tool_use" + TRACES = "traces" + + + class azure.ai.projects.types.DataGenerationModelOptions(TypedDict, total=False): + key "model": Required[str] + model: str + + + class azure.ai.projects.types.DataGenerationTokenUsage(TypedDict, total=False): + key "completion_tokens": Required[int] + key "prompt_tokens": Required[int] + key "total_tokens": Required[int] + completion_tokens: int + prompt_tokens: int + total_tokens: int + + + class azure.ai.projects.types.DatasetDataGenerationJobOutput(TypedDict, total=False): + key "description": str + key "id": str + key "name": str + key "type": Required[Literal[DataGenerationJobOutputType.DATASET]] + key "version": str + description: str + id: str + name: str + tags: dict[str, str] + type: Literal[DataGenerationJobOutputType.DATASET] + version: str + + + class azure.ai.projects.types.DatasetEvaluatorGenerationJobSource(TypedDict, total=False): + key "description": str + key "name": Required[str] + key "type": Required[Literal[EvaluatorGenerationJobSourceType.DATASET]] + key "version": str + description: str + name: str + type: Literal[EvaluatorGenerationJobSourceType.DATASET] + version: str + + + class azure.ai.projects.types.DatasetReference(TypedDict, total=False): + key "name": Required[str] + key "version": Required[str] + name: str + version: str + + + class azure.ai.projects.types.DatasetType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + URI_FILE = "uri_file" + URI_FOLDER = "uri_folder" + + + class azure.ai.projects.types.DeleteScopeRequest(TypedDict, total=False): + key "scope": Required[str] + scope: str + + + class azure.ai.projects.types.Dimension(TypedDict, total=False): + key "always_applicable": bool + key "description": Required[str] + key "id": Required[str] + key "weight": Required[int] + always_applicable: bool + description: str + id: str + weight: int + + + class azure.ai.projects.types.DispatchRoutineAsyncRequest(TypedDict, total=False): + key "payload": ForwardRef('RoutineDispatchPayload', module='types') + payload: RoutineDispatchPayload + + + class azure.ai.projects.types.EmbeddingConfiguration(TypedDict, total=False): + key "embeddingField": Required[str] + key "modelDeploymentName": Required[str] + embeddingField: str + modelDeploymentName: str + + + class azure.ai.projects.types.EmptyModelParam(TypedDict, total=False): + + + class azure.ai.projects.types.EndpointBasedEvaluatorDefinition(TypedDict, total=False): + key "connection_name": Required[str] + key "type": Required[Literal[EvaluatorDefinitionType.ENDPOINT]] + connection_name: str + data_schema: dict[str, Any] + init_parameters: dict[str, Any] + metrics: dict[str, EvaluatorMetric] + type: Literal[EvaluatorDefinitionType.ENDPOINT] + + + class azure.ai.projects.types.EntraAuthorizationScheme(TypedDict, total=False): + key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.ENTRA]] + type: Literal[AgentEndpointAuthorizationSchemeType.ENTRA] + + + class azure.ai.projects.types.EvalResult(TypedDict, total=False): + key "name": Required[str] + key "passed": Required[bool] + key "score": Required[float] + key "type": Required[str] + name: str + passed: bool + score: float + type: str + + + class azure.ai.projects.types.EvalRunResultCompareItem(TypedDict, total=False): + key "deltaEstimate": Required[float] + key "pValue": Required[float] + key "treatmentEffect": Required[Union[str, TreatmentEffectType]] + key "treatmentRunId": Required[str] + key "treatmentRunSummary": Required[EvalRunResultSummary] + deltaEstimate: float + pValue: float + treatmentEffect: Union[str, TreatmentEffectType] + treatmentRunId: str + treatmentRunSummary: EvalRunResultSummary + + + class azure.ai.projects.types.EvalRunResultComparison(TypedDict, total=False): + key "baselineRunSummary": Required[EvalRunResultSummary] + key "compareItems": Required[list[EvalRunResultCompareItem]] + key "evaluator": Required[str] + key "metric": Required[str] + key "testingCriteria": Required[str] + baselineRunSummary: EvalRunResultSummary + compareItems: list[EvalRunResultCompareItem] + evaluator: str + metric: str + testingCriteria: str + + + class azure.ai.projects.types.EvalRunResultSummary(TypedDict, total=False): + key "average": Required[float] + key "runId": Required[str] + key "sampleCount": Required[int] + key "standardDeviation": Required[float] + average: float + runId: str + sampleCount: int + standardDeviation: float + + + class azure.ai.projects.types.EvaluationComparisonInsightRequest(TypedDict, total=False): + key "baselineRunId": Required[str] + key "evalId": Required[str] + key "treatmentRunIds": Required[list[str]] + key "type": Required[Literal[InsightType.EVALUATION_COMPARISON]] + baselineRunId: str + evalId: str + treatmentRunIds: list[str] + type: Literal[InsightType.EVALUATION_COMPARISON] + + + class azure.ai.projects.types.EvaluationComparisonInsightResult(TypedDict, total=False): + key "comparisons": Required[list[EvalRunResultComparison]] + key "method": Required[str] + key "type": Required[Literal[InsightType.EVALUATION_COMPARISON]] + comparisons: list[EvalRunResultComparison] + method: str + type: Literal[InsightType.EVALUATION_COMPARISON] + + + class azure.ai.projects.types.EvaluationResultSample(TypedDict, total=False): + key "correlationInfo": Required[dict[str, Any]] + key "evaluationResult": Required[EvalResult] + key "features": Required[dict[str, Any]] + key "id": Required[str] + key "type": Required[Literal[SampleType.EVALUATION_RESULT_SAMPLE]] + correlationInfo: dict[str, Any] + evaluationResult: EvalResult + features: dict[str, Any] + id: str + type: Literal[SampleType.EVALUATION_RESULT_SAMPLE] + + + class azure.ai.projects.types.EvaluationRule(TypedDict, total=False): + key "action": Required[EvaluationRuleAction] + key "description": str + key "displayName": str + key "enabled": Required[bool] + key "eventType": Required[Union[str, EvaluationRuleEventType]] + key "filter": ForwardRef('EvaluationRuleFilter', module='types') + key "id": Required[str] + key "systemData": Required[dict[str, str]] + action: EvaluationRuleAction + description: str + displayName: str + enabled: bool + eventType: Union[str, EvaluationRuleEventType] + filter: EvaluationRuleFilter + id: str + systemData: dict[str, str] + + + class azure.ai.projects.types.EvaluationRuleActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONTINUOUS_EVALUATION = "continuousEvaluation" + HUMAN_EVALUATION_PREVIEW = "humanEvaluationPreview" + + + class azure.ai.projects.types.EvaluationRuleFilter(TypedDict, total=False): + key "agentName": Required[str] + agentName: str + + + class azure.ai.projects.types.EvaluationRunClusterInsightRequest(TypedDict, total=False): + key "evalId": Required[str] + key "modelConfiguration": ForwardRef('InsightModelConfiguration', module='types') + key "runIds": Required[list[str]] + key "type": Required[Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT]] + evalId: str + modelConfiguration: InsightModelConfiguration + runIds: list[str] + type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] + + + class azure.ai.projects.types.EvaluationRunClusterInsightResult(TypedDict, total=False): + key "clusterInsight": Required[ClusterInsightResult] + key "type": Required[Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT]] + clusterInsight: ClusterInsightResult + type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] + + + class azure.ai.projects.types.EvaluationScheduleTask(TypedDict, total=False): + key "evalId": Required[str] + key "evalRun": Required[dict[str, Any]] + key "type": Required[Literal[ScheduleTaskType.EVALUATION]] + configuration: dict[str, str] + evalId: str + evalRun: dict[str, Any] + type: Literal[ScheduleTaskType.EVALUATION] + + + class azure.ai.projects.types.EvaluationTaxonomy(TypedDict, total=False): + key "description": str + key "id": str + key "name": Required[str] + key "taxonomyInput": Required[EvaluationTaxonomyInput] + key "version": Required[str] + description: str + id: str + name: str + properties: dict[str, str] + tags: dict[str, str] + taxonomyCategories: list[TaxonomyCategory] + taxonomyInput: EvaluationTaxonomyInput + version: str + + + class azure.ai.projects.types.EvaluationTaxonomyInput(TypedDict, total=False): + key "riskCategories": Required[list[Union[str, RiskCategory]]] + key "target": Required[EvaluationTarget] + key "type": Required[Literal[EvaluationTaxonomyInputType.AGENT]] + riskCategories: list[Union[str, RiskCategory]] + target: EvaluationTarget + type: Literal[EvaluationTaxonomyInputType.AGENT] + + + class azure.ai.projects.types.EvaluationTaxonomyInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT = "agent" + POLICY = "policy" + + + class azure.ai.projects.types.EvaluatorCredentialRequest(TypedDict, total=False): + key "blob_uri": Required[str] + blob_uri: str + + + class azure.ai.projects.types.EvaluatorDefinitionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CODE = "code" + ENDPOINT = "endpoint" + OPENAI_GRADERS = "openai_graders" + PROMPT = "prompt" + PROMPT_AND_CODE = "prompt_and_code" + RUBRIC = "rubric" + SERVICE = "service" + + + class azure.ai.projects.types.EvaluatorGenerationArtifacts(TypedDict, total=False): + key "dataset": Required[DatasetReference] + key "kinds": Required[list[str]] + dataset: DatasetReference + kinds: list[str] + + + class azure.ai.projects.types.EvaluatorGenerationInputs(TypedDict, total=False): + key "evaluator_description": str + key "evaluator_display_name": str + key "evaluator_name": Required[str] + key "model": Required[str] + key "sources": Required[list[EvaluatorGenerationJobSource]] + evaluator_description: str + evaluator_display_name: str + evaluator_name: str + model: str + sources: list[EvaluatorGenerationJobSource] + + + class azure.ai.projects.types.EvaluatorGenerationJob(TypedDict, total=False): + key "created_at": Required[int] + key "error": ForwardRef('ApiError', module='types') + key "finished_at": int + key "id": Required[str] + key "inputs": ForwardRef('EvaluatorGenerationInputs', module='types') + key "result": ForwardRef('EvaluatorVersion', module='types') + key "status": Required[Union[str, JobStatus]] + key "usage": ForwardRef('EvaluatorGenerationTokenUsage', module='types') + created_at: int + error: ApiError + finished_at: int + id: str + input_quality_warnings: list[RubricGenerationInputQualityWarning] + inputs: EvaluatorGenerationInputs + result: EvaluatorVersion + status: Union[str, JobStatus] + usage: EvaluatorGenerationTokenUsage + + + class azure.ai.projects.types.EvaluatorGenerationJobSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT = "agent" + DATASET = "dataset" + PROMPT = "prompt" + TRACES = "traces" + + + class azure.ai.projects.types.EvaluatorGenerationTokenUsage(TypedDict, total=False): + key "input_tokens": Required[int] + key "output_tokens": Required[int] + key "total_tokens": Required[int] + input_tokens: int + output_tokens: int + total_tokens: int + + + class azure.ai.projects.types.EvaluatorMetric(TypedDict, total=False): + key "desirable_direction": Union[str, EvaluatorMetricDirection] + key "is_primary": bool + key "max_value": float + key "min_value": float + key "threshold": float + key "type": Union[str, EvaluatorMetricType] + desirable_direction: Union[str, EvaluatorMetricDirection] + is_primary: bool + max_value: float + min_value: float + threshold: float + type: Union[str, EvaluatorMetricType] + + + class azure.ai.projects.types.EvaluatorVersion(TypedDict, total=False): + key "categories": Required[list[Union[str, EvaluatorCategory]]] + key "created_at": Required[str] + key "created_by": Required[str] + key "definition": Required[EvaluatorDefinition] + key "description": str + key "display_name": str + key "evaluator_type": Required[Union[str, EvaluatorType]] + key "generation_artifacts": ForwardRef('EvaluatorGenerationArtifacts', module='types') + key "generation_job_id": str + key "id": str + key "modified_at": Required[str] + key "name": Required[str] + key "version": Required[str] + categories: list[Union[str, EvaluatorCategory]] + created_at: str + created_by: str + definition: EvaluatorDefinition + description: str + display_name: str + evaluator_type: Union[str, EvaluatorType] + generation_artifacts: EvaluatorGenerationArtifacts + generation_job_id: str + id: str + metadata: dict[str, str] + modified_at: str + name: str + supported_evaluation_levels: list[Union[str, EvaluationLevel]] + tags: dict[str, str] + version: str + warnings: list[Union[str, GenerationWarningType]] + + + class azure.ai.projects.types.ExternalAgentDefinition(TypedDict, total=False): + key "kind": Required[Literal[AgentKind.EXTERNAL]] + key "otel_agent_id": str + key "rai_config": ForwardRef('RaiConfig', module='types') + kind: Literal[AgentKind.EXTERNAL] + otel_agent_id: str + rai_config: RaiConfig + + + class azure.ai.projects.types.FabricDataAgentToolParameters(TypedDict, total=False): + project_connections: list[ToolProjectConnection] + + + class azure.ai.projects.types.FabricIQPreviewTool(TypedDict, total=False): + key "project_connection_id": Required[str] + key "require_approval": Optional[Union[MCPToolRequireApproval, str]] + key "server_label": str + key "server_url": str + key "type": Required[Literal[ToolType.FABRIC_IQ_PREVIEW]] + project_connection_id: str + require_approval: Union[MCPToolRequireApproval, str] + server_label: str + server_url: str + type: Literal[ToolType.FABRIC_IQ_PREVIEW] + + + class azure.ai.projects.types.FabricIQPreviewToolboxTool(TypedDict, total=False): + key "description": str + key "name": str + key "project_connection_id": Required[str] + key "require_approval": Optional[Union[MCPToolRequireApproval, str]] + key "server_label": str + key "server_url": str + key "type": Required[Literal[ToolboxToolType.FABRIC_IQ_PREVIEW]] + description: str + name: str + project_connection_id: str + require_approval: Union[MCPToolRequireApproval, str] + server_label: str + server_url: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.FABRIC_IQ_PREVIEW] + + + class azure.ai.projects.types.FieldMapping(TypedDict, total=False): + key "contentFields": Required[list[str]] + key "filepathField": str + key "titleField": str + key "urlField": str + contentFields: list[str] + filepathField: str + metadataFields: list[str] + titleField: str + urlField: str + vectorFields: list[str] + + + class azure.ai.projects.types.FileDataGenerationJobOutput(TypedDict, total=False): + key "filename": Required[str] + key "id": Required[str] + key "type": Required[Literal[DataGenerationJobOutputType.FILE]] + filename: str + id: str + type: Literal[DataGenerationJobOutputType.FILE] + + + class azure.ai.projects.types.FileDataGenerationJobSource(TypedDict, total=False): + key "description": str + key "id": Required[str] + key "type": Required[Literal[DataGenerationJobSourceType.FILE]] + description: str + id: str + type: Literal[DataGenerationJobSourceType.FILE] + + + class azure.ai.projects.types.FileDatasetVersion(TypedDict, total=False): + key "connectionName": str + key "dataUri": Required[str] + key "description": str + key "id": str + key "isReference": bool + key "name": Required[str] + key "type": Required[Literal[DatasetType.URI_FILE]] + key "version": Required[str] + connectionName: str + dataUri: str + description: str + id: str + isReference: bool + name: str + tags: dict[str, str] + type: Literal[DatasetType.URI_FILE] + version: str + + + class azure.ai.projects.types.FileSearchTool(TypedDict, total=False): + key "description": str + key "filters": Optional[Filters] + key "max_num_results": int + key "name": str + key "ranking_options": ForwardRef('RankingOptions', module='types') + key "type": Required[Literal[ToolType.FILE_SEARCH]] + key "vector_store_ids": Required[list[str]] + description: str + filters: Filters + max_num_results: int + name: str + ranking_options: RankingOptions + tool_configs: dict[str, ToolConfig] + type: Literal[ToolType.FILE_SEARCH] + vector_store_ids: list[str] + + + class azure.ai.projects.types.FileSearchToolboxTool(TypedDict, total=False): + key "description": str + key "filters": Optional[Filters] + key "max_num_results": int + key "name": str + key "ranking_options": ForwardRef('RankingOptions', module='types') + key "type": Required[Literal[ToolboxToolType.FILE_SEARCH]] + description: str + filters: Filters + max_num_results: int + name: str + ranking_options: RankingOptions + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.FILE_SEARCH] + vector_store_ids: list[str] + + + class azure.ai.projects.types.FixedRatioVersionSelectionRule(TypedDict, total=False): + key "agent_version": Required[str] + key "traffic_percentage": Required[int] + key "type": Required[Literal[VersionSelectorType.FIXED_RATIO]] + agent_version: str + traffic_percentage: int + type: Literal[VersionSelectorType.FIXED_RATIO] + + + class azure.ai.projects.types.FolderDatasetVersion(TypedDict, total=False): + key "connectionName": str + key "dataUri": Required[str] + key "description": str + key "id": str + key "isReference": bool + key "name": Required[str] + key "type": Required[Literal[DatasetType.URI_FOLDER]] + key "version": Required[str] + connectionName: str + dataUri: str + description: str + id: str + isReference: bool + name: str + tags: dict[str, str] + type: Literal[DatasetType.URI_FOLDER] + version: str + + + class azure.ai.projects.types.FoundryModelWarning(TypedDict, total=False): + key "code": Union[str, FoundryModelWarningCode] + key "message": str + code: Union[str, FoundryModelWarningCode] + message: str + + + class azure.ai.projects.types.FunctionShellToolParam(TypedDict, total=False): + key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] + key "description": str + key "environment": Optional[FunctionShellToolParamEnvironment] + key "name": str + key "type": Required[Literal[ToolType.SHELL]] + allowed_callers: list[Union[str, CallableToolAllowedCaller]] + description: str + environment: FunctionShellToolParamEnvironment + name: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolType.SHELL] + + + class azure.ai.projects.types.FunctionShellToolParamEnvironmentContainerReferenceParam(TypedDict, total=False): + key "container_id": Required[str] + key "type": Required[Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE]] + container_id: str + type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE] + + + class azure.ai.projects.types.FunctionShellToolParamEnvironmentLocalEnvironmentParam(TypedDict, total=False): + key "type": Required[Literal[FunctionShellToolParamEnvironmentType.LOCAL]] + skills: list[LocalSkillParam] + type: Literal[FunctionShellToolParamEnvironmentType.LOCAL] + + + class azure.ai.projects.types.FunctionShellToolParamEnvironmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONTAINER_AUTO = "container_auto" + CONTAINER_REFERENCE = "container_reference" + LOCAL = "local" + + + class azure.ai.projects.types.FunctionTool(TypedDict, total=False): + key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] + key "defer_loading": bool + key "description": Optional[str] + key "name": Required[str] + key "output_schema": Optional[dict[str, Any]] + key "parameters": Required[Optional[dict[str, Any]]] + key "strict": Required[Optional[bool]] + key "type": Required[Literal[ToolType.FUNCTION]] + allowed_callers: list[Union[str, CallableToolAllowedCaller]] + defer_loading: bool + description: str + name: str + output_schema: dict[str, Any] + parameters: dict[str, Any] + strict: bool + type: Literal[ToolType.FUNCTION] + + + class azure.ai.projects.types.FunctionToolParam(TypedDict, total=False): + key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] + key "defer_loading": bool + key "description": Optional[str] + key "name": Required[str] + key "output_schema": Optional[dict[str, Any]] + key "parameters": Optional[EmptyModelParam] + key "strict": Optional[bool] + key "type": Required[Literal["function"]] + allowed_callers: list[Union[str, CallableToolAllowedCaller]] + defer_loading: bool + description: str + name: str + output_schema: dict[str, Any] + parameters: EmptyModelParam + strict: bool + type: Literal[function] + + + class azure.ai.projects.types.GenerateAgentRequest(TypedDict, total=False): + key "kind": Required[Union[str, AgentKind]] + kind: Union[str, AgentKind] + + + class azure.ai.projects.types.GitHubIssueRoutineTrigger(TypedDict, total=False): + key "connection_id": Required[str] + key "issue_event": Required[Union[str, GitHubIssueEvent]] + key "owner": Required[str] + key "repository": Required[str] + key "type": Required[Literal[RoutineTriggerType.GITHUB_ISSUE]] + connection_id: str + issue_event: Union[str, GitHubIssueEvent] + owner: str + repository: str + type: Literal[RoutineTriggerType.GITHUB_ISSUE] + + + class azure.ai.projects.types.HeaderTelemetryEndpointAuth(TypedDict, total=False): + key "header_name": Required[str] + key "secret_id": Required[str] + key "secret_key": Required[str] + key "type": Required[Literal[TelemetryEndpointAuthType.HEADER]] + header_name: str + secret_id: str + secret_key: str + type: Literal[TelemetryEndpointAuthType.HEADER] + + + class azure.ai.projects.types.HostedAgentDefinition(TypedDict, total=False): + key "code_configuration": ForwardRef('CodeConfiguration', module='types') + key "container_configuration": ForwardRef('ContainerConfiguration', module='types') + key "cpu": Required[str] + key "kind": Required[Literal[AgentKind.HOSTED]] + key "memory": Required[str] + key "rai_config": ForwardRef('RaiConfig', module='types') + key "telemetry_config": ForwardRef('TelemetryConfig', module='types') + code_configuration: CodeConfiguration + container_configuration: ContainerConfiguration + cpu: str + environment_variables: dict[str, str] + kind: Literal[AgentKind.HOSTED] + memory: str + protocol_versions: list[ProtocolVersionRecord] + rai_config: RaiConfig + telemetry_config: TelemetryConfig + + + class azure.ai.projects.types.HourlyRecurrenceSchedule(TypedDict, total=False): + key "type": Required[Literal[RecurrenceType.HOURLY]] + type: Literal[RecurrenceType.HOURLY] + + + class azure.ai.projects.types.HumanEvaluationPreviewRuleAction(TypedDict, total=False): + key "templateId": Required[str] + key "type": Required[Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW]] + templateId: str + type: Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW] + + + class azure.ai.projects.types.HybridSearchOptions(TypedDict, total=False): + key "embedding_weight": Required[float] + key "text_weight": Required[float] + embedding_weight: float + text_weight: float + + + class azure.ai.projects.types.ImageGenTool(TypedDict, total=False): + key "action": Union[str, ImageGenAction] + key "background": Literal["transparent", "opaque", "auto"] + key "description": str + key "input_fidelity": Optional[Union[str, InputFidelity]] + key "input_image_mask": ForwardRef('ImageGenToolInputImageMask', module='types') + key "model": Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], Literal["gpt-image-5"], str] + key "moderation": Literal["auto", "low"] + key "name": str + key "output_compression": int + key "output_format": Literal["png", "webp", "jpeg"] + key "partial_images": int + key "quality": Literal["low", "medium", "high", "auto"] + key "size": Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str] + key "type": Required[Literal[ToolType.IMAGE_GENERATION]] + action: Union[str, ImageGenAction] + background: Literal[transparent, opaque, auto] + description: str + input_fidelity: Union[str, InputFidelity] + input_image_mask: ImageGenToolInputImageMask + model: Union[Literal[gpt-image-1], Literal[gpt-image-1-mini], Literal[gpt-image-5], str] + moderation: Literal[auto, low] + name: str + output_compression: int + output_format: Literal[png, webp, jpeg] + partial_images: int + quality: Literal[low, medium, high, auto] + size: Union[Literal[1024x1024], Literal[1024x1536], Literal[1536x1024], Literal[auto], str] + tool_configs: dict[str, ToolConfig] + type: Literal[ToolType.IMAGE_GENERATION] + + + class azure.ai.projects.types.ImageGenToolInputImageMask(TypedDict, total=False): + key "file_id": str + key "image_url": str + file_id: str + image_url: str + + + class azure.ai.projects.types.IndexType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_SEARCH = "AzureSearch" + COSMOS_DB = "CosmosDBNoSqlVectorStore" + MANAGED_AZURE_SEARCH = "ManagedAzureSearch" + + + class azure.ai.projects.types.InlineSkillParam(TypedDict, total=False): + key "description": Required[str] + key "name": Required[str] + key "source": Required[InlineSkillSourceParam] + key "type": Required[Literal[ContainerSkillType.INLINE]] + description: str + name: str + source: InlineSkillSourceParam + type: Literal[ContainerSkillType.INLINE] + + + class azure.ai.projects.types.InlineSkillSourceParam(TypedDict, total=False): + key "data": Required[str] + key "media_type": Required[Literal["application/zip"]] + key "type": Required[Literal["base64"]] + data: str + media_type: Literal[application/zip] + type: Literal[base64] + + + class azure.ai.projects.types.Insight(TypedDict, total=False): + key "displayName": Required[str] + key "id": Required[str] + key "metadata": Required[InsightsMetadata] + key "request": Required[InsightRequest] + key "result": ForwardRef('InsightResult', module='types') + key "state": Required[Union[str, OperationState]] + displayName: str + id: str + metadata: InsightsMetadata + request: InsightRequest + result: InsightResult + state: Union[str, OperationState] + + + class azure.ai.projects.types.InsightCluster(TypedDict, total=False): + key "description": Required[str] + key "id": Required[str] + key "label": Required[str] + key "suggestion": Required[str] + key "suggestionTitle": Required[str] + key "weight": Required[int] + description: str + id: str + label: str + samples: list[InsightSample] + subClusters: list[InsightCluster] + suggestion: str + suggestionTitle: str + weight: int + + + class azure.ai.projects.types.InsightModelConfiguration(TypedDict, total=False): + key "modelDeploymentName": Required[str] + modelDeploymentName: str + + + class azure.ai.projects.types.InsightSample(TypedDict, total=False): + key "correlationInfo": Required[dict[str, Any]] + key "evaluationResult": Required[EvalResult] + key "features": Required[dict[str, Any]] + key "id": Required[str] + key "type": Required[Literal[SampleType.EVALUATION_RESULT_SAMPLE]] + correlationInfo: dict[str, Any] + evaluationResult: EvalResult + features: dict[str, Any] + id: str + type: Literal[SampleType.EVALUATION_RESULT_SAMPLE] + + + class azure.ai.projects.types.InsightScheduleTask(TypedDict, total=False): + key "insight": Required[Insight] + key "type": Required[Literal[ScheduleTaskType.INSIGHT]] + configuration: dict[str, str] + insight: Insight + type: Literal[ScheduleTaskType.INSIGHT] + + + class azure.ai.projects.types.InsightSummary(TypedDict, total=False): + key "method": Required[str] + key "sampleCount": Required[int] + key "uniqueClusterCount": Required[int] + key "uniqueSubclusterCount": Required[int] + key "usage": Required[ClusterTokenUsage] + method: str + sampleCount: int + uniqueClusterCount: int + uniqueSubclusterCount: int + usage: ClusterTokenUsage + + + class azure.ai.projects.types.InsightType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT_CLUSTER_INSIGHT = "AgentClusterInsight" + EVALUATION_COMPARISON = "EvaluationComparison" + EVALUATION_RUN_CLUSTER_INSIGHT = "EvaluationRunClusterInsight" + + + class azure.ai.projects.types.InsightsMetadata(TypedDict, total=False): + key "completedAt": str + key "createdAt": Required[str] + completedAt: str + createdAt: str + + + class azure.ai.projects.types.InvocationsProtocolConfiguration(TypedDict, total=False): + + + class azure.ai.projects.types.InvocationsWsProtocolConfiguration(TypedDict, total=False): + + + class azure.ai.projects.types.InvokeAgentInvocationsApiDispatchPayload(TypedDict, total=False): + key "input": Required[Any] + key "type": Required[Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API]] + input: Any + type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API] + + + class azure.ai.projects.types.InvokeAgentInvocationsApiRoutineAction(TypedDict, total=False): + key "agent_endpoint_id": str + key "agent_name": str + key "input": Any + key "session_id": str + key "type": Required[Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API]] + agent_endpoint_id: str + agent_name: str + input: Any + session_id: str + type: Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API] + + + class azure.ai.projects.types.InvokeAgentResponsesApiDispatchPayload(TypedDict, total=False): + key "input": Required[Any] + key "type": Required[Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API]] + input: Any + type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API] + + + class azure.ai.projects.types.InvokeAgentResponsesApiRoutineAction(TypedDict, total=False): + key "agent_endpoint_id": str + key "agent_name": str + key "conversation": str + key "input": Any + key "type": Required[Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API]] + agent_endpoint_id: str + agent_name: str + conversation: str + input: Any + type: Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API] + + + class azure.ai.projects.types.ListMemoriesRequest(TypedDict, total=False): + key "scope": Required[str] + scope: str + + + class azure.ai.projects.types.LlmGeneratedVoiceGreetingConfig(TypedDict, total=False): + key "prompt": Required[str] + key "tool_choice": ForwardRef('VoiceAgentToolChoice', module='types') + key "type": Required[Literal["llm_generated"]] + prompt: str + tool_choice: VoiceAgentToolChoice + type: Literal[llm_generated] + + + class azure.ai.projects.types.LocalShellToolParam(TypedDict, total=False): + key "description": str + key "name": str + key "type": Required[Literal[ToolType.LOCAL_SHELL]] + description: str + name: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolType.LOCAL_SHELL] + + + class azure.ai.projects.types.LocalSkillParam(TypedDict, total=False): + key "description": Required[str] + key "name": Required[str] + key "path": Required[str] + description: str + name: str + path: str + + + class azure.ai.projects.types.LogProbProperties(TypedDict, total=False): + key "bytes": Required[list[int]] + key "logprob": Required[float] + key "token": Required[str] + bytes: list[int] + logprob: float + token: str + + + class azure.ai.projects.types.LoraConfig(TypedDict, total=False): + key "alpha": int + key "dropout": float + key "rank": int + alpha: int + dropout: float + rank: int + targetModules: list[str] + + + class azure.ai.projects.types.MCPListToolsTool(TypedDict, total=False): + key "annotations": Optional[MCPListToolsToolAnnotations] + key "description": Optional[str] + key "input_schema": Required[MCPListToolsToolInputSchema] + key "name": Required[str] + annotations: MCPListToolsToolAnnotations + description: str + input_schema: MCPListToolsToolInputSchema + name: str + + + class azure.ai.projects.types.MCPListToolsToolAnnotations(TypedDict, total=False): + + + class azure.ai.projects.types.MCPListToolsToolInputSchema(TypedDict, total=False): + + + class azure.ai.projects.types.MCPTool(TypedDict, total=False): + key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] + key "allowed_tools": Optional[Union[list[str], MCPToolFilter]] + key "authorization": str + key "connector_id": Literal["connector_dropbox", "connector_gmail", "connector_googlecalendar", "connector_googledrive", "connector_microsoftteams", "connector_outlookcalendar", "connector_outlookemail", "connector_sharepoint"] + key "defer_loading": bool + key "headers": Optional[dict[str, str]] + key "project_connection_id": str + key "require_approval": Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] + key "server_description": str + key "server_label": Required[str] + key "server_url": str + key "tunnel_id": str + key "type": Required[Literal[ToolType.MCP]] + allowed_callers: list[Union[str, CallableToolAllowedCaller]] + allowed_tools: Union[list[str], MCPToolFilter] + authorization: str + connector_id: Literal[connector_dropbox, connector_gmail, connector_googlecalendar, connector_googledrive, connector_microsoftteams, + defer_loading: bool + headers: dict[str, str] + project_connection_id: str + require_approval: Union[MCPToolRequireApproval, Literal[always], Literal[never]] + server_description: str + server_label: str + server_url: str + tool_configs: dict[str, ToolConfig] + tunnel_id: str + type: Literal[ToolType.MCP] + + + class azure.ai.projects.types.MCPToolFilter(TypedDict, total=False): + key "read_only": bool + read_only: bool + tool_names: list[str] + + + class azure.ai.projects.types.MCPToolRequireApproval(TypedDict, total=False): + key "always": ForwardRef('MCPToolFilter', module='types') + key "never": ForwardRef('MCPToolFilter', module='types') + always: MCPToolFilter + never: MCPToolFilter + + + class azure.ai.projects.types.MCPToolboxTool(TypedDict, total=False): + key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] + key "allowed_tools": Optional[Union[list[str], MCPToolFilter]] + key "authorization": str + key "connector_id": Literal["connector_dropbox", "connector_gmail", "connector_googlecalendar", "connector_googledrive", "connector_microsoftteams", "connector_outlookcalendar", "connector_outlookemail", "connector_sharepoint"] + key "defer_loading": bool + key "description": str + key "headers": Optional[dict[str, str]] + key "name": str + key "project_connection_id": str + key "require_approval": Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] + key "server_description": str + key "server_label": Required[str] + key "server_url": str + key "tunnel_id": str + key "type": Required[Literal[ToolboxToolType.MCP]] + allowed_callers: list[Union[str, CallableToolAllowedCaller]] + allowed_tools: Union[list[str], MCPToolFilter] + authorization: str + connector_id: Literal[connector_dropbox, connector_gmail, connector_googlecalendar, connector_googledrive, connector_microsoftteams, + defer_loading: bool + description: str + headers: dict[str, str] + name: str + project_connection_id: str + require_approval: Union[MCPToolRequireApproval, Literal[always], Literal[never]] + server_description: str + server_label: str + server_url: str + tool_configs: dict[str, ToolConfig] + tunnel_id: str + type: Literal[ToolboxToolType.MCP] + + + class azure.ai.projects.types.ManagedAgentIdentityBlueprintReference(TypedDict, total=False): + key "blueprint_id": Required[str] + key "type": Required[Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT]] + blueprint_id: str + type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] + + + class azure.ai.projects.types.ManagedAzureAISearchIndex(TypedDict, total=False): + key "description": str + key "id": str + key "name": Required[str] + key "type": Required[Literal[IndexType.MANAGED_AZURE_SEARCH]] + key "vectorStoreId": Required[str] + key "version": Required[str] + description: str + id: str + name: str + tags: dict[str, str] + type: Literal[IndexType.MANAGED_AZURE_SEARCH] + vectorStoreId: str + version: str + + + class azure.ai.projects.types.McpProtocolConfiguration(TypedDict, total=False): + + + class azure.ai.projects.types.MemorySearchOptions(TypedDict, total=False): + key "max_memories": int + max_memories: int + + + class azure.ai.projects.types.MemorySearchPreviewTool(TypedDict, total=False): + key "memory_store_name": Required[str] + key "scope": Required[str] + key "search_options": ForwardRef('MemorySearchOptions', module='types') + key "type": Required[Literal[ToolType.MEMORY_SEARCH_PREVIEW]] + key "update_delay": int + memory_store_name: str + scope: str + search_options: MemorySearchOptions + type: Literal[ToolType.MEMORY_SEARCH_PREVIEW] + update_delay: int + + + class azure.ai.projects.types.MemoryStoreDefaultDefinition(TypedDict, total=False): + key "chat_model": Required[str] + key "embedding_model": Required[str] + key "kind": Required[Literal[MemoryStoreKind.DEFAULT]] + key "options": ForwardRef('MemoryStoreDefaultOptions', module='types') + chat_model: str + embedding_model: str + kind: Literal[MemoryStoreKind.DEFAULT] + options: MemoryStoreDefaultOptions + + + class azure.ai.projects.types.MemoryStoreDefaultOptions(TypedDict, total=False): + key "chat_summary_enabled": Required[bool] + key "default_ttl_seconds": str + key "procedural_memory_enabled": bool + key "user_profile_details": str + key "user_profile_enabled": Required[bool] + chat_summary_enabled: bool + default_ttl_seconds: str + procedural_memory_enabled: bool + user_profile_details: str + user_profile_enabled: bool + + + class azure.ai.projects.types.MemoryStoreDefinition(TypedDict, total=False): + key "chat_model": Required[str] + key "embedding_model": Required[str] + key "kind": Required[Literal[MemoryStoreKind.DEFAULT]] + key "options": ForwardRef('MemoryStoreDefaultOptions', module='types') + chat_model: str + embedding_model: str + kind: Literal[MemoryStoreKind.DEFAULT] + options: MemoryStoreDefaultOptions + + + class azure.ai.projects.types.MemoryStoreKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DEFAULT = "default" + + + class azure.ai.projects.types.Metadata(TypedDict, total=False): + + + class azure.ai.projects.types.MicrosoftFabricPreviewTool(TypedDict, total=False): + key "fabric_dataagent_preview": Required[FabricDataAgentToolParameters] + key "type": Required[Literal[ToolType.FABRIC_DATAAGENT_PREVIEW]] + fabric_dataagent_preview: FabricDataAgentToolParameters + type: Literal[ToolType.FABRIC_DATAAGENT_PREVIEW] + + + class azure.ai.projects.types.ModelCredentialRequest(TypedDict, total=False): + key "blobUri": Required[str] + blobUri: str + + + class azure.ai.projects.types.ModelPendingUploadRequest(TypedDict, total=False): + key "connectionName": str + key "pendingUploadId": str + key "pendingUploadType": Required[Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE]] + connectionName: str + pendingUploadId: str + pendingUploadType: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] + + + class azure.ai.projects.types.ModelSamplingParams(TypedDict, total=False): + key "max_completion_tokens": int + key "seed": int + key "temperature": float + key "top_p": float + max_completion_tokens: int + seed: int + temperature: float + top_p: float + + + class azure.ai.projects.types.ModelSourceData(TypedDict, total=False): + key "jobId": str + key "sourceType": Union[str, FoundryModelSourceType] + jobId: str + sourceType: Union[str, FoundryModelSourceType] + + + class azure.ai.projects.types.ModelVersion(TypedDict, total=False): + key "artifactProfile": ForwardRef('ArtifactProfile', module='types') + key "baseModel": str + key "blobUri": Required[str] + key "description": str + key "id": str + key "loraConfig": ForwardRef('LoraConfig', module='types') + key "name": Required[str] + key "source": ForwardRef('ModelSourceData', module='types') + key "version": Required[str] + key "weightType": Union[str, FoundryModelWeightType] + artifactProfile: ArtifactProfile + baseModel: str + blobUri: str + description: str + id: str + loraConfig: LoraConfig + name: str + source: ModelSourceData + tags: dict[str, str] + version: str + warnings: list[FoundryModelWarning] + weightType: Union[str, FoundryModelWeightType] + + + class azure.ai.projects.types.MonthlyRecurrenceSchedule(TypedDict, total=False): + key "daysOfMonth": Required[list[int]] + key "type": Required[Literal[RecurrenceType.MONTHLY]] + daysOfMonth: list[int] + type: Literal[RecurrenceType.MONTHLY] + + + class azure.ai.projects.types.NamespaceToolParam(TypedDict, total=False): + key "description": Required[str] + key "name": Required[str] + key "tools": Required[list[Union[FunctionToolParam, CustomToolParam]]] + key "type": Required[Literal[ToolType.NAMESPACE]] + description: str + name: str + tools: list[Union[FunctionToolParam, CustomToolParam]] + type: Literal[ToolType.NAMESPACE] + + + class azure.ai.projects.types.OmitPropertiesRealtimeResponse1(TypedDict, total=False): + key "conversation_id": str + key "id": str + key "max_output_tokens": Union[int, Literal["inf"]] + key "metadata": Optional[Metadata] + key "object": Literal["response"] + key "status": Literal["completed", "cancelled", "failed", "incomplete", "in_progress"] + key "status_details": ForwardRef('RealtimeResponseStatusDetails', module='types') + key "usage": ForwardRef('RealtimeResponseUsage', module='types') + conversation_id: str + id: str + max_output_tokens: Union[int, Literal[inf]] + metadata: Metadata + object: Literal[response] + output_modalities: list[Literal["text", "audio"]] + status: Literal[completed, cancelled, failed, incomplete, in_progress] + status_details: RealtimeResponseStatusDetails + usage: RealtimeResponseUsage + + + class azure.ai.projects.types.OneTimeTrigger(TypedDict, total=False): + key "timeZone": str + key "triggerAt": Required[str] + key "type": Required[Literal[TriggerType.ONE_TIME]] + timeZone: str + triggerAt: str + type: Literal[TriggerType.ONE_TIME] + + + class azure.ai.projects.types.OpenApiAnonymousAuthDetails(TypedDict, total=False): + key "type": Required[Literal[OpenApiAuthType.ANONYMOUS]] + type: Literal[OpenApiAuthType.ANONYMOUS] + + + class azure.ai.projects.types.OpenApiAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ANONYMOUS = "anonymous" + MANAGED_IDENTITY = "managed_identity" + PROJECT_CONNECTION = "project_connection" + + + class azure.ai.projects.types.OpenApiFunctionDefinition(TypedDict, total=False): + key "auth": Required[OpenApiAuthDetails] + key "description": str + key "name": Required[str] + key "spec": Required[dict[str, Any]] + auth: OpenApiAuthDetails + default_params: list[str] + description: str + functions: list[OpenApiFunctionDefinitionFunction] + name: str + spec: dict[str, Any] + + + class azure.ai.projects.types.OpenApiFunctionDefinitionFunction(TypedDict, total=False): + key "description": str + key "name": Required[str] + key "parameters": Required[dict[str, Any]] + description: str + name: str + parameters: dict[str, Any] + + + class azure.ai.projects.types.OpenApiManagedAuthDetails(TypedDict, total=False): + key "security_scheme": Required[OpenApiManagedSecurityScheme] + key "type": Required[Literal[OpenApiAuthType.MANAGED_IDENTITY]] + security_scheme: OpenApiManagedSecurityScheme + type: Literal[OpenApiAuthType.MANAGED_IDENTITY] + + + class azure.ai.projects.types.OpenApiManagedSecurityScheme(TypedDict, total=False): + key "audience": Required[str] + audience: str + + + class azure.ai.projects.types.OpenApiProjectConnectionAuthDetails(TypedDict, total=False): + key "security_scheme": Required[OpenApiProjectConnectionSecurityScheme] + key "type": Required[Literal[OpenApiAuthType.PROJECT_CONNECTION]] + security_scheme: OpenApiProjectConnectionSecurityScheme + type: Literal[OpenApiAuthType.PROJECT_CONNECTION] + + + class azure.ai.projects.types.OpenApiProjectConnectionSecurityScheme(TypedDict, total=False): + key "project_connection_id": Required[str] + project_connection_id: str + + + class azure.ai.projects.types.OpenApiTool(TypedDict, total=False): + key "openapi": Required[OpenApiFunctionDefinition] + key "type": Required[Literal[ToolType.OPENAPI]] + openapi: OpenApiFunctionDefinition + tool_configs: dict[str, ToolConfig] + type: Literal[ToolType.OPENAPI] + + + class azure.ai.projects.types.OpenApiToolboxTool(TypedDict, total=False): + key "description": str + key "name": str + key "openapi": Required[OpenApiFunctionDefinition] + key "type": Required[Literal[ToolboxToolType.OPENAPI]] + description: str + name: str + openapi: OpenApiFunctionDefinition + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.OPENAPI] + + + class azure.ai.projects.types.OptimizedAgentIdentifier(TypedDict, total=False): + key "agent_name": Required[str] + key "agent_version": str + agent_name: str + agent_version: str + + + class azure.ai.projects.types.OtlpTelemetryEndpoint(TypedDict, total=False): + key "auth": ForwardRef('TelemetryEndpointAuth', module='types') + key "data": Required[list[Union[str, TelemetryDataKind]]] + key "endpoint": Required[str] + key "kind": Required[Literal[TelemetryEndpointKind.OTLP]] + key "protocol": Required[Union[str, TelemetryTransportProtocol]] + auth: TelemetryEndpointAuth + data: list[Union[str, TelemetryDataKind]] + endpoint: str + kind: Literal[TelemetryEndpointKind.OTLP] + protocol: Union[str, TelemetryTransportProtocol] + + + class azure.ai.projects.types.PatchAgentObjectRequest(TypedDict, total=False): + key "agent_card": ForwardRef('AgentCard', module='types') + key "agent_endpoint": ForwardRef('AgentEndpointConfig', module='types') + agent_card: AgentCard + agent_endpoint: AgentEndpointConfig + + + class azure.ai.projects.types.PendingUploadRequest(TypedDict, total=False): + key "connectionName": str + key "pendingUploadId": str + key "pendingUploadType": Required[Literal[PendingUploadType.BLOB_REFERENCE]] + connectionName: str + pendingUploadId: str + pendingUploadType: Literal[PendingUploadType.BLOB_REFERENCE] + + + class azure.ai.projects.types.PendingUploadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BLOB_REFERENCE = "BlobReference" + NONE = "None" + TEMPORARY_BLOB_REFERENCE = "TemporaryBlobReference" + + + class azure.ai.projects.types.PickPropertiesVoiceAudioConfig(TypedDict, total=False): + key "output": ForwardRef('VoiceAudioOutputConfig', module='types') + output: VoiceAudioOutputConfig + + + class azure.ai.projects.types.ProgrammaticToolCallingParam(TypedDict, total=False): + key "type": Required[Literal[ToolType.PROGRAMMATIC_TOOL_CALLING]] + type: Literal[ToolType.PROGRAMMATIC_TOOL_CALLING] + + + class azure.ai.projects.types.PromotionInfo(TypedDict, total=False): + key "agent_name": Required[str] + key "agent_version": Required[str] + key "promoted_at": Required[int] + agent_name: str + agent_version: str + promoted_at: int + + + class azure.ai.projects.types.PromptAgentDefinition(TypedDict, total=False): + key "instructions": Optional[str] + key "kind": Required[Literal[AgentKind.PROMPT]] + key "model": Required[str] + key "rai_config": ForwardRef('RaiConfig', module='types') + key "reasoning": Optional[Reasoning] + key "temperature": Optional[float] + key "text": ForwardRef('PromptAgentDefinitionTextOptions', module='types') + key "tool_choice": Union[str, ToolChoiceParam] + key "top_p": Optional[float] + instructions: str + kind: Literal[AgentKind.PROMPT] + model: str + rai_config: RaiConfig + reasoning: Reasoning + structured_inputs: dict[str, StructuredInputDefinition] + temperature: float + text: PromptAgentDefinitionTextOptions + tool_choice: Union[str, ToolChoiceParam] + tools: list[Tool] + top_p: float + + + class azure.ai.projects.types.PromptAgentDefinitionTextOptions(TypedDict, total=False): + key "format": ForwardRef('TextResponseFormat', module='types') + format: TextResponseFormat + + + class azure.ai.projects.types.PromptBasedEvaluatorDefinition(TypedDict, total=False): + key "prompt_text": Required[str] + key "type": Required[Literal[EvaluatorDefinitionType.PROMPT]] + data_schema: dict[str, Any] + init_parameters: dict[str, Any] + metrics: dict[str, EvaluatorMetric] + prompt_text: str + type: Literal[EvaluatorDefinitionType.PROMPT] + + + class azure.ai.projects.types.PromptDataGenerationJobSource(TypedDict, total=False): + key "description": str + key "prompt": Required[str] + key "type": Required[Literal[DataGenerationJobSourceType.PROMPT]] + description: str + prompt: str + type: Literal[DataGenerationJobSourceType.PROMPT] + + + class azure.ai.projects.types.PromptEvaluatorGenerationJobSource(TypedDict, total=False): + key "description": str + key "prompt": Required[str] + key "type": Required[Literal[EvaluatorGenerationJobSourceType.PROMPT]] + description: str + prompt: str + type: Literal[EvaluatorGenerationJobSourceType.PROMPT] + + + class azure.ai.projects.types.ProtocolConfiguration(TypedDict, total=False): + key "a2a": ForwardRef('A2AProtocolConfiguration', module='types') + key "activity": ForwardRef('ActivityProtocolConfiguration', module='types') + key "invocations": ForwardRef('InvocationsProtocolConfiguration', module='types') + key "invocations_ws": ForwardRef('InvocationsWsProtocolConfiguration', module='types') + key "mcp": ForwardRef('McpProtocolConfiguration', module='types') + key "responses": ForwardRef('ResponsesProtocolConfiguration', module='types') + a2a: A2AProtocolConfiguration + activity: ActivityProtocolConfiguration + invocations: InvocationsProtocolConfiguration + invocations_ws: InvocationsWsProtocolConfiguration + mcp: McpProtocolConfiguration + responses: ResponsesProtocolConfiguration + + + class azure.ai.projects.types.ProtocolVersionRecord(TypedDict, total=False): + key "protocol": Required[Union[str, AgentEndpointProtocol]] + key "version": Required[str] + protocol: Union[str, AgentEndpointProtocol] + version: str + + + class azure.ai.projects.types.RaiConfig(TypedDict, total=False): + key "rai_policy_name": Required[str] + rai_policy_name: str + + + class azure.ai.projects.types.RankingOptions(TypedDict, total=False): + key "hybrid_search": ForwardRef('HybridSearchOptions', module='types') + key "ranker": Union[str, RankerVersionType] + key "score_threshold": float + hybrid_search: HybridSearchOptions + ranker: Union[str, RankerVersionType] + score_threshold: float + + + class azure.ai.projects.types.RealtimeAudioFormatsAudioPcm(TypedDict, total=False): + key "rate": Literal[24000] + key "type": Required[Literal[RealtimeAudioFormatsType.AUDIO_PCM]] + rate: Literal[24000] + type: Literal[RealtimeAudioFormatsType.AUDIO_PCM] + + + class azure.ai.projects.types.RealtimeAudioFormatsAudioPcma(TypedDict, total=False): + key "type": Required[Literal[RealtimeAudioFormatsType.AUDIO_PCMA]] + type: Literal[RealtimeAudioFormatsType.AUDIO_PCMA] + + + class azure.ai.projects.types.RealtimeAudioFormatsAudioPcmu(TypedDict, total=False): + key "type": Required[Literal[RealtimeAudioFormatsType.AUDIO_PCMU]] + type: Literal[RealtimeAudioFormatsType.AUDIO_PCMU] + + + class azure.ai.projects.types.RealtimeAudioFormatsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUDIO_PCM = "audio/pcm" + AUDIO_PCMA = "audio/pcma" + AUDIO_PCMU = "audio/pcmu" + + + class azure.ai.projects.types.RealtimeClientEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONVERSATION_ITEM_CREATE = "conversation.item.create" + CONVERSATION_ITEM_DELETE = "conversation.item.delete" + CONVERSATION_ITEM_RETRIEVE = "conversation.item.retrieve" + CONVERSATION_ITEM_TRUNCATE = "conversation.item.truncate" + INPUT_AUDIO_BUFFER_APPEND = "input_audio_buffer.append" + INPUT_AUDIO_BUFFER_CLEAR = "input_audio_buffer.clear" + INPUT_AUDIO_BUFFER_COMMIT = "input_audio_buffer.commit" + OUTPUT_AUDIO_BUFFER_CLEAR = "output_audio_buffer.clear" + RESPONSE_CANCEL = "response.cancel" + RESPONSE_CREATE = "response.create" + SESSION_UPDATE = "session.update" + + + class azure.ai.projects.types.RealtimeConversationItemFunctionCall(TypedDict, total=False): + key "arguments": Required[str] + key "call_id": str + key "id": str + key "name": Required[str] + key "object": Literal["item"] + key "status": Literal["completed", "incomplete", "in_progress"] + key "type": Required[Literal[RealtimeConversationItemType.FUNCTION_CALL]] + arguments: str + call_id: str + id: str + name: str + object: Literal[item] + status: Literal[completed, incomplete, in_progress] + type: Literal[RealtimeConversationItemType.FUNCTION_CALL] + + + class azure.ai.projects.types.RealtimeConversationItemFunctionCallOutput(TypedDict, total=False): + key "call_id": Required[str] + key "id": str + key "object": Literal["item"] + key "output": Required[str] + key "status": Literal["completed", "incomplete", "in_progress"] + key "type": Required[Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT]] + call_id: str + id: str + object: Literal[item] + output: str + status: Literal[completed, incomplete, in_progress] + type: Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT] + + + class azure.ai.projects.types.RealtimeConversationItemMessageAssistant(TypedDict, total=False): + key "content": Required[list[RealtimeConversationItemMessageAssistantContent]] + key "id": str + key "object": Literal["item"] + key "role": Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] + key "status": Literal["completed", "incomplete", "in_progress"] + key "type": Required[Literal["message"]] + content: list[RealtimeConversationItemMessageAssistantContent] + id: str + object: Literal[item] + role: Literal[RealtimeConversationItemMessageType.ASSISTANT] + status: Literal[completed, incomplete, in_progress] + type: Literal[message] + + + class azure.ai.projects.types.RealtimeConversationItemMessageAssistantContent(TypedDict, total=False): + key "audio": str + key "text": str + key "transcript": str + key "type": Literal["output_text", "output_audio"] + audio: str + text: str + transcript: str + type: Literal[output_text, output_audio] + + + class azure.ai.projects.types.RealtimeConversationItemMessageSystem(TypedDict, total=False): + key "content": Required[list[RealtimeConversationItemMessageSystemContent]] + key "id": str + key "object": Literal["item"] + key "role": Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] + key "status": Literal["completed", "incomplete", "in_progress"] + key "type": Required[Literal["message"]] + content: list[RealtimeConversationItemMessageSystemContent] + id: str + object: Literal[item] + role: Literal[RealtimeConversationItemMessageType.SYSTEM] + status: Literal[completed, incomplete, in_progress] + type: Literal[message] + + + class azure.ai.projects.types.RealtimeConversationItemMessageSystemContent(TypedDict, total=False): + key "text": str + key "type": Literal["input_text"] + text: str + type: Literal[input_text] + + + class azure.ai.projects.types.RealtimeConversationItemMessageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ASSISTANT = "assistant" + SYSTEM = "system" + USER = "user" + + + class azure.ai.projects.types.RealtimeConversationItemMessageUser(TypedDict, total=False): + key "content": Required[list[RealtimeConversationItemMessageUserContent]] + key "id": str + key "object": Literal["item"] + key "role": Required[Literal[RealtimeConversationItemMessageType.USER]] + key "status": Literal["completed", "incomplete", "in_progress"] + key "type": Required[Literal["message"]] + content: list[RealtimeConversationItemMessageUserContent] + id: str + object: Literal[item] + role: Literal[RealtimeConversationItemMessageType.USER] + status: Literal[completed, incomplete, in_progress] + type: Literal[message] + + + class azure.ai.projects.types.RealtimeConversationItemMessageUserContent(TypedDict, total=False): + key "audio": str + key "detail": Literal["auto", "low", "high"] + key "image_url": str + key "text": str + key "transcript": str + key "type": Literal["input_text", "input_audio", "input_image"] + audio: str + detail: Literal[auto, low, high] + image_url: str + text: str + transcript: str + type: Literal[input_text, input_audio, input_image] + + + class azure.ai.projects.types.RealtimeConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FUNCTION_CALL = "function_call" + FUNCTION_CALL_OUTPUT = "function_call_output" + MCP_APPROVAL_REQUEST = "mcp_approval_request" + MCP_APPROVAL_RESPONSE = "mcp_approval_response" + MCP_CALL = "mcp_call" + MCP_LIST_TOOLS = "mcp_list_tools" + + + class azure.ai.projects.types.RealtimeFunctionTool(TypedDict, total=False): + key "description": str + key "name": str + key "parameters": ForwardRef('RealtimeFunctionToolParameters', module='types') + key "type": Literal["function"] + description: str + name: str + parameters: RealtimeFunctionToolParameters + type: Literal[function] + + + class azure.ai.projects.types.RealtimeFunctionToolParameters(TypedDict, total=False): + + + class azure.ai.projects.types.RealtimeMCPApprovalRequest(TypedDict, total=False): + key "arguments": Required[str] + key "id": Required[str] + key "name": Required[str] + key "server_label": Required[str] + key "type": Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST]] + arguments: str + id: str + name: str + server_label: str + type: Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST] + + + class azure.ai.projects.types.RealtimeMCPApprovalResponse(TypedDict, total=False): + key "approval_request_id": Required[str] + key "approve": Required[bool] + key "id": Required[str] + key "reason": Optional[str] + key "type": Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE]] + approval_request_id: str + approve: bool + id: str + reason: str + type: Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE] + + + class azure.ai.projects.types.RealtimeMCPHTTPError(TypedDict, total=False): + key "code": Required[int] + key "message": Required[str] + key "type": Required[Literal[RealtimeMcpErrorType.HTTP_ERROR]] + code: int + message: str + type: Literal[RealtimeMcpErrorType.HTTP_ERROR] + + + class azure.ai.projects.types.RealtimeMCPListTools(TypedDict, total=False): + key "id": str + key "server_label": Required[str] + key "tools": Required[list[MCPListToolsTool]] + key "type": Required[Literal[RealtimeConversationItemType.MCP_LIST_TOOLS]] + id: str + server_label: str + tools: list[MCPListToolsTool] + type: Literal[RealtimeConversationItemType.MCP_LIST_TOOLS] + + + class azure.ai.projects.types.RealtimeMCPProtocolError(TypedDict, total=False): + key "code": Required[int] + key "message": Required[str] + key "type": Required[Literal[RealtimeMcpErrorType.PROTOCOL_ERROR]] + code: int + message: str + type: Literal[RealtimeMcpErrorType.PROTOCOL_ERROR] + + + class azure.ai.projects.types.RealtimeMCPToolCall(TypedDict, total=False): + key "approval_request_id": Optional[str] + key "arguments": Required[str] + key "error": ForwardRef('RealtimeMCPError', module='types') + key "id": Required[str] + key "name": Required[str] + key "output": Optional[str] + key "server_label": Required[str] + key "type": Required[Literal[RealtimeConversationItemType.MCP_CALL]] + approval_request_id: str + arguments: str + error: RealtimeMCPError + id: str + name: str + output: str + server_label: str + type: Literal[RealtimeConversationItemType.MCP_CALL] + + + class azure.ai.projects.types.RealtimeMCPToolExecutionError(TypedDict, total=False): + key "message": Required[str] + key "type": Required[Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR]] + message: str + type: Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR] + + + class azure.ai.projects.types.RealtimeMcpErrorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HTTP_ERROR = "http_error" + PROTOCOL_ERROR = "protocol_error" + TOOL_EXECUTION_ERROR = "tool_execution_error" + + + class azure.ai.projects.types.RealtimeReasoning(TypedDict, total=False): + key "effort": Union[str, RealtimeReasoningEffort] + effort: Union[str, RealtimeReasoningEffort] + + + class azure.ai.projects.types.RealtimeResponseStatusDetails(TypedDict, total=False): + key "error": ForwardRef('RealtimeResponseStatusDetailsError', module='types') + key "reason": Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"] + key "type": Literal["completed", "cancelled", "failed", "incomplete"] + error: RealtimeResponseStatusDetailsError + reason: Literal[turn_detected, client_cancelled, max_output_tokens, content_filter] + type: Literal[completed, cancelled, failed, incomplete] + + + class azure.ai.projects.types.RealtimeResponseStatusDetailsError(TypedDict, total=False): + key "code": str + key "type": str + code: str + type: str + + + class azure.ai.projects.types.RealtimeResponseUsage(TypedDict, total=False): + key "input_token_details": ForwardRef('RealtimeResponseUsageInputTokenDetails', module='types') + key "input_tokens": int + key "output_token_details": ForwardRef('RealtimeResponseUsageOutputTokenDetails', module='types') + key "output_tokens": int + key "total_tokens": int + input_token_details: RealtimeResponseUsageInputTokenDetails + input_tokens: int + output_token_details: RealtimeResponseUsageOutputTokenDetails + output_tokens: int + total_tokens: int + + + class azure.ai.projects.types.RealtimeResponseUsageInputTokenDetails(TypedDict, total=False): + key "audio_tokens": int + key "cached_tokens": int + key "cached_tokens_details": ForwardRef('RealtimeResponseUsageInputTokenDetailsCachedTokensDetails', module='types') + key "image_tokens": int + key "text_tokens": int + audio_tokens: int + cached_tokens: int + cached_tokens_details: RealtimeResponseUsageInputTokenDetailsCachedTokensDetails + image_tokens: int + text_tokens: int + + + class azure.ai.projects.types.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails(TypedDict, total=False): + key "audio_tokens": int + key "image_tokens": int + key "text_tokens": int + audio_tokens: int + image_tokens: int + text_tokens: int + + + class azure.ai.projects.types.RealtimeResponseUsageOutputTokenDetails(TypedDict, total=False): + key "audio_tokens": int + key "text_tokens": int + audio_tokens: int + text_tokens: int + + + class azure.ai.projects.types.RealtimeServerEvent(TypedDict, total=False): + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "part": Required[RealtimeServerEventResponseContentPartAddedPart] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED]] + content_index: int + event_id: str + item_id: str + output_index: int + part: RealtimeServerEventResponseContentPartAddedPart + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED] + + + class azure.ai.projects.types.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError(TypedDict, total=False): + key "code": str + key "message": str + key "param": str + key "type": str + code: str + message: str + param: str + type: str + + + class azure.ai.projects.types.RealtimeServerEventError(TypedDict, total=False): + key "error": Required[RealtimeServerEventErrorError] + key "event_id": Required[str] + key "type": Required[Literal["error"]] + error: RealtimeServerEventErrorError + event_id: str + type: Literal[error] + + + class azure.ai.projects.types.RealtimeServerEventErrorError(TypedDict, total=False): + key "code": Optional[str] + key "event_id": Optional[str] + key "message": Required[str] + key "param": Optional[str] + key "type": Required[str] + code: str + event_id: str + message: str + param: str + type: str + + + class azure.ai.projects.types.RealtimeServerEventRateLimitsUpdatedRateLimits(TypedDict, total=False): + key "limit": int + key "name": Literal["requests", "tokens"] + key "remaining": int + key "reset_seconds": float + limit: int + name: Literal[requests, tokens] + remaining: int + reset_seconds: float + + + class azure.ai.projects.types.RealtimeServerEventResponseContentPartAdded(TypedDict, total=False): + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "part": Required[RealtimeServerEventResponseContentPartAddedPart] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED]] + content_index: int + event_id: str + item_id: str + output_index: int + part: RealtimeServerEventResponseContentPartAddedPart + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED] + + + class azure.ai.projects.types.RealtimeServerEventResponseContentPartAddedPart(TypedDict, total=False): + key "audio": str + key "text": str + key "transcript": str + key "type": Literal["audio", "text"] + audio: str + text: str + transcript: str + type: Literal[audio, text] + + + class azure.ai.projects.types.RealtimeServerEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONVERSATION_CREATED = "conversation.created" + CONVERSATION_ITEM_ADDED = "conversation.item.added" + CONVERSATION_ITEM_CREATED = "conversation.item.created" + CONVERSATION_ITEM_DELETED = "conversation.item.deleted" + CONVERSATION_ITEM_DONE = "conversation.item.done" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED = "conversation.item.input_audio_transcription.completed" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA = "conversation.item.input_audio_transcription.delta" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED = "conversation.item.input_audio_transcription.failed" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT = "conversation.item.input_audio_transcription.segment" + CONVERSATION_ITEM_RETRIEVED = "conversation.item.retrieved" + CONVERSATION_ITEM_TRUNCATED = "conversation.item.truncated" + ERROR = "error" + INPUT_AUDIO_BUFFER_CLEARED = "input_audio_buffer.cleared" + INPUT_AUDIO_BUFFER_COMMITTED = "input_audio_buffer.committed" + INPUT_AUDIO_BUFFER_DTMF_EVENT_RECEIVED = "input_audio_buffer.dtmf_event_received" + INPUT_AUDIO_BUFFER_SPEECH_STARTED = "input_audio_buffer.speech_started" + INPUT_AUDIO_BUFFER_SPEECH_STOPPED = "input_audio_buffer.speech_stopped" + INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED = "input_audio_buffer.timeout_triggered" + MCP_LIST_TOOLS_COMPLETED = "mcp_list_tools.completed" + MCP_LIST_TOOLS_FAILED = "mcp_list_tools.failed" + MCP_LIST_TOOLS_IN_PROGRESS = "mcp_list_tools.in_progress" + OUTPUT_AUDIO_BUFFER_CLEARED = "output_audio_buffer.cleared" + OUTPUT_AUDIO_BUFFER_STARTED = "output_audio_buffer.started" + OUTPUT_AUDIO_BUFFER_STOPPED = "output_audio_buffer.stopped" + RATE_LIMITS_UPDATED = "rate_limits.updated" + RESPONSE_CONTENT_PART_ADDED = "response.content_part.added" + RESPONSE_CONTENT_PART_DONE = "response.content_part.done" + RESPONSE_CREATED = "response.created" + RESPONSE_DONE = "response.done" + RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA = "response.function_call_arguments.delta" + RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE = "response.function_call_arguments.done" + RESPONSE_MCP_CALL_ARGUMENTS_DELTA = "response.mcp_call_arguments.delta" + RESPONSE_MCP_CALL_ARGUMENTS_DONE = "response.mcp_call_arguments.done" + RESPONSE_MCP_CALL_COMPLETED = "response.mcp_call.completed" + RESPONSE_MCP_CALL_FAILED = "response.mcp_call.failed" + RESPONSE_MCP_CALL_IN_PROGRESS = "response.mcp_call.in_progress" + RESPONSE_OUTPUT_AUDIO_DELTA = "response.output_audio.delta" + RESPONSE_OUTPUT_AUDIO_DONE = "response.output_audio.done" + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA = "response.output_audio_transcript.delta" + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE = "response.output_audio_transcript.done" + RESPONSE_OUTPUT_ITEM_ADDED = "response.output_item.added" + RESPONSE_OUTPUT_ITEM_DONE = "response.output_item.done" + RESPONSE_OUTPUT_TEXT_DELTA = "response.output_text.delta" + RESPONSE_OUTPUT_TEXT_DONE = "response.output_text.done" + SESSION_CREATED = "session.created" + SESSION_UPDATED = "session.updated" + + + class azure.ai.projects.types.Reasoning(TypedDict, total=False): + key "context": Optional[Literal["auto", "current_turn", "all_turns"]] + key "effort": Optional[Union[str, ReasoningEffort]] + key "generate_summary": Optional[Literal["auto", "concise", "detailed"]] + key "mode": Union[str, ReasoningModeEnum] + key "summary": Optional[Literal["auto", "concise", "detailed"]] + context: Literal[auto, current_turn, all_turns] + effort: Union[str, ReasoningEffort] + generate_summary: Literal[auto, concise, detailed] + mode: Union[str, ReasoningModeEnum] + summary: Literal[auto, concise, detailed] + + + class azure.ai.projects.types.RecurrenceTrigger(TypedDict, total=False): + key "endTime": str + key "interval": Required[int] + key "schedule": Required[RecurrenceSchedule] + key "startTime": str + key "timeZone": str + key "type": Required[Literal[TriggerType.RECURRENCE]] + endTime: str + interval: int + schedule: RecurrenceSchedule + startTime: str + timeZone: str + type: Literal[TriggerType.RECURRENCE] + + + class azure.ai.projects.types.RecurrenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DAILY = "Daily" + HOURLY = "Hourly" + MONTHLY = "Monthly" + WEEKLY = "Weekly" + + + class azure.ai.projects.types.RedTeam(TypedDict, total=False): + key "applicationScenario": str + key "displayName": str + key "id": Required[str] + key "numTurns": int + key "simulationOnly": bool + key "status": str + key "target": Required[RedTeamTargetConfig] + applicationScenario: str + attackStrategies: list[Union[str, AttackStrategy]] + displayName: str + id: str + numTurns: int + properties: dict[str, str] + riskCategories: list[Union[str, RiskCategory]] + simulationOnly: bool + status: str + tags: dict[str, str] + target: RedTeamTargetConfig + + + class azure.ai.projects.types.RedTeamTargetConfig(TypedDict, total=False): + key "modelDeploymentName": Required[str] + key "type": Required[Literal["AzureOpenAIModel"]] + modelDeploymentName: str + type: Literal[AzureOpenAIModel] + + + class azure.ai.projects.types.ReminderPreviewToolboxTool(TypedDict, total=False): + key "description": str + key "name": str + key "type": Required[Literal[ToolboxToolType.REMINDER_PREVIEW]] + description: str + name: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.REMINDER_PREVIEW] + + + class azure.ai.projects.types.ResponsesProtocolConfiguration(TypedDict, total=False): + + + class azure.ai.projects.types.RoutineActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INVOKE_AGENT_INVOCATIONS_API = "invoke_agent_invocations_api" + INVOKE_AGENT_RESPONSES_API = "invoke_agent_responses_api" + + + class azure.ai.projects.types.RoutineDispatchPayloadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INVOKE_AGENT_INVOCATIONS_API = "invoke_agent_invocations_api" + INVOKE_AGENT_RESPONSES_API = "invoke_agent_responses_api" + + + class azure.ai.projects.types.RoutineTriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CUSTOM = "custom" + GITHUB_ISSUE = "github_issue" + SCHEDULE = "schedule" + TIMER = "timer" + + + class azure.ai.projects.types.RubricBasedEvaluatorDefinition(TypedDict, total=False): + key "dimensions": Required[list[Dimension]] + key "pass_threshold": float + key "type": Required[Literal[EvaluatorDefinitionType.RUBRIC]] + data_schema: dict[str, Any] + dimensions: list[Dimension] + init_parameters: dict[str, Any] + metrics: dict[str, EvaluatorMetric] + pass_threshold: float + type: Literal[EvaluatorDefinitionType.RUBRIC] + + + class azure.ai.projects.types.RubricGenerationInputQualityWarning(TypedDict, total=False): + key "code": Required[Union[str, RubricGenerationInputQualityWarningCode]] + key "message": Required[str] + key "severity": Required[Union[str, RubricGenerationInputQualityWarningSeverity]] + key "source": Required[Union[str, RubricGenerationInputQualityWarningSource]] + key "source_index": int + code: Union[str, RubricGenerationInputQualityWarningCode] + message: str + severity: Union[str, RubricGenerationInputQualityWarningSeverity] + source: Union[str, RubricGenerationInputQualityWarningSource] + source_index: int + + + class azure.ai.projects.types.SampleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EVALUATION_RESULT_SAMPLE = "EvaluationResultSample" + + + class azure.ai.projects.types.Schedule(TypedDict, total=False): + key "description": str + key "displayName": str + key "enabled": Required[bool] + key "id": Required[str] + key "provisioningStatus": Union[str, ScheduleProvisioningStatus] + key "systemData": Required[dict[str, str]] + key "task": Required[ScheduleTask] + key "trigger": Required[Trigger] + description: str + displayName: str + enabled: bool + id: str + properties: dict[str, str] + provisioningStatus: Union[str, ScheduleProvisioningStatus] + systemData: dict[str, str] + tags: dict[str, str] + task: ScheduleTask + trigger: Trigger + + + class azure.ai.projects.types.ScheduleRoutineTrigger(TypedDict, total=False): + key "cron_expression": Required[str] + key "time_zone": Required[str] + key "type": Required[Literal[RoutineTriggerType.SCHEDULE]] + cron_expression: str + time_zone: str + type: Literal[RoutineTriggerType.SCHEDULE] + + + class azure.ai.projects.types.ScheduleTaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EVALUATION = "Evaluation" + INSIGHT = "Insight" + + + class azure.ai.projects.types.SearchMemoriesRequest(TypedDict, total=False): + key "options": ForwardRef('MemorySearchOptions', module='types') + key "previous_search_id": str + key "scope": Required[str] + items: list[dict[str, Any]] + options: MemorySearchOptions + previous_search_id: str + scope: str + + + class azure.ai.projects.types.SharepointGroundingToolParameters(TypedDict, total=False): + project_connections: list[ToolProjectConnection] + + + class azure.ai.projects.types.SharepointPreviewTool(TypedDict, total=False): + key "sharepoint_grounding_preview": Required[SharepointGroundingToolParameters] + key "type": Required[Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW]] + sharepoint_grounding_preview: SharepointGroundingToolParameters + type: Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW] + + + class azure.ai.projects.types.SimpleQnADataGenerationJobOptions(TypedDict, total=False): + key "max_samples": Required[int] + key "model_options": ForwardRef('DataGenerationModelOptions', module='types') + key "train_split": float + key "type": Required[Literal[DataGenerationJobType.SIMPLE_QNA]] + max_samples: int + model_options: DataGenerationModelOptions + question_types: list[Union[str, SimpleQnAFineTuningQuestionType]] + train_split: float + type: Literal[DataGenerationJobType.SIMPLE_QNA] + + + class azure.ai.projects.types.SkillInlineContent(TypedDict, total=False): + key "compatibility": str + key "description": Required[str] + key "instructions": Required[str] + key "license": str + allowed_tools: list[str] + compatibility: str + description: str + instructions: str + license: str + metadata: dict[str, str] + + + class azure.ai.projects.types.SkillReferenceParam(TypedDict, total=False): + key "skill_id": Required[str] + key "type": Required[Literal[ContainerSkillType.SKILL_REFERENCE]] + key "version": str + skill_id: str + type: Literal[ContainerSkillType.SKILL_REFERENCE] + version: str + + + class azure.ai.projects.types.SpecificApplyPatchParam(TypedDict, total=False): + key "type": Required[Literal[ToolChoiceParamType.APPLY_PATCH]] + type: Literal[ToolChoiceParamType.APPLY_PATCH] + + + class azure.ai.projects.types.SpecificFunctionShellParam(TypedDict, total=False): + key "type": Required[Literal[ToolChoiceParamType.SHELL]] + type: Literal[ToolChoiceParamType.SHELL] + + + class azure.ai.projects.types.SpecificProgrammaticToolCallingParam(TypedDict, total=False): + key "type": Required[Literal[ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING]] + type: Literal[ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING] + + + class azure.ai.projects.types.StructuredInputDefinition(TypedDict, total=False): + key "default_value": Any + key "description": str + key "required": bool + default_value: Any + description: str + required: bool + schema: dict[str, Any] + + + class azure.ai.projects.types.StructuredOutputDefinition(TypedDict, total=False): + key "description": Required[str] + key "name": Required[str] + key "schema": Required[dict[str, Any]] + key "strict": Required[Optional[bool]] + description: str + name: str + schema: dict[str, Any] + strict: bool + + + class azure.ai.projects.types.TaskGenerationDataGenerationJobOptions(TypedDict, total=False): + key "max_samples": Required[int] + key "model_options": ForwardRef('DataGenerationModelOptions', module='types') + key "train_split": float + key "type": Required[Literal[DataGenerationJobType.TASK_GENERATION]] + max_samples: int + model_options: DataGenerationModelOptions + train_split: float + type: Literal[DataGenerationJobType.TASK_GENERATION] + + + class azure.ai.projects.types.TaxonomyCategory(TypedDict, total=False): + key "description": str + key "id": Required[str] + key "name": Required[str] + key "riskCategory": Required[Union[str, RiskCategory]] + key "subCategories": Required[list[TaxonomySubCategory]] + description: str + id: str + name: str + properties: dict[str, str] + riskCategory: Union[str, RiskCategory] + subCategories: list[TaxonomySubCategory] + + + class azure.ai.projects.types.TaxonomySubCategory(TypedDict, total=False): + key "description": str + key "enabled": Required[bool] + key "id": Required[str] + key "name": Required[str] + description: str + enabled: bool + id: str + name: str + properties: dict[str, str] + + + class azure.ai.projects.types.TelemetryConfig(TypedDict, total=False): + key "endpoints": Required[list[TelemetryEndpoint]] + endpoints: list[TelemetryEndpoint] + + + class azure.ai.projects.types.TelemetryEndpoint(TypedDict, total=False): + key "auth": ForwardRef('TelemetryEndpointAuth', module='types') + key "data": Required[list[Union[str, TelemetryDataKind]]] + key "endpoint": Required[str] + key "kind": Required[Literal[TelemetryEndpointKind.OTLP]] + key "protocol": Required[Union[str, TelemetryTransportProtocol]] + auth: TelemetryEndpointAuth + data: list[Union[str, TelemetryDataKind]] + endpoint: str + kind: Literal[TelemetryEndpointKind.OTLP] + protocol: Union[str, TelemetryTransportProtocol] + + + class azure.ai.projects.types.TelemetryEndpointAuth(TypedDict, total=False): + key "header_name": Required[str] + key "secret_id": Required[str] + key "secret_key": Required[str] + key "type": Required[Literal[TelemetryEndpointAuthType.HEADER]] + header_name: str + secret_id: str + secret_key: str + type: Literal[TelemetryEndpointAuthType.HEADER] + + + class azure.ai.projects.types.TelemetryEndpointAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HEADER = "header" + + + class azure.ai.projects.types.TelemetryEndpointKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + OTLP = "OTLP" + + + class azure.ai.projects.types.TemplateVoiceGreetingConfig(TypedDict, total=False): + key "text": Required[str] + key "type": Required[Literal["template"]] + text: str + type: Literal[template] + + + class azure.ai.projects.types.TextResponseFormatConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + JSON_OBJECT = "json_object" + JSON_SCHEMA = "json_schema" + TEXT = "text" + + + class azure.ai.projects.types.TextResponseFormatJsonObject(TypedDict, total=False): + key "type": Required[Literal[TextResponseFormatConfigurationType.JSON_OBJECT]] + type: Literal[TextResponseFormatConfigurationType.JSON_OBJECT] + + + class azure.ai.projects.types.TextResponseFormatJsonSchema(TypedDict, total=False): + key "description": str + key "name": Required[str] + key "schema": Required[dict[str, Any]] + key "strict": Optional[bool] + key "type": Required[Literal[TextResponseFormatConfigurationType.JSON_SCHEMA]] + description: str + name: str + schema: dict[str, Any] + strict: bool + type: Literal[TextResponseFormatConfigurationType.JSON_SCHEMA] + + + class azure.ai.projects.types.TextResponseFormatText(TypedDict, total=False): + key "type": Required[Literal[TextResponseFormatConfigurationType.TEXT]] + type: Literal[TextResponseFormatConfigurationType.TEXT] + + + class azure.ai.projects.types.TimerRoutineTrigger(TypedDict, total=False): + key "at": int + key "type": Required[Literal[RoutineTriggerType.TIMER]] + at: int + type: Literal[RoutineTriggerType.TIMER] + + + class azure.ai.projects.types.ToolChoiceAllowed(TypedDict, total=False): + key "mode": Required[Literal["auto", "required"]] + key "tools": Required[list[dict[str, Any]]] + key "type": Required[Literal[ToolChoiceParamType.ALLOWED_TOOLS]] + mode: Literal[auto, required] + tools: list[dict[str, Any]] + type: Literal[ToolChoiceParamType.ALLOWED_TOOLS] + + + class azure.ai.projects.types.ToolChoiceCodeInterpreter(TypedDict, total=False): + key "type": Required[Literal[ToolChoiceParamType.CODE_INTERPRETER]] + type: Literal[ToolChoiceParamType.CODE_INTERPRETER] + + + class azure.ai.projects.types.ToolChoiceComputer(TypedDict, total=False): + key "type": Required[Literal[ToolChoiceParamType.COMPUTER]] + type: Literal[ToolChoiceParamType.COMPUTER] + + + class azure.ai.projects.types.ToolChoiceComputerUse(TypedDict, total=False): + key "type": Required[Literal[ToolChoiceParamType.COMPUTER_USE]] + type: Literal[ToolChoiceParamType.COMPUTER_USE] + + + class azure.ai.projects.types.ToolChoiceComputerUsePreview(TypedDict, total=False): + key "type": Required[Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW]] + type: Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW] + + + class azure.ai.projects.types.ToolChoiceCustom(TypedDict, total=False): + key "name": Required[str] + key "type": Required[Literal[ToolChoiceParamType.CUSTOM]] + name: str + type: Literal[ToolChoiceParamType.CUSTOM] + + + class azure.ai.projects.types.ToolChoiceFileSearch(TypedDict, total=False): + key "type": Required[Literal[ToolChoiceParamType.FILE_SEARCH]] + type: Literal[ToolChoiceParamType.FILE_SEARCH] + + + class azure.ai.projects.types.ToolChoiceFunction(TypedDict, total=False): + key "name": Required[str] + key "type": Required[Literal[ToolChoiceParamType.FUNCTION]] + name: str + type: Literal[ToolChoiceParamType.FUNCTION] + + + class azure.ai.projects.types.ToolChoiceImageGeneration(TypedDict, total=False): + key "type": Required[Literal[ToolChoiceParamType.IMAGE_GENERATION]] + type: Literal[ToolChoiceParamType.IMAGE_GENERATION] + + + class azure.ai.projects.types.ToolChoiceMCP(TypedDict, total=False): + key "name": Optional[str] + key "server_label": Required[str] + key "type": Required[Literal[ToolChoiceParamType.MCP]] + name: str + server_label: str + type: Literal[ToolChoiceParamType.MCP] + + + class azure.ai.projects.types.ToolChoiceParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ALLOWED_TOOLS = "allowed_tools" + APPLY_PATCH = "apply_patch" + CODE_INTERPRETER = "code_interpreter" + COMPUTER = "computer" + COMPUTER_USE = "computer_use" + COMPUTER_USE_PREVIEW = "computer_use_preview" + CUSTOM = "custom" + FILE_SEARCH = "file_search" + FUNCTION = "function" + IMAGE_GENERATION = "image_generation" + MCP = "mcp" + PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" + SHELL = "shell" + WEB_SEARCH_PREVIEW = "web_search_preview" + WEB_SEARCH_PREVIEW_2025_03_11 = "web_search_preview_2025_03_11" + + + class azure.ai.projects.types.ToolChoiceWebSearchPreview(TypedDict, total=False): + key "type": Required[Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW]] + type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW] + + + class azure.ai.projects.types.ToolChoiceWebSearchPreview20250311(TypedDict, total=False): + key "type": Required[Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11]] + type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11] + + + class azure.ai.projects.types.ToolConfig(TypedDict, total=False): + key "additional_search_text": str + key "pin": bool + additional_search_text: str + pin: bool + + + class azure.ai.projects.types.ToolDescription(TypedDict, total=False): + key "description": str + key "name": str + description: str + name: str + + + class azure.ai.projects.types.ToolProjectConnection(TypedDict, total=False): + key "project_connection_id": Required[str] + project_connection_id: str + + + class azure.ai.projects.types.ToolSearchToolParam(TypedDict, total=False): + key "description": Optional[str] + key "execution": Union[str, ToolSearchExecutionType] + key "parameters": Optional[EmptyModelParam] + key "type": Required[Literal[ToolType.TOOL_SEARCH]] + description: str + execution: Union[str, ToolSearchExecutionType] + parameters: EmptyModelParam + type: Literal[ToolType.TOOL_SEARCH] + + + class azure.ai.projects.types.ToolSearchToolboxTool(TypedDict, total=False): + key "description": str + key "name": str + key "type": Required[Literal[ToolboxToolType.TOOLBOX_SEARCH]] + description: str + name: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.TOOLBOX_SEARCH] + + + class azure.ai.projects.types.ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + A2A_PREVIEW = "a2a_preview" + APPLY_PATCH = "apply_patch" + AZURE_AI_SEARCH = "azure_ai_search" + AZURE_FUNCTION = "azure_function" + BING_CUSTOM_SEARCH_PREVIEW = "bing_custom_search_preview" + BING_GROUNDING = "bing_grounding" + BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" + CAPTURE_STRUCTURED_OUTPUTS = "capture_structured_outputs" + CODE_INTERPRETER = "code_interpreter" + COMPUTER = "computer" + COMPUTER_USE_PREVIEW = "computer_use_preview" + CUSTOM = "custom" + FABRIC_DATAAGENT_PREVIEW = "fabric_dataagent_preview" + FABRIC_IQ_PREVIEW = "fabric_iq_preview" + FILE_SEARCH = "file_search" + FUNCTION = "function" + IMAGE_GENERATION = "image_generation" + LOCAL_SHELL = "local_shell" + MCP = "mcp" + MEMORY_SEARCH_PREVIEW = "memory_search_preview" + NAMESPACE = "namespace" + OPENAPI = "openapi" + PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" + SHAREPOINT_GROUNDING_PREVIEW = "sharepoint_grounding_preview" + SHELL = "shell" + TOOLBOX_SEARCH_PREVIEW = "toolbox_search_preview" + TOOL_SEARCH = "tool_search" + WEB_SEARCH = "web_search" + WEB_SEARCH_PREVIEW = "web_search_preview" + WORK_IQ_PREVIEW = "work_iq_preview" + + + class azure.ai.projects.types.ToolUseFineTuningDataGenerationJobOptions(TypedDict, total=False): + key "max_samples": Required[int] + key "model_options": ForwardRef('DataGenerationModelOptions', module='types') + key "train_split": float + key "type": Required[Literal[DataGenerationJobType.TOOL_USE]] + max_samples: int + model_options: DataGenerationModelOptions + train_split: float + type: Literal[DataGenerationJobType.TOOL_USE] + + + class azure.ai.projects.types.ToolboxPolicies(TypedDict, total=False): + key "rai_config": ForwardRef('RaiConfig', module='types') + rai_config: RaiConfig + + + class azure.ai.projects.types.ToolboxSearchPreviewToolboxTool(TypedDict, total=False): + key "description": str + key "name": str + key "type": Required[Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW]] + description: str + name: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW] + + + class azure.ai.projects.types.ToolboxSkill(TypedDict, total=False): + key "name": Required[str] + key "type": Required[Literal["skill_reference"]] + key "version": str + name: str + type: Literal[skill_reference] + version: str + + + class azure.ai.projects.types.ToolboxSkillReference(TypedDict, total=False): + key "name": Required[str] + key "type": Required[Literal["skill_reference"]] + key "version": str + name: str + type: Literal[skill_reference] + version: str + + + class azure.ai.projects.types.ToolboxToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + A2A_PREVIEW = "a2a_preview" + AZURE_AI_SEARCH = "azure_ai_search" + BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" + CODE_INTERPRETER = "code_interpreter" + FABRIC_IQ_PREVIEW = "fabric_iq_preview" + FILE_SEARCH = "file_search" + MCP = "mcp" + OPENAPI = "openapi" + REMINDER_PREVIEW = "reminder_preview" + TOOLBOX_SEARCH = "toolbox_search" + TOOLBOX_SEARCH_PREVIEW = "toolbox_search_preview" + WEB_SEARCH = "web_search" + WORK_IQ_PREVIEW = "work_iq_preview" + + + class azure.ai.projects.types.TracesDataGenerationJobOptions(TypedDict, total=False): + key "max_samples": Required[int] + key "model_options": ForwardRef('DataGenerationModelOptions', module='types') + key "train_split": float + key "type": Required[Literal[DataGenerationJobType.TRACES]] + max_samples: int + model_options: DataGenerationModelOptions + train_split: float + type: Literal[DataGenerationJobType.TRACES] + + + class azure.ai.projects.types.TracesDataGenerationJobSource(TypedDict, total=False): + key "agent_id": str + key "agent_name": str + key "agent_version": str + key "description": str + key "end_time": int + key "start_time": Required[int] + key "type": Required[Literal[DataGenerationJobSourceType.TRACES]] + agent_id: str + agent_name: str + agent_version: str + description: str + end_time: int + start_time: int + type: Literal[DataGenerationJobSourceType.TRACES] + + + class azure.ai.projects.types.TracesEvaluatorGenerationJobSource(TypedDict, total=False): + key "agent_id": str + key "agent_name": str + key "agent_version": str + key "description": str + key "end_time": int + key "start_time": Required[int] + key "type": Required[Literal[EvaluatorGenerationJobSourceType.TRACES]] + agent_id: str + agent_name: str + agent_version: str + description: str + end_time: int + start_time: int + type: Literal[EvaluatorGenerationJobSourceType.TRACES] + + + class azure.ai.projects.types.TranscriptTextUsageDuration(TypedDict, total=False): + key "seconds": Required[str] + key "type": Required[Literal[CreateTranscriptionResponseJsonUsageType.DURATION]] + seconds: str + type: Literal[CreateTranscriptionResponseJsonUsageType.DURATION] + + + class azure.ai.projects.types.TranscriptTextUsageTokens(TypedDict, total=False): + key "input_token_details": ForwardRef('TranscriptTextUsageTokensInputTokenDetails', module='types') + key "input_tokens": Required[int] + key "output_tokens": Required[int] + key "total_tokens": Required[int] + key "type": Required[Literal[CreateTranscriptionResponseJsonUsageType.TOKENS]] + input_token_details: TranscriptTextUsageTokensInputTokenDetails + input_tokens: int + output_tokens: int + total_tokens: int + type: Literal[CreateTranscriptionResponseJsonUsageType.TOKENS] + + + class azure.ai.projects.types.TranscriptTextUsageTokensInputTokenDetails(TypedDict, total=False): + key "audio_tokens": int + key "text_tokens": int + audio_tokens: int + text_tokens: int + + + class azure.ai.projects.types.TriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CRON = "Cron" + ONE_TIME = "OneTime" + RECURRENCE = "Recurrence" + + + class azure.ai.projects.types.UpdateMemoriesRequest(TypedDict, total=False): + key "previous_update_id": str + key "scope": Required[str] + key "update_delay": int + items: list[dict[str, Any]] + previous_update_id: str + scope: str + update_delay: int + + + class azure.ai.projects.types.UpdateMemoryRequest(TypedDict, total=False): + key "content": Required[str] + content: str + + + class azure.ai.projects.types.UpdateMemoryStoreRequest(TypedDict, total=False): + key "description": str + description: str + metadata: dict[str, str] + + + class azure.ai.projects.types.UpdateModelVersionRequest(TypedDict, total=False): + key "description": str + description: str + tags: dict[str, str] + + + class azure.ai.projects.types.UpdateSkillRequest(TypedDict, total=False): + key "default_version": Required[str] + default_version: str + + + class azure.ai.projects.types.UpdateToolboxRequest(TypedDict, total=False): + key "default_version": Required[str] + default_version: str + + + class azure.ai.projects.types.UpdateToolboxRequest1(TypedDict, total=False): + key "default_version": Required[str] + default_version: str + + + class azure.ai.projects.types.VersionIndicator(TypedDict, total=False): + key "agent_version": Required[str] + key "type": Required[Literal[VersionIndicatorType.VERSION_REF]] + agent_version: str + type: Literal[VersionIndicatorType.VERSION_REF] + + + class azure.ai.projects.types.VersionIndicatorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + VERSION_REF = "version_ref" + + + class azure.ai.projects.types.VersionRefIndicator(TypedDict, total=False): + key "agent_version": Required[str] + key "type": Required[Literal[VersionIndicatorType.VERSION_REF]] + agent_version: str + type: Literal[VersionIndicatorType.VERSION_REF] + + + class azure.ai.projects.types.VersionSelectionRule(TypedDict, total=False): + key "agent_version": Required[str] + key "traffic_percentage": Required[int] + key "type": Required[Literal[VersionSelectorType.FIXED_RATIO]] + agent_version: str + traffic_percentage: int + type: Literal[VersionSelectorType.FIXED_RATIO] + + + class azure.ai.projects.types.VersionSelector(TypedDict, total=False): + key "version_selection_rules": Required[list[VersionSelectionRule]] + version_selection_rules: list[VersionSelectionRule] + + + class azure.ai.projects.types.VersionSelectorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FIXED_RATIO = "FixedRatio" + + + class azure.ai.projects.types.VoiceAgentAnimationConfig(TypedDict, total=False): + key "model_name": str + model_name: str + outputs: list[Union[str, VoiceAgentAnimationOutputType]] + + + class azure.ai.projects.types.VoiceAgentAvatarIceServer(TypedDict, total=False): + key "credential": Optional[str] + key "urls": Required[list[str]] + key "username": Optional[str] + credential: str + urls: list[str] + username: str + + + class azure.ai.projects.types.VoiceAgentAvatarScene(TypedDict, total=False): + key "amplitude": float + key "position_x": float + key "position_y": float + key "rotation_x": float + key "rotation_y": float + key "rotation_z": float + key "zoom": float + amplitude: float + position_x: float + position_y: float + rotation_x: float + rotation_y: float + rotation_z: float + zoom: float + + + class azure.ai.projects.types.VoiceAgentAvatarVideoBackground(TypedDict, total=False): + key "color": str + key "image_url": str + color: str + image_url: str + + + class azure.ai.projects.types.VoiceAgentAvatarVideoCrop(TypedDict, total=False): + key "bottom_right": Required[list[int]] + key "top_left": Required[list[int]] + bottom_right: list[int] + top_left: list[int] + + + class azure.ai.projects.types.VoiceAgentAvatarVideoParams(TypedDict, total=False): + key "background": ForwardRef('VoiceAgentAvatarVideoBackground', module='types') + key "bitrate": int + key "codec": Literal["h264"] + key "crop": ForwardRef('VoiceAgentAvatarVideoCrop', module='types') + key "gop_size": int + key "resolution": ForwardRef('VoiceAgentAvatarVideoResolution', module='types') + background: VoiceAgentAvatarVideoBackground + bitrate: int + codec: Literal[h264] + crop: VoiceAgentAvatarVideoCrop + gop_size: int + resolution: VoiceAgentAvatarVideoResolution + + + class azure.ai.projects.types.VoiceAgentAvatarVideoResolution(TypedDict, total=False): + key "height": Required[int] + key "width": Required[int] + height: int + width: int + + + class azure.ai.projects.types.VoiceAgentClientEventConversationItemCreate(TypedDict, total=False): + key "event_id": str + key "item": Required[VoiceAgentCreateConversationItem] + key "previous_item_id": str + key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE]] + event_id: str + item: VoiceAgentCreateConversationItem + previous_item_id: str + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE] + + + class azure.ai.projects.types.VoiceAgentClientEventConversationItemDelete(TypedDict, total=False): + key "event_id": str + key "item_id": Required[str] + key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE]] + event_id: str + item_id: str + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE] + + + class azure.ai.projects.types.VoiceAgentClientEventConversationItemRetrieve(TypedDict, total=False): + key "event_id": str + key "item_id": Required[str] + key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE]] + event_id: str + item_id: str + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE] + + + class azure.ai.projects.types.VoiceAgentClientEventConversationItemTruncate(TypedDict, total=False): + key "audio_end_ms": Required[int] + key "content_index": Required[int] + key "event_id": str + key "item_id": Required[str] + key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE]] + audio_end_ms: int + content_index: int + event_id: str + item_id: str + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE] + + + class azure.ai.projects.types.VoiceAgentClientEventInputAudioBufferAppend(TypedDict, total=False): + key "audio": Required[str] + key "event_id": str + key "type": Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND]] + audio: str + event_id: str + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND] + + + class azure.ai.projects.types.VoiceAgentClientEventInputAudioBufferClear(TypedDict, total=False): + key "event_id": str + key "type": Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR]] + event_id: str + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR] + + + class azure.ai.projects.types.VoiceAgentClientEventInputAudioBufferCommit(TypedDict, total=False): + key "event_id": str + key "type": Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT]] + event_id: str + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT] + + + class azure.ai.projects.types.VoiceAgentClientEventOutputAudioBufferClear(TypedDict, total=False): + key "event_id": str + key "type": Required[Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR]] + event_id: str + type: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR] + + + class azure.ai.projects.types.VoiceAgentClientEventResponseCancel(TypedDict, total=False): + key "event_id": str + key "response_id": str + key "type": Required[Literal[RealtimeClientEventType.RESPONSE_CANCEL]] + event_id: str + response_id: str + type: Literal[RealtimeClientEventType.RESPONSE_CANCEL] + + + class azure.ai.projects.types.VoiceAgentClientEventResponseCreate(TypedDict, total=False): + key "event_id": str + key "response": ForwardRef('VoiceAgentResponseCreateParams', module='types') + key "type": Required[Literal[RealtimeClientEventType.RESPONSE_CREATE]] + event_id: str + response: VoiceAgentResponseCreateParams + type: Literal[RealtimeClientEventType.RESPONSE_CREATE] + + + class azure.ai.projects.types.VoiceAgentClientEventSessionAvatarConnect(TypedDict, total=False): + key "client_sdp": Required[str] + key "event_id": str + key "type": Required[Literal["connect"]] + client_sdp: str + event_id: str + type: Literal[connect] + + + class azure.ai.projects.types.VoiceAgentClientEventSessionUpdate(TypedDict, total=False): + key "event_id": str + key "session": Required[VoiceAgentSessionUpdateConfig] + key "type": Required[Literal[RealtimeClientEventType.SESSION_UPDATE]] + event_id: str + session: VoiceAgentSessionUpdateConfig + type: Literal[RealtimeClientEventType.SESSION_UPDATE] + + + class azure.ai.projects.types.VoiceAgentDefinition(TypedDict, total=False): + key "audio": ForwardRef('VoiceAudioConfig', module='types') + key "avatar": ForwardRef('VoiceAvatarConfig', module='types') + key "greeting": ForwardRef('VoiceGreetingConfig', module='types') + key "instructions": str + key "interim_response": ForwardRef('VoiceAgentInterimResponse', module='types') + key "kind": Required[Literal[AgentKind.VOICE]] + key "max_output_tokens": ForwardRef('VoiceAgentMaxOutputTokens', module='types') + key "model": Required[str] + key "model_type": Required[Union[str, VoiceModelType]] + key "parallel_tool_calls": bool + key "rai_config": ForwardRef('RaiConfig', module='types') + key "store": bool + key "tool_choice": ForwardRef('VoiceAgentToolChoice', module='types') + audio: VoiceAudioConfig + avatar: VoiceAvatarConfig + greeting: VoiceGreetingConfig + include: list[Union[str, VoiceAgentSessionIncludeOption]] + instructions: str + interim_response: VoiceAgentInterimResponse + kind: Literal[AgentKind.VOICE] + max_output_tokens: VoiceAgentMaxOutputTokens + model: str + model_type: Union[str, VoiceModelType] + output_modalities: list[Union[str, VoiceOutputModality]] + parallel_tool_calls: bool + rai_config: RaiConfig + store: bool + structured_inputs: dict[str, StructuredInputDefinition] + tool_choice: VoiceAgentToolChoice + tools: list[VoiceAgentTool] + + + class azure.ai.projects.types.VoiceAgentEchoCancellation(TypedDict, total=False): + key "channels": int + key "reference_source": Union[str, VoiceAgentEchoCancellationReferenceSource] + key "type": Required[Literal["server_echo_cancellation"]] + channels: int + reference_source: Union[str, VoiceAgentEchoCancellationReferenceSource] + type: Literal[server_echo_cancellation] + + + class azure.ai.projects.types.VoiceAgentFunctionTool(TypedDict, total=False): + key "description": str + key "name": Required[str] + key "parameters": ForwardRef('RealtimeFunctionToolParameters', module='types') + key "type": Required[Literal["function"]] + description: str + name: str + parameters: RealtimeFunctionToolParameters + type: Literal[function] + + + class azure.ai.projects.types.VoiceAgentLlmInterimResponseConfig(TypedDict, total=False): + key "instructions": str + key "latency_threshold_ms": int + key "max_completion_tokens": int + key "model": str + key "type": Required[Literal["llm_interim_response"]] + instructions: str + latency_threshold_ms: int + max_completion_tokens: int + model: str + triggers: list[Union[str, VoiceAgentInterimResponseTrigger]] + type: Literal[llm_interim_response] + + + class azure.ai.projects.types.VoiceAgentMcpTool(TypedDict, total=False): + key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] + key "allowed_tools": Optional[Union[list[str], MCPToolFilter]] + key "authorization": str + key "defer_loading": bool + key "headers": Optional[dict[str, str]] + key "project_connection_id": str + key "require_approval": Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] + key "response_scheduling": Union[str, VoiceAgentToolResponseScheduling] + key "server_description": str + key "server_label": Required[str] + key "server_url": str + key "type": Required[Literal["mcp"]] + allowed_callers: list[Union[str, CallableToolAllowedCaller]] + allowed_tools: Union[list[str], MCPToolFilter] + authorization: str + defer_loading: bool + headers: dict[str, str] + project_connection_id: str + require_approval: Union[MCPToolRequireApproval, Literal[always], Literal[never]] + response_scheduling: Union[str, VoiceAgentToolResponseScheduling] + server_description: str + server_label: str + server_url: str + tool_configs: dict[str, ToolConfig] + type: Literal[mcp] + + + class azure.ai.projects.types.VoiceAgentRealtimeResponse(OmitPropertiesRealtimeResponse1): + key "audio": ForwardRef('VoiceResponseAudio', module='types') + key "conversation_id": str + key "id": str + key "max_output_tokens": Union[int, Literal["inf"]] + key "metadata": Optional[Metadata] + key "object": Literal["response"] + key "status": Literal["completed", "cancelled", "failed", "incomplete", "in_progress"] + key "status_details": ForwardRef('RealtimeResponseStatusDetails', module='types') + key "usage": ForwardRef('RealtimeResponseUsage', module='types') + audio: VoiceResponseAudio + conversation_id: str + id: str + max_output_tokens: Union[int, Literal[inf]] + metadata: Metadata + object: Literal[response] + output: list[VoiceAgentResponseItem] + output_modalities: list[Literal["text", "audio"]] + status: Literal[completed, cancelled, failed, incomplete, in_progress] + status_details: RealtimeResponseStatusDetails + usage: RealtimeResponseUsage + + + class azure.ai.projects.types.VoiceAgentResponseCreateParams(TypedDict, total=False): + key "audio": ForwardRef('PickPropertiesVoiceAudioConfig', module='types') + key "conversation": Union[Literal["auto"], Literal["none"], str] + key "instructions": str + key "interim_response": Optional[VoiceAgentInterimResponse] + key "max_output_tokens": Union[int, Literal["inf"]] + key "metadata": Optional[Metadata] + key "parallel_tool_calls": bool + key "pre_generated_assistant_message": Optional[RealtimeConversationItemMessageAssistant] + key "reasoning": ForwardRef('RealtimeReasoning', module='types') + key "tool_choice": Union[str, ToolChoiceOptions, ToolChoiceFunction, ToolChoiceMCP] + audio: PickPropertiesVoiceAudioConfig + conversation: Union[Literal[auto], Literal[none], str] + input: list[RealtimeConversationItem] + instructions: str + interim_response: VoiceAgentInterimResponse + max_output_tokens: Union[int, Literal[inf]] + metadata: Metadata + output_modalities: list[Union[str, VoiceOutputModality]] + parallel_tool_calls: bool + pre_generated_assistant_message: RealtimeConversationItemMessageAssistant + reasoning: RealtimeReasoning + tool_choice: Union[str, ToolChoiceOptions, ToolChoiceFunction, ToolChoiceMCP] + tools: list[Union[RealtimeFunctionTool, MCPTool]] + + + class azure.ai.projects.types.VoiceAgentResponseEventContentPart(TypedDict, total=False): + key "audio": str + key "format": ForwardRef('VoiceAudioFormat', module='types') + key "text": str + key "transcript": str + key "type": Literal["audio", "text"] + audio: str + format: VoiceAudioFormat + text: str + transcript: str + type: Literal[audio, text] + + + class azure.ai.projects.types.VoiceAgentSemanticVadTurnDetection(TypedDict, total=False): + key "auto_truncate": bool + key "create_response": bool + key "eagerness": Literal["low", "medium", "high", "auto"] + key "interrupt_response": bool + key "type": Required[Literal[VoiceTurnDetectionType.SEMANTIC_VAD]] + auto_truncate: bool + create_response: bool + eagerness: Literal[low, medium, high, auto] + interrupt_response: bool + type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD] + + + class azure.ai.projects.types.VoiceAgentServerEventConversationItemAdded(TypedDict, total=False): + key "event_id": Required[str] + key "item": Required[VoiceAgentResponseItem] + key "previous_item_id": Optional[str] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED]] + event_id: str + item: VoiceAgentResponseItem + previous_item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED] + + + class azure.ai.projects.types.VoiceAgentServerEventConversationItemCreated(TypedDict, total=False): + key "event_id": Required[str] + key "item": Required[VoiceAgentResponseItem] + key "previous_item_id": Optional[str] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED]] + event_id: str + item: VoiceAgentResponseItem + previous_item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED] + + + class azure.ai.projects.types.VoiceAgentServerEventConversationItemDeleted(TypedDict, total=False): + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED]] + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED] + + + class azure.ai.projects.types.VoiceAgentServerEventConversationItemDone(TypedDict, total=False): + key "event_id": Required[str] + key "item": Required[VoiceAgentResponseItem] + key "previous_item_id": Optional[str] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE]] + event_id: str + item: VoiceAgentResponseItem + previous_item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE] + + + class azure.ai.projects.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted(TypedDict, total=False): + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "logprobs": Optional[list[LogProbProperties]] + key "phrases": Optional[list[VoiceAgentTranscriptionPhrase]] + key "transcript": Required[str] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED]] + key "usage": Required[Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration]] + content_index: int + event_id: str + item_id: str + logprobs: list[LogProbProperties] + phrases: list[VoiceAgentTranscriptionPhrase] + transcript: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED] + usage: Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration] + + + class azure.ai.projects.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta(TypedDict, total=False): + key "content_index": int + key "delta": str + key "event_id": Required[str] + key "item_id": Required[str] + key "logprobs": Optional[list[LogProbProperties]] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA]] + content_index: int + delta: str + event_id: str + item_id: str + logprobs: list[LogProbProperties] + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA] + + + class azure.ai.projects.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed(TypedDict, total=False): + key "content_index": Required[int] + key "error": Required[RealtimeServerEventConversationItemInputAudioTranscriptionFailedError] + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED]] + content_index: int + error: RealtimeServerEventConversationItemInputAudioTranscriptionFailedError + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED] + + + class azure.ai.projects.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment(TypedDict, total=False): + key "content_index": Required[int] + key "end": Required[float] + key "event_id": Required[str] + key "id": Required[str] + key "item_id": Required[str] + key "speaker": Required[str] + key "start": Required[float] + key "text": Required[str] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT]] + content_index: int + end: float + event_id: str + id: str + item_id: str + speaker: str + start: float + text: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT] + + + class azure.ai.projects.types.VoiceAgentServerEventConversationItemRetrieved(TypedDict, total=False): + key "event_id": Required[str] + key "item": Required[VoiceAgentResponseItem] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED]] + event_id: str + item: VoiceAgentResponseItem + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED] + + + class azure.ai.projects.types.VoiceAgentServerEventConversationItemTruncated(TypedDict, total=False): + key "audio_end_ms": Required[int] + key "content_index": Required[int] + key "event_id": Required[str] + key "item": ForwardRef('RealtimeConversationItemMessageAssistant', module='types') + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED]] + audio_end_ms: int + content_index: int + event_id: str + item: RealtimeConversationItemMessageAssistant + item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED] + + + class azure.ai.projects.types.VoiceAgentServerEventInputAudioBufferCleared(TypedDict, total=False): + key "event_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED]] + event_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED] + + + class azure.ai.projects.types.VoiceAgentServerEventInputAudioBufferCommitted(TypedDict, total=False): + key "event_id": Required[str] + key "item_id": Required[str] + key "previous_item_id": Optional[str] + key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED]] + event_id: str + item_id: str + previous_item_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED] + + + class azure.ai.projects.types.VoiceAgentServerEventInputAudioBufferSpeechStarted(TypedDict, total=False): + key "audio_start_ms": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED]] + audio_start_ms: int + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED] + + + class azure.ai.projects.types.VoiceAgentServerEventInputAudioBufferSpeechStopped(TypedDict, total=False): + key "audio_end_ms": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED]] + audio_end_ms: int + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED] + + + class azure.ai.projects.types.VoiceAgentServerEventInputAudioBufferTimeoutTriggered(TypedDict, total=False): + key "audio_end_ms": Required[int] + key "audio_start_ms": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED]] + audio_end_ms: int + audio_start_ms: int + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED] + + + class azure.ai.projects.types.VoiceAgentServerEventMcpListToolsCompleted(TypedDict, total=False): + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED]] + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED] + + + class azure.ai.projects.types.VoiceAgentServerEventMcpListToolsFailed(TypedDict, total=False): + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED]] + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED] + + + class azure.ai.projects.types.VoiceAgentServerEventMcpListToolsInProgress(TypedDict, total=False): + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS]] + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS] + + + class azure.ai.projects.types.VoiceAgentServerEventOutputAudioBufferCleared(TypedDict, total=False): + key "event_id": Required[str] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED]] + event_id: str + response_id: str + type: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED] + + + class azure.ai.projects.types.VoiceAgentServerEventRateLimitsUpdated(TypedDict, total=False): + key "event_id": Required[str] + key "rate_limits": Required[list[RealtimeServerEventRateLimitsUpdatedRateLimits]] + key "type": Required[Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED]] + event_id: str + rate_limits: list[RealtimeServerEventRateLimitsUpdatedRateLimits] + type: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED] + + + class azure.ai.projects.types.VoiceAgentServerEventResponseAnimationBlendshapesDelta(TypedDict, total=False): + key "content_index": Required[int] + key "event_id": Required[str] + key "frame_index": Required[int] + key "frames": Required[list[list[float]]] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal["delta"]] + content_index: int + event_id: str + frame_index: int + frames: list[list[float]] + item_id: str + output_index: int + response_id: str + type: Literal[delta] + + + class azure.ai.projects.types.VoiceAgentServerEventResponseAnimationBlendshapesDone(TypedDict, total=False): + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal["done"]] + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[done] + + + class azure.ai.projects.types.VoiceAgentServerEventResponseAnimationVisemeDelta(TypedDict, total=False): + key "audio_offset_ms": Required[int] + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal["delta"]] + key "viseme_id": Required[int] + audio_offset_ms: int + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[delta] + viseme_id: int + + + class azure.ai.projects.types.VoiceAgentServerEventResponseAnimationVisemeDone(TypedDict, total=False): + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal["done"]] + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[done] + + + class azure.ai.projects.types.VoiceAgentServerEventResponseAudioDelta(TypedDict, total=False): + key "content_index": Required[int] + key "delta": Required[str] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA]] + content_index: int + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA] + + + class azure.ai.projects.types.VoiceAgentServerEventResponseAudioDone(TypedDict, total=False): + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE]] + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE] + + + class azure.ai.projects.types.VoiceAgentServerEventResponseAudioTimestampDelta(TypedDict, total=False): + key "audio_duration_ms": Required[int] + key "audio_offset_ms": Required[int] + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "text": Required[str] + key "timestamp_type": Required[Literal["word"]] + key "type": Required[Literal["delta"]] + audio_duration_ms: int + audio_offset_ms: int + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + text: str + timestamp_type: Literal[word] + type: Literal[delta] + + + class azure.ai.projects.types.VoiceAgentServerEventResponseAudioTimestampDone(TypedDict, total=False): + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal["done"]] + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[done] + + + class azure.ai.projects.types.VoiceAgentServerEventResponseAudioTranscriptDelta(TypedDict, total=False): + key "content_index": Required[int] + key "delta": Required[str] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA]] + content_index: int + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA] + + + class azure.ai.projects.types.VoiceAgentServerEventResponseAudioTranscriptDone(TypedDict, total=False): + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "transcript": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE]] + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + transcript: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE] + + + class azure.ai.projects.types.VoiceAgentServerEventResponseContentPartDone(TypedDict, total=False): + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "part": Required[VoiceAgentResponseEventContentPart] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE]] + content_index: int + event_id: str + item_id: str + output_index: int + part: VoiceAgentResponseEventContentPart + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE] + + + class azure.ai.projects.types.VoiceAgentServerEventResponseCreated(TypedDict, total=False): + key "event_id": Required[str] + key "response": Required[VoiceAgentRealtimeResponse] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CREATED]] + event_id: str + response: VoiceAgentRealtimeResponse + type: Literal[RealtimeServerEventType.RESPONSE_CREATED] + + + class azure.ai.projects.types.VoiceAgentServerEventResponseDone(TypedDict, total=False): + key "event_id": Required[str] + key "response": Required[VoiceAgentRealtimeResponse] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_DONE]] + event_id: str + response: VoiceAgentRealtimeResponse + type: Literal[RealtimeServerEventType.RESPONSE_DONE] + + + class azure.ai.projects.types.VoiceAgentServerEventResponseFunctionCallArgumentsDelta(TypedDict, total=False): + key "call_id": Required[str] + key "delta": Required[str] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA]] + call_id: str + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA] + + + class azure.ai.projects.types.VoiceAgentServerEventResponseFunctionCallArgumentsDone(TypedDict, total=False): + key "arguments": Required[str] + key "call_id": Required[str] + key "event_id": Required[str] + key "item_id": Required[str] + key "name": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE]] + arguments: str + call_id: str + event_id: str + item_id: str + name: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE] + + + class azure.ai.projects.types.VoiceAgentServerEventResponseMcpCallArgumentsDelta(TypedDict, total=False): + key "delta": Required[str] + key "event_id": Required[str] + key "item_id": Required[str] + key "obfuscation": Optional[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA]] + delta: str + event_id: str + item_id: str + obfuscation: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA] + + + class azure.ai.projects.types.VoiceAgentServerEventResponseMcpCallArgumentsDone(TypedDict, total=False): + key "arguments": Required[str] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE]] + arguments: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE] + + + class azure.ai.projects.types.VoiceAgentServerEventResponseMcpCallCompleted(TypedDict, total=False): + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED]] + event_id: str + item_id: str + output_index: int + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED] + + + class azure.ai.projects.types.VoiceAgentServerEventResponseMcpCallFailed(TypedDict, total=False): + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED]] + event_id: str + item_id: str + output_index: int + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED] + + + class azure.ai.projects.types.VoiceAgentServerEventResponseMcpCallInProgress(TypedDict, total=False): + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS]] + event_id: str + item_id: str + output_index: int + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS] + + + class azure.ai.projects.types.VoiceAgentServerEventResponseOutputItemAdded(TypedDict, total=False): + key "event_id": Required[str] + key "item": Required[VoiceAgentResponseItem] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED]] + event_id: str + item: VoiceAgentResponseItem + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED] + + + class azure.ai.projects.types.VoiceAgentServerEventResponseOutputItemDone(TypedDict, total=False): + key "event_id": Required[str] + key "item": Required[VoiceAgentResponseItem] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE]] + event_id: str + item: VoiceAgentResponseItem + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE] + + + class azure.ai.projects.types.VoiceAgentServerEventResponseTextDelta(TypedDict, total=False): + key "content_index": Required[int] + key "delta": Required[str] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA]] + content_index: int + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA] + + + class azure.ai.projects.types.VoiceAgentServerEventResponseTextDone(TypedDict, total=False): + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "text": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE]] + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + text: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE] + + + class azure.ai.projects.types.VoiceAgentServerEventResponseVideoDelta(TypedDict, total=False): + key "codec": Required[str] + key "delta": Required[str] + key "event_id": Required[str] + key "output_index": Required[int] + key "type": Required[Literal["delta"]] + codec: str + delta: str + event_id: str + output_index: int + type: Literal[delta] + + + class azure.ai.projects.types.VoiceAgentServerEventSessionAvatarConnecting(TypedDict, total=False): + key "event_id": Required[str] + key "server_sdp": Required[str] + key "type": Required[Literal["connecting"]] + event_id: str + server_sdp: str + type: Literal[connecting] + + + class azure.ai.projects.types.VoiceAgentServerEventSessionAvatarSwitchToIdle(TypedDict, total=False): + key "event_id": Required[str] + key "turn_id": str + key "type": Required[Literal["switch_to_idle"]] + event_id: str + turn_id: str + type: Literal[switch_to_idle] + + + class azure.ai.projects.types.VoiceAgentServerEventSessionAvatarSwitchToSpeaking(TypedDict, total=False): + key "event_id": Required[str] + key "turn_id": str + key "type": Required[Literal["switch_to_speaking"]] + event_id: str + turn_id: str + type: Literal[switch_to_speaking] + + + class azure.ai.projects.types.VoiceAgentServerEventSessionCreated(TypedDict, total=False): + key "event_id": Required[str] + key "session": Required[VoiceAgentSessionResponseConfig] + key "type": Required[Literal[RealtimeServerEventType.SESSION_CREATED]] + event_id: str + session: VoiceAgentSessionResponseConfig + type: Literal[RealtimeServerEventType.SESSION_CREATED] + + + class azure.ai.projects.types.VoiceAgentServerEventSessionUpdated(TypedDict, total=False): + key "event_id": Required[str] + key "session": Required[VoiceAgentSessionResponseConfig] + key "type": Required[Literal[RealtimeServerEventType.SESSION_UPDATED]] + event_id: str + session: VoiceAgentSessionResponseConfig + type: Literal[RealtimeServerEventType.SESSION_UPDATED] + + + class azure.ai.projects.types.VoiceAgentServerEventWarning(TypedDict, total=False): + key "event_id": Required[str] + key "type": Required[Literal["warning"]] + key "warning": Required[VoiceAgentServerEventWarningDetails] + event_id: str + type: Literal[warning] + warning: VoiceAgentServerEventWarningDetails + + + class azure.ai.projects.types.VoiceAgentServerEventWarningDetails(TypedDict, total=False): + key "code": str + key "message": Required[str] + key "param": str + code: str + message: str + param: str + + + class azure.ai.projects.types.VoiceAgentSessionAvatarConfig(VoiceAvatarConfig): + key "character": Required[str] + key "customized": bool + key "ice_servers": Optional[list[VoiceAgentAvatarIceServer]] + key "model": str + key "output_audit_audio": bool + key "output_protocol": Union[str, VoiceAvatarOutputProtocol] + key "scene": ForwardRef('VoiceAgentAvatarScene', module='types') + key "style": str + key "type": Required[Union[str, VoiceAvatarType]] + key "video": ForwardRef('VoiceAgentAvatarVideoParams', module='types') + character: str + customized: bool + ice_servers: list[VoiceAgentAvatarIceServer] + model: str + output_audit_audio: bool + output_protocol: Union[str, VoiceAvatarOutputProtocol] + scene: VoiceAgentAvatarScene + style: str + type: Union[str, VoiceAvatarType] + video: VoiceAgentAvatarVideoParams + + + class azure.ai.projects.types.VoiceAgentSessionResponseConfig(TypedDict, total=False): + key "animation": ForwardRef('VoiceAgentAnimationConfig', module='types') + key "audio": ForwardRef('VoiceAudioConfig', module='types') + key "avatar": ForwardRef('VoiceAgentSessionAvatarConfig', module='types') + key "expires_at": Optional[int] + key "greeting": ForwardRef('VoiceGreetingConfig', module='types') + key "id": Required[str] + key "instructions": str + key "interim_response": ForwardRef('VoiceAgentInterimResponse', module='types') + key "max_output_tokens": ForwardRef('VoiceAgentMaxOutputTokens', module='types') + key "model": Required[str] + key "object": Required[Literal["session"]] + key "parallel_tool_calls": bool + key "reasoning": ForwardRef('RealtimeReasoning', module='types') + key "temperature": float + key "tool_choice": ForwardRef('VoiceAgentToolChoice', module='types') + key "type": Required[Literal["realtime"]] + animation: VoiceAgentAnimationConfig + audio: VoiceAudioConfig + avatar: VoiceAgentSessionAvatarConfig + expires_at: int + greeting: VoiceGreetingConfig + id: str + include: list[Union[str, VoiceAgentSessionIncludeOption]] + instructions: str + interim_response: VoiceAgentInterimResponse + max_output_tokens: VoiceAgentMaxOutputTokens + metadata: dict[str, str] + model: str + object: Literal[session] + output_modalities: list[Union[str, VoiceOutputModality]] + parallel_tool_calls: bool + reasoning: RealtimeReasoning + temperature: float + tool_choice: VoiceAgentToolChoice + tools: list[VoiceAgentTool] + type: Literal[realtime] + + + class azure.ai.projects.types.VoiceAgentSessionUpdateConfig(TypedDict, total=False): + key "animation": ForwardRef('VoiceAgentAnimationConfig', module='types') + key "audio": ForwardRef('VoiceAudioConfig', module='types') + key "avatar": ForwardRef('VoiceAgentSessionAvatarConfig', module='types') + key "greeting": ForwardRef('VoiceGreetingConfig', module='types') + key "instructions": str + key "interim_response": ForwardRef('VoiceAgentInterimResponse', module='types') + key "max_output_tokens": ForwardRef('VoiceAgentMaxOutputTokens', module='types') + key "parallel_tool_calls": bool + key "reasoning": ForwardRef('RealtimeReasoning', module='types') + key "temperature": float + key "tool_choice": ForwardRef('VoiceAgentToolChoice', module='types') + key "type": Required[Literal["realtime"]] + animation: VoiceAgentAnimationConfig + audio: VoiceAudioConfig + avatar: VoiceAgentSessionAvatarConfig + greeting: VoiceGreetingConfig + include: list[Union[str, VoiceAgentSessionIncludeOption]] + instructions: str + interim_response: VoiceAgentInterimResponse + max_output_tokens: VoiceAgentMaxOutputTokens + metadata: dict[str, str] + output_modalities: list[Union[str, VoiceOutputModality]] + parallel_tool_calls: bool + reasoning: RealtimeReasoning + temperature: float + tool_choice: VoiceAgentToolChoice + tools: list[VoiceAgentTool] + type: Literal[realtime] + + + class azure.ai.projects.types.VoiceAgentStaticInterimResponseConfig(TypedDict, total=False): + key "latency_threshold_ms": int + key "type": Required[Literal["static_interim_response"]] + latency_threshold_ms: int + texts: list[str] + triggers: list[Union[str, VoiceAgentInterimResponseTrigger]] + type: Literal[static_interim_response] + + + class azure.ai.projects.types.VoiceAgentTranscriptionPhrase(TypedDict, total=False): + key "confidence": Optional[float] + key "duration_milliseconds": Required[int] + key "locale": Optional[str] + key "offset_milliseconds": Required[int] + key "text": Required[str] + key "words": Optional[list[VoiceAgentTranscriptionWord]] + confidence: float + duration_milliseconds: int + locale: str + offset_milliseconds: int + text: str + words: list[VoiceAgentTranscriptionWord] + + + class azure.ai.projects.types.VoiceAgentTranscriptionWord(TypedDict, total=False): + key "duration_milliseconds": Required[int] + key "offset_milliseconds": Required[int] + key "text": Required[str] + duration_milliseconds: int + offset_milliseconds: int + text: str + + + class azure.ai.projects.types.VoiceAssistantMessageItem(TypedDict, total=False): + key "content": Required[list[RealtimeConversationItemMessageAssistantContent]] + key "created_at": int + key "id": str + key "object": Literal["item"] + key "response_id": str + key "role": Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] + key "status": Literal["completed", "incomplete", "in_progress"] + key "type": Required[Literal[VoiceConversationItemType.MESSAGE]] + content: list[RealtimeConversationItemMessageAssistantContent] + created_at: int + id: str + object: Literal[item] + response_id: str + role: Literal[RealtimeConversationItemMessageType.ASSISTANT] + status: Literal[completed, incomplete, in_progress] + type: Literal[VoiceConversationItemType.MESSAGE] + + + class azure.ai.projects.types.VoiceAudioConfig(TypedDict, total=False): + key "input": ForwardRef('VoiceAudioInputConfig', module='types') + key "output": ForwardRef('VoiceAudioOutputConfig', module='types') + input: VoiceAudioInputConfig + output: VoiceAudioOutputConfig + + + class azure.ai.projects.types.VoiceAudioFormat(TypedDict, total=False): + key "rate": int + key "type": Required[Union[str, VoiceAudioFormatType]] + rate: int + type: Union[str, VoiceAudioFormatType] + + + class azure.ai.projects.types.VoiceAudioInputConfig(TypedDict, total=False): + key "echo_cancellation": Optional[VoiceAgentEchoCancellation] + key "format": ForwardRef('VoiceAudioFormat', module='types') + key "noise_reduction": Optional[VoiceNoiseReduction] + key "transcription": Optional[VoiceInputTranscription] + key "turn_detection": Optional[VoiceAgentTurnDetection] + echo_cancellation: VoiceAgentEchoCancellation + format: VoiceAudioFormat + noise_reduction: VoiceNoiseReduction + transcription: VoiceInputTranscription + turn_detection: VoiceAgentTurnDetection + + + class azure.ai.projects.types.VoiceAudioOutputConfig(TypedDict, total=False): + key "custom_lexicon_url": str + key "custom_text_normalization_url": str + key "custom_voice_endpoint_id": str + key "format": ForwardRef('VoiceAudioFormat', module='types') + key "personal_voice_model": str + key "pitch": str + key "speed": float + key "style": str + key "voice": str + key "voice_locale": str + key "voice_temperature": float + key "voice_type": str + key "volume": str + custom_lexicon_url: str + custom_text_normalization_url: str + custom_voice_endpoint_id: str + format: VoiceAudioFormat + output_audio_timestamp_types: list[Union[str, VoiceAudioTimestampType]] + personal_voice_model: str + pitch: str + prefer_locales: list[str] + speed: float + style: str + voice: str + voice_locale: str + voice_temperature: float + voice_type: str + volume: str + + + class azure.ai.projects.types.VoiceAvatarConfig(TypedDict, total=False): + key "character": Required[str] + key "customized": bool + key "model": str + key "output_audit_audio": bool + key "output_protocol": Union[str, VoiceAvatarOutputProtocol] + key "scene": ForwardRef('VoiceAgentAvatarScene', module='types') + key "style": str + key "type": Required[Union[str, VoiceAvatarType]] + key "video": ForwardRef('VoiceAgentAvatarVideoParams', module='types') + character: str + customized: bool + model: str + output_audit_audio: bool + output_protocol: Union[str, VoiceAvatarOutputProtocol] + scene: VoiceAgentAvatarScene + style: str + type: Union[str, VoiceAvatarType] + video: VoiceAgentAvatarVideoParams + + + class azure.ai.projects.types.VoiceAzureSemanticVadEnTurnDetection(TypedDict, total=False): + key "auto_truncate": bool + key "create_response": bool + key "end_of_utterance_detection": Optional[VoiceEndOfUtteranceDetection] + key "idle_timeout_ms": str + key "interrupt_response": bool + key "prefix_padding_ms": str + key "remove_filler_words": bool + key "silence_duration_ms": str + key "speech_duration_ms": str + key "threshold": float + key "type": Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN]] + auto_truncate: bool + create_response: bool + end_of_utterance_detection: VoiceEndOfUtteranceDetection + idle_timeout_ms: str + interrupt_response: bool + prefix_padding_ms: str + remove_filler_words: bool + silence_duration_ms: str + speech_duration_ms: str + threshold: float + type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN] + + + class azure.ai.projects.types.VoiceAzureSemanticVadMultilingualTurnDetection(TypedDict, total=False): + key "auto_truncate": bool + key "create_response": bool + key "end_of_utterance_detection": Optional[VoiceEndOfUtteranceDetection] + key "idle_timeout_ms": str + key "interrupt_response": bool + key "prefix_padding_ms": str + key "remove_filler_words": bool + key "silence_duration_ms": str + key "speech_duration_ms": str + key "threshold": float + key "type": Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL]] + auto_truncate: bool + create_response: bool + end_of_utterance_detection: VoiceEndOfUtteranceDetection + idle_timeout_ms: str + interrupt_response: bool + languages: list[str] + prefix_padding_ms: str + remove_filler_words: bool + silence_duration_ms: str + speech_duration_ms: str + threshold: float + type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] + + + class azure.ai.projects.types.VoiceAzureSemanticVadTurnDetection(TypedDict, total=False): + key "auto_truncate": bool + key "create_response": bool + key "end_of_utterance_detection": Optional[VoiceEndOfUtteranceDetection] + key "idle_timeout_ms": str + key "interrupt_response": bool + key "prefix_padding_ms": str + key "remove_filler_words": bool + key "silence_duration_ms": str + key "speech_duration_ms": str + key "threshold": float + key "type": Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD]] + auto_truncate: bool + create_response: bool + end_of_utterance_detection: VoiceEndOfUtteranceDetection + idle_timeout_ms: str + interrupt_response: bool + languages: list[str] + prefix_padding_ms: str + remove_filler_words: bool + silence_duration_ms: str + speech_duration_ms: str + threshold: float + type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD] + + + class azure.ai.projects.types.VoiceConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FUNCTION_CALL = "function_call" + FUNCTION_CALL_OUTPUT = "function_call_output" + MCP_APPROVAL_REQUEST = "mcp_approval_request" + MCP_APPROVAL_RESPONSE = "mcp_approval_response" + MCP_CALL = "mcp_call" + MCP_LIST_TOOLS = "mcp_list_tools" + MESSAGE = "message" + + + class azure.ai.projects.types.VoiceEndOfUtteranceDetection(TypedDict, total=False): + key "model": Required[Union[str, VoiceEndOfUtteranceDetectionModel]] + key "threshold_level": Union[str, VoiceEndOfUtteranceThresholdLevel] + key "timeout_ms": str + model: Union[str, VoiceEndOfUtteranceDetectionModel] + threshold_level: Union[str, VoiceEndOfUtteranceThresholdLevel] + timeout_ms: str + + + class azure.ai.projects.types.VoiceFunctionCallItem(TypedDict, total=False): + key "arguments": Required[str] + key "call_id": str + key "created_at": int + key "id": str + key "name": Required[str] + key "object": Literal["item"] + key "response_id": str + key "status": Literal["completed", "incomplete", "in_progress"] + key "type": Required[Literal[VoiceConversationItemType.FUNCTION_CALL]] + arguments: str + call_id: str + created_at: int + id: str + name: str + object: Literal[item] + response_id: str + status: Literal[completed, incomplete, in_progress] + type: Literal[VoiceConversationItemType.FUNCTION_CALL] + + + class azure.ai.projects.types.VoiceFunctionCallOutputItem(TypedDict, total=False): + key "call_id": Required[str] + key "created_at": int + key "id": str + key "name": str + key "object": Literal["item"] + key "output": Required[str] + key "response_id": str + key "status": Literal["completed", "incomplete", "in_progress"] + key "type": Required[Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT]] + call_id: str + created_at: int + id: str + name: str + object: Literal[item] + output: str + response_id: str + status: Literal[completed, incomplete, in_progress] + type: Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT] + + + class azure.ai.projects.types.VoiceInputTranscription(TypedDict, total=False): + key "delay": Literal["minimal", "low", "medium", "high", "xhigh"] + key "language": str + key "model": Required[Union[str, VoiceInputTranscriptionModel]] + key "prompt": str + custom_speech: dict[str, str] + delay: Literal[minimal, low, medium, high, xhigh] + language: str + model: Union[str, VoiceInputTranscriptionModel] + phrase_list: list[str] + prompt: str + + + class azure.ai.projects.types.VoiceMcpApprovalRequestItem(TypedDict, total=False): + key "arguments": Required[str] + key "created_at": int + key "id": Required[str] + key "name": Required[str] + key "response_id": str + key "server_label": Required[str] + key "type": Required[Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST]] + arguments: str + created_at: int + id: str + name: str + response_id: str + server_label: str + type: Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST] + + + class azure.ai.projects.types.VoiceMcpApprovalResponseItem(TypedDict, total=False): + key "approval_request_id": Required[str] + key "approve": Required[bool] + key "created_at": int + key "id": Required[str] + key "reason": Optional[str] + key "response_id": str + key "type": Required[Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE]] + approval_request_id: str + approve: bool + created_at: int + id: str + reason: str + response_id: str + type: Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE] + + + class azure.ai.projects.types.VoiceMcpCallItem(TypedDict, total=False): + key "approval_request_id": Optional[str] + key "arguments": Required[str] + key "created_at": int + key "error": ForwardRef('RealtimeMCPError', module='types') + key "id": Required[str] + key "name": Required[str] + key "output": Optional[str] + key "response_id": str + key "server_label": Required[str] + key "type": Required[Literal[VoiceConversationItemType.MCP_CALL]] + approval_request_id: str + arguments: str + created_at: int + error: RealtimeMCPError + id: str + name: str + output: str + response_id: str + server_label: str + type: Literal[VoiceConversationItemType.MCP_CALL] + + + class azure.ai.projects.types.VoiceMcpListToolsItem(TypedDict, total=False): + key "created_at": int + key "id": str + key "response_id": str + key "server_label": Required[str] + key "tools": Required[list[MCPListToolsTool]] + key "type": Required[Literal[VoiceConversationItemType.MCP_LIST_TOOLS]] + created_at: int + id: str + response_id: str + server_label: str + tools: list[MCPListToolsTool] + type: Literal[VoiceConversationItemType.MCP_LIST_TOOLS] + + + class azure.ai.projects.types.VoiceNoiseReduction(TypedDict, total=False): + key "type": Required[Union[str, VoiceNoiseReductionType]] + type: Union[str, VoiceNoiseReductionType] + + + class azure.ai.projects.types.VoiceResponseAudio(TypedDict, total=False): + key "output": ForwardRef('VoiceResponseAudioOutput', module='types') + output: VoiceResponseAudioOutput + + + class azure.ai.projects.types.VoiceResponseAudioOutput(TypedDict, total=False): + key "format": ForwardRef('RealtimeAudioFormats', module='types') + key "voice": str + key "voice_locale": str + key "voice_type": str + format: RealtimeAudioFormats + voice: str + voice_locale: str + voice_type: str + + + class azure.ai.projects.types.VoiceServerVadTurnDetection(TypedDict, total=False): + key "auto_truncate": bool + key "create_response": bool + key "end_of_utterance_detection": Optional[VoiceEndOfUtteranceDetection] + key "idle_timeout_ms": Optional[int] + key "interrupt_response": bool + key "prefix_padding_ms": int + key "silence_duration_ms": int + key "speech_duration_ms": int + key "threshold": float + key "type": Required[Literal[VoiceTurnDetectionType.SERVER_VAD]] + auto_truncate: bool + create_response: bool + end_of_utterance_detection: VoiceEndOfUtteranceDetection + idle_timeout_ms: int + interrupt_response: bool + prefix_padding_ms: int + silence_duration_ms: int + speech_duration_ms: int + threshold: float + type: Literal[VoiceTurnDetectionType.SERVER_VAD] + + + class azure.ai.projects.types.VoiceSystemMessageItem(TypedDict, total=False): + key "content": Required[list[RealtimeConversationItemMessageSystemContent]] + key "created_at": int + key "id": str + key "object": Literal["item"] + key "response_id": str + key "role": Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] + key "status": Literal["completed", "incomplete", "in_progress"] + key "type": Required[Literal[VoiceConversationItemType.MESSAGE]] + content: list[RealtimeConversationItemMessageSystemContent] + created_at: int + id: str + object: Literal[item] + response_id: str + role: Literal[RealtimeConversationItemMessageType.SYSTEM] + status: Literal[completed, incomplete, in_progress] + type: Literal[VoiceConversationItemType.MESSAGE] + + + class azure.ai.projects.types.VoiceSystemTool(TypedDict, total=False): + key "description": str + key "name": Required[Union[str, VoiceSystemToolName]] + key "type": Required[Literal["system"]] + description: str + name: Union[str, VoiceSystemToolName] + type: Literal[system] + + + class azure.ai.projects.types.VoiceToolboxTool(TypedDict, total=False): + key "response_scheduling": Union[str, VoiceAgentToolResponseScheduling] + key "toolbox_name": Required[str] + key "toolbox_version": Required[str] + key "type": Required[Literal["toolbox"]] + response_scheduling: Union[str, VoiceAgentToolResponseScheduling] + toolbox_name: str + toolbox_version: str + type: Literal[toolbox] + + + class azure.ai.projects.types.VoiceTurnDetectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_SEMANTIC_VAD = "azure_semantic_vad" + AZURE_SEMANTIC_VAD_EN = "azure_semantic_vad_en" + AZURE_SEMANTIC_VAD_MULTILINGUAL = "azure_semantic_vad_multilingual" + SEMANTIC_VAD = "semantic_vad" + SERVER_VAD = "server_vad" + + + class azure.ai.projects.types.VoiceUserMessageItem(TypedDict, total=False): + key "content": Required[list[RealtimeConversationItemMessageUserContent]] + key "created_at": int + key "id": str + key "object": Literal["item"] + key "response_id": str + key "role": Required[Literal[RealtimeConversationItemMessageType.USER]] + key "status": Literal["completed", "incomplete", "in_progress"] + key "type": Required[Literal[VoiceConversationItemType.MESSAGE]] + content: list[RealtimeConversationItemMessageUserContent] + created_at: int + id: str + object: Literal[item] + response_id: str + role: Literal[RealtimeConversationItemMessageType.USER] + status: Literal[completed, incomplete, in_progress] + type: Literal[VoiceConversationItemType.MESSAGE] + + + class azure.ai.projects.types.WebSearchApproximateLocation(TypedDict, total=False): + key "city": Optional[str] + key "country": Optional[str] + key "region": Optional[str] + key "timezone": Optional[str] + key "type": Required[Literal["approximate"]] + city: str + country: str + region: str + timezone: str + type: Literal[approximate] + + + class azure.ai.projects.types.WebSearchConfiguration(TypedDict, total=False): + key "instance_name": Required[str] + key "project_connection_id": Required[str] + instance_name: str + project_connection_id: str + + + class azure.ai.projects.types.WebSearchPreviewTool(TypedDict, total=False): + key "search_context_size": Union[str, SearchContextSize] + key "type": Required[Literal[ToolType.WEB_SEARCH_PREVIEW]] + key "user_location": Optional[ApproximateLocation] + search_content_types: list[Union[str, SearchContentType]] + search_context_size: Union[str, SearchContextSize] + type: Literal[ToolType.WEB_SEARCH_PREVIEW] + user_location: ApproximateLocation + + + class azure.ai.projects.types.WebSearchTool(TypedDict, total=False): + key "custom_search_configuration": ForwardRef('WebSearchConfiguration', module='types') + key "description": str + key "filters": Optional[WebSearchToolFilters] + key "name": str + key "search_context_size": Literal["low", "medium", "high"] + key "type": Required[Literal[ToolType.WEB_SEARCH]] + key "user_location": Optional[WebSearchApproximateLocation] + custom_search_configuration: WebSearchConfiguration + description: str + filters: WebSearchToolFilters + name: str + search_context_size: Literal[low, medium, high] + tool_configs: dict[str, ToolConfig] + type: Literal[ToolType.WEB_SEARCH] + user_location: WebSearchApproximateLocation + + + class azure.ai.projects.types.WebSearchToolFilters(TypedDict, total=False): + key "allowed_domains": Optional[list[str]] + allowed_domains: list[str] + + + class azure.ai.projects.types.WebSearchToolboxTool(TypedDict, total=False): + key "custom_search_configuration": ForwardRef('WebSearchConfiguration', module='types') + key "description": str + key "filters": Optional[WebSearchToolFilters] + key "name": str + key "search_context_size": Literal["low", "medium", "high"] + key "type": Required[Literal[ToolboxToolType.WEB_SEARCH]] + key "user_location": Optional[WebSearchApproximateLocation] + custom_search_configuration: WebSearchConfiguration + description: str + filters: WebSearchToolFilters + name: str + search_context_size: Literal[low, medium, high] + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.WEB_SEARCH] + user_location: WebSearchApproximateLocation + + + class azure.ai.projects.types.WeeklyRecurrenceSchedule(TypedDict, total=False): + key "daysOfWeek": Required[list[Union[str, DayOfWeek]]] + key "type": Required[Literal[RecurrenceType.WEEKLY]] + daysOfWeek: list[Union[str, DayOfWeek]] + type: Literal[RecurrenceType.WEEKLY] + + + class azure.ai.projects.types.WorkIQPreviewTool(TypedDict, total=False): + key "project_connection_id": Required[str] + key "type": Required[Literal[ToolType.WORK_IQ_PREVIEW]] + project_connection_id: str + type: Literal[ToolType.WORK_IQ_PREVIEW] + + + class azure.ai.projects.types.WorkIQPreviewToolboxTool(TypedDict, total=False): + key "description": str + key "name": str + key "project_connection_id": Required[str] + key "type": Required[Literal[ToolboxToolType.WORK_IQ_PREVIEW]] + description: str + name: str + project_connection_id: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.WORK_IQ_PREVIEW] + + + class azure.ai.projects.types.WorkflowAgentDefinition(TypedDict, total=False): + key "kind": Required[Literal[AgentKind.WORKFLOW]] + key "rai_config": ForwardRef('RaiConfig', module='types') + key "workflow": str + kind: Literal[AgentKind.WORKFLOW] + rai_config: RaiConfig + workflow: str ``` \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/api.metadata.yml b/sdk/ai/azure-ai-projects/api.metadata.yml index 3d493abef420..a6caded15f7e 100644 --- a/sdk/ai/azure-ai-projects/api.metadata.yml +++ b/sdk/ai/azure-ai-projects/api.metadata.yml @@ -1,3 +1,3 @@ -apiMdSha256: 544c82773e2ee8b4aeb0ece5b64bb938f2d3703720950214d3e4c5c98e3e61fd +apiMdSha256: 3916caa8bea8b1e1fcda2d427861466aece65b6f7e7e5fcfd439734c15fac6d9 parserVersion: 0.3.30 -pythonVersion: 3.14.3 +pythonVersion: 3.13.2 diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index fd4f2a8e648b..ac0d2ad5bdd1 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -26,6 +26,19 @@ "azure.ai.projects.models.AgenticIdentityPreviewCredentials": "Azure.AI.Projects.AgenticIdentityPreviewCredentials", "azure.ai.projects.models.AgentIdentity": "Azure.AI.Projects.AgentIdentity", "azure.ai.projects.models.AgentObjectVersions": "Azure.AI.Projects.AgentObject.versions.anonymous", + "azure.ai.projects.models.AgentOptimizationCandidate": "Azure.AI.Projects.AgentOptimizationCandidate", + "azure.ai.projects.models.AgentOptimizationDatasetCriterion": "Azure.AI.Projects.AgentOptimizationDatasetCriterion", + "azure.ai.projects.models.AgentOptimizationDatasetInput": "Azure.AI.Projects.AgentOptimizationDatasetInput", + "azure.ai.projects.models.AgentOptimizationDatasetItem": "Azure.AI.Projects.AgentOptimizationDatasetItem", + "azure.ai.projects.models.AgentOptimizationEvaluatorRef": "Azure.AI.Projects.AgentOptimizationEvaluatorRef", + "azure.ai.projects.models.AgentOptimizationInlineDatasetInput": "Azure.AI.Projects.AgentOptimizationInlineDatasetInput", + "azure.ai.projects.models.AgentOptimizationJob": "Azure.AI.Projects.AgentOptimizationJob", + "azure.ai.projects.models.AgentOptimizationJobInputs": "Azure.AI.Projects.AgentOptimizationJobInputs", + "azure.ai.projects.models.AgentOptimizationJobListItem": "Azure.AI.Projects.AgentOptimizationJobListItem", + "azure.ai.projects.models.AgentOptimizationJobProgress": "Azure.AI.Projects.AgentOptimizationJobProgress", + "azure.ai.projects.models.AgentOptimizationJobResult": "Azure.AI.Projects.AgentOptimizationJobResult", + "azure.ai.projects.models.AgentOptimizationOptions": "Azure.AI.Projects.AgentOptimizationOptions", + "azure.ai.projects.models.AgentOptimizationReferenceDatasetInput": "Azure.AI.Projects.AgentOptimizationReferenceDatasetInput", "azure.ai.projects.models.AgentSessionResource": "Azure.AI.Projects.AgentSessionResource", "azure.ai.projects.models.EvaluationTaxonomyInput": "Azure.AI.Projects.EvaluationTaxonomyInput", "azure.ai.projects.models.AgentTaxonomyInput": "Azure.AI.Projects.AgentTaxonomyInput", @@ -97,6 +110,7 @@ "azure.ai.projects.models.CosmosDBIndex": "Azure.AI.Projects.CosmosDBIndex", "azure.ai.projects.models.CreateAsyncResponse": "Azure.AI.Projects.createAsync.Response.anonymous", "azure.ai.projects.models.CreateSkillVersionFromFilesBody": "Azure.AI.Projects.CreateSkillVersionFromFilesBody", + "azure.ai.projects.models.CreateTranscriptionResponseJsonUsage": "OpenAI.CreateTranscriptionResponseJsonUsage", "azure.ai.projects.models.Trigger": "Azure.AI.Projects.Trigger", "azure.ai.projects.models.CronTrigger": "Azure.AI.Projects.CronTrigger", "azure.ai.projects.models.CustomCredential": "Azure.AI.Projects.CustomCredential", @@ -201,11 +215,17 @@ "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.VoiceGreetingConfig": "Azure.AI.Projects.VoiceGreetingConfig", + "azure.ai.projects.models.LlmGeneratedVoiceGreetingConfig": "Azure.AI.Projects.LlmGeneratedVoiceGreetingConfig", "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", "azure.ai.projects.models.ManagedAgentIdentityBlueprintReference": "Azure.AI.Projects.ManagedAgentIdentityBlueprintReference", "azure.ai.projects.models.ManagedAzureAISearchIndex": "Azure.AI.Projects.ManagedAzureAISearchIndex", + "azure.ai.projects.models.MCPListToolsTool": "OpenAI.MCPListToolsTool", + "azure.ai.projects.models.MCPListToolsToolAnnotations": "OpenAI.MCPListToolsToolAnnotations", + "azure.ai.projects.models.MCPListToolsToolInputSchema": "OpenAI.MCPListToolsToolInputSchema", "azure.ai.projects.models.McpProtocolConfiguration": "Azure.AI.Projects.McpProtocolConfiguration", "azure.ai.projects.models.MCPTool": "OpenAI.MCPTool", "azure.ai.projects.models.MCPToolboxTool": "Azure.AI.Projects.MCPToolboxTool", @@ -224,6 +244,7 @@ "azure.ai.projects.models.MemoryStoreSearchResult": "Azure.AI.Projects.MemoryStoreSearchResponse", "azure.ai.projects.models.MemoryStoreUpdateCompletedResult": "Azure.AI.Projects.MemoryStoreUpdateCompletedResult", "azure.ai.projects.models.MemoryStoreUpdateResult": "Azure.AI.Projects.MemoryStoreUpdateResponse", + "azure.ai.projects.models.Metadata": "OpenAI.Metadata", "azure.ai.projects.models.MicrosoftFabricPreviewTool": "Azure.AI.Projects.MicrosoftFabricPreviewTool", "azure.ai.projects.models.ModelCredentialRequest": "Azure.AI.Projects.ModelCredentialRequest", "azure.ai.projects.models.ModelDeployment": "Azure.AI.Projects.ModelDeployment", @@ -236,6 +257,8 @@ "azure.ai.projects.models.MonthlyRecurrenceSchedule": "Azure.AI.Projects.MonthlyRecurrenceSchedule", "azure.ai.projects.models.NamespaceToolParam": "OpenAI.NamespaceToolParam", "azure.ai.projects.models.NoAuthenticationCredentials": "Azure.AI.Projects.NoAuthenticationCredentials", + "azure.ai.projects.models.OmitPropertiesRealtimeResponse": "TypeSpec.OmitProperties", + "azure.ai.projects.models.OmitPropertiesRealtimeResponse1": "TypeSpec.OmitProperties", "azure.ai.projects.models.OneTimeTrigger": "Azure.AI.Projects.OneTimeTrigger", "azure.ai.projects.models.OpenApiAuthDetails": "Azure.AI.Projects.OpenApiAuthDetails", "azure.ai.projects.models.OpenApiAnonymousAuthDetails": "Azure.AI.Projects.OpenApiAnonymousAuthDetails", @@ -247,25 +270,14 @@ "azure.ai.projects.models.OpenApiProjectConnectionSecurityScheme": "Azure.AI.Projects.OpenApiProjectConnectionSecurityScheme", "azure.ai.projects.models.OpenApiTool": "Azure.AI.Projects.OpenApiTool", "azure.ai.projects.models.OpenApiToolboxTool": "Azure.AI.Projects.OpenApiToolboxTool", - "azure.ai.projects.models.OptimizationAgentIdentifier": "Azure.AI.Projects.OptimizationAgentIdentifier", - "azure.ai.projects.models.OptimizationCandidate": "Azure.AI.Projects.OptimizationCandidate", - "azure.ai.projects.models.OptimizationDatasetCriterion": "Azure.AI.Projects.OptimizationDatasetCriterion", - "azure.ai.projects.models.OptimizationDatasetInput": "Azure.AI.Projects.OptimizationDatasetInput", - "azure.ai.projects.models.OptimizationDatasetItem": "Azure.AI.Projects.OptimizationDatasetItem", - "azure.ai.projects.models.OptimizationEvaluatorRef": "Azure.AI.Projects.OptimizationEvaluatorRef", - "azure.ai.projects.models.OptimizationInlineDatasetInput": "Azure.AI.Projects.OptimizationInlineDatasetInput", - "azure.ai.projects.models.OptimizationJob": "Azure.AI.Projects.OptimizationJob", - "azure.ai.projects.models.OptimizationJobInputs": "Azure.AI.Projects.OptimizationJobInputs", - "azure.ai.projects.models.OptimizationJobListItem": "Azure.AI.Projects.OptimizationJobListItem", - "azure.ai.projects.models.OptimizationJobProgress": "Azure.AI.Projects.OptimizationJobProgress", - "azure.ai.projects.models.OptimizationJobResult": "Azure.AI.Projects.OptimizationJobResult", - "azure.ai.projects.models.OptimizationOptions": "Azure.AI.Projects.OptimizationOptions", - "azure.ai.projects.models.OptimizationReferenceDatasetInput": "Azure.AI.Projects.OptimizationReferenceDatasetInput", + "azure.ai.projects.models.OptimizedAgentIdentifier": "Azure.AI.Projects.OptimizedAgentIdentifier", "azure.ai.projects.models.TelemetryEndpoint": "Azure.AI.Projects.TelemetryEndpoint", "azure.ai.projects.models.OtlpTelemetryEndpoint": "Azure.AI.Projects.OtlpTelemetryEndpoint", "azure.ai.projects.models.PendingUploadRequest": "Azure.AI.Projects.PendingUploadRequest", "azure.ai.projects.models.PendingUploadResponse": "Azure.AI.Projects.PendingUploadResponse", + "azure.ai.projects.models.PickPropertiesVoiceAudioConfig": "TypeSpec.PickProperties", "azure.ai.projects.models.ProceduralMemoryItem": "Azure.AI.Projects.ProceduralMemoryItem", + "azure.ai.projects.models.ProgrammaticToolCallingParam": "OpenAI.ProgrammaticToolCallingParam", "azure.ai.projects.models.PromotionInfo": "Azure.AI.Projects.PromotionInfo", "azure.ai.projects.models.PromptAgentDefinition": "Azure.AI.Projects.PromptAgentDefinition", "azure.ai.projects.models.PromptAgentDefinitionTextOptions": "Azure.AI.Projects.PromptAgentDefinitionTextOptions", @@ -276,6 +288,44 @@ "azure.ai.projects.models.ProtocolVersionRecord": "Azure.AI.Projects.ProtocolVersionRecord", "azure.ai.projects.models.RaiConfig": "Azure.AI.Projects.RaiConfig", "azure.ai.projects.models.RankingOptions": "OpenAI.RankingOptions", + "azure.ai.projects.models.RealtimeAudioFormats": "OpenAI.RealtimeAudioFormats", + "azure.ai.projects.models.RealtimeAudioFormatsAudioPcm": "OpenAI.RealtimeAudioFormatsAudioPcm", + "azure.ai.projects.models.RealtimeAudioFormatsAudioPcma": "OpenAI.RealtimeAudioFormatsAudioPcma", + "azure.ai.projects.models.RealtimeAudioFormatsAudioPcmu": "OpenAI.RealtimeAudioFormatsAudioPcmu", + "azure.ai.projects.models.RealtimeConversationItem": "OpenAI.RealtimeConversationItem", + "azure.ai.projects.models.RealtimeConversationItemFunctionCall": "OpenAI.RealtimeConversationItemFunctionCall", + "azure.ai.projects.models.RealtimeConversationItemFunctionCallOutput": "OpenAI.RealtimeConversationItemFunctionCallOutput", + "azure.ai.projects.models.RealtimeConversationItemMessage": "OpenAI.RealtimeConversationItemMessage", + "azure.ai.projects.models.RealtimeConversationItemMessageAssistant": "OpenAI.RealtimeConversationItemMessageAssistant", + "azure.ai.projects.models.RealtimeConversationItemMessageAssistantContent": "OpenAI.RealtimeConversationItemMessageAssistantContent", + "azure.ai.projects.models.RealtimeConversationItemMessageSystem": "OpenAI.RealtimeConversationItemMessageSystem", + "azure.ai.projects.models.RealtimeConversationItemMessageSystemContent": "OpenAI.RealtimeConversationItemMessageSystemContent", + "azure.ai.projects.models.RealtimeConversationItemMessageUser": "OpenAI.RealtimeConversationItemMessageUser", + "azure.ai.projects.models.RealtimeConversationItemMessageUserContent": "OpenAI.RealtimeConversationItemMessageUserContent", + "azure.ai.projects.models.RealtimeFunctionTool": "OpenAI.RealtimeFunctionTool", + "azure.ai.projects.models.RealtimeFunctionToolParameters": "OpenAI.RealtimeFunctionToolParameters", + "azure.ai.projects.models.RealtimeMCPApprovalRequest": "OpenAI.RealtimeMCPApprovalRequest", + "azure.ai.projects.models.RealtimeMCPApprovalResponse": "OpenAI.RealtimeMCPApprovalResponse", + "azure.ai.projects.models.RealtimeMCPError": "OpenAI.RealtimeMCPError", + "azure.ai.projects.models.RealtimeMCPHTTPError": "OpenAI.RealtimeMCPHTTPError", + "azure.ai.projects.models.RealtimeMCPListTools": "OpenAI.RealtimeMCPListTools", + "azure.ai.projects.models.RealtimeMCPProtocolError": "OpenAI.RealtimeMCPProtocolError", + "azure.ai.projects.models.RealtimeMCPToolCall": "OpenAI.RealtimeMCPToolCall", + "azure.ai.projects.models.RealtimeMCPToolExecutionError": "OpenAI.RealtimeMCPToolExecutionError", + "azure.ai.projects.models.RealtimeReasoning": "OpenAI.RealtimeReasoning", + "azure.ai.projects.models.RealtimeResponseStatusDetails": "OpenAI.RealtimeResponseStatusDetails", + "azure.ai.projects.models.RealtimeResponseStatusDetailsError": "OpenAI.RealtimeResponseStatusDetailsError", + "azure.ai.projects.models.RealtimeResponseUsage": "OpenAI.RealtimeResponseUsage", + "azure.ai.projects.models.RealtimeResponseUsageInputTokenDetails": "OpenAI.RealtimeResponseUsageInputTokenDetails", + "azure.ai.projects.models.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails": "OpenAI.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails", + "azure.ai.projects.models.RealtimeResponseUsageOutputTokenDetails": "OpenAI.RealtimeResponseUsageOutputTokenDetails", + "azure.ai.projects.models.RealtimeServerEvent": "OpenAI.RealtimeServerEvent", + "azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError": "OpenAI.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError", + "azure.ai.projects.models.RealtimeServerEventError": "OpenAI.RealtimeServerEventError", + "azure.ai.projects.models.RealtimeServerEventErrorError": "OpenAI.RealtimeServerEventErrorError", + "azure.ai.projects.models.RealtimeServerEventRateLimitsUpdatedRateLimits": "OpenAI.RealtimeServerEventRateLimitsUpdatedRateLimits", + "azure.ai.projects.models.RealtimeServerEventResponseContentPartAdded": "OpenAI.RealtimeServerEventResponseContentPartAdded", + "azure.ai.projects.models.RealtimeServerEventResponseContentPartAddedPart": "OpenAI.RealtimeServerEventResponseContentPartAddedPart", "azure.ai.projects.models.Reasoning": "OpenAI.Reasoning", "azure.ai.projects.models.RecurrenceTrigger": "Azure.AI.Projects.RecurrenceTrigger", "azure.ai.projects.models.RedTeam": "Azure.AI.Projects.RedTeam", @@ -304,12 +354,14 @@ "azure.ai.projects.models.ToolChoiceParam": "OpenAI.ToolChoiceParam", "azure.ai.projects.models.SpecificApplyPatchParam": "OpenAI.SpecificApplyPatchParam", "azure.ai.projects.models.SpecificFunctionShellParam": "OpenAI.SpecificFunctionShellParam", + "azure.ai.projects.models.SpecificProgrammaticToolCallingParam": "OpenAI.SpecificProgrammaticToolCallingParam", "azure.ai.projects.models.StructuredInputDefinition": "Azure.AI.Projects.StructuredInputDefinition", "azure.ai.projects.models.StructuredOutputDefinition": "Azure.AI.Projects.StructuredOutputDefinition", "azure.ai.projects.models.TaskGenerationDataGenerationJobOptions": "Azure.AI.Projects.TaskGenerationDataGenerationJobOptions", "azure.ai.projects.models.TaxonomyCategory": "Azure.AI.Projects.TaxonomyCategory", "azure.ai.projects.models.TaxonomySubCategory": "Azure.AI.Projects.TaxonomySubCategory", "azure.ai.projects.models.TelemetryConfig": "Azure.AI.Projects.TelemetryConfig", + "azure.ai.projects.models.TemplateVoiceGreetingConfig": "Azure.AI.Projects.TemplateVoiceGreetingConfig", "azure.ai.projects.models.TextResponseFormat": "OpenAI.TextResponseFormatConfiguration", "azure.ai.projects.models.TextResponseFormatJsonObject": "OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject", "azure.ai.projects.models.TextResponseFormatJsonSchema": "OpenAI.TextResponseFormatJsonSchema", @@ -342,12 +394,136 @@ "azure.ai.projects.models.TracesDataGenerationJobOptions": "Azure.AI.Projects.TracesDataGenerationJobOptions", "azure.ai.projects.models.TracesDataGenerationJobSource": "Azure.AI.Projects.TracesDataGenerationJobSource", "azure.ai.projects.models.TracesEvaluatorGenerationJobSource": "Azure.AI.Projects.TracesEvaluatorGenerationJobSource", + "azure.ai.projects.models.TranscriptTextUsageDuration": "OpenAI.TranscriptTextUsageDuration", + "azure.ai.projects.models.TranscriptTextUsageTokens": "OpenAI.TranscriptTextUsageTokens", + "azure.ai.projects.models.TranscriptTextUsageTokensInputTokenDetails": "OpenAI.TranscriptTextUsageTokensInputTokenDetails", "azure.ai.projects.models.UpdateModelVersionRequest": "Azure.AI.Projects.UpdateModelVersionRequest", "azure.ai.projects.models.UpdateToolboxRequest": "Azure.AI.Projects.UpdateToolboxRequest", "azure.ai.projects.models.UserProfileMemoryItem": "Azure.AI.Projects.UserProfileMemoryItem", "azure.ai.projects.models.VersionIndicator": "Azure.AI.Projects.VersionIndicator", "azure.ai.projects.models.VersionRefIndicator": "Azure.AI.Projects.VersionRefIndicator", "azure.ai.projects.models.VersionSelector": "Azure.AI.Projects.VersionSelector", + "azure.ai.projects.models.VoiceAgentAnimationConfig": "Azure.AI.Projects.VoiceAgentAnimationConfig", + "azure.ai.projects.models.VoiceAgentAvatarIceServer": "Azure.AI.Projects.VoiceAgentAvatarIceServer", + "azure.ai.projects.models.VoiceAgentAvatarScene": "Azure.AI.Projects.VoiceAgentAvatarScene", + "azure.ai.projects.models.VoiceAgentAvatarVideoBackground": "Azure.AI.Projects.VoiceAgentAvatarVideoBackground", + "azure.ai.projects.models.VoiceAgentAvatarVideoCrop": "Azure.AI.Projects.VoiceAgentAvatarVideoCrop", + "azure.ai.projects.models.VoiceAgentAvatarVideoParams": "Azure.AI.Projects.VoiceAgentAvatarVideoParams", + "azure.ai.projects.models.VoiceAgentAvatarVideoResolution": "Azure.AI.Projects.VoiceAgentAvatarVideoResolution", + "azure.ai.projects.models.VoiceAgentClientEventConversationItemCreate": "Azure.AI.Projects.VoiceAgentClientEventConversationItemCreate", + "azure.ai.projects.models.VoiceAgentClientEventConversationItemDelete": "Azure.AI.Projects.VoiceAgentClientEventConversationItemDelete", + "azure.ai.projects.models.VoiceAgentClientEventConversationItemRetrieve": "Azure.AI.Projects.VoiceAgentClientEventConversationItemRetrieve", + "azure.ai.projects.models.VoiceAgentClientEventConversationItemTruncate": "Azure.AI.Projects.VoiceAgentClientEventConversationItemTruncate", + "azure.ai.projects.models.VoiceAgentClientEventInputAudioBufferAppend": "Azure.AI.Projects.VoiceAgentClientEventInputAudioBufferAppend", + "azure.ai.projects.models.VoiceAgentClientEventInputAudioBufferClear": "Azure.AI.Projects.VoiceAgentClientEventInputAudioBufferClear", + "azure.ai.projects.models.VoiceAgentClientEventInputAudioBufferCommit": "Azure.AI.Projects.VoiceAgentClientEventInputAudioBufferCommit", + "azure.ai.projects.models.VoiceAgentClientEventOutputAudioBufferClear": "Azure.AI.Projects.VoiceAgentClientEventOutputAudioBufferClear", + "azure.ai.projects.models.VoiceAgentClientEventResponseCancel": "Azure.AI.Projects.VoiceAgentClientEventResponseCancel", + "azure.ai.projects.models.VoiceAgentClientEventResponseCreate": "Azure.AI.Projects.VoiceAgentClientEventResponseCreate", + "azure.ai.projects.models.VoiceAgentClientEventSessionAvatarConnect": "Azure.AI.Projects.VoiceAgentClientEventSessionAvatarConnect", + "azure.ai.projects.models.VoiceAgentClientEventSessionUpdate": "Azure.AI.Projects.VoiceAgentClientEventSessionUpdate", + "azure.ai.projects.models.VoiceAgentDefinition": "Azure.AI.Projects.VoiceAgentDefinition", + "azure.ai.projects.models.VoiceAgentEchoCancellation": "Azure.AI.Projects.VoiceAgentEchoCancellation", + "azure.ai.projects.models.VoiceAgentTool": "Azure.AI.Projects.VoiceAgentTool", + "azure.ai.projects.models.VoiceAgentFunctionTool": "Azure.AI.Projects.VoiceAgentFunctionTool", + "azure.ai.projects.models.VoiceAgentInterimResponseConfig": "Azure.AI.Projects.VoiceAgentInterimResponseConfig", + "azure.ai.projects.models.VoiceAgentLlmInterimResponseConfig": "Azure.AI.Projects.VoiceAgentLlmInterimResponseConfig", + "azure.ai.projects.models.VoiceAgentMcpTool": "Azure.AI.Projects.VoiceAgentMcpTool", + "azure.ai.projects.models.VoiceAgentRealtimeResponse": "Azure.AI.Projects.VoiceAgentRealtimeResponse", + "azure.ai.projects.models.VoiceAgentResponseCreateParams": "Azure.AI.Projects.VoiceAgentResponseCreateParams", + "azure.ai.projects.models.VoiceAgentResponseEventContentPart": "Azure.AI.Projects.VoiceAgentResponseEventContentPart", + "azure.ai.projects.models.VoiceTurnDetection": "Azure.AI.Projects.VoiceTurnDetection", + "azure.ai.projects.models.VoiceAgentSemanticVadTurnDetection": "Azure.AI.Projects.VoiceAgentSemanticVadTurnDetection", + "azure.ai.projects.models.VoiceAgentServerEventConversationItemAdded": "Azure.AI.Projects.VoiceAgentServerEventConversationItemAdded", + "azure.ai.projects.models.VoiceAgentServerEventConversationItemCreated": "Azure.AI.Projects.VoiceAgentServerEventConversationItemCreated", + "azure.ai.projects.models.VoiceAgentServerEventConversationItemDeleted": "Azure.AI.Projects.VoiceAgentServerEventConversationItemDeleted", + "azure.ai.projects.models.VoiceAgentServerEventConversationItemDone": "Azure.AI.Projects.VoiceAgentServerEventConversationItemDone", + "azure.ai.projects.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted": "Azure.AI.Projects.VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted", + "azure.ai.projects.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta": "Azure.AI.Projects.VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta", + "azure.ai.projects.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed": "Azure.AI.Projects.VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed", + "azure.ai.projects.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment": "Azure.AI.Projects.VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment", + "azure.ai.projects.models.VoiceAgentServerEventConversationItemRetrieved": "Azure.AI.Projects.VoiceAgentServerEventConversationItemRetrieved", + "azure.ai.projects.models.VoiceAgentServerEventConversationItemTruncated": "Azure.AI.Projects.VoiceAgentServerEventConversationItemTruncated", + "azure.ai.projects.models.VoiceAgentServerEventInputAudioBufferCleared": "Azure.AI.Projects.VoiceAgentServerEventInputAudioBufferCleared", + "azure.ai.projects.models.VoiceAgentServerEventInputAudioBufferCommitted": "Azure.AI.Projects.VoiceAgentServerEventInputAudioBufferCommitted", + "azure.ai.projects.models.VoiceAgentServerEventInputAudioBufferSpeechStarted": "Azure.AI.Projects.VoiceAgentServerEventInputAudioBufferSpeechStarted", + "azure.ai.projects.models.VoiceAgentServerEventInputAudioBufferSpeechStopped": "Azure.AI.Projects.VoiceAgentServerEventInputAudioBufferSpeechStopped", + "azure.ai.projects.models.VoiceAgentServerEventInputAudioBufferTimeoutTriggered": "Azure.AI.Projects.VoiceAgentServerEventInputAudioBufferTimeoutTriggered", + "azure.ai.projects.models.VoiceAgentServerEventMcpListToolsCompleted": "Azure.AI.Projects.VoiceAgentServerEventMcpListToolsCompleted", + "azure.ai.projects.models.VoiceAgentServerEventMcpListToolsFailed": "Azure.AI.Projects.VoiceAgentServerEventMcpListToolsFailed", + "azure.ai.projects.models.VoiceAgentServerEventMcpListToolsInProgress": "Azure.AI.Projects.VoiceAgentServerEventMcpListToolsInProgress", + "azure.ai.projects.models.VoiceAgentServerEventOutputAudioBufferCleared": "Azure.AI.Projects.VoiceAgentServerEventOutputAudioBufferCleared", + "azure.ai.projects.models.VoiceAgentServerEventRateLimitsUpdated": "Azure.AI.Projects.VoiceAgentServerEventRateLimitsUpdated", + "azure.ai.projects.models.VoiceAgentServerEventResponseAnimationBlendshapesDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseAnimationBlendshapesDelta", + "azure.ai.projects.models.VoiceAgentServerEventResponseAnimationBlendshapesDone": "Azure.AI.Projects.VoiceAgentServerEventResponseAnimationBlendshapesDone", + "azure.ai.projects.models.VoiceAgentServerEventResponseAnimationVisemeDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseAnimationVisemeDelta", + "azure.ai.projects.models.VoiceAgentServerEventResponseAnimationVisemeDone": "Azure.AI.Projects.VoiceAgentServerEventResponseAnimationVisemeDone", + "azure.ai.projects.models.VoiceAgentServerEventResponseAudioDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseAudioDelta", + "azure.ai.projects.models.VoiceAgentServerEventResponseAudioDone": "Azure.AI.Projects.VoiceAgentServerEventResponseAudioDone", + "azure.ai.projects.models.VoiceAgentServerEventResponseAudioTimestampDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseAudioTimestampDelta", + "azure.ai.projects.models.VoiceAgentServerEventResponseAudioTimestampDone": "Azure.AI.Projects.VoiceAgentServerEventResponseAudioTimestampDone", + "azure.ai.projects.models.VoiceAgentServerEventResponseAudioTranscriptDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseAudioTranscriptDelta", + "azure.ai.projects.models.VoiceAgentServerEventResponseAudioTranscriptDone": "Azure.AI.Projects.VoiceAgentServerEventResponseAudioTranscriptDone", + "azure.ai.projects.models.VoiceAgentServerEventResponseContentPartDone": "Azure.AI.Projects.VoiceAgentServerEventResponseContentPartDone", + "azure.ai.projects.models.VoiceAgentServerEventResponseCreated": "Azure.AI.Projects.VoiceAgentServerEventResponseCreated", + "azure.ai.projects.models.VoiceAgentServerEventResponseDone": "Azure.AI.Projects.VoiceAgentServerEventResponseDone", + "azure.ai.projects.models.VoiceAgentServerEventResponseFunctionCallArgumentsDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseFunctionCallArgumentsDelta", + "azure.ai.projects.models.VoiceAgentServerEventResponseFunctionCallArgumentsDone": "Azure.AI.Projects.VoiceAgentServerEventResponseFunctionCallArgumentsDone", + "azure.ai.projects.models.VoiceAgentServerEventResponseMcpCallArgumentsDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseMcpCallArgumentsDelta", + "azure.ai.projects.models.VoiceAgentServerEventResponseMcpCallArgumentsDone": "Azure.AI.Projects.VoiceAgentServerEventResponseMcpCallArgumentsDone", + "azure.ai.projects.models.VoiceAgentServerEventResponseMcpCallCompleted": "Azure.AI.Projects.VoiceAgentServerEventResponseMcpCallCompleted", + "azure.ai.projects.models.VoiceAgentServerEventResponseMcpCallFailed": "Azure.AI.Projects.VoiceAgentServerEventResponseMcpCallFailed", + "azure.ai.projects.models.VoiceAgentServerEventResponseMcpCallInProgress": "Azure.AI.Projects.VoiceAgentServerEventResponseMcpCallInProgress", + "azure.ai.projects.models.VoiceAgentServerEventResponseOutputItemAdded": "Azure.AI.Projects.VoiceAgentServerEventResponseOutputItemAdded", + "azure.ai.projects.models.VoiceAgentServerEventResponseOutputItemDone": "Azure.AI.Projects.VoiceAgentServerEventResponseOutputItemDone", + "azure.ai.projects.models.VoiceAgentServerEventResponseTextDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseTextDelta", + "azure.ai.projects.models.VoiceAgentServerEventResponseTextDone": "Azure.AI.Projects.VoiceAgentServerEventResponseTextDone", + "azure.ai.projects.models.VoiceAgentServerEventResponseVideoDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseVideoDelta", + "azure.ai.projects.models.VoiceAgentServerEventSessionAvatarConnecting": "Azure.AI.Projects.VoiceAgentServerEventSessionAvatarConnecting", + "azure.ai.projects.models.VoiceAgentServerEventSessionAvatarSwitchToIdle": "Azure.AI.Projects.VoiceAgentServerEventSessionAvatarSwitchToIdle", + "azure.ai.projects.models.VoiceAgentServerEventSessionAvatarSwitchToSpeaking": "Azure.AI.Projects.VoiceAgentServerEventSessionAvatarSwitchToSpeaking", + "azure.ai.projects.models.VoiceAgentServerEventSessionCreated": "Azure.AI.Projects.VoiceAgentServerEventSessionCreated", + "azure.ai.projects.models.VoiceAgentServerEventSessionUpdated": "Azure.AI.Projects.VoiceAgentServerEventSessionUpdated", + "azure.ai.projects.models.VoiceAgentServerEventWarning": "Azure.AI.Projects.VoiceAgentServerEventWarning", + "azure.ai.projects.models.VoiceAgentServerEventWarningDetails": "Azure.AI.Projects.VoiceAgentServerEventWarningDetails", + "azure.ai.projects.models.VoiceAvatarConfig": "Azure.AI.Projects.VoiceAvatarConfig", + "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.VoiceAgentStaticInterimResponseConfig": "Azure.AI.Projects.VoiceAgentStaticInterimResponseConfig", + "azure.ai.projects.models.VoiceAgentTranscriptionPhrase": "Azure.AI.Projects.VoiceAgentTranscriptionPhrase", + "azure.ai.projects.models.VoiceAgentTranscriptionWord": "Azure.AI.Projects.VoiceAgentTranscriptionWord", + "azure.ai.projects.models.VoiceConversationItem": "Azure.AI.Projects.VoiceConversationItem", + "azure.ai.projects.models.VoiceMessageItem": "Azure.AI.Projects.VoiceMessageItem", + "azure.ai.projects.models.VoiceAssistantMessageItem": "Azure.AI.Projects.VoiceAssistantMessageItem", + "azure.ai.projects.models.VoiceAudioConfig": "Azure.AI.Projects.VoiceAudioConfig", + "azure.ai.projects.models.VoiceAudioFormat": "Azure.AI.Projects.VoiceAudioFormat", + "azure.ai.projects.models.VoiceAudioInputConfig": "Azure.AI.Projects.VoiceAudioInputConfig", + "azure.ai.projects.models.VoiceAudioOutputConfig": "Azure.AI.Projects.VoiceAudioOutputConfig", + "azure.ai.projects.models.VoiceAzureSemanticVadEnTurnDetection": "Azure.AI.Projects.VoiceAzureSemanticVadEnTurnDetection", + "azure.ai.projects.models.VoiceAzureSemanticVadMultilingualTurnDetection": "Azure.AI.Projects.VoiceAzureSemanticVadMultilingualTurnDetection", + "azure.ai.projects.models.VoiceAzureSemanticVadTurnDetection": "Azure.AI.Projects.VoiceAzureSemanticVadTurnDetection", + "azure.ai.projects.models.VoiceConversation": "Azure.AI.Projects.VoiceConversation", + "azure.ai.projects.models.VoiceEndOfUtteranceDetection": "Azure.AI.Projects.VoiceEndOfUtteranceDetection", + "azure.ai.projects.models.VoiceFunctionCallItem": "Azure.AI.Projects.VoiceFunctionCallItem", + "azure.ai.projects.models.VoiceFunctionCallOutputItem": "Azure.AI.Projects.VoiceFunctionCallOutputItem", + "azure.ai.projects.models.VoiceInputTranscription": "Azure.AI.Projects.VoiceInputTranscription", + "azure.ai.projects.models.VoiceItemAudioResponse": "Azure.AI.Projects.VoiceItemAudioResponse", + "azure.ai.projects.models.VoiceMcpApprovalRequestItem": "Azure.AI.Projects.VoiceMcpApprovalRequestItem", + "azure.ai.projects.models.VoiceMcpApprovalResponseItem": "Azure.AI.Projects.VoiceMcpApprovalResponseItem", + "azure.ai.projects.models.VoiceMcpCallItem": "Azure.AI.Projects.VoiceMcpCallItem", + "azure.ai.projects.models.VoiceMcpListToolsItem": "Azure.AI.Projects.VoiceMcpListToolsItem", + "azure.ai.projects.models.VoiceNoiseReduction": "Azure.AI.Projects.VoiceNoiseReduction", + "azure.ai.projects.models.VoiceRecordingChannelLayout": "Azure.AI.Projects.VoiceRecordingChannelLayout", + "azure.ai.projects.models.VoiceRecordingResponse": "Azure.AI.Projects.VoiceRecordingResponse", + "azure.ai.projects.models.VoiceResponse": "Azure.AI.Projects.VoiceResponse", + "azure.ai.projects.models.VoiceResponseAudio": "Azure.AI.Projects.VoiceResponseAudio", + "azure.ai.projects.models.VoiceResponseAudioOutput": "Azure.AI.Projects.VoiceResponseAudioOutput", + "azure.ai.projects.models.VoiceServerVadTurnDetection": "Azure.AI.Projects.VoiceServerVadTurnDetection", + "azure.ai.projects.models.VoiceSystemMessageItem": "Azure.AI.Projects.VoiceSystemMessageItem", + "azure.ai.projects.models.VoiceSystemTool": "Azure.AI.Projects.VoiceSystemTool", + "azure.ai.projects.models.VoiceToolboxTool": "Azure.AI.Projects.VoiceToolboxTool", + "azure.ai.projects.models.VoiceUserMessageItem": "Azure.AI.Projects.VoiceUserMessageItem", "azure.ai.projects.models.WebSearchApproximateLocation": "OpenAI.WebSearchApproximateLocation", "azure.ai.projects.models.WebSearchConfiguration": "Azure.AI.Projects.WebSearchConfiguration", "azure.ai.projects.models.WebSearchPreviewTool": "OpenAI.WebSearchPreviewTool", @@ -360,6 +536,7 @@ "azure.ai.projects.models.WorkIQPreviewToolboxTool": "Azure.AI.Projects.WorkIQPreviewToolboxTool", "azure.ai.projects.models.EvaluationTaxonomyInputType": "Azure.AI.Projects.EvaluationTaxonomyInputType", "azure.ai.projects.models.ToolType": "OpenAI.ToolType", + "azure.ai.projects.models.CallableToolAllowedCaller": "OpenAI.CallableToolAllowedCaller", "azure.ai.projects.models.AzureAISearchQueryType": "Azure.AI.Projects.AzureAISearchQueryType", "azure.ai.projects.models.ContainerMemoryLimit": "OpenAI.ContainerMemoryLimit", "azure.ai.projects.models.ContainerNetworkPolicyParamType": "OpenAI.ContainerNetworkPolicyParamType", @@ -420,9 +597,10 @@ "azure.ai.projects.models.SimpleQnAFineTuningQuestionType": "Azure.AI.Projects.SimpleQnAFineTuningQuestionType", "azure.ai.projects.models.DataGenerationJobScenario": "Azure.AI.Projects.DataGenerationJobScenario", "azure.ai.projects.models.DataGenerationJobOutputType": "Azure.AI.Projects.DataGenerationJobOutputType", - "azure.ai.projects.models.OptimizationDatasetInputType": "Azure.AI.Projects.OptimizationDatasetInputType", + "azure.ai.projects.models.AgentOptimizationDatasetInputType": "Azure.AI.Projects.AgentOptimizationDatasetInputType", "azure.ai.projects.models.AgentObjectType": "Azure.AI.Projects.AgentObjectType", "azure.ai.projects.models.AgentState": "Azure.AI.Projects.AgentState", + "azure.ai.projects.models.AgentStateSource": "Azure.AI.Projects.AgentStateSource", "azure.ai.projects.models.AgentKind": "Azure.AI.Projects.AgentKind", "azure.ai.projects.models.AgentEndpointProtocol": "Azure.AI.Projects.AgentEndpointProtocol", "azure.ai.projects.models.CodeDependencyResolution": "Azure.AI.Projects.CodeDependencyResolution", @@ -430,8 +608,27 @@ "azure.ai.projects.models.TelemetryDataKind": "Azure.AI.Projects.TelemetryDataKind", "azure.ai.projects.models.TelemetryEndpointAuthType": "Azure.AI.Projects.TelemetryEndpointAuthType", "azure.ai.projects.models.TelemetryTransportProtocol": "Azure.AI.Projects.TelemetryTransportProtocol", + "azure.ai.projects.models.ReasoningModeEnum": "OpenAI.ReasoningModeEnum", + "azure.ai.projects.models.ReasoningEffort": "OpenAI.ReasoningEffort", "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.ToolChoiceOptions": "OpenAI.ToolChoiceOptions", + "azure.ai.projects.models.VoiceAudioFormatType": "Azure.AI.Projects.VoiceAudioFormatType", + "azure.ai.projects.models.VoiceNoiseReductionType": "Azure.AI.Projects.VoiceNoiseReductionType", + "azure.ai.projects.models.VoiceTurnDetectionType": "Azure.AI.Projects.VoiceTurnDetectionType", + "azure.ai.projects.models.VoiceEndOfUtteranceDetectionModel": "Azure.AI.Projects.VoiceEndOfUtteranceDetectionModel", + "azure.ai.projects.models.VoiceEndOfUtteranceThresholdLevel": "Azure.AI.Projects.VoiceEndOfUtteranceThresholdLevel", + "azure.ai.projects.models.VoiceAgentEchoCancellationReferenceSource": "Azure.AI.Projects.VoiceAgentEchoCancellationReferenceSource", + "azure.ai.projects.models.VoiceInputTranscriptionModel": "Azure.AI.Projects.VoiceInputTranscriptionModel", + "azure.ai.projects.models.VoiceAudioTimestampType": "Azure.AI.Projects.VoiceAudioTimestampType", + "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.VoiceAvatarType": "Azure.AI.Projects.VoiceAvatarType", + "azure.ai.projects.models.VoiceAvatarOutputProtocol": "Azure.AI.Projects.VoiceAvatarOutputProtocol", + "azure.ai.projects.models.VoiceAgentToolResponseScheduling": "Azure.AI.Projects.VoiceAgentToolResponseScheduling", + "azure.ai.projects.models.VoiceSystemToolName": "Azure.AI.Projects.VoiceSystemToolName", "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", @@ -440,6 +637,15 @@ "azure.ai.projects.models.VersionIndicatorType": "Azure.AI.Projects.VersionIndicatorType", "azure.ai.projects.models.AgentSessionStatus": "Azure.AI.Projects.AgentSessionStatus", "azure.ai.projects.models.SessionLogEventType": "Azure.AI.Projects.SessionLogEventType", + "azure.ai.projects.models.VoiceAgentWebSocketSubprotocol": "Azure.AI.Projects.VoiceAgentWebSocketSubprotocol", + "azure.ai.projects.models.VoiceConversationStatus": "Azure.AI.Projects.VoiceConversationStatus", + "azure.ai.projects.models.VoiceConversationItemType": "Azure.AI.Projects.VoiceConversationItemType", + "azure.ai.projects.models.RealtimeMcpErrorType": "OpenAI.RealtimeMcpErrorType", + "azure.ai.projects.models.RealtimeConversationItemMessageType": "OpenAI.RealtimeConversationItemMessageType", + "azure.ai.projects.models.RealtimeAudioFormatsType": "OpenAI.RealtimeAudioFormatsType", + "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.EvaluationRuleActionType": "Azure.AI.Projects.EvaluationRuleActionType", "azure.ai.projects.models.EvaluationRuleEventType": "Azure.AI.Projects.EvaluationRuleEventType", "azure.ai.projects.models.ConnectionType": "Azure.AI.Projects.ConnectionType", @@ -449,8 +655,16 @@ "azure.ai.projects.models.IndexType": "Azure.AI.Projects.IndexType", "azure.ai.projects.models.ToolboxToolType": "Azure.AI.Projects.ToolboxToolType", "azure.ai.projects.models.MemoryStoreUpdateStatus": "Azure.AI.Projects.MemoryStoreUpdateStatus", + "azure.ai.projects.models.RealtimeClientEventType": "OpenAI.RealtimeClientEventType", + "azure.ai.projects.models.RealtimeConversationItemType": "OpenAI.RealtimeConversationItemType", + "azure.ai.projects.models.RealtimeReasoningEffort": "OpenAI.RealtimeReasoningEffort", + "azure.ai.projects.models.VoiceAgentAnimationOutputType": "Azure.AI.Projects.VoiceAgentAnimationOutputType", + "azure.ai.projects.models.RealtimeServerEventType": "OpenAI.RealtimeServerEventType", + "azure.ai.projects.models.CreateTranscriptionResponseJsonUsageType": "OpenAI.CreateTranscriptionResponseJsonUsageType", "azure.ai.projects.operations.AgentsOperations.get": "Azure.AI.Projects.Agents.getAgent", "azure.ai.projects.aio.operations.AgentsOperations.get": "Azure.AI.Projects.Agents.getAgent", + "azure.ai.projects.operations.AgentsOperations.generate_agent": "Azure.AI.Projects.Agents.generateAgent", + "azure.ai.projects.aio.operations.AgentsOperations.generate_agent": "Azure.AI.Projects.Agents.generateAgent", "azure.ai.projects.operations.AgentsOperations.delete": "Azure.AI.Projects.Agents.deleteAgent", "azure.ai.projects.aio.operations.AgentsOperations.delete": "Azure.AI.Projects.Agents.deleteAgent", "azure.ai.projects.operations.AgentsOperations.list": "Azure.AI.Projects.Agents.listAgents", @@ -493,6 +707,32 @@ "azure.ai.projects.aio.operations.AgentsOperations.list_session_files": "Azure.AI.Projects.AgentSessionFiles.listSessionFiles", "azure.ai.projects.operations.AgentsOperations.delete_session_file": "Azure.AI.Projects.AgentSessionFiles.deleteSessionFile", "azure.ai.projects.aio.operations.AgentsOperations.delete_session_file": "Azure.AI.Projects.AgentSessionFiles.deleteSessionFile", + "azure.ai.projects.operations.VoiceAgentWebSocketOperations.connect_voice_agent": "Azure.AI.Projects.VoiceAgentWebSocket.connectVoiceAgent", + "azure.ai.projects.aio.operations.VoiceAgentWebSocketOperations.connect_voice_agent": "Azure.AI.Projects.VoiceAgentWebSocket.connectVoiceAgent", + "azure.ai.projects.operations.AgentEndpointConversationsOperations.list_agent_conversations": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversations", + "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.list_agent_conversations": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversations", + "azure.ai.projects.operations.AgentEndpointConversationsOperations.get_agent_conversation": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversation", + "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversation", + "azure.ai.projects.operations.AgentEndpointConversationsOperations.delete_agent_conversation": "Azure.AI.Projects.AgentEndpointConversations.deleteAgentConversation", + "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.delete_agent_conversation": "Azure.AI.Projects.AgentEndpointConversations.deleteAgentConversation", + "azure.ai.projects.operations.AgentEndpointConversationsOperations.list_agent_conversation_responses": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversationResponses", + "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.list_agent_conversation_responses": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversationResponses", + "azure.ai.projects.operations.AgentEndpointConversationsOperations.get_agent_conversation_response": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationResponse", + "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_response": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationResponse", + "azure.ai.projects.operations.AgentEndpointConversationsOperations.list_agent_conversation_response_items": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversationResponseItems", + "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.list_agent_conversation_response_items": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversationResponseItems", + "azure.ai.projects.operations.AgentEndpointConversationsOperations.list_agent_conversation_items": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversationItems", + "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.list_agent_conversation_items": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversationItems", + "azure.ai.projects.operations.AgentEndpointConversationsOperations.get_agent_conversation_item": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItem", + "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_item": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItem", + "azure.ai.projects.operations.AgentEndpointConversationsOperations.get_agent_conversation_item_audio": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItemAudio", + "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_item_audio": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItemAudio", + "azure.ai.projects.operations.AgentEndpointConversationsOperations.get_agent_conversation_item_audio_content": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItemAudioContent", + "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_item_audio_content": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItemAudioContent", + "azure.ai.projects.operations.AgentEndpointConversationsOperations.get_agent_conversation_audio": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationAudio", + "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_audio": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationAudio", + "azure.ai.projects.operations.AgentEndpointConversationsOperations.get_agent_conversation_audio_content": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationAudioContent", + "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_audio_content": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationAudioContent", "azure.ai.projects.operations.EvaluationRulesOperations.get": "Azure.AI.Projects.EvaluationRules.get", "azure.ai.projects.aio.operations.EvaluationRulesOperations.get": "Azure.AI.Projects.EvaluationRules.get", "azure.ai.projects.operations.EvaluationRulesOperations.delete": "Azure.AI.Projects.EvaluationRules.delete", @@ -548,5 +788,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": "856df4c68403" + "CrossLanguageVersion": "0ee3fce61394" } \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py index 60c172ebfdd2..29fc344d6a6a 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py @@ -17,6 +17,7 @@ from ._configuration import AIProjectClientConfiguration from ._utils.serialization import Deserializer, Serializer from .operations import ( + AgentEndpointConversationsOperations, AgentsOperations, BetaOperations, ConnectionsOperations, @@ -25,6 +26,7 @@ EvaluationRulesOperations, IndexesOperations, ToolboxesOperations, + VoiceAgentWebSocketOperations, ) if sys.version_info >= (3, 11): @@ -36,13 +38,18 @@ from azure.core.credentials import TokenCredential -class AIProjectClient: # pylint: disable=too-many-instance-attributes +class AIProjectClient: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """AIProjectClient. :ivar beta: BetaOperations operations :vartype beta: azure.ai.projects.operations.BetaOperations :ivar agents: AgentsOperations operations :vartype agents: azure.ai.projects.operations.AgentsOperations + :ivar voice_agent_web_socket: VoiceAgentWebSocketOperations operations + :vartype voice_agent_web_socket: azure.ai.projects.operations.VoiceAgentWebSocketOperations + :ivar agent_endpoint_conversations: AgentEndpointConversationsOperations operations + :vartype agent_endpoint_conversations: + azure.ai.projects.operations.AgentEndpointConversationsOperations :ivar evaluation_rules: EvaluationRulesOperations operations :vartype evaluation_rules: azure.ai.projects.operations.EvaluationRulesOperations :ivar connections: ConnectionsOperations operations @@ -106,6 +113,12 @@ def __init__( self._serialize.client_side_validation = False self.beta = BetaOperations(self._client, self._config, self._serialize, self._deserialize) self.agents = AgentsOperations(self._client, self._config, self._serialize, self._deserialize) + self.voice_agent_web_socket = VoiceAgentWebSocketOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.agent_endpoint_conversations = AgentEndpointConversationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.evaluation_rules = EvaluationRulesOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_configuration.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_configuration.py index dbc21038f880..71772d698792 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_configuration.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_configuration.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -16,7 +17,7 @@ from azure.core.credentials import TokenCredential -class AIProjectClientConfiguration: # pylint: disable=too-many-instance-attributes +class AIProjectClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """Configuration for AIProjectClient. Note that all parameters used to create this instance are saved as instance 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 abad0c3afee4..d11228d5304f 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_unions.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_unions.py @@ -6,9 +6,45 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING, Union +from typing import Literal, TYPE_CHECKING, Union if TYPE_CHECKING: from . import models as _models Filters = Union["_models.ComparisonFilter", "_models.CompoundFilter"] RoutineRunStatus = str +VoiceAgentToolChoice = Union[str, "_models.ToolChoiceOptions", "_models.ToolChoiceFunction", "_models.ToolChoiceMCP"] +VoiceAgentTurnDetection = Union[ + "_models.VoiceServerVadTurnDetection", + "_models.VoiceAgentSemanticVadTurnDetection", + "_models.VoiceAzureSemanticVadTurnDetection", + "_models.VoiceAzureSemanticVadEnTurnDetection", + "_models.VoiceAzureSemanticVadMultilingualTurnDetection", +] +VoiceAgentMaxOutputTokens = Union[int, Literal["inf"]] +VoiceAgentInterimResponse = Union[ + "_models.VoiceAgentStaticInterimResponseConfig", "_models.VoiceAgentLlmInterimResponseConfig" +] +VoiceAgentRequestConversationItem = Union[ + "_models.RealtimeConversationItemMessageSystem", + "_models.RealtimeConversationItemMessageUser", + "_models.RealtimeConversationItemMessageAssistant", + "_models.RealtimeConversationItemFunctionCall", + "_models.RealtimeConversationItemFunctionCallOutput", +] +VoiceAgentCreateConversationItem = Union[ + "_unions.VoiceAgentRequestConversationItem", "_models.RealtimeMCPApprovalResponse" +] +VoiceAgentResponseMessageItem = Union[ + "_models.RealtimeConversationItemMessageSystem", + "_models.RealtimeConversationItemMessageUser", + "_models.RealtimeConversationItemMessageAssistant", +] +VoiceAgentResponseItem = Union[ + "_unions.VoiceAgentResponseMessageItem", + "_models.VoiceFunctionCallItem", + "_models.VoiceFunctionCallOutputItem", + "_models.VoiceMcpListToolsItem", + "_models.VoiceMcpCallItem", + "_models.VoiceMcpApprovalRequestItem", + "_models.VoiceMcpApprovalResponseItem", +] diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/model_base.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/model_base.py index a79d3782e99c..88aaf1823543 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/model_base.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/model_base.py @@ -158,7 +158,15 @@ def _is_readonly(p): class SdkJSONEncoder(JSONEncoder): - """A JSON encoder that's capable of serializing datetime objects and bytes.""" + """A JSON encoder that's capable of serializing datetime objects and bytes. + + :param args: Additional positional arguments passed to the base ``JSONEncoder``. + :type args: typing.Any + :keyword exclude_readonly: Whether to exclude readonly properties. Defaults to False. + :paramtype exclude_readonly: bool + :keyword format: The format to use for serialization. Defaults to None. + :paramtype format: typing.Optional[str] + """ def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): super().__init__(*args, **kwargs) @@ -342,6 +350,12 @@ def _deserialize_int_as_str(attr): return int(attr) +def _deserialize_bool_as_str(attr): + if isinstance(attr, bool): + return attr + return attr.lower() == "true" + + _DESERIALIZE_MAPPING = { datetime: _deserialize_datetime, date: _deserialize_date, @@ -369,6 +383,8 @@ def _deserialize_int_as_str(attr): def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): if annotation is int and rf and rf._format == "str": return _deserialize_int_as_str + if annotation is bool and rf and rf._format == "str": + return _deserialize_bool_as_str if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) if rf and rf._format: @@ -458,21 +474,21 @@ def __ne__(self, other: typing.Any) -> bool: def keys(self) -> typing.KeysView[str]: """ - :returns: a set-like object providing a view on D's keys + :returns: a set-like object providing a view on the mapping's keys :rtype: ~typing.KeysView """ return self._data.keys() def values(self) -> typing.ValuesView[typing.Any]: """ - :returns: an object providing a view on D's values + :returns: an object providing a view on the mapping's values :rtype: ~typing.ValuesView """ return self._data.values() def items(self) -> typing.ItemsView[str, typing.Any]: """ - :returns: set-like object providing a view on D's items + :returns: a set-like object providing a view on the mapping's items :rtype: ~typing.ItemsView """ return self._data.items() @@ -482,7 +498,7 @@ def get(self, key: str, default: typing.Any = None) -> typing.Any: Get the value for key if key is in the dictionary, else default. :param str key: The key to look up. :param any default: The value to return if key is not in the dictionary. Defaults to None - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ try: @@ -517,19 +533,19 @@ def popitem(self) -> tuple[str, typing.Any]: Removes and returns some (key, value) pair :returns: The (key, value) pair. :rtype: tuple - :raises KeyError: if D is empty. + :raises KeyError: if the dictionary is empty. """ return self._data.popitem() def clear(self) -> None: """ - Remove all items from D. + Remove all items from the dictionary. """ self._data.clear() def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ """ - Updates D from mapping/iterable E and F. + Update the dictionary from a mapping or an iterable of key-value pairs. :param any args: Either a mapping object or an iterable of key-value pairs. """ self._data.update(*args, **kwargs) @@ -542,10 +558,11 @@ def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: """ - Same as calling D.get(k, d), and setting D[k]=d if k not found + Return the value for key if key is in the dictionary; otherwise set the key to + default and return default. :param str key: The key to look up. :param any default: The value to set if key is not in the dictionary - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ if default is _UNSET: diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/serialization.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/serialization.py index 75906e2eb77f..ae08f9d89f74 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/serialization.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/serialization.py @@ -480,7 +480,11 @@ def _decode_attribute_map_key(key): class Serializer: # pylint: disable=too-many-public-methods - """Request object model serializer.""" + """Request object model serializer. + + :param classes: Mapping of model names to model types, used to resolve models during serialization. + :type classes: typing.Optional[typing.Mapping[str, type]] + """ basic_types = {str: "str", int: "int", bool: "bool", float: "float"} diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py index 967ac1cf48d2..bf15e25b782f 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py @@ -17,6 +17,7 @@ from .._utils.serialization import Deserializer, Serializer from ._configuration import AIProjectClientConfiguration from .operations import ( + AgentEndpointConversationsOperations, AgentsOperations, BetaOperations, ConnectionsOperations, @@ -25,6 +26,7 @@ EvaluationRulesOperations, IndexesOperations, ToolboxesOperations, + VoiceAgentWebSocketOperations, ) if sys.version_info >= (3, 11): @@ -36,13 +38,18 @@ from azure.core.credentials_async import AsyncTokenCredential -class AIProjectClient: # pylint: disable=too-many-instance-attributes +class AIProjectClient: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """AIProjectClient. :ivar beta: BetaOperations operations :vartype beta: azure.ai.projects.aio.operations.BetaOperations :ivar agents: AgentsOperations operations :vartype agents: azure.ai.projects.aio.operations.AgentsOperations + :ivar voice_agent_web_socket: VoiceAgentWebSocketOperations operations + :vartype voice_agent_web_socket: azure.ai.projects.aio.operations.VoiceAgentWebSocketOperations + :ivar agent_endpoint_conversations: AgentEndpointConversationsOperations operations + :vartype agent_endpoint_conversations: + azure.ai.projects.aio.operations.AgentEndpointConversationsOperations :ivar evaluation_rules: EvaluationRulesOperations operations :vartype evaluation_rules: azure.ai.projects.aio.operations.EvaluationRulesOperations :ivar connections: ConnectionsOperations operations @@ -106,6 +113,12 @@ def __init__( self._serialize.client_side_validation = False self.beta = BetaOperations(self._client, self._config, self._serialize, self._deserialize) self.agents = AgentsOperations(self._client, self._config, self._serialize, self._deserialize) + self.voice_agent_web_socket = VoiceAgentWebSocketOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.agent_endpoint_conversations = AgentEndpointConversationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.evaluation_rules = EvaluationRulesOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_configuration.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_configuration.py index bb5588e5968e..52e5a14d7b8b 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_configuration.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_configuration.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -16,7 +17,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class AIProjectClientConfiguration: # pylint: disable=too-many-instance-attributes +class AIProjectClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """Configuration for AIProjectClient. Note that all parameters used to create this instance are saved as instance diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py index a9b0aa007166..cbe16ebc39d3 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py @@ -28,6 +28,14 @@ ) from ._client import AIProjectClient as AIProjectClientGenerated from .operations import TelemetryOperations +from ._realtime import ( + AsyncRealtime, + AsyncRealtimeConnection, + AsyncRealtimeConnectionManager, + ClientEvent, + ConversationItem, + ServerEvent, +) _OPENAI_TRANSPORT_LOGGER_NAME = "azure.ai.projects.openai_transport" logger = logging.getLogger(__name__) @@ -120,6 +128,18 @@ def __init__( super().__init__(endpoint=endpoint, credential=credential, allow_preview=allow_preview, **kwargs) self.telemetry = TelemetryOperations(self) # type: ignore + self._realtime: Optional[AsyncRealtime] = None + + @property + def realtime(self) -> AsyncRealtime: + """Realtime streaming entry point for voice agents. + + :return: The realtime namespace, exposing ``connect(...)``. + :rtype: ~azure.ai.projects.aio.AsyncRealtime + """ + if self._realtime is None: + self._realtime = AsyncRealtime(self) + return self._realtime def _get_openai_api_key(self, kwargs: dict): """Resolve the API key for the AsyncOpenAI client. @@ -346,7 +366,15 @@ def _log_request_body(self, request: httpx.Request) -> None: _openai_transport_logger.debug("Body: [Content exists]") -__all__: List[str] = ["AIProjectClient"] # Add all objects you want publicly available to users at this package level +__all__: List[str] = [ + "AIProjectClient", + "AsyncRealtime", + "AsyncRealtimeConnection", + "AsyncRealtimeConnectionManager", + "ClientEvent", + "ConversationItem", + "ServerEvent", +] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_realtime.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py similarity index 82% rename from sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_realtime.py rename to sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py index 76d9461d7ae0..7b64d9a2b124 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_realtime.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py @@ -8,11 +8,10 @@ Realtime uses a fundamentally different transport (a persistent WebSocket) than the request/response HTTP surface generated from the service's TypeSpec definition, so it is -hand-written and exposed as the ``VoiceAgentsClient.realtime`` namespace. +hand-written and exposed as the ``AIProjectClient.realtime`` namespace. -The connection ergonomics follow the OpenAI Python realtime client (and this package's -sibling ``azure-ai-voicelive``) so that developers moving between the libraries get a -familiar surface: +The connection ergonomics follow the OpenAI Python realtime client so that developers moving +between the libraries get a familiar surface: * :meth:`AsyncRealtime.connect` returns an async context manager. * Entering the context yields an :class:`AsyncRealtimeConnection`. @@ -20,10 +19,11 @@ sub-namespaces (``session``, ``input_audio_buffer``, ``output_audio_buffer``, ``conversation``, ``response``) for sending strongly-typed outbound client events. -Unlike the private-preview implementation, outbound and inbound events use the generated -``VoiceAgentClientEventXxx``/``VoiceAgentServerEventXxx`` models directly. ``send`` and -``recv`` still accept/return plain ``dict`` objects as a forward-compatible fallback for any -event ``type`` the generated models don't yet know about. +Outbound and inbound events use the generated ``VoiceAgentClientEventXxx``/ +``VoiceAgentServerEventXxx`` models directly where one exists. ``send`` and ``recv`` still +accept/return plain ``dict`` objects as a forward-compatible fallback for any event ``type`` +the generated models don't yet know about (for example ``conversation.created``, which is a +valid event but does not (yet) have a dedicated generated model in this package). ``aiohttp`` is required for this feature and is *not* a hard dependency of the package; it is imported lazily so importing the SDK never fails when it is absent. @@ -32,16 +32,33 @@ import base64 import json -from typing import Any, AsyncIterator, cast, Dict, List, Mapping, Optional, Type, TYPE_CHECKING, Union +from typing import ( + Any, + AsyncIterator, + cast, + Dict, + List, + Mapping, + Optional, + Type, + TYPE_CHECKING, + Union, +) from .. import models as _models +from ..models._enums import _AgentDefinitionOptInKeys +from ..models._patch import _FOUNDRY_FEATURES_HEADER_NAME from .._utils.model_base import Model as _Model, SdkJSONEncoder +# Scoped to just the voice-agent preview opt-in; callers connecting to other preview agent +# kinds through this same route can pass a broader value explicitly via ``foundry_features``. +_VOICE_AGENT_FEATURE_HEADER: str = _AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.value + if TYPE_CHECKING: from aiohttp import ClientSession, ClientWebSocketResponse from azure.core.credentials_async import AsyncTokenCredential - from ._client import VoiceAgentsClient + from ._client import AIProjectClient __all__ = [ @@ -84,10 +101,10 @@ ] # Every server event ``type`` string mapped to its generated model, used to deserialize -# inbound frames into strongly-typed objects. Unrecognized ``type`` values fall back to a -# plain ``dict`` so newly-added service events never break an older client. +# inbound frames into strongly-typed objects. Event types not represented by a dedicated +# generated model in this package (for example ``conversation.created``) are intentionally +# left out here and fall back to a plain ``dict``, as do any newly-added service events. _SERVER_EVENT_TYPES: Dict[str, Type[_Model]] = { - "conversation.created": _models.VoiceAgentServerEventConversationCreated, "conversation.item.added": _models.VoiceAgentServerEventConversationItemAdded, "conversation.item.created": _models.VoiceAgentServerEventConversationItemCreated, "conversation.item.deleted": _models.VoiceAgentServerEventConversationItemDeleted, @@ -106,19 +123,26 @@ ), "conversation.item.retrieved": _models.VoiceAgentServerEventConversationItemRetrieved, "conversation.item.truncated": _models.VoiceAgentServerEventConversationItemTruncated, - "error": _models.VoiceAgentServerEventError, + # Shared OpenAI-style Realtime error event (not voice-agent specific in this package). + "error": _models.RealtimeServerEventError, "input_audio_buffer.cleared": _models.VoiceAgentServerEventInputAudioBufferCleared, "input_audio_buffer.committed": _models.VoiceAgentServerEventInputAudioBufferCommitted, "input_audio_buffer.speech_started": _models.VoiceAgentServerEventInputAudioBufferSpeechStarted, "input_audio_buffer.speech_stopped": _models.VoiceAgentServerEventInputAudioBufferSpeechStopped, - "input_audio_buffer.timeout_triggered": _models.VoiceAgentServerEventInputAudioBufferTimeoutTriggered, + "input_audio_buffer.timeout_triggered": ( + _models.VoiceAgentServerEventInputAudioBufferTimeoutTriggered + ), "mcp_list_tools.completed": _models.VoiceAgentServerEventMcpListToolsCompleted, "mcp_list_tools.failed": _models.VoiceAgentServerEventMcpListToolsFailed, "mcp_list_tools.in_progress": _models.VoiceAgentServerEventMcpListToolsInProgress, "output_audio_buffer.cleared": _models.VoiceAgentServerEventOutputAudioBufferCleared, "rate_limits.updated": _models.VoiceAgentServerEventRateLimitsUpdated, - "response.animation_blendshapes.delta": _models.VoiceAgentServerEventResponseAnimationBlendshapesDelta, - "response.animation_blendshapes.done": _models.VoiceAgentServerEventResponseAnimationBlendshapesDone, + "response.animation_blendshapes.delta": ( + _models.VoiceAgentServerEventResponseAnimationBlendshapesDelta + ), + "response.animation_blendshapes.done": ( + _models.VoiceAgentServerEventResponseAnimationBlendshapesDone + ), "response.animation_viseme.delta": _models.VoiceAgentServerEventResponseAnimationVisemeDelta, "response.animation_viseme.done": _models.VoiceAgentServerEventResponseAnimationVisemeDone, "response.audio_timestamp.delta": _models.VoiceAgentServerEventResponseAudioTimestampDelta, @@ -127,11 +151,12 @@ "response.content_part.done": _models.VoiceAgentServerEventResponseContentPartDone, "response.created": _models.VoiceAgentServerEventResponseCreated, "response.done": _models.VoiceAgentServerEventResponseDone, - "response.file_search_call.completed": _models.VoiceAgentServerEventFileSearchCallCompleted, - "response.file_search_call.in_progress": _models.VoiceAgentServerEventFileSearchCallInProgress, - "response.file_search_call.searching": _models.VoiceAgentServerEventFileSearchCallSearching, - "response.function_call_arguments.delta": _models.VoiceAgentServerEventResponseFunctionCallArgumentsDelta, - "response.function_call_arguments.done": _models.VoiceAgentServerEventResponseFunctionCallArgumentsDone, + "response.function_call_arguments.delta": ( + _models.VoiceAgentServerEventResponseFunctionCallArgumentsDelta + ), + "response.function_call_arguments.done": ( + _models.VoiceAgentServerEventResponseFunctionCallArgumentsDone + ), "response.mcp_call.completed": _models.VoiceAgentServerEventResponseMcpCallCompleted, "response.mcp_call.failed": _models.VoiceAgentServerEventResponseMcpCallFailed, "response.mcp_call.in_progress": _models.VoiceAgentServerEventResponseMcpCallInProgress, @@ -139,31 +164,29 @@ "response.mcp_call_arguments.done": _models.VoiceAgentServerEventResponseMcpCallArgumentsDone, "response.output_audio.delta": _models.VoiceAgentServerEventResponseAudioDelta, "response.output_audio.done": _models.VoiceAgentServerEventResponseAudioDone, - "response.output_audio_transcript.delta": _models.VoiceAgentServerEventResponseAudioTranscriptDelta, - "response.output_audio_transcript.done": _models.VoiceAgentServerEventResponseAudioTranscriptDone, + "response.output_audio_transcript.delta": ( + _models.VoiceAgentServerEventResponseAudioTranscriptDelta + ), + "response.output_audio_transcript.done": ( + _models.VoiceAgentServerEventResponseAudioTranscriptDone + ), "response.output_item.added": _models.VoiceAgentServerEventResponseOutputItemAdded, "response.output_item.done": _models.VoiceAgentServerEventResponseOutputItemDone, "response.output_text.delta": _models.VoiceAgentServerEventResponseTextDelta, "response.output_text.done": _models.VoiceAgentServerEventResponseTextDone, "response.video.delta": _models.VoiceAgentServerEventResponseVideoDelta, - "response.web_search_call.completed": _models.VoiceAgentServerEventWebSearchCallCompleted, - "response.web_search_call.in_progress": _models.VoiceAgentServerEventWebSearchCallInProgress, - "response.web_search_call.searching": _models.VoiceAgentServerEventWebSearchCallSearching, "session.avatar.connecting": _models.VoiceAgentServerEventSessionAvatarConnecting, "session.avatar.switch_to_idle": _models.VoiceAgentServerEventSessionAvatarSwitchToIdle, "session.avatar.switch_to_speaking": _models.VoiceAgentServerEventSessionAvatarSwitchToSpeaking, "session.created": _models.VoiceAgentServerEventSessionCreated, - "session.handoff.aborted": _models.VoiceAgentServerEventSessionHandoffAborted, - "session.handoff.completed": _models.VoiceAgentServerEventSessionHandoffCompleted, - "session.handoff.started": _models.VoiceAgentServerEventSessionHandoffStarted, "session.updated": _models.VoiceAgentServerEventSessionUpdated, "warning": _models.VoiceAgentServerEventWarning, } # Every generated server event model, for consumers that want a precise return type. ServerEvent = Union[ + _models.RealtimeServerEventError, _models.RealtimeServerEventResponseContentPartAdded, - _models.VoiceAgentServerEventConversationCreated, _models.VoiceAgentServerEventConversationItemAdded, _models.VoiceAgentServerEventConversationItemCreated, _models.VoiceAgentServerEventConversationItemDeleted, @@ -174,10 +197,6 @@ _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment, _models.VoiceAgentServerEventConversationItemRetrieved, _models.VoiceAgentServerEventConversationItemTruncated, - _models.VoiceAgentServerEventError, - _models.VoiceAgentServerEventFileSearchCallCompleted, - _models.VoiceAgentServerEventFileSearchCallInProgress, - _models.VoiceAgentServerEventFileSearchCallSearching, _models.VoiceAgentServerEventInputAudioBufferCleared, _models.VoiceAgentServerEventInputAudioBufferCommitted, _models.VoiceAgentServerEventInputAudioBufferSpeechStarted, @@ -217,14 +236,8 @@ _models.VoiceAgentServerEventSessionAvatarSwitchToIdle, _models.VoiceAgentServerEventSessionAvatarSwitchToSpeaking, _models.VoiceAgentServerEventSessionCreated, - _models.VoiceAgentServerEventSessionHandoffAborted, - _models.VoiceAgentServerEventSessionHandoffCompleted, - _models.VoiceAgentServerEventSessionHandoffStarted, _models.VoiceAgentServerEventSessionUpdated, _models.VoiceAgentServerEventWarning, - _models.VoiceAgentServerEventWebSearchCallCompleted, - _models.VoiceAgentServerEventWebSearchCallInProgress, - _models.VoiceAgentServerEventWebSearchCallSearching, Mapping[str, Any], ] @@ -245,7 +258,7 @@ def _to_ws_url(endpoint: str, agent_name: str) -> str: return f"{base}/agents/{agent_name}/endpoint/protocols/voice" -class _BaseResource: +class _BaseResource: # pylint: disable=too-few-public-methods """Base helper that forwards typed helpers to the parent connection.""" def __init__(self, connection: "AsyncRealtimeConnection") -> None: @@ -267,7 +280,8 @@ async def update( """Update the realtime session configuration. :keyword session: The session configuration to apply. - :paramtype session: ~azure.ai.voiceagents.models.VoiceAgentSessionUpdateConfig or Mapping[str, Any] + :paramtype session: ~azure.ai.projects.models.VoiceAgentSessionUpdateConfig or + Mapping[str, Any] :keyword event_id: Optional client-generated ID used to identify this event. :paramtype event_id: str or None """ @@ -340,7 +354,7 @@ async def clear(self, *, event_id: Optional[str] = None) -> None: ) -class OutputAudioBufferResource(_BaseResource): +class OutputAudioBufferResource(_BaseResource): # pylint: disable=too-few-public-methods """Send ``output_audio_buffer.*`` client events.""" async def clear(self, *, event_id: Optional[str] = None) -> None: @@ -369,12 +383,12 @@ async def create( """Insert an item into the conversation. :keyword item: The conversation item to create. - :paramtype item: ~azure.ai.voiceagents.models.RealtimeConversationItemMessageSystem or - ~azure.ai.voiceagents.models.RealtimeConversationItemMessageUser or - ~azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistant or - ~azure.ai.voiceagents.models.RealtimeConversationItemFunctionCall or - ~azure.ai.voiceagents.models.RealtimeConversationItemFunctionCallOutput or - ~azure.ai.voiceagents.models.RealtimeMCPApprovalResponse or Mapping[str, Any] + :paramtype item: ~azure.ai.projects.models.RealtimeConversationItemMessageSystem or + ~azure.ai.projects.models.RealtimeConversationItemMessageUser or + ~azure.ai.projects.models.RealtimeConversationItemMessageAssistant or + ~azure.ai.projects.models.RealtimeConversationItemFunctionCall or + ~azure.ai.projects.models.RealtimeConversationItemFunctionCallOutput or + ~azure.ai.projects.models.RealtimeMCPApprovalResponse or Mapping[str, Any] :keyword previous_item_id: The ID of the preceding item after which the new item will be inserted. Default value is None. :paramtype previous_item_id: str or None @@ -399,7 +413,9 @@ async def delete(self, *, item_id: str, event_id: Optional[str] = None) -> None: """ await self._send( _models.VoiceAgentClientEventConversationItemDelete( - type=_models.RealtimeClientEventType.CONVERSATION_ITEM_DELETE, item_id=item_id, event_id=event_id + type=_models.RealtimeClientEventType.CONVERSATION_ITEM_DELETE, + item_id=item_id, + event_id=event_id, ) ) @@ -412,7 +428,9 @@ async def retrieve(self, *, item_id: str, event_id: Optional[str] = None) -> Non """ await self._send( _models.VoiceAgentClientEventConversationItemRetrieve( - type=_models.RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE, item_id=item_id, event_id=event_id + type=_models.RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE, + item_id=item_id, + event_id=event_id, ) ) @@ -438,7 +456,7 @@ async def truncate( ) -class ConversationResource(_BaseResource): +class ConversationResource(_BaseResource): # pylint: disable=too-few-public-methods """Send ``conversation.*`` client events.""" def __init__(self, connection: "AsyncRealtimeConnection") -> None: @@ -452,13 +470,16 @@ class ResponseResource(_BaseResource): async def create( self, *, - response: Optional[Union["_models.VoiceAgentResponseCreateParams", Mapping[str, Any]]] = None, + response: Optional[ + Union["_models.VoiceAgentResponseCreateParams", Mapping[str, Any]] + ] = None, event_id: Optional[str] = None, ) -> None: """Ask the model to generate a response. :keyword response: Optional per-response overrides. Default value is None. - :paramtype response: ~azure.ai.voiceagents.models.VoiceAgentResponseCreateParams or Mapping[str, Any] or None + :paramtype response: ~azure.ai.projects.models.VoiceAgentResponseCreateParams or + Mapping[str, Any] or None :keyword event_id: Optional client-generated ID used to identify this event. :paramtype event_id: str or None """ @@ -470,7 +491,9 @@ async def create( ) ) - async def cancel(self, *, response_id: Optional[str] = None, event_id: Optional[str] = None) -> None: + async def cancel( + self, *, response_id: Optional[str] = None, event_id: Optional[str] = None + ) -> None: """Cancel an in-progress response. :keyword response_id: The ID of the response to cancel, if targeting a specific one. @@ -481,7 +504,9 @@ async def cancel(self, *, response_id: Optional[str] = None, event_id: Optional[ """ await self._send( _models.VoiceAgentClientEventResponseCancel( - type=_models.RealtimeClientEventType.RESPONSE_CANCEL, response_id=response_id, event_id=event_id + type=_models.RealtimeClientEventType.RESPONSE_CANCEL, + response_id=response_id, + event_id=event_id, ) ) @@ -493,7 +518,6 @@ class AsyncRealtimeConnection: # pylint: disable=too-many-instance-attributes sub-namespaces to send strongly-typed client events:: async with client.realtime.connect(agent_name="my-agent") as conn: - await conn.session.update(session={"modalities": ["audio", "text"]}) await conn.input_audio_buffer.append(audio=chunk) await conn.input_audio_buffer.commit() await conn.response.create() @@ -535,7 +559,7 @@ async def recv(self) -> ServerEvent: generated model are returned as a plain ``dict`` for forward compatibility. :return: The parsed server event. - :rtype: ~azure.ai.voiceagents.aio.ServerEvent + :rtype: ~azure.ai.projects.aio.ServerEvent :raises ConnectionResetError: If the connection was closed by the server. """ import aiohttp # pylint: disable=import-outside-toplevel @@ -543,7 +567,11 @@ async def recv(self) -> ServerEvent: msg = await self._connection.receive() while msg.type in (aiohttp.WSMsgType.PING, aiohttp.WSMsgType.PONG): msg = await self._connection.receive() - if msg.type in (aiohttp.WSMsgType.CLOSE, aiohttp.WSMsgType.CLOSING, aiohttp.WSMsgType.CLOSED): + if msg.type in ( + aiohttp.WSMsgType.CLOSE, + aiohttp.WSMsgType.CLOSING, + aiohttp.WSMsgType.CLOSED, + ): raise ConnectionResetError("The realtime connection was closed.") if msg.type == aiohttp.WSMsgType.ERROR: raise ConnectionResetError( @@ -563,7 +591,7 @@ async def send(self, event: ClientEvent) -> None: """Send a client event over the connection. :param event: A strongly-typed client event, a ready-made mapping, or a raw JSON string. - :type event: ~azure.ai.voiceagents.aio.ClientEvent or str + :type event: ~azure.ai.projects.aio.ClientEvent or str """ payload = event if isinstance(event, str) else json.dumps(event, cls=SdkJSONEncoder) await self._connection.send_str(payload) @@ -595,7 +623,7 @@ def __init__( # pylint: disable=too-many-arguments credential_scopes: List[str], api_version: str, agent_name: str, - foundry_features: Union[str, "_models.AgentDefinitionOptInKeys"], + foundry_features: str, agent_session_id: Optional[str] = None, agent_version_override: Optional[str] = None, structured_inputs: Optional[str] = None, @@ -626,7 +654,7 @@ async def enter(self) -> AsyncRealtimeConnection: # pylint: disable=too-many-lo """Open the connection. :return: The live realtime connection. - :rtype: ~azure.ai.voiceagents.aio.AsyncRealtimeConnection + :rtype: ~azure.ai.projects.aio.AsyncRealtimeConnection """ try: import aiohttp # pylint: disable=import-outside-toplevel @@ -639,7 +667,9 @@ async def enter(self) -> AsyncRealtimeConnection: # pylint: disable=too-many-lo # escape hatch used to reach a specific data-plane host/path directly. url = self._connection_url or _to_ws_url(self._endpoint, self._agent_name) if not url.startswith("wss://"): - raise ValueError("The realtime WebSocket URL must use wss:// to protect credentials in transit.") + raise ValueError( + "The realtime WebSocket URL must use wss:// to protect credentials in transit." + ) params: Dict[str, str] = {"api-version": self._api_version} if self._agent_session_id is not None: @@ -649,13 +679,9 @@ async def enter(self) -> AsyncRealtimeConnection: # pylint: disable=too-many-lo params.update(self._extra_query) token = await self._credential.get_token(*self._credential_scopes) - # Coerce enum members (e.g. ``AgentDefinitionOptInKeys``) to their string value so the - # header carries ``VoiceAgents=V1Preview`` rather than the enum's ``repr``/``str`` form, - # which the gateway rejects with a 403 during the WebSocket handshake. - foundry_features = getattr(self._foundry_features, "value", self._foundry_features) headers: Dict[str, str] = { "Authorization": f"Bearer {token.token}", - "Foundry-Features": str(foundry_features), + _FOUNDRY_FEATURES_HEADER_NAME: self._foundry_features, "Sec-WebSocket-Protocol": "realtime", } if self._structured_inputs is not None: @@ -664,11 +690,15 @@ async def enter(self) -> AsyncRealtimeConnection: # pylint: disable=too-many-lo session = aiohttp.ClientSession() try: - connection = await session.ws_connect(url, headers=headers, params=params, **self._kwargs) + connection = await session.ws_connect( + url, headers=headers, params=params, **self._kwargs + ) except BaseException: await session.close() raise - self._connection = AsyncRealtimeConnection(cast("ClientWebSocketResponse", connection), session) + self._connection = AsyncRealtimeConnection( + cast("ClientWebSocketResponse", connection), session + ) return self._connection async def __aexit__(self, *exc_details: Any) -> None: @@ -677,18 +707,17 @@ async def __aexit__(self, *exc_details: Any) -> None: self._connection = None -class AsyncRealtime: +class AsyncRealtime: # pylint: disable=too-few-public-methods """Realtime streaming entry point, exposed as ``client.realtime``. Follows the OpenAI Python realtime surface: obtain it from the HTTP client and open a connection with :meth:`connect`:: - from azure.ai.voiceagents.aio import VoiceAgentsClient + from azure.ai.projects.aio import AIProjectClient from azure.identity.aio import DefaultAzureCredential - client = VoiceAgentsClient(endpoint, DefaultAzureCredential()) + client = AIProjectClient(endpoint, DefaultAzureCredential()) async with client.realtime.connect(agent_name="my-agent") as conn: - await conn.session.update(session={"modalities": ["audio", "text"]}) await conn.input_audio_buffer.append(audio=chunk) await conn.input_audio_buffer.commit() await conn.response.create() @@ -698,19 +727,17 @@ class AsyncRealtime: :param client: The HTTP client whose endpoint and credential are reused for the realtime handshake. - :type client: ~azure.ai.voiceagents.aio.VoiceAgentsClient + :type client: ~azure.ai.projects.aio.AIProjectClient """ - def __init__(self, client: "VoiceAgentsClient") -> None: + def __init__(self, client: "AIProjectClient") -> None: self._config = client._config # pylint: disable=protected-access def connect( # pylint: disable=too-many-arguments self, *, agent_name: str, - foundry_features: Union[ - str, "_models.AgentDefinitionOptInKeys" - ] = _models.AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW, + foundry_features: str = _VOICE_AGENT_FEATURE_HEADER, agent_session_id: Optional[str] = None, agent_version_override: Optional[str] = None, structured_inputs: Optional[str] = None, @@ -724,9 +751,10 @@ def connect( # pylint: disable=too-many-arguments """Open a realtime WebSocket connection to a voice agent. :keyword str agent_name: The name of the voice agent to connect to. - :keyword foundry_features: Preview opt-in value for the ``Foundry-Features`` header. - Default value is ``AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW``. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.AgentDefinitionOptInKeys + :keyword foundry_features: Preview opt-in value(s) for the ``Foundry-Features`` header. + Defaults to ``VoiceAgents=V1Preview``. Pass a comma-separated value to opt in to + additional preview features on the same request. + :paramtype foundry_features: str :keyword agent_session_id: An optional identifier used to correlate the voice session. Default value is None. :paramtype agent_session_id: str or None @@ -750,7 +778,7 @@ def connect( # pylint: disable=too-many-arguments :keyword extra_headers: Additional headers for the handshake. :paramtype extra_headers: Mapping[str, str] or None :return: An async context manager yielding an :class:`AsyncRealtimeConnection`. - :rtype: ~azure.ai.voiceagents.aio.AsyncRealtimeConnectionManager + :rtype: ~azure.ai.projects.aio.AsyncRealtimeConnectionManager """ return AsyncRealtimeConnectionManager( endpoint=self._config.endpoint, diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/__init__.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/__init__.py index d6cf67b4d8cf..fb5ec672ba20 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/__init__.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/__init__.py @@ -14,6 +14,8 @@ from ._operations import BetaOperations # type: ignore from ._operations import AgentsOperations # type: ignore +from ._operations import VoiceAgentWebSocketOperations # type: ignore +from ._operations import AgentEndpointConversationsOperations # type: ignore from ._operations import EvaluationRulesOperations # type: ignore from ._operations import ConnectionsOperations # type: ignore from ._operations import DatasetsOperations # type: ignore @@ -28,6 +30,8 @@ __all__ = [ "BetaOperations", "AgentsOperations", + "VoiceAgentWebSocketOperations", + "AgentEndpointConversationsOperations", "EvaluationRulesOperations", "ConnectionsOperations", "DatasetsOperations", 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 fc836a471ebe..28d8e51a6f0e 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 @@ -32,11 +32,23 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict -from ... import models as _models +from ... import models as _models, types as _types from ..._utils.model_base import Model as _Model, SdkJSONEncoder, _deserialize, _failsafe_deserialize from ..._utils.serialization import Deserializer, Serializer from ..._utils.utils import prepare_multipart_form_data from ...operations._operations import ( + build_agent_endpoint_conversations_delete_agent_conversation_request, + build_agent_endpoint_conversations_get_agent_conversation_audio_content_request, + build_agent_endpoint_conversations_get_agent_conversation_audio_request, + build_agent_endpoint_conversations_get_agent_conversation_item_audio_content_request, + build_agent_endpoint_conversations_get_agent_conversation_item_audio_request, + build_agent_endpoint_conversations_get_agent_conversation_item_request, + build_agent_endpoint_conversations_get_agent_conversation_request, + build_agent_endpoint_conversations_get_agent_conversation_response_request, + build_agent_endpoint_conversations_list_agent_conversation_items_request, + build_agent_endpoint_conversations_list_agent_conversation_response_items_request, + build_agent_endpoint_conversations_list_agent_conversation_responses_request, + build_agent_endpoint_conversations_list_agent_conversations_request, build_agents_create_session_request, build_agents_create_version_from_code_request, build_agents_create_version_from_manifest_request, @@ -49,6 +61,7 @@ build_agents_download_code_request, build_agents_download_session_file_request, build_agents_enable_request, + build_agents_generate_agent_request, build_agents_get_request, build_agents_get_session_log_stream_request, build_agents_get_session_request, @@ -169,6 +182,7 @@ build_toolboxes_list_request, build_toolboxes_list_versions_request, build_toolboxes_update_request, + build_voice_agent_web_socket_connect_voice_agent_request, ) from .._configuration import AIProjectClientConfiguration @@ -179,7 +193,7 @@ List = list -class BetaOperations: # pylint: disable=too-many-instance-attributes +class BetaOperations: # pylint: disable=docstring-missing-param,too-many-instance-attributes """ .. warning:: **DO NOT** instantiate this class directly. @@ -211,7 +225,7 @@ def __init__(self, *args, **kwargs) -> None: self.agents = BetaAgentsOperations(self._client, self._config, self._serialize, self._deserialize) -class AgentsOperations: # pylint: disable=too-many-public-methods +class AgentsOperations: # pylint: disable=docstring-missing-param,too-many-public-methods """ .. warning:: **DO NOT** instantiate this class directly. @@ -295,6 +309,155 @@ async def get(self, agent_name: str, **kwargs: Any) -> _models.AgentDetails: return deserialized # type: ignore + @overload + async def generate_agent( + self, *, kind: Union[str, _models.AgentKind], content_type: str = "application/json", **kwargs: Any + ) -> _models.AgentDetails: + """Generate an agent. + + Generates and creates an agent from kind-specific high-level inputs. The generated definition + remains fully editable through the standard agent versioning operations. + + :keyword kind: The kind of agent to generate. Known values are: "prompt", "hosted", "workflow", + "external", and "voice". Required. + :paramtype kind: str or ~azure.ai.projects.models.AgentKind + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AgentDetails. The AgentDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def generate_agent( + self, body: _types.GenerateAgentRequest, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AgentDetails: + """Generate an agent. + + Generates and creates an agent from kind-specific high-level inputs. The generated definition + remains fully editable through the standard agent versioning operations. + + :param body: Required. + :type body: ~azure.ai.projects.types.GenerateAgentRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AgentDetails. The AgentDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def generate_agent( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AgentDetails: + """Generate an agent. + + Generates and creates an agent from kind-specific high-level inputs. The generated definition + remains fully editable through the standard agent versioning operations. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AgentDetails. The AgentDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def generate_agent( + self, + body: Union[JSON, _types.GenerateAgentRequest, IO[bytes]] = _Unset, + *, + kind: Union[str, _models.AgentKind] = _Unset, + **kwargs: Any + ) -> _models.AgentDetails: + """Generate an agent. + + Generates and creates an agent from kind-specific high-level inputs. The generated definition + remains fully editable through the standard agent versioning operations. + + :param body: Is one of the following types: JSON, GenerateAgentRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.GenerateAgentRequest or IO[bytes] + :keyword kind: The kind of agent to generate. Known values are: "prompt", "hosted", "workflow", + "external", and "voice". Required. + :paramtype kind: str or ~azure.ai.projects.models.AgentKind + :return: AgentDetails. The AgentDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentDetails + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AgentDetails] = kwargs.pop("cls", None) + + if body is _Unset: + if kind is _Unset: + raise TypeError("missing required argument: kind") + body = {"kind": kind} + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_agents_generate_agent_request( + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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.AgentDetails, 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, *, force: Optional[bool] = None, **kwargs: Any @@ -387,7 +550,7 @@ def list( Returns a paged collection of agent resources. :keyword kind: Filter agents by kind. If not provided, all agents are returned. Known values - are: "prompt", "hosted", "workflow", and "external". Default value is None. + are: "prompt", "hosted", "workflow", "external", and "voice". Default value is None. :paramtype kind: str or ~azure.ai.projects.models.AgentKind :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the @@ -493,8 +656,8 @@ async def create_version( * Can contain hyphens in the middle * Must not exceed 63 characters. Required. :type agent_name: str - :keyword definition: The agent definition. This can be a workflow, hosted agent, or a simple - agent definition. Required. + :keyword definition: The agent definition. This can be a prompt, workflow, hosted, external, or + voice agent definition. Required. :paramtype definition: ~azure.ai.projects.models.AgentDefinition :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -522,7 +685,12 @@ async def create_version( @overload async def create_version( - self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: _types.CreateAgentVersionRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentVersionDetails: """Create an agent version. @@ -536,7 +704,7 @@ async def create_version( * Must not exceed 63 characters. Required. :type agent_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateAgentVersionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -574,7 +742,7 @@ async def create_version( async def create_version( self, agent_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateAgentVersionRequest, IO[bytes]] = _Unset, *, definition: _models.AgentDefinition = _Unset, metadata: Optional[dict[str, str]] = None, @@ -594,10 +762,11 @@ async def create_version( * Can contain hyphens in the middle * Must not exceed 63 characters. Required. :type agent_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword definition: The agent definition. This can be a workflow, hosted agent, or a simple - agent definition. Required. + :param body: Is one of the following types: JSON, CreateAgentVersionRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.projects.types.CreateAgentVersionRequest or IO[bytes] + :keyword definition: The agent definition. This can be a prompt, workflow, hosted, external, or + voice agent definition. Required. :paramtype definition: ~azure.ai.projects.models.AgentDefinition :keyword 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 @@ -742,7 +911,12 @@ async def create_version_from_manifest( @overload async def create_version_from_manifest( - self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: _types.CreateAgentVersionFromManifestRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentVersionDetails: """Create an agent version from manifest. @@ -756,7 +930,7 @@ async def create_version_from_manifest( * Must not exceed 63 characters. Required. :type agent_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateAgentVersionFromManifestRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -794,7 +968,7 @@ async def create_version_from_manifest( async def create_version_from_manifest( self, agent_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateAgentVersionFromManifestRequest, IO[bytes]] = _Unset, *, manifest_id: str = _Unset, parameter_values: dict[str, Any] = _Unset, @@ -813,8 +987,9 @@ async def create_version_from_manifest( * Can contain hyphens in the middle * Must not exceed 63 characters. Required. :type agent_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateAgentVersionFromManifestRequest, + IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.CreateAgentVersionFromManifestRequest or IO[bytes] :keyword manifest_id: The manifest ID to import the agent version from. Required. :paramtype manifest_id: str :keyword parameter_values: The inputs to the manifest that will result in a fully materialized @@ -1193,7 +1368,12 @@ async def update_details( @overload async def update_details( - self, agent_name: str, body: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any + self, + agent_name: str, + body: _types.PatchAgentObjectRequest, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any ) -> _models.AgentDetails: """Update an agent endpoint. @@ -1202,7 +1382,7 @@ async def update_details( :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.PatchAgentObjectRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -1235,7 +1415,7 @@ async def update_details( async def update_details( self, agent_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.PatchAgentObjectRequest, IO[bytes]] = _Unset, *, agent_endpoint: Optional[_models.AgentEndpointConfig] = None, agent_card: Optional[_models.AgentCard] = None, @@ -1247,8 +1427,8 @@ async def update_details( :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, PatchAgentObjectRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.PatchAgentObjectRequest or IO[bytes] :keyword agent_endpoint: The endpoint configuration for the agent. Default value is None. :paramtype agent_endpoint: ~azure.ai.projects.models.AgentEndpointConfig :keyword agent_card: Optional agent card for the agent. Default value is None. @@ -1336,14 +1516,19 @@ async def _create_version_from_code( ) -> _models.AgentVersionDetails: ... @overload async def _create_version_from_code( - self, agent_name: str, content: JSON, *, code_zip_sha256: str, **kwargs: Any + self, + agent_name: str, + content: _types._CreateAgentVersionFromCodeContent, + *, + code_zip_sha256: str, + **kwargs: Any ) -> _models.AgentVersionDetails: ... @distributed_trace_async async def _create_version_from_code( self, agent_name: str, - content: Union[_models._models._CreateAgentVersionFromCodeContent, JSON], + content: Union[_models._models._CreateAgentVersionFromCodeContent, _types._CreateAgentVersionFromCodeContent], *, code_zip_sha256: str, **kwargs: Any @@ -1362,9 +1547,10 @@ async def _create_version_from_code( * Can contain hyphens in the middle * Must not exceed 63 characters. Required. :type agent_name: str - :param content: The content multipart request content. Is either a - _CreateAgentVersionFromCodeContent type or a JSON type. Required. - :type content: ~azure.ai.projects.models._models._CreateAgentVersionFromCodeContent or JSON + :param content: The content multipart request content. Is one of the following types: + _CreateAgentVersionFromCodeContent Required. + :type content: ~azure.ai.projects.models._models._CreateAgentVersionFromCodeContent or + ~azure.ai.projects.types._CreateAgentVersionFromCodeContent :keyword code_zip_sha256: SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity verification. Required. :paramtype code_zip_sha256: str @@ -1661,7 +1847,12 @@ async def create_session( @overload async def create_session( - self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: _types.CreateSessionRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentSessionResource: """Create a session. @@ -1672,7 +1863,7 @@ async def create_session( :param agent_name: The name of the agent to create a session for. Required. :type agent_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateSessionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1707,7 +1898,7 @@ async def create_session( async def create_session( self, agent_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateSessionRequest, IO[bytes]] = _Unset, *, version_indicator: _models.VersionIndicator = _Unset, agent_session_id: Optional[str] = None, @@ -1721,8 +1912,8 @@ async def create_session( :param agent_name: The name of the agent to create a session for. Required. :type agent_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateSessionRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.CreateSessionRequest or IO[bytes] :keyword version_indicator: Determines which agent version backs the session. Required. :paramtype version_indicator: ~azure.ai.projects.models.VersionIndicator :keyword agent_session_id: Optional caller-provided session ID. If specified, it must be unique @@ -2187,9 +2378,16 @@ async def get_session_log_stream( return deserialized # type: ignore - @distributed_trace_async + @overload async def upload_session_file( - self, agent_name: str, session_id: str, content: bytes, *, path: str, **kwargs: Any + self, + agent_name: str, + session_id: str, + content: bytes, + *, + path: str, + content_type: str = "application/octet-stream", + **kwargs: Any ) -> _models.SessionFileWriteResult: """Upload a session file. @@ -2205,6 +2403,65 @@ async def upload_session_file( :keyword path: The destination file path within the sandbox, relative to the session home directory. Required. :paramtype path: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/octet-stream". + :paramtype content_type: str + :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.SessionFileWriteResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def upload_session_file( + self, + agent_name: str, + session_id: str, + content: IO[bytes], + *, + path: str, + content_type: str = "application/octet-stream", + **kwargs: Any + ) -> _models.SessionFileWriteResult: + """Upload a session file. + + Uploads binary file content to the specified path in the session sandbox. The service stores + the file relative to the session home directory and rejects payloads larger than 50 MB. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param session_id: The session ID. Required. + :type session_id: str + :param content: Required. + :type content: IO[bytes] + :keyword path: The destination file path within the sandbox, relative to the session home + directory. Required. + :paramtype path: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/octet-stream". + :paramtype content_type: str + :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.SessionFileWriteResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def upload_session_file( + self, agent_name: str, session_id: str, content: Union[bytes, IO[bytes]], *, path: str, **kwargs: Any + ) -> _models.SessionFileWriteResult: + """Upload a session file. + + Uploads binary file content to the specified path in the session sandbox. The service stores + the file relative to the session home directory and rejects payloads larger than 50 MB. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param session_id: The session ID. Required. + :type session_id: str + :param content: Is either a bytes type or a IO[bytes] type. Required. + :type content: bytes or IO[bytes] + :keyword path: The destination file path within the sandbox, relative to the session home + directory. Required. + :paramtype path: str :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping :rtype: ~azure.ai.projects.models.SessionFileWriteResult :raises ~azure.core.exceptions.HttpResponseError: @@ -2220,9 +2477,10 @@ async def upload_session_file( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/octet-stream")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SessionFileWriteResult] = kwargs.pop("cls", None) + content_type = content_type or "application/octet-stream" _content = content _request = build_agents_upload_session_file_request( @@ -2400,80 +2658,1231 @@ def list_session_files( 409: ResourceExistsError, 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(_continuation_token=None): - - _request = build_agents_list_session_files_request( - agent_name=agent_name, - session_id=session_id, - path=path, - 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 + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(_continuation_token=None): + + _request = build_agents_list_session_files_request( + agent_name=agent_name, + session_id=session_id, + path=path, + 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.SessionDirectoryEntry], + deserialized.get("entries", []), + ) + 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 delete_session_file( + self, agent_name: str, session_id: str, *, path: str, recursive: Optional[bool] = None, **kwargs: Any + ) -> None: + """Delete a session file. + + Deletes the specified file or directory from the session sandbox. When ``recursive`` is false, + deleting a non-empty directory returns 409 Conflict. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param session_id: The session ID. Required. + :type session_id: str + :keyword path: The file or directory path to delete, relative to the session home directory. + Required. + :paramtype path: str + :keyword recursive: Whether to recursively delete directory contents. The service defaults to + ``false`` if a value is not specified by the caller. Default value is None. + :paramtype recursive: bool + :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_agents_delete_session_file_request( + agent_name=agent_name, + session_id=session_id, + path=path, + recursive=recursive, + 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 + + +class VoiceAgentWebSocketOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.aio.AIProjectClient`'s + :attr:`voice_agent_web_socket` 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_async + async def connect_voice_agent( + self, + agent_name: str, + *, + agent_session_id: Optional[str] = None, + store: Optional[bool] = None, + agent_version_override: Optional[str] = None, + websocket_subprotocol: Optional[Union[str, _models.VoiceAgentWebSocketSubprotocol]] = None, + structured_inputs: Optional[str] = None, + **kwargs: Any + ) -> None: + """Connect to a voice agent. + + Connects to a voice agent over WebSocket. The client must send an HTTP GET with ``Upgrade: + websocket`` + headers. The optional ``realtime`` subprotocol is the only accepted subprotocol value. + + If the target agent is disabled, the HTTP WebSocket handshake fails before the ``101 Switching + Protocols`` + upgrade. The service returns ``409 Conflict`` using the shared Foundry ``ApiErrorResponse`` + shape with + ``error.code = agent_disabled``. This failure is terminal until the caller enables the agent. + + :param agent_name: The name of the voice agent. Required. + :type agent_name: str + :keyword agent_session_id: An optional identifier used to correlate the voice session. Default + value is None. + :paramtype agent_session_id: str + :keyword store: Whether to persist the conversation created by this WebSocket session. If + omitted, the service honors the + persisted voice agent definition's configured ``store`` value. If supplied, this value + overrides the + definition's ``store`` setting for this session only. Default value is None. + :paramtype store: bool + :keyword agent_version_override: Selects a specific version of the voice agent for this + session. Default value is None. + :paramtype agent_version_override: str + :keyword websocket_subprotocol: The requested WebSocket subprotocol. Omit this header or + request exactly ``realtime``. "realtime" Default value is None. + :paramtype websocket_subprotocol: str or + ~azure.ai.projects.models.VoiceAgentWebSocketSubprotocol + :keyword structured_inputs: A JSON object that maps structured-input names to their values for + this session. Default value is None. + :paramtype structured_inputs: 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_voice_agent_web_socket_connect_voice_agent_request( + agent_name=agent_name, + agent_session_id=agent_session_id, + store=store, + agent_version_override=agent_version_override, + websocket_subprotocol=websocket_subprotocol, + structured_inputs=structured_inputs, + 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 [101]: + 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["Sec-WebSocket-Protocol"] = self._deserialize( + "str", response.headers.get("Sec-WebSocket-Protocol") + ) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + +class AgentEndpointConversationsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.aio.AIProjectClient`'s + :attr:`agent_endpoint_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_agent_conversations( + self, + agent_name: str, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.VoiceConversation"]: + """List voice agent conversations. + + Returns the conversations persisted for the specified voice agent endpoint. Conversations are + present only when the agent definition has ``store = true``. + + :param agent_name: The name of the 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 VoiceConversation + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.VoiceConversation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VoiceConversation]] = 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_agent_endpoint_conversations_list_agent_conversations_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.VoiceConversation], + 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_agent_conversation( + self, agent_name: str, conversation_id: str, **kwargs: Any + ) -> _models.VoiceConversation: + """Get a voice agent conversation. + + Retrieves a single conversation recorded for the specified voice agent endpoint by its id. + Returns ``404`` when the conversation was not persisted (``store = false``) or does not exist. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation to retrieve. Required. + :type conversation_id: str + :return: VoiceConversation. The VoiceConversation is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceConversation + :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.VoiceConversation] = kwargs.pop("cls", None) + + _request = build_agent_endpoint_conversations_get_agent_conversation_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.VoiceConversation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete_agent_conversation(self, agent_name: str, conversation_id: str, **kwargs: Any) -> None: + """Delete a voice agent conversation. + + Deletes a conversation and all of its stored data — responses, items, and any audio (cascade). + This is the customer's explicit data-deletion control for voice conversations. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation to delete. 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_agent_endpoint_conversations_delete_agent_conversation_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_agent_conversation_responses( + 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.VoiceResponse"]: + """List responses in a voice agent conversation. + + Returns a paged collection of the responses (model inference turns) recorded for the specified + conversation. The per-response ``output`` projection may be omitted here; use the + response-items route for the canonical paged output. Returns ``404`` when the conversation was + not persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose responses are listed. 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 VoiceResponse + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.VoiceResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VoiceResponse]] = 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_agent_endpoint_conversations_list_agent_conversation_responses_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.VoiceResponse], + 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_agent_conversation_response( + self, agent_name: str, conversation_id: str, response_id: str, **kwargs: Any + ) -> _models.VoiceResponse: + """Get a voice agent conversation response. + + Retrieves a single response from the specified conversation by its id, including its ``output`` + items, ``usage``, and status. Returns ``404`` when the conversation or response was not + persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the response. Required. + :type conversation_id: str + :param response_id: The id of the response to retrieve. Required. + :type response_id: str + :return: VoiceResponse. The VoiceResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceResponse + :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.VoiceResponse] = kwargs.pop("cls", None) + + _request = build_agent_endpoint_conversations_get_agent_conversation_response_request( + agent_name=agent_name, + conversation_id=conversation_id, + response_id=response_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.VoiceResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_agent_conversation_response_items( + self, + agent_name: str, + conversation_id: str, + response_id: str, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.VoiceConversationItem"]: + """List items produced by a voice agent conversation response. + + Returns a paged collection of the output items produced by a specific response (the response's + output projection). For the complete ordered conversation history — including user input and + client-created tool outputs — use the conversation items route instead. Returns ``404`` when + the conversation or response was not persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the response. Required. + :type conversation_id: str + :param response_id: The id of the response whose output items are listed. Required. + :type response_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 VoiceConversationItem + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.VoiceConversationItem] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VoiceConversationItem]] = 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_agent_endpoint_conversations_list_agent_conversation_response_items_request( + agent_name=agent_name, + conversation_id=conversation_id, + response_id=response_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.VoiceConversationItem], + 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 + def list_agent_conversation_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.VoiceConversationItem"]: + """List items in a voice agent conversation. + + Returns a paged collection of items — the complete ordered conversation history, including user + input, assistant output, and client-created tool outputs (transcripts + tool events). Returns + ``404`` when the conversation was not persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose items are listed. 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 VoiceConversationItem + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.VoiceConversationItem] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VoiceConversationItem]] = 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_agent_endpoint_conversations_list_agent_conversation_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.VoiceConversationItem], + 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_agent_conversation_item( + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.VoiceConversationItem: + """Get a voice agent conversation item. + + Retrieves a single item from the specified conversation by its id, including its transcript. An + ``input_audio``/``output_audio`` content part indicates that audio is available for the item; + the canonical per-item audio metadata is the ``/items/{item_id}/audio`` resource, and the bytes + are streamed by ``/items/{item_id}/audio/content``. Returns ``404`` when the conversation or + item was not persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item to retrieve. Required. + :type item_id: str + :return: VoiceConversationItem. The VoiceConversationItem is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceConversationItem + :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.VoiceConversationItem] = kwargs.pop("cls", None) + + _request = build_agent_endpoint_conversations_get_agent_conversation_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.VoiceConversationItem, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_agent_conversation_item_audio( + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.VoiceItemAudioResponse: + """Get a voice agent conversation item's audio metadata. + + Returns metadata for a single conversation item's audio segment, including the common playback + facts (role, format/codec, sample rate, channels, offset, duration) for both Foundry-managed + and bring-your-own-storage (BYOS) recordings; for BYOS the response additionally includes + ``blob_uri``, the URI of the recording in the customer's own storage (no SAS) that the customer + downloads with their own credentials. Requires the conversation to have persisted audio + (``store = true``); returns ``404`` when the conversation, item, or its audio was not + persisted. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose audio metadata is retrieved. Required. + :type item_id: str + :return: VoiceItemAudioResponse. The VoiceItemAudioResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceItemAudioResponse + :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.VoiceItemAudioResponse] = kwargs.pop("cls", None) + + _request = build_agent_endpoint_conversations_get_agent_conversation_item_audio_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.VoiceItemAudioResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_agent_conversation_item_audio_content( # pylint: disable=name-too-long + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + """Stream a voice agent conversation item's audio. + + Streams a single conversation item's audio as a WAV (``audio/wav``) byte stream through the + service (no SAS URL). This route serves Foundry-managed storage only. For + bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download + directly from customer storage using the ``blob_uri`` returned by the item's ``/audio`` + metadata route — so this route returns ``409 Conflict`` for BYOS recordings. Returns ``404`` + when the conversation, item, or its audio was not persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose audio is streamed. 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_agent_endpoint_conversations_get_agent_conversation_item_audio_content_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_agent_conversation_audio( + self, agent_name: str, conversation_id: str, **kwargs: Any + ) -> _models.VoiceRecordingResponse: + """Get a voice agent conversation's merged recording metadata. + + Returns metadata for the whole-call merged stereo recording (user audio on the left channel, + agent audio on the right). The common metadata (format, sample rate, channels, channel layout, + duration) is returned for both Foundry-managed and bring-your-own-storage (BYOS) recordings; + for BYOS the response additionally includes ``blob_uri``, the URI of the recording in the + customer's own storage (no SAS) that the customer downloads with their own credentials. The + recording is built once from the per-turn segments after persistence finalization succeeds. + While the conversation is ``in_progress``, this route returns retriable ``409 Conflict`` with + ``error.code = recording_not_ready`` and a ``Retry-After`` header when retry guidance is + available. When the conversation is ``failed``, it returns terminal ``409 Conflict`` with + ``error.code = recording_unavailable``. For a ``completed`` conversation, metadata is available + subject to the existing BYOS behavior. Requires the conversation to have persisted audio + (``store = true``); otherwise returns ``404``. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose merged recording metadata is + retrieved. Required. + :type conversation_id: str + :return: VoiceRecordingResponse. The VoiceRecordingResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceRecordingResponse + :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.VoiceRecordingResponse] = kwargs.pop("cls", None) + + _request = build_agent_endpoint_conversations_get_agent_conversation_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) - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.SessionDirectoryEntry], - deserialized.get("entries", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("last_id") or None, AsyncList(list_of_elem) + _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 + ) - async def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) + response = pipeline_response.http_response - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + 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, ) - response = pipeline_response.http_response + raise HttpResponseError(response=response, model=error) - 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) + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VoiceRecordingResponse, response.json()) - return pipeline_response + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore - return AsyncItemPaged(get_next, extract_data) + return deserialized # type: ignore @distributed_trace_async - async def delete_session_file( - self, agent_name: str, session_id: str, *, path: str, recursive: Optional[bool] = None, **kwargs: Any - ) -> None: - """Delete a session file. - - Deletes the specified file or directory from the session sandbox. When ``recursive`` is false, - deleting a non-empty directory returns 409 Conflict. + async def get_agent_conversation_audio_content( + self, agent_name: str, conversation_id: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + """Stream a voice agent conversation's merged recording. + + Streams the whole-call merged stereo recording as a WAV (``audio/wav``) byte stream through the + service (no SAS URL). This route serves Foundry-managed storage only. For + bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download + directly from customer storage using the ``blob_uri`` returned by the metadata route — so this + route returns ``409 Conflict`` for BYOS recordings. While the conversation is ``in_progress``, + this route returns retriable ``409 Conflict`` with ``error.code = recording_not_ready`` and a + ``Retry-After`` header when retry guidance is available. When the conversation is ``failed``, + it returns terminal ``409 Conflict`` with ``error.code = recording_unavailable``. For a + ``completed`` conversation, content is available subject to the existing BYOS behavior. A + conversation without persisted audio (``store = false``) returns ``404``. :param agent_name: The name of the agent. Required. :type agent_name: str - :param session_id: The session ID. Required. - :type session_id: str - :keyword path: The file or directory path to delete, relative to the session home directory. + :param conversation_id: The id of the conversation whose merged recording is streamed. Required. - :paramtype path: str - :keyword recursive: Whether to recursively delete directory contents. The service defaults to - ``false`` if a value is not specified by the caller. Default value is None. - :paramtype recursive: bool - :return: None - :rtype: None + :type conversation_id: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2487,13 +3896,11 @@ async def delete_session_file( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_agents_delete_session_file_request( + _request = build_agent_endpoint_conversations_get_agent_conversation_audio_content_request( agent_name=agent_name, - session_id=session_id, - path=path, - recursive=recursive, + conversation_id=conversation_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -2503,14 +3910,20 @@ async def delete_session_file( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _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 [204]: + 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, @@ -2518,11 +3931,18 @@ async def delete_session_file( ) 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, None, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore -class EvaluationRulesOperations: +class EvaluationRulesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2674,7 +4094,7 @@ async def create_or_update( @overload async def create_or_update( - self, id: str, evaluation_rule: JSON, *, content_type: str = "application/json", **kwargs: Any + self, id: str, evaluation_rule: _types.EvaluationRule, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationRule: """Create or update an evaluation rule. @@ -2683,7 +4103,7 @@ async def create_or_update( :param id: Unique identifier for the evaluation rule. Required. :type id: str :param evaluation_rule: Evaluation rule resource. Required. - :type evaluation_rule: JSON + :type evaluation_rule: ~azure.ai.projects.types.EvaluationRule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2714,7 +4134,7 @@ async def create_or_update( @distributed_trace_async async def create_or_update( - self, id: str, evaluation_rule: Union[_models.EvaluationRule, JSON, IO[bytes]], **kwargs: Any + self, id: str, evaluation_rule: Union[_models.EvaluationRule, _types.EvaluationRule, IO[bytes]], **kwargs: Any ) -> _models.EvaluationRule: """Create or update an evaluation rule. @@ -2722,9 +4142,10 @@ async def create_or_update( :param id: Unique identifier for the evaluation rule. Required. :type id: str - :param evaluation_rule: Evaluation rule resource. Is one of the following types: - EvaluationRule, JSON, IO[bytes] Required. - :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule or JSON or IO[bytes] + :param evaluation_rule: Evaluation rule resource. Is either a EvaluationRule type or a + IO[bytes] type. Required. + :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule or + ~azure.ai.projects.types.EvaluationRule or IO[bytes] :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationRule :raises ~azure.core.exceptions.HttpResponseError: @@ -2899,7 +4320,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class ConnectionsOperations: +class ConnectionsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -3160,7 +4581,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class DatasetsOperations: +class DatasetsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -3514,7 +4935,7 @@ async def create_or_update( self, name: str, version: str, - dataset_version: JSON, + dataset_version: _types.DatasetVersion, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -3528,7 +4949,7 @@ async def create_or_update( :param version: The specific version id of the DatasetVersion to create or update. Required. :type version: str :param dataset_version: The DatasetVersion to create or update. Required. - :type dataset_version: JSON + :type dataset_version: ~azure.ai.projects.types.DatasetVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -3567,7 +4988,11 @@ async def create_or_update( @distributed_trace_async async def create_or_update( - self, name: str, version: str, dataset_version: Union[_models.DatasetVersion, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + version: str, + dataset_version: Union[_models.DatasetVersion, _types.DatasetVersion, IO[bytes]], + **kwargs: Any ) -> _models.DatasetVersion: """Create or update a version. @@ -3577,9 +5002,10 @@ async def create_or_update( :type name: str :param version: The specific version id of the DatasetVersion to create or update. Required. :type version: str - :param dataset_version: The DatasetVersion to create or update. Is one of the following types: - DatasetVersion, JSON, IO[bytes] Required. - :type dataset_version: ~azure.ai.projects.models.DatasetVersion or JSON or IO[bytes] + :param dataset_version: The DatasetVersion to create or update. Is either a DatasetVersion type + or a IO[bytes] type. Required. + :type dataset_version: ~azure.ai.projects.models.DatasetVersion or + ~azure.ai.projects.types.DatasetVersion or IO[bytes] :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -3679,7 +5105,7 @@ async def pending_upload( self, name: str, version: str, - pending_upload_request: JSON, + pending_upload_request: _types.PendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any @@ -3693,7 +5119,7 @@ async def pending_upload( :param version: The specific version id of the DatasetVersion to operate on. Required. :type version: str :param pending_upload_request: The pending upload request parameters. Required. - :type pending_upload_request: JSON + :type pending_upload_request: ~azure.ai.projects.types.PendingUploadRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3735,7 +5161,7 @@ async def pending_upload( self, name: str, version: str, - pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], + pending_upload_request: Union[_models.PendingUploadRequest, _types.PendingUploadRequest, IO[bytes]], **kwargs: Any ) -> _models.PendingUploadResponse: """Start a pending upload. @@ -3746,10 +5172,10 @@ async def pending_upload( :type name: str :param version: The specific version id of the DatasetVersion to operate on. Required. :type version: str - :param pending_upload_request: The pending upload request parameters. Is one of the following - types: PendingUploadRequest, JSON, IO[bytes] Required. - :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or JSON or - IO[bytes] + :param pending_upload_request: The pending upload request parameters. Is either a + PendingUploadRequest type or a IO[bytes] type. Required. + :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or + ~azure.ai.projects.types.PendingUploadRequest or IO[bytes] :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -3883,7 +5309,7 @@ async def get_credentials(self, name: str, version: str, **kwargs: Any) -> _mode return deserialized # type: ignore -class DeploymentsOperations: +class DeploymentsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -4078,7 +5504,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class IndexesOperations: +class IndexesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -4429,7 +5855,13 @@ async def create_or_update( @overload async def create_or_update( - self, name: str, version: str, index: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any + self, + name: str, + version: str, + index: _types.Index, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any ) -> _models.Index: """Create or update a version. @@ -4440,7 +5872,7 @@ async def create_or_update( :param version: The specific version id of the Index to create or update. Required. :type version: str :param index: The Index to create or update. Required. - :type index: JSON + :type index: ~azure.ai.projects.types.Index :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -4479,7 +5911,7 @@ async def create_or_update( @distributed_trace_async async def create_or_update( - self, name: str, version: str, index: Union[_models.Index, JSON, IO[bytes]], **kwargs: Any + self, name: str, version: str, index: Union[_models.Index, _types.Index, IO[bytes]], **kwargs: Any ) -> _models.Index: """Create or update a version. @@ -4489,9 +5921,9 @@ async def create_or_update( :type name: str :param version: The specific version id of the Index to create or update. Required. :type version: str - :param index: The Index to create or update. Is one of the following types: Index, JSON, - IO[bytes] Required. - :type index: ~azure.ai.projects.models.Index or JSON or IO[bytes] + :param index: The Index to create or update. Is either a Index type or a IO[bytes] type. + Required. + :type index: ~azure.ai.projects.models.Index or ~azure.ai.projects.types.Index or IO[bytes] :return: Index. The Index is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Index :raises ~azure.core.exceptions.HttpResponseError: @@ -4559,7 +5991,7 @@ async def create_or_update( return deserialized # type: ignore -class ToolboxesOperations: +class ToolboxesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -4619,7 +6051,12 @@ async def create_version( @overload async def create_version( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + body: _types.CreateToolboxVersionRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.ToolboxVersionObject: """Create a new version of a toolbox. @@ -4629,7 +6066,7 @@ async def create_version( Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateToolboxVersionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4663,7 +6100,7 @@ async def create_version( async def create_version( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateToolboxVersionRequest, IO[bytes]] = _Unset, *, tools: List[_models.ToolboxTool] = _Unset, description: Optional[str] = None, @@ -4679,8 +6116,9 @@ async def create_version( :param name: The name of the toolbox. If the toolbox does not exist, it will be created. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateToolboxVersionRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.projects.types.CreateToolboxVersionRequest or IO[bytes] :keyword tools: The list of tools to include in this version. Required. :paramtype tools: list[~azure.ai.projects.models.ToolboxTool] :keyword description: A human-readable description of the toolbox. Default value is None. @@ -5122,7 +6560,7 @@ async def update( @overload async def update( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.UpdateToolboxRequest1, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. @@ -5131,7 +6569,7 @@ async def update( :param name: The name of the toolbox to update. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.UpdateToolboxRequest1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5162,7 +6600,12 @@ async def update( @distributed_trace_async async def update( - self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, default_version: str = _Unset, **kwargs: Any + self, + name: str, + body: Union[JSON, _types.UpdateToolboxRequest1, IO[bytes]] = _Unset, + *, + default_version: str = _Unset, + **kwargs: Any ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. @@ -5170,8 +6613,8 @@ async def update( :param name: The name of the toolbox to update. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, UpdateToolboxRequest1, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.UpdateToolboxRequest1 or IO[bytes] :keyword 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. :paramtype default_version: str @@ -5361,7 +6804,7 @@ async def delete_version(self, name: str, version: str, **kwargs: Any) -> None: return cls(pipeline_response, None, {}) # type: ignore -class BetaEvaluationTaxonomiesOperations: +class BetaEvaluationTaxonomiesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -5612,7 +7055,7 @@ async def create( @overload async def create( - self, name: str, taxonomy: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, taxonomy: _types.EvaluationTaxonomy, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. @@ -5621,7 +7064,7 @@ async def create( :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. - :type taxonomy: JSON + :type taxonomy: ~azure.ai.projects.types.EvaluationTaxonomy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5652,7 +7095,10 @@ async def create( @distributed_trace_async async def create( - self, name: str, taxonomy: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + taxonomy: Union[_models.EvaluationTaxonomy, _types.EvaluationTaxonomy, IO[bytes]], + **kwargs: Any ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. @@ -5660,9 +7106,10 @@ async def create( :param name: The name of the evaluation taxonomy. Required. :type name: str - :param taxonomy: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, - JSON, IO[bytes] Required. - :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] + :param taxonomy: The evaluation taxonomy. Is either a EvaluationTaxonomy type or a IO[bytes] + type. Required. + :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or + ~azure.ai.projects.types.EvaluationTaxonomy or IO[bytes] :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: @@ -5750,7 +7197,7 @@ async def update( @overload async def update( - self, name: str, taxonomy: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, taxonomy: _types.EvaluationTaxonomy, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. @@ -5759,7 +7206,7 @@ async def update( :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. - :type taxonomy: JSON + :type taxonomy: ~azure.ai.projects.types.EvaluationTaxonomy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5790,7 +7237,10 @@ async def update( @distributed_trace_async async def update( - self, name: str, taxonomy: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + taxonomy: Union[_models.EvaluationTaxonomy, _types.EvaluationTaxonomy, IO[bytes]], + **kwargs: Any ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. @@ -5798,9 +7248,10 @@ async def update( :param name: The name of the evaluation taxonomy. Required. :type name: str - :param taxonomy: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, - JSON, IO[bytes] Required. - :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] + :param taxonomy: The evaluation taxonomy. Is either a EvaluationTaxonomy type or a IO[bytes] + type. Required. + :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or + ~azure.ai.projects.types.EvaluationTaxonomy or IO[bytes] :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: @@ -5867,7 +7318,7 @@ async def update( return deserialized # type: ignore -class BetaEvaluatorsOperations: +class BetaEvaluatorsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -6244,7 +7695,12 @@ async def create_version( @overload async def create_version( - self, name: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + evaluator_version: _types.EvaluatorVersion, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.EvaluatorVersion: """Create an evaluator version. @@ -6253,7 +7709,7 @@ async def create_version( :param name: The name of the resource. Required. :type name: str :param evaluator_version: Required. - :type evaluator_version: JSON + :type evaluator_version: ~azure.ai.projects.types.EvaluatorVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6284,7 +7740,10 @@ async def create_version( @distributed_trace_async async def create_version( - self, name: str, evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + evaluator_version: Union[_models.EvaluatorVersion, _types.EvaluatorVersion, IO[bytes]], + **kwargs: Any ) -> _models.EvaluatorVersion: """Create an evaluator version. @@ -6292,9 +7751,9 @@ async def create_version( :param name: The name of the resource. Required. :type name: str - :param evaluator_version: Is one of the following types: EvaluatorVersion, JSON, IO[bytes] - Required. - :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or JSON or IO[bytes] + :param evaluator_version: Is either a EvaluatorVersion type or a IO[bytes] type. Required. + :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or + ~azure.ai.projects.types.EvaluatorVersion or IO[bytes] :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -6390,7 +7849,13 @@ async def update_version( @overload async def update_version( - self, name: str, version: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + version: str, + evaluator_version: _types.EvaluatorVersion, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.EvaluatorVersion: """Update an evaluator version. @@ -6401,7 +7866,7 @@ async def update_version( :param version: The version of the EvaluatorVersion to update. Required. :type version: str :param evaluator_version: Evaluator resource. Required. - :type evaluator_version: JSON + :type evaluator_version: ~azure.ai.projects.types.EvaluatorVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6443,7 +7908,7 @@ async def update_version( self, name: str, version: str, - evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], + evaluator_version: Union[_models.EvaluatorVersion, _types.EvaluatorVersion, IO[bytes]], **kwargs: Any ) -> _models.EvaluatorVersion: """Update an evaluator version. @@ -6454,9 +7919,10 @@ async def update_version( :type name: str :param version: The version of the EvaluatorVersion to update. Required. :type version: str - :param evaluator_version: Evaluator resource. Is one of the following types: EvaluatorVersion, - JSON, IO[bytes] Required. - :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or JSON or IO[bytes] + :param evaluator_version: Evaluator resource. Is either a EvaluatorVersion type or a IO[bytes] + type. Required. + :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or + ~azure.ai.projects.types.EvaluatorVersion or IO[bytes] :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -6557,7 +8023,7 @@ async def pending_upload( self, name: str, version: str, - pending_upload_request: JSON, + pending_upload_request: _types.PendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any @@ -6572,7 +8038,7 @@ async def pending_upload( :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str :param pending_upload_request: The pending upload request parameters. Required. - :type pending_upload_request: JSON + :type pending_upload_request: ~azure.ai.projects.types.PendingUploadRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6615,7 +8081,7 @@ async def pending_upload( self, name: str, version: str, - pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], + pending_upload_request: Union[_models.PendingUploadRequest, _types.PendingUploadRequest, IO[bytes]], **kwargs: Any ) -> _models.PendingUploadResponse: """Start a pending upload. @@ -6627,10 +8093,10 @@ async def pending_upload( :type name: str :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str - :param pending_upload_request: The pending upload request parameters. Is one of the following - types: PendingUploadRequest, JSON, IO[bytes] Required. - :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or JSON or - IO[bytes] + :param pending_upload_request: The pending upload request parameters. Is either a + PendingUploadRequest type or a IO[bytes] type. Required. + :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or + ~azure.ai.projects.types.PendingUploadRequest or IO[bytes] :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -6735,7 +8201,7 @@ async def get_credentials( self, name: str, version: str, - credential_request: JSON, + credential_request: _types.EvaluatorCredentialRequest, *, content_type: str = "application/json", **kwargs: Any @@ -6750,7 +8216,7 @@ async def get_credentials( :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str :param credential_request: The credential request parameters. Required. - :type credential_request: JSON + :type credential_request: ~azure.ai.projects.types.EvaluatorCredentialRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6793,7 +8259,7 @@ async def get_credentials( self, name: str, version: str, - credential_request: Union[_models.EvaluatorCredentialRequest, JSON, IO[bytes]], + credential_request: Union[_models.EvaluatorCredentialRequest, _types.EvaluatorCredentialRequest, IO[bytes]], **kwargs: Any ) -> _models.DatasetCredential: """Get evaluator credentials. @@ -6805,10 +8271,10 @@ async def get_credentials( :type name: str :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str - :param credential_request: The credential request parameters. Is one of the following types: - EvaluatorCredentialRequest, JSON, IO[bytes] Required. - :type credential_request: ~azure.ai.projects.models.EvaluatorCredentialRequest or JSON or - IO[bytes] + :param credential_request: The credential request parameters. Is either a + EvaluatorCredentialRequest type or a IO[bytes] type. Required. + :type credential_request: ~azure.ai.projects.models.EvaluatorCredentialRequest or + ~azure.ai.projects.types.EvaluatorCredentialRequest or IO[bytes] :return: DatasetCredential. The DatasetCredential is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetCredential :raises ~azure.core.exceptions.HttpResponseError: @@ -6881,7 +8347,7 @@ async def get_credentials( async def _create_generation_job_initial( self, - job: Union[_models.EvaluatorGenerationJob, JSON, IO[bytes]], + job: Union[_models.EvaluatorGenerationJob, _types.EvaluatorGenerationJob, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -6981,7 +8447,12 @@ async def begin_create_generation_job( @overload async def begin_create_generation_job( - self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any + self, + job: _types.EvaluatorGenerationJob, + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any ) -> AsyncLROPoller[_models.EvaluatorVersion]: """Create an evaluator generation job. @@ -6989,7 +8460,7 @@ async def begin_create_generation_job( from the provided source materials asynchronously. :param job: The job to create. Required. - :type job: JSON + :type job: ~azure.ai.projects.types.EvaluatorGenerationJob :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -7033,7 +8504,7 @@ async def begin_create_generation_job( @distributed_trace_async async def begin_create_generation_job( self, - job: Union[_models.EvaluatorGenerationJob, JSON, IO[bytes]], + job: Union[_models.EvaluatorGenerationJob, _types.EvaluatorGenerationJob, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -7043,9 +8514,10 @@ async def begin_create_generation_job( Creates an evaluator generation job. The service generates rubric-based evaluator definitions from the provided source materials asynchronously. - :param job: The job to create. Is one of the following types: EvaluatorGenerationJob, JSON, - IO[bytes] Required. - :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or JSON or IO[bytes] + :param job: The job to create. Is either a EvaluatorGenerationJob type or a IO[bytes] type. + Required. + :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or + ~azure.ai.projects.types.EvaluatorGenerationJob or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -7400,7 +8872,7 @@ async def delete_generation_job(self, job_id: str, **kwargs: Any) -> None: return cls(pipeline_response, None, {}) # type: ignore -class BetaInsightsOperations: +class BetaInsightsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -7438,7 +8910,7 @@ async def generate( @overload async def generate( - self, insight: JSON, *, content_type: str = "application/json", **kwargs: Any + self, insight: _types.Insight, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Insight: """Generate insights. @@ -7446,7 +8918,7 @@ async def generate( :param insight: Complete evaluation configuration including data source, evaluators, and result settings. Required. - :type insight: JSON + :type insight: ~azure.ai.projects.types.Insight :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7475,14 +8947,17 @@ async def generate( """ @distributed_trace_async - async def generate(self, insight: Union[_models.Insight, JSON, IO[bytes]], **kwargs: Any) -> _models.Insight: + async def generate( + self, insight: Union[_models.Insight, _types.Insight, IO[bytes]], **kwargs: Any + ) -> _models.Insight: """Generate insights. Generates an insights report from the provided evaluation configuration. :param insight: Complete evaluation configuration including data source, evaluators, and result - settings. Is one of the following types: Insight, JSON, IO[bytes] Required. - :type insight: ~azure.ai.projects.models.Insight or JSON or IO[bytes] + settings. Is either a Insight type or a IO[bytes] type. Required. + :type insight: ~azure.ai.projects.models.Insight or ~azure.ai.projects.types.Insight or + IO[bytes] :return: Insight. The Insight is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Insight :raises ~azure.core.exceptions.HttpResponseError: @@ -7745,7 +9220,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class BetaMemoryStoresOperations: +class BetaMemoryStoresOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -7796,14 +9271,14 @@ async def create( @overload async def create( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, body: _types.CreateMemoryStoreRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: """Create a memory store. Creates a memory store resource with the provided configuration. :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateMemoryStoreRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7833,7 +9308,7 @@ async def create( @distributed_trace_async async def create( self, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateMemoryStoreRequest, IO[bytes]] = _Unset, *, name: str = _Unset, definition: _models.MemoryStoreDefinition = _Unset, @@ -7845,8 +9320,8 @@ async def create( Creates a memory store resource with the provided configuration. - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateMemoryStoreRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.CreateMemoryStoreRequest or IO[bytes] :keyword name: The name of the memory store. Required. :paramtype name: str :keyword definition: The memory store definition. Required. @@ -7962,7 +9437,7 @@ async def update( @overload async def update( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.UpdateMemoryStoreRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: """Update a memory store. @@ -7971,7 +9446,7 @@ async def update( :param name: The name of the memory store to update. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.UpdateMemoryStoreRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -8004,7 +9479,7 @@ async def update( async def update( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.UpdateMemoryStoreRequest, IO[bytes]] = _Unset, *, description: Optional[str] = None, metadata: Optional[dict[str, str]] = None, @@ -8016,8 +9491,8 @@ async def update( :param name: The name of the memory store to update. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, UpdateMemoryStoreRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.UpdateMemoryStoreRequest or IO[bytes] :keyword description: A human-readable description of the memory store. Default value is None. :paramtype description: str :keyword metadata: Arbitrary key-value metadata to associate with the memory store. Default @@ -8335,7 +9810,7 @@ async def _search_memories( ) -> _models.MemoryStoreSearchResult: ... @overload async def _search_memories( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.SearchMemoriesRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreSearchResult: ... @overload async def _search_memories( @@ -8346,7 +9821,7 @@ async def _search_memories( async def _search_memories( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.SearchMemoriesRequest, IO[bytes]] = _Unset, *, scope: str = _Unset, items: Optional[List[dict[str, Any]]] = None, @@ -8360,8 +9835,8 @@ async def _search_memories( :param name: The name of the memory store to search. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, SearchMemoriesRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.SearchMemoriesRequest or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -8449,7 +9924,7 @@ async def _search_memories( async def _update_memories_initial( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.UpdateMemoriesRequest, IO[bytes]] = _Unset, *, scope: str = _Unset, items: Optional[List[dict[str, Any]]] = None, @@ -8545,7 +10020,7 @@ async def _begin_update_memories( ) -> AsyncLROPoller[_models.MemoryStoreUpdateCompletedResult]: ... @overload async def _begin_update_memories( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.UpdateMemoriesRequest, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.MemoryStoreUpdateCompletedResult]: ... @overload async def _begin_update_memories( @@ -8556,7 +10031,7 @@ async def _begin_update_memories( async def _begin_update_memories( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.UpdateMemoriesRequest, IO[bytes]] = _Unset, *, scope: str = _Unset, items: Optional[List[dict[str, Any]]] = None, @@ -8571,8 +10046,8 @@ async def _begin_update_memories( :param name: The name of the memory store to update. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, UpdateMemoriesRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.UpdateMemoriesRequest or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -8678,7 +10153,7 @@ async def delete_scope( @overload async def delete_scope( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.DeleteScopeRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: """Delete memories by scope. @@ -8687,7 +10162,7 @@ async def delete_scope( :param name: The name of the memory store. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.DeleteScopeRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -8720,7 +10195,12 @@ async def delete_scope( @distributed_trace_async async def delete_scope( - self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, **kwargs: Any + self, + name: str, + body: Union[JSON, _types.DeleteScopeRequest, IO[bytes]] = _Unset, + *, + scope: str = _Unset, + **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: """Delete memories by scope. @@ -8728,8 +10208,8 @@ async def delete_scope( :param name: The name of the memory store. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, DeleteScopeRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.DeleteScopeRequest or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories to delete, such as a user ID. Required. :paramtype scope: str @@ -8843,7 +10323,7 @@ async def create_memory( @overload async def create_memory( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.CreateMemoryRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: """Create a memory item. @@ -8852,7 +10332,7 @@ async def create_memory( :param name: The name of the memory store. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateMemoryRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -8885,7 +10365,7 @@ async def create_memory( async def create_memory( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateMemoryRequest, IO[bytes]] = _Unset, *, scope: str = _Unset, content: str = _Unset, @@ -8898,8 +10378,8 @@ async def create_memory( :param name: The name of the memory store. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateMemoryRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.CreateMemoryRequest or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -9010,7 +10490,13 @@ async def update_memory( @overload async def update_memory( - self, name: str, memory_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + memory_id: str, + body: _types.UpdateMemoryRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.MemoryItem: """Update a memory item. @@ -9021,7 +10507,7 @@ async def update_memory( :param memory_id: The ID of the memory item to update. Required. :type memory_id: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.UpdateMemoryRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9054,7 +10540,13 @@ async def update_memory( @distributed_trace_async async def update_memory( - self, name: str, memory_id: str, body: Union[JSON, IO[bytes]] = _Unset, *, content: str = _Unset, **kwargs: Any + self, + name: str, + memory_id: str, + body: Union[JSON, _types.UpdateMemoryRequest, IO[bytes]] = _Unset, + *, + content: str = _Unset, + **kwargs: Any ) -> _models.MemoryItem: """Update a memory item. @@ -9064,8 +10556,8 @@ async def update_memory( :type name: str :param memory_id: The ID of the memory item to update. Required. :type memory_id: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, UpdateMemoryRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.UpdateMemoryRequest or IO[bytes] :keyword content: The updated content of the memory. Required. :paramtype content: str :return: MemoryItem. The MemoryItem is compatible with MutableMapping @@ -9264,7 +10756,7 @@ def list_memories( def list_memories( self, name: str, - body: JSON, + body: _types.ListMemoriesRequest, *, kind: Optional[Union[str, _models.MemoryItemKind]] = None, limit: Optional[int] = None, @@ -9280,7 +10772,7 @@ def list_memories( :param name: The name of the memory store. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.ListMemoriesRequest :keyword kind: The kind of the memory item. Known values are: "user_profile", "chat_summary", and "procedural". Default value is None. :paramtype kind: str or ~azure.ai.projects.models.MemoryItemKind @@ -9356,7 +10848,7 @@ def list_memories( def list_memories( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.ListMemoriesRequest, IO[bytes]] = _Unset, *, scope: str = _Unset, kind: Optional[Union[str, _models.MemoryItemKind]] = None, @@ -9371,8 +10863,8 @@ def list_memories( :param name: The name of the memory store. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, ListMemoriesRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.ListMemoriesRequest or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -9545,7 +11037,7 @@ async def delete_memory(self, name: str, memory_id: str, **kwargs: Any) -> _mode return deserialized # type: ignore -class BetaModelsOperations: +class BetaModelsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -9898,7 +11390,7 @@ async def update( self, name: str, version: str, - model_version_update: JSON, + model_version_update: _types.UpdateModelVersionRequest, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -9913,7 +11405,7 @@ async def update( Required. :type version: str :param model_version_update: The UpdateModelVersionRequest to create or update. Required. - :type model_version_update: JSON + :type model_version_update: ~azure.ai.projects.types.UpdateModelVersionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -9956,7 +11448,7 @@ async def update( self, name: str, version: str, - model_version_update: Union[_models.UpdateModelVersionRequest, JSON, IO[bytes]], + model_version_update: Union[_models.UpdateModelVersionRequest, _types.UpdateModelVersionRequest, IO[bytes]], **kwargs: Any ) -> _models.ModelVersion: """Update a model version. @@ -9968,10 +11460,10 @@ async def update( :param version: The specific version id of the UpdateModelVersionRequest to create or update. Required. :type version: str - :param model_version_update: The UpdateModelVersionRequest to create or update. Is one of the - following types: UpdateModelVersionRequest, JSON, IO[bytes] Required. - :type model_version_update: ~azure.ai.projects.models.UpdateModelVersionRequest or JSON or - IO[bytes] + :param model_version_update: The UpdateModelVersionRequest to create or update. Is either a + UpdateModelVersionRequest type or a IO[bytes] type. Required. + :type model_version_update: ~azure.ai.projects.models.UpdateModelVersionRequest or + ~azure.ai.projects.types.UpdateModelVersionRequest or IO[bytes] :return: ModelVersion. The ModelVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.ModelVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -10069,7 +11561,13 @@ async def pending_create_version( @overload async def pending_create_version( - self, name: str, version: str, model_version: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + version: str, + model_version: _types.ModelVersion, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.CreateAsyncResponse: """Create a model version async. @@ -10081,7 +11579,7 @@ async def pending_create_version( :param version: Version of the model. Required. :type version: str :param model_version: Model version to create. Required. - :type model_version: JSON + :type model_version: ~azure.ai.projects.types.ModelVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10121,7 +11619,11 @@ async def pending_create_version( @distributed_trace_async async def pending_create_version( - self, name: str, version: str, model_version: Union[_models.ModelVersion, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + version: str, + model_version: Union[_models.ModelVersion, _types.ModelVersion, IO[bytes]], + **kwargs: Any ) -> _models.CreateAsyncResponse: """Create a model version async. @@ -10132,9 +11634,10 @@ async def pending_create_version( :type name: str :param version: Version of the model. Required. :type version: str - :param model_version: Model version to create. Is one of the following types: ModelVersion, - JSON, IO[bytes] Required. - :type model_version: ~azure.ai.projects.models.ModelVersion or JSON or IO[bytes] + :param model_version: Model version to create. Is either a ModelVersion type or a IO[bytes] + type. Required. + :type model_version: ~azure.ai.projects.models.ModelVersion or + ~azure.ai.projects.types.ModelVersion or IO[bytes] :return: CreateAsyncResponse. The CreateAsyncResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.CreateAsyncResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -10238,7 +11741,7 @@ async def pending_upload( self, name: str, version: str, - pending_upload_request: JSON, + pending_upload_request: _types.ModelPendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any @@ -10252,7 +11755,7 @@ async def pending_upload( :param version: Version of the model. Required. :type version: str :param pending_upload_request: The pending upload request request body. Required. - :type pending_upload_request: JSON + :type pending_upload_request: ~azure.ai.projects.types.ModelPendingUploadRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10296,7 +11799,7 @@ async def pending_upload( self, name: str, version: str, - pending_upload_request: Union[_models.ModelPendingUploadRequest, JSON, IO[bytes]], + pending_upload_request: Union[_models.ModelPendingUploadRequest, _types.ModelPendingUploadRequest, IO[bytes]], **kwargs: Any ) -> _models.ModelPendingUploadResponse: """Start a pending upload. @@ -10307,10 +11810,10 @@ async def pending_upload( :type name: str :param version: Version of the model. Required. :type version: str - :param pending_upload_request: The pending upload request request body. Is one of the following - types: ModelPendingUploadRequest, JSON, IO[bytes] Required. - :type pending_upload_request: ~azure.ai.projects.models.ModelPendingUploadRequest or JSON or - IO[bytes] + :param pending_upload_request: The pending upload request request body. Is either a + ModelPendingUploadRequest type or a IO[bytes] type. Required. + :type pending_upload_request: ~azure.ai.projects.models.ModelPendingUploadRequest or + ~azure.ai.projects.types.ModelPendingUploadRequest or IO[bytes] :return: ModelPendingUploadResponse. The ModelPendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.ModelPendingUploadResponse @@ -10411,7 +11914,7 @@ async def get_credentials( self, name: str, version: str, - credential_request: JSON, + credential_request: _types.ModelCredentialRequest, *, content_type: str = "application/json", **kwargs: Any @@ -10425,7 +11928,7 @@ async def get_credentials( :param version: Version of the model. Required. :type version: str :param credential_request: The credential request request body. Required. - :type credential_request: JSON + :type credential_request: ~azure.ai.projects.types.ModelCredentialRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10467,7 +11970,7 @@ async def get_credentials( self, name: str, version: str, - credential_request: Union[_models.ModelCredentialRequest, JSON, IO[bytes]], + credential_request: Union[_models.ModelCredentialRequest, _types.ModelCredentialRequest, IO[bytes]], **kwargs: Any ) -> _models.DatasetCredential: """Get model asset credentials. @@ -10478,9 +11981,10 @@ async def get_credentials( :type name: str :param version: Version of the model. Required. :type version: str - :param credential_request: The credential request request body. Is one of the following types: - ModelCredentialRequest, JSON, IO[bytes] Required. - :type credential_request: ~azure.ai.projects.models.ModelCredentialRequest or JSON or IO[bytes] + :param credential_request: The credential request request body. Is either a + ModelCredentialRequest type or a IO[bytes] type. Required. + :type credential_request: ~azure.ai.projects.models.ModelCredentialRequest or + ~azure.ai.projects.types.ModelCredentialRequest or IO[bytes] :return: DatasetCredential. The DatasetCredential is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetCredential :raises ~azure.core.exceptions.HttpResponseError: @@ -10548,7 +12052,7 @@ async def get_credentials( return deserialized # type: ignore -class BetaRedTeamsOperations: +class BetaRedTeamsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -10737,13 +12241,15 @@ async def create( """ @overload - async def create(self, red_team: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.RedTeam: + async def create( + self, red_team: _types.RedTeam, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.RedTeam: """Create a redteam run. Submits a new redteam run for execution with the provided configuration. :param red_team: Redteam to be run. Required. - :type red_team: JSON + :type red_team: ~azure.ai.projects.types.RedTeam :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10771,14 +12277,16 @@ async def create( """ @distributed_trace_async - async def create(self, red_team: Union[_models.RedTeam, JSON, IO[bytes]], **kwargs: Any) -> _models.RedTeam: + async def create( + self, red_team: Union[_models.RedTeam, _types.RedTeam, IO[bytes]], **kwargs: Any + ) -> _models.RedTeam: """Create a redteam run. Submits a new redteam run for execution with the provided configuration. - :param red_team: Redteam to be run. Is one of the following types: RedTeam, JSON, IO[bytes] - Required. - :type red_team: ~azure.ai.projects.models.RedTeam or JSON or IO[bytes] + :param red_team: Redteam to be run. Is either a RedTeam type or a IO[bytes] type. Required. + :type red_team: ~azure.ai.projects.models.RedTeam or ~azure.ai.projects.types.RedTeam or + IO[bytes] :return: RedTeam. The RedTeam is compatible with MutableMapping :rtype: ~azure.ai.projects.models.RedTeam :raises ~azure.core.exceptions.HttpResponseError: @@ -10848,7 +12356,7 @@ async def create(self, red_team: Union[_models.RedTeam, JSON, IO[bytes]], **kwar return deserialized # type: ignore -class BetaRoutinesOperations: +class BetaRoutinesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -10902,7 +12410,12 @@ async def create_or_update( @overload async def create_or_update( - self, routine_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + routine_name: str, + body: _types.CreateOrUpdateRoutineRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.Routine: """Create or update a routine. @@ -10911,7 +12424,7 @@ async def create_or_update( :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateOrUpdateRoutineRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10944,7 +12457,7 @@ async def create_or_update( async def create_or_update( self, routine_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateOrUpdateRoutineRequest, IO[bytes]] = _Unset, *, description: Optional[str] = None, enabled: Optional[bool] = None, @@ -10958,8 +12471,9 @@ async def create_or_update( :param routine_name: The unique name of the routine. Required. :type routine_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateOrUpdateRoutineRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.projects.types.CreateOrUpdateRoutineRequest or IO[bytes] :keyword description: A human-readable description of the routine. Default value is None. :paramtype description: str :keyword enabled: Whether the routine is enabled. Default value is None. @@ -11500,7 +13014,12 @@ async def dispatch( @overload async def dispatch( - self, routine_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + routine_name: str, + body: _types.DispatchRoutineAsyncRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. @@ -11509,7 +13028,7 @@ async def dispatch( :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.DispatchRoutineAsyncRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11542,7 +13061,7 @@ async def dispatch( async def dispatch( self, routine_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.DispatchRoutineAsyncRequest, IO[bytes]] = _Unset, *, payload: Optional[_models.RoutineDispatchPayload] = None, **kwargs: Any @@ -11553,8 +13072,9 @@ async def dispatch( :param routine_name: The unique name of the routine. Required. :type routine_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, DispatchRoutineAsyncRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.projects.types.DispatchRoutineAsyncRequest or IO[bytes] :keyword payload: A direct action-input override sent downstream when testing a routine. Default value is None. :paramtype payload: ~azure.ai.projects.models.RoutineDispatchPayload @@ -11631,7 +13151,7 @@ async def dispatch( return deserialized # type: ignore -class BetaSchedulesOperations: +class BetaSchedulesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -11886,7 +13406,7 @@ async def create_or_update( @overload async def create_or_update( - self, schedule_id: str, schedule: JSON, *, content_type: str = "application/json", **kwargs: Any + self, schedule_id: str, schedule: _types.Schedule, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Schedule: """Create or update a schedule. @@ -11895,7 +13415,7 @@ async def create_or_update( :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str :param schedule: The resource instance. Required. - :type schedule: JSON + :type schedule: ~azure.ai.projects.types.Schedule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11926,7 +13446,7 @@ async def create_or_update( @distributed_trace_async async def create_or_update( - self, schedule_id: str, schedule: Union[_models.Schedule, JSON, IO[bytes]], **kwargs: Any + self, schedule_id: str, schedule: Union[_models.Schedule, _types.Schedule, IO[bytes]], **kwargs: Any ) -> _models.Schedule: """Create or update a schedule. @@ -11934,9 +13454,10 @@ async def create_or_update( :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str - :param schedule: The resource instance. Is one of the following types: Schedule, JSON, - IO[bytes] Required. - :type schedule: ~azure.ai.projects.models.Schedule or JSON or IO[bytes] + :param schedule: The resource instance. Is either a Schedule type or a IO[bytes] type. + Required. + :type schedule: ~azure.ai.projects.models.Schedule or ~azure.ai.projects.types.Schedule or + IO[bytes] :return: Schedule. The Schedule is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Schedule :raises ~azure.core.exceptions.HttpResponseError: @@ -12180,7 +13701,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class BetaSkillsOperations: +class BetaSkillsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -12379,7 +13900,7 @@ async def update( @overload async def update( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.UpdateSkillRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SkillDetails: """Update a skill. @@ -12388,7 +13909,7 @@ async def update( :param name: The name of the skill to update. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.UpdateSkillRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -12419,7 +13940,12 @@ async def update( @distributed_trace_async async def update( - self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, default_version: str = _Unset, **kwargs: Any + self, + name: str, + body: Union[JSON, _types.UpdateSkillRequest, IO[bytes]] = _Unset, + *, + default_version: str = _Unset, + **kwargs: Any ) -> _models.SkillDetails: """Update a skill. @@ -12427,8 +13953,8 @@ async def update( :param name: The name of the skill to update. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, UpdateSkillRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.UpdateSkillRequest or IO[bytes] :keyword default_version: The version identifier that the skill should point to. When set, the skill's default version will resolve to this version instead of the latest. Required. :paramtype default_version: str @@ -12604,7 +14130,12 @@ async def create( @overload async def create( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + body: _types.CreateSkillVersionRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.SkillVersion: """Create a new version of a skill. @@ -12613,7 +14144,7 @@ async def create( :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateSkillVersionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -12646,7 +14177,7 @@ async def create( async def create( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateSkillVersionRequest, IO[bytes]] = _Unset, *, inline_content: Optional[_models.SkillInlineContent] = None, default: Optional[bool] = None, @@ -12658,8 +14189,9 @@ async def create( :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateSkillVersionRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.projects.types.CreateSkillVersionRequest or IO[bytes] :keyword inline_content: Inline skill content for simple skills without file uploads. Foundry-specific extension. Default value is None. :paramtype inline_content: ~azure.ai.projects.models.SkillInlineContent @@ -12755,7 +14287,9 @@ async def create_from_files( """ @overload - async def create_from_files(self, name: str, content: JSON, **kwargs: Any) -> _models.SkillVersion: + async def create_from_files( + self, name: str, content: _types.CreateSkillVersionFromFilesBody, **kwargs: Any + ) -> _models.SkillVersion: """Create a skill version from uploaded files. Creates a new version of a skill from uploaded files via multipart form data. @@ -12763,7 +14297,7 @@ async def create_from_files(self, name: str, content: JSON, **kwargs: Any) -> _m :param name: The name of the skill. Required. :type name: str :param content: The multipart request content. Required. - :type content: JSON + :type content: ~azure.ai.projects.types.CreateSkillVersionFromFilesBody :return: SkillVersion. The SkillVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.SkillVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -12771,7 +14305,10 @@ async def create_from_files(self, name: str, content: JSON, **kwargs: Any) -> _m @distributed_trace_async async def create_from_files( - self, name: str, content: Union[_models.CreateSkillVersionFromFilesBody, JSON], **kwargs: Any + self, + name: str, + content: Union[_models.CreateSkillVersionFromFilesBody, _types.CreateSkillVersionFromFilesBody], + **kwargs: Any ) -> _models.SkillVersion: """Create a skill version from uploaded files. @@ -12779,9 +14316,10 @@ async def create_from_files( :param name: The name of the skill. Required. :type name: str - :param content: The multipart request content. Is either a CreateSkillVersionFromFilesBody type - or a JSON type. Required. - :type content: ~azure.ai.projects.models.CreateSkillVersionFromFilesBody or JSON + :param content: The multipart request content. Is one of the following types: + CreateSkillVersionFromFilesBody Required. + :type content: ~azure.ai.projects.models.CreateSkillVersionFromFilesBody or + ~azure.ai.projects.types.CreateSkillVersionFromFilesBody :return: SkillVersion. The SkillVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.SkillVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -13222,7 +14760,7 @@ async def delete_version(self, name: str, version: str, **kwargs: Any) -> _model return deserialized # type: ignore -class BetaDatasetsOperations: +class BetaDatasetsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -13403,7 +14941,7 @@ async def get_next(_continuation_token=None): async def _create_generation_job_initial( self, - job: Union[_models.DataGenerationJob, JSON, IO[bytes]], + job: Union[_models.DataGenerationJob, _types.DataGenerationJob, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -13502,14 +15040,19 @@ async def begin_create_generation_job( @overload async def begin_create_generation_job( - self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any + self, + job: _types.DataGenerationJob, + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any ) -> AsyncLROPoller[_models.DataGenerationJobResult]: """Create a data generation job. Submits a new data generation job for asynchronous execution. :param job: The job to create. Required. - :type job: JSON + :type job: ~azure.ai.projects.types.DataGenerationJob :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -13552,7 +15095,7 @@ async def begin_create_generation_job( @distributed_trace_async async def begin_create_generation_job( self, - job: Union[_models.DataGenerationJob, JSON, IO[bytes]], + job: Union[_models.DataGenerationJob, _types.DataGenerationJob, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -13561,9 +15104,10 @@ async def begin_create_generation_job( Submits a new data generation job for asynchronous execution. - :param job: The job to create. Is one of the following types: DataGenerationJob, JSON, - IO[bytes] Required. - :type job: ~azure.ai.projects.models.DataGenerationJob or JSON or IO[bytes] + :param job: The job to create. Is either a DataGenerationJob type or a IO[bytes] type. + Required. + :type job: ~azure.ai.projects.models.DataGenerationJob or + ~azure.ai.projects.types.DataGenerationJob or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -13752,7 +15296,7 @@ async def delete_generation_job(self, job_id: str, **kwargs: Any) -> None: return cls(pipeline_response, None, {}) # type: ignore -class BetaAgentsOperations: +class BetaAgentsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -13770,7 +15314,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") async def _create_optimization_job_initial( - self, job: Union[_models.OptimizationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any + self, + job: Union[_models.AgentOptimizationJob, _types.AgentOptimizationJob, IO[bytes]], + *, + operation_id: Optional[str] = None, + **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -13840,51 +15388,58 @@ async def _create_optimization_job_initial( @overload async def begin_create_optimization_job( self, - job: _models.OptimizationJob, + job: _models.AgentOptimizationJob, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.OptimizationJobResult]: + ) -> AsyncLROPoller[_models.AgentOptimizationJobResult]: """Create an agent optimization job. Creates an optimization job and returns the queued job. Honors ``Operation-Id`` for idempotent retry. :param job: The job to create. Required. - :type job: ~azure.ai.projects.models.OptimizationJob + :type job: ~azure.ai.projects.models.AgentOptimizationJob :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns OptimizationJobResult. The - OptimizationJobResult is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.OptimizationJobResult] + :return: An instance of AsyncLROPoller that returns AgentOptimizationJobResult. The + AgentOptimizationJobResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.AgentOptimizationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def begin_create_optimization_job( - self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.OptimizationJobResult]: + self, + job: _types.AgentOptimizationJob, + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AgentOptimizationJobResult]: """Create an agent optimization job. Creates an optimization job and returns the queued job. Honors ``Operation-Id`` for idempotent retry. :param job: The job to create. Required. - :type job: JSON + :type job: ~azure.ai.projects.types.AgentOptimizationJob :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns OptimizationJobResult. The - OptimizationJobResult is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.OptimizationJobResult] + :return: An instance of AsyncLROPoller that returns AgentOptimizationJobResult. The + AgentOptimizationJobResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.AgentOptimizationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -13896,7 +15451,7 @@ async def begin_create_optimization_job( operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.OptimizationJobResult]: + ) -> AsyncLROPoller[_models.AgentOptimizationJobResult]: """Create an agent optimization job. Creates an optimization job and returns the queued job. Honors ``Operation-Id`` for idempotent @@ -13910,37 +15465,44 @@ async def begin_create_optimization_job( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns OptimizationJobResult. The - OptimizationJobResult is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.OptimizationJobResult] + :return: An instance of AsyncLROPoller that returns AgentOptimizationJobResult. The + AgentOptimizationJobResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.AgentOptimizationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def begin_create_optimization_job( - self, job: Union[_models.OptimizationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.OptimizationJobResult]: + self, + job: Union[_models.AgentOptimizationJob, _types.AgentOptimizationJob, IO[bytes]], + *, + operation_id: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.AgentOptimizationJobResult]: """Create an agent optimization job. Creates an optimization job and returns the queued job. Honors ``Operation-Id`` for idempotent retry. - :param job: The job to create. Is one of the following types: OptimizationJob, JSON, IO[bytes] + :param job: The job to create. Is either a AgentOptimizationJob type or a IO[bytes] type. Required. - :type job: ~azure.ai.projects.models.OptimizationJob or JSON or IO[bytes] + :type job: ~azure.ai.projects.models.AgentOptimizationJob or + ~azure.ai.projects.types.AgentOptimizationJob or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str - :return: An instance of AsyncLROPoller that returns OptimizationJobResult. The - OptimizationJobResult is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.OptimizationJobResult] + :return: An instance of AsyncLROPoller that returns AgentOptimizationJobResult. The + AgentOptimizationJobResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.AgentOptimizationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OptimizationJobResult] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentOptimizationJobResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -13965,7 +15527,7 @@ def get_long_running_output(pipeline_response): ) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - deserialized = _deserialize(_models.OptimizationJobResult, response.json().get("result", {})) + deserialized = _deserialize(_models.AgentOptimizationJobResult, response.json().get("result", {})) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized @@ -13984,26 +15546,26 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.OptimizationJobResult].from_continuation_token( + return AsyncLROPoller[_models.AgentOptimizationJobResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.OptimizationJobResult]( + return AsyncLROPoller[_models.AgentOptimizationJobResult]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @distributed_trace_async - async def get_optimization_job(self, job_id: str, **kwargs: Any) -> _models.OptimizationJob: + async def get_optimization_job(self, job_id: str, **kwargs: Any) -> _models.AgentOptimizationJob: """Get an agent optimization job. Retrieves an optimization job by its identifier. :param job_id: The ID of the job. Required. :type job_id: str - :return: OptimizationJob. The OptimizationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.OptimizationJob + :return: AgentOptimizationJob. The AgentOptimizationJob is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentOptimizationJob :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -14017,7 +15579,7 @@ async def get_optimization_job(self, job_id: str, **kwargs: Any) -> _models.Opti _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.OptimizationJob] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentOptimizationJob] = kwargs.pop("cls", None) _request = build_beta_agents_get_optimization_job_request( job_id=job_id, @@ -14057,7 +15619,7 @@ async def get_optimization_job(self, job_id: str, **kwargs: Any) -> _models.Opti if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.OptimizationJob, response.json()) + deserialized = _deserialize(_models.AgentOptimizationJob, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -14074,7 +15636,7 @@ def list_optimization_jobs( status: Optional[Union[str, _models.JobStatus]] = None, agent_name: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.OptimizationJobListItem"]: + ) -> AsyncItemPaged["_models.AgentOptimizationJobListItem"]: """List agent optimization jobs. Lists optimization jobs with cursor pagination and optional status or agent name filters. @@ -14098,15 +15660,15 @@ def list_optimization_jobs( :paramtype status: str or ~azure.ai.projects.models.JobStatus :keyword agent_name: Filter to jobs targeting this agent name. Default value is None. :paramtype agent_name: str - :return: An iterator like instance of OptimizationJobListItem + :return: An iterator like instance of AgentOptimizationJobListItem :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.OptimizationJobListItem] + ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.AgentOptimizationJobListItem] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.OptimizationJobListItem]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.AgentOptimizationJobListItem]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -14138,7 +15700,7 @@ def prepare_request(_continuation_token=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.OptimizationJobListItem], + List[_models.AgentOptimizationJobListItem], deserialized.get("data", []), ) if cls: @@ -14167,7 +15729,7 @@ async def get_next(_continuation_token=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.OptimizationJob: + async def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.AgentOptimizationJob: """Cancel an agent optimization job. Requests cancellation of a running or queued job and returns an error if the job is already in @@ -14175,8 +15737,8 @@ async def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.O :param job_id: The ID of the job to cancel. Required. :type job_id: str - :return: OptimizationJob. The OptimizationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.OptimizationJob + :return: AgentOptimizationJob. The AgentOptimizationJob is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentOptimizationJob :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -14190,7 +15752,7 @@ async def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.O _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.OptimizationJob] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentOptimizationJob] = kwargs.pop("cls", None) _request = build_beta_agents_cancel_optimization_job_request( job_id=job_id, @@ -14227,7 +15789,7 @@ async def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.O if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.OptimizationJob, response.json()) + deserialized = _deserialize(_models.AgentOptimizationJob, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore 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 e490237abf83..d893d0919896 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -32,6 +33,19 @@ AgentEvaluatorGenerationJobSource, AgentIdentity, AgentObjectVersions, + AgentOptimizationCandidate, + AgentOptimizationDatasetCriterion, + AgentOptimizationDatasetInput, + AgentOptimizationDatasetItem, + AgentOptimizationEvaluatorRef, + AgentOptimizationInlineDatasetInput, + AgentOptimizationJob, + AgentOptimizationJobInputs, + AgentOptimizationJobListItem, + AgentOptimizationJobProgress, + AgentOptimizationJobResult, + AgentOptimizationOptions, + AgentOptimizationReferenceDatasetInput, AgentSessionResource, AgentTaxonomyInput, AgentVersionDetails, @@ -96,6 +110,7 @@ CosmosDBIndex, CreateAsyncResponse, CreateSkillVersionFromFilesBody, + CreateTranscriptionResponseJsonUsage, CronTrigger, CustomCredential, CustomGrammarFormatParam, @@ -202,9 +217,14 @@ InvokeAgentInvocationsApiRoutineAction, InvokeAgentResponsesApiDispatchPayload, InvokeAgentResponsesApiRoutineAction, + LlmGeneratedVoiceGreetingConfig, LocalShellToolParam, LocalSkillParam, + LogProbProperties, LoraConfig, + MCPListToolsTool, + MCPListToolsToolAnnotations, + MCPListToolsToolInputSchema, MCPTool, MCPToolFilter, MCPToolRequireApproval, @@ -226,6 +246,7 @@ MemoryStoreSearchResult, MemoryStoreUpdateCompletedResult, MemoryStoreUpdateResult, + Metadata, MicrosoftFabricPreviewTool, ModelCredentialRequest, ModelDeployment, @@ -238,6 +259,8 @@ MonthlyRecurrenceSchedule, NamespaceToolParam, NoAuthenticationCredentials, + OmitPropertiesRealtimeResponse, + OmitPropertiesRealtimeResponse1, OneTimeTrigger, OpenApiAnonymousAuthDetails, OpenApiAuthDetails, @@ -249,24 +272,13 @@ OpenApiProjectConnectionSecurityScheme, OpenApiTool, OpenApiToolboxTool, - OptimizationAgentIdentifier, - OptimizationCandidate, - OptimizationDatasetCriterion, - OptimizationDatasetInput, - OptimizationDatasetItem, - OptimizationEvaluatorRef, - OptimizationInlineDatasetInput, - OptimizationJob, - OptimizationJobInputs, - OptimizationJobListItem, - OptimizationJobProgress, - OptimizationJobResult, - OptimizationOptions, - OptimizationReferenceDatasetInput, + OptimizedAgentIdentifier, OtlpTelemetryEndpoint, PendingUploadRequest, PendingUploadResponse, + PickPropertiesVoiceAudioConfig, ProceduralMemoryItem, + ProgrammaticToolCallingParam, PromotionInfo, PromptAgentDefinition, PromptAgentDefinitionTextOptions, @@ -277,6 +289,44 @@ ProtocolVersionRecord, RaiConfig, RankingOptions, + RealtimeAudioFormats, + RealtimeAudioFormatsAudioPcm, + RealtimeAudioFormatsAudioPcma, + RealtimeAudioFormatsAudioPcmu, + RealtimeConversationItem, + RealtimeConversationItemFunctionCall, + RealtimeConversationItemFunctionCallOutput, + RealtimeConversationItemMessage, + RealtimeConversationItemMessageAssistant, + RealtimeConversationItemMessageAssistantContent, + RealtimeConversationItemMessageSystem, + RealtimeConversationItemMessageSystemContent, + RealtimeConversationItemMessageUser, + RealtimeConversationItemMessageUserContent, + RealtimeFunctionTool, + RealtimeFunctionToolParameters, + RealtimeMCPApprovalRequest, + RealtimeMCPApprovalResponse, + RealtimeMCPError, + RealtimeMCPHTTPError, + RealtimeMCPListTools, + RealtimeMCPProtocolError, + RealtimeMCPToolCall, + RealtimeMCPToolExecutionError, + RealtimeReasoning, + RealtimeResponseStatusDetails, + RealtimeResponseStatusDetailsError, + RealtimeResponseUsage, + RealtimeResponseUsageInputTokenDetails, + RealtimeResponseUsageInputTokenDetailsCachedTokensDetails, + RealtimeResponseUsageOutputTokenDetails, + RealtimeServerEvent, + RealtimeServerEventConversationItemInputAudioTranscriptionFailedError, + RealtimeServerEventError, + RealtimeServerEventErrorError, + RealtimeServerEventRateLimitsUpdatedRateLimits, + RealtimeServerEventResponseContentPartAdded, + RealtimeServerEventResponseContentPartAddedPart, Reasoning, RecurrenceSchedule, RecurrenceTrigger, @@ -310,6 +360,7 @@ SkillVersion, SpecificApplyPatchParam, SpecificFunctionShellParam, + SpecificProgrammaticToolCallingParam, StructuredInputDefinition, StructuredOutputDefinition, TaskGenerationDataGenerationJobOptions, @@ -318,6 +369,7 @@ TelemetryConfig, TelemetryEndpoint, TelemetryEndpointAuth, + TemplateVoiceGreetingConfig, TextResponseFormat, TextResponseFormatJsonObject, TextResponseFormatJsonSchema, @@ -353,6 +405,9 @@ TracesDataGenerationJobOptions, TracesDataGenerationJobSource, TracesEvaluatorGenerationJobSource, + TranscriptTextUsageDuration, + TranscriptTextUsageTokens, + TranscriptTextUsageTokensInputTokenDetails, Trigger, UpdateModelVersionRequest, UpdateToolboxRequest, @@ -361,6 +416,128 @@ VersionRefIndicator, VersionSelectionRule, VersionSelector, + VoiceAgentAnimationConfig, + VoiceAgentAvatarIceServer, + VoiceAgentAvatarScene, + VoiceAgentAvatarVideoBackground, + VoiceAgentAvatarVideoCrop, + VoiceAgentAvatarVideoParams, + VoiceAgentAvatarVideoResolution, + VoiceAgentClientEventConversationItemCreate, + VoiceAgentClientEventConversationItemDelete, + VoiceAgentClientEventConversationItemRetrieve, + VoiceAgentClientEventConversationItemTruncate, + VoiceAgentClientEventInputAudioBufferAppend, + VoiceAgentClientEventInputAudioBufferClear, + VoiceAgentClientEventInputAudioBufferCommit, + VoiceAgentClientEventOutputAudioBufferClear, + VoiceAgentClientEventResponseCancel, + VoiceAgentClientEventResponseCreate, + VoiceAgentClientEventSessionAvatarConnect, + VoiceAgentClientEventSessionUpdate, + VoiceAgentDefinition, + VoiceAgentEchoCancellation, + VoiceAgentFunctionTool, + VoiceAgentInterimResponseConfig, + VoiceAgentLlmInterimResponseConfig, + VoiceAgentMcpTool, + VoiceAgentRealtimeResponse, + VoiceAgentResponseCreateParams, + VoiceAgentResponseEventContentPart, + VoiceAgentSemanticVadTurnDetection, + VoiceAgentServerEventConversationItemAdded, + VoiceAgentServerEventConversationItemCreated, + VoiceAgentServerEventConversationItemDeleted, + VoiceAgentServerEventConversationItemDone, + VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted, + VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta, + VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed, + VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment, + VoiceAgentServerEventConversationItemRetrieved, + VoiceAgentServerEventConversationItemTruncated, + VoiceAgentServerEventInputAudioBufferCleared, + VoiceAgentServerEventInputAudioBufferCommitted, + VoiceAgentServerEventInputAudioBufferSpeechStarted, + VoiceAgentServerEventInputAudioBufferSpeechStopped, + VoiceAgentServerEventInputAudioBufferTimeoutTriggered, + VoiceAgentServerEventMcpListToolsCompleted, + VoiceAgentServerEventMcpListToolsFailed, + VoiceAgentServerEventMcpListToolsInProgress, + VoiceAgentServerEventOutputAudioBufferCleared, + VoiceAgentServerEventRateLimitsUpdated, + VoiceAgentServerEventResponseAnimationBlendshapesDelta, + VoiceAgentServerEventResponseAnimationBlendshapesDone, + VoiceAgentServerEventResponseAnimationVisemeDelta, + VoiceAgentServerEventResponseAnimationVisemeDone, + VoiceAgentServerEventResponseAudioDelta, + VoiceAgentServerEventResponseAudioDone, + VoiceAgentServerEventResponseAudioTimestampDelta, + VoiceAgentServerEventResponseAudioTimestampDone, + VoiceAgentServerEventResponseAudioTranscriptDelta, + VoiceAgentServerEventResponseAudioTranscriptDone, + VoiceAgentServerEventResponseContentPartDone, + VoiceAgentServerEventResponseCreated, + VoiceAgentServerEventResponseDone, + VoiceAgentServerEventResponseFunctionCallArgumentsDelta, + VoiceAgentServerEventResponseFunctionCallArgumentsDone, + VoiceAgentServerEventResponseMcpCallArgumentsDelta, + VoiceAgentServerEventResponseMcpCallArgumentsDone, + VoiceAgentServerEventResponseMcpCallCompleted, + VoiceAgentServerEventResponseMcpCallFailed, + VoiceAgentServerEventResponseMcpCallInProgress, + VoiceAgentServerEventResponseOutputItemAdded, + VoiceAgentServerEventResponseOutputItemDone, + VoiceAgentServerEventResponseTextDelta, + VoiceAgentServerEventResponseTextDone, + VoiceAgentServerEventResponseVideoDelta, + VoiceAgentServerEventSessionAvatarConnecting, + VoiceAgentServerEventSessionAvatarSwitchToIdle, + VoiceAgentServerEventSessionAvatarSwitchToSpeaking, + VoiceAgentServerEventSessionCreated, + VoiceAgentServerEventSessionUpdated, + VoiceAgentServerEventWarning, + VoiceAgentServerEventWarningDetails, + VoiceAgentSessionAvatarConfig, + VoiceAgentSessionResponseConfig, + VoiceAgentSessionUpdateConfig, + VoiceAgentStaticInterimResponseConfig, + VoiceAgentTool, + VoiceAgentTranscriptionPhrase, + VoiceAgentTranscriptionWord, + VoiceAssistantMessageItem, + VoiceAudioConfig, + VoiceAudioFormat, + VoiceAudioInputConfig, + VoiceAudioOutputConfig, + VoiceAvatarConfig, + VoiceAzureSemanticVadEnTurnDetection, + VoiceAzureSemanticVadMultilingualTurnDetection, + VoiceAzureSemanticVadTurnDetection, + VoiceConversation, + VoiceConversationItem, + VoiceEndOfUtteranceDetection, + VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, + VoiceGreetingConfig, + VoiceInputTranscription, + VoiceItemAudioResponse, + VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem, + VoiceMcpCallItem, + VoiceMcpListToolsItem, + VoiceMessageItem, + VoiceNoiseReduction, + VoiceRecordingChannelLayout, + VoiceRecordingResponse, + VoiceResponse, + VoiceResponseAudio, + VoiceResponseAudioOutput, + VoiceServerVadTurnDetection, + VoiceSystemMessageItem, + VoiceSystemTool, + VoiceToolboxTool, + VoiceTurnDetection, + VoiceUserMessageItem, WebSearchApproximateLocation, WebSearchConfiguration, WebSearchPreviewTool, @@ -380,17 +557,21 @@ AgentIdentityStatus, AgentKind, AgentObjectType, + AgentOptimizationDatasetInputType, AgentSessionStatus, AgentState, + AgentStateSource, AgentVersionStatus, AttackStrategy, AzureAISearchQueryType, + CallableToolAllowedCaller, CodeDependencyResolution, ComputerEnvironment, ConnectionType, ContainerMemoryLimit, ContainerNetworkPolicyParamType, ContainerSkillType, + CreateTranscriptionResponseJsonUsageType, CredentialType, CustomToolParamFormatType, DataGenerationJobOutputType, @@ -431,10 +612,18 @@ MemoryStoreUpdateStatus, OpenApiAuthType, OperationState, - OptimizationDatasetInputType, PageOrder, PendingUploadType, RankerVersionType, + RealtimeAudioFormatsType, + RealtimeClientEventType, + RealtimeConversationItemMessageType, + RealtimeConversationItemType, + RealtimeMcpErrorType, + RealtimeReasoningEffort, + RealtimeServerEventType, + ReasoningEffort, + ReasoningModeEnum, RecurrenceType, RiskCategory, RoutineActionType, @@ -457,6 +646,7 @@ TelemetryEndpointKind, TelemetryTransportProtocol, TextResponseFormatConfigurationType, + ToolChoiceOptions, ToolChoiceParamType, ToolSearchExecutionType, ToolType, @@ -465,6 +655,29 @@ TriggerType, VersionIndicatorType, VersionSelectorType, + VoiceAgentAnimationOutputType, + VoiceAgentEchoCancellationReferenceSource, + VoiceAgentInterimResponseTrigger, + VoiceAgentSessionIncludeOption, + VoiceAgentToolResponseScheduling, + VoiceAgentWebSocketSubprotocol, + VoiceAudioCodec, + VoiceAudioContainerFormat, + VoiceAudioFormatType, + VoiceAudioRole, + VoiceAudioTimestampType, + VoiceAvatarOutputProtocol, + VoiceAvatarType, + VoiceConversationItemType, + VoiceConversationStatus, + VoiceEndOfUtteranceDetectionModel, + VoiceEndOfUtteranceThresholdLevel, + VoiceInputTranscriptionModel, + VoiceModelType, + VoiceNoiseReductionType, + VoiceOutputModality, + VoiceSystemToolName, + VoiceTurnDetectionType, ) from ._patch import __all__ as _patch_all from ._patch import * @@ -489,6 +702,19 @@ "AgentEvaluatorGenerationJobSource", "AgentIdentity", "AgentObjectVersions", + "AgentOptimizationCandidate", + "AgentOptimizationDatasetCriterion", + "AgentOptimizationDatasetInput", + "AgentOptimizationDatasetItem", + "AgentOptimizationEvaluatorRef", + "AgentOptimizationInlineDatasetInput", + "AgentOptimizationJob", + "AgentOptimizationJobInputs", + "AgentOptimizationJobListItem", + "AgentOptimizationJobProgress", + "AgentOptimizationJobResult", + "AgentOptimizationOptions", + "AgentOptimizationReferenceDatasetInput", "AgentSessionResource", "AgentTaxonomyInput", "AgentVersionDetails", @@ -553,6 +779,7 @@ "CosmosDBIndex", "CreateAsyncResponse", "CreateSkillVersionFromFilesBody", + "CreateTranscriptionResponseJsonUsage", "CronTrigger", "CustomCredential", "CustomGrammarFormatParam", @@ -659,9 +886,14 @@ "InvokeAgentInvocationsApiRoutineAction", "InvokeAgentResponsesApiDispatchPayload", "InvokeAgentResponsesApiRoutineAction", + "LlmGeneratedVoiceGreetingConfig", "LocalShellToolParam", "LocalSkillParam", + "LogProbProperties", "LoraConfig", + "MCPListToolsTool", + "MCPListToolsToolAnnotations", + "MCPListToolsToolInputSchema", "MCPTool", "MCPToolFilter", "MCPToolRequireApproval", @@ -683,6 +915,7 @@ "MemoryStoreSearchResult", "MemoryStoreUpdateCompletedResult", "MemoryStoreUpdateResult", + "Metadata", "MicrosoftFabricPreviewTool", "ModelCredentialRequest", "ModelDeployment", @@ -695,6 +928,8 @@ "MonthlyRecurrenceSchedule", "NamespaceToolParam", "NoAuthenticationCredentials", + "OmitPropertiesRealtimeResponse", + "OmitPropertiesRealtimeResponse1", "OneTimeTrigger", "OpenApiAnonymousAuthDetails", "OpenApiAuthDetails", @@ -706,24 +941,13 @@ "OpenApiProjectConnectionSecurityScheme", "OpenApiTool", "OpenApiToolboxTool", - "OptimizationAgentIdentifier", - "OptimizationCandidate", - "OptimizationDatasetCriterion", - "OptimizationDatasetInput", - "OptimizationDatasetItem", - "OptimizationEvaluatorRef", - "OptimizationInlineDatasetInput", - "OptimizationJob", - "OptimizationJobInputs", - "OptimizationJobListItem", - "OptimizationJobProgress", - "OptimizationJobResult", - "OptimizationOptions", - "OptimizationReferenceDatasetInput", + "OptimizedAgentIdentifier", "OtlpTelemetryEndpoint", "PendingUploadRequest", "PendingUploadResponse", + "PickPropertiesVoiceAudioConfig", "ProceduralMemoryItem", + "ProgrammaticToolCallingParam", "PromotionInfo", "PromptAgentDefinition", "PromptAgentDefinitionTextOptions", @@ -734,6 +958,44 @@ "ProtocolVersionRecord", "RaiConfig", "RankingOptions", + "RealtimeAudioFormats", + "RealtimeAudioFormatsAudioPcm", + "RealtimeAudioFormatsAudioPcma", + "RealtimeAudioFormatsAudioPcmu", + "RealtimeConversationItem", + "RealtimeConversationItemFunctionCall", + "RealtimeConversationItemFunctionCallOutput", + "RealtimeConversationItemMessage", + "RealtimeConversationItemMessageAssistant", + "RealtimeConversationItemMessageAssistantContent", + "RealtimeConversationItemMessageSystem", + "RealtimeConversationItemMessageSystemContent", + "RealtimeConversationItemMessageUser", + "RealtimeConversationItemMessageUserContent", + "RealtimeFunctionTool", + "RealtimeFunctionToolParameters", + "RealtimeMCPApprovalRequest", + "RealtimeMCPApprovalResponse", + "RealtimeMCPError", + "RealtimeMCPHTTPError", + "RealtimeMCPListTools", + "RealtimeMCPProtocolError", + "RealtimeMCPToolCall", + "RealtimeMCPToolExecutionError", + "RealtimeReasoning", + "RealtimeResponseStatusDetails", + "RealtimeResponseStatusDetailsError", + "RealtimeResponseUsage", + "RealtimeResponseUsageInputTokenDetails", + "RealtimeResponseUsageInputTokenDetailsCachedTokensDetails", + "RealtimeResponseUsageOutputTokenDetails", + "RealtimeServerEvent", + "RealtimeServerEventConversationItemInputAudioTranscriptionFailedError", + "RealtimeServerEventError", + "RealtimeServerEventErrorError", + "RealtimeServerEventRateLimitsUpdatedRateLimits", + "RealtimeServerEventResponseContentPartAdded", + "RealtimeServerEventResponseContentPartAddedPart", "Reasoning", "RecurrenceSchedule", "RecurrenceTrigger", @@ -767,6 +1029,7 @@ "SkillVersion", "SpecificApplyPatchParam", "SpecificFunctionShellParam", + "SpecificProgrammaticToolCallingParam", "StructuredInputDefinition", "StructuredOutputDefinition", "TaskGenerationDataGenerationJobOptions", @@ -775,6 +1038,7 @@ "TelemetryConfig", "TelemetryEndpoint", "TelemetryEndpointAuth", + "TemplateVoiceGreetingConfig", "TextResponseFormat", "TextResponseFormatJsonObject", "TextResponseFormatJsonSchema", @@ -810,6 +1074,9 @@ "TracesDataGenerationJobOptions", "TracesDataGenerationJobSource", "TracesEvaluatorGenerationJobSource", + "TranscriptTextUsageDuration", + "TranscriptTextUsageTokens", + "TranscriptTextUsageTokensInputTokenDetails", "Trigger", "UpdateModelVersionRequest", "UpdateToolboxRequest", @@ -818,6 +1085,128 @@ "VersionRefIndicator", "VersionSelectionRule", "VersionSelector", + "VoiceAgentAnimationConfig", + "VoiceAgentAvatarIceServer", + "VoiceAgentAvatarScene", + "VoiceAgentAvatarVideoBackground", + "VoiceAgentAvatarVideoCrop", + "VoiceAgentAvatarVideoParams", + "VoiceAgentAvatarVideoResolution", + "VoiceAgentClientEventConversationItemCreate", + "VoiceAgentClientEventConversationItemDelete", + "VoiceAgentClientEventConversationItemRetrieve", + "VoiceAgentClientEventConversationItemTruncate", + "VoiceAgentClientEventInputAudioBufferAppend", + "VoiceAgentClientEventInputAudioBufferClear", + "VoiceAgentClientEventInputAudioBufferCommit", + "VoiceAgentClientEventOutputAudioBufferClear", + "VoiceAgentClientEventResponseCancel", + "VoiceAgentClientEventResponseCreate", + "VoiceAgentClientEventSessionAvatarConnect", + "VoiceAgentClientEventSessionUpdate", + "VoiceAgentDefinition", + "VoiceAgentEchoCancellation", + "VoiceAgentFunctionTool", + "VoiceAgentInterimResponseConfig", + "VoiceAgentLlmInterimResponseConfig", + "VoiceAgentMcpTool", + "VoiceAgentRealtimeResponse", + "VoiceAgentResponseCreateParams", + "VoiceAgentResponseEventContentPart", + "VoiceAgentSemanticVadTurnDetection", + "VoiceAgentServerEventConversationItemAdded", + "VoiceAgentServerEventConversationItemCreated", + "VoiceAgentServerEventConversationItemDeleted", + "VoiceAgentServerEventConversationItemDone", + "VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted", + "VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta", + "VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed", + "VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment", + "VoiceAgentServerEventConversationItemRetrieved", + "VoiceAgentServerEventConversationItemTruncated", + "VoiceAgentServerEventInputAudioBufferCleared", + "VoiceAgentServerEventInputAudioBufferCommitted", + "VoiceAgentServerEventInputAudioBufferSpeechStarted", + "VoiceAgentServerEventInputAudioBufferSpeechStopped", + "VoiceAgentServerEventInputAudioBufferTimeoutTriggered", + "VoiceAgentServerEventMcpListToolsCompleted", + "VoiceAgentServerEventMcpListToolsFailed", + "VoiceAgentServerEventMcpListToolsInProgress", + "VoiceAgentServerEventOutputAudioBufferCleared", + "VoiceAgentServerEventRateLimitsUpdated", + "VoiceAgentServerEventResponseAnimationBlendshapesDelta", + "VoiceAgentServerEventResponseAnimationBlendshapesDone", + "VoiceAgentServerEventResponseAnimationVisemeDelta", + "VoiceAgentServerEventResponseAnimationVisemeDone", + "VoiceAgentServerEventResponseAudioDelta", + "VoiceAgentServerEventResponseAudioDone", + "VoiceAgentServerEventResponseAudioTimestampDelta", + "VoiceAgentServerEventResponseAudioTimestampDone", + "VoiceAgentServerEventResponseAudioTranscriptDelta", + "VoiceAgentServerEventResponseAudioTranscriptDone", + "VoiceAgentServerEventResponseContentPartDone", + "VoiceAgentServerEventResponseCreated", + "VoiceAgentServerEventResponseDone", + "VoiceAgentServerEventResponseFunctionCallArgumentsDelta", + "VoiceAgentServerEventResponseFunctionCallArgumentsDone", + "VoiceAgentServerEventResponseMcpCallArgumentsDelta", + "VoiceAgentServerEventResponseMcpCallArgumentsDone", + "VoiceAgentServerEventResponseMcpCallCompleted", + "VoiceAgentServerEventResponseMcpCallFailed", + "VoiceAgentServerEventResponseMcpCallInProgress", + "VoiceAgentServerEventResponseOutputItemAdded", + "VoiceAgentServerEventResponseOutputItemDone", + "VoiceAgentServerEventResponseTextDelta", + "VoiceAgentServerEventResponseTextDone", + "VoiceAgentServerEventResponseVideoDelta", + "VoiceAgentServerEventSessionAvatarConnecting", + "VoiceAgentServerEventSessionAvatarSwitchToIdle", + "VoiceAgentServerEventSessionAvatarSwitchToSpeaking", + "VoiceAgentServerEventSessionCreated", + "VoiceAgentServerEventSessionUpdated", + "VoiceAgentServerEventWarning", + "VoiceAgentServerEventWarningDetails", + "VoiceAgentSessionAvatarConfig", + "VoiceAgentSessionResponseConfig", + "VoiceAgentSessionUpdateConfig", + "VoiceAgentStaticInterimResponseConfig", + "VoiceAgentTool", + "VoiceAgentTranscriptionPhrase", + "VoiceAgentTranscriptionWord", + "VoiceAssistantMessageItem", + "VoiceAudioConfig", + "VoiceAudioFormat", + "VoiceAudioInputConfig", + "VoiceAudioOutputConfig", + "VoiceAvatarConfig", + "VoiceAzureSemanticVadEnTurnDetection", + "VoiceAzureSemanticVadMultilingualTurnDetection", + "VoiceAzureSemanticVadTurnDetection", + "VoiceConversation", + "VoiceConversationItem", + "VoiceEndOfUtteranceDetection", + "VoiceFunctionCallItem", + "VoiceFunctionCallOutputItem", + "VoiceGreetingConfig", + "VoiceInputTranscription", + "VoiceItemAudioResponse", + "VoiceMcpApprovalRequestItem", + "VoiceMcpApprovalResponseItem", + "VoiceMcpCallItem", + "VoiceMcpListToolsItem", + "VoiceMessageItem", + "VoiceNoiseReduction", + "VoiceRecordingChannelLayout", + "VoiceRecordingResponse", + "VoiceResponse", + "VoiceResponseAudio", + "VoiceResponseAudioOutput", + "VoiceServerVadTurnDetection", + "VoiceSystemMessageItem", + "VoiceSystemTool", + "VoiceToolboxTool", + "VoiceTurnDetection", + "VoiceUserMessageItem", "WebSearchApproximateLocation", "WebSearchConfiguration", "WebSearchPreviewTool", @@ -834,17 +1223,21 @@ "AgentIdentityStatus", "AgentKind", "AgentObjectType", + "AgentOptimizationDatasetInputType", "AgentSessionStatus", "AgentState", + "AgentStateSource", "AgentVersionStatus", "AttackStrategy", "AzureAISearchQueryType", + "CallableToolAllowedCaller", "CodeDependencyResolution", "ComputerEnvironment", "ConnectionType", "ContainerMemoryLimit", "ContainerNetworkPolicyParamType", "ContainerSkillType", + "CreateTranscriptionResponseJsonUsageType", "CredentialType", "CustomToolParamFormatType", "DataGenerationJobOutputType", @@ -885,10 +1278,18 @@ "MemoryStoreUpdateStatus", "OpenApiAuthType", "OperationState", - "OptimizationDatasetInputType", "PageOrder", "PendingUploadType", "RankerVersionType", + "RealtimeAudioFormatsType", + "RealtimeClientEventType", + "RealtimeConversationItemMessageType", + "RealtimeConversationItemType", + "RealtimeMcpErrorType", + "RealtimeReasoningEffort", + "RealtimeServerEventType", + "ReasoningEffort", + "ReasoningModeEnum", "RecurrenceType", "RiskCategory", "RoutineActionType", @@ -911,6 +1312,7 @@ "TelemetryEndpointKind", "TelemetryTransportProtocol", "TextResponseFormatConfigurationType", + "ToolChoiceOptions", "ToolChoiceParamType", "ToolSearchExecutionType", "ToolType", @@ -919,6 +1321,29 @@ "TriggerType", "VersionIndicatorType", "VersionSelectorType", + "VoiceAgentAnimationOutputType", + "VoiceAgentEchoCancellationReferenceSource", + "VoiceAgentInterimResponseTrigger", + "VoiceAgentSessionIncludeOption", + "VoiceAgentToolResponseScheduling", + "VoiceAgentWebSocketSubprotocol", + "VoiceAudioCodec", + "VoiceAudioContainerFormat", + "VoiceAudioFormatType", + "VoiceAudioRole", + "VoiceAudioTimestampType", + "VoiceAvatarOutputProtocol", + "VoiceAvatarType", + "VoiceConversationItemType", + "VoiceConversationStatus", + "VoiceEndOfUtteranceDetectionModel", + "VoiceEndOfUtteranceThresholdLevel", + "VoiceInputTranscriptionModel", + "VoiceModelType", + "VoiceNoiseReductionType", + "VoiceOutputModality", + "VoiceSystemToolName", + "VoiceTurnDetectionType", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() 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 b7f159dd935a..21edb0afa073 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 @@ -20,6 +20,8 @@ class _AgentDefinitionOptInKeys(str, Enum, metaclass=CaseInsensitiveEnumMeta): """EXTERNAL_AGENTS_V1_PREVIEW.""" DRAFT_AGENTS_V1_PREVIEW = "DraftAgents=V1Preview" """DRAFT_AGENTS_V1_PREVIEW.""" + VOICE_AGENTS_V1_PREVIEW = "VoiceAgents=V1Preview" + """VOICE_AGENTS_V1_PREVIEW.""" class _FoundryFeaturesOptInKeys(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -80,6 +82,8 @@ class AgentEndpointProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): """MCP.""" INVOCATIONS = "invocations" """INVOCATIONS.""" + VOICE = "voice" + """VOICE.""" INVOCATIONS_WS = "invocations_ws" """WebSocket-based protocol for hosted voice and real-time streaming agents.""" @@ -106,6 +110,8 @@ class AgentKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): """WORKFLOW.""" EXTERNAL = "external" """EXTERNAL.""" + VOICE = "voice" + """VOICE.""" class AgentObjectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -123,6 +129,15 @@ class AgentObjectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """AGENT_CONTAINER.""" +class AgentOptimizationDatasetInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Discriminator values for the dataset input union.""" + + INLINE = "inline" + """Inline dataset — items are provided directly in the request body.""" + REFERENCE = "reference" + """Reference to a registered Foundry dataset by name and version.""" + + class AgentSessionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The status of an agent session.""" @@ -153,6 +168,17 @@ class AgentState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Agent endpoint rejects all requests.""" +class AgentStateSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates the source of an agent's operational state. Empty when the state is not derived from + a specific source. + """ + + AGENT_INSTANCE_IDENTITY = "agent_instance_identity" + """The state is derived from the agent's instance identity.""" + AGENT_BLUEPRINT = "agent_blueprint" + """The state is derived from the agent's blueprint.""" + + class AgentVersionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The provisioning status of an agent version.""" @@ -254,6 +280,15 @@ class AzureAISearchQueryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Query type ``vector_semantic_hybrid``.""" +class CallableToolAllowedCaller(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of CallableToolAllowedCaller.""" + + DIRECT = "direct" + """DIRECT.""" + PROGRAMMATIC = "programmatic" + """PROGRAMMATIC.""" + + class CodeDependencyResolution(str, Enum, metaclass=CaseInsensitiveEnumMeta): """How package dependencies are resolved at deployment time for a code-based hosted agent.""" @@ -335,6 +370,15 @@ class ContainerSkillType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """INLINE.""" +class CreateTranscriptionResponseJsonUsageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of CreateTranscriptionResponseJsonUsageType.""" + + TOKENS = "tokens" + """TOKENS.""" + DURATION = "duration" + """DURATION.""" + + class CredentialType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The credential type used by the connection.""" @@ -799,15 +843,6 @@ class OperationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The operation has been canceled by the user.""" -class OptimizationDatasetInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Discriminator values for the dataset input union.""" - - INLINE = "inline" - """Inline dataset — items are provided directly in the request body.""" - REFERENCE = "reference" - """Reference to a registered Foundry dataset by name and version.""" - - class PageOrder(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of PageOrder.""" @@ -838,6 +873,230 @@ class RankerVersionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """DEFAULT_2024_11_15.""" +class RealtimeAudioFormatsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of RealtimeAudioFormatsType.""" + + AUDIO_PCM = "audio/pcm" + """AUDIO_PCM.""" + AUDIO_PCMU = "audio/pcmu" + """AUDIO_PCMU.""" + AUDIO_PCMA = "audio/pcma" + """AUDIO_PCMA.""" + + +class RealtimeClientEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of RealtimeClientEventType.""" + + CONVERSATION_ITEM_CREATE = "conversation.item.create" + """CONVERSATION_ITEM_CREATE.""" + CONVERSATION_ITEM_DELETE = "conversation.item.delete" + """CONVERSATION_ITEM_DELETE.""" + CONVERSATION_ITEM_RETRIEVE = "conversation.item.retrieve" + """CONVERSATION_ITEM_RETRIEVE.""" + CONVERSATION_ITEM_TRUNCATE = "conversation.item.truncate" + """CONVERSATION_ITEM_TRUNCATE.""" + INPUT_AUDIO_BUFFER_APPEND = "input_audio_buffer.append" + """INPUT_AUDIO_BUFFER_APPEND.""" + INPUT_AUDIO_BUFFER_CLEAR = "input_audio_buffer.clear" + """INPUT_AUDIO_BUFFER_CLEAR.""" + OUTPUT_AUDIO_BUFFER_CLEAR = "output_audio_buffer.clear" + """OUTPUT_AUDIO_BUFFER_CLEAR.""" + INPUT_AUDIO_BUFFER_COMMIT = "input_audio_buffer.commit" + """INPUT_AUDIO_BUFFER_COMMIT.""" + RESPONSE_CANCEL = "response.cancel" + """RESPONSE_CANCEL.""" + RESPONSE_CREATE = "response.create" + """RESPONSE_CREATE.""" + SESSION_UPDATE = "session.update" + """SESSION_UPDATE.""" + + +class RealtimeConversationItemMessageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of RealtimeConversationItemMessageType.""" + + SYSTEM = "system" + """SYSTEM.""" + USER = "user" + """USER.""" + ASSISTANT = "assistant" + """ASSISTANT.""" + + +class RealtimeConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of RealtimeConversationItemType.""" + + FUNCTION_CALL = "function_call" + """FUNCTION_CALL.""" + FUNCTION_CALL_OUTPUT = "function_call_output" + """FUNCTION_CALL_OUTPUT.""" + MCP_APPROVAL_RESPONSE = "mcp_approval_response" + """MCP_APPROVAL_RESPONSE.""" + MCP_LIST_TOOLS = "mcp_list_tools" + """MCP_LIST_TOOLS.""" + MCP_CALL = "mcp_call" + """MCP_CALL.""" + MCP_APPROVAL_REQUEST = "mcp_approval_request" + """MCP_APPROVAL_REQUEST.""" + + +class RealtimeMcpErrorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of RealtimeMcpErrorType.""" + + PROTOCOL_ERROR = "protocol_error" + """PROTOCOL_ERROR.""" + TOOL_EXECUTION_ERROR = "tool_execution_error" + """TOOL_EXECUTION_ERROR.""" + HTTP_ERROR = "http_error" + """HTTP_ERROR.""" + + +class RealtimeReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Constrains effort on reasoning for reasoning-capable Realtime models such as + ``gpt-realtime-2``. + """ + + MINIMAL = "minimal" + """MINIMAL.""" + LOW = "low" + """LOW.""" + MEDIUM = "medium" + """MEDIUM.""" + HIGH = "high" + """HIGH.""" + XHIGH = "xhigh" + """XHIGH.""" + + +class RealtimeServerEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of RealtimeServerEventType.""" + + CONVERSATION_CREATED = "conversation.created" + """CONVERSATION_CREATED.""" + CONVERSATION_ITEM_CREATED = "conversation.item.created" + """CONVERSATION_ITEM_CREATED.""" + CONVERSATION_ITEM_DELETED = "conversation.item.deleted" + """CONVERSATION_ITEM_DELETED.""" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED = "conversation.item.input_audio_transcription.completed" + """CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED.""" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA = "conversation.item.input_audio_transcription.delta" + """CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA.""" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED = "conversation.item.input_audio_transcription.failed" + """CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED.""" + CONVERSATION_ITEM_RETRIEVED = "conversation.item.retrieved" + """CONVERSATION_ITEM_RETRIEVED.""" + CONVERSATION_ITEM_TRUNCATED = "conversation.item.truncated" + """CONVERSATION_ITEM_TRUNCATED.""" + ERROR = "error" + """ERROR.""" + INPUT_AUDIO_BUFFER_CLEARED = "input_audio_buffer.cleared" + """INPUT_AUDIO_BUFFER_CLEARED.""" + INPUT_AUDIO_BUFFER_COMMITTED = "input_audio_buffer.committed" + """INPUT_AUDIO_BUFFER_COMMITTED.""" + INPUT_AUDIO_BUFFER_DTMF_EVENT_RECEIVED = "input_audio_buffer.dtmf_event_received" + """INPUT_AUDIO_BUFFER_DTMF_EVENT_RECEIVED.""" + INPUT_AUDIO_BUFFER_SPEECH_STARTED = "input_audio_buffer.speech_started" + """INPUT_AUDIO_BUFFER_SPEECH_STARTED.""" + INPUT_AUDIO_BUFFER_SPEECH_STOPPED = "input_audio_buffer.speech_stopped" + """INPUT_AUDIO_BUFFER_SPEECH_STOPPED.""" + RATE_LIMITS_UPDATED = "rate_limits.updated" + """RATE_LIMITS_UPDATED.""" + RESPONSE_OUTPUT_AUDIO_DELTA = "response.output_audio.delta" + """RESPONSE_OUTPUT_AUDIO_DELTA.""" + RESPONSE_OUTPUT_AUDIO_DONE = "response.output_audio.done" + """RESPONSE_OUTPUT_AUDIO_DONE.""" + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA = "response.output_audio_transcript.delta" + """RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA.""" + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE = "response.output_audio_transcript.done" + """RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE.""" + RESPONSE_CONTENT_PART_ADDED = "response.content_part.added" + """RESPONSE_CONTENT_PART_ADDED.""" + RESPONSE_CONTENT_PART_DONE = "response.content_part.done" + """RESPONSE_CONTENT_PART_DONE.""" + RESPONSE_CREATED = "response.created" + """RESPONSE_CREATED.""" + RESPONSE_DONE = "response.done" + """RESPONSE_DONE.""" + RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA = "response.function_call_arguments.delta" + """RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA.""" + RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE = "response.function_call_arguments.done" + """RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE.""" + RESPONSE_OUTPUT_ITEM_ADDED = "response.output_item.added" + """RESPONSE_OUTPUT_ITEM_ADDED.""" + RESPONSE_OUTPUT_ITEM_DONE = "response.output_item.done" + """RESPONSE_OUTPUT_ITEM_DONE.""" + RESPONSE_OUTPUT_TEXT_DELTA = "response.output_text.delta" + """RESPONSE_OUTPUT_TEXT_DELTA.""" + RESPONSE_OUTPUT_TEXT_DONE = "response.output_text.done" + """RESPONSE_OUTPUT_TEXT_DONE.""" + SESSION_CREATED = "session.created" + """SESSION_CREATED.""" + SESSION_UPDATED = "session.updated" + """SESSION_UPDATED.""" + OUTPUT_AUDIO_BUFFER_STARTED = "output_audio_buffer.started" + """OUTPUT_AUDIO_BUFFER_STARTED.""" + OUTPUT_AUDIO_BUFFER_STOPPED = "output_audio_buffer.stopped" + """OUTPUT_AUDIO_BUFFER_STOPPED.""" + OUTPUT_AUDIO_BUFFER_CLEARED = "output_audio_buffer.cleared" + """OUTPUT_AUDIO_BUFFER_CLEARED.""" + CONVERSATION_ITEM_ADDED = "conversation.item.added" + """CONVERSATION_ITEM_ADDED.""" + CONVERSATION_ITEM_DONE = "conversation.item.done" + """CONVERSATION_ITEM_DONE.""" + INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED = "input_audio_buffer.timeout_triggered" + """INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED.""" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT = "conversation.item.input_audio_transcription.segment" + """CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT.""" + MCP_LIST_TOOLS_IN_PROGRESS = "mcp_list_tools.in_progress" + """MCP_LIST_TOOLS_IN_PROGRESS.""" + MCP_LIST_TOOLS_COMPLETED = "mcp_list_tools.completed" + """MCP_LIST_TOOLS_COMPLETED.""" + MCP_LIST_TOOLS_FAILED = "mcp_list_tools.failed" + """MCP_LIST_TOOLS_FAILED.""" + RESPONSE_MCP_CALL_ARGUMENTS_DELTA = "response.mcp_call_arguments.delta" + """RESPONSE_MCP_CALL_ARGUMENTS_DELTA.""" + RESPONSE_MCP_CALL_ARGUMENTS_DONE = "response.mcp_call_arguments.done" + """RESPONSE_MCP_CALL_ARGUMENTS_DONE.""" + RESPONSE_MCP_CALL_IN_PROGRESS = "response.mcp_call.in_progress" + """RESPONSE_MCP_CALL_IN_PROGRESS.""" + RESPONSE_MCP_CALL_COMPLETED = "response.mcp_call.completed" + """RESPONSE_MCP_CALL_COMPLETED.""" + RESPONSE_MCP_CALL_FAILED = "response.mcp_call.failed" + """RESPONSE_MCP_CALL_FAILED.""" + + +class ReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Constrains effort on reasoning for reasoning models. Currently supported values are ``none``, + ``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. + """ + + NONE = "none" + """NONE.""" + MINIMAL = "minimal" + """MINIMAL.""" + LOW = "low" + """LOW.""" + MEDIUM = "medium" + """MEDIUM.""" + HIGH = "high" + """HIGH.""" + XHIGH = "xhigh" + """XHIGH.""" + MAX = "max" + """MAX.""" + + +class ReasoningModeEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of ReasoningModeEnum.""" + + STANDARD = "standard" + """STANDARD.""" + PRO = "pro" + """PRO.""" + + class RecurrenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Recurrence type.""" @@ -1135,6 +1394,17 @@ class ToolboxToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """TOOLBOX_SEARCH_PREVIEW.""" +class ToolChoiceOptions(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Tool choice mode.""" + + NONE = "none" + """NONE.""" + AUTO = "auto" + """AUTO.""" + REQUIRED = "required" + """REQUIRED.""" + + class ToolChoiceParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of ToolChoiceParamType.""" @@ -1146,6 +1416,8 @@ class ToolChoiceParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """MCP.""" CUSTOM = "custom" """CUSTOM.""" + PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" + """PROGRAMMATIC_TOOL_CALLING.""" APPLY_PATCH = "apply_patch" """APPLY_PATCH.""" SHELL = "shell" @@ -1194,6 +1466,8 @@ class ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """MCP.""" CODE_INTERPRETER = "code_interpreter" """CODE_INTERPRETER.""" + PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" + """PROGRAMMATIC_TOOL_CALLING.""" IMAGE_GENERATION = "image_generation" """IMAGE_GENERATION.""" LOCAL_SHELL = "local_shell" @@ -1278,3 +1552,285 @@ class VersionSelectorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): FIXED_RATIO = "FixedRatio" """FIXED_RATIO.""" + + +class VoiceAgentAnimationOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """An animation output produced by a voice-agent session.""" + + BLENDSHAPES = "blendshapes" + """BLENDSHAPES.""" + VISEME_ID = "viseme_id" + """VISEME_ID.""" + + +class VoiceAgentEchoCancellationReferenceSource( # pylint: disable=name-too-long + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The source of reference audio used for echo cancellation.""" + + SERVER = "server" + """SERVER.""" + CLIENT = "client" + """CLIENT.""" + + +class VoiceAgentInterimResponseTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """A condition that may trigger an interim response.""" + + LATENCY = "latency" + """LATENCY.""" + TOOL = "tool" + """TOOL.""" + + +class VoiceAgentSessionIncludeOption(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Additional fields that a voice-agent session may include in service outputs.""" + + INPUT_AUDIO_TRANSCRIPTION_LOGPROBS = "item.input_audio_transcription.logprobs" + """INPUT_AUDIO_TRANSCRIPTION_LOGPROBS.""" + INPUT_AUDIO_TRANSCRIPTION_PHRASES = "item.input_audio_transcription.phrases" + """INPUT_AUDIO_TRANSCRIPTION_PHRASES.""" + FILE_SEARCH_CALL_RESULTS = "file_search_call.results" + """FILE_SEARCH_CALL_RESULTS.""" + + +class VoiceAgentToolResponseScheduling(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """When a tool invocation creates a follow-up response. Additional values may be added over time.""" + + SILENT = "silent" + """Do not create a follow-up response after the service-executed tool invocation completes.""" + WHEN_IDLE = "when_idle" + """Create a follow-up response when the conversation is idle.""" + INTERRUPT = "interrupt" + """Interrupt the active response and create a follow-up response.""" + SKIP_IF_BUSY = "skip_if_busy" + """Create a follow-up response only when no response is active.""" + + +class VoiceAgentWebSocketSubprotocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The WebSocket subprotocol supported by a voice-agent connection.""" + + REALTIME = "realtime" + """REALTIME.""" + + +class VoiceAudioCodec(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """An audio codec. Additional values may be added over time.""" + + PCM16 = "pcm16" + """16-bit pulse-code modulation.""" + PCMU = "pcmu" + """G.711 mu-law.""" + PCMA = "pcma" + """G.711 A-law.""" + + +class VoiceAudioContainerFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """An audio container format. Additional values may be added over time.""" + + WAV = "wav" + """Waveform Audio File Format.""" + + +class VoiceAudioFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The audio format type. Values follow the OpenAI Realtime wire schema and are exempt from the + snake_case enum-value rule. + """ + + PCM = "audio/pcm" + """16-bit PCM.""" + PCMU = "audio/pcmu" + """G.711 mu-law (telephony).""" + PCMA = "audio/pcma" + """G.711 A-law (telephony).""" + + +class VoiceAudioRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """A voice-audio participant role. Additional values may be added over time.""" + + USER = "user" + """Audio produced by the user.""" + AGENT = "agent" + """Audio produced by the agent.""" + + +class VoiceAudioTimestampType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """An output-audio timestamp kind supported by a voice agent.""" + + WORD = "word" + """Word-level timestamps.""" + + +class VoiceAvatarOutputProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The transport used to deliver the avatar video stream.""" + + WEBRTC = "webrtc" + """WEBRTC.""" + WEBSOCKET = "websocket" + """WEBSOCKET.""" + WEBSOCKET_BINARY = "websocket-binary" + """Binary WebSocket transport.""" + + +class VoiceAvatarType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The avatar type.""" + + VIDEO_AVATAR = "video_avatar" + """VIDEO_AVATAR.""" + PHOTO_AVATAR = "photo_avatar" + """PHOTO_AVATAR.""" + + +class VoiceConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of a persisted voice conversation item.""" + + MESSAGE = "message" + """A message item.""" + FUNCTION_CALL = "function_call" + """A function-call request item.""" + FUNCTION_CALL_OUTPUT = "function_call_output" + """A function-call output item.""" + MCP_LIST_TOOLS = "mcp_list_tools" + """An MCP list-tools item.""" + MCP_CALL = "mcp_call" + """An MCP call item.""" + MCP_APPROVAL_REQUEST = "mcp_approval_request" + """An MCP approval request item.""" + MCP_APPROVAL_RESPONSE = "mcp_approval_response" + """An MCP approval response item.""" + + +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 = "in_progress" + """The live session is active, or post-session persistence finalization is still pending.""" + COMPLETED = "completed" + """Persistence finalization succeeded. This includes normal or client-initiated close, the + ``end_conversation`` system tool, a max-duration ``1001`` close, and client or network + disconnects that the service can still finalize.""" + FAILED = "failed" + """A terminal service, bridge, storage, or unrecoverable transport failure prevented persistence + finalization.""" + + +class VoiceEndOfUtteranceDetectionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The semantic end-of-utterance detection model.""" + + SEMANTIC_DETECTION_V1 = "semantic_detection_v1" + """The default semantic detection model.""" + SEMANTIC_DETECTION_V1_EN = "semantic_detection_v1_en" + """The English-optimized semantic detection model.""" + SEMANTIC_DETECTION_V1_MULTILINGUAL = "semantic_detection_v1_multilingual" + """The multilingual semantic detection model.""" + SMART_END_OF_TURN_DETECTION = "smart_end_of_turn_detection" + """The smart end-of-turn detection model.""" + + +class VoiceEndOfUtteranceThresholdLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The sensitivity threshold for semantic end-of-utterance detection.""" + + LOW = "low" + """The low sensitivity threshold.""" + MEDIUM = "medium" + """The medium sensitivity threshold.""" + HIGH = "high" + """The high sensitivity threshold.""" + DEFAULT = "default" + """The service-selected sensitivity threshold.""" + + +class VoiceInputTranscriptionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The input-audio transcription model. 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 added over time. + """ + + WHISPER1 = "whisper-1" + """OpenAI Whisper.""" + GPT_REALTIME_WHISPER = "gpt-realtime-whisper" + """OpenAI GPT Realtime Whisper.""" + GPT4_O_TRANSCRIBE = "gpt-4o-transcribe" + """OpenAI GPT-4o transcribe.""" + GPT4_O_MINI_TRANSCRIBE = "gpt-4o-mini-transcribe" + """OpenAI GPT-4o mini transcribe.""" + GPT4_O_TRANSCRIBE_DIARIZE = "gpt-4o-transcribe-diarize" + """OpenAI GPT-4o transcribe with speaker diarization.""" + GPT_TRANSCRIBE = "gpt-transcribe" + """OpenAI GPT Transcribe.""" + GPT_LIVE_TRANSCRIBE = "gpt-live-transcribe" + """OpenAI GPT Live Transcribe.""" + MAI_TRANSCRIBE = "mai-transcribe" + """MAI transcription.""" + AZURE_SPEECH = "azure-speech" + """Azure AI Speech to text.""" + + +class VoiceModelType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """How the model backing a voice agent is served. This is independent of the architecture + (realtime or cascaded), which the service derives from the selected model. + """ + + MANAGED = "managed" + """The service hosts and manages the named model, for example ``gpt-realtime``.""" + SELF_DEPLOYED = "self_deployed" + """The service uses the customer's own Foundry deployment named by ``model``.""" + + +class VoiceNoiseReductionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The input audio noise reduction mode.""" + + NEAR_FIELD = "near_field" + """NEAR_FIELD.""" + FAR_FIELD = "far_field" + """FAR_FIELD.""" + AZURE_DEEP_NOISE_SUPPRESSION = "azure_deep_noise_suppression" + """Azure deep noise suppression.""" + + +class VoiceOutputModality(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """An output modality the agent may produce. ``animation`` and ``avatar`` are used when an avatar + is configured. + """ + + TEXT = "text" + """TEXT.""" + AUDIO = "audio" + """AUDIO.""" + ANIMATION = "animation" + """ANIMATION.""" + AVATAR = "avatar" + """AVATAR.""" + + +class VoiceSystemToolName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """A service-managed voice-session control action. Known values are stable; additional values may + be added over time. + """ + + END_CONVERSATION = "end_conversation" + """Ends the active conversation.""" + + +class VoiceTurnDetectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The turn-detection strategy. Additional values may be added over time.""" + + SERVER_VAD = "server_vad" + """Server-side voice activity detection.""" + SEMANTIC_VAD = "semantic_vad" + """Semantic voice activity detection.""" + AZURE_SEMANTIC_VAD = "azure_semantic_vad" + """Azure semantic voice activity detection.""" + AZURE_SEMANTIC_VAD_EN = "azure_semantic_vad_en" + """English-optimized Azure semantic voice activity detection.""" + AZURE_SEMANTIC_VAD_MULTILINGUAL = "azure_semantic_vad_multilingual" + """Multilingual Azure semantic voice activity detection.""" 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 15d2e20c44f2..9299b9caec47 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 @@ -18,8 +18,10 @@ AgentEndpointAuthorizationSchemeType, AgentKind, AgentObjectType, + AgentOptimizationDatasetInputType, ContainerNetworkPolicyParamType, ContainerSkillType, + CreateTranscriptionResponseJsonUsageType, CredentialType, CustomToolParamFormatType, DataGenerationJobOutputType, @@ -38,8 +40,13 @@ MemoryStoreKind, MemoryStoreObjectType, OpenApiAuthType, - OptimizationDatasetInputType, PendingUploadType, + RealtimeAudioFormatsType, + RealtimeClientEventType, + RealtimeConversationItemMessageType, + RealtimeConversationItemType, + RealtimeMcpErrorType, + RealtimeServerEventType, RecurrenceType, RoutineActionType, RoutineDispatchPayloadType, @@ -55,13 +62,15 @@ TriggerType, VersionIndicatorType, VersionSelectorType, + VoiceConversationItemType, + VoiceTurnDetectionType, ) if TYPE_CHECKING: - from .. import _types, models as _models + from .. import _unions, models as _models -class _CreateAgentVersionFromCodeContent(_Model): +class _CreateAgentVersionFromCodeContent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Multipart request body for updating or versioning a code-based agent (POST /agents/{name} and POST /agents/{name}/versions). @@ -99,7 +108,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class _CreateAgentVersionFromCodeMetadata(_Model): +class _CreateAgentVersionFromCodeMetadata(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """JSON metadata for code-based agent operations (create, update, create version). The agent name comes from the URL path parameter or the ``x-ms-agent-name`` header, so it is not included in this model. The content hash (SHA-256 of the zip) is carried in the ``x-ms-code-zip-sha256`` @@ -152,7 +161,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Tool(_Model): +class Tool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """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: @@ -161,29 +170,30 @@ class Tool(_Model): CaptureStructuredOutputsTool, CodeInterpreterTool, ComputerTool, ComputerUsePreviewTool, CustomToolParam, MicrosoftFabricPreviewTool, FabricIQPreviewTool, FileSearchTool, FunctionTool, ImageGenTool, LocalShellToolParam, MCPTool, MemorySearchPreviewTool, NamespaceToolParam, - OpenApiTool, SharepointPreviewTool, FunctionShellToolParam, ToolSearchToolParam, WebSearchTool, - WebSearchPreviewTool, WorkIQPreviewTool + OpenApiTool, ProgrammaticToolCallingParam, SharepointPreviewTool, FunctionShellToolParam, + ToolSearchToolParam, WebSearchTool, WebSearchPreviewTool, WorkIQPreviewTool :ivar type: Required. Known values are: "function", "file_search", "computer", - "computer_use_preview", "web_search", "mcp", "code_interpreter", "image_generation", - "local_shell", "shell", "custom", "namespace", "tool_search", "web_search_preview", - "apply_patch", "a2a_preview", "bing_custom_search_preview", "browser_automation_preview", - "fabric_dataagent_preview", "sharepoint_grounding_preview", "memory_search_preview", - "work_iq_preview", "fabric_iq_preview", "toolbox_search_preview", "azure_ai_search", - "azure_function", "bing_grounding", "capture_structured_outputs", and "openapi". + "computer_use_preview", "web_search", "mcp", "code_interpreter", "programmatic_tool_calling", + "image_generation", "local_shell", "shell", "custom", "namespace", "tool_search", + "web_search_preview", "apply_patch", "a2a_preview", "bing_custom_search_preview", + "browser_automation_preview", "fabric_dataagent_preview", "sharepoint_grounding_preview", + "memory_search_preview", "work_iq_preview", "fabric_iq_preview", "toolbox_search_preview", + "azure_ai_search", "azure_function", "bing_grounding", "capture_structured_outputs", and + "openapi". :vartype type: str or ~azure.ai.projects.models.ToolType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) """Required. Known values are: \"function\", \"file_search\", \"computer\", - \"computer_use_preview\", \"web_search\", \"mcp\", \"code_interpreter\", \"image_generation\", - \"local_shell\", \"shell\", \"custom\", \"namespace\", \"tool_search\", \"web_search_preview\", - \"apply_patch\", \"a2a_preview\", \"bing_custom_search_preview\", - \"browser_automation_preview\", \"fabric_dataagent_preview\", \"sharepoint_grounding_preview\", - \"memory_search_preview\", \"work_iq_preview\", \"fabric_iq_preview\", - \"toolbox_search_preview\", \"azure_ai_search\", \"azure_function\", \"bing_grounding\", - \"capture_structured_outputs\", and \"openapi\".""" + \"computer_use_preview\", \"web_search\", \"mcp\", \"code_interpreter\", + \"programmatic_tool_calling\", \"image_generation\", \"local_shell\", \"shell\", \"custom\", + \"namespace\", \"tool_search\", \"web_search_preview\", \"apply_patch\", \"a2a_preview\", + \"bing_custom_search_preview\", \"browser_automation_preview\", \"fabric_dataagent_preview\", + \"sharepoint_grounding_preview\", \"memory_search_preview\", \"work_iq_preview\", + \"fabric_iq_preview\", \"toolbox_search_preview\", \"azure_ai_search\", \"azure_function\", + \"bing_grounding\", \"capture_structured_outputs\", and \"openapi\".""" @overload def __init__( @@ -203,7 +213,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class A2APreviewTool(Tool, discriminator="a2a_preview"): +class A2APreviewTool(Tool, discriminator="a2a_preview"): # pylint: disable=docstring-keyword-should-match-keyword-only """An agent implementing the A2A protocol. :ivar type: The type of the tool. Always ``"a2a_preview``. Required. A2A_PREVIEW. @@ -261,7 +271,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.A2A_PREVIEW # type: ignore -class ToolboxTool(_Model): +class ToolboxTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """An abstract representation of a tool stored in a toolbox. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -323,7 +333,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class A2APreviewToolboxTool(ToolboxTool, discriminator="a2a_preview"): +class A2APreviewToolboxTool( + ToolboxTool, discriminator="a2a_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only """An A2A tool stored in a toolbox. :ivar name: Optional user-defined name for this tool or configuration. @@ -396,7 +408,7 @@ class A2AProtocolConfiguration(_Model): """Configuration specific to the A2A protocol.""" -class ActivityProtocolConfiguration(_Model): +class ActivityProtocolConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Configuration specific to the activity protocol. :ivar enable_m365_public_endpoint: Whether to enable the M365 public endpoint for the activity @@ -425,7 +437,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentBlueprintReference(_Model): +class AgentBlueprintReference(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """AgentBlueprintReference. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -457,7 +469,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentCard(_Model): +class AgentCard(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """AgentCard. :ivar version: The version of the agent card. Required. @@ -495,7 +507,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentCardSkill(_Model): +class AgentCardSkill(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """AgentCardSkill. :ivar id: a unique identifier for the skill. Required. @@ -543,7 +555,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InsightRequest(_Model): +class InsightRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The request of the insights report. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -578,7 +590,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentClusterInsightRequest(InsightRequest, discriminator="AgentClusterInsight"): +class AgentClusterInsightRequest( + InsightRequest, discriminator="AgentClusterInsight" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Insights on set of Agent Evaluation Results. :ivar type: The type of request. Required. Cluster Insight on an Agent. @@ -618,7 +632,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = InsightType.AGENT_CLUSTER_INSIGHT # type: ignore -class InsightResult(_Model): +class InsightResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The result of the insights. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -652,7 +666,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentClusterInsightResult(InsightResult, discriminator="AgentClusterInsight"): +class AgentClusterInsightResult( + InsightResult, discriminator="AgentClusterInsight" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Insights from the agent cluster analysis. :ivar type: The type of insights result. Required. Cluster Insight on an Agent. @@ -687,7 +703,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = InsightType.AGENT_CLUSTER_INSIGHT # type: ignore -class DataGenerationJobSource(_Model): +class DataGenerationJobSource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The base source model for data generation jobs. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -730,7 +746,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentDataGenerationJobSource(DataGenerationJobSource, discriminator="agent"): +class AgentDataGenerationJobSource( + DataGenerationJobSource, discriminator="agent" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Agent source for data generation jobs — references an agent to fetch instructions and metadata from. @@ -775,13 +793,15 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = DataGenerationJobSourceType.AGENT # type: ignore -class AgentDefinition(_Model): +class AgentDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """AgentDefinition. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ExternalAgentDefinition, HostedAgentDefinition, PromptAgentDefinition, WorkflowAgentDefinition + ExternalAgentDefinition, HostedAgentDefinition, PromptAgentDefinition, VoiceAgentDefinition, + WorkflowAgentDefinition - :ivar kind: Required. Known values are: "prompt", "hosted", "workflow", and "external". + :ivar kind: Required. Known values are: "prompt", "hosted", "workflow", "external", and + "voice". :vartype kind: str or ~azure.ai.projects.models.AgentKind :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. :vartype rai_config: ~azure.ai.projects.models.RaiConfig @@ -789,7 +809,7 @@ class AgentDefinition(_Model): __mapping__: dict[str, _Model] = {} kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"prompt\", \"hosted\", \"workflow\", and \"external\".""" + """Required. Known values are: \"prompt\", \"hosted\", \"workflow\", \"external\", and \"voice\".""" rai_config: Optional["_models.RaiConfig"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Configuration for Responsible AI (RAI) content filtering and safety features.""" @@ -812,7 +832,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentDetails(_Model): +class AgentDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """AgentDetails. :ivar object: The object type, which is always 'agent'. Required. AGENT. @@ -824,6 +844,10 @@ class AgentDetails(_Model): :ivar state: The operational state of the agent. Controls whether the agent endpoint accepts or rejects requests. Required. Known values are: "enabled" and "disabled". :vartype state: str or ~azure.ai.projects.models.AgentState + :ivar state_source: The source of the agent's operational state. When the agent is disabled, + indicates where the disabled state originates from. Empty when not derived from a specific + source. Known values are: "agent_instance_identity" and "agent_blueprint". + :vartype state_source: str or ~azure.ai.projects.models.AgentStateSource :ivar versions: The latest version of the agent. Required. :vartype versions: ~azure.ai.projects.models.AgentObjectVersions :ivar agent_endpoint: The endpoint configuration for the agent. @@ -847,6 +871,10 @@ class AgentDetails(_Model): state: Union[str, "_models.AgentState"] = rest_field(visibility=["read"]) """The operational state of the agent. Controls whether the agent endpoint accepts or rejects requests. Required. Known values are: \"enabled\" and \"disabled\".""" + state_source: Optional[Union[str, "_models.AgentStateSource"]] = rest_field(visibility=["read"]) + """The source of the agent's operational state. When the agent is disabled, indicates where the + disabled state originates from. Empty when not derived from a specific source. Known values + are: \"agent_instance_identity\" and \"agent_blueprint\".""" versions: "_models.AgentObjectVersions" = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The latest version of the agent. Required.""" agent_endpoint: Optional["_models.AgentEndpointConfig"] = rest_field( @@ -884,7 +912,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentEndpointAuthorizationScheme(_Model): +class AgentEndpointAuthorizationScheme(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """AgentEndpointAuthorizationScheme. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -919,7 +947,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentEndpointConfig(_Model): +class AgentEndpointConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """AgentEndpointConfig. :ivar version_selector: The version selector of the agent endpoint determines how traffic is @@ -966,7 +994,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorGenerationJobSource(_Model): +class EvaluatorGenerationJobSource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The base source model for evaluator generation jobs. Polymorphic over ``type``. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -1001,7 +1029,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator="agent"): +class AgentEvaluatorGenerationJobSource( + EvaluatorGenerationJobSource, discriminator="agent" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Agent source for evaluator generation jobs — references an agent to fetch instructions and metadata from. @@ -1050,7 +1080,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = EvaluatorGenerationJobSourceType.AGENT # type: ignore -class BaseCredentials(_Model): +class BaseCredentials(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A base class for connection credentials. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -1112,7 +1142,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = CredentialType.AGENTIC_IDENTITY_PREVIEW # type: ignore -class AgentIdentity(_Model): +class AgentIdentity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """AgentIdentity. :ivar principal_id: The principal ID of the agent instance. Required. @@ -1155,7 +1185,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentObjectVersions(_Model): +class AgentObjectVersions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """AgentObjectVersions. :ivar latest: Required. @@ -1183,53 +1213,59 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentSessionResource(_Model): - """An agent session providing a long-lived compute sandbox for hosted agent invocations. +class AgentOptimizationCandidate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Aggregated evaluation result for a single candidate agent configuration across all tasks. - :ivar agent_session_id: The session identifier. Required. - :vartype agent_session_id: str - :ivar version_indicator: The version indicator determining which agent version backs this - session. Required. - :vartype version_indicator: ~azure.ai.projects.models.VersionIndicator - :ivar status: The current status of the session. Required. Known values are: "creating", - "active", "idle", "updating", "failed", "deleting", "deleted", and "expired". - :vartype status: str or ~azure.ai.projects.models.AgentSessionStatus - :ivar created_at: The Unix timestamp (in seconds) when the session was created. Required. - :vartype created_at: ~datetime.datetime - :ivar last_accessed_at: The Unix timestamp (in seconds) when the session was last accessed. - Required. - :vartype last_accessed_at: ~datetime.datetime - :ivar expires_at: The Unix timestamp (in seconds) when the session expires (rolling, 30 days - from last activity). Required. - :vartype expires_at: ~datetime.datetime + :ivar candidate_id: Server-assigned candidate identifier. Use with GET /candidates/{id} + sub-endpoints. + :vartype candidate_id: str + :ivar name: Display name of the candidate (e.g., 'baseline', 'instruction-v2'). Required. + :vartype name: str + :ivar mutations: What was mutated from the baseline (e.g., {system_prompt: 'new prompt'}). + :vartype mutations: dict[str, any] + :ivar avg_score: Average composite score across all tasks. Required. + :vartype avg_score: float + :ivar avg_tokens: Average token usage across all tasks. Required. + :vartype avg_tokens: float + :ivar eval_id: Foundry evaluation identifier used to score this candidate. + :vartype eval_id: str + :ivar eval_run_id: Foundry evaluation run identifier for this candidate's scoring run. + :vartype eval_run_id: str + :ivar promotion: Promotion metadata. Null if the candidate has not been promoted. + :vartype promotion: ~azure.ai.projects.models.PromotionInfo """ - agent_session_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The session identifier. Required.""" - version_indicator: "_models.VersionIndicator" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The version indicator determining which agent version backs this session. Required.""" - status: Union[str, "_models.AgentSessionStatus"] = rest_field( + candidate_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Server-assigned candidate identifier. Use with GET /candidates/{id} sub-endpoints.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Display name of the candidate (e.g., 'baseline', 'instruction-v2'). Required.""" + mutations: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """What was mutated from the baseline (e.g., {system_prompt: 'new prompt'}).""" + avg_score: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Average composite score across all tasks. Required.""" + avg_tokens: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Average token usage across all tasks. Required.""" + eval_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Foundry evaluation identifier used to score this candidate.""" + eval_run_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Foundry evaluation run identifier for this candidate's scoring run.""" + promotion: Optional["_models.PromotionInfo"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The current status of the session. Required. Known values are: \"creating\", \"active\", - \"idle\", \"updating\", \"failed\", \"deleting\", \"deleted\", and \"expired\".""" - created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") - """The Unix timestamp (in seconds) when the session was created. Required.""" - last_accessed_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") - """The Unix timestamp (in seconds) when the session was last accessed. Required.""" - expires_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") - """The Unix timestamp (in seconds) when the session expires (rolling, 30 days from last activity). - Required.""" + """Promotion metadata. Null if the candidate has not been promoted.""" @overload def __init__( self, *, - agent_session_id: str, - version_indicator: "_models.VersionIndicator", - status: Union[str, "_models.AgentSessionStatus"], + name: str, + avg_score: float, + avg_tokens: float, + candidate_id: Optional[str] = None, + mutations: Optional[dict[str, Any]] = None, + eval_id: Optional[str] = None, + eval_run_id: Optional[str] = None, + promotion: Optional["_models.PromotionInfo"] = None, ) -> None: ... @overload @@ -1243,20 +1279,53 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationTaxonomyInput(_Model): - """Input configuration for the evaluation taxonomy. +class AgentOptimizationDatasetCriterion(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Evaluation criterion: a name + instruction pair used for per-item scoring. + + :ivar name: Criterion name. Required. + :vartype name: str + :ivar instruction: Criterion instruction / description. Required. + :vartype instruction: str + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Criterion name. Required.""" + instruction: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Criterion instruction / description. Required.""" + + @overload + def __init__( + self, + *, + name: str, + instruction: 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 AgentOptimizationDatasetInput(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Base discriminated model for dataset input. Either inline items or a registered reference. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AgentTaxonomyInput + AgentOptimizationInlineDatasetInput, AgentOptimizationReferenceDatasetInput - :ivar type: Input type of the evaluation taxonomy. Required. Known values are: "agent" and - "policy". - :vartype type: str or ~azure.ai.projects.models.EvaluationTaxonomyInputType + :ivar type: Dataset input type discriminator. Required. Known values are: "inline" and + "reference". + :vartype type: str or ~azure.ai.projects.models.AgentOptimizationDatasetInputType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Input type of the evaluation taxonomy. Required. Known values are: \"agent\" and \"policy\".""" + """Dataset input type discriminator. Required. Known values are: \"inline\" and \"reference\".""" @overload def __init__( @@ -1276,32 +1345,38 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentTaxonomyInput(EvaluationTaxonomyInput, discriminator="agent"): - """Input configuration for the evaluation taxonomy when the input type is agent. +class AgentOptimizationDatasetItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A single item in an inline dataset. - :ivar type: Input type of the evaluation taxonomy. Required. Agent. - :vartype type: str or ~azure.ai.projects.models.AGENT - :ivar target: Target configuration for the agent. Required. - :vartype target: ~azure.ai.projects.models.EvaluationTarget - :ivar risk_categories: List of risk categories to evaluate against. Required. - :vartype risk_categories: list[str or ~azure.ai.projects.models.RiskCategory] + :ivar query: The user query / prompt. + :vartype query: str + :ivar ground_truth: Expected ground truth answer. + :vartype ground_truth: str + :ivar desired_num_turns: Desired number of conversation turns for simulation mode (1-20). + :vartype desired_num_turns: int + :ivar criteria: Per-item evaluation criteria. + :vartype criteria: list[~azure.ai.projects.models.AgentOptimizationDatasetCriterion] """ - type: Literal[EvaluationTaxonomyInputType.AGENT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Input type of the evaluation taxonomy. Required. Agent.""" - target: "_models.EvaluationTarget" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Target configuration for the agent. Required.""" - risk_categories: list[Union[str, "_models.RiskCategory"]] = rest_field( - name="riskCategories", visibility=["read", "create", "update", "delete", "query"] + query: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The user query / prompt.""" + ground_truth: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Expected ground truth answer.""" + desired_num_turns: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Desired number of conversation turns for simulation mode (1-20).""" + criteria: Optional[list["_models.AgentOptimizationDatasetCriterion"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """List of risk categories to evaluate against. Required.""" + """Per-item evaluation criteria.""" @overload def __init__( self, *, - target: "_models.EvaluationTarget", - risk_categories: list[Union[str, "_models.RiskCategory"]], + query: Optional[str] = None, + ground_truth: Optional[str] = None, + desired_num_turns: Optional[int] = None, + criteria: Optional[list["_models.AgentOptimizationDatasetCriterion"]] = None, ) -> None: ... @overload @@ -1313,112 +1388,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = EvaluationTaxonomyInputType.AGENT # type: ignore -class AgentVersionDetails(_Model): - """AgentVersionDetails. - - :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 AgentOptimizationEvaluatorRef(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Reference to a named evaluator, optionally pinned to a version. - 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 object: The object type, which is always 'agent.version'. Required. AGENT_VERSION. - :vartype object: str or ~azure.ai.projects.models.AGENT_VERSION - :ivar id: The unique identifier of the agent version. Required. - :vartype id: str - :ivar name: The name of the agent. Name can be used to retrieve/update/delete the agent. - Required. + :ivar name: Evaluator name. Required. :vartype name: str - :ivar version: The version identifier of the agent. Agents are immutable and every update - creates a new version while keeping the name same. Required. + :ivar version: Evaluator version. If not specified, the latest version is used. :vartype version: str - :ivar description: A human-readable description of the agent. - :vartype description: str - :ivar created_at: The Unix timestamp (seconds) when the agent was created. Required. - :vartype created_at: ~datetime.datetime - :ivar definition: Required. - :vartype definition: ~azure.ai.projects.models.AgentDefinition - :ivar draft: Whether this agent version is a draft (candidate) rather than a release. Draft - versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. - Defaults to false. - :vartype draft: bool - :ivar status: The provisioning status of the agent version. Defaults to 'active' for non-hosted - agents. For hosted agents, reflects infrastructure readiness. Known values are: "creating", - "active", "failed", "deleting", and "deleted". - :vartype status: str or ~azure.ai.projects.models.AgentVersionStatus - :ivar instance_identity: The instance identity of the agent. - :vartype instance_identity: ~azure.ai.projects.models.AgentIdentity - :ivar blueprint: The blueprint for the agent. - :vartype blueprint: ~azure.ai.projects.models.AgentIdentity - :ivar blueprint_reference: The blueprint for the agent. - :vartype blueprint_reference: ~azure.ai.projects.models.AgentBlueprintReference - :ivar agent_guid: The unique GUID identifier of the agent. - :vartype agent_guid: str """ - 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.""" - object: Literal[AgentObjectType.AGENT_VERSION] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The object type, which is always 'agent.version'. Required. AGENT_VERSION.""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the agent version. Required.""" name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the agent. Name can be used to retrieve/update/delete the agent. Required.""" - version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version identifier of the agent. Agents are immutable and every update creates a new - version while keeping the name same. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A human-readable description of the agent.""" - created_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (seconds) when the agent was created. Required.""" - definition: "_models.AgentDefinition" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - draft: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether this agent version is a draft (candidate) rather than a release. Draft versions are - recorded but excluded from default 'latest' resolution and are not auto-promoted. Defaults to - false.""" - status: Optional[Union[str, "_models.AgentVersionStatus"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The provisioning status of the agent version. Defaults to 'active' for non-hosted agents. For - hosted agents, reflects infrastructure readiness. Known values are: \"creating\", \"active\", - \"failed\", \"deleting\", and \"deleted\".""" - instance_identity: Optional["_models.AgentIdentity"] = rest_field(visibility=["read"]) - """The instance identity of the agent.""" - blueprint: Optional["_models.AgentIdentity"] = rest_field(visibility=["read"]) - """The blueprint for the agent.""" - blueprint_reference: Optional["_models.AgentBlueprintReference"] = rest_field(visibility=["read"]) - """The blueprint for the agent.""" - agent_guid: Optional[str] = rest_field(visibility=["read"]) - """The unique GUID identifier of the agent.""" + """Evaluator name. Required.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Evaluator version. If not specified, the latest version is used.""" @overload def __init__( self, *, - metadata: dict[str, str], - object: Literal[AgentObjectType.AGENT_VERSION], - id: str, # pylint: disable=redefined-builtin name: str, - version: str, - created_at: datetime.datetime, - definition: "_models.AgentDefinition", - description: Optional[str] = None, - draft: Optional[bool] = None, - status: Optional[Union[str, "_models.AgentVersionStatus"]] = None, + version: Optional[str] = None, ) -> None: ... @overload @@ -1432,52 +1423,31 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AISearchIndexResource(_Model): - """A AI Search Index resource. +class AgentOptimizationInlineDatasetInput( + AgentOptimizationDatasetInput, discriminator="inline" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Inline dataset — items supplied directly in the request body. - :ivar project_connection_id: An index connection ID in an IndexResource attached to this agent. - :vartype project_connection_id: str - :ivar index_name: The name of an index in an IndexResource attached to this agent. - :vartype index_name: str - :ivar query_type: Type of query in an AIIndexResource attached to this agent. Known values are: - "simple", "semantic", "vector", "vector_simple_hybrid", and "vector_semantic_hybrid". - :vartype query_type: str or ~azure.ai.projects.models.AzureAISearchQueryType - :ivar top_k: Number of documents to retrieve from search and present to the model. - :vartype top_k: int - :ivar filter: filter string for search resource. `Learn more here - `_. - :vartype filter: str - :ivar index_asset_id: Index asset id for search resource. - :vartype index_asset_id: str + :ivar type: Dataset input type discriminator. Required. Inline dataset — items are provided + directly in the request body. + :vartype type: str or ~azure.ai.projects.models.INLINE + :ivar dataset_items: Dataset items. Required. + :vartype dataset_items: list[~azure.ai.projects.models.AgentOptimizationDatasetItem] """ - project_connection_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An index connection ID in an IndexResource attached to this agent.""" - index_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of an index in an IndexResource attached to this agent.""" - query_type: Optional[Union[str, "_models.AzureAISearchQueryType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + type: Literal[AgentOptimizationDatasetInputType.INLINE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Dataset input type discriminator. Required. Inline dataset — items are provided directly in the + request body.""" + dataset_items: list["_models.AgentOptimizationDatasetItem"] = rest_field( + name="items", visibility=["read", "create", "update", "delete", "query"] ) - """Type of query in an AIIndexResource attached to this agent. Known values are: \"simple\", - \"semantic\", \"vector\", \"vector_simple_hybrid\", and \"vector_semantic_hybrid\".""" - top_k: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of documents to retrieve from search and present to the model.""" - filter: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """filter string for search resource. `Learn more here - `_.""" - index_asset_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Index asset id for search resource.""" + """Dataset items. Required.""" @overload def __init__( self, *, - project_connection_id: Optional[str] = None, - index_name: Optional[str] = None, - query_type: Optional[Union[str, "_models.AzureAISearchQueryType"]] = None, - top_k: Optional[int] = None, - filter: Optional[str] = None, # pylint: disable=redefined-builtin - index_asset_id: Optional[str] = None, + dataset_items: list["_models.AgentOptimizationDatasetItem"], ) -> None: ... @overload @@ -1489,52 +1459,64 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = AgentOptimizationDatasetInputType.INLINE # type: ignore -class ApiError(_Model): - """ApiError. +class AgentOptimizationJob(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Agent optimization job resource — a long-running job that optimizes an agent's configuration + (instructions, model, skills, tools) to maximize evaluation scores. On success, the result + contains scored candidates. - :ivar code: Required. - :vartype code: str - :ivar message: Required. - :vartype message: str - :ivar param: - :vartype param: str - :ivar type: - :vartype type: str - :ivar details: - :vartype details: list[~azure.ai.projects.models.ApiError] - :ivar additional_info: - :vartype additional_info: dict[str, any] - :ivar debug_info: - :vartype debug_info: dict[str, any] + :ivar id: Server-assigned unique identifier. Required. + :vartype id: str + :ivar inputs: Caller-supplied inputs. + :vartype inputs: ~azure.ai.projects.models.AgentOptimizationJobInputs + :ivar result: Result produced on success. + :vartype result: ~azure.ai.projects.models.AgentOptimizationJobResult + :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 created_at: The timestamp when the job was created, represented in Unix time. Required. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The timestamp when the job was last updated, represented in Unix time. + Required. + :vartype updated_at: ~datetime.datetime + :ivar progress: Progress snapshot. May be present in terminal states reflecting last-known + progress. + :vartype progress: ~azure.ai.projects.models.AgentOptimizationJobProgress + :ivar warnings: Non-fatal warnings emitted at any point during optimization. + :vartype warnings: list[str] """ - code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - details: Optional[list["_models.ApiError"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - additional_info: Optional[dict[str, Any]] = rest_field( - name="additionalInfo", visibility=["read", "create", "update", "delete", "query"] - ) - debug_info: Optional[dict[str, Any]] = rest_field( - name="debugInfo", visibility=["read", "create", "update", "delete", "query"] + id: str = rest_field(visibility=["read"]) + """Server-assigned unique identifier. Required.""" + inputs: Optional["_models.AgentOptimizationJobInputs"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) + """Caller-supplied inputs.""" + result: Optional["_models.AgentOptimizationJobResult"] = rest_field(visibility=["read"]) + """Result produced on success.""" + status: Union[str, "_models.JobStatus"] = rest_field(visibility=["read"]) + """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", + \"succeeded\", \"failed\", and \"cancelled\".""" + error: Optional["_models.ApiError"] = rest_field(visibility=["read"]) + """Error details — populated only on failure.""" + created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The timestamp when the job was created, represented in Unix time. Required.""" + updated_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The timestamp when the job was last updated, represented in Unix time. Required.""" + progress: Optional["_models.AgentOptimizationJobProgress"] = rest_field(visibility=["read"]) + """Progress snapshot. May be present in terminal states reflecting last-known progress.""" + warnings: Optional[list[str]] = rest_field(visibility=["read"]) + """Non-fatal warnings emitted at any point during optimization.""" @overload def __init__( self, *, - code: str, - message: str, - param: Optional[str] = None, - type: Optional[str] = None, - details: Optional[list["_models.ApiError"]] = None, - additional_info: Optional[dict[str, Any]] = None, - debug_info: Optional[dict[str, Any]] = None, + inputs: Optional["_models.AgentOptimizationJobInputs"] = None, ) -> None: ... @overload @@ -1548,21 +1530,54 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ApiErrorResponse(_Model): - """Error response for API failures. +class AgentOptimizationJobInputs(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Caller-supplied inputs for an optimization job. - :ivar error: Required. - :vartype error: ~azure.ai.projects.models.ApiError + :ivar agent: The agent (and pinned version) being optimized. Required. + :vartype agent: ~azure.ai.projects.models.OptimizedAgentIdentifier + :ivar train_dataset: Training dataset — either inline items or a reference to a registered + dataset. Required. Required. + :vartype train_dataset: ~azure.ai.projects.models.AgentOptimizationDatasetInput + :ivar validation_dataset: Optional held-out validation dataset for measuring generalization of + the final candidate. + :vartype validation_dataset: ~azure.ai.projects.models.AgentOptimizationDatasetInput + :ivar evaluators: Job-level evaluators referenced by name and optional version. Required; at + least one must be provided. Required. + :vartype evaluators: list[~azure.ai.projects.models.AgentOptimizationEvaluatorRef] + :ivar options: Tuning knobs and run-mode. + :vartype options: ~azure.ai.projects.models.AgentOptimizationOptions """ - error: "_models.ApiError" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + agent: "_models.OptimizedAgentIdentifier" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The agent (and pinned version) being optimized. Required.""" + train_dataset: "_models.AgentOptimizationDatasetInput" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Training dataset — either inline items or a reference to a registered dataset. Required. + Required.""" + validation_dataset: Optional["_models.AgentOptimizationDatasetInput"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional held-out validation dataset for measuring generalization of the final candidate.""" + evaluators: list["_models.AgentOptimizationEvaluatorRef"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Job-level evaluators referenced by name and optional version. Required; at least one must be + provided. Required.""" + options: Optional["_models.AgentOptimizationOptions"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Tuning knobs and run-mode.""" @overload def __init__( self, *, - error: "_models.ApiError", + agent: "_models.OptimizedAgentIdentifier", + train_dataset: "_models.AgentOptimizationDatasetInput", + evaluators: list["_models.AgentOptimizationEvaluatorRef"], + validation_dataset: Optional["_models.AgentOptimizationDatasetInput"] = None, + options: Optional["_models.AgentOptimizationOptions"] = None, ) -> None: ... @overload @@ -1576,23 +1591,72 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ApiKeyCredentials(BaseCredentials, discriminator="ApiKey"): - """API Key Credential definition. +class AgentOptimizationJobListItem(_Model): + """Slim job representation returned by the LIST endpoint. - :ivar type: The credential type. Required. API Key credential. - :vartype type: str or ~azure.ai.projects.models.API_KEY - :ivar api_key: API Key. - :vartype api_key: str + :ivar id: Server-assigned unique identifier. Required. + :vartype id: str + :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 created_at: The timestamp when the job was created, represented in Unix time. Required. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The timestamp when the job was last updated, represented in Unix time. + Required. + :vartype updated_at: ~datetime.datetime + :ivar progress: Progress snapshot. May be present in terminal states reflecting last-known + progress. + :vartype progress: ~azure.ai.projects.models.AgentOptimizationJobProgress + :ivar agent: The agent targeted by this optimization job. + :vartype agent: ~azure.ai.projects.models.OptimizedAgentIdentifier """ - type: Literal[CredentialType.API_KEY] = rest_discriminator(name="type", visibility=["read"]) # type: ignore - """The credential type. Required. API Key credential.""" - api_key: Optional[str] = rest_field(name="key", visibility=["read"]) - """API Key.""" + id: str = rest_field(visibility=["read"]) + """Server-assigned unique identifier. Required.""" + status: Union[str, "_models.JobStatus"] = rest_field(visibility=["read"]) + """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", + \"succeeded\", \"failed\", and \"cancelled\".""" + error: Optional["_models.ApiError"] = rest_field(visibility=["read"]) + """Error details — populated only on failure.""" + created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The timestamp when the job was created, represented in Unix time. Required.""" + updated_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The timestamp when the job was last updated, represented in Unix time. Required.""" + progress: Optional["_models.AgentOptimizationJobProgress"] = rest_field(visibility=["read"]) + """Progress snapshot. May be present in terminal states reflecting last-known progress.""" + agent: Optional["_models.OptimizedAgentIdentifier"] = rest_field(visibility=["read"]) + """The agent targeted by this optimization job.""" + + +class AgentOptimizationJobProgress(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """In-flight progress; only populated while status is queued or in_progress. + + :ivar candidates_completed: Number of candidates whose evaluation has completed so far. + Required. + :vartype candidates_completed: int + :ivar best_score: Best score observed so far across all candidates. Required. + :vartype best_score: float + :ivar elapsed_seconds: Wall-clock time elapsed in seconds since the job began executing. + Required. + :vartype elapsed_seconds: float + """ + + candidates_completed: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Number of candidates whose evaluation has completed so far. Required.""" + best_score: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Best score observed so far across all candidates. Required.""" + elapsed_seconds: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Wall-clock time elapsed in seconds since the job began executing. Required.""" @overload def __init__( self, + *, + candidates_completed: int, + best_score: float, + elapsed_seconds: float, ) -> None: ... @overload @@ -1604,22 +1668,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = CredentialType.API_KEY # type: ignore -class ApplyPatchToolParam(Tool, discriminator="apply_patch"): - """Apply patch tool. +class AgentOptimizationJobResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Terminal-state result body. Populated when status is succeeded or failed. - :ivar type: The type of the tool. Always ``apply_patch``. Required. APPLY_PATCH. - :vartype type: str or ~azure.ai.projects.models.APPLY_PATCH + :ivar baseline: Candidate ID of the original (un-optimized) baseline evaluation. + :vartype baseline: str + :ivar best: Candidate ID of the highest-scoring candidate found during optimization. + :vartype best: str + :ivar candidates: All evaluated candidates including baseline. + :vartype candidates: list[~azure.ai.projects.models.AgentOptimizationCandidate] """ - 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.""" + baseline: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Candidate ID of the original (un-optimized) baseline evaluation.""" + best: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Candidate ID of the highest-scoring candidate found during optimization.""" + candidates: Optional[list["_models.AgentOptimizationCandidate"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """All evaluated candidates including baseline.""" @overload def __init__( self, + *, + baseline: Optional[str] = None, + best: Optional[str] = None, + candidates: Optional[list["_models.AgentOptimizationCandidate"]] = None, ) -> None: ... @overload @@ -1631,81 +1708,73 @@ 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 ApproximateLocation(_Model): - """ApproximateLocation. - :ivar type: The type of location approximation. Always ``approximate``. Required. Default value - is "approximate". - :vartype type: str - :ivar country: - :vartype country: str - :ivar region: - :vartype region: str - :ivar city: - :vartype city: str - :ivar timezone: - :vartype timezone: str - """ - type: Literal["approximate"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The type of location approximation. Always ``approximate``. Required. Default value is - \"approximate\".""" - country: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - region: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - city: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - timezone: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) +class AgentOptimizationOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Tuning knobs and run-mode for an optimization job. - @overload - def __init__( - self, - *, - country: Optional[str] = None, - region: Optional[str] = None, - city: Optional[str] = None, - timezone: 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["approximate"] = "approximate" - - -class ArtifactProfile(_Model): - """Artifact profile of the model. - - :ivar category: The category of the artifact profile. Required. Known values are: "DataOnly", - "RuntimeDependent", and "Unknown". - :vartype category: str or ~azure.ai.projects.models.FoundryModelArtifactProfileCategory - :ivar signals: Signals detected in the model artifact. - :vartype signals: list[str or ~azure.ai.projects.models.FoundryModelArtifactProfileSignal] + :ivar max_candidates: Maximum number of optimization candidates to generate. Must be >= 1. + Default: 5. + :vartype max_candidates: int + :ivar optimization_config: Per-target-attribute configuration overrides. Contains skills, + tools, system_prompt for the agent, plus model space for model optimization. + :vartype optimization_config: dict[str, any] + :ivar eval_model: Model deployment used for evaluation. Defaults to server config (typically + 'gpt-4o'). + :vartype eval_model: str + :ivar optimization_model: Model deployment for optimization reasoning (must be gpt-5 family). + Falls back to the default eval model when not set. + :vartype optimization_model: str + :ivar evaluation_level: Evaluation granularity. Null/omitted means per-item single-turn. Set to + 'conversation' for per-conversation multi-turn simulation scoring. Known values are: "turn" and + "conversation". + :vartype evaluation_level: str or ~azure.ai.projects.models.EvaluationLevel + :ivar max_stalls: Maximum number of consecutive reflective minibatch rejections before stopping + early. A 'stall' occurs when the optimizer proposes a prompt change, evaluates it on a small + subset, and the score does not improve — so no full validation-set evaluation is triggered. The + counter resets whenever a minibatch passes and its full-validation score beats the current + best. Only a sustained plateau of ``max_stalls`` consecutive minibatch failures triggers the + stop. The service defaults to 5 if a value is not specified by the caller. Must be >= 1 when + set. + :vartype max_stalls: int """ - category: Union[str, "_models.FoundryModelArtifactProfileCategory"] = rest_field( + max_candidates: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Maximum number of optimization candidates to generate. Must be >= 1. Default: 5.""" + optimization_config: Optional[dict[str, Any]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The category of the artifact profile. Required. Known values are: \"DataOnly\", - \"RuntimeDependent\", and \"Unknown\".""" - signals: Optional[list[Union[str, "_models.FoundryModelArtifactProfileSignal"]]] = rest_field( + """Per-target-attribute configuration overrides. Contains skills, tools, system_prompt for the + agent, plus model space for model optimization.""" + eval_model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Model deployment used for evaluation. Defaults to server config (typically 'gpt-4o').""" + optimization_model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Model deployment for optimization reasoning (must be gpt-5 family). Falls back to the default + eval model when not set.""" + evaluation_level: Optional[Union[str, "_models.EvaluationLevel"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Signals detected in the model artifact.""" + """Evaluation granularity. Null/omitted means per-item single-turn. Set to 'conversation' for + per-conversation multi-turn simulation scoring. Known values are: \"turn\" and + \"conversation\".""" + max_stalls: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Maximum number of consecutive reflective minibatch rejections before stopping early. A 'stall' + occurs when the optimizer proposes a prompt change, evaluates it on a small subset, and the + score does not improve — so no full validation-set evaluation is triggered. The counter resets + whenever a minibatch passes and its full-validation score beats the current best. Only a + sustained plateau of ``max_stalls`` consecutive minibatch failures triggers the stop. The + service defaults to 5 if a value is not specified by the caller. Must be >= 1 when set.""" @overload def __init__( self, *, - category: Union[str, "_models.FoundryModelArtifactProfileCategory"], - signals: Optional[list[Union[str, "_models.FoundryModelArtifactProfileSignal"]]] = None, + max_candidates: Optional[int] = None, + optimization_config: Optional[dict[str, Any]] = None, + eval_model: Optional[str] = None, + optimization_model: Optional[str] = None, + evaluation_level: Optional[Union[str, "_models.EvaluationLevel"]] = None, + max_stalls: Optional[int] = None, ) -> None: ... @overload @@ -1719,38 +1788,34 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AutoCodeInterpreterToolParam(_Model): - """Automatic Code Interpreter Tool Parameters. +class AgentOptimizationReferenceDatasetInput( + AgentOptimizationDatasetInput, discriminator="reference" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Reference to a registered Foundry dataset. - :ivar type: Always ``auto``. Required. Default value is "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 network_policy: - :vartype network_policy: ~azure.ai.projects.models.ContainerNetworkPolicyParam + :ivar type: Dataset input type discriminator. Required. Reference to a registered Foundry + dataset by name and version. + :vartype type: str or ~azure.ai.projects.models.REFERENCE + :ivar name: Registered dataset name. Required. + :vartype name: str + :ivar version: Dataset version. If not specified, the latest version is used. + :vartype version: str """ - type: Literal["auto"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Always ``auto``. Required. Default value is \"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\".""" - network_policy: Optional["_models.ContainerNetworkPolicyParam"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) + type: Literal[AgentOptimizationDatasetInputType.REFERENCE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Dataset input type discriminator. Required. Reference to a registered Foundry dataset by name + and version.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Registered dataset name. Required.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Dataset version. If not specified, the latest version is used.""" @overload def __init__( self, *, - file_ids: Optional[list[str]] = None, - memory_limit: Optional[Union[str, "_models.ContainerMemoryLimit"]] = None, - network_policy: Optional["_models.ContainerNetworkPolicyParam"] = None, + name: str, + version: Optional[str] = None, ) -> None: ... @overload @@ -1762,28 +1827,56 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["auto"] = "auto" + self.type = AgentOptimizationDatasetInputType.REFERENCE # type: ignore -class EvaluationTarget(_Model): - """Base class for targets with discriminator support. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AzureAIAgentTarget, AzureAIModelTarget +class AgentSessionResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An agent session providing a long-lived compute sandbox for hosted agent invocations. - :ivar type: The type of target. Required. Default value is None. - :vartype type: str + :ivar agent_session_id: The session identifier. Required. + :vartype agent_session_id: str + :ivar version_indicator: The version indicator determining which agent version backs this + session. Required. + :vartype version_indicator: ~azure.ai.projects.models.VersionIndicator + :ivar status: The current status of the session. Required. Known values are: "creating", + "active", "idle", "updating", "failed", "deleting", "deleted", and "expired". + :vartype status: str or ~azure.ai.projects.models.AgentSessionStatus + :ivar created_at: The Unix timestamp (in seconds) when the session was created. Required. + :vartype created_at: ~datetime.datetime + :ivar last_accessed_at: The Unix timestamp (in seconds) when the session was last accessed. + Required. + :vartype last_accessed_at: ~datetime.datetime + :ivar expires_at: The Unix timestamp (in seconds) when the session expires (rolling, 30 days + from last activity). Required. + :vartype expires_at: ~datetime.datetime """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of target. Required. Default value is None.""" + agent_session_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The session identifier. Required.""" + version_indicator: "_models.VersionIndicator" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The version indicator determining which agent version backs this session. Required.""" + status: Union[str, "_models.AgentSessionStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The current status of the session. Required. Known values are: \"creating\", \"active\", + \"idle\", \"updating\", \"failed\", \"deleting\", \"deleted\", and \"expired\".""" + created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The Unix timestamp (in seconds) when the session was created. Required.""" + last_accessed_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The Unix timestamp (in seconds) when the session was last accessed. Required.""" + expires_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The Unix timestamp (in seconds) when the session expires (rolling, 30 days from last activity). + Required.""" @overload def __init__( self, *, - type: str, + agent_session_id: str, + version_indicator: "_models.VersionIndicator", + status: Union[str, "_models.AgentSessionStatus"], ) -> None: ... @overload @@ -1797,43 +1890,26 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AzureAIAgentTarget(EvaluationTarget, discriminator="azure_ai_agent"): - """Represents a target specifying an Azure AI agent. +class EvaluationTaxonomyInput(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Input configuration for the evaluation taxonomy. - :ivar type: The type of target, always ``azure_ai_agent``. Required. Default value is - "azure_ai_agent". - :vartype type: str - :ivar name: The unique identifier of the Azure AI agent. Required. - :vartype name: str - :ivar version: The version of the Azure AI agent. - :vartype version: str - :ivar tool_descriptions: The parameters used to control the sampling behavior of the agent - during text generation. - :vartype tool_descriptions: list[~azure.ai.projects.models.ToolDescription] - :ivar tools: - :vartype tools: list[~azure.ai.projects.models.Tool] + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AgentTaxonomyInput + + :ivar type: Input type of the evaluation taxonomy. Required. Known values are: "agent" and + "policy". + :vartype type: str or ~azure.ai.projects.models.EvaluationTaxonomyInputType """ - type: Literal["azure_ai_agent"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of target, always ``azure_ai_agent``. Required. Default value is \"azure_ai_agent\".""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the Azure AI agent. Required.""" - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version of the Azure AI agent.""" - tool_descriptions: Optional[list["_models.ToolDescription"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The parameters used to control the sampling behavior of the agent during text generation.""" - tools: Optional[list["_models.Tool"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Input type of the evaluation taxonomy. Required. Known values are: \"agent\" and \"policy\".""" @overload def __init__( self, *, - name: str, - version: Optional[str] = None, - tool_descriptions: Optional[list["_models.ToolDescription"]] = None, - tools: Optional[list["_models.Tool"]] = None, + type: str, ) -> None: ... @overload @@ -1845,37 +1921,36 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "azure_ai_agent" # type: ignore -class AzureAIModelTarget(EvaluationTarget, discriminator="azure_ai_model"): - """Represents a target specifying an Azure AI model for operations requiring model selection. +class AgentTaxonomyInput( + EvaluationTaxonomyInput, discriminator="agent" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Input configuration for the evaluation taxonomy when the input type is agent. - :ivar type: The type of target, always ``azure_ai_model``. Required. Default value is - "azure_ai_model". - :vartype type: str - :ivar model: The unique identifier of the Azure AI model. - :vartype model: str - :ivar sampling_params: The parameters used to control the sampling behavior of the model during - text generation. - :vartype sampling_params: ~azure.ai.projects.models.ModelSamplingParams + :ivar type: Input type of the evaluation taxonomy. Required. Agent. + :vartype type: str or ~azure.ai.projects.models.AGENT + :ivar target: Target configuration for the agent. Required. + :vartype target: ~azure.ai.projects.models.EvaluationTarget + :ivar risk_categories: List of risk categories to evaluate against. Required. + :vartype risk_categories: list[str or ~azure.ai.projects.models.RiskCategory] """ - type: Literal["azure_ai_model"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of target, always ``azure_ai_model``. Required. Default value is \"azure_ai_model\".""" - model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the Azure AI model.""" - sampling_params: Optional["_models.ModelSamplingParams"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + type: Literal[EvaluationTaxonomyInputType.AGENT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Input type of the evaluation taxonomy. Required. Agent.""" + target: "_models.EvaluationTarget" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Target configuration for the agent. Required.""" + risk_categories: list[Union[str, "_models.RiskCategory"]] = rest_field( + name="riskCategories", visibility=["read", "create", "update", "delete", "query"] ) - """The parameters used to control the sampling behavior of the model during text generation.""" + """List of risk categories to evaluate against. Required.""" @overload def __init__( self, *, - model: Optional[str] = None, - sampling_params: Optional["_models.ModelSamplingParams"] = None, + target: "_models.EvaluationTarget", + risk_categories: list[Union[str, "_models.RiskCategory"]], ) -> None: ... @overload @@ -1887,52 +1962,112 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "azure_ai_model" # type: ignore + self.type = EvaluationTaxonomyInputType.AGENT # type: ignore -class Index(_Model): - """Index resource Definition. +class AgentVersionDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """AgentVersionDetails. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AzureAISearchIndex, CosmosDBIndex, ManagedAzureAISearchIndex + :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. - :ivar type: Type of index. Required. Known values are: "AzureSearch", - "CosmosDBNoSqlVectorStore", and "ManagedAzureSearch". - :vartype type: str or ~azure.ai.projects.models.IndexType - :ivar id: Asset ID, a unique identifier for the asset. + 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 object: The object type, which is always 'agent.version'. Required. AGENT_VERSION. + :vartype object: str or ~azure.ai.projects.models.AGENT_VERSION + :ivar id: The unique identifier of the agent version. Required. :vartype id: str - :ivar name: The name of the resource. Required. + :ivar name: The name of the agent. Name can be used to retrieve/update/delete the agent. + Required. :vartype name: str - :ivar version: The version of the resource. Required. + :ivar version: The version identifier of the agent. Agents are immutable and every update + creates a new version while keeping the name same. Required. :vartype version: str - :ivar description: The asset description text. + :ivar description: A human-readable description of the agent. :vartype description: str - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] + :ivar created_at: The Unix timestamp (seconds) when the agent was created. Required. + :vartype created_at: ~datetime.datetime + :ivar definition: Required. + :vartype definition: ~azure.ai.projects.models.AgentDefinition + :ivar draft: Whether this agent version is a draft (candidate) rather than a release. Draft + versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. + Defaults to false. + :vartype draft: bool + :ivar status: The provisioning status of the agent version. Defaults to 'active' for non-hosted + agents. For hosted agents, reflects infrastructure readiness. Known values are: "creating", + "active", "failed", "deleting", and "deleted". + :vartype status: str or ~azure.ai.projects.models.AgentVersionStatus + :ivar instance_identity: The instance identity of the agent. + :vartype instance_identity: ~azure.ai.projects.models.AgentIdentity + :ivar blueprint: The blueprint for the agent. + :vartype blueprint: ~azure.ai.projects.models.AgentIdentity + :ivar blueprint_reference: The blueprint for the agent. + :vartype blueprint_reference: ~azure.ai.projects.models.AgentBlueprintReference + :ivar agent_guid: The unique GUID identifier of the agent. + :vartype agent_guid: str """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Type of index. Required. Known values are: \"AzureSearch\", \"CosmosDBNoSqlVectorStore\", and - \"ManagedAzureSearch\".""" - 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=["create", "update"]) - """The asset description text.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["create", "update"]) - """Tag dictionary. Tags can be added, removed, and updated.""" + 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.""" + object: Literal[AgentObjectType.AGENT_VERSION] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The object type, which is always 'agent.version'. Required. AGENT_VERSION.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the agent version. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the agent. Name can be used to retrieve/update/delete the agent. Required.""" + version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version identifier of the agent. Agents are immutable and every update creates a new + version while keeping the name same. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A human-readable description of the agent.""" + created_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (seconds) when the agent was created. Required.""" + definition: "_models.AgentDefinition" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + draft: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether this agent version is a draft (candidate) rather than a release. Draft versions are + recorded but excluded from default 'latest' resolution and are not auto-promoted. Defaults to + false.""" + status: Optional[Union[str, "_models.AgentVersionStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The provisioning status of the agent version. Defaults to 'active' for non-hosted agents. For + hosted agents, reflects infrastructure readiness. Known values are: \"creating\", \"active\", + \"failed\", \"deleting\", and \"deleted\".""" + instance_identity: Optional["_models.AgentIdentity"] = rest_field(visibility=["read"]) + """The instance identity of the agent.""" + blueprint: Optional["_models.AgentIdentity"] = rest_field(visibility=["read"]) + """The blueprint for the agent.""" + blueprint_reference: Optional["_models.AgentBlueprintReference"] = rest_field(visibility=["read"]) + """The blueprint for the agent.""" + agent_guid: Optional[str] = rest_field(visibility=["read"]) + """The unique GUID identifier of the agent.""" @overload def __init__( self, *, - type: str, + metadata: dict[str, str], + object: Literal[AgentObjectType.AGENT_VERSION], + id: str, # pylint: disable=redefined-builtin + name: str, + version: str, + created_at: datetime.datetime, + definition: "_models.AgentDefinition", description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, + draft: Optional[bool] = None, + status: Optional[Union[str, "_models.AgentVersionStatus"]] = None, ) -> None: ... @overload @@ -1946,47 +2081,52 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AzureAISearchIndex(Index, discriminator="AzureSearch"): - """Azure AI Search Index Definition. +class AISearchIndexResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A AI Search Index resource. - :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. Azure search. - :vartype type: str or ~azure.ai.projects.models.AZURE_SEARCH - :ivar connection_name: Name of connection to Azure AI Search. Required. - :vartype connection_name: str - :ivar index_name: Name of index in Azure AI Search resource to attach. Required. + :ivar project_connection_id: An index connection ID in an IndexResource attached to this agent. + :vartype project_connection_id: str + :ivar index_name: The name of an index in an IndexResource attached to this agent. :vartype index_name: str - :ivar field_mapping: Field mapping configuration. - :vartype field_mapping: ~azure.ai.projects.models.FieldMapping + :ivar query_type: Type of query in an AIIndexResource attached to this agent. Known values are: + "simple", "semantic", "vector", "vector_simple_hybrid", and "vector_semantic_hybrid". + :vartype query_type: str or ~azure.ai.projects.models.AzureAISearchQueryType + :ivar top_k: Number of documents to retrieve from search and present to the model. + :vartype top_k: int + :ivar filter: filter string for search resource. `Learn more here + `_. + :vartype filter: str + :ivar index_asset_id: Index asset id for search resource. + :vartype index_asset_id: str """ - type: Literal[IndexType.AZURE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Type of index. Required. Azure search.""" - connection_name: str = rest_field(name="connectionName", visibility=["create"]) - """Name of connection to Azure AI Search. Required.""" - index_name: str = rest_field(name="indexName", visibility=["create"]) - """Name of index in Azure AI Search resource to attach. Required.""" - field_mapping: Optional["_models.FieldMapping"] = rest_field(name="fieldMapping", visibility=["create"]) - """Field mapping configuration.""" + project_connection_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An index connection ID in an IndexResource attached to this agent.""" + index_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of an index in an IndexResource attached to this agent.""" + query_type: Optional[Union[str, "_models.AzureAISearchQueryType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Type of query in an AIIndexResource attached to this agent. Known values are: \"simple\", + \"semantic\", \"vector\", \"vector_simple_hybrid\", and \"vector_semantic_hybrid\".""" + top_k: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Number of documents to retrieve from search and present to the model.""" + filter: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """filter string for search resource. `Learn more here + `_.""" + index_asset_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Index asset id for search resource.""" @overload def __init__( self, *, - connection_name: str, - index_name: str, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, - field_mapping: Optional["_models.FieldMapping"] = None, + project_connection_id: Optional[str] = None, + index_name: Optional[str] = None, + query_type: Optional[Union[str, "_models.AzureAISearchQueryType"]] = None, + top_k: Optional[int] = None, + filter: Optional[str] = None, # pylint: disable=redefined-builtin + index_asset_id: Optional[str] = None, ) -> None: ... @overload @@ -1998,49 +2138,52 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = IndexType.AZURE_SEARCH # type: ignore -class AzureAISearchTool(Tool, discriminator="azure_ai_search"): - """The input definition information for an Azure AI search tool as used to configure an agent. +class ApiError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ApiError. - :ivar type: The object type, which is always 'azure_ai_search'. Required. AZURE_AI_SEARCH. - :vartype type: str or ~azure.ai.projects.models.AZURE_AI_SEARCH - :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 azure_ai_search: The azure ai search index resource. Required. - :vartype azure_ai_search: ~azure.ai.projects.models.AzureAISearchToolResource + :ivar code: Required. + :vartype code: str + :ivar message: Required. + :vartype message: str + :ivar param: + :vartype param: str + :ivar type: + :vartype type: str + :ivar details: + :vartype details: list[~azure.ai.projects.models.ApiError] + :ivar additional_info: + :vartype additional_info: dict[str, any] + :ivar debug_info: + :vartype debug_info: dict[str, any] """ - type: Literal[ToolType.AZURE_AI_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'azure_ai_search'. Required. AZURE_AI_SEARCH.""" - 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"] + code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + details: Optional[list["_models.ApiError"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + additional_info: Optional[dict[str, Any]] = rest_field( + name="additionalInfo", visibility=["read", "create", "update", "delete", "query"] ) - """Deprecated. This property is deprecated and will be removed in a future version.""" - azure_ai_search: "_models.AzureAISearchToolResource" = rest_field( - visibility=["read", "create", "update", "delete", "query"] + debug_info: Optional[dict[str, Any]] = rest_field( + name="debugInfo", visibility=["read", "create", "update", "delete", "query"] ) - """The azure ai search index resource. Required.""" @overload def __init__( self, *, - azure_ai_search: "_models.AzureAISearchToolResource", - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + code: str, + message: str, + param: Optional[str] = None, + type: Optional[str] = None, + details: Optional[list["_models.ApiError"]] = None, + additional_info: Optional[dict[str, Any]] = None, + debug_info: Optional[dict[str, Any]] = None, ) -> None: ... @overload @@ -2052,41 +2195,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.AZURE_AI_SEARCH # type: ignore -class AzureAISearchToolboxTool(ToolboxTool, discriminator="azure_ai_search"): - """An Azure AI Search tool stored in a toolbox. +class ApiErrorResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Error response for API failures. - :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. AZURE_AI_SEARCH. - :vartype type: str or ~azure.ai.projects.models.AZURE_AI_SEARCH - :ivar azure_ai_search: The azure ai search index resource. Required. - :vartype azure_ai_search: ~azure.ai.projects.models.AzureAISearchToolResource + :ivar error: Required. + :vartype error: ~azure.ai.projects.models.ApiError """ - type: Literal[ToolboxToolType.AZURE_AI_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. AZURE_AI_SEARCH.""" - azure_ai_search: "_models.AzureAISearchToolResource" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The azure ai search index resource. Required.""" + error: "_models.ApiError" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - azure_ai_search: "_models.AzureAISearchToolResource", - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + error: "_models.ApiError", ) -> None: ... @overload @@ -2098,28 +2223,25 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolboxToolType.AZURE_AI_SEARCH # type: ignore -class AzureAISearchToolResource(_Model): - """A set of index resources used by the ``azure_ai_search`` tool. +class ApiKeyCredentials(BaseCredentials, discriminator="ApiKey"): + """API Key Credential definition. - :ivar indexes: The indices attached to this agent. There can be a maximum of 1 index resource - attached to the agent. Required. - :vartype indexes: list[~azure.ai.projects.models.AISearchIndexResource] + :ivar type: The credential type. Required. API Key credential. + :vartype type: str or ~azure.ai.projects.models.API_KEY + :ivar api_key: API Key. + :vartype api_key: str """ - indexes: list["_models.AISearchIndexResource"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The indices attached to this agent. There can be a maximum of 1 index resource attached to the - agent. Required.""" + type: Literal[CredentialType.API_KEY] = rest_discriminator(name="type", visibility=["read"]) # type: ignore + """The credential type. Required. API Key credential.""" + api_key: Optional[str] = rest_field(name="key", visibility=["read"]) + """API Key.""" @overload def __init__( self, - *, - indexes: list["_models.AISearchIndexResource"], ) -> None: ... @overload @@ -2131,31 +2253,31 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = CredentialType.API_KEY # type: ignore -class AzureFunctionBinding(_Model): - """The structure for keeping storage queue name and URI. +class ApplyPatchToolParam( + Tool, discriminator="apply_patch" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Apply patch tool. - :ivar type: The type of binding, which is always 'storage_queue'. Required. Default value is - "storage_queue". - :vartype type: str - :ivar storage_queue: Storage queue. Required. - :vartype storage_queue: ~azure.ai.projects.models.AzureFunctionStorageQueue + :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["storage_queue"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The type of binding, which is always 'storage_queue'. Required. Default value is - \"storage_queue\".""" - storage_queue: "_models.AzureFunctionStorageQueue" = rest_field( + 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"] ) - """Storage queue. Required.""" @overload def __init__( self, *, - storage_queue: "_models.AzureFunctionStorageQueue", + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, ) -> None: ... @overload @@ -2167,44 +2289,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["storage_queue"] = "storage_queue" + self.type = ToolType.APPLY_PATCH # type: ignore -class AzureFunctionDefinition(_Model): - """The definition of Azure function. +class ApproximateLocation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ApproximateLocation. - :ivar function: The definition of azure function and its parameters. Required. - :vartype function: ~azure.ai.projects.models.AzureFunctionDefinitionFunction - :ivar input_binding: Input storage queue. The queue storage trigger runs a function as messages - are added to it. Required. - :vartype input_binding: ~azure.ai.projects.models.AzureFunctionBinding - :ivar output_binding: Output storage queue. The function writes output to this queue when the - input items are processed. Required. - :vartype output_binding: ~azure.ai.projects.models.AzureFunctionBinding + :ivar type: The type of location approximation. Always ``approximate``. Required. Default value + is "approximate". + :vartype type: str + :ivar country: + :vartype country: str + :ivar region: + :vartype region: str + :ivar city: + :vartype city: str + :ivar timezone: + :vartype timezone: str """ - function: "_models.AzureFunctionDefinitionFunction" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The definition of azure function and its parameters. Required.""" - input_binding: "_models.AzureFunctionBinding" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Input storage queue. The queue storage trigger runs a function as messages are added to it. - Required.""" - output_binding: "_models.AzureFunctionBinding" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Output storage queue. The function writes output to this queue when the input items are - processed. Required.""" + type: Literal["approximate"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of location approximation. Always ``approximate``. Required. Default value is + \"approximate\".""" + country: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + region: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + city: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + timezone: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - function: "_models.AzureFunctionDefinitionFunction", - input_binding: "_models.AzureFunctionBinding", - output_binding: "_models.AzureFunctionBinding", + country: Optional[str] = None, + region: Optional[str] = None, + city: Optional[str] = None, + timezone: Optional[str] = None, ) -> None: ... @overload @@ -2216,36 +2335,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["approximate"] = "approximate" -class AzureFunctionDefinitionFunction(_Model): - """AzureFunctionDefinitionFunction. +class ArtifactProfile(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Artifact profile of the model. - :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 category: The category of the artifact profile. Required. Known values are: "DataOnly", + "RuntimeDependent", and "Unknown". + :vartype category: str or ~azure.ai.projects.models.FoundryModelArtifactProfileCategory + :ivar signals: Signals detected in the model artifact. + :vartype signals: list[str or ~azure.ai.projects.models.FoundryModelArtifactProfileSignal] """ - 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.""" + category: Union[str, "_models.FoundryModelArtifactProfileCategory"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The category of the artifact profile. Required. Known values are: \"DataOnly\", + \"RuntimeDependent\", and \"Unknown\".""" + signals: Optional[list[Union[str, "_models.FoundryModelArtifactProfileSignal"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Signals detected in the model artifact.""" @overload def __init__( self, *, - name: str, - parameters: dict[str, Any], - description: Optional[str] = None, + category: Union[str, "_models.FoundryModelArtifactProfileCategory"], + signals: Optional[list[Union[str, "_models.FoundryModelArtifactProfileSignal"]]] = None, ) -> None: ... @overload @@ -2259,27 +2377,38 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AzureFunctionStorageQueue(_Model): - """The structure for keeping storage queue name and URI. +class AutoCodeInterpreterToolParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Automatic Code Interpreter Tool Parameters. - :ivar queue_service_endpoint: URI to the Azure Storage Queue service allowing you to manipulate - a queue. Required. - :vartype queue_service_endpoint: str - :ivar queue_name: The name of an Azure function storage queue. Required. - :vartype queue_name: str + :ivar type: Always ``auto``. Required. Default value is "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 network_policy: + :vartype network_policy: ~azure.ai.projects.models.ContainerNetworkPolicyParam """ - queue_service_endpoint: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """URI to the Azure Storage Queue service allowing you to manipulate a queue. Required.""" - queue_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of an Azure function storage queue. Required.""" + type: Literal["auto"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Always ``auto``. Required. Default value is \"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\".""" + network_policy: Optional["_models.ContainerNetworkPolicyParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) @overload def __init__( self, *, - queue_service_endpoint: str, - queue_name: str, + file_ids: Optional[list[str]] = None, + memory_limit: Optional[Union[str, "_models.ContainerMemoryLimit"]] = None, + network_policy: Optional["_models.ContainerNetworkPolicyParam"] = None, ) -> None: ... @overload @@ -2291,37 +2420,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["auto"] = "auto" -class AzureFunctionTool(Tool, discriminator="azure_function"): - """The input definition information for an Azure Function Tool, as used to configure an Agent. +class EvaluationTarget(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Base class for targets with discriminator support. - :ivar type: The object type, which is always 'browser_automation'. Required. AZURE_FUNCTION. - :vartype type: str or ~azure.ai.projects.models.AZURE_FUNCTION - :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 azure_function: The Azure Function Tool definition. Required. - :vartype azure_function: ~azure.ai.projects.models.AzureFunctionDefinition + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AzureAIAgentTarget, AzureAIModelTarget + + :ivar type: The type of target. Required. Default value is None. + :vartype type: str """ - type: Literal[ToolType.AZURE_FUNCTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'browser_automation'. Required. AZURE_FUNCTION.""" - 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.""" - azure_function: "_models.AzureFunctionDefinition" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The Azure Function Tool definition. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The type of target. Required. Default value is None.""" @overload def __init__( self, *, - azure_function: "_models.AzureFunctionDefinition", - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + type: str, ) -> None: ... @overload @@ -2333,28 +2453,47 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.AZURE_FUNCTION # type: ignore - -class RedTeamTargetConfig(_Model): - """Abstract class for target configuration. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AzureOpenAIModelConfiguration +class AzureAIAgentTarget( + EvaluationTarget, discriminator="azure_ai_agent" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents a target specifying an Azure AI agent. - :ivar type: Type of the model configuration. Required. Default value is None. + :ivar type: The type of target, always ``azure_ai_agent``. Required. Default value is + "azure_ai_agent". :vartype type: str + :ivar name: The unique identifier of the Azure AI agent. Required. + :vartype name: str + :ivar version: The version of the Azure AI agent. + :vartype version: str + :ivar tool_descriptions: The parameters used to control the sampling behavior of the agent + during text generation. + :vartype tool_descriptions: list[~azure.ai.projects.models.ToolDescription] + :ivar tools: + :vartype tools: list[~azure.ai.projects.models.Tool] """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Type of the model configuration. Required. Default value is None.""" + type: Literal["azure_ai_agent"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of target, always ``azure_ai_agent``. Required. Default value is \"azure_ai_agent\".""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the Azure AI agent. Required.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version of the Azure AI agent.""" + tool_descriptions: Optional[list["_models.ToolDescription"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The parameters used to control the sampling behavior of the agent during text generation.""" + tools: Optional[list["_models.Tool"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - type: str, + name: str, + version: Optional[str] = None, + tool_descriptions: Optional[list["_models.ToolDescription"]] = None, + tools: Optional[list["_models.Tool"]] = None, ) -> None: ... @overload @@ -2366,33 +2505,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = "azure_ai_agent" # type: ignore -class AzureOpenAIModelConfiguration(RedTeamTargetConfig, discriminator="AzureOpenAIModel"): - """Azure OpenAI model configuration. The API version would be selected by the service for querying - the model. +class AzureAIModelTarget( + EvaluationTarget, discriminator="azure_ai_model" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents a target specifying an Azure AI model for operations requiring model selection. - :ivar type: Required. Default value is "AzureOpenAIModel". + :ivar type: The type of target, always ``azure_ai_model``. Required. Default value is + "azure_ai_model". :vartype type: str - :ivar model_deployment_name: Deployment name for AOAI model. Example: gpt-4o if in AIServices - or connection based ``connection_name/deployment_name`` (e.g. ``my-aoai-connection/gpt-4o``). - Required. - :vartype model_deployment_name: str - """ - - type: Literal["AzureOpenAIModel"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Default value is \"AzureOpenAIModel\".""" - model_deployment_name: str = rest_field( - name="modelDeploymentName", visibility=["read", "create", "update", "delete", "query"] + :ivar model: The unique identifier of the Azure AI model. + :vartype model: str + :ivar sampling_params: The parameters used to control the sampling behavior of the model during + text generation. + :vartype sampling_params: ~azure.ai.projects.models.ModelSamplingParams + """ + + type: Literal["azure_ai_model"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of target, always ``azure_ai_model``. Required. Default value is \"azure_ai_model\".""" + model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the Azure AI model.""" + sampling_params: Optional["_models.ModelSamplingParams"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Deployment name for AOAI model. Example: gpt-4o if in AIServices or connection based - ``connection_name/deployment_name`` (e.g. ``my-aoai-connection/gpt-4o``). Required.""" + """The parameters used to control the sampling behavior of the model during text generation.""" @overload def __init__( self, *, - model_deployment_name: str, + model: Optional[str] = None, + sampling_params: Optional["_models.ModelSamplingParams"] = None, ) -> None: ... @overload @@ -2404,51 +2549,52 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "AzureOpenAIModel" # type: ignore + self.type = "azure_ai_model" # type: ignore -class BingCustomSearchConfiguration(_Model): - """A bing custom search configuration. +class Index(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Index resource Definition. - :ivar project_connection_id: Project connection id for grounding with bing search. Required. - :vartype project_connection_id: str - :ivar instance_name: Name of the custom configuration instance given to config. Required. - :vartype instance_name: str - :ivar market: The market where the results come from. - :vartype market: str - :ivar set_lang: The language to use for user interface strings when calling Bing API. - :vartype set_lang: str - :ivar count: The number of search results to return in the bing api response. - :vartype count: int - :ivar freshness: Filter search results by a specific time range. See `accepted values here - `_. - :vartype freshness: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AzureAISearchIndex, CosmosDBIndex, ManagedAzureAISearchIndex + + :ivar type: Type of index. Required. Known values are: "AzureSearch", + "CosmosDBNoSqlVectorStore", and "ManagedAzureSearch". + :vartype type: str or ~azure.ai.projects.models.IndexType + :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] """ - project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Project connection id for grounding with bing search. Required.""" - instance_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name of the custom configuration instance given to config. Required.""" - market: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The market where the results come from.""" - set_lang: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The language to use for user interface strings when calling Bing API.""" - count: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of search results to return in the bing api response.""" - freshness: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Filter search results by a specific time range. See `accepted values here - `_.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Type of index. Required. Known values are: \"AzureSearch\", \"CosmosDBNoSqlVectorStore\", and + \"ManagedAzureSearch\".""" + 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=["create", "update"]) + """The asset description text.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["create", "update"]) + """Tag dictionary. Tags can be added, removed, and updated.""" @overload def __init__( self, *, - project_connection_id: str, - instance_name: str, - market: Optional[str] = None, - set_lang: Optional[str] = None, - count: Optional[int] = None, - freshness: Optional[str] = None, + type: str, + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -2462,29 +2608,49 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class BingCustomSearchPreviewTool(Tool, discriminator="bing_custom_search_preview"): - """The input definition information for a Bing custom search tool as used to configure an agent. +class AzureAISearchIndex( + Index, discriminator="AzureSearch" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Azure AI Search Index Definition. - :ivar type: The object type, which is always 'bing_custom_search_preview'. Required. - BING_CUSTOM_SEARCH_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.BING_CUSTOM_SEARCH_PREVIEW - :ivar bing_custom_search_preview: The bing custom search tool parameters. Required. - :vartype bing_custom_search_preview: ~azure.ai.projects.models.BingCustomSearchToolParameters + :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. Azure search. + :vartype type: str or ~azure.ai.projects.models.AZURE_SEARCH + :ivar connection_name: Name of connection to Azure AI Search. Required. + :vartype connection_name: str + :ivar index_name: Name of index in Azure AI Search resource to attach. Required. + :vartype index_name: str + :ivar field_mapping: Field mapping configuration. + :vartype field_mapping: ~azure.ai.projects.models.FieldMapping """ - type: Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'bing_custom_search_preview'. Required. - BING_CUSTOM_SEARCH_PREVIEW.""" - bing_custom_search_preview: "_models.BingCustomSearchToolParameters" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The bing custom search tool parameters. Required.""" + type: Literal[IndexType.AZURE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Type of index. Required. Azure search.""" + connection_name: str = rest_field(name="connectionName", visibility=["create"]) + """Name of connection to Azure AI Search. Required.""" + index_name: str = rest_field(name="indexName", visibility=["create"]) + """Name of index in Azure AI Search resource to attach. Required.""" + field_mapping: Optional["_models.FieldMapping"] = rest_field(name="fieldMapping", visibility=["create"]) + """Field mapping configuration.""" @overload def __init__( self, *, - bing_custom_search_preview: "_models.BingCustomSearchToolParameters", + connection_name: str, + index_name: str, + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, + field_mapping: Optional["_models.FieldMapping"] = None, ) -> None: ... @overload @@ -2496,28 +2662,51 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.BING_CUSTOM_SEARCH_PREVIEW # type: ignore + self.type = IndexType.AZURE_SEARCH # type: ignore -class BingCustomSearchToolParameters(_Model): - """The bing custom search tool parameters. +class AzureAISearchTool( + Tool, discriminator="azure_ai_search" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The input definition information for an Azure AI search tool as used to configure an agent. - :ivar search_configurations: The project connections attached to this tool. There can be a - maximum of 1 connection resource attached to the tool. Required. - :vartype search_configurations: list[~azure.ai.projects.models.BingCustomSearchConfiguration] + :ivar type: The object type, which is always 'azure_ai_search'. Required. AZURE_AI_SEARCH. + :vartype type: str or ~azure.ai.projects.models.AZURE_AI_SEARCH + :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 azure_ai_search: The azure ai search index resource. Required. + :vartype azure_ai_search: ~azure.ai.projects.models.AzureAISearchToolResource """ - search_configurations: list["_models.BingCustomSearchConfiguration"] = rest_field( + type: Literal[ToolType.AZURE_AI_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'azure_ai_search'. Required. AZURE_AI_SEARCH.""" + 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"] ) - """The project connections attached to this tool. There can be a maximum of 1 connection resource - attached to the tool. Required.""" + """Deprecated. This property is deprecated and will be removed in a future version.""" + azure_ai_search: "_models.AzureAISearchToolResource" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The azure ai search index resource. Required.""" @overload def __init__( self, *, - search_configurations: list["_models.BingCustomSearchConfiguration"], + azure_ai_search: "_models.AzureAISearchToolResource", + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -2529,45 +2718,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.AZURE_AI_SEARCH # type: ignore -class BingGroundingSearchConfiguration(_Model): - """Search configuration for Bing Grounding. +class AzureAISearchToolboxTool( + ToolboxTool, discriminator="azure_ai_search" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An Azure AI Search tool stored in a toolbox. - :ivar project_connection_id: Project connection id for grounding with bing search. Required. - :vartype project_connection_id: str - :ivar market: The market where the results come from. - :vartype market: str - :ivar set_lang: The language to use for user interface strings when calling Bing API. - :vartype set_lang: str - :ivar count: The number of search results to return in the bing api response. - :vartype count: int - :ivar freshness: Filter search results by a specific time range. See `accepted values here - `_. - :vartype freshness: 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: Required. AZURE_AI_SEARCH. + :vartype type: str or ~azure.ai.projects.models.AZURE_AI_SEARCH + :ivar azure_ai_search: The azure ai search index resource. Required. + :vartype azure_ai_search: ~azure.ai.projects.models.AzureAISearchToolResource """ - project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Project connection id for grounding with bing search. Required.""" - market: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The market where the results come from.""" - set_lang: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The language to use for user interface strings when calling Bing API.""" - count: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of search results to return in the bing api response.""" - freshness: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Filter search results by a specific time range. See `accepted values here - `_.""" + type: Literal[ToolboxToolType.AZURE_AI_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. AZURE_AI_SEARCH.""" + azure_ai_search: "_models.AzureAISearchToolResource" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The azure ai search index resource. Required.""" @overload def __init__( self, *, - project_connection_id: str, - market: Optional[str] = None, - set_lang: Optional[str] = None, - count: Optional[int] = None, - freshness: Optional[str] = None, + azure_ai_search: "_models.AzureAISearchToolResource", + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -2579,28 +2766,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolboxToolType.AZURE_AI_SEARCH # type: ignore -class BingGroundingSearchToolParameters(_Model): - """The bing grounding search tool parameters. +class AzureAISearchToolResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A set of index resources used by the ``azure_ai_search`` tool. - :ivar search_configurations: The search configurations attached to this tool. There can be a - maximum of 1 search configuration resource attached to the tool. Required. - :vartype search_configurations: - list[~azure.ai.projects.models.BingGroundingSearchConfiguration] + :ivar indexes: The indices attached to this agent. There can be a maximum of 1 index resource + attached to the agent. Required. + :vartype indexes: list[~azure.ai.projects.models.AISearchIndexResource] """ - search_configurations: list["_models.BingGroundingSearchConfiguration"] = rest_field( + indexes: list["_models.AISearchIndexResource"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The search configurations attached to this tool. There can be a maximum of 1 search - configuration resource attached to the tool. Required.""" + """The indices attached to this agent. There can be a maximum of 1 index resource attached to the + agent. Required.""" @overload def __init__( self, *, - search_configurations: list["_models.BingGroundingSearchConfiguration"], + indexes: list["_models.AISearchIndexResource"], ) -> None: ... @overload @@ -2614,47 +2801,29 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class BingGroundingTool(Tool, discriminator="bing_grounding"): - """The input definition information for a bing grounding search tool as used to configure an - agent. +class AzureFunctionBinding(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The structure for keeping storage queue name and URI. - :ivar type: The object type, which is always 'bing_grounding'. Required. BING_GROUNDING. - :vartype type: str or ~azure.ai.projects.models.BING_GROUNDING - :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 bing_grounding: The bing grounding search tool parameters. Required. - :vartype bing_grounding: ~azure.ai.projects.models.BingGroundingSearchToolParameters + :ivar type: The type of binding, which is always 'storage_queue'. Required. Default value is + "storage_queue". + :vartype type: str + :ivar storage_queue: Storage queue. Required. + :vartype storage_queue: ~azure.ai.projects.models.AzureFunctionStorageQueue """ - type: Literal[ToolType.BING_GROUNDING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'bing_grounding'. Required. BING_GROUNDING.""" - 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.""" - bing_grounding: "_models.BingGroundingSearchToolParameters" = rest_field( + type: Literal["storage_queue"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of binding, which is always 'storage_queue'. Required. Default value is + \"storage_queue\".""" + storage_queue: "_models.AzureFunctionStorageQueue" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The bing grounding search tool parameters. Required.""" + """Storage queue. Required.""" @overload def __init__( self, *, - bing_grounding: "_models.BingGroundingSearchToolParameters", - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + storage_queue: "_models.AzureFunctionStorageQueue", ) -> None: ... @overload @@ -2666,40 +2835,44 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.BING_GROUNDING # type: ignore + self.type: Literal["storage_queue"] = "storage_queue" -class BlobReference(_Model): - """Blob reference details. +class AzureFunctionDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The definition of Azure function. - :ivar blob_uri: Blob URI path for client to upload data. Example: - ``https://blob.windows.core.net/Container/Path``. Required. - :vartype blob_uri: str - :ivar storage_account_arm_id: ARM ID of the storage account to use. Required. - :vartype storage_account_arm_id: str - :ivar credential: Credential info to access the storage account. Required. - :vartype credential: ~azure.ai.projects.models.BlobReferenceSasCredential + :ivar function: The definition of azure function and its parameters. Required. + :vartype function: ~azure.ai.projects.models.AzureFunctionDefinitionFunction + :ivar input_binding: Input storage queue. The queue storage trigger runs a function as messages + are added to it. Required. + :vartype input_binding: ~azure.ai.projects.models.AzureFunctionBinding + :ivar output_binding: Output storage queue. The function writes output to this queue when the + input items are processed. Required. + :vartype output_binding: ~azure.ai.projects.models.AzureFunctionBinding """ - blob_uri: str = rest_field(name="blobUri", visibility=["read", "create", "update", "delete", "query"]) - """Blob URI path for client to upload data. Example: - ``https://blob.windows.core.net/Container/Path``. Required.""" - storage_account_arm_id: str = rest_field( - name="storageAccountArmId", visibility=["read", "create", "update", "delete", "query"] + function: "_models.AzureFunctionDefinitionFunction" = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """ARM ID of the storage account to use. Required.""" - credential: "_models.BlobReferenceSasCredential" = rest_field( + """The definition of azure function and its parameters. Required.""" + input_binding: "_models.AzureFunctionBinding" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Credential info to access the storage account. Required.""" + """Input storage queue. The queue storage trigger runs a function as messages are added to it. + Required.""" + output_binding: "_models.AzureFunctionBinding" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Output storage queue. The function writes output to this queue when the input items are + processed. Required.""" @overload def __init__( self, *, - blob_uri: str, - storage_account_arm_id: str, - credential: "_models.BlobReferenceSasCredential", + function: "_models.AzureFunctionDefinitionFunction", + input_binding: "_models.AzureFunctionBinding", + output_binding: "_models.AzureFunctionBinding", ) -> None: ... @overload @@ -2713,38 +2886,34 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class BlobReferenceSasCredential(_Model): - """SAS Credential definition. - - :ivar sas_uri: SAS uri. Required. - :vartype sas_uri: str - :ivar type: Type of credential. Required. Default value is "SAS". - :vartype type: str - """ - - sas_uri: str = rest_field(name="sasUri", visibility=["read"]) - """SAS uri. Required.""" - type: Literal["SAS"] = rest_field(visibility=["read"]) - """Type of credential. Required. Default value is \"SAS\".""" - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type: Literal["SAS"] = "SAS" - - -class BotServiceAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="BotService"): - """BotServiceAuthorizationScheme. +class AzureFunctionDefinitionFunction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """AzureFunctionDefinitionFunction. - :ivar type: Required. BOT_SERVICE. - :vartype type: str or ~azure.ai.projects.models.BOT_SERVICE + :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] """ - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. BOT_SERVICE.""" + 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, + *, + name: str, + parameters: dict[str, Any], + description: Optional[str] = None, ) -> None: ... @overload @@ -2756,22 +2925,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = AgentEndpointAuthorizationSchemeType.BOT_SERVICE # type: ignore -class BotServiceRbacAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="BotServiceRbac"): - """BotServiceRbacAuthorizationScheme. +class AzureFunctionStorageQueue(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The structure for keeping storage queue name and URI. - :ivar type: Required. BOT_SERVICE_RBAC. - :vartype type: str or ~azure.ai.projects.models.BOT_SERVICE_RBAC + :ivar queue_service_endpoint: URI to the Azure Storage Queue service allowing you to manipulate + a queue. Required. + :vartype queue_service_endpoint: str + :ivar queue_name: The name of an Azure function storage queue. Required. + :vartype queue_name: str """ - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. BOT_SERVICE_RBAC.""" + queue_service_endpoint: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """URI to the Azure Storage Queue service allowing you to manipulate a queue. Required.""" + queue_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of an Azure function storage queue. Required.""" @overload def __init__( self, + *, + queue_service_endpoint: str, + queue_name: str, ) -> None: ... @overload @@ -2783,22 +2959,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC # type: ignore -class BotServiceTenantAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="BotServiceTenant"): - """BotServiceTenantAuthorizationScheme. +class AzureFunctionTool( + Tool, discriminator="azure_function" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The input definition information for an Azure Function Tool, as used to configure an Agent. - :ivar type: Required. BOT_SERVICE_TENANT. - :vartype type: str or ~azure.ai.projects.models.BOT_SERVICE_TENANT + :ivar type: The object type, which is always 'browser_automation'. Required. AZURE_FUNCTION. + :vartype type: str or ~azure.ai.projects.models.AZURE_FUNCTION + :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 azure_function: The Azure Function Tool definition. Required. + :vartype azure_function: ~azure.ai.projects.models.AzureFunctionDefinition """ - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. BOT_SERVICE_TENANT.""" + type: Literal[ToolType.AZURE_FUNCTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'browser_automation'. Required. AZURE_FUNCTION.""" + 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.""" + azure_function: "_models.AzureFunctionDefinition" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The Azure Function Tool definition. Required.""" @overload def __init__( self, + *, + azure_function: "_models.AzureFunctionDefinition", + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -2810,32 +3003,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT # type: ignore + self.type = ToolType.AZURE_FUNCTION # type: ignore -class BrowserAutomationPreviewTool(Tool, discriminator="browser_automation_preview"): - """The input definition information for a Browser Automation Tool, as used to configure an Agent. +class RedTeamTargetConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Abstract class for target configuration. - :ivar type: The object type, which is always 'browser_automation_preview'. Required. - BROWSER_AUTOMATION_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.BROWSER_AUTOMATION_PREVIEW - :ivar browser_automation_preview: The Browser Automation Tool parameters. Required. - :vartype browser_automation_preview: ~azure.ai.projects.models.BrowserAutomationToolParameters + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AzureOpenAIModelConfiguration + + :ivar type: Type of the model configuration. Required. Default value is None. + :vartype type: str """ - type: Literal[ToolType.BROWSER_AUTOMATION_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'browser_automation_preview'. Required. - BROWSER_AUTOMATION_PREVIEW.""" - browser_automation_preview: "_models.BrowserAutomationToolParameters" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The Browser Automation Tool parameters. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Type of the model configuration. Required. Default value is None.""" @overload def __init__( self, *, - browser_automation_preview: "_models.BrowserAutomationToolParameters", + type: str, ) -> None: ... @overload @@ -2847,41 +3036,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.BROWSER_AUTOMATION_PREVIEW # type: ignore -class BrowserAutomationPreviewToolboxTool(ToolboxTool, discriminator="browser_automation_preview"): - """A browser automation tool stored in a toolbox. +class AzureOpenAIModelConfiguration( + RedTeamTargetConfig, discriminator="AzureOpenAIModel" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Azure OpenAI model configuration. The API version would be selected by the service for querying + the model. - :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. BROWSER_AUTOMATION_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.BROWSER_AUTOMATION_PREVIEW - :ivar browser_automation_preview: The Browser Automation Tool parameters. Required. - :vartype browser_automation_preview: ~azure.ai.projects.models.BrowserAutomationToolParameters + :ivar type: Required. Default value is "AzureOpenAIModel". + :vartype type: str + :ivar model_deployment_name: Deployment name for AOAI model. Example: gpt-4o if in AIServices + or connection based ``connection_name/deployment_name`` (e.g. ``my-aoai-connection/gpt-4o``). + Required. + :vartype model_deployment_name: str """ - type: Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. BROWSER_AUTOMATION_PREVIEW.""" - browser_automation_preview: "_models.BrowserAutomationToolParameters" = rest_field( - visibility=["read", "create", "update", "delete", "query"] + type: Literal["AzureOpenAIModel"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"AzureOpenAIModel\".""" + model_deployment_name: str = rest_field( + name="modelDeploymentName", visibility=["read", "create", "update", "delete", "query"] ) - """The Browser Automation Tool parameters. Required.""" + """Deployment name for AOAI model. Example: gpt-4o if in AIServices or connection based + ``connection_name/deployment_name`` (e.g. ``my-aoai-connection/gpt-4o``). Required.""" @overload def __init__( self, *, - browser_automation_preview: "_models.BrowserAutomationToolParameters", - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + model_deployment_name: str, ) -> None: ... @overload @@ -2893,25 +3076,51 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolboxToolType.BROWSER_AUTOMATION_PREVIEW # type: ignore + self.type = "AzureOpenAIModel" # type: ignore -class BrowserAutomationToolConnectionParameters(_Model): # pylint: disable=name-too-long - """Definition of input parameters for the connection used by the Browser Automation Tool. +class BingCustomSearchConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A bing custom search configuration. - :ivar project_connection_id: The ID of the project connection to your Azure Playwright - resource. Required. + :ivar project_connection_id: Project connection id for grounding with bing search. Required. :vartype project_connection_id: str + :ivar instance_name: Name of the custom configuration instance given to config. Required. + :vartype instance_name: str + :ivar market: The market where the results come from. + :vartype market: str + :ivar set_lang: The language to use for user interface strings when calling Bing API. + :vartype set_lang: str + :ivar count: The number of search results to return in the bing api response. + :vartype count: int + :ivar freshness: Filter search results by a specific time range. See `accepted values here + `_. + :vartype freshness: str """ project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the project connection to your Azure Playwright resource. Required.""" - - @overload - def __init__( - self, + """Project connection id for grounding with bing search. Required.""" + instance_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the custom configuration instance given to config. Required.""" + market: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The market where the results come from.""" + set_lang: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The language to use for user interface strings when calling Bing API.""" + count: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of search results to return in the bing api response.""" + freshness: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Filter search results by a specific time range. See `accepted values here + `_.""" + + @overload + def __init__( + self, *, project_connection_id: str, + instance_name: str, + market: Optional[str] = None, + set_lang: Optional[str] = None, + count: Optional[int] = None, + freshness: Optional[str] = None, ) -> None: ... @overload @@ -2925,24 +3134,31 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class BrowserAutomationToolParameters(_Model): - """Definition of input parameters for the Browser Automation Tool. +class BingCustomSearchPreviewTool( + Tool, discriminator="bing_custom_search_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The input definition information for a Bing custom search tool as used to configure an agent. - :ivar connection: The project connection parameters associated with the Browser Automation - Tool. Required. - :vartype connection: ~azure.ai.projects.models.BrowserAutomationToolConnectionParameters + :ivar type: The object type, which is always 'bing_custom_search_preview'. Required. + BING_CUSTOM_SEARCH_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.BING_CUSTOM_SEARCH_PREVIEW + :ivar bing_custom_search_preview: The bing custom search tool parameters. Required. + :vartype bing_custom_search_preview: ~azure.ai.projects.models.BingCustomSearchToolParameters """ - connection: "_models.BrowserAutomationToolConnectionParameters" = rest_field( + type: Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'bing_custom_search_preview'. Required. + BING_CUSTOM_SEARCH_PREVIEW.""" + bing_custom_search_preview: "_models.BingCustomSearchToolParameters" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The project connection parameters associated with the Browser Automation Tool. Required.""" + """The bing custom search tool parameters. Required.""" @overload def __init__( self, *, - connection: "_models.BrowserAutomationToolConnectionParameters", + bing_custom_search_preview: "_models.BingCustomSearchToolParameters", ) -> None: ... @overload @@ -2954,50 +3170,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.BING_CUSTOM_SEARCH_PREVIEW # type: ignore -class CaptureStructuredOutputsTool(Tool, discriminator="capture_structured_outputs"): - """A tool for capturing structured outputs. +class BingCustomSearchToolParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The bing custom search tool parameters. - :ivar type: The type of the tool. Always ``capture_structured_outputs``. Required. - CAPTURE_STRUCTURED_OUTPUTS. - :vartype type: str or ~azure.ai.projects.models.CAPTURE_STRUCTURED_OUTPUTS - :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 outputs: The structured outputs to capture from the model. Required. - :vartype outputs: ~azure.ai.projects.models.StructuredOutputDefinition + :ivar search_configurations: The project connections attached to this tool. There can be a + maximum of 1 connection resource attached to the tool. Required. + :vartype search_configurations: list[~azure.ai.projects.models.BingCustomSearchConfiguration] """ - type: Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the tool. Always ``capture_structured_outputs``. Required. - CAPTURE_STRUCTURED_OUTPUTS.""" - 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.""" - outputs: "_models.StructuredOutputDefinition" = rest_field( + search_configurations: list["_models.BingCustomSearchConfiguration"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The structured outputs to capture from the model. Required.""" + """The project connections attached to this tool. There can be a maximum of 1 connection resource + attached to the tool. Required.""" @overload def __init__( self, *, - outputs: "_models.StructuredOutputDefinition", - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + search_configurations: list["_models.BingCustomSearchConfiguration"], ) -> None: ... @overload @@ -3009,34 +3203,45 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.CAPTURE_STRUCTURED_OUTPUTS # type: ignore -class ChartCoordinate(_Model): - """Coordinates for the analysis chart. +class BingGroundingSearchConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Search configuration for Bing Grounding. - :ivar x: X-axis coordinate. Required. - :vartype x: int - :ivar y: Y-axis coordinate. Required. - :vartype y: int - :ivar size: Size of the chart element. Required. - :vartype size: int + :ivar project_connection_id: Project connection id for grounding with bing search. Required. + :vartype project_connection_id: str + :ivar market: The market where the results come from. + :vartype market: str + :ivar set_lang: The language to use for user interface strings when calling Bing API. + :vartype set_lang: str + :ivar count: The number of search results to return in the bing api response. + :vartype count: int + :ivar freshness: Filter search results by a specific time range. See `accepted values here + `_. + :vartype freshness: str """ - x: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """X-axis coordinate. Required.""" - y: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Y-axis coordinate. Required.""" - size: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Size of the chart element. Required.""" + project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Project connection id for grounding with bing search. Required.""" + market: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The market where the results come from.""" + set_lang: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The language to use for user interface strings when calling Bing API.""" + count: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of search results to return in the bing api response.""" + freshness: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Filter search results by a specific time range. See `accepted values here + `_.""" @overload def __init__( self, *, - x: int, - y: int, - size: int, + project_connection_id: str, + market: Optional[str] = None, + set_lang: Optional[str] = None, + count: Optional[int] = None, + freshness: Optional[str] = None, ) -> None: ... @overload @@ -3050,50 +3255,26 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryItem(_Model): - """A single memory item stored in the memory store, containing content and metadata. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ChatSummaryMemoryItem, ProceduralMemoryItem, UserProfileMemoryItem +class BingGroundingSearchToolParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The bing grounding search tool parameters. - :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. Known values are: "user_profile", - "chat_summary", and "procedural". - :vartype kind: str or ~azure.ai.projects.models.MemoryItemKind + :ivar search_configurations: The search configurations attached to this tool. There can be a + maximum of 1 search configuration resource attached to the tool. Required. + :vartype search_configurations: + list[~azure.ai.projects.models.BingGroundingSearchConfiguration] """ - __mapping__: dict[str, _Model] = {} - memory_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the memory item. Required.""" - updated_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + search_configurations: list["_models.BingGroundingSearchConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The last update time of the memory item. Required.""" - scope: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The namespace that logically groups and isolates memories, such as a user ID. Required.""" - content: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The content of the memory. Required.""" - kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) - """The kind of the memory item. Required. Known values are: \"user_profile\", \"chat_summary\", - and \"procedural\".""" + """The search configurations attached to this tool. There can be a maximum of 1 search + configuration resource attached to the tool. Required.""" @overload def __init__( self, *, - memory_id: str, - updated_at: datetime.datetime, - scope: str, - content: str, - kind: str, + search_configurations: list["_models.BingGroundingSearchConfiguration"], ) -> None: ... @overload @@ -3107,33 +3288,49 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ChatSummaryMemoryItem(MemoryItem, discriminator="chat_summary"): - """A memory item containing a summary extracted from conversations. +class BingGroundingTool( + Tool, discriminator="bing_grounding" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The input definition information for a bing grounding search tool as used to configure an + agent. - :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. Summary of chat conversations. - :vartype kind: str or ~azure.ai.projects.models.CHAT_SUMMARY + :ivar type: The object type, which is always 'bing_grounding'. Required. BING_GROUNDING. + :vartype type: str or ~azure.ai.projects.models.BING_GROUNDING + :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 bing_grounding: The bing grounding search tool parameters. Required. + :vartype bing_grounding: ~azure.ai.projects.models.BingGroundingSearchToolParameters """ - kind: Literal[MemoryItemKind.CHAT_SUMMARY] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The kind of the memory item. Required. Summary of chat conversations.""" + type: Literal[ToolType.BING_GROUNDING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'bing_grounding'. Required. BING_GROUNDING.""" + 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.""" + bing_grounding: "_models.BingGroundingSearchToolParameters" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The bing grounding search tool parameters. Required.""" @overload def __init__( self, *, - memory_id: str, - updated_at: datetime.datetime, - scope: str, - content: str, + bing_grounding: "_models.BingGroundingSearchToolParameters", + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -3145,73 +3342,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = MemoryItemKind.CHAT_SUMMARY # type: ignore - - -class ClusterInsightResult(_Model): - """Insights from the cluster analysis. - - :ivar summary: Summary of the insights report. Required. - :vartype summary: ~azure.ai.projects.models.InsightSummary - :ivar clusters: List of clusters identified in the insights. Required. - :vartype clusters: list[~azure.ai.projects.models.InsightCluster] - :ivar coordinates: Optional mapping of IDs to 2D coordinates used by the UX for - visualization. - - The map keys are string identifiers (for example, a cluster id or a sample id) - and the values are the coordinates and visual size for rendering on a 2D chart. - - This property is omitted unless the client requests coordinates (for example, - by passing ``includeCoordinates=true`` as a query parameter). - - Example: + self.type = ToolType.BING_GROUNDING # type: ignore - .. code-block:: - { - "cluster-1": { "x": 12, "y": 34, "size": 8 }, - "sample-123": { "x": 18, "y": 22, "size": 4 } - } +class BlobReference(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Blob reference details. - Coordinates are intended only for client-side visualization and do not - modify the canonical insights results. - :vartype coordinates: dict[str, ~azure.ai.projects.models.ChartCoordinate] + :ivar blob_uri: Blob URI path for client to upload data. Example: + ``https://blob.windows.core.net/Container/Path``. Required. + :vartype blob_uri: str + :ivar storage_account_arm_id: ARM ID of the storage account to use. Required. + :vartype storage_account_arm_id: str + :ivar credential: Credential info to access the storage account. Required. + :vartype credential: ~azure.ai.projects.models.BlobReferenceSasCredential """ - summary: "_models.InsightSummary" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Summary of the insights report. Required.""" - clusters: list["_models.InsightCluster"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """List of clusters identified in the insights. Required.""" - coordinates: Optional[dict[str, "_models.ChartCoordinate"]] = rest_field( + blob_uri: str = rest_field(name="blobUri", visibility=["read", "create", "update", "delete", "query"]) + """Blob URI path for client to upload data. Example: + ``https://blob.windows.core.net/Container/Path``. Required.""" + storage_account_arm_id: str = rest_field( + name="storageAccountArmId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM ID of the storage account to use. Required.""" + credential: "_models.BlobReferenceSasCredential" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """ Optional mapping of IDs to 2D coordinates used by the UX for visualization. - - The map keys are string identifiers (for example, a cluster id or a sample id) - and the values are the coordinates and visual size for rendering on a 2D chart. - - This property is omitted unless the client requests coordinates (for example, - by passing ``includeCoordinates=true`` as a query parameter). - - Example: - - .. code-block:: - - { - \"cluster-1\": { \"x\": 12, \"y\": 34, \"size\": 8 }, - \"sample-123\": { \"x\": 18, \"y\": 22, \"size\": 4 } - } - - Coordinates are intended only for client-side visualization and do not - modify the canonical insights results.""" + """Credential info to access the storage account. Required.""" @overload def __init__( self, *, - summary: "_models.InsightSummary", - clusters: list["_models.InsightCluster"], - coordinates: Optional[dict[str, "_models.ChartCoordinate"]] = None, + blob_uri: str, + storage_account_arm_id: str, + credential: "_models.BlobReferenceSasCredential", ) -> None: ... @overload @@ -3225,37 +3389,38 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ClusterTokenUsage(_Model): - """Token usage for cluster analysis. +class BlobReferenceSasCredential(_Model): # pylint: disable=docstring-missing-param + """SAS Credential definition. - :ivar input_token_usage: input token usage. Required. - :vartype input_token_usage: int - :ivar output_token_usage: output token usage. Required. - :vartype output_token_usage: int - :ivar total_token_usage: total token usage. Required. - :vartype total_token_usage: int + :ivar sas_uri: SAS uri. Required. + :vartype sas_uri: str + :ivar type: Type of credential. Required. Default value is "SAS". + :vartype type: str """ - input_token_usage: int = rest_field( - name="inputTokenUsage", visibility=["read", "create", "update", "delete", "query"] - ) - """input token usage. Required.""" - output_token_usage: int = rest_field( - name="outputTokenUsage", visibility=["read", "create", "update", "delete", "query"] - ) - """output token usage. Required.""" - total_token_usage: int = rest_field( - name="totalTokenUsage", visibility=["read", "create", "update", "delete", "query"] - ) - """total token usage. Required.""" + sas_uri: str = rest_field(name="sasUri", visibility=["read"]) + """SAS uri. Required.""" + type: Literal["SAS"] = rest_field(visibility=["read"]) + """Type of credential. Required. Default value is \"SAS\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["SAS"] = "SAS" + + +class BotServiceAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="BotService"): + """BotServiceAuthorizationScheme. + + :ivar type: Required. BOT_SERVICE. + :vartype type: str or ~azure.ai.projects.models.BOT_SERVICE + """ + + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. BOT_SERVICE.""" @overload def __init__( self, - *, - input_token_usage: int, - output_token_usage: int, - total_token_usage: int, ) -> None: ... @overload @@ -3267,51 +3432,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = AgentEndpointAuthorizationSchemeType.BOT_SERVICE # type: ignore -class EvaluatorDefinition(_Model): - """Base evaluator configuration with discriminator. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - CodeBasedEvaluatorDefinition, EndpointBasedEvaluatorDefinition, PromptBasedEvaluatorDefinition, - RubricBasedEvaluatorDefinition +class BotServiceRbacAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="BotServiceRbac"): + """BotServiceRbacAuthorizationScheme. - :ivar type: The type of evaluator definition. Required. Known values are: "prompt", "code", - "prompt_and_code", "service", "openai_graders", "rubric", and "endpoint". - :vartype type: str or ~azure.ai.projects.models.EvaluatorDefinitionType - :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. BOT_SERVICE_RBAC. + :vartype type: str or ~azure.ai.projects.models.BOT_SERVICE_RBAC """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of evaluator definition. Required. Known values are: \"prompt\", \"code\", - \"prompt_and_code\", \"service\", \"openai_graders\", \"rubric\", and \"endpoint\".""" - init_parameters: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The JSON schema (Draft 2020-12) for the evaluator's input parameters. This includes parameters - like type, properties, required.""" - data_schema: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The JSON schema (Draft 2020-12) for the evaluator's input data. This includes parameters like - type, properties, required.""" - metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """List of output metrics produced by this evaluator.""" + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. BOT_SERVICE_RBAC.""" @overload def __init__( self, - *, - type: str, - init_parameters: Optional[dict[str, Any]] = None, - data_schema: Optional[dict[str, Any]] = None, - metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, ) -> None: ... @overload @@ -3323,55 +3459,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC # type: ignore -class CodeBasedEvaluatorDefinition(EvaluatorDefinition, discriminator="code"): - """Code-based evaluator definition using python code. +class BotServiceTenantAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="BotServiceTenant"): + """BotServiceTenantAuthorizationScheme. - :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. Code-based definition. - :vartype type: str or ~azure.ai.projects.models.CODE - :ivar code_text: Inline code text for the evaluator. - :vartype code_text: str - :ivar entry_point: The entry point Python file name for the uploaded evaluator code (e.g. - 'answer_length_evaluator.py'). - :vartype entry_point: str - :ivar image_tag: The container image tag to use for evaluator code execution. - :vartype image_tag: str - :ivar blob_uri: The blob URI for the evaluator storage. - :vartype blob_uri: str + :ivar type: Required. BOT_SERVICE_TENANT. + :vartype type: str or ~azure.ai.projects.models.BOT_SERVICE_TENANT """ - type: Literal[EvaluatorDefinitionType.CODE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Code-based definition.""" - code_text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Inline code text for the evaluator.""" - entry_point: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The entry point Python file name for the uploaded evaluator code (e.g. - 'answer_length_evaluator.py').""" - image_tag: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The container image tag to use for evaluator code execution.""" - blob_uri: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The blob URI for the evaluator storage.""" + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. BOT_SERVICE_TENANT.""" @overload def __init__( self, - *, - init_parameters: Optional[dict[str, Any]] = None, - data_schema: Optional[dict[str, Any]] = None, - metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, - code_text: Optional[str] = None, - entry_point: Optional[str] = None, - image_tag: Optional[str] = None, - blob_uri: Optional[str] = None, ) -> None: ... @overload @@ -3383,53 +3486,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = EvaluatorDefinitionType.CODE # type: ignore + self.type = AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT # type: ignore -class CodeConfiguration(_Model): - """Code-based deployment configuration for a hosted agent. +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. - :ivar runtime: The runtime identifier for code execution (e.g., 'python_3_11', 'python_3_12', - 'python_3_13'). Required. - :vartype runtime: str - :ivar entry_point: The entry point command and arguments for the code execution. Required. - :vartype entry_point: list[str] - :ivar dependency_resolution: How package dependencies are resolved at deployment time. Defaults - to ``bundled``, where the caller bundles all dependencies into the uploaded zip and the service - performs no remote build. ``remote_build`` instructs the service to build dependencies remotely - from the manifest included in the uploaded zip. Required. Known values are: "bundled" and - "remote_build". - :vartype dependency_resolution: str or ~azure.ai.projects.models.CodeDependencyResolution - :ivar content_hash: The SHA-256 hex digest of the uploaded code zip. Set by the service from - the ``x-ms-code-zip-sha256`` request header; read-only in responses and never accepted in - request payloads. - :vartype content_hash: str + :ivar type: The object type, which is always 'browser_automation_preview'. Required. + BROWSER_AUTOMATION_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.BROWSER_AUTOMATION_PREVIEW + :ivar browser_automation_preview: The Browser Automation Tool parameters. Required. + :vartype browser_automation_preview: ~azure.ai.projects.models.BrowserAutomationToolParameters """ - runtime: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The runtime identifier for code execution (e.g., 'python_3_11', 'python_3_12', 'python_3_13'). - Required.""" - entry_point: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The entry point command and arguments for the code execution. Required.""" - dependency_resolution: Union[str, "_models.CodeDependencyResolution"] = rest_field( + type: Literal[ToolType.BROWSER_AUTOMATION_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'browser_automation_preview'. Required. + BROWSER_AUTOMATION_PREVIEW.""" + browser_automation_preview: "_models.BrowserAutomationToolParameters" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """How package dependencies are resolved at deployment time. Defaults to ``bundled``, where the - caller bundles all dependencies into the uploaded zip and the service performs no remote build. - ``remote_build`` instructs the service to build dependencies remotely from the manifest - included in the uploaded zip. Required. Known values are: \"bundled\" and \"remote_build\".""" - content_hash: Optional[str] = rest_field(visibility=["read"]) - """The SHA-256 hex digest of the uploaded code zip. Set by the service from the - ``x-ms-code-zip-sha256`` request header; read-only in responses and never accepted in request - payloads.""" + """The Browser Automation Tool parameters. Required.""" @overload def __init__( self, *, - runtime: str, - entry_point: list[str], - dependency_resolution: Union[str, "_models.CodeDependencyResolution"], + browser_automation_preview: "_models.BrowserAutomationToolParameters", ) -> None: ... @overload @@ -3441,55 +3525,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.BROWSER_AUTOMATION_PREVIEW # type: ignore -class CodeInterpreterTool(Tool, discriminator="code_interpreter"): - """Code interpreter. +class BrowserAutomationPreviewToolboxTool( + ToolboxTool, discriminator="browser_automation_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A browser automation tool stored in a toolbox. - :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 name: Deprecated. This property is deprecated and will be removed in a future version. + :ivar name: Optional user-defined name for this tool or configuration. :vartype name: str - :ivar description: Deprecated. This property is deprecated and will be removed in a future - version. + :ivar description: Optional user-defined description for this tool or configuration. :vartype description: str - :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future - version. + :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 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 type: Required. BROWSER_AUTOMATION_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.BROWSER_AUTOMATION_PREVIEW + :ivar browser_automation_preview: The Browser Automation Tool parameters. Required. + :vartype browser_automation_preview: ~azure.ai.projects.models.BrowserAutomationToolParameters """ - 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.""" - 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( + type: Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. BROWSER_AUTOMATION_PREVIEW.""" + browser_automation_preview: "_models.BrowserAutomationToolParameters" = 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.""" + """The Browser Automation Tool parameters. Required.""" @overload def __init__( self, *, + browser_automation_preview: "_models.BrowserAutomationToolParameters", 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 @@ -3501,47 +3573,27 @@ 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 + self.type = ToolboxToolType.BROWSER_AUTOMATION_PREVIEW # type: ignore -class CodeInterpreterToolboxTool(ToolboxTool, discriminator="code_interpreter"): - """A code interpreter tool stored in a toolbox. +class BrowserAutomationToolConnectionParameters( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Definition of input parameters for the connection used by the Browser Automation Tool. - :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. CODE_INTERPRETER. - :vartype type: str or ~azure.ai.projects.models.CODE_INTERPRETER - :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 project_connection_id: The ID of the project connection to your Azure Playwright + resource. Required. + :vartype project_connection_id: str """ - type: Literal[ToolboxToolType.CODE_INTERPRETER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. CODE_INTERPRETER.""" - 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.""" + project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the project connection to your Azure Playwright resource. Required.""" @overload def __init__( self, *, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, - container: Optional[Union[str, "_models.AutoCodeInterpreterToolParam"]] = None, + project_connection_id: str, ) -> None: ... @overload @@ -3553,63 +3605,26 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolboxToolType.CODE_INTERPRETER # type: ignore - -class ComparisonFilter(_Model): - """Comparison Filter. - :ivar type: Specifies the comparison operator: ``eq``, ``ne``, ``gt``, ``gte``, ``lt``, - ``lte``, ``in``, ``nin``. +class BrowserAutomationToolParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Definition of input parameters for the Browser Automation Tool. - * `eq`: equals - * `ne`: not equal - * `gt`: greater than - * `gte`: greater than or equal - * `lt`: less than - * `lte`: less than or equal - * `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 - :ivar value: The value to compare against the attribute key; supports string, number, or - boolean types. Required. Is one of the following types: str, float, bool, [Union[str, float]] - :vartype value: str or float or bool or list[str or float] + :ivar connection: The project connection parameters associated with the Browser Automation + Tool. Required. + :vartype connection: ~azure.ai.projects.models.BrowserAutomationToolConnectionParameters """ - type: Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies the comparison operator: ``eq``, ``ne``, ``gt``, ``gte``, ``lt``, ``lte``, ``in``, - ``nin``. - - * `eq`: equals - * `ne`: not equal - * `gt`: greater than - * `gte`: greater than or equal - * `lt`: less than - * `lte`: less than or equal - * `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\"]""" - key: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The key to compare against the value. Required.""" - value: Union[str, float, bool, list[Union[str, float]]] = rest_field( + connection: "_models.BrowserAutomationToolConnectionParameters" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The value to compare against the attribute key; supports string, number, or boolean types. - Required. Is one of the following types: str, float, bool, [Union[str, float]]""" + """The project connection parameters associated with the Browser Automation Tool. Required.""" @overload def __init__( self, *, - type: Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"], - key: str, - value: Union[str, float, bool, list[Union[str, float]]], + connection: "_models.BrowserAutomationToolConnectionParameters", ) -> None: ... @overload @@ -3623,31 +3638,50 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CompoundFilter(_Model): - """Compound Filter. +class CaptureStructuredOutputsTool( + Tool, discriminator="capture_structured_outputs" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A tool for capturing structured outputs. - :ivar type: Type of operation: ``and`` or ``or``. Required. Is either a Literal["and"] type or - a Literal["or"] type. - :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] + :ivar type: The type of the tool. Always ``capture_structured_outputs``. Required. + CAPTURE_STRUCTURED_OUTPUTS. + :vartype type: str or ~azure.ai.projects.models.CAPTURE_STRUCTURED_OUTPUTS + :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 outputs: The structured outputs to capture from the model. Required. + :vartype outputs: ~azure.ai.projects.models.StructuredOutputDefinition """ - 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( + type: Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the tool. Always ``capture_structured_outputs``. Required. + CAPTURE_STRUCTURED_OUTPUTS.""" + 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"] ) - """Array of filters to combine. Items can be ``ComparisonFilter`` or ``CompoundFilter``. Required.""" + """Deprecated. This property is deprecated and will be removed in a future version.""" + outputs: "_models.StructuredOutputDefinition" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The structured outputs to capture from the model. Required.""" @overload def __init__( self, *, - type: Literal["and", "or"], - filters: list[Union["_models.ComparisonFilter", Any]], + outputs: "_models.StructuredOutputDefinition", + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -3659,21 +3693,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.CAPTURE_STRUCTURED_OUTPUTS # type: ignore -class ComputerTool(Tool, discriminator="computer"): - """Computer. +class ChartCoordinate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Coordinates for the analysis chart. - :ivar type: The type of the computer tool. Always ``computer``. Required. COMPUTER. - :vartype type: str or ~azure.ai.projects.models.COMPUTER + :ivar x: X-axis coordinate. Required. + :vartype x: int + :ivar y: Y-axis coordinate. Required. + :vartype y: int + :ivar size: Size of the chart element. Required. + :vartype size: int """ - 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.""" + x: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """X-axis coordinate. Required.""" + y: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Y-axis coordinate. Required.""" + size: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Size of the chart element. Required.""" @overload def __init__( self, + *, + x: int, + y: int, + size: int, ) -> None: ... @overload @@ -3685,44 +3732,52 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: 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"): - """Computer use preview. +class MemoryItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A single memory item stored in the memory store, containing content and metadata. - :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 + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ChatSummaryMemoryItem, ProceduralMemoryItem, UserProfileMemoryItem + + :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. Known values are: "user_profile", + "chat_summary", and "procedural". + :vartype kind: str or ~azure.ai.projects.models.MemoryItemKind """ - 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"] + __mapping__: dict[str, _Model] = {} + memory_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the memory item. Required.""" + updated_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" ) - """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.""" + """The last update time of the memory item. Required.""" + scope: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The namespace that logically groups and isolates memories, such as a user ID. Required.""" + content: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The content of the memory. Required.""" + kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) + """The kind of the memory item. Required. Known values are: \"user_profile\", \"chat_summary\", + and \"procedural\".""" @overload def __init__( self, *, - environment: Union[str, "_models.ComputerEnvironment"], - display_width: int, - display_height: int, + memory_id: str, + updated_at: datetime.datetime, + scope: str, + content: str, + kind: str, ) -> None: ... @overload @@ -3734,69 +3789,37 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: 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. +class ChatSummaryMemoryItem( + MemoryItem, discriminator="chat_summary" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A memory item containing a summary extracted from conversations. - :ivar name: The friendly name of the connection, provided by the user. Required. - :vartype name: str - :ivar id: A unique identifier for the connection, generated by the service. Required. - :vartype id: str - :ivar type: Category of the connection. Required. Known values are: "AzureOpenAI", "AzureBlob", - "AzureStorageAccount", "CognitiveSearch", "CosmosDB", "ApiKey", "AppConfig", "AppInsights", - "CustomKeys", and "RemoteTool_Preview". - :vartype type: str or ~azure.ai.projects.models.ConnectionType - :ivar target: The connection URL to be used for this service. Required. - :vartype target: str - :ivar is_default: Whether the connection is tagged as the default connection of its type. + :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 is_default: bool - :ivar credentials: The credentials used by the connection. Required. - :vartype credentials: ~azure.ai.projects.models.BaseCredentials - :ivar metadata: Metadata of the connection. Required. - :vartype metadata: dict[str, str] - """ - - name: str = rest_field(visibility=["read"]) - """The friendly name of the connection, provided by the user. Required.""" - id: str = rest_field(visibility=["read"]) - """A unique identifier for the connection, generated by the service. Required.""" - type: Union[str, "_models.ConnectionType"] = rest_field(visibility=["read"]) - """Category of the connection. Required. Known values are: \"AzureOpenAI\", \"AzureBlob\", - \"AzureStorageAccount\", \"CognitiveSearch\", \"CosmosDB\", \"ApiKey\", \"AppConfig\", - \"AppInsights\", \"CustomKeys\", and \"RemoteTool_Preview\".""" - target: str = rest_field(visibility=["read"]) - """The connection URL to be used for this service. Required.""" - is_default: bool = rest_field(name="isDefault", visibility=["read"]) - """Whether the connection is tagged as the default connection of its type. Required.""" - credentials: "_models.BaseCredentials" = rest_field(visibility=["read"]) - """The credentials used by the connection. Required.""" - metadata: dict[str, str] = rest_field(visibility=["read"]) - """Metadata of the connection. Required.""" - - -class FunctionShellToolParamEnvironment(_Model): - """FunctionShellToolParamEnvironment. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ContainerAutoParam, FunctionShellToolParamEnvironmentContainerReferenceParam, - FunctionShellToolParamEnvironmentLocalEnvironmentParam - - :ivar type: Required. Known values are: "container_auto", "local", and "container_reference". - :vartype type: str or ~azure.ai.projects.models.FunctionShellToolParamEnvironmentType + :vartype scope: str + :ivar content: The content of the memory. Required. + :vartype content: str + :ivar kind: The kind of the memory item. Required. Summary of chat conversations. + :vartype kind: str or ~azure.ai.projects.models.CHAT_SUMMARY """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"container_auto\", \"local\", and \"container_reference\".""" + kind: Literal[MemoryItemKind.CHAT_SUMMARY] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The kind of the memory item. Required. Summary of chat conversations.""" @overload def __init__( self, *, - type: str, + memory_id: str, + updated_at: datetime.datetime, + scope: str, + content: str, ) -> None: ... @overload @@ -3808,47 +3831,73 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.kind = MemoryItemKind.CHAT_SUMMARY # type: ignore -class ContainerAutoParam(FunctionShellToolParamEnvironment, discriminator="container_auto"): - """ContainerAutoParam. +class ClusterInsightResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Insights from the cluster analysis. - :ivar type: Automatically creates a container for this request. Required. CONTAINER_AUTO. - :vartype type: str or ~azure.ai.projects.models.CONTAINER_AUTO - :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: - :vartype network_policy: ~azure.ai.projects.models.ContainerNetworkPolicyParam + :ivar summary: Summary of the insights report. Required. + :vartype summary: ~azure.ai.projects.models.InsightSummary + :ivar clusters: List of clusters identified in the insights. Required. + :vartype clusters: list[~azure.ai.projects.models.InsightCluster] + :ivar coordinates: Optional mapping of IDs to 2D coordinates used by the UX for + visualization. + + The map keys are string identifiers (for example, a cluster id or a sample id) + and the values are the coordinates and visual size for rendering on a 2D chart. + + This property is omitted unless the client requests coordinates (for example, + by passing ``includeCoordinates=true`` as a query parameter). + + Example: + + .. code-block:: + + { + "cluster-1": { "x": 12, "y": 34, "size": 8 }, + "sample-123": { "x": 18, "y": 22, "size": 4 } + } + + Coordinates are intended only for client-side visualization and do not + modify the canonical insights results. + :vartype coordinates: dict[str, ~azure.ai.projects.models.ChartCoordinate] """ - type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Automatically creates a container for this request. Required. 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.ContainerNetworkPolicyParam"] = rest_field( + summary: "_models.InsightSummary" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Summary of the insights report. Required.""" + clusters: list["_models.InsightCluster"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of clusters identified in the insights. Required.""" + coordinates: Optional[dict[str, "_models.ChartCoordinate"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) + """ Optional mapping of IDs to 2D coordinates used by the UX for visualization. + + The map keys are string identifiers (for example, a cluster id or a sample id) + and the values are the coordinates and visual size for rendering on a 2D chart. + + This property is omitted unless the client requests coordinates (for example, + by passing ``includeCoordinates=true`` as a query parameter). + + Example: + + .. code-block:: + + { + \"cluster-1\": { \"x\": 12, \"y\": 34, \"size\": 8 }, + \"sample-123\": { \"x\": 18, \"y\": 22, \"size\": 4 } + } + + Coordinates are intended only for client-side visualization and do not + modify the canonical insights results.""" @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.ContainerNetworkPolicyParam"] = None, + summary: "_models.InsightSummary", + clusters: list["_models.InsightCluster"], + coordinates: Optional[dict[str, "_models.ChartCoordinate"]] = None, ) -> None: ... @overload @@ -3860,24 +3909,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = FunctionShellToolParamEnvironmentType.CONTAINER_AUTO # type: ignore -class ContainerConfiguration(_Model): - """Container-based deployment configuration for a hosted agent. +class ClusterTokenUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Token usage for cluster analysis. - :ivar image: The container image for the hosted agent. Required. - :vartype image: str + :ivar input_token_usage: input token usage. Required. + :vartype input_token_usage: int + :ivar output_token_usage: output token usage. Required. + :vartype output_token_usage: int + :ivar total_token_usage: total token usage. Required. + :vartype total_token_usage: int """ - image: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The container image for the hosted agent. Required.""" + input_token_usage: int = rest_field( + name="inputTokenUsage", visibility=["read", "create", "update", "delete", "query"] + ) + """input token usage. Required.""" + output_token_usage: int = rest_field( + name="outputTokenUsage", visibility=["read", "create", "update", "delete", "query"] + ) + """output token usage. Required.""" + total_token_usage: int = rest_field( + name="totalTokenUsage", visibility=["read", "create", "update", "delete", "query"] + ) + """total token usage. Required.""" @overload def __init__( self, *, - image: str, + input_token_usage: int, + output_token_usage: int, + total_token_usage: int, ) -> None: ... @overload @@ -3891,25 +3955,49 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ContainerNetworkPolicyParam(_Model): - """Network access policy for the container. +class EvaluatorDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Base evaluator configuration with discriminator. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ContainerNetworkPolicyAllowlistParam, ContainerNetworkPolicyDisabledParam + CodeBasedEvaluatorDefinition, EndpointBasedEvaluatorDefinition, PromptBasedEvaluatorDefinition, + RubricBasedEvaluatorDefinition - :ivar type: Required. Known values are: "disabled" and "allowlist". - :vartype type: str or ~azure.ai.projects.models.ContainerNetworkPolicyParamType + :ivar type: The type of evaluator definition. Required. Known values are: "prompt", "code", + "prompt_and_code", "service", "openai_graders", "rubric", and "endpoint". + :vartype type: str or ~azure.ai.projects.models.EvaluatorDefinitionType + :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] """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"disabled\" and \"allowlist\".""" + """The type of evaluator definition. Required. Known values are: \"prompt\", \"code\", + \"prompt_and_code\", \"service\", \"openai_graders\", \"rubric\", and \"endpoint\".""" + init_parameters: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The JSON schema (Draft 2020-12) for the evaluator's input parameters. This includes parameters + like type, properties, required.""" + data_schema: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The JSON schema (Draft 2020-12) for the evaluator's input data. This includes parameters like + type, properties, required.""" + metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of output metrics produced by this evaluator.""" @overload def __init__( self, *, type: str, + init_parameters: Optional[dict[str, Any]] = None, + data_schema: Optional[dict[str, Any]] = None, + metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, ) -> None: ... @overload @@ -3923,35 +4011,55 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ContainerNetworkPolicyAllowlistParam(ContainerNetworkPolicyParam, discriminator="allowlist"): - """ContainerNetworkPolicyAllowlistParam. +class CodeBasedEvaluatorDefinition( + EvaluatorDefinition, discriminator="code" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Code-based evaluator definition using python code. - :ivar type: Allow outbound network access only to specified domains. Always ``allowlist``. - Required. ALLOWLIST. - :vartype type: str or ~azure.ai.projects.models.ALLOWLIST - :ivar allowed_domains: A list of allowed domains when type is ``allowlist``. Required. - :vartype allowed_domains: list[str] - :ivar domain_secrets: Optional domain-scoped secrets for allowlisted domains. - :vartype domain_secrets: - list[~azure.ai.projects.models.ContainerNetworkPolicyDomainSecretParam] + :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. Code-based definition. + :vartype type: str or ~azure.ai.projects.models.CODE + :ivar code_text: Inline code text for the evaluator. + :vartype code_text: str + :ivar entry_point: The entry point Python file name for the uploaded evaluator code (e.g. + 'answer_length_evaluator.py'). + :vartype entry_point: str + :ivar image_tag: The container image tag to use for evaluator code execution. + :vartype image_tag: str + :ivar blob_uri: The blob URI for the evaluator storage. + :vartype blob_uri: str """ - type: Literal[ContainerNetworkPolicyParamType.ALLOWLIST] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Allow outbound network access only to specified domains. Always ``allowlist``. Required. - ALLOWLIST.""" - allowed_domains: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A list of allowed domains when type is ``allowlist``. Required.""" - domain_secrets: Optional[list["_models.ContainerNetworkPolicyDomainSecretParam"]] = rest_field( - visibility=["create"] - ) - """Optional domain-scoped secrets for allowlisted domains.""" + type: Literal[EvaluatorDefinitionType.CODE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Code-based definition.""" + code_text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Inline code text for the evaluator.""" + entry_point: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The entry point Python file name for the uploaded evaluator code (e.g. + 'answer_length_evaluator.py').""" + image_tag: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The container image tag to use for evaluator code execution.""" + blob_uri: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The blob URI for the evaluator storage.""" @overload def __init__( self, *, - allowed_domains: list[str], - domain_secrets: Optional[list["_models.ContainerNetworkPolicyDomainSecretParam"]] = None, + init_parameters: Optional[dict[str, Any]] = None, + data_schema: Optional[dict[str, Any]] = None, + metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, + code_text: Optional[str] = None, + entry_point: Optional[str] = None, + image_tag: Optional[str] = None, + blob_uri: Optional[str] = None, ) -> None: ... @overload @@ -3963,22 +4071,53 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ContainerNetworkPolicyParamType.ALLOWLIST # type: ignore - - -class ContainerNetworkPolicyDisabledParam(ContainerNetworkPolicyParam, discriminator="disabled"): - """ContainerNetworkPolicyDisabledParam. + self.type = EvaluatorDefinitionType.CODE # type: ignore - :ivar type: Disable outbound network access. Always ``disabled``. Required. DISABLED. - :vartype type: str or ~azure.ai.projects.models.DISABLED - """ - type: Literal[ContainerNetworkPolicyParamType.DISABLED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Disable outbound network access. Always ``disabled``. Required. DISABLED.""" +class CodeConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Code-based deployment configuration for a hosted agent. - @overload + :ivar runtime: The runtime identifier for code execution (e.g., 'python_3_11', 'python_3_12', + 'python_3_13'). Required. + :vartype runtime: str + :ivar entry_point: The entry point command and arguments for the code execution. Required. + :vartype entry_point: list[str] + :ivar dependency_resolution: How package dependencies are resolved at deployment time. Defaults + to ``bundled``, where the caller bundles all dependencies into the uploaded zip and the service + performs no remote build. ``remote_build`` instructs the service to build dependencies remotely + from the manifest included in the uploaded zip. Required. Known values are: "bundled" and + "remote_build". + :vartype dependency_resolution: str or ~azure.ai.projects.models.CodeDependencyResolution + :ivar content_hash: The SHA-256 hex digest of the uploaded code zip. Set by the service from + the ``x-ms-code-zip-sha256`` request header; read-only in responses and never accepted in + request payloads. + :vartype content_hash: str + """ + + runtime: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The runtime identifier for code execution (e.g., 'python_3_11', 'python_3_12', 'python_3_13'). + Required.""" + entry_point: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The entry point command and arguments for the code execution. Required.""" + dependency_resolution: Union[str, "_models.CodeDependencyResolution"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """How package dependencies are resolved at deployment time. Defaults to ``bundled``, where the + caller bundles all dependencies into the uploaded zip and the service performs no remote build. + ``remote_build`` instructs the service to build dependencies remotely from the manifest + included in the uploaded zip. Required. Known values are: \"bundled\" and \"remote_build\".""" + content_hash: Optional[str] = rest_field(visibility=["read"]) + """The SHA-256 hex digest of the uploaded code zip. Set by the service from the + ``x-ms-code-zip-sha256`` request header; read-only in responses and never accepted in request + payloads.""" + + @overload def __init__( self, + *, + runtime: str, + entry_point: list[str], + dependency_resolution: Union[str, "_models.CodeDependencyResolution"], ) -> None: ... @overload @@ -3990,34 +4129,63 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ContainerNetworkPolicyParamType.DISABLED # type: ignore -class ContainerNetworkPolicyDomainSecretParam(_Model): - """ContainerNetworkPolicyDomainSecretParam. +class CodeInterpreterTool( + Tool, discriminator="code_interpreter" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Code interpreter. - :ivar domain: The domain associated with the secret. Required. - :vartype domain: str - :ivar name: The name of the secret to inject for the domain. Required. + :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 value: The secret value to inject for the domain. Required. - :vartype value: 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 """ - domain: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The domain associated with the secret. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the secret to inject for the domain. Required.""" - value: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The secret value to inject for the domain. 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"] + ) + 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, *, - domain: str, - name: str, - value: str, + 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 @@ -4029,27 +4197,55 @@ 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 ContainerSkill(_Model): - """ContainerSkill. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - InlineSkillParam, SkillReferenceParam +class CodeInterpreterToolboxTool( + ToolboxTool, discriminator="code_interpreter" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A code interpreter tool stored in a toolbox. - :ivar type: Required. Known values are: "skill_reference" and "inline". - :vartype type: str or ~azure.ai.projects.models.ContainerSkillType + :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. 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 """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"skill_reference\" and \"inline\".""" + type: Literal[ToolboxToolType.CODE_INTERPRETER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """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.""" @overload def __init__( self, *, - type: str, + 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, + container: Optional[Union[str, "_models.AutoCodeInterpreterToolParam"]] = None, ) -> None: ... @overload @@ -4061,29 +4257,63 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolboxToolType.CODE_INTERPRETER # type: ignore -class EvaluationRuleAction(_Model): - """Evaluation action model. +class ComparisonFilter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Comparison Filter. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ContinuousEvaluationRuleAction, HumanEvaluationPreviewRuleAction + :ivar type: Specifies the comparison operator: ``eq``, ``ne``, ``gt``, ``gte``, ``lt``, + ``lte``, ``in``, ``nin``. - :ivar type: Type of the evaluation action. Required. Known values are: "continuousEvaluation" - and "humanEvaluationPreview". - :vartype type: str or ~azure.ai.projects.models.EvaluationRuleActionType + * `eq`: equals + * `ne`: not equal + * `gt`: greater than + * `gte`: greater than or equal + * `lt`: less than + * `lte`: less than or equal + * `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 + :ivar value: The value to compare against the attribute key; supports string, number, or + boolean types. Required. Is one of the following types: str, float, bool, [Union[str, float]] + :vartype value: str or float or bool or list[str or float] """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Type of the evaluation action. Required. Known values are: \"continuousEvaluation\" and - \"humanEvaluationPreview\".""" + type: Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the comparison operator: ``eq``, ``ne``, ``gt``, ``gte``, ``lt``, ``lte``, ``in``, + ``nin``. + + * `eq`: equals + * `ne`: not equal + * `gt`: greater than + * `gte`: greater than or equal + * `lt`: less than + * `lte`: less than or equal + * `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\"]""" + key: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The key to compare against the value. Required.""" + value: Union[str, float, bool, list[Union[str, float]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The value to compare against the attribute key; supports string, number, or boolean types. + Required. Is one of the following types: str, float, bool, [Union[str, float]]""" @overload def __init__( self, *, - type: str, + type: Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"], + key: str, + value: Union[str, float, bool, list[Union[str, float]]], ) -> None: ... @overload @@ -4097,43 +4327,31 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ContinuousEvaluationRuleAction(EvaluationRuleAction, discriminator="continuousEvaluation"): - """Evaluation rule action for continuous evaluation. +class CompoundFilter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Compound Filter. - :ivar type: Required. Continuous evaluation. - :vartype type: str or ~azure.ai.projects.models.CONTINUOUS_EVALUATION - :ivar eval_id: Eval Id to add continuous evaluation runs to. Required. - :vartype eval_id: str - :ivar max_hourly_runs: Maximum number of evaluation runs allowed per hour. - :vartype max_hourly_runs: int - :ivar sampling_rate: Percentage (0-100] chance that a matching event triggers an evaluation. - When omitted, the service-default is to evaluate every event, which is equivalent to setting a - sampling rate of 100. - :vartype sampling_rate: float + :ivar type: Type of operation: ``and`` or ``or``. Required. Is either a Literal["and"] type or + a Literal["or"] type. + :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] """ - type: Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Continuous evaluation.""" - eval_id: str = rest_field(name="evalId", visibility=["read", "create", "update", "delete", "query"]) - """Eval Id to add continuous evaluation runs to. Required.""" - max_hourly_runs: Optional[int] = rest_field( - name="maxHourlyRuns", visibility=["read", "create", "update", "delete", "query"] - ) - """Maximum number of evaluation runs allowed per hour.""" - sampling_rate: Optional[float] = rest_field( - name="samplingRate", visibility=["read", "create", "update", "delete", "query"] + 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( + visibility=["read", "create", "update", "delete", "query"] ) - """Percentage (0-100] chance that a matching event triggers an evaluation. When omitted, the - service-default is to evaluate every event, which is equivalent to setting a sampling rate of - 100.""" + """Array of filters to combine. Items can be ``ComparisonFilter`` or ``CompoundFilter``. Required.""" @overload def __init__( self, *, - eval_id: str, - max_hourly_runs: Optional[int] = None, - sampling_rate: Optional[float] = None, + type: Literal["and", "or"], + filters: list[Union["_models.ComparisonFilter", Any]], ) -> None: ... @overload @@ -4145,62 +4363,21 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = EvaluationRuleActionType.CONTINUOUS_EVALUATION # type: ignore -class CosmosDBIndex(Index, discriminator="CosmosDBNoSqlVectorStore"): - """CosmosDB Vector Store Index Definition. +class ComputerTool(Tool, discriminator="computer"): + """Computer. - :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. CosmosDB. - :vartype type: str or ~azure.ai.projects.models.COSMOS_DB - :ivar connection_name: Name of connection to CosmosDB. Required. - :vartype connection_name: str - :ivar database_name: Name of the CosmosDB Database. Required. - :vartype database_name: str - :ivar container_name: Name of CosmosDB Container. Required. - :vartype container_name: str - :ivar embedding_configuration: Embedding model configuration. Required. - :vartype embedding_configuration: ~azure.ai.projects.models.EmbeddingConfiguration - :ivar field_mapping: Field mapping configuration. Required. - :vartype field_mapping: ~azure.ai.projects.models.FieldMapping + :ivar type: The type of the computer tool. Always ``computer``. Required. COMPUTER. + :vartype type: str or ~azure.ai.projects.models.COMPUTER """ - type: Literal[IndexType.COSMOS_DB] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Type of index. Required. CosmosDB.""" - connection_name: str = rest_field(name="connectionName", visibility=["create"]) - """Name of connection to CosmosDB. Required.""" - database_name: str = rest_field(name="databaseName", visibility=["create"]) - """Name of the CosmosDB Database. Required.""" - container_name: str = rest_field(name="containerName", visibility=["create"]) - """Name of CosmosDB Container. Required.""" - embedding_configuration: "_models.EmbeddingConfiguration" = rest_field( - name="embeddingConfiguration", visibility=["create"] - ) - """Embedding model configuration. Required.""" - field_mapping: "_models.FieldMapping" = rest_field(name="fieldMapping", visibility=["create"]) - """Field mapping configuration. Required.""" + 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, - *, - connection_name: str, - database_name: str, - container_name: str, - embedding_configuration: "_models.EmbeddingConfiguration", - field_mapping: "_models.FieldMapping", - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -4212,32 +4389,46 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = IndexType.COSMOS_DB # type: ignore + self.type = ToolType.COMPUTER # type: ignore -class CreateAsyncResponse(_Model): - """CreateAsyncResponse. +class ComputerUsePreviewTool( + Tool, discriminator="computer_use_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Computer use preview. - :ivar location: URL to poll for operation status. - :vartype location: str - :ivar operation_result: URL to the operation result, or null if the operation is still in - progress. - :vartype operation_result: str + :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 """ - location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """URL to poll for operation status.""" - operation_result: Optional[str] = rest_field( - name="operationResult", visibility=["read", "create", "update", "delete", "query"] + 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"] ) - """URL to the operation result, or null if the operation is still in progress.""" + """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, *, - location: Optional[str] = None, - operation_result: Optional[str] = None, + environment: Union[str, "_models.ComputerEnvironment"], + display_width: int, + display_height: int, ) -> None: ... @overload @@ -4249,61 +4440,63 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.COMPUTER_USE_PREVIEW # type: ignore -class CreateSkillVersionFromFilesBody(_Model): - """Multipart request body for creating a skill version from files. Accepts either a single zip - file or multiple individual skill files (directory upload). For zip uploads, the server - extracts and validates contents. For directory uploads, files are validated as-is. +class Connection(_Model): + """Response from the list and get connections operations. - :ivar files: Skill files to upload. Upload a single zip file or multiple individual files with - relative paths. Required. - :vartype files: list[~azure.ai.projects._utils.utils.FileType] - :ivar default: Whether to set this version as the default. Defaults to false. - :vartype default: bool + :ivar name: The friendly name of the connection, provided by the user. Required. + :vartype name: str + :ivar id: A unique identifier for the connection, generated by the service. Required. + :vartype id: str + :ivar type: Category of the connection. Required. Known values are: "AzureOpenAI", "AzureBlob", + "AzureStorageAccount", "CognitiveSearch", "CosmosDB", "ApiKey", "AppConfig", "AppInsights", + "CustomKeys", and "RemoteTool_Preview". + :vartype type: str or ~azure.ai.projects.models.ConnectionType + :ivar target: The connection URL to be used for this service. Required. + :vartype target: str + :ivar is_default: Whether the connection is tagged as the default connection of its type. + Required. + :vartype is_default: bool + :ivar credentials: The credentials used by the connection. Required. + :vartype credentials: ~azure.ai.projects.models.BaseCredentials + :ivar metadata: Metadata of the connection. Required. + :vartype metadata: dict[str, str] """ - files: list[FileType] = rest_field( - visibility=["read", "create", "update", "delete", "query"], is_multipart_file_input=True - ) - """Skill files to upload. Upload a single zip file or multiple individual files with relative - paths. Required.""" - default: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether to set this version as the default. Defaults to false.""" - - @overload - def __init__( - self, - *, - files: list[FileType], - default: 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) + name: str = rest_field(visibility=["read"]) + """The friendly name of the connection, provided by the user. Required.""" + id: str = rest_field(visibility=["read"]) + """A unique identifier for the connection, generated by the service. Required.""" + type: Union[str, "_models.ConnectionType"] = rest_field(visibility=["read"]) + """Category of the connection. Required. Known values are: \"AzureOpenAI\", \"AzureBlob\", + \"AzureStorageAccount\", \"CognitiveSearch\", \"CosmosDB\", \"ApiKey\", \"AppConfig\", + \"AppInsights\", \"CustomKeys\", and \"RemoteTool_Preview\".""" + target: str = rest_field(visibility=["read"]) + """The connection URL to be used for this service. Required.""" + is_default: bool = rest_field(name="isDefault", visibility=["read"]) + """Whether the connection is tagged as the default connection of its type. Required.""" + credentials: "_models.BaseCredentials" = rest_field(visibility=["read"]) + """The credentials used by the connection. Required.""" + metadata: dict[str, str] = rest_field(visibility=["read"]) + """Metadata of the connection. Required.""" -class Trigger(_Model): - """Base model for Trigger of the schedule. +class FunctionShellToolParamEnvironment(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """FunctionShellToolParamEnvironment. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - CronTrigger, OneTimeTrigger, RecurrenceTrigger + ContainerAutoParam, FunctionShellToolParamEnvironmentContainerReferenceParam, + FunctionShellToolParamEnvironmentLocalEnvironmentParam - :ivar type: Type of the trigger. Required. Known values are: "Cron", "Recurrence", and - "OneTime". - :vartype type: str or ~azure.ai.projects.models.TriggerType + :ivar type: Required. Known values are: "container_auto", "local", and "container_reference". + :vartype type: str or ~azure.ai.projects.models.FunctionShellToolParamEnvironmentType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Type of the trigger. Required. Known values are: \"Cron\", \"Recurrence\", and \"OneTime\".""" + """Required. Known values are: \"container_auto\", \"local\", and \"container_reference\".""" @overload def __init__( @@ -4323,44 +4516,47 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CronTrigger(Trigger, discriminator="Cron"): - """Cron based trigger. +class ContainerAutoParam( + FunctionShellToolParamEnvironment, discriminator="container_auto" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """ContainerAutoParam. - :ivar type: Required. Cron based trigger. - :vartype type: str or ~azure.ai.projects.models.CRON - :ivar expression: Cron expression that defines the schedule frequency. Required. - :vartype expression: str - :ivar time_zone: Time zone for the cron schedule. Defaults to ``UTC``. - :vartype time_zone: str - :ivar start_time: Start time for the cron schedule in ISO 8601 format. - :vartype start_time: ~datetime.datetime - :ivar end_time: End time for the cron schedule in ISO 8601 format. - :vartype end_time: ~datetime.datetime + :ivar type: Automatically creates a container for this request. Required. CONTAINER_AUTO. + :vartype type: str or ~azure.ai.projects.models.CONTAINER_AUTO + :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: + :vartype network_policy: ~azure.ai.projects.models.ContainerNetworkPolicyParam """ - type: Literal[TriggerType.CRON] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Cron based trigger.""" - expression: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Cron expression that defines the schedule frequency. Required.""" - time_zone: Optional[str] = rest_field(name="timeZone", visibility=["read", "create", "update", "delete", "query"]) - """Time zone for the cron schedule. Defaults to ``UTC``.""" - start_time: Optional[datetime.datetime] = rest_field( - name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Automatically creates a container for this request. Required. 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"] ) - """Start time for the cron schedule in ISO 8601 format.""" - end_time: Optional[datetime.datetime] = rest_field( - name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + """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.ContainerNetworkPolicyParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """End time for the cron schedule in ISO 8601 format.""" @overload def __init__( self, *, - expression: str, - time_zone: Optional[str] = None, - start_time: Optional[datetime.datetime] = None, - end_time: Optional[datetime.datetime] = 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.ContainerNetworkPolicyParam"] = None, ) -> None: ... @overload @@ -4372,22 +4568,24 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = TriggerType.CRON # type: ignore + self.type = FunctionShellToolParamEnvironmentType.CONTAINER_AUTO # type: ignore -class CustomCredential(BaseCredentials, discriminator="CustomKeys"): - """Custom credential definition. +class ContainerConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Container-based deployment configuration for a hosted agent. - :ivar type: The credential type. Required. Custom credential. - :vartype type: str or ~azure.ai.projects.models.CUSTOM + :ivar image: The container image for the hosted agent. Required. + :vartype image: str """ - type: Literal[CredentialType.CUSTOM] = rest_discriminator(name="type", visibility=["read"]) # type: ignore - """The credential type. Required. Custom credential.""" + image: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The container image for the hosted agent. Required.""" @overload def __init__( self, + *, + image: str, ) -> None: ... @overload @@ -4399,22 +4597,21 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = CredentialType.CUSTOM # type: ignore -class CustomToolParamFormat(_Model): - """The input format for the custom tool. Default is unconstrained text. +class ContainerNetworkPolicyParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Network access policy for the container. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - CustomGrammarFormatParam, CustomTextFormatParam + ContainerNetworkPolicyAllowlistParam, ContainerNetworkPolicyDisabledParam - :ivar type: Required. Known values are: "text" and "grammar". - :vartype type: str or ~azure.ai.projects.models.CustomToolParamFormatType + :ivar type: Required. Known values are: "disabled" and "allowlist". + :vartype type: str or ~azure.ai.projects.models.ContainerNetworkPolicyParamType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"text\" and \"grammar\".""" + """Required. Known values are: \"disabled\" and \"allowlist\".""" @overload def __init__( @@ -4434,34 +4631,37 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CustomGrammarFormatParam(CustomToolParamFormat, discriminator="grammar"): - """Grammar format. +class ContainerNetworkPolicyAllowlistParam( + ContainerNetworkPolicyParam, discriminator="allowlist" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """ContainerNetworkPolicyAllowlistParam. - :ivar type: Grammar format. Always ``grammar``. Required. GRAMMAR. - :vartype type: str or ~azure.ai.projects.models.GRAMMAR - :ivar syntax: The syntax of the grammar definition. One of ``lark`` or ``regex``. Required. - Known values are: "lark" and "regex". - :vartype syntax: str or ~azure.ai.projects.models.GrammarSyntax1 - :ivar definition: The grammar definition. Required. - :vartype definition: str + :ivar type: Allow outbound network access only to specified domains. Always ``allowlist``. + Required. ALLOWLIST. + :vartype type: str or ~azure.ai.projects.models.ALLOWLIST + :ivar allowed_domains: A list of allowed domains when type is ``allowlist``. Required. + :vartype allowed_domains: list[str] + :ivar domain_secrets: Optional domain-scoped secrets for allowlisted domains. + :vartype domain_secrets: + list[~azure.ai.projects.models.ContainerNetworkPolicyDomainSecretParam] """ - type: Literal[CustomToolParamFormatType.GRAMMAR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Grammar format. Always ``grammar``. Required. GRAMMAR.""" - syntax: Union[str, "_models.GrammarSyntax1"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The syntax of the grammar definition. One of ``lark`` or ``regex``. Required. Known values are: - \"lark\" and \"regex\".""" - definition: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The grammar definition. Required.""" + type: Literal[ContainerNetworkPolicyParamType.ALLOWLIST] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Allow outbound network access only to specified domains. Always ``allowlist``. Required. + ALLOWLIST.""" + allowed_domains: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A list of allowed domains when type is ``allowlist``. Required.""" + domain_secrets: Optional[list["_models.ContainerNetworkPolicyDomainSecretParam"]] = rest_field( + visibility=["create"] + ) + """Optional domain-scoped secrets for allowlisted domains.""" @overload def __init__( self, *, - syntax: Union[str, "_models.GrammarSyntax1"], - definition: str, + allowed_domains: list[str], + domain_secrets: Optional[list["_models.ContainerNetworkPolicyDomainSecretParam"]] = None, ) -> None: ... @overload @@ -4473,30 +4673,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = CustomToolParamFormatType.GRAMMAR # type: ignore - + self.type = ContainerNetworkPolicyParamType.ALLOWLIST # type: ignore -class RoutineTrigger(_Model): - """Base model for a routine trigger. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - CustomRoutineTrigger, GitHubIssueRoutineTrigger, ScheduleRoutineTrigger, TimerRoutineTrigger +class ContainerNetworkPolicyDisabledParam(ContainerNetworkPolicyParam, discriminator="disabled"): + """ContainerNetworkPolicyDisabledParam. - :ivar type: The trigger type. Required. Known values are: "custom", "github_issue", "schedule", - and "timer". - :vartype type: str or ~azure.ai.projects.models.RoutineTriggerType + :ivar type: Disable outbound network access. Always ``disabled``. Required. DISABLED. + :vartype type: str or ~azure.ai.projects.models.DISABLED """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The trigger type. Required. Known values are: \"custom\", \"github_issue\", \"schedule\", and - \"timer\".""" + type: Literal[ContainerNetworkPolicyParamType.DISABLED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Disable outbound network access. Always ``disabled``. Required. DISABLED.""" @overload def __init__( self, - *, - type: str, ) -> None: ... @overload @@ -4508,37 +4700,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ContainerNetworkPolicyParamType.DISABLED # type: ignore -class CustomRoutineTrigger(RoutineTrigger, discriminator="custom"): - """A custom event routine trigger. +class ContainerNetworkPolicyDomainSecretParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ContainerNetworkPolicyDomainSecretParam. - :ivar type: The trigger type. Required. A custom event trigger. - :vartype type: str or ~azure.ai.projects.models.CUSTOM - :ivar provider: The external provider that emits the custom event. Required. - :vartype provider: str - :ivar event_name: The provider-specific event name that fires the routine. - :vartype event_name: str - :ivar parameters: Provider-specific trigger parameters. Required. - :vartype parameters: dict[str, any] + :ivar domain: The domain associated with the secret. Required. + :vartype domain: str + :ivar name: The name of the secret to inject for the domain. Required. + :vartype name: str + :ivar value: The secret value to inject for the domain. Required. + :vartype value: str """ - type: Literal[RoutineTriggerType.CUSTOM] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The trigger type. Required. A custom event trigger.""" - provider: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The external provider that emits the custom event. Required.""" - event_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The provider-specific event name that fires the routine.""" - parameters: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Provider-specific trigger parameters. Required.""" + domain: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The domain associated with the secret. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the secret to inject for the domain. Required.""" + value: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The secret value to inject for the domain. Required.""" @overload def __init__( self, *, - provider: str, - parameters: dict[str, Any], - event_name: Optional[str] = None, + domain: str, + name: str, + value: str, ) -> None: ... @overload @@ -4550,22 +4739,27 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RoutineTriggerType.CUSTOM # type: ignore -class CustomTextFormatParam(CustomToolParamFormat, discriminator="text"): - """Text format. +class ContainerSkill(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ContainerSkill. - :ivar type: Unconstrained text format. Always ``text``. Required. TEXT. - :vartype type: str or ~azure.ai.projects.models.TEXT + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + InlineSkillParam, SkillReferenceParam + + :ivar type: Required. Known values are: "skill_reference" and "inline". + :vartype type: str or ~azure.ai.projects.models.ContainerSkillType """ - type: Literal[CustomToolParamFormatType.TEXT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Unconstrained text format. Always ``text``. Required. TEXT.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"skill_reference\" and \"inline\".""" @overload def __init__( self, + *, + type: str, ) -> None: ... @overload @@ -4577,45 +4771,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = CustomToolParamFormatType.TEXT # type: ignore -class CustomToolParam(Tool, discriminator="custom"): - """Custom tool. +class EvaluationRuleAction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Evaluation action model. - :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 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 + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ContinuousEvaluationRuleAction, HumanEvaluationPreviewRuleAction + + :ivar type: Type of the evaluation action. Required. Known values are: "continuousEvaluation" + and "humanEvaluationPreview". + :vartype type: str or ~azure.ai.projects.models.EvaluationRuleActionType """ - 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.""" - 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.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Type of the evaluation action. Required. Known values are: \"continuousEvaluation\" and + \"humanEvaluationPreview\".""" @overload def __init__( self, *, - name: str, - description: Optional[str] = None, - format: Optional["_models.CustomToolParamFormat"] = None, - defer_loading: Optional[bool] = None, + type: str, ) -> None: ... @overload @@ -4627,31 +4805,47 @@ 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 -class RecurrenceSchedule(_Model): - """Recurrence schedule model. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - DailyRecurrenceSchedule, HourlyRecurrenceSchedule, MonthlyRecurrenceSchedule, - WeeklyRecurrenceSchedule +class ContinuousEvaluationRuleAction( + EvaluationRuleAction, discriminator="continuousEvaluation" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Evaluation rule action for continuous evaluation. - :ivar type: Recurrence type for the recurrence schedule. Required. Known values are: "Hourly", - "Daily", "Weekly", and "Monthly". - :vartype type: str or ~azure.ai.projects.models.RecurrenceType + :ivar type: Required. Continuous evaluation. + :vartype type: str or ~azure.ai.projects.models.CONTINUOUS_EVALUATION + :ivar eval_id: Eval Id to add continuous evaluation runs to. Required. + :vartype eval_id: str + :ivar max_hourly_runs: Maximum number of evaluation runs allowed per hour. + :vartype max_hourly_runs: int + :ivar sampling_rate: Percentage (0-100] chance that a matching event triggers an evaluation. + When omitted, the service-default is to evaluate every event, which is equivalent to setting a + sampling rate of 100. + :vartype sampling_rate: float """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Recurrence type for the recurrence schedule. Required. Known values are: \"Hourly\", \"Daily\", - \"Weekly\", and \"Monthly\".""" + type: Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Continuous evaluation.""" + eval_id: str = rest_field(name="evalId", visibility=["read", "create", "update", "delete", "query"]) + """Eval Id to add continuous evaluation runs to. Required.""" + max_hourly_runs: Optional[int] = rest_field( + name="maxHourlyRuns", visibility=["read", "create", "update", "delete", "query"] + ) + """Maximum number of evaluation runs allowed per hour.""" + sampling_rate: Optional[float] = rest_field( + name="samplingRate", visibility=["read", "create", "update", "delete", "query"] + ) + """Percentage (0-100] chance that a matching event triggers an evaluation. When omitted, the + service-default is to evaluate every event, which is equivalent to setting a sampling rate of + 100.""" @overload def __init__( self, *, - type: str, + eval_id: str, + max_hourly_runs: Optional[int] = None, + sampling_rate: Optional[float] = None, ) -> None: ... @overload @@ -4663,27 +4857,64 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = EvaluationRuleActionType.CONTINUOUS_EVALUATION # type: ignore -class DailyRecurrenceSchedule(RecurrenceSchedule, discriminator="Daily"): - """Daily recurrence schedule. +class CosmosDBIndex( + Index, discriminator="CosmosDBNoSqlVectorStore" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """CosmosDB Vector Store Index Definition. - :ivar type: Daily recurrence type. Required. Daily recurrence pattern. - :vartype type: str or ~azure.ai.projects.models.DAILY - :ivar hours: Hours for the recurrence schedule. Required. - :vartype hours: list[int] + :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. CosmosDB. + :vartype type: str or ~azure.ai.projects.models.COSMOS_DB + :ivar connection_name: Name of connection to CosmosDB. Required. + :vartype connection_name: str + :ivar database_name: Name of the CosmosDB Database. Required. + :vartype database_name: str + :ivar container_name: Name of CosmosDB Container. Required. + :vartype container_name: str + :ivar embedding_configuration: Embedding model configuration. Required. + :vartype embedding_configuration: ~azure.ai.projects.models.EmbeddingConfiguration + :ivar field_mapping: Field mapping configuration. Required. + :vartype field_mapping: ~azure.ai.projects.models.FieldMapping """ - type: Literal[RecurrenceType.DAILY] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Daily recurrence type. Required. Daily recurrence pattern.""" - hours: list[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Hours for the recurrence schedule. Required.""" + type: Literal[IndexType.COSMOS_DB] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Type of index. Required. CosmosDB.""" + connection_name: str = rest_field(name="connectionName", visibility=["create"]) + """Name of connection to CosmosDB. Required.""" + database_name: str = rest_field(name="databaseName", visibility=["create"]) + """Name of the CosmosDB Database. Required.""" + container_name: str = rest_field(name="containerName", visibility=["create"]) + """Name of CosmosDB Container. Required.""" + embedding_configuration: "_models.EmbeddingConfiguration" = rest_field( + name="embeddingConfiguration", visibility=["create"] + ) + """Embedding model configuration. Required.""" + field_mapping: "_models.FieldMapping" = rest_field(name="fieldMapping", visibility=["create"]) + """Field mapping configuration. Required.""" @overload def __init__( self, *, - hours: list[int], + connection_name: str, + database_name: str, + container_name: str, + embedding_configuration: "_models.EmbeddingConfiguration", + field_mapping: "_models.FieldMapping", + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -4695,56 +4926,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RecurrenceType.DAILY # type: ignore + self.type = IndexType.COSMOS_DB # type: ignore -class DataGenerationJob(_Model): - """Data Generation Job resource. +class CreateAsyncResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """CreateAsyncResponse. - :ivar id: Server-assigned unique identifier. Required. - :vartype id: str - :ivar inputs: Caller-supplied inputs. - :vartype inputs: ~azure.ai.projects.models.DataGenerationJobInputs - :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 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 location: URL to poll for operation status. + :vartype location: str + :ivar operation_result: URL to the operation result, or null if the operation is still in + progress. + :vartype operation_result: str """ - id: str = rest_field(visibility=["read"]) - """Server-assigned unique identifier. Required.""" - inputs: Optional["_models.DataGenerationJobInputs"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """URL to poll for operation status.""" + operation_result: Optional[str] = rest_field( + name="operationResult", visibility=["read", "create", "update", "delete", "query"] ) - """Caller-supplied inputs.""" - result: Optional["_models.DataGenerationJobResult"] = rest_field(visibility=["read"]) - """Result produced on success.""" - status: Union[str, "_models.JobStatus"] = rest_field(visibility=["read"]) - """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", - \"succeeded\", \"failed\", and \"cancelled\".""" - error: Optional["_models.ApiError"] = rest_field(visibility=["read"]) - """Error details — populated only on failure.""" - created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") - """The timestamp when the job was created, represented in Unix time (seconds since January 1, - 1970). Required.""" - finished_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") - """The timestamp when the job was finished, represented in Unix time (seconds since January 1, - 1970).""" + """URL to the operation result, or null if the operation is still in progress.""" @overload def __init__( self, *, - inputs: Optional["_models.DataGenerationJobInputs"] = None, + location: Optional[str] = None, + operation_result: Optional[str] = None, ) -> None: ... @overload @@ -4758,53 +4965,32 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DataGenerationJobInputs(_Model): - """Caller-supplied inputs for a data generation job. +class CreateSkillVersionFromFilesBody(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Multipart request body for creating a skill version from files. Accepts either a single zip + file or multiple individual skill files (directory upload). For zip uploads, the server + extracts and validates contents. For directory uploads, files are validated as-is. - :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 options: The options for the data generation job. Required. - :vartype options: ~azure.ai.projects.models.DataGenerationJobOptions - :ivar scenario: The scenario of the data generation job. Either for fine-tuning or evaluation. - Required. Known values are: "supervised_finetuning", "reinforcement_finetuning", and - "evaluation". - :vartype scenario: str or ~azure.ai.projects.models.DataGenerationJobScenario - :ivar output_options: Optional caller-supplied metadata for the job's output. See individual - fields for whether they apply to file outputs (fine-tuning scenarios), dataset outputs - (evaluation scenario), or both. - :vartype output_options: ~azure.ai.projects.models.DataGenerationJobOutputOptions + :ivar files: Skill files to upload. Upload a single zip file or multiple individual files with + relative paths. Required. + :vartype files: list[~azure.ai.projects._utils.utils.FileType] + :ivar default: Whether to set this version as the default. Defaults to false. + :vartype default: bool """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The display name of the data generation job. Required.""" - sources: list["_models.DataGenerationJobSource"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The sources used for the data generation job. Required.""" - options: "_models.DataGenerationJobOptions" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The options for the data generation job. Required.""" - scenario: Union[str, "_models.DataGenerationJobScenario"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The scenario of the data generation job. Either for fine-tuning or evaluation. Required. Known - values are: \"supervised_finetuning\", \"reinforcement_finetuning\", and \"evaluation\".""" - output_options: Optional["_models.DataGenerationJobOutputOptions"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + files: list[FileType] = rest_field( + visibility=["read", "create", "update", "delete", "query"], is_multipart_file_input=True ) - """Optional caller-supplied metadata for the job's output. See individual fields for whether they - apply to file outputs (fine-tuning scenarios), dataset outputs (evaluation scenario), or both.""" + """Skill files to upload. Upload a single zip file or multiple individual files with relative + paths. Required.""" + default: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to set this version as the default. Defaults to false.""" @overload def __init__( self, *, - name: str, - sources: list["_models.DataGenerationJobSource"], - options: "_models.DataGenerationJobOptions", - scenario: Union[str, "_models.DataGenerationJobScenario"], - output_options: Optional["_models.DataGenerationJobOutputOptions"] = None, + files: list[FileType], + default: Optional[bool] = None, ) -> None: ... @overload @@ -4818,47 +5004,25 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DataGenerationJobOptions(_Model): - """Options for managing data generation jobs. +class CreateTranscriptionResponseJsonUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Token usage statistics for the request. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - SimpleQnADataGenerationJobOptions, TaskGenerationDataGenerationJobOptions, - ToolUseFineTuningDataGenerationJobOptions, TracesDataGenerationJobOptions + TranscriptTextUsageDuration, TranscriptTextUsageTokens - :ivar type: The data generation job type. Required. Known values are: "simple_qna", "traces", - "tool_use", and "task_generation". - :vartype type: str or ~azure.ai.projects.models.DataGenerationJobType - :ivar max_samples: Maximum number of samples to generate. Required. - :vartype max_samples: int - :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: Required. Known values are: "tokens" and "duration". + :vartype type: str or ~azure.ai.projects.models.CreateTranscriptionResponseJsonUsageType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The data generation job type. Required. Known values are: \"simple_qna\", \"traces\", - \"tool_use\", and \"task_generation\".""" - max_samples: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Maximum number of samples to generate. Required.""" - train_split: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """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.""" - model_options: Optional["_models.DataGenerationModelOptions"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The LLM model options.""" + """Required. Known values are: \"tokens\" and \"duration\".""" @overload def __init__( self, *, type: str, - max_samples: int, - train_split: Optional[float] = None, - model_options: Optional["_models.DataGenerationModelOptions"] = None, ) -> None: ... @overload @@ -4872,19 +5036,20 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DataGenerationJobOutput(_Model): - """Output information for a data generation job. +class Trigger(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Base model for Trigger of the schedule. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - DatasetDataGenerationJobOutput, FileDataGenerationJobOutput + CronTrigger, OneTimeTrigger, RecurrenceTrigger - :ivar type: The type of the output. Required. Known values are: "file" and "dataset". - :vartype type: str or ~azure.ai.projects.models.DataGenerationJobOutputType + :ivar type: Type of the trigger. Required. Known values are: "Cron", "Recurrence", and + "OneTime". + :vartype type: str or ~azure.ai.projects.models.TriggerType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of the output. Required. Known values are: \"file\" and \"dataset\".""" + """Type of the trigger. Required. Known values are: \"Cron\", \"Recurrence\", and \"OneTime\".""" @overload def __init__( @@ -4904,37 +5069,44 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DataGenerationJobOutputOptions(_Model): - """Output options for data generation job. +class CronTrigger(Trigger, discriminator="Cron"): # pylint: disable=docstring-keyword-should-match-keyword-only + """Cron based trigger. - :ivar name: Name to assign to the output. Used as the filename for Azure OpenAI file outputs - (fine-tuning scenarios) and as the dataset name for dataset outputs (evaluation scenario). - :vartype name: str - :ivar description: Description to assign to the output. Applies only to dataset outputs - (evaluation scenario); ignored for Azure OpenAI file outputs. - :vartype description: str - :ivar tags: Tags to assign to the output. Applies only to dataset outputs (evaluation - scenario); ignored for Azure OpenAI file outputs. - :vartype tags: dict[str, str] + :ivar type: Required. Cron based trigger. + :vartype type: str or ~azure.ai.projects.models.CRON + :ivar expression: Cron expression that defines the schedule frequency. Required. + :vartype expression: str + :ivar time_zone: Time zone for the cron schedule. Defaults to ``UTC``. + :vartype time_zone: str + :ivar start_time: Start time for the cron schedule in ISO 8601 format. + :vartype start_time: ~datetime.datetime + :ivar end_time: End time for the cron schedule in ISO 8601 format. + :vartype end_time: ~datetime.datetime """ - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name to assign to the output. Used as the filename for Azure OpenAI file outputs (fine-tuning - scenarios) and as the dataset name for dataset outputs (evaluation scenario).""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Description to assign to the output. Applies only to dataset outputs (evaluation scenario); - ignored for Azure OpenAI file outputs.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Tags to assign to the output. Applies only to dataset outputs (evaluation scenario); ignored - for Azure OpenAI file outputs.""" + type: Literal[TriggerType.CRON] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Cron based trigger.""" + expression: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Cron expression that defines the schedule frequency. Required.""" + time_zone: Optional[str] = rest_field(name="timeZone", visibility=["read", "create", "update", "delete", "query"]) + """Time zone for the cron schedule. Defaults to ``UTC``.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Start time for the cron 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 cron schedule in ISO 8601 format.""" @overload def __init__( self, *, - name: Optional[str] = None, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, + expression: str, + time_zone: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, ) -> None: ... @overload @@ -4946,38 +5118,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = TriggerType.CRON # type: ignore -class DataGenerationJobResult(_Model): - """Result produced by a successful data generation job. +class CustomCredential(BaseCredentials, discriminator="CustomKeys"): + """Custom credential definition. - :ivar outputs: The final job outputs: Azure OpenAI files for fine-tuning, or datasets for - evaluation. - :vartype outputs: list[~azure.ai.projects.models.DataGenerationJobOutput] - :ivar generated_samples: The number of samples actually generated. Required. - :vartype generated_samples: int - :ivar token_usage: The token usage information for the data generation job. - :vartype token_usage: ~azure.ai.projects.models.DataGenerationTokenUsage + :ivar type: The credential type. Required. Custom credential. + :vartype type: str or ~azure.ai.projects.models.CUSTOM """ - outputs: Optional[list["_models.DataGenerationJobOutput"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The final job outputs: Azure OpenAI files for fine-tuning, or datasets for evaluation.""" - generated_samples: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of samples actually generated. Required.""" - token_usage: Optional["_models.DataGenerationTokenUsage"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The token usage information for the data generation job.""" + type: Literal[CredentialType.CUSTOM] = rest_discriminator(name="type", visibility=["read"]) # type: ignore + """The credential type. Required. Custom credential.""" @overload def __init__( self, - *, - generated_samples: int, - outputs: Optional[list["_models.DataGenerationJobOutput"]] = None, - token_usage: Optional["_models.DataGenerationTokenUsage"] = None, ) -> None: ... @overload @@ -4989,23 +5145,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = CredentialType.CUSTOM # type: ignore -class DataGenerationModelOptions(_Model): - """LLM model options for data generation jobs. +class CustomToolParamFormat(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The input format for the custom tool. Default is unconstrained text. - :ivar model: Base model name used to generate data. Required. - :vartype model: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + CustomGrammarFormatParam, CustomTextFormatParam + + :ivar type: Required. Known values are: "text" and "grammar". + :vartype type: str or ~azure.ai.projects.models.CustomToolParamFormatType """ - model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Base model name used to generate data. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"text\" and \"grammar\".""" @overload def __init__( self, *, - model: str, + type: str, ) -> None: ... @overload @@ -5019,42 +5180,36 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DataGenerationTokenUsage(_Model): - """Token usage information for a data generation job. - - :ivar prompt_tokens: The number of prompt tokens used. Required. - :vartype prompt_tokens: int - :ivar completion_tokens: The number of completion tokens generated. Required. - :vartype completion_tokens: int - :ivar total_tokens: Total number of tokens used. Required. - :vartype total_tokens: int - """ - - prompt_tokens: int = rest_field(visibility=["read"]) - """The number of prompt tokens used. Required.""" - completion_tokens: int = rest_field(visibility=["read"]) - """The number of completion tokens generated. Required.""" - total_tokens: int = rest_field(visibility=["read"]) - """Total number of tokens used. Required.""" - - -class DatasetCredential(_Model): - """Represents a reference to a blob for consumption. +class CustomGrammarFormatParam( + CustomToolParamFormat, discriminator="grammar" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Grammar format. - :ivar blob_reference: Credential info to access the storage account. Required. - :vartype blob_reference: ~azure.ai.projects.models.BlobReference + :ivar type: Grammar format. Always ``grammar``. Required. GRAMMAR. + :vartype type: str or ~azure.ai.projects.models.GRAMMAR + :ivar syntax: The syntax of the grammar definition. One of ``lark`` or ``regex``. Required. + Known values are: "lark" and "regex". + :vartype syntax: str or ~azure.ai.projects.models.GrammarSyntax1 + :ivar definition: The grammar definition. Required. + :vartype definition: str """ - blob_reference: "_models.BlobReference" = rest_field( - name="blobReference", visibility=["read", "create", "update", "delete", "query"] + type: Literal[CustomToolParamFormatType.GRAMMAR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Grammar format. Always ``grammar``. Required. GRAMMAR.""" + syntax: Union[str, "_models.GrammarSyntax1"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Credential info to access the storage account. Required.""" + """The syntax of the grammar definition. One of ``lark`` or ``regex``. Required. Known values are: + \"lark\" and \"regex\".""" + definition: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The grammar definition. Required.""" @overload def __init__( self, *, - blob_reference: "_models.BlobReference", + syntax: Union[str, "_models.GrammarSyntax1"], + definition: str, ) -> None: ... @overload @@ -5066,41 +5221,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = CustomToolParamFormatType.GRAMMAR # type: ignore -class DatasetDataGenerationJobOutput(DataGenerationJobOutput, discriminator="dataset"): - """Dataset output for a data generation job. +class RoutineTrigger(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Base model for a routine trigger. - :ivar type: Dataset output. Required. The generated data is a Dataset. - :vartype type: str or ~azure.ai.projects.models.DATASET - :ivar id: The id of the output dataset created. - :vartype id: str - :ivar name: The name of the output dataset. - :vartype name: str - :ivar version: The version of the output dataset. - :vartype version: str - :ivar description: Description of the output dataset. - :vartype description: str - :ivar tags: Tag dictionary of the output dataset. - :vartype tags: dict[str, str] + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + CustomRoutineTrigger, GitHubIssueRoutineTrigger, ScheduleRoutineTrigger, TimerRoutineTrigger + + :ivar type: The trigger type. Required. Known values are: "custom", "github_issue", "schedule", + and "timer". + :vartype type: str or ~azure.ai.projects.models.RoutineTriggerType """ - type: Literal[DataGenerationJobOutputType.DATASET] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Dataset output. Required. The generated data is a Dataset.""" - id: Optional[str] = rest_field(visibility=["read"]) - """The id of the output dataset created.""" - name: Optional[str] = rest_field(visibility=["read"]) - """The name of the output dataset.""" - version: Optional[str] = rest_field(visibility=["read"]) - """The version of the output dataset.""" - description: Optional[str] = rest_field(visibility=["read"]) - """Description of the output dataset.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read"]) - """Tag dictionary of the output dataset.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The trigger type. Required. Known values are: \"custom\", \"github_issue\", \"schedule\", and + \"timer\".""" @overload def __init__( self, + *, + type: str, ) -> None: ... @overload @@ -5112,43 +5256,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DataGenerationJobOutputType.DATASET # type: ignore -class DatasetEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator="dataset"): - """Dataset source for evaluator generation jobs — reference to a dataset. +class CustomRoutineTrigger( + RoutineTrigger, discriminator="custom" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A custom event routine trigger. - :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 Dataset. Required. Dataset source — - reference to a dataset. - :vartype type: str or ~azure.ai.projects.models.DATASET - :ivar name: The name of the dataset. Required. - :vartype name: str - :ivar version: The version of the dataset. If not specified, the latest version is used. - :vartype version: str + :ivar type: The trigger type. Required. A custom event trigger. + :vartype type: str or ~azure.ai.projects.models.CUSTOM + :ivar provider: The external provider that emits the custom event. Required. + :vartype provider: str + :ivar event_name: The provider-specific event name that fires the routine. + :vartype event_name: str + :ivar parameters: Provider-specific trigger parameters. Required. + :vartype parameters: dict[str, any] """ - 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.DATASET] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The source type for this source, which is Dataset. Required. Dataset source — reference to a - dataset.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the dataset. Required.""" - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version of the dataset. If not specified, the latest version is used.""" + type: Literal[RoutineTriggerType.CUSTOM] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The trigger type. Required. A custom event trigger.""" + provider: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The external provider that emits the custom event. Required.""" + event_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The provider-specific event name that fires the routine.""" + parameters: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Provider-specific trigger parameters. Required.""" @overload def __init__( self, *, - name: str, - description: Optional[str] = None, - version: Optional[str] = None, + provider: str, + parameters: dict[str, Any], + event_name: Optional[str] = None, ) -> None: ... @overload @@ -5160,29 +5300,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = EvaluatorGenerationJobSourceType.DATASET # type: ignore + self.type = RoutineTriggerType.CUSTOM # type: ignore -class DatasetReference(_Model): - """Reference to a versioned Foundry Dataset. +class CustomTextFormatParam(CustomToolParamFormat, discriminator="text"): + """Text format. - :ivar name: Dataset name. Required. - :vartype name: str - :ivar version: Dataset version. Required. - :vartype version: str + :ivar type: Unconstrained text format. Always ``text``. Required. TEXT. + :vartype type: str or ~azure.ai.projects.models.TEXT """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Dataset name. Required.""" - version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Dataset version. Required.""" + type: Literal[CustomToolParamFormatType.TEXT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Unconstrained text format. Always ``text``. Required. TEXT.""" @overload def __init__( self, - *, - name: str, - version: str, ) -> None: ... @overload @@ -5194,69 +5327,51 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = CustomToolParamFormatType.TEXT # type: ignore -class DatasetVersion(_Model): - """DatasetVersion Definition. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - FileDatasetVersion, FolderDatasetVersion +class CustomToolParam(Tool, discriminator="custom"): # pylint: disable=docstring-keyword-should-match-keyword-only + """Custom tool. - :ivar data_uri: URI of the data (`example `_). - Required. - :vartype data_uri: str - :ivar type: Dataset type. Required. Known values are: "uri_file" and "uri_folder". - :vartype type: str or ~azure.ai.projects.models.DatasetType - :ivar is_reference: Indicates if the dataset holds a reference to the storage, or the dataset - manages storage itself. If true, the underlying data will not be deleted when the dataset - version is deleted. - :vartype is_reference: bool - :ivar connection_name: The Azure Storage Account connection name. Required if - startPendingUploadVersion was not called before creating the Dataset. - :vartype connection_name: str - :ivar id: Asset ID, a unique identifier for the asset. - :vartype id: str - :ivar name: The name of the resource. Required. + :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 version: The version of the resource. Required. - :vartype version: str - :ivar description: The asset description text. + :ivar description: Optional description of the custom tool, used to provide more context. :vartype description: str - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, 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] """ - __mapping__: dict[str, _Model] = {} - data_uri: str = rest_field(name="dataUri", visibility=["read", "create"]) - """URI of the data (`example `_). Required.""" - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Dataset type. Required. Known values are: \"uri_file\" and \"uri_folder\".""" - is_reference: Optional[bool] = rest_field(name="isReference", visibility=["read"]) - """Indicates if the dataset holds a reference to the storage, or the dataset manages storage - itself. If true, the underlying data will not be deleted when the dataset version is deleted.""" - connection_name: Optional[str] = rest_field(name="connectionName", visibility=["read", "create"]) - """The Azure Storage Account connection name. Required if startPendingUploadVersion was not called - before creating the Dataset.""" - 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=["create", "update"]) - """The asset description text.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["create", "update"]) - """Tag dictionary. Tags can be added, removed, and updated.""" + 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.""" + 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, *, - data_uri: str, - type: str, - connection_name: Optional[str] = None, + name: str, description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, + format: Optional["_models.CustomToolParamFormat"] = None, + defer_loading: Optional[bool] = None, + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, ) -> None: ... @overload @@ -5268,35 +5383,31 @@ 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 -class DeleteAgentResponse(_Model): - """A deleted agent Object. +class RecurrenceSchedule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Recurrence schedule model. - :ivar object: The object type. Always 'agent.deleted'. Required. AGENT_DELETED. - :vartype object: str or ~azure.ai.projects.models.AGENT_DELETED - :ivar name: The name of the agent. Required. - :vartype name: str - :ivar deleted: Whether the agent was successfully deleted. Required. - :vartype deleted: bool + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + DailyRecurrenceSchedule, HourlyRecurrenceSchedule, MonthlyRecurrenceSchedule, + WeeklyRecurrenceSchedule + + :ivar type: Recurrence type for the recurrence schedule. Required. Known values are: "Hourly", + "Daily", "Weekly", and "Monthly". + :vartype type: str or ~azure.ai.projects.models.RecurrenceType """ - object: Literal[AgentObjectType.AGENT_DELETED] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The object type. Always 'agent.deleted'. Required. AGENT_DELETED.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the agent. Required.""" - deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the agent was successfully deleted. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Recurrence type for the recurrence schedule. Required. Known values are: \"Hourly\", \"Daily\", + \"Weekly\", and \"Monthly\".""" @overload def __init__( self, *, - object: Literal[AgentObjectType.AGENT_DELETED], - name: str, - deleted: bool, + type: str, ) -> None: ... @overload @@ -5310,38 +5421,27 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DeleteAgentVersionResponse(_Model): - """A deleted agent version Object. +class DailyRecurrenceSchedule( + RecurrenceSchedule, discriminator="Daily" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Daily recurrence schedule. - :ivar object: The object type. Always 'agent.version.deleted'. Required. AGENT_VERSION_DELETED. - :vartype object: str or ~azure.ai.projects.models.AGENT_VERSION_DELETED - :ivar name: The name of the agent. Required. - :vartype name: str - :ivar version: The version identifier of the agent. Required. - :vartype version: str - :ivar deleted: Whether the agent was successfully deleted. Required. - :vartype deleted: bool + :ivar type: Daily recurrence type. Required. Daily recurrence pattern. + :vartype type: str or ~azure.ai.projects.models.DAILY + :ivar hours: Hours for the recurrence schedule. Required. + :vartype hours: list[int] """ - object: Literal[AgentObjectType.AGENT_VERSION_DELETED] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The object type. Always 'agent.version.deleted'. Required. AGENT_VERSION_DELETED.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the agent. Required.""" - version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version identifier of the agent. Required.""" - deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the agent was successfully deleted. Required.""" + type: Literal[RecurrenceType.DAILY] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Daily recurrence type. Required. Daily recurrence pattern.""" + hours: list[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Hours for the recurrence schedule. Required.""" @overload def __init__( self, *, - object: Literal[AgentObjectType.AGENT_VERSION_DELETED], - name: str, - version: str, - deleted: bool, + hours: list[int], ) -> None: ... @overload @@ -5353,35 +5453,56 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RecurrenceType.DAILY # type: ignore -class DeleteMemoryResult(_Model): - """Response for deleting a memory item from a memory store. +class DataGenerationJob(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Data Generation Job resource. - :ivar object: The object type. Always 'memory_store.item.deleted'. Required. MEMORY_DELETED. - :vartype object: str or ~azure.ai.projects.models.MEMORY_DELETED - :ivar memory_id: The unique ID of the deleted memory item. Required. - :vartype memory_id: str - :ivar deleted: Whether the memory item was successfully deleted. Required. - :vartype deleted: bool + :ivar id: Server-assigned unique identifier. Required. + :vartype id: str + :ivar inputs: Caller-supplied inputs. + :vartype inputs: ~azure.ai.projects.models.DataGenerationJobInputs + :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 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 """ - object: Literal[MemoryStoreObjectType.MEMORY_DELETED] = rest_field( + id: str = rest_field(visibility=["read"]) + """Server-assigned unique identifier. Required.""" + inputs: Optional["_models.DataGenerationJobInputs"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The object type. Always 'memory_store.item.deleted'. Required. MEMORY_DELETED.""" - memory_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the deleted memory item. Required.""" - deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the memory item was successfully deleted. Required.""" + """Caller-supplied inputs.""" + result: Optional["_models.DataGenerationJobResult"] = rest_field(visibility=["read"]) + """Result produced on success.""" + status: Union[str, "_models.JobStatus"] = rest_field(visibility=["read"]) + """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", + \"succeeded\", \"failed\", and \"cancelled\".""" + error: Optional["_models.ApiError"] = rest_field(visibility=["read"]) + """Error details — populated only on failure.""" + created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The timestamp when the job was created, represented in Unix time (seconds since January 1, + 1970). Required.""" + finished_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") + """The timestamp when the job was finished, represented in Unix time (seconds since January 1, + 1970).""" @overload def __init__( self, *, - object: Literal[MemoryStoreObjectType.MEMORY_DELETED], - memory_id: str, - deleted: bool, + inputs: Optional["_models.DataGenerationJobInputs"] = None, ) -> None: ... @overload @@ -5395,33 +5516,53 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DeleteMemoryStoreResult(_Model): - """DeleteMemoryStoreResult. +class DataGenerationJobInputs(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Caller-supplied inputs for a data generation job. - :ivar object: The object type. Always 'memory_store.deleted'. Required. MEMORY_STORE_DELETED. - :vartype object: str or ~azure.ai.projects.models.MEMORY_STORE_DELETED - :ivar name: The name of the memory store. Required. + :ivar name: The display name of the data generation job. Required. :vartype name: str - :ivar deleted: Whether the memory store was successfully deleted. Required. - :vartype deleted: bool + :ivar sources: The sources used for the data generation job. Required. + :vartype sources: list[~azure.ai.projects.models.DataGenerationJobSource] + :ivar options: The options for the data generation job. Required. + :vartype options: ~azure.ai.projects.models.DataGenerationJobOptions + :ivar scenario: The scenario of the data generation job. Either for fine-tuning or evaluation. + Required. Known values are: "supervised_finetuning", "reinforcement_finetuning", and + "evaluation". + :vartype scenario: str or ~azure.ai.projects.models.DataGenerationJobScenario + :ivar output_options: Optional caller-supplied metadata for the job's output. See individual + fields for whether they apply to file outputs (fine-tuning scenarios), dataset outputs + (evaluation scenario), or both. + :vartype output_options: ~azure.ai.projects.models.DataGenerationJobOutputOptions """ - object: Literal[MemoryStoreObjectType.MEMORY_STORE_DELETED] = rest_field( + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The display name of the data generation job. Required.""" + sources: list["_models.DataGenerationJobSource"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The object type. Always 'memory_store.deleted'. Required. MEMORY_STORE_DELETED.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the memory store. Required.""" - deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the memory store was successfully deleted. Required.""" + """The sources used for the data generation job. Required.""" + options: "_models.DataGenerationJobOptions" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The options for the data generation job. Required.""" + scenario: Union[str, "_models.DataGenerationJobScenario"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The scenario of the data generation job. Either for fine-tuning or evaluation. Required. Known + values are: \"supervised_finetuning\", \"reinforcement_finetuning\", and \"evaluation\".""" + output_options: Optional["_models.DataGenerationJobOutputOptions"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional caller-supplied metadata for the job's output. See individual fields for whether they + apply to file outputs (fine-tuning scenarios), dataset outputs (evaluation scenario), or both.""" @overload def __init__( self, *, - object: Literal[MemoryStoreObjectType.MEMORY_STORE_DELETED], name: str, - deleted: bool, + sources: list["_models.DataGenerationJobSource"], + options: "_models.DataGenerationJobOptions", + scenario: Union[str, "_models.DataGenerationJobScenario"], + output_options: Optional["_models.DataGenerationJobOutputOptions"] = None, ) -> None: ... @overload @@ -5435,74 +5576,47 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DeleteSkillResult(_Model): - """A deleted skill. - - :ivar id: The unique identifier of the deleted skill. Required. - :vartype id: str - :ivar name: The unique name of the skill. Required. - :vartype name: str - :ivar deleted: Whether the skill was successfully deleted. Required. - :vartype deleted: bool - """ - - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the deleted skill. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique name of the skill. Required.""" - deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the skill was successfully deleted. Required.""" - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - name: str, - deleted: 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 DataGenerationJobOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Options for managing data generation jobs. -class DeleteSkillVersionResult(_Model): - """A deleted skill version. + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + SimpleQnADataGenerationJobOptions, TaskGenerationDataGenerationJobOptions, + ToolUseFineTuningDataGenerationJobOptions, TracesDataGenerationJobOptions - :ivar id: The unique identifier of the deleted skill version. Required. - :vartype id: str - :ivar name: The name of the skill. Required. - :vartype name: str - :ivar deleted: Whether the skill version was successfully deleted. Required. - :vartype deleted: bool - :ivar version: The version that was deleted. Required. - :vartype version: str + :ivar type: The data generation job type. Required. Known values are: "simple_qna", "traces", + "tool_use", and "task_generation". + :vartype type: str or ~azure.ai.projects.models.DataGenerationJobType + :ivar max_samples: Maximum number of samples to generate. Required. + :vartype max_samples: int + :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 """ - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the deleted skill version. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the skill. Required.""" - deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the skill version was successfully deleted. Required.""" - version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version that was deleted. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The data generation job type. Required. Known values are: \"simple_qna\", \"traces\", + \"tool_use\", and \"task_generation\".""" + max_samples: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Maximum number of samples to generate. Required.""" + train_split: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """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.""" + model_options: Optional["_models.DataGenerationModelOptions"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The LLM model options.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - name: str, - deleted: bool, - version: str, + type: str, + max_samples: int, + train_split: Optional[float] = None, + model_options: Optional["_models.DataGenerationModelOptions"] = None, ) -> None: ... @overload @@ -5516,23 +5630,19 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Deployment(_Model): - """Model Deployment Definition. +class DataGenerationJobOutput(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Output information for a data generation job. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ModelDeployment + DatasetDataGenerationJobOutput, FileDataGenerationJobOutput - :ivar type: The type of the deployment. Required. "ModelDeployment" - :vartype type: str or ~azure.ai.projects.models.DeploymentType - :ivar name: Name of the deployment. Required. - :vartype name: str + :ivar type: The type of the output. Required. Known values are: "file" and "dataset". + :vartype type: str or ~azure.ai.projects.models.DataGenerationJobOutputType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of the deployment. Required. \"ModelDeployment\"""" - name: str = rest_field(visibility=["read"]) - """Name of the deployment. Required.""" + """The type of the output. Required. Known values are: \"file\" and \"dataset\".""" @overload def __init__( @@ -5552,54 +5662,37 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Dimension(_Model): - """A single dimension — one independent, measurable quality dimension within a rubric evaluator's - scoring blueprint. +class DataGenerationJobOutputOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Output options for data generation job. - :ivar id: Stable identifier for this dimension (snake_case, e.g., ``correct_resolution``). - Required. Provided by the user when manually creating a rubric evaluator or during - human-in-the-loop review of a generated set; the generation pipeline produces an initial value - the user can edit. Editable when saving new versions. Required. - :vartype id: str - :ivar description: What this dimension measures (e.g., 'Correctly identifies the user's - reservation intent and pursues the appropriate workflow'). Required. + :ivar name: Name to assign to the output. Used as the filename for Azure OpenAI file outputs + (fine-tuning scenarios) and as the dataset name for dataset outputs (evaluation scenario). + :vartype name: str + :ivar description: Description to assign to the output. Applies only to dataset outputs + (evaluation scenario); ignored for Azure OpenAI file outputs. :vartype description: str - :ivar weight: Relative weight of this dimension (1-10). The generation pipeline assigns exactly - one dimension weight 8-10; all others use 1-6. User edits are not constrained by this - heuristic. Required. - :vartype weight: int - :ivar always_applicable: When true, the LLM judge always scores this dimension regardless of - relevance (skips applicability assessment). The service-generated general quality/policy - dimension has this set to true and is non-editable. Users may set this on their own custom - dimensions. The service defaults to ``false`` if a value is not specified by the caller. - :vartype always_applicable: bool + :ivar tags: Tags to assign to the output. Applies only to dataset outputs (evaluation + scenario); ignored for Azure OpenAI file outputs. + :vartype tags: dict[str, str] """ - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Stable identifier for this dimension (snake_case, e.g., ``correct_resolution``). Required. - Provided by the user when manually creating a rubric evaluator or during human-in-the-loop - review of a generated set; the generation pipeline produces an initial value the user can edit. - Editable when saving new versions. Required.""" - description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """What this dimension measures (e.g., 'Correctly identifies the user's reservation intent and - pursues the appropriate workflow'). Required.""" - weight: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Relative weight of this dimension (1-10). The generation pipeline assigns exactly one dimension - weight 8-10; all others use 1-6. User edits are not constrained by this heuristic. Required.""" - always_applicable: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """When true, the LLM judge always scores this dimension regardless of relevance (skips - applicability assessment). The service-generated general quality/policy dimension has this set - to true and is non-editable. Users may set this on their own custom dimensions. The service - defaults to ``false`` if a value is not specified by the caller.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name to assign to the output. Used as the filename for Azure OpenAI file outputs (fine-tuning + scenarios) and as the dataset name for dataset outputs (evaluation scenario).""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Description to assign to the output. Applies only to dataset outputs (evaluation scenario); + ignored for Azure OpenAI file outputs.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Tags to assign to the output. Applies only to dataset outputs (evaluation scenario); ignored + for Azure OpenAI file outputs.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - description: str, - weight: int, - always_applicable: Optional[bool] = None, + name: Optional[str] = None, + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -5613,31 +5706,36 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DispatchRoutineResult(_Model): - """Identifiers returned after a routine dispatch is queued. +class DataGenerationJobResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Result produced by a successful data generation job. - :ivar dispatch_id: The dispatch identifier created for the routine dispatch. - :vartype dispatch_id: str - :ivar action_correlation_id: A downstream action correlation identifier, when available. - :vartype action_correlation_id: str - :ivar task_id: A workspace task identifier created for the dispatch, when available. - :vartype task_id: str + :ivar outputs: The final job outputs: Azure OpenAI files for fine-tuning, or datasets for + evaluation. + :vartype outputs: list[~azure.ai.projects.models.DataGenerationJobOutput] + :ivar generated_samples: The number of samples actually generated. Required. + :vartype generated_samples: int + :ivar token_usage: The token usage information for the data generation job. + :vartype token_usage: ~azure.ai.projects.models.DataGenerationTokenUsage """ - dispatch_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The dispatch identifier created for the routine dispatch.""" - action_correlation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A downstream action correlation identifier, when available.""" - task_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A workspace task identifier created for the dispatch, when available.""" + outputs: Optional[list["_models.DataGenerationJobOutput"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The final job outputs: Azure OpenAI files for fine-tuning, or datasets for evaluation.""" + generated_samples: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of samples actually generated. Required.""" + token_usage: Optional["_models.DataGenerationTokenUsage"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The token usage information for the data generation job.""" @overload def __init__( self, *, - dispatch_id: Optional[str] = None, - action_correlation_id: Optional[str] = None, - task_id: Optional[str] = None, + generated_samples: int, + outputs: Optional[list["_models.DataGenerationJobOutput"]] = None, + token_usage: Optional["_models.DataGenerationTokenUsage"] = None, ) -> None: ... @overload @@ -5651,28 +5749,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EmbeddingConfiguration(_Model): - """Embedding configuration class. +class DataGenerationModelOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LLM model options for data generation jobs. - :ivar model_deployment_name: Deployment name of embedding model. It can point to a model - deployment either in the parent AIServices or a connection. Required. - :vartype model_deployment_name: str - :ivar embedding_field: Embedding field. Required. - :vartype embedding_field: str + :ivar model: Base model name used to generate data. Required. + :vartype model: str """ - model_deployment_name: str = rest_field(name="modelDeploymentName", visibility=["create"]) - """Deployment name of embedding model. It can point to a model deployment either in the parent - AIServices or a connection. Required.""" - embedding_field: str = rest_field(name="embeddingField", visibility=["create"]) - """Embedding field. Required.""" + model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Base model name used to generate data. Required.""" @overload def __init__( self, *, - model_deployment_name: str, - embedding_field: str, + model: str, ) -> None: ... @overload @@ -5686,52 +5777,42 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EmptyModelParam(_Model): - """EmptyModelParam.""" +class DataGenerationTokenUsage(_Model): + """Token usage information for a data generation job. + + :ivar prompt_tokens: The number of prompt tokens used. Required. + :vartype prompt_tokens: int + :ivar completion_tokens: The number of completion tokens generated. Required. + :vartype completion_tokens: int + :ivar total_tokens: Total number of tokens used. Required. + :vartype total_tokens: int + """ + prompt_tokens: int = rest_field(visibility=["read"]) + """The number of prompt tokens used. Required.""" + completion_tokens: int = rest_field(visibility=["read"]) + """The number of completion tokens generated. Required.""" + total_tokens: int = rest_field(visibility=["read"]) + """Total number of tokens used. Required.""" -class EndpointBasedEvaluatorDefinition(EvaluatorDefinition, discriminator="endpoint"): - """Endpoint-based evaluator definition. The customer owns and hosts an HTTP endpoint that - implements the evaluation contract. The evaluator references a Project Connection by name; the - connection stores the endpoint URL and credentials (API Key or Entra ID). At execution time, - the service resolves the connection to obtain the endpoint URL and authentication details, then - calls the endpoint for each evaluation row. - :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. Endpoint-based evaluator definition. References a customer-owned HTTP - endpoint via a Project Connection. - :vartype type: str or ~azure.ai.projects.models.ENDPOINT - :ivar connection_name: Name of the Project Connection that stores the endpoint URL and - credentials. The connection must exist on the project and have a non-empty target URL. - Supported auth types: ApiKey (sends ``api-key`` header) and AAD/Entra ID (acquires a bearer - token via the project's Managed Identity). Required. - :vartype connection_name: str +class DatasetCredential(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents a reference to a blob for consumption. + + :ivar blob_reference: Credential info to access the storage account. Required. + :vartype blob_reference: ~azure.ai.projects.models.BlobReference """ - type: Literal[EvaluatorDefinitionType.ENDPOINT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Endpoint-based evaluator definition. References a customer-owned HTTP endpoint via a - Project Connection.""" - connection_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name of the Project Connection that stores the endpoint URL and credentials. The connection - must exist on the project and have a non-empty target URL. Supported auth types: ApiKey (sends - ``api-key`` header) and AAD/Entra ID (acquires a bearer token via the project's Managed - Identity). Required.""" + blob_reference: "_models.BlobReference" = rest_field( + name="blobReference", visibility=["read", "create", "update", "delete", "query"] + ) + """Credential info to access the storage account. Required.""" @overload def __init__( self, *, - connection_name: str, - init_parameters: Optional[dict[str, Any]] = None, - data_schema: Optional[dict[str, Any]] = None, - metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, + blob_reference: "_models.BlobReference", ) -> None: ... @overload @@ -5743,18 +5824,37 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = EvaluatorDefinitionType.ENDPOINT # type: ignore -class EntraAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="Entra"): - """EntraAuthorizationScheme. +class DatasetDataGenerationJobOutput(DataGenerationJobOutput, discriminator="dataset"): + """Dataset output for a data generation job. - :ivar type: Required. ENTRA. - :vartype type: str or ~azure.ai.projects.models.ENTRA + :ivar type: Dataset output. Required. The generated data is a Dataset. + :vartype type: str or ~azure.ai.projects.models.DATASET + :ivar id: The id of the output dataset created. + :vartype id: str + :ivar name: The name of the output dataset. + :vartype name: str + :ivar version: The version of the output dataset. + :vartype version: str + :ivar description: Description of the output dataset. + :vartype description: str + :ivar tags: Tag dictionary of the output dataset. + :vartype tags: dict[str, str] """ - type: Literal[AgentEndpointAuthorizationSchemeType.ENTRA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. ENTRA.""" + type: Literal[DataGenerationJobOutputType.DATASET] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Dataset output. Required. The generated data is a Dataset.""" + id: Optional[str] = rest_field(visibility=["read"]) + """The id of the output dataset created.""" + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the output dataset.""" + version: Optional[str] = rest_field(visibility=["read"]) + """The version of the output dataset.""" + description: Optional[str] = rest_field(visibility=["read"]) + """Description of the output dataset.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read"]) + """Tag dictionary of the output dataset.""" @overload def __init__( @@ -5770,22 +5870,45 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = AgentEndpointAuthorizationSchemeType.ENTRA # type: ignore + self.type = DataGenerationJobOutputType.DATASET # type: ignore -class EntraIDCredentials(BaseCredentials, discriminator="AAD"): - """Entra ID credential definition. +class DatasetEvaluatorGenerationJobSource( + EvaluatorGenerationJobSource, discriminator="dataset" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Dataset source for evaluator generation jobs — reference to a dataset. - :ivar type: The credential type. Required. Entra ID credential (formerly known as AAD). - :vartype type: str or ~azure.ai.projects.models.ENTRA_ID + :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 Dataset. Required. Dataset source — + reference to a dataset. + :vartype type: str or ~azure.ai.projects.models.DATASET + :ivar name: The name of the dataset. Required. + :vartype name: str + :ivar version: The version of the dataset. If not specified, the latest version is used. + :vartype version: str """ - type: Literal[CredentialType.ENTRA_ID] = rest_discriminator(name="type", visibility=["read"]) # type: ignore - """The credential type. Required. Entra ID credential (formerly known as AAD).""" + 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.DATASET] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The source type for this source, which is Dataset. Required. Dataset source — reference to a + dataset.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the dataset. Required.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version of the dataset. If not specified, the latest version is used.""" @overload def __init__( self, + *, + name: str, + description: Optional[str] = None, + version: Optional[str] = None, ) -> None: ... @overload @@ -5797,39 +5920,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = CredentialType.ENTRA_ID # type: ignore + self.type = EvaluatorGenerationJobSourceType.DATASET # type: ignore -class EvalResult(_Model): - """Result of the evaluation. +class DatasetReference(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Reference to a versioned Foundry Dataset. - :ivar name: name of the check. Required. + :ivar name: Dataset name. Required. :vartype name: str - :ivar type: type of the check. Required. - :vartype type: str - :ivar score: score. Required. - :vartype score: float - :ivar passed: indicates if the check passed or failed. Required. - :vartype passed: bool + :ivar version: Dataset version. Required. + :vartype version: str """ name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """name of the check. Required.""" - type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """type of the check. Required.""" - score: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """score. Required.""" - passed: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """indicates if the check passed or failed. Required.""" + """Dataset name. Required.""" + version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Dataset version. Required.""" @overload def __init__( self, *, name: str, - type: str, - score: float, - passed: bool, + version: str, ) -> None: ... @overload @@ -5843,49 +5956,67 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvalRunResultCompareItem(_Model): - """Metric comparison for a treatment against the baseline. +class DatasetVersion(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """DatasetVersion Definition. - :ivar treatment_run_id: The treatment run ID. Required. - :vartype treatment_run_id: str - :ivar treatment_run_summary: Summary statistics of the treatment run. Required. - :vartype treatment_run_summary: ~azure.ai.projects.models.EvalRunResultSummary - :ivar delta_estimate: Estimated difference between treatment and baseline. Required. - :vartype delta_estimate: float - :ivar p_value: P-value for the treatment effect. Required. - :vartype p_value: float - :ivar treatment_effect: Type of treatment effect. Required. Known values are: "TooFewSamples", - "Inconclusive", "Changed", "Improved", and "Degraded". - :vartype treatment_effect: str or ~azure.ai.projects.models.TreatmentEffectType + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + FileDatasetVersion, FolderDatasetVersion + + :ivar data_uri: URI of the data (`example `_). + Required. + :vartype data_uri: str + :ivar type: Dataset type. Required. Known values are: "uri_file" and "uri_folder". + :vartype type: str or ~azure.ai.projects.models.DatasetType + :ivar is_reference: Indicates if the dataset holds a reference to the storage, or the dataset + manages storage itself. If true, the underlying data will not be deleted when the dataset + version is deleted. + :vartype is_reference: bool + :ivar connection_name: The Azure Storage Account connection name. Required if + startPendingUploadVersion was not called before creating the Dataset. + :vartype connection_name: str + :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] """ - treatment_run_id: str = rest_field( - name="treatmentRunId", visibility=["read", "create", "update", "delete", "query"] - ) - """The treatment run ID. Required.""" - treatment_run_summary: "_models.EvalRunResultSummary" = rest_field( - name="treatmentRunSummary", visibility=["read", "create", "update", "delete", "query"] - ) - """Summary statistics of the treatment run. Required.""" - delta_estimate: float = rest_field(name="deltaEstimate", visibility=["read", "create", "update", "delete", "query"]) - """Estimated difference between treatment and baseline. Required.""" - p_value: float = rest_field(name="pValue", visibility=["read", "create", "update", "delete", "query"]) - """P-value for the treatment effect. Required.""" - treatment_effect: Union[str, "_models.TreatmentEffectType"] = rest_field( - name="treatmentEffect", visibility=["read", "create", "update", "delete", "query"] - ) - """Type of treatment effect. Required. Known values are: \"TooFewSamples\", \"Inconclusive\", - \"Changed\", \"Improved\", and \"Degraded\".""" + __mapping__: dict[str, _Model] = {} + data_uri: str = rest_field(name="dataUri", visibility=["read", "create"]) + """URI of the data (`example `_). Required.""" + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Dataset type. Required. Known values are: \"uri_file\" and \"uri_folder\".""" + is_reference: Optional[bool] = rest_field(name="isReference", visibility=["read"]) + """Indicates if the dataset holds a reference to the storage, or the dataset manages storage + itself. If true, the underlying data will not be deleted when the dataset version is deleted.""" + connection_name: Optional[str] = rest_field(name="connectionName", visibility=["read", "create"]) + """The Azure Storage Account connection name. Required if startPendingUploadVersion was not called + before creating the Dataset.""" + 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=["create", "update"]) + """The asset description text.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["create", "update"]) + """Tag dictionary. Tags can be added, removed, and updated.""" @overload def __init__( self, *, - treatment_run_id: str, - treatment_run_summary: "_models.EvalRunResultSummary", - delta_estimate: float, - p_value: float, - treatment_effect: Union[str, "_models.TreatmentEffectType"], + data_uri: str, + type: str, + connection_name: Optional[str] = None, + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -5899,47 +6030,33 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvalRunResultComparison(_Model): - """Comparison results for treatment runs against the baseline. +class DeleteAgentResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A deleted agent Object. - :ivar testing_criteria: Name of the testing criteria. Required. - :vartype testing_criteria: str - :ivar metric: Metric being evaluated. Required. - :vartype metric: str - :ivar evaluator: Name of the evaluator for this testing criteria. Required. - :vartype evaluator: str - :ivar baseline_run_summary: Summary statistics of the baseline run. Required. - :vartype baseline_run_summary: ~azure.ai.projects.models.EvalRunResultSummary - :ivar compare_items: List of comparison results for each treatment run. Required. - :vartype compare_items: list[~azure.ai.projects.models.EvalRunResultCompareItem] + :ivar object: The object type. Always 'agent.deleted'. Required. AGENT_DELETED. + :vartype object: str or ~azure.ai.projects.models.AGENT_DELETED + :ivar name: The name of the agent. Required. + :vartype name: str + :ivar deleted: Whether the agent was successfully deleted. Required. + :vartype deleted: bool """ - testing_criteria: str = rest_field( - name="testingCriteria", visibility=["read", "create", "update", "delete", "query"] - ) - """Name of the testing criteria. Required.""" - metric: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Metric being evaluated. Required.""" - evaluator: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name of the evaluator for this testing criteria. Required.""" - baseline_run_summary: "_models.EvalRunResultSummary" = rest_field( - name="baselineRunSummary", visibility=["read", "create", "update", "delete", "query"] - ) - """Summary statistics of the baseline run. Required.""" - compare_items: list["_models.EvalRunResultCompareItem"] = rest_field( - name="compareItems", visibility=["read", "create", "update", "delete", "query"] + object: Literal[AgentObjectType.AGENT_DELETED] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """List of comparison results for each treatment run. Required.""" + """The object type. Always 'agent.deleted'. Required. AGENT_DELETED.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the agent. Required.""" + deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the agent was successfully deleted. Required.""" @overload def __init__( self, *, - testing_criteria: str, - metric: str, - evaluator: str, - baseline_run_summary: "_models.EvalRunResultSummary", - compare_items: list["_models.EvalRunResultCompareItem"], + object: Literal[AgentObjectType.AGENT_DELETED], + name: str, + deleted: bool, ) -> None: ... @overload @@ -5953,38 +6070,38 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvalRunResultSummary(_Model): - """Summary statistics of a metric in an evaluation run. +class DeleteAgentVersionResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A deleted agent version Object. - :ivar run_id: The evaluation run ID. Required. - :vartype run_id: str - :ivar sample_count: Number of samples in the evaluation run. Required. - :vartype sample_count: int - :ivar average: Average value of the metric in the evaluation run. Required. - :vartype average: float - :ivar standard_deviation: Standard deviation of the metric in the evaluation run. Required. - :vartype standard_deviation: float + :ivar object: The object type. Always 'agent.version.deleted'. Required. AGENT_VERSION_DELETED. + :vartype object: str or ~azure.ai.projects.models.AGENT_VERSION_DELETED + :ivar name: The name of the agent. Required. + :vartype name: str + :ivar version: The version identifier of the agent. Required. + :vartype version: str + :ivar deleted: Whether the agent was successfully deleted. Required. + :vartype deleted: bool """ - run_id: str = rest_field(name="runId", visibility=["read", "create", "update", "delete", "query"]) - """The evaluation run ID. Required.""" - sample_count: int = rest_field(name="sampleCount", visibility=["read", "create", "update", "delete", "query"]) - """Number of samples in the evaluation run. Required.""" - average: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Average value of the metric in the evaluation run. Required.""" - standard_deviation: float = rest_field( - name="standardDeviation", visibility=["read", "create", "update", "delete", "query"] + object: Literal[AgentObjectType.AGENT_VERSION_DELETED] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Standard deviation of the metric in the evaluation run. Required.""" + """The object type. Always 'agent.version.deleted'. Required. AGENT_VERSION_DELETED.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the agent. Required.""" + version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version identifier of the agent. Required.""" + deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the agent was successfully deleted. Required.""" @overload def __init__( self, *, - run_id: str, - sample_count: int, - average: float, - standard_deviation: float, + object: Literal[AgentObjectType.AGENT_VERSION_DELETED], + name: str, + version: str, + deleted: bool, ) -> None: ... @overload @@ -5998,37 +6115,33 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationComparisonInsightRequest(InsightRequest, discriminator="EvaluationComparison"): - """Evaluation Comparison Request. +class DeleteMemoryResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Response for deleting a memory item from a memory store. - :ivar type: The type of request. Required. Evaluation Comparison. - :vartype type: str or ~azure.ai.projects.models.EVALUATION_COMPARISON - :ivar eval_id: Identifier for the evaluation. Required. - :vartype eval_id: str - :ivar baseline_run_id: The baseline run ID for comparison. Required. - :vartype baseline_run_id: str - :ivar treatment_run_ids: List of treatment run IDs for comparison. Required. - :vartype treatment_run_ids: list[str] + :ivar object: The object type. Always 'memory_store.item.deleted'. Required. MEMORY_DELETED. + :vartype object: str or ~azure.ai.projects.models.MEMORY_DELETED + :ivar memory_id: The unique ID of the deleted memory item. Required. + :vartype memory_id: str + :ivar deleted: Whether the memory item was successfully deleted. Required. + :vartype deleted: bool """ - type: Literal[InsightType.EVALUATION_COMPARISON] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of request. Required. Evaluation Comparison.""" - eval_id: str = rest_field(name="evalId", visibility=["read", "create", "update", "delete", "query"]) - """Identifier for the evaluation. Required.""" - baseline_run_id: str = rest_field(name="baselineRunId", visibility=["read", "create", "update", "delete", "query"]) - """The baseline run ID for comparison. Required.""" - treatment_run_ids: list[str] = rest_field( - name="treatmentRunIds", visibility=["read", "create", "update", "delete", "query"] + object: Literal[MemoryStoreObjectType.MEMORY_DELETED] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """List of treatment run IDs for comparison. Required.""" + """The object type. Always 'memory_store.item.deleted'. Required. MEMORY_DELETED.""" + memory_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the deleted memory item. Required.""" + deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the memory item was successfully deleted. Required.""" @overload def __init__( self, *, - eval_id: str, - baseline_run_id: str, - treatment_run_ids: list[str], + object: Literal[MemoryStoreObjectType.MEMORY_DELETED], + memory_id: str, + deleted: bool, ) -> None: ... @overload @@ -6040,35 +6153,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = InsightType.EVALUATION_COMPARISON # type: ignore -class EvaluationComparisonInsightResult(InsightResult, discriminator="EvaluationComparison"): - """Insights from the evaluation comparison. +class DeleteMemoryStoreResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """DeleteMemoryStoreResult. - :ivar type: The type of insights result. Required. Evaluation Comparison. - :vartype type: str or ~azure.ai.projects.models.EVALUATION_COMPARISON - :ivar comparisons: Comparison results for each treatment run against the baseline. Required. - :vartype comparisons: list[~azure.ai.projects.models.EvalRunResultComparison] - :ivar method: The statistical method used for comparison. Required. - :vartype method: str + :ivar object: The object type. Always 'memory_store.deleted'. Required. MEMORY_STORE_DELETED. + :vartype object: str or ~azure.ai.projects.models.MEMORY_STORE_DELETED + :ivar name: The name of the memory store. Required. + :vartype name: str + :ivar deleted: Whether the memory store was successfully deleted. Required. + :vartype deleted: bool """ - type: Literal[InsightType.EVALUATION_COMPARISON] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of insights result. Required. Evaluation Comparison.""" - comparisons: list["_models.EvalRunResultComparison"] = rest_field( + object: Literal[MemoryStoreObjectType.MEMORY_STORE_DELETED] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Comparison results for each treatment run against the baseline. Required.""" - method: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The statistical method used for comparison. Required.""" + """The object type. Always 'memory_store.deleted'. Required. MEMORY_STORE_DELETED.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the memory store. Required.""" + deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the memory store was successfully deleted. Required.""" @overload def __init__( self, *, - comparisons: list["_models.EvalRunResultComparison"], - method: str, + object: Literal[MemoryStoreObjectType.MEMORY_STORE_DELETED], + name: str, + deleted: bool, ) -> None: ... @overload @@ -6080,45 +6193,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = InsightType.EVALUATION_COMPARISON # type: ignore - -class InsightSample(_Model): - """A sample from the analysis. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - EvaluationResultSample +class DeleteSkillResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A deleted skill. - :ivar id: The unique identifier for the analysis sample. Required. + :ivar id: The unique identifier of the deleted skill. Required. :vartype id: str - :ivar type: Sample type. Required. "EvaluationResultSample" - :vartype type: str or ~azure.ai.projects.models.SampleType - :ivar features: Features to help with additional filtering of data in UX. Required. - :vartype features: dict[str, any] - :ivar correlation_info: Info about the correlation for the analysis sample. Required. - :vartype correlation_info: dict[str, any] + :ivar name: The unique name of the skill. Required. + :vartype name: str + :ivar deleted: Whether the skill was successfully deleted. Required. + :vartype deleted: bool """ - __mapping__: dict[str, _Model] = {} id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier for the analysis sample. Required.""" - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Sample type. Required. \"EvaluationResultSample\"""" - features: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Features to help with additional filtering of data in UX. Required.""" - correlation_info: dict[str, Any] = rest_field( - name="correlationInfo", visibility=["read", "create", "update", "delete", "query"] - ) - """Info about the correlation for the analysis sample. Required.""" + """The unique identifier of the deleted skill. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique name of the skill. Required.""" + deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the skill was successfully deleted. Required.""" @overload def __init__( self, *, id: str, # pylint: disable=redefined-builtin - type: str, - features: dict[str, Any], - correlation_info: dict[str, Any], + name: str, + deleted: bool, ) -> None: ... @overload @@ -6132,36 +6233,36 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationResultSample(InsightSample, discriminator="EvaluationResultSample"): - """A sample from the evaluation result. +class DeleteSkillVersionResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A deleted skill version. - :ivar id: The unique identifier for the analysis sample. Required. + :ivar id: The unique identifier of the deleted skill version. Required. :vartype id: str - :ivar features: Features to help with additional filtering of data in UX. Required. - :vartype features: dict[str, any] - :ivar correlation_info: Info about the correlation for the analysis sample. Required. - :vartype correlation_info: dict[str, any] - :ivar type: Evaluation Result Sample Type. Required. A sample from the evaluation result. - :vartype type: str or ~azure.ai.projects.models.EVALUATION_RESULT_SAMPLE - :ivar evaluation_result: Evaluation result for the analysis sample. Required. - :vartype evaluation_result: ~azure.ai.projects.models.EvalResult + :ivar name: The name of the skill. Required. + :vartype name: str + :ivar deleted: Whether the skill version was successfully deleted. Required. + :vartype deleted: bool + :ivar version: The version that was deleted. Required. + :vartype version: str """ - type: Literal[SampleType.EVALUATION_RESULT_SAMPLE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Evaluation Result Sample Type. Required. A sample from the evaluation result.""" - evaluation_result: "_models.EvalResult" = rest_field( - name="evaluationResult", visibility=["read", "create", "update", "delete", "query"] - ) - """Evaluation result for the analysis sample. Required.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the deleted skill version. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the skill. Required.""" + deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the skill version was successfully deleted. Required.""" + version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version that was deleted. Required.""" @overload def __init__( self, *, id: str, # pylint: disable=redefined-builtin - features: dict[str, Any], - correlation_info: dict[str, Any], - evaluation_result: "_models.EvalResult", + name: str, + deleted: bool, + version: str, ) -> None: ... @overload @@ -6173,65 +6274,31 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = SampleType.EVALUATION_RESULT_SAMPLE # type: ignore -class EvaluationRule(_Model): - """Evaluation rule model. +class Deployment(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Model Deployment Definition. - :ivar id: Unique identifier for the evaluation rule. Required. - :vartype id: str - :ivar display_name: Display Name for the evaluation rule. - :vartype display_name: str - :ivar description: Description for the evaluation rule. - :vartype description: str - :ivar action: Definition of the evaluation rule action. Required. - :vartype action: ~azure.ai.projects.models.EvaluationRuleAction - :ivar filter: Filter condition of the evaluation rule. - :vartype filter: ~azure.ai.projects.models.EvaluationRuleFilter - :ivar event_type: Event type that the evaluation rule applies to. Required. Known values are: - "responseCompleted" and "manual". - :vartype event_type: str or ~azure.ai.projects.models.EvaluationRuleEventType - :ivar enabled: Indicates whether the evaluation rule is enabled. Default is true. Required. - :vartype enabled: bool - :ivar system_data: System metadata for the evaluation rule. Required. - :vartype system_data: dict[str, str] + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ModelDeployment + + :ivar type: The type of the deployment. Required. "ModelDeployment" + :vartype type: str or ~azure.ai.projects.models.DeploymentType + :ivar name: Name of the deployment. Required. + :vartype name: str """ - id: str = rest_field(visibility=["read"]) - """Unique identifier for the evaluation rule. Required.""" - display_name: Optional[str] = rest_field( - name="displayName", visibility=["read", "create", "update", "delete", "query"] - ) - """Display Name for the evaluation rule.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Description for the evaluation rule.""" - action: "_models.EvaluationRuleAction" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Definition of the evaluation rule action. Required.""" - filter: Optional["_models.EvaluationRuleFilter"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Filter condition of the evaluation rule.""" - event_type: Union[str, "_models.EvaluationRuleEventType"] = rest_field( - name="eventType", visibility=["read", "create", "update", "delete", "query"] - ) - """Event type that the evaluation rule applies to. Required. Known values are: - \"responseCompleted\" and \"manual\".""" - enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Indicates whether the evaluation rule is enabled. Default is true. Required.""" - system_data: dict[str, str] = rest_field(name="systemData", visibility=["read"]) - """System metadata for the evaluation rule. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The type of the deployment. Required. \"ModelDeployment\"""" + name: str = rest_field(visibility=["read"]) + """Name of the deployment. Required.""" @overload def __init__( self, *, - action: "_models.EvaluationRuleAction", - event_type: Union[str, "_models.EvaluationRuleEventType"], - enabled: bool, - display_name: Optional[str] = None, - description: Optional[str] = None, - filter: Optional["_models.EvaluationRuleFilter"] = None, # pylint: disable=redefined-builtin + type: str, ) -> None: ... @overload @@ -6245,21 +6312,54 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationRuleFilter(_Model): - """Evaluation filter model. +class Dimension(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A single dimension — one independent, measurable quality dimension within a rubric evaluator's + scoring blueprint. - :ivar agent_name: Filter by agent name. Required. - :vartype agent_name: str + :ivar id: Stable identifier for this dimension (snake_case, e.g., ``correct_resolution``). + Required. Provided by the user when manually creating a rubric evaluator or during + human-in-the-loop review of a generated set; the generation pipeline produces an initial value + the user can edit. Editable when saving new versions. Required. + :vartype id: str + :ivar description: What this dimension measures (e.g., 'Correctly identifies the user's + reservation intent and pursues the appropriate workflow'). Required. + :vartype description: str + :ivar weight: Relative weight of this dimension (1-10). The generation pipeline assigns exactly + one dimension weight 8-10; all others use 1-6. User edits are not constrained by this + heuristic. Required. + :vartype weight: int + :ivar always_applicable: When true, the LLM judge always scores this dimension regardless of + relevance (skips applicability assessment). The service-generated general quality/policy + dimension has this set to true and is non-editable. Users may set this on their own custom + dimensions. The service defaults to ``false`` if a value is not specified by the caller. + :vartype always_applicable: bool """ - agent_name: str = rest_field(name="agentName", visibility=["read", "create", "update", "delete", "query"]) - """Filter by agent name. Required.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Stable identifier for this dimension (snake_case, e.g., ``correct_resolution``). Required. + Provided by the user when manually creating a rubric evaluator or during human-in-the-loop + review of a generated set; the generation pipeline produces an initial value the user can edit. + Editable when saving new versions. Required.""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """What this dimension measures (e.g., 'Correctly identifies the user's reservation intent and + pursues the appropriate workflow'). Required.""" + weight: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Relative weight of this dimension (1-10). The generation pipeline assigns exactly one dimension + weight 8-10; all others use 1-6. User edits are not constrained by this heuristic. Required.""" + always_applicable: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """When true, the LLM judge always scores this dimension regardless of relevance (skips + applicability assessment). The service-generated general quality/policy dimension has this set + to true and is non-editable. Users may set this on their own custom dimensions. The service + defaults to ``false`` if a value is not specified by the caller.""" @overload def __init__( self, *, - agent_name: str, + id: str, # pylint: disable=redefined-builtin + description: str, + weight: int, + always_applicable: Optional[bool] = None, ) -> None: ... @overload @@ -6273,37 +6373,31 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationRunClusterInsightRequest(InsightRequest, discriminator="EvaluationRunClusterInsight"): - """Insights on set of Evaluation Results. +class DispatchRoutineResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Identifiers returned after a routine dispatch is queued. - :ivar type: The type of insights request. Required. Insights on an Evaluation run result. - :vartype type: str or ~azure.ai.projects.models.EVALUATION_RUN_CLUSTER_INSIGHT - :ivar eval_id: Evaluation Id for the insights. Required. - :vartype eval_id: str - :ivar run_ids: List of evaluation run IDs for the insights. Required. - :vartype run_ids: list[str] - :ivar model_configuration: Configuration of the model used in the insight generation. - :vartype model_configuration: ~azure.ai.projects.models.InsightModelConfiguration + :ivar dispatch_id: The dispatch identifier created for the routine dispatch. + :vartype dispatch_id: str + :ivar action_correlation_id: A downstream action correlation identifier, when available. + :vartype action_correlation_id: str + :ivar task_id: A workspace task identifier created for the dispatch, when available. + :vartype task_id: str """ - type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of insights request. Required. Insights on an Evaluation run result.""" - eval_id: str = rest_field(name="evalId", visibility=["read", "create", "update", "delete", "query"]) - """Evaluation Id for the insights. Required.""" - run_ids: list[str] = rest_field(name="runIds", visibility=["read", "create", "update", "delete", "query"]) - """List of evaluation run IDs for the insights. Required.""" - model_configuration: Optional["_models.InsightModelConfiguration"] = rest_field( - name="modelConfiguration", visibility=["read", "create", "update", "delete", "query"] - ) - """Configuration of the model used in the insight generation.""" + dispatch_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The dispatch identifier created for the routine dispatch.""" + action_correlation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A downstream action correlation identifier, when available.""" + task_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A workspace task identifier created for the dispatch, when available.""" @overload def __init__( self, *, - eval_id: str, - run_ids: list[str], - model_configuration: Optional["_models.InsightModelConfiguration"] = None, + dispatch_id: Optional[str] = None, + action_correlation_id: Optional[str] = None, + task_id: Optional[str] = None, ) -> None: ... @overload @@ -6315,30 +6409,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = InsightType.EVALUATION_RUN_CLUSTER_INSIGHT # type: ignore -class EvaluationRunClusterInsightResult(InsightResult, discriminator="EvaluationRunClusterInsight"): - """Insights from the evaluation run cluster analysis. +class EmbeddingConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Embedding configuration class. - :ivar type: The type of insights result. Required. Insights on an Evaluation run result. - :vartype type: str or ~azure.ai.projects.models.EVALUATION_RUN_CLUSTER_INSIGHT - :ivar cluster_insight: Required. - :vartype cluster_insight: ~azure.ai.projects.models.ClusterInsightResult + :ivar model_deployment_name: Deployment name of embedding model. It can point to a model + deployment either in the parent AIServices or a connection. Required. + :vartype model_deployment_name: str + :ivar embedding_field: Embedding field. Required. + :vartype embedding_field: str """ - type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of insights result. Required. Insights on an Evaluation run result.""" - cluster_insight: "_models.ClusterInsightResult" = rest_field( - name="clusterInsight", visibility=["read", "create", "update", "delete", "query"] - ) - """Required.""" + model_deployment_name: str = rest_field(name="modelDeploymentName", visibility=["create"]) + """Deployment name of embedding model. It can point to a model deployment either in the parent + AIServices or a connection. Required.""" + embedding_field: str = rest_field(name="embeddingField", visibility=["create"]) + """Embedding field. Required.""" @overload def __init__( self, *, - cluster_insight: "_models.ClusterInsightResult", + model_deployment_name: str, + embedding_field: str, ) -> None: ... @overload @@ -6350,33 +6444,56 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = InsightType.EVALUATION_RUN_CLUSTER_INSIGHT # type: ignore -class ScheduleTask(_Model): - """Schedule task model. +class EmptyModelParam(_Model): + """EmptyModelParam.""" - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - EvaluationScheduleTask, InsightScheduleTask - :ivar type: Type of the task. Required. Known values are: "Evaluation" and "Insight". - :vartype type: str or ~azure.ai.projects.models.ScheduleTaskType - :ivar configuration: Configuration for the task. - :vartype configuration: dict[str, str] +class EndpointBasedEvaluatorDefinition( + EvaluatorDefinition, discriminator="endpoint" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Endpoint-based evaluator definition. The customer owns and hosts an HTTP endpoint that + implements the evaluation contract. The evaluator references a Project Connection by name; the + connection stores the endpoint URL and credentials (API Key or Entra ID). At execution time, + the service resolves the connection to obtain the endpoint URL and authentication details, then + calls the endpoint for each evaluation row. + + :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. Endpoint-based evaluator definition. References a customer-owned HTTP + endpoint via a Project Connection. + :vartype type: str or ~azure.ai.projects.models.ENDPOINT + :ivar connection_name: Name of the Project Connection that stores the endpoint URL and + credentials. The connection must exist on the project and have a non-empty target URL. + Supported auth types: ApiKey (sends ``api-key`` header) and AAD/Entra ID (acquires a bearer + token via the project's Managed Identity). Required. + :vartype connection_name: str """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Type of the task. Required. Known values are: \"Evaluation\" and \"Insight\".""" - configuration: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Configuration for the task.""" + type: Literal[EvaluatorDefinitionType.ENDPOINT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Endpoint-based evaluator definition. References a customer-owned HTTP endpoint via a + Project Connection.""" + connection_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the Project Connection that stores the endpoint URL and credentials. The connection + must exist on the project and have a non-empty target URL. Supported auth types: ApiKey (sends + ``api-key`` header) and AAD/Entra ID (acquires a bearer token via the project's Managed + Identity). Required.""" @overload def __init__( self, *, - type: str, - configuration: Optional[dict[str, str]] = None, + connection_name: str, + init_parameters: Optional[dict[str, Any]] = None, + data_schema: Optional[dict[str, Any]] = None, + metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, ) -> None: ... @overload @@ -6388,35 +6505,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = EvaluatorDefinitionType.ENDPOINT # type: ignore -class EvaluationScheduleTask(ScheduleTask, discriminator="Evaluation"): - """Evaluation task for the schedule. +class EntraAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="Entra"): + """EntraAuthorizationScheme. - :ivar configuration: Configuration for the task. - :vartype configuration: dict[str, str] - :ivar type: Required. Evaluation task. - :vartype type: str or ~azure.ai.projects.models.EVALUATION - :ivar eval_id: Identifier of the evaluation group. Required. - :vartype eval_id: str - :ivar eval_run: The evaluation run payload. Required. - :vartype eval_run: dict[str, any] + :ivar type: Required. ENTRA. + :vartype type: str or ~azure.ai.projects.models.ENTRA """ - type: Literal[ScheduleTaskType.EVALUATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Evaluation task.""" - eval_id: str = rest_field(name="evalId", visibility=["read", "create", "update", "delete", "query"]) - """Identifier of the evaluation group. Required.""" - eval_run: dict[str, Any] = rest_field(name="evalRun", visibility=["read", "create", "update", "delete", "query"]) - """The evaluation run payload. Required.""" + type: Literal[AgentEndpointAuthorizationSchemeType.ENTRA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. ENTRA.""" @overload def __init__( self, - *, - eval_id: str, - eval_run: dict[str, Any], - configuration: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -6428,60 +6532,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ScheduleTaskType.EVALUATION # type: ignore + self.type = AgentEndpointAuthorizationSchemeType.ENTRA # type: ignore -class EvaluationTaxonomy(_Model): - """Evaluation Taxonomy Definition. +class EntraIDCredentials(BaseCredentials, discriminator="AAD"): + """Entra ID credential 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 taxonomy_input: Input configuration for the evaluation taxonomy. Required. - :vartype taxonomy_input: ~azure.ai.projects.models.EvaluationTaxonomyInput - :ivar taxonomy_categories: List of taxonomy categories. - :vartype taxonomy_categories: list[~azure.ai.projects.models.TaxonomyCategory] - :ivar properties: Additional properties for the evaluation taxonomy. - :vartype properties: dict[str, str] + :ivar type: The credential type. Required. Entra ID credential (formerly known as AAD). + :vartype type: str or ~azure.ai.projects.models.ENTRA_ID """ - 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=["create", "update"]) - """The asset description text.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["create", "update"]) - """Tag dictionary. Tags can be added, removed, and updated.""" - taxonomy_input: "_models.EvaluationTaxonomyInput" = rest_field( - name="taxonomyInput", visibility=["read", "create", "update", "delete", "query"] - ) - """Input configuration for the evaluation taxonomy. Required.""" - taxonomy_categories: Optional[list["_models.TaxonomyCategory"]] = rest_field( - name="taxonomyCategories", visibility=["read", "create", "update", "delete", "query"] - ) - """List of taxonomy categories.""" - properties: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Additional properties for the evaluation taxonomy.""" + type: Literal[CredentialType.ENTRA_ID] = rest_discriminator(name="type", visibility=["read"]) # type: ignore + """The credential type. Required. Entra ID credential (formerly known as AAD).""" @overload def __init__( self, - *, - taxonomy_input: "_models.EvaluationTaxonomyInput", - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, - taxonomy_categories: Optional[list["_models.TaxonomyCategory"]] = None, - properties: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -6493,25 +6559,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = CredentialType.ENTRA_ID # type: ignore -class EvaluatorCredentialRequest(_Model): - """Request body for getting evaluator credentials. +class EvalResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Result of the evaluation. - :ivar blob_uri: The blob URI for the evaluator storage. Example: - ``https://account.blob.core.windows.net:443/container``. Required. - :vartype blob_uri: str + :ivar name: name of the check. Required. + :vartype name: str + :ivar type: type of the check. Required. + :vartype type: str + :ivar score: score. Required. + :vartype score: float + :ivar passed: indicates if the check passed or failed. Required. + :vartype passed: bool """ - blob_uri: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The blob URI for the evaluator storage. Example: - ``https://account.blob.core.windows.net:443/container``. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """name of the check. Required.""" + type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """type of the check. Required.""" + score: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """score. Required.""" + passed: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """indicates if the check passed or failed. Required.""" @overload def __init__( self, *, - blob_uri: str, + name: str, + type: str, + score: float, + passed: bool, ) -> None: ... @overload @@ -6525,42 +6605,49 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorGenerationArtifacts(_Model): - """Service-managed provenance artifacts produced by an evaluator generation job. Present only on - EvaluatorVersion resources created via the generation pipeline. The combined-JSONL Foundry - Dataset is read-only and resolves to a versioned dataset in a service-reserved namespace. +class EvalRunResultCompareItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Metric comparison for a treatment against the baseline. - :ivar dataset: Reference to the single Foundry Dataset (one combined JSONL file, - version-aligned to ``EvaluatorVersion.version``) holding all artifacts produced by the - generation pipeline. Each row in the JSONL carries a ``kind`` field discriminating its content - (e.g. ``spec``, ``tools``, ``context``). Required. - :vartype dataset: ~azure.ai.projects.models.DatasetReference - :ivar kinds: The kinds of rows present in ``dataset``. Always contains ``"spec"`` (the - generated evaluation specification, a Markdown document describing what the evaluator - measures). May additionally contain ``"tools"`` (when the generation pipeline produced or - inferred OpenAI tool schemas) and/or ``"context"`` (when supplementary materials such as file - uploads or trace samples were used during generation). Required. - :vartype kinds: list[str] + :ivar treatment_run_id: The treatment run ID. Required. + :vartype treatment_run_id: str + :ivar treatment_run_summary: Summary statistics of the treatment run. Required. + :vartype treatment_run_summary: ~azure.ai.projects.models.EvalRunResultSummary + :ivar delta_estimate: Estimated difference between treatment and baseline. Required. + :vartype delta_estimate: float + :ivar p_value: P-value for the treatment effect. Required. + :vartype p_value: float + :ivar treatment_effect: Type of treatment effect. Required. Known values are: "TooFewSamples", + "Inconclusive", "Changed", "Improved", and "Degraded". + :vartype treatment_effect: str or ~azure.ai.projects.models.TreatmentEffectType """ - dataset: "_models.DatasetReference" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Reference to the single Foundry Dataset (one combined JSONL file, version-aligned to - ``EvaluatorVersion.version``) holding all artifacts produced by the generation pipeline. Each - row in the JSONL carries a ``kind`` field discriminating its content (e.g. ``spec``, ``tools``, - ``context``). Required.""" - kinds: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The kinds of rows present in ``dataset``. Always contains ``\"spec\"`` (the generated - evaluation specification, a Markdown document describing what the evaluator measures). May - additionally contain ``\"tools\"`` (when the generation pipeline produced or inferred OpenAI - tool schemas) and/or ``\"context\"`` (when supplementary materials such as file uploads or - trace samples were used during generation). Required.""" + treatment_run_id: str = rest_field( + name="treatmentRunId", visibility=["read", "create", "update", "delete", "query"] + ) + """The treatment run ID. Required.""" + treatment_run_summary: "_models.EvalRunResultSummary" = rest_field( + name="treatmentRunSummary", visibility=["read", "create", "update", "delete", "query"] + ) + """Summary statistics of the treatment run. Required.""" + delta_estimate: float = rest_field(name="deltaEstimate", visibility=["read", "create", "update", "delete", "query"]) + """Estimated difference between treatment and baseline. Required.""" + p_value: float = rest_field(name="pValue", visibility=["read", "create", "update", "delete", "query"]) + """P-value for the treatment effect. Required.""" + treatment_effect: Union[str, "_models.TreatmentEffectType"] = rest_field( + name="treatmentEffect", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of treatment effect. Required. Known values are: \"TooFewSamples\", \"Inconclusive\", + \"Changed\", \"Improved\", and \"Degraded\".""" @overload def __init__( self, *, - dataset: "_models.DatasetReference", - kinds: list[str], + treatment_run_id: str, + treatment_run_summary: "_models.EvalRunResultSummary", + delta_estimate: float, + p_value: float, + treatment_effect: Union[str, "_models.TreatmentEffectType"], ) -> None: ... @overload @@ -6574,76 +6661,47 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorGenerationInputs(_Model): - """Caller-supplied inputs for an evaluator generation job. +class EvalRunResultComparison(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Comparison results for treatment runs against the baseline. - :ivar sources: Source materials for generation — agent descriptions, prompts, traces, or - datasets. Each entry is an ``EvaluatorGenerationJobSource`` variant discriminated by ``type``. - Required. - :vartype sources: list[~azure.ai.projects.models.EvaluatorGenerationJobSource] - :ivar model: The LLM model to use for rubric generation (e.g., 'gpt-4o'). Required — users must - provide their own model rather than relying on service-owned capacity. Required. - :vartype model: str - :ivar evaluator_name: The evaluator name (immutable identifier). 1-256 characters; allowed - characters are ASCII letters, digits, underscore (``_``), period (``.``), tilde (``~``), and - hyphen (``-``). The prefix ``builtin.`` is reserved for system-managed evaluators and is - rejected by the service. If an evaluator with this name already exists in the project (and is - rubric-subtype), the service creates a new version under the same name and uses the prior - version's ``dimensions`` as context for incremental improvement (foundation of the post-//build - adaptive loop). Old versions remain queryable via ``get_version(name, version)``. If the - existing evaluator is not a rubric-subtype evaluator (built-in, prompt-based, code-based), the - request is rejected with ``400 Bad Request``. Required. - :vartype evaluator_name: str - :ivar evaluator_display_name: Optional human-friendly display name for the resulting evaluator. - Surfaced as ``EvaluatorVersion.display_name`` on the persisted evaluator. When omitted, the - service uses ``evaluator_name`` as the display name. The ``evaluator_`` prefix disambiguates - this from the immutable ``evaluator_name`` identifier. - :vartype evaluator_display_name: str - :ivar evaluator_description: Optional human-friendly description for the resulting evaluator. - Surfaced as ``EvaluatorVersion.description`` on the persisted evaluator. Typically collected - from the UI alongside ``evaluator_display_name``. The ``evaluator_`` prefix disambiguates this - from any other description fields on related models. - :vartype evaluator_description: str + :ivar testing_criteria: Name of the testing criteria. Required. + :vartype testing_criteria: str + :ivar metric: Metric being evaluated. Required. + :vartype metric: str + :ivar evaluator: Name of the evaluator for this testing criteria. Required. + :vartype evaluator: str + :ivar baseline_run_summary: Summary statistics of the baseline run. Required. + :vartype baseline_run_summary: ~azure.ai.projects.models.EvalRunResultSummary + :ivar compare_items: List of comparison results for each treatment run. Required. + :vartype compare_items: list[~azure.ai.projects.models.EvalRunResultCompareItem] """ - sources: list["_models.EvaluatorGenerationJobSource"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + testing_criteria: str = rest_field( + name="testingCriteria", visibility=["read", "create", "update", "delete", "query"] ) - """Source materials for generation — agent descriptions, prompts, traces, or datasets. Each entry - is an ``EvaluatorGenerationJobSource`` variant discriminated by ``type``. Required.""" - model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The LLM model to use for rubric generation (e.g., 'gpt-4o'). Required — users must provide - their own model rather than relying on service-owned capacity. Required.""" - evaluator_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The evaluator name (immutable identifier). 1-256 characters; allowed characters are ASCII - letters, digits, underscore (``_``), period (``.``), tilde (``~``), and hyphen (``-``). The - prefix ``builtin.`` is reserved for system-managed evaluators and is rejected by the service. - If an evaluator with this name already exists in the project (and is rubric-subtype), the - service creates a new version under the same name and uses the prior version's ``dimensions`` - as context for incremental improvement (foundation of the post-//build adaptive loop). Old - versions remain queryable via ``get_version(name, version)``. If the existing evaluator is not - a rubric-subtype evaluator (built-in, prompt-based, code-based), the request is rejected with - ``400 Bad Request``. Required.""" - evaluator_display_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional human-friendly display name for the resulting evaluator. Surfaced as - ``EvaluatorVersion.display_name`` on the persisted evaluator. When omitted, the service uses - ``evaluator_name`` as the display name. The ``evaluator_`` prefix disambiguates this from the - immutable ``evaluator_name`` identifier.""" - evaluator_description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional human-friendly description for the resulting evaluator. Surfaced as - ``EvaluatorVersion.description`` on the persisted evaluator. Typically collected from the UI - alongside ``evaluator_display_name``. The ``evaluator_`` prefix disambiguates this from any - other description fields on related models.""" + """Name of the testing criteria. Required.""" + metric: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Metric being evaluated. Required.""" + evaluator: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the evaluator for this testing criteria. Required.""" + baseline_run_summary: "_models.EvalRunResultSummary" = rest_field( + name="baselineRunSummary", visibility=["read", "create", "update", "delete", "query"] + ) + """Summary statistics of the baseline run. Required.""" + compare_items: list["_models.EvalRunResultCompareItem"] = rest_field( + name="compareItems", visibility=["read", "create", "update", "delete", "query"] + ) + """List of comparison results for each treatment run. Required.""" @overload def __init__( self, *, - sources: list["_models.EvaluatorGenerationJobSource"], - model: str, - evaluator_name: str, - evaluator_display_name: Optional[str] = None, - evaluator_description: Optional[str] = None, + testing_criteria: str, + metric: str, + evaluator: str, + baseline_run_summary: "_models.EvalRunResultSummary", + compare_items: list["_models.EvalRunResultCompareItem"], ) -> None: ... @overload @@ -6657,70 +6715,38 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorGenerationJob(_Model): - """Evaluator Generation Job resource — a long-running job that generates rubric-based evaluator - definitions from source materials. On success, the result is the persisted EvaluatorVersion. +class EvalRunResultSummary(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Summary statistics of a metric in an evaluation run. - :ivar id: Server-assigned unique identifier. Required. - :vartype id: str - :ivar inputs: Caller-supplied inputs. - :vartype inputs: ~azure.ai.projects.models.EvaluatorGenerationInputs - :ivar result: Result produced on success. - :vartype result: ~azure.ai.projects.models.EvaluatorVersion - :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 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 finished, represented in Unix time (seconds since - January 1, 1970). - :vartype finished_at: ~datetime.datetime - :ivar usage: Token consumption summary. Populated when the job reaches a terminal state. - :vartype usage: ~azure.ai.projects.models.EvaluatorGenerationTokenUsage - :ivar input_quality_warnings: Non-fatal input-quality advisories produced by the generation - pipeline. Read-only; service-generated; populated only on terminal jobs when advisories fired. - Omitted when generation was clean. Cleared when a subsequent ``PATCH`` to the paired - ``EvaluatorVersion.definition`` invalidates the advisories. - :vartype input_quality_warnings: - list[~azure.ai.projects.models.RubricGenerationInputQualityWarning] + :ivar run_id: The evaluation run ID. Required. + :vartype run_id: str + :ivar sample_count: Number of samples in the evaluation run. Required. + :vartype sample_count: int + :ivar average: Average value of the metric in the evaluation run. Required. + :vartype average: float + :ivar standard_deviation: Standard deviation of the metric in the evaluation run. Required. + :vartype standard_deviation: float """ - id: str = rest_field(visibility=["read"]) - """Server-assigned unique identifier. Required.""" - inputs: Optional["_models.EvaluatorGenerationInputs"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Caller-supplied inputs.""" - result: Optional["_models.EvaluatorVersion"] = rest_field(visibility=["read"]) - """Result produced on success.""" - status: Union[str, "_models.JobStatus"] = rest_field(visibility=["read"]) - """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", - \"succeeded\", \"failed\", and \"cancelled\".""" - error: Optional["_models.ApiError"] = rest_field(visibility=["read"]) - """Error details — populated only on failure.""" - created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") - """The timestamp when the job was created, represented in Unix time (seconds since January 1, - 1970). Required.""" - finished_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") - """The timestamp when the job finished, represented in Unix time (seconds since January 1, 1970).""" - usage: Optional["_models.EvaluatorGenerationTokenUsage"] = rest_field(visibility=["read"]) - """Token consumption summary. Populated when the job reaches a terminal state.""" - input_quality_warnings: Optional[list["_models.RubricGenerationInputQualityWarning"]] = rest_field( - visibility=["read"] + run_id: str = rest_field(name="runId", visibility=["read", "create", "update", "delete", "query"]) + """The evaluation run ID. Required.""" + sample_count: int = rest_field(name="sampleCount", visibility=["read", "create", "update", "delete", "query"]) + """Number of samples in the evaluation run. Required.""" + average: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Average value of the metric in the evaluation run. Required.""" + standard_deviation: float = rest_field( + name="standardDeviation", visibility=["read", "create", "update", "delete", "query"] ) - """Non-fatal input-quality advisories produced by the generation pipeline. Read-only; - service-generated; populated only on terminal jobs when advisories fired. Omitted when - generation was clean. Cleared when a subsequent ``PATCH`` to the paired - ``EvaluatorVersion.definition`` invalidates the advisories.""" + """Standard deviation of the metric in the evaluation run. Required.""" @overload def __init__( self, *, - inputs: Optional["_models.EvaluatorGenerationInputs"] = None, + run_id: str, + sample_count: int, + average: float, + standard_deviation: float, ) -> None: ... @overload @@ -6734,32 +6760,39 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorGenerationTokenUsage(_Model): - """Token consumption summary for an evaluator generation job. Populated when the job reaches a - terminal state. +class EvaluationComparisonInsightRequest( + InsightRequest, discriminator="EvaluationComparison" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Evaluation Comparison Request. - :ivar input_tokens: Number of input (prompt) tokens consumed. Required. - :vartype input_tokens: int - :ivar output_tokens: Number of output (completion) tokens generated. Required. - :vartype output_tokens: int - :ivar total_tokens: Total tokens consumed (input + output). Required. - :vartype total_tokens: int + :ivar type: The type of request. Required. Evaluation Comparison. + :vartype type: str or ~azure.ai.projects.models.EVALUATION_COMPARISON + :ivar eval_id: Identifier for the evaluation. Required. + :vartype eval_id: str + :ivar baseline_run_id: The baseline run ID for comparison. Required. + :vartype baseline_run_id: str + :ivar treatment_run_ids: List of treatment run IDs for comparison. Required. + :vartype treatment_run_ids: list[str] """ - input_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of input (prompt) tokens consumed. Required.""" - output_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of output (completion) tokens generated. Required.""" - total_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Total tokens consumed (input + output). Required.""" + type: Literal[InsightType.EVALUATION_COMPARISON] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of request. Required. Evaluation Comparison.""" + eval_id: str = rest_field(name="evalId", visibility=["read", "create", "update", "delete", "query"]) + """Identifier for the evaluation. Required.""" + baseline_run_id: str = rest_field(name="baselineRunId", visibility=["read", "create", "update", "delete", "query"]) + """The baseline run ID for comparison. Required.""" + treatment_run_ids: list[str] = rest_field( + name="treatmentRunIds", visibility=["read", "create", "update", "delete", "query"] + ) + """List of treatment run IDs for comparison. Required.""" @overload def __init__( self, *, - input_tokens: int, - output_tokens: int, - total_tokens: int, + eval_id: str, + baseline_run_id: str, + treatment_run_ids: list[str], ) -> None: ... @overload @@ -6771,54 +6804,37 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = InsightType.EVALUATION_COMPARISON # type: ignore -class EvaluatorMetric(_Model): - """Evaluator Metric. +class EvaluationComparisonInsightResult( + InsightResult, discriminator="EvaluationComparison" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Insights from the evaluation comparison. - :ivar type: Type of the metric. Known values are: "ordinal", "continuous", and "boolean". - :vartype type: str or ~azure.ai.projects.models.EvaluatorMetricType - :ivar desirable_direction: It indicates whether a higher value is better or a lower value is - better for this metric. Known values are: "increase", "decrease", and "neutral". - :vartype desirable_direction: str or ~azure.ai.projects.models.EvaluatorMetricDirection - :ivar min_value: Minimum value for the metric. - :vartype min_value: float - :ivar max_value: Maximum value for the metric. If not specified, it is assumed to be unbounded. - :vartype max_value: float - :ivar threshold: Default pass/fail threshold for this metric. - :vartype threshold: float - :ivar is_primary: Indicates if this metric is primary when there are multiple metrics. - :vartype is_primary: bool + :ivar type: The type of insights result. Required. Evaluation Comparison. + :vartype type: str or ~azure.ai.projects.models.EVALUATION_COMPARISON + :ivar comparisons: Comparison results for each treatment run against the baseline. Required. + :vartype comparisons: list[~azure.ai.projects.models.EvalRunResultComparison] + :ivar method: The statistical method used for comparison. Required. + :vartype method: str """ - type: Optional[Union[str, "_models.EvaluatorMetricType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Type of the metric. Known values are: \"ordinal\", \"continuous\", and \"boolean\".""" - desirable_direction: Optional[Union[str, "_models.EvaluatorMetricDirection"]] = rest_field( + type: Literal[InsightType.EVALUATION_COMPARISON] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of insights result. Required. Evaluation Comparison.""" + comparisons: list["_models.EvalRunResultComparison"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """It indicates whether a higher value is better or a lower value is better for this metric. Known - values are: \"increase\", \"decrease\", and \"neutral\".""" - min_value: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Minimum value for the metric.""" - max_value: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Maximum value for the metric. If not specified, it is assumed to be unbounded.""" - threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Default pass/fail threshold for this metric.""" - is_primary: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Indicates if this metric is primary when there are multiple metrics.""" + """Comparison results for each treatment run against the baseline. Required.""" + method: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The statistical method used for comparison. Required.""" @overload def __init__( self, *, - type: Optional[Union[str, "_models.EvaluatorMetricType"]] = None, - desirable_direction: Optional[Union[str, "_models.EvaluatorMetricDirection"]] = None, - min_value: Optional[float] = None, - max_value: Optional[float] = None, - threshold: Optional[float] = None, - is_primary: Optional[bool] = None, + comparisons: list["_models.EvalRunResultComparison"], + method: str, ) -> None: ... @overload @@ -6830,124 +6846,45 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = InsightType.EVALUATION_COMPARISON # type: ignore -class EvaluatorVersion(_Model): - """Evaluator Definition. +class InsightSample(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A sample from the analysis. - :ivar display_name: Display Name for evaluator. It helps to find the evaluator easily in AI - Foundry. It does not need to be unique. - :vartype display_name: str - :ivar metadata: Metadata about the evaluator. - :vartype metadata: dict[str, str] - :ivar evaluator_type: The type of the evaluator. Required. Known values are: "builtin" and - "custom". - :vartype evaluator_type: str or ~azure.ai.projects.models.EvaluatorType - :ivar categories: The categories of the evaluator. Required. - :vartype categories: list[str or ~azure.ai.projects.models.EvaluatorCategory] - :ivar supported_evaluation_levels: Evaluation levels this evaluator supports (e.g., ``turn``, - ``conversation``). When omitted on create, the service defaults to ``["turn"]``. On update, - omitting this field leaves it unchanged; an empty list is rejected. Custom code-based - evaluators support only ``turn``; custom prompt-based evaluators support exactly one level - (``turn`` or ``conversation``). - :vartype supported_evaluation_levels: list[str or ~azure.ai.projects.models.EvaluationLevel] - :ivar definition: Definition of the evaluator. Required. - :vartype definition: ~azure.ai.projects.models.EvaluatorDefinition - :ivar generation_artifacts: Provenance artifacts from the generation pipeline. Read-only; - present only on evaluator versions created via an EvaluatorGenerationJob. Each artifact - resolves to a versioned Foundry Dataset. - :vartype generation_artifacts: ~azure.ai.projects.models.EvaluatorGenerationArtifacts - :ivar generation_job_id: Read-only provenance link back to the EvaluatorGenerationJob that - produced this version. Present only on evaluator versions created via the generation pipeline; - absent for manually-created versions and unaffected by subsequent ``PATCH`` calls. - :vartype generation_job_id: str - :ivar warnings: Categories of warnings surfaced on this generated evaluator version. Present - only on versions created via an EvaluatorGenerationJob when the paired job produced non-empty - warnings. Absent (treat as no warnings) when the version is not from generation, when the - paired job was clean, or when a subsequent ``PATCH`` to ``definition`` cleared the paired job's - advisories. Follow ``generation_job_id`` to fetch the detailed warning payloads. - :vartype warnings: list[str or ~azure.ai.projects.models.GenerationWarningType] - :ivar created_by: Creator of the evaluator. Required. - :vartype created_by: str - :ivar created_at: Creation date/time of the evaluator. Required. - :vartype created_at: ~datetime.datetime - :ivar modified_at: Last modified date/time of the evaluator. Required. - :vartype modified_at: ~datetime.datetime - :ivar id: Asset ID, a unique identifier for the asset. + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + EvaluationResultSample + + :ivar id: The unique identifier for the analysis sample. Required. :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: Sample type. Required. "EvaluationResultSample" + :vartype type: str or ~azure.ai.projects.models.SampleType + :ivar features: Features to help with additional filtering of data in UX. Required. + :vartype features: dict[str, any] + :ivar correlation_info: Info about the correlation for the analysis sample. Required. + :vartype correlation_info: dict[str, any] """ - display_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not - need to be unique.""" - metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Metadata about the evaluator.""" - evaluator_type: Union[str, "_models.EvaluatorType"] = rest_field(visibility=["read", "create"]) - """The type of the evaluator. Required. Known values are: \"builtin\" and \"custom\".""" - categories: list[Union[str, "_models.EvaluatorCategory"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The categories of the evaluator. Required.""" - supported_evaluation_levels: Optional[list[Union[str, "_models.EvaluationLevel"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + __mapping__: dict[str, _Model] = {} + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier for the analysis sample. Required.""" + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Sample type. Required. \"EvaluationResultSample\"""" + features: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Features to help with additional filtering of data in UX. Required.""" + correlation_info: dict[str, Any] = rest_field( + name="correlationInfo", visibility=["read", "create", "update", "delete", "query"] ) - """Evaluation levels this evaluator supports (e.g., ``turn``, ``conversation``). When omitted on - create, the service defaults to ``[\"turn\"]``. On update, omitting this field leaves it - unchanged; an empty list is rejected. Custom code-based evaluators support only ``turn``; - custom prompt-based evaluators support exactly one level (``turn`` or ``conversation``).""" - definition: "_models.EvaluatorDefinition" = rest_field(visibility=["read", "create"]) - """Definition of the evaluator. Required.""" - generation_artifacts: Optional["_models.EvaluatorGenerationArtifacts"] = rest_field(visibility=["read"]) - """Provenance artifacts from the generation pipeline. Read-only; present only on evaluator - versions created via an EvaluatorGenerationJob. Each artifact resolves to a versioned Foundry - Dataset.""" - generation_job_id: Optional[str] = rest_field(visibility=["read"]) - """Read-only provenance link back to the EvaluatorGenerationJob that produced this version. - Present only on evaluator versions created via the generation pipeline; absent for - manually-created versions and unaffected by subsequent ``PATCH`` calls.""" - warnings: Optional[list[Union[str, "_models.GenerationWarningType"]]] = rest_field(visibility=["read"]) - """Categories of warnings surfaced on this generated evaluator version. Present only on versions - created via an EvaluatorGenerationJob when the paired job produced non-empty warnings. Absent - (treat as no warnings) when the version is not from generation, when the paired job was clean, - or when a subsequent ``PATCH`` to ``definition`` cleared the paired job's advisories. Follow - ``generation_job_id`` to fetch the detailed warning payloads.""" - created_by: str = rest_field(visibility=["read"]) - """Creator of the evaluator. Required.""" - created_at: datetime.datetime = rest_field(visibility=["read"], format="rfc3339") - """Creation date/time of the evaluator. Required.""" - modified_at: datetime.datetime = rest_field(visibility=["read"], format="rfc3339") - """Last modified date/time of the evaluator. Required.""" - 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=["create", "update"]) - """The asset description text.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["create", "update"]) - """Tag dictionary. Tags can be added, removed, and updated.""" + """Info about the correlation for the analysis sample. Required.""" @overload def __init__( self, *, - evaluator_type: Union[str, "_models.EvaluatorType"], - categories: list[Union[str, "_models.EvaluatorCategory"]], - definition: "_models.EvaluatorDefinition", - display_name: Optional[str] = None, - metadata: Optional[dict[str, str]] = None, - supported_evaluation_levels: Optional[list[Union[str, "_models.EvaluationLevel"]]] = None, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, + id: str, # pylint: disable=redefined-builtin + type: str, + features: dict[str, Any], + correlation_info: dict[str, Any], ) -> None: ... @overload @@ -6961,40 +6898,38 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ExternalAgentDefinition(AgentDefinition, discriminator="external"): - """The external agent definition. Represents a third-party agent hosted outside Foundry (for - example, on GCP or AWS). Registration is metadata-only: Foundry records the agent definition to - light up observability experiences (traces, evaluations) over customer-emitted OpenTelemetry - data. +class EvaluationResultSample( + InsightSample, discriminator="EvaluationResultSample" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A sample from the evaluation result. - :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. - :vartype rai_config: ~azure.ai.projects.models.RaiConfig - :ivar kind: Required. EXTERNAL. - :vartype kind: str or ~azure.ai.projects.models.EXTERNAL - :ivar otel_agent_id: The OpenTelemetry agent identifier used to attribute customer-emitted - spans to this Foundry agent. Spans must include the attribute ``gen_ai.agent.id = - `` to appear under this registration. Defaults to the top-level agent name when - omitted. Provide an explicit value only for migration scenarios where the running external - agent already emits a stable id that differs from the Foundry agent name. The resolved value is - always echoed on read. - :vartype otel_agent_id: str + :ivar id: The unique identifier for the analysis sample. Required. + :vartype id: str + :ivar features: Features to help with additional filtering of data in UX. Required. + :vartype features: dict[str, any] + :ivar correlation_info: Info about the correlation for the analysis sample. Required. + :vartype correlation_info: dict[str, any] + :ivar type: Evaluation Result Sample Type. Required. A sample from the evaluation result. + :vartype type: str or ~azure.ai.projects.models.EVALUATION_RESULT_SAMPLE + :ivar evaluation_result: Evaluation result for the analysis sample. Required. + :vartype evaluation_result: ~azure.ai.projects.models.EvalResult """ - kind: Literal[AgentKind.EXTERNAL] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. EXTERNAL.""" - otel_agent_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The OpenTelemetry agent identifier used to attribute customer-emitted spans to this Foundry - agent. Spans must include the attribute ``gen_ai.agent.id = `` to appear under - this registration. Defaults to the top-level agent name when omitted. Provide an explicit value - only for migration scenarios where the running external agent already emits a stable id that - differs from the Foundry agent name. The resolved value is always echoed on read.""" + type: Literal[SampleType.EVALUATION_RESULT_SAMPLE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Evaluation Result Sample Type. Required. A sample from the evaluation result.""" + evaluation_result: "_models.EvalResult" = rest_field( + name="evaluationResult", visibility=["read", "create", "update", "delete", "query"] + ) + """Evaluation result for the analysis sample. Required.""" @overload def __init__( self, *, - rai_config: Optional["_models.RaiConfig"] = None, - otel_agent_id: Optional[str] = None, + id: str, # pylint: disable=redefined-builtin + features: dict[str, Any], + correlation_info: dict[str, Any], + evaluation_result: "_models.EvalResult", ) -> None: ... @overload @@ -7006,28 +6941,65 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = AgentKind.EXTERNAL # type: ignore + self.type = SampleType.EVALUATION_RESULT_SAMPLE # type: ignore -class FabricDataAgentToolParameters(_Model): - """The fabric data agent tool parameters. +class EvaluationRule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Evaluation rule model. - :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 id: Unique identifier for the evaluation rule. Required. + :vartype id: str + :ivar display_name: Display Name for the evaluation rule. + :vartype display_name: str + :ivar description: Description for the evaluation rule. + :vartype description: str + :ivar action: Definition of the evaluation rule action. Required. + :vartype action: ~azure.ai.projects.models.EvaluationRuleAction + :ivar filter: Filter condition of the evaluation rule. + :vartype filter: ~azure.ai.projects.models.EvaluationRuleFilter + :ivar event_type: Event type that the evaluation rule applies to. Required. Known values are: + "responseCompleted" and "manual". + :vartype event_type: str or ~azure.ai.projects.models.EvaluationRuleEventType + :ivar enabled: Indicates whether the evaluation rule is enabled. Default is true. Required. + :vartype enabled: bool + :ivar system_data: System metadata for the evaluation rule. Required. + :vartype system_data: dict[str, str] """ - project_connections: Optional[list["_models.ToolProjectConnection"]] = rest_field( + id: str = rest_field(visibility=["read"]) + """Unique identifier for the evaluation rule. Required.""" + display_name: Optional[str] = rest_field( + name="displayName", visibility=["read", "create", "update", "delete", "query"] + ) + """Display Name for the evaluation rule.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Description for the evaluation rule.""" + action: "_models.EvaluationRuleAction" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Definition of the evaluation rule action. Required.""" + filter: Optional["_models.EvaluationRuleFilter"] = 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.""" + """Filter condition of the evaluation rule.""" + event_type: Union[str, "_models.EvaluationRuleEventType"] = rest_field( + name="eventType", visibility=["read", "create", "update", "delete", "query"] + ) + """Event type that the evaluation rule applies to. Required. Known values are: + \"responseCompleted\" and \"manual\".""" + enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Indicates whether the evaluation rule is enabled. Default is true. Required.""" + system_data: dict[str, str] = rest_field(name="systemData", visibility=["read"]) + """System metadata for the evaluation rule. Required.""" @overload def __init__( self, *, - project_connections: Optional[list["_models.ToolProjectConnection"]] = None, + action: "_models.EvaluationRuleAction", + event_type: Union[str, "_models.EvaluationRuleEventType"], + enabled: bool, + display_name: Optional[str] = None, + description: Optional[str] = None, + filter: Optional["_models.EvaluationRuleFilter"] = None, # pylint: disable=redefined-builtin ) -> None: ... @overload @@ -7041,46 +7013,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class FabricIQPreviewTool(Tool, discriminator="fabric_iq_preview"): - """A FabricIQ server-side tool. +class EvaluationRuleFilter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Evaluation filter model. - :ivar type: The object type, which is always 'fabric_iq_preview'. Required. FABRIC_IQ_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.FABRIC_IQ_PREVIEW - :ivar project_connection_id: The ID of the FabricIQ project connection. Required. - :vartype project_connection_id: str - :ivar server_label: (Optional) The label of the FabricIQ MCP server to connect to. - :vartype server_label: str - :ivar server_url: (Optional) The URL of the FabricIQ MCP server. If not provided, the URL from - the project connection will be used. - :vartype server_url: str - :ivar require_approval: (Optional) Whether the agent requires approval before executing - actions. Default is always. Is either a MCPToolRequireApproval type or a str type. - :vartype require_approval: ~azure.ai.projects.models.MCPToolRequireApproval or str + :ivar agent_name: Filter by agent name. Required. + :vartype agent_name: str """ - type: Literal[ToolType.FABRIC_IQ_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'fabric_iq_preview'. Required. FABRIC_IQ_PREVIEW.""" - project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the FabricIQ project connection. Required.""" - server_label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """(Optional) The label of the FabricIQ MCP server to connect to.""" - server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """(Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project - connection will be used.""" - require_approval: Optional[Union["_models.MCPToolRequireApproval", str]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """(Optional) Whether the agent requires approval before executing actions. Default is always. Is - either a MCPToolRequireApproval type or a str type.""" + agent_name: str = rest_field(name="agentName", visibility=["read", "create", "update", "delete", "query"]) + """Filter by agent name. Required.""" @overload def __init__( self, *, - project_connection_id: str, - server_label: Optional[str] = None, - server_url: Optional[str] = None, - require_approval: Optional[Union["_models.MCPToolRequireApproval", str]] = None, + agent_name: str, ) -> None: ... @overload @@ -7092,60 +7039,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_IQ_PREVIEW # type: ignore -class FabricIQPreviewToolboxTool(ToolboxTool, discriminator="fabric_iq_preview"): - """A FabricIQ tool stored in a toolbox. +class EvaluationRunClusterInsightRequest( + InsightRequest, discriminator="EvaluationRunClusterInsight" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Insights on set of Evaluation Results. - :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. FABRIC_IQ_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.FABRIC_IQ_PREVIEW - :ivar project_connection_id: The ID of the FabricIQ project connection. Required. - :vartype project_connection_id: str - :ivar server_label: (Optional) The label of the FabricIQ MCP server to connect to. - :vartype server_label: str - :ivar server_url: (Optional) The URL of the FabricIQ MCP server. If not provided, the URL from - the project connection will be used. - :vartype server_url: str - :ivar require_approval: (Optional) Whether the agent requires approval before executing - actions. Default is always. Is either a MCPToolRequireApproval type or a str type. - :vartype require_approval: ~azure.ai.projects.models.MCPToolRequireApproval or str + :ivar type: The type of insights request. Required. Insights on an Evaluation run result. + :vartype type: str or ~azure.ai.projects.models.EVALUATION_RUN_CLUSTER_INSIGHT + :ivar eval_id: Evaluation Id for the insights. Required. + :vartype eval_id: str + :ivar run_ids: List of evaluation run IDs for the insights. Required. + :vartype run_ids: list[str] + :ivar model_configuration: Configuration of the model used in the insight generation. + :vartype model_configuration: ~azure.ai.projects.models.InsightModelConfiguration """ - type: Literal[ToolboxToolType.FABRIC_IQ_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. FABRIC_IQ_PREVIEW.""" - project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the FabricIQ project connection. Required.""" - server_label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """(Optional) The label of the FabricIQ MCP server to connect to.""" - server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """(Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project - connection will be used.""" - require_approval: Optional[Union["_models.MCPToolRequireApproval", str]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of insights request. Required. Insights on an Evaluation run result.""" + eval_id: str = rest_field(name="evalId", visibility=["read", "create", "update", "delete", "query"]) + """Evaluation Id for the insights. Required.""" + run_ids: list[str] = rest_field(name="runIds", visibility=["read", "create", "update", "delete", "query"]) + """List of evaluation run IDs for the insights. Required.""" + model_configuration: Optional["_models.InsightModelConfiguration"] = rest_field( + name="modelConfiguration", visibility=["read", "create", "update", "delete", "query"] ) - """(Optional) Whether the agent requires approval before executing actions. Default is always. Is - either a MCPToolRequireApproval type or a str type.""" + """Configuration of the model used in the insight generation.""" @overload def __init__( self, *, - project_connection_id: str, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, - server_label: Optional[str] = None, - server_url: Optional[str] = None, - require_approval: Optional[Union["_models.MCPToolRequireApproval", str]] = None, + eval_id: str, + run_ids: list[str], + model_configuration: Optional["_models.InsightModelConfiguration"] = None, ) -> None: ... @overload @@ -7157,31 +7085,883 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolboxToolType.FABRIC_IQ_PREVIEW # type: ignore + self.type = InsightType.EVALUATION_RUN_CLUSTER_INSIGHT # type: ignore -class FieldMapping(_Model): - """Field mapping configuration class. +class EvaluationRunClusterInsightResult( + InsightResult, discriminator="EvaluationRunClusterInsight" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Insights from the evaluation run cluster analysis. - :ivar content_fields: List of fields with text content. Required. - :vartype content_fields: list[str] - :ivar filepath_field: Path of file to be used as a source of text content. - :vartype filepath_field: str - :ivar title_field: Field containing the title of the document. - :vartype title_field: str - :ivar url_field: Field containing the url of the document. - :vartype url_field: str - :ivar vector_fields: List of fields with vector content. - :vartype vector_fields: list[str] - :ivar metadata_fields: List of fields with metadata content. - :vartype metadata_fields: list[str] + :ivar type: The type of insights result. Required. Insights on an Evaluation run result. + :vartype type: str or ~azure.ai.projects.models.EVALUATION_RUN_CLUSTER_INSIGHT + :ivar cluster_insight: Required. + :vartype cluster_insight: ~azure.ai.projects.models.ClusterInsightResult """ - content_fields: list[str] = rest_field(name="contentFields", visibility=["create"]) - """List of fields with text content. Required.""" - filepath_field: Optional[str] = rest_field(name="filepathField", visibility=["create"]) - """Path of file to be used as a source of text content.""" - title_field: Optional[str] = rest_field(name="titleField", visibility=["create"]) + type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of insights result. Required. Insights on an Evaluation run result.""" + cluster_insight: "_models.ClusterInsightResult" = rest_field( + name="clusterInsight", visibility=["read", "create", "update", "delete", "query"] + ) + """Required.""" + + @overload + def __init__( + self, + *, + cluster_insight: "_models.ClusterInsightResult", + ) -> 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 = InsightType.EVALUATION_RUN_CLUSTER_INSIGHT # type: ignore + + +class ScheduleTask(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Schedule task model. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + EvaluationScheduleTask, InsightScheduleTask + + :ivar type: Type of the task. Required. Known values are: "Evaluation" and "Insight". + :vartype type: str or ~azure.ai.projects.models.ScheduleTaskType + :ivar configuration: Configuration for the task. + :vartype configuration: dict[str, str] + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Type of the task. Required. Known values are: \"Evaluation\" and \"Insight\".""" + configuration: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Configuration for the task.""" + + @overload + def __init__( + self, + *, + type: str, + configuration: 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 EvaluationScheduleTask( + ScheduleTask, discriminator="Evaluation" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Evaluation task for the schedule. + + :ivar configuration: Configuration for the task. + :vartype configuration: dict[str, str] + :ivar type: Required. Evaluation task. + :vartype type: str or ~azure.ai.projects.models.EVALUATION + :ivar eval_id: Identifier of the evaluation group. Required. + :vartype eval_id: str + :ivar eval_run: The evaluation run payload. Required. + :vartype eval_run: dict[str, any] + """ + + type: Literal[ScheduleTaskType.EVALUATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Evaluation task.""" + eval_id: str = rest_field(name="evalId", visibility=["read", "create", "update", "delete", "query"]) + """Identifier of the evaluation group. Required.""" + eval_run: dict[str, Any] = rest_field(name="evalRun", visibility=["read", "create", "update", "delete", "query"]) + """The evaluation run payload. Required.""" + + @overload + def __init__( + self, + *, + eval_id: str, + eval_run: dict[str, Any], + configuration: 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 = ScheduleTaskType.EVALUATION # type: ignore + + +class EvaluationTaxonomy(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Evaluation Taxonomy 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 taxonomy_input: Input configuration for the evaluation taxonomy. Required. + :vartype taxonomy_input: ~azure.ai.projects.models.EvaluationTaxonomyInput + :ivar taxonomy_categories: List of taxonomy categories. + :vartype taxonomy_categories: list[~azure.ai.projects.models.TaxonomyCategory] + :ivar properties: Additional properties for the evaluation taxonomy. + :vartype properties: dict[str, str] + """ + + 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=["create", "update"]) + """The asset description text.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["create", "update"]) + """Tag dictionary. Tags can be added, removed, and updated.""" + taxonomy_input: "_models.EvaluationTaxonomyInput" = rest_field( + name="taxonomyInput", visibility=["read", "create", "update", "delete", "query"] + ) + """Input configuration for the evaluation taxonomy. Required.""" + taxonomy_categories: Optional[list["_models.TaxonomyCategory"]] = rest_field( + name="taxonomyCategories", visibility=["read", "create", "update", "delete", "query"] + ) + """List of taxonomy categories.""" + properties: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Additional properties for the evaluation taxonomy.""" + + @overload + def __init__( + self, + *, + taxonomy_input: "_models.EvaluationTaxonomyInput", + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, + taxonomy_categories: Optional[list["_models.TaxonomyCategory"]] = 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 EvaluatorCredentialRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Request body for getting evaluator credentials. + + :ivar blob_uri: The blob URI for the evaluator storage. Example: + ``https://account.blob.core.windows.net:443/container``. Required. + :vartype blob_uri: str + """ + + blob_uri: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The blob URI for the evaluator storage. Example: + ``https://account.blob.core.windows.net:443/container``. Required.""" + + @overload + def __init__( + self, + *, + blob_uri: 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 EvaluatorGenerationArtifacts(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Service-managed provenance artifacts produced by an evaluator generation job. Present only on + EvaluatorVersion resources created via the generation pipeline. The combined-JSONL Foundry + Dataset is read-only and resolves to a versioned dataset in a service-reserved namespace. + + :ivar dataset: Reference to the single Foundry Dataset (one combined JSONL file, + version-aligned to ``EvaluatorVersion.version``) holding all artifacts produced by the + generation pipeline. Each row in the JSONL carries a ``kind`` field discriminating its content + (e.g. ``spec``, ``tools``, ``context``). Required. + :vartype dataset: ~azure.ai.projects.models.DatasetReference + :ivar kinds: The kinds of rows present in ``dataset``. Always contains ``"spec"`` (the + generated evaluation specification, a Markdown document describing what the evaluator + measures). May additionally contain ``"tools"`` (when the generation pipeline produced or + inferred OpenAI tool schemas) and/or ``"context"`` (when supplementary materials such as file + uploads or trace samples were used during generation). Required. + :vartype kinds: list[str] + """ + + dataset: "_models.DatasetReference" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Reference to the single Foundry Dataset (one combined JSONL file, version-aligned to + ``EvaluatorVersion.version``) holding all artifacts produced by the generation pipeline. Each + row in the JSONL carries a ``kind`` field discriminating its content (e.g. ``spec``, ``tools``, + ``context``). Required.""" + kinds: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The kinds of rows present in ``dataset``. Always contains ``\"spec\"`` (the generated + evaluation specification, a Markdown document describing what the evaluator measures). May + additionally contain ``\"tools\"`` (when the generation pipeline produced or inferred OpenAI + tool schemas) and/or ``\"context\"`` (when supplementary materials such as file uploads or + trace samples were used during generation). Required.""" + + @overload + def __init__( + self, + *, + dataset: "_models.DatasetReference", + kinds: list[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 EvaluatorGenerationInputs(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Caller-supplied inputs for an evaluator generation job. + + :ivar sources: Source materials for generation — agent descriptions, prompts, traces, or + datasets. Each entry is an ``EvaluatorGenerationJobSource`` variant discriminated by ``type``. + Required. + :vartype sources: list[~azure.ai.projects.models.EvaluatorGenerationJobSource] + :ivar model: The LLM model to use for rubric generation (e.g., 'gpt-4o'). Required — users must + provide their own model rather than relying on service-owned capacity. Required. + :vartype model: str + :ivar evaluator_name: The evaluator name (immutable identifier). 1-256 characters; allowed + characters are ASCII letters, digits, underscore (``_``), period (``.``), tilde (``~``), and + hyphen (``-``). The prefix ``builtin.`` is reserved for system-managed evaluators and is + rejected by the service. If an evaluator with this name already exists in the project (and is + rubric-subtype), the service creates a new version under the same name and uses the prior + version's ``dimensions`` as context for incremental improvement (foundation of the post-//build + adaptive loop). Old versions remain queryable via ``get_version(name, version)``. If the + existing evaluator is not a rubric-subtype evaluator (built-in, prompt-based, code-based), the + request is rejected with ``400 Bad Request``. Required. + :vartype evaluator_name: str + :ivar evaluator_display_name: Optional human-friendly display name for the resulting evaluator. + Surfaced as ``EvaluatorVersion.display_name`` on the persisted evaluator. When omitted, the + service uses ``evaluator_name`` as the display name. The ``evaluator_`` prefix disambiguates + this from the immutable ``evaluator_name`` identifier. + :vartype evaluator_display_name: str + :ivar evaluator_description: Optional human-friendly description for the resulting evaluator. + Surfaced as ``EvaluatorVersion.description`` on the persisted evaluator. Typically collected + from the UI alongside ``evaluator_display_name``. The ``evaluator_`` prefix disambiguates this + from any other description fields on related models. + :vartype evaluator_description: str + """ + + sources: list["_models.EvaluatorGenerationJobSource"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Source materials for generation — agent descriptions, prompts, traces, or datasets. Each entry + is an ``EvaluatorGenerationJobSource`` variant discriminated by ``type``. Required.""" + model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The LLM model to use for rubric generation (e.g., 'gpt-4o'). Required — users must provide + their own model rather than relying on service-owned capacity. Required.""" + evaluator_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The evaluator name (immutable identifier). 1-256 characters; allowed characters are ASCII + letters, digits, underscore (``_``), period (``.``), tilde (``~``), and hyphen (``-``). The + prefix ``builtin.`` is reserved for system-managed evaluators and is rejected by the service. + If an evaluator with this name already exists in the project (and is rubric-subtype), the + service creates a new version under the same name and uses the prior version's ``dimensions`` + as context for incremental improvement (foundation of the post-//build adaptive loop). Old + versions remain queryable via ``get_version(name, version)``. If the existing evaluator is not + a rubric-subtype evaluator (built-in, prompt-based, code-based), the request is rejected with + ``400 Bad Request``. Required.""" + evaluator_display_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional human-friendly display name for the resulting evaluator. Surfaced as + ``EvaluatorVersion.display_name`` on the persisted evaluator. When omitted, the service uses + ``evaluator_name`` as the display name. The ``evaluator_`` prefix disambiguates this from the + immutable ``evaluator_name`` identifier.""" + evaluator_description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional human-friendly description for the resulting evaluator. Surfaced as + ``EvaluatorVersion.description`` on the persisted evaluator. Typically collected from the UI + alongside ``evaluator_display_name``. The ``evaluator_`` prefix disambiguates this from any + other description fields on related models.""" + + @overload + def __init__( + self, + *, + sources: list["_models.EvaluatorGenerationJobSource"], + model: str, + evaluator_name: str, + evaluator_display_name: Optional[str] = None, + evaluator_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 EvaluatorGenerationJob(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Evaluator Generation Job resource — a long-running job that generates rubric-based evaluator + definitions from source materials. On success, the result is the persisted EvaluatorVersion. + + :ivar id: Server-assigned unique identifier. Required. + :vartype id: str + :ivar inputs: Caller-supplied inputs. + :vartype inputs: ~azure.ai.projects.models.EvaluatorGenerationInputs + :ivar result: Result produced on success. + :vartype result: ~azure.ai.projects.models.EvaluatorVersion + :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 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 finished, represented in Unix time (seconds since + January 1, 1970). + :vartype finished_at: ~datetime.datetime + :ivar usage: Token consumption summary. Populated when the job reaches a terminal state. + :vartype usage: ~azure.ai.projects.models.EvaluatorGenerationTokenUsage + :ivar input_quality_warnings: Non-fatal input-quality advisories produced by the generation + pipeline. Read-only; service-generated; populated only on terminal jobs when advisories fired. + Omitted when generation was clean. Cleared when a subsequent ``PATCH`` to the paired + ``EvaluatorVersion.definition`` invalidates the advisories. + :vartype input_quality_warnings: + list[~azure.ai.projects.models.RubricGenerationInputQualityWarning] + """ + + id: str = rest_field(visibility=["read"]) + """Server-assigned unique identifier. Required.""" + inputs: Optional["_models.EvaluatorGenerationInputs"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Caller-supplied inputs.""" + result: Optional["_models.EvaluatorVersion"] = rest_field(visibility=["read"]) + """Result produced on success.""" + status: Union[str, "_models.JobStatus"] = rest_field(visibility=["read"]) + """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", + \"succeeded\", \"failed\", and \"cancelled\".""" + error: Optional["_models.ApiError"] = rest_field(visibility=["read"]) + """Error details — populated only on failure.""" + created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The timestamp when the job was created, represented in Unix time (seconds since January 1, + 1970). Required.""" + finished_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") + """The timestamp when the job finished, represented in Unix time (seconds since January 1, 1970).""" + usage: Optional["_models.EvaluatorGenerationTokenUsage"] = rest_field(visibility=["read"]) + """Token consumption summary. Populated when the job reaches a terminal state.""" + input_quality_warnings: Optional[list["_models.RubricGenerationInputQualityWarning"]] = rest_field( + visibility=["read"] + ) + """Non-fatal input-quality advisories produced by the generation pipeline. Read-only; + service-generated; populated only on terminal jobs when advisories fired. Omitted when + generation was clean. Cleared when a subsequent ``PATCH`` to the paired + ``EvaluatorVersion.definition`` invalidates the advisories.""" + + @overload + def __init__( + self, + *, + inputs: Optional["_models.EvaluatorGenerationInputs"] = 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 EvaluatorGenerationTokenUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Token consumption summary for an evaluator generation job. Populated when the job reaches a + terminal state. + + :ivar input_tokens: Number of input (prompt) tokens consumed. Required. + :vartype input_tokens: int + :ivar output_tokens: Number of output (completion) tokens generated. Required. + :vartype output_tokens: int + :ivar total_tokens: Total tokens consumed (input + output). Required. + :vartype total_tokens: int + """ + + input_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Number of input (prompt) tokens consumed. Required.""" + output_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Number of output (completion) tokens generated. Required.""" + total_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Total tokens consumed (input + output). Required.""" + + @overload + def __init__( + self, + *, + input_tokens: int, + output_tokens: int, + total_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 EvaluatorMetric(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Evaluator Metric. + + :ivar type: Type of the metric. Known values are: "ordinal", "continuous", and "boolean". + :vartype type: str or ~azure.ai.projects.models.EvaluatorMetricType + :ivar desirable_direction: It indicates whether a higher value is better or a lower value is + better for this metric. Known values are: "increase", "decrease", and "neutral". + :vartype desirable_direction: str or ~azure.ai.projects.models.EvaluatorMetricDirection + :ivar min_value: Minimum value for the metric. + :vartype min_value: float + :ivar max_value: Maximum value for the metric. If not specified, it is assumed to be unbounded. + :vartype max_value: float + :ivar threshold: Default pass/fail threshold for this metric. + :vartype threshold: float + :ivar is_primary: Indicates if this metric is primary when there are multiple metrics. + :vartype is_primary: bool + """ + + type: Optional[Union[str, "_models.EvaluatorMetricType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Type of the metric. Known values are: \"ordinal\", \"continuous\", and \"boolean\".""" + desirable_direction: Optional[Union[str, "_models.EvaluatorMetricDirection"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """It indicates whether a higher value is better or a lower value is better for this metric. Known + values are: \"increase\", \"decrease\", and \"neutral\".""" + min_value: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Minimum value for the metric.""" + max_value: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Maximum value for the metric. If not specified, it is assumed to be unbounded.""" + threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Default pass/fail threshold for this metric.""" + is_primary: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Indicates if this metric is primary when there are multiple metrics.""" + + @overload + def __init__( + self, + *, + type: Optional[Union[str, "_models.EvaluatorMetricType"]] = None, + desirable_direction: Optional[Union[str, "_models.EvaluatorMetricDirection"]] = None, + min_value: Optional[float] = None, + max_value: Optional[float] = None, + threshold: Optional[float] = None, + is_primary: 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 EvaluatorVersion(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Evaluator Definition. + + :ivar display_name: Display Name for evaluator. It helps to find the evaluator easily in AI + Foundry. It does not need to be unique. + :vartype display_name: str + :ivar metadata: Metadata about the evaluator. + :vartype metadata: dict[str, str] + :ivar evaluator_type: The type of the evaluator. Required. Known values are: "builtin" and + "custom". + :vartype evaluator_type: str or ~azure.ai.projects.models.EvaluatorType + :ivar categories: The categories of the evaluator. Required. + :vartype categories: list[str or ~azure.ai.projects.models.EvaluatorCategory] + :ivar supported_evaluation_levels: Evaluation levels this evaluator supports (e.g., ``turn``, + ``conversation``). When omitted on create, the service defaults to ``["turn"]``. On update, + omitting this field leaves it unchanged; an empty list is rejected. Custom code-based + evaluators support only ``turn``; custom prompt-based evaluators support exactly one level + (``turn`` or ``conversation``). + :vartype supported_evaluation_levels: list[str or ~azure.ai.projects.models.EvaluationLevel] + :ivar definition: Definition of the evaluator. Required. + :vartype definition: ~azure.ai.projects.models.EvaluatorDefinition + :ivar generation_artifacts: Provenance artifacts from the generation pipeline. Read-only; + present only on evaluator versions created via an EvaluatorGenerationJob. Each artifact + resolves to a versioned Foundry Dataset. + :vartype generation_artifacts: ~azure.ai.projects.models.EvaluatorGenerationArtifacts + :ivar generation_job_id: Read-only provenance link back to the EvaluatorGenerationJob that + produced this version. Present only on evaluator versions created via the generation pipeline; + absent for manually-created versions and unaffected by subsequent ``PATCH`` calls. + :vartype generation_job_id: str + :ivar warnings: Categories of warnings surfaced on this generated evaluator version. Present + only on versions created via an EvaluatorGenerationJob when the paired job produced non-empty + warnings. Absent (treat as no warnings) when the version is not from generation, when the + paired job was clean, or when a subsequent ``PATCH`` to ``definition`` cleared the paired job's + advisories. Follow ``generation_job_id`` to fetch the detailed warning payloads. + :vartype warnings: list[str or ~azure.ai.projects.models.GenerationWarningType] + :ivar created_by: Creator of the evaluator. Required. + :vartype created_by: str + :ivar created_at: Creation date/time of the evaluator. Required. + :vartype created_at: ~datetime.datetime + :ivar modified_at: Last modified date/time of the evaluator. Required. + :vartype modified_at: ~datetime.datetime + :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] + """ + + display_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not + need to be unique.""" + metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Metadata about the evaluator.""" + evaluator_type: Union[str, "_models.EvaluatorType"] = rest_field(visibility=["read", "create"]) + """The type of the evaluator. Required. Known values are: \"builtin\" and \"custom\".""" + categories: list[Union[str, "_models.EvaluatorCategory"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The categories of the evaluator. Required.""" + supported_evaluation_levels: Optional[list[Union[str, "_models.EvaluationLevel"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Evaluation levels this evaluator supports (e.g., ``turn``, ``conversation``). When omitted on + create, the service defaults to ``[\"turn\"]``. On update, omitting this field leaves it + unchanged; an empty list is rejected. Custom code-based evaluators support only ``turn``; + custom prompt-based evaluators support exactly one level (``turn`` or ``conversation``).""" + definition: "_models.EvaluatorDefinition" = rest_field(visibility=["read", "create"]) + """Definition of the evaluator. Required.""" + generation_artifacts: Optional["_models.EvaluatorGenerationArtifacts"] = rest_field(visibility=["read"]) + """Provenance artifacts from the generation pipeline. Read-only; present only on evaluator + versions created via an EvaluatorGenerationJob. Each artifact resolves to a versioned Foundry + Dataset.""" + generation_job_id: Optional[str] = rest_field(visibility=["read"]) + """Read-only provenance link back to the EvaluatorGenerationJob that produced this version. + Present only on evaluator versions created via the generation pipeline; absent for + manually-created versions and unaffected by subsequent ``PATCH`` calls.""" + warnings: Optional[list[Union[str, "_models.GenerationWarningType"]]] = rest_field(visibility=["read"]) + """Categories of warnings surfaced on this generated evaluator version. Present only on versions + created via an EvaluatorGenerationJob when the paired job produced non-empty warnings. Absent + (treat as no warnings) when the version is not from generation, when the paired job was clean, + or when a subsequent ``PATCH`` to ``definition`` cleared the paired job's advisories. Follow + ``generation_job_id`` to fetch the detailed warning payloads.""" + created_by: str = rest_field(visibility=["read"]) + """Creator of the evaluator. Required.""" + created_at: datetime.datetime = rest_field(visibility=["read"], format="rfc3339") + """Creation date/time of the evaluator. Required.""" + modified_at: datetime.datetime = rest_field(visibility=["read"], format="rfc3339") + """Last modified date/time of the evaluator. Required.""" + 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=["create", "update"]) + """The asset description text.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["create", "update"]) + """Tag dictionary. Tags can be added, removed, and updated.""" + + @overload + def __init__( + self, + *, + evaluator_type: Union[str, "_models.EvaluatorType"], + categories: list[Union[str, "_models.EvaluatorCategory"]], + definition: "_models.EvaluatorDefinition", + display_name: Optional[str] = None, + metadata: Optional[dict[str, str]] = None, + supported_evaluation_levels: Optional[list[Union[str, "_models.EvaluationLevel"]]] = None, + 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) + + +class ExternalAgentDefinition( + AgentDefinition, discriminator="external" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The external agent definition. Represents a third-party agent hosted outside Foundry (for + example, on GCP or AWS). Registration is metadata-only: Foundry records the agent definition to + light up observability experiences (traces, evaluations) over customer-emitted OpenTelemetry + data. + + :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. + :vartype rai_config: ~azure.ai.projects.models.RaiConfig + :ivar kind: Required. EXTERNAL. + :vartype kind: str or ~azure.ai.projects.models.EXTERNAL + :ivar otel_agent_id: The OpenTelemetry agent identifier used to attribute customer-emitted + spans to this Foundry agent. Spans must include the attribute ``gen_ai.agent.id = + `` to appear under this registration. Defaults to the top-level agent name when + omitted. Provide an explicit value only for migration scenarios where the running external + agent already emits a stable id that differs from the Foundry agent name. The resolved value is + always echoed on read. + :vartype otel_agent_id: str + """ + + kind: Literal[AgentKind.EXTERNAL] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. EXTERNAL.""" + otel_agent_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The OpenTelemetry agent identifier used to attribute customer-emitted spans to this Foundry + agent. Spans must include the attribute ``gen_ai.agent.id = `` to appear under + this registration. Defaults to the top-level agent name when omitted. Provide an explicit value + only for migration scenarios where the running external agent already emits a stable id that + differs from the Foundry agent name. The resolved value is always echoed on read.""" + + @overload + def __init__( + self, + *, + rai_config: Optional["_models.RaiConfig"] = None, + otel_agent_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.kind = AgentKind.EXTERNAL # type: ignore + + +class FabricDataAgentToolParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The fabric data agent 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 FabricIQPreviewTool( + Tool, discriminator="fabric_iq_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A FabricIQ server-side tool. + + :ivar type: The object type, which is always 'fabric_iq_preview'. Required. FABRIC_IQ_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.FABRIC_IQ_PREVIEW + :ivar project_connection_id: The ID of the FabricIQ project connection. Required. + :vartype project_connection_id: str + :ivar server_label: (Optional) The label of the FabricIQ MCP server to connect to. + :vartype server_label: str + :ivar server_url: (Optional) The URL of the FabricIQ MCP server. If not provided, the URL from + the project connection will be used. + :vartype server_url: str + :ivar require_approval: (Optional) Whether the agent requires approval before executing + actions. Default is always. Is either a MCPToolRequireApproval type or a str type. + :vartype require_approval: ~azure.ai.projects.models.MCPToolRequireApproval or str + """ + + type: Literal[ToolType.FABRIC_IQ_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'fabric_iq_preview'. Required. FABRIC_IQ_PREVIEW.""" + project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the FabricIQ project connection. Required.""" + server_label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """(Optional) The label of the FabricIQ MCP server to connect to.""" + server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """(Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project + connection will be used.""" + require_approval: Optional[Union["_models.MCPToolRequireApproval", str]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """(Optional) Whether the agent requires approval before executing actions. Default is always. Is + either a MCPToolRequireApproval type or a str type.""" + + @overload + def __init__( + self, + *, + project_connection_id: str, + server_label: Optional[str] = None, + server_url: Optional[str] = None, + require_approval: Optional[Union["_models.MCPToolRequireApproval", 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 = ToolType.FABRIC_IQ_PREVIEW # type: ignore + + +class FabricIQPreviewToolboxTool( + ToolboxTool, discriminator="fabric_iq_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A FabricIQ 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. FABRIC_IQ_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.FABRIC_IQ_PREVIEW + :ivar project_connection_id: The ID of the FabricIQ project connection. Required. + :vartype project_connection_id: str + :ivar server_label: (Optional) The label of the FabricIQ MCP server to connect to. + :vartype server_label: str + :ivar server_url: (Optional) The URL of the FabricIQ MCP server. If not provided, the URL from + the project connection will be used. + :vartype server_url: str + :ivar require_approval: (Optional) Whether the agent requires approval before executing + actions. Default is always. Is either a MCPToolRequireApproval type or a str type. + :vartype require_approval: ~azure.ai.projects.models.MCPToolRequireApproval or str + """ + + type: Literal[ToolboxToolType.FABRIC_IQ_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. FABRIC_IQ_PREVIEW.""" + project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the FabricIQ project connection. Required.""" + server_label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """(Optional) The label of the FabricIQ MCP server to connect to.""" + server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """(Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project + connection will be used.""" + require_approval: Optional[Union["_models.MCPToolRequireApproval", str]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """(Optional) Whether the agent requires approval before executing actions. Default is always. Is + either a MCPToolRequireApproval type or a str type.""" + + @overload + def __init__( + self, + *, + project_connection_id: str, + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + server_label: Optional[str] = None, + server_url: Optional[str] = None, + require_approval: Optional[Union["_models.MCPToolRequireApproval", 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 = ToolboxToolType.FABRIC_IQ_PREVIEW # type: ignore + + +class FieldMapping(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Field mapping configuration class. + + :ivar content_fields: List of fields with text content. Required. + :vartype content_fields: list[str] + :ivar filepath_field: Path of file to be used as a source of text content. + :vartype filepath_field: str + :ivar title_field: Field containing the title of the document. + :vartype title_field: str + :ivar url_field: Field containing the url of the document. + :vartype url_field: str + :ivar vector_fields: List of fields with vector content. + :vartype vector_fields: list[str] + :ivar metadata_fields: List of fields with metadata content. + :vartype metadata_fields: list[str] + """ + + content_fields: list[str] = rest_field(name="contentFields", visibility=["create"]) + """List of fields with text content. Required.""" + filepath_field: Optional[str] = rest_field(name="filepathField", visibility=["create"]) + """Path of file to be used as a source of text content.""" + title_field: Optional[str] = rest_field(name="titleField", visibility=["create"]) """Field containing the title of the document.""" url_field: Optional[str] = rest_field(name="urlField", visibility=["create"]) """Field containing the url of the document.""" @@ -7194,12 +7974,7607 @@ class FieldMapping(_Model): def __init__( self, *, - content_fields: list[str], - filepath_field: Optional[str] = None, - title_field: Optional[str] = None, - url_field: Optional[str] = None, - vector_fields: Optional[list[str]] = None, - metadata_fields: Optional[list[str]] = None, + content_fields: list[str], + filepath_field: Optional[str] = None, + title_field: Optional[str] = None, + url_field: Optional[str] = None, + vector_fields: Optional[list[str]] = None, + metadata_fields: 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 FileDataGenerationJobOutput(DataGenerationJobOutput, discriminator="file"): + """Azure OpenAI file output for a data generation job. + + :ivar type: Azure OpenAI file output. Required. The generated data is an Azure OpenAI File. + :vartype type: str or ~azure.ai.projects.models.FILE + :ivar id: The id of the output Azure OpenAI file. Required. + :vartype id: str + :ivar filename: The filename of the output Azure OpenAI file. Required. + :vartype filename: str + """ + + type: Literal[DataGenerationJobOutputType.FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Azure OpenAI file output. Required. The generated data is an Azure OpenAI File.""" + id: str = rest_field(visibility=["read"]) + """The id of the output Azure OpenAI file. Required.""" + filename: str = rest_field(visibility=["read"]) + """The filename of the output Azure OpenAI file. Required.""" + + @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 = DataGenerationJobOutputType.FILE # type: ignore + + +class FileDataGenerationJobSource( + DataGenerationJobSource, discriminator="file" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """File source for data generation jobs — Azure OpenAI file input. + + :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 job, which is File. Required. File source — Azure OpenAI + file. + :vartype type: str or ~azure.ai.projects.models.FILE + :ivar id: Input Azure Open AI file id used for data generation. Required. + :vartype id: str + """ + + type: Literal[DataGenerationJobSourceType.FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The source type for this job, which is File. Required. File source — Azure OpenAI file.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Input Azure Open AI file id used for data generation. Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + 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 = DataGenerationJobSourceType.FILE # type: ignore + + +class FileDatasetVersion( + DatasetVersion, discriminator="uri_file" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """FileDatasetVersion Definition. + + :ivar data_uri: URI of the data (`example `_). + Required. + :vartype data_uri: str + :ivar is_reference: Indicates if the dataset holds a reference to the storage, or the dataset + manages storage itself. If true, the underlying data will not be deleted when the dataset + version is deleted. + :vartype is_reference: bool + :ivar connection_name: The Azure Storage Account connection name. Required if + startPendingUploadVersion was not called before creating the Dataset. + :vartype connection_name: str + :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: Dataset type. Required. URI file. + :vartype type: str or ~azure.ai.projects.models.URI_FILE + """ + + type: Literal[DatasetType.URI_FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Dataset type. Required. URI file.""" + + @overload + def __init__( + self, + *, + data_uri: str, + connection_name: Optional[str] = None, + 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 = 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 + """A file 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: Required. FILE_SEARCH. + :vartype type: str or ~azure.ai.projects.models.FILE_SEARCH + :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 vector_store_ids: The IDs of the vector stores to search. + :vartype vector_store_ids: list[str] + """ + + type: Literal[ToolboxToolType.FILE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. FILE_SEARCH.""" + 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.""" + vector_store_ids: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The IDs of the vector stores to search.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + max_num_results: Optional[int] = None, + ranking_options: Optional["_models.RankingOptions"] = None, + filters: Optional["_unions.Filters"] = None, + vector_store_ids: 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 = ToolboxToolType.FILE_SEARCH # type: ignore + + +class VersionSelectionRule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """VersionSelectionRule. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + FixedRatioVersionSelectionRule + + :ivar type: Required. "FixedRatio" + :vartype type: str or ~azure.ai.projects.models.VersionSelectorType + :ivar agent_version: The agent version to route traffic to. Required. + :vartype agent_version: str + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. \"FixedRatio\"""" + agent_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The agent version to route traffic to. Required.""" + + @overload + def __init__( + self, + *, + type: str, + agent_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 FixedRatioVersionSelectionRule( + VersionSelectionRule, discriminator="FixedRatio" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """FixedRatioVersionSelectionRule. + + :ivar agent_version: The agent version to route traffic to. Required. + :vartype agent_version: str + :ivar type: Required. FIXED_RATIO. + :vartype type: str or ~azure.ai.projects.models.FIXED_RATIO + :ivar traffic_percentage: The percentage of traffic to route to the version. Must be between 0 + and 100. Required. + :vartype traffic_percentage: int + """ + + type: Literal[VersionSelectorType.FIXED_RATIO] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. FIXED_RATIO.""" + traffic_percentage: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The percentage of traffic to route to the version. Must be between 0 and 100. Required.""" + + @overload + def __init__( + self, + *, + agent_version: str, + traffic_percentage: 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 = VersionSelectorType.FIXED_RATIO # type: ignore + + +class FolderDatasetVersion( + DatasetVersion, discriminator="uri_folder" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """FileDatasetVersion Definition. + + :ivar data_uri: URI of the data (`example `_). + Required. + :vartype data_uri: str + :ivar is_reference: Indicates if the dataset holds a reference to the storage, or the dataset + manages storage itself. If true, the underlying data will not be deleted when the dataset + version is deleted. + :vartype is_reference: bool + :ivar connection_name: The Azure Storage Account connection name. Required if + startPendingUploadVersion was not called before creating the Dataset. + :vartype connection_name: str + :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: Dataset type. Required. URI folder. + :vartype type: str or ~azure.ai.projects.models.URI_FOLDER + """ + + type: Literal[DatasetType.URI_FOLDER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Dataset type. Required. URI folder.""" + + @overload + def __init__( + self, + *, + data_uri: str, + connection_name: Optional[str] = None, + 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 = DatasetType.URI_FOLDER # type: ignore + + +class FoundryModelWarning(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A warning associated with a model. + + :ivar code: The warning code. Known values are: "RuntimeDependentArtifact" and + "UnclassifiedArtifact". + :vartype code: str or ~azure.ai.projects.models.FoundryModelWarningCode + :ivar message: The warning message. + :vartype message: str + """ + + code: Optional[Union[str, "_models.FoundryModelWarningCode"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The warning code. Known values are: \"RuntimeDependentArtifact\" and \"UnclassifiedArtifact\".""" + message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The warning message.""" + + @overload + def __init__( + self, + *, + code: Optional[Union[str, "_models.FoundryModelWarningCode"]] = None, + 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 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 + """FunctionShellToolParamEnvironmentContainerReferenceParam. + + :ivar type: References a container created with the /v1/containers endpoint. Required. + CONTAINER_REFERENCE. + :vartype type: str or ~azure.ai.projects.models.CONTAINER_REFERENCE + :ivar container_id: The ID of the referenced container. Required. + :vartype container_id: str + """ + + type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """References a container created with the /v1/containers endpoint. Required. 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 = FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE # type: ignore + + +class FunctionShellToolParamEnvironmentLocalEnvironmentParam( + FunctionShellToolParamEnvironment, discriminator="local" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """FunctionShellToolParamEnvironmentLocalEnvironmentParam. + + :ivar type: Use a local computer environment. Required. LOCAL. + :vartype type: str or ~azure.ai.projects.models.LOCAL + :ivar skills: An optional list of skills. + :vartype skills: list[~azure.ai.projects.models.LocalSkillParam] + """ + + type: Literal[FunctionShellToolParamEnvironmentType.LOCAL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Use a local computer environment. Required. LOCAL.""" + skills: Optional[list["_models.LocalSkillParam"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """An optional list of skills.""" + + @overload + def __init__( + self, + *, + skills: Optional[list["_models.LocalSkillParam"]] = 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 = 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 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.""" + 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, + 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. + + :ivar name: Required. + :vartype name: str + :ivar description: + :vartype description: str + :ivar parameters: + :vartype parameters: ~azure.ai.projects.models.EmptyModelParam + :ivar strict: + :vartype strict: bool + :ivar type: Required. Default value is "function". + :vartype type: str + :ivar output_schema: + :vartype output_schema: dict[str, any] + :ivar defer_loading: Whether this function 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] + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + parameters: Optional["_models.EmptyModelParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + strict: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal["function"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"function\".""" + output_schema: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + defer_loading: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether this function 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, + description: Optional[str] = None, + parameters: Optional["_models.EmptyModelParam"] = None, + strict: Optional[bool] = 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: Literal["function"] = "function" + + +class GitHubIssueRoutineTrigger( + RoutineTrigger, discriminator="github_issue" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A GitHub issue routine trigger. + + :ivar type: The trigger type. Required. A GitHub issue trigger. + :vartype type: str or ~azure.ai.projects.models.GITHUB_ISSUE + :ivar connection_id: The workspace connection identifier that resolves the GitHub configuration + for the trigger. Required. + :vartype connection_id: str + :ivar owner: The GitHub owner or organization that scopes which issues can fire the trigger. + Required. + :vartype owner: str + :ivar repository: The GitHub repository filter that scopes which issues can fire the trigger. + Required. + :vartype repository: str + :ivar issue_event: The GitHub issue event that fires the routine. Required. Known values are: + "opened" and "closed". + :vartype issue_event: str or ~azure.ai.projects.models.GitHubIssueEvent + """ + + type: Literal[RoutineTriggerType.GITHUB_ISSUE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The trigger type. Required. A GitHub issue trigger.""" + connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The workspace connection identifier that resolves the GitHub configuration for the trigger. + Required.""" + owner: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The GitHub owner or organization that scopes which issues can fire the trigger. Required.""" + repository: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The GitHub repository filter that scopes which issues can fire the trigger. Required.""" + issue_event: Union[str, "_models.GitHubIssueEvent"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The GitHub issue event that fires the routine. Required. Known values are: \"opened\" and + \"closed\".""" + + @overload + def __init__( + self, + *, + connection_id: str, + owner: str, + repository: str, + issue_event: Union[str, "_models.GitHubIssueEvent"], + ) -> 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.GITHUB_ISSUE # type: ignore + + +class TelemetryEndpointAuth(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Authentication configuration for a telemetry endpoint. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + HeaderTelemetryEndpointAuth + + :ivar type: The authentication type. Required. "header" + :vartype type: str or ~azure.ai.projects.models.TelemetryEndpointAuthType + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The authentication type. Required. \"header\"""" + + @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 HeaderTelemetryEndpointAuth( + TelemetryEndpointAuth, discriminator="header" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Header-based secret authentication for a telemetry endpoint. The resolved secret value is + injected as an HTTP header. + + :ivar type: The authentication type, always 'header' for header-based secret authentication. + Required. Header-based secret authentication. + :vartype type: str or ~azure.ai.projects.models.HEADER + :ivar header_name: The name of the HTTP header to inject the secret value into. Required. + :vartype header_name: str + :ivar secret_id: The identifier of the secret store or connection. Required. + :vartype secret_id: str + :ivar secret_key: The key within the secret to retrieve the authentication value. Required. + :vartype secret_key: str + """ + + type: Literal[TelemetryEndpointAuthType.HEADER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The authentication type, always 'header' for header-based secret authentication. Required. + Header-based secret authentication.""" + header_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the HTTP header to inject the secret value into. Required.""" + secret_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The identifier of the secret store or connection. Required.""" + secret_key: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The key within the secret to retrieve the authentication value. Required.""" + + @overload + def __init__( + self, + *, + header_name: str, + secret_id: str, + secret_key: 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 = TelemetryEndpointAuthType.HEADER # type: ignore + + +class HostedAgentDefinition( + AgentDefinition, discriminator="hosted" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The hosted agent definition. + + :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. + :vartype rai_config: ~azure.ai.projects.models.RaiConfig + :ivar kind: Required. HOSTED. + :vartype kind: str or ~azure.ai.projects.models.HOSTED + :ivar cpu: The CPU configuration for the hosted agent. Required. + :vartype cpu: str + :ivar memory: The memory configuration for the hosted agent. Required. + :vartype memory: str + :ivar environment_variables: Environment variables to set in the hosted agent container. + :vartype environment_variables: dict[str, str] + :ivar container_configuration: Container-based deployment configuration. Provide this for + image-based deployments. Mutually exclusive with code_configuration — the service validates + that exactly one is set. + :vartype container_configuration: ~azure.ai.projects.models.ContainerConfiguration + :ivar protocol_versions: The protocols that the agent supports for ingress communication. + :vartype protocol_versions: list[~azure.ai.projects.models.ProtocolVersionRecord] + :ivar code_configuration: Code-based deployment configuration. Provide this for code-based + deployments. Mutually exclusive with container_configuration — the service validates that + exactly one is set. + :vartype code_configuration: ~azure.ai.projects.models.CodeConfiguration + :ivar telemetry_config: Optional customer-supplied telemetry configuration for exporting + container logs, traces, and metrics. + :vartype telemetry_config: ~azure.ai.projects.models.TelemetryConfig + """ + + kind: Literal[AgentKind.HOSTED] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. HOSTED.""" + cpu: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The CPU configuration for the hosted agent. Required.""" + memory: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The memory configuration for the hosted agent. Required.""" + environment_variables: Optional[dict[str, str]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Environment variables to set in the hosted agent container.""" + container_configuration: Optional["_models.ContainerConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Container-based deployment configuration. Provide this for image-based deployments. Mutually + exclusive with code_configuration — the service validates that exactly one is set.""" + protocol_versions: Optional[list["_models.ProtocolVersionRecord"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The protocols that the agent supports for ingress communication.""" + code_configuration: Optional["_models.CodeConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Code-based deployment configuration. Provide this for code-based deployments. Mutually + exclusive with container_configuration — the service validates that exactly one is set.""" + telemetry_config: Optional["_models.TelemetryConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional customer-supplied telemetry configuration for exporting container logs, traces, and + metrics.""" + + @overload + def __init__( + self, + *, + cpu: str, + memory: str, + rai_config: Optional["_models.RaiConfig"] = None, + environment_variables: Optional[dict[str, str]] = None, + container_configuration: Optional["_models.ContainerConfiguration"] = None, + protocol_versions: Optional[list["_models.ProtocolVersionRecord"]] = None, + code_configuration: Optional["_models.CodeConfiguration"] = None, + telemetry_config: Optional["_models.TelemetryConfig"] = 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.kind = AgentKind.HOSTED # type: ignore + + +class HourlyRecurrenceSchedule(RecurrenceSchedule, discriminator="Hourly"): + """Hourly recurrence schedule. + + :ivar type: Required. Hourly recurrence pattern. + :vartype type: str or ~azure.ai.projects.models.HOURLY + """ + + type: Literal[RecurrenceType.HOURLY] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Hourly recurrence pattern.""" + + @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 = RecurrenceType.HOURLY # type: ignore + + +class HumanEvaluationPreviewRuleAction( + EvaluationRuleAction, discriminator="humanEvaluationPreview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Evaluation rule action for human evaluation. + + :ivar type: Required. Human evaluation preview. + :vartype type: str or ~azure.ai.projects.models.HUMAN_EVALUATION_PREVIEW + :ivar template_id: Human evaluation template Id. Required. + :vartype template_id: str + """ + + type: Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Human evaluation preview.""" + template_id: str = rest_field(name="templateId", visibility=["read", "create", "update", "delete", "query"]) + """Human evaluation template Id. Required.""" + + @overload + def __init__( + self, + *, + template_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 = EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW # type: ignore + + +class HybridSearchOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """HybridSearchOptions. + + :ivar embedding_weight: The weight of the embedding in the reciprocal ranking fusion. Required. + :vartype embedding_weight: float + :ivar text_weight: The weight of the text in the reciprocal ranking fusion. Required. + :vartype text_weight: float + """ + + embedding_weight: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The weight of the embedding in the reciprocal ranking fusion. Required.""" + text_weight: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The weight of the text in the reciprocal ranking fusion. Required.""" + + @overload + def __init__( + self, + *, + embedding_weight: float, + text_weight: 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 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"], str + :vartype model: 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"], + 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: Background type for the generated image. One of ``transparent``, ``opaque``, + or ``auto``. 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"], 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\"], str""" + quality: Optional[Literal["low", "medium", "high", "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\"]""" + 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""" + 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"] + ) + """Background type for the generated image. One of ``transparent``, ``opaque``, or ``auto``. + 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"], str] + ] = None, + quality: Optional[Literal["low", "medium", "high", "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. + + :ivar image_url: + :vartype image_url: str + :ivar file_id: + :vartype file_id: str + """ + + image_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + file_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + image_url: Optional[str] = None, + 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 InlineSkillParam( + ContainerSkill, discriminator="inline" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """InlineSkillParam. + + :ivar type: Defines an inline skill for this request. Required. INLINE. + :vartype type: str or ~azure.ai.projects.models.INLINE + :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.InlineSkillSourceParam + """ + + type: Literal[ContainerSkillType.INLINE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Defines an inline skill for this request. Required. 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.InlineSkillSourceParam" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Inline skill payload. Required.""" + + @overload + def __init__( + self, + *, + name: str, + description: str, + source: "_models.InlineSkillSourceParam", + ) -> 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.INLINE # type: ignore + + +class InlineSkillSourceParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Inline skill payload. + + :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 + """ + + 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, + *, + 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) + self.type: Literal["base64"] = "base64" + self.media_type: Literal["application/zip"] = "application/zip" + + +class Insight(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The response body for cluster insights. + + :ivar insight_id: The unique identifier for the insights report. Required. + :vartype insight_id: str + :ivar metadata: Metadata about the insights report. Required. + :vartype metadata: ~azure.ai.projects.models.InsightsMetadata + :ivar state: The current state of the insights. Required. Known values are: "NotStarted", + "Running", "Succeeded", "Failed", and "Canceled". + :vartype state: str or ~azure.ai.projects.models.OperationState + :ivar display_name: User friendly display name for the insight. Required. + :vartype display_name: str + :ivar request: Request for the insights analysis. Required. + :vartype request: ~azure.ai.projects.models.InsightRequest + :ivar result: The result of the insights report. + :vartype result: ~azure.ai.projects.models.InsightResult + """ + + insight_id: str = rest_field(name="id", visibility=["read"]) + """The unique identifier for the insights report. Required.""" + metadata: "_models.InsightsMetadata" = rest_field(visibility=["read"]) + """Metadata about the insights report. Required.""" + state: Union[str, "_models.OperationState"] = rest_field(visibility=["read"]) + """The current state of the insights. Required. Known values are: \"NotStarted\", \"Running\", + \"Succeeded\", \"Failed\", and \"Canceled\".""" + display_name: str = rest_field(name="displayName", visibility=["read", "create", "update", "delete", "query"]) + """User friendly display name for the insight. Required.""" + request: "_models.InsightRequest" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Request for the insights analysis. Required.""" + result: Optional["_models.InsightResult"] = rest_field(visibility=["read"]) + """The result of the insights report.""" + + @overload + def __init__( + self, + *, + display_name: str, + request: "_models.InsightRequest", + ) -> 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 InsightCluster(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A cluster of analysis samples. + + :ivar id: The id of the analysis cluster. Required. + :vartype id: str + :ivar label: Label for the cluster. Required. + :vartype label: str + :ivar suggestion: Suggestion for the cluster. Required. + :vartype suggestion: str + :ivar suggestion_title: The title of the suggestion for the cluster. Required. + :vartype suggestion_title: str + :ivar description: Description of the analysis cluster. Required. + :vartype description: str + :ivar weight: The weight of the analysis cluster. This indicate number of samples in the + cluster. Required. + :vartype weight: int + :ivar sub_clusters: List of subclusters within this cluster. Empty if no subclusters exist. + :vartype sub_clusters: list[~azure.ai.projects.models.InsightCluster] + :ivar samples: List of samples that belong to this cluster. Empty if samples are part of + subclusters. + :vartype samples: list[~azure.ai.projects.models.InsightSample] + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The id of the analysis cluster. Required.""" + label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Label for the cluster. Required.""" + suggestion: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Suggestion for the cluster. Required.""" + suggestion_title: str = rest_field( + name="suggestionTitle", visibility=["read", "create", "update", "delete", "query"] + ) + """The title of the suggestion for the cluster. Required.""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Description of the analysis cluster. Required.""" + weight: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The weight of the analysis cluster. This indicate number of samples in the cluster. Required.""" + sub_clusters: Optional[list["_models.InsightCluster"]] = rest_field( + name="subClusters", visibility=["read", "create", "update", "delete", "query"] + ) + """List of subclusters within this cluster. Empty if no subclusters exist.""" + samples: Optional[list["_models.InsightSample"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of samples that belong to this cluster. Empty if samples are part of subclusters.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + label: str, + suggestion: str, + suggestion_title: str, + description: str, + weight: int, + sub_clusters: Optional[list["_models.InsightCluster"]] = None, + samples: Optional[list["_models.InsightSample"]] = 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 InsightModelConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Configuration of the model used in the insight generation. + + :ivar model_deployment_name: The model deployment to be evaluated. Accepts either the + deployment name alone or with the connection name as '{connectionName}/'. + Required. + :vartype model_deployment_name: str + """ + + model_deployment_name: str = rest_field( + name="modelDeploymentName", visibility=["read", "create", "update", "delete", "query"] + ) + """The model deployment to be evaluated. Accepts either the deployment name alone or with the + connection name as '{connectionName}/'. Required.""" + + @overload + def __init__( + self, + *, + model_deployment_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) + + +class InsightScheduleTask( + ScheduleTask, discriminator="Insight" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Insight task for the schedule. + + :ivar configuration: Configuration for the task. + :vartype configuration: dict[str, str] + :ivar type: Required. Insight task. + :vartype type: str or ~azure.ai.projects.models.INSIGHT + :ivar insight: The insight payload. Required. + :vartype insight: ~azure.ai.projects.models.Insight + """ + + type: Literal[ScheduleTaskType.INSIGHT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Insight task.""" + insight: "_models.Insight" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The insight payload. Required.""" + + @overload + def __init__( + self, + *, + insight: "_models.Insight", + configuration: 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 = ScheduleTaskType.INSIGHT # type: ignore + + +class InsightsMetadata(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Metadata about the insights. + + :ivar created_at: The timestamp when the insights were created. Required. + :vartype created_at: ~datetime.datetime + :ivar completed_at: The timestamp when the insights were completed. + :vartype completed_at: ~datetime.datetime + """ + + created_at: datetime.datetime = rest_field( + name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp when the insights were created. Required.""" + completed_at: Optional[datetime.datetime] = rest_field( + name="completedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp when the insights were completed.""" + + @overload + def __init__( + self, + *, + created_at: datetime.datetime, + completed_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) + + +class InsightSummary(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Summary of the error cluster analysis. + + :ivar sample_count: Total number of samples analyzed. Required. + :vartype sample_count: int + :ivar unique_subcluster_count: Total number of unique subcluster labels. Required. + :vartype unique_subcluster_count: int + :ivar unique_cluster_count: Total number of unique clusters. Required. + :vartype unique_cluster_count: int + :ivar method: Method used for clustering. Required. + :vartype method: str + :ivar usage: Token usage while performing clustering analysis. Required. + :vartype usage: ~azure.ai.projects.models.ClusterTokenUsage + """ + + sample_count: int = rest_field(name="sampleCount", visibility=["read", "create", "update", "delete", "query"]) + """Total number of samples analyzed. Required.""" + unique_subcluster_count: int = rest_field( + name="uniqueSubclusterCount", visibility=["read", "create", "update", "delete", "query"] + ) + """Total number of unique subcluster labels. Required.""" + unique_cluster_count: int = rest_field( + name="uniqueClusterCount", visibility=["read", "create", "update", "delete", "query"] + ) + """Total number of unique clusters. Required.""" + method: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Method used for clustering. Required.""" + usage: "_models.ClusterTokenUsage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Token usage while performing clustering analysis. Required.""" + + @overload + def __init__( + self, + *, + sample_count: int, + unique_subcluster_count: int, + unique_cluster_count: int, + method: str, + usage: "_models.ClusterTokenUsage", + ) -> 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 InvocationsProtocolConfiguration(_Model): + """Configuration specific to the invocations protocol.""" + + +class InvocationsWsProtocolConfiguration(_Model): + """Configuration specific to the WebSocket-based invocations protocol.""" + + +class RoutineDispatchPayload(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Base model for a manual dispatch payload. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + InvokeAgentInvocationsApiDispatchPayload, InvokeAgentResponsesApiDispatchPayload + + :ivar type: The manual dispatch payload type. Required. Known values are: + "invoke_agent_responses_api" and "invoke_agent_invocations_api". + :vartype type: str or ~azure.ai.projects.models.RoutineDispatchPayloadType + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The manual dispatch payload type. Required. Known values are: \"invoke_agent_responses_api\" + and \"invoke_agent_invocations_api\".""" + + @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 InvokeAgentInvocationsApiDispatchPayload( + RoutineDispatchPayload, discriminator="invoke_agent_invocations_api" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A manual payload used to test an invocations API routine dispatch. + + :ivar type: The manual dispatch payload type. Required. A manual payload for an invocations API + routine dispatch. + :vartype type: str or ~azure.ai.projects.models.INVOKE_AGENT_INVOCATIONS_API + :ivar input: The JSON value sent as the complete downstream invocations input. The value is + passed through as-is and can be an object, string, number, boolean, array, or null. Required. + :vartype input: any + """ + + type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The manual dispatch payload type. Required. A manual payload for an invocations API routine + dispatch.""" + input: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The JSON value sent as the complete downstream invocations input. The value is passed through + as-is and can be an object, string, number, boolean, array, or null. Required.""" + + @overload + def __init__( + self, + *, + input: Any, + ) -> 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 = RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API # type: ignore + + +class RoutineAction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Base model for a routine action. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + InvokeAgentInvocationsApiRoutineAction, InvokeAgentResponsesApiRoutineAction + + :ivar type: The action type. Required. Known values are: "invoke_agent_responses_api" and + "invoke_agent_invocations_api". + :vartype type: str or ~azure.ai.projects.models.RoutineActionType + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The action type. Required. Known values are: \"invoke_agent_responses_api\" and + \"invoke_agent_invocations_api\".""" + + @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 InvokeAgentInvocationsApiRoutineAction( + RoutineAction, discriminator="invoke_agent_invocations_api" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Dispatches a routine through the raw invocations API. Exactly one of agent_name or + agent_endpoint_id must be provided. + + :ivar type: The action type. Required. Dispatches through the raw invocations API. + :vartype type: str or ~azure.ai.projects.models.INVOKE_AGENT_INVOCATIONS_API + :ivar agent_name: The project-scoped agent name for routine dispatch. + :vartype agent_name: str + :ivar agent_endpoint_id: Legacy endpoint-scoped agent identifier for routine dispatch. + :vartype agent_endpoint_id: str + :ivar input: Static JSON value sent as the complete downstream input when the routine fires. + The value is passed through as-is; no templating is applied. + :vartype input: any + :ivar session_id: An optional existing hosted-agent session identifier to continue during the + downstream dispatch. + :vartype session_id: str + """ + + type: Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The action type. Required. Dispatches through the raw invocations API.""" + agent_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The project-scoped agent name for routine dispatch.""" + agent_endpoint_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Legacy endpoint-scoped agent identifier for routine dispatch.""" + input: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Static JSON value sent as the complete downstream input when the routine fires. The value is + passed through as-is; no templating is applied.""" + session_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional existing hosted-agent session identifier to continue during the downstream + dispatch.""" + + @overload + def __init__( + self, + *, + agent_name: Optional[str] = None, + agent_endpoint_id: Optional[str] = None, + input: Optional[Any] = None, + session_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 = RoutineActionType.INVOKE_AGENT_INVOCATIONS_API # type: ignore + + +class InvokeAgentResponsesApiDispatchPayload( + RoutineDispatchPayload, discriminator="invoke_agent_responses_api" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A manual payload used to test a responses API routine dispatch. + + :ivar type: The manual dispatch payload type. Required. A manual payload for a responses API + routine dispatch. + :vartype type: str or ~azure.ai.projects.models.INVOKE_AGENT_RESPONSES_API + :ivar input: The JSON value sent as the complete downstream responses input. The value is + passed through as-is and can be an object, string, number, boolean, array, or null. Required. + :vartype input: any + """ + + type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The manual dispatch payload type. Required. A manual payload for a responses API routine + dispatch.""" + input: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The JSON value sent as the complete downstream responses input. The value is passed through + as-is and can be an object, string, number, boolean, array, or null. Required.""" + + @overload + def __init__( + self, + *, + input: Any, + ) -> 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 = RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API # type: ignore + + +class InvokeAgentResponsesApiRoutineAction( + RoutineAction, discriminator="invoke_agent_responses_api" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Dispatches a routine through the responses API. Exactly one of agent_name or agent_endpoint_id + must be provided. + + :ivar type: The action type. Required. Dispatches through the responses API. + :vartype type: str or ~azure.ai.projects.models.INVOKE_AGENT_RESPONSES_API + :ivar agent_name: The project-scoped agent name for routine dispatch. + :vartype agent_name: str + :ivar agent_endpoint_id: Legacy endpoint-scoped agent identifier for routine dispatch. + :vartype agent_endpoint_id: str + :ivar input: Static JSON value sent as the complete downstream input when the routine fires. + The value is passed through as-is; no templating is applied. + :vartype input: any + :ivar conversation: An optional existing conversation identifier to continue during the + downstream dispatch. + :vartype conversation: str + """ + + type: Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The action type. Required. Dispatches through the responses API.""" + agent_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The project-scoped agent name for routine dispatch.""" + agent_endpoint_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Legacy endpoint-scoped agent identifier for routine dispatch.""" + input: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Static JSON value sent as the complete downstream input when the routine fires. The value is + passed through as-is; no templating is applied.""" + conversation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional existing conversation identifier to continue during the downstream dispatch.""" + + @overload + def __init__( + self, + *, + agent_name: Optional[str] = None, + agent_endpoint_id: Optional[str] = None, + input: Optional[Any] = None, + conversation: 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 = RoutineActionType.INVOKE_AGENT_RESPONSES_API # type: ignore + + +class VoiceGreetingConfig(_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: + LlmGeneratedVoiceGreetingConfig, TemplateVoiceGreetingConfig + + :ivar type: The greeting mode. 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 greeting mode. 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 LlmGeneratedVoiceGreetingConfig( + VoiceGreetingConfig, discriminator="llm_generated" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A greeting authored by the session model from a scoped opening-turn prompt. + + :ivar type: Required. Default value is "llm_generated". + :vartype type: str + :ivar prompt: The Handlebars prompt that guides the opening turn. Required. + :vartype prompt: str + :ivar tool_choice: The tool-selection policy for the opening response. Defaults to ``none``. Is + one of the following types: Union[str, "_models.ToolChoiceOptions"], ToolChoiceFunction, + ToolChoiceMCP + :vartype tool_choice: str or ~azure.ai.projects.models.ToolChoiceOptions or + ~azure.ai.projects.models.ToolChoiceFunction or ~azure.ai.projects.models.ToolChoiceMCP + """ + + type: Literal["llm_generated"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"llm_generated\".""" + prompt: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Handlebars prompt that guides the opening turn. Required.""" + tool_choice: Optional["_unions.VoiceAgentToolChoice"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The tool-selection policy for the opening response. Defaults to ``none``. Is one of the + following types: Union[str, \"_models.ToolChoiceOptions\"], ToolChoiceFunction, ToolChoiceMCP""" + + @overload + def __init__( + self, + *, + prompt: str, + tool_choice: Optional["_unions.VoiceAgentToolChoice"] = 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 = "llm_generated" # type: ignore + + +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 `_. 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[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 + `_. 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, + *, + 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 + 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.MCP # 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 `_. 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 + """ + + 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 + `_. 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.""" + + @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, + ) -> 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.MCP # type: ignore + + +class MCPToolFilter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """MCP tool filter. + + :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 + """ + + 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, + *, + tool_names: Optional[list[str]] = None, + read_only: 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 MCPToolRequireApproval(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """MCPToolRequireApproval. + + :ivar always: + :vartype always: ~azure.ai.projects.models.MCPToolFilter + :ivar never: + :vartype never: ~azure.ai.projects.models.MCPToolFilter + """ + + 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, + *, + always: Optional["_models.MCPToolFilter"] = None, + never: Optional["_models.MCPToolFilter"] = 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 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 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 + """ + + 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 + 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 MemorySearchItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A retrieved memory item from memory search. + + :ivar memory_item: Retrieved memory item. Required. + :vartype memory_item: ~azure.ai.projects.models.MemoryItem + """ + + memory_item: "_models.MemoryItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Retrieved memory item. Required.""" + + @overload + def __init__( + self, + *, + memory_item: "_models.MemoryItem", + ) -> 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 MemorySearchOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Memory search options. + + :ivar max_memories: Maximum number of memory items to return. + :vartype max_memories: int + """ + + max_memories: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Maximum number of memory items to return.""" + + @overload + def __init__( + self, + *, + max_memories: 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 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 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[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 + 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.MEMORY_SEARCH_PREVIEW # 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 + + :ivar kind: The kind of the memory store. Required. "default" + :vartype kind: str or ~azure.ai.projects.models.MemoryStoreKind + """ + + __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, + *, + kind: 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 MemoryStoreDefaultDefinition( + MemoryStoreDefinition, discriminator="default" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Default memory store implementation. + + :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 + """ + + 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, + *, + chat_model: str, + embedding_model: str, + options: Optional["_models.MemoryStoreDefaultOptions"] = 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.kind = MemoryStoreKind.DEFAULT # type: ignore + + +class MemoryStoreDefaultOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Default memory store configurations. + + :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 + """ + + 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__( + 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, + ) -> 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 MemoryStoreDeleteScopeResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Response for deleting memories from a scope. + + :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 + """ + + 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, + *, + object: Literal[MemoryStoreObjectType.MEMORY_STORE_SCOPE_DELETED], + name: str, + scope: str, + deleted: 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 MemoryStoreDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A memory store that can store and retrieve user memories. + + :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 + """ + + 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.""" + + @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, + ) -> 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 MemoryStoreOperationUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Usage statistics of a memory store operation. + + :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 + """ + + 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, + *, + embedding_tokens: int, + input_tokens: int, + input_tokens_details: "_models.ResponseUsageInputTokensDetails", + output_tokens: int, + output_tokens_details: "_models.ResponseUsageOutputTokensDetails", + total_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 MemoryStoreSearchResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Memory search response. + + :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 + """ + + 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, + *, + search_id: str, + memories: list["_models.MemorySearchItem"], + usage: "_models.MemoryStoreOperationUsage", + ) -> 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 MemoryStoreUpdateCompletedResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Memory update result. + + :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 + """ + + 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.""" + + @overload + def __init__( + self, + *, + memory_operations: list["_models.MemoryOperation"], + usage: "_models.MemoryStoreOperationUsage", + ) -> 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 MemoryStoreUpdateResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Provides the status of a memory store update operation. + + :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 + """ + + 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] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +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 MicrosoftFabricPreviewTool( + Tool, discriminator="fabric_dataagent_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The input definition information for a Microsoft Fabric tool as used to configure an agent. + + :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 + """ + + 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.""" + + @overload + def __init__( + self, + *, + fabric_dataagent_preview: "_models.FabricDataAgentToolParameters", + ) -> 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.FABRIC_DATAAGENT_PREVIEW # type: ignore + + +class ModelCredentialRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Request to fetch credentials for a model asset. + + :ivar blob_uri: Blob URI of the model asset to fetch credentials for. Required. + :vartype blob_uri: 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.""" + + @overload + def __init__( + self, + *, + blob_uri: 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 ModelDeployment(Deployment, discriminator="ModelDeployment"): + """Model Deployment Definition. + + :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, + ) -> 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 = DeploymentType.MODEL_DEPLOYMENT # type: ignore + + +class ModelDeploymentSku(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Sku information. + + :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 + """ + + 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, + *, + capacity: int, + family: str, + name: str, + size: str, + tier: 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 ModelPendingUploadRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents a request for a pending upload of a model version. + + :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 + """ + + 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.""" + + @overload + def __init__( + self, + *, + pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE], + pending_upload_id: Optional[str] = None, + connection_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) + + +class ModelPendingUploadResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents the response for a model pending upload request. + + :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 + """ + + 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.""" + + @overload + def __init__( + self, + *, + blob_reference: "_models.BlobReference", + pending_upload_id: str, + pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE], + 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 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 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 + """ + + 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, + *, + temperature: Optional[float] = None, + top_p: Optional[float] = None, + seed: Optional[int] = None, + max_completion_tokens: 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 ModelSourceData(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Source information for the model. + + :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.""" + + @overload + def __init__( + self, + *, + source_type: Optional[Union[str, "_models.FoundryModelSourceType"]] = None, + job_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 ModelVersion(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Model Version Definition. + + :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] + """ + + 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"] + ) + """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, + *, + 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 + 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 MonthlyRecurrenceSchedule( + RecurrenceSchedule, discriminator="Monthly" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Monthly recurrence schedule. + + :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] + """ + + 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.""" + + @overload + def __init__( + self, + *, + days_of_month: 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) + self.type = RecurrenceType.MONTHLY # type: ignore + + +class NamespaceToolParam( + Tool, discriminator="namespace" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Namespace. + + :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] + """ + + 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, + *, + name: str, + description: str, + tools: list[Union["_models.FunctionToolParam", "_models.CustomToolParam"]], + ) -> 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.NAMESPACE # type: ignore + + +class NoAuthenticationCredentials(BaseCredentials, discriminator="None"): + """Credentials that do not require authentication. + + :ivar type: The credential type. Required. No credential. + :vartype type: str or ~azure.ai.projects.models.NONE + """ + + type: Literal[CredentialType.NONE] = rest_discriminator(name="type", visibility=["read"]) # type: ignore + """The credential type. Required. No credential.""" + + @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 = CredentialType.NONE # type: ignore + + +class OmitPropertiesRealtimeResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The template for omitting properties. + + :ivar id: The unique ID of the response, will look like ``resp_1234``. + :vartype id: str + :ivar object: The object type, must be ``realtime.response``. Default value is + "realtime.response". + :vartype object: str + :ivar status: The final status of the response (``completed``, ``cancelled``, ``failed``, or + ``incomplete``, ``in_progress``). Is one of the following types: Literal["completed"], + Literal["cancelled"], Literal["failed"], Literal["incomplete"], Literal["in_progress"] + :vartype status: str or str or str or str or str + :ivar status_details: Additional details about the status. + :vartype status_details: ~azure.ai.projects.models.RealtimeResponseStatusDetails + :ivar usage: Usage statistics for the Response, this will correspond to billing. A Realtime API + session will maintain a conversation context and append new Items to the Conversation, thus + output from previous turns (text and audio tokens) will become the input for later turns. + :vartype usage: ~azure.ai.projects.models.RealtimeResponseUsage + :ivar conversation_id: Which conversation the response is added to, determined by the + ``conversation`` field in the ``response.create`` event. If ``auto``, the response will be + added to the default conversation and the value of ``conversation_id`` will be an id like + ``conv_1234``. If ``none``, the response will not be added to any conversation and the value of + ``conversation_id`` will be ``null``. If responses are being triggered automatically by VAD the + response will be added to the default conversation. + :vartype conversation_id: str + :ivar output_modalities: The set of modalities the model used to respond, currently the only + possible values are ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text + transcript. Setting the output to mode ``text`` will disable audio output from the model. + :vartype output_modalities: list[str or str] + :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, + inclusive of tool calls, that was used in this response. Is either a int type or a + Literal["inf"] type. + :vartype max_output_tokens: int or str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the response, will look like ``resp_1234``.""" + object: Optional[Literal["realtime.response"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The object type, must be ``realtime.response``. Default value is \"realtime.response\".""" + status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The final status of the response (``completed``, ``cancelled``, ``failed``, or ``incomplete``, + ``in_progress``). Is one of the following types: Literal[\"completed\"], + Literal[\"cancelled\"], Literal[\"failed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" + status_details: Optional["_models.RealtimeResponseStatusDetails"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Additional details about the status.""" + usage: Optional["_models.RealtimeResponseUsage"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Usage statistics for the Response, this will correspond to billing. A Realtime API session will + maintain a conversation context and append new Items to the Conversation, thus output from + previous turns (text and audio tokens) will become the input for later turns.""" + conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Which conversation the response is added to, determined by the ``conversation`` field in the + ``response.create`` event. If ``auto``, the response will be added to the default conversation + and the value of ``conversation_id`` will be an id like ``conv_1234``. If ``none``, the + response will not be added to any conversation and the value of ``conversation_id`` will be + ``null``. If responses are being triggered automatically by VAD the response will be added to + the default conversation.""" + output_modalities: Optional[list[Literal["text", "audio"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The set of modalities the model used to respond, currently the only possible values are + ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text transcript. Setting the + output to mode ``text`` will disable audio output from the model.""" + max_output_tokens: Optional[Union[int, Literal["inf"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Maximum number of output tokens for a single assistant response, inclusive of tool calls, that + was used in this response. Is either a int type or a Literal[\"inf\"] type.""" + + @overload + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + object: Optional[Literal["realtime.response"]] = None, + status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] = None, + status_details: Optional["_models.RealtimeResponseStatusDetails"] = None, + usage: Optional["_models.RealtimeResponseUsage"] = None, + conversation_id: Optional[str] = None, + output_modalities: Optional[list[Literal["text", "audio"]]] = None, + max_output_tokens: Optional[Union[int, Literal["inf"]]] = 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 OmitPropertiesRealtimeResponse1(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The template for omitting properties. + + :ivar id: The unique ID of the response, will look like ``resp_1234``. + :vartype id: str + :ivar object: The object type, must be ``realtime.response``. Default value is + "realtime.response". + :vartype object: str + :ivar status: The final status of the response (``completed``, ``cancelled``, ``failed``, or + ``incomplete``, ``in_progress``). Is one of the following types: Literal["completed"], + Literal["cancelled"], Literal["failed"], Literal["incomplete"], Literal["in_progress"] + :vartype status: str or str or str or str or str + :ivar status_details: Additional details about the status. + :vartype status_details: ~azure.ai.projects.models.RealtimeResponseStatusDetails + :ivar metadata: + :vartype metadata: ~azure.ai.projects.models.Metadata + :ivar usage: Usage statistics for the Response, this will correspond to billing. A Realtime API + session will maintain a conversation context and append new Items to the Conversation, thus + output from previous turns (text and audio tokens) will become the input for later turns. + :vartype usage: ~azure.ai.projects.models.RealtimeResponseUsage + :ivar conversation_id: Which conversation the response is added to, determined by the + ``conversation`` field in the ``response.create`` event. If ``auto``, the response will be + added to the default conversation and the value of ``conversation_id`` will be an id like + ``conv_1234``. If ``none``, the response will not be added to any conversation and the value of + ``conversation_id`` will be ``null``. If responses are being triggered automatically by VAD the + response will be added to the default conversation. + :vartype conversation_id: str + :ivar output_modalities: The set of modalities the model used to respond, currently the only + possible values are ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text + transcript. Setting the output to mode ``text`` will disable audio output from the model. + :vartype output_modalities: list[str or str] + :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, + inclusive of tool calls, that was used in this response. Is either a int type or a + Literal["inf"] type. + :vartype max_output_tokens: int or str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the response, will look like ``resp_1234``.""" + object: Optional[Literal["realtime.response"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The object type, must be ``realtime.response``. Default value is \"realtime.response\".""" + status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The final status of the response (``completed``, ``cancelled``, ``failed``, or ``incomplete``, + ``in_progress``). Is one of the following types: Literal[\"completed\"], + Literal[\"cancelled\"], Literal[\"failed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" + status_details: Optional["_models.RealtimeResponseStatusDetails"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Additional details about the status.""" + metadata: Optional["_models.Metadata"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + usage: Optional["_models.RealtimeResponseUsage"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Usage statistics for the Response, this will correspond to billing. A Realtime API session will + maintain a conversation context and append new Items to the Conversation, thus output from + previous turns (text and audio tokens) will become the input for later turns.""" + conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Which conversation the response is added to, determined by the ``conversation`` field in the + ``response.create`` event. If ``auto``, the response will be added to the default conversation + and the value of ``conversation_id`` will be an id like ``conv_1234``. If ``none``, the + response will not be added to any conversation and the value of ``conversation_id`` will be + ``null``. If responses are being triggered automatically by VAD the response will be added to + the default conversation.""" + output_modalities: Optional[list[Literal["text", "audio"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The set of modalities the model used to respond, currently the only possible values are + ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text transcript. Setting the + output to mode ``text`` will disable audio output from the model.""" + max_output_tokens: Optional[Union[int, Literal["inf"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Maximum number of output tokens for a single assistant response, inclusive of tool calls, that + was used in this response. Is either a int type or a Literal[\"inf\"] type.""" + + @overload + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + object: Optional[Literal["realtime.response"]] = None, + status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] = None, + status_details: Optional["_models.RealtimeResponseStatusDetails"] = None, + metadata: Optional["_models.Metadata"] = None, + usage: Optional["_models.RealtimeResponseUsage"] = None, + conversation_id: Optional[str] = None, + output_modalities: Optional[list[Literal["text", "audio"]]] = None, + max_output_tokens: Optional[Union[int, Literal["inf"]]] = 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 OneTimeTrigger(Trigger, discriminator="OneTime"): # pylint: disable=docstring-keyword-should-match-keyword-only + """One-time trigger. + + :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 + """ + + 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, + *, + trigger_at: datetime.datetime, + time_zone: 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 = 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 + + :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 + """ + + __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, + *, + 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 OpenApiAnonymousAuthDetails(OpenApiAuthDetails, discriminator="anonymous"): + """Security details for OpenApi anonymous authentication. + + :ivar type: The object type, which is always 'anonymous'. Required. ANONYMOUS. + :vartype type: str or ~azure.ai.projects.models.ANONYMOUS + """ + + 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__( + 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 = OpenApiAuthType.ANONYMOUS # type: ignore + + +class OpenApiFunctionDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The input definition information for an openapi function. + + :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] + """ + + 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 + 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 OpenApiFunctionDefinitionFunction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """OpenApiFunctionDefinitionFunction. + + :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] + """ + + 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, + *, + name: str, + parameters: dict[str, Any], + 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 OpenApiManagedAuthDetails( + OpenApiAuthDetails, discriminator="managed_identity" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Security details for OpenApi managed_identity authentication. + + :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 + """ + + 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, + *, + security_scheme: "_models.OpenApiManagedSecurityScheme", + ) -> 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 = OpenApiAuthType.MANAGED_IDENTITY # type: ignore + + +class OpenApiManagedSecurityScheme(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Security scheme for OpenApi managed_identity authentication. + + :ivar audience: Authentication scope for managed_identity auth type. Required. + :vartype audience: str + """ + + audience: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Authentication scope for managed_identity auth type. Required.""" + + @overload + def __init__( + self, + *, + audience: 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 OpenApiProjectConnectionAuthDetails( + OpenApiAuthDetails, discriminator="project_connection" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Security details for OpenApi project connection authentication. + + :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 + """ + + 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, + *, + security_scheme: "_models.OpenApiProjectConnectionSecurityScheme", + ) -> 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 = OpenApiAuthType.PROJECT_CONNECTION # type: ignore + + +class OpenApiProjectConnectionSecurityScheme(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Security scheme for OpenApi managed_identity authentication. + + :ivar project_connection_id: Project connection id for Project Connection auth type. Required. + :vartype project_connection_id: str + """ + + 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, + *, + 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 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 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 + """ + + 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, + *, + openapi: "_models.OpenApiFunctionDefinition", + 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.OPENAPI # type: ignore + + +class OpenApiToolboxTool( + ToolboxTool, discriminator="openapi" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An OpenAPI 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. OPENAPI. + :vartype type: str or ~azure.ai.projects.models.OPENAPI + :ivar openapi: The openapi function definition. Required. + :vartype openapi: ~azure.ai.projects.models.OpenApiFunctionDefinition + """ + + 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, + *, + openapi: "_models.OpenApiFunctionDefinition", + 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.OPENAPI # type: ignore + + +class OptimizedAgentIdentifier(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Identifies the registered Foundry agent to optimize (request-only). Skills, tools, and + system_prompt are specified in options.optimization_config. + + :ivar agent_name: Registered Foundry agent name (required). Required. + :vartype agent_name: str + :ivar agent_version: Pinned agent version. Defaults to latest if omitted. + :vartype agent_version: str + """ + + agent_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Registered Foundry agent name (required). Required.""" + agent_version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Pinned agent version. Defaults to latest if omitted.""" + + @overload + def __init__( + self, + *, + agent_name: str, + agent_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 TelemetryEndpoint(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A telemetry export endpoint configuration. + + 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 + """ + + __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, + *, + kind: str, + data: list[Union[str, "_models.TelemetryDataKind"]], + auth: Optional["_models.TelemetryEndpointAuth"] = 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 OtlpTelemetryEndpoint( + TelemetryEndpoint, discriminator="OTLP" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An OTLP (OpenTelemetry Protocol) telemetry export endpoint. + + :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 + """ + + 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: + """ + :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 = TelemetryEndpointKind.OTLP # type: ignore + + +class PendingUploadRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents a request for a pending upload. + + :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 + """ + + 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, + *, + pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE], + pending_upload_id: Optional[str] = None, + connection_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) + + +class PendingUploadResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents the response for a pending upload request. + + :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 + """ + + 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.""" + + @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 + 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 PickPropertiesVoiceAudioConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The template for picking properties. + + :ivar output: Output (agent speech) audio configuration. + :vartype output: ~azure.ai.projects.models.VoiceAudioOutputConfig + """ + + output: Optional["_models.VoiceAudioOutputConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Output (agent speech) audio configuration.""" + + @overload + def __init__( + self, + *, + output: Optional["_models.VoiceAudioOutputConfig"] = 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 ProceduralMemoryItem( + MemoryItem, discriminator="procedural" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A memory item containing a procedure extracted from conversations. + + :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 + """ + + 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, + *, + memory_id: str, + updated_at: datetime.datetime, + scope: str, + content: 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 = MemoryItemKind.PROCEDURAL # type: ignore + + +class ProgrammaticToolCallingParam(Tool, discriminator="programmatic_tool_calling"): + """ProgrammaticToolCallingParam. + + :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 + """ + + 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, + ) -> 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.PROGRAMMATIC_TOOL_CALLING # type: ignore + + +class PromotionInfo(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Promotion metadata recorded when a candidate is deployed to a Foundry agent. + + :ivar promoted_at: Timestamp when promotion occurred, represented in Unix time. Required. + :vartype promoted_at: ~datetime.datetime + :ivar agent_name: Name of the Foundry agent this candidate was promoted to. Required. + :vartype agent_name: str + :ivar agent_version: Version of the Foundry agent this candidate was promoted to. Required. + :vartype agent_version: str + """ + + promoted_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """Timestamp when promotion occurred, represented in Unix time. Required.""" + agent_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the Foundry agent this candidate was promoted to. Required.""" + agent_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Version of the Foundry agent this candidate was promoted to. Required.""" + + @overload + def __init__( + self, + *, + promoted_at: datetime.datetime, + agent_name: str, + agent_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 PromptAgentDefinition( + AgentDefinition, discriminator="prompt" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The prompt agent definition. + + :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 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 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] + """ + + kind: Literal[AgentKind.PROMPT] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. PROMPT.""" + 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.""" + 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( + 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, + *, + model: str, + rai_config: Optional["_models.RaiConfig"] = None, + instructions: Optional[str] = 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 + 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 = AgentKind.PROMPT # 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. + + :ivar format: + :vartype format: ~azure.ai.projects.models.TextResponseFormat + """ + + format: Optional["_models.TextResponseFormat"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + format: Optional["_models.TextResponseFormat"] = 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 PromptBasedEvaluatorDefinition( + EvaluatorDefinition, discriminator="prompt" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Prompt-based evaluator. + + :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 + """ + + 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, + *, + 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 + 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 = 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. + + :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: 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, + *, + 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 = 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 + """ + + 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 ProtocolConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Per-protocol configuration for the agent endpoint. + + :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 + """ + + 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"] + ) + """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, + *, + 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 + 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 ProtocolVersionRecord(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """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". + :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 + """ + + protocol: Union[str, "_models.AgentEndpointProtocol"] = rest_field( + 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.""" + + @overload + def __init__( + self, + *, + protocol: Union[str, "_models.AgentEndpointProtocol"], + 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 RaiConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Configuration for Responsible AI (RAI) content filtering and safety features. + + :ivar rai_policy_name: The name of the RAI policy to apply. Required. + :vartype rai_policy_name: str + """ + + rai_policy_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the RAI policy to apply. Required.""" + + @overload + def __init__( + self, + *, + rai_policy_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) + + +class RankingOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RankingOptions. + + :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 + """ + + 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.""" + + @overload + def __init__( + self, + *, + ranker: Optional[Union[str, "_models.RankerVersionType"]] = None, + score_threshold: Optional[float] = None, + hybrid_search: Optional["_models.HybridSearchOptions"] = 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. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + RealtimeAudioFormatsAudioPcm, RealtimeAudioFormatsAudioPcma, RealtimeAudioFormatsAudioPcmu + + :ivar type: Required. Known values are: "audio/pcm", "audio/pcmu", and "audio/pcma". + :vartype type: str or ~azure.ai.projects.models.RealtimeAudioFormatsType + """ + + __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, + *, + 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 RealtimeAudioFormatsAudioPcm( + RealtimeAudioFormats, discriminator="audio/pcm" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeAudioFormatsAudioPcm. + + :ivar type: Required. AUDIO_PCM. + :vartype type: str or ~azure.ai.projects.models.AUDIO_PCM + :ivar rate: Default value is 24000. + :vartype rate: int + """ + + 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, + *, + rate: Optional[Literal[24000]] = 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 = RealtimeAudioFormatsType.AUDIO_PCM # type: ignore + + +class RealtimeAudioFormatsAudioPcma(RealtimeAudioFormats, discriminator="audio/pcma"): + """RealtimeAudioFormatsAudioPcma. + + :ivar type: Required. AUDIO_PCMA. + :vartype type: str or ~azure.ai.projects.models.AUDIO_PCMA + """ + + type: Literal[RealtimeAudioFormatsType.AUDIO_PCMA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. AUDIO_PCMA.""" + + @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 = RealtimeAudioFormatsType.AUDIO_PCMA # type: ignore + + +class RealtimeAudioFormatsAudioPcmu(RealtimeAudioFormats, discriminator="audio/pcmu"): + """RealtimeAudioFormatsAudioPcmu. + + :ivar type: Required. AUDIO_PCMU. + :vartype type: str or ~azure.ai.projects.models.AUDIO_PCMU + """ + + type: Literal[RealtimeAudioFormatsType.AUDIO_PCMU] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. AUDIO_PCMU.""" + + @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 = RealtimeAudioFormatsType.AUDIO_PCMU # 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 + + :ivar type: Required. Known values are: "function_call", "function_call_output", + "mcp_approval_response", "mcp_list_tools", "mcp_call", and "mcp_approval_request". + :vartype type: str or ~azure.ai.projects.models.RealtimeConversationItemType + """ + + __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\", and \"mcp_approval_request\".""" + + @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 RealtimeConversationItemFunctionCall( + RealtimeConversationItem, discriminator="function_call" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime function call item. + + :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 + """ + + 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"] + ) + """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.""" + + @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, + ) -> 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 = 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. + + :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 + """ + + 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.""" + + @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, + ) -> 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 = RealtimeConversationItemType.FUNCTION_CALL_OUTPUT # type: ignore + + +class RealtimeConversationItemMessage(_Model): # 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 + + :ivar role: Required. Known values are: "system", "user", and "assistant". + :vartype role: str or ~azure.ai.projects.models.RealtimeConversationItemMessageType + """ + + __mapping__: dict[str, _Model] = {} + role: str = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"system\", \"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 RealtimeConversationItemMessageAssistant( + RealtimeConversationItemMessage, discriminator="assistant" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime assistant message item. + + :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. Default value is "message". + :vartype type: str + :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] + """ + + 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["message"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the item. Always ``message``. Required. Default value is \"message\".""" + 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.""" + + @overload + def __init__( + self, + *, + 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 + 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 = RealtimeConversationItemMessageType.ASSISTANT # type: ignore + self.type: Literal["message"] = "message" + + +class RealtimeConversationItemMessageAssistantContent( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeConversationItemMessageAssistantContent. + + :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 + """ + + 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, + *, + type: Optional[Literal["output_text", "output_audio"]] = None, + text: Optional[str] = None, + audio: Optional[str] = None, + transcript: 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 RealtimeConversationItemMessageSystem( + RealtimeConversationItemMessage, discriminator="system" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime system message item. + + :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. Default value is "message". + :vartype type: str + :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] + """ + + 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["message"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the item. Always ``message``. Required. Default value is \"message\".""" + 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.""" + + @overload + def __init__( + self, + *, + 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 + 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 = RealtimeConversationItemMessageType.SYSTEM # type: ignore + self.type: Literal["message"] = "message" + + +class RealtimeConversationItemMessageSystemContent( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeConversationItemMessageSystemContent. + + :ivar type: Default value is "input_text". + :vartype type: str + :ivar text: + :vartype text: 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"]) + + @overload + def __init__( + self, + *, + type: Optional[Literal["input_text"]] = None, + 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 RealtimeConversationItemMessageUser( + RealtimeConversationItemMessage, discriminator="user" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime user message item. + + :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. Default value is "message". + :vartype type: str + :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] + """ + + 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["message"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the item. Always ``message``. Required. Default value is \"message\".""" + 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.""" + + @overload + def __init__( + self, + *, + 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 + 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 = RealtimeConversationItemMessageType.USER # type: ignore + self.type: Literal["message"] = "message" + + +class RealtimeConversationItemMessageUserContent( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeConversationItemMessageUserContent. + + :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 + """ + + 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, + *, + 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 + 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 RealtimeFunctionTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Function tool. + + :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 + """ + + 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, + *, + type: Optional[Literal["function"]] = None, + name: Optional[str] = None, + description: Optional[str] = None, + parameters: Optional["_models.RealtimeFunctionToolParameters"] = 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 RealtimeFunctionToolParameters(_Model): + """RealtimeFunctionToolParameters.""" + + +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 + """ + + 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.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + server_label: str, + name: str, + arguments: 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 = RealtimeConversationItemType.MCP_APPROVAL_REQUEST # type: ignore + + +class RealtimeMCPApprovalResponse( + RealtimeConversationItem, discriminator="mcp_approval_response" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime MCP approval response. + + :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 + """ + + 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"]) + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + approval_request_id: str, + approve: bool, + reason: 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 = RealtimeConversationItemType.MCP_APPROVAL_RESPONSE # type: ignore + + +class RealtimeMCPError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeMCPError. + + 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 + """ + + __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, + *, + 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 RealtimeMCPHTTPError( + RealtimeMCPError, discriminator="http_error" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime MCP HTTP error. + + :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 + """ + + 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, + *, + code: int, + 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] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeMcpErrorType.HTTP_ERROR # type: ignore + + +class RealtimeMCPListTools( + RealtimeConversationItem, discriminator="mcp_list_tools" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime MCP list tools. + + :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] + """ + + 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.""" + + @overload + def __init__( + self, + *, + server_label: str, + tools: list["_models.MCPListToolsTool"], + id: Optional[str] = None, # 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) + self.type = RealtimeConversationItemType.MCP_LIST_TOOLS # type: ignore + + +class RealtimeMCPProtocolError( + RealtimeMCPError, discriminator="protocol_error" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime MCP protocol error. + + :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 + """ + + 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, + *, + code: int, + 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] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeMcpErrorType.PROTOCOL_ERROR # type: ignore + + +class RealtimeMCPToolCall( + RealtimeConversationItem, discriminator="mcp_call" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime MCP tool call. + + :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 + """ + + 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"]) + + @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, + ) -> 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 = 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. + + :ivar type: Required. TOOL_EXECUTION_ERROR. + :vartype type: str or ~azure.ai.projects.models.TOOL_EXECUTION_ERROR + :ivar message: Required. + :vartype message: str + """ + + 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, + *, + 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] + """ + + 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. + + :ivar effort: Known values are: "minimal", "low", "medium", "high", and "xhigh". + :vartype effort: str or ~azure.ai.projects.models.RealtimeReasoningEffort + """ + + 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, + *, + effort: Optional[Union[str, "_models.RealtimeReasoningEffort"]] = 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 RealtimeResponseStatusDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeResponseStatusDetails. + + :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 + """ + + 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"] + ) + + @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, + ) -> 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 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 RealtimeResponseUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeResponseUsage. + + :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 + """ + + 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"] + ) + + @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, + ) -> 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 RealtimeResponseUsageInputTokenDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeResponseUsageInputTokenDetails. + + :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 + """ + + 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"] + ) + + @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, + ) -> 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 RealtimeResponseUsageInputTokenDetailsCachedTokensDetails( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeResponseUsageInputTokenDetailsCachedTokensDetails. + + :ivar text_tokens: + :vartype text_tokens: int + :ivar image_tokens: + :vartype image_tokens: int + :ivar audio_tokens: + :vartype audio_tokens: int + """ + + 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, + *, + text_tokens: Optional[int] = None, + image_tokens: Optional[int] = None, + audio_tokens: 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 RealtimeResponseUsageOutputTokenDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeResponseUsageOutputTokenDetails. + + :ivar text_tokens: + :vartype text_tokens: int + :ivar audio_tokens: + :vartype audio_tokens: int + """ + + 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, + *, + text_tokens: Optional[int] = None, + audio_tokens: 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 RealtimeServerEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A realtime server event. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + RealtimeServerEventResponseContentPartAdded + + :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", and "response.mcp_call.failed". + :vartype type: str or ~azure.ai.projects.models.RealtimeServerEventType + """ + + __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\", and \"response.mcp_call.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 RealtimeServerEventConversationItemInputAudioTranscriptionFailedError( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeServerEventConversationItemInputAudioTranscriptionFailedError. + + :ivar type: + :vartype type: str + :ivar code: + :vartype code: str + :ivar message: + :vartype message: str + :ivar param: + :vartype param: str + """ + + 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, + *, + type: Optional[str] = None, + code: Optional[str] = None, + message: Optional[str] = None, + 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) + + +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 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 + """ + + 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"] + ) + """Details of the error. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + error: "_models.RealtimeServerEventErrorError", + ) -> 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["error"] = "error" + + +class RealtimeServerEventErrorError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeServerEventErrorError. + + :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 + """ + + 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, + *, + type: str, + message: str, + code: Optional[str] = None, + param: Optional[str] = None, + 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 RealtimeServerEventRateLimitsUpdatedRateLimits( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeServerEventRateLimitsUpdatedRateLimits. + + :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 + """ + + 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 + 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 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 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 + """ + + 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.""" + + @overload + def __init__( + self, + *, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + part: "_models.RealtimeServerEventResponseContentPartAddedPart", + ) -> 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_CONTENT_PART_ADDED # type: ignore + + +class RealtimeServerEventResponseContentPartAddedPart( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeServerEventResponseContentPartAddedPart. + + :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 + """ + + 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, + *, + type: Optional[Literal["audio", "text"]] = None, + text: Optional[str] = None, + audio: Optional[str] = None, + transcript: 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 Reasoning(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Reasoning. + + :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 + """ + + 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, + *, + 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 + 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 RecurrenceTrigger( + Trigger, discriminator="Recurrence" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Recurrence based trigger. + + :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 + """ + + 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, + *, + interval: int, + schedule: "_models.RecurrenceSchedule", + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_zone: 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 = TriggerType.RECURRENCE # type: ignore + + +class RedTeam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Red team details. + + :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 + """ + + 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 ReminderPreviewToolboxTool( + ToolboxTool, discriminator="reminder_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A reminder 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. REMINDER_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.REMINDER_PREVIEW + """ + + type: Literal[ToolboxToolType.REMINDER_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. REMINDER_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.REMINDER_PREVIEW # type: ignore + + +class ResponsesProtocolConfiguration(_Model): + """Configuration specific to the responses protocol.""" + + +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 + """ + + 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 ResponseUsageOutputTokensDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ResponseUsageOutputTokensDetails. + + :ivar reasoning_tokens: Required. + :vartype reasoning_tokens: int + """ + + reasoning_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + reasoning_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 Routine(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A routine definition returned by the service. + + :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 + """ + + 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.""" + + @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, + ) -> 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 RoutineRun(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A single routine run returned from the run history API. + + :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 + """ + + 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, + *, + 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 + 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 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 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 + """ + + 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, + *, + 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 + 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 = EvaluatorDefinitionType.RUBRIC # 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. + + :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.inputs.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 + """ + + 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( + 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.inputs.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, + *, + code: Union[str, "_models.RubricGenerationInputQualityWarningCode"], + severity: Union[str, "_models.RubricGenerationInputQualityWarningSeverity"], + message: str, + source: Union[str, "_models.RubricGenerationInputQualityWarningSource"], + source_index: Optional[int] = None, ) -> None: ... @overload @@ -7213,23 +15588,19 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class FileDataGenerationJobOutput(DataGenerationJobOutput, discriminator="file"): - """Azure OpenAI file output for a data generation job. +class SASCredentials(BaseCredentials, discriminator="SAS"): + """Shared Access Signature (SAS) credential definition. - :ivar type: Azure OpenAI file output. Required. The generated data is an Azure OpenAI File. - :vartype type: str or ~azure.ai.projects.models.FILE - :ivar id: The id of the output Azure OpenAI file. Required. - :vartype id: str - :ivar filename: The filename of the output Azure OpenAI file. Required. - :vartype filename: str + :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 """ - type: Literal[DataGenerationJobOutputType.FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Azure OpenAI file output. Required. The generated data is an Azure OpenAI File.""" - id: str = rest_field(visibility=["read"]) - """The id of the output Azure OpenAI file. Required.""" - filename: str = rest_field(visibility=["read"]) - """The filename of the output Azure OpenAI file. 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__( @@ -7245,34 +15616,74 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DataGenerationJobOutputType.FILE # type: ignore + self.type = CredentialType.SAS # type: ignore -class FileDataGenerationJobSource(DataGenerationJobSource, discriminator="file"): - """File source for data generation jobs — Azure OpenAI file input. +class Schedule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Schedule model. - :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'). + :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 type: The source type for this job, which is File. Required. File source — Azure OpenAI - file. - :vartype type: str or ~azure.ai.projects.models.FILE - :ivar id: Input Azure Open AI file id used for data generation. Required. - :vartype id: 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] """ - type: Literal[DataGenerationJobSourceType.FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The source type for this job, which is File. Required. File source — Azure OpenAI file.""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Input Azure Open AI file id used for data generation. Required.""" + 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.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin + 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 @@ -7284,47 +15695,36 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DataGenerationJobSourceType.FILE # type: ignore -class FileDatasetVersion(DatasetVersion, discriminator="uri_file"): - """FileDatasetVersion Definition. +class ScheduleRoutineTrigger( + RoutineTrigger, discriminator="schedule" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A recurring cron-based routine trigger. - :ivar data_uri: URI of the data (`example `_). - Required. - :vartype data_uri: str - :ivar is_reference: Indicates if the dataset holds a reference to the storage, or the dataset - manages storage itself. If true, the underlying data will not be deleted when the dataset - version is deleted. - :vartype is_reference: bool - :ivar connection_name: The Azure Storage Account connection name. Required if - startPendingUploadVersion was not called before creating the Dataset. - :vartype connection_name: str - :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: Dataset type. Required. URI file. - :vartype type: str or ~azure.ai.projects.models.URI_FILE + :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[DatasetType.URI_FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Dataset type. Required. URI file.""" + 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, *, - data_uri: str, - connection_name: Optional[str] = None, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, + cron_expression: str, + time_zone: str, ) -> None: ... @overload @@ -7336,129 +15736,92 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DatasetType.URI_FILE # type: ignore + self.type = RoutineTriggerType.SCHEDULE # type: ignore -class FileSearchTool(Tool, discriminator="file_search"): - """File search. +class ScheduleRun(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Schedule run model. - :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] + :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] """ - 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["_types.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"] + 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" ) - """Deprecated. This property is deprecated and will be removed in a future version.""" + """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, *, - vector_store_ids: list[str], - max_num_results: Optional[int] = None, - ranking_options: Optional["_models.RankingOptions"] = None, - filters: Optional["_types.Filters"] = None, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + 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) - self.type = ToolType.FILE_SEARCH # type: ignore - - -class FileSearchToolboxTool(ToolboxTool, discriminator="file_search"): - """A file 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: Required. FILE_SEARCH. - :vartype type: str or ~azure.ai.projects.models.FILE_SEARCH - :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 vector_store_ids: The IDs of the vector stores to search. - :vartype vector_store_ids: list[str] + @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 """ - type: Literal[ToolboxToolType.FILE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. FILE_SEARCH.""" - 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"] + 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" ) - """Ranking options for search.""" - filters: Optional["_types.Filters"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Is either a ComparisonFilter type or a CompoundFilter type.""" - vector_store_ids: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The IDs of the vector stores to search.""" + """The Unix timestamp (in seconds) when the file was last modified. Required.""" @overload def __init__( self, *, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, - max_num_results: Optional[int] = None, - ranking_options: Optional["_models.RankingOptions"] = None, - filters: Optional["_types.Filters"] = None, - vector_store_ids: Optional[list[str]] = None, + name: str, + size: int, + is_directory: bool, + modified_time: datetime.datetime, ) -> None: ... @overload @@ -7470,33 +15833,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolboxToolType.FILE_SEARCH # type: ignore - -class VersionSelectionRule(_Model): - """VersionSelectionRule. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - FixedRatioVersionSelectionRule +class SessionFileWriteResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Response from uploading a file to a session sandbox. - :ivar type: Required. "FixedRatio" - :vartype type: str or ~azure.ai.projects.models.VersionSelectorType - :ivar agent_version: The agent version to route traffic to. Required. - :vartype agent_version: str + :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 """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. \"FixedRatio\"""" - agent_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The agent version to route traffic to. Required.""" + 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, *, - type: str, - agent_version: str, + path: str, + bytes_written: int, ) -> None: ... @overload @@ -7510,29 +15869,51 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class FixedRatioVersionSelectionRule(VersionSelectionRule, discriminator="FixedRatio"): - """FixedRatioVersionSelectionRule. +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. - :ivar agent_version: The agent version to route traffic to. Required. - :vartype agent_version: str - :ivar type: Required. FIXED_RATIO. - :vartype type: str or ~azure.ai.projects.models.FIXED_RATIO - :ivar traffic_percentage: The percentage of traffic to route to the version. Must be between 0 - and 100. Required. - :vartype traffic_percentage: int + 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 """ - type: Literal[VersionSelectorType.FIXED_RATIO] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. FIXED_RATIO.""" - traffic_percentage: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The percentage of traffic to route to the version. Must be between 0 and 100. Required.""" + 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, *, - agent_version: str, - traffic_percentage: int, + event: Union[str, "_models.SessionLogEventType"], + data: str, ) -> None: ... @overload @@ -7544,47 +15925,27 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = VersionSelectorType.FIXED_RATIO # type: ignore -class FolderDatasetVersion(DatasetVersion, discriminator="uri_folder"): - """FileDatasetVersion Definition. +class SharepointGroundingToolParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The sharepoint grounding tool parameters. - :ivar data_uri: URI of the data (`example `_). - Required. - :vartype data_uri: str - :ivar is_reference: Indicates if the dataset holds a reference to the storage, or the dataset - manages storage itself. If true, the underlying data will not be deleted when the dataset - version is deleted. - :vartype is_reference: bool - :ivar connection_name: The Azure Storage Account connection name. Required if - startPendingUploadVersion was not called before creating the Dataset. - :vartype connection_name: str - :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: Dataset type. Required. URI folder. - :vartype type: str or ~azure.ai.projects.models.URI_FOLDER + :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] """ - type: Literal[DatasetType.URI_FOLDER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Dataset type. Required. URI folder.""" + 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, *, - data_uri: str, - connection_name: Optional[str] = None, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, + project_connections: Optional[list["_models.ToolProjectConnection"]] = None, ) -> None: ... @overload @@ -7596,32 +15957,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DatasetType.URI_FOLDER # type: ignore -class FoundryModelWarning(_Model): - """A warning associated with a model. +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 code: The warning code. Known values are: "RuntimeDependentArtifact" and - "UnclassifiedArtifact". - :vartype code: str or ~azure.ai.projects.models.FoundryModelWarningCode - :ivar message: The warning message. - :vartype message: str + :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 """ - code: Optional[Union[str, "_models.FoundryModelWarningCode"]] = rest_field( + 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 warning code. Known values are: \"RuntimeDependentArtifact\" and \"UnclassifiedArtifact\".""" - message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The warning message.""" + """The sharepoint grounding tool parameters. Required.""" @overload def __init__( self, *, - code: Optional[Union[str, "_models.FoundryModelWarningCode"]] = None, - message: Optional[str] = None, + sharepoint_grounding_preview: "_models.SharepointGroundingToolParameters", ) -> None: ... @overload @@ -7633,47 +15996,44 @@ 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 -class FunctionShellToolParam(Tool, discriminator="shell"): - """Shell tool. +class SimpleQnADataGenerationJobOptions( + DataGenerationJobOptions, discriminator="simple_qna" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The options for a data generation job with SimpleQnA type. - :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 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 max_samples: Maximum number of samples to generate. Required. + :vartype max_samples: int + :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 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[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"] - ) - 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( + 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.""" + question_types: Optional[list[Union[str, "_models.SimpleQnAFineTuningQuestionType"]]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Deprecated. This property is deprecated and will be removed in a future version.""" + """The question types to generate. Used only for fine-tuning scenarios.""" @overload def __init__( self, *, - environment: Optional["_models.FunctionShellToolParamEnvironment"] = None, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + 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 @@ -7685,31 +16045,52 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.SHELL # type: ignore - + self.type = DataGenerationJobType.SIMPLE_QNA # type: ignore -class FunctionShellToolParamEnvironmentContainerReferenceParam( - FunctionShellToolParamEnvironment, discriminator="container_reference" -): # pylint: disable=name-too-long - """FunctionShellToolParamEnvironmentContainerReferenceParam. - :ivar type: References a container created with the /v1/containers endpoint. Required. - CONTAINER_REFERENCE. - :vartype type: str or ~azure.ai.projects.models.CONTAINER_REFERENCE - :ivar container_id: The ID of the referenced container. Required. - :vartype container_id: str +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 """ - type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """References a container created with the /v1/containers endpoint. Required. CONTAINER_REFERENCE.""" - container_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the referenced container. Required.""" + 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, *, - container_id: str, + id: str, # pylint: disable=redefined-builtin + name: str, + description: str, + created_at: datetime.datetime, + default_version: str, + latest_version: str, ) -> None: ... @overload @@ -7721,32 +16102,52 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE # type: ignore -class FunctionShellToolParamEnvironmentLocalEnvironmentParam( - FunctionShellToolParamEnvironment, discriminator="local" -): # pylint: disable=name-too-long - """FunctionShellToolParamEnvironmentLocalEnvironmentParam. +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 type: Use a local computer environment. Required. LOCAL. - :vartype type: str or ~azure.ai.projects.models.LOCAL - :ivar skills: An optional list of skills. - :vartype skills: list[~azure.ai.projects.models.LocalSkillParam] + :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] """ - type: Literal[FunctionShellToolParamEnvironmentType.LOCAL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Use a local computer environment. Required. LOCAL.""" - skills: Optional[list["_models.LocalSkillParam"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """An optional list of skills.""" + 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, *, - skills: Optional[list["_models.LocalSkillParam"]] = None, + 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 @@ -7758,47 +16159,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = FunctionShellToolParamEnvironmentType.LOCAL # type: ignore -class FunctionTool(Tool, discriminator="function"): - """Function. +class SkillReferenceParam( + ContainerSkill, discriminator="skill_reference" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """SkillReferenceParam. - :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 description: - :vartype description: str - :ivar parameters: Required. - :vartype parameters: 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 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[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.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - parameters: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - 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.""" + 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, *, - name: str, - parameters: dict[str, Any], - strict: bool, - description: Optional[str] = None, - defer_loading: Optional[bool] = None, + skill_id: str, + version: Optional[str] = None, ) -> None: ... @overload @@ -7810,47 +16198,51 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.FUNCTION # type: ignore + self.type = ContainerSkillType.SKILL_REFERENCE # type: ignore -class FunctionToolParam(_Model): - """FunctionToolParam. +class SkillVersion(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A specific version of a skill. - :ivar name: Required. + :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 description: + :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 parameters: - :vartype parameters: ~azure.ai.projects.models.EmptyModelParam - :ivar strict: - :vartype strict: bool - :ivar type: Required. Default value is "function". - :vartype type: str - :ivar defer_loading: Whether this function should be deferred and discovered via tool search. - :vartype defer_loading: bool + :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"]) - """Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - parameters: Optional["_models.EmptyModelParam"] = 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" ) - strict: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - type: Literal["function"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"function\".""" - defer_loading: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether this function should be deferred and discovered via tool search.""" + """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, - description: Optional[str] = None, - parameters: Optional["_models.EmptyModelParam"] = None, - strict: Optional[bool] = None, - defer_loading: Optional[bool] = None, + version: str, + description: str, + created_at: datetime.datetime, ) -> None: ... @overload @@ -7862,51 +16254,38 @@ 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 GitHubIssueRoutineTrigger(RoutineTrigger, discriminator="github_issue"): - """A GitHub issue routine trigger. +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. - :ivar type: The trigger type. Required. A GitHub issue trigger. - :vartype type: str or ~azure.ai.projects.models.GITHUB_ISSUE - :ivar connection_id: The workspace connection identifier that resolves the GitHub configuration - for the trigger. Required. - :vartype connection_id: str - :ivar owner: The GitHub owner or organization that scopes which issues can fire the trigger. - Required. - :vartype owner: str - :ivar repository: The GitHub repository filter that scopes which issues can fire the trigger. - Required. - :vartype repository: str - :ivar issue_event: The GitHub issue event that fires the routine. Required. Known values are: - "opened" and "closed". - :vartype issue_event: str or ~azure.ai.projects.models.GitHubIssueEvent + 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 """ - type: Literal[RoutineTriggerType.GITHUB_ISSUE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The trigger type. Required. A GitHub issue trigger.""" - connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The workspace connection identifier that resolves the GitHub configuration for the trigger. - Required.""" - owner: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The GitHub owner or organization that scopes which issues can fire the trigger. Required.""" - repository: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The GitHub repository filter that scopes which issues can fire the trigger. Required.""" - issue_event: Union[str, "_models.GitHubIssueEvent"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The GitHub issue event that fires the routine. Required. Known values are: \"opened\" and - \"closed\".""" + __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, *, - connection_id: str, - owner: str, - repository: str, - issue_event: Union[str, "_models.GitHubIssueEvent"], + type: str, ) -> None: ... @overload @@ -7918,28 +16297,21 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RoutineTriggerType.GITHUB_ISSUE # type: ignore -class TelemetryEndpointAuth(_Model): - """Authentication configuration for a telemetry endpoint. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - HeaderTelemetryEndpointAuth +class SpecificApplyPatchParam(ToolChoiceParam, discriminator="apply_patch"): + """Specific apply patch tool choice. - :ivar type: The authentication type. Required. "header" - :vartype type: str or ~azure.ai.projects.models.TelemetryEndpointAuthType + :ivar type: The tool to call. Always ``apply_patch``. Required. APPLY_PATCH. + :vartype type: str or ~azure.ai.projects.models.APPLY_PATCH """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The authentication type. Required. \"header\"""" + 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, - *, - type: str, ) -> None: ... @overload @@ -7951,40 +16323,22 @@ 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 -class HeaderTelemetryEndpointAuth(TelemetryEndpointAuth, discriminator="header"): - """Header-based secret authentication for a telemetry endpoint. The resolved secret value is - injected as an HTTP header. +class SpecificFunctionShellParam(ToolChoiceParam, discriminator="shell"): + """Specific shell tool choice. - :ivar type: The authentication type, always 'header' for header-based secret authentication. - Required. Header-based secret authentication. - :vartype type: str or ~azure.ai.projects.models.HEADER - :ivar header_name: The name of the HTTP header to inject the secret value into. Required. - :vartype header_name: str - :ivar secret_id: The identifier of the secret store or connection. Required. - :vartype secret_id: str - :ivar secret_key: The key within the secret to retrieve the authentication value. Required. - :vartype secret_key: str + :ivar type: The tool to call. Always ``shell``. Required. SHELL. + :vartype type: str or ~azure.ai.projects.models.SHELL """ - type: Literal[TelemetryEndpointAuthType.HEADER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The authentication type, always 'header' for header-based secret authentication. Required. - Header-based secret authentication.""" - header_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the HTTP header to inject the secret value into. Required.""" - secret_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The identifier of the secret store or connection. Required.""" - secret_key: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The key within the secret to retrieve the authentication value. Required.""" + 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, - *, - header_name: str, - secret_id: str, - secret_key: str, ) -> None: ... @overload @@ -7996,79 +16350,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = TelemetryEndpointAuthType.HEADER # type: ignore + self.type = ToolChoiceParamType.SHELL # type: ignore -class HostedAgentDefinition(AgentDefinition, discriminator="hosted"): - """The hosted agent definition. +class SpecificProgrammaticToolCallingParam(ToolChoiceParam, discriminator="programmatic_tool_calling"): + """SpecificProgrammaticToolCallingParam. - :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. - :vartype rai_config: ~azure.ai.projects.models.RaiConfig - :ivar kind: Required. HOSTED. - :vartype kind: str or ~azure.ai.projects.models.HOSTED - :ivar cpu: The CPU configuration for the hosted agent. Required. - :vartype cpu: str - :ivar memory: The memory configuration for the hosted agent. Required. - :vartype memory: str - :ivar environment_variables: Environment variables to set in the hosted agent container. - :vartype environment_variables: dict[str, str] - :ivar container_configuration: Container-based deployment configuration. Provide this for - image-based deployments. Mutually exclusive with code_configuration — the service validates - that exactly one is set. - :vartype container_configuration: ~azure.ai.projects.models.ContainerConfiguration - :ivar protocol_versions: The protocols that the agent supports for ingress communication. - :vartype protocol_versions: list[~azure.ai.projects.models.ProtocolVersionRecord] - :ivar code_configuration: Code-based deployment configuration. Provide this for code-based - deployments. Mutually exclusive with container_configuration — the service validates that - exactly one is set. - :vartype code_configuration: ~azure.ai.projects.models.CodeConfiguration - :ivar telemetry_config: Optional customer-supplied telemetry configuration for exporting - container logs, traces, and metrics. - :vartype telemetry_config: ~azure.ai.projects.models.TelemetryConfig + :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 """ - kind: Literal[AgentKind.HOSTED] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. HOSTED.""" - cpu: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The CPU configuration for the hosted agent. Required.""" - memory: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The memory configuration for the hosted agent. Required.""" - environment_variables: Optional[dict[str, str]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Environment variables to set in the hosted agent container.""" - container_configuration: Optional["_models.ContainerConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Container-based deployment configuration. Provide this for image-based deployments. Mutually - exclusive with code_configuration — the service validates that exactly one is set.""" - protocol_versions: Optional[list["_models.ProtocolVersionRecord"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The protocols that the agent supports for ingress communication.""" - code_configuration: Optional["_models.CodeConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Code-based deployment configuration. Provide this for code-based deployments. Mutually - exclusive with container_configuration — the service validates that exactly one is set.""" - telemetry_config: Optional["_models.TelemetryConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Optional customer-supplied telemetry configuration for exporting container logs, traces, and - metrics.""" + 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, - *, - cpu: str, - memory: str, - rai_config: Optional["_models.RaiConfig"] = None, - environment_variables: Optional[dict[str, str]] = None, - container_configuration: Optional["_models.ContainerConfiguration"] = None, - protocol_versions: Optional[list["_models.ProtocolVersionRecord"]] = None, - code_configuration: Optional["_models.CodeConfiguration"] = None, - telemetry_config: Optional["_models.TelemetryConfig"] = None, ) -> None: ... @overload @@ -8080,22 +16378,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = AgentKind.HOSTED # type: ignore + self.type = ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING # type: ignore -class HourlyRecurrenceSchedule(RecurrenceSchedule, discriminator="Hourly"): - """Hourly recurrence schedule. +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 type: Required. Hourly recurrence pattern. - :vartype type: str or ~azure.ai.projects.models.HOURLY + :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 """ - type: Literal[RecurrenceType.HOURLY] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Hourly recurrence pattern.""" + 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 @@ -8107,28 +16425,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RecurrenceType.HOURLY # type: ignore -class HumanEvaluationPreviewRuleAction(EvaluationRuleAction, discriminator="humanEvaluationPreview"): - """Evaluation rule action for human evaluation. +class StructuredOutputDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A structured output that can be produced by the agent. - :ivar type: Required. Human evaluation preview. - :vartype type: str or ~azure.ai.projects.models.HUMAN_EVALUATION_PREVIEW - :ivar template_id: Human evaluation template Id. Required. - :vartype template_id: str + :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 """ - type: Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Human evaluation preview.""" - template_id: str = rest_field(name="templateId", visibility=["read", "create", "update", "delete", "query"]) - """Human evaluation template Id. Required.""" + 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, *, - template_id: str, + name: str, + description: str, + schema: dict[str, Any], + strict: bool, ) -> None: ... @overload @@ -8140,29 +16470,38 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW # type: ignore -class HybridSearchOptions(_Model): - """HybridSearchOptions. +class TaskGenerationDataGenerationJobOptions( + DataGenerationJobOptions, discriminator="task_generation" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The options 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 embedding_weight: The weight of the embedding in the reciprocal ranking fusion. Required. - :vartype embedding_weight: float - :ivar text_weight: The weight of the text in the reciprocal ranking fusion. Required. - :vartype text_weight: float + :ivar max_samples: Maximum number of samples to generate. Required. + :vartype max_samples: int + :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 TaskGeneration for this model. Required. + Task generation for evaluation scenarios. + :vartype type: str or ~azure.ai.projects.models.TASK_GENERATION """ - embedding_weight: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The weight of the embedding in the reciprocal ranking fusion. Required.""" - text_weight: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The weight of the text in the reciprocal ranking fusion. Required.""" + type: Literal[DataGenerationJobType.TASK_GENERATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The data generation job type, which is TaskGeneration for this model. Required. Task generation + for evaluation scenarios.""" @overload def __init__( self, *, - embedding_weight: float, - text_weight: float, + max_samples: int, + train_split: Optional[float] = None, + model_options: Optional["_models.DataGenerationModelOptions"] = None, ) -> None: ... @overload @@ -8174,158 +16513,59 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = DataGenerationJobType.TASK_GENERATION # type: ignore -class ImageGenTool(Tool, discriminator="image_generation"): - """Image generation tool. +class TaxonomyCategory(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Taxonomy category definition. - :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"], str - :vartype model: 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"], - 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: Background type for the generated image. One of ``transparent``, ``opaque``, - or ``auto``. 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. + :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: Deprecated. This property is deprecated and will be removed in a future - version. + :ivar description: Description of the taxonomy category. :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 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] """ - 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"], 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\"], str""" - quality: Optional[Literal["low", "medium", "high", "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\"]""" - 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""" - 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"] - ) - """Background type for the generated image. One of ``transparent``, ``opaque``, or ``auto``. - 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.""" + 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"]) - """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"] + """Description of the taxonomy category.""" + risk_category: Union[str, "_models.RiskCategory"] = rest_field( + name="riskCategory", visibility=["read", "create", "update", "delete", "query"] ) - """Deprecated. This property is deprecated and will be removed in a future version.""" + """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, *, - model: Optional[ - Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], Literal["gpt-image-1.5"], str] - ] = None, - quality: Optional[Literal["low", "medium", "high", "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, + id: str, # pylint: disable=redefined-builtin + name: str, + risk_category: Union[str, "_models.RiskCategory"], + sub_categories: list["_models.TaxonomySubCategory"], description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + properties: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -8337,27 +16577,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.IMAGE_GENERATION # type: ignore -class ImageGenToolInputImageMask(_Model): - """ImageGenToolInputImageMask. +class TaxonomySubCategory(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Taxonomy sub-category definition. - :ivar image_url: - :vartype image_url: str - :ivar file_id: - :vartype file_id: str + :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] """ - image_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - file_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + 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, *, - image_url: Optional[str] = None, - file_id: Optional[str] = None, + id: str, # pylint: disable=redefined-builtin + name: str, + enabled: bool, + description: Optional[str] = None, + properties: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -8371,35 +16627,23 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InlineSkillParam(ContainerSkill, discriminator="inline"): - """InlineSkillParam. +class TelemetryConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Customer-supplied telemetry configuration for exporting container logs, traces, and metrics. - :ivar type: Defines an inline skill for this request. Required. INLINE. - :vartype type: str or ~azure.ai.projects.models.INLINE - :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.InlineSkillSourceParam + :ivar endpoints: Customer-supplied telemetry export endpoint configurations. Required. + :vartype endpoints: list[~azure.ai.projects.models.TelemetryEndpoint] """ - type: Literal[ContainerSkillType.INLINE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Defines an inline skill for this request. Required. 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.InlineSkillSourceParam" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Inline skill payload. Required.""" + endpoints: list["_models.TelemetryEndpoint"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Customer-supplied telemetry export endpoint configurations. Required.""" @overload def __init__( self, *, - name: str, - description: str, - source: "_models.InlineSkillSourceParam", + endpoints: list["_models.TelemetryEndpoint"], ) -> None: ... @overload @@ -8411,35 +16655,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ContainerSkillType.INLINE # type: ignore -class InlineSkillSourceParam(_Model): - """Inline skill payload. +class TemplateVoiceGreetingConfig( + VoiceGreetingConfig, discriminator="template" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A deterministic greeting rendered with the voice agent's structured inputs and synthesized + without model-authored generation. - :ivar type: The type of the inline skill source. Must be ``base64``. Required. Default value is - "base64". + :ivar type: Required. Default value is "template". :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 + :ivar text: The Handlebars text template spoken at session start. Required. + :vartype text: str """ - 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.""" + type: Literal["template"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"template\".""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Handlebars text template spoken at session start. Required.""" @overload def __init__( self, *, - data: str, + text: str, ) -> None: ... @overload @@ -8451,48 +16690,61 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["base64"] = "base64" - self.media_type: Literal["application/zip"] = "application/zip" + self.type = "template" # type: ignore -class Insight(_Model): - """The response body for cluster insights. +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. - :ivar insight_id: The unique identifier for the insights report. Required. - :vartype insight_id: str - :ivar metadata: Metadata about the insights report. Required. - :vartype metadata: ~azure.ai.projects.models.InsightsMetadata - :ivar state: The current state of the insights. Required. Known values are: "NotStarted", - "Running", "Succeeded", "Failed", and "Canceled". - :vartype state: str or ~azure.ai.projects.models.OperationState - :ivar display_name: User friendly display name for the insight. Required. - :vartype display_name: str - :ivar request: Request for the insights analysis. Required. - :vartype request: ~azure.ai.projects.models.InsightRequest - :ivar result: The result of the insights report. - :vartype result: ~azure.ai.projects.models.InsightResult + 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 """ - insight_id: str = rest_field(name="id", visibility=["read"]) - """The unique identifier for the insights report. Required.""" - metadata: "_models.InsightsMetadata" = rest_field(visibility=["read"]) - """Metadata about the insights report. Required.""" - state: Union[str, "_models.OperationState"] = rest_field(visibility=["read"]) - """The current state of the insights. Required. Known values are: \"NotStarted\", \"Running\", - \"Succeeded\", \"Failed\", and \"Canceled\".""" - display_name: str = rest_field(name="displayName", visibility=["read", "create", "update", "delete", "query"]) - """User friendly display name for the insight. Required.""" - request: "_models.InsightRequest" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Request for the insights analysis. Required.""" - result: Optional["_models.InsightResult"] = rest_field(visibility=["read"]) - """The result of the insights report.""" + __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, - *, - display_name: str, - request: "_models.InsightRequest", ) -> None: ... @overload @@ -8504,66 +16756,49 @@ 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 -class InsightCluster(_Model): - """A cluster of analysis samples. +class TextResponseFormatJsonSchema( + TextResponseFormat, discriminator="json_schema" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """JSON schema. - :ivar id: The id of the analysis cluster. Required. - :vartype id: str - :ivar label: Label for the cluster. Required. - :vartype label: str - :ivar suggestion: Suggestion for the cluster. Required. - :vartype suggestion: str - :ivar suggestion_title: The title of the suggestion for the cluster. Required. - :vartype suggestion_title: str - :ivar description: Description of the analysis cluster. Required. + :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 weight: The weight of the analysis cluster. This indicate number of samples in the - cluster. Required. - :vartype weight: int - :ivar sub_clusters: List of subclusters within this cluster. Empty if no subclusters exist. - :vartype sub_clusters: list[~azure.ai.projects.models.InsightCluster] - :ivar samples: List of samples that belong to this cluster. Empty if samples are part of - subclusters. - :vartype samples: list[~azure.ai.projects.models.InsightSample] + :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 """ - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The id of the analysis cluster. Required.""" - label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Label for the cluster. Required.""" - suggestion: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Suggestion for the cluster. Required.""" - suggestion_title: str = rest_field( - name="suggestionTitle", visibility=["read", "create", "update", "delete", "query"] - ) - """The title of the suggestion for the cluster. Required.""" - description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Description of the analysis cluster. Required.""" - weight: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The weight of the analysis cluster. This indicate number of samples in the cluster. Required.""" - sub_clusters: Optional[list["_models.InsightCluster"]] = rest_field( - name="subClusters", visibility=["read", "create", "update", "delete", "query"] - ) - """List of subclusters within this cluster. Empty if no subclusters exist.""" - samples: Optional[list["_models.InsightSample"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """List of samples that belong to this cluster. Empty if samples are part of subclusters.""" + 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 - label: str, - suggestion: str, - suggestion_title: str, - description: str, - weight: int, - sub_clusters: Optional[list["_models.InsightCluster"]] = None, - samples: Optional[list["_models.InsightSample"]] = None, + name: str, + schema: dict[str, Any], + description: Optional[str] = None, + strict: Optional[bool] = None, ) -> None: ... @overload @@ -8575,28 +16810,22 @@ 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 InsightModelConfiguration(_Model): - """Configuration of the model used in the insight generation. +class TextResponseFormatText(TextResponseFormat, discriminator="text"): + """Text. - :ivar model_deployment_name: The model deployment to be evaluated. Accepts either the - deployment name alone or with the connection name as '{connectionName}/'. - Required. - :vartype model_deployment_name: str + :ivar type: The type of response format being defined. Always ``text``. Required. TEXT. + :vartype type: str or ~azure.ai.projects.models.TEXT """ - model_deployment_name: str = rest_field( - name="modelDeploymentName", visibility=["read", "create", "update", "delete", "query"] - ) - """The model deployment to be evaluated. Accepts either the deployment name alone or with the - connection name as '{connectionName}/'. Required.""" + 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, - *, - model_deployment_name: str, ) -> None: ... @overload @@ -8608,30 +16837,32 @@ 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 InsightScheduleTask(ScheduleTask, discriminator="Insight"): - """Insight task for the schedule. +class TimerRoutineTrigger( + RoutineTrigger, discriminator="timer" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A one-shot timer routine trigger. - :ivar configuration: Configuration for the task. - :vartype configuration: dict[str, str] - :ivar type: Required. Insight task. - :vartype type: str or ~azure.ai.projects.models.INSIGHT - :ivar insight: The insight payload. Required. - :vartype insight: ~azure.ai.projects.models.Insight + :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[ScheduleTaskType.INSIGHT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Insight task.""" - insight: "_models.Insight" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The insight payload. Required.""" + 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.""" @overload def __init__( self, *, - insight: "_models.Insight", - configuration: Optional[dict[str, str]] = None, + at: Optional[datetime.datetime] = None, ) -> None: ... @overload @@ -8643,33 +16874,36 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ScheduleTaskType.INSIGHT # type: ignore + self.type = RoutineTriggerType.TIMER # type: ignore -class InsightsMetadata(_Model): - """Metadata about the insights. +class ToolboxObject(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A toolbox that stores reusable tool definitions for agents. - :ivar created_at: The timestamp when the insights were created. Required. - :vartype created_at: ~datetime.datetime - :ivar completed_at: The timestamp when the insights were completed. - :vartype completed_at: ~datetime.datetime + :ivar id: The unique identifier of the toolbox. Required. + :vartype id: str + :ivar name: The name of the toolbox. Required. + :vartype name: str + :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 """ - created_at: datetime.datetime = rest_field( - name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """The timestamp when the insights were created. Required.""" - completed_at: Optional[datetime.datetime] = rest_field( - name="completedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """The timestamp when the insights were completed.""" + 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.""" + 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, *, - created_at: datetime.datetime, - completed_at: Optional[datetime.datetime] = None, + id: str, # pylint: disable=redefined-builtin + name: str, + default_version: str, ) -> None: ... @overload @@ -8683,45 +16917,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InsightSummary(_Model): - """Summary of the error cluster analysis. +class ToolboxPolicies(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Policy configuration for a toolbox, including content safety and other governance settings. - :ivar sample_count: Total number of samples analyzed. Required. - :vartype sample_count: int - :ivar unique_subcluster_count: Total number of unique subcluster labels. Required. - :vartype unique_subcluster_count: int - :ivar unique_cluster_count: Total number of unique clusters. Required. - :vartype unique_cluster_count: int - :ivar method: Method used for clustering. Required. - :vartype method: str - :ivar usage: Token usage while performing clustering analysis. Required. - :vartype usage: ~azure.ai.projects.models.ClusterTokenUsage + :ivar rai_config: Responsible AI content filtering configuration. + :vartype rai_config: ~azure.ai.projects.models.RaiConfig """ - sample_count: int = rest_field(name="sampleCount", visibility=["read", "create", "update", "delete", "query"]) - """Total number of samples analyzed. Required.""" - unique_subcluster_count: int = rest_field( - name="uniqueSubclusterCount", visibility=["read", "create", "update", "delete", "query"] - ) - """Total number of unique subcluster labels. Required.""" - unique_cluster_count: int = rest_field( - name="uniqueClusterCount", visibility=["read", "create", "update", "delete", "query"] - ) - """Total number of unique clusters. Required.""" - method: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Method used for clustering. Required.""" - usage: "_models.ClusterTokenUsage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Token usage while performing clustering analysis. Required.""" + rai_config: Optional["_models.RaiConfig"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Responsible AI content filtering configuration.""" @overload def __init__( self, *, - sample_count: int, - unique_subcluster_count: int, - unique_cluster_count: int, - method: str, - usage: "_models.ClusterTokenUsage", + rai_config: Optional["_models.RaiConfig"] = None, ) -> None: ... @overload @@ -8735,35 +16945,34 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InvocationsProtocolConfiguration(_Model): - """Configuration specific to the invocations protocol.""" - - -class InvocationsWsProtocolConfiguration(_Model): - """Configuration specific to the WebSocket-based invocations protocol.""" - - -class RoutineDispatchPayload(_Model): - """Base model for a manual dispatch payload. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - InvokeAgentInvocationsApiDispatchPayload, InvokeAgentResponsesApiDispatchPayload +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 manual dispatch payload type. Required. Known values are: - "invoke_agent_responses_api" and "invoke_agent_invocations_api". - :vartype type: str or ~azure.ai.projects.models.RoutineDispatchPayloadType + :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 """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The manual dispatch payload type. Required. Known values are: \"invoke_agent_responses_api\" - and \"invoke_agent_invocations_api\".""" + 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: str, + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -8775,31 +16984,28 @@ 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 InvokeAgentInvocationsApiDispatchPayload(RoutineDispatchPayload, discriminator="invoke_agent_invocations_api"): - """A manual payload used to test an invocations API routine dispatch. +class ToolboxSkill(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A skill source included in a toolbox. - :ivar type: The manual dispatch payload type. Required. A manual payload for an invocations API - routine dispatch. - :vartype type: str or ~azure.ai.projects.models.INVOKE_AGENT_INVOCATIONS_API - :ivar input: The JSON value sent as the complete downstream invocations input. The value is - passed through as-is and can be an object, string, number, boolean, array, or null. Required. - :vartype input: any - """ + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ToolboxSkillReference - type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The manual dispatch payload type. Required. A manual payload for an invocations API routine - dispatch.""" - input: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The JSON value sent as the complete downstream invocations input. The value is passed through - as-is and can be an object, string, number, boolean, array, or null. Required.""" + :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"]) + """The type of skill source. Required. Default value is None.""" @overload def __init__( self, *, - input: Any, + type: str, ) -> None: ... @overload @@ -8811,30 +17017,36 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API # type: ignore - -class RoutineAction(_Model): - """Base model for a routine action. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - InvokeAgentInvocationsApiRoutineAction, InvokeAgentResponsesApiRoutineAction +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 action type. Required. Known values are: "invoke_agent_responses_api" and - "invoke_agent_invocations_api". - :vartype type: str or ~azure.ai.projects.models.RoutineActionType + :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 """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The action type. Required. Known values are: \"invoke_agent_responses_api\" and - \"invoke_agent_invocations_api\".""" + 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, *, - type: str, + name: str, + version: Optional[str] = None, ) -> None: ... @overload @@ -8846,47 +17058,82 @@ 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 -class InvokeAgentInvocationsApiRoutineAction(RoutineAction, discriminator="invoke_agent_invocations_api"): - """Dispatches a routine through the raw invocations API. Exactly one of agent_name or - agent_endpoint_id must be provided. +class ToolboxVersionObject(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A specific version of a toolbox. - :ivar type: The action type. Required. Dispatches through the raw invocations API. - :vartype type: str or ~azure.ai.projects.models.INVOKE_AGENT_INVOCATIONS_API - :ivar agent_name: The project-scoped agent name for routine dispatch. - :vartype agent_name: str - :ivar agent_endpoint_id: Legacy endpoint-scoped agent identifier for routine dispatch. - :vartype agent_endpoint_id: str - :ivar input: Static JSON value sent as the complete downstream input when the routine fires. - The value is passed through as-is; no templating is applied. - :vartype input: any - :ivar session_id: An optional existing hosted-agent session identifier to continue during the - downstream dispatch. - :vartype session_id: str + :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 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[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The action type. Required. Dispatches through the raw invocations API.""" - agent_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The project-scoped agent name for routine dispatch.""" - agent_endpoint_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Legacy endpoint-scoped agent identifier for routine dispatch.""" - input: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Static JSON value sent as the complete downstream input when the routine fires. The value is - passed through as-is; no templating is applied.""" - session_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An optional existing hosted-agent session identifier to continue during the downstream - dispatch.""" + 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.""" @overload def __init__( self, *, - agent_name: Optional[str] = None, - agent_endpoint_id: Optional[str] = None, - input: Optional[Any] = None, - session_id: Optional[str] = None, + 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 @@ -8898,32 +17145,58 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RoutineActionType.INVOKE_AGENT_INVOCATIONS_API # type: ignore -class InvokeAgentResponsesApiDispatchPayload(RoutineDispatchPayload, discriminator="invoke_agent_responses_api"): - """A manual payload used to test a responses API routine dispatch. +class ToolChoiceAllowed( + ToolChoiceParam, discriminator="allowed_tools" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Allowed tools. - :ivar type: The manual dispatch payload type. Required. A manual payload for a responses API - routine dispatch. - :vartype type: str or ~azure.ai.projects.models.INVOKE_AGENT_RESPONSES_API - :ivar input: The JSON value sent as the complete downstream responses input. The value is - passed through as-is and can be an object, string, number, boolean, array, or null. Required. - :vartype input: any + :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[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The manual dispatch payload type. Required. A manual payload for a responses API routine - dispatch.""" - input: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The JSON value sent as the complete downstream responses input. The value is passed through - as-is and can be an object, string, number, boolean, array, or null. Required.""" + 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, *, - input: Any, + mode: Literal["auto", "required"], + tools: list[dict[str, Any]], ) -> None: ... @overload @@ -8935,47 +17208,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API # type: ignore + self.type = ToolChoiceParamType.ALLOWED_TOOLS # type: ignore -class InvokeAgentResponsesApiRoutineAction(RoutineAction, discriminator="invoke_agent_responses_api"): - """Dispatches a routine through the responses API. Exactly one of agent_name or agent_endpoint_id - must be provided. +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 type: The action type. Required. Dispatches through the responses API. - :vartype type: str or ~azure.ai.projects.models.INVOKE_AGENT_RESPONSES_API - :ivar agent_name: The project-scoped agent name for routine dispatch. - :vartype agent_name: str - :ivar agent_endpoint_id: Legacy endpoint-scoped agent identifier for routine dispatch. - :vartype agent_endpoint_id: str - :ivar input: Static JSON value sent as the complete downstream input when the routine fires. - The value is passed through as-is; no templating is applied. - :vartype input: any - :ivar conversation: An optional existing conversation identifier to continue during the - downstream dispatch. - :vartype conversation: str + :ivar type: Required. CODE_INTERPRETER. + :vartype type: str or ~azure.ai.projects.models.CODE_INTERPRETER """ - type: Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The action type. Required. Dispatches through the responses API.""" - agent_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The project-scoped agent name for routine dispatch.""" - agent_endpoint_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Legacy endpoint-scoped agent identifier for routine dispatch.""" - input: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Static JSON value sent as the complete downstream input when the routine fires. The value is - passed through as-is; no templating is applied.""" - conversation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An optional existing conversation identifier to continue during the downstream dispatch.""" + type: Literal[ToolChoiceParamType.CODE_INTERPRETER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. CODE_INTERPRETER.""" @overload def __init__( self, - *, - agent_name: Optional[str] = None, - agent_endpoint_id: Optional[str] = None, - input: Optional[Any] = None, - conversation: Optional[str] = None, ) -> None: ... @overload @@ -8987,42 +17236,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RoutineActionType.INVOKE_AGENT_RESPONSES_API # type: ignore - + self.type = ToolChoiceParamType.CODE_INTERPRETER # type: ignore -class LocalShellToolParam(Tool, discriminator="local_shell"): - """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] - """ +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 `_. - 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.""" + :ivar type: Required. COMPUTER. + :vartype type: str or ~azure.ai.projects.models.COMPUTER + """ + + type: Literal[ToolChoiceParamType.COMPUTER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. COMPUTER.""" @overload def __init__( self, - *, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -9034,34 +17264,23 @@ 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 = ToolChoiceParamType.COMPUTER # type: ignore -class LocalSkillParam(_Model): - """LocalSkillParam. +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: 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 type: Required. COMPUTER_USE. + :vartype type: str or ~azure.ai.projects.models.COMPUTER_USE """ - 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.""" + 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: str, - description: str, - path: str, ) -> None: ... @overload @@ -9073,43 +17292,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_USE # type: ignore -class LoraConfig(_Model): - """Adapter-specific metadata for LoRA models. Drives serving engine configuration at deployment - time. +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 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: Required. COMPUTER_USE_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.COMPUTER_USE_PREVIEW """ - 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[ToolChoiceParamType.COMPUTER_USE_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. COMPUTER_USE_PREVIEW.""" @overload def __init__( self, - *, - rank: Optional[int] = None, - alpha: Optional[int] = None, - target_modules: Optional[list[str]] = None, - dropout: Optional[float] = None, ) -> None: ... @overload @@ -9121,27 +17320,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 ManagedAgentIdentityBlueprintReference(AgentBlueprintReference, discriminator="ManagedAgentIdentityBlueprint"): - """ManagedAgentIdentityBlueprintReference. +class ToolChoiceCustom( + ToolChoiceParam, discriminator="custom" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Custom tool. - :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 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[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.""" + 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, *, - blueprint_id: str, + name: str, ) -> None: ... @overload @@ -9153,40 +17355,23 @@ 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 = ToolChoiceParamType.CUSTOM # type: ignore -class ManagedAzureAISearchIndex(Index, discriminator="ManagedAzureSearch"): - """Managed Azure AI Search Index Definition. +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 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 type: Required. FILE_SEARCH. + :vartype type: str or ~azure.ai.projects.models.FILE_SEARCH """ - 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.""" + type: Literal[ToolChoiceParamType.FILE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. FILE_SEARCH.""" @overload def __init__( self, - *, - vector_store_id: str, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -9198,149 +17383,30 @@ 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 McpProtocolConfiguration(_Model): - """Configuration specific to the MCP protocol.""" - - -class MCPTool(Tool, discriminator="mcp"): - """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`` or ``connector_id`` must be - provided. - :vartype server_url: str - :ivar connector_id: Identifier for service connectors, like those available in ChatGPT. One of - ``server_url`` or ``connector_id`` must be provided. Learn more about service connectors `here - `_. Currently supported ``connector_id`` values are: + self.type = ToolChoiceParamType.FILE_SEARCH # type: ignore - * 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 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 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[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`` or ``connector_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`` or - ``connector_id`` must be provided. Learn more about service connectors `here - `_. 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\"]""" - 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.""" - 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.""" +class ToolChoiceFunction( + ToolChoiceParam, discriminator="function" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Function tool. - @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, - authorization: Optional[str] = None, - server_description: Optional[str] = None, - headers: Optional[dict[str, str]] = None, - allowed_tools: Optional[Union[list[str], "_models.MCPToolFilter"]] = 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, + :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 + """ + + 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, + *, + name: str, ) -> None: ... @overload @@ -9352,148 +17418,23 @@ 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 = ToolChoiceParamType.FUNCTION # type: ignore -class MCPToolboxTool(ToolboxTool, discriminator="mcp"): - """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`` or ``connector_id`` must be - provided. - :vartype server_url: str - :ivar connector_id: Identifier for service connectors, like those available in ChatGPT. One of - ``server_url`` or ``connector_id`` must be provided. Learn more about service connectors `here - `_. Currently supported ``connector_id`` values are: +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 `_. - * 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 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 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: Required. IMAGE_GENERATION. + :vartype type: str or ~azure.ai.projects.models.IMAGE_GENERATION """ - 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`` or ``connector_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`` or - ``connector_id`` must be provided. Learn more about service connectors `here - `_. 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\"]""" - 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.""" - 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.""" + type: Literal[ToolChoiceParamType.IMAGE_GENERATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. IMAGE_GENERATION.""" @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, - authorization: Optional[str] = None, - server_description: Optional[str] = None, - headers: Optional[dict[str, str]] = None, - allowed_tools: Optional[Union[list[str], "_models.MCPToolFilter"]] = 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 @@ -9505,35 +17446,34 @@ 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 = ToolChoiceParamType.IMAGE_GENERATION # type: ignore -class MCPToolFilter(_Model): - """MCP tool filter. +class ToolChoiceMCP( + ToolChoiceParam, discriminator="mcp" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """MCP tool. - :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: 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 """ - 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[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, *, - tool_names: Optional[list[str]] = None, - read_only: Optional[bool] = None, + server_label: str, + name: Optional[str] = None, ) -> None: ... @overload @@ -9545,26 +17485,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 MCPToolRequireApproval(_Model): - """MCPToolRequireApproval. +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 always: - :vartype always: ~azure.ai.projects.models.MCPToolFilter - :ivar never: - :vartype never: ~azure.ai.projects.models.MCPToolFilter + :ivar type: Required. WEB_SEARCH_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_PREVIEW """ - always: Optional["_models.MCPToolFilter"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - never: Optional["_models.MCPToolFilter"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + 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, - *, - always: Optional["_models.MCPToolFilter"] = None, - never: Optional["_models.MCPToolFilter"] = None, ) -> None: ... @overload @@ -9576,32 +17513,23 @@ 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 -class MemoryOperation(_Model): - """Represents a single memory operation (create, update, or delete) performed on a memory item. +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 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 type: Required. WEB_SEARCH_PREVIEW_2025_03_11. + :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_PREVIEW_2025_03_11 """ - 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.""" + 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, - *, - kind: Union[str, "_models.MemoryOperationKind"], - memory_item: "_models.MemoryItem", ) -> None: ... @overload @@ -9613,23 +17541,35 @@ 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 MemorySearchItem(_Model): - """A retrieved memory item from memory search. +class ToolConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Per-tool configuration that controls tool visibility and search behavior. - :ivar memory_item: Retrieved memory item. Required. - :vartype memory_item: ~azure.ai.projects.models.MemoryItem + :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 """ - memory_item: "_models.MemoryItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Retrieved memory item. Required.""" + 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, *, - memory_item: "_models.MemoryItem", + pin: Optional[bool] = None, + additional_search_text: Optional[str] = None, ) -> None: ... @overload @@ -9643,21 +17583,26 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemorySearchOptions(_Model): - """Memory search options. +class ToolDescription(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Description of a tool that can be used by an agent. - :ivar max_memories: Maximum number of memory items to return. - :vartype max_memories: int + :ivar name: The name of the tool. + :vartype name: str + :ivar description: A brief description of the tool's purpose. + :vartype description: str """ - max_memories: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Maximum number of memory items to return.""" + 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, *, - max_memories: Optional[int] = None, + name: Optional[str] = None, + description: Optional[str] = None, ) -> None: ... @overload @@ -9671,48 +17616,22 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemorySearchPreviewTool(Tool, discriminator="memory_search_preview"): - """A tool for integrating memories into the agent. +class ToolProjectConnection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A project connection resource. - :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 project_connection_id: A project connection in a ToolProjectConnectionList attached to + this tool. Required. + :vartype project_connection_id: str """ - 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.""" + 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, *, - memory_store_name: str, - scope: str, - search_options: Optional["_models.MemorySearchOptions"] = None, - update_delay: Optional[int] = None, + project_connection_id: str, ) -> None: ... @overload @@ -9724,28 +17643,35 @@ 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 -class MemoryStoreDefinition(_Model): - """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 ToolSearchToolboxTool( + ToolboxTool, discriminator="toolbox_search" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A toolbox search tool stored in a toolbox. - :ivar kind: The kind of the memory store. Required. "default" - :vartype kind: str or ~azure.ai.projects.models.MemoryStoreKind + :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 """ - __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[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, *, - kind: str, + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -9757,40 +17683,44 @@ 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 -class MemoryStoreDefaultDefinition(MemoryStoreDefinition, discriminator="default"): - """Default memory store implementation. +class ToolSearchToolParam( + Tool, discriminator="tool_search" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Tool search tool. - :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 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 """ - 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[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, *, - chat_model: str, - embedding_model: str, - options: Optional["_models.MemoryStoreDefaultOptions"] = None, + execution: Optional[Union[str, "_models.ToolSearchExecutionType"]] = None, + description: Optional[str] = None, + parameters: Optional["_models.EmptyModelParam"] = None, ) -> None: ... @overload @@ -9802,53 +17732,37 @@ 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 = ToolType.TOOL_SEARCH # type: ignore -class MemoryStoreDefaultOptions(_Model): - """Default memory store configurations. +class ToolUseFineTuningDataGenerationJobOptions( + DataGenerationJobOptions, discriminator="tool_use" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The options for a data generation job with ToolUse type. Used only for fine-tuning scenarios. - :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 max_samples: Maximum number of samples to generate. Required. + :vartype max_samples: int + :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 """ - 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``.""" + 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.""" @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, + max_samples: int, + train_split: Optional[float] = None, + model_options: Optional["_models.DataGenerationModelOptions"] = None, ) -> None: ... @overload @@ -9860,41 +17774,37 @@ 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 MemoryStoreDeleteScopeResult(_Model): - """Response for deleting memories from a scope. +class TracesDataGenerationJobOptions( + DataGenerationJobOptions, discriminator="traces" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The options for a data generation job with Traces type. - :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 max_samples: Maximum number of samples to generate. Required. + :vartype max_samples: int + :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 """ - 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.""" + 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.""" @overload def __init__( self, *, - object: Literal[MemoryStoreObjectType.MEMORY_STORE_SCOPE_DELETED], - name: str, - scope: str, - deleted: bool, + max_samples: int, + train_split: Optional[float] = None, + model_options: Optional["_models.DataGenerationModelOptions"] = None, ) -> None: ... @overload @@ -9906,65 +17816,68 @@ 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 -class MemoryStoreDetails(_Model): - """A memory store that can store and retrieve user memories. +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 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. + :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 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 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 """ - 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( + 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" ) - """The Unix timestamp (seconds) when the memory store was created. Required.""" - updated_at: datetime.datetime = rest_field( + """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" ) - """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.""" + """End of the time window (Unix timestamp in seconds). Defaults to current time.""" @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", + start_time: datetime.datetime, description: Optional[str] = None, - metadata: Optional[dict[str, 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 @@ -9976,52 +17889,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 MemoryStoreOperationUsage(_Model): - """Usage statistics of a memory store operation. +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 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 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 """ - 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"] + 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" ) - """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"] + """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" ) - """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.""" + """End of the time window (Unix timestamp in seconds). Defaults to current time.""" @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, + 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 @@ -10033,35 +17965,33 @@ 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 MemoryStoreSearchResult(_Model): - """Memory search response. +class TranscriptTextUsageDuration( + CreateTranscriptionResponseJsonUsage, discriminator="duration" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Duration Usage. - :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 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 """ - 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.""" + 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, *, - search_id: str, - memories: list["_models.MemorySearchItem"], - usage: "_models.MemoryStoreOperationUsage", + seconds: datetime.timedelta, ) -> None: ... @overload @@ -10073,31 +18003,48 @@ 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 MemoryStoreUpdateCompletedResult(_Model): - """Memory update result. +class TranscriptTextUsageTokens( + CreateTranscriptionResponseJsonUsage, discriminator="tokens" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Token Usage. - :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: 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 """ - memory_operations: list["_models.MemoryOperation"] = 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"] ) - """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.""" + """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, *, - memory_operations: list["_models.MemoryOperation"], - usage: "_models.MemoryStoreOperationUsage", + input_tokens: int, + output_tokens: int, + total_tokens: int, + input_token_details: Optional["_models.TranscriptTextUsageTokensInputTokenDetails"] = None, ) -> None: ... @overload @@ -10109,53 +18056,29 @@ 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 MemoryStoreUpdateResult(_Model): - """Provides the status of a memory store update operation. +class TranscriptTextUsageTokensInputTokenDetails( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """TranscriptTextUsageTokensInputTokenDetails. - :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 text_tokens: + :vartype text_tokens: int + :ivar audio_tokens: + :vartype audio_tokens: int """ - 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\".""" + 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, *, - update_id: str, - status: Union[str, "_models.MemoryStoreUpdateStatus"], - superseded_by: Optional[str] = None, - result: Optional["_models.MemoryStoreUpdateCompletedResult"] = None, - error: Optional["_models.ApiError"] = None, + text_tokens: Optional[int] = None, + audio_tokens: Optional[int] = None, ) -> None: ... @overload @@ -10169,29 +18092,26 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MicrosoftFabricPreviewTool(Tool, discriminator="fabric_dataagent_preview"): - """The input definition information for a Microsoft Fabric tool as used to configure an agent. +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 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 description: The asset description text. + :vartype description: str + :ivar tags: Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, 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.""" + 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, *, - fabric_dataagent_preview: "_models.FabricDataAgentToolParameters", + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -10203,24 +18123,25 @@ 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 -class ModelCredentialRequest(_Model): - """Request to fetch credentials for a model asset. +class UpdateToolboxRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """UpdateToolboxRequest. - :ivar blob_uri: Blob URI of the model asset to fetch credentials for. Required. - :vartype blob_uri: 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 """ - blob_uri: str = rest_field(name="blobUri", visibility=["read", "create", "update", "delete", "query"]) - """Blob URI of the model asset to fetch credentials for. 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, *, - blob_uri: str, + default_version: str, ) -> None: ... @overload @@ -10234,45 +18155,37 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ModelDeployment(Deployment, discriminator="ModelDeployment"): - """Model Deployment Definition. +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 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 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 """ - 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.""" + 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, + *, + memory_id: str, + updated_at: datetime.datetime, + scope: str, + content: str, ) -> None: ... @overload @@ -10284,44 +18197,28 @@ 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 + self.kind = MemoryItemKind.USER_PROFILE # type: ignore -class ModelDeploymentSku(_Model): - """Sku information. +class VersionIndicator(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Version indicator determining which agent version backs the session. - :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 + 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 """ - 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.""" + __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, *, - capacity: int, - family: str, - name: str, - size: str, - tier: str, + type: str, ) -> None: ... @overload @@ -10335,40 +18232,28 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ModelPendingUploadRequest(_Model): - """Represents a request for a pending upload of a model version. +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 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: 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 """ - 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[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, *, - pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE], - pending_upload_id: Optional[str] = None, - connection_name: Optional[str] = None, + agent_version: str, ) -> None: ... @overload @@ -10380,47 +18265,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 ModelPendingUploadResponse(_Model): - """Represents the response for a model pending upload request. +class VersionSelector(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """VersionSelector. - :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 + :ivar version_selection_rules: Required. + :vartype version_selection_rules: list[~azure.ai.projects.models.VersionSelectionRule] """ - 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"] + version_selection_rules: list["_models.VersionSelectionRule"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The type of pending upload. Only TemporaryBlobReference is supported for models. Required. - Temporary blob reference.""" + """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, + version_selection_rules: list["_models.VersionSelectionRule"], ) -> None: ... @overload @@ -10434,37 +18298,28 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ModelSamplingParams(_Model): - """Represents a set of parameters used to control the sampling behavior of a language model during - text generation. +class VoiceAgentAnimationConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Animation settings for a voice-agent session. - :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 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] """ - 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.""" + 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"] + ) + """The requested animation output kinds.""" @overload def __init__( self, *, - temperature: Optional[float] = None, - top_p: Optional[float] = None, - seed: Optional[int] = None, - max_completion_tokens: Optional[int] = None, + model_name: Optional[str] = None, + outputs: Optional[list[Union[str, "_models.VoiceAgentAnimationOutputType"]]] = None, ) -> None: ... @overload @@ -10478,29 +18333,29 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ModelSourceData(_Model): - """Source information for the model. +class VoiceAgentAvatarIceServer(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An ICE server used for avatar WebRTC negotiation. - :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 + :ivar urls: Required. + :vartype urls: list[str] + :ivar username: + :vartype username: str + :ivar credential: + :vartype credential: 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.""" + 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, *, - source_type: Optional[Union[str, "_models.FoundryModelSourceType"]] = None, - job_id: Optional[str] = None, + urls: list[str], + username: Optional[str] = None, + credential: Optional[str] = None, ) -> None: ... @overload @@ -10514,78 +18369,44 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ModelVersion(_Model): - """Model Version Definition. +class VoiceAgentAvatarScene(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Avatar placement and motion settings. - :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] + :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 """ - 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"] - ) - """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.""" + 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, *, - 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, + 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 @@ -10599,27 +18420,24 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MonthlyRecurrenceSchedule(RecurrenceSchedule, discriminator="Monthly"): - """Monthly recurrence schedule. +class VoiceAgentAvatarVideoBackground(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The avatar video background. - :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 image_url: + :vartype image_url: str + :ivar color: + :vartype color: str """ - 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.""" + 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, *, - days_of_month: list[int], + image_url: Optional[str] = None, + color: Optional[str] = None, ) -> None: ... @overload @@ -10631,41 +18449,82 @@ 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"): - """Namespace. +class VoiceAgentAvatarVideoCrop(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The rectangular crop applied to avatar video. - :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 bottom_right: Required. + :vartype bottom_right: list[int] + :ivar top_left: Required. + :vartype top_left: list[int] """ - 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( + 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, + *, + bottom_right: list[int], + top_left: 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 VoiceAgentAvatarVideoParams(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Avatar video encoder and presentation settings. + + :ivar bitrate: + :vartype bitrate: int + :ivar codec: Default value is "h264". + :vartype codec: str + :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 + """ + + bitrate: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + codec: Optional[Literal["h264"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Default value is \"h264\".""" + crop: Optional["_models.VoiceAgentAvatarVideoCrop"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The function/custom tools available inside this namespace. Required.""" + 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, *, - name: str, - description: str, - tools: list[Union["_models.FunctionToolParam", "_models.CustomToolParam"]], + bitrate: Optional[int] = None, + codec: Optional[Literal["h264"]] = None, + crop: Optional["_models.VoiceAgentAvatarVideoCrop"] = None, + resolution: Optional["_models.VoiceAgentAvatarVideoResolution"] = None, + background: Optional["_models.VoiceAgentAvatarVideoBackground"] = None, + gop_size: Optional[int] = None, ) -> None: ... @overload @@ -10677,22 +18536,28 @@ 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 VoiceAgentAvatarVideoResolution(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The avatar video resolution. - :ivar type: The credential type. Required. No credential. - :vartype type: str or ~azure.ai.projects.models.NONE + :ivar width: Required. + :vartype width: int + :ivar height: Required. + :vartype height: int """ - type: Literal[CredentialType.NONE] = rest_discriminator(name="type", visibility=["read"]) # type: ignore - """The credential type. Required. No credential.""" + 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, + *, + width: int, + height: int, ) -> None: ... @overload @@ -10704,35 +18569,60 @@ 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"): - """One-time trigger. +class VoiceAgentClientEventConversationItemCreate( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``conversation.item.create`` client event. - :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 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: The conversation item to create. Required. Is either a + "_unions.VoiceAgentRequestConversationItem" type or a RealtimeMCPApprovalResponse type. + :vartype item: ~azure.ai.projects.models.RealtimeConversationItemMessageSystem or + ~azure.ai.projects.models.RealtimeConversationItemMessageUser or + ~azure.ai.projects.models.RealtimeConversationItemMessageAssistant or + ~azure.ai.projects.models.RealtimeConversationItemFunctionCall or + ~azure.ai.projects.models.RealtimeConversationItemFunctionCallOutput or + ~azure.ai.projects.models.RealtimeMCPApprovalResponse """ - 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" + 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_field( + visibility=["read", "create", "update", "delete", "query"] ) - """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``.""" + """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: "_unions.VoiceAgentCreateConversationItem" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The conversation item to create. Required. Is either a + \"_unions.VoiceAgentRequestConversationItem\" type or a RealtimeMCPApprovalResponse type.""" @overload def __init__( self, *, - trigger_at: datetime.datetime, - time_zone: Optional[str] = None, + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE], + item: "_unions.VoiceAgentCreateConversationItem", + event_id: Optional[str] = None, + previous_item_id: Optional[str] = None, ) -> None: ... @overload @@ -10744,30 +18634,38 @@ 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): - """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 VoiceAgentClientEventConversationItemDelete( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``conversation.item.delete`` client event. - :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 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 """ - __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\".""" + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, *, - type: str, + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE], + item_id: str, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -10781,19 +18679,36 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OpenApiAnonymousAuthDetails(OpenApiAuthDetails, discriminator="anonymous"): - """Security details for OpenApi anonymous authentication. +class VoiceAgentClientEventConversationItemRetrieve( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``conversation.item.retrieve`` client event. - :ivar type: The object type, which is always 'anonymous'. Required. ANONYMOUS. - :vartype type: str or ~azure.ai.projects.models.ANONYMOUS + :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 """ - 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.""" + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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.""" @overload def __init__( self, + *, + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE], + item_id: str, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -10805,50 +18720,53 @@ 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 -class OpenApiFunctionDefinition(_Model): - """The input definition information for an openapi function. +class VoiceAgentClientEventConversationItemTruncate( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``conversation.item.truncate`` client event. - :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] + :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 """ - 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.""" + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, *, - name: str, - spec: dict[str, Any], - auth: "_models.OpenApiAuthDetails", - description: Optional[str] = None, - default_params: Optional[list[str]] = None, + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE], + item_id: str, + content_index: int, + audio_end_ms: int, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -10862,34 +18780,38 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OpenApiFunctionDefinitionFunction(_Model): - """OpenApiFunctionDefinitionFunction. +class VoiceAgentClientEventInputAudioBufferAppend( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``input_audio_buffer.append`` client event. - :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 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 """ - 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.""" + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, *, - name: str, - parameters: dict[str, Any], - description: Optional[str] = None, + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND], + audio: str, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -10903,27 +18825,31 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OpenApiManagedAuthDetails(OpenApiAuthDetails, discriminator="managed_identity"): - """Security details for OpenApi managed_identity authentication. +class VoiceAgentClientEventInputAudioBufferClear( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``input_audio_buffer.clear`` client event. - :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 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 """ - 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( + 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_field( visibility=["read", "create", "update", "delete", "query"] ) - """Connection auth security details. Required.""" + """The event type, must be ``input_audio_buffer.clear``. Required. INPUT_AUDIO_BUFFER_CLEAR.""" @overload def __init__( self, *, - security_scheme: "_models.OpenApiManagedSecurityScheme", + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR], + event_id: Optional[str] = None, ) -> None: ... @overload @@ -10935,24 +18861,33 @@ 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): - """Security scheme for OpenApi managed_identity authentication. +class VoiceAgentClientEventInputAudioBufferCommit( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``input_audio_buffer.commit`` client event. - :ivar audience: Authentication scope for managed_identity auth type. Required. - :vartype audience: str + :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 """ - audience: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Authentication scope for managed_identity auth type. 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The event type, must be ``input_audio_buffer.commit``. Required. INPUT_AUDIO_BUFFER_COMMIT.""" @overload def __init__( self, *, - audience: str, + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT], + event_id: Optional[str] = None, ) -> None: ... @overload @@ -10966,28 +18901,31 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OpenApiProjectConnectionAuthDetails(OpenApiAuthDetails, discriminator="project_connection"): - """Security details for OpenApi project connection authentication. +class VoiceAgentClientEventOutputAudioBufferClear( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``output_audio_buffer.clear`` client event. - :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 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: 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( + 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_field( visibility=["read", "create", "update", "delete", "query"] ) - """Project connection auth security details. Required.""" + """The event type, must be ``output_audio_buffer.clear``. Required. OUTPUT_AUDIO_BUFFER_CLEAR.""" @overload def __init__( self, *, - security_scheme: "_models.OpenApiProjectConnectionSecurityScheme", + type: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR], + event_id: Optional[str] = None, ) -> None: ... @overload @@ -10999,24 +18937,37 @@ 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): - """Security scheme for OpenApi managed_identity authentication. +class VoiceAgentClientEventResponseCancel(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``response.cancel`` client event. - :ivar project_connection_id: Project connection id for Project Connection auth type. Required. - :vartype project_connection_id: str + :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 """ - project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Project connection id for Project Connection auth type. 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, *, - project_connection_id: str, + type: Literal[RealtimeClientEventType.RESPONSE_CANCEL], + event_id: Optional[str] = None, + response_id: Optional[str] = None, ) -> None: ... @overload @@ -11030,35 +18981,76 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OpenApiTool(Tool, discriminator="openapi"): - """The input definition information for an OpenAPI tool as used to configure an agent. +class VoiceAgentClientEventResponseCreate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``response.create`` client event. - :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 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: Parameters for the new response. + :vartype response: ~azure.ai.projects.models.VoiceAgentResponseCreateParams + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The event type, must be ``response.create``. Required. RESPONSE_CREATE.""" + response: Optional["_models.VoiceAgentResponseCreateParams"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Parameters for the new response.""" + + @overload + def __init__( + self, + *, + type: Literal[RealtimeClientEventType.RESPONSE_CREATE], + event_id: Optional[str] = None, + response: Optional["_models.VoiceAgentResponseCreateParams"] = 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 VoiceAgentClientEventSessionAvatarConnect( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``session.avatar.connect`` client event. + + :ivar type: The event type. Always ``session.avatar.connect``. Required. Default value is + "session.avatar.connect". + :vartype type: str + :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 """ - 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.""" + type: Literal["session.avatar.connect"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event type. Always ``session.avatar.connect``. Required. Default value is + \"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, *, - openapi: "_models.OpenApiFunctionDefinition", - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + client_sdp: str, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -11070,41 +19062,42 @@ 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 + self.type: Literal["session.avatar.connect"] = "session.avatar.connect" -class OpenApiToolboxTool(ToolboxTool, discriminator="openapi"): - """An OpenAPI tool stored in a toolbox. +class VoiceAgentClientEventSessionUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``session.update`` client event. - :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 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 stable realtime session fields to update. Required. + :vartype session: ~azure.ai.projects.models.VoiceAgentSessionUpdateConfig """ - type: Literal[ToolboxToolType.OPENAPI] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. OPENAPI.""" - openapi: "_models.OpenApiFunctionDefinition" = rest_field( + 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 openapi function definition. Required.""" + """The event type, must be ``session.update``. Required. SESSION_UPDATE.""" + session: "_models.VoiceAgentSessionUpdateConfig" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The stable realtime session fields to update. Required.""" @overload def __init__( self, *, - openapi: "_models.OpenApiFunctionDefinition", - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + type: Literal[RealtimeClientEventType.SESSION_UPDATE], + session: "_models.VoiceAgentSessionUpdateConfig", + event_id: Optional[str] = None, ) -> None: ... @overload @@ -11116,30 +19109,186 @@ 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 OptimizationAgentIdentifier(_Model): - """Identifies the registered Foundry agent to optimize (request-only). Skills, tools, and - system_prompt are specified in options.optimization_config. - - :ivar agent_name: Registered Foundry agent name (required). Required. - :vartype agent_name: str - :ivar agent_version: Pinned agent version. Defaults to latest if omitted. - :vartype agent_version: str - """ +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. - agent_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Registered Foundry agent name (required). Required.""" - agent_version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Pinned agent version. Defaults to latest if omitted.""" + :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 agent is served. Together with ``model``, this + selects the model up front. ``managed`` uses a service-managed model; ``self_deployed`` uses + the customer's own Foundry deployment. This is independent of the architecture (realtime or + cascaded), which the service derives from the selected model. Required. 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, paired with ``model_type``: the service-managed + model name when ``model_type`` is ``managed``, or the customer's Foundry deployment name when + ``model_type`` is ``self_deployed``. The model must support realtime or cascaded voice. The + service derives the architecture from the selected model. Required. + :vartype model: str + :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.VoiceGreetingConfig + :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.VoiceAudioConfig + :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. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. + :vartype interim_response: ~azure.ai.projects.models.VoiceAgentStaticInterimResponseConfig or + ~azure.ai.projects.models.VoiceAgentLlmInterimResponseConfig + :ivar avatar: Optional avatar configuration. These values are session defaults and may be + overridden when connecting. + :vartype avatar: ~azure.ai.projects.models.VoiceAvatarConfig + :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: Union[str, "_models.ToolChoiceOptions"], ToolChoiceFunction, ToolChoiceMCP + :vartype tool_choice: str or ~azure.ai.projects.models.ToolChoiceOptions 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 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 + """ + + 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: Union[str, "_models.VoiceModelType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """How the model backing this agent is served. Together with ``model``, this selects the model up + front. ``managed`` uses a service-managed model; ``self_deployed`` uses the customer's own + Foundry deployment. This is independent of the architecture (realtime or cascaded), which the + service derives from the selected model. Required. Known values are: \"managed\" and + \"self_deployed\".""" + model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The model to use for this agent, paired with ``model_type``: the service-managed model name + when ``model_type`` is ``managed``, or the customer's Foundry deployment name when + ``model_type`` is ``self_deployed``. The model must support realtime or cascaded voice. The + service derives the architecture from the selected model. Required.""" + 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.VoiceGreetingConfig"] = 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.VoiceAudioConfig"] = 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["_unions.VoiceAgentInterimResponse"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Interim-response settings for latency and tool execution. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type.""" + avatar: Optional["_models.VoiceAvatarConfig"] = 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: + Union[str, \"_models.ToolChoiceOptions\"], 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( + visibility=["read", "create", "update", "delete", "query"] + ) + """Set of structured inputs that participate in prompt template substitution, rendered per session + before the live session starts.""" + 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.""" @overload def __init__( self, *, - agent_name: str, - agent_version: Optional[str] = None, + model_type: Union[str, "_models.VoiceModelType"], + model: str, + rai_config: Optional["_models.RaiConfig"] = None, + instructions: Optional[str] = None, + greeting: Optional["_models.VoiceGreetingConfig"] = None, + audio: Optional["_models.VoiceAudioConfig"] = 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["_unions.VoiceAgentInterimResponse"] = None, + avatar: Optional["_models.VoiceAvatarConfig"] = 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, + store: Optional[bool] = None, ) -> None: ... @overload @@ -11151,61 +19300,42 @@ 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 OptimizationCandidate(_Model): - """Aggregated evaluation result for a single candidate agent configuration across all tasks. - - :ivar candidate_id: Server-assigned candidate identifier. Use with GET /candidates/{id} - sub-endpoints. - :vartype candidate_id: str - :ivar name: Display name of the candidate (e.g., 'baseline', 'instruction-v2'). Required. - :vartype name: str - :ivar mutations: What was mutated from the baseline (e.g., {system_prompt: 'new prompt'}). - :vartype mutations: dict[str, any] - :ivar avg_score: Average composite score across all tasks. Required. - :vartype avg_score: float - :ivar avg_tokens: Average token usage across all tasks. Required. - :vartype avg_tokens: float - :ivar eval_id: Foundry evaluation identifier used to score this candidate. - :vartype eval_id: str - :ivar eval_run_id: Foundry evaluation run identifier for this candidate's scoring run. - :vartype eval_run_id: str - :ivar promotion: Promotion metadata. Null if the candidate has not been promoted. - :vartype promotion: ~azure.ai.projects.models.PromotionInfo - """ +class VoiceAgentEchoCancellation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Server-side echo cancellation settings for input audio. - candidate_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Server-assigned candidate identifier. Use with GET /candidates/{id} sub-endpoints.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Display name of the candidate (e.g., 'baseline', 'instruction-v2'). Required.""" - mutations: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """What was mutated from the baseline (e.g., {system_prompt: 'new prompt'}).""" - avg_score: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Average composite score across all tasks. Required.""" - avg_tokens: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Average token usage across all tasks. Required.""" - eval_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Foundry evaluation identifier used to score this candidate.""" - eval_run_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Foundry evaluation run identifier for this candidate's scoring run.""" - promotion: Optional["_models.PromotionInfo"] = rest_field( + :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 + """ + + 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"] ) - """Promotion metadata. Null if the candidate has not been promoted.""" + """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, *, - name: str, - avg_score: float, - avg_tokens: float, - candidate_id: Optional[str] = None, - mutations: Optional[dict[str, Any]] = None, - eval_id: Optional[str] = None, - eval_run_id: Optional[str] = None, - promotion: Optional["_models.PromotionInfo"] = None, + reference_source: Optional[Union[str, "_models.VoiceAgentEchoCancellationReferenceSource"]] = None, + channels: Optional[int] = None, ) -> None: ... @overload @@ -11217,28 +19347,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 OptimizationDatasetCriterion(_Model): - """Evaluation criterion: a name + instruction pair used for per-item scoring. +class VoiceAgentTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A tool usable by a voice agent. - :ivar name: Criterion name. Required. - :vartype name: str - :ivar instruction: Criterion instruction / description. Required. - :vartype instruction: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + VoiceAgentFunctionTool, VoiceAgentMcpTool, VoiceSystemTool, VoiceToolboxTool + + :ivar type: The tool kind. Required. Default value is None. + :vartype type: str """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Criterion name. Required.""" - instruction: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Criterion instruction / description. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The tool kind. Required. Default value is None.""" @overload def __init__( self, *, - name: str, - instruction: str, + type: str, ) -> None: ... @overload @@ -11252,26 +19382,41 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OptimizationDatasetInput(_Model): - """Base discriminated model for dataset input. Either inline items or a registered reference. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - OptimizationInlineDatasetInput, OptimizationReferenceDatasetInput +class VoiceAgentFunctionTool( + VoiceAgentTool, discriminator="function" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A native function tool executed by the client. - :ivar type: Dataset input type discriminator. Required. Known values are: "inline" and - "reference". - :vartype type: str or ~azure.ai.projects.models.OptimizationDatasetInputType + :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 """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Dataset input type discriminator. Required. Known values are: \"inline\" and \"reference\".""" + 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, *, - type: str, + name: str, + description: Optional[str] = None, + parameters: Optional["_models.RealtimeFunctionToolParameters"] = None, ) -> None: ... @overload @@ -11283,40 +19428,40 @@ 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 -class OptimizationDatasetItem(_Model): - """A single item in an inline dataset. +class VoiceAgentInterimResponseConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Fields shared by interim-response configurations. - :ivar query: The user query / prompt. - :vartype query: str - :ivar ground_truth: Expected ground truth answer. - :vartype ground_truth: str - :ivar desired_num_turns: Desired number of conversation turns for simulation mode (1-20). - :vartype desired_num_turns: int - :ivar criteria: Per-item evaluation criteria. - :vartype criteria: list[~azure.ai.projects.models.OptimizationDatasetCriterion] + 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 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: int """ - query: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The user query / prompt.""" - ground_truth: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Expected ground truth answer.""" - desired_num_turns: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Desired number of conversation turns for simulation mode (1-20).""" - criteria: Optional[list["_models.OptimizationDatasetCriterion"]] = 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"] ) - """Per-item evaluation criteria.""" + """Conditions that may trigger one interim response.""" + latency_threshold_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The latency threshold in milliseconds.""" @overload def __init__( self, *, - query: Optional[str] = None, - ground_truth: Optional[str] = None, - desired_num_turns: Optional[int] = None, - criteria: Optional[list["_models.OptimizationDatasetCriterion"]] = None, + type: str, + triggers: Optional[list[Union[str, "_models.VoiceAgentInterimResponseTrigger"]]] = None, + latency_threshold_ms: Optional[int] = None, ) -> None: ... @overload @@ -11330,26 +19475,43 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OptimizationEvaluatorRef(_Model): - """Reference to a named evaluator, optionally pinned to a version. +class VoiceAgentLlmInterimResponseConfig( + VoiceAgentInterimResponseConfig, discriminator="llm_interim_response" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An interim response generated by a language model. - :ivar name: Evaluator name. Required. - :vartype name: str - :ivar version: Evaluator version. If not specified, the latest version is used. - :vartype version: 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: int + :ivar type: Required. Default value is "llm_interim_response". + :vartype type: str + :ivar model: The model used to generate interim responses. + :vartype model: str + :ivar instructions: Optional instructions for generating interim responses. + :vartype instructions: str + :ivar max_completion_tokens: The maximum completion-token count for an interim response. + :vartype max_completion_tokens: int """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Evaluator name. Required.""" - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Evaluator version. If not specified, the latest version is used.""" + type: Literal["llm_interim_response"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"llm_interim_response\".""" + model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The model used to generate interim responses.""" + instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional instructions for generating interim responses.""" + max_completion_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The maximum completion-token count for an interim response.""" @overload def __init__( self, *, - name: str, - version: Optional[str] = None, + triggers: Optional[list[Union[str, "_models.VoiceAgentInterimResponseTrigger"]]] = None, + latency_threshold_ms: Optional[int] = None, + model: Optional[str] = None, + instructions: Optional[str] = None, + max_completion_tokens: Optional[int] = None, ) -> None: ... @overload @@ -11361,31 +19523,104 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = "llm_interim_response" # type: ignore -class OptimizationInlineDatasetInput(OptimizationDatasetInput, discriminator="inline"): - """Inline dataset — items supplied directly in the request body. +class VoiceAgentMcpTool( + VoiceAgentTool, discriminator="mcp" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An MCP tool available to a voice agent. - :ivar type: Dataset input type discriminator. Required. Inline dataset — items are provided - directly in the request body. - :vartype type: str or ~azure.ai.projects.models.INLINE - :ivar dataset_items: Dataset items. Required. - :vartype dataset_items: list[~azure.ai.projects.models.OptimizationDatasetItem] + :ivar server_label: A label for this MCP server, used to identify it in tool calls. Required. + :vartype server_label: 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] + :ivar type: Required. Default value is "mcp". + :vartype type: str + :ivar server_url: The URL for the MCP server. + :vartype server_url: str + :ivar response_scheduling: When the MCP invocation creates a follow-up response. Defaults to + ``when_idle``. Known values are: "silent", "when_idle", "interrupt", and "skip_if_busy". + :vartype response_scheduling: str or ~azure.ai.projects.models.VoiceAgentToolResponseScheduling """ - type: Literal[OptimizationDatasetInputType.INLINE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Dataset input type discriminator. Required. Inline dataset — items are provided directly in the - request body.""" - dataset_items: list["_models.OptimizationDatasetItem"] = rest_field( - name="items", visibility=["read", "create", "update", "delete", "query"] + 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.""" + 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"] ) - """Dataset items. Required.""" + """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.""" + type: Literal["mcp"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"mcp\".""" + server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The URL for the MCP server.""" + response_scheduling: Optional[Union[str, "_models.VoiceAgentToolResponseScheduling"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """When the MCP invocation creates a follow-up response. Defaults to ``when_idle``. Known values + are: \"silent\", \"when_idle\", \"interrupt\", and \"skip_if_busy\".""" @overload def __init__( self, *, - dataset_items: list["_models.OptimizationDatasetItem"], + server_label: str, + 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, + server_url: Optional[str] = None, + response_scheduling: Optional[Union[str, "_models.VoiceAgentToolResponseScheduling"]] = None, ) -> None: ... @overload @@ -11397,64 +19632,86 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = OptimizationDatasetInputType.INLINE # type: ignore + self.type = "mcp" # type: ignore -class OptimizationJob(_Model): - """Agent optimization job resource — a long-running job that optimizes an agent's configuration - (instructions, model, skills, tools) to maximize evaluation scores. On success, the result - contains scored candidates. +class VoiceAgentRealtimeResponse( + OmitPropertiesRealtimeResponse1 +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A live realtime response returned by the voice-agent service in both ``response.created`` and + ``response.done`` events. - :ivar id: Server-assigned unique identifier. Required. + :ivar id: The unique ID of the response, will look like ``resp_1234``. :vartype id: str - :ivar inputs: Caller-supplied inputs. - :vartype inputs: ~azure.ai.projects.models.OptimizationJobInputs - :ivar result: Result produced on success. - :vartype result: ~azure.ai.projects.models.OptimizationJobResult - :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 created_at: The timestamp when the job was created, represented in Unix time. Required. - :vartype created_at: ~datetime.datetime - :ivar updated_at: The timestamp when the job was last updated, represented in Unix time. - Required. - :vartype updated_at: ~datetime.datetime - :ivar progress: Progress snapshot. May be present in terminal states reflecting last-known - progress. - :vartype progress: ~azure.ai.projects.models.OptimizationJobProgress - :ivar warnings: Non-fatal warnings emitted at any point during optimization. - :vartype warnings: list[str] - """ - - id: str = rest_field(visibility=["read"]) - """Server-assigned unique identifier. Required.""" - inputs: Optional["_models.OptimizationJobInputs"] = rest_field( + :ivar object: The object type, must be ``realtime.response``. Default value is + "realtime.response". + :vartype object: str + :ivar status: The final status of the response (``completed``, ``cancelled``, ``failed``, or + ``incomplete``, ``in_progress``). Is one of the following types: Literal["completed"], + Literal["cancelled"], Literal["failed"], Literal["incomplete"], Literal["in_progress"] + :vartype status: str or str or str or str or str + :ivar status_details: Additional details about the status. + :vartype status_details: ~azure.ai.projects.models.RealtimeResponseStatusDetails + :ivar metadata: + :vartype metadata: ~azure.ai.projects.models.Metadata + :ivar usage: Usage statistics for the Response, this will correspond to billing. A Realtime API + session will maintain a conversation context and append new Items to the Conversation, thus + output from previous turns (text and audio tokens) will become the input for later turns. + :vartype usage: ~azure.ai.projects.models.RealtimeResponseUsage + :ivar conversation_id: Which conversation the response is added to, determined by the + ``conversation`` field in the ``response.create`` event. If ``auto``, the response will be + added to the default conversation and the value of ``conversation_id`` will be an id like + ``conv_1234``. If ``none``, the response will not be added to any conversation and the value of + ``conversation_id`` will be ``null``. If responses are being triggered automatically by VAD the + response will be added to the default conversation. + :vartype conversation_id: str + :ivar output_modalities: The set of modalities the model used to respond, currently the only + possible values are ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text + transcript. Setting the output to mode ``text`` will disable audio output from the model. + :vartype output_modalities: list[str or str] + :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, + inclusive of tool calls, that was used in this response. Is either a int type or a + Literal["inf"] type. + :vartype max_output_tokens: int or str + :ivar audio: The audio configuration used by the live response, including flat voice provider, + locale, and format fields under ``output``. + :vartype audio: ~azure.ai.projects.models.VoiceResponseAudio + :ivar output: The items produced by the live response. + :vartype output: list[~azure.ai.projects.models.RealtimeConversationItemMessageSystem or + ~azure.ai.projects.models.RealtimeConversationItemMessageUser or + ~azure.ai.projects.models.RealtimeConversationItemMessageAssistant or + ~azure.ai.projects.models.VoiceFunctionCallItem or + ~azure.ai.projects.models.VoiceFunctionCallOutputItem or + ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem + or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or + ~azure.ai.projects.models.VoiceMcpApprovalResponseItem] + """ + + audio: Optional["_models.VoiceResponseAudio"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Caller-supplied inputs.""" - result: Optional["_models.OptimizationJobResult"] = rest_field(visibility=["read"]) - """Result produced on success.""" - status: Union[str, "_models.JobStatus"] = rest_field(visibility=["read"]) - """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", - \"succeeded\", \"failed\", and \"cancelled\".""" - error: Optional["_models.ApiError"] = rest_field(visibility=["read"]) - """Error details — populated only on failure.""" - created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") - """The timestamp when the job was created, represented in Unix time. Required.""" - updated_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") - """The timestamp when the job was last updated, represented in Unix time. Required.""" - progress: Optional["_models.OptimizationJobProgress"] = rest_field(visibility=["read"]) - """Progress snapshot. May be present in terminal states reflecting last-known progress.""" - warnings: Optional[list[str]] = rest_field(visibility=["read"]) - """Non-fatal warnings emitted at any point during optimization.""" + """The audio configuration used by the live response, including flat voice provider, locale, and + format fields under ``output``.""" + output: Optional[list["_unions.VoiceAgentResponseItem"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The items produced by the live response.""" @overload def __init__( self, *, - inputs: Optional["_models.OptimizationJobInputs"] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + object: Optional[Literal["realtime.response"]] = None, + status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] = None, + status_details: Optional["_models.RealtimeResponseStatusDetails"] = None, + metadata: Optional["_models.Metadata"] = None, + usage: Optional["_models.RealtimeResponseUsage"] = None, + conversation_id: Optional[str] = None, + output_modalities: Optional[list[Literal["text", "audio"]]] = None, + max_output_tokens: Optional[Union[int, Literal["inf"]]] = None, + audio: Optional["_models.VoiceResponseAudio"] = None, + output: Optional[list["_unions.VoiceAgentResponseItem"]] = None, ) -> None: ... @overload @@ -11468,56 +19725,148 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OptimizationJobInputs(_Model): - """Caller-supplied inputs for an optimization job. +class VoiceAgentResponseCreateParams(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Parameters accepted by a voice-agent ``response.create`` event. - :ivar agent: The agent (and pinned version) being optimized. Required. - :vartype agent: ~azure.ai.projects.models.OptimizationAgentIdentifier - :ivar train_dataset: Training dataset — either inline items or a reference to a registered - dataset. Required. Required. - :vartype train_dataset: ~azure.ai.projects.models.OptimizationDatasetInput - :ivar validation_dataset: Optional held-out validation dataset for measuring generalization of - the final candidate. - :vartype validation_dataset: ~azure.ai.projects.models.OptimizationDatasetInput - :ivar evaluators: Job-level evaluators referenced by name and optional version. Required; at - least one must be provided. Required. - :vartype evaluators: list[~azure.ai.projects.models.OptimizationEvaluatorRef] - :ivar options: Tuning knobs and run-mode. - :vartype options: ~azure.ai.projects.models.OptimizationOptions + :ivar instructions: The default system instructions (i.e. system message) prepended to model + calls. This field allows the client to guide the model on desired responses. The model can be + instructed on response content and format, (e.g. "be extremely succinct", "act friendly", "here + are examples of good responses") and on audio behavior (e.g. "talk quickly", "inject emotion + into your voice", "laugh frequently"). The instructions are not guaranteed to be followed by + the model, but they provide guidance to the model on the desired behavior. Note that the server + sets default instructions which will be used if this field is not set and are visible in the + ``session.created`` event at the start of the session. + :vartype instructions: str + :ivar tools: Tools available to the model. + :vartype tools: list[~azure.ai.projects.models.RealtimeFunctionTool or + ~azure.ai.projects.models.MCPTool] + :ivar tool_choice: How the model chooses tools. Provide one of the string modes or force a + specific function/MCP tool. Is one of the following types: Union[str, + "_models.ToolChoiceOptions"], ToolChoiceFunction, ToolChoiceMCP + :vartype tool_choice: str or ~azure.ai.projects.models.ToolChoiceOptions 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. Only + supported by reasoning Realtime models such as ``gpt-realtime-2``. + :vartype parallel_tool_calls: bool + :ivar reasoning: + :vartype reasoning: ~azure.ai.projects.models.RealtimeReasoning + :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, + inclusive of tool calls. Provide an integer between 1 and 4096 to limit output tokens, or + ``inf`` for the maximum available tokens for a given model. Defaults to ``inf``. Is either a + int type or a Literal["inf"] type. + :vartype max_output_tokens: int or str + :ivar conversation: Controls which conversation the response is added to. Currently supports + ``auto`` and ``none``, with ``auto`` as the default value. The ``auto`` value means that the + contents of the response will be added to the default conversation. Set this to ``none`` to + create an out-of-band response which will not add items to default conversation. Is one of the + following types: Literal["auto"], Literal["none"], str + :vartype conversation: str or str or str + :ivar metadata: + :vartype metadata: ~azure.ai.projects.models.Metadata + :ivar input: Input items to include in the prompt for the model. Using this field creates a new + context for this Response instead of using the default conversation. An empty array ``[]`` will + clear the context for this Response. Note that this can include references to items that + previously appeared in the session using their id. + :vartype input: list[~azure.ai.projects.models.RealtimeConversationItem] + :ivar output_modalities: Modalities that the response may return. + :vartype output_modalities: list[str or ~azure.ai.projects.models.VoiceOutputModality] + :ivar audio: Response-specific audio settings. + :vartype audio: ~azure.ai.projects.models.PickPropertiesVoiceAudioConfig + :ivar pre_generated_assistant_message: A pre-generated assistant message used to begin the + response. + :vartype pre_generated_assistant_message: + ~azure.ai.projects.models.RealtimeConversationItemMessageAssistant + :ivar interim_response: Interim-response settings for this response. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. + :vartype interim_response: ~azure.ai.projects.models.VoiceAgentStaticInterimResponseConfig or + ~azure.ai.projects.models.VoiceAgentLlmInterimResponseConfig """ - agent: "_models.OptimizationAgentIdentifier" = rest_field( + instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The default system instructions (i.e. system message) prepended to model calls. This field + allows the client to guide the model on desired responses. The model can be instructed on + response content and format, (e.g. \"be extremely succinct\", \"act friendly\", \"here are + examples of good responses\") and on audio behavior (e.g. \"talk quickly\", \"inject emotion + into your voice\", \"laugh frequently\"). The instructions are not guaranteed to be followed by + the model, but they provide guidance to the model on the desired behavior. Note that the server + sets default instructions which will be used if this field is not set and are visible in the + ``session.created`` event at the start of the session.""" + tools: Optional[list[Union["_models.RealtimeFunctionTool", "_models.MCPTool"]]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The agent (and pinned version) being optimized. Required.""" - train_dataset: "_models.OptimizationDatasetInput" = rest_field( + """Tools available to the model.""" + tool_choice: Optional[ + Union[str, "_models.ToolChoiceOptions", "_models.ToolChoiceFunction", "_models.ToolChoiceMCP"] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """How the model chooses tools. Provide one of the string modes or force a specific function/MCP + tool. Is one of the following types: Union[str, \"_models.ToolChoiceOptions\"], + ToolChoiceFunction, ToolChoiceMCP""" + parallel_tool_calls: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the model may call multiple tools in parallel. Only supported by reasoning Realtime + models such as ``gpt-realtime-2``.""" + reasoning: Optional["_models.RealtimeReasoning"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Training dataset — either inline items or a reference to a registered dataset. Required. - Required.""" - validation_dataset: Optional["_models.OptimizationDatasetInput"] = rest_field( + max_output_tokens: Optional[Union[int, Literal["inf"]]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Optional held-out validation dataset for measuring generalization of the final candidate.""" - evaluators: list["_models.OptimizationEvaluatorRef"] = rest_field( + """Maximum number of output tokens for a single assistant response, inclusive of tool calls. + Provide an integer between 1 and 4096 to limit output tokens, or ``inf`` for the maximum + available tokens for a given model. Defaults to ``inf``. Is either a int type or a + Literal[\"inf\"] type.""" + conversation: Optional[Union[Literal["auto"], Literal["none"], str]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Job-level evaluators referenced by name and optional version. Required; at least one must be - provided. Required.""" - options: Optional["_models.OptimizationOptions"] = rest_field( + """Controls which conversation the response is added to. Currently supports ``auto`` and ``none``, + with ``auto`` as the default value. The ``auto`` value means that the contents of the response + will be added to the default conversation. Set this to ``none`` to create an out-of-band + response which will not add items to default conversation. Is one of the following types: + Literal[\"auto\"], Literal[\"none\"], str""" + metadata: Optional["_models.Metadata"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + input: Optional[list["_models.RealtimeConversationItem"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Tuning knobs and run-mode.""" + """Input items to include in the prompt for the model. Using this field creates a new context for + this Response instead of using the default conversation. An empty array ``[]`` will clear the + context for this Response. Note that this can include references to items that previously + appeared in the session using their id.""" + output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Modalities that the response may return.""" + audio: Optional["_models.PickPropertiesVoiceAudioConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Response-specific audio settings.""" + pre_generated_assistant_message: Optional["_models.RealtimeConversationItemMessageAssistant"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """A pre-generated assistant message used to begin the response.""" + interim_response: Optional["_unions.VoiceAgentInterimResponse"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Interim-response settings for this response. Is either a VoiceAgentStaticInterimResponseConfig + type or a VoiceAgentLlmInterimResponseConfig type.""" @overload def __init__( self, *, - agent: "_models.OptimizationAgentIdentifier", - train_dataset: "_models.OptimizationDatasetInput", - evaluators: list["_models.OptimizationEvaluatorRef"], - validation_dataset: Optional["_models.OptimizationDatasetInput"] = None, - options: Optional["_models.OptimizationOptions"] = None, + instructions: Optional[str] = None, + tools: Optional[list[Union["_models.RealtimeFunctionTool", "_models.MCPTool"]]] = None, + tool_choice: Optional[ + Union[str, "_models.ToolChoiceOptions", "_models.ToolChoiceFunction", "_models.ToolChoiceMCP"] + ] = None, + parallel_tool_calls: Optional[bool] = None, + reasoning: Optional["_models.RealtimeReasoning"] = None, + max_output_tokens: Optional[Union[int, Literal["inf"]]] = None, + conversation: Optional[Union[Literal["auto"], Literal["none"], str]] = None, + metadata: Optional["_models.Metadata"] = None, + input: Optional[list["_models.RealtimeConversationItem"]] = None, + output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = None, + audio: Optional["_models.PickPropertiesVoiceAudioConfig"] = None, + pre_generated_assistant_message: Optional["_models.RealtimeConversationItemMessageAssistant"] = None, + interim_response: Optional["_unions.VoiceAgentInterimResponse"] = None, ) -> None: ... @overload @@ -11531,72 +19880,40 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OptimizationJobListItem(_Model): - """Slim job representation returned by the LIST endpoint. - - :ivar id: Server-assigned unique identifier. Required. - :vartype id: str - :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 created_at: The timestamp when the job was created, represented in Unix time. Required. - :vartype created_at: ~datetime.datetime - :ivar updated_at: The timestamp when the job was last updated, represented in Unix time. - Required. - :vartype updated_at: ~datetime.datetime - :ivar progress: Progress snapshot. May be present in terminal states reflecting last-known - progress. - :vartype progress: ~azure.ai.projects.models.OptimizationJobProgress - :ivar agent: The agent targeted by this optimization job. - :vartype agent: ~azure.ai.projects.models.OptimizationAgentIdentifier - """ - - id: str = rest_field(visibility=["read"]) - """Server-assigned unique identifier. Required.""" - status: Union[str, "_models.JobStatus"] = rest_field(visibility=["read"]) - """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", - \"succeeded\", \"failed\", and \"cancelled\".""" - error: Optional["_models.ApiError"] = rest_field(visibility=["read"]) - """Error details — populated only on failure.""" - created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") - """The timestamp when the job was created, represented in Unix time. Required.""" - updated_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") - """The timestamp when the job was last updated, represented in Unix time. Required.""" - progress: Optional["_models.OptimizationJobProgress"] = rest_field(visibility=["read"]) - """Progress snapshot. May be present in terminal states reflecting last-known progress.""" - agent: Optional["_models.OptimizationAgentIdentifier"] = rest_field(visibility=["read"]) - """The agent targeted by this optimization job.""" - - -class OptimizationJobProgress(_Model): - """In-flight progress; only populated while status is queued or in_progress. - - :ivar candidates_completed: Number of candidates whose evaluation has completed so far. - Required. - :vartype candidates_completed: int - :ivar best_score: Best score observed so far across all candidates. Required. - :vartype best_score: float - :ivar elapsed_seconds: Wall-clock time elapsed in seconds since the job began executing. - Required. - :vartype elapsed_seconds: float - """ +class VoiceAgentResponseEventContentPart(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A content part carried by a ``response.content_part.*`` server event. - candidates_completed: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of candidates whose evaluation has completed so far. Required.""" - best_score: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Best score observed so far across all candidates. Required.""" - elapsed_seconds: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Wall-clock time elapsed in seconds since the job began executing. Required.""" + :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.VoiceAudioFormat + """ + + 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.VoiceAudioFormat"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The audio format, when this is an audio content part.""" @overload def __init__( self, *, - candidates_completed: int, - best_score: float, - elapsed_seconds: float, + type: Optional[Literal["audio", "text"]] = None, + text: Optional[str] = None, + audio: Optional[str] = None, + transcript: Optional[str] = None, + format: Optional["_models.VoiceAudioFormat"] = None, ) -> None: ... @overload @@ -11610,33 +19927,36 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OptimizationJobResult(_Model): - """Terminal-state result body. Populated when status is succeeded or failed. +class VoiceTurnDetection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Turn-detection configuration for a voice agent. - :ivar baseline: Candidate ID of the original (un-optimized) baseline evaluation. - :vartype baseline: str - :ivar best: Candidate ID of the highest-scoring candidate found during optimization. - :vartype best: str - :ivar candidates: All evaluated candidates including baseline. - :vartype candidates: list[~azure.ai.projects.models.OptimizationCandidate] + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + VoiceAzureSemanticVadTurnDetection, VoiceAzureSemanticVadEnTurnDetection, + VoiceAzureSemanticVadMultilingualTurnDetection, VoiceAgentSemanticVadTurnDetection, + VoiceServerVadTurnDetection + + :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.VoiceTurnDetectionType + :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech + stops. + :vartype auto_truncate: bool """ - baseline: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Candidate ID of the original (un-optimized) baseline evaluation.""" - best: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Candidate ID of the highest-scoring candidate found during optimization.""" - candidates: Optional[list["_models.OptimizationCandidate"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """All evaluated candidates including baseline.""" + __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, *, - baseline: Optional[str] = None, - best: Optional[str] = None, - candidates: Optional[list["_models.OptimizationCandidate"]] = None, + type: str, + auto_truncate: Optional[bool] = None, ) -> None: ... @overload @@ -11650,71 +19970,43 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OptimizationOptions(_Model): - """Tuning knobs and run-mode for an optimization job. +class VoiceAgentSemanticVadTurnDetection( + VoiceTurnDetection, discriminator="semantic_vad" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """OpenAI semantic VAD turn-detection settings. - :ivar max_candidates: Maximum number of optimization candidates to generate. Must be >= 1. - Default: 5. - :vartype max_candidates: int - :ivar optimization_config: Per-target-attribute configuration overrides. Contains skills, - tools, system_prompt for the agent, plus model space for model optimization. - :vartype optimization_config: dict[str, any] - :ivar eval_model: Model deployment used for evaluation. Defaults to server config (typically - 'gpt-4o'). - :vartype eval_model: str - :ivar optimization_model: Model deployment for optimization reasoning (must be gpt-5 family). - Falls back to the default eval model when not set. - :vartype optimization_model: str - :ivar evaluation_level: Evaluation granularity. Null/omitted means per-item single-turn. Set to - 'conversation' for per-conversation multi-turn simulation scoring. Known values are: "turn" and - "conversation". - :vartype evaluation_level: str or ~azure.ai.projects.models.EvaluationLevel - :ivar max_stalls: Maximum number of consecutive reflective minibatch rejections before stopping - early. A 'stall' occurs when the optimizer proposes a prompt change, evaluates it on a small - subset, and the score does not improve — so no full validation-set evaluation is triggered. The - counter resets whenever a minibatch passes and its full-validation score beats the current - best. Only a sustained plateau of ``max_stalls`` consecutive minibatch failures triggers the - stop. The service defaults to 5 if a value is not specified by the caller. Must be >= 1 when - set. - :vartype max_stalls: int + :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech + stops. + :vartype auto_truncate: bool + :ivar eagerness: Is one of the following types: Literal["low"], Literal["medium"], + Literal["high"], Literal["auto"] + :vartype eagerness: str or str or str or str + :ivar create_response: + :vartype create_response: bool + :ivar interrupt_response: + :vartype interrupt_response: bool + :ivar type: Required. Semantic voice activity detection. + :vartype type: str or ~azure.ai.projects.models.SEMANTIC_VAD """ - max_candidates: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Maximum number of optimization candidates to generate. Must be >= 1. Default: 5.""" - optimization_config: Optional[dict[str, Any]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Per-target-attribute configuration overrides. Contains skills, tools, system_prompt for the - agent, plus model space for model optimization.""" - eval_model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Model deployment used for evaluation. Defaults to server config (typically 'gpt-4o').""" - optimization_model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Model deployment for optimization reasoning (must be gpt-5 family). Falls back to the default - eval model when not set.""" - evaluation_level: Optional[Union[str, "_models.EvaluationLevel"]] = rest_field( + eagerness: Optional[Literal["low", "medium", "high", "auto"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Evaluation granularity. Null/omitted means per-item single-turn. Set to 'conversation' for - per-conversation multi-turn simulation scoring. Known values are: \"turn\" and - \"conversation\".""" - max_stalls: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Maximum number of consecutive reflective minibatch rejections before stopping early. A 'stall' - occurs when the optimizer proposes a prompt change, evaluates it on a small subset, and the - score does not improve — so no full validation-set evaluation is triggered. The counter resets - whenever a minibatch passes and its full-validation score beats the current best. Only a - sustained plateau of ``max_stalls`` consecutive minibatch failures triggers the stop. The - service defaults to 5 if a value is not specified by the caller. Must be >= 1 when set.""" + """Is one of the following types: Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"], + Literal[\"auto\"]""" + create_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + interrupt_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Semantic voice activity detection.""" @overload def __init__( self, *, - max_candidates: Optional[int] = None, - optimization_config: Optional[dict[str, Any]] = None, - eval_model: Optional[str] = None, - optimization_model: Optional[str] = None, - evaluation_level: Optional[Union[str, "_models.EvaluationLevel"]] = None, - max_stalls: Optional[int] = None, + auto_truncate: Optional[bool] = None, + eagerness: Optional[Literal["low", "medium", "high", "auto"]] = None, + create_response: Optional[bool] = None, + interrupt_response: Optional[bool] = None, ) -> None: ... @overload @@ -11726,34 +20018,56 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = VoiceTurnDetectionType.SEMANTIC_VAD # type: ignore -class OptimizationReferenceDatasetInput(OptimizationDatasetInput, discriminator="reference"): - """Reference to a registered Foundry dataset. +class VoiceAgentServerEventConversationItemAdded( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``conversation.item.added`` server event. - :ivar type: Dataset input type discriminator. Required. Reference to a registered Foundry - dataset by name and version. - :vartype type: str or ~azure.ai.projects.models.REFERENCE - :ivar name: Registered dataset name. Required. - :vartype name: str - :ivar version: Dataset version. If not specified, the latest version is used. - :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 ``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: The item added to the conversation. Required. Is one of the following types: + "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem + :vartype item: ~azure.ai.projects.models.RealtimeConversationItemMessageSystem or + ~azure.ai.projects.models.RealtimeConversationItemMessageUser or + ~azure.ai.projects.models.RealtimeConversationItemMessageAssistant or + ~azure.ai.projects.models.VoiceFunctionCallItem or + ~azure.ai.projects.models.VoiceFunctionCallOutputItem or + ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem + or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or + ~azure.ai.projects.models.VoiceMcpApprovalResponseItem """ - type: Literal[OptimizationDatasetInputType.REFERENCE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Dataset input type discriminator. Required. Reference to a registered Foundry dataset by name - and version.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Registered dataset name. Required.""" - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Dataset version. If not specified, the latest version is used.""" + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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: "_unions.VoiceAgentResponseItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The item added to the conversation. Required. Is one of the following types: + \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem""" @overload def __init__( self, *, - name: str, - version: Optional[str] = None, + event_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED], + item: "_unions.VoiceAgentResponseItem", + previous_item_id: Optional[str] = None, ) -> None: ... @overload @@ -11765,43 +20079,55 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = OptimizationDatasetInputType.REFERENCE # type: ignore - -class TelemetryEndpoint(_Model): - """A telemetry export endpoint configuration. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - OtlpTelemetryEndpoint +class VoiceAgentServerEventConversationItemCreated( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``conversation.item.created`` server event. - :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 + :ivar event_id: The unique ID of the server event. Required. + :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: The created conversation item. Required. Is one of the following types: + "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem + :vartype item: ~azure.ai.projects.models.RealtimeConversationItemMessageSystem or + ~azure.ai.projects.models.RealtimeConversationItemMessageUser or + ~azure.ai.projects.models.RealtimeConversationItemMessageAssistant or + ~azure.ai.projects.models.VoiceFunctionCallItem or + ~azure.ai.projects.models.VoiceFunctionCallOutputItem or + ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem + or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or + ~azure.ai.projects.models.VoiceMcpApprovalResponseItem """ - __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( + 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_field( visibility=["read", "create", "update", "delete", "query"] ) - """Optional authentication configuration.""" + """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: "_unions.VoiceAgentResponseItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The created conversation item. Required. Is one of the following types: + \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem""" @overload def __init__( self, *, - kind: str, - data: list[Union[str, "_models.TelemetryDataKind"]], - auth: Optional["_models.TelemetryEndpointAuth"] = None, + event_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED], + item: "_unions.VoiceAgentResponseItem", + previous_item_id: Optional[str] = None, ) -> None: ... @overload @@ -11815,43 +20141,36 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OtlpTelemetryEndpoint(TelemetryEndpoint, discriminator="OTLP"): - """An OTLP (OpenTelemetry Protocol) telemetry export endpoint. +class VoiceAgentServerEventConversationItemDeleted( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``conversation.item.deleted`` server event. - :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 event_id: The unique ID of the server event. Required. + :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. + :vartype item_id: 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( + 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_field( visibility=["read", "create", "update", "delete", "query"] ) - """The transport protocol for the OTLP endpoint. Required. Known values are: \"Http\" and - \"Grpc\".""" + """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 item that was deleted. Required.""" @overload def __init__( self, *, - data: list[Union[str, "_models.TelemetryDataKind"]], - endpoint: str, - protocol: Union[str, "_models.TelemetryTransportProtocol"], - auth: Optional["_models.TelemetryEndpointAuth"] = None, + event_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED], + item_id: str, ) -> None: ... @overload @@ -11863,43 +20182,55 @@ 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): - """Represents a request for a pending upload. +class VoiceAgentServerEventConversationItemDone( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``conversation.item.done`` server event. - :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 event_id: The unique ID of the server event. Required. + :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: The completed conversation item. Required. Is one of the following types: + "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem + :vartype item: ~azure.ai.projects.models.RealtimeConversationItemMessageSystem or + ~azure.ai.projects.models.RealtimeConversationItemMessageUser or + ~azure.ai.projects.models.RealtimeConversationItemMessageAssistant or + ~azure.ai.projects.models.VoiceFunctionCallItem or + ~azure.ai.projects.models.VoiceFunctionCallOutputItem or + ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem + or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or + ~azure.ai.projects.models.VoiceMcpApprovalResponseItem """ - 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"] + 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_field( + 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 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: "_unions.VoiceAgentResponseItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The completed conversation item. Required. Is one of the following types: + \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem""" @overload def __init__( self, *, - pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE], - pending_upload_id: Optional[str] = None, - connection_name: Optional[str] = None, + event_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE], + item: "_unions.VoiceAgentResponseItem", + previous_item_id: Optional[str] = None, ) -> None: ... @overload @@ -11913,45 +20244,73 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PendingUploadResponse(_Model): - """Represents the response for a pending upload request. +class VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``conversation.item.input_audio_transcription.completed`` server event. - :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 event_id: The unique ID of the server event. Required. + :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 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] """ - blob_reference: "_models.BlobReference" = rest_field( - name="blobReference", 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[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED] = rest_field( + 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"] + """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.""" + logprobs: Optional[list["_models.LogProbProperties"]] = rest_field( + 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"] + usage: Union["_models.TranscriptTextUsageTokens", "_models.TranscriptTextUsageDuration"] = rest_field( + 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.""" + """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, *, - blob_reference: "_models.BlobReference", - pending_upload_id: str, - pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE], - version: Optional[str] = None, + event_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED], + item_id: str, + content_index: int, + transcript: str, + usage: Union["_models.TranscriptTextUsageTokens", "_models.TranscriptTextUsageDuration"], + logprobs: Optional[list["_models.LogProbProperties"]] = None, + phrases: Optional[list["_models.VoiceAgentTranscriptionPhrase"]] = None, ) -> None: ... @overload @@ -11965,34 +20324,54 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ProceduralMemoryItem(MemoryItem, discriminator="procedural"): - """A memory item containing a procedure extracted from conversations. +class VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``conversation.item.input_audio_transcription.delta`` server event. - :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 event_id: The unique ID of the server event. Required. + :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] """ - 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.""" + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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"] + ) @overload def __init__( self, *, - memory_id: str, - updated_at: datetime.datetime, - scope: str, - content: str, + event_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA], + item_id: str, + content_index: Optional[int] = None, + delta: Optional[str] = None, + logprobs: Optional[list["_models.LogProbProperties"]] = None, ) -> None: ... @overload @@ -12004,36 +20383,53 @@ 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 PromotionInfo(_Model): - """Promotion metadata recorded when a candidate is deployed to a Foundry agent. +class VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``conversation.item.input_audio_transcription.failed`` server event. - :ivar promoted_at: Timestamp when promotion occurred, represented in Unix time. Required. - :vartype promoted_at: ~datetime.datetime - :ivar agent_name: Name of the Foundry agent this candidate was promoted to. Required. - :vartype agent_name: str - :ivar agent_version: Version of the Foundry agent this candidate was promoted to. Required. - :vartype agent_version: 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.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 """ - promoted_at: 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.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Timestamp when promotion occurred, represented in Unix time. Required.""" - agent_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name of the Foundry agent this candidate was promoted to. Required.""" - agent_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Version of the Foundry agent this candidate was promoted to. Required.""" + """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.""" @overload def __init__( self, *, - promoted_at: datetime.datetime, - agent_name: str, - agent_version: str, + event_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED], + item_id: str, + content_index: int, + error: "_models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError", ) -> None: ... @overload @@ -12047,94 +20443,68 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PromptAgentDefinition(AgentDefinition, discriminator="prompt"): - """The prompt agent definition. +class VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``conversation.item.input_audio_transcription.segment`` server event. - :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 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 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 event_id: The unique ID of the server event. Required. + :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 """ - kind: Literal[AgentKind.PROMPT] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. PROMPT.""" - 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.""" - 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( + 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_field( visibility=["read", "create", "update", "delete", "query"] ) - """Set of structured inputs that can participate in prompt template substitution or tool argument - bindings.""" + """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, *, - model: str, - rai_config: Optional["_models.RaiConfig"] = None, - instructions: Optional[str] = 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, + event_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT], + item_id: str, + content_index: int, + text: str, + id: str, # pylint: disable=redefined-builtin + speaker: str, + start: float, + end: float, ) -> None: ... @overload @@ -12146,26 +20516,51 @@ 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 -class PromptAgentDefinitionTextOptions(_Model): - """Configuration options for a text response from the model. Can be plain text or structured JSON - data. +class VoiceAgentServerEventConversationItemRetrieved( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``conversation.item.retrieved`` server event. - :ivar format: - :vartype format: ~azure.ai.projects.models.TextResponseFormat + :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: The retrieved conversation item. Required. Is one of the following types: + "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem + :vartype item: ~azure.ai.projects.models.RealtimeConversationItemMessageSystem or + ~azure.ai.projects.models.RealtimeConversationItemMessageUser or + ~azure.ai.projects.models.RealtimeConversationItemMessageAssistant or + ~azure.ai.projects.models.VoiceFunctionCallItem or + ~azure.ai.projects.models.VoiceFunctionCallOutputItem or + ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem + or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or + ~azure.ai.projects.models.VoiceMcpApprovalResponseItem """ - format: Optional["_models.TextResponseFormat"] = rest_field( + 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_field( visibility=["read", "create", "update", "delete", "query"] ) + """The event type, must be ``conversation.item.retrieved``. Required. CONVERSATION_ITEM_RETRIEVED.""" + item: "_unions.VoiceAgentResponseItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The retrieved conversation item. Required. Is one of the following types: + \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem""" @overload def __init__( self, *, - format: Optional["_models.TextResponseFormat"] = None, + event_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED], + item: "_unions.VoiceAgentResponseItem", ) -> None: ... @overload @@ -12179,36 +20574,54 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PromptBasedEvaluatorDefinition(EvaluatorDefinition, discriminator="prompt"): - """Prompt-based evaluator. +class VoiceAgentServerEventConversationItemTruncated( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``conversation.item.truncated`` server event. - :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 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.RealtimeConversationItemMessageAssistant """ - 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.""" + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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.RealtimeConversationItemMessageAssistant"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The assistant message after truncation, when the service returns the updated item.""" @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, + event_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED], + item_id: str, + content_index: int, + audio_end_ms: int, + item: Optional["_models.RealtimeConversationItemMessageAssistant"] = None, ) -> None: ... @overload @@ -12220,36 +20633,33 @@ 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"): - """Prompt source for data generation jobs — inline text provided by the user. +class VoiceAgentServerEventInputAudioBufferCleared( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``input_audio_buffer.cleared`` server event. - :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 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 """ - 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.""" + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The event type, must be ``input_audio_buffer.cleared``. Required. INPUT_AUDIO_BUFFER_CLEARED.""" @overload def __init__( self, *, - prompt: str, - description: Optional[str] = None, + event_id: str, + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED], ) -> None: ... @overload @@ -12261,39 +20671,43 @@ 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"): - """Prompt source for evaluator generation jobs — inline text provided by the user. +class VoiceAgentServerEventInputAudioBufferCommitted( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``input_audio_buffer.committed`` server event. - :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 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 """ - 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.""" + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, *, - prompt: str, - description: Optional[str] = None, + event_id: str, + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED], + item_id: str, + previous_item_id: Optional[str] = None, ) -> None: ... @overload @@ -12305,61 +20719,49 @@ 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 -class ProtocolConfiguration(_Model): - """Per-protocol configuration for the agent endpoint. +class VoiceAgentServerEventInputAudioBufferSpeechStarted( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``input_audio_buffer.speech_started`` server event. - :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 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 """ - 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( + 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_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.""" + """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, *, - 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, + event_id: str, + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED], + audio_start_ms: int, + item_id: str, ) -> None: ... @overload @@ -12373,30 +20775,46 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ProtocolVersionRecord(_Model): - """A record mapping for a single protocol and its version. +class VoiceAgentServerEventInputAudioBufferSpeechStopped( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``input_audio_buffer.speech_stopped`` server event. - :ivar protocol: The protocol type. Required. Known values are: "activity", "responses", "a2a", - "mcp", "invocations", 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. - :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 ``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 """ - protocol: Union[str, "_models.AgentEndpointProtocol"] = rest_field( + 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_field( visibility=["read", "create", "update", "delete", "query"] ) - """The protocol type. Required. Known values are: \"activity\", \"responses\", \"a2a\", \"mcp\", - \"invocations\", 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.""" + """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, *, - protocol: Union[str, "_models.AgentEndpointProtocol"], - version: str, + event_id: str, + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED], + audio_end_ms: int, + item_id: str, ) -> None: ... @overload @@ -12410,21 +20828,51 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RaiConfig(_Model): - """Configuration for Responsible AI (RAI) content filtering and safety features. +class VoiceAgentServerEventInputAudioBufferTimeoutTriggered( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``input_audio_buffer.timeout_triggered`` server event. - :ivar rai_policy_name: The name of the RAI policy to apply. Required. - :vartype rai_policy_name: 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.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 """ - rai_policy_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the RAI policy to apply. 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, *, - rai_policy_name: str, + event_id: str, + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED], + audio_start_ms: int, + audio_end_ms: int, + item_id: str, ) -> None: ... @overload @@ -12438,41 +20886,36 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RankingOptions(_Model): - """RankingOptions. +class VoiceAgentServerEventMcpListToolsCompleted( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``mcp_list_tools.completed`` server event. - :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 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 """ - 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( + 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_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.""" + """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, *, - ranker: Optional[Union[str, "_models.RankerVersionType"]] = None, - score_threshold: Optional[float] = None, - hybrid_search: Optional["_models.HybridSearchOptions"] = None, + event_id: str, + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED], + item_id: str, ) -> None: ... @overload @@ -12486,41 +20929,33 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Reasoning(_Model): - """Reasoning. +class VoiceAgentServerEventMcpListToolsFailed(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``mcp_list_tools.failed`` server event. - :ivar effort: Is one of the following types: Literal["none"], Literal["minimal"], - Literal["low"], Literal["medium"], Literal["high"], Literal["xhigh"] - :vartype effort: str or str or str or str or str or str - :ivar summary: Is one of the following types: Literal["auto"], Literal["concise"], - Literal["detailed"] - :vartype summary: 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 ``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 """ - effort: Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Is one of the following types: Literal[\"none\"], Literal[\"minimal\"], Literal[\"low\"], - Literal[\"medium\"], Literal[\"high\"], Literal[\"xhigh\"]""" - 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\"]""" - generate_summary: Optional[Literal["auto", "concise", "detailed"]] = rest_field( + 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_field( visibility=["read", "create", "update", "delete", "query"] ) - """Is one of the following types: Literal[\"auto\"], Literal[\"concise\"], Literal[\"detailed\"]""" + """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, *, - effort: Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]] = None, - summary: Optional[Literal["auto", "concise", "detailed"]] = None, - generate_summary: Optional[Literal["auto", "concise", "detailed"]] = None, + event_id: str, + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED], + item_id: str, ) -> None: ... @overload @@ -12534,49 +20969,36 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RecurrenceTrigger(Trigger, discriminator="Recurrence"): - """Recurrence based trigger. +class VoiceAgentServerEventMcpListToolsInProgress( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``mcp_list_tools.in_progress`` server event. - :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 ``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 """ - 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.MCP_LIST_TOOLS_IN_PROGRESS] = 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 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, *, - 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, + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS], + item_id: str, ) -> None: ... @overload @@ -12588,88 +21010,38 @@ 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 RedTeam(_Model): - """Red team details. - - :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 - """ - - 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.""" + +class VoiceAgentServerEventOutputAudioBufferCleared( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``output_audio_buffer.cleared`` server event. + + :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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, *, - 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, + type: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED], + response_id: str, ) -> None: ... @overload @@ -12683,31 +21055,36 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ReminderPreviewToolboxTool(ToolboxTool, discriminator="reminder_preview"): - """A reminder tool stored in a toolbox. +class VoiceAgentServerEventRateLimitsUpdated(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``rate_limits.updated`` server event. - :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 ``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] """ - 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.RATE_LIMITS_UPDATED] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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.""" @overload def __init__( self, *, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + event_id: str, + type: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED], + rate_limits: list["_models.RealtimeServerEventRateLimitsUpdatedRateLimits"], ) -> None: ... @overload @@ -12719,28 +21096,61 @@ 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.""" - -class ResponseUsageInputTokensDetails(_Model): - """ResponseUsageInputTokensDetails. - :ivar cached_tokens: Required. - :vartype cached_tokens: int - """ +class VoiceAgentServerEventResponseAnimationBlendshapesDelta( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.animation_blendshapes.delta`` server event. - cached_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + :ivar type: Required. Default value is "response.animation_blendshapes.delta". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int + :ivar frames: Animation frames as numeric blendshape weights. Required. + :vartype frames: list[list[float]] + :ivar frame_index: The index of the first frame in this delta. Required. + :vartype frame_index: int + """ + + type: Literal["response.animation_blendshapes.delta"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Default value is \"response.animation_blendshapes.delta\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + frames: list[list[float]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Animation frames as numeric blendshape weights. Required.""" + frame_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the first frame in this delta. Required.""" @overload def __init__( self, *, - cached_tokens: int, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + frames: list[list[float]], + frame_index: int, ) -> None: ... @overload @@ -12752,23 +21162,47 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["response.animation_blendshapes.delta"] = "response.animation_blendshapes.delta" -class ResponseUsageOutputTokensDetails(_Model): - """ResponseUsageOutputTokensDetails. +class VoiceAgentServerEventResponseAnimationBlendshapesDone( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.animation_blendshapes.done`` server event. - :ivar reasoning_tokens: Required. - :vartype reasoning_tokens: int + :ivar type: Required. Default value is "response.animation_blendshapes.done". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int """ - reasoning_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal["response.animation_blendshapes.done"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Default value is \"response.animation_blendshapes.done\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" @overload def __init__( self, *, - reasoning_tokens: int, + event_id: str, + response_id: str, + item_id: str, + output_index: int, ) -> None: ... @overload @@ -12780,59 +21214,62 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["response.animation_blendshapes.done"] = "response.animation_blendshapes.done" -class Routine(_Model): - """A routine definition returned by the service. - - :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 - """ +class VoiceAgentServerEventResponseAnimationVisemeDelta( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.animation_viseme.delta`` server event. - 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( + :ivar type: Required. Default value is "response.animation_viseme.delta". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int + :ivar audio_offset_ms: Required. + :vartype audio_offset_ms: int + :ivar viseme_id: Required. + :vartype viseme_id: int + """ + + type: Literal["response.animation_viseme.delta"] = 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.""" + """Required. Default value is \"response.animation_viseme.delta\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + audio_offset_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + viseme_id: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """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, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + audio_offset_ms: int, + viseme_id: int, ) -> None: ... @overload @@ -12844,162 +21281,114 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["response.animation_viseme.delta"] = "response.animation_viseme.delta" -class RoutineRun(_Model): - """A single routine run returned from the run history API. +class VoiceAgentServerEventResponseAnimationVisemeDone( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.animation_viseme.done`` server event. - :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. + :ivar type: Required. Default value is "response.animation_viseme.done". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. :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 item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int """ - id: str = rest_field(visibility=["read"]) - """The unique run identifier for the routine attempt. Required.""" - status: Optional["_types.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( + type: Literal["response.animation_viseme.done"] = 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.""" + """Required. Default value is \"response.animation_viseme.done\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + content_index: int = 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, + ) -> 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["response.animation_viseme.done"] = "response.animation_viseme.done" + + +class VoiceAgentServerEventResponseAudioDelta(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``response.output_audio.delta`` server event. + + :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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, *, - status: Optional["_types.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, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA], + response_id: str, + item_id: str, + output_index: int, + content_index: int, + delta: bytes, ) -> None: ... @overload @@ -13013,59 +21402,49 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RubricBasedEvaluatorDefinition(EvaluatorDefinition, discriminator="rubric"): - """Rubric-based evaluator definition — stores dimensions produced by the generate API. Used for - both quality and safety evaluators. +class VoiceAgentServerEventResponseAudioDone(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``response.output_audio.done`` server event. - :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 ``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[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.RESPONSE_OUTPUT_AUDIO_DONE] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, *, - 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, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE], + response_id: str, + item_id: str, + output_index: int, + content_index: int, ) -> None: ... @overload @@ -13077,66 +21456,70 @@ 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 RubricGenerationInputQualityWarning(_Model): - """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 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.inputs.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 - """ +class VoiceAgentServerEventResponseAudioTimestampDelta( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.audio_timestamp.delta`` server event. - 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( + :ivar type: Required. Default value is "response.audio_timestamp.delta". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int + :ivar audio_offset_ms: Required. + :vartype audio_offset_ms: int + :ivar audio_duration_ms: Required. + :vartype audio_duration_ms: int + :ivar text: Required. + :vartype text: str + :ivar timestamp_type: Required. Default value is "word". + :vartype timestamp_type: str + """ + + type: Literal["response.audio_timestamp.delta"] = 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.inputs.sources`` when the warning applies to a - specific source. Omitted for aggregate warnings and for warnings not tied to one source.""" + """Required. Default value is \"response.audio_timestamp.delta\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + audio_offset_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + audio_duration_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + timestamp_type: Literal["word"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"word\".""" @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, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + audio_offset_ms: int, + audio_duration_ms: int, + text: str, ) -> None: ... @overload @@ -13148,25 +21531,53 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["response.audio_timestamp.delta"] = "response.audio_timestamp.delta" + self.timestamp_type: Literal["word"] = "word" -class SASCredentials(BaseCredentials, discriminator="SAS"): - """Shared Access Signature (SAS) credential definition. +class VoiceAgentServerEventResponseAudioTimestampDone( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.audio_timestamp.done`` server event. - :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 type: Required. Default value is "response.audio_timestamp.done". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int """ - 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.""" + type: Literal["response.audio_timestamp.done"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Default value is \"response.audio_timestamp.done\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + content_index: int = 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, ) -> None: ... @overload @@ -13178,74 +21589,189 @@ 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 + self.type: Literal["response.audio_timestamp.done"] = "response.audio_timestamp.done" -class Schedule(_Model): - """Schedule model. - - :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] - """ +class VoiceAgentServerEventResponseAudioTranscriptDelta( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.output_audio_transcript.delta`` server event. - 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"] + :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 + """ + + 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_field( + 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"] + """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, + *, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA], + response_id: str, + item_id: str, + output_index: int, + content_index: int, + delta: 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 VoiceAgentServerEventResponseAudioTranscriptDone( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.output_audio_transcript.done`` server event. + + :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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] ) - """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.""" + """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, *, - 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, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE], + response_id: str, + item_id: str, + output_index: int, + content_index: int, + transcript: 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 VoiceAgentServerEventResponseContentPartDone( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.content_part.done`` server event. + + :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 finished streaming. Required. + :vartype part: ~azure.ai.projects.models.VoiceAgentResponseEventContentPart + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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.VoiceAgentResponseEventContentPart" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The content part that finished streaming. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE], + response_id: str, + item_id: str, + output_index: int, + content_index: int, + part: "_models.VoiceAgentResponseEventContentPart", ) -> None: ... @overload @@ -13259,32 +21785,35 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ScheduleRoutineTrigger(RoutineTrigger, discriminator="schedule"): - """A recurring cron-based routine trigger. +class VoiceAgentServerEventResponseCreated(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``response.created`` server event. - :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.created``. Required. RESPONSE_CREATED. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_CREATED + :ivar response: The created voice-agent response. Required. + :vartype response: ~azure.ai.projects.models.VoiceAgentRealtimeResponse """ - 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_CREATED] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The event type, must be ``response.created``. Required. RESPONSE_CREATED.""" + response: "_models.VoiceAgentRealtimeResponse" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The created voice-agent response. Required.""" @overload def __init__( self, *, - cron_expression: str, - time_zone: str, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_CREATED], + response: "_models.VoiceAgentRealtimeResponse", ) -> None: ... @overload @@ -13296,47 +21825,37 @@ 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 -class ScheduleRun(_Model): - """Schedule run model. +class VoiceAgentServerEventResponseDone(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``response.done`` server event. - :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.done``. Required. RESPONSE_DONE. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_DONE + :ivar response: The completed voice-agent response. Required. + :vartype response: ~azure.ai.projects.models.VoiceAgentRealtimeResponse """ - 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" + 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_field( + visibility=["read", "create", "update", "delete", "query"] ) - """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.""" + """The event type, must be ``response.done``. Required. RESPONSE_DONE.""" + response: "_models.VoiceAgentRealtimeResponse" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The completed voice-agent response. Required.""" @overload def __init__( self, *, - schedule_id: str, - trigger_time: Optional[datetime.datetime] = None, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_DONE], + response: "_models.VoiceAgentRealtimeResponse", ) -> None: ... @overload @@ -13350,38 +21869,57 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SessionDirectoryEntry(_Model): - """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 - """ +class VoiceAgentServerEventResponseFunctionCallArgumentsDelta( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.function_call_arguments.delta`` server event. - 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" + :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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The Unix timestamp (in seconds) when the file was last modified. Required.""" + """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, *, - name: str, - size: int, - is_directory: bool, - modified_time: datetime.datetime, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA], + response_id: str, + item_id: str, + output_index: int, + call_id: str, + delta: str, ) -> None: ... @overload @@ -13395,27 +21933,62 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SessionFileWriteResult(_Model): - """Response from uploading a file to a session sandbox. +class VoiceAgentServerEventResponseFunctionCallArgumentsDone( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.function_call_arguments.done`` server event. - :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 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 """ - 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.""" + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, *, - path: str, - bytes_written: int, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE], + response_id: str, + item_id: str, + output_index: int, + call_id: str, + name: str, + arguments: str, ) -> None: ... @overload @@ -13429,51 +22002,56 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SessionLogEvent(_Model): - """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 - """ +class VoiceAgentServerEventResponseMcpCallArgumentsDelta( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.mcp_call_arguments.delta`` server event. - event: Union[str, "_models.SessionLogEventType"] = rest_field( + :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_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 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, *, - event: Union[str, "_models.SessionLogEventType"], - data: str, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA], + response_id: str, + item_id: str, + output_index: int, + delta: str, + obfuscation: Optional[str] = None, ) -> None: ... @overload @@ -13487,25 +22065,52 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SharepointGroundingToolParameters(_Model): - """The sharepoint grounding tool parameters. +class VoiceAgentServerEventResponseMcpCallArgumentsDone( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.mcp_call_arguments.done`` server event. - :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 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 """ - project_connections: Optional[list["_models.ToolProjectConnection"]] = 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_MCP_CALL_ARGUMENTS_DONE] = 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 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, *, - project_connections: Optional[list["_models.ToolProjectConnection"]] = None, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE], + response_id: str, + item_id: str, + output_index: int, + arguments: str, ) -> None: ... @overload @@ -13519,30 +22124,41 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SharepointPreviewTool(Tool, discriminator="sharepoint_grounding_preview"): - """The input definition information for a sharepoint tool as used to configure an agent. +class VoiceAgentServerEventResponseMcpCallCompleted( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.mcp_call.completed`` server event. - :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.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 """ - 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_MCP_CALL_COMPLETED] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The sharepoint grounding tool parameters. Required.""" + """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, *, - sharepoint_grounding_preview: "_models.SharepointGroundingToolParameters", + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED], + output_index: int, + item_id: str, ) -> None: ... @overload @@ -13554,42 +22170,43 @@ 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 -class SimpleQnADataGenerationJobOptions(DataGenerationJobOptions, discriminator="simple_qna"): - """The options for a data generation job with SimpleQnA type. +class VoiceAgentServerEventResponseMcpCallFailed( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.mcp_call.failed`` server event. - :ivar max_samples: Maximum number of samples to generate. Required. - :vartype max_samples: int - :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 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.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 """ - 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.""" - question_types: Optional[list[Union[str, "_models.SimpleQnAFineTuningQuestionType"]]] = 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_MCP_CALL_FAILED] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The question types to generate. Used only for fine-tuning scenarios.""" + """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, *, - 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, + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED], + output_index: int, + item_id: str, ) -> None: ... @overload @@ -13601,52 +22218,44 @@ 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 -class SkillDetails(_Model): - """A skill resource. +class VoiceAgentServerEventResponseMcpCallInProgress( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.mcp_call.in_progress`` server event. - :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.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 """ - 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" + 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_field( + visibility=["read", "create", "update", "delete", "query"] ) - """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.""" + """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, *, - id: str, # pylint: disable=redefined-builtin - name: str, - description: str, - created_at: datetime.datetime, - default_version: str, - latest_version: str, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS], + output_index: int, + item_id: str, ) -> None: ... @overload @@ -13656,54 +22265,63 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class SkillInlineContent(_Model): - """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.""" - + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class VoiceAgentServerEventResponseOutputItemAdded( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.output_item.added`` server event. + + :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: The output item that was added. Required. Is one of the following types: + "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem + :vartype item: ~azure.ai.projects.models.RealtimeConversationItemMessageSystem or + ~azure.ai.projects.models.RealtimeConversationItemMessageUser or + ~azure.ai.projects.models.RealtimeConversationItemMessageAssistant or + ~azure.ai.projects.models.VoiceFunctionCallItem or + ~azure.ai.projects.models.VoiceFunctionCallOutputItem or + ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem + or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or + ~azure.ai.projects.models.VoiceMcpApprovalResponseItem + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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: "_unions.VoiceAgentResponseItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The output item that was added. Required. Is one of the following types: + \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem""" + @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, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED], + response_id: str, + output_index: int, + item: "_unions.VoiceAgentResponseItem", ) -> None: ... @overload @@ -13717,30 +22335,59 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SkillReferenceParam(ContainerSkill, discriminator="skill_reference"): - """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 - """ +class VoiceAgentServerEventResponseOutputItemDone( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.output_item.done`` server event. - 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.""" + :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: The output item that finished streaming. Required. Is one of the following types: + "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem + :vartype item: ~azure.ai.projects.models.RealtimeConversationItemMessageSystem or + ~azure.ai.projects.models.RealtimeConversationItemMessageUser or + ~azure.ai.projects.models.RealtimeConversationItemMessageAssistant or + ~azure.ai.projects.models.VoiceFunctionCallItem or + ~azure.ai.projects.models.VoiceFunctionCallOutputItem or + ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem + or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or + ~azure.ai.projects.models.VoiceMcpApprovalResponseItem + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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: "_unions.VoiceAgentResponseItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The output item that finished streaming. Required. Is one of the following types: + \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem""" @overload def __init__( self, *, - skill_id: str, - version: Optional[str] = None, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE], + response_id: str, + output_index: int, + item: "_unions.VoiceAgentResponseItem", ) -> None: ... @overload @@ -13752,51 +22399,56 @@ 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 -class SkillVersion(_Model): - """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 - """ +class VoiceAgentServerEventResponseTextDelta(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``response.output_text.delta`` server event. - 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" + :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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The Unix timestamp (seconds) when the skill version was created. Required.""" + """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, *, - id: str, # pylint: disable=redefined-builtin - skill_id: str, - name: str, - version: str, - description: str, - created_at: datetime.datetime, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA], + response_id: str, + item_id: str, + output_index: int, + content_index: int, + delta: str, ) -> None: ... @overload @@ -13810,35 +22462,54 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ToolChoiceParam(_Model): - """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, SpecificFunctionShellParam, - ToolChoiceWebSearchPreview, ToolChoiceWebSearchPreview20250311 - - :ivar type: Required. Known values are: "allowed_tools", "function", "mcp", "custom", - "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 - """ +class VoiceAgentServerEventResponseTextDone(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``response.output_text.done`` server event. - __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\", - \"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\".""" + :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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, *, - type: str, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE], + response_id: str, + item_id: str, + output_index: int, + content_index: int, + text: str, ) -> None: ... @overload @@ -13852,19 +22523,40 @@ 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 - """ +class VoiceAgentServerEventResponseVideoDelta(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``response.video.delta`` server event. - 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.""" + :ivar type: Required. Default value is "response.video.delta". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar codec: Required. + :vartype codec: str + :ivar delta: The base64-encoded video frame data. Required. + :vartype delta: str + """ + + type: Literal["response.video.delta"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"response.video.delta\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + codec: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The base64-encoded video frame data. Required.""" @overload def __init__( self, + *, + event_id: str, + output_index: int, + codec: str, + delta: str, ) -> None: ... @overload @@ -13876,22 +22568,35 @@ 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: Literal["response.video.delta"] = "response.video.delta" -class SpecificFunctionShellParam(ToolChoiceParam, discriminator="shell"): - """Specific shell tool choice. +class VoiceAgentServerEventSessionAvatarConnecting( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``session.avatar.connecting`` server event. - :ivar type: The tool to call. Always ``shell``. Required. SHELL. - :vartype type: str or ~azure.ai.projects.models.SHELL + :ivar type: Required. Default value is "session.avatar.connecting". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar server_sdp: The server's SDP answer for avatar media negotiation. Required. + :vartype server_sdp: 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.""" + type: Literal["session.avatar.connecting"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"session.avatar.connecting\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + server_sdp: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The server's SDP answer for avatar media negotiation. Required.""" @overload def __init__( self, + *, + event_id: str, + server_sdp: str, ) -> None: ... @overload @@ -13903,42 +22608,36 @@ 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: Literal["session.avatar.connecting"] = "session.avatar.connecting" -class StructuredInputDefinition(_Model): - """An structured input that can participate in prompt template substitutions and tool argument - binding. +class VoiceAgentServerEventSessionAvatarSwitchToIdle( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``session.avatar.switch_to_idle`` server event. - :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 type: Required. Default value is "session.avatar.switch_to_idle". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar turn_id: + :vartype turn_id: 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.""" + type: Literal["session.avatar.switch_to_idle"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Default value is \"session.avatar.switch_to_idle\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + turn_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - description: Optional[str] = None, - default_value: Optional[Any] = None, - schema: Optional[dict[str, Any]] = None, - required: Optional[bool] = None, + event_id: str, + turn_id: Optional[str] = None, ) -> None: ... @overload @@ -13950,40 +22649,36 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["session.avatar.switch_to_idle"] = "session.avatar.switch_to_idle" -class StructuredOutputDefinition(_Model): - """A structured output that can be produced by the agent. +class VoiceAgentServerEventSessionAvatarSwitchToSpeaking( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``session.avatar.switch_to_speaking`` server event. - :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: Required. Default value is "session.avatar.switch_to_speaking". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar turn_id: + :vartype turn_id: str """ - 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["session.avatar.switch_to_speaking"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Default value is \"session.avatar.switch_to_speaking\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + turn_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - name: str, - description: str, - schema: dict[str, Any], - strict: bool, + event_id: str, + turn_id: Optional[str] = None, ) -> None: ... @overload @@ -13995,36 +22690,38 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["session.avatar.switch_to_speaking"] = "session.avatar.switch_to_speaking" -class TaskGenerationDataGenerationJobOptions(DataGenerationJobOptions, discriminator="task_generation"): - """The options 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``. +class VoiceAgentServerEventSessionCreated(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``session.created`` server event. - :ivar max_samples: Maximum number of samples to generate. Required. - :vartype max_samples: int - :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 TaskGeneration for this model. Required. - Task generation for evaluation scenarios. - :vartype type: str or ~azure.ai.projects.models.TASK_GENERATION + :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 initial effective voice-agent session configuration. Required. + :vartype session: ~azure.ai.projects.models.VoiceAgentSessionResponseConfig """ - type: Literal[DataGenerationJobType.TASK_GENERATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The data generation job type, which is TaskGeneration for this model. Required. Task generation - 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.SESSION_CREATED] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The event type, must be ``session.created``. Required. SESSION_CREATED.""" + session: "_models.VoiceAgentSessionResponseConfig" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The initial effective voice-agent session configuration. Required.""" @overload def __init__( self, *, - max_samples: int, - train_split: Optional[float] = None, - model_options: Optional["_models.DataGenerationModelOptions"] = None, + event_id: str, + type: Literal[RealtimeServerEventType.SESSION_CREATED], + session: "_models.VoiceAgentSessionResponseConfig", ) -> None: ... @overload @@ -14036,59 +22733,37 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DataGenerationJobType.TASK_GENERATION # type: ignore -class TaxonomyCategory(_Model): - """Taxonomy category definition. +class VoiceAgentServerEventSessionUpdated(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``session.updated`` server event. - :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] + :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 effective voice-agent session configuration after the update. Required. + :vartype session: ~azure.ai.projects.models.VoiceAgentSessionResponseConfig """ - 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"] + 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_field( + 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"] + """The event type, must be ``session.updated``. Required. SESSION_UPDATED.""" + session: "_models.VoiceAgentSessionResponseConfig" = rest_field( + 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.""" + """The effective voice-agent session configuration after the update. Required.""" @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, + event_id: str, + type: Literal[RealtimeServerEventType.SESSION_UPDATED], + session: "_models.VoiceAgentSessionResponseConfig", ) -> None: ... @overload @@ -14102,41 +22777,32 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TaxonomySubCategory(_Model): - """Taxonomy sub-category definition. +class VoiceAgentServerEventWarning(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``warning`` server event. - :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] + :ivar type: Required. Default value is "warning". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar warning: Required. + :vartype warning: ~azure.ai.projects.models.VoiceAgentServerEventWarningDetails """ - 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.""" + type: Literal["warning"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"warning\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + warning: "_models.VoiceAgentServerEventWarningDetails" = 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, + event_id: str, + warning: "_models.VoiceAgentServerEventWarningDetails", ) -> None: ... @overload @@ -14148,25 +22814,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["warning"] = "warning" -class TelemetryConfig(_Model): - """Customer-supplied telemetry configuration for exporting container logs, traces, and metrics. +class VoiceAgentServerEventWarningDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Details of a non-fatal warning. - :ivar endpoints: Customer-supplied telemetry export endpoint configurations. Required. - :vartype endpoints: list[~azure.ai.projects.models.TelemetryEndpoint] + :ivar message: Required. + :vartype message: str + :ivar code: + :vartype code: str + :ivar param: + :vartype param: str """ - endpoints: list["_models.TelemetryEndpoint"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Customer-supplied telemetry export endpoint configurations. Required.""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + code: 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, *, - endpoints: list["_models.TelemetryEndpoint"], + message: str, + code: Optional[str] = None, + param: Optional[str] = None, ) -> None: ... @overload @@ -14180,31 +22853,70 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TextResponseFormat(_Model): - """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 - """ +class VoiceAvatarConfig(_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. - __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\".""" + :ivar type: The avatar type. Required. Known values are: "video_avatar" and "photo_avatar". + :vartype type: str or ~azure.ai.projects.models.VoiceAvatarType + :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", "websocket", and "websocket-binary". + :vartype output_protocol: str or ~azure.ai.projects.models.VoiceAvatarOutputProtocol + :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 + """ + + type: Union[str, "_models.VoiceAvatarType"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """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.VoiceAvatarOutputProtocol"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The transport used to deliver the avatar video stream. Known values are: \"webrtc\", + \"websocket\", and \"websocket-binary\".""" + 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, *, - type: str, + type: Union[str, "_models.VoiceAvatarType"], + character: str, + style: Optional[str] = None, + customized: Optional[bool] = None, + output_protocol: Optional[Union[str, "_models.VoiceAvatarOutputProtocol"]] = None, + model: Optional[str] = None, + video: Optional["_models.VoiceAgentAvatarVideoParams"] = None, + scene: Optional["_models.VoiceAgentAvatarScene"] = None, + output_audit_audio: Optional[bool] = None, ) -> None: ... @overload @@ -14218,20 +22930,50 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TextResponseFormatJsonObject(TextResponseFormat, discriminator="json_object"): - """JSON object. +class VoiceAgentSessionAvatarConfig(VoiceAvatarConfig): # pylint: disable=docstring-keyword-should-match-keyword-only + """Avatar settings accepted by the stable voice-agent WebSocket contract. - :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 avatar type. Required. Known values are: "video_avatar" and "photo_avatar". + :vartype type: str or ~azure.ai.projects.models.VoiceAvatarType + :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", "websocket", and "websocket-binary". + :vartype output_protocol: str or ~azure.ai.projects.models.VoiceAvatarOutputProtocol + :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 ice_servers: + :vartype ice_servers: list[~azure.ai.projects.models.VoiceAgentAvatarIceServer] """ - 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.""" + ice_servers: Optional[list["_models.VoiceAgentAvatarIceServer"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) @overload def __init__( self, + *, + type: Union[str, "_models.VoiceAvatarType"], + character: str, + style: Optional[str] = None, + customized: Optional[bool] = None, + output_protocol: Optional[Union[str, "_models.VoiceAvatarOutputProtocol"]] = None, + model: Optional[str] = None, + video: Optional["_models.VoiceAgentAvatarVideoParams"] = None, + scene: Optional["_models.VoiceAgentAvatarScene"] = None, + output_audit_audio: Optional[bool] = None, + ice_servers: Optional[list["_models.VoiceAgentAvatarIceServer"]] = None, ) -> None: ... @overload @@ -14243,47 +22985,147 @@ 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 -class TextResponseFormatJsonSchema(TextResponseFormat, discriminator="json_schema"): - """JSON schema. +class VoiceAgentSessionResponseConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The effective stable realtime session settings returned by the voice-agent service. - :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 + :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.VoiceAudioConfig + :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: + Union[str, "_models.ToolChoiceOptions"], ToolChoiceFunction, ToolChoiceMCP + :vartype tool_choice: str or ~azure.ai.projects.models.ToolChoiceOptions 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. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. + :vartype interim_response: ~azure.ai.projects.models.VoiceAgentStaticInterimResponseConfig or + ~azure.ai.projects.models.VoiceAgentLlmInterimResponseConfig + :ivar greeting: A proactive assistant greeting started after session configuration. + :vartype greeting: ~azure.ai.projects.models.VoiceGreetingConfig + :ivar object: The object type. Always ``realtime.session``. Required. Default value is + "realtime.session". + :vartype object: str + :ivar id: The session identifier. Required. + :vartype id: str + :ivar model: The selected model. Required. + :vartype model: str + :ivar expires_at: The session expiration time as a Unix timestamp in seconds. + :vartype expires_at: ~datetime.datetime """ - 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"]) + 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.VoiceAudioConfig"] = 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: Union[str, + \"_models.ToolChoiceOptions\"], 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["_unions.VoiceAgentInterimResponse"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Interim-response settings for latency and tool execution. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type.""" + greeting: Optional["_models.VoiceGreetingConfig"] = rest_field( + 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.""" @overload def __init__( self, *, - name: str, - schema: dict[str, Any], - description: Optional[str] = None, - strict: Optional[bool] = None, + 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.VoiceAudioConfig"] = 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["_unions.VoiceAgentInterimResponse"] = None, + greeting: Optional["_models.VoiceGreetingConfig"] = None, + expires_at: Optional[datetime.datetime] = None, ) -> None: ... @overload @@ -14295,22 +23137,127 @@ 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 + self.type: Literal["realtime"] = "realtime" + self.object: Literal["realtime.session"] = "realtime.session" -class TextResponseFormatText(TextResponseFormat, discriminator="text"): - """Text. +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 type of response format being defined. Always ``text``. Required. TEXT. - :vartype type: str or ~azure.ai.projects.models.TEXT + :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.VoiceAudioConfig + :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: + Union[str, "_models.ToolChoiceOptions"], ToolChoiceFunction, ToolChoiceMCP + :vartype tool_choice: str or ~azure.ai.projects.models.ToolChoiceOptions 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. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. + :vartype interim_response: ~azure.ai.projects.models.VoiceAgentStaticInterimResponseConfig or + ~azure.ai.projects.models.VoiceAgentLlmInterimResponseConfig + :ivar greeting: A proactive assistant greeting started after session configuration. + :vartype greeting: ~azure.ai.projects.models.VoiceGreetingConfig """ - 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.""" + 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.VoiceAudioConfig"] = 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: Union[str, + \"_models.ToolChoiceOptions\"], 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["_unions.VoiceAgentInterimResponse"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Interim-response settings for latency and tool execution. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type.""" + greeting: Optional["_models.VoiceGreetingConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """A proactive assistant greeting started after session configuration.""" @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.VoiceAudioConfig"] = 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["_unions.VoiceAgentInterimResponse"] = None, + greeting: Optional["_models.VoiceGreetingConfig"] = None, ) -> None: ... @overload @@ -14322,30 +23269,36 @@ 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 + self.type: Literal["realtime"] = "realtime" -class TimerRoutineTrigger(RoutineTrigger, discriminator="timer"): - """A one-shot timer routine trigger. +class VoiceAgentStaticInterimResponseConfig( + VoiceAgentInterimResponseConfig, discriminator="static_interim_response" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A static interim response selected from configured text. - :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 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: int + :ivar type: Required. Default value is "static_interim_response". + :vartype type: str + :ivar texts: Candidate text values for the interim response. + :vartype texts: list[str] """ - 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["static_interim_response"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"static_interim_response\".""" + texts: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Candidate text values for the interim response.""" @overload def __init__( self, *, - at: Optional[datetime.datetime] = None, + triggers: Optional[list[Union[str, "_models.VoiceAgentInterimResponseTrigger"]]] = None, + latency_threshold_ms: Optional[int] = None, + texts: Optional[list[str]] = None, ) -> None: ... @overload @@ -14357,36 +23310,52 @@ 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 = "static_interim_response" # type: ignore -class ToolboxObject(_Model): - """A toolbox that stores reusable tool definitions for agents. - - :ivar id: The unique identifier of the toolbox. Required. - :vartype id: str - :ivar name: The name of the toolbox. Required. - :vartype name: str - :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 - """ +class VoiceAgentTranscriptionPhrase(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A transcribed phrase with timing information. - 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.""" - 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.""" + :ivar offset_milliseconds: The phrase offset from the beginning of the audio, in milliseconds. + Required. + :vartype offset_milliseconds: int + :ivar duration_milliseconds: The phrase duration in milliseconds. Required. + :vartype duration_milliseconds: int + :ivar text: The transcribed phrase text. Required. + :vartype text: str + :ivar words: Word-level timing details, when available. + :vartype words: list[~azure.ai.projects.models.VoiceAgentTranscriptionWord] + :ivar locale: The detected locale. + :vartype locale: str + :ivar confidence: The transcription confidence score. + :vartype confidence: float + """ + + offset_milliseconds: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The phrase offset from the beginning of the audio, in milliseconds. Required.""" + duration_milliseconds: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The phrase duration in milliseconds. Required.""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The transcribed phrase text. Required.""" + words: Optional[list["_models.VoiceAgentTranscriptionWord"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Word-level timing details, when available.""" + locale: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The detected locale.""" + confidence: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The transcription confidence score.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - name: str, - default_version: str, + offset_milliseconds: int, + duration_milliseconds: int, + text: str, + words: Optional[list["_models.VoiceAgentTranscriptionWord"]] = None, + locale: Optional[str] = None, + confidence: Optional[float] = None, ) -> None: ... @overload @@ -14400,21 +23369,32 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ToolboxPolicies(_Model): - """Policy configuration for a toolbox, including content safety and other governance settings. +class VoiceAgentTranscriptionWord(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A time-stamped word in an input-audio transcription. - :ivar rai_config: Responsible AI content filtering configuration. - :vartype rai_config: ~azure.ai.projects.models.RaiConfig + :ivar text: The transcribed word text. Required. + :vartype text: str + :ivar offset_milliseconds: The word offset from the beginning of the audio, in milliseconds. + Required. + :vartype offset_milliseconds: int + :ivar duration_milliseconds: The word duration in milliseconds. Required. + :vartype duration_milliseconds: int """ - rai_config: Optional["_models.RaiConfig"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Responsible AI content filtering configuration.""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The transcribed word text. Required.""" + offset_milliseconds: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The word offset from the beginning of the audio, in milliseconds. Required.""" + duration_milliseconds: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The word duration in milliseconds. Required.""" @overload def __init__( self, *, - rai_config: Optional["_models.RaiConfig"] = None, + text: str, + offset_milliseconds: int, + duration_milliseconds: int, ) -> None: ... @overload @@ -14428,32 +23408,42 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ToolboxSearchPreviewToolboxTool(ToolboxTool, discriminator="toolbox_search_preview"): - """A toolbox search tool stored in a toolbox. +class VoiceConversationItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A persisted item in a voice conversation. - :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 + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + VoiceFunctionCallItem, VoiceFunctionCallOutputItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem, VoiceMcpCallItem, VoiceMcpListToolsItem, VoiceMessageItem + + :ivar type: The type of the conversation item. Required. Known values are: "message", + "function_call", "function_call_output", "mcp_list_tools", "mcp_call", "mcp_approval_request", + and "mcp_approval_response". + :vartype type: str or ~azure.ai.projects.models.VoiceConversationItemType + :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 """ - 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.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The type of the conversation item. Required. Known values are: \"message\", \"function_call\", + \"function_call_output\", \"mcp_list_tools\", \"mcp_call\", \"mcp_approval_request\", and + \"mcp_approval_response\".""" + created_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The id of the response that produced this item, when applicable.""" @overload def __init__( self, *, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + type: str, + created_at: Optional[datetime.datetime] = None, + response_id: Optional[str] = None, ) -> None: ... @overload @@ -14465,28 +23455,41 @@ 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 ToolboxSkill(_Model): - """A skill source included in a toolbox. +class VoiceMessageItem( + VoiceConversationItem, discriminator="message" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A persisted message item in a voice conversation. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ToolboxSkillReference + VoiceAssistantMessageItem, VoiceSystemMessageItem, VoiceUserMessageItem - :ivar type: The type of skill source. Required. Default value is None. - :vartype type: 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 type: Required. A message item. + :vartype type: str or ~azure.ai.projects.models.MESSAGE + :ivar role: The role of the message sender. Required. Known values are: "system", "user", and + "assistant". + :vartype role: str or ~azure.ai.projects.models.RealtimeConversationItemMessageType """ __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[VoiceConversationItemType.MESSAGE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. A message item.""" + role: str = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) + """The role of the message sender. Required. Known values are: \"system\", \"user\", and + \"assistant\".""" @overload def __init__( self, *, - type: str, + role: str, + created_at: Optional[datetime.datetime] = None, + response_id: Optional[str] = None, ) -> None: ... @overload @@ -14498,34 +23501,65 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = VoiceConversationItemType.MESSAGE # type: ignore -class ToolboxSkillReference(ToolboxSkill, discriminator="skill_reference"): - """A reference to an existing skill to include in a toolbox. +class VoiceAssistantMessageItem( + VoiceMessageItem, discriminator="assistant" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An assistant message item. Only ``output_text`` and ``output_audio`` content are valid for + assistant messages. - :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 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: Required. A message item. + :vartype type: str or ~azure.ai.projects.models.MESSAGE + :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 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 content: The content of the message. Required. + :vartype content: + list[~azure.ai.projects.models.RealtimeConversationItemMessageAssistantContent] + :ivar role: Required. ASSISTANT. + :vartype role: str or ~azure.ai.projects.models.ASSISTANT """ - 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.""" + __mapping__: dict[str, _Model] = {} + 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\"]""" + content: list["_models.RealtimeConversationItemMessageAssistantContent"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The content of the message. Required.""" + role: Literal[RealtimeConversationItemMessageType.ASSISTANT] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. ASSISTANT.""" @overload def __init__( self, *, - name: str, - version: Optional[str] = None, + content: list["_models.RealtimeConversationItemMessageAssistantContent"], + created_at: Optional[datetime.datetime] = None, + response_id: Optional[str] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + object: Optional[Literal["realtime.item"]] = None, + status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, ) -> None: ... @overload @@ -14537,82 +23571,34 @@ 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.role = RealtimeConversationItemMessageType.ASSISTANT # type: ignore -class ToolboxVersionObject(_Model): - """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 VoiceAudioConfig(_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. - 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 input: Input (microphone) audio configuration. + :vartype input: ~azure.ai.projects.models.VoiceAudioInputConfig + :ivar output: Output (agent speech) audio configuration. + :vartype output: ~azure.ai.projects.models.VoiceAudioOutputConfig """ - 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( + input: Optional["_models.VoiceAudioInputConfig"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The list of skill sources included in this toolbox version.""" - policies: Optional["_models.ToolboxPolicies"] = rest_field( + """Input (microphone) audio configuration.""" + output: Optional["_models.VoiceAudioOutputConfig"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Policy configuration for the toolbox version.""" + """Output (agent speech) audio configuration.""" @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, + input: Optional["_models.VoiceAudioInputConfig"] = None, + output: Optional["_models.VoiceAudioOutputConfig"] = None, ) -> None: ... @overload @@ -14626,54 +23612,35 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ToolChoiceAllowed(ToolChoiceParam, discriminator="allowed_tools"): - """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 VoiceAudioFormat(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An audio format. Follows the OpenAI Realtime session schema; ``type`` carries the media + subtype. - [ - { "type": "function", "name": "get_weather" }, - { "type": "mcp", "server_label": "deepwiki" }, - { "type": "image_generation" } - ] - :vartype tools: list[dict[str, any]] + :ivar type: The audio format type, e.g. 'audio/pcm' (16-bit PCM), 'audio/pcmu' (G.711 mu-law), + or 'audio/pcma' (G.711 A-law). Required. Known values are: "audio/pcm", "audio/pcmu", and + "audio/pcma". + :vartype type: str or ~azure.ai.projects.models.VoiceAudioFormatType + :ivar rate: The sample rate in Hz. Applies to 'audio/pcm' (e.g. 24000); omit for telephony + G.711 formats (8 kHz). + :vartype rate: int """ - 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: Union[str, "_models.VoiceAudioFormatType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The audio format type, e.g. 'audio/pcm' (16-bit PCM), 'audio/pcmu' (G.711 mu-law), or + 'audio/pcma' (G.711 A-law). Required. Known values are: \"audio/pcm\", \"audio/pcmu\", and + \"audio/pcma\".""" + rate: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sample rate in Hz. Applies to 'audio/pcm' (e.g. 24000); omit for telephony G.711 formats (8 + kHz).""" @overload def __init__( self, *, - mode: Literal["auto", "required"], - tools: list[dict[str, Any]], + type: Union[str, "_models.VoiceAudioFormatType"], + rate: Optional[int] = None, ) -> None: ... @overload @@ -14685,23 +23652,66 @@ 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 -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 VoiceAudioInputConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Input audio configuration for a voice agent. - :ivar type: Required. CODE_INTERPRETER. - :vartype type: str or ~azure.ai.projects.models.CODE_INTERPRETER + :ivar format: The input audio format. + :vartype format: ~azure.ai.projects.models.VoiceAudioFormat + :ivar noise_reduction: Input noise reduction. Set to null to disable. + :vartype noise_reduction: ~azure.ai.projects.models.VoiceNoiseReduction + :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. + Is one of the following types: VoiceServerVadTurnDetection, VoiceAgentSemanticVadTurnDetection, + VoiceAzureSemanticVadTurnDetection, VoiceAzureSemanticVadEnTurnDetection, + VoiceAzureSemanticVadMultilingualTurnDetection + :vartype turn_detection: ~azure.ai.projects.models.VoiceServerVadTurnDetection or + ~azure.ai.projects.models.VoiceAgentSemanticVadTurnDetection or + ~azure.ai.projects.models.VoiceAzureSemanticVadTurnDetection or + ~azure.ai.projects.models.VoiceAzureSemanticVadEnTurnDetection or + ~azure.ai.projects.models.VoiceAzureSemanticVadMultilingualTurnDetection + :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.VoiceInputTranscription """ - type: Literal[ToolChoiceParamType.CODE_INTERPRETER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. CODE_INTERPRETER.""" + format: Optional["_models.VoiceAudioFormat"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The input audio format.""" + noise_reduction: Optional["_models.VoiceNoiseReduction"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Input noise reduction. Set to null to disable.""" + turn_detection: Optional["_unions.VoiceAgentTurnDetection"] = 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. Is one of the + following types: VoiceServerVadTurnDetection, VoiceAgentSemanticVadTurnDetection, + VoiceAzureSemanticVadTurnDetection, VoiceAzureSemanticVadEnTurnDetection, + VoiceAzureSemanticVadMultilingualTurnDetection""" + echo_cancellation: Optional["_models.VoiceAgentEchoCancellation"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional server-side echo cancellation settings.""" + transcription: Optional["_models.VoiceInputTranscription"] = 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.VoiceAudioFormat"] = None, + noise_reduction: Optional["_models.VoiceNoiseReduction"] = None, + turn_detection: Optional["_unions.VoiceAgentTurnDetection"] = None, + echo_cancellation: Optional["_models.VoiceAgentEchoCancellation"] = None, + transcription: Optional["_models.VoiceInputTranscription"] = None, ) -> None: ... @overload @@ -14713,23 +23723,142 @@ 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 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 VoiceAudioOutputConfig(_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 type: Required. COMPUTER. - :vartype type: str or ~azure.ai.projects.models.COMPUTER + * `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.VoiceAudioFormat + :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``. The + string is extensible so future values do not require SDK type changes. + :vartype voice_type: str + :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.VoiceAudioTimestampType] """ - type: Literal[ToolChoiceParamType.COMPUTER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. COMPUTER.""" + format: Optional["_models.VoiceAudioFormat"] = 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[str] = 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``. The string is + extensible so future values do not require SDK type changes.""" + 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.VoiceAudioTimestampType"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Timestamp kinds to include with output audio. Applies to every ``voice_type``.""" @overload def __init__( self, + *, + format: Optional["_models.VoiceAudioFormat"] = None, + voice: Optional[str] = None, + voice_type: Optional[str] = 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.VoiceAudioTimestampType"]]] = None, ) -> None: ... @overload @@ -14741,23 +23870,85 @@ 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 `_. - :ivar type: Required. COMPUTER_USE. - :vartype type: str or ~azure.ai.projects.models.COMPUTER_USE - """ +class VoiceAzureSemanticVadEnTurnDetection( + VoiceTurnDetection, discriminator="azure_semantic_vad_en" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """English-optimized Azure semantic voice activity detection. - type: Literal[ToolChoiceParamType.COMPUTER_USE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. COMPUTER_USE.""" + :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.VoiceEndOfUtteranceDetection + :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[VoiceTurnDetectionType.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.VoiceEndOfUtteranceDetection"] = 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.VoiceEndOfUtteranceDetection"] = 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 @@ -14769,23 +23960,91 @@ 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 = VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN # 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 `_. - :ivar type: Required. COMPUTER_USE_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.COMPUTER_USE_PREVIEW - """ +class VoiceAzureSemanticVadMultilingualTurnDetection( + VoiceTurnDetection, discriminator="azure_semantic_vad_multilingual" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Multilingual Azure semantic voice activity detection. - type: Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. COMPUTER_USE_PREVIEW.""" + :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.VoiceEndOfUtteranceDetection + :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[VoiceTurnDetectionType.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.VoiceEndOfUtteranceDetection"] = 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.VoiceEndOfUtteranceDetection"] = 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 @@ -14797,28 +24056,91 @@ 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 - + self.type = VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL # type: ignore -class ToolChoiceCustom(ToolChoiceParam, discriminator="custom"): - """Custom tool. - :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 - """ +class VoiceAzureSemanticVadTurnDetection( + VoiceTurnDetection, discriminator="azure_semantic_vad" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Azure semantic voice activity detection. - 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.""" + :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.VoiceEndOfUtteranceDetection + :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[VoiceTurnDetectionType.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.VoiceEndOfUtteranceDetection"] = 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, *, - name: str, + 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.VoiceEndOfUtteranceDetection"] = 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 @@ -14830,23 +24152,84 @@ 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 = VoiceTurnDetectionType.AZURE_SEMANTIC_VAD # 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 VoiceConversation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A persisted voice conversation. The Foundry envelope that owns a voice agent's stored + transcript, responses, per-turn metrics, and audio. It is the parent, retention, and delete + boundary: deleting it cascades to its responses, items, metrics, and audio. When finalization + fails, any partial persisted responses, items, and item audio remain readable. - :ivar type: Required. FILE_SEARCH. - :vartype type: str or ~azure.ai.projects.models.FILE_SEARCH + :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 usage: Final aggregate token usage across all responses in this conversation. Absent + while ``status`` is ``in_progress`` and populated after successful ``completed`` finalization; + it may be absent when ``status`` is ``failed``, and values are not guaranteed to be reported + incrementally. + :vartype usage: ~azure.ai.projects.models.RealtimeResponseUsage + :ivar last_error: The terminal error that prevented persistence finalization. Present only when + ``status`` is ``failed``. + :vartype last_error: ~azure.ai.projects.models.ApiError """ - type: Literal[ToolChoiceParamType.FILE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. FILE_SEARCH.""" + 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.""" + usage: Optional["_models.RealtimeResponseUsage"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Final aggregate token usage across all responses in this conversation. Absent while ``status`` + is ``in_progress`` and populated after successful ``completed`` finalization; it may be absent + when ``status`` is ``failed``, and values are not guaranteed to be reported incrementally.""" + 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``.""" @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, + usage: Optional["_models.RealtimeResponseUsage"] = None, + last_error: Optional["_models.ApiError"] = None, ) -> None: ... @overload @@ -14858,28 +24241,45 @@ 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.object: Literal["voice.conversation"] = "voice.conversation" -class ToolChoiceFunction(ToolChoiceParam, discriminator="function"): - """Function tool. +class VoiceEndOfUtteranceDetection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Semantic end-of-utterance detection configuration. - :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 + :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.VoiceEndOfUtteranceDetectionModel + :ivar threshold_level: The sensitivity threshold. Known values are: "low", "medium", "high", + and "default". + :vartype threshold_level: str or ~azure.ai.projects.models.VoiceEndOfUtteranceThresholdLevel + :ivar timeout_ms: The detection timeout in milliseconds. + :vartype timeout_ms: ~datetime.timedelta """ - 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.""" + model: Union[str, "_models.VoiceEndOfUtteranceDetectionModel"] = 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.VoiceEndOfUtteranceThresholdLevel"]] = 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, *, - name: str, + model: Union[str, "_models.VoiceEndOfUtteranceDetectionModel"], + threshold_level: Optional[Union[str, "_models.VoiceEndOfUtteranceThresholdLevel"]] = None, + timeout_ms: Optional[datetime.timedelta] = None, ) -> None: ... @overload @@ -14891,23 +24291,69 @@ 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 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: Required. IMAGE_GENERATION. - :vartype type: str or ~azure.ai.projects.models.IMAGE_GENERATION - """ +class VoiceFunctionCallItem( + VoiceConversationItem, discriminator="function_call" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A function call request item. - type: Literal[ToolChoiceParamType.IMAGE_GENERATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. IMAGE_GENERATION.""" + :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 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 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 type: Required. A function-call request item. + :vartype type: str or ~azure.ai.projects.models.FUNCTION_CALL + """ + + 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\"]""" + 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.""" + type: Literal[VoiceConversationItemType.FUNCTION_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. A function-call request item.""" @overload def __init__( self, + *, + name: str, + arguments: str, + created_at: Optional[datetime.datetime] = None, + response_id: Optional[str] = None, + 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 @@ -14919,31 +24365,71 @@ 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 = VoiceConversationItemType.FUNCTION_CALL # type: ignore -class ToolChoiceMCP(ToolChoiceParam, discriminator="mcp"): - """MCP tool. +class VoiceFunctionCallOutputItem( + VoiceConversationItem, discriminator="function_call_output" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A function call output item. - :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 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 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 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 type: Required. A function-call output item. + :vartype type: str or ~azure.ai.projects.models.FUNCTION_CALL_OUTPUT + :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: 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.""" + 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\"]""" + 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.""" + type: Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. A function-call output item.""" 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, *, - server_label: str, + call_id: str, + output: str, + created_at: Optional[datetime.datetime] = None, + response_id: Optional[str] = None, + 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: ... @@ -14956,23 +24442,78 @@ 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 = VoiceConversationItemType.FUNCTION_CALL_OUTPUT # 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 - """ +class VoiceInputTranscription(_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. - type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. WEB_SEARCH_PREVIEW.""" + :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 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 to use. 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.VoiceInputTranscriptionModel + :ivar custom_speech: Optional custom speech model 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] + """ + + 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.""" + 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.VoiceInputTranscriptionModel"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The transcription model to use. 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 custom speech model 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, + *, + model: Union[str, "_models.VoiceInputTranscriptionModel"], + language: Optional[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 @@ -14984,23 +24525,87 @@ 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 -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 VoiceItemAudioResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Metadata for a single conversation item's audio segment. For bring-your-own-storage (BYOS), the + response includes ``blob_uri``, a direct customer-storage URI without a SAS token, that the + customer accesses with their own credentials. For Foundry-managed storage, ``blob_uri`` is + absent and the bytes are streamed through the item's ``/audio/content`` route. - :ivar type: Required. WEB_SEARCH_PREVIEW_2025_03_11. - :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_PREVIEW_2025_03_11 + :ivar conversation_id: The id of the conversation the item belongs to. Required. + :vartype conversation_id: str + :ivar item_id: The id of the item this audio belongs to. Required. + :vartype item_id: str + :ivar role: The role the audio belongs to. Known values are: "user" and "agent". + :vartype role: str or ~azure.ai.projects.models.VoiceAudioRole + :ivar format: The container format of the audio. "wav" + :vartype format: str or ~azure.ai.projects.models.VoiceAudioContainerFormat + :ivar codec: The audio codec. Known values are: "pcm16", "pcmu", and "pcma". + :vartype codec: str or ~azure.ai.projects.models.VoiceAudioCodec + :ivar sample_rate: The sample rate in Hz. + :vartype sample_rate: int + :ivar channels: The number of audio channels. + :vartype channels: int + :ivar start_offset_ms: The offset from the session start at which this segment begins. + :vartype start_offset_ms: ~datetime.timedelta + :ivar duration_ms: The duration of the audio segment. + :vartype duration_ms: ~datetime.timedelta + :ivar blob_uri: For bring-your-own-storage (BYOS) recordings only: the URI of the recording in + the customer's own storage, without a SAS token. The customer downloads it using their own + storage credentials. Absent for Foundry-managed storage, where the bytes are streamed via the + item's ``/audio/content`` route instead. + :vartype blob_uri: str """ - 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.""" + conversation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The id of the conversation the item belongs to. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The id of the item this audio belongs to. Required.""" + role: Optional[Union[str, "_models.VoiceAudioRole"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The role the audio belongs to. Known values are: \"user\" and \"agent\".""" + format: Optional[Union[str, "_models.VoiceAudioContainerFormat"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The container format of the audio. \"wav\"""" + codec: Optional[Union[str, "_models.VoiceAudioCodec"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The audio codec. Known values are: \"pcm16\", \"pcmu\", and \"pcma\".""" + sample_rate: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sample rate in Hz.""" + channels: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of audio channels.""" + start_offset_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """The offset from the session start at which this segment begins.""" + duration_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """The duration of the audio segment.""" + blob_uri: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """For bring-your-own-storage (BYOS) recordings only: the URI of the recording in the customer's + own storage, without a SAS token. The customer downloads it using their own storage + credentials. Absent for Foundry-managed storage, where the bytes are streamed via the item's + ``/audio/content`` route instead.""" @overload def __init__( self, + *, + conversation_id: str, + item_id: str, + role: Optional[Union[str, "_models.VoiceAudioRole"]] = None, + format: Optional[Union[str, "_models.VoiceAudioContainerFormat"]] = None, + codec: Optional[Union[str, "_models.VoiceAudioCodec"]] = None, + sample_rate: Optional[int] = None, + channels: Optional[int] = None, + start_offset_ms: Optional[datetime.timedelta] = None, + duration_ms: Optional[datetime.timedelta] = None, + blob_uri: Optional[str] = None, ) -> None: ... @overload @@ -15012,35 +24617,50 @@ 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 ToolConfig(_Model): - """Per-tool configuration that controls tool visibility and search behavior. +class VoiceMcpApprovalRequestItem( + VoiceConversationItem, discriminator="mcp_approval_request" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An MCP approval request item. - :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 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 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 type: Required. An MCP approval request item. + :vartype type: str or ~azure.ai.projects.models.MCP_APPROVAL_REQUEST """ - 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.""" + 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.""" + type: Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. An MCP approval request item.""" @overload def __init__( self, *, - pin: Optional[bool] = None, - additional_search_text: Optional[str] = None, + id: str, # pylint: disable=redefined-builtin + server_label: str, + name: str, + arguments: str, + created_at: Optional[datetime.datetime] = None, + response_id: Optional[str] = None, ) -> None: ... @overload @@ -15052,28 +24672,50 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = VoiceConversationItemType.MCP_APPROVAL_REQUEST # type: ignore -class ToolDescription(_Model): - """Description of a tool that can be used by an agent. +class VoiceMcpApprovalResponseItem( + VoiceConversationItem, discriminator="mcp_approval_response" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An MCP approval response item (client-created). - :ivar name: The name of the tool. - :vartype name: str - :ivar description: A brief description of the tool's purpose. - :vartype description: 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 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 type: Required. An MCP approval response item. + :vartype type: str or ~azure.ai.projects.models.MCP_APPROVAL_RESPONSE """ - 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.""" + 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"]) + type: Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. An MCP approval response item.""" @overload def __init__( self, *, - name: Optional[str] = None, - description: Optional[str] = None, + id: str, # pylint: disable=redefined-builtin + approval_request_id: str, + approve: bool, + created_at: Optional[datetime.datetime] = None, + response_id: Optional[str] = None, + reason: Optional[str] = None, ) -> None: ... @overload @@ -15085,24 +24727,63 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = VoiceConversationItemType.MCP_APPROVAL_RESPONSE # type: ignore -class ToolProjectConnection(_Model): - """A project connection resource. +class VoiceMcpCallItem( + VoiceConversationItem, discriminator="mcp_call" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An MCP call item. - :ivar project_connection_id: A project connection in a ToolProjectConnectionList attached to - this tool. Required. - :vartype project_connection_id: 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 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 type: Required. An MCP call item. + :vartype type: str or ~azure.ai.projects.models.MCP_CALL """ - project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A project connection in a ToolProjectConnectionList attached to this tool. Required.""" + 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"]) + type: Literal[VoiceConversationItemType.MCP_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. An MCP call item.""" @overload def __init__( self, *, - project_connection_id: str, + id: str, # pylint: disable=redefined-builtin + server_label: str, + name: str, + arguments: str, + created_at: Optional[datetime.datetime] = None, + response_id: Optional[str] = None, + approval_request_id: Optional[str] = None, + output: Optional[str] = None, + error: Optional["_models.RealtimeMCPError"] = None, ) -> None: ... @overload @@ -15114,33 +24795,46 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = VoiceConversationItemType.MCP_CALL # type: ignore -class ToolSearchToolboxTool(ToolboxTool, discriminator="toolbox_search"): - """A toolbox search tool stored in a toolbox. +class VoiceMcpListToolsItem( + VoiceConversationItem, discriminator="mcp_list_tools" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An MCP list-tools item. - :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 + :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 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 type: Required. An MCP list-tools item. + :vartype type: str or ~azure.ai.projects.models.MCP_LIST_TOOLS """ - 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.""" + 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.""" + type: Literal[VoiceConversationItemType.MCP_LIST_TOOLS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. An MCP list-tools item.""" @overload def __init__( self, *, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + server_label: str, + tools: list["_models.MCPListToolsTool"], + created_at: Optional[datetime.datetime] = None, + response_id: Optional[str] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin ) -> None: ... @overload @@ -15152,42 +24846,28 @@ 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 = VoiceConversationItemType.MCP_LIST_TOOLS # type: ignore -class ToolSearchToolParam(Tool, discriminator="tool_search"): - """Tool search tool. +class VoiceNoiseReduction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Input audio noise reduction configuration. - :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 noise reduction mode. Required. Known values are: "near_field", "far_field", + and "azure_deep_noise_suppression". + :vartype type: str or ~azure.ai.projects.models.VoiceNoiseReductionType """ - 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: Union[str, "_models.VoiceNoiseReductionType"] = 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\".""" @overload def __init__( self, *, - execution: Optional[Union[str, "_models.ToolSearchExecutionType"]] = None, - description: Optional[str] = None, - parameters: Optional["_models.EmptyModelParam"] = None, + type: Union[str, "_models.VoiceNoiseReductionType"], ) -> None: ... @overload @@ -15199,77 +24879,94 @@ 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 - - -class ToolUseFineTuningDataGenerationJobOptions( - DataGenerationJobOptions, discriminator="tool_use" -): # pylint: disable=name-too-long - """The options for a data generation job with ToolUse type. Used only for fine-tuning scenarios. - - :ivar max_samples: Maximum number of samples to generate. Required. - :vartype max_samples: int - :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 - """ - - 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.""" - - @overload - def __init__( - self, - *, - max_samples: int, - 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] - """ + + +class VoiceRecordingChannelLayout(_Model): # pylint: disable=docstring-missing-param + """The role assigned to each channel of a merged stereo voice recording. + + :ivar left: The role carried on the left channel. Always ``user``. Required. Default value is + "user". + :vartype left: str + :ivar right: The role carried on the right channel. Always ``agent``. Required. Default value + is "agent". + :vartype right: str + """ + + left: Literal["user"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The role carried on the left channel. Always ``user``. Required. Default value is \"user\".""" + right: Literal["agent"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The role carried on the right channel. Always ``agent``. Required. Default value is \"agent\".""" def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DataGenerationJobType.TOOL_USE # type: ignore + self.left: Literal["user"] = "user" + self.right: Literal["agent"] = "agent" -class TracesDataGenerationJobOptions(DataGenerationJobOptions, discriminator="traces"): - """The options for a data generation job with Traces type. +class VoiceRecordingResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Metadata for the merged, whole-call stereo recording of a voice conversation (user audio on the + left channel, agent audio on the right). Built once from the per-turn segments after the + session ends and durably cached. The common metadata (format, sample rate, channels, channel + layout, duration) is returned for both Foundry-managed and bring-your-own-storage (BYOS) + recordings. For BYOS the response also includes ``blob_uri``, the URI of the recording in the + customer's own storage (no SAS token), which the customer downloads using their own storage + credentials. For Foundry-managed storage ``blob_uri`` is absent and the bytes are streamed via + the ``/audio/content`` route instead. - :ivar max_samples: Maximum number of samples to generate. Required. - :vartype max_samples: int - :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 conversation_id: The id of the conversation this recording belongs to. Required. + :vartype conversation_id: str + :ivar format: The container format of the recording. Required. "wav" + :vartype format: str or ~azure.ai.projects.models.VoiceAudioContainerFormat + :ivar sample_rate: The sample rate of the recording in Hz, e.g. 24000. Required. + :vartype sample_rate: int + :ivar channels: The number of audio channels. The merged recording is stereo (``2``). Required. + :vartype channels: int + :ivar channel_layout: The role assigned to each stereo channel. Required. + :vartype channel_layout: ~azure.ai.projects.models.VoiceRecordingChannelLayout + :ivar duration_ms: The total duration of the recording. Required. + :vartype duration_ms: ~datetime.timedelta + :ivar blob_uri: For bring-your-own-storage (BYOS) recordings only: the URI of the recording in + the customer's own storage, without a SAS token. The customer downloads it using their own + storage credentials. Absent for Foundry-managed storage, where the bytes are streamed via the + ``/audio/content`` route instead. + :vartype blob_uri: 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.""" + conversation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The id of the conversation this recording belongs to. Required.""" + format: Union[str, "_models.VoiceAudioContainerFormat"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The container format of the recording. Required. \"wav\"""" + sample_rate: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sample rate of the recording in Hz, e.g. 24000. Required.""" + channels: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of audio channels. The merged recording is stereo (``2``). Required.""" + channel_layout: "_models.VoiceRecordingChannelLayout" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The role assigned to each stereo channel. Required.""" + duration_ms: datetime.timedelta = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """The total duration of the recording. Required.""" + blob_uri: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """For bring-your-own-storage (BYOS) recordings only: the URI of the recording in the customer's + own storage, without a SAS token. The customer downloads it using their own storage + credentials. Absent for Foundry-managed storage, where the bytes are streamed via the + ``/audio/content`` route instead.""" @overload def __init__( self, *, - max_samples: int, - train_split: Optional[float] = None, - model_options: Optional["_models.DataGenerationModelOptions"] = None, + conversation_id: str, + format: Union[str, "_models.VoiceAudioContainerFormat"], + sample_rate: int, + channels: int, + channel_layout: "_models.VoiceRecordingChannelLayout", + duration_ms: datetime.timedelta, + blob_uri: Optional[str] = None, ) -> None: ... @overload @@ -15281,66 +24978,105 @@ 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 -class TracesDataGenerationJobSource(DataGenerationJobSource, discriminator="traces"): - """Traces source for data generation jobs — conversation traces from Application Insights. +class VoiceResponse(OmitPropertiesRealtimeResponse): # pylint: disable=docstring-keyword-should-match-keyword-only + """A persisted voice response representing one model inference turn within a conversation. In list + results the ``output`` projection may be omitted; retrieve the full response (``GET + .../responses/{response_id}``) or the paged response-items route (``GET + .../responses/{response_id}/items``) for its output items. ``created_at``/``completed_at`` are + Foundry durable ordering extensions. - :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 object: The object type, must be ``realtime.response``. Default value is + "realtime.response". + :vartype object: str + :ivar status: The final status of the response (``completed``, ``cancelled``, ``failed``, or + ``incomplete``, ``in_progress``). Is one of the following types: Literal["completed"], + Literal["cancelled"], Literal["failed"], Literal["incomplete"], Literal["in_progress"] + :vartype status: str or str or str or str or str + :ivar status_details: Additional details about the status. + :vartype status_details: ~azure.ai.projects.models.RealtimeResponseStatusDetails + :ivar usage: Usage statistics for the Response, this will correspond to billing. A Realtime API + session will maintain a conversation context and append new Items to the Conversation, thus + output from previous turns (text and audio tokens) will become the input for later turns. + :vartype usage: ~azure.ai.projects.models.RealtimeResponseUsage + :ivar output_modalities: The set of modalities the model used to respond, currently the only + possible values are ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text + transcript. Setting the output to mode ``text`` will disable audio output from the model. + :vartype output_modalities: list[str or str] + :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, + inclusive of tool calls, that was used in this response. Is either a int type or a + Literal["inf"] type. + :vartype max_output_tokens: int or str + :ivar id: The unique id of the response. Required. + :vartype id: str + :ivar output: The output items produced by the response. May be omitted in list results; + retrieve the full response (GET .../responses/{response_id}) or use the paged response-items + route (GET .../responses/{response_id}/items) for its output items. Each item's ``response_id`` + also links it back to this response in the conversation-level items list. + :vartype output: list[~azure.ai.projects.models.VoiceConversationItem] + :ivar conversation_id: The id of the conversation this response belongs to. Required. + :vartype conversation_id: str + :ivar audio: The audio configuration used for the response, including the voice and audio + format used for output. + :vartype audio: ~azure.ai.projects.models.VoiceResponseAudio + :ivar metadata: A set of key-value pairs attached to the response. + :vartype metadata: dict[str, str] + :ivar temperature: The sampling temperature used for the response. + :vartype temperature: float + :ivar created_at: The Unix timestamp (in seconds) for when the response was created. + :vartype created_at: ~datetime.datetime + :ivar completed_at: The Unix timestamp (in seconds) for when the response completed. + :vartype completed_at: ~datetime.datetime """ - 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( + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique id of the response. Required.""" + output: Optional[list["_models.VoiceConversationItem"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The output items produced by the response. May be omitted in list results; retrieve the full + response (GET .../responses/{response_id}) or use the paged response-items route (GET + .../responses/{response_id}/items) for its output items. Each item's ``response_id`` also links + it back to this response in the conversation-level items list.""" + conversation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The id of the conversation this response belongs to. Required.""" + audio: Optional["_models.VoiceResponseAudio"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The audio configuration used for the response, including the voice and audio format used for + output.""" + metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A set of key-value pairs attached to the response.""" + temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sampling temperature used for the response.""" + created_at: Optional[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( + """The Unix timestamp (in seconds) for when the response was created.""" + completed_at: 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.""" + """The Unix timestamp (in seconds) for when the response completed.""" @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, + id: str, # pylint: disable=redefined-builtin + conversation_id: str, + object: Optional[Literal["realtime.response"]] = None, + status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] = None, + status_details: Optional["_models.RealtimeResponseStatusDetails"] = None, + usage: Optional["_models.RealtimeResponseUsage"] = None, + output_modalities: Optional[list[Literal["text", "audio"]]] = None, + max_output_tokens: Optional[Union[int, Literal["inf"]]] = None, + output: Optional[list["_models.VoiceConversationItem"]] = None, + audio: Optional["_models.VoiceResponseAudio"] = None, + metadata: Optional[dict[str, str]] = None, + temperature: Optional[float] = None, + created_at: Optional[datetime.datetime] = None, + completed_at: Optional[datetime.datetime] = None, ) -> None: ... @overload @@ -15352,69 +25088,25 @@ 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"): - """Traces source for evaluator generation jobs — conversation traces from Application Insights. +class VoiceResponseAudio(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Audio configuration for a response. Follows the OpenAI Realtime GA ``audio`` object shape. - :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 output: The audio output configuration used for the response. + :vartype output: ~azure.ai.projects.models.VoiceResponseAudioOutput """ - 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" + output: Optional["_models.VoiceResponseAudioOutput"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """End of the time window (Unix timestamp in seconds). Defaults to current time.""" + """The audio output configuration used for the response.""" @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, + output: Optional["_models.VoiceResponseAudioOutput"] = None, ) -> None: ... @overload @@ -15426,29 +25118,42 @@ 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 UpdateModelVersionRequest(_Model): - """Request body for updating a model version. Only description and tags can be modified. +class VoiceResponseAudioOutput(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The flat response audio-output projection, with optional ``voice``, ``voice_type``, + ``voice_locale``, and ``format`` fields. - :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 voice: The voice name used for the response's audio output. + :vartype voice: str + :ivar voice_type: The extensible provider/type of the voice used for the response's audio + output. + :vartype voice_type: str + :ivar voice_locale: The BCP-47 locale of the voice used for the response's audio output. + :vartype voice_locale: str + :ivar format: The audio format used for the response's audio output. + :vartype format: ~azure.ai.projects.models.RealtimeAudioFormats """ - 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.""" + voice: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The voice name used for the response's audio output.""" + voice_type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The extensible provider/type of the voice used for the response's audio output.""" + voice_locale: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The BCP-47 locale of the voice used for the response's audio output.""" + format: Optional["_models.RealtimeAudioFormats"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The audio format used for the response's audio output.""" @overload def __init__( self, *, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, + voice: Optional[str] = None, + voice_type: Optional[str] = None, + voice_locale: Optional[str] = None, + format: Optional["_models.RealtimeAudioFormats"] = None, ) -> None: ... @overload @@ -15462,23 +25167,64 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class UpdateToolboxRequest(_Model): - """UpdateToolboxRequest. +class VoiceServerVadTurnDetection( + VoiceTurnDetection, discriminator="server_vad" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Server-side voice activity detection. - :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 auto_truncate: Whether the input audio buffer is truncated automatically when speech + stops. + :vartype auto_truncate: bool + :ivar threshold: + :vartype threshold: float + :ivar prefix_padding_ms: + :vartype prefix_padding_ms: int + :ivar silence_duration_ms: + :vartype silence_duration_ms: int + :ivar create_response: + :vartype create_response: bool + :ivar interrupt_response: + :vartype interrupt_response: bool + :ivar idle_timeout_ms: + :vartype idle_timeout_ms: int + :ivar type: Required. Server-side voice activity detection. + :vartype type: str or ~azure.ai.projects.models.SERVER_VAD + :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in + milliseconds. + :vartype speech_duration_ms: int + :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.VoiceEndOfUtteranceDetection """ - 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.""" + threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + prefix_padding_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + silence_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + create_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + interrupt_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + idle_timeout_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[VoiceTurnDetectionType.SERVER_VAD] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Server-side voice activity detection.""" + speech_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Minimum speech duration required to trigger detection, in milliseconds.""" + end_of_utterance_detection: Optional["_models.VoiceEndOfUtteranceDetection"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Semantic end-of-utterance detection configuration. Set to null to disable it.""" @overload def __init__( self, *, - default_version: str, + auto_truncate: Optional[bool] = None, + threshold: Optional[float] = None, + prefix_padding_ms: Optional[int] = None, + silence_duration_ms: Optional[int] = None, + create_response: Optional[bool] = None, + interrupt_response: Optional[bool] = None, + idle_timeout_ms: Optional[int] = None, + speech_duration_ms: Optional[int] = None, + end_of_utterance_detection: Optional["_models.VoiceEndOfUtteranceDetection"] = None, ) -> None: ... @overload @@ -15490,37 +25236,63 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = VoiceTurnDetectionType.SERVER_VAD # type: ignore -class UserProfileMemoryItem(MemoryItem, discriminator="user_profile"): - """A memory item specifically containing user profile information extracted from conversations, - such as preferences, interests, and personal details. +class VoiceSystemMessageItem( + VoiceMessageItem, discriminator="system" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A system message item. Only ``input_text`` content is valid for system messages. - :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 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: Required. A message item. + :vartype type: str or ~azure.ai.projects.models.MESSAGE + :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 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 content: The content of the message. Required. + :vartype content: list[~azure.ai.projects.models.RealtimeConversationItemMessageSystemContent] + :ivar role: Required. SYSTEM. + :vartype role: str or ~azure.ai.projects.models.SYSTEM """ - 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.""" + __mapping__: dict[str, _Model] = {} + 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\"]""" + content: list["_models.RealtimeConversationItemMessageSystemContent"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The content of the message. Required.""" + role: Literal[RealtimeConversationItemMessageType.SYSTEM] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. SYSTEM.""" @overload def __init__( self, *, - memory_id: str, - updated_at: datetime.datetime, - scope: str, - content: str, + content: list["_models.RealtimeConversationItemMessageSystemContent"], + created_at: Optional[datetime.datetime] = None, + response_id: Optional[str] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + object: Optional[Literal["realtime.item"]] = None, + status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, ) -> None: ... @overload @@ -15532,28 +25304,40 @@ 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 + self.role = RealtimeConversationItemMessageType.SYSTEM # type: ignore -class VersionIndicator(_Model): - """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 VoiceSystemTool( + 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. - :ivar type: The type of version indicator. Required. "version_ref" - :vartype type: str or ~azure.ai.projects.models.VersionIndicatorType + :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.VoiceSystemToolName + :ivar description: An optional description of the system tool. + :vartype description: str """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of version indicator. Required. \"version_ref\"""" + 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: Union[str, "_models.VoiceSystemToolName"] = rest_field( + 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, *, - type: str, + name: Union[str, "_models.VoiceSystemToolName"], + description: Optional[str] = None, ) -> None: ... @overload @@ -15565,28 +25349,45 @@ 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 VersionRefIndicator(VersionIndicator, discriminator="version_ref"): - """Version indicator that references a specific agent version by name. - - :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 - """ +class VoiceToolboxTool( + VoiceAgentTool, discriminator="toolbox" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A reference to a Foundry toolbox, which is a versioned bundle of tools executed through its MCP + endpoint. - 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.""" + :ivar type: The type of the tool. Always ``toolbox``. Required. Default value is "toolbox". + :vartype type: str + :ivar toolbox_name: The name of the toolbox to attach. Required. + :vartype toolbox_name: str + :ivar toolbox_version: The immutable version of the toolbox to attach. Required. + :vartype toolbox_version: str + :ivar response_scheduling: When the toolbox invocation creates a follow-up response. Defaults + to ``when_idle``. Known values are: "silent", "when_idle", "interrupt", and "skip_if_busy". + :vartype response_scheduling: str or ~azure.ai.projects.models.VoiceAgentToolResponseScheduling + """ + + type: Literal["toolbox"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the tool. Always ``toolbox``. Required. Default value is \"toolbox\".""" + toolbox_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the toolbox to attach. Required.""" + toolbox_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The immutable version of the toolbox to attach. Required.""" + response_scheduling: Optional[Union[str, "_models.VoiceAgentToolResponseScheduling"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """When the toolbox invocation creates a follow-up response. Defaults to ``when_idle``. Known + values are: \"silent\", \"when_idle\", \"interrupt\", and \"skip_if_busy\".""" @overload def __init__( self, *, - agent_version: str, + toolbox_name: str, + toolbox_version: str, + response_scheduling: Optional[Union[str, "_models.VoiceAgentToolResponseScheduling"]] = None, ) -> None: ... @overload @@ -15598,26 +25399,64 @@ 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 + self.type = "toolbox" # type: ignore -class VersionSelector(_Model): - """VersionSelector. +class VoiceUserMessageItem( + VoiceMessageItem, discriminator="user" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A user message item. ``input_text``, ``input_audio``, and ``input_image`` content are valid for + user messages. - :ivar version_selection_rules: Required. - :vartype version_selection_rules: list[~azure.ai.projects.models.VersionSelectionRule] + :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: Required. A message item. + :vartype type: str or ~azure.ai.projects.models.MESSAGE + :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 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 content: The content of the message. Required. + :vartype content: list[~azure.ai.projects.models.RealtimeConversationItemMessageUserContent] + :ivar role: Required. USER. + :vartype role: str or ~azure.ai.projects.models.USER """ - version_selection_rules: list["_models.VersionSelectionRule"] = rest_field( + __mapping__: dict[str, _Model] = {} + 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"] ) - """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\"]""" + content: list["_models.RealtimeConversationItemMessageUserContent"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The content of the message. Required.""" + role: Literal[RealtimeConversationItemMessageType.USER] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. USER.""" @overload def __init__( self, *, - version_selection_rules: list["_models.VersionSelectionRule"], + content: list["_models.RealtimeConversationItemMessageUserContent"], + created_at: Optional[datetime.datetime] = None, + response_id: Optional[str] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + object: Optional[Literal["realtime.item"]] = None, + status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, ) -> None: ... @overload @@ -15629,9 +25468,10 @@ 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 -class WebSearchApproximateLocation(_Model): +class WebSearchApproximateLocation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Web search approximate location. :ivar type: The type of location approximation. Always ``approximate``. Required. Default value @@ -15677,7 +25517,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["approximate"] = "approximate" -class WebSearchConfiguration(_Model): +class WebSearchConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A web search configuration for bing custom search. :ivar project_connection_id: Project connection id for grounding with bing custom search. @@ -15711,7 +25551,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class WebSearchPreviewTool(Tool, discriminator="web_search_preview"): +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 @@ -15764,7 +25606,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.WEB_SEARCH_PREVIEW # type: ignore -class WebSearchTool(Tool, discriminator="web_search"): +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 @@ -15845,7 +25687,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.WEB_SEARCH # type: ignore -class WebSearchToolboxTool(ToolboxTool, discriminator="web_search"): +class WebSearchToolboxTool( + ToolboxTool, discriminator="web_search" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A web search tool stored in a toolbox. :ivar name: Optional user-defined name for this tool or configuration. @@ -15916,7 +25760,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolboxToolType.WEB_SEARCH # type: ignore -class WebSearchToolFilters(_Model): +class WebSearchToolFilters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """WebSearchToolFilters. :ivar allowed_domains: @@ -15943,7 +25787,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class WeeklyRecurrenceSchedule(RecurrenceSchedule, discriminator="Weekly"): +class WeeklyRecurrenceSchedule( + RecurrenceSchedule, discriminator="Weekly" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Weekly recurrence schedule. :ivar type: Weekly recurrence type. Required. Weekly recurrence pattern. @@ -15978,7 +25824,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RecurrenceType.WEEKLY # type: ignore -class WorkflowAgentDefinition(AgentDefinition, discriminator="workflow"): +class WorkflowAgentDefinition( + AgentDefinition, discriminator="workflow" +): # pylint: disable=docstring-keyword-should-match-keyword-only """The workflow agent definition. :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. @@ -16014,7 +25862,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = AgentKind.WORKFLOW # type: ignore -class WorkIQPreviewTool(Tool, discriminator="work_iq_preview"): +class WorkIQPreviewTool( + Tool, discriminator="work_iq_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A WorkIQ server-side tool. :ivar type: The object type, which is always 'work_iq_preview'. Required. WORK_IQ_PREVIEW. @@ -16047,7 +25897,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.WORK_IQ_PREVIEW # type: ignore -class WorkIQPreviewToolboxTool(ToolboxTool, discriminator="work_iq_preview"): +class WorkIQPreviewToolboxTool( + ToolboxTool, discriminator="work_iq_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A WorkIQ tool stored in a toolbox. :ivar name: Optional user-defined name for this tool or configuration. 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 257e53dded78..d5171a4789be 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 @@ -50,6 +50,7 @@ _AgentDefinitionOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW.value, _AgentDefinitionOptInKeys.EXTERNAL_AGENTS_V1_PREVIEW.value, _AgentDefinitionOptInKeys.DRAFT_AGENTS_V1_PREVIEW.value, + _AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.value, _FoundryFeaturesOptInKeys.AGENTS_OPTIMIZATION_V2_PREVIEW.value, ] ) diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/__init__.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/__init__.py index d6cf67b4d8cf..fb5ec672ba20 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/__init__.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/__init__.py @@ -14,6 +14,8 @@ from ._operations import BetaOperations # type: ignore from ._operations import AgentsOperations # type: ignore +from ._operations import VoiceAgentWebSocketOperations # type: ignore +from ._operations import AgentEndpointConversationsOperations # type: ignore from ._operations import EvaluationRulesOperations # type: ignore from ._operations import ConnectionsOperations # type: ignore from ._operations import DatasetsOperations # type: ignore @@ -28,6 +30,8 @@ __all__ = [ "BetaOperations", "AgentsOperations", + "VoiceAgentWebSocketOperations", + "AgentEndpointConversationsOperations", "EvaluationRulesOperations", "ConnectionsOperations", "DatasetsOperations", 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 7013e5925454..67bad4f5bbe3 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -33,7 +33,7 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from .. import models as _models +from .. import models as _models, types as _types from .._configuration import AIProjectClientConfiguration from .._utils.model_base import Model as _Model, SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._utils.serialization import Deserializer, Serializer @@ -73,6 +73,28 @@ def build_agents_get_request(agent_name: str, **kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_agents_generate_agent_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/agents:generate" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + def build_agents_delete_request(agent_name: str, *, force: Optional[bool] = None, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -571,7 +593,7 @@ def build_agents_upload_session_file_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: str = kwargs.pop("content_type") + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") @@ -589,7 +611,8 @@ def build_agents_upload_session_file_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) @@ -692,62 +715,100 @@ def build_agents_delete_session_file_request( return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_evaluation_rules_get_request(id: str, **kwargs: Any) -> HttpRequest: +def build_voice_agent_web_socket_connect_voice_agent_request( # pylint: disable=name-too-long + agent_name: str, + *, + agent_session_id: Optional[str] = None, + store: Optional[bool] = None, + agent_version_override: Optional[str] = None, + websocket_subprotocol: Optional[Union[str, _models.VoiceAgentWebSocketSubprotocol]] = None, + structured_inputs: 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 = "/evaluationrules/{id}" + _url = "/agents/{agent_name}/endpoint/protocols/voice" path_format_arguments = { - "id": _SERIALIZER.url("id", id, "str"), + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + if agent_session_id is not None: + _params["agent_session_id"] = _SERIALIZER.query("agent_session_id", agent_session_id, "str") + if store is not None: + _params["store"] = _SERIALIZER.query("store", store, "bool") + if agent_version_override is not None: + _params["x-agent-version-override"] = _SERIALIZER.query("agent_version_override", agent_version_override, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if websocket_subprotocol is not None: + _headers["Sec-WebSocket-Protocol"] = _SERIALIZER.header("websocket_subprotocol", websocket_subprotocol, "str") + if structured_inputs is not None: + _headers["x-ms-voice-structured-inputs"] = _SERIALIZER.header("structured_inputs", structured_inputs, "str") return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_evaluation_rules_delete_request(id: str, **kwargs: Any) -> HttpRequest: +def build_agent_endpoint_conversations_list_agent_conversations_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 = "/evaluationrules/{id}" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations" path_format_arguments = { - "id": _SERIALIZER.url("id", id, "str"), + "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") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_evaluation_rules_create_or_update_request( # pylint: disable=name-too-long - id: str, **kwargs: Any + +def build_agent_endpoint_conversations_get_agent_conversation_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 {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluationrules/{id}" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}" path_format_arguments = { - "id": _SERIALIZER.url("id", id, "str"), + "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 @@ -756,45 +817,42 @@ def build_evaluation_rules_create_or_update_request( # pylint: disable=name-too _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_evaluation_rules_list_request( - *, - action_type: Optional[Union[str, _models.EvaluationRuleActionType]] = None, - agent_name: Optional[str] = None, - enabled: Optional[bool] = None, - **kwargs: Any +def build_agent_endpoint_conversations_delete_agent_conversation_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 = "/evaluationrules" + _url = "/agents/{agent_name}/endpoint/protocols/voice/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") - if action_type is not None: - _params["actionType"] = _SERIALIZER.query("action_type", action_type, "str") - if agent_name is not None: - _params["agentName"] = _SERIALIZER.query("agent_name", agent_name, "str") - if enabled is not None: - _params["enabled"] = _SERIALIZER.query("enabled", enabled, "bool") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_connections_get_request(name: str, **kwargs: Any) -> HttpRequest: +def build_agent_endpoint_conversations_list_agent_conversation_responses_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 {}) @@ -802,14 +860,23 @@ def build_connections_get_request(name: str, **kwargs: Any) -> HttpRequest: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/connections/{name}" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/responses" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "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 @@ -818,8 +885,8 @@ def build_connections_get_request(name: str, **kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_connections_get_with_credentials_request( # pylint: disable=name-too-long - name: str, **kwargs: Any +def build_agent_endpoint_conversations_get_agent_conversation_response_request( # pylint: disable=name-too-long + agent_name: str, conversation_id: str, response_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -828,9 +895,11 @@ def build_connections_get_with_credentials_request( # pylint: disable=name-too- accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/connections/{name}/getConnectionWithCredentials" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/responses/{response_id}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + "response_id": _SERIALIZER.url("response_id", response_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -841,13 +910,18 @@ def build_connections_get_with_credentials_request( # pylint: disable=name-too- # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_connections_list_request( +def build_agent_endpoint_conversations_list_agent_conversation_response_items_request( # pylint: disable=name-too-long + agent_name: str, + conversation_id: str, + response_id: str, *, - connection_type: Optional[Union[str, _models.ConnectionType]] = None, - default_connection: Optional[bool] = None, + 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 {}) @@ -857,14 +931,25 @@ def build_connections_list_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/connections" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/responses/{response_id}/items" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + "response_id": _SERIALIZER.url("response_id", response_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") - if connection_type is not None: - _params["connectionType"] = _SERIALIZER.query("connection_type", connection_type, "str") - if default_connection is not None: - _params["defaultConnection"] = _SERIALIZER.query("default_connection", default_connection, "bool") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -872,7 +957,16 @@ def build_connections_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_datasets_list_versions_request(name: str, **kwargs: Any) -> HttpRequest: +def build_agent_endpoint_conversations_list_agent_conversation_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 {}) @@ -880,14 +974,23 @@ def build_datasets_list_versions_request(name: str, **kwargs: Any) -> HttpReques accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/datasets/{name}/versions" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/items" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "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 @@ -896,7 +999,9 @@ def build_datasets_list_versions_request(name: str, **kwargs: Any) -> HttpReques return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_datasets_list_request(**kwargs: Any) -> HttpRequest: +def build_agent_endpoint_conversations_get_agent_conversation_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 {}) @@ -904,7 +1009,14 @@ def build_datasets_list_request(**kwargs: Any) -> HttpRequest: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/datasets" + _url = "/agents/{agent_name}/endpoint/protocols/voice/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") @@ -915,7 +1027,9 @@ def build_datasets_list_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_datasets_get_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_agent_endpoint_conversations_get_agent_conversation_item_audio_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 {}) @@ -923,10 +1037,11 @@ def build_datasets_get_request(name: str, version: str, **kwargs: Any) -> HttpRe accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/datasets/{name}/versions/{version}" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/items/{item_id}/audio" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "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 @@ -940,15 +1055,21 @@ def build_datasets_get_request(name: str, version: str, **kwargs: Any) -> HttpRe return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_datasets_delete_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_agent_endpoint_conversations_get_agent_conversation_item_audio_content_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 = "/datasets/{name}/versions/{version}" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/items/{item_id}/audio/content" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "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 @@ -956,22 +1077,26 @@ def build_datasets_delete_request(name: str, version: str, **kwargs: Any) -> Htt # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_datasets_create_or_update_request(name: str, version: str, **kwargs: Any) -> HttpRequest: + +def build_agent_endpoint_conversations_get_agent_conversation_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 {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/datasets/{name}/versions/{version}" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/audio" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "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 @@ -980,26 +1105,25 @@ def build_datasets_create_or_update_request(name: str, version: str, **kwargs: A _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_datasets_pending_upload_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_agent_endpoint_conversations_get_agent_conversation_audio_content_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 {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") + accept = _headers.pop("Accept", "audio/wav") # Construct URL - _url = "/datasets/{name}/versions/{version}/startPendingUpload" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/audio/content" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "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 @@ -1008,14 +1132,12 @@ def build_datasets_pending_upload_request(name: str, version: str, **kwargs: Any _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_datasets_get_credentials_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_evaluation_rules_get_request(id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1023,10 +1145,9 @@ def build_datasets_get_credentials_request(name: str, version: str, **kwargs: An accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/datasets/{name}/versions/{version}/credentials" + _url = "/evaluationrules/{id}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "id": _SERIALIZER.url("id", id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1037,20 +1158,17 @@ def build_datasets_get_credentials_request(name: str, version: str, **kwargs: An # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_deployments_get_request(name: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) +def build_evaluation_rules_delete_request(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")) - accept = _headers.pop("Accept", "application/json") - # Construct URL - _url = "/deployments/{name}" + _url = "/evaluationrules/{id}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "id": _SERIALIZER.url("id", id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1058,54 +1176,23 @@ def build_deployments_get_request(name: str, **kwargs: Any) -> HttpRequest: # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_deployments_list_request( - *, - model_publisher: Optional[str] = None, - model_name: Optional[str] = None, - deployment_type: Optional[Union[str, _models.DeploymentType]] = None, - **kwargs: Any +def build_evaluation_rules_create_or_update_request( # pylint: disable=name-too-long + id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/deployments" - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if model_publisher is not None: - _params["modelPublisher"] = _SERIALIZER.query("model_publisher", model_publisher, "str") - if model_name is not None: - _params["modelName"] = _SERIALIZER.query("model_name", model_name, "str") - if deployment_type is not None: - _params["deploymentType"] = _SERIALIZER.query("deployment_type", deployment_type, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_indexes_list_versions_request(name: 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 = "/indexes/{name}/versions" + _url = "/evaluationrules/{id}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "id": _SERIALIZER.url("id", id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1114,12 +1201,20 @@ def build_indexes_list_versions_request(name: str, **kwargs: Any) -> HttpRequest _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_indexes_list_request(**kwargs: Any) -> HttpRequest: +def build_evaluation_rules_list_request( + *, + action_type: Optional[Union[str, _models.EvaluationRuleActionType]] = None, + agent_name: Optional[str] = None, + enabled: Optional[bool] = None, + **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1127,10 +1222,16 @@ def build_indexes_list_request(**kwargs: Any) -> HttpRequest: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/indexes" + _url = "/evaluationrules" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if action_type is not None: + _params["actionType"] = _SERIALIZER.query("action_type", action_type, "str") + if agent_name is not None: + _params["agentName"] = _SERIALIZER.query("agent_name", agent_name, "str") + if enabled is not None: + _params["enabled"] = _SERIALIZER.query("enabled", enabled, "bool") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1138,7 +1239,7 @@ def build_indexes_list_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_indexes_get_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_connections_get_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1146,10 +1247,9 @@ def build_indexes_get_request(name: str, version: str, **kwargs: Any) -> HttpReq accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/indexes/{name}/versions/{version}" + _url = "/connections/{name}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1163,38 +1263,19 @@ def build_indexes_get_request(name: str, version: str, **kwargs: Any) -> HttpReq return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_indexes_delete_request(name: str, version: 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 = "/indexes/{name}/versions/{version}" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "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_indexes_create_or_update_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_connections_get_with_credentials_request( # pylint: disable=name-too-long + name: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/indexes/{name}/versions/{version}" + _url = "/connections/{name}/getConnectionWithCredentials" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1203,41 +1284,40 @@ def build_indexes_create_or_update_request(name: str, version: str, **kwargs: An _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_create_version_request(name: str, **kwargs: Any) -> HttpRequest: +def build_connections_list_request( + *, + connection_type: Optional[Union[str, _models.ConnectionType]] = None, + default_connection: Optional[bool] = None, + **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/toolboxes/{name}/versions" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore + _url = "/connections" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if connection_type is not None: + _params["connectionType"] = _SERIALIZER.query("connection_type", connection_type, "str") + if default_connection is not None: + _params["defaultConnection"] = _SERIALIZER.query("default_connection", default_connection, "bool") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_get_request(name: str, **kwargs: Any) -> HttpRequest: +def build_datasets_list_versions_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1245,7 +1325,7 @@ def build_toolboxes_get_request(name: str, **kwargs: Any) -> HttpRequest: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/toolboxes/{name}" + _url = "/datasets/{name}/versions" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), } @@ -1261,14 +1341,7 @@ def build_toolboxes_get_request(name: str, **kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_list_request( - *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - after: Optional[str] = None, - before: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: +def build_datasets_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1276,17 +1349,9 @@ def build_toolboxes_list_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/toolboxes" + _url = "/datasets" # 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 @@ -1295,15 +1360,7 @@ def build_toolboxes_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_list_versions_request( - name: str, - *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - after: Optional[str] = None, - before: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: +def build_datasets_get_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1311,22 +1368,15 @@ def build_toolboxes_list_versions_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/toolboxes/{name}/versions" + _url = "/datasets/{name}/versions/{version}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "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 @@ -1335,15 +1385,12 @@ def build_toolboxes_list_versions_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_get_version_request(name: str, version: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) +def build_datasets_delete_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _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 = "/toolboxes/{name}/versions/{version}" + _url = "/datasets/{name}/versions/{version}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), "version": _SERIALIZER.url("version", version, "str"), @@ -1354,13 +1401,10 @@ def build_toolboxes_get_version_request(name: str, version: str, **kwargs: Any) # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_toolboxes_update_request(name: str, **kwargs: Any) -> HttpRequest: +def build_datasets_create_or_update_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1369,9 +1413,10 @@ def build_toolboxes_update_request(name: str, **kwargs: Any) -> HttpRequest: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/toolboxes/{name}" + _url = "/datasets/{name}/versions/{version}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1387,14 +1432,19 @@ def build_toolboxes_update_request(name: str, **kwargs: Any) -> HttpRequest: return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_delete_request(name: str, **kwargs: Any) -> HttpRequest: +def build_datasets_pending_upload_request(name: str, version: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + # Construct URL - _url = "/toolboxes/{name}" + _url = "/datasets/{name}/versions/{version}/startPendingUpload" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1402,15 +1452,23 @@ def build_toolboxes_delete_request(name: str, **kwargs: Any) -> HttpRequest: # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_delete_version_request(name: str, version: str, **kwargs: Any) -> HttpRequest: + +def build_datasets_get_credentials_request(name: str, version: 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 = "/toolboxes/{name}/versions/{version}" + _url = "/datasets/{name}/versions/{version}/credentials" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), "version": _SERIALIZER.url("version", version, "str"), @@ -1421,12 +1479,13 @@ def build_toolboxes_delete_version_request(name: str, version: str, **kwargs: An # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluation_taxonomies_get_request( # pylint: disable=name-too-long - name: str, **kwargs: Any -) -> HttpRequest: + +def build_deployments_get_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1434,7 +1493,7 @@ def build_beta_evaluation_taxonomies_get_request( # pylint: disable=name-too-lo accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluationtaxonomies/{name}" + _url = "/deployments/{name}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), } @@ -1450,8 +1509,12 @@ def build_beta_evaluation_taxonomies_get_request( # pylint: disable=name-too-lo return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluation_taxonomies_list_request( # pylint: disable=name-too-long - *, input_name: Optional[str] = None, input_type: Optional[str] = None, **kwargs: Any +def build_deployments_list_request( + *, + model_publisher: Optional[str] = None, + model_name: Optional[str] = None, + deployment_type: Optional[Union[str, _models.DeploymentType]] = None, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1460,14 +1523,16 @@ def build_beta_evaluation_taxonomies_list_request( # pylint: disable=name-too-l accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluationtaxonomies" + _url = "/deployments" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if input_name is not None: - _params["inputName"] = _SERIALIZER.query("input_name", input_name, "str") - if input_type is not None: - _params["inputType"] = _SERIALIZER.query("input_type", input_type, "str") + if model_publisher is not None: + _params["modelPublisher"] = _SERIALIZER.query("model_publisher", model_publisher, "str") + if model_name is not None: + _params["modelName"] = _SERIALIZER.query("model_name", model_name, "str") + if deployment_type is not None: + _params["deploymentType"] = _SERIALIZER.query("deployment_type", deployment_type, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1475,14 +1540,15 @@ def build_beta_evaluation_taxonomies_list_request( # pylint: disable=name-too-l return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluation_taxonomies_delete_request( # pylint: disable=name-too-long - name: str, **kwargs: Any -) -> HttpRequest: +def build_indexes_list_versions_request(name: 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 = "/evaluationtaxonomies/{name}" + _url = "/indexes/{name}/versions" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), } @@ -1492,52 +1558,43 @@ def build_beta_evaluation_taxonomies_delete_request( # pylint: disable=name-too # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluation_taxonomies_create_request( # pylint: disable=name-too-long - name: str, **kwargs: Any -) -> HttpRequest: + +def build_indexes_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluationtaxonomies/{name}" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore + _url = "/indexes" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluation_taxonomies_update_request( # pylint: disable=name-too-long - name: str, **kwargs: Any -) -> HttpRequest: +def build_indexes_get_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluationtaxonomies/{name}" + _url = "/indexes/{name}/versions/{version}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1546,89 +1603,70 @@ def build_beta_evaluation_taxonomies_update_request( # pylint: disable=name-too _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_list_versions_request( # pylint: disable=name-too-long - name: str, - *, - type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, - limit: Optional[int] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) +def build_indexes_delete_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _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 = "/evaluators/{name}/versions" + _url = "/indexes/{name}/versions/{version}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if type is not None: - _params["type"] = _SERIALIZER.query("type", type, "str") - if limit is not None: - _params["limit"] = _SERIALIZER.query("limit", limit, "int") - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_beta_evaluators_list_request( - *, - type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, - limit: Optional[int] = None, - **kwargs: Any -) -> HttpRequest: +def build_indexes_create_or_update_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluators" + _url = "/indexes/{name}/versions/{version}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if type is not None: - _params["type"] = _SERIALIZER.query("type", type, "str") - if limit is not None: - _params["limit"] = _SERIALIZER.query("limit", limit, "int") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_get_version_request( # pylint: disable=name-too-long - name: str, version: str, **kwargs: Any -) -> HttpRequest: +def build_toolboxes_create_version_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluators/{name}/versions/{version}" + _url = "/toolboxes/{name}/versions" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1637,22 +1675,24 @@ def build_beta_evaluators_get_version_request( # pylint: disable=name-too-long _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_delete_version_request( # pylint: disable=name-too-long - name: str, version: str, **kwargs: Any -) -> HttpRequest: +def build_toolboxes_get_request(name: 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 = "/evaluators/{name}/versions/{version}" + _url = "/toolboxes/{name}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1660,80 +1700,95 @@ def build_beta_evaluators_delete_version_request( # pylint: disable=name-too-lo # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_create_version_request( # pylint: disable=name-too-long - name: str, **kwargs: Any + +def build_toolboxes_list_request( + *, + 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 {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluators/{name}/versions" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore + _url = "/toolboxes" # 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 - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_update_version_request( # pylint: disable=name-too-long - name: str, version: str, **kwargs: Any +def build_toolboxes_list_versions_request( + 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 {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluators/{name}/versions/{version}" + _url = "/toolboxes/{name}/versions" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "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 - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_pending_upload_request( # pylint: disable=name-too-long - name: str, version: str, **kwargs: Any -) -> HttpRequest: +def build_toolboxes_get_version_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluators/{name}/versions/{version}/startPendingUpload" + _url = "/toolboxes/{name}/versions/{version}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), "version": _SERIALIZER.url("version", version, "str"), @@ -1745,16 +1800,12 @@ def build_beta_evaluators_pending_upload_request( # pylint: disable=name-too-lo _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_get_credentials_request( # pylint: disable=name-too-long - name: str, version: str, **kwargs: Any -) -> HttpRequest: +def build_toolboxes_update_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1763,10 +1814,9 @@ def build_beta_evaluators_get_credentials_request( # pylint: disable=name-too-l accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluators/{name}/versions/{version}/credentials" + _url = "/toolboxes/{name}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1779,48 +1829,36 @@ def build_beta_evaluators_get_credentials_request( # pylint: disable=name-too-l _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_create_generation_job_request( # pylint: disable=name-too-long - *, operation_id: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) +def build_toolboxes_delete_request(name: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") - # Construct URL - _url = "/evaluator_generation_jobs" + _url = "/toolboxes/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - if operation_id is not None: - _headers["Operation-Id"] = _SERIALIZER.header("operation_id", operation_id, "str") - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_beta_evaluators_get_generation_job_request( # pylint: disable=name-too-long - job_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) +def build_toolboxes_delete_version_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _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 = "/evaluator_generation_jobs/{jobId}" + _url = "/toolboxes/{name}/versions/{version}" path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1828,19 +1866,11 @@ def build_beta_evaluators_get_generation_job_request( # pylint: disable=name-to # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_beta_evaluators_list_generation_jobs_request( # pylint: disable=name-too-long - *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - after: Optional[str] = None, - before: Optional[str] = None, - **kwargs: Any +def build_beta_evaluation_taxonomies_get_request( # pylint: disable=name-too-long + name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1849,17 +1879,14 @@ def build_beta_evaluators_list_generation_jobs_request( # pylint: disable=name- accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluator_generation_jobs" + _url = "/evaluationtaxonomies/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", 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 @@ -1868,8 +1895,8 @@ def build_beta_evaluators_list_generation_jobs_request( # pylint: disable=name- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_cancel_generation_job_request( # pylint: disable=name-too-long - job_id: str, **kwargs: Any +def build_beta_evaluation_taxonomies_list_request( # pylint: disable=name-too-long + *, input_name: Optional[str] = None, input_type: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1878,32 +1905,31 @@ def build_beta_evaluators_cancel_generation_job_request( # pylint: disable=name accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluator_generation_jobs/{jobId}:cancel" - path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore + _url = "/evaluationtaxonomies" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if input_name is not None: + _params["inputName"] = _SERIALIZER.query("input_name", input_name, "str") + if input_type is not None: + _params["inputType"] = _SERIALIZER.query("input_type", input_type, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_delete_generation_job_request( # pylint: disable=name-too-long - job_id: str, **kwargs: Any +def build_beta_evaluation_taxonomies_delete_request( # pylint: disable=name-too-long + name: 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 = "/evaluator_generation_jobs/{jobId}" + _url = "/evaluationtaxonomies/{name}" path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1914,7 +1940,9 @@ def build_beta_evaluators_delete_generation_job_request( # pylint: disable=name return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_beta_insights_generate_request(**kwargs: Any) -> HttpRequest: +def build_beta_evaluation_taxonomies_create_request( # pylint: disable=name-too-long + name: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1923,60 +1951,58 @@ def build_beta_insights_generate_request(**kwargs: Any) -> HttpRequest: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/insights" + _url = "/evaluationtaxonomies/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if "Repeatability-Request-ID" not in _headers: - _headers["Repeatability-Request-ID"] = str(uuid.uuid4()) - if "Repeatability-First-Sent" not in _headers: - _headers["Repeatability-First-Sent"] = _SERIALIZER.serialize_data( - datetime.datetime.now(datetime.timezone.utc), "rfc-1123" - ) if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_insights_get_request( - insight_id: str, *, include_coordinates: Optional[bool] = None, **kwargs: Any +def build_beta_evaluation_taxonomies_update_request( # pylint: disable=name-too-long + name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/insights/{id}" + _url = "/evaluationtaxonomies/{name}" path_format_arguments = { - "id": _SERIALIZER.url("insight_id", insight_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - if include_coordinates is not None: - _params["includeCoordinates"] = _SERIALIZER.query("include_coordinates", include_coordinates, "bool") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_insights_list_request( +def build_beta_evaluators_list_versions_request( # pylint: disable=name-too-long + name: str, *, - type: Optional[Union[str, _models.InsightType]] = None, - eval_id: Optional[str] = None, - run_id: Optional[str] = None, - agent_name: Optional[str] = None, - include_coordinates: Optional[bool] = None, + type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, + limit: Optional[int] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1986,20 +2012,19 @@ def build_beta_insights_list_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/insights" + _url = "/evaluators/{name}/versions" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") if type is not None: _params["type"] = _SERIALIZER.query("type", type, "str") - if eval_id is not None: - _params["evalId"] = _SERIALIZER.query("eval_id", eval_id, "str") - if run_id is not None: - _params["runId"] = _SERIALIZER.query("run_id", run_id, "str") - if agent_name is not None: - _params["agentName"] = _SERIALIZER.query("agent_name", agent_name, "str") - if include_coordinates is not None: - _params["includeCoordinates"] = _SERIALIZER.query("include_coordinates", include_coordinates, "bool") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if limit is not None: + _params["limit"] = _SERIALIZER.query("limit", limit, "int") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2007,56 +2032,37 @@ def build_beta_insights_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_memory_stores_create_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/memory_stores" - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_beta_memory_stores_update_request(name: str, **kwargs: Any) -> HttpRequest: +def build_beta_evaluators_list_request( + *, + type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, + limit: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores/{name}" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore + _url = "/evaluators" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if type is not None: + _params["type"] = _SERIALIZER.query("type", type, "str") + if limit is not None: + _params["limit"] = _SERIALIZER.query("limit", limit, "int") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_memory_stores_get_request(name: str, **kwargs: Any) -> HttpRequest: +def build_beta_evaluators_get_version_request( # pylint: disable=name-too-long + name: str, version: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2064,9 +2070,10 @@ def build_beta_memory_stores_get_request(name: str, **kwargs: Any) -> HttpReques accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores/{name}" + _url = "/evaluators/{name}/versions/{version}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2080,51 +2087,17 @@ def build_beta_memory_stores_get_request(name: str, **kwargs: Any) -> HttpReques return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_memory_stores_list_request( - *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - after: Optional[str] = None, - before: Optional[str] = None, - **kwargs: Any +def build_beta_evaluators_delete_version_request( # pylint: disable=name-too-long + name: str, version: 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 = "/memory_stores" - - # 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_memory_stores_delete_request(name: 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 = "/memory_stores/{name}" + _url = "/evaluators/{name}/versions/{version}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2132,13 +2105,10 @@ def build_beta_memory_stores_delete_request(name: str, **kwargs: Any) -> HttpReq # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_beta_memory_stores_search_memories_request( # pylint: disable=name-too-long +def build_beta_evaluators_create_version_request( # pylint: disable=name-too-long name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2149,7 +2119,7 @@ def build_beta_memory_stores_search_memories_request( # pylint: disable=name-to accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores/{name}:search_memories" + _url = "/evaluators/{name}/versions" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), } @@ -2167,8 +2137,8 @@ def build_beta_memory_stores_search_memories_request( # pylint: disable=name-to return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_memory_stores_update_memories_request( # pylint: disable=name-too-long - name: str, **kwargs: Any +def build_beta_evaluators_update_version_request( # pylint: disable=name-too-long + name: str, version: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2178,9 +2148,10 @@ def build_beta_memory_stores_update_memories_request( # pylint: disable=name-to accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores/{name}:update_memories" + _url = "/evaluators/{name}/versions/{version}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2193,11 +2164,11 @@ def build_beta_memory_stores_update_memories_request( # pylint: disable=name-to _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_memory_stores_delete_scope_request( # pylint: disable=name-too-long - name: str, **kwargs: Any +def build_beta_evaluators_pending_upload_request( # pylint: disable=name-too-long + name: str, version: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2207,9 +2178,10 @@ def build_beta_memory_stores_delete_scope_request( # pylint: disable=name-too-l accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores/{name}:delete_scope" + _url = "/evaluators/{name}/versions/{version}/startPendingUpload" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2225,8 +2197,8 @@ def build_beta_memory_stores_delete_scope_request( # pylint: disable=name-too-l return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_memory_stores_create_memory_request( # pylint: disable=name-too-long - name: str, **kwargs: Any +def build_beta_evaluators_get_credentials_request( # pylint: disable=name-too-long + name: str, version: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2236,9 +2208,10 @@ def build_beta_memory_stores_create_memory_request( # pylint: disable=name-too- accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores/{name}/items" + _url = "/evaluators/{name}/versions/{version}/credentials" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2254,8 +2227,8 @@ def build_beta_memory_stores_create_memory_request( # pylint: disable=name-too- return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_memory_stores_update_memory_request( # pylint: disable=name-too-long - name: str, memory_id: str, **kwargs: Any +def build_beta_evaluators_create_generation_job_request( # pylint: disable=name-too-long + *, operation_id: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2265,18 +2238,14 @@ def build_beta_memory_stores_update_memory_request( # pylint: disable=name-too- accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores/{name}/items/{memory_id}" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "memory_id": _SERIALIZER.url("memory_id", memory_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore + _url = "/evaluator_generation_jobs" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if operation_id is not None: + _headers["Operation-Id"] = _SERIALIZER.header("operation_id", operation_id, "str") if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2284,8 +2253,8 @@ def build_beta_memory_stores_update_memory_request( # pylint: disable=name-too- return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_memory_stores_get_memory_request( # pylint: disable=name-too-long - name: str, memory_id: str, **kwargs: Any +def build_beta_evaluators_get_generation_job_request( # pylint: disable=name-too-long + job_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2294,10 +2263,9 @@ def build_beta_memory_stores_get_memory_request( # pylint: disable=name-too-lon accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores/{name}/items/{memory_id}" + _url = "/evaluator_generation_jobs/{jobId}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "memory_id": _SERIALIZER.url("memory_id", memory_id, "str"), + "jobId": _SERIALIZER.url("job_id", job_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2311,10 +2279,8 @@ def build_beta_memory_stores_get_memory_request( # pylint: disable=name-too-lon return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_memory_stores_list_memories_request( # pylint: disable=name-too-long - name: str, +def build_beta_evaluators_list_generation_jobs_request( # pylint: disable=name-too-long *, - kind: Optional[Union[str, _models.MemoryItemKind]] = None, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, after: Optional[str] = None, @@ -2324,21 +2290,13 @@ def build_beta_memory_stores_list_memories_request( # pylint: disable=name-too- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores/{name}/items:list" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore + _url = "/evaluator_generation_jobs" # Construct parameters - if kind is not None: - _params["kind"] = _SERIALIZER.query("kind", kind, "str") if limit is not None: _params["limit"] = _SERIALIZER.query("limit", limit, "int") if order is not None: @@ -2350,15 +2308,13 @@ def build_beta_memory_stores_list_memories_request( # pylint: disable=name-too- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_memory_stores_delete_memory_request( # pylint: disable=name-too-long - name: str, memory_id: str, **kwargs: Any +def build_beta_evaluators_cancel_generation_job_request( # pylint: disable=name-too-long + job_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2367,10 +2323,9 @@ def build_beta_memory_stores_delete_memory_request( # pylint: disable=name-too- accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores/{name}/items/{memory_id}" + _url = "/evaluator_generation_jobs/{jobId}:cancel" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "memory_id": _SERIALIZER.url("memory_id", memory_id, "str"), + "jobId": _SERIALIZER.url("job_id", job_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2381,20 +2336,19 @@ def build_beta_memory_stores_delete_memory_request( # pylint: disable=name-too- # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_models_list_versions_request(name: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) +def build_beta_evaluators_delete_generation_job_request( # pylint: disable=name-too-long + job_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")) - accept = _headers.pop("Accept", "application/json") - # Construct URL - _url = "/models/{name}/versions" + _url = "/evaluator_generation_jobs/{jobId}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "jobId": _SERIALIZER.url("job_id", job_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2402,32 +2356,40 @@ def build_beta_models_list_versions_request(name: str, **kwargs: Any) -> HttpReq # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_beta_models_list_request(**kwargs: Any) -> HttpRequest: +def build_beta_insights_generate_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/models" + _url = "/insights" # 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_models_get_request(name: str, version: str, **kwargs: Any) -> HttpRequest: + if "Repeatability-Request-ID" not in _headers: + _headers["Repeatability-Request-ID"] = str(uuid.uuid4()) + if "Repeatability-First-Sent" not in _headers: + _headers["Repeatability-First-Sent"] = _SERIALIZER.serialize_data( + datetime.datetime.now(datetime.timezone.utc), "rfc-1123" + ) + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_insights_get_request( + insight_id: str, *, include_coordinates: Optional[bool] = None, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2435,15 +2397,16 @@ def build_beta_models_get_request(name: str, version: str, **kwargs: Any) -> Htt accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/models/{name}/versions/{version}" + _url = "/insights/{id}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "id": _SERIALIZER.url("insight_id", insight_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + if include_coordinates is not None: + _params["includeCoordinates"] = _SERIALIZER.query("include_coordinates", include_coordinates, "bool") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers @@ -2452,26 +2415,44 @@ def build_beta_models_get_request(name: str, version: str, **kwargs: Any) -> Htt return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_models_delete_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_beta_insights_list_request( + *, + type: Optional[Union[str, _models.InsightType]] = None, + eval_id: Optional[str] = None, + run_id: Optional[str] = None, + agent_name: Optional[str] = None, + include_coordinates: Optional[bool] = 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")) - # Construct URL - _url = "/models/{name}/versions/{version}" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } + accept = _headers.pop("Accept", "application/json") - _url: str = _url.format(**path_format_arguments) # type: ignore + # Construct URL + _url = "/insights" # Construct parameters + if type is not None: + _params["type"] = _SERIALIZER.query("type", type, "str") + if eval_id is not None: + _params["evalId"] = _SERIALIZER.query("eval_id", eval_id, "str") + if run_id is not None: + _params["runId"] = _SERIALIZER.query("run_id", run_id, "str") + if agent_name is not None: + _params["agentName"] = _SERIALIZER.query("agent_name", agent_name, "str") + if include_coordinates is not None: + _params["includeCoordinates"] = _SERIALIZER.query("include_coordinates", include_coordinates, "bool") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_models_update_request(name: str, version: str, **kwargs: Any) -> HttpRequest: + +def build_beta_memory_stores_create_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2480,13 +2461,7 @@ def build_beta_models_update_request(name: str, version: str, **kwargs: Any) -> accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/models/{name}/versions/{version}" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore + _url = "/memory_stores" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2496,12 +2471,10 @@ def build_beta_models_update_request(name: str, version: str, **kwargs: Any) -> _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_models_pending_create_version_request( # pylint: disable=name-too-long - name: str, version: str, **kwargs: Any -) -> HttpRequest: +def build_beta_memory_stores_update_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2510,10 +2483,9 @@ def build_beta_models_pending_create_version_request( # pylint: disable=name-to accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/models/{name}/versions/{version}/createAsync" + _url = "/memory_stores/{name}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2529,19 +2501,17 @@ def build_beta_models_pending_create_version_request( # pylint: disable=name-to return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_models_pending_upload_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_beta_memory_stores_get_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/models/{name}/versions/{version}/startPendingUpload" + _url = "/memory_stores/{name}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2550,44 +2520,46 @@ def build_beta_models_pending_upload_request(name: str, version: str, **kwargs: _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_models_get_credentials_request( # pylint: disable=name-too-long - name: str, version: str, **kwargs: Any +def build_beta_memory_stores_list_request( + *, + 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 {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/models/{name}/versions/{version}/credentials" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore + _url = "/memory_stores" # 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 - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_red_teams_get_request(name: str, **kwargs: Any) -> HttpRequest: +def build_beta_memory_stores_delete_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2595,7 +2567,7 @@ def build_beta_red_teams_get_request(name: str, **kwargs: Any) -> HttpRequest: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/redTeams/runs/{name}" + _url = "/memory_stores/{name}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), } @@ -2608,29 +2580,41 @@ def build_beta_red_teams_get_request(name: str, **kwargs: Any) -> HttpRequest: # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_red_teams_list_request(**kwargs: Any) -> HttpRequest: +def build_beta_memory_stores_search_memories_request( # pylint: disable=name-too-long + name: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/redTeams/runs" + _url = "/memory_stores/{name}:search_memories" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_red_teams_create_request(**kwargs: Any) -> HttpRequest: +def build_beta_memory_stores_update_memories_request( # pylint: disable=name-too-long + name: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2639,7 +2623,12 @@ def build_beta_red_teams_create_request(**kwargs: Any) -> HttpRequest: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/redTeams/runs:run" + _url = "/memory_stores/{name}:update_memories" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2652,8 +2641,8 @@ def build_beta_red_teams_create_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_routines_create_or_update_request( # pylint: disable=name-too-long - routine_name: str, **kwargs: Any +def build_beta_memory_stores_delete_scope_request( # pylint: disable=name-too-long + name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2663,9 +2652,9 @@ def build_beta_routines_create_or_update_request( # pylint: disable=name-too-lo accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/routines/{routine_name}" + _url = "/memory_stores/{name}:delete_scope" path_format_arguments = { - "routine_name": _SERIALIZER.url("routine_name", routine_name, "str"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2678,20 +2667,23 @@ def build_beta_routines_create_or_update_request( # pylint: disable=name-too-lo _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_routines_get_request(routine_name: str, **kwargs: Any) -> HttpRequest: +def build_beta_memory_stores_create_memory_request( # pylint: disable=name-too-long + name: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/routines/{routine_name}" + _url = "/memory_stores/{name}/items" path_format_arguments = { - "routine_name": _SERIALIZER.url("routine_name", routine_name, "str"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2700,22 +2692,28 @@ def build_beta_routines_get_request(routine_name: str, **kwargs: Any) -> HttpReq _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_routines_enable_request(routine_name: str, **kwargs: Any) -> HttpRequest: +def build_beta_memory_stores_update_memory_request( # pylint: disable=name-too-long + name: str, memory_id: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/routines/{routine_name}:enable" + _url = "/memory_stores/{name}/items/{memory_id}" path_format_arguments = { - "routine_name": _SERIALIZER.url("routine_name", routine_name, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "memory_id": _SERIALIZER.url("memory_id", memory_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2724,12 +2722,16 @@ def build_beta_routines_enable_request(routine_name: str, **kwargs: Any) -> Http _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_routines_disable_request(routine_name: str, **kwargs: Any) -> HttpRequest: +def build_beta_memory_stores_get_memory_request( # pylint: disable=name-too-long + name: str, memory_id: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2737,9 +2739,10 @@ def build_beta_routines_disable_request(routine_name: str, **kwargs: Any) -> Htt accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/routines/{routine_name}:disable" + _url = "/memory_stores/{name}/items/{memory_id}" path_format_arguments = { - "routine_name": _SERIALIZER.url("routine_name", routine_name, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "memory_id": _SERIALIZER.url("memory_id", memory_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2750,51 +2753,69 @@ def build_beta_routines_disable_request(routine_name: str, **kwargs: Any) -> Htt # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_routines_list_request( +def build_beta_memory_stores_list_memories_request( # pylint: disable=name-too-long + name: str, *, + kind: Optional[Union[str, _models.MemoryItemKind]] = None, limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, after: Optional[str] = None, before: Optional[str] = None, - order: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/routines" + _url = "/memory_stores/{name}/items:list" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + if kind is not None: + _params["kind"] = _SERIALIZER.query("kind", kind, "str") 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") - if order is not None: - _params["order"] = _SERIALIZER.query("order", order, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_routines_delete_request(routine_name: str, **kwargs: Any) -> HttpRequest: +def build_beta_memory_stores_delete_memory_request( # pylint: disable=name-too-long + name: str, memory_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 = "/routines/{routine_name}" + _url = "/memory_stores/{name}/items/{memory_id}" path_format_arguments = { - "routine_name": _SERIALIZER.url("routine_name", routine_name, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "memory_id": _SERIALIZER.url("memory_id", memory_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2802,19 +2823,13 @@ def build_beta_routines_delete_request(routine_name: str, **kwargs: Any) -> Http # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_routines_list_runs_request( - routine_name: str, - *, - filter: Optional[str] = None, - limit: Optional[int] = None, - after: Optional[str] = None, - before: Optional[str] = None, - order: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: + +def build_beta_models_list_versions_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2822,24 +2837,14 @@ def build_beta_routines_list_runs_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/routines/{routine_name}/runs" + _url = "/models/{name}/versions" path_format_arguments = { - "routine_name": _SERIALIZER.url("routine_name", routine_name, "str"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - if filter is not None: - _params["filter"] = _SERIALIZER.query("filter", filter, "str") - if limit is not None: - _params["limit"] = _SERIALIZER.query("limit", limit, "int") - if after is not None: - _params["after"] = _SERIALIZER.query("after", after, "str") - if before is not None: - _params["before"] = _SERIALIZER.query("before", before, "str") - if order is not None: - _params["order"] = _SERIALIZER.query("order", order, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers @@ -2848,18 +2853,37 @@ def build_beta_routines_list_runs_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_routines_dispatch_request(routine_name: str, **kwargs: Any) -> HttpRequest: +def build_beta_models_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/routines/{routine_name}:dispatch_async" + _url = "/models" + + # 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_models_get_request(name: str, version: 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 = "/models/{name}/versions/{version}" path_format_arguments = { - "routine_name": _SERIALIZER.url("routine_name", routine_name, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2868,21 +2892,20 @@ def build_beta_routines_dispatch_request(routine_name: str, **kwargs: Any) -> Ht _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_schedules_delete_request(schedule_id: str, **kwargs: Any) -> HttpRequest: +def build_beta_models_delete_request(name: str, version: 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 = "/schedules/{id}" + _url = "/models/{name}/versions/{version}" path_format_arguments = { - "id": _SERIALIZER.url("schedule_id", schedule_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2893,17 +2916,19 @@ def build_beta_schedules_delete_request(schedule_id: str, **kwargs: Any) -> Http return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_beta_schedules_get_request(schedule_id: str, **kwargs: Any) -> HttpRequest: +def build_beta_models_update_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/schedules/{id}" + _url = "/models/{name}/versions/{version}" path_format_arguments = { - "id": _SERIALIZER.url("schedule_id", schedule_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2912,39 +2937,44 @@ def build_beta_schedules_get_request(schedule_id: str, **kwargs: Any) -> HttpReq _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_schedules_list_request( - *, type: Optional[Union[str, _models.ScheduleTaskType]] = None, enabled: Optional[bool] = None, **kwargs: Any +def build_beta_models_pending_create_version_request( # pylint: disable=name-too-long + name: str, version: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/schedules" + _url = "/models/{name}/versions/{version}/createAsync" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if type is not None: - _params["type"] = _SERIALIZER.query("type", type, "str") - if enabled is not None: - _params["enabled"] = _SERIALIZER.query("enabled", enabled, "bool") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_schedules_create_or_update_request( # pylint: disable=name-too-long - schedule_id: str, **kwargs: Any -) -> HttpRequest: +def build_beta_models_pending_upload_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2953,9 +2983,10 @@ def build_beta_schedules_create_or_update_request( # pylint: disable=name-too-l accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/schedules/{id}" + _url = "/models/{name}/versions/{version}/startPendingUpload" path_format_arguments = { - "id": _SERIALIZER.url("schedule_id", schedule_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2968,21 +2999,24 @@ def build_beta_schedules_create_or_update_request( # pylint: disable=name-too-l _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_schedules_get_run_request(schedule_id: str, run_id: str, **kwargs: Any) -> HttpRequest: +def build_beta_models_get_credentials_request( # pylint: disable=name-too-long + name: str, version: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/schedules/{schedule_id}/runs/{run_id}" + _url = "/models/{name}/versions/{version}/credentials" path_format_arguments = { - "schedule_id": _SERIALIZER.url("schedule_id", schedule_id, "str"), - "run_id": _SERIALIZER.url("run_id", run_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2991,18 +3025,14 @@ def build_beta_schedules_get_run_request(schedule_id: str, run_id: str, **kwargs _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_schedules_list_runs_request( - schedule_id: str, - *, - type: Optional[Union[str, _models.ScheduleTaskType]] = None, - enabled: Optional[bool] = None, - **kwargs: Any -) -> HttpRequest: +def build_beta_red_teams_get_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3010,19 +3040,15 @@ def build_beta_schedules_list_runs_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/schedules/{id}/runs" + _url = "/redTeams/runs/{name}" path_format_arguments = { - "id": _SERIALIZER.url("schedule_id", schedule_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if type is not None: - _params["type"] = _SERIALIZER.query("type", type, "str") - if enabled is not None: - _params["enabled"] = _SERIALIZER.query("enabled", enabled, "bool") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -3030,7 +3056,7 @@ def build_beta_schedules_list_runs_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_skills_get_request(name: str, **kwargs: Any) -> HttpRequest: +def build_beta_red_teams_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3038,12 +3064,7 @@ def build_beta_skills_get_request(name: str, **kwargs: Any) -> HttpRequest: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/skills/{name}" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore + _url = "/redTeams/runs" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -3054,41 +3075,31 @@ def build_beta_skills_get_request(name: str, **kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_skills_list_request( - *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - after: Optional[str] = None, - before: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: +def build_beta_red_teams_create_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/skills" + _url = "/redTeams/runs:run" # 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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_skills_update_request(name: str, **kwargs: Any) -> HttpRequest: +def build_beta_routines_create_or_update_request( # pylint: disable=name-too-long + routine_name: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3097,9 +3108,9 @@ def build_beta_skills_update_request(name: str, **kwargs: Any) -> HttpRequest: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/skills/{name}" + _url = "/routines/{routine_name}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "routine_name": _SERIALIZER.url("routine_name", routine_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3112,10 +3123,10 @@ def build_beta_skills_update_request(name: str, **kwargs: Any) -> HttpRequest: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_skills_delete_request(name: str, **kwargs: Any) -> HttpRequest: +def build_beta_routines_get_request(routine_name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3123,9 +3134,9 @@ def build_beta_skills_delete_request(name: str, **kwargs: Any) -> HttpRequest: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/skills/{name}" + _url = "/routines/{routine_name}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "routine_name": _SERIALIZER.url("routine_name", routine_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3136,21 +3147,20 @@ def build_beta_skills_delete_request(name: str, **kwargs: Any) -> HttpRequest: # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_skills_create_request(name: str, **kwargs: Any) -> HttpRequest: +def build_beta_routines_enable_request(routine_name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/skills/{name}/versions" + _url = "/routines/{routine_name}:enable" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "routine_name": _SERIALIZER.url("routine_name", routine_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3159,16 +3169,12 @@ def build_beta_skills_create_request(name: str, **kwargs: Any) -> HttpRequest: _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_skills_create_from_files_request( # pylint: disable=name-too-long - name: str, **kwargs: Any -) -> HttpRequest: +def build_beta_routines_disable_request(routine_name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3176,9 +3182,9 @@ def build_beta_skills_create_from_files_request( # pylint: disable=name-too-lon accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/skills/{name}/versions" + _url = "/routines/{routine_name}:disable" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "routine_name": _SERIALIZER.url("routine_name", routine_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3192,13 +3198,12 @@ def build_beta_skills_create_from_files_request( # pylint: disable=name-too-lon return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_skills_list_versions_request( - name: str, +def build_beta_routines_list_request( *, limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, after: Optional[str] = None, before: Optional[str] = None, + order: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -3208,22 +3213,17 @@ def build_beta_skills_list_versions_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/skills/{name}/versions" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore + _url = "/routines" # 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") + if order is not None: + _params["order"] = _SERIALIZER.query("order", order, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers @@ -3232,18 +3232,14 @@ def build_beta_skills_list_versions_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_skills_get_version_request(name: str, version: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) +def build_beta_routines_delete_request(routine_name: str, **kwargs: Any) -> HttpRequest: _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 = "/skills/{name}/versions/{version}" + _url = "/routines/{routine_name}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "routine_name": _SERIALIZER.url("routine_name", routine_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3251,28 +3247,44 @@ def build_beta_skills_get_version_request(name: str, version: str, **kwargs: Any # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_beta_skills_download_request(name: str, **kwargs: Any) -> HttpRequest: +def build_beta_routines_list_runs_request( + routine_name: str, + *, + filter: Optional[str] = None, + limit: Optional[int] = None, + after: Optional[str] = None, + before: Optional[str] = None, + order: 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/zip") + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/skills/{name}/content" + _url = "/routines/{routine_name}/runs" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "routine_name": _SERIALIZER.url("routine_name", routine_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + if filter is not None: + _params["filter"] = _SERIALIZER.query("filter", filter, "str") + if limit is not None: + _params["limit"] = _SERIALIZER.query("limit", limit, "int") + if after is not None: + _params["after"] = _SERIALIZER.query("after", after, "str") + if before is not None: + _params["before"] = _SERIALIZER.query("before", before, "str") + if order is not None: + _params["order"] = _SERIALIZER.query("order", order, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers @@ -3281,20 +3293,62 @@ def build_beta_skills_download_request(name: str, **kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_skills_download_version_request( # pylint: disable=name-too-long - name: str, version: str, **kwargs: Any -) -> HttpRequest: +def build_beta_routines_dispatch_request(routine_name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/zip") + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/skills/{name}/versions/{version}/content" + _url = "/routines/{routine_name}:dispatch_async" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "routine_name": _SERIALIZER.url("routine_name", routine_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_schedules_delete_request(schedule_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 = "/schedules/{id}" + path_format_arguments = { + "id": _SERIALIZER.url("schedule_id", schedule_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_schedules_get_request(schedule_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 = "/schedules/{id}" + path_format_arguments = { + "id": _SERIALIZER.url("schedule_id", schedule_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3308,7 +3362,9 @@ def build_beta_skills_download_version_request( # pylint: disable=name-too-long return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_skills_delete_version_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_beta_schedules_list_request( + *, type: Optional[Union[str, _models.ScheduleTaskType]] = None, enabled: Optional[bool] = None, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3316,10 +3372,35 @@ def build_beta_skills_delete_version_request(name: str, version: str, **kwargs: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/skills/{name}/versions/{version}" + _url = "/schedules" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if type is not None: + _params["type"] = _SERIALIZER.query("type", type, "str") + if enabled is not None: + _params["enabled"] = _SERIALIZER.query("enabled", enabled, "bool") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_schedules_create_or_update_request( # pylint: disable=name-too-long + schedule_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/schedules/{id}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "id": _SERIALIZER.url("schedule_id", schedule_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3328,13 +3409,44 @@ def build_beta_skills_delete_version_request(name: str, version: str, **kwargs: _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_datasets_get_generation_job_request( # pylint: disable=name-too-long - job_id: str, **kwargs: Any +def build_beta_schedules_get_run_request(schedule_id: str, run_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 = "/schedules/{schedule_id}/runs/{run_id}" + path_format_arguments = { + "schedule_id": _SERIALIZER.url("schedule_id", schedule_id, "str"), + "run_id": _SERIALIZER.url("run_id", run_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_schedules_list_runs_request( + schedule_id: str, + *, + type: Optional[Union[str, _models.ScheduleTaskType]] = None, + enabled: Optional[bool] = None, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3343,15 +3455,19 @@ def build_beta_datasets_get_generation_job_request( # pylint: disable=name-too- accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/data_generation_jobs/{jobId}" + _url = "/schedules/{id}/runs" path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), + "id": _SERIALIZER.url("schedule_id", schedule_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if type is not None: + _params["type"] = _SERIALIZER.query("type", type, "str") + if enabled is not None: + _params["enabled"] = _SERIALIZER.query("enabled", enabled, "bool") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -3359,7 +3475,31 @@ def build_beta_datasets_get_generation_job_request( # pylint: disable=name-too- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_datasets_list_generation_jobs_request( # pylint: disable=name-too-long +def build_beta_skills_get_request(name: 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 = "/skills/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "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_skills_list_request( *, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, @@ -3374,7 +3514,7 @@ def build_beta_datasets_list_generation_jobs_request( # pylint: disable=name-to accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/data_generation_jobs" + _url = "/skills" # Construct parameters if limit is not None: @@ -3393,9 +3533,7 @@ def build_beta_datasets_list_generation_jobs_request( # pylint: disable=name-to return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_datasets_create_generation_job_request( # pylint: disable=name-too-long - *, operation_id: Optional[str] = None, **kwargs: Any -) -> HttpRequest: +def build_beta_skills_update_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3404,14 +3542,17 @@ def build_beta_datasets_create_generation_job_request( # pylint: disable=name-t accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/data_generation_jobs" + _url = "/skills/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if operation_id is not None: - _headers["Operation-Id"] = _SERIALIZER.header("operation_id", operation_id, "str") if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -3419,9 +3560,7 @@ def build_beta_datasets_create_generation_job_request( # pylint: disable=name-t return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_datasets_cancel_generation_job_request( # pylint: disable=name-too-long - job_id: str, **kwargs: Any -) -> HttpRequest: +def build_beta_skills_delete_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3429,9 +3568,9 @@ def build_beta_datasets_cancel_generation_job_request( # pylint: disable=name-t accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/data_generation_jobs/{jobId}:cancel" + _url = "/skills/{name}" path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3442,32 +3581,10 @@ def build_beta_datasets_cancel_generation_job_request( # pylint: disable=name-t # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_beta_datasets_delete_generation_job_request( # pylint: disable=name-too-long - job_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 = "/data_generation_jobs/{jobId}" - path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_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) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agents_create_optimization_job_request( # pylint: disable=name-too-long - *, operation_id: Optional[str] = None, **kwargs: Any -) -> HttpRequest: +def build_beta_skills_create_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3476,14 +3593,17 @@ def build_beta_agents_create_optimization_job_request( # pylint: disable=name-t accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agent_optimization_jobs" + _url = "/skills/{name}/versions" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if operation_id is not None: - _headers["Operation-Id"] = _SERIALIZER.header("operation_id", operation_id, "str") if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -3491,8 +3611,8 @@ def build_beta_agents_create_optimization_job_request( # pylint: disable=name-t return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agents_get_optimization_job_request( # pylint: disable=name-too-long - job_id: str, **kwargs: Any +def build_beta_skills_create_from_files_request( # pylint: disable=name-too-long + name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3501,9 +3621,9 @@ def build_beta_agents_get_optimization_job_request( # pylint: disable=name-too- accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agent_optimization_jobs/{jobId}" + _url = "/skills/{name}/versions" path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3514,17 +3634,16 @@ def build_beta_agents_get_optimization_job_request( # pylint: disable=name-too- # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agents_list_optimization_jobs_request( # pylint: disable=name-too-long +def build_beta_skills_list_versions_request( + name: str, *, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, after: Optional[str] = None, before: Optional[str] = None, - status: Optional[Union[str, _models.JobStatus]] = None, - agent_name: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -3534,7 +3653,12 @@ def build_beta_agents_list_optimization_jobs_request( # pylint: disable=name-to accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agent_optimization_jobs" + _url = "/skills/{name}/versions" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if limit is not None: @@ -3545,10 +3669,6 @@ def build_beta_agents_list_optimization_jobs_request( # pylint: disable=name-to _params["after"] = _SERIALIZER.query("after", after, "str") if before is not None: _params["before"] = _SERIALIZER.query("before", before, "str") - if status is not None: - _params["status"] = _SERIALIZER.query("status", status, "str") - if agent_name is not None: - _params["agent_name"] = _SERIALIZER.query("agent_name", agent_name, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers @@ -3557,9 +3677,7 @@ def build_beta_agents_list_optimization_jobs_request( # pylint: disable=name-to return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agents_cancel_optimization_job_request( # pylint: disable=name-too-long - job_id: str, **kwargs: Any -) -> HttpRequest: +def build_beta_skills_get_version_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3567,9 +3685,10 @@ def build_beta_agents_cancel_optimization_job_request( # pylint: disable=name-t accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agent_optimization_jobs/{jobId}:cancel" + _url = "/skills/{name}/versions/{version}" path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3580,86 +3699,1593 @@ def build_beta_agents_cancel_optimization_job_request( # pylint: disable=name-t # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agents_delete_optimization_job_request( # pylint: disable=name-too-long - job_id: str, **kwargs: Any -) -> HttpRequest: +def build_beta_skills_download_request(name: 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/zip") + # Construct URL - _url = "/agent_optimization_jobs/{jobId}" + _url = "/skills/{name}/content" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "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_skills_download_version_request( # pylint: disable=name-too-long + name: str, version: 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/zip") + + # Construct URL + _url = "/skills/{name}/versions/{version}/content" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "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_skills_delete_version_request(name: str, version: 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 = "/skills/{name}/versions/{version}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_datasets_get_generation_job_request( # pylint: disable=name-too-long + job_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 = "/data_generation_jobs/{jobId}" + path_format_arguments = { + "jobId": _SERIALIZER.url("job_id", job_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_datasets_list_generation_jobs_request( # pylint: disable=name-too-long + *, + 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 = "/data_generation_jobs" + + # 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_datasets_create_generation_job_request( # pylint: disable=name-too-long + *, operation_id: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/data_generation_jobs" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if operation_id is not None: + _headers["Operation-Id"] = _SERIALIZER.header("operation_id", operation_id, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_datasets_cancel_generation_job_request( # pylint: disable=name-too-long + job_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 = "/data_generation_jobs/{jobId}:cancel" + path_format_arguments = { + "jobId": _SERIALIZER.url("job_id", job_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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_datasets_delete_generation_job_request( # pylint: disable=name-too-long + job_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 = "/data_generation_jobs/{jobId}" + path_format_arguments = { + "jobId": _SERIALIZER.url("job_id", job_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_agents_create_optimization_job_request( # pylint: disable=name-too-long + *, operation_id: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/agent_optimization_jobs" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if operation_id is not None: + _headers["Operation-Id"] = _SERIALIZER.header("operation_id", operation_id, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_agents_get_optimization_job_request( # pylint: disable=name-too-long + job_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 = "/agent_optimization_jobs/{jobId}" path_format_arguments = { "jobId": _SERIALIZER.url("job_id", job_id, "str"), } - _url: str = _url.format(**path_format_arguments) # type: ignore + _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_agents_list_optimization_jobs_request( # pylint: disable=name-too-long + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + after: Optional[str] = None, + before: Optional[str] = None, + status: Optional[Union[str, _models.JobStatus]] = None, + agent_name: 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 = "/agent_optimization_jobs" + + # 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") + if status is not None: + _params["status"] = _SERIALIZER.query("status", status, "str") + if agent_name is not None: + _params["agent_name"] = _SERIALIZER.query("agent_name", agent_name, "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_agents_cancel_optimization_job_request( # pylint: disable=name-too-long + job_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 = "/agent_optimization_jobs/{jobId}:cancel" + path_format_arguments = { + "jobId": _SERIALIZER.url("job_id", job_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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_agents_delete_optimization_job_request( # pylint: disable=name-too-long + job_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 = "/agent_optimization_jobs/{jobId}" + path_format_arguments = { + "jobId": _SERIALIZER.url("job_id", job_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) + + +class BetaOperations: # pylint: disable=docstring-missing-param,too-many-instance-attributes + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.AIProjectClient`'s + :attr:`beta` 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") + + self.evaluation_taxonomies = BetaEvaluationTaxonomiesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.evaluators = BetaEvaluatorsOperations(self._client, self._config, self._serialize, self._deserialize) + self.insights = BetaInsightsOperations(self._client, self._config, self._serialize, self._deserialize) + self.memory_stores = BetaMemoryStoresOperations(self._client, self._config, self._serialize, self._deserialize) + self.models = BetaModelsOperations(self._client, self._config, self._serialize, self._deserialize) + self.red_teams = BetaRedTeamsOperations(self._client, self._config, self._serialize, self._deserialize) + self.routines = BetaRoutinesOperations(self._client, self._config, self._serialize, self._deserialize) + self.schedules = BetaSchedulesOperations(self._client, self._config, self._serialize, self._deserialize) + self.skills = BetaSkillsOperations(self._client, self._config, self._serialize, self._deserialize) + self.datasets = BetaDatasetsOperations(self._client, self._config, self._serialize, self._deserialize) + self.agents = BetaAgentsOperations(self._client, self._config, self._serialize, self._deserialize) + + +class AgentsOperations: # pylint: disable=docstring-missing-param,too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.AIProjectClient`'s + :attr:`agents` 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 get(self, agent_name: str, **kwargs: Any) -> _models.AgentDetails: + """Get an agent. + + Retrieves an agent definition by its unique name. + + :param agent_name: The name of the agent to retrieve. Required. + :type agent_name: str + :return: AgentDetails. The AgentDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentDetails + :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.AgentDetails] = kwargs.pop("cls", None) + + _request = build_agents_get_request( + agent_name=agent_name, + 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.AgentDetails, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def generate_agent( + self, *, kind: Union[str, _models.AgentKind], content_type: str = "application/json", **kwargs: Any + ) -> _models.AgentDetails: + """Generate an agent. + + Generates and creates an agent from kind-specific high-level inputs. The generated definition + remains fully editable through the standard agent versioning operations. + + :keyword kind: The kind of agent to generate. Known values are: "prompt", "hosted", "workflow", + "external", and "voice". Required. + :paramtype kind: str or ~azure.ai.projects.models.AgentKind + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AgentDetails. The AgentDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def generate_agent( + self, body: _types.GenerateAgentRequest, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AgentDetails: + """Generate an agent. + + Generates and creates an agent from kind-specific high-level inputs. The generated definition + remains fully editable through the standard agent versioning operations. + + :param body: Required. + :type body: ~azure.ai.projects.types.GenerateAgentRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AgentDetails. The AgentDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def generate_agent( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AgentDetails: + """Generate an agent. + + Generates and creates an agent from kind-specific high-level inputs. The generated definition + remains fully editable through the standard agent versioning operations. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AgentDetails. The AgentDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def generate_agent( + self, + body: Union[JSON, _types.GenerateAgentRequest, IO[bytes]] = _Unset, + *, + kind: Union[str, _models.AgentKind] = _Unset, + **kwargs: Any + ) -> _models.AgentDetails: + """Generate an agent. + + Generates and creates an agent from kind-specific high-level inputs. The generated definition + remains fully editable through the standard agent versioning operations. + + :param body: Is one of the following types: JSON, GenerateAgentRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.GenerateAgentRequest or IO[bytes] + :keyword kind: The kind of agent to generate. Known values are: "prompt", "hosted", "workflow", + "external", and "voice". Required. + :paramtype kind: str or ~azure.ai.projects.models.AgentKind + :return: AgentDetails. The AgentDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentDetails + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AgentDetails] = kwargs.pop("cls", None) + + if body is _Unset: + if kind is _Unset: + raise TypeError("missing required argument: kind") + body = {"kind": kind} + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_agents_generate_agent_request( + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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.AgentDetails, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete(self, agent_name: str, *, force: Optional[bool] = None, **kwargs: Any) -> _models.DeleteAgentResponse: + """Delete an agent. + + Deletes an agent. For hosted agents, if any version has active sessions, the request is + rejected with HTTP 409 unless ``force`` is set to true. When force is true, all associated + sessions are cascade-deleted along with the agent and its versions. + + :param agent_name: The name of the agent to delete. Required. + :type agent_name: str + :keyword force: For Hosted Agents, if ``true``, force-deletes the agent even if its versions + have active sessions, cascading deletion to all associated sessions. The service defaults to + ``false`` if a value is not specified by the caller. This value is not relevant for other Agent + types. Default value is None. + :paramtype force: bool + :return: DeleteAgentResponse. The DeleteAgentResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.DeleteAgentResponse + :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.DeleteAgentResponse] = kwargs.pop("cls", None) + + _request = build_agents_delete_request( + agent_name=agent_name, + force=force, + 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.DeleteAgentResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list( + self, + *, + kind: Optional[Union[str, _models.AgentKind]] = None, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.AgentDetails"]: + """List agents. + + Returns a paged collection of agent resources. + + :keyword kind: Filter agents by kind. If not provided, all agents are returned. Known values + are: "prompt", "hosted", "workflow", "external", and "voice". Default value is None. + :paramtype kind: str or ~azure.ai.projects.models.AgentKind + :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 AgentDetails + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.AgentDetails] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AgentDetails]] = 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_agents_list_request( + kind=kind, + 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.AgentDetails], + 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) + + @overload + def create_version( + self, + agent_name: str, + *, + definition: _models.AgentDefinition, + content_type: str = "application/json", + metadata: Optional[dict[str, str]] = None, + description: Optional[str] = None, + blueprint_reference: Optional[_models.AgentBlueprintReference] = None, + draft: Optional[bool] = None, + **kwargs: Any + ) -> _models.AgentVersionDetails: + """Create an agent version. + + Creates a new version for the specified agent and returns the created version resource. + + :param agent_name: The unique name that identifies the agent. Name can be used to + retrieve/update/delete the agent. + + * Must start and end with alphanumeric characters, + * Can contain hyphens in the middle + * Must not exceed 63 characters. Required. + :type agent_name: str + :keyword definition: The agent definition. This can be a prompt, workflow, hosted, external, or + voice agent definition. Required. + :paramtype definition: ~azure.ai.projects.models.AgentDefinition + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword 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. Default value is None. + :paramtype metadata: dict[str, str] + :keyword description: A human-readable description of the agent. Default value is None. + :paramtype description: str + :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. + :paramtype blueprint_reference: ~azure.ai.projects.models.AgentBlueprintReference + :keyword draft: (Preview) Whether this agent version is a draft (candidate) rather than a + release. The service defaults to ``false`` if a value is not specified by the caller. Draft + versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. + Default value is None. + :paramtype draft: bool + :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentVersionDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_version( + self, + agent_name: str, + body: _types.CreateAgentVersionRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AgentVersionDetails: + """Create an agent version. + + Creates a new version for the specified agent and returns the created version resource. + + :param agent_name: The unique name that identifies the agent. Name can be used to + retrieve/update/delete the agent. + + * Must start and end with alphanumeric characters, + * Can contain hyphens in the middle + * Must not exceed 63 characters. Required. + :type agent_name: str + :param body: Required. + :type body: ~azure.ai.projects.types.CreateAgentVersionRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentVersionDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_version( + self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AgentVersionDetails: + """Create an agent version. + + Creates a new version for the specified agent and returns the created version resource. + + :param agent_name: The unique name that identifies the agent. Name can be used to + retrieve/update/delete the agent. + + * Must start and end with alphanumeric characters, + * Can contain hyphens in the middle + * Must not exceed 63 characters. Required. + :type agent_name: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentVersionDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_version( + self, + agent_name: str, + body: Union[JSON, _types.CreateAgentVersionRequest, IO[bytes]] = _Unset, + *, + definition: _models.AgentDefinition = _Unset, + metadata: Optional[dict[str, str]] = None, + description: Optional[str] = None, + blueprint_reference: Optional[_models.AgentBlueprintReference] = None, + draft: Optional[bool] = None, + **kwargs: Any + ) -> _models.AgentVersionDetails: + """Create an agent version. + + Creates a new version for the specified agent and returns the created version resource. + + :param agent_name: The unique name that identifies the agent. Name can be used to + retrieve/update/delete the agent. + + * Must start and end with alphanumeric characters, + * Can contain hyphens in the middle + * Must not exceed 63 characters. Required. + :type agent_name: str + :param body: Is one of the following types: JSON, CreateAgentVersionRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.projects.types.CreateAgentVersionRequest or IO[bytes] + :keyword definition: The agent definition. This can be a prompt, workflow, hosted, external, or + voice agent definition. Required. + :paramtype definition: ~azure.ai.projects.models.AgentDefinition + :keyword 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. Default value is None. + :paramtype metadata: dict[str, str] + :keyword description: A human-readable description of the agent. Default value is None. + :paramtype description: str + :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. + :paramtype blueprint_reference: ~azure.ai.projects.models.AgentBlueprintReference + :keyword draft: (Preview) Whether this agent version is a draft (candidate) rather than a + release. The service defaults to ``false`` if a value is not specified by the caller. Draft + versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. + Default value is None. + :paramtype draft: bool + :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentVersionDetails + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AgentVersionDetails] = kwargs.pop("cls", None) + + if body is _Unset: + if definition is _Unset: + raise TypeError("missing required argument: definition") + body = { + "blueprint_reference": blueprint_reference, + "definition": definition, + "description": description, + "draft": draft, + "metadata": metadata, + } + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_agents_create_version_request( + agent_name=agent_name, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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.AgentVersionDetails, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_version_from_manifest( + self, + agent_name: str, + *, + manifest_id: str, + parameter_values: dict[str, Any], + content_type: str = "application/json", + metadata: Optional[dict[str, str]] = None, + description: Optional[str] = None, + **kwargs: Any + ) -> _models.AgentVersionDetails: + """Create an agent version from manifest. + + Imports the provided manifest to create a new version for the specified agent. + + :param agent_name: The unique name that identifies the agent. Name can be used to + retrieve/update/delete the agent. + + * Must start and end with alphanumeric characters, + * Can contain hyphens in the middle + * Must not exceed 63 characters. Required. + :type agent_name: str + :keyword manifest_id: The manifest ID to import the agent version from. Required. + :paramtype manifest_id: str + :keyword parameter_values: The inputs to the manifest that will result in a fully materialized + Agent. Required. + :paramtype parameter_values: dict[str, any] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword 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. Default value is None. + :paramtype metadata: dict[str, str] + :keyword description: A human-readable description of the agent. Default value is None. + :paramtype description: str + :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentVersionDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_version_from_manifest( + self, + agent_name: str, + body: _types.CreateAgentVersionFromManifestRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AgentVersionDetails: + """Create an agent version from manifest. + + Imports the provided manifest to create a new version for the specified agent. + + :param agent_name: The unique name that identifies the agent. Name can be used to + retrieve/update/delete the agent. + + * Must start and end with alphanumeric characters, + * Can contain hyphens in the middle + * Must not exceed 63 characters. Required. + :type agent_name: str + :param body: Required. + :type body: ~azure.ai.projects.types.CreateAgentVersionFromManifestRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentVersionDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_version_from_manifest( + self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AgentVersionDetails: + """Create an agent version from manifest. + + Imports the provided manifest to create a new version for the specified agent. + + :param agent_name: The unique name that identifies the agent. Name can be used to + retrieve/update/delete the agent. + + * Must start and end with alphanumeric characters, + * Can contain hyphens in the middle + * Must not exceed 63 characters. Required. + :type agent_name: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentVersionDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_version_from_manifest( + self, + agent_name: str, + body: Union[JSON, _types.CreateAgentVersionFromManifestRequest, IO[bytes]] = _Unset, + *, + manifest_id: str = _Unset, + parameter_values: dict[str, Any] = _Unset, + metadata: Optional[dict[str, str]] = None, + description: Optional[str] = None, + **kwargs: Any + ) -> _models.AgentVersionDetails: + """Create an agent version from manifest. + + Imports the provided manifest to create a new version for the specified agent. + + :param agent_name: The unique name that identifies the agent. Name can be used to + retrieve/update/delete the agent. + + * Must start and end with alphanumeric characters, + * Can contain hyphens in the middle + * Must not exceed 63 characters. Required. + :type agent_name: str + :param body: Is one of the following types: JSON, CreateAgentVersionFromManifestRequest, + IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.CreateAgentVersionFromManifestRequest or IO[bytes] + :keyword manifest_id: The manifest ID to import the agent version from. Required. + :paramtype manifest_id: str + :keyword parameter_values: The inputs to the manifest that will result in a fully materialized + Agent. Required. + :paramtype parameter_values: dict[str, any] + :keyword 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. Default value is None. + :paramtype metadata: dict[str, str] + :keyword description: A human-readable description of the agent. Default value is None. + :paramtype description: str + :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentVersionDetails + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AgentVersionDetails] = kwargs.pop("cls", None) + + if body is _Unset: + if manifest_id is _Unset: + raise TypeError("missing required argument: manifest_id") + if parameter_values is _Unset: + raise TypeError("missing required argument: parameter_values") + body = { + "description": description, + "manifest_id": manifest_id, + "metadata": metadata, + "parameter_values": parameter_values, + } + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_agents_create_version_from_manifest_request( + agent_name=agent_name, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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.AgentVersionDetails, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_version(self, agent_name: str, agent_version: str, **kwargs: Any) -> _models.AgentVersionDetails: + """Get an agent version. + + Retrieves the specified version of an agent by its agent name and version identifier. + + :param agent_name: The name of the agent to retrieve. Required. + :type agent_name: str + :param agent_version: The version of the agent to retrieve. Required. + :type agent_version: str + :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentVersionDetails + :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.AgentVersionDetails] = kwargs.pop("cls", None) + + _request = build_agents_get_version_request( + agent_name=agent_name, + agent_version=agent_version, + 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.AgentVersionDetails, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete_version( + self, agent_name: str, agent_version: str, *, force: Optional[bool] = None, **kwargs: Any + ) -> _models.DeleteAgentVersionResponse: + """Delete an agent version. + + Deletes a specific version of an agent. For hosted agents, if the version has active sessions, + the request is rejected with HTTP 409 unless ``force`` is set to true. When force is true, all + sessions associated with this version are cascade-deleted. + + :param agent_name: The name of the agent to delete. Required. + :type agent_name: str + :param agent_version: The version of the agent to delete. Required. + :type agent_version: str + :keyword force: For Hosted Agents, if ``true``, force-deletes the version even if it has active + sessions, cascading deletion to all associated sessions. The service defaults to ``false`` if a + value is not specified by the caller. This value is not relevant for other Agent types. Default + value is None. + :paramtype force: bool + :return: DeleteAgentVersionResponse. The DeleteAgentVersionResponse is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.DeleteAgentVersionResponse + :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.DeleteAgentVersionResponse] = kwargs.pop("cls", None) + + _request = build_agents_delete_version_request( + agent_name=agent_name, + agent_version=agent_version, + force=force, + 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 + ) - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + response = pipeline_response.http_response - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + 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.DeleteAgentVersionResponse, response.json()) -class BetaOperations: # pylint: disable=too-many-instance-attributes - """ - .. warning:: - **DO NOT** instantiate this class directly. + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore - Instead, you should access the following operations through - :class:`~azure.ai.projects.AIProjectClient`'s - :attr:`beta` attribute. - """ + return deserialized # type: ignore - 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_versions( + self, + agent_name: str, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + include_drafts: Optional[bool] = None, + **kwargs: Any + ) -> ItemPaged["_models.AgentVersionDetails"]: + """List agent versions. - self.evaluation_taxonomies = BetaEvaluationTaxonomiesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.evaluators = BetaEvaluatorsOperations(self._client, self._config, self._serialize, self._deserialize) - self.insights = BetaInsightsOperations(self._client, self._config, self._serialize, self._deserialize) - self.memory_stores = BetaMemoryStoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.models = BetaModelsOperations(self._client, self._config, self._serialize, self._deserialize) - self.red_teams = BetaRedTeamsOperations(self._client, self._config, self._serialize, self._deserialize) - self.routines = BetaRoutinesOperations(self._client, self._config, self._serialize, self._deserialize) - self.schedules = BetaSchedulesOperations(self._client, self._config, self._serialize, self._deserialize) - self.skills = BetaSkillsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datasets = BetaDatasetsOperations(self._client, self._config, self._serialize, self._deserialize) - self.agents = BetaAgentsOperations(self._client, self._config, self._serialize, self._deserialize) + Returns a paged collection of versions for the specified agent. + + :param agent_name: The name of the agent to retrieve versions for. 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 + :keyword include_drafts: (Preview) Whether to include draft versions in the listing. The + service defaults to ``false`` if a value is not specified by the caller (only non-draft + versions are returned). Default value is None. + :paramtype include_drafts: bool + :return: An iterator like instance of AgentVersionDetails + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.AgentVersionDetails] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + cls: ClsType[List[_models.AgentVersionDetails]] = kwargs.pop("cls", None) -class AgentsOperations: # pylint: disable=too-many-public-methods - """ - .. warning:: - **DO NOT** instantiate this class directly. + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - Instead, you should access the following operations through - :class:`~azure.ai.projects.AIProjectClient`'s - :attr:`agents` attribute. - """ + def prepare_request(_continuation_token=None): - 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") + _request = build_agents_list_versions_request( + agent_name=agent_name, + limit=limit, + order=order, + after=_continuation_token, + before=before, + include_drafts=include_drafts, + 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.AgentVersionDetails], + 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) + + @overload + def update_details( + self, + agent_name: str, + *, + content_type: str = "application/merge-patch+json", + agent_endpoint: Optional[_models.AgentEndpointConfig] = None, + agent_card: Optional[_models.AgentCard] = None, + **kwargs: Any + ) -> _models.AgentDetails: + """Update an agent endpoint. + + Applies a merge-patch update to the specified agent endpoint configuration. + + :param agent_name: The name of the agent to retrieve. Required. + :type agent_name: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/merge-patch+json". + :paramtype content_type: str + :keyword agent_endpoint: The endpoint configuration for the agent. Default value is None. + :paramtype agent_endpoint: ~azure.ai.projects.models.AgentEndpointConfig + :keyword agent_card: Optional agent card for the agent. Default value is None. + :paramtype agent_card: ~azure.ai.projects.models.AgentCard + :return: AgentDetails. The AgentDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_details( + self, + agent_name: str, + body: _types.PatchAgentObjectRequest, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> _models.AgentDetails: + """Update an agent endpoint. + + Applies a merge-patch update to the specified agent endpoint configuration. + + :param agent_name: The name of the agent to retrieve. Required. + :type agent_name: str + :param body: Required. + :type body: ~azure.ai.projects.types.PatchAgentObjectRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/merge-patch+json". + :paramtype content_type: str + :return: AgentDetails. The AgentDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_details( + self, agent_name: str, body: IO[bytes], *, content_type: str = "application/merge-patch+json", **kwargs: Any + ) -> _models.AgentDetails: + """Update an agent endpoint. + + Applies a merge-patch update to the specified agent endpoint configuration. + + :param agent_name: The name of the agent to retrieve. Required. + :type agent_name: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/merge-patch+json". + :paramtype content_type: str + :return: AgentDetails. The AgentDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace - def get(self, agent_name: str, **kwargs: Any) -> _models.AgentDetails: - """Get an agent. + def update_details( + self, + agent_name: str, + body: Union[JSON, _types.PatchAgentObjectRequest, IO[bytes]] = _Unset, + *, + agent_endpoint: Optional[_models.AgentEndpointConfig] = None, + agent_card: Optional[_models.AgentCard] = None, + **kwargs: Any + ) -> _models.AgentDetails: + """Update an agent endpoint. - Retrieves an agent definition by its unique name. + Applies a merge-patch update to the specified agent endpoint configuration. :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str + :param body: Is one of the following types: JSON, PatchAgentObjectRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.PatchAgentObjectRequest or IO[bytes] + :keyword agent_endpoint: The endpoint configuration for the agent. Default value is None. + :paramtype agent_endpoint: ~azure.ai.projects.models.AgentEndpointConfig + :keyword agent_card: Optional agent card for the agent. Default value is None. + :paramtype agent_card: ~azure.ai.projects.models.AgentCard :return: AgentDetails. The AgentDetails is compatible with MutableMapping :rtype: ~azure.ai.projects.models.AgentDetails :raises ~azure.core.exceptions.HttpResponseError: @@ -3672,14 +5298,27 @@ def get(self, agent_name: str, **kwargs: Any) -> _models.AgentDetails: } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.AgentDetails] = kwargs.pop("cls", None) - _request = build_agents_get_request( + if body is _Unset: + body = {"agent_card": agent_card, "agent_endpoint": agent_endpoint} + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/merge-patch+json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_agents_update_details_request( agent_name=agent_name, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -3719,23 +5358,57 @@ def get(self, agent_name: str, **kwargs: Any) -> _models.AgentDetails: return deserialized # type: ignore + @overload + def _create_version_from_code( + self, + agent_name: str, + content: _models._models._CreateAgentVersionFromCodeContent, + *, + code_zip_sha256: str, + **kwargs: Any + ) -> _models.AgentVersionDetails: ... + @overload + def _create_version_from_code( + self, + agent_name: str, + content: _types._CreateAgentVersionFromCodeContent, + *, + code_zip_sha256: str, + **kwargs: Any + ) -> _models.AgentVersionDetails: ... + @distributed_trace - def delete(self, agent_name: str, *, force: Optional[bool] = None, **kwargs: Any) -> _models.DeleteAgentResponse: - """Delete an agent. + def _create_version_from_code( + self, + agent_name: str, + content: Union[_models._models._CreateAgentVersionFromCodeContent, _types._CreateAgentVersionFromCodeContent], + *, + code_zip_sha256: str, + **kwargs: Any + ) -> _models.AgentVersionDetails: + """Create an agent version from code. - Deletes an agent. For hosted agents, if any version has active sessions, the request is - rejected with HTTP 409 unless ``force`` is set to true. When force is true, all associated - sessions are cascade-deleted along with the agent and its versions. + Creates a new agent version from code. Uploads the code zip and creates a new version for an + existing agent. The SHA-256 hex digest of the zip is provided in the ``x-ms-code-zip-sha256`` + header for integrity and dedup. The request body is multipart/form-data with a JSON metadata + part and a binary code part (part order is irrelevant). Maximum upload size is 250 MB. - :param agent_name: The name of the agent to delete. Required. + :param agent_name: The unique name that identifies the agent. Name can be used to + retrieve/update/delete the agent. + + * Must start and end with alphanumeric characters, + * Can contain hyphens in the middle + * Must not exceed 63 characters. Required. :type agent_name: str - :keyword force: For Hosted Agents, if ``true``, force-deletes the agent even if its versions - have active sessions, cascading deletion to all associated sessions. The service defaults to - ``false`` if a value is not specified by the caller. This value is not relevant for other Agent - types. Default value is None. - :paramtype force: bool - :return: DeleteAgentResponse. The DeleteAgentResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DeleteAgentResponse + :param content: The content multipart request content. Is one of the following types: + _CreateAgentVersionFromCodeContent Required. + :type content: ~azure.ai.projects.models._models._CreateAgentVersionFromCodeContent or + ~azure.ai.projects.types._CreateAgentVersionFromCodeContent + :keyword code_zip_sha256: SHA-256 hex digest of the uploaded code zip. Used for change + detection (dedup) and integrity verification. Required. + :paramtype code_zip_sha256: str + :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentVersionDetails :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3749,12 +5422,18 @@ def delete(self, agent_name: str, *, force: Optional[bool] = None, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DeleteAgentResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentVersionDetails] = kwargs.pop("cls", None) - _request = build_agents_delete_request( + _body = content.as_dict() if isinstance(content, _Model) else content + _file_fields: list[str] = ["code"] + _data_fields: list[str] = ["metadata"] + _files = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_agents_create_version_from_code_request( agent_name=agent_name, - force=force, + code_zip_sha256=code_zip_sha256, api_version=self._config.api_version, + files=_files, headers=_headers, params=_params, ) @@ -3787,7 +5466,7 @@ def delete(self, agent_name: str, *, force: Optional[bool] = None, **kwargs: Any if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.DeleteAgentResponse, response.json()) + deserialized = _deserialize(_models.AgentVersionDetails, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3795,45 +5474,27 @@ def delete(self, agent_name: str, *, force: Optional[bool] = None, **kwargs: Any return deserialized # type: ignore @distributed_trace - def list( - self, - *, - kind: Optional[Union[str, _models.AgentKind]] = None, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.AgentDetails"]: - """List agents. + def download_code(self, agent_name: str, *, agent_version: Optional[str] = None, **kwargs: Any) -> Iterator[bytes]: + """Download agent code. - Returns a paged collection of agent resources. + Downloads the code zip for a code-based hosted agent. + Returns the previously-uploaded zip (``application/zip``). - :keyword kind: Filter agents by kind. If not provided, all agents are returned. Known values - are: "prompt", "hosted", "workflow", and "external". Default value is None. - :paramtype kind: str or ~azure.ai.projects.models.AgentKind - :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 AgentDetails - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.AgentDetails] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + If ``agent_version`` is supplied, returns that version's code zip; otherwise + returns the latest version's code zip. - cls: ClsType[List[_models.AgentDetails]] = kwargs.pop("cls", None) + The SHA-256 digest of the returned bytes matches the ``content_hash`` on the + resolved version's ``code_configuration``. + :param agent_name: The name of the agent. Required. + :type agent_name: str + :keyword agent_version: The version of the agent whose code zip should be downloaded. + If omitted, the latest version's code zip is returned. Default value is None. + :paramtype agent_version: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -3842,203 +5503,124 @@ def list( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(_continuation_token=None): - - _request = build_agents_list_request( - kind=kind, - 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.AgentDetails], - 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) + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - @overload - def create_version( - self, - agent_name: str, - *, - definition: _models.AgentDefinition, - content_type: str = "application/json", - metadata: Optional[dict[str, str]] = None, - description: Optional[str] = None, - blueprint_reference: Optional[_models.AgentBlueprintReference] = None, - draft: Optional[bool] = None, - **kwargs: Any - ) -> _models.AgentVersionDetails: - """Create an agent version. + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - Creates a new version for the specified agent and returns the created version resource. + _request = build_agents_download_code_request( + agent_name=agent_name, + agent_version=agent_version, + 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) - :param agent_name: The unique name that identifies the agent. Name can be used to - retrieve/update/delete the agent. + _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 + ) - * Must start and end with alphanumeric characters, - * Can contain hyphens in the middle - * Must not exceed 63 characters. Required. - :type agent_name: str - :keyword definition: The agent definition. This can be a workflow, hosted agent, or a simple - agent definition. Required. - :paramtype definition: ~azure.ai.projects.models.AgentDefinition - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword 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. + response = pipeline_response.http_response - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. Default value is None. - :paramtype metadata: dict[str, str] - :keyword description: A human-readable description of the agent. Default value is None. - :paramtype description: str - :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. - :paramtype blueprint_reference: ~azure.ai.projects.models.AgentBlueprintReference - :keyword draft: (Preview) Whether this agent version is a draft (candidate) rather than a - release. The service defaults to ``false`` if a value is not specified by the caller. Draft - versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. - Default value is None. - :paramtype draft: bool - :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentVersionDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ + 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) - @overload - def create_version( - self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.AgentVersionDetails: - """Create an agent version. + response_headers = {} + response_headers["x-ms-agent-version"] = self._deserialize("str", response.headers.get("x-ms-agent-version")) + response_headers["Content-Type"] = self._deserialize("str", response.headers.get("Content-Type")) - Creates a new version for the specified agent and returns the created version resource. + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - :param agent_name: The unique name that identifies the agent. Name can be used to - retrieve/update/delete the agent. + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore - * Must start and end with alphanumeric characters, - * Can contain hyphens in the middle - * Must not exceed 63 characters. Required. + return deserialized # type: ignore + + @distributed_trace + def enable(self, agent_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """Enable an agent. + + Enables the specified agent, allowing it to accept new sessions and process requests. This + operation is idempotent — enabling an already-enabled agent returns success with no side + effects. + + :param agent_name: The name of the agent to enable. Required. :type agent_name: str - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentVersionDetails + :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 {}) - @overload - def create_version( - self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.AgentVersionDetails: - """Create an agent version. + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - Creates a new version for the specified agent and returns the created version resource. + cls: ClsType[None] = kwargs.pop("cls", None) - :param agent_name: The unique name that identifies the agent. Name can be used to - retrieve/update/delete the agent. + _request = build_agents_enable_request( + agent_name=agent_name, + 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) - * Must start and end with alphanumeric characters, - * Can contain hyphens in the middle - * Must not exceed 63 characters. Required. - :type agent_name: str - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentVersionDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - @distributed_trace - def create_version( - self, - agent_name: str, - body: Union[JSON, IO[bytes]] = _Unset, - *, - definition: _models.AgentDefinition = _Unset, - metadata: Optional[dict[str, str]] = None, - description: Optional[str] = None, - blueprint_reference: Optional[_models.AgentBlueprintReference] = None, - draft: Optional[bool] = None, - **kwargs: Any - ) -> _models.AgentVersionDetails: - """Create an agent version. + response = pipeline_response.http_response - Creates a new version for the specified agent and returns the created version resource. + 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) - :param agent_name: The unique name that identifies the agent. Name can be used to - retrieve/update/delete the agent. + if cls: + return cls(pipeline_response, None, {}) # type: ignore - * Must start and end with alphanumeric characters, - * Can contain hyphens in the middle - * Must not exceed 63 characters. Required. - :type agent_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword definition: The agent definition. This can be a workflow, hosted agent, or a simple - agent definition. Required. - :paramtype definition: ~azure.ai.projects.models.AgentDefinition - :keyword 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. + @distributed_trace + def disable(self, agent_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """Disable an agent. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. Default value is None. - :paramtype metadata: dict[str, str] - :keyword description: A human-readable description of the agent. Default value is None. - :paramtype description: str - :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. - :paramtype blueprint_reference: ~azure.ai.projects.models.AgentBlueprintReference - :keyword draft: (Preview) Whether this agent version is a draft (candidate) rather than a - release. The service defaults to ``false`` if a value is not specified by the caller. Draft - versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. - Default value is None. - :paramtype draft: bool - :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentVersionDetails + Disables the specified agent, preventing it from accepting new sessions or processing requests. + Existing active sessions are allowed to drain gracefully but no new sessions can be created. + This operation is idempotent — disabling an already-disabled agent returns success with no side + effects. + + :param agent_name: The name of the agent to disable. Required. + :type agent_name: str + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4049,35 +5631,14 @@ def create_version( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AgentVersionDetails] = kwargs.pop("cls", None) - - if body is _Unset: - if definition is _Unset: - raise TypeError("missing required argument: definition") - body = { - "blueprint_reference": blueprint_reference, - "definition": definition, - "description": description, - "draft": draft, - "metadata": metadata, - } - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_agents_create_version_request( + _request = build_agents_disable_request( agent_name=agent_name, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -4086,20 +5647,14 @@ def create_version( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _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 + 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, @@ -4107,152 +5662,116 @@ def create_version( ) raise HttpResponseError(response=response, model=error) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.AgentVersionDetails, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + return cls(pipeline_response, None, {}) # type: ignore @overload - def create_version_from_manifest( + def create_session( self, agent_name: str, *, - manifest_id: str, - parameter_values: dict[str, Any], + version_indicator: _models.VersionIndicator, content_type: str = "application/json", - metadata: Optional[dict[str, str]] = None, - description: Optional[str] = None, + agent_session_id: Optional[str] = None, **kwargs: Any - ) -> _models.AgentVersionDetails: - """Create an agent version from manifest. - - Imports the provided manifest to create a new version for the specified agent. + ) -> _models.AgentSessionResource: + """Create a session. - :param agent_name: The unique name that identifies the agent. Name can be used to - retrieve/update/delete the agent. + Creates a new session for an agent endpoint. The endpoint resolves the backing agent version + from ``version_indicator`` and enforces session ownership using the provided user identity for + session-mutating operations. - * Must start and end with alphanumeric characters, - * Can contain hyphens in the middle - * Must not exceed 63 characters. Required. + :param agent_name: The name of the agent to create a session for. Required. :type agent_name: str - :keyword manifest_id: The manifest ID to import the agent version from. Required. - :paramtype manifest_id: str - :keyword parameter_values: The inputs to the manifest that will result in a fully materialized - Agent. Required. - :paramtype parameter_values: dict[str, any] + :keyword version_indicator: Determines which agent version backs the session. Required. + :paramtype version_indicator: ~azure.ai.projects.models.VersionIndicator :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword 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. Default value is None. - :paramtype metadata: dict[str, str] - :keyword description: A human-readable description of the agent. Default value is None. - :paramtype description: str - :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentVersionDetails + :keyword agent_session_id: Optional caller-provided session ID. If specified, it must be unique + within the agent endpoint. Auto-generated if omitted. Default value is None. + :paramtype agent_session_id: str + :return: AgentSessionResource. The AgentSessionResource is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentSessionResource :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_version_from_manifest( - self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.AgentVersionDetails: - """Create an agent version from manifest. - - Imports the provided manifest to create a new version for the specified agent. - - :param agent_name: The unique name that identifies the agent. Name can be used to - retrieve/update/delete the agent. + def create_session( + self, + agent_name: str, + body: _types.CreateSessionRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AgentSessionResource: + """Create a session. - * Must start and end with alphanumeric characters, - * Can contain hyphens in the middle - * Must not exceed 63 characters. Required. + Creates a new session for an agent endpoint. The endpoint resolves the backing agent version + from ``version_indicator`` and enforces session ownership using the provided user identity for + session-mutating operations. + + :param agent_name: The name of the agent to create a session for. Required. :type agent_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateSessionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentVersionDetails + :return: AgentSessionResource. The AgentSessionResource is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentSessionResource :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_version_from_manifest( + def create_session( self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.AgentVersionDetails: - """Create an agent version from manifest. - - Imports the provided manifest to create a new version for the specified agent. + ) -> _models.AgentSessionResource: + """Create a session. - :param agent_name: The unique name that identifies the agent. Name can be used to - retrieve/update/delete the agent. + Creates a new session for an agent endpoint. The endpoint resolves the backing agent version + from ``version_indicator`` and enforces session ownership using the provided user identity for + session-mutating operations. - * Must start and end with alphanumeric characters, - * Can contain hyphens in the middle - * Must not exceed 63 characters. Required. + :param agent_name: The name of the agent to create a session for. Required. :type agent_name: str :param body: Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentVersionDetails + :return: AgentSessionResource. The AgentSessionResource is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentSessionResource :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def create_version_from_manifest( + def create_session( self, agent_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateSessionRequest, IO[bytes]] = _Unset, *, - manifest_id: str = _Unset, - parameter_values: dict[str, Any] = _Unset, - metadata: Optional[dict[str, str]] = None, - description: Optional[str] = None, + version_indicator: _models.VersionIndicator = _Unset, + agent_session_id: Optional[str] = None, **kwargs: Any - ) -> _models.AgentVersionDetails: - """Create an agent version from manifest. - - Imports the provided manifest to create a new version for the specified agent. + ) -> _models.AgentSessionResource: + """Create a session. - :param agent_name: The unique name that identifies the agent. Name can be used to - retrieve/update/delete the agent. + Creates a new session for an agent endpoint. The endpoint resolves the backing agent version + from ``version_indicator`` and enforces session ownership using the provided user identity for + session-mutating operations. - * Must start and end with alphanumeric characters, - * Can contain hyphens in the middle - * Must not exceed 63 characters. Required. + :param agent_name: The name of the agent to create a session for. Required. :type agent_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword manifest_id: The manifest ID to import the agent version from. Required. - :paramtype manifest_id: str - :keyword parameter_values: The inputs to the manifest that will result in a fully materialized - Agent. Required. - :paramtype parameter_values: dict[str, any] - :keyword 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. Default value is None. - :paramtype metadata: dict[str, str] - :keyword description: A human-readable description of the agent. Default value is None. - :paramtype description: str - :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentVersionDetails + :param body: Is one of the following types: JSON, CreateSessionRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.CreateSessionRequest or IO[bytes] + :keyword version_indicator: Determines which agent version backs the session. Required. + :paramtype version_indicator: ~azure.ai.projects.models.VersionIndicator + :keyword agent_session_id: Optional caller-provided session ID. If specified, it must be unique + within the agent endpoint. Auto-generated if omitted. Default value is None. + :paramtype agent_session_id: str + :return: AgentSessionResource. The AgentSessionResource is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentSessionResource :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4267,19 +5786,12 @@ def create_version_from_manifest( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AgentVersionDetails] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentSessionResource] = kwargs.pop("cls", None) if body is _Unset: - if manifest_id is _Unset: - raise TypeError("missing required argument: manifest_id") - if parameter_values is _Unset: - raise TypeError("missing required argument: parameter_values") - body = { - "description": description, - "manifest_id": manifest_id, - "metadata": metadata, - "parameter_values": parameter_values, - } + if version_indicator is _Unset: + raise TypeError("missing required argument: version_indicator") + body = {"agent_session_id": agent_session_id, "version_indicator": version_indicator} body = {k: v for k, v in body.items() if v is not None} content_type = content_type or "application/json" _content = None @@ -4288,7 +5800,7 @@ def create_version_from_manifest( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_agents_create_version_from_manifest_request( + _request = build_agents_create_session_request( agent_name=agent_name, content_type=content_type, api_version=self._config.api_version, @@ -4309,7 +5821,7 @@ def create_version_from_manifest( response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [201]: if _stream: try: response.read() # Load the body in memory and close the socket @@ -4325,7 +5837,7 @@ def create_version_from_manifest( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.AgentVersionDetails, response.json()) + deserialized = _deserialize(_models.AgentSessionResource, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4333,17 +5845,17 @@ def create_version_from_manifest( return deserialized # type: ignore @distributed_trace - def get_version(self, agent_name: str, agent_version: str, **kwargs: Any) -> _models.AgentVersionDetails: - """Get an agent version. + def get_session(self, agent_name: str, session_id: str, **kwargs: Any) -> _models.AgentSessionResource: + """Get a session. - Retrieves the specified version of an agent by its agent name and version identifier. + Retrieves the details of a hosted agent session by agent name and session identifier. - :param agent_name: The name of the agent to retrieve. Required. + :param agent_name: The name of the agent. Required. :type agent_name: str - :param agent_version: The version of the agent to retrieve. Required. - :type agent_version: str - :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentVersionDetails + :param session_id: The session identifier. Required. + :type session_id: str + :return: AgentSessionResource. The AgentSessionResource is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentSessionResource :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4357,11 +5869,11 @@ def get_version(self, agent_name: str, agent_version: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.AgentVersionDetails] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentSessionResource] = kwargs.pop("cls", None) - _request = build_agents_get_version_request( + _request = build_agents_get_session_request( agent_name=agent_name, - agent_version=agent_version, + session_id=session_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4395,7 +5907,7 @@ def get_version(self, agent_name: str, agent_version: str, **kwargs: Any) -> _mo if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.AgentVersionDetails, response.json()) + deserialized = _deserialize(_models.AgentSessionResource, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4403,27 +5915,20 @@ def get_version(self, agent_name: str, agent_version: str, **kwargs: Any) -> _mo return deserialized # type: ignore @distributed_trace - def delete_version( - self, agent_name: str, agent_version: str, *, force: Optional[bool] = None, **kwargs: Any - ) -> _models.DeleteAgentVersionResponse: - """Delete an agent version. + def delete_session( # pylint: disable=inconsistent-return-statements + self, agent_name: str, session_id: str, **kwargs: Any + ) -> None: + """Delete a session. - Deletes a specific version of an agent. For hosted agents, if the version has active sessions, - the request is rejected with HTTP 409 unless ``force`` is set to true. When force is true, all - sessions associated with this version are cascade-deleted. + Deletes a session synchronously. Returns 204 No Content when the session is deleted or does not + exist. - :param agent_name: The name of the agent to delete. Required. + :param agent_name: The name of the agent. Required. :type agent_name: str - :param agent_version: The version of the agent to delete. Required. - :type agent_version: str - :keyword force: For Hosted Agents, if ``true``, force-deletes the version even if it has active - sessions, cascading deletion to all associated sessions. The service defaults to ``false`` if a - value is not specified by the caller. This value is not relevant for other Agent types. Default - value is None. - :paramtype force: bool - :return: DeleteAgentVersionResponse. The DeleteAgentVersionResponse is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.DeleteAgentVersionResponse + :param session_id: The session identifier. Required. + :type session_id: str + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4437,12 +5942,11 @@ def delete_version( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DeleteAgentVersionResponse] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_agents_delete_version_request( + _request = build_agents_delete_session_request( agent_name=agent_name, - agent_version=agent_version, - force=force, + session_id=session_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4452,20 +5956,14 @@ def delete_version( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _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 + 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, @@ -4473,32 +5971,84 @@ def delete_version( ) raise HttpResponseError(response=response, model=error) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.DeleteAgentVersionResponse, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, None, {}) # type: ignore - return deserialized # type: ignore + @distributed_trace + def stop_session( # pylint: disable=inconsistent-return-statements + self, agent_name: str, session_id: str, **kwargs: Any + ) -> None: + """Stop a session. + + Terminates the specified hosted agent session and returns 204 No Content when the request + succeeds. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param session_id: The session identifier. Required. + :type session_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_agents_stop_session_request( + agent_name=agent_name, + session_id=session_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_versions( + def list_sessions( self, agent_name: str, *, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, before: Optional[str] = None, - include_drafts: Optional[bool] = None, **kwargs: Any - ) -> ItemPaged["_models.AgentVersionDetails"]: - """List agent versions. + ) -> ItemPaged["_models.AgentSessionResource"]: + """List sessions for an agent. - Returns a paged collection of versions for the specified agent. + Returns a paged collection of sessions associated with the specified agent endpoint. - :param agent_name: The name of the agent to retrieve versions for. Required. + :param agent_name: The name of the 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 @@ -4514,18 +6064,14 @@ def list_versions( subsequent call can include before=obj_foo in order to fetch the previous page of the list. Default value is None. :paramtype before: str - :keyword include_drafts: (Preview) Whether to include draft versions in the listing. The - service defaults to ``false`` if a value is not specified by the caller (only non-draft - versions are returned). Default value is None. - :paramtype include_drafts: bool - :return: An iterator like instance of AgentVersionDetails - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.AgentVersionDetails] + :return: An iterator like instance of AgentSessionResource + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.AgentSessionResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.AgentVersionDetails]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.AgentSessionResource]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4537,13 +6083,12 @@ def list_versions( def prepare_request(_continuation_token=None): - _request = build_agents_list_versions_request( + _request = build_agents_list_sessions_request( agent_name=agent_name, limit=limit, order=order, after=_continuation_token, before=before, - include_drafts=include_drafts, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4557,7 +6102,7 @@ def prepare_request(_continuation_token=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.AgentVersionDetails], + List[_models.AgentSessionResource], deserialized.get("data", []), ) if cls: @@ -4585,98 +6130,47 @@ def get_next(_continuation_token=None): return ItemPaged(get_next, extract_data) - @overload - def update_details( - self, - agent_name: str, - *, - content_type: str = "application/merge-patch+json", - agent_endpoint: Optional[_models.AgentEndpointConfig] = None, - agent_card: Optional[_models.AgentCard] = None, - **kwargs: Any - ) -> _models.AgentDetails: - """Update an agent endpoint. + @distributed_trace + def get_session_log_stream( + self, agent_name: str, agent_version: str, session_id: str, **kwargs: Any + ) -> _models.SessionLogEvent: + """Stream console logs for a hosted agent session. - Applies a merge-patch update to the specified agent endpoint configuration. + Streams console logs (stdout / stderr) for a specific hosted agent session + as a Server-Sent Events (SSE) stream. - :param agent_name: The name of the agent to retrieve. Required. - :type agent_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/merge-patch+json". - :paramtype content_type: str - :keyword agent_endpoint: The endpoint configuration for the agent. Default value is None. - :paramtype agent_endpoint: ~azure.ai.projects.models.AgentEndpointConfig - :keyword agent_card: Optional agent card for the agent. Default value is None. - :paramtype agent_card: ~azure.ai.projects.models.AgentCard - :return: AgentDetails. The AgentDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ + Each SSE frame contains: - @overload - def update_details( - self, agent_name: str, body: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> _models.AgentDetails: - """Update an agent endpoint. + * `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) - Applies a merge-patch update to the specified agent endpoint configuration. + Example SSE frames: - :param agent_name: The name of the agent to retrieve. Required. - :type agent_name: str - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/merge-patch+json". - :paramtype content_type: str - :return: AgentDetails. The AgentDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ + .. code-block:: - @overload - def update_details( - self, agent_name: str, body: IO[bytes], *, content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> _models.AgentDetails: - """Update an agent endpoint. + event: log + data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting FoundryCBAgent server on port 8088"} - Applies a merge-patch update to the specified agent endpoint configuration. + event: log + data: {"timestamp":"2026-03-10T09:33:17.130Z","stream":"stderr","message":"INFO: Application startup complete."} - :param agent_name: The name of the agent to retrieve. Required. - :type agent_name: str - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/merge-patch+json". - :paramtype content_type: str - :return: AgentDetails. The AgentDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ + event: log + data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully connected to container"} - @distributed_trace - def update_details( - self, - agent_name: str, - body: Union[JSON, IO[bytes]] = _Unset, - *, - agent_endpoint: Optional[_models.AgentEndpointConfig] = None, - agent_card: Optional[_models.AgentCard] = None, - **kwargs: Any - ) -> _models.AgentDetails: - """Update an agent endpoint. + event: log + data: {"timestamp":"2026-03-10T09:35:52.714Z","stream":"status","message":"No logs since last 60 seconds"} - Applies a merge-patch update to the specified agent endpoint configuration. + The stream remains open until the client disconnects or the server + terminates the connection. Clients should handle reconnection as needed. - :param agent_name: The name of the agent to retrieve. Required. + :param agent_name: The name of the hosted agent. Required. :type agent_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword agent_endpoint: The endpoint configuration for the agent. Default value is None. - :paramtype agent_endpoint: ~azure.ai.projects.models.AgentEndpointConfig - :keyword agent_card: Optional agent card for the agent. Default value is None. - :paramtype agent_card: ~azure.ai.projects.models.AgentCard - :return: AgentDetails. The AgentDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentDetails + :param agent_version: The version of the agent. Required. + :type agent_version: str + :param session_id: The session ID (maps to an ADC sandbox). Required. + :type session_id: str + :return: SessionLogEvent. The SessionLogEvent is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.SessionLogEvent :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4687,27 +6181,16 @@ def update_details( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AgentDetails] = kwargs.pop("cls", None) - - if body is _Unset: - body = {"agent_card": agent_card, "agent_endpoint": agent_endpoint} - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/merge-patch+json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.SessionLogEvent] = kwargs.pop("cls", None) - _request = build_agents_update_details_request( + _request = build_agents_get_session_log_stream_request( agent_name=agent_name, - content_type=content_type, + agent_version=agent_version, + session_id=session_id, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -4717,7 +6200,7 @@ def update_details( _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 ) @@ -4737,61 +6220,105 @@ def update_details( ) raise HttpResponseError(response=response, model=error) + response_headers = {} + response_headers["Content-Type"] = self._deserialize("str", response.headers.get("Content-Type")) + if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.AgentDetails, response.json()) + deserialized = _deserialize(_models.SessionLogEvent, response.text()) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @overload - def _create_version_from_code( + def upload_session_file( self, agent_name: str, - content: _models._models._CreateAgentVersionFromCodeContent, + session_id: str, + content: bytes, *, - code_zip_sha256: str, + path: str, + content_type: str = "application/octet-stream", **kwargs: Any - ) -> _models.AgentVersionDetails: ... - @overload - def _create_version_from_code( - self, agent_name: str, content: JSON, *, code_zip_sha256: str, **kwargs: Any - ) -> _models.AgentVersionDetails: ... + ) -> _models.SessionFileWriteResult: + """Upload a session file. - @distributed_trace - def _create_version_from_code( + Uploads binary file content to the specified path in the session sandbox. The service stores + the file relative to the session home directory and rejects payloads larger than 50 MB. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param session_id: The session ID. Required. + :type session_id: str + :param content: Required. + :type content: bytes + :keyword path: The destination file path within the sandbox, relative to the session home + directory. Required. + :paramtype path: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/octet-stream". + :paramtype content_type: str + :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.SessionFileWriteResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def upload_session_file( self, agent_name: str, - content: Union[_models._models._CreateAgentVersionFromCodeContent, JSON], + session_id: str, + content: IO[bytes], *, - code_zip_sha256: str, + path: str, + content_type: str = "application/octet-stream", **kwargs: Any - ) -> _models.AgentVersionDetails: - """Create an agent version from code. + ) -> _models.SessionFileWriteResult: + """Upload a session file. - Creates a new agent version from code. Uploads the code zip and creates a new version for an - existing agent. The SHA-256 hex digest of the zip is provided in the ``x-ms-code-zip-sha256`` - header for integrity and dedup. The request body is multipart/form-data with a JSON metadata - part and a binary code part (part order is irrelevant). Maximum upload size is 250 MB. + Uploads binary file content to the specified path in the session sandbox. The service stores + the file relative to the session home directory and rejects payloads larger than 50 MB. - :param agent_name: The unique name that identifies the agent. Name can be used to - retrieve/update/delete the agent. + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param session_id: The session ID. Required. + :type session_id: str + :param content: Required. + :type content: IO[bytes] + :keyword path: The destination file path within the sandbox, relative to the session home + directory. Required. + :paramtype path: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/octet-stream". + :paramtype content_type: str + :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.SessionFileWriteResult + :raises ~azure.core.exceptions.HttpResponseError: + """ - * Must start and end with alphanumeric characters, - * Can contain hyphens in the middle - * Must not exceed 63 characters. Required. + @distributed_trace + def upload_session_file( + self, agent_name: str, session_id: str, content: Union[bytes, IO[bytes]], *, path: str, **kwargs: Any + ) -> _models.SessionFileWriteResult: + """Upload a session file. + + Uploads binary file content to the specified path in the session sandbox. The service stores + the file relative to the session home directory and rejects payloads larger than 50 MB. + + :param agent_name: The name of the agent. Required. :type agent_name: str - :param content: The content multipart request content. Is either a - _CreateAgentVersionFromCodeContent type or a JSON type. Required. - :type content: ~azure.ai.projects.models._models._CreateAgentVersionFromCodeContent or JSON - :keyword code_zip_sha256: SHA-256 hex digest of the uploaded code zip. Used for change - detection (dedup) and integrity verification. Required. - :paramtype code_zip_sha256: str - :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentVersionDetails + :param session_id: The session ID. Required. + :type session_id: str + :param content: Is either a bytes type or a IO[bytes] type. Required. + :type content: bytes or IO[bytes] + :keyword path: The destination file path within the sandbox, relative to the session home + directory. Required. + :paramtype path: str + :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.SessionFileWriteResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4802,21 +6329,22 @@ def _create_version_from_code( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.AgentVersionDetails] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SessionFileWriteResult] = kwargs.pop("cls", None) - _body = content.as_dict() if isinstance(content, _Model) else content - _file_fields: list[str] = ["code"] - _data_fields: list[str] = ["metadata"] - _files = prepare_multipart_form_data(_body, _file_fields, _data_fields) + content_type = content_type or "application/octet-stream" + _content = content - _request = build_agents_create_version_from_code_request( + _request = build_agents_upload_session_file_request( agent_name=agent_name, - code_zip_sha256=code_zip_sha256, + session_id=session_id, + path=path, + content_type=content_type, api_version=self._config.api_version, - files=_files, + content=_content, headers=_headers, params=_params, ) @@ -4833,7 +6361,7 @@ def _create_version_from_code( response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [201]: if _stream: try: response.read() # Load the body in memory and close the socket @@ -4849,7 +6377,7 @@ def _create_version_from_code( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.AgentVersionDetails, response.json()) + deserialized = _deserialize(_models.SessionFileWriteResult, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4857,23 +6385,19 @@ def _create_version_from_code( return deserialized # type: ignore @distributed_trace - def download_code(self, agent_name: str, *, agent_version: Optional[str] = None, **kwargs: Any) -> Iterator[bytes]: - """Download agent code. - - Downloads the code zip for a code-based hosted agent. - Returns the previously-uploaded zip (``application/zip``). - - If ``agent_version`` is supplied, returns that version's code zip; otherwise - returns the latest version's code zip. + def download_session_file(self, agent_name: str, session_id: str, *, path: str, **kwargs: Any) -> Iterator[bytes]: + """Download a session file. - The SHA-256 digest of the returned bytes matches the ``content_hash`` on the - resolved version's ``code_configuration``. + Downloads the file at the specified sandbox path as a binary stream. The path is resolved + relative to the session home directory. :param agent_name: The name of the agent. Required. :type agent_name: str - :keyword agent_version: The version of the agent whose code zip should be downloaded. - If omitted, the latest version's code zip is returned. Default value is None. - :paramtype agent_version: str + :param session_id: The session ID. Required. + :type session_id: str + :keyword path: The file path to download from the sandbox, relative to the session home + directory. Required. + :paramtype path: str :return: Iterator[bytes] :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: @@ -4891,9 +6415,10 @@ def download_code(self, agent_name: str, *, agent_version: Optional[str] = None, cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_agents_download_code_request( + _request = build_agents_download_session_file_request( agent_name=agent_name, - agent_version=agent_version, + session_id=session_id, + path=path, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4924,31 +6449,61 @@ def download_code(self, agent_name: str, *, agent_version: Optional[str] = None, ) raise HttpResponseError(response=response, model=error) - response_headers = {} - response_headers["x-ms-agent-version"] = self._deserialize("str", response.headers.get("x-ms-agent-version")) - 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 cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace - def enable(self, agent_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """Enable an agent. + def list_session_files( + self, + agent_name: str, + session_id: str, + *, + path: Optional[str] = None, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.SessionDirectoryEntry"]: + """List session files. - Enables the specified agent, allowing it to accept new sessions and process requests. This - operation is idempotent — enabling an already-enabled agent returns success with no side - effects. + Returns files and directories at the specified path in the session sandbox. The response + includes only the immediate children of the target directory and defaults to the session home + directory when no path is supplied. - :param agent_name: The name of the agent to enable. Required. + :param agent_name: The name of the agent. Required. :type agent_name: str - :return: None - :rtype: None + :param session_id: The session ID. Required. + :type session_id: str + :keyword path: The directory path to list, relative to the session home directory. Defaults to + the home directory if not provided. Default value is None. + :paramtype path: 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 SessionDirectoryEntry + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.SessionDirectoryEntry] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SessionDirectoryEntry]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -4957,51 +6512,76 @@ def enable(self, agent_name: str, **kwargs: Any) -> None: # pylint: disable=inc } 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) + def prepare_request(_continuation_token=None): - _request = build_agents_enable_request( - agent_name=agent_name, - 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) + _request = build_agents_list_session_files_request( + agent_name=agent_name, + session_id=session_id, + path=path, + 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 - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SessionDirectoryEntry], + deserialized.get("entries", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("last_id") or None, iter(list_of_elem) - response = pipeline_response.http_response + def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) - 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, + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - raise HttpResponseError(response=response, model=error) + response = pipeline_response.http_response - if cls: - return cls(pipeline_response, None, {}) # type: ignore + 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 disable(self, agent_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """Disable an agent. + def delete_session_file( # pylint: disable=inconsistent-return-statements + self, agent_name: str, session_id: str, *, path: str, recursive: Optional[bool] = None, **kwargs: Any + ) -> None: + """Delete a session file. - Disables the specified agent, preventing it from accepting new sessions or processing requests. - Existing active sessions are allowed to drain gracefully but no new sessions can be created. - This operation is idempotent — disabling an already-disabled agent returns success with no side - effects. + Deletes the specified file or directory from the session sandbox. When ``recursive`` is false, + deleting a non-empty directory returns 409 Conflict. - :param agent_name: The name of the agent to disable. Required. + :param agent_name: The name of the agent. Required. :type agent_name: str + :param session_id: The session ID. Required. + :type session_id: str + :keyword path: The file or directory path to delete, relative to the session home directory. + Required. + :paramtype path: str + :keyword recursive: Whether to recursively delete directory contents. The service defaults to + ``false`` if a value is not specified by the caller. Default value is None. + :paramtype recursive: bool :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -5019,8 +6599,11 @@ def disable(self, agent_name: str, **kwargs: Any) -> None: # pylint: disable=in cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_agents_disable_request( + _request = build_agents_delete_session_file_request( agent_name=agent_name, + session_id=session_id, + path=path, + recursive=recursive, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5048,108 +6631,71 @@ def disable(self, agent_name: str, **kwargs: Any) -> None: # pylint: disable=in if cls: return cls(pipeline_response, None, {}) # type: ignore - @overload - def create_session( - self, - agent_name: str, - *, - version_indicator: _models.VersionIndicator, - content_type: str = "application/json", - agent_session_id: Optional[str] = None, - **kwargs: Any - ) -> _models.AgentSessionResource: - """Create a session. - - Creates a new session for an agent endpoint. The endpoint resolves the backing agent version - from ``version_indicator`` and enforces session ownership using the provided user identity for - session-mutating operations. - - :param agent_name: The name of the agent to create a session for. Required. - :type agent_name: str - :keyword version_indicator: Determines which agent version backs the session. Required. - :paramtype version_indicator: ~azure.ai.projects.models.VersionIndicator - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword agent_session_id: Optional caller-provided session ID. If specified, it must be unique - within the agent endpoint. Auto-generated if omitted. Default value is None. - :paramtype agent_session_id: str - :return: AgentSessionResource. The AgentSessionResource is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentSessionResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_session( - self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.AgentSessionResource: - """Create a session. - - Creates a new session for an agent endpoint. The endpoint resolves the backing agent version - from ``version_indicator`` and enforces session ownership using the provided user identity for - session-mutating operations. - - :param agent_name: The name of the agent to create a session for. Required. - :type agent_name: str - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: AgentSessionResource. The AgentSessionResource is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentSessionResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - @overload - def create_session( - self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.AgentSessionResource: - """Create a session. +class VoiceAgentWebSocketOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. - Creates a new session for an agent endpoint. The endpoint resolves the backing agent version - from ``version_indicator`` and enforces session ownership using the provided user identity for - session-mutating operations. + Instead, you should access the following operations through + :class:`~azure.ai.projects.AIProjectClient`'s + :attr:`voice_agent_web_socket` attribute. + """ - :param agent_name: The name of the agent to create a session for. Required. - :type agent_name: str - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: AgentSessionResource. The AgentSessionResource is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentSessionResource - :raises ~azure.core.exceptions.HttpResponseError: - """ + 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 create_session( + def connect_voice_agent( # pylint: disable=inconsistent-return-statements self, agent_name: str, - body: Union[JSON, IO[bytes]] = _Unset, *, - version_indicator: _models.VersionIndicator = _Unset, agent_session_id: Optional[str] = None, + store: Optional[bool] = None, + agent_version_override: Optional[str] = None, + websocket_subprotocol: Optional[Union[str, _models.VoiceAgentWebSocketSubprotocol]] = None, + structured_inputs: Optional[str] = None, **kwargs: Any - ) -> _models.AgentSessionResource: - """Create a session. + ) -> None: + """Connect to a voice agent. + + Connects to a voice agent over WebSocket. The client must send an HTTP GET with ``Upgrade: + websocket`` + headers. The optional ``realtime`` subprotocol is the only accepted subprotocol value. - Creates a new session for an agent endpoint. The endpoint resolves the backing agent version - from ``version_indicator`` and enforces session ownership using the provided user identity for - session-mutating operations. + If the target agent is disabled, the HTTP WebSocket handshake fails before the ``101 Switching + Protocols`` + upgrade. The service returns ``409 Conflict`` using the shared Foundry ``ApiErrorResponse`` + shape with + ``error.code = agent_disabled``. This failure is terminal until the caller enables the agent. - :param agent_name: The name of the agent to create a session for. Required. + :param agent_name: The name of the voice agent. Required. :type agent_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword version_indicator: Determines which agent version backs the session. Required. - :paramtype version_indicator: ~azure.ai.projects.models.VersionIndicator - :keyword agent_session_id: Optional caller-provided session ID. If specified, it must be unique - within the agent endpoint. Auto-generated if omitted. Default value is None. + :keyword agent_session_id: An optional identifier used to correlate the voice session. Default + value is None. :paramtype agent_session_id: str - :return: AgentSessionResource. The AgentSessionResource is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentSessionResource + :keyword store: Whether to persist the conversation created by this WebSocket session. If + omitted, the service honors the + persisted voice agent definition's configured ``store`` value. If supplied, this value + overrides the + definition's ``store`` setting for this session only. Default value is None. + :paramtype store: bool + :keyword agent_version_override: Selects a specific version of the voice agent for this + session. Default value is None. + :paramtype agent_version_override: str + :keyword websocket_subprotocol: The requested WebSocket subprotocol. Omit this header or + request exactly ``realtime``. "realtime" Default value is None. + :paramtype websocket_subprotocol: str or + ~azure.ai.projects.models.VoiceAgentWebSocketSubprotocol + :keyword structured_inputs: A JSON object that maps structured-input names to their values for + this session. Default value is None. + :paramtype structured_inputs: str + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5160,29 +6706,19 @@ def create_session( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AgentSessionResource] = kwargs.pop("cls", None) - - if body is _Unset: - if version_indicator is _Unset: - raise TypeError("missing required argument: version_indicator") - body = {"agent_session_id": agent_session_id, "version_indicator": version_indicator} - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_agents_create_session_request( + _request = build_voice_agent_web_socket_connect_voice_agent_request( agent_name=agent_name, - content_type=content_type, + agent_session_id=agent_session_id, + store=store, + agent_version_override=agent_version_override, + websocket_subprotocol=websocket_subprotocol, + structured_inputs=structured_inputs, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -5191,20 +6727,14 @@ def create_session( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _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 [201]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [101]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ApiErrorResponse, @@ -5212,28 +6742,142 @@ def create_session( ) raise HttpResponseError(response=response, model=error) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.AgentSessionResource, response.json()) + response_headers = {} + response_headers["Sec-WebSocket-Protocol"] = self._deserialize( + "str", response.headers.get("Sec-WebSocket-Protocol") + ) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, None, response_headers) # type: ignore - return deserialized # type: ignore + +class AgentEndpointConversationsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.AIProjectClient`'s + :attr:`agent_endpoint_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 get_session(self, agent_name: str, session_id: str, **kwargs: Any) -> _models.AgentSessionResource: - """Get a session. + def list_agent_conversations( + self, + agent_name: str, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.VoiceConversation"]: + """List voice agent conversations. - Retrieves the details of a hosted agent session by agent name and session identifier. + Returns the conversations persisted for the specified voice agent endpoint. Conversations are + present only when the agent definition has ``store = true``. :param agent_name: The name of the agent. Required. :type agent_name: str - :param session_id: The session identifier. Required. - :type session_id: str - :return: AgentSessionResource. The AgentSessionResource is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentSessionResource + :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 VoiceConversation + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.VoiceConversation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VoiceConversation]] = 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_agent_endpoint_conversations_list_agent_conversations_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.VoiceConversation], + 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_agent_conversation(self, agent_name: str, conversation_id: str, **kwargs: Any) -> _models.VoiceConversation: + """Get a voice agent conversation. + + Retrieves a single conversation recorded for the specified voice agent endpoint by its id. + Returns ``404`` when the conversation was not persisted (``store = false``) or does not exist. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation to retrieve. Required. + :type conversation_id: str + :return: VoiceConversation. The VoiceConversation is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceConversation :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5247,11 +6891,11 @@ def get_session(self, agent_name: str, session_id: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.AgentSessionResource] = kwargs.pop("cls", None) + cls: ClsType[_models.VoiceConversation] = kwargs.pop("cls", None) - _request = build_agents_get_session_request( + _request = build_agent_endpoint_conversations_get_agent_conversation_request( agent_name=agent_name, - session_id=session_id, + conversation_id=conversation_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5285,7 +6929,7 @@ def get_session(self, agent_name: str, session_id: str, **kwargs: Any) -> _model if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.AgentSessionResource, response.json()) + deserialized = _deserialize(_models.VoiceConversation, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -5293,18 +6937,18 @@ def get_session(self, agent_name: str, session_id: str, **kwargs: Any) -> _model return deserialized # type: ignore @distributed_trace - def delete_session( # pylint: disable=inconsistent-return-statements - self, agent_name: str, session_id: str, **kwargs: Any + def delete_agent_conversation( # pylint: disable=inconsistent-return-statements + self, agent_name: str, conversation_id: str, **kwargs: Any ) -> None: - """Delete a session. + """Delete a voice agent conversation. - Deletes a session synchronously. Returns 204 No Content when the session is deleted or does not - exist. + Deletes a conversation and all of its stored data — responses, items, and any audio (cascade). + This is the customer's explicit data-deletion control for voice conversations. :param agent_name: The name of the agent. Required. :type agent_name: str - :param session_id: The session identifier. Required. - :type session_id: str + :param conversation_id: The id of the conversation to delete. Required. + :type conversation_id: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -5322,9 +6966,9 @@ def delete_session( # pylint: disable=inconsistent-return-statements cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_agents_delete_session_request( + _request = build_agent_endpoint_conversations_delete_agent_conversation_request( agent_name=agent_name, - session_id=session_id, + conversation_id=conversation_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5349,24 +6993,130 @@ def delete_session( # pylint: disable=inconsistent-return-statements ) raise HttpResponseError(response=response, model=error) - if cls: - return cls(pipeline_response, None, {}) # type: ignore + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_agent_conversation_responses( + 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.VoiceResponse"]: + """List responses in a voice agent conversation. + + Returns a paged collection of the responses (model inference turns) recorded for the specified + conversation. The per-response ``output`` projection may be omitted here; use the + response-items route for the canonical paged output. Returns ``404`` when the conversation was + not persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose responses are listed. 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 VoiceResponse + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.VoiceResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VoiceResponse]] = 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_agent_endpoint_conversations_list_agent_conversation_responses_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.VoiceResponse], + 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 stop_session( # pylint: disable=inconsistent-return-statements - self, agent_name: str, session_id: str, **kwargs: Any - ) -> None: - """Stop a session. + def get_agent_conversation_response( + self, agent_name: str, conversation_id: str, response_id: str, **kwargs: Any + ) -> _models.VoiceResponse: + """Get a voice agent conversation response. - Terminates the specified hosted agent session and returns 204 No Content when the request - succeeds. + Retrieves a single response from the specified conversation by its id, including its ``output`` + items, ``usage``, and status. Returns ``404`` when the conversation or response was not + persisted (``store = false``). :param agent_name: The name of the agent. Required. :type agent_name: str - :param session_id: The session identifier. Required. - :type session_id: str - :return: None - :rtype: None + :param conversation_id: The id of the conversation that contains the response. Required. + :type conversation_id: str + :param response_id: The id of the response to retrieve. Required. + :type response_id: str + :return: VoiceResponse. The VoiceResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5380,11 +7130,12 @@ def stop_session( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[_models.VoiceResponse] = kwargs.pop("cls", None) - _request = build_agents_stop_session_request( + _request = build_agent_endpoint_conversations_get_agent_conversation_response_request( agent_name=agent_name, - session_id=session_id, + conversation_id=conversation_id, + response_id=response_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5394,14 +7145,20 @@ def stop_session( # pylint: disable=inconsistent-return-statements } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _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 [204]: + 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, @@ -5409,25 +7166,41 @@ def stop_session( # pylint: disable=inconsistent-return-statements ) raise HttpResponseError(response=response, model=error) + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VoiceResponse, response.json()) + if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore @distributed_trace - def list_sessions( + def list_agent_conversation_response_items( self, agent_name: str, + conversation_id: str, + response_id: str, *, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, before: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.AgentSessionResource"]: - """List sessions for an agent. + ) -> ItemPaged["_models.VoiceConversationItem"]: + """List items produced by a voice agent conversation response. - Returns a paged collection of sessions associated with the specified agent endpoint. + Returns a paged collection of the output items produced by a specific response (the response's + output projection). For the complete ordered conversation history — including user input and + client-created tool outputs — use the conversation items route instead. Returns ``404`` when + the conversation or response was not persisted (``store = false``). :param agent_name: The name of the agent. Required. :type agent_name: str + :param conversation_id: The id of the conversation that contains the response. Required. + :type conversation_id: str + :param response_id: The id of the response whose output items are listed. Required. + :type response_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. @@ -5442,14 +7215,14 @@ def list_sessions( 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 AgentSessionResource - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.AgentSessionResource] + :return: An iterator like instance of VoiceConversationItem + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.VoiceConversationItem] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.AgentSessionResource]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.VoiceConversationItem]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5461,8 +7234,10 @@ def list_sessions( def prepare_request(_continuation_token=None): - _request = build_agents_list_sessions_request( + _request = build_agent_endpoint_conversations_list_agent_conversation_response_items_request( agent_name=agent_name, + conversation_id=conversation_id, + response_id=response_id, limit=limit, order=order, after=_continuation_token, @@ -5480,7 +7255,7 @@ def prepare_request(_continuation_token=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.AgentSessionResource], + List[_models.VoiceConversationItem], deserialized.get("data", []), ) if cls: @@ -5509,46 +7284,127 @@ def get_next(_continuation_token=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_session_log_stream( - self, agent_name: str, agent_version: str, session_id: str, **kwargs: Any - ) -> _models.SessionLogEvent: - """Stream console logs for a hosted agent session. + def list_agent_conversation_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.VoiceConversationItem"]: + """List items in a voice agent conversation. - Streams console logs (stdout / stderr) for a specific hosted agent session - as a Server-Sent Events (SSE) stream. + Returns a paged collection of items — the complete ordered conversation history, including user + input, assistant output, and client-created tool outputs (transcripts + tool events). Returns + ``404`` when the conversation was not persisted (``store = false``). - Each SSE frame contains: + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose items are listed. 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 VoiceConversationItem + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.VoiceConversationItem] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - * `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) + cls: ClsType[List[_models.VoiceConversationItem]] = kwargs.pop("cls", None) - Example SSE frames: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - .. code-block:: + def prepare_request(_continuation_token=None): - event: log - data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting FoundryCBAgent server on port 8088"} + _request = build_agent_endpoint_conversations_list_agent_conversation_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 - event: log - data: {"timestamp":"2026-03-10T09:33:17.130Z","stream":"stderr","message":"INFO: Application startup complete."} + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.VoiceConversationItem], + 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) - event: log - data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully connected to container"} + def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) - event: log - data: {"timestamp":"2026-03-10T09:35:52.714Z","stream":"status","message":"No logs since last 60 seconds"} + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response - The stream remains open until the client disconnects or the server - terminates the connection. Clients should handle reconnection as needed. + 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) - :param agent_name: The name of the hosted agent. Required. + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get_agent_conversation_item( + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.VoiceConversationItem: + """Get a voice agent conversation item. + + Retrieves a single item from the specified conversation by its id, including its transcript. An + ``input_audio``/``output_audio`` content part indicates that audio is available for the item; + the canonical per-item audio metadata is the ``/items/{item_id}/audio`` resource, and the bytes + are streamed by ``/items/{item_id}/audio/content``. Returns ``404`` when the conversation or + item was not persisted (``store = false``). + + :param agent_name: The name of the agent. Required. :type agent_name: str - :param agent_version: The version of the agent. Required. - :type agent_version: str - :param session_id: The session ID (maps to an ADC sandbox). Required. - :type session_id: str - :return: SessionLogEvent. The SessionLogEvent is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.SessionLogEvent + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item to retrieve. Required. + :type item_id: str + :return: VoiceConversationItem. The VoiceConversationItem is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceConversationItem :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5562,12 +7418,12 @@ def get_session_log_stream( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.SessionLogEvent] = kwargs.pop("cls", None) + cls: ClsType[_models.VoiceConversationItem] = kwargs.pop("cls", None) - _request = build_agents_get_session_log_stream_request( + _request = build_agent_endpoint_conversations_get_agent_conversation_item_request( agent_name=agent_name, - agent_version=agent_version, - session_id=session_id, + conversation_id=conversation_id, + item_id=item_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5578,7 +7434,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 ) @@ -5598,39 +7454,38 @@ def get_session_log_stream( ) raise HttpResponseError(response=response, model=error) - response_headers = {} - response_headers["Content-Type"] = self._deserialize("str", response.headers.get("Content-Type")) - if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.SessionLogEvent, response.text()) + deserialized = _deserialize(_models.VoiceConversationItem, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace - def upload_session_file( - self, agent_name: str, session_id: str, content: bytes, *, path: str, **kwargs: Any - ) -> _models.SessionFileWriteResult: - """Upload a session file. - - Uploads binary file content to the specified path in the session sandbox. The service stores - the file relative to the session home directory and rejects payloads larger than 50 MB. + def get_agent_conversation_item_audio( + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.VoiceItemAudioResponse: + """Get a voice agent conversation item's audio metadata. + + Returns metadata for a single conversation item's audio segment, including the common playback + facts (role, format/codec, sample rate, channels, offset, duration) for both Foundry-managed + and bring-your-own-storage (BYOS) recordings; for BYOS the response additionally includes + ``blob_uri``, the URI of the recording in the customer's own storage (no SAS) that the customer + downloads with their own credentials. Requires the conversation to have persisted audio + (``store = true``); returns ``404`` when the conversation, item, or its audio was not + persisted. :param agent_name: The name of the agent. Required. :type agent_name: str - :param session_id: The session ID. Required. - :type session_id: str - :param content: Required. - :type content: bytes - :keyword path: The destination file path within the sandbox, relative to the session home - directory. Required. - :paramtype path: str - :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.SessionFileWriteResult + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose audio metadata is retrieved. Required. + :type item_id: str + :return: VoiceItemAudioResponse. The VoiceItemAudioResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceItemAudioResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5641,21 +7496,16 @@ def upload_session_file( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/octet-stream")) - cls: ClsType[_models.SessionFileWriteResult] = kwargs.pop("cls", None) - - _content = content + cls: ClsType[_models.VoiceItemAudioResponse] = kwargs.pop("cls", None) - _request = build_agents_upload_session_file_request( + _request = build_agent_endpoint_conversations_get_agent_conversation_item_audio_request( agent_name=agent_name, - session_id=session_id, - path=path, - content_type=content_type, + conversation_id=conversation_id, + item_id=item_id, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -5672,7 +7522,7 @@ def upload_session_file( response = pipeline_response.http_response - if response.status_code not in [201]: + if response.status_code not in [200]: if _stream: try: response.read() # Load the body in memory and close the socket @@ -5688,7 +7538,7 @@ def upload_session_file( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.SessionFileWriteResult, response.json()) + deserialized = _deserialize(_models.VoiceItemAudioResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -5696,19 +7546,24 @@ def upload_session_file( return deserialized # type: ignore @distributed_trace - def download_session_file(self, agent_name: str, session_id: str, *, path: str, **kwargs: Any) -> Iterator[bytes]: - """Download a session file. + def get_agent_conversation_item_audio_content( # pylint: disable=name-too-long + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> Iterator[bytes]: + """Stream a voice agent conversation item's audio. - Downloads the file at the specified sandbox path as a binary stream. The path is resolved - relative to the session home directory. + Streams a single conversation item's audio as a WAV (``audio/wav``) byte stream through the + service (no SAS URL). This route serves Foundry-managed storage only. For + bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download + directly from customer storage using the ``blob_uri`` returned by the item's ``/audio`` + metadata route — so this route returns ``409 Conflict`` for BYOS recordings. Returns ``404`` + when the conversation, item, or its audio was not persisted (``store = false``). :param agent_name: The name of the agent. Required. :type agent_name: str - :param session_id: The session ID. Required. - :type session_id: str - :keyword path: The file path to download from the sandbox, relative to the session home - directory. Required. - :paramtype path: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose audio is streamed. Required. + :type item_id: str :return: Iterator[bytes] :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: @@ -5726,10 +7581,10 @@ def download_session_file(self, agent_name: str, session_id: str, *, path: str, cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_agents_download_session_file_request( + _request = build_agent_endpoint_conversations_get_agent_conversation_item_audio_content_request( agent_name=agent_name, - session_id=session_id, - path=path, + conversation_id=conversation_id, + item_id=item_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5760,61 +7615,44 @@ def download_session_file(self, agent_name: str, session_id: str, *, path: str, ) 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, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace - def list_session_files( - self, - agent_name: str, - session_id: str, - *, - path: Optional[str] = None, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.SessionDirectoryEntry"]: - """List session files. - - Returns files and directories at the specified path in the session sandbox. The response - includes only the immediate children of the target directory and defaults to the session home - directory when no path is supplied. + def get_agent_conversation_audio( + self, agent_name: str, conversation_id: str, **kwargs: Any + ) -> _models.VoiceRecordingResponse: + """Get a voice agent conversation's merged recording metadata. + + Returns metadata for the whole-call merged stereo recording (user audio on the left channel, + agent audio on the right). The common metadata (format, sample rate, channels, channel layout, + duration) is returned for both Foundry-managed and bring-your-own-storage (BYOS) recordings; + for BYOS the response additionally includes ``blob_uri``, the URI of the recording in the + customer's own storage (no SAS) that the customer downloads with their own credentials. The + recording is built once from the per-turn segments after persistence finalization succeeds. + While the conversation is ``in_progress``, this route returns retriable ``409 Conflict`` with + ``error.code = recording_not_ready`` and a ``Retry-After`` header when retry guidance is + available. When the conversation is ``failed``, it returns terminal ``409 Conflict`` with + ``error.code = recording_unavailable``. For a ``completed`` conversation, metadata is available + subject to the existing BYOS behavior. Requires the conversation to have persisted audio + (``store = true``); otherwise returns ``404``. :param agent_name: The name of the agent. Required. :type agent_name: str - :param session_id: The session ID. Required. - :type session_id: str - :keyword path: The directory path to list, relative to the session home directory. Defaults to - the home directory if not provided. Default value is None. - :paramtype path: 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 SessionDirectoryEntry - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.SessionDirectoryEntry] + :param conversation_id: The id of the conversation whose merged recording metadata is + retrieved. Required. + :type conversation_id: str + :return: VoiceRecordingResponse. The VoiceRecordingResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceRecordingResponse :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.SessionDirectoryEntry]] = kwargs.pop("cls", None) - error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -5823,78 +7661,78 @@ def list_session_files( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(_continuation_token=None): + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VoiceRecordingResponse] = kwargs.pop("cls", None) - _request = build_agents_list_session_files_request( - agent_name=agent_name, - session_id=session_id, - path=path, - 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 + _request = build_agent_endpoint_conversations_get_agent_conversation_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) - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.SessionDirectoryEntry], - deserialized.get("entries", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("last_id") or None, iter(list_of_elem) + _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 + ) - def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) + response = pipeline_response.http_response - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + 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, ) - response = pipeline_response.http_response + raise HttpResponseError(response=response, model=error) - 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) + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VoiceRecordingResponse, response.json()) - return pipeline_response + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore - return ItemPaged(get_next, extract_data) + return deserialized # type: ignore @distributed_trace - def delete_session_file( # pylint: disable=inconsistent-return-statements - self, agent_name: str, session_id: str, *, path: str, recursive: Optional[bool] = None, **kwargs: Any - ) -> None: - """Delete a session file. - - Deletes the specified file or directory from the session sandbox. When ``recursive`` is false, - deleting a non-empty directory returns 409 Conflict. + def get_agent_conversation_audio_content( + self, agent_name: str, conversation_id: str, **kwargs: Any + ) -> Iterator[bytes]: + """Stream a voice agent conversation's merged recording. + + Streams the whole-call merged stereo recording as a WAV (``audio/wav``) byte stream through the + service (no SAS URL). This route serves Foundry-managed storage only. For + bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download + directly from customer storage using the ``blob_uri`` returned by the metadata route — so this + route returns ``409 Conflict`` for BYOS recordings. While the conversation is ``in_progress``, + this route returns retriable ``409 Conflict`` with ``error.code = recording_not_ready`` and a + ``Retry-After`` header when retry guidance is available. When the conversation is ``failed``, + it returns terminal ``409 Conflict`` with ``error.code = recording_unavailable``. For a + ``completed`` conversation, content is available subject to the existing BYOS behavior. A + conversation without persisted audio (``store = false``) returns ``404``. :param agent_name: The name of the agent. Required. :type agent_name: str - :param session_id: The session ID. Required. - :type session_id: str - :keyword path: The file or directory path to delete, relative to the session home directory. + :param conversation_id: The id of the conversation whose merged recording is streamed. Required. - :paramtype path: str - :keyword recursive: Whether to recursively delete directory contents. The service defaults to - ``false`` if a value is not specified by the caller. Default value is None. - :paramtype recursive: bool - :return: None - :rtype: None + :type conversation_id: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5908,13 +7746,11 @@ def delete_session_file( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_agents_delete_session_file_request( + _request = build_agent_endpoint_conversations_get_agent_conversation_audio_content_request( agent_name=agent_name, - session_id=session_id, - path=path, - recursive=recursive, + conversation_id=conversation_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5924,14 +7760,20 @@ def delete_session_file( # pylint: disable=inconsistent-return-statements } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _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 [204]: + 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, @@ -5939,11 +7781,18 @@ def delete_session_file( # pylint: disable=inconsistent-return-statements ) 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, None, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore -class EvaluationRulesOperations: +class EvaluationRulesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -6095,7 +7944,7 @@ def create_or_update( @overload def create_or_update( - self, id: str, evaluation_rule: JSON, *, content_type: str = "application/json", **kwargs: Any + self, id: str, evaluation_rule: _types.EvaluationRule, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationRule: """Create or update an evaluation rule. @@ -6104,7 +7953,7 @@ def create_or_update( :param id: Unique identifier for the evaluation rule. Required. :type id: str :param evaluation_rule: Evaluation rule resource. Required. - :type evaluation_rule: JSON + :type evaluation_rule: ~azure.ai.projects.types.EvaluationRule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6135,7 +7984,7 @@ def create_or_update( @distributed_trace def create_or_update( - self, id: str, evaluation_rule: Union[_models.EvaluationRule, JSON, IO[bytes]], **kwargs: Any + self, id: str, evaluation_rule: Union[_models.EvaluationRule, _types.EvaluationRule, IO[bytes]], **kwargs: Any ) -> _models.EvaluationRule: """Create or update an evaluation rule. @@ -6143,9 +7992,10 @@ def create_or_update( :param id: Unique identifier for the evaluation rule. Required. :type id: str - :param evaluation_rule: Evaluation rule resource. Is one of the following types: - EvaluationRule, JSON, IO[bytes] Required. - :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule or JSON or IO[bytes] + :param evaluation_rule: Evaluation rule resource. Is either a EvaluationRule type or a + IO[bytes] type. Required. + :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule or + ~azure.ai.projects.types.EvaluationRule or IO[bytes] :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationRule :raises ~azure.core.exceptions.HttpResponseError: @@ -6320,7 +8170,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class ConnectionsOperations: +class ConnectionsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -6581,7 +8431,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class DatasetsOperations: +class DatasetsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -6935,7 +8785,7 @@ def create_or_update( self, name: str, version: str, - dataset_version: JSON, + dataset_version: _types.DatasetVersion, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -6949,7 +8799,7 @@ def create_or_update( :param version: The specific version id of the DatasetVersion to create or update. Required. :type version: str :param dataset_version: The DatasetVersion to create or update. Required. - :type dataset_version: JSON + :type dataset_version: ~azure.ai.projects.types.DatasetVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -6988,7 +8838,11 @@ def create_or_update( @distributed_trace def create_or_update( - self, name: str, version: str, dataset_version: Union[_models.DatasetVersion, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + version: str, + dataset_version: Union[_models.DatasetVersion, _types.DatasetVersion, IO[bytes]], + **kwargs: Any ) -> _models.DatasetVersion: """Create or update a version. @@ -6998,9 +8852,10 @@ def create_or_update( :type name: str :param version: The specific version id of the DatasetVersion to create or update. Required. :type version: str - :param dataset_version: The DatasetVersion to create or update. Is one of the following types: - DatasetVersion, JSON, IO[bytes] Required. - :type dataset_version: ~azure.ai.projects.models.DatasetVersion or JSON or IO[bytes] + :param dataset_version: The DatasetVersion to create or update. Is either a DatasetVersion type + or a IO[bytes] type. Required. + :type dataset_version: ~azure.ai.projects.models.DatasetVersion or + ~azure.ai.projects.types.DatasetVersion or IO[bytes] :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -7100,7 +8955,7 @@ def pending_upload( self, name: str, version: str, - pending_upload_request: JSON, + pending_upload_request: _types.PendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any @@ -7114,7 +8969,7 @@ def pending_upload( :param version: The specific version id of the DatasetVersion to operate on. Required. :type version: str :param pending_upload_request: The pending upload request parameters. Required. - :type pending_upload_request: JSON + :type pending_upload_request: ~azure.ai.projects.types.PendingUploadRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7156,7 +9011,7 @@ def pending_upload( self, name: str, version: str, - pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], + pending_upload_request: Union[_models.PendingUploadRequest, _types.PendingUploadRequest, IO[bytes]], **kwargs: Any ) -> _models.PendingUploadResponse: """Start a pending upload. @@ -7167,10 +9022,10 @@ def pending_upload( :type name: str :param version: The specific version id of the DatasetVersion to operate on. Required. :type version: str - :param pending_upload_request: The pending upload request parameters. Is one of the following - types: PendingUploadRequest, JSON, IO[bytes] Required. - :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or JSON or - IO[bytes] + :param pending_upload_request: The pending upload request parameters. Is either a + PendingUploadRequest type or a IO[bytes] type. Required. + :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or + ~azure.ai.projects.types.PendingUploadRequest or IO[bytes] :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -7304,7 +9159,7 @@ def get_credentials(self, name: str, version: str, **kwargs: Any) -> _models.Dat return deserialized # type: ignore -class DeploymentsOperations: +class DeploymentsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -7499,7 +9354,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class IndexesOperations: +class IndexesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -7850,7 +9705,13 @@ def create_or_update( @overload def create_or_update( - self, name: str, version: str, index: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any + self, + name: str, + version: str, + index: _types.Index, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any ) -> _models.Index: """Create or update a version. @@ -7861,7 +9722,7 @@ def create_or_update( :param version: The specific version id of the Index to create or update. Required. :type version: str :param index: The Index to create or update. Required. - :type index: JSON + :type index: ~azure.ai.projects.types.Index :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -7900,7 +9761,7 @@ def create_or_update( @distributed_trace def create_or_update( - self, name: str, version: str, index: Union[_models.Index, JSON, IO[bytes]], **kwargs: Any + self, name: str, version: str, index: Union[_models.Index, _types.Index, IO[bytes]], **kwargs: Any ) -> _models.Index: """Create or update a version. @@ -7910,9 +9771,9 @@ def create_or_update( :type name: str :param version: The specific version id of the Index to create or update. Required. :type version: str - :param index: The Index to create or update. Is one of the following types: Index, JSON, - IO[bytes] Required. - :type index: ~azure.ai.projects.models.Index or JSON or IO[bytes] + :param index: The Index to create or update. Is either a Index type or a IO[bytes] type. + Required. + :type index: ~azure.ai.projects.models.Index or ~azure.ai.projects.types.Index or IO[bytes] :return: Index. The Index is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Index :raises ~azure.core.exceptions.HttpResponseError: @@ -7980,7 +9841,7 @@ def create_or_update( return deserialized # type: ignore -class ToolboxesOperations: +class ToolboxesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -8040,7 +9901,12 @@ def create_version( @overload def create_version( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + body: _types.CreateToolboxVersionRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.ToolboxVersionObject: """Create a new version of a toolbox. @@ -8050,7 +9916,7 @@ def create_version( Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateToolboxVersionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -8084,7 +9950,7 @@ def create_version( def create_version( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateToolboxVersionRequest, IO[bytes]] = _Unset, *, tools: List[_models.ToolboxTool] = _Unset, description: Optional[str] = None, @@ -8100,8 +9966,9 @@ def create_version( :param name: The name of the toolbox. If the toolbox does not exist, it will be created. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateToolboxVersionRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.projects.types.CreateToolboxVersionRequest or IO[bytes] :keyword tools: The list of tools to include in this version. Required. :paramtype tools: list[~azure.ai.projects.models.ToolboxTool] :keyword description: A human-readable description of the toolbox. Default value is None. @@ -8543,7 +10410,7 @@ def update( @overload def update( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.UpdateToolboxRequest1, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. @@ -8552,7 +10419,7 @@ def update( :param name: The name of the toolbox to update. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.UpdateToolboxRequest1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -8583,7 +10450,12 @@ def update( @distributed_trace def update( - self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, default_version: str = _Unset, **kwargs: Any + self, + name: str, + body: Union[JSON, _types.UpdateToolboxRequest1, IO[bytes]] = _Unset, + *, + default_version: str = _Unset, + **kwargs: Any ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. @@ -8591,8 +10463,8 @@ def update( :param name: The name of the toolbox to update. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, UpdateToolboxRequest1, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.UpdateToolboxRequest1 or IO[bytes] :keyword 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. :paramtype default_version: str @@ -8784,7 +10656,7 @@ def delete_version( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore -class BetaEvaluationTaxonomiesOperations: +class BetaEvaluationTaxonomiesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -9035,7 +10907,7 @@ def create( @overload def create( - self, name: str, taxonomy: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, taxonomy: _types.EvaluationTaxonomy, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. @@ -9044,7 +10916,7 @@ def create( :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. - :type taxonomy: JSON + :type taxonomy: ~azure.ai.projects.types.EvaluationTaxonomy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9075,7 +10947,10 @@ def create( @distributed_trace def create( - self, name: str, taxonomy: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + taxonomy: Union[_models.EvaluationTaxonomy, _types.EvaluationTaxonomy, IO[bytes]], + **kwargs: Any ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. @@ -9083,9 +10958,10 @@ def create( :param name: The name of the evaluation taxonomy. Required. :type name: str - :param taxonomy: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, - JSON, IO[bytes] Required. - :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] + :param taxonomy: The evaluation taxonomy. Is either a EvaluationTaxonomy type or a IO[bytes] + type. Required. + :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or + ~azure.ai.projects.types.EvaluationTaxonomy or IO[bytes] :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: @@ -9173,7 +11049,7 @@ def update( @overload def update( - self, name: str, taxonomy: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, taxonomy: _types.EvaluationTaxonomy, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. @@ -9182,7 +11058,7 @@ def update( :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. - :type taxonomy: JSON + :type taxonomy: ~azure.ai.projects.types.EvaluationTaxonomy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9213,7 +11089,10 @@ def update( @distributed_trace def update( - self, name: str, taxonomy: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + taxonomy: Union[_models.EvaluationTaxonomy, _types.EvaluationTaxonomy, IO[bytes]], + **kwargs: Any ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. @@ -9221,9 +11100,10 @@ def update( :param name: The name of the evaluation taxonomy. Required. :type name: str - :param taxonomy: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, - JSON, IO[bytes] Required. - :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] + :param taxonomy: The evaluation taxonomy. Is either a EvaluationTaxonomy type or a IO[bytes] + type. Required. + :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or + ~azure.ai.projects.types.EvaluationTaxonomy or IO[bytes] :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: @@ -9290,7 +11170,7 @@ def update( return deserialized # type: ignore -class BetaEvaluatorsOperations: +class BetaEvaluatorsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -9669,7 +11549,12 @@ def create_version( @overload def create_version( - self, name: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + evaluator_version: _types.EvaluatorVersion, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.EvaluatorVersion: """Create an evaluator version. @@ -9678,7 +11563,7 @@ def create_version( :param name: The name of the resource. Required. :type name: str :param evaluator_version: Required. - :type evaluator_version: JSON + :type evaluator_version: ~azure.ai.projects.types.EvaluatorVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9709,7 +11594,10 @@ def create_version( @distributed_trace def create_version( - self, name: str, evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + evaluator_version: Union[_models.EvaluatorVersion, _types.EvaluatorVersion, IO[bytes]], + **kwargs: Any ) -> _models.EvaluatorVersion: """Create an evaluator version. @@ -9717,9 +11605,9 @@ def create_version( :param name: The name of the resource. Required. :type name: str - :param evaluator_version: Is one of the following types: EvaluatorVersion, JSON, IO[bytes] - Required. - :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or JSON or IO[bytes] + :param evaluator_version: Is either a EvaluatorVersion type or a IO[bytes] type. Required. + :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or + ~azure.ai.projects.types.EvaluatorVersion or IO[bytes] :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -9815,7 +11703,13 @@ def update_version( @overload def update_version( - self, name: str, version: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + version: str, + evaluator_version: _types.EvaluatorVersion, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.EvaluatorVersion: """Update an evaluator version. @@ -9826,7 +11720,7 @@ def update_version( :param version: The version of the EvaluatorVersion to update. Required. :type version: str :param evaluator_version: Evaluator resource. Required. - :type evaluator_version: JSON + :type evaluator_version: ~azure.ai.projects.types.EvaluatorVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9868,7 +11762,7 @@ def update_version( self, name: str, version: str, - evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], + evaluator_version: Union[_models.EvaluatorVersion, _types.EvaluatorVersion, IO[bytes]], **kwargs: Any ) -> _models.EvaluatorVersion: """Update an evaluator version. @@ -9879,9 +11773,10 @@ def update_version( :type name: str :param version: The version of the EvaluatorVersion to update. Required. :type version: str - :param evaluator_version: Evaluator resource. Is one of the following types: EvaluatorVersion, - JSON, IO[bytes] Required. - :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or JSON or IO[bytes] + :param evaluator_version: Evaluator resource. Is either a EvaluatorVersion type or a IO[bytes] + type. Required. + :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or + ~azure.ai.projects.types.EvaluatorVersion or IO[bytes] :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -9982,7 +11877,7 @@ def pending_upload( self, name: str, version: str, - pending_upload_request: JSON, + pending_upload_request: _types.PendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any @@ -9997,7 +11892,7 @@ def pending_upload( :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str :param pending_upload_request: The pending upload request parameters. Required. - :type pending_upload_request: JSON + :type pending_upload_request: ~azure.ai.projects.types.PendingUploadRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10040,7 +11935,7 @@ def pending_upload( self, name: str, version: str, - pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], + pending_upload_request: Union[_models.PendingUploadRequest, _types.PendingUploadRequest, IO[bytes]], **kwargs: Any ) -> _models.PendingUploadResponse: """Start a pending upload. @@ -10052,10 +11947,10 @@ def pending_upload( :type name: str :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str - :param pending_upload_request: The pending upload request parameters. Is one of the following - types: PendingUploadRequest, JSON, IO[bytes] Required. - :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or JSON or - IO[bytes] + :param pending_upload_request: The pending upload request parameters. Is either a + PendingUploadRequest type or a IO[bytes] type. Required. + :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or + ~azure.ai.projects.types.PendingUploadRequest or IO[bytes] :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -10160,7 +12055,7 @@ def get_credentials( self, name: str, version: str, - credential_request: JSON, + credential_request: _types.EvaluatorCredentialRequest, *, content_type: str = "application/json", **kwargs: Any @@ -10175,7 +12070,7 @@ def get_credentials( :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str :param credential_request: The credential request parameters. Required. - :type credential_request: JSON + :type credential_request: ~azure.ai.projects.types.EvaluatorCredentialRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10218,7 +12113,7 @@ def get_credentials( self, name: str, version: str, - credential_request: Union[_models.EvaluatorCredentialRequest, JSON, IO[bytes]], + credential_request: Union[_models.EvaluatorCredentialRequest, _types.EvaluatorCredentialRequest, IO[bytes]], **kwargs: Any ) -> _models.DatasetCredential: """Get evaluator credentials. @@ -10230,10 +12125,10 @@ def get_credentials( :type name: str :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str - :param credential_request: The credential request parameters. Is one of the following types: - EvaluatorCredentialRequest, JSON, IO[bytes] Required. - :type credential_request: ~azure.ai.projects.models.EvaluatorCredentialRequest or JSON or - IO[bytes] + :param credential_request: The credential request parameters. Is either a + EvaluatorCredentialRequest type or a IO[bytes] type. Required. + :type credential_request: ~azure.ai.projects.models.EvaluatorCredentialRequest or + ~azure.ai.projects.types.EvaluatorCredentialRequest or IO[bytes] :return: DatasetCredential. The DatasetCredential is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetCredential :raises ~azure.core.exceptions.HttpResponseError: @@ -10306,7 +12201,7 @@ def get_credentials( def _create_generation_job_initial( self, - job: Union[_models.EvaluatorGenerationJob, JSON, IO[bytes]], + job: Union[_models.EvaluatorGenerationJob, _types.EvaluatorGenerationJob, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -10406,7 +12301,12 @@ def begin_create_generation_job( @overload def begin_create_generation_job( - self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any + self, + job: _types.EvaluatorGenerationJob, + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any ) -> LROPoller[_models.EvaluatorVersion]: """Create an evaluator generation job. @@ -10414,7 +12314,7 @@ def begin_create_generation_job( from the provided source materials asynchronously. :param job: The job to create. Required. - :type job: JSON + :type job: ~azure.ai.projects.types.EvaluatorGenerationJob :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -10458,7 +12358,7 @@ def begin_create_generation_job( @distributed_trace def begin_create_generation_job( self, - job: Union[_models.EvaluatorGenerationJob, JSON, IO[bytes]], + job: Union[_models.EvaluatorGenerationJob, _types.EvaluatorGenerationJob, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -10468,9 +12368,10 @@ def begin_create_generation_job( Creates an evaluator generation job. The service generates rubric-based evaluator definitions from the provided source materials asynchronously. - :param job: The job to create. Is one of the following types: EvaluatorGenerationJob, JSON, - IO[bytes] Required. - :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or JSON or IO[bytes] + :param job: The job to create. Is either a EvaluatorGenerationJob type or a IO[bytes] type. + Required. + :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or + ~azure.ai.projects.types.EvaluatorGenerationJob or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -10825,7 +12726,7 @@ def delete_generation_job( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore -class BetaInsightsOperations: +class BetaInsightsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -10862,14 +12763,16 @@ def generate( """ @overload - def generate(self, insight: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.Insight: + def generate( + self, insight: _types.Insight, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Insight: """Generate insights. Generates an insights report from the provided evaluation configuration. :param insight: Complete evaluation configuration including data source, evaluators, and result settings. Required. - :type insight: JSON + :type insight: ~azure.ai.projects.types.Insight :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10896,14 +12799,15 @@ def generate(self, insight: IO[bytes], *, content_type: str = "application/json" """ @distributed_trace - def generate(self, insight: Union[_models.Insight, JSON, IO[bytes]], **kwargs: Any) -> _models.Insight: + def generate(self, insight: Union[_models.Insight, _types.Insight, IO[bytes]], **kwargs: Any) -> _models.Insight: """Generate insights. Generates an insights report from the provided evaluation configuration. :param insight: Complete evaluation configuration including data source, evaluators, and result - settings. Is one of the following types: Insight, JSON, IO[bytes] Required. - :type insight: ~azure.ai.projects.models.Insight or JSON or IO[bytes] + settings. Is either a Insight type or a IO[bytes] type. Required. + :type insight: ~azure.ai.projects.models.Insight or ~azure.ai.projects.types.Insight or + IO[bytes] :return: Insight. The Insight is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Insight :raises ~azure.core.exceptions.HttpResponseError: @@ -11164,7 +13068,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class BetaMemoryStoresOperations: +class BetaMemoryStoresOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -11215,14 +13119,14 @@ def create( @overload def create( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, body: _types.CreateMemoryStoreRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: """Create a memory store. Creates a memory store resource with the provided configuration. :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateMemoryStoreRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11252,7 +13156,7 @@ def create( @distributed_trace def create( self, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateMemoryStoreRequest, IO[bytes]] = _Unset, *, name: str = _Unset, definition: _models.MemoryStoreDefinition = _Unset, @@ -11264,8 +13168,8 @@ def create( Creates a memory store resource with the provided configuration. - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateMemoryStoreRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.CreateMemoryStoreRequest or IO[bytes] :keyword name: The name of the memory store. Required. :paramtype name: str :keyword definition: The memory store definition. Required. @@ -11381,7 +13285,7 @@ def update( @overload def update( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.UpdateMemoryStoreRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: """Update a memory store. @@ -11390,7 +13294,7 @@ def update( :param name: The name of the memory store to update. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.UpdateMemoryStoreRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11423,7 +13327,7 @@ def update( def update( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.UpdateMemoryStoreRequest, IO[bytes]] = _Unset, *, description: Optional[str] = None, metadata: Optional[dict[str, str]] = None, @@ -11435,8 +13339,8 @@ def update( :param name: The name of the memory store to update. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, UpdateMemoryStoreRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.UpdateMemoryStoreRequest or IO[bytes] :keyword description: A human-readable description of the memory store. Default value is None. :paramtype description: str :keyword metadata: Arbitrary key-value metadata to associate with the memory store. Default @@ -11754,7 +13658,7 @@ def _search_memories( ) -> _models.MemoryStoreSearchResult: ... @overload def _search_memories( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.SearchMemoriesRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreSearchResult: ... @overload def _search_memories( @@ -11765,7 +13669,7 @@ def _search_memories( def _search_memories( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.SearchMemoriesRequest, IO[bytes]] = _Unset, *, scope: str = _Unset, items: Optional[List[dict[str, Any]]] = None, @@ -11779,8 +13683,8 @@ def _search_memories( :param name: The name of the memory store to search. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, SearchMemoriesRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.SearchMemoriesRequest or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -11868,7 +13772,7 @@ def _search_memories( def _update_memories_initial( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.UpdateMemoriesRequest, IO[bytes]] = _Unset, *, scope: str = _Unset, items: Optional[List[dict[str, Any]]] = None, @@ -11964,7 +13868,7 @@ def _begin_update_memories( ) -> LROPoller[_models.MemoryStoreUpdateCompletedResult]: ... @overload def _begin_update_memories( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.UpdateMemoriesRequest, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.MemoryStoreUpdateCompletedResult]: ... @overload def _begin_update_memories( @@ -11975,7 +13879,7 @@ def _begin_update_memories( def _begin_update_memories( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.UpdateMemoriesRequest, IO[bytes]] = _Unset, *, scope: str = _Unset, items: Optional[List[dict[str, Any]]] = None, @@ -11990,8 +13894,8 @@ def _begin_update_memories( :param name: The name of the memory store to update. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, UpdateMemoriesRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.UpdateMemoriesRequest or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -12096,7 +14000,7 @@ def delete_scope( @overload def delete_scope( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.DeleteScopeRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: """Delete memories by scope. @@ -12105,7 +14009,7 @@ def delete_scope( :param name: The name of the memory store. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.DeleteScopeRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -12138,7 +14042,12 @@ def delete_scope( @distributed_trace def delete_scope( - self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, **kwargs: Any + self, + name: str, + body: Union[JSON, _types.DeleteScopeRequest, IO[bytes]] = _Unset, + *, + scope: str = _Unset, + **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: """Delete memories by scope. @@ -12146,8 +14055,8 @@ def delete_scope( :param name: The name of the memory store. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, DeleteScopeRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.DeleteScopeRequest or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories to delete, such as a user ID. Required. :paramtype scope: str @@ -12261,7 +14170,7 @@ def create_memory( @overload def create_memory( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.CreateMemoryRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: """Create a memory item. @@ -12270,7 +14179,7 @@ def create_memory( :param name: The name of the memory store. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateMemoryRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -12303,7 +14212,7 @@ def create_memory( def create_memory( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateMemoryRequest, IO[bytes]] = _Unset, *, scope: str = _Unset, content: str = _Unset, @@ -12316,8 +14225,8 @@ def create_memory( :param name: The name of the memory store. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateMemoryRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.CreateMemoryRequest or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -12428,7 +14337,13 @@ def update_memory( @overload def update_memory( - self, name: str, memory_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + memory_id: str, + body: _types.UpdateMemoryRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.MemoryItem: """Update a memory item. @@ -12439,7 +14354,7 @@ def update_memory( :param memory_id: The ID of the memory item to update. Required. :type memory_id: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.UpdateMemoryRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -12472,7 +14387,13 @@ def update_memory( @distributed_trace def update_memory( - self, name: str, memory_id: str, body: Union[JSON, IO[bytes]] = _Unset, *, content: str = _Unset, **kwargs: Any + self, + name: str, + memory_id: str, + body: Union[JSON, _types.UpdateMemoryRequest, IO[bytes]] = _Unset, + *, + content: str = _Unset, + **kwargs: Any ) -> _models.MemoryItem: """Update a memory item. @@ -12482,8 +14403,8 @@ def update_memory( :type name: str :param memory_id: The ID of the memory item to update. Required. :type memory_id: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, UpdateMemoryRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.UpdateMemoryRequest or IO[bytes] :keyword content: The updated content of the memory. Required. :paramtype content: str :return: MemoryItem. The MemoryItem is compatible with MutableMapping @@ -12682,7 +14603,7 @@ def list_memories( def list_memories( self, name: str, - body: JSON, + body: _types.ListMemoriesRequest, *, kind: Optional[Union[str, _models.MemoryItemKind]] = None, limit: Optional[int] = None, @@ -12698,7 +14619,7 @@ def list_memories( :param name: The name of the memory store. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.ListMemoriesRequest :keyword kind: The kind of the memory item. Known values are: "user_profile", "chat_summary", and "procedural". Default value is None. :paramtype kind: str or ~azure.ai.projects.models.MemoryItemKind @@ -12774,7 +14695,7 @@ def list_memories( def list_memories( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.ListMemoriesRequest, IO[bytes]] = _Unset, *, scope: str = _Unset, kind: Optional[Union[str, _models.MemoryItemKind]] = None, @@ -12789,8 +14710,8 @@ def list_memories( :param name: The name of the memory store. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, ListMemoriesRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.ListMemoriesRequest or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -12963,7 +14884,7 @@ def delete_memory(self, name: str, memory_id: str, **kwargs: Any) -> _models.Del return deserialized # type: ignore -class BetaModelsOperations: +class BetaModelsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -13316,7 +15237,7 @@ def update( self, name: str, version: str, - model_version_update: JSON, + model_version_update: _types.UpdateModelVersionRequest, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -13331,7 +15252,7 @@ def update( Required. :type version: str :param model_version_update: The UpdateModelVersionRequest to create or update. Required. - :type model_version_update: JSON + :type model_version_update: ~azure.ai.projects.types.UpdateModelVersionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -13374,7 +15295,7 @@ def update( self, name: str, version: str, - model_version_update: Union[_models.UpdateModelVersionRequest, JSON, IO[bytes]], + model_version_update: Union[_models.UpdateModelVersionRequest, _types.UpdateModelVersionRequest, IO[bytes]], **kwargs: Any ) -> _models.ModelVersion: """Update a model version. @@ -13386,10 +15307,10 @@ def update( :param version: The specific version id of the UpdateModelVersionRequest to create or update. Required. :type version: str - :param model_version_update: The UpdateModelVersionRequest to create or update. Is one of the - following types: UpdateModelVersionRequest, JSON, IO[bytes] Required. - :type model_version_update: ~azure.ai.projects.models.UpdateModelVersionRequest or JSON or - IO[bytes] + :param model_version_update: The UpdateModelVersionRequest to create or update. Is either a + UpdateModelVersionRequest type or a IO[bytes] type. Required. + :type model_version_update: ~azure.ai.projects.models.UpdateModelVersionRequest or + ~azure.ai.projects.types.UpdateModelVersionRequest or IO[bytes] :return: ModelVersion. The ModelVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.ModelVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -13487,7 +15408,13 @@ def pending_create_version( @overload def pending_create_version( - self, name: str, version: str, model_version: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + version: str, + model_version: _types.ModelVersion, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.CreateAsyncResponse: """Create a model version async. @@ -13499,7 +15426,7 @@ def pending_create_version( :param version: Version of the model. Required. :type version: str :param model_version: Model version to create. Required. - :type model_version: JSON + :type model_version: ~azure.ai.projects.types.ModelVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -13539,7 +15466,11 @@ def pending_create_version( @distributed_trace def pending_create_version( - self, name: str, version: str, model_version: Union[_models.ModelVersion, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + version: str, + model_version: Union[_models.ModelVersion, _types.ModelVersion, IO[bytes]], + **kwargs: Any ) -> _models.CreateAsyncResponse: """Create a model version async. @@ -13550,9 +15481,10 @@ def pending_create_version( :type name: str :param version: Version of the model. Required. :type version: str - :param model_version: Model version to create. Is one of the following types: ModelVersion, - JSON, IO[bytes] Required. - :type model_version: ~azure.ai.projects.models.ModelVersion or JSON or IO[bytes] + :param model_version: Model version to create. Is either a ModelVersion type or a IO[bytes] + type. Required. + :type model_version: ~azure.ai.projects.models.ModelVersion or + ~azure.ai.projects.types.ModelVersion or IO[bytes] :return: CreateAsyncResponse. The CreateAsyncResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.CreateAsyncResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -13656,7 +15588,7 @@ def pending_upload( self, name: str, version: str, - pending_upload_request: JSON, + pending_upload_request: _types.ModelPendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any @@ -13670,7 +15602,7 @@ def pending_upload( :param version: Version of the model. Required. :type version: str :param pending_upload_request: The pending upload request request body. Required. - :type pending_upload_request: JSON + :type pending_upload_request: ~azure.ai.projects.types.ModelPendingUploadRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -13714,7 +15646,7 @@ def pending_upload( self, name: str, version: str, - pending_upload_request: Union[_models.ModelPendingUploadRequest, JSON, IO[bytes]], + pending_upload_request: Union[_models.ModelPendingUploadRequest, _types.ModelPendingUploadRequest, IO[bytes]], **kwargs: Any ) -> _models.ModelPendingUploadResponse: """Start a pending upload. @@ -13725,10 +15657,10 @@ def pending_upload( :type name: str :param version: Version of the model. Required. :type version: str - :param pending_upload_request: The pending upload request request body. Is one of the following - types: ModelPendingUploadRequest, JSON, IO[bytes] Required. - :type pending_upload_request: ~azure.ai.projects.models.ModelPendingUploadRequest or JSON or - IO[bytes] + :param pending_upload_request: The pending upload request request body. Is either a + ModelPendingUploadRequest type or a IO[bytes] type. Required. + :type pending_upload_request: ~azure.ai.projects.models.ModelPendingUploadRequest or + ~azure.ai.projects.types.ModelPendingUploadRequest or IO[bytes] :return: ModelPendingUploadResponse. The ModelPendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.ModelPendingUploadResponse @@ -13829,7 +15761,7 @@ def get_credentials( self, name: str, version: str, - credential_request: JSON, + credential_request: _types.ModelCredentialRequest, *, content_type: str = "application/json", **kwargs: Any @@ -13843,7 +15775,7 @@ def get_credentials( :param version: Version of the model. Required. :type version: str :param credential_request: The credential request request body. Required. - :type credential_request: JSON + :type credential_request: ~azure.ai.projects.types.ModelCredentialRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -13885,7 +15817,7 @@ def get_credentials( self, name: str, version: str, - credential_request: Union[_models.ModelCredentialRequest, JSON, IO[bytes]], + credential_request: Union[_models.ModelCredentialRequest, _types.ModelCredentialRequest, IO[bytes]], **kwargs: Any ) -> _models.DatasetCredential: """Get model asset credentials. @@ -13896,9 +15828,10 @@ def get_credentials( :type name: str :param version: Version of the model. Required. :type version: str - :param credential_request: The credential request request body. Is one of the following types: - ModelCredentialRequest, JSON, IO[bytes] Required. - :type credential_request: ~azure.ai.projects.models.ModelCredentialRequest or JSON or IO[bytes] + :param credential_request: The credential request request body. Is either a + ModelCredentialRequest type or a IO[bytes] type. Required. + :type credential_request: ~azure.ai.projects.models.ModelCredentialRequest or + ~azure.ai.projects.types.ModelCredentialRequest or IO[bytes] :return: DatasetCredential. The DatasetCredential is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetCredential :raises ~azure.core.exceptions.HttpResponseError: @@ -13966,7 +15899,7 @@ def get_credentials( return deserialized # type: ignore -class BetaRedTeamsOperations: +class BetaRedTeamsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -14155,13 +16088,15 @@ def create( """ @overload - def create(self, red_team: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.RedTeam: + def create( + self, red_team: _types.RedTeam, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.RedTeam: """Create a redteam run. Submits a new redteam run for execution with the provided configuration. :param red_team: Redteam to be run. Required. - :type red_team: JSON + :type red_team: ~azure.ai.projects.types.RedTeam :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -14187,14 +16122,14 @@ def create(self, red_team: IO[bytes], *, content_type: str = "application/json", """ @distributed_trace - def create(self, red_team: Union[_models.RedTeam, JSON, IO[bytes]], **kwargs: Any) -> _models.RedTeam: + def create(self, red_team: Union[_models.RedTeam, _types.RedTeam, IO[bytes]], **kwargs: Any) -> _models.RedTeam: """Create a redteam run. Submits a new redteam run for execution with the provided configuration. - :param red_team: Redteam to be run. Is one of the following types: RedTeam, JSON, IO[bytes] - Required. - :type red_team: ~azure.ai.projects.models.RedTeam or JSON or IO[bytes] + :param red_team: Redteam to be run. Is either a RedTeam type or a IO[bytes] type. Required. + :type red_team: ~azure.ai.projects.models.RedTeam or ~azure.ai.projects.types.RedTeam or + IO[bytes] :return: RedTeam. The RedTeam is compatible with MutableMapping :rtype: ~azure.ai.projects.models.RedTeam :raises ~azure.core.exceptions.HttpResponseError: @@ -14264,7 +16199,7 @@ def create(self, red_team: Union[_models.RedTeam, JSON, IO[bytes]], **kwargs: An return deserialized # type: ignore -class BetaRoutinesOperations: +class BetaRoutinesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -14318,7 +16253,12 @@ def create_or_update( @overload def create_or_update( - self, routine_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + routine_name: str, + body: _types.CreateOrUpdateRoutineRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.Routine: """Create or update a routine. @@ -14327,7 +16267,7 @@ def create_or_update( :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateOrUpdateRoutineRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -14360,7 +16300,7 @@ def create_or_update( def create_or_update( self, routine_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateOrUpdateRoutineRequest, IO[bytes]] = _Unset, *, description: Optional[str] = None, enabled: Optional[bool] = None, @@ -14374,8 +16314,9 @@ def create_or_update( :param routine_name: The unique name of the routine. Required. :type routine_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateOrUpdateRoutineRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.projects.types.CreateOrUpdateRoutineRequest or IO[bytes] :keyword description: A human-readable description of the routine. Default value is None. :paramtype description: str :keyword enabled: Whether the routine is enabled. Default value is None. @@ -14916,7 +16857,12 @@ def dispatch( @overload def dispatch( - self, routine_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + routine_name: str, + body: _types.DispatchRoutineAsyncRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. @@ -14925,7 +16871,7 @@ def dispatch( :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.DispatchRoutineAsyncRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -14958,7 +16904,7 @@ def dispatch( def dispatch( self, routine_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.DispatchRoutineAsyncRequest, IO[bytes]] = _Unset, *, payload: Optional[_models.RoutineDispatchPayload] = None, **kwargs: Any @@ -14969,8 +16915,9 @@ def dispatch( :param routine_name: The unique name of the routine. Required. :type routine_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, DispatchRoutineAsyncRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.projects.types.DispatchRoutineAsyncRequest or IO[bytes] :keyword payload: A direct action-input override sent downstream when testing a routine. Default value is None. :paramtype payload: ~azure.ai.projects.models.RoutineDispatchPayload @@ -15047,7 +16994,7 @@ def dispatch( return deserialized # type: ignore -class BetaSchedulesOperations: +class BetaSchedulesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -15302,7 +17249,7 @@ def create_or_update( @overload def create_or_update( - self, schedule_id: str, schedule: JSON, *, content_type: str = "application/json", **kwargs: Any + self, schedule_id: str, schedule: _types.Schedule, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Schedule: """Create or update a schedule. @@ -15311,7 +17258,7 @@ def create_or_update( :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str :param schedule: The resource instance. Required. - :type schedule: JSON + :type schedule: ~azure.ai.projects.types.Schedule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -15342,7 +17289,7 @@ def create_or_update( @distributed_trace def create_or_update( - self, schedule_id: str, schedule: Union[_models.Schedule, JSON, IO[bytes]], **kwargs: Any + self, schedule_id: str, schedule: Union[_models.Schedule, _types.Schedule, IO[bytes]], **kwargs: Any ) -> _models.Schedule: """Create or update a schedule. @@ -15350,9 +17297,10 @@ def create_or_update( :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str - :param schedule: The resource instance. Is one of the following types: Schedule, JSON, - IO[bytes] Required. - :type schedule: ~azure.ai.projects.models.Schedule or JSON or IO[bytes] + :param schedule: The resource instance. Is either a Schedule type or a IO[bytes] type. + Required. + :type schedule: ~azure.ai.projects.models.Schedule or ~azure.ai.projects.types.Schedule or + IO[bytes] :return: Schedule. The Schedule is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Schedule :raises ~azure.core.exceptions.HttpResponseError: @@ -15596,7 +17544,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class BetaSkillsOperations: +class BetaSkillsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -15795,7 +17743,7 @@ def update( @overload def update( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.UpdateSkillRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SkillDetails: """Update a skill. @@ -15804,7 +17752,7 @@ def update( :param name: The name of the skill to update. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.UpdateSkillRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -15835,7 +17783,12 @@ def update( @distributed_trace def update( - self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, default_version: str = _Unset, **kwargs: Any + self, + name: str, + body: Union[JSON, _types.UpdateSkillRequest, IO[bytes]] = _Unset, + *, + default_version: str = _Unset, + **kwargs: Any ) -> _models.SkillDetails: """Update a skill. @@ -15843,8 +17796,8 @@ def update( :param name: The name of the skill to update. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, UpdateSkillRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.UpdateSkillRequest or IO[bytes] :keyword default_version: The version identifier that the skill should point to. When set, the skill's default version will resolve to this version instead of the latest. Required. :paramtype default_version: str @@ -16020,7 +17973,12 @@ def create( @overload def create( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + body: _types.CreateSkillVersionRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.SkillVersion: """Create a new version of a skill. @@ -16029,7 +17987,7 @@ def create( :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateSkillVersionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -16062,7 +18020,7 @@ def create( def create( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateSkillVersionRequest, IO[bytes]] = _Unset, *, inline_content: Optional[_models.SkillInlineContent] = None, default: Optional[bool] = None, @@ -16074,8 +18032,9 @@ def create( :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateSkillVersionRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.projects.types.CreateSkillVersionRequest or IO[bytes] :keyword inline_content: Inline skill content for simple skills without file uploads. Foundry-specific extension. Default value is None. :paramtype inline_content: ~azure.ai.projects.models.SkillInlineContent @@ -16171,7 +18130,9 @@ def create_from_files( """ @overload - def create_from_files(self, name: str, content: JSON, **kwargs: Any) -> _models.SkillVersion: + def create_from_files( + self, name: str, content: _types.CreateSkillVersionFromFilesBody, **kwargs: Any + ) -> _models.SkillVersion: """Create a skill version from uploaded files. Creates a new version of a skill from uploaded files via multipart form data. @@ -16179,7 +18140,7 @@ def create_from_files(self, name: str, content: JSON, **kwargs: Any) -> _models. :param name: The name of the skill. Required. :type name: str :param content: The multipart request content. Required. - :type content: JSON + :type content: ~azure.ai.projects.types.CreateSkillVersionFromFilesBody :return: SkillVersion. The SkillVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.SkillVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -16187,7 +18148,10 @@ def create_from_files(self, name: str, content: JSON, **kwargs: Any) -> _models. @distributed_trace def create_from_files( - self, name: str, content: Union[_models.CreateSkillVersionFromFilesBody, JSON], **kwargs: Any + self, + name: str, + content: Union[_models.CreateSkillVersionFromFilesBody, _types.CreateSkillVersionFromFilesBody], + **kwargs: Any ) -> _models.SkillVersion: """Create a skill version from uploaded files. @@ -16195,9 +18159,10 @@ def create_from_files( :param name: The name of the skill. Required. :type name: str - :param content: The multipart request content. Is either a CreateSkillVersionFromFilesBody type - or a JSON type. Required. - :type content: ~azure.ai.projects.models.CreateSkillVersionFromFilesBody or JSON + :param content: The multipart request content. Is one of the following types: + CreateSkillVersionFromFilesBody Required. + :type content: ~azure.ai.projects.models.CreateSkillVersionFromFilesBody or + ~azure.ai.projects.types.CreateSkillVersionFromFilesBody :return: SkillVersion. The SkillVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.SkillVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -16638,7 +18603,7 @@ def delete_version(self, name: str, version: str, **kwargs: Any) -> _models.Dele return deserialized # type: ignore -class BetaDatasetsOperations: +class BetaDatasetsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -16819,7 +18784,7 @@ def get_next(_continuation_token=None): def _create_generation_job_initial( self, - job: Union[_models.DataGenerationJob, JSON, IO[bytes]], + job: Union[_models.DataGenerationJob, _types.DataGenerationJob, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -16918,14 +18883,19 @@ def begin_create_generation_job( @overload def begin_create_generation_job( - self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any + self, + job: _types.DataGenerationJob, + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any ) -> LROPoller[_models.DataGenerationJobResult]: """Create a data generation job. Submits a new data generation job for asynchronous execution. :param job: The job to create. Required. - :type job: JSON + :type job: ~azure.ai.projects.types.DataGenerationJob :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -16968,7 +18938,7 @@ def begin_create_generation_job( @distributed_trace def begin_create_generation_job( self, - job: Union[_models.DataGenerationJob, JSON, IO[bytes]], + job: Union[_models.DataGenerationJob, _types.DataGenerationJob, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -16977,9 +18947,10 @@ def begin_create_generation_job( Submits a new data generation job for asynchronous execution. - :param job: The job to create. Is one of the following types: DataGenerationJob, JSON, - IO[bytes] Required. - :type job: ~azure.ai.projects.models.DataGenerationJob or JSON or IO[bytes] + :param job: The job to create. Is either a DataGenerationJob type or a IO[bytes] type. + Required. + :type job: ~azure.ai.projects.models.DataGenerationJob or + ~azure.ai.projects.types.DataGenerationJob or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -17169,7 +19140,7 @@ def delete_generation_job( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore -class BetaAgentsOperations: +class BetaAgentsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -17187,7 +19158,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") def _create_optimization_job_initial( - self, job: Union[_models.OptimizationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any + self, + job: Union[_models.AgentOptimizationJob, _types.AgentOptimizationJob, IO[bytes]], + *, + operation_id: Optional[str] = None, + **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -17257,51 +19232,56 @@ def _create_optimization_job_initial( @overload def begin_create_optimization_job( self, - job: _models.OptimizationJob, + job: _models.AgentOptimizationJob, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.OptimizationJobResult]: + ) -> LROPoller[_models.AgentOptimizationJobResult]: """Create an agent optimization job. Creates an optimization job and returns the queued job. Honors ``Operation-Id`` for idempotent retry. :param job: The job to create. Required. - :type job: ~azure.ai.projects.models.OptimizationJob + :type job: ~azure.ai.projects.models.AgentOptimizationJob :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns OptimizationJobResult. The OptimizationJobResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.OptimizationJobResult] + :return: An instance of LROPoller that returns AgentOptimizationJobResult. The + AgentOptimizationJobResult is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.AgentOptimizationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ @overload def begin_create_optimization_job( - self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.OptimizationJobResult]: + self, + job: _types.AgentOptimizationJob, + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AgentOptimizationJobResult]: """Create an agent optimization job. Creates an optimization job and returns the queued job. Honors ``Operation-Id`` for idempotent retry. :param job: The job to create. Required. - :type job: JSON + :type job: ~azure.ai.projects.types.AgentOptimizationJob :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns OptimizationJobResult. The OptimizationJobResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.OptimizationJobResult] + :return: An instance of LROPoller that returns AgentOptimizationJobResult. The + AgentOptimizationJobResult is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.AgentOptimizationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -17313,7 +19293,7 @@ def begin_create_optimization_job( operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.OptimizationJobResult]: + ) -> LROPoller[_models.AgentOptimizationJobResult]: """Create an agent optimization job. Creates an optimization job and returns the queued job. Honors ``Operation-Id`` for idempotent @@ -17327,37 +19307,42 @@ def begin_create_optimization_job( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns OptimizationJobResult. The OptimizationJobResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.OptimizationJobResult] + :return: An instance of LROPoller that returns AgentOptimizationJobResult. The + AgentOptimizationJobResult is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.AgentOptimizationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace def begin_create_optimization_job( - self, job: Union[_models.OptimizationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any - ) -> LROPoller[_models.OptimizationJobResult]: + self, + job: Union[_models.AgentOptimizationJob, _types.AgentOptimizationJob, IO[bytes]], + *, + operation_id: Optional[str] = None, + **kwargs: Any + ) -> LROPoller[_models.AgentOptimizationJobResult]: """Create an agent optimization job. Creates an optimization job and returns the queued job. Honors ``Operation-Id`` for idempotent retry. - :param job: The job to create. Is one of the following types: OptimizationJob, JSON, IO[bytes] + :param job: The job to create. Is either a AgentOptimizationJob type or a IO[bytes] type. Required. - :type job: ~azure.ai.projects.models.OptimizationJob or JSON or IO[bytes] + :type job: ~azure.ai.projects.models.AgentOptimizationJob or + ~azure.ai.projects.types.AgentOptimizationJob or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str - :return: An instance of LROPoller that returns OptimizationJobResult. The OptimizationJobResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.OptimizationJobResult] + :return: An instance of LROPoller that returns AgentOptimizationJobResult. The + AgentOptimizationJobResult is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.AgentOptimizationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OptimizationJobResult] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentOptimizationJobResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -17382,7 +19367,7 @@ def get_long_running_output(pipeline_response): ) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - deserialized = _deserialize(_models.OptimizationJobResult, response.json().get("result", {})) + deserialized = _deserialize(_models.AgentOptimizationJobResult, response.json().get("result", {})) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized @@ -17400,26 +19385,26 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.OptimizationJobResult].from_continuation_token( + return LROPoller[_models.AgentOptimizationJobResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.OptimizationJobResult]( + return LROPoller[_models.AgentOptimizationJobResult]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @distributed_trace - def get_optimization_job(self, job_id: str, **kwargs: Any) -> _models.OptimizationJob: + def get_optimization_job(self, job_id: str, **kwargs: Any) -> _models.AgentOptimizationJob: """Get an agent optimization job. Retrieves an optimization job by its identifier. :param job_id: The ID of the job. Required. :type job_id: str - :return: OptimizationJob. The OptimizationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.OptimizationJob + :return: AgentOptimizationJob. The AgentOptimizationJob is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentOptimizationJob :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -17433,7 +19418,7 @@ def get_optimization_job(self, job_id: str, **kwargs: Any) -> _models.Optimizati _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.OptimizationJob] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentOptimizationJob] = kwargs.pop("cls", None) _request = build_beta_agents_get_optimization_job_request( job_id=job_id, @@ -17473,7 +19458,7 @@ def get_optimization_job(self, job_id: str, **kwargs: Any) -> _models.Optimizati if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.OptimizationJob, response.json()) + deserialized = _deserialize(_models.AgentOptimizationJob, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -17490,7 +19475,7 @@ def list_optimization_jobs( status: Optional[Union[str, _models.JobStatus]] = None, agent_name: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.OptimizationJobListItem"]: + ) -> ItemPaged["_models.AgentOptimizationJobListItem"]: """List agent optimization jobs. Lists optimization jobs with cursor pagination and optional status or agent name filters. @@ -17514,14 +19499,14 @@ def list_optimization_jobs( :paramtype status: str or ~azure.ai.projects.models.JobStatus :keyword agent_name: Filter to jobs targeting this agent name. Default value is None. :paramtype agent_name: str - :return: An iterator like instance of OptimizationJobListItem - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.OptimizationJobListItem] + :return: An iterator like instance of AgentOptimizationJobListItem + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.AgentOptimizationJobListItem] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.OptimizationJobListItem]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.AgentOptimizationJobListItem]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -17553,7 +19538,7 @@ def prepare_request(_continuation_token=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.OptimizationJobListItem], + List[_models.AgentOptimizationJobListItem], deserialized.get("data", []), ) if cls: @@ -17582,7 +19567,7 @@ def get_next(_continuation_token=None): return ItemPaged(get_next, extract_data) @distributed_trace - def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.OptimizationJob: + def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.AgentOptimizationJob: """Cancel an agent optimization job. Requests cancellation of a running or queued job and returns an error if the job is already in @@ -17590,8 +19575,8 @@ def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.Optimiz :param job_id: The ID of the job to cancel. Required. :type job_id: str - :return: OptimizationJob. The OptimizationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.OptimizationJob + :return: AgentOptimizationJob. The AgentOptimizationJob is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentOptimizationJob :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -17605,7 +19590,7 @@ def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.Optimiz _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.OptimizationJob] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentOptimizationJob] = kwargs.pop("cls", None) _request = build_beta_agents_cancel_optimization_job_request( job_id=job_id, @@ -17642,7 +19627,7 @@ def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.Optimiz if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.OptimizationJob, response.json()) + deserialized = _deserialize(_models.AgentOptimizationJob, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/types.py b/sdk/ai/azure-ai-projects/azure/ai/projects/types.py new file mode 100644 index 000000000000..2438c098c2a9 --- /dev/null +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/types.py @@ -0,0 +1,12134 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Literal, Optional, TYPE_CHECKING, Union +from typing_extensions import Required, TypedDict + +from ._utils.utils import FileType +from .models._enums import ( + AgentBlueprintReferenceType, + AgentEndpointAuthorizationSchemeType, + AgentKind, + AgentOptimizationDatasetInputType, + ContainerNetworkPolicyParamType, + ContainerSkillType, + CreateTranscriptionResponseJsonUsageType, + CustomToolParamFormatType, + DataGenerationJobOutputType, + DataGenerationJobSourceType, + DataGenerationJobType, + DatasetType, + EvaluationRuleActionType, + EvaluationTaxonomyInputType, + EvaluatorDefinitionType, + EvaluatorGenerationJobSourceType, + FunctionShellToolParamEnvironmentType, + IndexType, + InsightType, + MemoryStoreKind, + OpenApiAuthType, + PendingUploadType, + RealtimeAudioFormatsType, + RealtimeClientEventType, + RealtimeConversationItemMessageType, + RealtimeConversationItemType, + RealtimeMcpErrorType, + RealtimeServerEventType, + RecurrenceType, + RoutineActionType, + RoutineDispatchPayloadType, + RoutineTriggerType, + SampleType, + ScheduleTaskType, + TelemetryEndpointAuthType, + TelemetryEndpointKind, + TextResponseFormatConfigurationType, + ToolChoiceParamType, + ToolType, + ToolboxToolType, + TriggerType, + VersionIndicatorType, + VersionSelectorType, + VoiceConversationItemType, + VoiceTurnDetectionType, +) + +if TYPE_CHECKING: + from . import _unions + from .models import ( + AgentEndpointProtocol, + AgentKind, + AttackStrategy, + AzureAISearchQueryType, + CallableToolAllowedCaller, + CodeDependencyResolution, + ComputerEnvironment, + ContainerMemoryLimit, + DataGenerationJobScenario, + DayOfWeek, + EvaluationLevel, + EvaluationRuleEventType, + EvaluatorCategory, + EvaluatorMetricDirection, + EvaluatorMetricType, + EvaluatorType, + FoundryModelArtifactProfileCategory, + FoundryModelArtifactProfileSignal, + FoundryModelSourceType, + FoundryModelWarningCode, + FoundryModelWeightType, + GenerationWarningType, + GitHubIssueEvent, + GrammarSyntax1, + ImageGenAction, + InputFidelity, + JobStatus, + MemoryItemKind, + OperationState, + RankerVersionType, + RealtimeReasoningEffort, + ReasoningEffort, + ReasoningModeEnum, + RiskCategory, + RubricGenerationInputQualityWarningCode, + RubricGenerationInputQualityWarningSeverity, + RubricGenerationInputQualityWarningSource, + ScheduleProvisioningStatus, + SearchContentType, + SearchContextSize, + SimpleQnAFineTuningQuestionType, + TelemetryDataKind, + TelemetryTransportProtocol, + ToolChoiceOptions, + ToolSearchExecutionType, + TreatmentEffectType, + VoiceAgentAnimationOutputType, + VoiceAgentEchoCancellationReferenceSource, + VoiceAgentInterimResponseTrigger, + VoiceAgentSessionIncludeOption, + VoiceAgentToolResponseScheduling, + VoiceAudioFormatType, + VoiceAudioTimestampType, + VoiceAvatarOutputProtocol, + VoiceAvatarType, + VoiceEndOfUtteranceDetectionModel, + VoiceEndOfUtteranceThresholdLevel, + VoiceInputTranscriptionModel, + VoiceModelType, + VoiceNoiseReductionType, + VoiceOutputModality, + VoiceSystemToolName, + ) + + +class _CreateAgentVersionFromCodeContent(TypedDict, total=False): + """Multipart request body for updating or versioning a code-based agent (POST /agents/{name} and + POST /agents/{name}/versions). + + :ivar metadata: JSON metadata including description and hosted definition. Required. + :vartype metadata: "_CreateAgentVersionFromCodeMetadata" + :ivar code: The code zip file (max 250 MB). Required. + :vartype code: FileType + """ + + metadata: Required["_CreateAgentVersionFromCodeMetadata"] + """JSON metadata including description and hosted definition. Required.""" + code: Required[FileType] + """The code zip file (max 250 MB). Required.""" + + +class _CreateAgentVersionFromCodeMetadata(TypedDict, total=False): + """JSON metadata for code-based agent operations (create, update, create version). The agent name + comes from the URL path parameter or the ``x-ms-agent-name`` header, so it is not included in + this model. The content hash (SHA-256 of the zip) is carried in the ``x-ms-code-zip-sha256`` + header. + + :ivar description: A human-readable description of the agent. + :vartype description: str + :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. + :vartype metadata: dict[str, str] + :ivar definition: The hosted agent definition including code_configuration (runtime, + entry_point), cpu, memory, and protocol_versions. Required. + :vartype definition: "HostedAgentDefinition" + """ + + description: str + """A human-readable description of the agent.""" + metadata: dict[str, str] + """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.""" + definition: Required["HostedAgentDefinition"] + """The hosted agent definition including code_configuration (runtime, entry_point), cpu, memory, + and protocol_versions. Required.""" + + +class A2APreviewTool(TypedDict, total=False): + """An agent implementing the A2A protocol. + + :ivar type: The type of the tool. Always ``"a2a_preview``. Required. A2A_PREVIEW. + :vartype type: Literal[ToolType.A2A_PREVIEW] + :ivar base_url: Base URL of the agent. + :vartype base_url: str + :ivar agent_card_path: The path to the agent card relative to the ``base_url``. If not + provided, defaults to ``/.well-known/agent-card.json``. + :vartype agent_card_path: str + :ivar project_connection_id: The connection ID in the project for the A2A server. The + connection stores authentication and other connection details needed to connect to the A2A + server. + :vartype project_connection_id: str + :ivar send_credentials_for_agent_card: When ``true``, Foundry sends its credentials when + fetching the remote agent's Agent Card. The service defaults to ``false`` if a value is not + specified by the caller (anonymous fetch). + :vartype send_credentials_for_agent_card: bool + """ + + type: Required[Literal[ToolType.A2A_PREVIEW]] + """The type of the tool. Always ``\"a2a_preview``. Required. A2A_PREVIEW.""" + base_url: str + """Base URL of the agent.""" + agent_card_path: str + """The path to the agent card relative to the ``base_url``. If not provided, defaults to + ``/.well-known/agent-card.json``.""" + project_connection_id: str + """The connection ID in the project for the A2A server. The connection stores authentication and + other connection details needed to connect to the A2A server.""" + send_credentials_for_agent_card: bool + """When ``true``, Foundry sends its credentials when fetching the remote agent's Agent Card. The + service defaults to ``false`` if a value is not specified by the caller (anonymous fetch).""" + + +class A2APreviewToolboxTool(TypedDict, total=False): + """An A2A 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, "ToolConfig"] + :ivar type: Required. A2A_PREVIEW. + :vartype type: Literal[ToolboxToolType.A2A_PREVIEW] + :ivar base_url: Base URL of the agent. + :vartype base_url: str + :ivar agent_card_path: The path to the agent card relative to the ``base_url``. If not + provided, defaults to ``/.well-known/agent-card.json``. + :vartype agent_card_path: str + :ivar project_connection_id: The connection ID in the project for the A2A server. The + connection stores authentication and other connection details needed to connect to the A2A + server. + :vartype project_connection_id: str + :ivar send_credentials_for_agent_card: When ``true``, Foundry sends its credentials when + fetching the remote agent's Agent Card. The service defaults to ``false`` if a value is not + specified by the caller (anonymous fetch). + :vartype send_credentials_for_agent_card: bool + """ + + name: str + """Optional user-defined name for this tool or configuration.""" + description: str + """Optional user-defined description for this tool or configuration.""" + tool_configs: dict[str, "ToolConfig"] + """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.""" + type: Required[Literal[ToolboxToolType.A2A_PREVIEW]] + """Required. A2A_PREVIEW.""" + base_url: str + """Base URL of the agent.""" + agent_card_path: str + """The path to the agent card relative to the ``base_url``. If not provided, defaults to + ``/.well-known/agent-card.json``.""" + project_connection_id: str + """The connection ID in the project for the A2A server. The connection stores authentication and + other connection details needed to connect to the A2A server.""" + send_credentials_for_agent_card: bool + """When ``true``, Foundry sends its credentials when fetching the remote agent's Agent Card. The + service defaults to ``false`` if a value is not specified by the caller (anonymous fetch).""" + + +class A2AProtocolConfiguration(TypedDict, total=False): + """Configuration specific to the A2A protocol.""" + + +class ActivityProtocolConfiguration(TypedDict, total=False): + """Configuration specific to the activity protocol. + + :ivar enable_m365_public_endpoint: Whether to enable the M365 public endpoint for the activity + protocol. + :vartype enable_m365_public_endpoint: bool + """ + + enable_m365_public_endpoint: bool + """Whether to enable the M365 public endpoint for the activity protocol.""" + + +class AgentCard(TypedDict, total=False): + """AgentCard. + + :ivar version: The version of the agent card. Required. + :vartype version: str + :ivar description: The description of the agent card. + :vartype description: str + :ivar skills: The set of skills that an agent can perform. Required. + :vartype skills: list["AgentCardSkill"] + """ + + version: Required[str] + """The version of the agent card. Required.""" + description: str + """The description of the agent card.""" + skills: Required[list["AgentCardSkill"]] + """The set of skills that an agent can perform. Required.""" + + +class AgentCardSkill(TypedDict, total=False): + """AgentCardSkill. + + :ivar id: a unique identifier for the skill. Required. + :vartype id: str + :ivar name: The name of the skill. Required. + :vartype name: str + :ivar description: A description of the skill. + :vartype description: str + :ivar tags: set of tagwords describing classes of capabilities for the skill. + :vartype tags: list[str] + :ivar examples: A list of example scenarios that the skill can perform. + :vartype examples: list[str] + """ + + id: Required[str] + """a unique identifier for the skill. Required.""" + name: Required[str] + """The name of the skill. Required.""" + description: str + """A description of the skill.""" + tags: list[str] + """set of tagwords describing classes of capabilities for the skill.""" + examples: list[str] + """A list of example scenarios that the skill can perform.""" + + +class AgentClusterInsightRequest(TypedDict, total=False): + """Insights on set of Agent Evaluation Results. + + :ivar type: The type of request. Required. Cluster Insight on an Agent. + :vartype type: Literal[InsightType.AGENT_CLUSTER_INSIGHT] + :ivar agentName: Identifier for the agent. Required. + :vartype agentName: str + :ivar modelConfiguration: Configuration of the model used in the insight generation. + :vartype modelConfiguration: "InsightModelConfiguration" + """ + + type: Required[Literal[InsightType.AGENT_CLUSTER_INSIGHT]] + """The type of request. Required. Cluster Insight on an Agent.""" + agentName: Required[str] + """Identifier for the agent. Required.""" + modelConfiguration: "InsightModelConfiguration" + """Configuration of the model used in the insight generation.""" + + +class AgentClusterInsightResult(TypedDict, total=False): + """Insights from the agent cluster analysis. + + :ivar type: The type of insights result. Required. Cluster Insight on an Agent. + :vartype type: Literal[InsightType.AGENT_CLUSTER_INSIGHT] + :ivar clusterInsight: Required. + :vartype clusterInsight: "ClusterInsightResult" + """ + + type: Required[Literal[InsightType.AGENT_CLUSTER_INSIGHT]] + """The type of insights result. Required. Cluster Insight on an Agent.""" + clusterInsight: Required["ClusterInsightResult"] + """Required.""" + + +class AgentDataGenerationJobSource(TypedDict, total=False): + """Agent source for data generation jobs — references an agent to fetch instructions and metadata + from. + + :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 Agent. Required. Agent source — + references an agent. + :vartype type: Literal[DataGenerationJobSourceType.AGENT] + :ivar agent_name: The agent name to fetch instructions from. Required. + :vartype agent_name: str + :ivar agent_version: The agent version. If not specified, the latest version is used. + :vartype agent_version: str + """ + + description: str + """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: Required[Literal[DataGenerationJobSourceType.AGENT]] + """The source type for this source, which is Agent. Required. Agent source — references an agent.""" + agent_name: Required[str] + """The agent name to fetch instructions from. Required.""" + agent_version: str + """The agent version. If not specified, the latest version is used.""" + + +class AgentEndpointConfig(TypedDict, total=False): + """AgentEndpointConfig. + + :ivar version_selector: The version selector of the agent endpoint determines how traffic is + routed to different versions of the agent. + :vartype version_selector: "VersionSelector" + :ivar protocol_configuration: Per-protocol configuration for the agent endpoint. + :vartype protocol_configuration: "ProtocolConfiguration" + :ivar authorization_schemes: The authorization schemes supported by the agent endpoint. + :vartype authorization_schemes: list["AgentEndpointAuthorizationScheme"] + """ + + version_selector: "VersionSelector" + """The version selector of the agent endpoint determines how traffic is routed to different + versions of the agent.""" + protocol_configuration: "ProtocolConfiguration" + """Per-protocol configuration for the agent endpoint.""" + authorization_schemes: list["AgentEndpointAuthorizationScheme"] + """The authorization schemes supported by the agent endpoint.""" + + +class AgentEvaluatorGenerationJobSource(TypedDict, total=False): + """Agent source for evaluator generation jobs — references an agent to fetch instructions and + metadata from. + + :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 Agent. Required. Agent source — + references an agent to fetch instructions and metadata from. + :vartype type: Literal[EvaluatorGenerationJobSourceType.AGENT] + :ivar agent_name: The agent name to fetch instructions from. Required. + :vartype agent_name: str + :ivar agent_version: The agent version. If not specified, the latest version is used. + :vartype agent_version: str + """ + + description: str + """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: Required[Literal[EvaluatorGenerationJobSourceType.AGENT]] + """The source type for this source, which is Agent. Required. Agent source — references an agent + to fetch instructions and metadata from.""" + agent_name: Required[str] + """The agent name to fetch instructions from. Required.""" + agent_version: str + """The agent version. If not specified, the latest version is used.""" + + +class AgentOptimizationCandidate(TypedDict, total=False): + """Aggregated evaluation result for a single candidate agent configuration across all tasks. + + :ivar candidate_id: Server-assigned candidate identifier. Use with GET /candidates/{id} + sub-endpoints. + :vartype candidate_id: str + :ivar name: Display name of the candidate (e.g., 'baseline', 'instruction-v2'). Required. + :vartype name: str + :ivar mutations: What was mutated from the baseline (e.g., {system_prompt: 'new prompt'}). + :vartype mutations: dict[str, Any] + :ivar avg_score: Average composite score across all tasks. Required. + :vartype avg_score: float + :ivar avg_tokens: Average token usage across all tasks. Required. + :vartype avg_tokens: float + :ivar eval_id: Foundry evaluation identifier used to score this candidate. + :vartype eval_id: str + :ivar eval_run_id: Foundry evaluation run identifier for this candidate's scoring run. + :vartype eval_run_id: str + :ivar promotion: Promotion metadata. Null if the candidate has not been promoted. + :vartype promotion: "PromotionInfo" + """ + + candidate_id: str + """Server-assigned candidate identifier. Use with GET /candidates/{id} sub-endpoints.""" + name: Required[str] + """Display name of the candidate (e.g., 'baseline', 'instruction-v2'). Required.""" + mutations: dict[str, Any] + """What was mutated from the baseline (e.g., {system_prompt: 'new prompt'}).""" + avg_score: Required[float] + """Average composite score across all tasks. Required.""" + avg_tokens: Required[float] + """Average token usage across all tasks. Required.""" + eval_id: str + """Foundry evaluation identifier used to score this candidate.""" + eval_run_id: str + """Foundry evaluation run identifier for this candidate's scoring run.""" + promotion: "PromotionInfo" + """Promotion metadata. Null if the candidate has not been promoted.""" + + +class AgentOptimizationDatasetCriterion(TypedDict, total=False): + """Evaluation criterion: a name + instruction pair used for per-item scoring. + + :ivar name: Criterion name. Required. + :vartype name: str + :ivar instruction: Criterion instruction / description. Required. + :vartype instruction: str + """ + + name: Required[str] + """Criterion name. Required.""" + instruction: Required[str] + """Criterion instruction / description. Required.""" + + +class AgentOptimizationDatasetItem(TypedDict, total=False): + """A single item in an inline dataset. + + :ivar query: The user query / prompt. + :vartype query: str + :ivar ground_truth: Expected ground truth answer. + :vartype ground_truth: str + :ivar desired_num_turns: Desired number of conversation turns for simulation mode (1-20). + :vartype desired_num_turns: int + :ivar criteria: Per-item evaluation criteria. + :vartype criteria: list["AgentOptimizationDatasetCriterion"] + """ + + query: str + """The user query / prompt.""" + ground_truth: str + """Expected ground truth answer.""" + desired_num_turns: int + """Desired number of conversation turns for simulation mode (1-20).""" + criteria: list["AgentOptimizationDatasetCriterion"] + """Per-item evaluation criteria.""" + + +class AgentOptimizationEvaluatorRef(TypedDict, total=False): + """Reference to a named evaluator, optionally pinned to a version. + + :ivar name: Evaluator name. Required. + :vartype name: str + :ivar version: Evaluator version. If not specified, the latest version is used. + :vartype version: str + """ + + name: Required[str] + """Evaluator name. Required.""" + version: str + """Evaluator version. If not specified, the latest version is used.""" + + +class AgentOptimizationInlineDatasetInput(TypedDict, total=False): + """Inline dataset — items supplied directly in the request body. + + :ivar type: Dataset input type discriminator. Required. Inline dataset — items are provided + directly in the request body. + :vartype type: Literal[AgentOptimizationDatasetInputType.INLINE] + :ivar items: Dataset items. Required. + :vartype items: list["AgentOptimizationDatasetItem"] + """ + + type: Required[Literal[AgentOptimizationDatasetInputType.INLINE]] + """Dataset input type discriminator. Required. Inline dataset — items are provided directly in the + request body.""" + items: Required[list["AgentOptimizationDatasetItem"]] + """Dataset items. Required.""" + + +class AgentOptimizationJob(TypedDict, total=False): + """Agent optimization job resource — a long-running job that optimizes an agent's configuration + (instructions, model, skills, tools) to maximize evaluation scores. On success, the result + contains scored candidates. + + :ivar id: Server-assigned unique identifier. Required. + :vartype id: str + :ivar inputs: Caller-supplied inputs. + :vartype inputs: "AgentOptimizationJobInputs" + :ivar result: Result produced on success. + :vartype result: "AgentOptimizationJobResult" + :ivar status: Current lifecycle status. Required. Known values are: "queued", "in_progress", + "succeeded", "failed", and "cancelled". + :vartype status: Union[str, "JobStatus"] + :ivar error: Error details — populated only on failure. + :vartype error: "ApiError" + :ivar created_at: The timestamp when the job was created, represented in Unix time. Required. + :vartype created_at: int + :ivar updated_at: The timestamp when the job was last updated, represented in Unix time. + Required. + :vartype updated_at: int + :ivar progress: Progress snapshot. May be present in terminal states reflecting last-known + progress. + :vartype progress: "AgentOptimizationJobProgress" + :ivar warnings: Non-fatal warnings emitted at any point during optimization. + :vartype warnings: list[str] + """ + + id: Required[str] + """Server-assigned unique identifier. Required.""" + inputs: "AgentOptimizationJobInputs" + """Caller-supplied inputs.""" + result: "AgentOptimizationJobResult" + """Result produced on success.""" + status: Required[Union[str, "JobStatus"]] + """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", + \"succeeded\", \"failed\", and \"cancelled\".""" + error: "ApiError" + """Error details — populated only on failure.""" + created_at: Required[int] + """The timestamp when the job was created, represented in Unix time. Required.""" + updated_at: Required[int] + """The timestamp when the job was last updated, represented in Unix time. Required.""" + progress: "AgentOptimizationJobProgress" + """Progress snapshot. May be present in terminal states reflecting last-known progress.""" + warnings: list[str] + """Non-fatal warnings emitted at any point during optimization.""" + + +class AgentOptimizationJobInputs(TypedDict, total=False): + """Caller-supplied inputs for an optimization job. + + :ivar agent: The agent (and pinned version) being optimized. Required. + :vartype agent: "OptimizedAgentIdentifier" + :ivar train_dataset: Training dataset — either inline items or a reference to a registered + dataset. Required. Required. + :vartype train_dataset: "AgentOptimizationDatasetInput" + :ivar validation_dataset: Optional held-out validation dataset for measuring generalization of + the final candidate. + :vartype validation_dataset: "AgentOptimizationDatasetInput" + :ivar evaluators: Job-level evaluators referenced by name and optional version. Required; at + least one must be provided. Required. + :vartype evaluators: list["AgentOptimizationEvaluatorRef"] + :ivar options: Tuning knobs and run-mode. + :vartype options: "AgentOptimizationOptions" + """ + + agent: Required["OptimizedAgentIdentifier"] + """The agent (and pinned version) being optimized. Required.""" + train_dataset: Required["AgentOptimizationDatasetInput"] + """Training dataset — either inline items or a reference to a registered dataset. Required. + Required.""" + validation_dataset: "AgentOptimizationDatasetInput" + """Optional held-out validation dataset for measuring generalization of the final candidate.""" + evaluators: Required[list["AgentOptimizationEvaluatorRef"]] + """Job-level evaluators referenced by name and optional version. Required; at least one must be + provided. Required.""" + options: "AgentOptimizationOptions" + """Tuning knobs and run-mode.""" + + +class AgentOptimizationJobProgress(TypedDict, total=False): + """In-flight progress; only populated while status is queued or in_progress. + + :ivar candidates_completed: Number of candidates whose evaluation has completed so far. + Required. + :vartype candidates_completed: int + :ivar best_score: Best score observed so far across all candidates. Required. + :vartype best_score: float + :ivar elapsed_seconds: Wall-clock time elapsed in seconds since the job began executing. + Required. + :vartype elapsed_seconds: float + """ + + candidates_completed: Required[int] + """Number of candidates whose evaluation has completed so far. Required.""" + best_score: Required[float] + """Best score observed so far across all candidates. Required.""" + elapsed_seconds: Required[float] + """Wall-clock time elapsed in seconds since the job began executing. Required.""" + + +class AgentOptimizationJobResult(TypedDict, total=False): + """Terminal-state result body. Populated when status is succeeded or failed. + + :ivar baseline: Candidate ID of the original (un-optimized) baseline evaluation. + :vartype baseline: str + :ivar best: Candidate ID of the highest-scoring candidate found during optimization. + :vartype best: str + :ivar candidates: All evaluated candidates including baseline. + :vartype candidates: list["AgentOptimizationCandidate"] + """ + + baseline: str + """Candidate ID of the original (un-optimized) baseline evaluation.""" + best: str + """Candidate ID of the highest-scoring candidate found during optimization.""" + candidates: list["AgentOptimizationCandidate"] + """All evaluated candidates including baseline.""" + + +class AgentOptimizationOptions(TypedDict, total=False): + """Tuning knobs and run-mode for an optimization job. + + :ivar max_candidates: Maximum number of optimization candidates to generate. Must be >= 1. + Default: 5. + :vartype max_candidates: int + :ivar optimization_config: Per-target-attribute configuration overrides. Contains skills, + tools, system_prompt for the agent, plus model space for model optimization. + :vartype optimization_config: dict[str, Any] + :ivar eval_model: Model deployment used for evaluation. Defaults to server config (typically + 'gpt-4o'). + :vartype eval_model: str + :ivar optimization_model: Model deployment for optimization reasoning (must be gpt-5 family). + Falls back to the default eval model when not set. + :vartype optimization_model: str + :ivar evaluation_level: Evaluation granularity. Null/omitted means per-item single-turn. Set to + 'conversation' for per-conversation multi-turn simulation scoring. Known values are: "turn" and + "conversation". + :vartype evaluation_level: Union[str, "EvaluationLevel"] + :ivar max_stalls: Maximum number of consecutive reflective minibatch rejections before stopping + early. A 'stall' occurs when the optimizer proposes a prompt change, evaluates it on a small + subset, and the score does not improve — so no full validation-set evaluation is triggered. The + counter resets whenever a minibatch passes and its full-validation score beats the current + best. Only a sustained plateau of ``max_stalls`` consecutive minibatch failures triggers the + stop. The service defaults to 5 if a value is not specified by the caller. Must be >= 1 when + set. + :vartype max_stalls: int + """ + + max_candidates: int + """Maximum number of optimization candidates to generate. Must be >= 1. Default: 5.""" + optimization_config: dict[str, Any] + """Per-target-attribute configuration overrides. Contains skills, tools, system_prompt for the + agent, plus model space for model optimization.""" + eval_model: str + """Model deployment used for evaluation. Defaults to server config (typically 'gpt-4o').""" + optimization_model: str + """Model deployment for optimization reasoning (must be gpt-5 family). Falls back to the default + eval model when not set.""" + evaluation_level: Union[str, "EvaluationLevel"] + """Evaluation granularity. Null/omitted means per-item single-turn. Set to 'conversation' for + per-conversation multi-turn simulation scoring. Known values are: \"turn\" and + \"conversation\".""" + max_stalls: int + """Maximum number of consecutive reflective minibatch rejections before stopping early. A 'stall' + occurs when the optimizer proposes a prompt change, evaluates it on a small subset, and the + score does not improve — so no full validation-set evaluation is triggered. The counter resets + whenever a minibatch passes and its full-validation score beats the current best. Only a + sustained plateau of ``max_stalls`` consecutive minibatch failures triggers the stop. The + service defaults to 5 if a value is not specified by the caller. Must be >= 1 when set.""" + + +class AgentOptimizationReferenceDatasetInput(TypedDict, total=False): + """Reference to a registered Foundry dataset. + + :ivar type: Dataset input type discriminator. Required. Reference to a registered Foundry + dataset by name and version. + :vartype type: Literal[AgentOptimizationDatasetInputType.REFERENCE] + :ivar name: Registered dataset name. Required. + :vartype name: str + :ivar version: Dataset version. If not specified, the latest version is used. + :vartype version: str + """ + + type: Required[Literal[AgentOptimizationDatasetInputType.REFERENCE]] + """Dataset input type discriminator. Required. Reference to a registered Foundry dataset by name + and version.""" + name: Required[str] + """Registered dataset name. Required.""" + version: str + """Dataset version. If not specified, the latest version is used.""" + + +class AgentTaxonomyInput(TypedDict, total=False): + """Input configuration for the evaluation taxonomy when the input type is agent. + + :ivar type: Input type of the evaluation taxonomy. Required. Agent. + :vartype type: Literal[EvaluationTaxonomyInputType.AGENT] + :ivar target: Target configuration for the agent. Required. + :vartype target: "EvaluationTarget" + :ivar riskCategories: List of risk categories to evaluate against. Required. + :vartype riskCategories: list[Union[str, "RiskCategory"]] + """ + + type: Required[Literal[EvaluationTaxonomyInputType.AGENT]] + """Input type of the evaluation taxonomy. Required. Agent.""" + target: Required["EvaluationTarget"] + """Target configuration for the agent. Required.""" + riskCategories: Required[list[Union[str, "RiskCategory"]]] + """List of risk categories to evaluate against. Required.""" + + +class AISearchIndexResource(TypedDict, total=False): + """A AI Search Index resource. + + :ivar project_connection_id: An index connection ID in an IndexResource attached to this agent. + :vartype project_connection_id: str + :ivar index_name: The name of an index in an IndexResource attached to this agent. + :vartype index_name: str + :ivar query_type: Type of query in an AIIndexResource attached to this agent. Known values are: + "simple", "semantic", "vector", "vector_simple_hybrid", and "vector_semantic_hybrid". + :vartype query_type: Union[str, "AzureAISearchQueryType"] + :ivar top_k: Number of documents to retrieve from search and present to the model. + :vartype top_k: int + :ivar filter: filter string for search resource. `Learn more here + `_. + :vartype filter: str + :ivar index_asset_id: Index asset id for search resource. + :vartype index_asset_id: str + """ + + project_connection_id: str + """An index connection ID in an IndexResource attached to this agent.""" + index_name: str + """The name of an index in an IndexResource attached to this agent.""" + query_type: Union[str, "AzureAISearchQueryType"] + """Type of query in an AIIndexResource attached to this agent. Known values are: \"simple\", + \"semantic\", \"vector\", \"vector_simple_hybrid\", and \"vector_semantic_hybrid\".""" + top_k: int + """Number of documents to retrieve from search and present to the model.""" + filter: str + """filter string for search resource. `Learn more here + `_.""" + index_asset_id: str + """Index asset id for search resource.""" + + +class ApiError(TypedDict, total=False): + """ApiError. + + :ivar code: Required. + :vartype code: str + :ivar message: Required. + :vartype message: str + :ivar param: + :vartype param: str + :ivar type: + :vartype type: str + :ivar details: + :vartype details: list["ApiError"] + :ivar additionalInfo: + :vartype additionalInfo: dict[str, Any] + :ivar debugInfo: + :vartype debugInfo: dict[str, Any] + """ + + code: Required[Optional[str]] + """Required.""" + message: Required[str] + """Required.""" + param: Optional[str] + type: str + details: list["ApiError"] + additionalInfo: dict[str, Any] + debugInfo: dict[str, Any] + + +class ApplyPatchToolParam(TypedDict, total=False): + """Apply patch tool. + + :ivar type: The type of the tool. Always ``apply_patch``. Required. APPLY_PATCH. + :vartype type: Literal[ToolType.APPLY_PATCH] + :ivar allowed_callers: + :vartype allowed_callers: list[Union[str, "CallableToolAllowedCaller"]] + """ + + type: Required[Literal[ToolType.APPLY_PATCH]] + """The type of the tool. Always ``apply_patch``. Required. APPLY_PATCH.""" + allowed_callers: Optional[list[Union[str, "CallableToolAllowedCaller"]]] + + +class ApproximateLocation(TypedDict, total=False): + """ApproximateLocation. + + :ivar type: The type of location approximation. Always ``approximate``. Required. Default value + is "approximate". + :vartype type: Literal["approximate"] + :ivar country: + :vartype country: str + :ivar region: + :vartype region: str + :ivar city: + :vartype city: str + :ivar timezone: + :vartype timezone: str + """ + + type: Required[Literal["approximate"]] + """The type of location approximation. Always ``approximate``. Required. Default value is + \"approximate\".""" + country: Optional[str] + region: Optional[str] + city: Optional[str] + timezone: Optional[str] + + +class ArtifactProfile(TypedDict, total=False): + """Artifact profile of the model. + + :ivar category: The category of the artifact profile. Required. Known values are: "DataOnly", + "RuntimeDependent", and "Unknown". + :vartype category: Union[str, "FoundryModelArtifactProfileCategory"] + :ivar signals: Signals detected in the model artifact. + :vartype signals: list[Union[str, "FoundryModelArtifactProfileSignal"]] + """ + + category: Required[Union[str, "FoundryModelArtifactProfileCategory"]] + """The category of the artifact profile. Required. Known values are: \"DataOnly\", + \"RuntimeDependent\", and \"Unknown\".""" + signals: list[Union[str, "FoundryModelArtifactProfileSignal"]] + """Signals detected in the model artifact.""" + + +class AutoCodeInterpreterToolParam(TypedDict, total=False): + """Automatic Code Interpreter Tool Parameters. + + :ivar type: Always ``auto``. Required. Default value is "auto". + :vartype type: Literal["auto"] + :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: Union[str, "ContainerMemoryLimit"] + :ivar network_policy: + :vartype network_policy: "ContainerNetworkPolicyParam" + """ + + type: Required[Literal["auto"]] + """Always ``auto``. Required. Default value is \"auto\".""" + file_ids: list[str] + """An optional list of uploaded files to make available to your code.""" + memory_limit: Optional[Union[str, "ContainerMemoryLimit"]] + """Known values are: \"1g\", \"4g\", \"16g\", and \"64g\".""" + network_policy: "ContainerNetworkPolicyParam" + + +class AzureAIAgentTarget(TypedDict, total=False): + """Represents a target specifying an Azure AI agent. + + :ivar type: The type of target, always ``azure_ai_agent``. Required. Default value is + "azure_ai_agent". + :vartype type: Literal["azure_ai_agent"] + :ivar name: The unique identifier of the Azure AI agent. Required. + :vartype name: str + :ivar version: The version of the Azure AI agent. + :vartype version: str + :ivar tool_descriptions: The parameters used to control the sampling behavior of the agent + during text generation. + :vartype tool_descriptions: list["ToolDescription"] + :ivar tools: + :vartype tools: list["Tool"] + """ + + type: Required[Literal["azure_ai_agent"]] + """The type of target, always ``azure_ai_agent``. Required. Default value is \"azure_ai_agent\".""" + name: Required[str] + """The unique identifier of the Azure AI agent. Required.""" + version: str + """The version of the Azure AI agent.""" + tool_descriptions: list["ToolDescription"] + """The parameters used to control the sampling behavior of the agent during text generation.""" + tools: list["Tool"] + + +class AzureAIModelTarget(TypedDict, total=False): + """Represents a target specifying an Azure AI model for operations requiring model selection. + + :ivar type: The type of target, always ``azure_ai_model``. Required. Default value is + "azure_ai_model". + :vartype type: Literal["azure_ai_model"] + :ivar model: The unique identifier of the Azure AI model. + :vartype model: str + :ivar sampling_params: The parameters used to control the sampling behavior of the model during + text generation. + :vartype sampling_params: "ModelSamplingParams" + """ + + type: Required[Literal["azure_ai_model"]] + """The type of target, always ``azure_ai_model``. Required. Default value is \"azure_ai_model\".""" + model: str + """The unique identifier of the Azure AI model.""" + sampling_params: "ModelSamplingParams" + """The parameters used to control the sampling behavior of the model during text generation.""" + + +class AzureAISearchIndex(TypedDict, total=False): + """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. Azure search. + :vartype type: Literal[IndexType.AZURE_SEARCH] + :ivar connectionName: Name of connection to Azure AI Search. Required. + :vartype connectionName: str + :ivar indexName: Name of index in Azure AI Search resource to attach. Required. + :vartype indexName: str + :ivar fieldMapping: Field mapping configuration. + :vartype fieldMapping: "FieldMapping" + """ + + id: str + """Asset ID, a unique identifier for the asset.""" + name: Required[str] + """The name of the resource. Required.""" + version: Required[str] + """The version of the resource. Required.""" + description: str + """The asset description text.""" + tags: dict[str, str] + """Tag dictionary. Tags can be added, removed, and updated.""" + type: Required[Literal[IndexType.AZURE_SEARCH]] + """Type of index. Required. Azure search.""" + connectionName: Required[str] + """Name of connection to Azure AI Search. Required.""" + indexName: Required[str] + """Name of index in Azure AI Search resource to attach. Required.""" + fieldMapping: "FieldMapping" + """Field mapping configuration.""" + + +class AzureAISearchTool(TypedDict, total=False): + """The input definition information for an Azure AI search tool as used to configure an agent. + + :ivar type: The object type, which is always 'azure_ai_search'. Required. AZURE_AI_SEARCH. + :vartype type: Literal[ToolType.AZURE_AI_SEARCH] + :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, "ToolConfig"] + :ivar azure_ai_search: The azure ai search index resource. Required. + :vartype azure_ai_search: "AzureAISearchToolResource" + """ + + type: Required[Literal[ToolType.AZURE_AI_SEARCH]] + """The object type, which is always 'azure_ai_search'. Required. AZURE_AI_SEARCH.""" + name: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + description: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + tool_configs: dict[str, "ToolConfig"] + """Deprecated. This property is deprecated and will be removed in a future version.""" + azure_ai_search: Required["AzureAISearchToolResource"] + """The azure ai search index resource. Required.""" + + +class AzureAISearchToolboxTool(TypedDict, total=False): + """An Azure AI 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, "ToolConfig"] + :ivar type: Required. AZURE_AI_SEARCH. + :vartype type: Literal[ToolboxToolType.AZURE_AI_SEARCH] + :ivar azure_ai_search: The azure ai search index resource. Required. + :vartype azure_ai_search: "AzureAISearchToolResource" + """ + + name: str + """Optional user-defined name for this tool or configuration.""" + description: str + """Optional user-defined description for this tool or configuration.""" + tool_configs: dict[str, "ToolConfig"] + """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.""" + type: Required[Literal[ToolboxToolType.AZURE_AI_SEARCH]] + """Required. AZURE_AI_SEARCH.""" + azure_ai_search: Required["AzureAISearchToolResource"] + """The azure ai search index resource. Required.""" + + +class AzureAISearchToolResource(TypedDict, total=False): + """A set of index resources used by the ``azure_ai_search`` tool. + + :ivar indexes: The indices attached to this agent. There can be a maximum of 1 index resource + attached to the agent. Required. + :vartype indexes: list["AISearchIndexResource"] + """ + + indexes: Required[list["AISearchIndexResource"]] + """The indices attached to this agent. There can be a maximum of 1 index resource attached to the + agent. Required.""" + + +class AzureFunctionBinding(TypedDict, total=False): + """The structure for keeping storage queue name and URI. + + :ivar type: The type of binding, which is always 'storage_queue'. Required. Default value is + "storage_queue". + :vartype type: Literal["storage_queue"] + :ivar storage_queue: Storage queue. Required. + :vartype storage_queue: "AzureFunctionStorageQueue" + """ + + type: Required[Literal["storage_queue"]] + """The type of binding, which is always 'storage_queue'. Required. Default value is + \"storage_queue\".""" + storage_queue: Required["AzureFunctionStorageQueue"] + """Storage queue. Required.""" + + +class AzureFunctionDefinition(TypedDict, total=False): + """The definition of Azure function. + + :ivar function: The definition of azure function and its parameters. Required. + :vartype function: "AzureFunctionDefinitionFunction" + :ivar input_binding: Input storage queue. The queue storage trigger runs a function as messages + are added to it. Required. + :vartype input_binding: "AzureFunctionBinding" + :ivar output_binding: Output storage queue. The function writes output to this queue when the + input items are processed. Required. + :vartype output_binding: "AzureFunctionBinding" + """ + + function: Required["AzureFunctionDefinitionFunction"] + """The definition of azure function and its parameters. Required.""" + input_binding: Required["AzureFunctionBinding"] + """Input storage queue. The queue storage trigger runs a function as messages are added to it. + Required.""" + output_binding: Required["AzureFunctionBinding"] + """Output storage queue. The function writes output to this queue when the input items are + processed. Required.""" + + +class AzureFunctionDefinitionFunction(TypedDict, total=False): + """AzureFunctionDefinitionFunction. + + :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] + """ + + name: Required[str] + """The name of the function to be called. Required.""" + description: str + """A description of what the function does, used by the model to choose when and how to call the + function.""" + parameters: Required[dict[str, Any]] + """The parameters the functions accepts, described as a JSON Schema object. Required.""" + + +class AzureFunctionStorageQueue(TypedDict, total=False): + """The structure for keeping storage queue name and URI. + + :ivar queue_service_endpoint: URI to the Azure Storage Queue service allowing you to manipulate + a queue. Required. + :vartype queue_service_endpoint: str + :ivar queue_name: The name of an Azure function storage queue. Required. + :vartype queue_name: str + """ + + queue_service_endpoint: Required[str] + """URI to the Azure Storage Queue service allowing you to manipulate a queue. Required.""" + queue_name: Required[str] + """The name of an Azure function storage queue. Required.""" + + +class AzureFunctionTool(TypedDict, total=False): + """The input definition information for an Azure Function Tool, as used to configure an Agent. + + :ivar type: The object type, which is always 'browser_automation'. Required. AZURE_FUNCTION. + :vartype type: Literal[ToolType.AZURE_FUNCTION] + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, "ToolConfig"] + :ivar azure_function: The Azure Function Tool definition. Required. + :vartype azure_function: "AzureFunctionDefinition" + """ + + type: Required[Literal[ToolType.AZURE_FUNCTION]] + """The object type, which is always 'browser_automation'. Required. AZURE_FUNCTION.""" + tool_configs: dict[str, "ToolConfig"] + """Deprecated. This property is deprecated and will be removed in a future version.""" + azure_function: Required["AzureFunctionDefinition"] + """The Azure Function Tool definition. Required.""" + + +class AzureOpenAIModelConfiguration(TypedDict, total=False): + """Azure OpenAI model configuration. The API version would be selected by the service for querying + the model. + + :ivar type: Required. Default value is "AzureOpenAIModel". + :vartype type: Literal["AzureOpenAIModel"] + :ivar modelDeploymentName: Deployment name for AOAI model. Example: gpt-4o if in AIServices or + connection based ``connection_name/deployment_name`` (e.g. ``my-aoai-connection/gpt-4o``). + Required. + :vartype modelDeploymentName: str + """ + + type: Required[Literal["AzureOpenAIModel"]] + """Required. Default value is \"AzureOpenAIModel\".""" + modelDeploymentName: Required[str] + """Deployment name for AOAI model. Example: gpt-4o if in AIServices or connection based + ``connection_name/deployment_name`` (e.g. ``my-aoai-connection/gpt-4o``). Required.""" + + +class BingCustomSearchConfiguration(TypedDict, total=False): + """A bing custom search configuration. + + :ivar project_connection_id: Project connection id for grounding with bing search. Required. + :vartype project_connection_id: str + :ivar instance_name: Name of the custom configuration instance given to config. Required. + :vartype instance_name: str + :ivar market: The market where the results come from. + :vartype market: str + :ivar set_lang: The language to use for user interface strings when calling Bing API. + :vartype set_lang: str + :ivar count: The number of search results to return in the bing api response. + :vartype count: int + :ivar freshness: Filter search results by a specific time range. See `accepted values here + `_. + :vartype freshness: str + """ + + project_connection_id: Required[str] + """Project connection id for grounding with bing search. Required.""" + instance_name: Required[str] + """Name of the custom configuration instance given to config. Required.""" + market: str + """The market where the results come from.""" + set_lang: str + """The language to use for user interface strings when calling Bing API.""" + count: int + """The number of search results to return in the bing api response.""" + freshness: str + """Filter search results by a specific time range. See `accepted values here + `_.""" + + +class BingCustomSearchPreviewTool(TypedDict, total=False): + """The input definition information for a Bing custom search tool as used to configure an agent. + + :ivar type: The object type, which is always 'bing_custom_search_preview'. Required. + BING_CUSTOM_SEARCH_PREVIEW. + :vartype type: Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW] + :ivar bing_custom_search_preview: The bing custom search tool parameters. Required. + :vartype bing_custom_search_preview: "BingCustomSearchToolParameters" + """ + + type: Required[Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW]] + """The object type, which is always 'bing_custom_search_preview'. Required. + BING_CUSTOM_SEARCH_PREVIEW.""" + bing_custom_search_preview: Required["BingCustomSearchToolParameters"] + """The bing custom search tool parameters. Required.""" + + +class BingCustomSearchToolParameters(TypedDict, total=False): + """The bing custom search tool parameters. + + :ivar search_configurations: The project connections attached to this tool. There can be a + maximum of 1 connection resource attached to the tool. Required. + :vartype search_configurations: list["BingCustomSearchConfiguration"] + """ + + search_configurations: Required[list["BingCustomSearchConfiguration"]] + """The project connections attached to this tool. There can be a maximum of 1 connection resource + attached to the tool. Required.""" + + +class BingGroundingSearchConfiguration(TypedDict, total=False): + """Search configuration for Bing Grounding. + + :ivar project_connection_id: Project connection id for grounding with bing search. Required. + :vartype project_connection_id: str + :ivar market: The market where the results come from. + :vartype market: str + :ivar set_lang: The language to use for user interface strings when calling Bing API. + :vartype set_lang: str + :ivar count: The number of search results to return in the bing api response. + :vartype count: int + :ivar freshness: Filter search results by a specific time range. See `accepted values here + `_. + :vartype freshness: str + """ + + project_connection_id: Required[str] + """Project connection id for grounding with bing search. Required.""" + market: str + """The market where the results come from.""" + set_lang: str + """The language to use for user interface strings when calling Bing API.""" + count: int + """The number of search results to return in the bing api response.""" + freshness: str + """Filter search results by a specific time range. See `accepted values here + `_.""" + + +class BingGroundingSearchToolParameters(TypedDict, total=False): + """The bing grounding search tool parameters. + + :ivar search_configurations: The search configurations attached to this tool. There can be a + maximum of 1 search configuration resource attached to the tool. Required. + :vartype search_configurations: list["BingGroundingSearchConfiguration"] + """ + + search_configurations: Required[list["BingGroundingSearchConfiguration"]] + """The search configurations attached to this tool. There can be a maximum of 1 search + configuration resource attached to the tool. Required.""" + + +class BingGroundingTool(TypedDict, total=False): + """The input definition information for a bing grounding search tool as used to configure an + agent. + + :ivar type: The object type, which is always 'bing_grounding'. Required. BING_GROUNDING. + :vartype type: Literal[ToolType.BING_GROUNDING] + :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, "ToolConfig"] + :ivar bing_grounding: The bing grounding search tool parameters. Required. + :vartype bing_grounding: "BingGroundingSearchToolParameters" + """ + + type: Required[Literal[ToolType.BING_GROUNDING]] + """The object type, which is always 'bing_grounding'. Required. BING_GROUNDING.""" + name: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + description: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + tool_configs: dict[str, "ToolConfig"] + """Deprecated. This property is deprecated and will be removed in a future version.""" + bing_grounding: Required["BingGroundingSearchToolParameters"] + """The bing grounding search tool parameters. Required.""" + + +class BotServiceAuthorizationScheme(TypedDict, total=False): + """BotServiceAuthorizationScheme. + + :ivar type: Required. BOT_SERVICE. + :vartype type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE] + """ + + type: Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE]] + """Required. BOT_SERVICE.""" + + +class BotServiceRbacAuthorizationScheme(TypedDict, total=False): + """BotServiceRbacAuthorizationScheme. + + :ivar type: Required. BOT_SERVICE_RBAC. + :vartype type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC] + """ + + type: Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC]] + """Required. BOT_SERVICE_RBAC.""" + + +class BotServiceTenantAuthorizationScheme(TypedDict, total=False): + """BotServiceTenantAuthorizationScheme. + + :ivar type: Required. BOT_SERVICE_TENANT. + :vartype type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT] + """ + + type: Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT]] + """Required. BOT_SERVICE_TENANT.""" + + +class BrowserAutomationPreviewTool(TypedDict, total=False): + """The input definition information for a Browser Automation Tool, as used to configure an Agent. + + :ivar type: The object type, which is always 'browser_automation_preview'. Required. + BROWSER_AUTOMATION_PREVIEW. + :vartype type: Literal[ToolType.BROWSER_AUTOMATION_PREVIEW] + :ivar browser_automation_preview: The Browser Automation Tool parameters. Required. + :vartype browser_automation_preview: "BrowserAutomationToolParameters" + """ + + type: Required[Literal[ToolType.BROWSER_AUTOMATION_PREVIEW]] + """The object type, which is always 'browser_automation_preview'. Required. + BROWSER_AUTOMATION_PREVIEW.""" + browser_automation_preview: Required["BrowserAutomationToolParameters"] + """The Browser Automation Tool parameters. Required.""" + + +class BrowserAutomationPreviewToolboxTool(TypedDict, total=False): + """A browser automation 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, "ToolConfig"] + :ivar type: Required. BROWSER_AUTOMATION_PREVIEW. + :vartype type: Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW] + :ivar browser_automation_preview: The Browser Automation Tool parameters. Required. + :vartype browser_automation_preview: "BrowserAutomationToolParameters" + """ + + name: str + """Optional user-defined name for this tool or configuration.""" + description: str + """Optional user-defined description for this tool or configuration.""" + tool_configs: dict[str, "ToolConfig"] + """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.""" + type: Required[Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW]] + """Required. BROWSER_AUTOMATION_PREVIEW.""" + browser_automation_preview: Required["BrowserAutomationToolParameters"] + """The Browser Automation Tool parameters. Required.""" + + +class BrowserAutomationToolConnectionParameters(TypedDict, total=False): # pylint: disable=name-too-long + """Definition of input parameters for the connection used by the Browser Automation Tool. + + :ivar project_connection_id: The ID of the project connection to your Azure Playwright + resource. Required. + :vartype project_connection_id: str + """ + + project_connection_id: Required[str] + """The ID of the project connection to your Azure Playwright resource. Required.""" + + +class BrowserAutomationToolParameters(TypedDict, total=False): + """Definition of input parameters for the Browser Automation Tool. + + :ivar connection: The project connection parameters associated with the Browser Automation + Tool. Required. + :vartype connection: "BrowserAutomationToolConnectionParameters" + """ + + connection: Required["BrowserAutomationToolConnectionParameters"] + """The project connection parameters associated with the Browser Automation Tool. Required.""" + + +class CaptureStructuredOutputsTool(TypedDict, total=False): + """A tool for capturing structured outputs. + + :ivar type: The type of the tool. Always ``capture_structured_outputs``. Required. + CAPTURE_STRUCTURED_OUTPUTS. + :vartype type: Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS] + :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, "ToolConfig"] + :ivar outputs: The structured outputs to capture from the model. Required. + :vartype outputs: "StructuredOutputDefinition" + """ + + type: Required[Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS]] + """The type of the tool. Always ``capture_structured_outputs``. Required. + CAPTURE_STRUCTURED_OUTPUTS.""" + name: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + description: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + tool_configs: dict[str, "ToolConfig"] + """Deprecated. This property is deprecated and will be removed in a future version.""" + outputs: Required["StructuredOutputDefinition"] + """The structured outputs to capture from the model. Required.""" + + +class ChartCoordinate(TypedDict, total=False): + """Coordinates for the analysis chart. + + :ivar x: X-axis coordinate. Required. + :vartype x: int + :ivar y: Y-axis coordinate. Required. + :vartype y: int + :ivar size: Size of the chart element. Required. + :vartype size: int + """ + + x: Required[int] + """X-axis coordinate. Required.""" + y: Required[int] + """Y-axis coordinate. Required.""" + size: Required[int] + """Size of the chart element. Required.""" + + +class ClusterInsightResult(TypedDict, total=False): + """Insights from the cluster analysis. + + :ivar summary: Summary of the insights report. Required. + :vartype summary: "InsightSummary" + :ivar clusters: List of clusters identified in the insights. Required. + :vartype clusters: list["InsightCluster"] + :ivar coordinates: Optional mapping of IDs to 2D coordinates used by the UX for + visualization. + + The map keys are string identifiers (for example, a cluster id or a sample id) + and the values are the coordinates and visual size for rendering on a 2D chart. + + This property is omitted unless the client requests coordinates (for example, + by passing ``includeCoordinates=true`` as a query parameter). + + Example: + + .. code-block:: + + { + "cluster-1": { "x": 12, "y": 34, "size": 8 }, + "sample-123": { "x": 18, "y": 22, "size": 4 } + } + + Coordinates are intended only for client-side visualization and do not + modify the canonical insights results. + :vartype coordinates: dict[str, "ChartCoordinate"] + """ + + summary: Required["InsightSummary"] + """Summary of the insights report. Required.""" + clusters: Required[list["InsightCluster"]] + """List of clusters identified in the insights. Required.""" + coordinates: dict[str, "ChartCoordinate"] + """ Optional mapping of IDs to 2D coordinates used by the UX for visualization. + + The map keys are string identifiers (for example, a cluster id or a sample id) + and the values are the coordinates and visual size for rendering on a 2D chart. + + This property is omitted unless the client requests coordinates (for example, + by passing ``includeCoordinates=true`` as a query parameter). + + Example: + + .. code-block:: + + { + \"cluster-1\": { \"x\": 12, \"y\": 34, \"size\": 8 }, + \"sample-123\": { \"x\": 18, \"y\": 22, \"size\": 4 } + } + + Coordinates are intended only for client-side visualization and do not + modify the canonical insights results.""" + + +class ClusterTokenUsage(TypedDict, total=False): + """Token usage for cluster analysis. + + :ivar inputTokenUsage: input token usage. Required. + :vartype inputTokenUsage: int + :ivar outputTokenUsage: output token usage. Required. + :vartype outputTokenUsage: int + :ivar totalTokenUsage: total token usage. Required. + :vartype totalTokenUsage: int + """ + + inputTokenUsage: Required[int] + """input token usage. Required.""" + outputTokenUsage: Required[int] + """output token usage. Required.""" + totalTokenUsage: Required[int] + """total token usage. Required.""" + + +class CodeBasedEvaluatorDefinition(TypedDict, total=False): + """Code-based evaluator definition using python code. + + :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, "EvaluatorMetric"] + :ivar type: Required. Code-based definition. + :vartype type: Literal[EvaluatorDefinitionType.CODE] + :ivar code_text: Inline code text for the evaluator. + :vartype code_text: str + :ivar entry_point: The entry point Python file name for the uploaded evaluator code (e.g. + 'answer_length_evaluator.py'). + :vartype entry_point: str + :ivar image_tag: The container image tag to use for evaluator code execution. + :vartype image_tag: str + :ivar blob_uri: The blob URI for the evaluator storage. + :vartype blob_uri: str + """ + + init_parameters: dict[str, Any] + """The JSON schema (Draft 2020-12) for the evaluator's input parameters. This includes parameters + like type, properties, required.""" + data_schema: dict[str, Any] + """The JSON schema (Draft 2020-12) for the evaluator's input data. This includes parameters like + type, properties, required.""" + metrics: dict[str, "EvaluatorMetric"] + """List of output metrics produced by this evaluator.""" + type: Required[Literal[EvaluatorDefinitionType.CODE]] + """Required. Code-based definition.""" + code_text: str + """Inline code text for the evaluator.""" + entry_point: str + """The entry point Python file name for the uploaded evaluator code (e.g. + 'answer_length_evaluator.py').""" + image_tag: str + """The container image tag to use for evaluator code execution.""" + blob_uri: str + """The blob URI for the evaluator storage.""" + + +class CodeConfiguration(TypedDict, total=False): + """Code-based deployment configuration for a hosted agent. + + :ivar runtime: The runtime identifier for code execution (e.g., 'python_3_11', 'python_3_12', + 'python_3_13'). Required. + :vartype runtime: str + :ivar entry_point: The entry point command and arguments for the code execution. Required. + :vartype entry_point: list[str] + :ivar dependency_resolution: How package dependencies are resolved at deployment time. Defaults + to ``bundled``, where the caller bundles all dependencies into the uploaded zip and the service + performs no remote build. ``remote_build`` instructs the service to build dependencies remotely + from the manifest included in the uploaded zip. Required. Known values are: "bundled" and + "remote_build". + :vartype dependency_resolution: Union[str, "CodeDependencyResolution"] + :ivar content_hash: The SHA-256 hex digest of the uploaded code zip. Set by the service from + the ``x-ms-code-zip-sha256`` request header; read-only in responses and never accepted in + request payloads. + :vartype content_hash: str + """ + + runtime: Required[str] + """The runtime identifier for code execution (e.g., 'python_3_11', 'python_3_12', 'python_3_13'). + Required.""" + entry_point: Required[list[str]] + """The entry point command and arguments for the code execution. Required.""" + dependency_resolution: Required[Union[str, "CodeDependencyResolution"]] + """How package dependencies are resolved at deployment time. Defaults to ``bundled``, where the + caller bundles all dependencies into the uploaded zip and the service performs no remote build. + ``remote_build`` instructs the service to build dependencies remotely from the manifest + included in the uploaded zip. Required. Known values are: \"bundled\" and \"remote_build\".""" + content_hash: str + """The SHA-256 hex digest of the uploaded code zip. Set by the service from the + ``x-ms-code-zip-sha256`` request header; read-only in responses and never accepted in request + payloads.""" + + +class CodeInterpreterTool(TypedDict, total=False): + """Code interpreter. + + :ivar type: The type of the code interpreter tool. Always ``code_interpreter``. Required. + CODE_INTERPRETER. + :vartype type: Literal[ToolType.CODE_INTERPRETER] + :ivar allowed_callers: + :vartype allowed_callers: list[Union[str, "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, "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: Union[str, "AutoCodeInterpreterToolParam"] + """ + + type: Required[Literal[ToolType.CODE_INTERPRETER]] + """The type of the code interpreter tool. Always ``code_interpreter``. Required. CODE_INTERPRETER.""" + allowed_callers: Optional[list[Union[str, "CallableToolAllowedCaller"]]] + name: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + description: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + tool_configs: dict[str, "ToolConfig"] + """Deprecated. This property is deprecated and will be removed in a future version.""" + container: Union[str, "AutoCodeInterpreterToolParam"] + """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.""" + + +class CodeInterpreterToolboxTool(TypedDict, total=False): + """A code interpreter 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, "ToolConfig"] + :ivar type: Required. CODE_INTERPRETER. + :vartype type: Literal[ToolboxToolType.CODE_INTERPRETER] + :ivar allowed_callers: + :vartype allowed_callers: list[Union[str, "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: Union[str, "AutoCodeInterpreterToolParam"] + """ + + name: str + """Optional user-defined name for this tool or configuration.""" + description: str + """Optional user-defined description for this tool or configuration.""" + tool_configs: dict[str, "ToolConfig"] + """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.""" + type: Required[Literal[ToolboxToolType.CODE_INTERPRETER]] + """Required. CODE_INTERPRETER.""" + allowed_callers: Optional[list[Union[str, "CallableToolAllowedCaller"]]] + container: Union[str, "AutoCodeInterpreterToolParam"] + """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.""" + + +class ComparisonFilter(TypedDict, total=False): + """Comparison Filter. + + :ivar type: Specifies the comparison operator: ``eq``, ``ne``, ``gt``, ``gte``, ``lt``, + ``lte``, ``in``, ``nin``. + + * `eq`: equals + * `ne`: not equal + * `gt`: greater than + * `gte`: greater than or equal + * `lt`: less than + * `lte`: less than or equal + * `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: Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"] + :ivar key: The key to compare against the value. Required. + :vartype key: str + :ivar value: The value to compare against the attribute key; supports string, number, or + boolean types. Required. Is one of the following types: str, float, bool, [Union[str, float]] + :vartype value: Union[str, float, bool, list[Union[str, float]]] + """ + + type: Required[Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]] + """Specifies the comparison operator: ``eq``, ``ne``, ``gt``, ``gte``, ``lt``, ``lte``, ``in``, + ``nin``. + + * `eq`: equals + * `ne`: not equal + * `gt`: greater than + * `gte`: greater than or equal + * `lt`: less than + * `lte`: less than or equal + * `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\"]""" + key: Required[str] + """The key to compare against the value. Required.""" + value: Required[Union[str, float, bool, list[Union[str, float]]]] + """The value to compare against the attribute key; supports string, number, or boolean types. + Required. Is one of the following types: str, float, bool, [Union[str, float]]""" + + +class CompoundFilter(TypedDict, total=False): + """Compound Filter. + + :ivar type: Type of operation: ``and`` or ``or``. Required. Is either a Literal["and"] type or + a Literal["or"] type. + :vartype type: Literal["and", "or"] + :ivar filters: Array of filters to combine. Items can be ``ComparisonFilter`` or + ``CompoundFilter``. Required. + :vartype filters: list[Union["ComparisonFilter", Any]] + """ + + type: Required[Literal["and", "or"]] + """Type of operation: ``and`` or ``or``. Required. Is either a Literal[\"and\"] type or a + Literal[\"or\"] type.""" + filters: Required[list[Union["ComparisonFilter", Any]]] + """Array of filters to combine. Items can be ``ComparisonFilter`` or ``CompoundFilter``. Required.""" + + +class ComputerTool(TypedDict, total=False): + """Computer. + + :ivar type: The type of the computer tool. Always ``computer``. Required. COMPUTER. + :vartype type: Literal[ToolType.COMPUTER] + """ + + type: Required[Literal[ToolType.COMPUTER]] + """The type of the computer tool. Always ``computer``. Required. COMPUTER.""" + + +class ComputerUsePreviewTool(TypedDict, total=False): + """Computer use preview. + + :ivar type: The type of the computer use tool. Always ``computer_use_preview``. Required. + COMPUTER_USE_PREVIEW. + :vartype type: Literal[ToolType.COMPUTER_USE_PREVIEW] + :ivar environment: The type of computer environment to control. Required. Known values are: + "windows", "mac", "linux", "ubuntu", and "browser". + :vartype environment: Union[str, "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: Required[Literal[ToolType.COMPUTER_USE_PREVIEW]] + """The type of the computer use tool. Always ``computer_use_preview``. Required. + COMPUTER_USE_PREVIEW.""" + environment: Required[Union[str, "ComputerEnvironment"]] + """The type of computer environment to control. Required. Known values are: \"windows\", \"mac\", + \"linux\", \"ubuntu\", and \"browser\".""" + display_width: Required[int] + """The width of the computer display. Required.""" + display_height: Required[int] + """The height of the computer display. Required.""" + + +class ContainerAutoParam(TypedDict, total=False): + """ContainerAutoParam. + + :ivar type: Automatically creates a container for this request. Required. CONTAINER_AUTO. + :vartype type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO] + :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: Union[str, "ContainerMemoryLimit"] + :ivar skills: An optional list of skills referenced by id or inline data. + :vartype skills: list["ContainerSkill"] + :ivar network_policy: + :vartype network_policy: "ContainerNetworkPolicyParam" + """ + + type: Required[Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO]] + """Automatically creates a container for this request. Required. CONTAINER_AUTO.""" + file_ids: list[str] + """An optional list of uploaded files to make available to your code.""" + memory_limit: Optional[Union[str, "ContainerMemoryLimit"]] + """Known values are: \"1g\", \"4g\", \"16g\", and \"64g\".""" + skills: list["ContainerSkill"] + """An optional list of skills referenced by id or inline data.""" + network_policy: "ContainerNetworkPolicyParam" + + +class ContainerConfiguration(TypedDict, total=False): + """Container-based deployment configuration for a hosted agent. + + :ivar image: The container image for the hosted agent. Required. + :vartype image: str + """ + + image: Required[str] + """The container image for the hosted agent. Required.""" + + +class ContainerNetworkPolicyAllowlistParam(TypedDict, total=False): + """ContainerNetworkPolicyAllowlistParam. + + :ivar type: Allow outbound network access only to specified domains. Always ``allowlist``. + Required. ALLOWLIST. + :vartype type: Literal[ContainerNetworkPolicyParamType.ALLOWLIST] + :ivar allowed_domains: A list of allowed domains when type is ``allowlist``. Required. + :vartype allowed_domains: list[str] + :ivar domain_secrets: Optional domain-scoped secrets for allowlisted domains. + :vartype domain_secrets: list["ContainerNetworkPolicyDomainSecretParam"] + """ + + type: Required[Literal[ContainerNetworkPolicyParamType.ALLOWLIST]] + """Allow outbound network access only to specified domains. Always ``allowlist``. Required. + ALLOWLIST.""" + allowed_domains: Required[list[str]] + """A list of allowed domains when type is ``allowlist``. Required.""" + domain_secrets: list["ContainerNetworkPolicyDomainSecretParam"] + """Optional domain-scoped secrets for allowlisted domains.""" + + +class ContainerNetworkPolicyDisabledParam(TypedDict, total=False): + """ContainerNetworkPolicyDisabledParam. + + :ivar type: Disable outbound network access. Always ``disabled``. Required. DISABLED. + :vartype type: Literal[ContainerNetworkPolicyParamType.DISABLED] + """ + + type: Required[Literal[ContainerNetworkPolicyParamType.DISABLED]] + """Disable outbound network access. Always ``disabled``. Required. DISABLED.""" + + +class ContainerNetworkPolicyDomainSecretParam(TypedDict, total=False): + """ContainerNetworkPolicyDomainSecretParam. + + :ivar domain: The domain associated with the secret. Required. + :vartype domain: str + :ivar name: The name of the secret to inject for the domain. Required. + :vartype name: str + :ivar value: The secret value to inject for the domain. Required. + :vartype value: str + """ + + domain: Required[str] + """The domain associated with the secret. Required.""" + name: Required[str] + """The name of the secret to inject for the domain. Required.""" + value: Required[str] + """The secret value to inject for the domain. Required.""" + + +class ContinuousEvaluationRuleAction(TypedDict, total=False): + """Evaluation rule action for continuous evaluation. + + :ivar type: Required. Continuous evaluation. + :vartype type: Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION] + :ivar evalId: Eval Id to add continuous evaluation runs to. Required. + :vartype evalId: str + :ivar maxHourlyRuns: Maximum number of evaluation runs allowed per hour. + :vartype maxHourlyRuns: int + :ivar samplingRate: Percentage (0-100] chance that a matching event triggers an evaluation. + When omitted, the service-default is to evaluate every event, which is equivalent to setting a + sampling rate of 100. + :vartype samplingRate: float + """ + + type: Required[Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION]] + """Required. Continuous evaluation.""" + evalId: Required[str] + """Eval Id to add continuous evaluation runs to. Required.""" + maxHourlyRuns: int + """Maximum number of evaluation runs allowed per hour.""" + samplingRate: float + """Percentage (0-100] chance that a matching event triggers an evaluation. When omitted, the + service-default is to evaluate every event, which is equivalent to setting a sampling rate of + 100.""" + + +class CosmosDBIndex(TypedDict, total=False): + """CosmosDB Vector Store 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. CosmosDB. + :vartype type: Literal[IndexType.COSMOS_DB] + :ivar connectionName: Name of connection to CosmosDB. Required. + :vartype connectionName: str + :ivar databaseName: Name of the CosmosDB Database. Required. + :vartype databaseName: str + :ivar containerName: Name of CosmosDB Container. Required. + :vartype containerName: str + :ivar embeddingConfiguration: Embedding model configuration. Required. + :vartype embeddingConfiguration: "EmbeddingConfiguration" + :ivar fieldMapping: Field mapping configuration. Required. + :vartype fieldMapping: "FieldMapping" + """ + + id: str + """Asset ID, a unique identifier for the asset.""" + name: Required[str] + """The name of the resource. Required.""" + version: Required[str] + """The version of the resource. Required.""" + description: str + """The asset description text.""" + tags: dict[str, str] + """Tag dictionary. Tags can be added, removed, and updated.""" + type: Required[Literal[IndexType.COSMOS_DB]] + """Type of index. Required. CosmosDB.""" + connectionName: Required[str] + """Name of connection to CosmosDB. Required.""" + databaseName: Required[str] + """Name of the CosmosDB Database. Required.""" + containerName: Required[str] + """Name of CosmosDB Container. Required.""" + embeddingConfiguration: Required["EmbeddingConfiguration"] + """Embedding model configuration. Required.""" + fieldMapping: Required["FieldMapping"] + """Field mapping configuration. Required.""" + + +class CreateSkillVersionFromFilesBody(TypedDict, total=False): + """Multipart request body for creating a skill version from files. Accepts either a single zip + file or multiple individual skill files (directory upload). For zip uploads, the server + extracts and validates contents. For directory uploads, files are validated as-is. + + :ivar files: Skill files to upload. Upload a single zip file or multiple individual files with + relative paths. Required. + :vartype files: list[FileType] + :ivar default: Whether to set this version as the default. Defaults to false. + :vartype default: bool + """ + + files: Required[list[FileType]] + """Skill files to upload. Upload a single zip file or multiple individual files with relative + paths. Required.""" + default: bool + """Whether to set this version as the default. Defaults to false.""" + + +class CronTrigger(TypedDict, total=False): + """Cron based trigger. + + :ivar type: Required. Cron based trigger. + :vartype type: Literal[TriggerType.CRON] + :ivar expression: Cron expression that defines the schedule frequency. Required. + :vartype expression: str + :ivar timeZone: Time zone for the cron schedule. Defaults to ``UTC``. + :vartype timeZone: str + :ivar startTime: Start time for the cron schedule in ISO 8601 format. + :vartype startTime: str + :ivar endTime: End time for the cron schedule in ISO 8601 format. + :vartype endTime: str + """ + + type: Required[Literal[TriggerType.CRON]] + """Required. Cron based trigger.""" + expression: Required[str] + """Cron expression that defines the schedule frequency. Required.""" + timeZone: str + """Time zone for the cron schedule. Defaults to ``UTC``.""" + startTime: str + """Start time for the cron schedule in ISO 8601 format.""" + endTime: str + """End time for the cron schedule in ISO 8601 format.""" + + +class CustomGrammarFormatParam(TypedDict, total=False): + """Grammar format. + + :ivar type: Grammar format. Always ``grammar``. Required. GRAMMAR. + :vartype type: Literal[CustomToolParamFormatType.GRAMMAR] + :ivar syntax: The syntax of the grammar definition. One of ``lark`` or ``regex``. Required. + Known values are: "lark" and "regex". + :vartype syntax: Union[str, "GrammarSyntax1"] + :ivar definition: The grammar definition. Required. + :vartype definition: str + """ + + type: Required[Literal[CustomToolParamFormatType.GRAMMAR]] + """Grammar format. Always ``grammar``. Required. GRAMMAR.""" + syntax: Required[Union[str, "GrammarSyntax1"]] + """The syntax of the grammar definition. One of ``lark`` or ``regex``. Required. Known values are: + \"lark\" and \"regex\".""" + definition: Required[str] + """The grammar definition. Required.""" + + +class CustomRoutineTrigger(TypedDict, total=False): + """A custom event routine trigger. + + :ivar type: The trigger type. Required. A custom event trigger. + :vartype type: Literal[RoutineTriggerType.CUSTOM] + :ivar provider: The external provider that emits the custom event. Required. + :vartype provider: str + :ivar event_name: The provider-specific event name that fires the routine. + :vartype event_name: str + :ivar parameters: Provider-specific trigger parameters. Required. + :vartype parameters: dict[str, Any] + """ + + type: Required[Literal[RoutineTriggerType.CUSTOM]] + """The trigger type. Required. A custom event trigger.""" + provider: Required[str] + """The external provider that emits the custom event. Required.""" + event_name: str + """The provider-specific event name that fires the routine.""" + parameters: Required[dict[str, Any]] + """Provider-specific trigger parameters. Required.""" + + +class CustomTextFormatParam(TypedDict, total=False): + """Text format. + + :ivar type: Unconstrained text format. Always ``text``. Required. TEXT. + :vartype type: Literal[CustomToolParamFormatType.TEXT] + """ + + type: Required[Literal[CustomToolParamFormatType.TEXT]] + """Unconstrained text format. Always ``text``. Required. TEXT.""" + + +class CustomToolParam(TypedDict, total=False): + """Custom tool. + + :ivar type: The type of the custom tool. Always ``custom``. Required. CUSTOM. + :vartype type: Literal[ToolType.CUSTOM] + :ivar name: The name of the custom tool, used to identify it in tool calls. Required. + :vartype name: str + :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: "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[Union[str, "CallableToolAllowedCaller"]] + """ + + type: Required[Literal[ToolType.CUSTOM]] + """The type of the custom tool. Always ``custom``. Required. CUSTOM.""" + name: Required[str] + """The name of the custom tool, used to identify it in tool calls. Required.""" + description: str + """Optional description of the custom tool, used to provide more context.""" + format: "CustomToolParamFormat" + """The input format for the custom tool. Default is unconstrained text.""" + defer_loading: bool + """Whether this tool should be deferred and discovered via tool search.""" + allowed_callers: Optional[list[Union[str, "CallableToolAllowedCaller"]]] + + +class DailyRecurrenceSchedule(TypedDict, total=False): + """Daily recurrence schedule. + + :ivar type: Daily recurrence type. Required. Daily recurrence pattern. + :vartype type: Literal[RecurrenceType.DAILY] + :ivar hours: Hours for the recurrence schedule. Required. + :vartype hours: list[int] + """ + + type: Required[Literal[RecurrenceType.DAILY]] + """Daily recurrence type. Required. Daily recurrence pattern.""" + hours: Required[list[int]] + """Hours for the recurrence schedule. Required.""" + + +class DataGenerationJob(TypedDict, total=False): + """Data Generation Job resource. + + :ivar id: Server-assigned unique identifier. Required. + :vartype id: str + :ivar inputs: Caller-supplied inputs. + :vartype inputs: "DataGenerationJobInputs" + :ivar result: Result produced on success. + :vartype result: "DataGenerationJobResult" + :ivar status: Current lifecycle status. Required. Known values are: "queued", "in_progress", + "succeeded", "failed", and "cancelled". + :vartype status: Union[str, "JobStatus"] + :ivar error: Error details — populated only on failure. + :vartype error: "ApiError" + :ivar created_at: The timestamp when the job was created, represented in Unix time (seconds + since January 1, 1970). Required. + :vartype created_at: int + :ivar finished_at: The timestamp when the job was finished, represented in Unix time (seconds + since January 1, 1970). + :vartype finished_at: int + """ + + id: Required[str] + """Server-assigned unique identifier. Required.""" + inputs: "DataGenerationJobInputs" + """Caller-supplied inputs.""" + result: "DataGenerationJobResult" + """Result produced on success.""" + status: Required[Union[str, "JobStatus"]] + """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", + \"succeeded\", \"failed\", and \"cancelled\".""" + error: "ApiError" + """Error details — populated only on failure.""" + created_at: Required[int] + """The timestamp when the job was created, represented in Unix time (seconds since January 1, + 1970). Required.""" + finished_at: int + """The timestamp when the job was finished, represented in Unix time (seconds since January 1, + 1970).""" + + +class DataGenerationJobInputs(TypedDict, total=False): + """Caller-supplied inputs for a data generation job. + + :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["DataGenerationJobSource"] + :ivar options: The options for the data generation job. Required. + :vartype options: "DataGenerationJobOptions" + :ivar scenario: The scenario of the data generation job. Either for fine-tuning or evaluation. + Required. Known values are: "supervised_finetuning", "reinforcement_finetuning", and + "evaluation". + :vartype scenario: Union[str, "DataGenerationJobScenario"] + :ivar output_options: Optional caller-supplied metadata for the job's output. See individual + fields for whether they apply to file outputs (fine-tuning scenarios), dataset outputs + (evaluation scenario), or both. + :vartype output_options: "DataGenerationJobOutputOptions" + """ + + name: Required[str] + """The display name of the data generation job. Required.""" + sources: Required[list["DataGenerationJobSource"]] + """The sources used for the data generation job. Required.""" + options: Required["DataGenerationJobOptions"] + """The options for the data generation job. Required.""" + scenario: Required[Union[str, "DataGenerationJobScenario"]] + """The scenario of the data generation job. Either for fine-tuning or evaluation. Required. Known + values are: \"supervised_finetuning\", \"reinforcement_finetuning\", and \"evaluation\".""" + output_options: "DataGenerationJobOutputOptions" + """Optional caller-supplied metadata for the job's output. See individual fields for whether they + apply to file outputs (fine-tuning scenarios), dataset outputs (evaluation scenario), or both.""" + + +class DataGenerationJobOutputOptions(TypedDict, total=False): + """Output options for data generation job. + + :ivar name: Name to assign to the output. Used as the filename for Azure OpenAI file outputs + (fine-tuning scenarios) and as the dataset name for dataset outputs (evaluation scenario). + :vartype name: str + :ivar description: Description to assign to the output. Applies only to dataset outputs + (evaluation scenario); ignored for Azure OpenAI file outputs. + :vartype description: str + :ivar tags: Tags to assign to the output. Applies only to dataset outputs (evaluation + scenario); ignored for Azure OpenAI file outputs. + :vartype tags: dict[str, str] + """ + + name: str + """Name to assign to the output. Used as the filename for Azure OpenAI file outputs (fine-tuning + scenarios) and as the dataset name for dataset outputs (evaluation scenario).""" + description: str + """Description to assign to the output. Applies only to dataset outputs (evaluation scenario); + ignored for Azure OpenAI file outputs.""" + tags: dict[str, str] + """Tags to assign to the output. Applies only to dataset outputs (evaluation scenario); ignored + for Azure OpenAI file outputs.""" + + +class DataGenerationJobResult(TypedDict, total=False): + """Result produced by a successful data generation job. + + :ivar outputs: The final job outputs: Azure OpenAI files for fine-tuning, or datasets for + evaluation. + :vartype outputs: list["DataGenerationJobOutput"] + :ivar generated_samples: The number of samples actually generated. Required. + :vartype generated_samples: int + :ivar token_usage: The token usage information for the data generation job. + :vartype token_usage: "DataGenerationTokenUsage" + """ + + outputs: list["DataGenerationJobOutput"] + """The final job outputs: Azure OpenAI files for fine-tuning, or datasets for evaluation.""" + generated_samples: Required[int] + """The number of samples actually generated. Required.""" + token_usage: "DataGenerationTokenUsage" + """The token usage information for the data generation job.""" + + +class DataGenerationModelOptions(TypedDict, total=False): + """LLM model options for data generation jobs. + + :ivar model: Base model name used to generate data. Required. + :vartype model: str + """ + + model: Required[str] + """Base model name used to generate data. Required.""" + + +class DataGenerationTokenUsage(TypedDict, total=False): + """Token usage information for a data generation job. + + :ivar prompt_tokens: The number of prompt tokens used. Required. + :vartype prompt_tokens: int + :ivar completion_tokens: The number of completion tokens generated. Required. + :vartype completion_tokens: int + :ivar total_tokens: Total number of tokens used. Required. + :vartype total_tokens: int + """ + + prompt_tokens: Required[int] + """The number of prompt tokens used. Required.""" + completion_tokens: Required[int] + """The number of completion tokens generated. Required.""" + total_tokens: Required[int] + """Total number of tokens used. Required.""" + + +class DatasetDataGenerationJobOutput(TypedDict, total=False): + """Dataset output for a data generation job. + + :ivar type: Dataset output. Required. The generated data is a Dataset. + :vartype type: Literal[DataGenerationJobOutputType.DATASET] + :ivar id: The id of the output dataset created. + :vartype id: str + :ivar name: The name of the output dataset. + :vartype name: str + :ivar version: The version of the output dataset. + :vartype version: str + :ivar description: Description of the output dataset. + :vartype description: str + :ivar tags: Tag dictionary of the output dataset. + :vartype tags: dict[str, str] + """ + + type: Required[Literal[DataGenerationJobOutputType.DATASET]] + """Dataset output. Required. The generated data is a Dataset.""" + id: str + """The id of the output dataset created.""" + name: str + """The name of the output dataset.""" + version: str + """The version of the output dataset.""" + description: str + """Description of the output dataset.""" + tags: dict[str, str] + """Tag dictionary of the output dataset.""" + + +class DatasetEvaluatorGenerationJobSource(TypedDict, total=False): + """Dataset source for evaluator generation jobs — reference to a dataset. + + :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 Dataset. Required. Dataset source — + reference to a dataset. + :vartype type: Literal[EvaluatorGenerationJobSourceType.DATASET] + :ivar name: The name of the dataset. Required. + :vartype name: str + :ivar version: The version of the dataset. If not specified, the latest version is used. + :vartype version: str + """ + + description: str + """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: Required[Literal[EvaluatorGenerationJobSourceType.DATASET]] + """The source type for this source, which is Dataset. Required. Dataset source — reference to a + dataset.""" + name: Required[str] + """The name of the dataset. Required.""" + version: str + """The version of the dataset. If not specified, the latest version is used.""" + + +class DatasetReference(TypedDict, total=False): + """Reference to a versioned Foundry Dataset. + + :ivar name: Dataset name. Required. + :vartype name: str + :ivar version: Dataset version. Required. + :vartype version: str + """ + + name: Required[str] + """Dataset name. Required.""" + version: Required[str] + """Dataset version. Required.""" + + +class Dimension(TypedDict, total=False): + """A single dimension — one independent, measurable quality dimension within a rubric evaluator's + scoring blueprint. + + :ivar id: Stable identifier for this dimension (snake_case, e.g., ``correct_resolution``). + Required. Provided by the user when manually creating a rubric evaluator or during + human-in-the-loop review of a generated set; the generation pipeline produces an initial value + the user can edit. Editable when saving new versions. Required. + :vartype id: str + :ivar description: What this dimension measures (e.g., 'Correctly identifies the user's + reservation intent and pursues the appropriate workflow'). Required. + :vartype description: str + :ivar weight: Relative weight of this dimension (1-10). The generation pipeline assigns exactly + one dimension weight 8-10; all others use 1-6. User edits are not constrained by this + heuristic. Required. + :vartype weight: int + :ivar always_applicable: When true, the LLM judge always scores this dimension regardless of + relevance (skips applicability assessment). The service-generated general quality/policy + dimension has this set to true and is non-editable. Users may set this on their own custom + dimensions. The service defaults to ``false`` if a value is not specified by the caller. + :vartype always_applicable: bool + """ + + id: Required[str] + """Stable identifier for this dimension (snake_case, e.g., ``correct_resolution``). Required. + Provided by the user when manually creating a rubric evaluator or during human-in-the-loop + review of a generated set; the generation pipeline produces an initial value the user can edit. + Editable when saving new versions. Required.""" + description: Required[str] + """What this dimension measures (e.g., 'Correctly identifies the user's reservation intent and + pursues the appropriate workflow'). Required.""" + weight: Required[int] + """Relative weight of this dimension (1-10). The generation pipeline assigns exactly one dimension + weight 8-10; all others use 1-6. User edits are not constrained by this heuristic. Required.""" + always_applicable: bool + """When true, the LLM judge always scores this dimension regardless of relevance (skips + applicability assessment). The service-generated general quality/policy dimension has this set + to true and is non-editable. Users may set this on their own custom dimensions. The service + defaults to ``false`` if a value is not specified by the caller.""" + + +class EmbeddingConfiguration(TypedDict, total=False): + """Embedding configuration class. + + :ivar modelDeploymentName: Deployment name of embedding model. It can point to a model + deployment either in the parent AIServices or a connection. Required. + :vartype modelDeploymentName: str + :ivar embeddingField: Embedding field. Required. + :vartype embeddingField: str + """ + + modelDeploymentName: Required[str] + """Deployment name of embedding model. It can point to a model deployment either in the parent + AIServices or a connection. Required.""" + embeddingField: Required[str] + """Embedding field. Required.""" + + +class EmptyModelParam(TypedDict, total=False): + """EmptyModelParam.""" + + +class EndpointBasedEvaluatorDefinition(TypedDict, total=False): + """Endpoint-based evaluator definition. The customer owns and hosts an HTTP endpoint that + implements the evaluation contract. The evaluator references a Project Connection by name; the + connection stores the endpoint URL and credentials (API Key or Entra ID). At execution time, + the service resolves the connection to obtain the endpoint URL and authentication details, then + calls the endpoint for each evaluation row. + + :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, "EvaluatorMetric"] + :ivar type: Required. Endpoint-based evaluator definition. References a customer-owned HTTP + endpoint via a Project Connection. + :vartype type: Literal[EvaluatorDefinitionType.ENDPOINT] + :ivar connection_name: Name of the Project Connection that stores the endpoint URL and + credentials. The connection must exist on the project and have a non-empty target URL. + Supported auth types: ApiKey (sends ``api-key`` header) and AAD/Entra ID (acquires a bearer + token via the project's Managed Identity). Required. + :vartype connection_name: str + """ + + init_parameters: dict[str, Any] + """The JSON schema (Draft 2020-12) for the evaluator's input parameters. This includes parameters + like type, properties, required.""" + data_schema: dict[str, Any] + """The JSON schema (Draft 2020-12) for the evaluator's input data. This includes parameters like + type, properties, required.""" + metrics: dict[str, "EvaluatorMetric"] + """List of output metrics produced by this evaluator.""" + type: Required[Literal[EvaluatorDefinitionType.ENDPOINT]] + """Required. Endpoint-based evaluator definition. References a customer-owned HTTP endpoint via a + Project Connection.""" + connection_name: Required[str] + """Name of the Project Connection that stores the endpoint URL and credentials. The connection + must exist on the project and have a non-empty target URL. Supported auth types: ApiKey (sends + ``api-key`` header) and AAD/Entra ID (acquires a bearer token via the project's Managed + Identity). Required.""" + + +class EntraAuthorizationScheme(TypedDict, total=False): + """EntraAuthorizationScheme. + + :ivar type: Required. ENTRA. + :vartype type: Literal[AgentEndpointAuthorizationSchemeType.ENTRA] + """ + + type: Required[Literal[AgentEndpointAuthorizationSchemeType.ENTRA]] + """Required. ENTRA.""" + + +class EvalResult(TypedDict, total=False): + """Result of the evaluation. + + :ivar name: name of the check. Required. + :vartype name: str + :ivar type: type of the check. Required. + :vartype type: str + :ivar score: score. Required. + :vartype score: float + :ivar passed: indicates if the check passed or failed. Required. + :vartype passed: bool + """ + + name: Required[str] + """name of the check. Required.""" + type: Required[str] + """type of the check. Required.""" + score: Required[float] + """score. Required.""" + passed: Required[bool] + """indicates if the check passed or failed. Required.""" + + +class EvalRunResultCompareItem(TypedDict, total=False): + """Metric comparison for a treatment against the baseline. + + :ivar treatmentRunId: The treatment run ID. Required. + :vartype treatmentRunId: str + :ivar treatmentRunSummary: Summary statistics of the treatment run. Required. + :vartype treatmentRunSummary: "EvalRunResultSummary" + :ivar deltaEstimate: Estimated difference between treatment and baseline. Required. + :vartype deltaEstimate: float + :ivar pValue: P-value for the treatment effect. Required. + :vartype pValue: float + :ivar treatmentEffect: Type of treatment effect. Required. Known values are: "TooFewSamples", + "Inconclusive", "Changed", "Improved", and "Degraded". + :vartype treatmentEffect: Union[str, "TreatmentEffectType"] + """ + + treatmentRunId: Required[str] + """The treatment run ID. Required.""" + treatmentRunSummary: Required["EvalRunResultSummary"] + """Summary statistics of the treatment run. Required.""" + deltaEstimate: Required[float] + """Estimated difference between treatment and baseline. Required.""" + pValue: Required[float] + """P-value for the treatment effect. Required.""" + treatmentEffect: Required[Union[str, "TreatmentEffectType"]] + """Type of treatment effect. Required. Known values are: \"TooFewSamples\", \"Inconclusive\", + \"Changed\", \"Improved\", and \"Degraded\".""" + + +class EvalRunResultComparison(TypedDict, total=False): + """Comparison results for treatment runs against the baseline. + + :ivar testingCriteria: Name of the testing criteria. Required. + :vartype testingCriteria: str + :ivar metric: Metric being evaluated. Required. + :vartype metric: str + :ivar evaluator: Name of the evaluator for this testing criteria. Required. + :vartype evaluator: str + :ivar baselineRunSummary: Summary statistics of the baseline run. Required. + :vartype baselineRunSummary: "EvalRunResultSummary" + :ivar compareItems: List of comparison results for each treatment run. Required. + :vartype compareItems: list["EvalRunResultCompareItem"] + """ + + testingCriteria: Required[str] + """Name of the testing criteria. Required.""" + metric: Required[str] + """Metric being evaluated. Required.""" + evaluator: Required[str] + """Name of the evaluator for this testing criteria. Required.""" + baselineRunSummary: Required["EvalRunResultSummary"] + """Summary statistics of the baseline run. Required.""" + compareItems: Required[list["EvalRunResultCompareItem"]] + """List of comparison results for each treatment run. Required.""" + + +class EvalRunResultSummary(TypedDict, total=False): + """Summary statistics of a metric in an evaluation run. + + :ivar runId: The evaluation run ID. Required. + :vartype runId: str + :ivar sampleCount: Number of samples in the evaluation run. Required. + :vartype sampleCount: int + :ivar average: Average value of the metric in the evaluation run. Required. + :vartype average: float + :ivar standardDeviation: Standard deviation of the metric in the evaluation run. Required. + :vartype standardDeviation: float + """ + + runId: Required[str] + """The evaluation run ID. Required.""" + sampleCount: Required[int] + """Number of samples in the evaluation run. Required.""" + average: Required[float] + """Average value of the metric in the evaluation run. Required.""" + standardDeviation: Required[float] + """Standard deviation of the metric in the evaluation run. Required.""" + + +class EvaluationComparisonInsightRequest(TypedDict, total=False): + """Evaluation Comparison Request. + + :ivar type: The type of request. Required. Evaluation Comparison. + :vartype type: Literal[InsightType.EVALUATION_COMPARISON] + :ivar evalId: Identifier for the evaluation. Required. + :vartype evalId: str + :ivar baselineRunId: The baseline run ID for comparison. Required. + :vartype baselineRunId: str + :ivar treatmentRunIds: List of treatment run IDs for comparison. Required. + :vartype treatmentRunIds: list[str] + """ + + type: Required[Literal[InsightType.EVALUATION_COMPARISON]] + """The type of request. Required. Evaluation Comparison.""" + evalId: Required[str] + """Identifier for the evaluation. Required.""" + baselineRunId: Required[str] + """The baseline run ID for comparison. Required.""" + treatmentRunIds: Required[list[str]] + """List of treatment run IDs for comparison. Required.""" + + +class EvaluationComparisonInsightResult(TypedDict, total=False): + """Insights from the evaluation comparison. + + :ivar type: The type of insights result. Required. Evaluation Comparison. + :vartype type: Literal[InsightType.EVALUATION_COMPARISON] + :ivar comparisons: Comparison results for each treatment run against the baseline. Required. + :vartype comparisons: list["EvalRunResultComparison"] + :ivar method: The statistical method used for comparison. Required. + :vartype method: str + """ + + type: Required[Literal[InsightType.EVALUATION_COMPARISON]] + """The type of insights result. Required. Evaluation Comparison.""" + comparisons: Required[list["EvalRunResultComparison"]] + """Comparison results for each treatment run against the baseline. Required.""" + method: Required[str] + """The statistical method used for comparison. Required.""" + + +class EvaluationResultSample(TypedDict, total=False): + """A sample from the evaluation result. + + :ivar id: The unique identifier for the analysis sample. Required. + :vartype id: str + :ivar features: Features to help with additional filtering of data in UX. Required. + :vartype features: dict[str, Any] + :ivar correlationInfo: Info about the correlation for the analysis sample. Required. + :vartype correlationInfo: dict[str, Any] + :ivar type: Evaluation Result Sample Type. Required. A sample from the evaluation result. + :vartype type: Literal[SampleType.EVALUATION_RESULT_SAMPLE] + :ivar evaluationResult: Evaluation result for the analysis sample. Required. + :vartype evaluationResult: "EvalResult" + """ + + id: Required[str] + """The unique identifier for the analysis sample. Required.""" + features: Required[dict[str, Any]] + """Features to help with additional filtering of data in UX. Required.""" + correlationInfo: Required[dict[str, Any]] + """Info about the correlation for the analysis sample. Required.""" + type: Required[Literal[SampleType.EVALUATION_RESULT_SAMPLE]] + """Evaluation Result Sample Type. Required. A sample from the evaluation result.""" + evaluationResult: Required["EvalResult"] + """Evaluation result for the analysis sample. Required.""" + + +class EvaluationRule(TypedDict, total=False): + """Evaluation rule model. + + :ivar id: Unique identifier for the evaluation rule. Required. + :vartype id: str + :ivar displayName: Display Name for the evaluation rule. + :vartype displayName: str + :ivar description: Description for the evaluation rule. + :vartype description: str + :ivar action: Definition of the evaluation rule action. Required. + :vartype action: "EvaluationRuleAction" + :ivar filter: Filter condition of the evaluation rule. + :vartype filter: "EvaluationRuleFilter" + :ivar eventType: Event type that the evaluation rule applies to. Required. Known values are: + "responseCompleted" and "manual". + :vartype eventType: Union[str, "EvaluationRuleEventType"] + :ivar enabled: Indicates whether the evaluation rule is enabled. Default is true. Required. + :vartype enabled: bool + :ivar systemData: System metadata for the evaluation rule. Required. + :vartype systemData: dict[str, str] + """ + + id: Required[str] + """Unique identifier for the evaluation rule. Required.""" + displayName: str + """Display Name for the evaluation rule.""" + description: str + """Description for the evaluation rule.""" + action: Required["EvaluationRuleAction"] + """Definition of the evaluation rule action. Required.""" + filter: "EvaluationRuleFilter" + """Filter condition of the evaluation rule.""" + eventType: Required[Union[str, "EvaluationRuleEventType"]] + """Event type that the evaluation rule applies to. Required. Known values are: + \"responseCompleted\" and \"manual\".""" + enabled: Required[bool] + """Indicates whether the evaluation rule is enabled. Default is true. Required.""" + systemData: Required[dict[str, str]] + """System metadata for the evaluation rule. Required.""" + + +class EvaluationRuleFilter(TypedDict, total=False): + """Evaluation filter model. + + :ivar agentName: Filter by agent name. Required. + :vartype agentName: str + """ + + agentName: Required[str] + """Filter by agent name. Required.""" + + +class EvaluationRunClusterInsightRequest(TypedDict, total=False): + """Insights on set of Evaluation Results. + + :ivar type: The type of insights request. Required. Insights on an Evaluation run result. + :vartype type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] + :ivar evalId: Evaluation Id for the insights. Required. + :vartype evalId: str + :ivar runIds: List of evaluation run IDs for the insights. Required. + :vartype runIds: list[str] + :ivar modelConfiguration: Configuration of the model used in the insight generation. + :vartype modelConfiguration: "InsightModelConfiguration" + """ + + type: Required[Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT]] + """The type of insights request. Required. Insights on an Evaluation run result.""" + evalId: Required[str] + """Evaluation Id for the insights. Required.""" + runIds: Required[list[str]] + """List of evaluation run IDs for the insights. Required.""" + modelConfiguration: "InsightModelConfiguration" + """Configuration of the model used in the insight generation.""" + + +class EvaluationRunClusterInsightResult(TypedDict, total=False): + """Insights from the evaluation run cluster analysis. + + :ivar type: The type of insights result. Required. Insights on an Evaluation run result. + :vartype type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] + :ivar clusterInsight: Required. + :vartype clusterInsight: "ClusterInsightResult" + """ + + type: Required[Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT]] + """The type of insights result. Required. Insights on an Evaluation run result.""" + clusterInsight: Required["ClusterInsightResult"] + """Required.""" + + +class EvaluationScheduleTask(TypedDict, total=False): + """Evaluation task for the schedule. + + :ivar configuration: Configuration for the task. + :vartype configuration: dict[str, str] + :ivar type: Required. Evaluation task. + :vartype type: Literal[ScheduleTaskType.EVALUATION] + :ivar evalId: Identifier of the evaluation group. Required. + :vartype evalId: str + :ivar evalRun: The evaluation run payload. Required. + :vartype evalRun: dict[str, Any] + """ + + configuration: dict[str, str] + """Configuration for the task.""" + type: Required[Literal[ScheduleTaskType.EVALUATION]] + """Required. Evaluation task.""" + evalId: Required[str] + """Identifier of the evaluation group. Required.""" + evalRun: Required[dict[str, Any]] + """The evaluation run payload. Required.""" + + +class EvaluationTaxonomy(TypedDict, total=False): + """Evaluation Taxonomy 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 taxonomyInput: Input configuration for the evaluation taxonomy. Required. + :vartype taxonomyInput: "EvaluationTaxonomyInput" + :ivar taxonomyCategories: List of taxonomy categories. + :vartype taxonomyCategories: list["TaxonomyCategory"] + :ivar properties: Additional properties for the evaluation taxonomy. + :vartype properties: dict[str, str] + """ + + id: str + """Asset ID, a unique identifier for the asset.""" + name: Required[str] + """The name of the resource. Required.""" + version: Required[str] + """The version of the resource. Required.""" + description: str + """The asset description text.""" + tags: dict[str, str] + """Tag dictionary. Tags can be added, removed, and updated.""" + taxonomyInput: Required["EvaluationTaxonomyInput"] + """Input configuration for the evaluation taxonomy. Required.""" + taxonomyCategories: list["TaxonomyCategory"] + """List of taxonomy categories.""" + properties: dict[str, str] + """Additional properties for the evaluation taxonomy.""" + + +class EvaluatorCredentialRequest(TypedDict, total=False): + """Request body for getting evaluator credentials. + + :ivar blob_uri: The blob URI for the evaluator storage. Example: + ``https://account.blob.core.windows.net:443/container``. Required. + :vartype blob_uri: str + """ + + blob_uri: Required[str] + """The blob URI for the evaluator storage. Example: + ``https://account.blob.core.windows.net:443/container``. Required.""" + + +class EvaluatorGenerationArtifacts(TypedDict, total=False): + """Service-managed provenance artifacts produced by an evaluator generation job. Present only on + EvaluatorVersion resources created via the generation pipeline. The combined-JSONL Foundry + Dataset is read-only and resolves to a versioned dataset in a service-reserved namespace. + + :ivar dataset: Reference to the single Foundry Dataset (one combined JSONL file, + version-aligned to ``EvaluatorVersion.version``) holding all artifacts produced by the + generation pipeline. Each row in the JSONL carries a ``kind`` field discriminating its content + (e.g. ``spec``, ``tools``, ``context``). Required. + :vartype dataset: "DatasetReference" + :ivar kinds: The kinds of rows present in ``dataset``. Always contains ``"spec"`` (the + generated evaluation specification, a Markdown document describing what the evaluator + measures). May additionally contain ``"tools"`` (when the generation pipeline produced or + inferred OpenAI tool schemas) and/or ``"context"`` (when supplementary materials such as file + uploads or trace samples were used during generation). Required. + :vartype kinds: list[str] + """ + + dataset: Required["DatasetReference"] + """Reference to the single Foundry Dataset (one combined JSONL file, version-aligned to + ``EvaluatorVersion.version``) holding all artifacts produced by the generation pipeline. Each + row in the JSONL carries a ``kind`` field discriminating its content (e.g. ``spec``, ``tools``, + ``context``). Required.""" + kinds: Required[list[str]] + """The kinds of rows present in ``dataset``. Always contains ``\"spec\"`` (the generated + evaluation specification, a Markdown document describing what the evaluator measures). May + additionally contain ``\"tools\"`` (when the generation pipeline produced or inferred OpenAI + tool schemas) and/or ``\"context\"`` (when supplementary materials such as file uploads or + trace samples were used during generation). Required.""" + + +class EvaluatorGenerationInputs(TypedDict, total=False): + """Caller-supplied inputs for an evaluator generation job. + + :ivar sources: Source materials for generation — agent descriptions, prompts, traces, or + datasets. Each entry is an ``EvaluatorGenerationJobSource`` variant discriminated by ``type``. + Required. + :vartype sources: list["EvaluatorGenerationJobSource"] + :ivar model: The LLM model to use for rubric generation (e.g., 'gpt-4o'). Required — users must + provide their own model rather than relying on service-owned capacity. Required. + :vartype model: str + :ivar evaluator_name: The evaluator name (immutable identifier). 1-256 characters; allowed + characters are ASCII letters, digits, underscore (``_``), period (``.``), tilde (``~``), and + hyphen (``-``). The prefix ``builtin.`` is reserved for system-managed evaluators and is + rejected by the service. If an evaluator with this name already exists in the project (and is + rubric-subtype), the service creates a new version under the same name and uses the prior + version's ``dimensions`` as context for incremental improvement (foundation of the post-//build + adaptive loop). Old versions remain queryable via ``get_version(name, version)``. If the + existing evaluator is not a rubric-subtype evaluator (built-in, prompt-based, code-based), the + request is rejected with ``400 Bad Request``. Required. + :vartype evaluator_name: str + :ivar evaluator_display_name: Optional human-friendly display name for the resulting evaluator. + Surfaced as ``EvaluatorVersion.display_name`` on the persisted evaluator. When omitted, the + service uses ``evaluator_name`` as the display name. The ``evaluator_`` prefix disambiguates + this from the immutable ``evaluator_name`` identifier. + :vartype evaluator_display_name: str + :ivar evaluator_description: Optional human-friendly description for the resulting evaluator. + Surfaced as ``EvaluatorVersion.description`` on the persisted evaluator. Typically collected + from the UI alongside ``evaluator_display_name``. The ``evaluator_`` prefix disambiguates this + from any other description fields on related models. + :vartype evaluator_description: str + """ + + sources: Required[list["EvaluatorGenerationJobSource"]] + """Source materials for generation — agent descriptions, prompts, traces, or datasets. Each entry + is an ``EvaluatorGenerationJobSource`` variant discriminated by ``type``. Required.""" + model: Required[str] + """The LLM model to use for rubric generation (e.g., 'gpt-4o'). Required — users must provide + their own model rather than relying on service-owned capacity. Required.""" + evaluator_name: Required[str] + """The evaluator name (immutable identifier). 1-256 characters; allowed characters are ASCII + letters, digits, underscore (``_``), period (``.``), tilde (``~``), and hyphen (``-``). The + prefix ``builtin.`` is reserved for system-managed evaluators and is rejected by the service. + If an evaluator with this name already exists in the project (and is rubric-subtype), the + service creates a new version under the same name and uses the prior version's ``dimensions`` + as context for incremental improvement (foundation of the post-//build adaptive loop). Old + versions remain queryable via ``get_version(name, version)``. If the existing evaluator is not + a rubric-subtype evaluator (built-in, prompt-based, code-based), the request is rejected with + ``400 Bad Request``. Required.""" + evaluator_display_name: str + """Optional human-friendly display name for the resulting evaluator. Surfaced as + ``EvaluatorVersion.display_name`` on the persisted evaluator. When omitted, the service uses + ``evaluator_name`` as the display name. The ``evaluator_`` prefix disambiguates this from the + immutable ``evaluator_name`` identifier.""" + evaluator_description: str + """Optional human-friendly description for the resulting evaluator. Surfaced as + ``EvaluatorVersion.description`` on the persisted evaluator. Typically collected from the UI + alongside ``evaluator_display_name``. The ``evaluator_`` prefix disambiguates this from any + other description fields on related models.""" + + +class EvaluatorGenerationJob(TypedDict, total=False): + """Evaluator Generation Job resource — a long-running job that generates rubric-based evaluator + definitions from source materials. On success, the result is the persisted EvaluatorVersion. + + :ivar id: Server-assigned unique identifier. Required. + :vartype id: str + :ivar inputs: Caller-supplied inputs. + :vartype inputs: "EvaluatorGenerationInputs" + :ivar result: Result produced on success. + :vartype result: "EvaluatorVersion" + :ivar status: Current lifecycle status. Required. Known values are: "queued", "in_progress", + "succeeded", "failed", and "cancelled". + :vartype status: Union[str, "JobStatus"] + :ivar error: Error details — populated only on failure. + :vartype error: "ApiError" + :ivar created_at: The timestamp when the job was created, represented in Unix time (seconds + since January 1, 1970). Required. + :vartype created_at: int + :ivar finished_at: The timestamp when the job finished, represented in Unix time (seconds since + January 1, 1970). + :vartype finished_at: int + :ivar usage: Token consumption summary. Populated when the job reaches a terminal state. + :vartype usage: "EvaluatorGenerationTokenUsage" + :ivar input_quality_warnings: Non-fatal input-quality advisories produced by the generation + pipeline. Read-only; service-generated; populated only on terminal jobs when advisories fired. + Omitted when generation was clean. Cleared when a subsequent ``PATCH`` to the paired + ``EvaluatorVersion.definition`` invalidates the advisories. + :vartype input_quality_warnings: list["RubricGenerationInputQualityWarning"] + """ + + id: Required[str] + """Server-assigned unique identifier. Required.""" + inputs: "EvaluatorGenerationInputs" + """Caller-supplied inputs.""" + result: "EvaluatorVersion" + """Result produced on success.""" + status: Required[Union[str, "JobStatus"]] + """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", + \"succeeded\", \"failed\", and \"cancelled\".""" + error: "ApiError" + """Error details — populated only on failure.""" + created_at: Required[int] + """The timestamp when the job was created, represented in Unix time (seconds since January 1, + 1970). Required.""" + finished_at: int + """The timestamp when the job finished, represented in Unix time (seconds since January 1, 1970).""" + usage: "EvaluatorGenerationTokenUsage" + """Token consumption summary. Populated when the job reaches a terminal state.""" + input_quality_warnings: list["RubricGenerationInputQualityWarning"] + """Non-fatal input-quality advisories produced by the generation pipeline. Read-only; + service-generated; populated only on terminal jobs when advisories fired. Omitted when + generation was clean. Cleared when a subsequent ``PATCH`` to the paired + ``EvaluatorVersion.definition`` invalidates the advisories.""" + + +class EvaluatorGenerationTokenUsage(TypedDict, total=False): + """Token consumption summary for an evaluator generation job. Populated when the job reaches a + terminal state. + + :ivar input_tokens: Number of input (prompt) tokens consumed. Required. + :vartype input_tokens: int + :ivar output_tokens: Number of output (completion) tokens generated. Required. + :vartype output_tokens: int + :ivar total_tokens: Total tokens consumed (input + output). Required. + :vartype total_tokens: int + """ + + input_tokens: Required[int] + """Number of input (prompt) tokens consumed. Required.""" + output_tokens: Required[int] + """Number of output (completion) tokens generated. Required.""" + total_tokens: Required[int] + """Total tokens consumed (input + output). Required.""" + + +class EvaluatorMetric(TypedDict, total=False): + """Evaluator Metric. + + :ivar type: Type of the metric. Known values are: "ordinal", "continuous", and "boolean". + :vartype type: Union[str, "EvaluatorMetricType"] + :ivar desirable_direction: It indicates whether a higher value is better or a lower value is + better for this metric. Known values are: "increase", "decrease", and "neutral". + :vartype desirable_direction: Union[str, "EvaluatorMetricDirection"] + :ivar min_value: Minimum value for the metric. + :vartype min_value: float + :ivar max_value: Maximum value for the metric. If not specified, it is assumed to be unbounded. + :vartype max_value: float + :ivar threshold: Default pass/fail threshold for this metric. + :vartype threshold: float + :ivar is_primary: Indicates if this metric is primary when there are multiple metrics. + :vartype is_primary: bool + """ + + type: Union[str, "EvaluatorMetricType"] + """Type of the metric. Known values are: \"ordinal\", \"continuous\", and \"boolean\".""" + desirable_direction: Union[str, "EvaluatorMetricDirection"] + """It indicates whether a higher value is better or a lower value is better for this metric. Known + values are: \"increase\", \"decrease\", and \"neutral\".""" + min_value: float + """Minimum value for the metric.""" + max_value: float + """Maximum value for the metric. If not specified, it is assumed to be unbounded.""" + threshold: float + """Default pass/fail threshold for this metric.""" + is_primary: bool + """Indicates if this metric is primary when there are multiple metrics.""" + + +class EvaluatorVersion(TypedDict, total=False): + """Evaluator Definition. + + :ivar display_name: Display Name for evaluator. It helps to find the evaluator easily in AI + Foundry. It does not need to be unique. + :vartype display_name: str + :ivar metadata: Metadata about the evaluator. + :vartype metadata: dict[str, str] + :ivar evaluator_type: The type of the evaluator. Required. Known values are: "builtin" and + "custom". + :vartype evaluator_type: Union[str, "EvaluatorType"] + :ivar categories: The categories of the evaluator. Required. + :vartype categories: list[Union[str, "EvaluatorCategory"]] + :ivar supported_evaluation_levels: Evaluation levels this evaluator supports (e.g., ``turn``, + ``conversation``). When omitted on create, the service defaults to ``["turn"]``. On update, + omitting this field leaves it unchanged; an empty list is rejected. Custom code-based + evaluators support only ``turn``; custom prompt-based evaluators support exactly one level + (``turn`` or ``conversation``). + :vartype supported_evaluation_levels: list[Union[str, "EvaluationLevel"]] + :ivar definition: Definition of the evaluator. Required. + :vartype definition: "EvaluatorDefinition" + :ivar generation_artifacts: Provenance artifacts from the generation pipeline. Read-only; + present only on evaluator versions created via an EvaluatorGenerationJob. Each artifact + resolves to a versioned Foundry Dataset. + :vartype generation_artifacts: "EvaluatorGenerationArtifacts" + :ivar generation_job_id: Read-only provenance link back to the EvaluatorGenerationJob that + produced this version. Present only on evaluator versions created via the generation pipeline; + absent for manually-created versions and unaffected by subsequent ``PATCH`` calls. + :vartype generation_job_id: str + :ivar warnings: Categories of warnings surfaced on this generated evaluator version. Present + only on versions created via an EvaluatorGenerationJob when the paired job produced non-empty + warnings. Absent (treat as no warnings) when the version is not from generation, when the + paired job was clean, or when a subsequent ``PATCH`` to ``definition`` cleared the paired job's + advisories. Follow ``generation_job_id`` to fetch the detailed warning payloads. + :vartype warnings: list[Union[str, "GenerationWarningType"]] + :ivar created_by: Creator of the evaluator. Required. + :vartype created_by: str + :ivar created_at: Creation date/time of the evaluator. Required. + :vartype created_at: str + :ivar modified_at: Last modified date/time of the evaluator. Required. + :vartype modified_at: str + :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] + """ + + display_name: str + """Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not + need to be unique.""" + metadata: dict[str, str] + """Metadata about the evaluator.""" + evaluator_type: Required[Union[str, "EvaluatorType"]] + """The type of the evaluator. Required. Known values are: \"builtin\" and \"custom\".""" + categories: Required[list[Union[str, "EvaluatorCategory"]]] + """The categories of the evaluator. Required.""" + supported_evaluation_levels: list[Union[str, "EvaluationLevel"]] + """Evaluation levels this evaluator supports (e.g., ``turn``, ``conversation``). When omitted on + create, the service defaults to ``[\"turn\"]``. On update, omitting this field leaves it + unchanged; an empty list is rejected. Custom code-based evaluators support only ``turn``; + custom prompt-based evaluators support exactly one level (``turn`` or ``conversation``).""" + definition: Required["EvaluatorDefinition"] + """Definition of the evaluator. Required.""" + generation_artifacts: "EvaluatorGenerationArtifacts" + """Provenance artifacts from the generation pipeline. Read-only; present only on evaluator + versions created via an EvaluatorGenerationJob. Each artifact resolves to a versioned Foundry + Dataset.""" + generation_job_id: str + """Read-only provenance link back to the EvaluatorGenerationJob that produced this version. + Present only on evaluator versions created via the generation pipeline; absent for + manually-created versions and unaffected by subsequent ``PATCH`` calls.""" + warnings: list[Union[str, "GenerationWarningType"]] + """Categories of warnings surfaced on this generated evaluator version. Present only on versions + created via an EvaluatorGenerationJob when the paired job produced non-empty warnings. Absent + (treat as no warnings) when the version is not from generation, when the paired job was clean, + or when a subsequent ``PATCH`` to ``definition`` cleared the paired job's advisories. Follow + ``generation_job_id`` to fetch the detailed warning payloads.""" + created_by: Required[str] + """Creator of the evaluator. Required.""" + created_at: Required[str] + """Creation date/time of the evaluator. Required.""" + modified_at: Required[str] + """Last modified date/time of the evaluator. Required.""" + id: str + """Asset ID, a unique identifier for the asset.""" + name: Required[str] + """The name of the resource. Required.""" + version: Required[str] + """The version of the resource. Required.""" + description: str + """The asset description text.""" + tags: dict[str, str] + """Tag dictionary. Tags can be added, removed, and updated.""" + + +class ExternalAgentDefinition(TypedDict, total=False): + """The external agent definition. Represents a third-party agent hosted outside Foundry (for + example, on GCP or AWS). Registration is metadata-only: Foundry records the agent definition to + light up observability experiences (traces, evaluations) over customer-emitted OpenTelemetry + data. + + :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. + :vartype rai_config: "RaiConfig" + :ivar kind: Required. EXTERNAL. + :vartype kind: Literal[AgentKind.EXTERNAL] + :ivar otel_agent_id: The OpenTelemetry agent identifier used to attribute customer-emitted + spans to this Foundry agent. Spans must include the attribute ``gen_ai.agent.id = + `` to appear under this registration. Defaults to the top-level agent name when + omitted. Provide an explicit value only for migration scenarios where the running external + agent already emits a stable id that differs from the Foundry agent name. The resolved value is + always echoed on read. + :vartype otel_agent_id: str + """ + + rai_config: "RaiConfig" + """Configuration for Responsible AI (RAI) content filtering and safety features.""" + kind: Required[Literal[AgentKind.EXTERNAL]] + """Required. EXTERNAL.""" + otel_agent_id: str + """The OpenTelemetry agent identifier used to attribute customer-emitted spans to this Foundry + agent. Spans must include the attribute ``gen_ai.agent.id = `` to appear under + this registration. Defaults to the top-level agent name when omitted. Provide an explicit value + only for migration scenarios where the running external agent already emits a stable id that + differs from the Foundry agent name. The resolved value is always echoed on read.""" + + +class FabricDataAgentToolParameters(TypedDict, total=False): + """The fabric data agent 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["ToolProjectConnection"] + """ + + project_connections: list["ToolProjectConnection"] + """The project connections attached to this tool. There can be a maximum of 1 connection resource + attached to the tool.""" + + +class FabricIQPreviewTool(TypedDict, total=False): + """A FabricIQ server-side tool. + + :ivar type: The object type, which is always 'fabric_iq_preview'. Required. FABRIC_IQ_PREVIEW. + :vartype type: Literal[ToolType.FABRIC_IQ_PREVIEW] + :ivar project_connection_id: The ID of the FabricIQ project connection. Required. + :vartype project_connection_id: str + :ivar server_label: (Optional) The label of the FabricIQ MCP server to connect to. + :vartype server_label: str + :ivar server_url: (Optional) The URL of the FabricIQ MCP server. If not provided, the URL from + the project connection will be used. + :vartype server_url: str + :ivar require_approval: (Optional) Whether the agent requires approval before executing + actions. Default is always. Is either a MCPToolRequireApproval type or a str type. + :vartype require_approval: Union["MCPToolRequireApproval", str] + """ + + type: Required[Literal[ToolType.FABRIC_IQ_PREVIEW]] + """The object type, which is always 'fabric_iq_preview'. Required. FABRIC_IQ_PREVIEW.""" + project_connection_id: Required[str] + """The ID of the FabricIQ project connection. Required.""" + server_label: str + """(Optional) The label of the FabricIQ MCP server to connect to.""" + server_url: str + """(Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project + connection will be used.""" + require_approval: Optional[Union["MCPToolRequireApproval", str]] + """(Optional) Whether the agent requires approval before executing actions. Default is always. Is + either a MCPToolRequireApproval type or a str type.""" + + +class FabricIQPreviewToolboxTool(TypedDict, total=False): + """A FabricIQ 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, "ToolConfig"] + :ivar type: Required. FABRIC_IQ_PREVIEW. + :vartype type: Literal[ToolboxToolType.FABRIC_IQ_PREVIEW] + :ivar project_connection_id: The ID of the FabricIQ project connection. Required. + :vartype project_connection_id: str + :ivar server_label: (Optional) The label of the FabricIQ MCP server to connect to. + :vartype server_label: str + :ivar server_url: (Optional) The URL of the FabricIQ MCP server. If not provided, the URL from + the project connection will be used. + :vartype server_url: str + :ivar require_approval: (Optional) Whether the agent requires approval before executing + actions. Default is always. Is either a MCPToolRequireApproval type or a str type. + :vartype require_approval: Union["MCPToolRequireApproval", str] + """ + + name: str + """Optional user-defined name for this tool or configuration.""" + description: str + """Optional user-defined description for this tool or configuration.""" + tool_configs: dict[str, "ToolConfig"] + """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.""" + type: Required[Literal[ToolboxToolType.FABRIC_IQ_PREVIEW]] + """Required. FABRIC_IQ_PREVIEW.""" + project_connection_id: Required[str] + """The ID of the FabricIQ project connection. Required.""" + server_label: str + """(Optional) The label of the FabricIQ MCP server to connect to.""" + server_url: str + """(Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project + connection will be used.""" + require_approval: Optional[Union["MCPToolRequireApproval", str]] + """(Optional) Whether the agent requires approval before executing actions. Default is always. Is + either a MCPToolRequireApproval type or a str type.""" + + +class FieldMapping(TypedDict, total=False): + """Field mapping configuration class. + + :ivar contentFields: List of fields with text content. Required. + :vartype contentFields: list[str] + :ivar filepathField: Path of file to be used as a source of text content. + :vartype filepathField: str + :ivar titleField: Field containing the title of the document. + :vartype titleField: str + :ivar urlField: Field containing the url of the document. + :vartype urlField: str + :ivar vectorFields: List of fields with vector content. + :vartype vectorFields: list[str] + :ivar metadataFields: List of fields with metadata content. + :vartype metadataFields: list[str] + """ + + contentFields: Required[list[str]] + """List of fields with text content. Required.""" + filepathField: str + """Path of file to be used as a source of text content.""" + titleField: str + """Field containing the title of the document.""" + urlField: str + """Field containing the url of the document.""" + vectorFields: list[str] + """List of fields with vector content.""" + metadataFields: list[str] + """List of fields with metadata content.""" + + +class FileDataGenerationJobOutput(TypedDict, total=False): + """Azure OpenAI file output for a data generation job. + + :ivar type: Azure OpenAI file output. Required. The generated data is an Azure OpenAI File. + :vartype type: Literal[DataGenerationJobOutputType.FILE] + :ivar id: The id of the output Azure OpenAI file. Required. + :vartype id: str + :ivar filename: The filename of the output Azure OpenAI file. Required. + :vartype filename: str + """ + + type: Required[Literal[DataGenerationJobOutputType.FILE]] + """Azure OpenAI file output. Required. The generated data is an Azure OpenAI File.""" + id: Required[str] + """The id of the output Azure OpenAI file. Required.""" + filename: Required[str] + """The filename of the output Azure OpenAI file. Required.""" + + +class FileDataGenerationJobSource(TypedDict, total=False): + """File source for data generation jobs — Azure OpenAI file input. + + :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 job, which is File. Required. File source — Azure OpenAI + file. + :vartype type: Literal[DataGenerationJobSourceType.FILE] + :ivar id: Input Azure Open AI file id used for data generation. Required. + :vartype id: str + """ + + description: str + """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: Required[Literal[DataGenerationJobSourceType.FILE]] + """The source type for this job, which is File. Required. File source — Azure OpenAI file.""" + id: Required[str] + """Input Azure Open AI file id used for data generation. Required.""" + + +class FileDatasetVersion(TypedDict, total=False): + """FileDatasetVersion Definition. + + :ivar dataUri: URI of the data (`example `_). + Required. + :vartype dataUri: str + :ivar isReference: Indicates if the dataset holds a reference to the storage, or the dataset + manages storage itself. If true, the underlying data will not be deleted when the dataset + version is deleted. + :vartype isReference: bool + :ivar connectionName: The Azure Storage Account connection name. Required if + startPendingUploadVersion was not called before creating the Dataset. + :vartype connectionName: str + :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: Dataset type. Required. URI file. + :vartype type: Literal[DatasetType.URI_FILE] + """ + + dataUri: Required[str] + """URI of the data (`example `_). Required.""" + isReference: bool + """Indicates if the dataset holds a reference to the storage, or the dataset manages storage + itself. If true, the underlying data will not be deleted when the dataset version is deleted.""" + connectionName: str + """The Azure Storage Account connection name. Required if startPendingUploadVersion was not called + before creating the Dataset.""" + id: str + """Asset ID, a unique identifier for the asset.""" + name: Required[str] + """The name of the resource. Required.""" + version: Required[str] + """The version of the resource. Required.""" + description: str + """The asset description text.""" + tags: dict[str, str] + """Tag dictionary. Tags can be added, removed, and updated.""" + type: Required[Literal[DatasetType.URI_FILE]] + """Dataset type. Required. URI file.""" + + +class FileSearchTool(TypedDict, total=False): + """File search. + + :ivar type: The type of the file search tool. Always ``file_search``. Required. FILE_SEARCH. + :vartype type: Literal[ToolType.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: "RankingOptions" + :ivar filters: Is either a ComparisonFilter type or a CompoundFilter type. + :vartype filters: "_unions.Filters" + :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, "ToolConfig"] + """ + + type: Required[Literal[ToolType.FILE_SEARCH]] + """The type of the file search tool. Always ``file_search``. Required. FILE_SEARCH.""" + vector_store_ids: Required[list[str]] + """The IDs of the vector stores to search. Required.""" + max_num_results: int + """The maximum number of results to return. This number should be between 1 and 50 inclusive.""" + ranking_options: "RankingOptions" + """Ranking options for search.""" + filters: Optional["_unions.Filters"] + """Is either a ComparisonFilter type or a CompoundFilter type.""" + name: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + description: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + tool_configs: dict[str, "ToolConfig"] + """Deprecated. This property is deprecated and will be removed in a future version.""" + + +class FileSearchToolboxTool(TypedDict, total=False): + """A file 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, "ToolConfig"] + :ivar type: Required. FILE_SEARCH. + :vartype type: Literal[ToolboxToolType.FILE_SEARCH] + :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: "RankingOptions" + :ivar filters: Is either a ComparisonFilter type or a CompoundFilter type. + :vartype filters: "_unions.Filters" + :ivar vector_store_ids: The IDs of the vector stores to search. + :vartype vector_store_ids: list[str] + """ + + name: str + """Optional user-defined name for this tool or configuration.""" + description: str + """Optional user-defined description for this tool or configuration.""" + tool_configs: dict[str, "ToolConfig"] + """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.""" + type: Required[Literal[ToolboxToolType.FILE_SEARCH]] + """Required. FILE_SEARCH.""" + max_num_results: int + """The maximum number of results to return. This number should be between 1 and 50 inclusive.""" + ranking_options: "RankingOptions" + """Ranking options for search.""" + filters: Optional["_unions.Filters"] + """Is either a ComparisonFilter type or a CompoundFilter type.""" + vector_store_ids: list[str] + """The IDs of the vector stores to search.""" + + +class FixedRatioVersionSelectionRule(TypedDict, total=False): + """FixedRatioVersionSelectionRule. + + :ivar agent_version: The agent version to route traffic to. Required. + :vartype agent_version: str + :ivar type: Required. FIXED_RATIO. + :vartype type: Literal[VersionSelectorType.FIXED_RATIO] + :ivar traffic_percentage: The percentage of traffic to route to the version. Must be between 0 + and 100. Required. + :vartype traffic_percentage: int + """ + + agent_version: Required[str] + """The agent version to route traffic to. Required.""" + type: Required[Literal[VersionSelectorType.FIXED_RATIO]] + """Required. FIXED_RATIO.""" + traffic_percentage: Required[int] + """The percentage of traffic to route to the version. Must be between 0 and 100. Required.""" + + +class FolderDatasetVersion(TypedDict, total=False): + """FileDatasetVersion Definition. + + :ivar dataUri: URI of the data (`example `_). + Required. + :vartype dataUri: str + :ivar isReference: Indicates if the dataset holds a reference to the storage, or the dataset + manages storage itself. If true, the underlying data will not be deleted when the dataset + version is deleted. + :vartype isReference: bool + :ivar connectionName: The Azure Storage Account connection name. Required if + startPendingUploadVersion was not called before creating the Dataset. + :vartype connectionName: str + :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: Dataset type. Required. URI folder. + :vartype type: Literal[DatasetType.URI_FOLDER] + """ + + dataUri: Required[str] + """URI of the data (`example `_). Required.""" + isReference: bool + """Indicates if the dataset holds a reference to the storage, or the dataset manages storage + itself. If true, the underlying data will not be deleted when the dataset version is deleted.""" + connectionName: str + """The Azure Storage Account connection name. Required if startPendingUploadVersion was not called + before creating the Dataset.""" + id: str + """Asset ID, a unique identifier for the asset.""" + name: Required[str] + """The name of the resource. Required.""" + version: Required[str] + """The version of the resource. Required.""" + description: str + """The asset description text.""" + tags: dict[str, str] + """Tag dictionary. Tags can be added, removed, and updated.""" + type: Required[Literal[DatasetType.URI_FOLDER]] + """Dataset type. Required. URI folder.""" + + +class FoundryModelWarning(TypedDict, total=False): + """A warning associated with a model. + + :ivar code: The warning code. Known values are: "RuntimeDependentArtifact" and + "UnclassifiedArtifact". + :vartype code: Union[str, "FoundryModelWarningCode"] + :ivar message: The warning message. + :vartype message: str + """ + + code: Union[str, "FoundryModelWarningCode"] + """The warning code. Known values are: \"RuntimeDependentArtifact\" and \"UnclassifiedArtifact\".""" + message: str + """The warning message.""" + + +class FunctionShellToolParam(TypedDict, total=False): + """Shell tool. + + :ivar type: The type of the shell tool. Always ``shell``. Required. SHELL. + :vartype type: Literal[ToolType.SHELL] + :ivar environment: + :vartype environment: "FunctionShellToolParamEnvironment" + :ivar allowed_callers: + :vartype allowed_callers: list[Union[str, "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, "ToolConfig"] + """ + + type: Required[Literal[ToolType.SHELL]] + """The type of the shell tool. Always ``shell``. Required. SHELL.""" + environment: Optional["FunctionShellToolParamEnvironment"] + allowed_callers: Optional[list[Union[str, "CallableToolAllowedCaller"]]] + name: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + description: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + tool_configs: dict[str, "ToolConfig"] + """Deprecated. This property is deprecated and will be removed in a future version.""" + + +class FunctionShellToolParamEnvironmentContainerReferenceParam(TypedDict, total=False): # pylint: disable=name-too-long + """FunctionShellToolParamEnvironmentContainerReferenceParam. + + :ivar type: References a container created with the /v1/containers endpoint. Required. + CONTAINER_REFERENCE. + :vartype type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE] + :ivar container_id: The ID of the referenced container. Required. + :vartype container_id: str + """ + + type: Required[Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE]] + """References a container created with the /v1/containers endpoint. Required. CONTAINER_REFERENCE.""" + container_id: Required[str] + """The ID of the referenced container. Required.""" + + +class FunctionShellToolParamEnvironmentLocalEnvironmentParam(TypedDict, total=False): # pylint: disable=name-too-long + """FunctionShellToolParamEnvironmentLocalEnvironmentParam. + + :ivar type: Use a local computer environment. Required. LOCAL. + :vartype type: Literal[FunctionShellToolParamEnvironmentType.LOCAL] + :ivar skills: An optional list of skills. + :vartype skills: list["LocalSkillParam"] + """ + + type: Required[Literal[FunctionShellToolParamEnvironmentType.LOCAL]] + """Use a local computer environment. Required. LOCAL.""" + skills: list["LocalSkillParam"] + """An optional list of skills.""" + + +class FunctionTool(TypedDict, total=False): + """Function. + + :ivar type: The type of the function tool. Always ``function``. Required. FUNCTION. + :vartype type: Literal[ToolType.FUNCTION] + :ivar name: The name of the function to call. Required. + :vartype name: str + :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[Union[str, "CallableToolAllowedCaller"]] + """ + + type: Required[Literal[ToolType.FUNCTION]] + """The type of the function tool. Always ``function``. Required. FUNCTION.""" + name: Required[str] + """The name of the function to call. Required.""" + description: Optional[str] + parameters: Required[Optional[dict[str, Any]]] + """Required.""" + output_schema: Optional[dict[str, Any]] + strict: Required[Optional[bool]] + """Required.""" + defer_loading: bool + """Whether this function is deferred and loaded via tool search.""" + allowed_callers: Optional[list[Union[str, "CallableToolAllowedCaller"]]] + + +class FunctionToolParam(TypedDict, total=False): + """FunctionToolParam. + + :ivar name: Required. + :vartype name: str + :ivar description: + :vartype description: str + :ivar parameters: + :vartype parameters: "EmptyModelParam" + :ivar strict: + :vartype strict: bool + :ivar type: Required. Default value is "function". + :vartype type: Literal["function"] + :ivar output_schema: + :vartype output_schema: dict[str, Any] + :ivar defer_loading: Whether this function should be deferred and discovered via tool search. + :vartype defer_loading: bool + :ivar allowed_callers: + :vartype allowed_callers: list[Union[str, "CallableToolAllowedCaller"]] + """ + + name: Required[str] + """Required.""" + description: Optional[str] + parameters: Optional["EmptyModelParam"] + strict: Optional[bool] + type: Required[Literal["function"]] + """Required. Default value is \"function\".""" + output_schema: Optional[dict[str, Any]] + defer_loading: bool + """Whether this function should be deferred and discovered via tool search.""" + allowed_callers: Optional[list[Union[str, "CallableToolAllowedCaller"]]] + + +class GitHubIssueRoutineTrigger(TypedDict, total=False): + """A GitHub issue routine trigger. + + :ivar type: The trigger type. Required. A GitHub issue trigger. + :vartype type: Literal[RoutineTriggerType.GITHUB_ISSUE] + :ivar connection_id: The workspace connection identifier that resolves the GitHub configuration + for the trigger. Required. + :vartype connection_id: str + :ivar owner: The GitHub owner or organization that scopes which issues can fire the trigger. + Required. + :vartype owner: str + :ivar repository: The GitHub repository filter that scopes which issues can fire the trigger. + Required. + :vartype repository: str + :ivar issue_event: The GitHub issue event that fires the routine. Required. Known values are: + "opened" and "closed". + :vartype issue_event: Union[str, "GitHubIssueEvent"] + """ + + type: Required[Literal[RoutineTriggerType.GITHUB_ISSUE]] + """The trigger type. Required. A GitHub issue trigger.""" + connection_id: Required[str] + """The workspace connection identifier that resolves the GitHub configuration for the trigger. + Required.""" + owner: Required[str] + """The GitHub owner or organization that scopes which issues can fire the trigger. Required.""" + repository: Required[str] + """The GitHub repository filter that scopes which issues can fire the trigger. Required.""" + issue_event: Required[Union[str, "GitHubIssueEvent"]] + """The GitHub issue event that fires the routine. Required. Known values are: \"opened\" and + \"closed\".""" + + +class HeaderTelemetryEndpointAuth(TypedDict, total=False): + """Header-based secret authentication for a telemetry endpoint. The resolved secret value is + injected as an HTTP header. + + :ivar type: The authentication type, always 'header' for header-based secret authentication. + Required. Header-based secret authentication. + :vartype type: Literal[TelemetryEndpointAuthType.HEADER] + :ivar header_name: The name of the HTTP header to inject the secret value into. Required. + :vartype header_name: str + :ivar secret_id: The identifier of the secret store or connection. Required. + :vartype secret_id: str + :ivar secret_key: The key within the secret to retrieve the authentication value. Required. + :vartype secret_key: str + """ + + type: Required[Literal[TelemetryEndpointAuthType.HEADER]] + """The authentication type, always 'header' for header-based secret authentication. Required. + Header-based secret authentication.""" + header_name: Required[str] + """The name of the HTTP header to inject the secret value into. Required.""" + secret_id: Required[str] + """The identifier of the secret store or connection. Required.""" + secret_key: Required[str] + """The key within the secret to retrieve the authentication value. Required.""" + + +class HostedAgentDefinition(TypedDict, total=False): + """The hosted agent definition. + + :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. + :vartype rai_config: "RaiConfig" + :ivar kind: Required. HOSTED. + :vartype kind: Literal[AgentKind.HOSTED] + :ivar cpu: The CPU configuration for the hosted agent. Required. + :vartype cpu: str + :ivar memory: The memory configuration for the hosted agent. Required. + :vartype memory: str + :ivar environment_variables: Environment variables to set in the hosted agent container. + :vartype environment_variables: dict[str, str] + :ivar container_configuration: Container-based deployment configuration. Provide this for + image-based deployments. Mutually exclusive with code_configuration — the service validates + that exactly one is set. + :vartype container_configuration: "ContainerConfiguration" + :ivar protocol_versions: The protocols that the agent supports for ingress communication. + :vartype protocol_versions: list["ProtocolVersionRecord"] + :ivar code_configuration: Code-based deployment configuration. Provide this for code-based + deployments. Mutually exclusive with container_configuration — the service validates that + exactly one is set. + :vartype code_configuration: "CodeConfiguration" + :ivar telemetry_config: Optional customer-supplied telemetry configuration for exporting + container logs, traces, and metrics. + :vartype telemetry_config: "TelemetryConfig" + """ + + rai_config: "RaiConfig" + """Configuration for Responsible AI (RAI) content filtering and safety features.""" + kind: Required[Literal[AgentKind.HOSTED]] + """Required. HOSTED.""" + cpu: Required[str] + """The CPU configuration for the hosted agent. Required.""" + memory: Required[str] + """The memory configuration for the hosted agent. Required.""" + environment_variables: dict[str, str] + """Environment variables to set in the hosted agent container.""" + container_configuration: "ContainerConfiguration" + """Container-based deployment configuration. Provide this for image-based deployments. Mutually + exclusive with code_configuration — the service validates that exactly one is set.""" + protocol_versions: list["ProtocolVersionRecord"] + """The protocols that the agent supports for ingress communication.""" + code_configuration: "CodeConfiguration" + """Code-based deployment configuration. Provide this for code-based deployments. Mutually + exclusive with container_configuration — the service validates that exactly one is set.""" + telemetry_config: "TelemetryConfig" + """Optional customer-supplied telemetry configuration for exporting container logs, traces, and + metrics.""" + + +class HourlyRecurrenceSchedule(TypedDict, total=False): + """Hourly recurrence schedule. + + :ivar type: Required. Hourly recurrence pattern. + :vartype type: Literal[RecurrenceType.HOURLY] + """ + + type: Required[Literal[RecurrenceType.HOURLY]] + """Required. Hourly recurrence pattern.""" + + +class HumanEvaluationPreviewRuleAction(TypedDict, total=False): + """Evaluation rule action for human evaluation. + + :ivar type: Required. Human evaluation preview. + :vartype type: Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW] + :ivar templateId: Human evaluation template Id. Required. + :vartype templateId: str + """ + + type: Required[Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW]] + """Required. Human evaluation preview.""" + templateId: Required[str] + """Human evaluation template Id. Required.""" + + +class HybridSearchOptions(TypedDict, total=False): + """HybridSearchOptions. + + :ivar embedding_weight: The weight of the embedding in the reciprocal ranking fusion. Required. + :vartype embedding_weight: float + :ivar text_weight: The weight of the text in the reciprocal ranking fusion. Required. + :vartype text_weight: float + """ + + embedding_weight: Required[float] + """The weight of the embedding in the reciprocal ranking fusion. Required.""" + text_weight: Required[float] + """The weight of the text in the reciprocal ranking fusion. Required.""" + + +class ImageGenTool(TypedDict, total=False): + """Image generation tool. + + :ivar type: The type of the image generation tool. Always ``image_generation``. Required. + IMAGE_GENERATION. + :vartype type: Literal[ToolType.IMAGE_GENERATION] + :ivar model: Is one of the following types: Literal["gpt-image-1"], + Literal["gpt-image-1-mini"], Literal["gpt-image-1.5"], str + :vartype model: Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], + Literal["gpt-image-1.5"], 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: Literal["low", "medium", "high", "auto"] + :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: Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], + Literal["auto"], 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: Literal["png", "webp", "jpeg"] + :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: Literal["auto", "low"] + :ivar background: Background type for the generated image. One of ``transparent``, ``opaque``, + or ``auto``. Default: ``auto``. Is one of the following types: Literal["transparent"], + Literal["opaque"], Literal["auto"] + :vartype background: Literal["transparent", "opaque", "auto"] + :ivar input_fidelity: Known values are: "high" and "low". + :vartype input_fidelity: Union[str, "InputFidelity"] + :ivar input_image_mask: Optional mask for inpainting. Contains ``image_url`` (string, optional) + and ``file_id`` (string, optional). + :vartype input_image_mask: "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: Union[str, "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, "ToolConfig"] + """ + + type: Required[Literal[ToolType.IMAGE_GENERATION]] + """The type of the image generation tool. Always ``image_generation``. Required. IMAGE_GENERATION.""" + model: Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], Literal["gpt-image-1.5"], str] + """Is one of the following types: Literal[\"gpt-image-1\"], Literal[\"gpt-image-1-mini\"], + Literal[\"gpt-image-1.5\"], str""" + quality: Literal["low", "medium", "high", "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: Union[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: Literal["png", "webp", "jpeg"] + """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: int + """Compression level for the output image. Default: 100.""" + moderation: Literal["auto", "low"] + """Moderation level for the generated image. Default: ``auto``. Is either a Literal[\"auto\"] type + or a Literal[\"low\"] type.""" + background: Literal["transparent", "opaque", "auto"] + """Background type for the generated image. One of ``transparent``, ``opaque``, or ``auto``. + Default: ``auto``. Is one of the following types: Literal[\"transparent\"], + Literal[\"opaque\"], Literal[\"auto\"]""" + input_fidelity: Optional[Union[str, "InputFidelity"]] + """Known values are: \"high\" and \"low\".""" + input_image_mask: "ImageGenToolInputImageMask" + """Optional mask for inpainting. Contains ``image_url`` (string, optional) and ``file_id`` + (string, optional).""" + partial_images: int + """Number of partial images to generate in streaming mode, from 0 (default value) to 3.""" + action: Union[str, "ImageGenAction"] + """Whether to generate a new image or edit an existing image. Default: ``auto``. Known values are: + \"generate\", \"edit\", and \"auto\".""" + name: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + description: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + tool_configs: dict[str, "ToolConfig"] + """Deprecated. This property is deprecated and will be removed in a future version.""" + + +class ImageGenToolInputImageMask(TypedDict, total=False): + """ImageGenToolInputImageMask. + + :ivar image_url: + :vartype image_url: str + :ivar file_id: + :vartype file_id: str + """ + + image_url: str + file_id: str + + +class InlineSkillParam(TypedDict, total=False): + """InlineSkillParam. + + :ivar type: Defines an inline skill for this request. Required. INLINE. + :vartype type: Literal[ContainerSkillType.INLINE] + :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: "InlineSkillSourceParam" + """ + + type: Required[Literal[ContainerSkillType.INLINE]] + """Defines an inline skill for this request. Required. INLINE.""" + name: Required[str] + """The name of the skill. Required.""" + description: Required[str] + """The description of the skill. Required.""" + source: Required["InlineSkillSourceParam"] + """Inline skill payload. Required.""" + + +class InlineSkillSourceParam(TypedDict, total=False): + """Inline skill payload. + + :ivar type: The type of the inline skill source. Must be ``base64``. Required. Default value is + "base64". + :vartype type: Literal["base64"] + :ivar media_type: The media type of the inline skill payload. Must be ``application/zip``. + Required. Default value is "application/zip". + :vartype media_type: Literal["application/zip"] + :ivar data: Base64-encoded skill zip bundle. Required. + :vartype data: str + """ + + type: Required[Literal["base64"]] + """The type of the inline skill source. Must be ``base64``. Required. Default value is \"base64\".""" + media_type: Required[Literal["application/zip"]] + """The media type of the inline skill payload. Must be ``application/zip``. Required. Default + value is \"application/zip\".""" + data: Required[str] + """Base64-encoded skill zip bundle. Required.""" + + +class Insight(TypedDict, total=False): + """The response body for cluster insights. + + :ivar id: The unique identifier for the insights report. Required. + :vartype id: str + :ivar metadata: Metadata about the insights report. Required. + :vartype metadata: "InsightsMetadata" + :ivar state: The current state of the insights. Required. Known values are: "NotStarted", + "Running", "Succeeded", "Failed", and "Canceled". + :vartype state: Union[str, "OperationState"] + :ivar displayName: User friendly display name for the insight. Required. + :vartype displayName: str + :ivar request: Request for the insights analysis. Required. + :vartype request: "InsightRequest" + :ivar result: The result of the insights report. + :vartype result: "InsightResult" + """ + + id: Required[str] + """The unique identifier for the insights report. Required.""" + metadata: Required["InsightsMetadata"] + """Metadata about the insights report. Required.""" + state: Required[Union[str, "OperationState"]] + """The current state of the insights. Required. Known values are: \"NotStarted\", \"Running\", + \"Succeeded\", \"Failed\", and \"Canceled\".""" + displayName: Required[str] + """User friendly display name for the insight. Required.""" + request: Required["InsightRequest"] + """Request for the insights analysis. Required.""" + result: "InsightResult" + """The result of the insights report.""" + + +class InsightCluster(TypedDict, total=False): + """A cluster of analysis samples. + + :ivar id: The id of the analysis cluster. Required. + :vartype id: str + :ivar label: Label for the cluster. Required. + :vartype label: str + :ivar suggestion: Suggestion for the cluster. Required. + :vartype suggestion: str + :ivar suggestionTitle: The title of the suggestion for the cluster. Required. + :vartype suggestionTitle: str + :ivar description: Description of the analysis cluster. Required. + :vartype description: str + :ivar weight: The weight of the analysis cluster. This indicate number of samples in the + cluster. Required. + :vartype weight: int + :ivar subClusters: List of subclusters within this cluster. Empty if no subclusters exist. + :vartype subClusters: list["InsightCluster"] + :ivar samples: List of samples that belong to this cluster. Empty if samples are part of + subclusters. + :vartype samples: list["InsightSample"] + """ + + id: Required[str] + """The id of the analysis cluster. Required.""" + label: Required[str] + """Label for the cluster. Required.""" + suggestion: Required[str] + """Suggestion for the cluster. Required.""" + suggestionTitle: Required[str] + """The title of the suggestion for the cluster. Required.""" + description: Required[str] + """Description of the analysis cluster. Required.""" + weight: Required[int] + """The weight of the analysis cluster. This indicate number of samples in the cluster. Required.""" + subClusters: list["InsightCluster"] + """List of subclusters within this cluster. Empty if no subclusters exist.""" + samples: list["InsightSample"] + """List of samples that belong to this cluster. Empty if samples are part of subclusters.""" + + +class InsightModelConfiguration(TypedDict, total=False): + """Configuration of the model used in the insight generation. + + :ivar modelDeploymentName: The model deployment to be evaluated. Accepts either the deployment + name alone or with the connection name as '{connectionName}/'. Required. + :vartype modelDeploymentName: str + """ + + modelDeploymentName: Required[str] + """The model deployment to be evaluated. Accepts either the deployment name alone or with the + connection name as '{connectionName}/'. Required.""" + + +class InsightScheduleTask(TypedDict, total=False): + """Insight task for the schedule. + + :ivar configuration: Configuration for the task. + :vartype configuration: dict[str, str] + :ivar type: Required. Insight task. + :vartype type: Literal[ScheduleTaskType.INSIGHT] + :ivar insight: The insight payload. Required. + :vartype insight: "Insight" + """ + + configuration: dict[str, str] + """Configuration for the task.""" + type: Required[Literal[ScheduleTaskType.INSIGHT]] + """Required. Insight task.""" + insight: Required["Insight"] + """The insight payload. Required.""" + + +class InsightsMetadata(TypedDict, total=False): + """Metadata about the insights. + + :ivar createdAt: The timestamp when the insights were created. Required. + :vartype createdAt: str + :ivar completedAt: The timestamp when the insights were completed. + :vartype completedAt: str + """ + + createdAt: Required[str] + """The timestamp when the insights were created. Required.""" + completedAt: str + """The timestamp when the insights were completed.""" + + +class InsightSummary(TypedDict, total=False): + """Summary of the error cluster analysis. + + :ivar sampleCount: Total number of samples analyzed. Required. + :vartype sampleCount: int + :ivar uniqueSubclusterCount: Total number of unique subcluster labels. Required. + :vartype uniqueSubclusterCount: int + :ivar uniqueClusterCount: Total number of unique clusters. Required. + :vartype uniqueClusterCount: int + :ivar method: Method used for clustering. Required. + :vartype method: str + :ivar usage: Token usage while performing clustering analysis. Required. + :vartype usage: "ClusterTokenUsage" + """ + + sampleCount: Required[int] + """Total number of samples analyzed. Required.""" + uniqueSubclusterCount: Required[int] + """Total number of unique subcluster labels. Required.""" + uniqueClusterCount: Required[int] + """Total number of unique clusters. Required.""" + method: Required[str] + """Method used for clustering. Required.""" + usage: Required["ClusterTokenUsage"] + """Token usage while performing clustering analysis. Required.""" + + +class InvocationsProtocolConfiguration(TypedDict, total=False): + """Configuration specific to the invocations protocol.""" + + +class InvocationsWsProtocolConfiguration(TypedDict, total=False): + """Configuration specific to the WebSocket-based invocations protocol.""" + + +class InvokeAgentInvocationsApiDispatchPayload(TypedDict, total=False): + """A manual payload used to test an invocations API routine dispatch. + + :ivar type: The manual dispatch payload type. Required. A manual payload for an invocations API + routine dispatch. + :vartype type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API] + :ivar input: The JSON value sent as the complete downstream invocations input. The value is + passed through as-is and can be an object, string, number, boolean, array, or null. Required. + :vartype input: Any + """ + + type: Required[Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API]] + """The manual dispatch payload type. Required. A manual payload for an invocations API routine + dispatch.""" + input: Required[Any] + """The JSON value sent as the complete downstream invocations input. The value is passed through + as-is and can be an object, string, number, boolean, array, or null. Required.""" + + +class InvokeAgentInvocationsApiRoutineAction(TypedDict, total=False): + """Dispatches a routine through the raw invocations API. Exactly one of agent_name or + agent_endpoint_id must be provided. + + :ivar type: The action type. Required. Dispatches through the raw invocations API. + :vartype type: Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API] + :ivar agent_name: The project-scoped agent name for routine dispatch. + :vartype agent_name: str + :ivar agent_endpoint_id: Legacy endpoint-scoped agent identifier for routine dispatch. + :vartype agent_endpoint_id: str + :ivar input: Static JSON value sent as the complete downstream input when the routine fires. + The value is passed through as-is; no templating is applied. + :vartype input: Any + :ivar session_id: An optional existing hosted-agent session identifier to continue during the + downstream dispatch. + :vartype session_id: str + """ + + type: Required[Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API]] + """The action type. Required. Dispatches through the raw invocations API.""" + agent_name: str + """The project-scoped agent name for routine dispatch.""" + agent_endpoint_id: str + """Legacy endpoint-scoped agent identifier for routine dispatch.""" + input: Any + """Static JSON value sent as the complete downstream input when the routine fires. The value is + passed through as-is; no templating is applied.""" + session_id: str + """An optional existing hosted-agent session identifier to continue during the downstream + dispatch.""" + + +class InvokeAgentResponsesApiDispatchPayload(TypedDict, total=False): + """A manual payload used to test a responses API routine dispatch. + + :ivar type: The manual dispatch payload type. Required. A manual payload for a responses API + routine dispatch. + :vartype type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API] + :ivar input: The JSON value sent as the complete downstream responses input. The value is + passed through as-is and can be an object, string, number, boolean, array, or null. Required. + :vartype input: Any + """ + + type: Required[Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API]] + """The manual dispatch payload type. Required. A manual payload for a responses API routine + dispatch.""" + input: Required[Any] + """The JSON value sent as the complete downstream responses input. The value is passed through + as-is and can be an object, string, number, boolean, array, or null. Required.""" + + +class InvokeAgentResponsesApiRoutineAction(TypedDict, total=False): + """Dispatches a routine through the responses API. Exactly one of agent_name or agent_endpoint_id + must be provided. + + :ivar type: The action type. Required. Dispatches through the responses API. + :vartype type: Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API] + :ivar agent_name: The project-scoped agent name for routine dispatch. + :vartype agent_name: str + :ivar agent_endpoint_id: Legacy endpoint-scoped agent identifier for routine dispatch. + :vartype agent_endpoint_id: str + :ivar input: Static JSON value sent as the complete downstream input when the routine fires. + The value is passed through as-is; no templating is applied. + :vartype input: Any + :ivar conversation: An optional existing conversation identifier to continue during the + downstream dispatch. + :vartype conversation: str + """ + + type: Required[Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API]] + """The action type. Required. Dispatches through the responses API.""" + agent_name: str + """The project-scoped agent name for routine dispatch.""" + agent_endpoint_id: str + """Legacy endpoint-scoped agent identifier for routine dispatch.""" + input: Any + """Static JSON value sent as the complete downstream input when the routine fires. The value is + passed through as-is; no templating is applied.""" + conversation: str + """An optional existing conversation identifier to continue during the downstream dispatch.""" + + +class LlmGeneratedVoiceGreetingConfig(TypedDict, total=False): + """A greeting authored by the session model from a scoped opening-turn prompt. + + :ivar type: Required. Default value is "llm_generated". + :vartype type: Literal["llm_generated"] + :ivar prompt: The Handlebars prompt that guides the opening turn. Required. + :vartype prompt: str + :ivar tool_choice: The tool-selection policy for the opening response. Defaults to ``none``. Is + one of the following types: Union[str, "_models.ToolChoiceOptions"], ToolChoiceFunction, + ToolChoiceMCP + :vartype tool_choice: "_unions.VoiceAgentToolChoice" + """ + + type: Required[Literal["llm_generated"]] + """Required. Default value is \"llm_generated\".""" + prompt: Required[str] + """The Handlebars prompt that guides the opening turn. Required.""" + tool_choice: "_unions.VoiceAgentToolChoice" + """The tool-selection policy for the opening response. Defaults to ``none``. Is one of the + following types: Union[str, \"_models.ToolChoiceOptions\"], ToolChoiceFunction, ToolChoiceMCP""" + + +class LocalShellToolParam(TypedDict, total=False): + """Local shell tool. + + :ivar type: The type of the local shell tool. Always ``local_shell``. Required. LOCAL_SHELL. + :vartype type: Literal[ToolType.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, "ToolConfig"] + """ + + type: Required[Literal[ToolType.LOCAL_SHELL]] + """The type of the local shell tool. Always ``local_shell``. Required. LOCAL_SHELL.""" + name: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + description: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + tool_configs: dict[str, "ToolConfig"] + """Deprecated. This property is deprecated and will be removed in a future version.""" + + +class LocalSkillParam(TypedDict, total=False): + """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: Required[str] + """The name of the skill. Required.""" + description: Required[str] + """The description of the skill. Required.""" + path: Required[str] + """The path to the directory containing the skill. Required.""" + + +class LogProbProperties(TypedDict, total=False): + """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: Required[str] + """The token that was used to generate the log probability. Required.""" + logprob: Required[float] + """The log probability of the token. Required.""" + bytes: Required[list[int]] + """The bytes that were used to generate the log probability. Required.""" + + +class LoraConfig(TypedDict, total=False): + """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 targetModules: Model layers modified by the adapter (e.g., q_proj, v_proj). Auto-detected + from adapter_config.json if omitted. + :vartype targetModules: list[str] + :ivar dropout: Dropout rate used during training. Informational — not used at serving time. + :vartype dropout: float + """ + + rank: int + """LoRA rank (r). Positive integer. Common values: 8, 16, 32, 64.""" + alpha: int + """LoRA scaling factor (α). Positive integer; typically 2× the rank.""" + targetModules: list[str] + """Model layers modified by the adapter (e.g., q_proj, v_proj). Auto-detected from + adapter_config.json if omitted.""" + dropout: float + """Dropout rate used during training. Informational — not used at serving time.""" + + +class ManagedAgentIdentityBlueprintReference(TypedDict, total=False): + """ManagedAgentIdentityBlueprintReference. + + :ivar type: Required. MANAGED_AGENT_IDENTITY_BLUEPRINT. + :vartype type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] + :ivar blueprint_id: The ID of the managed blueprint. Required. + :vartype blueprint_id: str + """ + + type: Required[Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT]] + """Required. MANAGED_AGENT_IDENTITY_BLUEPRINT.""" + blueprint_id: Required[str] + """The ID of the managed blueprint. Required.""" + + +class ManagedAzureAISearchIndex(TypedDict, total=False): + """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: Literal[IndexType.MANAGED_AZURE_SEARCH] + :ivar vectorStoreId: Vector store id of managed index. Required. + :vartype vectorStoreId: str + """ + + id: str + """Asset ID, a unique identifier for the asset.""" + name: Required[str] + """The name of the resource. Required.""" + version: Required[str] + """The version of the resource. Required.""" + description: str + """The asset description text.""" + tags: dict[str, str] + """Tag dictionary. Tags can be added, removed, and updated.""" + type: Required[Literal[IndexType.MANAGED_AZURE_SEARCH]] + """Type of index. Required. Managed Azure Search.""" + vectorStoreId: Required[str] + """Vector store id of managed index. Required.""" + + +class MCPListToolsTool(TypedDict, total=False): + """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: "MCPListToolsToolInputSchema" + :ivar annotations: + :vartype annotations: "MCPListToolsToolAnnotations" + """ + + name: Required[str] + """The name of the tool. Required.""" + description: Optional[str] + input_schema: Required["MCPListToolsToolInputSchema"] + """The JSON schema describing the tool's input. Required.""" + annotations: Optional["MCPListToolsToolAnnotations"] + + +class MCPListToolsToolAnnotations(TypedDict, total=False): + """MCPListToolsToolAnnotations.""" + + +class MCPListToolsToolInputSchema(TypedDict, total=False): + """MCPListToolsToolInputSchema.""" + + +class McpProtocolConfiguration(TypedDict, total=False): + """Configuration specific to the MCP protocol.""" + + +class MCPTool(TypedDict, total=False): + """MCP tool. + + :ivar type: The type of the MCP tool. Always ``mcp``. Required. MCP. + :vartype type: Literal[ToolType.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: + + * 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: Literal["connector_dropbox", "connector_gmail", + "connector_googlecalendar", "connector_googledrive", "connector_microsoftteams", + "connector_outlookcalendar", "connector_outlookemail", "connector_sharepoint"] + :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: Union[list[str], "MCPToolFilter"] + :ivar allowed_callers: + :vartype allowed_callers: list[Union[str, "CallableToolAllowedCaller"]] + :ivar require_approval: Is one of the following types: MCPToolRequireApproval, + Literal["always"], Literal["never"] + :vartype require_approval: Union["MCPToolRequireApproval", Literal["always"], Literal["never"]] + :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, "ToolConfig"] + """ + + type: Required[Literal[ToolType.MCP]] + """The type of the MCP tool. Always ``mcp``. Required. MCP.""" + server_label: Required[str] + """A label for this MCP server, used to identify it in tool calls. Required.""" + server_url: str + """The URL for the MCP server. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be + provided.""" + connector_id: Literal[ + "connector_dropbox", + "connector_gmail", + "connector_googlecalendar", + "connector_googledrive", + "connector_microsoftteams", + "connector_outlookcalendar", + "connector_outlookemail", + "connector_sharepoint", + ] + """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: + + * 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: str + """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: str + """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: str + """Optional description of the MCP server, used to provide more context.""" + headers: Optional[dict[str, str]] + allowed_tools: Optional[Union[list[str], "MCPToolFilter"]] + """Is either a [str] type or a MCPToolFilter type.""" + allowed_callers: Optional[list[Union[str, "CallableToolAllowedCaller"]]] + require_approval: Optional[Union["MCPToolRequireApproval", Literal["always"], Literal["never"]]] + """Is one of the following types: MCPToolRequireApproval, Literal[\"always\"], Literal[\"never\"]""" + defer_loading: bool + """Whether this MCP tool is deferred and discovered via tool search.""" + project_connection_id: str + """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: dict[str, "ToolConfig"] + """Deprecated. This property is deprecated and will be removed in a future version.""" + + +class MCPToolboxTool(TypedDict, total=False): + """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, "ToolConfig"] + :ivar type: Required. MCP. + :vartype type: Literal[ToolboxToolType.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: + + * 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: Literal["connector_dropbox", "connector_gmail", + "connector_googlecalendar", "connector_googledrive", "connector_microsoftteams", + "connector_outlookcalendar", "connector_outlookemail", "connector_sharepoint"] + :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: Union[list[str], "MCPToolFilter"] + :ivar allowed_callers: + :vartype allowed_callers: list[Union[str, "CallableToolAllowedCaller"]] + :ivar require_approval: Is one of the following types: MCPToolRequireApproval, + Literal["always"], Literal["never"] + :vartype require_approval: Union["MCPToolRequireApproval", Literal["always"], Literal["never"]] + :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 + """ + + name: str + """Optional user-defined name for this tool or configuration.""" + description: str + """Optional user-defined description for this tool or configuration.""" + tool_configs: dict[str, "ToolConfig"] + """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.""" + type: Required[Literal[ToolboxToolType.MCP]] + """Required. MCP.""" + server_label: Required[str] + """A label for this MCP server, used to identify it in tool calls. Required.""" + server_url: str + """The URL for the MCP server. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be + provided.""" + connector_id: Literal[ + "connector_dropbox", + "connector_gmail", + "connector_googlecalendar", + "connector_googledrive", + "connector_microsoftteams", + "connector_outlookcalendar", + "connector_outlookemail", + "connector_sharepoint", + ] + """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: + + * 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: str + """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: str + """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: str + """Optional description of the MCP server, used to provide more context.""" + headers: Optional[dict[str, str]] + allowed_tools: Optional[Union[list[str], "MCPToolFilter"]] + """Is either a [str] type or a MCPToolFilter type.""" + allowed_callers: Optional[list[Union[str, "CallableToolAllowedCaller"]]] + require_approval: Optional[Union["MCPToolRequireApproval", Literal["always"], Literal["never"]]] + """Is one of the following types: MCPToolRequireApproval, Literal[\"always\"], Literal[\"never\"]""" + defer_loading: bool + """Whether this MCP tool is deferred and discovered via tool search.""" + project_connection_id: str + """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.""" + + +class MCPToolFilter(TypedDict, total=False): + """MCP tool filter. + + :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 + """ + + tool_names: list[str] + """MCP allowed tools.""" + read_only: bool + """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.""" + + +class MCPToolRequireApproval(TypedDict, total=False): + """MCPToolRequireApproval. + + :ivar always: + :vartype always: "MCPToolFilter" + :ivar never: + :vartype never: "MCPToolFilter" + """ + + always: "MCPToolFilter" + never: "MCPToolFilter" + + +class MemorySearchOptions(TypedDict, total=False): + """Memory search options. + + :ivar max_memories: Maximum number of memory items to return. + :vartype max_memories: int + """ + + max_memories: int + """Maximum number of memory items to return.""" + + +class MemorySearchPreviewTool(TypedDict, total=False): + """A tool for integrating memories into the agent. + + :ivar type: The type of the tool. Always ``memory_search_preview``. Required. + MEMORY_SEARCH_PREVIEW. + :vartype type: Literal[ToolType.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: "MemorySearchOptions" + :ivar update_delay: Time to wait before updating memories after inactivity (seconds). Default + 300. + :vartype update_delay: int + """ + + type: Required[Literal[ToolType.MEMORY_SEARCH_PREVIEW]] + """The type of the tool. Always ``memory_search_preview``. Required. MEMORY_SEARCH_PREVIEW.""" + memory_store_name: Required[str] + """The name of the memory store to use. Required.""" + scope: Required[str] + """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: "MemorySearchOptions" + """Options for searching the memory store.""" + update_delay: int + """Time to wait before updating memories after inactivity (seconds). Default 300.""" + + +class MemoryStoreDefaultDefinition(TypedDict, total=False): + """Default memory store implementation. + + :ivar kind: The kind of the memory store. Required. The default memory store implementation. + :vartype kind: Literal[MemoryStoreKind.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: "MemoryStoreDefaultOptions" + """ + + kind: Required[Literal[MemoryStoreKind.DEFAULT]] + """The kind of the memory store. Required. The default memory store implementation.""" + chat_model: Required[str] + """The name or identifier of the chat completion model deployment used for memory processing. + Required.""" + embedding_model: Required[str] + """The name or identifier of the embedding model deployment used for memory processing. Required.""" + options: "MemoryStoreDefaultOptions" + """Default memory store options.""" + + +class MemoryStoreDefaultOptions(TypedDict, total=False): + """Default memory store configurations. + + :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: str + """ + + user_profile_enabled: Required[bool] + """Whether to enable user profile extraction and storage. Default is true. Required.""" + user_profile_details: str + """Specific categories or types of user profile information to extract and store.""" + chat_summary_enabled: Required[bool] + """Whether to enable chat summary extraction and storage. Defaults to ``true``. Required.""" + procedural_memory_enabled: bool + """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: str + """The default time-to-live for memories in seconds. A value of ``0`` indicates that memories do + not expire. Defaults to ``0``.""" + + +class Metadata(TypedDict, total=False): + """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 MicrosoftFabricPreviewTool(TypedDict, total=False): + """The input definition information for a Microsoft Fabric tool as used to configure an agent. + + :ivar type: The object type, which is always 'fabric_dataagent_preview'. Required. + FABRIC_DATAAGENT_PREVIEW. + :vartype type: Literal[ToolType.FABRIC_DATAAGENT_PREVIEW] + :ivar fabric_dataagent_preview: The fabric data agent tool parameters. Required. + :vartype fabric_dataagent_preview: "FabricDataAgentToolParameters" + """ + + type: Required[Literal[ToolType.FABRIC_DATAAGENT_PREVIEW]] + """The object type, which is always 'fabric_dataagent_preview'. Required. + FABRIC_DATAAGENT_PREVIEW.""" + fabric_dataagent_preview: Required["FabricDataAgentToolParameters"] + """The fabric data agent tool parameters. Required.""" + + +class ModelCredentialRequest(TypedDict, total=False): + """Request to fetch credentials for a model asset. + + :ivar blobUri: Blob URI of the model asset to fetch credentials for. Required. + :vartype blobUri: str + """ + + blobUri: Required[str] + """Blob URI of the model asset to fetch credentials for. Required.""" + + +class ModelPendingUploadRequest(TypedDict, total=False): + """Represents a request for a pending upload of a model version. + + :ivar pendingUploadId: If PendingUploadId is not provided, a random GUID will be used. + :vartype pendingUploadId: str + :ivar connectionName: Azure Storage Account connection name to use for generating temporary SAS + token. + :vartype connectionName: str + :ivar pendingUploadType: The type of pending upload. Only TemporaryBlobReference is supported + for models. Required. Temporary blob reference. + :vartype pendingUploadType: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] + """ + + pendingUploadId: str + """If PendingUploadId is not provided, a random GUID will be used.""" + connectionName: str + """Azure Storage Account connection name to use for generating temporary SAS token.""" + pendingUploadType: Required[Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE]] + """The type of pending upload. Only TemporaryBlobReference is supported for models. Required. + Temporary blob reference.""" + + +class ModelSamplingParams(TypedDict, total=False): + """Represents a set of parameters used to control the sampling behavior of a language model during + text generation. + + :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 + """ + + temperature: float + """The temperature parameter for sampling. Defaults to 1.0.""" + top_p: float + """The top-p parameter for nucleus sampling. Defaults to 1.0.""" + seed: int + """The random seed for reproducibility. Defaults to 42.""" + max_completion_tokens: int + """The maximum number of tokens allowed in the completion.""" + + +class ModelSourceData(TypedDict, total=False): + """Source information for the model. + + :ivar sourceType: The source type of the model. Known values are: "LocalUpload" and + "TrainingJob". + :vartype sourceType: Union[str, "FoundryModelSourceType"] + :ivar jobId: The job ID that produced this model. + :vartype jobId: str + """ + + sourceType: Union[str, "FoundryModelSourceType"] + """The source type of the model. Known values are: \"LocalUpload\" and \"TrainingJob\".""" + jobId: str + """The job ID that produced this model.""" + + +class ModelVersion(TypedDict, total=False): + """Model Version Definition. + + :ivar blobUri: URI of the model artifact in blob storage. Required. + :vartype blobUri: str + :ivar weightType: The weight type of the model. Known values are: "FullWeight", "LoRA", and + "DraftModel". + :vartype weightType: Union[str, "FoundryModelWeightType"] + :ivar baseModel: Base model asset ID. + :vartype baseModel: str + :ivar source: The source of the model. + :vartype source: "ModelSourceData" + :ivar loraConfig: 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 loraConfig: "LoraConfig" + :ivar artifactProfile: The artifact profile of the model. + :vartype artifactProfile: "ArtifactProfile" + :ivar warnings: Service-computed advisory warnings derived from the artifact profile. + :vartype warnings: list["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] + """ + + blobUri: Required[str] + """URI of the model artifact in blob storage. Required.""" + weightType: Union[str, "FoundryModelWeightType"] + """The weight type of the model. Known values are: \"FullWeight\", \"LoRA\", and \"DraftModel\".""" + baseModel: str + """Base model asset ID.""" + source: "ModelSourceData" + """The source of the model.""" + loraConfig: "LoraConfig" + """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.""" + artifactProfile: "ArtifactProfile" + """The artifact profile of the model.""" + warnings: list["FoundryModelWarning"] + """Service-computed advisory warnings derived from the artifact profile.""" + id: str + """Asset ID, a unique identifier for the asset.""" + name: Required[str] + """The name of the resource. Required.""" + version: Required[str] + """The version of the resource. Required.""" + description: str + """The asset description text.""" + tags: dict[str, str] + """Tag dictionary. Tags can be added, removed, and updated.""" + + +class MonthlyRecurrenceSchedule(TypedDict, total=False): + """Monthly recurrence schedule. + + :ivar type: Monthly recurrence type. Required. Monthly recurrence pattern. + :vartype type: Literal[RecurrenceType.MONTHLY] + :ivar daysOfMonth: Days of the month for the recurrence schedule. Required. + :vartype daysOfMonth: list[int] + """ + + type: Required[Literal[RecurrenceType.MONTHLY]] + """Monthly recurrence type. Required. Monthly recurrence pattern.""" + daysOfMonth: Required[list[int]] + """Days of the month for the recurrence schedule. Required.""" + + +class NamespaceToolParam(TypedDict, total=False): + """Namespace. + + :ivar type: The type of the tool. Always ``namespace``. Required. NAMESPACE. + :vartype type: Literal[ToolType.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[Union["FunctionToolParam", "CustomToolParam"]] + """ + + type: Required[Literal[ToolType.NAMESPACE]] + """The type of the tool. Always ``namespace``. Required. NAMESPACE.""" + name: Required[str] + """The namespace name used in tool calls (for example, ``crm``). Required.""" + description: Required[str] + """A description of the namespace shown to the model. Required.""" + tools: Required[list[Union["FunctionToolParam", "CustomToolParam"]]] + """The function/custom tools available inside this namespace. Required.""" + + +class OmitPropertiesRealtimeResponse1(TypedDict, total=False): + """The template for omitting properties. + + :ivar id: The unique ID of the response, will look like ``resp_1234``. + :vartype id: str + :ivar object: The object type, must be ``realtime.response``. Default value is + "realtime.response". + :vartype object: Literal["realtime.response"] + :ivar status: The final status of the response (``completed``, ``cancelled``, ``failed``, or + ``incomplete``, ``in_progress``). Is one of the following types: Literal["completed"], + Literal["cancelled"], Literal["failed"], Literal["incomplete"], Literal["in_progress"] + :vartype status: Literal["completed", "cancelled", "failed", "incomplete", "in_progress"] + :ivar status_details: Additional details about the status. + :vartype status_details: "RealtimeResponseStatusDetails" + :ivar metadata: + :vartype metadata: "Metadata" + :ivar usage: Usage statistics for the Response, this will correspond to billing. A Realtime API + session will maintain a conversation context and append new Items to the Conversation, thus + output from previous turns (text and audio tokens) will become the input for later turns. + :vartype usage: "RealtimeResponseUsage" + :ivar conversation_id: Which conversation the response is added to, determined by the + ``conversation`` field in the ``response.create`` event. If ``auto``, the response will be + added to the default conversation and the value of ``conversation_id`` will be an id like + ``conv_1234``. If ``none``, the response will not be added to any conversation and the value of + ``conversation_id`` will be ``null``. If responses are being triggered automatically by VAD the + response will be added to the default conversation. + :vartype conversation_id: str + :ivar output_modalities: The set of modalities the model used to respond, currently the only + possible values are ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text + transcript. Setting the output to mode ``text`` will disable audio output from the model. + :vartype output_modalities: list[Literal["text", "audio"]] + :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, + inclusive of tool calls, that was used in this response. Is either a int type or a + Literal["inf"] type. + :vartype max_output_tokens: Union[int, Literal["inf"]] + """ + + id: str + """The unique ID of the response, will look like ``resp_1234``.""" + object: Literal["realtime.response"] + """The object type, must be ``realtime.response``. Default value is \"realtime.response\".""" + status: Literal["completed", "cancelled", "failed", "incomplete", "in_progress"] + """The final status of the response (``completed``, ``cancelled``, ``failed``, or ``incomplete``, + ``in_progress``). Is one of the following types: Literal[\"completed\"], + Literal[\"cancelled\"], Literal[\"failed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" + status_details: "RealtimeResponseStatusDetails" + """Additional details about the status.""" + metadata: Optional["Metadata"] + usage: "RealtimeResponseUsage" + """Usage statistics for the Response, this will correspond to billing. A Realtime API session will + maintain a conversation context and append new Items to the Conversation, thus output from + previous turns (text and audio tokens) will become the input for later turns.""" + conversation_id: str + """Which conversation the response is added to, determined by the ``conversation`` field in the + ``response.create`` event. If ``auto``, the response will be added to the default conversation + and the value of ``conversation_id`` will be an id like ``conv_1234``. If ``none``, the + response will not be added to any conversation and the value of ``conversation_id`` will be + ``null``. If responses are being triggered automatically by VAD the response will be added to + the default conversation.""" + output_modalities: list[Literal["text", "audio"]] + """The set of modalities the model used to respond, currently the only possible values are + ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text transcript. Setting the + output to mode ``text`` will disable audio output from the model.""" + max_output_tokens: Union[int, Literal["inf"]] + """Maximum number of output tokens for a single assistant response, inclusive of tool calls, that + was used in this response. Is either a int type or a Literal[\"inf\"] type.""" + + +class OneTimeTrigger(TypedDict, total=False): + """One-time trigger. + + :ivar type: Required. One-time trigger. + :vartype type: Literal[TriggerType.ONE_TIME] + :ivar triggerAt: Date and time for the one-time trigger in ISO 8601 format. Required. + :vartype triggerAt: str + :ivar timeZone: Time zone for the one-time trigger. Defaults to ``UTC``. + :vartype timeZone: str + """ + + type: Required[Literal[TriggerType.ONE_TIME]] + """Required. One-time trigger.""" + triggerAt: Required[str] + """Date and time for the one-time trigger in ISO 8601 format. Required.""" + timeZone: str + """Time zone for the one-time trigger. Defaults to ``UTC``.""" + + +class OpenApiAnonymousAuthDetails(TypedDict, total=False): + """Security details for OpenApi anonymous authentication. + + :ivar type: The object type, which is always 'anonymous'. Required. ANONYMOUS. + :vartype type: Literal[OpenApiAuthType.ANONYMOUS] + """ + + type: Required[Literal[OpenApiAuthType.ANONYMOUS]] + """The object type, which is always 'anonymous'. Required. ANONYMOUS.""" + + +class OpenApiFunctionDefinition(TypedDict, total=False): + """The input definition information for an openapi function. + + :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: "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["OpenApiFunctionDefinitionFunction"] + """ + + name: Required[str] + """The name of the function to be called. Required.""" + description: str + """A description of what the function does, used by the model to choose when and how to call the + function.""" + spec: Required[dict[str, Any]] + """The openapi function shape, described as a JSON Schema object. Required.""" + auth: Required["OpenApiAuthDetails"] + """Open API authentication details. Required.""" + default_params: list[str] + """List of OpenAPI spec parameters that will use user-provided defaults.""" + functions: list["OpenApiFunctionDefinitionFunction"] + """List of function definitions used by OpenApi tool.""" + + +class OpenApiFunctionDefinitionFunction(TypedDict, total=False): + """OpenApiFunctionDefinitionFunction. + + :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] + """ + + name: Required[str] + """The name of the function to be called. Required.""" + description: str + """A description of what the function does, used by the model to choose when and how to call the + function.""" + parameters: Required[dict[str, Any]] + """The parameters the functions accepts, described as a JSON Schema object. Required.""" + + +class OpenApiManagedAuthDetails(TypedDict, total=False): + """Security details for OpenApi managed_identity authentication. + + :ivar type: The object type, which is always 'managed_identity'. Required. MANAGED_IDENTITY. + :vartype type: Literal[OpenApiAuthType.MANAGED_IDENTITY] + :ivar security_scheme: Connection auth security details. Required. + :vartype security_scheme: "OpenApiManagedSecurityScheme" + """ + + type: Required[Literal[OpenApiAuthType.MANAGED_IDENTITY]] + """The object type, which is always 'managed_identity'. Required. MANAGED_IDENTITY.""" + security_scheme: Required["OpenApiManagedSecurityScheme"] + """Connection auth security details. Required.""" + + +class OpenApiManagedSecurityScheme(TypedDict, total=False): + """Security scheme for OpenApi managed_identity authentication. + + :ivar audience: Authentication scope for managed_identity auth type. Required. + :vartype audience: str + """ + + audience: Required[str] + """Authentication scope for managed_identity auth type. Required.""" + + +class OpenApiProjectConnectionAuthDetails(TypedDict, total=False): + """Security details for OpenApi project connection authentication. + + :ivar type: The object type, which is always 'project_connection'. Required. + PROJECT_CONNECTION. + :vartype type: Literal[OpenApiAuthType.PROJECT_CONNECTION] + :ivar security_scheme: Project connection auth security details. Required. + :vartype security_scheme: "OpenApiProjectConnectionSecurityScheme" + """ + + type: Required[Literal[OpenApiAuthType.PROJECT_CONNECTION]] + """The object type, which is always 'project_connection'. Required. PROJECT_CONNECTION.""" + security_scheme: Required["OpenApiProjectConnectionSecurityScheme"] + """Project connection auth security details. Required.""" + + +class OpenApiProjectConnectionSecurityScheme(TypedDict, total=False): + """Security scheme for OpenApi managed_identity authentication. + + :ivar project_connection_id: Project connection id for Project Connection auth type. Required. + :vartype project_connection_id: str + """ + + project_connection_id: Required[str] + """Project connection id for Project Connection auth type. Required.""" + + +class OpenApiTool(TypedDict, total=False): + """The input definition information for an OpenAPI tool as used to configure an agent. + + :ivar type: The object type, which is always 'openapi'. Required. OPENAPI. + :vartype type: Literal[ToolType.OPENAPI] + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, "ToolConfig"] + :ivar openapi: The openapi function definition. Required. + :vartype openapi: "OpenApiFunctionDefinition" + """ + + type: Required[Literal[ToolType.OPENAPI]] + """The object type, which is always 'openapi'. Required. OPENAPI.""" + tool_configs: dict[str, "ToolConfig"] + """Deprecated. This property is deprecated and will be removed in a future version.""" + openapi: Required["OpenApiFunctionDefinition"] + """The openapi function definition. Required.""" + + +class OpenApiToolboxTool(TypedDict, total=False): + """An OpenAPI 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, "ToolConfig"] + :ivar type: Required. OPENAPI. + :vartype type: Literal[ToolboxToolType.OPENAPI] + :ivar openapi: The openapi function definition. Required. + :vartype openapi: "OpenApiFunctionDefinition" + """ + + name: str + """Optional user-defined name for this tool or configuration.""" + description: str + """Optional user-defined description for this tool or configuration.""" + tool_configs: dict[str, "ToolConfig"] + """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.""" + type: Required[Literal[ToolboxToolType.OPENAPI]] + """Required. OPENAPI.""" + openapi: Required["OpenApiFunctionDefinition"] + """The openapi function definition. Required.""" + + +class OptimizedAgentIdentifier(TypedDict, total=False): + """Identifies the registered Foundry agent to optimize (request-only). Skills, tools, and + system_prompt are specified in options.optimization_config. + + :ivar agent_name: Registered Foundry agent name (required). Required. + :vartype agent_name: str + :ivar agent_version: Pinned agent version. Defaults to latest if omitted. + :vartype agent_version: str + """ + + agent_name: Required[str] + """Registered Foundry agent name (required). Required.""" + agent_version: str + """Pinned agent version. Defaults to latest if omitted.""" + + +class OtlpTelemetryEndpoint(TypedDict, total=False): + """An OTLP (OpenTelemetry Protocol) telemetry export endpoint. + + :ivar data: Data types to export to this endpoint. Use an empty array to export no data. + Required. + :vartype data: list[Union[str, "TelemetryDataKind"]] + :ivar auth: Optional authentication configuration. + :vartype auth: "TelemetryEndpointAuth" + :ivar kind: The endpoint kind, always 'OTLP' for OpenTelemetry Protocol endpoints. Required. + OpenTelemetry Protocol (OTLP) endpoint. + :vartype kind: Literal[TelemetryEndpointKind.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: Union[str, "TelemetryTransportProtocol"] + """ + + data: Required[list[Union[str, "TelemetryDataKind"]]] + """Data types to export to this endpoint. Use an empty array to export no data. Required.""" + auth: "TelemetryEndpointAuth" + """Optional authentication configuration.""" + kind: Required[Literal[TelemetryEndpointKind.OTLP]] + """The endpoint kind, always 'OTLP' for OpenTelemetry Protocol endpoints. Required. OpenTelemetry + Protocol (OTLP) endpoint.""" + endpoint: Required[str] + """The OTLP collector endpoint URL. Required.""" + protocol: Required[Union[str, "TelemetryTransportProtocol"]] + """The transport protocol for the OTLP endpoint. Required. Known values are: \"Http\" and + \"Grpc\".""" + + +class PendingUploadRequest(TypedDict, total=False): + """Represents a request for a pending upload. + + :ivar pendingUploadId: If PendingUploadId is not provided, a random GUID will be used. + :vartype pendingUploadId: str + :ivar connectionName: Azure Storage Account connection name to use for generating temporary SAS + token. + :vartype connectionName: str + :ivar pendingUploadType: The type of pending upload. Required. Deprecated: the service never + read this value and silently ignored it. Use TemporaryBlobReference instead. + :vartype pendingUploadType: Literal[PendingUploadType.BLOB_REFERENCE] + """ + + pendingUploadId: str + """If PendingUploadId is not provided, a random GUID will be used.""" + connectionName: str + """Azure Storage Account connection name to use for generating temporary SAS token.""" + pendingUploadType: Required[Literal[PendingUploadType.BLOB_REFERENCE]] + """The type of pending upload. Required. Deprecated: the service never read this value and + silently ignored it. Use TemporaryBlobReference instead.""" + + +class PickPropertiesVoiceAudioConfig(TypedDict, total=False): + """The template for picking properties. + + :ivar output: Output (agent speech) audio configuration. + :vartype output: "VoiceAudioOutputConfig" + """ + + output: "VoiceAudioOutputConfig" + """Output (agent speech) audio configuration.""" + + +class ProgrammaticToolCallingParam(TypedDict, total=False): + """ProgrammaticToolCallingParam. + + :ivar type: The type of the tool. Always ``programmatic_tool_calling``. Required. + PROGRAMMATIC_TOOL_CALLING. + :vartype type: Literal[ToolType.PROGRAMMATIC_TOOL_CALLING] + """ + + type: Required[Literal[ToolType.PROGRAMMATIC_TOOL_CALLING]] + """The type of the tool. Always ``programmatic_tool_calling``. Required. + PROGRAMMATIC_TOOL_CALLING.""" + + +class PromotionInfo(TypedDict, total=False): + """Promotion metadata recorded when a candidate is deployed to a Foundry agent. + + :ivar promoted_at: Timestamp when promotion occurred, represented in Unix time. Required. + :vartype promoted_at: int + :ivar agent_name: Name of the Foundry agent this candidate was promoted to. Required. + :vartype agent_name: str + :ivar agent_version: Version of the Foundry agent this candidate was promoted to. Required. + :vartype agent_version: str + """ + + promoted_at: Required[int] + """Timestamp when promotion occurred, represented in Unix time. Required.""" + agent_name: Required[str] + """Name of the Foundry agent this candidate was promoted to. Required.""" + agent_version: Required[str] + """Version of the Foundry agent this candidate was promoted to. Required.""" + + +class PromptAgentDefinition(TypedDict, total=False): + """The prompt agent definition. + + :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. + :vartype rai_config: "RaiConfig" + :ivar kind: Required. PROMPT. + :vartype kind: Literal[AgentKind.PROMPT] + :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 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: "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["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: Union[str, "ToolChoiceParam"] + :ivar text: Configuration options for a text response from the model. Can be plain text or + structured JSON data. + :vartype text: "PromptAgentDefinitionTextOptions" + :ivar structured_inputs: Set of structured inputs that can participate in prompt template + substitution or tool argument bindings. + :vartype structured_inputs: dict[str, "StructuredInputDefinition"] + """ + + rai_config: "RaiConfig" + """Configuration for Responsible AI (RAI) content filtering and safety features.""" + kind: Required[Literal[AgentKind.PROMPT]] + """Required. PROMPT.""" + model: Required[str] + """The model deployment to use for this agent. Required.""" + instructions: Optional[str] + """A system (or developer) message inserted into the model's context.""" + temperature: Optional[float] + """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] + """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["Reasoning"] + tools: list["Tool"] + """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: Union[str, "ToolChoiceParam"] + """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: "PromptAgentDefinitionTextOptions" + """Configuration options for a text response from the model. Can be plain text or structured JSON + data.""" + structured_inputs: dict[str, "StructuredInputDefinition"] + """Set of structured inputs that can participate in prompt template substitution or tool argument + bindings.""" + + +class PromptAgentDefinitionTextOptions(TypedDict, total=False): + """Configuration options for a text response from the model. Can be plain text or structured JSON + data. + + :ivar format: + :vartype format: "TextResponseFormat" + """ + + format: "TextResponseFormat" + + +class PromptBasedEvaluatorDefinition(TypedDict, total=False): + """Prompt-based evaluator. + + :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, "EvaluatorMetric"] + :ivar type: Required. Prompt-based definition. + :vartype type: Literal[EvaluatorDefinitionType.PROMPT] + :ivar prompt_text: The prompt text used for evaluation. Required. + :vartype prompt_text: str + """ + + init_parameters: dict[str, Any] + """The JSON schema (Draft 2020-12) for the evaluator's input parameters. This includes parameters + like type, properties, required.""" + data_schema: dict[str, Any] + """The JSON schema (Draft 2020-12) for the evaluator's input data. This includes parameters like + type, properties, required.""" + metrics: dict[str, "EvaluatorMetric"] + """List of output metrics produced by this evaluator.""" + type: Required[Literal[EvaluatorDefinitionType.PROMPT]] + """Required. Prompt-based definition.""" + prompt_text: Required[str] + """The prompt text used for evaluation. Required.""" + + +class PromptDataGenerationJobSource(TypedDict, total=False): + """Prompt source for data 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: Literal[DataGenerationJobSourceType.PROMPT] + :ivar prompt: Inline prompt text (e.g., agent description, policy text, supplementary context). + Required. + :vartype prompt: str + """ + + description: str + """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: Required[Literal[DataGenerationJobSourceType.PROMPT]] + """The source type for this source, which is Prompt. Required. Prompt source — inline text + provided by the user.""" + prompt: Required[str] + """Inline prompt text (e.g., agent description, policy text, supplementary context). Required.""" + + +class PromptEvaluatorGenerationJobSource(TypedDict, total=False): + """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: Literal[EvaluatorGenerationJobSourceType.PROMPT] + :ivar prompt: Inline prompt text (e.g., agent description, policy text, supplementary context). + Required. + :vartype prompt: str + """ + + description: str + """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: Required[Literal[EvaluatorGenerationJobSourceType.PROMPT]] + """The source type for this source, which is Prompt. Required. Prompt source — inline text + provided by the user.""" + prompt: Required[str] + """Inline prompt text (e.g., agent description, policy text, supplementary context). Required.""" + + +class ProtocolConfiguration(TypedDict, total=False): + """Per-protocol configuration for the agent endpoint. + + :ivar activity: Configuration for the activity protocol. + :vartype activity: "ActivityProtocolConfiguration" + :ivar responses: Configuration for the responses protocol. + :vartype responses: "ResponsesProtocolConfiguration" + :ivar a2a: Configuration for the A2A protocol. + :vartype a2a: "A2AProtocolConfiguration" + :ivar mcp: Configuration for the MCP protocol. + :vartype mcp: "McpProtocolConfiguration" + :ivar invocations: Configuration for the invocations protocol. + :vartype invocations: "InvocationsProtocolConfiguration" + :ivar invocations_ws: Configuration for the WebSocket-based invocations protocol. + :vartype invocations_ws: "InvocationsWsProtocolConfiguration" + """ + + activity: "ActivityProtocolConfiguration" + """Configuration for the activity protocol.""" + responses: "ResponsesProtocolConfiguration" + """Configuration for the responses protocol.""" + a2a: "A2AProtocolConfiguration" + """Configuration for the A2A protocol.""" + mcp: "McpProtocolConfiguration" + """Configuration for the MCP protocol.""" + invocations: "InvocationsProtocolConfiguration" + """Configuration for the invocations protocol.""" + invocations_ws: "InvocationsWsProtocolConfiguration" + """Configuration for the WebSocket-based invocations protocol.""" + + +class ProtocolVersionRecord(TypedDict, total=False): + """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". + :vartype protocol: Union[str, "AgentEndpointProtocol"] + :ivar version: The version string for the protocol, e.g. 'v0.1.1'. Required. + :vartype version: str + """ + + protocol: Required[Union[str, "AgentEndpointProtocol"]] + """The protocol type. Required. Known values are: \"activity\", \"responses\", \"a2a\", \"mcp\", + \"invocations\", \"voice\", and \"invocations_ws\".""" + version: Required[str] + """The version string for the protocol, e.g. 'v0.1.1'. Required.""" + + +class RaiConfig(TypedDict, total=False): + """Configuration for Responsible AI (RAI) content filtering and safety features. + + :ivar rai_policy_name: The name of the RAI policy to apply. Required. + :vartype rai_policy_name: str + """ + + rai_policy_name: Required[str] + """The name of the RAI policy to apply. Required.""" + + +class RankingOptions(TypedDict, total=False): + """RankingOptions. + + :ivar ranker: The ranker to use for the file search. Known values are: "auto" and + "default-2024-11-15". + :vartype ranker: Union[str, "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: "HybridSearchOptions" + """ + + ranker: Union[str, "RankerVersionType"] + """The ranker to use for the file search. Known values are: \"auto\" and \"default-2024-11-15\".""" + score_threshold: float + """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: "HybridSearchOptions" + """Weights that control how reciprocal rank fusion balances semantic embedding matches versus + sparse keyword matches when hybrid search is enabled.""" + + +class RealtimeAudioFormatsAudioPcm(TypedDict, total=False): + """RealtimeAudioFormatsAudioPcm. + + :ivar type: Required. AUDIO_PCM. + :vartype type: Literal[RealtimeAudioFormatsType.AUDIO_PCM] + :ivar rate: Default value is 24000. + :vartype rate: Literal[24000] + """ + + type: Required[Literal[RealtimeAudioFormatsType.AUDIO_PCM]] + """Required. AUDIO_PCM.""" + rate: Literal[24000] + """Default value is 24000.""" + + +class RealtimeAudioFormatsAudioPcma(TypedDict, total=False): + """RealtimeAudioFormatsAudioPcma. + + :ivar type: Required. AUDIO_PCMA. + :vartype type: Literal[RealtimeAudioFormatsType.AUDIO_PCMA] + """ + + type: Required[Literal[RealtimeAudioFormatsType.AUDIO_PCMA]] + """Required. AUDIO_PCMA.""" + + +class RealtimeAudioFormatsAudioPcmu(TypedDict, total=False): + """RealtimeAudioFormatsAudioPcmu. + + :ivar type: Required. AUDIO_PCMU. + :vartype type: Literal[RealtimeAudioFormatsType.AUDIO_PCMU] + """ + + type: Required[Literal[RealtimeAudioFormatsType.AUDIO_PCMU]] + """Required. AUDIO_PCMU.""" + + +class RealtimeConversationItemFunctionCall(TypedDict, total=False): + """Realtime function call item. + + :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: Literal["realtime.item"] + :ivar type: The type of the item. Always ``function_call``. Required. FUNCTION_CALL. + :vartype type: Literal[RealtimeConversationItemType.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: Literal["completed", "incomplete", "in_progress"] + :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 + """ + + id: str + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Literal["realtime.item"] + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + type: Required[Literal[RealtimeConversationItemType.FUNCTION_CALL]] + """The type of the item. Always ``function_call``. Required. FUNCTION_CALL.""" + status: Literal["completed", "incomplete", "in_progress"] + """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 + """The ID of the function call.""" + name: Required[str] + """The name of the function being called. Required.""" + arguments: Required[str] + """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.""" + + +class RealtimeConversationItemFunctionCallOutput(TypedDict, total=False): # pylint: disable=name-too-long + """Realtime function call output item. + + :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: Literal["realtime.item"] + :ivar type: The type of the item. Always ``function_call_output``. Required. + FUNCTION_CALL_OUTPUT. + :vartype type: Literal[RealtimeConversationItemType.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: Literal["completed", "incomplete", "in_progress"] + :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 + """ + + id: str + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Literal["realtime.item"] + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + type: Required[Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT]] + """The type of the item. Always ``function_call_output``. Required. FUNCTION_CALL_OUTPUT.""" + status: Literal["completed", "incomplete", "in_progress"] + """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: Required[str] + """The ID of the function call this output is for. Required.""" + output: Required[str] + """The output of the function call, this is free text and can contain any information or simply be + empty. Required.""" + + +class RealtimeConversationItemMessageAssistant(TypedDict, total=False): + """Realtime assistant message item. + + :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: Literal["realtime.item"] + :ivar type: The type of the item. Always ``message``. Required. Default value is "message". + :vartype type: Literal["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: Literal["completed", "incomplete", "in_progress"] + :ivar role: The role of the message sender. Always ``assistant``. Required. ASSISTANT. + :vartype role: Literal[RealtimeConversationItemMessageType.ASSISTANT] + :ivar content: The content of the message. Required. + :vartype content: list["RealtimeConversationItemMessageAssistantContent"] + """ + + id: str + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Literal["realtime.item"] + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + type: Required[Literal["message"]] + """The type of the item. Always ``message``. Required. Default value is \"message\".""" + status: Literal["completed", "incomplete", "in_progress"] + """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: Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] + """The role of the message sender. Always ``assistant``. Required. ASSISTANT.""" + content: Required[list["RealtimeConversationItemMessageAssistantContent"]] + """The content of the message. Required.""" + + +class RealtimeConversationItemMessageAssistantContent(TypedDict, total=False): # pylint: disable=name-too-long + """RealtimeConversationItemMessageAssistantContent. + + :ivar type: Is either a Literal["output_text"] type or a Literal["output_audio"] type. + :vartype type: Literal["output_text", "output_audio"] + :ivar text: + :vartype text: str + :ivar audio: + :vartype audio: str + :ivar transcript: + :vartype transcript: str + """ + + type: Literal["output_text", "output_audio"] + """Is either a Literal[\"output_text\"] type or a Literal[\"output_audio\"] type.""" + text: str + audio: str + transcript: str + + +class RealtimeConversationItemMessageSystem(TypedDict, total=False): + """Realtime system message item. + + :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: Literal["realtime.item"] + :ivar type: The type of the item. Always ``message``. Required. Default value is "message". + :vartype type: Literal["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: Literal["completed", "incomplete", "in_progress"] + :ivar role: The role of the message sender. Always ``system``. Required. SYSTEM. + :vartype role: Literal[RealtimeConversationItemMessageType.SYSTEM] + :ivar content: The content of the message. Required. + :vartype content: list["RealtimeConversationItemMessageSystemContent"] + """ + + id: str + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Literal["realtime.item"] + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + type: Required[Literal["message"]] + """The type of the item. Always ``message``. Required. Default value is \"message\".""" + status: Literal["completed", "incomplete", "in_progress"] + """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: Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] + """The role of the message sender. Always ``system``. Required. SYSTEM.""" + content: Required[list["RealtimeConversationItemMessageSystemContent"]] + """The content of the message. Required.""" + + +class RealtimeConversationItemMessageSystemContent(TypedDict, total=False): # pylint: disable=name-too-long + """RealtimeConversationItemMessageSystemContent. + + :ivar type: Default value is "input_text". + :vartype type: Literal["input_text"] + :ivar text: + :vartype text: str + """ + + type: Literal["input_text"] + """Default value is \"input_text\".""" + text: str + + +class RealtimeConversationItemMessageUser(TypedDict, total=False): + """Realtime user message item. + + :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: Literal["realtime.item"] + :ivar type: The type of the item. Always ``message``. Required. Default value is "message". + :vartype type: Literal["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: Literal["completed", "incomplete", "in_progress"] + :ivar role: The role of the message sender. Always ``user``. Required. USER. + :vartype role: Literal[RealtimeConversationItemMessageType.USER] + :ivar content: The content of the message. Required. + :vartype content: list["RealtimeConversationItemMessageUserContent"] + """ + + id: str + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Literal["realtime.item"] + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + type: Required[Literal["message"]] + """The type of the item. Always ``message``. Required. Default value is \"message\".""" + status: Literal["completed", "incomplete", "in_progress"] + """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: Required[Literal[RealtimeConversationItemMessageType.USER]] + """The role of the message sender. Always ``user``. Required. USER.""" + content: Required[list["RealtimeConversationItemMessageUserContent"]] + """The content of the message. Required.""" + + +class RealtimeConversationItemMessageUserContent(TypedDict, total=False): # pylint: disable=name-too-long + """RealtimeConversationItemMessageUserContent. + + :ivar type: Is one of the following types: Literal["input_text"], Literal["input_audio"], + Literal["input_image"] + :vartype type: Literal["input_text", "input_audio", "input_image"] + :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: Literal["auto", "low", "high"] + :ivar transcript: + :vartype transcript: str + """ + + type: Literal["input_text", "input_audio", "input_image"] + """Is one of the following types: Literal[\"input_text\"], Literal[\"input_audio\"], + Literal[\"input_image\"]""" + text: str + audio: str + image_url: str + detail: Literal["auto", "low", "high"] + """Is one of the following types: Literal[\"auto\"], Literal[\"low\"], Literal[\"high\"]""" + transcript: str + + +class RealtimeFunctionTool(TypedDict, total=False): + """Function tool. + + :ivar type: The type of the tool, i.e. ``function``. Default value is "function". + :vartype type: Literal["function"] + :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: "RealtimeFunctionToolParameters" + """ + + type: Literal["function"] + """The type of the tool, i.e. ``function``. Default value is \"function\".""" + name: str + """The name of the function.""" + description: str + """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: "RealtimeFunctionToolParameters" + """Parameters of the function in JSON Schema.""" + + +class RealtimeFunctionToolParameters(TypedDict, total=False): + """RealtimeFunctionToolParameters.""" + + +class RealtimeMCPApprovalRequest(TypedDict, total=False): + """Realtime MCP approval request. + + :ivar type: The type of the item. Always ``mcp_approval_request``. Required. + MCP_APPROVAL_REQUEST. + :vartype type: Literal[RealtimeConversationItemType.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 + """ + + type: Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST]] + """The type of the item. Always ``mcp_approval_request``. Required. MCP_APPROVAL_REQUEST.""" + id: Required[str] + """The unique ID of the approval request. Required.""" + server_label: Required[str] + """The label of the MCP server making the request. Required.""" + name: Required[str] + """The name of the tool to run. Required.""" + arguments: Required[str] + """A JSON string of arguments for the tool. Required.""" + + +class RealtimeMCPApprovalResponse(TypedDict, total=False): + """Realtime MCP approval response. + + :ivar type: The type of the item. Always ``mcp_approval_response``. Required. + MCP_APPROVAL_RESPONSE. + :vartype type: Literal[RealtimeConversationItemType.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 + """ + + type: Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE]] + """The type of the item. Always ``mcp_approval_response``. Required. MCP_APPROVAL_RESPONSE.""" + id: Required[str] + """The unique ID of the approval response. Required.""" + approval_request_id: Required[str] + """The ID of the approval request being answered. Required.""" + approve: Required[bool] + """Whether the request was approved. Required.""" + reason: Optional[str] + + +class RealtimeMCPHTTPError(TypedDict, total=False): + """Realtime MCP HTTP error. + + :ivar type: Required. HTTP_ERROR. + :vartype type: Literal[RealtimeMcpErrorType.HTTP_ERROR] + :ivar code: Required. + :vartype code: int + :ivar message: Required. + :vartype message: str + """ + + type: Required[Literal[RealtimeMcpErrorType.HTTP_ERROR]] + """Required. HTTP_ERROR.""" + code: Required[int] + """Required.""" + message: Required[str] + """Required.""" + + +class RealtimeMCPListTools(TypedDict, total=False): + """Realtime MCP list tools. + + :ivar type: The type of the item. Always ``mcp_list_tools``. Required. MCP_LIST_TOOLS. + :vartype type: Literal[RealtimeConversationItemType.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["MCPListToolsTool"] + """ + + type: Required[Literal[RealtimeConversationItemType.MCP_LIST_TOOLS]] + """The type of the item. Always ``mcp_list_tools``. Required. MCP_LIST_TOOLS.""" + id: str + """The unique ID of the list.""" + server_label: Required[str] + """The label of the MCP server. Required.""" + tools: Required[list["MCPListToolsTool"]] + """The tools available on the server. Required.""" + + +class RealtimeMCPProtocolError(TypedDict, total=False): + """Realtime MCP protocol error. + + :ivar type: Required. PROTOCOL_ERROR. + :vartype type: Literal[RealtimeMcpErrorType.PROTOCOL_ERROR] + :ivar code: Required. + :vartype code: int + :ivar message: Required. + :vartype message: str + """ + + type: Required[Literal[RealtimeMcpErrorType.PROTOCOL_ERROR]] + """Required. PROTOCOL_ERROR.""" + code: Required[int] + """Required.""" + message: Required[str] + """Required.""" + + +class RealtimeMCPToolCall(TypedDict, total=False): + """Realtime MCP tool call. + + :ivar type: The type of the item. Always ``mcp_call``. Required. MCP_CALL. + :vartype type: Literal[RealtimeConversationItemType.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: "RealtimeMCPError" + """ + + type: Required[Literal[RealtimeConversationItemType.MCP_CALL]] + """The type of the item. Always ``mcp_call``. Required. MCP_CALL.""" + id: Required[str] + """The unique ID of the tool call. Required.""" + server_label: Required[str] + """The label of the MCP server running the tool. Required.""" + name: Required[str] + """The name of the tool that was run. Required.""" + arguments: Required[str] + """A JSON string of the arguments passed to the tool. Required.""" + approval_request_id: Optional[str] + output: Optional[str] + error: "RealtimeMCPError" + + +class RealtimeMCPToolExecutionError(TypedDict, total=False): + """Realtime MCP tool execution error. + + :ivar type: Required. TOOL_EXECUTION_ERROR. + :vartype type: Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR] + :ivar message: Required. + :vartype message: str + """ + + type: Required[Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR]] + """Required. TOOL_EXECUTION_ERROR.""" + message: Required[str] + """Required.""" + + +class RealtimeReasoning(TypedDict, total=False): + """Realtime reasoning configuration. + + :ivar effort: Known values are: "minimal", "low", "medium", "high", and "xhigh". + :vartype effort: Union[str, "RealtimeReasoningEffort"] + """ + + effort: Union[str, "RealtimeReasoningEffort"] + """Known values are: \"minimal\", \"low\", \"medium\", \"high\", and \"xhigh\".""" + + +class RealtimeResponseStatusDetails(TypedDict, total=False): + """RealtimeResponseStatusDetails. + + :ivar type: Is one of the following types: Literal["completed"], Literal["cancelled"], + Literal["failed"], Literal["incomplete"] + :vartype type: Literal["completed", "cancelled", "failed", "incomplete"] + :ivar reason: Is one of the following types: Literal["turn_detected"], + Literal["client_cancelled"], Literal["max_output_tokens"], Literal["content_filter"] + :vartype reason: Literal["turn_detected", "client_cancelled", "max_output_tokens", + "content_filter"] + :ivar error: + :vartype error: "RealtimeResponseStatusDetailsError" + """ + + type: Literal["completed", "cancelled", "failed", "incomplete"] + """Is one of the following types: Literal[\"completed\"], Literal[\"cancelled\"], + Literal[\"failed\"], Literal[\"incomplete\"]""" + reason: Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"] + """Is one of the following types: Literal[\"turn_detected\"], Literal[\"client_cancelled\"], + Literal[\"max_output_tokens\"], Literal[\"content_filter\"]""" + error: "RealtimeResponseStatusDetailsError" + + +class RealtimeResponseStatusDetailsError(TypedDict, total=False): + """RealtimeResponseStatusDetailsError. + + :ivar type: + :vartype type: str + :ivar code: + :vartype code: str + """ + + type: str + code: str + + +class RealtimeResponseUsage(TypedDict, total=False): + """RealtimeResponseUsage. + + :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: "RealtimeResponseUsageInputTokenDetails" + :ivar output_token_details: + :vartype output_token_details: "RealtimeResponseUsageOutputTokenDetails" + """ + + total_tokens: int + input_tokens: int + output_tokens: int + input_token_details: "RealtimeResponseUsageInputTokenDetails" + output_token_details: "RealtimeResponseUsageOutputTokenDetails" + + +class RealtimeResponseUsageInputTokenDetails(TypedDict, total=False): + """RealtimeResponseUsageInputTokenDetails. + + :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: "RealtimeResponseUsageInputTokenDetailsCachedTokensDetails" + """ + + cached_tokens: int + text_tokens: int + image_tokens: int + audio_tokens: int + cached_tokens_details: "RealtimeResponseUsageInputTokenDetailsCachedTokensDetails" + + +class RealtimeResponseUsageInputTokenDetailsCachedTokensDetails( + TypedDict, total=False +): # pylint: disable=name-too-long + """RealtimeResponseUsageInputTokenDetailsCachedTokensDetails. + + :ivar text_tokens: + :vartype text_tokens: int + :ivar image_tokens: + :vartype image_tokens: int + :ivar audio_tokens: + :vartype audio_tokens: int + """ + + text_tokens: int + image_tokens: int + audio_tokens: int + + +class RealtimeResponseUsageOutputTokenDetails(TypedDict, total=False): + """RealtimeResponseUsageOutputTokenDetails. + + :ivar text_tokens: + :vartype text_tokens: int + :ivar audio_tokens: + :vartype audio_tokens: int + """ + + text_tokens: int + audio_tokens: int + + +class RealtimeServerEventConversationItemInputAudioTranscriptionFailedError( + TypedDict, total=False +): # pylint: disable=name-too-long + """RealtimeServerEventConversationItemInputAudioTranscriptionFailedError. + + :ivar type: + :vartype type: str + :ivar code: + :vartype code: str + :ivar message: + :vartype message: str + :ivar param: + :vartype param: str + """ + + type: str + code: str + message: str + param: str + + +class RealtimeServerEventError(TypedDict, total=False): + """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 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: Literal["error"] + :ivar error: Details of the error. Required. + :vartype error: "RealtimeServerEventErrorError" + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal["error"]] + """The event type, must be ``error``. Required. Default value is \"error\".""" + error: Required["RealtimeServerEventErrorError"] + """Details of the error. Required.""" + + +class RealtimeServerEventErrorError(TypedDict, total=False): + """RealtimeServerEventErrorError. + + :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 + """ + + type: Required[str] + """Required.""" + code: Optional[str] + message: Required[str] + """Required.""" + param: Optional[str] + event_id: Optional[str] + + +class RealtimeServerEventRateLimitsUpdatedRateLimits(TypedDict, total=False): # pylint: disable=name-too-long + """RealtimeServerEventRateLimitsUpdatedRateLimits. + + :ivar name: Is either a Literal["requests"] type or a Literal["tokens"] type. + :vartype name: Literal["requests", "tokens"] + :ivar limit: + :vartype limit: int + :ivar remaining: + :vartype remaining: int + :ivar reset_seconds: + :vartype reset_seconds: float + """ + + name: Literal["requests", "tokens"] + """Is either a Literal[\"requests\"] type or a Literal[\"tokens\"] type.""" + limit: int + remaining: int + reset_seconds: float + + +class RealtimeServerEventResponseContentPartAdded(TypedDict, total=False): # pylint: disable=name-too-long + """Returned when a new content part is added to an assistant message item 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.content_part.added``. Required. + RESPONSE_CONTENT_PART_ADDED. + :vartype type: Literal[RealtimeServerEventType.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: "RealtimeServerEventResponseContentPartAddedPart" + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED]] + """The event type, must be ``response.content_part.added``. Required. RESPONSE_CONTENT_PART_ADDED.""" + response_id: Required[str] + """The ID of the response. Required.""" + item_id: Required[str] + """The ID of the item to which the content part was added. Required.""" + output_index: Required[int] + """The index of the output item in the response. Required.""" + content_index: Required[int] + """The index of the content part in the item's content array. Required.""" + part: Required["RealtimeServerEventResponseContentPartAddedPart"] + """The content part that was added. Required.""" + + +class RealtimeServerEventResponseContentPartAddedPart(TypedDict, total=False): # pylint: disable=name-too-long + """RealtimeServerEventResponseContentPartAddedPart. + + :ivar type: Is either a Literal["audio"] type or a Literal["text"] type. + :vartype type: Literal["audio", "text"] + :ivar text: + :vartype text: str + :ivar audio: + :vartype audio: str + :ivar transcript: + :vartype transcript: str + """ + + type: Literal["audio", "text"] + """Is either a Literal[\"audio\"] type or a Literal[\"text\"] type.""" + text: str + audio: str + transcript: str + + +class Reasoning(TypedDict, total=False): + """Reasoning. + + :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: Union[str, "ReasoningModeEnum"] + :ivar effort: Known values are: "none", "minimal", "low", "medium", "high", "xhigh", and "max". + :vartype effort: Union[str, "ReasoningEffort"] + :ivar summary: Is one of the following types: Literal["auto"], Literal["concise"], + Literal["detailed"] + :vartype summary: Literal["auto", "concise", "detailed"] + :ivar context: Is one of the following types: Literal["auto"], Literal["current_turn"], + Literal["all_turns"] + :vartype context: Literal["auto", "current_turn", "all_turns"] + :ivar generate_summary: Is one of the following types: Literal["auto"], Literal["concise"], + Literal["detailed"] + :vartype generate_summary: Literal["auto", "concise", "detailed"] + """ + + mode: Union[str, "ReasoningModeEnum"] + """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, "ReasoningEffort"]] + """Known values are: \"none\", \"minimal\", \"low\", \"medium\", \"high\", \"xhigh\", and \"max\".""" + summary: Optional[Literal["auto", "concise", "detailed"]] + """Is one of the following types: Literal[\"auto\"], Literal[\"concise\"], Literal[\"detailed\"]""" + context: Optional[Literal["auto", "current_turn", "all_turns"]] + """Is one of the following types: Literal[\"auto\"], Literal[\"current_turn\"], + Literal[\"all_turns\"]""" + generate_summary: Optional[Literal["auto", "concise", "detailed"]] + """Is one of the following types: Literal[\"auto\"], Literal[\"concise\"], Literal[\"detailed\"]""" + + +class RecurrenceTrigger(TypedDict, total=False): + """Recurrence based trigger. + + :ivar type: Type of the trigger. Required. Recurrence based trigger. + :vartype type: Literal[TriggerType.RECURRENCE] + :ivar startTime: Start time for the recurrence schedule in ISO 8601 format. + :vartype startTime: str + :ivar endTime: End time for the recurrence schedule in ISO 8601 format. + :vartype endTime: str + :ivar timeZone: Time zone for the recurrence schedule. Defaults to ``UTC``. + :vartype timeZone: str + :ivar interval: Interval for the recurrence schedule. Required. + :vartype interval: int + :ivar schedule: Recurrence schedule for the recurrence trigger. Required. + :vartype schedule: "RecurrenceSchedule" + """ + + type: Required[Literal[TriggerType.RECURRENCE]] + """Type of the trigger. Required. Recurrence based trigger.""" + startTime: str + """Start time for the recurrence schedule in ISO 8601 format.""" + endTime: str + """End time for the recurrence schedule in ISO 8601 format.""" + timeZone: str + """Time zone for the recurrence schedule. Defaults to ``UTC``.""" + interval: Required[int] + """Interval for the recurrence schedule. Required.""" + schedule: Required["RecurrenceSchedule"] + """Recurrence schedule for the recurrence trigger. Required.""" + + +class RedTeam(TypedDict, total=False): + """Red team details. + + :ivar id: Identifier of the red team run. Required. + :vartype id: str + :ivar displayName: Name of the red-team run. + :vartype displayName: str + :ivar numTurns: Number of simulation rounds. + :vartype numTurns: int + :ivar attackStrategies: List of attack strategies or nested lists of attack strategies. + :vartype attackStrategies: list[Union[str, "AttackStrategy"]] + :ivar simulationOnly: 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 simulationOnly: bool + :ivar riskCategories: List of risk categories to generate attack objectives for. + :vartype riskCategories: list[Union[str, "RiskCategory"]] + :ivar applicationScenario: Application scenario for the red team operation, to generate + scenario specific attacks. + :vartype applicationScenario: 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: "RedTeamTargetConfig" + """ + + id: Required[str] + """Identifier of the red team run. Required.""" + displayName: str + """Name of the red-team run.""" + numTurns: int + """Number of simulation rounds.""" + attackStrategies: list[Union[str, "AttackStrategy"]] + """List of attack strategies or nested lists of attack strategies.""" + simulationOnly: bool + """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.""" + riskCategories: list[Union[str, "RiskCategory"]] + """List of risk categories to generate attack objectives for.""" + applicationScenario: str + """Application scenario for the red team operation, to generate scenario specific attacks.""" + tags: dict[str, str] + """Red team's tags. Unlike properties, tags are fully mutable.""" + properties: dict[str, str] + """Red team's properties. Unlike tags, properties are add-only. Once added, a property cannot be + removed.""" + status: str + """Status of the red-team. It is set by service and is read-only.""" + target: Required["RedTeamTargetConfig"] + """Target configuration for the red-team run. Required.""" + + +class ReminderPreviewToolboxTool(TypedDict, total=False): + """A reminder 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, "ToolConfig"] + :ivar type: Required. REMINDER_PREVIEW. + :vartype type: Literal[ToolboxToolType.REMINDER_PREVIEW] + """ + + name: str + """Optional user-defined name for this tool or configuration.""" + description: str + """Optional user-defined description for this tool or configuration.""" + tool_configs: dict[str, "ToolConfig"] + """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.""" + type: Required[Literal[ToolboxToolType.REMINDER_PREVIEW]] + """Required. REMINDER_PREVIEW.""" + + +class ResponsesProtocolConfiguration(TypedDict, total=False): + """Configuration specific to the responses protocol.""" + + +class RubricBasedEvaluatorDefinition(TypedDict, total=False): + """Rubric-based evaluator definition — stores dimensions produced by the generate API. Used for + both quality and safety evaluators. + + :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, "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: Literal[EvaluatorDefinitionType.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["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 + """ + + init_parameters: dict[str, Any] + """The JSON schema (Draft 2020-12) for the evaluator's input parameters. This includes parameters + like type, properties, required.""" + data_schema: dict[str, Any] + """The JSON schema (Draft 2020-12) for the evaluator's input data. This includes parameters like + type, properties, required.""" + metrics: dict[str, "EvaluatorMetric"] + """List of output metrics produced by this evaluator.""" + type: Required[Literal[EvaluatorDefinitionType.RUBRIC]] + """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: Required[list["Dimension"]] + """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: float + """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.""" + + +class RubricGenerationInputQualityWarning(TypedDict, total=False): + """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 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: Union[str, "RubricGenerationInputQualityWarningCode"] + :ivar severity: Advisory severity. Initial values: ``warning``. Required. "warning" + :vartype severity: Union[str, "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: Union[str, "RubricGenerationInputQualityWarningSource"] + :ivar source_index: Zero-based index into ``EvaluatorGenerationJob.inputs.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 + """ + + code: Required[Union[str, "RubricGenerationInputQualityWarningCode"]] + """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: Required[Union[str, "RubricGenerationInputQualityWarningSeverity"]] + """Advisory severity. Initial values: ``warning``. Required. \"warning\"""" + message: Required[str] + """Human-readable message suitable for direct SDK/CLI/UI display. Must not include raw prompt, + instruction, dataset, or trace text. Required.""" + source: Required[Union[str, "RubricGenerationInputQualityWarningSource"]] + """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: int + """Zero-based index into ``EvaluatorGenerationJob.inputs.sources`` when the warning applies to a + specific source. Omitted for aggregate warnings and for warnings not tied to one source.""" + + +class Schedule(TypedDict, total=False): + """Schedule model. + + :ivar id: Identifier of the schedule. Required. + :vartype id: str + :ivar displayName: Name of the schedule. + :vartype displayName: str + :ivar description: Description of the schedule. + :vartype description: str + :ivar enabled: Enabled status of the schedule. Required. + :vartype enabled: bool + :ivar provisioningStatus: Provisioning status of the schedule. Known values are: "Creating", + "Updating", "Deleting", "Succeeded", and "Failed". + :vartype provisioningStatus: Union[str, "ScheduleProvisioningStatus"] + :ivar trigger: Trigger for the schedule. Required. + :vartype trigger: "Trigger" + :ivar task: Task for the schedule. Required. + :vartype task: "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 systemData: System metadata for the resource. Required. + :vartype systemData: dict[str, str] + """ + + id: Required[str] + """Identifier of the schedule. Required.""" + displayName: str + """Name of the schedule.""" + description: str + """Description of the schedule.""" + enabled: Required[bool] + """Enabled status of the schedule. Required.""" + provisioningStatus: Union[str, "ScheduleProvisioningStatus"] + """Provisioning status of the schedule. Known values are: \"Creating\", \"Updating\", + \"Deleting\", \"Succeeded\", and \"Failed\".""" + trigger: Required["Trigger"] + """Trigger for the schedule. Required.""" + task: Required["ScheduleTask"] + """Task for the schedule. Required.""" + tags: dict[str, str] + """Schedule's tags. Unlike properties, tags are fully mutable.""" + properties: dict[str, str] + """Schedule's properties. Unlike tags, properties are add-only. Once added, a property cannot be + removed.""" + systemData: Required[dict[str, str]] + """System metadata for the resource. Required.""" + + +class ScheduleRoutineTrigger(TypedDict, total=False): + """A recurring cron-based routine trigger. + + :ivar type: The trigger type. Required. A recurring cron-based trigger. + :vartype type: Literal[RoutineTriggerType.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: Required[Literal[RoutineTriggerType.SCHEDULE]] + """The trigger type. Required. A recurring cron-based trigger.""" + cron_expression: Required[str] + """A 5-field cron expression. The service enforces a minimum interval of five minutes by default. + Required.""" + time_zone: Required[str] + """An IANA or Windows time zone identifier for the schedule. Required.""" + + +class SharepointGroundingToolParameters(TypedDict, total=False): + """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["ToolProjectConnection"] + """ + + project_connections: list["ToolProjectConnection"] + """The project connections attached to this tool. There can be a maximum of 1 connection resource + attached to the tool.""" + + +class SharepointPreviewTool(TypedDict, total=False): + """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: Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW] + :ivar sharepoint_grounding_preview: The sharepoint grounding tool parameters. Required. + :vartype sharepoint_grounding_preview: "SharepointGroundingToolParameters" + """ + + type: Required[Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW]] + """The object type, which is always 'sharepoint_grounding_preview'. Required. + SHAREPOINT_GROUNDING_PREVIEW.""" + sharepoint_grounding_preview: Required["SharepointGroundingToolParameters"] + """The sharepoint grounding tool parameters. Required.""" + + +class SimpleQnADataGenerationJobOptions(TypedDict, total=False): + """The options for a data generation job with SimpleQnA type. + + :ivar max_samples: Maximum number of samples to generate. Required. + :vartype max_samples: int + :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: "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: Literal[DataGenerationJobType.SIMPLE_QNA] + :ivar question_types: The question types to generate. Used only for fine-tuning scenarios. + :vartype question_types: list[Union[str, "SimpleQnAFineTuningQuestionType"]] + """ + + max_samples: Required[int] + """Maximum number of samples to generate. Required.""" + train_split: float + """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.""" + model_options: "DataGenerationModelOptions" + """The LLM model options.""" + type: Required[Literal[DataGenerationJobType.SIMPLE_QNA]] + """The data generation job type, which is SimpleQnA for this model. Required. Simple question and + answers between user and agent.""" + question_types: list[Union[str, "SimpleQnAFineTuningQuestionType"]] + """The question types to generate. Used only for fine-tuning scenarios.""" + + +class SkillInlineContent(TypedDict, total=False): + """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: Required[str] + """A human-readable description of what the skill does and when to use it. Required.""" + instructions: Required[str] + """The skill instructions in markdown format. This is the body content of the SKILL.md file. + Required.""" + license: str + """License name or reference to a bundled license file.""" + compatibility: str + """Environment requirements or compatibility notes for the skill.""" + metadata: dict[str, str] + """Arbitrary key-value metadata for additional properties.""" + allowed_tools: list[str] + """List of pre-approved tools the skill may use. Experimental.""" + + +class SkillReferenceParam(TypedDict, total=False): + """SkillReferenceParam. + + :ivar type: References a skill created with the /v1/skills endpoint. Required. SKILL_REFERENCE. + :vartype type: Literal[ContainerSkillType.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: Required[Literal[ContainerSkillType.SKILL_REFERENCE]] + """References a skill created with the /v1/skills endpoint. Required. SKILL_REFERENCE.""" + skill_id: Required[str] + """The ID of the referenced skill. Required.""" + version: str + """Optional skill version. Use a positive integer or 'latest'. Omit for default.""" + + +class SpecificApplyPatchParam(TypedDict, total=False): + """Specific apply patch tool choice. + + :ivar type: The tool to call. Always ``apply_patch``. Required. APPLY_PATCH. + :vartype type: Literal[ToolChoiceParamType.APPLY_PATCH] + """ + + type: Required[Literal[ToolChoiceParamType.APPLY_PATCH]] + """The tool to call. Always ``apply_patch``. Required. APPLY_PATCH.""" + + +class SpecificFunctionShellParam(TypedDict, total=False): + """Specific shell tool choice. + + :ivar type: The tool to call. Always ``shell``. Required. SHELL. + :vartype type: Literal[ToolChoiceParamType.SHELL] + """ + + type: Required[Literal[ToolChoiceParamType.SHELL]] + """The tool to call. Always ``shell``. Required. SHELL.""" + + +class SpecificProgrammaticToolCallingParam(TypedDict, total=False): + """SpecificProgrammaticToolCallingParam. + + :ivar type: The tool to call. Always ``programmatic_tool_calling``. Required. + PROGRAMMATIC_TOOL_CALLING. + :vartype type: Literal[ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING] + """ + + type: Required[Literal[ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING]] + """The tool to call. Always ``programmatic_tool_calling``. Required. PROGRAMMATIC_TOOL_CALLING.""" + + +class StructuredInputDefinition(TypedDict, total=False): + """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: str + """A human-readable description of the input.""" + default_value: Any + """The default value for the input if no run-time value is provided.""" + schema: dict[str, Any] + """The JSON schema for the structured input (optional).""" + required: bool + """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.""" + + +class StructuredOutputDefinition(TypedDict, total=False): + """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: Required[str] + """The name of the structured output. Required.""" + description: Required[str] + """A description of the output to emit. Used by the model to determine when to emit the output. + Required.""" + schema: Required[dict[str, Any]] + """The JSON schema for the structured output. Required.""" + strict: Required[Optional[bool]] + """Whether to enforce strict validation. Default ``true``. Required.""" + + +class TaskGenerationDataGenerationJobOptions(TypedDict, total=False): + """The options 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 max_samples: Maximum number of samples to generate. Required. + :vartype max_samples: int + :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: "DataGenerationModelOptions" + :ivar type: The data generation job type, which is TaskGeneration for this model. Required. + Task generation for evaluation scenarios. + :vartype type: Literal[DataGenerationJobType.TASK_GENERATION] + """ + + max_samples: Required[int] + """Maximum number of samples to generate. Required.""" + train_split: float + """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.""" + model_options: "DataGenerationModelOptions" + """The LLM model options.""" + type: Required[Literal[DataGenerationJobType.TASK_GENERATION]] + """The data generation job type, which is TaskGeneration for this model. Required. Task generation + for evaluation scenarios.""" + + +class TaxonomyCategory(TypedDict, total=False): + """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 riskCategory: Risk category associated with this taxonomy category. Required. Known + values are: "HateUnfairness", "Violence", "Sexual", "SelfHarm", "ProtectedMaterial", + "CodeVulnerability", "UngroundedAttributes", "ProhibitedActions", "SensitiveDataLeakage", and + "TaskAdherence". + :vartype riskCategory: Union[str, "RiskCategory"] + :ivar subCategories: List of taxonomy sub categories. Required. + :vartype subCategories: list["TaxonomySubCategory"] + :ivar properties: Additional properties for the taxonomy category. + :vartype properties: dict[str, str] + """ + + id: Required[str] + """Unique identifier of the taxonomy category. Required.""" + name: Required[str] + """Name of the taxonomy category. Required.""" + description: str + """Description of the taxonomy category.""" + riskCategory: Required[Union[str, "RiskCategory"]] + """Risk category associated with this taxonomy category. Required. Known values are: + \"HateUnfairness\", \"Violence\", \"Sexual\", \"SelfHarm\", \"ProtectedMaterial\", + \"CodeVulnerability\", \"UngroundedAttributes\", \"ProhibitedActions\", + \"SensitiveDataLeakage\", and \"TaskAdherence\".""" + subCategories: Required[list["TaxonomySubCategory"]] + """List of taxonomy sub categories. Required.""" + properties: dict[str, str] + """Additional properties for the taxonomy category.""" + + +class TaxonomySubCategory(TypedDict, total=False): + """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: Required[str] + """Unique identifier of the taxonomy sub-category. Required.""" + name: Required[str] + """Name of the taxonomy sub-category. Required.""" + description: str + """Description of the taxonomy sub-category.""" + enabled: Required[bool] + """List of taxonomy items under this sub-category. Required.""" + properties: dict[str, str] + """Additional properties for the taxonomy sub-category.""" + + +class TelemetryConfig(TypedDict, total=False): + """Customer-supplied telemetry configuration for exporting container logs, traces, and metrics. + + :ivar endpoints: Customer-supplied telemetry export endpoint configurations. Required. + :vartype endpoints: list["TelemetryEndpoint"] + """ + + endpoints: Required[list["TelemetryEndpoint"]] + """Customer-supplied telemetry export endpoint configurations. Required.""" + + +class TemplateVoiceGreetingConfig(TypedDict, total=False): + """A deterministic greeting rendered with the voice agent's structured inputs and synthesized + without model-authored generation. + + :ivar type: Required. Default value is "template". + :vartype type: Literal["template"] + :ivar text: The Handlebars text template spoken at session start. Required. + :vartype text: str + """ + + type: Required[Literal["template"]] + """Required. Default value is \"template\".""" + text: Required[str] + """The Handlebars text template spoken at session start. Required.""" + + +class TextResponseFormatJsonObject(TypedDict, total=False): + """JSON object. + + :ivar type: The type of response format being defined. Always ``json_object``. Required. + JSON_OBJECT. + :vartype type: Literal[TextResponseFormatConfigurationType.JSON_OBJECT] + """ + + type: Required[Literal[TextResponseFormatConfigurationType.JSON_OBJECT]] + """The type of response format being defined. Always ``json_object``. Required. JSON_OBJECT.""" + + +class TextResponseFormatJsonSchema(TypedDict, total=False): + """JSON schema. + + :ivar type: The type of response format being defined. Always ``json_schema``. Required. + JSON_SCHEMA. + :vartype type: Literal[TextResponseFormatConfigurationType.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: Required[Literal[TextResponseFormatConfigurationType.JSON_SCHEMA]] + """The type of response format being defined. Always ``json_schema``. Required. JSON_SCHEMA.""" + description: str + """A description of what the response format is for, used by the model to determine how to respond + in the format.""" + name: Required[str] + """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: Required[dict[str, Any]] + """Required.""" + strict: Optional[bool] + + +class TextResponseFormatText(TypedDict, total=False): + """Text. + + :ivar type: The type of response format being defined. Always ``text``. Required. TEXT. + :vartype type: Literal[TextResponseFormatConfigurationType.TEXT] + """ + + type: Required[Literal[TextResponseFormatConfigurationType.TEXT]] + """The type of response format being defined. Always ``text``. Required. TEXT.""" + + +class TimerRoutineTrigger(TypedDict, total=False): + """A one-shot timer routine trigger. + + :ivar type: The trigger type. Required. A one-shot timer trigger. + :vartype type: Literal[RoutineTriggerType.TIMER] + :ivar at: The UTC date and time at which the timer fires. + :vartype at: int + """ + + type: Required[Literal[RoutineTriggerType.TIMER]] + """The trigger type. Required. A one-shot timer trigger.""" + at: int + """The UTC date and time at which the timer fires.""" + + +class ToolboxPolicies(TypedDict, total=False): + """Policy configuration for a toolbox, including content safety and other governance settings. + + :ivar rai_config: Responsible AI content filtering configuration. + :vartype rai_config: "RaiConfig" + """ + + rai_config: "RaiConfig" + """Responsible AI content filtering configuration.""" + + +class ToolboxSearchPreviewToolboxTool(TypedDict, total=False): + """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, "ToolConfig"] + :ivar type: The type of the tool. Always ``toolbox_search_preview``. Required. + TOOLBOX_SEARCH_PREVIEW. + :vartype type: Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW] + """ + + name: str + """Optional user-defined name for this tool or configuration.""" + description: str + """Optional user-defined description for this tool or configuration.""" + tool_configs: dict[str, "ToolConfig"] + """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.""" + type: Required[Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW]] + """The type of the tool. Always ``toolbox_search_preview``. Required. TOOLBOX_SEARCH_PREVIEW.""" + + +class ToolboxSkillReference(TypedDict, total=False): + """A reference to an existing skill to include in a toolbox. + + :ivar type: The type of skill source. Required. Default value is "skill_reference". + :vartype type: Literal["skill_reference"] + :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: Required[Literal["skill_reference"]] + """The type of skill source. Required. Default value is \"skill_reference\".""" + name: Required[str] + """The name of the skill. Required.""" + version: str + """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.""" + + +class ToolChoiceAllowed(TypedDict, total=False): + """Allowed tools. + + :ivar type: Allowed tool configuration type. Always ``allowed_tools``. Required. ALLOWED_TOOLS. + :vartype type: Literal[ToolChoiceParamType.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: Literal["auto", "required"] + :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: Required[Literal[ToolChoiceParamType.ALLOWED_TOOLS]] + """Allowed tool configuration type. Always ``allowed_tools``. Required. ALLOWED_TOOLS.""" + mode: Required[Literal["auto", "required"]] + """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: Required[list[dict[str, Any]]] + """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\" } + ]""" + + +class ToolChoiceCodeInterpreter(TypedDict, total=False): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. + + :ivar type: Required. CODE_INTERPRETER. + :vartype type: Literal[ToolChoiceParamType.CODE_INTERPRETER] + """ + + type: Required[Literal[ToolChoiceParamType.CODE_INTERPRETER]] + """Required. CODE_INTERPRETER.""" + + +class ToolChoiceComputer(TypedDict, total=False): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. + + :ivar type: Required. COMPUTER. + :vartype type: Literal[ToolChoiceParamType.COMPUTER] + """ + + type: Required[Literal[ToolChoiceParamType.COMPUTER]] + """Required. COMPUTER.""" + + +class ToolChoiceComputerUse(TypedDict, total=False): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. + + :ivar type: Required. COMPUTER_USE. + :vartype type: Literal[ToolChoiceParamType.COMPUTER_USE] + """ + + type: Required[Literal[ToolChoiceParamType.COMPUTER_USE]] + """Required. COMPUTER_USE.""" + + +class ToolChoiceComputerUsePreview(TypedDict, total=False): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. + + :ivar type: Required. COMPUTER_USE_PREVIEW. + :vartype type: Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW] + """ + + type: Required[Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW]] + """Required. COMPUTER_USE_PREVIEW.""" + + +class ToolChoiceCustom(TypedDict, total=False): + """Custom tool. + + :ivar type: For custom tool calling, the type is always ``custom``. Required. CUSTOM. + :vartype type: Literal[ToolChoiceParamType.CUSTOM] + :ivar name: The name of the custom tool to call. Required. + :vartype name: str + """ + + type: Required[Literal[ToolChoiceParamType.CUSTOM]] + """For custom tool calling, the type is always ``custom``. Required. CUSTOM.""" + name: Required[str] + """The name of the custom tool to call. Required.""" + + +class ToolChoiceFileSearch(TypedDict, total=False): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. + + :ivar type: Required. FILE_SEARCH. + :vartype type: Literal[ToolChoiceParamType.FILE_SEARCH] + """ + + type: Required[Literal[ToolChoiceParamType.FILE_SEARCH]] + """Required. FILE_SEARCH.""" + + +class ToolChoiceFunction(TypedDict, total=False): + """Function tool. + + :ivar type: For function calling, the type is always ``function``. Required. FUNCTION. + :vartype type: Literal[ToolChoiceParamType.FUNCTION] + :ivar name: The name of the function to call. Required. + :vartype name: str + """ + + type: Required[Literal[ToolChoiceParamType.FUNCTION]] + """For function calling, the type is always ``function``. Required. FUNCTION.""" + name: Required[str] + """The name of the function to call. Required.""" + + +class ToolChoiceImageGeneration(TypedDict, total=False): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. + + :ivar type: Required. IMAGE_GENERATION. + :vartype type: Literal[ToolChoiceParamType.IMAGE_GENERATION] + """ + + type: Required[Literal[ToolChoiceParamType.IMAGE_GENERATION]] + """Required. IMAGE_GENERATION.""" + + +class ToolChoiceMCP(TypedDict, total=False): + """MCP tool. + + :ivar type: For MCP tools, the type is always ``mcp``. Required. MCP. + :vartype type: Literal[ToolChoiceParamType.MCP] + :ivar server_label: The label of the MCP server to use. Required. + :vartype server_label: str + :ivar name: + :vartype name: str + """ + + type: Required[Literal[ToolChoiceParamType.MCP]] + """For MCP tools, the type is always ``mcp``. Required. MCP.""" + server_label: Required[str] + """The label of the MCP server to use. Required.""" + name: Optional[str] + + +class ToolChoiceWebSearchPreview(TypedDict, total=False): + """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: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW] + """ + + type: Required[Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW]] + """Required. WEB_SEARCH_PREVIEW.""" + + +class ToolChoiceWebSearchPreview20250311(TypedDict, total=False): + """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: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11] + """ + + type: Required[Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11]] + """Required. WEB_SEARCH_PREVIEW_2025_03_11.""" + + +class ToolConfig(TypedDict, total=False): + """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: bool + """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: str + """Additional text indexed for tool_search. Supplements the native tool description to improve + discoverability. Does not alter ``tools/list`` output.""" + + +class ToolDescription(TypedDict, total=False): + """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: str + """The name of the tool.""" + description: str + """A brief description of the tool's purpose.""" + + +class ToolProjectConnection(TypedDict, total=False): + """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: Required[str] + """A project connection in a ToolProjectConnectionList attached to this tool. Required.""" + + +class ToolSearchToolboxTool(TypedDict, total=False): + """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, "ToolConfig"] + :ivar type: The type of the tool. Always ``toolbox_search``. Required. TOOLBOX_SEARCH. + :vartype type: Literal[ToolboxToolType.TOOLBOX_SEARCH] + """ + + name: str + """Optional user-defined name for this tool or configuration.""" + description: str + """Optional user-defined description for this tool or configuration.""" + tool_configs: dict[str, "ToolConfig"] + """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.""" + type: Required[Literal[ToolboxToolType.TOOLBOX_SEARCH]] + """The type of the tool. Always ``toolbox_search``. Required. TOOLBOX_SEARCH.""" + + +class ToolSearchToolParam(TypedDict, total=False): + """Tool search tool. + + :ivar type: The type of the tool. Always ``tool_search``. Required. TOOL_SEARCH. + :vartype type: Literal[ToolType.TOOL_SEARCH] + :ivar execution: Whether tool search is executed by the server or by the client. Known values + are: "server" and "client". + :vartype execution: Union[str, "ToolSearchExecutionType"] + :ivar description: + :vartype description: str + :ivar parameters: + :vartype parameters: "EmptyModelParam" + """ + + type: Required[Literal[ToolType.TOOL_SEARCH]] + """The type of the tool. Always ``tool_search``. Required. TOOL_SEARCH.""" + execution: Union[str, "ToolSearchExecutionType"] + """Whether tool search is executed by the server or by the client. Known values are: \"server\" + and \"client\".""" + description: Optional[str] + parameters: Optional["EmptyModelParam"] + + +class ToolUseFineTuningDataGenerationJobOptions(TypedDict, total=False): # pylint: disable=name-too-long + """The options for a data generation job with ToolUse type. Used only for fine-tuning scenarios. + + :ivar max_samples: Maximum number of samples to generate. Required. + :vartype max_samples: int + :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: "DataGenerationModelOptions" + :ivar type: The data generation job type, which is ToolUse for this model. Required. Tool + calling conversation between user and agent. + :vartype type: Literal[DataGenerationJobType.TOOL_USE] + """ + + max_samples: Required[int] + """Maximum number of samples to generate. Required.""" + train_split: float + """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.""" + model_options: "DataGenerationModelOptions" + """The LLM model options.""" + type: Required[Literal[DataGenerationJobType.TOOL_USE]] + """The data generation job type, which is ToolUse for this model. Required. Tool calling + conversation between user and agent.""" + + +class TracesDataGenerationJobOptions(TypedDict, total=False): + """The options for a data generation job with Traces type. + + :ivar max_samples: Maximum number of samples to generate. Required. + :vartype max_samples: int + :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: "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: Literal[DataGenerationJobType.TRACES] + """ + + max_samples: Required[int] + """Maximum number of samples to generate. Required.""" + train_split: float + """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.""" + model_options: "DataGenerationModelOptions" + """The LLM model options.""" + type: Required[Literal[DataGenerationJobType.TRACES]] + """The data generation job type, which is Traces for this model. Required. Single turn query and + response from agent traces.""" + + +class TracesDataGenerationJobSource(TypedDict, total=False): + """Traces source for data generation jobs — conversation traces from Application Insights. + + :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: Literal[DataGenerationJobSourceType.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: int + :ivar end_time: End of the time window (Unix timestamp in seconds). Defaults to current time. + :vartype end_time: int + """ + + description: str + """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: Required[Literal[DataGenerationJobSourceType.TRACES]] + """The source type for this source, which is Traces. Required. Traces source — conversation traces + from Application Insights.""" + agent_id: str + """The unique agent ID used to filter traces. Provide either ``agent_id`` or ``agent_name`` — at + least one is required.""" + agent_name: str + """The agent name to fetch traces for. Provide either ``agent_id`` or ``agent_name`` — at least + one is required.""" + agent_version: str + """The agent version. If not specified, traces for ALL versions of the agent are included within + the time window.""" + start_time: Required[int] + """Start of the time window (Unix timestamp in seconds) for fetching traces. Required.""" + end_time: int + """End of the time window (Unix timestamp in seconds). Defaults to current time.""" + + +class TracesEvaluatorGenerationJobSource(TypedDict, total=False): + """Traces source for evaluator generation jobs — conversation traces from Application Insights. + + :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: Literal[EvaluatorGenerationJobSourceType.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: int + :ivar end_time: End of the time window (Unix timestamp in seconds). Defaults to current time. + :vartype end_time: int + """ + + description: str + """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: Required[Literal[EvaluatorGenerationJobSourceType.TRACES]] + """The source type for this source, which is Traces. Required. Traces source — conversation traces + from Application Insights.""" + agent_id: str + """The unique agent ID used to filter traces. Provide either ``agent_id`` or ``agent_name`` — at + least one is required.""" + agent_name: str + """The agent name to fetch traces for. Provide either ``agent_id`` or ``agent_name`` — at least + one is required.""" + agent_version: str + """The agent version. If not specified, traces for ALL versions of the agent are included within + the time window.""" + start_time: Required[int] + """Start of the time window (Unix timestamp in seconds) for fetching traces. Required.""" + end_time: int + """End of the time window (Unix timestamp in seconds). Defaults to current time.""" + + +class TranscriptTextUsageDuration(TypedDict, total=False): + """Duration Usage. + + :ivar type: The type of the usage object. Always ``duration`` for this variant. Required. + DURATION. + :vartype type: Literal[CreateTranscriptionResponseJsonUsageType.DURATION] + :ivar seconds: Duration of the input audio in seconds. Required. + :vartype seconds: str + """ + + type: Required[Literal[CreateTranscriptionResponseJsonUsageType.DURATION]] + """The type of the usage object. Always ``duration`` for this variant. Required. DURATION.""" + seconds: Required[str] + """Duration of the input audio in seconds. Required.""" + + +class TranscriptTextUsageTokens(TypedDict, total=False): + """Token Usage. + + :ivar type: The type of the usage object. Always ``tokens`` for this variant. Required. TOKENS. + :vartype type: Literal[CreateTranscriptionResponseJsonUsageType.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: "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: Required[Literal[CreateTranscriptionResponseJsonUsageType.TOKENS]] + """The type of the usage object. Always ``tokens`` for this variant. Required. TOKENS.""" + input_tokens: Required[int] + """Number of input tokens billed for this request. Required.""" + input_token_details: "TranscriptTextUsageTokensInputTokenDetails" + """Details about the input tokens billed for this request.""" + output_tokens: Required[int] + """Number of output tokens generated. Required.""" + total_tokens: Required[int] + """Total number of tokens used (input + output). Required.""" + + +class TranscriptTextUsageTokensInputTokenDetails(TypedDict, total=False): # pylint: disable=name-too-long + """TranscriptTextUsageTokensInputTokenDetails. + + :ivar text_tokens: + :vartype text_tokens: int + :ivar audio_tokens: + :vartype audio_tokens: int + """ + + text_tokens: int + audio_tokens: int + + +class UpdateModelVersionRequest(TypedDict, total=False): + """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: str + """The asset description text.""" + tags: dict[str, str] + """Tag dictionary. Tags can be added, removed, and updated.""" + + +class UpdateToolboxRequest(TypedDict, total=False): + """UpdateToolboxRequest. + + :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 + """ + + default_version: Required[str] + """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.""" + + +class VersionRefIndicator(TypedDict, total=False): + """Version indicator that references a specific agent version by name. + + :ivar type: Discriminator value for version_ref. Required. Direct reference to a specific agent + version. + :vartype type: Literal[VersionIndicatorType.VERSION_REF] + :ivar agent_version: The agent version identifier returned by the agent version APIs. Required. + :vartype agent_version: str + """ + + type: Required[Literal[VersionIndicatorType.VERSION_REF]] + """Discriminator value for version_ref. Required. Direct reference to a specific agent version.""" + agent_version: Required[str] + """The agent version identifier returned by the agent version APIs. Required.""" + + +class VersionSelector(TypedDict, total=False): + """VersionSelector. + + :ivar version_selection_rules: Required. + :vartype version_selection_rules: list["VersionSelectionRule"] + """ + + version_selection_rules: Required[list["VersionSelectionRule"]] + """Required.""" + + +class VoiceAgentAnimationConfig(TypedDict, total=False): + """Animation settings for a voice-agent session. + + :ivar model_name: The animation model name. + :vartype model_name: str + :ivar outputs: The requested animation output kinds. + :vartype outputs: list[Union[str, "VoiceAgentAnimationOutputType"]] + """ + + model_name: str + """The animation model name.""" + outputs: list[Union[str, "VoiceAgentAnimationOutputType"]] + """The requested animation output kinds.""" + + +class VoiceAgentAvatarIceServer(TypedDict, total=False): + """An ICE server used for avatar WebRTC negotiation. + + :ivar urls: Required. + :vartype urls: list[str] + :ivar username: + :vartype username: str + :ivar credential: + :vartype credential: str + """ + + urls: Required[list[str]] + """Required.""" + username: Optional[str] + credential: Optional[str] + + +class VoiceAgentAvatarScene(TypedDict, total=False): + """Avatar placement and motion settings. + + :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 + """ + + zoom: float + position_x: float + position_y: float + rotation_x: float + rotation_y: float + rotation_z: float + amplitude: float + + +class VoiceAgentAvatarVideoBackground(TypedDict, total=False): + """The avatar video background. + + :ivar image_url: + :vartype image_url: str + :ivar color: + :vartype color: str + """ + + image_url: str + color: str + + +class VoiceAgentAvatarVideoCrop(TypedDict, total=False): + """The rectangular crop applied to avatar video. + + :ivar bottom_right: Required. + :vartype bottom_right: list[int] + :ivar top_left: Required. + :vartype top_left: list[int] + """ + + bottom_right: Required[list[int]] + """Required.""" + top_left: Required[list[int]] + """Required.""" + + +class VoiceAgentAvatarVideoParams(TypedDict, total=False): + """Avatar video encoder and presentation settings. + + :ivar bitrate: + :vartype bitrate: int + :ivar codec: Default value is "h264". + :vartype codec: Literal["h264"] + :ivar crop: + :vartype crop: "VoiceAgentAvatarVideoCrop" + :ivar resolution: + :vartype resolution: "VoiceAgentAvatarVideoResolution" + :ivar background: + :vartype background: "VoiceAgentAvatarVideoBackground" + :ivar gop_size: + :vartype gop_size: int + """ + + bitrate: int + codec: Literal["h264"] + """Default value is \"h264\".""" + crop: "VoiceAgentAvatarVideoCrop" + resolution: "VoiceAgentAvatarVideoResolution" + background: "VoiceAgentAvatarVideoBackground" + gop_size: int + + +class VoiceAgentAvatarVideoResolution(TypedDict, total=False): + """The avatar video resolution. + + :ivar width: Required. + :vartype width: int + :ivar height: Required. + :vartype height: int + """ + + width: Required[int] + """Required.""" + height: Required[int] + """Required.""" + + +class VoiceAgentClientEventConversationItemCreate(TypedDict, total=False): # pylint: disable=name-too-long + """The ``conversation.item.create`` client event. + + :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: Literal[RealtimeClientEventType.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: The conversation item to create. Required. Is either a + "_unions.VoiceAgentRequestConversationItem" type or a RealtimeMCPApprovalResponse type. + :vartype item: "_unions.VoiceAgentCreateConversationItem" + """ + + event_id: str + """Optional client-generated ID used to identify this event.""" + type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE]] + """The event type, must be ``conversation.item.create``. Required. CONVERSATION_ITEM_CREATE.""" + previous_item_id: str + """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: Required["_unions.VoiceAgentCreateConversationItem"] + """The conversation item to create. Required. Is either a + \"_unions.VoiceAgentRequestConversationItem\" type or a RealtimeMCPApprovalResponse type.""" + + +class VoiceAgentClientEventConversationItemDelete(TypedDict, total=False): # pylint: disable=name-too-long + """The ``conversation.item.delete`` client event. + + :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: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE] + :ivar item_id: The ID of the item to delete. Required. + :vartype item_id: str + """ + + event_id: str + """Optional client-generated ID used to identify this event.""" + type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE]] + """The event type, must be ``conversation.item.delete``. Required. CONVERSATION_ITEM_DELETE.""" + item_id: Required[str] + """The ID of the item to delete. Required.""" + + +class VoiceAgentClientEventConversationItemRetrieve(TypedDict, total=False): # pylint: disable=name-too-long + """The ``conversation.item.retrieve`` client event. + + :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: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE] + :ivar item_id: The ID of the item to retrieve. Required. + :vartype item_id: str + """ + + event_id: str + """Optional client-generated ID used to identify this event.""" + type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE]] + """The event type, must be ``conversation.item.retrieve``. Required. CONVERSATION_ITEM_RETRIEVE.""" + item_id: Required[str] + """The ID of the item to retrieve. Required.""" + + +class VoiceAgentClientEventConversationItemTruncate(TypedDict, total=False): # pylint: disable=name-too-long + """The ``conversation.item.truncate`` client event. + + :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: Literal[RealtimeClientEventType.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 + """Optional client-generated ID used to identify this event.""" + type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE]] + """The event type, must be ``conversation.item.truncate``. Required. CONVERSATION_ITEM_TRUNCATE.""" + item_id: Required[str] + """The ID of the assistant message item to truncate. Only assistant message items can be + truncated. Required.""" + content_index: Required[int] + """The index of the content part to truncate. Set this to ``0``. Required.""" + audio_end_ms: Required[int] + """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.""" + + +class VoiceAgentClientEventInputAudioBufferAppend(TypedDict, total=False): # pylint: disable=name-too-long + """The ``input_audio_buffer.append`` client event. + + :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: Literal[RealtimeClientEventType.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 + """Optional client-generated ID used to identify this event.""" + type: Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND]] + """The event type, must be ``input_audio_buffer.append``. Required. INPUT_AUDIO_BUFFER_APPEND.""" + audio: Required[str] + """Base64-encoded audio bytes. This must be in the format specified by the ``input_audio_format`` + field in the session configuration. Required.""" + + +class VoiceAgentClientEventInputAudioBufferClear(TypedDict, total=False): # pylint: disable=name-too-long + """The ``input_audio_buffer.clear`` client event. + + :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: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR] + """ + + event_id: str + """Optional client-generated ID used to identify this event.""" + type: Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR]] + """The event type, must be ``input_audio_buffer.clear``. Required. INPUT_AUDIO_BUFFER_CLEAR.""" + + +class VoiceAgentClientEventInputAudioBufferCommit(TypedDict, total=False): # pylint: disable=name-too-long + """The ``input_audio_buffer.commit`` client event. + + :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: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT] + """ + + event_id: str + """Optional client-generated ID used to identify this event.""" + type: Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT]] + """The event type, must be ``input_audio_buffer.commit``. Required. INPUT_AUDIO_BUFFER_COMMIT.""" + + +class VoiceAgentClientEventOutputAudioBufferClear(TypedDict, total=False): # pylint: disable=name-too-long + """The ``output_audio_buffer.clear`` client event. + + :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: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR] + """ + + event_id: str + """The unique ID of the client event used for error handling.""" + type: Required[Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR]] + """The event type, must be ``output_audio_buffer.clear``. Required. OUTPUT_AUDIO_BUFFER_CLEAR.""" + + +class VoiceAgentClientEventResponseCancel(TypedDict, total=False): + """The ``response.cancel`` client event. + + :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: Literal[RealtimeClientEventType.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 + """Optional client-generated ID used to identify this event.""" + type: Required[Literal[RealtimeClientEventType.RESPONSE_CANCEL]] + """The event type, must be ``response.cancel``. Required. RESPONSE_CANCEL.""" + response_id: str + """A specific response ID to cancel - if not provided, will cancel an in-progress response in the + default conversation.""" + + +class VoiceAgentClientEventResponseCreate(TypedDict, total=False): + """The ``response.create`` client event. + + :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: Literal[RealtimeClientEventType.RESPONSE_CREATE] + :ivar response: Parameters for the new response. + :vartype response: "VoiceAgentResponseCreateParams" + """ + + event_id: str + """Optional client-generated ID used to identify this event.""" + type: Required[Literal[RealtimeClientEventType.RESPONSE_CREATE]] + """The event type, must be ``response.create``. Required. RESPONSE_CREATE.""" + response: "VoiceAgentResponseCreateParams" + """Parameters for the new response.""" + + +class VoiceAgentClientEventSessionAvatarConnect(TypedDict, total=False): # pylint: disable=name-too-long + """The ``session.avatar.connect`` client event. + + :ivar type: The event type. Always ``session.avatar.connect``. Required. Default value is + "session.avatar.connect". + :vartype type: Literal["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 + """ + + type: Required[Literal["session.avatar.connect"]] + """The event type. Always ``session.avatar.connect``. Required. Default value is + \"session.avatar.connect\".""" + event_id: str + """An optional client-generated event identifier.""" + client_sdp: Required[str] + """The client's SDP offer for avatar media negotiation. Required.""" + + +class VoiceAgentClientEventSessionUpdate(TypedDict, total=False): + """The ``session.update`` client event. + + :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: Literal[RealtimeClientEventType.SESSION_UPDATE] + :ivar session: The stable realtime session fields to update. Required. + :vartype session: "VoiceAgentSessionUpdateConfig" + """ + + event_id: str + """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: Required[Literal[RealtimeClientEventType.SESSION_UPDATE]] + """The event type, must be ``session.update``. Required. SESSION_UPDATE.""" + session: Required["VoiceAgentSessionUpdateConfig"] + """The stable realtime session fields to update. Required.""" + + +class VoiceAgentDefinition(TypedDict, total=False): + """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 rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. + :vartype rai_config: "RaiConfig" + :ivar kind: The kind discriminator for a voice agent definition. Always ``voice``. Required. + VOICE. + :vartype kind: Literal[AgentKind.VOICE] + :ivar model_type: How the model backing this agent is served. Together with ``model``, this + selects the model up front. ``managed`` uses a service-managed model; ``self_deployed`` uses + the customer's own Foundry deployment. This is independent of the architecture (realtime or + cascaded), which the service derives from the selected model. Required. Known values are: + "managed" and "self_deployed". + :vartype model_type: Union[str, "VoiceModelType"] + :ivar model: The model to use for this agent, paired with ``model_type``: the service-managed + model name when ``model_type`` is ``managed``, or the customer's Foundry deployment name when + ``model_type`` is ``self_deployed``. The model must support realtime or cascaded voice. The + service derives the architecture from the selected model. Required. + :vartype model: str + :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: "VoiceGreetingConfig" + :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: "VoiceAudioConfig" + :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[Union[str, "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: "_unions.VoiceAgentMaxOutputTokens" + :ivar include: Additional fields to include in service outputs. + :vartype include: list[Union[str, "VoiceAgentSessionIncludeOption"]] + :ivar interim_response: Interim-response settings for latency and tool execution. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. + :vartype interim_response: "_unions.VoiceAgentInterimResponse" + :ivar avatar: Optional avatar configuration. These values are session defaults and may be + overridden when connecting. + :vartype avatar: "VoiceAvatarConfig" + :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["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: Union[str, "_models.ToolChoiceOptions"], ToolChoiceFunction, ToolChoiceMCP + :vartype tool_choice: "_unions.VoiceAgentToolChoice" + :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, "StructuredInputDefinition"] + :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 + """ + + rai_config: "RaiConfig" + """Configuration for Responsible AI (RAI) content filtering and safety features.""" + kind: Required[Literal[AgentKind.VOICE]] + """The kind discriminator for a voice agent definition. Always ``voice``. Required. VOICE.""" + model_type: Required[Union[str, "VoiceModelType"]] + """How the model backing this agent is served. Together with ``model``, this selects the model up + front. ``managed`` uses a service-managed model; ``self_deployed`` uses the customer's own + Foundry deployment. This is independent of the architecture (realtime or cascaded), which the + service derives from the selected model. Required. Known values are: \"managed\" and + \"self_deployed\".""" + model: Required[str] + """The model to use for this agent, paired with ``model_type``: the service-managed model name + when ``model_type`` is ``managed``, or the customer's Foundry deployment name when + ``model_type`` is ``self_deployed``. The model must support realtime or cascaded voice. The + service derives the architecture from the selected model. Required.""" + instructions: str + """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: "VoiceGreetingConfig" + """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: "VoiceAudioConfig" + """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: list[Union[str, "VoiceOutputModality"]] + """The output modalities the agent produces. Defaults to ``[\"audio\"]``. ``animation`` and + ``avatar`` are available when an avatar is configured.""" + max_output_tokens: "_unions.VoiceAgentMaxOutputTokens" + """The maximum output-token count for one response. Is either a int type or a Literal[\"inf\"] + type.""" + include: list[Union[str, "VoiceAgentSessionIncludeOption"]] + """Additional fields to include in service outputs.""" + interim_response: "_unions.VoiceAgentInterimResponse" + """Interim-response settings for latency and tool execution. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type.""" + avatar: "VoiceAvatarConfig" + """Optional avatar configuration. These values are session defaults and may be overridden when + connecting.""" + tools: list["VoiceAgentTool"] + """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: "_unions.VoiceAgentToolChoice" + """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: + Union[str, \"_models.ToolChoiceOptions\"], ToolChoiceFunction, ToolChoiceMCP""" + parallel_tool_calls: bool + """Whether the model may call multiple tools in parallel.""" + structured_inputs: dict[str, "StructuredInputDefinition"] + """Set of structured inputs that participate in prompt template substitution, rendered per session + before the live session starts.""" + store: bool + """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.""" + + +class VoiceAgentEchoCancellation(TypedDict, total=False): + """Server-side echo cancellation settings for input audio. + + :ivar type: The echo cancellation implementation. Always ``server_echo_cancellation``. + Required. Default value is "server_echo_cancellation". + :vartype type: Literal["server_echo_cancellation"] + :ivar reference_source: Whether reference audio comes from server playback or a client-provided + channel. Known values are: "server" and "client". + :vartype reference_source: Union[str, "VoiceAgentEchoCancellationReferenceSource"] + :ivar channels: The number of input channels. Use two interleaved channels when + ``reference_source`` is ``client``. + :vartype channels: int + """ + + type: Required[Literal["server_echo_cancellation"]] + """The echo cancellation implementation. Always ``server_echo_cancellation``. Required. Default + value is \"server_echo_cancellation\".""" + reference_source: Union[str, "VoiceAgentEchoCancellationReferenceSource"] + """Whether reference audio comes from server playback or a client-provided channel. Known values + are: \"server\" and \"client\".""" + channels: int + """The number of input channels. Use two interleaved channels when ``reference_source`` is + ``client``.""" + + +class VoiceAgentFunctionTool(TypedDict, total=False): + """A native function tool executed by the client. + + :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: "RealtimeFunctionToolParameters" + :ivar type: Required. Default value is "function". + :vartype type: Literal["function"] + :ivar name: The function name. Required. + :vartype name: str + """ + + description: str + """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: "RealtimeFunctionToolParameters" + """Parameters of the function in JSON Schema.""" + type: Required[Literal["function"]] + """Required. Default value is \"function\".""" + name: Required[str] + """The function name. Required.""" + + +class VoiceAgentLlmInterimResponseConfig(TypedDict, total=False): + """An interim response generated by a language model. + + :ivar triggers: Conditions that may trigger one interim response. + :vartype triggers: list[Union[str, "VoiceAgentInterimResponseTrigger"]] + :ivar latency_threshold_ms: The latency threshold in milliseconds. + :vartype latency_threshold_ms: int + :ivar type: Required. Default value is "llm_interim_response". + :vartype type: Literal["llm_interim_response"] + :ivar model: The model used to generate interim responses. + :vartype model: str + :ivar instructions: Optional instructions for generating interim responses. + :vartype instructions: str + :ivar max_completion_tokens: The maximum completion-token count for an interim response. + :vartype max_completion_tokens: int + """ + + triggers: list[Union[str, "VoiceAgentInterimResponseTrigger"]] + """Conditions that may trigger one interim response.""" + latency_threshold_ms: int + """The latency threshold in milliseconds.""" + type: Required[Literal["llm_interim_response"]] + """Required. Default value is \"llm_interim_response\".""" + model: str + """The model used to generate interim responses.""" + instructions: str + """Optional instructions for generating interim responses.""" + max_completion_tokens: int + """The maximum completion-token count for an interim response.""" + + +class VoiceAgentMcpTool(TypedDict, total=False): + """An MCP tool available to a voice agent. + + :ivar server_label: A label for this MCP server, used to identify it in tool calls. Required. + :vartype server_label: 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: Union[list[str], "MCPToolFilter"] + :ivar allowed_callers: + :vartype allowed_callers: list[Union[str, "CallableToolAllowedCaller"]] + :ivar require_approval: Is one of the following types: MCPToolRequireApproval, + Literal["always"], Literal["never"] + :vartype require_approval: Union["MCPToolRequireApproval", Literal["always"], Literal["never"]] + :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, "ToolConfig"] + :ivar type: Required. Default value is "mcp". + :vartype type: Literal["mcp"] + :ivar server_url: The URL for the MCP server. + :vartype server_url: str + :ivar response_scheduling: When the MCP invocation creates a follow-up response. Defaults to + ``when_idle``. Known values are: "silent", "when_idle", "interrupt", and "skip_if_busy". + :vartype response_scheduling: Union[str, "VoiceAgentToolResponseScheduling"] + """ + + server_label: Required[str] + """A label for this MCP server, used to identify it in tool calls. Required.""" + authorization: str + """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: str + """Optional description of the MCP server, used to provide more context.""" + headers: Optional[dict[str, str]] + allowed_tools: Optional[Union[list[str], "MCPToolFilter"]] + """Is either a [str] type or a MCPToolFilter type.""" + allowed_callers: Optional[list[Union[str, "CallableToolAllowedCaller"]]] + require_approval: Optional[Union["MCPToolRequireApproval", Literal["always"], Literal["never"]]] + """Is one of the following types: MCPToolRequireApproval, Literal[\"always\"], Literal[\"never\"]""" + defer_loading: bool + """Whether this MCP tool is deferred and discovered via tool search.""" + project_connection_id: str + """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: dict[str, "ToolConfig"] + """Deprecated. This property is deprecated and will be removed in a future version.""" + type: Required[Literal["mcp"]] + """Required. Default value is \"mcp\".""" + server_url: str + """The URL for the MCP server.""" + response_scheduling: Union[str, "VoiceAgentToolResponseScheduling"] + """When the MCP invocation creates a follow-up response. Defaults to ``when_idle``. Known values + are: \"silent\", \"when_idle\", \"interrupt\", and \"skip_if_busy\".""" + + +class VoiceAgentRealtimeResponse(OmitPropertiesRealtimeResponse1): + """A live realtime response returned by the voice-agent service in both ``response.created`` and + ``response.done`` events. + + :ivar id: The unique ID of the response, will look like ``resp_1234``. + :vartype id: str + :ivar object: The object type, must be ``realtime.response``. Default value is + "realtime.response". + :vartype object: Literal["realtime.response"] + :ivar status: The final status of the response (``completed``, ``cancelled``, ``failed``, or + ``incomplete``, ``in_progress``). Is one of the following types: Literal["completed"], + Literal["cancelled"], Literal["failed"], Literal["incomplete"], Literal["in_progress"] + :vartype status: Literal["completed", "cancelled", "failed", "incomplete", "in_progress"] + :ivar status_details: Additional details about the status. + :vartype status_details: "RealtimeResponseStatusDetails" + :ivar metadata: + :vartype metadata: "Metadata" + :ivar usage: Usage statistics for the Response, this will correspond to billing. A Realtime API + session will maintain a conversation context and append new Items to the Conversation, thus + output from previous turns (text and audio tokens) will become the input for later turns. + :vartype usage: "RealtimeResponseUsage" + :ivar conversation_id: Which conversation the response is added to, determined by the + ``conversation`` field in the ``response.create`` event. If ``auto``, the response will be + added to the default conversation and the value of ``conversation_id`` will be an id like + ``conv_1234``. If ``none``, the response will not be added to any conversation and the value of + ``conversation_id`` will be ``null``. If responses are being triggered automatically by VAD the + response will be added to the default conversation. + :vartype conversation_id: str + :ivar output_modalities: The set of modalities the model used to respond, currently the only + possible values are ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text + transcript. Setting the output to mode ``text`` will disable audio output from the model. + :vartype output_modalities: list[Literal["text", "audio"]] + :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, + inclusive of tool calls, that was used in this response. Is either a int type or a + Literal["inf"] type. + :vartype max_output_tokens: Union[int, Literal["inf"]] + :ivar audio: The audio configuration used by the live response, including flat voice provider, + locale, and format fields under ``output``. + :vartype audio: "VoiceResponseAudio" + :ivar output: The items produced by the live response. + :vartype output: list["_unions.VoiceAgentResponseItem"] + """ + + audio: "VoiceResponseAudio" + """The audio configuration used by the live response, including flat voice provider, locale, and + format fields under ``output``.""" + output: list["_unions.VoiceAgentResponseItem"] + """The items produced by the live response.""" + + +class VoiceAgentResponseCreateParams(TypedDict, total=False): + """Parameters accepted by a voice-agent ``response.create`` event. + + :ivar instructions: The default system instructions (i.e. system message) prepended to model + calls. This field allows the client to guide the model on desired responses. The model can be + instructed on response content and format, (e.g. "be extremely succinct", "act friendly", "here + are examples of good responses") and on audio behavior (e.g. "talk quickly", "inject emotion + into your voice", "laugh frequently"). The instructions are not guaranteed to be followed by + the model, but they provide guidance to the model on the desired behavior. Note that the server + sets default instructions which will be used if this field is not set and are visible in the + ``session.created`` event at the start of the session. + :vartype instructions: str + :ivar tools: Tools available to the model. + :vartype tools: list[Union["RealtimeFunctionTool", "MCPTool"]] + :ivar tool_choice: How the model chooses tools. Provide one of the string modes or force a + specific function/MCP tool. Is one of the following types: Union[str, + "_models.ToolChoiceOptions"], ToolChoiceFunction, ToolChoiceMCP + :vartype tool_choice: Union[str, "ToolChoiceOptions", "ToolChoiceFunction", "ToolChoiceMCP"] + :ivar parallel_tool_calls: Whether the model may call multiple tools in parallel. Only + supported by reasoning Realtime models such as ``gpt-realtime-2``. + :vartype parallel_tool_calls: bool + :ivar reasoning: + :vartype reasoning: "RealtimeReasoning" + :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, + inclusive of tool calls. Provide an integer between 1 and 4096 to limit output tokens, or + ``inf`` for the maximum available tokens for a given model. Defaults to ``inf``. Is either a + int type or a Literal["inf"] type. + :vartype max_output_tokens: Union[int, Literal["inf"]] + :ivar conversation: Controls which conversation the response is added to. Currently supports + ``auto`` and ``none``, with ``auto`` as the default value. The ``auto`` value means that the + contents of the response will be added to the default conversation. Set this to ``none`` to + create an out-of-band response which will not add items to default conversation. Is one of the + following types: Literal["auto"], Literal["none"], str + :vartype conversation: Union[Literal["auto"], Literal["none"], str] + :ivar metadata: + :vartype metadata: "Metadata" + :ivar input: Input items to include in the prompt for the model. Using this field creates a new + context for this Response instead of using the default conversation. An empty array ``[]`` will + clear the context for this Response. Note that this can include references to items that + previously appeared in the session using their id. + :vartype input: list["RealtimeConversationItem"] + :ivar output_modalities: Modalities that the response may return. + :vartype output_modalities: list[Union[str, "VoiceOutputModality"]] + :ivar audio: Response-specific audio settings. + :vartype audio: "PickPropertiesVoiceAudioConfig" + :ivar pre_generated_assistant_message: A pre-generated assistant message used to begin the + response. + :vartype pre_generated_assistant_message: "RealtimeConversationItemMessageAssistant" + :ivar interim_response: Interim-response settings for this response. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. + :vartype interim_response: "_unions.VoiceAgentInterimResponse" + """ + + instructions: str + """The default system instructions (i.e. system message) prepended to model calls. This field + allows the client to guide the model on desired responses. The model can be instructed on + response content and format, (e.g. \"be extremely succinct\", \"act friendly\", \"here are + examples of good responses\") and on audio behavior (e.g. \"talk quickly\", \"inject emotion + into your voice\", \"laugh frequently\"). The instructions are not guaranteed to be followed by + the model, but they provide guidance to the model on the desired behavior. Note that the server + sets default instructions which will be used if this field is not set and are visible in the + ``session.created`` event at the start of the session.""" + tools: list[Union["RealtimeFunctionTool", "MCPTool"]] + """Tools available to the model.""" + tool_choice: Union[str, "ToolChoiceOptions", "ToolChoiceFunction", "ToolChoiceMCP"] + """How the model chooses tools. Provide one of the string modes or force a specific function/MCP + tool. Is one of the following types: Union[str, \"_models.ToolChoiceOptions\"], + ToolChoiceFunction, ToolChoiceMCP""" + parallel_tool_calls: bool + """Whether the model may call multiple tools in parallel. Only supported by reasoning Realtime + models such as ``gpt-realtime-2``.""" + reasoning: "RealtimeReasoning" + max_output_tokens: Union[int, Literal["inf"]] + """Maximum number of output tokens for a single assistant response, inclusive of tool calls. + Provide an integer between 1 and 4096 to limit output tokens, or ``inf`` for the maximum + available tokens for a given model. Defaults to ``inf``. Is either a int type or a + Literal[\"inf\"] type.""" + conversation: Union[Literal["auto"], Literal["none"], str] + """Controls which conversation the response is added to. Currently supports ``auto`` and ``none``, + with ``auto`` as the default value. The ``auto`` value means that the contents of the response + will be added to the default conversation. Set this to ``none`` to create an out-of-band + response which will not add items to default conversation. Is one of the following types: + Literal[\"auto\"], Literal[\"none\"], str""" + metadata: Optional["Metadata"] + input: list["RealtimeConversationItem"] + """Input items to include in the prompt for the model. Using this field creates a new context for + this Response instead of using the default conversation. An empty array ``[]`` will clear the + context for this Response. Note that this can include references to items that previously + appeared in the session using their id.""" + output_modalities: list[Union[str, "VoiceOutputModality"]] + """Modalities that the response may return.""" + audio: "PickPropertiesVoiceAudioConfig" + """Response-specific audio settings.""" + pre_generated_assistant_message: Optional["RealtimeConversationItemMessageAssistant"] + """A pre-generated assistant message used to begin the response.""" + interim_response: Optional["_unions.VoiceAgentInterimResponse"] + """Interim-response settings for this response. Is either a VoiceAgentStaticInterimResponseConfig + type or a VoiceAgentLlmInterimResponseConfig type.""" + + +class VoiceAgentResponseEventContentPart(TypedDict, total=False): + """A content part carried by a ``response.content_part.*`` server event. + + :ivar type: Is either a Literal["audio"] type or a Literal["text"] type. + :vartype type: Literal["audio", "text"] + :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: "VoiceAudioFormat" + """ + + type: Literal["audio", "text"] + """Is either a Literal[\"audio\"] type or a Literal[\"text\"] type.""" + text: str + audio: str + transcript: str + format: "VoiceAudioFormat" + """The audio format, when this is an audio content part.""" + + +class VoiceAgentSemanticVadTurnDetection(TypedDict, total=False): + """OpenAI semantic VAD turn-detection settings. + + :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech + stops. + :vartype auto_truncate: bool + :ivar eagerness: Is one of the following types: Literal["low"], Literal["medium"], + Literal["high"], Literal["auto"] + :vartype eagerness: Literal["low", "medium", "high", "auto"] + :ivar create_response: + :vartype create_response: bool + :ivar interrupt_response: + :vartype interrupt_response: bool + :ivar type: Required. Semantic voice activity detection. + :vartype type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD] + """ + + auto_truncate: bool + """Whether the input audio buffer is truncated automatically when speech stops.""" + eagerness: Literal["low", "medium", "high", "auto"] + """Is one of the following types: Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"], + Literal[\"auto\"]""" + create_response: bool + interrupt_response: bool + type: Required[Literal[VoiceTurnDetectionType.SEMANTIC_VAD]] + """Required. Semantic voice activity detection.""" + + +class VoiceAgentServerEventConversationItemAdded(TypedDict, total=False): # pylint: disable=name-too-long + """The ``conversation.item.added`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``conversation.item.added``. Required. + CONVERSATION_ITEM_ADDED. + :vartype type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED] + :ivar previous_item_id: + :vartype previous_item_id: str + :ivar item: The item added to the conversation. Required. Is one of the following types: + "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem + :vartype item: "_unions.VoiceAgentResponseItem" + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED]] + """The event type, must be ``conversation.item.added``. Required. CONVERSATION_ITEM_ADDED.""" + previous_item_id: Optional[str] + item: Required["_unions.VoiceAgentResponseItem"] + """The item added to the conversation. Required. Is one of the following types: + \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem""" + + +class VoiceAgentServerEventConversationItemCreated(TypedDict, total=False): # pylint: disable=name-too-long + """The ``conversation.item.created`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``conversation.item.created``. Required. + CONVERSATION_ITEM_CREATED. + :vartype type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED] + :ivar previous_item_id: + :vartype previous_item_id: str + :ivar item: The created conversation item. Required. Is one of the following types: + "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem + :vartype item: "_unions.VoiceAgentResponseItem" + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED]] + """The event type, must be ``conversation.item.created``. Required. CONVERSATION_ITEM_CREATED.""" + previous_item_id: Optional[str] + item: Required["_unions.VoiceAgentResponseItem"] + """The created conversation item. Required. Is one of the following types: + \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem""" + + +class VoiceAgentServerEventConversationItemDeleted(TypedDict, total=False): # pylint: disable=name-too-long + """The ``conversation.item.deleted`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``conversation.item.deleted``. Required. + CONVERSATION_ITEM_DELETED. + :vartype type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED] + :ivar item_id: The ID of the item that was deleted. Required. + :vartype item_id: str + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED]] + """The event type, must be ``conversation.item.deleted``. Required. CONVERSATION_ITEM_DELETED.""" + item_id: Required[str] + """The ID of the item that was deleted. Required.""" + + +class VoiceAgentServerEventConversationItemDone(TypedDict, total=False): # pylint: disable=name-too-long + """The ``conversation.item.done`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``conversation.item.done``. Required. + CONVERSATION_ITEM_DONE. + :vartype type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE] + :ivar previous_item_id: + :vartype previous_item_id: str + :ivar item: The completed conversation item. Required. Is one of the following types: + "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem + :vartype item: "_unions.VoiceAgentResponseItem" + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE]] + """The event type, must be ``conversation.item.done``. Required. CONVERSATION_ITEM_DONE.""" + previous_item_id: Optional[str] + item: Required["_unions.VoiceAgentResponseItem"] + """The completed conversation item. Required. Is one of the following types: + \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem""" + + +class VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted( + TypedDict, total=False +): # pylint: disable=name-too-long + """The ``conversation.item.input_audio_transcription.completed`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :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: + Literal[RealtimeServerEventType.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 logprobs: + :vartype logprobs: list["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: Union["TranscriptTextUsageTokens", "TranscriptTextUsageDuration"] + :ivar phrases: Phrase-level transcription timing and confidence details. + :vartype phrases: list["VoiceAgentTranscriptionPhrase"] + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED]] + """The event type, must be ``conversation.item.input_audio_transcription.completed``. Required. + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED.""" + item_id: Required[str] + """The ID of the item containing the audio that is being transcribed. Required.""" + content_index: Required[int] + """The index of the content part containing the audio. Required.""" + transcript: Required[str] + """The transcribed text. Required.""" + logprobs: Optional[list["LogProbProperties"]] + usage: Required[Union["TranscriptTextUsageTokens", "TranscriptTextUsageDuration"]] + """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["VoiceAgentTranscriptionPhrase"]] + """Phrase-level transcription timing and confidence details.""" + + +class VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta( + TypedDict, total=False +): # pylint: disable=name-too-long + """The ``conversation.item.input_audio_transcription.delta`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :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: + Literal[RealtimeServerEventType.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["LogProbProperties"] + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA]] + """The event type, must be ``conversation.item.input_audio_transcription.delta``. Required. + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA.""" + item_id: Required[str] + """The ID of the item containing the audio that is being transcribed. Required.""" + content_index: int + """The index of the content part in the item's content array.""" + delta: str + """The text delta.""" + logprobs: Optional[list["LogProbProperties"]] + + +class VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed( + TypedDict, total=False +): # pylint: disable=name-too-long + """The ``conversation.item.input_audio_transcription.failed`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :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: + Literal[RealtimeServerEventType.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: "RealtimeServerEventConversationItemInputAudioTranscriptionFailedError" + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED]] + """The event type, must be ``conversation.item.input_audio_transcription.failed``. Required. + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED.""" + item_id: Required[str] + """The ID of the user message item. Required.""" + content_index: Required[int] + """The index of the content part containing the audio. Required.""" + error: Required["RealtimeServerEventConversationItemInputAudioTranscriptionFailedError"] + """Details of the transcription error. Required.""" + + +class VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment( + TypedDict, total=False +): # pylint: disable=name-too-long + """The ``conversation.item.input_audio_transcription.segment`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :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: + Literal[RealtimeServerEventType.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: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT]] + """The event type, must be ``conversation.item.input_audio_transcription.segment``. Required. + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT.""" + item_id: Required[str] + """The ID of the item containing the input audio content. Required.""" + content_index: Required[int] + """The index of the input audio content part within the item. Required.""" + text: Required[str] + """The text for this segment. Required.""" + id: Required[str] + """The segment identifier. Required.""" + speaker: Required[str] + """The detected speaker label for this segment. Required.""" + start: Required[float] + """Start time of the segment in seconds. Required.""" + end: Required[float] + """End time of the segment in seconds. Required.""" + + +class VoiceAgentServerEventConversationItemRetrieved(TypedDict, total=False): # pylint: disable=name-too-long + """The ``conversation.item.retrieved`` server event. + + :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: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED] + :ivar item: The retrieved conversation item. Required. Is one of the following types: + "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem + :vartype item: "_unions.VoiceAgentResponseItem" + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED]] + """The event type, must be ``conversation.item.retrieved``. Required. CONVERSATION_ITEM_RETRIEVED.""" + item: Required["_unions.VoiceAgentResponseItem"] + """The retrieved conversation item. Required. Is one of the following types: + \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem""" + + +class VoiceAgentServerEventConversationItemTruncated(TypedDict, total=False): # pylint: disable=name-too-long + """The ``conversation.item.truncated`` server event. + + :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: Literal[RealtimeServerEventType.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: "RealtimeConversationItemMessageAssistant" + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED]] + """The event type, must be ``conversation.item.truncated``. Required. CONVERSATION_ITEM_TRUNCATED.""" + item_id: Required[str] + """The ID of the assistant message item that was truncated. Required.""" + content_index: Required[int] + """The index of the content part that was truncated. Required.""" + audio_end_ms: Required[int] + """The duration up to which the audio was truncated, in milliseconds. Required.""" + item: "RealtimeConversationItemMessageAssistant" + """The assistant message after truncation, when the service returns the updated item.""" + + +class VoiceAgentServerEventInputAudioBufferCleared(TypedDict, total=False): # pylint: disable=name-too-long + """The ``input_audio_buffer.cleared`` server event. + + :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: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED] + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED]] + """The event type, must be ``input_audio_buffer.cleared``. Required. INPUT_AUDIO_BUFFER_CLEARED.""" + + +class VoiceAgentServerEventInputAudioBufferCommitted(TypedDict, total=False): # pylint: disable=name-too-long + """The ``input_audio_buffer.committed`` server event. + + :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: Literal[RealtimeServerEventType.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 + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED]] + """The event type, must be ``input_audio_buffer.committed``. Required. + INPUT_AUDIO_BUFFER_COMMITTED.""" + previous_item_id: Optional[str] + item_id: Required[str] + """The ID of the user message item that will be created. Required.""" + + +class VoiceAgentServerEventInputAudioBufferSpeechStarted(TypedDict, total=False): # pylint: disable=name-too-long + """The ``input_audio_buffer.speech_started`` server event. + + :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: Literal[RealtimeServerEventType.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 + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED]] + """The event type, must be ``input_audio_buffer.speech_started``. Required. + INPUT_AUDIO_BUFFER_SPEECH_STARTED.""" + audio_start_ms: Required[int] + """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: Required[str] + """The ID of the user message item that will be created when speech stops. Required.""" + + +class VoiceAgentServerEventInputAudioBufferSpeechStopped(TypedDict, total=False): # pylint: disable=name-too-long + """The ``input_audio_buffer.speech_stopped`` server event. + + :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: Literal[RealtimeServerEventType.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 + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED]] + """The event type, must be ``input_audio_buffer.speech_stopped``. Required. + INPUT_AUDIO_BUFFER_SPEECH_STOPPED.""" + audio_end_ms: Required[int] + """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: Required[str] + """The ID of the user message item that will be created. Required.""" + + +class VoiceAgentServerEventInputAudioBufferTimeoutTriggered(TypedDict, total=False): # pylint: disable=name-too-long + """The ``input_audio_buffer.timeout_triggered`` server event. + + :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: Literal[RealtimeServerEventType.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 + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED]] + """The event type, must be ``input_audio_buffer.timeout_triggered``. Required. + INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED.""" + audio_start_ms: Required[int] + """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: Required[int] + """Millisecond offset of audio written to the input audio buffer at the time the timeout was + triggered. Required.""" + item_id: Required[str] + """The ID of the item associated with this segment. Required.""" + + +class VoiceAgentServerEventMcpListToolsCompleted(TypedDict, total=False): # pylint: disable=name-too-long + """The ``mcp_list_tools.completed`` server event. + + :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: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED] + :ivar item_id: The ID of the MCP list tools item. Required. + :vartype item_id: str + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED]] + """The event type, must be ``mcp_list_tools.completed``. Required. MCP_LIST_TOOLS_COMPLETED.""" + item_id: Required[str] + """The ID of the MCP list tools item. Required.""" + + +class VoiceAgentServerEventMcpListToolsFailed(TypedDict, total=False): + """The ``mcp_list_tools.failed`` server event. + + :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: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED] + :ivar item_id: The ID of the MCP list tools item. Required. + :vartype item_id: str + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED]] + """The event type, must be ``mcp_list_tools.failed``. Required. MCP_LIST_TOOLS_FAILED.""" + item_id: Required[str] + """The ID of the MCP list tools item. Required.""" + + +class VoiceAgentServerEventMcpListToolsInProgress(TypedDict, total=False): # pylint: disable=name-too-long + """The ``mcp_list_tools.in_progress`` server event. + + :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: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS] + :ivar item_id: The ID of the MCP list tools item. Required. + :vartype item_id: str + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS]] + """The event type, must be ``mcp_list_tools.in_progress``. Required. MCP_LIST_TOOLS_IN_PROGRESS.""" + item_id: Required[str] + """The ID of the MCP list tools item. Required.""" + + +class VoiceAgentServerEventOutputAudioBufferCleared(TypedDict, total=False): # pylint: disable=name-too-long + """The ``output_audio_buffer.cleared`` server event. + + :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: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED] + :ivar response_id: The unique ID of the response that produced the audio. Required. + :vartype response_id: str + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED]] + """The event type, must be ``output_audio_buffer.cleared``. Required. OUTPUT_AUDIO_BUFFER_CLEARED.""" + response_id: Required[str] + """The unique ID of the response that produced the audio. Required.""" + + +class VoiceAgentServerEventRateLimitsUpdated(TypedDict, total=False): + """The ``rate_limits.updated`` server event. + + :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: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED] + :ivar rate_limits: List of rate limit information. Required. + :vartype rate_limits: list["RealtimeServerEventRateLimitsUpdatedRateLimits"] + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED]] + """The event type, must be ``rate_limits.updated``. Required. RATE_LIMITS_UPDATED.""" + rate_limits: Required[list["RealtimeServerEventRateLimitsUpdatedRateLimits"]] + """List of rate limit information. Required.""" + + +class VoiceAgentServerEventResponseAnimationBlendshapesDelta(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.animation_blendshapes.delta`` server event. + + :ivar type: Required. Default value is "response.animation_blendshapes.delta". + :vartype type: Literal["response.animation_blendshapes.delta"] + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int + :ivar frames: Animation frames as numeric blendshape weights. Required. + :vartype frames: list[list[float]] + :ivar frame_index: The index of the first frame in this delta. Required. + :vartype frame_index: int + """ + + type: Required[Literal["response.animation_blendshapes.delta"]] + """Required. Default value is \"response.animation_blendshapes.delta\".""" + event_id: Required[str] + """Required.""" + response_id: Required[str] + """Required.""" + item_id: Required[str] + """Required.""" + output_index: Required[int] + """Required.""" + content_index: Required[int] + """Required.""" + frames: Required[list[list[float]]] + """Animation frames as numeric blendshape weights. Required.""" + frame_index: Required[int] + """The index of the first frame in this delta. Required.""" + + +class VoiceAgentServerEventResponseAnimationBlendshapesDone(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.animation_blendshapes.done`` server event. + + :ivar type: Required. Default value is "response.animation_blendshapes.done". + :vartype type: Literal["response.animation_blendshapes.done"] + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + """ + + type: Required[Literal["response.animation_blendshapes.done"]] + """Required. Default value is \"response.animation_blendshapes.done\".""" + event_id: Required[str] + """Required.""" + response_id: Required[str] + """Required.""" + item_id: Required[str] + """Required.""" + output_index: Required[int] + """Required.""" + + +class VoiceAgentServerEventResponseAnimationVisemeDelta(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.animation_viseme.delta`` server event. + + :ivar type: Required. Default value is "response.animation_viseme.delta". + :vartype type: Literal["response.animation_viseme.delta"] + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int + :ivar audio_offset_ms: Required. + :vartype audio_offset_ms: int + :ivar viseme_id: Required. + :vartype viseme_id: int + """ + + type: Required[Literal["response.animation_viseme.delta"]] + """Required. Default value is \"response.animation_viseme.delta\".""" + event_id: Required[str] + """Required.""" + response_id: Required[str] + """Required.""" + item_id: Required[str] + """Required.""" + output_index: Required[int] + """Required.""" + content_index: Required[int] + """Required.""" + audio_offset_ms: Required[int] + """Required.""" + viseme_id: Required[int] + """Required.""" + + +class VoiceAgentServerEventResponseAnimationVisemeDone(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.animation_viseme.done`` server event. + + :ivar type: Required. Default value is "response.animation_viseme.done". + :vartype type: Literal["response.animation_viseme.done"] + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int + """ + + type: Required[Literal["response.animation_viseme.done"]] + """Required. Default value is \"response.animation_viseme.done\".""" + event_id: Required[str] + """Required.""" + response_id: Required[str] + """Required.""" + item_id: Required[str] + """Required.""" + output_index: Required[int] + """Required.""" + content_index: Required[int] + """Required.""" + + +class VoiceAgentServerEventResponseAudioDelta(TypedDict, total=False): + """The ``response.output_audio.delta`` server event. + + :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: Literal[RealtimeServerEventType.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: str + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA]] + """The event type, must be ``response.output_audio.delta``. Required. RESPONSE_OUTPUT_AUDIO_DELTA.""" + response_id: Required[str] + """The ID of the response. Required.""" + item_id: Required[str] + """The ID of the item. Required.""" + output_index: Required[int] + """The index of the output item in the response. Required.""" + content_index: Required[int] + """The index of the content part in the item's content array. Required.""" + delta: Required[str] + """Base64-encoded audio data delta. Required.""" + + +class VoiceAgentServerEventResponseAudioDone(TypedDict, total=False): + """The ``response.output_audio.done`` server event. + + :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: Literal[RealtimeServerEventType.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 + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE]] + """The event type, must be ``response.output_audio.done``. Required. RESPONSE_OUTPUT_AUDIO_DONE.""" + response_id: Required[str] + """The ID of the response. Required.""" + item_id: Required[str] + """The ID of the item. Required.""" + output_index: Required[int] + """The index of the output item in the response. Required.""" + content_index: Required[int] + """The index of the content part in the item's content array. Required.""" + + +class VoiceAgentServerEventResponseAudioTimestampDelta(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.audio_timestamp.delta`` server event. + + :ivar type: Required. Default value is "response.audio_timestamp.delta". + :vartype type: Literal["response.audio_timestamp.delta"] + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int + :ivar audio_offset_ms: Required. + :vartype audio_offset_ms: int + :ivar audio_duration_ms: Required. + :vartype audio_duration_ms: int + :ivar text: Required. + :vartype text: str + :ivar timestamp_type: Required. Default value is "word". + :vartype timestamp_type: Literal["word"] + """ + + type: Required[Literal["response.audio_timestamp.delta"]] + """Required. Default value is \"response.audio_timestamp.delta\".""" + event_id: Required[str] + """Required.""" + response_id: Required[str] + """Required.""" + item_id: Required[str] + """Required.""" + output_index: Required[int] + """Required.""" + content_index: Required[int] + """Required.""" + audio_offset_ms: Required[int] + """Required.""" + audio_duration_ms: Required[int] + """Required.""" + text: Required[str] + """Required.""" + timestamp_type: Required[Literal["word"]] + """Required. Default value is \"word\".""" + + +class VoiceAgentServerEventResponseAudioTimestampDone(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.audio_timestamp.done`` server event. + + :ivar type: Required. Default value is "response.audio_timestamp.done". + :vartype type: Literal["response.audio_timestamp.done"] + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int + """ + + type: Required[Literal["response.audio_timestamp.done"]] + """Required. Default value is \"response.audio_timestamp.done\".""" + event_id: Required[str] + """Required.""" + response_id: Required[str] + """Required.""" + item_id: Required[str] + """Required.""" + output_index: Required[int] + """Required.""" + content_index: Required[int] + """Required.""" + + +class VoiceAgentServerEventResponseAudioTranscriptDelta(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.output_audio_transcript.delta`` server event. + + :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: Literal[RealtimeServerEventType.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 + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA]] + """The event type, must be ``response.output_audio_transcript.delta``. Required. + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA.""" + response_id: Required[str] + """The ID of the response. Required.""" + item_id: Required[str] + """The ID of the item. Required.""" + output_index: Required[int] + """The index of the output item in the response. Required.""" + content_index: Required[int] + """The index of the content part in the item's content array. Required.""" + delta: Required[str] + """The transcript delta. Required.""" + + +class VoiceAgentServerEventResponseAudioTranscriptDone(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.output_audio_transcript.done`` server event. + + :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: Literal[RealtimeServerEventType.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 + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE]] + """The event type, must be ``response.output_audio_transcript.done``. Required. + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE.""" + response_id: Required[str] + """The ID of the response. Required.""" + item_id: Required[str] + """The ID of the item. Required.""" + output_index: Required[int] + """The index of the output item in the response. Required.""" + content_index: Required[int] + """The index of the content part in the item's content array. Required.""" + transcript: Required[str] + """The final transcript of the audio. Required.""" + + +class VoiceAgentServerEventResponseContentPartDone(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.content_part.done`` server event. + + :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: Literal[RealtimeServerEventType.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 finished streaming. Required. + :vartype part: "VoiceAgentResponseEventContentPart" + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE]] + """The event type, must be ``response.content_part.done``. Required. RESPONSE_CONTENT_PART_DONE.""" + response_id: Required[str] + """The ID of the response. Required.""" + item_id: Required[str] + """The ID of the item. Required.""" + output_index: Required[int] + """The index of the output item in the response. Required.""" + content_index: Required[int] + """The index of the content part in the item's content array. Required.""" + part: Required["VoiceAgentResponseEventContentPart"] + """The content part that finished streaming. Required.""" + + +class VoiceAgentServerEventResponseCreated(TypedDict, total=False): + """The ``response.created`` server event. + + :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: Literal[RealtimeServerEventType.RESPONSE_CREATED] + :ivar response: The created voice-agent response. Required. + :vartype response: "VoiceAgentRealtimeResponse" + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_CREATED]] + """The event type, must be ``response.created``. Required. RESPONSE_CREATED.""" + response: Required["VoiceAgentRealtimeResponse"] + """The created voice-agent response. Required.""" + + +class VoiceAgentServerEventResponseDone(TypedDict, total=False): + """The ``response.done`` server event. + + :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: Literal[RealtimeServerEventType.RESPONSE_DONE] + :ivar response: The completed voice-agent response. Required. + :vartype response: "VoiceAgentRealtimeResponse" + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_DONE]] + """The event type, must be ``response.done``. Required. RESPONSE_DONE.""" + response: Required["VoiceAgentRealtimeResponse"] + """The completed voice-agent response. Required.""" + + +class VoiceAgentServerEventResponseFunctionCallArgumentsDelta(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.function_call_arguments.delta`` server event. + + :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: Literal[RealtimeServerEventType.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 + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA]] + """The event type, must be ``response.function_call_arguments.delta``. Required. + RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA.""" + response_id: Required[str] + """The ID of the response. Required.""" + item_id: Required[str] + """The ID of the function call item. Required.""" + output_index: Required[int] + """The index of the output item in the response. Required.""" + call_id: Required[str] + """The ID of the function call. Required.""" + delta: Required[str] + """The arguments delta as a JSON string. Required.""" + + +class VoiceAgentServerEventResponseFunctionCallArgumentsDone(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.function_call_arguments.done`` server event. + + :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: Literal[RealtimeServerEventType.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 + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE]] + """The event type, must be ``response.function_call_arguments.done``. Required. + RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE.""" + response_id: Required[str] + """The ID of the response. Required.""" + item_id: Required[str] + """The ID of the function call item. Required.""" + output_index: Required[int] + """The index of the output item in the response. Required.""" + call_id: Required[str] + """The ID of the function call. Required.""" + name: Required[str] + """The name of the function that was called. Required.""" + arguments: Required[str] + """The final arguments as a JSON string. Required.""" + + +class VoiceAgentServerEventResponseMcpCallArgumentsDelta(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.mcp_call_arguments.delta`` server event. + + :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: Literal[RealtimeServerEventType.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: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA]] + """The event type, must be ``response.mcp_call_arguments.delta``. Required. + RESPONSE_MCP_CALL_ARGUMENTS_DELTA.""" + response_id: Required[str] + """The ID of the response. Required.""" + item_id: Required[str] + """The ID of the MCP tool call item. Required.""" + output_index: Required[int] + """The index of the output item in the response. Required.""" + delta: Required[str] + """The JSON-encoded arguments delta. Required.""" + obfuscation: Optional[str] + + +class VoiceAgentServerEventResponseMcpCallArgumentsDone(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.mcp_call_arguments.done`` server event. + + :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: Literal[RealtimeServerEventType.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 + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE]] + """The event type, must be ``response.mcp_call_arguments.done``. Required. + RESPONSE_MCP_CALL_ARGUMENTS_DONE.""" + response_id: Required[str] + """The ID of the response. Required.""" + item_id: Required[str] + """The ID of the MCP tool call item. Required.""" + output_index: Required[int] + """The index of the output item in the response. Required.""" + arguments: Required[str] + """The final JSON-encoded arguments string. Required.""" + + +class VoiceAgentServerEventResponseMcpCallCompleted(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.mcp_call.completed`` server event. + + :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: Literal[RealtimeServerEventType.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 + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED]] + """The event type, must be ``response.mcp_call.completed``. Required. RESPONSE_MCP_CALL_COMPLETED.""" + output_index: Required[int] + """The index of the output item in the response. Required.""" + item_id: Required[str] + """The ID of the MCP tool call item. Required.""" + + +class VoiceAgentServerEventResponseMcpCallFailed(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.mcp_call.failed`` server event. + + :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: Literal[RealtimeServerEventType.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 + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED]] + """The event type, must be ``response.mcp_call.failed``. Required. RESPONSE_MCP_CALL_FAILED.""" + output_index: Required[int] + """The index of the output item in the response. Required.""" + item_id: Required[str] + """The ID of the MCP tool call item. Required.""" + + +class VoiceAgentServerEventResponseMcpCallInProgress(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.mcp_call.in_progress`` server event. + + :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: Literal[RealtimeServerEventType.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 + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS]] + """The event type, must be ``response.mcp_call.in_progress``. Required. + RESPONSE_MCP_CALL_IN_PROGRESS.""" + output_index: Required[int] + """The index of the output item in the response. Required.""" + item_id: Required[str] + """The ID of the MCP tool call item. Required.""" + + +class VoiceAgentServerEventResponseOutputItemAdded(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.output_item.added`` server event. + + :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: Literal[RealtimeServerEventType.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: The output item that was added. Required. Is one of the following types: + "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem + :vartype item: "_unions.VoiceAgentResponseItem" + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED]] + """The event type, must be ``response.output_item.added``. Required. RESPONSE_OUTPUT_ITEM_ADDED.""" + response_id: Required[str] + """The ID of the Response to which the item belongs. Required.""" + output_index: Required[int] + """The index of the output item in the Response. Required.""" + item: Required["_unions.VoiceAgentResponseItem"] + """The output item that was added. Required. Is one of the following types: + \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem""" + + +class VoiceAgentServerEventResponseOutputItemDone(TypedDict, total=False): # pylint: disable=name-too-long + """The ``response.output_item.done`` server event. + + :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: Literal[RealtimeServerEventType.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: The output item that finished streaming. Required. Is one of the following types: + "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem + :vartype item: "_unions.VoiceAgentResponseItem" + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE]] + """The event type, must be ``response.output_item.done``. Required. RESPONSE_OUTPUT_ITEM_DONE.""" + response_id: Required[str] + """The ID of the Response to which the item belongs. Required.""" + output_index: Required[int] + """The index of the output item in the Response. Required.""" + item: Required["_unions.VoiceAgentResponseItem"] + """The output item that finished streaming. Required. Is one of the following types: + \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, + VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem""" + + +class VoiceAgentServerEventResponseTextDelta(TypedDict, total=False): + """The ``response.output_text.delta`` server event. + + :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: Literal[RealtimeServerEventType.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 + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA]] + """The event type, must be ``response.output_text.delta``. Required. RESPONSE_OUTPUT_TEXT_DELTA.""" + response_id: Required[str] + """The ID of the response. Required.""" + item_id: Required[str] + """The ID of the item. Required.""" + output_index: Required[int] + """The index of the output item in the response. Required.""" + content_index: Required[int] + """The index of the content part in the item's content array. Required.""" + delta: Required[str] + """The text delta. Required.""" + + +class VoiceAgentServerEventResponseTextDone(TypedDict, total=False): + """The ``response.output_text.done`` server event. + + :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: Literal[RealtimeServerEventType.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 + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE]] + """The event type, must be ``response.output_text.done``. Required. RESPONSE_OUTPUT_TEXT_DONE.""" + response_id: Required[str] + """The ID of the response. Required.""" + item_id: Required[str] + """The ID of the item. Required.""" + output_index: Required[int] + """The index of the output item in the response. Required.""" + content_index: Required[int] + """The index of the content part in the item's content array. Required.""" + text: Required[str] + """The final text content. Required.""" + + +class VoiceAgentServerEventResponseVideoDelta(TypedDict, total=False): + """The ``response.video.delta`` server event. + + :ivar type: Required. Default value is "response.video.delta". + :vartype type: Literal["response.video.delta"] + :ivar event_id: Required. + :vartype event_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar codec: Required. + :vartype codec: str + :ivar delta: The base64-encoded video frame data. Required. + :vartype delta: str + """ + + type: Required[Literal["response.video.delta"]] + """Required. Default value is \"response.video.delta\".""" + event_id: Required[str] + """Required.""" + output_index: Required[int] + """Required.""" + codec: Required[str] + """Required.""" + delta: Required[str] + """The base64-encoded video frame data. Required.""" + + +class VoiceAgentServerEventSessionAvatarConnecting(TypedDict, total=False): # pylint: disable=name-too-long + """The ``session.avatar.connecting`` server event. + + :ivar type: Required. Default value is "session.avatar.connecting". + :vartype type: Literal["session.avatar.connecting"] + :ivar event_id: Required. + :vartype event_id: str + :ivar server_sdp: The server's SDP answer for avatar media negotiation. Required. + :vartype server_sdp: str + """ + + type: Required[Literal["session.avatar.connecting"]] + """Required. Default value is \"session.avatar.connecting\".""" + event_id: Required[str] + """Required.""" + server_sdp: Required[str] + """The server's SDP answer for avatar media negotiation. Required.""" + + +class VoiceAgentServerEventSessionAvatarSwitchToIdle(TypedDict, total=False): # pylint: disable=name-too-long + """The ``session.avatar.switch_to_idle`` server event. + + :ivar type: Required. Default value is "session.avatar.switch_to_idle". + :vartype type: Literal["session.avatar.switch_to_idle"] + :ivar event_id: Required. + :vartype event_id: str + :ivar turn_id: + :vartype turn_id: str + """ + + type: Required[Literal["session.avatar.switch_to_idle"]] + """Required. Default value is \"session.avatar.switch_to_idle\".""" + event_id: Required[str] + """Required.""" + turn_id: str + + +class VoiceAgentServerEventSessionAvatarSwitchToSpeaking(TypedDict, total=False): # pylint: disable=name-too-long + """The ``session.avatar.switch_to_speaking`` server event. + + :ivar type: Required. Default value is "session.avatar.switch_to_speaking". + :vartype type: Literal["session.avatar.switch_to_speaking"] + :ivar event_id: Required. + :vartype event_id: str + :ivar turn_id: + :vartype turn_id: str + """ + + type: Required[Literal["session.avatar.switch_to_speaking"]] + """Required. Default value is \"session.avatar.switch_to_speaking\".""" + event_id: Required[str] + """Required.""" + turn_id: str + + +class VoiceAgentServerEventSessionCreated(TypedDict, total=False): + """The ``session.created`` server event. + + :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: Literal[RealtimeServerEventType.SESSION_CREATED] + :ivar session: The initial effective voice-agent session configuration. Required. + :vartype session: "VoiceAgentSessionResponseConfig" + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.SESSION_CREATED]] + """The event type, must be ``session.created``. Required. SESSION_CREATED.""" + session: Required["VoiceAgentSessionResponseConfig"] + """The initial effective voice-agent session configuration. Required.""" + + +class VoiceAgentServerEventSessionUpdated(TypedDict, total=False): + """The ``session.updated`` server event. + + :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: Literal[RealtimeServerEventType.SESSION_UPDATED] + :ivar session: The effective voice-agent session configuration after the update. Required. + :vartype session: "VoiceAgentSessionResponseConfig" + """ + + event_id: Required[str] + """The unique ID of the server event. Required.""" + type: Required[Literal[RealtimeServerEventType.SESSION_UPDATED]] + """The event type, must be ``session.updated``. Required. SESSION_UPDATED.""" + session: Required["VoiceAgentSessionResponseConfig"] + """The effective voice-agent session configuration after the update. Required.""" + + +class VoiceAgentServerEventWarning(TypedDict, total=False): + """The ``warning`` server event. + + :ivar type: Required. Default value is "warning". + :vartype type: Literal["warning"] + :ivar event_id: Required. + :vartype event_id: str + :ivar warning: Required. + :vartype warning: "VoiceAgentServerEventWarningDetails" + """ + + type: Required[Literal["warning"]] + """Required. Default value is \"warning\".""" + event_id: Required[str] + """Required.""" + warning: Required["VoiceAgentServerEventWarningDetails"] + """Required.""" + + +class VoiceAgentServerEventWarningDetails(TypedDict, total=False): + """Details of a non-fatal warning. + + :ivar message: Required. + :vartype message: str + :ivar code: + :vartype code: str + :ivar param: + :vartype param: str + """ + + message: Required[str] + """Required.""" + code: str + param: str + + +class VoiceAvatarConfig(TypedDict, total=False): + """Avatar configuration for a voice agent. These values are session defaults and may be overridden + when connecting. + + :ivar type: The avatar type. Required. Known values are: "video_avatar" and "photo_avatar". + :vartype type: Union[str, "VoiceAvatarType"] + :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", "websocket", and "websocket-binary". + :vartype output_protocol: Union[str, "VoiceAvatarOutputProtocol"] + :ivar model: The avatar model identifier. + :vartype model: str + :ivar video: Avatar video encoder and presentation settings. + :vartype video: "VoiceAgentAvatarVideoParams" + :ivar scene: Avatar placement and motion settings. + :vartype scene: "VoiceAgentAvatarScene" + :ivar output_audit_audio: Whether audit audio is emitted with avatar output. Defaults to false. + :vartype output_audit_audio: bool + """ + + type: Required[Union[str, "VoiceAvatarType"]] + """The avatar type. Required. Known values are: \"video_avatar\" and \"photo_avatar\".""" + character: Required[str] + """The avatar character identifier, e.g. 'lisa'. Required.""" + style: str + """The avatar style, e.g. 'casual-sitting'.""" + customized: bool + """Whether the avatar is a customer-customized avatar. Defaults to false.""" + output_protocol: Union[str, "VoiceAvatarOutputProtocol"] + """The transport used to deliver the avatar video stream. Known values are: \"webrtc\", + \"websocket\", and \"websocket-binary\".""" + model: str + """The avatar model identifier.""" + video: "VoiceAgentAvatarVideoParams" + """Avatar video encoder and presentation settings.""" + scene: "VoiceAgentAvatarScene" + """Avatar placement and motion settings.""" + output_audit_audio: bool + """Whether audit audio is emitted with avatar output. Defaults to false.""" + + +class VoiceAgentSessionAvatarConfig(VoiceAvatarConfig): + """Avatar settings accepted by the stable voice-agent WebSocket contract. + + :ivar type: The avatar type. Required. Known values are: "video_avatar" and "photo_avatar". + :vartype type: Union[str, "VoiceAvatarType"] + :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", "websocket", and "websocket-binary". + :vartype output_protocol: Union[str, "VoiceAvatarOutputProtocol"] + :ivar model: The avatar model identifier. + :vartype model: str + :ivar video: Avatar video encoder and presentation settings. + :vartype video: "VoiceAgentAvatarVideoParams" + :ivar scene: Avatar placement and motion settings. + :vartype scene: "VoiceAgentAvatarScene" + :ivar output_audit_audio: Whether audit audio is emitted with avatar output. Defaults to false. + :vartype output_audit_audio: bool + :ivar ice_servers: + :vartype ice_servers: list["VoiceAgentAvatarIceServer"] + """ + + ice_servers: Optional[list["VoiceAgentAvatarIceServer"]] + + +class VoiceAgentSessionResponseConfig(TypedDict, total=False): + """The effective stable realtime session settings returned by the voice-agent service. + + :ivar type: The session type. Always ``realtime``. Required. Default value is "realtime". + :vartype type: Literal["realtime"] + :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: "_unions.VoiceAgentMaxOutputTokens" + :ivar output_modalities: The output modalities enabled for the session. + :vartype output_modalities: list[Union[str, "VoiceOutputModality"]] + :ivar audio: The input- and output-audio settings for the session. + :vartype audio: "VoiceAudioConfig" + :ivar avatar: The avatar settings for the session. + :vartype avatar: "VoiceAgentSessionAvatarConfig" + :ivar animation: Animation settings for the session. + :vartype animation: "VoiceAgentAnimationConfig" + :ivar tools: Tools available to the session. + :vartype tools: list["VoiceAgentTool"] + :ivar tool_choice: Tool-selection behavior for the session. Is one of the following types: + Union[str, "_models.ToolChoiceOptions"], ToolChoiceFunction, ToolChoiceMCP + :vartype tool_choice: "_unions.VoiceAgentToolChoice" + :ivar reasoning: Reasoning settings for compatible realtime models. + :vartype reasoning: "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[Union[str, "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. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. + :vartype interim_response: "_unions.VoiceAgentInterimResponse" + :ivar greeting: A proactive assistant greeting started after session configuration. + :vartype greeting: "VoiceGreetingConfig" + :ivar object: The object type. Always ``realtime.session``. Required. Default value is + "realtime.session". + :vartype object: Literal["realtime.session"] + :ivar id: The session identifier. Required. + :vartype id: str + :ivar model: The selected model. Required. + :vartype model: str + :ivar expires_at: The session expiration time as a Unix timestamp in seconds. + :vartype expires_at: int + """ + + type: Required[Literal["realtime"]] + """The session type. Always ``realtime``. Required. Default value is \"realtime\".""" + instructions: str + """Instructions applied throughout the session.""" + temperature: float + """The sampling temperature for compatible cascaded pipelines.""" + max_output_tokens: "_unions.VoiceAgentMaxOutputTokens" + """The maximum output-token count for one response. Is either a int type or a Literal[\"inf\"] + type.""" + output_modalities: list[Union[str, "VoiceOutputModality"]] + """The output modalities enabled for the session.""" + audio: "VoiceAudioConfig" + """The input- and output-audio settings for the session.""" + avatar: "VoiceAgentSessionAvatarConfig" + """The avatar settings for the session.""" + animation: "VoiceAgentAnimationConfig" + """Animation settings for the session.""" + tools: list["VoiceAgentTool"] + """Tools available to the session.""" + tool_choice: "_unions.VoiceAgentToolChoice" + """Tool-selection behavior for the session. Is one of the following types: Union[str, + \"_models.ToolChoiceOptions\"], ToolChoiceFunction, ToolChoiceMCP""" + reasoning: "RealtimeReasoning" + """Reasoning settings for compatible realtime models.""" + parallel_tool_calls: bool + """Whether the model may call multiple tools in parallel.""" + include: list[Union[str, "VoiceAgentSessionIncludeOption"]] + """Additional fields to include in service outputs.""" + metadata: dict[str, str] + """Up to 16 string key-value pairs attached to the session.""" + interim_response: "_unions.VoiceAgentInterimResponse" + """Interim-response settings for latency and tool execution. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type.""" + greeting: "VoiceGreetingConfig" + """A proactive assistant greeting started after session configuration.""" + object: Required[Literal["realtime.session"]] + """The object type. Always ``realtime.session``. Required. Default value is \"realtime.session\".""" + id: Required[str] + """The session identifier. Required.""" + model: Required[str] + """The selected model. Required.""" + expires_at: Optional[int] + """The session expiration time as a Unix timestamp in seconds.""" + + +class VoiceAgentSessionUpdateConfig(TypedDict, total=False): + """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: Literal["realtime"] + :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: "_unions.VoiceAgentMaxOutputTokens" + :ivar output_modalities: The output modalities enabled for the session. + :vartype output_modalities: list[Union[str, "VoiceOutputModality"]] + :ivar audio: The input- and output-audio settings for the session. + :vartype audio: "VoiceAudioConfig" + :ivar avatar: The avatar settings for the session. + :vartype avatar: "VoiceAgentSessionAvatarConfig" + :ivar animation: Animation settings for the session. + :vartype animation: "VoiceAgentAnimationConfig" + :ivar tools: Tools available to the session. + :vartype tools: list["VoiceAgentTool"] + :ivar tool_choice: Tool-selection behavior for the session. Is one of the following types: + Union[str, "_models.ToolChoiceOptions"], ToolChoiceFunction, ToolChoiceMCP + :vartype tool_choice: "_unions.VoiceAgentToolChoice" + :ivar reasoning: Reasoning settings for compatible realtime models. + :vartype reasoning: "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[Union[str, "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. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. + :vartype interim_response: "_unions.VoiceAgentInterimResponse" + :ivar greeting: A proactive assistant greeting started after session configuration. + :vartype greeting: "VoiceGreetingConfig" + """ + + type: Required[Literal["realtime"]] + """The session type. Always ``realtime``. Required. Default value is \"realtime\".""" + instructions: str + """Instructions applied throughout the session.""" + temperature: float + """The sampling temperature for compatible cascaded pipelines.""" + max_output_tokens: "_unions.VoiceAgentMaxOutputTokens" + """The maximum output-token count for one response. Is either a int type or a Literal[\"inf\"] + type.""" + output_modalities: list[Union[str, "VoiceOutputModality"]] + """The output modalities enabled for the session.""" + audio: "VoiceAudioConfig" + """The input- and output-audio settings for the session.""" + avatar: "VoiceAgentSessionAvatarConfig" + """The avatar settings for the session.""" + animation: "VoiceAgentAnimationConfig" + """Animation settings for the session.""" + tools: list["VoiceAgentTool"] + """Tools available to the session.""" + tool_choice: "_unions.VoiceAgentToolChoice" + """Tool-selection behavior for the session. Is one of the following types: Union[str, + \"_models.ToolChoiceOptions\"], ToolChoiceFunction, ToolChoiceMCP""" + reasoning: "RealtimeReasoning" + """Reasoning settings for compatible realtime models.""" + parallel_tool_calls: bool + """Whether the model may call multiple tools in parallel.""" + include: list[Union[str, "VoiceAgentSessionIncludeOption"]] + """Additional fields to include in service outputs.""" + metadata: dict[str, str] + """Up to 16 string key-value pairs attached to the session.""" + interim_response: "_unions.VoiceAgentInterimResponse" + """Interim-response settings for latency and tool execution. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type.""" + greeting: "VoiceGreetingConfig" + """A proactive assistant greeting started after session configuration.""" + + +class VoiceAgentStaticInterimResponseConfig(TypedDict, total=False): + """A static interim response selected from configured text. + + :ivar triggers: Conditions that may trigger one interim response. + :vartype triggers: list[Union[str, "VoiceAgentInterimResponseTrigger"]] + :ivar latency_threshold_ms: The latency threshold in milliseconds. + :vartype latency_threshold_ms: int + :ivar type: Required. Default value is "static_interim_response". + :vartype type: Literal["static_interim_response"] + :ivar texts: Candidate text values for the interim response. + :vartype texts: list[str] + """ + + triggers: list[Union[str, "VoiceAgentInterimResponseTrigger"]] + """Conditions that may trigger one interim response.""" + latency_threshold_ms: int + """The latency threshold in milliseconds.""" + type: Required[Literal["static_interim_response"]] + """Required. Default value is \"static_interim_response\".""" + texts: list[str] + """Candidate text values for the interim response.""" + + +class VoiceAgentTranscriptionPhrase(TypedDict, total=False): + """A transcribed phrase with timing information. + + :ivar offset_milliseconds: The phrase offset from the beginning of the audio, in milliseconds. + Required. + :vartype offset_milliseconds: int + :ivar duration_milliseconds: The phrase duration in milliseconds. Required. + :vartype duration_milliseconds: int + :ivar text: The transcribed phrase text. Required. + :vartype text: str + :ivar words: Word-level timing details, when available. + :vartype words: list["VoiceAgentTranscriptionWord"] + :ivar locale: The detected locale. + :vartype locale: str + :ivar confidence: The transcription confidence score. + :vartype confidence: float + """ + + offset_milliseconds: Required[int] + """The phrase offset from the beginning of the audio, in milliseconds. Required.""" + duration_milliseconds: Required[int] + """The phrase duration in milliseconds. Required.""" + text: Required[str] + """The transcribed phrase text. Required.""" + words: Optional[list["VoiceAgentTranscriptionWord"]] + """Word-level timing details, when available.""" + locale: Optional[str] + """The detected locale.""" + confidence: Optional[float] + """The transcription confidence score.""" + + +class VoiceAgentTranscriptionWord(TypedDict, total=False): + """A time-stamped word in an input-audio transcription. + + :ivar text: The transcribed word text. Required. + :vartype text: str + :ivar offset_milliseconds: The word offset from the beginning of the audio, in milliseconds. + Required. + :vartype offset_milliseconds: int + :ivar duration_milliseconds: The word duration in milliseconds. Required. + :vartype duration_milliseconds: int + """ + + text: Required[str] + """The transcribed word text. Required.""" + offset_milliseconds: Required[int] + """The word offset from the beginning of the audio, in milliseconds. Required.""" + duration_milliseconds: Required[int] + """The word duration in milliseconds. Required.""" + + +class VoiceAssistantMessageItem(TypedDict, total=False): + """An assistant message item. Only ``output_text`` and ``output_audio`` content are valid for + assistant messages. + + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: int + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str + :ivar type: Required. A message item. + :vartype type: Literal[VoiceConversationItemType.MESSAGE] + :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: Literal["realtime.item"] + :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: Literal["completed", "incomplete", "in_progress"] + :ivar content: The content of the message. Required. + :vartype content: list["RealtimeConversationItemMessageAssistantContent"] + :ivar role: Required. ASSISTANT. + :vartype role: Literal[RealtimeConversationItemMessageType.ASSISTANT] + """ + + created_at: int + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: str + """The id of the response that produced this item, when applicable.""" + type: Required[Literal[VoiceConversationItemType.MESSAGE]] + """Required. A message item.""" + id: str + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Literal["realtime.item"] + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + status: Literal["completed", "incomplete", "in_progress"] + """The status of the item. Has no effect on the conversation. Is one of the following types: + Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" + content: Required[list["RealtimeConversationItemMessageAssistantContent"]] + """The content of the message. Required.""" + role: Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] + """Required. ASSISTANT.""" + + +class VoiceAudioConfig(TypedDict, total=False): + """The audio configuration for a voice agent. These values are session defaults and may be + overridden when connecting. + + :ivar input: Input (microphone) audio configuration. + :vartype input: "VoiceAudioInputConfig" + :ivar output: Output (agent speech) audio configuration. + :vartype output: "VoiceAudioOutputConfig" + """ + + input: "VoiceAudioInputConfig" + """Input (microphone) audio configuration.""" + output: "VoiceAudioOutputConfig" + """Output (agent speech) audio configuration.""" + + +class VoiceAudioFormat(TypedDict, total=False): + """An audio format. Follows the OpenAI Realtime session schema; ``type`` carries the media + subtype. + + :ivar type: The audio format type, e.g. 'audio/pcm' (16-bit PCM), 'audio/pcmu' (G.711 mu-law), + or 'audio/pcma' (G.711 A-law). Required. Known values are: "audio/pcm", "audio/pcmu", and + "audio/pcma". + :vartype type: Union[str, "VoiceAudioFormatType"] + :ivar rate: The sample rate in Hz. Applies to 'audio/pcm' (e.g. 24000); omit for telephony + G.711 formats (8 kHz). + :vartype rate: int + """ + + type: Required[Union[str, "VoiceAudioFormatType"]] + """The audio format type, e.g. 'audio/pcm' (16-bit PCM), 'audio/pcmu' (G.711 mu-law), or + 'audio/pcma' (G.711 A-law). Required. Known values are: \"audio/pcm\", \"audio/pcmu\", and + \"audio/pcma\".""" + rate: int + """The sample rate in Hz. Applies to 'audio/pcm' (e.g. 24000); omit for telephony G.711 formats (8 + kHz).""" + + +class VoiceAudioInputConfig(TypedDict, total=False): + """Input audio configuration for a voice agent. + + :ivar format: The input audio format. + :vartype format: "VoiceAudioFormat" + :ivar noise_reduction: Input noise reduction. Set to null to disable. + :vartype noise_reduction: "VoiceNoiseReduction" + :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. + Is one of the following types: VoiceServerVadTurnDetection, VoiceAgentSemanticVadTurnDetection, + VoiceAzureSemanticVadTurnDetection, VoiceAzureSemanticVadEnTurnDetection, + VoiceAzureSemanticVadMultilingualTurnDetection + :vartype turn_detection: "_unions.VoiceAgentTurnDetection" + :ivar echo_cancellation: Optional server-side echo cancellation settings. + :vartype echo_cancellation: "VoiceAgentEchoCancellation" + :ivar transcription: Asynchronous input-audio transcription. Set to null to disable + transcription. + :vartype transcription: "VoiceInputTranscription" + """ + + format: "VoiceAudioFormat" + """The input audio format.""" + noise_reduction: Optional["VoiceNoiseReduction"] + """Input noise reduction. Set to null to disable.""" + turn_detection: Optional["_unions.VoiceAgentTurnDetection"] + """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. Is one of the + following types: VoiceServerVadTurnDetection, VoiceAgentSemanticVadTurnDetection, + VoiceAzureSemanticVadTurnDetection, VoiceAzureSemanticVadEnTurnDetection, + VoiceAzureSemanticVadMultilingualTurnDetection""" + echo_cancellation: Optional["VoiceAgentEchoCancellation"] + """Optional server-side echo cancellation settings.""" + transcription: Optional["VoiceInputTranscription"] + """Asynchronous input-audio transcription. Set to null to disable transcription.""" + + +class VoiceAudioOutputConfig(TypedDict, total=False): + """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. + + :ivar format: The output audio format. Applies to every ``voice_type`` and defaults to 24 kHz + PCM. + :vartype format: "VoiceAudioFormat" + :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``. The + string is extensible so future values do not require SDK type changes. + :vartype voice_type: str + :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[Union[str, "VoiceAudioTimestampType"]] + """ + + format: "VoiceAudioFormat" + """The output audio format. Applies to every ``voice_type`` and defaults to 24 kHz PCM.""" + voice: str + """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: str + """The voice implementation. Known values are ``openai``, ``azure-standard``, ``azure-custom``, + ``azure-personal``, ``avatar-voice-sync``, and ``azure-realtime-native``. The string is + extensible so future values do not require SDK type changes.""" + voice_locale: str + """The enforced BCP-47 output locale. Applies to ``azure-standard``, ``azure-custom``, + ``azure-personal``, and ``avatar-voice-sync``.""" + speed: float + """The numeric output speed multiplier. Applies to all known ``voice_type`` values and defaults to + 1.""" + voice_temperature: float + """The voice variation temperature. Applies to ``azure-standard``, ``azure-custom``, + ``azure-personal``, and ``avatar-voice-sync``.""" + custom_lexicon_url: str + """The URL of a custom pronunciation lexicon. Applies to ``azure-standard``, ``azure-custom``, + ``azure-personal``, and ``avatar-voice-sync``.""" + custom_text_normalization_url: str + """The URL of a custom text-normalization configuration. Applies to ``azure-standard``, + ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``.""" + prefer_locales: list[str] + """Preferred BCP-47 locales for multilingual synthesis. Applies to ``azure-standard``, + ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``.""" + style: str + """The voice speaking style. Applies only when ``voice_type`` is ``azure-standard``.""" + pitch: str + """The voice pitch adjustment. Applies to ``azure-standard``, ``azure-custom``, + ``azure-personal``, and ``avatar-voice-sync``.""" + volume: str + """The voice volume adjustment. Applies to ``azure-standard``, ``azure-custom``, + ``azure-personal``, and ``avatar-voice-sync``.""" + custom_voice_endpoint_id: str + """The Azure custom-voice deployment endpoint identifier. Applies only when ``voice_type`` is + ``azure-custom``.""" + personal_voice_model: str + """The Azure personal or avatar voice model. Applies only when ``voice_type`` is + ``azure-personal`` or ``avatar-voice-sync``.""" + output_audio_timestamp_types: list[Union[str, "VoiceAudioTimestampType"]] + """Timestamp kinds to include with output audio. Applies to every ``voice_type``.""" + + +class VoiceAzureSemanticVadEnTurnDetection(TypedDict, total=False): + """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: Literal[VoiceTurnDetectionType.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: str + :ivar silence_duration_ms: Silence required to end speech detection, in milliseconds. + :vartype silence_duration_ms: str + :ivar idle_timeout_ms: Maximum idle time before the detector ends the turn, in milliseconds. + :vartype idle_timeout_ms: str + :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. Set to + null to disable it. + :vartype end_of_utterance_detection: "VoiceEndOfUtteranceDetection" + :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in + milliseconds. + :vartype speech_duration_ms: str + :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 + """ + + auto_truncate: bool + """Whether the input audio buffer is truncated automatically when speech stops.""" + type: Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN]] + """Required. English-optimized Azure semantic voice activity detection.""" + threshold: float + """Activation threshold for voice activity detection, from 0 to 1.""" + prefix_padding_ms: str + """Audio to include before detected speech, in milliseconds.""" + silence_duration_ms: str + """Silence required to end speech detection, in milliseconds.""" + idle_timeout_ms: str + """Maximum idle time before the detector ends the turn, in milliseconds.""" + end_of_utterance_detection: Optional["VoiceEndOfUtteranceDetection"] + """Semantic end-of-utterance detection configuration. Set to null to disable it.""" + speech_duration_ms: str + """Minimum speech duration required to trigger detection, in milliseconds.""" + remove_filler_words: bool + """Whether filler words are removed from transcription.""" + create_response: bool + """Whether a response is created automatically when speech stops.""" + interrupt_response: bool + """Whether user speech may interrupt the agent's response.""" + + +class VoiceAzureSemanticVadMultilingualTurnDetection(TypedDict, total=False): # pylint: disable=name-too-long + """Multilingual 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. Multilingual Azure semantic voice activity detection. + :vartype type: Literal[VoiceTurnDetectionType.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: str + :ivar silence_duration_ms: Silence required to end speech detection, in milliseconds. + :vartype silence_duration_ms: str + :ivar idle_timeout_ms: Maximum idle time before the detector ends the turn, in milliseconds. + :vartype idle_timeout_ms: str + :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. Set to + null to disable it. + :vartype end_of_utterance_detection: "VoiceEndOfUtteranceDetection" + :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in + milliseconds. + :vartype speech_duration_ms: str + :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] + """ + + auto_truncate: bool + """Whether the input audio buffer is truncated automatically when speech stops.""" + type: Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL]] + """Required. Multilingual Azure semantic voice activity detection.""" + threshold: float + """Activation threshold for voice activity detection, from 0 to 1.""" + prefix_padding_ms: str + """Audio to include before detected speech, in milliseconds.""" + silence_duration_ms: str + """Silence required to end speech detection, in milliseconds.""" + idle_timeout_ms: str + """Maximum idle time before the detector ends the turn, in milliseconds.""" + end_of_utterance_detection: Optional["VoiceEndOfUtteranceDetection"] + """Semantic end-of-utterance detection configuration. Set to null to disable it.""" + speech_duration_ms: str + """Minimum speech duration required to trigger detection, in milliseconds.""" + remove_filler_words: bool + """Whether filler words are removed from transcription.""" + create_response: bool + """Whether a response is created automatically when speech stops.""" + interrupt_response: bool + """Whether user speech may interrupt the agent's response.""" + languages: list[str] + """BCP-47 language codes used for speech detection.""" + + +class VoiceAzureSemanticVadTurnDetection(TypedDict, total=False): + """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: Literal[VoiceTurnDetectionType.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: str + :ivar silence_duration_ms: Silence required to end speech detection, in milliseconds. + :vartype silence_duration_ms: str + :ivar idle_timeout_ms: Maximum idle time before the detector ends the turn, in milliseconds. + :vartype idle_timeout_ms: str + :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. Set to + null to disable it. + :vartype end_of_utterance_detection: "VoiceEndOfUtteranceDetection" + :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in + milliseconds. + :vartype speech_duration_ms: str + :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] + """ + + auto_truncate: bool + """Whether the input audio buffer is truncated automatically when speech stops.""" + type: Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD]] + """Required. Azure semantic voice activity detection.""" + threshold: float + """Activation threshold for voice activity detection, from 0 to 1.""" + prefix_padding_ms: str + """Audio to include before detected speech, in milliseconds.""" + silence_duration_ms: str + """Silence required to end speech detection, in milliseconds.""" + idle_timeout_ms: str + """Maximum idle time before the detector ends the turn, in milliseconds.""" + end_of_utterance_detection: Optional["VoiceEndOfUtteranceDetection"] + """Semantic end-of-utterance detection configuration. Set to null to disable it.""" + speech_duration_ms: str + """Minimum speech duration required to trigger detection, in milliseconds.""" + remove_filler_words: bool + """Whether filler words are removed from transcription.""" + create_response: bool + """Whether a response is created automatically when speech stops.""" + interrupt_response: bool + """Whether user speech may interrupt the agent's response.""" + languages: list[str] + """BCP-47 language codes used for speech detection.""" + + +class VoiceEndOfUtteranceDetection(TypedDict, total=False): + """Semantic end-of-utterance detection configuration. + + :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: Union[str, "VoiceEndOfUtteranceDetectionModel"] + :ivar threshold_level: The sensitivity threshold. Known values are: "low", "medium", "high", + and "default". + :vartype threshold_level: Union[str, "VoiceEndOfUtteranceThresholdLevel"] + :ivar timeout_ms: The detection timeout in milliseconds. + :vartype timeout_ms: str + """ + + model: Required[Union[str, "VoiceEndOfUtteranceDetectionModel"]] + """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: Union[str, "VoiceEndOfUtteranceThresholdLevel"] + """The sensitivity threshold. Known values are: \"low\", \"medium\", \"high\", and \"default\".""" + timeout_ms: str + """The detection timeout in milliseconds.""" + + +class VoiceFunctionCallItem(TypedDict, total=False): + """A function call request item. + + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: int + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_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: Literal["realtime.item"] + :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: Literal["completed", "incomplete", "in_progress"] + :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 type: Required. A function-call request item. + :vartype type: Literal[VoiceConversationItemType.FUNCTION_CALL] + """ + + created_at: int + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: str + """The id of the response that produced this item, when applicable.""" + id: str + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Literal["realtime.item"] + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + status: Literal["completed", "incomplete", "in_progress"] + """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 + """The ID of the function call.""" + name: Required[str] + """The name of the function being called. Required.""" + arguments: Required[str] + """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.""" + type: Required[Literal[VoiceConversationItemType.FUNCTION_CALL]] + """Required. A function-call request item.""" + + +class VoiceFunctionCallOutputItem(TypedDict, total=False): + """A function call output item. + + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: int + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_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: Literal["realtime.item"] + :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: Literal["completed", "incomplete", "in_progress"] + :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 type: Required. A function-call output item. + :vartype type: Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT] + :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 + """ + + created_at: int + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: str + """The id of the response that produced this item, when applicable.""" + id: str + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Literal["realtime.item"] + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + status: Literal["completed", "incomplete", "in_progress"] + """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: Required[str] + """The ID of the function call this output is for. Required.""" + output: Required[str] + """The output of the function call, this is free text and can contain any information or simply be + empty. Required.""" + type: Required[Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT]] + """Required. A function-call output item.""" + name: str + """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``.""" + + +class VoiceInputTranscription(TypedDict, total=False): + """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 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 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: Literal["minimal", "low", "medium", "high", "xhigh"] + :ivar model: The transcription model to use. 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: Union[str, "VoiceInputTranscriptionModel"] + :ivar custom_speech: Optional custom speech model 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] + """ + + language: str + """The language of the input audio. Supplying the input language in `ISO-639-1 + `_ (e.g. ``en``) format will improve + accuracy and latency.""" + prompt: str + """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: Literal["minimal", "low", "medium", "high", "xhigh"] + """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: Required[Union[str, "VoiceInputTranscriptionModel"]] + """The transcription model to use. 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: dict[str, str] + """Optional custom speech model configuration, keyed by locale.""" + phrase_list: list[str] + """Optional phrase hints that bias recognition toward domain terms.""" + + +class VoiceMcpApprovalRequestItem(TypedDict, total=False): + """An MCP approval request item. + + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: int + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str + :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 type: Required. An MCP approval request item. + :vartype type: Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST] + """ + + created_at: int + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: str + """The id of the response that produced this item, when applicable.""" + id: Required[str] + """The unique ID of the approval request. Required.""" + server_label: Required[str] + """The label of the MCP server making the request. Required.""" + name: Required[str] + """The name of the tool to run. Required.""" + arguments: Required[str] + """A JSON string of arguments for the tool. Required.""" + type: Required[Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST]] + """Required. An MCP approval request item.""" + + +class VoiceMcpApprovalResponseItem(TypedDict, total=False): + """An MCP approval response item (client-created). + + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: int + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str + :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 type: Required. An MCP approval response item. + :vartype type: Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE] + """ + + created_at: int + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: str + """The id of the response that produced this item, when applicable.""" + id: Required[str] + """The unique ID of the approval response. Required.""" + approval_request_id: Required[str] + """The ID of the approval request being answered. Required.""" + approve: Required[bool] + """Whether the request was approved. Required.""" + reason: Optional[str] + type: Required[Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE]] + """Required. An MCP approval response item.""" + + +class VoiceMcpCallItem(TypedDict, total=False): + """An MCP call item. + + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: int + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str + :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: "RealtimeMCPError" + :ivar type: Required. An MCP call item. + :vartype type: Literal[VoiceConversationItemType.MCP_CALL] + """ + + created_at: int + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: str + """The id of the response that produced this item, when applicable.""" + id: Required[str] + """The unique ID of the tool call. Required.""" + server_label: Required[str] + """The label of the MCP server running the tool. Required.""" + name: Required[str] + """The name of the tool that was run. Required.""" + arguments: Required[str] + """A JSON string of the arguments passed to the tool. Required.""" + approval_request_id: Optional[str] + output: Optional[str] + error: "RealtimeMCPError" + type: Required[Literal[VoiceConversationItemType.MCP_CALL]] + """Required. An MCP call item.""" + + +class VoiceMcpListToolsItem(TypedDict, total=False): + """An MCP list-tools item. + + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: int + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str + :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["MCPListToolsTool"] + :ivar type: Required. An MCP list-tools item. + :vartype type: Literal[VoiceConversationItemType.MCP_LIST_TOOLS] + """ + + created_at: int + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: str + """The id of the response that produced this item, when applicable.""" + id: str + """The unique ID of the list.""" + server_label: Required[str] + """The label of the MCP server. Required.""" + tools: Required[list["MCPListToolsTool"]] + """The tools available on the server. Required.""" + type: Required[Literal[VoiceConversationItemType.MCP_LIST_TOOLS]] + """Required. An MCP list-tools item.""" + + +class VoiceNoiseReduction(TypedDict, total=False): + """Input audio noise reduction configuration. + + :ivar type: The noise reduction mode. Required. Known values are: "near_field", "far_field", + and "azure_deep_noise_suppression". + :vartype type: Union[str, "VoiceNoiseReductionType"] + """ + + type: Required[Union[str, "VoiceNoiseReductionType"]] + """The noise reduction mode. Required. Known values are: \"near_field\", \"far_field\", and + \"azure_deep_noise_suppression\".""" + + +class VoiceResponseAudio(TypedDict, total=False): + """Audio configuration for a response. Follows the OpenAI Realtime GA ``audio`` object shape. + + :ivar output: The audio output configuration used for the response. + :vartype output: "VoiceResponseAudioOutput" + """ + + output: "VoiceResponseAudioOutput" + """The audio output configuration used for the response.""" + + +class VoiceResponseAudioOutput(TypedDict, total=False): + """The flat response audio-output projection, with optional ``voice``, ``voice_type``, + ``voice_locale``, and ``format`` fields. + + :ivar voice: The voice name used for the response's audio output. + :vartype voice: str + :ivar voice_type: The extensible provider/type of the voice used for the response's audio + output. + :vartype voice_type: str + :ivar voice_locale: The BCP-47 locale of the voice used for the response's audio output. + :vartype voice_locale: str + :ivar format: The audio format used for the response's audio output. + :vartype format: "RealtimeAudioFormats" + """ + + voice: str + """The voice name used for the response's audio output.""" + voice_type: str + """The extensible provider/type of the voice used for the response's audio output.""" + voice_locale: str + """The BCP-47 locale of the voice used for the response's audio output.""" + format: "RealtimeAudioFormats" + """The audio format used for the response's audio output.""" + + +class VoiceServerVadTurnDetection(TypedDict, total=False): + """Server-side voice activity detection. + + :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech + stops. + :vartype auto_truncate: bool + :ivar threshold: + :vartype threshold: float + :ivar prefix_padding_ms: + :vartype prefix_padding_ms: int + :ivar silence_duration_ms: + :vartype silence_duration_ms: int + :ivar create_response: + :vartype create_response: bool + :ivar interrupt_response: + :vartype interrupt_response: bool + :ivar idle_timeout_ms: + :vartype idle_timeout_ms: int + :ivar type: Required. Server-side voice activity detection. + :vartype type: Literal[VoiceTurnDetectionType.SERVER_VAD] + :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in + milliseconds. + :vartype speech_duration_ms: int + :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. Set to + null to disable it. + :vartype end_of_utterance_detection: "VoiceEndOfUtteranceDetection" + """ + + auto_truncate: bool + """Whether the input audio buffer is truncated automatically when speech stops.""" + threshold: float + prefix_padding_ms: int + silence_duration_ms: int + create_response: bool + interrupt_response: bool + idle_timeout_ms: Optional[int] + type: Required[Literal[VoiceTurnDetectionType.SERVER_VAD]] + """Required. Server-side voice activity detection.""" + speech_duration_ms: int + """Minimum speech duration required to trigger detection, in milliseconds.""" + end_of_utterance_detection: Optional["VoiceEndOfUtteranceDetection"] + """Semantic end-of-utterance detection configuration. Set to null to disable it.""" + + +class VoiceSystemMessageItem(TypedDict, total=False): + """A system message item. Only ``input_text`` content is valid for system messages. + + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: int + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str + :ivar type: Required. A message item. + :vartype type: Literal[VoiceConversationItemType.MESSAGE] + :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: Literal["realtime.item"] + :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: Literal["completed", "incomplete", "in_progress"] + :ivar content: The content of the message. Required. + :vartype content: list["RealtimeConversationItemMessageSystemContent"] + :ivar role: Required. SYSTEM. + :vartype role: Literal[RealtimeConversationItemMessageType.SYSTEM] + """ + + created_at: int + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: str + """The id of the response that produced this item, when applicable.""" + type: Required[Literal[VoiceConversationItemType.MESSAGE]] + """Required. A message item.""" + id: str + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Literal["realtime.item"] + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + status: Literal["completed", "incomplete", "in_progress"] + """The status of the item. Has no effect on the conversation. Is one of the following types: + Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" + content: Required[list["RealtimeConversationItemMessageSystemContent"]] + """The content of the message. Required.""" + role: Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] + """Required. SYSTEM.""" + + +class VoiceSystemTool(TypedDict, total=False): + """A service-managed control that acts on the active voice session without customer code or + external authentication. + + :ivar type: The type of the tool. Always ``system``. Required. Default value is "system". + :vartype type: Literal["system"] + :ivar name: The service-managed control action. Known values are stable; additional values may + be added over time. Required. "end_conversation" + :vartype name: Union[str, "VoiceSystemToolName"] + :ivar description: An optional description of the system tool. + :vartype description: str + """ + + type: Required[Literal["system"]] + """The type of the tool. Always ``system``. Required. Default value is \"system\".""" + name: Required[Union[str, "VoiceSystemToolName"]] + """The service-managed control action. Known values are stable; additional values may be added + over time. Required. \"end_conversation\"""" + description: str + """An optional description of the system tool.""" + + +class VoiceToolboxTool(TypedDict, total=False): + """A reference to a Foundry toolbox, which is a versioned bundle of tools executed through its MCP + endpoint. + + :ivar type: The type of the tool. Always ``toolbox``. Required. Default value is "toolbox". + :vartype type: Literal["toolbox"] + :ivar toolbox_name: The name of the toolbox to attach. Required. + :vartype toolbox_name: str + :ivar toolbox_version: The immutable version of the toolbox to attach. Required. + :vartype toolbox_version: str + :ivar response_scheduling: When the toolbox invocation creates a follow-up response. Defaults + to ``when_idle``. Known values are: "silent", "when_idle", "interrupt", and "skip_if_busy". + :vartype response_scheduling: Union[str, "VoiceAgentToolResponseScheduling"] + """ + + type: Required[Literal["toolbox"]] + """The type of the tool. Always ``toolbox``. Required. Default value is \"toolbox\".""" + toolbox_name: Required[str] + """The name of the toolbox to attach. Required.""" + toolbox_version: Required[str] + """The immutable version of the toolbox to attach. Required.""" + response_scheduling: Union[str, "VoiceAgentToolResponseScheduling"] + """When the toolbox invocation creates a follow-up response. Defaults to ``when_idle``. Known + values are: \"silent\", \"when_idle\", \"interrupt\", and \"skip_if_busy\".""" + + +class VoiceUserMessageItem(TypedDict, total=False): + """A user message item. ``input_text``, ``input_audio``, and ``input_image`` content are valid for + user messages. + + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: int + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str + :ivar type: Required. A message item. + :vartype type: Literal[VoiceConversationItemType.MESSAGE] + :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: Literal["realtime.item"] + :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: Literal["completed", "incomplete", "in_progress"] + :ivar content: The content of the message. Required. + :vartype content: list["RealtimeConversationItemMessageUserContent"] + :ivar role: Required. USER. + :vartype role: Literal[RealtimeConversationItemMessageType.USER] + """ + + created_at: int + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: str + """The id of the response that produced this item, when applicable.""" + type: Required[Literal[VoiceConversationItemType.MESSAGE]] + """Required. A message item.""" + id: str + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Literal["realtime.item"] + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + status: Literal["completed", "incomplete", "in_progress"] + """The status of the item. Has no effect on the conversation. Is one of the following types: + Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" + content: Required[list["RealtimeConversationItemMessageUserContent"]] + """The content of the message. Required.""" + role: Required[Literal[RealtimeConversationItemMessageType.USER]] + """Required. USER.""" + + +class WebSearchApproximateLocation(TypedDict, total=False): + """Web search approximate location. + + :ivar type: The type of location approximation. Always ``approximate``. Required. Default value + is "approximate". + :vartype type: Literal["approximate"] + :ivar country: + :vartype country: str + :ivar region: + :vartype region: str + :ivar city: + :vartype city: str + :ivar timezone: + :vartype timezone: str + """ + + type: Required[Literal["approximate"]] + """The type of location approximation. Always ``approximate``. Required. Default value is + \"approximate\".""" + country: Optional[str] + region: Optional[str] + city: Optional[str] + timezone: Optional[str] + + +class WebSearchConfiguration(TypedDict, total=False): + """A web search configuration for bing custom search. + + :ivar project_connection_id: Project connection id for grounding with bing custom search. + Required. + :vartype project_connection_id: str + :ivar instance_name: Name of the custom configuration instance given to config. Required. + :vartype instance_name: str + """ + + project_connection_id: Required[str] + """Project connection id for grounding with bing custom search. Required.""" + instance_name: Required[str] + """Name of the custom configuration instance given to config. Required.""" + + +class WebSearchPreviewTool(TypedDict, total=False): + """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: Literal[ToolType.WEB_SEARCH_PREVIEW] + :ivar user_location: + :vartype user_location: "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: Union[str, "SearchContextSize"] + :ivar search_content_types: + :vartype search_content_types: list[Union[str, "SearchContentType"]] + """ + + type: Required[Literal[ToolType.WEB_SEARCH_PREVIEW]] + """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["ApproximateLocation"] + search_context_size: Union[str, "SearchContextSize"] + """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: list[Union[str, "SearchContentType"]] + + +class WebSearchTool(TypedDict, total=False): + """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: Literal[ToolType.WEB_SEARCH] + :ivar filters: + :vartype filters: "WebSearchToolFilters" + :ivar user_location: + :vartype user_location: "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: Literal["low", "medium", "high"] + :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, "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: "WebSearchConfiguration" + """ + + type: Required[Literal[ToolType.WEB_SEARCH]] + """The type of the web search tool. One of ``web_search`` or ``web_search_2025_08_26``. Required. + WEB_SEARCH.""" + filters: Optional["WebSearchToolFilters"] + user_location: Optional["WebSearchApproximateLocation"] + search_context_size: Literal["low", "medium", "high"] + """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: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + description: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + tool_configs: dict[str, "ToolConfig"] + """Deprecated. This property is deprecated and will be removed in a future version.""" + custom_search_configuration: "WebSearchConfiguration" + """The project connections attached to this tool. There can be a maximum of 1 connection resource + attached to the tool.""" + + +class WebSearchToolboxTool(TypedDict, total=False): + """A web 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, "ToolConfig"] + :ivar type: Required. WEB_SEARCH. + :vartype type: Literal[ToolboxToolType.WEB_SEARCH] + :ivar filters: + :vartype filters: "WebSearchToolFilters" + :ivar user_location: + :vartype user_location: "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: Literal["low", "medium", "high"] + :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: "WebSearchConfiguration" + """ + + name: str + """Optional user-defined name for this tool or configuration.""" + description: str + """Optional user-defined description for this tool or configuration.""" + tool_configs: dict[str, "ToolConfig"] + """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.""" + type: Required[Literal[ToolboxToolType.WEB_SEARCH]] + """Required. WEB_SEARCH.""" + filters: Optional["WebSearchToolFilters"] + user_location: Optional["WebSearchApproximateLocation"] + search_context_size: Literal["low", "medium", "high"] + """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\"]""" + custom_search_configuration: "WebSearchConfiguration" + """The project connections attached to this tool. There can be a maximum of 1 connection resource + attached to the tool.""" + + +class WebSearchToolFilters(TypedDict, total=False): + """WebSearchToolFilters. + + :ivar allowed_domains: + :vartype allowed_domains: list[str] + """ + + allowed_domains: Optional[list[str]] + + +class WeeklyRecurrenceSchedule(TypedDict, total=False): + """Weekly recurrence schedule. + + :ivar type: Weekly recurrence type. Required. Weekly recurrence pattern. + :vartype type: Literal[RecurrenceType.WEEKLY] + :ivar daysOfWeek: Days of the week for the recurrence schedule. Required. + :vartype daysOfWeek: list[Union[str, "DayOfWeek"]] + """ + + type: Required[Literal[RecurrenceType.WEEKLY]] + """Weekly recurrence type. Required. Weekly recurrence pattern.""" + daysOfWeek: Required[list[Union[str, "DayOfWeek"]]] + """Days of the week for the recurrence schedule. Required.""" + + +class WorkflowAgentDefinition(TypedDict, total=False): + """The workflow agent definition. + + :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. + :vartype rai_config: "RaiConfig" + :ivar kind: Required. WORKFLOW. + :vartype kind: Literal[AgentKind.WORKFLOW] + :ivar workflow: The CSDL YAML definition of the workflow. + :vartype workflow: str + """ + + rai_config: "RaiConfig" + """Configuration for Responsible AI (RAI) content filtering and safety features.""" + kind: Required[Literal[AgentKind.WORKFLOW]] + """Required. WORKFLOW.""" + workflow: str + """The CSDL YAML definition of the workflow.""" + + +class WorkIQPreviewTool(TypedDict, total=False): + """A WorkIQ server-side tool. + + :ivar type: The object type, which is always 'work_iq_preview'. Required. WORK_IQ_PREVIEW. + :vartype type: Literal[ToolType.WORK_IQ_PREVIEW] + :ivar project_connection_id: The ID of the WorkIQ project connection. Required. + :vartype project_connection_id: str + """ + + type: Required[Literal[ToolType.WORK_IQ_PREVIEW]] + """The object type, which is always 'work_iq_preview'. Required. WORK_IQ_PREVIEW.""" + project_connection_id: Required[str] + """The ID of the WorkIQ project connection. Required.""" + + +class WorkIQPreviewToolboxTool(TypedDict, total=False): + """A WorkIQ 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, "ToolConfig"] + :ivar type: Required. WORK_IQ_PREVIEW. + :vartype type: Literal[ToolboxToolType.WORK_IQ_PREVIEW] + :ivar project_connection_id: The ID of the WorkIQ project connection. Required. + :vartype project_connection_id: str + """ + + name: str + """Optional user-defined name for this tool or configuration.""" + description: str + """Optional user-defined description for this tool or configuration.""" + tool_configs: dict[str, "ToolConfig"] + """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.""" + type: Required[Literal[ToolboxToolType.WORK_IQ_PREVIEW]] + """Required. WORK_IQ_PREVIEW.""" + project_connection_id: Required[str] + """The ID of the WorkIQ project connection. Required.""" + + +class CreateMemoryStoreRequest(TypedDict, total=False): + """CreateMemoryStoreRequest. + + :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 memory store definition. Required. + :vartype definition: "MemoryStoreDefinition" + """ + + name: Required[str] + """The name of the memory store. Required.""" + description: str + """A human-readable description of the memory store.""" + metadata: dict[str, str] + """Arbitrary key-value metadata to associate with the memory store.""" + definition: Required["MemoryStoreDefinition"] + """The memory store definition. Required.""" + + +class UpdateMemoryStoreRequest(TypedDict, total=False): + """UpdateMemoryStoreRequest. + + :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] + """ + + description: str + """A human-readable description of the memory store.""" + metadata: dict[str, str] + """Arbitrary key-value metadata to associate with the memory store.""" + + +class SearchMemoriesRequest(TypedDict, total=False): + """SearchMemoriesRequest. + + :ivar scope: The namespace that logically groups and isolates memories, such as a user ID. + Required. + :vartype scope: str + :ivar items: Items for which to search for relevant memories. + :vartype items: list[dict[str, Any]] + :ivar previous_search_id: The unique ID of the previous search request, enabling incremental + memory search from where the last operation left off. + :vartype previous_search_id: str + :ivar options: Memory search options. + :vartype options: "MemorySearchOptions" + """ + + scope: Required[str] + """The namespace that logically groups and isolates memories, such as a user ID. Required.""" + items: list[dict[str, Any]] + """Items for which to search for relevant memories.""" + previous_search_id: str + """The unique ID of the previous search request, enabling incremental memory search from where the + last operation left off.""" + options: "MemorySearchOptions" + """Memory search options.""" + + +class UpdateMemoriesRequest(TypedDict, total=False): + """UpdateMemoriesRequest. + + :ivar scope: The namespace that logically groups and isolates memories, such as a user ID. + Required. + :vartype scope: str + :ivar items: Conversation items to be stored in memory. + :vartype items: list[dict[str, Any]] + :ivar previous_update_id: The unique ID of the previous update request, enabling incremental + memory updates from where the last operation left off. + :vartype previous_update_id: str + :ivar update_delay: Timeout period before processing the memory update in seconds. If a new + update request is received during this period, it will cancel the current request and reset the + timeout. Set to 0 to immediately trigger the update without delay. Defaults to 300 (5 minutes). + :vartype update_delay: int + """ + + scope: Required[str] + """The namespace that logically groups and isolates memories, such as a user ID. Required.""" + items: list[dict[str, Any]] + """Conversation items to be stored in memory.""" + previous_update_id: str + """The unique ID of the previous update request, enabling incremental memory updates from where + the last operation left off.""" + update_delay: int + """Timeout period before processing the memory update in seconds. If a new update request is + received during this period, it will cancel the current request and reset the timeout. Set to 0 + to immediately trigger the update without delay. Defaults to 300 (5 minutes).""" + + +class DeleteScopeRequest(TypedDict, total=False): + """DeleteScopeRequest. + + :ivar scope: The namespace that logically groups and isolates memories to delete, such as a + user ID. Required. + :vartype scope: str + """ + + scope: Required[str] + """The namespace that logically groups and isolates memories to delete, such as a user ID. + Required.""" + + +class CreateMemoryRequest(TypedDict, total=False): + """CreateMemoryRequest. + + :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. Known values are: "user_profile", + "chat_summary", and "procedural". + :vartype kind: Union[str, "MemoryItemKind"] + """ + + scope: Required[str] + """The namespace that logically groups and isolates memories, such as a user ID. Required.""" + content: Required[str] + """The content of the memory. Required.""" + kind: Required[Union[str, "MemoryItemKind"]] + """The kind of the memory item. Required. Known values are: \"user_profile\", \"chat_summary\", + and \"procedural\".""" + + +class UpdateMemoryRequest(TypedDict, total=False): + """UpdateMemoryRequest. + + :ivar content: The updated content of the memory. Required. + :vartype content: str + """ + + content: Required[str] + """The updated content of the memory. Required.""" + + +class ListMemoriesRequest(TypedDict, total=False): + """ListMemoriesRequest. + + :ivar scope: The namespace that logically groups and isolates memories, such as a user ID. + Required. + :vartype scope: str + """ + + scope: Required[str] + """The namespace that logically groups and isolates memories, such as a user ID. Required.""" + + +class CreateOrUpdateRoutineRequest(TypedDict, total=False): + """CreateOrUpdateRoutineRequest. + + :ivar description: A human-readable description of the routine. + :vartype description: str + :ivar enabled: Whether the routine is enabled. + :vartype enabled: bool + :ivar triggers: The triggers configured for the routine. In v1, exactly one trigger entry is + supported. + :vartype triggers: dict[str, "RoutineTrigger"] + :ivar action: The action executed when the routine fires. + :vartype action: "RoutineAction" + """ + + description: str + """A human-readable description of the routine.""" + enabled: bool + """Whether the routine is enabled.""" + triggers: dict[str, "RoutineTrigger"] + """The triggers configured for the routine. In v1, exactly one trigger entry is supported.""" + action: "RoutineAction" + """The action executed when the routine fires.""" + + +class DispatchRoutineAsyncRequest(TypedDict, total=False): + """DispatchRoutineAsyncRequest. + + :ivar payload: A direct action-input override sent downstream when testing a routine. + :vartype payload: "RoutineDispatchPayload" + """ + + payload: "RoutineDispatchPayload" + """A direct action-input override sent downstream when testing a routine.""" + + +class UpdateSkillRequest(TypedDict, total=False): + """UpdateSkillRequest. + + :ivar default_version: The version identifier that the skill should point to. When set, the + skill's default version will resolve to this version instead of the latest. Required. + :vartype default_version: str + """ + + default_version: Required[str] + """The version identifier that the skill should point to. When set, the skill's default version + will resolve to this version instead of the latest. Required.""" + + +class CreateSkillVersionRequest(TypedDict, total=False): + """CreateSkillVersionRequest. + + :ivar inline_content: Inline skill content for simple skills without file uploads. + Foundry-specific extension. + :vartype inline_content: "SkillInlineContent" + :ivar default: Whether to set this version as the default. + :vartype default: bool + """ + + inline_content: "SkillInlineContent" + """Inline skill content for simple skills without file uploads. Foundry-specific extension.""" + default: bool + """Whether to set this version as the default.""" + + +class GenerateAgentRequest(TypedDict, total=False): + """GenerateAgentRequest. + + :ivar kind: The kind of agent to generate. Required. Known values are: "prompt", "hosted", + "workflow", "external", and "voice". + :vartype kind: Union[str, "AgentKind"] + """ + + kind: Required[Union[str, "AgentKind"]] + """The kind of agent to generate. Required. Known values are: \"prompt\", \"hosted\", + \"workflow\", \"external\", and \"voice\".""" + + +class CreateAgentVersionRequest(TypedDict, total=False): + """CreateAgentVersionRequest. + + :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. + :vartype metadata: dict[str, str] + :ivar description: A human-readable description of the agent. + :vartype description: str + :ivar definition: The agent definition. This can be a prompt, workflow, hosted, external, or + voice agent definition. Required. + :vartype definition: "AgentDefinition" + :ivar blueprint_reference: The blueprint reference for the agent. + :vartype blueprint_reference: "AgentBlueprintReference" + :ivar draft: (Preview) Whether this agent version is a draft (candidate) rather than a release. + The service defaults to ``false`` if a value is not specified by the caller. Draft versions are + recorded but excluded from default 'latest' resolution and are not auto-promoted. + :vartype draft: bool + """ + + metadata: dict[str, str] + """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.""" + description: str + """A human-readable description of the agent.""" + definition: Required["AgentDefinition"] + """The agent definition. This can be a prompt, workflow, hosted, external, or voice agent + definition. Required.""" + blueprint_reference: "AgentBlueprintReference" + """The blueprint reference for the agent.""" + draft: bool + """(Preview) Whether this agent version is a draft (candidate) rather than a release. The service + defaults to ``false`` if a value is not specified by the caller. Draft versions are recorded + but excluded from default 'latest' resolution and are not auto-promoted.""" + + +class CreateAgentVersionFromManifestRequest(TypedDict, total=False): + """CreateAgentVersionFromManifestRequest. + + :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. + :vartype metadata: dict[str, str] + :ivar description: A human-readable description of the agent. + :vartype description: str + :ivar manifest_id: The manifest ID to import the agent version from. Required. + :vartype manifest_id: str + :ivar parameter_values: The inputs to the manifest that will result in a fully materialized + Agent. Required. + :vartype parameter_values: dict[str, Any] + """ + + metadata: dict[str, str] + """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.""" + description: str + """A human-readable description of the agent.""" + manifest_id: Required[str] + """The manifest ID to import the agent version from. Required.""" + parameter_values: Required[dict[str, Any]] + """The inputs to the manifest that will result in a fully materialized Agent. Required.""" + + +class PatchAgentObjectRequest(TypedDict, total=False): + """PatchAgentObjectRequest. + + :ivar agent_endpoint: The endpoint configuration for the agent. + :vartype agent_endpoint: "AgentEndpointConfig" + :ivar agent_card: Optional agent card for the agent. + :vartype agent_card: "AgentCard" + """ + + agent_endpoint: "AgentEndpointConfig" + """The endpoint configuration for the agent.""" + agent_card: "AgentCard" + """Optional agent card for the agent.""" + + +class CreateSessionRequest(TypedDict, total=False): + """CreateSessionRequest. + + :ivar agent_session_id: Optional caller-provided session ID. If specified, it must be unique + within the agent endpoint. Auto-generated if omitted. + :vartype agent_session_id: str + :ivar version_indicator: Determines which agent version backs the session. Required. + :vartype version_indicator: "VersionIndicator" + """ + + agent_session_id: str + """Optional caller-provided session ID. If specified, it must be unique within the agent endpoint. + Auto-generated if omitted.""" + version_indicator: Required["VersionIndicator"] + """Determines which agent version backs the session. Required.""" + + +class CreateToolboxVersionRequest(TypedDict, total=False): + """CreateToolboxVersionRequest. + + :ivar description: A human-readable description of the toolbox. + :vartype description: str + :ivar metadata: Arbitrary key-value metadata to associate with the toolbox. + :vartype metadata: dict[str, str] + :ivar tools: The list of tools to include in this version. Required. + :vartype tools: list["ToolboxTool"] + :ivar skills: The list of skill sources to include in this version. A skill reference specifies + a skill name and optionally a version. If version is omitted, the skill's default version is + used. + :vartype skills: list["ToolboxSkill"] + :ivar policies: Policy configuration for this toolbox version. + :vartype policies: "ToolboxPolicies" + """ + + description: str + """A human-readable description of the toolbox.""" + metadata: dict[str, str] + """Arbitrary key-value metadata to associate with the toolbox.""" + tools: Required[list["ToolboxTool"]] + """The list of tools to include in this version. Required.""" + skills: list["ToolboxSkill"] + """The list of skill sources to include in this version. A skill reference specifies a skill name + and optionally a version. If version is omitted, the skill's default version is used.""" + policies: "ToolboxPolicies" + """Policy configuration for this toolbox version.""" + + +class UpdateToolboxRequest1(TypedDict, total=False): + """UpdateToolboxRequest1. + + :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 + """ + + default_version: Required[str] + """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.""" + + +Tool = Union[ + A2APreviewTool, + ApplyPatchToolParam, + AzureAISearchTool, + AzureFunctionTool, + BingCustomSearchPreviewTool, + BingGroundingTool, + BrowserAutomationPreviewTool, + CaptureStructuredOutputsTool, + CodeInterpreterTool, + ComputerTool, + ComputerUsePreviewTool, + CustomToolParam, + MicrosoftFabricPreviewTool, + FabricIQPreviewTool, + FileSearchTool, + FunctionTool, + ImageGenTool, + LocalShellToolParam, + MCPTool, + MemorySearchPreviewTool, + NamespaceToolParam, + OpenApiTool, + ProgrammaticToolCallingParam, + SharepointPreviewTool, + FunctionShellToolParam, + ToolSearchToolParam, + WebSearchTool, + WebSearchPreviewTool, + WorkIQPreviewTool, +] +ToolboxTool = Union[ + A2APreviewToolboxTool, + AzureAISearchToolboxTool, + BrowserAutomationPreviewToolboxTool, + CodeInterpreterToolboxTool, + FabricIQPreviewToolboxTool, + FileSearchToolboxTool, + MCPToolboxTool, + OpenApiToolboxTool, + ReminderPreviewToolboxTool, + ToolSearchToolboxTool, + ToolboxSearchPreviewToolboxTool, + WebSearchToolboxTool, + WorkIQPreviewToolboxTool, +] +AgentBlueprintReference = Union[ManagedAgentIdentityBlueprintReference] +InsightRequest = Union[ + AgentClusterInsightRequest, EvaluationComparisonInsightRequest, EvaluationRunClusterInsightRequest +] +InsightResult = Union[AgentClusterInsightResult, EvaluationComparisonInsightResult, EvaluationRunClusterInsightResult] +DataGenerationJobSource = Union[ + AgentDataGenerationJobSource, + FileDataGenerationJobSource, + PromptDataGenerationJobSource, + TracesDataGenerationJobSource, +] +AgentDefinition = Union[ + ExternalAgentDefinition, HostedAgentDefinition, PromptAgentDefinition, VoiceAgentDefinition, WorkflowAgentDefinition +] +AgentEndpointAuthorizationScheme = Union[ + BotServiceAuthorizationScheme, + BotServiceRbacAuthorizationScheme, + BotServiceTenantAuthorizationScheme, + EntraAuthorizationScheme, +] +EvaluatorGenerationJobSource = Union[ + AgentEvaluatorGenerationJobSource, + DatasetEvaluatorGenerationJobSource, + PromptEvaluatorGenerationJobSource, + TracesEvaluatorGenerationJobSource, +] +AgentOptimizationDatasetInput = Union[AgentOptimizationInlineDatasetInput, AgentOptimizationReferenceDatasetInput] +EvaluationTaxonomyInput = Union[AgentTaxonomyInput] +EvaluationTarget = Union[AzureAIAgentTarget, AzureAIModelTarget] +Index = Union[AzureAISearchIndex, CosmosDBIndex, ManagedAzureAISearchIndex] +RedTeamTargetConfig = Union[AzureOpenAIModelConfiguration] +EvaluatorDefinition = Union[ + CodeBasedEvaluatorDefinition, + EndpointBasedEvaluatorDefinition, + PromptBasedEvaluatorDefinition, + RubricBasedEvaluatorDefinition, +] +FunctionShellToolParamEnvironment = Union[ + ContainerAutoParam, + FunctionShellToolParamEnvironmentContainerReferenceParam, + FunctionShellToolParamEnvironmentLocalEnvironmentParam, +] +ContainerNetworkPolicyParam = Union[ContainerNetworkPolicyAllowlistParam, ContainerNetworkPolicyDisabledParam] +ContainerSkill = Union[InlineSkillParam, SkillReferenceParam] +EvaluationRuleAction = Union[ContinuousEvaluationRuleAction, HumanEvaluationPreviewRuleAction] +CreateTranscriptionResponseJsonUsage = Union[TranscriptTextUsageDuration, TranscriptTextUsageTokens] +Trigger = Union[CronTrigger, OneTimeTrigger, RecurrenceTrigger] +CustomToolParamFormat = Union[CustomGrammarFormatParam, CustomTextFormatParam] +RoutineTrigger = Union[CustomRoutineTrigger, GitHubIssueRoutineTrigger, ScheduleRoutineTrigger, TimerRoutineTrigger] +RecurrenceSchedule = Union[ + DailyRecurrenceSchedule, HourlyRecurrenceSchedule, MonthlyRecurrenceSchedule, WeeklyRecurrenceSchedule +] +DataGenerationJobOptions = Union[ + SimpleQnADataGenerationJobOptions, + TaskGenerationDataGenerationJobOptions, + ToolUseFineTuningDataGenerationJobOptions, + TracesDataGenerationJobOptions, +] +DataGenerationJobOutput = Union[DatasetDataGenerationJobOutput, FileDataGenerationJobOutput] +DatasetVersion = Union[FileDatasetVersion, FolderDatasetVersion] +InsightSample = Union[EvaluationResultSample] +ScheduleTask = Union[EvaluationScheduleTask, InsightScheduleTask] +VersionSelectionRule = Union[FixedRatioVersionSelectionRule] +TelemetryEndpointAuth = Union[HeaderTelemetryEndpointAuth] +RoutineDispatchPayload = Union[InvokeAgentInvocationsApiDispatchPayload, InvokeAgentResponsesApiDispatchPayload] +RoutineAction = Union[InvokeAgentInvocationsApiRoutineAction, InvokeAgentResponsesApiRoutineAction] +VoiceGreetingConfig = Union[LlmGeneratedVoiceGreetingConfig, TemplateVoiceGreetingConfig] +MemoryStoreDefinition = Union[MemoryStoreDefaultDefinition] +OpenApiAuthDetails = Union[OpenApiAnonymousAuthDetails, OpenApiManagedAuthDetails, OpenApiProjectConnectionAuthDetails] +TelemetryEndpoint = Union[OtlpTelemetryEndpoint] +RealtimeAudioFormats = Union[RealtimeAudioFormatsAudioPcm, RealtimeAudioFormatsAudioPcma, RealtimeAudioFormatsAudioPcmu] +RealtimeConversationItem = Union[ + RealtimeConversationItemFunctionCall, + RealtimeConversationItemFunctionCallOutput, + RealtimeMCPApprovalRequest, + RealtimeMCPApprovalResponse, + RealtimeMCPToolCall, + RealtimeMCPListTools, +] +RealtimeConversationItemMessage = Union[ + RealtimeConversationItemMessageAssistant, RealtimeConversationItemMessageSystem, RealtimeConversationItemMessageUser +] +RealtimeMCPError = Union[RealtimeMCPHTTPError, RealtimeMCPProtocolError, RealtimeMCPToolExecutionError] +RealtimeServerEvent = Union[RealtimeServerEventResponseContentPartAdded] +ToolChoiceParam = Union[ + ToolChoiceAllowed, + SpecificApplyPatchParam, + ToolChoiceCodeInterpreter, + ToolChoiceComputer, + ToolChoiceComputerUse, + ToolChoiceComputerUsePreview, + ToolChoiceCustom, + ToolChoiceFileSearch, + ToolChoiceFunction, + ToolChoiceImageGeneration, + ToolChoiceMCP, + SpecificProgrammaticToolCallingParam, + SpecificFunctionShellParam, + ToolChoiceWebSearchPreview, + ToolChoiceWebSearchPreview20250311, +] +TextResponseFormat = Union[TextResponseFormatJsonObject, TextResponseFormatJsonSchema, TextResponseFormatText] +ToolboxSkill = Union[ToolboxSkillReference] +VersionIndicator = Union[VersionRefIndicator] +VoiceAgentTool = Union[VoiceAgentFunctionTool, VoiceAgentMcpTool, VoiceSystemTool, VoiceToolboxTool] +VoiceAgentInterimResponseConfig = Union[VoiceAgentLlmInterimResponseConfig, VoiceAgentStaticInterimResponseConfig] +VoiceTurnDetection = Union[ + VoiceAzureSemanticVadTurnDetection, + VoiceAzureSemanticVadEnTurnDetection, + VoiceAzureSemanticVadMultilingualTurnDetection, + VoiceAgentSemanticVadTurnDetection, + VoiceServerVadTurnDetection, +] +VoiceMessageItem = Union[VoiceAssistantMessageItem, VoiceSystemMessageItem, VoiceUserMessageItem] +VoiceConversationItem = Union[ + VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, + VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem, + VoiceMcpCallItem, + VoiceMcpListToolsItem, + VoiceMessageItem, +] diff --git a/sdk/ai/azure-ai-projects/docs/public-methods.md b/sdk/ai/azure-ai-projects/docs/public-methods.md index 66716e015430..bcf47e462f86 100644 --- a/sdk/ai/azure-ai-projects/docs/public-methods.md +++ b/sdk/ai/azure-ai-projects/docs/public-methods.md @@ -4,9 +4,9 @@ This document lists all public methods available on `AIProjectClient` and its su ## Summary -There are a total of 141 unique public methods: +There are a total of 154 unique public methods: - 5 stable methods on the client -- 55 stable methods on top-level sub-clients +- 68 stable methods on top-level sub-clients - 81 beta methods on nested beta sub-clients ### Top-level sub-clients (stable operations) @@ -14,6 +14,7 @@ There are a total of 141 unique public methods: | Subclient | Class Name | Methods Count | |-----------|------------|----------------| | `agents` | AgentsOperations | 23 | +| `agent_endpoint_conversations` | AgentEndpointConversationsOperations | 12 | | `connections` | ConnectionsOperations | 3 | | `datasets` | DatasetsOperations | 9 | | `deployments` | DeploymentsOperations | 2 | @@ -21,6 +22,7 @@ There are a total of 141 unique public methods: | `indexes` | IndexesOperations | 5 | | `telemetry` | TelemetryOperations | 1 | | `toolboxes` | ToolboxesOperations | 8 | +| `voice_agent_web_socket` | VoiceAgentWebSocketOperations | 1 | ### Nested sub-clients (beta operations) @@ -80,6 +82,19 @@ Alphabetically sorted. An asterisk at the end of the method name means is a hand .agents.update_details .agents.upload_session_file +.agent_endpoint_conversations.delete_agent_conversation +.agent_endpoint_conversations.get_agent_conversation +.agent_endpoint_conversations.get_agent_conversation_audio +.agent_endpoint_conversations.get_agent_conversation_audio_content +.agent_endpoint_conversations.get_agent_conversation_item +.agent_endpoint_conversations.get_agent_conversation_item_audio +.agent_endpoint_conversations.get_agent_conversation_item_audio_content +.agent_endpoint_conversations.get_agent_conversation_response +.agent_endpoint_conversations.list_agent_conversation_items +.agent_endpoint_conversations.list_agent_conversation_response_items +.agent_endpoint_conversations.list_agent_conversation_responses +.agent_endpoint_conversations.list_agent_conversations + .connections.get* .connections.get_default* .connections.list @@ -118,6 +133,8 @@ Alphabetically sorted. An asterisk at the end of the method name means is a hand .toolboxes.list .toolboxes.list_versions .toolboxes.update + +.voice_agent_web_socket.connect_voice_agent ``` ## Beta methods on nested sub-clients diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_basic.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_basic.py new file mode 100644 index 000000000000..52685986f538 --- /dev/null +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_basic.py @@ -0,0 +1,104 @@ +# pylint: disable=line-too-long,useless-suppression +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +""" +DESCRIPTION: + This sample demonstrates the voice-agent management lifecycle using the + unified Agents API in the Microsoft Foundry Python SDK (azure-ai-projects): + creating a voice agent (with an audio/voice configuration and conversation + storage enabled), retrieving it, listing the voice agents in the project, + creating a new version, disabling/enabling it, and deleting it. + + Voice agents are exposed through `project_client.agents` with + `kind="voice"`, the same surface used for prompt, workflow, hosted, and + external agents. + +USAGE: + python sample_voice_agent_basic.py + + Before running the sample: + + pip install "azure-ai-projects>=2.0.0" python-dotenv + + Set these environment variables with your own values: + 1) FOUNDRY_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview + page of your Microsoft Foundry portal. + 2) FOUNDRY_VOICE_MODEL - Optional. The realtime model deployment name. + Defaults to "gpt-realtime". + 3) FOUNDRY_VOICE_AGENT_NAME - Optional. The name of the voice agent. If not + set, defaults to "MyVoiceAgent". +""" + +import os +from dotenv import load_dotenv +from azure.identity import DefaultAzureCredential +from azure.ai.projects import AIProjectClient +from azure.ai.projects.models import ( + VoiceAgentDefinition, + VoiceAudioConfig, + VoiceAudioOutputConfig, + VoiceOutputModality, +) + +load_dotenv() + +endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] +model = os.environ.get("FOUNDRY_VOICE_MODEL") or "gpt-realtime" +agent_name = os.environ.get("FOUNDRY_VOICE_AGENT_NAME") or "MyVoiceAgent" + +with ( + DefaultAzureCredential() as credential, + AIProjectClient(endpoint=endpoint, credential=credential) as project_client, +): + try: + definition = VoiceAgentDefinition( + # `managed` uses a service-hosted model; use `self_deployed` with a Foundry + # deployment name to bring your own model. + model_type="managed", + model=model, + instructions="You are a friendly voice assistant. Keep replies short and natural.", + audio=VoiceAudioConfig( + output=VoiceAudioOutputConfig(voice="en-US-AvaNeural", voice_type="azure-standard"), + ), + output_modalities=[VoiceOutputModality.AUDIO], + # Persist conversations so the transcript and audio can be read back later + # (see sample_voice_agent_read_conversation.py). Defaults to False, which stores nothing. + store=True, + ) + + created_version = project_client.agents.create_version(agent_name=agent_name, definition=definition) + print(f"Created voice agent '{agent_name}', version: {created_version.version}") + + agent = project_client.agents.get(agent_name=agent_name) + print(f"Retrieved voice agent: {agent.name} (state={agent.state})") + + print("Voice agents in this project:") + for item in project_client.agents.list(kind="voice"): + print(f" - {item.name}") + + # Each update produces a new immutable version. + updated_version = project_client.agents.create_version( + agent_name=agent_name, + definition=VoiceAgentDefinition( + model_type="managed", + model=model, + instructions="You are a friendly voice assistant. Always greet the caller warmly.", + audio=definition.audio, + output_modalities=definition.output_modalities, + store=definition.store, + ), + description="Updated instructions.", + ) + print(f"Updated voice agent to version: {updated_version.version}") + + # Disable the agent so its endpoint rejects new requests, then re-enable it. + project_client.agents.disable(agent_name=agent_name) + print("Disabled voice agent") + project_client.agents.enable(agent_name=agent_name) + print("Enabled voice agent") + finally: + project_client.agents.delete(agent_name=agent_name) + print(f"Deleted voice agent: {agent_name}") diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_basic_async.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_basic_async.py new file mode 100644 index 000000000000..28aee34389f3 --- /dev/null +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_basic_async.py @@ -0,0 +1,73 @@ +# pylint: disable=line-too-long,useless-suppression +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +""" +DESCRIPTION: + This sample demonstrates the voice-agent management lifecycle using the + asynchronous AIProjectClient: creating a voice agent, retrieving it, + listing the voice agents in the project, and deleting it. + +USAGE: + python sample_voice_agent_basic_async.py + + Before running the sample: + + pip install "azure-ai-projects>=2.0.0" aiohttp python-dotenv + + Set these environment variables with your own values: + 1) FOUNDRY_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview + page of your Microsoft Foundry portal. + 2) FOUNDRY_VOICE_MODEL - Optional. The realtime model deployment name. + Defaults to "gpt-realtime". + 3) FOUNDRY_VOICE_AGENT_NAME - Optional. The name of the voice agent. If not + set, defaults to "MyVoiceAgentAsync". +""" + +import asyncio +import os +from dotenv import load_dotenv +from azure.identity.aio import DefaultAzureCredential +from azure.ai.projects.aio import AIProjectClient +from azure.ai.projects.models import VoiceAgentDefinition + +load_dotenv() + + +async def main() -> None: + endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] + model = os.environ.get("FOUNDRY_VOICE_MODEL") or "gpt-realtime" + agent_name = os.environ.get("FOUNDRY_VOICE_AGENT_NAME") or "MyVoiceAgentAsync" + + async with ( + DefaultAzureCredential() as credential, + AIProjectClient(endpoint=endpoint, credential=credential) as project_client, + ): + try: + created_version = await project_client.agents.create_version( + agent_name=agent_name, + definition=VoiceAgentDefinition( + model_type="managed", + model=model, + instructions="You are a friendly voice assistant. Keep replies short and natural.", + # Persist conversations so they can be read back later. Defaults to False. + store=True, + ), + ) + print(f"Created voice agent '{agent_name}', version: {created_version.version}") + + agent = await project_client.agents.get(agent_name=agent_name) + print(f"Retrieved voice agent: {agent.name}") + + print("Voice agents in this project:") + async for item in project_client.agents.list(kind="voice"): + print(f" - {item.name}") + finally: + await project_client.agents.delete(agent_name=agent_name) + print(f"Deleted voice agent: {agent_name}") + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_generate.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_generate.py new file mode 100644 index 000000000000..6c3e9faf9f6f --- /dev/null +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_generate.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +""" +DESCRIPTION: + This sample demonstrates guided authoring: generating and creating a voice + agent through `POST /agents:generate` (`project_client.agents.generate_agent`) + with `kind="voice"`. The service creates a voice agent with a + service-selected starter definition, which is fully editable afterward + through the standard create_version/update flow. + +USAGE: + python sample_voice_agent_generate.py + + Before running the sample: + + pip install "azure-ai-projects>=2.0.0" python-dotenv + + Set this environment variable with your own value: + 1) FOUNDRY_PROJECT_ENDPOINT - The Azure AI Project endpoint. +""" + +import os +from dotenv import load_dotenv +from azure.identity import DefaultAzureCredential +from azure.ai.projects import AIProjectClient + +load_dotenv() + +endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] + +with ( + DefaultAzureCredential() as credential, + AIProjectClient(endpoint=endpoint, credential=credential) as project_client, +): + agent = project_client.agents.generate_agent(kind="voice") + print(f"Generated voice agent: {agent.name}") + print(f"Instructions:\n{agent.versions.latest.definition.instructions}") # type: ignore[union-attr] + + project_client.agents.delete(agent_name=agent.name) + print(f"Deleted voice agent: {agent.name}") diff --git a/sdk/voiceagents/azure-ai-voiceagents/samples/live/sample_live_audio_conversation_async.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py similarity index 79% rename from sdk/voiceagents/azure-ai-voiceagents/samples/live/sample_live_audio_conversation_async.py rename to sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py index a6db0f95eb7e..4aea0c2630b9 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/samples/live/sample_live_audio_conversation_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py @@ -1,42 +1,43 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------- +# pylint: disable=line-too-long,useless-suppression +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ """ -FILE: sample_live_audio_conversation_async.py - DESCRIPTION: - End-to-end hands-free, bidirectional voice conversation against an existing - voice agent, using only azure-ai-voiceagents, through the native - ``client.realtime.connect(...)`` API. + End-to-end hands-free, bidirectional voice conversation against an + existing voice agent, using the ``client.realtime`` namespace added on top + of the generated azure-ai-projects client (see + ``azure.ai.projects.aio.AsyncRealtime``). This mirrors the ergonomics of + the OpenAI Python realtime client. 1. Stream live mic audio and let the agent's server-side VAD detect your turns: your speech is transcribed, the agent replies through the speakers, and talking over it barges in. 2. Read the persisted conversation back (requires the agent to have been - created with ``store=True``; see sample_create_and_manage_voice_agent.py). + created with `store=True`; see sample_voice_agent_basic.py). Capture and playback use non-blocking pyaudio callbacks; reply audio is - sequence-numbered so a barge-in can skip whatever is still queued. The agent - owns turn detection and noise suppression server-side. Use a headset to - avoid echo. + sequence-numbered so a barge-in can skip whatever is still queued. The + agent owns turn detection and noise suppression server-side. Use a headset + to avoid echo. Mic audio is sent as base64 PCM16; the reply arrives as typed - ``response.output_audio.*`` events, decoded to PCM16, mono, 24 kHz. Requires - ``pyaudio``. + ``response.output_audio.*`` events, decoded to PCM16, mono, 24 kHz. + Requires ``aiohttp`` and ``pyaudio``. - pip install azure-ai-voiceagents azure-identity pyaudio + pip install "azure-ai-projects>=2.0.0" azure-identity aiohttp pyaudio USAGE: - python sample_live_audio_conversation_async.py + python sample_voice_agent_live_audio_conversation_async.py Environment variables: - 1) AZURE_VOICE_AGENTS_ENDPOINT (required) - Foundry project endpoint: + 1) FOUNDRY_PROJECT_ENDPOINT (required) - Foundry project endpoint: https://.services.ai.azure.com/api/projects/ - 2) AZURE_VOICE_AGENTS_AGENT_NAME (required) - name of an existing voice agent to - converse with (created with ``store=True`` to persist conversations). + 2) FOUNDRY_VOICE_AGENT_NAME (required) - name of an existing voice agent to + converse with (created with `store=True` to persist conversations; see + sample_voice_agent_basic.py). Runs until you press Ctrl-C. Authenticates with DefaultAzureCredential, so sign in first (e.g. `az login`). @@ -50,19 +51,18 @@ from azure.core.exceptions import HttpResponseError from azure.identity.aio import DefaultAzureCredential -from azure.ai.voiceagents.aio import AsyncRealtimeConnection, VoiceAgentsClient -from azure.ai.voiceagents.models import ( - AgentDefinitionOptInKeys, - VoiceAgentServerEventConversationCreated, +# AsyncRealtimeConnection is re-exported dynamically via aio/_patch.py's `__all__`; pylint's +# static import resolution cannot trace that, but the symbol is valid (verified by Pyright/mypy). +from azure.ai.projects.aio import AsyncRealtimeConnection, AIProjectClient # pylint: disable=no-name-in-module +from azure.ai.projects.models import ( VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted, - VoiceAgentServerEventError, VoiceAgentServerEventInputAudioBufferSpeechStarted, VoiceAgentServerEventResponseAudioDelta, VoiceAgentServerEventResponseAudioTranscriptDone, + VoiceAgentServerEventResponseDone, + RealtimeServerEventError, ) -PREVIEW: Final = AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW - # Audio is streamed both ways as PCM16, mono, 24 kHz. _SAMPLE_RATE: Final = 24000 @@ -75,7 +75,7 @@ pyaudio: Any = None # type: ignore[no-redef] -class _AudioProcessor: +class _AudioProcessor: # pylint: disable=too-many-instance-attributes """Real-time mic capture and speaker playback via non-blocking pyaudio callbacks. * Capture appends each raw PCM16 frame to the input buffer (the realtime @@ -204,12 +204,12 @@ def seconds(self) -> float: return self._bytes / 2 / _SAMPLE_RATE -async def _run_audio_conversation(client: VoiceAgentsClient, agent_name: str) -> Optional[str]: +async def _run_audio_conversation(client: AIProjectClient, agent_name: str) -> Optional[str]: """Hold a live, hands-free conversation with barge-in. - :param client: The voice agents client. + :param client: The Foundry project client. :param agent_name: The existing voice agent name. - :type client: ~azure.ai.voiceagents.aio.VoiceAgentsClient + :type client: ~azure.ai.projects.aio.AIProjectClient :type agent_name: str :return: The persisted conversation id, if one is created. :rtype: str or None @@ -242,7 +242,7 @@ async def _run_audio_conversation(client: VoiceAgentsClient, agent_name: str) -> print("(listening...)") elif isinstance(event, VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted): print(f"You: {event.transcript.strip()}") - elif isinstance(event, VoiceAgentServerEventError): + elif isinstance(event, RealtimeServerEventError): # Non-fatal errors are reported; a fatal one closes the socket. print(f"Session error: {event.error.message}") elif isinstance(event, VoiceAgentServerEventResponseAudioDelta): @@ -250,9 +250,8 @@ async def _run_audio_conversation(client: VoiceAgentsClient, agent_name: str) -> ap.queue_audio(event.delta) elif isinstance(event, VoiceAgentServerEventResponseAudioTranscriptDone): print(f"Agent: {event.transcript}") - elif isinstance(event, VoiceAgentServerEventConversationCreated): - conversation_id = event.conversation_id - print(f"(conversation.created -> persisted id: {conversation_id})") + elif isinstance(event, VoiceAgentServerEventResponseDone): + conversation_id = event.response.conversation_id or conversation_id except (KeyboardInterrupt, asyncio.CancelledError): # Ctrl-C ends the session; read back whatever was persisted so far. print("\n(ending session...)") @@ -263,25 +262,23 @@ async def _run_audio_conversation(client: VoiceAgentsClient, agent_name: str) -> return conversation_id -async def _read_conversation(client: VoiceAgentsClient, agent_name: str, conversation_id: str) -> None: +async def _read_conversation(client: AIProjectClient, agent_name: str, conversation_id: str) -> None: """Read the persisted conversation back over the read-only conversation API. - :param client: The voice agents client. + :param client: The Foundry project client. :param agent_name: The voice agent name. :param conversation_id: The persisted conversation id. - :type client: ~azure.ai.voiceagents.aio.VoiceAgentsClient + :type client: ~azure.ai.projects.aio.AIProjectClient :type agent_name: str :type conversation_id: str """ conversations = client.agent_endpoint_conversations - conversation = await conversations.get_agent_conversation(agent_name, conversation_id, foundry_features=PREVIEW) + conversation = await conversations.get_agent_conversation(agent_name, conversation_id) print(f"Conversation {conversation.id}: status={conversation.status}, created_at={conversation.created_at}") print("Items (transcript):") - async for item in conversations.list_agent_conversation_items( - agent_name, conversation_id, foundry_features=PREVIEW - ): + async for item in conversations.list_agent_conversation_items(agent_name, conversation_id): role = item.get("role") or item.get("type") # Audio turns expose ``transcript``; text turns expose ``text``. parts = [(part.get("transcript") or part.get("text") or "").strip() for part in (item.get("content") or [])] @@ -292,22 +289,23 @@ async def _read_conversation(client: VoiceAgentsClient, agent_name: str, convers async def audio_conversation() -> None: - endpoint = os.environ["AZURE_VOICE_AGENTS_ENDPOINT"] - agent_name = os.environ["AZURE_VOICE_AGENTS_AGENT_NAME"] + endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] + agent_name = os.environ["FOUNDRY_VOICE_AGENT_NAME"] - async with DefaultAzureCredential() as credential, VoiceAgentsClient( - endpoint=endpoint, credential=credential - ) as client: + async with ( + DefaultAzureCredential() as credential, + AIProjectClient(endpoint=endpoint, credential=credential) as project_client, + ): try: # 1) Hold a live microphone conversation with the existing agent. print(f"Starting realtime session with agent: {agent_name}") - conversation_id = await _run_audio_conversation(client, agent_name) + conversation_id = await _run_audio_conversation(project_client, agent_name) # 2) Read the persisted conversation back. if conversation_id: print(f"Reading persisted conversation {conversation_id!r}...") try: - await _read_conversation(client, agent_name, conversation_id) + await _read_conversation(project_client, agent_name, conversation_id) except HttpResponseError as e: print(f"Could not read conversation: {e.status_code} {e.reason}") else: diff --git a/sdk/voiceagents/azure-ai-voiceagents/samples/live/sample_live_text_conversation_async.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py similarity index 75% rename from sdk/voiceagents/azure-ai-voiceagents/samples/live/sample_live_text_conversation_async.py rename to sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py index 6cdcff9d2ca7..15b18fd6c5a8 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/samples/live/sample_live_text_conversation_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py @@ -1,37 +1,37 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------- +# pylint: disable=line-too-long,useless-suppression +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ """ -FILE: sample_live_text_conversation_async.py - DESCRIPTION: - End-to-end typed conversation against an existing voice agent, using only - azure-ai-voiceagents, through the native ``client.realtime.connect(...)`` API. + End-to-end typed conversation against an existing voice agent, using the + ``client.realtime`` namespace added on top of the generated + azure-ai-projects client (see ``azure.ai.projects.aio.AsyncRealtime``). 1. Hold a typed, multi-turn conversation: each prompt is sent as a ``RealtimeConversationItemMessageUser`` and the reply streams back as typed audio and transcript events. Blank line (or ``exit`` / ``quit``) ends it. 2. Read the persisted conversation back (requires the agent to have been - created with ``store=True``; see sample_create_and_manage_voice_agent.py). + created with `store=True`; see sample_voice_agent_basic.py). Reply audio is PCM16, mono, 24 kHz and plays through the speakers when ``pyaudio`` is installed; runs headless otherwise. For a hands-free mic - conversation with barge-in, see sample_live_audio_conversation_async.py. + conversation with barge-in, see sample_voice_agent_live_audio_conversation_async.py. - pip install azure-ai-voiceagents azure-identity pyaudio + pip install "azure-ai-projects>=2.0.0" azure-identity aiohttp pyaudio USAGE: - python sample_live_text_conversation_async.py + python sample_voice_agent_live_text_conversation_async.py Environment variables: - 1) AZURE_VOICE_AGENTS_ENDPOINT (required) - Foundry project endpoint: + 1) FOUNDRY_PROJECT_ENDPOINT (required) - Foundry project endpoint: https://.services.ai.azure.com/api/projects/ - 2) AZURE_VOICE_AGENTS_AGENT_NAME (required) - name of an existing voice agent to - converse with (created with ``store=True`` to persist conversations). + 2) FOUNDRY_VOICE_AGENT_NAME (required) - name of an existing voice agent to + converse with (created with `store=True` to persist conversations; see + sample_voice_agent_basic.py). Authenticates with DefaultAzureCredential, so sign in first (e.g. `az login`). """ @@ -42,21 +42,16 @@ from azure.core.exceptions import HttpResponseError from azure.identity.aio import DefaultAzureCredential - -from azure.ai.voiceagents.aio import VoiceAgentsClient -from azure.ai.voiceagents.models import ( - AgentDefinitionOptInKeys, +from azure.ai.projects.aio import AIProjectClient +from azure.ai.projects.models import ( RealtimeConversationItemMessageUser, RealtimeConversationItemMessageUserContent, - VoiceAgentServerEventConversationCreated, - VoiceAgentServerEventError, VoiceAgentServerEventResponseAudioDelta, VoiceAgentServerEventResponseAudioTranscriptDone, VoiceAgentServerEventResponseDone, + RealtimeServerEventError, ) -PREVIEW: Final = AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW - # Seconds to wait for the agent to finish its reply. _RESPONSE_TIMEOUT: Final = 45 @@ -122,12 +117,12 @@ def seconds(self) -> float: return self._bytes / 2 / _SAMPLE_RATE -async def _run_text_conversation(client: VoiceAgentsClient, agent_name: str) -> Optional[str]: +async def _run_text_conversation(client: AIProjectClient, agent_name: str) -> Optional[str]: """Hold a typed, multi-turn conversation. - :param client: The voice agents client. + :param client: The Foundry project client. :param agent_name: The existing voice agent name. - :type client: ~azure.ai.voiceagents.aio.VoiceAgentsClient + :type client: ~azure.ai.projects.aio.AIProjectClient :type agent_name: str :return: The persisted conversation id, if one is created. :rtype: str or None @@ -145,8 +140,9 @@ async def pump() -> None: nonlocal conversation_id, audio_delta_count async for event in conn: if isinstance(event, VoiceAgentServerEventResponseDone): + conversation_id = event.response.conversation_id or conversation_id return - if isinstance(event, VoiceAgentServerEventError): + if isinstance(event, RealtimeServerEventError): print(f"Session error: {event.error.message}") return if isinstance(event, VoiceAgentServerEventResponseAudioDelta): @@ -155,9 +151,6 @@ async def pump() -> None: player.play(event.delta) elif isinstance(event, VoiceAgentServerEventResponseAudioTranscriptDone): print(f"Agent: {event.transcript}") - elif isinstance(event, VoiceAgentServerEventConversationCreated): - conversation_id = event.conversation_id - print(f"(conversation.created -> persisted id: {conversation_id})") while True: # input() blocks, so read it off the loop in a worker thread. @@ -190,25 +183,23 @@ async def pump() -> None: return conversation_id -async def _read_conversation(client: VoiceAgentsClient, agent_name: str, conversation_id: str) -> None: +async def _read_conversation(client: AIProjectClient, agent_name: str, conversation_id: str) -> None: """Read the persisted conversation back over the read-only conversation API. - :param client: The voice agents client. + :param client: The Foundry project client. :param agent_name: The voice agent name. :param conversation_id: The persisted conversation id. - :type client: ~azure.ai.voiceagents.aio.VoiceAgentsClient + :type client: ~azure.ai.projects.aio.AIProjectClient :type agent_name: str :type conversation_id: str """ conversations = client.agent_endpoint_conversations - conversation = await conversations.get_agent_conversation(agent_name, conversation_id, foundry_features=PREVIEW) + conversation = await conversations.get_agent_conversation(agent_name, conversation_id) print(f"Conversation {conversation.id}: status={conversation.status}, created_at={conversation.created_at}") print("Items (transcript):") - async for item in conversations.list_agent_conversation_items( - agent_name, conversation_id, foundry_features=PREVIEW - ): + async for item in conversations.list_agent_conversation_items(agent_name, conversation_id): role = item.get("role") or item.get("type") # Audio turns expose ``transcript``; text turns expose ``text``. parts = [(part.get("transcript") or part.get("text") or "").strip() for part in (item.get("content") or [])] @@ -219,22 +210,23 @@ async def _read_conversation(client: VoiceAgentsClient, agent_name: str, convers async def text_conversation() -> None: - endpoint = os.environ["AZURE_VOICE_AGENTS_ENDPOINT"] - agent_name = os.environ["AZURE_VOICE_AGENTS_AGENT_NAME"] + endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] + agent_name = os.environ["FOUNDRY_VOICE_AGENT_NAME"] - async with DefaultAzureCredential() as credential, VoiceAgentsClient( - endpoint=endpoint, credential=credential - ) as client: + async with ( + DefaultAzureCredential() as credential, + AIProjectClient(endpoint=endpoint, credential=credential) as project_client, + ): try: # 1) Hold the realtime conversation against the existing agent. print(f"Starting realtime session with agent: {agent_name}") - conversation_id = await _run_text_conversation(client, agent_name) + conversation_id = await _run_text_conversation(project_client, agent_name) # 2) Read the persisted conversation back. if conversation_id: print(f"Reading persisted conversation {conversation_id}...") try: - await _read_conversation(client, agent_name, conversation_id) + await _read_conversation(project_client, agent_name, conversation_id) except HttpResponseError as e: print(f"Could not read conversation: {e.status_code} {e.reason}") else: diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_read_conversation.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_read_conversation.py new file mode 100644 index 000000000000..5ac675d7c7e1 --- /dev/null +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_read_conversation.py @@ -0,0 +1,88 @@ +# pylint: disable=line-too-long,useless-suppression +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +""" +DESCRIPTION: + This sample demonstrates reading a persisted voice conversation back over + the read-only conversation API exposed by `project_client.agent_endpoint_conversations`: + the conversation envelope, its responses (model inference turns), and its + ordered items (the transcript). Conversations are created and written by + the voice orchestrator during a live session; this client can only read + them, and only when the agent was configured with `store=True` (see + sample_voice_agent_basic.py). + +USAGE: + python sample_voice_agent_read_conversation.py + + Before running the sample: + + pip install "azure-ai-projects>=2.0.0" python-dotenv + + Set these environment variables with your own values: + 1) FOUNDRY_PROJECT_ENDPOINT - The Azure AI Project endpoint. + 2) FOUNDRY_VOICE_AGENT_NAME - The name of the voice agent. + 3) FOUNDRY_VOICE_CONVERSATION_ID - The id of a persisted conversation + (captured from the `conversation.created` event during a live session, + see sample_voice_agent_live_audio_conversation_async.py). +""" + +import os +from dotenv import load_dotenv +from azure.core.exceptions import HttpResponseError +from azure.identity import DefaultAzureCredential +from azure.ai.projects import AIProjectClient + +load_dotenv() + +endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] +agent_name = os.environ["FOUNDRY_VOICE_AGENT_NAME"] +conversation_id = os.environ["FOUNDRY_VOICE_CONVERSATION_ID"] + +with ( + DefaultAzureCredential() as credential, + AIProjectClient(endpoint=endpoint, credential=credential) as project_client, +): + conversations = project_client.agent_endpoint_conversations + try: + # The conversation envelope: status, timestamps, aggregate usage. + conversation = conversations.get_agent_conversation(agent_name, conversation_id) + print(f"Conversation {conversation.id}: status={conversation.status}, created_at={conversation.created_at}") + + # The responses (model inference turns) in the conversation. + print("Responses:") + for response in conversations.list_agent_conversation_responses(agent_name, conversation_id): + print(f" - {response.id}: status={response.status}") + + # Read a single response back, with its output and token usage. + detail = conversations.get_agent_conversation_response(agent_name, conversation_id, response.id) + print(f" usage={detail.usage}") + + # The items produced by this specific response. Conversation items + # belong to an open union, so on read they surface as mappings + # keyed by their wire fields (``type``, ``id``, ...). + for response_item in conversations.list_agent_conversation_response_items( + agent_name, conversation_id, response.id + ): + print(f" item {response_item.get('type')} id={response_item.get('id')}") + + # The ordered conversation items -- the full transcript (user + assistant + tool events). + print("Items (transcript):") + for item in conversations.list_agent_conversation_items(agent_name, conversation_id): + item_id = item.get("id") + print(f" - {item.get('type')} id={item_id}") + + # Read a single item back by id. + if item_id: + single = conversations.get_agent_conversation_item(agent_name, conversation_id, item_id) + print(f" fetched item id={single.get('id')}") + + # Deleting a conversation removes it and all of its responses, items, and audio. + # This is destructive, so it is shown but not run by default. Uncomment to enable. + # deleted = conversations.delete_agent_conversation(agent_name, conversation_id) + # print(f"Deleted conversation {deleted.id}: deleted={deleted.deleted}") + except HttpResponseError as e: + # 404 typically means the conversation was not persisted (agent ran with `store=False`). + print(f"Service responded with an error: {e.status_code} {e.reason}") diff --git a/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_read_conversation_audio.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_read_conversation_audio.py similarity index 56% rename from sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_read_conversation_audio.py rename to sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_read_conversation_audio.py index 9dc60794e78f..cc5d8eacca10 100644 --- a/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_read_conversation_audio.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_read_conversation_audio.py @@ -1,61 +1,43 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------- +# pylint: disable=line-too-long,useless-suppression +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ """ -FILE: sample_read_conversation_audio.py - DESCRIPTION: - This sample demonstrates reading the persisted audio of a voice conversation, - both the merged whole-call recording and a single turn's audio segment. For - each it reads the metadata first, then streams the WAV bytes to a local file. - The merged recording is stereo: the caller on the left channel and the agent + This sample demonstrates reading the persisted audio of a voice + conversation via `project_client.agent_endpoint_conversations`, both the + merged whole-call recording and a single turn's audio segment. For each it + reads the metadata first, then streams the WAV bytes to a local file. The + merged recording is stereo: the caller on the left channel and the agent on the right. - Audio is available only after the session has ended and only when the agent - was configured with `store = true`. For bring-your-own-storage (BYOS) + Audio is available only after the session has ended and only when the + agent was configured with `store=True`. For bring-your-own-storage (BYOS) accounts the metadata carries a `blob_uri` instead, and the bytes are read from your own storage rather than streamed here. USAGE: - python sample_read_conversation_audio.py + python sample_voice_agent_read_conversation_audio.py + + Before running the sample: - Set these environment variables before running the sample: - 1) AZURE_VOICE_AGENTS_ENDPOINT - the Foundry project endpoint, in the form - https://.services.ai.azure.com/api/projects/ - 2) AZURE_VOICE_AGENTS_AGENT_NAME - the name of the voice agent. - 3) AZURE_VOICE_AGENTS_CONVERSATION_ID - the id of a persisted conversation. + pip install "azure-ai-projects>=2.0.0" python-dotenv - The sample authenticates with DefaultAzureCredential, so sign in first - (for example, with `az login`). + Set these environment variables with your own values: + 1) FOUNDRY_PROJECT_ENDPOINT - The Azure AI Project endpoint. + 2) FOUNDRY_VOICE_AGENT_NAME - The name of the voice agent. + 3) FOUNDRY_VOICE_CONVERSATION_ID - The id of a persisted conversation. """ import os -from typing import Final - +from dotenv import load_dotenv from azure.core.exceptions import HttpResponseError from azure.identity import DefaultAzureCredential +from azure.ai.projects import AIProjectClient -from azure.ai.voiceagents import VoiceAgentsClient -from azure.ai.voiceagents.models import AgentDefinitionOptInKeys - - -def read_conversation_audio() -> None: - endpoint = os.environ["AZURE_VOICE_AGENTS_ENDPOINT"] - agent_name = os.environ["AZURE_VOICE_AGENTS_AGENT_NAME"] - conversation_id = os.environ["AZURE_VOICE_AGENTS_CONVERSATION_ID"] - preview: Final = AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW - - with VoiceAgentsClient(endpoint=endpoint, credential=DefaultAzureCredential()) as client: - conversations = client.agent_endpoint_conversations - try: - read_merged_recording(conversations, agent_name, conversation_id, preview) - read_first_item_audio(conversations, agent_name, conversation_id, preview) - except HttpResponseError as e: - # 404: not persisted / not ready. 409: session still in progress. - print(f"Service responded with an error: {e.status_code} {e.reason}") +load_dotenv() def stream_to_wav(stream, output_path) -> None: @@ -72,19 +54,17 @@ def stream_to_wav(stream, output_path) -> None: print(f"Wrote {output_path}") -def read_merged_recording(conversations, agent_name, conversation_id, preview) -> None: +def read_merged_recording(conversations, agent_name, conversation_id) -> None: """Read the merged whole-call stereo recording (left=user, right=agent). :param conversations: The conversation operations client. :param agent_name: The voice agent name. :param conversation_id: The persisted conversation id. - :param preview: The preview feature opt-in value. - :type conversations: azure.ai.voiceagents.operations.AgentEndpointConversationsOperations + :type conversations: azure.ai.projects.operations.AgentEndpointConversationsOperations :type agent_name: str :type conversation_id: str - :type preview: azure.ai.voiceagents.models.AgentDefinitionOptInKeys """ - recording = conversations.get_agent_conversation_audio(agent_name, conversation_id, foundry_features=preview) + recording = conversations.get_agent_conversation_audio(agent_name, conversation_id) print( f"Recording: format={recording.format}, sample_rate={recording.sample_rate}, " f"channels={recording.channels}, duration_ms={recording.duration_ms}" @@ -96,30 +76,26 @@ def read_merged_recording(conversations, agent_name, conversation_id, preview) - return # Foundry-managed storage: stream the bytes and write them to a local WAV file. - stream = conversations.get_agent_conversation_audio_content(agent_name, conversation_id, foundry_features=preview) + stream = conversations.get_agent_conversation_audio_content(agent_name, conversation_id) stream_to_wav(stream, f"{conversation_id}.wav") -def read_first_item_audio(conversations, agent_name, conversation_id, preview) -> None: +def read_first_item_audio(conversations, agent_name, conversation_id) -> None: """Read the audio segment of the first conversation item that has one. :param conversations: The conversation operations client. :param agent_name: The voice agent name. :param conversation_id: The persisted conversation id. - :param preview: The preview feature opt-in value. - :type conversations: azure.ai.voiceagents.operations.AgentEndpointConversationsOperations + :type conversations: azure.ai.projects.operations.AgentEndpointConversationsOperations :type agent_name: str :type conversation_id: str - :type preview: azure.ai.voiceagents.models.AgentDefinitionOptInKeys """ - for item in conversations.list_agent_conversation_items(agent_name, conversation_id, foundry_features=preview): + for item in conversations.list_agent_conversation_items(agent_name, conversation_id): item_id = item.get("id") if not item_id: continue try: - metadata = conversations.get_agent_conversation_item_audio( - agent_name, conversation_id, item_id, foundry_features=preview - ) + metadata = conversations.get_agent_conversation_item_audio(agent_name, conversation_id, item_id) except HttpResponseError as e: # A 404 means this item has no persisted audio (for example, a text-only turn). if e.status_code == 404: @@ -131,14 +107,30 @@ def read_first_item_audio(conversations, agent_name, conversation_id, preview) - print(f"Item audio is stored in your own storage at: {metadata.blob_uri}") return - stream = conversations.get_agent_conversation_item_audio_content( - agent_name, conversation_id, item_id, foundry_features=preview - ) + stream = conversations.get_agent_conversation_item_audio_content(agent_name, conversation_id, item_id) stream_to_wav(stream, f"{conversation_id}_{item_id}.wav") return print("No conversation item with audio was found.") +def main() -> None: + endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] + agent_name = os.environ["FOUNDRY_VOICE_AGENT_NAME"] + conversation_id = os.environ["FOUNDRY_VOICE_CONVERSATION_ID"] + + with ( + DefaultAzureCredential() as credential, + AIProjectClient(endpoint=endpoint, credential=credential) as project_client, + ): + conversations = project_client.agent_endpoint_conversations + try: + read_merged_recording(conversations, agent_name, conversation_id) + read_first_item_audio(conversations, agent_name, conversation_id) + except HttpResponseError as e: + # 404: not persisted / not ready. 409: session still in progress. + print(f"Service responded with an error: {e.status_code} {e.reason}") + + if __name__ == "__main__": - read_conversation_audio() + main() diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_versions.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_versions.py new file mode 100644 index 000000000000..7878ec9a4ccd --- /dev/null +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_versions.py @@ -0,0 +1,90 @@ +# pylint: disable=line-too-long,useless-suppression +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +""" +DESCRIPTION: + This sample demonstrates working with voice-agent versions. Agents are + immutable: every `create_version` call produces a new version. This sample + creates an agent, adds a new version to it, adds a draft version, lists the + versions, and reads a single version back. + +USAGE: + python sample_voice_agent_versions.py + + Before running the sample: + + pip install "azure-ai-projects>=2.0.0" python-dotenv + + Set these environment variables with your own values: + 1) FOUNDRY_PROJECT_ENDPOINT - The Azure AI Project endpoint. + 2) FOUNDRY_VOICE_MODEL - Optional. The realtime model deployment name. + Defaults to "gpt-realtime". +""" + +import os +from dotenv import load_dotenv +from azure.identity import DefaultAzureCredential +from azure.ai.projects import AIProjectClient +from azure.ai.projects.models import VoiceAgentDefinition + +load_dotenv() + +endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] +model = os.environ.get("FOUNDRY_VOICE_MODEL") or "gpt-realtime" +agent_name = "sample-versioned-voice-agent" + + +def make_definition(instructions: str) -> VoiceAgentDefinition: + # Each version differs only by its instructions; the rest is identical. + return VoiceAgentDefinition(model_type="managed", model=model, instructions=instructions) + + +with ( + DefaultAzureCredential() as credential, + AIProjectClient(endpoint=endpoint, credential=credential) as project_client, +): + try: + # Create the initial agent (this is version 1). + created = project_client.agents.create_version( + agent_name=agent_name, + definition=make_definition("You are a helpful voice assistant."), + ) + print(f"Created agent '{agent_name}', version: {created.version}") + + # Create a new version with updated instructions. + new_version = project_client.agents.create_version( + agent_name=agent_name, + definition=make_definition("You are a helpful voice assistant. Always greet the caller by name."), + description="Added a personalized greeting.", + ) + print(f"Created new version: {new_version.version}") + + # Create a draft version. Drafts are recorded but excluded from the default + # 'latest' resolution and from version listings unless include_drafts=True. + draft_version = project_client.agents.create_version( + agent_name=agent_name, + definition=make_definition("You are a helpful voice assistant. Experimental draft persona."), + description="Candidate persona under review.", + draft=True, + ) + print(f"Created draft version: {draft_version.version}") + + # List released versions (drafts excluded by default). + print(f"Released versions of '{agent_name}':") + for version in project_client.agents.list_versions(agent_name=agent_name): + print(f" - version {version.version} (created_at={version.created_at})") + + # List including drafts. + print(f"All versions of '{agent_name}' (including drafts):") + for version in project_client.agents.list_versions(agent_name=agent_name, include_drafts=True): + print(f" - version {version.version} (draft={version.draft})") + + # Read a single version back. + fetched = project_client.agents.get_version(agent_name=agent_name, agent_version=new_version.version) + print(f"Fetched version {fetched.version}: {fetched.definition.instructions}") # type: ignore[union-attr] + finally: + project_client.agents.delete(agent_name=agent_name) + print(f"Deleted agent: {agent_name}") diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_with_tools.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_with_tools.py new file mode 100644 index 000000000000..9022e6d85975 --- /dev/null +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_with_tools.py @@ -0,0 +1,146 @@ +# pylint: disable=line-too-long,useless-suppression +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +""" +DESCRIPTION: + This sample demonstrates the richer parts of a voice agent definition: + + * Input (microphone) audio configuration: audio format, server-side turn + detection (VAD), input-audio transcription. + * Tools the agent may use during a live session: a client-executed + `function` tool and a service-managed `system` control tool (`mcp` and + `toolbox` tools are shown as constructed objects for illustration). + * Bring-your-own-model (BYOM): set `model_type="self_deployed"` to point + the agent at your own Foundry model deployment instead of a + service-managed model. + +USAGE: + python sample_voice_agent_with_tools.py + + Before running the sample: + + pip install "azure-ai-projects>=2.0.0" python-dotenv + + Set these environment variables with your own values: + 1) FOUNDRY_PROJECT_ENDPOINT - The Azure AI Project endpoint. + 2) FOUNDRY_VOICE_MODEL - Optional. The realtime model (managed) or the + Foundry deployment name (BYOM). Defaults to "gpt-realtime". + 3) FOUNDRY_VOICE_MODEL_TYPE - Optional. "managed" (default) for a + service-hosted model, or "self_deployed" to bring your own deployment. +""" + +import os +from typing import Any, cast + +from dotenv import load_dotenv +from azure.identity import DefaultAzureCredential +from azure.ai.projects import AIProjectClient +from azure.ai.projects.models import ( + RealtimeFunctionTool, + ToolType, + VoiceAgentDefinition, + VoiceAgentMcpTool, + VoiceAudioConfig, + VoiceAudioFormat, + VoiceAudioInputConfig, + VoiceAudioOutputConfig, + VoiceInputTranscription, + VoiceModelType, + VoiceOutputModality, + VoiceServerVadTurnDetection, + VoiceSystemTool, + VoiceSystemToolName, + VoiceToolboxTool, +) + +load_dotenv() + +endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] +model = os.environ.get("FOUNDRY_VOICE_MODEL") or "gpt-realtime" +# "managed" runs a service-hosted model; "self_deployed" (BYOM) uses your own +# Foundry deployment named by `model`. The service derives whether the model is +# realtime or cascaded; you don't set that here. +model_type = os.environ.get("FOUNDRY_VOICE_MODEL_TYPE") or VoiceModelType.MANAGED +agent_name = "sample-voice-agent-with-tools" + +# A client-executed tool: the service forwards the function call to your app, +# and your app returns the result over the live session. +get_weather = RealtimeFunctionTool( + type="function", + name="get_weather", + description="Get the current weather for a city.", + parameters=cast( + Any, + { + "type": "object", + "properties": {"city": {"type": "string", "description": "City name, e.g. Seattle."}}, + "required": ["city"], + }, + ), +) + +# A service-managed control tool: the platform can end the call on the agent's behalf. +end_call = VoiceSystemTool(name=VoiceSystemToolName.END_CONVERSATION) + +# An MCP tool is executed by the service against a remote MCP server you own. +# It references an external server, so it is constructed here for illustration +# and not attached below. Provide one of server_url, connector_id, or tunnel_id. +_example_mcp_tool = VoiceAgentMcpTool( + type=ToolType.MCP, + server_label="my-mcp-server", + server_url="https://example.com/mcp", + require_approval="never", +) + +# A toolbox tool references a versioned Foundry toolbox you have created. It is +# constructed here for illustration; attach it only if the toolbox exists. +_example_toolbox_tool = VoiceToolboxTool(toolbox_name="my-toolbox", toolbox_version="1") + +definition = VoiceAgentDefinition( + model_type=model_type, + model=model, + instructions="You are a helpful voice assistant. Use tools when they help answer the caller.", + audio=VoiceAudioConfig( + # Input (microphone) side: 24 kHz PCM, server-side VAD so the agent + # auto-responds when the caller stops speaking, plus input-audio + # transcription so user speech is transcribed. + input=VoiceAudioInputConfig( + format=VoiceAudioFormat(type="audio/pcm", rate=24000), + turn_detection=VoiceServerVadTurnDetection( + threshold=0.5, + prefix_padding_ms=300, + silence_duration_ms=500, + ), + transcription=VoiceInputTranscription(model="whisper-1"), + ), + # Output (agent speech) side: the voice the agent speaks with. + output=VoiceAudioOutputConfig(voice="en-US-AvaNeural", voice_type="azure-standard"), + ), + output_modalities=[VoiceOutputModality.AUDIO], + # Attach the self-contained tools. `_example_mcp_tool` and `_example_toolbox_tool` + # reference external resources you must own, so they are left out here. + tools=[get_weather, end_call], + store=True, +) + +with ( + DefaultAzureCredential() as credential, + AIProjectClient(endpoint=endpoint, credential=credential) as project_client, +): + try: + created_version = project_client.agents.create_version(agent_name=agent_name, definition=definition) + print(f"Created voice agent '{agent_name}' (model_type={model_type}, model={model})") + + agent_version = project_client.agents.get_version(agent_name=agent_name, agent_version=created_version.version) + tools = agent_version.definition.tools or [] # type: ignore[union-attr] + print(f"Configured {len(tools)} tool(s):") + for tool in tools: + # Tools belong to an open union, so on read they surface as mappings + # keyed by their wire fields (``type`` and, for most kinds, ``name``). + print(f" - {tool['type']}: {tool.get('name', '(unnamed)')}") + finally: + project_client.agents.delete(agent_name=agent_name) + print(f"Deleted voice agent: {agent_name}") diff --git a/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py b/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py index 55e08fee6f52..4555d6f7676d 100644 --- a/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py +++ b/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py @@ -45,7 +45,7 @@ "schedules": "Schedules=V1Preview", "skills": "Skills=V1Preview", "datasets": "DataGenerationJobs=V1Preview", - "agents": "WorkflowAgents=V1Preview,ExternalAgents=V1Preview,DraftAgents=V1Preview,AgentsOptimization=V2Preview", + "agents": "WorkflowAgents=V1Preview,ExternalAgents=V1Preview,DraftAgents=V1Preview,VoiceAgents=V1Preview,AgentsOptimization=V2Preview", } # Methods on .beta sub-clients that are NOT simple one-HTTP-call wrappers and @@ -83,7 +83,7 @@ # The test id is derived automatically from method_name. pytest.param( "agents.create_version", - "WorkflowAgents=V1Preview,ExternalAgents=V1Preview,DraftAgents=V1Preview,AgentsOptimization=V2Preview", + "WorkflowAgents=V1Preview,ExternalAgents=V1Preview,DraftAgents=V1Preview,VoiceAgents=V1Preview,AgentsOptimization=V2Preview", ), pytest.param( "evaluation_rules.create_or_update", diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml b/sdk/ai/azure-ai-projects/tsp-location.yaml new file mode 100644 index 000000000000..0318ebd65cef --- /dev/null +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml @@ -0,0 +1,28 @@ +directory: specification/ai-foundry/data-plane/Foundry/src/sdk-python-js-azure-ai-projects +commit: 387a89cd76214595babe8031d538b0408914d9c6 +repo: Azure/azure-rest-api-specs +additionalDirectories: + - specification/ai-foundry/data-plane/Foundry/src/agents + - specification/ai-foundry/data-plane/Foundry/src/agents-optimization + - specification/ai-foundry/data-plane/Foundry/src/agents-session-files + - specification/ai-foundry/data-plane/Foundry/src/common + - specification/ai-foundry/data-plane/Foundry/src/connections + - specification/ai-foundry/data-plane/Foundry/src/data_generation_jobs + - specification/ai-foundry/data-plane/Foundry/src/datasets + - specification/ai-foundry/data-plane/Foundry/src/deployments + - specification/ai-foundry/data-plane/Foundry/src/evaluation-rules + - specification/ai-foundry/data-plane/Foundry/src/evaluation-taxonomies + - specification/ai-foundry/data-plane/Foundry/src/evaluators + - specification/ai-foundry/data-plane/Foundry/src/indexes + - specification/ai-foundry/data-plane/Foundry/src/insights + - specification/ai-foundry/data-plane/Foundry/src/memory-stores + - specification/ai-foundry/data-plane/Foundry/src/models + - specification/ai-foundry/data-plane/Foundry/src/openai + - specification/ai-foundry/data-plane/Foundry/src/red-teams + - specification/ai-foundry/data-plane/Foundry/src/routines + - specification/ai-foundry/data-plane/Foundry/src/schedules + - specification/ai-foundry/data-plane/Foundry/src/sdk-common + - specification/ai-foundry/data-plane/Foundry/src/skills + - specification/ai-foundry/data-plane/Foundry/src/toolboxes + - specification/ai-foundry/data-plane/Foundry/src/tools + - specification/ai-foundry/data-plane/Foundry/src/voice-agents diff --git a/sdk/voiceagents/azure-ai-voiceagents/CHANGELOG.md b/sdk/voiceagents/azure-ai-voiceagents/CHANGELOG.md deleted file mode 100644 index d5783dcd33e6..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/CHANGELOG.md +++ /dev/null @@ -1,7 +0,0 @@ -# Release History - -## 1.0.0b1 (2026-08-06) - -### Other Changes - -- Initial version diff --git a/sdk/voiceagents/azure-ai-voiceagents/LICENSE b/sdk/voiceagents/azure-ai-voiceagents/LICENSE deleted file mode 100644 index 63447fd8bbbf..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) Microsoft Corporation. - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/sdk/voiceagents/azure-ai-voiceagents/MANIFEST.in b/sdk/voiceagents/azure-ai-voiceagents/MANIFEST.in deleted file mode 100644 index 40653212ffad..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/MANIFEST.in +++ /dev/null @@ -1,7 +0,0 @@ -include *.md -include LICENSE -include azure/ai/voiceagents/py.typed -recursive-include tests *.py -recursive-include samples *.py *.md -include azure/__init__.py -include azure/ai/__init__.py diff --git a/sdk/voiceagents/azure-ai-voiceagents/README.md b/sdk/voiceagents/azure-ai-voiceagents/README.md deleted file mode 100644 index ec5ed98133ad..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/README.md +++ /dev/null @@ -1,116 +0,0 @@ -# Azure AI Voice Agents client library for Python - -The Azure AI Voice Agents client library provides APIs for creating and managing -voice agents in an Azure AI Foundry project, reading persisted voice -conversations, and connecting to a voice agent over a realtime WebSocket session. - -Use this package to: - -- Generate or create voice agents with model, instruction, voice, and tool settings. -- Manage voice agent versions and operational state. -- Stream live microphone audio to an existing voice agent and receive spoken responses. -- Read persisted conversation transcripts and audio when an agent is configured to store them. - -## Getting started - -### Install the package - -```bash -python -m pip install azure-ai-voiceagents -``` - -### Prerequisites - -- Python 3.10 or later is required to use this package. -- You need an Azure subscription. -- You need an Azure AI Foundry project endpoint, for example - `https://.services.ai.azure.com/api/projects/`. -- For Microsoft Entra ID authentication, install [`azure-identity`][azure_identity_pip]. -- For realtime async WebSocket sessions, install an async transport such as `aiohttp`. - -### Authenticate the client - -The client supports token credentials from the -[`azure-identity`][azure_identity_credentials] library. For example, -[`DefaultAzureCredential`][default_azure_credential] can authenticate from your -developer environment or configured application identity. - -```python -from azure.ai.voiceagents import VoiceAgentsClient -from azure.identity import DefaultAzureCredential - -client = VoiceAgentsClient( - endpoint="https://.services.ai.azure.com/api/projects/", - credential=DefaultAzureCredential(), -) -``` - -## Examples - -Create a voice agents client and list the voice agents in a project: - -```python -from azure.ai.voiceagents import VoiceAgentsClient -from azure.ai.voiceagents.models import AgentDefinitionOptInKeys -from azure.identity import DefaultAzureCredential - -client = VoiceAgentsClient( - endpoint="https://.services.ai.azure.com/api/projects/", - credential=DefaultAzureCredential(), -) - -for agent in client.voice_agents.list_voice_agents( - foundry_features=AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW -): - print(agent.name) -``` - -See the [samples on GitHub](https://github.com/Azure/azure-sdk-for-python/tree/xitzhang/voice-agent-pupr/sdk/voiceagents/azure-ai-voiceagents/samples) -for management, quickstart, and realtime conversation examples. - -## Key concepts - -- **Voice agents** are managed in an Azure AI Foundry project through the - `VoiceAgentsClient`. -- **Realtime sessions** connect to an agent over an asynchronous WebSocket - connection and can stream audio input and output. -- **Persisted conversations** contain transcripts and audio when conversation - storage is enabled for the agent. - -## Troubleshooting - -- Verify that `AZURE_VOICE_AGENTS_ENDPOINT` points to the Foundry project - endpoint, not the account endpoint. -- Ensure the credential has permission to access the project and its voice - agents. -- For realtime audio samples, install `aiohttp` and `pyaudio`, and verify that - the operating system has an available microphone and speaker. - -## Next steps - -- Review the [sample collection](https://github.com/Azure/azure-sdk-for-python/tree/xitzhang/voice-agent-pupr/sdk/voiceagents/azure-ai-voiceagents/samples). -- Read the [Azure AI Foundry documentation](https://learn.microsoft.com/azure/ai-foundry/). -- See the [API reference](https://github.com/Azure/azure-sdk-for-python/blob/xitzhang/voice-agent-pupr/sdk/voiceagents/azure-ai-voiceagents/api.md). - -## Contributing - -This project welcomes contributions and suggestions. Most contributions require -you to agree to a Contributor License Agreement (CLA) declaring that you have -the right to, and actually do, grant us the rights to use your contribution. -For details, visit . - -When you submit a pull request, a CLA-bot will automatically determine whether -you need to provide a CLA and decorate the PR appropriately (e.g., label, -comment). Simply follow the instructions provided by the bot. You will only -need to do this once across all repos using our CLA. - -This project has adopted the -[Microsoft Open Source Code of Conduct][code_of_conduct]. For more information, -see the Code of Conduct FAQ or contact with any -additional questions or comments. - - -[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ -[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#credentials -[azure_identity_pip]: https://pypi.org/project/azure-identity/ -[default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential diff --git a/sdk/voiceagents/azure-ai-voiceagents/_metadata.json b/sdk/voiceagents/azure-ai-voiceagents/_metadata.json deleted file mode 100644 index 3a000fe50d57..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/_metadata.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "apiVersion": "v1", - "apiVersions": { - "Azure.AI.Projects": "v1" - } -} \ No newline at end of file diff --git a/sdk/voiceagents/azure-ai-voiceagents/api.md b/sdk/voiceagents/azure-ai-voiceagents/api.md deleted file mode 100644 index cdef329f00fe..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/api.md +++ /dev/null @@ -1,9896 +0,0 @@ -```py -namespace azure.ai.voiceagents - - class azure.ai.voiceagents.VoiceAgentsClient: implements ContextManager - agent_endpoint_conversations: AgentEndpointConversationsOperations - voice_agents: VoiceAgentsOperations - - def __init__( - self, - endpoint: str, - credential: TokenCredential, - *, - api_version: str = ..., - **kwargs: Any - ) -> None: ... - - def close(self) -> None: ... - - def send_request( - self, - request: HttpRequest, - *, - stream: bool = False, - **kwargs: Any - ) -> HttpResponse: ... - - -namespace azure.ai.voiceagents.aio - - class azure.ai.voiceagents.aio.AsyncRealtime: - - def __init__(self, client: VoiceAgentsClient) -> None: ... - - def connect( - self, - *, - agent_name: str, - agent_session_id: Optional[str] = ..., - agent_version_override: Optional[str] = ..., - api_version: Optional[str] = ..., - connection_url: Optional[str] = ..., - credential_scopes: Optional[List[str]] = ..., - extra_headers: Optional[Mapping[str, str]] = ..., - extra_query: Optional[Mapping[str, str]] = ..., - foundry_features: Union[str, AgentDefinitionOptInKeys] = _models.AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW, - structured_inputs: Optional[str] = ..., - **kwargs: Any - ) -> AsyncRealtimeConnectionManager: ... - - - class azure.ai.voiceagents.aio.AsyncRealtimeConnection: implements AsyncContextManager - - def __aiter__(self) -> AsyncIterator[ServerEvent]: ... - - def __init__( - self, - connection: ClientWebSocketResponse, - session: ClientSession - ) -> None: ... - - async def close( - self, - *, - code: int = 1000, - reason: str = "" - ) -> None: ... - - async def recv(self) -> ServerEvent: ... - - async def send(self, event: ClientEvent) -> None: ... - - - class azure.ai.voiceagents.aio.AsyncRealtimeConnectionManager: implements AsyncContextManager - - def __init__( - self, - *, - agent_name: str, - agent_session_id: Optional[str] = ..., - agent_version_override: Optional[str] = ..., - api_version: str, - connection_url: Optional[str] = ..., - credential: AsyncTokenCredential, - credential_scopes: List[str], - endpoint: str, - extra_headers: Optional[Mapping[str, str]] = ..., - extra_query: Optional[Mapping[str, str]] = ..., - foundry_features: Union[str, AgentDefinitionOptInKeys], - structured_inputs: Optional[str] = ..., - **kwargs: Any - ) -> None: ... - - async def enter(self) -> AsyncRealtimeConnection: ... - - - class azure.ai.voiceagents.aio.VoiceAgentsClient(_GeneratedVoiceAgentsClient): implements AsyncContextManager - property realtime: AsyncRealtime # Read-only - - def __init__( - self, - endpoint: str, - credential: AsyncTokenCredential, - *, - api_version: Optional[str] = ..., - **kwargs: Any - ) -> None: ... - - async def close(self) -> None: ... - - def send_request( - self, - request: HttpRequest, - *, - stream: bool = False, - **kwargs: Any - ) -> Awaitable[AsyncHttpResponse]: ... - - -namespace azure.ai.voiceagents.aio.operations - - class azure.ai.voiceagents.aio.operations.AgentEndpointConversationsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @distributed_trace_async - async def delete_agent_conversation( - self, - agent_name: str, - conversation_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> None: ... - - @distributed_trace_async - async def get_agent_conversation( - self, - agent_name: str, - conversation_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> VoiceConversation: ... - - @distributed_trace_async - async def get_agent_conversation_audio( - self, - agent_name: str, - conversation_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> VoiceRecordingResponse: ... - - @distributed_trace_async - async def get_agent_conversation_audio_content( - self, - agent_name: str, - conversation_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> AsyncIterator[bytes]: ... - - @distributed_trace_async - async def get_agent_conversation_item( - self, - agent_name: str, - conversation_id: str, - item_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> VoiceConversationItem: ... - - @distributed_trace_async - async def get_agent_conversation_item_audio( - self, - agent_name: str, - conversation_id: str, - item_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> VoiceItemAudioResponse: ... - - @distributed_trace_async - async def get_agent_conversation_item_audio_content( - self, - agent_name: str, - conversation_id: str, - item_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> AsyncIterator[bytes]: ... - - @distributed_trace_async - async def get_agent_conversation_response( - self, - agent_name: str, - conversation_id: str, - response_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> VoiceResponse: ... - - @distributed_trace - def list_agent_conversation_items( - self, - agent_name: str, - conversation_id: str, - *, - before: Optional[str] = ..., - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> AsyncItemPaged[VoiceConversationItem]: ... - - @distributed_trace - def list_agent_conversation_response_items( - self, - agent_name: str, - conversation_id: str, - response_id: str, - *, - before: Optional[str] = ..., - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> AsyncItemPaged[VoiceConversationItem]: ... - - @distributed_trace - def list_agent_conversation_responses( - self, - agent_name: str, - conversation_id: str, - *, - before: Optional[str] = ..., - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> AsyncItemPaged[VoiceResponse]: ... - - - class azure.ai.voiceagents.aio.operations.VoiceAgentsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - async def create_voice_agent( - self, - *, - agent_card: Optional[AgentCard] = ..., - agent_endpoint: Optional[AgentEndpointConfig] = ..., - blueprint_reference: Optional[AgentBlueprintReference] = ..., - content_type: str = "application/json", - definition: VoiceAgentDefinition, - description: Optional[str] = ..., - draft: Optional[bool] = ..., - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - metadata: Optional[dict[str, str]] = ..., - name: str, - state: Optional[Union[str, AgentState]] = ..., - **kwargs: Any - ) -> VoiceAgentObject: ... - - @overload - async def create_voice_agent( - self, - body: CreateVoiceAgentRequest, - *, - content_type: str = "application/json", - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> VoiceAgentObject: ... - - @overload - async def create_voice_agent( - self, - body: IO[bytes], - *, - content_type: str = "application/json", - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> VoiceAgentObject: ... - - @overload - async def create_voice_agent_version( - self, - agent_name: str, - *, - blueprint_reference: Optional[AgentBlueprintReference] = ..., - content_type: str = "application/json", - definition: VoiceAgentDefinition, - description: Optional[str] = ..., - draft: Optional[bool] = ..., - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - metadata: Optional[dict[str, str]] = ..., - **kwargs: Any - ) -> VoiceAgentVersionObject: ... - - @overload - async def create_voice_agent_version( - self, - agent_name: str, - body: CreateVoiceAgentVersionRequest, - *, - content_type: str = "application/json", - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> VoiceAgentVersionObject: ... - - @overload - async def create_voice_agent_version( - self, - agent_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> VoiceAgentVersionObject: ... - - @distributed_trace_async - async def delete_voice_agent( - self, - agent_name: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> None: ... - - @distributed_trace_async - async def delete_voice_agent_version( - self, - agent_name: str, - agent_version: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> None: ... - - @distributed_trace_async - async def disable_voice_agent( - self, - agent_name: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> None: ... - - @distributed_trace_async - async def enable_voice_agent( - self, - agent_name: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> None: ... - - @overload - async def generate_voice_agent( - self, - *, - agent_type: Union[str, VoiceAgentType], - content_type: str = "application/json", - description: Optional[str] = ..., - draft: Optional[bool] = ..., - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - goal: str, - model: str, - model_type: Union[str, VoiceModelType], - name: str, - tools: Optional[list[VoiceAgentTool]] = ..., - use_case: Union[str, VoiceAgentUseCase], - **kwargs: Any - ) -> VoiceAgentObject: ... - - @overload - async def generate_voice_agent( - self, - body: GenerateVoiceAgentRequest, - *, - content_type: str = "application/json", - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> VoiceAgentObject: ... - - @overload - async def generate_voice_agent( - self, - body: IO[bytes], - *, - content_type: str = "application/json", - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> VoiceAgentObject: ... - - @distributed_trace_async - async def get_voice_agent( - self, - agent_name: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> VoiceAgentObject: ... - - @distributed_trace_async - async def get_voice_agent_version( - self, - agent_name: str, - agent_version: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> VoiceAgentVersionObject: ... - - @distributed_trace - def list_voice_agent_versions( - self, - agent_name: str, - *, - before: Optional[str] = ..., - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - include_drafts: Optional[bool] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> AsyncItemPaged[VoiceAgentVersionObject]: ... - - @distributed_trace - def list_voice_agents( - self, - *, - before: Optional[str] = ..., - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> AsyncItemPaged[VoiceAgentObject]: ... - - @overload - async def update_voice_agent( - self, - agent_name: str, - *, - blueprint_reference: Optional[AgentBlueprintReference] = ..., - content_type: str = "application/json", - definition: VoiceAgentDefinition, - description: Optional[str] = ..., - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - metadata: Optional[dict[str, str]] = ..., - **kwargs: Any - ) -> VoiceAgentObject: ... - - @overload - async def update_voice_agent( - self, - agent_name: str, - body: UpdateVoiceAgentRequest, - *, - content_type: str = "application/json", - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> VoiceAgentObject: ... - - @overload - async def update_voice_agent( - self, - agent_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> VoiceAgentObject: ... - - -namespace azure.ai.voiceagents.models - - class azure.ai.voiceagents.models.A2AProtocolConfiguration(_Model): - - - class azure.ai.voiceagents.models.ActivityProtocolConfiguration(_Model): - enable_m365_public_endpoint: Optional[bool] - - @overload - def __init__( - self, - *, - enable_m365_public_endpoint: Optional[bool] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.AgentBlueprintReference(_Model): - type: str - - @overload - def __init__( - self, - *, - type: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.AgentBlueprintReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - MANAGED_AGENT_IDENTITY_BLUEPRINT = "ManagedAgentIdentityBlueprint" - - - class azure.ai.voiceagents.models.AgentCard(_Model): - description: Optional[str] - skills: list[AgentCardSkill] - version: str - - @overload - def __init__( - self, - *, - description: Optional[str] = ..., - skills: list[AgentCardSkill], - version: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.AgentCardSkill(_Model): - description: Optional[str] - examples: Optional[list[str]] - id: str - name: str - tags: Optional[list[str]] - - @overload - def __init__( - self, - *, - description: Optional[str] = ..., - examples: Optional[list[str]] = ..., - id: str, - name: str, - tags: Optional[list[str]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.AgentDefinitionOptInKeys(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DRAFT_AGENTS_V1_PREVIEW = "DraftAgents=V1Preview" - EXTERNAL_AGENTS_V1_PREVIEW = "ExternalAgents=V1Preview" - VOICE_AGENTS_V1_PREVIEW = "VoiceAgents=V1Preview" - WORKFLOW_AGENTS_V1_PREVIEW = "WorkflowAgents=V1Preview" - - - class azure.ai.voiceagents.models.AgentEndpointAuthorizationScheme(_Model): - type: str - - @overload - def __init__( - self, - *, - type: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.AgentEndpointAuthorizationSchemeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - BOT_SERVICE = "BotService" - BOT_SERVICE_RBAC = "BotServiceRbac" - BOT_SERVICE_TENANT = "BotServiceTenant" - ENTRA = "Entra" - - - class azure.ai.voiceagents.models.AgentEndpointConfig(_Model): - authorization_schemes: Optional[list[AgentEndpointAuthorizationScheme]] - protocol_configuration: Optional[ProtocolConfiguration] - version_selector: Optional[VersionSelector] - - @overload - def __init__( - self, - *, - authorization_schemes: Optional[list[AgentEndpointAuthorizationScheme]] = ..., - protocol_configuration: Optional[ProtocolConfiguration] = ..., - version_selector: Optional[VersionSelector] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.AgentIdentity(_Model): - client_id: str - principal_id: str - status: Optional[Union[str, AgentIdentityStatus]] - - @overload - def __init__( - self, - *, - client_id: str, - principal_id: str, - status: Optional[Union[str, AgentIdentityStatus]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.AgentIdentityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ACTIVE = "active" - DISABLED = "disabled" - - - class azure.ai.voiceagents.models.AgentObjectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENT = "agent" - AGENT_CONTAINER = "agent.container" - AGENT_DELETED = "agent.deleted" - AGENT_VERSION = "agent.version" - AGENT_VERSION_DELETED = "agent.version.deleted" - - - class azure.ai.voiceagents.models.AgentState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "disabled" - ENABLED = "enabled" - - - class azure.ai.voiceagents.models.AgentStateSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENT_BLUEPRINT = "agent_blueprint" - AGENT_INSTANCE_IDENTITY = "agent_instance_identity" - - - class azure.ai.voiceagents.models.AgentVersionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ACTIVE = "active" - CREATING = "creating" - DELETED = "deleted" - DELETING = "deleting" - FAILED = "failed" - - - class azure.ai.voiceagents.models.ApiErrorResponse(_Model): - error: Error - - @overload - def __init__( - self, - *, - error: Error - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.AzureAvatarVoiceSyncVoice(AzureVoice, discriminator='avatar-voice-sync'): - custom_lexicon_url: str - custom_text_normalization_url: str - locale: str - model: Union[str, PersonalVoiceModel] - pitch: str - prefer_locales: list[str] - rate: str - style: str - temperature: float - type: Literal[AzureVoiceType.AVATAR_VOICE_SYNC] - volume: str - - @overload - def __init__( - self, - *, - custom_lexicon_url: Optional[str] = ..., - custom_text_normalization_url: Optional[str] = ..., - locale: Optional[str] = ..., - model: Union[str, PersonalVoiceModel], - pitch: Optional[str] = ..., - prefer_locales: Optional[list[str]] = ..., - rate: Optional[str] = ..., - style: Optional[str] = ..., - temperature: Optional[float] = ..., - volume: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.AzureCustomVoice(AzureVoice, discriminator='azure-custom'): - custom_lexicon_url: str - custom_text_normalization_url: str - endpoint_id: str - locale: str - name: str - pitch: str - prefer_locales: list[str] - rate: str - style: str - temperature: float - type: Literal[AzureVoiceType.AZURE_CUSTOM] - volume: str - - @overload - def __init__( - self, - *, - custom_lexicon_url: Optional[str] = ..., - custom_text_normalization_url: Optional[str] = ..., - endpoint_id: str, - locale: Optional[str] = ..., - name: str, - pitch: Optional[str] = ..., - prefer_locales: Optional[list[str]] = ..., - rate: Optional[str] = ..., - style: Optional[str] = ..., - temperature: Optional[float] = ..., - volume: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.AzurePersonalVoice(AzureVoice, discriminator='azure-personal'): - custom_lexicon_url: str - custom_text_normalization_url: str - locale: str - model: Union[str, PersonalVoiceModel] - name: str - pitch: str - prefer_locales: list[str] - rate: str - style: str - temperature: float - type: Literal[AzureVoiceType.AZURE_PERSONAL] - volume: str - - @overload - def __init__( - self, - *, - custom_lexicon_url: Optional[str] = ..., - custom_text_normalization_url: Optional[str] = ..., - locale: Optional[str] = ..., - model: Union[str, PersonalVoiceModel], - name: str, - pitch: Optional[str] = ..., - prefer_locales: Optional[list[str]] = ..., - rate: Optional[str] = ..., - style: Optional[str] = ..., - temperature: Optional[float] = ..., - volume: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.AzureRealtimeNativeVoice(_Model): - name: Union[str, AzureRealtimeNativeVoiceName] - type: Literal["azure-realtime-native"] - - @overload - def __init__( - self, - *, - name: Union[str, AzureRealtimeNativeVoiceName] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.AzureRealtimeNativeVoiceName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AARTI = "aarti" - ALVARO = "alvaro" - ANDREW = "andrew" - ANTONIO = "antonio" - AVA = "ava" - CLARA = "clara" - DALIA = "dalia" - DENISE = "denise" - DIEGO = "diego" - DIYA = "diya" - ELSA = "elsa" - EMMA = "emma" - FLORIAN = "florian" - FRANCISCA = "francisca" - HYUNSU = "hyunsu" - JORGE = "jorge" - KEITA = "keita" - LIAM = "liam" - MEERA = "meera" - NANAMI = "nanami" - NATASHA = "natasha" - NIWAT = "niwat" - PREMWADEE = "premwadee" - REMY = "remy" - RYAN = "ryan" - SERAPHINA = "seraphina" - SONIA = "sonia" - SUNHI = "sunhi" - SYLVIE = "sylvie" - THIERRY = "thierry" - WILLIAM = "william" - XIAOXIAO = "xiaoxiao" - XIMENA = "ximena" - YUNXI = "yunxi" - - - class azure.ai.voiceagents.models.AzureStandardVoice(AzureVoice, discriminator='azure-standard'): - custom_lexicon_url: str - custom_text_normalization_url: str - locale: str - multi_talker_speaker_name: Optional[str] - name: str - pitch: str - prefer_locales: list[str] - rate: str - style: str - temperature: float - type: Literal[AzureVoiceType.AZURE_STANDARD] - volume: str - - @overload - def __init__( - self, - *, - custom_lexicon_url: Optional[str] = ..., - custom_text_normalization_url: Optional[str] = ..., - locale: Optional[str] = ..., - multi_talker_speaker_name: Optional[str] = ..., - name: str, - pitch: Optional[str] = ..., - prefer_locales: Optional[list[str]] = ..., - rate: Optional[str] = ..., - style: Optional[str] = ..., - temperature: Optional[float] = ..., - volume: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.AzureVoice(_Model): - custom_lexicon_url: Optional[str] - custom_text_normalization_url: Optional[str] - locale: Optional[str] - pitch: Optional[str] - prefer_locales: Optional[list[str]] - rate: Optional[str] - style: Optional[str] - temperature: Optional[float] - type: str - volume: Optional[str] - - @overload - def __init__( - self, - *, - custom_lexicon_url: Optional[str] = ..., - custom_text_normalization_url: Optional[str] = ..., - locale: Optional[str] = ..., - pitch: Optional[str] = ..., - prefer_locales: Optional[list[str]] = ..., - rate: Optional[str] = ..., - style: Optional[str] = ..., - temperature: Optional[float] = ..., - type: str, - volume: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.AzureVoiceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AVATAR_VOICE_SYNC = "avatar-voice-sync" - AZURE_CUSTOM = "azure-custom" - AZURE_PERSONAL = "azure-personal" - AZURE_STANDARD = "azure-standard" - - - class azure.ai.voiceagents.models.BotServiceAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator='BotService'): - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.BotServiceRbacAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator='BotServiceRbac'): - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.BotServiceTenantAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator='BotServiceTenant'): - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.CallableToolAllowedCaller(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DIRECT = "direct" - PROGRAMMATIC = "programmatic" - - - class azure.ai.voiceagents.models.CreateTranscriptionResponseJsonUsage(_Model): - type: str - - @overload - def __init__( - self, - *, - type: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.CreateTranscriptionResponseJsonUsageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DURATION = "duration" - TOKENS = "tokens" - - - class azure.ai.voiceagents.models.EntraAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator='Entra'): - type: Literal[AgentEndpointAuthorizationSchemeType.ENTRA] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.Error(_Model): - additional_info: Optional[dict[str, Any]] - code: str - debug_info: Optional[dict[str, Any]] - details: Optional[list[Error]] - message: str - param: Optional[str] - type: Optional[str] - - @overload - def __init__( - self, - *, - additional_info: Optional[dict[str, Any]] = ..., - code: str, - debug_info: Optional[dict[str, Any]] = ..., - details: Optional[list[Error]] = ..., - message: str, - param: Optional[str] = ..., - type: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.FixedRatioVersionSelectionRule(VersionSelectionRule, discriminator='FixedRatio'): - agent_version: str - traffic_percentage: int - type: Literal[VersionSelectorType.FIXED_RATIO] - - @overload - def __init__( - self, - *, - agent_version: str, - traffic_percentage: int - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.InvocationsProtocolConfiguration(_Model): - - - class azure.ai.voiceagents.models.InvocationsWsProtocolConfiguration(_Model): - - - class azure.ai.voiceagents.models.LlmGeneratedVoiceGreetingConfig(VoiceGreetingConfig, discriminator='llm_generated'): - fallback_text: Optional[str] - prompt: str - tool_choice: Optional[Union[str, VoiceGreetingToolChoice]] - type: Literal["llm_generated"] - - @overload - def __init__( - self, - *, - fallback_text: Optional[str] = ..., - prompt: str, - tool_choice: Optional[Union[str, VoiceGreetingToolChoice]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.LogProbProperties(_Model): - bytes: list[int] - logprob: float - token: str - - @overload - def __init__( - self, - *, - bytes: list[int], - logprob: float, - token: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.MCPListToolsTool(_Model): - annotations: Optional[MCPListToolsToolAnnotations] - description: Optional[str] - input_schema: MCPListToolsToolInputSchema - name: str - - @overload - def __init__( - self, - *, - annotations: Optional[MCPListToolsToolAnnotations] = ..., - description: Optional[str] = ..., - input_schema: MCPListToolsToolInputSchema, - name: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.MCPListToolsToolAnnotations(_Model): - - - class azure.ai.voiceagents.models.MCPListToolsToolInputSchema(_Model): - - - class azure.ai.voiceagents.models.MCPTool(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, - *, - 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.voiceagents.models.MCPToolFilter(_Model): - read_only: Optional[bool] - tool_names: Optional[list[str]] - - @overload - def __init__( - self, - *, - read_only: Optional[bool] = ..., - tool_names: Optional[list[str]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.MCPToolRequireApproval(_Model): - always: Optional[MCPToolFilter] - never: Optional[MCPToolFilter] - - @overload - def __init__( - self, - *, - always: Optional[MCPToolFilter] = ..., - never: Optional[MCPToolFilter] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.ManagedAgentIdentityBlueprintReference(AgentBlueprintReference, discriminator='ManagedAgentIdentityBlueprint'): - blueprint_id: str - type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] - - @overload - def __init__( - self, - *, - blueprint_id: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.McpProtocolConfiguration(_Model): - - - class azure.ai.voiceagents.models.Metadata(_Model): - - - class azure.ai.voiceagents.models.OpenAIVoice(_Model): - name: Union[str, VoiceIdsShared] - type: Literal["openai"] - - @overload - def __init__( - self, - *, - name: Union[str, VoiceIdsShared] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.PageOrder(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ASC = "asc" - DESC = "desc" - - - class azure.ai.voiceagents.models.PersonalVoiceModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DRAGON_HD_OMNI_LATEST_NEURAL = "DragonHDOmniLatestNeural" - DRAGON_LATEST_NEURAL = "DragonLatestNeural" - MAI_VOICE = "MAI-Voice" - - - class azure.ai.voiceagents.models.ProtocolConfiguration(_Model): - a2_a: Optional[A2AProtocolConfiguration] - activity: Optional[ActivityProtocolConfiguration] - invocations: Optional[InvocationsProtocolConfiguration] - invocations_ws: Optional[InvocationsWsProtocolConfiguration] - mcp: Optional[McpProtocolConfiguration] - responses: Optional[ResponsesProtocolConfiguration] - - @overload - def __init__( - self, - *, - a2_a: Optional[A2AProtocolConfiguration] = ..., - activity: Optional[ActivityProtocolConfiguration] = ..., - invocations: Optional[InvocationsProtocolConfiguration] = ..., - invocations_ws: Optional[InvocationsWsProtocolConfiguration] = ..., - mcp: Optional[McpProtocolConfiguration] = ..., - responses: Optional[ResponsesProtocolConfiguration] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RaiConfig(_Model): - rai_policy_name: str - - @overload - def __init__( - self, - *, - rai_policy_name: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeAudioFormats(_Model): - type: str - - @overload - def __init__( - self, - *, - type: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeAudioFormatsAudioPcm(RealtimeAudioFormats, discriminator='audio/pcm'): - rate: Optional[Literal[24000]] - type: Literal[RealtimeAudioFormatsType.AUDIO_PCM] - - @overload - def __init__( - self, - *, - rate: Optional[Literal[24000]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeAudioFormatsAudioPcma(RealtimeAudioFormats, discriminator='audio/pcma'): - type: Literal[RealtimeAudioFormatsType.AUDIO_PCMA] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeAudioFormatsAudioPcmu(RealtimeAudioFormats, discriminator='audio/pcmu'): - type: Literal[RealtimeAudioFormatsType.AUDIO_PCMU] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeAudioFormatsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AUDIO_PCM = "audio/pcm" - AUDIO_PCMA = "audio/pcma" - AUDIO_PCMU = "audio/pcmu" - - - class azure.ai.voiceagents.models.RealtimeClientEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CONVERSATION_ITEM_CREATE = "conversation.item.create" - CONVERSATION_ITEM_DELETE = "conversation.item.delete" - CONVERSATION_ITEM_RETRIEVE = "conversation.item.retrieve" - CONVERSATION_ITEM_TRUNCATE = "conversation.item.truncate" - INPUT_AUDIO_BUFFER_APPEND = "input_audio_buffer.append" - INPUT_AUDIO_BUFFER_CLEAR = "input_audio_buffer.clear" - INPUT_AUDIO_BUFFER_COMMIT = "input_audio_buffer.commit" - OUTPUT_AUDIO_BUFFER_CLEAR = "output_audio_buffer.clear" - RESPONSE_CANCEL = "response.cancel" - RESPONSE_CREATE = "response.create" - SESSION_UPDATE = "session.update" - - - class azure.ai.voiceagents.models.RealtimeConversationItem(_Model): - type: str - - @overload - def __init__( - self, - *, - type: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeConversationItemFunctionCall(RealtimeConversationItem, discriminator='function_call'): - arguments: str - call_id: Optional[str] - id: Optional[str] - name: str - object: Optional[Literal["item"]] - status: Optional[Literal["completed", "incomplete", "in_progress"]] - type: Literal[RealtimeConversationItemType.FUNCTION_CALL] - - @overload - def __init__( - self, - *, - arguments: str, - call_id: Optional[str] = ..., - id: Optional[str] = ..., - name: str, - object: Optional[Literal[item]] = ..., - status: Optional[Literal[completed, incomplete, in_progress]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeConversationItemFunctionCallOutput(RealtimeConversationItem, discriminator='function_call_output'): - call_id: str - id: Optional[str] - object: Optional[Literal["item"]] - output: str - status: Optional[Literal["completed", "incomplete", "in_progress"]] - type: Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT] - - @overload - def __init__( - self, - *, - call_id: str, - id: Optional[str] = ..., - object: Optional[Literal[item]] = ..., - output: str, - status: Optional[Literal[completed, incomplete, in_progress]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeConversationItemMessage(_Model): - role: str - - @overload - def __init__( - self, - *, - role: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistant(RealtimeConversationItemMessage, discriminator='assistant'): - content: list[RealtimeConversationItemMessageAssistantContent] - id: Optional[str] - object: Optional[Literal["item"]] - role: Literal[RealtimeConversationItemMessageType.ASSISTANT] - status: Optional[Literal["completed", "incomplete", "in_progress"]] - type: Literal["message"] - - @overload - def __init__( - self, - *, - content: list[RealtimeConversationItemMessageAssistantContent], - id: Optional[str] = ..., - object: Optional[Literal[item]] = ..., - status: Optional[Literal[completed, incomplete, in_progress]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistantContent(_Model): - audio: Optional[str] - text: Optional[str] - transcript: Optional[str] - type: Optional[Literal["output_text", "output_audio"]] - - @overload - def __init__( - self, - *, - audio: Optional[str] = ..., - text: Optional[str] = ..., - transcript: Optional[str] = ..., - type: Optional[Literal[output_text, output_audio]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeConversationItemMessageSystem(RealtimeConversationItemMessage, discriminator='system'): - content: list[RealtimeConversationItemMessageSystemContent] - id: Optional[str] - object: Optional[Literal["item"]] - role: Literal[RealtimeConversationItemMessageType.SYSTEM] - status: Optional[Literal["completed", "incomplete", "in_progress"]] - type: Literal["message"] - - @overload - def __init__( - self, - *, - content: list[RealtimeConversationItemMessageSystemContent], - id: Optional[str] = ..., - object: Optional[Literal[item]] = ..., - status: Optional[Literal[completed, incomplete, in_progress]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeConversationItemMessageSystemContent(_Model): - text: Optional[str] - type: Optional[Literal["input_text"]] - - @overload - def __init__( - self, - *, - text: Optional[str] = ..., - type: Optional[Literal[input_text]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeConversationItemMessageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ASSISTANT = "assistant" - SYSTEM = "system" - USER = "user" - - - class azure.ai.voiceagents.models.RealtimeConversationItemMessageUser(RealtimeConversationItemMessage, discriminator='user'): - content: list[RealtimeConversationItemMessageUserContent] - id: Optional[str] - object: Optional[Literal["item"]] - role: Literal[RealtimeConversationItemMessageType.USER] - status: Optional[Literal["completed", "incomplete", "in_progress"]] - type: Literal["message"] - - @overload - def __init__( - self, - *, - content: list[RealtimeConversationItemMessageUserContent], - id: Optional[str] = ..., - object: Optional[Literal[item]] = ..., - status: Optional[Literal[completed, incomplete, in_progress]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeConversationItemMessageUserContent(_Model): - audio: Optional[str] - detail: Optional[Literal["auto", "low", "high"]] - image_url: Optional[str] - text: Optional[str] - transcript: Optional[str] - type: Optional[Literal["input_text", "input_audio", "input_image"]] - - @overload - def __init__( - self, - *, - audio: Optional[str] = ..., - detail: Optional[Literal[auto, low, high]] = ..., - image_url: Optional[str] = ..., - text: Optional[str] = ..., - transcript: Optional[str] = ..., - type: Optional[Literal[input_text, input_audio, input_image]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FUNCTION_CALL = "function_call" - FUNCTION_CALL_OUTPUT = "function_call_output" - MCP_APPROVAL_REQUEST = "mcp_approval_request" - MCP_APPROVAL_RESPONSE = "mcp_approval_response" - MCP_CALL = "mcp_call" - MCP_LIST_TOOLS = "mcp_list_tools" - - - class azure.ai.voiceagents.models.RealtimeFunctionTool(_Model): - description: Optional[str] - name: Optional[str] - parameters: Optional[RealtimeFunctionToolParameters] - type: Optional[Literal["function"]] - - @overload - def __init__( - self, - *, - description: Optional[str] = ..., - name: Optional[str] = ..., - parameters: Optional[RealtimeFunctionToolParameters] = ..., - type: Optional[Literal[function]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeFunctionToolParameters(_Model): - - - class azure.ai.voiceagents.models.RealtimeMCPApprovalRequest(RealtimeConversationItem, discriminator='mcp_approval_request'): - arguments: str - id: str - name: str - server_label: str - type: Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST] - - @overload - def __init__( - self, - *, - arguments: str, - id: str, - name: str, - server_label: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeMCPApprovalResponse(RealtimeConversationItem, discriminator='mcp_approval_response'): - approval_request_id: str - approve: bool - id: str - reason: Optional[str] - type: Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE] - - @overload - def __init__( - self, - *, - approval_request_id: str, - approve: bool, - id: str, - reason: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeMCPError(_Model): - type: str - - @overload - def __init__( - self, - *, - type: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeMCPHTTPError(RealtimeMCPError, discriminator='http_error'): - code: int - message: str - type: Literal[RealtimeMcpErrorType.HTTP_ERROR] - - @overload - def __init__( - self, - *, - code: int, - message: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeMCPListTools(RealtimeConversationItem, discriminator='mcp_list_tools'): - id: Optional[str] - server_label: str - tools: list[MCPListToolsTool] - type: Literal[RealtimeConversationItemType.MCP_LIST_TOOLS] - - @overload - def __init__( - self, - *, - id: Optional[str] = ..., - server_label: str, - tools: list[MCPListToolsTool] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeMCPProtocolError(RealtimeMCPError, discriminator='protocol_error'): - code: int - message: str - type: Literal[RealtimeMcpErrorType.PROTOCOL_ERROR] - - @overload - def __init__( - self, - *, - code: int, - message: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeMCPToolCall(RealtimeConversationItem, discriminator='mcp_call'): - approval_request_id: Optional[str] - arguments: str - error: Optional[RealtimeMCPError] - id: str - name: str - output: Optional[str] - server_label: str - type: Literal[RealtimeConversationItemType.MCP_CALL] - - @overload - def __init__( - self, - *, - approval_request_id: Optional[str] = ..., - arguments: str, - error: Optional[RealtimeMCPError] = ..., - id: str, - name: str, - output: Optional[str] = ..., - server_label: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeMCPToolExecutionError(RealtimeMCPError, discriminator='tool_execution_error'): - message: str - type: Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR] - - @overload - def __init__( - self, - *, - message: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeMcpErrorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - HTTP_ERROR = "http_error" - PROTOCOL_ERROR = "protocol_error" - TOOL_EXECUTION_ERROR = "tool_execution_error" - - - class azure.ai.voiceagents.models.RealtimeReasoning(_Model): - effort: Optional[Union[str, RealtimeReasoningEffort]] - - @overload - def __init__( - self, - *, - effort: Optional[Union[str, RealtimeReasoningEffort]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): - HIGH = "high" - LOW = "low" - MEDIUM = "medium" - MINIMAL = "minimal" - XHIGH = "xhigh" - - - class azure.ai.voiceagents.models.RealtimeResponseStatusDetails(_Model): - error: Optional[RealtimeResponseStatusDetailsError] - reason: Optional[Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"]] - type: Optional[Literal["completed", "cancelled", "failed", "incomplete"]] - - @overload - def __init__( - self, - *, - error: Optional[RealtimeResponseStatusDetailsError] = ..., - reason: Optional[Literal[turn_detected, client_cancelled, max_output_tokens, content_filter]] = ..., - type: Optional[Literal[completed, cancelled, failed, incomplete]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeResponseStatusDetailsError(_Model): - code: Optional[str] - type: Optional[str] - - @overload - def __init__( - self, - *, - code: Optional[str] = ..., - type: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeResponseUsage(_Model): - input_token_details: Optional[RealtimeResponseUsageInputTokenDetails] - input_tokens: Optional[int] - output_token_details: Optional[RealtimeResponseUsageOutputTokenDetails] - output_tokens: Optional[int] - total_tokens: Optional[int] - - @overload - def __init__( - self, - *, - input_token_details: Optional[RealtimeResponseUsageInputTokenDetails] = ..., - input_tokens: Optional[int] = ..., - output_token_details: Optional[RealtimeResponseUsageOutputTokenDetails] = ..., - output_tokens: Optional[int] = ..., - total_tokens: Optional[int] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeResponseUsageInputTokenDetails(_Model): - audio_tokens: Optional[int] - cached_tokens: Optional[int] - cached_tokens_details: Optional[RealtimeResponseUsageInputTokenDetailsCachedTokensDetails] - image_tokens: Optional[int] - text_tokens: Optional[int] - - @overload - def __init__( - self, - *, - audio_tokens: Optional[int] = ..., - cached_tokens: Optional[int] = ..., - cached_tokens_details: Optional[RealtimeResponseUsageInputTokenDetailsCachedTokensDetails] = ..., - image_tokens: Optional[int] = ..., - text_tokens: Optional[int] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails(_Model): - audio_tokens: Optional[int] - image_tokens: Optional[int] - text_tokens: Optional[int] - - @overload - def __init__( - self, - *, - audio_tokens: Optional[int] = ..., - image_tokens: Optional[int] = ..., - text_tokens: Optional[int] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeResponseUsageOutputTokenDetails(_Model): - audio_tokens: Optional[int] - text_tokens: Optional[int] - - @overload - def __init__( - self, - *, - audio_tokens: Optional[int] = ..., - text_tokens: Optional[int] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeServerEvent(_Model): - type: str - - @overload - def __init__( - self, - *, - type: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError(_Model): - code: Optional[str] - message: Optional[str] - param: Optional[str] - type: Optional[str] - - @overload - def __init__( - self, - *, - code: Optional[str] = ..., - message: Optional[str] = ..., - param: Optional[str] = ..., - type: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeServerEventRateLimitsUpdatedRateLimits(_Model): - limit: Optional[int] - name: Optional[Literal["requests", "tokens"]] - remaining: Optional[int] - reset_seconds: Optional[float] - - @overload - def __init__( - self, - *, - limit: Optional[int] = ..., - name: Optional[Literal[requests, tokens]] = ..., - remaining: Optional[int] = ..., - reset_seconds: Optional[float] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeServerEventResponseContentPartAdded(RealtimeServerEvent, discriminator='response.content_part.added'): - content_index: int - event_id: str - item_id: str - output_index: int - part: RealtimeServerEventResponseContentPartAddedPart - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED] - - @overload - def __init__( - self, - *, - content_index: int, - event_id: str, - item_id: str, - output_index: int, - part: RealtimeServerEventResponseContentPartAddedPart, - response_id: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeServerEventResponseContentPartAddedPart(_Model): - audio: Optional[str] - text: Optional[str] - transcript: Optional[str] - type: Optional[Literal["audio", "text"]] - - @overload - def __init__( - self, - *, - audio: Optional[str] = ..., - text: Optional[str] = ..., - transcript: Optional[str] = ..., - type: Optional[Literal[audio, text]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.RealtimeServerEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CONVERSATION_CREATED = "conversation.created" - CONVERSATION_ITEM_ADDED = "conversation.item.added" - CONVERSATION_ITEM_CREATED = "conversation.item.created" - CONVERSATION_ITEM_DELETED = "conversation.item.deleted" - CONVERSATION_ITEM_DONE = "conversation.item.done" - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED = "conversation.item.input_audio_transcription.completed" - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA = "conversation.item.input_audio_transcription.delta" - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED = "conversation.item.input_audio_transcription.failed" - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT = "conversation.item.input_audio_transcription.segment" - CONVERSATION_ITEM_RETRIEVED = "conversation.item.retrieved" - CONVERSATION_ITEM_TRUNCATED = "conversation.item.truncated" - ERROR = "error" - INPUT_AUDIO_BUFFER_CLEARED = "input_audio_buffer.cleared" - INPUT_AUDIO_BUFFER_COMMITTED = "input_audio_buffer.committed" - INPUT_AUDIO_BUFFER_DTMF_EVENT_RECEIVED = "input_audio_buffer.dtmf_event_received" - INPUT_AUDIO_BUFFER_SPEECH_STARTED = "input_audio_buffer.speech_started" - INPUT_AUDIO_BUFFER_SPEECH_STOPPED = "input_audio_buffer.speech_stopped" - INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED = "input_audio_buffer.timeout_triggered" - MCP_LIST_TOOLS_COMPLETED = "mcp_list_tools.completed" - MCP_LIST_TOOLS_FAILED = "mcp_list_tools.failed" - MCP_LIST_TOOLS_IN_PROGRESS = "mcp_list_tools.in_progress" - OUTPUT_AUDIO_BUFFER_CLEARED = "output_audio_buffer.cleared" - OUTPUT_AUDIO_BUFFER_STARTED = "output_audio_buffer.started" - OUTPUT_AUDIO_BUFFER_STOPPED = "output_audio_buffer.stopped" - RATE_LIMITS_UPDATED = "rate_limits.updated" - RESPONSE_CONTENT_PART_ADDED = "response.content_part.added" - RESPONSE_CONTENT_PART_DONE = "response.content_part.done" - RESPONSE_CREATED = "response.created" - RESPONSE_DONE = "response.done" - RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA = "response.function_call_arguments.delta" - RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE = "response.function_call_arguments.done" - RESPONSE_MCP_CALL_ARGUMENTS_DELTA = "response.mcp_call_arguments.delta" - RESPONSE_MCP_CALL_ARGUMENTS_DONE = "response.mcp_call_arguments.done" - RESPONSE_MCP_CALL_COMPLETED = "response.mcp_call.completed" - RESPONSE_MCP_CALL_FAILED = "response.mcp_call.failed" - RESPONSE_MCP_CALL_IN_PROGRESS = "response.mcp_call.in_progress" - RESPONSE_OUTPUT_AUDIO_DELTA = "response.output_audio.delta" - RESPONSE_OUTPUT_AUDIO_DONE = "response.output_audio.done" - RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA = "response.output_audio_transcript.delta" - RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE = "response.output_audio_transcript.done" - RESPONSE_OUTPUT_ITEM_ADDED = "response.output_item.added" - RESPONSE_OUTPUT_ITEM_DONE = "response.output_item.done" - RESPONSE_OUTPUT_TEXT_DELTA = "response.output_text.delta" - RESPONSE_OUTPUT_TEXT_DONE = "response.output_text.done" - SESSION_CREATED = "session.created" - SESSION_UPDATED = "session.updated" - - - class azure.ai.voiceagents.models.RealtimeToolChoiceFunction(_Model): - name: str - type: Literal[ToolChoiceParamType.FUNCTION] - - @overload - def __init__( - self, - *, - name: str, - type: Literal[ToolChoiceParamType.FUNCTION] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.ResponsesProtocolConfiguration(_Model): - - - class azure.ai.voiceagents.models.StructuredInputDefinition(_Model): - default_value: Optional[Any] - description: Optional[str] - required: Optional[bool] - schema: Optional[dict[str, Any]] - - @overload - def __init__( - self, - *, - default_value: Optional[Any] = ..., - description: Optional[str] = ..., - required: Optional[bool] = ..., - schema: Optional[dict[str, Any]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.TemplateVoiceGreetingConfig(VoiceGreetingConfig, discriminator='template'): - text: str - type: Literal["template"] - - @overload - def __init__( - self, - *, - text: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.Tool(_Model): - type: str - - @overload - def __init__( - self, - *, - type: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.ToolChoiceFunction(ToolChoiceParam, discriminator='function'): - name: str - type: Literal[ToolChoiceParamType.FUNCTION] - - @overload - def __init__( - self, - *, - name: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.ToolChoiceMCP(ToolChoiceParam, discriminator='mcp'): - name: Optional[str] - server_label: str - type: Literal[ToolChoiceParamType.MCP] - - @overload - def __init__( - self, - *, - name: Optional[str] = ..., - server_label: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.ToolChoiceOptions(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AUTO = "auto" - NONE = "none" - REQUIRED = "required" - - - class azure.ai.voiceagents.models.ToolChoiceParam(_Model): - type: str - - @overload - def __init__( - self, - *, - type: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.ToolChoiceParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ALLOWED_TOOLS = "allowed_tools" - APPLY_PATCH = "apply_patch" - CODE_INTERPRETER = "code_interpreter" - COMPUTER = "computer" - COMPUTER_USE = "computer_use" - COMPUTER_USE_PREVIEW = "computer_use_preview" - CUSTOM = "custom" - FILE_SEARCH = "file_search" - FUNCTION = "function" - IMAGE_GENERATION = "image_generation" - MCP = "mcp" - PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" - SHELL = "shell" - WEB_SEARCH_PREVIEW = "web_search_preview" - WEB_SEARCH_PREVIEW2025_03_11 = "web_search_preview_2025_03_11" - - - class azure.ai.voiceagents.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.voiceagents.models.ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - A2_A_PREVIEW = "a2a_preview" - APPLY_PATCH = "apply_patch" - AZURE_AI_SEARCH = "azure_ai_search" - AZURE_FUNCTION = "azure_function" - BING_CUSTOM_SEARCH_PREVIEW = "bing_custom_search_preview" - BING_GROUNDING = "bing_grounding" - BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" - CAPTURE_STRUCTURED_OUTPUTS = "capture_structured_outputs" - CODE_INTERPRETER = "code_interpreter" - COMPUTER = "computer" - COMPUTER_USE_PREVIEW = "computer_use_preview" - CUSTOM = "custom" - FABRIC_DATAAGENT_PREVIEW = "fabric_dataagent_preview" - FABRIC_IQ_PREVIEW = "fabric_iq_preview" - FILE_SEARCH = "file_search" - FUNCTION = "function" - IMAGE_GENERATION = "image_generation" - LOCAL_SHELL = "local_shell" - MCP = "mcp" - MEMORY_SEARCH_PREVIEW = "memory_search_preview" - NAMESPACE = "namespace" - OPENAPI = "openapi" - PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" - SHAREPOINT_GROUNDING_PREVIEW = "sharepoint_grounding_preview" - SHELL = "shell" - TOOLBOX_SEARCH_PREVIEW = "toolbox_search_preview" - TOOL_SEARCH = "tool_search" - WEB_SEARCH = "web_search" - WEB_SEARCH_PREVIEW = "web_search_preview" - WORK_IQ_PREVIEW = "work_iq_preview" - - - class azure.ai.voiceagents.models.TranscriptTextUsageDuration(CreateTranscriptionResponseJsonUsage, discriminator='duration'): - seconds: timedelta - type: Literal[CreateTranscriptionResponseJsonUsageType.DURATION] - - @overload - def __init__( - self, - *, - seconds: timedelta - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.TranscriptTextUsageTokens(CreateTranscriptionResponseJsonUsage, discriminator='tokens'): - input_token_details: Optional[TranscriptTextUsageTokensInputTokenDetails] - input_tokens: int - output_tokens: int - total_tokens: int - type: Literal[CreateTranscriptionResponseJsonUsageType.TOKENS] - - @overload - def __init__( - self, - *, - input_token_details: Optional[TranscriptTextUsageTokensInputTokenDetails] = ..., - input_tokens: int, - output_tokens: int, - total_tokens: int - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.TranscriptTextUsageTokensInputTokenDetails(_Model): - audio_tokens: Optional[int] - text_tokens: Optional[int] - - @overload - def __init__( - self, - *, - audio_tokens: Optional[int] = ..., - text_tokens: Optional[int] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VersionSelectionRule(_Model): - agent_version: str - type: str - - @overload - def __init__( - self, - *, - agent_version: str, - type: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VersionSelector(_Model): - version_selection_rules: list[VersionSelectionRule] - - @overload - def __init__( - self, - *, - version_selection_rules: list[VersionSelectionRule] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VersionSelectorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FIXED_RATIO = "FixedRatio" - - - class azure.ai.voiceagents.models.VoiceAgentAnimationConfig(_Model): - model_name: Optional[str] - outputs: Optional[list[Union[str, VoiceAgentAnimationOutputType]]] - - @overload - def __init__( - self, - *, - model_name: Optional[str] = ..., - outputs: Optional[list[Union[str, VoiceAgentAnimationOutputType]]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentAnimationOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - BLENDSHAPES = "blendshapes" - VISEME_ID = "viseme_id" - - - class azure.ai.voiceagents.models.VoiceAgentAvatarIceServer(_Model): - credential: Optional[str] - urls: list[str] - username: Optional[str] - - @overload - def __init__( - self, - *, - credential: Optional[str] = ..., - urls: list[str], - username: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentAvatarOutputProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - WEBRTC = "webrtc" - WEBSOCKET = "websocket" - WEBSOCKET_BINARY = "websocket-binary" - - - class azure.ai.voiceagents.models.VoiceAgentAvatarScene(_Model): - amplitude: Optional[float] - position_x: Optional[float] - position_y: Optional[float] - rotation_x: Optional[float] - rotation_y: Optional[float] - rotation_z: Optional[float] - zoom: Optional[float] - - @overload - def __init__( - self, - *, - amplitude: Optional[float] = ..., - position_x: Optional[float] = ..., - position_y: Optional[float] = ..., - rotation_x: Optional[float] = ..., - rotation_y: Optional[float] = ..., - rotation_z: Optional[float] = ..., - zoom: Optional[float] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentAvatarType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - PHOTO_AVATAR = "photo_avatar" - VIDEO_AVATAR = "video_avatar" - - - class azure.ai.voiceagents.models.VoiceAgentAvatarVideoBackground(_Model): - color: Optional[str] - image_url: Optional[str] - - @overload - def __init__( - self, - *, - color: Optional[str] = ..., - image_url: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentAvatarVideoCrop(_Model): - bottom_right: list[int] - top_left: list[int] - - @overload - def __init__( - self, - *, - bottom_right: list[int], - top_left: list[int] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentAvatarVideoParams(_Model): - background: Optional[VoiceAgentAvatarVideoBackground] - bitrate: Optional[int] - codec: Optional[Literal["h264"]] - crop: Optional[VoiceAgentAvatarVideoCrop] - gop_size: Optional[int] - resolution: Optional[VoiceAgentAvatarVideoResolution] - - @overload - def __init__( - self, - *, - background: Optional[VoiceAgentAvatarVideoBackground] = ..., - bitrate: Optional[int] = ..., - codec: Optional[Literal[h264]] = ..., - crop: Optional[VoiceAgentAvatarVideoCrop] = ..., - gop_size: Optional[int] = ..., - resolution: Optional[VoiceAgentAvatarVideoResolution] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentAvatarVideoResolution(_Model): - height: int - width: int - - @overload - def __init__( - self, - *, - height: int, - width: int - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentAzureMultilingualSemanticVadTurnDetection(_Model): - auto_truncate: Optional[bool] - create_response: Optional[bool] - end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] - idle_timeout_ms: Optional[int] - interrupt_response: Optional[bool] - languages: Optional[list[str]] - prefix_padding_ms: Optional[int] - remove_filler_words: Optional[bool] - silence_duration_ms: Optional[int] - speech_duration_ms: Optional[int] - threshold: Optional[float] - type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] - - @overload - def __init__( - self, - *, - auto_truncate: Optional[bool] = ..., - create_response: Optional[bool] = ..., - end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] = ..., - idle_timeout_ms: Optional[int] = ..., - interrupt_response: Optional[bool] = ..., - languages: Optional[list[str]] = ..., - prefix_padding_ms: Optional[int] = ..., - remove_filler_words: Optional[bool] = ..., - silence_duration_ms: Optional[int] = ..., - speech_duration_ms: Optional[int] = ..., - threshold: Optional[float] = ..., - type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentAzureSemanticVadTurnDetection(_Model): - auto_truncate: Optional[bool] - create_response: Optional[bool] - end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] - idle_timeout_ms: Optional[int] - interrupt_response: Optional[bool] - languages: Optional[list[str]] - prefix_padding_ms: Optional[int] - remove_filler_words: Optional[bool] - silence_duration_ms: Optional[int] - speech_duration_ms: Optional[int] - threshold: Optional[float] - type: Union[str, VoiceAgentAzureSemanticVadType] - - @overload - def __init__( - self, - *, - auto_truncate: Optional[bool] = ..., - create_response: Optional[bool] = ..., - end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] = ..., - idle_timeout_ms: Optional[int] = ..., - interrupt_response: Optional[bool] = ..., - languages: Optional[list[str]] = ..., - prefix_padding_ms: Optional[int] = ..., - remove_filler_words: Optional[bool] = ..., - silence_duration_ms: Optional[int] = ..., - speech_duration_ms: Optional[int] = ..., - threshold: Optional[float] = ..., - type: Union[str, VoiceAgentAzureSemanticVadType] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentAzureSemanticVadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DEFAULT = "azure_semantic_vad" - ENGLISH = "azure_semantic_vad_en" - - - class azure.ai.voiceagents.models.VoiceAgentClientEventConversationItemCreate(_Model): - event_id: Optional[str] - item: VoiceAgentCreateConversationItem - previous_item_id: Optional[str] - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE] - - @overload - def __init__( - self, - *, - event_id: Optional[str] = ..., - item: VoiceAgentCreateConversationItem, - previous_item_id: Optional[str] = ..., - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentClientEventConversationItemDelete(_Model): - event_id: Optional[str] - item_id: str - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE] - - @overload - def __init__( - self, - *, - event_id: Optional[str] = ..., - item_id: str, - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentClientEventConversationItemRetrieve(_Model): - event_id: Optional[str] - item_id: str - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE] - - @overload - def __init__( - self, - *, - event_id: Optional[str] = ..., - item_id: str, - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentClientEventConversationItemTruncate(_Model): - audio_end_ms: int - content_index: int - event_id: Optional[str] - item_id: str - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE] - - @overload - def __init__( - self, - *, - audio_end_ms: int, - content_index: int, - event_id: Optional[str] = ..., - item_id: str, - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentClientEventInputAudioBufferAppend(_Model): - audio: str - event_id: Optional[str] - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND] - - @overload - def __init__( - self, - *, - audio: str, - event_id: Optional[str] = ..., - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentClientEventInputAudioBufferClear(_Model): - event_id: Optional[str] - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR] - - @overload - def __init__( - self, - *, - event_id: Optional[str] = ..., - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentClientEventInputAudioBufferCommit(_Model): - event_id: Optional[str] - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT] - - @overload - def __init__( - self, - *, - event_id: Optional[str] = ..., - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentClientEventOutputAudioBufferClear(_Model): - event_id: Optional[str] - type: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR] - - @overload - def __init__( - self, - *, - event_id: Optional[str] = ..., - type: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentClientEventResponseCancel(_Model): - event_id: Optional[str] - response_id: Optional[str] - type: Literal[RealtimeClientEventType.RESPONSE_CANCEL] - - @overload - def __init__( - self, - *, - event_id: Optional[str] = ..., - response_id: Optional[str] = ..., - type: Literal[RealtimeClientEventType.RESPONSE_CANCEL] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentClientEventResponseCreate(_Model): - event_id: Optional[str] - response: Optional[VoiceAgentResponseCreateParams] - type: Literal[RealtimeClientEventType.RESPONSE_CREATE] - - @overload - def __init__( - self, - *, - event_id: Optional[str] = ..., - response: Optional[VoiceAgentResponseCreateParams] = ..., - type: Literal[RealtimeClientEventType.RESPONSE_CREATE] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentClientEventSessionAvatarConnect(_Model): - client_sdp: str - event_id: Optional[str] - type: Literal["connect"] - - @overload - def __init__( - self, - *, - client_sdp: str, - event_id: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentClientEventSessionUpdate(_Model): - event_id: Optional[str] - session: VoiceAgentSessionUpdateConfig - type: Literal[RealtimeClientEventType.SESSION_UPDATE] - - @overload - def __init__( - self, - *, - event_id: Optional[str] = ..., - session: VoiceAgentSessionUpdateConfig, - type: Literal[RealtimeClientEventType.SESSION_UPDATE] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentDefinition(_Model): - audio: Optional[VoiceAudioConfig] - avatar: Optional[VoiceAvatarConfig] - greeting: Optional[VoiceGreetingConfig] - instructions: Optional[str] - kind: Literal["voice"] - model: str - model_type: Union[str, VoiceModelType] - output_modalities: Optional[list[Union[str, VoiceOutputModality]]] - rai_config: Optional[RaiConfig] - store: Optional[bool] - structured_inputs: Optional[dict[str, StructuredInputDefinition]] - tools: Optional[list[VoiceAgentTool]] - - @overload - def __init__( - self, - *, - audio: Optional[VoiceAudioConfig] = ..., - avatar: Optional[VoiceAvatarConfig] = ..., - greeting: Optional[VoiceGreetingConfig] = ..., - instructions: Optional[str] = ..., - model: str, - model_type: Union[str, VoiceModelType], - output_modalities: Optional[list[Union[str, VoiceOutputModality]]] = ..., - rai_config: Optional[RaiConfig] = ..., - store: Optional[bool] = ..., - structured_inputs: Optional[dict[str, StructuredInputDefinition]] = ..., - tools: Optional[list[VoiceAgentTool]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentEchoCancellation(_Model): - channels: Optional[int] - reference_source: Optional[Union[str, VoiceAgentEchoCancellationReferenceSource]] - type: Literal["server_echo_cancellation"] - - @overload - def __init__( - self, - *, - channels: Optional[int] = ..., - reference_source: Optional[Union[str, VoiceAgentEchoCancellationReferenceSource]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentEchoCancellationReferenceSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CLIENT = "client" - SERVER = "server" - - - class azure.ai.voiceagents.models.VoiceAgentEndOfUtteranceDetection(_Model): - model: Union[str, VoiceAgentEndOfUtteranceModel] - threshold: Optional[float] - threshold_level: Optional[Union[str, VoiceAgentEndOfUtteranceThresholdLevel]] - timeout: Optional[float] - timeout_ms: Optional[int] - - @overload - def __init__( - self, - *, - model: Union[str, VoiceAgentEndOfUtteranceModel], - threshold: Optional[float] = ..., - threshold_level: Optional[Union[str, VoiceAgentEndOfUtteranceThresholdLevel]] = ..., - timeout: Optional[float] = ..., - timeout_ms: Optional[int] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentEndOfUtteranceModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - SEMANTIC_DETECTION_V1 = "semantic_detection_v1" - SEMANTIC_DETECTION_V1_EN = "semantic_detection_v1_en" - SEMANTIC_DETECTION_V1_MULTILINGUAL = "semantic_detection_v1_multilingual" - SMART_END_OF_TURN_DETECTION = "smart_end_of_turn_detection" - - - class azure.ai.voiceagents.models.VoiceAgentEndOfUtteranceThresholdLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DEFAULT = "default" - HIGH = "high" - LOW = "low" - MEDIUM = "medium" - - - class azure.ai.voiceagents.models.VoiceAgentEstimatedCost(_Model): - amount: float - byom_model_amount: Optional[float] - byom_model_price_version: Optional[str] - currency: Optional[Literal["USD"]] - input_cost: Optional[float] - output_cost: Optional[float] - price_version: str - status: Union[str, VoiceAgentEstimatedCostStatus] - unpriced_components: Optional[list[str]] - voice_live_amount: float - - @overload - def __init__( - self, - *, - amount: float, - byom_model_amount: Optional[float] = ..., - byom_model_price_version: Optional[str] = ..., - currency: Optional[Literal[USD]] = ..., - input_cost: Optional[float] = ..., - output_cost: Optional[float] = ..., - price_version: str, - status: Union[str, VoiceAgentEstimatedCostStatus], - unpriced_components: Optional[list[str]] = ..., - voice_live_amount: float - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentEstimatedCostStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - COMPLETE = "complete" - PARTIAL = "partial" - UNAVAILABLE = "unavailable" - - - class azure.ai.voiceagents.models.VoiceAgentFileSearchCallItem(_Model): - id: str - queries: Optional[list[str]] - results: Optional[list[VoiceAgentFileSearchResult]] - status: Union[str, VoiceAgentFileSearchCallStatus] - type: Literal["file_search_call"] - - @overload - def __init__( - self, - *, - id: str, - queries: Optional[list[str]] = ..., - results: Optional[list[VoiceAgentFileSearchResult]] = ..., - status: Union[str, VoiceAgentFileSearchCallStatus] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentFileSearchCallStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - COMPLETED = "completed" - FAILED = "failed" - INCOMPLETE = "incomplete" - IN_PROGRESS = "in_progress" - SEARCHING = "searching" - - - class azure.ai.voiceagents.models.VoiceAgentFileSearchResult(_Model): - attributes: Optional[dict[str, VoiceAgentFileSearchAttributeValue]] - file_id: Optional[str] - filename: Optional[str] - score: Optional[float] - text: Optional[str] - - @overload - def __init__( - self, - *, - attributes: Optional[dict[str, VoiceAgentFileSearchAttributeValue]] = ..., - file_id: Optional[str] = ..., - filename: Optional[str] = ..., - score: Optional[float] = ..., - text: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentHandoffAbortReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ERROR = "error" - USER_INTERRUPTION = "user_interruption" - - - class azure.ai.voiceagents.models.VoiceAgentHandoffEdgeConfig(_Model): - cancel_on_interruption: Optional[bool] - delay_ms: Optional[int] - description: str - id: str - source: str - target: str - target_response: Optional[Union[str, VoiceAgentHandoffTargetResponse]] - transfer_message: Optional[str] - - @overload - def __init__( - self, - *, - cancel_on_interruption: Optional[bool] = ..., - delay_ms: Optional[int] = ..., - description: str, - id: str, - source: str, - target: str, - target_response: Optional[Union[str, VoiceAgentHandoffTargetResponse]] = ..., - transfer_message: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentHandoffEdgeState(_Model): - cancel_on_interruption: Optional[bool] - delay_ms: Optional[int] - id: str - source: str - target: str - target_response: Optional[Union[str, VoiceAgentHandoffTargetResponse]] - transfer_message: Optional[str] - - @overload - def __init__( - self, - *, - cancel_on_interruption: Optional[bool] = ..., - delay_ms: Optional[int] = ..., - id: str, - source: str, - target: str, - target_response: Optional[Union[str, VoiceAgentHandoffTargetResponse]] = ..., - transfer_message: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentHandoffGraphConfig(_Model): - edges: list[VoiceAgentHandoffEdgeConfig] - max_attempts: Optional[int] - max_transfers: Optional[int] - nodes: list[VoiceAgentHandoffNodeConfig] - - @overload - def __init__( - self, - *, - edges: list[VoiceAgentHandoffEdgeConfig], - max_attempts: Optional[int] = ..., - max_transfers: Optional[int] = ..., - nodes: list[VoiceAgentHandoffNodeConfig] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentHandoffNodeConfig(_Model): - config: VoiceAgentHandoffNodeSessionConfig - description: str - id: str - - @overload - def __init__( - self, - *, - config: VoiceAgentHandoffNodeSessionConfig, - description: str, - id: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentHandoffNodeSessionConfig(_Model): - instructions: Optional[str] - interim_response: Optional[VoiceAgentInterimResponse] - max_response_output_tokens: Optional[VoiceAgentMaxOutputTokens] - model: Optional[str] - parallel_tool_calls: Optional[bool] - reasoning_effort: Optional[Union[str, VoiceAgentHandoffReasoningEffort]] - temperature: Optional[float] - tool_choice: Optional[VoiceAgentToolChoice] - tools: Optional[list[VoiceAgentSessionTool]] - voice: Optional[VoiceAgentVoice] - voice_adaptation: Optional[VoiceAgentVoiceAdaptation] - - @overload - def __init__( - self, - *, - instructions: Optional[str] = ..., - interim_response: Optional[VoiceAgentInterimResponse] = ..., - max_response_output_tokens: Optional[VoiceAgentMaxOutputTokens] = ..., - model: Optional[str] = ..., - parallel_tool_calls: Optional[bool] = ..., - reasoning_effort: Optional[Union[str, VoiceAgentHandoffReasoningEffort]] = ..., - temperature: Optional[float] = ..., - tool_choice: Optional[VoiceAgentToolChoice] = ..., - tools: Optional[list[VoiceAgentSessionTool]] = ..., - voice: Optional[VoiceAgentVoice] = ..., - voice_adaptation: Optional[VoiceAgentVoiceAdaptation] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentHandoffNodeState(_Model): - description: str - id: str - implicit: Optional[bool] - - @overload - def __init__( - self, - *, - description: str, - id: str, - implicit: Optional[bool] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentHandoffReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): - HIGH = "high" - LOW = "low" - MEDIUM = "medium" - MINIMAL = "minimal" - NONE = "none" - XHIGH = "xhigh" - - - class azure.ai.voiceagents.models.VoiceAgentHandoffState(_Model): - active_node_id: str - attempt_count: int - available_edge_ids: list[str] - edges: list[VoiceAgentHandoffEdgeState] - node_generation: int - nodes: list[VoiceAgentHandoffNodeState] - pipeline_family: Union[str, VoiceAgentPipelineFamily] - transfer_count: int - transfer_tool: RealtimeFunctionTool - - @overload - def __init__( - self, - *, - active_node_id: str, - attempt_count: int, - available_edge_ids: list[str], - edges: list[VoiceAgentHandoffEdgeState], - node_generation: int, - nodes: list[VoiceAgentHandoffNodeState], - pipeline_family: Union[str, VoiceAgentPipelineFamily], - transfer_count: int, - transfer_tool: RealtimeFunctionTool - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentHandoffTargetResponse(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AUTO = "auto" - NONE = "none" - - - class azure.ai.voiceagents.models.VoiceAgentInterimResponseConfig(_Model): - latency_threshold_ms: Optional[int] - triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] - type: str - - @overload - def __init__( - self, - *, - latency_threshold_ms: Optional[int] = ..., - triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] = ..., - type: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentInterimResponseTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): - LATENCY = "latency" - TOOL = "tool" - - - class azure.ai.voiceagents.models.VoiceAgentLlmInterimResponseConfig(VoiceAgentInterimResponseConfig, discriminator='llm_interim_response'): - instructions: Optional[str] - latency_threshold_ms: int - max_completion_tokens: Optional[int] - model: Optional[str] - triggers: Union[list[str, VoiceAgentInterimResponseTrigger]] - type: Literal["llm_interim_response"] - - @overload - def __init__( - self, - *, - instructions: Optional[str] = ..., - latency_threshold_ms: Optional[int] = ..., - max_completion_tokens: Optional[int] = ..., - model: Optional[str] = ..., - triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentMcpApprovalMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ALWAYS = "always" - NEVER_REQUIRE = "never" - - - class azure.ai.voiceagents.models.VoiceAgentMcpAssignedManagedIdentity(_Model): - audience: str - client_id: Optional[str] - type: Literal["assigned_managed_identity"] - - @overload - def __init__( - self, - *, - audience: str, - client_id: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentMcpResponseScheduling(str, Enum, metaclass=CaseInsensitiveEnumMeta): - INTERRUPT = "interrupt" - SILENT = "silent" - SKIP_IF_BUSY = "skip_if_busy" - WHEN_IDLE = "when_idle" - - - class azure.ai.voiceagents.models.VoiceAgentMcpTool(_Model): - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] - allowed_tools: Optional[Union[list[str], MCPToolFilter]] - defer_loading: Optional[bool] - headers: Optional[dict[str, str]] - project_connection_id: Optional[str] - require_approval: Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] - response_scheduling: Optional[Union[str, VoiceAgentMcpResponseScheduling]] - server_description: Optional[str] - server_label: str - server_url: Optional[str] - tool_configs: Optional[dict[str, ToolConfig]] - type: Literal[ToolType.MCP] - - @overload - def __init__( - self, - *, - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., - allowed_tools: Optional[Union[list[str], MCPToolFilter]] = ..., - defer_loading: Optional[bool] = ..., - headers: Optional[dict[str, str]] = ..., - project_connection_id: Optional[str] = ..., - require_approval: Optional[Union[MCPToolRequireApproval, Literal[always], Literal[never]]] = ..., - response_scheduling: Optional[Union[str, VoiceAgentMcpResponseScheduling]] = ..., - server_description: Optional[str] = ..., - server_label: str, - server_url: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ..., - type: Literal[ToolType.MCP] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentObject(_Model): - agent_card: Optional[AgentCard] - agent_endpoint: Optional[AgentEndpointConfig] - blueprint: Optional[AgentIdentity] - blueprint_reference: Optional[AgentBlueprintReference] - id: str - instance_identity: Optional[AgentIdentity] - name: str - object: Literal[AgentObjectType.AGENT] - state: Union[str, AgentState] - state_source: Optional[Union[str, AgentStateSource]] - versions: VoiceAgentObjectVersions - - @overload - def __init__( - self, - *, - agent_card: Optional[AgentCard] = ..., - agent_endpoint: Optional[AgentEndpointConfig] = ..., - id: str, - name: str, - object: Literal[AgentObjectType.AGENT], - versions: VoiceAgentObjectVersions - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentObjectVersions(_Model): - latest: VoiceAgentVersionObject - - @overload - def __init__( - self, - *, - latest: VoiceAgentVersionObject - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentPipelineFamily(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CASCADED = "cascaded" - REALTIME = "realtime" - - - class azure.ai.voiceagents.models.VoiceAgentRealtimeResponse(_Model): - conversation_id: Optional[str] - estimated_cost: Optional[VoiceAgentEstimatedCost] - id: str - max_output_tokens: Optional[VoiceAgentMaxOutputTokens] - metadata: Optional[dict[str, str]] - modalities: Optional[list[Union[str, VoiceOutputModality]]] - object: Literal["response"] - output: list[VoiceAgentResponseItem] - output_audio_format: Optional[Union[str, VoiceAgentResponseAudioFormat]] - status: Union[str, VoiceAgentResponseStatus] - status_details: RealtimeResponseStatusDetails - temperature: Optional[float] - usage: RealtimeResponseUsage - voice: Optional[VoiceAgentVoice] - - @overload - def __init__( - self, - *, - conversation_id: Optional[str] = ..., - estimated_cost: Optional[VoiceAgentEstimatedCost] = ..., - id: str, - max_output_tokens: Optional[VoiceAgentMaxOutputTokens] = ..., - metadata: Optional[dict[str, str]] = ..., - modalities: Optional[list[Union[str, VoiceOutputModality]]] = ..., - output: list[VoiceAgentResponseItem], - output_audio_format: Optional[Union[str, VoiceAgentResponseAudioFormat]] = ..., - status: Union[str, VoiceAgentResponseStatus], - status_details: RealtimeResponseStatusDetails, - temperature: Optional[float] = ..., - usage: RealtimeResponseUsage, - voice: Optional[VoiceAgentVoice] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentResponseAudioFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): - G711_ALAW = "g711_alaw" - G711_ULAW = "g711_ulaw" - MP3 = "mp3" - MP3_24_KHZ160_KBPS = "mp3_24khz_160kbps" - MP3_24_KHZ48_KBPS = "mp3_24khz_48kbps" - MP3_24_KHZ96_KBPS = "mp3_24khz_96kbps" - PCM16 = "pcm16" - PCM16_16000_HZ = "pcm16_16000hz" - PCM16_22050_HZ = "pcm16_22050hz" - PCM16_24000_HZ = "pcm16_24000hz" - PCM16_44100_HZ = "pcm16_44100hz" - PCM16_48000_HZ = "pcm16_48000hz" - PCM16_8000_HZ = "pcm16_8000hz" - - - class azure.ai.voiceagents.models.VoiceAgentResponseCreateAudio(_Model): - output: Optional[VoiceAgentSessionUpdateAudioOutput] - - @overload - def __init__( - self, - *, - output: Optional[VoiceAgentSessionUpdateAudioOutput] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentResponseCreateParams(_Model): - audio: Optional[VoiceAgentResponseCreateAudio] - conversation: Optional[Union[Literal["auto"], Literal["none"], str]] - input: Optional[list[RealtimeConversationItem]] - instructions: Optional[str] - interim_response: Optional[VoiceAgentInterimResponse] - max_output_tokens: Optional[Union[int, Literal["inf"]]] - metadata: Optional[Metadata] - output_modalities: Optional[list[Union[str, VoiceOutputModality]]] - parallel_tool_calls: Optional[bool] - pre_generated_assistant_message: Optional[RealtimeConversationItemMessageAssistant] - reasoning: Optional[RealtimeReasoning] - tool_choice: Optional[Union[str, ToolChoiceOptions, ToolChoiceFunction, ToolChoiceMCP]] - tools: Optional[list[Union[RealtimeFunctionTool, MCPTool]]] - - @overload - def __init__( - self, - *, - audio: Optional[VoiceAgentResponseCreateAudio] = ..., - conversation: Optional[Union[Literal[auto], Literal[none], str]] = ..., - input: Optional[list[RealtimeConversationItem]] = ..., - instructions: Optional[str] = ..., - interim_response: Optional[VoiceAgentInterimResponse] = ..., - max_output_tokens: Optional[Union[int, Literal[inf]]] = ..., - metadata: Optional[Metadata] = ..., - output_modalities: Optional[list[Union[str, VoiceOutputModality]]] = ..., - parallel_tool_calls: Optional[bool] = ..., - pre_generated_assistant_message: Optional[RealtimeConversationItemMessageAssistant] = ..., - reasoning: Optional[RealtimeReasoning] = ..., - tool_choice: Optional[Union[str, ToolChoiceOptions, ToolChoiceFunction, ToolChoiceMCP]] = ..., - tools: Optional[list[Union[RealtimeFunctionTool, MCPTool]]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentResponseEventAudioContentPart(_Model): - annotations: Optional[Any] - audio: Optional[str] - format: Optional[VoiceAudioFormat] - transcript: str - type: Literal["audio"] - - @overload - def __init__( - self, - *, - annotations: Optional[Any] = ..., - audio: Optional[str] = ..., - format: Optional[VoiceAudioFormat] = ..., - transcript: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentResponseEventTextContentPart(_Model): - text: str - type: Literal["text"] - - @overload - def __init__( - self, - *, - text: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentResponseStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CANCELLED = "cancelled" - COMPLETED = "completed" - FAILED = "failed" - INCOMPLETE = "incomplete" - IN_PROGRESS = "in_progress" - - - class azure.ai.voiceagents.models.VoiceAgentSemanticVadTurnDetection(_Model): - auto_truncate: Optional[bool] - create_response: Optional[bool] - eagerness: Optional[Literal["low", "medium", "high", "auto"]] - interrupt_response: Optional[bool] - type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD] - - @overload - def __init__( - self, - *, - auto_truncate: Optional[bool] = ..., - create_response: Optional[bool] = ..., - eagerness: Optional[Literal[low, medium, high, auto]] = ..., - interrupt_response: Optional[bool] = ..., - type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventConversationCreated(_Model): - conversation_id: str - type: Literal["created"] - - @overload - def __init__( - self, - *, - conversation_id: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemAdded(_Model): - event_id: str - item: VoiceAgentResponseItem - previous_item_id: Optional[str] - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED] - - @overload - def __init__( - self, - *, - event_id: str, - item: VoiceAgentResponseItem, - previous_item_id: Optional[str] = ..., - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemCreated(_Model): - event_id: str - item: VoiceAgentResponseItem - previous_item_id: Optional[str] - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED] - - @overload - def __init__( - self, - *, - event_id: str, - item: VoiceAgentResponseItem, - previous_item_id: Optional[str] = ..., - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemDeleted(_Model): - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED] - - @overload - def __init__( - self, - *, - event_id: str, - item_id: str, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemDone(_Model): - event_id: str - item: VoiceAgentResponseItem - previous_item_id: Optional[str] - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE] - - @overload - def __init__( - self, - *, - event_id: str, - item: VoiceAgentResponseItem, - previous_item_id: Optional[str] = ..., - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted(_Model): - content_index: int - event_id: str - item_id: str - logprobs: Optional[list[LogProbProperties]] - phrases: Optional[list[VoiceAgentTranscriptionPhrase]] - transcript: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED] - usage: Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration] - - @overload - def __init__( - self, - *, - content_index: int, - event_id: str, - item_id: str, - logprobs: Optional[list[LogProbProperties]] = ..., - phrases: Optional[list[VoiceAgentTranscriptionPhrase]] = ..., - transcript: str, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED], - usage: Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta(_Model): - content_index: Optional[int] - delta: Optional[str] - event_id: str - item_id: str - logprobs: Optional[list[LogProbProperties]] - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA] - - @overload - def __init__( - self, - *, - content_index: Optional[int] = ..., - delta: Optional[str] = ..., - event_id: str, - item_id: str, - logprobs: Optional[list[LogProbProperties]] = ..., - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed(_Model): - content_index: int - error: RealtimeServerEventConversationItemInputAudioTranscriptionFailedError - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED] - - @overload - def __init__( - self, - *, - content_index: int, - error: RealtimeServerEventConversationItemInputAudioTranscriptionFailedError, - event_id: str, - item_id: str, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment(_Model): - content_index: int - end: float - event_id: str - id: str - item_id: str - speaker: str - start: float - text: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT] - - @overload - def __init__( - self, - *, - content_index: int, - end: float, - event_id: str, - id: str, - item_id: str, - speaker: str, - start: float, - text: str, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemRetrieved(_Model): - event_id: str - item: VoiceAgentResponseItem - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED] - - @overload - def __init__( - self, - *, - event_id: str, - item: VoiceAgentResponseItem, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemTruncated(_Model): - audio_end_ms: int - content_index: int - event_id: str - item: Optional[RealtimeConversationItemMessageAssistant] - item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED] - - @overload - def __init__( - self, - *, - audio_end_ms: int, - content_index: int, - event_id: str, - item: Optional[RealtimeConversationItemMessageAssistant] = ..., - item_id: str, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventError(_Model): - error: VoiceAgentServerEventErrorDetails - event_id: str - type: Literal["error"] - - @overload - def __init__( - self, - *, - error: VoiceAgentServerEventErrorDetails, - event_id: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventErrorDetails(_Model): - code: Optional[str] - event_id: Optional[str] - message: str - param: Optional[str] - tool_label: Optional[str] - tool_type: Optional[str] - type: str - - @overload - def __init__( - self, - *, - code: Optional[str] = ..., - event_id: Optional[str] = ..., - message: str, - param: Optional[str] = ..., - tool_label: Optional[str] = ..., - tool_type: Optional[str] = ..., - type: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventFileSearchCallCompleted(_Model): - event_id: Optional[str] - item_id: str - output_index: int - response_id: Optional[str] - sequence_number: int - type: Literal["completed"] - - @overload - def __init__( - self, - *, - event_id: Optional[str] = ..., - item_id: str, - output_index: int, - response_id: Optional[str] = ..., - sequence_number: int - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventFileSearchCallInProgress(_Model): - event_id: Optional[str] - item_id: str - output_index: int - response_id: Optional[str] - sequence_number: int - type: Literal["in_progress"] - - @overload - def __init__( - self, - *, - event_id: Optional[str] = ..., - item_id: str, - output_index: int, - response_id: Optional[str] = ..., - sequence_number: int - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventFileSearchCallSearching(_Model): - event_id: Optional[str] - item_id: str - output_index: int - response_id: Optional[str] - sequence_number: int - type: Literal["searching"] - - @overload - def __init__( - self, - *, - event_id: Optional[str] = ..., - item_id: str, - output_index: int, - response_id: Optional[str] = ..., - sequence_number: int - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventInputAudioBufferCleared(_Model): - event_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED] - - @overload - def __init__( - self, - *, - event_id: str, - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventInputAudioBufferCommitted(_Model): - event_id: str - item_id: str - previous_item_id: Optional[str] - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED] - - @overload - def __init__( - self, - *, - event_id: str, - item_id: str, - previous_item_id: Optional[str] = ..., - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventInputAudioBufferSpeechStarted(_Model): - audio_start_ms: int - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED] - - @overload - def __init__( - self, - *, - audio_start_ms: int, - event_id: str, - item_id: str, - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventInputAudioBufferSpeechStopped(_Model): - audio_end_ms: int - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED] - - @overload - def __init__( - self, - *, - audio_end_ms: int, - event_id: str, - item_id: str, - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventInputAudioBufferTimeoutTriggered(_Model): - audio_end_ms: int - audio_start_ms: int - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED] - - @overload - def __init__( - self, - *, - audio_end_ms: int, - audio_start_ms: int, - event_id: str, - item_id: str, - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventMcpListToolsCompleted(_Model): - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED] - - @overload - def __init__( - self, - *, - event_id: str, - item_id: str, - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventMcpListToolsFailed(_Model): - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED] - - @overload - def __init__( - self, - *, - event_id: str, - item_id: str, - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventMcpListToolsInProgress(_Model): - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS] - - @overload - def __init__( - self, - *, - event_id: str, - item_id: str, - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventOutputAudioBufferCleared(_Model): - event_id: str - response_id: str - type: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED] - - @overload - def __init__( - self, - *, - event_id: str, - response_id: str, - type: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventRateLimitsUpdated(_Model): - event_id: str - rate_limits: list[RealtimeServerEventRateLimitsUpdatedRateLimits] - type: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED] - - @overload - def __init__( - self, - *, - event_id: str, - rate_limits: list[RealtimeServerEventRateLimitsUpdatedRateLimits], - type: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventResponseAnimationBlendshapesDelta(_Model): - content_index: int - event_id: str - frame_index: int - frames: Union[list[list[float]], str] - item_id: str - output_index: int - response_id: str - type: Literal["delta"] - - @overload - def __init__( - self, - *, - content_index: int, - event_id: str, - frame_index: int, - frames: Union[list[list[float]], str], - item_id: str, - output_index: int, - response_id: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventResponseAnimationBlendshapesDone(_Model): - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal["done"] - - @overload - def __init__( - self, - *, - event_id: str, - item_id: str, - output_index: int, - response_id: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventResponseAnimationVisemeDelta(_Model): - audio_offset_ms: int - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal["delta"] - viseme_id: int - - @overload - def __init__( - self, - *, - audio_offset_ms: int, - content_index: int, - event_id: str, - item_id: str, - output_index: int, - response_id: str, - viseme_id: int - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventResponseAnimationVisemeDone(_Model): - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal["done"] - - @overload - def __init__( - self, - *, - content_index: int, - event_id: str, - item_id: str, - output_index: int, - response_id: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventResponseAudioDelta(_Model): - content_index: int - delta: bytes - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA] - - @overload - def __init__( - self, - *, - content_index: int, - delta: bytes, - event_id: str, - item_id: str, - output_index: int, - response_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventResponseAudioDone(_Model): - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE] - - @overload - def __init__( - self, - *, - content_index: int, - event_id: str, - item_id: str, - output_index: int, - response_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventResponseAudioTimestampDelta(_Model): - audio_duration_ms: int - audio_offset_ms: int - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - text: str - timestamp_type: Literal["word"] - type: Literal["delta"] - - @overload - def __init__( - self, - *, - audio_duration_ms: int, - audio_offset_ms: int, - content_index: int, - event_id: str, - item_id: str, - output_index: int, - response_id: str, - text: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventResponseAudioTimestampDone(_Model): - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal["done"] - - @overload - def __init__( - self, - *, - content_index: int, - event_id: str, - item_id: str, - output_index: int, - response_id: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventResponseAudioTranscriptDelta(_Model): - content_index: int - delta: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA] - - @overload - def __init__( - self, - *, - content_index: int, - delta: str, - event_id: str, - item_id: str, - output_index: int, - response_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventResponseAudioTranscriptDone(_Model): - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - transcript: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE] - - @overload - def __init__( - self, - *, - content_index: int, - event_id: str, - item_id: str, - output_index: int, - response_id: str, - transcript: str, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventResponseContentPartDone(_Model): - content_index: int - event_id: str - item_id: str - output_index: int - part: VoiceAgentResponseEventContentPart - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE] - - @overload - def __init__( - self, - *, - content_index: int, - event_id: str, - item_id: str, - output_index: int, - part: VoiceAgentResponseEventContentPart, - response_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventResponseCreated(_Model): - event_id: str - response: VoiceAgentRealtimeResponse - type: Literal[RealtimeServerEventType.RESPONSE_CREATED] - - @overload - def __init__( - self, - *, - event_id: str, - response: VoiceAgentRealtimeResponse, - type: Literal[RealtimeServerEventType.RESPONSE_CREATED] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventResponseDone(_Model): - event_id: str - response: VoiceAgentRealtimeResponse - type: Literal[RealtimeServerEventType.RESPONSE_DONE] - - @overload - def __init__( - self, - *, - event_id: str, - response: VoiceAgentRealtimeResponse, - type: Literal[RealtimeServerEventType.RESPONSE_DONE] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventResponseFunctionCallArgumentsDelta(_Model): - call_id: str - delta: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA] - - @overload - def __init__( - self, - *, - call_id: str, - delta: str, - event_id: str, - item_id: str, - output_index: int, - response_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventResponseFunctionCallArgumentsDone(_Model): - arguments: str - call_id: str - event_id: str - item_id: str - name: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE] - - @overload - def __init__( - self, - *, - arguments: str, - call_id: str, - event_id: str, - item_id: str, - name: str, - output_index: int, - response_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventResponseMcpCallArgumentsDelta(_Model): - delta: str - event_id: str - item_id: str - obfuscation: Optional[str] - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA] - - @overload - def __init__( - self, - *, - delta: str, - event_id: str, - item_id: str, - obfuscation: Optional[str] = ..., - output_index: int, - response_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventResponseMcpCallArgumentsDone(_Model): - arguments: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE] - - @overload - def __init__( - self, - *, - arguments: str, - event_id: str, - item_id: str, - output_index: int, - response_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventResponseMcpCallCompleted(_Model): - event_id: str - item_id: str - output_index: int - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED] - - @overload - def __init__( - self, - *, - event_id: str, - item_id: str, - output_index: int, - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventResponseMcpCallFailed(_Model): - event_id: str - item_id: str - output_index: int - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED] - - @overload - def __init__( - self, - *, - event_id: str, - item_id: str, - output_index: int, - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventResponseMcpCallInProgress(_Model): - event_id: str - item_id: str - output_index: int - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS] - - @overload - def __init__( - self, - *, - event_id: str, - item_id: str, - output_index: int, - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventResponseOutputItemAdded(_Model): - event_id: str - item: VoiceAgentResponseItem - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED] - - @overload - def __init__( - self, - *, - event_id: str, - item: VoiceAgentResponseItem, - output_index: int, - response_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventResponseOutputItemDone(_Model): - event_id: str - item: VoiceAgentResponseItem - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE] - - @overload - def __init__( - self, - *, - event_id: str, - item: VoiceAgentResponseItem, - output_index: int, - response_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventResponseTextDelta(_Model): - content_index: int - delta: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA] - - @overload - def __init__( - self, - *, - content_index: int, - delta: str, - event_id: str, - item_id: str, - output_index: int, - response_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventResponseTextDone(_Model): - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - text: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE] - - @overload - def __init__( - self, - *, - content_index: int, - event_id: str, - item_id: str, - output_index: int, - response_id: str, - text: str, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventResponseVideoDelta(_Model): - codec: str - delta: str - event_id: str - output_index: int - type: Literal["delta"] - - @overload - def __init__( - self, - *, - codec: str, - delta: str, - event_id: str, - output_index: int - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventSessionAvatarConnecting(_Model): - event_id: str - server_sdp: str - type: Literal["connecting"] - - @overload - def __init__( - self, - *, - event_id: str, - server_sdp: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventSessionAvatarSwitchToIdle(_Model): - event_id: str - turn_id: Optional[str] - type: Literal["switch_to_idle"] - - @overload - def __init__( - self, - *, - event_id: str, - turn_id: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventSessionAvatarSwitchToSpeaking(_Model): - event_id: str - turn_id: Optional[str] - type: Literal["switch_to_speaking"] - - @overload - def __init__( - self, - *, - event_id: str, - turn_id: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventSessionCreated(_Model): - event_id: str - session: VoiceAgentSessionResponseConfig - type: Literal[RealtimeServerEventType.SESSION_CREATED] - - @overload - def __init__( - self, - *, - event_id: str, - session: VoiceAgentSessionResponseConfig, - type: Literal[RealtimeServerEventType.SESSION_CREATED] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventSessionHandoffAborted(_Model): - edge_id: str - error: Optional[VoiceAgentServerEventErrorDetails] - event_id: str - from_model: str - from_node_id: str - handoff_id: str - node_generation: int - reason: Union[str, VoiceAgentHandoffAbortReason] - to_model: str - to_node_id: str - tool_call_id: str - type: Literal["aborted"] - - @overload - def __init__( - self, - *, - edge_id: str, - error: Optional[VoiceAgentServerEventErrorDetails] = ..., - event_id: str, - from_model: str, - from_node_id: str, - handoff_id: str, - node_generation: int, - reason: Union[str, VoiceAgentHandoffAbortReason], - to_model: str, - to_node_id: str, - tool_call_id: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventSessionHandoffCompleted(_Model): - duration_ms: int - edge_id: str - event_id: str - from_model: str - from_node_id: str - handoff_id: str - node_generation: int - prepare_duration_ms: int - to_model: str - to_node_id: str - tool_call_id: str - type: Literal["completed"] - - @overload - def __init__( - self, - *, - duration_ms: int, - edge_id: str, - event_id: str, - from_model: str, - from_node_id: str, - handoff_id: str, - node_generation: int, - prepare_duration_ms: int, - to_model: str, - to_node_id: str, - tool_call_id: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventSessionHandoffStarted(_Model): - edge_id: str - event_id: str - from_model: str - from_node_id: str - handoff_id: str - node_generation: int - to_model: str - to_node_id: str - tool_call_id: str - type: Literal["started"] - - @overload - def __init__( - self, - *, - edge_id: str, - event_id: str, - from_model: str, - from_node_id: str, - handoff_id: str, - node_generation: int, - to_model: str, - to_node_id: str, - tool_call_id: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventSessionUpdated(_Model): - event_id: str - session: VoiceAgentSessionResponseConfig - type: Literal[RealtimeServerEventType.SESSION_UPDATED] - - @overload - def __init__( - self, - *, - event_id: str, - session: VoiceAgentSessionResponseConfig, - type: Literal[RealtimeServerEventType.SESSION_UPDATED] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventWarning(_Model): - event_id: str - type: Literal["warning"] - warning: VoiceAgentServerEventWarningDetails - - @overload - def __init__( - self, - *, - event_id: str, - warning: VoiceAgentServerEventWarningDetails - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventWarningDetails(_Model): - code: Optional[str] - message: str - param: Optional[str] - - @overload - def __init__( - self, - *, - code: Optional[str] = ..., - message: str, - param: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventWebSearchCallCompleted(_Model): - event_id: Optional[str] - item_id: str - output_index: int - response_id: Optional[str] - sequence_number: int - type: Literal["completed"] - - @overload - def __init__( - self, - *, - event_id: Optional[str] = ..., - item_id: str, - output_index: int, - response_id: Optional[str] = ..., - sequence_number: int - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventWebSearchCallInProgress(_Model): - event_id: Optional[str] - item_id: str - output_index: int - response_id: Optional[str] - sequence_number: int - type: Literal["in_progress"] - - @overload - def __init__( - self, - *, - event_id: Optional[str] = ..., - item_id: str, - output_index: int, - response_id: Optional[str] = ..., - sequence_number: int - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerEventWebSearchCallSearching(_Model): - event_id: Optional[str] - item_id: str - output_index: int - response_id: Optional[str] - sequence_number: int - type: Literal["searching"] - - @overload - def __init__( - self, - *, - event_id: Optional[str] = ..., - item_id: str, - output_index: int, - response_id: Optional[str] = ..., - sequence_number: int - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentServerVadTurnDetection(_Model): - auto_truncate: Optional[bool] - create_response: Optional[bool] - end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] - idle_timeout_ms: Optional[int] - interrupt_response: Optional[bool] - prefix_padding_ms: Optional[int] - silence_duration_ms: Optional[int] - speech_duration_ms: Optional[int] - threshold: Optional[float] - type: Literal[VoiceTurnDetectionType.SERVER_VAD] - - @overload - def __init__( - self, - *, - auto_truncate: Optional[bool] = ..., - create_response: Optional[bool] = ..., - end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] = ..., - idle_timeout_ms: Optional[int] = ..., - interrupt_response: Optional[bool] = ..., - prefix_padding_ms: Optional[int] = ..., - silence_duration_ms: Optional[int] = ..., - speech_duration_ms: Optional[int] = ..., - threshold: Optional[float] = ..., - type: Literal[VoiceTurnDetectionType.SERVER_VAD] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentSessionAvatarConfig(_Model): - character: str - customized: Optional[bool] - ice_servers: Optional[list[VoiceAgentAvatarIceServer]] - model: Optional[str] - output_audit_audio: Optional[bool] - output_protocol: Optional[Union[str, VoiceAgentAvatarOutputProtocol]] - scene: Optional[VoiceAgentAvatarScene] - style: Optional[str] - type: Optional[Union[str, VoiceAgentAvatarType]] - video: Optional[VoiceAgentAvatarVideoParams] - - @overload - def __init__( - self, - *, - character: str, - customized: Optional[bool] = ..., - ice_servers: Optional[list[VoiceAgentAvatarIceServer]] = ..., - model: Optional[str] = ..., - output_audit_audio: Optional[bool] = ..., - output_protocol: Optional[Union[str, VoiceAgentAvatarOutputProtocol]] = ..., - scene: Optional[VoiceAgentAvatarScene] = ..., - style: Optional[str] = ..., - type: Optional[Union[str, VoiceAgentAvatarType]] = ..., - video: Optional[VoiceAgentAvatarVideoParams] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentSessionIncludeOption(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FILE_SEARCH_CALL_RESULTS = "file_search_call.results" - INPUT_AUDIO_TRANSCRIPTION_LOGPROBS = "item.input_audio_transcription.logprobs" - INPUT_AUDIO_TRANSCRIPTION_PHRASES = "item.input_audio_transcription.phrases" - - - class azure.ai.voiceagents.models.VoiceAgentSessionMcpTool(_Model): - allowed_tools: Optional[list[str]] - authorization: Optional[Union[str, VoiceAgentMcpAssignedManagedIdentity]] - headers: Optional[dict[str, str]] - require_approval: Optional[VoiceAgentMcpApprovalPolicy] - response_scheduling: Optional[Union[str, VoiceAgentMcpResponseScheduling]] - server_label: str - server_url: str - type: Literal["mcp"] - - @overload - def __init__( - self, - *, - allowed_tools: Optional[list[str]] = ..., - authorization: Optional[Union[str, VoiceAgentMcpAssignedManagedIdentity]] = ..., - headers: Optional[dict[str, str]] = ..., - require_approval: Optional[VoiceAgentMcpApprovalPolicy] = ..., - response_scheduling: Optional[Union[str, VoiceAgentMcpResponseScheduling]] = ..., - server_label: str, - server_url: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentSessionResponseAudio(_Model): - input: Optional[VoiceAgentSessionResponseAudioInput] - output: Optional[VoiceAgentSessionResponseAudioOutput] - - @overload - def __init__( - self, - *, - input: Optional[VoiceAgentSessionResponseAudioInput] = ..., - output: Optional[VoiceAgentSessionResponseAudioOutput] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentSessionResponseAudioInput(_Model): - echo_cancellation: Optional[VoiceAgentEchoCancellation] - format: Optional[VoiceAudioFormat] - noise_reduction: Optional[VoiceNoiseReduction] - transcription: Optional[VoiceInputTranscription] - turn_detection: Optional[VoiceAgentTurnDetection] - - @overload - def __init__( - self, - *, - echo_cancellation: Optional[VoiceAgentEchoCancellation] = ..., - format: Optional[VoiceAudioFormat] = ..., - noise_reduction: Optional[VoiceNoiseReduction] = ..., - transcription: Optional[VoiceInputTranscription] = ..., - turn_detection: Optional[VoiceAgentTurnDetection] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentSessionResponseAudioOutput(_Model): - format: Optional[VoiceAudioFormat] - output_audio_timestamp_types: Optional[list[Union[str, VoiceAudioTimestampType]]] - speed: Optional[float] - voice: Optional[VoiceAgentVoice] - - @overload - def __init__( - self, - *, - format: Optional[VoiceAudioFormat] = ..., - output_audio_timestamp_types: Optional[list[Union[str, VoiceAudioTimestampType]]] = ..., - speed: Optional[float] = ..., - voice: Optional[VoiceAgentVoice] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentSessionResponseConfig(_Model): - animation: Optional[VoiceAgentAnimationConfig] - audio: Optional[VoiceAgentSessionResponseAudio] - avatar: Optional[VoiceAgentSessionAvatarConfig] - expires_at: Optional[datetime] - greeting: Optional[VoiceGreetingConfig] - handoff: Optional[VoiceAgentHandoffState] - id: str - idle_timeout: Optional[int] - instructions: Optional[str] - interim_response: Optional[VoiceAgentInterimResponse] - max_output_tokens: Optional[VoiceAgentMaxOutputTokens] - model: str - object: Literal["session"] - output_modalities: list[Union[str, VoiceOutputModality]] - parallel_tool_calls: Optional[bool] - reasoning: Optional[RealtimeReasoning] - response_delimiter: Optional[str] - temperature: Optional[float] - tool_choice: Optional[VoiceAgentToolChoice] - tools: Optional[list[VoiceAgentSessionTool]] - type: Literal["realtime"] - voice_adaptation: Optional[VoiceAgentVoiceAdaptation] - - @overload - def __init__( - self, - *, - animation: Optional[VoiceAgentAnimationConfig] = ..., - audio: Optional[VoiceAgentSessionResponseAudio] = ..., - avatar: Optional[VoiceAgentSessionAvatarConfig] = ..., - expires_at: Optional[datetime] = ..., - greeting: Optional[VoiceGreetingConfig] = ..., - handoff: Optional[VoiceAgentHandoffState] = ..., - id: str, - idle_timeout: Optional[int] = ..., - instructions: Optional[str] = ..., - interim_response: Optional[VoiceAgentInterimResponse] = ..., - max_output_tokens: Optional[VoiceAgentMaxOutputTokens] = ..., - model: str, - output_modalities: list[Union[str, VoiceOutputModality]], - parallel_tool_calls: Optional[bool] = ..., - reasoning: Optional[RealtimeReasoning] = ..., - response_delimiter: Optional[str] = ..., - temperature: Optional[float] = ..., - tool_choice: Optional[VoiceAgentToolChoice] = ..., - tools: Optional[list[VoiceAgentSessionTool]] = ..., - voice_adaptation: Optional[VoiceAgentVoiceAdaptation] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentSessionUpdateAudio(_Model): - input: Optional[VoiceAgentSessionUpdateAudioInput] - output: Optional[VoiceAgentSessionUpdateAudioOutput] - - @overload - def __init__( - self, - *, - input: Optional[VoiceAgentSessionUpdateAudioInput] = ..., - output: Optional[VoiceAgentSessionUpdateAudioOutput] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentSessionUpdateAudioInput(_Model): - echo_cancellation: Optional[VoiceAgentEchoCancellation] - format: Optional[VoiceAudioFormat] - noise_reduction: Optional[VoiceNoiseReduction] - transcription: Optional[VoiceInputTranscription] - turn_detection: Optional[VoiceAgentTurnDetection] - - @overload - def __init__( - self, - *, - echo_cancellation: Optional[VoiceAgentEchoCancellation] = ..., - format: Optional[VoiceAudioFormat] = ..., - noise_reduction: Optional[VoiceNoiseReduction] = ..., - transcription: Optional[VoiceInputTranscription] = ..., - turn_detection: Optional[VoiceAgentTurnDetection] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentSessionUpdateAudioOutput(_Model): - format: Optional[VoiceAudioFormat] - output_audio_timestamp_types: Optional[list[Union[str, VoiceAudioTimestampType]]] - speed: Optional[float] - voice: Optional[VoiceAgentVoice] - - @overload - def __init__( - self, - *, - format: Optional[VoiceAudioFormat] = ..., - output_audio_timestamp_types: Optional[list[Union[str, VoiceAudioTimestampType]]] = ..., - speed: Optional[float] = ..., - voice: Optional[VoiceAgentVoice] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentSessionUpdateConfig(_Model): - animation: Optional[VoiceAgentAnimationConfig] - audio: Optional[VoiceAgentSessionUpdateAudio] - avatar: Optional[VoiceAgentSessionAvatarConfig] - greeting: Optional[VoiceGreetingConfig] - handoff: Optional[VoiceAgentHandoffGraphConfig] - include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] - instructions: Optional[str] - interim_response: Optional[VoiceAgentInterimResponse] - max_output_tokens: Optional[VoiceAgentMaxOutputTokens] - metadata: Optional[dict[str, str]] - output_modalities: Optional[list[Union[str, VoiceOutputModality]]] - parallel_tool_calls: Optional[bool] - reasoning: Optional[RealtimeReasoning] - response_delimiter: Optional[str] - temperature: Optional[float] - tool_choice: Optional[VoiceAgentToolChoice] - tools: Optional[list[VoiceAgentSessionTool]] - type: Literal["realtime"] - voice_adaptation: Optional[VoiceAgentVoiceAdaptation] - - @overload - def __init__( - self, - *, - animation: Optional[VoiceAgentAnimationConfig] = ..., - audio: Optional[VoiceAgentSessionUpdateAudio] = ..., - avatar: Optional[VoiceAgentSessionAvatarConfig] = ..., - greeting: Optional[VoiceGreetingConfig] = ..., - handoff: Optional[VoiceAgentHandoffGraphConfig] = ..., - include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] = ..., - instructions: Optional[str] = ..., - interim_response: Optional[VoiceAgentInterimResponse] = ..., - max_output_tokens: Optional[VoiceAgentMaxOutputTokens] = ..., - metadata: Optional[dict[str, str]] = ..., - output_modalities: Optional[list[Union[str, VoiceOutputModality]]] = ..., - parallel_tool_calls: Optional[bool] = ..., - reasoning: Optional[RealtimeReasoning] = ..., - response_delimiter: Optional[str] = ..., - temperature: Optional[float] = ..., - tool_choice: Optional[VoiceAgentToolChoice] = ..., - tools: Optional[list[VoiceAgentSessionTool]] = ..., - voice_adaptation: Optional[VoiceAgentVoiceAdaptation] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentStaticInterimResponseConfig(VoiceAgentInterimResponseConfig, discriminator='static_interim_response'): - latency_threshold_ms: int - texts: Optional[list[str]] - triggers: Union[list[str, VoiceAgentInterimResponseTrigger]] - type: Literal["static_interim_response"] - - @overload - def __init__( - self, - *, - latency_threshold_ms: Optional[int] = ..., - texts: Optional[list[str]] = ..., - triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentTranscriptionPhrase(_Model): - confidence: Optional[float] - duration_milliseconds: int - locale: Optional[str] - offset_milliseconds: int - text: str - words: Optional[list[VoiceAgentTranscriptionWord]] - - @overload - def __init__( - self, - *, - confidence: Optional[float] = ..., - duration_milliseconds: int, - locale: Optional[str] = ..., - offset_milliseconds: int, - text: str, - words: Optional[list[VoiceAgentTranscriptionWord]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentTranscriptionWord(_Model): - duration_milliseconds: int - offset_milliseconds: int - text: str - - @overload - def __init__( - self, - *, - duration_milliseconds: int, - offset_milliseconds: int, - text: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - BUSINESS = "business" - PERSONAL = "personal" - - - class azure.ai.voiceagents.models.VoiceAgentUseCase(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CALL_CENTER = "call_center" - CUSTOMER_SUPPORT = "customer_support" - IN_CAR = "in_car" - LEARNING = "learning" - OUTREACH = "outreach" - PERSONAL_ASSISTANT = "personal_assistant" - RECEPTION = "reception" - SALES = "sales" - TRAVEL_ASSISTANT = "travel_assistant" - - - class azure.ai.voiceagents.models.VoiceAgentVersionObject(_Model): - agent_guid: Optional[str] - blueprint: Optional[AgentIdentity] - blueprint_reference: Optional[AgentBlueprintReference] - created_at: datetime - definition: VoiceAgentDefinition - description: Optional[str] - draft: Optional[bool] - id: str - instance_identity: Optional[AgentIdentity] - metadata: dict[str, str] - name: str - object: Literal[AgentObjectType.AGENT_VERSION] - status: Optional[Union[str, AgentVersionStatus]] - version: str - - @overload - def __init__( - self, - *, - created_at: datetime, - definition: VoiceAgentDefinition, - description: Optional[str] = ..., - draft: Optional[bool] = ..., - id: str, - metadata: dict[str, str], - name: str, - object: Literal[AgentObjectType.AGENT_VERSION], - status: Optional[Union[str, AgentVersionStatus]] = ..., - version: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentVoiceAdaptation(_Model): - type: Literal["auto"] - - def __init__( - self, - *args: Any, - **kwargs: Any - ) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentWebSearchActionFind(_Model): - pattern: str - type: Literal["find"] - url: str - - @overload - def __init__( - self, - *, - pattern: str, - url: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentWebSearchActionOpenPage(_Model): - type: Literal["open_page"] - url: str - - @overload - def __init__( - self, - *, - url: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentWebSearchActionSearch(_Model): - query: str - sources: Optional[list[VoiceAgentWebSearchSource]] - type: Literal["search"] - - @overload - def __init__( - self, - *, - query: str, - sources: Optional[list[VoiceAgentWebSearchSource]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentWebSearchCallItem(_Model): - action: Optional[VoiceAgentWebSearchAction] - id: str - status: Union[str, VoiceAgentWebSearchCallStatus] - type: Literal["web_search_call"] - - @overload - def __init__( - self, - *, - action: Optional[VoiceAgentWebSearchAction] = ..., - id: str, - status: Union[str, VoiceAgentWebSearchCallStatus] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentWebSearchCallStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - COMPLETED = "completed" - FAILED = "failed" - IN_PROGRESS = "in_progress" - SEARCHING = "searching" - - - class azure.ai.voiceagents.models.VoiceAgentWebSearchSource(_Model): - type: Literal["url"] - url: str - - @overload - def __init__( - self, - *, - url: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAgentWebSocketSubprotocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - REALTIME = "realtime" - - - class azure.ai.voiceagents.models.VoiceAgentWorkflowActionItem(_Model): - action_id: str - id: str - kind: Optional[str] - object: Optional[Literal["item"]] - parent_action_id: Optional[str] - previous_action_id: Optional[str] - status: str - type: Literal["workflow_action"] - - @overload - def __init__( - self, - *, - action_id: str, - id: str, - kind: Optional[str] = ..., - object: Optional[Literal[item]] = ..., - parent_action_id: Optional[str] = ..., - previous_action_id: Optional[str] = ..., - status: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAssistantMessageItem(VoiceMessageItem, discriminator='assistant'): - content: list[RealtimeConversationItemMessageAssistantContent] - created_at: datetime - id: Optional[str] - object: Optional[Literal["item"]] - response_id: str - role: Literal[RealtimeConversationItemMessageType.ASSISTANT] - status: Optional[Literal["completed", "incomplete", "in_progress"]] - type: Union[str, azure.ai.voiceagents.models.MESSAGE] - - @overload - def __init__( - self, - *, - content: list[RealtimeConversationItemMessageAssistantContent], - created_at: Optional[datetime] = ..., - id: Optional[str] = ..., - object: Optional[Literal[item]] = ..., - response_id: Optional[str] = ..., - status: Optional[Literal[completed, incomplete, in_progress]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAudioCodec(str, Enum, metaclass=CaseInsensitiveEnumMeta): - PCM16 = "pcm16" - PCMA = "pcma" - PCMU = "pcmu" - - - class azure.ai.voiceagents.models.VoiceAudioConfig(_Model): - input: Optional[VoiceAudioInputConfig] - output: Optional[VoiceAudioOutputConfig] - - @overload - def __init__( - self, - *, - input: Optional[VoiceAudioInputConfig] = ..., - output: Optional[VoiceAudioOutputConfig] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAudioContainerFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): - WAV = "wav" - - - class azure.ai.voiceagents.models.VoiceAudioFormat(_Model): - rate: Optional[int] - type: Union[str, VoiceAudioFormatType] - - @overload - def __init__( - self, - *, - rate: Optional[int] = ..., - type: Union[str, VoiceAudioFormatType] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAudioFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - PCM = "audio/pcm" - PCMA = "audio/pcma" - PCMU = "audio/pcmu" - - - class azure.ai.voiceagents.models.VoiceAudioInputConfig(_Model): - format: Optional[VoiceAudioFormat] - noise_reduction: Optional[VoiceNoiseReduction] - transcription: Optional[VoiceInputTranscription] - turn_detection: Optional[VoiceTurnDetection] - - @overload - def __init__( - self, - *, - format: Optional[VoiceAudioFormat] = ..., - noise_reduction: Optional[VoiceNoiseReduction] = ..., - transcription: Optional[VoiceInputTranscription] = ..., - turn_detection: Optional[VoiceTurnDetection] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAudioOutputConfig(_Model): - format: Optional[VoiceAudioFormat] - output_audio_timestamp_types: Optional[list[Union[str, VoiceAudioTimestampType]]] - speed: Optional[float] - voice: Optional[VoiceAgentVoice] - - @overload - def __init__( - self, - *, - format: Optional[VoiceAudioFormat] = ..., - output_audio_timestamp_types: Optional[list[Union[str, VoiceAudioTimestampType]]] = ..., - speed: Optional[float] = ..., - voice: Optional[VoiceAgentVoice] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAudioRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENT = "agent" - USER = "user" - - - class azure.ai.voiceagents.models.VoiceAudioTimestampType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - WORD = "word" - - - class azure.ai.voiceagents.models.VoiceAvatarConfig(_Model): - character: str - customized: Optional[bool] - output_protocol: Optional[Union[str, VoiceAvatarOutputProtocol]] - style: Optional[str] - type: Union[str, VoiceAvatarType] - - @overload - def __init__( - self, - *, - character: str, - customized: Optional[bool] = ..., - output_protocol: Optional[Union[str, VoiceAvatarOutputProtocol]] = ..., - style: Optional[str] = ..., - type: Union[str, VoiceAvatarType] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAvatarOutputProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - WEBRTC = "webrtc" - WEBSOCKET = "websocket" - - - class azure.ai.voiceagents.models.VoiceAvatarType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - PHOTO_AVATAR = "photo_avatar" - VIDEO_AVATAR = "video_avatar" - - - class azure.ai.voiceagents.models.VoiceAzureSemanticDetection(VoiceEndOfUtteranceDetection, discriminator='semantic_detection_v1'): - model: Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1] - threshold_level: Optional[Union[str, VoiceEndOfUtteranceThresholdLevel]] - timeout_ms: Optional[int] - - @overload - def __init__( - self, - *, - threshold_level: Optional[Union[str, VoiceEndOfUtteranceThresholdLevel]] = ..., - timeout_ms: Optional[int] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAzureSemanticDetectionEn(VoiceEndOfUtteranceDetection, discriminator='semantic_detection_v1_en'): - model: Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1_EN] - threshold_level: Optional[Union[str, VoiceEndOfUtteranceThresholdLevel]] - timeout_ms: Optional[int] - - @overload - def __init__( - self, - *, - threshold_level: Optional[Union[str, VoiceEndOfUtteranceThresholdLevel]] = ..., - timeout_ms: Optional[int] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAzureSemanticDetectionMultilingual(VoiceEndOfUtteranceDetection, discriminator='semantic_detection_v1_multilingual'): - model: Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1_MULTILINGUAL] - threshold_level: Optional[Union[str, VoiceEndOfUtteranceThresholdLevel]] - timeout_ms: Optional[int] - - @overload - def __init__( - self, - *, - threshold_level: Optional[Union[str, VoiceEndOfUtteranceThresholdLevel]] = ..., - timeout_ms: Optional[int] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAzureSemanticVadEnTurnDetection(VoiceTurnDetection, discriminator='azure_semantic_vad_en'): - auto_truncate: Optional[bool] - create_response: Optional[bool] - end_of_utterance_detection: Optional[VoiceEndOfUtteranceDetection] - interrupt_response: Optional[bool] - prefix_padding_ms: Optional[int] - remove_filler_words: Optional[bool] - silence_duration_ms: Optional[int] - speech_duration_ms: Optional[int] - threshold: Optional[float] - type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN] - - @overload - def __init__( - self, - *, - auto_truncate: Optional[bool] = ..., - create_response: Optional[bool] = ..., - end_of_utterance_detection: Optional[VoiceEndOfUtteranceDetection] = ..., - interrupt_response: Optional[bool] = ..., - prefix_padding_ms: Optional[int] = ..., - remove_filler_words: Optional[bool] = ..., - silence_duration_ms: Optional[int] = ..., - speech_duration_ms: Optional[int] = ..., - threshold: Optional[float] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAzureSemanticVadMultilingualTurnDetection(VoiceTurnDetection, discriminator='azure_semantic_vad_multilingual'): - auto_truncate: Optional[bool] - create_response: Optional[bool] - end_of_utterance_detection: Optional[VoiceEndOfUtteranceDetection] - interrupt_response: Optional[bool] - languages: Optional[list[str]] - prefix_padding_ms: Optional[int] - remove_filler_words: Optional[bool] - silence_duration_ms: Optional[int] - speech_duration_ms: Optional[int] - threshold: Optional[float] - type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] - - @overload - def __init__( - self, - *, - auto_truncate: Optional[bool] = ..., - create_response: Optional[bool] = ..., - end_of_utterance_detection: Optional[VoiceEndOfUtteranceDetection] = ..., - interrupt_response: Optional[bool] = ..., - languages: Optional[list[str]] = ..., - prefix_padding_ms: Optional[int] = ..., - remove_filler_words: Optional[bool] = ..., - silence_duration_ms: Optional[int] = ..., - speech_duration_ms: Optional[int] = ..., - threshold: Optional[float] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceAzureSemanticVadTurnDetection(VoiceTurnDetection, discriminator='azure_semantic_vad'): - auto_truncate: Optional[bool] - create_response: Optional[bool] - end_of_utterance_detection: Optional[VoiceEndOfUtteranceDetection] - interrupt_response: Optional[bool] - languages: Optional[list[str]] - prefix_padding_ms: Optional[int] - remove_filler_words: Optional[bool] - silence_duration_ms: Optional[int] - speech_duration_ms: Optional[int] - threshold: Optional[float] - type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD] - - @overload - def __init__( - self, - *, - auto_truncate: Optional[bool] = ..., - create_response: Optional[bool] = ..., - end_of_utterance_detection: Optional[VoiceEndOfUtteranceDetection] = ..., - interrupt_response: Optional[bool] = ..., - languages: Optional[list[str]] = ..., - prefix_padding_ms: Optional[int] = ..., - remove_filler_words: Optional[bool] = ..., - silence_duration_ms: Optional[int] = ..., - speech_duration_ms: Optional[int] = ..., - threshold: Optional[float] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceConversation(_Model): - completed_at: Optional[datetime] - created_at: datetime - id: str - metadata: Optional[dict[str, str]] - object: Literal["conversation"] - status: Union[str, VoiceConversationStatus] - usage: Optional[RealtimeResponseUsage] - - @overload - def __init__( - self, - *, - completed_at: Optional[datetime] = ..., - created_at: datetime, - id: str, - metadata: Optional[dict[str, str]] = ..., - status: Union[str, VoiceConversationStatus], - usage: Optional[RealtimeResponseUsage] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceConversationItem(_Model): - created_at: Optional[datetime] - response_id: Optional[str] - type: str - - @overload - def __init__( - self, - *, - created_at: Optional[datetime] = ..., - response_id: Optional[str] = ..., - type: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FUNCTION_CALL = "function_call" - FUNCTION_CALL_OUTPUT = "function_call_output" - MCP_APPROVAL_REQUEST = "mcp_approval_request" - MCP_APPROVAL_RESPONSE = "mcp_approval_response" - MCP_CALL = "mcp_call" - MCP_LIST_TOOLS = "mcp_list_tools" - MESSAGE = "message" - - - class azure.ai.voiceagents.models.VoiceConversationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - COMPLETED = "completed" - IN_PROGRESS = "in_progress" - - - class azure.ai.voiceagents.models.VoiceEndOfUtteranceDetection(_Model): - model: str - - @overload - def __init__( - self, - *, - model: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceEndOfUtteranceDetectionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - SEMANTIC_DETECTION_V1 = "semantic_detection_v1" - SEMANTIC_DETECTION_V1_EN = "semantic_detection_v1_en" - SEMANTIC_DETECTION_V1_MULTILINGUAL = "semantic_detection_v1_multilingual" - - - class azure.ai.voiceagents.models.VoiceEndOfUtteranceThresholdLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DEFAULT = "default" - HIGH = "high" - LOW = "low" - MEDIUM = "medium" - - - class azure.ai.voiceagents.models.VoiceFunctionCallItem(VoiceConversationItem, discriminator='function_call'): - arguments: str - call_id: Optional[str] - created_at: datetime - id: Optional[str] - name: str - object: Optional[Literal["item"]] - response_id: str - status: Optional[Literal["completed", "incomplete", "in_progress"]] - type: Literal[VoiceConversationItemType.FUNCTION_CALL] - - @overload - def __init__( - self, - *, - arguments: str, - call_id: Optional[str] = ..., - created_at: Optional[datetime] = ..., - id: Optional[str] = ..., - name: str, - object: Optional[Literal[item]] = ..., - response_id: Optional[str] = ..., - status: Optional[Literal[completed, incomplete, in_progress]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceFunctionCallOutputItem(VoiceConversationItem, discriminator='function_call_output'): - call_id: str - created_at: datetime - id: Optional[str] - name: Optional[str] - object: Optional[Literal["item"]] - output: str - response_id: str - status: Optional[Literal["completed", "incomplete", "in_progress"]] - type: Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT] - - @overload - def __init__( - self, - *, - call_id: str, - created_at: Optional[datetime] = ..., - id: Optional[str] = ..., - name: Optional[str] = ..., - object: Optional[Literal[item]] = ..., - output: str, - response_id: Optional[str] = ..., - status: Optional[Literal[completed, incomplete, in_progress]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceGreetingConfig(_Model): - type: str - - @overload - def __init__( - self, - *, - type: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceGreetingToolChoice(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AUTO = "auto" - NONE = "none" - REQUIRED = "required" - - - class azure.ai.voiceagents.models.VoiceIdsShared(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ALLOY = "alloy" - ASH = "ash" - BALLAD = "ballad" - CEDAR = "cedar" - CORAL = "coral" - ECHO = "echo" - MARIN = "marin" - SAGE = "sage" - SHIMMER = "shimmer" - VERSE = "verse" - - - class azure.ai.voiceagents.models.VoiceInputTranscription(_Model): - custom_speech: Optional[dict[str, str]] - delay: Optional[Literal["minimal", "low", "medium", "high", "xhigh"]] - language: Optional[str] - model: Union[str, VoiceInputTranscriptionModel] - phrase_list: Optional[list[str]] - prompt: Optional[str] - - @overload - def __init__( - self, - *, - custom_speech: Optional[dict[str, str]] = ..., - delay: Optional[Literal[minimal, low, medium, high, xhigh]] = ..., - language: Optional[str] = ..., - model: Union[str, VoiceInputTranscriptionModel], - phrase_list: Optional[list[str]] = ..., - prompt: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceInputTranscriptionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AZURE_SPEECH = "azure-speech" - GPT4_O_MINI_TRANSCRIBE = "gpt-4o-mini-transcribe" - GPT4_O_TRANSCRIBE = "gpt-4o-transcribe" - GPT4_O_TRANSCRIBE_DIARIZE = "gpt-4o-transcribe-diarize" - GPT_LIVE_TRANSCRIBE = "gpt-live-transcribe" - GPT_REALTIME_WHISPER = "gpt-realtime-whisper" - GPT_TRANSCRIBE = "gpt-transcribe" - MAI_TRANSCRIBE = "mai-transcribe" - WHISPER1 = "whisper-1" - - - class azure.ai.voiceagents.models.VoiceItemAudioResponse(_Model): - blob_uri: Optional[str] - channels: Optional[int] - codec: Optional[Union[str, VoiceAudioCodec]] - conversation_id: str - duration_ms: Optional[timedelta] - format: Optional[Union[str, VoiceAudioContainerFormat]] - item_id: str - role: Optional[Union[str, VoiceAudioRole]] - sample_rate: Optional[int] - start_offset_ms: Optional[timedelta] - - @overload - def __init__( - self, - *, - blob_uri: Optional[str] = ..., - channels: Optional[int] = ..., - codec: Optional[Union[str, VoiceAudioCodec]] = ..., - conversation_id: str, - duration_ms: Optional[timedelta] = ..., - format: Optional[Union[str, VoiceAudioContainerFormat]] = ..., - item_id: str, - role: Optional[Union[str, VoiceAudioRole]] = ..., - sample_rate: Optional[int] = ..., - start_offset_ms: Optional[timedelta] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceMcpApprovalRequestItem(VoiceConversationItem, discriminator='mcp_approval_request'): - arguments: str - created_at: datetime - id: str - name: str - response_id: str - server_label: str - type: Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST] - - @overload - def __init__( - self, - *, - arguments: str, - created_at: Optional[datetime] = ..., - id: str, - name: str, - response_id: Optional[str] = ..., - server_label: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceMcpApprovalResponseItem(VoiceConversationItem, discriminator='mcp_approval_response'): - approval_request_id: str - approve: bool - created_at: datetime - id: str - reason: Optional[str] - response_id: str - type: Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE] - - @overload - def __init__( - self, - *, - approval_request_id: str, - approve: bool, - created_at: Optional[datetime] = ..., - id: str, - reason: Optional[str] = ..., - response_id: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceMcpCallItem(VoiceConversationItem, discriminator='mcp_call'): - approval_request_id: Optional[str] - arguments: str - created_at: datetime - error: Optional[RealtimeMCPError] - id: str - name: str - output: Optional[str] - response_id: str - server_label: str - type: Literal[VoiceConversationItemType.MCP_CALL] - - @overload - def __init__( - self, - *, - approval_request_id: Optional[str] = ..., - arguments: str, - created_at: Optional[datetime] = ..., - error: Optional[RealtimeMCPError] = ..., - id: str, - name: str, - output: Optional[str] = ..., - response_id: Optional[str] = ..., - server_label: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceMcpListToolsItem(VoiceConversationItem, discriminator='mcp_list_tools'): - created_at: datetime - id: Optional[str] - response_id: str - server_label: str - tools: list[MCPListToolsTool] - type: Literal[VoiceConversationItemType.MCP_LIST_TOOLS] - - @overload - def __init__( - self, - *, - created_at: Optional[datetime] = ..., - id: Optional[str] = ..., - response_id: Optional[str] = ..., - server_label: str, - tools: list[MCPListToolsTool] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceMessageItem(VoiceConversationItem, discriminator='message'): - created_at: datetime - response_id: str - role: str - type: Literal[VoiceConversationItemType.MESSAGE] - - @overload - def __init__( - self, - *, - created_at: Optional[datetime] = ..., - response_id: Optional[str] = ..., - role: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceModelType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - MANAGED = "managed" - SELF_DEPLOYED = "self_deployed" - - - class azure.ai.voiceagents.models.VoiceNoiseReduction(_Model): - type: Union[str, VoiceNoiseReductionType] - - @overload - def __init__( - self, - *, - type: Union[str, VoiceNoiseReductionType] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceNoiseReductionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AZURE_DEEP_NOISE_SUPPRESSION = "azure_deep_noise_suppression" - FAR_FIELD = "far_field" - NEAR_FIELD = "near_field" - - - class azure.ai.voiceagents.models.VoiceOutputModality(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ANIMATION = "animation" - AUDIO = "audio" - AVATAR = "avatar" - TEXT = "text" - - - class azure.ai.voiceagents.models.VoiceRecordingChannelLayout(_Model): - left: Literal["user"] - right: Literal["agent"] - - def __init__( - self, - *args: Any, - **kwargs: Any - ) -> None: ... - - - class azure.ai.voiceagents.models.VoiceRecordingResponse(_Model): - blob_uri: Optional[str] - channel_layout: VoiceRecordingChannelLayout - channels: int - conversation_id: str - duration_ms: timedelta - format: Union[str, VoiceAudioContainerFormat] - sample_rate: int - - @overload - def __init__( - self, - *, - blob_uri: Optional[str] = ..., - channel_layout: VoiceRecordingChannelLayout, - channels: int, - conversation_id: str, - duration_ms: timedelta, - format: Union[str, VoiceAudioContainerFormat], - sample_rate: int - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceResponse(_Model): - audio: Optional[VoiceResponseAudio] - completed_at: Optional[datetime] - conversation_id: str - created_at: Optional[datetime] - id: str - max_output_tokens: Optional[Union[int, Literal["inf"]]] - object: Literal["response"] - output: Optional[list[VoiceConversationItem]] - output_modalities: Optional[list[Literal["text", "audio"]]] - status: Union[str, VoiceResponseStatus] - status_details: Optional[RealtimeResponseStatusDetails] - temperature: Optional[float] - usage: Optional[RealtimeResponseUsage] - - @overload - def __init__( - self, - *, - audio: Optional[VoiceResponseAudio] = ..., - completed_at: Optional[datetime] = ..., - conversation_id: str, - created_at: Optional[datetime] = ..., - id: str, - max_output_tokens: Optional[Union[int, Literal[inf]]] = ..., - output: Optional[list[VoiceConversationItem]] = ..., - output_modalities: Optional[list[Literal[text, audio]]] = ..., - status: Union[str, VoiceResponseStatus], - status_details: Optional[RealtimeResponseStatusDetails] = ..., - temperature: Optional[float] = ..., - usage: Optional[RealtimeResponseUsage] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceResponseAudio(_Model): - output: Optional[VoiceResponseAudioOutput] - - @overload - def __init__( - self, - *, - output: Optional[VoiceResponseAudioOutput] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceResponseAudioOutput(_Model): - format: Optional[RealtimeAudioFormats] - voice: Optional[VoiceResponseVoice] - - @overload - def __init__( - self, - *, - format: Optional[RealtimeAudioFormats] = ..., - voice: Optional[VoiceResponseVoice] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceResponseStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CANCELLED = "cancelled" - COMPLETED = "completed" - FAILED = "failed" - INCOMPLETE = "incomplete" - IN_PROGRESS = "in_progress" - - - class azure.ai.voiceagents.models.VoiceSemanticVadTurnDetection(VoiceTurnDetection, discriminator='semantic_vad'): - create_response: Optional[bool] - eagerness: Optional[Literal["low", "medium", "high", "auto"]] - interrupt_response: Optional[bool] - type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD] - - @overload - def __init__( - self, - *, - create_response: Optional[bool] = ..., - eagerness: Optional[Literal[low, medium, high, auto]] = ..., - interrupt_response: Optional[bool] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceServerVadTurnDetection(VoiceTurnDetection, discriminator='server_vad'): - create_response: Optional[bool] - idle_timeout_ms: Optional[int] - interrupt_response: Optional[bool] - prefix_padding_ms: Optional[int] - silence_duration_ms: Optional[int] - threshold: Optional[float] - type: Literal[VoiceTurnDetectionType.SERVER_VAD] - - @overload - def __init__( - self, - *, - create_response: Optional[bool] = ..., - idle_timeout_ms: Optional[int] = ..., - interrupt_response: Optional[bool] = ..., - prefix_padding_ms: Optional[int] = ..., - silence_duration_ms: Optional[int] = ..., - threshold: Optional[float] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceSystemMessageItem(VoiceMessageItem, discriminator='system'): - content: list[RealtimeConversationItemMessageSystemContent] - created_at: datetime - id: Optional[str] - object: Optional[Literal["item"]] - response_id: str - role: Literal[RealtimeConversationItemMessageType.SYSTEM] - status: Optional[Literal["completed", "incomplete", "in_progress"]] - type: Union[str, azure.ai.voiceagents.models.MESSAGE] - - @overload - def __init__( - self, - *, - content: list[RealtimeConversationItemMessageSystemContent], - created_at: Optional[datetime] = ..., - id: Optional[str] = ..., - object: Optional[Literal[item]] = ..., - response_id: Optional[str] = ..., - status: Optional[Literal[completed, incomplete, in_progress]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceSystemTool(_Model): - description: Optional[str] - name: Union[str, VoiceSystemToolName] - type: Literal["system"] - - @overload - def __init__( - self, - *, - description: Optional[str] = ..., - name: Union[str, VoiceSystemToolName] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceSystemToolName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - END_CONVERSATION = "end_conversation" - - - class azure.ai.voiceagents.models.VoiceToolboxTool(_Model): - toolbox_name: str - toolbox_version: str - type: Literal["toolbox"] - - @overload - def __init__( - self, - *, - toolbox_name: str, - toolbox_version: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceTurnDetection(_Model): - type: str - - @overload - def __init__( - self, - *, - type: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.voiceagents.models.VoiceTurnDetectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AZURE_SEMANTIC_VAD = "azure_semantic_vad" - AZURE_SEMANTIC_VAD_EN = "azure_semantic_vad_en" - AZURE_SEMANTIC_VAD_MULTILINGUAL = "azure_semantic_vad_multilingual" - SEMANTIC_VAD = "semantic_vad" - SERVER_VAD = "server_vad" - - - class azure.ai.voiceagents.models.VoiceUserMessageItem(VoiceMessageItem, discriminator='user'): - content: list[RealtimeConversationItemMessageUserContent] - created_at: datetime - id: Optional[str] - object: Optional[Literal["item"]] - response_id: str - role: Literal[RealtimeConversationItemMessageType.USER] - status: Optional[Literal["completed", "incomplete", "in_progress"]] - type: Union[str, azure.ai.voiceagents.models.MESSAGE] - - @overload - def __init__( - self, - *, - content: list[RealtimeConversationItemMessageUserContent], - created_at: Optional[datetime] = ..., - id: Optional[str] = ..., - object: Optional[Literal[item]] = ..., - response_id: Optional[str] = ..., - status: Optional[Literal[completed, incomplete, in_progress]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - -namespace azure.ai.voiceagents.operations - - class azure.ai.voiceagents.operations.AgentEndpointConversationsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @distributed_trace - def delete_agent_conversation( - self, - agent_name: str, - conversation_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> None: ... - - @distributed_trace - def get_agent_conversation( - self, - agent_name: str, - conversation_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> VoiceConversation: ... - - @distributed_trace - def get_agent_conversation_audio( - self, - agent_name: str, - conversation_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> VoiceRecordingResponse: ... - - @distributed_trace - def get_agent_conversation_audio_content( - self, - agent_name: str, - conversation_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> Iterator[bytes]: ... - - @distributed_trace - def get_agent_conversation_item( - self, - agent_name: str, - conversation_id: str, - item_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> VoiceConversationItem: ... - - @distributed_trace - def get_agent_conversation_item_audio( - self, - agent_name: str, - conversation_id: str, - item_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> VoiceItemAudioResponse: ... - - @distributed_trace - def get_agent_conversation_item_audio_content( - self, - agent_name: str, - conversation_id: str, - item_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> Iterator[bytes]: ... - - @distributed_trace - def get_agent_conversation_response( - self, - agent_name: str, - conversation_id: str, - response_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> VoiceResponse: ... - - @distributed_trace - def list_agent_conversation_items( - self, - agent_name: str, - conversation_id: str, - *, - before: Optional[str] = ..., - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> ItemPaged[VoiceConversationItem]: ... - - @distributed_trace - def list_agent_conversation_response_items( - self, - agent_name: str, - conversation_id: str, - response_id: str, - *, - before: Optional[str] = ..., - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> ItemPaged[VoiceConversationItem]: ... - - @distributed_trace - def list_agent_conversation_responses( - self, - agent_name: str, - conversation_id: str, - *, - before: Optional[str] = ..., - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> ItemPaged[VoiceResponse]: ... - - - class azure.ai.voiceagents.operations.VoiceAgentsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - def create_voice_agent( - self, - *, - agent_card: Optional[AgentCard] = ..., - agent_endpoint: Optional[AgentEndpointConfig] = ..., - blueprint_reference: Optional[AgentBlueprintReference] = ..., - content_type: str = "application/json", - definition: VoiceAgentDefinition, - description: Optional[str] = ..., - draft: Optional[bool] = ..., - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - metadata: Optional[dict[str, str]] = ..., - name: str, - state: Optional[Union[str, AgentState]] = ..., - **kwargs: Any - ) -> VoiceAgentObject: ... - - @overload - def create_voice_agent( - self, - body: CreateVoiceAgentRequest, - *, - content_type: str = "application/json", - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> VoiceAgentObject: ... - - @overload - def create_voice_agent( - self, - body: IO[bytes], - *, - content_type: str = "application/json", - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> VoiceAgentObject: ... - - @overload - def create_voice_agent_version( - self, - agent_name: str, - *, - blueprint_reference: Optional[AgentBlueprintReference] = ..., - content_type: str = "application/json", - definition: VoiceAgentDefinition, - description: Optional[str] = ..., - draft: Optional[bool] = ..., - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - metadata: Optional[dict[str, str]] = ..., - **kwargs: Any - ) -> VoiceAgentVersionObject: ... - - @overload - def create_voice_agent_version( - self, - agent_name: str, - body: CreateVoiceAgentVersionRequest, - *, - content_type: str = "application/json", - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> VoiceAgentVersionObject: ... - - @overload - def create_voice_agent_version( - self, - agent_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> VoiceAgentVersionObject: ... - - @distributed_trace - def delete_voice_agent( - self, - agent_name: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> None: ... - - @distributed_trace - def delete_voice_agent_version( - self, - agent_name: str, - agent_version: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> None: ... - - @distributed_trace - def disable_voice_agent( - self, - agent_name: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> None: ... - - @distributed_trace - def enable_voice_agent( - self, - agent_name: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> None: ... - - @overload - def generate_voice_agent( - self, - *, - agent_type: Union[str, VoiceAgentType], - content_type: str = "application/json", - description: Optional[str] = ..., - draft: Optional[bool] = ..., - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - goal: str, - model: str, - model_type: Union[str, VoiceModelType], - name: str, - tools: Optional[list[VoiceAgentTool]] = ..., - use_case: Union[str, VoiceAgentUseCase], - **kwargs: Any - ) -> VoiceAgentObject: ... - - @overload - def generate_voice_agent( - self, - body: GenerateVoiceAgentRequest, - *, - content_type: str = "application/json", - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> VoiceAgentObject: ... - - @overload - def generate_voice_agent( - self, - body: IO[bytes], - *, - content_type: str = "application/json", - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> VoiceAgentObject: ... - - @distributed_trace - def get_voice_agent( - self, - agent_name: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> VoiceAgentObject: ... - - @distributed_trace - def get_voice_agent_version( - self, - agent_name: str, - agent_version: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> VoiceAgentVersionObject: ... - - @distributed_trace - def list_voice_agent_versions( - self, - agent_name: str, - *, - before: Optional[str] = ..., - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - include_drafts: Optional[bool] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> ItemPaged[VoiceAgentVersionObject]: ... - - @distributed_trace - def list_voice_agents( - self, - *, - before: Optional[str] = ..., - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> ItemPaged[VoiceAgentObject]: ... - - @overload - def update_voice_agent( - self, - agent_name: str, - *, - blueprint_reference: Optional[AgentBlueprintReference] = ..., - content_type: str = "application/json", - definition: VoiceAgentDefinition, - description: Optional[str] = ..., - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - metadata: Optional[dict[str, str]] = ..., - **kwargs: Any - ) -> VoiceAgentObject: ... - - @overload - def update_voice_agent( - self, - agent_name: str, - body: UpdateVoiceAgentRequest, - *, - content_type: str = "application/json", - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> VoiceAgentObject: ... - - @overload - def update_voice_agent( - self, - agent_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> VoiceAgentObject: ... - - -namespace azure.ai.voiceagents.types - - class azure.ai.voiceagents.types.A2AProtocolConfiguration(TypedDict, total=False): - - - class azure.ai.voiceagents.types.ActivityProtocolConfiguration(TypedDict, total=False): - key "enable_m365_public_endpoint": bool - enable_m365_public_endpoint: bool - - - class azure.ai.voiceagents.types.AgentBlueprintReference(TypedDict, total=False): - key "blueprint_id": Required[str] - key "type": Required[Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT]] - blueprint_id: str - type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] - - - class azure.ai.voiceagents.types.AgentBlueprintReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - MANAGED_AGENT_IDENTITY_BLUEPRINT = "ManagedAgentIdentityBlueprint" - - - class azure.ai.voiceagents.types.AgentCard(TypedDict, total=False): - key "description": str - key "skills": Required[list[AgentCardSkill]] - key "version": Required[str] - description: str - skills: list[AgentCardSkill] - version: str - - - class azure.ai.voiceagents.types.AgentCardSkill(TypedDict, total=False): - key "description": str - key "id": Required[str] - key "name": Required[str] - description: str - examples: list[str] - id: str - name: str - tags: list[str] - - - class azure.ai.voiceagents.types.AgentEndpointAuthorizationSchemeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - BOT_SERVICE = "BotService" - BOT_SERVICE_RBAC = "BotServiceRbac" - BOT_SERVICE_TENANT = "BotServiceTenant" - ENTRA = "Entra" - - - class azure.ai.voiceagents.types.AgentEndpointConfig(TypedDict, total=False): - key "protocol_configuration": ForwardRef('ProtocolConfiguration', module='types') - key "version_selector": ForwardRef('VersionSelector', module='types') - authorization_schemes: list[AgentEndpointAuthorizationScheme] - protocol_configuration: ProtocolConfiguration - version_selector: VersionSelector - - - class azure.ai.voiceagents.types.AzureAvatarVoiceSyncVoice(TypedDict, total=False): - key "custom_lexicon_url": str - key "custom_text_normalization_url": str - key "locale": str - key "model": Required[Union[str, PersonalVoiceModel]] - key "pitch": str - key "rate": str - key "style": str - key "temperature": float - key "type": Required[Literal[AzureVoiceType.AVATAR_VOICE_SYNC]] - key "volume": str - custom_lexicon_url: str - custom_text_normalization_url: str - locale: str - model: Union[str, PersonalVoiceModel] - pitch: str - prefer_locales: list[str] - rate: str - style: str - temperature: float - type: Literal[AzureVoiceType.AVATAR_VOICE_SYNC] - volume: str - - - class azure.ai.voiceagents.types.AzureCustomVoice(TypedDict, total=False): - key "custom_lexicon_url": str - key "custom_text_normalization_url": str - key "endpoint_id": Required[str] - key "locale": str - key "name": Required[str] - key "pitch": str - key "rate": str - key "style": str - key "temperature": float - key "type": Required[Literal[AzureVoiceType.AZURE_CUSTOM]] - key "volume": str - custom_lexicon_url: str - custom_text_normalization_url: str - endpoint_id: str - locale: str - name: str - pitch: str - prefer_locales: list[str] - rate: str - style: str - temperature: float - type: Literal[AzureVoiceType.AZURE_CUSTOM] - volume: str - - - class azure.ai.voiceagents.types.AzurePersonalVoice(TypedDict, total=False): - key "custom_lexicon_url": str - key "custom_text_normalization_url": str - key "locale": str - key "model": Required[Union[str, PersonalVoiceModel]] - key "name": Required[str] - key "pitch": str - key "rate": str - key "style": str - key "temperature": float - key "type": Required[Literal[AzureVoiceType.AZURE_PERSONAL]] - key "volume": str - custom_lexicon_url: str - custom_text_normalization_url: str - locale: str - model: Union[str, PersonalVoiceModel] - name: str - pitch: str - prefer_locales: list[str] - rate: str - style: str - temperature: float - type: Literal[AzureVoiceType.AZURE_PERSONAL] - volume: str - - - class azure.ai.voiceagents.types.AzureRealtimeNativeVoice(TypedDict, total=False): - key "name": Required[Union[str, AzureRealtimeNativeVoiceName]] - key "type": Required[Literal["azure-realtime-native"]] - name: Union[str, AzureRealtimeNativeVoiceName] - type: Literal[azure-realtime-native] - - - class azure.ai.voiceagents.types.AzureStandardVoice(TypedDict, total=False): - key "custom_lexicon_url": str - key "custom_text_normalization_url": str - key "locale": str - key "multi_talker_speaker_name": str - key "name": Required[str] - key "pitch": str - key "rate": str - key "style": str - key "temperature": float - key "type": Required[Literal[AzureVoiceType.AZURE_STANDARD]] - key "volume": str - custom_lexicon_url: str - custom_text_normalization_url: str - locale: str - multi_talker_speaker_name: str - name: str - pitch: str - prefer_locales: list[str] - rate: str - style: str - temperature: float - type: Literal[AzureVoiceType.AZURE_STANDARD] - volume: str - - - class azure.ai.voiceagents.types.AzureVoiceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AVATAR_VOICE_SYNC = "avatar-voice-sync" - AZURE_CUSTOM = "azure-custom" - AZURE_PERSONAL = "azure-personal" - AZURE_STANDARD = "azure-standard" - - - class azure.ai.voiceagents.types.BotServiceAuthorizationScheme(TypedDict, total=False): - key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE]] - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE] - - - class azure.ai.voiceagents.types.BotServiceRbacAuthorizationScheme(TypedDict, total=False): - key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC]] - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC] - - - class azure.ai.voiceagents.types.BotServiceTenantAuthorizationScheme(TypedDict, total=False): - key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT]] - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT] - - - class azure.ai.voiceagents.types.CreateTranscriptionResponseJsonUsageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DURATION = "duration" - TOKENS = "tokens" - - - class azure.ai.voiceagents.types.CreateVoiceAgentRequest(TypedDict, total=False): - key "agent_card": ForwardRef('AgentCard', module='types') - key "agent_endpoint": ForwardRef('AgentEndpointConfig', module='types') - key "blueprint_reference": ForwardRef('AgentBlueprintReference', module='types') - key "definition": Required[VoiceAgentDefinition] - key "description": str - key "draft": bool - key "name": Required[str] - key "state": Union[str, AgentState] - agent_card: AgentCard - agent_endpoint: AgentEndpointConfig - blueprint_reference: AgentBlueprintReference - definition: VoiceAgentDefinition - description: str - draft: bool - metadata: dict[str, str] - name: str - state: Union[str, AgentState] - - - class azure.ai.voiceagents.types.CreateVoiceAgentVersionRequest(TypedDict, total=False): - key "blueprint_reference": ForwardRef('AgentBlueprintReference', module='types') - key "definition": Required[VoiceAgentDefinition] - key "description": str - key "draft": bool - blueprint_reference: AgentBlueprintReference - definition: VoiceAgentDefinition - description: str - draft: bool - metadata: dict[str, str] - - - class azure.ai.voiceagents.types.EntraAuthorizationScheme(TypedDict, total=False): - key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.ENTRA]] - type: Literal[AgentEndpointAuthorizationSchemeType.ENTRA] - - - class azure.ai.voiceagents.types.FixedRatioVersionSelectionRule(TypedDict, total=False): - key "agent_version": Required[str] - key "traffic_percentage": Required[int] - key "type": Required[Literal[VersionSelectorType.FIXED_RATIO]] - agent_version: str - traffic_percentage: int - type: Literal[VersionSelectorType.FIXED_RATIO] - - - class azure.ai.voiceagents.types.GenerateVoiceAgentRequest(TypedDict, total=False): - key "agent_type": Required[Union[str, VoiceAgentType]] - key "description": str - key "draft": bool - key "goal": Required[str] - key "model": Required[str] - key "model_type": Required[Union[str, VoiceModelType]] - key "name": Required[str] - key "use_case": Required[Union[str, VoiceAgentUseCase]] - agent_type: Union[str, VoiceAgentType] - description: str - draft: bool - goal: str - model: str - model_type: Union[str, VoiceModelType] - name: str - tools: list[VoiceAgentTool] - use_case: Union[str, VoiceAgentUseCase] - - - class azure.ai.voiceagents.types.InvocationsProtocolConfiguration(TypedDict, total=False): - - - class azure.ai.voiceagents.types.InvocationsWsProtocolConfiguration(TypedDict, total=False): - - - class azure.ai.voiceagents.types.LlmGeneratedVoiceGreetingConfig(TypedDict, total=False): - key "fallback_text": str - key "prompt": Required[str] - key "tool_choice": Union[str, VoiceGreetingToolChoice] - key "type": Required[Literal["llm_generated"]] - fallback_text: str - prompt: str - tool_choice: Union[str, VoiceGreetingToolChoice] - type: Literal[llm_generated] - - - class azure.ai.voiceagents.types.LogProbProperties(TypedDict, total=False): - key "bytes": Required[list[int]] - key "logprob": Required[float] - key "token": Required[str] - bytes: list[int] - logprob: float - token: str - - - class azure.ai.voiceagents.types.MCPListToolsTool(TypedDict, total=False): - key "annotations": Optional[MCPListToolsToolAnnotations] - key "description": Optional[str] - key "input_schema": Required[MCPListToolsToolInputSchema] - key "name": Required[str] - annotations: MCPListToolsToolAnnotations - description: str - input_schema: MCPListToolsToolInputSchema - name: str - - - class azure.ai.voiceagents.types.MCPListToolsToolAnnotations(TypedDict, total=False): - - - class azure.ai.voiceagents.types.MCPListToolsToolInputSchema(TypedDict, total=False): - - - class azure.ai.voiceagents.types.MCPTool(TypedDict, total=False): - key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] - key "allowed_tools": Optional[Union[list[str], MCPToolFilter]] - key "authorization": str - key "connector_id": Literal["connector_dropbox", "connector_gmail", "connector_googlecalendar", "connector_googledrive", "connector_microsoftteams", "connector_outlookcalendar", "connector_outlookemail", "connector_sharepoint"] - key "defer_loading": bool - key "headers": Optional[dict[str, str]] - key "project_connection_id": str - key "require_approval": Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] - key "server_description": str - key "server_label": Required[str] - key "server_url": str - key "tunnel_id": str - key "type": Required[Literal[ToolType.MCP]] - allowed_callers: list[Union[str, CallableToolAllowedCaller]] - allowed_tools: Union[list[str], MCPToolFilter] - authorization: str - connector_id: Literal[connector_dropbox, connector_gmail, connector_googlecalendar, connector_googledrive, connector_microsoftteams, - defer_loading: bool - headers: dict[str, str] - project_connection_id: str - require_approval: Union[MCPToolRequireApproval, Literal[always], Literal[never]] - server_description: str - server_label: str - server_url: str - tool_configs: dict[str, ToolConfig] - tunnel_id: str - type: Literal[ToolType.MCP] - - - class azure.ai.voiceagents.types.MCPToolFilter(TypedDict, total=False): - key "read_only": bool - read_only: bool - tool_names: list[str] - - - class azure.ai.voiceagents.types.MCPToolRequireApproval(TypedDict, total=False): - key "always": ForwardRef('MCPToolFilter', module='types') - key "never": ForwardRef('MCPToolFilter', module='types') - always: MCPToolFilter - never: MCPToolFilter - - - class azure.ai.voiceagents.types.ManagedAgentIdentityBlueprintReference(TypedDict, total=False): - key "blueprint_id": Required[str] - key "type": Required[Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT]] - blueprint_id: str - type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] - - - class azure.ai.voiceagents.types.McpProtocolConfiguration(TypedDict, total=False): - - - class azure.ai.voiceagents.types.Metadata(TypedDict, total=False): - - - class azure.ai.voiceagents.types.OpenAIVoice(TypedDict, total=False): - key "name": Required[Union[str, VoiceIdsShared]] - key "type": Required[Literal["openai"]] - name: Union[str, VoiceIdsShared] - type: Literal[openai] - - - class azure.ai.voiceagents.types.ProtocolConfiguration(TypedDict, total=False): - key "a2a": ForwardRef('A2AProtocolConfiguration', module='types') - key "activity": ForwardRef('ActivityProtocolConfiguration', module='types') - key "invocations": ForwardRef('InvocationsProtocolConfiguration', module='types') - key "invocations_ws": ForwardRef('InvocationsWsProtocolConfiguration', module='types') - key "mcp": ForwardRef('McpProtocolConfiguration', module='types') - key "responses": ForwardRef('ResponsesProtocolConfiguration', module='types') - a2a: A2AProtocolConfiguration - activity: ActivityProtocolConfiguration - invocations: InvocationsProtocolConfiguration - invocations_ws: InvocationsWsProtocolConfiguration - mcp: McpProtocolConfiguration - responses: ResponsesProtocolConfiguration - - - class azure.ai.voiceagents.types.RaiConfig(TypedDict, total=False): - key "rai_policy_name": Required[str] - rai_policy_name: str - - - class azure.ai.voiceagents.types.RealtimeClientEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CONVERSATION_ITEM_CREATE = "conversation.item.create" - CONVERSATION_ITEM_DELETE = "conversation.item.delete" - CONVERSATION_ITEM_RETRIEVE = "conversation.item.retrieve" - CONVERSATION_ITEM_TRUNCATE = "conversation.item.truncate" - INPUT_AUDIO_BUFFER_APPEND = "input_audio_buffer.append" - INPUT_AUDIO_BUFFER_CLEAR = "input_audio_buffer.clear" - INPUT_AUDIO_BUFFER_COMMIT = "input_audio_buffer.commit" - OUTPUT_AUDIO_BUFFER_CLEAR = "output_audio_buffer.clear" - RESPONSE_CANCEL = "response.cancel" - RESPONSE_CREATE = "response.create" - SESSION_UPDATE = "session.update" - - - class azure.ai.voiceagents.types.RealtimeConversationItemFunctionCall(TypedDict, total=False): - key "arguments": Required[str] - key "call_id": str - key "id": str - key "name": Required[str] - key "object": Literal["item"] - key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal[RealtimeConversationItemType.FUNCTION_CALL]] - arguments: str - call_id: str - id: str - name: str - object: Literal[item] - status: Literal[completed, incomplete, in_progress] - type: Literal[RealtimeConversationItemType.FUNCTION_CALL] - - - class azure.ai.voiceagents.types.RealtimeConversationItemFunctionCallOutput(TypedDict, total=False): - key "call_id": Required[str] - key "id": str - key "object": Literal["item"] - key "output": Required[str] - key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT]] - call_id: str - id: str - object: Literal[item] - output: str - status: Literal[completed, incomplete, in_progress] - type: Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT] - - - class azure.ai.voiceagents.types.RealtimeConversationItemMessageAssistant(TypedDict, total=False): - key "content": Required[list[RealtimeConversationItemMessageAssistantContent]] - key "id": str - key "object": Literal["item"] - key "role": Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] - key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal["message"]] - content: list[RealtimeConversationItemMessageAssistantContent] - id: str - object: Literal[item] - role: Literal[RealtimeConversationItemMessageType.ASSISTANT] - status: Literal[completed, incomplete, in_progress] - type: Literal[message] - - - class azure.ai.voiceagents.types.RealtimeConversationItemMessageAssistantContent(TypedDict, total=False): - key "audio": str - key "text": str - key "transcript": str - key "type": Literal["output_text", "output_audio"] - audio: str - text: str - transcript: str - type: Literal[output_text, output_audio] - - - class azure.ai.voiceagents.types.RealtimeConversationItemMessageSystem(TypedDict, total=False): - key "content": Required[list[RealtimeConversationItemMessageSystemContent]] - key "id": str - key "object": Literal["item"] - key "role": Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] - key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal["message"]] - content: list[RealtimeConversationItemMessageSystemContent] - id: str - object: Literal[item] - role: Literal[RealtimeConversationItemMessageType.SYSTEM] - status: Literal[completed, incomplete, in_progress] - type: Literal[message] - - - class azure.ai.voiceagents.types.RealtimeConversationItemMessageSystemContent(TypedDict, total=False): - key "text": str - key "type": Literal["input_text"] - text: str - type: Literal[input_text] - - - class azure.ai.voiceagents.types.RealtimeConversationItemMessageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ASSISTANT = "assistant" - SYSTEM = "system" - USER = "user" - - - class azure.ai.voiceagents.types.RealtimeConversationItemMessageUser(TypedDict, total=False): - key "content": Required[list[RealtimeConversationItemMessageUserContent]] - key "id": str - key "object": Literal["item"] - key "role": Required[Literal[RealtimeConversationItemMessageType.USER]] - key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal["message"]] - content: list[RealtimeConversationItemMessageUserContent] - id: str - object: Literal[item] - role: Literal[RealtimeConversationItemMessageType.USER] - status: Literal[completed, incomplete, in_progress] - type: Literal[message] - - - class azure.ai.voiceagents.types.RealtimeConversationItemMessageUserContent(TypedDict, total=False): - key "audio": str - key "detail": Literal["auto", "low", "high"] - key "image_url": str - key "text": str - key "transcript": str - key "type": Literal["input_text", "input_audio", "input_image"] - audio: str - detail: Literal[auto, low, high] - image_url: str - text: str - transcript: str - type: Literal[input_text, input_audio, input_image] - - - class azure.ai.voiceagents.types.RealtimeConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FUNCTION_CALL = "function_call" - FUNCTION_CALL_OUTPUT = "function_call_output" - MCP_APPROVAL_REQUEST = "mcp_approval_request" - MCP_APPROVAL_RESPONSE = "mcp_approval_response" - MCP_CALL = "mcp_call" - MCP_LIST_TOOLS = "mcp_list_tools" - - - class azure.ai.voiceagents.types.RealtimeFunctionTool(TypedDict, total=False): - key "description": str - key "name": str - key "parameters": ForwardRef('RealtimeFunctionToolParameters', module='types') - key "type": Literal["function"] - description: str - name: str - parameters: RealtimeFunctionToolParameters - type: Literal[function] - - - class azure.ai.voiceagents.types.RealtimeFunctionToolParameters(TypedDict, total=False): - - - class azure.ai.voiceagents.types.RealtimeMCPApprovalRequest(TypedDict, total=False): - key "arguments": Required[str] - key "id": Required[str] - key "name": Required[str] - key "server_label": Required[str] - key "type": Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST]] - arguments: str - id: str - name: str - server_label: str - type: Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST] - - - class azure.ai.voiceagents.types.RealtimeMCPApprovalResponse(TypedDict, total=False): - key "approval_request_id": Required[str] - key "approve": Required[bool] - key "id": Required[str] - key "reason": Optional[str] - key "type": Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE]] - approval_request_id: str - approve: bool - id: str - reason: str - type: Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE] - - - class azure.ai.voiceagents.types.RealtimeMCPHTTPError(TypedDict, total=False): - key "code": Required[int] - key "message": Required[str] - key "type": Required[Literal[RealtimeMcpErrorType.HTTP_ERROR]] - code: int - message: str - type: Literal[RealtimeMcpErrorType.HTTP_ERROR] - - - class azure.ai.voiceagents.types.RealtimeMCPListTools(TypedDict, total=False): - key "id": str - key "server_label": Required[str] - key "tools": Required[list[MCPListToolsTool]] - key "type": Required[Literal[RealtimeConversationItemType.MCP_LIST_TOOLS]] - id: str - server_label: str - tools: list[MCPListToolsTool] - type: Literal[RealtimeConversationItemType.MCP_LIST_TOOLS] - - - class azure.ai.voiceagents.types.RealtimeMCPProtocolError(TypedDict, total=False): - key "code": Required[int] - key "message": Required[str] - key "type": Required[Literal[RealtimeMcpErrorType.PROTOCOL_ERROR]] - code: int - message: str - type: Literal[RealtimeMcpErrorType.PROTOCOL_ERROR] - - - class azure.ai.voiceagents.types.RealtimeMCPToolCall(TypedDict, total=False): - key "approval_request_id": Optional[str] - key "arguments": Required[str] - key "error": ForwardRef('RealtimeMCPError', module='types') - key "id": Required[str] - key "name": Required[str] - key "output": Optional[str] - key "server_label": Required[str] - key "type": Required[Literal[RealtimeConversationItemType.MCP_CALL]] - approval_request_id: str - arguments: str - error: RealtimeMCPError - id: str - name: str - output: str - server_label: str - type: Literal[RealtimeConversationItemType.MCP_CALL] - - - class azure.ai.voiceagents.types.RealtimeMCPToolExecutionError(TypedDict, total=False): - key "message": Required[str] - key "type": Required[Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR]] - message: str - type: Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR] - - - class azure.ai.voiceagents.types.RealtimeMcpErrorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - HTTP_ERROR = "http_error" - PROTOCOL_ERROR = "protocol_error" - TOOL_EXECUTION_ERROR = "tool_execution_error" - - - class azure.ai.voiceagents.types.RealtimeReasoning(TypedDict, total=False): - key "effort": Union[str, RealtimeReasoningEffort] - effort: Union[str, RealtimeReasoningEffort] - - - class azure.ai.voiceagents.types.RealtimeResponseStatusDetails(TypedDict, total=False): - key "error": ForwardRef('RealtimeResponseStatusDetailsError', module='types') - key "reason": Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"] - key "type": Literal["completed", "cancelled", "failed", "incomplete"] - error: RealtimeResponseStatusDetailsError - reason: Literal[turn_detected, client_cancelled, max_output_tokens, content_filter] - type: Literal[completed, cancelled, failed, incomplete] - - - class azure.ai.voiceagents.types.RealtimeResponseStatusDetailsError(TypedDict, total=False): - key "code": str - key "type": str - code: str - type: str - - - class azure.ai.voiceagents.types.RealtimeResponseUsage(TypedDict, total=False): - key "input_token_details": ForwardRef('RealtimeResponseUsageInputTokenDetails', module='types') - key "input_tokens": int - key "output_token_details": ForwardRef('RealtimeResponseUsageOutputTokenDetails', module='types') - key "output_tokens": int - key "total_tokens": int - input_token_details: RealtimeResponseUsageInputTokenDetails - input_tokens: int - output_token_details: RealtimeResponseUsageOutputTokenDetails - output_tokens: int - total_tokens: int - - - class azure.ai.voiceagents.types.RealtimeResponseUsageInputTokenDetails(TypedDict, total=False): - key "audio_tokens": int - key "cached_tokens": int - key "cached_tokens_details": ForwardRef('RealtimeResponseUsageInputTokenDetailsCachedTokensDetails', module='types') - key "image_tokens": int - key "text_tokens": int - audio_tokens: int - cached_tokens: int - cached_tokens_details: RealtimeResponseUsageInputTokenDetailsCachedTokensDetails - image_tokens: int - text_tokens: int - - - class azure.ai.voiceagents.types.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails(TypedDict, total=False): - key "audio_tokens": int - key "image_tokens": int - key "text_tokens": int - audio_tokens: int - image_tokens: int - text_tokens: int - - - class azure.ai.voiceagents.types.RealtimeResponseUsageOutputTokenDetails(TypedDict, total=False): - key "audio_tokens": int - key "text_tokens": int - audio_tokens: int - text_tokens: int - - - class azure.ai.voiceagents.types.RealtimeServerEvent(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "part": Required[RealtimeServerEventResponseContentPartAddedPart] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED]] - content_index: int - event_id: str - item_id: str - output_index: int - part: RealtimeServerEventResponseContentPartAddedPart - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED] - - - class azure.ai.voiceagents.types.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError(TypedDict, total=False): - key "code": str - key "message": str - key "param": str - key "type": str - code: str - message: str - param: str - type: str - - - class azure.ai.voiceagents.types.RealtimeServerEventRateLimitsUpdatedRateLimits(TypedDict, total=False): - key "limit": int - key "name": Literal["requests", "tokens"] - key "remaining": int - key "reset_seconds": float - limit: int - name: Literal[requests, tokens] - remaining: int - reset_seconds: float - - - class azure.ai.voiceagents.types.RealtimeServerEventResponseContentPartAdded(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "part": Required[RealtimeServerEventResponseContentPartAddedPart] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED]] - content_index: int - event_id: str - item_id: str - output_index: int - part: RealtimeServerEventResponseContentPartAddedPart - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED] - - - class azure.ai.voiceagents.types.RealtimeServerEventResponseContentPartAddedPart(TypedDict, total=False): - key "audio": str - key "text": str - key "transcript": str - key "type": Literal["audio", "text"] - audio: str - text: str - transcript: str - type: Literal[audio, text] - - - class azure.ai.voiceagents.types.RealtimeServerEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CONVERSATION_CREATED = "conversation.created" - CONVERSATION_ITEM_ADDED = "conversation.item.added" - CONVERSATION_ITEM_CREATED = "conversation.item.created" - CONVERSATION_ITEM_DELETED = "conversation.item.deleted" - CONVERSATION_ITEM_DONE = "conversation.item.done" - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED = "conversation.item.input_audio_transcription.completed" - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA = "conversation.item.input_audio_transcription.delta" - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED = "conversation.item.input_audio_transcription.failed" - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT = "conversation.item.input_audio_transcription.segment" - CONVERSATION_ITEM_RETRIEVED = "conversation.item.retrieved" - CONVERSATION_ITEM_TRUNCATED = "conversation.item.truncated" - ERROR = "error" - INPUT_AUDIO_BUFFER_CLEARED = "input_audio_buffer.cleared" - INPUT_AUDIO_BUFFER_COMMITTED = "input_audio_buffer.committed" - INPUT_AUDIO_BUFFER_DTMF_EVENT_RECEIVED = "input_audio_buffer.dtmf_event_received" - INPUT_AUDIO_BUFFER_SPEECH_STARTED = "input_audio_buffer.speech_started" - INPUT_AUDIO_BUFFER_SPEECH_STOPPED = "input_audio_buffer.speech_stopped" - INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED = "input_audio_buffer.timeout_triggered" - MCP_LIST_TOOLS_COMPLETED = "mcp_list_tools.completed" - MCP_LIST_TOOLS_FAILED = "mcp_list_tools.failed" - MCP_LIST_TOOLS_IN_PROGRESS = "mcp_list_tools.in_progress" - OUTPUT_AUDIO_BUFFER_CLEARED = "output_audio_buffer.cleared" - OUTPUT_AUDIO_BUFFER_STARTED = "output_audio_buffer.started" - OUTPUT_AUDIO_BUFFER_STOPPED = "output_audio_buffer.stopped" - RATE_LIMITS_UPDATED = "rate_limits.updated" - RESPONSE_CONTENT_PART_ADDED = "response.content_part.added" - RESPONSE_CONTENT_PART_DONE = "response.content_part.done" - RESPONSE_CREATED = "response.created" - RESPONSE_DONE = "response.done" - RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA = "response.function_call_arguments.delta" - RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE = "response.function_call_arguments.done" - RESPONSE_MCP_CALL_ARGUMENTS_DELTA = "response.mcp_call_arguments.delta" - RESPONSE_MCP_CALL_ARGUMENTS_DONE = "response.mcp_call_arguments.done" - RESPONSE_MCP_CALL_COMPLETED = "response.mcp_call.completed" - RESPONSE_MCP_CALL_FAILED = "response.mcp_call.failed" - RESPONSE_MCP_CALL_IN_PROGRESS = "response.mcp_call.in_progress" - RESPONSE_OUTPUT_AUDIO_DELTA = "response.output_audio.delta" - RESPONSE_OUTPUT_AUDIO_DONE = "response.output_audio.done" - RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA = "response.output_audio_transcript.delta" - RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE = "response.output_audio_transcript.done" - RESPONSE_OUTPUT_ITEM_ADDED = "response.output_item.added" - RESPONSE_OUTPUT_ITEM_DONE = "response.output_item.done" - RESPONSE_OUTPUT_TEXT_DELTA = "response.output_text.delta" - RESPONSE_OUTPUT_TEXT_DONE = "response.output_text.done" - SESSION_CREATED = "session.created" - SESSION_UPDATED = "session.updated" - - - class azure.ai.voiceagents.types.RealtimeToolChoiceFunction(TypedDict, total=False): - key "name": Required[str] - key "type": Required[Literal[ToolChoiceParamType.FUNCTION]] - name: str - type: Literal[ToolChoiceParamType.FUNCTION] - - - class azure.ai.voiceagents.types.ResponsesProtocolConfiguration(TypedDict, total=False): - - - class azure.ai.voiceagents.types.StructuredInputDefinition(TypedDict, total=False): - key "default_value": Any - key "description": str - key "required": bool - default_value: Any - description: str - required: bool - schema: dict[str, Any] - - - class azure.ai.voiceagents.types.TemplateVoiceGreetingConfig(TypedDict, total=False): - key "text": Required[str] - key "type": Required[Literal["template"]] - text: str - type: Literal[template] - - - class azure.ai.voiceagents.types.Tool(TypedDict, total=False): - key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] - key "allowed_tools": Optional[Union[list[str], MCPToolFilter]] - key "authorization": str - key "connector_id": Literal["connector_dropbox", "connector_gmail", "connector_googlecalendar", "connector_googledrive", "connector_microsoftteams", "connector_outlookcalendar", "connector_outlookemail", "connector_sharepoint"] - key "defer_loading": bool - key "headers": Optional[dict[str, str]] - key "project_connection_id": str - key "require_approval": Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] - key "server_description": str - key "server_label": Required[str] - key "server_url": str - key "tunnel_id": str - key "type": Required[Literal[ToolType.MCP]] - allowed_callers: list[Union[str, CallableToolAllowedCaller]] - allowed_tools: Union[list[str], MCPToolFilter] - authorization: str - connector_id: Literal[connector_dropbox, connector_gmail, connector_googlecalendar, connector_googledrive, connector_microsoftteams, - defer_loading: bool - headers: dict[str, str] - project_connection_id: str - require_approval: Union[MCPToolRequireApproval, Literal[always], Literal[never]] - server_description: str - server_label: str - server_url: str - tool_configs: dict[str, ToolConfig] - tunnel_id: str - type: Literal[ToolType.MCP] - - - class azure.ai.voiceagents.types.ToolChoiceFunction(TypedDict, total=False): - key "name": Required[str] - key "type": Required[Literal[ToolChoiceParamType.FUNCTION]] - name: str - type: Literal[ToolChoiceParamType.FUNCTION] - - - class azure.ai.voiceagents.types.ToolChoiceMCP(TypedDict, total=False): - key "name": Optional[str] - key "server_label": Required[str] - key "type": Required[Literal[ToolChoiceParamType.MCP]] - name: str - server_label: str - type: Literal[ToolChoiceParamType.MCP] - - - class azure.ai.voiceagents.types.ToolChoiceParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ALLOWED_TOOLS = "allowed_tools" - APPLY_PATCH = "apply_patch" - CODE_INTERPRETER = "code_interpreter" - COMPUTER = "computer" - COMPUTER_USE = "computer_use" - COMPUTER_USE_PREVIEW = "computer_use_preview" - CUSTOM = "custom" - FILE_SEARCH = "file_search" - FUNCTION = "function" - IMAGE_GENERATION = "image_generation" - MCP = "mcp" - PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" - SHELL = "shell" - WEB_SEARCH_PREVIEW = "web_search_preview" - WEB_SEARCH_PREVIEW2025_03_11 = "web_search_preview_2025_03_11" - - - class azure.ai.voiceagents.types.ToolConfig(TypedDict, total=False): - key "additional_search_text": str - key "pin": bool - additional_search_text: str - pin: bool - - - class azure.ai.voiceagents.types.ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - A2_A_PREVIEW = "a2a_preview" - APPLY_PATCH = "apply_patch" - AZURE_AI_SEARCH = "azure_ai_search" - AZURE_FUNCTION = "azure_function" - BING_CUSTOM_SEARCH_PREVIEW = "bing_custom_search_preview" - BING_GROUNDING = "bing_grounding" - BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" - CAPTURE_STRUCTURED_OUTPUTS = "capture_structured_outputs" - CODE_INTERPRETER = "code_interpreter" - COMPUTER = "computer" - COMPUTER_USE_PREVIEW = "computer_use_preview" - CUSTOM = "custom" - FABRIC_DATAAGENT_PREVIEW = "fabric_dataagent_preview" - FABRIC_IQ_PREVIEW = "fabric_iq_preview" - FILE_SEARCH = "file_search" - FUNCTION = "function" - IMAGE_GENERATION = "image_generation" - LOCAL_SHELL = "local_shell" - MCP = "mcp" - MEMORY_SEARCH_PREVIEW = "memory_search_preview" - NAMESPACE = "namespace" - OPENAPI = "openapi" - PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" - SHAREPOINT_GROUNDING_PREVIEW = "sharepoint_grounding_preview" - SHELL = "shell" - TOOLBOX_SEARCH_PREVIEW = "toolbox_search_preview" - TOOL_SEARCH = "tool_search" - WEB_SEARCH = "web_search" - WEB_SEARCH_PREVIEW = "web_search_preview" - WORK_IQ_PREVIEW = "work_iq_preview" - - - class azure.ai.voiceagents.types.TranscriptTextUsageDuration(TypedDict, total=False): - key "seconds": Required[str] - key "type": Required[Literal[CreateTranscriptionResponseJsonUsageType.DURATION]] - seconds: str - type: Literal[CreateTranscriptionResponseJsonUsageType.DURATION] - - - class azure.ai.voiceagents.types.TranscriptTextUsageTokens(TypedDict, total=False): - key "input_token_details": ForwardRef('TranscriptTextUsageTokensInputTokenDetails', module='types') - key "input_tokens": Required[int] - key "output_tokens": Required[int] - key "total_tokens": Required[int] - key "type": Required[Literal[CreateTranscriptionResponseJsonUsageType.TOKENS]] - input_token_details: TranscriptTextUsageTokensInputTokenDetails - input_tokens: int - output_tokens: int - total_tokens: int - type: Literal[CreateTranscriptionResponseJsonUsageType.TOKENS] - - - class azure.ai.voiceagents.types.TranscriptTextUsageTokensInputTokenDetails(TypedDict, total=False): - key "audio_tokens": int - key "text_tokens": int - audio_tokens: int - text_tokens: int - - - class azure.ai.voiceagents.types.UpdateVoiceAgentRequest(TypedDict, total=False): - key "blueprint_reference": ForwardRef('AgentBlueprintReference', module='types') - key "definition": Required[VoiceAgentDefinition] - key "description": str - blueprint_reference: AgentBlueprintReference - definition: VoiceAgentDefinition - description: str - metadata: dict[str, str] - - - class azure.ai.voiceagents.types.VersionSelectionRule(TypedDict, total=False): - key "agent_version": Required[str] - key "traffic_percentage": Required[int] - key "type": Required[Literal[VersionSelectorType.FIXED_RATIO]] - agent_version: str - traffic_percentage: int - type: Literal[VersionSelectorType.FIXED_RATIO] - - - class azure.ai.voiceagents.types.VersionSelector(TypedDict, total=False): - key "version_selection_rules": Required[list[VersionSelectionRule]] - version_selection_rules: list[VersionSelectionRule] - - - class azure.ai.voiceagents.types.VersionSelectorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FIXED_RATIO = "FixedRatio" - - - class azure.ai.voiceagents.types.VoiceAgentAnimationConfig(TypedDict, total=False): - key "model_name": str - model_name: str - outputs: list[Union[str, VoiceAgentAnimationOutputType]] - - - class azure.ai.voiceagents.types.VoiceAgentAvatarIceServer(TypedDict, total=False): - key "credential": Optional[str] - key "urls": Required[list[str]] - key "username": Optional[str] - credential: str - urls: list[str] - username: str - - - class azure.ai.voiceagents.types.VoiceAgentAvatarScene(TypedDict, total=False): - key "amplitude": float - key "position_x": float - key "position_y": float - key "rotation_x": float - key "rotation_y": float - key "rotation_z": float - key "zoom": float - amplitude: float - position_x: float - position_y: float - rotation_x: float - rotation_y: float - rotation_z: float - zoom: float - - - class azure.ai.voiceagents.types.VoiceAgentAvatarVideoBackground(TypedDict, total=False): - key "color": Optional[str] - key "image_url": Optional[str] - color: str - image_url: str - - - class azure.ai.voiceagents.types.VoiceAgentAvatarVideoCrop(TypedDict, total=False): - key "bottom_right": Required[list[int]] - key "top_left": Required[list[int]] - bottom_right: list[int] - top_left: list[int] - - - class azure.ai.voiceagents.types.VoiceAgentAvatarVideoParams(TypedDict, total=False): - key "background": Optional[VoiceAgentAvatarVideoBackground] - key "bitrate": int - key "codec": Literal["h264"] - key "crop": Optional[VoiceAgentAvatarVideoCrop] - key "gop_size": int - key "resolution": Optional[VoiceAgentAvatarVideoResolution] - background: VoiceAgentAvatarVideoBackground - bitrate: int - codec: Literal[h264] - crop: VoiceAgentAvatarVideoCrop - gop_size: int - resolution: VoiceAgentAvatarVideoResolution - - - class azure.ai.voiceagents.types.VoiceAgentAvatarVideoResolution(TypedDict, total=False): - key "height": Required[int] - key "width": Required[int] - height: int - width: int - - - class azure.ai.voiceagents.types.VoiceAgentAzureMultilingualSemanticVadTurnDetection(TypedDict, total=False): - key "auto_truncate": bool - key "create_response": bool - key "end_of_utterance_detection": Optional[VoiceAgentEndOfUtteranceDetection] - key "idle_timeout_ms": Optional[int] - key "interrupt_response": bool - key "languages": Optional[list[str]] - key "prefix_padding_ms": Optional[int] - key "remove_filler_words": bool - key "silence_duration_ms": Optional[int] - key "speech_duration_ms": Optional[int] - key "threshold": Optional[float] - key "type": Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL]] - auto_truncate: bool - create_response: bool - end_of_utterance_detection: VoiceAgentEndOfUtteranceDetection - idle_timeout_ms: int - interrupt_response: bool - languages: list[str] - prefix_padding_ms: int - remove_filler_words: bool - silence_duration_ms: int - speech_duration_ms: int - threshold: float - type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] - - - class azure.ai.voiceagents.types.VoiceAgentAzureSemanticVadTurnDetection(TypedDict, total=False): - key "auto_truncate": bool - key "create_response": bool - key "end_of_utterance_detection": Optional[VoiceAgentEndOfUtteranceDetection] - key "idle_timeout_ms": Optional[int] - key "interrupt_response": bool - key "languages": Optional[list[str]] - key "prefix_padding_ms": Optional[int] - key "remove_filler_words": bool - key "silence_duration_ms": Optional[int] - key "speech_duration_ms": Optional[int] - key "threshold": Optional[float] - key "type": Required[Union[str, VoiceAgentAzureSemanticVadType]] - auto_truncate: bool - create_response: bool - end_of_utterance_detection: VoiceAgentEndOfUtteranceDetection - idle_timeout_ms: int - interrupt_response: bool - languages: list[str] - prefix_padding_ms: int - remove_filler_words: bool - silence_duration_ms: int - speech_duration_ms: int - threshold: float - type: Union[str, VoiceAgentAzureSemanticVadType] - - - class azure.ai.voiceagents.types.VoiceAgentClientEventConversationItemCreate(TypedDict, total=False): - key "event_id": str - key "item": Required[VoiceAgentCreateConversationItem] - key "previous_item_id": str - key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE]] - event_id: str - item: VoiceAgentCreateConversationItem - previous_item_id: str - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE] - - - class azure.ai.voiceagents.types.VoiceAgentClientEventConversationItemDelete(TypedDict, total=False): - key "event_id": str - key "item_id": Required[str] - key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE]] - event_id: str - item_id: str - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE] - - - class azure.ai.voiceagents.types.VoiceAgentClientEventConversationItemRetrieve(TypedDict, total=False): - key "event_id": str - key "item_id": Required[str] - key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE]] - event_id: str - item_id: str - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE] - - - class azure.ai.voiceagents.types.VoiceAgentClientEventConversationItemTruncate(TypedDict, total=False): - key "audio_end_ms": Required[int] - key "content_index": Required[int] - key "event_id": str - key "item_id": Required[str] - key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE]] - audio_end_ms: int - content_index: int - event_id: str - item_id: str - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE] - - - class azure.ai.voiceagents.types.VoiceAgentClientEventInputAudioBufferAppend(TypedDict, total=False): - key "audio": Required[str] - key "event_id": str - key "type": Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND]] - audio: str - event_id: str - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND] - - - class azure.ai.voiceagents.types.VoiceAgentClientEventInputAudioBufferClear(TypedDict, total=False): - key "event_id": str - key "type": Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR]] - event_id: str - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR] - - - class azure.ai.voiceagents.types.VoiceAgentClientEventInputAudioBufferCommit(TypedDict, total=False): - key "event_id": str - key "type": Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT]] - event_id: str - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT] - - - class azure.ai.voiceagents.types.VoiceAgentClientEventOutputAudioBufferClear(TypedDict, total=False): - key "event_id": str - key "type": Required[Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR]] - event_id: str - type: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR] - - - class azure.ai.voiceagents.types.VoiceAgentClientEventResponseCancel(TypedDict, total=False): - key "event_id": str - key "response_id": str - key "type": Required[Literal[RealtimeClientEventType.RESPONSE_CANCEL]] - event_id: str - response_id: str - type: Literal[RealtimeClientEventType.RESPONSE_CANCEL] - - - class azure.ai.voiceagents.types.VoiceAgentClientEventResponseCreate(TypedDict, total=False): - key "event_id": str - key "response": ForwardRef('VoiceAgentResponseCreateParams', module='types') - key "type": Required[Literal[RealtimeClientEventType.RESPONSE_CREATE]] - event_id: str - response: VoiceAgentResponseCreateParams - type: Literal[RealtimeClientEventType.RESPONSE_CREATE] - - - class azure.ai.voiceagents.types.VoiceAgentClientEventSessionAvatarConnect(TypedDict, total=False): - key "client_sdp": Required[str] - key "event_id": str - key "type": Required[Literal["connect"]] - client_sdp: str - event_id: str - type: Literal[connect] - - - class azure.ai.voiceagents.types.VoiceAgentClientEventSessionUpdate(TypedDict, total=False): - key "event_id": str - key "session": Required[VoiceAgentSessionUpdateConfig] - key "type": Required[Literal[RealtimeClientEventType.SESSION_UPDATE]] - event_id: str - session: VoiceAgentSessionUpdateConfig - type: Literal[RealtimeClientEventType.SESSION_UPDATE] - - - class azure.ai.voiceagents.types.VoiceAgentDefinition(TypedDict, total=False): - key "audio": ForwardRef('VoiceAudioConfig', module='types') - key "avatar": ForwardRef('VoiceAvatarConfig', module='types') - key "greeting": ForwardRef('VoiceGreetingConfig', module='types') - key "instructions": str - key "kind": Required[Literal["voice"]] - key "model": Required[str] - key "model_type": Required[Union[str, VoiceModelType]] - key "rai_config": ForwardRef('RaiConfig', module='types') - key "store": bool - audio: VoiceAudioConfig - avatar: VoiceAvatarConfig - greeting: VoiceGreetingConfig - instructions: str - kind: Literal[voice] - model: str - model_type: Union[str, VoiceModelType] - output_modalities: list[Union[str, VoiceOutputModality]] - rai_config: RaiConfig - store: bool - structured_inputs: dict[str, StructuredInputDefinition] - tools: list[VoiceAgentTool] - - - class azure.ai.voiceagents.types.VoiceAgentEchoCancellation(TypedDict, total=False): - key "channels": int - key "reference_source": Union[str, VoiceAgentEchoCancellationReferenceSource] - key "type": Required[Literal["server_echo_cancellation"]] - channels: int - reference_source: Union[str, VoiceAgentEchoCancellationReferenceSource] - type: Literal[server_echo_cancellation] - - - class azure.ai.voiceagents.types.VoiceAgentEndOfUtteranceDetection(TypedDict, total=False): - key "model": Required[Union[str, VoiceAgentEndOfUtteranceModel]] - key "threshold": Optional[float] - key "threshold_level": Optional[Union[str, VoiceAgentEndOfUtteranceThresholdLevel]] - key "timeout": Optional[float] - key "timeout_ms": Optional[int] - model: Union[str, VoiceAgentEndOfUtteranceModel] - threshold: float - threshold_level: Union[str, VoiceAgentEndOfUtteranceThresholdLevel] - timeout: float - timeout_ms: int - - - class azure.ai.voiceagents.types.VoiceAgentEstimatedCost(TypedDict, total=False): - key "amount": Required[Optional[float]] - key "byom_model_amount": Optional[float] - key "byom_model_price_version": Optional[str] - key "currency": Literal["USD"] - key "input_cost": Optional[float] - key "output_cost": Optional[float] - key "price_version": Required[str] - key "status": Required[Union[str, VoiceAgentEstimatedCostStatus]] - key "voice_live_amount": Required[float] - amount: float - byom_model_amount: float - byom_model_price_version: str - currency: Literal[USD] - input_cost: float - output_cost: float - price_version: str - status: Union[str, VoiceAgentEstimatedCostStatus] - unpriced_components: list[str] - voice_live_amount: float - - - class azure.ai.voiceagents.types.VoiceAgentFileSearchCallItem(TypedDict, total=False): - key "id": Required[str] - key "queries": Optional[list[str]] - key "results": Optional[list[VoiceAgentFileSearchResult]] - key "status": Required[Union[str, VoiceAgentFileSearchCallStatus]] - key "type": Required[Literal["file_search_call"]] - id: str - queries: list[str] - results: list[VoiceAgentFileSearchResult] - status: Union[str, VoiceAgentFileSearchCallStatus] - type: Literal[file_search_call] - - - class azure.ai.voiceagents.types.VoiceAgentFileSearchResult(TypedDict, total=False): - key "attributes": Optional[dict[str, VoiceAgentFileSearchAttributeValue]] - key "file_id": Optional[str] - key "filename": Optional[str] - key "score": Optional[float] - key "text": Optional[str] - attributes: dict[str, VoiceAgentFileSearchAttributeValue] - file_id: str - filename: str - score: float - text: str - - - class azure.ai.voiceagents.types.VoiceAgentHandoffEdgeConfig(TypedDict, total=False): - key "cancel_on_interruption": bool - key "delay_ms": int - key "description": Required[str] - key "id": Required[str] - key "source": Required[str] - key "target": Required[str] - key "target_response": Union[str, VoiceAgentHandoffTargetResponse] - key "transfer_message": Optional[str] - cancel_on_interruption: bool - delay_ms: int - description: str - id: str - source: str - target: str - target_response: Union[str, VoiceAgentHandoffTargetResponse] - transfer_message: str - - - class azure.ai.voiceagents.types.VoiceAgentHandoffEdgeState(TypedDict, total=False): - key "cancel_on_interruption": bool - key "delay_ms": int - key "id": Required[str] - key "source": Required[str] - key "target": Required[str] - key "target_response": Union[str, VoiceAgentHandoffTargetResponse] - key "transfer_message": Optional[str] - cancel_on_interruption: bool - delay_ms: int - id: str - source: str - target: str - target_response: Union[str, VoiceAgentHandoffTargetResponse] - transfer_message: str - - - class azure.ai.voiceagents.types.VoiceAgentHandoffGraphConfig(TypedDict, total=False): - key "edges": Required[list[VoiceAgentHandoffEdgeConfig]] - key "max_attempts": Optional[int] - key "max_transfers": int - key "nodes": Required[list[VoiceAgentHandoffNodeConfig]] - edges: list[VoiceAgentHandoffEdgeConfig] - max_attempts: int - max_transfers: int - nodes: list[VoiceAgentHandoffNodeConfig] - - - class azure.ai.voiceagents.types.VoiceAgentHandoffNodeConfig(TypedDict, total=False): - key "config": Required[VoiceAgentHandoffNodeSessionConfig] - key "description": Required[str] - key "id": Required[str] - config: VoiceAgentHandoffNodeSessionConfig - description: str - id: str - - - class azure.ai.voiceagents.types.VoiceAgentHandoffNodeSessionConfig(TypedDict, total=False): - key "instructions": Optional[str] - key "interim_response": Optional[VoiceAgentInterimResponse] - key "max_response_output_tokens": Optional[VoiceAgentMaxOutputTokens] - key "model": Optional[str] - key "parallel_tool_calls": bool - key "reasoning_effort": Optional[Union[str, VoiceAgentHandoffReasoningEffort]] - key "temperature": Optional[float] - key "tool_choice": Optional[VoiceAgentToolChoice] - key "tools": Optional[list[VoiceAgentSessionTool]] - key "voice": Optional[VoiceAgentVoice] - key "voice_adaptation": Optional[VoiceAgentVoiceAdaptation] - instructions: str - interim_response: VoiceAgentInterimResponse - max_response_output_tokens: VoiceAgentMaxOutputTokens - model: str - parallel_tool_calls: bool - reasoning_effort: Union[str, VoiceAgentHandoffReasoningEffort] - temperature: float - tool_choice: VoiceAgentToolChoice - tools: list[VoiceAgentSessionTool] - voice: VoiceAgentVoice - voice_adaptation: VoiceAgentVoiceAdaptation - - - class azure.ai.voiceagents.types.VoiceAgentHandoffNodeState(TypedDict, total=False): - key "description": Required[str] - key "id": Required[str] - key "implicit": bool - description: str - id: str - implicit: bool - - - class azure.ai.voiceagents.types.VoiceAgentHandoffState(TypedDict, total=False): - key "active_node_id": Required[str] - key "attempt_count": Required[int] - key "available_edge_ids": Required[list[str]] - key "edges": Required[list[VoiceAgentHandoffEdgeState]] - key "node_generation": Required[int] - key "nodes": Required[list[VoiceAgentHandoffNodeState]] - key "pipeline_family": Required[Union[str, VoiceAgentPipelineFamily]] - key "transfer_count": Required[int] - key "transfer_tool": Required[Optional[RealtimeFunctionTool]] - active_node_id: str - attempt_count: int - available_edge_ids: list[str] - edges: list[VoiceAgentHandoffEdgeState] - node_generation: int - nodes: list[VoiceAgentHandoffNodeState] - pipeline_family: Union[str, VoiceAgentPipelineFamily] - transfer_count: int - transfer_tool: RealtimeFunctionTool - - - class azure.ai.voiceagents.types.VoiceAgentLlmInterimResponseConfig(TypedDict, total=False): - key "instructions": str - key "latency_threshold_ms": int - key "max_completion_tokens": int - key "model": str - key "type": Required[Literal["llm_interim_response"]] - instructions: str - latency_threshold_ms: int - max_completion_tokens: int - model: str - triggers: list[Union[str, VoiceAgentInterimResponseTrigger]] - type: Literal[llm_interim_response] - - - class azure.ai.voiceagents.types.VoiceAgentMcpAssignedManagedIdentity(TypedDict, total=False): - key "audience": Required[str] - key "client_id": str - key "type": Required[Literal["assigned_managed_identity"]] - audience: str - client_id: str - type: Literal[assigned_managed_identity] - - - class azure.ai.voiceagents.types.VoiceAgentMcpTool(TypedDict, total=False): - key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] - key "allowed_tools": Optional[Union[list[str], MCPToolFilter]] - key "defer_loading": bool - key "headers": Optional[dict[str, str]] - key "project_connection_id": str - key "require_approval": Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] - key "response_scheduling": Union[str, VoiceAgentMcpResponseScheduling] - key "server_description": str - key "server_label": Required[str] - key "server_url": str - key "type": Required[Literal[ToolType.MCP]] - allowed_callers: list[Union[str, CallableToolAllowedCaller]] - allowed_tools: Union[list[str], MCPToolFilter] - defer_loading: bool - headers: dict[str, str] - project_connection_id: str - require_approval: Union[MCPToolRequireApproval, Literal[always], Literal[never]] - response_scheduling: Union[str, VoiceAgentMcpResponseScheduling] - server_description: str - server_label: str - server_url: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.MCP] - - - class azure.ai.voiceagents.types.VoiceAgentRealtimeResponse(TypedDict, total=False): - key "conversation_id": Optional[str] - key "estimated_cost": ForwardRef('VoiceAgentEstimatedCost', module='types') - key "id": Required[str] - key "max_output_tokens": Optional[VoiceAgentMaxOutputTokens] - key "metadata": Optional[dict[str, str]] - key "modalities": Optional[list[Union[str, VoiceOutputModality]]] - key "object": Required[Literal["response"]] - key "output": Required[list[VoiceAgentResponseItem]] - key "output_audio_format": Optional[Union[str, VoiceAgentResponseAudioFormat]] - key "status": Required[Union[str, VoiceAgentResponseStatus]] - key "status_details": Required[Optional[RealtimeResponseStatusDetails]] - key "temperature": Optional[float] - key "usage": Required[Optional[RealtimeResponseUsage]] - key "voice": Optional[VoiceAgentVoice] - conversation_id: str - estimated_cost: VoiceAgentEstimatedCost - id: str - max_output_tokens: VoiceAgentMaxOutputTokens - metadata: dict[str, str] - modalities: list[Union[str, VoiceOutputModality]] - object: Literal[response] - output: list[VoiceAgentResponseItem] - output_audio_format: Union[str, VoiceAgentResponseAudioFormat] - status: Union[str, VoiceAgentResponseStatus] - status_details: RealtimeResponseStatusDetails - temperature: float - usage: RealtimeResponseUsage - voice: VoiceAgentVoice - - - class azure.ai.voiceagents.types.VoiceAgentResponseCreateAudio(TypedDict, total=False): - key "output": Optional[VoiceAgentSessionUpdateAudioOutput] - output: VoiceAgentSessionUpdateAudioOutput - - - class azure.ai.voiceagents.types.VoiceAgentResponseCreateParams(TypedDict, total=False): - key "audio": ForwardRef('VoiceAgentResponseCreateAudio', module='types') - key "conversation": Union[Literal["auto"], Literal["none"], str] - key "instructions": str - key "interim_response": Optional[VoiceAgentInterimResponse] - key "max_output_tokens": Union[int, Literal["inf"]] - key "metadata": Optional[Metadata] - key "parallel_tool_calls": bool - key "pre_generated_assistant_message": Optional[RealtimeConversationItemMessageAssistant] - key "reasoning": ForwardRef('RealtimeReasoning', module='types') - key "tool_choice": Union[str, ToolChoiceOptions, ToolChoiceFunction, ToolChoiceMCP] - audio: VoiceAgentResponseCreateAudio - conversation: Union[Literal[auto], Literal[none], str] - input: list[RealtimeConversationItem] - instructions: str - interim_response: VoiceAgentInterimResponse - max_output_tokens: Union[int, Literal[inf]] - metadata: Metadata - output_modalities: list[Union[str, VoiceOutputModality]] - parallel_tool_calls: bool - pre_generated_assistant_message: RealtimeConversationItemMessageAssistant - reasoning: RealtimeReasoning - tool_choice: Union[str, ToolChoiceOptions, ToolChoiceFunction, ToolChoiceMCP] - tools: list[Union[RealtimeFunctionTool, MCPTool]] - - - class azure.ai.voiceagents.types.VoiceAgentResponseEventAudioContentPart(TypedDict, total=False): - key "annotations": Any - key "audio": str - key "format": ForwardRef('VoiceAudioFormat', module='types') - key "transcript": Required[Optional[str]] - key "type": Required[Literal["audio"]] - annotations: Any - audio: str - format: VoiceAudioFormat - transcript: str - type: Literal[audio] - - - class azure.ai.voiceagents.types.VoiceAgentResponseEventTextContentPart(TypedDict, total=False): - key "text": Required[str] - key "type": Required[Literal["text"]] - text: str - type: Literal[text] - - - class azure.ai.voiceagents.types.VoiceAgentSemanticVadTurnDetection(TypedDict, total=False): - key "auto_truncate": bool - key "create_response": bool - key "eagerness": Literal["low", "medium", "high", "auto"] - key "interrupt_response": bool - key "type": Required[Literal[VoiceTurnDetectionType.SEMANTIC_VAD]] - auto_truncate: bool - create_response: bool - eagerness: Literal[low, medium, high, auto] - interrupt_response: bool - type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventConversationCreated(TypedDict, total=False): - key "conversation_id": Required[str] - key "type": Required[Literal["created"]] - conversation_id: str - type: Literal[created] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventConversationItemAdded(TypedDict, total=False): - key "event_id": Required[str] - key "item": Required[VoiceAgentResponseItem] - key "previous_item_id": Optional[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED]] - event_id: str - item: VoiceAgentResponseItem - previous_item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventConversationItemCreated(TypedDict, total=False): - key "event_id": Required[str] - key "item": Required[VoiceAgentResponseItem] - key "previous_item_id": Optional[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED]] - event_id: str - item: VoiceAgentResponseItem - previous_item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventConversationItemDeleted(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED]] - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventConversationItemDone(TypedDict, total=False): - key "event_id": Required[str] - key "item": Required[VoiceAgentResponseItem] - key "previous_item_id": Optional[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE]] - event_id: str - item: VoiceAgentResponseItem - previous_item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "logprobs": Optional[list[LogProbProperties]] - key "phrases": Optional[list[VoiceAgentTranscriptionPhrase]] - key "transcript": Required[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED]] - key "usage": Required[Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration]] - content_index: int - event_id: str - item_id: str - logprobs: list[LogProbProperties] - phrases: list[VoiceAgentTranscriptionPhrase] - transcript: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED] - usage: Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta(TypedDict, total=False): - key "content_index": int - key "delta": str - key "event_id": Required[str] - key "item_id": Required[str] - key "logprobs": Optional[list[LogProbProperties]] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA]] - content_index: int - delta: str - event_id: str - item_id: str - logprobs: list[LogProbProperties] - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed(TypedDict, total=False): - key "content_index": Required[int] - key "error": Required[RealtimeServerEventConversationItemInputAudioTranscriptionFailedError] - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED]] - content_index: int - error: RealtimeServerEventConversationItemInputAudioTranscriptionFailedError - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment(TypedDict, total=False): - key "content_index": Required[int] - key "end": Required[float] - key "event_id": Required[str] - key "id": Required[str] - key "item_id": Required[str] - key "speaker": Required[str] - key "start": Required[float] - key "text": Required[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT]] - content_index: int - end: float - event_id: str - id: str - item_id: str - speaker: str - start: float - text: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventConversationItemRetrieved(TypedDict, total=False): - key "event_id": Required[str] - key "item": Required[VoiceAgentResponseItem] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED]] - event_id: str - item: VoiceAgentResponseItem - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventConversationItemTruncated(TypedDict, total=False): - key "audio_end_ms": Required[int] - key "content_index": Required[int] - key "event_id": Required[str] - key "item": ForwardRef('RealtimeConversationItemMessageAssistant', module='types') - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED]] - audio_end_ms: int - content_index: int - event_id: str - item: RealtimeConversationItemMessageAssistant - item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventError(TypedDict, total=False): - key "error": Required[VoiceAgentServerEventErrorDetails] - key "event_id": Required[str] - key "type": Required[Literal["error"]] - error: VoiceAgentServerEventErrorDetails - event_id: str - type: Literal[error] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventErrorDetails(TypedDict, total=False): - key "code": Optional[str] - key "event_id": Optional[str] - key "message": Required[str] - key "param": Optional[str] - key "tool_label": str - key "tool_type": str - key "type": Required[str] - code: str - event_id: str - message: str - param: str - tool_label: str - tool_type: str - type: str - - - class azure.ai.voiceagents.types.VoiceAgentServerEventFileSearchCallCompleted(TypedDict, total=False): - key "event_id": str - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": str - key "sequence_number": Required[int] - key "type": Required[Literal["completed"]] - event_id: str - item_id: str - output_index: int - response_id: str - sequence_number: int - type: Literal[completed] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventFileSearchCallInProgress(TypedDict, total=False): - key "event_id": str - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": str - key "sequence_number": Required[int] - key "type": Required[Literal["in_progress"]] - event_id: str - item_id: str - output_index: int - response_id: str - sequence_number: int - type: Literal[in_progress] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventFileSearchCallSearching(TypedDict, total=False): - key "event_id": str - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": str - key "sequence_number": Required[int] - key "type": Required[Literal["searching"]] - event_id: str - item_id: str - output_index: int - response_id: str - sequence_number: int - type: Literal[searching] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventInputAudioBufferCleared(TypedDict, total=False): - key "event_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED]] - event_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventInputAudioBufferCommitted(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "previous_item_id": Optional[str] - key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED]] - event_id: str - item_id: str - previous_item_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventInputAudioBufferSpeechStarted(TypedDict, total=False): - key "audio_start_ms": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED]] - audio_start_ms: int - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventInputAudioBufferSpeechStopped(TypedDict, total=False): - key "audio_end_ms": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED]] - audio_end_ms: int - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventInputAudioBufferTimeoutTriggered(TypedDict, total=False): - key "audio_end_ms": Required[int] - key "audio_start_ms": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED]] - audio_end_ms: int - audio_start_ms: int - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventMcpListToolsCompleted(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED]] - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventMcpListToolsFailed(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED]] - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventMcpListToolsInProgress(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS]] - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventOutputAudioBufferCleared(TypedDict, total=False): - key "event_id": Required[str] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED]] - event_id: str - response_id: str - type: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventRateLimitsUpdated(TypedDict, total=False): - key "event_id": Required[str] - key "rate_limits": Required[list[RealtimeServerEventRateLimitsUpdatedRateLimits]] - key "type": Required[Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED]] - event_id: str - rate_limits: list[RealtimeServerEventRateLimitsUpdatedRateLimits] - type: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventResponseAnimationBlendshapesDelta(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "frame_index": Required[int] - key "frames": Required[Union[list[list[float]], str]] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal["delta"]] - content_index: int - event_id: str - frame_index: int - frames: Union[list[list[float]], str] - item_id: str - output_index: int - response_id: str - type: Literal[delta] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventResponseAnimationBlendshapesDone(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal["done"]] - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[done] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventResponseAnimationVisemeDelta(TypedDict, total=False): - key "audio_offset_ms": Required[int] - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal["delta"]] - key "viseme_id": Required[int] - audio_offset_ms: int - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[delta] - viseme_id: int - - - class azure.ai.voiceagents.types.VoiceAgentServerEventResponseAnimationVisemeDone(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal["done"]] - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[done] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventResponseAudioDelta(TypedDict, total=False): - key "content_index": Required[int] - key "delta": Required[str] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA]] - content_index: int - delta: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventResponseAudioDone(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE]] - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventResponseAudioTimestampDelta(TypedDict, total=False): - key "audio_duration_ms": Required[int] - key "audio_offset_ms": Required[int] - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "text": Required[str] - key "timestamp_type": Required[Literal["word"]] - key "type": Required[Literal["delta"]] - audio_duration_ms: int - audio_offset_ms: int - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - text: str - timestamp_type: Literal[word] - type: Literal[delta] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventResponseAudioTimestampDone(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal["done"]] - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[done] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventResponseAudioTranscriptDelta(TypedDict, total=False): - key "content_index": Required[int] - key "delta": Required[str] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA]] - content_index: int - delta: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventResponseAudioTranscriptDone(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "transcript": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE]] - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - transcript: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventResponseContentPartDone(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "part": Required[VoiceAgentResponseEventContentPart] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE]] - content_index: int - event_id: str - item_id: str - output_index: int - part: VoiceAgentResponseEventContentPart - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventResponseCreated(TypedDict, total=False): - key "event_id": Required[str] - key "response": Required[VoiceAgentRealtimeResponse] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CREATED]] - event_id: str - response: VoiceAgentRealtimeResponse - type: Literal[RealtimeServerEventType.RESPONSE_CREATED] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventResponseDone(TypedDict, total=False): - key "event_id": Required[str] - key "response": Required[VoiceAgentRealtimeResponse] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_DONE]] - event_id: str - response: VoiceAgentRealtimeResponse - type: Literal[RealtimeServerEventType.RESPONSE_DONE] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventResponseFunctionCallArgumentsDelta(TypedDict, total=False): - key "call_id": Required[str] - key "delta": Required[str] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA]] - call_id: str - delta: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventResponseFunctionCallArgumentsDone(TypedDict, total=False): - key "arguments": Required[str] - key "call_id": Required[str] - key "event_id": Required[str] - key "item_id": Required[str] - key "name": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE]] - arguments: str - call_id: str - event_id: str - item_id: str - name: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventResponseMcpCallArgumentsDelta(TypedDict, total=False): - key "delta": Required[str] - key "event_id": Required[str] - key "item_id": Required[str] - key "obfuscation": Optional[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA]] - delta: str - event_id: str - item_id: str - obfuscation: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventResponseMcpCallArgumentsDone(TypedDict, total=False): - key "arguments": Required[str] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE]] - arguments: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventResponseMcpCallCompleted(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED]] - event_id: str - item_id: str - output_index: int - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventResponseMcpCallFailed(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED]] - event_id: str - item_id: str - output_index: int - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventResponseMcpCallInProgress(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS]] - event_id: str - item_id: str - output_index: int - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventResponseOutputItemAdded(TypedDict, total=False): - key "event_id": Required[str] - key "item": Required[VoiceAgentResponseItem] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED]] - event_id: str - item: VoiceAgentResponseItem - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventResponseOutputItemDone(TypedDict, total=False): - key "event_id": Required[str] - key "item": Required[VoiceAgentResponseItem] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE]] - event_id: str - item: VoiceAgentResponseItem - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventResponseTextDelta(TypedDict, total=False): - key "content_index": Required[int] - key "delta": Required[str] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA]] - content_index: int - delta: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventResponseTextDone(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "text": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE]] - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - text: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventResponseVideoDelta(TypedDict, total=False): - key "codec": Required[str] - key "delta": Required[str] - key "event_id": Required[str] - key "output_index": Required[int] - key "type": Required[Literal["delta"]] - codec: str - delta: str - event_id: str - output_index: int - type: Literal[delta] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventSessionAvatarConnecting(TypedDict, total=False): - key "event_id": Required[str] - key "server_sdp": Required[str] - key "type": Required[Literal["connecting"]] - event_id: str - server_sdp: str - type: Literal[connecting] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventSessionAvatarSwitchToIdle(TypedDict, total=False): - key "event_id": Required[str] - key "turn_id": str - key "type": Required[Literal["switch_to_idle"]] - event_id: str - turn_id: str - type: Literal[switch_to_idle] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventSessionAvatarSwitchToSpeaking(TypedDict, total=False): - key "event_id": Required[str] - key "turn_id": str - key "type": Required[Literal["switch_to_speaking"]] - event_id: str - turn_id: str - type: Literal[switch_to_speaking] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventSessionCreated(TypedDict, total=False): - key "event_id": Required[str] - key "session": Required[VoiceAgentSessionResponseConfig] - key "type": Required[Literal[RealtimeServerEventType.SESSION_CREATED]] - event_id: str - session: VoiceAgentSessionResponseConfig - type: Literal[RealtimeServerEventType.SESSION_CREATED] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventSessionHandoffAborted(TypedDict, total=False): - key "edge_id": Required[str] - key "error": ForwardRef('VoiceAgentServerEventErrorDetails', module='types') - key "event_id": Required[str] - key "from_model": Required[str] - key "from_node_id": Required[str] - key "handoff_id": Required[str] - key "node_generation": Required[int] - key "reason": Required[Union[str, VoiceAgentHandoffAbortReason]] - key "to_model": Required[str] - key "to_node_id": Required[str] - key "tool_call_id": Required[str] - key "type": Required[Literal["aborted"]] - edge_id: str - error: VoiceAgentServerEventErrorDetails - event_id: str - from_model: str - from_node_id: str - handoff_id: str - node_generation: int - reason: Union[str, VoiceAgentHandoffAbortReason] - to_model: str - to_node_id: str - tool_call_id: str - type: Literal[aborted] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventSessionHandoffCompleted(TypedDict, total=False): - key "duration_ms": Required[int] - key "edge_id": Required[str] - key "event_id": Required[str] - key "from_model": Required[str] - key "from_node_id": Required[str] - key "handoff_id": Required[str] - key "node_generation": Required[int] - key "prepare_duration_ms": Required[int] - key "to_model": Required[str] - key "to_node_id": Required[str] - key "tool_call_id": Required[str] - key "type": Required[Literal["completed"]] - duration_ms: int - edge_id: str - event_id: str - from_model: str - from_node_id: str - handoff_id: str - node_generation: int - prepare_duration_ms: int - to_model: str - to_node_id: str - tool_call_id: str - type: Literal[completed] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventSessionHandoffStarted(TypedDict, total=False): - key "edge_id": Required[str] - key "event_id": Required[str] - key "from_model": Required[str] - key "from_node_id": Required[str] - key "handoff_id": Required[str] - key "node_generation": Required[int] - key "to_model": Required[str] - key "to_node_id": Required[str] - key "tool_call_id": Required[str] - key "type": Required[Literal["started"]] - edge_id: str - event_id: str - from_model: str - from_node_id: str - handoff_id: str - node_generation: int - to_model: str - to_node_id: str - tool_call_id: str - type: Literal[started] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventSessionUpdated(TypedDict, total=False): - key "event_id": Required[str] - key "session": Required[VoiceAgentSessionResponseConfig] - key "type": Required[Literal[RealtimeServerEventType.SESSION_UPDATED]] - event_id: str - session: VoiceAgentSessionResponseConfig - type: Literal[RealtimeServerEventType.SESSION_UPDATED] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventWarning(TypedDict, total=False): - key "event_id": Required[str] - key "type": Required[Literal["warning"]] - key "warning": Required[VoiceAgentServerEventWarningDetails] - event_id: str - type: Literal[warning] - warning: VoiceAgentServerEventWarningDetails - - - class azure.ai.voiceagents.types.VoiceAgentServerEventWarningDetails(TypedDict, total=False): - key "code": str - key "message": Required[str] - key "param": str - code: str - message: str - param: str - - - class azure.ai.voiceagents.types.VoiceAgentServerEventWebSearchCallCompleted(TypedDict, total=False): - key "event_id": str - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": str - key "sequence_number": Required[int] - key "type": Required[Literal["completed"]] - event_id: str - item_id: str - output_index: int - response_id: str - sequence_number: int - type: Literal[completed] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventWebSearchCallInProgress(TypedDict, total=False): - key "event_id": str - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": str - key "sequence_number": Required[int] - key "type": Required[Literal["in_progress"]] - event_id: str - item_id: str - output_index: int - response_id: str - sequence_number: int - type: Literal[in_progress] - - - class azure.ai.voiceagents.types.VoiceAgentServerEventWebSearchCallSearching(TypedDict, total=False): - key "event_id": str - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": str - key "sequence_number": Required[int] - key "type": Required[Literal["searching"]] - event_id: str - item_id: str - output_index: int - response_id: str - sequence_number: int - type: Literal[searching] - - - class azure.ai.voiceagents.types.VoiceAgentServerVadTurnDetection(TypedDict, total=False): - key "auto_truncate": bool - key "create_response": bool - key "end_of_utterance_detection": Optional[VoiceAgentEndOfUtteranceDetection] - key "idle_timeout_ms": Optional[int] - key "interrupt_response": bool - key "prefix_padding_ms": Optional[int] - key "silence_duration_ms": Optional[int] - key "speech_duration_ms": Optional[int] - key "threshold": Optional[float] - key "type": Required[Literal[VoiceTurnDetectionType.SERVER_VAD]] - auto_truncate: bool - create_response: bool - end_of_utterance_detection: VoiceAgentEndOfUtteranceDetection - idle_timeout_ms: int - interrupt_response: bool - prefix_padding_ms: int - silence_duration_ms: int - speech_duration_ms: int - threshold: float - type: Literal[VoiceTurnDetectionType.SERVER_VAD] - - - class azure.ai.voiceagents.types.VoiceAgentSessionAvatarConfig(TypedDict, total=False): - key "character": Required[str] - key "customized": bool - key "ice_servers": Optional[list[VoiceAgentAvatarIceServer]] - key "model": Optional[str] - key "output_audit_audio": bool - key "output_protocol": Union[str, VoiceAgentAvatarOutputProtocol] - key "scene": Optional[VoiceAgentAvatarScene] - key "style": Optional[str] - key "type": Union[str, VoiceAgentAvatarType] - key "video": Optional[VoiceAgentAvatarVideoParams] - character: str - customized: bool - ice_servers: list[VoiceAgentAvatarIceServer] - model: str - output_audit_audio: bool - output_protocol: Union[str, VoiceAgentAvatarOutputProtocol] - scene: VoiceAgentAvatarScene - style: str - type: Union[str, VoiceAgentAvatarType] - video: VoiceAgentAvatarVideoParams - - - class azure.ai.voiceagents.types.VoiceAgentSessionMcpTool(TypedDict, total=False): - key "authorization": Optional[Union[str, VoiceAgentMcpAssignedManagedIdentity]] - key "require_approval": ForwardRef('VoiceAgentMcpApprovalPolicy', module='types') - key "response_scheduling": Union[str, VoiceAgentMcpResponseScheduling] - key "server_label": Required[str] - key "server_url": Required[str] - key "type": Required[Literal["mcp"]] - allowed_tools: list[str] - authorization: Union[str, VoiceAgentMcpAssignedManagedIdentity] - headers: dict[str, str] - require_approval: VoiceAgentMcpApprovalPolicy - response_scheduling: Union[str, VoiceAgentMcpResponseScheduling] - server_label: str - server_url: str - type: Literal[mcp] - - - class azure.ai.voiceagents.types.VoiceAgentSessionResponseAudio(TypedDict, total=False): - key "input": Optional[VoiceAgentSessionResponseAudioInput] - key "output": Optional[VoiceAgentSessionResponseAudioOutput] - input: VoiceAgentSessionResponseAudioInput - output: VoiceAgentSessionResponseAudioOutput - - - class azure.ai.voiceagents.types.VoiceAgentSessionResponseAudioInput(TypedDict, total=False): - key "echo_cancellation": Optional[VoiceAgentEchoCancellation] - key "format": Optional[VoiceAudioFormat] - key "noise_reduction": Optional[VoiceNoiseReduction] - key "transcription": Optional[VoiceInputTranscription] - key "turn_detection": Optional[VoiceAgentTurnDetection] - echo_cancellation: VoiceAgentEchoCancellation - format: VoiceAudioFormat - noise_reduction: VoiceNoiseReduction - transcription: VoiceInputTranscription - turn_detection: VoiceAgentTurnDetection - - - class azure.ai.voiceagents.types.VoiceAgentSessionResponseAudioOutput(TypedDict, total=False): - key "format": ForwardRef('VoiceAudioFormat', module='types') - key "speed": Optional[float] - key "voice": ForwardRef('VoiceAgentVoice', module='types') - format: VoiceAudioFormat - output_audio_timestamp_types: list[Union[str, VoiceAudioTimestampType]] - speed: float - voice: VoiceAgentVoice - - - class azure.ai.voiceagents.types.VoiceAgentSessionResponseConfig(TypedDict, total=False): - key "animation": Optional[VoiceAgentAnimationConfig] - key "audio": Optional[VoiceAgentSessionResponseAudio] - key "avatar": Optional[VoiceAgentSessionAvatarConfig] - key "expires_at": Optional[int] - key "greeting": Optional[VoiceGreetingConfig] - key "handoff": Optional[VoiceAgentHandoffState] - key "id": Required[str] - key "idle_timeout": Optional[int] - key "instructions": Optional[str] - key "interim_response": Optional[VoiceAgentInterimResponse] - key "max_output_tokens": Optional[VoiceAgentMaxOutputTokens] - key "model": Required[str] - key "object": Required[Literal["session"]] - key "output_modalities": Required[list[Union[str, VoiceOutputModality]]] - key "parallel_tool_calls": bool - key "reasoning": Optional[RealtimeReasoning] - key "response_delimiter": str - key "temperature": Optional[float] - key "tool_choice": Optional[VoiceAgentToolChoice] - key "tools": Optional[list[VoiceAgentSessionTool]] - key "type": Required[Literal["realtime"]] - key "voice_adaptation": Optional[VoiceAgentVoiceAdaptation] - animation: VoiceAgentAnimationConfig - audio: VoiceAgentSessionResponseAudio - avatar: VoiceAgentSessionAvatarConfig - expires_at: int - greeting: VoiceGreetingConfig - handoff: VoiceAgentHandoffState - id: str - idle_timeout: int - instructions: str - interim_response: VoiceAgentInterimResponse - max_output_tokens: VoiceAgentMaxOutputTokens - model: str - object: Literal[session] - output_modalities: list[Union[str, VoiceOutputModality]] - parallel_tool_calls: bool - reasoning: RealtimeReasoning - response_delimiter: str - temperature: float - tool_choice: VoiceAgentToolChoice - tools: list[VoiceAgentSessionTool] - type: Literal[realtime] - voice_adaptation: VoiceAgentVoiceAdaptation - - - class azure.ai.voiceagents.types.VoiceAgentSessionUpdateAudio(TypedDict, total=False): - key "input": Optional[VoiceAgentSessionUpdateAudioInput] - key "output": Optional[VoiceAgentSessionUpdateAudioOutput] - input: VoiceAgentSessionUpdateAudioInput - output: VoiceAgentSessionUpdateAudioOutput - - - class azure.ai.voiceagents.types.VoiceAgentSessionUpdateAudioInput(TypedDict, total=False): - key "echo_cancellation": Optional[VoiceAgentEchoCancellation] - key "format": Optional[VoiceAudioFormat] - key "noise_reduction": Optional[VoiceNoiseReduction] - key "transcription": Optional[VoiceInputTranscription] - key "turn_detection": Optional[VoiceAgentTurnDetection] - echo_cancellation: VoiceAgentEchoCancellation - format: VoiceAudioFormat - noise_reduction: VoiceNoiseReduction - transcription: VoiceInputTranscription - turn_detection: VoiceAgentTurnDetection - - - class azure.ai.voiceagents.types.VoiceAgentSessionUpdateAudioOutput(TypedDict, total=False): - key "format": ForwardRef('VoiceAudioFormat', module='types') - key "speed": Optional[float] - key "voice": ForwardRef('VoiceAgentVoice', module='types') - format: VoiceAudioFormat - output_audio_timestamp_types: list[Union[str, VoiceAudioTimestampType]] - speed: float - voice: VoiceAgentVoice - - - class azure.ai.voiceagents.types.VoiceAgentSessionUpdateConfig(TypedDict, total=False): - key "animation": Optional[VoiceAgentAnimationConfig] - key "audio": Optional[VoiceAgentSessionUpdateAudio] - key "avatar": Optional[VoiceAgentSessionAvatarConfig] - key "greeting": Optional[VoiceGreetingConfig] - key "handoff": Optional[VoiceAgentHandoffGraphConfig] - key "include": Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] - key "instructions": Optional[str] - key "interim_response": Optional[VoiceAgentInterimResponse] - key "max_output_tokens": Optional[VoiceAgentMaxOutputTokens] - key "metadata": Optional[dict[str, str]] - key "output_modalities": Optional[list[Union[str, VoiceOutputModality]]] - key "parallel_tool_calls": bool - key "reasoning": Optional[RealtimeReasoning] - key "response_delimiter": str - key "temperature": Optional[float] - key "tool_choice": Optional[VoiceAgentToolChoice] - key "tools": Optional[list[VoiceAgentSessionTool]] - key "type": Required[Literal["realtime"]] - key "voice_adaptation": Optional[VoiceAgentVoiceAdaptation] - animation: VoiceAgentAnimationConfig - audio: VoiceAgentSessionUpdateAudio - avatar: VoiceAgentSessionAvatarConfig - greeting: VoiceGreetingConfig - handoff: VoiceAgentHandoffGraphConfig - include: list[Union[str, VoiceAgentSessionIncludeOption]] - instructions: str - interim_response: VoiceAgentInterimResponse - max_output_tokens: VoiceAgentMaxOutputTokens - metadata: dict[str, str] - output_modalities: list[Union[str, VoiceOutputModality]] - parallel_tool_calls: bool - reasoning: RealtimeReasoning - response_delimiter: str - temperature: float - tool_choice: VoiceAgentToolChoice - tools: list[VoiceAgentSessionTool] - type: Literal[realtime] - voice_adaptation: VoiceAgentVoiceAdaptation - - - class azure.ai.voiceagents.types.VoiceAgentStaticInterimResponseConfig(TypedDict, total=False): - key "latency_threshold_ms": int - key "type": Required[Literal["static_interim_response"]] - latency_threshold_ms: int - texts: list[str] - triggers: list[Union[str, VoiceAgentInterimResponseTrigger]] - type: Literal[static_interim_response] - - - class azure.ai.voiceagents.types.VoiceAgentTranscriptionPhrase(TypedDict, total=False): - key "confidence": Optional[float] - key "duration_milliseconds": Required[int] - key "locale": Optional[str] - key "offset_milliseconds": Required[int] - key "text": Required[str] - key "words": Optional[list[VoiceAgentTranscriptionWord]] - confidence: float - duration_milliseconds: int - locale: str - offset_milliseconds: int - text: str - words: list[VoiceAgentTranscriptionWord] - - - class azure.ai.voiceagents.types.VoiceAgentTranscriptionWord(TypedDict, total=False): - key "duration_milliseconds": Required[int] - key "offset_milliseconds": Required[int] - key "text": Required[str] - duration_milliseconds: int - offset_milliseconds: int - text: str - - - class azure.ai.voiceagents.types.VoiceAgentVoiceAdaptation(TypedDict, total=False): - key "type": Required[Literal["auto"]] - type: Literal[auto] - - - class azure.ai.voiceagents.types.VoiceAgentWebSearchActionFind(TypedDict, total=False): - key "pattern": Required[str] - key "type": Required[Literal["find"]] - key "url": Required[str] - pattern: str - type: Literal[find] - url: str - - - class azure.ai.voiceagents.types.VoiceAgentWebSearchActionOpenPage(TypedDict, total=False): - key "type": Required[Literal["open_page"]] - key "url": Required[str] - type: Literal[open_page] - url: str - - - class azure.ai.voiceagents.types.VoiceAgentWebSearchActionSearch(TypedDict, total=False): - key "query": Required[Optional[str]] - key "sources": Optional[list[VoiceAgentWebSearchSource]] - key "type": Required[Literal["search"]] - query: str - sources: list[VoiceAgentWebSearchSource] - type: Literal[search] - - - class azure.ai.voiceagents.types.VoiceAgentWebSearchCallItem(TypedDict, total=False): - key "action": Optional[VoiceAgentWebSearchAction] - key "id": Required[str] - key "status": Required[Union[str, VoiceAgentWebSearchCallStatus]] - key "type": Required[Literal["web_search_call"]] - action: VoiceAgentWebSearchAction - id: str - status: Union[str, VoiceAgentWebSearchCallStatus] - type: Literal[web_search_call] - - - class azure.ai.voiceagents.types.VoiceAgentWebSearchSource(TypedDict, total=False): - key "type": Required[Literal["url"]] - key "url": Required[str] - type: Literal[url] - url: str - - - class azure.ai.voiceagents.types.VoiceAgentWorkflowActionItem(TypedDict, total=False): - key "action_id": Required[str] - key "id": Required[Optional[str]] - key "kind": Optional[str] - key "object": Literal["item"] - key "parent_action_id": Optional[str] - key "previous_action_id": Optional[str] - key "status": Required[str] - key "type": Required[Literal["workflow_action"]] - action_id: str - id: str - kind: str - object: Literal[item] - parent_action_id: str - previous_action_id: str - status: str - type: Literal[workflow_action] - - - class azure.ai.voiceagents.types.VoiceAssistantMessageItem(TypedDict, total=False): - key "content": Required[list[RealtimeConversationItemMessageAssistantContent]] - key "created_at": int - key "id": str - key "object": Literal["item"] - key "response_id": str - key "role": Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] - key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal[VoiceConversationItemType.MESSAGE]] - content: list[RealtimeConversationItemMessageAssistantContent] - created_at: int - id: str - object: Literal[item] - response_id: str - role: Literal[RealtimeConversationItemMessageType.ASSISTANT] - status: Literal[completed, incomplete, in_progress] - type: Literal[VoiceConversationItemType.MESSAGE] - - - class azure.ai.voiceagents.types.VoiceAudioConfig(TypedDict, total=False): - key "input": ForwardRef('VoiceAudioInputConfig', module='types') - key "output": ForwardRef('VoiceAudioOutputConfig', module='types') - input: VoiceAudioInputConfig - output: VoiceAudioOutputConfig - - - class azure.ai.voiceagents.types.VoiceAudioFormat(TypedDict, total=False): - key "rate": int - key "type": Required[Union[str, VoiceAudioFormatType]] - rate: int - type: Union[str, VoiceAudioFormatType] - - - class azure.ai.voiceagents.types.VoiceAudioInputConfig(TypedDict, total=False): - key "format": ForwardRef('VoiceAudioFormat', module='types') - key "noise_reduction": Optional[VoiceNoiseReduction] - key "transcription": Optional[VoiceInputTranscription] - key "turn_detection": Optional[VoiceTurnDetection] - format: VoiceAudioFormat - noise_reduction: VoiceNoiseReduction - transcription: VoiceInputTranscription - turn_detection: VoiceTurnDetection - - - class azure.ai.voiceagents.types.VoiceAudioOutputConfig(TypedDict, total=False): - key "format": ForwardRef('VoiceAudioFormat', module='types') - key "speed": float - key "voice": ForwardRef('VoiceAgentVoice', module='types') - format: VoiceAudioFormat - output_audio_timestamp_types: list[Union[str, VoiceAudioTimestampType]] - speed: float - voice: VoiceAgentVoice - - - class azure.ai.voiceagents.types.VoiceAvatarConfig(TypedDict, total=False): - key "character": Required[str] - key "customized": bool - key "output_protocol": Union[str, VoiceAvatarOutputProtocol] - key "style": str - key "type": Required[Union[str, VoiceAvatarType]] - character: str - customized: bool - output_protocol: Union[str, VoiceAvatarOutputProtocol] - style: str - type: Union[str, VoiceAvatarType] - - - class azure.ai.voiceagents.types.VoiceAzureSemanticDetection(TypedDict, total=False): - key "model": Required[Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1]] - key "threshold_level": Union[str, VoiceEndOfUtteranceThresholdLevel] - key "timeout_ms": int - model: Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1] - threshold_level: Union[str, VoiceEndOfUtteranceThresholdLevel] - timeout_ms: int - - - class azure.ai.voiceagents.types.VoiceAzureSemanticDetectionEn(TypedDict, total=False): - key "model": Required[Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1_EN]] - key "threshold_level": Union[str, VoiceEndOfUtteranceThresholdLevel] - key "timeout_ms": int - model: Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1_EN] - threshold_level: Union[str, VoiceEndOfUtteranceThresholdLevel] - timeout_ms: int - - - class azure.ai.voiceagents.types.VoiceAzureSemanticDetectionMultilingual(TypedDict, total=False): - key "model": Required[Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1_MULTILINGUAL]] - key "threshold_level": Union[str, VoiceEndOfUtteranceThresholdLevel] - key "timeout_ms": int - model: Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1_MULTILINGUAL] - threshold_level: Union[str, VoiceEndOfUtteranceThresholdLevel] - timeout_ms: int - - - class azure.ai.voiceagents.types.VoiceAzureSemanticVadEnTurnDetection(TypedDict, total=False): - key "auto_truncate": bool - key "create_response": bool - key "end_of_utterance_detection": ForwardRef('VoiceEndOfUtteranceDetection', module='types') - key "interrupt_response": bool - key "prefix_padding_ms": int - key "remove_filler_words": bool - key "silence_duration_ms": int - key "speech_duration_ms": int - key "threshold": float - key "type": Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN]] - auto_truncate: bool - create_response: bool - end_of_utterance_detection: VoiceEndOfUtteranceDetection - interrupt_response: bool - prefix_padding_ms: int - remove_filler_words: bool - silence_duration_ms: int - speech_duration_ms: int - threshold: float - type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN] - - - class azure.ai.voiceagents.types.VoiceAzureSemanticVadMultilingualTurnDetection(TypedDict, total=False): - key "auto_truncate": bool - key "create_response": bool - key "end_of_utterance_detection": ForwardRef('VoiceEndOfUtteranceDetection', module='types') - key "interrupt_response": bool - key "prefix_padding_ms": int - key "remove_filler_words": bool - key "silence_duration_ms": int - key "speech_duration_ms": int - key "threshold": float - key "type": Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL]] - auto_truncate: bool - create_response: bool - end_of_utterance_detection: VoiceEndOfUtteranceDetection - interrupt_response: bool - languages: list[str] - prefix_padding_ms: int - remove_filler_words: bool - silence_duration_ms: int - speech_duration_ms: int - threshold: float - type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] - - - class azure.ai.voiceagents.types.VoiceAzureSemanticVadTurnDetection(TypedDict, total=False): - key "auto_truncate": bool - key "create_response": bool - key "end_of_utterance_detection": ForwardRef('VoiceEndOfUtteranceDetection', module='types') - key "interrupt_response": bool - key "prefix_padding_ms": int - key "remove_filler_words": bool - key "silence_duration_ms": int - key "speech_duration_ms": int - key "threshold": float - key "type": Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD]] - auto_truncate: bool - create_response: bool - end_of_utterance_detection: VoiceEndOfUtteranceDetection - interrupt_response: bool - languages: list[str] - prefix_padding_ms: int - remove_filler_words: bool - silence_duration_ms: int - speech_duration_ms: int - threshold: float - type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD] - - - class azure.ai.voiceagents.types.VoiceConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FUNCTION_CALL = "function_call" - FUNCTION_CALL_OUTPUT = "function_call_output" - MCP_APPROVAL_REQUEST = "mcp_approval_request" - MCP_APPROVAL_RESPONSE = "mcp_approval_response" - MCP_CALL = "mcp_call" - MCP_LIST_TOOLS = "mcp_list_tools" - MESSAGE = "message" - - - class azure.ai.voiceagents.types.VoiceEndOfUtteranceDetectionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - SEMANTIC_DETECTION_V1 = "semantic_detection_v1" - SEMANTIC_DETECTION_V1_EN = "semantic_detection_v1_en" - SEMANTIC_DETECTION_V1_MULTILINGUAL = "semantic_detection_v1_multilingual" - - - class azure.ai.voiceagents.types.VoiceFunctionCallItem(TypedDict, total=False): - key "arguments": Required[str] - key "call_id": str - key "created_at": int - key "id": str - key "name": Required[str] - key "object": Literal["item"] - key "response_id": str - key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal[VoiceConversationItemType.FUNCTION_CALL]] - arguments: str - call_id: str - created_at: int - id: str - name: str - object: Literal[item] - response_id: str - status: Literal[completed, incomplete, in_progress] - type: Literal[VoiceConversationItemType.FUNCTION_CALL] - - - class azure.ai.voiceagents.types.VoiceFunctionCallOutputItem(TypedDict, total=False): - key "call_id": Required[str] - key "created_at": int - key "id": str - key "name": str - key "object": Literal["item"] - key "output": Required[str] - key "response_id": str - key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT]] - call_id: str - created_at: int - id: str - name: str - object: Literal[item] - output: str - response_id: str - status: Literal[completed, incomplete, in_progress] - type: Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT] - - - class azure.ai.voiceagents.types.VoiceInputTranscription(TypedDict, total=False): - key "delay": Literal["minimal", "low", "medium", "high", "xhigh"] - key "language": str - key "model": Required[Union[str, VoiceInputTranscriptionModel]] - key "prompt": str - custom_speech: dict[str, str] - delay: Literal[minimal, low, medium, high, xhigh] - language: str - model: Union[str, VoiceInputTranscriptionModel] - phrase_list: list[str] - prompt: str - - - class azure.ai.voiceagents.types.VoiceMcpApprovalRequestItem(TypedDict, total=False): - key "arguments": Required[str] - key "created_at": int - key "id": Required[str] - key "name": Required[str] - key "response_id": str - key "server_label": Required[str] - key "type": Required[Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST]] - arguments: str - created_at: int - id: str - name: str - response_id: str - server_label: str - type: Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST] - - - class azure.ai.voiceagents.types.VoiceMcpApprovalResponseItem(TypedDict, total=False): - key "approval_request_id": Required[str] - key "approve": Required[bool] - key "created_at": int - key "id": Required[str] - key "reason": Optional[str] - key "response_id": str - key "type": Required[Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE]] - approval_request_id: str - approve: bool - created_at: int - id: str - reason: str - response_id: str - type: Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE] - - - class azure.ai.voiceagents.types.VoiceMcpCallItem(TypedDict, total=False): - key "approval_request_id": Optional[str] - key "arguments": Required[str] - key "created_at": int - key "error": ForwardRef('RealtimeMCPError', module='types') - key "id": Required[str] - key "name": Required[str] - key "output": Optional[str] - key "response_id": str - key "server_label": Required[str] - key "type": Required[Literal[VoiceConversationItemType.MCP_CALL]] - approval_request_id: str - arguments: str - created_at: int - error: RealtimeMCPError - id: str - name: str - output: str - response_id: str - server_label: str - type: Literal[VoiceConversationItemType.MCP_CALL] - - - class azure.ai.voiceagents.types.VoiceMcpListToolsItem(TypedDict, total=False): - key "created_at": int - key "id": str - key "response_id": str - key "server_label": Required[str] - key "tools": Required[list[MCPListToolsTool]] - key "type": Required[Literal[VoiceConversationItemType.MCP_LIST_TOOLS]] - created_at: int - id: str - response_id: str - server_label: str - tools: list[MCPListToolsTool] - type: Literal[VoiceConversationItemType.MCP_LIST_TOOLS] - - - class azure.ai.voiceagents.types.VoiceNoiseReduction(TypedDict, total=False): - key "type": Required[Union[str, VoiceNoiseReductionType]] - type: Union[str, VoiceNoiseReductionType] - - - class azure.ai.voiceagents.types.VoiceSemanticVadTurnDetection(TypedDict, total=False): - key "create_response": bool - key "eagerness": Literal["low", "medium", "high", "auto"] - key "interrupt_response": bool - key "type": Required[Literal[VoiceTurnDetectionType.SEMANTIC_VAD]] - create_response: bool - eagerness: Literal[low, medium, high, auto] - interrupt_response: bool - type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD] - - - class azure.ai.voiceagents.types.VoiceServerVadTurnDetection(TypedDict, total=False): - key "create_response": bool - key "idle_timeout_ms": Optional[int] - key "interrupt_response": bool - key "prefix_padding_ms": int - key "silence_duration_ms": int - key "threshold": float - key "type": Required[Literal[VoiceTurnDetectionType.SERVER_VAD]] - create_response: bool - idle_timeout_ms: int - interrupt_response: bool - prefix_padding_ms: int - silence_duration_ms: int - threshold: float - type: Literal[VoiceTurnDetectionType.SERVER_VAD] - - - class azure.ai.voiceagents.types.VoiceSystemMessageItem(TypedDict, total=False): - key "content": Required[list[RealtimeConversationItemMessageSystemContent]] - key "created_at": int - key "id": str - key "object": Literal["item"] - key "response_id": str - key "role": Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] - key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal[VoiceConversationItemType.MESSAGE]] - content: list[RealtimeConversationItemMessageSystemContent] - created_at: int - id: str - object: Literal[item] - response_id: str - role: Literal[RealtimeConversationItemMessageType.SYSTEM] - status: Literal[completed, incomplete, in_progress] - type: Literal[VoiceConversationItemType.MESSAGE] - - - class azure.ai.voiceagents.types.VoiceSystemTool(TypedDict, total=False): - key "description": str - key "name": Required[Union[str, VoiceSystemToolName]] - key "type": Required[Literal["system"]] - description: str - name: Union[str, VoiceSystemToolName] - type: Literal[system] - - - class azure.ai.voiceagents.types.VoiceToolboxTool(TypedDict, total=False): - key "toolbox_name": Required[str] - key "toolbox_version": Required[str] - key "type": Required[Literal["toolbox"]] - toolbox_name: str - toolbox_version: str - type: Literal[toolbox] - - - class azure.ai.voiceagents.types.VoiceTurnDetectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AZURE_SEMANTIC_VAD = "azure_semantic_vad" - AZURE_SEMANTIC_VAD_EN = "azure_semantic_vad_en" - AZURE_SEMANTIC_VAD_MULTILINGUAL = "azure_semantic_vad_multilingual" - SEMANTIC_VAD = "semantic_vad" - SERVER_VAD = "server_vad" - - - class azure.ai.voiceagents.types.VoiceUserMessageItem(TypedDict, total=False): - key "content": Required[list[RealtimeConversationItemMessageUserContent]] - key "created_at": int - key "id": str - key "object": Literal["item"] - key "response_id": str - key "role": Required[Literal[RealtimeConversationItemMessageType.USER]] - key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal[VoiceConversationItemType.MESSAGE]] - content: list[RealtimeConversationItemMessageUserContent] - created_at: int - id: str - object: Literal[item] - response_id: str - role: Literal[RealtimeConversationItemMessageType.USER] - status: Literal[completed, incomplete, in_progress] - type: Literal[VoiceConversationItemType.MESSAGE] - - -``` \ No newline at end of file diff --git a/sdk/voiceagents/azure-ai-voiceagents/api.metadata.yml b/sdk/voiceagents/azure-ai-voiceagents/api.metadata.yml deleted file mode 100644 index c38648a54a71..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/api.metadata.yml +++ /dev/null @@ -1,3 +0,0 @@ -apiMdSha256: 16ab5e41e31ae5d8fdbd7dbbf7d39740a9ffd3650a21e0731a622ea1282f79f6 -parserVersion: 0.3.31 -pythonVersion: 3.13.2 diff --git a/sdk/voiceagents/azure-ai-voiceagents/apiview-properties.json b/sdk/voiceagents/azure-ai-voiceagents/apiview-properties.json deleted file mode 100644 index 8d7e108d309c..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/apiview-properties.json +++ /dev/null @@ -1,380 +0,0 @@ -{ - "CrossLanguagePackageId": "Azure.AI.Projects", - "CrossLanguageDefinitionId": { - "azure.ai.voiceagents.models.A2AProtocolConfiguration": "Azure.AI.Projects.A2AProtocolConfiguration", - "azure.ai.voiceagents.models.ActivityProtocolConfiguration": "Azure.AI.Projects.ActivityProtocolConfiguration", - "azure.ai.voiceagents.models.AgentBlueprintReference": "Azure.AI.Projects.AgentBlueprintReference", - "azure.ai.voiceagents.models.AgentCard": "Azure.AI.Projects.AgentCard", - "azure.ai.voiceagents.models.AgentCardSkill": "Azure.AI.Projects.AgentCardSkill", - "azure.ai.voiceagents.models.AgentEndpointAuthorizationScheme": "Azure.AI.Projects.AgentEndpointAuthorizationScheme", - "azure.ai.voiceagents.models.AgentEndpointConfig": "Azure.AI.Projects.AgentEndpointConfig", - "azure.ai.voiceagents.models.AgentIdentity": "Azure.AI.Projects.AgentIdentity", - "azure.ai.voiceagents.models.ApiErrorResponse": "Azure.AI.Projects.ApiErrorResponse", - "azure.ai.voiceagents.models.AzureVoice": "Azure.AI.Projects.AzureVoice", - "azure.ai.voiceagents.models.AzureAvatarVoiceSyncVoice": "Azure.AI.Projects.AzureAvatarVoiceSyncVoice", - "azure.ai.voiceagents.models.AzureCustomVoice": "Azure.AI.Projects.AzureCustomVoice", - "azure.ai.voiceagents.models.AzurePersonalVoice": "Azure.AI.Projects.AzurePersonalVoice", - "azure.ai.voiceagents.models.AzureRealtimeNativeVoice": "Azure.AI.Projects.AzureRealtimeNativeVoice", - "azure.ai.voiceagents.models.AzureStandardVoice": "Azure.AI.Projects.AzureStandardVoice", - "azure.ai.voiceagents.models.BotServiceAuthorizationScheme": "Azure.AI.Projects.BotServiceAuthorizationScheme", - "azure.ai.voiceagents.models.BotServiceRbacAuthorizationScheme": "Azure.AI.Projects.BotServiceRbacAuthorizationScheme", - "azure.ai.voiceagents.models.BotServiceTenantAuthorizationScheme": "Azure.AI.Projects.BotServiceTenantAuthorizationScheme", - "azure.ai.voiceagents.models.CreateTranscriptionResponseJsonUsage": "OpenAI.CreateTranscriptionResponseJsonUsage", - "azure.ai.voiceagents.models.EntraAuthorizationScheme": "Azure.AI.Projects.EntraAuthorizationScheme", - "azure.ai.voiceagents.models.Error": "OpenAI.Error", - "azure.ai.voiceagents.models.VersionSelectionRule": "Azure.AI.Projects.VersionSelectionRule", - "azure.ai.voiceagents.models.FixedRatioVersionSelectionRule": "Azure.AI.Projects.FixedRatioVersionSelectionRule", - "azure.ai.voiceagents.models.InvocationsProtocolConfiguration": "Azure.AI.Projects.InvocationsProtocolConfiguration", - "azure.ai.voiceagents.models.InvocationsWsProtocolConfiguration": "Azure.AI.Projects.InvocationsWsProtocolConfiguration", - "azure.ai.voiceagents.models.VoiceGreetingConfig": "Azure.AI.Projects.VoiceGreetingConfig", - "azure.ai.voiceagents.models.LlmGeneratedVoiceGreetingConfig": "Azure.AI.Projects.LlmGeneratedVoiceGreetingConfig", - "azure.ai.voiceagents.models.LogProbProperties": "OpenAI.LogProbProperties", - "azure.ai.voiceagents.models.ManagedAgentIdentityBlueprintReference": "Azure.AI.Projects.ManagedAgentIdentityBlueprintReference", - "azure.ai.voiceagents.models.MCPListToolsTool": "OpenAI.MCPListToolsTool", - "azure.ai.voiceagents.models.MCPListToolsToolAnnotations": "OpenAI.MCPListToolsToolAnnotations", - "azure.ai.voiceagents.models.MCPListToolsToolInputSchema": "OpenAI.MCPListToolsToolInputSchema", - "azure.ai.voiceagents.models.McpProtocolConfiguration": "Azure.AI.Projects.McpProtocolConfiguration", - "azure.ai.voiceagents.models.Tool": "OpenAI.Tool", - "azure.ai.voiceagents.models.MCPTool": "OpenAI.MCPTool", - "azure.ai.voiceagents.models.MCPToolFilter": "OpenAI.MCPToolFilter", - "azure.ai.voiceagents.models.MCPToolRequireApproval": "OpenAI.MCPToolRequireApproval", - "azure.ai.voiceagents.models.Metadata": "OpenAI.Metadata", - "azure.ai.voiceagents.models.OpenAIVoice": "Azure.AI.Projects.OpenAIVoice", - "azure.ai.voiceagents.models.ProtocolConfiguration": "Azure.AI.Projects.ProtocolConfiguration", - "azure.ai.voiceagents.models.RaiConfig": "Azure.AI.Projects.RaiConfig", - "azure.ai.voiceagents.models.RealtimeAudioFormats": "OpenAI.RealtimeAudioFormats", - "azure.ai.voiceagents.models.RealtimeAudioFormatsAudioPcm": "OpenAI.RealtimeAudioFormatsAudioPcm", - "azure.ai.voiceagents.models.RealtimeAudioFormatsAudioPcma": "OpenAI.RealtimeAudioFormatsAudioPcma", - "azure.ai.voiceagents.models.RealtimeAudioFormatsAudioPcmu": "OpenAI.RealtimeAudioFormatsAudioPcmu", - "azure.ai.voiceagents.models.RealtimeConversationItem": "OpenAI.RealtimeConversationItem", - "azure.ai.voiceagents.models.RealtimeConversationItemFunctionCall": "OpenAI.RealtimeConversationItemFunctionCall", - "azure.ai.voiceagents.models.RealtimeConversationItemFunctionCallOutput": "OpenAI.RealtimeConversationItemFunctionCallOutput", - "azure.ai.voiceagents.models.RealtimeConversationItemMessage": "OpenAI.RealtimeConversationItemMessage", - "azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistant": "OpenAI.RealtimeConversationItemMessageAssistant", - "azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistantContent": "OpenAI.RealtimeConversationItemMessageAssistantContent", - "azure.ai.voiceagents.models.RealtimeConversationItemMessageSystem": "OpenAI.RealtimeConversationItemMessageSystem", - "azure.ai.voiceagents.models.RealtimeConversationItemMessageSystemContent": "OpenAI.RealtimeConversationItemMessageSystemContent", - "azure.ai.voiceagents.models.RealtimeConversationItemMessageUser": "OpenAI.RealtimeConversationItemMessageUser", - "azure.ai.voiceagents.models.RealtimeConversationItemMessageUserContent": "OpenAI.RealtimeConversationItemMessageUserContent", - "azure.ai.voiceagents.models.RealtimeFunctionTool": "OpenAI.RealtimeFunctionTool", - "azure.ai.voiceagents.models.RealtimeFunctionToolParameters": "OpenAI.RealtimeFunctionToolParameters", - "azure.ai.voiceagents.models.RealtimeMCPApprovalRequest": "OpenAI.RealtimeMCPApprovalRequest", - "azure.ai.voiceagents.models.RealtimeMCPApprovalResponse": "OpenAI.RealtimeMCPApprovalResponse", - "azure.ai.voiceagents.models.RealtimeMCPError": "OpenAI.RealtimeMCPError", - "azure.ai.voiceagents.models.RealtimeMCPHTTPError": "OpenAI.RealtimeMCPHTTPError", - "azure.ai.voiceagents.models.RealtimeMCPListTools": "OpenAI.RealtimeMCPListTools", - "azure.ai.voiceagents.models.RealtimeMCPProtocolError": "OpenAI.RealtimeMCPProtocolError", - "azure.ai.voiceagents.models.RealtimeMCPToolCall": "OpenAI.RealtimeMCPToolCall", - "azure.ai.voiceagents.models.RealtimeMCPToolExecutionError": "OpenAI.RealtimeMCPToolExecutionError", - "azure.ai.voiceagents.models.RealtimeReasoning": "OpenAI.RealtimeReasoning", - "azure.ai.voiceagents.models.RealtimeResponseStatusDetails": "OpenAI.RealtimeResponseStatusDetails", - "azure.ai.voiceagents.models.RealtimeResponseStatusDetailsError": "OpenAI.RealtimeResponseStatusDetailsError", - "azure.ai.voiceagents.models.RealtimeResponseUsage": "OpenAI.RealtimeResponseUsage", - "azure.ai.voiceagents.models.RealtimeResponseUsageInputTokenDetails": "OpenAI.RealtimeResponseUsageInputTokenDetails", - "azure.ai.voiceagents.models.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails": "OpenAI.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails", - "azure.ai.voiceagents.models.RealtimeResponseUsageOutputTokenDetails": "OpenAI.RealtimeResponseUsageOutputTokenDetails", - "azure.ai.voiceagents.models.RealtimeServerEvent": "OpenAI.RealtimeServerEvent", - "azure.ai.voiceagents.models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError": "OpenAI.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError", - "azure.ai.voiceagents.models.RealtimeServerEventRateLimitsUpdatedRateLimits": "OpenAI.RealtimeServerEventRateLimitsUpdatedRateLimits", - "azure.ai.voiceagents.models.RealtimeServerEventResponseContentPartAdded": "OpenAI.RealtimeServerEventResponseContentPartAdded", - "azure.ai.voiceagents.models.RealtimeServerEventResponseContentPartAddedPart": "OpenAI.RealtimeServerEventResponseContentPartAddedPart", - "azure.ai.voiceagents.models.RealtimeToolChoiceFunction": "OpenAI.RealtimeToolChoiceFunction", - "azure.ai.voiceagents.models.ResponsesProtocolConfiguration": "Azure.AI.Projects.ResponsesProtocolConfiguration", - "azure.ai.voiceagents.models.StructuredInputDefinition": "Azure.AI.Projects.StructuredInputDefinition", - "azure.ai.voiceagents.models.TemplateVoiceGreetingConfig": "Azure.AI.Projects.TemplateVoiceGreetingConfig", - "azure.ai.voiceagents.models.ToolChoiceParam": "OpenAI.ToolChoiceParam", - "azure.ai.voiceagents.models.ToolChoiceFunction": "OpenAI.ToolChoiceFunction", - "azure.ai.voiceagents.models.ToolChoiceMCP": "OpenAI.ToolChoiceMCP", - "azure.ai.voiceagents.models.ToolConfig": "Azure.AI.Projects.ToolConfig", - "azure.ai.voiceagents.models.TranscriptTextUsageDuration": "OpenAI.TranscriptTextUsageDuration", - "azure.ai.voiceagents.models.TranscriptTextUsageTokens": "OpenAI.TranscriptTextUsageTokens", - "azure.ai.voiceagents.models.TranscriptTextUsageTokensInputTokenDetails": "OpenAI.TranscriptTextUsageTokensInputTokenDetails", - "azure.ai.voiceagents.models.VersionSelector": "Azure.AI.Projects.VersionSelector", - "azure.ai.voiceagents.models.VoiceAgentAnimationConfig": "Azure.AI.Projects.VoiceAgentAnimationConfig", - "azure.ai.voiceagents.models.VoiceAgentAvatarIceServer": "Azure.AI.Projects.VoiceAgentAvatarIceServer", - "azure.ai.voiceagents.models.VoiceAgentAvatarScene": "Azure.AI.Projects.VoiceAgentAvatarScene", - "azure.ai.voiceagents.models.VoiceAgentAvatarVideoBackground": "Azure.AI.Projects.VoiceAgentAvatarVideoBackground", - "azure.ai.voiceagents.models.VoiceAgentAvatarVideoCrop": "Azure.AI.Projects.VoiceAgentAvatarVideoCrop", - "azure.ai.voiceagents.models.VoiceAgentAvatarVideoParams": "Azure.AI.Projects.VoiceAgentAvatarVideoParams", - "azure.ai.voiceagents.models.VoiceAgentAvatarVideoResolution": "Azure.AI.Projects.VoiceAgentAvatarVideoResolution", - "azure.ai.voiceagents.models.VoiceAgentAzureMultilingualSemanticVadTurnDetection": "Azure.AI.Projects.VoiceAgentAzureMultilingualSemanticVadTurnDetection", - "azure.ai.voiceagents.models.VoiceAgentAzureSemanticVadTurnDetection": "Azure.AI.Projects.VoiceAgentAzureSemanticVadTurnDetection", - "azure.ai.voiceagents.models.VoiceAgentClientEventConversationItemCreate": "Azure.AI.Projects.VoiceAgentClientEventConversationItemCreate", - "azure.ai.voiceagents.models.VoiceAgentClientEventConversationItemDelete": "Azure.AI.Projects.VoiceAgentClientEventConversationItemDelete", - "azure.ai.voiceagents.models.VoiceAgentClientEventConversationItemRetrieve": "Azure.AI.Projects.VoiceAgentClientEventConversationItemRetrieve", - "azure.ai.voiceagents.models.VoiceAgentClientEventConversationItemTruncate": "Azure.AI.Projects.VoiceAgentClientEventConversationItemTruncate", - "azure.ai.voiceagents.models.VoiceAgentClientEventInputAudioBufferAppend": "Azure.AI.Projects.VoiceAgentClientEventInputAudioBufferAppend", - "azure.ai.voiceagents.models.VoiceAgentClientEventInputAudioBufferClear": "Azure.AI.Projects.VoiceAgentClientEventInputAudioBufferClear", - "azure.ai.voiceagents.models.VoiceAgentClientEventInputAudioBufferCommit": "Azure.AI.Projects.VoiceAgentClientEventInputAudioBufferCommit", - "azure.ai.voiceagents.models.VoiceAgentClientEventOutputAudioBufferClear": "Azure.AI.Projects.VoiceAgentClientEventOutputAudioBufferClear", - "azure.ai.voiceagents.models.VoiceAgentClientEventResponseCancel": "Azure.AI.Projects.VoiceAgentClientEventResponseCancel", - "azure.ai.voiceagents.models.VoiceAgentClientEventResponseCreate": "Azure.AI.Projects.VoiceAgentClientEventResponseCreate", - "azure.ai.voiceagents.models.VoiceAgentClientEventSessionAvatarConnect": "Azure.AI.Projects.VoiceAgentClientEventSessionAvatarConnect", - "azure.ai.voiceagents.models.VoiceAgentClientEventSessionUpdate": "Azure.AI.Projects.VoiceAgentClientEventSessionUpdate", - "azure.ai.voiceagents.models.VoiceAgentDefinition": "Azure.AI.Projects.VoiceAgentDefinition", - "azure.ai.voiceagents.models.VoiceAgentEchoCancellation": "Azure.AI.Projects.VoiceAgentEchoCancellation", - "azure.ai.voiceagents.models.VoiceAgentEndOfUtteranceDetection": "Azure.AI.Projects.VoiceAgentEndOfUtteranceDetection", - "azure.ai.voiceagents.models.VoiceAgentEstimatedCost": "Azure.AI.Projects.VoiceAgentEstimatedCost", - "azure.ai.voiceagents.models.VoiceAgentFileSearchCallItem": "Azure.AI.Projects.VoiceAgentFileSearchCallItem", - "azure.ai.voiceagents.models.VoiceAgentFileSearchResult": "Azure.AI.Projects.VoiceAgentFileSearchResult", - "azure.ai.voiceagents.models.VoiceAgentHandoffEdgeConfig": "Azure.AI.Projects.VoiceAgentHandoffEdgeConfig", - "azure.ai.voiceagents.models.VoiceAgentHandoffEdgeState": "Azure.AI.Projects.VoiceAgentHandoffEdgeState", - "azure.ai.voiceagents.models.VoiceAgentHandoffGraphConfig": "Azure.AI.Projects.VoiceAgentHandoffGraphConfig", - "azure.ai.voiceagents.models.VoiceAgentHandoffNodeConfig": "Azure.AI.Projects.VoiceAgentHandoffNodeConfig", - "azure.ai.voiceagents.models.VoiceAgentHandoffNodeSessionConfig": "Azure.AI.Projects.VoiceAgentHandoffNodeSessionConfig", - "azure.ai.voiceagents.models.VoiceAgentHandoffNodeState": "Azure.AI.Projects.VoiceAgentHandoffNodeState", - "azure.ai.voiceagents.models.VoiceAgentHandoffState": "Azure.AI.Projects.VoiceAgentHandoffState", - "azure.ai.voiceagents.models.VoiceAgentInterimResponseConfig": "Azure.AI.Projects.VoiceAgentInterimResponseConfig", - "azure.ai.voiceagents.models.VoiceAgentLlmInterimResponseConfig": "Azure.AI.Projects.VoiceAgentLlmInterimResponseConfig", - "azure.ai.voiceagents.models.VoiceAgentMcpAssignedManagedIdentity": "Azure.AI.Projects.VoiceAgentMcpAssignedManagedIdentity", - "azure.ai.voiceagents.models.VoiceAgentMcpTool": "Azure.AI.Projects.VoiceAgentMcpTool", - "azure.ai.voiceagents.models.VoiceAgentObject": "Azure.AI.Projects.VoiceAgentObject", - "azure.ai.voiceagents.models.VoiceAgentObjectVersions": "Azure.AI.Projects.VoiceAgentObject.versions.anonymous", - "azure.ai.voiceagents.models.VoiceAgentRealtimeResponse": "Azure.AI.Projects.VoiceAgentRealtimeResponse", - "azure.ai.voiceagents.models.VoiceAgentResponseCreateAudio": "Azure.AI.Projects.VoiceAgentResponseCreateAudio", - "azure.ai.voiceagents.models.VoiceAgentResponseCreateParams": "Azure.AI.Projects.VoiceAgentResponseCreateParams", - "azure.ai.voiceagents.models.VoiceAgentResponseEventAudioContentPart": "Azure.AI.Projects.VoiceAgentResponseEventAudioContentPart", - "azure.ai.voiceagents.models.VoiceAgentResponseEventTextContentPart": "Azure.AI.Projects.VoiceAgentResponseEventTextContentPart", - "azure.ai.voiceagents.models.VoiceAgentSemanticVadTurnDetection": "Azure.AI.Projects.VoiceAgentSemanticVadTurnDetection", - "azure.ai.voiceagents.models.VoiceAgentServerEventConversationCreated": "Azure.AI.Projects.VoiceAgentServerEventConversationCreated", - "azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemAdded": "Azure.AI.Projects.VoiceAgentServerEventConversationItemAdded", - "azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemCreated": "Azure.AI.Projects.VoiceAgentServerEventConversationItemCreated", - "azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemDeleted": "Azure.AI.Projects.VoiceAgentServerEventConversationItemDeleted", - "azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemDone": "Azure.AI.Projects.VoiceAgentServerEventConversationItemDone", - "azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted": "Azure.AI.Projects.VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted", - "azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta": "Azure.AI.Projects.VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta", - "azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed": "Azure.AI.Projects.VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed", - "azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment": "Azure.AI.Projects.VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment", - "azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemRetrieved": "Azure.AI.Projects.VoiceAgentServerEventConversationItemRetrieved", - "azure.ai.voiceagents.models.VoiceAgentServerEventConversationItemTruncated": "Azure.AI.Projects.VoiceAgentServerEventConversationItemTruncated", - "azure.ai.voiceagents.models.VoiceAgentServerEventError": "Azure.AI.Projects.VoiceAgentServerEventError", - "azure.ai.voiceagents.models.VoiceAgentServerEventErrorDetails": "Azure.AI.Projects.VoiceAgentServerEventErrorDetails", - "azure.ai.voiceagents.models.VoiceAgentServerEventFileSearchCallCompleted": "Azure.AI.Projects.VoiceAgentServerEventFileSearchCallCompleted", - "azure.ai.voiceagents.models.VoiceAgentServerEventFileSearchCallInProgress": "Azure.AI.Projects.VoiceAgentServerEventFileSearchCallInProgress", - "azure.ai.voiceagents.models.VoiceAgentServerEventFileSearchCallSearching": "Azure.AI.Projects.VoiceAgentServerEventFileSearchCallSearching", - "azure.ai.voiceagents.models.VoiceAgentServerEventInputAudioBufferCleared": "Azure.AI.Projects.VoiceAgentServerEventInputAudioBufferCleared", - "azure.ai.voiceagents.models.VoiceAgentServerEventInputAudioBufferCommitted": "Azure.AI.Projects.VoiceAgentServerEventInputAudioBufferCommitted", - "azure.ai.voiceagents.models.VoiceAgentServerEventInputAudioBufferSpeechStarted": "Azure.AI.Projects.VoiceAgentServerEventInputAudioBufferSpeechStarted", - "azure.ai.voiceagents.models.VoiceAgentServerEventInputAudioBufferSpeechStopped": "Azure.AI.Projects.VoiceAgentServerEventInputAudioBufferSpeechStopped", - "azure.ai.voiceagents.models.VoiceAgentServerEventInputAudioBufferTimeoutTriggered": "Azure.AI.Projects.VoiceAgentServerEventInputAudioBufferTimeoutTriggered", - "azure.ai.voiceagents.models.VoiceAgentServerEventMcpListToolsCompleted": "Azure.AI.Projects.VoiceAgentServerEventMcpListToolsCompleted", - "azure.ai.voiceagents.models.VoiceAgentServerEventMcpListToolsFailed": "Azure.AI.Projects.VoiceAgentServerEventMcpListToolsFailed", - "azure.ai.voiceagents.models.VoiceAgentServerEventMcpListToolsInProgress": "Azure.AI.Projects.VoiceAgentServerEventMcpListToolsInProgress", - "azure.ai.voiceagents.models.VoiceAgentServerEventOutputAudioBufferCleared": "Azure.AI.Projects.VoiceAgentServerEventOutputAudioBufferCleared", - "azure.ai.voiceagents.models.VoiceAgentServerEventRateLimitsUpdated": "Azure.AI.Projects.VoiceAgentServerEventRateLimitsUpdated", - "azure.ai.voiceagents.models.VoiceAgentServerEventResponseAnimationBlendshapesDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseAnimationBlendshapesDelta", - "azure.ai.voiceagents.models.VoiceAgentServerEventResponseAnimationBlendshapesDone": "Azure.AI.Projects.VoiceAgentServerEventResponseAnimationBlendshapesDone", - "azure.ai.voiceagents.models.VoiceAgentServerEventResponseAnimationVisemeDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseAnimationVisemeDelta", - "azure.ai.voiceagents.models.VoiceAgentServerEventResponseAnimationVisemeDone": "Azure.AI.Projects.VoiceAgentServerEventResponseAnimationVisemeDone", - "azure.ai.voiceagents.models.VoiceAgentServerEventResponseAudioDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseAudioDelta", - "azure.ai.voiceagents.models.VoiceAgentServerEventResponseAudioDone": "Azure.AI.Projects.VoiceAgentServerEventResponseAudioDone", - "azure.ai.voiceagents.models.VoiceAgentServerEventResponseAudioTimestampDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseAudioTimestampDelta", - "azure.ai.voiceagents.models.VoiceAgentServerEventResponseAudioTimestampDone": "Azure.AI.Projects.VoiceAgentServerEventResponseAudioTimestampDone", - "azure.ai.voiceagents.models.VoiceAgentServerEventResponseAudioTranscriptDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseAudioTranscriptDelta", - "azure.ai.voiceagents.models.VoiceAgentServerEventResponseAudioTranscriptDone": "Azure.AI.Projects.VoiceAgentServerEventResponseAudioTranscriptDone", - "azure.ai.voiceagents.models.VoiceAgentServerEventResponseContentPartDone": "Azure.AI.Projects.VoiceAgentServerEventResponseContentPartDone", - "azure.ai.voiceagents.models.VoiceAgentServerEventResponseCreated": "Azure.AI.Projects.VoiceAgentServerEventResponseCreated", - "azure.ai.voiceagents.models.VoiceAgentServerEventResponseDone": "Azure.AI.Projects.VoiceAgentServerEventResponseDone", - "azure.ai.voiceagents.models.VoiceAgentServerEventResponseFunctionCallArgumentsDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseFunctionCallArgumentsDelta", - "azure.ai.voiceagents.models.VoiceAgentServerEventResponseFunctionCallArgumentsDone": "Azure.AI.Projects.VoiceAgentServerEventResponseFunctionCallArgumentsDone", - "azure.ai.voiceagents.models.VoiceAgentServerEventResponseMcpCallArgumentsDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseMcpCallArgumentsDelta", - "azure.ai.voiceagents.models.VoiceAgentServerEventResponseMcpCallArgumentsDone": "Azure.AI.Projects.VoiceAgentServerEventResponseMcpCallArgumentsDone", - "azure.ai.voiceagents.models.VoiceAgentServerEventResponseMcpCallCompleted": "Azure.AI.Projects.VoiceAgentServerEventResponseMcpCallCompleted", - "azure.ai.voiceagents.models.VoiceAgentServerEventResponseMcpCallFailed": "Azure.AI.Projects.VoiceAgentServerEventResponseMcpCallFailed", - "azure.ai.voiceagents.models.VoiceAgentServerEventResponseMcpCallInProgress": "Azure.AI.Projects.VoiceAgentServerEventResponseMcpCallInProgress", - "azure.ai.voiceagents.models.VoiceAgentServerEventResponseOutputItemAdded": "Azure.AI.Projects.VoiceAgentServerEventResponseOutputItemAdded", - "azure.ai.voiceagents.models.VoiceAgentServerEventResponseOutputItemDone": "Azure.AI.Projects.VoiceAgentServerEventResponseOutputItemDone", - "azure.ai.voiceagents.models.VoiceAgentServerEventResponseTextDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseTextDelta", - "azure.ai.voiceagents.models.VoiceAgentServerEventResponseTextDone": "Azure.AI.Projects.VoiceAgentServerEventResponseTextDone", - "azure.ai.voiceagents.models.VoiceAgentServerEventResponseVideoDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseVideoDelta", - "azure.ai.voiceagents.models.VoiceAgentServerEventSessionAvatarConnecting": "Azure.AI.Projects.VoiceAgentServerEventSessionAvatarConnecting", - "azure.ai.voiceagents.models.VoiceAgentServerEventSessionAvatarSwitchToIdle": "Azure.AI.Projects.VoiceAgentServerEventSessionAvatarSwitchToIdle", - "azure.ai.voiceagents.models.VoiceAgentServerEventSessionAvatarSwitchToSpeaking": "Azure.AI.Projects.VoiceAgentServerEventSessionAvatarSwitchToSpeaking", - "azure.ai.voiceagents.models.VoiceAgentServerEventSessionCreated": "Azure.AI.Projects.VoiceAgentServerEventSessionCreated", - "azure.ai.voiceagents.models.VoiceAgentServerEventSessionHandoffAborted": "Azure.AI.Projects.VoiceAgentServerEventSessionHandoffAborted", - "azure.ai.voiceagents.models.VoiceAgentServerEventSessionHandoffCompleted": "Azure.AI.Projects.VoiceAgentServerEventSessionHandoffCompleted", - "azure.ai.voiceagents.models.VoiceAgentServerEventSessionHandoffStarted": "Azure.AI.Projects.VoiceAgentServerEventSessionHandoffStarted", - "azure.ai.voiceagents.models.VoiceAgentServerEventSessionUpdated": "Azure.AI.Projects.VoiceAgentServerEventSessionUpdated", - "azure.ai.voiceagents.models.VoiceAgentServerEventWarning": "Azure.AI.Projects.VoiceAgentServerEventWarning", - "azure.ai.voiceagents.models.VoiceAgentServerEventWarningDetails": "Azure.AI.Projects.VoiceAgentServerEventWarningDetails", - "azure.ai.voiceagents.models.VoiceAgentServerEventWebSearchCallCompleted": "Azure.AI.Projects.VoiceAgentServerEventWebSearchCallCompleted", - "azure.ai.voiceagents.models.VoiceAgentServerEventWebSearchCallInProgress": "Azure.AI.Projects.VoiceAgentServerEventWebSearchCallInProgress", - "azure.ai.voiceagents.models.VoiceAgentServerEventWebSearchCallSearching": "Azure.AI.Projects.VoiceAgentServerEventWebSearchCallSearching", - "azure.ai.voiceagents.models.VoiceAgentServerVadTurnDetection": "Azure.AI.Projects.VoiceAgentServerVadTurnDetection", - "azure.ai.voiceagents.models.VoiceAgentSessionAvatarConfig": "Azure.AI.Projects.VoiceAgentSessionAvatarConfig", - "azure.ai.voiceagents.models.VoiceAgentSessionMcpTool": "Azure.AI.Projects.VoiceAgentSessionMcpTool", - "azure.ai.voiceagents.models.VoiceAgentSessionResponseAudio": "Azure.AI.Projects.VoiceAgentSessionResponseAudio", - "azure.ai.voiceagents.models.VoiceAgentSessionResponseAudioInput": "Azure.AI.Projects.VoiceAgentSessionResponseAudioInput", - "azure.ai.voiceagents.models.VoiceAgentSessionResponseAudioOutput": "Azure.AI.Projects.VoiceAgentSessionResponseAudioOutput", - "azure.ai.voiceagents.models.VoiceAgentSessionResponseConfig": "Azure.AI.Projects.VoiceAgentSessionResponseConfig", - "azure.ai.voiceagents.models.VoiceAgentSessionUpdateAudio": "Azure.AI.Projects.VoiceAgentSessionUpdateAudio", - "azure.ai.voiceagents.models.VoiceAgentSessionUpdateAudioInput": "Azure.AI.Projects.VoiceAgentSessionUpdateAudioInput", - "azure.ai.voiceagents.models.VoiceAgentSessionUpdateAudioOutput": "Azure.AI.Projects.VoiceAgentSessionUpdateAudioOutput", - "azure.ai.voiceagents.models.VoiceAgentSessionUpdateConfig": "Azure.AI.Projects.VoiceAgentSessionUpdateConfig", - "azure.ai.voiceagents.models.VoiceAgentStaticInterimResponseConfig": "Azure.AI.Projects.VoiceAgentStaticInterimResponseConfig", - "azure.ai.voiceagents.models.VoiceAgentTranscriptionPhrase": "Azure.AI.Projects.VoiceAgentTranscriptionPhrase", - "azure.ai.voiceagents.models.VoiceAgentTranscriptionWord": "Azure.AI.Projects.VoiceAgentTranscriptionWord", - "azure.ai.voiceagents.models.VoiceAgentVersionObject": "Azure.AI.Projects.VoiceAgentVersionObject", - "azure.ai.voiceagents.models.VoiceAgentVoiceAdaptation": "Azure.AI.Projects.VoiceAgentVoiceAdaptation", - "azure.ai.voiceagents.models.VoiceAgentWebSearchActionFind": "Azure.AI.Projects.VoiceAgentWebSearchActionFind", - "azure.ai.voiceagents.models.VoiceAgentWebSearchActionOpenPage": "Azure.AI.Projects.VoiceAgentWebSearchActionOpenPage", - "azure.ai.voiceagents.models.VoiceAgentWebSearchActionSearch": "Azure.AI.Projects.VoiceAgentWebSearchActionSearch", - "azure.ai.voiceagents.models.VoiceAgentWebSearchCallItem": "Azure.AI.Projects.VoiceAgentWebSearchCallItem", - "azure.ai.voiceagents.models.VoiceAgentWebSearchSource": "Azure.AI.Projects.VoiceAgentWebSearchSource", - "azure.ai.voiceagents.models.VoiceAgentWorkflowActionItem": "Azure.AI.Projects.VoiceAgentWorkflowActionItem", - "azure.ai.voiceagents.models.VoiceConversationItem": "Azure.AI.Projects.VoiceConversationItem", - "azure.ai.voiceagents.models.VoiceMessageItem": "Azure.AI.Projects.VoiceMessageItem", - "azure.ai.voiceagents.models.VoiceAssistantMessageItem": "Azure.AI.Projects.VoiceAssistantMessageItem", - "azure.ai.voiceagents.models.VoiceAudioConfig": "Azure.AI.Projects.VoiceAudioConfig", - "azure.ai.voiceagents.models.VoiceAudioFormat": "Azure.AI.Projects.VoiceAudioFormat", - "azure.ai.voiceagents.models.VoiceAudioInputConfig": "Azure.AI.Projects.VoiceAudioInputConfig", - "azure.ai.voiceagents.models.VoiceAudioOutputConfig": "Azure.AI.Projects.VoiceAudioOutputConfig", - "azure.ai.voiceagents.models.VoiceAvatarConfig": "Azure.AI.Projects.VoiceAvatarConfig", - "azure.ai.voiceagents.models.VoiceEndOfUtteranceDetection": "Azure.AI.Projects.VoiceEndOfUtteranceDetection", - "azure.ai.voiceagents.models.VoiceAzureSemanticDetection": "Azure.AI.Projects.VoiceAzureSemanticDetection", - "azure.ai.voiceagents.models.VoiceAzureSemanticDetectionEn": "Azure.AI.Projects.VoiceAzureSemanticDetectionEn", - "azure.ai.voiceagents.models.VoiceAzureSemanticDetectionMultilingual": "Azure.AI.Projects.VoiceAzureSemanticDetectionMultilingual", - "azure.ai.voiceagents.models.VoiceTurnDetection": "Azure.AI.Projects.VoiceTurnDetection", - "azure.ai.voiceagents.models.VoiceAzureSemanticVadEnTurnDetection": "Azure.AI.Projects.VoiceAzureSemanticVadEnTurnDetection", - "azure.ai.voiceagents.models.VoiceAzureSemanticVadMultilingualTurnDetection": "Azure.AI.Projects.VoiceAzureSemanticVadMultilingualTurnDetection", - "azure.ai.voiceagents.models.VoiceAzureSemanticVadTurnDetection": "Azure.AI.Projects.VoiceAzureSemanticVadTurnDetection", - "azure.ai.voiceagents.models.VoiceConversation": "Azure.AI.Projects.VoiceConversation", - "azure.ai.voiceagents.models.VoiceFunctionCallItem": "Azure.AI.Projects.VoiceFunctionCallItem", - "azure.ai.voiceagents.models.VoiceFunctionCallOutputItem": "Azure.AI.Projects.VoiceFunctionCallOutputItem", - "azure.ai.voiceagents.models.VoiceInputTranscription": "Azure.AI.Projects.VoiceInputTranscription", - "azure.ai.voiceagents.models.VoiceItemAudioResponse": "Azure.AI.Projects.VoiceItemAudioResponse", - "azure.ai.voiceagents.models.VoiceMcpApprovalRequestItem": "Azure.AI.Projects.VoiceMcpApprovalRequestItem", - "azure.ai.voiceagents.models.VoiceMcpApprovalResponseItem": "Azure.AI.Projects.VoiceMcpApprovalResponseItem", - "azure.ai.voiceagents.models.VoiceMcpCallItem": "Azure.AI.Projects.VoiceMcpCallItem", - "azure.ai.voiceagents.models.VoiceMcpListToolsItem": "Azure.AI.Projects.VoiceMcpListToolsItem", - "azure.ai.voiceagents.models.VoiceNoiseReduction": "Azure.AI.Projects.VoiceNoiseReduction", - "azure.ai.voiceagents.models.VoiceRecordingChannelLayout": "Azure.AI.Projects.VoiceRecordingChannelLayout", - "azure.ai.voiceagents.models.VoiceRecordingResponse": "Azure.AI.Projects.VoiceRecordingResponse", - "azure.ai.voiceagents.models.VoiceResponse": "Azure.AI.Projects.VoiceResponse", - "azure.ai.voiceagents.models.VoiceResponseAudio": "Azure.AI.Projects.VoiceResponseAudio", - "azure.ai.voiceagents.models.VoiceResponseAudioOutput": "Azure.AI.Projects.VoiceResponseAudioOutput", - "azure.ai.voiceagents.models.VoiceSemanticVadTurnDetection": "Azure.AI.Projects.VoiceSemanticVadTurnDetection", - "azure.ai.voiceagents.models.VoiceServerVadTurnDetection": "Azure.AI.Projects.VoiceServerVadTurnDetection", - "azure.ai.voiceagents.models.VoiceSystemMessageItem": "Azure.AI.Projects.VoiceSystemMessageItem", - "azure.ai.voiceagents.models.VoiceSystemTool": "Azure.AI.Projects.VoiceSystemTool", - "azure.ai.voiceagents.models.VoiceToolboxTool": "Azure.AI.Projects.VoiceToolboxTool", - "azure.ai.voiceagents.models.VoiceUserMessageItem": "Azure.AI.Projects.VoiceUserMessageItem", - "azure.ai.voiceagents.models.VoiceAgentWebSocketSubprotocol": "Azure.AI.Projects.VoiceAgentWebSocketSubprotocol", - "azure.ai.voiceagents.models.AgentDefinitionOptInKeys": "Azure.AI.Projects.AgentDefinitionOptInKeys", - "azure.ai.voiceagents.models.VoiceConversationStatus": "Azure.AI.Projects.VoiceConversationStatus", - "azure.ai.voiceagents.models.VoiceResponseStatus": "Azure.AI.Projects.VoiceResponseStatus", - "azure.ai.voiceagents.models.VoiceConversationItemType": "Azure.AI.Projects.VoiceConversationItemType", - "azure.ai.voiceagents.models.RealtimeMcpErrorType": "OpenAI.RealtimeMcpErrorType", - "azure.ai.voiceagents.models.RealtimeConversationItemMessageType": "OpenAI.RealtimeConversationItemMessageType", - "azure.ai.voiceagents.models.VoiceIdsShared": "OpenAI.VoiceIdsShared", - "azure.ai.voiceagents.models.AzureVoiceType": "Azure.AI.Projects.AzureVoiceType", - "azure.ai.voiceagents.models.PersonalVoiceModel": "Azure.AI.Projects.PersonalVoiceModel", - "azure.ai.voiceagents.models.AzureRealtimeNativeVoiceName": "Azure.AI.Projects.AzureRealtimeNativeVoiceName", - "azure.ai.voiceagents.models.RealtimeAudioFormatsType": "OpenAI.RealtimeAudioFormatsType", - "azure.ai.voiceagents.models.PageOrder": "Azure.AI.Projects.PageOrder", - "azure.ai.voiceagents.models.VoiceAudioRole": "Azure.AI.Projects.VoiceAudioRole", - "azure.ai.voiceagents.models.VoiceAudioContainerFormat": "Azure.AI.Projects.VoiceAudioContainerFormat", - "azure.ai.voiceagents.models.VoiceAudioCodec": "Azure.AI.Projects.VoiceAudioCodec", - "azure.ai.voiceagents.models.AgentObjectType": "Azure.AI.Projects.AgentObjectType", - "azure.ai.voiceagents.models.AgentState": "Azure.AI.Projects.AgentState", - "azure.ai.voiceagents.models.AgentStateSource": "Azure.AI.Projects.AgentStateSource", - "azure.ai.voiceagents.models.VersionSelectorType": "Azure.AI.Projects.VersionSelectorType", - "azure.ai.voiceagents.models.AgentEndpointAuthorizationSchemeType": "Azure.AI.Projects.AgentEndpointAuthorizationSchemeType", - "azure.ai.voiceagents.models.AgentIdentityStatus": "Azure.AI.Projects.AgentIdentityStatus", - "azure.ai.voiceagents.models.AgentBlueprintReferenceType": "Azure.AI.Projects.AgentBlueprintReferenceType", - "azure.ai.voiceagents.models.AgentVersionStatus": "Azure.AI.Projects.AgentVersionStatus", - "azure.ai.voiceagents.models.VoiceModelType": "Azure.AI.Projects.VoiceModelType", - "azure.ai.voiceagents.models.VoiceGreetingToolChoice": "Azure.AI.Projects.VoiceGreetingToolChoice", - "azure.ai.voiceagents.models.VoiceAudioFormatType": "Azure.AI.Projects.VoiceAudioFormatType", - "azure.ai.voiceagents.models.VoiceNoiseReductionType": "Azure.AI.Projects.VoiceNoiseReductionType", - "azure.ai.voiceagents.models.VoiceTurnDetectionType": "Azure.AI.Projects.VoiceTurnDetectionType", - "azure.ai.voiceagents.models.VoiceEndOfUtteranceDetectionModel": "Azure.AI.Projects.VoiceEndOfUtteranceDetectionModel", - "azure.ai.voiceagents.models.VoiceEndOfUtteranceThresholdLevel": "Azure.AI.Projects.VoiceEndOfUtteranceThresholdLevel", - "azure.ai.voiceagents.models.VoiceInputTranscriptionModel": "Azure.AI.Projects.VoiceInputTranscriptionModel", - "azure.ai.voiceagents.models.VoiceAudioTimestampType": "Azure.AI.Projects.VoiceAudioTimestampType", - "azure.ai.voiceagents.models.VoiceOutputModality": "Azure.AI.Projects.VoiceOutputModality", - "azure.ai.voiceagents.models.VoiceAvatarType": "Azure.AI.Projects.VoiceAvatarType", - "azure.ai.voiceagents.models.VoiceAvatarOutputProtocol": "Azure.AI.Projects.VoiceAvatarOutputProtocol", - "azure.ai.voiceagents.models.ToolType": "OpenAI.ToolType", - "azure.ai.voiceagents.models.CallableToolAllowedCaller": "OpenAI.CallableToolAllowedCaller", - "azure.ai.voiceagents.models.VoiceAgentMcpResponseScheduling": "Azure.AI.Projects.VoiceAgentMcpResponseScheduling", - "azure.ai.voiceagents.models.VoiceSystemToolName": "Azure.AI.Projects.VoiceSystemToolName", - "azure.ai.voiceagents.models.VoiceAgentType": "Azure.AI.Projects.VoiceAgentType", - "azure.ai.voiceagents.models.VoiceAgentUseCase": "Azure.AI.Projects.VoiceAgentUseCase", - "azure.ai.voiceagents.models.RealtimeClientEventType": "OpenAI.RealtimeClientEventType", - "azure.ai.voiceagents.models.RealtimeConversationItemType": "OpenAI.RealtimeConversationItemType", - "azure.ai.voiceagents.models.ToolChoiceOptions": "OpenAI.ToolChoiceOptions", - "azure.ai.voiceagents.models.ToolChoiceParamType": "OpenAI.ToolChoiceParamType", - "azure.ai.voiceagents.models.RealtimeReasoningEffort": "OpenAI.RealtimeReasoningEffort", - "azure.ai.voiceagents.models.VoiceAgentInterimResponseTrigger": "Azure.AI.Projects.VoiceAgentInterimResponseTrigger", - "azure.ai.voiceagents.models.VoiceAgentEndOfUtteranceModel": "Azure.AI.Projects.VoiceAgentEndOfUtteranceModel", - "azure.ai.voiceagents.models.VoiceAgentEndOfUtteranceThresholdLevel": "Azure.AI.Projects.VoiceAgentEndOfUtteranceThresholdLevel", - "azure.ai.voiceagents.models.VoiceAgentAzureSemanticVadType": "Azure.AI.Projects.VoiceAgentAzureSemanticVadType", - "azure.ai.voiceagents.models.VoiceAgentEchoCancellationReferenceSource": "Azure.AI.Projects.VoiceAgentEchoCancellationReferenceSource", - "azure.ai.voiceagents.models.VoiceAgentAvatarType": "Azure.AI.Projects.VoiceAgentAvatarType", - "azure.ai.voiceagents.models.VoiceAgentAvatarOutputProtocol": "Azure.AI.Projects.VoiceAgentAvatarOutputProtocol", - "azure.ai.voiceagents.models.VoiceAgentAnimationOutputType": "Azure.AI.Projects.VoiceAgentAnimationOutputType", - "azure.ai.voiceagents.models.VoiceAgentMcpApprovalMode": "Azure.AI.Projects.VoiceAgentMcpApprovalMode", - "azure.ai.voiceagents.models.VoiceAgentSessionIncludeOption": "Azure.AI.Projects.VoiceAgentSessionIncludeOption", - "azure.ai.voiceagents.models.VoiceAgentHandoffReasoningEffort": "Azure.AI.Projects.VoiceAgentHandoffReasoningEffort", - "azure.ai.voiceagents.models.VoiceAgentHandoffTargetResponse": "Azure.AI.Projects.VoiceAgentHandoffTargetResponse", - "azure.ai.voiceagents.models.RealtimeServerEventType": "OpenAI.RealtimeServerEventType", - "azure.ai.voiceagents.models.VoiceAgentWebSearchCallStatus": "Azure.AI.Projects.VoiceAgentWebSearchCallStatus", - "azure.ai.voiceagents.models.VoiceAgentFileSearchCallStatus": "Azure.AI.Projects.VoiceAgentFileSearchCallStatus", - "azure.ai.voiceagents.models.CreateTranscriptionResponseJsonUsageType": "OpenAI.CreateTranscriptionResponseJsonUsageType", - "azure.ai.voiceagents.models.VoiceAgentResponseStatus": "Azure.AI.Projects.VoiceAgentResponseStatus", - "azure.ai.voiceagents.models.VoiceAgentEstimatedCostStatus": "Azure.AI.Projects.VoiceAgentEstimatedCostStatus", - "azure.ai.voiceagents.models.VoiceAgentResponseAudioFormat": "Azure.AI.Projects.VoiceAgentResponseAudioFormat", - "azure.ai.voiceagents.models.VoiceAgentPipelineFamily": "Azure.AI.Projects.VoiceAgentPipelineFamily", - "azure.ai.voiceagents.models.VoiceAgentHandoffAbortReason": "Azure.AI.Projects.VoiceAgentHandoffAbortReason", - "azure.ai.voiceagents.operations.VoiceAgentWebSocketOperations.connect_voice_agent": "Azure.AI.Projects.VoiceAgentWebSocket.connectVoiceAgent", - "azure.ai.voiceagents.aio.operations.VoiceAgentWebSocketOperations.connect_voice_agent": "Azure.AI.Projects.VoiceAgentWebSocket.connectVoiceAgent", - "azure.ai.voiceagents.operations.AgentEndpointConversationsOperations.get_agent_conversation": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversation", - "azure.ai.voiceagents.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversation", - "azure.ai.voiceagents.operations.AgentEndpointConversationsOperations.delete_agent_conversation": "Azure.AI.Projects.AgentEndpointConversations.deleteAgentConversation", - "azure.ai.voiceagents.aio.operations.AgentEndpointConversationsOperations.delete_agent_conversation": "Azure.AI.Projects.AgentEndpointConversations.deleteAgentConversation", - "azure.ai.voiceagents.operations.AgentEndpointConversationsOperations.list_agent_conversation_responses": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversationResponses", - "azure.ai.voiceagents.aio.operations.AgentEndpointConversationsOperations.list_agent_conversation_responses": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversationResponses", - "azure.ai.voiceagents.operations.AgentEndpointConversationsOperations.get_agent_conversation_response": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationResponse", - "azure.ai.voiceagents.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_response": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationResponse", - "azure.ai.voiceagents.operations.AgentEndpointConversationsOperations.list_agent_conversation_response_items": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversationResponseItems", - "azure.ai.voiceagents.aio.operations.AgentEndpointConversationsOperations.list_agent_conversation_response_items": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversationResponseItems", - "azure.ai.voiceagents.operations.AgentEndpointConversationsOperations.list_agent_conversation_items": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversationItems", - "azure.ai.voiceagents.aio.operations.AgentEndpointConversationsOperations.list_agent_conversation_items": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversationItems", - "azure.ai.voiceagents.operations.AgentEndpointConversationsOperations.get_agent_conversation_item": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItem", - "azure.ai.voiceagents.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_item": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItem", - "azure.ai.voiceagents.operations.AgentEndpointConversationsOperations.get_agent_conversation_item_audio": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItemAudio", - "azure.ai.voiceagents.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_item_audio": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItemAudio", - "azure.ai.voiceagents.operations.AgentEndpointConversationsOperations.get_agent_conversation_item_audio_content": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItemAudioContent", - "azure.ai.voiceagents.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_item_audio_content": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItemAudioContent", - "azure.ai.voiceagents.operations.AgentEndpointConversationsOperations.get_agent_conversation_audio": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationAudio", - "azure.ai.voiceagents.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_audio": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationAudio", - "azure.ai.voiceagents.operations.AgentEndpointConversationsOperations.get_agent_conversation_audio_content": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationAudioContent", - "azure.ai.voiceagents.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_audio_content": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationAudioContent", - "azure.ai.voiceagents.operations.VoiceAgentsOperations.create_voice_agent": "Azure.AI.Projects.VoiceAgents.createVoiceAgent", - "azure.ai.voiceagents.aio.operations.VoiceAgentsOperations.create_voice_agent": "Azure.AI.Projects.VoiceAgents.createVoiceAgent", - "azure.ai.voiceagents.operations.VoiceAgentsOperations.list_voice_agents": "Azure.AI.Projects.VoiceAgents.listVoiceAgents", - "azure.ai.voiceagents.aio.operations.VoiceAgentsOperations.list_voice_agents": "Azure.AI.Projects.VoiceAgents.listVoiceAgents", - "azure.ai.voiceagents.operations.VoiceAgentsOperations.get_voice_agent": "Azure.AI.Projects.VoiceAgents.getVoiceAgent", - "azure.ai.voiceagents.aio.operations.VoiceAgentsOperations.get_voice_agent": "Azure.AI.Projects.VoiceAgents.getVoiceAgent", - "azure.ai.voiceagents.operations.VoiceAgentsOperations.update_voice_agent": "Azure.AI.Projects.VoiceAgents.updateVoiceAgent", - "azure.ai.voiceagents.aio.operations.VoiceAgentsOperations.update_voice_agent": "Azure.AI.Projects.VoiceAgents.updateVoiceAgent", - "azure.ai.voiceagents.operations.VoiceAgentsOperations.delete_voice_agent": "Azure.AI.Projects.VoiceAgents.deleteVoiceAgent", - "azure.ai.voiceagents.aio.operations.VoiceAgentsOperations.delete_voice_agent": "Azure.AI.Projects.VoiceAgents.deleteVoiceAgent", - "azure.ai.voiceagents.operations.VoiceAgentsOperations.enable_voice_agent": "Azure.AI.Projects.VoiceAgents.enableVoiceAgent", - "azure.ai.voiceagents.aio.operations.VoiceAgentsOperations.enable_voice_agent": "Azure.AI.Projects.VoiceAgents.enableVoiceAgent", - "azure.ai.voiceagents.operations.VoiceAgentsOperations.disable_voice_agent": "Azure.AI.Projects.VoiceAgents.disableVoiceAgent", - "azure.ai.voiceagents.aio.operations.VoiceAgentsOperations.disable_voice_agent": "Azure.AI.Projects.VoiceAgents.disableVoiceAgent", - "azure.ai.voiceagents.operations.VoiceAgentsOperations.generate_voice_agent": "Azure.AI.Projects.VoiceAgents.generateVoiceAgent", - "azure.ai.voiceagents.aio.operations.VoiceAgentsOperations.generate_voice_agent": "Azure.AI.Projects.VoiceAgents.generateVoiceAgent", - "azure.ai.voiceagents.operations.VoiceAgentsOperations.create_voice_agent_version": "Azure.AI.Projects.VoiceAgents.createVoiceAgentVersion", - "azure.ai.voiceagents.aio.operations.VoiceAgentsOperations.create_voice_agent_version": "Azure.AI.Projects.VoiceAgents.createVoiceAgentVersion", - "azure.ai.voiceagents.operations.VoiceAgentsOperations.list_voice_agent_versions": "Azure.AI.Projects.VoiceAgents.listVoiceAgentVersions", - "azure.ai.voiceagents.aio.operations.VoiceAgentsOperations.list_voice_agent_versions": "Azure.AI.Projects.VoiceAgents.listVoiceAgentVersions", - "azure.ai.voiceagents.operations.VoiceAgentsOperations.get_voice_agent_version": "Azure.AI.Projects.VoiceAgents.getVoiceAgentVersion", - "azure.ai.voiceagents.aio.operations.VoiceAgentsOperations.get_voice_agent_version": "Azure.AI.Projects.VoiceAgents.getVoiceAgentVersion", - "azure.ai.voiceagents.operations.VoiceAgentsOperations.delete_voice_agent_version": "Azure.AI.Projects.VoiceAgents.deleteVoiceAgentVersion", - "azure.ai.voiceagents.aio.operations.VoiceAgentsOperations.delete_voice_agent_version": "Azure.AI.Projects.VoiceAgents.deleteVoiceAgentVersion" - }, - "CrossLanguageVersion": "a102b6cbed5d" -} \ No newline at end of file diff --git a/sdk/voiceagents/azure-ai-voiceagents/assets.json b/sdk/voiceagents/azure-ai-voiceagents/assets.json deleted file mode 100644 index 703d21fc1f3a..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "python", - "TagPrefix": "python/voiceagents/azure-ai-voiceagents", - "Tag": "python/voiceagents/azure-ai-voiceagents_d69733ae81" -} diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/__init__.py b/sdk/voiceagents/azure-ai-voiceagents/azure/__init__.py deleted file mode 100644 index d55ccad1f573..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/__init__.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/__init__.py deleted file mode 100644 index d55ccad1f573..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/__init__.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/__init__.py deleted file mode 100644 index 99bf20879f5b..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/__init__.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._client import VoiceAgentsClient # type: ignore -from ._version import VERSION - -__version__ = VERSION - -try: - from ._patch import __all__ as _patch_all - from ._patch import * -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "VoiceAgentsClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore - -_patch_sdk() diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_client.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_client.py deleted file mode 100644 index a1672ba29f30..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_client.py +++ /dev/null @@ -1,117 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -import sys -from typing import Any, TYPE_CHECKING - -from azure.core import PipelineClient -from azure.core.pipeline import policies -from azure.core.rest import HttpRequest, HttpResponse - -from ._configuration import VoiceAgentsClientConfiguration -from ._utils.serialization import Deserializer, Serializer -from .operations import AgentEndpointConversationsOperations, VoiceAgentsOperations - -if sys.version_info >= (3, 11): - from typing import Self -else: - from typing_extensions import Self # type: ignore - -if TYPE_CHECKING: - from azure.core.credentials import TokenCredential - - -class VoiceAgentsClient: # pylint: disable=docstring-keyword-should-match-keyword-only - """VoiceAgentsClient. - - :ivar agent_endpoint_conversations: AgentEndpointConversationsOperations operations - :vartype agent_endpoint_conversations: - azure.ai.voiceagents.operations.AgentEndpointConversationsOperations - :ivar voice_agents: VoiceAgentsOperations operations - :vartype voice_agents: azure.ai.voiceagents.operations.VoiceAgentsOperations - :param endpoint: Foundry Project endpoint in the form - "https://{ai-services-account-name}.services.ai.azure.com/api/projects/{project-name}". If you - only have one Project in your Foundry Hub, or to target the default Project in your Hub, use - the form "https://{ai-services-account-name}.services.ai.azure.com/api/projects/_project". - Required. - :type endpoint: str - :param credential: Credential used to authenticate requests to the service. Required. - :type credential: ~azure.core.credentials.TokenCredential - :keyword api_version: The API version to use for this operation. Known values are "v1" and - None. Default value is None. If not set, the operation's default API version will be used. Note - that overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None: - _endpoint = "{endpoint}" - self._config = VoiceAgentsClientConfiguration(endpoint=endpoint, credential=credential, **kwargs) - - _policies = kwargs.pop("policies", None) - if _policies is None: - _policies = [ - policies.RequestIdPolicy(**kwargs), - self._config.headers_policy, - self._config.user_agent_policy, - self._config.proxy_policy, - policies.ContentDecodePolicy(**kwargs), - self._config.redirect_policy, - self._config.retry_policy, - self._config.authentication_policy, - self._config.custom_hook_policy, - self._config.logging_policy, - policies.DistributedTracingPolicy(**kwargs), - policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, - self._config.http_logging_policy, - ] - self._client: PipelineClient = PipelineClient(base_url=_endpoint, policies=_policies, **kwargs) - - self._serialize = Serializer() - self._deserialize = Deserializer() - self._serialize.client_side_validation = False - self.agent_endpoint_conversations = AgentEndpointConversationsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.voice_agents = VoiceAgentsOperations(self._client, self._config, self._serialize, self._deserialize) - - def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = client.send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - - request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) - return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore - - def close(self) -> None: - self._client.close() - - def __enter__(self) -> Self: - self._client.__enter__() - return self - - def __exit__(self, *exc_details: Any) -> None: - self._client.__exit__(*exc_details) diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_configuration.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_configuration.py deleted file mode 100644 index 6f48c8a3aec0..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_configuration.py +++ /dev/null @@ -1,69 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.pipeline import policies - -from ._version import VERSION - -if TYPE_CHECKING: - from azure.core.credentials import TokenCredential - - -class VoiceAgentsClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only - """Configuration for VoiceAgentsClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param endpoint: Foundry Project endpoint in the form - "https://{ai-services-account-name}.services.ai.azure.com/api/projects/{project-name}". If you - only have one Project in your Foundry Hub, or to target the default Project in your Hub, use - the form "https://{ai-services-account-name}.services.ai.azure.com/api/projects/_project". - Required. - :type endpoint: str - :param credential: Credential used to authenticate requests to the service. Required. - :type credential: ~azure.core.credentials.TokenCredential - :keyword api_version: The API version to use for this operation. Known values are "v1" and - None. Default value is None. If not set, the operation's default API version will be used. Note - that overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "v1") - - if endpoint is None: - raise ValueError("Parameter 'endpoint' must not be None.") - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - - self.endpoint = endpoint - self.credential = credential - self.api_version = api_version - self.credential_scopes = kwargs.pop("credential_scopes", ["https://ai.azure.com/.default"]) - kwargs.setdefault("sdk_moniker", "ai-voiceagents/{}".format(VERSION)) - self.polling_interval = kwargs.get("polling_interval", 30) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = policies.BearerTokenCredentialPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_patch.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_patch.py deleted file mode 100644 index 87676c65a8f0..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_patch.py +++ /dev/null @@ -1,21 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------- -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" - - -__all__: list[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_unions.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_unions.py deleted file mode 100644 index 84c462f4931b..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_unions.py +++ /dev/null @@ -1,71 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Literal, TYPE_CHECKING, Union - -if TYPE_CHECKING: - from . import models as _models -VoiceResponseVoice = Union["_models.OpenAIVoice", "_models.AzureVoice", "_models.AzureRealtimeNativeVoice"] -VoiceAgentVoice = Union["_models.OpenAIVoice", "_models.AzureVoice", "_models.AzureRealtimeNativeVoice"] -VoiceAgentTool = Union[ - "_models.RealtimeFunctionTool", "_models.VoiceAgentMcpTool", "_models.VoiceSystemTool", "_models.VoiceToolboxTool" -] -VoiceAgentRequestConversationItem = Union[ - "_models.RealtimeConversationItemMessageSystem", - "_models.RealtimeConversationItemMessageUser", - "_models.RealtimeConversationItemMessageAssistant", - "_models.RealtimeConversationItemFunctionCall", - "_models.RealtimeConversationItemFunctionCallOutput", -] -VoiceAgentCreateConversationItem = Union[ - "VoiceAgentRequestConversationItem", "_models.RealtimeMCPApprovalResponse" -] -VoiceAgentInterimResponse = Union[ - "_models.VoiceAgentStaticInterimResponseConfig", "_models.VoiceAgentLlmInterimResponseConfig" -] -VoiceAgentTurnDetection = Union[ - "_models.VoiceAgentServerVadTurnDetection", - "_models.VoiceAgentSemanticVadTurnDetection", - "_models.VoiceAgentAzureSemanticVadTurnDetection", - "_models.VoiceAgentAzureMultilingualSemanticVadTurnDetection", -] -VoiceAgentMaxOutputTokens = Union[int, Literal["inf"]] -VoiceAgentMcpApprovalPolicy = Union[str, "_models.VoiceAgentMcpApprovalMode", dict[str, list[str]]] -VoiceAgentSessionTool = Union[ - "_models.RealtimeFunctionTool", - "_models.VoiceAgentSessionMcpTool", - "_models.VoiceToolboxTool", - "_models.VoiceSystemTool", -] -VoiceAgentToolChoice = Union[str, "_models.ToolChoiceOptions", "_models.RealtimeToolChoiceFunction"] -VoiceAgentResponseMessageItem = Union[ - "_models.RealtimeConversationItemMessageSystem", - "_models.RealtimeConversationItemMessageUser", - "_models.RealtimeConversationItemMessageAssistant", -] -VoiceAgentWebSearchAction = Union[ - "_models.VoiceAgentWebSearchActionSearch", - "_models.VoiceAgentWebSearchActionOpenPage", - "_models.VoiceAgentWebSearchActionFind", -] -VoiceAgentFileSearchAttributeValue = Union[str, float, bool] -VoiceAgentResponseItem = Union[ - "VoiceAgentResponseMessageItem", - "_models.VoiceFunctionCallItem", - "_models.VoiceFunctionCallOutputItem", - "_models.VoiceMcpListToolsItem", - "_models.VoiceMcpCallItem", - "_models.VoiceMcpApprovalRequestItem", - "_models.VoiceMcpApprovalResponseItem", - "_models.VoiceAgentWorkflowActionItem", - "_models.VoiceAgentWebSearchCallItem", - "_models.VoiceAgentFileSearchCallItem", -] -VoiceAgentResponseEventContentPart = Union[ - "_models.VoiceAgentResponseEventTextContentPart", "_models.VoiceAgentResponseEventAudioContentPart" -] diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_utils/__init__.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_utils/__init__.py deleted file mode 100644 index 8026245c2abc..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_utils/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_utils/model_base.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_utils/model_base.py deleted file mode 100644 index 35d5fc024978..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_utils/model_base.py +++ /dev/null @@ -1,1787 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=protected-access, broad-except - -import copy -import calendar -import decimal -import functools -import sys -import logging -import base64 -import re -import typing -import enum -import email.utils -from datetime import datetime, date, time, timedelta, timezone -from json import JSONEncoder -import xml.etree.ElementTree as ET -from collections.abc import MutableMapping -import isodate -from azure.core.exceptions import DeserializationError -from azure.core import CaseInsensitiveEnumMeta -from azure.core.pipeline import PipelineResponse -from azure.core.serialization import _Null - -from azure.core.rest import HttpResponse - -if sys.version_info >= (3, 11): - from typing import Self -else: - from typing_extensions import Self - -_LOGGER = logging.getLogger(__name__) - -__all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] - -TZ_UTC = timezone.utc -_T = typing.TypeVar("_T") -_NONE_TYPE = type(None) - - -def _timedelta_as_isostr(td: timedelta) -> str: - """Converts a datetime.timedelta object into an ISO 8601 formatted string, e.g. 'P4DT12H30M05S' - - Function adapted from the Tin Can Python project: https://github.com/RusticiSoftware/TinCanPython - - :param timedelta td: The timedelta to convert - :rtype: str - :return: ISO8601 version of this timedelta - """ - - # Split seconds to larger units - seconds = td.total_seconds() - minutes, seconds = divmod(seconds, 60) - hours, minutes = divmod(minutes, 60) - days, hours = divmod(hours, 24) - - days, hours, minutes = list(map(int, (days, hours, minutes))) - seconds = round(seconds, 6) - - # Build date - date_str = "" - if days: - date_str = "%sD" % days - - if hours or minutes or seconds: - # Build time - time_str = "T" - - # Hours - bigger_exists = date_str or hours - if bigger_exists: - time_str += "{:02}H".format(hours) - - # Minutes - bigger_exists = bigger_exists or minutes - if bigger_exists: - time_str += "{:02}M".format(minutes) - - # Seconds - try: - if seconds.is_integer(): - seconds_string = "{:02}".format(int(seconds)) - else: - # 9 chars long w/ leading 0, 6 digits after decimal - seconds_string = "%09.6f" % seconds - # Remove trailing zeros - seconds_string = seconds_string.rstrip("0") - except AttributeError: # int.is_integer() raises - seconds_string = "{:02}".format(seconds) - - time_str += "{}S".format(seconds_string) - else: - time_str = "" - - return "P" + date_str + time_str - - -def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: - encoded = base64.b64encode(o).decode() - if format == "base64url": - return encoded.strip("=").replace("+", "-").replace("/", "_") - return encoded - - -def _serialize_duration(td: timedelta, format: typing.Optional[str] = None): - """Serialize a timedelta to its wire representation. - - For the ``seconds``/``milliseconds`` encodings the value is converted to a - numeric value, otherwise it falls back to an ISO 8601 duration string. - - :param timedelta td: The timedelta to serialize. - :param str format: The duration encoding format. - :rtype: int or float or str - :return: serialized duration - """ - seconds = td.total_seconds() - if format == "duration-seconds-int": - return int(seconds) - if format == "duration-seconds-float": - return seconds - if format == "duration-milliseconds-int": - return int(seconds * 1000) - if format == "duration-milliseconds-float": - return seconds * 1000 - return _timedelta_as_isostr(td) - - -def _serialize_datetime(o, format: typing.Optional[str] = None): - if hasattr(o, "year") and hasattr(o, "hour"): - if format == "rfc7231": - return email.utils.format_datetime(o, usegmt=True) - if format == "unix-timestamp": - return int(calendar.timegm(o.utctimetuple())) - - # astimezone() fails for naive times in Python 2.7, so make make sure o is aware (tzinfo is set) - if not o.tzinfo: - iso_formatted = o.replace(tzinfo=TZ_UTC).isoformat() - else: - iso_formatted = o.astimezone(TZ_UTC).isoformat() - # Replace the trailing "+00:00" UTC offset with "Z" (RFC 3339: https://www.ietf.org/rfc/rfc3339.txt) - return iso_formatted.replace("+00:00", "Z") - # Next try datetime.date or datetime.time - return o.isoformat() - - -def _is_readonly(p): - try: - return p._visibility == ["read"] - except AttributeError: - return False - - -class SdkJSONEncoder(JSONEncoder): - """A JSON encoder that's capable of serializing datetime objects and bytes. - - :param args: Additional positional arguments passed to the base ``JSONEncoder``. - :type args: typing.Any - :keyword exclude_readonly: Whether to exclude readonly properties. Defaults to False. - :paramtype exclude_readonly: bool - :keyword format: The format to use for serialization. Defaults to None. - :paramtype format: typing.Optional[str] - """ - - def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): - super().__init__(*args, **kwargs) - self.exclude_readonly = exclude_readonly - self.format = format - - def default(self, o): # pylint: disable=too-many-return-statements - if _is_model(o): - if self.exclude_readonly: - readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] - return {k: v for k, v in o.items() if k not in readonly_props} - return dict(o.items()) - try: - return super(SdkJSONEncoder, self).default(o) - except TypeError: - if isinstance(o, _Null): - return None - if isinstance(o, decimal.Decimal): - return float(o) - if isinstance(o, (bytes, bytearray)): - return _serialize_bytes(o, self.format) - try: - # First try datetime.datetime - return _serialize_datetime(o, self.format) - except AttributeError: - pass - # Last, try datetime.timedelta - try: - return _timedelta_as_isostr(o) - except AttributeError: - # This will be raised when it hits value.total_seconds in the method above - pass - return super(SdkJSONEncoder, self).default(o) - - -_VALID_DATE = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" + r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") -_VALID_RFC7231 = re.compile( - r"(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s\d{2}\s" - r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" -) - -_ARRAY_ENCODE_MAPPING = { - "pipeDelimited": "|", - "spaceDelimited": " ", - "commaDelimited": ",", - "newlineDelimited": "\n", -} - - -def _deserialize_array_encoded(delimit: str, attr): - if isinstance(attr, str): - if attr == "": - return [] - return attr.split(delimit) - return attr - - -def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: - """Deserialize ISO-8601 formatted string into Datetime object. - - :param str attr: response string to be deserialized. - :rtype: ~datetime.datetime - :returns: The datetime object from that input - """ - if isinstance(attr, datetime): - # i'm already deserialized - return attr - attr = attr.upper() - match = _VALID_DATE.match(attr) - if not match: - raise ValueError("Invalid datetime string: " + attr) - - check_decimal = attr.split(".") - if len(check_decimal) > 1: - decimal_str = "" - for digit in check_decimal[1]: - if digit.isdigit(): - decimal_str += digit - else: - break - if len(decimal_str) > 6: - attr = attr.replace(decimal_str, decimal_str[0:6]) - - date_obj = isodate.parse_datetime(attr) - test_utc = date_obj.utctimetuple() - if test_utc.tm_year > 9999 or test_utc.tm_year < 1: - raise OverflowError("Hit max or min date") - return date_obj # type: ignore[no-any-return] - - -def _deserialize_datetime_rfc7231(attr: typing.Union[str, datetime]) -> datetime: - """Deserialize RFC7231 formatted string into Datetime object. - - :param str attr: response string to be deserialized. - :rtype: ~datetime.datetime - :returns: The datetime object from that input - """ - if isinstance(attr, datetime): - # i'm already deserialized - return attr - match = _VALID_RFC7231.match(attr) - if not match: - raise ValueError("Invalid datetime string: " + attr) - - return email.utils.parsedate_to_datetime(attr) - - -def _deserialize_datetime_unix_timestamp(attr: typing.Union[float, datetime]) -> datetime: - """Deserialize unix timestamp into Datetime object. - - :param str attr: response string to be deserialized. - :rtype: ~datetime.datetime - :returns: The datetime object from that input - """ - if isinstance(attr, datetime): - # i'm already deserialized - return attr - return datetime.fromtimestamp(attr, TZ_UTC) - - -def _deserialize_date(attr: typing.Union[str, date]) -> date: - """Deserialize ISO-8601 formatted string into Date object. - :param str attr: response string to be deserialized. - :rtype: date - :returns: The date object from that input - """ - # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. - if isinstance(attr, date): - return attr - return isodate.parse_date(attr, defaultmonth=None, defaultday=None) # type: ignore - - -def _deserialize_time(attr: typing.Union[str, time]) -> time: - """Deserialize ISO-8601 formatted string into time object. - - :param str attr: response string to be deserialized. - :rtype: datetime.time - :returns: The time object from that input - """ - if isinstance(attr, time): - return attr - return isodate.parse_time(attr) # type: ignore[no-any-return] - - -def _deserialize_bytes(attr): - if isinstance(attr, (bytes, bytearray)): - return attr - return bytes(base64.b64decode(attr)) - - -def _deserialize_bytes_base64(attr): - if isinstance(attr, (bytes, bytearray)): - return attr - padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore - attr = attr + padding # type: ignore - encoded = attr.replace("-", "+").replace("_", "/") - return bytes(base64.b64decode(encoded)) - - -def _deserialize_duration(attr): - if isinstance(attr, timedelta): - return attr - return isodate.parse_duration(attr) - - -def _deserialize_duration_numeric(attr, unit): - if isinstance(attr, timedelta): - return attr - return timedelta(**{unit: float(attr)}) - - -def _deserialize_decimal(attr): - if isinstance(attr, decimal.Decimal): - return attr - return decimal.Decimal(str(attr)) - - -def _deserialize_int_as_str(attr): - if isinstance(attr, int): - return attr - return int(attr) - - -def _deserialize_bool_as_str(attr): - if isinstance(attr, bool): - return attr - return attr.lower() == "true" - - -_DESERIALIZE_MAPPING = { - datetime: _deserialize_datetime, - date: _deserialize_date, - time: _deserialize_time, - bytes: _deserialize_bytes, - bytearray: _deserialize_bytes, - timedelta: _deserialize_duration, - typing.Any: lambda x: x, - decimal.Decimal: _deserialize_decimal, -} - -_DESERIALIZE_MAPPING_WITHFORMAT = { - "rfc3339": _deserialize_datetime, - "rfc7231": _deserialize_datetime_rfc7231, - "unix-timestamp": _deserialize_datetime_unix_timestamp, - "base64": _deserialize_bytes, - "base64url": _deserialize_bytes_base64, - "duration-seconds-int": functools.partial(_deserialize_duration_numeric, unit="seconds"), - "duration-seconds-float": functools.partial(_deserialize_duration_numeric, unit="seconds"), - "duration-milliseconds-int": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), - "duration-milliseconds-float": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), -} - - -def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): - if annotation is int and rf and rf._format == "str": - return _deserialize_int_as_str - if annotation is bool and rf and rf._format == "str": - return _deserialize_bool_as_str - if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: - return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) - if rf and rf._format: - return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) - return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore - - -def _get_type_alias_type(module_name: str, alias_name: str): - types = { - k: v - for k, v in sys.modules[module_name].__dict__.items() - if isinstance(v, typing._GenericAlias) # type: ignore - } - if alias_name not in types: - return alias_name - return types[alias_name] - - -def _get_model(module_name: str, model_name: str): - models = {k: v for k, v in sys.modules[module_name].__dict__.items() if isinstance(v, type)} - module_end = module_name.rsplit(".", 1)[0] - models.update({k: v for k, v in sys.modules[module_end].__dict__.items() if isinstance(v, type)}) - if isinstance(model_name, str): - model_name = model_name.split(".")[-1] - if model_name not in models: - return model_name - return models[model_name] - - -_UNSET = object() - - -class _MyMutableMapping(MutableMapping[str, typing.Any]): - def __init__(self, data: dict[str, typing.Any]) -> None: - self._data = data - - def __contains__(self, key: typing.Any) -> bool: - return key in self._data - - def __getitem__(self, key: str) -> typing.Any: - # If this key has been deserialized (for mutable types), we need to handle serialization - if hasattr(self, "_attr_to_rest_field"): - cache_attr = f"_deserialized_{key}" - if hasattr(self, cache_attr): - rf = _get_rest_field(getattr(self, "_attr_to_rest_field"), key) - if rf: - value = self._data.get(key) - if isinstance(value, (dict, list, set)): - # For mutable types, serialize and return - # But also update _data with serialized form and clear flag - # so mutations via this returned value affect _data - serialized = _serialize(value, rf._format) - # If serialized form is same type (no transformation needed), - # return _data directly so mutations work - if isinstance(serialized, type(value)) and serialized == value: - return self._data.get(key) - # Otherwise return serialized copy and clear flag - try: - object.__delattr__(self, cache_attr) - except AttributeError: - pass - # Store serialized form back - self._data[key] = serialized - return serialized - return self._data.__getitem__(key) - - def __setitem__(self, key: str, value: typing.Any) -> None: - # Clear any cached deserialized value when setting through dictionary access - cache_attr = f"_deserialized_{key}" - try: - object.__delattr__(self, cache_attr) - except AttributeError: - pass - self._data.__setitem__(key, value) - - def __delitem__(self, key: str) -> None: - self._data.__delitem__(key) - - def __iter__(self) -> typing.Iterator[typing.Any]: - return self._data.__iter__() - - def __len__(self) -> int: - return self._data.__len__() - - def __ne__(self, other: typing.Any) -> bool: - return not self.__eq__(other) - - def keys(self) -> typing.KeysView[str]: - """ - :returns: a set-like object providing a view on the mapping's keys - :rtype: ~typing.KeysView - """ - return self._data.keys() - - def values(self) -> typing.ValuesView[typing.Any]: - """ - :returns: an object providing a view on the mapping's values - :rtype: ~typing.ValuesView - """ - return self._data.values() - - def items(self) -> typing.ItemsView[str, typing.Any]: - """ - :returns: a set-like object providing a view on the mapping's items - :rtype: ~typing.ItemsView - """ - return self._data.items() - - def get(self, key: str, default: typing.Any = None) -> typing.Any: - """ - Get the value for key if key is in the dictionary, else default. - :param str key: The key to look up. - :param any default: The value to return if key is not in the dictionary. Defaults to None - :returns: The value for key if key is in the dictionary, else default. - :rtype: any - """ - try: - return self[key] - except KeyError: - return default - - @typing.overload - def pop(self, key: str) -> typing.Any: ... # pylint: disable=arguments-differ - - @typing.overload - def pop(self, key: str, default: _T) -> _T: ... # pylint: disable=signature-differs - - @typing.overload - def pop(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs - - def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: - """ - Removes specified key and return the corresponding value. - :param str key: The key to pop. - :param any default: The value to return if key is not in the dictionary - :returns: The value corresponding to the key. - :rtype: any - :raises KeyError: If key is not found and default is not given. - """ - if default is _UNSET: - return self._data.pop(key) - return self._data.pop(key, default) - - def popitem(self) -> tuple[str, typing.Any]: - """ - Removes and returns some (key, value) pair - :returns: The (key, value) pair. - :rtype: tuple - :raises KeyError: if the dictionary is empty. - """ - return self._data.popitem() - - def clear(self) -> None: - """ - Remove all items from the dictionary. - """ - self._data.clear() - - def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ - """ - Update the dictionary from a mapping or an iterable of key-value pairs. - :param any args: Either a mapping object or an iterable of key-value pairs. - """ - self._data.update(*args, **kwargs) - - @typing.overload - def setdefault(self, key: str, default: None = None) -> None: ... - - @typing.overload - def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs - - def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: - """ - Return the value for key if key is in the dictionary; otherwise set the key to - default and return default. - :param str key: The key to look up. - :param any default: The value to set if key is not in the dictionary - :returns: The value for key if key is in the dictionary, else default. - :rtype: any - """ - if default is _UNSET: - return self._data.setdefault(key) - return self._data.setdefault(key, default) - - def __eq__(self, other: typing.Any) -> bool: - if isinstance(other, _MyMutableMapping): - return self._data == other._data - try: - other_model = self.__class__(other) - except Exception: - return False - return self._data == other_model._data - - def __repr__(self) -> str: - return str(self._data) - - -def _is_model(obj: typing.Any) -> bool: - return getattr(obj, "_is_model", False) - - -def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements - if isinstance(o, list): - if format in _ARRAY_ENCODE_MAPPING and all(isinstance(x, str) for x in o): - return _ARRAY_ENCODE_MAPPING[format].join(o) - return [_serialize(x, format) for x in o] - if isinstance(o, dict): - return {k: _serialize(v, format) for k, v in o.items()} - if isinstance(o, set): - return {_serialize(x, format) for x in o} - if isinstance(o, tuple): - return tuple(_serialize(x, format) for x in o) - if isinstance(o, (bytes, bytearray)): - return _serialize_bytes(o, format) - if isinstance(o, decimal.Decimal): - return float(o) - if isinstance(o, enum.Enum): - return o.value - if isinstance(o, int): - if format == "str": - return str(o) - return o - try: - # First try datetime.datetime - return _serialize_datetime(o, format) - except AttributeError: - pass - # Last, try datetime.timedelta - try: - return _serialize_duration(o, format) - except AttributeError: - # This will be raised when it hits value.total_seconds in the method above - pass - return o - - -def _get_rest_field(attr_to_rest_field: dict[str, "_RestField"], rest_name: str) -> typing.Optional["_RestField"]: - try: - return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) - except StopIteration: - return None - - -def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typing.Any: - if not rf: - return _serialize(value, None) - if rf._is_multipart_file_input: - return value - if rf._is_model: - return _deserialize(rf._type, value) - if isinstance(value, ET.Element): - value = _deserialize(rf._type, value) - return _serialize(value, rf._format) - - -# ============================================================================ -# Fast-path scalar deserializer functions for rest_field(deserializer=...) -# These are referenced from rest_field declarations to bypass the generic -# _deserialize -> _deserialize_with_callable chain. -# Only simple/primitive types — no models or container types. -# ============================================================================ - - -def _xml_deser_str(value): - if isinstance(value, ET.Element): - return value.text or "" - return str(value) if value is not None else None - - -def _xml_deser_int(value): - if isinstance(value, ET.Element): - return int(value.text) if value.text else None - return int(value) if value is not None else None - - -def _xml_deser_float(value): - if isinstance(value, ET.Element): - return float(value.text) if value.text else None - return float(value) if value is not None else None - - -def _xml_deser_bool(value): - if isinstance(value, ET.Element): - text = value.text - else: - text = value - if text is None: - return None - if text in (True, False): - return text - return text.lower() == "true" - - -# pylint: disable=docstring-missing-param -def _xml_deser_bytes(value): - """Deserialize bytes from XML (base64).""" - if isinstance(value, ET.Element): - text = value.text - else: - text = value - if text is None: - return None - return _deserialize_bytes(text) - - -def _xml_deser_bytes_base64url(value): - """Deserialize bytes from XML (base64url).""" - if isinstance(value, ET.Element): - text = value.text - else: - text = value - if text is None: - return None - return _deserialize_bytes_base64(text) - - -def _xml_deser_datetime(value): - """Deserialize a datetime from XML (ISO 8601 / rfc3339).""" - if isinstance(value, ET.Element): - text = value.text - else: - text = value - if text is None: - return None - return _deserialize_datetime(text) - - -def _xml_deser_datetime_rfc7231(value): - """Deserialize a datetime from XML (RFC7231 format).""" - if isinstance(value, ET.Element): - text = value.text - else: - text = value - if text is None: - return None - return _deserialize_datetime_rfc7231(text) - - -def _xml_deser_datetime_unix_timestamp(value): - """Deserialize a datetime from XML (Unix timestamp).""" - if isinstance(value, ET.Element): - text = value.text - else: - text = value - if text is None: - return None - return _deserialize_datetime_unix_timestamp(float(text)) - - -def _xml_deser_date(value): - """Deserialize a date from XML (ISO 8601).""" - if isinstance(value, ET.Element): - text = value.text - else: - text = value - if text is None: - return None - return _deserialize_date(text) - - -def _xml_deser_time(value): - """Deserialize a time from XML (ISO 8601).""" - if isinstance(value, ET.Element): - text = value.text - else: - text = value - if text is None: - return None - return _deserialize_time(text) - - -def _xml_deser_duration(value): - """Deserialize a timedelta from XML (ISO 8601 duration).""" - if isinstance(value, ET.Element): - text = value.text - else: - text = value - if text is None: - return None - return _deserialize_duration(text) - - -def _xml_deser_decimal(value): - """Deserialize a Decimal from XML.""" - if isinstance(value, ET.Element): - text = value.text - else: - text = value - if text is None: - return None - return _deserialize_decimal(text) - - -def _xml_deser_enum_or_str(enum_cls, value): - """Deserialize a Union[EnumType, str] from XML.""" - text = value.text if isinstance(value, ET.Element) else value - if text is None: - return None - try: - return enum_cls(text) - except ValueError: - return text - - -def _extract_xml_model_type(rf_type): - """Extract the concrete Model class from a resolved rf._type partial chain. - - Unwraps ``Optional[Model]`` and ``_deserialize_model(Model, ...)`` - wrappers. Only handles Model and Optional[Model] — other composite - types (List, Dict, Union, etc.) return None and fall through to the - generic ``_deserialize`` path at runtime. - """ - if rf_type is None: - return None - if isinstance(rf_type, type) and _is_model(rf_type): - return rf_type - if not isinstance(rf_type, functools.partial): - return None - func = rf_type.func - args = rf_type.args - if func is _deserialize_with_optional and args: - return _extract_xml_model_type(args[0]) - if func is _deserialize_model and args: - cls = args[0] - return cls if isinstance(cls, type) and _is_model(cls) else None - return None - - -def _build_xml_field_plan( # pylint: disable=docstring-missing-return, docstring-missing-rtype, unused-variable - cls, attr_to_rest_field: dict -) -> list: - """Build a precomputed XML field plan for fast _init_from_xml iteration. - - Called once per model class in __new__. Returns a list of tuples: - (rest_name, xml_name, kind, deser, rf_type, is_optional, items_name) - - kind: 0=wrapped, 1=attribute, 2=unwrapped, 3=text - - For Model and Optional[Model] fields that lack a scalar - ``_deserializer``, this function precomputes the Model class as the - deserializer so ``_init_from_xml`` can call ``ModelClass(element)`` - directly instead of going through the expensive - ``_get_deserialize_callable_from_annotation`` chain at runtime. - """ - model_meta = getattr(cls, "_xml", {}) - model_ns = model_meta.get("ns") or model_meta.get("namespace") - plan = [] - - for rf in attr_to_rest_field.values(): - prop_meta = getattr(rf, "_xml", {}) - deser = rf._deserializer - - xml_name = prop_meta.get("name", rf._rest_name) - xml_ns = _resolve_xml_ns(prop_meta, model_meta) - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - - is_optional = rf._is_optional - - # For Model / Optional[Model] fields without a scalar deserializer, - # precompute the Model class as the deserializer. - if deser is None and rf._type is not None: - model_cls = _extract_xml_model_type(rf._type) - if model_cls is not None: - deser = model_cls - - if prop_meta.get("attribute", False): - plan.append((rf._rest_name, xml_name, 1, deser, rf._type, is_optional, None)) - elif prop_meta.get("unwrapped", False): - items_name = prop_meta.get("itemsName") - if items_name: - items_ns = prop_meta.get("itemsNs") - if items_ns is not None: - xml_ns = items_ns - if xml_ns: - items_name = "{" + xml_ns + "}" + items_name - else: - items_name = xml_name - plan.append((rf._rest_name, xml_name, 2, deser, rf._type, is_optional, items_name)) - elif prop_meta.get("text", False): - plan.append((rf._rest_name, xml_name, 3, deser, rf._type, is_optional, None)) - else: - plan.append((rf._rest_name, xml_name, 0, deser, rf._type, is_optional, None)) - - return plan - - -# pylint: enable=docstring-missing-param -class Model(_MyMutableMapping): - _is_model = True - # label whether current class's _attr_to_rest_field has been calculated - # could not see _attr_to_rest_field directly because subclass inherits it from parent class - _calculated: set[str] = set() - - def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: - class_name = self.__class__.__name__ - if len(args) > 1: - raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") - dict_to_pass: dict[str, typing.Any] = {} - if args: - if isinstance(args[0], ET.Element): - dict_to_pass.update(self._init_from_xml(args[0])) - else: - dict_to_pass.update( - {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} - ) - else: - non_attr_kwargs = [k for k in kwargs if k not in self._attr_to_rest_field] - if non_attr_kwargs: - # actual type errors only throw the first wrong keyword arg they see, so following that. - raise TypeError(f"{class_name}.__init__() got an unexpected keyword argument '{non_attr_kwargs[0]}'") - dict_to_pass.update( - { - self._attr_to_rest_field[k]._rest_name: _create_value(self._attr_to_rest_field[k], v) - for k, v in kwargs.items() - if v is not None - } - ) - # Apply client default values for fields the caller didn't set so that - # defaults are part of `_data` and therefore included during serialization. - for rf in self._attr_to_rest_field.values(): - if rf._default is _UNSET: - continue - if rf._rest_name in dict_to_pass: - continue - dict_to_pass[rf._rest_name] = _create_value(rf, rf._default) - super().__init__(dict_to_pass) - - def _init_from_xml( # pylint: disable=too-many-branches, too-many-statements - self, element: ET.Element - ) -> dict[str, typing.Any]: - """Deserialize an XML element into a dict mapping rest field names to values. - - :param ET.Element element: The XML element to deserialize from. - :returns: A dictionary of rest_name to deserialized value pairs. - :rtype: dict - """ - result: dict[str, typing.Any] = {} - existed_attr_keys: list[str] = [] - - field_plan = getattr(self, "_xml_field_plan", None) - if field_plan: - for rest_name, xml_name, kind, deser, rf_type, is_optional, items_name in field_plan: - if kind == 0: # wrapped element (most common) - item = element.find(xml_name) - if item is not None: - existed_attr_keys.append(xml_name) - if deser: - result[rest_name] = deser(item) - else: - result[rest_name] = _deserialize(rf_type, item) - elif kind == 1: # attribute - attr_val = element.get(xml_name) - if attr_val is not None: - existed_attr_keys.append(xml_name) - if deser: - result[rest_name] = deser(attr_val) - else: - result[rest_name] = attr_val - elif kind == 2: # unwrapped array - items = element.findall(items_name) # pyright: ignore - if len(items) > 0: - existed_attr_keys.append(items_name) - if deser: - result[rest_name] = deser(items) - else: - result[rest_name] = _deserialize(rf_type, items) - elif not is_optional: - existed_attr_keys.append(items_name) - result[rest_name] = [] - elif kind == 3: # text - if element.text is not None: - if deser: - result[rest_name] = deser(element.text) - else: - result[rest_name] = element.text - else: - model_meta = getattr(self, "_xml", {}) - for rf in self._attr_to_rest_field.values(): - prop_meta = getattr(rf, "_xml", {}) - xml_name = prop_meta.get("name", rf._rest_name) - xml_ns = _resolve_xml_ns(prop_meta, model_meta) - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - - # attribute - if prop_meta.get("attribute", False) and element.get(xml_name) is not None: - existed_attr_keys.append(xml_name) - result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) - continue - - # unwrapped element is array - if prop_meta.get("unwrapped", False): - _items_name = prop_meta.get("itemsName") - if _items_name: - xml_name = _items_name - _items_ns = prop_meta.get("itemsNs") - if _items_ns is not None: - xml_ns = _items_ns - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - items = element.findall(xml_name) # pyright: ignore - if len(items) > 0: - existed_attr_keys.append(xml_name) - result[rf._rest_name] = _deserialize(rf._type, items) - elif not rf._is_optional: - existed_attr_keys.append(xml_name) - result[rf._rest_name] = [] - continue - - # text element is primitive type - if prop_meta.get("text", False): - if element.text is not None: - result[rf._rest_name] = _deserialize(rf._type, element.text) - continue - - # wrapped element could be normal property or array - item = element.find(xml_name) - if item is not None: - existed_attr_keys.append(xml_name) - result[rf._rest_name] = _deserialize(rf._type, item) - - # rest thing is additional properties - for e in element: - if e.tag not in existed_attr_keys: - result[e.tag] = _convert_element(e) - - return result - - def copy(self) -> "Model": - return Model(self.__dict__) - - def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: - if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated: - # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', - # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' - mros = cls.__mro__[:-9][::-1] # ignore parents, and reverse the mro order - attr_to_rest_field: dict[str, _RestField] = { # map attribute name to rest_field property - k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") - } - annotations = { - k: v - for mro_class in mros - if hasattr(mro_class, "__annotations__") - for k, v in mro_class.__annotations__.items() - } - for attr, rf in attr_to_rest_field.items(): - rf._module = cls.__module__ - if not rf._type: - rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) - if not rf._rest_name_input: - rf._rest_name_input = attr - cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) - # Build XML field plan for fast _init_from_xml (only for XML models) - if getattr(cls, "_xml", None): - cls._xml_field_plan = _build_xml_field_plan(cls, attr_to_rest_field) - cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") - - return super().__new__(cls) - - def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: - for base in cls.__bases__: - if hasattr(base, "__mapping__"): - base.__mapping__[discriminator or cls.__name__] = cls # type: ignore - - @classmethod - def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: - for v in cls.__dict__.values(): - if isinstance(v, _RestField) and v._is_discriminator and v._rest_name not in exist_discriminators: - return v - return None - - @classmethod - def _deserialize(cls, data, exist_discriminators): - if not hasattr(cls, "__mapping__"): - return cls(data) - discriminator = cls._get_discriminator(exist_discriminators) - if discriminator is None: - return cls(data) - exist_discriminators.append(discriminator._rest_name) - if isinstance(data, ET.Element): - model_meta = getattr(cls, "_xml", {}) - prop_meta = getattr(discriminator, "_xml", {}) - xml_name = prop_meta.get("name", discriminator._rest_name) - xml_ns = _resolve_xml_ns(prop_meta, model_meta) - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - - if data.get(xml_name) is not None: - discriminator_value = data.get(xml_name) - else: - discriminator_value = data.find(xml_name).text # pyright: ignore - else: - discriminator_value = data.get(discriminator._rest_name) - mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member - return mapped_cls._deserialize(data, exist_discriminators) - - def as_dict(self, *, exclude_readonly: bool = False) -> dict[str, typing.Any]: - """Return a dict that can be turned into json using json.dump. - - :keyword bool exclude_readonly: Whether to remove the readonly properties. - :returns: A dict JSON compatible object - :rtype: dict - """ - - result = {} - readonly_props = [] - if exclude_readonly: - readonly_props = [p._rest_name for p in self._attr_to_rest_field.values() if _is_readonly(p)] - for k, v in self.items(): - if exclude_readonly and k in readonly_props: # pyright: ignore - continue - is_multipart_file_input = False - try: - is_multipart_file_input = next( - rf for rf in self._attr_to_rest_field.values() if rf._rest_name == k - )._is_multipart_file_input - except StopIteration: - pass - result[k] = v if is_multipart_file_input else Model._as_dict_value(v, exclude_readonly=exclude_readonly) - return result - - @staticmethod - def _as_dict_value(v: typing.Any, exclude_readonly: bool = False) -> typing.Any: - if v is None or isinstance(v, _Null): - return None - if isinstance(v, (list, tuple, set)): - return type(v)(Model._as_dict_value(x, exclude_readonly=exclude_readonly) for x in v) - if isinstance(v, dict): - return {dk: Model._as_dict_value(dv, exclude_readonly=exclude_readonly) for dk, dv in v.items()} - return v.as_dict(exclude_readonly=exclude_readonly) if hasattr(v, "as_dict") else v - - -def _deserialize_model(model_deserializer: typing.Optional[typing.Callable], obj): - if _is_model(obj): - return obj - return _deserialize(model_deserializer, obj) - - -def _deserialize_with_optional(if_obj_deserializer: typing.Optional[typing.Callable], obj): - if obj is None: - return obj - return _deserialize_with_callable(if_obj_deserializer, obj) - - -def _deserialize_with_union(deserializers, obj): - for deserializer in deserializers: - try: - return _deserialize(deserializer, obj) - except DeserializationError: - pass - raise DeserializationError() - - -def _deserialize_dict( - value_deserializer: typing.Optional[typing.Callable], - module: typing.Optional[str], - obj: dict[typing.Any, typing.Any], -): - if obj is None: - return obj - if isinstance(obj, ET.Element): - obj = {child.tag: child for child in obj} - return {k: _deserialize(value_deserializer, v, module) for k, v in obj.items()} - - -def _deserialize_multiple_sequence( - entry_deserializers: list[typing.Optional[typing.Callable]], - module: typing.Optional[str], - obj, -): - if obj is None: - return obj - return type(obj)(_deserialize(deserializer, entry, module) for entry, deserializer in zip(obj, entry_deserializers)) - - -def _is_array_encoded_deserializer(deserializer: functools.partial) -> bool: - return ( - isinstance(deserializer, functools.partial) - and isinstance(deserializer.args[0], functools.partial) - and deserializer.args[0].func == _deserialize_array_encoded # pylint: disable=comparison-with-callable - ) - - -def _deserialize_sequence( - deserializer: typing.Optional[typing.Callable], - module: typing.Optional[str], - obj, -): - if obj is None: - return obj - if isinstance(obj, ET.Element): - obj = list(obj) - - # encoded string may be deserialized to sequence - if isinstance(obj, str) and isinstance(deserializer, functools.partial): - # for list[str] - if _is_array_encoded_deserializer(deserializer): - return deserializer(obj) - - # for list[Union[...]] - if isinstance(deserializer.args[0], list): - for sub_deserializer in deserializer.args[0]: - if _is_array_encoded_deserializer(sub_deserializer): - return sub_deserializer(obj) - - return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) - - -def _sorted_annotations(types: list[typing.Any]) -> list[typing.Any]: - return sorted( - types, - key=lambda x: hasattr(x, "__name__") and x.__name__.lower() in ("str", "float", "int", "bool"), - ) - - -def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-statements, too-many-branches - annotation: typing.Any, - module: typing.Optional[str], - rf: typing.Optional["_RestField"] = None, -) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: - if not annotation: - return None - - # is it a type alias? - if isinstance(annotation, str): - if module is not None: - annotation = _get_type_alias_type(module, annotation) - - # is it a forward ref / in quotes? - if isinstance(annotation, (str, typing.ForwardRef)): - try: - model_name = annotation.__forward_arg__ # type: ignore - except AttributeError: - model_name = annotation - if module is not None: - annotation = _get_model(module, model_name) # type: ignore - - try: - if module and _is_model(annotation): - if rf: - rf._is_model = True - - return functools.partial(_deserialize_model, annotation) # pyright: ignore - except Exception: - pass - - # is it a literal? - try: - if annotation.__origin__ is typing.Literal: # pyright: ignore - return None - except AttributeError: - pass - - # is it optional? - try: - if any(a is _NONE_TYPE for a in annotation.__args__): # pyright: ignore - if rf: - rf._is_optional = True - if len(annotation.__args__) <= 2: # pyright: ignore - if_obj_deserializer = _get_deserialize_callable_from_annotation( - next(a for a in annotation.__args__ if a is not _NONE_TYPE), module, rf # pyright: ignore - ) - - return functools.partial(_deserialize_with_optional, if_obj_deserializer) - # the type is Optional[Union[...]], we need to remove the None type from the Union - annotation_copy = copy.copy(annotation) - annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a is not _NONE_TYPE] # pyright: ignore - return _get_deserialize_callable_from_annotation(annotation_copy, module, rf) - except AttributeError: - pass - - # is it union? - if getattr(annotation, "__origin__", None) is typing.Union: - # initial ordering is we make `string` the last deserialization option, because it is often them most generic - deserializers = [ - _get_deserialize_callable_from_annotation(arg, module, rf) - for arg in _sorted_annotations(annotation.__args__) # pyright: ignore - ] - - return functools.partial(_deserialize_with_union, deserializers) - - try: - annotation_name = ( - annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore - ) - if annotation_name.lower() == "dict": - value_deserializer = _get_deserialize_callable_from_annotation( - annotation.__args__[1], module, rf # pyright: ignore - ) - - return functools.partial( - _deserialize_dict, - value_deserializer, - module, - ) - except (AttributeError, IndexError): - pass - try: - annotation_name = ( - annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore - ) - if annotation_name.lower() in ["list", "set", "tuple", "sequence"]: - if len(annotation.__args__) > 1: # pyright: ignore - entry_deserializers = [ - _get_deserialize_callable_from_annotation(dt, module, rf) - for dt in annotation.__args__ # pyright: ignore - ] - return functools.partial(_deserialize_multiple_sequence, entry_deserializers, module) - deserializer = _get_deserialize_callable_from_annotation( - annotation.__args__[0], module, rf # pyright: ignore - ) - - return functools.partial(_deserialize_sequence, deserializer, module) - except (TypeError, IndexError, AttributeError, SyntaxError): - pass - - def _deserialize_default( - deserializer, - obj, - ): - if obj is None: - return obj - try: - return _deserialize_with_callable(deserializer, obj) - except Exception: - pass - return obj - - if get_deserializer(annotation, rf): - return functools.partial(_deserialize_default, get_deserializer(annotation, rf)) - - return functools.partial(_deserialize_default, annotation) - - -def _deserialize_with_callable( - deserializer: typing.Optional[typing.Callable[[typing.Any], typing.Any]], - value: typing.Any, -): # pylint: disable=too-many-return-statements - try: - if value is None or isinstance(value, _Null): - return None - if isinstance(value, ET.Element): - if deserializer is str: - return value.text or "" - if deserializer is int: - return int(value.text) if value.text else None - if deserializer is float: - return float(value.text) if value.text else None - if deserializer is bool: - return value.text == "true" if value.text else None - if deserializer and deserializer in _DESERIALIZE_MAPPING.values(): - return deserializer(value.text) if value.text else None - if deserializer and deserializer in _DESERIALIZE_MAPPING_WITHFORMAT.values(): - return deserializer(value.text) if value.text else None - if deserializer is None: - return value - if deserializer in [int, float, bool]: - return deserializer(value) - if isinstance(deserializer, CaseInsensitiveEnumMeta): - try: - return deserializer(value.text if isinstance(value, ET.Element) else value) - except ValueError: - # for unknown value, return raw value - return value.text if isinstance(value, ET.Element) else value - if isinstance(deserializer, type) and issubclass(deserializer, Model): - return deserializer._deserialize(value, []) - return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) - except Exception as e: - raise DeserializationError() from e - - -def _deserialize( - deserializer: typing.Any, - value: typing.Any, - module: typing.Optional[str] = None, - rf: typing.Optional["_RestField"] = None, - format: typing.Optional[str] = None, -) -> typing.Any: - if isinstance(value, PipelineResponse): - value = value.http_response.json() - if rf is None and format: - rf = _RestField(format=format) - if not isinstance(deserializer, functools.partial): - deserializer = _get_deserialize_callable_from_annotation(deserializer, module, rf) - return _deserialize_with_callable(deserializer, value) - - -def _failsafe_deserialize( - deserializer: typing.Any, - response: HttpResponse, - module: typing.Optional[str] = None, - rf: typing.Optional["_RestField"] = None, - format: typing.Optional[str] = None, -) -> typing.Any: - try: - return _deserialize(deserializer, response.json(), module, rf, format) - except Exception: # pylint: disable=broad-except - _LOGGER.warning( - "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True - ) - return None - - -def _failsafe_deserialize_xml( - deserializer: typing.Any, - response: HttpResponse, -) -> typing.Any: - try: - return _deserialize_xml(deserializer, response.text()) - except Exception: # pylint: disable=broad-except - _LOGGER.warning( - "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True - ) - return None - - -# pylint: disable=too-many-instance-attributes -class _RestField: - def __init__( - self, - *, - name: typing.Optional[str] = None, - type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin - is_discriminator: bool = False, - visibility: typing.Optional[list[str]] = None, - default: typing.Any = _UNSET, - format: typing.Optional[str] = None, - is_multipart_file_input: bool = False, - xml: typing.Optional[dict[str, typing.Any]] = None, - deserializer: typing.Optional[typing.Callable] = None, - ): - self._type = type - self._rest_name_input = name - self._module: typing.Optional[str] = None - self._is_discriminator = is_discriminator - self._visibility = visibility - self._is_model = False - self._is_optional = False - self._default = default - self._format = format - self._is_multipart_file_input = is_multipart_file_input - self._xml = xml if xml is not None else {} - self._deserializer = deserializer - - @property - def _class_type(self) -> typing.Any: - result = getattr(self._type, "args", [None])[0] - # type may be wrapped by nested functools.partial so we need to check for that - if isinstance(result, functools.partial): - return getattr(result, "args", [None])[0] - return result - - @property - def _rest_name(self) -> str: - if self._rest_name_input is None: - raise ValueError("Rest name was never set") - return self._rest_name_input - - def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin - # by this point, type and rest_name will have a value bc we default - # them in __new__ of the Model class - # Use _data.get() directly to avoid triggering __getitem__ which clears the cache - item = obj._data.get(self._rest_name, _UNSET) - if item is _UNSET: - # Field not set by user; return the client default if one exists, otherwise None - return self._default if self._default is not _UNSET else None - if item is None: - return item - if self._is_model: - return item - - # For mutable types, we want mutations to directly affect _data - # Check if we've already deserialized this value - cache_attr = f"_deserialized_{self._rest_name}" - if hasattr(obj, cache_attr): - # Return the value from _data directly (it's been deserialized in place) - return obj._data.get(self._rest_name) - - # Fast path: use _deserializer directly (avoids _serialize/_deserialize chain) - if self._deserializer: - deserialized = self._deserializer(item) - else: - deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) - - # For mutable types, store the deserialized value back in _data - # so mutations directly affect _data - if isinstance(deserialized, (dict, list, set)): - obj._data[self._rest_name] = deserialized - object.__setattr__(obj, cache_attr, True) # Mark as deserialized - return deserialized - - return deserialized - - def __set__(self, obj: Model, value) -> None: - # Clear the cached deserialized object when setting a new value - cache_attr = f"_deserialized_{self._rest_name}" - if hasattr(obj, cache_attr): - object.__delattr__(obj, cache_attr) - - if value is None: - # we want to wipe out entries if users set attr to None - try: - obj.__delitem__(self._rest_name) - except KeyError: - pass - return - if self._is_model: - if not _is_model(value): - value = _deserialize(self._type, value) - obj.__setitem__(self._rest_name, value) - return - obj.__setitem__(self._rest_name, _serialize(value, self._format)) - - def _get_deserialize_callable_from_annotation( - self, annotation: typing.Any - ) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: - return _get_deserialize_callable_from_annotation(annotation, self._module, self) - - -def rest_field( - *, - name: typing.Optional[str] = None, - type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin - visibility: typing.Optional[list[str]] = None, - default: typing.Any = _UNSET, - format: typing.Optional[str] = None, - is_multipart_file_input: bool = False, - xml: typing.Optional[dict[str, typing.Any]] = None, - deserializer: typing.Optional[typing.Callable] = None, -) -> typing.Any: - return _RestField( - name=name, - type=type, - visibility=visibility, - default=default, - format=format, - is_multipart_file_input=is_multipart_file_input, - xml=xml, - deserializer=deserializer, - ) - - -def rest_discriminator( - *, - name: typing.Optional[str] = None, - type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin - visibility: typing.Optional[list[str]] = None, - xml: typing.Optional[dict[str, typing.Any]] = None, -) -> typing.Any: - return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) - - -def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: - """Serialize a model to XML. - - :param Model model: The model to serialize. - :param bool exclude_readonly: Whether to exclude readonly properties. - :returns: The XML representation of the model. - :rtype: str - """ - return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore - - -def _get_xml_ns(meta: dict[str, typing.Any]) -> typing.Optional[str]: - """Return the XML namespace from a metadata dict, checking both 'ns' (old-style) and 'namespace' (DPG) keys. - - :param dict meta: The metadata dictionary to extract namespace from. - :returns: The namespace string if 'ns' or 'namespace' key is present, None otherwise. - :rtype: str or None - """ - ns = meta.get("ns") - if ns is None: - ns = meta.get("namespace") - return ns - - -def _resolve_xml_ns( - prop_meta: dict[str, typing.Any], model_meta: typing.Optional[dict[str, typing.Any]] = None -) -> typing.Optional[str]: - """Resolve XML namespace for a property, falling back to model namespace when appropriate. - - Checks the property metadata first; if no namespace is found and the model does not declare - an explicit prefix, falls back to the model-level namespace. - - :param dict prop_meta: The property metadata dictionary. - :param dict model_meta: The model metadata dictionary, used as fallback. - :returns: The resolved namespace string, or None. - :rtype: str or None - """ - ns = _get_xml_ns(prop_meta) - if ns is None and model_meta is not None and not model_meta.get("prefix"): - ns = _get_xml_ns(model_meta) - return ns - - -def _set_xml_attribute(element: ET.Element, name: str, value: typing.Any, prop_meta: dict[str, typing.Any]) -> None: - """Set an XML attribute on an element, handling namespace prefix registration. - - :param ET.Element element: The element to set the attribute on. - :param str name: The default attribute name (wire name). - :param any value: The attribute value. - :param dict prop_meta: The property metadata dictionary. - """ - xml_name = prop_meta.get("name", name) - _attr_ns = _get_xml_ns(prop_meta) - if _attr_ns: - _attr_prefix = prop_meta.get("prefix") - if _attr_prefix: - _safe_register_namespace(_attr_prefix, _attr_ns) - xml_name = "{" + _attr_ns + "}" + xml_name - element.set(xml_name, _get_primitive_type_value(value)) - - -def _get_element( - o: typing.Any, - exclude_readonly: bool = False, - parent_meta: typing.Optional[dict[str, typing.Any]] = None, - wrapped_element: typing.Optional[ET.Element] = None, -) -> typing.Union[ET.Element, list[ET.Element]]: - if _is_model(o): - model_meta = getattr(o, "_xml", {}) - - # if prop is a model, then use the prop element directly, else generate a wrapper of model - if wrapped_element is None: - # When serializing as an array item (parent_meta is set), check if the parent has an - # explicit itemsName. This ensures correct element names for unwrapped arrays (where - # the element tag is the property/items name, not the model type name). - _items_name = parent_meta.get("itemsName") if parent_meta is not None else None - element_name = _items_name if _items_name else (model_meta.get("name") or o.__class__.__name__) - _model_ns = _get_xml_ns(model_meta) - wrapped_element = _create_xml_element( - element_name, - model_meta.get("prefix"), - _model_ns, - ) - - readonly_props = [] - if exclude_readonly: - readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] - - for k, v in o.items(): - # do not serialize readonly properties - if exclude_readonly and k in readonly_props: - continue - - prop_rest_field = _get_rest_field(o._attr_to_rest_field, k) - if prop_rest_field: - prop_meta = getattr(prop_rest_field, "_xml").copy() - # use the wire name as xml name if no specific name is set - if prop_meta.get("name") is None: - prop_meta["name"] = k - else: - # additional properties will not have rest field, use the wire name as xml name - prop_meta = {"name": k} - - # Propagate model namespace to properties only for old-style "ns"-keyed models. - # DPG-generated models use the "namespace" key and explicitly declare namespace on - # each property that needs it, so propagation is intentionally skipped for them. - if prop_meta.get("ns") is None and model_meta.get("ns"): - prop_meta["ns"] = model_meta.get("ns") - prop_meta["prefix"] = model_meta.get("prefix") - - if prop_meta.get("unwrapped", False): - # unwrapped could only set on array - wrapped_element.extend(_get_element(v, exclude_readonly, prop_meta)) - elif prop_meta.get("text", False): - # text could only set on primitive type - wrapped_element.text = _get_primitive_type_value(v) - elif prop_meta.get("attribute", False): - _set_xml_attribute(wrapped_element, k, v, prop_meta) - else: - # other wrapped prop element - wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) - return wrapped_element - if isinstance(o, list): - return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore - if isinstance(o, dict): - result = [] - _dict_ns = _get_xml_ns(parent_meta) if parent_meta else None - for k, v in o.items(): - result.append( - _get_wrapped_element( - v, - exclude_readonly, - { - "name": k, - "ns": _dict_ns, - "prefix": parent_meta.get("prefix") if parent_meta else None, - }, - ) - ) - return result - - # primitive case need to create element based on parent_meta - if parent_meta: - _items_ns = parent_meta.get("itemsNs") - if _items_ns is None: - _items_ns = _get_xml_ns(parent_meta) - return _get_wrapped_element( - o, - exclude_readonly, - { - "name": parent_meta.get("itemsName", parent_meta.get("name")), - "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), - "ns": _items_ns, - }, - ) - - raise ValueError("Could not serialize value into xml: " + o) - - -def _get_wrapped_element( - v: typing.Any, - exclude_readonly: bool, - meta: typing.Optional[dict[str, typing.Any]], -) -> ET.Element: - _meta_ns = _get_xml_ns(meta) if meta else None - wrapped_element = _create_xml_element( - meta.get("name") if meta else None, meta.get("prefix") if meta else None, _meta_ns - ) - if isinstance(v, (dict, list)): - wrapped_element.extend(_get_element(v, exclude_readonly, meta)) - elif _is_model(v): - _get_element(v, exclude_readonly, meta, wrapped_element) - else: - wrapped_element.text = _get_primitive_type_value(v) - return wrapped_element # type: ignore[no-any-return] - - -def _get_primitive_type_value(v) -> str: - if v is True: - return "true" - if v is False: - return "false" - if isinstance(v, _Null): - return "" - return str(v) - - -def _safe_register_namespace(prefix: str, ns: str) -> None: - """Register an XML namespace prefix, handling reserved prefix patterns. - - Some prefixes (e.g. 'ns2') match Python's reserved 'ns\\d+' pattern used for - auto-generated prefixes, causing register_namespace to raise ValueError. - Falls back to directly registering in the internal namespace map. - - :param str prefix: The namespace prefix to register. - :param str ns: The namespace URI. - """ - try: - ET.register_namespace(prefix, ns) - except ValueError: - _ns_map = getattr(ET, "_namespace_map", None) - if _ns_map is not None: - _ns_map[ns] = prefix - - -def _create_xml_element( - tag: typing.Any, prefix: typing.Optional[str] = None, ns: typing.Optional[str] = None -) -> ET.Element: - if prefix and ns: - _safe_register_namespace(prefix, ns) - if ns: - return ET.Element("{" + ns + "}" + tag) - return ET.Element(tag) - - -def _deserialize_xml( - deserializer: typing.Any, - value: str, -) -> typing.Any: - element = ET.fromstring(value) # nosec - if _is_model(deserializer): - return deserializer._deserialize(element, []) - return _deserialize(deserializer, element) - - -def _convert_element(e: ET.Element): - # dict case - if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: - dict_result: dict[str, typing.Any] = {} - for child in e: - if dict_result.get(child.tag) is not None: - if isinstance(dict_result[child.tag], list): - dict_result[child.tag].append(_convert_element(child)) - else: - dict_result[child.tag] = [dict_result[child.tag], _convert_element(child)] - else: - dict_result[child.tag] = _convert_element(child) - dict_result.update(e.attrib) - return dict_result - # array case - if len(e) > 0: - array_result: list[typing.Any] = [] - for child in e: - array_result.append(_convert_element(child)) - return array_result - # primitive case - return e.text diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_utils/serialization.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_utils/serialization.py deleted file mode 100644 index ae08f9d89f74..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_utils/serialization.py +++ /dev/null @@ -1,2179 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -# pyright: reportUnnecessaryTypeIgnoreComment=false - -from base64 import b64decode, b64encode -import calendar -import datetime -import decimal -import email -from enum import Enum -import json -import logging -import re -import sys -import codecs -from typing import ( - Any, - cast, - Optional, - Union, - AnyStr, - IO, - Mapping, - Callable, - MutableMapping, -) - -try: - from urllib import quote # type: ignore -except ImportError: - from urllib.parse import quote -import xml.etree.ElementTree as ET - -import isodate # type: ignore - -from azure.core.exceptions import DeserializationError, SerializationError -from azure.core.serialization import NULL as CoreNull - -if sys.version_info >= (3, 11): - from typing import Self -else: - from typing_extensions import Self - -_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") - -JSON = MutableMapping[str, Any] - - -class RawDeserializer: - - # Accept "text" because we're open minded people... - JSON_REGEXP = re.compile(r"^(application|text)/([a-z+.]+\+)?json$") - - # Name used in context - CONTEXT_NAME = "deserialized_data" - - @classmethod - def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: - """Decode data according to content-type. - - Accept a stream of data as well, but will be load at once in memory for now. - - If no content-type, will return the string version (not bytes, not stream) - - :param data: Input, could be bytes or stream (will be decoded with UTF8) or text - :type data: str or bytes or IO - :param str content_type: The content type. - :return: The deserialized data. - :rtype: object - """ - if hasattr(data, "read"): - # Assume a stream - data = cast(IO, data).read() - - if isinstance(data, bytes): - data_as_str = data.decode(encoding="utf-8-sig") - else: - # Explain to mypy the correct type. - data_as_str = cast(str, data) - - # Remove Byte Order Mark if present in string - data_as_str = data_as_str.lstrip(_BOM) - - if content_type is None: - return data - - if cls.JSON_REGEXP.match(content_type): - try: - return json.loads(data_as_str) - except ValueError as err: - raise DeserializationError("JSON is invalid: {}".format(err), err) from err - elif "xml" in (content_type or []): - try: - - try: - if isinstance(data, unicode): # type: ignore - # If I'm Python 2.7 and unicode XML will scream if I try a "fromstring" on unicode string - data_as_str = data_as_str.encode(encoding="utf-8") # type: ignore - except NameError: - pass - - return ET.fromstring(data_as_str) # nosec - except ET.ParseError as err: - # It might be because the server has an issue, and returned JSON with - # content-type XML.... - # So let's try a JSON load, and if it's still broken - # let's flow the initial exception - def _json_attemp(data): - try: - return True, json.loads(data) - except ValueError: - return False, None # Don't care about this one - - success, json_result = _json_attemp(data) - if success: - return json_result - # If i'm here, it's not JSON, it's not XML, let's scream - # and raise the last context in this block (the XML exception) - # The function hack is because Py2.7 messes up with exception - # context otherwise. - _LOGGER.critical("Wasn't XML not JSON, failing") - raise DeserializationError("XML is invalid") from err - elif content_type.startswith("text/"): - return data_as_str - raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) - - @classmethod - def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: - """Deserialize from HTTP response. - - Use bytes and headers to NOT use any requests/aiohttp or whatever - specific implementation. - Headers will tested for "content-type" - - :param bytes body_bytes: The body of the response. - :param dict headers: The headers of the response. - :returns: The deserialized data. - :rtype: object - """ - # Try to use content-type from headers if available - content_type = None - if "content-type" in headers: - content_type = headers["content-type"].split(";")[0].strip().lower() - # Ouch, this server did not declare what it sent... - # Let's guess it's JSON... - # Also, since Autorest was considering that an empty body was a valid JSON, - # need that test as well.... - else: - content_type = "application/json" - - if body_bytes: - return cls.deserialize_from_text(body_bytes, content_type) - return None - - -_LOGGER = logging.getLogger(__name__) - -try: - _long_type = long # type: ignore -except NameError: - _long_type = int - -TZ_UTC = datetime.timezone.utc - -_FLATTEN = re.compile(r"(? None: - self.additional_properties: Optional[dict[str, Any]] = {} - for k in kwargs: # pylint: disable=consider-using-dict-items - if k not in self._attribute_map: - _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) - elif k in self._validation and self._validation[k].get("readonly", False): - _LOGGER.warning("Readonly attribute %s will be ignored in class %s", k, self.__class__) - else: - setattr(self, k, kwargs[k]) - - def __eq__(self, other: Any) -> bool: - """Compare objects by comparing all attributes. - - :param object other: The object to compare - :returns: True if objects are equal - :rtype: bool - """ - if isinstance(other, self.__class__): - return self.__dict__ == other.__dict__ - return False - - def __ne__(self, other: Any) -> bool: - """Compare objects by comparing all attributes. - - :param object other: The object to compare - :returns: True if objects are not equal - :rtype: bool - """ - return not self.__eq__(other) - - def __str__(self) -> str: - return str(self.__dict__) - - @classmethod - def enable_additional_properties_sending(cls) -> None: - cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} - - @classmethod - def is_xml_model(cls) -> bool: - try: - cls._xml_map # type: ignore - except AttributeError: - return False - return True - - @classmethod - def _create_xml_node(cls): - """Create XML node. - - :returns: The XML node - :rtype: xml.etree.ElementTree.Element - """ - try: - xml_map = cls._xml_map # type: ignore - except AttributeError: - xml_map = {} - - return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) - - def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: - """Return the JSON that would be sent to server from this model. - - This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. - - If you want XML serialization, you can pass the kwargs is_xml=True. - - :param bool keep_readonly: If you want to serialize the readonly attributes - :returns: A dict JSON compatible object - :rtype: dict - """ - serializer = Serializer(self._infer_class_models()) - return serializer._serialize( # type: ignore # pylint: disable=protected-access - self, keep_readonly=keep_readonly, **kwargs - ) - - def as_dict( - self, - keep_readonly: bool = True, - key_transformer: Callable[[str, dict[str, Any], Any], Any] = attribute_transformer, - **kwargs: Any - ) -> JSON: - """Return a dict that can be serialized using json.dump. - - Advanced usage might optionally use a callback as parameter: - - .. code::python - - def my_key_transformer(key, attr_desc, value): - return key - - Key is the attribute name used in Python. Attr_desc - is a dict of metadata. Currently contains 'type' with the - msrest type and 'key' with the RestAPI encoded key. - Value is the current value in this object. - - The string returned will be used to serialize the key. - If the return type is a list, this is considered hierarchical - result dict. - - See the three examples in this file: - - - attribute_transformer - - full_restapi_key_transformer - - last_restapi_key_transformer - - If you want XML serialization, you can pass the kwargs is_xml=True. - - :param bool keep_readonly: If you want to serialize the readonly attributes - :param function key_transformer: A key transformer function. - :returns: A dict JSON compatible object - :rtype: dict - """ - serializer = Serializer(self._infer_class_models()) - return serializer._serialize( # type: ignore # pylint: disable=protected-access - self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs - ) - - @classmethod - def _infer_class_models(cls): - try: - str_models = cls.__module__.rsplit(".", 1)[0] - models = sys.modules[str_models] - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - if cls.__name__ not in client_models: - raise ValueError("Not Autorest generated code") - except Exception: # pylint: disable=broad-exception-caught - # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. - client_models = {cls.__name__: cls} - return client_models - - @classmethod - def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: - """Parse a str using the RestAPI syntax and return a model. - - :param str data: A str using RestAPI structure. JSON by default. - :param str content_type: JSON by default, set application/xml if XML. - :returns: An instance of this model - :raises DeserializationError: if something went wrong - :rtype: Self - """ - deserializer = Deserializer(cls._infer_class_models()) - return deserializer(cls.__name__, data, content_type=content_type) # type: ignore - - @classmethod - def from_dict( - cls, - data: Any, - key_extractors: Optional[Callable[[str, dict[str, Any], Any], Any]] = None, - content_type: Optional[str] = None, - ) -> Self: - """Parse a dict using given key extractor return a model. - - By default consider key - extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor - and last_rest_key_case_insensitive_extractor) - - :param dict data: A dict using RestAPI structure - :param function key_extractors: A key extractor function. - :param str content_type: JSON by default, set application/xml if XML. - :returns: An instance of this model - :raises DeserializationError: if something went wrong - :rtype: Self - """ - deserializer = Deserializer(cls._infer_class_models()) - deserializer.key_extractors = ( # type: ignore - [ # type: ignore - attribute_key_case_insensitive_extractor, - rest_key_case_insensitive_extractor, - last_rest_key_case_insensitive_extractor, - ] - if key_extractors is None - else key_extractors - ) - return deserializer(cls.__name__, data, content_type=content_type) # type: ignore - - @classmethod - def _flatten_subtype(cls, key, objects): - if "_subtype_map" not in cls.__dict__: - return {} - result = dict(cls._subtype_map[key]) - for valuetype in cls._subtype_map[key].values(): - result |= objects[valuetype]._flatten_subtype(key, objects) # pylint: disable=protected-access - return result - - @classmethod - def _classify(cls, response, objects): - """Check the class _subtype_map for any child classes. - We want to ignore any inherited _subtype_maps. - - :param dict response: The initial data - :param dict objects: The class objects - :returns: The class to be used - :rtype: class - """ - for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): - subtype_value = None - - if not isinstance(response, ET.Element): - rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] - subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None) - else: - subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) - if subtype_value: - # Try to match base class. Can be class name only - # (bug to fix in Autorest to support x-ms-discriminator-name) - if cls.__name__ == subtype_value: - return cls - flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) - try: - return objects[flatten_mapping_type[subtype_value]] # type: ignore - except KeyError: - _LOGGER.warning( - "Subtype value %s has no mapping, use base class %s.", - subtype_value, - cls.__name__, - ) - break - else: - _LOGGER.warning("Discriminator %s is absent or null, use base class %s.", subtype_key, cls.__name__) - break - return cls - - @classmethod - def _get_rest_key_parts(cls, attr_key): - """Get the RestAPI key of this attr, split it and decode part - :param str attr_key: Attribute key must be in attribute_map. - :returns: A list of RestAPI part - :rtype: list - """ - rest_split_key = _FLATTEN.split(cls._attribute_map[attr_key]["key"]) - return [_decode_attribute_map_key(key_part) for key_part in rest_split_key] - - -def _decode_attribute_map_key(key): - """This decode a key in an _attribute_map to the actual key we want to look at - inside the received data. - - :param str key: A key string from the generated code - :returns: The decoded key - :rtype: str - """ - return key.replace("\\.", ".") - - -class Serializer: # pylint: disable=too-many-public-methods - """Request object model serializer. - - :param classes: Mapping of model names to model types, used to resolve models during serialization. - :type classes: typing.Optional[typing.Mapping[str, type]] - """ - - basic_types = {str: "str", int: "int", bool: "bool", float: "float"} - - _xml_basic_types_serializers = {"bool": lambda x: str(x).lower()} - days = {0: "Mon", 1: "Tue", 2: "Wed", 3: "Thu", 4: "Fri", 5: "Sat", 6: "Sun"} - months = { - 1: "Jan", - 2: "Feb", - 3: "Mar", - 4: "Apr", - 5: "May", - 6: "Jun", - 7: "Jul", - 8: "Aug", - 9: "Sep", - 10: "Oct", - 11: "Nov", - 12: "Dec", - } - validation = { - "min_length": lambda x, y: len(x) < y, - "max_length": lambda x, y: len(x) > y, - "minimum": lambda x, y: x < y, - "maximum": lambda x, y: x > y, - "minimum_ex": lambda x, y: x <= y, - "maximum_ex": lambda x, y: x >= y, - "min_items": lambda x, y: len(x) < y, - "max_items": lambda x, y: len(x) > y, - "pattern": lambda x, y: not re.match(y, x, re.UNICODE), - "unique": lambda x, y: len(x) != len(set(x)), - "multiple": lambda x, y: x % y != 0, - } - - def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: - self.serialize_type = { - "iso-8601": Serializer.serialize_iso, - "rfc-1123": Serializer.serialize_rfc, - "unix-time": Serializer.serialize_unix, - "duration": Serializer.serialize_duration, - "duration-seconds-int": Serializer.serialize_duration_seconds_int, - "duration-seconds-float": Serializer.serialize_duration_seconds_float, - "duration-milliseconds-int": Serializer.serialize_duration_milliseconds_int, - "duration-milliseconds-float": Serializer.serialize_duration_milliseconds_float, - "date": Serializer.serialize_date, - "time": Serializer.serialize_time, - "decimal": Serializer.serialize_decimal, - "long": Serializer.serialize_long, - "bytearray": Serializer.serialize_bytearray, - "base64": Serializer.serialize_base64, - "object": self.serialize_object, - "[]": self.serialize_iter, - "{}": self.serialize_dict, - } - self.dependencies: dict[str, type] = dict(classes) if classes else {} - self.key_transformer = full_restapi_key_transformer - self.client_side_validation = True - - def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals - self, target_obj, data_type=None, **kwargs - ): - """Serialize data into a string according to type. - - :param object target_obj: The data to be serialized. - :param str data_type: The type to be serialized from. - :rtype: str, dict - :raises SerializationError: if serialization fails. - :returns: The serialized data. - """ - key_transformer = kwargs.get("key_transformer", self.key_transformer) - keep_readonly = kwargs.get("keep_readonly", False) - if target_obj is None: - return None - - attr_name = None - class_name = target_obj.__class__.__name__ - - if data_type: - return self.serialize_data(target_obj, data_type, **kwargs) - - if not hasattr(target_obj, "_attribute_map"): - data_type = type(target_obj).__name__ - if data_type in self.basic_types.values(): - return self.serialize_data(target_obj, data_type, **kwargs) - - # Force "is_xml" kwargs if we detect a XML model - try: - is_xml_model_serialization = kwargs["is_xml"] - except KeyError: - is_xml_model_serialization = kwargs.setdefault("is_xml", target_obj.is_xml_model()) - - serialized = {} - if is_xml_model_serialization: - serialized = target_obj._create_xml_node() # pylint: disable=protected-access - try: - attributes = target_obj._attribute_map # pylint: disable=protected-access - for attr, attr_desc in attributes.items(): - attr_name = attr - if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access - attr_name, {} - ).get("readonly", False): - continue - - if attr_name == "additional_properties" and attr_desc["key"] == "": - if target_obj.additional_properties is not None: - serialized |= target_obj.additional_properties - continue - try: - - orig_attr = getattr(target_obj, attr) - if is_xml_model_serialization: - pass # Don't provide "transformer" for XML for now. Keep "orig_attr" - else: # JSON - keys, orig_attr = key_transformer(attr, attr_desc.copy(), orig_attr) - keys = keys if isinstance(keys, list) else [keys] - - kwargs["serialization_ctxt"] = attr_desc - new_attr = self.serialize_data(orig_attr, attr_desc["type"], **kwargs) - - if is_xml_model_serialization: - xml_desc = attr_desc.get("xml", {}) - xml_name = xml_desc.get("name", attr_desc["key"]) - xml_prefix = xml_desc.get("prefix", None) - xml_ns = xml_desc.get("ns", None) - if xml_desc.get("attr", False): - if xml_ns: - ET.register_namespace(xml_prefix, xml_ns) - xml_name = "{{{}}}{}".format(xml_ns, xml_name) - serialized.set(xml_name, new_attr) # type: ignore - continue - if xml_desc.get("text", False): - serialized.text = new_attr # type: ignore - continue - if isinstance(new_attr, list): - serialized.extend(new_attr) # type: ignore - elif isinstance(new_attr, ET.Element): - # If the down XML has no XML/Name, - # we MUST replace the tag with the local tag. But keeping the namespaces. - if "name" not in getattr(orig_attr, "_xml_map", {}): - splitted_tag = new_attr.tag.split("}") - if len(splitted_tag) == 2: # Namespace - new_attr.tag = "}".join([splitted_tag[0], xml_name]) - else: - new_attr.tag = xml_name - serialized.append(new_attr) # type: ignore - else: # That's a basic type - # Integrate namespace if necessary - local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) - local_node.text = str(new_attr) - serialized.append(local_node) # type: ignore - else: # JSON - for k in reversed(keys): # type: ignore - new_attr = {k: new_attr} - - _new_attr = new_attr - _serialized = serialized - for k in keys: # type: ignore - if k not in _serialized: - _serialized.update(_new_attr) # type: ignore - _new_attr = _new_attr[k] # type: ignore - _serialized = _serialized[k] - except ValueError as err: - if isinstance(err, SerializationError): - raise - - except (AttributeError, KeyError, TypeError) as err: - msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) - raise SerializationError(msg) from err - return serialized - - def body(self, data, data_type, **kwargs): - """Serialize data intended for a request body. - - :param object data: The data to be serialized. - :param str data_type: The type to be serialized from. - :rtype: dict - :raises SerializationError: if serialization fails. - :raises ValueError: if data is None - :returns: The serialized request body - """ - - # Just in case this is a dict - internal_data_type_str = data_type.strip("[]{}") - internal_data_type = self.dependencies.get(internal_data_type_str, None) - try: - is_xml_model_serialization = kwargs["is_xml"] - except KeyError: - if internal_data_type and issubclass(internal_data_type, Model): - is_xml_model_serialization = kwargs.setdefault("is_xml", internal_data_type.is_xml_model()) - else: - is_xml_model_serialization = False - if internal_data_type and not isinstance(internal_data_type, Enum): - try: - deserializer = Deserializer(self.dependencies) - # Since it's on serialization, it's almost sure that format is not JSON REST - # We're not able to deal with additional properties for now. - deserializer.additional_properties_detection = False - if is_xml_model_serialization: - deserializer.key_extractors = [ # type: ignore - attribute_key_case_insensitive_extractor, - ] - else: - deserializer.key_extractors = [ - rest_key_case_insensitive_extractor, - attribute_key_case_insensitive_extractor, - last_rest_key_case_insensitive_extractor, - ] - data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access - except DeserializationError as err: - raise SerializationError("Unable to build a model: " + str(err)) from err - - return self._serialize(data, data_type, **kwargs) - - def url(self, name, data, data_type, **kwargs): - """Serialize data intended for a URL path. - - :param str name: The name of the URL path parameter. - :param object data: The data to be serialized. - :param str data_type: The type to be serialized from. - :rtype: str - :returns: The serialized URL path - :raises TypeError: if serialization fails. - :raises ValueError: if data is None - """ - try: - output = self.serialize_data(data, data_type, **kwargs) - if data_type == "bool": - output = json.dumps(output) - - if kwargs.get("skip_quote") is True: - output = str(output) - output = output.replace("{", quote("{")).replace("}", quote("}")) - else: - output = quote(str(output), safe="") - except SerializationError as exc: - raise TypeError("{} must be type {}.".format(name, data_type)) from exc - return output - - def query(self, name, data, data_type, **kwargs): - """Serialize data intended for a URL query. - - :param str name: The name of the query parameter. - :param object data: The data to be serialized. - :param str data_type: The type to be serialized from. - :rtype: str, list - :raises TypeError: if serialization fails. - :raises ValueError: if data is None - :returns: The serialized query parameter - """ - try: - # Treat the list aside, since we don't want to encode the div separator - if data_type.startswith("["): - internal_data_type = data_type[1:-1] - do_quote = not kwargs.get("skip_quote", False) - return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs) - - # Not a list, regular serialization - output = self.serialize_data(data, data_type, **kwargs) - if data_type == "bool": - output = json.dumps(output) - if kwargs.get("skip_quote") is True: - output = str(output) - else: - output = quote(str(output), safe="") - except SerializationError as exc: - raise TypeError("{} must be type {}.".format(name, data_type)) from exc - return str(output) - - def header(self, name, data, data_type, **kwargs): - """Serialize data intended for a request header. - - :param str name: The name of the header. - :param object data: The data to be serialized. - :param str data_type: The type to be serialized from. - :rtype: str - :raises TypeError: if serialization fails. - :raises ValueError: if data is None - :returns: The serialized header - """ - try: - if data_type in ["[str]"]: - data = ["" if d is None else d for d in data] - - output = self.serialize_data(data, data_type, **kwargs) - if data_type == "bool": - output = json.dumps(output) - except SerializationError as exc: - raise TypeError("{} must be type {}.".format(name, data_type)) from exc - return str(output) - - def serialize_data(self, data, data_type, **kwargs): - """Serialize generic data according to supplied data type. - - :param object data: The data to be serialized. - :param str data_type: The type to be serialized from. - :raises AttributeError: if required data is None. - :raises ValueError: if data is None - :raises SerializationError: if serialization fails. - :returns: The serialized data. - :rtype: str, int, float, bool, dict, list - """ - if data is None: - raise ValueError("No value for given attribute") - - try: - if data is CoreNull: - return None - if data_type in self.basic_types.values(): - return self.serialize_basic(data, data_type, **kwargs) - - if data_type in self.serialize_type: - return self.serialize_type[data_type](data, **kwargs) - - # If dependencies is empty, try with current data class - # It has to be a subclass of Enum anyway - enum_type = self.dependencies.get(data_type, cast(type, data.__class__)) - if issubclass(enum_type, Enum): - return Serializer.serialize_enum(data, enum_obj=enum_type) - - iter_type = data_type[0] + data_type[-1] - if iter_type in self.serialize_type: - return self.serialize_type[iter_type](data, data_type[1:-1], **kwargs) - - except (ValueError, TypeError) as err: - msg = "Unable to serialize value: {!r} as type: {!r}." - raise SerializationError(msg.format(data, data_type)) from err - return self._serialize(data, **kwargs) - - @classmethod - def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements - custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) - if custom_serializer: - return custom_serializer - if kwargs.get("is_xml", False): - return cls._xml_basic_types_serializers.get(data_type) - - @classmethod - def serialize_basic(cls, data, data_type, **kwargs): - """Serialize basic builting data type. - Serializes objects to str, int, float or bool. - - Possible kwargs: - - basic_types_serializers dict[str, callable] : If set, use the callable as serializer - - is_xml bool : If set, use xml_basic_types_serializers - - :param obj data: Object to be serialized. - :param str data_type: Type of object in the iterable. - :rtype: str, int, float, bool - :return: serialized object - :raises TypeError: raise if data_type is not one of str, int, float, bool. - """ - custom_serializer = cls._get_custom_serializers(data_type, **kwargs) - if custom_serializer: - return custom_serializer(data) - if data_type == "str": - return cls.serialize_unicode(data) - if data_type == "int": - return int(data) - if data_type == "float": - return float(data) - if data_type == "bool": - return bool(data) - raise TypeError("Unknown basic data type: {}".format(data_type)) - - @classmethod - def serialize_unicode(cls, data): - """Special handling for serializing unicode strings in Py2. - Encode to UTF-8 if unicode, otherwise handle as a str. - - :param str data: Object to be serialized. - :rtype: str - :return: serialized object - """ - try: # If I received an enum, return its value - return data.value - except AttributeError: - pass - - try: - if isinstance(data, unicode): # type: ignore - # Don't change it, JSON and XML ElementTree are totally able - # to serialize correctly u'' strings - return data - except NameError: - return str(data) - return str(data) - - def serialize_iter(self, data, iter_type, div=None, **kwargs): - """Serialize iterable. - - Supported kwargs: - - serialization_ctxt dict : The current entry of _attribute_map, or same format. - serialization_ctxt['type'] should be same as data_type. - - is_xml bool : If set, serialize as XML - - :param list data: Object to be serialized. - :param str iter_type: Type of object in the iterable. - :param str div: If set, this str will be used to combine the elements - in the iterable into a combined string. Default is 'None'. - Defaults to False. - :rtype: list, str - :return: serialized iterable - """ - if isinstance(data, str): - raise SerializationError("Refuse str type as a valid iter type.") - - serialization_ctxt = kwargs.get("serialization_ctxt", {}) - is_xml = kwargs.get("is_xml", False) - - serialized = [] - for d in data: - try: - serialized.append(self.serialize_data(d, iter_type, **kwargs)) - except ValueError as err: - if isinstance(err, SerializationError): - raise - serialized.append(None) - - if kwargs.get("do_quote", False): - serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] - - if div: - serialized = ["" if s is None else str(s) for s in serialized] - serialized = div.join(serialized) - - if "xml" in serialization_ctxt or is_xml: - # XML serialization is more complicated - xml_desc = serialization_ctxt.get("xml", {}) - xml_name = xml_desc.get("name") - if not xml_name: - xml_name = serialization_ctxt["key"] - - # Create a wrap node if necessary (use the fact that Element and list have "append") - is_wrapped = xml_desc.get("wrapped", False) - node_name = xml_desc.get("itemsName", xml_name) - if is_wrapped: - final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) - else: - final_result = [] - # All list elements to "local_node" - for el in serialized: - if isinstance(el, ET.Element): - el_node = el - else: - el_node = _create_xml_node(node_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) - if el is not None: # Otherwise it writes "None" :-p - el_node.text = str(el) - final_result.append(el_node) - return final_result - return serialized - - def serialize_dict(self, attr, dict_type, **kwargs): - """Serialize a dictionary of objects. - - :param dict attr: Object to be serialized. - :param str dict_type: Type of object in the dictionary. - :rtype: dict - :return: serialized dictionary - """ - serialization_ctxt = kwargs.get("serialization_ctxt", {}) - serialized = {} - for key, value in attr.items(): - try: - serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) - except ValueError as err: - if isinstance(err, SerializationError): - raise - serialized[self.serialize_unicode(key)] = None - - if "xml" in serialization_ctxt: - # XML serialization is more complicated - xml_desc = serialization_ctxt["xml"] - xml_name = xml_desc["name"] - - final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) - for key, value in serialized.items(): - ET.SubElement(final_result, key).text = value - return final_result - - return serialized - - def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements - """Serialize a generic object. - This will be handled as a dictionary. If object passed in is not - a basic type (str, int, float, dict, list) it will simply be - cast to str. - - :param dict attr: Object to be serialized. - :rtype: dict or str - :return: serialized object - """ - if attr is None: - return None - if isinstance(attr, ET.Element): - return attr - obj_type = type(attr) - if obj_type in self.basic_types: - return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) - if obj_type is _long_type: - return self.serialize_long(attr) - if obj_type is str: - return self.serialize_unicode(attr) - if obj_type is datetime.datetime: - return self.serialize_iso(attr) - if obj_type is datetime.date: - return self.serialize_date(attr) - if obj_type is datetime.time: - return self.serialize_time(attr) - if obj_type is datetime.timedelta: - return self.serialize_duration(attr) - if obj_type is decimal.Decimal: - return self.serialize_decimal(attr) - - # If it's a model or I know this dependency, serialize as a Model - if obj_type in self.dependencies.values() or isinstance(attr, Model): - return self._serialize(attr) - - if obj_type == dict: - serialized = {} - for key, value in attr.items(): - try: - serialized[self.serialize_unicode(key)] = self.serialize_object(value, **kwargs) - except ValueError: - serialized[self.serialize_unicode(key)] = None - return serialized - - if obj_type == list: - serialized = [] - for obj in attr: - try: - serialized.append(self.serialize_object(obj, **kwargs)) - except ValueError: - pass - return serialized - return str(attr) - - @staticmethod - def serialize_enum(attr, enum_obj=None): - try: - result = attr.value - except AttributeError: - result = attr - try: - enum_obj(result) # type: ignore - return result - except ValueError as exc: - for enum_value in enum_obj: # type: ignore - if enum_value.value.lower() == str(attr).lower(): - return enum_value.value - error = "{!r} is not valid value for enum {!r}" - raise SerializationError(error.format(attr, enum_obj)) from exc - - @staticmethod - def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument - """Serialize bytearray into base-64 string. - - :param str attr: Object to be serialized. - :rtype: str - :return: serialized base64 - """ - return b64encode(attr).decode() - - @staticmethod - def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument - """Serialize str into base-64 string. - - :param str attr: Object to be serialized. - :rtype: str - :return: serialized base64 - """ - encoded = b64encode(attr).decode("ascii") - return encoded.strip("=").replace("+", "-").replace("/", "_") - - @staticmethod - def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument - """Serialize Decimal object to float. - - :param decimal attr: Object to be serialized. - :rtype: float - :return: serialized decimal - """ - return float(attr) - - @staticmethod - def serialize_long(attr, **kwargs): # pylint: disable=unused-argument - """Serialize long (Py2) or int (Py3). - - :param int attr: Object to be serialized. - :rtype: int/long - :return: serialized long - """ - return _long_type(attr) - - @staticmethod - def serialize_date(attr, **kwargs): # pylint: disable=unused-argument - """Serialize Date object into ISO-8601 formatted string. - - :param Date attr: Object to be serialized. - :rtype: str - :return: serialized date - """ - if isinstance(attr, str): - attr = isodate.parse_date(attr) - t = "{:04}-{:02}-{:02}".format(attr.year, attr.month, attr.day) - return t - - @staticmethod - def serialize_time(attr, **kwargs): # pylint: disable=unused-argument - """Serialize Time object into ISO-8601 formatted string. - - :param datetime.time attr: Object to be serialized. - :rtype: str - :return: serialized time - """ - if isinstance(attr, str): - attr = isodate.parse_time(attr) - t = "{:02}:{:02}:{:02}".format(attr.hour, attr.minute, attr.second) - if attr.microsecond: - t += ".{:02}".format(attr.microsecond) - return t - - @staticmethod - def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument - """Serialize TimeDelta object into ISO-8601 formatted string. - - :param TimeDelta attr: Object to be serialized. - :rtype: str - :return: serialized duration - """ - if isinstance(attr, str): - attr = isodate.parse_duration(attr) - return isodate.duration_isoformat(attr) - - @staticmethod - def _serialize_duration_numeric(attr, scale, as_int): - """Serialize a TimeDelta into a numeric value scaled to the wire unit. - - :param TimeDelta attr: Object to be serialized. - :param int scale: Multiplier applied to total seconds (1 for seconds, 1000 for milliseconds). - :param bool as_int: Whether to truncate the result to an int. - :rtype: int or float - :return: serialized duration - """ - if isinstance(attr, str): - attr = isodate.parse_duration(attr) - value = attr.total_seconds() * scale if isinstance(attr, datetime.timedelta) else attr - return int(value) if as_int else float(value) - - @staticmethod - def serialize_duration_seconds_int(attr, **kwargs): # pylint: disable=unused-argument - """Serialize TimeDelta object into an integer number of seconds. - - :param TimeDelta attr: Object to be serialized. - :rtype: int - :return: serialized duration - """ - return Serializer._serialize_duration_numeric(attr, 1, True) - - @staticmethod - def serialize_duration_seconds_float(attr, **kwargs): # pylint: disable=unused-argument - """Serialize TimeDelta object into a floating point number of seconds. - - :param TimeDelta attr: Object to be serialized. - :rtype: float - :return: serialized duration - """ - return Serializer._serialize_duration_numeric(attr, 1, False) - - @staticmethod - def serialize_duration_milliseconds_int(attr, **kwargs): # pylint: disable=unused-argument - """Serialize TimeDelta object into an integer number of milliseconds. - - :param TimeDelta attr: Object to be serialized. - :rtype: int - :return: serialized duration - """ - return Serializer._serialize_duration_numeric(attr, 1000, True) - - @staticmethod - def serialize_duration_milliseconds_float(attr, **kwargs): # pylint: disable=unused-argument - """Serialize TimeDelta object into a floating point number of milliseconds. - - :param TimeDelta attr: Object to be serialized. - :rtype: float - :return: serialized duration - """ - return Serializer._serialize_duration_numeric(attr, 1000, False) - - @staticmethod - def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument - """Serialize Datetime object into RFC-1123 formatted string. - - :param Datetime attr: Object to be serialized. - :rtype: str - :raises TypeError: if format invalid. - :return: serialized rfc - """ - try: - if not attr.tzinfo: - _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") - utc = attr.utctimetuple() - except AttributeError as exc: - raise TypeError("RFC1123 object must be valid Datetime object.") from exc - - return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( - Serializer.days[utc.tm_wday], - utc.tm_mday, - Serializer.months[utc.tm_mon], - utc.tm_year, - utc.tm_hour, - utc.tm_min, - utc.tm_sec, - ) - - @staticmethod - def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument - """Serialize Datetime object into ISO-8601 formatted string. - - :param Datetime attr: Object to be serialized. - :rtype: str - :raises SerializationError: if format invalid. - :return: serialized iso - """ - if isinstance(attr, str): - attr = isodate.parse_datetime(attr) - try: - if not attr.tzinfo: - _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") - utc = attr.utctimetuple() - if utc.tm_year > 9999 or utc.tm_year < 1: - raise OverflowError("Hit max or min date") - - microseconds = str(attr.microsecond).rjust(6, "0").rstrip("0").ljust(3, "0") - if microseconds: - microseconds = "." + microseconds - date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format( - utc.tm_year, utc.tm_mon, utc.tm_mday, utc.tm_hour, utc.tm_min, utc.tm_sec - ) - return date + microseconds + "Z" - except (ValueError, OverflowError) as err: - msg = "Unable to serialize datetime object." - raise SerializationError(msg) from err - except AttributeError as err: - msg = "ISO-8601 object must be valid Datetime object." - raise TypeError(msg) from err - - @staticmethod - def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument - """Serialize Datetime object into IntTime format. - This is represented as seconds. - - :param Datetime attr: Object to be serialized. - :rtype: int - :raises SerializationError: if format invalid - :return: serialied unix - """ - if isinstance(attr, int): - return attr - try: - if not attr.tzinfo: - _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") - return int(calendar.timegm(attr.utctimetuple())) - except AttributeError as exc: - raise TypeError("Unix time object must be valid Datetime object.") from exc - - -def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument - key = attr_desc["key"] - working_data = data - - while "." in key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - dict_keys = cast(list[str], _FLATTEN.split(key)) - if len(dict_keys) == 1: - key = _decode_attribute_map_key(dict_keys[0]) - break - working_key = _decode_attribute_map_key(dict_keys[0]) - working_data = working_data.get(working_key, data) - if working_data is None: - # If at any point while following flatten JSON path see None, it means - # that all properties under are None as well - return None - key = ".".join(dict_keys[1:]) - - return working_data.get(key) - - -def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements - attr, attr_desc, data -): - key = attr_desc["key"] - working_data = data - - while "." in key: - dict_keys = _FLATTEN.split(key) - if len(dict_keys) == 1: - key = _decode_attribute_map_key(dict_keys[0]) - break - working_key = _decode_attribute_map_key(dict_keys[0]) - working_data = attribute_key_case_insensitive_extractor(working_key, None, working_data) - if working_data is None: - # If at any point while following flatten JSON path see None, it means - # that all properties under are None as well - return None - key = ".".join(dict_keys[1:]) - - if working_data: - return attribute_key_case_insensitive_extractor(key, None, working_data) - - -def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument - """Extract the attribute in "data" based on the last part of the JSON path key. - - :param str attr: The attribute to extract - :param dict attr_desc: The attribute description - :param dict data: The data to extract from - :rtype: object - :returns: The extracted attribute - """ - key = attr_desc["key"] - dict_keys = _FLATTEN.split(key) - return attribute_key_extractor(dict_keys[-1], None, data) - - -def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument - """Extract the attribute in "data" based on the last part of the JSON path key. - - This is the case insensitive version of "last_rest_key_extractor" - :param str attr: The attribute to extract - :param dict attr_desc: The attribute description - :param dict data: The data to extract from - :rtype: object - :returns: The extracted attribute - """ - key = attr_desc["key"] - dict_keys = _FLATTEN.split(key) - return attribute_key_case_insensitive_extractor(dict_keys[-1], None, data) - - -def attribute_key_extractor(attr, _, data): - return data.get(attr) - - -def attribute_key_case_insensitive_extractor(attr, _, data): - found_key = None - lower_attr = attr.lower() - for key in data: - if lower_attr == key.lower(): - found_key = key - break - - return data.get(found_key) - - -def _extract_name_from_internal_type(internal_type): - """Given an internal type XML description, extract correct XML name with namespace. - - :param dict internal_type: An model type - :rtype: tuple - :returns: A tuple XML name + namespace dict - """ - internal_type_xml_map = getattr(internal_type, "_xml_map", {}) - xml_name = internal_type_xml_map.get("name", internal_type.__name__) - xml_ns = internal_type_xml_map.get("ns", None) - if xml_ns: - xml_name = "{{{}}}{}".format(xml_ns, xml_name) - return xml_name - - -def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements - if isinstance(data, dict): - return None - - # Test if this model is XML ready first - if not isinstance(data, ET.Element): - return None - - xml_desc = attr_desc.get("xml", {}) - xml_name = xml_desc.get("name", attr_desc["key"]) - - # Look for a children - is_iter_type = attr_desc["type"].startswith("[") - is_wrapped = xml_desc.get("wrapped", False) - internal_type = attr_desc.get("internalType", None) - internal_type_xml_map = getattr(internal_type, "_xml_map", {}) - - # Integrate namespace if necessary - xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) - if xml_ns: - xml_name = "{{{}}}{}".format(xml_ns, xml_name) - - # If it's an attribute, that's simple - if xml_desc.get("attr", False): - return data.get(xml_name) - - # If it's x-ms-text, that's simple too - if xml_desc.get("text", False): - return data.text - - # Scenario where I take the local name: - # - Wrapped node - # - Internal type is an enum (considered basic types) - # - Internal type has no XML/Name node - if is_wrapped or (internal_type and (issubclass(internal_type, Enum) or "name" not in internal_type_xml_map)): - children = data.findall(xml_name) - # If internal type has a local name and it's not a list, I use that name - elif not is_iter_type and internal_type and "name" in internal_type_xml_map: - xml_name = _extract_name_from_internal_type(internal_type) - children = data.findall(xml_name) - # That's an array - else: - if internal_type: # Complex type, ignore itemsName and use the complex type name - items_name = _extract_name_from_internal_type(internal_type) - else: - items_name = xml_desc.get("itemsName", xml_name) - children = data.findall(items_name) - - if len(children) == 0: - if is_iter_type: - if is_wrapped: - return None # is_wrapped no node, we want None - return [] # not wrapped, assume empty list - return None # Assume it's not there, maybe an optional node. - - # If is_iter_type and not wrapped, return all found children - if is_iter_type: - if not is_wrapped: - return children - # Iter and wrapped, should have found one node only (the wrap one) - if len(children) != 1: - raise DeserializationError( - "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( - xml_name - ) - ) - return list(children[0]) # Might be empty list and that's ok. - - # Here it's not a itertype, we should have found one element only or empty - if len(children) > 1: - raise DeserializationError("Find several XML '{}' where it was not expected".format(xml_name)) - return children[0] - - -class Deserializer: - """Response object model deserializer. - - :param dict classes: Class type dictionary for deserializing complex types. - :ivar list key_extractors: Ordered list of extractors to be used by this deserializer. - """ - - basic_types = {str: "str", int: "int", bool: "bool", float: "float"} - - valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - - def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: - self.deserialize_type = { - "iso-8601": Deserializer.deserialize_iso, - "rfc-1123": Deserializer.deserialize_rfc, - "unix-time": Deserializer.deserialize_unix, - "duration": Deserializer.deserialize_duration, - "duration-seconds-int": Deserializer.deserialize_duration_seconds, - "duration-seconds-float": Deserializer.deserialize_duration_seconds, - "duration-milliseconds-int": Deserializer.deserialize_duration_milliseconds, - "duration-milliseconds-float": Deserializer.deserialize_duration_milliseconds, - "date": Deserializer.deserialize_date, - "time": Deserializer.deserialize_time, - "decimal": Deserializer.deserialize_decimal, - "long": Deserializer.deserialize_long, - "bytearray": Deserializer.deserialize_bytearray, - "base64": Deserializer.deserialize_base64, - "object": self.deserialize_object, - "[]": self.deserialize_iter, - "{}": self.deserialize_dict, - } - self.deserialize_expected_types = { - "duration": (isodate.Duration, datetime.timedelta), - "duration-seconds-int": (isodate.Duration, datetime.timedelta), - "duration-seconds-float": (isodate.Duration, datetime.timedelta), - "duration-milliseconds-int": (isodate.Duration, datetime.timedelta), - "duration-milliseconds-float": (isodate.Duration, datetime.timedelta), - "iso-8601": (datetime.datetime), - } - self.dependencies: dict[str, type] = dict(classes) if classes else {} - self.key_extractors = [rest_key_extractor, xml_key_extractor] - # Additional properties only works if the "rest_key_extractor" is used to - # extract the keys. Making it to work whatever the key extractor is too much - # complicated, with no real scenario for now. - # So adding a flag to disable additional properties detection. This flag should be - # used if your expect the deserialization to NOT come from a JSON REST syntax. - # Otherwise, result are unexpected - self.additional_properties_detection = True - - def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements - """Call the deserializer to process a REST response. - - :param str target_obj: Target data type to deserialize to. - :param requests.Response response_data: REST response object. - :param str content_type: Swagger "produces" if available. - :raises DeserializationError: if deserialization fails. - :return: Deserialized object. - :rtype: object - """ - # Fast path for header deserialization: response_data is a plain str or None - # and target_obj is a simple scalar type. This avoids the expensive - # _unpack_content → _deserialize → _classify_target → deserialize_data chain. - if response_data is None: - return None - if target_obj == "str" and isinstance(response_data, str): - return response_data - if isinstance(response_data, str): - if target_obj == "int": - return int(response_data) - if target_obj == "bool": - if response_data in ("true", "1", "True"): - return True - if response_data in ("false", "0", "False"): - return False - return bool(response_data) - if target_obj == "rfc-1123": - return Deserializer.deserialize_rfc(response_data) - if target_obj == "bytearray": - return Deserializer.deserialize_bytearray(response_data) - - data = self._unpack_content(response_data, content_type) - return self._deserialize(target_obj, data) - - def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements - """Call the deserializer on a model. - - Data needs to be already deserialized as JSON or XML ElementTree - - :param str target_obj: Target data type to deserialize to. - :param object data: Object to deserialize. - :raises DeserializationError: if deserialization fails. - :return: Deserialized object. - :rtype: object - """ - # This is already a model, go recursive just in case - if hasattr(data, "_attribute_map"): - constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] - try: - for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access - if attr in constants: - continue - value = getattr(data, attr) - if value is None: - continue - local_type = mapconfig["type"] - internal_data_type = local_type.strip("[]{}") - if internal_data_type not in self.dependencies or isinstance(internal_data_type, Enum): - continue - setattr(data, attr, self._deserialize(local_type, value)) - return data - except AttributeError: - return - - response, class_name = self._classify_target(target_obj, data) - - if isinstance(response, str): - return self.deserialize_data(data, response) - if isinstance(response, type) and issubclass(response, Enum): - return self.deserialize_enum(data, response) - - if data is None or data is CoreNull: - return data - try: - attributes = response._attribute_map # type: ignore # pylint: disable=protected-access - d_attrs = {} - for attr, attr_desc in attributes.items(): - # Check empty string. If it's not empty, someone has a real "additionalProperties"... - if attr == "additional_properties" and attr_desc["key"] == "": - continue - raw_value = None - # Enhance attr_desc with some dynamic data - attr_desc = attr_desc.copy() # Do a copy, do not change the real one - internal_data_type = attr_desc["type"].strip("[]{}") - if internal_data_type in self.dependencies: - attr_desc["internalType"] = self.dependencies[internal_data_type] - - for key_extractor in self.key_extractors: - found_value = key_extractor(attr, attr_desc, data) - if found_value is not None: - if raw_value is not None and raw_value != found_value: - msg = ( - "Ignoring extracted value '%s' from %s for key '%s'" - " (duplicate extraction, follow extractors order)" - ) - _LOGGER.warning(msg, found_value, key_extractor, attr) - continue - raw_value = found_value - - value = self.deserialize_data(raw_value, attr_desc["type"]) - d_attrs[attr] = value - except (AttributeError, TypeError, KeyError) as err: - msg = "Unable to deserialize to object: " + class_name # type: ignore - raise DeserializationError(msg) from err - additional_properties = self._build_additional_properties(attributes, data) - return self._instantiate_model(response, d_attrs, additional_properties) - - def _build_additional_properties(self, attribute_map, data): - if not self.additional_properties_detection: - return None - if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != "": - # Check empty string. If it's not empty, someone has a real "additionalProperties" - return None - if isinstance(data, ET.Element): - data = {el.tag: el.text for el in data} - - known_keys = { - _decode_attribute_map_key(_FLATTEN.split(desc["key"])[0]) - for desc in attribute_map.values() - if desc["key"] != "" - } - present_keys = set(data.keys()) - missing_keys = present_keys - known_keys - return {key: data[key] for key in missing_keys} - - def _classify_target(self, target, data): - """Check to see whether the deserialization target object can - be classified into a subclass. - Once classification has been determined, initialize object. - - :param str target: The target object type to deserialize to. - :param str/dict data: The response data to deserialize. - :return: The classified target object and its class name. - :rtype: tuple - """ - if target is None: - return None, None - - if isinstance(target, str): - try: - target = self.dependencies[target] - except KeyError: - return target, target - - try: - target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access - except AttributeError: - pass # Target is not a Model, no classify - return target, target.__class__.__name__ # type: ignore - - def failsafe_deserialize(self, target_obj, data, content_type=None): - """Ignores any errors encountered in deserialization, - and falls back to not deserializing the object. Recommended - for use in error deserialization, as we want to return the - HttpResponseError to users, and not have them deal with - a deserialization error. - - :param str target_obj: The target object type to deserialize to. - :param str/dict data: The response data to deserialize. - :param str content_type: Swagger "produces" if available. - :return: Deserialized object. - :rtype: object - """ - try: - return self(target_obj, data, content_type=content_type) - except: # pylint: disable=bare-except - _LOGGER.debug( - "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True - ) - return None - - @staticmethod - def _unpack_content(raw_data, content_type=None): - """Extract the correct structure for deserialization. - - If raw_data is a PipelineResponse, try to extract the result of RawDeserializer. - if we can't, raise. Your Pipeline should have a RawDeserializer. - - If not a pipeline response and raw_data is bytes or string, use content-type - to decode it. If no content-type, try JSON. - - If raw_data is something else, bypass all logic and return it directly. - - :param obj raw_data: Data to be processed. - :param str content_type: How to parse if raw_data is a string/bytes. - :raises JSONDecodeError: If JSON is requested and parsing is impossible. - :raises UnicodeDecodeError: If bytes is not UTF8 - :rtype: object - :return: Unpacked content. - """ - # Assume this is enough to detect a Pipeline Response without importing it - context = getattr(raw_data, "context", {}) - if context: - if RawDeserializer.CONTEXT_NAME in context: - return context[RawDeserializer.CONTEXT_NAME] - raise ValueError("This pipeline didn't have the RawDeserializer policy; can't deserialize") - - # Assume this is enough to recognize universal_http.ClientResponse without importing it - if hasattr(raw_data, "body"): - return RawDeserializer.deserialize_from_http_generics(raw_data.text(), raw_data.headers) - - # Assume this enough to recognize requests.Response without importing it. - if hasattr(raw_data, "_content_consumed"): - return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) - - if isinstance(raw_data, (str, bytes)) or hasattr(raw_data, "read"): - return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore - return raw_data - - def _instantiate_model(self, response, attrs, additional_properties=None): - """Instantiate a response model passing in deserialized args. - - :param Response response: The response model class. - :param dict attrs: The deserialized response attributes. - :param dict additional_properties: Additional properties to be set. - :rtype: Response - :return: The instantiated response model. - """ - if callable(response): - subtype = getattr(response, "_subtype_map", {}) - try: - readonly = [ - k - for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore - if v.get("readonly") - ] - const = [ - k - for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore - if v.get("constant") - ] - kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} - response_obj = response(**kwargs) - for attr in readonly: - setattr(response_obj, attr, attrs.get(attr)) - if additional_properties: - response_obj.additional_properties = additional_properties # type: ignore - return response_obj - except TypeError as err: - msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore - raise DeserializationError(msg + str(err)) from err - else: - try: - for attr, value in attrs.items(): - setattr(response, attr, value) - return response - except Exception as exp: - msg = "Unable to populate response model. " - msg += "Type: {}, Error: {}".format(type(response), exp) - raise DeserializationError(msg) from exp - - def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements - """Process data for deserialization according to data type. - - :param str data: The response string to be deserialized. - :param str data_type: The type to deserialize to. - :raises DeserializationError: if deserialization fails. - :return: Deserialized object. - :rtype: object - """ - if data is None: - return data - - try: - if not data_type: - return data - if data_type in self.basic_types.values(): - return self.deserialize_basic(data, data_type) - if data_type in self.deserialize_type: - if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): - return data - - is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment - "object", - "[]", - r"{}", - ] - if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: - return None - data_val = self.deserialize_type[data_type](data) - return data_val - - iter_type = data_type[0] + data_type[-1] - if iter_type in self.deserialize_type: - return self.deserialize_type[iter_type](data, data_type[1:-1]) - - obj_type = self.dependencies[data_type] - if issubclass(obj_type, Enum): - if isinstance(data, ET.Element): - data = data.text - return self.deserialize_enum(data, obj_type) - - except (ValueError, TypeError, AttributeError) as err: - msg = "Unable to deserialize response data." - msg += " Data: {}, {}".format(data, data_type) - raise DeserializationError(msg) from err - return self._deserialize(obj_type, data) - - def deserialize_iter(self, attr, iter_type): - """Deserialize an iterable. - - :param list attr: Iterable to be deserialized. - :param str iter_type: The type of object in the iterable. - :return: Deserialized iterable. - :rtype: list - """ - if attr is None: - return None - if isinstance(attr, ET.Element): # If I receive an element here, get the children - attr = list(attr) - if not isinstance(attr, (list, set)): - raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format(iter_type, type(attr))) - return [self.deserialize_data(a, iter_type) for a in attr] - - def deserialize_dict(self, attr, dict_type): - """Deserialize a dictionary. - - :param dict/list attr: Dictionary to be deserialized. Also accepts - a list of key, value pairs. - :param str dict_type: The object type of the items in the dictionary. - :return: Deserialized dictionary. - :rtype: dict - """ - if isinstance(attr, list): - return {x["key"]: self.deserialize_data(x["value"], dict_type) for x in attr} - - if isinstance(attr, ET.Element): - # Transform value into {"Key": "value"} - attr = {el.tag: el.text for el in attr} - return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} - - def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements - """Deserialize a generic object. - This will be handled as a dictionary. - - :param dict attr: Dictionary to be deserialized. - :return: Deserialized object. - :rtype: dict - :raises TypeError: if non-builtin datatype encountered. - """ - if attr is None: - return None - if isinstance(attr, ET.Element): - # Do no recurse on XML, just return the tree as-is - return attr - if isinstance(attr, str): - return self.deserialize_basic(attr, "str") - obj_type = type(attr) - if obj_type in self.basic_types: - return self.deserialize_basic(attr, self.basic_types[obj_type]) - if obj_type is _long_type: - return self.deserialize_long(attr) - - if obj_type == dict: - deserialized = {} - for key, value in attr.items(): - try: - deserialized[key] = self.deserialize_object(value, **kwargs) - except ValueError: - deserialized[key] = None - return deserialized - - if obj_type == list: - deserialized = [] - for obj in attr: - try: - deserialized.append(self.deserialize_object(obj, **kwargs)) - except ValueError: - pass - return deserialized - - error = "Cannot deserialize generic object with type: " - raise TypeError(error + str(obj_type)) - - def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements - """Deserialize basic builtin data type from string. - Will attempt to convert to str, int, float and bool. - This function will also accept '1', '0', 'true' and 'false' as - valid bool values. - - :param str attr: response string to be deserialized. - :param str data_type: deserialization data type. - :return: Deserialized basic type. - :rtype: str, int, float or bool - :raises TypeError: if string format is not valid or data_type is not one of str, int, float, bool. - """ - # If we're here, data is supposed to be a basic type. - # If it's still an XML node, take the text - if isinstance(attr, ET.Element): - attr = attr.text - if not attr: - if data_type == "str": - # None or '', node is empty string. - return "" - # None or '', node with a strong type is None. - # Don't try to model "empty bool" or "empty int" - return None - - if data_type == "bool": - if attr in [True, False, 1, 0]: - return bool(attr) - if isinstance(attr, str): - if attr.lower() in ["true", "1"]: - return True - if attr.lower() in ["false", "0"]: - return False - raise TypeError("Invalid boolean value: {}".format(attr)) - - if data_type == "str": - return self.deserialize_unicode(attr) - if data_type == "int": - return int(attr) - if data_type == "float": - return float(attr) - raise TypeError("Unknown basic data type: {}".format(data_type)) - - @staticmethod - def deserialize_unicode(data): - """Preserve unicode objects in Python 2, otherwise return data - as a string. - - :param str data: response string to be deserialized. - :return: Deserialized string. - :rtype: str or unicode - """ - # We might be here because we have an enum modeled as string, - # and we try to deserialize a partial dict with enum inside - if isinstance(data, Enum): - return data - - # Consider this is real string - try: - if isinstance(data, unicode): # type: ignore - return data - except NameError: - return str(data) - return str(data) - - @staticmethod - def deserialize_enum(data, enum_obj): - """Deserialize string into enum object. - - If the string is not a valid enum value it will be returned as-is - and a warning will be logged. - - :param str data: Response string to be deserialized. If this value is - None or invalid it will be returned as-is. - :param Enum enum_obj: Enum object to deserialize to. - :return: Deserialized enum object. - :rtype: Enum - """ - if isinstance(data, enum_obj) or data is None: - return data - if isinstance(data, Enum): - data = data.value - if isinstance(data, int): - # Workaround. We might consider remove it in the future. - try: - return list(enum_obj.__members__.values())[data] - except IndexError as exc: - error = "{!r} is not a valid index for enum {!r}" - raise DeserializationError(error.format(data, enum_obj)) from exc - try: - return enum_obj(str(data)) - except ValueError: - for enum_value in enum_obj: - if enum_value.value.lower() == str(data).lower(): - return enum_value - # We don't fail anymore for unknown value, we deserialize as a string - _LOGGER.warning("Deserializer is not able to find %s as valid enum in %s", data, enum_obj) - return Deserializer.deserialize_unicode(data) - - @staticmethod - def deserialize_bytearray(attr): - """Deserialize string into bytearray. - - :param str attr: response string to be deserialized. - :return: Deserialized bytearray - :rtype: bytearray - :raises TypeError: if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - return bytearray(b64decode(attr)) # type: ignore - - @staticmethod - def deserialize_base64(attr): - """Deserialize base64 encoded string into string. - - :param str attr: response string to be deserialized. - :return: Deserialized base64 string - :rtype: bytearray - :raises TypeError: if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore - attr = attr + padding # type: ignore - encoded = attr.replace("-", "+").replace("_", "/") - return b64decode(encoded) - - @staticmethod - def deserialize_decimal(attr): - """Deserialize string into Decimal object. - - :param str attr: response string to be deserialized. - :return: Deserialized decimal - :raises DeserializationError: if string format invalid. - :rtype: decimal - """ - if isinstance(attr, ET.Element): - attr = attr.text - try: - return decimal.Decimal(str(attr)) # type: ignore - except decimal.DecimalException as err: - msg = "Invalid decimal {}".format(attr) - raise DeserializationError(msg) from err - - @staticmethod - def deserialize_long(attr): - """Deserialize string into long (Py2) or int (Py3). - - :param str attr: response string to be deserialized. - :return: Deserialized int - :rtype: long or int - :raises ValueError: if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - return _long_type(attr) # type: ignore - - @staticmethod - def deserialize_duration(attr): - """Deserialize ISO-8601 formatted string into TimeDelta object. - - :param str attr: response string to be deserialized. - :return: Deserialized duration - :rtype: TimeDelta - :raises DeserializationError: if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - try: - duration = isodate.parse_duration(attr) - except (ValueError, OverflowError, AttributeError) as err: - msg = "Cannot deserialize duration object." - raise DeserializationError(msg) from err - return duration - - @staticmethod - def _deserialize_duration_numeric(attr, unit): - """Deserialize a numeric duration value into a TimeDelta object. - - :param float attr: response value to be deserialized. - :param str unit: The wire unit, used as the ``timedelta`` keyword - (``"seconds"`` or ``"milliseconds"``). - :return: Deserialized duration - :rtype: TimeDelta - :raises DeserializationError: if value is invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - try: - duration = datetime.timedelta(**{unit: float(attr)}) # type: ignore - except (ValueError, OverflowError, TypeError) as err: - msg = "Cannot deserialize duration object." - raise DeserializationError(msg) from err - return duration - - @staticmethod - def deserialize_duration_seconds(attr): - """Deserialize a numeric number of seconds into a TimeDelta object. - - :param float attr: response value to be deserialized. - :return: Deserialized duration - :rtype: TimeDelta - :raises DeserializationError: if value is invalid. - """ - return Deserializer._deserialize_duration_numeric(attr, "seconds") - - @staticmethod - def deserialize_duration_milliseconds(attr): - """Deserialize a numeric number of milliseconds into a TimeDelta object. - - :param float attr: response value to be deserialized. - :return: Deserialized duration - :rtype: TimeDelta - :raises DeserializationError: if value is invalid. - """ - return Deserializer._deserialize_duration_numeric(attr, "milliseconds") - - @staticmethod - def deserialize_date(attr): - """Deserialize ISO-8601 formatted string into Date object. - - :param str attr: response string to be deserialized. - :return: Deserialized date - :rtype: Date - :raises DeserializationError: if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore - raise DeserializationError("Date must have only digits and -. Received: %s" % attr) - # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. - return isodate.parse_date(attr, defaultmonth=0, defaultday=0) - - @staticmethod - def deserialize_time(attr): - """Deserialize ISO-8601 formatted string into time object. - - :param str attr: response string to be deserialized. - :return: Deserialized time - :rtype: datetime.time - :raises DeserializationError: if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore - raise DeserializationError("Date must have only digits and -. Received: %s" % attr) - return isodate.parse_time(attr) - - @staticmethod - def deserialize_rfc(attr): - """Deserialize RFC-1123 formatted string into Datetime object. - - :param str attr: response string to be deserialized. - :return: Deserialized RFC datetime - :rtype: Datetime - :raises DeserializationError: if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - try: - parsed_date = email.utils.parsedate_tz(attr) # type: ignore - date_obj = datetime.datetime( - *parsed_date[:6], tzinfo=datetime.timezone(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) - ) - if not date_obj.tzinfo: - date_obj = date_obj.astimezone(tz=TZ_UTC) - except ValueError as err: - msg = "Cannot deserialize to rfc datetime object." - raise DeserializationError(msg) from err - return date_obj - - @staticmethod - def deserialize_iso(attr): - """Deserialize ISO-8601 formatted string into Datetime object. - - :param str attr: response string to be deserialized. - :return: Deserialized ISO datetime - :rtype: Datetime - :raises DeserializationError: if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - try: - attr = attr.upper() # type: ignore - match = Deserializer.valid_date.match(attr) - if not match: - raise ValueError("Invalid datetime string: " + attr) - - check_decimal = attr.split(".") - if len(check_decimal) > 1: - decimal_str = "" - for digit in check_decimal[1]: - if digit.isdigit(): - decimal_str += digit - else: - break - if len(decimal_str) > 6: - attr = attr.replace(decimal_str, decimal_str[0:6]) - - date_obj = isodate.parse_datetime(attr) - test_utc = date_obj.utctimetuple() - if test_utc.tm_year > 9999 or test_utc.tm_year < 1: - raise OverflowError("Hit max or min date") - except (ValueError, OverflowError, AttributeError) as err: - msg = "Cannot deserialize datetime object." - raise DeserializationError(msg) from err - return date_obj - - @staticmethod - def deserialize_unix(attr): - """Serialize Datetime object into IntTime format. - This is represented as seconds. - - :param int attr: Object to be serialized. - :return: Deserialized datetime - :rtype: Datetime - :raises DeserializationError: if format invalid - """ - if isinstance(attr, ET.Element): - attr = int(attr.text) # type: ignore - try: - attr = int(attr) - date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) - except ValueError as err: - msg = "Cannot deserialize to unix datetime object." - raise DeserializationError(msg) from err - return date_obj diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_version.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_version.py deleted file mode 100644 index be71c81bd282..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/_version.py +++ /dev/null @@ -1,9 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -VERSION = "1.0.0b1" diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/__init__.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/__init__.py deleted file mode 100644 index e670329dd024..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/__init__.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._client import VoiceAgentsClient # type: ignore - -try: - from ._patch import __all__ as _patch_all - from ._patch import * -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "VoiceAgentsClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore - -_patch_sdk() diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_client.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_client.py deleted file mode 100644 index 9020e5ea13b4..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_client.py +++ /dev/null @@ -1,119 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -import sys -from typing import Any, Awaitable, TYPE_CHECKING - -from azure.core import AsyncPipelineClient -from azure.core.pipeline import policies -from azure.core.rest import AsyncHttpResponse, HttpRequest - -from .._utils.serialization import Deserializer, Serializer -from ._configuration import VoiceAgentsClientConfiguration -from .operations import AgentEndpointConversationsOperations, VoiceAgentsOperations - -if sys.version_info >= (3, 11): - from typing import Self -else: - from typing_extensions import Self # type: ignore - -if TYPE_CHECKING: - from azure.core.credentials_async import AsyncTokenCredential - - -class VoiceAgentsClient: # pylint: disable=docstring-keyword-should-match-keyword-only - """VoiceAgentsClient. - - :ivar agent_endpoint_conversations: AgentEndpointConversationsOperations operations - :vartype agent_endpoint_conversations: - azure.ai.voiceagents.aio.operations.AgentEndpointConversationsOperations - :ivar voice_agents: VoiceAgentsOperations operations - :vartype voice_agents: azure.ai.voiceagents.aio.operations.VoiceAgentsOperations - :param endpoint: Foundry Project endpoint in the form - "https://{ai-services-account-name}.services.ai.azure.com/api/projects/{project-name}". If you - only have one Project in your Foundry Hub, or to target the default Project in your Hub, use - the form "https://{ai-services-account-name}.services.ai.azure.com/api/projects/_project". - Required. - :type endpoint: str - :param credential: Credential used to authenticate requests to the service. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :keyword api_version: The API version to use for this operation. Known values are "v1" and - None. Default value is None. If not set, the operation's default API version will be used. Note - that overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__(self, endpoint: str, credential: "AsyncTokenCredential", **kwargs: Any) -> None: - _endpoint = "{endpoint}" - self._config = VoiceAgentsClientConfiguration(endpoint=endpoint, credential=credential, **kwargs) - - _policies = kwargs.pop("policies", None) - if _policies is None: - _policies = [ - policies.RequestIdPolicy(**kwargs), - self._config.headers_policy, - self._config.user_agent_policy, - self._config.proxy_policy, - policies.ContentDecodePolicy(**kwargs), - self._config.redirect_policy, - self._config.retry_policy, - self._config.authentication_policy, - self._config.custom_hook_policy, - self._config.logging_policy, - policies.DistributedTracingPolicy(**kwargs), - policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, - self._config.http_logging_policy, - ] - self._client: AsyncPipelineClient = AsyncPipelineClient(base_url=_endpoint, policies=_policies, **kwargs) - - self._serialize = Serializer() - self._deserialize = Deserializer() - self._serialize.client_side_validation = False - self.agent_endpoint_conversations = AgentEndpointConversationsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.voice_agents = VoiceAgentsOperations(self._client, self._config, self._serialize, self._deserialize) - - def send_request( - self, request: HttpRequest, *, stream: bool = False, **kwargs: Any - ) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client.send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - - request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) - return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> Self: - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details: Any) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_configuration.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_configuration.py deleted file mode 100644 index bbdeb569378e..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_configuration.py +++ /dev/null @@ -1,69 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.pipeline import policies - -from .._version import VERSION - -if TYPE_CHECKING: - from azure.core.credentials_async import AsyncTokenCredential - - -class VoiceAgentsClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only - """Configuration for VoiceAgentsClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param endpoint: Foundry Project endpoint in the form - "https://{ai-services-account-name}.services.ai.azure.com/api/projects/{project-name}". If you - only have one Project in your Foundry Hub, or to target the default Project in your Hub, use - the form "https://{ai-services-account-name}.services.ai.azure.com/api/projects/_project". - Required. - :type endpoint: str - :param credential: Credential used to authenticate requests to the service. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :keyword api_version: The API version to use for this operation. Known values are "v1" and - None. Default value is None. If not set, the operation's default API version will be used. Note - that overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__(self, endpoint: str, credential: "AsyncTokenCredential", **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "v1") - - if endpoint is None: - raise ValueError("Parameter 'endpoint' must not be None.") - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - - self.endpoint = endpoint - self.credential = credential - self.api_version = api_version - self.credential_scopes = kwargs.pop("credential_scopes", ["https://ai.azure.com/.default"]) - kwargs.setdefault("sdk_moniker", "ai-voiceagents/{}".format(VERSION)) - self.polling_interval = kwargs.get("polling_interval", 30) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_patch.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_patch.py deleted file mode 100644 index cd188babb2ce..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/_patch.py +++ /dev/null @@ -1,82 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------- -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import Any, Optional, TYPE_CHECKING - -import aiohttp - -from ._client import VoiceAgentsClient as _GeneratedVoiceAgentsClient -from ._realtime import ( - AsyncRealtime, - AsyncRealtimeConnection, - AsyncRealtimeConnectionManager, - ClientEvent, - ConversationItem, - ServerEvent, -) - -if TYPE_CHECKING: - from azure.core.credentials_async import AsyncTokenCredential - - -class VoiceAgentsClient(_GeneratedVoiceAgentsClient): # pylint: disable=client-accepts-api-version-keyword - """VoiceAgentsClient with a realtime streaming namespace. - - Adds the :attr:`realtime` namespace on top of the generated HTTP client, exposing - ``connect(...)`` for realtime WebSocket sessions. - """ - - _realtime: Optional[AsyncRealtime] = None - - def __init__( - self, endpoint: str, credential: "AsyncTokenCredential", *, api_version: Optional[str] = None, **kwargs: Any - ) -> None: - # Work around an azure-core/aiohttp limitation: azure-core disables - # aiohttp's native decompression but only re-implements gzip/deflate, - # while aiohttp advertises "br" by default. Supplying the session that - # the default AioHttpTransport will adopt keeps Accept-Encoding limited - # to encodings azure-core can actually decompress, without importing a - # concrete transport type. - if "transport" not in kwargs and "session" not in kwargs: - kwargs["session"] = aiohttp.ClientSession(headers={"Accept-Encoding": "gzip, deflate"}) - if api_version is None: - super().__init__(endpoint, credential, **kwargs) - else: - super().__init__(endpoint, credential, api_version=api_version, **kwargs) - - @property - def realtime(self) -> AsyncRealtime: - """Realtime streaming entry point. - - :return: The realtime namespace, exposing ``connect(...)``. - :rtype: ~azure.ai.voiceagents.aio.AsyncRealtime - """ - if self._realtime is None: - self._realtime = AsyncRealtime(self) - return self._realtime - - -__all__: list[str] = [ - "VoiceAgentsClient", - "AsyncRealtime", - "AsyncRealtimeConnection", - "AsyncRealtimeConnectionManager", - "ClientEvent", - "ConversationItem", - "ServerEvent", -] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/__init__.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/__init__.py deleted file mode 100644 index 0840d3975c41..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import AgentEndpointConversationsOperations # type: ignore -from ._operations import VoiceAgentsOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "AgentEndpointConversationsOperations", - "VoiceAgentsOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/_operations.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/_operations.py deleted file mode 100644 index 2dc75f842b7b..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/_operations.py +++ /dev/null @@ -1,2742 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -import json -from typing import Any, AsyncIterator, Callable, IO, Literal, Optional, TYPE_CHECKING, TypeVar, Union, overload - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict - -from ... import models as _models, types as _types -from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize -from ..._utils.serialization import Deserializer, Serializer -from ...models._enums import AgentDefinitionOptInKeys -from ...operations._operations import ( - build_agent_endpoint_conversations_delete_agent_conversation_request, - build_agent_endpoint_conversations_get_agent_conversation_audio_content_request, - build_agent_endpoint_conversations_get_agent_conversation_audio_request, - build_agent_endpoint_conversations_get_agent_conversation_item_audio_content_request, - build_agent_endpoint_conversations_get_agent_conversation_item_audio_request, - build_agent_endpoint_conversations_get_agent_conversation_item_request, - build_agent_endpoint_conversations_get_agent_conversation_request, - build_agent_endpoint_conversations_get_agent_conversation_response_request, - build_agent_endpoint_conversations_list_agent_conversation_items_request, - build_agent_endpoint_conversations_list_agent_conversation_response_items_request, - build_agent_endpoint_conversations_list_agent_conversation_responses_request, - build_voice_agents_create_voice_agent_request, - build_voice_agents_create_voice_agent_version_request, - build_voice_agents_delete_voice_agent_request, - build_voice_agents_delete_voice_agent_version_request, - build_voice_agents_disable_voice_agent_request, - build_voice_agents_enable_voice_agent_request, - build_voice_agents_generate_voice_agent_request, - build_voice_agents_get_voice_agent_request, - build_voice_agents_get_voice_agent_version_request, - build_voice_agents_list_voice_agent_versions_request, - build_voice_agents_list_voice_agents_request, - build_voice_agents_update_voice_agent_request, -) -from .._configuration import VoiceAgentsClientConfiguration - -if TYPE_CHECKING: - from ... import _unions -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] -_Unset: Any = object() - - -class AgentEndpointConversationsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.voiceagents.aio.VoiceAgentsClient`'s - :attr:`agent_endpoint_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: VoiceAgentsClientConfiguration = 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_async - async def get_agent_conversation( - self, - agent_name: str, - conversation_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> _models.VoiceConversation: - """Get a voice agent conversation. - - Retrieves a single conversation recorded for the specified voice agent endpoint by its id. - Returns ``404`` when the conversation was not persisted (``store = false``) or does not exist. - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation to retrieve. Required. - :type conversation_id: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :return: VoiceConversation. The VoiceConversation is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceConversation - :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.VoiceConversation] = kwargs.pop("cls", None) - - _request = build_agent_endpoint_conversations_get_agent_conversation_request( - agent_name=agent_name, - conversation_id=conversation_id, - foundry_features=foundry_features, - 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.VoiceConversation, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete_agent_conversation( - self, - agent_name: str, - conversation_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> None: - """Delete a voice agent conversation. - - Deletes a conversation and all of its stored data — responses, items, and any audio (cascade). - This is the customer's explicit data-deletion control for voice conversations. - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation to delete. Required. - :type conversation_id: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :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_agent_endpoint_conversations_delete_agent_conversation_request( - agent_name=agent_name, - conversation_id=conversation_id, - foundry_features=foundry_features, - 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_agent_conversation_responses( - self, - agent_name: str, - conversation_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.VoiceResponse"]: - """List responses in a voice agent conversation. - - Returns a paged collection of the responses (model inference turns) recorded for the specified - conversation. The per-response ``output`` projection may be omitted here; use the - response-items route for the canonical paged output. Returns ``404`` when the conversation was - not persisted (``store = false``). - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation whose responses are listed. Required. - :type conversation_id: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :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.voiceagents.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 VoiceResponse - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.voiceagents.models.VoiceResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[list[_models.VoiceResponse]] = 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_agent_endpoint_conversations_list_agent_conversation_responses_request( - agent_name=agent_name, - conversation_id=conversation_id, - foundry_features=foundry_features, - 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.VoiceResponse], - 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_agent_conversation_response( - self, - agent_name: str, - conversation_id: str, - response_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> _models.VoiceResponse: - """Get a voice agent conversation response. - - Retrieves a single response from the specified conversation by its id, including its ``output`` - items, ``usage``, and status. Returns ``404`` when the conversation or response was not - persisted (``store = false``). - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the response. Required. - :type conversation_id: str - :param response_id: The id of the response to retrieve. Required. - :type response_id: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :return: VoiceResponse. The VoiceResponse is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceResponse - :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.VoiceResponse] = kwargs.pop("cls", None) - - _request = build_agent_endpoint_conversations_get_agent_conversation_response_request( - agent_name=agent_name, - conversation_id=conversation_id, - response_id=response_id, - foundry_features=foundry_features, - 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.VoiceResponse, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_agent_conversation_response_items( - self, - agent_name: str, - conversation_id: str, - response_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.VoiceConversationItem"]: - """List items produced by a voice agent conversation response. - - Returns a paged collection of the output items produced by a specific response (the response's - output projection). For the complete ordered conversation history — including user input and - client-created tool outputs — use the conversation items route instead. Returns ``404`` when - the conversation or response was not persisted (``store = false``). - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the response. Required. - :type conversation_id: str - :param response_id: The id of the response whose output items are listed. Required. - :type response_id: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :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.voiceagents.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 VoiceConversationItem - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.voiceagents.models.VoiceConversationItem] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[list[_models.VoiceConversationItem]] = 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_agent_endpoint_conversations_list_agent_conversation_response_items_request( - agent_name=agent_name, - conversation_id=conversation_id, - response_id=response_id, - foundry_features=foundry_features, - 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.VoiceConversationItem], - 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 - def list_agent_conversation_items( - self, - agent_name: str, - conversation_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.VoiceConversationItem"]: - """List items in a voice agent conversation. - - Returns a paged collection of items — the complete ordered conversation history, including user - input, assistant output, and client-created tool outputs (transcripts + tool events). Returns - ``404`` when the conversation was not persisted (``store = false``). - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation whose items are listed. Required. - :type conversation_id: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :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.voiceagents.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 VoiceConversationItem - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.voiceagents.models.VoiceConversationItem] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[list[_models.VoiceConversationItem]] = 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_agent_endpoint_conversations_list_agent_conversation_items_request( - agent_name=agent_name, - conversation_id=conversation_id, - foundry_features=foundry_features, - 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.VoiceConversationItem], - 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_agent_conversation_item( - self, - agent_name: str, - conversation_id: str, - item_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> _models.VoiceConversationItem: - """Get a voice agent conversation item. - - Retrieves a single item from the specified conversation by its id, including its transcript. An - ``input_audio``/``output_audio`` content part indicates that audio is available for the item; - the canonical per-item audio metadata is the ``/items/{item_id}/audio`` resource, and the bytes - are streamed by ``/items/{item_id}/audio/content``. Returns ``404`` when the conversation or - item was not persisted (``store = false``). - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the item. Required. - :type conversation_id: str - :param item_id: The id of the conversation item to retrieve. Required. - :type item_id: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :return: VoiceConversationItem. The VoiceConversationItem is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceConversationItem - :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.VoiceConversationItem] = kwargs.pop("cls", None) - - _request = build_agent_endpoint_conversations_get_agent_conversation_item_request( - agent_name=agent_name, - conversation_id=conversation_id, - item_id=item_id, - foundry_features=foundry_features, - 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.VoiceConversationItem, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get_agent_conversation_item_audio( - self, - agent_name: str, - conversation_id: str, - item_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> _models.VoiceItemAudioResponse: - """Get a voice agent conversation item's audio metadata. - - Returns metadata for a single conversation item's audio segment, including the common playback - facts (role, format/codec, sample rate, channels, offset, duration) for both Foundry-managed - and bring-your-own-storage (BYOS) recordings; for BYOS the response additionally includes - ``blob_uri``, the URI of the recording in the customer's own storage (no SAS) that the customer - downloads with their own credentials. Requires the conversation to have persisted audio - (``store = true``); returns ``404`` when the conversation, item, or its audio was not - persisted. - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the item. Required. - :type conversation_id: str - :param item_id: The id of the conversation item whose audio metadata is retrieved. Required. - :type item_id: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :return: VoiceItemAudioResponse. The VoiceItemAudioResponse is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceItemAudioResponse - :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.VoiceItemAudioResponse] = kwargs.pop("cls", None) - - _request = build_agent_endpoint_conversations_get_agent_conversation_item_audio_request( - agent_name=agent_name, - conversation_id=conversation_id, - item_id=item_id, - foundry_features=foundry_features, - 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.VoiceItemAudioResponse, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get_agent_conversation_item_audio_content( # pylint: disable=name-too-long - self, - agent_name: str, - conversation_id: str, - item_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> AsyncIterator[bytes]: - """Stream a voice agent conversation item's audio. - - Streams a single conversation item's audio as a WAV (``audio/wav``) byte stream through the - service (no SAS URL). This route serves Foundry-managed storage only. For - bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download - directly from customer storage using the ``blob_uri`` returned by the item's ``/audio`` - metadata route — so this route returns ``409 Conflict`` for BYOS recordings. Returns ``404`` - when the conversation, item, or its audio was not persisted (``store = false``). - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the item. Required. - :type conversation_id: str - :param item_id: The id of the conversation item whose audio is streamed. Required. - :type item_id: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :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_agent_endpoint_conversations_get_agent_conversation_item_audio_content_request( - agent_name=agent_name, - conversation_id=conversation_id, - item_id=item_id, - foundry_features=foundry_features, - 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_agent_conversation_audio( - self, - agent_name: str, - conversation_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> _models.VoiceRecordingResponse: - """Get a voice agent conversation's merged recording metadata. - - Returns metadata for the whole-call merged stereo recording (user audio on the left channel, - agent audio on the right). The common metadata (format, sample rate, channels, channel layout, - duration) is returned for both Foundry-managed and bring-your-own-storage (BYOS) recordings; - for BYOS the response additionally includes ``blob_uri``, the URI of the recording in the - customer's own storage (no SAS) that the customer downloads with their own credentials. The - recording is built once from the per-turn segments after the session ends; a request against an - in-progress session returns ``409``. Requires the conversation to have persisted audio (``store - = true``); otherwise returns ``404``. - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation whose merged recording metadata is - retrieved. Required. - :type conversation_id: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :return: VoiceRecordingResponse. The VoiceRecordingResponse is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceRecordingResponse - :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.VoiceRecordingResponse] = kwargs.pop("cls", None) - - _request = build_agent_endpoint_conversations_get_agent_conversation_audio_request( - agent_name=agent_name, - conversation_id=conversation_id, - foundry_features=foundry_features, - 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.VoiceRecordingResponse, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get_agent_conversation_audio_content( - self, - agent_name: str, - conversation_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> AsyncIterator[bytes]: - """Stream a voice agent conversation's merged recording. - - Streams the whole-call merged stereo recording as a WAV (``audio/wav``) byte stream through the - service (no SAS URL). This route serves Foundry-managed storage only. For - bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download - directly from customer storage using the ``blob_uri`` returned by the metadata route — so this - route returns ``409 Conflict`` for BYOS recordings. A request against an in-progress session - also returns ``409`` (a distinct condition: session-not-ended versus BYOS-download-required). A - conversation without persisted audio (``store = false``) returns ``404``. - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation whose merged recording is streamed. - Required. - :type conversation_id: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :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_agent_endpoint_conversations_get_agent_conversation_audio_content_request( - agent_name=agent_name, - conversation_id=conversation_id, - foundry_features=foundry_features, - 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 VoiceAgentsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.voiceagents.aio.VoiceAgentsClient`'s - :attr:`voice_agents` 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: VoiceAgentsClientConfiguration = 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") - - @overload - async def create_voice_agent( - self, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - name: str, - definition: _models.VoiceAgentDefinition, - content_type: str = "application/json", - state: Optional[Union[str, _models.AgentState]] = None, - metadata: Optional[dict[str, str]] = None, - description: Optional[str] = None, - blueprint_reference: Optional[_models.AgentBlueprintReference] = None, - draft: Optional[bool] = None, - agent_endpoint: Optional[_models.AgentEndpointConfig] = None, - agent_card: Optional[_models.AgentCard] = None, - **kwargs: Any - ) -> _models.VoiceAgentObject: - """Create a voice agent. - - Creates a new voice agent, or a new version of an existing one. - - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword name: The unique name that identifies the agent. Name can be used to - retrieve/update/delete the agent. - - * Must start and end with alphanumeric characters, - * Can contain hyphens in the middle - * Must not exceed 63 characters. Required. - :paramtype name: str - :keyword definition: The voice agent definition. Required. - :paramtype definition: ~azure.ai.voiceagents.models.VoiceAgentDefinition - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword state: The initial operational state of the agent. Defaults to 'enabled' if not - specified. Known values are: "enabled" and "disabled". Default value is None. - :paramtype state: str or ~azure.ai.voiceagents.models.AgentState - :keyword 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. Default value is None. - :paramtype metadata: dict[str, str] - :keyword description: A human-readable description of the agent. Default value is None. - :paramtype description: str - :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. - :paramtype blueprint_reference: ~azure.ai.voiceagents.models.AgentBlueprintReference - :keyword draft: (Preview) Whether this agent version is a draft (candidate) rather than a - release. The service defaults to ``false`` if a value is not specified by the caller. Draft - versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. - Default value is None. - :paramtype draft: bool - :keyword agent_endpoint: An optional endpoint configuration. If not specified, a default - endpoint configuration will be set for the agent. Default value is None. - :paramtype agent_endpoint: ~azure.ai.voiceagents.models.AgentEndpointConfig - :keyword agent_card: Optional agent card for the agent. Default value is None. - :paramtype agent_card: ~azure.ai.voiceagents.models.AgentCard - :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_voice_agent( - self, - body: _types.CreateVoiceAgentRequest, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - content_type: str = "application/json", - **kwargs: Any - ) -> _models.VoiceAgentObject: - """Create a voice agent. - - Creates a new voice agent, or a new version of an existing one. - - :param body: Required. - :type body: ~azure.ai.voiceagents.types.CreateVoiceAgentRequest - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_voice_agent( - self, - body: IO[bytes], - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - content_type: str = "application/json", - **kwargs: Any - ) -> _models.VoiceAgentObject: - """Create a voice agent. - - Creates a new voice agent, or a new version of an existing one. - - :param body: Required. - :type body: IO[bytes] - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_voice_agent( # pylint: disable=too-many-locals - self, - body: Union[JSON, _types.CreateVoiceAgentRequest, IO[bytes]] = _Unset, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - name: str = _Unset, - definition: _models.VoiceAgentDefinition = _Unset, - state: Optional[Union[str, _models.AgentState]] = None, - metadata: Optional[dict[str, str]] = None, - description: Optional[str] = None, - blueprint_reference: Optional[_models.AgentBlueprintReference] = None, - draft: Optional[bool] = None, - agent_endpoint: Optional[_models.AgentEndpointConfig] = None, - agent_card: Optional[_models.AgentCard] = None, - **kwargs: Any - ) -> _models.VoiceAgentObject: - """Create a voice agent. - - Creates a new voice agent, or a new version of an existing one. - - :param body: Is one of the following types: JSON, CreateVoiceAgentRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.voiceagents.types.CreateVoiceAgentRequest or IO[bytes] - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword name: The unique name that identifies the agent. Name can be used to - retrieve/update/delete the agent. - - * Must start and end with alphanumeric characters, - * Can contain hyphens in the middle - * Must not exceed 63 characters. Required. - :paramtype name: str - :keyword definition: The voice agent definition. Required. - :paramtype definition: ~azure.ai.voiceagents.models.VoiceAgentDefinition - :keyword state: The initial operational state of the agent. Defaults to 'enabled' if not - specified. Known values are: "enabled" and "disabled". Default value is None. - :paramtype state: str or ~azure.ai.voiceagents.models.AgentState - :keyword 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. Default value is None. - :paramtype metadata: dict[str, str] - :keyword description: A human-readable description of the agent. Default value is None. - :paramtype description: str - :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. - :paramtype blueprint_reference: ~azure.ai.voiceagents.models.AgentBlueprintReference - :keyword draft: (Preview) Whether this agent version is a draft (candidate) rather than a - release. The service defaults to ``false`` if a value is not specified by the caller. Draft - versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. - Default value is None. - :paramtype draft: bool - :keyword agent_endpoint: An optional endpoint configuration. If not specified, a default - endpoint configuration will be set for the agent. Default value is None. - :paramtype agent_endpoint: ~azure.ai.voiceagents.models.AgentEndpointConfig - :keyword agent_card: Optional agent card for the agent. Default value is None. - :paramtype agent_card: ~azure.ai.voiceagents.models.AgentCard - :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject - :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.VoiceAgentObject] = kwargs.pop("cls", None) - - if body is _Unset: - if name is _Unset: - raise TypeError("missing required argument: name") - if definition is _Unset: - raise TypeError("missing required argument: definition") - body = { - "agent_card": agent_card, - "agent_endpoint": agent_endpoint, - "blueprint_reference": blueprint_reference, - "definition": definition, - "description": description, - "draft": draft, - "metadata": metadata, - "name": name, - "state": state, - } - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_voice_agents_create_voice_agent_request( - foundry_features=foundry_features, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - 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 [201]: - 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.VoiceAgentObject, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_voice_agents( - self, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.VoiceAgentObject"]: - """List voice agents. - - Returns a paged collection of voice agents. - - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :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.voiceagents.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 VoiceAgentObject - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.voiceagents.models.VoiceAgentObject] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[list[_models.VoiceAgentObject]] = 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_voice_agents_list_voice_agents_request( - foundry_features=foundry_features, - 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.VoiceAgentObject], - 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_voice_agent( - self, - agent_name: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> _models.VoiceAgentObject: - """Get a voice agent. - - Retrieves a voice agent by its unique name. - - :param agent_name: The name of the voice agent to retrieve. Required. - :type agent_name: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject - :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.VoiceAgentObject] = kwargs.pop("cls", None) - - _request = build_voice_agents_get_voice_agent_request( - agent_name=agent_name, - foundry_features=foundry_features, - 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.VoiceAgentObject, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def update_voice_agent( - self, - agent_name: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - definition: _models.VoiceAgentDefinition, - content_type: str = "application/json", - metadata: Optional[dict[str, str]] = None, - description: Optional[str] = None, - blueprint_reference: Optional[_models.AgentBlueprintReference] = None, - **kwargs: Any - ) -> _models.VoiceAgentObject: - """Update a voice agent. - - Updates a voice agent by adding a new version if there are any changes to the agent definition. - If no changes, returns the existing agent version. - - :param agent_name: The name of the voice agent to update. Required. - :type agent_name: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword definition: The voice agent definition. Required. - :paramtype definition: ~azure.ai.voiceagents.models.VoiceAgentDefinition - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword 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. Default value is None. - :paramtype metadata: dict[str, str] - :keyword description: A human-readable description of the agent. Default value is None. - :paramtype description: str - :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. - :paramtype blueprint_reference: ~azure.ai.voiceagents.models.AgentBlueprintReference - :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update_voice_agent( - self, - agent_name: str, - body: _types.UpdateVoiceAgentRequest, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - content_type: str = "application/json", - **kwargs: Any - ) -> _models.VoiceAgentObject: - """Update a voice agent. - - Updates a voice agent by adding a new version if there are any changes to the agent definition. - If no changes, returns the existing agent version. - - :param agent_name: The name of the voice agent to update. Required. - :type agent_name: str - :param body: Required. - :type body: ~azure.ai.voiceagents.types.UpdateVoiceAgentRequest - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update_voice_agent( - self, - agent_name: str, - body: IO[bytes], - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - content_type: str = "application/json", - **kwargs: Any - ) -> _models.VoiceAgentObject: - """Update a voice agent. - - Updates a voice agent by adding a new version if there are any changes to the agent definition. - If no changes, returns the existing agent version. - - :param agent_name: The name of the voice agent to update. Required. - :type agent_name: str - :param body: Required. - :type body: IO[bytes] - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update_voice_agent( - self, - agent_name: str, - body: Union[JSON, _types.UpdateVoiceAgentRequest, IO[bytes]] = _Unset, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - definition: _models.VoiceAgentDefinition = _Unset, - metadata: Optional[dict[str, str]] = None, - description: Optional[str] = None, - blueprint_reference: Optional[_models.AgentBlueprintReference] = None, - **kwargs: Any - ) -> _models.VoiceAgentObject: - """Update a voice agent. - - Updates a voice agent by adding a new version if there are any changes to the agent definition. - If no changes, returns the existing agent version. - - :param agent_name: The name of the voice agent to update. Required. - :type agent_name: str - :param body: Is one of the following types: JSON, UpdateVoiceAgentRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.voiceagents.types.UpdateVoiceAgentRequest or IO[bytes] - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword definition: The voice agent definition. Required. - :paramtype definition: ~azure.ai.voiceagents.models.VoiceAgentDefinition - :keyword 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. Default value is None. - :paramtype metadata: dict[str, str] - :keyword description: A human-readable description of the agent. Default value is None. - :paramtype description: str - :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. - :paramtype blueprint_reference: ~azure.ai.voiceagents.models.AgentBlueprintReference - :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject - :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.VoiceAgentObject] = kwargs.pop("cls", None) - - if body is _Unset: - if definition is _Unset: - raise TypeError("missing required argument: definition") - body = { - "blueprint_reference": blueprint_reference, - "definition": definition, - "description": description, - "metadata": metadata, - } - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_voice_agents_update_voice_agent_request( - agent_name=agent_name, - foundry_features=foundry_features, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - 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.VoiceAgentObject, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete_voice_agent( - self, - agent_name: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> None: - """Delete a voice agent. - - Deletes a voice agent and all of its versions. - - :param agent_name: The name of the voice agent to delete. Required. - :type agent_name: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :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_voice_agents_delete_voice_agent_request( - agent_name=agent_name, - foundry_features=foundry_features, - 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_async - async def enable_voice_agent( - self, - agent_name: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> None: - """Enable a voice agent. - - Enables the specified voice agent, allowing it to accept new requests. This operation is - idempotent — enabling an already-enabled voice agent returns success with no side effects. - - :param agent_name: The name of the voice agent to enable. Required. - :type agent_name: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :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_voice_agents_enable_voice_agent_request( - agent_name=agent_name, - foundry_features=foundry_features, - 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_async - async def disable_voice_agent( - self, - agent_name: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> None: - """Disable a voice agent. - - Disables the specified voice agent, preventing it from accepting new requests. This operation - is idempotent — disabling an already-disabled voice agent returns success with no side effects. - - :param agent_name: The name of the voice agent to disable. Required. - :type agent_name: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :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_voice_agents_disable_voice_agent_request( - agent_name=agent_name, - foundry_features=foundry_features, - 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 - - @overload - async def generate_voice_agent( - self, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - name: str, - model_type: Union[str, _models.VoiceModelType], - model: str, - agent_type: Union[str, _models.VoiceAgentType], - use_case: Union[str, _models.VoiceAgentUseCase], - goal: str, - content_type: str = "application/json", - description: Optional[str] = None, - tools: Optional[list["_unions.VoiceAgentTool"]] = None, - draft: Optional[bool] = None, - **kwargs: Any - ) -> _models.VoiceAgentObject: - """Generate a voice agent. - - Generates and creates a voice agent from high-level inputs plus a natural-language goal. The - operation expands the goal into a full, editable definition, creates the agent through the - standard voice create path, and returns the created ``VoiceAgentObject``. The caller can edit - or override the generated fields afterward through normal versioning. - - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword name: The unique name for the agent to create. Required. - :paramtype name: str - :keyword model_type: How the model backing the generated agent is served: ``managed`` - (service-managed) or ``self_deployed`` (the customer's own deployment). Carried through to the - generated definition, not generated. Known values are: "managed" and "self_deployed". Required. - :paramtype model_type: str or ~azure.ai.voiceagents.models.VoiceModelType - :keyword model: The model paired with ``model_type``: the service-managed model name when - ``managed``, or the customer's Foundry deployment name when ``self_deployed``. Carried through, - not generated. Required. - :paramtype model: str - :keyword agent_type: The persona/tone to steer generation. Known values are: "personal" and - "business". Required. - :paramtype agent_type: str or ~azure.ai.voiceagents.models.VoiceAgentType - :keyword use_case: The scenario-template catalog entry the generator specializes for. Known - values are: "customer_support", "reception", "sales", "travel_assistant", "outreach", - "personal_assistant", "learning", "call_center", and "in_car". Required. - :paramtype use_case: str or ~azure.ai.voiceagents.models.VoiceAgentUseCase - :keyword goal: A natural-language description of what the agent should do; the seed for the - generated ``instructions``. Required. - :paramtype goal: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword description: An optional description for the agent. Generated from ``goal`` when - omitted. Default value is None. - :paramtype description: str - :keyword tools: Optional tools carried through verbatim onto the generated agent (see - ``VoiceAgentTool``). Default value is None. - :paramtype tools: list[~azure.ai.voiceagents.models.RealtimeFunctionTool or - ~azure.ai.voiceagents.models.VoiceAgentMcpTool or ~azure.ai.voiceagents.models.VoiceSystemTool - or ~azure.ai.voiceagents.models.VoiceToolboxTool] - :keyword draft: (Preview) When ``true``, the generated voice agent is created as a draft — an - editable, unpublished version the caller can review and refine before publishing it via the - standard create/version path. The service defaults to ``false`` if a value is not specified by - the caller, in which case the agent is created and published normally. Default value is None. - :paramtype draft: bool - :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def generate_voice_agent( - self, - body: _types.GenerateVoiceAgentRequest, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - content_type: str = "application/json", - **kwargs: Any - ) -> _models.VoiceAgentObject: - """Generate a voice agent. - - Generates and creates a voice agent from high-level inputs plus a natural-language goal. The - operation expands the goal into a full, editable definition, creates the agent through the - standard voice create path, and returns the created ``VoiceAgentObject``. The caller can edit - or override the generated fields afterward through normal versioning. - - :param body: Required. - :type body: ~azure.ai.voiceagents.types.GenerateVoiceAgentRequest - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def generate_voice_agent( - self, - body: IO[bytes], - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - content_type: str = "application/json", - **kwargs: Any - ) -> _models.VoiceAgentObject: - """Generate a voice agent. - - Generates and creates a voice agent from high-level inputs plus a natural-language goal. The - operation expands the goal into a full, editable definition, creates the agent through the - standard voice create path, and returns the created ``VoiceAgentObject``. The caller can edit - or override the generated fields afterward through normal versioning. - - :param body: Required. - :type body: IO[bytes] - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def generate_voice_agent( # pylint: disable=too-many-locals - self, - body: Union[JSON, _types.GenerateVoiceAgentRequest, IO[bytes]] = _Unset, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - name: str = _Unset, - model_type: Union[str, _models.VoiceModelType] = _Unset, - model: str = _Unset, - agent_type: Union[str, _models.VoiceAgentType] = _Unset, - use_case: Union[str, _models.VoiceAgentUseCase] = _Unset, - goal: str = _Unset, - description: Optional[str] = None, - tools: Optional[list["_unions.VoiceAgentTool"]] = None, - draft: Optional[bool] = None, - **kwargs: Any - ) -> _models.VoiceAgentObject: - """Generate a voice agent. - - Generates and creates a voice agent from high-level inputs plus a natural-language goal. The - operation expands the goal into a full, editable definition, creates the agent through the - standard voice create path, and returns the created ``VoiceAgentObject``. The caller can edit - or override the generated fields afterward through normal versioning. - - :param body: Is one of the following types: JSON, GenerateVoiceAgentRequest, IO[bytes] - Required. - :type body: JSON or ~azure.ai.voiceagents.types.GenerateVoiceAgentRequest or IO[bytes] - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword name: The unique name for the agent to create. Required. - :paramtype name: str - :keyword model_type: How the model backing the generated agent is served: ``managed`` - (service-managed) or ``self_deployed`` (the customer's own deployment). Carried through to the - generated definition, not generated. Known values are: "managed" and "self_deployed". Required. - :paramtype model_type: str or ~azure.ai.voiceagents.models.VoiceModelType - :keyword model: The model paired with ``model_type``: the service-managed model name when - ``managed``, or the customer's Foundry deployment name when ``self_deployed``. Carried through, - not generated. Required. - :paramtype model: str - :keyword agent_type: The persona/tone to steer generation. Known values are: "personal" and - "business". Required. - :paramtype agent_type: str or ~azure.ai.voiceagents.models.VoiceAgentType - :keyword use_case: The scenario-template catalog entry the generator specializes for. Known - values are: "customer_support", "reception", "sales", "travel_assistant", "outreach", - "personal_assistant", "learning", "call_center", and "in_car". Required. - :paramtype use_case: str or ~azure.ai.voiceagents.models.VoiceAgentUseCase - :keyword goal: A natural-language description of what the agent should do; the seed for the - generated ``instructions``. Required. - :paramtype goal: str - :keyword description: An optional description for the agent. Generated from ``goal`` when - omitted. Default value is None. - :paramtype description: str - :keyword tools: Optional tools carried through verbatim onto the generated agent (see - ``VoiceAgentTool``). Default value is None. - :paramtype tools: list[~azure.ai.voiceagents.models.RealtimeFunctionTool or - ~azure.ai.voiceagents.models.VoiceAgentMcpTool or ~azure.ai.voiceagents.models.VoiceSystemTool - or ~azure.ai.voiceagents.models.VoiceToolboxTool] - :keyword draft: (Preview) When ``true``, the generated voice agent is created as a draft — an - editable, unpublished version the caller can review and refine before publishing it via the - standard create/version path. The service defaults to ``false`` if a value is not specified by - the caller, in which case the agent is created and published normally. Default value is None. - :paramtype draft: bool - :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject - :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.VoiceAgentObject] = kwargs.pop("cls", None) - - if body is _Unset: - if name is _Unset: - raise TypeError("missing required argument: name") - if model_type is _Unset: - raise TypeError("missing required argument: model_type") - if model is _Unset: - raise TypeError("missing required argument: model") - if agent_type is _Unset: - raise TypeError("missing required argument: agent_type") - if use_case is _Unset: - raise TypeError("missing required argument: use_case") - if goal is _Unset: - raise TypeError("missing required argument: goal") - body = { - "agent_type": agent_type, - "description": description, - "draft": draft, - "goal": goal, - "model": model, - "model_type": model_type, - "name": name, - "tools": tools, - "use_case": use_case, - } - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_voice_agents_generate_voice_agent_request( - foundry_features=foundry_features, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - 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.VoiceAgentObject, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_voice_agent_version( - self, - agent_name: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - definition: _models.VoiceAgentDefinition, - content_type: str = "application/json", - metadata: Optional[dict[str, str]] = None, - description: Optional[str] = None, - blueprint_reference: Optional[_models.AgentBlueprintReference] = None, - draft: Optional[bool] = None, - **kwargs: Any - ) -> _models.VoiceAgentVersionObject: - """Create a voice agent version. - - Creates a new version for the specified voice agent and returns the created version resource. - - :param agent_name: The name of the voice agent. Required. - :type agent_name: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword definition: The voice agent definition. Required. - :paramtype definition: ~azure.ai.voiceagents.models.VoiceAgentDefinition - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword 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. Default value is None. - :paramtype metadata: dict[str, str] - :keyword description: A human-readable description of the agent. Default value is None. - :paramtype description: str - :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. - :paramtype blueprint_reference: ~azure.ai.voiceagents.models.AgentBlueprintReference - :keyword draft: (Preview) Whether this agent version is a draft (candidate) rather than a - release. The service defaults to ``false`` if a value is not specified by the caller. Draft - versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. - Default value is None. - :paramtype draft: bool - :return: VoiceAgentVersionObject. The VoiceAgentVersionObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentVersionObject - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_voice_agent_version( - self, - agent_name: str, - body: _types.CreateVoiceAgentVersionRequest, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - content_type: str = "application/json", - **kwargs: Any - ) -> _models.VoiceAgentVersionObject: - """Create a voice agent version. - - Creates a new version for the specified voice agent and returns the created version resource. - - :param agent_name: The name of the voice agent. Required. - :type agent_name: str - :param body: Required. - :type body: ~azure.ai.voiceagents.types.CreateVoiceAgentVersionRequest - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: VoiceAgentVersionObject. The VoiceAgentVersionObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentVersionObject - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_voice_agent_version( - self, - agent_name: str, - body: IO[bytes], - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - content_type: str = "application/json", - **kwargs: Any - ) -> _models.VoiceAgentVersionObject: - """Create a voice agent version. - - Creates a new version for the specified voice agent and returns the created version resource. - - :param agent_name: The name of the voice agent. Required. - :type agent_name: str - :param body: Required. - :type body: IO[bytes] - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: VoiceAgentVersionObject. The VoiceAgentVersionObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentVersionObject - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_voice_agent_version( - self, - agent_name: str, - body: Union[JSON, _types.CreateVoiceAgentVersionRequest, IO[bytes]] = _Unset, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - definition: _models.VoiceAgentDefinition = _Unset, - metadata: Optional[dict[str, str]] = None, - description: Optional[str] = None, - blueprint_reference: Optional[_models.AgentBlueprintReference] = None, - draft: Optional[bool] = None, - **kwargs: Any - ) -> _models.VoiceAgentVersionObject: - """Create a voice agent version. - - Creates a new version for the specified voice agent and returns the created version resource. - - :param agent_name: The name of the voice agent. Required. - :type agent_name: str - :param body: Is one of the following types: JSON, CreateVoiceAgentVersionRequest, IO[bytes] - Required. - :type body: JSON or ~azure.ai.voiceagents.types.CreateVoiceAgentVersionRequest or IO[bytes] - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword definition: The voice agent definition. Required. - :paramtype definition: ~azure.ai.voiceagents.models.VoiceAgentDefinition - :keyword 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. Default value is None. - :paramtype metadata: dict[str, str] - :keyword description: A human-readable description of the agent. Default value is None. - :paramtype description: str - :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. - :paramtype blueprint_reference: ~azure.ai.voiceagents.models.AgentBlueprintReference - :keyword draft: (Preview) Whether this agent version is a draft (candidate) rather than a - release. The service defaults to ``false`` if a value is not specified by the caller. Draft - versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. - Default value is None. - :paramtype draft: bool - :return: VoiceAgentVersionObject. The VoiceAgentVersionObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentVersionObject - :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.VoiceAgentVersionObject] = kwargs.pop("cls", None) - - if body is _Unset: - if definition is _Unset: - raise TypeError("missing required argument: definition") - body = { - "blueprint_reference": blueprint_reference, - "definition": definition, - "description": description, - "draft": draft, - "metadata": metadata, - } - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_voice_agents_create_voice_agent_version_request( - agent_name=agent_name, - foundry_features=foundry_features, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - 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.VoiceAgentVersionObject, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_voice_agent_versions( - self, - agent_name: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, - include_drafts: Optional[bool] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.VoiceAgentVersionObject"]: - """List voice agent versions. - - Returns a paged collection of versions for the specified voice agent. - - :param agent_name: The name of the voice agent to retrieve versions for. Required. - :type agent_name: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :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.voiceagents.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 - :keyword include_drafts: (Preview) Whether to include draft versions in the listing. The - service defaults to ``false`` if a value is not specified by the caller (only non-draft - versions are returned). Default value is None. - :paramtype include_drafts: bool - :return: An iterator like instance of VoiceAgentVersionObject - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.voiceagents.models.VoiceAgentVersionObject] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[list[_models.VoiceAgentVersionObject]] = 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_voice_agents_list_voice_agent_versions_request( - agent_name=agent_name, - foundry_features=foundry_features, - limit=limit, - order=order, - after=_continuation_token, - before=before, - include_drafts=include_drafts, - 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.VoiceAgentVersionObject], - 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_voice_agent_version( - self, - agent_name: str, - agent_version: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> _models.VoiceAgentVersionObject: - """Get a voice agent version. - - Retrieves the specified version of a voice agent by its agent name and version identifier. - - :param agent_name: The name of the voice agent to retrieve. Required. - :type agent_name: str - :param agent_version: The version of the voice agent to retrieve. Required. - :type agent_version: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :return: VoiceAgentVersionObject. The VoiceAgentVersionObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentVersionObject - :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.VoiceAgentVersionObject] = kwargs.pop("cls", None) - - _request = build_voice_agents_get_voice_agent_version_request( - agent_name=agent_name, - agent_version=agent_version, - foundry_features=foundry_features, - 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.VoiceAgentVersionObject, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete_voice_agent_version( - self, - agent_name: str, - agent_version: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> None: - """Delete a voice agent version. - - Deletes a specific version of a voice agent. - - :param agent_name: The name of the voice agent to delete. Required. - :type agent_name: str - :param agent_version: The version of the voice agent to delete. Required. - :type agent_version: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :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_voice_agents_delete_voice_agent_version_request( - agent_name=agent_name, - agent_version=agent_version, - foundry_features=foundry_features, - 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 diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/_patch.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/_patch.py deleted file mode 100644 index 87676c65a8f0..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/aio/operations/_patch.py +++ /dev/null @@ -1,21 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------- -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" - - -__all__: list[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/__init__.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/__init__.py deleted file mode 100644 index 35ef5a6a7339..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/__init__.py +++ /dev/null @@ -1,680 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - - -from ._models import ( # type: ignore - A2AProtocolConfiguration, - ActivityProtocolConfiguration, - AgentBlueprintReference, - AgentCard, - AgentCardSkill, - AgentEndpointAuthorizationScheme, - AgentEndpointConfig, - AgentIdentity, - ApiErrorResponse, - AzureAvatarVoiceSyncVoice, - AzureCustomVoice, - AzurePersonalVoice, - AzureRealtimeNativeVoice, - AzureStandardVoice, - AzureVoice, - BotServiceAuthorizationScheme, - BotServiceRbacAuthorizationScheme, - BotServiceTenantAuthorizationScheme, - CreateTranscriptionResponseJsonUsage, - EntraAuthorizationScheme, - Error, - FixedRatioVersionSelectionRule, - InvocationsProtocolConfiguration, - InvocationsWsProtocolConfiguration, - LlmGeneratedVoiceGreetingConfig, - LogProbProperties, - MCPListToolsTool, - MCPListToolsToolAnnotations, - MCPListToolsToolInputSchema, - MCPTool, - MCPToolFilter, - MCPToolRequireApproval, - ManagedAgentIdentityBlueprintReference, - McpProtocolConfiguration, - Metadata, - OpenAIVoice, - ProtocolConfiguration, - RaiConfig, - RealtimeAudioFormats, - RealtimeAudioFormatsAudioPcm, - RealtimeAudioFormatsAudioPcma, - RealtimeAudioFormatsAudioPcmu, - RealtimeConversationItem, - RealtimeConversationItemFunctionCall, - RealtimeConversationItemFunctionCallOutput, - RealtimeConversationItemMessage, - RealtimeConversationItemMessageAssistant, - RealtimeConversationItemMessageAssistantContent, - RealtimeConversationItemMessageSystem, - RealtimeConversationItemMessageSystemContent, - RealtimeConversationItemMessageUser, - RealtimeConversationItemMessageUserContent, - RealtimeFunctionTool, - RealtimeFunctionToolParameters, - RealtimeMCPApprovalRequest, - RealtimeMCPApprovalResponse, - RealtimeMCPError, - RealtimeMCPHTTPError, - RealtimeMCPListTools, - RealtimeMCPProtocolError, - RealtimeMCPToolCall, - RealtimeMCPToolExecutionError, - RealtimeReasoning, - RealtimeResponseStatusDetails, - RealtimeResponseStatusDetailsError, - RealtimeResponseUsage, - RealtimeResponseUsageInputTokenDetails, - RealtimeResponseUsageInputTokenDetailsCachedTokensDetails, - RealtimeResponseUsageOutputTokenDetails, - RealtimeServerEvent, - RealtimeServerEventConversationItemInputAudioTranscriptionFailedError, - RealtimeServerEventRateLimitsUpdatedRateLimits, - RealtimeServerEventResponseContentPartAdded, - RealtimeServerEventResponseContentPartAddedPart, - RealtimeToolChoiceFunction, - ResponsesProtocolConfiguration, - StructuredInputDefinition, - TemplateVoiceGreetingConfig, - Tool, - ToolChoiceFunction, - ToolChoiceMCP, - ToolChoiceParam, - ToolConfig, - TranscriptTextUsageDuration, - TranscriptTextUsageTokens, - TranscriptTextUsageTokensInputTokenDetails, - VersionSelectionRule, - VersionSelector, - VoiceAgentAnimationConfig, - VoiceAgentAvatarIceServer, - VoiceAgentAvatarScene, - VoiceAgentAvatarVideoBackground, - VoiceAgentAvatarVideoCrop, - VoiceAgentAvatarVideoParams, - VoiceAgentAvatarVideoResolution, - VoiceAgentAzureMultilingualSemanticVadTurnDetection, - VoiceAgentAzureSemanticVadTurnDetection, - VoiceAgentClientEventConversationItemCreate, - VoiceAgentClientEventConversationItemDelete, - VoiceAgentClientEventConversationItemRetrieve, - VoiceAgentClientEventConversationItemTruncate, - VoiceAgentClientEventInputAudioBufferAppend, - VoiceAgentClientEventInputAudioBufferClear, - VoiceAgentClientEventInputAudioBufferCommit, - VoiceAgentClientEventOutputAudioBufferClear, - VoiceAgentClientEventResponseCancel, - VoiceAgentClientEventResponseCreate, - VoiceAgentClientEventSessionAvatarConnect, - VoiceAgentClientEventSessionUpdate, - VoiceAgentDefinition, - VoiceAgentEchoCancellation, - VoiceAgentEndOfUtteranceDetection, - VoiceAgentEstimatedCost, - VoiceAgentFileSearchCallItem, - VoiceAgentFileSearchResult, - VoiceAgentHandoffEdgeConfig, - VoiceAgentHandoffEdgeState, - VoiceAgentHandoffGraphConfig, - VoiceAgentHandoffNodeConfig, - VoiceAgentHandoffNodeSessionConfig, - VoiceAgentHandoffNodeState, - VoiceAgentHandoffState, - VoiceAgentInterimResponseConfig, - VoiceAgentLlmInterimResponseConfig, - VoiceAgentMcpAssignedManagedIdentity, - VoiceAgentMcpTool, - VoiceAgentObject, - VoiceAgentObjectVersions, - VoiceAgentRealtimeResponse, - VoiceAgentResponseCreateAudio, - VoiceAgentResponseCreateParams, - VoiceAgentResponseEventAudioContentPart, - VoiceAgentResponseEventTextContentPart, - VoiceAgentSemanticVadTurnDetection, - VoiceAgentServerEventConversationCreated, - VoiceAgentServerEventConversationItemAdded, - VoiceAgentServerEventConversationItemCreated, - VoiceAgentServerEventConversationItemDeleted, - VoiceAgentServerEventConversationItemDone, - VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted, - VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta, - VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed, - VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment, - VoiceAgentServerEventConversationItemRetrieved, - VoiceAgentServerEventConversationItemTruncated, - VoiceAgentServerEventError, - VoiceAgentServerEventErrorDetails, - VoiceAgentServerEventFileSearchCallCompleted, - VoiceAgentServerEventFileSearchCallInProgress, - VoiceAgentServerEventFileSearchCallSearching, - VoiceAgentServerEventInputAudioBufferCleared, - VoiceAgentServerEventInputAudioBufferCommitted, - VoiceAgentServerEventInputAudioBufferSpeechStarted, - VoiceAgentServerEventInputAudioBufferSpeechStopped, - VoiceAgentServerEventInputAudioBufferTimeoutTriggered, - VoiceAgentServerEventMcpListToolsCompleted, - VoiceAgentServerEventMcpListToolsFailed, - VoiceAgentServerEventMcpListToolsInProgress, - VoiceAgentServerEventOutputAudioBufferCleared, - VoiceAgentServerEventRateLimitsUpdated, - VoiceAgentServerEventResponseAnimationBlendshapesDelta, - VoiceAgentServerEventResponseAnimationBlendshapesDone, - VoiceAgentServerEventResponseAnimationVisemeDelta, - VoiceAgentServerEventResponseAnimationVisemeDone, - VoiceAgentServerEventResponseAudioDelta, - VoiceAgentServerEventResponseAudioDone, - VoiceAgentServerEventResponseAudioTimestampDelta, - VoiceAgentServerEventResponseAudioTimestampDone, - VoiceAgentServerEventResponseAudioTranscriptDelta, - VoiceAgentServerEventResponseAudioTranscriptDone, - VoiceAgentServerEventResponseContentPartDone, - VoiceAgentServerEventResponseCreated, - VoiceAgentServerEventResponseDone, - VoiceAgentServerEventResponseFunctionCallArgumentsDelta, - VoiceAgentServerEventResponseFunctionCallArgumentsDone, - VoiceAgentServerEventResponseMcpCallArgumentsDelta, - VoiceAgentServerEventResponseMcpCallArgumentsDone, - VoiceAgentServerEventResponseMcpCallCompleted, - VoiceAgentServerEventResponseMcpCallFailed, - VoiceAgentServerEventResponseMcpCallInProgress, - VoiceAgentServerEventResponseOutputItemAdded, - VoiceAgentServerEventResponseOutputItemDone, - VoiceAgentServerEventResponseTextDelta, - VoiceAgentServerEventResponseTextDone, - VoiceAgentServerEventResponseVideoDelta, - VoiceAgentServerEventSessionAvatarConnecting, - VoiceAgentServerEventSessionAvatarSwitchToIdle, - VoiceAgentServerEventSessionAvatarSwitchToSpeaking, - VoiceAgentServerEventSessionCreated, - VoiceAgentServerEventSessionHandoffAborted, - VoiceAgentServerEventSessionHandoffCompleted, - VoiceAgentServerEventSessionHandoffStarted, - VoiceAgentServerEventSessionUpdated, - VoiceAgentServerEventWarning, - VoiceAgentServerEventWarningDetails, - VoiceAgentServerEventWebSearchCallCompleted, - VoiceAgentServerEventWebSearchCallInProgress, - VoiceAgentServerEventWebSearchCallSearching, - VoiceAgentServerVadTurnDetection, - VoiceAgentSessionAvatarConfig, - VoiceAgentSessionMcpTool, - VoiceAgentSessionResponseAudio, - VoiceAgentSessionResponseAudioInput, - VoiceAgentSessionResponseAudioOutput, - VoiceAgentSessionResponseConfig, - VoiceAgentSessionUpdateAudio, - VoiceAgentSessionUpdateAudioInput, - VoiceAgentSessionUpdateAudioOutput, - VoiceAgentSessionUpdateConfig, - VoiceAgentStaticInterimResponseConfig, - VoiceAgentTranscriptionPhrase, - VoiceAgentTranscriptionWord, - VoiceAgentVersionObject, - VoiceAgentVoiceAdaptation, - VoiceAgentWebSearchActionFind, - VoiceAgentWebSearchActionOpenPage, - VoiceAgentWebSearchActionSearch, - VoiceAgentWebSearchCallItem, - VoiceAgentWebSearchSource, - VoiceAgentWorkflowActionItem, - VoiceAssistantMessageItem, - VoiceAudioConfig, - VoiceAudioFormat, - VoiceAudioInputConfig, - VoiceAudioOutputConfig, - VoiceAvatarConfig, - VoiceAzureSemanticDetection, - VoiceAzureSemanticDetectionEn, - VoiceAzureSemanticDetectionMultilingual, - VoiceAzureSemanticVadEnTurnDetection, - VoiceAzureSemanticVadMultilingualTurnDetection, - VoiceAzureSemanticVadTurnDetection, - VoiceConversation, - VoiceConversationItem, - VoiceEndOfUtteranceDetection, - VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, - VoiceGreetingConfig, - VoiceInputTranscription, - VoiceItemAudioResponse, - VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem, - VoiceMcpCallItem, - VoiceMcpListToolsItem, - VoiceMessageItem, - VoiceNoiseReduction, - VoiceRecordingChannelLayout, - VoiceRecordingResponse, - VoiceResponse, - VoiceResponseAudio, - VoiceResponseAudioOutput, - VoiceSemanticVadTurnDetection, - VoiceServerVadTurnDetection, - VoiceSystemMessageItem, - VoiceSystemTool, - VoiceToolboxTool, - VoiceTurnDetection, - VoiceUserMessageItem, -) - -from ._enums import ( # type: ignore - AgentBlueprintReferenceType, - AgentDefinitionOptInKeys, - AgentEndpointAuthorizationSchemeType, - AgentIdentityStatus, - AgentObjectType, - AgentState, - AgentStateSource, - AgentVersionStatus, - AzureRealtimeNativeVoiceName, - AzureVoiceType, - CallableToolAllowedCaller, - CreateTranscriptionResponseJsonUsageType, - PageOrder, - PersonalVoiceModel, - RealtimeAudioFormatsType, - RealtimeClientEventType, - RealtimeConversationItemMessageType, - RealtimeConversationItemType, - RealtimeMcpErrorType, - RealtimeReasoningEffort, - RealtimeServerEventType, - ToolChoiceOptions, - ToolChoiceParamType, - ToolType, - VersionSelectorType, - VoiceAgentAnimationOutputType, - VoiceAgentAvatarOutputProtocol, - VoiceAgentAvatarType, - VoiceAgentAzureSemanticVadType, - VoiceAgentEchoCancellationReferenceSource, - VoiceAgentEndOfUtteranceModel, - VoiceAgentEndOfUtteranceThresholdLevel, - VoiceAgentEstimatedCostStatus, - VoiceAgentFileSearchCallStatus, - VoiceAgentHandoffAbortReason, - VoiceAgentHandoffReasoningEffort, - VoiceAgentHandoffTargetResponse, - VoiceAgentInterimResponseTrigger, - VoiceAgentMcpApprovalMode, - VoiceAgentMcpResponseScheduling, - VoiceAgentPipelineFamily, - VoiceAgentResponseAudioFormat, - VoiceAgentResponseStatus, - VoiceAgentSessionIncludeOption, - VoiceAgentType, - VoiceAgentUseCase, - VoiceAgentWebSearchCallStatus, - VoiceAgentWebSocketSubprotocol, - VoiceAudioCodec, - VoiceAudioContainerFormat, - VoiceAudioFormatType, - VoiceAudioRole, - VoiceAudioTimestampType, - VoiceAvatarOutputProtocol, - VoiceAvatarType, - VoiceConversationItemType, - VoiceConversationStatus, - VoiceEndOfUtteranceDetectionModel, - VoiceEndOfUtteranceThresholdLevel, - VoiceGreetingToolChoice, - VoiceIdsShared, - VoiceInputTranscriptionModel, - VoiceModelType, - VoiceNoiseReductionType, - VoiceOutputModality, - VoiceResponseStatus, - VoiceSystemToolName, - VoiceTurnDetectionType, -) -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "A2AProtocolConfiguration", - "ActivityProtocolConfiguration", - "AgentBlueprintReference", - "AgentCard", - "AgentCardSkill", - "AgentEndpointAuthorizationScheme", - "AgentEndpointConfig", - "AgentIdentity", - "ApiErrorResponse", - "AzureAvatarVoiceSyncVoice", - "AzureCustomVoice", - "AzurePersonalVoice", - "AzureRealtimeNativeVoice", - "AzureStandardVoice", - "AzureVoice", - "BotServiceAuthorizationScheme", - "BotServiceRbacAuthorizationScheme", - "BotServiceTenantAuthorizationScheme", - "CreateTranscriptionResponseJsonUsage", - "EntraAuthorizationScheme", - "Error", - "FixedRatioVersionSelectionRule", - "InvocationsProtocolConfiguration", - "InvocationsWsProtocolConfiguration", - "LlmGeneratedVoiceGreetingConfig", - "LogProbProperties", - "MCPListToolsTool", - "MCPListToolsToolAnnotations", - "MCPListToolsToolInputSchema", - "MCPTool", - "MCPToolFilter", - "MCPToolRequireApproval", - "ManagedAgentIdentityBlueprintReference", - "McpProtocolConfiguration", - "Metadata", - "OpenAIVoice", - "ProtocolConfiguration", - "RaiConfig", - "RealtimeAudioFormats", - "RealtimeAudioFormatsAudioPcm", - "RealtimeAudioFormatsAudioPcma", - "RealtimeAudioFormatsAudioPcmu", - "RealtimeConversationItem", - "RealtimeConversationItemFunctionCall", - "RealtimeConversationItemFunctionCallOutput", - "RealtimeConversationItemMessage", - "RealtimeConversationItemMessageAssistant", - "RealtimeConversationItemMessageAssistantContent", - "RealtimeConversationItemMessageSystem", - "RealtimeConversationItemMessageSystemContent", - "RealtimeConversationItemMessageUser", - "RealtimeConversationItemMessageUserContent", - "RealtimeFunctionTool", - "RealtimeFunctionToolParameters", - "RealtimeMCPApprovalRequest", - "RealtimeMCPApprovalResponse", - "RealtimeMCPError", - "RealtimeMCPHTTPError", - "RealtimeMCPListTools", - "RealtimeMCPProtocolError", - "RealtimeMCPToolCall", - "RealtimeMCPToolExecutionError", - "RealtimeReasoning", - "RealtimeResponseStatusDetails", - "RealtimeResponseStatusDetailsError", - "RealtimeResponseUsage", - "RealtimeResponseUsageInputTokenDetails", - "RealtimeResponseUsageInputTokenDetailsCachedTokensDetails", - "RealtimeResponseUsageOutputTokenDetails", - "RealtimeServerEvent", - "RealtimeServerEventConversationItemInputAudioTranscriptionFailedError", - "RealtimeServerEventRateLimitsUpdatedRateLimits", - "RealtimeServerEventResponseContentPartAdded", - "RealtimeServerEventResponseContentPartAddedPart", - "RealtimeToolChoiceFunction", - "ResponsesProtocolConfiguration", - "StructuredInputDefinition", - "TemplateVoiceGreetingConfig", - "Tool", - "ToolChoiceFunction", - "ToolChoiceMCP", - "ToolChoiceParam", - "ToolConfig", - "TranscriptTextUsageDuration", - "TranscriptTextUsageTokens", - "TranscriptTextUsageTokensInputTokenDetails", - "VersionSelectionRule", - "VersionSelector", - "VoiceAgentAnimationConfig", - "VoiceAgentAvatarIceServer", - "VoiceAgentAvatarScene", - "VoiceAgentAvatarVideoBackground", - "VoiceAgentAvatarVideoCrop", - "VoiceAgentAvatarVideoParams", - "VoiceAgentAvatarVideoResolution", - "VoiceAgentAzureMultilingualSemanticVadTurnDetection", - "VoiceAgentAzureSemanticVadTurnDetection", - "VoiceAgentClientEventConversationItemCreate", - "VoiceAgentClientEventConversationItemDelete", - "VoiceAgentClientEventConversationItemRetrieve", - "VoiceAgentClientEventConversationItemTruncate", - "VoiceAgentClientEventInputAudioBufferAppend", - "VoiceAgentClientEventInputAudioBufferClear", - "VoiceAgentClientEventInputAudioBufferCommit", - "VoiceAgentClientEventOutputAudioBufferClear", - "VoiceAgentClientEventResponseCancel", - "VoiceAgentClientEventResponseCreate", - "VoiceAgentClientEventSessionAvatarConnect", - "VoiceAgentClientEventSessionUpdate", - "VoiceAgentDefinition", - "VoiceAgentEchoCancellation", - "VoiceAgentEndOfUtteranceDetection", - "VoiceAgentEstimatedCost", - "VoiceAgentFileSearchCallItem", - "VoiceAgentFileSearchResult", - "VoiceAgentHandoffEdgeConfig", - "VoiceAgentHandoffEdgeState", - "VoiceAgentHandoffGraphConfig", - "VoiceAgentHandoffNodeConfig", - "VoiceAgentHandoffNodeSessionConfig", - "VoiceAgentHandoffNodeState", - "VoiceAgentHandoffState", - "VoiceAgentInterimResponseConfig", - "VoiceAgentLlmInterimResponseConfig", - "VoiceAgentMcpAssignedManagedIdentity", - "VoiceAgentMcpTool", - "VoiceAgentObject", - "VoiceAgentObjectVersions", - "VoiceAgentRealtimeResponse", - "VoiceAgentResponseCreateAudio", - "VoiceAgentResponseCreateParams", - "VoiceAgentResponseEventAudioContentPart", - "VoiceAgentResponseEventTextContentPart", - "VoiceAgentSemanticVadTurnDetection", - "VoiceAgentServerEventConversationCreated", - "VoiceAgentServerEventConversationItemAdded", - "VoiceAgentServerEventConversationItemCreated", - "VoiceAgentServerEventConversationItemDeleted", - "VoiceAgentServerEventConversationItemDone", - "VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted", - "VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta", - "VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed", - "VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment", - "VoiceAgentServerEventConversationItemRetrieved", - "VoiceAgentServerEventConversationItemTruncated", - "VoiceAgentServerEventError", - "VoiceAgentServerEventErrorDetails", - "VoiceAgentServerEventFileSearchCallCompleted", - "VoiceAgentServerEventFileSearchCallInProgress", - "VoiceAgentServerEventFileSearchCallSearching", - "VoiceAgentServerEventInputAudioBufferCleared", - "VoiceAgentServerEventInputAudioBufferCommitted", - "VoiceAgentServerEventInputAudioBufferSpeechStarted", - "VoiceAgentServerEventInputAudioBufferSpeechStopped", - "VoiceAgentServerEventInputAudioBufferTimeoutTriggered", - "VoiceAgentServerEventMcpListToolsCompleted", - "VoiceAgentServerEventMcpListToolsFailed", - "VoiceAgentServerEventMcpListToolsInProgress", - "VoiceAgentServerEventOutputAudioBufferCleared", - "VoiceAgentServerEventRateLimitsUpdated", - "VoiceAgentServerEventResponseAnimationBlendshapesDelta", - "VoiceAgentServerEventResponseAnimationBlendshapesDone", - "VoiceAgentServerEventResponseAnimationVisemeDelta", - "VoiceAgentServerEventResponseAnimationVisemeDone", - "VoiceAgentServerEventResponseAudioDelta", - "VoiceAgentServerEventResponseAudioDone", - "VoiceAgentServerEventResponseAudioTimestampDelta", - "VoiceAgentServerEventResponseAudioTimestampDone", - "VoiceAgentServerEventResponseAudioTranscriptDelta", - "VoiceAgentServerEventResponseAudioTranscriptDone", - "VoiceAgentServerEventResponseContentPartDone", - "VoiceAgentServerEventResponseCreated", - "VoiceAgentServerEventResponseDone", - "VoiceAgentServerEventResponseFunctionCallArgumentsDelta", - "VoiceAgentServerEventResponseFunctionCallArgumentsDone", - "VoiceAgentServerEventResponseMcpCallArgumentsDelta", - "VoiceAgentServerEventResponseMcpCallArgumentsDone", - "VoiceAgentServerEventResponseMcpCallCompleted", - "VoiceAgentServerEventResponseMcpCallFailed", - "VoiceAgentServerEventResponseMcpCallInProgress", - "VoiceAgentServerEventResponseOutputItemAdded", - "VoiceAgentServerEventResponseOutputItemDone", - "VoiceAgentServerEventResponseTextDelta", - "VoiceAgentServerEventResponseTextDone", - "VoiceAgentServerEventResponseVideoDelta", - "VoiceAgentServerEventSessionAvatarConnecting", - "VoiceAgentServerEventSessionAvatarSwitchToIdle", - "VoiceAgentServerEventSessionAvatarSwitchToSpeaking", - "VoiceAgentServerEventSessionCreated", - "VoiceAgentServerEventSessionHandoffAborted", - "VoiceAgentServerEventSessionHandoffCompleted", - "VoiceAgentServerEventSessionHandoffStarted", - "VoiceAgentServerEventSessionUpdated", - "VoiceAgentServerEventWarning", - "VoiceAgentServerEventWarningDetails", - "VoiceAgentServerEventWebSearchCallCompleted", - "VoiceAgentServerEventWebSearchCallInProgress", - "VoiceAgentServerEventWebSearchCallSearching", - "VoiceAgentServerVadTurnDetection", - "VoiceAgentSessionAvatarConfig", - "VoiceAgentSessionMcpTool", - "VoiceAgentSessionResponseAudio", - "VoiceAgentSessionResponseAudioInput", - "VoiceAgentSessionResponseAudioOutput", - "VoiceAgentSessionResponseConfig", - "VoiceAgentSessionUpdateAudio", - "VoiceAgentSessionUpdateAudioInput", - "VoiceAgentSessionUpdateAudioOutput", - "VoiceAgentSessionUpdateConfig", - "VoiceAgentStaticInterimResponseConfig", - "VoiceAgentTranscriptionPhrase", - "VoiceAgentTranscriptionWord", - "VoiceAgentVersionObject", - "VoiceAgentVoiceAdaptation", - "VoiceAgentWebSearchActionFind", - "VoiceAgentWebSearchActionOpenPage", - "VoiceAgentWebSearchActionSearch", - "VoiceAgentWebSearchCallItem", - "VoiceAgentWebSearchSource", - "VoiceAgentWorkflowActionItem", - "VoiceAssistantMessageItem", - "VoiceAudioConfig", - "VoiceAudioFormat", - "VoiceAudioInputConfig", - "VoiceAudioOutputConfig", - "VoiceAvatarConfig", - "VoiceAzureSemanticDetection", - "VoiceAzureSemanticDetectionEn", - "VoiceAzureSemanticDetectionMultilingual", - "VoiceAzureSemanticVadEnTurnDetection", - "VoiceAzureSemanticVadMultilingualTurnDetection", - "VoiceAzureSemanticVadTurnDetection", - "VoiceConversation", - "VoiceConversationItem", - "VoiceEndOfUtteranceDetection", - "VoiceFunctionCallItem", - "VoiceFunctionCallOutputItem", - "VoiceGreetingConfig", - "VoiceInputTranscription", - "VoiceItemAudioResponse", - "VoiceMcpApprovalRequestItem", - "VoiceMcpApprovalResponseItem", - "VoiceMcpCallItem", - "VoiceMcpListToolsItem", - "VoiceMessageItem", - "VoiceNoiseReduction", - "VoiceRecordingChannelLayout", - "VoiceRecordingResponse", - "VoiceResponse", - "VoiceResponseAudio", - "VoiceResponseAudioOutput", - "VoiceSemanticVadTurnDetection", - "VoiceServerVadTurnDetection", - "VoiceSystemMessageItem", - "VoiceSystemTool", - "VoiceToolboxTool", - "VoiceTurnDetection", - "VoiceUserMessageItem", - "AgentBlueprintReferenceType", - "AgentDefinitionOptInKeys", - "AgentEndpointAuthorizationSchemeType", - "AgentIdentityStatus", - "AgentObjectType", - "AgentState", - "AgentStateSource", - "AgentVersionStatus", - "AzureRealtimeNativeVoiceName", - "AzureVoiceType", - "CallableToolAllowedCaller", - "CreateTranscriptionResponseJsonUsageType", - "PageOrder", - "PersonalVoiceModel", - "RealtimeAudioFormatsType", - "RealtimeClientEventType", - "RealtimeConversationItemMessageType", - "RealtimeConversationItemType", - "RealtimeMcpErrorType", - "RealtimeReasoningEffort", - "RealtimeServerEventType", - "ToolChoiceOptions", - "ToolChoiceParamType", - "ToolType", - "VersionSelectorType", - "VoiceAgentAnimationOutputType", - "VoiceAgentAvatarOutputProtocol", - "VoiceAgentAvatarType", - "VoiceAgentAzureSemanticVadType", - "VoiceAgentEchoCancellationReferenceSource", - "VoiceAgentEndOfUtteranceModel", - "VoiceAgentEndOfUtteranceThresholdLevel", - "VoiceAgentEstimatedCostStatus", - "VoiceAgentFileSearchCallStatus", - "VoiceAgentHandoffAbortReason", - "VoiceAgentHandoffReasoningEffort", - "VoiceAgentHandoffTargetResponse", - "VoiceAgentInterimResponseTrigger", - "VoiceAgentMcpApprovalMode", - "VoiceAgentMcpResponseScheduling", - "VoiceAgentPipelineFamily", - "VoiceAgentResponseAudioFormat", - "VoiceAgentResponseStatus", - "VoiceAgentSessionIncludeOption", - "VoiceAgentType", - "VoiceAgentUseCase", - "VoiceAgentWebSearchCallStatus", - "VoiceAgentWebSocketSubprotocol", - "VoiceAudioCodec", - "VoiceAudioContainerFormat", - "VoiceAudioFormatType", - "VoiceAudioRole", - "VoiceAudioTimestampType", - "VoiceAvatarOutputProtocol", - "VoiceAvatarType", - "VoiceConversationItemType", - "VoiceConversationStatus", - "VoiceEndOfUtteranceDetectionModel", - "VoiceEndOfUtteranceThresholdLevel", - "VoiceGreetingToolChoice", - "VoiceIdsShared", - "VoiceInputTranscriptionModel", - "VoiceModelType", - "VoiceNoiseReductionType", - "VoiceOutputModality", - "VoiceResponseStatus", - "VoiceSystemToolName", - "VoiceTurnDetectionType", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/_enums.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/_enums.py deleted file mode 100644 index 20bcab760940..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/_enums.py +++ /dev/null @@ -1,1084 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum -from azure.core import CaseInsensitiveEnumMeta - - -class AgentBlueprintReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of AgentBlueprintReferenceType.""" - - MANAGED_AGENT_IDENTITY_BLUEPRINT = "ManagedAgentIdentityBlueprint" - """MANAGED_AGENT_IDENTITY_BLUEPRINT.""" - - -class AgentDefinitionOptInKeys(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Feature opt-in keys for agent definition operations supporting hosted or workflow agents.""" - - WORKFLOW_AGENTS_V1_PREVIEW = "WorkflowAgents=V1Preview" - """WORKFLOW_AGENTS_V1_PREVIEW.""" - EXTERNAL_AGENTS_V1_PREVIEW = "ExternalAgents=V1Preview" - """EXTERNAL_AGENTS_V1_PREVIEW.""" - DRAFT_AGENTS_V1_PREVIEW = "DraftAgents=V1Preview" - """DRAFT_AGENTS_V1_PREVIEW.""" - VOICE_AGENTS_V1_PREVIEW = "VoiceAgents=V1Preview" - """VOICE_AGENTS_V1_PREVIEW.""" - - -class AgentEndpointAuthorizationSchemeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of AgentEndpointAuthorizationSchemeType.""" - - ENTRA = "Entra" - """ENTRA.""" - BOT_SERVICE = "BotService" - """BOT_SERVICE.""" - BOT_SERVICE_RBAC = "BotServiceRbac" - """BOT_SERVICE_RBAC.""" - BOT_SERVICE_TENANT = "BotServiceTenant" - """BOT_SERVICE_TENANT.""" - - -class AgentIdentityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The status of an agent identity, applicable to both the agent instance identity and the agent - blueprint. - """ - - ACTIVE = "active" - """The agent identity is active and can be used to access resources.""" - DISABLED = "disabled" - """The agent identity is disabled and cannot be used to access resources.""" - - -class AgentObjectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of AgentObjectType.""" - - AGENT = "agent" - """AGENT.""" - AGENT_VERSION = "agent.version" - """AGENT_VERSION.""" - AGENT_DELETED = "agent.deleted" - """AGENT_DELETED.""" - AGENT_VERSION_DELETED = "agent.version.deleted" - """AGENT_VERSION_DELETED.""" - AGENT_CONTAINER = "agent.container" - """AGENT_CONTAINER.""" - - -class AgentState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The operational state of an agent.""" - - ENABLED = "enabled" - """Agent endpoint accepts requests. This is the default state on creation.""" - DISABLED = "disabled" - """Agent endpoint rejects all requests.""" - - -class AgentStateSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates the source of an agent's operational state. Empty when the state is not derived from - a specific source. - """ - - AGENT_INSTANCE_IDENTITY = "agent_instance_identity" - """The state is derived from the agent's instance identity.""" - AGENT_BLUEPRINT = "agent_blueprint" - """The state is derived from the agent's blueprint.""" - - -class AgentVersionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The provisioning status of an agent version.""" - - CREATING = "creating" - """The agent version is being provisioned.""" - ACTIVE = "active" - """The agent version is active and ready to serve requests.""" - FAILED = "failed" - """The agent version provisioning failed.""" - DELETING = "deleting" - """The agent version is being deleted.""" - DELETED = "deleted" - """The agent version has been deleted.""" - - -class AzureRealtimeNativeVoiceName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """A known Azure realtime-native voice name. This union is extensible, so additional - service-supported names do not require an SDK update. - """ - - AARTI = "aarti" - """The Aarti voice.""" - ALVARO = "alvaro" - """The Alvaro voice.""" - ANDREW = "andrew" - """The Andrew voice.""" - ANTONIO = "antonio" - """The Antonio voice.""" - AVA = "ava" - """The Ava voice.""" - CLARA = "clara" - """The Clara voice.""" - DALIA = "dalia" - """The Dalia voice.""" - DENISE = "denise" - """The Denise voice.""" - DIEGO = "diego" - """The Diego voice.""" - DIYA = "diya" - """The Diya voice.""" - ELSA = "elsa" - """The Elsa voice.""" - EMMA = "emma" - """The Emma voice.""" - FLORIAN = "florian" - """The Florian voice.""" - FRANCISCA = "francisca" - """The Francisca voice.""" - HYUNSU = "hyunsu" - """The Hyunsu voice.""" - JORGE = "jorge" - """The Jorge voice.""" - KEITA = "keita" - """The Keita voice.""" - LIAM = "liam" - """The Liam voice.""" - MEERA = "meera" - """The Meera voice.""" - NANAMI = "nanami" - """The Nanami voice.""" - NATASHA = "natasha" - """The Natasha voice.""" - NIWAT = "niwat" - """The Niwat voice.""" - PREMWADEE = "premwadee" - """The Premwadee voice.""" - REMY = "remy" - """The Remy voice.""" - RYAN = "ryan" - """The Ryan voice.""" - SERAPHINA = "seraphina" - """The Seraphina voice.""" - SONIA = "sonia" - """The Sonia voice.""" - SUNHI = "sunhi" - """The Sunhi voice.""" - SYLVIE = "sylvie" - """The Sylvie voice.""" - THIERRY = "thierry" - """The Thierry voice.""" - WILLIAM = "william" - """The William voice.""" - XIAOXIAO = "xiaoxiao" - """The Xiaoxiao voice.""" - XIMENA = "ximena" - """The Ximena voice.""" - YUNXI = "yunxi" - """The Yunxi voice.""" - - -class AzureVoiceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The Azure synthesized voice kind. Additional values may be added over time.""" - - AZURE_STANDARD = "azure-standard" - """An Azure standard neural voice.""" - AZURE_CUSTOM = "azure-custom" - """An Azure custom neural voice.""" - AZURE_PERSONAL = "azure-personal" - """An Azure personal voice.""" - AVATAR_VOICE_SYNC = "avatar-voice-sync" - """An Azure avatar voice-synchronization voice.""" - - -class CallableToolAllowedCaller(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of CallableToolAllowedCaller.""" - - DIRECT = "direct" - """DIRECT.""" - PROGRAMMATIC = "programmatic" - """PROGRAMMATIC.""" - - -class CreateTranscriptionResponseJsonUsageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of CreateTranscriptionResponseJsonUsageType.""" - - TOKENS = "tokens" - """TOKENS.""" - DURATION = "duration" - """DURATION.""" - - -class PageOrder(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of PageOrder.""" - - ASC = "asc" - """ASC.""" - DESC = "desc" - """DESC.""" - - -class PersonalVoiceModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """A known neural model for an Azure personal or avatar voice. Additional values may be added over - time. - """ - - DRAGON_LATEST_NEURAL = "DragonLatestNeural" - """The latest Dragon model.""" - DRAGON_HD_OMNI_LATEST_NEURAL = "DragonHDOmniLatestNeural" - """The latest Dragon HD Omni model.""" - MAI_VOICE = "MAI-Voice" - """The MAI-Voice model.""" - - -class RealtimeAudioFormatsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of RealtimeAudioFormatsType.""" - - AUDIO_PCM = "audio/pcm" - """AUDIO_PCM.""" - AUDIO_PCMU = "audio/pcmu" - """AUDIO_PCMU.""" - AUDIO_PCMA = "audio/pcma" - """AUDIO_PCMA.""" - - -class RealtimeClientEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of RealtimeClientEventType.""" - - CONVERSATION_ITEM_CREATE = "conversation.item.create" - """CONVERSATION_ITEM_CREATE.""" - CONVERSATION_ITEM_DELETE = "conversation.item.delete" - """CONVERSATION_ITEM_DELETE.""" - CONVERSATION_ITEM_RETRIEVE = "conversation.item.retrieve" - """CONVERSATION_ITEM_RETRIEVE.""" - CONVERSATION_ITEM_TRUNCATE = "conversation.item.truncate" - """CONVERSATION_ITEM_TRUNCATE.""" - INPUT_AUDIO_BUFFER_APPEND = "input_audio_buffer.append" - """INPUT_AUDIO_BUFFER_APPEND.""" - INPUT_AUDIO_BUFFER_CLEAR = "input_audio_buffer.clear" - """INPUT_AUDIO_BUFFER_CLEAR.""" - OUTPUT_AUDIO_BUFFER_CLEAR = "output_audio_buffer.clear" - """OUTPUT_AUDIO_BUFFER_CLEAR.""" - INPUT_AUDIO_BUFFER_COMMIT = "input_audio_buffer.commit" - """INPUT_AUDIO_BUFFER_COMMIT.""" - RESPONSE_CANCEL = "response.cancel" - """RESPONSE_CANCEL.""" - RESPONSE_CREATE = "response.create" - """RESPONSE_CREATE.""" - SESSION_UPDATE = "session.update" - """SESSION_UPDATE.""" - - -class RealtimeConversationItemMessageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of RealtimeConversationItemMessageType.""" - - SYSTEM = "system" - """SYSTEM.""" - USER = "user" - """USER.""" - ASSISTANT = "assistant" - """ASSISTANT.""" - - -class RealtimeConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of RealtimeConversationItemType.""" - - FUNCTION_CALL = "function_call" - """FUNCTION_CALL.""" - FUNCTION_CALL_OUTPUT = "function_call_output" - """FUNCTION_CALL_OUTPUT.""" - MCP_APPROVAL_RESPONSE = "mcp_approval_response" - """MCP_APPROVAL_RESPONSE.""" - MCP_LIST_TOOLS = "mcp_list_tools" - """MCP_LIST_TOOLS.""" - MCP_CALL = "mcp_call" - """MCP_CALL.""" - MCP_APPROVAL_REQUEST = "mcp_approval_request" - """MCP_APPROVAL_REQUEST.""" - - -class RealtimeMcpErrorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of RealtimeMcpErrorType.""" - - PROTOCOL_ERROR = "protocol_error" - """PROTOCOL_ERROR.""" - TOOL_EXECUTION_ERROR = "tool_execution_error" - """TOOL_EXECUTION_ERROR.""" - HTTP_ERROR = "http_error" - """HTTP_ERROR.""" - - -class RealtimeReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Constrains effort on reasoning for reasoning-capable Realtime models such as - ``gpt-realtime-2``. - """ - - MINIMAL = "minimal" - """MINIMAL.""" - LOW = "low" - """LOW.""" - MEDIUM = "medium" - """MEDIUM.""" - HIGH = "high" - """HIGH.""" - XHIGH = "xhigh" - """XHIGH.""" - - -class RealtimeServerEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of RealtimeServerEventType.""" - - CONVERSATION_CREATED = "conversation.created" - """CONVERSATION_CREATED.""" - CONVERSATION_ITEM_CREATED = "conversation.item.created" - """CONVERSATION_ITEM_CREATED.""" - CONVERSATION_ITEM_DELETED = "conversation.item.deleted" - """CONVERSATION_ITEM_DELETED.""" - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED = "conversation.item.input_audio_transcription.completed" - """CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED.""" - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA = "conversation.item.input_audio_transcription.delta" - """CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA.""" - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED = "conversation.item.input_audio_transcription.failed" - """CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED.""" - CONVERSATION_ITEM_RETRIEVED = "conversation.item.retrieved" - """CONVERSATION_ITEM_RETRIEVED.""" - CONVERSATION_ITEM_TRUNCATED = "conversation.item.truncated" - """CONVERSATION_ITEM_TRUNCATED.""" - ERROR = "error" - """ERROR.""" - INPUT_AUDIO_BUFFER_CLEARED = "input_audio_buffer.cleared" - """INPUT_AUDIO_BUFFER_CLEARED.""" - INPUT_AUDIO_BUFFER_COMMITTED = "input_audio_buffer.committed" - """INPUT_AUDIO_BUFFER_COMMITTED.""" - INPUT_AUDIO_BUFFER_DTMF_EVENT_RECEIVED = "input_audio_buffer.dtmf_event_received" - """INPUT_AUDIO_BUFFER_DTMF_EVENT_RECEIVED.""" - INPUT_AUDIO_BUFFER_SPEECH_STARTED = "input_audio_buffer.speech_started" - """INPUT_AUDIO_BUFFER_SPEECH_STARTED.""" - INPUT_AUDIO_BUFFER_SPEECH_STOPPED = "input_audio_buffer.speech_stopped" - """INPUT_AUDIO_BUFFER_SPEECH_STOPPED.""" - RATE_LIMITS_UPDATED = "rate_limits.updated" - """RATE_LIMITS_UPDATED.""" - RESPONSE_OUTPUT_AUDIO_DELTA = "response.output_audio.delta" - """RESPONSE_OUTPUT_AUDIO_DELTA.""" - RESPONSE_OUTPUT_AUDIO_DONE = "response.output_audio.done" - """RESPONSE_OUTPUT_AUDIO_DONE.""" - RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA = "response.output_audio_transcript.delta" - """RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA.""" - RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE = "response.output_audio_transcript.done" - """RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE.""" - RESPONSE_CONTENT_PART_ADDED = "response.content_part.added" - """RESPONSE_CONTENT_PART_ADDED.""" - RESPONSE_CONTENT_PART_DONE = "response.content_part.done" - """RESPONSE_CONTENT_PART_DONE.""" - RESPONSE_CREATED = "response.created" - """RESPONSE_CREATED.""" - RESPONSE_DONE = "response.done" - """RESPONSE_DONE.""" - RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA = "response.function_call_arguments.delta" - """RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA.""" - RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE = "response.function_call_arguments.done" - """RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE.""" - RESPONSE_OUTPUT_ITEM_ADDED = "response.output_item.added" - """RESPONSE_OUTPUT_ITEM_ADDED.""" - RESPONSE_OUTPUT_ITEM_DONE = "response.output_item.done" - """RESPONSE_OUTPUT_ITEM_DONE.""" - RESPONSE_OUTPUT_TEXT_DELTA = "response.output_text.delta" - """RESPONSE_OUTPUT_TEXT_DELTA.""" - RESPONSE_OUTPUT_TEXT_DONE = "response.output_text.done" - """RESPONSE_OUTPUT_TEXT_DONE.""" - SESSION_CREATED = "session.created" - """SESSION_CREATED.""" - SESSION_UPDATED = "session.updated" - """SESSION_UPDATED.""" - OUTPUT_AUDIO_BUFFER_STARTED = "output_audio_buffer.started" - """OUTPUT_AUDIO_BUFFER_STARTED.""" - OUTPUT_AUDIO_BUFFER_STOPPED = "output_audio_buffer.stopped" - """OUTPUT_AUDIO_BUFFER_STOPPED.""" - OUTPUT_AUDIO_BUFFER_CLEARED = "output_audio_buffer.cleared" - """OUTPUT_AUDIO_BUFFER_CLEARED.""" - CONVERSATION_ITEM_ADDED = "conversation.item.added" - """CONVERSATION_ITEM_ADDED.""" - CONVERSATION_ITEM_DONE = "conversation.item.done" - """CONVERSATION_ITEM_DONE.""" - INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED = "input_audio_buffer.timeout_triggered" - """INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED.""" - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT = "conversation.item.input_audio_transcription.segment" - """CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT.""" - MCP_LIST_TOOLS_IN_PROGRESS = "mcp_list_tools.in_progress" - """MCP_LIST_TOOLS_IN_PROGRESS.""" - MCP_LIST_TOOLS_COMPLETED = "mcp_list_tools.completed" - """MCP_LIST_TOOLS_COMPLETED.""" - MCP_LIST_TOOLS_FAILED = "mcp_list_tools.failed" - """MCP_LIST_TOOLS_FAILED.""" - RESPONSE_MCP_CALL_ARGUMENTS_DELTA = "response.mcp_call_arguments.delta" - """RESPONSE_MCP_CALL_ARGUMENTS_DELTA.""" - RESPONSE_MCP_CALL_ARGUMENTS_DONE = "response.mcp_call_arguments.done" - """RESPONSE_MCP_CALL_ARGUMENTS_DONE.""" - RESPONSE_MCP_CALL_IN_PROGRESS = "response.mcp_call.in_progress" - """RESPONSE_MCP_CALL_IN_PROGRESS.""" - RESPONSE_MCP_CALL_COMPLETED = "response.mcp_call.completed" - """RESPONSE_MCP_CALL_COMPLETED.""" - RESPONSE_MCP_CALL_FAILED = "response.mcp_call.failed" - """RESPONSE_MCP_CALL_FAILED.""" - - -class ToolChoiceOptions(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Tool choice mode.""" - - NONE = "none" - """NONE.""" - AUTO = "auto" - """AUTO.""" - REQUIRED = "required" - """REQUIRED.""" - - -class ToolChoiceParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of ToolChoiceParamType.""" - - ALLOWED_TOOLS = "allowed_tools" - """ALLOWED_TOOLS.""" - FUNCTION = "function" - """FUNCTION.""" - MCP = "mcp" - """MCP.""" - CUSTOM = "custom" - """CUSTOM.""" - PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" - """PROGRAMMATIC_TOOL_CALLING.""" - APPLY_PATCH = "apply_patch" - """APPLY_PATCH.""" - SHELL = "shell" - """SHELL.""" - FILE_SEARCH = "file_search" - """FILE_SEARCH.""" - WEB_SEARCH_PREVIEW = "web_search_preview" - """WEB_SEARCH_PREVIEW.""" - COMPUTER_USE_PREVIEW = "computer_use_preview" - """COMPUTER_USE_PREVIEW.""" - WEB_SEARCH_PREVIEW2025_03_11 = "web_search_preview_2025_03_11" - """WEB_SEARCH_PREVIEW2025_03_11.""" - IMAGE_GENERATION = "image_generation" - """IMAGE_GENERATION.""" - CODE_INTERPRETER = "code_interpreter" - """CODE_INTERPRETER.""" - COMPUTER = "computer" - """COMPUTER.""" - COMPUTER_USE = "computer_use" - """COMPUTER_USE.""" - - -class ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of ToolType.""" - - FUNCTION = "function" - """FUNCTION.""" - FILE_SEARCH = "file_search" - """FILE_SEARCH.""" - COMPUTER = "computer" - """COMPUTER.""" - COMPUTER_USE_PREVIEW = "computer_use_preview" - """COMPUTER_USE_PREVIEW.""" - WEB_SEARCH = "web_search" - """WEB_SEARCH.""" - MCP = "mcp" - """MCP.""" - CODE_INTERPRETER = "code_interpreter" - """CODE_INTERPRETER.""" - PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" - """PROGRAMMATIC_TOOL_CALLING.""" - IMAGE_GENERATION = "image_generation" - """IMAGE_GENERATION.""" - LOCAL_SHELL = "local_shell" - """LOCAL_SHELL.""" - SHELL = "shell" - """SHELL.""" - CUSTOM = "custom" - """CUSTOM.""" - NAMESPACE = "namespace" - """NAMESPACE.""" - TOOL_SEARCH = "tool_search" - """TOOL_SEARCH.""" - WEB_SEARCH_PREVIEW = "web_search_preview" - """WEB_SEARCH_PREVIEW.""" - APPLY_PATCH = "apply_patch" - """APPLY_PATCH.""" - A2_A_PREVIEW = "a2a_preview" - """A2_A_PREVIEW.""" - BING_CUSTOM_SEARCH_PREVIEW = "bing_custom_search_preview" - """BING_CUSTOM_SEARCH_PREVIEW.""" - BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" - """BROWSER_AUTOMATION_PREVIEW.""" - FABRIC_DATAAGENT_PREVIEW = "fabric_dataagent_preview" - """FABRIC_DATAAGENT_PREVIEW.""" - SHAREPOINT_GROUNDING_PREVIEW = "sharepoint_grounding_preview" - """SHAREPOINT_GROUNDING_PREVIEW.""" - MEMORY_SEARCH_PREVIEW = "memory_search_preview" - """MEMORY_SEARCH_PREVIEW.""" - WORK_IQ_PREVIEW = "work_iq_preview" - """WORK_IQ_PREVIEW.""" - FABRIC_IQ_PREVIEW = "fabric_iq_preview" - """FABRIC_IQ_PREVIEW.""" - TOOLBOX_SEARCH_PREVIEW = "toolbox_search_preview" - """TOOLBOX_SEARCH_PREVIEW.""" - AZURE_AI_SEARCH = "azure_ai_search" - """AZURE_AI_SEARCH.""" - AZURE_FUNCTION = "azure_function" - """AZURE_FUNCTION.""" - BING_GROUNDING = "bing_grounding" - """BING_GROUNDING.""" - CAPTURE_STRUCTURED_OUTPUTS = "capture_structured_outputs" - """CAPTURE_STRUCTURED_OUTPUTS.""" - OPENAPI = "openapi" - """OPENAPI.""" - - -class VersionSelectorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of VersionSelectorType.""" - - FIXED_RATIO = "FixedRatio" - """FIXED_RATIO.""" - - -class VoiceAgentAnimationOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An animation output produced by a voice-agent session.""" - - BLENDSHAPES = "blendshapes" - """BLENDSHAPES.""" - VISEME_ID = "viseme_id" - """VISEME_ID.""" - - -class VoiceAgentAvatarOutputProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The transport used to deliver avatar media.""" - - WEBSOCKET = "websocket" - """WEBSOCKET.""" - WEBSOCKET_BINARY = "websocket-binary" - """WEBSOCKET_BINARY.""" - WEBRTC = "webrtc" - """WEBRTC.""" - - -class VoiceAgentAvatarType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The avatar implementation.""" - - VIDEO_AVATAR = "video_avatar" - """VIDEO_AVATAR.""" - PHOTO_AVATAR = "photo_avatar" - """PHOTO_AVATAR.""" - - -class VoiceAgentAzureSemanticVadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The discriminator for an Azure semantic VAD configuration.""" - - DEFAULT = "azure_semantic_vad" - """DEFAULT.""" - ENGLISH = "azure_semantic_vad_en" - """ENGLISH.""" - - -class VoiceAgentEchoCancellationReferenceSource( # pylint: disable=name-too-long - str, Enum, metaclass=CaseInsensitiveEnumMeta -): - """The source of reference audio used for echo cancellation.""" - - SERVER = "server" - """SERVER.""" - CLIENT = "client" - """CLIENT.""" - - -class VoiceAgentEndOfUtteranceModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An end-of-utterance detector model.""" - - SEMANTIC_DETECTION_V1 = "semantic_detection_v1" - """SEMANTIC_DETECTION_V1.""" - SEMANTIC_DETECTION_V1_EN = "semantic_detection_v1_en" - """SEMANTIC_DETECTION_V1_EN.""" - SEMANTIC_DETECTION_V1_MULTILINGUAL = "semantic_detection_v1_multilingual" - """SEMANTIC_DETECTION_V1_MULTILINGUAL.""" - SMART_END_OF_TURN_DETECTION = "smart_end_of_turn_detection" - """SMART_END_OF_TURN_DETECTION.""" - - -class VoiceAgentEndOfUtteranceThresholdLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """A threshold preset for end-of-utterance detection.""" - - LOW = "low" - """LOW.""" - MEDIUM = "medium" - """MEDIUM.""" - HIGH = "high" - """HIGH.""" - DEFAULT = "default" - """DEFAULT.""" - - -class VoiceAgentEstimatedCostStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Completeness of a best-effort cost estimate.""" - - COMPLETE = "complete" - """COMPLETE.""" - PARTIAL = "partial" - """PARTIAL.""" - UNAVAILABLE = "unavailable" - """UNAVAILABLE.""" - - -class VoiceAgentFileSearchCallStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The status of a file-search call.""" - - IN_PROGRESS = "in_progress" - """IN_PROGRESS.""" - SEARCHING = "searching" - """SEARCHING.""" - COMPLETED = "completed" - """COMPLETED.""" - INCOMPLETE = "incomplete" - """INCOMPLETE.""" - FAILED = "failed" - """FAILED.""" - - -class VoiceAgentHandoffAbortReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Why a handoff ended before the target behavior committed.""" - - USER_INTERRUPTION = "user_interruption" - """USER_INTERRUPTION.""" - ERROR = "error" - """ERROR.""" - - -class VoiceAgentHandoffReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Reasoning effort accepted by a handoff target.""" - - NONE = "none" - """NONE.""" - MINIMAL = "minimal" - """MINIMAL.""" - LOW = "low" - """LOW.""" - MEDIUM = "medium" - """MEDIUM.""" - HIGH = "high" - """HIGH.""" - XHIGH = "xhigh" - """XHIGH.""" - - -class VoiceAgentHandoffTargetResponse(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Whether a handoff target creates a response after transfer.""" - - AUTO = "auto" - """AUTO.""" - NONE = "none" - """NONE.""" - - -class VoiceAgentInterimResponseTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """A condition that may trigger an interim response.""" - - LATENCY = "latency" - """LATENCY.""" - TOOL = "tool" - """TOOL.""" - - -class VoiceAgentMcpApprovalMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An MCP approval mode.""" - - NEVER_REQUIRE = "never" - """NEVER_REQUIRE.""" - ALWAYS = "always" - """ALWAYS.""" - - -class VoiceAgentMcpResponseScheduling(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """When an MCP invocation creates a follow-up response. Additional values may be added over time.""" - - SILENT = "silent" - """Do not create a follow-up response after the MCP invocation completes.""" - WHEN_IDLE = "when_idle" - """Create a follow-up response when the conversation is idle.""" - INTERRUPT = "interrupt" - """Interrupt the active response and create a follow-up response.""" - SKIP_IF_BUSY = "skip_if_busy" - """Create a follow-up response only when no response is active.""" - - -class VoiceAgentPipelineFamily(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The runtime pipeline family used by an effective handoff graph.""" - - CASCADED = "cascaded" - """CASCADED.""" - REALTIME = "realtime" - """REALTIME.""" - - -class VoiceAgentResponseAudioFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An audio format reported on a voice-agent response resource.""" - - PCM16 = "pcm16" - """PCM16.""" - PCM16_8000_HZ = "pcm16_8000hz" - """PCM16_8000_HZ.""" - PCM16_16000_HZ = "pcm16_16000hz" - """PCM16_16000_HZ.""" - PCM16_22050_HZ = "pcm16_22050hz" - """PCM16_22050_HZ.""" - PCM16_24000_HZ = "pcm16_24000hz" - """PCM16_24000_HZ.""" - PCM16_44100_HZ = "pcm16_44100hz" - """PCM16_44100_HZ.""" - PCM16_48000_HZ = "pcm16_48000hz" - """PCM16_48000_HZ.""" - G711_ULAW = "g711_ulaw" - """G711_ULAW.""" - G711_ALAW = "g711_alaw" - """G711_ALAW.""" - MP3 = "mp3" - """MP3.""" - MP3_24_KHZ48_KBPS = "mp3_24khz_48kbps" - """MP3_24_KHZ48_KBPS.""" - MP3_24_KHZ96_KBPS = "mp3_24khz_96kbps" - """MP3_24_KHZ96_KBPS.""" - MP3_24_KHZ160_KBPS = "mp3_24khz_160kbps" - """MP3_24_KHZ160_KBPS.""" - - -class VoiceAgentResponseStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The lifecycle status of a voice-agent response.""" - - IN_PROGRESS = "in_progress" - """IN_PROGRESS.""" - COMPLETED = "completed" - """COMPLETED.""" - CANCELLED = "cancelled" - """CANCELLED.""" - INCOMPLETE = "incomplete" - """INCOMPLETE.""" - FAILED = "failed" - """FAILED.""" - - -class VoiceAgentSessionIncludeOption(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Additional server-output fields that a voice-agent session may request.""" - - INPUT_AUDIO_TRANSCRIPTION_LOGPROBS = "item.input_audio_transcription.logprobs" - """INPUT_AUDIO_TRANSCRIPTION_LOGPROBS.""" - INPUT_AUDIO_TRANSCRIPTION_PHRASES = "item.input_audio_transcription.phrases" - """INPUT_AUDIO_TRANSCRIPTION_PHRASES.""" - FILE_SEARCH_CALL_RESULTS = "file_search_call.results" - """FILE_SEARCH_CALL_RESULTS.""" - - -class VoiceAgentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The persona/tone a guided-authoring request steers the generated voice agent toward.""" - - PERSONAL = "personal" - """A personal-assistant persona.""" - BUSINESS = "business" - """A business / professional persona.""" - - -class VoiceAgentUseCase(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The scenario-template catalog entry a guided-authoring request specializes the generated voice - agent for. Extensible: additional use cases may be added over time. - """ - - CUSTOMER_SUPPORT = "customer_support" - """CUSTOMER_SUPPORT.""" - RECEPTION = "reception" - """RECEPTION.""" - SALES = "sales" - """SALES.""" - TRAVEL_ASSISTANT = "travel_assistant" - """TRAVEL_ASSISTANT.""" - OUTREACH = "outreach" - """OUTREACH.""" - PERSONAL_ASSISTANT = "personal_assistant" - """PERSONAL_ASSISTANT.""" - LEARNING = "learning" - """LEARNING.""" - CALL_CENTER = "call_center" - """CALL_CENTER.""" - IN_CAR = "in_car" - """IN_CAR.""" - - -class VoiceAgentWebSearchCallStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The status of a web-search call.""" - - IN_PROGRESS = "in_progress" - """IN_PROGRESS.""" - SEARCHING = "searching" - """SEARCHING.""" - COMPLETED = "completed" - """COMPLETED.""" - FAILED = "failed" - """FAILED.""" - - -class VoiceAgentWebSocketSubprotocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The WebSocket subprotocol supported by a voice-agent connection.""" - - REALTIME = "realtime" - """REALTIME.""" - - -class VoiceAudioCodec(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An audio codec. Additional values may be added over time.""" - - PCM16 = "pcm16" - """16-bit pulse-code modulation.""" - PCMU = "pcmu" - """G.711 mu-law.""" - PCMA = "pcma" - """G.711 A-law.""" - - -class VoiceAudioContainerFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An audio container format. Additional values may be added over time.""" - - WAV = "wav" - """Waveform Audio File Format.""" - - -class VoiceAudioFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The audio format type. Values follow the OpenAI Realtime wire schema and are exempt from the - snake_case enum-value rule. - """ - - PCM = "audio/pcm" - """16-bit PCM.""" - PCMU = "audio/pcmu" - """G.711 mu-law (telephony).""" - PCMA = "audio/pcma" - """G.711 A-law (telephony).""" - - -class VoiceAudioRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """A voice-audio participant role. Additional values may be added over time.""" - - USER = "user" - """Audio produced by the user.""" - AGENT = "agent" - """Audio produced by the agent.""" - - -class VoiceAudioTimestampType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An output-audio timestamp kind supported by a voice agent.""" - - WORD = "word" - """Word-level timestamps.""" - - -class VoiceAvatarOutputProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The transport used to deliver the avatar video stream.""" - - WEBRTC = "webrtc" - """WEBRTC.""" - WEBSOCKET = "websocket" - """WEBSOCKET.""" - - -class VoiceAvatarType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The avatar type.""" - - VIDEO_AVATAR = "video_avatar" - """VIDEO_AVATAR.""" - PHOTO_AVATAR = "photo_avatar" - """PHOTO_AVATAR.""" - - -class VoiceConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of a persisted voice conversation item.""" - - MESSAGE = "message" - """A message item.""" - FUNCTION_CALL = "function_call" - """A function-call request item.""" - FUNCTION_CALL_OUTPUT = "function_call_output" - """A function-call output item.""" - MCP_LIST_TOOLS = "mcp_list_tools" - """An MCP list-tools item.""" - MCP_CALL = "mcp_call" - """An MCP call item.""" - MCP_APPROVAL_REQUEST = "mcp_approval_request" - """An MCP approval request item.""" - MCP_APPROVAL_RESPONSE = "mcp_approval_response" - """An MCP approval response item.""" - - -class VoiceConversationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The lifecycle status of a persisted voice conversation.""" - - IN_PROGRESS = "in_progress" - """The conversation's live session is still in progress.""" - COMPLETED = "completed" - """The conversation's live session has ended.""" - - -class VoiceEndOfUtteranceDetectionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The semantic end-of-utterance detection model.""" - - SEMANTIC_DETECTION_V1 = "semantic_detection_v1" - """The default semantic detection model.""" - SEMANTIC_DETECTION_V1_EN = "semantic_detection_v1_en" - """The English-optimized semantic detection model.""" - SEMANTIC_DETECTION_V1_MULTILINGUAL = "semantic_detection_v1_multilingual" - """The multilingual semantic detection model.""" - - -class VoiceEndOfUtteranceThresholdLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The sensitivity threshold for semantic end-of-utterance detection.""" - - LOW = "low" - """The low sensitivity threshold.""" - MEDIUM = "medium" - """The medium sensitivity threshold.""" - HIGH = "high" - """The high sensitivity threshold.""" - DEFAULT = "default" - """The service-selected sensitivity threshold.""" - - -class VoiceGreetingToolChoice(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The tool-selection policy for an LLM-generated greeting.""" - - NONE = "none" - """Do not use tools for the opening response.""" - AUTO = "auto" - """Allow the model to select configured tools for the opening response.""" - REQUIRED = "required" - """Require the opening response to use a configured tool.""" - - -class VoiceIdsShared(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of VoiceIdsShared.""" - - ALLOY = "alloy" - """ALLOY.""" - ASH = "ash" - """ASH.""" - BALLAD = "ballad" - """BALLAD.""" - CORAL = "coral" - """CORAL.""" - ECHO = "echo" - """ECHO.""" - SAGE = "sage" - """SAGE.""" - SHIMMER = "shimmer" - """SHIMMER.""" - VERSE = "verse" - """VERSE.""" - MARIN = "marin" - """MARIN.""" - CEDAR = "cedar" - """CEDAR.""" - - -class VoiceInputTranscriptionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The input-audio transcription model. 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 added over time. - """ - - WHISPER1 = "whisper-1" - """OpenAI Whisper.""" - GPT_REALTIME_WHISPER = "gpt-realtime-whisper" - """OpenAI GPT Realtime Whisper.""" - GPT4_O_TRANSCRIBE = "gpt-4o-transcribe" - """OpenAI GPT-4o transcribe.""" - GPT4_O_MINI_TRANSCRIBE = "gpt-4o-mini-transcribe" - """OpenAI GPT-4o mini transcribe.""" - GPT4_O_TRANSCRIBE_DIARIZE = "gpt-4o-transcribe-diarize" - """OpenAI GPT-4o transcribe with speaker diarization.""" - GPT_TRANSCRIBE = "gpt-transcribe" - """OpenAI GPT Transcribe.""" - GPT_LIVE_TRANSCRIBE = "gpt-live-transcribe" - """OpenAI GPT Live Transcribe.""" - MAI_TRANSCRIBE = "mai-transcribe" - """MAI transcription.""" - AZURE_SPEECH = "azure-speech" - """Azure AI Speech to text.""" - - -class VoiceModelType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """How the model backing a voice agent is served. This is independent of the architecture - (realtime or cascaded), which the service derives from the selected model. - """ - - MANAGED = "managed" - """The service hosts and manages the named model, for example ``gpt-realtime``.""" - SELF_DEPLOYED = "self_deployed" - """The service uses the customer's own Foundry deployment named by ``model``.""" - - -class VoiceNoiseReductionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The input audio noise reduction mode.""" - - NEAR_FIELD = "near_field" - """NEAR_FIELD.""" - FAR_FIELD = "far_field" - """FAR_FIELD.""" - AZURE_DEEP_NOISE_SUPPRESSION = "azure_deep_noise_suppression" - """Azure deep noise suppression.""" - - -class VoiceOutputModality(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An output modality the agent may produce. ``animation`` and ``avatar`` are used when an avatar - is configured. - """ - - TEXT = "text" - """TEXT.""" - AUDIO = "audio" - """AUDIO.""" - ANIMATION = "animation" - """ANIMATION.""" - AVATAR = "avatar" - """AVATAR.""" - - -class VoiceResponseStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The status of a voice response.""" - - IN_PROGRESS = "in_progress" - """IN_PROGRESS.""" - COMPLETED = "completed" - """COMPLETED.""" - CANCELLED = "cancelled" - """CANCELLED.""" - INCOMPLETE = "incomplete" - """INCOMPLETE.""" - FAILED = "failed" - """FAILED.""" - - -class VoiceSystemToolName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """A service-managed voice-session control action. Known values are stable; additional values may - be added over time. - """ - - END_CONVERSATION = "end_conversation" - """Ends the active conversation.""" - - -class VoiceTurnDetectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The turn-detection strategy. Additional values may be added over time.""" - - SERVER_VAD = "server_vad" - """Server-side voice activity detection.""" - SEMANTIC_VAD = "semantic_vad" - """Semantic voice activity detection.""" - AZURE_SEMANTIC_VAD = "azure_semantic_vad" - """Azure semantic voice activity detection.""" - AZURE_SEMANTIC_VAD_EN = "azure_semantic_vad_en" - """English-optimized Azure semantic voice activity detection.""" - AZURE_SEMANTIC_VAD_MULTILINGUAL = "azure_semantic_vad_multilingual" - """Multilingual Azure semantic voice activity detection.""" diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/_models.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/_models.py deleted file mode 100644 index 5a8c269e3943..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/_models.py +++ /dev/null @@ -1,13395 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=useless-super-delegation - -import datetime -from typing import Any, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload - -from .._utils.model_base import Model as _Model, rest_discriminator, rest_field -from ._enums import ( - AgentBlueprintReferenceType, - AgentEndpointAuthorizationSchemeType, - AgentObjectType, - AzureVoiceType, - CreateTranscriptionResponseJsonUsageType, - RealtimeAudioFormatsType, - RealtimeClientEventType, - RealtimeConversationItemMessageType, - RealtimeConversationItemType, - RealtimeMcpErrorType, - RealtimeServerEventType, - ToolChoiceParamType, - ToolType, - VersionSelectorType, - VoiceConversationItemType, - VoiceEndOfUtteranceDetectionModel, - VoiceTurnDetectionType, -) - -if TYPE_CHECKING: - from .. import _unions, models as _models - - -class A2AProtocolConfiguration(_Model): - """Configuration specific to the A2A protocol.""" - - -class ActivityProtocolConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Configuration specific to the activity protocol. - - :ivar enable_m365_public_endpoint: Whether to enable the M365 public endpoint for the activity - protocol. - :vartype enable_m365_public_endpoint: bool - """ - - enable_m365_public_endpoint: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether to enable the M365 public endpoint for the activity protocol.""" - - @overload - def __init__( - self, - *, - enable_m365_public_endpoint: 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 AgentBlueprintReference(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """AgentBlueprintReference. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ManagedAgentIdentityBlueprintReference - - :ivar type: Required. "ManagedAgentIdentityBlueprint" - :vartype type: str or ~azure.ai.voiceagents.models.AgentBlueprintReferenceType - """ - - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. \"ManagedAgentIdentityBlueprint\"""" - - @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 AgentCard(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """AgentCard. - - :ivar version: The version of the agent card. Required. - :vartype version: str - :ivar description: The description of the agent card. - :vartype description: str - :ivar skills: The set of skills that an agent can perform. Required. - :vartype skills: list[~azure.ai.voiceagents.models.AgentCardSkill] - """ - - version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version of the agent card. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The description of the agent card.""" - skills: list["_models.AgentCardSkill"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The set of skills that an agent can perform. Required.""" - - @overload - def __init__( - self, - *, - version: str, - skills: list["_models.AgentCardSkill"], - 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 AgentCardSkill(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """AgentCardSkill. - - :ivar id: a unique identifier for the skill. Required. - :vartype id: str - :ivar name: The name of the skill. Required. - :vartype name: str - :ivar description: A description of the skill. - :vartype description: str - :ivar tags: set of tagwords describing classes of capabilities for the skill. - :vartype tags: list[str] - :ivar examples: A list of example scenarios that the skill can perform. - :vartype examples: list[str] - """ - - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """a unique identifier for the skill. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the skill. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A description of the skill.""" - tags: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """set of tagwords describing classes of capabilities for the skill.""" - examples: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A list of example scenarios that the skill can perform.""" - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - name: str, - description: Optional[str] = None, - tags: Optional[list[str]] = None, - examples: 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 AgentEndpointAuthorizationScheme(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """AgentEndpointAuthorizationScheme. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - BotServiceAuthorizationScheme, BotServiceRbacAuthorizationScheme, - BotServiceTenantAuthorizationScheme, EntraAuthorizationScheme - - :ivar type: Required. Known values are: "Entra", "BotService", "BotServiceRbac", and - "BotServiceTenant". - :vartype type: str or ~azure.ai.voiceagents.models.AgentEndpointAuthorizationSchemeType - """ - - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"Entra\", \"BotService\", \"BotServiceRbac\", and - \"BotServiceTenant\".""" - - @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 AgentEndpointConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """AgentEndpointConfig. - - :ivar version_selector: The version selector of the agent endpoint determines how traffic is - routed to different versions of the agent. - :vartype version_selector: ~azure.ai.voiceagents.models.VersionSelector - :ivar protocol_configuration: Per-protocol configuration for the agent endpoint. - :vartype protocol_configuration: ~azure.ai.voiceagents.models.ProtocolConfiguration - :ivar authorization_schemes: The authorization schemes supported by the agent endpoint. - :vartype authorization_schemes: - list[~azure.ai.voiceagents.models.AgentEndpointAuthorizationScheme] - """ - - version_selector: Optional["_models.VersionSelector"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The version selector of the agent endpoint determines how traffic is routed to different - versions of the agent.""" - protocol_configuration: Optional["_models.ProtocolConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Per-protocol configuration for the agent endpoint.""" - authorization_schemes: Optional[list["_models.AgentEndpointAuthorizationScheme"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The authorization schemes supported by the agent endpoint.""" - - @overload - def __init__( - self, - *, - version_selector: Optional["_models.VersionSelector"] = None, - protocol_configuration: Optional["_models.ProtocolConfiguration"] = None, - authorization_schemes: Optional[list["_models.AgentEndpointAuthorizationScheme"]] = 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 AgentIdentity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """AgentIdentity. - - :ivar principal_id: The principal ID of the agent instance. Required. - :vartype principal_id: str - :ivar client_id: The client ID of the agent instance. Also referred to as the instance ID. - Required. - :vartype client_id: str - :ivar status: The status of the agent identity. Present for both the agent instance identity - and the agent blueprint. Known values are: "active" and "disabled". - :vartype status: str or ~azure.ai.voiceagents.models.AgentIdentityStatus - """ - - principal_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The principal ID of the agent instance. Required.""" - client_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The client ID of the agent instance. Also referred to as the instance ID. Required.""" - status: Optional[Union[str, "_models.AgentIdentityStatus"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The status of the agent identity. Present for both the agent instance identity and the agent - blueprint. Known values are: \"active\" and \"disabled\".""" - - @overload - def __init__( - self, - *, - principal_id: str, - client_id: str, - status: Optional[Union[str, "_models.AgentIdentityStatus"]] = 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 ApiErrorResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Error response for API failures. - - :ivar error: Required. - :vartype error: ~azure.ai.voiceagents.models.Error - """ - - error: "_models.Error" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - error: "_models.Error", - ) -> 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 AzureVoice(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Base configuration shared by Azure synthesized voices. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AzureAvatarVoiceSyncVoice, AzureCustomVoice, AzurePersonalVoice, AzureStandardVoice - - :ivar type: The Azure voice kind. Required. Known values are: "azure-standard", "azure-custom", - "azure-personal", and "avatar-voice-sync". - :vartype type: str or ~azure.ai.voiceagents.models.AzureVoiceType - :ivar temperature: The synthesis temperature, from 0 to 1. - :vartype temperature: float - :ivar custom_lexicon_url: The URL of a custom pronunciation lexicon. - :vartype custom_lexicon_url: str - :ivar custom_text_normalization_url: The URL of a custom text-normalization service. - :vartype custom_text_normalization_url: str - :ivar prefer_locales: Preferred BCP-47 locales that influence language accents. - :vartype prefer_locales: list[str] - :ivar locale: The enforced BCP-47 locale. When omitted, the language is detected from the text. - :vartype locale: str - :ivar style: The speaking style, such as ``cheerful`` or ``sad``. - :vartype style: str - :ivar pitch: The SSML-compatible pitch adjustment, such as ``+5%``. - :vartype pitch: str - :ivar rate: The SSML-compatible speaking-rate adjustment, such as ``+10%``. - :vartype rate: str - :ivar volume: The SSML-compatible volume adjustment, such as ``+10`` or ``-6dB``. - :vartype volume: str - """ - - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The Azure voice kind. Required. Known values are: \"azure-standard\", \"azure-custom\", - \"azure-personal\", and \"avatar-voice-sync\".""" - temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The synthesis temperature, from 0 to 1.""" - custom_lexicon_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The URL of a custom pronunciation lexicon.""" - custom_text_normalization_url: Optional[str] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The URL of a custom text-normalization service.""" - prefer_locales: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Preferred BCP-47 locales that influence language accents.""" - locale: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The enforced BCP-47 locale. When omitted, the language is detected from the text.""" - style: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The speaking style, such as ``cheerful`` or ``sad``.""" - pitch: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The SSML-compatible pitch adjustment, such as ``+5%``.""" - rate: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The SSML-compatible speaking-rate adjustment, such as ``+10%``.""" - volume: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The SSML-compatible volume adjustment, such as ``+10`` or ``-6dB``.""" - - @overload - def __init__( - self, - *, - type: str, - temperature: Optional[float] = None, - custom_lexicon_url: Optional[str] = None, - custom_text_normalization_url: Optional[str] = None, - prefer_locales: Optional[list[str]] = None, - locale: Optional[str] = None, - style: Optional[str] = None, - pitch: Optional[str] = None, - rate: Optional[str] = None, - volume: 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 AzureAvatarVoiceSyncVoice( - AzureVoice, discriminator="avatar-voice-sync" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """An Azure avatar voice-synchronization configuration. The runtime derives its voice name from - the avatar character and style. - - :ivar temperature: The synthesis temperature, from 0 to 1. - :vartype temperature: float - :ivar custom_lexicon_url: The URL of a custom pronunciation lexicon. - :vartype custom_lexicon_url: str - :ivar custom_text_normalization_url: The URL of a custom text-normalization service. - :vartype custom_text_normalization_url: str - :ivar prefer_locales: Preferred BCP-47 locales that influence language accents. - :vartype prefer_locales: list[str] - :ivar locale: The enforced BCP-47 locale. When omitted, the language is detected from the text. - :vartype locale: str - :ivar style: The speaking style, such as ``cheerful`` or ``sad``. - :vartype style: str - :ivar pitch: The SSML-compatible pitch adjustment, such as ``+5%``. - :vartype pitch: str - :ivar rate: The SSML-compatible speaking-rate adjustment, such as ``+10%``. - :vartype rate: str - :ivar volume: The SSML-compatible volume adjustment, such as ``+10`` or ``-6dB``. - :vartype volume: str - :ivar type: Required. An Azure avatar voice-synchronization voice. - :vartype type: str or ~azure.ai.voiceagents.models.AVATAR_VOICE_SYNC - :ivar model: The neural model used to synthesize the avatar voice. Required. Known values are: - "DragonLatestNeural", "DragonHDOmniLatestNeural", and "MAI-Voice". - :vartype model: str or ~azure.ai.voiceagents.models.PersonalVoiceModel - """ - - type: Literal[AzureVoiceType.AVATAR_VOICE_SYNC] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. An Azure avatar voice-synchronization voice.""" - model: Union[str, "_models.PersonalVoiceModel"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The neural model used to synthesize the avatar voice. Required. Known values are: - \"DragonLatestNeural\", \"DragonHDOmniLatestNeural\", and \"MAI-Voice\".""" - - @overload - def __init__( - self, - *, - model: Union[str, "_models.PersonalVoiceModel"], - temperature: Optional[float] = None, - custom_lexicon_url: Optional[str] = None, - custom_text_normalization_url: Optional[str] = None, - prefer_locales: Optional[list[str]] = None, - locale: Optional[str] = None, - style: Optional[str] = None, - pitch: Optional[str] = None, - rate: Optional[str] = None, - volume: 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 = AzureVoiceType.AVATAR_VOICE_SYNC # type: ignore - - -class AzureCustomVoice( - AzureVoice, discriminator="azure-custom" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """An Azure custom neural voice configuration. - - :ivar temperature: The synthesis temperature, from 0 to 1. - :vartype temperature: float - :ivar custom_lexicon_url: The URL of a custom pronunciation lexicon. - :vartype custom_lexicon_url: str - :ivar custom_text_normalization_url: The URL of a custom text-normalization service. - :vartype custom_text_normalization_url: str - :ivar prefer_locales: Preferred BCP-47 locales that influence language accents. - :vartype prefer_locales: list[str] - :ivar locale: The enforced BCP-47 locale. When omitted, the language is detected from the text. - :vartype locale: str - :ivar style: The speaking style, such as ``cheerful`` or ``sad``. - :vartype style: str - :ivar pitch: The SSML-compatible pitch adjustment, such as ``+5%``. - :vartype pitch: str - :ivar rate: The SSML-compatible speaking-rate adjustment, such as ``+10%``. - :vartype rate: str - :ivar volume: The SSML-compatible volume adjustment, such as ``+10`` or ``-6dB``. - :vartype volume: str - :ivar type: Required. An Azure custom neural voice. - :vartype type: str or ~azure.ai.voiceagents.models.AZURE_CUSTOM - :ivar name: The custom voice name. Required. - :vartype name: str - :ivar endpoint_id: The Azure Speech custom voice deployment endpoint ID. Required. - :vartype endpoint_id: str - """ - - type: Literal[AzureVoiceType.AZURE_CUSTOM] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. An Azure custom neural voice.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The custom voice name. Required.""" - endpoint_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Azure Speech custom voice deployment endpoint ID. Required.""" - - @overload - def __init__( - self, - *, - name: str, - endpoint_id: str, - temperature: Optional[float] = None, - custom_lexicon_url: Optional[str] = None, - custom_text_normalization_url: Optional[str] = None, - prefer_locales: Optional[list[str]] = None, - locale: Optional[str] = None, - style: Optional[str] = None, - pitch: Optional[str] = None, - rate: Optional[str] = None, - volume: 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 = AzureVoiceType.AZURE_CUSTOM # type: ignore - - -class AzurePersonalVoice( - AzureVoice, discriminator="azure-personal" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """An Azure personal voice configuration. - - :ivar temperature: The synthesis temperature, from 0 to 1. - :vartype temperature: float - :ivar custom_lexicon_url: The URL of a custom pronunciation lexicon. - :vartype custom_lexicon_url: str - :ivar custom_text_normalization_url: The URL of a custom text-normalization service. - :vartype custom_text_normalization_url: str - :ivar prefer_locales: Preferred BCP-47 locales that influence language accents. - :vartype prefer_locales: list[str] - :ivar locale: The enforced BCP-47 locale. When omitted, the language is detected from the text. - :vartype locale: str - :ivar style: The speaking style, such as ``cheerful`` or ``sad``. - :vartype style: str - :ivar pitch: The SSML-compatible pitch adjustment, such as ``+5%``. - :vartype pitch: str - :ivar rate: The SSML-compatible speaking-rate adjustment, such as ``+10%``. - :vartype rate: str - :ivar volume: The SSML-compatible volume adjustment, such as ``+10`` or ``-6dB``. - :vartype volume: str - :ivar type: Required. An Azure personal voice. - :vartype type: str or ~azure.ai.voiceagents.models.AZURE_PERSONAL - :ivar name: The personal voice name. Required. - :vartype name: str - :ivar model: The neural model used by the personal voice. Required. Known values are: - "DragonLatestNeural", "DragonHDOmniLatestNeural", and "MAI-Voice". - :vartype model: str or ~azure.ai.voiceagents.models.PersonalVoiceModel - """ - - type: Literal[AzureVoiceType.AZURE_PERSONAL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. An Azure personal voice.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The personal voice name. Required.""" - model: Union[str, "_models.PersonalVoiceModel"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The neural model used by the personal voice. Required. Known values are: - \"DragonLatestNeural\", \"DragonHDOmniLatestNeural\", and \"MAI-Voice\".""" - - @overload - def __init__( - self, - *, - name: str, - model: Union[str, "_models.PersonalVoiceModel"], - temperature: Optional[float] = None, - custom_lexicon_url: Optional[str] = None, - custom_text_normalization_url: Optional[str] = None, - prefer_locales: Optional[list[str]] = None, - locale: Optional[str] = None, - style: Optional[str] = None, - pitch: Optional[str] = None, - rate: Optional[str] = None, - volume: 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 = AzureVoiceType.AZURE_PERSONAL # type: ignore - - -class AzureRealtimeNativeVoice(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """An Azure realtime-native voice configuration. - - :ivar type: The voice kind. Always ``azure-realtime-native``. Required. Default value is - "azure-realtime-native". - :vartype type: str - :ivar name: The Azure realtime-native voice name. Required. Known values are: "aarti", - "alvaro", "andrew", "antonio", "ava", "clara", "dalia", "denise", "diego", "diya", "elsa", - "emma", "florian", "francisca", "hyunsu", "jorge", "keita", "liam", "meera", "nanami", - "natasha", "niwat", "premwadee", "remy", "ryan", "seraphina", "sonia", "sunhi", "sylvie", - "thierry", "william", "xiaoxiao", "ximena", and "yunxi". - :vartype name: str or ~azure.ai.voiceagents.models.AzureRealtimeNativeVoiceName - """ - - type: Literal["azure-realtime-native"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The voice kind. Always ``azure-realtime-native``. Required. Default value is - \"azure-realtime-native\".""" - name: Union[str, "_models.AzureRealtimeNativeVoiceName"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The Azure realtime-native voice name. Required. Known values are: \"aarti\", \"alvaro\", - \"andrew\", \"antonio\", \"ava\", \"clara\", \"dalia\", \"denise\", \"diego\", \"diya\", - \"elsa\", \"emma\", \"florian\", \"francisca\", \"hyunsu\", \"jorge\", \"keita\", \"liam\", - \"meera\", \"nanami\", \"natasha\", \"niwat\", \"premwadee\", \"remy\", \"ryan\", - \"seraphina\", \"sonia\", \"sunhi\", \"sylvie\", \"thierry\", \"william\", \"xiaoxiao\", - \"ximena\", and \"yunxi\".""" - - @overload - def __init__( - self, - *, - name: Union[str, "_models.AzureRealtimeNativeVoiceName"], - ) -> 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["azure-realtime-native"] = "azure-realtime-native" - - -class AzureStandardVoice( - AzureVoice, discriminator="azure-standard" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """An Azure standard neural voice configuration. - - :ivar temperature: The synthesis temperature, from 0 to 1. - :vartype temperature: float - :ivar custom_lexicon_url: The URL of a custom pronunciation lexicon. - :vartype custom_lexicon_url: str - :ivar custom_text_normalization_url: The URL of a custom text-normalization service. - :vartype custom_text_normalization_url: str - :ivar prefer_locales: Preferred BCP-47 locales that influence language accents. - :vartype prefer_locales: list[str] - :ivar locale: The enforced BCP-47 locale. When omitted, the language is detected from the text. - :vartype locale: str - :ivar style: The speaking style, such as ``cheerful`` or ``sad``. - :vartype style: str - :ivar pitch: The SSML-compatible pitch adjustment, such as ``+5%``. - :vartype pitch: str - :ivar rate: The SSML-compatible speaking-rate adjustment, such as ``+10%``. - :vartype rate: str - :ivar volume: The SSML-compatible volume adjustment, such as ``+10`` or ``-6dB``. - :vartype volume: str - :ivar type: Required. An Azure standard neural voice. - :vartype type: str or ~azure.ai.voiceagents.models.AZURE_STANDARD - :ivar name: The Azure neural voice name. Required. - :vartype name: str - :ivar multi_talker_speaker_name: The speaker name used by a multi-talker voice. - :vartype multi_talker_speaker_name: str - """ - - type: Literal[AzureVoiceType.AZURE_STANDARD] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. An Azure standard neural voice.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Azure neural voice name. Required.""" - multi_talker_speaker_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The speaker name used by a multi-talker voice.""" - - @overload - def __init__( - self, - *, - name: str, - temperature: Optional[float] = None, - custom_lexicon_url: Optional[str] = None, - custom_text_normalization_url: Optional[str] = None, - prefer_locales: Optional[list[str]] = None, - locale: Optional[str] = None, - style: Optional[str] = None, - pitch: Optional[str] = None, - rate: Optional[str] = None, - volume: Optional[str] = None, - multi_talker_speaker_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 = AzureVoiceType.AZURE_STANDARD # type: ignore - - -class BotServiceAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="BotService"): - """BotServiceAuthorizationScheme. - - :ivar type: Required. BOT_SERVICE. - :vartype type: str or ~azure.ai.voiceagents.models.BOT_SERVICE - """ - - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. BOT_SERVICE.""" - - @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 = AgentEndpointAuthorizationSchemeType.BOT_SERVICE # type: ignore - - -class BotServiceRbacAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="BotServiceRbac"): - """BotServiceRbacAuthorizationScheme. - - :ivar type: Required. BOT_SERVICE_RBAC. - :vartype type: str or ~azure.ai.voiceagents.models.BOT_SERVICE_RBAC - """ - - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. BOT_SERVICE_RBAC.""" - - @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 = AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC # type: ignore - - -class BotServiceTenantAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="BotServiceTenant"): - """BotServiceTenantAuthorizationScheme. - - :ivar type: Required. BOT_SERVICE_TENANT. - :vartype type: str or ~azure.ai.voiceagents.models.BOT_SERVICE_TENANT - """ - - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. BOT_SERVICE_TENANT.""" - - @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 = AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT # type: ignore - - -class CreateTranscriptionResponseJsonUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Token usage statistics for the request. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - TranscriptTextUsageDuration, TranscriptTextUsageTokens - - :ivar type: Required. Known values are: "tokens" and "duration". - :vartype type: str or ~azure.ai.voiceagents.models.CreateTranscriptionResponseJsonUsageType - """ - - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"tokens\" and \"duration\".""" - - @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 EntraAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="Entra"): - """EntraAuthorizationScheme. - - :ivar type: Required. ENTRA. - :vartype type: str or ~azure.ai.voiceagents.models.ENTRA - """ - - type: Literal[AgentEndpointAuthorizationSchemeType.ENTRA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. ENTRA.""" - - @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 = AgentEndpointAuthorizationSchemeType.ENTRA # type: ignore - - -class Error(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Error. - - :ivar code: Required. - :vartype code: str - :ivar message: Required. - :vartype message: str - :ivar param: - :vartype param: str - :ivar type: - :vartype type: str - :ivar details: - :vartype details: list[~azure.ai.voiceagents.models.Error] - :ivar additional_info: - :vartype additional_info: dict[str, any] - :ivar debug_info: - :vartype debug_info: dict[str, any] - """ - - code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - details: Optional[list["_models.Error"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - additional_info: Optional[dict[str, Any]] = rest_field( - name="additionalInfo", visibility=["read", "create", "update", "delete", "query"] - ) - debug_info: Optional[dict[str, Any]] = rest_field( - name="debugInfo", visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - code: str, - message: str, - param: Optional[str] = None, - type: Optional[str] = None, - details: Optional[list["_models.Error"]] = None, - additional_info: Optional[dict[str, Any]] = None, - debug_info: Optional[dict[str, Any]] = 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 VersionSelectionRule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """VersionSelectionRule. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - FixedRatioVersionSelectionRule - - :ivar type: Required. "FixedRatio" - :vartype type: str or ~azure.ai.voiceagents.models.VersionSelectorType - :ivar agent_version: The agent version to route traffic to. Required. - :vartype agent_version: str - """ - - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. \"FixedRatio\"""" - agent_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The agent version to route traffic to. Required.""" - - @overload - def __init__( - self, - *, - type: str, - agent_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 FixedRatioVersionSelectionRule( - VersionSelectionRule, discriminator="FixedRatio" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """FixedRatioVersionSelectionRule. - - :ivar agent_version: The agent version to route traffic to. Required. - :vartype agent_version: str - :ivar type: Required. FIXED_RATIO. - :vartype type: str or ~azure.ai.voiceagents.models.FIXED_RATIO - :ivar traffic_percentage: The percentage of traffic to route to the version. Must be between 0 - and 100. Required. - :vartype traffic_percentage: int - """ - - type: Literal[VersionSelectorType.FIXED_RATIO] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. FIXED_RATIO.""" - traffic_percentage: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The percentage of traffic to route to the version. Must be between 0 and 100. Required.""" - - @overload - def __init__( - self, - *, - agent_version: str, - traffic_percentage: 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 = VersionSelectorType.FIXED_RATIO # type: ignore - - -class InvocationsProtocolConfiguration(_Model): - """Configuration specific to the invocations protocol.""" - - -class InvocationsWsProtocolConfiguration(_Model): - """Configuration specific to the WebSocket-based invocations protocol.""" - - -class VoiceGreetingConfig(_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: - LlmGeneratedVoiceGreetingConfig, TemplateVoiceGreetingConfig - - :ivar type: The greeting mode. 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 greeting mode. 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 LlmGeneratedVoiceGreetingConfig( - VoiceGreetingConfig, discriminator="llm_generated" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A greeting authored by the session model from a scoped opening-turn prompt. - - :ivar type: Required. Default value is "llm_generated". - :vartype type: str - :ivar prompt: The Handlebars prompt that guides the opening turn. Required. - :vartype prompt: str - :ivar fallback_text: The optional Handlebars text template synthesized when generation fails - before any greeting output. - :vartype fallback_text: str - :ivar tool_choice: The tool-selection policy for the opening response. Defaults to ``none``. - Known values are: "none", "auto", and "required". - :vartype tool_choice: str or ~azure.ai.voiceagents.models.VoiceGreetingToolChoice - """ - - type: Literal["llm_generated"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Default value is \"llm_generated\".""" - prompt: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Handlebars prompt that guides the opening turn. Required.""" - fallback_text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The optional Handlebars text template synthesized when generation fails before any greeting - output.""" - tool_choice: Optional[Union[str, "_models.VoiceGreetingToolChoice"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The tool-selection policy for the opening response. Defaults to ``none``. Known values are: - \"none\", \"auto\", and \"required\".""" - - @overload - def __init__( - self, - *, - prompt: str, - fallback_text: Optional[str] = None, - tool_choice: Optional[Union[str, "_models.VoiceGreetingToolChoice"]] = 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 = "llm_generated" # type: ignore - - -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 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.voiceagents.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 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.voiceagents.models.MCPListToolsToolInputSchema - :ivar annotations: - :vartype annotations: ~azure.ai.voiceagents.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 Tool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """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: - MCPTool - - :ivar type: Required. Known values are: "function", "file_search", "computer", - "computer_use_preview", "web_search", "mcp", "code_interpreter", "programmatic_tool_calling", - "image_generation", "local_shell", "shell", "custom", "namespace", "tool_search", - "web_search_preview", "apply_patch", "a2a_preview", "bing_custom_search_preview", - "browser_automation_preview", "fabric_dataagent_preview", "sharepoint_grounding_preview", - "memory_search_preview", "work_iq_preview", "fabric_iq_preview", "toolbox_search_preview", - "azure_ai_search", "azure_function", "bing_grounding", "capture_structured_outputs", and - "openapi". - :vartype type: str or ~azure.ai.voiceagents.models.ToolType - """ - - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"function\", \"file_search\", \"computer\", - \"computer_use_preview\", \"web_search\", \"mcp\", \"code_interpreter\", - \"programmatic_tool_calling\", \"image_generation\", \"local_shell\", \"shell\", \"custom\", - \"namespace\", \"tool_search\", \"web_search_preview\", \"apply_patch\", \"a2a_preview\", - \"bing_custom_search_preview\", \"browser_automation_preview\", \"fabric_dataagent_preview\", - \"sharepoint_grounding_preview\", \"memory_search_preview\", \"work_iq_preview\", - \"fabric_iq_preview\", \"toolbox_search_preview\", \"azure_ai_search\", \"azure_function\", - \"bing_grounding\", \"capture_structured_outputs\", and \"openapi\".""" - - @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 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.voiceagents.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: - - * 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.voiceagents.models.MCPToolFilter - :ivar allowed_callers: - :vartype allowed_callers: list[str or ~azure.ai.voiceagents.models.CallableToolAllowedCaller] - :ivar require_approval: Is one of the following types: MCPToolRequireApproval, - Literal["always"], Literal["never"] - :vartype require_approval: ~azure.ai.voiceagents.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.voiceagents.models.ToolConfig] - """ - - 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 - `_. 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, - *, - 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 - 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.MCP # type: ignore - - -class MCPToolFilter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """MCP tool filter. - - :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 - """ - - 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, - *, - tool_names: Optional[list[str]] = None, - read_only: 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 MCPToolRequireApproval(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """MCPToolRequireApproval. - - :ivar always: - :vartype always: ~azure.ai.voiceagents.models.MCPToolFilter - :ivar never: - :vartype never: ~azure.ai.voiceagents.models.MCPToolFilter - """ - - 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, - *, - always: Optional["_models.MCPToolFilter"] = None, - never: Optional["_models.MCPToolFilter"] = 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 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 OpenAIVoice(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """An OpenAI built-in voice configuration with an explicit type discriminator. - - :ivar type: The voice kind. Always ``openai``. Required. Default value is "openai". - :vartype type: str - :ivar name: The OpenAI built-in voice name. Required. Known values are: "alloy", "ash", - "ballad", "coral", "echo", "sage", "shimmer", "verse", "marin", and "cedar". - :vartype name: str or ~azure.ai.voiceagents.models.VoiceIdsShared - """ - - type: Literal["openai"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The voice kind. Always ``openai``. Required. Default value is \"openai\".""" - name: Union[str, "_models.VoiceIdsShared"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The OpenAI built-in voice name. Required. Known values are: \"alloy\", \"ash\", \"ballad\", - \"coral\", \"echo\", \"sage\", \"shimmer\", \"verse\", \"marin\", and \"cedar\".""" - - @overload - def __init__( - self, - *, - name: Union[str, "_models.VoiceIdsShared"], - ) -> 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["openai"] = "openai" - - -class ProtocolConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Per-protocol configuration for the agent endpoint. - - :ivar activity: Configuration for the activity protocol. - :vartype activity: ~azure.ai.voiceagents.models.ActivityProtocolConfiguration - :ivar responses: Configuration for the responses protocol. - :vartype responses: ~azure.ai.voiceagents.models.ResponsesProtocolConfiguration - :ivar a2_a: Configuration for the A2A protocol. - :vartype a2_a: ~azure.ai.voiceagents.models.A2AProtocolConfiguration - :ivar mcp: Configuration for the MCP protocol. - :vartype mcp: ~azure.ai.voiceagents.models.McpProtocolConfiguration - :ivar invocations: Configuration for the invocations protocol. - :vartype invocations: ~azure.ai.voiceagents.models.InvocationsProtocolConfiguration - :ivar invocations_ws: Configuration for the WebSocket-based invocations protocol. - :vartype invocations_ws: ~azure.ai.voiceagents.models.InvocationsWsProtocolConfiguration - """ - - 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.""" - a2_a: Optional["_models.A2AProtocolConfiguration"] = rest_field( - name="a2a", 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, - *, - activity: Optional["_models.ActivityProtocolConfiguration"] = None, - responses: Optional["_models.ResponsesProtocolConfiguration"] = None, - a2_a: Optional["_models.A2AProtocolConfiguration"] = None, - mcp: Optional["_models.McpProtocolConfiguration"] = None, - invocations: Optional["_models.InvocationsProtocolConfiguration"] = None, - invocations_ws: Optional["_models.InvocationsWsProtocolConfiguration"] = 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 RaiConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Configuration for Responsible AI (RAI) content filtering and safety features. - - :ivar rai_policy_name: The name of the RAI policy to apply. Required. - :vartype rai_policy_name: str - """ - - rai_policy_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the RAI policy to apply. Required.""" - - @overload - def __init__( - self, - *, - rai_policy_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) - - -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 - - :ivar type: Required. Known values are: "audio/pcm", "audio/pcmu", and "audio/pcma". - :vartype type: str or ~azure.ai.voiceagents.models.RealtimeAudioFormatsType - """ - - __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, - *, - 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 RealtimeAudioFormatsAudioPcm( - RealtimeAudioFormats, discriminator="audio/pcm" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeAudioFormatsAudioPcm. - - :ivar type: Required. AUDIO_PCM. - :vartype type: str or ~azure.ai.voiceagents.models.AUDIO_PCM - :ivar rate: Default value is 24000. - :vartype rate: int - """ - - 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, - *, - rate: Optional[Literal[24000]] = 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 = RealtimeAudioFormatsType.AUDIO_PCM # type: ignore - - -class RealtimeAudioFormatsAudioPcma(RealtimeAudioFormats, discriminator="audio/pcma"): - """RealtimeAudioFormatsAudioPcma. - - :ivar type: Required. AUDIO_PCMA. - :vartype type: str or ~azure.ai.voiceagents.models.AUDIO_PCMA - """ - - type: Literal[RealtimeAudioFormatsType.AUDIO_PCMA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. AUDIO_PCMA.""" - - @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 = RealtimeAudioFormatsType.AUDIO_PCMA # type: ignore - - -class RealtimeAudioFormatsAudioPcmu(RealtimeAudioFormats, discriminator="audio/pcmu"): - """RealtimeAudioFormatsAudioPcmu. - - :ivar type: Required. AUDIO_PCMU. - :vartype type: str or ~azure.ai.voiceagents.models.AUDIO_PCMU - """ - - type: Literal[RealtimeAudioFormatsType.AUDIO_PCMU] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. AUDIO_PCMU.""" - - @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 = RealtimeAudioFormatsType.AUDIO_PCMU # 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 - - :ivar type: Required. Known values are: "function_call", "function_call_output", - "mcp_approval_response", "mcp_list_tools", "mcp_call", and "mcp_approval_request". - :vartype type: str or ~azure.ai.voiceagents.models.RealtimeConversationItemType - """ - - __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\", and \"mcp_approval_request\".""" - - @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 RealtimeConversationItemFunctionCall( - RealtimeConversationItem, discriminator="function_call" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime function call item. - - :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.voiceagents.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 - """ - - 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"] - ) - """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.""" - - @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, - ) -> 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 = 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. - - :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.voiceagents.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 - """ - - 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.""" - - @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, - ) -> 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 = RealtimeConversationItemType.FUNCTION_CALL_OUTPUT # type: ignore - - -class RealtimeConversationItemMessage(_Model): # 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 - - :ivar role: Required. Known values are: "system", "user", and "assistant". - :vartype role: str or ~azure.ai.voiceagents.models.RealtimeConversationItemMessageType - """ - - __mapping__: dict[str, _Model] = {} - role: str = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"system\", \"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 RealtimeConversationItemMessageAssistant( - RealtimeConversationItemMessage, discriminator="assistant" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime assistant message item. - - :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. Default value is "message". - :vartype type: str - :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.voiceagents.models.ASSISTANT - :ivar content: The content of the message. Required. - :vartype content: - list[~azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistantContent] - """ - - 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["message"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The type of the item. Always ``message``. Required. Default value is \"message\".""" - 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.""" - - @overload - def __init__( - self, - *, - 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 - 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 = RealtimeConversationItemMessageType.ASSISTANT # type: ignore - self.type: Literal["message"] = "message" - - -class RealtimeConversationItemMessageAssistantContent( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """RealtimeConversationItemMessageAssistantContent. - - :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 - """ - - 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, - *, - type: Optional[Literal["output_text", "output_audio"]] = None, - text: Optional[str] = None, - audio: Optional[str] = None, - transcript: 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 RealtimeConversationItemMessageSystem( - RealtimeConversationItemMessage, discriminator="system" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime system message item. - - :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. Default value is "message". - :vartype type: str - :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.voiceagents.models.SYSTEM - :ivar content: The content of the message. Required. - :vartype content: - list[~azure.ai.voiceagents.models.RealtimeConversationItemMessageSystemContent] - """ - - 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["message"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The type of the item. Always ``message``. Required. Default value is \"message\".""" - 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.""" - - @overload - def __init__( - self, - *, - 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 - 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 = RealtimeConversationItemMessageType.SYSTEM # type: ignore - self.type: Literal["message"] = "message" - - -class RealtimeConversationItemMessageSystemContent( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """RealtimeConversationItemMessageSystemContent. - - :ivar type: Default value is "input_text". - :vartype type: str - :ivar text: - :vartype text: 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"]) - - @overload - def __init__( - self, - *, - type: Optional[Literal["input_text"]] = None, - 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 RealtimeConversationItemMessageUser( - RealtimeConversationItemMessage, discriminator="user" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime user message item. - - :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. Default value is "message". - :vartype type: str - :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.voiceagents.models.USER - :ivar content: The content of the message. Required. - :vartype content: list[~azure.ai.voiceagents.models.RealtimeConversationItemMessageUserContent] - """ - - 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["message"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The type of the item. Always ``message``. Required. Default value is \"message\".""" - 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.""" - - @overload - def __init__( - self, - *, - 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 - 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 = RealtimeConversationItemMessageType.USER # type: ignore - self.type: Literal["message"] = "message" - - -class RealtimeConversationItemMessageUserContent( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """RealtimeConversationItemMessageUserContent. - - :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 - """ - - 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, - *, - 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 - 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 RealtimeFunctionTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Function tool. - - :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.voiceagents.models.RealtimeFunctionToolParameters - """ - - 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, - *, - type: Optional[Literal["function"]] = None, - name: Optional[str] = None, - description: Optional[str] = None, - parameters: Optional["_models.RealtimeFunctionToolParameters"] = 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 RealtimeFunctionToolParameters(_Model): - """RealtimeFunctionToolParameters.""" - - -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.voiceagents.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 - """ - - 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.""" - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - server_label: str, - name: str, - arguments: 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 = RealtimeConversationItemType.MCP_APPROVAL_REQUEST # type: ignore - - -class RealtimeMCPApprovalResponse( - RealtimeConversationItem, discriminator="mcp_approval_response" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime MCP approval response. - - :ivar type: The type of the item. Always ``mcp_approval_response``. Required. - MCP_APPROVAL_RESPONSE. - :vartype type: str or ~azure.ai.voiceagents.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 - """ - - 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"]) - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - approval_request_id: str, - approve: bool, - reason: 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 = RealtimeConversationItemType.MCP_APPROVAL_RESPONSE # type: ignore - - -class RealtimeMCPError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeMCPError. - - 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.voiceagents.models.RealtimeMcpErrorType - """ - - __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, - *, - 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 RealtimeMCPHTTPError( - RealtimeMCPError, discriminator="http_error" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime MCP HTTP error. - - :ivar type: Required. HTTP_ERROR. - :vartype type: str or ~azure.ai.voiceagents.models.HTTP_ERROR - :ivar code: Required. - :vartype code: int - :ivar message: Required. - :vartype message: str - """ - - 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, - *, - code: int, - 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] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = RealtimeMcpErrorType.HTTP_ERROR # type: ignore - - -class RealtimeMCPListTools( - RealtimeConversationItem, discriminator="mcp_list_tools" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime MCP list tools. - - :ivar type: The type of the item. Always ``mcp_list_tools``. Required. MCP_LIST_TOOLS. - :vartype type: str or ~azure.ai.voiceagents.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.voiceagents.models.MCPListToolsTool] - """ - - 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.""" - - @overload - def __init__( - self, - *, - server_label: str, - tools: list["_models.MCPListToolsTool"], - id: Optional[str] = None, # 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) - self.type = RealtimeConversationItemType.MCP_LIST_TOOLS # type: ignore - - -class RealtimeMCPProtocolError( - RealtimeMCPError, discriminator="protocol_error" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime MCP protocol error. - - :ivar type: Required. PROTOCOL_ERROR. - :vartype type: str or ~azure.ai.voiceagents.models.PROTOCOL_ERROR - :ivar code: Required. - :vartype code: int - :ivar message: Required. - :vartype message: str - """ - - 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, - *, - code: int, - 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] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = RealtimeMcpErrorType.PROTOCOL_ERROR # type: ignore - - -class RealtimeMCPToolCall( - RealtimeConversationItem, discriminator="mcp_call" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime MCP tool call. - - :ivar type: The type of the item. Always ``mcp_call``. Required. MCP_CALL. - :vartype type: str or ~azure.ai.voiceagents.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.voiceagents.models.RealtimeMCPError - """ - - 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"]) - - @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, - ) -> 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 = 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. - - :ivar type: Required. TOOL_EXECUTION_ERROR. - :vartype type: str or ~azure.ai.voiceagents.models.TOOL_EXECUTION_ERROR - :ivar message: Required. - :vartype message: str - """ - - 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, - *, - 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] - """ - - 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. - - :ivar effort: Known values are: "minimal", "low", "medium", "high", and "xhigh". - :vartype effort: str or ~azure.ai.voiceagents.models.RealtimeReasoningEffort - """ - - 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, - *, - effort: Optional[Union[str, "_models.RealtimeReasoningEffort"]] = 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 RealtimeResponseStatusDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeResponseStatusDetails. - - :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.voiceagents.models.RealtimeResponseStatusDetailsError - """ - - 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"] - ) - - @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, - ) -> 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 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 RealtimeResponseUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeResponseUsage. - - :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.voiceagents.models.RealtimeResponseUsageInputTokenDetails - :ivar output_token_details: - :vartype output_token_details: - ~azure.ai.voiceagents.models.RealtimeResponseUsageOutputTokenDetails - """ - - 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"] - ) - - @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, - ) -> 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 RealtimeResponseUsageInputTokenDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeResponseUsageInputTokenDetails. - - :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.voiceagents.models.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails - """ - - 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"] - ) - - @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, - ) -> 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 RealtimeResponseUsageInputTokenDetailsCachedTokensDetails( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """RealtimeResponseUsageInputTokenDetailsCachedTokensDetails. - - :ivar text_tokens: - :vartype text_tokens: int - :ivar image_tokens: - :vartype image_tokens: int - :ivar audio_tokens: - :vartype audio_tokens: int - """ - - 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, - *, - text_tokens: Optional[int] = None, - image_tokens: Optional[int] = None, - audio_tokens: 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 RealtimeResponseUsageOutputTokenDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeResponseUsageOutputTokenDetails. - - :ivar text_tokens: - :vartype text_tokens: int - :ivar audio_tokens: - :vartype audio_tokens: int - """ - - 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, - *, - text_tokens: Optional[int] = None, - audio_tokens: 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 RealtimeServerEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A realtime server event. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - RealtimeServerEventResponseContentPartAdded - - :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", and "response.mcp_call.failed". - :vartype type: str or ~azure.ai.voiceagents.models.RealtimeServerEventType - """ - - __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\", and \"response.mcp_call.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 RealtimeServerEventConversationItemInputAudioTranscriptionFailedError( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """RealtimeServerEventConversationItemInputAudioTranscriptionFailedError. - - :ivar type: - :vartype type: str - :ivar code: - :vartype code: str - :ivar message: - :vartype message: str - :ivar param: - :vartype param: str - """ - - 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, - *, - type: Optional[str] = None, - code: Optional[str] = None, - message: Optional[str] = None, - 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) - - -class RealtimeServerEventRateLimitsUpdatedRateLimits( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """RealtimeServerEventRateLimitsUpdatedRateLimits. - - :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 - """ - - 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 - 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 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 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.voiceagents.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.voiceagents.models.RealtimeServerEventResponseContentPartAddedPart - """ - - 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.""" - - @overload - def __init__( - self, - *, - event_id: str, - response_id: str, - item_id: str, - output_index: int, - content_index: int, - part: "_models.RealtimeServerEventResponseContentPartAddedPart", - ) -> 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_CONTENT_PART_ADDED # type: ignore - - -class RealtimeServerEventResponseContentPartAddedPart( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """RealtimeServerEventResponseContentPartAddedPart. - - :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 - """ - - 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, - *, - type: Optional[Literal["audio", "text"]] = None, - text: Optional[str] = None, - audio: Optional[str] = None, - transcript: 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 RealtimeToolChoiceFunction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A Realtime tool-choice object that forces the model to call a specific function. - - :ivar type: For function calling, the type is always ``function``. Required. FUNCTION. - :vartype type: str or ~azure.ai.voiceagents.models.FUNCTION - :ivar name: The name of the function to call. Required. - :vartype name: str - """ - - type: Literal[ToolChoiceParamType.FUNCTION] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """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: Literal[ToolChoiceParamType.FUNCTION], - 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) - - -class ResponsesProtocolConfiguration(_Model): - """Configuration specific to the responses protocol.""" - - -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 TemplateVoiceGreetingConfig( - VoiceGreetingConfig, discriminator="template" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A deterministic greeting rendered with the voice agent's structured inputs and synthesized - without model-authored generation. - - :ivar type: Required. Default value is "template". - :vartype type: str - :ivar text: The Handlebars text template spoken at session start. Required. - :vartype text: str - """ - - type: Literal["template"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Default value is \"template\".""" - text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Handlebars text template spoken at session start. 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 = "template" # 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: - ToolChoiceFunction, ToolChoiceMCP - - :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.voiceagents.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 ToolChoiceFunction( - ToolChoiceParam, discriminator="function" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Function tool. - - :ivar type: For function calling, the type is always ``function``. Required. FUNCTION. - :vartype type: str or ~azure.ai.voiceagents.models.FUNCTION - :ivar name: The name of the function to call. Required. - :vartype name: str - """ - - 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, - *, - 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 = ToolChoiceParamType.FUNCTION # type: ignore - - -class ToolChoiceMCP( - ToolChoiceParam, discriminator="mcp" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """MCP tool. - - :ivar type: For MCP tools, the type is always ``mcp``. Required. MCP. - :vartype type: str or ~azure.ai.voiceagents.models.MCP - :ivar server_label: The label of the MCP server to use. Required. - :vartype server_label: str - :ivar name: - :vartype name: str - """ - - 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, - *, - 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 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 TranscriptTextUsageDuration( - CreateTranscriptionResponseJsonUsage, discriminator="duration" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Duration Usage. - - :ivar type: The type of the usage object. Always ``duration`` for this variant. Required. - DURATION. - :vartype type: str or ~azure.ai.voiceagents.models.DURATION - :ivar seconds: Duration of the input audio in seconds. Required. - :vartype seconds: ~datetime.timedelta - """ - - 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, - *, - seconds: datetime.timedelta, - ) -> 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 = CreateTranscriptionResponseJsonUsageType.DURATION # type: ignore - - -class TranscriptTextUsageTokens( - CreateTranscriptionResponseJsonUsage, discriminator="tokens" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Token Usage. - - :ivar type: The type of the usage object. Always ``tokens`` for this variant. Required. TOKENS. - :vartype type: str or ~azure.ai.voiceagents.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.voiceagents.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[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, - *, - input_tokens: int, - output_tokens: int, - total_tokens: int, - input_token_details: Optional["_models.TranscriptTextUsageTokensInputTokenDetails"] = 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 = CreateTranscriptionResponseJsonUsageType.TOKENS # type: ignore - - -class TranscriptTextUsageTokensInputTokenDetails( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """TranscriptTextUsageTokensInputTokenDetails. - - :ivar text_tokens: - :vartype text_tokens: int - :ivar audio_tokens: - :vartype audio_tokens: int - """ - - 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, - *, - text_tokens: Optional[int] = None, - audio_tokens: 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 VersionSelector(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """VersionSelector. - - :ivar version_selection_rules: Required. - :vartype version_selection_rules: list[~azure.ai.voiceagents.models.VersionSelectionRule] - """ - - version_selection_rules: list["_models.VersionSelectionRule"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required.""" - - @overload - def __init__( - self, - *, - version_selection_rules: list["_models.VersionSelectionRule"], - ) -> 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 VoiceAgentAnimationConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Animation settings for a voice-agent session. - - :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.voiceagents.models.VoiceAgentAnimationOutputType] - """ - - 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"] - ) - """The requested animation output kinds.""" - - @overload - def __init__( - self, - *, - model_name: Optional[str] = None, - outputs: Optional[list[Union[str, "_models.VoiceAgentAnimationOutputType"]]] = 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 VoiceAgentAvatarIceServer(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """An ICE server used for avatar WebRTC negotiation. - - :ivar urls: Required. - :vartype urls: list[str] - :ivar username: - :vartype username: str - :ivar credential: - :vartype credential: str - """ - - 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, - *, - urls: list[str], - username: Optional[str] = None, - credential: 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 VoiceAgentAvatarScene(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Avatar placement and motion settings. - - :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 - """ - - 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, - *, - 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 - 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 VoiceAgentAvatarVideoBackground(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The avatar video background. - - :ivar image_url: - :vartype image_url: str - :ivar color: - :vartype color: str - """ - - 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, - *, - image_url: Optional[str] = None, - color: 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 VoiceAgentAvatarVideoCrop(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The rectangular crop applied to avatar video. - - :ivar bottom_right: Required. - :vartype bottom_right: list[int] - :ivar top_left: Required. - :vartype top_left: list[int] - """ - - 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, - *, - bottom_right: list[int], - top_left: 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 VoiceAgentAvatarVideoParams(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Avatar video encoder and presentation settings. - - :ivar bitrate: - :vartype bitrate: int - :ivar codec: Default value is "h264". - :vartype codec: str - :ivar crop: - :vartype crop: ~azure.ai.voiceagents.models.VoiceAgentAvatarVideoCrop - :ivar resolution: - :vartype resolution: ~azure.ai.voiceagents.models.VoiceAgentAvatarVideoResolution - :ivar background: - :vartype background: ~azure.ai.voiceagents.models.VoiceAgentAvatarVideoBackground - :ivar gop_size: - :vartype gop_size: int - """ - - bitrate: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - codec: Optional[Literal["h264"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Default value is \"h264\".""" - crop: Optional["_models.VoiceAgentAvatarVideoCrop"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - 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, - *, - bitrate: Optional[int] = None, - codec: Optional[Literal["h264"]] = None, - crop: Optional["_models.VoiceAgentAvatarVideoCrop"] = None, - resolution: Optional["_models.VoiceAgentAvatarVideoResolution"] = None, - background: Optional["_models.VoiceAgentAvatarVideoBackground"] = None, - gop_size: 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 VoiceAgentAvatarVideoResolution(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The avatar video resolution. - - :ivar width: Required. - :vartype width: int - :ivar height: Required. - :vartype height: int - """ - - 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, - *, - width: int, - 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) - - -class VoiceAgentAzureMultilingualSemanticVadTurnDetection( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Azure multilingual semantic VAD turn-detection settings. - - :ivar remove_filler_words: Whether filler words are removed from transcription. - :vartype remove_filler_words: bool - :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech - stops. - :vartype auto_truncate: 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 type: Required. Multilingual Azure semantic voice activity detection. - :vartype type: str or ~azure.ai.voiceagents.models.AZURE_SEMANTIC_VAD_MULTILINGUAL - :ivar threshold: - :vartype threshold: float - :ivar prefix_padding_ms: - :vartype prefix_padding_ms: int - :ivar silence_duration_ms: - :vartype silence_duration_ms: int - :ivar idle_timeout_ms: - :vartype idle_timeout_ms: int - :ivar speech_duration_ms: - :vartype speech_duration_ms: int - :ivar end_of_utterance_detection: - :vartype end_of_utterance_detection: - ~azure.ai.voiceagents.models.VoiceAgentEndOfUtteranceDetection - :ivar languages: - :vartype languages: list[str] - """ - - remove_filler_words: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether filler words are removed from transcription.""" - auto_truncate: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the input audio buffer is truncated automatically when speech stops.""" - 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.""" - type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Multilingual Azure semantic voice activity detection.""" - threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - prefix_padding_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - silence_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - idle_timeout_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - speech_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - languages: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL], - remove_filler_words: Optional[bool] = None, - auto_truncate: Optional[bool] = None, - create_response: Optional[bool] = None, - interrupt_response: Optional[bool] = None, - threshold: Optional[float] = None, - prefix_padding_ms: Optional[int] = None, - silence_duration_ms: Optional[int] = None, - idle_timeout_ms: Optional[int] = None, - speech_duration_ms: Optional[int] = None, - end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = 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) - - -class VoiceAgentAzureSemanticVadTurnDetection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Azure semantic VAD turn-detection settings. - - :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 type: Required. Known values are: "azure_semantic_vad" and "azure_semantic_vad_en". - :vartype type: str or ~azure.ai.voiceagents.models.VoiceAgentAzureSemanticVadType - :ivar threshold: - :vartype threshold: float - :ivar prefix_padding_ms: - :vartype prefix_padding_ms: int - :ivar silence_duration_ms: - :vartype silence_duration_ms: int - :ivar idle_timeout_ms: - :vartype idle_timeout_ms: int - :ivar speech_duration_ms: - :vartype speech_duration_ms: int - :ivar end_of_utterance_detection: - :vartype end_of_utterance_detection: - ~azure.ai.voiceagents.models.VoiceAgentEndOfUtteranceDetection - :ivar remove_filler_words: - :vartype remove_filler_words: bool - :ivar languages: - :vartype languages: list[str] - :ivar auto_truncate: - :vartype auto_truncate: bool - """ - - 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.""" - type: Union[str, "_models.VoiceAgentAzureSemanticVadType"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Known values are: \"azure_semantic_vad\" and \"azure_semantic_vad_en\".""" - threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - prefix_padding_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - silence_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - idle_timeout_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - speech_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - remove_filler_words: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - languages: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - auto_truncate: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - type: Union[str, "_models.VoiceAgentAzureSemanticVadType"], - create_response: Optional[bool] = None, - interrupt_response: Optional[bool] = None, - threshold: Optional[float] = None, - prefix_padding_ms: Optional[int] = None, - silence_duration_ms: Optional[int] = None, - idle_timeout_ms: Optional[int] = None, - speech_duration_ms: Optional[int] = None, - end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = None, - remove_filler_words: Optional[bool] = None, - languages: Optional[list[str]] = None, - auto_truncate: 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 VoiceAgentClientEventConversationItemCreate( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``conversation.item.create`` client event. - - :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.voiceagents.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: The conversation item to create. Required. Is either a - "_unions.VoiceAgentRequestConversationItem" type or a RealtimeMCPApprovalResponse type. - :vartype item: ~azure.ai.voiceagents.models.RealtimeConversationItemMessageSystem or - ~azure.ai.voiceagents.models.RealtimeConversationItemMessageUser or - ~azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistant or - ~azure.ai.voiceagents.models.RealtimeConversationItemFunctionCall or - ~azure.ai.voiceagents.models.RealtimeConversationItemFunctionCallOutput or - ~azure.ai.voiceagents.models.RealtimeMCPApprovalResponse - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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: "_unions.VoiceAgentCreateConversationItem" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The conversation item to create. Required. Is either a - \"_unions.VoiceAgentRequestConversationItem\" type or a RealtimeMCPApprovalResponse type.""" - - @overload - def __init__( - self, - *, - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE], - item: "_unions.VoiceAgentCreateConversationItem", - event_id: Optional[str] = None, - previous_item_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 VoiceAgentClientEventConversationItemDelete( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``conversation.item.delete`` client event. - - :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.voiceagents.models.CONVERSATION_ITEM_DELETE - :ivar item_id: The ID of the item to delete. Required. - :vartype item_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_DELETE] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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, - *, - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE], - 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) - - -class VoiceAgentClientEventConversationItemRetrieve( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``conversation.item.retrieve`` client event. - - :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.voiceagents.models.CONVERSATION_ITEM_RETRIEVE - :ivar item_id: The ID of the item to retrieve. Required. - :vartype item_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_RETRIEVE] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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.""" - - @overload - def __init__( - self, - *, - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE], - 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) - - -class VoiceAgentClientEventConversationItemTruncate( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``conversation.item.truncate`` client event. - - :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.voiceagents.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: 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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, - *, - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE], - item_id: str, - content_index: int, - audio_end_ms: int, - 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 VoiceAgentClientEventInputAudioBufferAppend( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``input_audio_buffer.append`` client event. - - :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.voiceagents.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: 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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, - *, - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND], - 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) - - -class VoiceAgentClientEventInputAudioBufferClear( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``input_audio_buffer.clear`` client event. - - :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.voiceagents.models.INPUT_AUDIO_BUFFER_CLEAR - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The event type, must be ``input_audio_buffer.clear``. Required. INPUT_AUDIO_BUFFER_CLEAR.""" - - @overload - def __init__( - self, - *, - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR], - 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 VoiceAgentClientEventInputAudioBufferCommit( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``input_audio_buffer.commit`` client event. - - :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.voiceagents.models.INPUT_AUDIO_BUFFER_COMMIT - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The event type, must be ``input_audio_buffer.commit``. Required. INPUT_AUDIO_BUFFER_COMMIT.""" - - @overload - def __init__( - self, - *, - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT], - 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 VoiceAgentClientEventOutputAudioBufferClear( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``output_audio_buffer.clear`` client event. - - :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.voiceagents.models.OUTPUT_AUDIO_BUFFER_CLEAR - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The event type, must be ``output_audio_buffer.clear``. Required. OUTPUT_AUDIO_BUFFER_CLEAR.""" - - @overload - def __init__( - self, - *, - type: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR], - 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 VoiceAgentClientEventResponseCancel(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``response.cancel`` client event. - - :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.voiceagents.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: 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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, - *, - type: Literal[RealtimeClientEventType.RESPONSE_CANCEL], - event_id: Optional[str] = None, - 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) - - -class VoiceAgentClientEventResponseCreate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``response.create`` client event. - - :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.voiceagents.models.RESPONSE_CREATE - :ivar response: Parameters for the new response. - :vartype response: ~azure.ai.voiceagents.models.VoiceAgentResponseCreateParams - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The event type, must be ``response.create``. Required. RESPONSE_CREATE.""" - response: Optional["_models.VoiceAgentResponseCreateParams"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Parameters for the new response.""" - - @overload - def __init__( - self, - *, - type: Literal[RealtimeClientEventType.RESPONSE_CREATE], - event_id: Optional[str] = None, - response: Optional["_models.VoiceAgentResponseCreateParams"] = 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 VoiceAgentClientEventSessionAvatarConnect( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``session.avatar.connect`` client event. - - :ivar type: The event type. Always ``session.avatar.connect``. Required. Default value is - "session.avatar.connect". - :vartype type: str - :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 - """ - - type: Literal["session.avatar.connect"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The event type. Always ``session.avatar.connect``. Required. Default value is - \"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, - *, - client_sdp: 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: Literal["session.avatar.connect"] = "session.avatar.connect" - - -class VoiceAgentClientEventSessionUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``session.update`` client event. - - :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.voiceagents.models.SESSION_UPDATE - :ivar session: The stable realtime session fields to update. Required. - :vartype session: ~azure.ai.voiceagents.models.VoiceAgentSessionUpdateConfig - """ - - 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: "_models.VoiceAgentSessionUpdateConfig" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The stable realtime session fields to update. Required.""" - - @overload - def __init__( - self, - *, - type: Literal[RealtimeClientEventType.SESSION_UPDATE], - session: "_models.VoiceAgentSessionUpdateConfig", - 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 VoiceAgentDefinition(_Model): # 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. The realtime voice session is established - through a separate connect operation that is not defined in this specification. Every create or - update produces a new immutable version. - - :ivar kind: The kind discriminator for a voice agent definition. Always ``voice``. Required. - Default value is "voice". - :vartype kind: str - :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. - :vartype rai_config: ~azure.ai.voiceagents.models.RaiConfig - :ivar model_type: How the model backing this agent is served. Together with ``model``, this - selects the model up front. ``managed`` uses a service-managed model; ``self_deployed`` uses - the customer's own Foundry deployment. This is independent of the architecture (realtime or - cascaded), which the service derives from the selected model. Required. Known values are: - "managed" and "self_deployed". - :vartype model_type: str or ~azure.ai.voiceagents.models.VoiceModelType - :ivar model: The model to use for this agent, paired with ``model_type``: the service-managed - model name when ``model_type`` is ``managed``, or the customer's Foundry deployment name when - ``model_type`` is ``self_deployed``. The model must support realtime or cascaded voice. The - service derives the architecture from the selected model. Required. - :vartype model: str - :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.voiceagents.models.VoiceGreetingConfig - :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.voiceagents.models.VoiceAudioConfig - :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.voiceagents.models.VoiceOutputModality] - :ivar avatar: Optional avatar configuration. These values are session defaults and may be - overridden when connecting. - :vartype avatar: ~azure.ai.voiceagents.models.VoiceAvatarConfig - :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.voiceagents.models.RealtimeFunctionTool or - ~azure.ai.voiceagents.models.VoiceAgentMcpTool or ~azure.ai.voiceagents.models.VoiceSystemTool - or ~azure.ai.voiceagents.models.VoiceToolboxTool] - :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.voiceagents.models.StructuredInputDefinition] - :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 - """ - - kind: Literal["voice"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The kind discriminator for a voice agent definition. Always ``voice``. Required. Default value - is \"voice\".""" - rai_config: Optional["_models.RaiConfig"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Configuration for Responsible AI (RAI) content filtering and safety features.""" - model_type: Union[str, "_models.VoiceModelType"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """How the model backing this agent is served. Together with ``model``, this selects the model up - front. ``managed`` uses a service-managed model; ``self_deployed`` uses the customer's own - Foundry deployment. This is independent of the architecture (realtime or cascaded), which the - service derives from the selected model. Required. Known values are: \"managed\" and - \"self_deployed\".""" - model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The model to use for this agent, paired with ``model_type``: the service-managed model name - when ``model_type`` is ``managed``, or the customer's Foundry deployment name when - ``model_type`` is ``self_deployed``. The model must support realtime or cascaded voice. The - service derives the architecture from the selected model. Required.""" - 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.VoiceGreetingConfig"] = 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.VoiceAudioConfig"] = 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.""" - avatar: Optional["_models.VoiceAvatarConfig"] = 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["_unions.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.""" - structured_inputs: Optional[dict[str, "_models.StructuredInputDefinition"]] = 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.""" - 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.""" - - @overload - def __init__( - self, - *, - model_type: Union[str, "_models.VoiceModelType"], - model: str, - rai_config: Optional["_models.RaiConfig"] = None, - instructions: Optional[str] = None, - greeting: Optional["_models.VoiceGreetingConfig"] = None, - audio: Optional["_models.VoiceAudioConfig"] = None, - output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = None, - avatar: Optional["_models.VoiceAvatarConfig"] = None, - tools: Optional[list["_unions.VoiceAgentTool"]] = None, - structured_inputs: Optional[dict[str, "_models.StructuredInputDefinition"]] = None, - store: 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.kind: Literal["voice"] = "voice" - - -class VoiceAgentEchoCancellation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Server-side echo cancellation settings for input audio. - - :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.voiceagents.models.VoiceAgentEchoCancellationReferenceSource - :ivar channels: The number of input channels. Use two interleaved channels when - ``reference_source`` is ``client``. - :vartype channels: int - """ - - 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, - *, - reference_source: Optional[Union[str, "_models.VoiceAgentEchoCancellationReferenceSource"]] = None, - channels: 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: Literal["server_echo_cancellation"] = "server_echo_cancellation" - - -class VoiceAgentEndOfUtteranceDetection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """End-of-utterance detection settings. - - :ivar 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.voiceagents.models.VoiceAgentEndOfUtteranceModel - :ivar threshold: - :vartype threshold: float - :ivar threshold_level: Known values are: "low", "medium", "high", and "default". - :vartype threshold_level: str or - ~azure.ai.voiceagents.models.VoiceAgentEndOfUtteranceThresholdLevel - :ivar timeout: - :vartype timeout: float - :ivar timeout_ms: - :vartype timeout_ms: int - """ - - model: Union[str, "_models.VoiceAgentEndOfUtteranceModel"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Known values are: \"semantic_detection_v1\", \"semantic_detection_v1_en\", - \"semantic_detection_v1_multilingual\", and \"smart_end_of_turn_detection\".""" - threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - threshold_level: Optional[Union[str, "_models.VoiceAgentEndOfUtteranceThresholdLevel"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Known values are: \"low\", \"medium\", \"high\", and \"default\".""" - timeout: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - timeout_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - model: Union[str, "_models.VoiceAgentEndOfUtteranceModel"], - threshold: Optional[float] = None, - threshold_level: Optional[Union[str, "_models.VoiceAgentEndOfUtteranceThresholdLevel"]] = None, - timeout: Optional[float] = None, - timeout_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) - - -class VoiceAgentEstimatedCost(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A best-effort public-retail cost estimate for a response. - - :ivar amount: The total estimated amount, when available. Required. - :vartype amount: float - :ivar input_cost: The estimated input cost. - :vartype input_cost: float - :ivar output_cost: The estimated output cost. - :vartype output_cost: float - :ivar currency: The estimate currency. Always ``USD``. Default value is "USD". - :vartype currency: str - :ivar voice_live_amount: The portion attributed to Voice Live processing. Required. - :vartype voice_live_amount: float - :ivar byom_model_amount: The portion attributed to a customer-provided model. - :vartype byom_model_amount: float - :ivar status: Whether the estimate is complete, partial, or unavailable. Required. Known values - are: "complete", "partial", and "unavailable". - :vartype status: str or ~azure.ai.voiceagents.models.VoiceAgentEstimatedCostStatus - :ivar price_version: The Voice Live price version used for the estimate. Required. - :vartype price_version: str - :ivar byom_model_price_version: The customer-provided model price version used for the - estimate. - :vartype byom_model_price_version: str - :ivar unpriced_components: Components for which no price was available. - :vartype unpriced_components: list[str] - """ - - amount: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The total estimated amount, when available. Required.""" - input_cost: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The estimated input cost.""" - output_cost: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The estimated output cost.""" - currency: Optional[Literal["USD"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The estimate currency. Always ``USD``. Default value is \"USD\".""" - voice_live_amount: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The portion attributed to Voice Live processing. Required.""" - byom_model_amount: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The portion attributed to a customer-provided model.""" - status: Union[str, "_models.VoiceAgentEstimatedCostStatus"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Whether the estimate is complete, partial, or unavailable. Required. Known values are: - \"complete\", \"partial\", and \"unavailable\".""" - price_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Voice Live price version used for the estimate. Required.""" - byom_model_price_version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The customer-provided model price version used for the estimate.""" - unpriced_components: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Components for which no price was available.""" - - @overload - def __init__( - self, - *, - amount: float, - voice_live_amount: float, - status: Union[str, "_models.VoiceAgentEstimatedCostStatus"], - price_version: str, - input_cost: Optional[float] = None, - output_cost: Optional[float] = None, - currency: Optional[Literal["USD"]] = None, - byom_model_amount: Optional[float] = None, - byom_model_price_version: Optional[str] = None, - unpriced_components: 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 VoiceAgentFileSearchCallItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A file-search output item. - - :ivar id: Required. - :vartype id: str - :ivar type: Required. Default value is "file_search_call". - :vartype type: str - :ivar status: Required. Known values are: "in_progress", "searching", "completed", - "incomplete", and "failed". - :vartype status: str or ~azure.ai.voiceagents.models.VoiceAgentFileSearchCallStatus - :ivar queries: - :vartype queries: list[str] - :ivar results: - :vartype results: list[~azure.ai.voiceagents.models.VoiceAgentFileSearchResult] - """ - - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - type: Literal["file_search_call"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"file_search_call\".""" - status: Union[str, "_models.VoiceAgentFileSearchCallStatus"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Known values are: \"in_progress\", \"searching\", \"completed\", \"incomplete\", and - \"failed\".""" - queries: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - results: Optional[list["_models.VoiceAgentFileSearchResult"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - status: Union[str, "_models.VoiceAgentFileSearchCallStatus"], - queries: Optional[list[str]] = None, - results: Optional[list["_models.VoiceAgentFileSearchResult"]] = 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["file_search_call"] = "file_search_call" - - -class VoiceAgentFileSearchResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """One result returned by a file-search call. - - :ivar attributes: - :vartype attributes: dict[str, str or float or bool] - :ivar file_id: - :vartype file_id: str - :ivar filename: - :vartype filename: str - :ivar score: - :vartype score: float - :ivar text: - :vartype text: str - """ - - attributes: Optional[dict[str, "_unions.VoiceAgentFileSearchAttributeValue"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - file_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - filename: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - score: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - attributes: Optional[dict[str, "_unions.VoiceAgentFileSearchAttributeValue"]] = None, - file_id: Optional[str] = None, - filename: Optional[str] = None, - score: Optional[float] = None, - 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 VoiceAgentHandoffEdgeConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A directed transition between handoff nodes. - - :ivar id: The edge identifier. Required. - :vartype id: str - :ivar source: The source node identifier. Required. - :vartype source: str - :ivar target: The target node identifier. Required. - :vartype target: str - :ivar description: A non-empty description used by the model to select this transition. - Required. - :vartype description: str - :ivar cancel_on_interruption: Whether user interruption cancels the transition. - :vartype cancel_on_interruption: bool - :ivar delay_ms: The delay before the target behavior is committed, in milliseconds. - :vartype delay_ms: int - :ivar transfer_message: Optional text synthesized while transferring. - :vartype transfer_message: str - :ivar target_response: Whether the target automatically creates a response after transfer. - Known values are: "auto" and "none". - :vartype target_response: str or ~azure.ai.voiceagents.models.VoiceAgentHandoffTargetResponse - """ - - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The edge identifier. Required.""" - source: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The source node identifier. Required.""" - target: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The target node identifier. Required.""" - description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A non-empty description used by the model to select this transition. Required.""" - cancel_on_interruption: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether user interruption cancels the transition.""" - delay_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The delay before the target behavior is committed, in milliseconds.""" - transfer_message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional text synthesized while transferring.""" - target_response: Optional[Union[str, "_models.VoiceAgentHandoffTargetResponse"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Whether the target automatically creates a response after transfer. Known values are: \"auto\" - and \"none\".""" - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - source: str, - target: str, - description: str, - cancel_on_interruption: Optional[bool] = None, - delay_ms: Optional[int] = None, - transfer_message: Optional[str] = None, - target_response: Optional[Union[str, "_models.VoiceAgentHandoffTargetResponse"]] = 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 VoiceAgentHandoffEdgeState(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Non-sensitive metadata for an effective handoff edge. - - :ivar id: The edge identifier. Required. - :vartype id: str - :ivar source: The source node identifier. Required. - :vartype source: str - :ivar target: The target node identifier. Required. - :vartype target: str - :ivar cancel_on_interruption: Whether user interruption cancels the transition. - :vartype cancel_on_interruption: bool - :ivar delay_ms: The delay before the target behavior is committed, in milliseconds. - :vartype delay_ms: int - :ivar transfer_message: Optional text synthesized while transferring. - :vartype transfer_message: str - :ivar target_response: Whether the target automatically creates a response after transfer. - Known values are: "auto" and "none". - :vartype target_response: str or ~azure.ai.voiceagents.models.VoiceAgentHandoffTargetResponse - """ - - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The edge identifier. Required.""" - source: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The source node identifier. Required.""" - target: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The target node identifier. Required.""" - cancel_on_interruption: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether user interruption cancels the transition.""" - delay_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The delay before the target behavior is committed, in milliseconds.""" - transfer_message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional text synthesized while transferring.""" - target_response: Optional[Union[str, "_models.VoiceAgentHandoffTargetResponse"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Whether the target automatically creates a response after transfer. Known values are: \"auto\" - and \"none\".""" - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - source: str, - target: str, - cancel_on_interruption: Optional[bool] = None, - delay_ms: Optional[int] = None, - transfer_message: Optional[str] = None, - target_response: Optional[Union[str, "_models.VoiceAgentHandoffTargetResponse"]] = 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 VoiceAgentHandoffGraphConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A customer-supplied handoff graph. - - :ivar max_transfers: The maximum number of successful transfers in the session. - :vartype max_transfers: int - :ivar max_attempts: The maximum number of transfer attempts in the session. - :vartype max_attempts: int - :ivar nodes: The explicitly configured handoff targets. Required. - :vartype nodes: list[~azure.ai.voiceagents.models.VoiceAgentHandoffNodeConfig] - :ivar edges: The directed transitions between handoff nodes. Required. - :vartype edges: list[~azure.ai.voiceagents.models.VoiceAgentHandoffEdgeConfig] - """ - - max_transfers: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The maximum number of successful transfers in the session.""" - max_attempts: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The maximum number of transfer attempts in the session.""" - nodes: list["_models.VoiceAgentHandoffNodeConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The explicitly configured handoff targets. Required.""" - edges: list["_models.VoiceAgentHandoffEdgeConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The directed transitions between handoff nodes. Required.""" - - @overload - def __init__( - self, - *, - nodes: list["_models.VoiceAgentHandoffNodeConfig"], - edges: list["_models.VoiceAgentHandoffEdgeConfig"], - max_transfers: Optional[int] = None, - 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 VoiceAgentHandoffNodeConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A configured handoff target and its node-scoped behavior. - - :ivar id: The node identifier. Required. - :vartype id: str - :ivar description: A non-empty description used to select this target. Required. - :vartype description: str - :ivar config: Session behavior applied after transferring to this node. Required. - :vartype config: ~azure.ai.voiceagents.models.VoiceAgentHandoffNodeSessionConfig - """ - - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The node identifier. Required.""" - description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A non-empty description used to select this target. Required.""" - config: "_models.VoiceAgentHandoffNodeSessionConfig" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Session behavior applied after transferring to this node. Required.""" - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - description: str, - config: "_models.VoiceAgentHandoffNodeSessionConfig", - ) -> 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 VoiceAgentHandoffNodeSessionConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Session behavior applied at a handoff target. - - :ivar model: The target model, when different from the current node. - :vartype model: str - :ivar instructions: Instructions applied at the target node. - :vartype instructions: str - :ivar tools: Tools available at the target node. - :vartype tools: list[~azure.ai.voiceagents.models.RealtimeFunctionTool or - ~azure.ai.voiceagents.models.VoiceAgentSessionMcpTool or - ~azure.ai.voiceagents.models.VoiceToolboxTool or ~azure.ai.voiceagents.models.VoiceSystemTool] - :ivar tool_choice: Tool-selection behavior at the target node. Is either a Union[str, - "_models.ToolChoiceOptions"] type or a RealtimeToolChoiceFunction type. - :vartype tool_choice: str or ~azure.ai.voiceagents.models.ToolChoiceOptions or - ~azure.ai.voiceagents.models.RealtimeToolChoiceFunction - :ivar voice: The target node's voice. Is one of the following types: OpenAIVoice, AzureVoice, - AzureRealtimeNativeVoice - :vartype voice: ~azure.ai.voiceagents.models.OpenAIVoice or - ~azure.ai.voiceagents.models.AzureVoice or - ~azure.ai.voiceagents.models.AzureRealtimeNativeVoice - :ivar temperature: The target node's sampling temperature. - :vartype temperature: float - :ivar max_response_output_tokens: The target node's maximum output-token count. Is either a int - type or a Literal["inf"] type. - :vartype max_response_output_tokens: int or str - :ivar reasoning_effort: The reasoning effort used at the target node. Known values are: "none", - "minimal", "low", "medium", "high", and "xhigh". - :vartype reasoning_effort: str or ~azure.ai.voiceagents.models.VoiceAgentHandoffReasoningEffort - :ivar voice_adaptation: Voice adaptation applied at the target node. - :vartype voice_adaptation: ~azure.ai.voiceagents.models.VoiceAgentVoiceAdaptation - :ivar interim_response: Interim-response settings applied at the target node. Is either a - VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. - :vartype interim_response: ~azure.ai.voiceagents.models.VoiceAgentStaticInterimResponseConfig - or ~azure.ai.voiceagents.models.VoiceAgentLlmInterimResponseConfig - :ivar parallel_tool_calls: Whether the target model may call multiple tools in parallel. - :vartype parallel_tool_calls: bool - """ - - model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The target model, when different from the current node.""" - instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Instructions applied at the target node.""" - tools: Optional[list["_unions.VoiceAgentSessionTool"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Tools available at the target node.""" - tool_choice: Optional["_unions.VoiceAgentToolChoice"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Tool-selection behavior at the target node. Is either a Union[str, - \"_models.ToolChoiceOptions\"] type or a RealtimeToolChoiceFunction type.""" - voice: Optional["_unions.VoiceAgentVoice"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The target node's voice. Is one of the following types: OpenAIVoice, AzureVoice, - AzureRealtimeNativeVoice""" - temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The target node's sampling temperature.""" - max_response_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The target node's maximum output-token count. Is either a int type or a Literal[\"inf\"] type.""" - reasoning_effort: Optional[Union[str, "_models.VoiceAgentHandoffReasoningEffort"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The reasoning effort used at the target node. Known values are: \"none\", \"minimal\", \"low\", - \"medium\", \"high\", and \"xhigh\".""" - voice_adaptation: Optional["_models.VoiceAgentVoiceAdaptation"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Voice adaptation applied at the target node.""" - interim_response: Optional["_unions.VoiceAgentInterimResponse"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Interim-response settings applied at the target node. Is either a - VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type.""" - parallel_tool_calls: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the target model may call multiple tools in parallel.""" - - @overload - def __init__( - self, - *, - model: Optional[str] = None, - instructions: Optional[str] = None, - tools: Optional[list["_unions.VoiceAgentSessionTool"]] = None, - tool_choice: Optional["_unions.VoiceAgentToolChoice"] = None, - voice: Optional["_unions.VoiceAgentVoice"] = None, - temperature: Optional[float] = None, - max_response_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] = None, - reasoning_effort: Optional[Union[str, "_models.VoiceAgentHandoffReasoningEffort"]] = None, - voice_adaptation: Optional["_models.VoiceAgentVoiceAdaptation"] = None, - interim_response: Optional["_unions.VoiceAgentInterimResponse"] = 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 VoiceAgentHandoffNodeState(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Non-sensitive metadata for an effective handoff node. - - :ivar id: The node identifier. Required. - :vartype id: str - :ivar description: The node description. Required. - :vartype description: str - :ivar implicit: Whether the service implicitly created this node. - :vartype implicit: bool - """ - - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The node identifier. Required.""" - description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The node description. Required.""" - implicit: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the service implicitly created this node.""" - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - description: str, - implicit: 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 VoiceAgentHandoffState(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The effective handoff state returned by the service. - - :ivar pipeline_family: The runtime pipeline family. Required. Known values are: "cascaded" and - "realtime". - :vartype pipeline_family: str or ~azure.ai.voiceagents.models.VoiceAgentPipelineFamily - :ivar active_node_id: The active node identifier. Required. - :vartype active_node_id: str - :ivar node_generation: The active node generation. Required. - :vartype node_generation: int - :ivar transfer_count: The number of completed transfers. Required. - :vartype transfer_count: int - :ivar attempt_count: The number of transfer attempts. Required. - :vartype attempt_count: int - :ivar available_edge_ids: The edge identifiers currently available to the model. Required. - :vartype available_edge_ids: list[str] - :ivar transfer_tool: The function tool exposed to initiate transfers. Required. - :vartype transfer_tool: ~azure.ai.voiceagents.models.RealtimeFunctionTool - :ivar nodes: The compiled handoff nodes. Required. - :vartype nodes: list[~azure.ai.voiceagents.models.VoiceAgentHandoffNodeState] - :ivar edges: The compiled handoff edges. Required. - :vartype edges: list[~azure.ai.voiceagents.models.VoiceAgentHandoffEdgeState] - """ - - pipeline_family: Union[str, "_models.VoiceAgentPipelineFamily"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The runtime pipeline family. Required. Known values are: \"cascaded\" and \"realtime\".""" - active_node_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The active node identifier. Required.""" - node_generation: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The active node generation. Required.""" - transfer_count: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of completed transfers. Required.""" - attempt_count: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of transfer attempts. Required.""" - available_edge_ids: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The edge identifiers currently available to the model. Required.""" - transfer_tool: "_models.RealtimeFunctionTool" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The function tool exposed to initiate transfers. Required.""" - nodes: list["_models.VoiceAgentHandoffNodeState"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The compiled handoff nodes. Required.""" - edges: list["_models.VoiceAgentHandoffEdgeState"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The compiled handoff edges. Required.""" - - @overload - def __init__( - self, - *, - pipeline_family: Union[str, "_models.VoiceAgentPipelineFamily"], - active_node_id: str, - node_generation: int, - transfer_count: int, - attempt_count: int, - available_edge_ids: list[str], - transfer_tool: "_models.RealtimeFunctionTool", - nodes: list["_models.VoiceAgentHandoffNodeState"], - edges: list["_models.VoiceAgentHandoffEdgeState"], - ) -> 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 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 - - :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.voiceagents.models.VoiceAgentInterimResponseTrigger] - :ivar latency_threshold_ms: The latency threshold in milliseconds. - :vartype latency_threshold_ms: int - """ - - __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[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The latency threshold in milliseconds.""" - - @overload - def __init__( - self, - *, - type: str, - triggers: Optional[list[Union[str, "_models.VoiceAgentInterimResponseTrigger"]]] = None, - latency_threshold_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) - - -class VoiceAgentLlmInterimResponseConfig( - VoiceAgentInterimResponseConfig, discriminator="llm_interim_response" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """An interim response generated by a language model. - - :ivar triggers: Conditions that may trigger one interim response. - :vartype triggers: list[str or ~azure.ai.voiceagents.models.VoiceAgentInterimResponseTrigger] - :ivar latency_threshold_ms: The latency threshold in milliseconds. - :vartype latency_threshold_ms: int - :ivar type: Required. Default value is "llm_interim_response". - :vartype type: str - :ivar model: The model used to generate interim responses. - :vartype model: str - :ivar instructions: Optional instructions for generating interim responses. - :vartype instructions: str - :ivar max_completion_tokens: The maximum completion-token count for an interim response. - :vartype max_completion_tokens: int - """ - - type: Literal["llm_interim_response"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Default value is \"llm_interim_response\".""" - model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The model used to generate interim responses.""" - instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional instructions for generating interim responses.""" - max_completion_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The maximum completion-token count for an interim response.""" - - @overload - def __init__( - self, - *, - triggers: Optional[list[Union[str, "_models.VoiceAgentInterimResponseTrigger"]]] = None, - latency_threshold_ms: Optional[int] = None, - model: Optional[str] = None, - instructions: Optional[str] = None, - max_completion_tokens: 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 = "llm_interim_response" # type: ignore - - -class VoiceAgentMcpAssignedManagedIdentity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A managed identity used to authorize a voice-agent MCP connection. - - :ivar type: Required. Default value is "assigned_managed_identity". - :vartype type: str - :ivar audience: Required. - :vartype audience: str - :ivar client_id: - :vartype client_id: str - """ - - type: Literal["assigned_managed_identity"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"assigned_managed_identity\".""" - audience: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - client_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - audience: str, - client_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["assigned_managed_identity"] = "assigned_managed_identity" - - -class VoiceAgentMcpTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """An MCP tool available to a voice agent. - - :ivar type: The type of the MCP tool. Always ``mcp``. Required. MCP. - :vartype type: str or ~azure.ai.voiceagents.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_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.voiceagents.models.MCPToolFilter - :ivar allowed_callers: - :vartype allowed_callers: list[str or ~azure.ai.voiceagents.models.CallableToolAllowedCaller] - :ivar require_approval: Is one of the following types: MCPToolRequireApproval, - Literal["always"], Literal["never"] - :vartype require_approval: ~azure.ai.voiceagents.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.voiceagents.models.ToolConfig] - :ivar server_url: The URL for the MCP server. - :vartype server_url: str - :ivar response_scheduling: When the MCP invocation creates a follow-up response. Defaults to - ``when_idle`` so the agent continues after the tool call completes. Known values are: "silent", - "when_idle", "interrupt", and "skip_if_busy". - :vartype response_scheduling: str or - ~azure.ai.voiceagents.models.VoiceAgentMcpResponseScheduling - """ - - type: Literal[ToolType.MCP] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """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_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.""" - server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The URL for the MCP server.""" - response_scheduling: Optional[Union[str, "_models.VoiceAgentMcpResponseScheduling"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """When the MCP invocation creates a follow-up response. Defaults to ``when_idle`` so the agent - continues after the tool call completes. Known values are: \"silent\", \"when_idle\", - \"interrupt\", and \"skip_if_busy\".""" - - @overload - def __init__( - self, - *, - type: Literal[ToolType.MCP], - server_label: str, - 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, - server_url: Optional[str] = None, - response_scheduling: Optional[Union[str, "_models.VoiceAgentMcpResponseScheduling"]] = 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 VoiceAgentObject(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A voice agent. Mirrors ``AgentObject``, but its latest version is a - ``VoiceAgentVersionObject``. - - :ivar object: The object type, which is always 'agent'. Required. AGENT. - :vartype object: str or ~azure.ai.voiceagents.models.AGENT - :ivar id: The unique identifier of the agent. Required. - :vartype id: str - :ivar name: The name of the agent. Required. - :vartype name: str - :ivar state: The operational state of the agent. Controls whether the agent endpoint accepts or - rejects requests. Required. Known values are: "enabled" and "disabled". - :vartype state: str or ~azure.ai.voiceagents.models.AgentState - :ivar state_source: The source of the agent's operational state. When the agent is disabled, - indicates where the disabled state originates from. Empty when not derived from a specific - source. Known values are: "agent_instance_identity" and "agent_blueprint". - :vartype state_source: str or ~azure.ai.voiceagents.models.AgentStateSource - :ivar agent_endpoint: The endpoint configuration for the agent. - :vartype agent_endpoint: ~azure.ai.voiceagents.models.AgentEndpointConfig - :ivar instance_identity: The instance identity of the agent. - :vartype instance_identity: ~azure.ai.voiceagents.models.AgentIdentity - :ivar blueprint: The blueprint for the agent. - :vartype blueprint: ~azure.ai.voiceagents.models.AgentIdentity - :ivar blueprint_reference: The blueprint for the agent. - :vartype blueprint_reference: ~azure.ai.voiceagents.models.AgentBlueprintReference - :ivar agent_card: - :vartype agent_card: ~azure.ai.voiceagents.models.AgentCard - :ivar versions: The latest version of the voice agent. Required. - :vartype versions: ~azure.ai.voiceagents.models.VoiceAgentObjectVersions - """ - - object: Literal[AgentObjectType.AGENT] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The object type, which is always 'agent'. Required. AGENT.""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the agent. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the agent. Required.""" - state: Union[str, "_models.AgentState"] = rest_field(visibility=["read"]) - """The operational state of the agent. Controls whether the agent endpoint accepts or rejects - requests. Required. Known values are: \"enabled\" and \"disabled\".""" - state_source: Optional[Union[str, "_models.AgentStateSource"]] = rest_field(visibility=["read"]) - """The source of the agent's operational state. When the agent is disabled, indicates where the - disabled state originates from. Empty when not derived from a specific source. Known values - are: \"agent_instance_identity\" and \"agent_blueprint\".""" - agent_endpoint: Optional["_models.AgentEndpointConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The endpoint configuration for the agent.""" - instance_identity: Optional["_models.AgentIdentity"] = rest_field(visibility=["read"]) - """The instance identity of the agent.""" - blueprint: Optional["_models.AgentIdentity"] = rest_field(visibility=["read"]) - """The blueprint for the agent.""" - blueprint_reference: Optional["_models.AgentBlueprintReference"] = rest_field(visibility=["read"]) - """The blueprint for the agent.""" - agent_card: Optional["_models.AgentCard"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - versions: "_models.VoiceAgentObjectVersions" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The latest version of the voice agent. Required.""" - - @overload - def __init__( - self, - *, - object: Literal[AgentObjectType.AGENT], - id: str, # pylint: disable=redefined-builtin - name: str, - versions: "_models.VoiceAgentObjectVersions", - agent_endpoint: Optional["_models.AgentEndpointConfig"] = None, - agent_card: Optional["_models.AgentCard"] = 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 VoiceAgentObjectVersions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """VoiceAgentObjectVersions. - - :ivar latest: Required. - :vartype latest: ~azure.ai.voiceagents.models.VoiceAgentVersionObject - """ - - latest: "_models.VoiceAgentVersionObject" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - latest: "_models.VoiceAgentVersionObject", - ) -> 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 VoiceAgentRealtimeResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A realtime response returned by the voice-agent service. - - :ivar object: The object type. Always ``realtime.response``. Required. Default value is - "realtime.response". - :vartype object: str - :ivar id: The response identifier. Required. - :vartype id: str - :ivar status: The response lifecycle status. Required. Known values are: "in_progress", - "completed", "cancelled", "incomplete", and "failed". - :vartype status: str or ~azure.ai.voiceagents.models.VoiceAgentResponseStatus - :ivar status_details: Additional details for a terminal response status. Required. - :vartype status_details: ~azure.ai.voiceagents.models.RealtimeResponseStatusDetails - :ivar output: The items produced by the response. Required. - :vartype output: list[~azure.ai.voiceagents.models.RealtimeConversationItemMessageSystem or - ~azure.ai.voiceagents.models.RealtimeConversationItemMessageUser or - ~azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistant or - ~azure.ai.voiceagents.models.VoiceFunctionCallItem or - ~azure.ai.voiceagents.models.VoiceFunctionCallOutputItem or - ~azure.ai.voiceagents.models.VoiceMcpListToolsItem or - ~azure.ai.voiceagents.models.VoiceMcpCallItem or - ~azure.ai.voiceagents.models.VoiceMcpApprovalRequestItem or - ~azure.ai.voiceagents.models.VoiceMcpApprovalResponseItem or - ~azure.ai.voiceagents.models.VoiceAgentWorkflowActionItem or - ~azure.ai.voiceagents.models.VoiceAgentWebSearchCallItem or - ~azure.ai.voiceagents.models.VoiceAgentFileSearchCallItem] - :ivar usage: Token usage for the response. Required. - :vartype usage: ~azure.ai.voiceagents.models.RealtimeResponseUsage - :ivar estimated_cost: The best-effort response cost estimate. Returned only when cost output is - enabled. - :vartype estimated_cost: ~azure.ai.voiceagents.models.VoiceAgentEstimatedCost - :ivar conversation_id: The conversation identifier, or null for an out-of-band response. - :vartype conversation_id: str - :ivar modalities: The modalities used by the response. - :vartype modalities: list[str or ~azure.ai.voiceagents.models.VoiceOutputModality] - :ivar voice: The voice used by the response. Is one of the following types: OpenAIVoice, - AzureVoice, AzureRealtimeNativeVoice - :vartype voice: ~azure.ai.voiceagents.models.OpenAIVoice or - ~azure.ai.voiceagents.models.AzureVoice or - ~azure.ai.voiceagents.models.AzureRealtimeNativeVoice - :ivar output_audio_format: The output-audio format used by the response. Known values are: - "pcm16", "pcm16_8000hz", "pcm16_16000hz", "pcm16_22050hz", "pcm16_24000hz", "pcm16_44100hz", - "pcm16_48000hz", "g711_ulaw", "g711_alaw", "mp3", "mp3_24khz_48kbps", "mp3_24khz_96kbps", and - "mp3_24khz_160kbps". - :vartype output_audio_format: str or ~azure.ai.voiceagents.models.VoiceAgentResponseAudioFormat - :ivar temperature: The sampling temperature used by the response. - :vartype temperature: float - :ivar max_output_tokens: The maximum output-token count used by the response. Is either a int - type or a Literal["inf"] type. - :vartype max_output_tokens: int or str - :ivar metadata: String key-value metadata attached to the response. - :vartype metadata: dict[str, str] - """ - - object: Literal["realtime.response"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The object type. Always ``realtime.response``. Required. Default value is - \"realtime.response\".""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The response identifier. Required.""" - status: Union[str, "_models.VoiceAgentResponseStatus"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The response lifecycle status. Required. Known values are: \"in_progress\", \"completed\", - \"cancelled\", \"incomplete\", and \"failed\".""" - status_details: "_models.RealtimeResponseStatusDetails" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Additional details for a terminal response status. Required.""" - output: list["_unions.VoiceAgentResponseItem"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The items produced by the response. Required.""" - usage: "_models.RealtimeResponseUsage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Token usage for the response. Required.""" - estimated_cost: Optional["_models.VoiceAgentEstimatedCost"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The best-effort response cost estimate. Returned only when cost output is enabled.""" - conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The conversation identifier, or null for an out-of-band response.""" - modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The modalities used by the response.""" - voice: Optional["_unions.VoiceAgentVoice"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The voice used by the response. Is one of the following types: OpenAIVoice, AzureVoice, - AzureRealtimeNativeVoice""" - output_audio_format: Optional[Union[str, "_models.VoiceAgentResponseAudioFormat"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The output-audio format used by the response. Known values are: \"pcm16\", \"pcm16_8000hz\", - \"pcm16_16000hz\", \"pcm16_22050hz\", \"pcm16_24000hz\", \"pcm16_44100hz\", \"pcm16_48000hz\", - \"g711_ulaw\", \"g711_alaw\", \"mp3\", \"mp3_24khz_48kbps\", \"mp3_24khz_96kbps\", and - \"mp3_24khz_160kbps\".""" - temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The sampling temperature used by the response.""" - max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The maximum output-token count used by the response. Is either a int type or a Literal[\"inf\"] - type.""" - metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """String key-value metadata attached to the response.""" - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - status: Union[str, "_models.VoiceAgentResponseStatus"], - status_details: "_models.RealtimeResponseStatusDetails", - output: list["_unions.VoiceAgentResponseItem"], - usage: "_models.RealtimeResponseUsage", - estimated_cost: Optional["_models.VoiceAgentEstimatedCost"] = None, - conversation_id: Optional[str] = None, - modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = None, - voice: Optional["_unions.VoiceAgentVoice"] = None, - output_audio_format: Optional[Union[str, "_models.VoiceAgentResponseAudioFormat"]] = None, - temperature: Optional[float] = None, - max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] = None, - metadata: 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.object: Literal["realtime.response"] = "realtime.response" - - -class VoiceAgentResponseCreateAudio(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Output-audio settings applied to one ``response.create`` request. - - :ivar output: The response-specific output-audio settings. - :vartype output: ~azure.ai.voiceagents.models.VoiceAgentSessionUpdateAudioOutput - """ - - output: Optional["_models.VoiceAgentSessionUpdateAudioOutput"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The response-specific output-audio settings.""" - - @overload - def __init__( - self, - *, - output: Optional["_models.VoiceAgentSessionUpdateAudioOutput"] = 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 VoiceAgentResponseCreateParams(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Parameters accepted by a voice-agent ``response.create`` event. - - :ivar instructions: The default system instructions (i.e. system message) prepended to model - calls. This field allows the client to guide the model on desired responses. The model can be - instructed on response content and format, (e.g. "be extremely succinct", "act friendly", "here - are examples of good responses") and on audio behavior (e.g. "talk quickly", "inject emotion - into your voice", "laugh frequently"). The instructions are not guaranteed to be followed by - the model, but they provide guidance to the model on the desired behavior. Note that the server - sets default instructions which will be used if this field is not set and are visible in the - ``session.created`` event at the start of the session. - :vartype instructions: str - :ivar tools: Tools available to the model. - :vartype tools: list[~azure.ai.voiceagents.models.RealtimeFunctionTool or - ~azure.ai.voiceagents.models.MCPTool] - :ivar tool_choice: How the model chooses tools. Provide one of the string modes or force a - specific function/MCP tool. Is one of the following types: Union[str, - "_models.ToolChoiceOptions"], ToolChoiceFunction, ToolChoiceMCP - :vartype tool_choice: str or ~azure.ai.voiceagents.models.ToolChoiceOptions or - ~azure.ai.voiceagents.models.ToolChoiceFunction or ~azure.ai.voiceagents.models.ToolChoiceMCP - :ivar parallel_tool_calls: Whether the model may call multiple tools in parallel. Only - supported by reasoning Realtime models such as ``gpt-realtime-2``. - :vartype parallel_tool_calls: bool - :ivar reasoning: - :vartype reasoning: ~azure.ai.voiceagents.models.RealtimeReasoning - :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, - inclusive of tool calls. Provide an integer between 1 and 4096 to limit output tokens, or - ``inf`` for the maximum available tokens for a given model. Defaults to ``inf``. Is either a - int type or a Literal["inf"] type. - :vartype max_output_tokens: int or str - :ivar conversation: Controls which conversation the response is added to. Currently supports - ``auto`` and ``none``, with ``auto`` as the default value. The ``auto`` value means that the - contents of the response will be added to the default conversation. Set this to ``none`` to - create an out-of-band response which will not add items to default conversation. Is one of the - following types: Literal["auto"], Literal["none"], str - :vartype conversation: str or str or str - :ivar metadata: - :vartype metadata: ~azure.ai.voiceagents.models.Metadata - :ivar input: Input items to include in the prompt for the model. Using this field creates a new - context for this Response instead of using the default conversation. An empty array ``[]`` will - clear the context for this Response. Note that this can include references to items that - previously appeared in the session using their id. - :vartype input: list[~azure.ai.voiceagents.models.RealtimeConversationItem] - :ivar output_modalities: Modalities that the response may return. - :vartype output_modalities: list[str or ~azure.ai.voiceagents.models.VoiceOutputModality] - :ivar audio: Response-specific audio settings. - :vartype audio: ~azure.ai.voiceagents.models.VoiceAgentResponseCreateAudio - :ivar pre_generated_assistant_message: A pre-generated assistant message used to begin the - response. - :vartype pre_generated_assistant_message: - ~azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistant - :ivar interim_response: Interim-response settings for this response. Is either a - VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. - :vartype interim_response: ~azure.ai.voiceagents.models.VoiceAgentStaticInterimResponseConfig - or ~azure.ai.voiceagents.models.VoiceAgentLlmInterimResponseConfig - """ - - instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The default system instructions (i.e. system message) prepended to model calls. This field - allows the client to guide the model on desired responses. The model can be instructed on - response content and format, (e.g. \"be extremely succinct\", \"act friendly\", \"here are - examples of good responses\") and on audio behavior (e.g. \"talk quickly\", \"inject emotion - into your voice\", \"laugh frequently\"). The instructions are not guaranteed to be followed by - the model, but they provide guidance to the model on the desired behavior. Note that the server - sets default instructions which will be used if this field is not set and are visible in the - ``session.created`` event at the start of the session.""" - tools: Optional[list[Union["_models.RealtimeFunctionTool", "_models.MCPTool"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Tools available to the model.""" - tool_choice: Optional[ - Union[str, "_models.ToolChoiceOptions", "_models.ToolChoiceFunction", "_models.ToolChoiceMCP"] - ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """How the model chooses tools. Provide one of the string modes or force a specific function/MCP - tool. Is one of the following types: Union[str, \"_models.ToolChoiceOptions\"], - ToolChoiceFunction, ToolChoiceMCP""" - parallel_tool_calls: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the model may call multiple tools in parallel. Only supported by reasoning Realtime - models such as ``gpt-realtime-2``.""" - reasoning: Optional["_models.RealtimeReasoning"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - max_output_tokens: Optional[Union[int, Literal["inf"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Maximum number of output tokens for a single assistant response, inclusive of tool calls. - Provide an integer between 1 and 4096 to limit output tokens, or ``inf`` for the maximum - available tokens for a given model. Defaults to ``inf``. Is either a int type or a - Literal[\"inf\"] type.""" - conversation: Optional[Union[Literal["auto"], Literal["none"], str]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Controls which conversation the response is added to. Currently supports ``auto`` and ``none``, - with ``auto`` as the default value. The ``auto`` value means that the contents of the response - will be added to the default conversation. Set this to ``none`` to create an out-of-band - response which will not add items to default conversation. Is one of the following types: - Literal[\"auto\"], Literal[\"none\"], str""" - metadata: Optional["_models.Metadata"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - input: Optional[list["_models.RealtimeConversationItem"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Input items to include in the prompt for the model. Using this field creates a new context for - this Response instead of using the default conversation. An empty array ``[]`` will clear the - context for this Response. Note that this can include references to items that previously - appeared in the session using their id.""" - output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Modalities that the response may return.""" - audio: Optional["_models.VoiceAgentResponseCreateAudio"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Response-specific audio settings.""" - pre_generated_assistant_message: Optional["_models.RealtimeConversationItemMessageAssistant"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """A pre-generated assistant message used to begin the response.""" - interim_response: Optional["_unions.VoiceAgentInterimResponse"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Interim-response settings for this response. Is either a VoiceAgentStaticInterimResponseConfig - type or a VoiceAgentLlmInterimResponseConfig type.""" - - @overload - def __init__( - self, - *, - instructions: Optional[str] = None, - tools: Optional[list[Union["_models.RealtimeFunctionTool", "_models.MCPTool"]]] = None, - tool_choice: Optional[ - Union[str, "_models.ToolChoiceOptions", "_models.ToolChoiceFunction", "_models.ToolChoiceMCP"] - ] = None, - parallel_tool_calls: Optional[bool] = None, - reasoning: Optional["_models.RealtimeReasoning"] = None, - max_output_tokens: Optional[Union[int, Literal["inf"]]] = None, - conversation: Optional[Union[Literal["auto"], Literal["none"], str]] = None, - metadata: Optional["_models.Metadata"] = None, - input: Optional[list["_models.RealtimeConversationItem"]] = None, - output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = None, - audio: Optional["_models.VoiceAgentResponseCreateAudio"] = None, - pre_generated_assistant_message: Optional["_models.RealtimeConversationItemMessageAssistant"] = None, - interim_response: Optional["_unions.VoiceAgentInterimResponse"] = 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 VoiceAgentResponseEventAudioContentPart(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """An audio part in a ``response.content_part.*`` server event. - - :ivar type: Required. Default value is "audio". - :vartype type: str - :ivar transcript: Required. - :vartype transcript: str - :ivar annotations: - :vartype annotations: any - :ivar audio: - :vartype audio: str - :ivar format: - :vartype format: ~azure.ai.voiceagents.models.VoiceAudioFormat - """ - - type: Literal["audio"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"audio\".""" - transcript: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - annotations: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - audio: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - format: Optional["_models.VoiceAudioFormat"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - transcript: str, - annotations: Optional[Any] = None, - audio: Optional[str] = None, - format: Optional["_models.VoiceAudioFormat"] = 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["audio"] = "audio" - - -class VoiceAgentResponseEventTextContentPart(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A text part in a ``response.content_part.*`` server event. - - :ivar type: Required. Default value is "text". - :vartype type: str - :ivar text: Required. - :vartype text: str - """ - - type: Literal["text"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"text\".""" - text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """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["text"] = "text" - - -class VoiceAgentSemanticVadTurnDetection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """OpenAI semantic VAD turn-detection settings. - - :ivar eagerness: Is one of the following types: Literal["low"], Literal["medium"], - Literal["high"], Literal["auto"] - :vartype eagerness: str or str or str or str - :ivar create_response: - :vartype create_response: bool - :ivar interrupt_response: - :vartype interrupt_response: bool - :ivar type: Required. Semantic voice activity detection. - :vartype type: str or ~azure.ai.voiceagents.models.SEMANTIC_VAD - :ivar auto_truncate: - :vartype auto_truncate: bool - """ - - eagerness: Optional[Literal["low", "medium", "high", "auto"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Is one of the following types: Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"], - Literal[\"auto\"]""" - create_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - interrupt_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Semantic voice activity detection.""" - auto_truncate: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD], - eagerness: Optional[Literal["low", "medium", "high", "auto"]] = None, - create_response: Optional[bool] = None, - interrupt_response: Optional[bool] = None, - auto_truncate: 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 VoiceAgentServerEventConversationCreated(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``conversation.created`` server event emitted when a voice-agent connection starts. - - :ivar type: Required. Default value is "conversation.created". - :vartype type: str - :ivar conversation_id: The identifier of the created conversation. Required. - :vartype conversation_id: str - """ - - type: Literal["conversation.created"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"conversation.created\".""" - conversation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The identifier of the created conversation. Required.""" - - @overload - def __init__( - self, - *, - conversation_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["conversation.created"] = "conversation.created" - - -class VoiceAgentServerEventConversationItemAdded( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``conversation.item.added`` server event. - - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.added``. Required. - CONVERSATION_ITEM_ADDED. - :vartype type: str or ~azure.ai.voiceagents.models.CONVERSATION_ITEM_ADDED - :ivar previous_item_id: - :vartype previous_item_id: str - :ivar item: The item added to the conversation. Required. Is one of the following types: - "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, - VoiceAgentFileSearchCallItem - :vartype item: ~azure.ai.voiceagents.models.RealtimeConversationItemMessageSystem or - ~azure.ai.voiceagents.models.RealtimeConversationItemMessageUser or - ~azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistant or - ~azure.ai.voiceagents.models.VoiceFunctionCallItem or - ~azure.ai.voiceagents.models.VoiceFunctionCallOutputItem or - ~azure.ai.voiceagents.models.VoiceMcpListToolsItem or - ~azure.ai.voiceagents.models.VoiceMcpCallItem or - ~azure.ai.voiceagents.models.VoiceMcpApprovalRequestItem or - ~azure.ai.voiceagents.models.VoiceMcpApprovalResponseItem or - ~azure.ai.voiceagents.models.VoiceAgentWorkflowActionItem or - ~azure.ai.voiceagents.models.VoiceAgentWebSearchCallItem or - ~azure.ai.voiceagents.models.VoiceAgentFileSearchCallItem - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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: "_unions.VoiceAgentResponseItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The item added to the conversation. Required. Is one of the following types: - \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, - VoiceAgentFileSearchCallItem""" - - @overload - def __init__( - self, - *, - event_id: str, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED], - item: "_unions.VoiceAgentResponseItem", - previous_item_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 VoiceAgentServerEventConversationItemCreated( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``conversation.item.created`` server event. - - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.created``. Required. - CONVERSATION_ITEM_CREATED. - :vartype type: str or ~azure.ai.voiceagents.models.CONVERSATION_ITEM_CREATED - :ivar previous_item_id: - :vartype previous_item_id: str - :ivar item: The created conversation item. Required. Is one of the following types: - "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, - VoiceAgentFileSearchCallItem - :vartype item: ~azure.ai.voiceagents.models.RealtimeConversationItemMessageSystem or - ~azure.ai.voiceagents.models.RealtimeConversationItemMessageUser or - ~azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistant or - ~azure.ai.voiceagents.models.VoiceFunctionCallItem or - ~azure.ai.voiceagents.models.VoiceFunctionCallOutputItem or - ~azure.ai.voiceagents.models.VoiceMcpListToolsItem or - ~azure.ai.voiceagents.models.VoiceMcpCallItem or - ~azure.ai.voiceagents.models.VoiceMcpApprovalRequestItem or - ~azure.ai.voiceagents.models.VoiceMcpApprovalResponseItem or - ~azure.ai.voiceagents.models.VoiceAgentWorkflowActionItem or - ~azure.ai.voiceagents.models.VoiceAgentWebSearchCallItem or - ~azure.ai.voiceagents.models.VoiceAgentFileSearchCallItem - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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: "_unions.VoiceAgentResponseItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The created conversation item. Required. Is one of the following types: - \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, - VoiceAgentFileSearchCallItem""" - - @overload - def __init__( - self, - *, - event_id: str, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED], - item: "_unions.VoiceAgentResponseItem", - previous_item_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 VoiceAgentServerEventConversationItemDeleted( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``conversation.item.deleted`` server event. - - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.deleted``. Required. - CONVERSATION_ITEM_DELETED. - :vartype type: str or ~azure.ai.voiceagents.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.CONVERSATION_ITEM_DELETED] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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 item that was deleted. Required.""" - - @overload - def __init__( - self, - *, - event_id: str, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED], - item_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 VoiceAgentServerEventConversationItemDone( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``conversation.item.done`` server event. - - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.done``. Required. - CONVERSATION_ITEM_DONE. - :vartype type: str or ~azure.ai.voiceagents.models.CONVERSATION_ITEM_DONE - :ivar previous_item_id: - :vartype previous_item_id: str - :ivar item: The completed conversation item. Required. Is one of the following types: - "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, - VoiceAgentFileSearchCallItem - :vartype item: ~azure.ai.voiceagents.models.RealtimeConversationItemMessageSystem or - ~azure.ai.voiceagents.models.RealtimeConversationItemMessageUser or - ~azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistant or - ~azure.ai.voiceagents.models.VoiceFunctionCallItem or - ~azure.ai.voiceagents.models.VoiceFunctionCallOutputItem or - ~azure.ai.voiceagents.models.VoiceMcpListToolsItem or - ~azure.ai.voiceagents.models.VoiceMcpCallItem or - ~azure.ai.voiceagents.models.VoiceMcpApprovalRequestItem or - ~azure.ai.voiceagents.models.VoiceMcpApprovalResponseItem or - ~azure.ai.voiceagents.models.VoiceAgentWorkflowActionItem or - ~azure.ai.voiceagents.models.VoiceAgentWebSearchCallItem or - ~azure.ai.voiceagents.models.VoiceAgentFileSearchCallItem - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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: "_unions.VoiceAgentResponseItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The completed conversation item. Required. Is one of the following types: - \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, - VoiceAgentFileSearchCallItem""" - - @overload - def __init__( - self, - *, - event_id: str, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE], - item: "_unions.VoiceAgentResponseItem", - previous_item_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 VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``conversation.item.input_audio_transcription.completed`` server event. - - :ivar event_id: The unique ID of the server event. Required. - :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.voiceagents.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 logprobs: - :vartype logprobs: list[~azure.ai.voiceagents.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.voiceagents.models.TranscriptTextUsageTokens or - ~azure.ai.voiceagents.models.TranscriptTextUsageDuration - :ivar phrases: Phrase-level transcription timing and confidence details. - :vartype phrases: list[~azure.ai.voiceagents.models.VoiceAgentTranscriptionPhrase] - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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.""" - 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, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED], - item_id: str, - content_index: int, - transcript: str, - usage: Union["_models.TranscriptTextUsageTokens", "_models.TranscriptTextUsageDuration"], - logprobs: Optional[list["_models.LogProbProperties"]] = None, - phrases: Optional[list["_models.VoiceAgentTranscriptionPhrase"]] = 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 VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``conversation.item.input_audio_transcription.delta`` server event. - - :ivar event_id: The unique ID of the server event. Required. - :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.voiceagents.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.voiceagents.models.LogProbProperties] - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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"] - ) - - @overload - def __init__( - self, - *, - event_id: str, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA], - item_id: str, - content_index: Optional[int] = None, - delta: Optional[str] = None, - logprobs: Optional[list["_models.LogProbProperties"]] = 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 VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``conversation.item.input_audio_transcription.failed`` server event. - - :ivar event_id: The unique ID of the server event. Required. - :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.voiceagents.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.voiceagents.models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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.""" - - @overload - def __init__( - self, - *, - event_id: str, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED], - item_id: str, - content_index: int, - error: "_models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError", - ) -> 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 VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``conversation.item.input_audio_transcription.segment`` server event. - - :ivar event_id: The unique ID of the server event. Required. - :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.voiceagents.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.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT], - item_id: str, - content_index: int, - text: str, - id: str, # pylint: disable=redefined-builtin - speaker: str, - start: float, - end: 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 VoiceAgentServerEventConversationItemRetrieved( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``conversation.item.retrieved`` server event. - - :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.voiceagents.models.CONVERSATION_ITEM_RETRIEVED - :ivar item: The retrieved conversation item. Required. Is one of the following types: - "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, - VoiceAgentFileSearchCallItem - :vartype item: ~azure.ai.voiceagents.models.RealtimeConversationItemMessageSystem or - ~azure.ai.voiceagents.models.RealtimeConversationItemMessageUser or - ~azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistant or - ~azure.ai.voiceagents.models.VoiceFunctionCallItem or - ~azure.ai.voiceagents.models.VoiceFunctionCallOutputItem or - ~azure.ai.voiceagents.models.VoiceMcpListToolsItem or - ~azure.ai.voiceagents.models.VoiceMcpCallItem or - ~azure.ai.voiceagents.models.VoiceMcpApprovalRequestItem or - ~azure.ai.voiceagents.models.VoiceMcpApprovalResponseItem or - ~azure.ai.voiceagents.models.VoiceAgentWorkflowActionItem or - ~azure.ai.voiceagents.models.VoiceAgentWebSearchCallItem or - ~azure.ai.voiceagents.models.VoiceAgentFileSearchCallItem - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The event type, must be ``conversation.item.retrieved``. Required. CONVERSATION_ITEM_RETRIEVED.""" - item: "_unions.VoiceAgentResponseItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The retrieved conversation item. Required. Is one of the following types: - \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, - VoiceAgentFileSearchCallItem""" - - @overload - def __init__( - self, - *, - event_id: str, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED], - item: "_unions.VoiceAgentResponseItem", - ) -> 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 VoiceAgentServerEventConversationItemTruncated( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``conversation.item.truncated`` server event. - - :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.voiceagents.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.voiceagents.models.RealtimeConversationItemMessageAssistant - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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.RealtimeConversationItemMessageAssistant"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The assistant message after truncation, when the service returns the updated item.""" - - @overload - def __init__( - self, - *, - event_id: str, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED], - item_id: str, - content_index: int, - audio_end_ms: int, - item: Optional["_models.RealtimeConversationItemMessageAssistant"] = 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 VoiceAgentServerEventError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``error`` server event. - - :ivar event_id: The unique identifier of the event. Required. - :vartype event_id: str - :ivar type: Required. Default value is "error". - :vartype type: str - :ivar error: Details of the error. Required. - :vartype error: ~azure.ai.voiceagents.models.VoiceAgentServerEventErrorDetails - """ - - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the event. Required.""" - type: Literal["error"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"error\".""" - error: "_models.VoiceAgentServerEventErrorDetails" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Details of the error. Required.""" - - @overload - def __init__( - self, - *, - event_id: str, - error: "_models.VoiceAgentServerEventErrorDetails", - ) -> 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["error"] = "error" - - -class VoiceAgentServerEventErrorDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Details of a voice-agent WebSocket error. - - :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 tool_label: The configured label of a tool that could not be resolved. - :vartype tool_label: str - :ivar tool_type: The configured type of a tool that could not be resolved. - :vartype tool_type: 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"]) - tool_label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The configured label of a tool that could not be resolved.""" - tool_type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The configured type of a tool that could not be resolved.""" - - @overload - def __init__( - self, - *, - type: str, - message: str, - code: Optional[str] = None, - param: Optional[str] = None, - event_id: Optional[str] = None, - tool_label: Optional[str] = None, - tool_type: 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 VoiceAgentServerEventFileSearchCallCompleted( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.file_search_call.completed`` server event. - - :ivar type: Required. Default value is "response.file_search_call.completed". - :vartype type: str - :ivar event_id: - :vartype event_id: str - :ivar response_id: - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar sequence_number: Required. - :vartype sequence_number: int - """ - - type: Literal["response.file_search_call.completed"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Default value is \"response.file_search_call.completed\".""" - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - item_id: str, - output_index: int, - sequence_number: int, - event_id: Optional[str] = None, - 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["response.file_search_call.completed"] = "response.file_search_call.completed" - - -class VoiceAgentServerEventFileSearchCallInProgress( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.file_search_call.in_progress`` server event. - - :ivar type: Required. Default value is "response.file_search_call.in_progress". - :vartype type: str - :ivar event_id: - :vartype event_id: str - :ivar response_id: - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar sequence_number: Required. - :vartype sequence_number: int - """ - - type: Literal["response.file_search_call.in_progress"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Default value is \"response.file_search_call.in_progress\".""" - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - item_id: str, - output_index: int, - sequence_number: int, - event_id: Optional[str] = None, - 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["response.file_search_call.in_progress"] = "response.file_search_call.in_progress" - - -class VoiceAgentServerEventFileSearchCallSearching( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.file_search_call.searching`` server event. - - :ivar type: Required. Default value is "response.file_search_call.searching". - :vartype type: str - :ivar event_id: - :vartype event_id: str - :ivar response_id: - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar sequence_number: Required. - :vartype sequence_number: int - """ - - type: Literal["response.file_search_call.searching"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Default value is \"response.file_search_call.searching\".""" - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - item_id: str, - output_index: int, - sequence_number: int, - event_id: Optional[str] = None, - 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["response.file_search_call.searching"] = "response.file_search_call.searching" - - -class VoiceAgentServerEventInputAudioBufferCleared( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``input_audio_buffer.cleared`` server event. - - :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.voiceagents.models.INPUT_AUDIO_BUFFER_CLEARED - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The event type, must be ``input_audio_buffer.cleared``. Required. INPUT_AUDIO_BUFFER_CLEARED.""" - - @overload - def __init__( - self, - *, - event_id: str, - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED], - ) -> 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 VoiceAgentServerEventInputAudioBufferCommitted( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``input_audio_buffer.committed`` server event. - - :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.voiceagents.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 - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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, - *, - event_id: str, - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED], - item_id: str, - previous_item_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 VoiceAgentServerEventInputAudioBufferSpeechStarted( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``input_audio_buffer.speech_started`` server event. - - :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.voiceagents.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 - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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, - *, - event_id: str, - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED], - audio_start_ms: int, - item_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 VoiceAgentServerEventInputAudioBufferSpeechStopped( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``input_audio_buffer.speech_stopped`` server event. - - :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.voiceagents.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 - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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, - *, - event_id: str, - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED], - audio_end_ms: int, - item_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 VoiceAgentServerEventInputAudioBufferTimeoutTriggered( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``input_audio_buffer.timeout_triggered`` server event. - - :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.voiceagents.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 - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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, - *, - event_id: str, - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED], - audio_start_ms: int, - audio_end_ms: int, - item_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 VoiceAgentServerEventMcpListToolsCompleted( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``mcp_list_tools.completed`` server event. - - :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.voiceagents.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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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, - *, - event_id: str, - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED], - item_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 VoiceAgentServerEventMcpListToolsFailed(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``mcp_list_tools.failed`` server event. - - :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.voiceagents.models.MCP_LIST_TOOLS_FAILED - :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_FAILED] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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, - *, - event_id: str, - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED], - item_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 VoiceAgentServerEventMcpListToolsInProgress( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``mcp_list_tools.in_progress`` server event. - - :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.voiceagents.models.MCP_LIST_TOOLS_IN_PROGRESS - :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_IN_PROGRESS] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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, - *, - event_id: str, - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS], - item_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 VoiceAgentServerEventOutputAudioBufferCleared( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``output_audio_buffer.cleared`` server event. - - :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.voiceagents.models.OUTPUT_AUDIO_BUFFER_CLEARED - :ivar response_id: The unique ID of the response that produced the audio. Required. - :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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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, - *, - event_id: str, - type: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED], - response_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 VoiceAgentServerEventRateLimitsUpdated(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``rate_limits.updated`` server event. - - :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.voiceagents.models.RATE_LIMITS_UPDATED - :ivar rate_limits: List of rate limit information. Required. - :vartype rate_limits: - list[~azure.ai.voiceagents.models.RealtimeServerEventRateLimitsUpdatedRateLimits] - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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.""" - - @overload - def __init__( - self, - *, - event_id: str, - type: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED], - rate_limits: list["_models.RealtimeServerEventRateLimitsUpdatedRateLimits"], - ) -> 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 VoiceAgentServerEventResponseAnimationBlendshapesDelta( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.animation_blendshapes.delta`` server event. - - :ivar type: Required. Default value is "response.animation_blendshapes.delta". - :vartype type: str - :ivar event_id: Required. - :vartype event_id: str - :ivar response_id: Required. - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar content_index: Required. - :vartype content_index: int - :ivar frames: Animation frames as numeric blendshape weights or a compact encoded string. - Required. Is either a [[float]] type or a str type. - :vartype frames: list[list[float]] or str - :ivar frame_index: The index of the first frame in this delta. Required. - :vartype frame_index: int - """ - - type: Literal["response.animation_blendshapes.delta"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Default value is \"response.animation_blendshapes.delta\".""" - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - frames: Union[list[list[float]], str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Animation frames as numeric blendshape weights or a compact encoded string. Required. Is either - a [[float]] type or a str type.""" - frame_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the first frame in this delta. Required.""" - - @overload - def __init__( - self, - *, - event_id: str, - response_id: str, - item_id: str, - output_index: int, - content_index: int, - frames: Union[list[list[float]], str], - frame_index: 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: Literal["response.animation_blendshapes.delta"] = "response.animation_blendshapes.delta" - - -class VoiceAgentServerEventResponseAnimationBlendshapesDone( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.animation_blendshapes.done`` server event. - - :ivar type: Required. Default value is "response.animation_blendshapes.done". - :vartype type: str - :ivar event_id: Required. - :vartype event_id: str - :ivar response_id: Required. - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - """ - - type: Literal["response.animation_blendshapes.done"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Default value is \"response.animation_blendshapes.done\".""" - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - output_index: int = 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, - ) -> 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["response.animation_blendshapes.done"] = "response.animation_blendshapes.done" - - -class VoiceAgentServerEventResponseAnimationVisemeDelta( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.animation_viseme.delta`` server event. - - :ivar type: Required. Default value is "response.animation_viseme.delta". - :vartype type: str - :ivar event_id: Required. - :vartype event_id: str - :ivar response_id: Required. - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar content_index: Required. - :vartype content_index: int - :ivar audio_offset_ms: Required. - :vartype audio_offset_ms: int - :ivar viseme_id: Required. - :vartype viseme_id: int - """ - - type: Literal["response.animation_viseme.delta"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Default value is \"response.animation_viseme.delta\".""" - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - audio_offset_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - viseme_id: int = 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, - audio_offset_ms: int, - viseme_id: 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: Literal["response.animation_viseme.delta"] = "response.animation_viseme.delta" - - -class VoiceAgentServerEventResponseAnimationVisemeDone( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.animation_viseme.done`` server event. - - :ivar type: Required. Default value is "response.animation_viseme.done". - :vartype type: str - :ivar event_id: Required. - :vartype event_id: str - :ivar response_id: Required. - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar content_index: Required. - :vartype content_index: int - """ - - type: Literal["response.animation_viseme.done"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Default value is \"response.animation_viseme.done\".""" - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - content_index: int = 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, - ) -> 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["response.animation_viseme.done"] = "response.animation_viseme.done" - - -class VoiceAgentServerEventResponseAudioDelta(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``response.output_audio.delta`` server event. - - :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.voiceagents.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 - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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, - *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA], - response_id: str, - item_id: str, - output_index: int, - content_index: int, - delta: bytes, - ) -> 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 VoiceAgentServerEventResponseAudioDone(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``response.output_audio.done`` server event. - - :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.voiceagents.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 - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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, - *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE], - response_id: str, - item_id: str, - output_index: int, - content_index: 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 VoiceAgentServerEventResponseAudioTimestampDelta( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.audio_timestamp.delta`` server event. - - :ivar type: Required. Default value is "response.audio_timestamp.delta". - :vartype type: str - :ivar event_id: Required. - :vartype event_id: str - :ivar response_id: Required. - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar content_index: Required. - :vartype content_index: int - :ivar audio_offset_ms: Required. - :vartype audio_offset_ms: int - :ivar audio_duration_ms: Required. - :vartype audio_duration_ms: int - :ivar text: Required. - :vartype text: str - :ivar timestamp_type: Required. Default value is "word". - :vartype timestamp_type: str - """ - - type: Literal["response.audio_timestamp.delta"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Default value is \"response.audio_timestamp.delta\".""" - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - audio_offset_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - audio_duration_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - timestamp_type: Literal["word"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"word\".""" - - @overload - def __init__( - self, - *, - event_id: str, - response_id: str, - item_id: str, - output_index: int, - content_index: int, - audio_offset_ms: int, - audio_duration_ms: int, - 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["response.audio_timestamp.delta"] = "response.audio_timestamp.delta" - self.timestamp_type: Literal["word"] = "word" - - -class VoiceAgentServerEventResponseAudioTimestampDone( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.audio_timestamp.done`` server event. - - :ivar type: Required. Default value is "response.audio_timestamp.done". - :vartype type: str - :ivar event_id: Required. - :vartype event_id: str - :ivar response_id: Required. - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar content_index: Required. - :vartype content_index: int - """ - - type: Literal["response.audio_timestamp.done"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Default value is \"response.audio_timestamp.done\".""" - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - content_index: int = 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, - ) -> 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["response.audio_timestamp.done"] = "response.audio_timestamp.done" - - -class VoiceAgentServerEventResponseAudioTranscriptDelta( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.output_audio_transcript.delta`` server event. - - :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.voiceagents.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 - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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, - *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA], - response_id: str, - item_id: str, - output_index: int, - content_index: int, - delta: 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 VoiceAgentServerEventResponseAudioTranscriptDone( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.output_audio_transcript.done`` server event. - - :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.voiceagents.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 - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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, - *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE], - response_id: str, - item_id: str, - output_index: int, - content_index: int, - transcript: 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 VoiceAgentServerEventResponseContentPartDone( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.content_part.done`` server event. - - :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.voiceagents.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 finished streaming. Required. Is either a - VoiceAgentResponseEventTextContentPart type or a VoiceAgentResponseEventAudioContentPart type. - :vartype part: ~azure.ai.voiceagents.models.VoiceAgentResponseEventTextContentPart or - ~azure.ai.voiceagents.models.VoiceAgentResponseEventAudioContentPart - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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: "_unions.VoiceAgentResponseEventContentPart" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The content part that finished streaming. Required. Is either a - VoiceAgentResponseEventTextContentPart type or a VoiceAgentResponseEventAudioContentPart type.""" - - @overload - def __init__( - self, - *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE], - response_id: str, - item_id: str, - output_index: int, - content_index: int, - part: "_unions.VoiceAgentResponseEventContentPart", - ) -> 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 VoiceAgentServerEventResponseCreated(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``response.created`` server event. - - :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.voiceagents.models.RESPONSE_CREATED - :ivar response: The created voice-agent response. Required. - :vartype response: ~azure.ai.voiceagents.models.VoiceAgentRealtimeResponse - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The event type, must be ``response.created``. Required. RESPONSE_CREATED.""" - response: "_models.VoiceAgentRealtimeResponse" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The created voice-agent response. Required.""" - - @overload - def __init__( - self, - *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_CREATED], - response: "_models.VoiceAgentRealtimeResponse", - ) -> 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 VoiceAgentServerEventResponseDone(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``response.done`` server event. - - :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.voiceagents.models.RESPONSE_DONE - :ivar response: The completed voice-agent response. Required. - :vartype response: ~azure.ai.voiceagents.models.VoiceAgentRealtimeResponse - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The event type, must be ``response.done``. Required. RESPONSE_DONE.""" - response: "_models.VoiceAgentRealtimeResponse" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The completed voice-agent response. Required.""" - - @overload - def __init__( - self, - *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_DONE], - response: "_models.VoiceAgentRealtimeResponse", - ) -> 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 VoiceAgentServerEventResponseFunctionCallArgumentsDelta( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.function_call_arguments.delta`` server event. - - :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.voiceagents.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 - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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, - *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA], - response_id: str, - item_id: str, - output_index: int, - call_id: str, - delta: 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 VoiceAgentServerEventResponseFunctionCallArgumentsDone( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.function_call_arguments.done`` server event. - - :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.voiceagents.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 - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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, - *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE], - response_id: str, - item_id: str, - output_index: int, - call_id: str, - name: str, - arguments: 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 VoiceAgentServerEventResponseMcpCallArgumentsDelta( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.mcp_call_arguments.delta`` server event. - - :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.voiceagents.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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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, - *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA], - 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) - - -class VoiceAgentServerEventResponseMcpCallArgumentsDone( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.mcp_call_arguments.done`` server event. - - :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.voiceagents.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 - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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, - *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE], - response_id: str, - item_id: str, - output_index: int, - arguments: 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 VoiceAgentServerEventResponseMcpCallCompleted( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.mcp_call.completed`` server event. - - :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.voiceagents.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 - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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, - *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED], - output_index: int, - item_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 VoiceAgentServerEventResponseMcpCallFailed( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.mcp_call.failed`` server event. - - :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.voiceagents.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 - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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, - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED], - output_index: int, - item_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 VoiceAgentServerEventResponseMcpCallInProgress( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.mcp_call.in_progress`` server event. - - :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.voiceagents.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 - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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, - *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS], - output_index: int, - item_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 VoiceAgentServerEventResponseOutputItemAdded( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.output_item.added`` server event. - - :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.voiceagents.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: The output item that was added. Required. Is one of the following types: - "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, - VoiceAgentFileSearchCallItem - :vartype item: ~azure.ai.voiceagents.models.RealtimeConversationItemMessageSystem or - ~azure.ai.voiceagents.models.RealtimeConversationItemMessageUser or - ~azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistant or - ~azure.ai.voiceagents.models.VoiceFunctionCallItem or - ~azure.ai.voiceagents.models.VoiceFunctionCallOutputItem or - ~azure.ai.voiceagents.models.VoiceMcpListToolsItem or - ~azure.ai.voiceagents.models.VoiceMcpCallItem or - ~azure.ai.voiceagents.models.VoiceMcpApprovalRequestItem or - ~azure.ai.voiceagents.models.VoiceMcpApprovalResponseItem or - ~azure.ai.voiceagents.models.VoiceAgentWorkflowActionItem or - ~azure.ai.voiceagents.models.VoiceAgentWebSearchCallItem or - ~azure.ai.voiceagents.models.VoiceAgentFileSearchCallItem - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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: "_unions.VoiceAgentResponseItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The output item that was added. Required. Is one of the following types: - \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, - VoiceAgentFileSearchCallItem""" - - @overload - def __init__( - self, - *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED], - response_id: str, - output_index: int, - item: "_unions.VoiceAgentResponseItem", - ) -> 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 VoiceAgentServerEventResponseOutputItemDone( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.output_item.done`` server event. - - :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.voiceagents.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: The output item that finished streaming. Required. Is one of the following types: - "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, - VoiceAgentFileSearchCallItem - :vartype item: ~azure.ai.voiceagents.models.RealtimeConversationItemMessageSystem or - ~azure.ai.voiceagents.models.RealtimeConversationItemMessageUser or - ~azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistant or - ~azure.ai.voiceagents.models.VoiceFunctionCallItem or - ~azure.ai.voiceagents.models.VoiceFunctionCallOutputItem or - ~azure.ai.voiceagents.models.VoiceMcpListToolsItem or - ~azure.ai.voiceagents.models.VoiceMcpCallItem or - ~azure.ai.voiceagents.models.VoiceMcpApprovalRequestItem or - ~azure.ai.voiceagents.models.VoiceMcpApprovalResponseItem or - ~azure.ai.voiceagents.models.VoiceAgentWorkflowActionItem or - ~azure.ai.voiceagents.models.VoiceAgentWebSearchCallItem or - ~azure.ai.voiceagents.models.VoiceAgentFileSearchCallItem - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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: "_unions.VoiceAgentResponseItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The output item that finished streaming. Required. Is one of the following types: - \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, - VoiceAgentFileSearchCallItem""" - - @overload - def __init__( - self, - *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE], - response_id: str, - output_index: int, - item: "_unions.VoiceAgentResponseItem", - ) -> 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 VoiceAgentServerEventResponseTextDelta(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``response.output_text.delta`` server event. - - :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.voiceagents.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 - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA], - response_id: str, - item_id: str, - output_index: int, - content_index: int, - delta: 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 VoiceAgentServerEventResponseTextDone(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``response.output_text.done`` server event. - - :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.voiceagents.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 - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE], - response_id: str, - item_id: str, - output_index: int, - content_index: int, - 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) - - -class VoiceAgentServerEventResponseVideoDelta(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``response.video.delta`` server event. - - :ivar type: Required. Default value is "response.video.delta". - :vartype type: str - :ivar event_id: Required. - :vartype event_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar codec: Required. - :vartype codec: str - :ivar delta: The base64-encoded video frame data. Required. - :vartype delta: str - """ - - type: Literal["response.video.delta"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"response.video.delta\".""" - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - codec: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The base64-encoded video frame data. Required.""" - - @overload - def __init__( - self, - *, - event_id: str, - output_index: int, - codec: str, - delta: 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["response.video.delta"] = "response.video.delta" - - -class VoiceAgentServerEventSessionAvatarConnecting( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``session.avatar.connecting`` server event. - - :ivar type: Required. Default value is "session.avatar.connecting". - :vartype type: str - :ivar event_id: Required. - :vartype event_id: str - :ivar server_sdp: The server's SDP answer for avatar media negotiation. Required. - :vartype server_sdp: str - """ - - type: Literal["session.avatar.connecting"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"session.avatar.connecting\".""" - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - server_sdp: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The server's SDP answer for avatar media negotiation. Required.""" - - @overload - def __init__( - self, - *, - event_id: str, - server_sdp: 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["session.avatar.connecting"] = "session.avatar.connecting" - - -class VoiceAgentServerEventSessionAvatarSwitchToIdle( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``session.avatar.switch_to_idle`` server event. - - :ivar type: Required. Default value is "session.avatar.switch_to_idle". - :vartype type: str - :ivar event_id: Required. - :vartype event_id: str - :ivar turn_id: - :vartype turn_id: str - """ - - type: Literal["session.avatar.switch_to_idle"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Default value is \"session.avatar.switch_to_idle\".""" - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - turn_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - event_id: str, - turn_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["session.avatar.switch_to_idle"] = "session.avatar.switch_to_idle" - - -class VoiceAgentServerEventSessionAvatarSwitchToSpeaking( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``session.avatar.switch_to_speaking`` server event. - - :ivar type: Required. Default value is "session.avatar.switch_to_speaking". - :vartype type: str - :ivar event_id: Required. - :vartype event_id: str - :ivar turn_id: - :vartype turn_id: str - """ - - type: Literal["session.avatar.switch_to_speaking"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Default value is \"session.avatar.switch_to_speaking\".""" - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - turn_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - event_id: str, - turn_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["session.avatar.switch_to_speaking"] = "session.avatar.switch_to_speaking" - - -class VoiceAgentServerEventSessionCreated(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``session.created`` server event. - - :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.voiceagents.models.SESSION_CREATED - :ivar session: The initial effective voice-agent session configuration. Required. - :vartype session: ~azure.ai.voiceagents.models.VoiceAgentSessionResponseConfig - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The event type, must be ``session.created``. Required. SESSION_CREATED.""" - session: "_models.VoiceAgentSessionResponseConfig" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The initial effective voice-agent session configuration. Required.""" - - @overload - def __init__( - self, - *, - event_id: str, - type: Literal[RealtimeServerEventType.SESSION_CREATED], - session: "_models.VoiceAgentSessionResponseConfig", - ) -> 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 VoiceAgentServerEventSessionHandoffAborted( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``session.handoff.aborted`` server event. - - :ivar type: Required. Default value is "session.handoff.aborted". - :vartype type: str - :ivar event_id: Required. - :vartype event_id: str - :ivar handoff_id: Required. - :vartype handoff_id: str - :ivar edge_id: Required. - :vartype edge_id: str - :ivar from_node_id: Required. - :vartype from_node_id: str - :ivar to_node_id: Required. - :vartype to_node_id: str - :ivar from_model: Required. - :vartype from_model: str - :ivar to_model: Required. - :vartype to_model: str - :ivar tool_call_id: Required. - :vartype tool_call_id: str - :ivar node_generation: Required. - :vartype node_generation: int - :ivar reason: The reason the handoff was aborted. Required. Known values are: - "user_interruption" and "error". - :vartype reason: str or ~azure.ai.voiceagents.models.VoiceAgentHandoffAbortReason - :ivar error: The error that aborted the handoff, when ``reason`` is ``error``. - :vartype error: ~azure.ai.voiceagents.models.VoiceAgentServerEventErrorDetails - """ - - type: Literal["session.handoff.aborted"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"session.handoff.aborted\".""" - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - handoff_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - edge_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - from_node_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - to_node_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - from_model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - to_model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - tool_call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - node_generation: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - reason: Union[str, "_models.VoiceAgentHandoffAbortReason"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The reason the handoff was aborted. Required. Known values are: \"user_interruption\" and - \"error\".""" - error: Optional["_models.VoiceAgentServerEventErrorDetails"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The error that aborted the handoff, when ``reason`` is ``error``.""" - - @overload - def __init__( - self, - *, - event_id: str, - handoff_id: str, - edge_id: str, - from_node_id: str, - to_node_id: str, - from_model: str, - to_model: str, - tool_call_id: str, - node_generation: int, - reason: Union[str, "_models.VoiceAgentHandoffAbortReason"], - error: Optional["_models.VoiceAgentServerEventErrorDetails"] = 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["session.handoff.aborted"] = "session.handoff.aborted" - - -class VoiceAgentServerEventSessionHandoffCompleted( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``session.handoff.completed`` server event. - - :ivar type: Required. Default value is "session.handoff.completed". - :vartype type: str - :ivar event_id: Required. - :vartype event_id: str - :ivar handoff_id: Required. - :vartype handoff_id: str - :ivar edge_id: Required. - :vartype edge_id: str - :ivar from_node_id: Required. - :vartype from_node_id: str - :ivar to_node_id: Required. - :vartype to_node_id: str - :ivar from_model: Required. - :vartype from_model: str - :ivar to_model: Required. - :vartype to_model: str - :ivar tool_call_id: Required. - :vartype tool_call_id: str - :ivar node_generation: Required. - :vartype node_generation: int - :ivar prepare_duration_ms: The time spent preparing the target behavior, in milliseconds. - Required. - :vartype prepare_duration_ms: int - :ivar duration_ms: The total duration of the handoff, in milliseconds. Required. - :vartype duration_ms: int - """ - - type: Literal["session.handoff.completed"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"session.handoff.completed\".""" - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - handoff_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - edge_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - from_node_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - to_node_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - from_model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - to_model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - tool_call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - node_generation: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - prepare_duration_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The time spent preparing the target behavior, in milliseconds. Required.""" - duration_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The total duration of the handoff, in milliseconds. Required.""" - - @overload - def __init__( - self, - *, - event_id: str, - handoff_id: str, - edge_id: str, - from_node_id: str, - to_node_id: str, - from_model: str, - to_model: str, - tool_call_id: str, - node_generation: int, - prepare_duration_ms: int, - duration_ms: 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: Literal["session.handoff.completed"] = "session.handoff.completed" - - -class VoiceAgentServerEventSessionHandoffStarted( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``session.handoff.started`` server event. - - :ivar type: Required. Default value is "session.handoff.started". - :vartype type: str - :ivar event_id: Required. - :vartype event_id: str - :ivar handoff_id: Required. - :vartype handoff_id: str - :ivar edge_id: Required. - :vartype edge_id: str - :ivar from_node_id: Required. - :vartype from_node_id: str - :ivar to_node_id: Required. - :vartype to_node_id: str - :ivar from_model: Required. - :vartype from_model: str - :ivar to_model: Required. - :vartype to_model: str - :ivar tool_call_id: Required. - :vartype tool_call_id: str - :ivar node_generation: Required. - :vartype node_generation: int - """ - - type: Literal["session.handoff.started"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"session.handoff.started\".""" - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - handoff_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - edge_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - from_node_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - to_node_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - from_model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - to_model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - tool_call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - node_generation: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - event_id: str, - handoff_id: str, - edge_id: str, - from_node_id: str, - to_node_id: str, - from_model: str, - to_model: str, - tool_call_id: str, - node_generation: 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: Literal["session.handoff.started"] = "session.handoff.started" - - -class VoiceAgentServerEventSessionUpdated(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``session.updated`` server event. - - :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.voiceagents.models.SESSION_UPDATED - :ivar session: The effective voice-agent session configuration after the update. Required. - :vartype session: ~azure.ai.voiceagents.models.VoiceAgentSessionResponseConfig - """ - - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The event type, must be ``session.updated``. Required. SESSION_UPDATED.""" - session: "_models.VoiceAgentSessionResponseConfig" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The effective voice-agent session configuration after the update. Required.""" - - @overload - def __init__( - self, - *, - event_id: str, - type: Literal[RealtimeServerEventType.SESSION_UPDATED], - session: "_models.VoiceAgentSessionResponseConfig", - ) -> 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 VoiceAgentServerEventWarning(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``warning`` server event. - - :ivar type: Required. Default value is "warning". - :vartype type: str - :ivar event_id: Required. - :vartype event_id: str - :ivar warning: Required. - :vartype warning: ~azure.ai.voiceagents.models.VoiceAgentServerEventWarningDetails - """ - - type: Literal["warning"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"warning\".""" - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - warning: "_models.VoiceAgentServerEventWarningDetails" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required.""" - - @overload - def __init__( - self, - *, - event_id: str, - warning: "_models.VoiceAgentServerEventWarningDetails", - ) -> 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["warning"] = "warning" - - -class VoiceAgentServerEventWarningDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Details of a non-fatal warning. - - :ivar message: Required. - :vartype message: str - :ivar code: - :vartype code: str - :ivar param: - :vartype param: str - """ - - message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - code: 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, - *, - message: str, - code: Optional[str] = None, - 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) - - -class VoiceAgentServerEventWebSearchCallCompleted( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.web_search_call.completed`` server event. - - :ivar type: Required. Default value is "response.web_search_call.completed". - :vartype type: str - :ivar event_id: - :vartype event_id: str - :ivar response_id: - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar sequence_number: Required. - :vartype sequence_number: int - """ - - type: Literal["response.web_search_call.completed"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Default value is \"response.web_search_call.completed\".""" - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - item_id: str, - output_index: int, - sequence_number: int, - event_id: Optional[str] = None, - 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["response.web_search_call.completed"] = "response.web_search_call.completed" - - -class VoiceAgentServerEventWebSearchCallInProgress( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.web_search_call.in_progress`` server event. - - :ivar type: Required. Default value is "response.web_search_call.in_progress". - :vartype type: str - :ivar event_id: - :vartype event_id: str - :ivar response_id: - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar sequence_number: Required. - :vartype sequence_number: int - """ - - type: Literal["response.web_search_call.in_progress"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Default value is \"response.web_search_call.in_progress\".""" - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - item_id: str, - output_index: int, - sequence_number: int, - event_id: Optional[str] = None, - 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["response.web_search_call.in_progress"] = "response.web_search_call.in_progress" - - -class VoiceAgentServerEventWebSearchCallSearching( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.web_search_call.searching`` server event. - - :ivar type: Required. Default value is "response.web_search_call.searching". - :vartype type: str - :ivar event_id: - :vartype event_id: str - :ivar response_id: - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar sequence_number: Required. - :vartype sequence_number: int - """ - - type: Literal["response.web_search_call.searching"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Default value is \"response.web_search_call.searching\".""" - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - item_id: str, - output_index: int, - sequence_number: int, - event_id: Optional[str] = None, - 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["response.web_search_call.searching"] = "response.web_search_call.searching" - - -class VoiceAgentServerVadTurnDetection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Server VAD turn-detection settings. - - :ivar create_response: - :vartype create_response: bool - :ivar interrupt_response: - :vartype interrupt_response: bool - :ivar idle_timeout_ms: - :vartype idle_timeout_ms: int - :ivar type: Required. Server-side voice activity detection. - :vartype type: str or ~azure.ai.voiceagents.models.SERVER_VAD - :ivar threshold: - :vartype threshold: float - :ivar prefix_padding_ms: - :vartype prefix_padding_ms: int - :ivar silence_duration_ms: - :vartype silence_duration_ms: int - :ivar speech_duration_ms: - :vartype speech_duration_ms: int - :ivar end_of_utterance_detection: - :vartype end_of_utterance_detection: - ~azure.ai.voiceagents.models.VoiceAgentEndOfUtteranceDetection - :ivar auto_truncate: - :vartype auto_truncate: bool - """ - - create_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - interrupt_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - idle_timeout_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - type: Literal[VoiceTurnDetectionType.SERVER_VAD] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Server-side voice activity detection.""" - threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - prefix_padding_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - silence_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - speech_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - auto_truncate: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - type: Literal[VoiceTurnDetectionType.SERVER_VAD], - create_response: Optional[bool] = None, - interrupt_response: Optional[bool] = None, - idle_timeout_ms: Optional[int] = None, - threshold: Optional[float] = None, - prefix_padding_ms: Optional[int] = None, - silence_duration_ms: Optional[int] = None, - speech_duration_ms: Optional[int] = None, - end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = None, - auto_truncate: 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 VoiceAgentSessionAvatarConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Avatar settings accepted by the stable voice-agent WebSocket contract. - - :ivar type: Known values are: "video_avatar" and "photo_avatar". - :vartype type: str or ~azure.ai.voiceagents.models.VoiceAgentAvatarType - :ivar ice_servers: - :vartype ice_servers: list[~azure.ai.voiceagents.models.VoiceAgentAvatarIceServer] - :ivar character: Required. - :vartype character: str - :ivar style: - :vartype style: str - :ivar customized: - :vartype customized: bool - :ivar model: - :vartype model: str - :ivar video: - :vartype video: ~azure.ai.voiceagents.models.VoiceAgentAvatarVideoParams - :ivar scene: - :vartype scene: ~azure.ai.voiceagents.models.VoiceAgentAvatarScene - :ivar output_protocol: Known values are: "websocket", "websocket-binary", and "webrtc". - :vartype output_protocol: str or ~azure.ai.voiceagents.models.VoiceAgentAvatarOutputProtocol - :ivar output_audit_audio: - :vartype output_audit_audio: bool - """ - - type: Optional[Union[str, "_models.VoiceAgentAvatarType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Known values are: \"video_avatar\" and \"photo_avatar\".""" - ice_servers: Optional[list["_models.VoiceAgentAvatarIceServer"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - character: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - style: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - customized: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - video: Optional["_models.VoiceAgentAvatarVideoParams"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - scene: Optional["_models.VoiceAgentAvatarScene"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - output_protocol: Optional[Union[str, "_models.VoiceAgentAvatarOutputProtocol"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Known values are: \"websocket\", \"websocket-binary\", and \"webrtc\".""" - output_audit_audio: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - character: str, - type: Optional[Union[str, "_models.VoiceAgentAvatarType"]] = None, - ice_servers: Optional[list["_models.VoiceAgentAvatarIceServer"]] = None, - style: Optional[str] = None, - customized: Optional[bool] = None, - model: Optional[str] = None, - video: Optional["_models.VoiceAgentAvatarVideoParams"] = None, - scene: Optional["_models.VoiceAgentAvatarScene"] = None, - output_protocol: Optional[Union[str, "_models.VoiceAgentAvatarOutputProtocol"]] = None, - output_audit_audio: 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 VoiceAgentSessionMcpTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A remote MCP server available to a voice-agent session. - - :ivar type: 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: Required. - :vartype server_url: str - :ivar authorization: Is either a str type or a VoiceAgentMcpAssignedManagedIdentity type. - :vartype authorization: str or - ~azure.ai.voiceagents.models.VoiceAgentMcpAssignedManagedIdentity - :ivar headers: - :vartype headers: dict[str, str] - :ivar allowed_tools: - :vartype allowed_tools: list[str] - :ivar require_approval: Is either a Union[str, "_models.VoiceAgentMcpApprovalMode"] type or a - {str: [str]} type. - :vartype require_approval: str or ~azure.ai.voiceagents.models.VoiceAgentMcpApprovalMode or - dict[str, list[str]] - :ivar response_scheduling: Known values are: "silent", "when_idle", "interrupt", and - "skip_if_busy". - :vartype response_scheduling: str or - ~azure.ai.voiceagents.models.VoiceAgentMcpResponseScheduling - """ - - 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"]) - """A label for this MCP server, used to identify it in tool calls. Required.""" - server_url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - authorization: Optional[Union[str, "_models.VoiceAgentMcpAssignedManagedIdentity"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Is either a str type or a VoiceAgentMcpAssignedManagedIdentity type.""" - headers: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - allowed_tools: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - require_approval: Optional["_unions.VoiceAgentMcpApprovalPolicy"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Is either a Union[str, \"_models.VoiceAgentMcpApprovalMode\"] type or a {str: [str]} type.""" - response_scheduling: Optional[Union[str, "_models.VoiceAgentMcpResponseScheduling"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Known values are: \"silent\", \"when_idle\", \"interrupt\", and \"skip_if_busy\".""" - - @overload - def __init__( - self, - *, - server_label: str, - server_url: str, - authorization: Optional[Union[str, "_models.VoiceAgentMcpAssignedManagedIdentity"]] = None, - headers: Optional[dict[str, str]] = None, - allowed_tools: Optional[list[str]] = None, - require_approval: Optional["_unions.VoiceAgentMcpApprovalPolicy"] = None, - response_scheduling: Optional[Union[str, "_models.VoiceAgentMcpResponseScheduling"]] = 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["mcp"] = "mcp" - - -class VoiceAgentSessionResponseAudio(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Input- and output-audio settings returned in a stable voice-agent session event. - - :ivar input: The effective input-audio settings. - :vartype input: ~azure.ai.voiceagents.models.VoiceAgentSessionResponseAudioInput - :ivar output: The output-audio settings for the session. - :vartype output: ~azure.ai.voiceagents.models.VoiceAgentSessionResponseAudioOutput - """ - - input: Optional["_models.VoiceAgentSessionResponseAudioInput"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The effective input-audio settings.""" - output: Optional["_models.VoiceAgentSessionResponseAudioOutput"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The output-audio settings for the session.""" - - @overload - def __init__( - self, - *, - input: Optional["_models.VoiceAgentSessionResponseAudioInput"] = None, - output: Optional["_models.VoiceAgentSessionResponseAudioOutput"] = 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 VoiceAgentSessionResponseAudioInput(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Input-audio settings returned in a stable voice-agent session event. - - :ivar noise_reduction: Input noise reduction. Set to null to disable. - :vartype noise_reduction: ~azure.ai.voiceagents.models.VoiceNoiseReduction - :ivar transcription: Asynchronous input-audio transcription. Set to null to disable - transcription. - :vartype transcription: ~azure.ai.voiceagents.models.VoiceInputTranscription - :ivar format: The structured input audio format. - :vartype format: ~azure.ai.voiceagents.models.VoiceAudioFormat - :ivar turn_detection: Turn-detection settings. Set to null to disable server-side turn - detection. Is one of the following types: VoiceAgentServerVadTurnDetection, - VoiceAgentSemanticVadTurnDetection, VoiceAgentAzureSemanticVadTurnDetection, - VoiceAgentAzureMultilingualSemanticVadTurnDetection - :vartype turn_detection: ~azure.ai.voiceagents.models.VoiceAgentServerVadTurnDetection or - ~azure.ai.voiceagents.models.VoiceAgentSemanticVadTurnDetection or - ~azure.ai.voiceagents.models.VoiceAgentAzureSemanticVadTurnDetection or - ~azure.ai.voiceagents.models.VoiceAgentAzureMultilingualSemanticVadTurnDetection - :ivar echo_cancellation: Optional server-side echo cancellation settings. - :vartype echo_cancellation: ~azure.ai.voiceagents.models.VoiceAgentEchoCancellation - """ - - noise_reduction: Optional["_models.VoiceNoiseReduction"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Input noise reduction. Set to null to disable.""" - transcription: Optional["_models.VoiceInputTranscription"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Asynchronous input-audio transcription. Set to null to disable transcription.""" - format: Optional["_models.VoiceAudioFormat"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The structured input audio format.""" - turn_detection: Optional["_unions.VoiceAgentTurnDetection"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Turn-detection settings. Set to null to disable server-side turn detection. Is one of the - following types: VoiceAgentServerVadTurnDetection, VoiceAgentSemanticVadTurnDetection, - VoiceAgentAzureSemanticVadTurnDetection, VoiceAgentAzureMultilingualSemanticVadTurnDetection""" - echo_cancellation: Optional["_models.VoiceAgentEchoCancellation"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Optional server-side echo cancellation settings.""" - - @overload - def __init__( - self, - *, - noise_reduction: Optional["_models.VoiceNoiseReduction"] = None, - transcription: Optional["_models.VoiceInputTranscription"] = None, - format: Optional["_models.VoiceAudioFormat"] = None, - turn_detection: Optional["_unions.VoiceAgentTurnDetection"] = None, - echo_cancellation: Optional["_models.VoiceAgentEchoCancellation"] = 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 VoiceAgentSessionResponseAudioOutput(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Output-audio settings returned in a stable voice-agent session event. - - :ivar format: The output audio format. - :vartype format: ~azure.ai.voiceagents.models.VoiceAudioFormat - :ivar voice: The typed voice configuration. Is one of the following types: OpenAIVoice, - AzureVoice, AzureRealtimeNativeVoice - :vartype voice: ~azure.ai.voiceagents.models.OpenAIVoice or - ~azure.ai.voiceagents.models.AzureVoice or - ~azure.ai.voiceagents.models.AzureRealtimeNativeVoice - :ivar output_audio_timestamp_types: Timestamp kinds to include with output audio. - :vartype output_audio_timestamp_types: list[str or - ~azure.ai.voiceagents.models.VoiceAudioTimestampType] - :ivar speed: The speaking-speed multiplier. - :vartype speed: float - """ - - format: Optional["_models.VoiceAudioFormat"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The output audio format.""" - voice: Optional["_unions.VoiceAgentVoice"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The typed voice configuration. Is one of the following types: OpenAIVoice, AzureVoice, - AzureRealtimeNativeVoice""" - output_audio_timestamp_types: Optional[list[Union[str, "_models.VoiceAudioTimestampType"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Timestamp kinds to include with output audio.""" - speed: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The speaking-speed multiplier.""" - - @overload - def __init__( - self, - *, - format: Optional["_models.VoiceAudioFormat"] = None, - voice: Optional["_unions.VoiceAgentVoice"] = None, - output_audio_timestamp_types: Optional[list[Union[str, "_models.VoiceAudioTimestampType"]]] = None, - speed: 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 VoiceAgentSessionResponseConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The effective stable realtime session settings returned by the voice-agent service. - - :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 avatar: The avatar settings for the session. - :vartype avatar: ~azure.ai.voiceagents.models.VoiceAgentSessionAvatarConfig - :ivar animation: Animation settings for the session. - :vartype animation: ~azure.ai.voiceagents.models.VoiceAgentAnimationConfig - :ivar tools: Tools available to the session. - :vartype tools: list[~azure.ai.voiceagents.models.RealtimeFunctionTool or - ~azure.ai.voiceagents.models.VoiceAgentSessionMcpTool or - ~azure.ai.voiceagents.models.VoiceToolboxTool or ~azure.ai.voiceagents.models.VoiceSystemTool] - :ivar tool_choice: Tool-selection behavior for the session. Is either a Union[str, - "_models.ToolChoiceOptions"] type or a RealtimeToolChoiceFunction type. - :vartype tool_choice: str or ~azure.ai.voiceagents.models.ToolChoiceOptions or - ~azure.ai.voiceagents.models.RealtimeToolChoiceFunction - :ivar reasoning: Reasoning settings for compatible realtime models. - :vartype reasoning: ~azure.ai.voiceagents.models.RealtimeReasoning - :ivar parallel_tool_calls: Whether the model may call multiple tools in parallel. - :vartype parallel_tool_calls: bool - :ivar voice_adaptation: Voice-optimized instruction adaptation settings. - :vartype voice_adaptation: ~azure.ai.voiceagents.models.VoiceAgentVoiceAdaptation - :ivar interim_response: Interim-response settings for latency and tool execution. Is either a - VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. - :vartype interim_response: ~azure.ai.voiceagents.models.VoiceAgentStaticInterimResponseConfig - or ~azure.ai.voiceagents.models.VoiceAgentLlmInterimResponseConfig - :ivar response_delimiter: A delimiter appended to generated responses. - :vartype response_delimiter: str - :ivar greeting: A proactive assistant greeting started after session configuration. - :vartype greeting: ~azure.ai.voiceagents.models.VoiceGreetingConfig - :ivar object: The object type. Always ``realtime.session``. Required. Default value is - "realtime.session". - :vartype object: str - :ivar id: The session identifier. Required. - :vartype id: str - :ivar model: The selected model. Required. - :vartype model: str - :ivar expires_at: The session expiration time as a Unix timestamp in seconds. - :vartype expires_at: ~datetime.datetime - :ivar output_modalities: The output modalities enabled for the session. Required. - :vartype output_modalities: list[str or ~azure.ai.voiceagents.models.VoiceOutputModality] - :ivar audio: The effective input- and output-audio settings for the session. - :vartype audio: ~azure.ai.voiceagents.models.VoiceAgentSessionResponseAudio - :ivar handoff: The effective handoff state. - :vartype handoff: ~azure.ai.voiceagents.models.VoiceAgentHandoffState - :ivar idle_timeout: The idle timeout reported by the service, in milliseconds. - :vartype idle_timeout: int - """ - - 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.""" - 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["_unions.VoiceAgentSessionTool"]] = 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 either a Union[str, \"_models.ToolChoiceOptions\"] - type or a RealtimeToolChoiceFunction type.""" - 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.""" - voice_adaptation: Optional["_models.VoiceAgentVoiceAdaptation"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Voice-optimized instruction adaptation settings.""" - interim_response: Optional["_unions.VoiceAgentInterimResponse"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Interim-response settings for latency and tool execution. Is either a - VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type.""" - response_delimiter: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A delimiter appended to generated responses.""" - greeting: Optional["_models.VoiceGreetingConfig"] = rest_field( - 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.""" - output_modalities: list[Union[str, "_models.VoiceOutputModality"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The output modalities enabled for the session. Required.""" - audio: Optional["_models.VoiceAgentSessionResponseAudio"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The effective input- and output-audio settings for the session.""" - handoff: Optional["_models.VoiceAgentHandoffState"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The effective handoff state.""" - idle_timeout: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The idle timeout reported by the service, in milliseconds.""" - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - model: str, - output_modalities: list[Union[str, "_models.VoiceOutputModality"]], - instructions: Optional[str] = None, - temperature: Optional[float] = None, - max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] = None, - avatar: Optional["_models.VoiceAgentSessionAvatarConfig"] = None, - animation: Optional["_models.VoiceAgentAnimationConfig"] = None, - tools: Optional[list["_unions.VoiceAgentSessionTool"]] = None, - tool_choice: Optional["_unions.VoiceAgentToolChoice"] = None, - reasoning: Optional["_models.RealtimeReasoning"] = None, - parallel_tool_calls: Optional[bool] = None, - voice_adaptation: Optional["_models.VoiceAgentVoiceAdaptation"] = None, - interim_response: Optional["_unions.VoiceAgentInterimResponse"] = None, - response_delimiter: Optional[str] = None, - greeting: Optional["_models.VoiceGreetingConfig"] = None, - expires_at: Optional[datetime.datetime] = None, - audio: Optional["_models.VoiceAgentSessionResponseAudio"] = None, - handoff: Optional["_models.VoiceAgentHandoffState"] = None, - idle_timeout: 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: Literal["realtime"] = "realtime" - self.object: Literal["realtime.session"] = "realtime.session" - - -class VoiceAgentSessionUpdateAudio(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Input- and output-audio settings accepted in a ``session.update`` client event. - - :ivar input: The input-audio settings for the session. - :vartype input: ~azure.ai.voiceagents.models.VoiceAgentSessionUpdateAudioInput - :ivar output: The output-audio settings for the session. - :vartype output: ~azure.ai.voiceagents.models.VoiceAgentSessionUpdateAudioOutput - """ - - input: Optional["_models.VoiceAgentSessionUpdateAudioInput"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The input-audio settings for the session.""" - output: Optional["_models.VoiceAgentSessionUpdateAudioOutput"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The output-audio settings for the session.""" - - @overload - def __init__( - self, - *, - input: Optional["_models.VoiceAgentSessionUpdateAudioInput"] = None, - output: Optional["_models.VoiceAgentSessionUpdateAudioOutput"] = 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 VoiceAgentSessionUpdateAudioInput(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Input-audio settings accepted in a stable voice-agent session. - - :ivar noise_reduction: Input noise reduction. Set to null to disable. - :vartype noise_reduction: ~azure.ai.voiceagents.models.VoiceNoiseReduction - :ivar transcription: Asynchronous input-audio transcription. Set to null to disable - transcription. - :vartype transcription: ~azure.ai.voiceagents.models.VoiceInputTranscription - :ivar format: The structured input audio format. - :vartype format: ~azure.ai.voiceagents.models.VoiceAudioFormat - :ivar turn_detection: Turn-detection settings. Set to null to disable server-side turn - detection. Is one of the following types: VoiceAgentServerVadTurnDetection, - VoiceAgentSemanticVadTurnDetection, VoiceAgentAzureSemanticVadTurnDetection, - VoiceAgentAzureMultilingualSemanticVadTurnDetection - :vartype turn_detection: ~azure.ai.voiceagents.models.VoiceAgentServerVadTurnDetection or - ~azure.ai.voiceagents.models.VoiceAgentSemanticVadTurnDetection or - ~azure.ai.voiceagents.models.VoiceAgentAzureSemanticVadTurnDetection or - ~azure.ai.voiceagents.models.VoiceAgentAzureMultilingualSemanticVadTurnDetection - :ivar echo_cancellation: Optional server-side echo cancellation settings. - :vartype echo_cancellation: ~azure.ai.voiceagents.models.VoiceAgentEchoCancellation - """ - - noise_reduction: Optional["_models.VoiceNoiseReduction"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Input noise reduction. Set to null to disable.""" - transcription: Optional["_models.VoiceInputTranscription"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Asynchronous input-audio transcription. Set to null to disable transcription.""" - format: Optional["_models.VoiceAudioFormat"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The structured input audio format.""" - turn_detection: Optional["_unions.VoiceAgentTurnDetection"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Turn-detection settings. Set to null to disable server-side turn detection. Is one of the - following types: VoiceAgentServerVadTurnDetection, VoiceAgentSemanticVadTurnDetection, - VoiceAgentAzureSemanticVadTurnDetection, VoiceAgentAzureMultilingualSemanticVadTurnDetection""" - echo_cancellation: Optional["_models.VoiceAgentEchoCancellation"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Optional server-side echo cancellation settings.""" - - @overload - def __init__( - self, - *, - noise_reduction: Optional["_models.VoiceNoiseReduction"] = None, - transcription: Optional["_models.VoiceInputTranscription"] = None, - format: Optional["_models.VoiceAudioFormat"] = None, - turn_detection: Optional["_unions.VoiceAgentTurnDetection"] = None, - echo_cancellation: Optional["_models.VoiceAgentEchoCancellation"] = 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 VoiceAgentSessionUpdateAudioOutput(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Output-audio settings accepted in a stable voice-agent session. - - :ivar format: The output audio format. - :vartype format: ~azure.ai.voiceagents.models.VoiceAudioFormat - :ivar voice: The typed voice configuration. Is one of the following types: OpenAIVoice, - AzureVoice, AzureRealtimeNativeVoice - :vartype voice: ~azure.ai.voiceagents.models.OpenAIVoice or - ~azure.ai.voiceagents.models.AzureVoice or - ~azure.ai.voiceagents.models.AzureRealtimeNativeVoice - :ivar output_audio_timestamp_types: Timestamp kinds to include with output audio. - :vartype output_audio_timestamp_types: list[str or - ~azure.ai.voiceagents.models.VoiceAudioTimestampType] - :ivar speed: The speaking-speed multiplier. - :vartype speed: float - """ - - format: Optional["_models.VoiceAudioFormat"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The output audio format.""" - voice: Optional["_unions.VoiceAgentVoice"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The typed voice configuration. Is one of the following types: OpenAIVoice, AzureVoice, - AzureRealtimeNativeVoice""" - output_audio_timestamp_types: Optional[list[Union[str, "_models.VoiceAudioTimestampType"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Timestamp kinds to include with output audio.""" - speed: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The speaking-speed multiplier.""" - - @overload - def __init__( - self, - *, - format: Optional["_models.VoiceAudioFormat"] = None, - voice: Optional["_unions.VoiceAgentVoice"] = None, - output_audio_timestamp_types: Optional[list[Union[str, "_models.VoiceAudioTimestampType"]]] = None, - speed: 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 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.voiceagents.models.VoiceOutputModality] - :ivar audio: The input- and output-audio settings for the session. - :vartype audio: ~azure.ai.voiceagents.models.VoiceAgentSessionUpdateAudio - :ivar avatar: The avatar settings for the session. - :vartype avatar: ~azure.ai.voiceagents.models.VoiceAgentSessionAvatarConfig - :ivar animation: Animation settings for the session. - :vartype animation: ~azure.ai.voiceagents.models.VoiceAgentAnimationConfig - :ivar tools: Tools available to the session. - :vartype tools: list[~azure.ai.voiceagents.models.RealtimeFunctionTool or - ~azure.ai.voiceagents.models.VoiceAgentSessionMcpTool or - ~azure.ai.voiceagents.models.VoiceToolboxTool or ~azure.ai.voiceagents.models.VoiceSystemTool] - :ivar tool_choice: Tool-selection behavior for the session. Is either a Union[str, - "_models.ToolChoiceOptions"] type or a RealtimeToolChoiceFunction type. - :vartype tool_choice: str or ~azure.ai.voiceagents.models.ToolChoiceOptions or - ~azure.ai.voiceagents.models.RealtimeToolChoiceFunction - :ivar reasoning: Reasoning settings for compatible realtime models. - :vartype reasoning: ~azure.ai.voiceagents.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.voiceagents.models.VoiceAgentSessionIncludeOption] - :ivar metadata: Up to 16 string key-value pairs attached to the session. - :vartype metadata: dict[str, str] - :ivar voice_adaptation: Voice-optimized instruction adaptation settings. - :vartype voice_adaptation: ~azure.ai.voiceagents.models.VoiceAgentVoiceAdaptation - :ivar interim_response: Interim-response settings for latency and tool execution. Is either a - VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. - :vartype interim_response: ~azure.ai.voiceagents.models.VoiceAgentStaticInterimResponseConfig - or ~azure.ai.voiceagents.models.VoiceAgentLlmInterimResponseConfig - :ivar response_delimiter: A delimiter appended to generated responses. - :vartype response_delimiter: str - :ivar greeting: A proactive assistant greeting started after session configuration. - :vartype greeting: ~azure.ai.voiceagents.models.VoiceGreetingConfig - :ivar handoff: The customer-supplied handoff graph. - :vartype handoff: ~azure.ai.voiceagents.models.VoiceAgentHandoffGraphConfig - """ - - 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.VoiceAgentSessionUpdateAudio"] = 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["_unions.VoiceAgentSessionTool"]] = 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 either a Union[str, \"_models.ToolChoiceOptions\"] - type or a RealtimeToolChoiceFunction type.""" - 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.""" - voice_adaptation: Optional["_models.VoiceAgentVoiceAdaptation"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Voice-optimized instruction adaptation settings.""" - interim_response: Optional["_unions.VoiceAgentInterimResponse"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Interim-response settings for latency and tool execution. Is either a - VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type.""" - response_delimiter: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A delimiter appended to generated responses.""" - greeting: Optional["_models.VoiceGreetingConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """A proactive assistant greeting started after session configuration.""" - handoff: Optional["_models.VoiceAgentHandoffGraphConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The customer-supplied handoff graph.""" - - @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.VoiceAgentSessionUpdateAudio"] = None, - avatar: Optional["_models.VoiceAgentSessionAvatarConfig"] = None, - animation: Optional["_models.VoiceAgentAnimationConfig"] = None, - tools: Optional[list["_unions.VoiceAgentSessionTool"]] = 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, - voice_adaptation: Optional["_models.VoiceAgentVoiceAdaptation"] = None, - interim_response: Optional["_unions.VoiceAgentInterimResponse"] = None, - response_delimiter: Optional[str] = None, - greeting: Optional["_models.VoiceGreetingConfig"] = None, - handoff: Optional["_models.VoiceAgentHandoffGraphConfig"] = 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" - - -class VoiceAgentStaticInterimResponseConfig( - VoiceAgentInterimResponseConfig, discriminator="static_interim_response" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A static interim response selected from configured text. - - :ivar triggers: Conditions that may trigger one interim response. - :vartype triggers: list[str or ~azure.ai.voiceagents.models.VoiceAgentInterimResponseTrigger] - :ivar latency_threshold_ms: The latency threshold in milliseconds. - :vartype latency_threshold_ms: int - :ivar type: Required. Default value is "static_interim_response". - :vartype type: str - :ivar texts: Candidate text values for the interim response. - :vartype texts: list[str] - """ - - type: Literal["static_interim_response"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Default value is \"static_interim_response\".""" - texts: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Candidate text values for the interim response.""" - - @overload - def __init__( - self, - *, - triggers: Optional[list[Union[str, "_models.VoiceAgentInterimResponseTrigger"]]] = None, - latency_threshold_ms: Optional[int] = None, - texts: 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 = "static_interim_response" # type: ignore - - -class VoiceAgentTranscriptionPhrase(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A transcribed phrase with timing information. - - :ivar offset_milliseconds: The phrase offset from the beginning of the audio, in milliseconds. - Required. - :vartype offset_milliseconds: int - :ivar duration_milliseconds: The phrase duration in milliseconds. Required. - :vartype duration_milliseconds: int - :ivar text: The transcribed phrase text. Required. - :vartype text: str - :ivar words: Word-level timing details, when available. - :vartype words: list[~azure.ai.voiceagents.models.VoiceAgentTranscriptionWord] - :ivar locale: The detected locale. - :vartype locale: str - :ivar confidence: The transcription confidence score. - :vartype confidence: float - """ - - offset_milliseconds: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The phrase offset from the beginning of the audio, in milliseconds. Required.""" - duration_milliseconds: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The phrase duration in milliseconds. Required.""" - text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The transcribed phrase text. Required.""" - words: Optional[list["_models.VoiceAgentTranscriptionWord"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Word-level timing details, when available.""" - locale: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The detected locale.""" - confidence: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The transcription confidence score.""" - - @overload - def __init__( - self, - *, - offset_milliseconds: int, - duration_milliseconds: int, - text: str, - words: Optional[list["_models.VoiceAgentTranscriptionWord"]] = None, - locale: Optional[str] = None, - confidence: 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 VoiceAgentTranscriptionWord(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A time-stamped word in an input-audio transcription. - - :ivar text: The transcribed word text. Required. - :vartype text: str - :ivar offset_milliseconds: The word offset from the beginning of the audio, in milliseconds. - Required. - :vartype offset_milliseconds: int - :ivar duration_milliseconds: The word duration in milliseconds. Required. - :vartype duration_milliseconds: int - """ - - text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The transcribed word text. Required.""" - offset_milliseconds: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The word offset from the beginning of the audio, in milliseconds. Required.""" - duration_milliseconds: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The word duration in milliseconds. Required.""" - - @overload - def __init__( - self, - *, - text: str, - offset_milliseconds: int, - duration_milliseconds: 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 VoiceAgentVersionObject(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A voice agent version. Mirrors ``AgentVersionObject``, but its ``definition`` is always a - ``VoiceAgentDefinition``. - - :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 object: The object type, which is always 'agent.version'. Required. AGENT_VERSION. - :vartype object: str or ~azure.ai.voiceagents.models.AGENT_VERSION - :ivar id: The unique identifier of the agent version. Required. - :vartype id: str - :ivar name: The name of the agent. Name can be used to retrieve/update/delete the agent. - Required. - :vartype name: str - :ivar version: The version identifier of the agent. Agents are immutable and every update - creates a new version while keeping the name same. Required. - :vartype version: str - :ivar description: A human-readable description of the agent. - :vartype description: str - :ivar created_at: The Unix timestamp (seconds) when the agent was created. Required. - :vartype created_at: ~datetime.datetime - :ivar draft: Whether this agent version is a draft (candidate) rather than a release. Draft - versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. - Defaults to false. - :vartype draft: bool - :ivar status: The provisioning status of the agent version. Defaults to 'active' for non-hosted - agents. For hosted agents, reflects infrastructure readiness. Known values are: "creating", - "active", "failed", "deleting", and "deleted". - :vartype status: str or ~azure.ai.voiceagents.models.AgentVersionStatus - :ivar instance_identity: The instance identity of the agent. - :vartype instance_identity: ~azure.ai.voiceagents.models.AgentIdentity - :ivar blueprint: The blueprint for the agent. - :vartype blueprint: ~azure.ai.voiceagents.models.AgentIdentity - :ivar blueprint_reference: The blueprint for the agent. - :vartype blueprint_reference: ~azure.ai.voiceagents.models.AgentBlueprintReference - :ivar agent_guid: The unique GUID identifier of the agent. - :vartype agent_guid: str - :ivar definition: The voice agent definition for this version. Required. - :vartype definition: ~azure.ai.voiceagents.models.VoiceAgentDefinition - """ - - 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.""" - object: Literal[AgentObjectType.AGENT_VERSION] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The object type, which is always 'agent.version'. Required. AGENT_VERSION.""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the agent version. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the agent. Name can be used to retrieve/update/delete the agent. Required.""" - version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version identifier of the agent. Agents are immutable and every update creates a new - version while keeping the name same. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A human-readable description of the agent.""" - created_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (seconds) when the agent was created. Required.""" - draft: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether this agent version is a draft (candidate) rather than a release. Draft versions are - recorded but excluded from default 'latest' resolution and are not auto-promoted. Defaults to - false.""" - status: Optional[Union[str, "_models.AgentVersionStatus"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The provisioning status of the agent version. Defaults to 'active' for non-hosted agents. For - hosted agents, reflects infrastructure readiness. Known values are: \"creating\", \"active\", - \"failed\", \"deleting\", and \"deleted\".""" - instance_identity: Optional["_models.AgentIdentity"] = rest_field(visibility=["read"]) - """The instance identity of the agent.""" - blueprint: Optional["_models.AgentIdentity"] = rest_field(visibility=["read"]) - """The blueprint for the agent.""" - blueprint_reference: Optional["_models.AgentBlueprintReference"] = rest_field(visibility=["read"]) - """The blueprint for the agent.""" - agent_guid: Optional[str] = rest_field(visibility=["read"]) - """The unique GUID identifier of the agent.""" - definition: "_models.VoiceAgentDefinition" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The voice agent definition for this version. Required.""" - - @overload - def __init__( - self, - *, - metadata: dict[str, str], - object: Literal[AgentObjectType.AGENT_VERSION], - id: str, # pylint: disable=redefined-builtin - name: str, - version: str, - created_at: datetime.datetime, - definition: "_models.VoiceAgentDefinition", - description: Optional[str] = None, - draft: Optional[bool] = None, - status: Optional[Union[str, "_models.AgentVersionStatus"]] = 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 VoiceAgentVoiceAdaptation(_Model): # pylint: disable=docstring-missing-param - """Voice-optimized instruction adaptation settings. - - :ivar type: The adaptation strategy. Always ``auto``. Required. Default value is "auto". - :vartype type: str - """ - - type: Literal["auto"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The adaptation strategy. Always ``auto``. Required. Default value is \"auto\".""" - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type: Literal["auto"] = "auto" - - -class VoiceAgentWebSearchActionFind(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """An action that finds text on a web page. - - :ivar type: Required. Default value is "find". - :vartype type: str - :ivar pattern: Required. - :vartype pattern: str - :ivar url: Required. - :vartype url: str - """ - - type: Literal["find"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"find\".""" - pattern: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - pattern: str, - url: 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["find"] = "find" - - -class VoiceAgentWebSearchActionOpenPage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """An action that opens a web page. - - :ivar type: Required. Default value is "open_page". - :vartype type: str - :ivar url: Required. - :vartype url: str - """ - - type: Literal["open_page"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"open_page\".""" - url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - url: 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["open_page"] = "open_page" - - -class VoiceAgentWebSearchActionSearch(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A web search action. - - :ivar type: Required. Default value is "search". - :vartype type: str - :ivar query: Required. - :vartype query: str - :ivar sources: - :vartype sources: list[~azure.ai.voiceagents.models.VoiceAgentWebSearchSource] - """ - - type: Literal["search"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"search\".""" - query: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - sources: Optional[list["_models.VoiceAgentWebSearchSource"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - query: str, - sources: Optional[list["_models.VoiceAgentWebSearchSource"]] = 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["search"] = "search" - - -class VoiceAgentWebSearchCallItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A web-search output item. - - :ivar id: Required. - :vartype id: str - :ivar type: Required. Default value is "web_search_call". - :vartype type: str - :ivar status: Required. Known values are: "in_progress", "searching", "completed", and - "failed". - :vartype status: str or ~azure.ai.voiceagents.models.VoiceAgentWebSearchCallStatus - :ivar action: Is one of the following types: VoiceAgentWebSearchActionSearch, - VoiceAgentWebSearchActionOpenPage, VoiceAgentWebSearchActionFind - :vartype action: ~azure.ai.voiceagents.models.VoiceAgentWebSearchActionSearch or - ~azure.ai.voiceagents.models.VoiceAgentWebSearchActionOpenPage or - ~azure.ai.voiceagents.models.VoiceAgentWebSearchActionFind - """ - - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - type: Literal["web_search_call"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"web_search_call\".""" - status: Union[str, "_models.VoiceAgentWebSearchCallStatus"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Known values are: \"in_progress\", \"searching\", \"completed\", and \"failed\".""" - action: Optional["_unions.VoiceAgentWebSearchAction"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Is one of the following types: VoiceAgentWebSearchActionSearch, - VoiceAgentWebSearchActionOpenPage, VoiceAgentWebSearchActionFind""" - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - status: Union[str, "_models.VoiceAgentWebSearchCallStatus"], - action: Optional["_unions.VoiceAgentWebSearchAction"] = 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["web_search_call"] = "web_search_call" - - -class VoiceAgentWebSearchSource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A web-search source URL. - - :ivar type: Required. Default value is "url". - :vartype type: str - :ivar url: Required. - :vartype url: str - """ - - type: Literal["url"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"url\".""" - url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - url: 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["url"] = "url" - - -class VoiceAgentWorkflowActionItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A workflow action output item. - - :ivar id: Required. - :vartype id: str - :ivar object: Default value is "realtime.item". - :vartype object: str - :ivar type: Required. Default value is "workflow_action". - :vartype type: str - :ivar action_id: Required. - :vartype action_id: str - :ivar status: Required. - :vartype status: str - :ivar kind: - :vartype kind: str - :ivar parent_action_id: - :vartype parent_action_id: str - :ivar previous_action_id: - :vartype previous_action_id: str - """ - - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - object: Optional[Literal["realtime.item"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Default value is \"realtime.item\".""" - type: Literal["workflow_action"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"workflow_action\".""" - action_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - kind: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - parent_action_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - previous_action_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - action_id: str, - status: str, - object: Optional[Literal["realtime.item"]] = None, - kind: Optional[str] = None, - parent_action_id: Optional[str] = None, - previous_action_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["workflow_action"] = "workflow_action" - - -class VoiceConversationItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A persisted item in a voice conversation. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - VoiceFunctionCallItem, VoiceFunctionCallOutputItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem, VoiceMcpCallItem, VoiceMcpListToolsItem, VoiceMessageItem - - :ivar type: The type of the conversation item. Required. Known values are: "message", - "function_call", "function_call_output", "mcp_list_tools", "mcp_call", "mcp_approval_request", - and "mcp_approval_response". - :vartype type: str or ~azure.ai.voiceagents.models.VoiceConversationItemType - :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 - """ - - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of the conversation item. Required. Known values are: \"message\", \"function_call\", - \"function_call_output\", \"mcp_list_tools\", \"mcp_call\", \"mcp_approval_request\", and - \"mcp_approval_response\".""" - created_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The id of the response that produced this item, when applicable.""" - - @overload - def __init__( - self, - *, - type: str, - created_at: Optional[datetime.datetime] = None, - 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) - - -class VoiceMessageItem( - VoiceConversationItem, discriminator="message" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A persisted message item in a voice conversation. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - VoiceAssistantMessageItem, VoiceSystemMessageItem, VoiceUserMessageItem - - :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: Required. A message item. - :vartype type: str or ~azure.ai.voiceagents.models.MESSAGE - :ivar role: The role of the message sender. Required. Known values are: "system", "user", and - "assistant". - :vartype role: str or ~azure.ai.voiceagents.models.RealtimeConversationItemMessageType - """ - - __mapping__: dict[str, _Model] = {} - type: Literal[VoiceConversationItemType.MESSAGE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. A message item.""" - role: str = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) - """The role of the message sender. Required. Known values are: \"system\", \"user\", and - \"assistant\".""" - - @overload - def __init__( - self, - *, - role: str, - created_at: Optional[datetime.datetime] = None, - 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 = VoiceConversationItemType.MESSAGE # type: ignore - - -class VoiceAssistantMessageItem( - VoiceMessageItem, discriminator="assistant" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """An assistant message item. Only ``output_text`` and ``output_audio`` content are valid for - assistant messages. - - :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: Required. A message item. - :vartype type: str or ~azure.ai.voiceagents.models.MESSAGE - :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 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 content: The content of the message. Required. - :vartype content: - list[~azure.ai.voiceagents.models.RealtimeConversationItemMessageAssistantContent] - :ivar role: Required. ASSISTANT. - :vartype role: str or ~azure.ai.voiceagents.models.ASSISTANT - """ - - __mapping__: dict[str, _Model] = {} - 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\"]""" - content: list["_models.RealtimeConversationItemMessageAssistantContent"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The content of the message. Required.""" - role: Literal[RealtimeConversationItemMessageType.ASSISTANT] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. ASSISTANT.""" - - @overload - def __init__( - self, - *, - content: list["_models.RealtimeConversationItemMessageAssistantContent"], - created_at: Optional[datetime.datetime] = None, - response_id: Optional[str] = None, - id: Optional[str] = None, # pylint: disable=redefined-builtin - object: Optional[Literal["realtime.item"]] = None, - status: Optional[Literal["completed", "incomplete", "in_progress"]] = 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 = RealtimeConversationItemMessageType.ASSISTANT # type: ignore - - -class VoiceAudioConfig(_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 input: Input (microphone) audio configuration. - :vartype input: ~azure.ai.voiceagents.models.VoiceAudioInputConfig - :ivar output: Output (agent speech) audio configuration. - :vartype output: ~azure.ai.voiceagents.models.VoiceAudioOutputConfig - """ - - input: Optional["_models.VoiceAudioInputConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Input (microphone) audio configuration.""" - output: Optional["_models.VoiceAudioOutputConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Output (agent speech) audio configuration.""" - - @overload - def __init__( - self, - *, - input: Optional["_models.VoiceAudioInputConfig"] = None, - output: Optional["_models.VoiceAudioOutputConfig"] = 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 VoiceAudioFormat(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """An audio format. Follows the OpenAI Realtime session schema; ``type`` carries the media - subtype. - - :ivar type: The audio format type, e.g. 'audio/pcm' (16-bit PCM), 'audio/pcmu' (G.711 mu-law), - or 'audio/pcma' (G.711 A-law). Required. Known values are: "audio/pcm", "audio/pcmu", and - "audio/pcma". - :vartype type: str or ~azure.ai.voiceagents.models.VoiceAudioFormatType - :ivar rate: The sample rate in Hz. Applies to 'audio/pcm' (e.g. 24000); omit for telephony - G.711 formats (8 kHz). - :vartype rate: int - """ - - type: Union[str, "_models.VoiceAudioFormatType"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The audio format type, e.g. 'audio/pcm' (16-bit PCM), 'audio/pcmu' (G.711 mu-law), or - 'audio/pcma' (G.711 A-law). Required. Known values are: \"audio/pcm\", \"audio/pcmu\", and - \"audio/pcma\".""" - rate: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The sample rate in Hz. Applies to 'audio/pcm' (e.g. 24000); omit for telephony G.711 formats (8 - kHz).""" - - @overload - def __init__( - self, - *, - type: Union[str, "_models.VoiceAudioFormatType"], - rate: 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 VoiceAudioInputConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Input audio configuration for a voice agent. - - :ivar format: The input audio format. - :vartype format: ~azure.ai.voiceagents.models.VoiceAudioFormat - :ivar noise_reduction: Input noise reduction. Set to null to disable. - :vartype noise_reduction: ~azure.ai.voiceagents.models.VoiceNoiseReduction - :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.voiceagents.models.VoiceTurnDetection - :ivar transcription: Asynchronous input-audio transcription. Set to null to disable - transcription. - :vartype transcription: ~azure.ai.voiceagents.models.VoiceInputTranscription - """ - - format: Optional["_models.VoiceAudioFormat"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The input audio format.""" - noise_reduction: Optional["_models.VoiceNoiseReduction"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Input noise reduction. Set to null to disable.""" - turn_detection: Optional["_models.VoiceTurnDetection"] = 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.""" - transcription: Optional["_models.VoiceInputTranscription"] = 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.VoiceAudioFormat"] = None, - noise_reduction: Optional["_models.VoiceNoiseReduction"] = None, - turn_detection: Optional["_models.VoiceTurnDetection"] = None, - transcription: Optional["_models.VoiceInputTranscription"] = 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 VoiceAudioOutputConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Output audio configuration for a voice agent. - - :ivar format: The output audio format. - :vartype format: ~azure.ai.voiceagents.models.VoiceAudioFormat - :ivar voice: The typed voice configuration. Is one of the following types: OpenAIVoice, - AzureVoice, AzureRealtimeNativeVoice - :vartype voice: ~azure.ai.voiceagents.models.OpenAIVoice or - ~azure.ai.voiceagents.models.AzureVoice or - ~azure.ai.voiceagents.models.AzureRealtimeNativeVoice - :ivar speed: The OpenAI-compatible speaking speed multiplier, from 0.25 to 1.5. Defaults to 1. - For Azure synthesized voices, use ``voice.rate`` instead. - :vartype speed: float - :ivar output_audio_timestamp_types: Timestamp kinds to include with output audio. - :vartype output_audio_timestamp_types: list[str or - ~azure.ai.voiceagents.models.VoiceAudioTimestampType] - """ - - format: Optional["_models.VoiceAudioFormat"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The output audio format.""" - voice: Optional["_unions.VoiceAgentVoice"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The typed voice configuration. Is one of the following types: OpenAIVoice, AzureVoice, - AzureRealtimeNativeVoice""" - speed: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The OpenAI-compatible speaking speed multiplier, from 0.25 to 1.5. Defaults to 1. For Azure - synthesized voices, use ``voice.rate`` instead.""" - output_audio_timestamp_types: Optional[list[Union[str, "_models.VoiceAudioTimestampType"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Timestamp kinds to include with output audio.""" - - @overload - def __init__( - self, - *, - format: Optional["_models.VoiceAudioFormat"] = None, - voice: Optional["_unions.VoiceAgentVoice"] = None, - speed: Optional[float] = None, - output_audio_timestamp_types: Optional[list[Union[str, "_models.VoiceAudioTimestampType"]]] = 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 VoiceAvatarConfig(_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 type: The avatar type. Required. Known values are: "video_avatar" and "photo_avatar". - :vartype type: str or ~azure.ai.voiceagents.models.VoiceAvatarType - :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.voiceagents.models.VoiceAvatarOutputProtocol - """ - - type: Union[str, "_models.VoiceAvatarType"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """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.VoiceAvatarOutputProtocol"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The transport used to deliver the avatar video stream. Known values are: \"webrtc\" and - \"websocket\".""" - - @overload - def __init__( - self, - *, - type: Union[str, "_models.VoiceAvatarType"], - character: str, - style: Optional[str] = None, - customized: Optional[bool] = None, - output_protocol: Optional[Union[str, "_models.VoiceAvatarOutputProtocol"]] = 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 VoiceEndOfUtteranceDetection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Semantic end-of-utterance detection configuration. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - VoiceAzureSemanticDetection, VoiceAzureSemanticDetectionEn, - VoiceAzureSemanticDetectionMultilingual - - :ivar model: The semantic detection model. Required. Known values are: "semantic_detection_v1", - "semantic_detection_v1_en", and "semantic_detection_v1_multilingual". - :vartype model: str or ~azure.ai.voiceagents.models.VoiceEndOfUtteranceDetectionModel - """ - - __mapping__: dict[str, _Model] = {} - model: str = rest_discriminator(name="model", visibility=["read", "create", "update", "delete", "query"]) - """The semantic detection model. Required. Known values are: \"semantic_detection_v1\", - \"semantic_detection_v1_en\", and \"semantic_detection_v1_multilingual\".""" - - @overload - def __init__( - self, - *, - model: 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 VoiceAzureSemanticDetection( - VoiceEndOfUtteranceDetection, discriminator="semantic_detection_v1" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Default Azure semantic end-of-utterance detection. - - :ivar model: Required. The default semantic detection model. - :vartype model: str or ~azure.ai.voiceagents.models.SEMANTIC_DETECTION_V1 - :ivar threshold_level: The sensitivity threshold. Known values are: "low", "medium", "high", - and "default". - :vartype threshold_level: str or ~azure.ai.voiceagents.models.VoiceEndOfUtteranceThresholdLevel - :ivar timeout_ms: The detection timeout in milliseconds. - :vartype timeout_ms: int - """ - - model: Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1] = rest_discriminator(name="model", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. The default semantic detection model.""" - threshold_level: Optional[Union[str, "_models.VoiceEndOfUtteranceThresholdLevel"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The sensitivity threshold. Known values are: \"low\", \"medium\", \"high\", and \"default\".""" - timeout_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The detection timeout in milliseconds.""" - - @overload - def __init__( - self, - *, - threshold_level: Optional[Union[str, "_models.VoiceEndOfUtteranceThresholdLevel"]] = None, - timeout_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.model = VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1 # type: ignore - - -class VoiceAzureSemanticDetectionEn( - VoiceEndOfUtteranceDetection, discriminator="semantic_detection_v1_en" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """English-optimized Azure semantic end-of-utterance detection. - - :ivar model: Required. The English-optimized semantic detection model. - :vartype model: str or ~azure.ai.voiceagents.models.SEMANTIC_DETECTION_V1_EN - :ivar threshold_level: The sensitivity threshold. Known values are: "low", "medium", "high", - and "default". - :vartype threshold_level: str or ~azure.ai.voiceagents.models.VoiceEndOfUtteranceThresholdLevel - :ivar timeout_ms: The detection timeout in milliseconds. - :vartype timeout_ms: int - """ - - model: Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1_EN] = rest_discriminator(name="model", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. The English-optimized semantic detection model.""" - threshold_level: Optional[Union[str, "_models.VoiceEndOfUtteranceThresholdLevel"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The sensitivity threshold. Known values are: \"low\", \"medium\", \"high\", and \"default\".""" - timeout_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The detection timeout in milliseconds.""" - - @overload - def __init__( - self, - *, - threshold_level: Optional[Union[str, "_models.VoiceEndOfUtteranceThresholdLevel"]] = None, - timeout_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.model = VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1_EN # type: ignore - - -class VoiceAzureSemanticDetectionMultilingual( - VoiceEndOfUtteranceDetection, discriminator="semantic_detection_v1_multilingual" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Multilingual Azure semantic end-of-utterance detection. - - :ivar model: Required. The multilingual semantic detection model. - :vartype model: str or ~azure.ai.voiceagents.models.SEMANTIC_DETECTION_V1_MULTILINGUAL - :ivar threshold_level: The sensitivity threshold. Known values are: "low", "medium", "high", - and "default". - :vartype threshold_level: str or ~azure.ai.voiceagents.models.VoiceEndOfUtteranceThresholdLevel - :ivar timeout_ms: The detection timeout in milliseconds. - :vartype timeout_ms: int - """ - - model: Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1_MULTILINGUAL] = rest_discriminator(name="model", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. The multilingual semantic detection model.""" - threshold_level: Optional[Union[str, "_models.VoiceEndOfUtteranceThresholdLevel"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The sensitivity threshold. Known values are: \"low\", \"medium\", \"high\", and \"default\".""" - timeout_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The detection timeout in milliseconds.""" - - @overload - def __init__( - self, - *, - threshold_level: Optional[Union[str, "_models.VoiceEndOfUtteranceThresholdLevel"]] = None, - timeout_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.model = VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1_MULTILINGUAL # type: ignore - - -class VoiceTurnDetection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Turn-detection configuration for a voice agent. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - VoiceAzureSemanticVadTurnDetection, VoiceAzureSemanticVadEnTurnDetection, - VoiceAzureSemanticVadMultilingualTurnDetection, VoiceSemanticVadTurnDetection, - VoiceServerVadTurnDetection - - :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.voiceagents.models.VoiceTurnDetectionType - """ - - __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\".""" - - @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 VoiceAzureSemanticVadEnTurnDetection( - VoiceTurnDetection, discriminator="azure_semantic_vad_en" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """English-optimized Azure semantic voice activity detection. - - :ivar type: Required. English-optimized Azure semantic voice activity detection. - :vartype type: str or ~azure.ai.voiceagents.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: int - :ivar silence_duration_ms: Silence required to end speech detection, in milliseconds. - :vartype silence_duration_ms: int - :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. - :vartype end_of_utterance_detection: ~azure.ai.voiceagents.models.VoiceEndOfUtteranceDetection - :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in - milliseconds. - :vartype speech_duration_ms: int - :ivar remove_filler_words: Whether filler words are removed from transcription. - :vartype remove_filler_words: bool - :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech - stops. - :vartype auto_truncate: 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[VoiceTurnDetectionType.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[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Audio to include before detected speech, in milliseconds.""" - silence_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Silence required to end speech detection, in milliseconds.""" - end_of_utterance_detection: Optional["_models.VoiceEndOfUtteranceDetection"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Semantic end-of-utterance detection configuration.""" - speech_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """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.""" - auto_truncate: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the input audio buffer is truncated automatically when speech stops.""" - 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, - *, - threshold: Optional[float] = None, - prefix_padding_ms: Optional[int] = None, - silence_duration_ms: Optional[int] = None, - end_of_utterance_detection: Optional["_models.VoiceEndOfUtteranceDetection"] = None, - speech_duration_ms: Optional[int] = None, - remove_filler_words: Optional[bool] = None, - auto_truncate: 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 = VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN # type: ignore - - -class VoiceAzureSemanticVadMultilingualTurnDetection( - VoiceTurnDetection, discriminator="azure_semantic_vad_multilingual" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Multilingual Azure semantic voice activity detection. - - :ivar type: Required. Multilingual Azure semantic voice activity detection. - :vartype type: str or ~azure.ai.voiceagents.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: int - :ivar silence_duration_ms: Silence required to end speech detection, in milliseconds. - :vartype silence_duration_ms: int - :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. - :vartype end_of_utterance_detection: ~azure.ai.voiceagents.models.VoiceEndOfUtteranceDetection - :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in - milliseconds. - :vartype speech_duration_ms: int - :ivar remove_filler_words: Whether filler words are removed from transcription. - :vartype remove_filler_words: bool - :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech - stops. - :vartype auto_truncate: 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[VoiceTurnDetectionType.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[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Audio to include before detected speech, in milliseconds.""" - silence_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Silence required to end speech detection, in milliseconds.""" - end_of_utterance_detection: Optional["_models.VoiceEndOfUtteranceDetection"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Semantic end-of-utterance detection configuration.""" - speech_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """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.""" - auto_truncate: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the input audio buffer is truncated automatically when speech stops.""" - 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, - *, - threshold: Optional[float] = None, - prefix_padding_ms: Optional[int] = None, - silence_duration_ms: Optional[int] = None, - end_of_utterance_detection: Optional["_models.VoiceEndOfUtteranceDetection"] = None, - speech_duration_ms: Optional[int] = None, - remove_filler_words: Optional[bool] = None, - auto_truncate: 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 = VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL # type: ignore - - -class VoiceAzureSemanticVadTurnDetection( - VoiceTurnDetection, discriminator="azure_semantic_vad" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Azure semantic voice activity detection. - - :ivar type: Required. Azure semantic voice activity detection. - :vartype type: str or ~azure.ai.voiceagents.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: int - :ivar silence_duration_ms: Silence required to end speech detection, in milliseconds. - :vartype silence_duration_ms: int - :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. - :vartype end_of_utterance_detection: ~azure.ai.voiceagents.models.VoiceEndOfUtteranceDetection - :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in - milliseconds. - :vartype speech_duration_ms: int - :ivar remove_filler_words: Whether filler words are removed from transcription. - :vartype remove_filler_words: bool - :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech - stops. - :vartype auto_truncate: 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[VoiceTurnDetectionType.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[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Audio to include before detected speech, in milliseconds.""" - silence_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Silence required to end speech detection, in milliseconds.""" - end_of_utterance_detection: Optional["_models.VoiceEndOfUtteranceDetection"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Semantic end-of-utterance detection configuration.""" - speech_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """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.""" - auto_truncate: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the input audio buffer is truncated automatically when speech stops.""" - 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, - *, - threshold: Optional[float] = None, - prefix_padding_ms: Optional[int] = None, - silence_duration_ms: Optional[int] = None, - end_of_utterance_detection: Optional["_models.VoiceEndOfUtteranceDetection"] = None, - speech_duration_ms: Optional[int] = None, - remove_filler_words: Optional[bool] = None, - auto_truncate: 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 = VoiceTurnDetectionType.AZURE_SEMANTIC_VAD # type: ignore - - -class VoiceConversation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A persisted voice conversation. The Foundry envelope that owns a voice agent's stored - transcript, responses, per-turn metrics, and audio. It is the parent, retention, and delete - boundary: deleting it cascades to its responses, items, metrics, and audio. - - :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" and "completed". - :vartype status: str or ~azure.ai.voiceagents.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 the conversation's session ended. - Absent while 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 usage: Aggregate token usage totals across all responses in this conversation. - :vartype usage: ~azure.ai.voiceagents.models.RealtimeResponseUsage - """ - - 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\" and - \"completed\".""" - 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 the conversation's session ended. Absent while 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.""" - usage: Optional["_models.RealtimeResponseUsage"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Aggregate token usage totals across all responses in this conversation.""" - - @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, - usage: Optional["_models.RealtimeResponseUsage"] = 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 VoiceFunctionCallItem( - VoiceConversationItem, discriminator="function_call" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A function call request item. - - :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 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 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 type: Required. A function-call request item. - :vartype type: str or ~azure.ai.voiceagents.models.FUNCTION_CALL - """ - - 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\"]""" - 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.""" - type: Literal[VoiceConversationItemType.FUNCTION_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. A function-call request item.""" - - @overload - def __init__( - self, - *, - name: str, - arguments: str, - created_at: Optional[datetime.datetime] = None, - response_id: Optional[str] = None, - 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 - 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 = VoiceConversationItemType.FUNCTION_CALL # type: ignore - - -class VoiceFunctionCallOutputItem( - VoiceConversationItem, discriminator="function_call_output" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A function call output item. - - :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 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 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 type: Required. A function-call output item. - :vartype type: str or ~azure.ai.voiceagents.models.FUNCTION_CALL_OUTPUT - :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 - """ - - 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\"]""" - 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.""" - type: Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. A function-call output item.""" - 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, - *, - call_id: str, - output: str, - created_at: Optional[datetime.datetime] = None, - response_id: Optional[str] = None, - 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 - 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 = VoiceConversationItemType.FUNCTION_CALL_OUTPUT # type: ignore - - -class VoiceInputTranscription(_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 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 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 to use. 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.voiceagents.models.VoiceInputTranscriptionModel - :ivar custom_speech: Optional custom speech model 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] - """ - - 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.""" - 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.VoiceInputTranscriptionModel"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The transcription model to use. 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 custom speech model 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, - *, - model: Union[str, "_models.VoiceInputTranscriptionModel"], - language: Optional[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 - 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 VoiceItemAudioResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Metadata for a single conversation item's audio segment. For bring-your-own-storage (BYOS), the - response includes ``blob_uri``, a direct customer-storage URI without a SAS token, that the - customer accesses with their own credentials. For Foundry-managed storage, ``blob_uri`` is - absent and the bytes are streamed through the item's ``/audio/content`` route. - - :ivar conversation_id: The id of the conversation the item belongs to. Required. - :vartype conversation_id: str - :ivar item_id: The id of the item this audio belongs to. Required. - :vartype item_id: str - :ivar role: The role the audio belongs to. Known values are: "user" and "agent". - :vartype role: str or ~azure.ai.voiceagents.models.VoiceAudioRole - :ivar format: The container format of the audio. "wav" - :vartype format: str or ~azure.ai.voiceagents.models.VoiceAudioContainerFormat - :ivar codec: The audio codec. Known values are: "pcm16", "pcmu", and "pcma". - :vartype codec: str or ~azure.ai.voiceagents.models.VoiceAudioCodec - :ivar sample_rate: The sample rate in Hz. - :vartype sample_rate: int - :ivar channels: The number of audio channels. - :vartype channels: int - :ivar start_offset_ms: The offset from the session start at which this segment begins. - :vartype start_offset_ms: ~datetime.timedelta - :ivar duration_ms: The duration of the audio segment. - :vartype duration_ms: ~datetime.timedelta - :ivar blob_uri: For bring-your-own-storage (BYOS) recordings only: the URI of the recording in - the customer's own storage, without a SAS token. The customer downloads it using their own - storage credentials. Absent for Foundry-managed storage, where the bytes are streamed via the - item's ``/audio/content`` route instead. - :vartype blob_uri: str - """ - - conversation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The id of the conversation the item belongs to. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The id of the item this audio belongs to. Required.""" - role: Optional[Union[str, "_models.VoiceAudioRole"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The role the audio belongs to. Known values are: \"user\" and \"agent\".""" - format: Optional[Union[str, "_models.VoiceAudioContainerFormat"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The container format of the audio. \"wav\"""" - codec: Optional[Union[str, "_models.VoiceAudioCodec"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The audio codec. Known values are: \"pcm16\", \"pcmu\", and \"pcma\".""" - sample_rate: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The sample rate in Hz.""" - channels: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of audio channels.""" - start_offset_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """The offset from the session start at which this segment begins.""" - duration_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """The duration of the audio segment.""" - blob_uri: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """For bring-your-own-storage (BYOS) recordings only: the URI of the recording in the customer's - own storage, without a SAS token. The customer downloads it using their own storage - credentials. Absent for Foundry-managed storage, where the bytes are streamed via the item's - ``/audio/content`` route instead.""" - - @overload - def __init__( - self, - *, - conversation_id: str, - item_id: str, - role: Optional[Union[str, "_models.VoiceAudioRole"]] = None, - format: Optional[Union[str, "_models.VoiceAudioContainerFormat"]] = None, - codec: Optional[Union[str, "_models.VoiceAudioCodec"]] = None, - sample_rate: Optional[int] = None, - channels: Optional[int] = None, - start_offset_ms: Optional[datetime.timedelta] = None, - duration_ms: Optional[datetime.timedelta] = None, - blob_uri: 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 VoiceMcpApprovalRequestItem( - VoiceConversationItem, discriminator="mcp_approval_request" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """An MCP approval request item. - - :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 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 type: Required. An MCP approval request item. - :vartype type: str or ~azure.ai.voiceagents.models.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.""" - type: Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. An MCP approval request item.""" - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - server_label: str, - name: str, - arguments: str, - created_at: Optional[datetime.datetime] = None, - 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 = VoiceConversationItemType.MCP_APPROVAL_REQUEST # type: ignore - - -class VoiceMcpApprovalResponseItem( - VoiceConversationItem, discriminator="mcp_approval_response" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """An MCP approval response item (client-created). - - :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 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 type: Required. An MCP approval response item. - :vartype type: str or ~azure.ai.voiceagents.models.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"]) - type: Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. An MCP approval response item.""" - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - approval_request_id: str, - approve: bool, - created_at: Optional[datetime.datetime] = None, - response_id: Optional[str] = None, - reason: 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 = VoiceConversationItemType.MCP_APPROVAL_RESPONSE # type: ignore - - -class VoiceMcpCallItem( - VoiceConversationItem, discriminator="mcp_call" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """An MCP call item. - - :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 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.voiceagents.models.RealtimeMCPError - :ivar type: Required. An MCP call item. - :vartype type: str or ~azure.ai.voiceagents.models.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"]) - type: Literal[VoiceConversationItemType.MCP_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. An MCP call item.""" - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - server_label: str, - name: str, - arguments: str, - created_at: Optional[datetime.datetime] = None, - response_id: Optional[str] = None, - approval_request_id: Optional[str] = None, - output: Optional[str] = None, - error: Optional["_models.RealtimeMCPError"] = 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 = VoiceConversationItemType.MCP_CALL # type: ignore - - -class VoiceMcpListToolsItem( - VoiceConversationItem, discriminator="mcp_list_tools" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """An MCP list-tools item. - - :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 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.voiceagents.models.MCPListToolsTool] - :ivar type: Required. An MCP list-tools item. - :vartype type: str or ~azure.ai.voiceagents.models.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.""" - type: Literal[VoiceConversationItemType.MCP_LIST_TOOLS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. An MCP list-tools item.""" - - @overload - def __init__( - self, - *, - server_label: str, - tools: list["_models.MCPListToolsTool"], - created_at: Optional[datetime.datetime] = None, - response_id: Optional[str] = None, - id: Optional[str] = None, # 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) - self.type = VoiceConversationItemType.MCP_LIST_TOOLS # type: ignore - - -class VoiceNoiseReduction(_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". - :vartype type: str or ~azure.ai.voiceagents.models.VoiceNoiseReductionType - """ - - type: Union[str, "_models.VoiceNoiseReductionType"] = 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\".""" - - @overload - def __init__( - self, - *, - type: Union[str, "_models.VoiceNoiseReductionType"], - ) -> 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 VoiceRecordingChannelLayout(_Model): # pylint: disable=docstring-missing-param - """The role assigned to each channel of a merged stereo voice recording. - - :ivar left: The role carried on the left channel. Always ``user``. Required. Default value is - "user". - :vartype left: str - :ivar right: The role carried on the right channel. Always ``agent``. Required. Default value - is "agent". - :vartype right: str - """ - - left: Literal["user"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The role carried on the left channel. Always ``user``. Required. Default value is \"user\".""" - right: Literal["agent"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The role carried on the right channel. Always ``agent``. Required. Default value is \"agent\".""" - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.left: Literal["user"] = "user" - self.right: Literal["agent"] = "agent" - - -class VoiceRecordingResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Metadata for the merged, whole-call stereo recording of a voice conversation (user audio on the - left channel, agent audio on the right). Built once from the per-turn segments after the - session ends and durably cached. The common metadata (format, sample rate, channels, channel - layout, duration) is returned for both Foundry-managed and bring-your-own-storage (BYOS) - recordings. For BYOS the response also includes ``blob_uri``, the URI of the recording in the - customer's own storage (no SAS token), which the customer downloads using their own storage - credentials. For Foundry-managed storage ``blob_uri`` is absent and the bytes are streamed via - the ``/audio/content`` route instead. - - :ivar conversation_id: The id of the conversation this recording belongs to. Required. - :vartype conversation_id: str - :ivar format: The container format of the recording. Required. "wav" - :vartype format: str or ~azure.ai.voiceagents.models.VoiceAudioContainerFormat - :ivar sample_rate: The sample rate of the recording in Hz, e.g. 24000. Required. - :vartype sample_rate: int - :ivar channels: The number of audio channels. The merged recording is stereo (``2``). Required. - :vartype channels: int - :ivar channel_layout: The role assigned to each stereo channel. Required. - :vartype channel_layout: ~azure.ai.voiceagents.models.VoiceRecordingChannelLayout - :ivar duration_ms: The total duration of the recording. Required. - :vartype duration_ms: ~datetime.timedelta - :ivar blob_uri: For bring-your-own-storage (BYOS) recordings only: the URI of the recording in - the customer's own storage, without a SAS token. The customer downloads it using their own - storage credentials. Absent for Foundry-managed storage, where the bytes are streamed via the - ``/audio/content`` route instead. - :vartype blob_uri: str - """ - - conversation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The id of the conversation this recording belongs to. Required.""" - format: Union[str, "_models.VoiceAudioContainerFormat"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The container format of the recording. Required. \"wav\"""" - sample_rate: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The sample rate of the recording in Hz, e.g. 24000. Required.""" - channels: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of audio channels. The merged recording is stereo (``2``). Required.""" - channel_layout: "_models.VoiceRecordingChannelLayout" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The role assigned to each stereo channel. Required.""" - duration_ms: datetime.timedelta = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """The total duration of the recording. Required.""" - blob_uri: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """For bring-your-own-storage (BYOS) recordings only: the URI of the recording in the customer's - own storage, without a SAS token. The customer downloads it using their own storage - credentials. Absent for Foundry-managed storage, where the bytes are streamed via the - ``/audio/content`` route instead.""" - - @overload - def __init__( - self, - *, - conversation_id: str, - format: Union[str, "_models.VoiceAudioContainerFormat"], - sample_rate: int, - channels: int, - channel_layout: "_models.VoiceRecordingChannelLayout", - duration_ms: datetime.timedelta, - blob_uri: 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 VoiceResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A persisted voice response representing one model inference turn within a conversation. In list - results the ``output`` projection may be omitted; retrieve the full response (``GET - .../responses/{response_id}``) or the paged response-items route (``GET - .../responses/{response_id}/items``) for its output items. ``created_at``/``completed_at`` are - Foundry durable ordering extensions. - - :ivar id: The unique id of the response. Required. - :vartype id: str - :ivar object: The object type. Always ``realtime.response``. Required. Default value is - "realtime.response". - :vartype object: str - :ivar status: The status of the response. Required. Known values are: "in_progress", - "completed", "cancelled", "incomplete", and "failed". - :vartype status: str or ~azure.ai.voiceagents.models.VoiceResponseStatus - :ivar status_details: Additional detail about a terminal status. - :vartype status_details: ~azure.ai.voiceagents.models.RealtimeResponseStatusDetails - :ivar output: The output items produced by the response. May be omitted in list results; - retrieve the full response (GET .../responses/{response_id}) or use the paged response-items - route (GET .../responses/{response_id}/items) for its output items. Each item's ``response_id`` - also links it back to this response in the conversation-level items list. - :vartype output: list[~azure.ai.voiceagents.models.VoiceConversationItem] - :ivar usage: Token usage statistics for the response. - :vartype usage: ~azure.ai.voiceagents.models.RealtimeResponseUsage - :ivar conversation_id: The id of the conversation this response belongs to. Required. - :vartype conversation_id: str - :ivar audio: The audio configuration used for the response, including the voice and audio - format used for output. - :vartype audio: ~azure.ai.voiceagents.models.VoiceResponseAudio - :ivar output_modalities: The output modalities used for the response, e.g. ``["text", - "audio"]``. Audio output always includes a text transcript. - :vartype output_modalities: list[str or str] - :ivar temperature: The sampling temperature used for the response. - :vartype temperature: float - :ivar max_output_tokens: The maximum number of output tokens allowed for the response; an - integer or the literal ``inf``. Is either a int type or a Literal["inf"] type. - :vartype max_output_tokens: int or str - :ivar created_at: The Unix timestamp (in seconds) for when the response was created. - :vartype created_at: ~datetime.datetime - :ivar completed_at: The Unix timestamp (in seconds) for when the response completed. - :vartype completed_at: ~datetime.datetime - """ - - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique id of the response. Required.""" - object: Literal["realtime.response"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The object type. Always ``realtime.response``. Required. Default value is - \"realtime.response\".""" - status: Union[str, "_models.VoiceResponseStatus"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The status of the response. Required. Known values are: \"in_progress\", \"completed\", - \"cancelled\", \"incomplete\", and \"failed\".""" - status_details: Optional["_models.RealtimeResponseStatusDetails"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Additional detail about a terminal status.""" - output: Optional[list["_models.VoiceConversationItem"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The output items produced by the response. May be omitted in list results; retrieve the full - response (GET .../responses/{response_id}) or use the paged response-items route (GET - .../responses/{response_id}/items) for its output items. Each item's ``response_id`` also links - it back to this response in the conversation-level items list.""" - usage: Optional["_models.RealtimeResponseUsage"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Token usage statistics for the response.""" - conversation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The id of the conversation this response belongs to. Required.""" - audio: Optional["_models.VoiceResponseAudio"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The audio configuration used for the response, including the voice and audio format used for - output.""" - output_modalities: Optional[list[Literal["text", "audio"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The output modalities used for the response, e.g. ``[\"text\", \"audio\"]``. Audio output - always includes a text transcript.""" - temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The sampling temperature used for the response.""" - max_output_tokens: Optional[Union[int, Literal["inf"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The maximum number of output tokens allowed for the response; an integer or the literal - ``inf``. Is either a int type or a Literal[\"inf\"] type.""" - created_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when the response was created.""" - completed_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when the response completed.""" - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - status: Union[str, "_models.VoiceResponseStatus"], - conversation_id: str, - status_details: Optional["_models.RealtimeResponseStatusDetails"] = None, - output: Optional[list["_models.VoiceConversationItem"]] = None, - usage: Optional["_models.RealtimeResponseUsage"] = None, - audio: Optional["_models.VoiceResponseAudio"] = None, - output_modalities: Optional[list[Literal["text", "audio"]]] = None, - temperature: Optional[float] = None, - max_output_tokens: Optional[Union[int, Literal["inf"]]] = None, - created_at: Optional[datetime.datetime] = None, - completed_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.object: Literal["realtime.response"] = "realtime.response" - - -class VoiceResponseAudio(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Audio configuration for a response. Follows the OpenAI Realtime GA ``audio`` object shape. - - :ivar output: The audio output configuration used for the response. - :vartype output: ~azure.ai.voiceagents.models.VoiceResponseAudioOutput - """ - - output: Optional["_models.VoiceResponseAudioOutput"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The audio output configuration used for the response.""" - - @overload - def __init__( - self, - *, - output: Optional["_models.VoiceResponseAudioOutput"] = 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 VoiceResponseAudioOutput(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The output audio format used for a response. Follows the OpenAI Realtime GA audio format - discriminated union. - - :ivar voice: The voice used for the response's audio output. Is one of the following types: - OpenAIVoice, AzureVoice, AzureRealtimeNativeVoice - :vartype voice: ~azure.ai.voiceagents.models.OpenAIVoice or - ~azure.ai.voiceagents.models.AzureVoice or - ~azure.ai.voiceagents.models.AzureRealtimeNativeVoice - :ivar format: The audio format used for the response's audio output. - :vartype format: ~azure.ai.voiceagents.models.RealtimeAudioFormats - """ - - voice: Optional["_unions.VoiceResponseVoice"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The voice used for the response's audio output. Is one of the following types: OpenAIVoice, - AzureVoice, AzureRealtimeNativeVoice""" - format: Optional["_models.RealtimeAudioFormats"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The audio format used for the response's audio output.""" - - @overload - def __init__( - self, - *, - voice: Optional["_unions.VoiceResponseVoice"] = None, - format: Optional["_models.RealtimeAudioFormats"] = 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 VoiceSemanticVadTurnDetection( - VoiceTurnDetection, discriminator="semantic_vad" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Semantic voice activity detection. - - :ivar eagerness: Is one of the following types: Literal["low"], Literal["medium"], - Literal["high"], Literal["auto"] - :vartype eagerness: str or str or str or str - :ivar create_response: - :vartype create_response: bool - :ivar interrupt_response: - :vartype interrupt_response: bool - :ivar type: Required. Semantic voice activity detection. - :vartype type: str or ~azure.ai.voiceagents.models.SEMANTIC_VAD - """ - - eagerness: Optional[Literal["low", "medium", "high", "auto"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Is one of the following types: Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"], - Literal[\"auto\"]""" - create_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - interrupt_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Semantic voice activity detection.""" - - @overload - def __init__( - self, - *, - eagerness: Optional[Literal["low", "medium", "high", "auto"]] = 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 = VoiceTurnDetectionType.SEMANTIC_VAD # type: ignore - - -class VoiceServerVadTurnDetection( - VoiceTurnDetection, discriminator="server_vad" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Server-side voice activity detection. - - :ivar threshold: - :vartype threshold: float - :ivar prefix_padding_ms: - :vartype prefix_padding_ms: int - :ivar silence_duration_ms: - :vartype silence_duration_ms: int - :ivar create_response: - :vartype create_response: bool - :ivar interrupt_response: - :vartype interrupt_response: bool - :ivar idle_timeout_ms: - :vartype idle_timeout_ms: int - :ivar type: Required. Server-side voice activity detection. - :vartype type: str or ~azure.ai.voiceagents.models.SERVER_VAD - """ - - threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - prefix_padding_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - silence_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - create_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - interrupt_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - idle_timeout_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - type: Literal[VoiceTurnDetectionType.SERVER_VAD] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Server-side voice activity detection.""" - - @overload - def __init__( - self, - *, - threshold: Optional[float] = None, - prefix_padding_ms: Optional[int] = None, - silence_duration_ms: Optional[int] = None, - create_response: Optional[bool] = None, - interrupt_response: Optional[bool] = None, - idle_timeout_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 = VoiceTurnDetectionType.SERVER_VAD # type: ignore - - -class VoiceSystemMessageItem( - VoiceMessageItem, discriminator="system" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A system message item. Only ``input_text`` content is valid for system messages. - - :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: Required. A message item. - :vartype type: str or ~azure.ai.voiceagents.models.MESSAGE - :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 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 content: The content of the message. Required. - :vartype content: - list[~azure.ai.voiceagents.models.RealtimeConversationItemMessageSystemContent] - :ivar role: Required. SYSTEM. - :vartype role: str or ~azure.ai.voiceagents.models.SYSTEM - """ - - __mapping__: dict[str, _Model] = {} - 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\"]""" - content: list["_models.RealtimeConversationItemMessageSystemContent"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The content of the message. Required.""" - role: Literal[RealtimeConversationItemMessageType.SYSTEM] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. SYSTEM.""" - - @overload - def __init__( - self, - *, - content: list["_models.RealtimeConversationItemMessageSystemContent"], - created_at: Optional[datetime.datetime] = None, - response_id: Optional[str] = None, - id: Optional[str] = None, # pylint: disable=redefined-builtin - object: Optional[Literal["realtime.item"]] = None, - status: Optional[Literal["completed", "incomplete", "in_progress"]] = 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 = RealtimeConversationItemMessageType.SYSTEM # type: ignore - - -class VoiceSystemTool(_Model): # 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. - - :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.voiceagents.models.VoiceSystemToolName - :ivar description: An optional description of the system tool. - :vartype description: str - """ - - type: Literal["system"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The type of the tool. Always ``system``. Required. Default value is \"system\".""" - name: Union[str, "_models.VoiceSystemToolName"] = rest_field( - 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, - *, - name: Union[str, "_models.VoiceSystemToolName"], - 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: Literal["system"] = "system" - - -class VoiceToolboxTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A reference to a Foundry toolbox, which is a versioned bundle of tools executed through its MCP - endpoint. - - :ivar type: The type of the tool. Always ``toolbox``. Required. Default value is "toolbox". - :vartype type: str - :ivar toolbox_name: The name of the toolbox to attach. Required. - :vartype toolbox_name: str - :ivar toolbox_version: The immutable version of the toolbox to attach. Required. - :vartype toolbox_version: str - """ - - type: Literal["toolbox"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The type of the tool. Always ``toolbox``. Required. Default value is \"toolbox\".""" - toolbox_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the toolbox to attach. Required.""" - toolbox_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The immutable version of the toolbox to attach. Required.""" - - @overload - def __init__( - self, - *, - toolbox_name: str, - toolbox_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) - self.type: Literal["toolbox"] = "toolbox" - - -class VoiceUserMessageItem( - VoiceMessageItem, discriminator="user" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A user message item. ``input_text``, ``input_audio``, and ``input_image`` content are valid for - user messages. - - :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: Required. A message item. - :vartype type: str or ~azure.ai.voiceagents.models.MESSAGE - :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 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 content: The content of the message. Required. - :vartype content: list[~azure.ai.voiceagents.models.RealtimeConversationItemMessageUserContent] - :ivar role: Required. USER. - :vartype role: str or ~azure.ai.voiceagents.models.USER - """ - - __mapping__: dict[str, _Model] = {} - 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\"]""" - content: list["_models.RealtimeConversationItemMessageUserContent"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The content of the message. Required.""" - role: Literal[RealtimeConversationItemMessageType.USER] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. USER.""" - - @overload - def __init__( - self, - *, - content: list["_models.RealtimeConversationItemMessageUserContent"], - created_at: Optional[datetime.datetime] = None, - response_id: Optional[str] = None, - id: Optional[str] = None, # pylint: disable=redefined-builtin - object: Optional[Literal["realtime.item"]] = None, - status: Optional[Literal["completed", "incomplete", "in_progress"]] = 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 = RealtimeConversationItemMessageType.USER # type: ignore diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/_patch.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/_patch.py deleted file mode 100644 index 87676c65a8f0..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/models/_patch.py +++ /dev/null @@ -1,21 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------- -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" - - -__all__: list[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/__init__.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/__init__.py deleted file mode 100644 index 0840d3975c41..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import AgentEndpointConversationsOperations # type: ignore -from ._operations import VoiceAgentsOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "AgentEndpointConversationsOperations", - "VoiceAgentsOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/_operations.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/_operations.py deleted file mode 100644 index 28621e78532d..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/_operations.py +++ /dev/null @@ -1,3501 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -import json -from typing import Any, Callable, IO, Iterator, Literal, Optional, TYPE_CHECKING, TypeVar, Union, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict - -from .. import models as _models, types as _types -from .._configuration import VoiceAgentsClientConfiguration -from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize -from .._utils.serialization import Deserializer, Serializer -from ..models._enums import AgentDefinitionOptInKeys - -if TYPE_CHECKING: - from .. import _unions -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] -_Unset: Any = object() - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_voice_agent_web_socket_connect_voice_agent_request( # pylint: disable=name-too-long - agent_name: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - agent_session_id: Optional[str] = None, - agent_version_override: Optional[str] = None, - websocket_subprotocol: Optional[Union[str, _models.VoiceAgentWebSocketSubprotocol]] = None, - structured_inputs: 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")) - # Construct URL - _url = "/agents/{agent_name}/endpoint/protocols/voice" - path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if agent_session_id is not None: - _params["agent_session_id"] = _SERIALIZER.query("agent_session_id", agent_session_id, "str") - if agent_version_override is not None: - _params["x-agent-version-override"] = _SERIALIZER.query("agent_version_override", agent_version_override, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") - if websocket_subprotocol is not None: - _headers["Sec-WebSocket-Protocol"] = _SERIALIZER.header("websocket_subprotocol", websocket_subprotocol, "str") - if structured_inputs is not None: - _headers["x-ms-voice-structured-inputs"] = _SERIALIZER.header("structured_inputs", structured_inputs, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_agent_endpoint_conversations_get_agent_conversation_request( # pylint: disable=name-too-long - agent_name: str, - conversation_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **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/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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_agent_endpoint_conversations_delete_agent_conversation_request( # pylint: disable=name-too-long - agent_name: str, - conversation_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **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")) - # Construct URL - _url = "/agents/{agent_name}/endpoint/protocols/voice/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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_agent_endpoint_conversations_list_agent_conversation_responses_request( # pylint: disable=name-too-long - agent_name: str, - conversation_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - 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/conversations/{conversation_id}/responses" - 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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_agent_endpoint_conversations_get_agent_conversation_response_request( # pylint: disable=name-too-long - agent_name: str, - conversation_id: str, - response_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **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/conversations/{conversation_id}/responses/{response_id}" - path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), - "response_id": _SERIALIZER.url("response_id", response_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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_agent_endpoint_conversations_list_agent_conversation_response_items_request( # pylint: disable=name-too-long - agent_name: str, - conversation_id: str, - response_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - 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/conversations/{conversation_id}/responses/{response_id}/items" - path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), - "response_id": _SERIALIZER.url("response_id", response_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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_agent_endpoint_conversations_list_agent_conversation_items_request( # pylint: disable=name-too-long - agent_name: str, - conversation_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - 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/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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_agent_endpoint_conversations_get_agent_conversation_item_request( # pylint: disable=name-too-long - agent_name: str, - conversation_id: str, - item_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **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/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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_agent_endpoint_conversations_get_agent_conversation_item_audio_request( # pylint: disable=name-too-long - agent_name: str, - conversation_id: str, - item_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **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/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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_agent_endpoint_conversations_get_agent_conversation_item_audio_content_request( # pylint: disable=name-too-long - agent_name: str, - conversation_id: str, - item_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **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/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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_agent_endpoint_conversations_get_agent_conversation_audio_request( # pylint: disable=name-too-long - agent_name: str, - conversation_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **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/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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_agent_endpoint_conversations_get_agent_conversation_audio_content_request( # pylint: disable=name-too-long - agent_name: str, - conversation_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **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/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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_voice_agents_create_voice_agent_request( # pylint: disable=name-too-long - *, foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/voice_agents" - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_voice_agents_list_voice_agents_request( # pylint: disable=name-too-long - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - 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 = "/voice_agents" - - # 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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_voice_agents_get_voice_agent_request( # pylint: disable=name-too-long - agent_name: str, *, foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], **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 = "/voice_agents/{agent_name}" - path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_voice_agents_update_voice_agent_request( # pylint: disable=name-too-long - agent_name: str, *, foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/voice_agents/{agent_name}" - path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_voice_agents_delete_voice_agent_request( # pylint: disable=name-too-long - agent_name: str, *, foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], **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")) - # Construct URL - _url = "/voice_agents/{agent_name}" - path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_voice_agents_enable_voice_agent_request( # pylint: disable=name-too-long - agent_name: str, *, foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], **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")) - # Construct URL - _url = "/voice_agents/{agent_name}:enable" - path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_voice_agents_disable_voice_agent_request( # pylint: disable=name-too-long - agent_name: str, *, foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], **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")) - # Construct URL - _url = "/voice_agents/{agent_name}:disable" - path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_voice_agents_generate_voice_agent_request( # pylint: disable=name-too-long - *, foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/voice_agents:generate" - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_voice_agents_create_voice_agent_version_request( # pylint: disable=name-too-long - agent_name: str, *, foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/voice_agents/{agent_name}/versions" - path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_voice_agents_list_voice_agent_versions_request( # pylint: disable=name-too-long - agent_name: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - after: Optional[str] = None, - before: Optional[str] = None, - include_drafts: Optional[bool] = 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 = "/voice_agents/{agent_name}/versions" - 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") - if include_drafts is not None: - _params["include_drafts"] = _SERIALIZER.query("include_drafts", include_drafts, "bool") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_voice_agents_get_voice_agent_version_request( # pylint: disable=name-too-long - agent_name: str, - agent_version: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **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 = "/voice_agents/{agent_name}/versions/{agent_version}" - path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "agent_version": _SERIALIZER.url("agent_version", agent_version, "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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_voice_agents_delete_voice_agent_version_request( # pylint: disable=name-too-long - agent_name: str, - agent_version: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **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")) - # Construct URL - _url = "/voice_agents/{agent_name}/versions/{agent_version}" - path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "agent_version": _SERIALIZER.url("agent_version", agent_version, "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["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class AgentEndpointConversationsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.voiceagents.VoiceAgentsClient`'s - :attr:`agent_endpoint_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: VoiceAgentsClientConfiguration = 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 get_agent_conversation( - self, - agent_name: str, - conversation_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> _models.VoiceConversation: - """Get a voice agent conversation. - - Retrieves a single conversation recorded for the specified voice agent endpoint by its id. - Returns ``404`` when the conversation was not persisted (``store = false``) or does not exist. - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation to retrieve. Required. - :type conversation_id: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :return: VoiceConversation. The VoiceConversation is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceConversation - :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.VoiceConversation] = kwargs.pop("cls", None) - - _request = build_agent_endpoint_conversations_get_agent_conversation_request( - agent_name=agent_name, - conversation_id=conversation_id, - foundry_features=foundry_features, - 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.VoiceConversation, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete_agent_conversation( # pylint: disable=inconsistent-return-statements - self, - agent_name: str, - conversation_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> None: - """Delete a voice agent conversation. - - Deletes a conversation and all of its stored data — responses, items, and any audio (cascade). - This is the customer's explicit data-deletion control for voice conversations. - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation to delete. Required. - :type conversation_id: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :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_agent_endpoint_conversations_delete_agent_conversation_request( - agent_name=agent_name, - conversation_id=conversation_id, - foundry_features=foundry_features, - 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_agent_conversation_responses( - self, - agent_name: str, - conversation_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.VoiceResponse"]: - """List responses in a voice agent conversation. - - Returns a paged collection of the responses (model inference turns) recorded for the specified - conversation. The per-response ``output`` projection may be omitted here; use the - response-items route for the canonical paged output. Returns ``404`` when the conversation was - not persisted (``store = false``). - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation whose responses are listed. Required. - :type conversation_id: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :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.voiceagents.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 VoiceResponse - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.voiceagents.models.VoiceResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[list[_models.VoiceResponse]] = 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_agent_endpoint_conversations_list_agent_conversation_responses_request( - agent_name=agent_name, - conversation_id=conversation_id, - foundry_features=foundry_features, - 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.VoiceResponse], - 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_agent_conversation_response( - self, - agent_name: str, - conversation_id: str, - response_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> _models.VoiceResponse: - """Get a voice agent conversation response. - - Retrieves a single response from the specified conversation by its id, including its ``output`` - items, ``usage``, and status. Returns ``404`` when the conversation or response was not - persisted (``store = false``). - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the response. Required. - :type conversation_id: str - :param response_id: The id of the response to retrieve. Required. - :type response_id: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :return: VoiceResponse. The VoiceResponse is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceResponse - :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.VoiceResponse] = kwargs.pop("cls", None) - - _request = build_agent_endpoint_conversations_get_agent_conversation_response_request( - agent_name=agent_name, - conversation_id=conversation_id, - response_id=response_id, - foundry_features=foundry_features, - 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.VoiceResponse, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_agent_conversation_response_items( - self, - agent_name: str, - conversation_id: str, - response_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.VoiceConversationItem"]: - """List items produced by a voice agent conversation response. - - Returns a paged collection of the output items produced by a specific response (the response's - output projection). For the complete ordered conversation history — including user input and - client-created tool outputs — use the conversation items route instead. Returns ``404`` when - the conversation or response was not persisted (``store = false``). - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the response. Required. - :type conversation_id: str - :param response_id: The id of the response whose output items are listed. Required. - :type response_id: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :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.voiceagents.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 VoiceConversationItem - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.voiceagents.models.VoiceConversationItem] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[list[_models.VoiceConversationItem]] = 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_agent_endpoint_conversations_list_agent_conversation_response_items_request( - agent_name=agent_name, - conversation_id=conversation_id, - response_id=response_id, - foundry_features=foundry_features, - 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.VoiceConversationItem], - 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 list_agent_conversation_items( - self, - agent_name: str, - conversation_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.VoiceConversationItem"]: - """List items in a voice agent conversation. - - Returns a paged collection of items — the complete ordered conversation history, including user - input, assistant output, and client-created tool outputs (transcripts + tool events). Returns - ``404`` when the conversation was not persisted (``store = false``). - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation whose items are listed. Required. - :type conversation_id: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :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.voiceagents.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 VoiceConversationItem - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.voiceagents.models.VoiceConversationItem] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[list[_models.VoiceConversationItem]] = 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_agent_endpoint_conversations_list_agent_conversation_items_request( - agent_name=agent_name, - conversation_id=conversation_id, - foundry_features=foundry_features, - 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.VoiceConversationItem], - 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_agent_conversation_item( - self, - agent_name: str, - conversation_id: str, - item_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> _models.VoiceConversationItem: - """Get a voice agent conversation item. - - Retrieves a single item from the specified conversation by its id, including its transcript. An - ``input_audio``/``output_audio`` content part indicates that audio is available for the item; - the canonical per-item audio metadata is the ``/items/{item_id}/audio`` resource, and the bytes - are streamed by ``/items/{item_id}/audio/content``. Returns ``404`` when the conversation or - item was not persisted (``store = false``). - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the item. Required. - :type conversation_id: str - :param item_id: The id of the conversation item to retrieve. Required. - :type item_id: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :return: VoiceConversationItem. The VoiceConversationItem is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceConversationItem - :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.VoiceConversationItem] = kwargs.pop("cls", None) - - _request = build_agent_endpoint_conversations_get_agent_conversation_item_request( - agent_name=agent_name, - conversation_id=conversation_id, - item_id=item_id, - foundry_features=foundry_features, - 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.VoiceConversationItem, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_agent_conversation_item_audio( - self, - agent_name: str, - conversation_id: str, - item_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> _models.VoiceItemAudioResponse: - """Get a voice agent conversation item's audio metadata. - - Returns metadata for a single conversation item's audio segment, including the common playback - facts (role, format/codec, sample rate, channels, offset, duration) for both Foundry-managed - and bring-your-own-storage (BYOS) recordings; for BYOS the response additionally includes - ``blob_uri``, the URI of the recording in the customer's own storage (no SAS) that the customer - downloads with their own credentials. Requires the conversation to have persisted audio - (``store = true``); returns ``404`` when the conversation, item, or its audio was not - persisted. - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the item. Required. - :type conversation_id: str - :param item_id: The id of the conversation item whose audio metadata is retrieved. Required. - :type item_id: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :return: VoiceItemAudioResponse. The VoiceItemAudioResponse is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceItemAudioResponse - :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.VoiceItemAudioResponse] = kwargs.pop("cls", None) - - _request = build_agent_endpoint_conversations_get_agent_conversation_item_audio_request( - agent_name=agent_name, - conversation_id=conversation_id, - item_id=item_id, - foundry_features=foundry_features, - 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.VoiceItemAudioResponse, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_agent_conversation_item_audio_content( # pylint: disable=name-too-long - self, - agent_name: str, - conversation_id: str, - item_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> Iterator[bytes]: - """Stream a voice agent conversation item's audio. - - Streams a single conversation item's audio as a WAV (``audio/wav``) byte stream through the - service (no SAS URL). This route serves Foundry-managed storage only. For - bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download - directly from customer storage using the ``blob_uri`` returned by the item's ``/audio`` - metadata route — so this route returns ``409 Conflict`` for BYOS recordings. Returns ``404`` - when the conversation, item, or its audio was not persisted (``store = false``). - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the item. Required. - :type conversation_id: str - :param item_id: The id of the conversation item whose audio is streamed. Required. - :type item_id: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :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_agent_endpoint_conversations_get_agent_conversation_item_audio_content_request( - agent_name=agent_name, - conversation_id=conversation_id, - item_id=item_id, - foundry_features=foundry_features, - 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_agent_conversation_audio( - self, - agent_name: str, - conversation_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> _models.VoiceRecordingResponse: - """Get a voice agent conversation's merged recording metadata. - - Returns metadata for the whole-call merged stereo recording (user audio on the left channel, - agent audio on the right). The common metadata (format, sample rate, channels, channel layout, - duration) is returned for both Foundry-managed and bring-your-own-storage (BYOS) recordings; - for BYOS the response additionally includes ``blob_uri``, the URI of the recording in the - customer's own storage (no SAS) that the customer downloads with their own credentials. The - recording is built once from the per-turn segments after the session ends; a request against an - in-progress session returns ``409``. Requires the conversation to have persisted audio (``store - = true``); otherwise returns ``404``. - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation whose merged recording metadata is - retrieved. Required. - :type conversation_id: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :return: VoiceRecordingResponse. The VoiceRecordingResponse is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceRecordingResponse - :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.VoiceRecordingResponse] = kwargs.pop("cls", None) - - _request = build_agent_endpoint_conversations_get_agent_conversation_audio_request( - agent_name=agent_name, - conversation_id=conversation_id, - foundry_features=foundry_features, - 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.VoiceRecordingResponse, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_agent_conversation_audio_content( - self, - agent_name: str, - conversation_id: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> Iterator[bytes]: - """Stream a voice agent conversation's merged recording. - - Streams the whole-call merged stereo recording as a WAV (``audio/wav``) byte stream through the - service (no SAS URL). This route serves Foundry-managed storage only. For - bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download - directly from customer storage using the ``blob_uri`` returned by the metadata route — so this - route returns ``409 Conflict`` for BYOS recordings. A request against an in-progress session - also returns ``409`` (a distinct condition: session-not-ended versus BYOS-download-required). A - conversation without persisted audio (``store = false``) returns ``404``. - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation whose merged recording is streamed. - Required. - :type conversation_id: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :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_agent_endpoint_conversations_get_agent_conversation_audio_content_request( - agent_name=agent_name, - conversation_id=conversation_id, - foundry_features=foundry_features, - 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 VoiceAgentsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.voiceagents.VoiceAgentsClient`'s - :attr:`voice_agents` 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: VoiceAgentsClientConfiguration = 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") - - @overload - def create_voice_agent( - self, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - name: str, - definition: _models.VoiceAgentDefinition, - content_type: str = "application/json", - state: Optional[Union[str, _models.AgentState]] = None, - metadata: Optional[dict[str, str]] = None, - description: Optional[str] = None, - blueprint_reference: Optional[_models.AgentBlueprintReference] = None, - draft: Optional[bool] = None, - agent_endpoint: Optional[_models.AgentEndpointConfig] = None, - agent_card: Optional[_models.AgentCard] = None, - **kwargs: Any - ) -> _models.VoiceAgentObject: - """Create a voice agent. - - Creates a new voice agent, or a new version of an existing one. - - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword name: The unique name that identifies the agent. Name can be used to - retrieve/update/delete the agent. - - * Must start and end with alphanumeric characters, - * Can contain hyphens in the middle - * Must not exceed 63 characters. Required. - :paramtype name: str - :keyword definition: The voice agent definition. Required. - :paramtype definition: ~azure.ai.voiceagents.models.VoiceAgentDefinition - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword state: The initial operational state of the agent. Defaults to 'enabled' if not - specified. Known values are: "enabled" and "disabled". Default value is None. - :paramtype state: str or ~azure.ai.voiceagents.models.AgentState - :keyword 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. Default value is None. - :paramtype metadata: dict[str, str] - :keyword description: A human-readable description of the agent. Default value is None. - :paramtype description: str - :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. - :paramtype blueprint_reference: ~azure.ai.voiceagents.models.AgentBlueprintReference - :keyword draft: (Preview) Whether this agent version is a draft (candidate) rather than a - release. The service defaults to ``false`` if a value is not specified by the caller. Draft - versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. - Default value is None. - :paramtype draft: bool - :keyword agent_endpoint: An optional endpoint configuration. If not specified, a default - endpoint configuration will be set for the agent. Default value is None. - :paramtype agent_endpoint: ~azure.ai.voiceagents.models.AgentEndpointConfig - :keyword agent_card: Optional agent card for the agent. Default value is None. - :paramtype agent_card: ~azure.ai.voiceagents.models.AgentCard - :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_voice_agent( - self, - body: _types.CreateVoiceAgentRequest, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - content_type: str = "application/json", - **kwargs: Any - ) -> _models.VoiceAgentObject: - """Create a voice agent. - - Creates a new voice agent, or a new version of an existing one. - - :param body: Required. - :type body: ~azure.ai.voiceagents.types.CreateVoiceAgentRequest - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_voice_agent( - self, - body: IO[bytes], - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - content_type: str = "application/json", - **kwargs: Any - ) -> _models.VoiceAgentObject: - """Create a voice agent. - - Creates a new voice agent, or a new version of an existing one. - - :param body: Required. - :type body: IO[bytes] - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_voice_agent( # pylint: disable=too-many-locals - self, - body: Union[JSON, _types.CreateVoiceAgentRequest, IO[bytes]] = _Unset, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - name: str = _Unset, - definition: _models.VoiceAgentDefinition = _Unset, - state: Optional[Union[str, _models.AgentState]] = None, - metadata: Optional[dict[str, str]] = None, - description: Optional[str] = None, - blueprint_reference: Optional[_models.AgentBlueprintReference] = None, - draft: Optional[bool] = None, - agent_endpoint: Optional[_models.AgentEndpointConfig] = None, - agent_card: Optional[_models.AgentCard] = None, - **kwargs: Any - ) -> _models.VoiceAgentObject: - """Create a voice agent. - - Creates a new voice agent, or a new version of an existing one. - - :param body: Is one of the following types: JSON, CreateVoiceAgentRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.voiceagents.types.CreateVoiceAgentRequest or IO[bytes] - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword name: The unique name that identifies the agent. Name can be used to - retrieve/update/delete the agent. - - * Must start and end with alphanumeric characters, - * Can contain hyphens in the middle - * Must not exceed 63 characters. Required. - :paramtype name: str - :keyword definition: The voice agent definition. Required. - :paramtype definition: ~azure.ai.voiceagents.models.VoiceAgentDefinition - :keyword state: The initial operational state of the agent. Defaults to 'enabled' if not - specified. Known values are: "enabled" and "disabled". Default value is None. - :paramtype state: str or ~azure.ai.voiceagents.models.AgentState - :keyword 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. Default value is None. - :paramtype metadata: dict[str, str] - :keyword description: A human-readable description of the agent. Default value is None. - :paramtype description: str - :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. - :paramtype blueprint_reference: ~azure.ai.voiceagents.models.AgentBlueprintReference - :keyword draft: (Preview) Whether this agent version is a draft (candidate) rather than a - release. The service defaults to ``false`` if a value is not specified by the caller. Draft - versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. - Default value is None. - :paramtype draft: bool - :keyword agent_endpoint: An optional endpoint configuration. If not specified, a default - endpoint configuration will be set for the agent. Default value is None. - :paramtype agent_endpoint: ~azure.ai.voiceagents.models.AgentEndpointConfig - :keyword agent_card: Optional agent card for the agent. Default value is None. - :paramtype agent_card: ~azure.ai.voiceagents.models.AgentCard - :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject - :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.VoiceAgentObject] = kwargs.pop("cls", None) - - if body is _Unset: - if name is _Unset: - raise TypeError("missing required argument: name") - if definition is _Unset: - raise TypeError("missing required argument: definition") - body = { - "agent_card": agent_card, - "agent_endpoint": agent_endpoint, - "blueprint_reference": blueprint_reference, - "definition": definition, - "description": description, - "draft": draft, - "metadata": metadata, - "name": name, - "state": state, - } - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_voice_agents_create_voice_agent_request( - foundry_features=foundry_features, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - 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 [201]: - 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.VoiceAgentObject, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_voice_agents( - self, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.VoiceAgentObject"]: - """List voice agents. - - Returns a paged collection of voice agents. - - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :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.voiceagents.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 VoiceAgentObject - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.voiceagents.models.VoiceAgentObject] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[list[_models.VoiceAgentObject]] = 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_voice_agents_list_voice_agents_request( - foundry_features=foundry_features, - 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.VoiceAgentObject], - 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_voice_agent( - self, - agent_name: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> _models.VoiceAgentObject: - """Get a voice agent. - - Retrieves a voice agent by its unique name. - - :param agent_name: The name of the voice agent to retrieve. Required. - :type agent_name: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject - :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.VoiceAgentObject] = kwargs.pop("cls", None) - - _request = build_voice_agents_get_voice_agent_request( - agent_name=agent_name, - foundry_features=foundry_features, - 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.VoiceAgentObject, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def update_voice_agent( - self, - agent_name: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - definition: _models.VoiceAgentDefinition, - content_type: str = "application/json", - metadata: Optional[dict[str, str]] = None, - description: Optional[str] = None, - blueprint_reference: Optional[_models.AgentBlueprintReference] = None, - **kwargs: Any - ) -> _models.VoiceAgentObject: - """Update a voice agent. - - Updates a voice agent by adding a new version if there are any changes to the agent definition. - If no changes, returns the existing agent version. - - :param agent_name: The name of the voice agent to update. Required. - :type agent_name: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword definition: The voice agent definition. Required. - :paramtype definition: ~azure.ai.voiceagents.models.VoiceAgentDefinition - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword 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. Default value is None. - :paramtype metadata: dict[str, str] - :keyword description: A human-readable description of the agent. Default value is None. - :paramtype description: str - :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. - :paramtype blueprint_reference: ~azure.ai.voiceagents.models.AgentBlueprintReference - :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update_voice_agent( - self, - agent_name: str, - body: _types.UpdateVoiceAgentRequest, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - content_type: str = "application/json", - **kwargs: Any - ) -> _models.VoiceAgentObject: - """Update a voice agent. - - Updates a voice agent by adding a new version if there are any changes to the agent definition. - If no changes, returns the existing agent version. - - :param agent_name: The name of the voice agent to update. Required. - :type agent_name: str - :param body: Required. - :type body: ~azure.ai.voiceagents.types.UpdateVoiceAgentRequest - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update_voice_agent( - self, - agent_name: str, - body: IO[bytes], - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - content_type: str = "application/json", - **kwargs: Any - ) -> _models.VoiceAgentObject: - """Update a voice agent. - - Updates a voice agent by adding a new version if there are any changes to the agent definition. - If no changes, returns the existing agent version. - - :param agent_name: The name of the voice agent to update. Required. - :type agent_name: str - :param body: Required. - :type body: IO[bytes] - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update_voice_agent( - self, - agent_name: str, - body: Union[JSON, _types.UpdateVoiceAgentRequest, IO[bytes]] = _Unset, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - definition: _models.VoiceAgentDefinition = _Unset, - metadata: Optional[dict[str, str]] = None, - description: Optional[str] = None, - blueprint_reference: Optional[_models.AgentBlueprintReference] = None, - **kwargs: Any - ) -> _models.VoiceAgentObject: - """Update a voice agent. - - Updates a voice agent by adding a new version if there are any changes to the agent definition. - If no changes, returns the existing agent version. - - :param agent_name: The name of the voice agent to update. Required. - :type agent_name: str - :param body: Is one of the following types: JSON, UpdateVoiceAgentRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.voiceagents.types.UpdateVoiceAgentRequest or IO[bytes] - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword definition: The voice agent definition. Required. - :paramtype definition: ~azure.ai.voiceagents.models.VoiceAgentDefinition - :keyword 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. Default value is None. - :paramtype metadata: dict[str, str] - :keyword description: A human-readable description of the agent. Default value is None. - :paramtype description: str - :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. - :paramtype blueprint_reference: ~azure.ai.voiceagents.models.AgentBlueprintReference - :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject - :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.VoiceAgentObject] = kwargs.pop("cls", None) - - if body is _Unset: - if definition is _Unset: - raise TypeError("missing required argument: definition") - body = { - "blueprint_reference": blueprint_reference, - "definition": definition, - "description": description, - "metadata": metadata, - } - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_voice_agents_update_voice_agent_request( - agent_name=agent_name, - foundry_features=foundry_features, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - 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.VoiceAgentObject, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete_voice_agent( # pylint: disable=inconsistent-return-statements - self, - agent_name: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> None: - """Delete a voice agent. - - Deletes a voice agent and all of its versions. - - :param agent_name: The name of the voice agent to delete. Required. - :type agent_name: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :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_voice_agents_delete_voice_agent_request( - agent_name=agent_name, - foundry_features=foundry_features, - 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 enable_voice_agent( # pylint: disable=inconsistent-return-statements - self, - agent_name: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> None: - """Enable a voice agent. - - Enables the specified voice agent, allowing it to accept new requests. This operation is - idempotent — enabling an already-enabled voice agent returns success with no side effects. - - :param agent_name: The name of the voice agent to enable. Required. - :type agent_name: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :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_voice_agents_enable_voice_agent_request( - agent_name=agent_name, - foundry_features=foundry_features, - 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 disable_voice_agent( # pylint: disable=inconsistent-return-statements - self, - agent_name: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> None: - """Disable a voice agent. - - Disables the specified voice agent, preventing it from accepting new requests. This operation - is idempotent — disabling an already-disabled voice agent returns success with no side effects. - - :param agent_name: The name of the voice agent to disable. Required. - :type agent_name: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :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_voice_agents_disable_voice_agent_request( - agent_name=agent_name, - foundry_features=foundry_features, - 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 - - @overload - def generate_voice_agent( - self, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - name: str, - model_type: Union[str, _models.VoiceModelType], - model: str, - agent_type: Union[str, _models.VoiceAgentType], - use_case: Union[str, _models.VoiceAgentUseCase], - goal: str, - content_type: str = "application/json", - description: Optional[str] = None, - tools: Optional[list["_unions.VoiceAgentTool"]] = None, - draft: Optional[bool] = None, - **kwargs: Any - ) -> _models.VoiceAgentObject: - """Generate a voice agent. - - Generates and creates a voice agent from high-level inputs plus a natural-language goal. The - operation expands the goal into a full, editable definition, creates the agent through the - standard voice create path, and returns the created ``VoiceAgentObject``. The caller can edit - or override the generated fields afterward through normal versioning. - - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword name: The unique name for the agent to create. Required. - :paramtype name: str - :keyword model_type: How the model backing the generated agent is served: ``managed`` - (service-managed) or ``self_deployed`` (the customer's own deployment). Carried through to the - generated definition, not generated. Known values are: "managed" and "self_deployed". Required. - :paramtype model_type: str or ~azure.ai.voiceagents.models.VoiceModelType - :keyword model: The model paired with ``model_type``: the service-managed model name when - ``managed``, or the customer's Foundry deployment name when ``self_deployed``. Carried through, - not generated. Required. - :paramtype model: str - :keyword agent_type: The persona/tone to steer generation. Known values are: "personal" and - "business". Required. - :paramtype agent_type: str or ~azure.ai.voiceagents.models.VoiceAgentType - :keyword use_case: The scenario-template catalog entry the generator specializes for. Known - values are: "customer_support", "reception", "sales", "travel_assistant", "outreach", - "personal_assistant", "learning", "call_center", and "in_car". Required. - :paramtype use_case: str or ~azure.ai.voiceagents.models.VoiceAgentUseCase - :keyword goal: A natural-language description of what the agent should do; the seed for the - generated ``instructions``. Required. - :paramtype goal: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword description: An optional description for the agent. Generated from ``goal`` when - omitted. Default value is None. - :paramtype description: str - :keyword tools: Optional tools carried through verbatim onto the generated agent (see - ``VoiceAgentTool``). Default value is None. - :paramtype tools: list[~azure.ai.voiceagents.models.RealtimeFunctionTool or - ~azure.ai.voiceagents.models.VoiceAgentMcpTool or ~azure.ai.voiceagents.models.VoiceSystemTool - or ~azure.ai.voiceagents.models.VoiceToolboxTool] - :keyword draft: (Preview) When ``true``, the generated voice agent is created as a draft — an - editable, unpublished version the caller can review and refine before publishing it via the - standard create/version path. The service defaults to ``false`` if a value is not specified by - the caller, in which case the agent is created and published normally. Default value is None. - :paramtype draft: bool - :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def generate_voice_agent( - self, - body: _types.GenerateVoiceAgentRequest, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - content_type: str = "application/json", - **kwargs: Any - ) -> _models.VoiceAgentObject: - """Generate a voice agent. - - Generates and creates a voice agent from high-level inputs plus a natural-language goal. The - operation expands the goal into a full, editable definition, creates the agent through the - standard voice create path, and returns the created ``VoiceAgentObject``. The caller can edit - or override the generated fields afterward through normal versioning. - - :param body: Required. - :type body: ~azure.ai.voiceagents.types.GenerateVoiceAgentRequest - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def generate_voice_agent( - self, - body: IO[bytes], - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - content_type: str = "application/json", - **kwargs: Any - ) -> _models.VoiceAgentObject: - """Generate a voice agent. - - Generates and creates a voice agent from high-level inputs plus a natural-language goal. The - operation expands the goal into a full, editable definition, creates the agent through the - standard voice create path, and returns the created ``VoiceAgentObject``. The caller can edit - or override the generated fields afterward through normal versioning. - - :param body: Required. - :type body: IO[bytes] - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def generate_voice_agent( # pylint: disable=too-many-locals - self, - body: Union[JSON, _types.GenerateVoiceAgentRequest, IO[bytes]] = _Unset, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - name: str = _Unset, - model_type: Union[str, _models.VoiceModelType] = _Unset, - model: str = _Unset, - agent_type: Union[str, _models.VoiceAgentType] = _Unset, - use_case: Union[str, _models.VoiceAgentUseCase] = _Unset, - goal: str = _Unset, - description: Optional[str] = None, - tools: Optional[list["_unions.VoiceAgentTool"]] = None, - draft: Optional[bool] = None, - **kwargs: Any - ) -> _models.VoiceAgentObject: - """Generate a voice agent. - - Generates and creates a voice agent from high-level inputs plus a natural-language goal. The - operation expands the goal into a full, editable definition, creates the agent through the - standard voice create path, and returns the created ``VoiceAgentObject``. The caller can edit - or override the generated fields afterward through normal versioning. - - :param body: Is one of the following types: JSON, GenerateVoiceAgentRequest, IO[bytes] - Required. - :type body: JSON or ~azure.ai.voiceagents.types.GenerateVoiceAgentRequest or IO[bytes] - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword name: The unique name for the agent to create. Required. - :paramtype name: str - :keyword model_type: How the model backing the generated agent is served: ``managed`` - (service-managed) or ``self_deployed`` (the customer's own deployment). Carried through to the - generated definition, not generated. Known values are: "managed" and "self_deployed". Required. - :paramtype model_type: str or ~azure.ai.voiceagents.models.VoiceModelType - :keyword model: The model paired with ``model_type``: the service-managed model name when - ``managed``, or the customer's Foundry deployment name when ``self_deployed``. Carried through, - not generated. Required. - :paramtype model: str - :keyword agent_type: The persona/tone to steer generation. Known values are: "personal" and - "business". Required. - :paramtype agent_type: str or ~azure.ai.voiceagents.models.VoiceAgentType - :keyword use_case: The scenario-template catalog entry the generator specializes for. Known - values are: "customer_support", "reception", "sales", "travel_assistant", "outreach", - "personal_assistant", "learning", "call_center", and "in_car". Required. - :paramtype use_case: str or ~azure.ai.voiceagents.models.VoiceAgentUseCase - :keyword goal: A natural-language description of what the agent should do; the seed for the - generated ``instructions``. Required. - :paramtype goal: str - :keyword description: An optional description for the agent. Generated from ``goal`` when - omitted. Default value is None. - :paramtype description: str - :keyword tools: Optional tools carried through verbatim onto the generated agent (see - ``VoiceAgentTool``). Default value is None. - :paramtype tools: list[~azure.ai.voiceagents.models.RealtimeFunctionTool or - ~azure.ai.voiceagents.models.VoiceAgentMcpTool or ~azure.ai.voiceagents.models.VoiceSystemTool - or ~azure.ai.voiceagents.models.VoiceToolboxTool] - :keyword draft: (Preview) When ``true``, the generated voice agent is created as a draft — an - editable, unpublished version the caller can review and refine before publishing it via the - standard create/version path. The service defaults to ``false`` if a value is not specified by - the caller, in which case the agent is created and published normally. Default value is None. - :paramtype draft: bool - :return: VoiceAgentObject. The VoiceAgentObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentObject - :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.VoiceAgentObject] = kwargs.pop("cls", None) - - if body is _Unset: - if name is _Unset: - raise TypeError("missing required argument: name") - if model_type is _Unset: - raise TypeError("missing required argument: model_type") - if model is _Unset: - raise TypeError("missing required argument: model") - if agent_type is _Unset: - raise TypeError("missing required argument: agent_type") - if use_case is _Unset: - raise TypeError("missing required argument: use_case") - if goal is _Unset: - raise TypeError("missing required argument: goal") - body = { - "agent_type": agent_type, - "description": description, - "draft": draft, - "goal": goal, - "model": model, - "model_type": model_type, - "name": name, - "tools": tools, - "use_case": use_case, - } - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_voice_agents_generate_voice_agent_request( - foundry_features=foundry_features, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - 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.VoiceAgentObject, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_voice_agent_version( - self, - agent_name: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - definition: _models.VoiceAgentDefinition, - content_type: str = "application/json", - metadata: Optional[dict[str, str]] = None, - description: Optional[str] = None, - blueprint_reference: Optional[_models.AgentBlueprintReference] = None, - draft: Optional[bool] = None, - **kwargs: Any - ) -> _models.VoiceAgentVersionObject: - """Create a voice agent version. - - Creates a new version for the specified voice agent and returns the created version resource. - - :param agent_name: The name of the voice agent. Required. - :type agent_name: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword definition: The voice agent definition. Required. - :paramtype definition: ~azure.ai.voiceagents.models.VoiceAgentDefinition - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword 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. Default value is None. - :paramtype metadata: dict[str, str] - :keyword description: A human-readable description of the agent. Default value is None. - :paramtype description: str - :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. - :paramtype blueprint_reference: ~azure.ai.voiceagents.models.AgentBlueprintReference - :keyword draft: (Preview) Whether this agent version is a draft (candidate) rather than a - release. The service defaults to ``false`` if a value is not specified by the caller. Draft - versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. - Default value is None. - :paramtype draft: bool - :return: VoiceAgentVersionObject. The VoiceAgentVersionObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentVersionObject - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_voice_agent_version( - self, - agent_name: str, - body: _types.CreateVoiceAgentVersionRequest, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - content_type: str = "application/json", - **kwargs: Any - ) -> _models.VoiceAgentVersionObject: - """Create a voice agent version. - - Creates a new version for the specified voice agent and returns the created version resource. - - :param agent_name: The name of the voice agent. Required. - :type agent_name: str - :param body: Required. - :type body: ~azure.ai.voiceagents.types.CreateVoiceAgentVersionRequest - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: VoiceAgentVersionObject. The VoiceAgentVersionObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentVersionObject - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_voice_agent_version( - self, - agent_name: str, - body: IO[bytes], - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - content_type: str = "application/json", - **kwargs: Any - ) -> _models.VoiceAgentVersionObject: - """Create a voice agent version. - - Creates a new version for the specified voice agent and returns the created version resource. - - :param agent_name: The name of the voice agent. Required. - :type agent_name: str - :param body: Required. - :type body: IO[bytes] - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: VoiceAgentVersionObject. The VoiceAgentVersionObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentVersionObject - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_voice_agent_version( - self, - agent_name: str, - body: Union[JSON, _types.CreateVoiceAgentVersionRequest, IO[bytes]] = _Unset, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - definition: _models.VoiceAgentDefinition = _Unset, - metadata: Optional[dict[str, str]] = None, - description: Optional[str] = None, - blueprint_reference: Optional[_models.AgentBlueprintReference] = None, - draft: Optional[bool] = None, - **kwargs: Any - ) -> _models.VoiceAgentVersionObject: - """Create a voice agent version. - - Creates a new version for the specified voice agent and returns the created version resource. - - :param agent_name: The name of the voice agent. Required. - :type agent_name: str - :param body: Is one of the following types: JSON, CreateVoiceAgentVersionRequest, IO[bytes] - Required. - :type body: JSON or ~azure.ai.voiceagents.types.CreateVoiceAgentVersionRequest or IO[bytes] - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :keyword definition: The voice agent definition. Required. - :paramtype definition: ~azure.ai.voiceagents.models.VoiceAgentDefinition - :keyword 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. Default value is None. - :paramtype metadata: dict[str, str] - :keyword description: A human-readable description of the agent. Default value is None. - :paramtype description: str - :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. - :paramtype blueprint_reference: ~azure.ai.voiceagents.models.AgentBlueprintReference - :keyword draft: (Preview) Whether this agent version is a draft (candidate) rather than a - release. The service defaults to ``false`` if a value is not specified by the caller. Draft - versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. - Default value is None. - :paramtype draft: bool - :return: VoiceAgentVersionObject. The VoiceAgentVersionObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentVersionObject - :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.VoiceAgentVersionObject] = kwargs.pop("cls", None) - - if body is _Unset: - if definition is _Unset: - raise TypeError("missing required argument: definition") - body = { - "blueprint_reference": blueprint_reference, - "definition": definition, - "description": description, - "draft": draft, - "metadata": metadata, - } - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_voice_agents_create_voice_agent_version_request( - agent_name=agent_name, - foundry_features=foundry_features, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - 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.VoiceAgentVersionObject, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_voice_agent_versions( - self, - agent_name: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, - include_drafts: Optional[bool] = None, - **kwargs: Any - ) -> ItemPaged["_models.VoiceAgentVersionObject"]: - """List voice agent versions. - - Returns a paged collection of versions for the specified voice agent. - - :param agent_name: The name of the voice agent to retrieve versions for. Required. - :type agent_name: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :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.voiceagents.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 - :keyword include_drafts: (Preview) Whether to include draft versions in the listing. The - service defaults to ``false`` if a value is not specified by the caller (only non-draft - versions are returned). Default value is None. - :paramtype include_drafts: bool - :return: An iterator like instance of VoiceAgentVersionObject - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.voiceagents.models.VoiceAgentVersionObject] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[list[_models.VoiceAgentVersionObject]] = 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_voice_agents_list_voice_agent_versions_request( - agent_name=agent_name, - foundry_features=foundry_features, - limit=limit, - order=order, - after=_continuation_token, - before=before, - include_drafts=include_drafts, - 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.VoiceAgentVersionObject], - 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_voice_agent_version( - self, - agent_name: str, - agent_version: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> _models.VoiceAgentVersionObject: - """Get a voice agent version. - - Retrieves the specified version of a voice agent by its agent name and version identifier. - - :param agent_name: The name of the voice agent to retrieve. Required. - :type agent_name: str - :param agent_version: The version of the voice agent to retrieve. Required. - :type agent_version: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :return: VoiceAgentVersionObject. The VoiceAgentVersionObject is compatible with MutableMapping - :rtype: ~azure.ai.voiceagents.models.VoiceAgentVersionObject - :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.VoiceAgentVersionObject] = kwargs.pop("cls", None) - - _request = build_voice_agents_get_voice_agent_version_request( - agent_name=agent_name, - agent_version=agent_version, - foundry_features=foundry_features, - 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.VoiceAgentVersionObject, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete_voice_agent_version( # pylint: disable=inconsistent-return-statements - self, - agent_name: str, - agent_version: str, - *, - foundry_features: Literal[AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW], - **kwargs: Any - ) -> None: - """Delete a voice agent version. - - Deletes a specific version of a voice agent. - - :param agent_name: The name of the voice agent to delete. Required. - :type agent_name: str - :param agent_version: The version of the voice agent to delete. Required. - :type agent_version: str - :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. VOICE_AGENTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.voiceagents.models.VOICE_AGENTS_V1_PREVIEW - :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_voice_agents_delete_voice_agent_version_request( - agent_name=agent_name, - agent_version=agent_version, - foundry_features=foundry_features, - 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 diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/_patch.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/_patch.py deleted file mode 100644 index 87676c65a8f0..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/operations/_patch.py +++ /dev/null @@ -1,21 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------- -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" - - -__all__: list[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/py.typed b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/types.py b/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/types.py deleted file mode 100644 index 32c498a13f7d..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/azure/ai/voiceagents/types.py +++ /dev/null @@ -1,6717 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, Literal, Optional, TYPE_CHECKING, Union -from typing_extensions import Required, TypedDict - -from .models._enums import ( - AgentBlueprintReferenceType, - AgentEndpointAuthorizationSchemeType, - AzureVoiceType, - CreateTranscriptionResponseJsonUsageType, - RealtimeClientEventType, - RealtimeConversationItemMessageType, - RealtimeConversationItemType, - RealtimeMcpErrorType, - RealtimeServerEventType, - ToolChoiceParamType, - ToolType, - VersionSelectorType, - VoiceConversationItemType, - VoiceEndOfUtteranceDetectionModel, - VoiceTurnDetectionType, -) - -if TYPE_CHECKING: - from . import _unions - from .models import ( - AgentState, - AzureRealtimeNativeVoiceName, - CallableToolAllowedCaller, - PersonalVoiceModel, - RealtimeReasoningEffort, - ToolChoiceOptions, - VoiceAgentAnimationOutputType, - VoiceAgentAvatarOutputProtocol, - VoiceAgentAvatarType, - VoiceAgentAzureSemanticVadType, - VoiceAgentEchoCancellationReferenceSource, - VoiceAgentEndOfUtteranceModel, - VoiceAgentEndOfUtteranceThresholdLevel, - VoiceAgentEstimatedCostStatus, - VoiceAgentFileSearchCallStatus, - VoiceAgentHandoffAbortReason, - VoiceAgentHandoffReasoningEffort, - VoiceAgentHandoffTargetResponse, - VoiceAgentInterimResponseTrigger, - VoiceAgentMcpResponseScheduling, - VoiceAgentPipelineFamily, - VoiceAgentResponseAudioFormat, - VoiceAgentResponseStatus, - VoiceAgentSessionIncludeOption, - VoiceAgentType, - VoiceAgentUseCase, - VoiceAgentWebSearchCallStatus, - VoiceAudioFormatType, - VoiceAudioTimestampType, - VoiceAvatarOutputProtocol, - VoiceAvatarType, - VoiceEndOfUtteranceThresholdLevel, - VoiceGreetingToolChoice, - VoiceIdsShared, - VoiceInputTranscriptionModel, - VoiceModelType, - VoiceNoiseReductionType, - VoiceOutputModality, - VoiceSystemToolName, - ) - - -class A2AProtocolConfiguration(TypedDict, total=False): - """Configuration specific to the A2A protocol.""" - - -class ActivityProtocolConfiguration(TypedDict, total=False): - """Configuration specific to the activity protocol. - - :ivar enable_m365_public_endpoint: Whether to enable the M365 public endpoint for the activity - protocol. - :vartype enable_m365_public_endpoint: bool - """ - - enable_m365_public_endpoint: bool - """Whether to enable the M365 public endpoint for the activity protocol.""" - - -class AgentCard(TypedDict, total=False): - """AgentCard. - - :ivar version: The version of the agent card. Required. - :vartype version: str - :ivar description: The description of the agent card. - :vartype description: str - :ivar skills: The set of skills that an agent can perform. Required. - :vartype skills: list["AgentCardSkill"] - """ - - version: Required[str] - """The version of the agent card. Required.""" - description: str - """The description of the agent card.""" - skills: Required[list["AgentCardSkill"]] - """The set of skills that an agent can perform. Required.""" - - -class AgentCardSkill(TypedDict, total=False): - """AgentCardSkill. - - :ivar id: a unique identifier for the skill. Required. - :vartype id: str - :ivar name: The name of the skill. Required. - :vartype name: str - :ivar description: A description of the skill. - :vartype description: str - :ivar tags: set of tagwords describing classes of capabilities for the skill. - :vartype tags: list[str] - :ivar examples: A list of example scenarios that the skill can perform. - :vartype examples: list[str] - """ - - id: Required[str] - """a unique identifier for the skill. Required.""" - name: Required[str] - """The name of the skill. Required.""" - description: str - """A description of the skill.""" - tags: list[str] - """set of tagwords describing classes of capabilities for the skill.""" - examples: list[str] - """A list of example scenarios that the skill can perform.""" - - -class AgentEndpointConfig(TypedDict, total=False): - """AgentEndpointConfig. - - :ivar version_selector: The version selector of the agent endpoint determines how traffic is - routed to different versions of the agent. - :vartype version_selector: "VersionSelector" - :ivar protocol_configuration: Per-protocol configuration for the agent endpoint. - :vartype protocol_configuration: "ProtocolConfiguration" - :ivar authorization_schemes: The authorization schemes supported by the agent endpoint. - :vartype authorization_schemes: list["AgentEndpointAuthorizationScheme"] - """ - - version_selector: "VersionSelector" - """The version selector of the agent endpoint determines how traffic is routed to different - versions of the agent.""" - protocol_configuration: "ProtocolConfiguration" - """Per-protocol configuration for the agent endpoint.""" - authorization_schemes: list["AgentEndpointAuthorizationScheme"] - """The authorization schemes supported by the agent endpoint.""" - - -class AzureAvatarVoiceSyncVoice(TypedDict, total=False): - """An Azure avatar voice-synchronization configuration. The runtime derives its voice name from - the avatar character and style. - - :ivar temperature: The synthesis temperature, from 0 to 1. - :vartype temperature: float - :ivar custom_lexicon_url: The URL of a custom pronunciation lexicon. - :vartype custom_lexicon_url: str - :ivar custom_text_normalization_url: The URL of a custom text-normalization service. - :vartype custom_text_normalization_url: str - :ivar prefer_locales: Preferred BCP-47 locales that influence language accents. - :vartype prefer_locales: list[str] - :ivar locale: The enforced BCP-47 locale. When omitted, the language is detected from the text. - :vartype locale: str - :ivar style: The speaking style, such as ``cheerful`` or ``sad``. - :vartype style: str - :ivar pitch: The SSML-compatible pitch adjustment, such as ``+5%``. - :vartype pitch: str - :ivar rate: The SSML-compatible speaking-rate adjustment, such as ``+10%``. - :vartype rate: str - :ivar volume: The SSML-compatible volume adjustment, such as ``+10`` or ``-6dB``. - :vartype volume: str - :ivar type: Required. An Azure avatar voice-synchronization voice. - :vartype type: Literal[AzureVoiceType.AVATAR_VOICE_SYNC] - :ivar model: The neural model used to synthesize the avatar voice. Required. Known values are: - "DragonLatestNeural", "DragonHDOmniLatestNeural", and "MAI-Voice". - :vartype model: Union[str, "PersonalVoiceModel"] - """ - - temperature: float - """The synthesis temperature, from 0 to 1.""" - custom_lexicon_url: str - """The URL of a custom pronunciation lexicon.""" - custom_text_normalization_url: str - """The URL of a custom text-normalization service.""" - prefer_locales: list[str] - """Preferred BCP-47 locales that influence language accents.""" - locale: str - """The enforced BCP-47 locale. When omitted, the language is detected from the text.""" - style: str - """The speaking style, such as ``cheerful`` or ``sad``.""" - pitch: str - """The SSML-compatible pitch adjustment, such as ``+5%``.""" - rate: str - """The SSML-compatible speaking-rate adjustment, such as ``+10%``.""" - volume: str - """The SSML-compatible volume adjustment, such as ``+10`` or ``-6dB``.""" - type: Required[Literal[AzureVoiceType.AVATAR_VOICE_SYNC]] - """Required. An Azure avatar voice-synchronization voice.""" - model: Required[Union[str, "PersonalVoiceModel"]] - """The neural model used to synthesize the avatar voice. Required. Known values are: - \"DragonLatestNeural\", \"DragonHDOmniLatestNeural\", and \"MAI-Voice\".""" - - -class AzureCustomVoice(TypedDict, total=False): - """An Azure custom neural voice configuration. - - :ivar temperature: The synthesis temperature, from 0 to 1. - :vartype temperature: float - :ivar custom_lexicon_url: The URL of a custom pronunciation lexicon. - :vartype custom_lexicon_url: str - :ivar custom_text_normalization_url: The URL of a custom text-normalization service. - :vartype custom_text_normalization_url: str - :ivar prefer_locales: Preferred BCP-47 locales that influence language accents. - :vartype prefer_locales: list[str] - :ivar locale: The enforced BCP-47 locale. When omitted, the language is detected from the text. - :vartype locale: str - :ivar style: The speaking style, such as ``cheerful`` or ``sad``. - :vartype style: str - :ivar pitch: The SSML-compatible pitch adjustment, such as ``+5%``. - :vartype pitch: str - :ivar rate: The SSML-compatible speaking-rate adjustment, such as ``+10%``. - :vartype rate: str - :ivar volume: The SSML-compatible volume adjustment, such as ``+10`` or ``-6dB``. - :vartype volume: str - :ivar type: Required. An Azure custom neural voice. - :vartype type: Literal[AzureVoiceType.AZURE_CUSTOM] - :ivar name: The custom voice name. Required. - :vartype name: str - :ivar endpoint_id: The Azure Speech custom voice deployment endpoint ID. Required. - :vartype endpoint_id: str - """ - - temperature: float - """The synthesis temperature, from 0 to 1.""" - custom_lexicon_url: str - """The URL of a custom pronunciation lexicon.""" - custom_text_normalization_url: str - """The URL of a custom text-normalization service.""" - prefer_locales: list[str] - """Preferred BCP-47 locales that influence language accents.""" - locale: str - """The enforced BCP-47 locale. When omitted, the language is detected from the text.""" - style: str - """The speaking style, such as ``cheerful`` or ``sad``.""" - pitch: str - """The SSML-compatible pitch adjustment, such as ``+5%``.""" - rate: str - """The SSML-compatible speaking-rate adjustment, such as ``+10%``.""" - volume: str - """The SSML-compatible volume adjustment, such as ``+10`` or ``-6dB``.""" - type: Required[Literal[AzureVoiceType.AZURE_CUSTOM]] - """Required. An Azure custom neural voice.""" - name: Required[str] - """The custom voice name. Required.""" - endpoint_id: Required[str] - """The Azure Speech custom voice deployment endpoint ID. Required.""" - - -class AzurePersonalVoice(TypedDict, total=False): - """An Azure personal voice configuration. - - :ivar temperature: The synthesis temperature, from 0 to 1. - :vartype temperature: float - :ivar custom_lexicon_url: The URL of a custom pronunciation lexicon. - :vartype custom_lexicon_url: str - :ivar custom_text_normalization_url: The URL of a custom text-normalization service. - :vartype custom_text_normalization_url: str - :ivar prefer_locales: Preferred BCP-47 locales that influence language accents. - :vartype prefer_locales: list[str] - :ivar locale: The enforced BCP-47 locale. When omitted, the language is detected from the text. - :vartype locale: str - :ivar style: The speaking style, such as ``cheerful`` or ``sad``. - :vartype style: str - :ivar pitch: The SSML-compatible pitch adjustment, such as ``+5%``. - :vartype pitch: str - :ivar rate: The SSML-compatible speaking-rate adjustment, such as ``+10%``. - :vartype rate: str - :ivar volume: The SSML-compatible volume adjustment, such as ``+10`` or ``-6dB``. - :vartype volume: str - :ivar type: Required. An Azure personal voice. - :vartype type: Literal[AzureVoiceType.AZURE_PERSONAL] - :ivar name: The personal voice name. Required. - :vartype name: str - :ivar model: The neural model used by the personal voice. Required. Known values are: - "DragonLatestNeural", "DragonHDOmniLatestNeural", and "MAI-Voice". - :vartype model: Union[str, "PersonalVoiceModel"] - """ - - temperature: float - """The synthesis temperature, from 0 to 1.""" - custom_lexicon_url: str - """The URL of a custom pronunciation lexicon.""" - custom_text_normalization_url: str - """The URL of a custom text-normalization service.""" - prefer_locales: list[str] - """Preferred BCP-47 locales that influence language accents.""" - locale: str - """The enforced BCP-47 locale. When omitted, the language is detected from the text.""" - style: str - """The speaking style, such as ``cheerful`` or ``sad``.""" - pitch: str - """The SSML-compatible pitch adjustment, such as ``+5%``.""" - rate: str - """The SSML-compatible speaking-rate adjustment, such as ``+10%``.""" - volume: str - """The SSML-compatible volume adjustment, such as ``+10`` or ``-6dB``.""" - type: Required[Literal[AzureVoiceType.AZURE_PERSONAL]] - """Required. An Azure personal voice.""" - name: Required[str] - """The personal voice name. Required.""" - model: Required[Union[str, "PersonalVoiceModel"]] - """The neural model used by the personal voice. Required. Known values are: - \"DragonLatestNeural\", \"DragonHDOmniLatestNeural\", and \"MAI-Voice\".""" - - -class AzureRealtimeNativeVoice(TypedDict, total=False): - """An Azure realtime-native voice configuration. - - :ivar type: The voice kind. Always ``azure-realtime-native``. Required. Default value is - "azure-realtime-native". - :vartype type: Literal["azure-realtime-native"] - :ivar name: The Azure realtime-native voice name. Required. Known values are: "aarti", - "alvaro", "andrew", "antonio", "ava", "clara", "dalia", "denise", "diego", "diya", "elsa", - "emma", "florian", "francisca", "hyunsu", "jorge", "keita", "liam", "meera", "nanami", - "natasha", "niwat", "premwadee", "remy", "ryan", "seraphina", "sonia", "sunhi", "sylvie", - "thierry", "william", "xiaoxiao", "ximena", and "yunxi". - :vartype name: Union[str, "AzureRealtimeNativeVoiceName"] - """ - - type: Required[Literal["azure-realtime-native"]] - """The voice kind. Always ``azure-realtime-native``. Required. Default value is - \"azure-realtime-native\".""" - name: Required[Union[str, "AzureRealtimeNativeVoiceName"]] - """The Azure realtime-native voice name. Required. Known values are: \"aarti\", \"alvaro\", - \"andrew\", \"antonio\", \"ava\", \"clara\", \"dalia\", \"denise\", \"diego\", \"diya\", - \"elsa\", \"emma\", \"florian\", \"francisca\", \"hyunsu\", \"jorge\", \"keita\", \"liam\", - \"meera\", \"nanami\", \"natasha\", \"niwat\", \"premwadee\", \"remy\", \"ryan\", - \"seraphina\", \"sonia\", \"sunhi\", \"sylvie\", \"thierry\", \"william\", \"xiaoxiao\", - \"ximena\", and \"yunxi\".""" - - -class AzureStandardVoice(TypedDict, total=False): - """An Azure standard neural voice configuration. - - :ivar temperature: The synthesis temperature, from 0 to 1. - :vartype temperature: float - :ivar custom_lexicon_url: The URL of a custom pronunciation lexicon. - :vartype custom_lexicon_url: str - :ivar custom_text_normalization_url: The URL of a custom text-normalization service. - :vartype custom_text_normalization_url: str - :ivar prefer_locales: Preferred BCP-47 locales that influence language accents. - :vartype prefer_locales: list[str] - :ivar locale: The enforced BCP-47 locale. When omitted, the language is detected from the text. - :vartype locale: str - :ivar style: The speaking style, such as ``cheerful`` or ``sad``. - :vartype style: str - :ivar pitch: The SSML-compatible pitch adjustment, such as ``+5%``. - :vartype pitch: str - :ivar rate: The SSML-compatible speaking-rate adjustment, such as ``+10%``. - :vartype rate: str - :ivar volume: The SSML-compatible volume adjustment, such as ``+10`` or ``-6dB``. - :vartype volume: str - :ivar type: Required. An Azure standard neural voice. - :vartype type: Literal[AzureVoiceType.AZURE_STANDARD] - :ivar name: The Azure neural voice name. Required. - :vartype name: str - :ivar multi_talker_speaker_name: The speaker name used by a multi-talker voice. - :vartype multi_talker_speaker_name: str - """ - - temperature: float - """The synthesis temperature, from 0 to 1.""" - custom_lexicon_url: str - """The URL of a custom pronunciation lexicon.""" - custom_text_normalization_url: str - """The URL of a custom text-normalization service.""" - prefer_locales: list[str] - """Preferred BCP-47 locales that influence language accents.""" - locale: str - """The enforced BCP-47 locale. When omitted, the language is detected from the text.""" - style: str - """The speaking style, such as ``cheerful`` or ``sad``.""" - pitch: str - """The SSML-compatible pitch adjustment, such as ``+5%``.""" - rate: str - """The SSML-compatible speaking-rate adjustment, such as ``+10%``.""" - volume: str - """The SSML-compatible volume adjustment, such as ``+10`` or ``-6dB``.""" - type: Required[Literal[AzureVoiceType.AZURE_STANDARD]] - """Required. An Azure standard neural voice.""" - name: Required[str] - """The Azure neural voice name. Required.""" - multi_talker_speaker_name: str - """The speaker name used by a multi-talker voice.""" - - -class BotServiceAuthorizationScheme(TypedDict, total=False): - """BotServiceAuthorizationScheme. - - :ivar type: Required. BOT_SERVICE. - :vartype type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE] - """ - - type: Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE]] - """Required. BOT_SERVICE.""" - - -class BotServiceRbacAuthorizationScheme(TypedDict, total=False): - """BotServiceRbacAuthorizationScheme. - - :ivar type: Required. BOT_SERVICE_RBAC. - :vartype type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC] - """ - - type: Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC]] - """Required. BOT_SERVICE_RBAC.""" - - -class BotServiceTenantAuthorizationScheme(TypedDict, total=False): - """BotServiceTenantAuthorizationScheme. - - :ivar type: Required. BOT_SERVICE_TENANT. - :vartype type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT] - """ - - type: Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT]] - """Required. BOT_SERVICE_TENANT.""" - - -class EntraAuthorizationScheme(TypedDict, total=False): - """EntraAuthorizationScheme. - - :ivar type: Required. ENTRA. - :vartype type: Literal[AgentEndpointAuthorizationSchemeType.ENTRA] - """ - - type: Required[Literal[AgentEndpointAuthorizationSchemeType.ENTRA]] - """Required. ENTRA.""" - - -class FixedRatioVersionSelectionRule(TypedDict, total=False): - """FixedRatioVersionSelectionRule. - - :ivar agent_version: The agent version to route traffic to. Required. - :vartype agent_version: str - :ivar type: Required. FIXED_RATIO. - :vartype type: Literal[VersionSelectorType.FIXED_RATIO] - :ivar traffic_percentage: The percentage of traffic to route to the version. Must be between 0 - and 100. Required. - :vartype traffic_percentage: int - """ - - agent_version: Required[str] - """The agent version to route traffic to. Required.""" - type: Required[Literal[VersionSelectorType.FIXED_RATIO]] - """Required. FIXED_RATIO.""" - traffic_percentage: Required[int] - """The percentage of traffic to route to the version. Must be between 0 and 100. Required.""" - - -class InvocationsProtocolConfiguration(TypedDict, total=False): - """Configuration specific to the invocations protocol.""" - - -class InvocationsWsProtocolConfiguration(TypedDict, total=False): - """Configuration specific to the WebSocket-based invocations protocol.""" - - -class LlmGeneratedVoiceGreetingConfig(TypedDict, total=False): - """A greeting authored by the session model from a scoped opening-turn prompt. - - :ivar type: Required. Default value is "llm_generated". - :vartype type: Literal["llm_generated"] - :ivar prompt: The Handlebars prompt that guides the opening turn. Required. - :vartype prompt: str - :ivar fallback_text: The optional Handlebars text template synthesized when generation fails - before any greeting output. - :vartype fallback_text: str - :ivar tool_choice: The tool-selection policy for the opening response. Defaults to ``none``. - Known values are: "none", "auto", and "required". - :vartype tool_choice: Union[str, "VoiceGreetingToolChoice"] - """ - - type: Required[Literal["llm_generated"]] - """Required. Default value is \"llm_generated\".""" - prompt: Required[str] - """The Handlebars prompt that guides the opening turn. Required.""" - fallback_text: str - """The optional Handlebars text template synthesized when generation fails before any greeting - output.""" - tool_choice: Union[str, "VoiceGreetingToolChoice"] - """The tool-selection policy for the opening response. Defaults to ``none``. Known values are: - \"none\", \"auto\", and \"required\".""" - - -class LogProbProperties(TypedDict, total=False): - """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: Required[str] - """The token that was used to generate the log probability. Required.""" - logprob: Required[float] - """The log probability of the token. Required.""" - bytes: Required[list[int]] - """The bytes that were used to generate the log probability. Required.""" - - -class ManagedAgentIdentityBlueprintReference(TypedDict, total=False): - """ManagedAgentIdentityBlueprintReference. - - :ivar type: Required. MANAGED_AGENT_IDENTITY_BLUEPRINT. - :vartype type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] - :ivar blueprint_id: The ID of the managed blueprint. Required. - :vartype blueprint_id: str - """ - - type: Required[Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT]] - """Required. MANAGED_AGENT_IDENTITY_BLUEPRINT.""" - blueprint_id: Required[str] - """The ID of the managed blueprint. Required.""" - - -class MCPListToolsTool(TypedDict, total=False): - """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: "MCPListToolsToolInputSchema" - :ivar annotations: - :vartype annotations: "MCPListToolsToolAnnotations" - """ - - name: Required[str] - """The name of the tool. Required.""" - description: Optional[str] - input_schema: Required["MCPListToolsToolInputSchema"] - """The JSON schema describing the tool's input. Required.""" - annotations: Optional["MCPListToolsToolAnnotations"] - - -class MCPListToolsToolAnnotations(TypedDict, total=False): - """MCPListToolsToolAnnotations.""" - - -class MCPListToolsToolInputSchema(TypedDict, total=False): - """MCPListToolsToolInputSchema.""" - - -class McpProtocolConfiguration(TypedDict, total=False): - """Configuration specific to the MCP protocol.""" - - -class MCPTool(TypedDict, total=False): - """MCP tool. - - :ivar type: The type of the MCP tool. Always ``mcp``. Required. MCP. - :vartype type: Literal[ToolType.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: - - * 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: Literal["connector_dropbox", "connector_gmail", - "connector_googlecalendar", "connector_googledrive", "connector_microsoftteams", - "connector_outlookcalendar", "connector_outlookemail", "connector_sharepoint"] - :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: Union[list[str], "MCPToolFilter"] - :ivar allowed_callers: - :vartype allowed_callers: list[Union[str, "CallableToolAllowedCaller"]] - :ivar require_approval: Is one of the following types: MCPToolRequireApproval, - Literal["always"], Literal["never"] - :vartype require_approval: Union["MCPToolRequireApproval", Literal["always"], Literal["never"]] - :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, "ToolConfig"] - """ - - type: Required[Literal[ToolType.MCP]] - """The type of the MCP tool. Always ``mcp``. Required. MCP.""" - server_label: Required[str] - """A label for this MCP server, used to identify it in tool calls. Required.""" - server_url: str - """The URL for the MCP server. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be - provided.""" - connector_id: Literal[ - "connector_dropbox", - "connector_gmail", - "connector_googlecalendar", - "connector_googledrive", - "connector_microsoftteams", - "connector_outlookcalendar", - "connector_outlookemail", - "connector_sharepoint", - ] - """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: - - * 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: str - """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: str - """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: str - """Optional description of the MCP server, used to provide more context.""" - headers: Optional[dict[str, str]] - allowed_tools: Optional[Union[list[str], "MCPToolFilter"]] - """Is either a [str] type or a MCPToolFilter type.""" - allowed_callers: Optional[list[Union[str, "CallableToolAllowedCaller"]]] - require_approval: Optional[Union["MCPToolRequireApproval", Literal["always"], Literal["never"]]] - """Is one of the following types: MCPToolRequireApproval, Literal[\"always\"], Literal[\"never\"]""" - defer_loading: bool - """Whether this MCP tool is deferred and discovered via tool search.""" - project_connection_id: str - """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: dict[str, "ToolConfig"] - """Deprecated. This property is deprecated and will be removed in a future version.""" - - -class MCPToolFilter(TypedDict, total=False): - """MCP tool filter. - - :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 - """ - - tool_names: list[str] - """MCP allowed tools.""" - read_only: bool - """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.""" - - -class MCPToolRequireApproval(TypedDict, total=False): - """MCPToolRequireApproval. - - :ivar always: - :vartype always: "MCPToolFilter" - :ivar never: - :vartype never: "MCPToolFilter" - """ - - always: "MCPToolFilter" - never: "MCPToolFilter" - - -class Metadata(TypedDict, total=False): - """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 OpenAIVoice(TypedDict, total=False): - """An OpenAI built-in voice configuration with an explicit type discriminator. - - :ivar type: The voice kind. Always ``openai``. Required. Default value is "openai". - :vartype type: Literal["openai"] - :ivar name: The OpenAI built-in voice name. Required. Known values are: "alloy", "ash", - "ballad", "coral", "echo", "sage", "shimmer", "verse", "marin", and "cedar". - :vartype name: Union[str, "VoiceIdsShared"] - """ - - type: Required[Literal["openai"]] - """The voice kind. Always ``openai``. Required. Default value is \"openai\".""" - name: Required[Union[str, "VoiceIdsShared"]] - """The OpenAI built-in voice name. Required. Known values are: \"alloy\", \"ash\", \"ballad\", - \"coral\", \"echo\", \"sage\", \"shimmer\", \"verse\", \"marin\", and \"cedar\".""" - - -class ProtocolConfiguration(TypedDict, total=False): - """Per-protocol configuration for the agent endpoint. - - :ivar activity: Configuration for the activity protocol. - :vartype activity: "ActivityProtocolConfiguration" - :ivar responses: Configuration for the responses protocol. - :vartype responses: "ResponsesProtocolConfiguration" - :ivar a2a: Configuration for the A2A protocol. - :vartype a2a: "A2AProtocolConfiguration" - :ivar mcp: Configuration for the MCP protocol. - :vartype mcp: "McpProtocolConfiguration" - :ivar invocations: Configuration for the invocations protocol. - :vartype invocations: "InvocationsProtocolConfiguration" - :ivar invocations_ws: Configuration for the WebSocket-based invocations protocol. - :vartype invocations_ws: "InvocationsWsProtocolConfiguration" - """ - - activity: "ActivityProtocolConfiguration" - """Configuration for the activity protocol.""" - responses: "ResponsesProtocolConfiguration" - """Configuration for the responses protocol.""" - a2a: "A2AProtocolConfiguration" - """Configuration for the A2A protocol.""" - mcp: "McpProtocolConfiguration" - """Configuration for the MCP protocol.""" - invocations: "InvocationsProtocolConfiguration" - """Configuration for the invocations protocol.""" - invocations_ws: "InvocationsWsProtocolConfiguration" - """Configuration for the WebSocket-based invocations protocol.""" - - -class RaiConfig(TypedDict, total=False): - """Configuration for Responsible AI (RAI) content filtering and safety features. - - :ivar rai_policy_name: The name of the RAI policy to apply. Required. - :vartype rai_policy_name: str - """ - - rai_policy_name: Required[str] - """The name of the RAI policy to apply. Required.""" - - -class RealtimeConversationItemFunctionCall(TypedDict, total=False): - """Realtime function call item. - - :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: Literal["realtime.item"] - :ivar type: The type of the item. Always ``function_call``. Required. FUNCTION_CALL. - :vartype type: Literal[RealtimeConversationItemType.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: Literal["completed", "incomplete", "in_progress"] - :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 - """ - - id: str - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Literal["realtime.item"] - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - type: Required[Literal[RealtimeConversationItemType.FUNCTION_CALL]] - """The type of the item. Always ``function_call``. Required. FUNCTION_CALL.""" - status: Literal["completed", "incomplete", "in_progress"] - """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 - """The ID of the function call.""" - name: Required[str] - """The name of the function being called. Required.""" - arguments: Required[str] - """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.""" - - -class RealtimeConversationItemFunctionCallOutput(TypedDict, total=False): # pylint: disable=name-too-long - """Realtime function call output item. - - :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: Literal["realtime.item"] - :ivar type: The type of the item. Always ``function_call_output``. Required. - FUNCTION_CALL_OUTPUT. - :vartype type: Literal[RealtimeConversationItemType.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: Literal["completed", "incomplete", "in_progress"] - :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 - """ - - id: str - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Literal["realtime.item"] - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - type: Required[Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT]] - """The type of the item. Always ``function_call_output``. Required. FUNCTION_CALL_OUTPUT.""" - status: Literal["completed", "incomplete", "in_progress"] - """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: Required[str] - """The ID of the function call this output is for. Required.""" - output: Required[str] - """The output of the function call, this is free text and can contain any information or simply be - empty. Required.""" - - -class RealtimeConversationItemMessageAssistant(TypedDict, total=False): - """Realtime assistant message item. - - :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: Literal["realtime.item"] - :ivar type: The type of the item. Always ``message``. Required. Default value is "message". - :vartype type: Literal["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: Literal["completed", "incomplete", "in_progress"] - :ivar role: The role of the message sender. Always ``assistant``. Required. ASSISTANT. - :vartype role: Literal[RealtimeConversationItemMessageType.ASSISTANT] - :ivar content: The content of the message. Required. - :vartype content: list["RealtimeConversationItemMessageAssistantContent"] - """ - - id: str - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Literal["realtime.item"] - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - type: Required[Literal["message"]] - """The type of the item. Always ``message``. Required. Default value is \"message\".""" - status: Literal["completed", "incomplete", "in_progress"] - """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: Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] - """The role of the message sender. Always ``assistant``. Required. ASSISTANT.""" - content: Required[list["RealtimeConversationItemMessageAssistantContent"]] - """The content of the message. Required.""" - - -class RealtimeConversationItemMessageAssistantContent(TypedDict, total=False): # pylint: disable=name-too-long - """RealtimeConversationItemMessageAssistantContent. - - :ivar type: Is either a Literal["output_text"] type or a Literal["output_audio"] type. - :vartype type: Literal["output_text", "output_audio"] - :ivar text: - :vartype text: str - :ivar audio: - :vartype audio: str - :ivar transcript: - :vartype transcript: str - """ - - type: Literal["output_text", "output_audio"] - """Is either a Literal[\"output_text\"] type or a Literal[\"output_audio\"] type.""" - text: str - audio: str - transcript: str - - -class RealtimeConversationItemMessageSystem(TypedDict, total=False): - """Realtime system message item. - - :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: Literal["realtime.item"] - :ivar type: The type of the item. Always ``message``. Required. Default value is "message". - :vartype type: Literal["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: Literal["completed", "incomplete", "in_progress"] - :ivar role: The role of the message sender. Always ``system``. Required. SYSTEM. - :vartype role: Literal[RealtimeConversationItemMessageType.SYSTEM] - :ivar content: The content of the message. Required. - :vartype content: list["RealtimeConversationItemMessageSystemContent"] - """ - - id: str - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Literal["realtime.item"] - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - type: Required[Literal["message"]] - """The type of the item. Always ``message``. Required. Default value is \"message\".""" - status: Literal["completed", "incomplete", "in_progress"] - """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: Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] - """The role of the message sender. Always ``system``. Required. SYSTEM.""" - content: Required[list["RealtimeConversationItemMessageSystemContent"]] - """The content of the message. Required.""" - - -class RealtimeConversationItemMessageSystemContent(TypedDict, total=False): # pylint: disable=name-too-long - """RealtimeConversationItemMessageSystemContent. - - :ivar type: Default value is "input_text". - :vartype type: Literal["input_text"] - :ivar text: - :vartype text: str - """ - - type: Literal["input_text"] - """Default value is \"input_text\".""" - text: str - - -class RealtimeConversationItemMessageUser(TypedDict, total=False): - """Realtime user message item. - - :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: Literal["realtime.item"] - :ivar type: The type of the item. Always ``message``. Required. Default value is "message". - :vartype type: Literal["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: Literal["completed", "incomplete", "in_progress"] - :ivar role: The role of the message sender. Always ``user``. Required. USER. - :vartype role: Literal[RealtimeConversationItemMessageType.USER] - :ivar content: The content of the message. Required. - :vartype content: list["RealtimeConversationItemMessageUserContent"] - """ - - id: str - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Literal["realtime.item"] - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - type: Required[Literal["message"]] - """The type of the item. Always ``message``. Required. Default value is \"message\".""" - status: Literal["completed", "incomplete", "in_progress"] - """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: Required[Literal[RealtimeConversationItemMessageType.USER]] - """The role of the message sender. Always ``user``. Required. USER.""" - content: Required[list["RealtimeConversationItemMessageUserContent"]] - """The content of the message. Required.""" - - -class RealtimeConversationItemMessageUserContent(TypedDict, total=False): # pylint: disable=name-too-long - """RealtimeConversationItemMessageUserContent. - - :ivar type: Is one of the following types: Literal["input_text"], Literal["input_audio"], - Literal["input_image"] - :vartype type: Literal["input_text", "input_audio", "input_image"] - :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: Literal["auto", "low", "high"] - :ivar transcript: - :vartype transcript: str - """ - - type: Literal["input_text", "input_audio", "input_image"] - """Is one of the following types: Literal[\"input_text\"], Literal[\"input_audio\"], - Literal[\"input_image\"]""" - text: str - audio: str - image_url: str - detail: Literal["auto", "low", "high"] - """Is one of the following types: Literal[\"auto\"], Literal[\"low\"], Literal[\"high\"]""" - transcript: str - - -class RealtimeFunctionTool(TypedDict, total=False): - """Function tool. - - :ivar type: The type of the tool, i.e. ``function``. Default value is "function". - :vartype type: Literal["function"] - :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: "RealtimeFunctionToolParameters" - """ - - type: Literal["function"] - """The type of the tool, i.e. ``function``. Default value is \"function\".""" - name: str - """The name of the function.""" - description: str - """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: "RealtimeFunctionToolParameters" - """Parameters of the function in JSON Schema.""" - - -class RealtimeFunctionToolParameters(TypedDict, total=False): - """RealtimeFunctionToolParameters.""" - - -class RealtimeMCPApprovalRequest(TypedDict, total=False): - """Realtime MCP approval request. - - :ivar type: The type of the item. Always ``mcp_approval_request``. Required. - MCP_APPROVAL_REQUEST. - :vartype type: Literal[RealtimeConversationItemType.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 - """ - - type: Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST]] - """The type of the item. Always ``mcp_approval_request``. Required. MCP_APPROVAL_REQUEST.""" - id: Required[str] - """The unique ID of the approval request. Required.""" - server_label: Required[str] - """The label of the MCP server making the request. Required.""" - name: Required[str] - """The name of the tool to run. Required.""" - arguments: Required[str] - """A JSON string of arguments for the tool. Required.""" - - -class RealtimeMCPApprovalResponse(TypedDict, total=False): - """Realtime MCP approval response. - - :ivar type: The type of the item. Always ``mcp_approval_response``. Required. - MCP_APPROVAL_RESPONSE. - :vartype type: Literal[RealtimeConversationItemType.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 - """ - - type: Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE]] - """The type of the item. Always ``mcp_approval_response``. Required. MCP_APPROVAL_RESPONSE.""" - id: Required[str] - """The unique ID of the approval response. Required.""" - approval_request_id: Required[str] - """The ID of the approval request being answered. Required.""" - approve: Required[bool] - """Whether the request was approved. Required.""" - reason: Optional[str] - - -class RealtimeMCPHTTPError(TypedDict, total=False): - """Realtime MCP HTTP error. - - :ivar type: Required. HTTP_ERROR. - :vartype type: Literal[RealtimeMcpErrorType.HTTP_ERROR] - :ivar code: Required. - :vartype code: int - :ivar message: Required. - :vartype message: str - """ - - type: Required[Literal[RealtimeMcpErrorType.HTTP_ERROR]] - """Required. HTTP_ERROR.""" - code: Required[int] - """Required.""" - message: Required[str] - """Required.""" - - -class RealtimeMCPListTools(TypedDict, total=False): - """Realtime MCP list tools. - - :ivar type: The type of the item. Always ``mcp_list_tools``. Required. MCP_LIST_TOOLS. - :vartype type: Literal[RealtimeConversationItemType.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["MCPListToolsTool"] - """ - - type: Required[Literal[RealtimeConversationItemType.MCP_LIST_TOOLS]] - """The type of the item. Always ``mcp_list_tools``. Required. MCP_LIST_TOOLS.""" - id: str - """The unique ID of the list.""" - server_label: Required[str] - """The label of the MCP server. Required.""" - tools: Required[list["MCPListToolsTool"]] - """The tools available on the server. Required.""" - - -class RealtimeMCPProtocolError(TypedDict, total=False): - """Realtime MCP protocol error. - - :ivar type: Required. PROTOCOL_ERROR. - :vartype type: Literal[RealtimeMcpErrorType.PROTOCOL_ERROR] - :ivar code: Required. - :vartype code: int - :ivar message: Required. - :vartype message: str - """ - - type: Required[Literal[RealtimeMcpErrorType.PROTOCOL_ERROR]] - """Required. PROTOCOL_ERROR.""" - code: Required[int] - """Required.""" - message: Required[str] - """Required.""" - - -class RealtimeMCPToolCall(TypedDict, total=False): - """Realtime MCP tool call. - - :ivar type: The type of the item. Always ``mcp_call``. Required. MCP_CALL. - :vartype type: Literal[RealtimeConversationItemType.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: "RealtimeMCPError" - """ - - type: Required[Literal[RealtimeConversationItemType.MCP_CALL]] - """The type of the item. Always ``mcp_call``. Required. MCP_CALL.""" - id: Required[str] - """The unique ID of the tool call. Required.""" - server_label: Required[str] - """The label of the MCP server running the tool. Required.""" - name: Required[str] - """The name of the tool that was run. Required.""" - arguments: Required[str] - """A JSON string of the arguments passed to the tool. Required.""" - approval_request_id: Optional[str] - output: Optional[str] - error: "RealtimeMCPError" - - -class RealtimeMCPToolExecutionError(TypedDict, total=False): - """Realtime MCP tool execution error. - - :ivar type: Required. TOOL_EXECUTION_ERROR. - :vartype type: Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR] - :ivar message: Required. - :vartype message: str - """ - - type: Required[Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR]] - """Required. TOOL_EXECUTION_ERROR.""" - message: Required[str] - """Required.""" - - -class RealtimeReasoning(TypedDict, total=False): - """Realtime reasoning configuration. - - :ivar effort: Known values are: "minimal", "low", "medium", "high", and "xhigh". - :vartype effort: Union[str, "RealtimeReasoningEffort"] - """ - - effort: Union[str, "RealtimeReasoningEffort"] - """Known values are: \"minimal\", \"low\", \"medium\", \"high\", and \"xhigh\".""" - - -class RealtimeResponseStatusDetails(TypedDict, total=False): - """RealtimeResponseStatusDetails. - - :ivar type: Is one of the following types: Literal["completed"], Literal["cancelled"], - Literal["failed"], Literal["incomplete"] - :vartype type: Literal["completed", "cancelled", "failed", "incomplete"] - :ivar reason: Is one of the following types: Literal["turn_detected"], - Literal["client_cancelled"], Literal["max_output_tokens"], Literal["content_filter"] - :vartype reason: Literal["turn_detected", "client_cancelled", "max_output_tokens", - "content_filter"] - :ivar error: - :vartype error: "RealtimeResponseStatusDetailsError" - """ - - type: Literal["completed", "cancelled", "failed", "incomplete"] - """Is one of the following types: Literal[\"completed\"], Literal[\"cancelled\"], - Literal[\"failed\"], Literal[\"incomplete\"]""" - reason: Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"] - """Is one of the following types: Literal[\"turn_detected\"], Literal[\"client_cancelled\"], - Literal[\"max_output_tokens\"], Literal[\"content_filter\"]""" - error: "RealtimeResponseStatusDetailsError" - - -class RealtimeResponseStatusDetailsError(TypedDict, total=False): - """RealtimeResponseStatusDetailsError. - - :ivar type: - :vartype type: str - :ivar code: - :vartype code: str - """ - - type: str - code: str - - -class RealtimeResponseUsage(TypedDict, total=False): - """RealtimeResponseUsage. - - :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: "RealtimeResponseUsageInputTokenDetails" - :ivar output_token_details: - :vartype output_token_details: "RealtimeResponseUsageOutputTokenDetails" - """ - - total_tokens: int - input_tokens: int - output_tokens: int - input_token_details: "RealtimeResponseUsageInputTokenDetails" - output_token_details: "RealtimeResponseUsageOutputTokenDetails" - - -class RealtimeResponseUsageInputTokenDetails(TypedDict, total=False): - """RealtimeResponseUsageInputTokenDetails. - - :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: "RealtimeResponseUsageInputTokenDetailsCachedTokensDetails" - """ - - cached_tokens: int - text_tokens: int - image_tokens: int - audio_tokens: int - cached_tokens_details: "RealtimeResponseUsageInputTokenDetailsCachedTokensDetails" - - -class RealtimeResponseUsageInputTokenDetailsCachedTokensDetails( - TypedDict, total=False -): # pylint: disable=name-too-long - """RealtimeResponseUsageInputTokenDetailsCachedTokensDetails. - - :ivar text_tokens: - :vartype text_tokens: int - :ivar image_tokens: - :vartype image_tokens: int - :ivar audio_tokens: - :vartype audio_tokens: int - """ - - text_tokens: int - image_tokens: int - audio_tokens: int - - -class RealtimeResponseUsageOutputTokenDetails(TypedDict, total=False): - """RealtimeResponseUsageOutputTokenDetails. - - :ivar text_tokens: - :vartype text_tokens: int - :ivar audio_tokens: - :vartype audio_tokens: int - """ - - text_tokens: int - audio_tokens: int - - -class RealtimeServerEventConversationItemInputAudioTranscriptionFailedError( - TypedDict, total=False -): # pylint: disable=name-too-long - """RealtimeServerEventConversationItemInputAudioTranscriptionFailedError. - - :ivar type: - :vartype type: str - :ivar code: - :vartype code: str - :ivar message: - :vartype message: str - :ivar param: - :vartype param: str - """ - - type: str - code: str - message: str - param: str - - -class RealtimeServerEventRateLimitsUpdatedRateLimits(TypedDict, total=False): # pylint: disable=name-too-long - """RealtimeServerEventRateLimitsUpdatedRateLimits. - - :ivar name: Is either a Literal["requests"] type or a Literal["tokens"] type. - :vartype name: Literal["requests", "tokens"] - :ivar limit: - :vartype limit: int - :ivar remaining: - :vartype remaining: int - :ivar reset_seconds: - :vartype reset_seconds: float - """ - - name: Literal["requests", "tokens"] - """Is either a Literal[\"requests\"] type or a Literal[\"tokens\"] type.""" - limit: int - remaining: int - reset_seconds: float - - -class RealtimeServerEventResponseContentPartAdded(TypedDict, total=False): # pylint: disable=name-too-long - """Returned when a new content part is added to an assistant message item 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.content_part.added``. Required. - RESPONSE_CONTENT_PART_ADDED. - :vartype type: Literal[RealtimeServerEventType.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: "RealtimeServerEventResponseContentPartAddedPart" - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED]] - """The event type, must be ``response.content_part.added``. Required. RESPONSE_CONTENT_PART_ADDED.""" - response_id: Required[str] - """The ID of the response. Required.""" - item_id: Required[str] - """The ID of the item to which the content part was added. Required.""" - output_index: Required[int] - """The index of the output item in the response. Required.""" - content_index: Required[int] - """The index of the content part in the item's content array. Required.""" - part: Required["RealtimeServerEventResponseContentPartAddedPart"] - """The content part that was added. Required.""" - - -class RealtimeServerEventResponseContentPartAddedPart(TypedDict, total=False): # pylint: disable=name-too-long - """RealtimeServerEventResponseContentPartAddedPart. - - :ivar type: Is either a Literal["audio"] type or a Literal["text"] type. - :vartype type: Literal["audio", "text"] - :ivar text: - :vartype text: str - :ivar audio: - :vartype audio: str - :ivar transcript: - :vartype transcript: str - """ - - type: Literal["audio", "text"] - """Is either a Literal[\"audio\"] type or a Literal[\"text\"] type.""" - text: str - audio: str - transcript: str - - -class RealtimeToolChoiceFunction(TypedDict, total=False): - """A Realtime tool-choice object that forces the model to call a specific function. - - :ivar type: For function calling, the type is always ``function``. Required. FUNCTION. - :vartype type: Literal[ToolChoiceParamType.FUNCTION] - :ivar name: The name of the function to call. Required. - :vartype name: str - """ - - type: Required[Literal[ToolChoiceParamType.FUNCTION]] - """For function calling, the type is always ``function``. Required. FUNCTION.""" - name: Required[str] - """The name of the function to call. Required.""" - - -class ResponsesProtocolConfiguration(TypedDict, total=False): - """Configuration specific to the responses protocol.""" - - -class StructuredInputDefinition(TypedDict, total=False): - """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: str - """A human-readable description of the input.""" - default_value: Any - """The default value for the input if no run-time value is provided.""" - schema: dict[str, Any] - """The JSON schema for the structured input (optional).""" - required: bool - """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.""" - - -class TemplateVoiceGreetingConfig(TypedDict, total=False): - """A deterministic greeting rendered with the voice agent's structured inputs and synthesized - without model-authored generation. - - :ivar type: Required. Default value is "template". - :vartype type: Literal["template"] - :ivar text: The Handlebars text template spoken at session start. Required. - :vartype text: str - """ - - type: Required[Literal["template"]] - """Required. Default value is \"template\".""" - text: Required[str] - """The Handlebars text template spoken at session start. Required.""" - - -class ToolChoiceFunction(TypedDict, total=False): - """Function tool. - - :ivar type: For function calling, the type is always ``function``. Required. FUNCTION. - :vartype type: Literal[ToolChoiceParamType.FUNCTION] - :ivar name: The name of the function to call. Required. - :vartype name: str - """ - - type: Required[Literal[ToolChoiceParamType.FUNCTION]] - """For function calling, the type is always ``function``. Required. FUNCTION.""" - name: Required[str] - """The name of the function to call. Required.""" - - -class ToolChoiceMCP(TypedDict, total=False): - """MCP tool. - - :ivar type: For MCP tools, the type is always ``mcp``. Required. MCP. - :vartype type: Literal[ToolChoiceParamType.MCP] - :ivar server_label: The label of the MCP server to use. Required. - :vartype server_label: str - :ivar name: - :vartype name: str - """ - - type: Required[Literal[ToolChoiceParamType.MCP]] - """For MCP tools, the type is always ``mcp``. Required. MCP.""" - server_label: Required[str] - """The label of the MCP server to use. Required.""" - name: Optional[str] - - -class ToolConfig(TypedDict, total=False): - """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: bool - """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: str - """Additional text indexed for tool_search. Supplements the native tool description to improve - discoverability. Does not alter ``tools/list`` output.""" - - -class TranscriptTextUsageDuration(TypedDict, total=False): - """Duration Usage. - - :ivar type: The type of the usage object. Always ``duration`` for this variant. Required. - DURATION. - :vartype type: Literal[CreateTranscriptionResponseJsonUsageType.DURATION] - :ivar seconds: Duration of the input audio in seconds. Required. - :vartype seconds: str - """ - - type: Required[Literal[CreateTranscriptionResponseJsonUsageType.DURATION]] - """The type of the usage object. Always ``duration`` for this variant. Required. DURATION.""" - seconds: Required[str] - """Duration of the input audio in seconds. Required.""" - - -class TranscriptTextUsageTokens(TypedDict, total=False): - """Token Usage. - - :ivar type: The type of the usage object. Always ``tokens`` for this variant. Required. TOKENS. - :vartype type: Literal[CreateTranscriptionResponseJsonUsageType.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: "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: Required[Literal[CreateTranscriptionResponseJsonUsageType.TOKENS]] - """The type of the usage object. Always ``tokens`` for this variant. Required. TOKENS.""" - input_tokens: Required[int] - """Number of input tokens billed for this request. Required.""" - input_token_details: "TranscriptTextUsageTokensInputTokenDetails" - """Details about the input tokens billed for this request.""" - output_tokens: Required[int] - """Number of output tokens generated. Required.""" - total_tokens: Required[int] - """Total number of tokens used (input + output). Required.""" - - -class TranscriptTextUsageTokensInputTokenDetails(TypedDict, total=False): # pylint: disable=name-too-long - """TranscriptTextUsageTokensInputTokenDetails. - - :ivar text_tokens: - :vartype text_tokens: int - :ivar audio_tokens: - :vartype audio_tokens: int - """ - - text_tokens: int - audio_tokens: int - - -class VersionSelector(TypedDict, total=False): - """VersionSelector. - - :ivar version_selection_rules: Required. - :vartype version_selection_rules: list["VersionSelectionRule"] - """ - - version_selection_rules: Required[list["VersionSelectionRule"]] - """Required.""" - - -class VoiceAgentAnimationConfig(TypedDict, total=False): - """Animation settings for a voice-agent session. - - :ivar model_name: The animation model name. - :vartype model_name: str - :ivar outputs: The requested animation output kinds. - :vartype outputs: list[Union[str, "VoiceAgentAnimationOutputType"]] - """ - - model_name: str - """The animation model name.""" - outputs: list[Union[str, "VoiceAgentAnimationOutputType"]] - """The requested animation output kinds.""" - - -class VoiceAgentAvatarIceServer(TypedDict, total=False): - """An ICE server used for avatar WebRTC negotiation. - - :ivar urls: Required. - :vartype urls: list[str] - :ivar username: - :vartype username: str - :ivar credential: - :vartype credential: str - """ - - urls: Required[list[str]] - """Required.""" - username: Optional[str] - credential: Optional[str] - - -class VoiceAgentAvatarScene(TypedDict, total=False): - """Avatar placement and motion settings. - - :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 - """ - - zoom: float - position_x: float - position_y: float - rotation_x: float - rotation_y: float - rotation_z: float - amplitude: float - - -class VoiceAgentAvatarVideoBackground(TypedDict, total=False): - """The avatar video background. - - :ivar image_url: - :vartype image_url: str - :ivar color: - :vartype color: str - """ - - image_url: Optional[str] - color: Optional[str] - - -class VoiceAgentAvatarVideoCrop(TypedDict, total=False): - """The rectangular crop applied to avatar video. - - :ivar bottom_right: Required. - :vartype bottom_right: list[int] - :ivar top_left: Required. - :vartype top_left: list[int] - """ - - bottom_right: Required[list[int]] - """Required.""" - top_left: Required[list[int]] - """Required.""" - - -class VoiceAgentAvatarVideoParams(TypedDict, total=False): - """Avatar video encoder and presentation settings. - - :ivar bitrate: - :vartype bitrate: int - :ivar codec: Default value is "h264". - :vartype codec: Literal["h264"] - :ivar crop: - :vartype crop: "VoiceAgentAvatarVideoCrop" - :ivar resolution: - :vartype resolution: "VoiceAgentAvatarVideoResolution" - :ivar background: - :vartype background: "VoiceAgentAvatarVideoBackground" - :ivar gop_size: - :vartype gop_size: int - """ - - bitrate: int - codec: Literal["h264"] - """Default value is \"h264\".""" - crop: Optional["VoiceAgentAvatarVideoCrop"] - resolution: Optional["VoiceAgentAvatarVideoResolution"] - background: Optional["VoiceAgentAvatarVideoBackground"] - gop_size: int - - -class VoiceAgentAvatarVideoResolution(TypedDict, total=False): - """The avatar video resolution. - - :ivar width: Required. - :vartype width: int - :ivar height: Required. - :vartype height: int - """ - - width: Required[int] - """Required.""" - height: Required[int] - """Required.""" - - -class VoiceAgentAzureMultilingualSemanticVadTurnDetection(TypedDict, total=False): # pylint: disable=name-too-long - """Azure multilingual semantic VAD turn-detection settings. - - :ivar remove_filler_words: Whether filler words are removed from transcription. - :vartype remove_filler_words: bool - :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech - stops. - :vartype auto_truncate: 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 type: Required. Multilingual Azure semantic voice activity detection. - :vartype type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] - :ivar threshold: - :vartype threshold: float - :ivar prefix_padding_ms: - :vartype prefix_padding_ms: int - :ivar silence_duration_ms: - :vartype silence_duration_ms: int - :ivar idle_timeout_ms: - :vartype idle_timeout_ms: int - :ivar speech_duration_ms: - :vartype speech_duration_ms: int - :ivar end_of_utterance_detection: - :vartype end_of_utterance_detection: "VoiceAgentEndOfUtteranceDetection" - :ivar languages: - :vartype languages: list[str] - """ - - remove_filler_words: bool - """Whether filler words are removed from transcription.""" - auto_truncate: bool - """Whether the input audio buffer is truncated automatically when speech stops.""" - create_response: bool - """Whether a response is created automatically when speech stops.""" - interrupt_response: bool - """Whether user speech may interrupt the agent's response.""" - type: Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL]] - """Required. Multilingual Azure semantic voice activity detection.""" - threshold: Optional[float] - prefix_padding_ms: Optional[int] - silence_duration_ms: Optional[int] - idle_timeout_ms: Optional[int] - speech_duration_ms: Optional[int] - end_of_utterance_detection: Optional["VoiceAgentEndOfUtteranceDetection"] - languages: Optional[list[str]] - - -class VoiceAgentAzureSemanticVadTurnDetection(TypedDict, total=False): - """Azure semantic VAD turn-detection settings. - - :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 type: Required. Known values are: "azure_semantic_vad" and "azure_semantic_vad_en". - :vartype type: Union[str, "VoiceAgentAzureSemanticVadType"] - :ivar threshold: - :vartype threshold: float - :ivar prefix_padding_ms: - :vartype prefix_padding_ms: int - :ivar silence_duration_ms: - :vartype silence_duration_ms: int - :ivar idle_timeout_ms: - :vartype idle_timeout_ms: int - :ivar speech_duration_ms: - :vartype speech_duration_ms: int - :ivar end_of_utterance_detection: - :vartype end_of_utterance_detection: "VoiceAgentEndOfUtteranceDetection" - :ivar remove_filler_words: - :vartype remove_filler_words: bool - :ivar languages: - :vartype languages: list[str] - :ivar auto_truncate: - :vartype auto_truncate: bool - """ - - create_response: bool - """Whether a response is created automatically when speech stops.""" - interrupt_response: bool - """Whether user speech may interrupt the agent's response.""" - type: Required[Union[str, "VoiceAgentAzureSemanticVadType"]] - """Required. Known values are: \"azure_semantic_vad\" and \"azure_semantic_vad_en\".""" - threshold: Optional[float] - prefix_padding_ms: Optional[int] - silence_duration_ms: Optional[int] - idle_timeout_ms: Optional[int] - speech_duration_ms: Optional[int] - end_of_utterance_detection: Optional["VoiceAgentEndOfUtteranceDetection"] - remove_filler_words: bool - languages: Optional[list[str]] - auto_truncate: bool - - -class VoiceAgentClientEventConversationItemCreate(TypedDict, total=False): # pylint: disable=name-too-long - """The ``conversation.item.create`` client event. - - :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: Literal[RealtimeClientEventType.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: The conversation item to create. Required. Is either a - "_unions.VoiceAgentRequestConversationItem" type or a RealtimeMCPApprovalResponse type. - :vartype item: "_unions.VoiceAgentCreateConversationItem" - """ - - event_id: str - """Optional client-generated ID used to identify this event.""" - type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE]] - """The event type, must be ``conversation.item.create``. Required. CONVERSATION_ITEM_CREATE.""" - previous_item_id: str - """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: Required["_unions.VoiceAgentCreateConversationItem"] - """The conversation item to create. Required. Is either a - \"_unions.VoiceAgentRequestConversationItem\" type or a RealtimeMCPApprovalResponse type.""" - - -class VoiceAgentClientEventConversationItemDelete(TypedDict, total=False): # pylint: disable=name-too-long - """The ``conversation.item.delete`` client event. - - :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: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE] - :ivar item_id: The ID of the item to delete. Required. - :vartype item_id: str - """ - - event_id: str - """Optional client-generated ID used to identify this event.""" - type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE]] - """The event type, must be ``conversation.item.delete``. Required. CONVERSATION_ITEM_DELETE.""" - item_id: Required[str] - """The ID of the item to delete. Required.""" - - -class VoiceAgentClientEventConversationItemRetrieve(TypedDict, total=False): # pylint: disable=name-too-long - """The ``conversation.item.retrieve`` client event. - - :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: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE] - :ivar item_id: The ID of the item to retrieve. Required. - :vartype item_id: str - """ - - event_id: str - """Optional client-generated ID used to identify this event.""" - type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE]] - """The event type, must be ``conversation.item.retrieve``. Required. CONVERSATION_ITEM_RETRIEVE.""" - item_id: Required[str] - """The ID of the item to retrieve. Required.""" - - -class VoiceAgentClientEventConversationItemTruncate(TypedDict, total=False): # pylint: disable=name-too-long - """The ``conversation.item.truncate`` client event. - - :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: Literal[RealtimeClientEventType.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 - """Optional client-generated ID used to identify this event.""" - type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE]] - """The event type, must be ``conversation.item.truncate``. Required. CONVERSATION_ITEM_TRUNCATE.""" - item_id: Required[str] - """The ID of the assistant message item to truncate. Only assistant message items can be - truncated. Required.""" - content_index: Required[int] - """The index of the content part to truncate. Set this to ``0``. Required.""" - audio_end_ms: Required[int] - """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.""" - - -class VoiceAgentClientEventInputAudioBufferAppend(TypedDict, total=False): # pylint: disable=name-too-long - """The ``input_audio_buffer.append`` client event. - - :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: Literal[RealtimeClientEventType.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 - """Optional client-generated ID used to identify this event.""" - type: Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND]] - """The event type, must be ``input_audio_buffer.append``. Required. INPUT_AUDIO_BUFFER_APPEND.""" - audio: Required[str] - """Base64-encoded audio bytes. This must be in the format specified by the ``input_audio_format`` - field in the session configuration. Required.""" - - -class VoiceAgentClientEventInputAudioBufferClear(TypedDict, total=False): # pylint: disable=name-too-long - """The ``input_audio_buffer.clear`` client event. - - :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: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR] - """ - - event_id: str - """Optional client-generated ID used to identify this event.""" - type: Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR]] - """The event type, must be ``input_audio_buffer.clear``. Required. INPUT_AUDIO_BUFFER_CLEAR.""" - - -class VoiceAgentClientEventInputAudioBufferCommit(TypedDict, total=False): # pylint: disable=name-too-long - """The ``input_audio_buffer.commit`` client event. - - :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: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT] - """ - - event_id: str - """Optional client-generated ID used to identify this event.""" - type: Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT]] - """The event type, must be ``input_audio_buffer.commit``. Required. INPUT_AUDIO_BUFFER_COMMIT.""" - - -class VoiceAgentClientEventOutputAudioBufferClear(TypedDict, total=False): # pylint: disable=name-too-long - """The ``output_audio_buffer.clear`` client event. - - :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: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR] - """ - - event_id: str - """The unique ID of the client event used for error handling.""" - type: Required[Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR]] - """The event type, must be ``output_audio_buffer.clear``. Required. OUTPUT_AUDIO_BUFFER_CLEAR.""" - - -class VoiceAgentClientEventResponseCancel(TypedDict, total=False): - """The ``response.cancel`` client event. - - :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: Literal[RealtimeClientEventType.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 - """Optional client-generated ID used to identify this event.""" - type: Required[Literal[RealtimeClientEventType.RESPONSE_CANCEL]] - """The event type, must be ``response.cancel``. Required. RESPONSE_CANCEL.""" - response_id: str - """A specific response ID to cancel - if not provided, will cancel an in-progress response in the - default conversation.""" - - -class VoiceAgentClientEventResponseCreate(TypedDict, total=False): - """The ``response.create`` client event. - - :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: Literal[RealtimeClientEventType.RESPONSE_CREATE] - :ivar response: Parameters for the new response. - :vartype response: "VoiceAgentResponseCreateParams" - """ - - event_id: str - """Optional client-generated ID used to identify this event.""" - type: Required[Literal[RealtimeClientEventType.RESPONSE_CREATE]] - """The event type, must be ``response.create``. Required. RESPONSE_CREATE.""" - response: "VoiceAgentResponseCreateParams" - """Parameters for the new response.""" - - -class VoiceAgentClientEventSessionAvatarConnect(TypedDict, total=False): # pylint: disable=name-too-long - """The ``session.avatar.connect`` client event. - - :ivar type: The event type. Always ``session.avatar.connect``. Required. Default value is - "session.avatar.connect". - :vartype type: Literal["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 - """ - - type: Required[Literal["session.avatar.connect"]] - """The event type. Always ``session.avatar.connect``. Required. Default value is - \"session.avatar.connect\".""" - event_id: str - """An optional client-generated event identifier.""" - client_sdp: Required[str] - """The client's SDP offer for avatar media negotiation. Required.""" - - -class VoiceAgentClientEventSessionUpdate(TypedDict, total=False): - """The ``session.update`` client event. - - :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: Literal[RealtimeClientEventType.SESSION_UPDATE] - :ivar session: The stable realtime session fields to update. Required. - :vartype session: "VoiceAgentSessionUpdateConfig" - """ - - event_id: str - """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: Required[Literal[RealtimeClientEventType.SESSION_UPDATE]] - """The event type, must be ``session.update``. Required. SESSION_UPDATE.""" - session: Required["VoiceAgentSessionUpdateConfig"] - """The stable realtime session fields to update. Required.""" - - -class VoiceAgentDefinition(TypedDict, total=False): - """The voice agent definition. Its configuration (model, instructions, audio, tools, and optional - avatar) drives a managed speech-to-speech experience. The realtime voice session is established - through a separate connect operation that is not defined in this specification. Every create or - update produces a new immutable version. - - :ivar kind: The kind discriminator for a voice agent definition. Always ``voice``. Required. - Default value is "voice". - :vartype kind: Literal["voice"] - :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. - :vartype rai_config: "RaiConfig" - :ivar model_type: How the model backing this agent is served. Together with ``model``, this - selects the model up front. ``managed`` uses a service-managed model; ``self_deployed`` uses - the customer's own Foundry deployment. This is independent of the architecture (realtime or - cascaded), which the service derives from the selected model. Required. Known values are: - "managed" and "self_deployed". - :vartype model_type: Union[str, "VoiceModelType"] - :ivar model: The model to use for this agent, paired with ``model_type``: the service-managed - model name when ``model_type`` is ``managed``, or the customer's Foundry deployment name when - ``model_type`` is ``self_deployed``. The model must support realtime or cascaded voice. The - service derives the architecture from the selected model. Required. - :vartype model: str - :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: "VoiceGreetingConfig" - :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: "VoiceAudioConfig" - :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[Union[str, "VoiceOutputModality"]] - :ivar avatar: Optional avatar configuration. These values are session defaults and may be - overridden when connecting. - :vartype avatar: "VoiceAvatarConfig" - :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["_unions.VoiceAgentTool"] - :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, "StructuredInputDefinition"] - :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 - """ - - kind: Required[Literal["voice"]] - """The kind discriminator for a voice agent definition. Always ``voice``. Required. Default value - is \"voice\".""" - rai_config: "RaiConfig" - """Configuration for Responsible AI (RAI) content filtering and safety features.""" - model_type: Required[Union[str, "VoiceModelType"]] - """How the model backing this agent is served. Together with ``model``, this selects the model up - front. ``managed`` uses a service-managed model; ``self_deployed`` uses the customer's own - Foundry deployment. This is independent of the architecture (realtime or cascaded), which the - service derives from the selected model. Required. Known values are: \"managed\" and - \"self_deployed\".""" - model: Required[str] - """The model to use for this agent, paired with ``model_type``: the service-managed model name - when ``model_type`` is ``managed``, or the customer's Foundry deployment name when - ``model_type`` is ``self_deployed``. The model must support realtime or cascaded voice. The - service derives the architecture from the selected model. Required.""" - instructions: str - """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: "VoiceGreetingConfig" - """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: "VoiceAudioConfig" - """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: list[Union[str, "VoiceOutputModality"]] - """The output modalities the agent produces. Defaults to ``[\"audio\"]``. ``animation`` and - ``avatar`` are available when an avatar is configured.""" - avatar: "VoiceAvatarConfig" - """Optional avatar configuration. These values are session defaults and may be overridden when - connecting.""" - tools: list["_unions.VoiceAgentTool"] - """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.""" - structured_inputs: dict[str, "StructuredInputDefinition"] - """Set of structured inputs that participate in prompt template substitution, rendered per session - before the live session starts.""" - store: bool - """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.""" - - -class VoiceAgentEchoCancellation(TypedDict, total=False): - """Server-side echo cancellation settings for input audio. - - :ivar type: The echo cancellation implementation. Always ``server_echo_cancellation``. - Required. Default value is "server_echo_cancellation". - :vartype type: Literal["server_echo_cancellation"] - :ivar reference_source: Whether reference audio comes from server playback or a client-provided - channel. Known values are: "server" and "client". - :vartype reference_source: Union[str, "VoiceAgentEchoCancellationReferenceSource"] - :ivar channels: The number of input channels. Use two interleaved channels when - ``reference_source`` is ``client``. - :vartype channels: int - """ - - type: Required[Literal["server_echo_cancellation"]] - """The echo cancellation implementation. Always ``server_echo_cancellation``. Required. Default - value is \"server_echo_cancellation\".""" - reference_source: Union[str, "VoiceAgentEchoCancellationReferenceSource"] - """Whether reference audio comes from server playback or a client-provided channel. Known values - are: \"server\" and \"client\".""" - channels: int - """The number of input channels. Use two interleaved channels when ``reference_source`` is - ``client``.""" - - -class VoiceAgentEndOfUtteranceDetection(TypedDict, total=False): - """End-of-utterance detection settings. - - :ivar model: Required. Known values are: "semantic_detection_v1", "semantic_detection_v1_en", - "semantic_detection_v1_multilingual", and "smart_end_of_turn_detection". - :vartype model: Union[str, "VoiceAgentEndOfUtteranceModel"] - :ivar threshold: - :vartype threshold: float - :ivar threshold_level: Known values are: "low", "medium", "high", and "default". - :vartype threshold_level: Union[str, "VoiceAgentEndOfUtteranceThresholdLevel"] - :ivar timeout: - :vartype timeout: float - :ivar timeout_ms: - :vartype timeout_ms: int - """ - - model: Required[Union[str, "VoiceAgentEndOfUtteranceModel"]] - """Required. Known values are: \"semantic_detection_v1\", \"semantic_detection_v1_en\", - \"semantic_detection_v1_multilingual\", and \"smart_end_of_turn_detection\".""" - threshold: Optional[float] - threshold_level: Optional[Union[str, "VoiceAgentEndOfUtteranceThresholdLevel"]] - """Known values are: \"low\", \"medium\", \"high\", and \"default\".""" - timeout: Optional[float] - timeout_ms: Optional[int] - - -class VoiceAgentEstimatedCost(TypedDict, total=False): - """A best-effort public-retail cost estimate for a response. - - :ivar amount: The total estimated amount, when available. Required. - :vartype amount: float - :ivar input_cost: The estimated input cost. - :vartype input_cost: float - :ivar output_cost: The estimated output cost. - :vartype output_cost: float - :ivar currency: The estimate currency. Always ``USD``. Default value is "USD". - :vartype currency: Literal["USD"] - :ivar voice_live_amount: The portion attributed to Voice Live processing. Required. - :vartype voice_live_amount: float - :ivar byom_model_amount: The portion attributed to a customer-provided model. - :vartype byom_model_amount: float - :ivar status: Whether the estimate is complete, partial, or unavailable. Required. Known values - are: "complete", "partial", and "unavailable". - :vartype status: Union[str, "VoiceAgentEstimatedCostStatus"] - :ivar price_version: The Voice Live price version used for the estimate. Required. - :vartype price_version: str - :ivar byom_model_price_version: The customer-provided model price version used for the - estimate. - :vartype byom_model_price_version: str - :ivar unpriced_components: Components for which no price was available. - :vartype unpriced_components: list[str] - """ - - amount: Required[Optional[float]] - """The total estimated amount, when available. Required.""" - input_cost: Optional[float] - """The estimated input cost.""" - output_cost: Optional[float] - """The estimated output cost.""" - currency: Literal["USD"] - """The estimate currency. Always ``USD``. Default value is \"USD\".""" - voice_live_amount: Required[float] - """The portion attributed to Voice Live processing. Required.""" - byom_model_amount: Optional[float] - """The portion attributed to a customer-provided model.""" - status: Required[Union[str, "VoiceAgentEstimatedCostStatus"]] - """Whether the estimate is complete, partial, or unavailable. Required. Known values are: - \"complete\", \"partial\", and \"unavailable\".""" - price_version: Required[str] - """The Voice Live price version used for the estimate. Required.""" - byom_model_price_version: Optional[str] - """The customer-provided model price version used for the estimate.""" - unpriced_components: list[str] - """Components for which no price was available.""" - - -class VoiceAgentFileSearchCallItem(TypedDict, total=False): - """A file-search output item. - - :ivar id: Required. - :vartype id: str - :ivar type: Required. Default value is "file_search_call". - :vartype type: Literal["file_search_call"] - :ivar status: Required. Known values are: "in_progress", "searching", "completed", - "incomplete", and "failed". - :vartype status: Union[str, "VoiceAgentFileSearchCallStatus"] - :ivar queries: - :vartype queries: list[str] - :ivar results: - :vartype results: list["VoiceAgentFileSearchResult"] - """ - - id: Required[str] - """Required.""" - type: Required[Literal["file_search_call"]] - """Required. Default value is \"file_search_call\".""" - status: Required[Union[str, "VoiceAgentFileSearchCallStatus"]] - """Required. Known values are: \"in_progress\", \"searching\", \"completed\", \"incomplete\", and - \"failed\".""" - queries: Optional[list[str]] - results: Optional[list["VoiceAgentFileSearchResult"]] - - -class VoiceAgentFileSearchResult(TypedDict, total=False): - """One result returned by a file-search call. - - :ivar attributes: - :vartype attributes: dict[str, "_unions.VoiceAgentFileSearchAttributeValue"] - :ivar file_id: - :vartype file_id: str - :ivar filename: - :vartype filename: str - :ivar score: - :vartype score: float - :ivar text: - :vartype text: str - """ - - attributes: Optional[dict[str, "_unions.VoiceAgentFileSearchAttributeValue"]] - file_id: Optional[str] - filename: Optional[str] - score: Optional[float] - text: Optional[str] - - -class VoiceAgentHandoffEdgeConfig(TypedDict, total=False): - """A directed transition between handoff nodes. - - :ivar id: The edge identifier. Required. - :vartype id: str - :ivar source: The source node identifier. Required. - :vartype source: str - :ivar target: The target node identifier. Required. - :vartype target: str - :ivar description: A non-empty description used by the model to select this transition. - Required. - :vartype description: str - :ivar cancel_on_interruption: Whether user interruption cancels the transition. - :vartype cancel_on_interruption: bool - :ivar delay_ms: The delay before the target behavior is committed, in milliseconds. - :vartype delay_ms: int - :ivar transfer_message: Optional text synthesized while transferring. - :vartype transfer_message: str - :ivar target_response: Whether the target automatically creates a response after transfer. - Known values are: "auto" and "none". - :vartype target_response: Union[str, "VoiceAgentHandoffTargetResponse"] - """ - - id: Required[str] - """The edge identifier. Required.""" - source: Required[str] - """The source node identifier. Required.""" - target: Required[str] - """The target node identifier. Required.""" - description: Required[str] - """A non-empty description used by the model to select this transition. Required.""" - cancel_on_interruption: bool - """Whether user interruption cancels the transition.""" - delay_ms: int - """The delay before the target behavior is committed, in milliseconds.""" - transfer_message: Optional[str] - """Optional text synthesized while transferring.""" - target_response: Union[str, "VoiceAgentHandoffTargetResponse"] - """Whether the target automatically creates a response after transfer. Known values are: \"auto\" - and \"none\".""" - - -class VoiceAgentHandoffEdgeState(TypedDict, total=False): - """Non-sensitive metadata for an effective handoff edge. - - :ivar id: The edge identifier. Required. - :vartype id: str - :ivar source: The source node identifier. Required. - :vartype source: str - :ivar target: The target node identifier. Required. - :vartype target: str - :ivar cancel_on_interruption: Whether user interruption cancels the transition. - :vartype cancel_on_interruption: bool - :ivar delay_ms: The delay before the target behavior is committed, in milliseconds. - :vartype delay_ms: int - :ivar transfer_message: Optional text synthesized while transferring. - :vartype transfer_message: str - :ivar target_response: Whether the target automatically creates a response after transfer. - Known values are: "auto" and "none". - :vartype target_response: Union[str, "VoiceAgentHandoffTargetResponse"] - """ - - id: Required[str] - """The edge identifier. Required.""" - source: Required[str] - """The source node identifier. Required.""" - target: Required[str] - """The target node identifier. Required.""" - cancel_on_interruption: bool - """Whether user interruption cancels the transition.""" - delay_ms: int - """The delay before the target behavior is committed, in milliseconds.""" - transfer_message: Optional[str] - """Optional text synthesized while transferring.""" - target_response: Union[str, "VoiceAgentHandoffTargetResponse"] - """Whether the target automatically creates a response after transfer. Known values are: \"auto\" - and \"none\".""" - - -class VoiceAgentHandoffGraphConfig(TypedDict, total=False): - """A customer-supplied handoff graph. - - :ivar max_transfers: The maximum number of successful transfers in the session. - :vartype max_transfers: int - :ivar max_attempts: The maximum number of transfer attempts in the session. - :vartype max_attempts: int - :ivar nodes: The explicitly configured handoff targets. Required. - :vartype nodes: list["VoiceAgentHandoffNodeConfig"] - :ivar edges: The directed transitions between handoff nodes. Required. - :vartype edges: list["VoiceAgentHandoffEdgeConfig"] - """ - - max_transfers: int - """The maximum number of successful transfers in the session.""" - max_attempts: Optional[int] - """The maximum number of transfer attempts in the session.""" - nodes: Required[list["VoiceAgentHandoffNodeConfig"]] - """The explicitly configured handoff targets. Required.""" - edges: Required[list["VoiceAgentHandoffEdgeConfig"]] - """The directed transitions between handoff nodes. Required.""" - - -class VoiceAgentHandoffNodeConfig(TypedDict, total=False): - """A configured handoff target and its node-scoped behavior. - - :ivar id: The node identifier. Required. - :vartype id: str - :ivar description: A non-empty description used to select this target. Required. - :vartype description: str - :ivar config: Session behavior applied after transferring to this node. Required. - :vartype config: "VoiceAgentHandoffNodeSessionConfig" - """ - - id: Required[str] - """The node identifier. Required.""" - description: Required[str] - """A non-empty description used to select this target. Required.""" - config: Required["VoiceAgentHandoffNodeSessionConfig"] - """Session behavior applied after transferring to this node. Required.""" - - -class VoiceAgentHandoffNodeSessionConfig(TypedDict, total=False): - """Session behavior applied at a handoff target. - - :ivar model: The target model, when different from the current node. - :vartype model: str - :ivar instructions: Instructions applied at the target node. - :vartype instructions: str - :ivar tools: Tools available at the target node. - :vartype tools: list["_unions.VoiceAgentSessionTool"] - :ivar tool_choice: Tool-selection behavior at the target node. Is either a Union[str, - "_models.ToolChoiceOptions"] type or a RealtimeToolChoiceFunction type. - :vartype tool_choice: "_unions.VoiceAgentToolChoice" - :ivar voice: The target node's voice. Is one of the following types: OpenAIVoice, AzureVoice, - AzureRealtimeNativeVoice - :vartype voice: "_unions.VoiceAgentVoice" - :ivar temperature: The target node's sampling temperature. - :vartype temperature: float - :ivar max_response_output_tokens: The target node's maximum output-token count. Is either a int - type or a Literal["inf"] type. - :vartype max_response_output_tokens: "_unions.VoiceAgentMaxOutputTokens" - :ivar reasoning_effort: The reasoning effort used at the target node. Known values are: "none", - "minimal", "low", "medium", "high", and "xhigh". - :vartype reasoning_effort: Union[str, "VoiceAgentHandoffReasoningEffort"] - :ivar voice_adaptation: Voice adaptation applied at the target node. - :vartype voice_adaptation: "VoiceAgentVoiceAdaptation" - :ivar interim_response: Interim-response settings applied at the target node. Is either a - VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. - :vartype interim_response: "_unions.VoiceAgentInterimResponse" - :ivar parallel_tool_calls: Whether the target model may call multiple tools in parallel. - :vartype parallel_tool_calls: bool - """ - - model: Optional[str] - """The target model, when different from the current node.""" - instructions: Optional[str] - """Instructions applied at the target node.""" - tools: Optional[list["_unions.VoiceAgentSessionTool"]] - """Tools available at the target node.""" - tool_choice: Optional["_unions.VoiceAgentToolChoice"] - """Tool-selection behavior at the target node. Is either a Union[str, - \"_models.ToolChoiceOptions\"] type or a RealtimeToolChoiceFunction type.""" - voice: Optional["_unions.VoiceAgentVoice"] - """The target node's voice. Is one of the following types: OpenAIVoice, AzureVoice, - AzureRealtimeNativeVoice""" - temperature: Optional[float] - """The target node's sampling temperature.""" - max_response_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] - """The target node's maximum output-token count. Is either a int type or a Literal[\"inf\"] type.""" - reasoning_effort: Optional[Union[str, "VoiceAgentHandoffReasoningEffort"]] - """The reasoning effort used at the target node. Known values are: \"none\", \"minimal\", \"low\", - \"medium\", \"high\", and \"xhigh\".""" - voice_adaptation: Optional["VoiceAgentVoiceAdaptation"] - """Voice adaptation applied at the target node.""" - interim_response: Optional["_unions.VoiceAgentInterimResponse"] - """Interim-response settings applied at the target node. Is either a - VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type.""" - parallel_tool_calls: bool - """Whether the target model may call multiple tools in parallel.""" - - -class VoiceAgentHandoffNodeState(TypedDict, total=False): - """Non-sensitive metadata for an effective handoff node. - - :ivar id: The node identifier. Required. - :vartype id: str - :ivar description: The node description. Required. - :vartype description: str - :ivar implicit: Whether the service implicitly created this node. - :vartype implicit: bool - """ - - id: Required[str] - """The node identifier. Required.""" - description: Required[str] - """The node description. Required.""" - implicit: bool - """Whether the service implicitly created this node.""" - - -class VoiceAgentHandoffState(TypedDict, total=False): - """The effective handoff state returned by the service. - - :ivar pipeline_family: The runtime pipeline family. Required. Known values are: "cascaded" and - "realtime". - :vartype pipeline_family: Union[str, "VoiceAgentPipelineFamily"] - :ivar active_node_id: The active node identifier. Required. - :vartype active_node_id: str - :ivar node_generation: The active node generation. Required. - :vartype node_generation: int - :ivar transfer_count: The number of completed transfers. Required. - :vartype transfer_count: int - :ivar attempt_count: The number of transfer attempts. Required. - :vartype attempt_count: int - :ivar available_edge_ids: The edge identifiers currently available to the model. Required. - :vartype available_edge_ids: list[str] - :ivar transfer_tool: The function tool exposed to initiate transfers. Required. - :vartype transfer_tool: "RealtimeFunctionTool" - :ivar nodes: The compiled handoff nodes. Required. - :vartype nodes: list["VoiceAgentHandoffNodeState"] - :ivar edges: The compiled handoff edges. Required. - :vartype edges: list["VoiceAgentHandoffEdgeState"] - """ - - pipeline_family: Required[Union[str, "VoiceAgentPipelineFamily"]] - """The runtime pipeline family. Required. Known values are: \"cascaded\" and \"realtime\".""" - active_node_id: Required[str] - """The active node identifier. Required.""" - node_generation: Required[int] - """The active node generation. Required.""" - transfer_count: Required[int] - """The number of completed transfers. Required.""" - attempt_count: Required[int] - """The number of transfer attempts. Required.""" - available_edge_ids: Required[list[str]] - """The edge identifiers currently available to the model. Required.""" - transfer_tool: Required[Optional["RealtimeFunctionTool"]] - """The function tool exposed to initiate transfers. Required.""" - nodes: Required[list["VoiceAgentHandoffNodeState"]] - """The compiled handoff nodes. Required.""" - edges: Required[list["VoiceAgentHandoffEdgeState"]] - """The compiled handoff edges. Required.""" - - -class VoiceAgentLlmInterimResponseConfig(TypedDict, total=False): - """An interim response generated by a language model. - - :ivar triggers: Conditions that may trigger one interim response. - :vartype triggers: list[Union[str, "VoiceAgentInterimResponseTrigger"]] - :ivar latency_threshold_ms: The latency threshold in milliseconds. - :vartype latency_threshold_ms: int - :ivar type: Required. Default value is "llm_interim_response". - :vartype type: Literal["llm_interim_response"] - :ivar model: The model used to generate interim responses. - :vartype model: str - :ivar instructions: Optional instructions for generating interim responses. - :vartype instructions: str - :ivar max_completion_tokens: The maximum completion-token count for an interim response. - :vartype max_completion_tokens: int - """ - - triggers: list[Union[str, "VoiceAgentInterimResponseTrigger"]] - """Conditions that may trigger one interim response.""" - latency_threshold_ms: int - """The latency threshold in milliseconds.""" - type: Required[Literal["llm_interim_response"]] - """Required. Default value is \"llm_interim_response\".""" - model: str - """The model used to generate interim responses.""" - instructions: str - """Optional instructions for generating interim responses.""" - max_completion_tokens: int - """The maximum completion-token count for an interim response.""" - - -class VoiceAgentMcpAssignedManagedIdentity(TypedDict, total=False): - """A managed identity used to authorize a voice-agent MCP connection. - - :ivar type: Required. Default value is "assigned_managed_identity". - :vartype type: Literal["assigned_managed_identity"] - :ivar audience: Required. - :vartype audience: str - :ivar client_id: - :vartype client_id: str - """ - - type: Required[Literal["assigned_managed_identity"]] - """Required. Default value is \"assigned_managed_identity\".""" - audience: Required[str] - """Required.""" - client_id: str - - -class VoiceAgentMcpTool(TypedDict, total=False): - """An MCP tool available to a voice agent. - - :ivar type: The type of the MCP tool. Always ``mcp``. Required. MCP. - :vartype type: Literal[ToolType.MCP] - :ivar server_label: A label for this MCP server, used to identify it in tool calls. Required. - :vartype server_label: 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: Union[list[str], "MCPToolFilter"] - :ivar allowed_callers: - :vartype allowed_callers: list[Union[str, "CallableToolAllowedCaller"]] - :ivar require_approval: Is one of the following types: MCPToolRequireApproval, - Literal["always"], Literal["never"] - :vartype require_approval: Union["MCPToolRequireApproval", Literal["always"], Literal["never"]] - :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, "ToolConfig"] - :ivar server_url: The URL for the MCP server. - :vartype server_url: str - :ivar response_scheduling: When the MCP invocation creates a follow-up response. Defaults to - ``when_idle`` so the agent continues after the tool call completes. Known values are: "silent", - "when_idle", "interrupt", and "skip_if_busy". - :vartype response_scheduling: Union[str, "VoiceAgentMcpResponseScheduling"] - """ - - type: Required[Literal[ToolType.MCP]] - """The type of the MCP tool. Always ``mcp``. Required. MCP.""" - server_label: Required[str] - """A label for this MCP server, used to identify it in tool calls. Required.""" - server_description: str - """Optional description of the MCP server, used to provide more context.""" - headers: Optional[dict[str, str]] - allowed_tools: Optional[Union[list[str], "MCPToolFilter"]] - """Is either a [str] type or a MCPToolFilter type.""" - allowed_callers: Optional[list[Union[str, "CallableToolAllowedCaller"]]] - require_approval: Optional[Union["MCPToolRequireApproval", Literal["always"], Literal["never"]]] - """Is one of the following types: MCPToolRequireApproval, Literal[\"always\"], Literal[\"never\"]""" - defer_loading: bool - """Whether this MCP tool is deferred and discovered via tool search.""" - project_connection_id: str - """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: dict[str, "ToolConfig"] - """Deprecated. This property is deprecated and will be removed in a future version.""" - server_url: str - """The URL for the MCP server.""" - response_scheduling: Union[str, "VoiceAgentMcpResponseScheduling"] - """When the MCP invocation creates a follow-up response. Defaults to ``when_idle`` so the agent - continues after the tool call completes. Known values are: \"silent\", \"when_idle\", - \"interrupt\", and \"skip_if_busy\".""" - - -class VoiceAgentRealtimeResponse(TypedDict, total=False): - """A realtime response returned by the voice-agent service. - - :ivar object: The object type. Always ``realtime.response``. Required. Default value is - "realtime.response". - :vartype object: Literal["realtime.response"] - :ivar id: The response identifier. Required. - :vartype id: str - :ivar status: The response lifecycle status. Required. Known values are: "in_progress", - "completed", "cancelled", "incomplete", and "failed". - :vartype status: Union[str, "VoiceAgentResponseStatus"] - :ivar status_details: Additional details for a terminal response status. Required. - :vartype status_details: "RealtimeResponseStatusDetails" - :ivar output: The items produced by the response. Required. - :vartype output: list["_unions.VoiceAgentResponseItem"] - :ivar usage: Token usage for the response. Required. - :vartype usage: "RealtimeResponseUsage" - :ivar estimated_cost: The best-effort response cost estimate. Returned only when cost output is - enabled. - :vartype estimated_cost: "VoiceAgentEstimatedCost" - :ivar conversation_id: The conversation identifier, or null for an out-of-band response. - :vartype conversation_id: str - :ivar modalities: The modalities used by the response. - :vartype modalities: list[Union[str, "VoiceOutputModality"]] - :ivar voice: The voice used by the response. Is one of the following types: OpenAIVoice, - AzureVoice, AzureRealtimeNativeVoice - :vartype voice: "_unions.VoiceAgentVoice" - :ivar output_audio_format: The output-audio format used by the response. Known values are: - "pcm16", "pcm16_8000hz", "pcm16_16000hz", "pcm16_22050hz", "pcm16_24000hz", "pcm16_44100hz", - "pcm16_48000hz", "g711_ulaw", "g711_alaw", "mp3", "mp3_24khz_48kbps", "mp3_24khz_96kbps", and - "mp3_24khz_160kbps". - :vartype output_audio_format: Union[str, "VoiceAgentResponseAudioFormat"] - :ivar temperature: The sampling temperature used by the response. - :vartype temperature: float - :ivar max_output_tokens: The maximum output-token count used by the response. Is either a int - type or a Literal["inf"] type. - :vartype max_output_tokens: "_unions.VoiceAgentMaxOutputTokens" - :ivar metadata: String key-value metadata attached to the response. - :vartype metadata: dict[str, str] - """ - - object: Required[Literal["realtime.response"]] - """The object type. Always ``realtime.response``. Required. Default value is - \"realtime.response\".""" - id: Required[str] - """The response identifier. Required.""" - status: Required[Union[str, "VoiceAgentResponseStatus"]] - """The response lifecycle status. Required. Known values are: \"in_progress\", \"completed\", - \"cancelled\", \"incomplete\", and \"failed\".""" - status_details: Required[Optional["RealtimeResponseStatusDetails"]] - """Additional details for a terminal response status. Required.""" - output: Required[list["_unions.VoiceAgentResponseItem"]] - """The items produced by the response. Required.""" - usage: Required[Optional["RealtimeResponseUsage"]] - """Token usage for the response. Required.""" - estimated_cost: "VoiceAgentEstimatedCost" - """The best-effort response cost estimate. Returned only when cost output is enabled.""" - conversation_id: Optional[str] - """The conversation identifier, or null for an out-of-band response.""" - modalities: Optional[list[Union[str, "VoiceOutputModality"]]] - """The modalities used by the response.""" - voice: Optional["_unions.VoiceAgentVoice"] - """The voice used by the response. Is one of the following types: OpenAIVoice, AzureVoice, - AzureRealtimeNativeVoice""" - output_audio_format: Optional[Union[str, "VoiceAgentResponseAudioFormat"]] - """The output-audio format used by the response. Known values are: \"pcm16\", \"pcm16_8000hz\", - \"pcm16_16000hz\", \"pcm16_22050hz\", \"pcm16_24000hz\", \"pcm16_44100hz\", \"pcm16_48000hz\", - \"g711_ulaw\", \"g711_alaw\", \"mp3\", \"mp3_24khz_48kbps\", \"mp3_24khz_96kbps\", and - \"mp3_24khz_160kbps\".""" - temperature: Optional[float] - """The sampling temperature used by the response.""" - max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] - """The maximum output-token count used by the response. Is either a int type or a Literal[\"inf\"] - type.""" - metadata: Optional[dict[str, str]] - """String key-value metadata attached to the response.""" - - -class VoiceAgentResponseCreateAudio(TypedDict, total=False): - """Output-audio settings applied to one ``response.create`` request. - - :ivar output: The response-specific output-audio settings. - :vartype output: "VoiceAgentSessionUpdateAudioOutput" - """ - - output: Optional["VoiceAgentSessionUpdateAudioOutput"] - """The response-specific output-audio settings.""" - - -class VoiceAgentResponseCreateParams(TypedDict, total=False): - """Parameters accepted by a voice-agent ``response.create`` event. - - :ivar instructions: The default system instructions (i.e. system message) prepended to model - calls. This field allows the client to guide the model on desired responses. The model can be - instructed on response content and format, (e.g. "be extremely succinct", "act friendly", "here - are examples of good responses") and on audio behavior (e.g. "talk quickly", "inject emotion - into your voice", "laugh frequently"). The instructions are not guaranteed to be followed by - the model, but they provide guidance to the model on the desired behavior. Note that the server - sets default instructions which will be used if this field is not set and are visible in the - ``session.created`` event at the start of the session. - :vartype instructions: str - :ivar tools: Tools available to the model. - :vartype tools: list[Union["RealtimeFunctionTool", "MCPTool"]] - :ivar tool_choice: How the model chooses tools. Provide one of the string modes or force a - specific function/MCP tool. Is one of the following types: Union[str, - "_models.ToolChoiceOptions"], ToolChoiceFunction, ToolChoiceMCP - :vartype tool_choice: Union[str, "ToolChoiceOptions", "ToolChoiceFunction", "ToolChoiceMCP"] - :ivar parallel_tool_calls: Whether the model may call multiple tools in parallel. Only - supported by reasoning Realtime models such as ``gpt-realtime-2``. - :vartype parallel_tool_calls: bool - :ivar reasoning: - :vartype reasoning: "RealtimeReasoning" - :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, - inclusive of tool calls. Provide an integer between 1 and 4096 to limit output tokens, or - ``inf`` for the maximum available tokens for a given model. Defaults to ``inf``. Is either a - int type or a Literal["inf"] type. - :vartype max_output_tokens: Union[int, Literal["inf"]] - :ivar conversation: Controls which conversation the response is added to. Currently supports - ``auto`` and ``none``, with ``auto`` as the default value. The ``auto`` value means that the - contents of the response will be added to the default conversation. Set this to ``none`` to - create an out-of-band response which will not add items to default conversation. Is one of the - following types: Literal["auto"], Literal["none"], str - :vartype conversation: Union[Literal["auto"], Literal["none"], str] - :ivar metadata: - :vartype metadata: "Metadata" - :ivar input: Input items to include in the prompt for the model. Using this field creates a new - context for this Response instead of using the default conversation. An empty array ``[]`` will - clear the context for this Response. Note that this can include references to items that - previously appeared in the session using their id. - :vartype input: list["RealtimeConversationItem"] - :ivar output_modalities: Modalities that the response may return. - :vartype output_modalities: list[Union[str, "VoiceOutputModality"]] - :ivar audio: Response-specific audio settings. - :vartype audio: "VoiceAgentResponseCreateAudio" - :ivar pre_generated_assistant_message: A pre-generated assistant message used to begin the - response. - :vartype pre_generated_assistant_message: "RealtimeConversationItemMessageAssistant" - :ivar interim_response: Interim-response settings for this response. Is either a - VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. - :vartype interim_response: "_unions.VoiceAgentInterimResponse" - """ - - instructions: str - """The default system instructions (i.e. system message) prepended to model calls. This field - allows the client to guide the model on desired responses. The model can be instructed on - response content and format, (e.g. \"be extremely succinct\", \"act friendly\", \"here are - examples of good responses\") and on audio behavior (e.g. \"talk quickly\", \"inject emotion - into your voice\", \"laugh frequently\"). The instructions are not guaranteed to be followed by - the model, but they provide guidance to the model on the desired behavior. Note that the server - sets default instructions which will be used if this field is not set and are visible in the - ``session.created`` event at the start of the session.""" - tools: list[Union["RealtimeFunctionTool", "MCPTool"]] - """Tools available to the model.""" - tool_choice: Union[str, "ToolChoiceOptions", "ToolChoiceFunction", "ToolChoiceMCP"] - """How the model chooses tools. Provide one of the string modes or force a specific function/MCP - tool. Is one of the following types: Union[str, \"_models.ToolChoiceOptions\"], - ToolChoiceFunction, ToolChoiceMCP""" - parallel_tool_calls: bool - """Whether the model may call multiple tools in parallel. Only supported by reasoning Realtime - models such as ``gpt-realtime-2``.""" - reasoning: "RealtimeReasoning" - max_output_tokens: Union[int, Literal["inf"]] - """Maximum number of output tokens for a single assistant response, inclusive of tool calls. - Provide an integer between 1 and 4096 to limit output tokens, or ``inf`` for the maximum - available tokens for a given model. Defaults to ``inf``. Is either a int type or a - Literal[\"inf\"] type.""" - conversation: Union[Literal["auto"], Literal["none"], str] - """Controls which conversation the response is added to. Currently supports ``auto`` and ``none``, - with ``auto`` as the default value. The ``auto`` value means that the contents of the response - will be added to the default conversation. Set this to ``none`` to create an out-of-band - response which will not add items to default conversation. Is one of the following types: - Literal[\"auto\"], Literal[\"none\"], str""" - metadata: Optional["Metadata"] - input: list["RealtimeConversationItem"] - """Input items to include in the prompt for the model. Using this field creates a new context for - this Response instead of using the default conversation. An empty array ``[]`` will clear the - context for this Response. Note that this can include references to items that previously - appeared in the session using their id.""" - output_modalities: list[Union[str, "VoiceOutputModality"]] - """Modalities that the response may return.""" - audio: "VoiceAgentResponseCreateAudio" - """Response-specific audio settings.""" - pre_generated_assistant_message: Optional["RealtimeConversationItemMessageAssistant"] - """A pre-generated assistant message used to begin the response.""" - interim_response: Optional["_unions.VoiceAgentInterimResponse"] - """Interim-response settings for this response. Is either a VoiceAgentStaticInterimResponseConfig - type or a VoiceAgentLlmInterimResponseConfig type.""" - - -class VoiceAgentResponseEventAudioContentPart(TypedDict, total=False): - """An audio part in a ``response.content_part.*`` server event. - - :ivar type: Required. Default value is "audio". - :vartype type: Literal["audio"] - :ivar transcript: Required. - :vartype transcript: str - :ivar annotations: - :vartype annotations: Any - :ivar audio: - :vartype audio: str - :ivar format: - :vartype format: "VoiceAudioFormat" - """ - - type: Required[Literal["audio"]] - """Required. Default value is \"audio\".""" - transcript: Required[Optional[str]] - """Required.""" - annotations: Any - audio: str - format: "VoiceAudioFormat" - - -class VoiceAgentResponseEventTextContentPart(TypedDict, total=False): - """A text part in a ``response.content_part.*`` server event. - - :ivar type: Required. Default value is "text". - :vartype type: Literal["text"] - :ivar text: Required. - :vartype text: str - """ - - type: Required[Literal["text"]] - """Required. Default value is \"text\".""" - text: Required[str] - """Required.""" - - -class VoiceAgentSemanticVadTurnDetection(TypedDict, total=False): - """OpenAI semantic VAD turn-detection settings. - - :ivar eagerness: Is one of the following types: Literal["low"], Literal["medium"], - Literal["high"], Literal["auto"] - :vartype eagerness: Literal["low", "medium", "high", "auto"] - :ivar create_response: - :vartype create_response: bool - :ivar interrupt_response: - :vartype interrupt_response: bool - :ivar type: Required. Semantic voice activity detection. - :vartype type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD] - :ivar auto_truncate: - :vartype auto_truncate: bool - """ - - eagerness: Literal["low", "medium", "high", "auto"] - """Is one of the following types: Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"], - Literal[\"auto\"]""" - create_response: bool - interrupt_response: bool - type: Required[Literal[VoiceTurnDetectionType.SEMANTIC_VAD]] - """Required. Semantic voice activity detection.""" - auto_truncate: bool - - -class VoiceAgentServerEventConversationCreated(TypedDict, total=False): - """The ``conversation.created`` server event emitted when a voice-agent connection starts. - - :ivar type: Required. Default value is "conversation.created". - :vartype type: Literal["conversation.created"] - :ivar conversation_id: The identifier of the created conversation. Required. - :vartype conversation_id: str - """ - - type: Required[Literal["conversation.created"]] - """Required. Default value is \"conversation.created\".""" - conversation_id: Required[str] - """The identifier of the created conversation. Required.""" - - -class VoiceAgentServerEventConversationItemAdded(TypedDict, total=False): # pylint: disable=name-too-long - """The ``conversation.item.added`` server event. - - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.added``. Required. - CONVERSATION_ITEM_ADDED. - :vartype type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED] - :ivar previous_item_id: - :vartype previous_item_id: str - :ivar item: The item added to the conversation. Required. Is one of the following types: - "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, - VoiceAgentFileSearchCallItem - :vartype item: "_unions.VoiceAgentResponseItem" - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED]] - """The event type, must be ``conversation.item.added``. Required. CONVERSATION_ITEM_ADDED.""" - previous_item_id: Optional[str] - item: Required["_unions.VoiceAgentResponseItem"] - """The item added to the conversation. Required. Is one of the following types: - \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, - VoiceAgentFileSearchCallItem""" - - -class VoiceAgentServerEventConversationItemCreated(TypedDict, total=False): # pylint: disable=name-too-long - """The ``conversation.item.created`` server event. - - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.created``. Required. - CONVERSATION_ITEM_CREATED. - :vartype type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED] - :ivar previous_item_id: - :vartype previous_item_id: str - :ivar item: The created conversation item. Required. Is one of the following types: - "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, - VoiceAgentFileSearchCallItem - :vartype item: "_unions.VoiceAgentResponseItem" - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED]] - """The event type, must be ``conversation.item.created``. Required. CONVERSATION_ITEM_CREATED.""" - previous_item_id: Optional[str] - item: Required["_unions.VoiceAgentResponseItem"] - """The created conversation item. Required. Is one of the following types: - \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, - VoiceAgentFileSearchCallItem""" - - -class VoiceAgentServerEventConversationItemDeleted(TypedDict, total=False): # pylint: disable=name-too-long - """The ``conversation.item.deleted`` server event. - - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.deleted``. Required. - CONVERSATION_ITEM_DELETED. - :vartype type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED] - :ivar item_id: The ID of the item that was deleted. Required. - :vartype item_id: str - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED]] - """The event type, must be ``conversation.item.deleted``. Required. CONVERSATION_ITEM_DELETED.""" - item_id: Required[str] - """The ID of the item that was deleted. Required.""" - - -class VoiceAgentServerEventConversationItemDone(TypedDict, total=False): # pylint: disable=name-too-long - """The ``conversation.item.done`` server event. - - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.done``. Required. - CONVERSATION_ITEM_DONE. - :vartype type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE] - :ivar previous_item_id: - :vartype previous_item_id: str - :ivar item: The completed conversation item. Required. Is one of the following types: - "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, - VoiceAgentFileSearchCallItem - :vartype item: "_unions.VoiceAgentResponseItem" - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE]] - """The event type, must be ``conversation.item.done``. Required. CONVERSATION_ITEM_DONE.""" - previous_item_id: Optional[str] - item: Required["_unions.VoiceAgentResponseItem"] - """The completed conversation item. Required. Is one of the following types: - \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, - VoiceAgentFileSearchCallItem""" - - -class VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted( - TypedDict, total=False -): # pylint: disable=name-too-long - """The ``conversation.item.input_audio_transcription.completed`` server event. - - :ivar event_id: The unique ID of the server event. Required. - :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: - Literal[RealtimeServerEventType.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 logprobs: - :vartype logprobs: list["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: Union["TranscriptTextUsageTokens", "TranscriptTextUsageDuration"] - :ivar phrases: Phrase-level transcription timing and confidence details. - :vartype phrases: list["VoiceAgentTranscriptionPhrase"] - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED]] - """The event type, must be ``conversation.item.input_audio_transcription.completed``. Required. - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED.""" - item_id: Required[str] - """The ID of the item containing the audio that is being transcribed. Required.""" - content_index: Required[int] - """The index of the content part containing the audio. Required.""" - transcript: Required[str] - """The transcribed text. Required.""" - logprobs: Optional[list["LogProbProperties"]] - usage: Required[Union["TranscriptTextUsageTokens", "TranscriptTextUsageDuration"]] - """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["VoiceAgentTranscriptionPhrase"]] - """Phrase-level transcription timing and confidence details.""" - - -class VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta( - TypedDict, total=False -): # pylint: disable=name-too-long - """The ``conversation.item.input_audio_transcription.delta`` server event. - - :ivar event_id: The unique ID of the server event. Required. - :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: - Literal[RealtimeServerEventType.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["LogProbProperties"] - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA]] - """The event type, must be ``conversation.item.input_audio_transcription.delta``. Required. - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA.""" - item_id: Required[str] - """The ID of the item containing the audio that is being transcribed. Required.""" - content_index: int - """The index of the content part in the item's content array.""" - delta: str - """The text delta.""" - logprobs: Optional[list["LogProbProperties"]] - - -class VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed( - TypedDict, total=False -): # pylint: disable=name-too-long - """The ``conversation.item.input_audio_transcription.failed`` server event. - - :ivar event_id: The unique ID of the server event. Required. - :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: - Literal[RealtimeServerEventType.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: "RealtimeServerEventConversationItemInputAudioTranscriptionFailedError" - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED]] - """The event type, must be ``conversation.item.input_audio_transcription.failed``. Required. - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED.""" - item_id: Required[str] - """The ID of the user message item. Required.""" - content_index: Required[int] - """The index of the content part containing the audio. Required.""" - error: Required["RealtimeServerEventConversationItemInputAudioTranscriptionFailedError"] - """Details of the transcription error. Required.""" - - -class VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment( - TypedDict, total=False -): # pylint: disable=name-too-long - """The ``conversation.item.input_audio_transcription.segment`` server event. - - :ivar event_id: The unique ID of the server event. Required. - :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: - Literal[RealtimeServerEventType.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: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT]] - """The event type, must be ``conversation.item.input_audio_transcription.segment``. Required. - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT.""" - item_id: Required[str] - """The ID of the item containing the input audio content. Required.""" - content_index: Required[int] - """The index of the input audio content part within the item. Required.""" - text: Required[str] - """The text for this segment. Required.""" - id: Required[str] - """The segment identifier. Required.""" - speaker: Required[str] - """The detected speaker label for this segment. Required.""" - start: Required[float] - """Start time of the segment in seconds. Required.""" - end: Required[float] - """End time of the segment in seconds. Required.""" - - -class VoiceAgentServerEventConversationItemRetrieved(TypedDict, total=False): # pylint: disable=name-too-long - """The ``conversation.item.retrieved`` server event. - - :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: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED] - :ivar item: The retrieved conversation item. Required. Is one of the following types: - "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, - VoiceAgentFileSearchCallItem - :vartype item: "_unions.VoiceAgentResponseItem" - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED]] - """The event type, must be ``conversation.item.retrieved``. Required. CONVERSATION_ITEM_RETRIEVED.""" - item: Required["_unions.VoiceAgentResponseItem"] - """The retrieved conversation item. Required. Is one of the following types: - \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, - VoiceAgentFileSearchCallItem""" - - -class VoiceAgentServerEventConversationItemTruncated(TypedDict, total=False): # pylint: disable=name-too-long - """The ``conversation.item.truncated`` server event. - - :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: Literal[RealtimeServerEventType.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: "RealtimeConversationItemMessageAssistant" - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED]] - """The event type, must be ``conversation.item.truncated``. Required. CONVERSATION_ITEM_TRUNCATED.""" - item_id: Required[str] - """The ID of the assistant message item that was truncated. Required.""" - content_index: Required[int] - """The index of the content part that was truncated. Required.""" - audio_end_ms: Required[int] - """The duration up to which the audio was truncated, in milliseconds. Required.""" - item: "RealtimeConversationItemMessageAssistant" - """The assistant message after truncation, when the service returns the updated item.""" - - -class VoiceAgentServerEventError(TypedDict, total=False): - """The ``error`` server event. - - :ivar event_id: The unique identifier of the event. Required. - :vartype event_id: str - :ivar type: Required. Default value is "error". - :vartype type: Literal["error"] - :ivar error: Details of the error. Required. - :vartype error: "VoiceAgentServerEventErrorDetails" - """ - - event_id: Required[str] - """The unique identifier of the event. Required.""" - type: Required[Literal["error"]] - """Required. Default value is \"error\".""" - error: Required["VoiceAgentServerEventErrorDetails"] - """Details of the error. Required.""" - - -class VoiceAgentServerEventErrorDetails(TypedDict, total=False): - """Details of a voice-agent WebSocket error. - - :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 tool_label: The configured label of a tool that could not be resolved. - :vartype tool_label: str - :ivar tool_type: The configured type of a tool that could not be resolved. - :vartype tool_type: str - """ - - type: Required[str] - """Required.""" - code: Optional[str] - message: Required[str] - """Required.""" - param: Optional[str] - event_id: Optional[str] - tool_label: str - """The configured label of a tool that could not be resolved.""" - tool_type: str - """The configured type of a tool that could not be resolved.""" - - -class VoiceAgentServerEventFileSearchCallCompleted(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.file_search_call.completed`` server event. - - :ivar type: Required. Default value is "response.file_search_call.completed". - :vartype type: Literal["response.file_search_call.completed"] - :ivar event_id: - :vartype event_id: str - :ivar response_id: - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar sequence_number: Required. - :vartype sequence_number: int - """ - - type: Required[Literal["response.file_search_call.completed"]] - """Required. Default value is \"response.file_search_call.completed\".""" - event_id: str - response_id: str - item_id: Required[str] - """Required.""" - output_index: Required[int] - """Required.""" - sequence_number: Required[int] - """Required.""" - - -class VoiceAgentServerEventFileSearchCallInProgress(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.file_search_call.in_progress`` server event. - - :ivar type: Required. Default value is "response.file_search_call.in_progress". - :vartype type: Literal["response.file_search_call.in_progress"] - :ivar event_id: - :vartype event_id: str - :ivar response_id: - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar sequence_number: Required. - :vartype sequence_number: int - """ - - type: Required[Literal["response.file_search_call.in_progress"]] - """Required. Default value is \"response.file_search_call.in_progress\".""" - event_id: str - response_id: str - item_id: Required[str] - """Required.""" - output_index: Required[int] - """Required.""" - sequence_number: Required[int] - """Required.""" - - -class VoiceAgentServerEventFileSearchCallSearching(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.file_search_call.searching`` server event. - - :ivar type: Required. Default value is "response.file_search_call.searching". - :vartype type: Literal["response.file_search_call.searching"] - :ivar event_id: - :vartype event_id: str - :ivar response_id: - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar sequence_number: Required. - :vartype sequence_number: int - """ - - type: Required[Literal["response.file_search_call.searching"]] - """Required. Default value is \"response.file_search_call.searching\".""" - event_id: str - response_id: str - item_id: Required[str] - """Required.""" - output_index: Required[int] - """Required.""" - sequence_number: Required[int] - """Required.""" - - -class VoiceAgentServerEventInputAudioBufferCleared(TypedDict, total=False): # pylint: disable=name-too-long - """The ``input_audio_buffer.cleared`` server event. - - :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: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED] - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED]] - """The event type, must be ``input_audio_buffer.cleared``. Required. INPUT_AUDIO_BUFFER_CLEARED.""" - - -class VoiceAgentServerEventInputAudioBufferCommitted(TypedDict, total=False): # pylint: disable=name-too-long - """The ``input_audio_buffer.committed`` server event. - - :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: Literal[RealtimeServerEventType.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 - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED]] - """The event type, must be ``input_audio_buffer.committed``. Required. - INPUT_AUDIO_BUFFER_COMMITTED.""" - previous_item_id: Optional[str] - item_id: Required[str] - """The ID of the user message item that will be created. Required.""" - - -class VoiceAgentServerEventInputAudioBufferSpeechStarted(TypedDict, total=False): # pylint: disable=name-too-long - """The ``input_audio_buffer.speech_started`` server event. - - :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: Literal[RealtimeServerEventType.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 - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED]] - """The event type, must be ``input_audio_buffer.speech_started``. Required. - INPUT_AUDIO_BUFFER_SPEECH_STARTED.""" - audio_start_ms: Required[int] - """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: Required[str] - """The ID of the user message item that will be created when speech stops. Required.""" - - -class VoiceAgentServerEventInputAudioBufferSpeechStopped(TypedDict, total=False): # pylint: disable=name-too-long - """The ``input_audio_buffer.speech_stopped`` server event. - - :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: Literal[RealtimeServerEventType.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 - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED]] - """The event type, must be ``input_audio_buffer.speech_stopped``. Required. - INPUT_AUDIO_BUFFER_SPEECH_STOPPED.""" - audio_end_ms: Required[int] - """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: Required[str] - """The ID of the user message item that will be created. Required.""" - - -class VoiceAgentServerEventInputAudioBufferTimeoutTriggered(TypedDict, total=False): # pylint: disable=name-too-long - """The ``input_audio_buffer.timeout_triggered`` server event. - - :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: Literal[RealtimeServerEventType.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 - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED]] - """The event type, must be ``input_audio_buffer.timeout_triggered``. Required. - INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED.""" - audio_start_ms: Required[int] - """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: Required[int] - """Millisecond offset of audio written to the input audio buffer at the time the timeout was - triggered. Required.""" - item_id: Required[str] - """The ID of the item associated with this segment. Required.""" - - -class VoiceAgentServerEventMcpListToolsCompleted(TypedDict, total=False): # pylint: disable=name-too-long - """The ``mcp_list_tools.completed`` server event. - - :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: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED] - :ivar item_id: The ID of the MCP list tools item. Required. - :vartype item_id: str - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED]] - """The event type, must be ``mcp_list_tools.completed``. Required. MCP_LIST_TOOLS_COMPLETED.""" - item_id: Required[str] - """The ID of the MCP list tools item. Required.""" - - -class VoiceAgentServerEventMcpListToolsFailed(TypedDict, total=False): - """The ``mcp_list_tools.failed`` server event. - - :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: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED] - :ivar item_id: The ID of the MCP list tools item. Required. - :vartype item_id: str - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED]] - """The event type, must be ``mcp_list_tools.failed``. Required. MCP_LIST_TOOLS_FAILED.""" - item_id: Required[str] - """The ID of the MCP list tools item. Required.""" - - -class VoiceAgentServerEventMcpListToolsInProgress(TypedDict, total=False): # pylint: disable=name-too-long - """The ``mcp_list_tools.in_progress`` server event. - - :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: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS] - :ivar item_id: The ID of the MCP list tools item. Required. - :vartype item_id: str - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS]] - """The event type, must be ``mcp_list_tools.in_progress``. Required. MCP_LIST_TOOLS_IN_PROGRESS.""" - item_id: Required[str] - """The ID of the MCP list tools item. Required.""" - - -class VoiceAgentServerEventOutputAudioBufferCleared(TypedDict, total=False): # pylint: disable=name-too-long - """The ``output_audio_buffer.cleared`` server event. - - :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: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED] - :ivar response_id: The unique ID of the response that produced the audio. Required. - :vartype response_id: str - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED]] - """The event type, must be ``output_audio_buffer.cleared``. Required. OUTPUT_AUDIO_BUFFER_CLEARED.""" - response_id: Required[str] - """The unique ID of the response that produced the audio. Required.""" - - -class VoiceAgentServerEventRateLimitsUpdated(TypedDict, total=False): - """The ``rate_limits.updated`` server event. - - :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: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED] - :ivar rate_limits: List of rate limit information. Required. - :vartype rate_limits: list["RealtimeServerEventRateLimitsUpdatedRateLimits"] - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED]] - """The event type, must be ``rate_limits.updated``. Required. RATE_LIMITS_UPDATED.""" - rate_limits: Required[list["RealtimeServerEventRateLimitsUpdatedRateLimits"]] - """List of rate limit information. Required.""" - - -class VoiceAgentServerEventResponseAnimationBlendshapesDelta(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.animation_blendshapes.delta`` server event. - - :ivar type: Required. Default value is "response.animation_blendshapes.delta". - :vartype type: Literal["response.animation_blendshapes.delta"] - :ivar event_id: Required. - :vartype event_id: str - :ivar response_id: Required. - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar content_index: Required. - :vartype content_index: int - :ivar frames: Animation frames as numeric blendshape weights or a compact encoded string. - Required. Is either a [[float]] type or a str type. - :vartype frames: Union[list[list[float]], str] - :ivar frame_index: The index of the first frame in this delta. Required. - :vartype frame_index: int - """ - - type: Required[Literal["response.animation_blendshapes.delta"]] - """Required. Default value is \"response.animation_blendshapes.delta\".""" - event_id: Required[str] - """Required.""" - response_id: Required[str] - """Required.""" - item_id: Required[str] - """Required.""" - output_index: Required[int] - """Required.""" - content_index: Required[int] - """Required.""" - frames: Required[Union[list[list[float]], str]] - """Animation frames as numeric blendshape weights or a compact encoded string. Required. Is either - a [[float]] type or a str type.""" - frame_index: Required[int] - """The index of the first frame in this delta. Required.""" - - -class VoiceAgentServerEventResponseAnimationBlendshapesDone(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.animation_blendshapes.done`` server event. - - :ivar type: Required. Default value is "response.animation_blendshapes.done". - :vartype type: Literal["response.animation_blendshapes.done"] - :ivar event_id: Required. - :vartype event_id: str - :ivar response_id: Required. - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - """ - - type: Required[Literal["response.animation_blendshapes.done"]] - """Required. Default value is \"response.animation_blendshapes.done\".""" - event_id: Required[str] - """Required.""" - response_id: Required[str] - """Required.""" - item_id: Required[str] - """Required.""" - output_index: Required[int] - """Required.""" - - -class VoiceAgentServerEventResponseAnimationVisemeDelta(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.animation_viseme.delta`` server event. - - :ivar type: Required. Default value is "response.animation_viseme.delta". - :vartype type: Literal["response.animation_viseme.delta"] - :ivar event_id: Required. - :vartype event_id: str - :ivar response_id: Required. - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar content_index: Required. - :vartype content_index: int - :ivar audio_offset_ms: Required. - :vartype audio_offset_ms: int - :ivar viseme_id: Required. - :vartype viseme_id: int - """ - - type: Required[Literal["response.animation_viseme.delta"]] - """Required. Default value is \"response.animation_viseme.delta\".""" - event_id: Required[str] - """Required.""" - response_id: Required[str] - """Required.""" - item_id: Required[str] - """Required.""" - output_index: Required[int] - """Required.""" - content_index: Required[int] - """Required.""" - audio_offset_ms: Required[int] - """Required.""" - viseme_id: Required[int] - """Required.""" - - -class VoiceAgentServerEventResponseAnimationVisemeDone(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.animation_viseme.done`` server event. - - :ivar type: Required. Default value is "response.animation_viseme.done". - :vartype type: Literal["response.animation_viseme.done"] - :ivar event_id: Required. - :vartype event_id: str - :ivar response_id: Required. - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar content_index: Required. - :vartype content_index: int - """ - - type: Required[Literal["response.animation_viseme.done"]] - """Required. Default value is \"response.animation_viseme.done\".""" - event_id: Required[str] - """Required.""" - response_id: Required[str] - """Required.""" - item_id: Required[str] - """Required.""" - output_index: Required[int] - """Required.""" - content_index: Required[int] - """Required.""" - - -class VoiceAgentServerEventResponseAudioDelta(TypedDict, total=False): - """The ``response.output_audio.delta`` server event. - - :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: Literal[RealtimeServerEventType.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: str - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA]] - """The event type, must be ``response.output_audio.delta``. Required. RESPONSE_OUTPUT_AUDIO_DELTA.""" - response_id: Required[str] - """The ID of the response. Required.""" - item_id: Required[str] - """The ID of the item. Required.""" - output_index: Required[int] - """The index of the output item in the response. Required.""" - content_index: Required[int] - """The index of the content part in the item's content array. Required.""" - delta: Required[str] - """Base64-encoded audio data delta. Required.""" - - -class VoiceAgentServerEventResponseAudioDone(TypedDict, total=False): - """The ``response.output_audio.done`` server event. - - :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: Literal[RealtimeServerEventType.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 - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE]] - """The event type, must be ``response.output_audio.done``. Required. RESPONSE_OUTPUT_AUDIO_DONE.""" - response_id: Required[str] - """The ID of the response. Required.""" - item_id: Required[str] - """The ID of the item. Required.""" - output_index: Required[int] - """The index of the output item in the response. Required.""" - content_index: Required[int] - """The index of the content part in the item's content array. Required.""" - - -class VoiceAgentServerEventResponseAudioTimestampDelta(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.audio_timestamp.delta`` server event. - - :ivar type: Required. Default value is "response.audio_timestamp.delta". - :vartype type: Literal["response.audio_timestamp.delta"] - :ivar event_id: Required. - :vartype event_id: str - :ivar response_id: Required. - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar content_index: Required. - :vartype content_index: int - :ivar audio_offset_ms: Required. - :vartype audio_offset_ms: int - :ivar audio_duration_ms: Required. - :vartype audio_duration_ms: int - :ivar text: Required. - :vartype text: str - :ivar timestamp_type: Required. Default value is "word". - :vartype timestamp_type: Literal["word"] - """ - - type: Required[Literal["response.audio_timestamp.delta"]] - """Required. Default value is \"response.audio_timestamp.delta\".""" - event_id: Required[str] - """Required.""" - response_id: Required[str] - """Required.""" - item_id: Required[str] - """Required.""" - output_index: Required[int] - """Required.""" - content_index: Required[int] - """Required.""" - audio_offset_ms: Required[int] - """Required.""" - audio_duration_ms: Required[int] - """Required.""" - text: Required[str] - """Required.""" - timestamp_type: Required[Literal["word"]] - """Required. Default value is \"word\".""" - - -class VoiceAgentServerEventResponseAudioTimestampDone(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.audio_timestamp.done`` server event. - - :ivar type: Required. Default value is "response.audio_timestamp.done". - :vartype type: Literal["response.audio_timestamp.done"] - :ivar event_id: Required. - :vartype event_id: str - :ivar response_id: Required. - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar content_index: Required. - :vartype content_index: int - """ - - type: Required[Literal["response.audio_timestamp.done"]] - """Required. Default value is \"response.audio_timestamp.done\".""" - event_id: Required[str] - """Required.""" - response_id: Required[str] - """Required.""" - item_id: Required[str] - """Required.""" - output_index: Required[int] - """Required.""" - content_index: Required[int] - """Required.""" - - -class VoiceAgentServerEventResponseAudioTranscriptDelta(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.output_audio_transcript.delta`` server event. - - :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: Literal[RealtimeServerEventType.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 - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA]] - """The event type, must be ``response.output_audio_transcript.delta``. Required. - RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA.""" - response_id: Required[str] - """The ID of the response. Required.""" - item_id: Required[str] - """The ID of the item. Required.""" - output_index: Required[int] - """The index of the output item in the response. Required.""" - content_index: Required[int] - """The index of the content part in the item's content array. Required.""" - delta: Required[str] - """The transcript delta. Required.""" - - -class VoiceAgentServerEventResponseAudioTranscriptDone(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.output_audio_transcript.done`` server event. - - :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: Literal[RealtimeServerEventType.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 - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE]] - """The event type, must be ``response.output_audio_transcript.done``. Required. - RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE.""" - response_id: Required[str] - """The ID of the response. Required.""" - item_id: Required[str] - """The ID of the item. Required.""" - output_index: Required[int] - """The index of the output item in the response. Required.""" - content_index: Required[int] - """The index of the content part in the item's content array. Required.""" - transcript: Required[str] - """The final transcript of the audio. Required.""" - - -class VoiceAgentServerEventResponseContentPartDone(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.content_part.done`` server event. - - :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: Literal[RealtimeServerEventType.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 finished streaming. Required. Is either a - VoiceAgentResponseEventTextContentPart type or a VoiceAgentResponseEventAudioContentPart type. - :vartype part: "_unions.VoiceAgentResponseEventContentPart" - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE]] - """The event type, must be ``response.content_part.done``. Required. RESPONSE_CONTENT_PART_DONE.""" - response_id: Required[str] - """The ID of the response. Required.""" - item_id: Required[str] - """The ID of the item. Required.""" - output_index: Required[int] - """The index of the output item in the response. Required.""" - content_index: Required[int] - """The index of the content part in the item's content array. Required.""" - part: Required["_unions.VoiceAgentResponseEventContentPart"] - """The content part that finished streaming. Required. Is either a - VoiceAgentResponseEventTextContentPart type or a VoiceAgentResponseEventAudioContentPart type.""" - - -class VoiceAgentServerEventResponseCreated(TypedDict, total=False): - """The ``response.created`` server event. - - :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: Literal[RealtimeServerEventType.RESPONSE_CREATED] - :ivar response: The created voice-agent response. Required. - :vartype response: "VoiceAgentRealtimeResponse" - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_CREATED]] - """The event type, must be ``response.created``. Required. RESPONSE_CREATED.""" - response: Required["VoiceAgentRealtimeResponse"] - """The created voice-agent response. Required.""" - - -class VoiceAgentServerEventResponseDone(TypedDict, total=False): - """The ``response.done`` server event. - - :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: Literal[RealtimeServerEventType.RESPONSE_DONE] - :ivar response: The completed voice-agent response. Required. - :vartype response: "VoiceAgentRealtimeResponse" - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_DONE]] - """The event type, must be ``response.done``. Required. RESPONSE_DONE.""" - response: Required["VoiceAgentRealtimeResponse"] - """The completed voice-agent response. Required.""" - - -class VoiceAgentServerEventResponseFunctionCallArgumentsDelta(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.function_call_arguments.delta`` server event. - - :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: Literal[RealtimeServerEventType.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 - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA]] - """The event type, must be ``response.function_call_arguments.delta``. Required. - RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA.""" - response_id: Required[str] - """The ID of the response. Required.""" - item_id: Required[str] - """The ID of the function call item. Required.""" - output_index: Required[int] - """The index of the output item in the response. Required.""" - call_id: Required[str] - """The ID of the function call. Required.""" - delta: Required[str] - """The arguments delta as a JSON string. Required.""" - - -class VoiceAgentServerEventResponseFunctionCallArgumentsDone(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.function_call_arguments.done`` server event. - - :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: Literal[RealtimeServerEventType.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 - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE]] - """The event type, must be ``response.function_call_arguments.done``. Required. - RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE.""" - response_id: Required[str] - """The ID of the response. Required.""" - item_id: Required[str] - """The ID of the function call item. Required.""" - output_index: Required[int] - """The index of the output item in the response. Required.""" - call_id: Required[str] - """The ID of the function call. Required.""" - name: Required[str] - """The name of the function that was called. Required.""" - arguments: Required[str] - """The final arguments as a JSON string. Required.""" - - -class VoiceAgentServerEventResponseMcpCallArgumentsDelta(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.mcp_call_arguments.delta`` server event. - - :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: Literal[RealtimeServerEventType.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: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA]] - """The event type, must be ``response.mcp_call_arguments.delta``. Required. - RESPONSE_MCP_CALL_ARGUMENTS_DELTA.""" - response_id: Required[str] - """The ID of the response. Required.""" - item_id: Required[str] - """The ID of the MCP tool call item. Required.""" - output_index: Required[int] - """The index of the output item in the response. Required.""" - delta: Required[str] - """The JSON-encoded arguments delta. Required.""" - obfuscation: Optional[str] - - -class VoiceAgentServerEventResponseMcpCallArgumentsDone(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.mcp_call_arguments.done`` server event. - - :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: Literal[RealtimeServerEventType.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 - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE]] - """The event type, must be ``response.mcp_call_arguments.done``. Required. - RESPONSE_MCP_CALL_ARGUMENTS_DONE.""" - response_id: Required[str] - """The ID of the response. Required.""" - item_id: Required[str] - """The ID of the MCP tool call item. Required.""" - output_index: Required[int] - """The index of the output item in the response. Required.""" - arguments: Required[str] - """The final JSON-encoded arguments string. Required.""" - - -class VoiceAgentServerEventResponseMcpCallCompleted(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.mcp_call.completed`` server event. - - :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: Literal[RealtimeServerEventType.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 - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED]] - """The event type, must be ``response.mcp_call.completed``. Required. RESPONSE_MCP_CALL_COMPLETED.""" - output_index: Required[int] - """The index of the output item in the response. Required.""" - item_id: Required[str] - """The ID of the MCP tool call item. Required.""" - - -class VoiceAgentServerEventResponseMcpCallFailed(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.mcp_call.failed`` server event. - - :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: Literal[RealtimeServerEventType.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 - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED]] - """The event type, must be ``response.mcp_call.failed``. Required. RESPONSE_MCP_CALL_FAILED.""" - output_index: Required[int] - """The index of the output item in the response. Required.""" - item_id: Required[str] - """The ID of the MCP tool call item. Required.""" - - -class VoiceAgentServerEventResponseMcpCallInProgress(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.mcp_call.in_progress`` server event. - - :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: Literal[RealtimeServerEventType.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 - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS]] - """The event type, must be ``response.mcp_call.in_progress``. Required. - RESPONSE_MCP_CALL_IN_PROGRESS.""" - output_index: Required[int] - """The index of the output item in the response. Required.""" - item_id: Required[str] - """The ID of the MCP tool call item. Required.""" - - -class VoiceAgentServerEventResponseOutputItemAdded(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.output_item.added`` server event. - - :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: Literal[RealtimeServerEventType.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: The output item that was added. Required. Is one of the following types: - "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, - VoiceAgentFileSearchCallItem - :vartype item: "_unions.VoiceAgentResponseItem" - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED]] - """The event type, must be ``response.output_item.added``. Required. RESPONSE_OUTPUT_ITEM_ADDED.""" - response_id: Required[str] - """The ID of the Response to which the item belongs. Required.""" - output_index: Required[int] - """The index of the output item in the Response. Required.""" - item: Required["_unions.VoiceAgentResponseItem"] - """The output item that was added. Required. Is one of the following types: - \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, - VoiceAgentFileSearchCallItem""" - - -class VoiceAgentServerEventResponseOutputItemDone(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.output_item.done`` server event. - - :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: Literal[RealtimeServerEventType.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: The output item that finished streaming. Required. Is one of the following types: - "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, - VoiceAgentFileSearchCallItem - :vartype item: "_unions.VoiceAgentResponseItem" - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE]] - """The event type, must be ``response.output_item.done``. Required. RESPONSE_OUTPUT_ITEM_DONE.""" - response_id: Required[str] - """The ID of the Response to which the item belongs. Required.""" - output_index: Required[int] - """The index of the output item in the Response. Required.""" - item: Required["_unions.VoiceAgentResponseItem"] - """The output item that finished streaming. Required. Is one of the following types: - \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem, VoiceAgentWorkflowActionItem, VoiceAgentWebSearchCallItem, - VoiceAgentFileSearchCallItem""" - - -class VoiceAgentServerEventResponseTextDelta(TypedDict, total=False): - """The ``response.output_text.delta`` server event. - - :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: Literal[RealtimeServerEventType.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 - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA]] - """The event type, must be ``response.output_text.delta``. Required. RESPONSE_OUTPUT_TEXT_DELTA.""" - response_id: Required[str] - """The ID of the response. Required.""" - item_id: Required[str] - """The ID of the item. Required.""" - output_index: Required[int] - """The index of the output item in the response. Required.""" - content_index: Required[int] - """The index of the content part in the item's content array. Required.""" - delta: Required[str] - """The text delta. Required.""" - - -class VoiceAgentServerEventResponseTextDone(TypedDict, total=False): - """The ``response.output_text.done`` server event. - - :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: Literal[RealtimeServerEventType.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 - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE]] - """The event type, must be ``response.output_text.done``. Required. RESPONSE_OUTPUT_TEXT_DONE.""" - response_id: Required[str] - """The ID of the response. Required.""" - item_id: Required[str] - """The ID of the item. Required.""" - output_index: Required[int] - """The index of the output item in the response. Required.""" - content_index: Required[int] - """The index of the content part in the item's content array. Required.""" - text: Required[str] - """The final text content. Required.""" - - -class VoiceAgentServerEventResponseVideoDelta(TypedDict, total=False): - """The ``response.video.delta`` server event. - - :ivar type: Required. Default value is "response.video.delta". - :vartype type: Literal["response.video.delta"] - :ivar event_id: Required. - :vartype event_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar codec: Required. - :vartype codec: str - :ivar delta: The base64-encoded video frame data. Required. - :vartype delta: str - """ - - type: Required[Literal["response.video.delta"]] - """Required. Default value is \"response.video.delta\".""" - event_id: Required[str] - """Required.""" - output_index: Required[int] - """Required.""" - codec: Required[str] - """Required.""" - delta: Required[str] - """The base64-encoded video frame data. Required.""" - - -class VoiceAgentServerEventSessionAvatarConnecting(TypedDict, total=False): # pylint: disable=name-too-long - """The ``session.avatar.connecting`` server event. - - :ivar type: Required. Default value is "session.avatar.connecting". - :vartype type: Literal["session.avatar.connecting"] - :ivar event_id: Required. - :vartype event_id: str - :ivar server_sdp: The server's SDP answer for avatar media negotiation. Required. - :vartype server_sdp: str - """ - - type: Required[Literal["session.avatar.connecting"]] - """Required. Default value is \"session.avatar.connecting\".""" - event_id: Required[str] - """Required.""" - server_sdp: Required[str] - """The server's SDP answer for avatar media negotiation. Required.""" - - -class VoiceAgentServerEventSessionAvatarSwitchToIdle(TypedDict, total=False): # pylint: disable=name-too-long - """The ``session.avatar.switch_to_idle`` server event. - - :ivar type: Required. Default value is "session.avatar.switch_to_idle". - :vartype type: Literal["session.avatar.switch_to_idle"] - :ivar event_id: Required. - :vartype event_id: str - :ivar turn_id: - :vartype turn_id: str - """ - - type: Required[Literal["session.avatar.switch_to_idle"]] - """Required. Default value is \"session.avatar.switch_to_idle\".""" - event_id: Required[str] - """Required.""" - turn_id: str - - -class VoiceAgentServerEventSessionAvatarSwitchToSpeaking(TypedDict, total=False): # pylint: disable=name-too-long - """The ``session.avatar.switch_to_speaking`` server event. - - :ivar type: Required. Default value is "session.avatar.switch_to_speaking". - :vartype type: Literal["session.avatar.switch_to_speaking"] - :ivar event_id: Required. - :vartype event_id: str - :ivar turn_id: - :vartype turn_id: str - """ - - type: Required[Literal["session.avatar.switch_to_speaking"]] - """Required. Default value is \"session.avatar.switch_to_speaking\".""" - event_id: Required[str] - """Required.""" - turn_id: str - - -class VoiceAgentServerEventSessionCreated(TypedDict, total=False): - """The ``session.created`` server event. - - :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: Literal[RealtimeServerEventType.SESSION_CREATED] - :ivar session: The initial effective voice-agent session configuration. Required. - :vartype session: "VoiceAgentSessionResponseConfig" - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.SESSION_CREATED]] - """The event type, must be ``session.created``. Required. SESSION_CREATED.""" - session: Required["VoiceAgentSessionResponseConfig"] - """The initial effective voice-agent session configuration. Required.""" - - -class VoiceAgentServerEventSessionHandoffAborted(TypedDict, total=False): # pylint: disable=name-too-long - """The ``session.handoff.aborted`` server event. - - :ivar type: Required. Default value is "session.handoff.aborted". - :vartype type: Literal["session.handoff.aborted"] - :ivar event_id: Required. - :vartype event_id: str - :ivar handoff_id: Required. - :vartype handoff_id: str - :ivar edge_id: Required. - :vartype edge_id: str - :ivar from_node_id: Required. - :vartype from_node_id: str - :ivar to_node_id: Required. - :vartype to_node_id: str - :ivar from_model: Required. - :vartype from_model: str - :ivar to_model: Required. - :vartype to_model: str - :ivar tool_call_id: Required. - :vartype tool_call_id: str - :ivar node_generation: Required. - :vartype node_generation: int - :ivar reason: The reason the handoff was aborted. Required. Known values are: - "user_interruption" and "error". - :vartype reason: Union[str, "VoiceAgentHandoffAbortReason"] - :ivar error: The error that aborted the handoff, when ``reason`` is ``error``. - :vartype error: "VoiceAgentServerEventErrorDetails" - """ - - type: Required[Literal["session.handoff.aborted"]] - """Required. Default value is \"session.handoff.aborted\".""" - event_id: Required[str] - """Required.""" - handoff_id: Required[str] - """Required.""" - edge_id: Required[str] - """Required.""" - from_node_id: Required[str] - """Required.""" - to_node_id: Required[str] - """Required.""" - from_model: Required[str] - """Required.""" - to_model: Required[str] - """Required.""" - tool_call_id: Required[str] - """Required.""" - node_generation: Required[int] - """Required.""" - reason: Required[Union[str, "VoiceAgentHandoffAbortReason"]] - """The reason the handoff was aborted. Required. Known values are: \"user_interruption\" and - \"error\".""" - error: "VoiceAgentServerEventErrorDetails" - """The error that aborted the handoff, when ``reason`` is ``error``.""" - - -class VoiceAgentServerEventSessionHandoffCompleted(TypedDict, total=False): # pylint: disable=name-too-long - """The ``session.handoff.completed`` server event. - - :ivar type: Required. Default value is "session.handoff.completed". - :vartype type: Literal["session.handoff.completed"] - :ivar event_id: Required. - :vartype event_id: str - :ivar handoff_id: Required. - :vartype handoff_id: str - :ivar edge_id: Required. - :vartype edge_id: str - :ivar from_node_id: Required. - :vartype from_node_id: str - :ivar to_node_id: Required. - :vartype to_node_id: str - :ivar from_model: Required. - :vartype from_model: str - :ivar to_model: Required. - :vartype to_model: str - :ivar tool_call_id: Required. - :vartype tool_call_id: str - :ivar node_generation: Required. - :vartype node_generation: int - :ivar prepare_duration_ms: The time spent preparing the target behavior, in milliseconds. - Required. - :vartype prepare_duration_ms: int - :ivar duration_ms: The total duration of the handoff, in milliseconds. Required. - :vartype duration_ms: int - """ - - type: Required[Literal["session.handoff.completed"]] - """Required. Default value is \"session.handoff.completed\".""" - event_id: Required[str] - """Required.""" - handoff_id: Required[str] - """Required.""" - edge_id: Required[str] - """Required.""" - from_node_id: Required[str] - """Required.""" - to_node_id: Required[str] - """Required.""" - from_model: Required[str] - """Required.""" - to_model: Required[str] - """Required.""" - tool_call_id: Required[str] - """Required.""" - node_generation: Required[int] - """Required.""" - prepare_duration_ms: Required[int] - """The time spent preparing the target behavior, in milliseconds. Required.""" - duration_ms: Required[int] - """The total duration of the handoff, in milliseconds. Required.""" - - -class VoiceAgentServerEventSessionHandoffStarted(TypedDict, total=False): # pylint: disable=name-too-long - """The ``session.handoff.started`` server event. - - :ivar type: Required. Default value is "session.handoff.started". - :vartype type: Literal["session.handoff.started"] - :ivar event_id: Required. - :vartype event_id: str - :ivar handoff_id: Required. - :vartype handoff_id: str - :ivar edge_id: Required. - :vartype edge_id: str - :ivar from_node_id: Required. - :vartype from_node_id: str - :ivar to_node_id: Required. - :vartype to_node_id: str - :ivar from_model: Required. - :vartype from_model: str - :ivar to_model: Required. - :vartype to_model: str - :ivar tool_call_id: Required. - :vartype tool_call_id: str - :ivar node_generation: Required. - :vartype node_generation: int - """ - - type: Required[Literal["session.handoff.started"]] - """Required. Default value is \"session.handoff.started\".""" - event_id: Required[str] - """Required.""" - handoff_id: Required[str] - """Required.""" - edge_id: Required[str] - """Required.""" - from_node_id: Required[str] - """Required.""" - to_node_id: Required[str] - """Required.""" - from_model: Required[str] - """Required.""" - to_model: Required[str] - """Required.""" - tool_call_id: Required[str] - """Required.""" - node_generation: Required[int] - """Required.""" - - -class VoiceAgentServerEventSessionUpdated(TypedDict, total=False): - """The ``session.updated`` server event. - - :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: Literal[RealtimeServerEventType.SESSION_UPDATED] - :ivar session: The effective voice-agent session configuration after the update. Required. - :vartype session: "VoiceAgentSessionResponseConfig" - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.SESSION_UPDATED]] - """The event type, must be ``session.updated``. Required. SESSION_UPDATED.""" - session: Required["VoiceAgentSessionResponseConfig"] - """The effective voice-agent session configuration after the update. Required.""" - - -class VoiceAgentServerEventWarning(TypedDict, total=False): - """The ``warning`` server event. - - :ivar type: Required. Default value is "warning". - :vartype type: Literal["warning"] - :ivar event_id: Required. - :vartype event_id: str - :ivar warning: Required. - :vartype warning: "VoiceAgentServerEventWarningDetails" - """ - - type: Required[Literal["warning"]] - """Required. Default value is \"warning\".""" - event_id: Required[str] - """Required.""" - warning: Required["VoiceAgentServerEventWarningDetails"] - """Required.""" - - -class VoiceAgentServerEventWarningDetails(TypedDict, total=False): - """Details of a non-fatal warning. - - :ivar message: Required. - :vartype message: str - :ivar code: - :vartype code: str - :ivar param: - :vartype param: str - """ - - message: Required[str] - """Required.""" - code: str - param: str - - -class VoiceAgentServerEventWebSearchCallCompleted(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.web_search_call.completed`` server event. - - :ivar type: Required. Default value is "response.web_search_call.completed". - :vartype type: Literal["response.web_search_call.completed"] - :ivar event_id: - :vartype event_id: str - :ivar response_id: - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar sequence_number: Required. - :vartype sequence_number: int - """ - - type: Required[Literal["response.web_search_call.completed"]] - """Required. Default value is \"response.web_search_call.completed\".""" - event_id: str - response_id: str - item_id: Required[str] - """Required.""" - output_index: Required[int] - """Required.""" - sequence_number: Required[int] - """Required.""" - - -class VoiceAgentServerEventWebSearchCallInProgress(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.web_search_call.in_progress`` server event. - - :ivar type: Required. Default value is "response.web_search_call.in_progress". - :vartype type: Literal["response.web_search_call.in_progress"] - :ivar event_id: - :vartype event_id: str - :ivar response_id: - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar sequence_number: Required. - :vartype sequence_number: int - """ - - type: Required[Literal["response.web_search_call.in_progress"]] - """Required. Default value is \"response.web_search_call.in_progress\".""" - event_id: str - response_id: str - item_id: Required[str] - """Required.""" - output_index: Required[int] - """Required.""" - sequence_number: Required[int] - """Required.""" - - -class VoiceAgentServerEventWebSearchCallSearching(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.web_search_call.searching`` server event. - - :ivar type: Required. Default value is "response.web_search_call.searching". - :vartype type: Literal["response.web_search_call.searching"] - :ivar event_id: - :vartype event_id: str - :ivar response_id: - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar sequence_number: Required. - :vartype sequence_number: int - """ - - type: Required[Literal["response.web_search_call.searching"]] - """Required. Default value is \"response.web_search_call.searching\".""" - event_id: str - response_id: str - item_id: Required[str] - """Required.""" - output_index: Required[int] - """Required.""" - sequence_number: Required[int] - """Required.""" - - -class VoiceAgentServerVadTurnDetection(TypedDict, total=False): - """Server VAD turn-detection settings. - - :ivar create_response: - :vartype create_response: bool - :ivar interrupt_response: - :vartype interrupt_response: bool - :ivar idle_timeout_ms: - :vartype idle_timeout_ms: int - :ivar type: Required. Server-side voice activity detection. - :vartype type: Literal[VoiceTurnDetectionType.SERVER_VAD] - :ivar threshold: - :vartype threshold: float - :ivar prefix_padding_ms: - :vartype prefix_padding_ms: int - :ivar silence_duration_ms: - :vartype silence_duration_ms: int - :ivar speech_duration_ms: - :vartype speech_duration_ms: int - :ivar end_of_utterance_detection: - :vartype end_of_utterance_detection: "VoiceAgentEndOfUtteranceDetection" - :ivar auto_truncate: - :vartype auto_truncate: bool - """ - - create_response: bool - interrupt_response: bool - idle_timeout_ms: Optional[int] - type: Required[Literal[VoiceTurnDetectionType.SERVER_VAD]] - """Required. Server-side voice activity detection.""" - threshold: Optional[float] - prefix_padding_ms: Optional[int] - silence_duration_ms: Optional[int] - speech_duration_ms: Optional[int] - end_of_utterance_detection: Optional["VoiceAgentEndOfUtteranceDetection"] - auto_truncate: bool - - -class VoiceAgentSessionAvatarConfig(TypedDict, total=False): - """Avatar settings accepted by the stable voice-agent WebSocket contract. - - :ivar type: Known values are: "video_avatar" and "photo_avatar". - :vartype type: Union[str, "VoiceAgentAvatarType"] - :ivar ice_servers: - :vartype ice_servers: list["VoiceAgentAvatarIceServer"] - :ivar character: Required. - :vartype character: str - :ivar style: - :vartype style: str - :ivar customized: - :vartype customized: bool - :ivar model: - :vartype model: str - :ivar video: - :vartype video: "VoiceAgentAvatarVideoParams" - :ivar scene: - :vartype scene: "VoiceAgentAvatarScene" - :ivar output_protocol: Known values are: "websocket", "websocket-binary", and "webrtc". - :vartype output_protocol: Union[str, "VoiceAgentAvatarOutputProtocol"] - :ivar output_audit_audio: - :vartype output_audit_audio: bool - """ - - type: Union[str, "VoiceAgentAvatarType"] - """Known values are: \"video_avatar\" and \"photo_avatar\".""" - ice_servers: Optional[list["VoiceAgentAvatarIceServer"]] - character: Required[str] - """Required.""" - style: Optional[str] - customized: bool - model: Optional[str] - video: Optional["VoiceAgentAvatarVideoParams"] - scene: Optional["VoiceAgentAvatarScene"] - output_protocol: Union[str, "VoiceAgentAvatarOutputProtocol"] - """Known values are: \"websocket\", \"websocket-binary\", and \"webrtc\".""" - output_audit_audio: bool - - -class VoiceAgentSessionMcpTool(TypedDict, total=False): - """A remote MCP server available to a voice-agent session. - - :ivar type: Required. Default value is "mcp". - :vartype type: Literal["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: Required. - :vartype server_url: str - :ivar authorization: Is either a str type or a VoiceAgentMcpAssignedManagedIdentity type. - :vartype authorization: Union[str, "VoiceAgentMcpAssignedManagedIdentity"] - :ivar headers: - :vartype headers: dict[str, str] - :ivar allowed_tools: - :vartype allowed_tools: list[str] - :ivar require_approval: Is either a Union[str, "_models.VoiceAgentMcpApprovalMode"] type or a - {str: [str]} type. - :vartype require_approval: "_unions.VoiceAgentMcpApprovalPolicy" - :ivar response_scheduling: Known values are: "silent", "when_idle", "interrupt", and - "skip_if_busy". - :vartype response_scheduling: Union[str, "VoiceAgentMcpResponseScheduling"] - """ - - type: Required[Literal["mcp"]] - """Required. Default value is \"mcp\".""" - server_label: Required[str] - """A label for this MCP server, used to identify it in tool calls. Required.""" - server_url: Required[str] - """Required.""" - authorization: Optional[Union[str, "VoiceAgentMcpAssignedManagedIdentity"]] - """Is either a str type or a VoiceAgentMcpAssignedManagedIdentity type.""" - headers: dict[str, str] - allowed_tools: list[str] - require_approval: "_unions.VoiceAgentMcpApprovalPolicy" - """Is either a Union[str, \"_models.VoiceAgentMcpApprovalMode\"] type or a {str: [str]} type.""" - response_scheduling: Union[str, "VoiceAgentMcpResponseScheduling"] - """Known values are: \"silent\", \"when_idle\", \"interrupt\", and \"skip_if_busy\".""" - - -class VoiceAgentSessionResponseAudio(TypedDict, total=False): - """Input- and output-audio settings returned in a stable voice-agent session event. - - :ivar input: The effective input-audio settings. - :vartype input: "VoiceAgentSessionResponseAudioInput" - :ivar output: The output-audio settings for the session. - :vartype output: "VoiceAgentSessionResponseAudioOutput" - """ - - input: Optional["VoiceAgentSessionResponseAudioInput"] - """The effective input-audio settings.""" - output: Optional["VoiceAgentSessionResponseAudioOutput"] - """The output-audio settings for the session.""" - - -class VoiceAgentSessionResponseAudioInput(TypedDict, total=False): - """Input-audio settings returned in a stable voice-agent session event. - - :ivar noise_reduction: Input noise reduction. Set to null to disable. - :vartype noise_reduction: "VoiceNoiseReduction" - :ivar transcription: Asynchronous input-audio transcription. Set to null to disable - transcription. - :vartype transcription: "VoiceInputTranscription" - :ivar format: The structured input audio format. - :vartype format: "VoiceAudioFormat" - :ivar turn_detection: Turn-detection settings. Set to null to disable server-side turn - detection. Is one of the following types: VoiceAgentServerVadTurnDetection, - VoiceAgentSemanticVadTurnDetection, VoiceAgentAzureSemanticVadTurnDetection, - VoiceAgentAzureMultilingualSemanticVadTurnDetection - :vartype turn_detection: "_unions.VoiceAgentTurnDetection" - :ivar echo_cancellation: Optional server-side echo cancellation settings. - :vartype echo_cancellation: "VoiceAgentEchoCancellation" - """ - - noise_reduction: Optional["VoiceNoiseReduction"] - """Input noise reduction. Set to null to disable.""" - transcription: Optional["VoiceInputTranscription"] - """Asynchronous input-audio transcription. Set to null to disable transcription.""" - format: Optional["VoiceAudioFormat"] - """The structured input audio format.""" - turn_detection: Optional["_unions.VoiceAgentTurnDetection"] - """Turn-detection settings. Set to null to disable server-side turn detection. Is one of the - following types: VoiceAgentServerVadTurnDetection, VoiceAgentSemanticVadTurnDetection, - VoiceAgentAzureSemanticVadTurnDetection, VoiceAgentAzureMultilingualSemanticVadTurnDetection""" - echo_cancellation: Optional["VoiceAgentEchoCancellation"] - """Optional server-side echo cancellation settings.""" - - -class VoiceAgentSessionResponseAudioOutput(TypedDict, total=False): - """Output-audio settings returned in a stable voice-agent session event. - - :ivar format: The output audio format. - :vartype format: "VoiceAudioFormat" - :ivar voice: The typed voice configuration. Is one of the following types: OpenAIVoice, - AzureVoice, AzureRealtimeNativeVoice - :vartype voice: "_unions.VoiceAgentVoice" - :ivar output_audio_timestamp_types: Timestamp kinds to include with output audio. - :vartype output_audio_timestamp_types: list[Union[str, "VoiceAudioTimestampType"]] - :ivar speed: The speaking-speed multiplier. - :vartype speed: float - """ - - format: "VoiceAudioFormat" - """The output audio format.""" - voice: "_unions.VoiceAgentVoice" - """The typed voice configuration. Is one of the following types: OpenAIVoice, AzureVoice, - AzureRealtimeNativeVoice""" - output_audio_timestamp_types: list[Union[str, "VoiceAudioTimestampType"]] - """Timestamp kinds to include with output audio.""" - speed: Optional[float] - """The speaking-speed multiplier.""" - - -class VoiceAgentSessionResponseConfig(TypedDict, total=False): - """The effective stable realtime session settings returned by the voice-agent service. - - :ivar type: The session type. Always ``realtime``. Required. Default value is "realtime". - :vartype type: Literal["realtime"] - :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: "_unions.VoiceAgentMaxOutputTokens" - :ivar avatar: The avatar settings for the session. - :vartype avatar: "VoiceAgentSessionAvatarConfig" - :ivar animation: Animation settings for the session. - :vartype animation: "VoiceAgentAnimationConfig" - :ivar tools: Tools available to the session. - :vartype tools: list["_unions.VoiceAgentSessionTool"] - :ivar tool_choice: Tool-selection behavior for the session. Is either a Union[str, - "_models.ToolChoiceOptions"] type or a RealtimeToolChoiceFunction type. - :vartype tool_choice: "_unions.VoiceAgentToolChoice" - :ivar reasoning: Reasoning settings for compatible realtime models. - :vartype reasoning: "RealtimeReasoning" - :ivar parallel_tool_calls: Whether the model may call multiple tools in parallel. - :vartype parallel_tool_calls: bool - :ivar voice_adaptation: Voice-optimized instruction adaptation settings. - :vartype voice_adaptation: "VoiceAgentVoiceAdaptation" - :ivar interim_response: Interim-response settings for latency and tool execution. Is either a - VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. - :vartype interim_response: "_unions.VoiceAgentInterimResponse" - :ivar response_delimiter: A delimiter appended to generated responses. - :vartype response_delimiter: str - :ivar greeting: A proactive assistant greeting started after session configuration. - :vartype greeting: "VoiceGreetingConfig" - :ivar object: The object type. Always ``realtime.session``. Required. Default value is - "realtime.session". - :vartype object: Literal["realtime.session"] - :ivar id: The session identifier. Required. - :vartype id: str - :ivar model: The selected model. Required. - :vartype model: str - :ivar expires_at: The session expiration time as a Unix timestamp in seconds. - :vartype expires_at: int - :ivar output_modalities: The output modalities enabled for the session. Required. - :vartype output_modalities: list[Union[str, "VoiceOutputModality"]] - :ivar audio: The effective input- and output-audio settings for the session. - :vartype audio: "VoiceAgentSessionResponseAudio" - :ivar handoff: The effective handoff state. - :vartype handoff: "VoiceAgentHandoffState" - :ivar idle_timeout: The idle timeout reported by the service, in milliseconds. - :vartype idle_timeout: int - """ - - type: Required[Literal["realtime"]] - """The session type. Always ``realtime``. Required. Default value is \"realtime\".""" - instructions: Optional[str] - """Instructions applied throughout the session.""" - temperature: Optional[float] - """The sampling temperature for compatible cascaded pipelines.""" - max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] - """The maximum output-token count for one response. Is either a int type or a Literal[\"inf\"] - type.""" - avatar: Optional["VoiceAgentSessionAvatarConfig"] - """The avatar settings for the session.""" - animation: Optional["VoiceAgentAnimationConfig"] - """Animation settings for the session.""" - tools: Optional[list["_unions.VoiceAgentSessionTool"]] - """Tools available to the session.""" - tool_choice: Optional["_unions.VoiceAgentToolChoice"] - """Tool-selection behavior for the session. Is either a Union[str, \"_models.ToolChoiceOptions\"] - type or a RealtimeToolChoiceFunction type.""" - reasoning: Optional["RealtimeReasoning"] - """Reasoning settings for compatible realtime models.""" - parallel_tool_calls: bool - """Whether the model may call multiple tools in parallel.""" - voice_adaptation: Optional["VoiceAgentVoiceAdaptation"] - """Voice-optimized instruction adaptation settings.""" - interim_response: Optional["_unions.VoiceAgentInterimResponse"] - """Interim-response settings for latency and tool execution. Is either a - VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type.""" - response_delimiter: str - """A delimiter appended to generated responses.""" - greeting: Optional["VoiceGreetingConfig"] - """A proactive assistant greeting started after session configuration.""" - object: Required[Literal["realtime.session"]] - """The object type. Always ``realtime.session``. Required. Default value is \"realtime.session\".""" - id: Required[str] - """The session identifier. Required.""" - model: Required[str] - """The selected model. Required.""" - expires_at: Optional[int] - """The session expiration time as a Unix timestamp in seconds.""" - output_modalities: Required[list[Union[str, "VoiceOutputModality"]]] - """The output modalities enabled for the session. Required.""" - audio: Optional["VoiceAgentSessionResponseAudio"] - """The effective input- and output-audio settings for the session.""" - handoff: Optional["VoiceAgentHandoffState"] - """The effective handoff state.""" - idle_timeout: Optional[int] - """The idle timeout reported by the service, in milliseconds.""" - - -class VoiceAgentSessionUpdateAudio(TypedDict, total=False): - """Input- and output-audio settings accepted in a ``session.update`` client event. - - :ivar input: The input-audio settings for the session. - :vartype input: "VoiceAgentSessionUpdateAudioInput" - :ivar output: The output-audio settings for the session. - :vartype output: "VoiceAgentSessionUpdateAudioOutput" - """ - - input: Optional["VoiceAgentSessionUpdateAudioInput"] - """The input-audio settings for the session.""" - output: Optional["VoiceAgentSessionUpdateAudioOutput"] - """The output-audio settings for the session.""" - - -class VoiceAgentSessionUpdateAudioInput(TypedDict, total=False): - """Input-audio settings accepted in a stable voice-agent session. - - :ivar noise_reduction: Input noise reduction. Set to null to disable. - :vartype noise_reduction: "VoiceNoiseReduction" - :ivar transcription: Asynchronous input-audio transcription. Set to null to disable - transcription. - :vartype transcription: "VoiceInputTranscription" - :ivar format: The structured input audio format. - :vartype format: "VoiceAudioFormat" - :ivar turn_detection: Turn-detection settings. Set to null to disable server-side turn - detection. Is one of the following types: VoiceAgentServerVadTurnDetection, - VoiceAgentSemanticVadTurnDetection, VoiceAgentAzureSemanticVadTurnDetection, - VoiceAgentAzureMultilingualSemanticVadTurnDetection - :vartype turn_detection: "_unions.VoiceAgentTurnDetection" - :ivar echo_cancellation: Optional server-side echo cancellation settings. - :vartype echo_cancellation: "VoiceAgentEchoCancellation" - """ - - noise_reduction: Optional["VoiceNoiseReduction"] - """Input noise reduction. Set to null to disable.""" - transcription: Optional["VoiceInputTranscription"] - """Asynchronous input-audio transcription. Set to null to disable transcription.""" - format: Optional["VoiceAudioFormat"] - """The structured input audio format.""" - turn_detection: Optional["_unions.VoiceAgentTurnDetection"] - """Turn-detection settings. Set to null to disable server-side turn detection. Is one of the - following types: VoiceAgentServerVadTurnDetection, VoiceAgentSemanticVadTurnDetection, - VoiceAgentAzureSemanticVadTurnDetection, VoiceAgentAzureMultilingualSemanticVadTurnDetection""" - echo_cancellation: Optional["VoiceAgentEchoCancellation"] - """Optional server-side echo cancellation settings.""" - - -class VoiceAgentSessionUpdateAudioOutput(TypedDict, total=False): - """Output-audio settings accepted in a stable voice-agent session. - - :ivar format: The output audio format. - :vartype format: "VoiceAudioFormat" - :ivar voice: The typed voice configuration. Is one of the following types: OpenAIVoice, - AzureVoice, AzureRealtimeNativeVoice - :vartype voice: "_unions.VoiceAgentVoice" - :ivar output_audio_timestamp_types: Timestamp kinds to include with output audio. - :vartype output_audio_timestamp_types: list[Union[str, "VoiceAudioTimestampType"]] - :ivar speed: The speaking-speed multiplier. - :vartype speed: float - """ - - format: "VoiceAudioFormat" - """The output audio format.""" - voice: "_unions.VoiceAgentVoice" - """The typed voice configuration. Is one of the following types: OpenAIVoice, AzureVoice, - AzureRealtimeNativeVoice""" - output_audio_timestamp_types: list[Union[str, "VoiceAudioTimestampType"]] - """Timestamp kinds to include with output audio.""" - speed: Optional[float] - """The speaking-speed multiplier.""" - - -class VoiceAgentSessionUpdateConfig(TypedDict, total=False): - """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: Literal["realtime"] - :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: "_unions.VoiceAgentMaxOutputTokens" - :ivar output_modalities: The output modalities enabled for the session. - :vartype output_modalities: list[Union[str, "VoiceOutputModality"]] - :ivar audio: The input- and output-audio settings for the session. - :vartype audio: "VoiceAgentSessionUpdateAudio" - :ivar avatar: The avatar settings for the session. - :vartype avatar: "VoiceAgentSessionAvatarConfig" - :ivar animation: Animation settings for the session. - :vartype animation: "VoiceAgentAnimationConfig" - :ivar tools: Tools available to the session. - :vartype tools: list["_unions.VoiceAgentSessionTool"] - :ivar tool_choice: Tool-selection behavior for the session. Is either a Union[str, - "_models.ToolChoiceOptions"] type or a RealtimeToolChoiceFunction type. - :vartype tool_choice: "_unions.VoiceAgentToolChoice" - :ivar reasoning: Reasoning settings for compatible realtime models. - :vartype reasoning: "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[Union[str, "VoiceAgentSessionIncludeOption"]] - :ivar metadata: Up to 16 string key-value pairs attached to the session. - :vartype metadata: dict[str, str] - :ivar voice_adaptation: Voice-optimized instruction adaptation settings. - :vartype voice_adaptation: "VoiceAgentVoiceAdaptation" - :ivar interim_response: Interim-response settings for latency and tool execution. Is either a - VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. - :vartype interim_response: "_unions.VoiceAgentInterimResponse" - :ivar response_delimiter: A delimiter appended to generated responses. - :vartype response_delimiter: str - :ivar greeting: A proactive assistant greeting started after session configuration. - :vartype greeting: "VoiceGreetingConfig" - :ivar handoff: The customer-supplied handoff graph. - :vartype handoff: "VoiceAgentHandoffGraphConfig" - """ - - type: Required[Literal["realtime"]] - """The session type. Always ``realtime``. Required. Default value is \"realtime\".""" - instructions: Optional[str] - """Instructions applied throughout the session.""" - temperature: Optional[float] - """The sampling temperature for compatible cascaded pipelines.""" - max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] - """The maximum output-token count for one response. Is either a int type or a Literal[\"inf\"] - type.""" - output_modalities: Optional[list[Union[str, "VoiceOutputModality"]]] - """The output modalities enabled for the session.""" - audio: Optional["VoiceAgentSessionUpdateAudio"] - """The input- and output-audio settings for the session.""" - avatar: Optional["VoiceAgentSessionAvatarConfig"] - """The avatar settings for the session.""" - animation: Optional["VoiceAgentAnimationConfig"] - """Animation settings for the session.""" - tools: Optional[list["_unions.VoiceAgentSessionTool"]] - """Tools available to the session.""" - tool_choice: Optional["_unions.VoiceAgentToolChoice"] - """Tool-selection behavior for the session. Is either a Union[str, \"_models.ToolChoiceOptions\"] - type or a RealtimeToolChoiceFunction type.""" - reasoning: Optional["RealtimeReasoning"] - """Reasoning settings for compatible realtime models.""" - parallel_tool_calls: bool - """Whether the model may call multiple tools in parallel.""" - include: Optional[list[Union[str, "VoiceAgentSessionIncludeOption"]]] - """Additional fields to include in service outputs.""" - metadata: Optional[dict[str, str]] - """Up to 16 string key-value pairs attached to the session.""" - voice_adaptation: Optional["VoiceAgentVoiceAdaptation"] - """Voice-optimized instruction adaptation settings.""" - interim_response: Optional["_unions.VoiceAgentInterimResponse"] - """Interim-response settings for latency and tool execution. Is either a - VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type.""" - response_delimiter: str - """A delimiter appended to generated responses.""" - greeting: Optional["VoiceGreetingConfig"] - """A proactive assistant greeting started after session configuration.""" - handoff: Optional["VoiceAgentHandoffGraphConfig"] - """The customer-supplied handoff graph.""" - - -class VoiceAgentStaticInterimResponseConfig(TypedDict, total=False): - """A static interim response selected from configured text. - - :ivar triggers: Conditions that may trigger one interim response. - :vartype triggers: list[Union[str, "VoiceAgentInterimResponseTrigger"]] - :ivar latency_threshold_ms: The latency threshold in milliseconds. - :vartype latency_threshold_ms: int - :ivar type: Required. Default value is "static_interim_response". - :vartype type: Literal["static_interim_response"] - :ivar texts: Candidate text values for the interim response. - :vartype texts: list[str] - """ - - triggers: list[Union[str, "VoiceAgentInterimResponseTrigger"]] - """Conditions that may trigger one interim response.""" - latency_threshold_ms: int - """The latency threshold in milliseconds.""" - type: Required[Literal["static_interim_response"]] - """Required. Default value is \"static_interim_response\".""" - texts: list[str] - """Candidate text values for the interim response.""" - - -class VoiceAgentTranscriptionPhrase(TypedDict, total=False): - """A transcribed phrase with timing information. - - :ivar offset_milliseconds: The phrase offset from the beginning of the audio, in milliseconds. - Required. - :vartype offset_milliseconds: int - :ivar duration_milliseconds: The phrase duration in milliseconds. Required. - :vartype duration_milliseconds: int - :ivar text: The transcribed phrase text. Required. - :vartype text: str - :ivar words: Word-level timing details, when available. - :vartype words: list["VoiceAgentTranscriptionWord"] - :ivar locale: The detected locale. - :vartype locale: str - :ivar confidence: The transcription confidence score. - :vartype confidence: float - """ - - offset_milliseconds: Required[int] - """The phrase offset from the beginning of the audio, in milliseconds. Required.""" - duration_milliseconds: Required[int] - """The phrase duration in milliseconds. Required.""" - text: Required[str] - """The transcribed phrase text. Required.""" - words: Optional[list["VoiceAgentTranscriptionWord"]] - """Word-level timing details, when available.""" - locale: Optional[str] - """The detected locale.""" - confidence: Optional[float] - """The transcription confidence score.""" - - -class VoiceAgentTranscriptionWord(TypedDict, total=False): - """A time-stamped word in an input-audio transcription. - - :ivar text: The transcribed word text. Required. - :vartype text: str - :ivar offset_milliseconds: The word offset from the beginning of the audio, in milliseconds. - Required. - :vartype offset_milliseconds: int - :ivar duration_milliseconds: The word duration in milliseconds. Required. - :vartype duration_milliseconds: int - """ - - text: Required[str] - """The transcribed word text. Required.""" - offset_milliseconds: Required[int] - """The word offset from the beginning of the audio, in milliseconds. Required.""" - duration_milliseconds: Required[int] - """The word duration in milliseconds. Required.""" - - -class VoiceAgentVoiceAdaptation(TypedDict, total=False): - """Voice-optimized instruction adaptation settings. - - :ivar type: The adaptation strategy. Always ``auto``. Required. Default value is "auto". - :vartype type: Literal["auto"] - """ - - type: Required[Literal["auto"]] - """The adaptation strategy. Always ``auto``. Required. Default value is \"auto\".""" - - -class VoiceAgentWebSearchActionFind(TypedDict, total=False): - """An action that finds text on a web page. - - :ivar type: Required. Default value is "find". - :vartype type: Literal["find"] - :ivar pattern: Required. - :vartype pattern: str - :ivar url: Required. - :vartype url: str - """ - - type: Required[Literal["find"]] - """Required. Default value is \"find\".""" - pattern: Required[str] - """Required.""" - url: Required[str] - """Required.""" - - -class VoiceAgentWebSearchActionOpenPage(TypedDict, total=False): - """An action that opens a web page. - - :ivar type: Required. Default value is "open_page". - :vartype type: Literal["open_page"] - :ivar url: Required. - :vartype url: str - """ - - type: Required[Literal["open_page"]] - """Required. Default value is \"open_page\".""" - url: Required[str] - """Required.""" - - -class VoiceAgentWebSearchActionSearch(TypedDict, total=False): - """A web search action. - - :ivar type: Required. Default value is "search". - :vartype type: Literal["search"] - :ivar query: Required. - :vartype query: str - :ivar sources: - :vartype sources: list["VoiceAgentWebSearchSource"] - """ - - type: Required[Literal["search"]] - """Required. Default value is \"search\".""" - query: Required[Optional[str]] - """Required.""" - sources: Optional[list["VoiceAgentWebSearchSource"]] - - -class VoiceAgentWebSearchCallItem(TypedDict, total=False): - """A web-search output item. - - :ivar id: Required. - :vartype id: str - :ivar type: Required. Default value is "web_search_call". - :vartype type: Literal["web_search_call"] - :ivar status: Required. Known values are: "in_progress", "searching", "completed", and - "failed". - :vartype status: Union[str, "VoiceAgentWebSearchCallStatus"] - :ivar action: Is one of the following types: VoiceAgentWebSearchActionSearch, - VoiceAgentWebSearchActionOpenPage, VoiceAgentWebSearchActionFind - :vartype action: "_unions.VoiceAgentWebSearchAction" - """ - - id: Required[str] - """Required.""" - type: Required[Literal["web_search_call"]] - """Required. Default value is \"web_search_call\".""" - status: Required[Union[str, "VoiceAgentWebSearchCallStatus"]] - """Required. Known values are: \"in_progress\", \"searching\", \"completed\", and \"failed\".""" - action: Optional["_unions.VoiceAgentWebSearchAction"] - """Is one of the following types: VoiceAgentWebSearchActionSearch, - VoiceAgentWebSearchActionOpenPage, VoiceAgentWebSearchActionFind""" - - -class VoiceAgentWebSearchSource(TypedDict, total=False): - """A web-search source URL. - - :ivar type: Required. Default value is "url". - :vartype type: Literal["url"] - :ivar url: Required. - :vartype url: str - """ - - type: Required[Literal["url"]] - """Required. Default value is \"url\".""" - url: Required[str] - """Required.""" - - -class VoiceAgentWorkflowActionItem(TypedDict, total=False): - """A workflow action output item. - - :ivar id: Required. - :vartype id: str - :ivar object: Default value is "realtime.item". - :vartype object: Literal["realtime.item"] - :ivar type: Required. Default value is "workflow_action". - :vartype type: Literal["workflow_action"] - :ivar action_id: Required. - :vartype action_id: str - :ivar status: Required. - :vartype status: str - :ivar kind: - :vartype kind: str - :ivar parent_action_id: - :vartype parent_action_id: str - :ivar previous_action_id: - :vartype previous_action_id: str - """ - - id: Required[Optional[str]] - """Required.""" - object: Literal["realtime.item"] - """Default value is \"realtime.item\".""" - type: Required[Literal["workflow_action"]] - """Required. Default value is \"workflow_action\".""" - action_id: Required[str] - """Required.""" - status: Required[str] - """Required.""" - kind: Optional[str] - parent_action_id: Optional[str] - previous_action_id: Optional[str] - - -class VoiceAssistantMessageItem(TypedDict, total=False): - """An assistant message item. Only ``output_text`` and ``output_audio`` content are valid for - assistant messages. - - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: int - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str - :ivar type: Required. A message item. - :vartype type: Literal[VoiceConversationItemType.MESSAGE] - :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: Literal["realtime.item"] - :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: Literal["completed", "incomplete", "in_progress"] - :ivar content: The content of the message. Required. - :vartype content: list["RealtimeConversationItemMessageAssistantContent"] - :ivar role: Required. ASSISTANT. - :vartype role: Literal[RealtimeConversationItemMessageType.ASSISTANT] - """ - - created_at: int - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: str - """The id of the response that produced this item, when applicable.""" - type: Required[Literal[VoiceConversationItemType.MESSAGE]] - """Required. A message item.""" - id: str - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Literal["realtime.item"] - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - status: Literal["completed", "incomplete", "in_progress"] - """The status of the item. Has no effect on the conversation. Is one of the following types: - Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" - content: Required[list["RealtimeConversationItemMessageAssistantContent"]] - """The content of the message. Required.""" - role: Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] - """Required. ASSISTANT.""" - - -class VoiceAudioConfig(TypedDict, total=False): - """The audio configuration for a voice agent. These values are session defaults and may be - overridden when connecting. - - :ivar input: Input (microphone) audio configuration. - :vartype input: "VoiceAudioInputConfig" - :ivar output: Output (agent speech) audio configuration. - :vartype output: "VoiceAudioOutputConfig" - """ - - input: "VoiceAudioInputConfig" - """Input (microphone) audio configuration.""" - output: "VoiceAudioOutputConfig" - """Output (agent speech) audio configuration.""" - - -class VoiceAudioFormat(TypedDict, total=False): - """An audio format. Follows the OpenAI Realtime session schema; ``type`` carries the media - subtype. - - :ivar type: The audio format type, e.g. 'audio/pcm' (16-bit PCM), 'audio/pcmu' (G.711 mu-law), - or 'audio/pcma' (G.711 A-law). Required. Known values are: "audio/pcm", "audio/pcmu", and - "audio/pcma". - :vartype type: Union[str, "VoiceAudioFormatType"] - :ivar rate: The sample rate in Hz. Applies to 'audio/pcm' (e.g. 24000); omit for telephony - G.711 formats (8 kHz). - :vartype rate: int - """ - - type: Required[Union[str, "VoiceAudioFormatType"]] - """The audio format type, e.g. 'audio/pcm' (16-bit PCM), 'audio/pcmu' (G.711 mu-law), or - 'audio/pcma' (G.711 A-law). Required. Known values are: \"audio/pcm\", \"audio/pcmu\", and - \"audio/pcma\".""" - rate: int - """The sample rate in Hz. Applies to 'audio/pcm' (e.g. 24000); omit for telephony G.711 formats (8 - kHz).""" - - -class VoiceAudioInputConfig(TypedDict, total=False): - """Input audio configuration for a voice agent. - - :ivar format: The input audio format. - :vartype format: "VoiceAudioFormat" - :ivar noise_reduction: Input noise reduction. Set to null to disable. - :vartype noise_reduction: "VoiceNoiseReduction" - :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: "VoiceTurnDetection" - :ivar transcription: Asynchronous input-audio transcription. Set to null to disable - transcription. - :vartype transcription: "VoiceInputTranscription" - """ - - format: "VoiceAudioFormat" - """The input audio format.""" - noise_reduction: Optional["VoiceNoiseReduction"] - """Input noise reduction. Set to null to disable.""" - turn_detection: Optional["VoiceTurnDetection"] - """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.""" - transcription: Optional["VoiceInputTranscription"] - """Asynchronous input-audio transcription. Set to null to disable transcription.""" - - -class VoiceAudioOutputConfig(TypedDict, total=False): - """Output audio configuration for a voice agent. - - :ivar format: The output audio format. - :vartype format: "VoiceAudioFormat" - :ivar voice: The typed voice configuration. Is one of the following types: OpenAIVoice, - AzureVoice, AzureRealtimeNativeVoice - :vartype voice: "_unions.VoiceAgentVoice" - :ivar speed: The OpenAI-compatible speaking speed multiplier, from 0.25 to 1.5. Defaults to 1. - For Azure synthesized voices, use ``voice.rate`` instead. - :vartype speed: float - :ivar output_audio_timestamp_types: Timestamp kinds to include with output audio. - :vartype output_audio_timestamp_types: list[Union[str, "VoiceAudioTimestampType"]] - """ - - format: "VoiceAudioFormat" - """The output audio format.""" - voice: "_unions.VoiceAgentVoice" - """The typed voice configuration. Is one of the following types: OpenAIVoice, AzureVoice, - AzureRealtimeNativeVoice""" - speed: float - """The OpenAI-compatible speaking speed multiplier, from 0.25 to 1.5. Defaults to 1. For Azure - synthesized voices, use ``voice.rate`` instead.""" - output_audio_timestamp_types: list[Union[str, "VoiceAudioTimestampType"]] - """Timestamp kinds to include with output audio.""" - - -class VoiceAvatarConfig(TypedDict, total=False): - """Avatar configuration for a voice agent. These values are session defaults and may be overridden - when connecting. - - :ivar type: The avatar type. Required. Known values are: "video_avatar" and "photo_avatar". - :vartype type: Union[str, "VoiceAvatarType"] - :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: Union[str, "VoiceAvatarOutputProtocol"] - """ - - type: Required[Union[str, "VoiceAvatarType"]] - """The avatar type. Required. Known values are: \"video_avatar\" and \"photo_avatar\".""" - character: Required[str] - """The avatar character identifier, e.g. 'lisa'. Required.""" - style: str - """The avatar style, e.g. 'casual-sitting'.""" - customized: bool - """Whether the avatar is a customer-customized avatar. Defaults to false.""" - output_protocol: Union[str, "VoiceAvatarOutputProtocol"] - """The transport used to deliver the avatar video stream. Known values are: \"webrtc\" and - \"websocket\".""" - - -class VoiceAzureSemanticDetection(TypedDict, total=False): - """Default Azure semantic end-of-utterance detection. - - :ivar model: Required. The default semantic detection model. - :vartype model: Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1] - :ivar threshold_level: The sensitivity threshold. Known values are: "low", "medium", "high", - and "default". - :vartype threshold_level: Union[str, "VoiceEndOfUtteranceThresholdLevel"] - :ivar timeout_ms: The detection timeout in milliseconds. - :vartype timeout_ms: int - """ - - model: Required[Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1]] - """Required. The default semantic detection model.""" - threshold_level: Union[str, "VoiceEndOfUtteranceThresholdLevel"] - """The sensitivity threshold. Known values are: \"low\", \"medium\", \"high\", and \"default\".""" - timeout_ms: int - """The detection timeout in milliseconds.""" - - -class VoiceAzureSemanticDetectionEn(TypedDict, total=False): - """English-optimized Azure semantic end-of-utterance detection. - - :ivar model: Required. The English-optimized semantic detection model. - :vartype model: Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1_EN] - :ivar threshold_level: The sensitivity threshold. Known values are: "low", "medium", "high", - and "default". - :vartype threshold_level: Union[str, "VoiceEndOfUtteranceThresholdLevel"] - :ivar timeout_ms: The detection timeout in milliseconds. - :vartype timeout_ms: int - """ - - model: Required[Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1_EN]] - """Required. The English-optimized semantic detection model.""" - threshold_level: Union[str, "VoiceEndOfUtteranceThresholdLevel"] - """The sensitivity threshold. Known values are: \"low\", \"medium\", \"high\", and \"default\".""" - timeout_ms: int - """The detection timeout in milliseconds.""" - - -class VoiceAzureSemanticDetectionMultilingual(TypedDict, total=False): - """Multilingual Azure semantic end-of-utterance detection. - - :ivar model: Required. The multilingual semantic detection model. - :vartype model: Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1_MULTILINGUAL] - :ivar threshold_level: The sensitivity threshold. Known values are: "low", "medium", "high", - and "default". - :vartype threshold_level: Union[str, "VoiceEndOfUtteranceThresholdLevel"] - :ivar timeout_ms: The detection timeout in milliseconds. - :vartype timeout_ms: int - """ - - model: Required[Literal[VoiceEndOfUtteranceDetectionModel.SEMANTIC_DETECTION_V1_MULTILINGUAL]] - """Required. The multilingual semantic detection model.""" - threshold_level: Union[str, "VoiceEndOfUtteranceThresholdLevel"] - """The sensitivity threshold. Known values are: \"low\", \"medium\", \"high\", and \"default\".""" - timeout_ms: int - """The detection timeout in milliseconds.""" - - -class VoiceAzureSemanticVadEnTurnDetection(TypedDict, total=False): - """English-optimized Azure semantic voice activity detection. - - :ivar type: Required. English-optimized Azure semantic voice activity detection. - :vartype type: Literal[VoiceTurnDetectionType.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: int - :ivar silence_duration_ms: Silence required to end speech detection, in milliseconds. - :vartype silence_duration_ms: int - :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. - :vartype end_of_utterance_detection: "VoiceEndOfUtteranceDetection" - :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in - milliseconds. - :vartype speech_duration_ms: int - :ivar remove_filler_words: Whether filler words are removed from transcription. - :vartype remove_filler_words: bool - :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech - stops. - :vartype auto_truncate: 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: Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN]] - """Required. English-optimized Azure semantic voice activity detection.""" - threshold: float - """Activation threshold for voice activity detection, from 0 to 1.""" - prefix_padding_ms: int - """Audio to include before detected speech, in milliseconds.""" - silence_duration_ms: int - """Silence required to end speech detection, in milliseconds.""" - end_of_utterance_detection: "VoiceEndOfUtteranceDetection" - """Semantic end-of-utterance detection configuration.""" - speech_duration_ms: int - """Minimum speech duration required to trigger detection, in milliseconds.""" - remove_filler_words: bool - """Whether filler words are removed from transcription.""" - auto_truncate: bool - """Whether the input audio buffer is truncated automatically when speech stops.""" - create_response: bool - """Whether a response is created automatically when speech stops.""" - interrupt_response: bool - """Whether user speech may interrupt the agent's response.""" - - -class VoiceAzureSemanticVadMultilingualTurnDetection(TypedDict, total=False): # pylint: disable=name-too-long - """Multilingual Azure semantic voice activity detection. - - :ivar type: Required. Multilingual Azure semantic voice activity detection. - :vartype type: Literal[VoiceTurnDetectionType.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: int - :ivar silence_duration_ms: Silence required to end speech detection, in milliseconds. - :vartype silence_duration_ms: int - :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. - :vartype end_of_utterance_detection: "VoiceEndOfUtteranceDetection" - :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in - milliseconds. - :vartype speech_duration_ms: int - :ivar remove_filler_words: Whether filler words are removed from transcription. - :vartype remove_filler_words: bool - :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech - stops. - :vartype auto_truncate: 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: Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL]] - """Required. Multilingual Azure semantic voice activity detection.""" - threshold: float - """Activation threshold for voice activity detection, from 0 to 1.""" - prefix_padding_ms: int - """Audio to include before detected speech, in milliseconds.""" - silence_duration_ms: int - """Silence required to end speech detection, in milliseconds.""" - end_of_utterance_detection: "VoiceEndOfUtteranceDetection" - """Semantic end-of-utterance detection configuration.""" - speech_duration_ms: int - """Minimum speech duration required to trigger detection, in milliseconds.""" - remove_filler_words: bool - """Whether filler words are removed from transcription.""" - auto_truncate: bool - """Whether the input audio buffer is truncated automatically when speech stops.""" - create_response: bool - """Whether a response is created automatically when speech stops.""" - interrupt_response: bool - """Whether user speech may interrupt the agent's response.""" - languages: list[str] - """BCP-47 language codes used for speech detection.""" - - -class VoiceAzureSemanticVadTurnDetection(TypedDict, total=False): - """Azure semantic voice activity detection. - - :ivar type: Required. Azure semantic voice activity detection. - :vartype type: Literal[VoiceTurnDetectionType.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: int - :ivar silence_duration_ms: Silence required to end speech detection, in milliseconds. - :vartype silence_duration_ms: int - :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. - :vartype end_of_utterance_detection: "VoiceEndOfUtteranceDetection" - :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in - milliseconds. - :vartype speech_duration_ms: int - :ivar remove_filler_words: Whether filler words are removed from transcription. - :vartype remove_filler_words: bool - :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech - stops. - :vartype auto_truncate: 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: Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD]] - """Required. Azure semantic voice activity detection.""" - threshold: float - """Activation threshold for voice activity detection, from 0 to 1.""" - prefix_padding_ms: int - """Audio to include before detected speech, in milliseconds.""" - silence_duration_ms: int - """Silence required to end speech detection, in milliseconds.""" - end_of_utterance_detection: "VoiceEndOfUtteranceDetection" - """Semantic end-of-utterance detection configuration.""" - speech_duration_ms: int - """Minimum speech duration required to trigger detection, in milliseconds.""" - remove_filler_words: bool - """Whether filler words are removed from transcription.""" - auto_truncate: bool - """Whether the input audio buffer is truncated automatically when speech stops.""" - create_response: bool - """Whether a response is created automatically when speech stops.""" - interrupt_response: bool - """Whether user speech may interrupt the agent's response.""" - languages: list[str] - """BCP-47 language codes used for speech detection.""" - - -class VoiceFunctionCallItem(TypedDict, total=False): - """A function call request item. - - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: int - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_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: Literal["realtime.item"] - :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: Literal["completed", "incomplete", "in_progress"] - :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 type: Required. A function-call request item. - :vartype type: Literal[VoiceConversationItemType.FUNCTION_CALL] - """ - - created_at: int - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: str - """The id of the response that produced this item, when applicable.""" - id: str - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Literal["realtime.item"] - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - status: Literal["completed", "incomplete", "in_progress"] - """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 - """The ID of the function call.""" - name: Required[str] - """The name of the function being called. Required.""" - arguments: Required[str] - """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.""" - type: Required[Literal[VoiceConversationItemType.FUNCTION_CALL]] - """Required. A function-call request item.""" - - -class VoiceFunctionCallOutputItem(TypedDict, total=False): - """A function call output item. - - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: int - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_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: Literal["realtime.item"] - :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: Literal["completed", "incomplete", "in_progress"] - :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 type: Required. A function-call output item. - :vartype type: Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT] - :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 - """ - - created_at: int - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: str - """The id of the response that produced this item, when applicable.""" - id: str - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Literal["realtime.item"] - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - status: Literal["completed", "incomplete", "in_progress"] - """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: Required[str] - """The ID of the function call this output is for. Required.""" - output: Required[str] - """The output of the function call, this is free text and can contain any information or simply be - empty. Required.""" - type: Required[Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT]] - """Required. A function-call output item.""" - name: str - """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``.""" - - -class VoiceInputTranscription(TypedDict, total=False): - """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 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 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: Literal["minimal", "low", "medium", "high", "xhigh"] - :ivar model: The transcription model to use. 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: Union[str, "VoiceInputTranscriptionModel"] - :ivar custom_speech: Optional custom speech model 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] - """ - - language: str - """The language of the input audio. Supplying the input language in `ISO-639-1 - `_ (e.g. ``en``) format will improve - accuracy and latency.""" - prompt: str - """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: Literal["minimal", "low", "medium", "high", "xhigh"] - """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: Required[Union[str, "VoiceInputTranscriptionModel"]] - """The transcription model to use. 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: dict[str, str] - """Optional custom speech model configuration, keyed by locale.""" - phrase_list: list[str] - """Optional phrase hints that bias recognition toward domain terms.""" - - -class VoiceMcpApprovalRequestItem(TypedDict, total=False): - """An MCP approval request item. - - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: int - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str - :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 type: Required. An MCP approval request item. - :vartype type: Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST] - """ - - created_at: int - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: str - """The id of the response that produced this item, when applicable.""" - id: Required[str] - """The unique ID of the approval request. Required.""" - server_label: Required[str] - """The label of the MCP server making the request. Required.""" - name: Required[str] - """The name of the tool to run. Required.""" - arguments: Required[str] - """A JSON string of arguments for the tool. Required.""" - type: Required[Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST]] - """Required. An MCP approval request item.""" - - -class VoiceMcpApprovalResponseItem(TypedDict, total=False): - """An MCP approval response item (client-created). - - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: int - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str - :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 type: Required. An MCP approval response item. - :vartype type: Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE] - """ - - created_at: int - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: str - """The id of the response that produced this item, when applicable.""" - id: Required[str] - """The unique ID of the approval response. Required.""" - approval_request_id: Required[str] - """The ID of the approval request being answered. Required.""" - approve: Required[bool] - """Whether the request was approved. Required.""" - reason: Optional[str] - type: Required[Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE]] - """Required. An MCP approval response item.""" - - -class VoiceMcpCallItem(TypedDict, total=False): - """An MCP call item. - - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: int - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str - :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: "RealtimeMCPError" - :ivar type: Required. An MCP call item. - :vartype type: Literal[VoiceConversationItemType.MCP_CALL] - """ - - created_at: int - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: str - """The id of the response that produced this item, when applicable.""" - id: Required[str] - """The unique ID of the tool call. Required.""" - server_label: Required[str] - """The label of the MCP server running the tool. Required.""" - name: Required[str] - """The name of the tool that was run. Required.""" - arguments: Required[str] - """A JSON string of the arguments passed to the tool. Required.""" - approval_request_id: Optional[str] - output: Optional[str] - error: "RealtimeMCPError" - type: Required[Literal[VoiceConversationItemType.MCP_CALL]] - """Required. An MCP call item.""" - - -class VoiceMcpListToolsItem(TypedDict, total=False): - """An MCP list-tools item. - - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: int - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str - :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["MCPListToolsTool"] - :ivar type: Required. An MCP list-tools item. - :vartype type: Literal[VoiceConversationItemType.MCP_LIST_TOOLS] - """ - - created_at: int - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: str - """The id of the response that produced this item, when applicable.""" - id: str - """The unique ID of the list.""" - server_label: Required[str] - """The label of the MCP server. Required.""" - tools: Required[list["MCPListToolsTool"]] - """The tools available on the server. Required.""" - type: Required[Literal[VoiceConversationItemType.MCP_LIST_TOOLS]] - """Required. An MCP list-tools item.""" - - -class VoiceNoiseReduction(TypedDict, total=False): - """Input audio noise reduction configuration. - - :ivar type: The noise reduction mode. Required. Known values are: "near_field", "far_field", - and "azure_deep_noise_suppression". - :vartype type: Union[str, "VoiceNoiseReductionType"] - """ - - type: Required[Union[str, "VoiceNoiseReductionType"]] - """The noise reduction mode. Required. Known values are: \"near_field\", \"far_field\", and - \"azure_deep_noise_suppression\".""" - - -class VoiceSemanticVadTurnDetection(TypedDict, total=False): - """Semantic voice activity detection. - - :ivar eagerness: Is one of the following types: Literal["low"], Literal["medium"], - Literal["high"], Literal["auto"] - :vartype eagerness: Literal["low", "medium", "high", "auto"] - :ivar create_response: - :vartype create_response: bool - :ivar interrupt_response: - :vartype interrupt_response: bool - :ivar type: Required. Semantic voice activity detection. - :vartype type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD] - """ - - eagerness: Literal["low", "medium", "high", "auto"] - """Is one of the following types: Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"], - Literal[\"auto\"]""" - create_response: bool - interrupt_response: bool - type: Required[Literal[VoiceTurnDetectionType.SEMANTIC_VAD]] - """Required. Semantic voice activity detection.""" - - -class VoiceServerVadTurnDetection(TypedDict, total=False): - """Server-side voice activity detection. - - :ivar threshold: - :vartype threshold: float - :ivar prefix_padding_ms: - :vartype prefix_padding_ms: int - :ivar silence_duration_ms: - :vartype silence_duration_ms: int - :ivar create_response: - :vartype create_response: bool - :ivar interrupt_response: - :vartype interrupt_response: bool - :ivar idle_timeout_ms: - :vartype idle_timeout_ms: int - :ivar type: Required. Server-side voice activity detection. - :vartype type: Literal[VoiceTurnDetectionType.SERVER_VAD] - """ - - threshold: float - prefix_padding_ms: int - silence_duration_ms: int - create_response: bool - interrupt_response: bool - idle_timeout_ms: Optional[int] - type: Required[Literal[VoiceTurnDetectionType.SERVER_VAD]] - """Required. Server-side voice activity detection.""" - - -class VoiceSystemMessageItem(TypedDict, total=False): - """A system message item. Only ``input_text`` content is valid for system messages. - - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: int - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str - :ivar type: Required. A message item. - :vartype type: Literal[VoiceConversationItemType.MESSAGE] - :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: Literal["realtime.item"] - :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: Literal["completed", "incomplete", "in_progress"] - :ivar content: The content of the message. Required. - :vartype content: list["RealtimeConversationItemMessageSystemContent"] - :ivar role: Required. SYSTEM. - :vartype role: Literal[RealtimeConversationItemMessageType.SYSTEM] - """ - - created_at: int - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: str - """The id of the response that produced this item, when applicable.""" - type: Required[Literal[VoiceConversationItemType.MESSAGE]] - """Required. A message item.""" - id: str - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Literal["realtime.item"] - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - status: Literal["completed", "incomplete", "in_progress"] - """The status of the item. Has no effect on the conversation. Is one of the following types: - Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" - content: Required[list["RealtimeConversationItemMessageSystemContent"]] - """The content of the message. Required.""" - role: Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] - """Required. SYSTEM.""" - - -class VoiceSystemTool(TypedDict, total=False): - """A service-managed control that acts on the active voice session without customer code or - external authentication. - - :ivar type: The type of the tool. Always ``system``. Required. Default value is "system". - :vartype type: Literal["system"] - :ivar name: The service-managed control action. Known values are stable; additional values may - be added over time. Required. "end_conversation" - :vartype name: Union[str, "VoiceSystemToolName"] - :ivar description: An optional description of the system tool. - :vartype description: str - """ - - type: Required[Literal["system"]] - """The type of the tool. Always ``system``. Required. Default value is \"system\".""" - name: Required[Union[str, "VoiceSystemToolName"]] - """The service-managed control action. Known values are stable; additional values may be added - over time. Required. \"end_conversation\"""" - description: str - """An optional description of the system tool.""" - - -class VoiceToolboxTool(TypedDict, total=False): - """A reference to a Foundry toolbox, which is a versioned bundle of tools executed through its MCP - endpoint. - - :ivar type: The type of the tool. Always ``toolbox``. Required. Default value is "toolbox". - :vartype type: Literal["toolbox"] - :ivar toolbox_name: The name of the toolbox to attach. Required. - :vartype toolbox_name: str - :ivar toolbox_version: The immutable version of the toolbox to attach. Required. - :vartype toolbox_version: str - """ - - type: Required[Literal["toolbox"]] - """The type of the tool. Always ``toolbox``. Required. Default value is \"toolbox\".""" - toolbox_name: Required[str] - """The name of the toolbox to attach. Required.""" - toolbox_version: Required[str] - """The immutable version of the toolbox to attach. Required.""" - - -class VoiceUserMessageItem(TypedDict, total=False): - """A user message item. ``input_text``, ``input_audio``, and ``input_image`` content are valid for - user messages. - - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: int - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str - :ivar type: Required. A message item. - :vartype type: Literal[VoiceConversationItemType.MESSAGE] - :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: Literal["realtime.item"] - :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: Literal["completed", "incomplete", "in_progress"] - :ivar content: The content of the message. Required. - :vartype content: list["RealtimeConversationItemMessageUserContent"] - :ivar role: Required. USER. - :vartype role: Literal[RealtimeConversationItemMessageType.USER] - """ - - created_at: int - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: str - """The id of the response that produced this item, when applicable.""" - type: Required[Literal[VoiceConversationItemType.MESSAGE]] - """Required. A message item.""" - id: str - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Literal["realtime.item"] - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - status: Literal["completed", "incomplete", "in_progress"] - """The status of the item. Has no effect on the conversation. Is one of the following types: - Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" - content: Required[list["RealtimeConversationItemMessageUserContent"]] - """The content of the message. Required.""" - role: Required[Literal[RealtimeConversationItemMessageType.USER]] - """Required. USER.""" - - -class CreateVoiceAgentRequest(TypedDict, total=False): - """CreateVoiceAgentRequest. - - :ivar name: The unique name that identifies the agent. Name can be used to - retrieve/update/delete the agent. - - * Must start and end with alphanumeric characters, - * Can contain hyphens in the middle - * Must not exceed 63 characters. Required. - :vartype name: str - :ivar state: The initial operational state of the agent. Defaults to 'enabled' if not - specified. Known values are: "enabled" and "disabled". - :vartype state: Union[str, "AgentState"] - :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. - :vartype metadata: dict[str, str] - :ivar description: A human-readable description of the agent. - :vartype description: str - :ivar blueprint_reference: The blueprint reference for the agent. - :vartype blueprint_reference: "AgentBlueprintReference" - :ivar draft: (Preview) Whether this agent version is a draft (candidate) rather than a release. - The service defaults to ``false`` if a value is not specified by the caller. Draft versions are - recorded but excluded from default 'latest' resolution and are not auto-promoted. - :vartype draft: bool - :ivar definition: The voice agent definition. Required. - :vartype definition: "VoiceAgentDefinition" - :ivar agent_endpoint: An optional endpoint configuration. If not specified, a default endpoint - configuration will be set for the agent. - :vartype agent_endpoint: "AgentEndpointConfig" - :ivar agent_card: Optional agent card for the agent. - :vartype agent_card: "AgentCard" - """ - - name: Required[str] - """The unique name that identifies the agent. Name can be used to retrieve/update/delete the - agent. - - * Must start and end with alphanumeric characters, - * Can contain hyphens in the middle - * Must not exceed 63 characters. Required.""" - state: Union[str, "AgentState"] - """The initial operational state of the agent. Defaults to 'enabled' if not specified. Known - values are: \"enabled\" and \"disabled\".""" - metadata: dict[str, str] - """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.""" - description: str - """A human-readable description of the agent.""" - blueprint_reference: "AgentBlueprintReference" - """The blueprint reference for the agent.""" - draft: bool - """(Preview) Whether this agent version is a draft (candidate) rather than a release. The service - defaults to ``false`` if a value is not specified by the caller. Draft versions are recorded - but excluded from default 'latest' resolution and are not auto-promoted.""" - definition: Required["VoiceAgentDefinition"] - """The voice agent definition. Required.""" - agent_endpoint: "AgentEndpointConfig" - """An optional endpoint configuration. If not specified, a default endpoint configuration will be - set for the agent.""" - agent_card: "AgentCard" - """Optional agent card for the agent.""" - - -class UpdateVoiceAgentRequest(TypedDict, total=False): - """UpdateVoiceAgentRequest. - - :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. - :vartype metadata: dict[str, str] - :ivar description: A human-readable description of the agent. - :vartype description: str - :ivar blueprint_reference: The blueprint reference for the agent. - :vartype blueprint_reference: "AgentBlueprintReference" - :ivar definition: The voice agent definition. Required. - :vartype definition: "VoiceAgentDefinition" - """ - - metadata: dict[str, str] - """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.""" - description: str - """A human-readable description of the agent.""" - blueprint_reference: "AgentBlueprintReference" - """The blueprint reference for the agent.""" - definition: Required["VoiceAgentDefinition"] - """The voice agent definition. Required.""" - - -class GenerateVoiceAgentRequest(TypedDict, total=False): - """GenerateVoiceAgentRequest. - - :ivar name: The unique name for the agent to create. Required. - :vartype name: str - :ivar model_type: How the model backing the generated agent is served: ``managed`` - (service-managed) or ``self_deployed`` (the customer's own deployment). Carried through to the - generated definition, not generated. Required. Known values are: "managed" and "self_deployed". - :vartype model_type: Union[str, "VoiceModelType"] - :ivar model: The model paired with ``model_type``: the service-managed model name when - ``managed``, or the customer's Foundry deployment name when ``self_deployed``. Carried through, - not generated. Required. - :vartype model: str - :ivar agent_type: The persona/tone to steer generation. Required. Known values are: "personal" - and "business". - :vartype agent_type: Union[str, "VoiceAgentType"] - :ivar use_case: The scenario-template catalog entry the generator specializes for. Required. - Known values are: "customer_support", "reception", "sales", "travel_assistant", "outreach", - "personal_assistant", "learning", "call_center", and "in_car". - :vartype use_case: Union[str, "VoiceAgentUseCase"] - :ivar goal: A natural-language description of what the agent should do; the seed for the - generated ``instructions``. Required. - :vartype goal: str - :ivar description: An optional description for the agent. Generated from ``goal`` when omitted. - :vartype description: str - :ivar tools: Optional tools carried through verbatim onto the generated agent (see - ``VoiceAgentTool``). - :vartype tools: list["_unions.VoiceAgentTool"] - :ivar draft: (Preview) When ``true``, the generated voice agent is created as a draft — an - editable, unpublished version the caller can review and refine before publishing it via the - standard create/version path. The service defaults to ``false`` if a value is not specified by - the caller, in which case the agent is created and published normally. - :vartype draft: bool - """ - - name: Required[str] - """The unique name for the agent to create. Required.""" - model_type: Required[Union[str, "VoiceModelType"]] - """How the model backing the generated agent is served: ``managed`` (service-managed) or - ``self_deployed`` (the customer's own deployment). Carried through to the generated definition, - not generated. Required. Known values are: \"managed\" and \"self_deployed\".""" - model: Required[str] - """The model paired with ``model_type``: the service-managed model name when ``managed``, or the - customer's Foundry deployment name when ``self_deployed``. Carried through, not generated. - Required.""" - agent_type: Required[Union[str, "VoiceAgentType"]] - """The persona/tone to steer generation. Required. Known values are: \"personal\" and - \"business\".""" - use_case: Required[Union[str, "VoiceAgentUseCase"]] - """The scenario-template catalog entry the generator specializes for. Required. Known values are: - \"customer_support\", \"reception\", \"sales\", \"travel_assistant\", \"outreach\", - \"personal_assistant\", \"learning\", \"call_center\", and \"in_car\".""" - goal: Required[str] - """A natural-language description of what the agent should do; the seed for the generated - ``instructions``. Required.""" - description: str - """An optional description for the agent. Generated from ``goal`` when omitted.""" - tools: list["_unions.VoiceAgentTool"] - """Optional tools carried through verbatim onto the generated agent (see ``VoiceAgentTool``).""" - draft: bool - """(Preview) When ``true``, the generated voice agent is created as a draft — an editable, - unpublished version the caller can review and refine before publishing it via the standard - create/version path. The service defaults to ``false`` if a value is not specified by the - caller, in which case the agent is created and published normally.""" - - -class CreateVoiceAgentVersionRequest(TypedDict, total=False): - """CreateVoiceAgentVersionRequest. - - :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. - :vartype metadata: dict[str, str] - :ivar description: A human-readable description of the agent. - :vartype description: str - :ivar blueprint_reference: The blueprint reference for the agent. - :vartype blueprint_reference: "AgentBlueprintReference" - :ivar draft: (Preview) Whether this agent version is a draft (candidate) rather than a release. - The service defaults to ``false`` if a value is not specified by the caller. Draft versions are - recorded but excluded from default 'latest' resolution and are not auto-promoted. - :vartype draft: bool - :ivar definition: The voice agent definition. Required. - :vartype definition: "VoiceAgentDefinition" - """ - - metadata: dict[str, str] - """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.""" - description: str - """A human-readable description of the agent.""" - blueprint_reference: "AgentBlueprintReference" - """The blueprint reference for the agent.""" - draft: bool - """(Preview) Whether this agent version is a draft (candidate) rather than a release. The service - defaults to ``false`` if a value is not specified by the caller. Draft versions are recorded - but excluded from default 'latest' resolution and are not auto-promoted.""" - definition: Required["VoiceAgentDefinition"] - """The voice agent definition. Required.""" - - -AgentBlueprintReference = Union[ManagedAgentIdentityBlueprintReference] -AgentEndpointAuthorizationScheme = Union[ - BotServiceAuthorizationScheme, - BotServiceRbacAuthorizationScheme, - BotServiceTenantAuthorizationScheme, - EntraAuthorizationScheme, -] -AzureVoice = Union[AzureAvatarVoiceSyncVoice, AzureCustomVoice, AzurePersonalVoice, AzureStandardVoice] -CreateTranscriptionResponseJsonUsage = Union[TranscriptTextUsageDuration, TranscriptTextUsageTokens] -VersionSelectionRule = Union[FixedRatioVersionSelectionRule] -VoiceGreetingConfig = Union[LlmGeneratedVoiceGreetingConfig, TemplateVoiceGreetingConfig] -Tool = Union[MCPTool] -RealtimeConversationItem = Union[ - RealtimeConversationItemFunctionCall, - RealtimeConversationItemFunctionCallOutput, - RealtimeMCPApprovalRequest, - RealtimeMCPApprovalResponse, - RealtimeMCPToolCall, - RealtimeMCPListTools, -] -RealtimeConversationItemMessage = Union[ - RealtimeConversationItemMessageAssistant, RealtimeConversationItemMessageSystem, RealtimeConversationItemMessageUser -] -RealtimeMCPError = Union[RealtimeMCPHTTPError, RealtimeMCPProtocolError, RealtimeMCPToolExecutionError] -RealtimeServerEvent = Union[RealtimeServerEventResponseContentPartAdded] -ToolChoiceParam = Union[ToolChoiceFunction, ToolChoiceMCP] -VoiceAgentInterimResponseConfig = Union[VoiceAgentLlmInterimResponseConfig, VoiceAgentStaticInterimResponseConfig] -VoiceMessageItem = Union[VoiceAssistantMessageItem, VoiceSystemMessageItem, VoiceUserMessageItem] -VoiceConversationItem = Union[ - VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, - VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem, - VoiceMcpCallItem, - VoiceMcpListToolsItem, - VoiceMessageItem, -] -VoiceEndOfUtteranceDetection = Union[ - VoiceAzureSemanticDetection, VoiceAzureSemanticDetectionEn, VoiceAzureSemanticDetectionMultilingual -] -VoiceTurnDetection = Union[ - VoiceAzureSemanticVadTurnDetection, - VoiceAzureSemanticVadEnTurnDetection, - VoiceAzureSemanticVadMultilingualTurnDetection, - VoiceSemanticVadTurnDetection, - VoiceServerVadTurnDetection, -] diff --git a/sdk/voiceagents/azure-ai-voiceagents/dev_requirements.txt b/sdk/voiceagents/azure-ai-voiceagents/dev_requirements.txt deleted file mode 100644 index ad0907b03b93..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/dev_requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ --e ../../../eng/tools/azure-sdk-tools -../../core/azure-core -../../identity/azure-identity -aiohttp \ No newline at end of file diff --git a/sdk/voiceagents/azure-ai-voiceagents/pyproject.toml b/sdk/voiceagents/azure-ai-voiceagents/pyproject.toml deleted file mode 100644 index 5247f5be1ec5..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/pyproject.toml +++ /dev/null @@ -1,61 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -[build-system] -requires = ["setuptools>=77.0.3", "wheel"] -build-backend = "setuptools.build_meta" - -[project] -name = "azure-ai-voiceagents" -authors = [ - { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, -] -description = "Microsoft Corporation Azure Ai Voiceagents Client Library for Python" -license = "MIT" -classifiers = [ - "Development Status :: 4 - Beta", - "Programming Language :: Python", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", - "Programming Language :: Python :: 3.14", -] -requires-python = ">=3.10" -keywords = ["azure", "azure sdk"] - -dependencies = [ - "isodate>=0.6.1", - "azure-core>=1.37.0", - "typing-extensions>=4.6.0", -] -dynamic = [ -"version", "readme" -] - -[project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python" - -[tool.setuptools.dynamic] -version = {attr = "azure.ai.voiceagents._version.VERSION"} -readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} - -[tool.setuptools.packages.find] -exclude = [ - "tests*", - "generated_tests*", - "samples*", - "generated_samples*", - "doc*", - "azure", - "azure.ai", -] - -[tool.setuptools.package-data] -pytyped = ["py.typed"] diff --git a/sdk/voiceagents/azure-ai-voiceagents/pyrightconfig.json b/sdk/voiceagents/azure-ai-voiceagents/pyrightconfig.json deleted file mode 100644 index 66cc40d3f494..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/pyrightconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "reportTypeCommentUsage": true, - "reportMissingImports": false, - "pythonVersion": "3.10", - "exclude": [ - "**/tests/**", - "azure/ai/voiceagents/_unions.py" - ], - "extraPaths": [ - "./../../core/azure-core", - "./../../identity/azure-identity" - ] -} diff --git a/sdk/voiceagents/azure-ai-voiceagents/pytest.ini b/sdk/voiceagents/azure-ai-voiceagents/pytest.ini deleted file mode 100644 index 2f4c80e30750..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/pytest.ini +++ /dev/null @@ -1,2 +0,0 @@ -[pytest] -asyncio_mode = auto diff --git a/sdk/voiceagents/azure-ai-voiceagents/samples/README.md b/sdk/voiceagents/azure-ai-voiceagents/samples/README.md deleted file mode 100644 index 22f40474bf93..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/samples/README.md +++ /dev/null @@ -1,153 +0,0 @@ ---- -page_type: sample -languages: - - python -products: - - azure - - azure-ai-foundry -urlFragment: voiceagents-samples ---- - -# Samples for the Azure AI Voice Agents client library for Python - -These code samples are organized **by scenario**: - -- **`quickstart/`** — the - shortest end-to-end path: generate a temporary voice agent with the management - API, hold a realtime microphone/speaker conversation with it, then delete the - agent. -- **`management/`** — - request/response scenarios with the `azure-ai-voiceagents` client: managing - voice agents, working with agent versions, and reading back persisted - conversations (transcript, items, and audio recordings). Each scenario - includes a sync sample and, where applicable, its async variant (files - suffixed `_async`). -- **`live/`** — the live voice conversation - scenario against an existing agent through the native - `client.realtime.connect(...)` API. No other SDK is required. - -> [!IMPORTANT] -> Voice agents are a **gated preview**. Every call opts in with the -> `VoiceAgents=V1Preview` feature flag (the samples pass it as `foundry_features`). -> The preview must also be **enabled for your subscription** and **served on your -> project's endpoint/region**. Until then, even a correct, authenticated request -> returns `404 NotFound` -- the route simply isn't provisioned for your project -> yet. If you hit this, confirm preview enablement and a supported region with -> your service contact rather than changing the sample code. - -## `quickstart/` -- create an agent and talk to it - -| File | Description | -| ---- | ----------- | -| [quickstart/sample_quickstart_async.py](https://github.com/Azure/azure-sdk-for-python/blob/xitzhang/voice-agent-pupr/sdk/voiceagents/azure-ai-voiceagents/samples/quickstart/sample_quickstart_async.py) | Generate a temporary voice agent, stream microphone audio to it, play the spoken response through your speakers, and delete the agent when the sample exits. Requires `pyaudio`. | - -## `management/` -- manage agents and read conversations - -**Manage voice agents** -- these run standalone; you only need an endpoint. - -| File | Description | -| ---- | ----------- | -| [management/sample_create_and_manage_voice_agent.py](https://github.com/Azure/azure-sdk-for-python/blob/xitzhang/voice-agent-pupr/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_create_and_manage_voice_agent.py) | Create (with a voice/audio config and conversation storage enabled), get, list, update, disable/enable, and delete a voice agent. | -| [management/sample_create_and_manage_voice_agent_async.py](https://github.com/Azure/azure-sdk-for-python/blob/xitzhang/voice-agent-pupr/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_create_and_manage_voice_agent_async.py) | Async version of the create/manage lifecycle. | -| [management/sample_create_voice_agent_with_tools.py](https://github.com/Azure/azure-sdk-for-python/blob/xitzhang/voice-agent-pupr/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_create_voice_agent_with_tools.py) | Create an agent with tools (`function`, `system`, `mcp`, `toolbox`), input-audio config (turn detection + transcription), and bring-your-own-model (`self_deployed`). | -| [management/sample_generate_voice_agent.py](https://github.com/Azure/azure-sdk-for-python/blob/xitzhang/voice-agent-pupr/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_generate_voice_agent.py) | Guided authoring: generate and create a voice agent from a persona, use case, and a natural-language goal. | -| [management/sample_manage_voice_agent_versions.py](https://github.com/Azure/azure-sdk-for-python/blob/xitzhang/voice-agent-pupr/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_manage_voice_agent_versions.py) | Create and list immutable versions of a voice agent, including draft versions. | - -**Read conversations** -- these need an existing agent and a conversation id from -a completed live session (see [Getting a conversation id](#getting-a-conversation-id)). - -| File | Description | -| ---- | ----------- | -| [management/sample_read_conversation.py](https://github.com/Azure/azure-sdk-for-python/blob/xitzhang/voice-agent-pupr/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_read_conversation.py) | Read a persisted conversation, its responses (and per-response items), and its items (with single get by id). | -| [management/sample_read_conversation_audio.py](https://github.com/Azure/azure-sdk-for-python/blob/xitzhang/voice-agent-pupr/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_read_conversation_audio.py) | Read the merged whole-call recording and a single turn's audio, streaming each to a WAV file. | - -## `live/` -- hold a live conversation - -| File | Description | -| ---- | ----------- | -| [live/sample_live_text_conversation_async.py](https://github.com/Azure/azure-sdk-for-python/blob/xitzhang/voice-agent-pupr/sdk/voiceagents/azure-ai-voiceagents/samples/live/sample_live_text_conversation_async.py) | Converse with an **existing** agent using **typed** turns: type prompts in a loop -- each is sent via `client.realtime.connect(...)` and the spoken reply is streamed back (optionally played through your speakers). Reads the persisted conversation back at the end. Runs headless -- no microphone needed. | -| [live/sample_live_audio_conversation_async.py](https://github.com/Azure/azure-sdk-for-python/blob/xitzhang/voice-agent-pupr/sdk/voiceagents/azure-ai-voiceagents/samples/live/sample_live_audio_conversation_async.py) | Converse with an **existing** agent using your **microphone**: stream live audio to the agent, let server VAD detect your turns, and talk over the agent to **barge in** (cancel its in-flight reply). Requires `pyaudio`. Runs until you press Ctrl-C. | - -## Prerequisites - -- Python 3.10 or later. -- An Azure subscription and a Foundry project endpoint. -- The following packages installed: - - ```bash - python -m pip install azure-ai-voiceagents azure-identity - # for the async samples, also install an async transport: - python -m pip install aiohttp - # optional: to hear the live samples' audio reply through your speakers, - # and to run the microphone sample: - python -m pip install pyaudio - ``` - -## Setup - -The samples read their inputs from environment variables. Every sample needs -`AZURE_VOICE_AGENTS_ENDPOINT`; the other variables depend on the scenario. - -| Variable | Required by | Description | -| -------- | ----------- | ----------- | -| `AZURE_VOICE_AGENTS_ENDPOINT` | all samples | Foundry project endpoint: `https://.services.ai.azure.com/api/projects/` | -| `AZURE_VOICE_AGENTS_MODEL` | management and quickstart samples (optional) | Realtime model deployment name. Defaults to `gpt-realtime`. | -| `AZURE_VOICE_AGENTS_MODEL_TYPE` | `sample_create_voice_agent_with_tools.py` (optional) | `managed` (default) for a service-hosted model, or `self_deployed` to bring your own Foundry deployment. | -| `AZURE_VOICE_AGENTS_AGENT_NAME` | `live/*.py`, `sample_read_conversation*.py` | Name of an existing voice agent -- create one first with a management sample using `store=True`, or use the quickstart for an automatic create-and-talk flow. | -| `AZURE_VOICE_AGENTS_CONVERSATION_ID` | `sample_read_conversation*.py` | Id of a persisted conversation (see below). | - -```bash -# bash -export AZURE_VOICE_AGENTS_ENDPOINT="https://.services.ai.azure.com/api/projects/" -``` - -```powershell -# PowerShell -$env:AZURE_VOICE_AGENTS_ENDPOINT = "https://.services.ai.azure.com/api/projects/" -``` - -The samples authenticate with -[`DefaultAzureCredential`](https://learn.microsoft.com/python/api/azure-identity/azure.identity.defaultazurecredential), -so sign in first (for example, with `az login`) or configure the appropriate -environment variables. Your identity needs access to the Foundry project. - -### Getting a conversation id - -The read samples don't create conversations -- this client can only *read* them. -A conversation is created by the **voice orchestrator during a live session**, -and it is persisted only when the agent was created with `store = true` (the -management samples turn this on). During the live session the service emits a -`conversation.created` event whose id you pass as -`AZURE_VOICE_AGENTS_CONVERSATION_ID`. Audio additionally requires the session to -have ended. - -The `live/` samples do this end to end for you against an **existing** agent -(set `AZURE_VOICE_AGENTS_AGENT_NAME`; create one first with a management sample and -`store=True`): each opens a live session with `client.realtime.connect(...)`, -captures the conversation id from that session, and reads the conversation -back -- no manual id wiring required. Use `sample_live_text_conversation_async.py` -for a headless typed turn, or `sample_live_audio_conversation_async.py` for a -hands-free microphone conversation with barge-in. - -## Running a sample - -```bash -python management/sample_create_and_manage_voice_agent.py -``` - -## Troubleshooting - -| Symptom | Likely cause and fix | -| ------- | -------------------- | -| `KeyError: 'AZURE_VOICE_AGENTS_...'` | A required environment variable is not set. See the table above. | -| `HttpResponseError` 401 / 403 | Not signed in, or your identity lacks access to the project. Run `az login` and confirm project permissions. | -| `ResourceNotFoundError` / 404 on a **management** call (create, list, generate) | The gated preview isn't enabled for your subscription, or isn't served on your project's endpoint/region yet. The request URL and auth are correct; the route just isn't provisioned. Confirm preview enablement and a supported region with your service contact. | -| `HttpResponseError` 404 on a **read** sample | The conversation was not persisted (agent ran with `store = false`) or the id is wrong. | -| `HttpResponseError` 409 on the audio sample | Either the session is still in progress, or the recording lives in your own bring-your-own-storage (BYOS) account -- its bytes aren't streamed through the service and must be downloaded directly from the `blob_uri` returned by the metadata route. Foundry-managed audio streams normally. | -| Model / deployment not found | The `gpt-realtime` default deployment doesn't exist in your project. Set `AZURE_VOICE_AGENTS_MODEL` to a valid realtime deployment name. | - -> [!NOTE] -> The management samples create and delete **real resources** in your project and -> may incur cost. Each sample deletes the agent it creates on the success path -> only; if a sample fails partway through, it may leave the agent behind, so -> check your project and delete any leftover agents manually. diff --git a/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_create_and_manage_voice_agent.py b/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_create_and_manage_voice_agent.py deleted file mode 100644 index 980cb41b8628..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_create_and_manage_voice_agent.py +++ /dev/null @@ -1,115 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------- - -""" -FILE: sample_create_and_manage_voice_agent.py - -DESCRIPTION: - This sample demonstrates the voice-agent management lifecycle over the HTTP - surface: creating a voice agent (with an audio/voice configuration and - conversation storage enabled), retrieving it, listing the agents in the - project, updating it, disabling/enabling it, and deleting it. - -USAGE: - python sample_create_and_manage_voice_agent.py - - Set the environment variable before running the sample: - 1) AZURE_VOICE_AGENTS_ENDPOINT - the Foundry project endpoint, in the form - https://.services.ai.azure.com/api/projects/ - - Optional: - 2) AZURE_VOICE_AGENTS_MODEL - the realtime model deployment to use. - Defaults to "gpt-realtime". - - The sample authenticates with DefaultAzureCredential, so sign in first - (for example, with `az login`). -""" - -import os -from typing import Final - -from azure.identity import DefaultAzureCredential - -from azure.ai.voiceagents import VoiceAgentsClient -from azure.ai.voiceagents.models import ( - AgentDefinitionOptInKeys, - AzureStandardVoice, - VoiceAgentDefinition, - VoiceAudioConfig, - VoiceAudioOutputConfig, - VoiceOutputModality, -) - - -def create_and_manage_voice_agent() -> None: - endpoint = os.environ["AZURE_VOICE_AGENTS_ENDPOINT"] - model = os.environ.get("AZURE_VOICE_AGENTS_MODEL", "gpt-realtime") - agent_name = "sample-voice-agent" - - # Voice agent preview operations require this feature-flag opt-in. - preview: Final = AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW - - definition = VoiceAgentDefinition( - # `managed` uses a service-hosted model; use `self_deployed` with a Foundry - # deployment name to bring your own model. - model_type="managed", - model=model, - instructions="You are a friendly voice assistant. Keep replies short and natural.", - audio=VoiceAudioConfig( - output=VoiceAudioOutputConfig(voice=AzureStandardVoice(name="en-US-AvaNeural")), - ), - output_modalities=[VoiceOutputModality.AUDIO], - # Persist conversations so the transcript and audio can be read back later - # (see sample_read_conversation.py). Defaults to False, which stores nothing. - store=True, - ) - - with VoiceAgentsClient(endpoint=endpoint, credential=DefaultAzureCredential()) as client: - created = client.voice_agents.create_voice_agent( - name=agent_name, - definition=definition, - description="Created by the azure-ai-voiceagents sample.", - foundry_features=preview, - ) - print(f"Created voice agent: {created.name}") - - agent = client.voice_agents.get_voice_agent(agent_name, foundry_features=preview) - print(f"Retrieved voice agent: {agent.name}") - - print("Voice agents in this project:") - for item in client.voice_agents.list_voice_agents(foundry_features=preview): - print(f" - {item.name}") - - # Update the agent. Each update that changes the definition produces a new version. - # Preserve the audio and output-modality configuration from the original - # definition so the new version keeps the same voice behavior. - updated = client.voice_agents.update_voice_agent( - agent_name, - definition=VoiceAgentDefinition( - model_type="managed", - model=model, - instructions="You are a friendly voice assistant. Always greet the caller warmly.", - audio=definition.audio, - output_modalities=definition.output_modalities, - store=definition.store, - ), - description="Updated instructions.", - foundry_features=preview, - ) - print(f"Updated voice agent to version: {updated.versions.latest.version}") - - # Disable the agent so its endpoint rejects new requests, then re-enable it. - client.voice_agents.disable_voice_agent(agent_name, foundry_features=preview) - print("Disabled voice agent") - client.voice_agents.enable_voice_agent(agent_name, foundry_features=preview) - print("Enabled voice agent") - - client.voice_agents.delete_voice_agent(agent_name, foundry_features=preview) - print(f"Deleted voice agent: {agent_name}") - - -if __name__ == "__main__": - create_and_manage_voice_agent() diff --git a/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_create_and_manage_voice_agent_async.py b/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_create_and_manage_voice_agent_async.py deleted file mode 100644 index 1599223f6e2f..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_create_and_manage_voice_agent_async.py +++ /dev/null @@ -1,76 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------- - -""" -FILE: sample_create_and_manage_voice_agent_async.py - -DESCRIPTION: - This sample demonstrates the voice-agent management lifecycle using the async - client: creating a voice agent, retrieving it, listing the agents in the - project, and deleting it. - -USAGE: - python sample_create_and_manage_voice_agent_async.py - - Set the environment variable before running the sample: - 1) AZURE_VOICE_AGENTS_ENDPOINT - the Foundry project endpoint, in the form - https://.services.ai.azure.com/api/projects/ - - Optional: - 2) AZURE_VOICE_AGENTS_MODEL - the realtime model deployment to use. - Defaults to "gpt-realtime". - - The sample authenticates with DefaultAzureCredential, so sign in first - (for example, with `az login`). An async HTTP transport such as aiohttp must - be installed (`pip install aiohttp`). -""" - -import asyncio -import os -from typing import Final - -from azure.identity.aio import DefaultAzureCredential - -from azure.ai.voiceagents.aio import VoiceAgentsClient -from azure.ai.voiceagents.models import AgentDefinitionOptInKeys, VoiceAgentDefinition - - -async def create_and_manage_voice_agent() -> None: - endpoint = os.environ["AZURE_VOICE_AGENTS_ENDPOINT"] - model = os.environ.get("AZURE_VOICE_AGENTS_MODEL", "gpt-realtime") - agent_name = "sample-voice-agent-async" - preview: Final = AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW - - async with DefaultAzureCredential() as credential, VoiceAgentsClient( - endpoint=endpoint, credential=credential - ) as client: - created = await client.voice_agents.create_voice_agent( - name=agent_name, - definition=VoiceAgentDefinition( - model_type="managed", - model=model, - instructions="You are a friendly voice assistant. Keep replies short and natural.", - # Persist conversations so they can be read back later. Defaults to False. - store=True, - ), - description="Created by the azure-ai-voiceagents async sample.", - foundry_features=preview, - ) - print(f"Created voice agent: {created.name}") - - agent = await client.voice_agents.get_voice_agent(agent_name, foundry_features=preview) - print(f"Retrieved voice agent: {agent.name}") - - print("Voice agents in this project:") - async for item in client.voice_agents.list_voice_agents(foundry_features=preview): - print(f" - {item.name}") - - await client.voice_agents.delete_voice_agent(agent_name, foundry_features=preview) - print(f"Deleted voice agent: {agent_name}") - - -if __name__ == "__main__": - asyncio.run(create_and_manage_voice_agent()) diff --git a/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_create_voice_agent_with_tools.py b/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_create_voice_agent_with_tools.py deleted file mode 100644 index 946205a26c42..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_create_voice_agent_with_tools.py +++ /dev/null @@ -1,162 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------- - -""" -FILE: sample_create_voice_agent_with_tools.py - -DESCRIPTION: - This sample demonstrates the richer parts of a voice agent definition that the - basic create sample leaves out: - - * Input (microphone) audio configuration: audio format, server-side turn - detection (VAD), input-audio transcription, and noise reduction. - * Tools the agent may use during a live session: a client-executed `function` - tool, a service-managed `system` control tool, and (shown as constructed - objects) `mcp` and `toolbox` tools. - * Bring-your-own-model (BYOM): set `model_type="self_deployed"` to point the - agent at your own Foundry model deployment instead of a service-managed model. - - The tools and audio settings are session defaults baked into the agent; the live - realtime session that actually invokes them is reached through the - `client.realtime.connect(...)` namespace (see the live sample). - -USAGE: - python sample_create_voice_agent_with_tools.py - - Set these environment variables before running the sample: - 1) AZURE_VOICE_AGENTS_ENDPOINT - the Foundry project endpoint, in the form - https://.services.ai.azure.com/api/projects/ - 2) AZURE_VOICE_AGENTS_MODEL - optional. The realtime model (managed) or the - Foundry deployment name (BYOM). Defaults to "gpt-realtime". - 3) AZURE_VOICE_AGENTS_MODEL_TYPE - optional. "managed" (default) for a - service-hosted model, or "self_deployed" to bring your own deployment. - - The sample authenticates with DefaultAzureCredential, so sign in first - (for example, with `az login`). -""" - -import os -from typing import Any, Final, cast - -from azure.identity import DefaultAzureCredential - -from azure.ai.voiceagents import VoiceAgentsClient -from azure.ai.voiceagents.models import ( - AgentDefinitionOptInKeys, - AzureStandardVoice, - RealtimeFunctionTool, - VoiceAgentDefinition, - VoiceAgentMcpTool, - VoiceAudioConfig, - VoiceAudioFormat, - VoiceAudioInputConfig, - VoiceAudioOutputConfig, - VoiceInputTranscription, - VoiceModelType, - VoiceOutputModality, - VoiceServerVadTurnDetection, - VoiceSystemTool, - VoiceSystemToolName, - ToolType, - VoiceToolboxTool, -) - - -def create_voice_agent_with_tools() -> None: - endpoint = os.environ["AZURE_VOICE_AGENTS_ENDPOINT"] - model = os.environ.get("AZURE_VOICE_AGENTS_MODEL", "gpt-realtime") - # "managed" runs a service-hosted model; "self_deployed" (BYOM) uses your own - # Foundry deployment named by `model`. The service derives whether the model is - # realtime or cascaded; you don't set that here. - model_type = os.environ.get("AZURE_VOICE_AGENTS_MODEL_TYPE", VoiceModelType.MANAGED) - agent_name = "sample-voice-agent-with-tools" - - # Voice agent preview operations require this feature-flag opt-in. - preview: Final = AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW - - # A client-executed tool: the service forwards the function call to your app, - # and your app returns the result over the live session. - get_weather = RealtimeFunctionTool( - type="function", - name="get_weather", - description="Get the current weather for a city.", - parameters=cast(Any, { - "type": "object", - "properties": {"city": {"type": "string", "description": "City name, e.g. Seattle."}}, - "required": ["city"], - }), - ) - - # A service-managed control tool: the platform can end the call on the agent's behalf. - end_call = VoiceSystemTool(name=VoiceSystemToolName.END_CONVERSATION) - - # An MCP tool is executed by the service against a remote MCP server you own. - # It references an external server, so it is constructed here for illustration - # and not attached below. Provide one of server_url, connector_id, or tunnel_id. - _example_mcp_tool = VoiceAgentMcpTool( - type=ToolType.MCP, - server_label="my-mcp-server", - server_url="https://example.com/mcp", - require_approval="never", - ) - - # A toolbox tool references a versioned Foundry toolbox you have created. It is - # constructed here for illustration; attach it only if the toolbox exists. - _example_toolbox_tool = VoiceToolboxTool(toolbox_name="my-toolbox", toolbox_version="1") - - definition = VoiceAgentDefinition( - model_type=model_type, - model=model, - instructions="You are a helpful voice assistant. Use tools when they help answer the caller.", - audio=VoiceAudioConfig( - # Input (microphone) side: 24 kHz PCM, server-side VAD so the agent - # auto-responds when the caller stops speaking, plus input-audio - # transcription so user speech is transcribed. - input=VoiceAudioInputConfig( - format=VoiceAudioFormat(type="audio/pcm", rate=24000), - turn_detection=VoiceServerVadTurnDetection( - threshold=0.5, - prefix_padding_ms=300, - silence_duration_ms=500, - ), - transcription=VoiceInputTranscription(model="whisper-1"), - ), - # Output (agent speech) side: the voice the agent speaks with. Pass an - # AzureStandardVoice for an Azure neural voice, or a plain string such as - # "alloy" for a built-in OpenAI voice (realtime models only): - # output=VoiceAudioOutputConfig(voice="alloy"), - output=VoiceAudioOutputConfig(voice=AzureStandardVoice(name="en-US-AvaNeural")), - ), - output_modalities=[VoiceOutputModality.AUDIO], - # Attach the self-contained tools. `_example_mcp_tool` and `_example_toolbox_tool` - # reference external resources you must own, so they are left out here. - tools=[get_weather, end_call], - store=True, - ) - - with VoiceAgentsClient(endpoint=endpoint, credential=DefaultAzureCredential()) as client: - created = client.voice_agents.create_voice_agent( - name=agent_name, - definition=definition, - description="Voice agent with tools and input-audio config (azure-ai-voiceagents sample).", - foundry_features=preview, - ) - print(f"Created voice agent: {created.name} (model_type={model_type}, model={model})") - - agent = client.voice_agents.get_voice_agent(agent_name, foundry_features=preview) - tools = agent.versions.latest.definition.tools or [] - print(f"Configured {len(tools)} tool(s):") - for tool in tools: - # Tools belong to an open union, so on read they surface as mappings - # keyed by their wire fields (``type`` and, for most kinds, ``name``). - print(f" - {tool['type']}: {tool.get('name', '(unnamed)')}") - - client.voice_agents.delete_voice_agent(agent_name, foundry_features=preview) - print(f"Deleted voice agent: {agent_name}") - - -if __name__ == "__main__": - create_voice_agent_with_tools() diff --git a/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_generate_voice_agent.py b/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_generate_voice_agent.py deleted file mode 100644 index 42639e720bd8..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_generate_voice_agent.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------- - -""" -FILE: sample_generate_voice_agent.py - -DESCRIPTION: - This sample demonstrates guided authoring: generating and creating a voice - agent from a few high-level inputs plus a natural-language goal. The service - expands the goal into a full, editable definition, creates the agent, and - returns it. Every generated field can be refined afterward through the normal - update/version flow. - -USAGE: - python sample_generate_voice_agent.py - - Set the environment variable before running the sample: - 1) AZURE_VOICE_AGENTS_ENDPOINT - the Foundry project endpoint, in the form - https://.services.ai.azure.com/api/projects/ - - Optional: - 2) AZURE_VOICE_AGENTS_MODEL - the realtime model deployment to use. - Defaults to "gpt-realtime". - - The sample authenticates with DefaultAzureCredential, so sign in first - (for example, with `az login`). -""" - -import os -from typing import Final - -from azure.identity import DefaultAzureCredential - -from azure.ai.voiceagents import VoiceAgentsClient -from azure.ai.voiceagents.models import AgentDefinitionOptInKeys, VoiceAgentType, VoiceAgentUseCase - - -def generate_voice_agent() -> None: - endpoint = os.environ["AZURE_VOICE_AGENTS_ENDPOINT"] - model = os.environ.get("AZURE_VOICE_AGENTS_MODEL", "gpt-realtime") - preview: Final = AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW - - with VoiceAgentsClient(endpoint=endpoint, credential=DefaultAzureCredential()) as client: - agent = client.voice_agents.generate_voice_agent( - name="sample-generated-agent", - model_type="managed", - model=model, - agent_type=VoiceAgentType.BUSINESS, - use_case=VoiceAgentUseCase.CUSTOMER_SUPPORT, - goal="Help callers troubleshoot their internet connection and open a support ticket if needed.", - foundry_features=preview, - ) - print(f"Generated voice agent: {agent.name}") - print(f"Instructions:\n{agent.versions.latest.definition.instructions}") - - client.voice_agents.delete_voice_agent(agent.name, foundry_features=preview) - print(f"Deleted voice agent: {agent.name}") - - -if __name__ == "__main__": - generate_voice_agent() diff --git a/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_manage_voice_agent_versions.py b/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_manage_voice_agent_versions.py deleted file mode 100644 index fbbe7b3b8462..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_manage_voice_agent_versions.py +++ /dev/null @@ -1,101 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------- - -""" -FILE: sample_manage_voice_agent_versions.py - -DESCRIPTION: - This sample demonstrates working with voice-agent versions. Voice agents are - immutable: every create or update produces a new version. This sample creates - an agent, adds a new version to it, lists the versions, and reads a single - version back. - -USAGE: - python sample_manage_voice_agent_versions.py - - Set the environment variable before running the sample: - 1) AZURE_VOICE_AGENTS_ENDPOINT - the Foundry project endpoint, in the form - https://.services.ai.azure.com/api/projects/ - - Optional: - 2) AZURE_VOICE_AGENTS_MODEL - the realtime model deployment to use. - Defaults to "gpt-realtime". - - The sample authenticates with DefaultAzureCredential, so sign in first - (for example, with `az login`). -""" - -import os -from typing import Final - -from azure.identity import DefaultAzureCredential - -from azure.ai.voiceagents import VoiceAgentsClient -from azure.ai.voiceagents.models import AgentDefinitionOptInKeys, VoiceAgentDefinition - - -def manage_voice_agent_versions() -> None: - endpoint = os.environ["AZURE_VOICE_AGENTS_ENDPOINT"] - model = os.environ.get("AZURE_VOICE_AGENTS_MODEL", "gpt-realtime") - agent_name = "sample-versioned-voice-agent" - preview: Final = AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW - - def definition(instructions: str) -> VoiceAgentDefinition: - # Each version differs only by its instructions; the rest is identical. - return VoiceAgentDefinition(model_type="managed", model=model, instructions=instructions) - - with VoiceAgentsClient(endpoint=endpoint, credential=DefaultAzureCredential()) as client: - # Create the initial agent (this is version 1). - created = client.voice_agents.create_voice_agent( - name=agent_name, - definition=definition("You are a helpful voice assistant."), - foundry_features=preview, - ) - print(f"Created agent '{created.name}', latest version: {created.versions.latest.version}") - - # Create a new version with updated instructions. - new_version = client.voice_agents.create_voice_agent_version( - agent_name, - definition=definition("You are a helpful voice assistant. Always greet the caller by name."), - description="Added a personalized greeting.", - foundry_features=preview, - ) - print(f"Created new version: {new_version.version}") - - # Create a draft version. Drafts are recorded but excluded from the default - # 'latest' resolution and from version listings unless include_drafts=True. - draft_version = client.voice_agents.create_voice_agent_version( - agent_name, - definition=definition("You are a helpful voice assistant. Experimental draft persona."), - description="Candidate persona under review.", - draft=True, - foundry_features=preview, - ) - print(f"Created draft version: {draft_version.version}") - - # List released versions (drafts excluded by default). - print(f"Released versions of '{agent_name}':") - for version in client.voice_agents.list_voice_agent_versions(agent_name, foundry_features=preview): - print(f" - version {version.version} (created_at={version.created_at})") - - # List including drafts. - print(f"All versions of '{agent_name}' (including drafts):") - for version in client.voice_agents.list_voice_agent_versions( - agent_name, include_drafts=True, foundry_features=preview - ): - print(f" - version {version.version} (draft={version.draft})") - - # Read a single version back. - fetched = client.voice_agents.get_voice_agent_version(agent_name, new_version.version, foundry_features=preview) - print(f"Fetched version {fetched.version}: {fetched.definition.instructions}") - - # Clean up. - client.voice_agents.delete_voice_agent(agent_name, foundry_features=preview) - print(f"Deleted agent: {agent_name}") - - -if __name__ == "__main__": - manage_voice_agent_versions() diff --git a/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_read_conversation.py b/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_read_conversation.py deleted file mode 100644 index e86b3521aae9..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/samples/management/sample_read_conversation.py +++ /dev/null @@ -1,103 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------- - -""" -FILE: sample_read_conversation.py - -DESCRIPTION: - This sample demonstrates reading a persisted voice conversation back over the - read-only conversation API: the conversation envelope, its responses (model - inference turns), and its ordered items (the transcript). Conversations are - created and written by the voice orchestrator during a live session; this - client can only read them, and only when the agent was configured with - `store = true`. - -USAGE: - python sample_read_conversation.py - - Set these environment variables before running the sample: - 1) AZURE_VOICE_AGENTS_ENDPOINT - the Foundry project endpoint, in the form - https://.services.ai.azure.com/api/projects/ - 2) AZURE_VOICE_AGENTS_AGENT_NAME - the name of the voice agent. - 3) AZURE_VOICE_AGENTS_CONVERSATION_ID - the id of a persisted conversation - (captured from the `conversation.created` event during a live session). - - The sample authenticates with DefaultAzureCredential, so sign in first - (for example, with `az login`). -""" - -import os -from typing import Final - -from azure.core.exceptions import HttpResponseError -from azure.identity import DefaultAzureCredential - -from azure.ai.voiceagents import VoiceAgentsClient -from azure.ai.voiceagents.models import AgentDefinitionOptInKeys - - -def read_conversation() -> None: - endpoint = os.environ["AZURE_VOICE_AGENTS_ENDPOINT"] - agent_name = os.environ["AZURE_VOICE_AGENTS_AGENT_NAME"] - conversation_id = os.environ["AZURE_VOICE_AGENTS_CONVERSATION_ID"] - preview: Final = AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW - - with VoiceAgentsClient(endpoint=endpoint, credential=DefaultAzureCredential()) as client: - conversations = client.agent_endpoint_conversations - try: - # The conversation envelope: status, timestamps, aggregate usage. - conversation = conversations.get_agent_conversation(agent_name, conversation_id, foundry_features=preview) - print(f"Conversation {conversation.id}: status={conversation.status}, created_at={conversation.created_at}") - - # The responses (model inference turns) in the conversation. - print("Responses:") - for response in conversations.list_agent_conversation_responses( - agent_name, conversation_id, foundry_features=preview - ): - print(f" - {response.id}: status={response.status}") - - # Read a single response back, with its output and token usage. - detail = conversations.get_agent_conversation_response( - agent_name, conversation_id, response.id, foundry_features=preview - ) - print(f" usage={detail.usage}") - - # The items produced by this specific response. Conversation items - # belong to an open union, so on read they surface as mappings - # keyed by their wire fields (``type``, ``id``, ...). - for response_item in conversations.list_agent_conversation_response_items( - agent_name, conversation_id, response.id, foundry_features=preview - ): - print(f" item {response_item.get('type')} id={response_item.get('id')}") - - # The ordered conversation items -- the full transcript (user + assistant + tool events). - print("Items (transcript):") - for item in conversations.list_agent_conversation_items( - agent_name, conversation_id, foundry_features=preview - ): - item_id = item.get("id") - print(f" - {item.get('type')} id={item_id}") - - # Read a single item back by id. - if item_id: - single = conversations.get_agent_conversation_item( - agent_name, conversation_id, item_id, foundry_features=preview - ) - print(f" fetched item id={single.get('id')}") - - # Deleting a conversation removes it and all of its responses, items, and audio. - # This is destructive, so it is shown but not run by default. Uncomment to enable. - # deleted = conversations.delete_agent_conversation( - # agent_name, conversation_id, foundry_features=preview - # ) - # print(f"Deleted conversation {deleted.id}: deleted={deleted.deleted}") - except HttpResponseError as e: - # 404 typically means the conversation was not persisted (agent ran with `store = false`). - print(f"Service responded with an error: {e.status_code} {e.reason}") - - -if __name__ == "__main__": - read_conversation() diff --git a/sdk/voiceagents/azure-ai-voiceagents/samples/quickstart/sample_quickstart_async.py b/sdk/voiceagents/azure-ai-voiceagents/samples/quickstart/sample_quickstart_async.py deleted file mode 100644 index f9d2e1a02968..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/samples/quickstart/sample_quickstart_async.py +++ /dev/null @@ -1,227 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------- - -""" -FILE: sample_quickstart_async.py - -DESCRIPTION: - Generate a temporary voice agent, start a live microphone/speaker realtime - conversation with it, then delete the agent when the sample exits. - - This is the shortest end-to-end path for trying voice agents with live audio: - management API for agent setup, realtime WebSocket API for the conversation. - - Requires ``pyaudio`` for microphone capture and speaker playback. - - pip install azure-ai-voiceagents azure-identity aiohttp pyaudio - -USAGE: - python sample_quickstart_async.py - - Environment variables: - 1) AZURE_VOICE_AGENTS_ENDPOINT (required) - Foundry project endpoint: - https://.services.ai.azure.com/api/projects/ - 2) AZURE_VOICE_AGENTS_MODEL (optional) - realtime model deployment name. - Defaults to "gpt-realtime". - - Runs until you press Ctrl-C. Authenticates with DefaultAzureCredential, so - sign in first (for example, with `az login`). -""" - -import asyncio -import os -import queue -import uuid -from typing import Any, Final, Optional - -from azure.core.exceptions import HttpResponseError -from azure.identity.aio import DefaultAzureCredential - -from azure.ai.voiceagents.aio import AsyncRealtimeConnection, VoiceAgentsClient -from azure.ai.voiceagents.models import ( - AgentDefinitionOptInKeys, - VoiceAgentType, - VoiceAgentUseCase, - VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted, - VoiceAgentServerEventError, - VoiceAgentServerEventInputAudioBufferSpeechStarted, - VoiceAgentServerEventResponseAudioDelta, - VoiceAgentServerEventResponseAudioTranscriptDone, - VoiceModelType, -) - -PREVIEW: Final = AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW -_SAMPLE_RATE: Final = 24000 -_CHUNK_SAMPLES: Final = 1200 - -try: - import pyaudio # type: ignore[import-not-found] -except ImportError: # pragma: no cover - required audio dependency - pyaudio: Any = None # type: ignore[no-redef] - - -class _AudioProcessor: - def __init__(self, connection: AsyncRealtimeConnection) -> None: - self._conn = connection - self._loop: Optional[asyncio.AbstractEventLoop] = None - self._audio = pyaudio.PyAudio() - self._playback_queue: "queue.Queue[tuple[int, Optional[bytes]]]" = queue.Queue() - self._playback_base = 0 - self._next_seq = 0 - self._input_stream = None - self._output_stream = None - - def start(self) -> None: - self._loop = asyncio.get_running_loop() - - def capture_callback(in_data, _frame_count, _time_info, _status): - assert self._loop is not None - asyncio.run_coroutine_threadsafe(self._conn.input_audio_buffer.append(audio=in_data), self._loop) - return (None, pyaudio.paContinue) - - self._input_stream = self._audio.open( - format=pyaudio.paInt16, - channels=1, - rate=_SAMPLE_RATE, - input=True, - frames_per_buffer=_CHUNK_SAMPLES, - stream_callback=capture_callback, - ) - - remaining = b"" - - def playback_callback(_in_data, frame_count, _time_info, _status): - nonlocal remaining - wanted = frame_count * pyaudio.get_sample_size(pyaudio.paInt16) - out = remaining[:wanted] - remaining = remaining[wanted:] - - while len(out) < wanted: - try: - seq, data = self._playback_queue.get_nowait() - except queue.Empty: - out += bytes(wanted - len(out)) - continue - if data is None: - break - if seq < self._playback_base: - remaining = b"" - continue - take = wanted - len(out) - out += data[:take] - remaining = data[take:] - - return (out, pyaudio.paContinue) - - self._output_stream = self._audio.open( - format=pyaudio.paInt16, - channels=1, - rate=_SAMPLE_RATE, - output=True, - frames_per_buffer=_CHUNK_SAMPLES, - stream_callback=playback_callback, - ) - - def queue_audio(self, pcm: bytes) -> None: - self._playback_queue.put((self._next_seq_num(), pcm)) - - def skip_pending_audio(self) -> None: - self._playback_base = self._next_seq_num() - - def close(self) -> None: - if self._input_stream is not None: - self._input_stream.stop_stream() - self._input_stream.close() - if self._output_stream is not None: - self.skip_pending_audio() - self._playback_queue.put((self._next_seq_num(), None)) - self._output_stream.stop_stream() - self._output_stream.close() - self._audio.terminate() - - def _next_seq_num(self) -> int: - seq = self._next_seq - self._next_seq += 1 - return seq - - -async def _generate_agent(client: VoiceAgentsClient, model: str) -> str: - agent_name = f"sample-quickstart-agent-{uuid.uuid4().hex[:8]}" - agent = await client.voice_agents.generate_voice_agent( - name=agent_name, - model_type=VoiceModelType.MANAGED, - model=model, - agent_type=VoiceAgentType.BUSINESS, - use_case=VoiceAgentUseCase.CUSTOMER_SUPPORT, - goal="Answer questions in a friendly voice. Keep replies short and natural.", - description="Temporary agent generated by the azure-ai-voiceagents quickstart.", - foundry_features=PREVIEW, - ) - print(f"Generated temporary voice agent: {agent.name}") - return agent.name - - -async def _delete_agent(client: VoiceAgentsClient, agent_name: str) -> None: - try: - await client.voice_agents.delete_voice_agent(agent_name, foundry_features=PREVIEW) - except HttpResponseError as exc: - # Service currently returns either 200 or 204 on successful delete. - if exc.response is None or exc.response.status_code not in (200, 204): - raise - print(f"Deleted temporary voice agent: {agent_name}") - - -async def _run_audio_session(client: VoiceAgentsClient, agent_name: str) -> None: - async with client.realtime.connect(agent_name=agent_name) as conn: - audio = _AudioProcessor(conn) - audio.start() - print("Speak now. Talk over the agent to interrupt it. Press Ctrl-C to stop.") - - try: - async for event in conn: - if isinstance(event, VoiceAgentServerEventInputAudioBufferSpeechStarted): - # Cancel the in-flight response before dropping audio that is - # still queued in the local speaker buffer. The service only - # supports output_audio_buffer.clear in avatar mode. - await conn.response.cancel() - audio.skip_pending_audio() - print("(listening...)") - elif isinstance(event, VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted): - print(f"You: {event.transcript.strip()}") - elif isinstance(event, VoiceAgentServerEventResponseAudioDelta): - audio.queue_audio(event.delta) - elif isinstance(event, VoiceAgentServerEventResponseAudioTranscriptDone): - print(f"Agent: {event.transcript}") - elif isinstance(event, VoiceAgentServerEventError): - print(f"Session error: {event.error.message}") - finally: - audio.close() - - -async def main() -> None: - if pyaudio is None: - print("This quickstart needs pyaudio for microphone and speaker audio: pip install pyaudio") - return - - endpoint = os.environ["AZURE_VOICE_AGENTS_ENDPOINT"] - model = os.environ.get("AZURE_VOICE_AGENTS_MODEL", "gpt-realtime") - agent_name: Optional[str] = None - - async with DefaultAzureCredential() as credential, VoiceAgentsClient( - endpoint=endpoint, credential=credential - ) as client: - try: - agent_name = await _generate_agent(client, model) - await _run_audio_session(client, agent_name) - except (KeyboardInterrupt, asyncio.CancelledError): - print("\nStopping quickstart...") - finally: - if agent_name is not None: - await _delete_agent(client, agent_name) - - -if __name__ == "__main__": - asyncio.run(main()) diff --git a/sdk/voiceagents/azure-ai-voiceagents/test-resources.json b/sdk/voiceagents/azure-ai-voiceagents/test-resources.json deleted file mode 100644 index e3ca8f7e7422..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/test-resources.json +++ /dev/null @@ -1,566 +0,0 @@ -{ - "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "baseName": { - "type": "string", - "defaultValue": "[resourceGroup().name]", - "metadata": { - "description": "The base resource name for AI Services." - } - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]", - "metadata": { - "description": "The location of the resource. By default, this is the same as the resource group." - } - }, - "tenantId": { - "type": "string", - "defaultValue": "72f988bf-86f1-41af-91ab-2d7cd011db47", - "metadata": { - "description": "The tenant ID to which the application and resources belong." - } - }, - "testApplicationOid": { - "type": "string", - "defaultValue": "b3653439-8136-4cd5-aac3-2a9460871ca6", - "metadata": { - "description": "The client OID to grant access to test resources." - } - }, - "tagValues": { - "type": "object", - "defaultValue": {} - }, - "allowProjectManagement": { - "type": "bool", - "defaultValue": true - }, - "virtualNetworkType": { - "type": "string", - "defaultValue": "None" - }, - "vnet": { - "type": "object", - "defaultValue": {} - }, - "ipRules": { - "type": "array", - "defaultValue": [] - }, - "privateEndpoints": { - "type": "array", - "defaultValue": [] - }, - "privateDnsZone": { - "type": "string", - "defaultValue": "privatelink.aiservices.azure.com" - }, - "resourceGroupName": { - "type": "string", - "defaultValue": "[resourceGroup().name]" - }, - "resourceGroupId": { - "type": "string", - "defaultValue": "[resourceGroup().id]" - }, - "uniqueId": { - "type": "string", - "defaultValue": "[newGuid()]" - }, - "defaultProjectName": { - "type": "string", - "defaultValue": "[concat(toLower(parameters('baseName')), '-ai-defaultproject')]" - }, - "identity": { - "type": "object", - "defaultValue": { - "type": "SystemAssigned" - } - }, - "userAssignedIdentityName": { - "type": "string", - "defaultValue": "" - }, - "userIdentityResourceGroupName": { - "type": "string", - "defaultValue": "" - }, - "identityType": { - "type": "string", - "defaultValue": "SystemAssigned" - }, - "encryption_status": { - "type": "string", - "defaultValue": " " - }, - "cmk_keyvault": { - "type": "string", - "defaultValue": "" - }, - "resource_cmk_uri": { - "type": "string", - "defaultValue": "" - }, - "userAssignedIdentityId": { - "type": "string", - "defaultValue": "" - }, - "keyVaultName": { - "type": "string", - "defaultValue": "" - }, - "keyVaultLocation": { - "type": "string", - "defaultValue": "" - }, - "keyVaultResourceGroupName": { - "type": "string", - "defaultValue": "" - }, - "keyVersion": { - "type": "string", - "defaultValue": "" - }, - "keyName": { - "type": "string", - "defaultValue": "" - }, - "hasRoleAssignment": { - "type": "bool", - "defaultValue": false - }, - "roleDefinitionId": { - "type": "string", - "defaultValue": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '53ca6127-db72-4b80-b1b0-d745d6d5456d')]" - }, - "enableRbac": { - "type": "bool", - "defaultValue": false - }, - "cryptoUserRoleAssignmentName": { - "type": "string", - "defaultValue": "[guid(concat(parameters('cmk_keyvault'), 'KeyVaultCryptoUser'))]" - } - }, - "variables": { - "aiServicesName": "[concat(parameters('baseName'), '-ai')]" - }, - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2017-05-10", - "name": "deployVnet", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": {}, - "variables": {}, - "resources": [ - { - "type": "Microsoft.Network/virtualNetworks", - "apiVersion": "2020-04-01", - "name": "[if(equals(parameters('virtualNetworkType'), 'External'), parameters('vnet').name, variables('defaultVNetName'))]", - "location": "[parameters('location')]", - "properties": { - "addressSpace": { - "addressPrefixes": "[if(equals(parameters('virtualNetworkType'), 'External'), parameters('vnet').addressPrefixes, json(concat('[{\"', variables('defaultAddressPrefix'),'\"}]')))]" - }, - "subnets": [ - { - "name": "[if(equals(parameters('virtualNetworkType'), 'External'), parameters('vnet').subnets.subnet.name, variables('defaultSubnetName'))]", - "properties": { - "serviceEndpoints": [ - { - "service": "Microsoft.CognitiveServices", - "locations": [ - "[parameters('location')]" - ] - } - ], - "addressPrefix": "[if(equals(parameters('virtualNetworkType'), 'External'), parameters('vnet').subnets.subnet.addressPrefix, variables('defaultAddressPrefix'))]" - } - } - ] - } - } - ] - }, - "parameters": {} - }, - "condition": "[and(and(not(empty(parameters('vnet'))), equals(parameters('vnet').newOrExisting, 'new')), equals(parameters('virtualNetworkType'), 'External'))]" - }, - { - "apiVersion": "2025-04-01-preview", - "name": "[variables('aiServicesName')]", - "location": "[parameters('location')]", - "type": "Microsoft.CognitiveServices/accounts", - "kind": "AIServices", - "sku": { - "name": "S0" - }, - "identity": "[parameters('identity')]", - "tags": "[if(contains(parameters('tagValues'), 'Microsoft.CognitiveServices/accounts'), parameters('tagValues')['Microsoft.CognitiveServices/accounts'], json('{}'))]", - "properties": { - "customSubDomainName": "[toLower(variables('aiServicesName'))]", - "defaultProjectName": "[toLower(variables('aiServicesName'))]", - "publicNetworkAccess": "[if(equals(parameters('virtualNetworkType'), 'Internal'), 'Disabled', 'Enabled')]", - "networkAcls": { - "defaultAction": "[if(equals(parameters('virtualNetworkType'), 'External'), 'Deny', 'Allow')]", - "virtualNetworkRules": "[if(equals(parameters('virtualNetworkType'), 'External'), json(concat('[{\"id\": \"', concat(subscription().id, '/resourceGroups/', parameters('vnet').resourceGroup, '/providers/Microsoft.Network/virtualNetworks/', parameters('vnet').name, '/subnets/', parameters('vnet').subnets.subnet.name), '\"}]')), json('[]'))]", - "ipRules": "[if(or(empty(parameters('ipRules')), empty(parameters('ipRules')[0].value)), json('[]'), parameters('ipRules'))]" - }, - "identity": "[parameters('identity')]", - "userAssignedIdentityName": "[if(equals(parameters('identity').type, 'UserAssigned'), parameters('userAssignedIdentityName'), json('null'))]", - "userIdentityResourceGroupName": "[if(equals(parameters('identity').type, 'UserAssigned'), parameters('userIdentityResourceGroupName'), json('null'))]", - "encryption_status": "[parameters('encryption_status')]", - "keyVaultName": "[parameters('keyVaultName')]", - "keyVaultLocation": "[parameters('keyVaultLocation')]", - "keyVaultResourceGroupName": "[parameters('keyVaultResourceGroupName')]", - "cmk_keyvault": "[parameters('cmk_keyvault')]", - "resource_cmk_uri": "[parameters('resource_cmk_uri')]", - "keyVersion": "[parameters('keyVersion')]", - "allowProjectManagement": "[parameters('allowProjectManagement')]" - }, - "resources": [ - { - "type": "projects", - "apiVersion": "2025-04-01-preview", - "name": "[parameters('defaultProjectName')]", - "location": "[parameters('location')]", - "identity": { - "type": "SystemAssigned" - }, - "sku": { - "name": "S0" - }, - "properties": { - "displayName": "[parameters('defaultProjectName')]", - "description": "Default project created with the resource" - }, - "dependsOn": [ - "[resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName'))]" - ] - } - ], - "dependsOn": [ - "[concat('Microsoft.Resources/deployments/', 'deployVnet')]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "name": "[concat('patchAccessPolicy-', parameters('keyVaultName'))]", - "apiVersion": "2021-04-01", - "condition": "[and(equals(parameters('enableRbac'), bool('false')), equals(parameters('encryption_status'), 'Enabled'))]", - "resourceGroup": "[parameters('keyVaultResourceGroupName')]", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - { - "type": "Microsoft.KeyVault/vaults/accessPolicies", - "apiVersion": "2019-09-01", - "name": "[concat(parameters('keyVaultName'), '/add')]", - "properties": { - "accessPolicies": [ - { - "tenantId": "[subscription().tenantId]", - "objectId": "[reference(resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName')), '2025-04-01-preview', 'Full').identity.principalId]", - "permissions": { - "keys": [ - "get", - "wrapKey", - "unwrapKey" - ] - } - } - ] - } - } - ] - } - }, - "dependsOn": [ - "[resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName'))]" - ] - }, - { - "type": "Microsoft.Authorization/roleAssignments", - "apiVersion": "2022-04-01", - "name": "[guid(concat(parameters('cmk_keyvault'), '-', variables('aiServicesName'), 'KeyVaultCryptoUser'))]", - "scope": "[parameters('cmk_keyvault')]", - "condition": "[and(equals(parameters('hasRoleAssignment'), bool('true')), equals(parameters('enableRbac'), bool('true')))]", - "properties": { - "roleDefinitionId": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '14b46e9e-c2b7-41b4-b07b-48a6ebf60603')]", - "principalId": "[reference(resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName')), '2025-04-01-preview', 'Full').identity.principalId]" - }, - "dependsOn": [ - "[resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName'))]" - ] - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2021-04-01", - "name": "patchCMKEncryption", - "condition": "[and(equals(parameters('enableRbac'), bool('false')), equals(parameters('encryption_status'), 'Enabled'))]", - "dependsOn": [ - "[concat('patchAccessPolicy-', parameters('keyVaultName'))]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - { - "type": "Microsoft.CognitiveServices/accounts", - "apiVersion": "2025-04-01-preview", - "name": "[variables('aiServicesName')]", - "location": "[parameters('location')]", - "kind": "AIServices", - "sku": { - "name": "S0" - }, - "properties": { - "customSubDomainName": "[toLower(variables('aiServicesName'))]", - "publicNetworkAccess": "[if(equals(parameters('virtualNetworkType'), 'Internal'), 'Disabled', 'Enabled')]", - "networkAcls": { - "defaultAction": "[if(equals(parameters('virtualNetworkType'), 'External'), 'Deny', 'Allow')]", - "virtualNetworkRules": [], - "ipRules": [] - }, - "encryption": { - "status": "[parameters('encryption_status')]", - "keySource": "Microsoft.Keyvault", - "keyVaultProperties": { - "keyName": "[parameters('keyName')]", - "keyVersion": "[parameters('keyVersion')]", - "keyVaultUri": "[reference(parameters('cmk_keyvault'), '2021-04-01-preview').vaultUri]", - "identityClientId": "[json('null')]" - } - } - } - } - ] - } - } - }, - { - "type": "Microsoft.Resources/deployments", - "apiVersion": "2021-04-01", - "name": "patchCMKEncryptionWithRbac", - "condition": "[and(equals(parameters('enableRbac'), bool('true')), equals(parameters('encryption_status'), 'Enabled'))]", - "dependsOn": [ - "[resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName'))]", - "[concat('Microsoft.KeyVault/vaults/', parameters('keyVaultName'), '/providers/Microsoft.Authorization/roleAssignments/', guid(concat(parameters('cmk_keyvault'), '-', variables('aiServicesName'), 'KeyVaultCryptoUser')))]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - { - "type": "Microsoft.CognitiveServices/accounts", - "apiVersion": "2025-04-01-preview", - "name": "[variables('aiServicesName')]", - "location": "[parameters('location')]", - "kind": "AIServices", - "sku": { - "name": "S0" - }, - "properties": { - "customSubDomainName": "[toLower(variables('aiServicesName'))]", - "publicNetworkAccess": "[if(equals(parameters('virtualNetworkType'), 'Internal'), 'Disabled', 'Enabled')]", - "networkAcls": { - "defaultAction": "[if(equals(parameters('virtualNetworkType'), 'External'), 'Deny', 'Allow')]", - "virtualNetworkRules": [], - "ipRules": [] - }, - "identity": { - "type": "SystemAssigned" - }, - "encryption": { - "status": "[parameters('encryption_status')]", - "keySource": "Microsoft.Keyvault", - "keyVaultProperties": { - "keyName": "[parameters('keyName')]", - "keyVersion": "[parameters('keyVersion')]", - "keyVaultUri": "[reference(parameters('cmk_keyvault'), '2021-04-01-preview').vaultUri]", - "identityClientId": "[json('null')]" - } - } - } - } - ] - } - } - }, - { - "apiVersion": "2018-05-01", - "name": "[concat('deployPrivateEndpoint-', parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.name)]", - "type": "Microsoft.Resources/deployments", - "resourceGroup": "[parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.resourceGroup.value.name]", - "subscriptionId": "[parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.subscription.subscriptionId]", - "dependsOn": [ - "[concat('Microsoft.CognitiveServices/accounts/', variables('aiServicesName'))]" - ], - "condition": "[equals(parameters('virtualNetworkType'), 'Internal')]", - "copy": { - "name": "privateendpointscopy", - "count": "[length(parameters('privateEndpoints'))]" - }, - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - { - "location": "[parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.location]", - "name": "[parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.name]", - "type": "Microsoft.Network/privateEndpoints", - "apiVersion": "2021-05-01", - "properties": { - "subnet": { - "id": "[parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.properties.subnet.id]" - }, - "privateLinkServiceConnections": [ - { - "name": "[parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.name]", - "properties": { - "privateLinkServiceId": "[concat(parameters('resourceGroupId'), '/providers/Microsoft.CognitiveServices/accounts/', variables('aiServicesName'))]", - "groupIds": "[parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.properties.privateLinkServiceConnections[0].properties.groupIds]" - } - } - ], - "customNetworkInterfaceName": "[concat(parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.name, '-nic')]" - }, - "tags": {} - } - ] - } - } - }, - { - "apiVersion": "2018-05-01", - "name": "[concat('deployDnsZoneGroup-', parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.name)]", - "type": "Microsoft.Resources/deployments", - "resourceGroup": "[parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.resourceGroup.value.name]", - "subscriptionId": "[parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.subscription.subscriptionId]", - "dependsOn": [ - "[concat('deployPrivateEndpoint-', parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.name)]" - ], - "condition": "[and(equals(parameters('virtualNetworkType'), 'Internal'), parameters('privateEndpoints')[copyIndex()].privateDnsZoneConfiguration.integrateWithPrivateDnsZone)]", - "copy": { - "name": "privateendpointdnscopy", - "count": "[length(parameters('privateEndpoints'))]" - }, - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - { - "type": "Microsoft.Network/privateDnsZones", - "apiVersion": "2018-09-01", - "name": "[parameters('privateDnsZone')]", - "location": "global", - "tags": {}, - "properties": {} - }, - { - "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks", - "apiVersion": "2018-09-01", - "name": "[concat(parameters('privateDnsZone'), '/', replace(uniqueString(parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.properties.subnet.id), '/subnets/default', ''))]", - "location": "global", - "dependsOn": [ - "[parameters('privateDnsZone')]" - ], - "properties": { - "virtualNetwork": { - "id": "[split(parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.properties.subnet.id, '/subnets/')[0]]" - }, - "registrationEnabled": false - } - }, - { - "apiVersion": "2017-05-10", - "name": "[concat('EndpointDnsRecords-', parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.name)]", - "type": "Microsoft.Resources/deployments", - "dependsOn": [ - "[parameters('privateDnsZone')]" - ], - "properties": { - "mode": "Incremental", - "templatelink": { - "uri": "https://go.microsoft.com/fwlink/?linkid=2264916" - }, - "parameters": { - "privateDnsName": { - "value": "[parameters('privateDnsZone')]" - }, - "privateEndpointNicResourceId": { - "value": "[concat('/subscriptions/', parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.subscription.subscriptionId, '/resourceGroups/', parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.resourceGroup.value.name, '/providers/Microsoft.Network/networkInterfaces/', parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.name, '-nic')]" - }, - "nicRecordsTemplateUri": { - "value": "https://go.microsoft.com/fwlink/?linkid=2264719" - }, - "ipConfigRecordsTemplateUri": { - "value": "https://go.microsoft.com/fwlink/?linkid=2265018" - }, - "uniqueId": { - "value": "[parameters('uniqueId')]" - }, - "existingRecords": { - "value": {} - } - } - } - }, - { - "type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups", - "apiVersion": "2020-03-01", - "name": "[concat(parameters('privateEndpoints')[copyIndex()].privateEndpointConfiguration.privateEndpoint.name, '/', 'default')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[parameters('privateDnsZone')]" - ], - "properties": { - "privateDnsZoneConfigs": [ - { - "name": "privatelink-cognitiveservices", - "properties": { - "privateDnsZoneId": "[concat(parameters('resourceGroupId'), '/providers/Microsoft.Network/privateDnsZones/', parameters('privateDnsZone'))]" - } - } - ] - } - } - ] - } - } - } - ], - "outputs": { - "AI_SERVICES_NAME": { - "type": "string", - "value": "[variables('aiServicesName')]" - }, - "AI_SERVICES_ENDPOINT": { - "type": "string", - "value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName'))).endpoints['AI Foundry API']]" - }, - "AI_SERVICES_KEY": { - "type": "string", - "value": "[listKeys(resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName')), '2025-04-01-preview').key1]" - } - } -} \ No newline at end of file diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/conftest.py b/sdk/voiceagents/azure-ai-voiceagents/tests/conftest.py deleted file mode 100644 index 371671c2e8cd..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/tests/conftest.py +++ /dev/null @@ -1,15 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -import pytest -from devtools_testutils import test_proxy # noqa: F401 pylint: disable=unused-import - - -@pytest.fixture(scope="session", autouse=True) -def start_proxy(test_proxy): # pylint: disable=redefined-outer-name - """Starts the test proxy server for the whole test session. - - See https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/tests.md - """ - return diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/live/conftest.py b/sdk/voiceagents/azure-ai-voiceagents/tests/live/conftest.py deleted file mode 100644 index ae8f36c9b21b..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/tests/live/conftest.py +++ /dev/null @@ -1,17 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Overrides the parent (recorded-test) conftest for the live test suite. - -The live smoke test never goes through the test proxy (see test_smoke_live.py), -so it doesn't need the autouse ``start_proxy`` fixture from ../conftest.py. -This shadows that fixture so running ``pytest tests/live`` alone never tries -to download/start the proxy. -""" -import pytest - - -@pytest.fixture(scope="session", autouse=True) -def start_proxy(): - return diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/live/test_voice_agents_management.py b/sdk/voiceagents/azure-ai-voiceagents/tests/live/test_voice_agents_management.py deleted file mode 100644 index 13d5e21e84ee..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/tests/live/test_voice_agents_management.py +++ /dev/null @@ -1,101 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Live management tests for voice agents. - -These tests exercise operations whose current service status codes match the -TypeSpec-generated client. Agent deletion is cleanup only because the service -currently returns 200 while the generated client expects 204. -""" -import os -import uuid - -import pytest -from azure.core.exceptions import HttpResponseError -from azure.identity import DefaultAzureCredential - -from azure.ai.voiceagents import VoiceAgentsClient -from azure.ai.voiceagents.models import ( - AgentDefinitionOptInKeys, - AzureStandardVoice, - VoiceAgentDefinition, - VoiceAgentType, - VoiceAgentUseCase, - VoiceAudioConfig, - VoiceAudioOutputConfig, - VoiceModelType, - VoiceOutputModality, -) - -PREVIEW = AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW - -pytestmark = [ - pytest.mark.live_test_only, - pytest.mark.skipif( - os.environ.get("AZURE_TEST_RUN_LIVE", "false").lower() != "true", - reason="Live tests only run when AZURE_TEST_RUN_LIVE=true.", - ), -] - - -def _endpoint() -> str: - return os.environ.get("AZURE_VOICE_AGENTS_ENDPOINT") or os.environ["AI_SERVICES_ENDPOINT"] - - -def _definition(model: str, instructions: str) -> VoiceAgentDefinition: - return VoiceAgentDefinition( - model_type=VoiceModelType.MANAGED, - model=model, - instructions=instructions, - audio=VoiceAudioConfig(output=VoiceAudioOutputConfig(voice=AzureStandardVoice(name="en-US-AvaNeural"))), - output_modalities=[VoiceOutputModality.AUDIO], - store=False, - ) - - -def _delete_agent_for_cleanup(client: VoiceAgentsClient, agent_name: str) -> None: - try: - client.voice_agents.delete_voice_agent(agent_name, foundry_features=PREVIEW) - except HttpResponseError as exc: - if exc.response is None or exc.response.status_code not in (200, 404): - raise - - -def test_generate_get_list_update_enable_disable_voice_agent(): - """Exercise supported voice agent management operations against a live project.""" - model = os.environ.get("AZURE_VOICE_AGENTS_MODEL", "gpt-realtime") - agent_name = f"test-voice-management-{uuid.uuid4().hex[:8]}" - - with DefaultAzureCredential() as credential, VoiceAgentsClient(endpoint=_endpoint(), credential=credential) as client: - try: - generated = client.voice_agents.generate_voice_agent( - name=agent_name, - model_type=VoiceModelType.MANAGED, - model=model, - agent_type=VoiceAgentType.BUSINESS, - use_case=VoiceAgentUseCase.CUSTOMER_SUPPORT, - goal="Answer questions in a friendly voice. Keep replies short and natural.", - foundry_features=PREVIEW, - ) - assert generated["name"] == agent_name - - fetched = client.voice_agents.get_voice_agent(agent_name, foundry_features=PREVIEW) - assert fetched["state"] == "enabled" - assert any(item["name"] == agent_name for item in client.voice_agents.list_voice_agents(foundry_features=PREVIEW)) - - updated = client.voice_agents.update_voice_agent( - agent_name, - definition=_definition(model, "Greet callers warmly and keep replies concise."), - description="Updated by a live management test.", - foundry_features=PREVIEW, - ) - assert updated["name"] == agent_name - - client.voice_agents.disable_voice_agent(agent_name, foundry_features=PREVIEW) - assert client.voice_agents.get_voice_agent(agent_name, foundry_features=PREVIEW)["state"] == "disabled" - - client.voice_agents.enable_voice_agent(agent_name, foundry_features=PREVIEW) - assert client.voice_agents.get_voice_agent(agent_name, foundry_features=PREVIEW)["state"] == "enabled" - finally: - _delete_agent_for_cleanup(client, agent_name) \ No newline at end of file diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/live/test_voice_agents_realtime.py b/sdk/voiceagents/azure-ai-voiceagents/tests/live/test_voice_agents_realtime.py deleted file mode 100644 index aaf301cb2fc1..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/tests/live/test_voice_agents_realtime.py +++ /dev/null @@ -1,83 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Live realtime WebSocket tests for voice agents.""" -import asyncio -import os -import uuid - -import pytest -from azure.core.exceptions import HttpResponseError -from azure.identity.aio import DefaultAzureCredential - -from azure.ai.voiceagents.aio import VoiceAgentsClient -from azure.ai.voiceagents.models import ( - AgentDefinitionOptInKeys, - RealtimeConversationItemMessageUser, - RealtimeConversationItemMessageUserContent, - VoiceAgentServerEventError, - VoiceAgentServerEventResponseDone, - VoiceAgentType, - VoiceAgentUseCase, - VoiceModelType, -) - -PREVIEW = AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW - -pytestmark = [ - pytest.mark.live_test_only, - pytest.mark.skipif( - os.environ.get("AZURE_TEST_RUN_LIVE", "false").lower() != "true", - reason="Live tests only run when AZURE_TEST_RUN_LIVE=true.", - ), -] - - -async def _delete_agent_for_cleanup(client: VoiceAgentsClient, agent_name: str) -> None: - try: - await client.voice_agents.delete_voice_agent(agent_name, foundry_features=PREVIEW) - except HttpResponseError as exc: - if exc.response is None or exc.response.status_code not in (200, 404): - raise - - -@pytest.mark.asyncio -async def test_realtime_typed_turn(): - """Generate an agent, stream one typed turn, and receive a completed response.""" - endpoint = os.environ.get("AZURE_VOICE_AGENTS_ENDPOINT") or os.environ["AI_SERVICES_ENDPOINT"] - model = os.environ.get("AZURE_VOICE_AGENTS_MODEL", "gpt-realtime") - agent_name = f"test-voice-stream-{uuid.uuid4().hex[:8]}" - - async with DefaultAzureCredential() as credential, VoiceAgentsClient(endpoint=endpoint, credential=credential) as client: - try: - await client.voice_agents.generate_voice_agent( - name=agent_name, - model_type=VoiceModelType.MANAGED, - model=model, - agent_type=VoiceAgentType.BUSINESS, - use_case=VoiceAgentUseCase.CUSTOMER_SUPPORT, - goal="Reply with a short, friendly greeting.", - foundry_features=PREVIEW, - ) - - async with client.realtime.connect(agent_name=agent_name) as connection: - await connection.conversation.item.create( - item=RealtimeConversationItemMessageUser( - content=[RealtimeConversationItemMessageUserContent(type="input_text", text="Hello")] - ) - ) - await connection.response.create() - - async def wait_for_response_done(): - async for event in connection: - if isinstance(event, VoiceAgentServerEventError): - raise AssertionError(f"Realtime service error: {event.error.message}") - if isinstance(event, VoiceAgentServerEventResponseDone): - return event - raise AssertionError("Realtime connection closed before the response completed.") - - response = await asyncio.wait_for(wait_for_response_done(), timeout=45) - assert response.response["status"] == "completed" - finally: - await _delete_agent_for_cleanup(client, agent_name) \ No newline at end of file diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/recording/_preparer.py b/sdk/voiceagents/azure-ai-voiceagents/tests/recording/_preparer.py deleted file mode 100644 index 5a189f30208b..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/tests/recording/_preparer.py +++ /dev/null @@ -1,26 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Shared fixtures for the recorded and live test suites in this package.""" -import functools - -from devtools_testutils import EnvironmentVariableLoader - -from azure.ai.voiceagents.models import AgentDefinitionOptInKeys - -# All voice agent operations currently require this preview feature opt-in. -PREVIEW = AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW - -# Loads the real environment variables in live mode, and sanitizes them to the -# values below when recording (so secrets/identifiers never end up in the -# checked-in cassette) and in playback (so recorded interactions can be -# matched). Kwarg names are uppercased to get the real environment variable -# name, e.g. azure_voice_agents_endpoint -> AZURE_VOICE_AGENTS_ENDPOINT. -VoiceAgentsPreparer = functools.partial( - EnvironmentVariableLoader, - "", - azure_voice_agents_endpoint="https://sanitized-account.services.ai.azure.com/api/projects/sanitized-project", - azure_voice_agents_agent_name="sanitized-agent-name", - azure_voice_agents_conversation_id="sanitized-conversation-id", -) diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/recording/conftest.py b/sdk/voiceagents/azure-ai-voiceagents/tests/recording/conftest.py deleted file mode 100644 index 0aac7adf0b65..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/tests/recording/conftest.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Extra sanitization for this package's recordings. - -The test-proxy's default sanitizers redact the account-name portion of the -recorded request URI's host (e.g. "voice-live-tip-resource" -> "Sanitized"), -but they don't know about the Foundry project name embedded later in the -path ("/api/projects/{project-name}"). Without an explicit sanitizer for it, -the real project name would leak into the checked-in recording. This -sanitizer redacts that path segment regardless of what happens to the host. -""" -import pytest -from devtools_testutils import add_uri_regex_sanitizer, test_proxy # noqa: F401 pylint: disable=unused-import - - -@pytest.fixture(scope="session", autouse=True) -def add_project_name_sanitizer(test_proxy): # pylint: disable=redefined-outer-name - add_uri_regex_sanitizer(regex=r"/api/projects/[^/?]+", value="/api/projects/sanitized-project") diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client.py b/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client.py deleted file mode 100644 index 5d5ca69930e4..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client.py +++ /dev/null @@ -1,115 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Recorded functional tests for the sync VoiceAgentsClient. - -These exercise only read-only (GET/LIST) operations against a pre-existing -voice agent and a pre-existing, persisted conversation -- both supplied via -environment variables (see ../../samples/README.md). Agent/conversation creation -and deletion are intentionally out of scope: at the time this suite was -written, the create (expects 201) and delete (expects 204) operations did not -match what the live test service actually returns (200), so recording those -calls would bake an unrelated, known service issue into the checked-in -cassette. See /memories/repo notes for details. -""" -from devtools_testutils import AzureRecordedTestCase, recorded_by_proxy - -from azure.ai.voiceagents import VoiceAgentsClient - -from _preparer import PREVIEW, VoiceAgentsPreparer - - -class TestVoiceAgentsClient(AzureRecordedTestCase): - def create_client(self, endpoint: str) -> VoiceAgentsClient: - credential = self.get_credential(VoiceAgentsClient) - return self.create_client_from_credential(VoiceAgentsClient, credential=credential, endpoint=endpoint) - - @VoiceAgentsPreparer() - @recorded_by_proxy - def test_get_voice_agent(self, azure_voice_agents_endpoint, azure_voice_agents_agent_name): - with self.create_client(azure_voice_agents_endpoint) as client: - agent = client.voice_agents.get_voice_agent( - azure_voice_agents_agent_name, - foundry_features=PREVIEW, - ) - - # NOTE: don't assert agent["name"]/["id"] against azure_voice_agents_agent_name -- - # the test-proxy's built-in default sanitizers always redact "id"/"name" body - # fields to a generic value in playback, regardless of our own sanitizers. - assert agent["object"] == "agent" - assert agent["state"] in ("enabled", "disabled") - - # NOTE: list_voice_agents is intentionally not recorded here. Against a shared - # test resource, it returns every agent's full definition (including real - # subscription IDs, resource groups, connection IDs, and other agents' - # instructions), which can't be generically sanitized. See the live smoke - # test / manual testing for that operation instead. - - @VoiceAgentsPreparer() - @recorded_by_proxy - def test_get_agent_conversation( - self, azure_voice_agents_endpoint, azure_voice_agents_agent_name, azure_voice_agents_conversation_id - ): - with self.create_client(azure_voice_agents_endpoint) as client: - conversation = client.agent_endpoint_conversations.get_agent_conversation( - azure_voice_agents_agent_name, - azure_voice_agents_conversation_id, - foundry_features=PREVIEW, - headers={"Accept-Encoding": "identity"}, - ) - - # See the note in test_get_voice_agent about not asserting on "id"/"name". - assert conversation["object"] == "voice.conversation" - assert conversation["status"] is not None - - @VoiceAgentsPreparer() - @recorded_by_proxy - def test_list_agent_conversation_items( - self, azure_voice_agents_endpoint, azure_voice_agents_agent_name, azure_voice_agents_conversation_id - ): - with self.create_client(azure_voice_agents_endpoint) as client: - items = list( - client.agent_endpoint_conversations.list_agent_conversation_items( - azure_voice_agents_agent_name, - azure_voice_agents_conversation_id, - foundry_features=PREVIEW, - headers={"Accept-Encoding": "identity"}, - ) - ) - - assert items - - @VoiceAgentsPreparer() - @recorded_by_proxy - def test_list_agent_conversation_responses( - self, azure_voice_agents_endpoint, azure_voice_agents_agent_name, azure_voice_agents_conversation_id - ): - with self.create_client(azure_voice_agents_endpoint) as client: - responses = list( - client.agent_endpoint_conversations.list_agent_conversation_responses( - azure_voice_agents_agent_name, - azure_voice_agents_conversation_id, - foundry_features=PREVIEW, - headers={"Accept-Encoding": "identity"}, - ) - ) - - assert responses - assert responses[0]["object"] == "realtime.response" - - @VoiceAgentsPreparer() - @recorded_by_proxy - def test_get_agent_conversation_audio_metadata( - self, azure_voice_agents_endpoint, azure_voice_agents_agent_name, azure_voice_agents_conversation_id - ): - with self.create_client(azure_voice_agents_endpoint) as client: - recording = client.agent_endpoint_conversations.get_agent_conversation_audio( - azure_voice_agents_agent_name, - azure_voice_agents_conversation_id, - foundry_features=PREVIEW, - headers={"Accept-Encoding": "identity"}, - ) - - assert recording["format"] is not None - assert recording["sample_rate"] is not None diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client_async.py b/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client_async.py deleted file mode 100644 index e122ab5752f0..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/tests/recording/test_voice_agents_client_async.py +++ /dev/null @@ -1,106 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Recorded functional tests for the async VoiceAgentsClient. - -See test_voice_agents_client.py for why this suite is limited to GET/LIST -operations. -""" -from devtools_testutils import AzureRecordedTestCase -from devtools_testutils.aio import recorded_by_proxy_async - -from azure.ai.voiceagents.aio import VoiceAgentsClient - -from _preparer import PREVIEW, VoiceAgentsPreparer - - -class TestVoiceAgentsClientAsync(AzureRecordedTestCase): - def create_client(self, endpoint: str) -> VoiceAgentsClient: - credential = self.get_credential(VoiceAgentsClient, is_async=True) - return self.create_client_from_credential(VoiceAgentsClient, credential=credential, endpoint=endpoint) - - @VoiceAgentsPreparer() - @recorded_by_proxy_async - async def test_get_voice_agent(self, azure_voice_agents_endpoint, azure_voice_agents_agent_name): - async with self.create_client(azure_voice_agents_endpoint) as client: - agent = await client.voice_agents.get_voice_agent(azure_voice_agents_agent_name, foundry_features=PREVIEW) - - # NOTE: don't assert agent["name"]/["id"] against azure_voice_agents_agent_name -- - # the test-proxy's built-in default sanitizers always redact "id"/"name" body - # fields to a generic value in playback, regardless of our own sanitizers. - assert agent["object"] == "agent" - assert agent["state"] in ("enabled", "disabled") - - # NOTE: list_voice_agents is intentionally not recorded here -- see the - # comment in test_voice_agents_client.py for why. - - @VoiceAgentsPreparer() - @recorded_by_proxy_async - async def test_get_agent_conversation( - self, azure_voice_agents_endpoint, azure_voice_agents_agent_name, azure_voice_agents_conversation_id - ): - async with self.create_client(azure_voice_agents_endpoint) as client: - conversation = await client.agent_endpoint_conversations.get_agent_conversation( - azure_voice_agents_agent_name, - azure_voice_agents_conversation_id, - foundry_features=PREVIEW, - headers={"Accept-Encoding": "identity"}, - ) - - # See the note in test_get_voice_agent about not asserting on "id"/"name". - assert conversation["object"] == "voice.conversation" - assert conversation["status"] is not None - - @VoiceAgentsPreparer() - @recorded_by_proxy_async - async def test_list_agent_conversation_items( - self, azure_voice_agents_endpoint, azure_voice_agents_agent_name, azure_voice_agents_conversation_id - ): - async with self.create_client(azure_voice_agents_endpoint) as client: - items = [ - item - async for item in client.agent_endpoint_conversations.list_agent_conversation_items( - azure_voice_agents_agent_name, - azure_voice_agents_conversation_id, - foundry_features=PREVIEW, - headers={"Accept-Encoding": "identity"}, - ) - ] - - assert items - - @VoiceAgentsPreparer() - @recorded_by_proxy_async - async def test_list_agent_conversation_responses( - self, azure_voice_agents_endpoint, azure_voice_agents_agent_name, azure_voice_agents_conversation_id - ): - async with self.create_client(azure_voice_agents_endpoint) as client: - responses = [ - response - async for response in client.agent_endpoint_conversations.list_agent_conversation_responses( - azure_voice_agents_agent_name, - azure_voice_agents_conversation_id, - foundry_features=PREVIEW, - headers={"Accept-Encoding": "identity"}, - ) - ] - - assert responses - assert responses[0]["object"] == "realtime.response" - - @VoiceAgentsPreparer() - @recorded_by_proxy_async - async def test_get_agent_conversation_audio_metadata( - self, azure_voice_agents_endpoint, azure_voice_agents_agent_name, azure_voice_agents_conversation_id - ): - async with self.create_client(azure_voice_agents_endpoint) as client: - recording = await client.agent_endpoint_conversations.get_agent_conversation_audio( - azure_voice_agents_agent_name, - azure_voice_agents_conversation_id, - foundry_features=PREVIEW, - headers={"Accept-Encoding": "identity"}, - ) - - assert recording["format"] is not None - assert recording["sample_rate"] is not None diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/unit/conftest.py b/sdk/voiceagents/azure-ai-voiceagents/tests/unit/conftest.py deleted file mode 100644 index 3da6c4586041..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/tests/unit/conftest.py +++ /dev/null @@ -1,17 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Overrides the parent (recorded-test) conftest for the unit test suite. - -Unit tests don't make any network calls, so they don't need the test-proxy -server that the recorded tests in the parent ``tests/`` directory start. This -fixture shadows the autouse ``start_proxy`` fixture from ../conftest.py so -running ``pytest tests/unit`` alone never tries to download/start the proxy. -""" -import pytest - - -@pytest.fixture(scope="session", autouse=True) -def start_proxy(): - return diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/unit/test_brotli_workaround.py b/sdk/voiceagents/azure-ai-voiceagents/tests/unit/test_brotli_workaround.py deleted file mode 100644 index 0b689e1772c8..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/tests/unit/test_brotli_workaround.py +++ /dev/null @@ -1,48 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Unit tests for the Brotli/aiohttp workaround in aio/_patch.py. No network calls. - -azure-core's AioHttpTransport disables aiohttp's native response decompression -and only re-implements gzip/deflate, while aiohttp advertises "Accept-Encoding: -br" by default. The async VoiceAgentsClient works around this by injecting its -own transport (unless the caller already supplied one) that only advertises -encodings azure-core can actually decompress. - -These tests must be `async def` because constructing the injected transport -builds an aiohttp.ClientSession, which requires a running event loop. -""" -import aiohttp -from azure.core.pipeline.transport import AioHttpTransport - -from azure.ai.voiceagents.aio import VoiceAgentsClient - -ENDPOINT = "https://example.services.ai.azure.com/api/projects/p" - - -class _FakeAsyncCredential: - async def get_token(self, *scopes, **kwargs): - raise NotImplementedError - - async def close(self): - pass - - -async def test_default_transport_only_advertises_gzip_deflate(): - async with VoiceAgentsClient(endpoint=ENDPOINT, credential=_FakeAsyncCredential()) as client: - transport = client._client._pipeline._transport - assert isinstance(transport, AioHttpTransport) - assert transport.session.headers.get("Accept-Encoding") == "gzip, deflate" - - -async def test_explicit_transport_bypasses_workaround(): - custom_session = aiohttp.ClientSession() - custom_transport = AioHttpTransport(session=custom_session) - try: - async with VoiceAgentsClient( - endpoint=ENDPOINT, credential=_FakeAsyncCredential(), transport=custom_transport - ) as client: - assert client._client._pipeline._transport is custom_transport - finally: - await custom_session.close() diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/unit/test_client_construction.py b/sdk/voiceagents/azure-ai-voiceagents/tests/unit/test_client_construction.py deleted file mode 100644 index 1015732de3d8..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/tests/unit/test_client_construction.py +++ /dev/null @@ -1,59 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Unit tests for sync/async client construction. No network calls. - -Note: constructing the async client requires a running event loop (it builds -an aiohttp.ClientSession by default -- see test_brotli_workaround.py), so the -async cases below are `async def` tests. -""" -from azure.ai.voiceagents import VoiceAgentsClient -from azure.ai.voiceagents.aio import VoiceAgentsClient as AsyncVoiceAgentsClient -from azure.ai.voiceagents.operations import ( - AgentEndpointConversationsOperations, - VoiceAgentsOperations, -) - -ENDPOINT = "https://example.services.ai.azure.com/api/projects/p" - - -class _FakeCredential: - def get_token(self, *scopes, **kwargs): - raise NotImplementedError - - -class _FakeAsyncCredential: - async def get_token(self, *scopes, **kwargs): - raise NotImplementedError - - async def close(self): - pass - - -def test_sync_client_exposes_operation_groups(): - client = VoiceAgentsClient(endpoint=ENDPOINT, credential=_FakeCredential()) - try: - assert isinstance(client.voice_agents, VoiceAgentsOperations) - assert isinstance(client.agent_endpoint_conversations, AgentEndpointConversationsOperations) - finally: - client.close() - - -def test_sync_client_is_a_context_manager(): - with VoiceAgentsClient(endpoint=ENDPOINT, credential=_FakeCredential()) as client: - assert client.voice_agents is not None - - -async def test_async_client_exposes_operation_groups(): - async with AsyncVoiceAgentsClient(endpoint=ENDPOINT, credential=_FakeAsyncCredential()) as client: - assert client.voice_agents is not None - assert client.agent_endpoint_conversations is not None - - -async def test_async_client_realtime_property_is_lazy_and_cached(): - async with AsyncVoiceAgentsClient(endpoint=ENDPOINT, credential=_FakeAsyncCredential()) as client: - assert client._realtime is None - realtime = client.realtime - assert realtime is not None - assert client.realtime is realtime # cached, not recreated on each access diff --git a/sdk/voiceagents/azure-ai-voiceagents/tests/unit/test_configuration.py b/sdk/voiceagents/azure-ai-voiceagents/tests/unit/test_configuration.py deleted file mode 100644 index 56d2eb7cc2df..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/tests/unit/test_configuration.py +++ /dev/null @@ -1,47 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Unit tests for VoiceAgentsClientConfiguration defaults. No network calls.""" -import pytest - -from azure.ai.voiceagents._configuration import VoiceAgentsClientConfiguration - -ENDPOINT = "https://example.services.ai.azure.com/api/projects/p" - - -class _FakeCredential: - def get_token(self, *scopes, **kwargs): - raise NotImplementedError - - -def test_default_api_version_is_v1(): - config = VoiceAgentsClientConfiguration(endpoint=ENDPOINT, credential=_FakeCredential()) - assert config.api_version == "v1" - - -def test_default_credential_scopes(): - config = VoiceAgentsClientConfiguration(endpoint=ENDPOINT, credential=_FakeCredential()) - assert config.credential_scopes == ["https://ai.azure.com/.default"] - - -def test_endpoint_and_credential_are_saved(): - credential = _FakeCredential() - config = VoiceAgentsClientConfiguration(endpoint=ENDPOINT, credential=credential) - assert config.endpoint == ENDPOINT - assert config.credential is credential - - -def test_endpoint_is_required(): - with pytest.raises(ValueError): - VoiceAgentsClientConfiguration(endpoint=None, credential=_FakeCredential()) - - -def test_credential_is_required(): - with pytest.raises(ValueError): - VoiceAgentsClientConfiguration(endpoint=ENDPOINT, credential=None) - - -def test_api_version_can_be_overridden(): - config = VoiceAgentsClientConfiguration(endpoint=ENDPOINT, credential=_FakeCredential(), api_version="v1") - assert config.api_version == "v1" diff --git a/sdk/voiceagents/azure-ai-voiceagents/tsp-location.yaml b/sdk/voiceagents/azure-ai-voiceagents/tsp-location.yaml deleted file mode 100644 index 1ff0d06d4cdc..000000000000 --- a/sdk/voiceagents/azure-ai-voiceagents/tsp-location.yaml +++ /dev/null @@ -1,13 +0,0 @@ -directory: specification/ai-foundry/data-plane/Foundry/src/sdk-python-azure-ai-voice-agents -commit: 708de4f80783992b0b9bce9394a0a9212bb14d40 -repo: yulin-li/azure-rest-api-specs -additionalDirectories: -- specification/ai-foundry/data-plane/Foundry/src/agents -- specification/ai-foundry/data-plane/Foundry/src/common -- specification/ai-foundry/data-plane/Foundry/src/memory-stores -- specification/ai-foundry/data-plane/Foundry/src/openai -- specification/ai-foundry/data-plane/Foundry/src/sdk-common -- specification/ai-foundry/data-plane/Foundry/src/skills -- specification/ai-foundry/data-plane/Foundry/src/tools -- specification/ai-foundry/data-plane/Foundry/src/toolboxes -- specification/ai-foundry/data-plane/Foundry/src/voice-agents From 23b70a770389a2c41156cecbae228463bc744957 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Thu, 13 Aug 2026 14:47:37 -0700 Subject: [PATCH 16/56] Remove remaining sdk/voiceagents CI config files --- sdk/voiceagents/ci.yml | 37 ------------------------------------ sdk/voiceagents/cspell.yaml | 38 ------------------------------------- sdk/voiceagents/tests.yml | 6 ------ 3 files changed, 81 deletions(-) delete mode 100644 sdk/voiceagents/ci.yml delete mode 100644 sdk/voiceagents/cspell.yaml delete mode 100644 sdk/voiceagents/tests.yml diff --git a/sdk/voiceagents/ci.yml b/sdk/voiceagents/ci.yml deleted file mode 100644 index d0a209af135c..000000000000 --- a/sdk/voiceagents/ci.yml +++ /dev/null @@ -1,37 +0,0 @@ -# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - -trigger: - branches: - include: - - main - - hotfix/* - - release/* - - restapi* - paths: - include: - - sdk/voiceagents/ - - sdk/core/ - -pr: - branches: - include: - - main - - feature/* - - hotfix/* - - release/* - - restapi* - paths: - include: - - sdk/voiceagents/ - - sdk/core/ - -extends: - template: /eng/pipelines/templates/stages/archetype-sdk-client.yml - parameters: - ServiceDirectory: voiceagents - TestProxy: true - BuildDocs: true - TestTimeoutInMinutes: 60 - Artifacts: - - name: azure-ai-voiceagents - safeName: azureaivoiceagents diff --git a/sdk/voiceagents/cspell.yaml b/sdk/voiceagents/cspell.yaml deleted file mode 100644 index 20807788ac46..000000000000 --- a/sdk/voiceagents/cspell.yaml +++ /dev/null @@ -1,38 +0,0 @@ -# cspell configuration for this service. Words are case-insensitive and -# kept sorted alphabetically. The import of the central config is required. -import: - - ../../.vscode/cspell.json -words: - - aarti - - aiservices - - byom - - BYOS - - CSDL - - dalia - - diya - - deser - - DTMF - - hyunsu - - keita - - MCPHTTP - - meera - - niwat - - pcma - - pcmu - - premwadee - - pyaudio - - redef - - realtime - - reraises - - sess - - SSML - - sunhi - - unsanitized - - vad - - viseme - - webrtc - - xhigh - - xiaoxiao - - ximena - - yunxi - - yulin diff --git a/sdk/voiceagents/tests.yml b/sdk/voiceagents/tests.yml deleted file mode 100644 index 1780a898a4e4..000000000000 --- a/sdk/voiceagents/tests.yml +++ /dev/null @@ -1,6 +0,0 @@ -trigger: none - -extends: - template: /eng/pipelines/templates/stages/python-analyze-weekly-standalone.yml - parameters: - ServiceDirectory: voiceagents From 580eff9fc0a8bc7fb790c2cfab0efb8eeb2bf322 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Thu, 13 Aug 2026 14:54:24 -0700 Subject: [PATCH 17/56] Improve realtime client: closed property, repr, wrapped connect errors, JSON validation on raw string events --- .../azure/ai/projects/aio/_realtime.py | 35 +++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py index 7b64d9a2b124..e45396ddee57 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py @@ -541,6 +541,18 @@ async def __aenter__(self) -> "AsyncRealtimeConnection": async def __aexit__(self, *exc_details: Any) -> None: await self.close() + def __repr__(self) -> str: + state = "closed" if self.closed else "open" + return f"" + + @property + def closed(self) -> bool: + """Whether the underlying WebSocket connection has been closed. + + :rtype: bool + """ + return self._connection.closed + def __aiter__(self) -> AsyncIterator[ServerEvent]: return self._iter() @@ -592,8 +604,16 @@ async def send(self, event: ClientEvent) -> None: :param event: A strongly-typed client event, a ready-made mapping, or a raw JSON string. :type event: ~azure.ai.projects.aio.ClientEvent or str + :raises ValueError: If ``event`` is a ``str`` that is not valid JSON. """ - payload = event if isinstance(event, str) else json.dumps(event, cls=SdkJSONEncoder) + if isinstance(event, str): + try: + json.loads(event) + except ValueError as exc: + raise ValueError(f"'event' is not valid JSON: {exc}") from exc + payload = event + else: + payload = json.dumps(event, cls=SdkJSONEncoder) await self._connection.send_str(payload) async def close(self, *, code: int = 1000, reason: str = "") -> None: @@ -655,6 +675,10 @@ async def enter(self) -> AsyncRealtimeConnection: # pylint: disable=too-many-lo :return: The live realtime connection. :rtype: ~azure.ai.projects.aio.AsyncRealtimeConnection + :raises RuntimeError: If ``aiohttp`` is not installed. + :raises ValueError: If the computed or supplied WebSocket URL does not use ``wss://``. + :raises ConnectionError: If the WebSocket upgrade handshake fails (for example, a + network error, DNS failure, or a non-101 response from the service). """ try: import aiohttp # pylint: disable=import-outside-toplevel @@ -693,9 +717,14 @@ async def enter(self) -> AsyncRealtimeConnection: # pylint: disable=too-many-lo connection = await session.ws_connect( url, headers=headers, params=params, **self._kwargs ) - except BaseException: + except BaseException as exc: await session.close() - raise + if isinstance(exc, (ValueError, RuntimeError)): + raise + raise ConnectionError( + f"Failed to open the realtime WebSocket connection to voice agent " + f"'{self._agent_name}' at '{url}': {exc}" + ) from exc self._connection = AsyncRealtimeConnection( cast("ClientWebSocketResponse", connection), session ) From 2ede6f85425929fd45f803c0160c39d39b4c5f8d Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Thu, 13 Aug 2026 16:14:57 -0700 Subject: [PATCH 18/56] Fix mypy/pylint/cspell issues and revert VoiceAgents header addition - Revert VOICE_AGENTS_V1_PREVIEW from _AGENT_OPERATION_FEATURE_HEADERS (service not ready, breaks existing recordings) - Fix mypy: undefined _unions self-reference, missing realtime/. AsyncRealtime* stubs in aio/_patch.pyi, add targeted overrides for known generated overload-widening signatures in patch_agents/patch_evaluation_rules - Fix pylint: reimported AgentKind in types.py, self-import in _unions.py - Fix voice/optimization sample type errors with targeted type: ignore comments - Add pcma/pcmu to sdk/ai/cspell.yaml word list --- .../azure/ai/projects/_unions.py | 4 ++-- .../azure/ai/projects/aio/_patch.pyi | 11 ++++++++- .../aio/operations/_patch_agents_async.py | 8 +++---- .../_patch_evaluation_rules_async.py | 6 ++--- .../azure/ai/projects/models/_enums.py | 8 +++---- .../azure/ai/projects/models/_models.py | 7 +++--- .../azure/ai/projects/models/_patch.py | 4 +++- .../ai/projects/operations/_patch_agents.py | 8 +++---- .../operations/_patch_evaluation_rules.py | 6 ++--- .../azure/ai/projects/types.py | 8 +++---- ...e_optimization_job_advanced_app_polling.py | 24 +++++++++---------- ...mization_job_advanced_app_polling_async.py | 20 ++++++++-------- .../sample_optimization_job_basic.py | 18 +++++++------- .../sample_optimization_job_basic_async.py | 18 +++++++------- .../sample_optimization_job_cancel.py | 22 ++++++++--------- .../voice/sample_voice_agent_generate.py | 2 +- .../voice/sample_voice_agent_versions.py | 2 +- .../voice/sample_voice_agent_with_tools.py | 6 ++--- .../foundry_features_header_test_base.py | 4 ++-- sdk/ai/cspell.yaml | 2 ++ 20 files changed, 101 insertions(+), 87 deletions(-) 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 d11228d5304f..71f1e68a4552 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_unions.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_unions.py @@ -32,7 +32,7 @@ "_models.RealtimeConversationItemFunctionCallOutput", ] VoiceAgentCreateConversationItem = Union[ - "_unions.VoiceAgentRequestConversationItem", "_models.RealtimeMCPApprovalResponse" + VoiceAgentRequestConversationItem, "_models.RealtimeMCPApprovalResponse" ] VoiceAgentResponseMessageItem = Union[ "_models.RealtimeConversationItemMessageSystem", @@ -40,7 +40,7 @@ "_models.RealtimeConversationItemMessageAssistant", ] VoiceAgentResponseItem = Union[ - "_unions.VoiceAgentResponseMessageItem", + VoiceAgentResponseMessageItem, "_models.VoiceFunctionCallItem", "_models.VoiceFunctionCallOutputItem", "_models.VoiceMcpListToolsItem", diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.pyi b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.pyi index 95983692257c..e480e6e373f3 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.pyi +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.pyi @@ -101,10 +101,19 @@ class AsyncOpenAI(AsyncOpenAIClient): class AIProjectClient(AIProjectClientGenerated): telemetry: TelemetryOperations + @property + def realtime(self) -> Any: ... def get_openai_client( self, agent_name: Optional[str] = None, **kwargs: Any # pylint: disable=unused-argument ) -> AsyncOpenAI: ... +class AsyncRealtime: + def __init__(self, client: Any) -> None: ... + def connect(self, *, agent_name: str, **kwargs: Any) -> Any: ... + +class AsyncRealtimeConnection: ... +class AsyncRealtimeConnectionManager: ... + class _OpenAILoggingTransport: def __init__(self, *, logging_enabled: bool) -> None: ... async def handle_async_request(self, request: Any) -> Any: ... @@ -114,6 +123,6 @@ class _LoggingAsyncByteStream(httpx.AsyncByteStream): ... def _log_streaming_response_notice(logging_enabled: bool) -> bool: ... # To make mypy happy... otherwise imports of the below result in mypy "attr-defined" error -__all__: List[str] = ["AIProjectClient"] +__all__: List[str] = ["AIProjectClient", "AsyncRealtime", "AsyncRealtimeConnection", "AsyncRealtimeConnectionManager"] def patch_sdk() -> None: ... diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py index cd906a8d8498..ec67c0b34159 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py @@ -33,7 +33,7 @@ class AgentsOperations(GeneratedAgentsOperations): :attr:`agents` attribute. """ - @overload + @overload # type: ignore[override] async def create_version( self, agent_name: str, @@ -135,7 +135,7 @@ async def create_version( """ @distributed_trace_async - async def create_version( + async def create_version( # type: ignore[override] self, agent_name: str, body: Union[JSON, IO[bytes]] = _Unset, @@ -193,9 +193,9 @@ async def create_version( kwargs["headers"] = headers try: - return await super().create_version( + return await super().create_version( # type: ignore[misc] agent_name, - body, + body, # type: ignore[arg-type] definition=definition, metadata=metadata, description=description, diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_evaluation_rules_async.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_evaluation_rules_async.py index 7e61eeb2866c..7f7d1902d5ff 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_evaluation_rules_async.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_evaluation_rules_async.py @@ -32,7 +32,7 @@ class EvaluationRulesOperations(GeneratedEvaluationRulesOperations): :attr:`evaluation_rules` attribute. """ - @overload + @overload # type: ignore[override] async def create_or_update( self, id: str, evaluation_rule: _models.EvaluationRule, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationRule: @@ -90,7 +90,7 @@ async def create_or_update( ... @distributed_trace_async - async def create_or_update( + async def create_or_update( # type: ignore[override] self, id: str, evaluation_rule: Union[_models.EvaluationRule, JSON, IO[bytes]], **kwargs: Any ) -> _models.EvaluationRule: """Create or update an evaluation rule. @@ -116,7 +116,7 @@ async def create_or_update( kwargs["headers"] = headers try: - return await super().create_or_update(id, evaluation_rule, **kwargs) + return await super().create_or_update(id, evaluation_rule, **kwargs) # type: ignore[arg-type] except HttpResponseError as exc: if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: api_error_response = exc.model 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 21edb0afa073..96d8984ad7d9 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 @@ -1704,12 +1704,12 @@ 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. + 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. + 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. + 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 9299b9caec47..d92e20bb2a71 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 @@ -23731,13 +23731,14 @@ class VoiceAudioOutputConfig(_Model): # pylint: disable=docstring-keyword-shoul * `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`. + `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. + `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 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 d5171a4789be..a3624bd63dc5 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 @@ -50,7 +50,9 @@ _AgentDefinitionOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW.value, _AgentDefinitionOptInKeys.EXTERNAL_AGENTS_V1_PREVIEW.value, _AgentDefinitionOptInKeys.DRAFT_AGENTS_V1_PREVIEW.value, - _AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.value, + # NOTE: VOICE_AGENTS_V1_PREVIEW is intentionally excluded here for now. The service + # API for voice agents is not yet ready, and recorded tests were captured without this + # opt-in value. Re-add it once the service is ready and recordings can be refreshed. _FoundryFeaturesOptInKeys.AGENTS_OPTIMIZATION_V2_PREVIEW.value, ] ) diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py index d72e81cf077d..f4c52a648dc0 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py @@ -51,7 +51,7 @@ class AgentsOperations(GeneratedAgentsOperations): :attr:`agents` attribute. """ - @overload + @overload # type: ignore[override] def create_version( self, agent_name: str, @@ -153,7 +153,7 @@ def create_version( """ @distributed_trace - def create_version( + def create_version( # type: ignore[override] self, agent_name: str, body: Union[JSON, IO[bytes]] = _Unset, @@ -212,9 +212,9 @@ def create_version( kwargs["headers"] = headers try: - return super().create_version( + return super().create_version( # type: ignore[misc] agent_name, - body, + body, # type: ignore[arg-type] definition=definition, metadata=metadata, description=description, diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_evaluation_rules.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_evaluation_rules.py index 859bea44b87b..76cec35bffe7 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_evaluation_rules.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_evaluation_rules.py @@ -32,7 +32,7 @@ class EvaluationRulesOperations(GeneratedEvaluationRulesOperations): :attr:`evaluation_rules` attribute. """ - @overload + @overload # type: ignore[override] def create_or_update( self, id: str, evaluation_rule: _models.EvaluationRule, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationRule: @@ -90,7 +90,7 @@ def create_or_update( ... @distributed_trace - def create_or_update( + def create_or_update( # type: ignore[override] self, id: str, evaluation_rule: Union[_models.EvaluationRule, JSON, IO[bytes]], **kwargs: Any ) -> _models.EvaluationRule: """Create or update an evaluation rule. @@ -117,7 +117,7 @@ def create_or_update( kwargs["headers"] = headers try: - return super().create_or_update(id, evaluation_rule, **kwargs) + return super().create_or_update(id, evaluation_rule, **kwargs) # type: ignore[arg-type] except HttpResponseError as exc: if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: api_error_response = exc.model diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/types.py b/sdk/ai/azure-ai-projects/azure/ai/projects/types.py index 2438c098c2a9..bad33838f680 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/types.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/types.py @@ -63,7 +63,6 @@ from . import _unions from .models import ( AgentEndpointProtocol, - AgentKind, AttackStrategy, AzureAISearchQueryType, CallableToolAllowedCaller, @@ -10501,13 +10500,14 @@ class VoiceAudioOutputConfig(TypedDict, total=False): * `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`. + `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. + `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 diff --git a/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_advanced_app_polling.py b/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_advanced_app_polling.py index ab72b614aeb9..1810e66ab5ca 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_advanced_app_polling.py +++ b/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_advanced_app_polling.py @@ -41,12 +41,12 @@ from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( JobStatus, - OptimizationAgentIdentifier as AgentIdentifier, - OptimizationEvaluatorRef as EvaluatorRef, - OptimizationJob, - OptimizationJobInputs, - OptimizationOptions, - OptimizationReferenceDatasetInput as ReferenceDatasetInput, + OptimizedAgentIdentifier as AgentIdentifier, + AgentOptimizationEvaluatorRef as EvaluatorRef, + AgentOptimizationJob, + AgentOptimizationJobInputs, + AgentOptimizationOptions, + AgentOptimizationReferenceDatasetInput as ReferenceDatasetInput, ) load_dotenv() @@ -71,23 +71,23 @@ # 1. Create an optimization job without SDK polling. # ------------------------------------------------------------------ print("Creating optimization job...") - created_jobs: list[OptimizationJob] = [] + created_jobs: list[AgentOptimizationJob] = [] def raw_response_hook(response): # Since `polling=False` is set below, it is guaranteed that `raw_response_hook` will be - # invoked once on the initial "201 Created" response, and `response` is of type `OptimizationJob`. + # invoked once on the initial "201 Created" response, and `response` is of type `AgentOptimizationJob`. response.http_response.read() - created_jobs.append(OptimizationJob(response.http_response.json())) + created_jobs.append(AgentOptimizationJob(response.http_response.json())) - job = OptimizationJob( - inputs=OptimizationJobInputs( + job = AgentOptimizationJob( + inputs=AgentOptimizationJobInputs( agent=AgentIdentifier(agent_name=agent_name), train_dataset=ReferenceDatasetInput( name=dataset_name, version=dataset_version, ), evaluators=[EvaluatorRef(name=evaluator_name)], - options=OptimizationOptions( + options=AgentOptimizationOptions( max_candidates=3, eval_model=eval_model, optimization_model=optimization_model, diff --git a/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_advanced_app_polling_async.py b/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_advanced_app_polling_async.py index 7a8599ecb48b..d89dea592417 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_advanced_app_polling_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_advanced_app_polling_async.py @@ -41,12 +41,12 @@ from azure.ai.projects.aio import AIProjectClient from azure.ai.projects.models import ( JobStatus, - OptimizationAgentIdentifier as AgentIdentifier, - OptimizationEvaluatorRef as EvaluatorRef, - OptimizationJob, - OptimizationJobInputs, - OptimizationOptions, - OptimizationReferenceDatasetInput as ReferenceDatasetInput, + OptimizedAgentIdentifier as AgentIdentifier, + AgentOptimizationEvaluatorRef as EvaluatorRef, + AgentOptimizationJob, + AgentOptimizationJobInputs, + AgentOptimizationOptions, + AgentOptimizationReferenceDatasetInput as ReferenceDatasetInput, ) load_dotenv() @@ -81,15 +81,15 @@ def raw_response_hook(response): # and parse the body afterwards, when read() has already been awaited. pipeline_responses.append(response) - job = OptimizationJob( - inputs=OptimizationJobInputs( + job = AgentOptimizationJob( + inputs=AgentOptimizationJobInputs( agent=AgentIdentifier(agent_name=agent_name), train_dataset=ReferenceDatasetInput( name=dataset_name, version=dataset_version, ), evaluators=[EvaluatorRef(name=evaluator_name)], - options=OptimizationOptions( + options=AgentOptimizationOptions( max_candidates=3, eval_model=eval_model, optimization_model=optimization_model, @@ -106,7 +106,7 @@ def raw_response_hook(response): # to a poller, and then awaiting `poller.result()`. if not pipeline_responses: raise RuntimeError("The create operation did not return an optimization job.") - job = OptimizationJob(pipeline_responses[0].http_response.json()) + job = AgentOptimizationJob(pipeline_responses[0].http_response.json()) print(f"Created job: id={job.id}, status={job.status}") # ------------------------------------------------------------------ diff --git a/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_basic.py b/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_basic.py index 66f41bf1e50a..222f9ad81eb6 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_basic.py +++ b/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_basic.py @@ -41,12 +41,12 @@ from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( - OptimizationAgentIdentifier as AgentIdentifier, - OptimizationEvaluatorRef as EvaluatorRef, - OptimizationJob, - OptimizationJobInputs, - OptimizationOptions, - OptimizationReferenceDatasetInput as ReferenceDatasetInput, + OptimizedAgentIdentifier as AgentIdentifier, + AgentOptimizationEvaluatorRef as EvaluatorRef, + AgentOptimizationJob, + AgentOptimizationJobInputs, + AgentOptimizationOptions, + AgentOptimizationReferenceDatasetInput as ReferenceDatasetInput, ) load_dotenv() @@ -68,15 +68,15 @@ # ------------------------------------------------------------------ # 1. Create an optimization job and observe the SDK-managed poller. # ------------------------------------------------------------------ - job = OptimizationJob( - inputs=OptimizationJobInputs( + job = AgentOptimizationJob( + inputs=AgentOptimizationJobInputs( agent=AgentIdentifier(agent_name=agent_name), train_dataset=ReferenceDatasetInput( name=dataset_name, version=dataset_version, ), evaluators=[EvaluatorRef(name=evaluator_name)], - options=OptimizationOptions( + options=AgentOptimizationOptions( max_candidates=3, eval_model=eval_model, optimization_model=optimization_model, diff --git a/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_basic_async.py b/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_basic_async.py index f1453ead5590..1ba21fd0bc8c 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_basic_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_basic_async.py @@ -41,12 +41,12 @@ from azure.identity.aio import DefaultAzureCredential from azure.ai.projects.aio import AIProjectClient from azure.ai.projects.models import ( - OptimizationAgentIdentifier as AgentIdentifier, - OptimizationEvaluatorRef as EvaluatorRef, - OptimizationJob, - OptimizationJobInputs, - OptimizationOptions, - OptimizationReferenceDatasetInput as ReferenceDatasetInput, + OptimizedAgentIdentifier as AgentIdentifier, + AgentOptimizationEvaluatorRef as EvaluatorRef, + AgentOptimizationJob, + AgentOptimizationJobInputs, + AgentOptimizationOptions, + AgentOptimizationReferenceDatasetInput as ReferenceDatasetInput, ) load_dotenv() @@ -70,15 +70,15 @@ async def main() -> None: # ------------------------------------------------------------------ # 1. Create an optimization job and observe the SDK-managed poller. # ------------------------------------------------------------------ - job = OptimizationJob( - inputs=OptimizationJobInputs( + job = AgentOptimizationJob( + inputs=AgentOptimizationJobInputs( agent=AgentIdentifier(agent_name=agent_name), train_dataset=ReferenceDatasetInput( name=dataset_name, version=dataset_version, ), evaluators=[EvaluatorRef(name=evaluator_name)], - options=OptimizationOptions( + options=AgentOptimizationOptions( max_candidates=3, eval_model=eval_model, optimization_model=optimization_model, diff --git a/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_cancel.py b/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_cancel.py index 9fa92921cab5..1878eebd7884 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_cancel.py +++ b/sdk/ai/azure-ai-projects/samples/agents/optimization/sample_optimization_job_cancel.py @@ -37,12 +37,12 @@ from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( - OptimizationAgentIdentifier as AgentIdentifier, - OptimizationEvaluatorRef as EvaluatorRef, - OptimizationJob, - OptimizationJobInputs, - OptimizationOptions, - OptimizationReferenceDatasetInput as ReferenceDatasetInput, + OptimizedAgentIdentifier as AgentIdentifier, + AgentOptimizationEvaluatorRef as EvaluatorRef, + AgentOptimizationJob, + AgentOptimizationJobInputs, + AgentOptimizationOptions, + AgentOptimizationReferenceDatasetInput as ReferenceDatasetInput, ) load_dotenv() @@ -65,15 +65,15 @@ # ------------------------------------------------------------------ # 1. Create an optimization job and retain the SDK-managed poller. # ------------------------------------------------------------------ - job = OptimizationJob( - inputs=OptimizationJobInputs( + job = AgentOptimizationJob( + inputs=AgentOptimizationJobInputs( agent=AgentIdentifier(agent_name=agent_name), train_dataset=ReferenceDatasetInput( name=dataset_name, version=dataset_version, ), evaluators=[EvaluatorRef(name=evaluator_name)], - options=OptimizationOptions( + options=AgentOptimizationOptions( max_candidates=3, eval_model=eval_model, optimization_model=optimization_model, @@ -81,11 +81,11 @@ ), ) - created_jobs: list[OptimizationJob] = [] + created_jobs: list[AgentOptimizationJob] = [] def raw_response_hook(response): response.http_response.read() - created_jobs.append(OptimizationJob(response.http_response.json())) + created_jobs.append(AgentOptimizationJob(response.http_response.json())) print("Begin creating an agent optimization job.") poller = project_client.beta.agents.begin_create_optimization_job( diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_generate.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_generate.py index 6c3e9faf9f6f..c101841ba538 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_generate.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_generate.py @@ -38,7 +38,7 @@ ): agent = project_client.agents.generate_agent(kind="voice") print(f"Generated voice agent: {agent.name}") - print(f"Instructions:\n{agent.versions.latest.definition.instructions}") # type: ignore[union-attr] + print(f"Instructions:\n{agent.versions.latest.definition.instructions}") # type: ignore[attr-defined] project_client.agents.delete(agent_name=agent.name) print(f"Deleted voice agent: {agent.name}") diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_versions.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_versions.py index 7878ec9a4ccd..7c1f4070cb23 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_versions.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_versions.py @@ -84,7 +84,7 @@ def make_definition(instructions: str) -> VoiceAgentDefinition: # Read a single version back. fetched = project_client.agents.get_version(agent_name=agent_name, agent_version=new_version.version) - print(f"Fetched version {fetched.version}: {fetched.definition.instructions}") # type: ignore[union-attr] + print(f"Fetched version {fetched.version}: {fetched.definition.instructions}") # type: ignore[attr-defined] finally: project_client.agents.delete(agent_name=agent_name) print(f"Deleted agent: {agent_name}") diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_with_tools.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_with_tools.py index 9022e6d85975..5964f6e5040b 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_with_tools.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_with_tools.py @@ -93,7 +93,7 @@ server_label="my-mcp-server", server_url="https://example.com/mcp", require_approval="never", -) +) # type: ignore[call-overload] # A toolbox tool references a versioned Foundry toolbox you have created. It is # constructed here for illustration; attach it only if the toolbox exists. @@ -122,7 +122,7 @@ output_modalities=[VoiceOutputModality.AUDIO], # Attach the self-contained tools. `_example_mcp_tool` and `_example_toolbox_tool` # reference external resources you must own, so they are left out here. - tools=[get_weather, end_call], + tools=[get_weather, end_call], # type: ignore[list-item] store=True, ) @@ -135,7 +135,7 @@ print(f"Created voice agent '{agent_name}' (model_type={model_type}, model={model})") agent_version = project_client.agents.get_version(agent_name=agent_name, agent_version=created_version.version) - tools = agent_version.definition.tools or [] # type: ignore[union-attr] + tools = agent_version.definition.tools or [] # type: ignore[attr-defined] print(f"Configured {len(tools)} tool(s):") for tool in tools: # Tools belong to an open union, so on read they surface as mappings diff --git a/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py b/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py index 4555d6f7676d..55e08fee6f52 100644 --- a/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py +++ b/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py @@ -45,7 +45,7 @@ "schedules": "Schedules=V1Preview", "skills": "Skills=V1Preview", "datasets": "DataGenerationJobs=V1Preview", - "agents": "WorkflowAgents=V1Preview,ExternalAgents=V1Preview,DraftAgents=V1Preview,VoiceAgents=V1Preview,AgentsOptimization=V2Preview", + "agents": "WorkflowAgents=V1Preview,ExternalAgents=V1Preview,DraftAgents=V1Preview,AgentsOptimization=V2Preview", } # Methods on .beta sub-clients that are NOT simple one-HTTP-call wrappers and @@ -83,7 +83,7 @@ # The test id is derived automatically from method_name. pytest.param( "agents.create_version", - "WorkflowAgents=V1Preview,ExternalAgents=V1Preview,DraftAgents=V1Preview,VoiceAgents=V1Preview,AgentsOptimization=V2Preview", + "WorkflowAgents=V1Preview,ExternalAgents=V1Preview,DraftAgents=V1Preview,AgentsOptimization=V2Preview", ), pytest.param( "evaluation_rules.create_or_update", diff --git a/sdk/ai/cspell.yaml b/sdk/ai/cspell.yaml index 18e70907235b..9083e839d933 100644 --- a/sdk/ai/cspell.yaml +++ b/sdk/ai/cspell.yaml @@ -80,6 +80,8 @@ words: - openai - openmpi - oupfoo + - pcma + - pcmu - pipelinerunid - PRIFINS - prompty From c70d02464bc74b3129f50eda01d99ab31c618438 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 13 Aug 2026 23:26:08 +0000 Subject: [PATCH 19/56] Regenerate azure-ai-projects API consistency artifacts Co-authored-by: xitzhang <11403681+xitzhang@users.noreply.github.com> --- sdk/ai/azure-ai-projects/api.md | 3416 ++++++++------------- sdk/ai/azure-ai-projects/api.metadata.yml | 6 +- 2 files changed, 1337 insertions(+), 2085 deletions(-) diff --git a/sdk/ai/azure-ai-projects/api.md b/sdk/ai/azure-ai-projects/api.md index c49b2623eabb..8926f3d8d072 100644 --- a/sdk/ai/azure-ai-projects/api.md +++ b/sdk/ai/azure-ai-projects/api.md @@ -44,6 +44,7 @@ namespace azure.ai.projects namespace azure.ai.projects.aio class azure.ai.projects.aio.AIProjectClient(AIProjectClientGenerated): implements AsyncContextManager + property realtime: AsyncRealtime # Read-only agents: AgentsOperations beta: BetaOperations connections: ConnectionsOperations @@ -83,6 +84,75 @@ namespace azure.ai.projects.aio ) -> Awaitable[AsyncHttpResponse]: ... + class azure.ai.projects.aio.AsyncRealtime: + + def __init__(self, client: AIProjectClient) -> None: ... + + def connect( + self, + *, + agent_name: str, + agent_session_id: Optional[str] = ..., + agent_version_override: Optional[str] = ..., + api_version: Optional[str] = ..., + connection_url: Optional[str] = ..., + credential_scopes: Optional[List[str]] = ..., + extra_headers: Optional[Mapping[str, str]] = ..., + extra_query: Optional[Mapping[str, str]] = ..., + foundry_features: str = _VOICE_AGENT_FEATURE_HEADER, + structured_inputs: Optional[str] = ..., + **kwargs: Any + ) -> AsyncRealtimeConnectionManager: ... + + + class azure.ai.projects.aio.AsyncRealtimeConnection: implements AsyncContextManager + property closed: bool # Read-only + + def __aiter__(self) -> AsyncIterator[ServerEvent]: ... + + def __init__( + self, + connection: ClientWebSocketResponse, + session: ClientSession + ) -> None: ... + + def __repr__(self) -> str: ... + + async def close( + self, + *, + code: int = 1000, + reason: str = "" + ) -> None: ... + + async def recv(self) -> ServerEvent: ... + + async def send(self, event: ClientEvent) -> None: ... + + + class azure.ai.projects.aio.AsyncRealtimeConnectionManager: implements AsyncContextManager + + def __init__( + self, + *, + agent_name: str, + agent_session_id: Optional[str] = ..., + agent_version_override: Optional[str] = ..., + api_version: str, + connection_url: Optional[str] = ..., + credential: AsyncTokenCredential, + credential_scopes: List[str], + endpoint: str, + extra_headers: Optional[Mapping[str, str]] = ..., + extra_query: Optional[Mapping[str, str]] = ..., + foundry_features: str, + structured_inputs: Optional[str] = ..., + **kwargs: Any + ) -> None: ... + + async def enter(self) -> AsyncRealtimeConnection: ... + + namespace azure.ai.projects.aio.operations class azure.ai.projects.aio.operations.AgentEndpointConversationsOperations: @@ -3420,21 +3490,21 @@ namespace azure.ai.projects.models class azure.ai.projects.models.AzureAIAgentTargetParam(TypedDict, total=False): - key "name": Required[str] key "tool_descriptions": List[ToolDescriptionParam] - key "type": Required[Literal["azure_ai_agent"]] key "version": str + name: Required[str] + type: Required[Literal["azure_ai_agent"]] class azure.ai.projects.models.AzureAIBenchmarkPreviewEvalRunDataSource(TypedDict, total=False): key "input_messages": InputMessagesItemReference - key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] - key "type": Required[Literal["azure_ai_benchmark_preview"]] + target: Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] + type: Required[Literal["azure_ai_benchmark_preview"]] class azure.ai.projects.models.AzureAIDataSourceConfig(TypedDict, total=False): - key "scenario": Required[str] - key "type": Required[Literal["azure_ai_source"]] + scenario: Required[str] + type: Required[Literal["azure_ai_source"]] class azure.ai.projects.models.AzureAIModelTarget(EvaluationTarget, discriminator='azure_ai_model'): @@ -3457,14 +3527,14 @@ namespace azure.ai.projects.models class azure.ai.projects.models.AzureAIModelTargetParam(TypedDict, total=False): key "model": str key "sampling_params": ModelSamplingConfigParam - key "type": Required[Literal["azure_ai_model"]] + type: Required[Literal["azure_ai_model"]] class azure.ai.projects.models.AzureAIResponsesEvalRunDataSource(TypedDict, total=False): key "event_configuration_id": str - key "item_generation_params": Required[ResponseRetrievalItemGenerationParams] key "max_runs_hourly": int - key "type": Required[Literal["azure_ai_responses"]] + item_generation_params: Required[ResponseRetrievalItemGenerationParams] + type: Required[Literal["azure_ai_responses"]] class azure.ai.projects.models.AzureAISearchIndex(Index, discriminator='AzureSearch'): @@ -5072,13 +5142,13 @@ namespace azure.ai.projects.models class azure.ai.projects.models.EvalCsvFileIdSource(TypedDict, total=False): - key "id": Required[str] - key "type": Required[Literal["file_id"]] + id: Required[str] + type: Required[Literal["file_id"]] class azure.ai.projects.models.EvalCsvRunDataSource(TypedDict, total=False): - key "source": Required[EvalCsvFileIdSource] - key "type": Required[Literal["csv"]] + source: Required[EvalCsvFileIdSource] + type: Required[Literal["csv"]] class azure.ai.projects.models.EvalResult(_Model): @@ -8845,9 +8915,9 @@ namespace azure.ai.projects.models class azure.ai.projects.models.RedTeamEvalRunDataSource(TypedDict, total=False): - key "item_generation_params": Required[Any] - key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] - key "type": Required[Literal["azure_ai_red_team"]] + item_generation_params: Required[Any] + target: Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] + type: Required[Literal["azure_ai_red_team"]] class azure.ai.projects.models.RedTeamTargetConfig(_Model): @@ -8884,10 +8954,10 @@ namespace azure.ai.projects.models class azure.ai.projects.models.ResponseRetrievalItemGenerationParams(TypedDict, total=False): - key "data_mapping": Required[Dict[str, str]] key "max_num_turns": int - key "source": Required[Union[SourceFileContent, SourceFileID]] - key "type": Required[Literal["response_retrieval"]] + data_mapping: Required[Dict[str, str]] + source: Required[Union[SourceFileContent, SourceFileID]] + type: Required[Literal["response_retrieval"]] class azure.ai.projects.models.ResponseUsageInputTokensDetails(_Model): @@ -9552,10 +9622,10 @@ namespace azure.ai.projects.models class azure.ai.projects.models.TargetCompletionEvalRunDataSource(TypedDict, total=False): - key "input_messages": Required[InputMessagesItemReference] - key "source": Required[Union[SourceFileContent, SourceFileID]] - key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] - key "type": Required[Literal["azure_ai_target_completions"]] + input_messages: Required[InputMessagesItemReference] + source: Required[Union[SourceFileContent, SourceFileID]] + target: Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] + type: Required[Literal["azure_ai_target_completions"]] class azure.ai.projects.models.TaskGenerationDataGenerationJobOptions(DataGenerationJobOptions, discriminator='task_generation'): @@ -9705,11 +9775,11 @@ namespace azure.ai.projects.models class azure.ai.projects.models.TestingCriterionAzureAIEvaluator(TypedDict, total=False): key "data_mapping": Dict[str, str] - key "evaluator_name": Required[str] key "evaluator_version": str key "initialization_parameters": Dict[str, Any] - key "name": Required[str] - key "type": Required[Literal["azure_ai_evaluator"]] + evaluator_name: Required[str] + name: Required[str] + type: Required[Literal["azure_ai_evaluator"]] class azure.ai.projects.models.TextResponseFormat(_Model): @@ -10355,7 +10425,7 @@ namespace azure.ai.projects.models key "lookback_hours": int key "max_traces": int key "trace_ids": List[str] - key "type": Required[Literal["azure_ai_traces_preview"]] + type: Required[Literal["azure_ai_traces_preview"]] class azure.ai.projects.models.TranscriptTextUsageDuration(CreateTranscriptionResponseJsonUsage, discriminator='duration'): @@ -16138,12 +16208,11 @@ namespace azure.ai.projects.types key "base_url": str key "project_connection_id": str key "send_credentials_for_agent_card": bool - key "type": Required[Literal[ToolType.A2A_PREVIEW]] agent_card_path: str base_url: str project_connection_id: str send_credentials_for_agent_card: bool - type: Literal[ToolType.A2A_PREVIEW] + type: Required[Literal[ToolType.A2A_PREVIEW]] class azure.ai.projects.types.A2APreviewToolboxTool(TypedDict, total=False): @@ -16153,7 +16222,7 @@ namespace azure.ai.projects.types key "name": str key "project_connection_id": str key "send_credentials_for_agent_card": bool - key "type": Required[Literal[ToolboxToolType.A2A_PREVIEW]] + key "tool_configs": dict[str, ToolConfig] agent_card_path: str base_url: str description: str @@ -16161,7 +16230,7 @@ namespace azure.ai.projects.types project_connection_id: str send_credentials_for_agent_card: bool tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.A2A_PREVIEW] + type: Required[Literal[ToolboxToolType.A2A_PREVIEW]] class azure.ai.projects.types.A2AProtocolConfiguration(TypedDict, total=False): @@ -16188,10 +16257,8 @@ namespace azure.ai.projects.types class azure.ai.projects.types.AgentBlueprintReference(TypedDict, total=False): - key "blueprint_id": Required[str] - key "type": Required[Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT]] - blueprint_id: str - type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] + blueprint_id: Required[str] + type: Required[Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT]] class azure.ai.projects.types.AgentBlueprintReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -16200,49 +16267,41 @@ namespace azure.ai.projects.types class azure.ai.projects.types.AgentCard(TypedDict, total=False): key "description": str - key "skills": Required[list[AgentCardSkill]] - key "version": Required[str] description: str - skills: list[AgentCardSkill] - version: str + skills: Required[list[AgentCardSkill]] + version: Required[str] class azure.ai.projects.types.AgentCardSkill(TypedDict, total=False): key "description": str - key "id": Required[str] - key "name": Required[str] + key "examples": list[str] + key "tags": list[str] description: str examples: list[str] - id: str - name: str + id: Required[str] + name: Required[str] tags: list[str] class azure.ai.projects.types.AgentClusterInsightRequest(TypedDict, total=False): - key "agentName": Required[str] - key "modelConfiguration": ForwardRef('InsightModelConfiguration', module='types') - key "type": Required[Literal[InsightType.AGENT_CLUSTER_INSIGHT]] - agentName: str + key "modelConfiguration": ForwardRef('InsightModelConfiguration') + agentName: Required[str] modelConfiguration: InsightModelConfiguration - type: Literal[InsightType.AGENT_CLUSTER_INSIGHT] + type: Required[Literal[InsightType.AGENT_CLUSTER_INSIGHT]] class azure.ai.projects.types.AgentClusterInsightResult(TypedDict, total=False): - key "clusterInsight": Required[ClusterInsightResult] - key "type": Required[Literal[InsightType.AGENT_CLUSTER_INSIGHT]] - clusterInsight: ClusterInsightResult - type: Literal[InsightType.AGENT_CLUSTER_INSIGHT] + clusterInsight: Required[ClusterInsightResult] + type: Required[Literal[InsightType.AGENT_CLUSTER_INSIGHT]] class azure.ai.projects.types.AgentDataGenerationJobSource(TypedDict, total=False): - key "agent_name": Required[str] key "agent_version": str key "description": str - key "type": Required[Literal[DataGenerationJobSourceType.AGENT]] - agent_name: str + agent_name: Required[str] agent_version: str description: str - type: Literal[DataGenerationJobSourceType.AGENT] + type: Required[Literal[DataGenerationJobSourceType.AGENT]] class azure.ai.projects.types.AgentEndpointAuthorizationSchemeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -16253,22 +16312,21 @@ namespace azure.ai.projects.types class azure.ai.projects.types.AgentEndpointConfig(TypedDict, total=False): - key "protocol_configuration": ForwardRef('ProtocolConfiguration', module='types') - key "version_selector": ForwardRef('VersionSelector', module='types') + key "authorization_schemes": list[AgentEndpointAuthorizationScheme] + key "protocol_configuration": ForwardRef('ProtocolConfiguration') + key "version_selector": ForwardRef('VersionSelector') authorization_schemes: list[AgentEndpointAuthorizationScheme] protocol_configuration: ProtocolConfiguration version_selector: VersionSelector class azure.ai.projects.types.AgentEvaluatorGenerationJobSource(TypedDict, total=False): - key "agent_name": Required[str] key "agent_version": str key "description": str - key "type": Required[Literal[EvaluatorGenerationJobSourceType.AGENT]] - agent_name: str + agent_name: Required[str] agent_version: str description: str - type: Literal[EvaluatorGenerationJobSourceType.AGENT] + type: Required[Literal[EvaluatorGenerationJobSourceType.AGENT]] class azure.ai.projects.types.AgentKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -16280,28 +16338,24 @@ namespace azure.ai.projects.types class azure.ai.projects.types.AgentOptimizationCandidate(TypedDict, total=False): - key "avg_score": Required[float] - key "avg_tokens": Required[float] key "candidate_id": str key "eval_id": str key "eval_run_id": str - key "name": Required[str] - key "promotion": ForwardRef('PromotionInfo', module='types') - avg_score: float - avg_tokens: float + key "mutations": dict[str, Any] + key "promotion": ForwardRef('PromotionInfo') + avg_score: Required[float] + avg_tokens: Required[float] candidate_id: str eval_id: str eval_run_id: str mutations: dict[str, Any] - name: str + name: Required[str] promotion: PromotionInfo class azure.ai.projects.types.AgentOptimizationDatasetCriterion(TypedDict, total=False): - key "instruction": Required[str] - key "name": Required[str] - instruction: str - name: str + instruction: Required[str] + name: Required[str] class azure.ai.projects.types.AgentOptimizationDatasetInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -16310,6 +16364,7 @@ namespace azure.ai.projects.types class azure.ai.projects.types.AgentOptimizationDatasetItem(TypedDict, total=False): + key "criteria": list[AgentOptimizationDatasetCriterion] key "desired_num_turns": int key "ground_truth": str key "query": str @@ -16320,64 +16375,53 @@ namespace azure.ai.projects.types class azure.ai.projects.types.AgentOptimizationEvaluatorRef(TypedDict, total=False): - key "name": Required[str] key "version": str - name: str + name: Required[str] version: str class azure.ai.projects.types.AgentOptimizationInlineDatasetInput(TypedDict, total=False): - key "items": Required[list[AgentOptimizationDatasetItem]] - key "type": Required[Literal[AgentOptimizationDatasetInputType.INLINE]] - items: list[AgentOptimizationDatasetItem] - type: Literal[AgentOptimizationDatasetInputType.INLINE] + items: Required[list[AgentOptimizationDatasetItem]] + type: Required[Literal[AgentOptimizationDatasetInputType.INLINE]] class azure.ai.projects.types.AgentOptimizationJob(TypedDict, total=False): - key "created_at": Required[int] - key "error": ForwardRef('ApiError', module='types') - key "id": Required[str] - key "inputs": ForwardRef('AgentOptimizationJobInputs', module='types') - key "progress": ForwardRef('AgentOptimizationJobProgress', module='types') - key "result": ForwardRef('AgentOptimizationJobResult', module='types') - key "status": Required[Union[str, JobStatus]] - key "updated_at": Required[int] - created_at: int + key "error": ForwardRef('ApiError') + key "inputs": ForwardRef('AgentOptimizationJobInputs') + key "progress": ForwardRef('AgentOptimizationJobProgress') + key "result": ForwardRef('AgentOptimizationJobResult') + key "warnings": list[str] + created_at: Required[int] error: ApiError - id: str + id: Required[str] inputs: AgentOptimizationJobInputs progress: AgentOptimizationJobProgress result: AgentOptimizationJobResult - status: Union[str, JobStatus] - updated_at: int + status: Required[Union[str, JobStatus]] + updated_at: Required[int] warnings: list[str] class azure.ai.projects.types.AgentOptimizationJobInputs(TypedDict, total=False): - key "agent": Required[OptimizedAgentIdentifier] - key "evaluators": Required[list[AgentOptimizationEvaluatorRef]] - key "options": ForwardRef('AgentOptimizationOptions', module='types') - key "train_dataset": Required[AgentOptimizationDatasetInput] - key "validation_dataset": ForwardRef('AgentOptimizationDatasetInput', module='types') - agent: OptimizedAgentIdentifier - evaluators: list[AgentOptimizationEvaluatorRef] + key "options": ForwardRef('AgentOptimizationOptions') + key "validation_dataset": ForwardRef('AgentOptimizationDatasetInput') + agent: Required[OptimizedAgentIdentifier] + evaluators: Required[list[AgentOptimizationEvaluatorRef]] options: AgentOptimizationOptions - train_dataset: AgentOptimizationDatasetInput + train_dataset: Required[AgentOptimizationDatasetInput] validation_dataset: AgentOptimizationDatasetInput class azure.ai.projects.types.AgentOptimizationJobProgress(TypedDict, total=False): - key "best_score": Required[float] - key "candidates_completed": Required[int] - key "elapsed_seconds": Required[float] - best_score: float - candidates_completed: int - elapsed_seconds: float + best_score: Required[float] + candidates_completed: Required[int] + elapsed_seconds: Required[float] class azure.ai.projects.types.AgentOptimizationJobResult(TypedDict, total=False): key "baseline": str key "best": str + key "candidates": list[AgentOptimizationCandidate] baseline: str best: str candidates: list[AgentOptimizationCandidate] @@ -16388,6 +16432,7 @@ namespace azure.ai.projects.types key "evaluation_level": Union[str, EvaluationLevel] key "max_candidates": int key "max_stalls": int + key "optimization_config": dict[str, Any] key "optimization_model": str eval_model: str evaluation_level: Union[str, EvaluationLevel] @@ -16398,42 +16443,37 @@ namespace azure.ai.projects.types class azure.ai.projects.types.AgentOptimizationReferenceDatasetInput(TypedDict, total=False): - key "name": Required[str] - key "type": Required[Literal[AgentOptimizationDatasetInputType.REFERENCE]] key "version": str - name: str - type: Literal[AgentOptimizationDatasetInputType.REFERENCE] + name: Required[str] + type: Required[Literal[AgentOptimizationDatasetInputType.REFERENCE]] version: str class azure.ai.projects.types.AgentTaxonomyInput(TypedDict, total=False): - key "riskCategories": Required[list[Union[str, RiskCategory]]] - key "target": Required[EvaluationTarget] - key "type": Required[Literal[EvaluationTaxonomyInputType.AGENT]] - riskCategories: list[Union[str, RiskCategory]] - target: EvaluationTarget - type: Literal[EvaluationTaxonomyInputType.AGENT] + riskCategories: Required[list[Union[str, RiskCategory]]] + target: Required[EvaluationTarget] + type: Required[Literal[EvaluationTaxonomyInputType.AGENT]] class azure.ai.projects.types.ApiError(TypedDict, total=False): - key "code": Required[Optional[str]] - key "message": Required[str] + key "additionalInfo": dict[str, Any] + key "debugInfo": dict[str, Any] + key "details": list[ApiError] key "param": Optional[str] key "type": str additionalInfo: dict[str, Any] - code: str + code: Required[Optional[str]] debugInfo: dict[str, Any] details: list[ApiError] - message: str + message: Required[str] param: str type: str class azure.ai.projects.types.ApplyPatchToolParam(TypedDict, total=False): key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] - key "type": Required[Literal[ToolType.APPLY_PATCH]] allowed_callers: list[Union[str, CallableToolAllowedCaller]] - type: Literal[ToolType.APPLY_PATCH] + type: Required[Literal[ToolType.APPLY_PATCH]] class azure.ai.projects.types.ApproximateLocation(TypedDict, total=False): @@ -16441,291 +16481,248 @@ namespace azure.ai.projects.types key "country": Optional[str] key "region": Optional[str] key "timezone": Optional[str] - key "type": Required[Literal["approximate"]] city: str country: str region: str timezone: str - type: Literal[approximate] + type: Required[Literal["approximate"]] class azure.ai.projects.types.ArtifactProfile(TypedDict, total=False): - key "category": Required[Union[str, FoundryModelArtifactProfileCategory]] - category: Union[str, FoundryModelArtifactProfileCategory] + key "signals": list[Union[str, FoundryModelArtifactProfileSignal]] + category: Required[Union[str, FoundryModelArtifactProfileCategory]] signals: list[Union[str, FoundryModelArtifactProfileSignal]] class azure.ai.projects.types.AutoCodeInterpreterToolParam(TypedDict, total=False): + key "file_ids": list[str] key "memory_limit": Optional[Union[str, ContainerMemoryLimit]] - key "network_policy": ForwardRef('ContainerNetworkPolicyParam', module='types') - key "type": Required[Literal["auto"]] + key "network_policy": ForwardRef('ContainerNetworkPolicyParam') file_ids: list[str] memory_limit: Union[str, ContainerMemoryLimit] network_policy: ContainerNetworkPolicyParam - type: Literal[auto] + type: Required[Literal["auto"]] class azure.ai.projects.types.AzureAIAgentTarget(TypedDict, total=False): - key "name": Required[str] - key "type": Required[Literal["azure_ai_agent"]] + key "tool_descriptions": list[ToolDescription] + key "tools": list[Tool] key "version": str - name: str + name: Required[str] tool_descriptions: list[ToolDescription] tools: list[Tool] - type: Literal[azure_ai_agent] + type: Required[Literal["azure_ai_agent"]] version: str class azure.ai.projects.types.AzureAIModelTarget(TypedDict, total=False): key "model": str - key "sampling_params": ForwardRef('ModelSamplingParams', module='types') - key "type": Required[Literal["azure_ai_model"]] + key "sampling_params": ForwardRef('ModelSamplingParams') model: str sampling_params: ModelSamplingParams - type: Literal[azure_ai_model] + type: Required[Literal["azure_ai_model"]] class azure.ai.projects.types.AzureAISearchIndex(TypedDict, total=False): - key "connectionName": Required[str] key "description": str - key "fieldMapping": ForwardRef('FieldMapping', module='types') + key "fieldMapping": ForwardRef('FieldMapping') key "id": str - key "indexName": Required[str] - key "name": Required[str] - key "type": Required[Literal[IndexType.AZURE_SEARCH]] - key "version": Required[str] - connectionName: str + key "tags": dict[str, str] + connectionName: Required[str] description: str fieldMapping: FieldMapping id: str - indexName: str - name: str + indexName: Required[str] + name: Required[str] tags: dict[str, str] - type: Literal[IndexType.AZURE_SEARCH] - version: str + type: Required[Literal[IndexType.AZURE_SEARCH]] + version: Required[str] class azure.ai.projects.types.AzureAISearchTool(TypedDict, total=False): - key "azure_ai_search": Required[AzureAISearchToolResource] key "description": str key "name": str - key "type": Required[Literal[ToolType.AZURE_AI_SEARCH]] - azure_ai_search: AzureAISearchToolResource + key "tool_configs": dict[str, ToolConfig] + azure_ai_search: Required[AzureAISearchToolResource] description: str name: str tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.AZURE_AI_SEARCH] + type: Required[Literal[ToolType.AZURE_AI_SEARCH]] class azure.ai.projects.types.AzureAISearchToolResource(TypedDict, total=False): - key "indexes": Required[list[AISearchIndexResource]] - indexes: list[AISearchIndexResource] + indexes: Required[list[AISearchIndexResource]] class azure.ai.projects.types.AzureAISearchToolboxTool(TypedDict, total=False): - key "azure_ai_search": Required[AzureAISearchToolResource] key "description": str key "name": str - key "type": Required[Literal[ToolboxToolType.AZURE_AI_SEARCH]] - azure_ai_search: AzureAISearchToolResource + key "tool_configs": dict[str, ToolConfig] + azure_ai_search: Required[AzureAISearchToolResource] description: str name: str tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.AZURE_AI_SEARCH] + type: Required[Literal[ToolboxToolType.AZURE_AI_SEARCH]] class azure.ai.projects.types.AzureFunctionBinding(TypedDict, total=False): - key "storage_queue": Required[AzureFunctionStorageQueue] - key "type": Required[Literal["storage_queue"]] - storage_queue: AzureFunctionStorageQueue - type: Literal[storage_queue] + storage_queue: Required[AzureFunctionStorageQueue] + type: Required[Literal["storage_queue"]] class azure.ai.projects.types.AzureFunctionDefinition(TypedDict, total=False): - key "function": Required[AzureFunctionDefinitionFunction] - key "input_binding": Required[AzureFunctionBinding] - key "output_binding": Required[AzureFunctionBinding] - function: AzureFunctionDefinitionFunction - input_binding: AzureFunctionBinding - output_binding: AzureFunctionBinding + function: Required[AzureFunctionDefinitionFunction] + input_binding: Required[AzureFunctionBinding] + output_binding: Required[AzureFunctionBinding] class azure.ai.projects.types.AzureFunctionDefinitionFunction(TypedDict, total=False): key "description": str - key "name": Required[str] - key "parameters": Required[dict[str, Any]] description: str - name: str - parameters: dict[str, Any] + name: Required[str] + parameters: Required[dict[str, Any]] class azure.ai.projects.types.AzureFunctionStorageQueue(TypedDict, total=False): - key "queue_name": Required[str] - key "queue_service_endpoint": Required[str] - queue_name: str - queue_service_endpoint: str + queue_name: Required[str] + queue_service_endpoint: Required[str] class azure.ai.projects.types.AzureFunctionTool(TypedDict, total=False): - key "azure_function": Required[AzureFunctionDefinition] - key "type": Required[Literal[ToolType.AZURE_FUNCTION]] - azure_function: AzureFunctionDefinition + key "tool_configs": dict[str, ToolConfig] + azure_function: Required[AzureFunctionDefinition] tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.AZURE_FUNCTION] + type: Required[Literal[ToolType.AZURE_FUNCTION]] class azure.ai.projects.types.AzureOpenAIModelConfiguration(TypedDict, total=False): - key "modelDeploymentName": Required[str] - key "type": Required[Literal["AzureOpenAIModel"]] - modelDeploymentName: str - type: Literal[AzureOpenAIModel] + modelDeploymentName: Required[str] + type: Required[Literal["AzureOpenAIModel"]] class azure.ai.projects.types.BingCustomSearchConfiguration(TypedDict, total=False): key "count": int key "freshness": str - key "instance_name": Required[str] key "market": str - key "project_connection_id": Required[str] key "set_lang": str count: int freshness: str - instance_name: str + instance_name: Required[str] market: str - project_connection_id: str + project_connection_id: Required[str] set_lang: str class azure.ai.projects.types.BingCustomSearchPreviewTool(TypedDict, total=False): - key "bing_custom_search_preview": Required[BingCustomSearchToolParameters] - key "type": Required[Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW]] - bing_custom_search_preview: BingCustomSearchToolParameters - type: Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW] + bing_custom_search_preview: Required[BingCustomSearchToolParameters] + type: Required[Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW]] class azure.ai.projects.types.BingCustomSearchToolParameters(TypedDict, total=False): - key "search_configurations": Required[list[BingCustomSearchConfiguration]] - search_configurations: list[BingCustomSearchConfiguration] + search_configurations: Required[list[BingCustomSearchConfiguration]] class azure.ai.projects.types.BingGroundingSearchConfiguration(TypedDict, total=False): key "count": int key "freshness": str key "market": str - key "project_connection_id": Required[str] key "set_lang": str count: int freshness: str market: str - project_connection_id: str + project_connection_id: Required[str] set_lang: str class azure.ai.projects.types.BingGroundingSearchToolParameters(TypedDict, total=False): - key "search_configurations": Required[list[BingGroundingSearchConfiguration]] - search_configurations: list[BingGroundingSearchConfiguration] + search_configurations: Required[list[BingGroundingSearchConfiguration]] class azure.ai.projects.types.BingGroundingTool(TypedDict, total=False): - key "bing_grounding": Required[BingGroundingSearchToolParameters] key "description": str key "name": str - key "type": Required[Literal[ToolType.BING_GROUNDING]] - bing_grounding: BingGroundingSearchToolParameters + key "tool_configs": dict[str, ToolConfig] + bing_grounding: Required[BingGroundingSearchToolParameters] description: str name: str tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.BING_GROUNDING] + type: Required[Literal[ToolType.BING_GROUNDING]] class azure.ai.projects.types.BotServiceAuthorizationScheme(TypedDict, total=False): - key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE]] - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE] + type: Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE]] class azure.ai.projects.types.BotServiceRbacAuthorizationScheme(TypedDict, total=False): - key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC]] - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC] + type: Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC]] class azure.ai.projects.types.BotServiceTenantAuthorizationScheme(TypedDict, total=False): - key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT]] - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT] + type: Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT]] class azure.ai.projects.types.BrowserAutomationPreviewTool(TypedDict, total=False): - key "browser_automation_preview": Required[BrowserAutomationToolParameters] - key "type": Required[Literal[ToolType.BROWSER_AUTOMATION_PREVIEW]] - browser_automation_preview: BrowserAutomationToolParameters - type: Literal[ToolType.BROWSER_AUTOMATION_PREVIEW] + browser_automation_preview: Required[BrowserAutomationToolParameters] + type: Required[Literal[ToolType.BROWSER_AUTOMATION_PREVIEW]] class azure.ai.projects.types.BrowserAutomationPreviewToolboxTool(TypedDict, total=False): - key "browser_automation_preview": Required[BrowserAutomationToolParameters] key "description": str key "name": str - key "type": Required[Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW]] - browser_automation_preview: BrowserAutomationToolParameters + key "tool_configs": dict[str, ToolConfig] + browser_automation_preview: Required[BrowserAutomationToolParameters] description: str name: str tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW] + type: Required[Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW]] class azure.ai.projects.types.BrowserAutomationToolConnectionParameters(TypedDict, total=False): - key "project_connection_id": Required[str] - project_connection_id: str + project_connection_id: Required[str] class azure.ai.projects.types.BrowserAutomationToolParameters(TypedDict, total=False): - key "connection": Required[BrowserAutomationToolConnectionParameters] - connection: BrowserAutomationToolConnectionParameters + connection: Required[BrowserAutomationToolConnectionParameters] class azure.ai.projects.types.CaptureStructuredOutputsTool(TypedDict, total=False): key "description": str key "name": str - key "outputs": Required[StructuredOutputDefinition] - key "type": Required[Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS]] + key "tool_configs": dict[str, ToolConfig] description: str name: str - outputs: StructuredOutputDefinition + outputs: Required[StructuredOutputDefinition] tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS] + type: Required[Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS]] class azure.ai.projects.types.ChartCoordinate(TypedDict, total=False): - key "size": Required[int] - key "x": Required[int] - key "y": Required[int] - size: int - x: int - y: int + size: Required[int] + x: Required[int] + y: Required[int] class azure.ai.projects.types.ClusterInsightResult(TypedDict, total=False): - key "clusters": Required[list[InsightCluster]] - key "summary": Required[InsightSummary] - clusters: list[InsightCluster] + key "coordinates": dict[str, ChartCoordinate] + clusters: Required[list[InsightCluster]] coordinates: dict[str, ChartCoordinate] - summary: InsightSummary + summary: Required[InsightSummary] class azure.ai.projects.types.ClusterTokenUsage(TypedDict, total=False): - key "inputTokenUsage": Required[int] - key "outputTokenUsage": Required[int] - key "totalTokenUsage": Required[int] - inputTokenUsage: int - outputTokenUsage: int - totalTokenUsage: int + inputTokenUsage: Required[int] + outputTokenUsage: Required[int] + totalTokenUsage: Required[int] class azure.ai.projects.types.CodeBasedEvaluatorDefinition(TypedDict, total=False): key "blob_uri": str key "code_text": str + key "data_schema": dict[str, Any] key "entry_point": str key "image_tag": str - key "type": Required[Literal[EvaluatorDefinitionType.CODE]] + key "init_parameters": dict[str, Any] + key "metrics": dict[str, EvaluatorMetric] blob_uri: str code_text: str data_schema: dict[str, Any] @@ -16733,18 +16730,15 @@ namespace azure.ai.projects.types image_tag: str init_parameters: dict[str, Any] metrics: dict[str, EvaluatorMetric] - type: Literal[EvaluatorDefinitionType.CODE] + type: Required[Literal[EvaluatorDefinitionType.CODE]] class azure.ai.projects.types.CodeConfiguration(TypedDict, total=False): key "content_hash": str - key "dependency_resolution": Required[Union[str, CodeDependencyResolution]] - key "entry_point": Required[list[str]] - key "runtime": Required[str] content_hash: str - dependency_resolution: Union[str, CodeDependencyResolution] - entry_point: list[str] - runtime: str + dependency_resolution: Required[Union[str, CodeDependencyResolution]] + entry_point: Required[list[str]] + runtime: Required[str] class azure.ai.projects.types.CodeInterpreterTool(TypedDict, total=False): @@ -16752,13 +16746,13 @@ namespace azure.ai.projects.types key "container": Union[str, AutoCodeInterpreterToolParam] key "description": str key "name": str - key "type": Required[Literal[ToolType.CODE_INTERPRETER]] + key "tool_configs": dict[str, ToolConfig] allowed_callers: list[Union[str, CallableToolAllowedCaller]] container: Union[str, AutoCodeInterpreterToolParam] description: str name: str tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.CODE_INTERPRETER] + type: Required[Literal[ToolType.CODE_INTERPRETER]] class azure.ai.projects.types.CodeInterpreterToolboxTool(TypedDict, total=False): @@ -16766,83 +16760,68 @@ namespace azure.ai.projects.types key "container": Union[str, AutoCodeInterpreterToolParam] key "description": str key "name": str - key "type": Required[Literal[ToolboxToolType.CODE_INTERPRETER]] + key "tool_configs": dict[str, ToolConfig] allowed_callers: list[Union[str, CallableToolAllowedCaller]] container: Union[str, AutoCodeInterpreterToolParam] description: str name: str tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.CODE_INTERPRETER] + type: Required[Literal[ToolboxToolType.CODE_INTERPRETER]] class azure.ai.projects.types.ComparisonFilter(TypedDict, total=False): - key "key": Required[str] - key "type": Required[Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]] - key "value": Required[Union[str, float, bool, list[Union[str, float]]]] - key: str - type: Literal[eq, ne, gt, gte, lt, lte, in, nin] - value: Union[str, float, bool, list[Union[str, float]]] + key: Required[str] + type: Required[Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]] + value: Required[Union[str, float, bool, list[Union[str, float]]]] class azure.ai.projects.types.CompoundFilter(TypedDict, total=False): - key "filters": Required[list[Union[ComparisonFilter, Any]]] - key "type": Required[Literal["and", "or"]] - filters: list[Union[ComparisonFilter, Any]] - type: Literal[and, or] + filters: Required[list[Union[ComparisonFilter, Any]]] + type: Required[Literal["and", "or"]] class azure.ai.projects.types.ComputerTool(TypedDict, total=False): - key "type": Required[Literal[ToolType.COMPUTER]] - type: Literal[ToolType.COMPUTER] + type: Required[Literal[ToolType.COMPUTER]] class azure.ai.projects.types.ComputerUsePreviewTool(TypedDict, total=False): - key "display_height": Required[int] - key "display_width": Required[int] - key "environment": Required[Union[str, ComputerEnvironment]] - key "type": Required[Literal[ToolType.COMPUTER_USE_PREVIEW]] - display_height: int - display_width: int - environment: Union[str, ComputerEnvironment] - type: Literal[ToolType.COMPUTER_USE_PREVIEW] + display_height: Required[int] + display_width: Required[int] + environment: Required[Union[str, ComputerEnvironment]] + type: Required[Literal[ToolType.COMPUTER_USE_PREVIEW]] class azure.ai.projects.types.ContainerAutoParam(TypedDict, total=False): + key "file_ids": list[str] key "memory_limit": Optional[Union[str, ContainerMemoryLimit]] - key "network_policy": ForwardRef('ContainerNetworkPolicyParam', module='types') - key "type": Required[Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO]] + key "network_policy": ForwardRef('ContainerNetworkPolicyParam') + key "skills": list[ContainerSkill] file_ids: list[str] memory_limit: Union[str, ContainerMemoryLimit] network_policy: ContainerNetworkPolicyParam skills: list[ContainerSkill] - type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO] + type: Required[Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO]] class azure.ai.projects.types.ContainerConfiguration(TypedDict, total=False): - key "image": Required[str] - image: str + image: Required[str] class azure.ai.projects.types.ContainerNetworkPolicyAllowlistParam(TypedDict, total=False): - key "allowed_domains": Required[list[str]] - key "type": Required[Literal[ContainerNetworkPolicyParamType.ALLOWLIST]] - allowed_domains: list[str] + key "domain_secrets": list[ContainerNetworkPolicyDomainSecretParam] + allowed_domains: Required[list[str]] domain_secrets: list[ContainerNetworkPolicyDomainSecretParam] - type: Literal[ContainerNetworkPolicyParamType.ALLOWLIST] + type: Required[Literal[ContainerNetworkPolicyParamType.ALLOWLIST]] class azure.ai.projects.types.ContainerNetworkPolicyDisabledParam(TypedDict, total=False): - key "type": Required[Literal[ContainerNetworkPolicyParamType.DISABLED]] - type: Literal[ContainerNetworkPolicyParamType.DISABLED] + type: Required[Literal[ContainerNetworkPolicyParamType.DISABLED]] class azure.ai.projects.types.ContainerNetworkPolicyDomainSecretParam(TypedDict, total=False): - key "domain": Required[str] - key "name": Required[str] - key "value": Required[str] - domain: str - name: str - value: str + domain: Required[str] + name: Required[str] + value: Required[str] class azure.ai.projects.types.ContainerNetworkPolicyParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -16856,85 +16835,72 @@ namespace azure.ai.projects.types class azure.ai.projects.types.ContinuousEvaluationRuleAction(TypedDict, total=False): - key "evalId": Required[str] key "maxHourlyRuns": int key "samplingRate": float - key "type": Required[Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION]] - evalId: str + evalId: Required[str] maxHourlyRuns: int samplingRate: float - type: Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION] + type: Required[Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION]] class azure.ai.projects.types.CosmosDBIndex(TypedDict, total=False): - key "connectionName": Required[str] - key "containerName": Required[str] - key "databaseName": Required[str] key "description": str - key "embeddingConfiguration": Required[EmbeddingConfiguration] - key "fieldMapping": Required[FieldMapping] key "id": str - key "name": Required[str] - key "type": Required[Literal[IndexType.COSMOS_DB]] - key "version": Required[str] - connectionName: str - containerName: str - databaseName: str + key "tags": dict[str, str] + connectionName: Required[str] + containerName: Required[str] + databaseName: Required[str] description: str - embeddingConfiguration: EmbeddingConfiguration - fieldMapping: FieldMapping + embeddingConfiguration: Required[EmbeddingConfiguration] + fieldMapping: Required[FieldMapping] id: str - name: str + name: Required[str] tags: dict[str, str] - type: Literal[IndexType.COSMOS_DB] - version: str + type: Required[Literal[IndexType.COSMOS_DB]] + version: Required[str] class azure.ai.projects.types.CreateAgentVersionFromManifestRequest(TypedDict, total=False): key "description": str - key "manifest_id": Required[str] - key "parameter_values": Required[dict[str, Any]] + key "metadata": dict[str, str] description: str - manifest_id: str + manifest_id: Required[str] metadata: dict[str, str] - parameter_values: dict[str, Any] + parameter_values: Required[dict[str, Any]] class azure.ai.projects.types.CreateAgentVersionRequest(TypedDict, total=False): - key "blueprint_reference": ForwardRef('AgentBlueprintReference', module='types') - key "definition": Required[AgentDefinition] + key "blueprint_reference": ForwardRef('AgentBlueprintReference') key "description": str key "draft": bool + key "metadata": dict[str, str] blueprint_reference: AgentBlueprintReference - definition: AgentDefinition + definition: Required[AgentDefinition] description: str draft: bool metadata: dict[str, str] class azure.ai.projects.types.CreateMemoryRequest(TypedDict, total=False): - key "content": Required[str] - key "kind": Required[Union[str, MemoryItemKind]] - key "scope": Required[str] - content: str - kind: Union[str, MemoryItemKind] - scope: str + content: Required[str] + kind: Required[Union[str, MemoryItemKind]] + scope: Required[str] class azure.ai.projects.types.CreateMemoryStoreRequest(TypedDict, total=False): - key "definition": Required[MemoryStoreDefinition] key "description": str - key "name": Required[str] - definition: MemoryStoreDefinition + key "metadata": dict[str, str] + definition: Required[MemoryStoreDefinition] description: str metadata: dict[str, str] - name: str + name: Required[str] class azure.ai.projects.types.CreateOrUpdateRoutineRequest(TypedDict, total=False): - key "action": ForwardRef('RoutineAction', module='types') + key "action": ForwardRef('RoutineAction') key "description": str key "enabled": bool + key "triggers": dict[str, RoutineTrigger] action: RoutineAction description: str enabled: bool @@ -16943,34 +16909,33 @@ namespace azure.ai.projects.types class azure.ai.projects.types.CreateSessionRequest(TypedDict, total=False): key "agent_session_id": str - key "version_indicator": Required[VersionIndicator] agent_session_id: str - version_indicator: VersionIndicator + version_indicator: Required[VersionIndicator] class azure.ai.projects.types.CreateSkillVersionFromFilesBody(TypedDict, total=False): key "default": bool - key "files": Required[list[Union[str, bytes, IO[str], IO[bytes], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]]], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]], Optional[str]]]]] default: bool - files: list[FileType] + files: Required[list[Union[str, bytes, IO[str], IO[bytes], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]]], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]], Optional[str]]]]] class azure.ai.projects.types.CreateSkillVersionRequest(TypedDict, total=False): key "default": bool - key "inline_content": ForwardRef('SkillInlineContent', module='types') + key "inline_content": ForwardRef('SkillInlineContent') default: bool inline_content: SkillInlineContent class azure.ai.projects.types.CreateToolboxVersionRequest(TypedDict, total=False): key "description": str - key "policies": ForwardRef('ToolboxPolicies', module='types') - key "tools": Required[list[ToolboxTool]] + key "metadata": dict[str, str] + key "policies": ForwardRef('ToolboxPolicies') + key "skills": list[ToolboxSkill] description: str metadata: dict[str, str] policies: ToolboxPolicies skills: list[ToolboxSkill] - tools: list[ToolboxTool] + tools: Required[list[ToolboxTool]] class azure.ai.projects.types.CreateTranscriptionResponseJsonUsageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -16980,55 +16945,44 @@ namespace azure.ai.projects.types class azure.ai.projects.types.CronTrigger(TypedDict, total=False): key "endTime": str - key "expression": Required[str] key "startTime": str key "timeZone": str - key "type": Required[Literal[TriggerType.CRON]] endTime: str - expression: str + expression: Required[str] startTime: str timeZone: str - type: Literal[TriggerType.CRON] + type: Required[Literal[TriggerType.CRON]] class azure.ai.projects.types.CustomGrammarFormatParam(TypedDict, total=False): - key "definition": Required[str] - key "syntax": Required[Union[str, GrammarSyntax1]] - key "type": Required[Literal[CustomToolParamFormatType.GRAMMAR]] - definition: str - syntax: Union[str, GrammarSyntax1] - type: Literal[CustomToolParamFormatType.GRAMMAR] + definition: Required[str] + syntax: Required[Union[str, GrammarSyntax1]] + type: Required[Literal[CustomToolParamFormatType.GRAMMAR]] class azure.ai.projects.types.CustomRoutineTrigger(TypedDict, total=False): key "event_name": str - key "parameters": Required[dict[str, Any]] - key "provider": Required[str] - key "type": Required[Literal[RoutineTriggerType.CUSTOM]] event_name: str - parameters: dict[str, Any] - provider: str - type: Literal[RoutineTriggerType.CUSTOM] + parameters: Required[dict[str, Any]] + provider: Required[str] + type: Required[Literal[RoutineTriggerType.CUSTOM]] class azure.ai.projects.types.CustomTextFormatParam(TypedDict, total=False): - key "type": Required[Literal[CustomToolParamFormatType.TEXT]] - type: Literal[CustomToolParamFormatType.TEXT] + type: Required[Literal[CustomToolParamFormatType.TEXT]] class azure.ai.projects.types.CustomToolParam(TypedDict, total=False): key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] key "defer_loading": bool key "description": str - key "format": ForwardRef('CustomToolParamFormat', module='types') - key "name": Required[str] - key "type": Required[Literal[ToolType.CUSTOM]] + key "format": ForwardRef('CustomToolParamFormat') allowed_callers: list[Union[str, CallableToolAllowedCaller]] defer_loading: bool description: str format: CustomToolParamFormat - name: str - type: Literal[ToolType.CUSTOM] + name: Required[str] + type: Required[Literal[ToolType.CUSTOM]] class azure.ai.projects.types.CustomToolParamFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -17037,45 +16991,37 @@ namespace azure.ai.projects.types class azure.ai.projects.types.DailyRecurrenceSchedule(TypedDict, total=False): - key "hours": Required[list[int]] - key "type": Required[Literal[RecurrenceType.DAILY]] - hours: list[int] - type: Literal[RecurrenceType.DAILY] + hours: Required[list[int]] + type: Required[Literal[RecurrenceType.DAILY]] class azure.ai.projects.types.DataGenerationJob(TypedDict, total=False): - key "created_at": Required[int] - key "error": ForwardRef('ApiError', module='types') + key "error": ForwardRef('ApiError') key "finished_at": int - key "id": Required[str] - key "inputs": ForwardRef('DataGenerationJobInputs', module='types') - key "result": ForwardRef('DataGenerationJobResult', module='types') - key "status": Required[Union[str, JobStatus]] - created_at: int + key "inputs": ForwardRef('DataGenerationJobInputs') + key "result": ForwardRef('DataGenerationJobResult') + created_at: Required[int] error: ApiError finished_at: int - id: str + id: Required[str] inputs: DataGenerationJobInputs result: DataGenerationJobResult - status: Union[str, JobStatus] + status: Required[Union[str, JobStatus]] class azure.ai.projects.types.DataGenerationJobInputs(TypedDict, total=False): - key "name": Required[str] - key "options": Required[DataGenerationJobOptions] - key "output_options": ForwardRef('DataGenerationJobOutputOptions', module='types') - key "scenario": Required[Union[str, DataGenerationJobScenario]] - key "sources": Required[list[DataGenerationJobSource]] - name: str - options: DataGenerationJobOptions + key "output_options": ForwardRef('DataGenerationJobOutputOptions') + name: Required[str] + options: Required[DataGenerationJobOptions] output_options: DataGenerationJobOutputOptions - scenario: Union[str, DataGenerationJobScenario] - sources: list[DataGenerationJobSource] + scenario: Required[Union[str, DataGenerationJobScenario]] + sources: Required[list[DataGenerationJobSource]] class azure.ai.projects.types.DataGenerationJobOutputOptions(TypedDict, total=False): key "description": str key "name": str + key "tags": dict[str, str] description: str name: str tags: dict[str, str] @@ -17087,9 +17033,9 @@ namespace azure.ai.projects.types class azure.ai.projects.types.DataGenerationJobResult(TypedDict, total=False): - key "generated_samples": Required[int] - key "token_usage": ForwardRef('DataGenerationTokenUsage', module='types') - generated_samples: int + key "outputs": list[DataGenerationJobOutput] + key "token_usage": ForwardRef('DataGenerationTokenUsage') + generated_samples: Required[int] outputs: list[DataGenerationJobOutput] token_usage: DataGenerationTokenUsage @@ -17109,49 +17055,41 @@ namespace azure.ai.projects.types class azure.ai.projects.types.DataGenerationModelOptions(TypedDict, total=False): - key "model": Required[str] - model: str + model: Required[str] class azure.ai.projects.types.DataGenerationTokenUsage(TypedDict, total=False): - key "completion_tokens": Required[int] - key "prompt_tokens": Required[int] - key "total_tokens": Required[int] - completion_tokens: int - prompt_tokens: int - total_tokens: int + completion_tokens: Required[int] + prompt_tokens: Required[int] + total_tokens: Required[int] class azure.ai.projects.types.DatasetDataGenerationJobOutput(TypedDict, total=False): key "description": str key "id": str key "name": str - key "type": Required[Literal[DataGenerationJobOutputType.DATASET]] + key "tags": dict[str, str] key "version": str description: str id: str name: str tags: dict[str, str] - type: Literal[DataGenerationJobOutputType.DATASET] + type: Required[Literal[DataGenerationJobOutputType.DATASET]] version: str class azure.ai.projects.types.DatasetEvaluatorGenerationJobSource(TypedDict, total=False): key "description": str - key "name": Required[str] - key "type": Required[Literal[EvaluatorGenerationJobSourceType.DATASET]] key "version": str description: str - name: str - type: Literal[EvaluatorGenerationJobSourceType.DATASET] + name: Required[str] + type: Required[Literal[EvaluatorGenerationJobSourceType.DATASET]] version: str class azure.ai.projects.types.DatasetReference(TypedDict, total=False): - key "name": Required[str] - key "version": Required[str] - name: str - version: str + name: Required[str] + version: Required[str] class azure.ai.projects.types.DatasetType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -17160,149 +17098,108 @@ namespace azure.ai.projects.types class azure.ai.projects.types.DeleteScopeRequest(TypedDict, total=False): - key "scope": Required[str] - scope: str + scope: Required[str] class azure.ai.projects.types.Dimension(TypedDict, total=False): key "always_applicable": bool - key "description": Required[str] - key "id": Required[str] - key "weight": Required[int] always_applicable: bool - description: str - id: str - weight: int + description: Required[str] + id: Required[str] + weight: Required[int] class azure.ai.projects.types.DispatchRoutineAsyncRequest(TypedDict, total=False): - key "payload": ForwardRef('RoutineDispatchPayload', module='types') + key "payload": ForwardRef('RoutineDispatchPayload') payload: RoutineDispatchPayload class azure.ai.projects.types.EmbeddingConfiguration(TypedDict, total=False): - key "embeddingField": Required[str] - key "modelDeploymentName": Required[str] - embeddingField: str - modelDeploymentName: str + embeddingField: Required[str] + modelDeploymentName: Required[str] class azure.ai.projects.types.EmptyModelParam(TypedDict, total=False): class azure.ai.projects.types.EndpointBasedEvaluatorDefinition(TypedDict, total=False): - key "connection_name": Required[str] - key "type": Required[Literal[EvaluatorDefinitionType.ENDPOINT]] - connection_name: str + key "data_schema": dict[str, Any] + key "init_parameters": dict[str, Any] + key "metrics": dict[str, EvaluatorMetric] + connection_name: Required[str] data_schema: dict[str, Any] init_parameters: dict[str, Any] metrics: dict[str, EvaluatorMetric] - type: Literal[EvaluatorDefinitionType.ENDPOINT] + type: Required[Literal[EvaluatorDefinitionType.ENDPOINT]] class azure.ai.projects.types.EntraAuthorizationScheme(TypedDict, total=False): - key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.ENTRA]] - type: Literal[AgentEndpointAuthorizationSchemeType.ENTRA] + type: Required[Literal[AgentEndpointAuthorizationSchemeType.ENTRA]] class azure.ai.projects.types.EvalResult(TypedDict, total=False): - key "name": Required[str] - key "passed": Required[bool] - key "score": Required[float] - key "type": Required[str] - name: str - passed: bool - score: float - type: str + name: Required[str] + passed: Required[bool] + score: Required[float] + type: Required[str] class azure.ai.projects.types.EvalRunResultCompareItem(TypedDict, total=False): - key "deltaEstimate": Required[float] - key "pValue": Required[float] - key "treatmentEffect": Required[Union[str, TreatmentEffectType]] - key "treatmentRunId": Required[str] - key "treatmentRunSummary": Required[EvalRunResultSummary] - deltaEstimate: float - pValue: float - treatmentEffect: Union[str, TreatmentEffectType] - treatmentRunId: str - treatmentRunSummary: EvalRunResultSummary + deltaEstimate: Required[float] + pValue: Required[float] + treatmentEffect: Required[Union[str, TreatmentEffectType]] + treatmentRunId: Required[str] + treatmentRunSummary: Required[EvalRunResultSummary] class azure.ai.projects.types.EvalRunResultComparison(TypedDict, total=False): - key "baselineRunSummary": Required[EvalRunResultSummary] - key "compareItems": Required[list[EvalRunResultCompareItem]] - key "evaluator": Required[str] - key "metric": Required[str] - key "testingCriteria": Required[str] - baselineRunSummary: EvalRunResultSummary - compareItems: list[EvalRunResultCompareItem] - evaluator: str - metric: str - testingCriteria: str + baselineRunSummary: Required[EvalRunResultSummary] + compareItems: Required[list[EvalRunResultCompareItem]] + evaluator: Required[str] + metric: Required[str] + testingCriteria: Required[str] class azure.ai.projects.types.EvalRunResultSummary(TypedDict, total=False): - key "average": Required[float] - key "runId": Required[str] - key "sampleCount": Required[int] - key "standardDeviation": Required[float] - average: float - runId: str - sampleCount: int - standardDeviation: float + average: Required[float] + runId: Required[str] + sampleCount: Required[int] + standardDeviation: Required[float] class azure.ai.projects.types.EvaluationComparisonInsightRequest(TypedDict, total=False): - key "baselineRunId": Required[str] - key "evalId": Required[str] - key "treatmentRunIds": Required[list[str]] - key "type": Required[Literal[InsightType.EVALUATION_COMPARISON]] - baselineRunId: str - evalId: str - treatmentRunIds: list[str] - type: Literal[InsightType.EVALUATION_COMPARISON] + baselineRunId: Required[str] + evalId: Required[str] + treatmentRunIds: Required[list[str]] + type: Required[Literal[InsightType.EVALUATION_COMPARISON]] class azure.ai.projects.types.EvaluationComparisonInsightResult(TypedDict, total=False): - key "comparisons": Required[list[EvalRunResultComparison]] - key "method": Required[str] - key "type": Required[Literal[InsightType.EVALUATION_COMPARISON]] - comparisons: list[EvalRunResultComparison] - method: str - type: Literal[InsightType.EVALUATION_COMPARISON] + comparisons: Required[list[EvalRunResultComparison]] + method: Required[str] + type: Required[Literal[InsightType.EVALUATION_COMPARISON]] class azure.ai.projects.types.EvaluationResultSample(TypedDict, total=False): - key "correlationInfo": Required[dict[str, Any]] - key "evaluationResult": Required[EvalResult] - key "features": Required[dict[str, Any]] - key "id": Required[str] - key "type": Required[Literal[SampleType.EVALUATION_RESULT_SAMPLE]] - correlationInfo: dict[str, Any] - evaluationResult: EvalResult - features: dict[str, Any] - id: str - type: Literal[SampleType.EVALUATION_RESULT_SAMPLE] + correlationInfo: Required[dict[str, Any]] + evaluationResult: Required[EvalResult] + features: Required[dict[str, Any]] + id: Required[str] + type: Required[Literal[SampleType.EVALUATION_RESULT_SAMPLE]] class azure.ai.projects.types.EvaluationRule(TypedDict, total=False): - key "action": Required[EvaluationRuleAction] key "description": str key "displayName": str - key "enabled": Required[bool] - key "eventType": Required[Union[str, EvaluationRuleEventType]] - key "filter": ForwardRef('EvaluationRuleFilter', module='types') - key "id": Required[str] - key "systemData": Required[dict[str, str]] - action: EvaluationRuleAction + key "filter": ForwardRef('EvaluationRuleFilter') + action: Required[EvaluationRuleAction] description: str displayName: str - enabled: bool - eventType: Union[str, EvaluationRuleEventType] + enabled: Required[bool] + eventType: Required[Union[str, EvaluationRuleEventType]] filter: EvaluationRuleFilter - id: str - systemData: dict[str, str] + id: Required[str] + systemData: Required[dict[str, str]] class azure.ai.projects.types.EvaluationRuleActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -17311,61 +17208,50 @@ namespace azure.ai.projects.types class azure.ai.projects.types.EvaluationRuleFilter(TypedDict, total=False): - key "agentName": Required[str] - agentName: str + agentName: Required[str] class azure.ai.projects.types.EvaluationRunClusterInsightRequest(TypedDict, total=False): - key "evalId": Required[str] - key "modelConfiguration": ForwardRef('InsightModelConfiguration', module='types') - key "runIds": Required[list[str]] - key "type": Required[Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT]] - evalId: str + key "modelConfiguration": ForwardRef('InsightModelConfiguration') + evalId: Required[str] modelConfiguration: InsightModelConfiguration - runIds: list[str] - type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] + runIds: Required[list[str]] + type: Required[Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT]] class azure.ai.projects.types.EvaluationRunClusterInsightResult(TypedDict, total=False): - key "clusterInsight": Required[ClusterInsightResult] - key "type": Required[Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT]] - clusterInsight: ClusterInsightResult - type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] + clusterInsight: Required[ClusterInsightResult] + type: Required[Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT]] class azure.ai.projects.types.EvaluationScheduleTask(TypedDict, total=False): - key "evalId": Required[str] - key "evalRun": Required[dict[str, Any]] - key "type": Required[Literal[ScheduleTaskType.EVALUATION]] + key "configuration": dict[str, str] configuration: dict[str, str] - evalId: str - evalRun: dict[str, Any] - type: Literal[ScheduleTaskType.EVALUATION] + evalId: Required[str] + evalRun: Required[dict[str, Any]] + type: Required[Literal[ScheduleTaskType.EVALUATION]] class azure.ai.projects.types.EvaluationTaxonomy(TypedDict, total=False): key "description": str key "id": str - key "name": Required[str] - key "taxonomyInput": Required[EvaluationTaxonomyInput] - key "version": Required[str] + key "properties": dict[str, str] + key "tags": dict[str, str] + key "taxonomyCategories": list[TaxonomyCategory] description: str id: str - name: str + name: Required[str] properties: dict[str, str] tags: dict[str, str] taxonomyCategories: list[TaxonomyCategory] - taxonomyInput: EvaluationTaxonomyInput - version: str + taxonomyInput: Required[EvaluationTaxonomyInput] + version: Required[str] class azure.ai.projects.types.EvaluationTaxonomyInput(TypedDict, total=False): - key "riskCategories": Required[list[Union[str, RiskCategory]]] - key "target": Required[EvaluationTarget] - key "type": Required[Literal[EvaluationTaxonomyInputType.AGENT]] - riskCategories: list[Union[str, RiskCategory]] - target: EvaluationTarget - type: Literal[EvaluationTaxonomyInputType.AGENT] + riskCategories: Required[list[Union[str, RiskCategory]]] + target: Required[EvaluationTarget] + type: Required[Literal[EvaluationTaxonomyInputType.AGENT]] class azure.ai.projects.types.EvaluationTaxonomyInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -17374,8 +17260,7 @@ namespace azure.ai.projects.types class azure.ai.projects.types.EvaluatorCredentialRequest(TypedDict, total=False): - key "blob_uri": Required[str] - blob_uri: str + blob_uri: Required[str] class azure.ai.projects.types.EvaluatorDefinitionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -17389,42 +17274,35 @@ namespace azure.ai.projects.types class azure.ai.projects.types.EvaluatorGenerationArtifacts(TypedDict, total=False): - key "dataset": Required[DatasetReference] - key "kinds": Required[list[str]] - dataset: DatasetReference - kinds: list[str] + dataset: Required[DatasetReference] + kinds: Required[list[str]] class azure.ai.projects.types.EvaluatorGenerationInputs(TypedDict, total=False): key "evaluator_description": str key "evaluator_display_name": str - key "evaluator_name": Required[str] - key "model": Required[str] - key "sources": Required[list[EvaluatorGenerationJobSource]] evaluator_description: str evaluator_display_name: str - evaluator_name: str - model: str - sources: list[EvaluatorGenerationJobSource] + evaluator_name: Required[str] + model: Required[str] + sources: Required[list[EvaluatorGenerationJobSource]] class azure.ai.projects.types.EvaluatorGenerationJob(TypedDict, total=False): - key "created_at": Required[int] - key "error": ForwardRef('ApiError', module='types') + key "error": ForwardRef('ApiError') key "finished_at": int - key "id": Required[str] - key "inputs": ForwardRef('EvaluatorGenerationInputs', module='types') - key "result": ForwardRef('EvaluatorVersion', module='types') - key "status": Required[Union[str, JobStatus]] - key "usage": ForwardRef('EvaluatorGenerationTokenUsage', module='types') - created_at: int + key "input_quality_warnings": list[RubricGenerationInputQualityWarning] + key "inputs": ForwardRef('EvaluatorGenerationInputs') + key "result": ForwardRef('EvaluatorVersion') + key "usage": ForwardRef('EvaluatorGenerationTokenUsage') + created_at: Required[int] error: ApiError finished_at: int - id: str + id: Required[str] input_quality_warnings: list[RubricGenerationInputQualityWarning] inputs: EvaluatorGenerationInputs result: EvaluatorVersion - status: Union[str, JobStatus] + status: Required[Union[str, JobStatus]] usage: EvaluatorGenerationTokenUsage @@ -17436,12 +17314,9 @@ namespace azure.ai.projects.types class azure.ai.projects.types.EvaluatorGenerationTokenUsage(TypedDict, total=False): - key "input_tokens": Required[int] - key "output_tokens": Required[int] - key "total_tokens": Required[int] - input_tokens: int - output_tokens: int - total_tokens: int + input_tokens: Required[int] + output_tokens: Required[int] + total_tokens: Required[int] class azure.ai.projects.types.EvaluatorMetric(TypedDict, total=False): @@ -17460,88 +17335,82 @@ namespace azure.ai.projects.types class azure.ai.projects.types.EvaluatorVersion(TypedDict, total=False): - key "categories": Required[list[Union[str, EvaluatorCategory]]] - key "created_at": Required[str] - key "created_by": Required[str] - key "definition": Required[EvaluatorDefinition] key "description": str key "display_name": str - key "evaluator_type": Required[Union[str, EvaluatorType]] - key "generation_artifacts": ForwardRef('EvaluatorGenerationArtifacts', module='types') + key "generation_artifacts": ForwardRef('EvaluatorGenerationArtifacts') key "generation_job_id": str key "id": str - key "modified_at": Required[str] - key "name": Required[str] - key "version": Required[str] - categories: list[Union[str, EvaluatorCategory]] - created_at: str - created_by: str - definition: EvaluatorDefinition + key "metadata": dict[str, str] + key "supported_evaluation_levels": list[Union[str, EvaluationLevel]] + key "tags": dict[str, str] + key "warnings": list[Union[str, GenerationWarningType]] + categories: Required[list[Union[str, EvaluatorCategory]]] + created_at: Required[str] + created_by: Required[str] + definition: Required[EvaluatorDefinition] description: str display_name: str - evaluator_type: Union[str, EvaluatorType] + evaluator_type: Required[Union[str, EvaluatorType]] generation_artifacts: EvaluatorGenerationArtifacts generation_job_id: str id: str metadata: dict[str, str] - modified_at: str - name: str + modified_at: Required[str] + name: Required[str] supported_evaluation_levels: list[Union[str, EvaluationLevel]] tags: dict[str, str] - version: str + version: Required[str] warnings: list[Union[str, GenerationWarningType]] class azure.ai.projects.types.ExternalAgentDefinition(TypedDict, total=False): - key "kind": Required[Literal[AgentKind.EXTERNAL]] key "otel_agent_id": str - key "rai_config": ForwardRef('RaiConfig', module='types') - kind: Literal[AgentKind.EXTERNAL] + key "rai_config": ForwardRef('RaiConfig') + kind: Required[Literal[AgentKind.EXTERNAL]] otel_agent_id: str rai_config: RaiConfig class azure.ai.projects.types.FabricDataAgentToolParameters(TypedDict, total=False): + key "project_connections": list[ToolProjectConnection] project_connections: list[ToolProjectConnection] class azure.ai.projects.types.FabricIQPreviewTool(TypedDict, total=False): - key "project_connection_id": Required[str] key "require_approval": Optional[Union[MCPToolRequireApproval, str]] key "server_label": str key "server_url": str - key "type": Required[Literal[ToolType.FABRIC_IQ_PREVIEW]] - project_connection_id: str + project_connection_id: Required[str] require_approval: Union[MCPToolRequireApproval, str] server_label: str server_url: str - type: Literal[ToolType.FABRIC_IQ_PREVIEW] + type: Required[Literal[ToolType.FABRIC_IQ_PREVIEW]] class azure.ai.projects.types.FabricIQPreviewToolboxTool(TypedDict, total=False): key "description": str key "name": str - key "project_connection_id": Required[str] key "require_approval": Optional[Union[MCPToolRequireApproval, str]] key "server_label": str key "server_url": str - key "type": Required[Literal[ToolboxToolType.FABRIC_IQ_PREVIEW]] + key "tool_configs": dict[str, ToolConfig] description: str name: str - project_connection_id: str + project_connection_id: Required[str] require_approval: Union[MCPToolRequireApproval, str] server_label: str server_url: str tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.FABRIC_IQ_PREVIEW] + type: Required[Literal[ToolboxToolType.FABRIC_IQ_PREVIEW]] class azure.ai.projects.types.FieldMapping(TypedDict, total=False): - key "contentFields": Required[list[str]] key "filepathField": str + key "metadataFields": list[str] key "titleField": str key "urlField": str - contentFields: list[str] + key "vectorFields": list[str] + contentFields: Required[list[str]] filepathField: str metadataFields: list[str] titleField: str @@ -17550,41 +17419,33 @@ namespace azure.ai.projects.types class azure.ai.projects.types.FileDataGenerationJobOutput(TypedDict, total=False): - key "filename": Required[str] - key "id": Required[str] - key "type": Required[Literal[DataGenerationJobOutputType.FILE]] - filename: str - id: str - type: Literal[DataGenerationJobOutputType.FILE] + filename: Required[str] + id: Required[str] + type: Required[Literal[DataGenerationJobOutputType.FILE]] class azure.ai.projects.types.FileDataGenerationJobSource(TypedDict, total=False): key "description": str - key "id": Required[str] - key "type": Required[Literal[DataGenerationJobSourceType.FILE]] description: str - id: str - type: Literal[DataGenerationJobSourceType.FILE] + id: Required[str] + type: Required[Literal[DataGenerationJobSourceType.FILE]] class azure.ai.projects.types.FileDatasetVersion(TypedDict, total=False): key "connectionName": str - key "dataUri": Required[str] key "description": str key "id": str key "isReference": bool - key "name": Required[str] - key "type": Required[Literal[DatasetType.URI_FILE]] - key "version": Required[str] + key "tags": dict[str, str] connectionName: str - dataUri: str + dataUri: Required[str] description: str id: str isReference: bool - name: str + name: Required[str] tags: dict[str, str] - type: Literal[DatasetType.URI_FILE] - version: str + type: Required[Literal[DatasetType.URI_FILE]] + version: Required[str] class azure.ai.projects.types.FileSearchTool(TypedDict, total=False): @@ -17592,17 +17453,16 @@ namespace azure.ai.projects.types key "filters": Optional[Filters] key "max_num_results": int key "name": str - key "ranking_options": ForwardRef('RankingOptions', module='types') - key "type": Required[Literal[ToolType.FILE_SEARCH]] - key "vector_store_ids": Required[list[str]] + key "ranking_options": ForwardRef('RankingOptions') + key "tool_configs": dict[str, ToolConfig] description: str filters: Filters max_num_results: int name: str ranking_options: RankingOptions tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.FILE_SEARCH] - vector_store_ids: list[str] + type: Required[Literal[ToolType.FILE_SEARCH]] + vector_store_ids: Required[list[str]] class azure.ai.projects.types.FileSearchToolboxTool(TypedDict, total=False): @@ -17610,45 +17470,40 @@ namespace azure.ai.projects.types key "filters": Optional[Filters] key "max_num_results": int key "name": str - key "ranking_options": ForwardRef('RankingOptions', module='types') - key "type": Required[Literal[ToolboxToolType.FILE_SEARCH]] + key "ranking_options": ForwardRef('RankingOptions') + key "tool_configs": dict[str, ToolConfig] + key "vector_store_ids": list[str] description: str filters: Filters max_num_results: int name: str ranking_options: RankingOptions tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.FILE_SEARCH] + type: Required[Literal[ToolboxToolType.FILE_SEARCH]] vector_store_ids: list[str] class azure.ai.projects.types.FixedRatioVersionSelectionRule(TypedDict, total=False): - key "agent_version": Required[str] - key "traffic_percentage": Required[int] - key "type": Required[Literal[VersionSelectorType.FIXED_RATIO]] - agent_version: str - traffic_percentage: int - type: Literal[VersionSelectorType.FIXED_RATIO] + agent_version: Required[str] + traffic_percentage: Required[int] + type: Required[Literal[VersionSelectorType.FIXED_RATIO]] class azure.ai.projects.types.FolderDatasetVersion(TypedDict, total=False): key "connectionName": str - key "dataUri": Required[str] key "description": str key "id": str key "isReference": bool - key "name": Required[str] - key "type": Required[Literal[DatasetType.URI_FOLDER]] - key "version": Required[str] + key "tags": dict[str, str] connectionName: str - dataUri: str + dataUri: Required[str] description: str id: str isReference: bool - name: str + name: Required[str] tags: dict[str, str] - type: Literal[DatasetType.URI_FOLDER] - version: str + type: Required[Literal[DatasetType.URI_FOLDER]] + version: Required[str] class azure.ai.projects.types.FoundryModelWarning(TypedDict, total=False): @@ -17663,26 +17518,24 @@ namespace azure.ai.projects.types key "description": str key "environment": Optional[FunctionShellToolParamEnvironment] key "name": str - key "type": Required[Literal[ToolType.SHELL]] + key "tool_configs": dict[str, ToolConfig] allowed_callers: list[Union[str, CallableToolAllowedCaller]] description: str environment: FunctionShellToolParamEnvironment name: str tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.SHELL] + type: Required[Literal[ToolType.SHELL]] class azure.ai.projects.types.FunctionShellToolParamEnvironmentContainerReferenceParam(TypedDict, total=False): - key "container_id": Required[str] - key "type": Required[Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE]] - container_id: str - type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE] + container_id: Required[str] + type: Required[Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE]] class azure.ai.projects.types.FunctionShellToolParamEnvironmentLocalEnvironmentParam(TypedDict, total=False): - key "type": Required[Literal[FunctionShellToolParamEnvironmentType.LOCAL]] + key "skills": list[LocalSkillParam] skills: list[LocalSkillParam] - type: Literal[FunctionShellToolParamEnvironmentType.LOCAL] + type: Required[Literal[FunctionShellToolParamEnvironmentType.LOCAL]] class azure.ai.projects.types.FunctionShellToolParamEnvironmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -17695,105 +17548,83 @@ namespace azure.ai.projects.types key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] key "defer_loading": bool key "description": Optional[str] - key "name": Required[str] key "output_schema": Optional[dict[str, Any]] - key "parameters": Required[Optional[dict[str, Any]]] - key "strict": Required[Optional[bool]] - key "type": Required[Literal[ToolType.FUNCTION]] allowed_callers: list[Union[str, CallableToolAllowedCaller]] defer_loading: bool description: str - name: str + name: Required[str] output_schema: dict[str, Any] - parameters: dict[str, Any] - strict: bool - type: Literal[ToolType.FUNCTION] + parameters: Required[Optional[dict[str, Any]]] + strict: Required[Optional[bool]] + type: Required[Literal[ToolType.FUNCTION]] class azure.ai.projects.types.FunctionToolParam(TypedDict, total=False): key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] key "defer_loading": bool key "description": Optional[str] - key "name": Required[str] key "output_schema": Optional[dict[str, Any]] key "parameters": Optional[EmptyModelParam] key "strict": Optional[bool] - key "type": Required[Literal["function"]] allowed_callers: list[Union[str, CallableToolAllowedCaller]] defer_loading: bool description: str - name: str + name: Required[str] output_schema: dict[str, Any] parameters: EmptyModelParam strict: bool - type: Literal[function] + type: Required[Literal["function"]] class azure.ai.projects.types.GenerateAgentRequest(TypedDict, total=False): - key "kind": Required[Union[str, AgentKind]] - kind: Union[str, AgentKind] + kind: Required[Union[str, AgentKind]] class azure.ai.projects.types.GitHubIssueRoutineTrigger(TypedDict, total=False): - key "connection_id": Required[str] - key "issue_event": Required[Union[str, GitHubIssueEvent]] - key "owner": Required[str] - key "repository": Required[str] - key "type": Required[Literal[RoutineTriggerType.GITHUB_ISSUE]] - connection_id: str - issue_event: Union[str, GitHubIssueEvent] - owner: str - repository: str - type: Literal[RoutineTriggerType.GITHUB_ISSUE] + connection_id: Required[str] + issue_event: Required[Union[str, GitHubIssueEvent]] + owner: Required[str] + repository: Required[str] + type: Required[Literal[RoutineTriggerType.GITHUB_ISSUE]] class azure.ai.projects.types.HeaderTelemetryEndpointAuth(TypedDict, total=False): - key "header_name": Required[str] - key "secret_id": Required[str] - key "secret_key": Required[str] - key "type": Required[Literal[TelemetryEndpointAuthType.HEADER]] - header_name: str - secret_id: str - secret_key: str - type: Literal[TelemetryEndpointAuthType.HEADER] + header_name: Required[str] + secret_id: Required[str] + secret_key: Required[str] + type: Required[Literal[TelemetryEndpointAuthType.HEADER]] class azure.ai.projects.types.HostedAgentDefinition(TypedDict, total=False): - key "code_configuration": ForwardRef('CodeConfiguration', module='types') - key "container_configuration": ForwardRef('ContainerConfiguration', module='types') - key "cpu": Required[str] - key "kind": Required[Literal[AgentKind.HOSTED]] - key "memory": Required[str] - key "rai_config": ForwardRef('RaiConfig', module='types') - key "telemetry_config": ForwardRef('TelemetryConfig', module='types') + key "code_configuration": ForwardRef('CodeConfiguration') + key "container_configuration": ForwardRef('ContainerConfiguration') + key "environment_variables": dict[str, str] + key "protocol_versions": list[ProtocolVersionRecord] + key "rai_config": ForwardRef('RaiConfig') + key "telemetry_config": ForwardRef('TelemetryConfig') code_configuration: CodeConfiguration container_configuration: ContainerConfiguration - cpu: str + cpu: Required[str] environment_variables: dict[str, str] - kind: Literal[AgentKind.HOSTED] - memory: str + kind: Required[Literal[AgentKind.HOSTED]] + memory: Required[str] protocol_versions: list[ProtocolVersionRecord] rai_config: RaiConfig telemetry_config: TelemetryConfig class azure.ai.projects.types.HourlyRecurrenceSchedule(TypedDict, total=False): - key "type": Required[Literal[RecurrenceType.HOURLY]] - type: Literal[RecurrenceType.HOURLY] + type: Required[Literal[RecurrenceType.HOURLY]] class azure.ai.projects.types.HumanEvaluationPreviewRuleAction(TypedDict, total=False): - key "templateId": Required[str] - key "type": Required[Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW]] - templateId: str - type: Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW] + templateId: Required[str] + type: Required[Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW]] class azure.ai.projects.types.HybridSearchOptions(TypedDict, total=False): - key "embedding_weight": Required[float] - key "text_weight": Required[float] - embedding_weight: float - text_weight: float + embedding_weight: Required[float] + text_weight: Required[float] class azure.ai.projects.types.ImageGenTool(TypedDict, total=False): @@ -17801,7 +17632,7 @@ namespace azure.ai.projects.types key "background": Literal["transparent", "opaque", "auto"] key "description": str key "input_fidelity": Optional[Union[str, InputFidelity]] - key "input_image_mask": ForwardRef('ImageGenToolInputImageMask', module='types') + key "input_image_mask": ForwardRef('ImageGenToolInputImageMask') key "model": Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], Literal["gpt-image-5"], str] key "moderation": Literal["auto", "low"] key "name": str @@ -17810,7 +17641,7 @@ namespace azure.ai.projects.types key "partial_images": int key "quality": Literal["low", "medium", "high", "auto"] key "size": Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str] - key "type": Required[Literal[ToolType.IMAGE_GENERATION]] + key "tool_configs": dict[str, ToolConfig] action: Union[str, ImageGenAction] background: Literal[transparent, opaque, auto] description: str @@ -17825,7 +17656,7 @@ namespace azure.ai.projects.types quality: Literal[low, medium, high, auto] size: Union[Literal[1024x1024], Literal[1024x1536], Literal[1536x1024], Literal[auto], str] tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.IMAGE_GENERATION] + type: Required[Literal[ToolType.IMAGE_GENERATION]] class azure.ai.projects.types.ImageGenToolInputImageMask(TypedDict, total=False): @@ -17842,94 +17673,66 @@ namespace azure.ai.projects.types class azure.ai.projects.types.InlineSkillParam(TypedDict, total=False): - key "description": Required[str] - key "name": Required[str] - key "source": Required[InlineSkillSourceParam] - key "type": Required[Literal[ContainerSkillType.INLINE]] - description: str - name: str - source: InlineSkillSourceParam - type: Literal[ContainerSkillType.INLINE] + description: Required[str] + name: Required[str] + source: Required[InlineSkillSourceParam] + type: Required[Literal[ContainerSkillType.INLINE]] class azure.ai.projects.types.InlineSkillSourceParam(TypedDict, total=False): - key "data": Required[str] - key "media_type": Required[Literal["application/zip"]] - key "type": Required[Literal["base64"]] - data: str - media_type: Literal[application/zip] - type: Literal[base64] + data: Required[str] + media_type: Required[Literal["application/zip"]] + type: Required[Literal["base64"]] class azure.ai.projects.types.Insight(TypedDict, total=False): - key "displayName": Required[str] - key "id": Required[str] - key "metadata": Required[InsightsMetadata] - key "request": Required[InsightRequest] - key "result": ForwardRef('InsightResult', module='types') - key "state": Required[Union[str, OperationState]] - displayName: str - id: str - metadata: InsightsMetadata - request: InsightRequest + key "result": ForwardRef('InsightResult') + displayName: Required[str] + id: Required[str] + metadata: Required[InsightsMetadata] + request: Required[InsightRequest] result: InsightResult - state: Union[str, OperationState] + state: Required[Union[str, OperationState]] class azure.ai.projects.types.InsightCluster(TypedDict, total=False): - key "description": Required[str] - key "id": Required[str] - key "label": Required[str] - key "suggestion": Required[str] - key "suggestionTitle": Required[str] - key "weight": Required[int] - description: str - id: str - label: str + key "samples": list[InsightSample] + key "subClusters": list[InsightCluster] + description: Required[str] + id: Required[str] + label: Required[str] samples: list[InsightSample] subClusters: list[InsightCluster] - suggestion: str - suggestionTitle: str - weight: int + suggestion: Required[str] + suggestionTitle: Required[str] + weight: Required[int] class azure.ai.projects.types.InsightModelConfiguration(TypedDict, total=False): - key "modelDeploymentName": Required[str] - modelDeploymentName: str + modelDeploymentName: Required[str] class azure.ai.projects.types.InsightSample(TypedDict, total=False): - key "correlationInfo": Required[dict[str, Any]] - key "evaluationResult": Required[EvalResult] - key "features": Required[dict[str, Any]] - key "id": Required[str] - key "type": Required[Literal[SampleType.EVALUATION_RESULT_SAMPLE]] - correlationInfo: dict[str, Any] - evaluationResult: EvalResult - features: dict[str, Any] - id: str - type: Literal[SampleType.EVALUATION_RESULT_SAMPLE] + correlationInfo: Required[dict[str, Any]] + evaluationResult: Required[EvalResult] + features: Required[dict[str, Any]] + id: Required[str] + type: Required[Literal[SampleType.EVALUATION_RESULT_SAMPLE]] class azure.ai.projects.types.InsightScheduleTask(TypedDict, total=False): - key "insight": Required[Insight] - key "type": Required[Literal[ScheduleTaskType.INSIGHT]] + key "configuration": dict[str, str] configuration: dict[str, str] - insight: Insight - type: Literal[ScheduleTaskType.INSIGHT] + insight: Required[Insight] + type: Required[Literal[ScheduleTaskType.INSIGHT]] class azure.ai.projects.types.InsightSummary(TypedDict, total=False): - key "method": Required[str] - key "sampleCount": Required[int] - key "uniqueClusterCount": Required[int] - key "uniqueSubclusterCount": Required[int] - key "usage": Required[ClusterTokenUsage] - method: str - sampleCount: int - uniqueClusterCount: int - uniqueSubclusterCount: int - usage: ClusterTokenUsage + method: Required[str] + sampleCount: Required[int] + uniqueClusterCount: Required[int] + uniqueSubclusterCount: Required[int] + usage: Required[ClusterTokenUsage] class azure.ai.projects.types.InsightType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -17940,9 +17743,8 @@ namespace azure.ai.projects.types class azure.ai.projects.types.InsightsMetadata(TypedDict, total=False): key "completedAt": str - key "createdAt": Required[str] completedAt: str - createdAt: str + createdAt: Required[str] class azure.ai.projects.types.InvocationsProtocolConfiguration(TypedDict, total=False): @@ -17952,10 +17754,8 @@ namespace azure.ai.projects.types class azure.ai.projects.types.InvokeAgentInvocationsApiDispatchPayload(TypedDict, total=False): - key "input": Required[Any] - key "type": Required[Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API]] - input: Any - type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API] + input: Required[Any] + type: Required[Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API]] class azure.ai.projects.types.InvokeAgentInvocationsApiRoutineAction(TypedDict, total=False): @@ -17963,19 +17763,16 @@ namespace azure.ai.projects.types key "agent_name": str key "input": Any key "session_id": str - key "type": Required[Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API]] agent_endpoint_id: str agent_name: str input: Any session_id: str - type: Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API] + type: Required[Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API]] class azure.ai.projects.types.InvokeAgentResponsesApiDispatchPayload(TypedDict, total=False): - key "input": Required[Any] - key "type": Required[Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API]] - input: Any - type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API] + input: Required[Any] + type: Required[Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API]] class azure.ai.projects.types.InvokeAgentResponsesApiRoutineAction(TypedDict, total=False): @@ -17983,60 +17780,51 @@ namespace azure.ai.projects.types key "agent_name": str key "conversation": str key "input": Any - key "type": Required[Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API]] agent_endpoint_id: str agent_name: str conversation: str input: Any - type: Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API] + type: Required[Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API]] class azure.ai.projects.types.ListMemoriesRequest(TypedDict, total=False): - key "scope": Required[str] - scope: str + scope: Required[str] class azure.ai.projects.types.LlmGeneratedVoiceGreetingConfig(TypedDict, total=False): - key "prompt": Required[str] - key "tool_choice": ForwardRef('VoiceAgentToolChoice', module='types') - key "type": Required[Literal["llm_generated"]] - prompt: str + key "tool_choice": ForwardRef('VoiceAgentToolChoice') + prompt: Required[str] tool_choice: VoiceAgentToolChoice - type: Literal[llm_generated] + type: Required[Literal["llm_generated"]] class azure.ai.projects.types.LocalShellToolParam(TypedDict, total=False): key "description": str key "name": str - key "type": Required[Literal[ToolType.LOCAL_SHELL]] + key "tool_configs": dict[str, ToolConfig] description: str name: str tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.LOCAL_SHELL] + type: Required[Literal[ToolType.LOCAL_SHELL]] class azure.ai.projects.types.LocalSkillParam(TypedDict, total=False): - key "description": Required[str] - key "name": Required[str] - key "path": Required[str] - description: str - name: str - path: str + description: Required[str] + name: Required[str] + path: Required[str] class azure.ai.projects.types.LogProbProperties(TypedDict, total=False): - key "bytes": Required[list[int]] - key "logprob": Required[float] - key "token": Required[str] - bytes: list[int] - logprob: float - token: str + bytes: Required[list[int]] + logprob: Required[float] + token: Required[str] class azure.ai.projects.types.LoraConfig(TypedDict, total=False): key "alpha": int key "dropout": float key "rank": int + key "targetModules": list[str] alpha: int dropout: float rank: int @@ -18046,12 +17834,10 @@ namespace azure.ai.projects.types class azure.ai.projects.types.MCPListToolsTool(TypedDict, total=False): key "annotations": Optional[MCPListToolsToolAnnotations] key "description": Optional[str] - key "input_schema": Required[MCPListToolsToolInputSchema] - key "name": Required[str] annotations: MCPListToolsToolAnnotations description: str - input_schema: MCPListToolsToolInputSchema - name: str + input_schema: Required[MCPListToolsToolInputSchema] + name: Required[str] class azure.ai.projects.types.MCPListToolsToolAnnotations(TypedDict, total=False): @@ -18070,10 +17856,9 @@ namespace azure.ai.projects.types key "project_connection_id": str key "require_approval": Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] key "server_description": str - key "server_label": Required[str] key "server_url": str + key "tool_configs": dict[str, ToolConfig] key "tunnel_id": str - key "type": Required[Literal[ToolType.MCP]] allowed_callers: list[Union[str, CallableToolAllowedCaller]] allowed_tools: Union[list[str], MCPToolFilter] authorization: str @@ -18083,22 +17868,23 @@ namespace azure.ai.projects.types project_connection_id: str require_approval: Union[MCPToolRequireApproval, Literal[always], Literal[never]] server_description: str - server_label: str + server_label: Required[str] server_url: str tool_configs: dict[str, ToolConfig] tunnel_id: str - type: Literal[ToolType.MCP] + type: Required[Literal[ToolType.MCP]] class azure.ai.projects.types.MCPToolFilter(TypedDict, total=False): key "read_only": bool + key "tool_names": list[str] read_only: bool tool_names: list[str] class azure.ai.projects.types.MCPToolRequireApproval(TypedDict, total=False): - key "always": ForwardRef('MCPToolFilter', module='types') - key "never": ForwardRef('MCPToolFilter', module='types') + key "always": ForwardRef('MCPToolFilter') + key "never": ForwardRef('MCPToolFilter') always: MCPToolFilter never: MCPToolFilter @@ -18115,10 +17901,9 @@ namespace azure.ai.projects.types key "project_connection_id": str key "require_approval": Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] key "server_description": str - key "server_label": Required[str] key "server_url": str + key "tool_configs": dict[str, ToolConfig] key "tunnel_id": str - key "type": Required[Literal[ToolboxToolType.MCP]] allowed_callers: list[Union[str, CallableToolAllowedCaller]] allowed_tools: Union[list[str], MCPToolFilter] authorization: str @@ -18130,34 +17915,29 @@ namespace azure.ai.projects.types project_connection_id: str require_approval: Union[MCPToolRequireApproval, Literal[always], Literal[never]] server_description: str - server_label: str + server_label: Required[str] server_url: str tool_configs: dict[str, ToolConfig] tunnel_id: str - type: Literal[ToolboxToolType.MCP] + type: Required[Literal[ToolboxToolType.MCP]] class azure.ai.projects.types.ManagedAgentIdentityBlueprintReference(TypedDict, total=False): - key "blueprint_id": Required[str] - key "type": Required[Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT]] - blueprint_id: str - type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] + blueprint_id: Required[str] + type: Required[Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT]] class azure.ai.projects.types.ManagedAzureAISearchIndex(TypedDict, total=False): key "description": str key "id": str - key "name": Required[str] - key "type": Required[Literal[IndexType.MANAGED_AZURE_SEARCH]] - key "vectorStoreId": Required[str] - key "version": Required[str] + key "tags": dict[str, str] description: str id: str - name: str + name: Required[str] tags: dict[str, str] - type: Literal[IndexType.MANAGED_AZURE_SEARCH] - vectorStoreId: str - version: str + type: Required[Literal[IndexType.MANAGED_AZURE_SEARCH]] + vectorStoreId: Required[str] + version: Required[str] class azure.ai.projects.types.McpProtocolConfiguration(TypedDict, total=False): @@ -18169,50 +17949,39 @@ namespace azure.ai.projects.types class azure.ai.projects.types.MemorySearchPreviewTool(TypedDict, total=False): - key "memory_store_name": Required[str] - key "scope": Required[str] - key "search_options": ForwardRef('MemorySearchOptions', module='types') - key "type": Required[Literal[ToolType.MEMORY_SEARCH_PREVIEW]] + key "search_options": ForwardRef('MemorySearchOptions') key "update_delay": int - memory_store_name: str - scope: str + memory_store_name: Required[str] + scope: Required[str] search_options: MemorySearchOptions - type: Literal[ToolType.MEMORY_SEARCH_PREVIEW] + type: Required[Literal[ToolType.MEMORY_SEARCH_PREVIEW]] update_delay: int class azure.ai.projects.types.MemoryStoreDefaultDefinition(TypedDict, total=False): - key "chat_model": Required[str] - key "embedding_model": Required[str] - key "kind": Required[Literal[MemoryStoreKind.DEFAULT]] - key "options": ForwardRef('MemoryStoreDefaultOptions', module='types') - chat_model: str - embedding_model: str - kind: Literal[MemoryStoreKind.DEFAULT] + key "options": ForwardRef('MemoryStoreDefaultOptions') + chat_model: Required[str] + embedding_model: Required[str] + kind: Required[Literal[MemoryStoreKind.DEFAULT]] options: MemoryStoreDefaultOptions class azure.ai.projects.types.MemoryStoreDefaultOptions(TypedDict, total=False): - key "chat_summary_enabled": Required[bool] key "default_ttl_seconds": str key "procedural_memory_enabled": bool key "user_profile_details": str - key "user_profile_enabled": Required[bool] - chat_summary_enabled: bool + chat_summary_enabled: Required[bool] default_ttl_seconds: str procedural_memory_enabled: bool user_profile_details: str - user_profile_enabled: bool + user_profile_enabled: Required[bool] class azure.ai.projects.types.MemoryStoreDefinition(TypedDict, total=False): - key "chat_model": Required[str] - key "embedding_model": Required[str] - key "kind": Required[Literal[MemoryStoreKind.DEFAULT]] - key "options": ForwardRef('MemoryStoreDefaultOptions', module='types') - chat_model: str - embedding_model: str - kind: Literal[MemoryStoreKind.DEFAULT] + key "options": ForwardRef('MemoryStoreDefaultOptions') + chat_model: Required[str] + embedding_model: Required[str] + kind: Required[Literal[MemoryStoreKind.DEFAULT]] options: MemoryStoreDefaultOptions @@ -18224,24 +17993,20 @@ namespace azure.ai.projects.types class azure.ai.projects.types.MicrosoftFabricPreviewTool(TypedDict, total=False): - key "fabric_dataagent_preview": Required[FabricDataAgentToolParameters] - key "type": Required[Literal[ToolType.FABRIC_DATAAGENT_PREVIEW]] - fabric_dataagent_preview: FabricDataAgentToolParameters - type: Literal[ToolType.FABRIC_DATAAGENT_PREVIEW] + fabric_dataagent_preview: Required[FabricDataAgentToolParameters] + type: Required[Literal[ToolType.FABRIC_DATAAGENT_PREVIEW]] class azure.ai.projects.types.ModelCredentialRequest(TypedDict, total=False): - key "blobUri": Required[str] - blobUri: str + blobUri: Required[str] class azure.ai.projects.types.ModelPendingUploadRequest(TypedDict, total=False): key "connectionName": str key "pendingUploadId": str - key "pendingUploadType": Required[Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE]] connectionName: str pendingUploadId: str - pendingUploadType: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] + pendingUploadType: Required[Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE]] class azure.ai.projects.types.ModelSamplingParams(TypedDict, total=False): @@ -18263,46 +18028,39 @@ namespace azure.ai.projects.types class azure.ai.projects.types.ModelVersion(TypedDict, total=False): - key "artifactProfile": ForwardRef('ArtifactProfile', module='types') + key "artifactProfile": ForwardRef('ArtifactProfile') key "baseModel": str - key "blobUri": Required[str] key "description": str key "id": str - key "loraConfig": ForwardRef('LoraConfig', module='types') - key "name": Required[str] - key "source": ForwardRef('ModelSourceData', module='types') - key "version": Required[str] + key "loraConfig": ForwardRef('LoraConfig') + key "source": ForwardRef('ModelSourceData') + key "tags": dict[str, str] + key "warnings": list[FoundryModelWarning] key "weightType": Union[str, FoundryModelWeightType] artifactProfile: ArtifactProfile baseModel: str - blobUri: str + blobUri: Required[str] description: str id: str loraConfig: LoraConfig - name: str + name: Required[str] source: ModelSourceData tags: dict[str, str] - version: str + version: Required[str] warnings: list[FoundryModelWarning] weightType: Union[str, FoundryModelWeightType] class azure.ai.projects.types.MonthlyRecurrenceSchedule(TypedDict, total=False): - key "daysOfMonth": Required[list[int]] - key "type": Required[Literal[RecurrenceType.MONTHLY]] - daysOfMonth: list[int] - type: Literal[RecurrenceType.MONTHLY] + daysOfMonth: Required[list[int]] + type: Required[Literal[RecurrenceType.MONTHLY]] class azure.ai.projects.types.NamespaceToolParam(TypedDict, total=False): - key "description": Required[str] - key "name": Required[str] - key "tools": Required[list[Union[FunctionToolParam, CustomToolParam]]] - key "type": Required[Literal[ToolType.NAMESPACE]] - description: str - name: str - tools: list[Union[FunctionToolParam, CustomToolParam]] - type: Literal[ToolType.NAMESPACE] + description: Required[str] + name: Required[str] + tools: Required[list[Union[FunctionToolParam, CustomToolParam]]] + type: Required[Literal[ToolType.NAMESPACE]] class azure.ai.projects.types.OmitPropertiesRealtimeResponse1(TypedDict, total=False): @@ -18311,15 +18069,16 @@ namespace azure.ai.projects.types key "max_output_tokens": Union[int, Literal["inf"]] key "metadata": Optional[Metadata] key "object": Literal["response"] + key "output_modalities": list[Literal["text", "audio"]] key "status": Literal["completed", "cancelled", "failed", "incomplete", "in_progress"] - key "status_details": ForwardRef('RealtimeResponseStatusDetails', module='types') - key "usage": ForwardRef('RealtimeResponseUsage', module='types') + key "status_details": ForwardRef('RealtimeResponseStatusDetails') + key "usage": ForwardRef('RealtimeResponseUsage') conversation_id: str id: str max_output_tokens: Union[int, Literal[inf]] metadata: Metadata object: Literal[response] - output_modalities: list[Literal["text", "audio"]] + output_modalities: list[Literal[text, audio]] status: Literal[completed, cancelled, failed, incomplete, in_progress] status_details: RealtimeResponseStatusDetails usage: RealtimeResponseUsage @@ -18327,16 +18086,13 @@ namespace azure.ai.projects.types class azure.ai.projects.types.OneTimeTrigger(TypedDict, total=False): key "timeZone": str - key "triggerAt": Required[str] - key "type": Required[Literal[TriggerType.ONE_TIME]] timeZone: str - triggerAt: str - type: Literal[TriggerType.ONE_TIME] + triggerAt: Required[str] + type: Required[Literal[TriggerType.ONE_TIME]] class azure.ai.projects.types.OpenApiAnonymousAuthDetails(TypedDict, total=False): - key "type": Required[Literal[OpenApiAuthType.ANONYMOUS]] - type: Literal[OpenApiAuthType.ANONYMOUS] + type: Required[Literal[OpenApiAuthType.ANONYMOUS]] class azure.ai.projects.types.OpenApiAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -18346,94 +18102,78 @@ namespace azure.ai.projects.types class azure.ai.projects.types.OpenApiFunctionDefinition(TypedDict, total=False): - key "auth": Required[OpenApiAuthDetails] + key "default_params": list[str] key "description": str - key "name": Required[str] - key "spec": Required[dict[str, Any]] - auth: OpenApiAuthDetails + key "functions": list[OpenApiFunctionDefinitionFunction] + auth: Required[OpenApiAuthDetails] default_params: list[str] description: str functions: list[OpenApiFunctionDefinitionFunction] - name: str - spec: dict[str, Any] + name: Required[str] + spec: Required[dict[str, Any]] class azure.ai.projects.types.OpenApiFunctionDefinitionFunction(TypedDict, total=False): key "description": str - key "name": Required[str] - key "parameters": Required[dict[str, Any]] description: str - name: str - parameters: dict[str, Any] + name: Required[str] + parameters: Required[dict[str, Any]] class azure.ai.projects.types.OpenApiManagedAuthDetails(TypedDict, total=False): - key "security_scheme": Required[OpenApiManagedSecurityScheme] - key "type": Required[Literal[OpenApiAuthType.MANAGED_IDENTITY]] - security_scheme: OpenApiManagedSecurityScheme - type: Literal[OpenApiAuthType.MANAGED_IDENTITY] + security_scheme: Required[OpenApiManagedSecurityScheme] + type: Required[Literal[OpenApiAuthType.MANAGED_IDENTITY]] class azure.ai.projects.types.OpenApiManagedSecurityScheme(TypedDict, total=False): - key "audience": Required[str] - audience: str + audience: Required[str] class azure.ai.projects.types.OpenApiProjectConnectionAuthDetails(TypedDict, total=False): - key "security_scheme": Required[OpenApiProjectConnectionSecurityScheme] - key "type": Required[Literal[OpenApiAuthType.PROJECT_CONNECTION]] - security_scheme: OpenApiProjectConnectionSecurityScheme - type: Literal[OpenApiAuthType.PROJECT_CONNECTION] + security_scheme: Required[OpenApiProjectConnectionSecurityScheme] + type: Required[Literal[OpenApiAuthType.PROJECT_CONNECTION]] class azure.ai.projects.types.OpenApiProjectConnectionSecurityScheme(TypedDict, total=False): - key "project_connection_id": Required[str] - project_connection_id: str + project_connection_id: Required[str] class azure.ai.projects.types.OpenApiTool(TypedDict, total=False): - key "openapi": Required[OpenApiFunctionDefinition] - key "type": Required[Literal[ToolType.OPENAPI]] - openapi: OpenApiFunctionDefinition + key "tool_configs": dict[str, ToolConfig] + openapi: Required[OpenApiFunctionDefinition] tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.OPENAPI] + type: Required[Literal[ToolType.OPENAPI]] class azure.ai.projects.types.OpenApiToolboxTool(TypedDict, total=False): key "description": str key "name": str - key "openapi": Required[OpenApiFunctionDefinition] - key "type": Required[Literal[ToolboxToolType.OPENAPI]] + key "tool_configs": dict[str, ToolConfig] description: str name: str - openapi: OpenApiFunctionDefinition + openapi: Required[OpenApiFunctionDefinition] tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.OPENAPI] + type: Required[Literal[ToolboxToolType.OPENAPI]] class azure.ai.projects.types.OptimizedAgentIdentifier(TypedDict, total=False): - key "agent_name": Required[str] key "agent_version": str - agent_name: str + agent_name: Required[str] agent_version: str class azure.ai.projects.types.OtlpTelemetryEndpoint(TypedDict, total=False): - key "auth": ForwardRef('TelemetryEndpointAuth', module='types') - key "data": Required[list[Union[str, TelemetryDataKind]]] - key "endpoint": Required[str] - key "kind": Required[Literal[TelemetryEndpointKind.OTLP]] - key "protocol": Required[Union[str, TelemetryTransportProtocol]] + key "auth": ForwardRef('TelemetryEndpointAuth') auth: TelemetryEndpointAuth - data: list[Union[str, TelemetryDataKind]] - endpoint: str - kind: Literal[TelemetryEndpointKind.OTLP] - protocol: Union[str, TelemetryTransportProtocol] + data: Required[list[Union[str, TelemetryDataKind]]] + endpoint: Required[str] + kind: Required[Literal[TelemetryEndpointKind.OTLP]] + protocol: Required[Union[str, TelemetryTransportProtocol]] class azure.ai.projects.types.PatchAgentObjectRequest(TypedDict, total=False): - key "agent_card": ForwardRef('AgentCard', module='types') - key "agent_endpoint": ForwardRef('AgentEndpointConfig', module='types') + key "agent_card": ForwardRef('AgentCard') + key "agent_endpoint": ForwardRef('AgentEndpointConfig') agent_card: AgentCard agent_endpoint: AgentEndpointConfig @@ -18441,10 +18181,9 @@ namespace azure.ai.projects.types class azure.ai.projects.types.PendingUploadRequest(TypedDict, total=False): key "connectionName": str key "pendingUploadId": str - key "pendingUploadType": Required[Literal[PendingUploadType.BLOB_REFERENCE]] connectionName: str pendingUploadId: str - pendingUploadType: Literal[PendingUploadType.BLOB_REFERENCE] + pendingUploadType: Required[Literal[PendingUploadType.BLOB_REFERENCE]] class azure.ai.projects.types.PendingUploadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -18454,37 +18193,33 @@ namespace azure.ai.projects.types class azure.ai.projects.types.PickPropertiesVoiceAudioConfig(TypedDict, total=False): - key "output": ForwardRef('VoiceAudioOutputConfig', module='types') + key "output": ForwardRef('VoiceAudioOutputConfig') output: VoiceAudioOutputConfig class azure.ai.projects.types.ProgrammaticToolCallingParam(TypedDict, total=False): - key "type": Required[Literal[ToolType.PROGRAMMATIC_TOOL_CALLING]] - type: Literal[ToolType.PROGRAMMATIC_TOOL_CALLING] + type: Required[Literal[ToolType.PROGRAMMATIC_TOOL_CALLING]] class azure.ai.projects.types.PromotionInfo(TypedDict, total=False): - key "agent_name": Required[str] - key "agent_version": Required[str] - key "promoted_at": Required[int] - agent_name: str - agent_version: str - promoted_at: int + agent_name: Required[str] + agent_version: Required[str] + promoted_at: Required[int] class azure.ai.projects.types.PromptAgentDefinition(TypedDict, total=False): key "instructions": Optional[str] - key "kind": Required[Literal[AgentKind.PROMPT]] - key "model": Required[str] - key "rai_config": ForwardRef('RaiConfig', module='types') + key "rai_config": ForwardRef('RaiConfig') key "reasoning": Optional[Reasoning] + key "structured_inputs": dict[str, StructuredInputDefinition] key "temperature": Optional[float] - key "text": ForwardRef('PromptAgentDefinitionTextOptions', module='types') + key "text": ForwardRef('PromptAgentDefinitionTextOptions') key "tool_choice": Union[str, ToolChoiceParam] + key "tools": list[Tool] key "top_p": Optional[float] instructions: str - kind: Literal[AgentKind.PROMPT] - model: str + kind: Required[Literal[AgentKind.PROMPT]] + model: Required[str] rai_config: RaiConfig reasoning: Reasoning structured_inputs: dict[str, StructuredInputDefinition] @@ -18496,45 +18231,42 @@ namespace azure.ai.projects.types class azure.ai.projects.types.PromptAgentDefinitionTextOptions(TypedDict, total=False): - key "format": ForwardRef('TextResponseFormat', module='types') + key "format": ForwardRef('TextResponseFormat') format: TextResponseFormat class azure.ai.projects.types.PromptBasedEvaluatorDefinition(TypedDict, total=False): - key "prompt_text": Required[str] - key "type": Required[Literal[EvaluatorDefinitionType.PROMPT]] + key "data_schema": dict[str, Any] + key "init_parameters": dict[str, Any] + key "metrics": dict[str, EvaluatorMetric] data_schema: dict[str, Any] init_parameters: dict[str, Any] metrics: dict[str, EvaluatorMetric] - prompt_text: str - type: Literal[EvaluatorDefinitionType.PROMPT] + prompt_text: Required[str] + type: Required[Literal[EvaluatorDefinitionType.PROMPT]] class azure.ai.projects.types.PromptDataGenerationJobSource(TypedDict, total=False): key "description": str - key "prompt": Required[str] - key "type": Required[Literal[DataGenerationJobSourceType.PROMPT]] description: str - prompt: str - type: Literal[DataGenerationJobSourceType.PROMPT] + prompt: Required[str] + type: Required[Literal[DataGenerationJobSourceType.PROMPT]] class azure.ai.projects.types.PromptEvaluatorGenerationJobSource(TypedDict, total=False): key "description": str - key "prompt": Required[str] - key "type": Required[Literal[EvaluatorGenerationJobSourceType.PROMPT]] description: str - prompt: str - type: Literal[EvaluatorGenerationJobSourceType.PROMPT] + prompt: Required[str] + type: Required[Literal[EvaluatorGenerationJobSourceType.PROMPT]] class azure.ai.projects.types.ProtocolConfiguration(TypedDict, total=False): - key "a2a": ForwardRef('A2AProtocolConfiguration', module='types') - key "activity": ForwardRef('ActivityProtocolConfiguration', module='types') - key "invocations": ForwardRef('InvocationsProtocolConfiguration', module='types') - key "invocations_ws": ForwardRef('InvocationsWsProtocolConfiguration', module='types') - key "mcp": ForwardRef('McpProtocolConfiguration', module='types') - key "responses": ForwardRef('ResponsesProtocolConfiguration', module='types') + key "a2a": ForwardRef('A2AProtocolConfiguration') + key "activity": ForwardRef('ActivityProtocolConfiguration') + key "invocations": ForwardRef('InvocationsProtocolConfiguration') + key "invocations_ws": ForwardRef('InvocationsWsProtocolConfiguration') + key "mcp": ForwardRef('McpProtocolConfiguration') + key "responses": ForwardRef('ResponsesProtocolConfiguration') a2a: A2AProtocolConfiguration activity: ActivityProtocolConfiguration invocations: InvocationsProtocolConfiguration @@ -18544,19 +18276,16 @@ namespace azure.ai.projects.types class azure.ai.projects.types.ProtocolVersionRecord(TypedDict, total=False): - key "protocol": Required[Union[str, AgentEndpointProtocol]] - key "version": Required[str] - protocol: Union[str, AgentEndpointProtocol] - version: str + protocol: Required[Union[str, AgentEndpointProtocol]] + version: Required[str] class azure.ai.projects.types.RaiConfig(TypedDict, total=False): - key "rai_policy_name": Required[str] - rai_policy_name: str + rai_policy_name: Required[str] class azure.ai.projects.types.RankingOptions(TypedDict, total=False): - key "hybrid_search": ForwardRef('HybridSearchOptions', module='types') + key "hybrid_search": ForwardRef('HybridSearchOptions') key "ranker": Union[str, RankerVersionType] key "score_threshold": float hybrid_search: HybridSearchOptions @@ -18566,19 +18295,16 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeAudioFormatsAudioPcm(TypedDict, total=False): key "rate": Literal[24000] - key "type": Required[Literal[RealtimeAudioFormatsType.AUDIO_PCM]] rate: Literal[24000] - type: Literal[RealtimeAudioFormatsType.AUDIO_PCM] + type: Required[Literal[RealtimeAudioFormatsType.AUDIO_PCM]] class azure.ai.projects.types.RealtimeAudioFormatsAudioPcma(TypedDict, total=False): - key "type": Required[Literal[RealtimeAudioFormatsType.AUDIO_PCMA]] - type: Literal[RealtimeAudioFormatsType.AUDIO_PCMA] + type: Required[Literal[RealtimeAudioFormatsType.AUDIO_PCMA]] class azure.ai.projects.types.RealtimeAudioFormatsAudioPcmu(TypedDict, total=False): - key "type": Required[Literal[RealtimeAudioFormatsType.AUDIO_PCMU]] - type: Literal[RealtimeAudioFormatsType.AUDIO_PCMU] + type: Required[Literal[RealtimeAudioFormatsType.AUDIO_PCMU]] class azure.ai.projects.types.RealtimeAudioFormatsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -18602,50 +18328,41 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeConversationItemFunctionCall(TypedDict, total=False): - key "arguments": Required[str] key "call_id": str key "id": str - key "name": Required[str] key "object": Literal["item"] key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal[RealtimeConversationItemType.FUNCTION_CALL]] - arguments: str + arguments: Required[str] call_id: str id: str - name: str + name: Required[str] object: Literal[item] status: Literal[completed, incomplete, in_progress] - type: Literal[RealtimeConversationItemType.FUNCTION_CALL] + type: Required[Literal[RealtimeConversationItemType.FUNCTION_CALL]] class azure.ai.projects.types.RealtimeConversationItemFunctionCallOutput(TypedDict, total=False): - key "call_id": Required[str] key "id": str key "object": Literal["item"] - key "output": Required[str] key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT]] - call_id: str + call_id: Required[str] id: str object: Literal[item] - output: str + output: Required[str] status: Literal[completed, incomplete, in_progress] - type: Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT] + type: Required[Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT]] class azure.ai.projects.types.RealtimeConversationItemMessageAssistant(TypedDict, total=False): - key "content": Required[list[RealtimeConversationItemMessageAssistantContent]] key "id": str key "object": Literal["item"] - key "role": Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal["message"]] - content: list[RealtimeConversationItemMessageAssistantContent] + content: Required[list[RealtimeConversationItemMessageAssistantContent]] id: str object: Literal[item] - role: Literal[RealtimeConversationItemMessageType.ASSISTANT] + role: Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] status: Literal[completed, incomplete, in_progress] - type: Literal[message] + type: Required[Literal["message"]] class azure.ai.projects.types.RealtimeConversationItemMessageAssistantContent(TypedDict, total=False): @@ -18660,18 +18377,15 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeConversationItemMessageSystem(TypedDict, total=False): - key "content": Required[list[RealtimeConversationItemMessageSystemContent]] key "id": str key "object": Literal["item"] - key "role": Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal["message"]] - content: list[RealtimeConversationItemMessageSystemContent] + content: Required[list[RealtimeConversationItemMessageSystemContent]] id: str object: Literal[item] - role: Literal[RealtimeConversationItemMessageType.SYSTEM] + role: Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] status: Literal[completed, incomplete, in_progress] - type: Literal[message] + type: Required[Literal["message"]] class azure.ai.projects.types.RealtimeConversationItemMessageSystemContent(TypedDict, total=False): @@ -18688,18 +18402,15 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeConversationItemMessageUser(TypedDict, total=False): - key "content": Required[list[RealtimeConversationItemMessageUserContent]] key "id": str key "object": Literal["item"] - key "role": Required[Literal[RealtimeConversationItemMessageType.USER]] key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal["message"]] - content: list[RealtimeConversationItemMessageUserContent] + content: Required[list[RealtimeConversationItemMessageUserContent]] id: str object: Literal[item] - role: Literal[RealtimeConversationItemMessageType.USER] + role: Required[Literal[RealtimeConversationItemMessageType.USER]] status: Literal[completed, incomplete, in_progress] - type: Literal[message] + type: Required[Literal["message"]] class azure.ai.projects.types.RealtimeConversationItemMessageUserContent(TypedDict, total=False): @@ -18729,7 +18440,7 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeFunctionTool(TypedDict, total=False): key "description": str key "name": str - key "parameters": ForwardRef('RealtimeFunctionToolParameters', module='types') + key "parameters": ForwardRef('RealtimeFunctionToolParameters') key "type": Literal["function"] description: str name: str @@ -18741,84 +18452,59 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeMCPApprovalRequest(TypedDict, total=False): - key "arguments": Required[str] - key "id": Required[str] - key "name": Required[str] - key "server_label": Required[str] - key "type": Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST]] - arguments: str - id: str - name: str - server_label: str - type: Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST] + arguments: Required[str] + id: Required[str] + name: Required[str] + server_label: Required[str] + type: Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST]] class azure.ai.projects.types.RealtimeMCPApprovalResponse(TypedDict, total=False): - key "approval_request_id": Required[str] - key "approve": Required[bool] - key "id": Required[str] key "reason": Optional[str] - key "type": Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE]] - approval_request_id: str - approve: bool - id: str + approval_request_id: Required[str] + approve: Required[bool] + id: Required[str] reason: str - type: Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE] + type: Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE]] class azure.ai.projects.types.RealtimeMCPHTTPError(TypedDict, total=False): - key "code": Required[int] - key "message": Required[str] - key "type": Required[Literal[RealtimeMcpErrorType.HTTP_ERROR]] - code: int - message: str - type: Literal[RealtimeMcpErrorType.HTTP_ERROR] + code: Required[int] + message: Required[str] + type: Required[Literal[RealtimeMcpErrorType.HTTP_ERROR]] class azure.ai.projects.types.RealtimeMCPListTools(TypedDict, total=False): key "id": str - key "server_label": Required[str] - key "tools": Required[list[MCPListToolsTool]] - key "type": Required[Literal[RealtimeConversationItemType.MCP_LIST_TOOLS]] id: str - server_label: str - tools: list[MCPListToolsTool] - type: Literal[RealtimeConversationItemType.MCP_LIST_TOOLS] + server_label: Required[str] + tools: Required[list[MCPListToolsTool]] + type: Required[Literal[RealtimeConversationItemType.MCP_LIST_TOOLS]] class azure.ai.projects.types.RealtimeMCPProtocolError(TypedDict, total=False): - key "code": Required[int] - key "message": Required[str] - key "type": Required[Literal[RealtimeMcpErrorType.PROTOCOL_ERROR]] - code: int - message: str - type: Literal[RealtimeMcpErrorType.PROTOCOL_ERROR] + code: Required[int] + message: Required[str] + type: Required[Literal[RealtimeMcpErrorType.PROTOCOL_ERROR]] class azure.ai.projects.types.RealtimeMCPToolCall(TypedDict, total=False): key "approval_request_id": Optional[str] - key "arguments": Required[str] - key "error": ForwardRef('RealtimeMCPError', module='types') - key "id": Required[str] - key "name": Required[str] + key "error": ForwardRef('RealtimeMCPError') key "output": Optional[str] - key "server_label": Required[str] - key "type": Required[Literal[RealtimeConversationItemType.MCP_CALL]] approval_request_id: str - arguments: str + arguments: Required[str] error: RealtimeMCPError - id: str - name: str + id: Required[str] + name: Required[str] output: str - server_label: str - type: Literal[RealtimeConversationItemType.MCP_CALL] + server_label: Required[str] + type: Required[Literal[RealtimeConversationItemType.MCP_CALL]] class azure.ai.projects.types.RealtimeMCPToolExecutionError(TypedDict, total=False): - key "message": Required[str] - key "type": Required[Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR]] - message: str - type: Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR] + message: Required[str] + type: Required[Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR]] class azure.ai.projects.types.RealtimeMcpErrorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -18833,7 +18519,7 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeResponseStatusDetails(TypedDict, total=False): - key "error": ForwardRef('RealtimeResponseStatusDetailsError', module='types') + key "error": ForwardRef('RealtimeResponseStatusDetailsError') key "reason": Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"] key "type": Literal["completed", "cancelled", "failed", "incomplete"] error: RealtimeResponseStatusDetailsError @@ -18849,9 +18535,9 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeResponseUsage(TypedDict, total=False): - key "input_token_details": ForwardRef('RealtimeResponseUsageInputTokenDetails', module='types') + key "input_token_details": ForwardRef('RealtimeResponseUsageInputTokenDetails') key "input_tokens": int - key "output_token_details": ForwardRef('RealtimeResponseUsageOutputTokenDetails', module='types') + key "output_token_details": ForwardRef('RealtimeResponseUsageOutputTokenDetails') key "output_tokens": int key "total_tokens": int input_token_details: RealtimeResponseUsageInputTokenDetails @@ -18864,7 +18550,7 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeResponseUsageInputTokenDetails(TypedDict, total=False): key "audio_tokens": int key "cached_tokens": int - key "cached_tokens_details": ForwardRef('RealtimeResponseUsageInputTokenDetailsCachedTokensDetails', module='types') + key "cached_tokens_details": ForwardRef('RealtimeResponseUsageInputTokenDetailsCachedTokensDetails') key "image_tokens": int key "text_tokens": int audio_tokens: int @@ -18891,20 +18577,13 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeServerEvent(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "part": Required[RealtimeServerEventResponseContentPartAddedPart] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED]] - content_index: int - event_id: str - item_id: str - output_index: int - part: RealtimeServerEventResponseContentPartAddedPart - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED] + content_index: Required[int] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + part: Required[RealtimeServerEventResponseContentPartAddedPart] + response_id: Required[str] + type: Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED]] class azure.ai.projects.types.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError(TypedDict, total=False): @@ -18919,25 +18598,20 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeServerEventError(TypedDict, total=False): - key "error": Required[RealtimeServerEventErrorError] - key "event_id": Required[str] - key "type": Required[Literal["error"]] - error: RealtimeServerEventErrorError - event_id: str - type: Literal[error] + error: Required[RealtimeServerEventErrorError] + event_id: Required[str] + type: Required[Literal["error"]] class azure.ai.projects.types.RealtimeServerEventErrorError(TypedDict, total=False): key "code": Optional[str] key "event_id": Optional[str] - key "message": Required[str] key "param": Optional[str] - key "type": Required[str] code: str event_id: str - message: str + message: Required[str] param: str - type: str + type: Required[str] class azure.ai.projects.types.RealtimeServerEventRateLimitsUpdatedRateLimits(TypedDict, total=False): @@ -18952,20 +18626,13 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeServerEventResponseContentPartAdded(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "part": Required[RealtimeServerEventResponseContentPartAddedPart] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED]] - content_index: int - event_id: str - item_id: str - output_index: int - part: RealtimeServerEventResponseContentPartAddedPart - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED] + content_index: Required[int] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + part: Required[RealtimeServerEventResponseContentPartAddedPart] + response_id: Required[str] + type: Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED]] class azure.ai.projects.types.RealtimeServerEventResponseContentPartAddedPart(TypedDict, total=False): @@ -19043,17 +18710,14 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RecurrenceTrigger(TypedDict, total=False): key "endTime": str - key "interval": Required[int] - key "schedule": Required[RecurrenceSchedule] key "startTime": str key "timeZone": str - key "type": Required[Literal[TriggerType.RECURRENCE]] endTime: str - interval: int - schedule: RecurrenceSchedule + interval: Required[int] + schedule: Required[RecurrenceSchedule] startTime: str timeZone: str - type: Literal[TriggerType.RECURRENCE] + type: Required[Literal[TriggerType.RECURRENCE]] class azure.ai.projects.types.RecurrenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -19065,40 +18729,40 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RedTeam(TypedDict, total=False): key "applicationScenario": str + key "attackStrategies": list[Union[str, AttackStrategy]] key "displayName": str - key "id": Required[str] key "numTurns": int + key "properties": dict[str, str] + key "riskCategories": list[Union[str, RiskCategory]] key "simulationOnly": bool key "status": str - key "target": Required[RedTeamTargetConfig] + key "tags": dict[str, str] applicationScenario: str attackStrategies: list[Union[str, AttackStrategy]] displayName: str - id: str + id: Required[str] numTurns: int properties: dict[str, str] riskCategories: list[Union[str, RiskCategory]] simulationOnly: bool status: str tags: dict[str, str] - target: RedTeamTargetConfig + target: Required[RedTeamTargetConfig] class azure.ai.projects.types.RedTeamTargetConfig(TypedDict, total=False): - key "modelDeploymentName": Required[str] - key "type": Required[Literal["AzureOpenAIModel"]] - modelDeploymentName: str - type: Literal[AzureOpenAIModel] + modelDeploymentName: Required[str] + type: Required[Literal["AzureOpenAIModel"]] class azure.ai.projects.types.ReminderPreviewToolboxTool(TypedDict, total=False): key "description": str key "name": str - key "type": Required[Literal[ToolboxToolType.REMINDER_PREVIEW]] + key "tool_configs": dict[str, ToolConfig] description: str name: str tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.REMINDER_PREVIEW] + type: Required[Literal[ToolboxToolType.REMINDER_PREVIEW]] class azure.ai.projects.types.ResponsesProtocolConfiguration(TypedDict, total=False): @@ -19122,27 +18786,24 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RubricBasedEvaluatorDefinition(TypedDict, total=False): - key "dimensions": Required[list[Dimension]] + key "data_schema": dict[str, Any] + key "init_parameters": dict[str, Any] + key "metrics": dict[str, EvaluatorMetric] key "pass_threshold": float - key "type": Required[Literal[EvaluatorDefinitionType.RUBRIC]] data_schema: dict[str, Any] - dimensions: list[Dimension] + dimensions: Required[list[Dimension]] init_parameters: dict[str, Any] metrics: dict[str, EvaluatorMetric] pass_threshold: float - type: Literal[EvaluatorDefinitionType.RUBRIC] + type: Required[Literal[EvaluatorDefinitionType.RUBRIC]] class azure.ai.projects.types.RubricGenerationInputQualityWarning(TypedDict, total=False): - key "code": Required[Union[str, RubricGenerationInputQualityWarningCode]] - key "message": Required[str] - key "severity": Required[Union[str, RubricGenerationInputQualityWarningSeverity]] - key "source": Required[Union[str, RubricGenerationInputQualityWarningSource]] key "source_index": int - code: Union[str, RubricGenerationInputQualityWarningCode] - message: str - severity: Union[str, RubricGenerationInputQualityWarningSeverity] - source: Union[str, RubricGenerationInputQualityWarningSource] + code: Required[Union[str, RubricGenerationInputQualityWarningCode]] + message: Required[str] + severity: Required[Union[str, RubricGenerationInputQualityWarningSeverity]] + source: Required[Union[str, RubricGenerationInputQualityWarningSource]] source_index: int @@ -19153,31 +18814,25 @@ namespace azure.ai.projects.types class azure.ai.projects.types.Schedule(TypedDict, total=False): key "description": str key "displayName": str - key "enabled": Required[bool] - key "id": Required[str] + key "properties": dict[str, str] key "provisioningStatus": Union[str, ScheduleProvisioningStatus] - key "systemData": Required[dict[str, str]] - key "task": Required[ScheduleTask] - key "trigger": Required[Trigger] + key "tags": dict[str, str] description: str displayName: str - enabled: bool - id: str + enabled: Required[bool] + id: Required[str] properties: dict[str, str] provisioningStatus: Union[str, ScheduleProvisioningStatus] - systemData: dict[str, str] + systemData: Required[dict[str, str]] tags: dict[str, str] - task: ScheduleTask - trigger: Trigger + task: Required[ScheduleTask] + trigger: Required[Trigger] class azure.ai.projects.types.ScheduleRoutineTrigger(TypedDict, total=False): - key "cron_expression": Required[str] - key "time_zone": Required[str] - key "type": Required[Literal[RoutineTriggerType.SCHEDULE]] - cron_expression: str - time_zone: str - type: Literal[RoutineTriggerType.SCHEDULE] + cron_expression: Required[str] + time_zone: Required[str] + type: Required[Literal[RoutineTriggerType.SCHEDULE]] class azure.ai.projects.types.ScheduleTaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -19186,79 +18841,73 @@ namespace azure.ai.projects.types class azure.ai.projects.types.SearchMemoriesRequest(TypedDict, total=False): - key "options": ForwardRef('MemorySearchOptions', module='types') + key "items": list[dict[str, Any]] + key "options": ForwardRef('MemorySearchOptions') key "previous_search_id": str - key "scope": Required[str] items: list[dict[str, Any]] options: MemorySearchOptions previous_search_id: str - scope: str + scope: Required[str] class azure.ai.projects.types.SharepointGroundingToolParameters(TypedDict, total=False): + key "project_connections": list[ToolProjectConnection] project_connections: list[ToolProjectConnection] class azure.ai.projects.types.SharepointPreviewTool(TypedDict, total=False): - key "sharepoint_grounding_preview": Required[SharepointGroundingToolParameters] - key "type": Required[Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW]] - sharepoint_grounding_preview: SharepointGroundingToolParameters - type: Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW] + sharepoint_grounding_preview: Required[SharepointGroundingToolParameters] + type: Required[Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW]] class azure.ai.projects.types.SimpleQnADataGenerationJobOptions(TypedDict, total=False): - key "max_samples": Required[int] - key "model_options": ForwardRef('DataGenerationModelOptions', module='types') + key "model_options": ForwardRef('DataGenerationModelOptions') + key "question_types": list[Union[str, SimpleQnAFineTuningQuestionType]] key "train_split": float - key "type": Required[Literal[DataGenerationJobType.SIMPLE_QNA]] - max_samples: int + max_samples: Required[int] model_options: DataGenerationModelOptions question_types: list[Union[str, SimpleQnAFineTuningQuestionType]] train_split: float - type: Literal[DataGenerationJobType.SIMPLE_QNA] + type: Required[Literal[DataGenerationJobType.SIMPLE_QNA]] class azure.ai.projects.types.SkillInlineContent(TypedDict, total=False): + key "allowed_tools": list[str] key "compatibility": str - key "description": Required[str] - key "instructions": Required[str] key "license": str + key "metadata": dict[str, str] allowed_tools: list[str] compatibility: str - description: str - instructions: str + description: Required[str] + instructions: Required[str] license: str metadata: dict[str, str] class azure.ai.projects.types.SkillReferenceParam(TypedDict, total=False): - key "skill_id": Required[str] - key "type": Required[Literal[ContainerSkillType.SKILL_REFERENCE]] key "version": str - skill_id: str - type: Literal[ContainerSkillType.SKILL_REFERENCE] + skill_id: Required[str] + type: Required[Literal[ContainerSkillType.SKILL_REFERENCE]] version: str class azure.ai.projects.types.SpecificApplyPatchParam(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.APPLY_PATCH]] - type: Literal[ToolChoiceParamType.APPLY_PATCH] + type: Required[Literal[ToolChoiceParamType.APPLY_PATCH]] class azure.ai.projects.types.SpecificFunctionShellParam(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.SHELL]] - type: Literal[ToolChoiceParamType.SHELL] + type: Required[Literal[ToolChoiceParamType.SHELL]] class azure.ai.projects.types.SpecificProgrammaticToolCallingParam(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING]] - type: Literal[ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING] + type: Required[Literal[ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING]] class azure.ai.projects.types.StructuredInputDefinition(TypedDict, total=False): key "default_value": Any key "description": str key "required": bool + key "schema": dict[str, Any] default_value: Any description: str required: bool @@ -19266,80 +18915,60 @@ namespace azure.ai.projects.types class azure.ai.projects.types.StructuredOutputDefinition(TypedDict, total=False): - key "description": Required[str] - key "name": Required[str] - key "schema": Required[dict[str, Any]] - key "strict": Required[Optional[bool]] - description: str - name: str - schema: dict[str, Any] - strict: bool + description: Required[str] + name: Required[str] + schema: Required[dict[str, Any]] + strict: Required[Optional[bool]] class azure.ai.projects.types.TaskGenerationDataGenerationJobOptions(TypedDict, total=False): - key "max_samples": Required[int] - key "model_options": ForwardRef('DataGenerationModelOptions', module='types') + key "model_options": ForwardRef('DataGenerationModelOptions') key "train_split": float - key "type": Required[Literal[DataGenerationJobType.TASK_GENERATION]] - max_samples: int + max_samples: Required[int] model_options: DataGenerationModelOptions train_split: float - type: Literal[DataGenerationJobType.TASK_GENERATION] + type: Required[Literal[DataGenerationJobType.TASK_GENERATION]] class azure.ai.projects.types.TaxonomyCategory(TypedDict, total=False): key "description": str - key "id": Required[str] - key "name": Required[str] - key "riskCategory": Required[Union[str, RiskCategory]] - key "subCategories": Required[list[TaxonomySubCategory]] + key "properties": dict[str, str] description: str - id: str - name: str + id: Required[str] + name: Required[str] properties: dict[str, str] - riskCategory: Union[str, RiskCategory] - subCategories: list[TaxonomySubCategory] + riskCategory: Required[Union[str, RiskCategory]] + subCategories: Required[list[TaxonomySubCategory]] class azure.ai.projects.types.TaxonomySubCategory(TypedDict, total=False): key "description": str - key "enabled": Required[bool] - key "id": Required[str] - key "name": Required[str] + key "properties": dict[str, str] description: str - enabled: bool - id: str - name: str + enabled: Required[bool] + id: Required[str] + name: Required[str] properties: dict[str, str] class azure.ai.projects.types.TelemetryConfig(TypedDict, total=False): - key "endpoints": Required[list[TelemetryEndpoint]] - endpoints: list[TelemetryEndpoint] + endpoints: Required[list[TelemetryEndpoint]] class azure.ai.projects.types.TelemetryEndpoint(TypedDict, total=False): - key "auth": ForwardRef('TelemetryEndpointAuth', module='types') - key "data": Required[list[Union[str, TelemetryDataKind]]] - key "endpoint": Required[str] - key "kind": Required[Literal[TelemetryEndpointKind.OTLP]] - key "protocol": Required[Union[str, TelemetryTransportProtocol]] + key "auth": ForwardRef('TelemetryEndpointAuth') auth: TelemetryEndpointAuth - data: list[Union[str, TelemetryDataKind]] - endpoint: str - kind: Literal[TelemetryEndpointKind.OTLP] - protocol: Union[str, TelemetryTransportProtocol] + data: Required[list[Union[str, TelemetryDataKind]]] + endpoint: Required[str] + kind: Required[Literal[TelemetryEndpointKind.OTLP]] + protocol: Required[Union[str, TelemetryTransportProtocol]] class azure.ai.projects.types.TelemetryEndpointAuth(TypedDict, total=False): - key "header_name": Required[str] - key "secret_id": Required[str] - key "secret_key": Required[str] - key "type": Required[Literal[TelemetryEndpointAuthType.HEADER]] - header_name: str - secret_id: str - secret_key: str - type: Literal[TelemetryEndpointAuthType.HEADER] + header_name: Required[str] + secret_id: Required[str] + secret_key: Required[str] + type: Required[Literal[TelemetryEndpointAuthType.HEADER]] class azure.ai.projects.types.TelemetryEndpointAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -19351,10 +18980,8 @@ namespace azure.ai.projects.types class azure.ai.projects.types.TemplateVoiceGreetingConfig(TypedDict, total=False): - key "text": Required[str] - key "type": Required[Literal["template"]] - text: str - type: Literal[template] + text: Required[str] + type: Required[Literal["template"]] class azure.ai.projects.types.TextResponseFormatConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -19364,95 +18991,74 @@ namespace azure.ai.projects.types class azure.ai.projects.types.TextResponseFormatJsonObject(TypedDict, total=False): - key "type": Required[Literal[TextResponseFormatConfigurationType.JSON_OBJECT]] - type: Literal[TextResponseFormatConfigurationType.JSON_OBJECT] + type: Required[Literal[TextResponseFormatConfigurationType.JSON_OBJECT]] class azure.ai.projects.types.TextResponseFormatJsonSchema(TypedDict, total=False): key "description": str - key "name": Required[str] - key "schema": Required[dict[str, Any]] key "strict": Optional[bool] - key "type": Required[Literal[TextResponseFormatConfigurationType.JSON_SCHEMA]] description: str - name: str - schema: dict[str, Any] + name: Required[str] + schema: Required[dict[str, Any]] strict: bool - type: Literal[TextResponseFormatConfigurationType.JSON_SCHEMA] + type: Required[Literal[TextResponseFormatConfigurationType.JSON_SCHEMA]] class azure.ai.projects.types.TextResponseFormatText(TypedDict, total=False): - key "type": Required[Literal[TextResponseFormatConfigurationType.TEXT]] - type: Literal[TextResponseFormatConfigurationType.TEXT] + type: Required[Literal[TextResponseFormatConfigurationType.TEXT]] class azure.ai.projects.types.TimerRoutineTrigger(TypedDict, total=False): key "at": int - key "type": Required[Literal[RoutineTriggerType.TIMER]] at: int - type: Literal[RoutineTriggerType.TIMER] + type: Required[Literal[RoutineTriggerType.TIMER]] class azure.ai.projects.types.ToolChoiceAllowed(TypedDict, total=False): - key "mode": Required[Literal["auto", "required"]] - key "tools": Required[list[dict[str, Any]]] - key "type": Required[Literal[ToolChoiceParamType.ALLOWED_TOOLS]] - mode: Literal[auto, required] - tools: list[dict[str, Any]] - type: Literal[ToolChoiceParamType.ALLOWED_TOOLS] + mode: Required[Literal["auto", "required"]] + tools: Required[list[dict[str, Any]]] + type: Required[Literal[ToolChoiceParamType.ALLOWED_TOOLS]] class azure.ai.projects.types.ToolChoiceCodeInterpreter(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.CODE_INTERPRETER]] - type: Literal[ToolChoiceParamType.CODE_INTERPRETER] + type: Required[Literal[ToolChoiceParamType.CODE_INTERPRETER]] class azure.ai.projects.types.ToolChoiceComputer(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.COMPUTER]] - type: Literal[ToolChoiceParamType.COMPUTER] + type: Required[Literal[ToolChoiceParamType.COMPUTER]] class azure.ai.projects.types.ToolChoiceComputerUse(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.COMPUTER_USE]] - type: Literal[ToolChoiceParamType.COMPUTER_USE] + type: Required[Literal[ToolChoiceParamType.COMPUTER_USE]] class azure.ai.projects.types.ToolChoiceComputerUsePreview(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW]] - type: Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW] + type: Required[Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW]] class azure.ai.projects.types.ToolChoiceCustom(TypedDict, total=False): - key "name": Required[str] - key "type": Required[Literal[ToolChoiceParamType.CUSTOM]] - name: str - type: Literal[ToolChoiceParamType.CUSTOM] + name: Required[str] + type: Required[Literal[ToolChoiceParamType.CUSTOM]] class azure.ai.projects.types.ToolChoiceFileSearch(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.FILE_SEARCH]] - type: Literal[ToolChoiceParamType.FILE_SEARCH] + type: Required[Literal[ToolChoiceParamType.FILE_SEARCH]] class azure.ai.projects.types.ToolChoiceFunction(TypedDict, total=False): - key "name": Required[str] - key "type": Required[Literal[ToolChoiceParamType.FUNCTION]] - name: str - type: Literal[ToolChoiceParamType.FUNCTION] + name: Required[str] + type: Required[Literal[ToolChoiceParamType.FUNCTION]] class azure.ai.projects.types.ToolChoiceImageGeneration(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.IMAGE_GENERATION]] - type: Literal[ToolChoiceParamType.IMAGE_GENERATION] + type: Required[Literal[ToolChoiceParamType.IMAGE_GENERATION]] class azure.ai.projects.types.ToolChoiceMCP(TypedDict, total=False): key "name": Optional[str] - key "server_label": Required[str] - key "type": Required[Literal[ToolChoiceParamType.MCP]] name: str - server_label: str - type: Literal[ToolChoiceParamType.MCP] + server_label: Required[str] + type: Required[Literal[ToolChoiceParamType.MCP]] class azure.ai.projects.types.ToolChoiceParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -19474,13 +19080,11 @@ namespace azure.ai.projects.types class azure.ai.projects.types.ToolChoiceWebSearchPreview(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW]] - type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW] + type: Required[Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW]] class azure.ai.projects.types.ToolChoiceWebSearchPreview20250311(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11]] - type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11] + type: Required[Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11]] class azure.ai.projects.types.ToolConfig(TypedDict, total=False): @@ -19498,29 +19102,27 @@ namespace azure.ai.projects.types class azure.ai.projects.types.ToolProjectConnection(TypedDict, total=False): - key "project_connection_id": Required[str] - project_connection_id: str + project_connection_id: Required[str] class azure.ai.projects.types.ToolSearchToolParam(TypedDict, total=False): key "description": Optional[str] key "execution": Union[str, ToolSearchExecutionType] key "parameters": Optional[EmptyModelParam] - key "type": Required[Literal[ToolType.TOOL_SEARCH]] description: str execution: Union[str, ToolSearchExecutionType] parameters: EmptyModelParam - type: Literal[ToolType.TOOL_SEARCH] + type: Required[Literal[ToolType.TOOL_SEARCH]] class azure.ai.projects.types.ToolSearchToolboxTool(TypedDict, total=False): key "description": str key "name": str - key "type": Required[Literal[ToolboxToolType.TOOLBOX_SEARCH]] + key "tool_configs": dict[str, ToolConfig] description: str name: str tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.TOOLBOX_SEARCH] + type: Required[Literal[ToolboxToolType.TOOLBOX_SEARCH]] class azure.ai.projects.types.ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -19557,46 +19159,40 @@ namespace azure.ai.projects.types class azure.ai.projects.types.ToolUseFineTuningDataGenerationJobOptions(TypedDict, total=False): - key "max_samples": Required[int] - key "model_options": ForwardRef('DataGenerationModelOptions', module='types') + key "model_options": ForwardRef('DataGenerationModelOptions') key "train_split": float - key "type": Required[Literal[DataGenerationJobType.TOOL_USE]] - max_samples: int + max_samples: Required[int] model_options: DataGenerationModelOptions train_split: float - type: Literal[DataGenerationJobType.TOOL_USE] + type: Required[Literal[DataGenerationJobType.TOOL_USE]] class azure.ai.projects.types.ToolboxPolicies(TypedDict, total=False): - key "rai_config": ForwardRef('RaiConfig', module='types') + key "rai_config": ForwardRef('RaiConfig') rai_config: RaiConfig class azure.ai.projects.types.ToolboxSearchPreviewToolboxTool(TypedDict, total=False): key "description": str key "name": str - key "type": Required[Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW]] + key "tool_configs": dict[str, ToolConfig] description: str name: str tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW] + type: Required[Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW]] class azure.ai.projects.types.ToolboxSkill(TypedDict, total=False): - key "name": Required[str] - key "type": Required[Literal["skill_reference"]] key "version": str - name: str - type: Literal[skill_reference] + name: Required[str] + type: Required[Literal["skill_reference"]] version: str class azure.ai.projects.types.ToolboxSkillReference(TypedDict, total=False): - key "name": Required[str] - key "type": Required[Literal["skill_reference"]] key "version": str - name: str - type: Literal[skill_reference] + name: Required[str] + type: Required[Literal["skill_reference"]] version: str @@ -19617,14 +19213,12 @@ namespace azure.ai.projects.types class azure.ai.projects.types.TracesDataGenerationJobOptions(TypedDict, total=False): - key "max_samples": Required[int] - key "model_options": ForwardRef('DataGenerationModelOptions', module='types') + key "model_options": ForwardRef('DataGenerationModelOptions') key "train_split": float - key "type": Required[Literal[DataGenerationJobType.TRACES]] - max_samples: int + max_samples: Required[int] model_options: DataGenerationModelOptions train_split: float - type: Literal[DataGenerationJobType.TRACES] + type: Required[Literal[DataGenerationJobType.TRACES]] class azure.ai.projects.types.TracesDataGenerationJobSource(TypedDict, total=False): @@ -19633,15 +19227,13 @@ namespace azure.ai.projects.types key "agent_version": str key "description": str key "end_time": int - key "start_time": Required[int] - key "type": Required[Literal[DataGenerationJobSourceType.TRACES]] agent_id: str agent_name: str agent_version: str description: str end_time: int - start_time: int - type: Literal[DataGenerationJobSourceType.TRACES] + start_time: Required[int] + type: Required[Literal[DataGenerationJobSourceType.TRACES]] class azure.ai.projects.types.TracesEvaluatorGenerationJobSource(TypedDict, total=False): @@ -19650,35 +19242,27 @@ namespace azure.ai.projects.types key "agent_version": str key "description": str key "end_time": int - key "start_time": Required[int] - key "type": Required[Literal[EvaluatorGenerationJobSourceType.TRACES]] agent_id: str agent_name: str agent_version: str description: str end_time: int - start_time: int - type: Literal[EvaluatorGenerationJobSourceType.TRACES] + start_time: Required[int] + type: Required[Literal[EvaluatorGenerationJobSourceType.TRACES]] class azure.ai.projects.types.TranscriptTextUsageDuration(TypedDict, total=False): - key "seconds": Required[str] - key "type": Required[Literal[CreateTranscriptionResponseJsonUsageType.DURATION]] - seconds: str - type: Literal[CreateTranscriptionResponseJsonUsageType.DURATION] + seconds: Required[str] + type: Required[Literal[CreateTranscriptionResponseJsonUsageType.DURATION]] class azure.ai.projects.types.TranscriptTextUsageTokens(TypedDict, total=False): - key "input_token_details": ForwardRef('TranscriptTextUsageTokensInputTokenDetails', module='types') - key "input_tokens": Required[int] - key "output_tokens": Required[int] - key "total_tokens": Required[int] - key "type": Required[Literal[CreateTranscriptionResponseJsonUsageType.TOKENS]] + key "input_token_details": ForwardRef('TranscriptTextUsageTokensInputTokenDetails') input_token_details: TranscriptTextUsageTokensInputTokenDetails - input_tokens: int - output_tokens: int - total_tokens: int - type: Literal[CreateTranscriptionResponseJsonUsageType.TOKENS] + input_tokens: Required[int] + output_tokens: Required[int] + total_tokens: Required[int] + type: Required[Literal[CreateTranscriptionResponseJsonUsageType.TOKENS]] class azure.ai.projects.types.TranscriptTextUsageTokensInputTokenDetails(TypedDict, total=False): @@ -19695,52 +19279,48 @@ namespace azure.ai.projects.types class azure.ai.projects.types.UpdateMemoriesRequest(TypedDict, total=False): + key "items": list[dict[str, Any]] key "previous_update_id": str - key "scope": Required[str] key "update_delay": int items: list[dict[str, Any]] previous_update_id: str - scope: str + scope: Required[str] update_delay: int class azure.ai.projects.types.UpdateMemoryRequest(TypedDict, total=False): - key "content": Required[str] - content: str + content: Required[str] class azure.ai.projects.types.UpdateMemoryStoreRequest(TypedDict, total=False): key "description": str + key "metadata": dict[str, str] description: str metadata: dict[str, str] class azure.ai.projects.types.UpdateModelVersionRequest(TypedDict, total=False): key "description": str + key "tags": dict[str, str] description: str tags: dict[str, str] class azure.ai.projects.types.UpdateSkillRequest(TypedDict, total=False): - key "default_version": Required[str] - default_version: str + default_version: Required[str] class azure.ai.projects.types.UpdateToolboxRequest(TypedDict, total=False): - key "default_version": Required[str] - default_version: str + default_version: Required[str] class azure.ai.projects.types.UpdateToolboxRequest1(TypedDict, total=False): - key "default_version": Required[str] - default_version: str + default_version: Required[str] class azure.ai.projects.types.VersionIndicator(TypedDict, total=False): - key "agent_version": Required[str] - key "type": Required[Literal[VersionIndicatorType.VERSION_REF]] - agent_version: str - type: Literal[VersionIndicatorType.VERSION_REF] + agent_version: Required[str] + type: Required[Literal[VersionIndicatorType.VERSION_REF]] class azure.ai.projects.types.VersionIndicatorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -19748,24 +19328,18 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VersionRefIndicator(TypedDict, total=False): - key "agent_version": Required[str] - key "type": Required[Literal[VersionIndicatorType.VERSION_REF]] - agent_version: str - type: Literal[VersionIndicatorType.VERSION_REF] + agent_version: Required[str] + type: Required[Literal[VersionIndicatorType.VERSION_REF]] class azure.ai.projects.types.VersionSelectionRule(TypedDict, total=False): - key "agent_version": Required[str] - key "traffic_percentage": Required[int] - key "type": Required[Literal[VersionSelectorType.FIXED_RATIO]] - agent_version: str - traffic_percentage: int - type: Literal[VersionSelectorType.FIXED_RATIO] + agent_version: Required[str] + traffic_percentage: Required[int] + type: Required[Literal[VersionSelectorType.FIXED_RATIO]] class azure.ai.projects.types.VersionSelector(TypedDict, total=False): - key "version_selection_rules": Required[list[VersionSelectionRule]] - version_selection_rules: list[VersionSelectionRule] + version_selection_rules: Required[list[VersionSelectionRule]] class azure.ai.projects.types.VersionSelectorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -19774,16 +19348,16 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceAgentAnimationConfig(TypedDict, total=False): key "model_name": str + key "outputs": list[Union[str, VoiceAgentAnimationOutputType]] model_name: str outputs: list[Union[str, VoiceAgentAnimationOutputType]] class azure.ai.projects.types.VoiceAgentAvatarIceServer(TypedDict, total=False): key "credential": Optional[str] - key "urls": Required[list[str]] key "username": Optional[str] credential: str - urls: list[str] + urls: Required[list[str]] username: str @@ -19812,19 +19386,17 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceAgentAvatarVideoCrop(TypedDict, total=False): - key "bottom_right": Required[list[int]] - key "top_left": Required[list[int]] - bottom_right: list[int] - top_left: list[int] + bottom_right: Required[list[int]] + top_left: Required[list[int]] class azure.ai.projects.types.VoiceAgentAvatarVideoParams(TypedDict, total=False): - key "background": ForwardRef('VoiceAgentAvatarVideoBackground', module='types') + key "background": ForwardRef('VoiceAgentAvatarVideoBackground') key "bitrate": int key "codec": Literal["h264"] - key "crop": ForwardRef('VoiceAgentAvatarVideoCrop', module='types') + key "crop": ForwardRef('VoiceAgentAvatarVideoCrop') key "gop_size": int - key "resolution": ForwardRef('VoiceAgentAvatarVideoResolution', module='types') + key "resolution": ForwardRef('VoiceAgentAvatarVideoResolution') background: VoiceAgentAvatarVideoBackground bitrate: int codec: Literal[h264] @@ -19834,144 +19406,122 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceAgentAvatarVideoResolution(TypedDict, total=False): - key "height": Required[int] - key "width": Required[int] - height: int - width: int + height: Required[int] + width: Required[int] class azure.ai.projects.types.VoiceAgentClientEventConversationItemCreate(TypedDict, total=False): key "event_id": str - key "item": Required[VoiceAgentCreateConversationItem] key "previous_item_id": str - key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE]] event_id: str - item: VoiceAgentCreateConversationItem + item: Required[VoiceAgentCreateConversationItem] previous_item_id: str - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE] + type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE]] class azure.ai.projects.types.VoiceAgentClientEventConversationItemDelete(TypedDict, total=False): key "event_id": str - key "item_id": Required[str] - key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE]] event_id: str - item_id: str - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE] + item_id: Required[str] + type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE]] class azure.ai.projects.types.VoiceAgentClientEventConversationItemRetrieve(TypedDict, total=False): key "event_id": str - key "item_id": Required[str] - key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE]] event_id: str - item_id: str - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE] + item_id: Required[str] + type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE]] class azure.ai.projects.types.VoiceAgentClientEventConversationItemTruncate(TypedDict, total=False): - key "audio_end_ms": Required[int] - key "content_index": Required[int] key "event_id": str - key "item_id": Required[str] - key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE]] - audio_end_ms: int - content_index: int + audio_end_ms: Required[int] + content_index: Required[int] event_id: str - item_id: str - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE] + item_id: Required[str] + type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE]] class azure.ai.projects.types.VoiceAgentClientEventInputAudioBufferAppend(TypedDict, total=False): - key "audio": Required[str] key "event_id": str - key "type": Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND]] - audio: str + audio: Required[str] event_id: str - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND] + type: Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND]] class azure.ai.projects.types.VoiceAgentClientEventInputAudioBufferClear(TypedDict, total=False): key "event_id": str - key "type": Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR]] event_id: str - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR] + type: Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR]] class azure.ai.projects.types.VoiceAgentClientEventInputAudioBufferCommit(TypedDict, total=False): key "event_id": str - key "type": Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT]] event_id: str - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT] + type: Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT]] class azure.ai.projects.types.VoiceAgentClientEventOutputAudioBufferClear(TypedDict, total=False): key "event_id": str - key "type": Required[Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR]] event_id: str - type: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR] + type: Required[Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR]] class azure.ai.projects.types.VoiceAgentClientEventResponseCancel(TypedDict, total=False): key "event_id": str key "response_id": str - key "type": Required[Literal[RealtimeClientEventType.RESPONSE_CANCEL]] event_id: str response_id: str - type: Literal[RealtimeClientEventType.RESPONSE_CANCEL] + type: Required[Literal[RealtimeClientEventType.RESPONSE_CANCEL]] class azure.ai.projects.types.VoiceAgentClientEventResponseCreate(TypedDict, total=False): key "event_id": str - key "response": ForwardRef('VoiceAgentResponseCreateParams', module='types') - key "type": Required[Literal[RealtimeClientEventType.RESPONSE_CREATE]] + key "response": ForwardRef('VoiceAgentResponseCreateParams') event_id: str response: VoiceAgentResponseCreateParams - type: Literal[RealtimeClientEventType.RESPONSE_CREATE] + type: Required[Literal[RealtimeClientEventType.RESPONSE_CREATE]] class azure.ai.projects.types.VoiceAgentClientEventSessionAvatarConnect(TypedDict, total=False): - key "client_sdp": Required[str] key "event_id": str - key "type": Required[Literal["connect"]] - client_sdp: str + client_sdp: Required[str] event_id: str - type: Literal[connect] + type: Required[Literal["connect"]] class azure.ai.projects.types.VoiceAgentClientEventSessionUpdate(TypedDict, total=False): key "event_id": str - key "session": Required[VoiceAgentSessionUpdateConfig] - key "type": Required[Literal[RealtimeClientEventType.SESSION_UPDATE]] event_id: str - session: VoiceAgentSessionUpdateConfig - type: Literal[RealtimeClientEventType.SESSION_UPDATE] + session: Required[VoiceAgentSessionUpdateConfig] + type: Required[Literal[RealtimeClientEventType.SESSION_UPDATE]] class azure.ai.projects.types.VoiceAgentDefinition(TypedDict, total=False): - key "audio": ForwardRef('VoiceAudioConfig', module='types') - key "avatar": ForwardRef('VoiceAvatarConfig', module='types') - key "greeting": ForwardRef('VoiceGreetingConfig', module='types') + key "audio": ForwardRef('VoiceAudioConfig') + key "avatar": ForwardRef('VoiceAvatarConfig') + key "greeting": ForwardRef('VoiceGreetingConfig') + key "include": list[Union[str, VoiceAgentSessionIncludeOption]] key "instructions": str - key "interim_response": ForwardRef('VoiceAgentInterimResponse', module='types') - key "kind": Required[Literal[AgentKind.VOICE]] - key "max_output_tokens": ForwardRef('VoiceAgentMaxOutputTokens', module='types') - key "model": Required[str] - key "model_type": Required[Union[str, VoiceModelType]] + key "interim_response": ForwardRef('VoiceAgentInterimResponse') + key "max_output_tokens": ForwardRef('VoiceAgentMaxOutputTokens') + key "output_modalities": list[Union[str, VoiceOutputModality]] key "parallel_tool_calls": bool - key "rai_config": ForwardRef('RaiConfig', module='types') + key "rai_config": ForwardRef('RaiConfig') key "store": bool - key "tool_choice": ForwardRef('VoiceAgentToolChoice', module='types') + key "structured_inputs": dict[str, StructuredInputDefinition] + key "tool_choice": ForwardRef('VoiceAgentToolChoice') + key "tools": list[VoiceAgentTool] audio: VoiceAudioConfig avatar: VoiceAvatarConfig greeting: VoiceGreetingConfig include: list[Union[str, VoiceAgentSessionIncludeOption]] instructions: str interim_response: VoiceAgentInterimResponse - kind: Literal[AgentKind.VOICE] + kind: Required[Literal[AgentKind.VOICE]] max_output_tokens: VoiceAgentMaxOutputTokens - model: str - model_type: Union[str, VoiceModelType] + model: Required[str] + model_type: Required[Union[str, VoiceModelType]] output_modalities: list[Union[str, VoiceOutputModality]] parallel_tool_calls: bool rai_config: RaiConfig @@ -19984,21 +19534,18 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceAgentEchoCancellation(TypedDict, total=False): key "channels": int key "reference_source": Union[str, VoiceAgentEchoCancellationReferenceSource] - key "type": Required[Literal["server_echo_cancellation"]] channels: int reference_source: Union[str, VoiceAgentEchoCancellationReferenceSource] - type: Literal[server_echo_cancellation] + type: Required[Literal["server_echo_cancellation"]] class azure.ai.projects.types.VoiceAgentFunctionTool(TypedDict, total=False): key "description": str - key "name": Required[str] - key "parameters": ForwardRef('RealtimeFunctionToolParameters', module='types') - key "type": Required[Literal["function"]] + key "parameters": ForwardRef('RealtimeFunctionToolParameters') description: str - name: str + name: Required[str] parameters: RealtimeFunctionToolParameters - type: Literal[function] + type: Required[Literal["function"]] class azure.ai.projects.types.VoiceAgentLlmInterimResponseConfig(TypedDict, total=False): @@ -20006,13 +19553,13 @@ namespace azure.ai.projects.types key "latency_threshold_ms": int key "max_completion_tokens": int key "model": str - key "type": Required[Literal["llm_interim_response"]] + key "triggers": list[Union[str, VoiceAgentInterimResponseTrigger]] instructions: str latency_threshold_ms: int max_completion_tokens: int model: str triggers: list[Union[str, VoiceAgentInterimResponseTrigger]] - type: Literal[llm_interim_response] + type: Required[Literal["llm_interim_response"]] class azure.ai.projects.types.VoiceAgentMcpTool(TypedDict, total=False): @@ -20025,9 +19572,8 @@ namespace azure.ai.projects.types key "require_approval": Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] key "response_scheduling": Union[str, VoiceAgentToolResponseScheduling] key "server_description": str - key "server_label": Required[str] key "server_url": str - key "type": Required[Literal["mcp"]] + key "tool_configs": dict[str, ToolConfig] allowed_callers: list[Union[str, CallableToolAllowedCaller]] allowed_tools: Union[list[str], MCPToolFilter] authorization: str @@ -20037,22 +19583,24 @@ namespace azure.ai.projects.types require_approval: Union[MCPToolRequireApproval, Literal[always], Literal[never]] response_scheduling: Union[str, VoiceAgentToolResponseScheduling] server_description: str - server_label: str + server_label: Required[str] server_url: str tool_configs: dict[str, ToolConfig] - type: Literal[mcp] + type: Required[Literal["mcp"]] class azure.ai.projects.types.VoiceAgentRealtimeResponse(OmitPropertiesRealtimeResponse1): - key "audio": ForwardRef('VoiceResponseAudio', module='types') + key "audio": ForwardRef('VoiceResponseAudio') key "conversation_id": str key "id": str key "max_output_tokens": Union[int, Literal["inf"]] key "metadata": Optional[Metadata] key "object": Literal["response"] + key "output": list[VoiceAgentResponseItem] + key "output_modalities": list[Literal["text", "audio"]] key "status": Literal["completed", "cancelled", "failed", "incomplete", "in_progress"] - key "status_details": ForwardRef('RealtimeResponseStatusDetails', module='types') - key "usage": ForwardRef('RealtimeResponseUsage', module='types') + key "status_details": ForwardRef('RealtimeResponseStatusDetails') + key "usage": ForwardRef('RealtimeResponseUsage') audio: VoiceResponseAudio conversation_id: str id: str @@ -20060,23 +19608,26 @@ namespace azure.ai.projects.types metadata: Metadata object: Literal[response] output: list[VoiceAgentResponseItem] - output_modalities: list[Literal["text", "audio"]] + output_modalities: list[Literal[text, audio]] status: Literal[completed, cancelled, failed, incomplete, in_progress] status_details: RealtimeResponseStatusDetails usage: RealtimeResponseUsage class azure.ai.projects.types.VoiceAgentResponseCreateParams(TypedDict, total=False): - key "audio": ForwardRef('PickPropertiesVoiceAudioConfig', module='types') + key "audio": ForwardRef('PickPropertiesVoiceAudioConfig') key "conversation": Union[Literal["auto"], Literal["none"], str] + key "input": list[RealtimeConversationItem] key "instructions": str key "interim_response": Optional[VoiceAgentInterimResponse] key "max_output_tokens": Union[int, Literal["inf"]] key "metadata": Optional[Metadata] + key "output_modalities": list[Union[str, VoiceOutputModality]] key "parallel_tool_calls": bool key "pre_generated_assistant_message": Optional[RealtimeConversationItemMessageAssistant] - key "reasoning": ForwardRef('RealtimeReasoning', module='types') + key "reasoning": ForwardRef('RealtimeReasoning') key "tool_choice": Union[str, ToolChoiceOptions, ToolChoiceFunction, ToolChoiceMCP] + key "tools": list[Union[RealtimeFunctionTool, MCPTool]] audio: PickPropertiesVoiceAudioConfig conversation: Union[Literal[auto], Literal[none], str] input: list[RealtimeConversationItem] @@ -20094,7 +19645,7 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceAgentResponseEventContentPart(TypedDict, total=False): key "audio": str - key "format": ForwardRef('VoiceAudioFormat', module='types') + key "format": ForwardRef('VoiceAudioFormat') key "text": str key "transcript": str key "type": Literal["audio", "text"] @@ -20110,700 +19661,453 @@ namespace azure.ai.projects.types key "create_response": bool key "eagerness": Literal["low", "medium", "high", "auto"] key "interrupt_response": bool - key "type": Required[Literal[VoiceTurnDetectionType.SEMANTIC_VAD]] auto_truncate: bool create_response: bool eagerness: Literal[low, medium, high, auto] interrupt_response: bool - type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD] + type: Required[Literal[VoiceTurnDetectionType.SEMANTIC_VAD]] class azure.ai.projects.types.VoiceAgentServerEventConversationItemAdded(TypedDict, total=False): - key "event_id": Required[str] - key "item": Required[VoiceAgentResponseItem] key "previous_item_id": Optional[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED]] - event_id: str - item: VoiceAgentResponseItem + event_id: Required[str] + item: Required[VoiceAgentResponseItem] previous_item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED] + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED]] class azure.ai.projects.types.VoiceAgentServerEventConversationItemCreated(TypedDict, total=False): - key "event_id": Required[str] - key "item": Required[VoiceAgentResponseItem] key "previous_item_id": Optional[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED]] - event_id: str - item: VoiceAgentResponseItem + event_id: Required[str] + item: Required[VoiceAgentResponseItem] previous_item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED] + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED]] class azure.ai.projects.types.VoiceAgentServerEventConversationItemDeleted(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED]] - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED] + event_id: Required[str] + item_id: Required[str] + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED]] class azure.ai.projects.types.VoiceAgentServerEventConversationItemDone(TypedDict, total=False): - key "event_id": Required[str] - key "item": Required[VoiceAgentResponseItem] key "previous_item_id": Optional[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE]] - event_id: str - item: VoiceAgentResponseItem + event_id: Required[str] + item: Required[VoiceAgentResponseItem] previous_item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE] + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE]] class azure.ai.projects.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] key "logprobs": Optional[list[LogProbProperties]] key "phrases": Optional[list[VoiceAgentTranscriptionPhrase]] - key "transcript": Required[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED]] - key "usage": Required[Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration]] - content_index: int - event_id: str - item_id: str + content_index: Required[int] + event_id: Required[str] + item_id: Required[str] logprobs: list[LogProbProperties] phrases: list[VoiceAgentTranscriptionPhrase] - transcript: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED] - usage: Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration] + transcript: Required[str] + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED]] + usage: Required[Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration]] class azure.ai.projects.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta(TypedDict, total=False): key "content_index": int key "delta": str - key "event_id": Required[str] - key "item_id": Required[str] key "logprobs": Optional[list[LogProbProperties]] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA]] content_index: int delta: str - event_id: str - item_id: str + event_id: Required[str] + item_id: Required[str] logprobs: list[LogProbProperties] - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA] + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA]] class azure.ai.projects.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed(TypedDict, total=False): - key "content_index": Required[int] - key "error": Required[RealtimeServerEventConversationItemInputAudioTranscriptionFailedError] - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED]] - content_index: int - error: RealtimeServerEventConversationItemInputAudioTranscriptionFailedError - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED] + content_index: Required[int] + error: Required[RealtimeServerEventConversationItemInputAudioTranscriptionFailedError] + event_id: Required[str] + item_id: Required[str] + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED]] class azure.ai.projects.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment(TypedDict, total=False): - key "content_index": Required[int] - key "end": Required[float] - key "event_id": Required[str] - key "id": Required[str] - key "item_id": Required[str] - key "speaker": Required[str] - key "start": Required[float] - key "text": Required[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT]] - content_index: int - end: float - event_id: str - id: str - item_id: str - speaker: str - start: float - text: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT] + content_index: Required[int] + end: Required[float] + event_id: Required[str] + id: Required[str] + item_id: Required[str] + speaker: Required[str] + start: Required[float] + text: Required[str] + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT]] class azure.ai.projects.types.VoiceAgentServerEventConversationItemRetrieved(TypedDict, total=False): - key "event_id": Required[str] - key "item": Required[VoiceAgentResponseItem] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED]] - event_id: str - item: VoiceAgentResponseItem - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED] + event_id: Required[str] + item: Required[VoiceAgentResponseItem] + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED]] class azure.ai.projects.types.VoiceAgentServerEventConversationItemTruncated(TypedDict, total=False): - key "audio_end_ms": Required[int] - key "content_index": Required[int] - key "event_id": Required[str] - key "item": ForwardRef('RealtimeConversationItemMessageAssistant', module='types') - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED]] - audio_end_ms: int - content_index: int - event_id: str + key "item": ForwardRef('RealtimeConversationItemMessageAssistant') + audio_end_ms: Required[int] + content_index: Required[int] + event_id: Required[str] item: RealtimeConversationItemMessageAssistant - item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED] + item_id: Required[str] + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED]] class azure.ai.projects.types.VoiceAgentServerEventInputAudioBufferCleared(TypedDict, total=False): - key "event_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED]] - event_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED] + event_id: Required[str] + type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED]] class azure.ai.projects.types.VoiceAgentServerEventInputAudioBufferCommitted(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] key "previous_item_id": Optional[str] - key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED]] - event_id: str - item_id: str + event_id: Required[str] + item_id: Required[str] previous_item_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED] + type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED]] class azure.ai.projects.types.VoiceAgentServerEventInputAudioBufferSpeechStarted(TypedDict, total=False): - key "audio_start_ms": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED]] - audio_start_ms: int - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED] + audio_start_ms: Required[int] + event_id: Required[str] + item_id: Required[str] + type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED]] class azure.ai.projects.types.VoiceAgentServerEventInputAudioBufferSpeechStopped(TypedDict, total=False): - key "audio_end_ms": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED]] - audio_end_ms: int - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED] + audio_end_ms: Required[int] + event_id: Required[str] + item_id: Required[str] + type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED]] class azure.ai.projects.types.VoiceAgentServerEventInputAudioBufferTimeoutTriggered(TypedDict, total=False): - key "audio_end_ms": Required[int] - key "audio_start_ms": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED]] - audio_end_ms: int - audio_start_ms: int - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED] + audio_end_ms: Required[int] + audio_start_ms: Required[int] + event_id: Required[str] + item_id: Required[str] + type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED]] class azure.ai.projects.types.VoiceAgentServerEventMcpListToolsCompleted(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED]] - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED] + event_id: Required[str] + item_id: Required[str] + type: Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED]] class azure.ai.projects.types.VoiceAgentServerEventMcpListToolsFailed(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED]] - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED] + event_id: Required[str] + item_id: Required[str] + type: Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED]] class azure.ai.projects.types.VoiceAgentServerEventMcpListToolsInProgress(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS]] - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS] + event_id: Required[str] + item_id: Required[str] + type: Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS]] class azure.ai.projects.types.VoiceAgentServerEventOutputAudioBufferCleared(TypedDict, total=False): - key "event_id": Required[str] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED]] - event_id: str - response_id: str - type: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED] + event_id: Required[str] + response_id: Required[str] + type: Required[Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED]] class azure.ai.projects.types.VoiceAgentServerEventRateLimitsUpdated(TypedDict, total=False): - key "event_id": Required[str] - key "rate_limits": Required[list[RealtimeServerEventRateLimitsUpdatedRateLimits]] - key "type": Required[Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED]] - event_id: str - rate_limits: list[RealtimeServerEventRateLimitsUpdatedRateLimits] - type: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED] + event_id: Required[str] + rate_limits: Required[list[RealtimeServerEventRateLimitsUpdatedRateLimits]] + type: Required[Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED]] class azure.ai.projects.types.VoiceAgentServerEventResponseAnimationBlendshapesDelta(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "frame_index": Required[int] - key "frames": Required[list[list[float]]] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal["delta"]] - content_index: int - event_id: str - frame_index: int - frames: list[list[float]] - item_id: str - output_index: int - response_id: str - type: Literal[delta] + content_index: Required[int] + event_id: Required[str] + frame_index: Required[int] + frames: Required[list[list[float]]] + item_id: Required[str] + output_index: Required[int] + response_id: Required[str] + type: Required[Literal["delta"]] class azure.ai.projects.types.VoiceAgentServerEventResponseAnimationBlendshapesDone(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal["done"]] - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[done] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + response_id: Required[str] + type: Required[Literal["done"]] class azure.ai.projects.types.VoiceAgentServerEventResponseAnimationVisemeDelta(TypedDict, total=False): - key "audio_offset_ms": Required[int] - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal["delta"]] - key "viseme_id": Required[int] - audio_offset_ms: int - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[delta] - viseme_id: int + audio_offset_ms: Required[int] + content_index: Required[int] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + response_id: Required[str] + type: Required[Literal["delta"]] + viseme_id: Required[int] class azure.ai.projects.types.VoiceAgentServerEventResponseAnimationVisemeDone(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal["done"]] - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[done] + content_index: Required[int] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + response_id: Required[str] + type: Required[Literal["done"]] class azure.ai.projects.types.VoiceAgentServerEventResponseAudioDelta(TypedDict, total=False): - key "content_index": Required[int] - key "delta": Required[str] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA]] - content_index: int - delta: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA] + content_index: Required[int] + delta: Required[str] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + response_id: Required[str] + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA]] class azure.ai.projects.types.VoiceAgentServerEventResponseAudioDone(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE]] - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE] + content_index: Required[int] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + response_id: Required[str] + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE]] class azure.ai.projects.types.VoiceAgentServerEventResponseAudioTimestampDelta(TypedDict, total=False): - key "audio_duration_ms": Required[int] - key "audio_offset_ms": Required[int] - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "text": Required[str] - key "timestamp_type": Required[Literal["word"]] - key "type": Required[Literal["delta"]] - audio_duration_ms: int - audio_offset_ms: int - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - text: str - timestamp_type: Literal[word] - type: Literal[delta] + audio_duration_ms: Required[int] + audio_offset_ms: Required[int] + content_index: Required[int] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + response_id: Required[str] + text: Required[str] + timestamp_type: Required[Literal["word"]] + type: Required[Literal["delta"]] class azure.ai.projects.types.VoiceAgentServerEventResponseAudioTimestampDone(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal["done"]] - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[done] + content_index: Required[int] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + response_id: Required[str] + type: Required[Literal["done"]] class azure.ai.projects.types.VoiceAgentServerEventResponseAudioTranscriptDelta(TypedDict, total=False): - key "content_index": Required[int] - key "delta": Required[str] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA]] - content_index: int - delta: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA] + content_index: Required[int] + delta: Required[str] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + response_id: Required[str] + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA]] class azure.ai.projects.types.VoiceAgentServerEventResponseAudioTranscriptDone(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "transcript": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE]] - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - transcript: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE] + content_index: Required[int] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + response_id: Required[str] + transcript: Required[str] + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE]] class azure.ai.projects.types.VoiceAgentServerEventResponseContentPartDone(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "part": Required[VoiceAgentResponseEventContentPart] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE]] - content_index: int - event_id: str - item_id: str - output_index: int - part: VoiceAgentResponseEventContentPart - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE] + content_index: Required[int] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + part: Required[VoiceAgentResponseEventContentPart] + response_id: Required[str] + type: Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE]] class azure.ai.projects.types.VoiceAgentServerEventResponseCreated(TypedDict, total=False): - key "event_id": Required[str] - key "response": Required[VoiceAgentRealtimeResponse] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CREATED]] - event_id: str - response: VoiceAgentRealtimeResponse - type: Literal[RealtimeServerEventType.RESPONSE_CREATED] + event_id: Required[str] + response: Required[VoiceAgentRealtimeResponse] + type: Required[Literal[RealtimeServerEventType.RESPONSE_CREATED]] class azure.ai.projects.types.VoiceAgentServerEventResponseDone(TypedDict, total=False): - key "event_id": Required[str] - key "response": Required[VoiceAgentRealtimeResponse] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_DONE]] - event_id: str - response: VoiceAgentRealtimeResponse - type: Literal[RealtimeServerEventType.RESPONSE_DONE] + event_id: Required[str] + response: Required[VoiceAgentRealtimeResponse] + type: Required[Literal[RealtimeServerEventType.RESPONSE_DONE]] class azure.ai.projects.types.VoiceAgentServerEventResponseFunctionCallArgumentsDelta(TypedDict, total=False): - key "call_id": Required[str] - key "delta": Required[str] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA]] - call_id: str - delta: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA] + call_id: Required[str] + delta: Required[str] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + response_id: Required[str] + type: Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA]] class azure.ai.projects.types.VoiceAgentServerEventResponseFunctionCallArgumentsDone(TypedDict, total=False): - key "arguments": Required[str] - key "call_id": Required[str] - key "event_id": Required[str] - key "item_id": Required[str] - key "name": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE]] - arguments: str - call_id: str - event_id: str - item_id: str - name: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE] + arguments: Required[str] + call_id: Required[str] + event_id: Required[str] + item_id: Required[str] + name: Required[str] + output_index: Required[int] + response_id: Required[str] + type: Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE]] class azure.ai.projects.types.VoiceAgentServerEventResponseMcpCallArgumentsDelta(TypedDict, total=False): - key "delta": Required[str] - key "event_id": Required[str] - key "item_id": Required[str] key "obfuscation": Optional[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA]] - delta: str - event_id: str - item_id: str + delta: Required[str] + event_id: Required[str] + item_id: Required[str] obfuscation: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA] + output_index: Required[int] + response_id: Required[str] + type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA]] class azure.ai.projects.types.VoiceAgentServerEventResponseMcpCallArgumentsDone(TypedDict, total=False): - key "arguments": Required[str] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE]] - arguments: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE] + arguments: Required[str] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + response_id: Required[str] + type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE]] class azure.ai.projects.types.VoiceAgentServerEventResponseMcpCallCompleted(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED]] - event_id: str - item_id: str - output_index: int - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED]] class azure.ai.projects.types.VoiceAgentServerEventResponseMcpCallFailed(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED]] - event_id: str - item_id: str - output_index: int - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED]] class azure.ai.projects.types.VoiceAgentServerEventResponseMcpCallInProgress(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS]] - event_id: str - item_id: str - output_index: int - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS]] class azure.ai.projects.types.VoiceAgentServerEventResponseOutputItemAdded(TypedDict, total=False): - key "event_id": Required[str] - key "item": Required[VoiceAgentResponseItem] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED]] - event_id: str - item: VoiceAgentResponseItem - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED] + event_id: Required[str] + item: Required[VoiceAgentResponseItem] + output_index: Required[int] + response_id: Required[str] + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED]] class azure.ai.projects.types.VoiceAgentServerEventResponseOutputItemDone(TypedDict, total=False): - key "event_id": Required[str] - key "item": Required[VoiceAgentResponseItem] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE]] - event_id: str - item: VoiceAgentResponseItem - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE] + event_id: Required[str] + item: Required[VoiceAgentResponseItem] + output_index: Required[int] + response_id: Required[str] + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE]] class azure.ai.projects.types.VoiceAgentServerEventResponseTextDelta(TypedDict, total=False): - key "content_index": Required[int] - key "delta": Required[str] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA]] - content_index: int - delta: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA] + content_index: Required[int] + delta: Required[str] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + response_id: Required[str] + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA]] class azure.ai.projects.types.VoiceAgentServerEventResponseTextDone(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "text": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE]] - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - text: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE] + content_index: Required[int] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + response_id: Required[str] + text: Required[str] + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE]] class azure.ai.projects.types.VoiceAgentServerEventResponseVideoDelta(TypedDict, total=False): - key "codec": Required[str] - key "delta": Required[str] - key "event_id": Required[str] - key "output_index": Required[int] - key "type": Required[Literal["delta"]] - codec: str - delta: str - event_id: str - output_index: int - type: Literal[delta] + codec: Required[str] + delta: Required[str] + event_id: Required[str] + output_index: Required[int] + type: Required[Literal["delta"]] class azure.ai.projects.types.VoiceAgentServerEventSessionAvatarConnecting(TypedDict, total=False): - key "event_id": Required[str] - key "server_sdp": Required[str] - key "type": Required[Literal["connecting"]] - event_id: str - server_sdp: str - type: Literal[connecting] + event_id: Required[str] + server_sdp: Required[str] + type: Required[Literal["connecting"]] class azure.ai.projects.types.VoiceAgentServerEventSessionAvatarSwitchToIdle(TypedDict, total=False): - key "event_id": Required[str] key "turn_id": str - key "type": Required[Literal["switch_to_idle"]] - event_id: str + event_id: Required[str] turn_id: str - type: Literal[switch_to_idle] + type: Required[Literal["switch_to_idle"]] class azure.ai.projects.types.VoiceAgentServerEventSessionAvatarSwitchToSpeaking(TypedDict, total=False): - key "event_id": Required[str] key "turn_id": str - key "type": Required[Literal["switch_to_speaking"]] - event_id: str + event_id: Required[str] turn_id: str - type: Literal[switch_to_speaking] + type: Required[Literal["switch_to_speaking"]] class azure.ai.projects.types.VoiceAgentServerEventSessionCreated(TypedDict, total=False): - key "event_id": Required[str] - key "session": Required[VoiceAgentSessionResponseConfig] - key "type": Required[Literal[RealtimeServerEventType.SESSION_CREATED]] - event_id: str - session: VoiceAgentSessionResponseConfig - type: Literal[RealtimeServerEventType.SESSION_CREATED] + event_id: Required[str] + session: Required[VoiceAgentSessionResponseConfig] + type: Required[Literal[RealtimeServerEventType.SESSION_CREATED]] class azure.ai.projects.types.VoiceAgentServerEventSessionUpdated(TypedDict, total=False): - key "event_id": Required[str] - key "session": Required[VoiceAgentSessionResponseConfig] - key "type": Required[Literal[RealtimeServerEventType.SESSION_UPDATED]] - event_id: str - session: VoiceAgentSessionResponseConfig - type: Literal[RealtimeServerEventType.SESSION_UPDATED] + event_id: Required[str] + session: Required[VoiceAgentSessionResponseConfig] + type: Required[Literal[RealtimeServerEventType.SESSION_UPDATED]] class azure.ai.projects.types.VoiceAgentServerEventWarning(TypedDict, total=False): - key "event_id": Required[str] - key "type": Required[Literal["warning"]] - key "warning": Required[VoiceAgentServerEventWarningDetails] - event_id: str - type: Literal[warning] - warning: VoiceAgentServerEventWarningDetails + event_id: Required[str] + type: Required[Literal["warning"]] + warning: Required[VoiceAgentServerEventWarningDetails] class azure.ai.projects.types.VoiceAgentServerEventWarningDetails(TypedDict, total=False): key "code": str - key "message": Required[str] key "param": str code: str - message: str + message: Required[str] param: str class azure.ai.projects.types.VoiceAgentSessionAvatarConfig(VoiceAvatarConfig): - key "character": Required[str] key "customized": bool key "ice_servers": Optional[list[VoiceAgentAvatarIceServer]] key "model": str key "output_audit_audio": bool key "output_protocol": Union[str, VoiceAvatarOutputProtocol] - key "scene": ForwardRef('VoiceAgentAvatarScene', module='types') + key "scene": ForwardRef('VoiceAgentAvatarScene') key "style": str - key "type": Required[Union[str, VoiceAvatarType]] - key "video": ForwardRef('VoiceAgentAvatarVideoParams', module='types') - character: str + key "video": ForwardRef('VoiceAgentAvatarVideoParams') + character: Required[str] customized: bool ice_servers: list[VoiceAgentAvatarIceServer] model: str @@ -20811,62 +20115,65 @@ namespace azure.ai.projects.types output_protocol: Union[str, VoiceAvatarOutputProtocol] scene: VoiceAgentAvatarScene style: str - type: Union[str, VoiceAvatarType] + type: Required[Union[str, VoiceAvatarType]] video: VoiceAgentAvatarVideoParams class azure.ai.projects.types.VoiceAgentSessionResponseConfig(TypedDict, total=False): - key "animation": ForwardRef('VoiceAgentAnimationConfig', module='types') - key "audio": ForwardRef('VoiceAudioConfig', module='types') - key "avatar": ForwardRef('VoiceAgentSessionAvatarConfig', module='types') + key "animation": ForwardRef('VoiceAgentAnimationConfig') + key "audio": ForwardRef('VoiceAudioConfig') + key "avatar": ForwardRef('VoiceAgentSessionAvatarConfig') key "expires_at": Optional[int] - key "greeting": ForwardRef('VoiceGreetingConfig', module='types') - key "id": Required[str] + key "greeting": ForwardRef('VoiceGreetingConfig') + key "include": list[Union[str, VoiceAgentSessionIncludeOption]] key "instructions": str - key "interim_response": ForwardRef('VoiceAgentInterimResponse', module='types') - key "max_output_tokens": ForwardRef('VoiceAgentMaxOutputTokens', module='types') - key "model": Required[str] - key "object": Required[Literal["session"]] + key "interim_response": ForwardRef('VoiceAgentInterimResponse') + key "max_output_tokens": ForwardRef('VoiceAgentMaxOutputTokens') + key "metadata": dict[str, str] + key "output_modalities": list[Union[str, VoiceOutputModality]] key "parallel_tool_calls": bool - key "reasoning": ForwardRef('RealtimeReasoning', module='types') + key "reasoning": ForwardRef('RealtimeReasoning') key "temperature": float - key "tool_choice": ForwardRef('VoiceAgentToolChoice', module='types') - key "type": Required[Literal["realtime"]] + key "tool_choice": ForwardRef('VoiceAgentToolChoice') + key "tools": list[VoiceAgentTool] animation: VoiceAgentAnimationConfig audio: VoiceAudioConfig avatar: VoiceAgentSessionAvatarConfig expires_at: int greeting: VoiceGreetingConfig - id: str + id: Required[str] include: list[Union[str, VoiceAgentSessionIncludeOption]] instructions: str interim_response: VoiceAgentInterimResponse max_output_tokens: VoiceAgentMaxOutputTokens metadata: dict[str, str] - model: str - object: Literal[session] + model: Required[str] + object: Required[Literal["session"]] output_modalities: list[Union[str, VoiceOutputModality]] parallel_tool_calls: bool reasoning: RealtimeReasoning temperature: float tool_choice: VoiceAgentToolChoice tools: list[VoiceAgentTool] - type: Literal[realtime] + type: Required[Literal["realtime"]] class azure.ai.projects.types.VoiceAgentSessionUpdateConfig(TypedDict, total=False): - key "animation": ForwardRef('VoiceAgentAnimationConfig', module='types') - key "audio": ForwardRef('VoiceAudioConfig', module='types') - key "avatar": ForwardRef('VoiceAgentSessionAvatarConfig', module='types') - key "greeting": ForwardRef('VoiceGreetingConfig', module='types') + key "animation": ForwardRef('VoiceAgentAnimationConfig') + key "audio": ForwardRef('VoiceAudioConfig') + key "avatar": ForwardRef('VoiceAgentSessionAvatarConfig') + key "greeting": ForwardRef('VoiceGreetingConfig') + key "include": list[Union[str, VoiceAgentSessionIncludeOption]] key "instructions": str - key "interim_response": ForwardRef('VoiceAgentInterimResponse', module='types') - key "max_output_tokens": ForwardRef('VoiceAgentMaxOutputTokens', module='types') + key "interim_response": ForwardRef('VoiceAgentInterimResponse') + key "max_output_tokens": ForwardRef('VoiceAgentMaxOutputTokens') + key "metadata": dict[str, str] + key "output_modalities": list[Union[str, VoiceOutputModality]] key "parallel_tool_calls": bool - key "reasoning": ForwardRef('RealtimeReasoning', module='types') + key "reasoning": ForwardRef('RealtimeReasoning') key "temperature": float - key "tool_choice": ForwardRef('VoiceAgentToolChoice', module='types') - key "type": Required[Literal["realtime"]] + key "tool_choice": ForwardRef('VoiceAgentToolChoice') + key "tools": list[VoiceAgentTool] animation: VoiceAgentAnimationConfig audio: VoiceAudioConfig avatar: VoiceAgentSessionAvatarConfig @@ -20882,78 +20189,69 @@ namespace azure.ai.projects.types temperature: float tool_choice: VoiceAgentToolChoice tools: list[VoiceAgentTool] - type: Literal[realtime] + type: Required[Literal["realtime"]] class azure.ai.projects.types.VoiceAgentStaticInterimResponseConfig(TypedDict, total=False): key "latency_threshold_ms": int - key "type": Required[Literal["static_interim_response"]] + key "texts": list[str] + key "triggers": list[Union[str, VoiceAgentInterimResponseTrigger]] latency_threshold_ms: int texts: list[str] triggers: list[Union[str, VoiceAgentInterimResponseTrigger]] - type: Literal[static_interim_response] + type: Required[Literal["static_interim_response"]] class azure.ai.projects.types.VoiceAgentTranscriptionPhrase(TypedDict, total=False): key "confidence": Optional[float] - key "duration_milliseconds": Required[int] key "locale": Optional[str] - key "offset_milliseconds": Required[int] - key "text": Required[str] key "words": Optional[list[VoiceAgentTranscriptionWord]] confidence: float - duration_milliseconds: int + duration_milliseconds: Required[int] locale: str - offset_milliseconds: int - text: str + offset_milliseconds: Required[int] + text: Required[str] words: list[VoiceAgentTranscriptionWord] class azure.ai.projects.types.VoiceAgentTranscriptionWord(TypedDict, total=False): - key "duration_milliseconds": Required[int] - key "offset_milliseconds": Required[int] - key "text": Required[str] - duration_milliseconds: int - offset_milliseconds: int - text: str + duration_milliseconds: Required[int] + offset_milliseconds: Required[int] + text: Required[str] class azure.ai.projects.types.VoiceAssistantMessageItem(TypedDict, total=False): - key "content": Required[list[RealtimeConversationItemMessageAssistantContent]] key "created_at": int key "id": str key "object": Literal["item"] key "response_id": str - key "role": Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal[VoiceConversationItemType.MESSAGE]] - content: list[RealtimeConversationItemMessageAssistantContent] + content: Required[list[RealtimeConversationItemMessageAssistantContent]] created_at: int id: str object: Literal[item] response_id: str - role: Literal[RealtimeConversationItemMessageType.ASSISTANT] + role: Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] status: Literal[completed, incomplete, in_progress] - type: Literal[VoiceConversationItemType.MESSAGE] + type: Required[Literal[VoiceConversationItemType.MESSAGE]] class azure.ai.projects.types.VoiceAudioConfig(TypedDict, total=False): - key "input": ForwardRef('VoiceAudioInputConfig', module='types') - key "output": ForwardRef('VoiceAudioOutputConfig', module='types') + key "input": ForwardRef('VoiceAudioInputConfig') + key "output": ForwardRef('VoiceAudioOutputConfig') input: VoiceAudioInputConfig output: VoiceAudioOutputConfig class azure.ai.projects.types.VoiceAudioFormat(TypedDict, total=False): key "rate": int - key "type": Required[Union[str, VoiceAudioFormatType]] rate: int - type: Union[str, VoiceAudioFormatType] + type: Required[Union[str, VoiceAudioFormatType]] class azure.ai.projects.types.VoiceAudioInputConfig(TypedDict, total=False): key "echo_cancellation": Optional[VoiceAgentEchoCancellation] - key "format": ForwardRef('VoiceAudioFormat', module='types') + key "format": ForwardRef('VoiceAudioFormat') key "noise_reduction": Optional[VoiceNoiseReduction] key "transcription": Optional[VoiceInputTranscription] key "turn_detection": Optional[VoiceAgentTurnDetection] @@ -20968,9 +20266,11 @@ namespace azure.ai.projects.types key "custom_lexicon_url": str key "custom_text_normalization_url": str key "custom_voice_endpoint_id": str - key "format": ForwardRef('VoiceAudioFormat', module='types') + key "format": ForwardRef('VoiceAudioFormat') + key "output_audio_timestamp_types": list[Union[str, VoiceAudioTimestampType]] key "personal_voice_model": str key "pitch": str + key "prefer_locales": list[str] key "speed": float key "style": str key "voice": str @@ -20996,23 +20296,21 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceAvatarConfig(TypedDict, total=False): - key "character": Required[str] key "customized": bool key "model": str key "output_audit_audio": bool key "output_protocol": Union[str, VoiceAvatarOutputProtocol] - key "scene": ForwardRef('VoiceAgentAvatarScene', module='types') + key "scene": ForwardRef('VoiceAgentAvatarScene') key "style": str - key "type": Required[Union[str, VoiceAvatarType]] - key "video": ForwardRef('VoiceAgentAvatarVideoParams', module='types') - character: str + key "video": ForwardRef('VoiceAgentAvatarVideoParams') + character: Required[str] customized: bool model: str output_audit_audio: bool output_protocol: Union[str, VoiceAvatarOutputProtocol] scene: VoiceAgentAvatarScene style: str - type: Union[str, VoiceAvatarType] + type: Required[Union[str, VoiceAvatarType]] video: VoiceAgentAvatarVideoParams @@ -21027,7 +20325,6 @@ namespace azure.ai.projects.types key "silence_duration_ms": str key "speech_duration_ms": str key "threshold": float - key "type": Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN]] auto_truncate: bool create_response: bool end_of_utterance_detection: VoiceEndOfUtteranceDetection @@ -21038,7 +20335,7 @@ namespace azure.ai.projects.types silence_duration_ms: str speech_duration_ms: str threshold: float - type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN] + type: Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN]] class azure.ai.projects.types.VoiceAzureSemanticVadMultilingualTurnDetection(TypedDict, total=False): @@ -21047,12 +20344,12 @@ namespace azure.ai.projects.types key "end_of_utterance_detection": Optional[VoiceEndOfUtteranceDetection] key "idle_timeout_ms": str key "interrupt_response": bool + key "languages": list[str] key "prefix_padding_ms": str key "remove_filler_words": bool key "silence_duration_ms": str key "speech_duration_ms": str key "threshold": float - key "type": Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL]] auto_truncate: bool create_response: bool end_of_utterance_detection: VoiceEndOfUtteranceDetection @@ -21064,7 +20361,7 @@ namespace azure.ai.projects.types silence_duration_ms: str speech_duration_ms: str threshold: float - type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] + type: Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL]] class azure.ai.projects.types.VoiceAzureSemanticVadTurnDetection(TypedDict, total=False): @@ -21073,12 +20370,12 @@ namespace azure.ai.projects.types key "end_of_utterance_detection": Optional[VoiceEndOfUtteranceDetection] key "idle_timeout_ms": str key "interrupt_response": bool + key "languages": list[str] key "prefix_padding_ms": str key "remove_filler_words": bool key "silence_duration_ms": str key "speech_duration_ms": str key "threshold": float - key "type": Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD]] auto_truncate: bool create_response: bool end_of_utterance_detection: VoiceEndOfUtteranceDetection @@ -21090,7 +20387,7 @@ namespace azure.ai.projects.types silence_duration_ms: str speech_duration_ms: str threshold: float - type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD] + type: Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD]] class azure.ai.projects.types.VoiceConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -21104,153 +20401,129 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceEndOfUtteranceDetection(TypedDict, total=False): - key "model": Required[Union[str, VoiceEndOfUtteranceDetectionModel]] key "threshold_level": Union[str, VoiceEndOfUtteranceThresholdLevel] key "timeout_ms": str - model: Union[str, VoiceEndOfUtteranceDetectionModel] + model: Required[Union[str, VoiceEndOfUtteranceDetectionModel]] threshold_level: Union[str, VoiceEndOfUtteranceThresholdLevel] timeout_ms: str class azure.ai.projects.types.VoiceFunctionCallItem(TypedDict, total=False): - key "arguments": Required[str] key "call_id": str key "created_at": int key "id": str - key "name": Required[str] key "object": Literal["item"] key "response_id": str key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal[VoiceConversationItemType.FUNCTION_CALL]] - arguments: str + arguments: Required[str] call_id: str created_at: int id: str - name: str + name: Required[str] object: Literal[item] response_id: str status: Literal[completed, incomplete, in_progress] - type: Literal[VoiceConversationItemType.FUNCTION_CALL] + type: Required[Literal[VoiceConversationItemType.FUNCTION_CALL]] class azure.ai.projects.types.VoiceFunctionCallOutputItem(TypedDict, total=False): - key "call_id": Required[str] key "created_at": int key "id": str key "name": str key "object": Literal["item"] - key "output": Required[str] key "response_id": str key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT]] - call_id: str + call_id: Required[str] created_at: int id: str name: str object: Literal[item] - output: str + output: Required[str] response_id: str status: Literal[completed, incomplete, in_progress] - type: Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT] + type: Required[Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT]] class azure.ai.projects.types.VoiceInputTranscription(TypedDict, total=False): + key "custom_speech": dict[str, str] key "delay": Literal["minimal", "low", "medium", "high", "xhigh"] key "language": str - key "model": Required[Union[str, VoiceInputTranscriptionModel]] + key "phrase_list": list[str] key "prompt": str custom_speech: dict[str, str] delay: Literal[minimal, low, medium, high, xhigh] language: str - model: Union[str, VoiceInputTranscriptionModel] + model: Required[Union[str, VoiceInputTranscriptionModel]] phrase_list: list[str] prompt: str class azure.ai.projects.types.VoiceMcpApprovalRequestItem(TypedDict, total=False): - key "arguments": Required[str] key "created_at": int - key "id": Required[str] - key "name": Required[str] key "response_id": str - key "server_label": Required[str] - key "type": Required[Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST]] - arguments: str + arguments: Required[str] created_at: int - id: str - name: str + id: Required[str] + name: Required[str] response_id: str - server_label: str - type: Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST] + server_label: Required[str] + type: Required[Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST]] class azure.ai.projects.types.VoiceMcpApprovalResponseItem(TypedDict, total=False): - key "approval_request_id": Required[str] - key "approve": Required[bool] key "created_at": int - key "id": Required[str] key "reason": Optional[str] key "response_id": str - key "type": Required[Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE]] - approval_request_id: str - approve: bool + approval_request_id: Required[str] + approve: Required[bool] created_at: int - id: str + id: Required[str] reason: str response_id: str - type: Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE] + type: Required[Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE]] class azure.ai.projects.types.VoiceMcpCallItem(TypedDict, total=False): key "approval_request_id": Optional[str] - key "arguments": Required[str] key "created_at": int - key "error": ForwardRef('RealtimeMCPError', module='types') - key "id": Required[str] - key "name": Required[str] + key "error": ForwardRef('RealtimeMCPError') key "output": Optional[str] key "response_id": str - key "server_label": Required[str] - key "type": Required[Literal[VoiceConversationItemType.MCP_CALL]] approval_request_id: str - arguments: str + arguments: Required[str] created_at: int error: RealtimeMCPError - id: str - name: str + id: Required[str] + name: Required[str] output: str response_id: str - server_label: str - type: Literal[VoiceConversationItemType.MCP_CALL] + server_label: Required[str] + type: Required[Literal[VoiceConversationItemType.MCP_CALL]] class azure.ai.projects.types.VoiceMcpListToolsItem(TypedDict, total=False): key "created_at": int key "id": str key "response_id": str - key "server_label": Required[str] - key "tools": Required[list[MCPListToolsTool]] - key "type": Required[Literal[VoiceConversationItemType.MCP_LIST_TOOLS]] created_at: int id: str response_id: str - server_label: str - tools: list[MCPListToolsTool] - type: Literal[VoiceConversationItemType.MCP_LIST_TOOLS] + server_label: Required[str] + tools: Required[list[MCPListToolsTool]] + type: Required[Literal[VoiceConversationItemType.MCP_LIST_TOOLS]] class azure.ai.projects.types.VoiceNoiseReduction(TypedDict, total=False): - key "type": Required[Union[str, VoiceNoiseReductionType]] - type: Union[str, VoiceNoiseReductionType] + type: Required[Union[str, VoiceNoiseReductionType]] class azure.ai.projects.types.VoiceResponseAudio(TypedDict, total=False): - key "output": ForwardRef('VoiceResponseAudioOutput', module='types') + key "output": ForwardRef('VoiceResponseAudioOutput') output: VoiceResponseAudioOutput class azure.ai.projects.types.VoiceResponseAudioOutput(TypedDict, total=False): - key "format": ForwardRef('RealtimeAudioFormats', module='types') + key "format": ForwardRef('RealtimeAudioFormats') key "voice": str key "voice_locale": str key "voice_type": str @@ -21270,7 +20543,6 @@ namespace azure.ai.projects.types key "silence_duration_ms": int key "speech_duration_ms": int key "threshold": float - key "type": Required[Literal[VoiceTurnDetectionType.SERVER_VAD]] auto_truncate: bool create_response: bool end_of_utterance_detection: VoiceEndOfUtteranceDetection @@ -21280,46 +20552,38 @@ namespace azure.ai.projects.types silence_duration_ms: int speech_duration_ms: int threshold: float - type: Literal[VoiceTurnDetectionType.SERVER_VAD] + type: Required[Literal[VoiceTurnDetectionType.SERVER_VAD]] class azure.ai.projects.types.VoiceSystemMessageItem(TypedDict, total=False): - key "content": Required[list[RealtimeConversationItemMessageSystemContent]] key "created_at": int key "id": str key "object": Literal["item"] key "response_id": str - key "role": Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal[VoiceConversationItemType.MESSAGE]] - content: list[RealtimeConversationItemMessageSystemContent] + content: Required[list[RealtimeConversationItemMessageSystemContent]] created_at: int id: str object: Literal[item] response_id: str - role: Literal[RealtimeConversationItemMessageType.SYSTEM] + role: Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] status: Literal[completed, incomplete, in_progress] - type: Literal[VoiceConversationItemType.MESSAGE] + type: Required[Literal[VoiceConversationItemType.MESSAGE]] class azure.ai.projects.types.VoiceSystemTool(TypedDict, total=False): key "description": str - key "name": Required[Union[str, VoiceSystemToolName]] - key "type": Required[Literal["system"]] description: str - name: Union[str, VoiceSystemToolName] - type: Literal[system] + name: Required[Union[str, VoiceSystemToolName]] + type: Required[Literal["system"]] class azure.ai.projects.types.VoiceToolboxTool(TypedDict, total=False): key "response_scheduling": Union[str, VoiceAgentToolResponseScheduling] - key "toolbox_name": Required[str] - key "toolbox_version": Required[str] - key "type": Required[Literal["toolbox"]] response_scheduling: Union[str, VoiceAgentToolResponseScheduling] - toolbox_name: str - toolbox_version: str - type: Literal[toolbox] + toolbox_name: Required[str] + toolbox_version: Required[str] + type: Required[Literal["toolbox"]] class azure.ai.projects.types.VoiceTurnDetectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -21331,22 +20595,19 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceUserMessageItem(TypedDict, total=False): - key "content": Required[list[RealtimeConversationItemMessageUserContent]] key "created_at": int key "id": str key "object": Literal["item"] key "response_id": str - key "role": Required[Literal[RealtimeConversationItemMessageType.USER]] key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal[VoiceConversationItemType.MESSAGE]] - content: list[RealtimeConversationItemMessageUserContent] + content: Required[list[RealtimeConversationItemMessageUserContent]] created_at: int id: str object: Literal[item] response_id: str - role: Literal[RealtimeConversationItemMessageType.USER] + role: Required[Literal[RealtimeConversationItemMessageType.USER]] status: Literal[completed, incomplete, in_progress] - type: Literal[VoiceConversationItemType.MESSAGE] + type: Required[Literal[VoiceConversationItemType.MESSAGE]] class azure.ai.projects.types.WebSearchApproximateLocation(TypedDict, total=False): @@ -21354,38 +20615,35 @@ namespace azure.ai.projects.types key "country": Optional[str] key "region": Optional[str] key "timezone": Optional[str] - key "type": Required[Literal["approximate"]] city: str country: str region: str timezone: str - type: Literal[approximate] + type: Required[Literal["approximate"]] class azure.ai.projects.types.WebSearchConfiguration(TypedDict, total=False): - key "instance_name": Required[str] - key "project_connection_id": Required[str] - instance_name: str - project_connection_id: str + instance_name: Required[str] + project_connection_id: Required[str] class azure.ai.projects.types.WebSearchPreviewTool(TypedDict, total=False): + key "search_content_types": list[Union[str, SearchContentType]] key "search_context_size": Union[str, SearchContextSize] - key "type": Required[Literal[ToolType.WEB_SEARCH_PREVIEW]] key "user_location": Optional[ApproximateLocation] search_content_types: list[Union[str, SearchContentType]] search_context_size: Union[str, SearchContextSize] - type: Literal[ToolType.WEB_SEARCH_PREVIEW] + type: Required[Literal[ToolType.WEB_SEARCH_PREVIEW]] user_location: ApproximateLocation class azure.ai.projects.types.WebSearchTool(TypedDict, total=False): - key "custom_search_configuration": ForwardRef('WebSearchConfiguration', module='types') + key "custom_search_configuration": ForwardRef('WebSearchConfiguration') key "description": str key "filters": Optional[WebSearchToolFilters] key "name": str key "search_context_size": Literal["low", "medium", "high"] - key "type": Required[Literal[ToolType.WEB_SEARCH]] + key "tool_configs": dict[str, ToolConfig] key "user_location": Optional[WebSearchApproximateLocation] custom_search_configuration: WebSearchConfiguration description: str @@ -21393,7 +20651,7 @@ namespace azure.ai.projects.types name: str search_context_size: Literal[low, medium, high] tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.WEB_SEARCH] + type: Required[Literal[ToolType.WEB_SEARCH]] user_location: WebSearchApproximateLocation @@ -21403,12 +20661,12 @@ namespace azure.ai.projects.types class azure.ai.projects.types.WebSearchToolboxTool(TypedDict, total=False): - key "custom_search_configuration": ForwardRef('WebSearchConfiguration', module='types') + key "custom_search_configuration": ForwardRef('WebSearchConfiguration') key "description": str key "filters": Optional[WebSearchToolFilters] key "name": str key "search_context_size": Literal["low", "medium", "high"] - key "type": Required[Literal[ToolboxToolType.WEB_SEARCH]] + key "tool_configs": dict[str, ToolConfig] key "user_location": Optional[WebSearchApproximateLocation] custom_search_configuration: WebSearchConfiguration description: str @@ -21416,41 +20674,35 @@ namespace azure.ai.projects.types name: str search_context_size: Literal[low, medium, high] tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.WEB_SEARCH] + type: Required[Literal[ToolboxToolType.WEB_SEARCH]] user_location: WebSearchApproximateLocation class azure.ai.projects.types.WeeklyRecurrenceSchedule(TypedDict, total=False): - key "daysOfWeek": Required[list[Union[str, DayOfWeek]]] - key "type": Required[Literal[RecurrenceType.WEEKLY]] - daysOfWeek: list[Union[str, DayOfWeek]] - type: Literal[RecurrenceType.WEEKLY] + daysOfWeek: Required[list[Union[str, DayOfWeek]]] + type: Required[Literal[RecurrenceType.WEEKLY]] class azure.ai.projects.types.WorkIQPreviewTool(TypedDict, total=False): - key "project_connection_id": Required[str] - key "type": Required[Literal[ToolType.WORK_IQ_PREVIEW]] - project_connection_id: str - type: Literal[ToolType.WORK_IQ_PREVIEW] + project_connection_id: Required[str] + type: Required[Literal[ToolType.WORK_IQ_PREVIEW]] class azure.ai.projects.types.WorkIQPreviewToolboxTool(TypedDict, total=False): key "description": str key "name": str - key "project_connection_id": Required[str] - key "type": Required[Literal[ToolboxToolType.WORK_IQ_PREVIEW]] + key "tool_configs": dict[str, ToolConfig] description: str name: str - project_connection_id: str + project_connection_id: Required[str] tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.WORK_IQ_PREVIEW] + type: Required[Literal[ToolboxToolType.WORK_IQ_PREVIEW]] class azure.ai.projects.types.WorkflowAgentDefinition(TypedDict, total=False): - key "kind": Required[Literal[AgentKind.WORKFLOW]] - key "rai_config": ForwardRef('RaiConfig', module='types') + key "rai_config": ForwardRef('RaiConfig') key "workflow": str - kind: Literal[AgentKind.WORKFLOW] + kind: Required[Literal[AgentKind.WORKFLOW]] rai_config: RaiConfig workflow: str diff --git a/sdk/ai/azure-ai-projects/api.metadata.yml b/sdk/ai/azure-ai-projects/api.metadata.yml index a6caded15f7e..73488fad5b55 100644 --- a/sdk/ai/azure-ai-projects/api.metadata.yml +++ b/sdk/ai/azure-ai-projects/api.metadata.yml @@ -1,3 +1,3 @@ -apiMdSha256: 3916caa8bea8b1e1fcda2d427861466aece65b6f7e7e5fcfd439734c15fac6d9 -parserVersion: 0.3.30 -pythonVersion: 3.13.2 +apiMdSha256: 233bd99062bd0c4c2beb1779b4b11dcdbc9243384eba8969f60fce4e693be680 +parserVersion: 0.3.31 +pythonVersion: 3.10.20 From 1db7726aebfc9c6c961b206b839aa48cafbd6d65 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 13 Aug 2026 23:32:40 +0000 Subject: [PATCH 20/56] Update azure-ai-projects API snapshot Co-authored-by: xitzhang <11403681+xitzhang@users.noreply.github.com> --- sdk/ai/azure-ai-projects/api.md | 3352 +++++++++++++-------- sdk/ai/azure-ai-projects/api.metadata.yml | 4 +- 2 files changed, 2087 insertions(+), 1269 deletions(-) diff --git a/sdk/ai/azure-ai-projects/api.md b/sdk/ai/azure-ai-projects/api.md index 8926f3d8d072..741f28cad5b2 100644 --- a/sdk/ai/azure-ai-projects/api.md +++ b/sdk/ai/azure-ai-projects/api.md @@ -3490,21 +3490,21 @@ namespace azure.ai.projects.models class azure.ai.projects.models.AzureAIAgentTargetParam(TypedDict, total=False): + key "name": Required[str] key "tool_descriptions": List[ToolDescriptionParam] + key "type": Required[Literal["azure_ai_agent"]] key "version": str - name: Required[str] - type: Required[Literal["azure_ai_agent"]] class azure.ai.projects.models.AzureAIBenchmarkPreviewEvalRunDataSource(TypedDict, total=False): key "input_messages": InputMessagesItemReference - target: Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] - type: Required[Literal["azure_ai_benchmark_preview"]] + key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] + key "type": Required[Literal["azure_ai_benchmark_preview"]] class azure.ai.projects.models.AzureAIDataSourceConfig(TypedDict, total=False): - scenario: Required[str] - type: Required[Literal["azure_ai_source"]] + key "scenario": Required[str] + key "type": Required[Literal["azure_ai_source"]] class azure.ai.projects.models.AzureAIModelTarget(EvaluationTarget, discriminator='azure_ai_model'): @@ -3527,14 +3527,14 @@ namespace azure.ai.projects.models class azure.ai.projects.models.AzureAIModelTargetParam(TypedDict, total=False): key "model": str key "sampling_params": ModelSamplingConfigParam - type: Required[Literal["azure_ai_model"]] + key "type": Required[Literal["azure_ai_model"]] class azure.ai.projects.models.AzureAIResponsesEvalRunDataSource(TypedDict, total=False): key "event_configuration_id": str + key "item_generation_params": Required[ResponseRetrievalItemGenerationParams] key "max_runs_hourly": int - item_generation_params: Required[ResponseRetrievalItemGenerationParams] - type: Required[Literal["azure_ai_responses"]] + key "type": Required[Literal["azure_ai_responses"]] class azure.ai.projects.models.AzureAISearchIndex(Index, discriminator='AzureSearch'): @@ -5142,13 +5142,13 @@ namespace azure.ai.projects.models class azure.ai.projects.models.EvalCsvFileIdSource(TypedDict, total=False): - id: Required[str] - type: Required[Literal["file_id"]] + key "id": Required[str] + key "type": Required[Literal["file_id"]] class azure.ai.projects.models.EvalCsvRunDataSource(TypedDict, total=False): - source: Required[EvalCsvFileIdSource] - type: Required[Literal["csv"]] + key "source": Required[EvalCsvFileIdSource] + key "type": Required[Literal["csv"]] class azure.ai.projects.models.EvalResult(_Model): @@ -8915,9 +8915,9 @@ namespace azure.ai.projects.models class azure.ai.projects.models.RedTeamEvalRunDataSource(TypedDict, total=False): - item_generation_params: Required[Any] - target: Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] - type: Required[Literal["azure_ai_red_team"]] + key "item_generation_params": Required[Any] + key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] + key "type": Required[Literal["azure_ai_red_team"]] class azure.ai.projects.models.RedTeamTargetConfig(_Model): @@ -8954,10 +8954,10 @@ namespace azure.ai.projects.models class azure.ai.projects.models.ResponseRetrievalItemGenerationParams(TypedDict, total=False): + key "data_mapping": Required[Dict[str, str]] key "max_num_turns": int - data_mapping: Required[Dict[str, str]] - source: Required[Union[SourceFileContent, SourceFileID]] - type: Required[Literal["response_retrieval"]] + key "source": Required[Union[SourceFileContent, SourceFileID]] + key "type": Required[Literal["response_retrieval"]] class azure.ai.projects.models.ResponseUsageInputTokensDetails(_Model): @@ -9622,10 +9622,10 @@ namespace azure.ai.projects.models class azure.ai.projects.models.TargetCompletionEvalRunDataSource(TypedDict, total=False): - input_messages: Required[InputMessagesItemReference] - source: Required[Union[SourceFileContent, SourceFileID]] - target: Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] - type: Required[Literal["azure_ai_target_completions"]] + key "input_messages": Required[InputMessagesItemReference] + key "source": Required[Union[SourceFileContent, SourceFileID]] + key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] + key "type": Required[Literal["azure_ai_target_completions"]] class azure.ai.projects.models.TaskGenerationDataGenerationJobOptions(DataGenerationJobOptions, discriminator='task_generation'): @@ -9775,11 +9775,11 @@ namespace azure.ai.projects.models class azure.ai.projects.models.TestingCriterionAzureAIEvaluator(TypedDict, total=False): key "data_mapping": Dict[str, str] + key "evaluator_name": Required[str] key "evaluator_version": str key "initialization_parameters": Dict[str, Any] - evaluator_name: Required[str] - name: Required[str] - type: Required[Literal["azure_ai_evaluator"]] + key "name": Required[str] + key "type": Required[Literal["azure_ai_evaluator"]] class azure.ai.projects.models.TextResponseFormat(_Model): @@ -10425,7 +10425,7 @@ namespace azure.ai.projects.models key "lookback_hours": int key "max_traces": int key "trace_ids": List[str] - type: Required[Literal["azure_ai_traces_preview"]] + key "type": Required[Literal["azure_ai_traces_preview"]] class azure.ai.projects.models.TranscriptTextUsageDuration(CreateTranscriptionResponseJsonUsage, discriminator='duration'): @@ -16208,11 +16208,12 @@ namespace azure.ai.projects.types key "base_url": str key "project_connection_id": str key "send_credentials_for_agent_card": bool + key "type": Required[Literal[ToolType.A2A_PREVIEW]] agent_card_path: str base_url: str project_connection_id: str send_credentials_for_agent_card: bool - type: Required[Literal[ToolType.A2A_PREVIEW]] + type: Literal[ToolType.A2A_PREVIEW] class azure.ai.projects.types.A2APreviewToolboxTool(TypedDict, total=False): @@ -16222,7 +16223,7 @@ namespace azure.ai.projects.types key "name": str key "project_connection_id": str key "send_credentials_for_agent_card": bool - key "tool_configs": dict[str, ToolConfig] + key "type": Required[Literal[ToolboxToolType.A2A_PREVIEW]] agent_card_path: str base_url: str description: str @@ -16230,7 +16231,7 @@ namespace azure.ai.projects.types project_connection_id: str send_credentials_for_agent_card: bool tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolboxToolType.A2A_PREVIEW]] + type: Literal[ToolboxToolType.A2A_PREVIEW] class azure.ai.projects.types.A2AProtocolConfiguration(TypedDict, total=False): @@ -16257,8 +16258,10 @@ namespace azure.ai.projects.types class azure.ai.projects.types.AgentBlueprintReference(TypedDict, total=False): - blueprint_id: Required[str] - type: Required[Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT]] + key "blueprint_id": Required[str] + key "type": Required[Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT]] + blueprint_id: str + type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] class azure.ai.projects.types.AgentBlueprintReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -16267,41 +16270,49 @@ namespace azure.ai.projects.types class azure.ai.projects.types.AgentCard(TypedDict, total=False): key "description": str + key "skills": Required[list[AgentCardSkill]] + key "version": Required[str] description: str - skills: Required[list[AgentCardSkill]] - version: Required[str] + skills: list[AgentCardSkill] + version: str class azure.ai.projects.types.AgentCardSkill(TypedDict, total=False): key "description": str - key "examples": list[str] - key "tags": list[str] + key "id": Required[str] + key "name": Required[str] description: str examples: list[str] - id: Required[str] - name: Required[str] + id: str + name: str tags: list[str] class azure.ai.projects.types.AgentClusterInsightRequest(TypedDict, total=False): - key "modelConfiguration": ForwardRef('InsightModelConfiguration') - agentName: Required[str] + key "agentName": Required[str] + key "modelConfiguration": ForwardRef('InsightModelConfiguration', module='types') + key "type": Required[Literal[InsightType.AGENT_CLUSTER_INSIGHT]] + agentName: str modelConfiguration: InsightModelConfiguration - type: Required[Literal[InsightType.AGENT_CLUSTER_INSIGHT]] + type: Literal[InsightType.AGENT_CLUSTER_INSIGHT] class azure.ai.projects.types.AgentClusterInsightResult(TypedDict, total=False): - clusterInsight: Required[ClusterInsightResult] - type: Required[Literal[InsightType.AGENT_CLUSTER_INSIGHT]] + key "clusterInsight": Required[ClusterInsightResult] + key "type": Required[Literal[InsightType.AGENT_CLUSTER_INSIGHT]] + clusterInsight: ClusterInsightResult + type: Literal[InsightType.AGENT_CLUSTER_INSIGHT] class azure.ai.projects.types.AgentDataGenerationJobSource(TypedDict, total=False): + key "agent_name": Required[str] key "agent_version": str key "description": str - agent_name: Required[str] + key "type": Required[Literal[DataGenerationJobSourceType.AGENT]] + agent_name: str agent_version: str description: str - type: Required[Literal[DataGenerationJobSourceType.AGENT]] + type: Literal[DataGenerationJobSourceType.AGENT] class azure.ai.projects.types.AgentEndpointAuthorizationSchemeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -16312,21 +16323,22 @@ namespace azure.ai.projects.types class azure.ai.projects.types.AgentEndpointConfig(TypedDict, total=False): - key "authorization_schemes": list[AgentEndpointAuthorizationScheme] - key "protocol_configuration": ForwardRef('ProtocolConfiguration') - key "version_selector": ForwardRef('VersionSelector') + key "protocol_configuration": ForwardRef('ProtocolConfiguration', module='types') + key "version_selector": ForwardRef('VersionSelector', module='types') authorization_schemes: list[AgentEndpointAuthorizationScheme] protocol_configuration: ProtocolConfiguration version_selector: VersionSelector class azure.ai.projects.types.AgentEvaluatorGenerationJobSource(TypedDict, total=False): + key "agent_name": Required[str] key "agent_version": str key "description": str - agent_name: Required[str] + key "type": Required[Literal[EvaluatorGenerationJobSourceType.AGENT]] + agent_name: str agent_version: str description: str - type: Required[Literal[EvaluatorGenerationJobSourceType.AGENT]] + type: Literal[EvaluatorGenerationJobSourceType.AGENT] class azure.ai.projects.types.AgentKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -16338,24 +16350,28 @@ namespace azure.ai.projects.types class azure.ai.projects.types.AgentOptimizationCandidate(TypedDict, total=False): + key "avg_score": Required[float] + key "avg_tokens": Required[float] key "candidate_id": str key "eval_id": str key "eval_run_id": str - key "mutations": dict[str, Any] - key "promotion": ForwardRef('PromotionInfo') - avg_score: Required[float] - avg_tokens: Required[float] + key "name": Required[str] + key "promotion": ForwardRef('PromotionInfo', module='types') + avg_score: float + avg_tokens: float candidate_id: str eval_id: str eval_run_id: str mutations: dict[str, Any] - name: Required[str] + name: str promotion: PromotionInfo class azure.ai.projects.types.AgentOptimizationDatasetCriterion(TypedDict, total=False): - instruction: Required[str] - name: Required[str] + key "instruction": Required[str] + key "name": Required[str] + instruction: str + name: str class azure.ai.projects.types.AgentOptimizationDatasetInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -16364,7 +16380,6 @@ namespace azure.ai.projects.types class azure.ai.projects.types.AgentOptimizationDatasetItem(TypedDict, total=False): - key "criteria": list[AgentOptimizationDatasetCriterion] key "desired_num_turns": int key "ground_truth": str key "query": str @@ -16375,53 +16390,64 @@ namespace azure.ai.projects.types class azure.ai.projects.types.AgentOptimizationEvaluatorRef(TypedDict, total=False): + key "name": Required[str] key "version": str - name: Required[str] + name: str version: str class azure.ai.projects.types.AgentOptimizationInlineDatasetInput(TypedDict, total=False): - items: Required[list[AgentOptimizationDatasetItem]] - type: Required[Literal[AgentOptimizationDatasetInputType.INLINE]] + key "items": Required[list[AgentOptimizationDatasetItem]] + key "type": Required[Literal[AgentOptimizationDatasetInputType.INLINE]] + items: list[AgentOptimizationDatasetItem] + type: Literal[AgentOptimizationDatasetInputType.INLINE] class azure.ai.projects.types.AgentOptimizationJob(TypedDict, total=False): - key "error": ForwardRef('ApiError') - key "inputs": ForwardRef('AgentOptimizationJobInputs') - key "progress": ForwardRef('AgentOptimizationJobProgress') - key "result": ForwardRef('AgentOptimizationJobResult') - key "warnings": list[str] - created_at: Required[int] + key "created_at": Required[int] + key "error": ForwardRef('ApiError', module='types') + key "id": Required[str] + key "inputs": ForwardRef('AgentOptimizationJobInputs', module='types') + key "progress": ForwardRef('AgentOptimizationJobProgress', module='types') + key "result": ForwardRef('AgentOptimizationJobResult', module='types') + key "status": Required[Union[str, JobStatus]] + key "updated_at": Required[int] + created_at: int error: ApiError - id: Required[str] + id: str inputs: AgentOptimizationJobInputs progress: AgentOptimizationJobProgress result: AgentOptimizationJobResult - status: Required[Union[str, JobStatus]] - updated_at: Required[int] + status: Union[str, JobStatus] + updated_at: int warnings: list[str] class azure.ai.projects.types.AgentOptimizationJobInputs(TypedDict, total=False): - key "options": ForwardRef('AgentOptimizationOptions') - key "validation_dataset": ForwardRef('AgentOptimizationDatasetInput') - agent: Required[OptimizedAgentIdentifier] - evaluators: Required[list[AgentOptimizationEvaluatorRef]] + key "agent": Required[OptimizedAgentIdentifier] + key "evaluators": Required[list[AgentOptimizationEvaluatorRef]] + key "options": ForwardRef('AgentOptimizationOptions', module='types') + key "train_dataset": Required[AgentOptimizationDatasetInput] + key "validation_dataset": ForwardRef('AgentOptimizationDatasetInput', module='types') + agent: OptimizedAgentIdentifier + evaluators: list[AgentOptimizationEvaluatorRef] options: AgentOptimizationOptions - train_dataset: Required[AgentOptimizationDatasetInput] + train_dataset: AgentOptimizationDatasetInput validation_dataset: AgentOptimizationDatasetInput class azure.ai.projects.types.AgentOptimizationJobProgress(TypedDict, total=False): - best_score: Required[float] - candidates_completed: Required[int] - elapsed_seconds: Required[float] + key "best_score": Required[float] + key "candidates_completed": Required[int] + key "elapsed_seconds": Required[float] + best_score: float + candidates_completed: int + elapsed_seconds: float class azure.ai.projects.types.AgentOptimizationJobResult(TypedDict, total=False): key "baseline": str key "best": str - key "candidates": list[AgentOptimizationCandidate] baseline: str best: str candidates: list[AgentOptimizationCandidate] @@ -16432,7 +16458,6 @@ namespace azure.ai.projects.types key "evaluation_level": Union[str, EvaluationLevel] key "max_candidates": int key "max_stalls": int - key "optimization_config": dict[str, Any] key "optimization_model": str eval_model: str evaluation_level: Union[str, EvaluationLevel] @@ -16443,37 +16468,42 @@ namespace azure.ai.projects.types class azure.ai.projects.types.AgentOptimizationReferenceDatasetInput(TypedDict, total=False): + key "name": Required[str] + key "type": Required[Literal[AgentOptimizationDatasetInputType.REFERENCE]] key "version": str - name: Required[str] - type: Required[Literal[AgentOptimizationDatasetInputType.REFERENCE]] + name: str + type: Literal[AgentOptimizationDatasetInputType.REFERENCE] version: str class azure.ai.projects.types.AgentTaxonomyInput(TypedDict, total=False): - riskCategories: Required[list[Union[str, RiskCategory]]] - target: Required[EvaluationTarget] - type: Required[Literal[EvaluationTaxonomyInputType.AGENT]] + key "riskCategories": Required[list[Union[str, RiskCategory]]] + key "target": Required[EvaluationTarget] + key "type": Required[Literal[EvaluationTaxonomyInputType.AGENT]] + riskCategories: list[Union[str, RiskCategory]] + target: EvaluationTarget + type: Literal[EvaluationTaxonomyInputType.AGENT] class azure.ai.projects.types.ApiError(TypedDict, total=False): - key "additionalInfo": dict[str, Any] - key "debugInfo": dict[str, Any] - key "details": list[ApiError] + key "code": Required[Optional[str]] + key "message": Required[str] key "param": Optional[str] key "type": str additionalInfo: dict[str, Any] - code: Required[Optional[str]] + code: str debugInfo: dict[str, Any] details: list[ApiError] - message: Required[str] + message: str param: str type: str class azure.ai.projects.types.ApplyPatchToolParam(TypedDict, total=False): key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] + key "type": Required[Literal[ToolType.APPLY_PATCH]] allowed_callers: list[Union[str, CallableToolAllowedCaller]] - type: Required[Literal[ToolType.APPLY_PATCH]] + type: Literal[ToolType.APPLY_PATCH] class azure.ai.projects.types.ApproximateLocation(TypedDict, total=False): @@ -16481,248 +16511,291 @@ namespace azure.ai.projects.types key "country": Optional[str] key "region": Optional[str] key "timezone": Optional[str] + key "type": Required[Literal["approximate"]] city: str country: str region: str timezone: str - type: Required[Literal["approximate"]] + type: Literal[approximate] class azure.ai.projects.types.ArtifactProfile(TypedDict, total=False): - key "signals": list[Union[str, FoundryModelArtifactProfileSignal]] - category: Required[Union[str, FoundryModelArtifactProfileCategory]] + key "category": Required[Union[str, FoundryModelArtifactProfileCategory]] + category: Union[str, FoundryModelArtifactProfileCategory] signals: list[Union[str, FoundryModelArtifactProfileSignal]] class azure.ai.projects.types.AutoCodeInterpreterToolParam(TypedDict, total=False): - key "file_ids": list[str] key "memory_limit": Optional[Union[str, ContainerMemoryLimit]] - key "network_policy": ForwardRef('ContainerNetworkPolicyParam') + key "network_policy": ForwardRef('ContainerNetworkPolicyParam', module='types') + key "type": Required[Literal["auto"]] file_ids: list[str] memory_limit: Union[str, ContainerMemoryLimit] network_policy: ContainerNetworkPolicyParam - type: Required[Literal["auto"]] + type: Literal[auto] class azure.ai.projects.types.AzureAIAgentTarget(TypedDict, total=False): - key "tool_descriptions": list[ToolDescription] - key "tools": list[Tool] + key "name": Required[str] + key "type": Required[Literal["azure_ai_agent"]] key "version": str - name: Required[str] + name: str tool_descriptions: list[ToolDescription] tools: list[Tool] - type: Required[Literal["azure_ai_agent"]] + type: Literal[azure_ai_agent] version: str class azure.ai.projects.types.AzureAIModelTarget(TypedDict, total=False): key "model": str - key "sampling_params": ForwardRef('ModelSamplingParams') + key "sampling_params": ForwardRef('ModelSamplingParams', module='types') + key "type": Required[Literal["azure_ai_model"]] model: str sampling_params: ModelSamplingParams - type: Required[Literal["azure_ai_model"]] + type: Literal[azure_ai_model] class azure.ai.projects.types.AzureAISearchIndex(TypedDict, total=False): + key "connectionName": Required[str] key "description": str - key "fieldMapping": ForwardRef('FieldMapping') + key "fieldMapping": ForwardRef('FieldMapping', module='types') key "id": str - key "tags": dict[str, str] - connectionName: Required[str] + key "indexName": Required[str] + key "name": Required[str] + key "type": Required[Literal[IndexType.AZURE_SEARCH]] + key "version": Required[str] + connectionName: str description: str fieldMapping: FieldMapping id: str - indexName: Required[str] - name: Required[str] + indexName: str + name: str tags: dict[str, str] - type: Required[Literal[IndexType.AZURE_SEARCH]] - version: Required[str] + type: Literal[IndexType.AZURE_SEARCH] + version: str class azure.ai.projects.types.AzureAISearchTool(TypedDict, total=False): + key "azure_ai_search": Required[AzureAISearchToolResource] key "description": str key "name": str - key "tool_configs": dict[str, ToolConfig] - azure_ai_search: Required[AzureAISearchToolResource] + key "type": Required[Literal[ToolType.AZURE_AI_SEARCH]] + azure_ai_search: AzureAISearchToolResource description: str name: str tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolType.AZURE_AI_SEARCH]] + type: Literal[ToolType.AZURE_AI_SEARCH] class azure.ai.projects.types.AzureAISearchToolResource(TypedDict, total=False): - indexes: Required[list[AISearchIndexResource]] + key "indexes": Required[list[AISearchIndexResource]] + indexes: list[AISearchIndexResource] class azure.ai.projects.types.AzureAISearchToolboxTool(TypedDict, total=False): + key "azure_ai_search": Required[AzureAISearchToolResource] key "description": str key "name": str - key "tool_configs": dict[str, ToolConfig] - azure_ai_search: Required[AzureAISearchToolResource] + key "type": Required[Literal[ToolboxToolType.AZURE_AI_SEARCH]] + azure_ai_search: AzureAISearchToolResource description: str name: str tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolboxToolType.AZURE_AI_SEARCH]] + type: Literal[ToolboxToolType.AZURE_AI_SEARCH] class azure.ai.projects.types.AzureFunctionBinding(TypedDict, total=False): - storage_queue: Required[AzureFunctionStorageQueue] - type: Required[Literal["storage_queue"]] + key "storage_queue": Required[AzureFunctionStorageQueue] + key "type": Required[Literal["storage_queue"]] + storage_queue: AzureFunctionStorageQueue + type: Literal[storage_queue] class azure.ai.projects.types.AzureFunctionDefinition(TypedDict, total=False): - function: Required[AzureFunctionDefinitionFunction] - input_binding: Required[AzureFunctionBinding] - output_binding: Required[AzureFunctionBinding] + key "function": Required[AzureFunctionDefinitionFunction] + key "input_binding": Required[AzureFunctionBinding] + key "output_binding": Required[AzureFunctionBinding] + function: AzureFunctionDefinitionFunction + input_binding: AzureFunctionBinding + output_binding: AzureFunctionBinding class azure.ai.projects.types.AzureFunctionDefinitionFunction(TypedDict, total=False): key "description": str + key "name": Required[str] + key "parameters": Required[dict[str, Any]] description: str - name: Required[str] - parameters: Required[dict[str, Any]] + name: str + parameters: dict[str, Any] class azure.ai.projects.types.AzureFunctionStorageQueue(TypedDict, total=False): - queue_name: Required[str] - queue_service_endpoint: Required[str] + key "queue_name": Required[str] + key "queue_service_endpoint": Required[str] + queue_name: str + queue_service_endpoint: str class azure.ai.projects.types.AzureFunctionTool(TypedDict, total=False): - key "tool_configs": dict[str, ToolConfig] - azure_function: Required[AzureFunctionDefinition] + key "azure_function": Required[AzureFunctionDefinition] + key "type": Required[Literal[ToolType.AZURE_FUNCTION]] + azure_function: AzureFunctionDefinition tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolType.AZURE_FUNCTION]] + type: Literal[ToolType.AZURE_FUNCTION] class azure.ai.projects.types.AzureOpenAIModelConfiguration(TypedDict, total=False): - modelDeploymentName: Required[str] - type: Required[Literal["AzureOpenAIModel"]] + key "modelDeploymentName": Required[str] + key "type": Required[Literal["AzureOpenAIModel"]] + modelDeploymentName: str + type: Literal[AzureOpenAIModel] class azure.ai.projects.types.BingCustomSearchConfiguration(TypedDict, total=False): key "count": int key "freshness": str + key "instance_name": Required[str] key "market": str + key "project_connection_id": Required[str] key "set_lang": str count: int freshness: str - instance_name: Required[str] + instance_name: str market: str - project_connection_id: Required[str] + project_connection_id: str set_lang: str class azure.ai.projects.types.BingCustomSearchPreviewTool(TypedDict, total=False): - bing_custom_search_preview: Required[BingCustomSearchToolParameters] - type: Required[Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW]] + key "bing_custom_search_preview": Required[BingCustomSearchToolParameters] + key "type": Required[Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW]] + bing_custom_search_preview: BingCustomSearchToolParameters + type: Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW] class azure.ai.projects.types.BingCustomSearchToolParameters(TypedDict, total=False): - search_configurations: Required[list[BingCustomSearchConfiguration]] + key "search_configurations": Required[list[BingCustomSearchConfiguration]] + search_configurations: list[BingCustomSearchConfiguration] class azure.ai.projects.types.BingGroundingSearchConfiguration(TypedDict, total=False): key "count": int key "freshness": str key "market": str + key "project_connection_id": Required[str] key "set_lang": str count: int freshness: str market: str - project_connection_id: Required[str] + project_connection_id: str set_lang: str class azure.ai.projects.types.BingGroundingSearchToolParameters(TypedDict, total=False): - search_configurations: Required[list[BingGroundingSearchConfiguration]] + key "search_configurations": Required[list[BingGroundingSearchConfiguration]] + search_configurations: list[BingGroundingSearchConfiguration] class azure.ai.projects.types.BingGroundingTool(TypedDict, total=False): + key "bing_grounding": Required[BingGroundingSearchToolParameters] key "description": str key "name": str - key "tool_configs": dict[str, ToolConfig] - bing_grounding: Required[BingGroundingSearchToolParameters] + key "type": Required[Literal[ToolType.BING_GROUNDING]] + bing_grounding: BingGroundingSearchToolParameters description: str name: str tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolType.BING_GROUNDING]] + type: Literal[ToolType.BING_GROUNDING] class azure.ai.projects.types.BotServiceAuthorizationScheme(TypedDict, total=False): - type: Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE]] + key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE]] + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE] class azure.ai.projects.types.BotServiceRbacAuthorizationScheme(TypedDict, total=False): - type: Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC]] + key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC]] + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC] class azure.ai.projects.types.BotServiceTenantAuthorizationScheme(TypedDict, total=False): - type: Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT]] + key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT]] + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT] class azure.ai.projects.types.BrowserAutomationPreviewTool(TypedDict, total=False): - browser_automation_preview: Required[BrowserAutomationToolParameters] - type: Required[Literal[ToolType.BROWSER_AUTOMATION_PREVIEW]] + key "browser_automation_preview": Required[BrowserAutomationToolParameters] + key "type": Required[Literal[ToolType.BROWSER_AUTOMATION_PREVIEW]] + browser_automation_preview: BrowserAutomationToolParameters + type: Literal[ToolType.BROWSER_AUTOMATION_PREVIEW] class azure.ai.projects.types.BrowserAutomationPreviewToolboxTool(TypedDict, total=False): + key "browser_automation_preview": Required[BrowserAutomationToolParameters] key "description": str key "name": str - key "tool_configs": dict[str, ToolConfig] - browser_automation_preview: Required[BrowserAutomationToolParameters] + key "type": Required[Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW]] + browser_automation_preview: BrowserAutomationToolParameters description: str name: str tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW]] + type: Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW] class azure.ai.projects.types.BrowserAutomationToolConnectionParameters(TypedDict, total=False): - project_connection_id: Required[str] + key "project_connection_id": Required[str] + project_connection_id: str class azure.ai.projects.types.BrowserAutomationToolParameters(TypedDict, total=False): - connection: Required[BrowserAutomationToolConnectionParameters] + key "connection": Required[BrowserAutomationToolConnectionParameters] + connection: BrowserAutomationToolConnectionParameters class azure.ai.projects.types.CaptureStructuredOutputsTool(TypedDict, total=False): key "description": str key "name": str - key "tool_configs": dict[str, ToolConfig] + key "outputs": Required[StructuredOutputDefinition] + key "type": Required[Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS]] description: str name: str - outputs: Required[StructuredOutputDefinition] + outputs: StructuredOutputDefinition tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS]] + type: Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS] class azure.ai.projects.types.ChartCoordinate(TypedDict, total=False): - size: Required[int] - x: Required[int] - y: Required[int] + key "size": Required[int] + key "x": Required[int] + key "y": Required[int] + size: int + x: int + y: int class azure.ai.projects.types.ClusterInsightResult(TypedDict, total=False): - key "coordinates": dict[str, ChartCoordinate] - clusters: Required[list[InsightCluster]] + key "clusters": Required[list[InsightCluster]] + key "summary": Required[InsightSummary] + clusters: list[InsightCluster] coordinates: dict[str, ChartCoordinate] - summary: Required[InsightSummary] + summary: InsightSummary class azure.ai.projects.types.ClusterTokenUsage(TypedDict, total=False): - inputTokenUsage: Required[int] - outputTokenUsage: Required[int] - totalTokenUsage: Required[int] + key "inputTokenUsage": Required[int] + key "outputTokenUsage": Required[int] + key "totalTokenUsage": Required[int] + inputTokenUsage: int + outputTokenUsage: int + totalTokenUsage: int class azure.ai.projects.types.CodeBasedEvaluatorDefinition(TypedDict, total=False): key "blob_uri": str key "code_text": str - key "data_schema": dict[str, Any] key "entry_point": str key "image_tag": str - key "init_parameters": dict[str, Any] - key "metrics": dict[str, EvaluatorMetric] + key "type": Required[Literal[EvaluatorDefinitionType.CODE]] blob_uri: str code_text: str data_schema: dict[str, Any] @@ -16730,15 +16803,18 @@ namespace azure.ai.projects.types image_tag: str init_parameters: dict[str, Any] metrics: dict[str, EvaluatorMetric] - type: Required[Literal[EvaluatorDefinitionType.CODE]] + type: Literal[EvaluatorDefinitionType.CODE] class azure.ai.projects.types.CodeConfiguration(TypedDict, total=False): key "content_hash": str + key "dependency_resolution": Required[Union[str, CodeDependencyResolution]] + key "entry_point": Required[list[str]] + key "runtime": Required[str] content_hash: str - dependency_resolution: Required[Union[str, CodeDependencyResolution]] - entry_point: Required[list[str]] - runtime: Required[str] + dependency_resolution: Union[str, CodeDependencyResolution] + entry_point: list[str] + runtime: str class azure.ai.projects.types.CodeInterpreterTool(TypedDict, total=False): @@ -16746,13 +16822,13 @@ namespace azure.ai.projects.types key "container": Union[str, AutoCodeInterpreterToolParam] key "description": str key "name": str - key "tool_configs": dict[str, ToolConfig] + key "type": Required[Literal[ToolType.CODE_INTERPRETER]] allowed_callers: list[Union[str, CallableToolAllowedCaller]] container: Union[str, AutoCodeInterpreterToolParam] description: str name: str tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolType.CODE_INTERPRETER]] + type: Literal[ToolType.CODE_INTERPRETER] class azure.ai.projects.types.CodeInterpreterToolboxTool(TypedDict, total=False): @@ -16760,68 +16836,83 @@ namespace azure.ai.projects.types key "container": Union[str, AutoCodeInterpreterToolParam] key "description": str key "name": str - key "tool_configs": dict[str, ToolConfig] + key "type": Required[Literal[ToolboxToolType.CODE_INTERPRETER]] allowed_callers: list[Union[str, CallableToolAllowedCaller]] container: Union[str, AutoCodeInterpreterToolParam] description: str name: str tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolboxToolType.CODE_INTERPRETER]] + type: Literal[ToolboxToolType.CODE_INTERPRETER] class azure.ai.projects.types.ComparisonFilter(TypedDict, total=False): - key: Required[str] - type: Required[Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]] - value: Required[Union[str, float, bool, list[Union[str, float]]]] + key "key": Required[str] + key "type": Required[Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]] + key "value": Required[Union[str, float, bool, list[Union[str, float]]]] + key: str + type: Literal[eq, ne, gt, gte, lt, lte, in, nin] + value: Union[str, float, bool, list[Union[str, float]]] class azure.ai.projects.types.CompoundFilter(TypedDict, total=False): - filters: Required[list[Union[ComparisonFilter, Any]]] - type: Required[Literal["and", "or"]] + key "filters": Required[list[Union[ComparisonFilter, Any]]] + key "type": Required[Literal["and", "or"]] + filters: list[Union[ComparisonFilter, Any]] + type: Literal[and, or] class azure.ai.projects.types.ComputerTool(TypedDict, total=False): - type: Required[Literal[ToolType.COMPUTER]] + key "type": Required[Literal[ToolType.COMPUTER]] + type: Literal[ToolType.COMPUTER] class azure.ai.projects.types.ComputerUsePreviewTool(TypedDict, total=False): - display_height: Required[int] - display_width: Required[int] - environment: Required[Union[str, ComputerEnvironment]] - type: Required[Literal[ToolType.COMPUTER_USE_PREVIEW]] + key "display_height": Required[int] + key "display_width": Required[int] + key "environment": Required[Union[str, ComputerEnvironment]] + key "type": Required[Literal[ToolType.COMPUTER_USE_PREVIEW]] + display_height: int + display_width: int + environment: Union[str, ComputerEnvironment] + type: Literal[ToolType.COMPUTER_USE_PREVIEW] class azure.ai.projects.types.ContainerAutoParam(TypedDict, total=False): - key "file_ids": list[str] key "memory_limit": Optional[Union[str, ContainerMemoryLimit]] - key "network_policy": ForwardRef('ContainerNetworkPolicyParam') - key "skills": list[ContainerSkill] + key "network_policy": ForwardRef('ContainerNetworkPolicyParam', module='types') + key "type": Required[Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO]] file_ids: list[str] memory_limit: Union[str, ContainerMemoryLimit] network_policy: ContainerNetworkPolicyParam skills: list[ContainerSkill] - type: Required[Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO]] + type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO] class azure.ai.projects.types.ContainerConfiguration(TypedDict, total=False): - image: Required[str] + key "image": Required[str] + image: str class azure.ai.projects.types.ContainerNetworkPolicyAllowlistParam(TypedDict, total=False): - key "domain_secrets": list[ContainerNetworkPolicyDomainSecretParam] - allowed_domains: Required[list[str]] + key "allowed_domains": Required[list[str]] + key "type": Required[Literal[ContainerNetworkPolicyParamType.ALLOWLIST]] + allowed_domains: list[str] domain_secrets: list[ContainerNetworkPolicyDomainSecretParam] - type: Required[Literal[ContainerNetworkPolicyParamType.ALLOWLIST]] + type: Literal[ContainerNetworkPolicyParamType.ALLOWLIST] class azure.ai.projects.types.ContainerNetworkPolicyDisabledParam(TypedDict, total=False): - type: Required[Literal[ContainerNetworkPolicyParamType.DISABLED]] + key "type": Required[Literal[ContainerNetworkPolicyParamType.DISABLED]] + type: Literal[ContainerNetworkPolicyParamType.DISABLED] class azure.ai.projects.types.ContainerNetworkPolicyDomainSecretParam(TypedDict, total=False): - domain: Required[str] - name: Required[str] - value: Required[str] + key "domain": Required[str] + key "name": Required[str] + key "value": Required[str] + domain: str + name: str + value: str class azure.ai.projects.types.ContainerNetworkPolicyParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -16835,72 +16926,85 @@ namespace azure.ai.projects.types class azure.ai.projects.types.ContinuousEvaluationRuleAction(TypedDict, total=False): + key "evalId": Required[str] key "maxHourlyRuns": int key "samplingRate": float - evalId: Required[str] + key "type": Required[Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION]] + evalId: str maxHourlyRuns: int samplingRate: float - type: Required[Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION]] + type: Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION] class azure.ai.projects.types.CosmosDBIndex(TypedDict, total=False): + key "connectionName": Required[str] + key "containerName": Required[str] + key "databaseName": Required[str] key "description": str + key "embeddingConfiguration": Required[EmbeddingConfiguration] + key "fieldMapping": Required[FieldMapping] key "id": str - key "tags": dict[str, str] - connectionName: Required[str] - containerName: Required[str] - databaseName: Required[str] + key "name": Required[str] + key "type": Required[Literal[IndexType.COSMOS_DB]] + key "version": Required[str] + connectionName: str + containerName: str + databaseName: str description: str - embeddingConfiguration: Required[EmbeddingConfiguration] - fieldMapping: Required[FieldMapping] + embeddingConfiguration: EmbeddingConfiguration + fieldMapping: FieldMapping id: str - name: Required[str] + name: str tags: dict[str, str] - type: Required[Literal[IndexType.COSMOS_DB]] - version: Required[str] + type: Literal[IndexType.COSMOS_DB] + version: str class azure.ai.projects.types.CreateAgentVersionFromManifestRequest(TypedDict, total=False): key "description": str - key "metadata": dict[str, str] + key "manifest_id": Required[str] + key "parameter_values": Required[dict[str, Any]] description: str - manifest_id: Required[str] + manifest_id: str metadata: dict[str, str] - parameter_values: Required[dict[str, Any]] + parameter_values: dict[str, Any] class azure.ai.projects.types.CreateAgentVersionRequest(TypedDict, total=False): - key "blueprint_reference": ForwardRef('AgentBlueprintReference') + key "blueprint_reference": ForwardRef('AgentBlueprintReference', module='types') + key "definition": Required[AgentDefinition] key "description": str key "draft": bool - key "metadata": dict[str, str] blueprint_reference: AgentBlueprintReference - definition: Required[AgentDefinition] + definition: AgentDefinition description: str draft: bool metadata: dict[str, str] class azure.ai.projects.types.CreateMemoryRequest(TypedDict, total=False): - content: Required[str] - kind: Required[Union[str, MemoryItemKind]] - scope: Required[str] + key "content": Required[str] + key "kind": Required[Union[str, MemoryItemKind]] + key "scope": Required[str] + content: str + kind: Union[str, MemoryItemKind] + scope: str class azure.ai.projects.types.CreateMemoryStoreRequest(TypedDict, total=False): + key "definition": Required[MemoryStoreDefinition] key "description": str - key "metadata": dict[str, str] - definition: Required[MemoryStoreDefinition] + key "name": Required[str] + definition: MemoryStoreDefinition description: str metadata: dict[str, str] - name: Required[str] + name: str class azure.ai.projects.types.CreateOrUpdateRoutineRequest(TypedDict, total=False): - key "action": ForwardRef('RoutineAction') + key "action": ForwardRef('RoutineAction', module='types') key "description": str key "enabled": bool - key "triggers": dict[str, RoutineTrigger] action: RoutineAction description: str enabled: bool @@ -16909,33 +17013,34 @@ namespace azure.ai.projects.types class azure.ai.projects.types.CreateSessionRequest(TypedDict, total=False): key "agent_session_id": str + key "version_indicator": Required[VersionIndicator] agent_session_id: str - version_indicator: Required[VersionIndicator] + version_indicator: VersionIndicator class azure.ai.projects.types.CreateSkillVersionFromFilesBody(TypedDict, total=False): key "default": bool + key "files": Required[list[Union[str, bytes, IO[str], IO[bytes], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]]], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]], Optional[str]]]]] default: bool - files: Required[list[Union[str, bytes, IO[str], IO[bytes], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]]], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]], Optional[str]]]]] + files: list[FileType] class azure.ai.projects.types.CreateSkillVersionRequest(TypedDict, total=False): key "default": bool - key "inline_content": ForwardRef('SkillInlineContent') + key "inline_content": ForwardRef('SkillInlineContent', module='types') default: bool inline_content: SkillInlineContent class azure.ai.projects.types.CreateToolboxVersionRequest(TypedDict, total=False): key "description": str - key "metadata": dict[str, str] - key "policies": ForwardRef('ToolboxPolicies') - key "skills": list[ToolboxSkill] + key "policies": ForwardRef('ToolboxPolicies', module='types') + key "tools": Required[list[ToolboxTool]] description: str metadata: dict[str, str] policies: ToolboxPolicies skills: list[ToolboxSkill] - tools: Required[list[ToolboxTool]] + tools: list[ToolboxTool] class azure.ai.projects.types.CreateTranscriptionResponseJsonUsageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -16945,44 +17050,55 @@ namespace azure.ai.projects.types class azure.ai.projects.types.CronTrigger(TypedDict, total=False): key "endTime": str + key "expression": Required[str] key "startTime": str key "timeZone": str + key "type": Required[Literal[TriggerType.CRON]] endTime: str - expression: Required[str] + expression: str startTime: str timeZone: str - type: Required[Literal[TriggerType.CRON]] + type: Literal[TriggerType.CRON] class azure.ai.projects.types.CustomGrammarFormatParam(TypedDict, total=False): - definition: Required[str] - syntax: Required[Union[str, GrammarSyntax1]] - type: Required[Literal[CustomToolParamFormatType.GRAMMAR]] + key "definition": Required[str] + key "syntax": Required[Union[str, GrammarSyntax1]] + key "type": Required[Literal[CustomToolParamFormatType.GRAMMAR]] + definition: str + syntax: Union[str, GrammarSyntax1] + type: Literal[CustomToolParamFormatType.GRAMMAR] class azure.ai.projects.types.CustomRoutineTrigger(TypedDict, total=False): key "event_name": str + key "parameters": Required[dict[str, Any]] + key "provider": Required[str] + key "type": Required[Literal[RoutineTriggerType.CUSTOM]] event_name: str - parameters: Required[dict[str, Any]] - provider: Required[str] - type: Required[Literal[RoutineTriggerType.CUSTOM]] + parameters: dict[str, Any] + provider: str + type: Literal[RoutineTriggerType.CUSTOM] class azure.ai.projects.types.CustomTextFormatParam(TypedDict, total=False): - type: Required[Literal[CustomToolParamFormatType.TEXT]] + key "type": Required[Literal[CustomToolParamFormatType.TEXT]] + type: Literal[CustomToolParamFormatType.TEXT] class azure.ai.projects.types.CustomToolParam(TypedDict, total=False): key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] key "defer_loading": bool key "description": str - key "format": ForwardRef('CustomToolParamFormat') + key "format": ForwardRef('CustomToolParamFormat', module='types') + key "name": Required[str] + key "type": Required[Literal[ToolType.CUSTOM]] allowed_callers: list[Union[str, CallableToolAllowedCaller]] defer_loading: bool description: str format: CustomToolParamFormat - name: Required[str] - type: Required[Literal[ToolType.CUSTOM]] + name: str + type: Literal[ToolType.CUSTOM] class azure.ai.projects.types.CustomToolParamFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -16991,37 +17107,45 @@ namespace azure.ai.projects.types class azure.ai.projects.types.DailyRecurrenceSchedule(TypedDict, total=False): - hours: Required[list[int]] - type: Required[Literal[RecurrenceType.DAILY]] + key "hours": Required[list[int]] + key "type": Required[Literal[RecurrenceType.DAILY]] + hours: list[int] + type: Literal[RecurrenceType.DAILY] class azure.ai.projects.types.DataGenerationJob(TypedDict, total=False): - key "error": ForwardRef('ApiError') + key "created_at": Required[int] + key "error": ForwardRef('ApiError', module='types') key "finished_at": int - key "inputs": ForwardRef('DataGenerationJobInputs') - key "result": ForwardRef('DataGenerationJobResult') - created_at: Required[int] + key "id": Required[str] + key "inputs": ForwardRef('DataGenerationJobInputs', module='types') + key "result": ForwardRef('DataGenerationJobResult', module='types') + key "status": Required[Union[str, JobStatus]] + created_at: int error: ApiError finished_at: int - id: Required[str] + id: str inputs: DataGenerationJobInputs result: DataGenerationJobResult - status: Required[Union[str, JobStatus]] + status: Union[str, JobStatus] class azure.ai.projects.types.DataGenerationJobInputs(TypedDict, total=False): - key "output_options": ForwardRef('DataGenerationJobOutputOptions') - name: Required[str] - options: Required[DataGenerationJobOptions] + key "name": Required[str] + key "options": Required[DataGenerationJobOptions] + key "output_options": ForwardRef('DataGenerationJobOutputOptions', module='types') + key "scenario": Required[Union[str, DataGenerationJobScenario]] + key "sources": Required[list[DataGenerationJobSource]] + name: str + options: DataGenerationJobOptions output_options: DataGenerationJobOutputOptions - scenario: Required[Union[str, DataGenerationJobScenario]] - sources: Required[list[DataGenerationJobSource]] + scenario: Union[str, DataGenerationJobScenario] + sources: list[DataGenerationJobSource] class azure.ai.projects.types.DataGenerationJobOutputOptions(TypedDict, total=False): key "description": str key "name": str - key "tags": dict[str, str] description: str name: str tags: dict[str, str] @@ -17033,9 +17157,9 @@ namespace azure.ai.projects.types class azure.ai.projects.types.DataGenerationJobResult(TypedDict, total=False): - key "outputs": list[DataGenerationJobOutput] - key "token_usage": ForwardRef('DataGenerationTokenUsage') - generated_samples: Required[int] + key "generated_samples": Required[int] + key "token_usage": ForwardRef('DataGenerationTokenUsage', module='types') + generated_samples: int outputs: list[DataGenerationJobOutput] token_usage: DataGenerationTokenUsage @@ -17055,41 +17179,49 @@ namespace azure.ai.projects.types class azure.ai.projects.types.DataGenerationModelOptions(TypedDict, total=False): - model: Required[str] + key "model": Required[str] + model: str class azure.ai.projects.types.DataGenerationTokenUsage(TypedDict, total=False): - completion_tokens: Required[int] - prompt_tokens: Required[int] - total_tokens: Required[int] + key "completion_tokens": Required[int] + key "prompt_tokens": Required[int] + key "total_tokens": Required[int] + completion_tokens: int + prompt_tokens: int + total_tokens: int class azure.ai.projects.types.DatasetDataGenerationJobOutput(TypedDict, total=False): key "description": str key "id": str key "name": str - key "tags": dict[str, str] + key "type": Required[Literal[DataGenerationJobOutputType.DATASET]] key "version": str description: str id: str name: str tags: dict[str, str] - type: Required[Literal[DataGenerationJobOutputType.DATASET]] + type: Literal[DataGenerationJobOutputType.DATASET] version: str class azure.ai.projects.types.DatasetEvaluatorGenerationJobSource(TypedDict, total=False): key "description": str + key "name": Required[str] + key "type": Required[Literal[EvaluatorGenerationJobSourceType.DATASET]] key "version": str description: str - name: Required[str] - type: Required[Literal[EvaluatorGenerationJobSourceType.DATASET]] + name: str + type: Literal[EvaluatorGenerationJobSourceType.DATASET] version: str class azure.ai.projects.types.DatasetReference(TypedDict, total=False): - name: Required[str] - version: Required[str] + key "name": Required[str] + key "version": Required[str] + name: str + version: str class azure.ai.projects.types.DatasetType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -17098,108 +17230,149 @@ namespace azure.ai.projects.types class azure.ai.projects.types.DeleteScopeRequest(TypedDict, total=False): - scope: Required[str] + key "scope": Required[str] + scope: str class azure.ai.projects.types.Dimension(TypedDict, total=False): key "always_applicable": bool + key "description": Required[str] + key "id": Required[str] + key "weight": Required[int] always_applicable: bool - description: Required[str] - id: Required[str] - weight: Required[int] + description: str + id: str + weight: int class azure.ai.projects.types.DispatchRoutineAsyncRequest(TypedDict, total=False): - key "payload": ForwardRef('RoutineDispatchPayload') + key "payload": ForwardRef('RoutineDispatchPayload', module='types') payload: RoutineDispatchPayload class azure.ai.projects.types.EmbeddingConfiguration(TypedDict, total=False): - embeddingField: Required[str] - modelDeploymentName: Required[str] + key "embeddingField": Required[str] + key "modelDeploymentName": Required[str] + embeddingField: str + modelDeploymentName: str class azure.ai.projects.types.EmptyModelParam(TypedDict, total=False): class azure.ai.projects.types.EndpointBasedEvaluatorDefinition(TypedDict, total=False): - key "data_schema": dict[str, Any] - key "init_parameters": dict[str, Any] - key "metrics": dict[str, EvaluatorMetric] - connection_name: Required[str] + key "connection_name": Required[str] + key "type": Required[Literal[EvaluatorDefinitionType.ENDPOINT]] + connection_name: str data_schema: dict[str, Any] init_parameters: dict[str, Any] metrics: dict[str, EvaluatorMetric] - type: Required[Literal[EvaluatorDefinitionType.ENDPOINT]] + type: Literal[EvaluatorDefinitionType.ENDPOINT] class azure.ai.projects.types.EntraAuthorizationScheme(TypedDict, total=False): - type: Required[Literal[AgentEndpointAuthorizationSchemeType.ENTRA]] + key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.ENTRA]] + type: Literal[AgentEndpointAuthorizationSchemeType.ENTRA] class azure.ai.projects.types.EvalResult(TypedDict, total=False): - name: Required[str] - passed: Required[bool] - score: Required[float] - type: Required[str] + key "name": Required[str] + key "passed": Required[bool] + key "score": Required[float] + key "type": Required[str] + name: str + passed: bool + score: float + type: str class azure.ai.projects.types.EvalRunResultCompareItem(TypedDict, total=False): - deltaEstimate: Required[float] - pValue: Required[float] - treatmentEffect: Required[Union[str, TreatmentEffectType]] - treatmentRunId: Required[str] - treatmentRunSummary: Required[EvalRunResultSummary] + key "deltaEstimate": Required[float] + key "pValue": Required[float] + key "treatmentEffect": Required[Union[str, TreatmentEffectType]] + key "treatmentRunId": Required[str] + key "treatmentRunSummary": Required[EvalRunResultSummary] + deltaEstimate: float + pValue: float + treatmentEffect: Union[str, TreatmentEffectType] + treatmentRunId: str + treatmentRunSummary: EvalRunResultSummary class azure.ai.projects.types.EvalRunResultComparison(TypedDict, total=False): - baselineRunSummary: Required[EvalRunResultSummary] - compareItems: Required[list[EvalRunResultCompareItem]] - evaluator: Required[str] - metric: Required[str] - testingCriteria: Required[str] + key "baselineRunSummary": Required[EvalRunResultSummary] + key "compareItems": Required[list[EvalRunResultCompareItem]] + key "evaluator": Required[str] + key "metric": Required[str] + key "testingCriteria": Required[str] + baselineRunSummary: EvalRunResultSummary + compareItems: list[EvalRunResultCompareItem] + evaluator: str + metric: str + testingCriteria: str class azure.ai.projects.types.EvalRunResultSummary(TypedDict, total=False): - average: Required[float] - runId: Required[str] - sampleCount: Required[int] - standardDeviation: Required[float] + key "average": Required[float] + key "runId": Required[str] + key "sampleCount": Required[int] + key "standardDeviation": Required[float] + average: float + runId: str + sampleCount: int + standardDeviation: float class azure.ai.projects.types.EvaluationComparisonInsightRequest(TypedDict, total=False): - baselineRunId: Required[str] - evalId: Required[str] - treatmentRunIds: Required[list[str]] - type: Required[Literal[InsightType.EVALUATION_COMPARISON]] + key "baselineRunId": Required[str] + key "evalId": Required[str] + key "treatmentRunIds": Required[list[str]] + key "type": Required[Literal[InsightType.EVALUATION_COMPARISON]] + baselineRunId: str + evalId: str + treatmentRunIds: list[str] + type: Literal[InsightType.EVALUATION_COMPARISON] class azure.ai.projects.types.EvaluationComparisonInsightResult(TypedDict, total=False): - comparisons: Required[list[EvalRunResultComparison]] - method: Required[str] - type: Required[Literal[InsightType.EVALUATION_COMPARISON]] + key "comparisons": Required[list[EvalRunResultComparison]] + key "method": Required[str] + key "type": Required[Literal[InsightType.EVALUATION_COMPARISON]] + comparisons: list[EvalRunResultComparison] + method: str + type: Literal[InsightType.EVALUATION_COMPARISON] class azure.ai.projects.types.EvaluationResultSample(TypedDict, total=False): - correlationInfo: Required[dict[str, Any]] - evaluationResult: Required[EvalResult] - features: Required[dict[str, Any]] - id: Required[str] - type: Required[Literal[SampleType.EVALUATION_RESULT_SAMPLE]] + key "correlationInfo": Required[dict[str, Any]] + key "evaluationResult": Required[EvalResult] + key "features": Required[dict[str, Any]] + key "id": Required[str] + key "type": Required[Literal[SampleType.EVALUATION_RESULT_SAMPLE]] + correlationInfo: dict[str, Any] + evaluationResult: EvalResult + features: dict[str, Any] + id: str + type: Literal[SampleType.EVALUATION_RESULT_SAMPLE] class azure.ai.projects.types.EvaluationRule(TypedDict, total=False): + key "action": Required[EvaluationRuleAction] key "description": str key "displayName": str - key "filter": ForwardRef('EvaluationRuleFilter') - action: Required[EvaluationRuleAction] + key "enabled": Required[bool] + key "eventType": Required[Union[str, EvaluationRuleEventType]] + key "filter": ForwardRef('EvaluationRuleFilter', module='types') + key "id": Required[str] + key "systemData": Required[dict[str, str]] + action: EvaluationRuleAction description: str displayName: str - enabled: Required[bool] - eventType: Required[Union[str, EvaluationRuleEventType]] + enabled: bool + eventType: Union[str, EvaluationRuleEventType] filter: EvaluationRuleFilter - id: Required[str] - systemData: Required[dict[str, str]] + id: str + systemData: dict[str, str] class azure.ai.projects.types.EvaluationRuleActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -17208,50 +17381,61 @@ namespace azure.ai.projects.types class azure.ai.projects.types.EvaluationRuleFilter(TypedDict, total=False): - agentName: Required[str] + key "agentName": Required[str] + agentName: str class azure.ai.projects.types.EvaluationRunClusterInsightRequest(TypedDict, total=False): - key "modelConfiguration": ForwardRef('InsightModelConfiguration') - evalId: Required[str] + key "evalId": Required[str] + key "modelConfiguration": ForwardRef('InsightModelConfiguration', module='types') + key "runIds": Required[list[str]] + key "type": Required[Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT]] + evalId: str modelConfiguration: InsightModelConfiguration - runIds: Required[list[str]] - type: Required[Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT]] + runIds: list[str] + type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] class azure.ai.projects.types.EvaluationRunClusterInsightResult(TypedDict, total=False): - clusterInsight: Required[ClusterInsightResult] - type: Required[Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT]] + key "clusterInsight": Required[ClusterInsightResult] + key "type": Required[Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT]] + clusterInsight: ClusterInsightResult + type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] class azure.ai.projects.types.EvaluationScheduleTask(TypedDict, total=False): - key "configuration": dict[str, str] + key "evalId": Required[str] + key "evalRun": Required[dict[str, Any]] + key "type": Required[Literal[ScheduleTaskType.EVALUATION]] configuration: dict[str, str] - evalId: Required[str] - evalRun: Required[dict[str, Any]] - type: Required[Literal[ScheduleTaskType.EVALUATION]] + evalId: str + evalRun: dict[str, Any] + type: Literal[ScheduleTaskType.EVALUATION] class azure.ai.projects.types.EvaluationTaxonomy(TypedDict, total=False): key "description": str key "id": str - key "properties": dict[str, str] - key "tags": dict[str, str] - key "taxonomyCategories": list[TaxonomyCategory] + key "name": Required[str] + key "taxonomyInput": Required[EvaluationTaxonomyInput] + key "version": Required[str] description: str id: str - name: Required[str] + name: str properties: dict[str, str] tags: dict[str, str] taxonomyCategories: list[TaxonomyCategory] - taxonomyInput: Required[EvaluationTaxonomyInput] - version: Required[str] + taxonomyInput: EvaluationTaxonomyInput + version: str class azure.ai.projects.types.EvaluationTaxonomyInput(TypedDict, total=False): - riskCategories: Required[list[Union[str, RiskCategory]]] - target: Required[EvaluationTarget] - type: Required[Literal[EvaluationTaxonomyInputType.AGENT]] + key "riskCategories": Required[list[Union[str, RiskCategory]]] + key "target": Required[EvaluationTarget] + key "type": Required[Literal[EvaluationTaxonomyInputType.AGENT]] + riskCategories: list[Union[str, RiskCategory]] + target: EvaluationTarget + type: Literal[EvaluationTaxonomyInputType.AGENT] class azure.ai.projects.types.EvaluationTaxonomyInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -17260,7 +17444,8 @@ namespace azure.ai.projects.types class azure.ai.projects.types.EvaluatorCredentialRequest(TypedDict, total=False): - blob_uri: Required[str] + key "blob_uri": Required[str] + blob_uri: str class azure.ai.projects.types.EvaluatorDefinitionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -17274,35 +17459,42 @@ namespace azure.ai.projects.types class azure.ai.projects.types.EvaluatorGenerationArtifacts(TypedDict, total=False): - dataset: Required[DatasetReference] - kinds: Required[list[str]] + key "dataset": Required[DatasetReference] + key "kinds": Required[list[str]] + dataset: DatasetReference + kinds: list[str] class azure.ai.projects.types.EvaluatorGenerationInputs(TypedDict, total=False): key "evaluator_description": str key "evaluator_display_name": str + key "evaluator_name": Required[str] + key "model": Required[str] + key "sources": Required[list[EvaluatorGenerationJobSource]] evaluator_description: str evaluator_display_name: str - evaluator_name: Required[str] - model: Required[str] - sources: Required[list[EvaluatorGenerationJobSource]] + evaluator_name: str + model: str + sources: list[EvaluatorGenerationJobSource] class azure.ai.projects.types.EvaluatorGenerationJob(TypedDict, total=False): - key "error": ForwardRef('ApiError') + key "created_at": Required[int] + key "error": ForwardRef('ApiError', module='types') key "finished_at": int - key "input_quality_warnings": list[RubricGenerationInputQualityWarning] - key "inputs": ForwardRef('EvaluatorGenerationInputs') - key "result": ForwardRef('EvaluatorVersion') - key "usage": ForwardRef('EvaluatorGenerationTokenUsage') - created_at: Required[int] + key "id": Required[str] + key "inputs": ForwardRef('EvaluatorGenerationInputs', module='types') + key "result": ForwardRef('EvaluatorVersion', module='types') + key "status": Required[Union[str, JobStatus]] + key "usage": ForwardRef('EvaluatorGenerationTokenUsage', module='types') + created_at: int error: ApiError finished_at: int - id: Required[str] + id: str input_quality_warnings: list[RubricGenerationInputQualityWarning] inputs: EvaluatorGenerationInputs result: EvaluatorVersion - status: Required[Union[str, JobStatus]] + status: Union[str, JobStatus] usage: EvaluatorGenerationTokenUsage @@ -17314,9 +17506,12 @@ namespace azure.ai.projects.types class azure.ai.projects.types.EvaluatorGenerationTokenUsage(TypedDict, total=False): - input_tokens: Required[int] - output_tokens: Required[int] - total_tokens: Required[int] + key "input_tokens": Required[int] + key "output_tokens": Required[int] + key "total_tokens": Required[int] + input_tokens: int + output_tokens: int + total_tokens: int class azure.ai.projects.types.EvaluatorMetric(TypedDict, total=False): @@ -17335,82 +17530,88 @@ namespace azure.ai.projects.types class azure.ai.projects.types.EvaluatorVersion(TypedDict, total=False): + key "categories": Required[list[Union[str, EvaluatorCategory]]] + key "created_at": Required[str] + key "created_by": Required[str] + key "definition": Required[EvaluatorDefinition] key "description": str key "display_name": str - key "generation_artifacts": ForwardRef('EvaluatorGenerationArtifacts') + key "evaluator_type": Required[Union[str, EvaluatorType]] + key "generation_artifacts": ForwardRef('EvaluatorGenerationArtifacts', module='types') key "generation_job_id": str key "id": str - key "metadata": dict[str, str] - key "supported_evaluation_levels": list[Union[str, EvaluationLevel]] - key "tags": dict[str, str] - key "warnings": list[Union[str, GenerationWarningType]] - categories: Required[list[Union[str, EvaluatorCategory]]] - created_at: Required[str] - created_by: Required[str] - definition: Required[EvaluatorDefinition] + key "modified_at": Required[str] + key "name": Required[str] + key "version": Required[str] + categories: list[Union[str, EvaluatorCategory]] + created_at: str + created_by: str + definition: EvaluatorDefinition description: str display_name: str - evaluator_type: Required[Union[str, EvaluatorType]] + evaluator_type: Union[str, EvaluatorType] generation_artifacts: EvaluatorGenerationArtifacts generation_job_id: str id: str metadata: dict[str, str] - modified_at: Required[str] - name: Required[str] + modified_at: str + name: str supported_evaluation_levels: list[Union[str, EvaluationLevel]] tags: dict[str, str] - version: Required[str] + version: str warnings: list[Union[str, GenerationWarningType]] class azure.ai.projects.types.ExternalAgentDefinition(TypedDict, total=False): + key "kind": Required[Literal[AgentKind.EXTERNAL]] key "otel_agent_id": str - key "rai_config": ForwardRef('RaiConfig') - kind: Required[Literal[AgentKind.EXTERNAL]] + key "rai_config": ForwardRef('RaiConfig', module='types') + kind: Literal[AgentKind.EXTERNAL] otel_agent_id: str rai_config: RaiConfig class azure.ai.projects.types.FabricDataAgentToolParameters(TypedDict, total=False): - key "project_connections": list[ToolProjectConnection] project_connections: list[ToolProjectConnection] class azure.ai.projects.types.FabricIQPreviewTool(TypedDict, total=False): + key "project_connection_id": Required[str] key "require_approval": Optional[Union[MCPToolRequireApproval, str]] key "server_label": str key "server_url": str - project_connection_id: Required[str] + key "type": Required[Literal[ToolType.FABRIC_IQ_PREVIEW]] + project_connection_id: str require_approval: Union[MCPToolRequireApproval, str] server_label: str server_url: str - type: Required[Literal[ToolType.FABRIC_IQ_PREVIEW]] + type: Literal[ToolType.FABRIC_IQ_PREVIEW] class azure.ai.projects.types.FabricIQPreviewToolboxTool(TypedDict, total=False): key "description": str key "name": str + key "project_connection_id": Required[str] key "require_approval": Optional[Union[MCPToolRequireApproval, str]] key "server_label": str key "server_url": str - key "tool_configs": dict[str, ToolConfig] + key "type": Required[Literal[ToolboxToolType.FABRIC_IQ_PREVIEW]] description: str name: str - project_connection_id: Required[str] + project_connection_id: str require_approval: Union[MCPToolRequireApproval, str] server_label: str server_url: str tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolboxToolType.FABRIC_IQ_PREVIEW]] + type: Literal[ToolboxToolType.FABRIC_IQ_PREVIEW] class azure.ai.projects.types.FieldMapping(TypedDict, total=False): + key "contentFields": Required[list[str]] key "filepathField": str - key "metadataFields": list[str] key "titleField": str key "urlField": str - key "vectorFields": list[str] - contentFields: Required[list[str]] + contentFields: list[str] filepathField: str metadataFields: list[str] titleField: str @@ -17419,33 +17620,41 @@ namespace azure.ai.projects.types class azure.ai.projects.types.FileDataGenerationJobOutput(TypedDict, total=False): - filename: Required[str] - id: Required[str] - type: Required[Literal[DataGenerationJobOutputType.FILE]] + key "filename": Required[str] + key "id": Required[str] + key "type": Required[Literal[DataGenerationJobOutputType.FILE]] + filename: str + id: str + type: Literal[DataGenerationJobOutputType.FILE] class azure.ai.projects.types.FileDataGenerationJobSource(TypedDict, total=False): key "description": str + key "id": Required[str] + key "type": Required[Literal[DataGenerationJobSourceType.FILE]] description: str - id: Required[str] - type: Required[Literal[DataGenerationJobSourceType.FILE]] + id: str + type: Literal[DataGenerationJobSourceType.FILE] class azure.ai.projects.types.FileDatasetVersion(TypedDict, total=False): key "connectionName": str + key "dataUri": Required[str] key "description": str key "id": str key "isReference": bool - key "tags": dict[str, str] + key "name": Required[str] + key "type": Required[Literal[DatasetType.URI_FILE]] + key "version": Required[str] connectionName: str - dataUri: Required[str] + dataUri: str description: str id: str isReference: bool - name: Required[str] + name: str tags: dict[str, str] - type: Required[Literal[DatasetType.URI_FILE]] - version: Required[str] + type: Literal[DatasetType.URI_FILE] + version: str class azure.ai.projects.types.FileSearchTool(TypedDict, total=False): @@ -17453,16 +17662,17 @@ namespace azure.ai.projects.types key "filters": Optional[Filters] key "max_num_results": int key "name": str - key "ranking_options": ForwardRef('RankingOptions') - key "tool_configs": dict[str, ToolConfig] + key "ranking_options": ForwardRef('RankingOptions', module='types') + key "type": Required[Literal[ToolType.FILE_SEARCH]] + key "vector_store_ids": Required[list[str]] description: str filters: Filters max_num_results: int name: str ranking_options: RankingOptions tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolType.FILE_SEARCH]] - vector_store_ids: Required[list[str]] + type: Literal[ToolType.FILE_SEARCH] + vector_store_ids: list[str] class azure.ai.projects.types.FileSearchToolboxTool(TypedDict, total=False): @@ -17470,40 +17680,45 @@ namespace azure.ai.projects.types key "filters": Optional[Filters] key "max_num_results": int key "name": str - key "ranking_options": ForwardRef('RankingOptions') - key "tool_configs": dict[str, ToolConfig] - key "vector_store_ids": list[str] + key "ranking_options": ForwardRef('RankingOptions', module='types') + key "type": Required[Literal[ToolboxToolType.FILE_SEARCH]] description: str filters: Filters max_num_results: int name: str ranking_options: RankingOptions tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolboxToolType.FILE_SEARCH]] + type: Literal[ToolboxToolType.FILE_SEARCH] vector_store_ids: list[str] class azure.ai.projects.types.FixedRatioVersionSelectionRule(TypedDict, total=False): - agent_version: Required[str] - traffic_percentage: Required[int] - type: Required[Literal[VersionSelectorType.FIXED_RATIO]] + key "agent_version": Required[str] + key "traffic_percentage": Required[int] + key "type": Required[Literal[VersionSelectorType.FIXED_RATIO]] + agent_version: str + traffic_percentage: int + type: Literal[VersionSelectorType.FIXED_RATIO] class azure.ai.projects.types.FolderDatasetVersion(TypedDict, total=False): key "connectionName": str + key "dataUri": Required[str] key "description": str key "id": str key "isReference": bool - key "tags": dict[str, str] + key "name": Required[str] + key "type": Required[Literal[DatasetType.URI_FOLDER]] + key "version": Required[str] connectionName: str - dataUri: Required[str] + dataUri: str description: str id: str isReference: bool - name: Required[str] + name: str tags: dict[str, str] - type: Required[Literal[DatasetType.URI_FOLDER]] - version: Required[str] + type: Literal[DatasetType.URI_FOLDER] + version: str class azure.ai.projects.types.FoundryModelWarning(TypedDict, total=False): @@ -17518,24 +17733,26 @@ namespace azure.ai.projects.types key "description": str key "environment": Optional[FunctionShellToolParamEnvironment] key "name": str - key "tool_configs": dict[str, ToolConfig] + key "type": Required[Literal[ToolType.SHELL]] allowed_callers: list[Union[str, CallableToolAllowedCaller]] description: str environment: FunctionShellToolParamEnvironment name: str tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolType.SHELL]] + type: Literal[ToolType.SHELL] class azure.ai.projects.types.FunctionShellToolParamEnvironmentContainerReferenceParam(TypedDict, total=False): - container_id: Required[str] - type: Required[Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE]] + key "container_id": Required[str] + key "type": Required[Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE]] + container_id: str + type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE] class azure.ai.projects.types.FunctionShellToolParamEnvironmentLocalEnvironmentParam(TypedDict, total=False): - key "skills": list[LocalSkillParam] + key "type": Required[Literal[FunctionShellToolParamEnvironmentType.LOCAL]] skills: list[LocalSkillParam] - type: Required[Literal[FunctionShellToolParamEnvironmentType.LOCAL]] + type: Literal[FunctionShellToolParamEnvironmentType.LOCAL] class azure.ai.projects.types.FunctionShellToolParamEnvironmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -17548,83 +17765,105 @@ namespace azure.ai.projects.types key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] key "defer_loading": bool key "description": Optional[str] + key "name": Required[str] key "output_schema": Optional[dict[str, Any]] + key "parameters": Required[Optional[dict[str, Any]]] + key "strict": Required[Optional[bool]] + key "type": Required[Literal[ToolType.FUNCTION]] allowed_callers: list[Union[str, CallableToolAllowedCaller]] defer_loading: bool description: str - name: Required[str] + name: str output_schema: dict[str, Any] - parameters: Required[Optional[dict[str, Any]]] - strict: Required[Optional[bool]] - type: Required[Literal[ToolType.FUNCTION]] + parameters: dict[str, Any] + strict: bool + type: Literal[ToolType.FUNCTION] class azure.ai.projects.types.FunctionToolParam(TypedDict, total=False): key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] key "defer_loading": bool key "description": Optional[str] + key "name": Required[str] key "output_schema": Optional[dict[str, Any]] key "parameters": Optional[EmptyModelParam] key "strict": Optional[bool] + key "type": Required[Literal["function"]] allowed_callers: list[Union[str, CallableToolAllowedCaller]] defer_loading: bool description: str - name: Required[str] + name: str output_schema: dict[str, Any] parameters: EmptyModelParam strict: bool - type: Required[Literal["function"]] + type: Literal[function] class azure.ai.projects.types.GenerateAgentRequest(TypedDict, total=False): - kind: Required[Union[str, AgentKind]] + key "kind": Required[Union[str, AgentKind]] + kind: Union[str, AgentKind] class azure.ai.projects.types.GitHubIssueRoutineTrigger(TypedDict, total=False): - connection_id: Required[str] - issue_event: Required[Union[str, GitHubIssueEvent]] - owner: Required[str] - repository: Required[str] - type: Required[Literal[RoutineTriggerType.GITHUB_ISSUE]] + key "connection_id": Required[str] + key "issue_event": Required[Union[str, GitHubIssueEvent]] + key "owner": Required[str] + key "repository": Required[str] + key "type": Required[Literal[RoutineTriggerType.GITHUB_ISSUE]] + connection_id: str + issue_event: Union[str, GitHubIssueEvent] + owner: str + repository: str + type: Literal[RoutineTriggerType.GITHUB_ISSUE] class azure.ai.projects.types.HeaderTelemetryEndpointAuth(TypedDict, total=False): - header_name: Required[str] - secret_id: Required[str] - secret_key: Required[str] - type: Required[Literal[TelemetryEndpointAuthType.HEADER]] + key "header_name": Required[str] + key "secret_id": Required[str] + key "secret_key": Required[str] + key "type": Required[Literal[TelemetryEndpointAuthType.HEADER]] + header_name: str + secret_id: str + secret_key: str + type: Literal[TelemetryEndpointAuthType.HEADER] class azure.ai.projects.types.HostedAgentDefinition(TypedDict, total=False): - key "code_configuration": ForwardRef('CodeConfiguration') - key "container_configuration": ForwardRef('ContainerConfiguration') - key "environment_variables": dict[str, str] - key "protocol_versions": list[ProtocolVersionRecord] - key "rai_config": ForwardRef('RaiConfig') - key "telemetry_config": ForwardRef('TelemetryConfig') + key "code_configuration": ForwardRef('CodeConfiguration', module='types') + key "container_configuration": ForwardRef('ContainerConfiguration', module='types') + key "cpu": Required[str] + key "kind": Required[Literal[AgentKind.HOSTED]] + key "memory": Required[str] + key "rai_config": ForwardRef('RaiConfig', module='types') + key "telemetry_config": ForwardRef('TelemetryConfig', module='types') code_configuration: CodeConfiguration container_configuration: ContainerConfiguration - cpu: Required[str] + cpu: str environment_variables: dict[str, str] - kind: Required[Literal[AgentKind.HOSTED]] - memory: Required[str] + kind: Literal[AgentKind.HOSTED] + memory: str protocol_versions: list[ProtocolVersionRecord] rai_config: RaiConfig telemetry_config: TelemetryConfig class azure.ai.projects.types.HourlyRecurrenceSchedule(TypedDict, total=False): - type: Required[Literal[RecurrenceType.HOURLY]] + key "type": Required[Literal[RecurrenceType.HOURLY]] + type: Literal[RecurrenceType.HOURLY] class azure.ai.projects.types.HumanEvaluationPreviewRuleAction(TypedDict, total=False): - templateId: Required[str] - type: Required[Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW]] + key "templateId": Required[str] + key "type": Required[Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW]] + templateId: str + type: Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW] class azure.ai.projects.types.HybridSearchOptions(TypedDict, total=False): - embedding_weight: Required[float] - text_weight: Required[float] + key "embedding_weight": Required[float] + key "text_weight": Required[float] + embedding_weight: float + text_weight: float class azure.ai.projects.types.ImageGenTool(TypedDict, total=False): @@ -17632,7 +17871,7 @@ namespace azure.ai.projects.types key "background": Literal["transparent", "opaque", "auto"] key "description": str key "input_fidelity": Optional[Union[str, InputFidelity]] - key "input_image_mask": ForwardRef('ImageGenToolInputImageMask') + key "input_image_mask": ForwardRef('ImageGenToolInputImageMask', module='types') key "model": Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], Literal["gpt-image-5"], str] key "moderation": Literal["auto", "low"] key "name": str @@ -17641,7 +17880,7 @@ namespace azure.ai.projects.types key "partial_images": int key "quality": Literal["low", "medium", "high", "auto"] key "size": Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str] - key "tool_configs": dict[str, ToolConfig] + key "type": Required[Literal[ToolType.IMAGE_GENERATION]] action: Union[str, ImageGenAction] background: Literal[transparent, opaque, auto] description: str @@ -17656,7 +17895,7 @@ namespace azure.ai.projects.types quality: Literal[low, medium, high, auto] size: Union[Literal[1024x1024], Literal[1024x1536], Literal[1536x1024], Literal[auto], str] tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolType.IMAGE_GENERATION]] + type: Literal[ToolType.IMAGE_GENERATION] class azure.ai.projects.types.ImageGenToolInputImageMask(TypedDict, total=False): @@ -17673,66 +17912,94 @@ namespace azure.ai.projects.types class azure.ai.projects.types.InlineSkillParam(TypedDict, total=False): - description: Required[str] - name: Required[str] - source: Required[InlineSkillSourceParam] - type: Required[Literal[ContainerSkillType.INLINE]] + key "description": Required[str] + key "name": Required[str] + key "source": Required[InlineSkillSourceParam] + key "type": Required[Literal[ContainerSkillType.INLINE]] + description: str + name: str + source: InlineSkillSourceParam + type: Literal[ContainerSkillType.INLINE] class azure.ai.projects.types.InlineSkillSourceParam(TypedDict, total=False): - data: Required[str] - media_type: Required[Literal["application/zip"]] - type: Required[Literal["base64"]] + key "data": Required[str] + key "media_type": Required[Literal["application/zip"]] + key "type": Required[Literal["base64"]] + data: str + media_type: Literal[application/zip] + type: Literal[base64] class azure.ai.projects.types.Insight(TypedDict, total=False): - key "result": ForwardRef('InsightResult') - displayName: Required[str] - id: Required[str] - metadata: Required[InsightsMetadata] - request: Required[InsightRequest] - result: InsightResult - state: Required[Union[str, OperationState]] - - + key "displayName": Required[str] + key "id": Required[str] + key "metadata": Required[InsightsMetadata] + key "request": Required[InsightRequest] + key "result": ForwardRef('InsightResult', module='types') + key "state": Required[Union[str, OperationState]] + displayName: str + id: str + metadata: InsightsMetadata + request: InsightRequest + result: InsightResult + state: Union[str, OperationState] + + class azure.ai.projects.types.InsightCluster(TypedDict, total=False): - key "samples": list[InsightSample] - key "subClusters": list[InsightCluster] - description: Required[str] - id: Required[str] - label: Required[str] + key "description": Required[str] + key "id": Required[str] + key "label": Required[str] + key "suggestion": Required[str] + key "suggestionTitle": Required[str] + key "weight": Required[int] + description: str + id: str + label: str samples: list[InsightSample] subClusters: list[InsightCluster] - suggestion: Required[str] - suggestionTitle: Required[str] - weight: Required[int] + suggestion: str + suggestionTitle: str + weight: int class azure.ai.projects.types.InsightModelConfiguration(TypedDict, total=False): - modelDeploymentName: Required[str] + key "modelDeploymentName": Required[str] + modelDeploymentName: str class azure.ai.projects.types.InsightSample(TypedDict, total=False): - correlationInfo: Required[dict[str, Any]] - evaluationResult: Required[EvalResult] - features: Required[dict[str, Any]] - id: Required[str] - type: Required[Literal[SampleType.EVALUATION_RESULT_SAMPLE]] + key "correlationInfo": Required[dict[str, Any]] + key "evaluationResult": Required[EvalResult] + key "features": Required[dict[str, Any]] + key "id": Required[str] + key "type": Required[Literal[SampleType.EVALUATION_RESULT_SAMPLE]] + correlationInfo: dict[str, Any] + evaluationResult: EvalResult + features: dict[str, Any] + id: str + type: Literal[SampleType.EVALUATION_RESULT_SAMPLE] class azure.ai.projects.types.InsightScheduleTask(TypedDict, total=False): - key "configuration": dict[str, str] + key "insight": Required[Insight] + key "type": Required[Literal[ScheduleTaskType.INSIGHT]] configuration: dict[str, str] - insight: Required[Insight] - type: Required[Literal[ScheduleTaskType.INSIGHT]] + insight: Insight + type: Literal[ScheduleTaskType.INSIGHT] class azure.ai.projects.types.InsightSummary(TypedDict, total=False): - method: Required[str] - sampleCount: Required[int] - uniqueClusterCount: Required[int] - uniqueSubclusterCount: Required[int] - usage: Required[ClusterTokenUsage] + key "method": Required[str] + key "sampleCount": Required[int] + key "uniqueClusterCount": Required[int] + key "uniqueSubclusterCount": Required[int] + key "usage": Required[ClusterTokenUsage] + method: str + sampleCount: int + uniqueClusterCount: int + uniqueSubclusterCount: int + usage: ClusterTokenUsage class azure.ai.projects.types.InsightType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -17743,8 +18010,9 @@ namespace azure.ai.projects.types class azure.ai.projects.types.InsightsMetadata(TypedDict, total=False): key "completedAt": str + key "createdAt": Required[str] completedAt: str - createdAt: Required[str] + createdAt: str class azure.ai.projects.types.InvocationsProtocolConfiguration(TypedDict, total=False): @@ -17754,8 +18022,10 @@ namespace azure.ai.projects.types class azure.ai.projects.types.InvokeAgentInvocationsApiDispatchPayload(TypedDict, total=False): - input: Required[Any] - type: Required[Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API]] + key "input": Required[Any] + key "type": Required[Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API]] + input: Any + type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API] class azure.ai.projects.types.InvokeAgentInvocationsApiRoutineAction(TypedDict, total=False): @@ -17763,16 +18033,19 @@ namespace azure.ai.projects.types key "agent_name": str key "input": Any key "session_id": str + key "type": Required[Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API]] agent_endpoint_id: str agent_name: str input: Any session_id: str - type: Required[Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API]] + type: Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API] class azure.ai.projects.types.InvokeAgentResponsesApiDispatchPayload(TypedDict, total=False): - input: Required[Any] - type: Required[Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API]] + key "input": Required[Any] + key "type": Required[Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API]] + input: Any + type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API] class azure.ai.projects.types.InvokeAgentResponsesApiRoutineAction(TypedDict, total=False): @@ -17780,51 +18053,60 @@ namespace azure.ai.projects.types key "agent_name": str key "conversation": str key "input": Any + key "type": Required[Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API]] agent_endpoint_id: str agent_name: str conversation: str input: Any - type: Required[Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API]] + type: Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API] class azure.ai.projects.types.ListMemoriesRequest(TypedDict, total=False): - scope: Required[str] + key "scope": Required[str] + scope: str class azure.ai.projects.types.LlmGeneratedVoiceGreetingConfig(TypedDict, total=False): - key "tool_choice": ForwardRef('VoiceAgentToolChoice') - prompt: Required[str] + key "prompt": Required[str] + key "tool_choice": ForwardRef('VoiceAgentToolChoice', module='types') + key "type": Required[Literal["llm_generated"]] + prompt: str tool_choice: VoiceAgentToolChoice - type: Required[Literal["llm_generated"]] + type: Literal[llm_generated] class azure.ai.projects.types.LocalShellToolParam(TypedDict, total=False): key "description": str key "name": str - key "tool_configs": dict[str, ToolConfig] + key "type": Required[Literal[ToolType.LOCAL_SHELL]] description: str name: str tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolType.LOCAL_SHELL]] + type: Literal[ToolType.LOCAL_SHELL] class azure.ai.projects.types.LocalSkillParam(TypedDict, total=False): - description: Required[str] - name: Required[str] - path: Required[str] + key "description": Required[str] + key "name": Required[str] + key "path": Required[str] + description: str + name: str + path: str class azure.ai.projects.types.LogProbProperties(TypedDict, total=False): - bytes: Required[list[int]] - logprob: Required[float] - token: Required[str] + key "bytes": Required[list[int]] + key "logprob": Required[float] + key "token": Required[str] + bytes: list[int] + logprob: float + token: str class azure.ai.projects.types.LoraConfig(TypedDict, total=False): key "alpha": int key "dropout": float key "rank": int - key "targetModules": list[str] alpha: int dropout: float rank: int @@ -17834,10 +18116,12 @@ namespace azure.ai.projects.types class azure.ai.projects.types.MCPListToolsTool(TypedDict, total=False): key "annotations": Optional[MCPListToolsToolAnnotations] key "description": Optional[str] + key "input_schema": Required[MCPListToolsToolInputSchema] + key "name": Required[str] annotations: MCPListToolsToolAnnotations description: str - input_schema: Required[MCPListToolsToolInputSchema] - name: Required[str] + input_schema: MCPListToolsToolInputSchema + name: str class azure.ai.projects.types.MCPListToolsToolAnnotations(TypedDict, total=False): @@ -17856,9 +18140,10 @@ namespace azure.ai.projects.types key "project_connection_id": str key "require_approval": Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] key "server_description": str + key "server_label": Required[str] key "server_url": str - key "tool_configs": dict[str, ToolConfig] key "tunnel_id": str + key "type": Required[Literal[ToolType.MCP]] allowed_callers: list[Union[str, CallableToolAllowedCaller]] allowed_tools: Union[list[str], MCPToolFilter] authorization: str @@ -17868,23 +18153,22 @@ namespace azure.ai.projects.types project_connection_id: str require_approval: Union[MCPToolRequireApproval, Literal[always], Literal[never]] server_description: str - server_label: Required[str] + server_label: str server_url: str tool_configs: dict[str, ToolConfig] tunnel_id: str - type: Required[Literal[ToolType.MCP]] + type: Literal[ToolType.MCP] class azure.ai.projects.types.MCPToolFilter(TypedDict, total=False): key "read_only": bool - key "tool_names": list[str] read_only: bool tool_names: list[str] class azure.ai.projects.types.MCPToolRequireApproval(TypedDict, total=False): - key "always": ForwardRef('MCPToolFilter') - key "never": ForwardRef('MCPToolFilter') + key "always": ForwardRef('MCPToolFilter', module='types') + key "never": ForwardRef('MCPToolFilter', module='types') always: MCPToolFilter never: MCPToolFilter @@ -17901,9 +18185,10 @@ namespace azure.ai.projects.types key "project_connection_id": str key "require_approval": Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] key "server_description": str + key "server_label": Required[str] key "server_url": str - key "tool_configs": dict[str, ToolConfig] key "tunnel_id": str + key "type": Required[Literal[ToolboxToolType.MCP]] allowed_callers: list[Union[str, CallableToolAllowedCaller]] allowed_tools: Union[list[str], MCPToolFilter] authorization: str @@ -17915,29 +18200,34 @@ namespace azure.ai.projects.types project_connection_id: str require_approval: Union[MCPToolRequireApproval, Literal[always], Literal[never]] server_description: str - server_label: Required[str] + server_label: str server_url: str tool_configs: dict[str, ToolConfig] tunnel_id: str - type: Required[Literal[ToolboxToolType.MCP]] + type: Literal[ToolboxToolType.MCP] class azure.ai.projects.types.ManagedAgentIdentityBlueprintReference(TypedDict, total=False): - blueprint_id: Required[str] - type: Required[Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT]] + key "blueprint_id": Required[str] + key "type": Required[Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT]] + blueprint_id: str + type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] class azure.ai.projects.types.ManagedAzureAISearchIndex(TypedDict, total=False): key "description": str key "id": str - key "tags": dict[str, str] + key "name": Required[str] + key "type": Required[Literal[IndexType.MANAGED_AZURE_SEARCH]] + key "vectorStoreId": Required[str] + key "version": Required[str] description: str id: str - name: Required[str] + name: str tags: dict[str, str] - type: Required[Literal[IndexType.MANAGED_AZURE_SEARCH]] - vectorStoreId: Required[str] - version: Required[str] + type: Literal[IndexType.MANAGED_AZURE_SEARCH] + vectorStoreId: str + version: str class azure.ai.projects.types.McpProtocolConfiguration(TypedDict, total=False): @@ -17949,39 +18239,50 @@ namespace azure.ai.projects.types class azure.ai.projects.types.MemorySearchPreviewTool(TypedDict, total=False): - key "search_options": ForwardRef('MemorySearchOptions') + key "memory_store_name": Required[str] + key "scope": Required[str] + key "search_options": ForwardRef('MemorySearchOptions', module='types') + key "type": Required[Literal[ToolType.MEMORY_SEARCH_PREVIEW]] key "update_delay": int - memory_store_name: Required[str] - scope: Required[str] + memory_store_name: str + scope: str search_options: MemorySearchOptions - type: Required[Literal[ToolType.MEMORY_SEARCH_PREVIEW]] + type: Literal[ToolType.MEMORY_SEARCH_PREVIEW] update_delay: int class azure.ai.projects.types.MemoryStoreDefaultDefinition(TypedDict, total=False): - key "options": ForwardRef('MemoryStoreDefaultOptions') - chat_model: Required[str] - embedding_model: Required[str] - kind: Required[Literal[MemoryStoreKind.DEFAULT]] + key "chat_model": Required[str] + key "embedding_model": Required[str] + key "kind": Required[Literal[MemoryStoreKind.DEFAULT]] + key "options": ForwardRef('MemoryStoreDefaultOptions', module='types') + chat_model: str + embedding_model: str + kind: Literal[MemoryStoreKind.DEFAULT] options: MemoryStoreDefaultOptions class azure.ai.projects.types.MemoryStoreDefaultOptions(TypedDict, total=False): + key "chat_summary_enabled": Required[bool] key "default_ttl_seconds": str key "procedural_memory_enabled": bool key "user_profile_details": str - chat_summary_enabled: Required[bool] + key "user_profile_enabled": Required[bool] + chat_summary_enabled: bool default_ttl_seconds: str procedural_memory_enabled: bool user_profile_details: str - user_profile_enabled: Required[bool] + user_profile_enabled: bool class azure.ai.projects.types.MemoryStoreDefinition(TypedDict, total=False): - key "options": ForwardRef('MemoryStoreDefaultOptions') - chat_model: Required[str] - embedding_model: Required[str] - kind: Required[Literal[MemoryStoreKind.DEFAULT]] + key "chat_model": Required[str] + key "embedding_model": Required[str] + key "kind": Required[Literal[MemoryStoreKind.DEFAULT]] + key "options": ForwardRef('MemoryStoreDefaultOptions', module='types') + chat_model: str + embedding_model: str + kind: Literal[MemoryStoreKind.DEFAULT] options: MemoryStoreDefaultOptions @@ -17993,20 +18294,24 @@ namespace azure.ai.projects.types class azure.ai.projects.types.MicrosoftFabricPreviewTool(TypedDict, total=False): - fabric_dataagent_preview: Required[FabricDataAgentToolParameters] - type: Required[Literal[ToolType.FABRIC_DATAAGENT_PREVIEW]] + key "fabric_dataagent_preview": Required[FabricDataAgentToolParameters] + key "type": Required[Literal[ToolType.FABRIC_DATAAGENT_PREVIEW]] + fabric_dataagent_preview: FabricDataAgentToolParameters + type: Literal[ToolType.FABRIC_DATAAGENT_PREVIEW] class azure.ai.projects.types.ModelCredentialRequest(TypedDict, total=False): - blobUri: Required[str] + key "blobUri": Required[str] + blobUri: str class azure.ai.projects.types.ModelPendingUploadRequest(TypedDict, total=False): key "connectionName": str key "pendingUploadId": str + key "pendingUploadType": Required[Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE]] connectionName: str pendingUploadId: str - pendingUploadType: Required[Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE]] + pendingUploadType: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] class azure.ai.projects.types.ModelSamplingParams(TypedDict, total=False): @@ -18028,39 +18333,46 @@ namespace azure.ai.projects.types class azure.ai.projects.types.ModelVersion(TypedDict, total=False): - key "artifactProfile": ForwardRef('ArtifactProfile') + key "artifactProfile": ForwardRef('ArtifactProfile', module='types') key "baseModel": str + key "blobUri": Required[str] key "description": str key "id": str - key "loraConfig": ForwardRef('LoraConfig') - key "source": ForwardRef('ModelSourceData') - key "tags": dict[str, str] - key "warnings": list[FoundryModelWarning] + key "loraConfig": ForwardRef('LoraConfig', module='types') + key "name": Required[str] + key "source": ForwardRef('ModelSourceData', module='types') + key "version": Required[str] key "weightType": Union[str, FoundryModelWeightType] artifactProfile: ArtifactProfile baseModel: str - blobUri: Required[str] + blobUri: str description: str id: str loraConfig: LoraConfig - name: Required[str] + name: str source: ModelSourceData tags: dict[str, str] - version: Required[str] + version: str warnings: list[FoundryModelWarning] weightType: Union[str, FoundryModelWeightType] class azure.ai.projects.types.MonthlyRecurrenceSchedule(TypedDict, total=False): - daysOfMonth: Required[list[int]] - type: Required[Literal[RecurrenceType.MONTHLY]] + key "daysOfMonth": Required[list[int]] + key "type": Required[Literal[RecurrenceType.MONTHLY]] + daysOfMonth: list[int] + type: Literal[RecurrenceType.MONTHLY] class azure.ai.projects.types.NamespaceToolParam(TypedDict, total=False): - description: Required[str] - name: Required[str] - tools: Required[list[Union[FunctionToolParam, CustomToolParam]]] - type: Required[Literal[ToolType.NAMESPACE]] + key "description": Required[str] + key "name": Required[str] + key "tools": Required[list[Union[FunctionToolParam, CustomToolParam]]] + key "type": Required[Literal[ToolType.NAMESPACE]] + description: str + name: str + tools: list[Union[FunctionToolParam, CustomToolParam]] + type: Literal[ToolType.NAMESPACE] class azure.ai.projects.types.OmitPropertiesRealtimeResponse1(TypedDict, total=False): @@ -18069,16 +18381,15 @@ namespace azure.ai.projects.types key "max_output_tokens": Union[int, Literal["inf"]] key "metadata": Optional[Metadata] key "object": Literal["response"] - key "output_modalities": list[Literal["text", "audio"]] key "status": Literal["completed", "cancelled", "failed", "incomplete", "in_progress"] - key "status_details": ForwardRef('RealtimeResponseStatusDetails') - key "usage": ForwardRef('RealtimeResponseUsage') + key "status_details": ForwardRef('RealtimeResponseStatusDetails', module='types') + key "usage": ForwardRef('RealtimeResponseUsage', module='types') conversation_id: str id: str max_output_tokens: Union[int, Literal[inf]] metadata: Metadata object: Literal[response] - output_modalities: list[Literal[text, audio]] + output_modalities: list[Literal["text", "audio"]] status: Literal[completed, cancelled, failed, incomplete, in_progress] status_details: RealtimeResponseStatusDetails usage: RealtimeResponseUsage @@ -18086,13 +18397,16 @@ namespace azure.ai.projects.types class azure.ai.projects.types.OneTimeTrigger(TypedDict, total=False): key "timeZone": str + key "triggerAt": Required[str] + key "type": Required[Literal[TriggerType.ONE_TIME]] timeZone: str - triggerAt: Required[str] - type: Required[Literal[TriggerType.ONE_TIME]] + triggerAt: str + type: Literal[TriggerType.ONE_TIME] class azure.ai.projects.types.OpenApiAnonymousAuthDetails(TypedDict, total=False): - type: Required[Literal[OpenApiAuthType.ANONYMOUS]] + key "type": Required[Literal[OpenApiAuthType.ANONYMOUS]] + type: Literal[OpenApiAuthType.ANONYMOUS] class azure.ai.projects.types.OpenApiAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -18102,78 +18416,94 @@ namespace azure.ai.projects.types class azure.ai.projects.types.OpenApiFunctionDefinition(TypedDict, total=False): - key "default_params": list[str] + key "auth": Required[OpenApiAuthDetails] key "description": str - key "functions": list[OpenApiFunctionDefinitionFunction] - auth: Required[OpenApiAuthDetails] + key "name": Required[str] + key "spec": Required[dict[str, Any]] + auth: OpenApiAuthDetails default_params: list[str] description: str functions: list[OpenApiFunctionDefinitionFunction] - name: Required[str] - spec: Required[dict[str, Any]] + name: str + spec: dict[str, Any] class azure.ai.projects.types.OpenApiFunctionDefinitionFunction(TypedDict, total=False): key "description": str + key "name": Required[str] + key "parameters": Required[dict[str, Any]] description: str - name: Required[str] - parameters: Required[dict[str, Any]] + name: str + parameters: dict[str, Any] class azure.ai.projects.types.OpenApiManagedAuthDetails(TypedDict, total=False): - security_scheme: Required[OpenApiManagedSecurityScheme] - type: Required[Literal[OpenApiAuthType.MANAGED_IDENTITY]] + key "security_scheme": Required[OpenApiManagedSecurityScheme] + key "type": Required[Literal[OpenApiAuthType.MANAGED_IDENTITY]] + security_scheme: OpenApiManagedSecurityScheme + type: Literal[OpenApiAuthType.MANAGED_IDENTITY] class azure.ai.projects.types.OpenApiManagedSecurityScheme(TypedDict, total=False): - audience: Required[str] + key "audience": Required[str] + audience: str class azure.ai.projects.types.OpenApiProjectConnectionAuthDetails(TypedDict, total=False): - security_scheme: Required[OpenApiProjectConnectionSecurityScheme] - type: Required[Literal[OpenApiAuthType.PROJECT_CONNECTION]] + key "security_scheme": Required[OpenApiProjectConnectionSecurityScheme] + key "type": Required[Literal[OpenApiAuthType.PROJECT_CONNECTION]] + security_scheme: OpenApiProjectConnectionSecurityScheme + type: Literal[OpenApiAuthType.PROJECT_CONNECTION] class azure.ai.projects.types.OpenApiProjectConnectionSecurityScheme(TypedDict, total=False): - project_connection_id: Required[str] + key "project_connection_id": Required[str] + project_connection_id: str class azure.ai.projects.types.OpenApiTool(TypedDict, total=False): - key "tool_configs": dict[str, ToolConfig] - openapi: Required[OpenApiFunctionDefinition] + key "openapi": Required[OpenApiFunctionDefinition] + key "type": Required[Literal[ToolType.OPENAPI]] + openapi: OpenApiFunctionDefinition tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolType.OPENAPI]] + type: Literal[ToolType.OPENAPI] class azure.ai.projects.types.OpenApiToolboxTool(TypedDict, total=False): key "description": str key "name": str - key "tool_configs": dict[str, ToolConfig] + key "openapi": Required[OpenApiFunctionDefinition] + key "type": Required[Literal[ToolboxToolType.OPENAPI]] description: str name: str - openapi: Required[OpenApiFunctionDefinition] + openapi: OpenApiFunctionDefinition tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolboxToolType.OPENAPI]] + type: Literal[ToolboxToolType.OPENAPI] class azure.ai.projects.types.OptimizedAgentIdentifier(TypedDict, total=False): + key "agent_name": Required[str] key "agent_version": str - agent_name: Required[str] + agent_name: str agent_version: str class azure.ai.projects.types.OtlpTelemetryEndpoint(TypedDict, total=False): - key "auth": ForwardRef('TelemetryEndpointAuth') + key "auth": ForwardRef('TelemetryEndpointAuth', module='types') + key "data": Required[list[Union[str, TelemetryDataKind]]] + key "endpoint": Required[str] + key "kind": Required[Literal[TelemetryEndpointKind.OTLP]] + key "protocol": Required[Union[str, TelemetryTransportProtocol]] auth: TelemetryEndpointAuth - data: Required[list[Union[str, TelemetryDataKind]]] - endpoint: Required[str] - kind: Required[Literal[TelemetryEndpointKind.OTLP]] - protocol: Required[Union[str, TelemetryTransportProtocol]] + data: list[Union[str, TelemetryDataKind]] + endpoint: str + kind: Literal[TelemetryEndpointKind.OTLP] + protocol: Union[str, TelemetryTransportProtocol] class azure.ai.projects.types.PatchAgentObjectRequest(TypedDict, total=False): - key "agent_card": ForwardRef('AgentCard') - key "agent_endpoint": ForwardRef('AgentEndpointConfig') + key "agent_card": ForwardRef('AgentCard', module='types') + key "agent_endpoint": ForwardRef('AgentEndpointConfig', module='types') agent_card: AgentCard agent_endpoint: AgentEndpointConfig @@ -18181,9 +18511,10 @@ namespace azure.ai.projects.types class azure.ai.projects.types.PendingUploadRequest(TypedDict, total=False): key "connectionName": str key "pendingUploadId": str + key "pendingUploadType": Required[Literal[PendingUploadType.BLOB_REFERENCE]] connectionName: str pendingUploadId: str - pendingUploadType: Required[Literal[PendingUploadType.BLOB_REFERENCE]] + pendingUploadType: Literal[PendingUploadType.BLOB_REFERENCE] class azure.ai.projects.types.PendingUploadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -18193,33 +18524,37 @@ namespace azure.ai.projects.types class azure.ai.projects.types.PickPropertiesVoiceAudioConfig(TypedDict, total=False): - key "output": ForwardRef('VoiceAudioOutputConfig') + key "output": ForwardRef('VoiceAudioOutputConfig', module='types') output: VoiceAudioOutputConfig class azure.ai.projects.types.ProgrammaticToolCallingParam(TypedDict, total=False): - type: Required[Literal[ToolType.PROGRAMMATIC_TOOL_CALLING]] + key "type": Required[Literal[ToolType.PROGRAMMATIC_TOOL_CALLING]] + type: Literal[ToolType.PROGRAMMATIC_TOOL_CALLING] class azure.ai.projects.types.PromotionInfo(TypedDict, total=False): - agent_name: Required[str] - agent_version: Required[str] - promoted_at: Required[int] + key "agent_name": Required[str] + key "agent_version": Required[str] + key "promoted_at": Required[int] + agent_name: str + agent_version: str + promoted_at: int class azure.ai.projects.types.PromptAgentDefinition(TypedDict, total=False): key "instructions": Optional[str] - key "rai_config": ForwardRef('RaiConfig') + key "kind": Required[Literal[AgentKind.PROMPT]] + key "model": Required[str] + key "rai_config": ForwardRef('RaiConfig', module='types') key "reasoning": Optional[Reasoning] - key "structured_inputs": dict[str, StructuredInputDefinition] key "temperature": Optional[float] - key "text": ForwardRef('PromptAgentDefinitionTextOptions') + key "text": ForwardRef('PromptAgentDefinitionTextOptions', module='types') key "tool_choice": Union[str, ToolChoiceParam] - key "tools": list[Tool] key "top_p": Optional[float] instructions: str - kind: Required[Literal[AgentKind.PROMPT]] - model: Required[str] + kind: Literal[AgentKind.PROMPT] + model: str rai_config: RaiConfig reasoning: Reasoning structured_inputs: dict[str, StructuredInputDefinition] @@ -18231,42 +18566,45 @@ namespace azure.ai.projects.types class azure.ai.projects.types.PromptAgentDefinitionTextOptions(TypedDict, total=False): - key "format": ForwardRef('TextResponseFormat') + key "format": ForwardRef('TextResponseFormat', module='types') format: TextResponseFormat class azure.ai.projects.types.PromptBasedEvaluatorDefinition(TypedDict, total=False): - key "data_schema": dict[str, Any] - key "init_parameters": dict[str, Any] - key "metrics": dict[str, EvaluatorMetric] + key "prompt_text": Required[str] + key "type": Required[Literal[EvaluatorDefinitionType.PROMPT]] data_schema: dict[str, Any] init_parameters: dict[str, Any] metrics: dict[str, EvaluatorMetric] - prompt_text: Required[str] - type: Required[Literal[EvaluatorDefinitionType.PROMPT]] + prompt_text: str + type: Literal[EvaluatorDefinitionType.PROMPT] class azure.ai.projects.types.PromptDataGenerationJobSource(TypedDict, total=False): key "description": str + key "prompt": Required[str] + key "type": Required[Literal[DataGenerationJobSourceType.PROMPT]] description: str - prompt: Required[str] - type: Required[Literal[DataGenerationJobSourceType.PROMPT]] + prompt: str + type: Literal[DataGenerationJobSourceType.PROMPT] class azure.ai.projects.types.PromptEvaluatorGenerationJobSource(TypedDict, total=False): key "description": str + key "prompt": Required[str] + key "type": Required[Literal[EvaluatorGenerationJobSourceType.PROMPT]] description: str - prompt: Required[str] - type: Required[Literal[EvaluatorGenerationJobSourceType.PROMPT]] + prompt: str + type: Literal[EvaluatorGenerationJobSourceType.PROMPT] class azure.ai.projects.types.ProtocolConfiguration(TypedDict, total=False): - key "a2a": ForwardRef('A2AProtocolConfiguration') - key "activity": ForwardRef('ActivityProtocolConfiguration') - key "invocations": ForwardRef('InvocationsProtocolConfiguration') - key "invocations_ws": ForwardRef('InvocationsWsProtocolConfiguration') - key "mcp": ForwardRef('McpProtocolConfiguration') - key "responses": ForwardRef('ResponsesProtocolConfiguration') + key "a2a": ForwardRef('A2AProtocolConfiguration', module='types') + key "activity": ForwardRef('ActivityProtocolConfiguration', module='types') + key "invocations": ForwardRef('InvocationsProtocolConfiguration', module='types') + key "invocations_ws": ForwardRef('InvocationsWsProtocolConfiguration', module='types') + key "mcp": ForwardRef('McpProtocolConfiguration', module='types') + key "responses": ForwardRef('ResponsesProtocolConfiguration', module='types') a2a: A2AProtocolConfiguration activity: ActivityProtocolConfiguration invocations: InvocationsProtocolConfiguration @@ -18276,16 +18614,19 @@ namespace azure.ai.projects.types class azure.ai.projects.types.ProtocolVersionRecord(TypedDict, total=False): - protocol: Required[Union[str, AgentEndpointProtocol]] - version: Required[str] + key "protocol": Required[Union[str, AgentEndpointProtocol]] + key "version": Required[str] + protocol: Union[str, AgentEndpointProtocol] + version: str class azure.ai.projects.types.RaiConfig(TypedDict, total=False): - rai_policy_name: Required[str] + key "rai_policy_name": Required[str] + rai_policy_name: str class azure.ai.projects.types.RankingOptions(TypedDict, total=False): - key "hybrid_search": ForwardRef('HybridSearchOptions') + key "hybrid_search": ForwardRef('HybridSearchOptions', module='types') key "ranker": Union[str, RankerVersionType] key "score_threshold": float hybrid_search: HybridSearchOptions @@ -18295,16 +18636,19 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeAudioFormatsAudioPcm(TypedDict, total=False): key "rate": Literal[24000] + key "type": Required[Literal[RealtimeAudioFormatsType.AUDIO_PCM]] rate: Literal[24000] - type: Required[Literal[RealtimeAudioFormatsType.AUDIO_PCM]] + type: Literal[RealtimeAudioFormatsType.AUDIO_PCM] class azure.ai.projects.types.RealtimeAudioFormatsAudioPcma(TypedDict, total=False): - type: Required[Literal[RealtimeAudioFormatsType.AUDIO_PCMA]] + key "type": Required[Literal[RealtimeAudioFormatsType.AUDIO_PCMA]] + type: Literal[RealtimeAudioFormatsType.AUDIO_PCMA] class azure.ai.projects.types.RealtimeAudioFormatsAudioPcmu(TypedDict, total=False): - type: Required[Literal[RealtimeAudioFormatsType.AUDIO_PCMU]] + key "type": Required[Literal[RealtimeAudioFormatsType.AUDIO_PCMU]] + type: Literal[RealtimeAudioFormatsType.AUDIO_PCMU] class azure.ai.projects.types.RealtimeAudioFormatsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -18328,41 +18672,50 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeConversationItemFunctionCall(TypedDict, total=False): + key "arguments": Required[str] key "call_id": str key "id": str + key "name": Required[str] key "object": Literal["item"] key "status": Literal["completed", "incomplete", "in_progress"] - arguments: Required[str] + key "type": Required[Literal[RealtimeConversationItemType.FUNCTION_CALL]] + arguments: str call_id: str id: str - name: Required[str] + name: str object: Literal[item] status: Literal[completed, incomplete, in_progress] - type: Required[Literal[RealtimeConversationItemType.FUNCTION_CALL]] + type: Literal[RealtimeConversationItemType.FUNCTION_CALL] class azure.ai.projects.types.RealtimeConversationItemFunctionCallOutput(TypedDict, total=False): + key "call_id": Required[str] key "id": str key "object": Literal["item"] + key "output": Required[str] key "status": Literal["completed", "incomplete", "in_progress"] - call_id: Required[str] + key "type": Required[Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT]] + call_id: str id: str object: Literal[item] - output: Required[str] + output: str status: Literal[completed, incomplete, in_progress] - type: Required[Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT]] + type: Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT] class azure.ai.projects.types.RealtimeConversationItemMessageAssistant(TypedDict, total=False): + key "content": Required[list[RealtimeConversationItemMessageAssistantContent]] key "id": str key "object": Literal["item"] + key "role": Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] key "status": Literal["completed", "incomplete", "in_progress"] - content: Required[list[RealtimeConversationItemMessageAssistantContent]] + key "type": Required[Literal["message"]] + content: list[RealtimeConversationItemMessageAssistantContent] id: str object: Literal[item] - role: Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] + role: Literal[RealtimeConversationItemMessageType.ASSISTANT] status: Literal[completed, incomplete, in_progress] - type: Required[Literal["message"]] + type: Literal[message] class azure.ai.projects.types.RealtimeConversationItemMessageAssistantContent(TypedDict, total=False): @@ -18377,15 +18730,18 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeConversationItemMessageSystem(TypedDict, total=False): + key "content": Required[list[RealtimeConversationItemMessageSystemContent]] key "id": str key "object": Literal["item"] + key "role": Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] key "status": Literal["completed", "incomplete", "in_progress"] - content: Required[list[RealtimeConversationItemMessageSystemContent]] + key "type": Required[Literal["message"]] + content: list[RealtimeConversationItemMessageSystemContent] id: str object: Literal[item] - role: Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] + role: Literal[RealtimeConversationItemMessageType.SYSTEM] status: Literal[completed, incomplete, in_progress] - type: Required[Literal["message"]] + type: Literal[message] class azure.ai.projects.types.RealtimeConversationItemMessageSystemContent(TypedDict, total=False): @@ -18402,15 +18758,18 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeConversationItemMessageUser(TypedDict, total=False): + key "content": Required[list[RealtimeConversationItemMessageUserContent]] key "id": str key "object": Literal["item"] + key "role": Required[Literal[RealtimeConversationItemMessageType.USER]] key "status": Literal["completed", "incomplete", "in_progress"] - content: Required[list[RealtimeConversationItemMessageUserContent]] + key "type": Required[Literal["message"]] + content: list[RealtimeConversationItemMessageUserContent] id: str object: Literal[item] - role: Required[Literal[RealtimeConversationItemMessageType.USER]] + role: Literal[RealtimeConversationItemMessageType.USER] status: Literal[completed, incomplete, in_progress] - type: Required[Literal["message"]] + type: Literal[message] class azure.ai.projects.types.RealtimeConversationItemMessageUserContent(TypedDict, total=False): @@ -18440,7 +18799,7 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeFunctionTool(TypedDict, total=False): key "description": str key "name": str - key "parameters": ForwardRef('RealtimeFunctionToolParameters') + key "parameters": ForwardRef('RealtimeFunctionToolParameters', module='types') key "type": Literal["function"] description: str name: str @@ -18452,59 +18811,84 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeMCPApprovalRequest(TypedDict, total=False): - arguments: Required[str] - id: Required[str] - name: Required[str] - server_label: Required[str] - type: Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST]] + key "arguments": Required[str] + key "id": Required[str] + key "name": Required[str] + key "server_label": Required[str] + key "type": Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST]] + arguments: str + id: str + name: str + server_label: str + type: Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST] class azure.ai.projects.types.RealtimeMCPApprovalResponse(TypedDict, total=False): + key "approval_request_id": Required[str] + key "approve": Required[bool] + key "id": Required[str] key "reason": Optional[str] - approval_request_id: Required[str] - approve: Required[bool] - id: Required[str] + key "type": Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE]] + approval_request_id: str + approve: bool + id: str reason: str - type: Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE]] + type: Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE] class azure.ai.projects.types.RealtimeMCPHTTPError(TypedDict, total=False): - code: Required[int] - message: Required[str] - type: Required[Literal[RealtimeMcpErrorType.HTTP_ERROR]] + key "code": Required[int] + key "message": Required[str] + key "type": Required[Literal[RealtimeMcpErrorType.HTTP_ERROR]] + code: int + message: str + type: Literal[RealtimeMcpErrorType.HTTP_ERROR] class azure.ai.projects.types.RealtimeMCPListTools(TypedDict, total=False): key "id": str + key "server_label": Required[str] + key "tools": Required[list[MCPListToolsTool]] + key "type": Required[Literal[RealtimeConversationItemType.MCP_LIST_TOOLS]] id: str - server_label: Required[str] - tools: Required[list[MCPListToolsTool]] - type: Required[Literal[RealtimeConversationItemType.MCP_LIST_TOOLS]] + server_label: str + tools: list[MCPListToolsTool] + type: Literal[RealtimeConversationItemType.MCP_LIST_TOOLS] class azure.ai.projects.types.RealtimeMCPProtocolError(TypedDict, total=False): - code: Required[int] - message: Required[str] - type: Required[Literal[RealtimeMcpErrorType.PROTOCOL_ERROR]] + key "code": Required[int] + key "message": Required[str] + key "type": Required[Literal[RealtimeMcpErrorType.PROTOCOL_ERROR]] + code: int + message: str + type: Literal[RealtimeMcpErrorType.PROTOCOL_ERROR] class azure.ai.projects.types.RealtimeMCPToolCall(TypedDict, total=False): key "approval_request_id": Optional[str] - key "error": ForwardRef('RealtimeMCPError') + key "arguments": Required[str] + key "error": ForwardRef('RealtimeMCPError', module='types') + key "id": Required[str] + key "name": Required[str] key "output": Optional[str] + key "server_label": Required[str] + key "type": Required[Literal[RealtimeConversationItemType.MCP_CALL]] approval_request_id: str - arguments: Required[str] + arguments: str error: RealtimeMCPError - id: Required[str] - name: Required[str] + id: str + name: str output: str - server_label: Required[str] - type: Required[Literal[RealtimeConversationItemType.MCP_CALL]] + server_label: str + type: Literal[RealtimeConversationItemType.MCP_CALL] class azure.ai.projects.types.RealtimeMCPToolExecutionError(TypedDict, total=False): - message: Required[str] - type: Required[Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR]] + key "message": Required[str] + key "type": Required[Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR]] + message: str + type: Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR] class azure.ai.projects.types.RealtimeMcpErrorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -18519,7 +18903,7 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeResponseStatusDetails(TypedDict, total=False): - key "error": ForwardRef('RealtimeResponseStatusDetailsError') + key "error": ForwardRef('RealtimeResponseStatusDetailsError', module='types') key "reason": Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"] key "type": Literal["completed", "cancelled", "failed", "incomplete"] error: RealtimeResponseStatusDetailsError @@ -18535,9 +18919,9 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeResponseUsage(TypedDict, total=False): - key "input_token_details": ForwardRef('RealtimeResponseUsageInputTokenDetails') + key "input_token_details": ForwardRef('RealtimeResponseUsageInputTokenDetails', module='types') key "input_tokens": int - key "output_token_details": ForwardRef('RealtimeResponseUsageOutputTokenDetails') + key "output_token_details": ForwardRef('RealtimeResponseUsageOutputTokenDetails', module='types') key "output_tokens": int key "total_tokens": int input_token_details: RealtimeResponseUsageInputTokenDetails @@ -18550,7 +18934,7 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeResponseUsageInputTokenDetails(TypedDict, total=False): key "audio_tokens": int key "cached_tokens": int - key "cached_tokens_details": ForwardRef('RealtimeResponseUsageInputTokenDetailsCachedTokensDetails') + key "cached_tokens_details": ForwardRef('RealtimeResponseUsageInputTokenDetailsCachedTokensDetails', module='types') key "image_tokens": int key "text_tokens": int audio_tokens: int @@ -18577,13 +18961,20 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeServerEvent(TypedDict, total=False): - content_index: Required[int] - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - part: Required[RealtimeServerEventResponseContentPartAddedPart] - response_id: Required[str] - type: Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED]] + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "part": Required[RealtimeServerEventResponseContentPartAddedPart] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED]] + content_index: int + event_id: str + item_id: str + output_index: int + part: RealtimeServerEventResponseContentPartAddedPart + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED] class azure.ai.projects.types.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError(TypedDict, total=False): @@ -18598,20 +18989,25 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeServerEventError(TypedDict, total=False): - error: Required[RealtimeServerEventErrorError] - event_id: Required[str] - type: Required[Literal["error"]] + key "error": Required[RealtimeServerEventErrorError] + key "event_id": Required[str] + key "type": Required[Literal["error"]] + error: RealtimeServerEventErrorError + event_id: str + type: Literal[error] class azure.ai.projects.types.RealtimeServerEventErrorError(TypedDict, total=False): key "code": Optional[str] key "event_id": Optional[str] + key "message": Required[str] key "param": Optional[str] + key "type": Required[str] code: str event_id: str - message: Required[str] + message: str param: str - type: Required[str] + type: str class azure.ai.projects.types.RealtimeServerEventRateLimitsUpdatedRateLimits(TypedDict, total=False): @@ -18626,13 +19022,20 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeServerEventResponseContentPartAdded(TypedDict, total=False): - content_index: Required[int] - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - part: Required[RealtimeServerEventResponseContentPartAddedPart] - response_id: Required[str] - type: Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED]] + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "part": Required[RealtimeServerEventResponseContentPartAddedPart] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED]] + content_index: int + event_id: str + item_id: str + output_index: int + part: RealtimeServerEventResponseContentPartAddedPart + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED] class azure.ai.projects.types.RealtimeServerEventResponseContentPartAddedPart(TypedDict, total=False): @@ -18710,14 +19113,17 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RecurrenceTrigger(TypedDict, total=False): key "endTime": str + key "interval": Required[int] + key "schedule": Required[RecurrenceSchedule] key "startTime": str key "timeZone": str + key "type": Required[Literal[TriggerType.RECURRENCE]] endTime: str - interval: Required[int] - schedule: Required[RecurrenceSchedule] + interval: int + schedule: RecurrenceSchedule startTime: str timeZone: str - type: Required[Literal[TriggerType.RECURRENCE]] + type: Literal[TriggerType.RECURRENCE] class azure.ai.projects.types.RecurrenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -18729,40 +19135,40 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RedTeam(TypedDict, total=False): key "applicationScenario": str - key "attackStrategies": list[Union[str, AttackStrategy]] key "displayName": str + key "id": Required[str] key "numTurns": int - key "properties": dict[str, str] - key "riskCategories": list[Union[str, RiskCategory]] key "simulationOnly": bool key "status": str - key "tags": dict[str, str] + key "target": Required[RedTeamTargetConfig] applicationScenario: str attackStrategies: list[Union[str, AttackStrategy]] displayName: str - id: Required[str] + id: str numTurns: int properties: dict[str, str] riskCategories: list[Union[str, RiskCategory]] simulationOnly: bool status: str tags: dict[str, str] - target: Required[RedTeamTargetConfig] + target: RedTeamTargetConfig class azure.ai.projects.types.RedTeamTargetConfig(TypedDict, total=False): - modelDeploymentName: Required[str] - type: Required[Literal["AzureOpenAIModel"]] + key "modelDeploymentName": Required[str] + key "type": Required[Literal["AzureOpenAIModel"]] + modelDeploymentName: str + type: Literal[AzureOpenAIModel] class azure.ai.projects.types.ReminderPreviewToolboxTool(TypedDict, total=False): key "description": str key "name": str - key "tool_configs": dict[str, ToolConfig] + key "type": Required[Literal[ToolboxToolType.REMINDER_PREVIEW]] description: str name: str tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolboxToolType.REMINDER_PREVIEW]] + type: Literal[ToolboxToolType.REMINDER_PREVIEW] class azure.ai.projects.types.ResponsesProtocolConfiguration(TypedDict, total=False): @@ -18786,24 +19192,27 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RubricBasedEvaluatorDefinition(TypedDict, total=False): - key "data_schema": dict[str, Any] - key "init_parameters": dict[str, Any] - key "metrics": dict[str, EvaluatorMetric] + key "dimensions": Required[list[Dimension]] key "pass_threshold": float + key "type": Required[Literal[EvaluatorDefinitionType.RUBRIC]] data_schema: dict[str, Any] - dimensions: Required[list[Dimension]] + dimensions: list[Dimension] init_parameters: dict[str, Any] metrics: dict[str, EvaluatorMetric] pass_threshold: float - type: Required[Literal[EvaluatorDefinitionType.RUBRIC]] + type: Literal[EvaluatorDefinitionType.RUBRIC] class azure.ai.projects.types.RubricGenerationInputQualityWarning(TypedDict, total=False): + key "code": Required[Union[str, RubricGenerationInputQualityWarningCode]] + key "message": Required[str] + key "severity": Required[Union[str, RubricGenerationInputQualityWarningSeverity]] + key "source": Required[Union[str, RubricGenerationInputQualityWarningSource]] key "source_index": int - code: Required[Union[str, RubricGenerationInputQualityWarningCode]] - message: Required[str] - severity: Required[Union[str, RubricGenerationInputQualityWarningSeverity]] - source: Required[Union[str, RubricGenerationInputQualityWarningSource]] + code: Union[str, RubricGenerationInputQualityWarningCode] + message: str + severity: Union[str, RubricGenerationInputQualityWarningSeverity] + source: Union[str, RubricGenerationInputQualityWarningSource] source_index: int @@ -18814,25 +19223,31 @@ namespace azure.ai.projects.types class azure.ai.projects.types.Schedule(TypedDict, total=False): key "description": str key "displayName": str - key "properties": dict[str, str] + key "enabled": Required[bool] + key "id": Required[str] key "provisioningStatus": Union[str, ScheduleProvisioningStatus] - key "tags": dict[str, str] + key "systemData": Required[dict[str, str]] + key "task": Required[ScheduleTask] + key "trigger": Required[Trigger] description: str displayName: str - enabled: Required[bool] - id: Required[str] + enabled: bool + id: str properties: dict[str, str] provisioningStatus: Union[str, ScheduleProvisioningStatus] - systemData: Required[dict[str, str]] + systemData: dict[str, str] tags: dict[str, str] - task: Required[ScheduleTask] - trigger: Required[Trigger] + task: ScheduleTask + trigger: Trigger class azure.ai.projects.types.ScheduleRoutineTrigger(TypedDict, total=False): - cron_expression: Required[str] - time_zone: Required[str] - type: Required[Literal[RoutineTriggerType.SCHEDULE]] + key "cron_expression": Required[str] + key "time_zone": Required[str] + key "type": Required[Literal[RoutineTriggerType.SCHEDULE]] + cron_expression: str + time_zone: str + type: Literal[RoutineTriggerType.SCHEDULE] class azure.ai.projects.types.ScheduleTaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -18841,73 +19256,79 @@ namespace azure.ai.projects.types class azure.ai.projects.types.SearchMemoriesRequest(TypedDict, total=False): - key "items": list[dict[str, Any]] - key "options": ForwardRef('MemorySearchOptions') + key "options": ForwardRef('MemorySearchOptions', module='types') key "previous_search_id": str + key "scope": Required[str] items: list[dict[str, Any]] options: MemorySearchOptions previous_search_id: str - scope: Required[str] + scope: str class azure.ai.projects.types.SharepointGroundingToolParameters(TypedDict, total=False): - key "project_connections": list[ToolProjectConnection] project_connections: list[ToolProjectConnection] class azure.ai.projects.types.SharepointPreviewTool(TypedDict, total=False): - sharepoint_grounding_preview: Required[SharepointGroundingToolParameters] - type: Required[Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW]] + key "sharepoint_grounding_preview": Required[SharepointGroundingToolParameters] + key "type": Required[Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW]] + sharepoint_grounding_preview: SharepointGroundingToolParameters + type: Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW] class azure.ai.projects.types.SimpleQnADataGenerationJobOptions(TypedDict, total=False): - key "model_options": ForwardRef('DataGenerationModelOptions') - key "question_types": list[Union[str, SimpleQnAFineTuningQuestionType]] + key "max_samples": Required[int] + key "model_options": ForwardRef('DataGenerationModelOptions', module='types') key "train_split": float - max_samples: Required[int] + key "type": Required[Literal[DataGenerationJobType.SIMPLE_QNA]] + max_samples: int model_options: DataGenerationModelOptions question_types: list[Union[str, SimpleQnAFineTuningQuestionType]] train_split: float - type: Required[Literal[DataGenerationJobType.SIMPLE_QNA]] + type: Literal[DataGenerationJobType.SIMPLE_QNA] class azure.ai.projects.types.SkillInlineContent(TypedDict, total=False): - key "allowed_tools": list[str] key "compatibility": str + key "description": Required[str] + key "instructions": Required[str] key "license": str - key "metadata": dict[str, str] allowed_tools: list[str] compatibility: str - description: Required[str] - instructions: Required[str] + description: str + instructions: str license: str metadata: dict[str, str] class azure.ai.projects.types.SkillReferenceParam(TypedDict, total=False): + key "skill_id": Required[str] + key "type": Required[Literal[ContainerSkillType.SKILL_REFERENCE]] key "version": str - skill_id: Required[str] - type: Required[Literal[ContainerSkillType.SKILL_REFERENCE]] + skill_id: str + type: Literal[ContainerSkillType.SKILL_REFERENCE] version: str class azure.ai.projects.types.SpecificApplyPatchParam(TypedDict, total=False): - type: Required[Literal[ToolChoiceParamType.APPLY_PATCH]] + key "type": Required[Literal[ToolChoiceParamType.APPLY_PATCH]] + type: Literal[ToolChoiceParamType.APPLY_PATCH] class azure.ai.projects.types.SpecificFunctionShellParam(TypedDict, total=False): - type: Required[Literal[ToolChoiceParamType.SHELL]] + key "type": Required[Literal[ToolChoiceParamType.SHELL]] + type: Literal[ToolChoiceParamType.SHELL] class azure.ai.projects.types.SpecificProgrammaticToolCallingParam(TypedDict, total=False): - type: Required[Literal[ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING]] + key "type": Required[Literal[ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING]] + type: Literal[ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING] class azure.ai.projects.types.StructuredInputDefinition(TypedDict, total=False): key "default_value": Any key "description": str key "required": bool - key "schema": dict[str, Any] default_value: Any description: str required: bool @@ -18915,60 +19336,80 @@ namespace azure.ai.projects.types class azure.ai.projects.types.StructuredOutputDefinition(TypedDict, total=False): - description: Required[str] - name: Required[str] - schema: Required[dict[str, Any]] - strict: Required[Optional[bool]] + key "description": Required[str] + key "name": Required[str] + key "schema": Required[dict[str, Any]] + key "strict": Required[Optional[bool]] + description: str + name: str + schema: dict[str, Any] + strict: bool class azure.ai.projects.types.TaskGenerationDataGenerationJobOptions(TypedDict, total=False): - key "model_options": ForwardRef('DataGenerationModelOptions') + key "max_samples": Required[int] + key "model_options": ForwardRef('DataGenerationModelOptions', module='types') key "train_split": float - max_samples: Required[int] + key "type": Required[Literal[DataGenerationJobType.TASK_GENERATION]] + max_samples: int model_options: DataGenerationModelOptions train_split: float - type: Required[Literal[DataGenerationJobType.TASK_GENERATION]] + type: Literal[DataGenerationJobType.TASK_GENERATION] class azure.ai.projects.types.TaxonomyCategory(TypedDict, total=False): key "description": str - key "properties": dict[str, str] + key "id": Required[str] + key "name": Required[str] + key "riskCategory": Required[Union[str, RiskCategory]] + key "subCategories": Required[list[TaxonomySubCategory]] description: str - id: Required[str] - name: Required[str] + id: str + name: str properties: dict[str, str] - riskCategory: Required[Union[str, RiskCategory]] - subCategories: Required[list[TaxonomySubCategory]] + riskCategory: Union[str, RiskCategory] + subCategories: list[TaxonomySubCategory] class azure.ai.projects.types.TaxonomySubCategory(TypedDict, total=False): key "description": str - key "properties": dict[str, str] + key "enabled": Required[bool] + key "id": Required[str] + key "name": Required[str] description: str - enabled: Required[bool] - id: Required[str] - name: Required[str] + enabled: bool + id: str + name: str properties: dict[str, str] class azure.ai.projects.types.TelemetryConfig(TypedDict, total=False): - endpoints: Required[list[TelemetryEndpoint]] + key "endpoints": Required[list[TelemetryEndpoint]] + endpoints: list[TelemetryEndpoint] class azure.ai.projects.types.TelemetryEndpoint(TypedDict, total=False): - key "auth": ForwardRef('TelemetryEndpointAuth') + key "auth": ForwardRef('TelemetryEndpointAuth', module='types') + key "data": Required[list[Union[str, TelemetryDataKind]]] + key "endpoint": Required[str] + key "kind": Required[Literal[TelemetryEndpointKind.OTLP]] + key "protocol": Required[Union[str, TelemetryTransportProtocol]] auth: TelemetryEndpointAuth - data: Required[list[Union[str, TelemetryDataKind]]] - endpoint: Required[str] - kind: Required[Literal[TelemetryEndpointKind.OTLP]] - protocol: Required[Union[str, TelemetryTransportProtocol]] + data: list[Union[str, TelemetryDataKind]] + endpoint: str + kind: Literal[TelemetryEndpointKind.OTLP] + protocol: Union[str, TelemetryTransportProtocol] class azure.ai.projects.types.TelemetryEndpointAuth(TypedDict, total=False): - header_name: Required[str] - secret_id: Required[str] - secret_key: Required[str] - type: Required[Literal[TelemetryEndpointAuthType.HEADER]] + key "header_name": Required[str] + key "secret_id": Required[str] + key "secret_key": Required[str] + key "type": Required[Literal[TelemetryEndpointAuthType.HEADER]] + header_name: str + secret_id: str + secret_key: str + type: Literal[TelemetryEndpointAuthType.HEADER] class azure.ai.projects.types.TelemetryEndpointAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -18980,8 +19421,10 @@ namespace azure.ai.projects.types class azure.ai.projects.types.TemplateVoiceGreetingConfig(TypedDict, total=False): - text: Required[str] - type: Required[Literal["template"]] + key "text": Required[str] + key "type": Required[Literal["template"]] + text: str + type: Literal[template] class azure.ai.projects.types.TextResponseFormatConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -18991,74 +19434,95 @@ namespace azure.ai.projects.types class azure.ai.projects.types.TextResponseFormatJsonObject(TypedDict, total=False): - type: Required[Literal[TextResponseFormatConfigurationType.JSON_OBJECT]] + key "type": Required[Literal[TextResponseFormatConfigurationType.JSON_OBJECT]] + type: Literal[TextResponseFormatConfigurationType.JSON_OBJECT] class azure.ai.projects.types.TextResponseFormatJsonSchema(TypedDict, total=False): key "description": str + key "name": Required[str] + key "schema": Required[dict[str, Any]] key "strict": Optional[bool] + key "type": Required[Literal[TextResponseFormatConfigurationType.JSON_SCHEMA]] description: str - name: Required[str] - schema: Required[dict[str, Any]] + name: str + schema: dict[str, Any] strict: bool - type: Required[Literal[TextResponseFormatConfigurationType.JSON_SCHEMA]] + type: Literal[TextResponseFormatConfigurationType.JSON_SCHEMA] class azure.ai.projects.types.TextResponseFormatText(TypedDict, total=False): - type: Required[Literal[TextResponseFormatConfigurationType.TEXT]] + key "type": Required[Literal[TextResponseFormatConfigurationType.TEXT]] + type: Literal[TextResponseFormatConfigurationType.TEXT] class azure.ai.projects.types.TimerRoutineTrigger(TypedDict, total=False): key "at": int + key "type": Required[Literal[RoutineTriggerType.TIMER]] at: int - type: Required[Literal[RoutineTriggerType.TIMER]] + type: Literal[RoutineTriggerType.TIMER] class azure.ai.projects.types.ToolChoiceAllowed(TypedDict, total=False): - mode: Required[Literal["auto", "required"]] - tools: Required[list[dict[str, Any]]] - type: Required[Literal[ToolChoiceParamType.ALLOWED_TOOLS]] + key "mode": Required[Literal["auto", "required"]] + key "tools": Required[list[dict[str, Any]]] + key "type": Required[Literal[ToolChoiceParamType.ALLOWED_TOOLS]] + mode: Literal[auto, required] + tools: list[dict[str, Any]] + type: Literal[ToolChoiceParamType.ALLOWED_TOOLS] class azure.ai.projects.types.ToolChoiceCodeInterpreter(TypedDict, total=False): - type: Required[Literal[ToolChoiceParamType.CODE_INTERPRETER]] + key "type": Required[Literal[ToolChoiceParamType.CODE_INTERPRETER]] + type: Literal[ToolChoiceParamType.CODE_INTERPRETER] class azure.ai.projects.types.ToolChoiceComputer(TypedDict, total=False): - type: Required[Literal[ToolChoiceParamType.COMPUTER]] + key "type": Required[Literal[ToolChoiceParamType.COMPUTER]] + type: Literal[ToolChoiceParamType.COMPUTER] class azure.ai.projects.types.ToolChoiceComputerUse(TypedDict, total=False): - type: Required[Literal[ToolChoiceParamType.COMPUTER_USE]] + key "type": Required[Literal[ToolChoiceParamType.COMPUTER_USE]] + type: Literal[ToolChoiceParamType.COMPUTER_USE] class azure.ai.projects.types.ToolChoiceComputerUsePreview(TypedDict, total=False): - type: Required[Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW]] + key "type": Required[Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW]] + type: Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW] class azure.ai.projects.types.ToolChoiceCustom(TypedDict, total=False): - name: Required[str] - type: Required[Literal[ToolChoiceParamType.CUSTOM]] + key "name": Required[str] + key "type": Required[Literal[ToolChoiceParamType.CUSTOM]] + name: str + type: Literal[ToolChoiceParamType.CUSTOM] class azure.ai.projects.types.ToolChoiceFileSearch(TypedDict, total=False): - type: Required[Literal[ToolChoiceParamType.FILE_SEARCH]] + key "type": Required[Literal[ToolChoiceParamType.FILE_SEARCH]] + type: Literal[ToolChoiceParamType.FILE_SEARCH] class azure.ai.projects.types.ToolChoiceFunction(TypedDict, total=False): - name: Required[str] - type: Required[Literal[ToolChoiceParamType.FUNCTION]] + key "name": Required[str] + key "type": Required[Literal[ToolChoiceParamType.FUNCTION]] + name: str + type: Literal[ToolChoiceParamType.FUNCTION] class azure.ai.projects.types.ToolChoiceImageGeneration(TypedDict, total=False): - type: Required[Literal[ToolChoiceParamType.IMAGE_GENERATION]] + key "type": Required[Literal[ToolChoiceParamType.IMAGE_GENERATION]] + type: Literal[ToolChoiceParamType.IMAGE_GENERATION] class azure.ai.projects.types.ToolChoiceMCP(TypedDict, total=False): key "name": Optional[str] + key "server_label": Required[str] + key "type": Required[Literal[ToolChoiceParamType.MCP]] name: str - server_label: Required[str] - type: Required[Literal[ToolChoiceParamType.MCP]] + server_label: str + type: Literal[ToolChoiceParamType.MCP] class azure.ai.projects.types.ToolChoiceParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -19080,11 +19544,13 @@ namespace azure.ai.projects.types class azure.ai.projects.types.ToolChoiceWebSearchPreview(TypedDict, total=False): - type: Required[Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW]] + key "type": Required[Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW]] + type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW] class azure.ai.projects.types.ToolChoiceWebSearchPreview20250311(TypedDict, total=False): - type: Required[Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11]] + key "type": Required[Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11]] + type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11] class azure.ai.projects.types.ToolConfig(TypedDict, total=False): @@ -19102,27 +19568,29 @@ namespace azure.ai.projects.types class azure.ai.projects.types.ToolProjectConnection(TypedDict, total=False): - project_connection_id: Required[str] + key "project_connection_id": Required[str] + project_connection_id: str class azure.ai.projects.types.ToolSearchToolParam(TypedDict, total=False): key "description": Optional[str] key "execution": Union[str, ToolSearchExecutionType] key "parameters": Optional[EmptyModelParam] + key "type": Required[Literal[ToolType.TOOL_SEARCH]] description: str execution: Union[str, ToolSearchExecutionType] parameters: EmptyModelParam - type: Required[Literal[ToolType.TOOL_SEARCH]] + type: Literal[ToolType.TOOL_SEARCH] class azure.ai.projects.types.ToolSearchToolboxTool(TypedDict, total=False): key "description": str key "name": str - key "tool_configs": dict[str, ToolConfig] + key "type": Required[Literal[ToolboxToolType.TOOLBOX_SEARCH]] description: str name: str tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolboxToolType.TOOLBOX_SEARCH]] + type: Literal[ToolboxToolType.TOOLBOX_SEARCH] class azure.ai.projects.types.ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -19159,40 +19627,46 @@ namespace azure.ai.projects.types class azure.ai.projects.types.ToolUseFineTuningDataGenerationJobOptions(TypedDict, total=False): - key "model_options": ForwardRef('DataGenerationModelOptions') + key "max_samples": Required[int] + key "model_options": ForwardRef('DataGenerationModelOptions', module='types') key "train_split": float - max_samples: Required[int] + key "type": Required[Literal[DataGenerationJobType.TOOL_USE]] + max_samples: int model_options: DataGenerationModelOptions train_split: float - type: Required[Literal[DataGenerationJobType.TOOL_USE]] + type: Literal[DataGenerationJobType.TOOL_USE] class azure.ai.projects.types.ToolboxPolicies(TypedDict, total=False): - key "rai_config": ForwardRef('RaiConfig') + key "rai_config": ForwardRef('RaiConfig', module='types') rai_config: RaiConfig class azure.ai.projects.types.ToolboxSearchPreviewToolboxTool(TypedDict, total=False): key "description": str key "name": str - key "tool_configs": dict[str, ToolConfig] + key "type": Required[Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW]] description: str name: str tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW]] + type: Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW] class azure.ai.projects.types.ToolboxSkill(TypedDict, total=False): + key "name": Required[str] + key "type": Required[Literal["skill_reference"]] key "version": str - name: Required[str] - type: Required[Literal["skill_reference"]] + name: str + type: Literal[skill_reference] version: str class azure.ai.projects.types.ToolboxSkillReference(TypedDict, total=False): + key "name": Required[str] + key "type": Required[Literal["skill_reference"]] key "version": str - name: Required[str] - type: Required[Literal["skill_reference"]] + name: str + type: Literal[skill_reference] version: str @@ -19213,12 +19687,14 @@ namespace azure.ai.projects.types class azure.ai.projects.types.TracesDataGenerationJobOptions(TypedDict, total=False): - key "model_options": ForwardRef('DataGenerationModelOptions') + key "max_samples": Required[int] + key "model_options": ForwardRef('DataGenerationModelOptions', module='types') key "train_split": float - max_samples: Required[int] + key "type": Required[Literal[DataGenerationJobType.TRACES]] + max_samples: int model_options: DataGenerationModelOptions train_split: float - type: Required[Literal[DataGenerationJobType.TRACES]] + type: Literal[DataGenerationJobType.TRACES] class azure.ai.projects.types.TracesDataGenerationJobSource(TypedDict, total=False): @@ -19227,13 +19703,15 @@ namespace azure.ai.projects.types key "agent_version": str key "description": str key "end_time": int + key "start_time": Required[int] + key "type": Required[Literal[DataGenerationJobSourceType.TRACES]] agent_id: str agent_name: str agent_version: str description: str end_time: int - start_time: Required[int] - type: Required[Literal[DataGenerationJobSourceType.TRACES]] + start_time: int + type: Literal[DataGenerationJobSourceType.TRACES] class azure.ai.projects.types.TracesEvaluatorGenerationJobSource(TypedDict, total=False): @@ -19242,27 +19720,35 @@ namespace azure.ai.projects.types key "agent_version": str key "description": str key "end_time": int + key "start_time": Required[int] + key "type": Required[Literal[EvaluatorGenerationJobSourceType.TRACES]] agent_id: str agent_name: str agent_version: str description: str end_time: int - start_time: Required[int] - type: Required[Literal[EvaluatorGenerationJobSourceType.TRACES]] + start_time: int + type: Literal[EvaluatorGenerationJobSourceType.TRACES] class azure.ai.projects.types.TranscriptTextUsageDuration(TypedDict, total=False): - seconds: Required[str] - type: Required[Literal[CreateTranscriptionResponseJsonUsageType.DURATION]] + key "seconds": Required[str] + key "type": Required[Literal[CreateTranscriptionResponseJsonUsageType.DURATION]] + seconds: str + type: Literal[CreateTranscriptionResponseJsonUsageType.DURATION] class azure.ai.projects.types.TranscriptTextUsageTokens(TypedDict, total=False): - key "input_token_details": ForwardRef('TranscriptTextUsageTokensInputTokenDetails') + key "input_token_details": ForwardRef('TranscriptTextUsageTokensInputTokenDetails', module='types') + key "input_tokens": Required[int] + key "output_tokens": Required[int] + key "total_tokens": Required[int] + key "type": Required[Literal[CreateTranscriptionResponseJsonUsageType.TOKENS]] input_token_details: TranscriptTextUsageTokensInputTokenDetails - input_tokens: Required[int] - output_tokens: Required[int] - total_tokens: Required[int] - type: Required[Literal[CreateTranscriptionResponseJsonUsageType.TOKENS]] + input_tokens: int + output_tokens: int + total_tokens: int + type: Literal[CreateTranscriptionResponseJsonUsageType.TOKENS] class azure.ai.projects.types.TranscriptTextUsageTokensInputTokenDetails(TypedDict, total=False): @@ -19279,48 +19765,52 @@ namespace azure.ai.projects.types class azure.ai.projects.types.UpdateMemoriesRequest(TypedDict, total=False): - key "items": list[dict[str, Any]] key "previous_update_id": str + key "scope": Required[str] key "update_delay": int items: list[dict[str, Any]] previous_update_id: str - scope: Required[str] + scope: str update_delay: int class azure.ai.projects.types.UpdateMemoryRequest(TypedDict, total=False): - content: Required[str] + key "content": Required[str] + content: str class azure.ai.projects.types.UpdateMemoryStoreRequest(TypedDict, total=False): key "description": str - key "metadata": dict[str, str] description: str metadata: dict[str, str] class azure.ai.projects.types.UpdateModelVersionRequest(TypedDict, total=False): key "description": str - key "tags": dict[str, str] description: str tags: dict[str, str] class azure.ai.projects.types.UpdateSkillRequest(TypedDict, total=False): - default_version: Required[str] + key "default_version": Required[str] + default_version: str class azure.ai.projects.types.UpdateToolboxRequest(TypedDict, total=False): - default_version: Required[str] + key "default_version": Required[str] + default_version: str class azure.ai.projects.types.UpdateToolboxRequest1(TypedDict, total=False): - default_version: Required[str] + key "default_version": Required[str] + default_version: str class azure.ai.projects.types.VersionIndicator(TypedDict, total=False): - agent_version: Required[str] - type: Required[Literal[VersionIndicatorType.VERSION_REF]] + key "agent_version": Required[str] + key "type": Required[Literal[VersionIndicatorType.VERSION_REF]] + agent_version: str + type: Literal[VersionIndicatorType.VERSION_REF] class azure.ai.projects.types.VersionIndicatorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -19328,18 +19818,24 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VersionRefIndicator(TypedDict, total=False): - agent_version: Required[str] - type: Required[Literal[VersionIndicatorType.VERSION_REF]] + key "agent_version": Required[str] + key "type": Required[Literal[VersionIndicatorType.VERSION_REF]] + agent_version: str + type: Literal[VersionIndicatorType.VERSION_REF] class azure.ai.projects.types.VersionSelectionRule(TypedDict, total=False): - agent_version: Required[str] - traffic_percentage: Required[int] - type: Required[Literal[VersionSelectorType.FIXED_RATIO]] + key "agent_version": Required[str] + key "traffic_percentage": Required[int] + key "type": Required[Literal[VersionSelectorType.FIXED_RATIO]] + agent_version: str + traffic_percentage: int + type: Literal[VersionSelectorType.FIXED_RATIO] class azure.ai.projects.types.VersionSelector(TypedDict, total=False): - version_selection_rules: Required[list[VersionSelectionRule]] + key "version_selection_rules": Required[list[VersionSelectionRule]] + version_selection_rules: list[VersionSelectionRule] class azure.ai.projects.types.VersionSelectorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -19348,16 +19844,16 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceAgentAnimationConfig(TypedDict, total=False): key "model_name": str - key "outputs": list[Union[str, VoiceAgentAnimationOutputType]] model_name: str outputs: list[Union[str, VoiceAgentAnimationOutputType]] class azure.ai.projects.types.VoiceAgentAvatarIceServer(TypedDict, total=False): key "credential": Optional[str] + key "urls": Required[list[str]] key "username": Optional[str] credential: str - urls: Required[list[str]] + urls: list[str] username: str @@ -19386,17 +19882,19 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceAgentAvatarVideoCrop(TypedDict, total=False): - bottom_right: Required[list[int]] - top_left: Required[list[int]] + key "bottom_right": Required[list[int]] + key "top_left": Required[list[int]] + bottom_right: list[int] + top_left: list[int] class azure.ai.projects.types.VoiceAgentAvatarVideoParams(TypedDict, total=False): - key "background": ForwardRef('VoiceAgentAvatarVideoBackground') + key "background": ForwardRef('VoiceAgentAvatarVideoBackground', module='types') key "bitrate": int key "codec": Literal["h264"] - key "crop": ForwardRef('VoiceAgentAvatarVideoCrop') + key "crop": ForwardRef('VoiceAgentAvatarVideoCrop', module='types') key "gop_size": int - key "resolution": ForwardRef('VoiceAgentAvatarVideoResolution') + key "resolution": ForwardRef('VoiceAgentAvatarVideoResolution', module='types') background: VoiceAgentAvatarVideoBackground bitrate: int codec: Literal[h264] @@ -19406,122 +19904,144 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceAgentAvatarVideoResolution(TypedDict, total=False): - height: Required[int] - width: Required[int] + key "height": Required[int] + key "width": Required[int] + height: int + width: int class azure.ai.projects.types.VoiceAgentClientEventConversationItemCreate(TypedDict, total=False): key "event_id": str + key "item": Required[VoiceAgentCreateConversationItem] key "previous_item_id": str + key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE]] event_id: str - item: Required[VoiceAgentCreateConversationItem] + item: VoiceAgentCreateConversationItem previous_item_id: str - type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE]] + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE] class azure.ai.projects.types.VoiceAgentClientEventConversationItemDelete(TypedDict, total=False): key "event_id": str + key "item_id": Required[str] + key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE]] event_id: str - item_id: Required[str] - type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE]] + item_id: str + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE] class azure.ai.projects.types.VoiceAgentClientEventConversationItemRetrieve(TypedDict, total=False): key "event_id": str + key "item_id": Required[str] + key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE]] event_id: str - item_id: Required[str] - type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE]] + item_id: str + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE] class azure.ai.projects.types.VoiceAgentClientEventConversationItemTruncate(TypedDict, total=False): + key "audio_end_ms": Required[int] + key "content_index": Required[int] key "event_id": str - audio_end_ms: Required[int] - content_index: Required[int] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE]] + audio_end_ms: int + content_index: int event_id: str - item_id: Required[str] - type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE]] + item_id: str + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE] class azure.ai.projects.types.VoiceAgentClientEventInputAudioBufferAppend(TypedDict, total=False): + key "audio": Required[str] key "event_id": str - audio: Required[str] + key "type": Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND]] + audio: str event_id: str - type: Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND]] + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND] class azure.ai.projects.types.VoiceAgentClientEventInputAudioBufferClear(TypedDict, total=False): key "event_id": str + key "type": Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR]] event_id: str - type: Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR]] + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR] class azure.ai.projects.types.VoiceAgentClientEventInputAudioBufferCommit(TypedDict, total=False): key "event_id": str + key "type": Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT]] event_id: str - type: Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT]] + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT] class azure.ai.projects.types.VoiceAgentClientEventOutputAudioBufferClear(TypedDict, total=False): key "event_id": str + key "type": Required[Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR]] event_id: str - type: Required[Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR]] + type: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR] class azure.ai.projects.types.VoiceAgentClientEventResponseCancel(TypedDict, total=False): key "event_id": str key "response_id": str + key "type": Required[Literal[RealtimeClientEventType.RESPONSE_CANCEL]] event_id: str response_id: str - type: Required[Literal[RealtimeClientEventType.RESPONSE_CANCEL]] + type: Literal[RealtimeClientEventType.RESPONSE_CANCEL] class azure.ai.projects.types.VoiceAgentClientEventResponseCreate(TypedDict, total=False): key "event_id": str - key "response": ForwardRef('VoiceAgentResponseCreateParams') + key "response": ForwardRef('VoiceAgentResponseCreateParams', module='types') + key "type": Required[Literal[RealtimeClientEventType.RESPONSE_CREATE]] event_id: str response: VoiceAgentResponseCreateParams - type: Required[Literal[RealtimeClientEventType.RESPONSE_CREATE]] + type: Literal[RealtimeClientEventType.RESPONSE_CREATE] class azure.ai.projects.types.VoiceAgentClientEventSessionAvatarConnect(TypedDict, total=False): + key "client_sdp": Required[str] key "event_id": str - client_sdp: Required[str] + key "type": Required[Literal["connect"]] + client_sdp: str event_id: str - type: Required[Literal["connect"]] + type: Literal[connect] class azure.ai.projects.types.VoiceAgentClientEventSessionUpdate(TypedDict, total=False): key "event_id": str + key "session": Required[VoiceAgentSessionUpdateConfig] + key "type": Required[Literal[RealtimeClientEventType.SESSION_UPDATE]] event_id: str - session: Required[VoiceAgentSessionUpdateConfig] - type: Required[Literal[RealtimeClientEventType.SESSION_UPDATE]] + session: VoiceAgentSessionUpdateConfig + type: Literal[RealtimeClientEventType.SESSION_UPDATE] class azure.ai.projects.types.VoiceAgentDefinition(TypedDict, total=False): - key "audio": ForwardRef('VoiceAudioConfig') - key "avatar": ForwardRef('VoiceAvatarConfig') - key "greeting": ForwardRef('VoiceGreetingConfig') - key "include": list[Union[str, VoiceAgentSessionIncludeOption]] + key "audio": ForwardRef('VoiceAudioConfig', module='types') + key "avatar": ForwardRef('VoiceAvatarConfig', module='types') + key "greeting": ForwardRef('VoiceGreetingConfig', module='types') key "instructions": str - key "interim_response": ForwardRef('VoiceAgentInterimResponse') - key "max_output_tokens": ForwardRef('VoiceAgentMaxOutputTokens') - key "output_modalities": list[Union[str, VoiceOutputModality]] + key "interim_response": ForwardRef('VoiceAgentInterimResponse', module='types') + key "kind": Required[Literal[AgentKind.VOICE]] + key "max_output_tokens": ForwardRef('VoiceAgentMaxOutputTokens', module='types') + key "model": Required[str] + key "model_type": Required[Union[str, VoiceModelType]] key "parallel_tool_calls": bool - key "rai_config": ForwardRef('RaiConfig') + key "rai_config": ForwardRef('RaiConfig', module='types') key "store": bool - key "structured_inputs": dict[str, StructuredInputDefinition] - key "tool_choice": ForwardRef('VoiceAgentToolChoice') - key "tools": list[VoiceAgentTool] + key "tool_choice": ForwardRef('VoiceAgentToolChoice', module='types') audio: VoiceAudioConfig avatar: VoiceAvatarConfig greeting: VoiceGreetingConfig include: list[Union[str, VoiceAgentSessionIncludeOption]] instructions: str interim_response: VoiceAgentInterimResponse - kind: Required[Literal[AgentKind.VOICE]] + kind: Literal[AgentKind.VOICE] max_output_tokens: VoiceAgentMaxOutputTokens - model: Required[str] - model_type: Required[Union[str, VoiceModelType]] + model: str + model_type: Union[str, VoiceModelType] output_modalities: list[Union[str, VoiceOutputModality]] parallel_tool_calls: bool rai_config: RaiConfig @@ -19534,18 +20054,21 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceAgentEchoCancellation(TypedDict, total=False): key "channels": int key "reference_source": Union[str, VoiceAgentEchoCancellationReferenceSource] + key "type": Required[Literal["server_echo_cancellation"]] channels: int reference_source: Union[str, VoiceAgentEchoCancellationReferenceSource] - type: Required[Literal["server_echo_cancellation"]] + type: Literal[server_echo_cancellation] class azure.ai.projects.types.VoiceAgentFunctionTool(TypedDict, total=False): key "description": str - key "parameters": ForwardRef('RealtimeFunctionToolParameters') + key "name": Required[str] + key "parameters": ForwardRef('RealtimeFunctionToolParameters', module='types') + key "type": Required[Literal["function"]] description: str - name: Required[str] + name: str parameters: RealtimeFunctionToolParameters - type: Required[Literal["function"]] + type: Literal[function] class azure.ai.projects.types.VoiceAgentLlmInterimResponseConfig(TypedDict, total=False): @@ -19553,13 +20076,13 @@ namespace azure.ai.projects.types key "latency_threshold_ms": int key "max_completion_tokens": int key "model": str - key "triggers": list[Union[str, VoiceAgentInterimResponseTrigger]] + key "type": Required[Literal["llm_interim_response"]] instructions: str latency_threshold_ms: int max_completion_tokens: int model: str triggers: list[Union[str, VoiceAgentInterimResponseTrigger]] - type: Required[Literal["llm_interim_response"]] + type: Literal[llm_interim_response] class azure.ai.projects.types.VoiceAgentMcpTool(TypedDict, total=False): @@ -19572,8 +20095,9 @@ namespace azure.ai.projects.types key "require_approval": Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] key "response_scheduling": Union[str, VoiceAgentToolResponseScheduling] key "server_description": str + key "server_label": Required[str] key "server_url": str - key "tool_configs": dict[str, ToolConfig] + key "type": Required[Literal["mcp"]] allowed_callers: list[Union[str, CallableToolAllowedCaller]] allowed_tools: Union[list[str], MCPToolFilter] authorization: str @@ -19583,24 +20107,22 @@ namespace azure.ai.projects.types require_approval: Union[MCPToolRequireApproval, Literal[always], Literal[never]] response_scheduling: Union[str, VoiceAgentToolResponseScheduling] server_description: str - server_label: Required[str] + server_label: str server_url: str tool_configs: dict[str, ToolConfig] - type: Required[Literal["mcp"]] + type: Literal[mcp] class azure.ai.projects.types.VoiceAgentRealtimeResponse(OmitPropertiesRealtimeResponse1): - key "audio": ForwardRef('VoiceResponseAudio') + key "audio": ForwardRef('VoiceResponseAudio', module='types') key "conversation_id": str key "id": str key "max_output_tokens": Union[int, Literal["inf"]] key "metadata": Optional[Metadata] key "object": Literal["response"] - key "output": list[VoiceAgentResponseItem] - key "output_modalities": list[Literal["text", "audio"]] key "status": Literal["completed", "cancelled", "failed", "incomplete", "in_progress"] - key "status_details": ForwardRef('RealtimeResponseStatusDetails') - key "usage": ForwardRef('RealtimeResponseUsage') + key "status_details": ForwardRef('RealtimeResponseStatusDetails', module='types') + key "usage": ForwardRef('RealtimeResponseUsage', module='types') audio: VoiceResponseAudio conversation_id: str id: str @@ -19608,26 +20130,23 @@ namespace azure.ai.projects.types metadata: Metadata object: Literal[response] output: list[VoiceAgentResponseItem] - output_modalities: list[Literal[text, audio]] + output_modalities: list[Literal["text", "audio"]] status: Literal[completed, cancelled, failed, incomplete, in_progress] status_details: RealtimeResponseStatusDetails usage: RealtimeResponseUsage class azure.ai.projects.types.VoiceAgentResponseCreateParams(TypedDict, total=False): - key "audio": ForwardRef('PickPropertiesVoiceAudioConfig') + key "audio": ForwardRef('PickPropertiesVoiceAudioConfig', module='types') key "conversation": Union[Literal["auto"], Literal["none"], str] - key "input": list[RealtimeConversationItem] key "instructions": str key "interim_response": Optional[VoiceAgentInterimResponse] key "max_output_tokens": Union[int, Literal["inf"]] key "metadata": Optional[Metadata] - key "output_modalities": list[Union[str, VoiceOutputModality]] key "parallel_tool_calls": bool key "pre_generated_assistant_message": Optional[RealtimeConversationItemMessageAssistant] - key "reasoning": ForwardRef('RealtimeReasoning') + key "reasoning": ForwardRef('RealtimeReasoning', module='types') key "tool_choice": Union[str, ToolChoiceOptions, ToolChoiceFunction, ToolChoiceMCP] - key "tools": list[Union[RealtimeFunctionTool, MCPTool]] audio: PickPropertiesVoiceAudioConfig conversation: Union[Literal[auto], Literal[none], str] input: list[RealtimeConversationItem] @@ -19645,7 +20164,7 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceAgentResponseEventContentPart(TypedDict, total=False): key "audio": str - key "format": ForwardRef('VoiceAudioFormat') + key "format": ForwardRef('VoiceAudioFormat', module='types') key "text": str key "transcript": str key "type": Literal["audio", "text"] @@ -19661,453 +20180,700 @@ namespace azure.ai.projects.types key "create_response": bool key "eagerness": Literal["low", "medium", "high", "auto"] key "interrupt_response": bool + key "type": Required[Literal[VoiceTurnDetectionType.SEMANTIC_VAD]] auto_truncate: bool create_response: bool eagerness: Literal[low, medium, high, auto] interrupt_response: bool - type: Required[Literal[VoiceTurnDetectionType.SEMANTIC_VAD]] + type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD] class azure.ai.projects.types.VoiceAgentServerEventConversationItemAdded(TypedDict, total=False): + key "event_id": Required[str] + key "item": Required[VoiceAgentResponseItem] key "previous_item_id": Optional[str] - event_id: Required[str] - item: Required[VoiceAgentResponseItem] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED]] + event_id: str + item: VoiceAgentResponseItem previous_item_id: str - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED]] + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED] class azure.ai.projects.types.VoiceAgentServerEventConversationItemCreated(TypedDict, total=False): + key "event_id": Required[str] + key "item": Required[VoiceAgentResponseItem] key "previous_item_id": Optional[str] - event_id: Required[str] - item: Required[VoiceAgentResponseItem] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED]] + event_id: str + item: VoiceAgentResponseItem previous_item_id: str - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED]] + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED] class azure.ai.projects.types.VoiceAgentServerEventConversationItemDeleted(TypedDict, total=False): - event_id: Required[str] - item_id: Required[str] - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED]] + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED]] + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED] class azure.ai.projects.types.VoiceAgentServerEventConversationItemDone(TypedDict, total=False): + key "event_id": Required[str] + key "item": Required[VoiceAgentResponseItem] key "previous_item_id": Optional[str] - event_id: Required[str] - item: Required[VoiceAgentResponseItem] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE]] + event_id: str + item: VoiceAgentResponseItem previous_item_id: str - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE]] + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE] class azure.ai.projects.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted(TypedDict, total=False): + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] key "logprobs": Optional[list[LogProbProperties]] key "phrases": Optional[list[VoiceAgentTranscriptionPhrase]] - content_index: Required[int] - event_id: Required[str] - item_id: Required[str] + key "transcript": Required[str] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED]] + key "usage": Required[Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration]] + content_index: int + event_id: str + item_id: str logprobs: list[LogProbProperties] phrases: list[VoiceAgentTranscriptionPhrase] - transcript: Required[str] - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED]] - usage: Required[Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration]] + transcript: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED] + usage: Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration] class azure.ai.projects.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta(TypedDict, total=False): key "content_index": int key "delta": str + key "event_id": Required[str] + key "item_id": Required[str] key "logprobs": Optional[list[LogProbProperties]] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA]] content_index: int delta: str - event_id: Required[str] - item_id: Required[str] + event_id: str + item_id: str logprobs: list[LogProbProperties] - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA]] + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA] class azure.ai.projects.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed(TypedDict, total=False): - content_index: Required[int] - error: Required[RealtimeServerEventConversationItemInputAudioTranscriptionFailedError] - event_id: Required[str] - item_id: Required[str] - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED]] + key "content_index": Required[int] + key "error": Required[RealtimeServerEventConversationItemInputAudioTranscriptionFailedError] + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED]] + content_index: int + error: RealtimeServerEventConversationItemInputAudioTranscriptionFailedError + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED] class azure.ai.projects.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment(TypedDict, total=False): - content_index: Required[int] - end: Required[float] - event_id: Required[str] - id: Required[str] - item_id: Required[str] - speaker: Required[str] - start: Required[float] - text: Required[str] - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT]] + key "content_index": Required[int] + key "end": Required[float] + key "event_id": Required[str] + key "id": Required[str] + key "item_id": Required[str] + key "speaker": Required[str] + key "start": Required[float] + key "text": Required[str] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT]] + content_index: int + end: float + event_id: str + id: str + item_id: str + speaker: str + start: float + text: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT] class azure.ai.projects.types.VoiceAgentServerEventConversationItemRetrieved(TypedDict, total=False): - event_id: Required[str] - item: Required[VoiceAgentResponseItem] - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED]] + key "event_id": Required[str] + key "item": Required[VoiceAgentResponseItem] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED]] + event_id: str + item: VoiceAgentResponseItem + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED] class azure.ai.projects.types.VoiceAgentServerEventConversationItemTruncated(TypedDict, total=False): - key "item": ForwardRef('RealtimeConversationItemMessageAssistant') - audio_end_ms: Required[int] - content_index: Required[int] - event_id: Required[str] + key "audio_end_ms": Required[int] + key "content_index": Required[int] + key "event_id": Required[str] + key "item": ForwardRef('RealtimeConversationItemMessageAssistant', module='types') + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED]] + audio_end_ms: int + content_index: int + event_id: str item: RealtimeConversationItemMessageAssistant - item_id: Required[str] - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED]] + item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED] class azure.ai.projects.types.VoiceAgentServerEventInputAudioBufferCleared(TypedDict, total=False): - event_id: Required[str] - type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED]] + key "event_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED]] + event_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED] class azure.ai.projects.types.VoiceAgentServerEventInputAudioBufferCommitted(TypedDict, total=False): + key "event_id": Required[str] + key "item_id": Required[str] key "previous_item_id": Optional[str] - event_id: Required[str] - item_id: Required[str] + key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED]] + event_id: str + item_id: str previous_item_id: str - type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED]] + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED] class azure.ai.projects.types.VoiceAgentServerEventInputAudioBufferSpeechStarted(TypedDict, total=False): - audio_start_ms: Required[int] - event_id: Required[str] - item_id: Required[str] - type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED]] + key "audio_start_ms": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED]] + audio_start_ms: int + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED] class azure.ai.projects.types.VoiceAgentServerEventInputAudioBufferSpeechStopped(TypedDict, total=False): - audio_end_ms: Required[int] - event_id: Required[str] - item_id: Required[str] - type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED]] + key "audio_end_ms": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED]] + audio_end_ms: int + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED] class azure.ai.projects.types.VoiceAgentServerEventInputAudioBufferTimeoutTriggered(TypedDict, total=False): - audio_end_ms: Required[int] - audio_start_ms: Required[int] - event_id: Required[str] - item_id: Required[str] - type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED]] + key "audio_end_ms": Required[int] + key "audio_start_ms": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED]] + audio_end_ms: int + audio_start_ms: int + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED] class azure.ai.projects.types.VoiceAgentServerEventMcpListToolsCompleted(TypedDict, total=False): - event_id: Required[str] - item_id: Required[str] - type: Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED]] + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED]] + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED] class azure.ai.projects.types.VoiceAgentServerEventMcpListToolsFailed(TypedDict, total=False): - event_id: Required[str] - item_id: Required[str] - type: Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED]] + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED]] + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED] class azure.ai.projects.types.VoiceAgentServerEventMcpListToolsInProgress(TypedDict, total=False): - event_id: Required[str] - item_id: Required[str] - type: Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS]] + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS]] + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS] class azure.ai.projects.types.VoiceAgentServerEventOutputAudioBufferCleared(TypedDict, total=False): - event_id: Required[str] - response_id: Required[str] - type: Required[Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED]] + key "event_id": Required[str] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED]] + event_id: str + response_id: str + type: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED] class azure.ai.projects.types.VoiceAgentServerEventRateLimitsUpdated(TypedDict, total=False): - event_id: Required[str] - rate_limits: Required[list[RealtimeServerEventRateLimitsUpdatedRateLimits]] - type: Required[Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED]] + key "event_id": Required[str] + key "rate_limits": Required[list[RealtimeServerEventRateLimitsUpdatedRateLimits]] + key "type": Required[Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED]] + event_id: str + rate_limits: list[RealtimeServerEventRateLimitsUpdatedRateLimits] + type: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED] class azure.ai.projects.types.VoiceAgentServerEventResponseAnimationBlendshapesDelta(TypedDict, total=False): - content_index: Required[int] - event_id: Required[str] - frame_index: Required[int] - frames: Required[list[list[float]]] - item_id: Required[str] - output_index: Required[int] - response_id: Required[str] - type: Required[Literal["delta"]] + key "content_index": Required[int] + key "event_id": Required[str] + key "frame_index": Required[int] + key "frames": Required[list[list[float]]] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal["delta"]] + content_index: int + event_id: str + frame_index: int + frames: list[list[float]] + item_id: str + output_index: int + response_id: str + type: Literal[delta] class azure.ai.projects.types.VoiceAgentServerEventResponseAnimationBlendshapesDone(TypedDict, total=False): - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - response_id: Required[str] - type: Required[Literal["done"]] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal["done"]] + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[done] class azure.ai.projects.types.VoiceAgentServerEventResponseAnimationVisemeDelta(TypedDict, total=False): - audio_offset_ms: Required[int] - content_index: Required[int] - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - response_id: Required[str] - type: Required[Literal["delta"]] - viseme_id: Required[int] + key "audio_offset_ms": Required[int] + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal["delta"]] + key "viseme_id": Required[int] + audio_offset_ms: int + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[delta] + viseme_id: int class azure.ai.projects.types.VoiceAgentServerEventResponseAnimationVisemeDone(TypedDict, total=False): - content_index: Required[int] - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - response_id: Required[str] - type: Required[Literal["done"]] + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal["done"]] + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[done] class azure.ai.projects.types.VoiceAgentServerEventResponseAudioDelta(TypedDict, total=False): - content_index: Required[int] - delta: Required[str] - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - response_id: Required[str] - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA]] + key "content_index": Required[int] + key "delta": Required[str] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA]] + content_index: int + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA] class azure.ai.projects.types.VoiceAgentServerEventResponseAudioDone(TypedDict, total=False): - content_index: Required[int] - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - response_id: Required[str] - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE]] + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE]] + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE] class azure.ai.projects.types.VoiceAgentServerEventResponseAudioTimestampDelta(TypedDict, total=False): - audio_duration_ms: Required[int] - audio_offset_ms: Required[int] - content_index: Required[int] - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - response_id: Required[str] - text: Required[str] - timestamp_type: Required[Literal["word"]] - type: Required[Literal["delta"]] + key "audio_duration_ms": Required[int] + key "audio_offset_ms": Required[int] + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "text": Required[str] + key "timestamp_type": Required[Literal["word"]] + key "type": Required[Literal["delta"]] + audio_duration_ms: int + audio_offset_ms: int + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + text: str + timestamp_type: Literal[word] + type: Literal[delta] class azure.ai.projects.types.VoiceAgentServerEventResponseAudioTimestampDone(TypedDict, total=False): - content_index: Required[int] - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - response_id: Required[str] - type: Required[Literal["done"]] + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal["done"]] + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[done] class azure.ai.projects.types.VoiceAgentServerEventResponseAudioTranscriptDelta(TypedDict, total=False): - content_index: Required[int] - delta: Required[str] - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - response_id: Required[str] - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA]] + key "content_index": Required[int] + key "delta": Required[str] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA]] + content_index: int + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA] class azure.ai.projects.types.VoiceAgentServerEventResponseAudioTranscriptDone(TypedDict, total=False): - content_index: Required[int] - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - response_id: Required[str] - transcript: Required[str] - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE]] + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "transcript": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE]] + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + transcript: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE] class azure.ai.projects.types.VoiceAgentServerEventResponseContentPartDone(TypedDict, total=False): - content_index: Required[int] - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - part: Required[VoiceAgentResponseEventContentPart] - response_id: Required[str] - type: Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE]] + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "part": Required[VoiceAgentResponseEventContentPart] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE]] + content_index: int + event_id: str + item_id: str + output_index: int + part: VoiceAgentResponseEventContentPart + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE] class azure.ai.projects.types.VoiceAgentServerEventResponseCreated(TypedDict, total=False): - event_id: Required[str] - response: Required[VoiceAgentRealtimeResponse] - type: Required[Literal[RealtimeServerEventType.RESPONSE_CREATED]] + key "event_id": Required[str] + key "response": Required[VoiceAgentRealtimeResponse] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CREATED]] + event_id: str + response: VoiceAgentRealtimeResponse + type: Literal[RealtimeServerEventType.RESPONSE_CREATED] class azure.ai.projects.types.VoiceAgentServerEventResponseDone(TypedDict, total=False): - event_id: Required[str] - response: Required[VoiceAgentRealtimeResponse] - type: Required[Literal[RealtimeServerEventType.RESPONSE_DONE]] + key "event_id": Required[str] + key "response": Required[VoiceAgentRealtimeResponse] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_DONE]] + event_id: str + response: VoiceAgentRealtimeResponse + type: Literal[RealtimeServerEventType.RESPONSE_DONE] class azure.ai.projects.types.VoiceAgentServerEventResponseFunctionCallArgumentsDelta(TypedDict, total=False): - call_id: Required[str] - delta: Required[str] - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - response_id: Required[str] - type: Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA]] + key "call_id": Required[str] + key "delta": Required[str] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA]] + call_id: str + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA] class azure.ai.projects.types.VoiceAgentServerEventResponseFunctionCallArgumentsDone(TypedDict, total=False): - arguments: Required[str] - call_id: Required[str] - event_id: Required[str] - item_id: Required[str] - name: Required[str] - output_index: Required[int] - response_id: Required[str] - type: Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE]] + key "arguments": Required[str] + key "call_id": Required[str] + key "event_id": Required[str] + key "item_id": Required[str] + key "name": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE]] + arguments: str + call_id: str + event_id: str + item_id: str + name: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE] class azure.ai.projects.types.VoiceAgentServerEventResponseMcpCallArgumentsDelta(TypedDict, total=False): + key "delta": Required[str] + key "event_id": Required[str] + key "item_id": Required[str] key "obfuscation": Optional[str] - delta: Required[str] - event_id: Required[str] - item_id: Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA]] + delta: str + event_id: str + item_id: str obfuscation: str - output_index: Required[int] - response_id: Required[str] - type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA]] + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA] class azure.ai.projects.types.VoiceAgentServerEventResponseMcpCallArgumentsDone(TypedDict, total=False): - arguments: Required[str] - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - response_id: Required[str] - type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE]] + key "arguments": Required[str] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE]] + arguments: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE] class azure.ai.projects.types.VoiceAgentServerEventResponseMcpCallCompleted(TypedDict, total=False): - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED]] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED]] + event_id: str + item_id: str + output_index: int + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED] class azure.ai.projects.types.VoiceAgentServerEventResponseMcpCallFailed(TypedDict, total=False): - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED]] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED]] + event_id: str + item_id: str + output_index: int + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED] class azure.ai.projects.types.VoiceAgentServerEventResponseMcpCallInProgress(TypedDict, total=False): - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS]] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS]] + event_id: str + item_id: str + output_index: int + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS] class azure.ai.projects.types.VoiceAgentServerEventResponseOutputItemAdded(TypedDict, total=False): - event_id: Required[str] - item: Required[VoiceAgentResponseItem] - output_index: Required[int] - response_id: Required[str] - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED]] + key "event_id": Required[str] + key "item": Required[VoiceAgentResponseItem] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED]] + event_id: str + item: VoiceAgentResponseItem + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED] class azure.ai.projects.types.VoiceAgentServerEventResponseOutputItemDone(TypedDict, total=False): - event_id: Required[str] - item: Required[VoiceAgentResponseItem] - output_index: Required[int] - response_id: Required[str] - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE]] + key "event_id": Required[str] + key "item": Required[VoiceAgentResponseItem] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE]] + event_id: str + item: VoiceAgentResponseItem + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE] class azure.ai.projects.types.VoiceAgentServerEventResponseTextDelta(TypedDict, total=False): - content_index: Required[int] - delta: Required[str] - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - response_id: Required[str] - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA]] + key "content_index": Required[int] + key "delta": Required[str] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA]] + content_index: int + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA] class azure.ai.projects.types.VoiceAgentServerEventResponseTextDone(TypedDict, total=False): - content_index: Required[int] - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - response_id: Required[str] - text: Required[str] - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE]] + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "text": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE]] + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + text: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE] class azure.ai.projects.types.VoiceAgentServerEventResponseVideoDelta(TypedDict, total=False): - codec: Required[str] - delta: Required[str] - event_id: Required[str] - output_index: Required[int] - type: Required[Literal["delta"]] + key "codec": Required[str] + key "delta": Required[str] + key "event_id": Required[str] + key "output_index": Required[int] + key "type": Required[Literal["delta"]] + codec: str + delta: str + event_id: str + output_index: int + type: Literal[delta] class azure.ai.projects.types.VoiceAgentServerEventSessionAvatarConnecting(TypedDict, total=False): - event_id: Required[str] - server_sdp: Required[str] - type: Required[Literal["connecting"]] + key "event_id": Required[str] + key "server_sdp": Required[str] + key "type": Required[Literal["connecting"]] + event_id: str + server_sdp: str + type: Literal[connecting] class azure.ai.projects.types.VoiceAgentServerEventSessionAvatarSwitchToIdle(TypedDict, total=False): + key "event_id": Required[str] key "turn_id": str - event_id: Required[str] + key "type": Required[Literal["switch_to_idle"]] + event_id: str turn_id: str - type: Required[Literal["switch_to_idle"]] + type: Literal[switch_to_idle] class azure.ai.projects.types.VoiceAgentServerEventSessionAvatarSwitchToSpeaking(TypedDict, total=False): + key "event_id": Required[str] key "turn_id": str - event_id: Required[str] + key "type": Required[Literal["switch_to_speaking"]] + event_id: str turn_id: str - type: Required[Literal["switch_to_speaking"]] + type: Literal[switch_to_speaking] class azure.ai.projects.types.VoiceAgentServerEventSessionCreated(TypedDict, total=False): - event_id: Required[str] - session: Required[VoiceAgentSessionResponseConfig] - type: Required[Literal[RealtimeServerEventType.SESSION_CREATED]] + key "event_id": Required[str] + key "session": Required[VoiceAgentSessionResponseConfig] + key "type": Required[Literal[RealtimeServerEventType.SESSION_CREATED]] + event_id: str + session: VoiceAgentSessionResponseConfig + type: Literal[RealtimeServerEventType.SESSION_CREATED] class azure.ai.projects.types.VoiceAgentServerEventSessionUpdated(TypedDict, total=False): - event_id: Required[str] - session: Required[VoiceAgentSessionResponseConfig] - type: Required[Literal[RealtimeServerEventType.SESSION_UPDATED]] + key "event_id": Required[str] + key "session": Required[VoiceAgentSessionResponseConfig] + key "type": Required[Literal[RealtimeServerEventType.SESSION_UPDATED]] + event_id: str + session: VoiceAgentSessionResponseConfig + type: Literal[RealtimeServerEventType.SESSION_UPDATED] class azure.ai.projects.types.VoiceAgentServerEventWarning(TypedDict, total=False): - event_id: Required[str] - type: Required[Literal["warning"]] - warning: Required[VoiceAgentServerEventWarningDetails] + key "event_id": Required[str] + key "type": Required[Literal["warning"]] + key "warning": Required[VoiceAgentServerEventWarningDetails] + event_id: str + type: Literal[warning] + warning: VoiceAgentServerEventWarningDetails class azure.ai.projects.types.VoiceAgentServerEventWarningDetails(TypedDict, total=False): key "code": str + key "message": Required[str] key "param": str code: str - message: Required[str] + message: str param: str class azure.ai.projects.types.VoiceAgentSessionAvatarConfig(VoiceAvatarConfig): + key "character": Required[str] key "customized": bool key "ice_servers": Optional[list[VoiceAgentAvatarIceServer]] key "model": str key "output_audit_audio": bool key "output_protocol": Union[str, VoiceAvatarOutputProtocol] - key "scene": ForwardRef('VoiceAgentAvatarScene') + key "scene": ForwardRef('VoiceAgentAvatarScene', module='types') key "style": str - key "video": ForwardRef('VoiceAgentAvatarVideoParams') - character: Required[str] + key "type": Required[Union[str, VoiceAvatarType]] + key "video": ForwardRef('VoiceAgentAvatarVideoParams', module='types') + character: str customized: bool ice_servers: list[VoiceAgentAvatarIceServer] model: str @@ -20115,65 +20881,62 @@ namespace azure.ai.projects.types output_protocol: Union[str, VoiceAvatarOutputProtocol] scene: VoiceAgentAvatarScene style: str - type: Required[Union[str, VoiceAvatarType]] + type: Union[str, VoiceAvatarType] video: VoiceAgentAvatarVideoParams class azure.ai.projects.types.VoiceAgentSessionResponseConfig(TypedDict, total=False): - key "animation": ForwardRef('VoiceAgentAnimationConfig') - key "audio": ForwardRef('VoiceAudioConfig') - key "avatar": ForwardRef('VoiceAgentSessionAvatarConfig') + key "animation": ForwardRef('VoiceAgentAnimationConfig', module='types') + key "audio": ForwardRef('VoiceAudioConfig', module='types') + key "avatar": ForwardRef('VoiceAgentSessionAvatarConfig', module='types') key "expires_at": Optional[int] - key "greeting": ForwardRef('VoiceGreetingConfig') - key "include": list[Union[str, VoiceAgentSessionIncludeOption]] + key "greeting": ForwardRef('VoiceGreetingConfig', module='types') + key "id": Required[str] key "instructions": str - key "interim_response": ForwardRef('VoiceAgentInterimResponse') - key "max_output_tokens": ForwardRef('VoiceAgentMaxOutputTokens') - key "metadata": dict[str, str] - key "output_modalities": list[Union[str, VoiceOutputModality]] + key "interim_response": ForwardRef('VoiceAgentInterimResponse', module='types') + key "max_output_tokens": ForwardRef('VoiceAgentMaxOutputTokens', module='types') + key "model": Required[str] + key "object": Required[Literal["session"]] key "parallel_tool_calls": bool - key "reasoning": ForwardRef('RealtimeReasoning') + key "reasoning": ForwardRef('RealtimeReasoning', module='types') key "temperature": float - key "tool_choice": ForwardRef('VoiceAgentToolChoice') - key "tools": list[VoiceAgentTool] + key "tool_choice": ForwardRef('VoiceAgentToolChoice', module='types') + key "type": Required[Literal["realtime"]] animation: VoiceAgentAnimationConfig audio: VoiceAudioConfig avatar: VoiceAgentSessionAvatarConfig expires_at: int greeting: VoiceGreetingConfig - id: Required[str] + id: str include: list[Union[str, VoiceAgentSessionIncludeOption]] instructions: str interim_response: VoiceAgentInterimResponse max_output_tokens: VoiceAgentMaxOutputTokens metadata: dict[str, str] - model: Required[str] - object: Required[Literal["session"]] + model: str + object: Literal[session] output_modalities: list[Union[str, VoiceOutputModality]] parallel_tool_calls: bool reasoning: RealtimeReasoning temperature: float tool_choice: VoiceAgentToolChoice tools: list[VoiceAgentTool] - type: Required[Literal["realtime"]] + type: Literal[realtime] class azure.ai.projects.types.VoiceAgentSessionUpdateConfig(TypedDict, total=False): - key "animation": ForwardRef('VoiceAgentAnimationConfig') - key "audio": ForwardRef('VoiceAudioConfig') - key "avatar": ForwardRef('VoiceAgentSessionAvatarConfig') - key "greeting": ForwardRef('VoiceGreetingConfig') - key "include": list[Union[str, VoiceAgentSessionIncludeOption]] + key "animation": ForwardRef('VoiceAgentAnimationConfig', module='types') + key "audio": ForwardRef('VoiceAudioConfig', module='types') + key "avatar": ForwardRef('VoiceAgentSessionAvatarConfig', module='types') + key "greeting": ForwardRef('VoiceGreetingConfig', module='types') key "instructions": str - key "interim_response": ForwardRef('VoiceAgentInterimResponse') - key "max_output_tokens": ForwardRef('VoiceAgentMaxOutputTokens') - key "metadata": dict[str, str] - key "output_modalities": list[Union[str, VoiceOutputModality]] + key "interim_response": ForwardRef('VoiceAgentInterimResponse', module='types') + key "max_output_tokens": ForwardRef('VoiceAgentMaxOutputTokens', module='types') key "parallel_tool_calls": bool - key "reasoning": ForwardRef('RealtimeReasoning') + key "reasoning": ForwardRef('RealtimeReasoning', module='types') key "temperature": float - key "tool_choice": ForwardRef('VoiceAgentToolChoice') - key "tools": list[VoiceAgentTool] + key "tool_choice": ForwardRef('VoiceAgentToolChoice', module='types') + key "type": Required[Literal["realtime"]] animation: VoiceAgentAnimationConfig audio: VoiceAudioConfig avatar: VoiceAgentSessionAvatarConfig @@ -20189,69 +20952,78 @@ namespace azure.ai.projects.types temperature: float tool_choice: VoiceAgentToolChoice tools: list[VoiceAgentTool] - type: Required[Literal["realtime"]] + type: Literal[realtime] class azure.ai.projects.types.VoiceAgentStaticInterimResponseConfig(TypedDict, total=False): key "latency_threshold_ms": int - key "texts": list[str] - key "triggers": list[Union[str, VoiceAgentInterimResponseTrigger]] + key "type": Required[Literal["static_interim_response"]] latency_threshold_ms: int texts: list[str] triggers: list[Union[str, VoiceAgentInterimResponseTrigger]] - type: Required[Literal["static_interim_response"]] + type: Literal[static_interim_response] class azure.ai.projects.types.VoiceAgentTranscriptionPhrase(TypedDict, total=False): key "confidence": Optional[float] + key "duration_milliseconds": Required[int] key "locale": Optional[str] + key "offset_milliseconds": Required[int] + key "text": Required[str] key "words": Optional[list[VoiceAgentTranscriptionWord]] confidence: float - duration_milliseconds: Required[int] + duration_milliseconds: int locale: str - offset_milliseconds: Required[int] - text: Required[str] + offset_milliseconds: int + text: str words: list[VoiceAgentTranscriptionWord] class azure.ai.projects.types.VoiceAgentTranscriptionWord(TypedDict, total=False): - duration_milliseconds: Required[int] - offset_milliseconds: Required[int] - text: Required[str] + key "duration_milliseconds": Required[int] + key "offset_milliseconds": Required[int] + key "text": Required[str] + duration_milliseconds: int + offset_milliseconds: int + text: str class azure.ai.projects.types.VoiceAssistantMessageItem(TypedDict, total=False): + key "content": Required[list[RealtimeConversationItemMessageAssistantContent]] key "created_at": int key "id": str key "object": Literal["item"] key "response_id": str + key "role": Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] key "status": Literal["completed", "incomplete", "in_progress"] - content: Required[list[RealtimeConversationItemMessageAssistantContent]] + key "type": Required[Literal[VoiceConversationItemType.MESSAGE]] + content: list[RealtimeConversationItemMessageAssistantContent] created_at: int id: str object: Literal[item] response_id: str - role: Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] + role: Literal[RealtimeConversationItemMessageType.ASSISTANT] status: Literal[completed, incomplete, in_progress] - type: Required[Literal[VoiceConversationItemType.MESSAGE]] + type: Literal[VoiceConversationItemType.MESSAGE] class azure.ai.projects.types.VoiceAudioConfig(TypedDict, total=False): - key "input": ForwardRef('VoiceAudioInputConfig') - key "output": ForwardRef('VoiceAudioOutputConfig') + key "input": ForwardRef('VoiceAudioInputConfig', module='types') + key "output": ForwardRef('VoiceAudioOutputConfig', module='types') input: VoiceAudioInputConfig output: VoiceAudioOutputConfig class azure.ai.projects.types.VoiceAudioFormat(TypedDict, total=False): key "rate": int + key "type": Required[Union[str, VoiceAudioFormatType]] rate: int - type: Required[Union[str, VoiceAudioFormatType]] + type: Union[str, VoiceAudioFormatType] class azure.ai.projects.types.VoiceAudioInputConfig(TypedDict, total=False): key "echo_cancellation": Optional[VoiceAgentEchoCancellation] - key "format": ForwardRef('VoiceAudioFormat') + key "format": ForwardRef('VoiceAudioFormat', module='types') key "noise_reduction": Optional[VoiceNoiseReduction] key "transcription": Optional[VoiceInputTranscription] key "turn_detection": Optional[VoiceAgentTurnDetection] @@ -20266,11 +21038,9 @@ namespace azure.ai.projects.types key "custom_lexicon_url": str key "custom_text_normalization_url": str key "custom_voice_endpoint_id": str - key "format": ForwardRef('VoiceAudioFormat') - key "output_audio_timestamp_types": list[Union[str, VoiceAudioTimestampType]] + key "format": ForwardRef('VoiceAudioFormat', module='types') key "personal_voice_model": str key "pitch": str - key "prefer_locales": list[str] key "speed": float key "style": str key "voice": str @@ -20296,21 +21066,23 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceAvatarConfig(TypedDict, total=False): + key "character": Required[str] key "customized": bool key "model": str key "output_audit_audio": bool key "output_protocol": Union[str, VoiceAvatarOutputProtocol] - key "scene": ForwardRef('VoiceAgentAvatarScene') + key "scene": ForwardRef('VoiceAgentAvatarScene', module='types') key "style": str - key "video": ForwardRef('VoiceAgentAvatarVideoParams') - character: Required[str] + key "type": Required[Union[str, VoiceAvatarType]] + key "video": ForwardRef('VoiceAgentAvatarVideoParams', module='types') + character: str customized: bool model: str output_audit_audio: bool output_protocol: Union[str, VoiceAvatarOutputProtocol] scene: VoiceAgentAvatarScene style: str - type: Required[Union[str, VoiceAvatarType]] + type: Union[str, VoiceAvatarType] video: VoiceAgentAvatarVideoParams @@ -20325,6 +21097,7 @@ namespace azure.ai.projects.types key "silence_duration_ms": str key "speech_duration_ms": str key "threshold": float + key "type": Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN]] auto_truncate: bool create_response: bool end_of_utterance_detection: VoiceEndOfUtteranceDetection @@ -20335,7 +21108,7 @@ namespace azure.ai.projects.types silence_duration_ms: str speech_duration_ms: str threshold: float - type: Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN]] + type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN] class azure.ai.projects.types.VoiceAzureSemanticVadMultilingualTurnDetection(TypedDict, total=False): @@ -20344,12 +21117,12 @@ namespace azure.ai.projects.types key "end_of_utterance_detection": Optional[VoiceEndOfUtteranceDetection] key "idle_timeout_ms": str key "interrupt_response": bool - key "languages": list[str] key "prefix_padding_ms": str key "remove_filler_words": bool key "silence_duration_ms": str key "speech_duration_ms": str key "threshold": float + key "type": Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL]] auto_truncate: bool create_response: bool end_of_utterance_detection: VoiceEndOfUtteranceDetection @@ -20361,7 +21134,7 @@ namespace azure.ai.projects.types silence_duration_ms: str speech_duration_ms: str threshold: float - type: Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL]] + type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] class azure.ai.projects.types.VoiceAzureSemanticVadTurnDetection(TypedDict, total=False): @@ -20370,12 +21143,12 @@ namespace azure.ai.projects.types key "end_of_utterance_detection": Optional[VoiceEndOfUtteranceDetection] key "idle_timeout_ms": str key "interrupt_response": bool - key "languages": list[str] key "prefix_padding_ms": str key "remove_filler_words": bool key "silence_duration_ms": str key "speech_duration_ms": str key "threshold": float + key "type": Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD]] auto_truncate: bool create_response: bool end_of_utterance_detection: VoiceEndOfUtteranceDetection @@ -20387,7 +21160,7 @@ namespace azure.ai.projects.types silence_duration_ms: str speech_duration_ms: str threshold: float - type: Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD]] + type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD] class azure.ai.projects.types.VoiceConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -20401,129 +21174,153 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceEndOfUtteranceDetection(TypedDict, total=False): + key "model": Required[Union[str, VoiceEndOfUtteranceDetectionModel]] key "threshold_level": Union[str, VoiceEndOfUtteranceThresholdLevel] key "timeout_ms": str - model: Required[Union[str, VoiceEndOfUtteranceDetectionModel]] + model: Union[str, VoiceEndOfUtteranceDetectionModel] threshold_level: Union[str, VoiceEndOfUtteranceThresholdLevel] timeout_ms: str class azure.ai.projects.types.VoiceFunctionCallItem(TypedDict, total=False): + key "arguments": Required[str] key "call_id": str key "created_at": int key "id": str + key "name": Required[str] key "object": Literal["item"] key "response_id": str key "status": Literal["completed", "incomplete", "in_progress"] - arguments: Required[str] + key "type": Required[Literal[VoiceConversationItemType.FUNCTION_CALL]] + arguments: str call_id: str created_at: int id: str - name: Required[str] + name: str object: Literal[item] response_id: str status: Literal[completed, incomplete, in_progress] - type: Required[Literal[VoiceConversationItemType.FUNCTION_CALL]] + type: Literal[VoiceConversationItemType.FUNCTION_CALL] class azure.ai.projects.types.VoiceFunctionCallOutputItem(TypedDict, total=False): + key "call_id": Required[str] key "created_at": int key "id": str key "name": str key "object": Literal["item"] + key "output": Required[str] key "response_id": str key "status": Literal["completed", "incomplete", "in_progress"] - call_id: Required[str] + key "type": Required[Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT]] + call_id: str created_at: int id: str name: str object: Literal[item] - output: Required[str] + output: str response_id: str status: Literal[completed, incomplete, in_progress] - type: Required[Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT]] + type: Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT] class azure.ai.projects.types.VoiceInputTranscription(TypedDict, total=False): - key "custom_speech": dict[str, str] key "delay": Literal["minimal", "low", "medium", "high", "xhigh"] key "language": str - key "phrase_list": list[str] + key "model": Required[Union[str, VoiceInputTranscriptionModel]] key "prompt": str custom_speech: dict[str, str] delay: Literal[minimal, low, medium, high, xhigh] language: str - model: Required[Union[str, VoiceInputTranscriptionModel]] + model: Union[str, VoiceInputTranscriptionModel] phrase_list: list[str] prompt: str class azure.ai.projects.types.VoiceMcpApprovalRequestItem(TypedDict, total=False): + key "arguments": Required[str] key "created_at": int + key "id": Required[str] + key "name": Required[str] key "response_id": str - arguments: Required[str] + key "server_label": Required[str] + key "type": Required[Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST]] + arguments: str created_at: int - id: Required[str] - name: Required[str] + id: str + name: str response_id: str - server_label: Required[str] - type: Required[Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST]] + server_label: str + type: Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST] class azure.ai.projects.types.VoiceMcpApprovalResponseItem(TypedDict, total=False): + key "approval_request_id": Required[str] + key "approve": Required[bool] key "created_at": int + key "id": Required[str] key "reason": Optional[str] key "response_id": str - approval_request_id: Required[str] - approve: Required[bool] + key "type": Required[Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE]] + approval_request_id: str + approve: bool created_at: int - id: Required[str] + id: str reason: str response_id: str - type: Required[Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE]] + type: Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE] class azure.ai.projects.types.VoiceMcpCallItem(TypedDict, total=False): key "approval_request_id": Optional[str] + key "arguments": Required[str] key "created_at": int - key "error": ForwardRef('RealtimeMCPError') + key "error": ForwardRef('RealtimeMCPError', module='types') + key "id": Required[str] + key "name": Required[str] key "output": Optional[str] key "response_id": str + key "server_label": Required[str] + key "type": Required[Literal[VoiceConversationItemType.MCP_CALL]] approval_request_id: str - arguments: Required[str] + arguments: str created_at: int error: RealtimeMCPError - id: Required[str] - name: Required[str] + id: str + name: str output: str response_id: str - server_label: Required[str] - type: Required[Literal[VoiceConversationItemType.MCP_CALL]] + server_label: str + type: Literal[VoiceConversationItemType.MCP_CALL] class azure.ai.projects.types.VoiceMcpListToolsItem(TypedDict, total=False): key "created_at": int key "id": str key "response_id": str + key "server_label": Required[str] + key "tools": Required[list[MCPListToolsTool]] + key "type": Required[Literal[VoiceConversationItemType.MCP_LIST_TOOLS]] created_at: int id: str response_id: str - server_label: Required[str] - tools: Required[list[MCPListToolsTool]] - type: Required[Literal[VoiceConversationItemType.MCP_LIST_TOOLS]] + server_label: str + tools: list[MCPListToolsTool] + type: Literal[VoiceConversationItemType.MCP_LIST_TOOLS] class azure.ai.projects.types.VoiceNoiseReduction(TypedDict, total=False): - type: Required[Union[str, VoiceNoiseReductionType]] + key "type": Required[Union[str, VoiceNoiseReductionType]] + type: Union[str, VoiceNoiseReductionType] class azure.ai.projects.types.VoiceResponseAudio(TypedDict, total=False): - key "output": ForwardRef('VoiceResponseAudioOutput') + key "output": ForwardRef('VoiceResponseAudioOutput', module='types') output: VoiceResponseAudioOutput class azure.ai.projects.types.VoiceResponseAudioOutput(TypedDict, total=False): - key "format": ForwardRef('RealtimeAudioFormats') + key "format": ForwardRef('RealtimeAudioFormats', module='types') key "voice": str key "voice_locale": str key "voice_type": str @@ -20543,6 +21340,7 @@ namespace azure.ai.projects.types key "silence_duration_ms": int key "speech_duration_ms": int key "threshold": float + key "type": Required[Literal[VoiceTurnDetectionType.SERVER_VAD]] auto_truncate: bool create_response: bool end_of_utterance_detection: VoiceEndOfUtteranceDetection @@ -20552,38 +21350,46 @@ namespace azure.ai.projects.types silence_duration_ms: int speech_duration_ms: int threshold: float - type: Required[Literal[VoiceTurnDetectionType.SERVER_VAD]] + type: Literal[VoiceTurnDetectionType.SERVER_VAD] class azure.ai.projects.types.VoiceSystemMessageItem(TypedDict, total=False): + key "content": Required[list[RealtimeConversationItemMessageSystemContent]] key "created_at": int key "id": str key "object": Literal["item"] key "response_id": str + key "role": Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] key "status": Literal["completed", "incomplete", "in_progress"] - content: Required[list[RealtimeConversationItemMessageSystemContent]] + key "type": Required[Literal[VoiceConversationItemType.MESSAGE]] + content: list[RealtimeConversationItemMessageSystemContent] created_at: int id: str object: Literal[item] response_id: str - role: Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] + role: Literal[RealtimeConversationItemMessageType.SYSTEM] status: Literal[completed, incomplete, in_progress] - type: Required[Literal[VoiceConversationItemType.MESSAGE]] + type: Literal[VoiceConversationItemType.MESSAGE] class azure.ai.projects.types.VoiceSystemTool(TypedDict, total=False): key "description": str + key "name": Required[Union[str, VoiceSystemToolName]] + key "type": Required[Literal["system"]] description: str - name: Required[Union[str, VoiceSystemToolName]] - type: Required[Literal["system"]] + name: Union[str, VoiceSystemToolName] + type: Literal[system] class azure.ai.projects.types.VoiceToolboxTool(TypedDict, total=False): key "response_scheduling": Union[str, VoiceAgentToolResponseScheduling] + key "toolbox_name": Required[str] + key "toolbox_version": Required[str] + key "type": Required[Literal["toolbox"]] response_scheduling: Union[str, VoiceAgentToolResponseScheduling] - toolbox_name: Required[str] - toolbox_version: Required[str] - type: Required[Literal["toolbox"]] + toolbox_name: str + toolbox_version: str + type: Literal[toolbox] class azure.ai.projects.types.VoiceTurnDetectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -20595,19 +21401,22 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceUserMessageItem(TypedDict, total=False): + key "content": Required[list[RealtimeConversationItemMessageUserContent]] key "created_at": int key "id": str key "object": Literal["item"] key "response_id": str + key "role": Required[Literal[RealtimeConversationItemMessageType.USER]] key "status": Literal["completed", "incomplete", "in_progress"] - content: Required[list[RealtimeConversationItemMessageUserContent]] + key "type": Required[Literal[VoiceConversationItemType.MESSAGE]] + content: list[RealtimeConversationItemMessageUserContent] created_at: int id: str object: Literal[item] response_id: str - role: Required[Literal[RealtimeConversationItemMessageType.USER]] + role: Literal[RealtimeConversationItemMessageType.USER] status: Literal[completed, incomplete, in_progress] - type: Required[Literal[VoiceConversationItemType.MESSAGE]] + type: Literal[VoiceConversationItemType.MESSAGE] class azure.ai.projects.types.WebSearchApproximateLocation(TypedDict, total=False): @@ -20615,35 +21424,38 @@ namespace azure.ai.projects.types key "country": Optional[str] key "region": Optional[str] key "timezone": Optional[str] + key "type": Required[Literal["approximate"]] city: str country: str region: str timezone: str - type: Required[Literal["approximate"]] + type: Literal[approximate] class azure.ai.projects.types.WebSearchConfiguration(TypedDict, total=False): - instance_name: Required[str] - project_connection_id: Required[str] + key "instance_name": Required[str] + key "project_connection_id": Required[str] + instance_name: str + project_connection_id: str class azure.ai.projects.types.WebSearchPreviewTool(TypedDict, total=False): - key "search_content_types": list[Union[str, SearchContentType]] key "search_context_size": Union[str, SearchContextSize] + key "type": Required[Literal[ToolType.WEB_SEARCH_PREVIEW]] key "user_location": Optional[ApproximateLocation] search_content_types: list[Union[str, SearchContentType]] search_context_size: Union[str, SearchContextSize] - type: Required[Literal[ToolType.WEB_SEARCH_PREVIEW]] + type: Literal[ToolType.WEB_SEARCH_PREVIEW] user_location: ApproximateLocation class azure.ai.projects.types.WebSearchTool(TypedDict, total=False): - key "custom_search_configuration": ForwardRef('WebSearchConfiguration') + key "custom_search_configuration": ForwardRef('WebSearchConfiguration', module='types') key "description": str key "filters": Optional[WebSearchToolFilters] key "name": str key "search_context_size": Literal["low", "medium", "high"] - key "tool_configs": dict[str, ToolConfig] + key "type": Required[Literal[ToolType.WEB_SEARCH]] key "user_location": Optional[WebSearchApproximateLocation] custom_search_configuration: WebSearchConfiguration description: str @@ -20651,7 +21463,7 @@ namespace azure.ai.projects.types name: str search_context_size: Literal[low, medium, high] tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolType.WEB_SEARCH]] + type: Literal[ToolType.WEB_SEARCH] user_location: WebSearchApproximateLocation @@ -20661,12 +21473,12 @@ namespace azure.ai.projects.types class azure.ai.projects.types.WebSearchToolboxTool(TypedDict, total=False): - key "custom_search_configuration": ForwardRef('WebSearchConfiguration') + key "custom_search_configuration": ForwardRef('WebSearchConfiguration', module='types') key "description": str key "filters": Optional[WebSearchToolFilters] key "name": str key "search_context_size": Literal["low", "medium", "high"] - key "tool_configs": dict[str, ToolConfig] + key "type": Required[Literal[ToolboxToolType.WEB_SEARCH]] key "user_location": Optional[WebSearchApproximateLocation] custom_search_configuration: WebSearchConfiguration description: str @@ -20674,35 +21486,41 @@ namespace azure.ai.projects.types name: str search_context_size: Literal[low, medium, high] tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolboxToolType.WEB_SEARCH]] + type: Literal[ToolboxToolType.WEB_SEARCH] user_location: WebSearchApproximateLocation class azure.ai.projects.types.WeeklyRecurrenceSchedule(TypedDict, total=False): - daysOfWeek: Required[list[Union[str, DayOfWeek]]] - type: Required[Literal[RecurrenceType.WEEKLY]] + key "daysOfWeek": Required[list[Union[str, DayOfWeek]]] + key "type": Required[Literal[RecurrenceType.WEEKLY]] + daysOfWeek: list[Union[str, DayOfWeek]] + type: Literal[RecurrenceType.WEEKLY] class azure.ai.projects.types.WorkIQPreviewTool(TypedDict, total=False): - project_connection_id: Required[str] - type: Required[Literal[ToolType.WORK_IQ_PREVIEW]] + key "project_connection_id": Required[str] + key "type": Required[Literal[ToolType.WORK_IQ_PREVIEW]] + project_connection_id: str + type: Literal[ToolType.WORK_IQ_PREVIEW] class azure.ai.projects.types.WorkIQPreviewToolboxTool(TypedDict, total=False): key "description": str key "name": str - key "tool_configs": dict[str, ToolConfig] + key "project_connection_id": Required[str] + key "type": Required[Literal[ToolboxToolType.WORK_IQ_PREVIEW]] description: str name: str - project_connection_id: Required[str] + project_connection_id: str tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolboxToolType.WORK_IQ_PREVIEW]] + type: Literal[ToolboxToolType.WORK_IQ_PREVIEW] class azure.ai.projects.types.WorkflowAgentDefinition(TypedDict, total=False): - key "rai_config": ForwardRef('RaiConfig') + key "kind": Required[Literal[AgentKind.WORKFLOW]] + key "rai_config": ForwardRef('RaiConfig', module='types') key "workflow": str - kind: Required[Literal[AgentKind.WORKFLOW]] + kind: Literal[AgentKind.WORKFLOW] rai_config: RaiConfig workflow: str diff --git a/sdk/ai/azure-ai-projects/api.metadata.yml b/sdk/ai/azure-ai-projects/api.metadata.yml index 73488fad5b55..a38a19e2ebf4 100644 --- a/sdk/ai/azure-ai-projects/api.metadata.yml +++ b/sdk/ai/azure-ai-projects/api.metadata.yml @@ -1,3 +1,3 @@ -apiMdSha256: 233bd99062bd0c4c2beb1779b4b11dcdbc9243384eba8969f60fce4e693be680 +apiMdSha256: 3d3ffaa23496a1f32b83d7560f23db9e94b6f7aafcf718ab6088014ee52f72ec parserVersion: 0.3.31 -pythonVersion: 3.10.20 +pythonVersion: 3.13.14 From a1762c981bc688839c157228d0cbf3812912d6a5 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Thu, 13 Aug 2026 17:18:58 -0700 Subject: [PATCH 21/56] Fix mypy/pyright/cspell CI failures for voice agent PR --- .../azure-ai-projects/azure/ai/projects/aio/_patch.pyi | 10 ++-------- .../projects/aio/operations/_patch_memories_async.py | 2 +- .../azure/ai/projects/models/_models.py | 8 ++++++-- .../azure/ai/projects/operations/_patch_memories.py | 2 +- sdk/ai/cspell.yaml | 7 +++++++ 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.pyi b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.pyi index e480e6e373f3..b4fa5b00ddeb 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.pyi +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.pyi @@ -32,6 +32,7 @@ from openai.types.graders.string_check_grader_param import StringCheckGraderPara from openai.types.eval_create_response import EvalCreateResponse from openai.types.shared_params.metadata import Metadata from ._client import AIProjectClient as AIProjectClientGenerated +from ._realtime import AsyncRealtime, AsyncRealtimeConnection, AsyncRealtimeConnectionManager from .operations import TelemetryOperations from ..models import ( AzureAIBenchmarkPreviewEvalRunDataSource, @@ -102,18 +103,11 @@ class AsyncOpenAI(AsyncOpenAIClient): class AIProjectClient(AIProjectClientGenerated): telemetry: TelemetryOperations @property - def realtime(self) -> Any: ... + def realtime(self) -> AsyncRealtime: ... def get_openai_client( self, agent_name: Optional[str] = None, **kwargs: Any # pylint: disable=unused-argument ) -> AsyncOpenAI: ... -class AsyncRealtime: - def __init__(self, client: Any) -> None: ... - def connect(self, *, agent_name: str, **kwargs: Any) -> Any: ... - -class AsyncRealtimeConnection: ... -class AsyncRealtimeConnectionManager: ... - class _OpenAILoggingTransport: def __init__(self, *, logging_enabled: bool) -> None: ... async def handle_async_request(self, request: Any) -> Any: ... diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_memories_async.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_memories_async.py index 856d3433a6a7..3758708bb1b6 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_memories_async.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_memories_async.py @@ -339,7 +339,7 @@ def get_long_running_output(pipeline_response): usage = MemoryStoreOperationUsage( embedding_tokens=0, input_tokens=0, - input_tokens_details=ResponseUsageInputTokensDetails(cached_tokens=0), + input_tokens_details=ResponseUsageInputTokensDetails(cached_tokens=0, cache_write_tokens=0), output_tokens=0, output_tokens_details=ResponseUsageOutputTokensDetails(reasoning_tokens=0), total_tokens=0, 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 d92e20bb2a71..57df6906fdef 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 @@ -25031,7 +25031,9 @@ class VoiceResponse(OmitPropertiesRealtimeResponse): # pylint: disable=docstrin :vartype completed_at: ~datetime.datetime """ - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + id: str = rest_field( # type: ignore[reportIncompatibleVariableOverride] + visibility=["read", "create", "update", "delete", "query"] + ) """The unique id of the response. Required.""" output: Optional[list["_models.VoiceConversationItem"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] @@ -25040,7 +25042,9 @@ class VoiceResponse(OmitPropertiesRealtimeResponse): # pylint: disable=docstrin response (GET .../responses/{response_id}) or use the paged response-items route (GET .../responses/{response_id}/items) for its output items. Each item's ``response_id`` also links it back to this response in the conversation-level items list.""" - conversation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + conversation_id: str = rest_field( # type: ignore[reportIncompatibleVariableOverride] + visibility=["read", "create", "update", "delete", "query"] + ) """The id of the conversation this response belongs to. Required.""" audio: Optional["_models.VoiceResponseAudio"] = rest_field( visibility=["read", "create", "update", "delete", "query"] diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_memories.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_memories.py index 33b932900a35..c5f16026520d 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_memories.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_memories.py @@ -374,7 +374,7 @@ def get_long_running_output(pipeline_response): usage = MemoryStoreOperationUsage( embedding_tokens=0, input_tokens=0, - input_tokens_details=ResponseUsageInputTokensDetails(cached_tokens=0), + input_tokens_details=ResponseUsageInputTokensDetails(cached_tokens=0, cache_write_tokens=0), output_tokens=0, output_tokens_details=ResponseUsageOutputTokensDetails(reasoning_tokens=0), total_tokens=0, diff --git a/sdk/ai/cspell.yaml b/sdk/ai/cspell.yaml index 9083e839d933..dc9b01add7bb 100644 --- a/sdk/ai/cspell.yaml +++ b/sdk/ai/cspell.yaml @@ -21,6 +21,8 @@ words: - azureopenai - balapvbyostoragecanary - BLPHARMA + - BYOM + - BYOS - cegr - closefd - cogsvc @@ -34,6 +36,8 @@ words: - deser - devtools - dotenv + - dtmf + - DTMF - dtype - estás - evals @@ -64,6 +68,7 @@ words: - LLMRAG - logprobs - LUMIFOOD + - MCPHTTP - miniconda - Ministral - mlflow @@ -95,7 +100,9 @@ words: - quantitive - rdel - recsmplmdl + - redef - reraises + - retriable - roups - runid - runsvdir From e368d9998fa9a244043f7b7767a092e7aac0a13d Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Fri, 14 Aug 2026 17:36:01 -0700 Subject: [PATCH 22/56] Add sync Realtime client for voice agents; regenerate SDK from TypeSpec (PR 45357); add sync live-text-conversation sample --- .../azure/ai/projects/_patch.py | 23 + .../azure/ai/projects/_patch.pyi | 5 +- .../azure/ai/projects/_realtime.py | 785 ++++++++++++++++++ .../azure/ai/projects/_unions.py | 4 +- .../azure/ai/projects/_utils/utils.py | 1 + .../azure/ai/projects/aio/_realtime.py | 48 +- .../ai/projects/aio/operations/_operations.py | 18 +- .../ai/projects/operations/_operations.py | 18 +- .../azure/ai/projects/types.py | 1 + ...mple_voice_agent_live_text_conversation.py | 240 ++++++ 10 files changed, 1092 insertions(+), 51 deletions(-) create mode 100644 sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py create mode 100644 sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py index 6e07cc919b74..5c804a5ca390 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py @@ -20,6 +20,14 @@ from ._client import AIProjectClient as AIProjectClientGenerated from .operations import TelemetryOperations from .models._patch import _BETA_OPERATION_FEATURE_HEADERS, _FOUNDRY_FEATURES_HEADER_NAME, _has_header_case_insensitive +from ._realtime import ( + Realtime, + RealtimeConnection, + RealtimeConnectionManager, + ClientEvent, + ConversationItem, + ServerEvent, +) _OPENAI_TRANSPORT_LOGGER_NAME = "azure.ai.projects.openai_transport" logger = logging.getLogger(__name__) @@ -239,6 +247,18 @@ def __init__( super().__init__(endpoint=endpoint, credential=credential, allow_preview=allow_preview, **kwargs) self.telemetry = TelemetryOperations(self) # type: ignore + self._realtime: Optional[Realtime] = None + + @property + def realtime(self) -> Realtime: + """Realtime streaming entry point for voice agents. + + :return: The realtime namespace, exposing ``connect(...)``. + :rtype: ~azure.ai.projects.Realtime + """ + if self._realtime is None: + self._realtime = Realtime(self) + return self._realtime def _get_openai_api_key(self, kwargs: dict): """Resolve the API key for the OpenAI client. @@ -501,6 +521,9 @@ def _log_request_body(self, request: httpx.Request) -> None: __all__: List[str] = [ "AIProjectClient", + "Realtime", + "RealtimeConnection", + "RealtimeConnectionManager", ] # Add all objects you want publicly available to users at this package level diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.pyi b/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.pyi index 4fad0e185af6..8e3e47320a25 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.pyi +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.pyi @@ -34,6 +34,7 @@ from openai.types.eval_create_response import EvalCreateResponse from openai.types.shared_params.metadata import Metadata from ._client import AIProjectClient as AIProjectClientGenerated from .operations import TelemetryOperations +from ._realtime import Realtime, RealtimeConnection, RealtimeConnectionManager from .models import ( AzureAIBenchmarkPreviewEvalRunDataSource, AzureAIDataSourceConfig, @@ -102,6 +103,8 @@ class OpenAI(OpenAIClient): class AIProjectClient(AIProjectClientGenerated): telemetry: TelemetryOperations + @property + def realtime(self) -> Realtime: ... def get_openai_client( self, agent_name: Optional[str] = None, **kwargs: Any # pylint: disable=unused-argument ) -> OpenAI: ... @@ -126,6 +129,6 @@ def _resolve_openai_default_headers(agent_name: Optional[str], kwargs: dict) -> def _build_openai_user_agent(custom_user_agent: Optional[str], openai_default_user_agent: str) -> str: ... def _log_streaming_response_notice(logging_enabled: bool) -> bool: ... -__all__: List[str] = ["AIProjectClient"] +__all__: List[str] = ["AIProjectClient", "Realtime", "RealtimeConnection", "RealtimeConnectionManager"] def patch_sdk() -> None: ... diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py new file mode 100644 index 000000000000..253131a652c9 --- /dev/null +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py @@ -0,0 +1,785 @@ +# pylint: disable=networking-import-outside-azure-core-transport +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +"""Hand-written sync realtime (WebSocket) streaming client for voice agents. + +This is the synchronous counterpart of :mod:`azure.ai.projects.aio._realtime`. See that +module's docstring for the full design rationale; the two modules are kept structurally +identical (sync method names drop the ``async``/``await`` keywords) so fixes/features land in +both at once. + +``websockets`` is required for this feature and is *not* a hard dependency of the package; it +is imported lazily so importing the SDK never fails when it is absent. +""" +from __future__ import annotations + +import base64 +import json +from urllib.parse import urlencode +from typing import ( + Any, + Dict, + Iterator, + List, + Mapping, + Optional, + Type, + TYPE_CHECKING, + Union, + cast, +) + +from . import models as _models +from .models._enums import _AgentDefinitionOptInKeys +from .models._patch import _FOUNDRY_FEATURES_HEADER_NAME +from ._utils.model_base import Model as _Model, SdkJSONEncoder + +# Scoped to just the voice-agent preview opt-in; callers connecting to other preview agent +# kinds through this same route can pass a broader value explicitly via ``foundry_features``. +_VOICE_AGENT_FEATURE_HEADER: str = _AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.value + +if TYPE_CHECKING: + from websockets.sync.client import ClientConnection + from azure.core.credentials import TokenCredential + + from ._client import AIProjectClient + + +__all__ = [ + "Realtime", + "RealtimeConnection", + "RealtimeConnectionManager", + "ClientEvent", + "ConversationItem", + "ServerEvent", +] + +# Union of the client event models sendable over the connection, plus a raw mapping escape +# hatch for forward compatibility with event types not yet represented in the generated models. +ClientEvent = Union[ + _models.VoiceAgentClientEventConversationItemCreate, + _models.VoiceAgentClientEventConversationItemDelete, + _models.VoiceAgentClientEventConversationItemRetrieve, + _models.VoiceAgentClientEventConversationItemTruncate, + _models.VoiceAgentClientEventInputAudioBufferAppend, + _models.VoiceAgentClientEventInputAudioBufferClear, + _models.VoiceAgentClientEventInputAudioBufferCommit, + _models.VoiceAgentClientEventOutputAudioBufferClear, + _models.VoiceAgentClientEventResponseCancel, + _models.VoiceAgentClientEventResponseCreate, + _models.VoiceAgentClientEventSessionAvatarConnect, + _models.VoiceAgentClientEventSessionUpdate, + str, + Mapping[str, Any], +] + +# The conversation item variants accepted by ``conversation.item.create``. +ConversationItem = Union[ + _models.RealtimeConversationItemMessageSystem, + _models.RealtimeConversationItemMessageUser, + _models.RealtimeConversationItemMessageAssistant, + _models.RealtimeConversationItemFunctionCall, + _models.RealtimeConversationItemFunctionCallOutput, + _models.RealtimeMCPApprovalResponse, + Mapping[str, Any], +] + +# Every server event ``type`` string mapped to its generated model, used to deserialize +# inbound frames into strongly-typed objects. Event types not represented by a dedicated +# generated model in this package (for example ``conversation.created``) are intentionally +# left out here and fall back to a plain ``dict``, as do any newly-added service events. +_SERVER_EVENT_TYPES: Dict[str, Type[_Model]] = { + "conversation.item.added": _models.VoiceAgentServerEventConversationItemAdded, + "conversation.item.created": _models.VoiceAgentServerEventConversationItemCreated, + "conversation.item.deleted": _models.VoiceAgentServerEventConversationItemDeleted, + "conversation.item.done": _models.VoiceAgentServerEventConversationItemDone, + "conversation.item.input_audio_transcription.completed": ( + _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted + ), + "conversation.item.input_audio_transcription.delta": ( + _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta + ), + "conversation.item.input_audio_transcription.failed": ( + _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed + ), + "conversation.item.input_audio_transcription.segment": ( + _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment + ), + "conversation.item.retrieved": _models.VoiceAgentServerEventConversationItemRetrieved, + "conversation.item.truncated": _models.VoiceAgentServerEventConversationItemTruncated, + # Shared OpenAI-style Realtime error event (not voice-agent specific in this package). + "error": _models.RealtimeServerEventError, + "input_audio_buffer.cleared": _models.VoiceAgentServerEventInputAudioBufferCleared, + "input_audio_buffer.committed": _models.VoiceAgentServerEventInputAudioBufferCommitted, + "input_audio_buffer.speech_started": _models.VoiceAgentServerEventInputAudioBufferSpeechStarted, + "input_audio_buffer.speech_stopped": _models.VoiceAgentServerEventInputAudioBufferSpeechStopped, + "input_audio_buffer.timeout_triggered": (_models.VoiceAgentServerEventInputAudioBufferTimeoutTriggered), + "mcp_list_tools.completed": _models.VoiceAgentServerEventMcpListToolsCompleted, + "mcp_list_tools.failed": _models.VoiceAgentServerEventMcpListToolsFailed, + "mcp_list_tools.in_progress": _models.VoiceAgentServerEventMcpListToolsInProgress, + "output_audio_buffer.cleared": _models.VoiceAgentServerEventOutputAudioBufferCleared, + "rate_limits.updated": _models.VoiceAgentServerEventRateLimitsUpdated, + "response.animation_blendshapes.delta": (_models.VoiceAgentServerEventResponseAnimationBlendshapesDelta), + "response.animation_blendshapes.done": (_models.VoiceAgentServerEventResponseAnimationBlendshapesDone), + "response.animation_viseme.delta": _models.VoiceAgentServerEventResponseAnimationVisemeDelta, + "response.animation_viseme.done": _models.VoiceAgentServerEventResponseAnimationVisemeDone, + "response.audio_timestamp.delta": _models.VoiceAgentServerEventResponseAudioTimestampDelta, + "response.audio_timestamp.done": _models.VoiceAgentServerEventResponseAudioTimestampDone, + "response.content_part.added": _models.RealtimeServerEventResponseContentPartAdded, + "response.content_part.done": _models.VoiceAgentServerEventResponseContentPartDone, + "response.created": _models.VoiceAgentServerEventResponseCreated, + "response.done": _models.VoiceAgentServerEventResponseDone, + "response.function_call_arguments.delta": (_models.VoiceAgentServerEventResponseFunctionCallArgumentsDelta), + "response.function_call_arguments.done": (_models.VoiceAgentServerEventResponseFunctionCallArgumentsDone), + "response.mcp_call.completed": _models.VoiceAgentServerEventResponseMcpCallCompleted, + "response.mcp_call.failed": _models.VoiceAgentServerEventResponseMcpCallFailed, + "response.mcp_call.in_progress": _models.VoiceAgentServerEventResponseMcpCallInProgress, + "response.mcp_call_arguments.delta": _models.VoiceAgentServerEventResponseMcpCallArgumentsDelta, + "response.mcp_call_arguments.done": _models.VoiceAgentServerEventResponseMcpCallArgumentsDone, + "response.output_audio.delta": _models.VoiceAgentServerEventResponseAudioDelta, + "response.output_audio.done": _models.VoiceAgentServerEventResponseAudioDone, + "response.output_audio_transcript.delta": (_models.VoiceAgentServerEventResponseAudioTranscriptDelta), + "response.output_audio_transcript.done": (_models.VoiceAgentServerEventResponseAudioTranscriptDone), + "response.output_item.added": _models.VoiceAgentServerEventResponseOutputItemAdded, + "response.output_item.done": _models.VoiceAgentServerEventResponseOutputItemDone, + "response.output_text.delta": _models.VoiceAgentServerEventResponseTextDelta, + "response.output_text.done": _models.VoiceAgentServerEventResponseTextDone, + "response.video.delta": _models.VoiceAgentServerEventResponseVideoDelta, + "session.avatar.connecting": _models.VoiceAgentServerEventSessionAvatarConnecting, + "session.avatar.switch_to_idle": _models.VoiceAgentServerEventSessionAvatarSwitchToIdle, + "session.avatar.switch_to_speaking": _models.VoiceAgentServerEventSessionAvatarSwitchToSpeaking, + "session.created": _models.VoiceAgentServerEventSessionCreated, + "session.updated": _models.VoiceAgentServerEventSessionUpdated, + "warning": _models.VoiceAgentServerEventWarning, +} + +# Every generated server event model, for consumers that want a precise return type. +ServerEvent = Union[ + _models.RealtimeServerEventError, + _models.RealtimeServerEventResponseContentPartAdded, + _models.VoiceAgentServerEventConversationItemAdded, + _models.VoiceAgentServerEventConversationItemCreated, + _models.VoiceAgentServerEventConversationItemDeleted, + _models.VoiceAgentServerEventConversationItemDone, + _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted, + _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta, + _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed, + _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment, + _models.VoiceAgentServerEventConversationItemRetrieved, + _models.VoiceAgentServerEventConversationItemTruncated, + _models.VoiceAgentServerEventInputAudioBufferCleared, + _models.VoiceAgentServerEventInputAudioBufferCommitted, + _models.VoiceAgentServerEventInputAudioBufferSpeechStarted, + _models.VoiceAgentServerEventInputAudioBufferSpeechStopped, + _models.VoiceAgentServerEventInputAudioBufferTimeoutTriggered, + _models.VoiceAgentServerEventMcpListToolsCompleted, + _models.VoiceAgentServerEventMcpListToolsFailed, + _models.VoiceAgentServerEventMcpListToolsInProgress, + _models.VoiceAgentServerEventOutputAudioBufferCleared, + _models.VoiceAgentServerEventRateLimitsUpdated, + _models.VoiceAgentServerEventResponseAnimationBlendshapesDelta, + _models.VoiceAgentServerEventResponseAnimationBlendshapesDone, + _models.VoiceAgentServerEventResponseAnimationVisemeDelta, + _models.VoiceAgentServerEventResponseAnimationVisemeDone, + _models.VoiceAgentServerEventResponseAudioDelta, + _models.VoiceAgentServerEventResponseAudioDone, + _models.VoiceAgentServerEventResponseAudioTimestampDelta, + _models.VoiceAgentServerEventResponseAudioTimestampDone, + _models.VoiceAgentServerEventResponseAudioTranscriptDelta, + _models.VoiceAgentServerEventResponseAudioTranscriptDone, + _models.VoiceAgentServerEventResponseContentPartDone, + _models.VoiceAgentServerEventResponseCreated, + _models.VoiceAgentServerEventResponseDone, + _models.VoiceAgentServerEventResponseFunctionCallArgumentsDelta, + _models.VoiceAgentServerEventResponseFunctionCallArgumentsDone, + _models.VoiceAgentServerEventResponseMcpCallArgumentsDelta, + _models.VoiceAgentServerEventResponseMcpCallArgumentsDone, + _models.VoiceAgentServerEventResponseMcpCallCompleted, + _models.VoiceAgentServerEventResponseMcpCallFailed, + _models.VoiceAgentServerEventResponseMcpCallInProgress, + _models.VoiceAgentServerEventResponseOutputItemAdded, + _models.VoiceAgentServerEventResponseOutputItemDone, + _models.VoiceAgentServerEventResponseTextDelta, + _models.VoiceAgentServerEventResponseTextDone, + _models.VoiceAgentServerEventResponseVideoDelta, + _models.VoiceAgentServerEventSessionAvatarConnecting, + _models.VoiceAgentServerEventSessionAvatarSwitchToIdle, + _models.VoiceAgentServerEventSessionAvatarSwitchToSpeaking, + _models.VoiceAgentServerEventSessionCreated, + _models.VoiceAgentServerEventSessionUpdated, + _models.VoiceAgentServerEventWarning, + Mapping[str, Any], +] + + +def _to_ws_url(endpoint: str, agent_name: str) -> str: + """Build the realtime WebSocket URL from the HTTP project endpoint. + + :param str endpoint: The Foundry project endpoint (``https://.../api/projects/...``). + :param str agent_name: The name of the voice agent to connect to. + :return: A ``wss://``/``ws://`` URL targeting the realtime route. + :rtype: str + """ + base = endpoint.rstrip("/") + if base.startswith("https://"): + base = "wss://" + base[len("https://") :] + elif base.startswith("http://"): + base = "ws://" + base[len("http://") :] + return f"{base}/agents/{agent_name}/endpoint/protocols/voice" + + +class _BaseResource: # pylint: disable=too-few-public-methods + """Base helper that forwards typed helpers to the parent connection.""" + + def __init__(self, connection: "RealtimeConnection") -> None: + self._connection = connection + + def _send(self, event: ClientEvent) -> None: + self._connection.send(event) + + +class SessionResource(_BaseResource): + """Send ``session.*`` client events.""" + + def update( + self, + *, + session: Union["_models.VoiceAgentSessionUpdateConfig", Mapping[str, Any]], + event_id: Optional[str] = None, + ) -> None: + """Update the realtime session configuration. + + :keyword session: The session configuration to apply. + :paramtype session: ~azure.ai.projects.models.VoiceAgentSessionUpdateConfig or + Mapping[str, Any] + :keyword event_id: Optional client-generated ID used to identify this event. + :paramtype event_id: str or None + """ + self._send( + cast(Any, _models.VoiceAgentClientEventSessionUpdate)( + type=_models.RealtimeClientEventType.SESSION_UPDATE, + session=session, + event_id=event_id, + ) + ) + + def avatar_connect(self, *, client_sdp: str, event_id: Optional[str] = None) -> None: + """Negotiate an avatar media session over WebRTC. + + :keyword str client_sdp: The client's SDP offer for avatar media negotiation. + :keyword event_id: An optional client-generated event identifier. + :paramtype event_id: str or None + """ + self._send( + _models.VoiceAgentClientEventSessionAvatarConnect( + client_sdp=client_sdp, + event_id=event_id, + ) + ) + + +class InputAudioBufferResource(_BaseResource): + """Send ``input_audio_buffer.*`` client events.""" + + def append(self, *, audio: Union[str, bytes], event_id: Optional[str] = None) -> None: + """Append audio bytes to the input buffer. + + :keyword audio: Raw audio bytes, or an already base64-encoded string. + :paramtype audio: str or bytes + :keyword event_id: Optional client-generated ID used to identify this event. + :paramtype event_id: str or None + """ + if isinstance(audio, (bytes, bytearray)): + audio = base64.b64encode(bytes(audio)).decode("ascii") + self._send( + _models.VoiceAgentClientEventInputAudioBufferAppend( + type=_models.RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND, + audio=audio, + event_id=event_id, + ) + ) + + def commit(self, *, event_id: Optional[str] = None) -> None: + """Commit the buffered input audio as a user turn. + + :keyword event_id: Optional client-generated ID used to identify this event. + :paramtype event_id: str or None + """ + self._send( + _models.VoiceAgentClientEventInputAudioBufferCommit( + type=_models.RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT, event_id=event_id + ) + ) + + def clear(self, *, event_id: Optional[str] = None) -> None: + """Discard any buffered input audio. + + :keyword event_id: Optional client-generated ID used to identify this event. + :paramtype event_id: str or None + """ + self._send( + _models.VoiceAgentClientEventInputAudioBufferClear( + type=_models.RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR, event_id=event_id + ) + ) + + +class OutputAudioBufferResource(_BaseResource): # pylint: disable=too-few-public-methods + """Send ``output_audio_buffer.*`` client events.""" + + def clear(self, *, event_id: Optional[str] = None) -> None: + """Stop and clear any audio the service is currently playing back (barge-in). + + :keyword event_id: Optional client-generated ID used to identify this event. + :paramtype event_id: str or None + """ + self._send( + _models.VoiceAgentClientEventOutputAudioBufferClear( + type=_models.RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR, event_id=event_id + ) + ) + + +class ConversationItemResource(_BaseResource): + """Send ``conversation.item.*`` client events.""" + + def create( + self, + *, + item: ConversationItem, + previous_item_id: Optional[str] = None, + event_id: Optional[str] = None, + ) -> None: + """Insert an item into the conversation. + + :keyword item: The conversation item to create. + :paramtype item: ~azure.ai.projects.models.RealtimeConversationItemMessageSystem or + ~azure.ai.projects.models.RealtimeConversationItemMessageUser or + ~azure.ai.projects.models.RealtimeConversationItemMessageAssistant or + ~azure.ai.projects.models.RealtimeConversationItemFunctionCall or + ~azure.ai.projects.models.RealtimeConversationItemFunctionCallOutput or + ~azure.ai.projects.models.RealtimeMCPApprovalResponse or Mapping[str, Any] + :keyword previous_item_id: The ID of the preceding item after which the new item will be + inserted. Default value is None. + :paramtype previous_item_id: str or None + :keyword event_id: Optional client-generated ID used to identify this event. + :paramtype event_id: str or None + """ + self._send( + cast(Any, _models.VoiceAgentClientEventConversationItemCreate)( + type=_models.RealtimeClientEventType.CONVERSATION_ITEM_CREATE, + item=item, + previous_item_id=previous_item_id, + event_id=event_id, + ) + ) + + def delete(self, *, item_id: str, event_id: Optional[str] = None) -> None: + """Delete an item from the conversation. + + :keyword str item_id: The ID of the item to delete. + :keyword event_id: Optional client-generated ID used to identify this event. + :paramtype event_id: str or None + """ + self._send( + _models.VoiceAgentClientEventConversationItemDelete( + type=_models.RealtimeClientEventType.CONVERSATION_ITEM_DELETE, + item_id=item_id, + event_id=event_id, + ) + ) + + def retrieve(self, *, item_id: str, event_id: Optional[str] = None) -> None: + """Ask the server to emit a ``conversation.item.retrieved`` event for an item. + + :keyword str item_id: The ID of the item to retrieve. + :keyword event_id: Optional client-generated ID used to identify this event. + :paramtype event_id: str or None + """ + self._send( + _models.VoiceAgentClientEventConversationItemRetrieve( + type=_models.RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE, + item_id=item_id, + event_id=event_id, + ) + ) + + def truncate(self, *, item_id: str, content_index: int, audio_end_ms: int, event_id: Optional[str] = None) -> None: + """Truncate a previously produced assistant audio item (used for barge-in). + + :keyword str item_id: The ID of the assistant message item to truncate. + :keyword int content_index: The index of the content part to truncate. Use ``0``. + :keyword int audio_end_ms: The point, in milliseconds, to truncate the audio to. + :keyword event_id: Optional client-generated ID used to identify this event. + :paramtype event_id: str or None + """ + self._send( + _models.VoiceAgentClientEventConversationItemTruncate( + type=_models.RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE, + item_id=item_id, + content_index=content_index, + audio_end_ms=audio_end_ms, + event_id=event_id, + ) + ) + + +class ConversationResource(_BaseResource): # pylint: disable=too-few-public-methods + """Send ``conversation.*`` client events.""" + + def __init__(self, connection: "RealtimeConnection") -> None: + super().__init__(connection) + self.item: ConversationItemResource = ConversationItemResource(connection) + + +class ResponseResource(_BaseResource): + """Send ``response.*`` client events.""" + + def create( + self, + *, + response: Optional[Union["_models.VoiceAgentResponseCreateParams", Mapping[str, Any]]] = None, + event_id: Optional[str] = None, + ) -> None: + """Ask the model to generate a response. + + :keyword response: Optional per-response overrides. Default value is None. + :paramtype response: ~azure.ai.projects.models.VoiceAgentResponseCreateParams or + Mapping[str, Any] or None + :keyword event_id: Optional client-generated ID used to identify this event. + :paramtype event_id: str or None + """ + self._send( + cast(Any, _models.VoiceAgentClientEventResponseCreate)( + type=_models.RealtimeClientEventType.RESPONSE_CREATE, + response=response, + event_id=event_id, + ) + ) + + def cancel(self, *, response_id: Optional[str] = None, event_id: Optional[str] = None) -> None: + """Cancel an in-progress response. + + :keyword response_id: The ID of the response to cancel, if targeting a specific one. + Default value is None. + :paramtype response_id: str or None + :keyword event_id: Optional client-generated ID used to identify this event. + :paramtype event_id: str or None + """ + self._send( + _models.VoiceAgentClientEventResponseCancel( + type=_models.RealtimeClientEventType.RESPONSE_CANCEL, + response_id=response_id, + event_id=event_id, + ) + ) + + +class RealtimeConnection: # pylint: disable=too-many-instance-attributes + """An open realtime WebSocket connection to a voice agent. + + Iterate over the connection to receive strongly-typed server events, and use the + sub-namespaces to send strongly-typed client events:: + + with client.realtime.connect(agent_name="my-agent") as conn: + conn.input_audio_buffer.append(audio=chunk) + conn.input_audio_buffer.commit() + conn.response.create() + for event in conn: + if event.type == RealtimeServerEventType.RESPONSE_DONE: + break + """ + + def __init__(self, connection: "ClientConnection") -> None: + self._connection = connection + self._closed = False + self.session: SessionResource = SessionResource(self) + self.input_audio_buffer: InputAudioBufferResource = InputAudioBufferResource(self) + self.output_audio_buffer: OutputAudioBufferResource = OutputAudioBufferResource(self) + self.conversation: ConversationResource = ConversationResource(self) + self.response: ResponseResource = ResponseResource(self) + + def __enter__(self) -> "RealtimeConnection": + return self + + def __exit__(self, *exc_details: Any) -> None: + self.close() + + def __repr__(self) -> str: + state = "closed" if self.closed else "open" + return f"" + + @property + def closed(self) -> bool: + """Whether the underlying WebSocket connection has been closed. + + :rtype: bool + """ + return self._closed + + def __iter__(self) -> Iterator[ServerEvent]: + return self._iter() + + def _iter(self) -> Iterator[ServerEvent]: + while True: + try: + yield self.recv() + except ConnectionResetError: + return + + def recv(self) -> ServerEvent: + """Receive and parse the next server event. + + Known event types are returned as their strongly-typed + ``VoiceAgentServerEventXxx`` model. Event types not (yet) represented by a + generated model are returned as a plain ``dict`` for forward compatibility. + + :return: The parsed server event. + :rtype: ~azure.ai.projects.ServerEvent + :raises ConnectionResetError: If the connection was closed by the server. + """ + from websockets.exceptions import ConnectionClosed # pylint: disable=import-outside-toplevel + + try: + raw = self._connection.recv() + except ConnectionClosed as exc: + self._closed = True + raise ConnectionResetError("The realtime connection was closed.") from exc + data = raw.decode("utf-8") if isinstance(raw, (bytes, bytearray)) else raw + payload: Dict[str, Any] = json.loads(data) + event_type = payload.get("type") + if not isinstance(event_type, str): + return payload + event_cls = _SERVER_EVENT_TYPES.get(event_type) + if event_cls is None: + return payload + return event_cls(payload) + + def send(self, event: ClientEvent) -> None: + """Send a client event over the connection. + + :param event: A strongly-typed client event, a ready-made mapping, or a raw JSON string. + :type event: ~azure.ai.projects.ClientEvent or str + :raises ValueError: If ``event`` is a ``str`` that is not valid JSON. + """ + if isinstance(event, str): + try: + json.loads(event) + except ValueError as exc: + raise ValueError(f"'event' is not valid JSON: {exc}") from exc + payload = event + else: + payload = json.dumps(event, cls=SdkJSONEncoder) + self._connection.send(payload) + + def close(self, *, code: int = 1000, reason: str = "") -> None: + """Close the connection. + + :keyword int code: The WebSocket close code. + :keyword str reason: The close reason. + """ + if self._closed: + return + try: + self._connection.close(code=code, reason=reason) + finally: + self._closed = True + + +class RealtimeConnectionManager: # pylint: disable=too-many-instance-attributes + """Context manager that opens a :class:`RealtimeConnection`. + + Returned by :meth:`Realtime.connect`; you normally use it as + ``with client.realtime.connect(...) as conn:``. + """ + + def __init__( # pylint: disable=too-many-arguments + self, + *, + endpoint: str, + credential: "TokenCredential", + credential_scopes: List[str], + api_version: str, + agent_name: str, + foundry_features: str, + agent_session_id: Optional[str] = None, + agent_version_override: Optional[str] = None, + structured_inputs: Optional[str] = None, + connection_url: Optional[str] = None, + extra_query: Optional[Mapping[str, str]] = None, + extra_headers: Optional[Mapping[str, str]] = None, + **kwargs: Any, + ) -> None: + self._endpoint = endpoint + self._credential = credential + self._credential_scopes = credential_scopes + self._api_version = api_version + self._agent_name = agent_name + self._foundry_features = foundry_features + self._agent_session_id = agent_session_id + self._agent_version_override = agent_version_override + self._structured_inputs = structured_inputs + self._connection_url = connection_url + self._extra_query = dict(extra_query or {}) + self._extra_headers = dict(extra_headers or {}) + self._kwargs = kwargs + self._connection: Optional[RealtimeConnection] = None + + def __enter__(self) -> RealtimeConnection: + return self.enter() + + def enter(self) -> RealtimeConnection: # pylint: disable=too-many-locals + """Open the connection. + + :return: The live realtime connection. + :rtype: ~azure.ai.projects.RealtimeConnection + :raises RuntimeError: If ``websockets`` is not installed. + :raises ValueError: If the computed or supplied WebSocket URL does not use ``wss://``. + :raises ConnectionError: If the WebSocket upgrade handshake fails (for example, a + network error, DNS failure, or a non-101 response from the service). + """ + try: + from websockets.sync.client import connect as _ws_connect # pylint: disable=import-outside-toplevel + except ImportError as exc: # pragma: no cover - dependency guard + raise RuntimeError( + "The realtime client requires `websockets`. Install it with `pip install websockets`." + ) from exc + + # ``connection_url`` fully overrides the computed route (scheme/host/path). This is the + # escape hatch used to reach a specific data-plane host/path directly. + url = self._connection_url or _to_ws_url(self._endpoint, self._agent_name) + if not url.startswith("wss://"): + raise ValueError("The realtime WebSocket URL must use wss:// to protect credentials in transit.") + + params: Dict[str, str] = {"api-version": self._api_version} + if self._agent_session_id is not None: + params["agent_session_id"] = self._agent_session_id + if self._agent_version_override is not None: + params["x-agent-version-override"] = self._agent_version_override + params.update(self._extra_query) + + full_url = f"{url}?{urlencode(params)}" if params else url + + token = self._credential.get_token(*self._credential_scopes) + headers: Dict[str, str] = { + "Authorization": f"Bearer {token.token}", + _FOUNDRY_FEATURES_HEADER_NAME: self._foundry_features, + } + if self._structured_inputs is not None: + headers["x-ms-voice-structured-inputs"] = self._structured_inputs + headers.update(self._extra_headers) + + try: + connection = _ws_connect( + full_url, + additional_headers=headers, + subprotocols=["realtime"], + **self._kwargs, + ) + except BaseException as exc: + if isinstance(exc, (ValueError, RuntimeError)): + raise + raise ConnectionError( + f"Failed to open the realtime WebSocket connection to voice agent " + f"'{self._agent_name}' at '{url}': {exc}" + ) from exc + self._connection = RealtimeConnection(connection) + return self._connection + + def __exit__(self, *exc_details: Any) -> None: + if self._connection is not None: + self._connection.close() + self._connection = None + + +class Realtime: # pylint: disable=too-few-public-methods + """Realtime streaming entry point, exposed as ``client.realtime``. + + Follows the OpenAI Python realtime surface: obtain it from the HTTP client and open a + connection with :meth:`connect`:: + + from azure.ai.projects import AIProjectClient + from azure.identity import DefaultAzureCredential + + client = AIProjectClient(endpoint, DefaultAzureCredential()) + with client.realtime.connect(agent_name="my-agent") as conn: + conn.input_audio_buffer.append(audio=chunk) + conn.input_audio_buffer.commit() + conn.response.create() + for event in conn: + if event.type == RealtimeServerEventType.RESPONSE_DONE: + break + + :param client: The HTTP client whose endpoint and credential are reused for the realtime + handshake. + :type client: ~azure.ai.projects.AIProjectClient + """ + + def __init__(self, client: "AIProjectClient") -> None: + self._config = client._config # pylint: disable=protected-access + + def connect( # pylint: disable=too-many-arguments + self, + *, + agent_name: str, + foundry_features: str = _VOICE_AGENT_FEATURE_HEADER, + agent_session_id: Optional[str] = None, + agent_version_override: Optional[str] = None, + structured_inputs: Optional[str] = None, + connection_url: Optional[str] = None, + api_version: Optional[str] = None, + credential_scopes: Optional[List[str]] = None, + extra_query: Optional[Mapping[str, str]] = None, + extra_headers: Optional[Mapping[str, str]] = None, + **kwargs: Any, + ) -> RealtimeConnectionManager: + """Open a realtime WebSocket connection to a voice agent. + + :keyword str agent_name: The name of the voice agent to connect to. + :keyword foundry_features: Preview opt-in value(s) for the ``Foundry-Features`` header. + Defaults to ``VoiceAgents=V1Preview``. Pass a comma-separated value to opt in to + additional preview features on the same request. + :paramtype foundry_features: str + :keyword agent_session_id: An optional identifier used to correlate the voice session. + Default value is None. + :paramtype agent_session_id: str or None + :keyword agent_version_override: Selects a specific version of the voice agent for this + session. Default value is None. + :paramtype agent_version_override: str or None + :keyword structured_inputs: A JSON object that maps structured-input names to their + values for this session. Default value is None. + :paramtype structured_inputs: str or None + :keyword connection_url: Full ``wss://``/``ws://`` URL that overrides the route computed + from the client endpoint. Query parameters are still appended. Default value is None. + :paramtype connection_url: str or None + :keyword api_version: Overrides the client's API version for the handshake. Default + value is None. + :paramtype api_version: str or None + :keyword credential_scopes: Overrides the client's token scopes for the handshake. + Default value is None. + :paramtype credential_scopes: list[str] or None + :keyword extra_query: Additional query-string parameters for the handshake. + :paramtype extra_query: Mapping[str, str] or None + :keyword extra_headers: Additional headers for the handshake. + :paramtype extra_headers: Mapping[str, str] or None + :return: A context manager yielding a :class:`RealtimeConnection`. + :rtype: ~azure.ai.projects.RealtimeConnectionManager + """ + return RealtimeConnectionManager( + endpoint=self._config.endpoint, + credential=self._config.credential, + credential_scopes=credential_scopes or self._config.credential_scopes, + api_version=api_version or self._config.api_version, + agent_name=agent_name, + foundry_features=foundry_features, + agent_session_id=agent_session_id, + agent_version_override=agent_version_override, + structured_inputs=structured_inputs, + connection_url=connection_url, + extra_query=extra_query, + extra_headers=extra_headers, + **kwargs, + ) 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 71f1e68a4552..d11228d5304f 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_unions.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_unions.py @@ -32,7 +32,7 @@ "_models.RealtimeConversationItemFunctionCallOutput", ] VoiceAgentCreateConversationItem = Union[ - VoiceAgentRequestConversationItem, "_models.RealtimeMCPApprovalResponse" + "_unions.VoiceAgentRequestConversationItem", "_models.RealtimeMCPApprovalResponse" ] VoiceAgentResponseMessageItem = Union[ "_models.RealtimeConversationItemMessageSystem", @@ -40,7 +40,7 @@ "_models.RealtimeConversationItemMessageAssistant", ] VoiceAgentResponseItem = Union[ - VoiceAgentResponseMessageItem, + "_unions.VoiceAgentResponseMessageItem", "_models.VoiceFunctionCallItem", "_models.VoiceFunctionCallOutputItem", "_models.VoiceMcpListToolsItem", diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/utils.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/utils.py index c91d6470e2bf..9ebe3cda3180 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/utils.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/utils.py @@ -11,6 +11,7 @@ from .._utils.model_base import Model, SdkJSONEncoder + # file-like tuple could be `(filename, IO (or bytes))` or `(filename, IO (or bytes), content_type)` FileContent = Union[str, bytes, IO[str], IO[bytes]] diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py index e45396ddee57..6ff9eeda83e6 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py @@ -129,20 +129,14 @@ "input_audio_buffer.committed": _models.VoiceAgentServerEventInputAudioBufferCommitted, "input_audio_buffer.speech_started": _models.VoiceAgentServerEventInputAudioBufferSpeechStarted, "input_audio_buffer.speech_stopped": _models.VoiceAgentServerEventInputAudioBufferSpeechStopped, - "input_audio_buffer.timeout_triggered": ( - _models.VoiceAgentServerEventInputAudioBufferTimeoutTriggered - ), + "input_audio_buffer.timeout_triggered": (_models.VoiceAgentServerEventInputAudioBufferTimeoutTriggered), "mcp_list_tools.completed": _models.VoiceAgentServerEventMcpListToolsCompleted, "mcp_list_tools.failed": _models.VoiceAgentServerEventMcpListToolsFailed, "mcp_list_tools.in_progress": _models.VoiceAgentServerEventMcpListToolsInProgress, "output_audio_buffer.cleared": _models.VoiceAgentServerEventOutputAudioBufferCleared, "rate_limits.updated": _models.VoiceAgentServerEventRateLimitsUpdated, - "response.animation_blendshapes.delta": ( - _models.VoiceAgentServerEventResponseAnimationBlendshapesDelta - ), - "response.animation_blendshapes.done": ( - _models.VoiceAgentServerEventResponseAnimationBlendshapesDone - ), + "response.animation_blendshapes.delta": (_models.VoiceAgentServerEventResponseAnimationBlendshapesDelta), + "response.animation_blendshapes.done": (_models.VoiceAgentServerEventResponseAnimationBlendshapesDone), "response.animation_viseme.delta": _models.VoiceAgentServerEventResponseAnimationVisemeDelta, "response.animation_viseme.done": _models.VoiceAgentServerEventResponseAnimationVisemeDone, "response.audio_timestamp.delta": _models.VoiceAgentServerEventResponseAudioTimestampDelta, @@ -151,12 +145,8 @@ "response.content_part.done": _models.VoiceAgentServerEventResponseContentPartDone, "response.created": _models.VoiceAgentServerEventResponseCreated, "response.done": _models.VoiceAgentServerEventResponseDone, - "response.function_call_arguments.delta": ( - _models.VoiceAgentServerEventResponseFunctionCallArgumentsDelta - ), - "response.function_call_arguments.done": ( - _models.VoiceAgentServerEventResponseFunctionCallArgumentsDone - ), + "response.function_call_arguments.delta": (_models.VoiceAgentServerEventResponseFunctionCallArgumentsDelta), + "response.function_call_arguments.done": (_models.VoiceAgentServerEventResponseFunctionCallArgumentsDone), "response.mcp_call.completed": _models.VoiceAgentServerEventResponseMcpCallCompleted, "response.mcp_call.failed": _models.VoiceAgentServerEventResponseMcpCallFailed, "response.mcp_call.in_progress": _models.VoiceAgentServerEventResponseMcpCallInProgress, @@ -164,12 +154,8 @@ "response.mcp_call_arguments.done": _models.VoiceAgentServerEventResponseMcpCallArgumentsDone, "response.output_audio.delta": _models.VoiceAgentServerEventResponseAudioDelta, "response.output_audio.done": _models.VoiceAgentServerEventResponseAudioDone, - "response.output_audio_transcript.delta": ( - _models.VoiceAgentServerEventResponseAudioTranscriptDelta - ), - "response.output_audio_transcript.done": ( - _models.VoiceAgentServerEventResponseAudioTranscriptDone - ), + "response.output_audio_transcript.delta": (_models.VoiceAgentServerEventResponseAudioTranscriptDelta), + "response.output_audio_transcript.done": (_models.VoiceAgentServerEventResponseAudioTranscriptDone), "response.output_item.added": _models.VoiceAgentServerEventResponseOutputItemAdded, "response.output_item.done": _models.VoiceAgentServerEventResponseOutputItemDone, "response.output_text.delta": _models.VoiceAgentServerEventResponseTextDelta, @@ -470,9 +456,7 @@ class ResponseResource(_BaseResource): async def create( self, *, - response: Optional[ - Union["_models.VoiceAgentResponseCreateParams", Mapping[str, Any]] - ] = None, + response: Optional[Union["_models.VoiceAgentResponseCreateParams", Mapping[str, Any]]] = None, event_id: Optional[str] = None, ) -> None: """Ask the model to generate a response. @@ -491,9 +475,7 @@ async def create( ) ) - async def cancel( - self, *, response_id: Optional[str] = None, event_id: Optional[str] = None - ) -> None: + async def cancel(self, *, response_id: Optional[str] = None, event_id: Optional[str] = None) -> None: """Cancel an in-progress response. :keyword response_id: The ID of the response to cancel, if targeting a specific one. @@ -691,9 +673,7 @@ async def enter(self) -> AsyncRealtimeConnection: # pylint: disable=too-many-lo # escape hatch used to reach a specific data-plane host/path directly. url = self._connection_url or _to_ws_url(self._endpoint, self._agent_name) if not url.startswith("wss://"): - raise ValueError( - "The realtime WebSocket URL must use wss:// to protect credentials in transit." - ) + raise ValueError("The realtime WebSocket URL must use wss:// to protect credentials in transit.") params: Dict[str, str] = {"api-version": self._api_version} if self._agent_session_id is not None: @@ -714,9 +694,7 @@ async def enter(self) -> AsyncRealtimeConnection: # pylint: disable=too-many-lo session = aiohttp.ClientSession() try: - connection = await session.ws_connect( - url, headers=headers, params=params, **self._kwargs - ) + connection = await session.ws_connect(url, headers=headers, params=params, **self._kwargs) except BaseException as exc: await session.close() if isinstance(exc, (ValueError, RuntimeError)): @@ -725,9 +703,7 @@ async def enter(self) -> AsyncRealtimeConnection: # pylint: disable=too-many-lo f"Failed to open the realtime WebSocket connection to voice agent " f"'{self._agent_name}' at '{url}': {exc}" ) from exc - self._connection = AsyncRealtimeConnection( - cast("ClientWebSocketResponse", connection), session - ) + self._connection = AsyncRealtimeConnection(cast("ClientWebSocketResponse", connection), session) return self._connection async def __aexit__(self, *exc_details: Any) -> None: 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 28d8e51a6f0e..b7ba89954b9a 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 @@ -2287,23 +2287,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. @@ -2345,7 +2351,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/operations/_operations.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py index 67bad4f5bbe3..464b25ad284a 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 @@ -6142,23 +6142,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. @@ -6200,7 +6206,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/azure/ai/projects/types.py b/sdk/ai/azure-ai-projects/azure/ai/projects/types.py index bad33838f680..a3e0a6c42ab2 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/types.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/types.py @@ -63,6 +63,7 @@ from . import _unions from .models import ( AgentEndpointProtocol, + AgentKind, AttackStrategy, AzureAISearchQueryType, CallableToolAllowedCaller, diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py new file mode 100644 index 000000000000..6f92a340fe11 --- /dev/null +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py @@ -0,0 +1,240 @@ +# pylint: disable=line-too-long,useless-suppression +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +""" +DESCRIPTION: + End-to-end typed conversation against an existing voice agent, using the + ``client.realtime`` namespace added on top of the generated + azure-ai-projects client (see ``azure.ai.projects.Realtime``). + + 1. Hold a typed, multi-turn conversation: each prompt is sent as a + ``RealtimeConversationItemMessageUser`` and the reply streams back as + typed audio and transcript events. Blank line (or ``exit`` / ``quit``) + ends it. + 2. Read the persisted conversation back (requires the agent to have been + created with `store=True`; see sample_voice_agent_basic.py). + + Reply audio is PCM16, mono, 24 kHz and plays through the speakers when + ``pyaudio`` is installed; runs headless otherwise. For a hands-free mic + conversation with barge-in, see sample_voice_agent_live_audio_conversation_async.py + (that sample needs concurrent send/receive so it stays async-only; see + sample_voice_agent_live_text_conversation_async.py for the async version of + this one). + + pip install "azure-ai-projects>=2.0.0" azure-identity websockets pyaudio + +USAGE: + python sample_voice_agent_live_text_conversation.py + + Environment variables: + 1) FOUNDRY_PROJECT_ENDPOINT (required) - Foundry project endpoint: + https://.services.ai.azure.com/api/projects/ + 2) FOUNDRY_VOICE_AGENT_NAME (required) - name of an existing voice agent to + converse with (created with `store=True` to persist conversations; see + sample_voice_agent_basic.py). + + Authenticates with DefaultAzureCredential, so sign in first (e.g. `az login`). +""" + +import os +from typing import Final, Optional + +from azure.core.exceptions import HttpResponseError +from azure.identity import DefaultAzureCredential +from azure.ai.projects import AIProjectClient +from azure.ai.projects.models import ( + RealtimeConversationItemMessageUser, + RealtimeConversationItemMessageUserContent, + VoiceAgentServerEventResponseAudioDelta, + VoiceAgentServerEventResponseAudioTranscriptDone, + VoiceAgentServerEventResponseDone, + RealtimeServerEventError, +) + +# Seconds to wait for the agent to finish its reply. +_RESPONSE_TIMEOUT: Final = 45 + +# Reply audio format: PCM16, mono, 24 kHz. +_SAMPLE_RATE: Final = 24000 + +try: + import pyaudio # type: ignore[import-not-found] +except ImportError: # pragma: no cover - optional playback dependency + pyaudio = None # type: ignore[assignment] + + +class _SpeakerPlayer: + """Play streamed PCM16 audio through the speakers with pyaudio. + + Optional: without pyaudio the player is a no-op and the sample still runs + headless, reporting how much audio it received. + """ + + def __init__(self) -> None: + self._audio = None + self._stream = None + self._bytes = 0 + if pyaudio is not None: + self._audio = pyaudio.PyAudio() + self._stream = self._audio.open( + format=pyaudio.paInt16, + channels=1, + rate=_SAMPLE_RATE, + output=True, + ) + + @property + def enabled(self) -> bool: + return self._stream is not None + + def play(self, pcm: bytes) -> None: + """Write one decoded PCM16 chunk to the speaker. + + :param pcm: Decoded PCM16 audio bytes. + :type pcm: bytes + """ + self._bytes += len(pcm) + if self._stream is not None: + self._stream.write(pcm) + + def close(self) -> None: + """Drain and release the audio device.""" + if self._stream is not None: + self._stream.stop_stream() + self._stream.close() + self._stream = None + if self._audio is not None: + self._audio.terminate() + self._audio = None + + @property + def seconds(self) -> float: + """Total audio received, in seconds (PCM16 = 2 bytes/sample). + + :rtype: float + """ + return self._bytes / 2 / _SAMPLE_RATE + + +def _run_text_conversation(client: AIProjectClient, agent_name: str) -> Optional[str]: + """Hold a typed, multi-turn conversation. + + :param client: The Foundry project client. + :param agent_name: The existing voice agent name. + :type client: ~azure.ai.projects.AIProjectClient + :type agent_name: str + :return: The persisted conversation id, if one is created. + :rtype: str or None + """ + conversation_id: Optional[str] = None + audio_delta_count = 0 + player = _SpeakerPlayer() + played = False + + try: + # Open the realtime session on the voice agent's dedicated route. + with client.realtime.connect(agent_name=agent_name) as conn: + print("Type a message and press Enter. Blank line (or 'exit') ends the session.") + + def pump() -> None: + nonlocal conversation_id, audio_delta_count + for event in conn: + if isinstance(event, VoiceAgentServerEventResponseDone): + conversation_id = event.response.conversation_id or conversation_id + return + if isinstance(event, RealtimeServerEventError): + print(f"Session error: {event.error.message}") + return + if isinstance(event, VoiceAgentServerEventResponseAudioDelta): + # Each delta is a decoded PCM16 chunk; play it. + audio_delta_count += 1 + player.play(event.delta) + elif isinstance(event, VoiceAgentServerEventResponseAudioTranscriptDone): + print(f"Agent: {event.transcript}") + + while True: + prompt = input("You: ").strip() + if not prompt or prompt.lower() in ("exit", "quit"): + break + + # Send the turn and ask the agent to respond. + conn.conversation.item.create( + item=RealtimeConversationItemMessageUser( + content=[RealtimeConversationItemMessageUserContent(type="input_text", text=prompt)] + ) + ) + conn.response.create() + pump() + except KeyboardInterrupt: + print("\n(ending session...)") + finally: + played = player.enabled + player.close() + + detail = "played" if played else "received" + print(f"(streamed {audio_delta_count} audio chunks, {detail} {player.seconds:.2f}s of audio)") + if not played: + print("(install pyaudio to hear the reply: pip install pyaudio)") + return conversation_id + + +def _read_conversation(client: AIProjectClient, agent_name: str, conversation_id: str) -> None: + """Read the persisted conversation back over the read-only conversation API. + + :param client: The Foundry project client. + :param agent_name: The voice agent name. + :param conversation_id: The persisted conversation id. + :type client: ~azure.ai.projects.AIProjectClient + :type agent_name: str + :type conversation_id: str + """ + conversations = client.agent_endpoint_conversations + + conversation = conversations.get_agent_conversation(agent_name, conversation_id) + print(f"Conversation {conversation.id}: status={conversation.status}, created_at={conversation.created_at}") + + print("Items (transcript):") + for item in conversations.list_agent_conversation_items(agent_name, conversation_id): + role = item.get("role") or item.get("type") + # Audio turns expose ``transcript``; text turns expose ``text``. + parts = [(part.get("transcript") or part.get("text") or "").strip() for part in (item.get("content") or [])] + transcript = " ".join(p for p in parts if p) + print(f" - {role} id={item.get('id')}") + if transcript: + print(f" {transcript}") + + +def text_conversation() -> None: + endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] + agent_name = os.environ["FOUNDRY_VOICE_AGENT_NAME"] + + with ( + DefaultAzureCredential() as credential, + AIProjectClient(endpoint=endpoint, credential=credential) as project_client, + ): + try: + # 1) Hold the realtime conversation against the existing agent. + print(f"Starting realtime session with agent: {agent_name}") + conversation_id = _run_text_conversation(project_client, agent_name) + + # 2) Read the persisted conversation back. + if conversation_id: + print(f"Reading persisted conversation {conversation_id}...") + try: + _read_conversation(project_client, agent_name, conversation_id) + except HttpResponseError as e: + print(f"Could not read conversation: {e.status_code} {e.reason}") + else: + print("No conversation id was returned; nothing to read.") + except HttpResponseError as e: + print(f"Service responded with an error: {e.status_code} {e.reason}") + + +if __name__ == "__main__": + try: + text_conversation() + except KeyboardInterrupt: + print("\nInterrupted.") From 294a250fde34bcb7519baf12e123203a35480f00 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Mon, 17 Aug 2026 12:37:42 -0700 Subject: [PATCH 23/56] fix pylint --- .../azure/ai/projects/_patch.py | 8 +++ .../azure/ai/projects/aio/_patch.py | 65 +++++++++++++++++++ .../azure/ai/projects/models/_patch.py | 4 +- .../agents/voice/sample_voice_agent_basic.py | 2 +- .../voice/sample_voice_agent_basic_async.py | 2 +- .../voice/sample_voice_agent_generate.py | 2 +- .../voice/sample_voice_agent_versions.py | 2 +- .../voice/sample_voice_agent_with_tools.py | 2 +- 8 files changed, 79 insertions(+), 8 deletions(-) diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py index 5c804a5ca390..00cdc934c91d 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py @@ -19,6 +19,8 @@ from azure.identity import get_bearer_token_provider from ._client import AIProjectClient as AIProjectClientGenerated from .operations import TelemetryOperations +from .operations._patch import _OperationMethodHeaderProxy +from .models._enums import _AgentDefinitionOptInKeys from .models._patch import _BETA_OPERATION_FEATURE_HEADERS, _FOUNDRY_FEATURES_HEADER_NAME, _has_header_case_insensitive from ._realtime import ( Realtime, @@ -248,6 +250,12 @@ def __init__( self.telemetry = TelemetryOperations(self) # type: ignore self._realtime: Optional[Realtime] = None + # Voice-agent conversation reads require the VoiceAgents=V1Preview opt-in header, which + # isn't part of the standard agent preview headers; inject it transparently. + self.agent_endpoint_conversations = _OperationMethodHeaderProxy( # type: ignore + self.agent_endpoint_conversations, + _AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.value, + ) @property def realtime(self) -> Realtime: diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py index cbe16ebc39d3..5d18e112fbef 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py @@ -10,6 +10,7 @@ import os import logging +from functools import wraps from typing import List, Any, Optional, cast import httpx # pylint: disable=networking-import-outside-azure-core-transport from openai import AsyncOpenAI, DefaultAsyncHttpxClient @@ -28,6 +29,9 @@ ) from ._client import AIProjectClient as AIProjectClientGenerated from .operations import TelemetryOperations +from ..operations._patch import _OperationMethodHeaderProxy, _method_accepts_keyword_headers +from ..models._enums import _AgentDefinitionOptInKeys +from ..models._patch import _has_header_case_insensitive from ._realtime import ( AsyncRealtime, AsyncRealtimeConnection, @@ -41,6 +45,54 @@ logger = logging.getLogger(__name__) _openai_transport_logger = logging.getLogger(_OPENAI_TRANSPORT_LOGGER_NAME) +# Workaround for a known azure-core/aiohttp issue where compressed (e.g. gzip/brotli) response +# bodies on some non-2xx or write (POST/PATCH/DELETE) calls can reach text/JSON deserialization +# before being decompressed, causing a spurious UnicodeDecodeError. Forcing "Accept-Encoding: +# identity" disables response compression for the affected operation groups so the response body +# is never compressed in the first place. This is scoped narrowly (not applied client-wide) to +# avoid unnecessarily disabling compression on unaffected operations. +_ACCEPT_ENCODING_HEADER_NAME = "Accept-Encoding" +_ACCEPT_ENCODING_IDENTITY_VALUE = "identity" + + +class _AcceptEncodingIdentityProxy: + """Proxy that forces 'Accept-Encoding: identity' on public operation method calls. + + Works around a known async aiohttp transport issue where compressed response bodies can be + handed to text/JSON deserialization before decompression, raising a spurious + UnicodeDecodeError. + """ + + def __init__(self, operation: Any): + object.__setattr__(self, "_operation", operation) + + def __getattr__(self, name: str) -> Any: + attribute = getattr(self._operation, name) + + if name.startswith("_") or not callable(attribute) or not _method_accepts_keyword_headers(attribute): + return attribute + + @wraps(attribute) + def _wrapped(*args: Any, **kwargs: Any) -> Any: + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_ACCEPT_ENCODING_HEADER_NAME: _ACCEPT_ENCODING_IDENTITY_VALUE} + elif not _has_header_case_insensitive(headers, _ACCEPT_ENCODING_HEADER_NAME): + try: + headers[_ACCEPT_ENCODING_HEADER_NAME] = _ACCEPT_ENCODING_IDENTITY_VALUE + except Exception: # pylint: disable=broad-except + kwargs["headers"] = {_ACCEPT_ENCODING_HEADER_NAME: _ACCEPT_ENCODING_IDENTITY_VALUE} + + return attribute(*args, **kwargs) + + return _wrapped + + def __dir__(self) -> list: + return dir(self._operation) + + def __setattr__(self, name: str, value: Any) -> None: + setattr(self._operation, name, value) + class AIProjectClient(AIProjectClientGenerated): # pylint: disable=too-many-instance-attributes """AIProjectClient. @@ -129,6 +181,19 @@ def __init__( self.telemetry = TelemetryOperations(self) # type: ignore self._realtime: Optional[AsyncRealtime] = None + # Voice-agent conversation reads require the VoiceAgents=V1Preview opt-in header, which + # isn't part of the standard agent preview headers; inject it transparently. + self.agent_endpoint_conversations = _OperationMethodHeaderProxy( # type: ignore + self.agent_endpoint_conversations, + _AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.value, + ) + # Work around a known async aiohttp transport issue (spurious UnicodeDecodeError caused by + # compressed response bodies reaching text/JSON deserialization before decompression) by + # disabling response compression for these two operation groups only. + self.agents = _AcceptEncodingIdentityProxy(self.agents) # type: ignore + self.agent_endpoint_conversations = _AcceptEncodingIdentityProxy( # type: ignore + self.agent_endpoint_conversations + ) @property def realtime(self) -> AsyncRealtime: 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 a3624bd63dc5..12c590316275 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 @@ -49,10 +49,8 @@ [ _AgentDefinitionOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW.value, _AgentDefinitionOptInKeys.EXTERNAL_AGENTS_V1_PREVIEW.value, + _AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.value, _AgentDefinitionOptInKeys.DRAFT_AGENTS_V1_PREVIEW.value, - # NOTE: VOICE_AGENTS_V1_PREVIEW is intentionally excluded here for now. The service - # API for voice agents is not yet ready, and recorded tests were captured without this - # opt-in value. Re-add it once the service is ready and recordings can be refreshed. _FoundryFeaturesOptInKeys.AGENTS_OPTIMIZATION_V2_PREVIEW.value, ] ) diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_basic.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_basic.py index 52685986f538..6ee1f059f4eb 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_basic.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_basic.py @@ -51,7 +51,7 @@ with ( DefaultAzureCredential() as credential, - AIProjectClient(endpoint=endpoint, credential=credential) as project_client, + AIProjectClient(endpoint=endpoint, credential=credential, allow_preview=True) as project_client, ): try: definition = VoiceAgentDefinition( diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_basic_async.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_basic_async.py index 28aee34389f3..8f17aba4dd2c 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_basic_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_basic_async.py @@ -43,7 +43,7 @@ async def main() -> None: async with ( DefaultAzureCredential() as credential, - AIProjectClient(endpoint=endpoint, credential=credential) as project_client, + AIProjectClient(endpoint=endpoint, credential=credential, allow_preview=True) as project_client, ): try: created_version = await project_client.agents.create_version( diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_generate.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_generate.py index c101841ba538..9f3e23a0f771 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_generate.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_generate.py @@ -34,7 +34,7 @@ with ( DefaultAzureCredential() as credential, - AIProjectClient(endpoint=endpoint, credential=credential) as project_client, + AIProjectClient(endpoint=endpoint, credential=credential, allow_preview=True) as project_client, ): agent = project_client.agents.generate_agent(kind="voice") print(f"Generated voice agent: {agent.name}") diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_versions.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_versions.py index 7c1f4070cb23..0c373c780988 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_versions.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_versions.py @@ -44,7 +44,7 @@ def make_definition(instructions: str) -> VoiceAgentDefinition: with ( DefaultAzureCredential() as credential, - AIProjectClient(endpoint=endpoint, credential=credential) as project_client, + AIProjectClient(endpoint=endpoint, credential=credential, allow_preview=True) as project_client, ): try: # Create the initial agent (this is version 1). diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_with_tools.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_with_tools.py index 5964f6e5040b..5cf3040ca401 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_with_tools.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_with_tools.py @@ -128,7 +128,7 @@ with ( DefaultAzureCredential() as credential, - AIProjectClient(endpoint=endpoint, credential=credential) as project_client, + AIProjectClient(endpoint=endpoint, credential=credential, allow_preview=True) as project_client, ): try: created_version = project_client.agents.create_version(agent_name=agent_name, definition=definition) From 0f705251ca9787d169276b81ff39682d66c409e1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 17 Aug 2026 20:03:08 +0000 Subject: [PATCH 24/56] Update azure-ai-projects api.md and api.metadata.yml for sync Realtime APIs Co-authored-by: xitzhang <11403681+xitzhang@users.noreply.github.com> --- sdk/ai/azure-ai-projects/api.md | 66 +++++++++++++++++++++++ sdk/ai/azure-ai-projects/api.metadata.yml | 2 +- 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/sdk/ai/azure-ai-projects/api.md b/sdk/ai/azure-ai-projects/api.md index 741f28cad5b2..935dfa2186ee 100644 --- a/sdk/ai/azure-ai-projects/api.md +++ b/sdk/ai/azure-ai-projects/api.md @@ -2,6 +2,7 @@ namespace azure.ai.projects class azure.ai.projects.AIProjectClient(AIProjectClientGenerated): implements ContextManager + property realtime: Realtime # Read-only agents: AgentsOperations beta: BetaOperations connections: ConnectionsOperations @@ -41,6 +42,71 @@ namespace azure.ai.projects ) -> HttpResponse: ... + class azure.ai.projects.Realtime: + + def __init__(self, client: AIProjectClient) -> None: ... + + def connect( + self, + *, + agent_name: str, + agent_session_id: Optional[str] = ..., + agent_version_override: Optional[str] = ..., + api_version: Optional[str] = ..., + connection_url: Optional[str] = ..., + credential_scopes: Optional[List[str]] = ..., + extra_headers: Optional[Mapping[str, str]] = ..., + extra_query: Optional[Mapping[str, str]] = ..., + foundry_features: str = _VOICE_AGENT_FEATURE_HEADER, + structured_inputs: Optional[str] = ..., + **kwargs: Any + ) -> RealtimeConnectionManager: ... + + + class azure.ai.projects.RealtimeConnection: implements ContextManager + property closed: bool # Read-only + + def __init__(self, connection: ClientConnection) -> None: ... + + def __iter__(self) -> Iterator[ServerEvent]: ... + + def __repr__(self) -> str: ... + + def close( + self, + *, + code: int = 1000, + reason: str = "" + ) -> None: ... + + def recv(self) -> ServerEvent: ... + + def send(self, event: ClientEvent) -> None: ... + + + class azure.ai.projects.RealtimeConnectionManager: implements ContextManager + + def __init__( + self, + *, + agent_name: str, + agent_session_id: Optional[str] = ..., + agent_version_override: Optional[str] = ..., + api_version: str, + connection_url: Optional[str] = ..., + credential: TokenCredential, + credential_scopes: List[str], + endpoint: str, + extra_headers: Optional[Mapping[str, str]] = ..., + extra_query: Optional[Mapping[str, str]] = ..., + foundry_features: str, + structured_inputs: Optional[str] = ..., + **kwargs: Any + ) -> None: ... + + def enter(self) -> RealtimeConnection: ... + + namespace azure.ai.projects.aio class azure.ai.projects.aio.AIProjectClient(AIProjectClientGenerated): implements AsyncContextManager diff --git a/sdk/ai/azure-ai-projects/api.metadata.yml b/sdk/ai/azure-ai-projects/api.metadata.yml index a38a19e2ebf4..c9f97de99bda 100644 --- a/sdk/ai/azure-ai-projects/api.metadata.yml +++ b/sdk/ai/azure-ai-projects/api.metadata.yml @@ -1,3 +1,3 @@ -apiMdSha256: 3d3ffaa23496a1f32b83d7560f23db9e94b6f7aafcf718ab6088014ee52f72ec +apiMdSha256: e8747d9614fde34654e3ac76a960aff0fbf2408b485b74c4ca92ebb7abe6dc6f parserVersion: 0.3.31 pythonVersion: 3.13.14 From 0b0ce935327a9c65c595fae5329e71235f60f924 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Mon, 17 Aug 2026 14:18:21 -0700 Subject: [PATCH 25/56] Fix voice-agent async decode bug, CI failures, and PR review comments - Work around aiohttp response-decompression bug on agents/agent_endpoint_conversations (async client) - Fix pyright errors: self-referencing forward-refs in _unions.py, subprotocols typing in _realtime.py - Fix Sphinx doc build failure (malformed RST in get_session_log_stream docstring) - Remove non-functional generated voice_agent_web_socket operation group from public client surface - Guard connection_url override against token exfiltration to untrusted hosts in realtime client - Don't swallow BaseException (e.g. CancelledError) when wrapping realtime connection failures - Add recorded tests for voice-agent CRUD (sync/async) and agent_endpoint_conversations header injection - Update stale expected Foundry-Features header constants to include VoiceAgents=V1Preview --- sdk/ai/azure-ai-projects/.env.template | 1 + sdk/ai/azure-ai-projects/assets.json | 2 +- .../azure/ai/projects/_patch.py | 5 + .../azure/ai/projects/_realtime.py | 32 +++- .../azure/ai/projects/_unions.py | 4 +- .../azure/ai/projects/aio/_patch.py | 5 + .../azure/ai/projects/aio/_realtime.py | 28 ++- .../ai/projects/aio/operations/_operations.py | 16 +- .../ai/projects/operations/_operations.py | 16 +- .../tests/agents/test_voice_agent_crud.py | 171 +++++++++++++++++ .../agents/test_voice_agent_crud_async.py | 174 ++++++++++++++++++ .../foundry_features_header_test_base.py | 23 ++- ..._header_on_agent_endpoint_conversations.py | 136 ++++++++++++++ ...r_on_agent_endpoint_conversations_async.py | 146 +++++++++++++++ sdk/ai/azure-ai-projects/tests/test_base.py | 1 + 15 files changed, 731 insertions(+), 29 deletions(-) create mode 100644 sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud.py create mode 100644 sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud_async.py create mode 100644 sdk/ai/azure-ai-projects/tests/foundry_features_header/test_foundry_features_header_on_agent_endpoint_conversations.py create mode 100644 sdk/ai/azure-ai-projects/tests/foundry_features_header/test_foundry_features_header_on_agent_endpoint_conversations_async.py diff --git a/sdk/ai/azure-ai-projects/.env.template b/sdk/ai/azure-ai-projects/.env.template index a89bd766f143..b4716440a60c 100644 --- a/sdk/ai/azure-ai-projects/.env.template +++ b/sdk/ai/azure-ai-projects/.env.template @@ -23,6 +23,7 @@ AZURE_AI_PROJECTS_CONSOLE_LOGGING= FOUNDRY_PROJECT_ENDPOINT= FOUNDRY_PROJECT_API_KEY= FOUNDRY_MODEL_NAME= +FOUNDRY_VOICE_MODEL_NAME= FOUNDRY_AGENT_NAME= FOUNDRY_AGENT_CONTAINER_IMAGE= CONVERSATION_ID= diff --git a/sdk/ai/azure-ai-projects/assets.json b/sdk/ai/azure-ai-projects/assets.json index 72ba85a709d4..6a0932ed64ef 100644 --- a/sdk/ai/azure-ai-projects/assets.json +++ b/sdk/ai/azure-ai-projects/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "python", "TagPrefix": "python/ai/azure-ai-projects", - "Tag": "python/ai/azure-ai-projects_4d4ddcf68b" + "Tag": "python/ai/azure-ai-projects_3b1b362cbf" } diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py index 00cdc934c91d..22a48875ef89 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py @@ -250,6 +250,11 @@ def __init__( self.telemetry = TelemetryOperations(self) # type: ignore self._realtime: Optional[Realtime] = None + # The generated `voice_agent_web_socket` operation group only performs a plain HTTP GET + # (no WebSocket upgrade handshake) and discards the connection, returning None. It is not a + # usable WebSocket client. Remove it from the public surface so it can't be mistaken for the + # real, functional voice-agent WebSocket client exposed via `.realtime`. + del self.voice_agent_web_socket # Voice-agent conversation reads require the VoiceAgents=V1Preview opt-in header, which # isn't part of the standard agent preview headers; inject it transparently. self.agent_endpoint_conversations = _OperationMethodHeaderProxy( # type: ignore diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py index 253131a652c9..1df9e3c5aa04 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py @@ -18,7 +18,7 @@ import base64 import json -from urllib.parse import urlencode +from urllib.parse import urlencode, urlparse from typing import ( Any, Dict, @@ -231,6 +231,29 @@ def _to_ws_url(endpoint: str, agent_name: str) -> str: return f"{base}/agents/{agent_name}/endpoint/protocols/voice" +def _assert_trusted_connection_url(connection_url: str, endpoint: str) -> None: + """Guard against attaching the caller's Entra bearer token to an untrusted host. + + ``connection_url`` is an escape hatch that lets a caller override the computed + scheme/host/path, but the Authorization header carrying the live credential's + token must never be sent to a host other than the configured Foundry project + endpoint: a caller-controlled or compromised URL could otherwise be used to + exfiltrate the token to an arbitrary host. + + :param str connection_url: The caller-supplied override URL. + :param str endpoint: The configured, trusted Foundry project endpoint. + :raises ValueError: If the override URL's host does not match the endpoint's host. + """ + override_host = (urlparse(connection_url).hostname or "").lower() + trusted_host = (urlparse(endpoint).hostname or "").lower() + if not override_host or override_host != trusted_host: + raise ValueError( + "The 'connection_url' override must target the same host as the configured Foundry " + f"project endpoint ('{trusted_host}') to avoid sending the Authorization token to an " + f"untrusted host; got host '{override_host or connection_url}'." + ) + + class _BaseResource: # pylint: disable=too-few-public-methods """Base helper that forwards typed helpers to the parent connection.""" @@ -643,6 +666,7 @@ def enter(self) -> RealtimeConnection: # pylint: disable=too-many-locals """ try: from websockets.sync.client import connect as _ws_connect # pylint: disable=import-outside-toplevel + from websockets.typing import Subprotocol # pylint: disable=import-outside-toplevel except ImportError as exc: # pragma: no cover - dependency guard raise RuntimeError( "The realtime client requires `websockets`. Install it with `pip install websockets`." @@ -650,6 +674,8 @@ def enter(self) -> RealtimeConnection: # pylint: disable=too-many-locals # ``connection_url`` fully overrides the computed route (scheme/host/path). This is the # escape hatch used to reach a specific data-plane host/path directly. + if self._connection_url is not None: + _assert_trusted_connection_url(self._connection_url, self._endpoint) url = self._connection_url or _to_ws_url(self._endpoint, self._agent_name) if not url.startswith("wss://"): raise ValueError("The realtime WebSocket URL must use wss:// to protect credentials in transit.") @@ -676,11 +702,11 @@ def enter(self) -> RealtimeConnection: # pylint: disable=too-many-locals connection = _ws_connect( full_url, additional_headers=headers, - subprotocols=["realtime"], + subprotocols=[Subprotocol("realtime")], **self._kwargs, ) except BaseException as exc: - if isinstance(exc, (ValueError, RuntimeError)): + if not isinstance(exc, Exception) or isinstance(exc, (ValueError, RuntimeError)): raise raise ConnectionError( f"Failed to open the realtime WebSocket connection to voice agent " 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 d11228d5304f..0e5ddbd9c108 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_unions.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_unions.py @@ -32,7 +32,7 @@ "_models.RealtimeConversationItemFunctionCallOutput", ] VoiceAgentCreateConversationItem = Union[ - "_unions.VoiceAgentRequestConversationItem", "_models.RealtimeMCPApprovalResponse" + "VoiceAgentRequestConversationItem", "_models.RealtimeMCPApprovalResponse" ] VoiceAgentResponseMessageItem = Union[ "_models.RealtimeConversationItemMessageSystem", @@ -40,7 +40,7 @@ "_models.RealtimeConversationItemMessageAssistant", ] VoiceAgentResponseItem = Union[ - "_unions.VoiceAgentResponseMessageItem", + "VoiceAgentResponseMessageItem", "_models.VoiceFunctionCallItem", "_models.VoiceFunctionCallOutputItem", "_models.VoiceMcpListToolsItem", diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py index 5d18e112fbef..c06ee40dbbf5 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py @@ -181,6 +181,11 @@ def __init__( self.telemetry = TelemetryOperations(self) # type: ignore self._realtime: Optional[AsyncRealtime] = None + # The generated `voice_agent_web_socket` operation group only performs a plain HTTP GET + # (no WebSocket upgrade handshake) and discards the connection, returning None. It is not a + # usable WebSocket client. Remove it from the public surface so it can't be mistaken for the + # real, functional voice-agent WebSocket client exposed via `.realtime`. + del self.voice_agent_web_socket # Voice-agent conversation reads require the VoiceAgents=V1Preview opt-in header, which # isn't part of the standard agent preview headers; inject it transparently. self.agent_endpoint_conversations = _OperationMethodHeaderProxy( # type: ignore diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py index 6ff9eeda83e6..679e6766b555 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py @@ -32,6 +32,7 @@ import base64 import json +from urllib.parse import urlparse from typing import ( Any, AsyncIterator, @@ -244,6 +245,29 @@ def _to_ws_url(endpoint: str, agent_name: str) -> str: return f"{base}/agents/{agent_name}/endpoint/protocols/voice" +def _assert_trusted_connection_url(connection_url: str, endpoint: str) -> None: + """Guard against attaching the caller's Entra bearer token to an untrusted host. + + ``connection_url`` is an escape hatch that lets a caller override the computed + scheme/host/path, but the Authorization header carrying the live credential's + token must never be sent to a host other than the configured Foundry project + endpoint: a caller-controlled or compromised URL could otherwise be used to + exfiltrate the token to an arbitrary host. + + :param str connection_url: The caller-supplied override URL. + :param str endpoint: The configured, trusted Foundry project endpoint. + :raises ValueError: If the override URL's host does not match the endpoint's host. + """ + override_host = (urlparse(connection_url).hostname or "").lower() + trusted_host = (urlparse(endpoint).hostname or "").lower() + if not override_host or override_host != trusted_host: + raise ValueError( + "The 'connection_url' override must target the same host as the configured Foundry " + f"project endpoint ('{trusted_host}') to avoid sending the Authorization token to an " + f"untrusted host; got host '{override_host or connection_url}'." + ) + + class _BaseResource: # pylint: disable=too-few-public-methods """Base helper that forwards typed helpers to the parent connection.""" @@ -671,6 +695,8 @@ async def enter(self) -> AsyncRealtimeConnection: # pylint: disable=too-many-lo # ``connection_url`` fully overrides the computed route (scheme/host/path). This is the # escape hatch used to reach a specific data-plane host/path directly. + if self._connection_url is not None: + _assert_trusted_connection_url(self._connection_url, self._endpoint) url = self._connection_url or _to_ws_url(self._endpoint, self._agent_name) if not url.startswith("wss://"): raise ValueError("The realtime WebSocket URL must use wss:// to protect credentials in transit.") @@ -697,7 +723,7 @@ async def enter(self) -> AsyncRealtimeConnection: # pylint: disable=too-many-lo connection = await session.ws_connect(url, headers=headers, params=params, **self._kwargs) except BaseException as exc: await session.close() - if isinstance(exc, (ValueError, RuntimeError)): + if not isinstance(exc, Exception) or isinstance(exc, (ValueError, RuntimeError)): raise raise ConnectionError( f"Failed to open the realtime WebSocket connection to voice agent " 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 b7ba89954b9a..0ba8d9c80cdc 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 @@ -2288,28 +2288,24 @@ async def get_session_log_stream( * `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) + 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. 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 464b25ad284a..b449b819327e 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 @@ -6143,28 +6143,24 @@ def get_session_log_stream( * `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) + 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. diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud.py b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud.py new file mode 100644 index 000000000000..b4f13b7cb810 --- /dev/null +++ b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud.py @@ -0,0 +1,171 @@ +# pylint: disable=too-many-lines,line-too-long,useless-suppression +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +# cSpell:disable + +from test_base import TestBase, servicePreparer +from devtools_testutils import recorded_by_proxy, RecordedTransport +from azure.ai.projects.models import ( + AgentDetails, + AgentVersionDetails, + VoiceAgentDefinition, + VoiceAudioConfig, + VoiceAudioOutputConfig, + VoiceOutputModality, +) + + +class TestVoiceAgentCrud(TestBase): + """ + Recorded tests covering the voice-agent (`kind="voice"`) REST API surface exposed through + `project_client.agents.*`. + + NOTE: Some voice-agent REST APIs are intentionally NOT covered here because they are + currently blocked by known service-side bugs (see this package's engineering notes): + - `agents.generate_agent(kind="voice")` - returns a `400 invalid_payload` error from the + service even though the SDK sends the TypeSpec-documented-correct payload. + - Reading back a conversation (`project_client.agent_endpoint_conversations.*`) using a + `conversation_id` produced by a live realtime WebSocket session - the service's REST + conversation-ID validator rejects the ID format generated by the realtime WS subsystem. + This is also not practical to cover with HTTP-only recorded tests since it requires an + actual WebSocket session. + Once these are fixed service-side, tests can be added for them. + """ + + # To run only this test: + # pytest tests\agents\test_voice_agent_crud.py::TestVoiceAgentCrud::test_voice_agent_crud -s + @servicePreparer() + @recorded_by_proxy() + def test_voice_agent_crud(self, **kwargs): + """ + Test CRUD operations for voice Agents (`kind="voice"`). + + This test creates a voice agent, creates a new version of it, gets it, gets a specific + version, lists its versions, and deletes it. + + Routes used in this test: + + Action REST API Route Client Method + ------+---------------------------------------------+----------------------------------- + POST /agents/{agent_name}/versions project_client.agents.create_version() + GET /agents/{agent_name} project_client.agents.get() + GET /agents/{agent_name}/versions/{agent_version} project_client.agents.get_version() + GET /agents/{agent_name}/versions project_client.agents.list_versions() + DELETE /agents/{agent_name} project_client.agents.delete() + """ + print("\n") + model = kwargs.get("foundry_voice_model_name") + assert model is not None + # Voice-agent operations require the preview opt-in. + project_client = self.create_client(operation_group="agents", allow_preview=True, **kwargs) + agent_name = "MyVoiceAgentCrudTest" + + def make_definition(instructions: str) -> VoiceAgentDefinition: + return VoiceAgentDefinition( + model_type="managed", + model=model, + instructions=instructions, + audio=VoiceAudioConfig( + output=VoiceAudioOutputConfig(voice="en-US-AvaNeural", voice_type="azure-standard") + ), + output_modalities=[VoiceOutputModality.AUDIO], + ) + + # Create the initial voice agent (version 1). + agent_version1: AgentVersionDetails = project_client.agents.create_version( + agent_name=agent_name, + definition=make_definition("You are a helpful voice assistant."), + ) + self._validate_agent_version(agent_version1, expected_name=agent_name) + assert agent_version1.definition.kind == "voice" # type: ignore[attr-defined] + + # Create a new version with updated instructions. + agent_version2: AgentVersionDetails = project_client.agents.create_version( + agent_name=agent_name, + definition=make_definition("You are a helpful voice assistant. Always greet the caller by name."), + ) + self._validate_agent_version(agent_version2, expected_name=agent_name) + + # Get the voice agent. + retrieved_agent: AgentDetails = project_client.agents.get(agent_name=agent_name) + self._validate_agent( + retrieved_agent, expected_name=agent_name, expected_latest_version=agent_version2.version + ) + + # Retrieve a specific version. + retrieved_agent_version: AgentVersionDetails = project_client.agents.get_version( + agent_name=agent_name, agent_version=agent_version1.version + ) + self._validate_agent_version( + retrieved_agent_version, expected_name=agent_name, expected_version=agent_version1.version + ) + + # List all versions. + item_count = 0 + for listed_agent_version in project_client.agents.list_versions(agent_name=agent_name): + item_count += 1 + self._validate_agent_version(listed_agent_version, expected_name=agent_name) + assert item_count >= 2 + + # Delete the voice agent. + result = project_client.agents.delete(agent_name=agent_name) + assert result.deleted + + # To run only this test: + # pytest tests\agents\test_voice_agent_crud.py::TestVoiceAgentCrud::test_voice_agent_disable_enable -s + @servicePreparer() + @recorded_by_proxy(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX) + def test_voice_agent_disable_enable(self, **kwargs): + """ + Test disable and enable operations for a voice Agent. + + Routes used in this test: + + Action REST API Route Client Method + ------+---------------------------------------------+----------------------------------- + POST /agents/{agent_name}/versions project_client.agents.create_version() + POST /agents/{agent_name}:disable project_client.agents.disable() + POST /agents/{agent_name}:enable project_client.agents.enable() + DELETE /agents/{agent_name} project_client.agents.delete() + """ + print("\n") + model = kwargs.get("foundry_voice_model_name") + assert model is not None + project_client = self.create_client(operation_group="agents", allow_preview=True, **kwargs) + agent_name = "VoiceAgentDisableEnableTest" + + # Delete any existing agent from previous test runs (ignore failures) + try: + project_client.agents.delete(agent_name=agent_name) + except Exception: # pylint: disable=broad-except + pass + + agent_version: AgentVersionDetails = project_client.agents.create_version( + agent_name=agent_name, + definition=VoiceAgentDefinition( + model_type="managed", + model=model, + instructions="You are a helpful voice assistant.", + audio=VoiceAudioConfig( + output=VoiceAudioOutputConfig(voice="en-US-AvaNeural", voice_type="azure-standard") + ), + output_modalities=[VoiceOutputModality.AUDIO], + ), + ) + self._validate_agent_version(agent_version, expected_name=agent_name) + + # Disable the agent. + project_client.agents.disable(agent_name=agent_name) + disabled_agent: AgentDetails = project_client.agents.get(agent_name=agent_name) + assert str(disabled_agent.state) == "AgentState.DISABLED" or disabled_agent.state == "disabled" + + # Enable the agent. + project_client.agents.enable(agent_name=agent_name) + enabled_agent: AgentDetails = project_client.agents.get(agent_name=agent_name) + assert str(enabled_agent.state) == "AgentState.ENABLED" or enabled_agent.state == "enabled" + + # Delete the voice agent. + result = project_client.agents.delete(agent_name=agent_name) + assert result.deleted diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud_async.py b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud_async.py new file mode 100644 index 000000000000..9b582eb945d4 --- /dev/null +++ b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud_async.py @@ -0,0 +1,174 @@ +# pylint: disable=too-many-lines,line-too-long,useless-suppression +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +# cSpell:disable + +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 ( + AgentDetails, + AgentVersionDetails, + VoiceAgentDefinition, + VoiceAudioConfig, + VoiceAudioOutputConfig, + VoiceOutputModality, +) + + +class TestVoiceAgentCrudAsync(TestBase): + """ + Recorded tests covering the voice-agent (`kind="voice"`) REST API surface exposed through + `project_client.agents.*`. + + NOTE: Some voice-agent REST APIs are intentionally NOT covered here because they are + currently blocked by known service-side bugs (see this package's engineering notes): + - `agents.generate_agent(kind="voice")` - returns a `400 invalid_payload` error from the + service even though the SDK sends the TypeSpec-documented-correct payload. + - Reading back a conversation (`project_client.agent_endpoint_conversations.*`) using a + `conversation_id` produced by a live realtime WebSocket session - the service's REST + conversation-ID validator rejects the ID format generated by the realtime WS subsystem. + This is also not practical to cover with HTTP-only recorded tests since it requires an + actual WebSocket session. + Once these are fixed service-side, tests can be added for them. + """ + + # To run only this test: + # pytest tests\agents\test_voice_agent_crud_async.py::TestVoiceAgentCrudAsync::test_voice_agent_crud_async -s + @servicePreparer() + @recorded_by_proxy_async() + async def test_voice_agent_crud_async(self, **kwargs): + """ + Test CRUD operations for voice Agents (`kind="voice"`). + + This test creates a voice agent, creates a new version of it, gets it, gets a specific + version, lists its versions, and deletes it. + + Routes used in this test: + + Action REST API Route Client Method + ------+---------------------------------------------+----------------------------------- + POST /agents/{agent_name}/versions project_client.agents.create_version() + GET /agents/{agent_name} project_client.agents.get() + GET /agents/{agent_name}/versions/{agent_version} project_client.agents.get_version() + GET /agents/{agent_name}/versions project_client.agents.list_versions() + DELETE /agents/{agent_name} project_client.agents.delete() + """ + print("\n") + model = kwargs.get("foundry_voice_model_name") + assert model is not None + # Voice-agent operations require the preview opt-in. + project_client = self.create_async_client(operation_group="agents", allow_preview=True, **kwargs) + agent_name = "MyVoiceAgentCrudTestAsync" + + def make_definition(instructions: str) -> VoiceAgentDefinition: + return VoiceAgentDefinition( + model_type="managed", + model=model, + instructions=instructions, + audio=VoiceAudioConfig( + output=VoiceAudioOutputConfig(voice="en-US-AvaNeural", voice_type="azure-standard") + ), + output_modalities=[VoiceOutputModality.AUDIO], + ) + + async with project_client: + # Create the initial voice agent (version 1). + agent_version1: AgentVersionDetails = await project_client.agents.create_version( + agent_name=agent_name, + definition=make_definition("You are a helpful voice assistant."), + ) + self._validate_agent_version(agent_version1, expected_name=agent_name) + assert agent_version1.definition.kind == "voice" # type: ignore[attr-defined] + + # Create a new version with updated instructions. + agent_version2: AgentVersionDetails = await project_client.agents.create_version( + agent_name=agent_name, + definition=make_definition("You are a helpful voice assistant. Always greet the caller by name."), + ) + self._validate_agent_version(agent_version2, expected_name=agent_name) + + # Get the voice agent. + retrieved_agent: AgentDetails = await project_client.agents.get(agent_name=agent_name) + self._validate_agent( + retrieved_agent, expected_name=agent_name, expected_latest_version=agent_version2.version + ) + + # Retrieve a specific version. + retrieved_agent_version: AgentVersionDetails = await project_client.agents.get_version( + agent_name=agent_name, agent_version=agent_version1.version + ) + self._validate_agent_version( + retrieved_agent_version, expected_name=agent_name, expected_version=agent_version1.version + ) + + # List all versions. + item_count = 0 + async for listed_agent_version in project_client.agents.list_versions(agent_name=agent_name): + item_count += 1 + self._validate_agent_version(listed_agent_version, expected_name=agent_name) + assert item_count >= 2 + + # Delete the voice agent. + result = await project_client.agents.delete(agent_name=agent_name) + assert result.deleted + + # To run only this test: + # pytest tests\agents\test_voice_agent_crud_async.py::TestVoiceAgentCrudAsync::test_voice_agent_disable_enable_async -s + @servicePreparer() + @recorded_by_proxy_async(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX) + async def test_voice_agent_disable_enable_async(self, **kwargs): + """ + Test disable and enable operations for a voice Agent. + + Routes used in this test: + + Action REST API Route Client Method + ------+---------------------------------------------+----------------------------------- + POST /agents/{agent_name}/versions project_client.agents.create_version() + POST /agents/{agent_name}:disable project_client.agents.disable() + POST /agents/{agent_name}:enable project_client.agents.enable() + DELETE /agents/{agent_name} project_client.agents.delete() + """ + print("\n") + model = kwargs.get("foundry_voice_model_name") + assert model is not None + project_client = self.create_async_client(operation_group="agents", allow_preview=True, **kwargs) + agent_name = "VoiceAgentDisableEnableTestAsync" + + async with project_client: + # Delete any existing agent from previous test runs (ignore failures) + try: + await project_client.agents.delete(agent_name=agent_name) + except Exception: # pylint: disable=broad-except + pass + + agent_version: AgentVersionDetails = await project_client.agents.create_version( + agent_name=agent_name, + definition=VoiceAgentDefinition( + model_type="managed", + model=model, + instructions="You are a helpful voice assistant.", + audio=VoiceAudioConfig( + output=VoiceAudioOutputConfig(voice="en-US-AvaNeural", voice_type="azure-standard") + ), + output_modalities=[VoiceOutputModality.AUDIO], + ), + ) + self._validate_agent_version(agent_version, expected_name=agent_name) + + # Disable the agent. + await project_client.agents.disable(agent_name=agent_name) + disabled_agent: AgentDetails = await project_client.agents.get(agent_name=agent_name) + assert str(disabled_agent.state) == "AgentState.DISABLED" or disabled_agent.state == "disabled" + + # Enable the agent. + await project_client.agents.enable(agent_name=agent_name) + enabled_agent: AgentDetails = await project_client.agents.get(agent_name=agent_name) + assert str(enabled_agent.state) == "AgentState.ENABLED" or enabled_agent.state == "enabled" + + # Delete the voice agent. + result = await project_client.agents.delete(agent_name=agent_name) + assert result.deleted diff --git a/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py b/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py index 55e08fee6f52..17157375d783 100644 --- a/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py +++ b/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py @@ -45,7 +45,7 @@ "schedules": "Schedules=V1Preview", "skills": "Skills=V1Preview", "datasets": "DataGenerationJobs=V1Preview", - "agents": "WorkflowAgents=V1Preview,ExternalAgents=V1Preview,DraftAgents=V1Preview,AgentsOptimization=V2Preview", + "agents": "WorkflowAgents=V1Preview,ExternalAgents=V1Preview,VoiceAgents=V1Preview,DraftAgents=V1Preview,AgentsOptimization=V2Preview", } # Methods on .beta sub-clients that are NOT simple one-HTTP-call wrappers and @@ -83,7 +83,7 @@ # The test id is derived automatically from method_name. pytest.param( "agents.create_version", - "WorkflowAgents=V1Preview,ExternalAgents=V1Preview,DraftAgents=V1Preview,AgentsOptimization=V2Preview", + "WorkflowAgents=V1Preview,ExternalAgents=V1Preview,VoiceAgents=V1Preview,DraftAgents=V1Preview,AgentsOptimization=V2Preview", ), pytest.param( "evaluation_rules.create_or_update", @@ -91,6 +91,25 @@ ), ] +# Methods on `agent_endpoint_conversations` that always send the Foundry-Features header, +# unconditionally, regardless of `allow_preview`. Unlike _NON_BETA_OPTIONAL_TEST_CASES above, +# this sub-client is wrapped with `_OperationMethodHeaderProxy` directly in `_patch.py` (not +# gated behind `allow_preview`), because voice-agent conversation reads require the +# VoiceAgents=V1Preview opt-in header even when the caller hasn't requested other preview +# features. Used by test_foundry_features_header_on_agent_endpoint_conversations.py (sync) and +# its async counterpart. +_AGENT_ENDPOINT_CONVERSATIONS_TEST_CASES = [ + # Each pytest.param entry has the following positional argument: + # 1. method_name (str) – "agent_endpoint_conversations." on AIProjectClient. + # The expected header value is always "VoiceAgents=V1Preview" for all of these. + pytest.param("agent_endpoint_conversations.list_agent_conversations"), + pytest.param("agent_endpoint_conversations.get_agent_conversation"), + pytest.param("agent_endpoint_conversations.delete_agent_conversation"), + pytest.param("agent_endpoint_conversations.list_agent_conversation_responses"), +] + +_AGENT_ENDPOINT_CONVERSATIONS_EXPECTED_HEADER_VALUE = "VoiceAgents=V1Preview" + # Both sentinel values – used by _make_fake_call to detect required parameters # whose defaults are the internal _Unset object (rather than inspect.Parameter.empty). _UNSET_SENTINELS: frozenset = frozenset({_SyncUnset, _AsyncUnset}) diff --git a/sdk/ai/azure-ai-projects/tests/foundry_features_header/test_foundry_features_header_on_agent_endpoint_conversations.py b/sdk/ai/azure-ai-projects/tests/foundry_features_header/test_foundry_features_header_on_agent_endpoint_conversations.py new file mode 100644 index 000000000000..a3d6bd502f88 --- /dev/null +++ b/sdk/ai/azure-ai-projects/tests/foundry_features_header/test_foundry_features_header_on_agent_endpoint_conversations.py @@ -0,0 +1,136 @@ +# pylint: disable=line-too-long,useless-suppression +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Tests unconditional Foundry-Features header behavior on sync `agent_endpoint_conversations` methods. + +Unlike the optional-header methods covered in test_foundry_features_header_on_ga_operations.py, +`agent_endpoint_conversations` is wrapped with `_OperationMethodHeaderProxy` directly in +`_patch.py`, so it always sends `Foundry-Features: VoiceAgents=V1Preview` regardless of whether +`allow_preview` was set on the `AIProjectClient` constructor. +""" + +from typing import Any, ClassVar, Iterator, List, Tuple + +import pytest +from azure.core.pipeline.transport import HttpTransport +from azure.ai.projects import AIProjectClient + +from foundry_features_header_test_base import ( + FAKE_ENDPOINT, + FakeCredential, + FoundryFeaturesHeaderTestBase, + _AGENT_ENDPOINT_CONVERSATIONS_EXPECTED_HEADER_VALUE, + _AGENT_ENDPOINT_CONVERSATIONS_TEST_CASES, + _RequestCaptured, +) + + +class CapturingTransport(HttpTransport): + """Sync transport that captures the outgoing request and raises _RequestCaptured.""" + + def send(self, request: Any, **kwargs: Any) -> Any: # type: ignore[override] + raise _RequestCaptured(request) + + def open(self) -> None: + pass + + def close(self) -> None: + pass + + def __enter__(self) -> "CapturingTransport": + return self + + def __exit__(self, *args: Any) -> None: + pass + + +@pytest.fixture(scope="module") +def client_preview_enabled() -> Iterator[AIProjectClient]: + with AIProjectClient( + endpoint=FAKE_ENDPOINT, + credential=FakeCredential(), # type: ignore[arg-type] + allow_preview=True, + transport=CapturingTransport(), + ) as c: + yield c + + +@pytest.fixture(scope="module") +def client_preview_disabled() -> Iterator[AIProjectClient]: + with AIProjectClient( + endpoint=FAKE_ENDPOINT, + credential=FakeCredential(), # type: ignore[arg-type] + transport=CapturingTransport(), + ) as c: + yield c + + +@pytest.fixture(scope="module", autouse=True) +def _print_report_agent_endpoint_conversations() -> Iterator[None]: + """Print a Foundry-Features report after all sync agent_endpoint_conversations tests finish.""" + yield + report = TestFoundryFeaturesHeaderOnAgentEndpointConversations._report + if report: + max_len = TestFoundryFeaturesHeaderOnAgentEndpointConversations._report_max_label_len + print( + "\n\nFoundry-Features header report on agent_endpoint_conversations (sync) — " + "always present regardless of allow_preview:" + ) + for label, header_value in sorted(report): + print(f'{label:<{max_len}} | "{header_value}"') + + +class TestFoundryFeaturesHeaderOnAgentEndpointConversations(FoundryFeaturesHeaderTestBase): + """Sync tests verifying the Foundry-Features header is always sent on + `agent_endpoint_conversations` methods, whether or not `allow_preview` was set. + """ + + _report: ClassVar[List[Tuple[str, str]]] = [] + _report_max_label_len: ClassVar[int] = 0 + + @staticmethod + def _capture(call: Any) -> Any: + """Call *call()* and return the captured HttpRequest.""" + try: + result = call() + except _RequestCaptured as exc: + return exc.request + + try: + next(iter(result)) + except _RequestCaptured as exc: + return exc.request + except StopIteration: + raise AssertionError("Iterator exhausted without the transport being called") from None + + raise AssertionError("Transport was never called") + + @classmethod + def _assert_header_present(cls, label: str, call: Any) -> None: + request = cls._capture(call) + cls._record_header_assertion(label, request, _AGENT_ENDPOINT_CONVERSATIONS_EXPECTED_HEADER_VALUE) + + @pytest.mark.parametrize("method_name", _AGENT_ENDPOINT_CONVERSATIONS_TEST_CASES) + def test_foundry_features_header_present_on_agent_endpoint_conversations_when_preview_enabled( + self, + client_preview_enabled: AIProjectClient, + method_name: str, + ) -> None: + subclient_name, method_attr = method_name.split(".") + sc = getattr(client_preview_enabled, subclient_name) + method = getattr(sc, method_attr) + self._assert_header_present(f"{method_name} (allow_preview=True)", self._make_fake_call(method)) + + @pytest.mark.parametrize("method_name", _AGENT_ENDPOINT_CONVERSATIONS_TEST_CASES) + def test_foundry_features_header_present_on_agent_endpoint_conversations_when_preview_not_enabled( + self, + client_preview_disabled: AIProjectClient, + method_name: str, + ) -> None: + """Even without `allow_preview`, agent_endpoint_conversations methods always send the header.""" + subclient_name, method_attr = method_name.split(".") + sc = getattr(client_preview_disabled, subclient_name) + method = getattr(sc, method_attr) + self._assert_header_present(f"{method_name} (allow_preview unset)", self._make_fake_call(method)) diff --git a/sdk/ai/azure-ai-projects/tests/foundry_features_header/test_foundry_features_header_on_agent_endpoint_conversations_async.py b/sdk/ai/azure-ai-projects/tests/foundry_features_header/test_foundry_features_header_on_agent_endpoint_conversations_async.py new file mode 100644 index 000000000000..bf86d5f8460f --- /dev/null +++ b/sdk/ai/azure-ai-projects/tests/foundry_features_header/test_foundry_features_header_on_agent_endpoint_conversations_async.py @@ -0,0 +1,146 @@ +# pylint: disable=line-too-long,useless-suppression +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Tests unconditional Foundry-Features header behavior on async `agent_endpoint_conversations` methods. + +Unlike the optional-header methods covered in test_foundry_features_header_on_ga_operations_async.py, +`agent_endpoint_conversations` is wrapped with `_OperationMethodHeaderProxy` directly in +`aio/_patch.py`, so it always sends `Foundry-Features: VoiceAgents=V1Preview` regardless of whether +`allow_preview` was set on the `AIProjectClient` constructor. +""" + +import inspect +from typing import Any, ClassVar, Iterator, List, Tuple + +import pytest +from azure.core.pipeline.transport import AsyncHttpTransport +from azure.ai.projects.aio import AIProjectClient as AsyncAIProjectClient + +from foundry_features_header_test_base import ( + FAKE_ENDPOINT, + AsyncFakeCredential, + FoundryFeaturesHeaderTestBase, + _AGENT_ENDPOINT_CONVERSATIONS_EXPECTED_HEADER_VALUE, + _AGENT_ENDPOINT_CONVERSATIONS_TEST_CASES, + _RequestCaptured, +) + + +class CapturingAsyncTransport(AsyncHttpTransport): + """Async transport that captures the outgoing request and raises _RequestCaptured.""" + + async def send(self, request: Any, **kwargs: Any) -> Any: # type: ignore[override] + raise _RequestCaptured(request) + + async def open(self) -> None: + pass + + async def close(self) -> None: + pass + + async def __aenter__(self) -> "CapturingAsyncTransport": + return self + + async def __aexit__(self, *args: Any) -> None: + pass + + +@pytest.fixture(scope="module") +def async_client_preview_enabled() -> Iterator[AsyncAIProjectClient]: + yield AsyncAIProjectClient( + endpoint=FAKE_ENDPOINT, + credential=AsyncFakeCredential(), # type: ignore[arg-type] + allow_preview=True, + transport=CapturingAsyncTransport(), + ) + + +@pytest.fixture(scope="module") +def async_client_preview_disabled() -> Iterator[AsyncAIProjectClient]: + yield AsyncAIProjectClient( + endpoint=FAKE_ENDPOINT, + credential=AsyncFakeCredential(), # type: ignore[arg-type] + transport=CapturingAsyncTransport(), + ) + + +@pytest.fixture(scope="module", autouse=True) +def _print_report_agent_endpoint_conversations_async() -> Iterator[None]: + """Print a Foundry-Features report after all async agent_endpoint_conversations tests finish.""" + yield + report = TestFoundryFeaturesHeaderOnAgentEndpointConversationsAsync._report + if report: + max_len = TestFoundryFeaturesHeaderOnAgentEndpointConversationsAsync._report_max_label_len + print( + "\n\nFoundry-Features header report on agent_endpoint_conversations (async) — " + "always present regardless of allow_preview:" + ) + for label, header_value in sorted(report): + print(f'{label:<{max_len}} | "{header_value}"') + + +class TestFoundryFeaturesHeaderOnAgentEndpointConversationsAsync(FoundryFeaturesHeaderTestBase): + """Async tests verifying the Foundry-Features header is always sent on + `agent_endpoint_conversations` methods, whether or not `allow_preview` was set. + """ + + _report: ClassVar[List[Tuple[str, str]]] = [] + _report_max_label_len: ClassVar[int] = 0 + + @staticmethod + async def _capture_async(call: Any) -> Any: + """Invoke *call()* and return the captured HttpRequest.""" + result = call() + + if inspect.isawaitable(result): + try: + await result + except _RequestCaptured as exc: + return exc.request + raise AssertionError("Transport was never called (awaitable completed without raising)") + + ai = result.__aiter__() + try: + await ai.__anext__() + except _RequestCaptured as exc: + return exc.request + except StopAsyncIteration: + raise AssertionError("Iterator exhausted without the transport being called") from None + + raise AssertionError("Transport was never called") + + @classmethod + async def _assert_header_present_async(cls, label: str, call: Any) -> None: + request = await cls._capture_async(call) + cls._record_header_assertion(label, request, _AGENT_ENDPOINT_CONVERSATIONS_EXPECTED_HEADER_VALUE) + + @pytest.mark.asyncio + @pytest.mark.parametrize("method_name", _AGENT_ENDPOINT_CONVERSATIONS_TEST_CASES) + async def test_foundry_features_header_present_on_agent_endpoint_conversations_when_preview_enabled_async( + self, + async_client_preview_enabled: AsyncAIProjectClient, + method_name: str, + ) -> None: + subclient_name, method_attr = method_name.split(".") + sc = getattr(async_client_preview_enabled, subclient_name) + method = getattr(sc, method_attr) + await self._assert_header_present_async( + f"{method_name} (allow_preview=True)", self._make_fake_call(method) + ) + + @pytest.mark.asyncio + @pytest.mark.parametrize("method_name", _AGENT_ENDPOINT_CONVERSATIONS_TEST_CASES) + async def test_foundry_features_header_present_on_agent_endpoint_conversations_when_preview_not_enabled_async( + self, + async_client_preview_disabled: AsyncAIProjectClient, + method_name: str, + ) -> None: + """Even without `allow_preview`, agent_endpoint_conversations methods always send the header.""" + subclient_name, method_attr = method_name.split(".") + sc = getattr(async_client_preview_disabled, subclient_name) + method = getattr(sc, method_attr) + await self._assert_header_present_async( + f"{method_name} (allow_preview unset)", self._make_fake_call(method) + ) diff --git a/sdk/ai/azure-ai-projects/tests/test_base.py b/sdk/ai/azure-ai-projects/tests/test_base.py index 4069479fdcb3..a4ece82551d2 100644 --- a/sdk/ai/azure-ai-projects/tests/test_base.py +++ b/sdk/ai/azure-ai-projects/tests/test_base.py @@ -43,6 +43,7 @@ foundry_project_api_key="sanitized-api-key", foundry_agent_name="sanitized-agent-name", foundry_model_name="sanitized-model-deployment-name", + foundry_voice_model_name="sanitized-model-deployment-name", llm_validation_project_endpoint="https://sanitized-account-name.services.ai.azure.com/api/projects/sanitized-project-name", image_generation_model_deployment_name="sanitized-gpt-image", bing_project_connection_id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sanitized-resource-group/providers/Microsoft.CognitiveServices/accounts/sanitized-account/projects/sanitized-project/connections/sanitized-bing-connection", From 58b08d08a833096118a33d54405a3253c19f2889 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Mon, 17 Aug 2026 16:50:38 -0700 Subject: [PATCH 26/56] Guard generated-attribute access for mocked __init__ tests; export ClientEvent/ConversationItem/ServerEvent from _patch; sanitize Foundry-Features header in test recordings --- .../azure/ai/projects/_patch.py | 17 +++++++++---- .../azure/ai/projects/_patch.pyi | 19 ++++++++++++-- .../azure/ai/projects/aio/_patch.py | 25 ++++++++++++------- .../azure/ai/projects/aio/_patch.pyi | 19 ++++++++++++-- sdk/ai/azure-ai-projects/tests/conftest.py | 14 +++++++++++ 5 files changed, 76 insertions(+), 18 deletions(-) diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py index 22a48875ef89..bc5fe415a4e1 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py @@ -254,13 +254,17 @@ def __init__( # (no WebSocket upgrade handshake) and discards the connection, returning None. It is not a # usable WebSocket client. Remove it from the public surface so it can't be mistaken for the # real, functional voice-agent WebSocket client exposed via `.realtime`. - del self.voice_agent_web_socket + if hasattr(self, "voice_agent_web_socket"): + del self.voice_agent_web_socket # Voice-agent conversation reads require the VoiceAgents=V1Preview opt-in header, which # isn't part of the standard agent preview headers; inject it transparently. - self.agent_endpoint_conversations = _OperationMethodHeaderProxy( # type: ignore - self.agent_endpoint_conversations, - _AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.value, - ) + # Guarded with hasattr since some tests mock out the generated __init__ entirely, in which + # case none of the generated operation-group attributes are set on `self`. + if hasattr(self, "agent_endpoint_conversations"): + self.agent_endpoint_conversations = _OperationMethodHeaderProxy( # type: ignore + self.agent_endpoint_conversations, + _AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.value, + ) @property def realtime(self) -> Realtime: @@ -537,6 +541,9 @@ def _log_request_body(self, request: httpx.Request) -> None: "Realtime", "RealtimeConnection", "RealtimeConnectionManager", + "ClientEvent", + "ConversationItem", + "ServerEvent", ] # Add all objects you want publicly available to users at this package level diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.pyi b/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.pyi index 8e3e47320a25..070856b73677 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.pyi +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.pyi @@ -34,7 +34,14 @@ from openai.types.eval_create_response import EvalCreateResponse from openai.types.shared_params.metadata import Metadata from ._client import AIProjectClient as AIProjectClientGenerated from .operations import TelemetryOperations -from ._realtime import Realtime, RealtimeConnection, RealtimeConnectionManager +from ._realtime import ( + Realtime, + RealtimeConnection, + RealtimeConnectionManager, + ClientEvent, + ConversationItem, + ServerEvent, +) from .models import ( AzureAIBenchmarkPreviewEvalRunDataSource, AzureAIDataSourceConfig, @@ -129,6 +136,14 @@ def _resolve_openai_default_headers(agent_name: Optional[str], kwargs: dict) -> def _build_openai_user_agent(custom_user_agent: Optional[str], openai_default_user_agent: str) -> str: ... def _log_streaming_response_notice(logging_enabled: bool) -> bool: ... -__all__: List[str] = ["AIProjectClient", "Realtime", "RealtimeConnection", "RealtimeConnectionManager"] +__all__: List[str] = [ + "AIProjectClient", + "Realtime", + "RealtimeConnection", + "RealtimeConnectionManager", + "ClientEvent", + "ConversationItem", + "ServerEvent", +] def patch_sdk() -> None: ... diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py index c06ee40dbbf5..a0739cefbdf4 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py @@ -185,20 +185,27 @@ def __init__( # (no WebSocket upgrade handshake) and discards the connection, returning None. It is not a # usable WebSocket client. Remove it from the public surface so it can't be mistaken for the # real, functional voice-agent WebSocket client exposed via `.realtime`. - del self.voice_agent_web_socket + if hasattr(self, "voice_agent_web_socket"): + del self.voice_agent_web_socket # Voice-agent conversation reads require the VoiceAgents=V1Preview opt-in header, which # isn't part of the standard agent preview headers; inject it transparently. - self.agent_endpoint_conversations = _OperationMethodHeaderProxy( # type: ignore - self.agent_endpoint_conversations, - _AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.value, - ) + # These attribute-presence checks are guarded with hasattr since some tests mock out the + # generated __init__ entirely, in which case none of the generated operation-group + # attributes are set on `self`. + if hasattr(self, "agent_endpoint_conversations"): + self.agent_endpoint_conversations = _OperationMethodHeaderProxy( # type: ignore + self.agent_endpoint_conversations, + _AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.value, + ) # Work around a known async aiohttp transport issue (spurious UnicodeDecodeError caused by # compressed response bodies reaching text/JSON deserialization before decompression) by # disabling response compression for these two operation groups only. - self.agents = _AcceptEncodingIdentityProxy(self.agents) # type: ignore - self.agent_endpoint_conversations = _AcceptEncodingIdentityProxy( # type: ignore - self.agent_endpoint_conversations - ) + if hasattr(self, "agents"): + self.agents = _AcceptEncodingIdentityProxy(self.agents) # type: ignore + if hasattr(self, "agent_endpoint_conversations"): + self.agent_endpoint_conversations = _AcceptEncodingIdentityProxy( # type: ignore + self.agent_endpoint_conversations + ) @property def realtime(self) -> AsyncRealtime: diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.pyi b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.pyi index b4fa5b00ddeb..afbddb34ddb9 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.pyi +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.pyi @@ -32,7 +32,14 @@ from openai.types.graders.string_check_grader_param import StringCheckGraderPara from openai.types.eval_create_response import EvalCreateResponse from openai.types.shared_params.metadata import Metadata from ._client import AIProjectClient as AIProjectClientGenerated -from ._realtime import AsyncRealtime, AsyncRealtimeConnection, AsyncRealtimeConnectionManager +from ._realtime import ( + AsyncRealtime, + AsyncRealtimeConnection, + AsyncRealtimeConnectionManager, + ClientEvent, + ConversationItem, + ServerEvent, +) from .operations import TelemetryOperations from ..models import ( AzureAIBenchmarkPreviewEvalRunDataSource, @@ -117,6 +124,14 @@ class _LoggingAsyncByteStream(httpx.AsyncByteStream): ... def _log_streaming_response_notice(logging_enabled: bool) -> bool: ... # To make mypy happy... otherwise imports of the below result in mypy "attr-defined" error -__all__: List[str] = ["AIProjectClient", "AsyncRealtime", "AsyncRealtimeConnection", "AsyncRealtimeConnectionManager"] +__all__: List[str] = [ + "AIProjectClient", + "AsyncRealtime", + "AsyncRealtimeConnection", + "AsyncRealtimeConnectionManager", + "ClientEvent", + "ConversationItem", + "ServerEvent", +] def patch_sdk() -> None: ... diff --git a/sdk/ai/azure-ai-projects/tests/conftest.py b/sdk/ai/azure-ai-projects/tests/conftest.py index 5d5722183e64..605d6f1d9fc6 100644 --- a/sdk/ai/azure-ai-projects/tests/conftest.py +++ b/sdk/ai/azure-ai-projects/tests/conftest.py @@ -369,6 +369,20 @@ def sanitize_url_paths(): # would otherwise fail to decode -> UnicodeDecodeError). add_remove_header_sanitizer(headers="Content-Encoding") + # Strip Foundry-Features from record/playback matching. Its value is a comma-joined list of + # preview opt-in flags that legitimately changes over time as new preview features are added + # (e.g. VoiceAgents=V1Preview was added later); exact-matching it against older cassettes + # would otherwise cause spurious playback failures unrelated to what a given test is actually + # validating. Some affected cassettes (test_ai_agents_instrumentor.py/_async.py) have been + # re-recorded and no longer need this, but others still rely on it pending re-recording (see + # test_responses_instrumentor_workflow.py, which currently fails to re-record live due to an + # unrelated pre-existing gap in its expected span-attribute list vs. actual gen_ai.usage.* + # token attributes now returned by the service). Tests that specifically need to assert on + # this header's value use a dedicated unit-test suite (tests/foundry_features_header) with a + # capturing transport instead of the test-proxy, so this does not reduce coverage of the + # header-injection behavior itself. + add_remove_header_sanitizer(headers="Foundry-Features") + # Remove the following sanitizers since certain fields are needed in tests and are non-sensitive: # - AZSDK3493: $..name # - AZSDK3430: $..id From 1f4f7d576a03cc5e6bf73fe03568f2a38132fe3d Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Mon, 17 Aug 2026 18:20:48 -0700 Subject: [PATCH 27/56] Add optional 'realtime' extra for websockets dependency; fix missing stream=True in session log stream samples --- sdk/ai/azure-ai-projects/dev_requirements.txt | 1 + sdk/ai/azure-ai-projects/pyproject.toml | 5 +++++ .../voice/sample_voice_agent_live_text_conversation.py | 2 +- .../samples/hosted_agents/sample_session_log_stream.py | 1 + .../samples/hosted_agents/sample_session_log_stream_async.py | 1 + 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/sdk/ai/azure-ai-projects/dev_requirements.txt b/sdk/ai/azure-ai-projects/dev_requirements.txt index 6641c1e8f14a..db1490b46b48 100644 --- a/sdk/ai/azure-ai-projects/dev_requirements.txt +++ b/sdk/ai/azure-ai-projects/dev_requirements.txt @@ -14,6 +14,7 @@ azure-monitor-query jsonref opentelemetry-sdk python-dotenv +websockets black # Can't include those, because they are not supported in Python 3.9. Samples that use these package # cannot be run as pytest, because the pipeline will fail on Python 3.9 jobs. diff --git a/sdk/ai/azure-ai-projects/pyproject.toml b/sdk/ai/azure-ai-projects/pyproject.toml index d903f4e1001b..44f29b83dac8 100644 --- a/sdk/ai/azure-ai-projects/pyproject.toml +++ b/sdk/ai/azure-ai-projects/pyproject.toml @@ -43,6 +43,11 @@ dynamic = [ "version", "readme" ] +[project.optional-dependencies] +realtime = [ + "websockets>=13.0", +] + [project.urls] repository = "https://aka.ms/azsdk/azure-ai-projects-v2/python/code" diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py index 6f92a340fe11..ac113503963a 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py @@ -24,7 +24,7 @@ sample_voice_agent_live_text_conversation_async.py for the async version of this one). - pip install "azure-ai-projects>=2.0.0" azure-identity websockets pyaudio + pip install "azure-ai-projects[realtime]>=2.0.0" azure-identity pyaudio USAGE: python sample_voice_agent_live_text_conversation.py diff --git a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_session_log_stream.py b/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_session_log_stream.py index b86587c910b7..f4dfa853d921 100644 --- a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_session_log_stream.py +++ b/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_session_log_stream.py @@ -130,6 +130,7 @@ def _iter_sse_frames(stream, max_log_events: int): agent_name=agent_name, agent_version=created.version, session_id=session.agent_session_id, + stream=True, ) for frame in _iter_sse_frames(raw_stream, max_log_events=30): print(f"SSE event: {frame.get('event')}") diff --git a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_session_log_stream_async.py b/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_session_log_stream_async.py index 64475d2b3142..97cba73d55b5 100644 --- a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_session_log_stream_async.py +++ b/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_session_log_stream_async.py @@ -132,6 +132,7 @@ async def main(): agent_name=agent_name, agent_version=created.version, session_id=session.agent_session_id, + stream=True, ) async for frame in _iter_sse_frames_async(raw_stream, max_log_events=30): print(f"SSE event: {frame.get('event')}") From a15b014fae90bc8b9d00f743c84cb4f9275ac372 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Mon, 17 Aug 2026 19:36:00 -0700 Subject: [PATCH 28/56] Fix pylint reimported warning: remove duplicate AgentKind import in types.py --- sdk/ai/azure-ai-projects/azure/ai/projects/types.py | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/types.py b/sdk/ai/azure-ai-projects/azure/ai/projects/types.py index a3e0a6c42ab2..bad33838f680 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/types.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/types.py @@ -63,7 +63,6 @@ from . import _unions from .models import ( AgentEndpointProtocol, - AgentKind, AttackStrategy, AzureAISearchQueryType, CallableToolAllowedCaller, From 839ca919fe1210ad1f3851c901fec348843c8053 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Tue, 18 Aug 2026 20:48:21 -0700 Subject: [PATCH 29/56] Regenerate SDK from latest voice-agents TypeSpec, fix conversation_id sample bug, add function tool sample, fix mypy/pyright issues --- sdk/ai/azure-ai-projects/PostEmitter.ps1 | 25 + .../azure-ai-projects/apiview-properties.json | 4 +- .../azure/ai/projects/_realtime.py | 1 + .../azure/ai/projects/_unions.py | 4 +- .../azure/ai/projects/_utils/utils.py | 1 - .../azure/ai/projects/aio/_realtime.py | 1 + .../ai/projects/aio/operations/_operations.py | 797 ++++++++--------- .../azure/ai/projects/models/__init__.py | 4 +- .../azure/ai/projects/models/_enums.py | 16 +- .../azure/ai/projects/models/_models.py | 143 ++-- .../azure/ai/projects/models/_patch.py | 2 +- .../ai/projects/operations/_operations.py | 805 ++++++++---------- .../azure/ai/projects/types.py | 16 +- .../voice/sample_voice_agent_function_tool.py | 166 ++++ ...ice_agent_live_audio_conversation_async.py | 9 +- ...mple_voice_agent_live_text_conversation.py | 6 +- ...oice_agent_live_text_conversation_async.py | 6 +- .../tests/agents/test_voice_agent_crud.py | 4 +- ...r_on_agent_endpoint_conversations_async.py | 8 +- sdk/ai/azure-ai-projects/tsp-location.yaml | 50 +- 20 files changed, 1041 insertions(+), 1027 deletions(-) create mode 100644 sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_function_tool.py diff --git a/sdk/ai/azure-ai-projects/PostEmitter.ps1 b/sdk/ai/azure-ai-projects/PostEmitter.ps1 index c5ae7d169221..ecfc398a3240 100644 --- a/sdk/ai/azure-ai-projects/PostEmitter.ps1 +++ b/sdk/ai/azure-ai-projects/PostEmitter.ps1 @@ -161,6 +161,31 @@ foreach ($f in $files) { } +# Fix pyright reportIncompatibleVariableOverride errors: VoiceResponse narrows the inherited +# optional `id`/`conversation_id` fields (from OmitPropertiesRealtimeResponse) to required `str`, +# which pyright flags as an incompatible override since the base type is `Optional[str]`. This is +# an intentional, spec-driven narrowing (the fields are always present on a persisted voice +# response), so silence the two specific lines rather than widen the type. +$f = 'azure\ai\projects\models\_models.py' +$lines = Get-Content $f +$inVoiceResponse = $false +for ($i = 0; $i -lt $lines.Length; $i++) { + if ($lines[$i] -match '^class VoiceResponse\(OmitPropertiesRealtimeResponse\)') { + $inVoiceResponse = $true + continue + } + if ($inVoiceResponse -and $lines[$i] -match '^class \w+') { + $inVoiceResponse = $false + } + if ($inVoiceResponse -and $lines[$i] -match '^\s*id: str = rest_field\(' -and $lines[$i] -notmatch '# type: ignore') { + $lines[$i] = $lines[$i] + ' # type: ignore[reportIncompatibleVariableOverride]' + } + if ($inVoiceResponse -and $lines[$i] -match '^\s*conversation_id: str = rest_field\(' -and $lines[$i] -notmatch '# type: ignore') { + $lines[$i] = $lines[$i] + ' # type: ignore[reportIncompatibleVariableOverride]' + } +} +Set-Content $f $lines + # Finishing by running 'black' tool to format code. pip install black black --config ../../../eng/black-pyproject.toml . diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index ac0d2ad5bdd1..03e4fc81a39d 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -347,6 +347,7 @@ "azure.ai.projects.models.SharepointGroundingToolParameters": "Azure.AI.Projects.SharepointGroundingToolParameters", "azure.ai.projects.models.SharepointPreviewTool": "Azure.AI.Projects.SharepointPreviewTool", "azure.ai.projects.models.SimpleQnADataGenerationJobOptions": "Azure.AI.Projects.SimpleQnADataGenerationJobOptions", + "azure.ai.projects.models.SimulationSeedDataGenerationJobOptions": "Azure.AI.Projects.SimulationSeedDataGenerationJobOptions", "azure.ai.projects.models.SkillDetails": "Azure.AI.Projects.Skill", "azure.ai.projects.models.SkillInlineContent": "Azure.AI.Projects.SkillInlineContent", "azure.ai.projects.models.SkillReferenceParam": "OpenAI.SkillReferenceParam", @@ -357,7 +358,6 @@ "azure.ai.projects.models.SpecificProgrammaticToolCallingParam": "OpenAI.SpecificProgrammaticToolCallingParam", "azure.ai.projects.models.StructuredInputDefinition": "Azure.AI.Projects.StructuredInputDefinition", "azure.ai.projects.models.StructuredOutputDefinition": "Azure.AI.Projects.StructuredOutputDefinition", - "azure.ai.projects.models.TaskGenerationDataGenerationJobOptions": "Azure.AI.Projects.TaskGenerationDataGenerationJobOptions", "azure.ai.projects.models.TaxonomyCategory": "Azure.AI.Projects.TaxonomyCategory", "azure.ai.projects.models.TaxonomySubCategory": "Azure.AI.Projects.TaxonomySubCategory", "azure.ai.projects.models.TelemetryConfig": "Azure.AI.Projects.TelemetryConfig", @@ -788,5 +788,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": "0ee3fce61394" + "CrossLanguageVersion": "9e9ec56d1a91" } \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py index 1df9e3c5aa04..05c5a1573f71 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py @@ -14,6 +14,7 @@ ``websockets`` is required for this feature and is *not* a hard dependency of the package; it is imported lazily so importing the SDK never fails when it is absent. """ + from __future__ import annotations import base64 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 0e5ddbd9c108..25a892edd3d4 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_unions.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_unions.py @@ -31,9 +31,7 @@ "_models.RealtimeConversationItemFunctionCall", "_models.RealtimeConversationItemFunctionCallOutput", ] -VoiceAgentCreateConversationItem = Union[ - "VoiceAgentRequestConversationItem", "_models.RealtimeMCPApprovalResponse" -] +VoiceAgentCreateConversationItem = Union["VoiceAgentRequestConversationItem", "_models.RealtimeMCPApprovalResponse"] VoiceAgentResponseMessageItem = Union[ "_models.RealtimeConversationItemMessageSystem", "_models.RealtimeConversationItemMessageUser", diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/utils.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/utils.py index 9ebe3cda3180..c91d6470e2bf 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/utils.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/utils.py @@ -11,7 +11,6 @@ from .._utils.model_base import Model, SdkJSONEncoder - # file-like tuple could be `(filename, IO (or bytes))` or `(filename, IO (or bytes), content_type)` FileContent = Union[str, bytes, IO[str], IO[bytes]] diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py index 679e6766b555..cc40fc39bae7 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py @@ -28,6 +28,7 @@ ``aiohttp`` is required for this feature and is *not* a hard dependency of the package; it is imported lazily so importing the SDK never fails when it is absent. """ + from __future__ import annotations import base64 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 0ba8d9c80cdc..5b71fdfdae83 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 @@ -32,7 +32,7 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict -from ... import models as _models, types as _types +from ... import models as _models from ..._utils.model_base import Model as _Model, SdkJSONEncoder, _deserialize, _failsafe_deserialize from ..._utils.serialization import Deserializer, Serializer from ..._utils.utils import prepare_multipart_form_data @@ -331,7 +331,7 @@ async def generate_agent( @overload async def generate_agent( - self, body: _types.GenerateAgentRequest, *, content_type: str = "application/json", **kwargs: Any + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentDetails: """Generate an agent. @@ -339,7 +339,7 @@ async def generate_agent( remains fully editable through the standard agent versioning operations. :param body: Required. - :type body: ~azure.ai.projects.types.GenerateAgentRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -369,19 +369,15 @@ async def generate_agent( @distributed_trace_async async def generate_agent( - self, - body: Union[JSON, _types.GenerateAgentRequest, IO[bytes]] = _Unset, - *, - kind: Union[str, _models.AgentKind] = _Unset, - **kwargs: Any + self, body: Union[JSON, IO[bytes]] = _Unset, *, kind: Union[str, _models.AgentKind] = _Unset, **kwargs: Any ) -> _models.AgentDetails: """Generate an agent. Generates and creates an agent from kind-specific high-level inputs. The generated definition remains fully editable through the standard agent versioning operations. - :param body: Is one of the following types: JSON, GenerateAgentRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.GenerateAgentRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword kind: The kind of agent to generate. Known values are: "prompt", "hosted", "workflow", "external", and "voice". Required. :paramtype kind: str or ~azure.ai.projects.models.AgentKind @@ -685,12 +681,7 @@ async def create_version( @overload async def create_version( - self, - agent_name: str, - body: _types.CreateAgentVersionRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentVersionDetails: """Create an agent version. @@ -704,7 +695,7 @@ async def create_version( * Must not exceed 63 characters. Required. :type agent_name: str :param body: Required. - :type body: ~azure.ai.projects.types.CreateAgentVersionRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -742,7 +733,7 @@ async def create_version( async def create_version( self, agent_name: str, - body: Union[JSON, _types.CreateAgentVersionRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, definition: _models.AgentDefinition = _Unset, metadata: Optional[dict[str, str]] = None, @@ -762,9 +753,8 @@ async def create_version( * Can contain hyphens in the middle * Must not exceed 63 characters. Required. :type agent_name: str - :param body: Is one of the following types: JSON, CreateAgentVersionRequest, IO[bytes] - Required. - :type body: JSON or ~azure.ai.projects.types.CreateAgentVersionRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword definition: The agent definition. This can be a prompt, workflow, hosted, external, or voice agent definition. Required. :paramtype definition: ~azure.ai.projects.models.AgentDefinition @@ -911,12 +901,7 @@ async def create_version_from_manifest( @overload async def create_version_from_manifest( - self, - agent_name: str, - body: _types.CreateAgentVersionFromManifestRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentVersionDetails: """Create an agent version from manifest. @@ -930,7 +915,7 @@ async def create_version_from_manifest( * Must not exceed 63 characters. Required. :type agent_name: str :param body: Required. - :type body: ~azure.ai.projects.types.CreateAgentVersionFromManifestRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -968,7 +953,7 @@ async def create_version_from_manifest( async def create_version_from_manifest( self, agent_name: str, - body: Union[JSON, _types.CreateAgentVersionFromManifestRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, manifest_id: str = _Unset, parameter_values: dict[str, Any] = _Unset, @@ -987,9 +972,8 @@ async def create_version_from_manifest( * Can contain hyphens in the middle * Must not exceed 63 characters. Required. :type agent_name: str - :param body: Is one of the following types: JSON, CreateAgentVersionFromManifestRequest, - IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.CreateAgentVersionFromManifestRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword manifest_id: The manifest ID to import the agent version from. Required. :paramtype manifest_id: str :keyword parameter_values: The inputs to the manifest that will result in a fully materialized @@ -1368,12 +1352,7 @@ async def update_details( @overload async def update_details( - self, - agent_name: str, - body: _types.PatchAgentObjectRequest, - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any + self, agent_name: str, body: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.AgentDetails: """Update an agent endpoint. @@ -1382,7 +1361,7 @@ async def update_details( :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str :param body: Required. - :type body: ~azure.ai.projects.types.PatchAgentObjectRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -1415,7 +1394,7 @@ async def update_details( async def update_details( self, agent_name: str, - body: Union[JSON, _types.PatchAgentObjectRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, agent_endpoint: Optional[_models.AgentEndpointConfig] = None, agent_card: Optional[_models.AgentCard] = None, @@ -1427,8 +1406,8 @@ async def update_details( :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str - :param body: Is one of the following types: JSON, PatchAgentObjectRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.PatchAgentObjectRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword agent_endpoint: The endpoint configuration for the agent. Default value is None. :paramtype agent_endpoint: ~azure.ai.projects.models.AgentEndpointConfig :keyword agent_card: Optional agent card for the agent. Default value is None. @@ -1516,19 +1495,14 @@ async def _create_version_from_code( ) -> _models.AgentVersionDetails: ... @overload async def _create_version_from_code( - self, - agent_name: str, - content: _types._CreateAgentVersionFromCodeContent, - *, - code_zip_sha256: str, - **kwargs: Any + self, agent_name: str, content: JSON, *, code_zip_sha256: str, **kwargs: Any ) -> _models.AgentVersionDetails: ... @distributed_trace_async async def _create_version_from_code( self, agent_name: str, - content: Union[_models._models._CreateAgentVersionFromCodeContent, _types._CreateAgentVersionFromCodeContent], + content: Union[_models._models._CreateAgentVersionFromCodeContent, JSON], *, code_zip_sha256: str, **kwargs: Any @@ -1547,10 +1521,9 @@ async def _create_version_from_code( * Can contain hyphens in the middle * Must not exceed 63 characters. Required. :type agent_name: str - :param content: The content multipart request content. Is one of the following types: - _CreateAgentVersionFromCodeContent Required. - :type content: ~azure.ai.projects.models._models._CreateAgentVersionFromCodeContent or - ~azure.ai.projects.types._CreateAgentVersionFromCodeContent + :param content: The content multipart request content. Is either a + _CreateAgentVersionFromCodeContent type or a JSON type. Required. + :type content: ~azure.ai.projects.models._models._CreateAgentVersionFromCodeContent or JSON :keyword code_zip_sha256: SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity verification. Required. :paramtype code_zip_sha256: str @@ -1847,12 +1820,7 @@ async def create_session( @overload async def create_session( - self, - agent_name: str, - body: _types.CreateSessionRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentSessionResource: """Create a session. @@ -1863,7 +1831,7 @@ async def create_session( :param agent_name: The name of the agent to create a session for. Required. :type agent_name: str :param body: Required. - :type body: ~azure.ai.projects.types.CreateSessionRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1898,7 +1866,7 @@ async def create_session( async def create_session( self, agent_name: str, - body: Union[JSON, _types.CreateSessionRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, version_indicator: _models.VersionIndicator = _Unset, agent_session_id: Optional[str] = None, @@ -1912,8 +1880,8 @@ async def create_session( :param agent_name: The name of the agent to create a session for. Required. :type agent_name: str - :param body: Is one of the following types: JSON, CreateSessionRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.CreateSessionRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword version_indicator: Determines which agent version backs the session. Required. :paramtype version_indicator: ~azure.ai.projects.models.VersionIndicator :keyword agent_session_id: Optional caller-provided session ID. If specified, it must be unique @@ -2287,9 +2255,7 @@ 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: @@ -2347,7 +2313,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 ) @@ -4096,7 +4062,7 @@ async def create_or_update( @overload async def create_or_update( - self, id: str, evaluation_rule: _types.EvaluationRule, *, content_type: str = "application/json", **kwargs: Any + self, id: str, evaluation_rule: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationRule: """Create or update an evaluation rule. @@ -4105,7 +4071,7 @@ async def create_or_update( :param id: Unique identifier for the evaluation rule. Required. :type id: str :param evaluation_rule: Evaluation rule resource. Required. - :type evaluation_rule: ~azure.ai.projects.types.EvaluationRule + :type evaluation_rule: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4136,7 +4102,7 @@ async def create_or_update( @distributed_trace_async async def create_or_update( - self, id: str, evaluation_rule: Union[_models.EvaluationRule, _types.EvaluationRule, IO[bytes]], **kwargs: Any + self, id: str, evaluation_rule: Union[_models.EvaluationRule, JSON, IO[bytes]], **kwargs: Any ) -> _models.EvaluationRule: """Create or update an evaluation rule. @@ -4144,10 +4110,9 @@ async def create_or_update( :param id: Unique identifier for the evaluation rule. Required. :type id: str - :param evaluation_rule: Evaluation rule resource. Is either a EvaluationRule type or a - IO[bytes] type. Required. - :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule or - ~azure.ai.projects.types.EvaluationRule or IO[bytes] + :param evaluation_rule: Evaluation rule resource. Is one of the following types: + EvaluationRule, JSON, IO[bytes] Required. + :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule or JSON or IO[bytes] :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationRule :raises ~azure.core.exceptions.HttpResponseError: @@ -4937,7 +4902,7 @@ async def create_or_update( self, name: str, version: str, - dataset_version: _types.DatasetVersion, + dataset_version: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -4951,7 +4916,7 @@ async def create_or_update( :param version: The specific version id of the DatasetVersion to create or update. Required. :type version: str :param dataset_version: The DatasetVersion to create or update. Required. - :type dataset_version: ~azure.ai.projects.types.DatasetVersion + :type dataset_version: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -4990,11 +4955,7 @@ async def create_or_update( @distributed_trace_async async def create_or_update( - self, - name: str, - version: str, - dataset_version: Union[_models.DatasetVersion, _types.DatasetVersion, IO[bytes]], - **kwargs: Any + self, name: str, version: str, dataset_version: Union[_models.DatasetVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.DatasetVersion: """Create or update a version. @@ -5004,10 +4965,9 @@ async def create_or_update( :type name: str :param version: The specific version id of the DatasetVersion to create or update. Required. :type version: str - :param dataset_version: The DatasetVersion to create or update. Is either a DatasetVersion type - or a IO[bytes] type. Required. - :type dataset_version: ~azure.ai.projects.models.DatasetVersion or - ~azure.ai.projects.types.DatasetVersion or IO[bytes] + :param dataset_version: The DatasetVersion to create or update. Is one of the following types: + DatasetVersion, JSON, IO[bytes] Required. + :type dataset_version: ~azure.ai.projects.models.DatasetVersion or JSON or IO[bytes] :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -5107,7 +5067,7 @@ async def pending_upload( self, name: str, version: str, - pending_upload_request: _types.PendingUploadRequest, + pending_upload_request: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -5121,7 +5081,7 @@ async def pending_upload( :param version: The specific version id of the DatasetVersion to operate on. Required. :type version: str :param pending_upload_request: The pending upload request parameters. Required. - :type pending_upload_request: ~azure.ai.projects.types.PendingUploadRequest + :type pending_upload_request: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5163,7 +5123,7 @@ async def pending_upload( self, name: str, version: str, - pending_upload_request: Union[_models.PendingUploadRequest, _types.PendingUploadRequest, IO[bytes]], + pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.PendingUploadResponse: """Start a pending upload. @@ -5174,10 +5134,10 @@ async def pending_upload( :type name: str :param version: The specific version id of the DatasetVersion to operate on. Required. :type version: str - :param pending_upload_request: The pending upload request parameters. Is either a - PendingUploadRequest type or a IO[bytes] type. Required. - :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or - ~azure.ai.projects.types.PendingUploadRequest or IO[bytes] + :param pending_upload_request: The pending upload request parameters. Is one of the following + types: PendingUploadRequest, JSON, IO[bytes] Required. + :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or JSON or + IO[bytes] :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -5857,13 +5817,7 @@ async def create_or_update( @overload async def create_or_update( - self, - name: str, - version: str, - index: _types.Index, - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any + self, name: str, version: str, index: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.Index: """Create or update a version. @@ -5874,7 +5828,7 @@ async def create_or_update( :param version: The specific version id of the Index to create or update. Required. :type version: str :param index: The Index to create or update. Required. - :type index: ~azure.ai.projects.types.Index + :type index: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -5913,7 +5867,7 @@ async def create_or_update( @distributed_trace_async async def create_or_update( - self, name: str, version: str, index: Union[_models.Index, _types.Index, IO[bytes]], **kwargs: Any + self, name: str, version: str, index: Union[_models.Index, JSON, IO[bytes]], **kwargs: Any ) -> _models.Index: """Create or update a version. @@ -5923,9 +5877,9 @@ async def create_or_update( :type name: str :param version: The specific version id of the Index to create or update. Required. :type version: str - :param index: The Index to create or update. Is either a Index type or a IO[bytes] type. - Required. - :type index: ~azure.ai.projects.models.Index or ~azure.ai.projects.types.Index or IO[bytes] + :param index: The Index to create or update. Is one of the following types: Index, JSON, + IO[bytes] Required. + :type index: ~azure.ai.projects.models.Index or JSON or IO[bytes] :return: Index. The Index is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Index :raises ~azure.core.exceptions.HttpResponseError: @@ -6053,12 +6007,7 @@ async def create_version( @overload async def create_version( - self, - name: str, - body: _types.CreateToolboxVersionRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ToolboxVersionObject: """Create a new version of a toolbox. @@ -6068,7 +6017,7 @@ async def create_version( Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.CreateToolboxVersionRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6102,7 +6051,7 @@ async def create_version( async def create_version( self, name: str, - body: Union[JSON, _types.CreateToolboxVersionRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, tools: List[_models.ToolboxTool] = _Unset, description: Optional[str] = None, @@ -6118,9 +6067,8 @@ async def create_version( :param name: The name of the toolbox. If the toolbox does not exist, it will be created. Required. :type name: str - :param body: Is one of the following types: JSON, CreateToolboxVersionRequest, IO[bytes] - Required. - :type body: JSON or ~azure.ai.projects.types.CreateToolboxVersionRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword tools: The list of tools to include in this version. Required. :paramtype tools: list[~azure.ai.projects.models.ToolboxTool] :keyword description: A human-readable description of the toolbox. Default value is None. @@ -6562,7 +6510,7 @@ async def update( @overload async def update( - self, name: str, body: _types.UpdateToolboxRequest1, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. @@ -6571,7 +6519,7 @@ async def update( :param name: The name of the toolbox to update. Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.UpdateToolboxRequest1 + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6602,12 +6550,7 @@ async def update( @distributed_trace_async async def update( - self, - name: str, - body: Union[JSON, _types.UpdateToolboxRequest1, IO[bytes]] = _Unset, - *, - default_version: str = _Unset, - **kwargs: Any + self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, default_version: str = _Unset, **kwargs: Any ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. @@ -6615,8 +6558,8 @@ async def update( :param name: The name of the toolbox to update. Required. :type name: str - :param body: Is one of the following types: JSON, UpdateToolboxRequest1, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.UpdateToolboxRequest1 or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword 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. :paramtype default_version: str @@ -7057,7 +7000,7 @@ async def create( @overload async def create( - self, name: str, taxonomy: _types.EvaluationTaxonomy, *, content_type: str = "application/json", **kwargs: Any + self, name: str, taxonomy: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. @@ -7066,7 +7009,7 @@ async def create( :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. - :type taxonomy: ~azure.ai.projects.types.EvaluationTaxonomy + :type taxonomy: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7097,10 +7040,7 @@ async def create( @distributed_trace_async async def create( - self, - name: str, - taxonomy: Union[_models.EvaluationTaxonomy, _types.EvaluationTaxonomy, IO[bytes]], - **kwargs: Any + self, name: str, taxonomy: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], **kwargs: Any ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. @@ -7108,10 +7048,9 @@ async def create( :param name: The name of the evaluation taxonomy. Required. :type name: str - :param taxonomy: The evaluation taxonomy. Is either a EvaluationTaxonomy type or a IO[bytes] - type. Required. - :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or - ~azure.ai.projects.types.EvaluationTaxonomy or IO[bytes] + :param taxonomy: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, + JSON, IO[bytes] Required. + :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: @@ -7199,7 +7138,7 @@ async def update( @overload async def update( - self, name: str, taxonomy: _types.EvaluationTaxonomy, *, content_type: str = "application/json", **kwargs: Any + self, name: str, taxonomy: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. @@ -7208,7 +7147,7 @@ async def update( :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. - :type taxonomy: ~azure.ai.projects.types.EvaluationTaxonomy + :type taxonomy: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7239,10 +7178,7 @@ async def update( @distributed_trace_async async def update( - self, - name: str, - taxonomy: Union[_models.EvaluationTaxonomy, _types.EvaluationTaxonomy, IO[bytes]], - **kwargs: Any + self, name: str, taxonomy: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], **kwargs: Any ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. @@ -7250,10 +7186,9 @@ async def update( :param name: The name of the evaluation taxonomy. Required. :type name: str - :param taxonomy: The evaluation taxonomy. Is either a EvaluationTaxonomy type or a IO[bytes] - type. Required. - :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or - ~azure.ai.projects.types.EvaluationTaxonomy or IO[bytes] + :param taxonomy: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, + JSON, IO[bytes] Required. + :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: @@ -7697,12 +7632,7 @@ async def create_version( @overload async def create_version( - self, - name: str, - evaluator_version: _types.EvaluatorVersion, - *, - content_type: str = "application/json", - **kwargs: Any + self, name: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: """Create an evaluator version. @@ -7711,7 +7641,7 @@ async def create_version( :param name: The name of the resource. Required. :type name: str :param evaluator_version: Required. - :type evaluator_version: ~azure.ai.projects.types.EvaluatorVersion + :type evaluator_version: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7742,10 +7672,7 @@ async def create_version( @distributed_trace_async async def create_version( - self, - name: str, - evaluator_version: Union[_models.EvaluatorVersion, _types.EvaluatorVersion, IO[bytes]], - **kwargs: Any + self, name: str, evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.EvaluatorVersion: """Create an evaluator version. @@ -7753,9 +7680,9 @@ async def create_version( :param name: The name of the resource. Required. :type name: str - :param evaluator_version: Is either a EvaluatorVersion type or a IO[bytes] type. Required. - :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or - ~azure.ai.projects.types.EvaluatorVersion or IO[bytes] + :param evaluator_version: Is one of the following types: EvaluatorVersion, JSON, IO[bytes] + Required. + :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or JSON or IO[bytes] :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -7851,13 +7778,7 @@ async def update_version( @overload async def update_version( - self, - name: str, - version: str, - evaluator_version: _types.EvaluatorVersion, - *, - content_type: str = "application/json", - **kwargs: Any + self, name: str, version: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: """Update an evaluator version. @@ -7868,7 +7789,7 @@ async def update_version( :param version: The version of the EvaluatorVersion to update. Required. :type version: str :param evaluator_version: Evaluator resource. Required. - :type evaluator_version: ~azure.ai.projects.types.EvaluatorVersion + :type evaluator_version: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7910,7 +7831,7 @@ async def update_version( self, name: str, version: str, - evaluator_version: Union[_models.EvaluatorVersion, _types.EvaluatorVersion, IO[bytes]], + evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.EvaluatorVersion: """Update an evaluator version. @@ -7921,10 +7842,9 @@ async def update_version( :type name: str :param version: The version of the EvaluatorVersion to update. Required. :type version: str - :param evaluator_version: Evaluator resource. Is either a EvaluatorVersion type or a IO[bytes] - type. Required. - :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or - ~azure.ai.projects.types.EvaluatorVersion or IO[bytes] + :param evaluator_version: Evaluator resource. Is one of the following types: EvaluatorVersion, + JSON, IO[bytes] Required. + :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or JSON or IO[bytes] :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -8025,7 +7945,7 @@ async def pending_upload( self, name: str, version: str, - pending_upload_request: _types.PendingUploadRequest, + pending_upload_request: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -8040,7 +7960,7 @@ async def pending_upload( :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str :param pending_upload_request: The pending upload request parameters. Required. - :type pending_upload_request: ~azure.ai.projects.types.PendingUploadRequest + :type pending_upload_request: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -8083,7 +8003,7 @@ async def pending_upload( self, name: str, version: str, - pending_upload_request: Union[_models.PendingUploadRequest, _types.PendingUploadRequest, IO[bytes]], + pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.PendingUploadResponse: """Start a pending upload. @@ -8095,10 +8015,10 @@ async def pending_upload( :type name: str :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str - :param pending_upload_request: The pending upload request parameters. Is either a - PendingUploadRequest type or a IO[bytes] type. Required. - :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or - ~azure.ai.projects.types.PendingUploadRequest or IO[bytes] + :param pending_upload_request: The pending upload request parameters. Is one of the following + types: PendingUploadRequest, JSON, IO[bytes] Required. + :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or JSON or + IO[bytes] :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -8203,7 +8123,7 @@ async def get_credentials( self, name: str, version: str, - credential_request: _types.EvaluatorCredentialRequest, + credential_request: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -8218,7 +8138,7 @@ async def get_credentials( :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str :param credential_request: The credential request parameters. Required. - :type credential_request: ~azure.ai.projects.types.EvaluatorCredentialRequest + :type credential_request: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -8261,7 +8181,7 @@ async def get_credentials( self, name: str, version: str, - credential_request: Union[_models.EvaluatorCredentialRequest, _types.EvaluatorCredentialRequest, IO[bytes]], + credential_request: Union[_models.EvaluatorCredentialRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.DatasetCredential: """Get evaluator credentials. @@ -8273,10 +8193,10 @@ async def get_credentials( :type name: str :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str - :param credential_request: The credential request parameters. Is either a - EvaluatorCredentialRequest type or a IO[bytes] type. Required. - :type credential_request: ~azure.ai.projects.models.EvaluatorCredentialRequest or - ~azure.ai.projects.types.EvaluatorCredentialRequest or IO[bytes] + :param credential_request: The credential request parameters. Is one of the following types: + EvaluatorCredentialRequest, JSON, IO[bytes] Required. + :type credential_request: ~azure.ai.projects.models.EvaluatorCredentialRequest or JSON or + IO[bytes] :return: DatasetCredential. The DatasetCredential is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetCredential :raises ~azure.core.exceptions.HttpResponseError: @@ -8349,7 +8269,7 @@ async def get_credentials( async def _create_generation_job_initial( self, - job: Union[_models.EvaluatorGenerationJob, _types.EvaluatorGenerationJob, IO[bytes]], + job: Union[_models.EvaluatorGenerationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -8449,12 +8369,7 @@ async def begin_create_generation_job( @overload async def begin_create_generation_job( - self, - job: _types.EvaluatorGenerationJob, - *, - operation_id: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any + self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.EvaluatorVersion]: """Create an evaluator generation job. @@ -8462,7 +8377,7 @@ async def begin_create_generation_job( from the provided source materials asynchronously. :param job: The job to create. Required. - :type job: ~azure.ai.projects.types.EvaluatorGenerationJob + :type job: JSON :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -8506,7 +8421,7 @@ async def begin_create_generation_job( @distributed_trace_async async def begin_create_generation_job( self, - job: Union[_models.EvaluatorGenerationJob, _types.EvaluatorGenerationJob, IO[bytes]], + job: Union[_models.EvaluatorGenerationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -8516,10 +8431,9 @@ async def begin_create_generation_job( Creates an evaluator generation job. The service generates rubric-based evaluator definitions from the provided source materials asynchronously. - :param job: The job to create. Is either a EvaluatorGenerationJob type or a IO[bytes] type. - Required. - :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or - ~azure.ai.projects.types.EvaluatorGenerationJob or IO[bytes] + :param job: The job to create. Is one of the following types: EvaluatorGenerationJob, JSON, + IO[bytes] Required. + :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or JSON or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -8912,7 +8826,7 @@ async def generate( @overload async def generate( - self, insight: _types.Insight, *, content_type: str = "application/json", **kwargs: Any + self, insight: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Insight: """Generate insights. @@ -8920,7 +8834,7 @@ async def generate( :param insight: Complete evaluation configuration including data source, evaluators, and result settings. Required. - :type insight: ~azure.ai.projects.types.Insight + :type insight: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -8949,17 +8863,14 @@ async def generate( """ @distributed_trace_async - async def generate( - self, insight: Union[_models.Insight, _types.Insight, IO[bytes]], **kwargs: Any - ) -> _models.Insight: + async def generate(self, insight: Union[_models.Insight, JSON, IO[bytes]], **kwargs: Any) -> _models.Insight: """Generate insights. Generates an insights report from the provided evaluation configuration. :param insight: Complete evaluation configuration including data source, evaluators, and result - settings. Is either a Insight type or a IO[bytes] type. Required. - :type insight: ~azure.ai.projects.models.Insight or ~azure.ai.projects.types.Insight or - IO[bytes] + settings. Is one of the following types: Insight, JSON, IO[bytes] Required. + :type insight: ~azure.ai.projects.models.Insight or JSON or IO[bytes] :return: Insight. The Insight is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Insight :raises ~azure.core.exceptions.HttpResponseError: @@ -9273,14 +9184,14 @@ async def create( @overload async def create( - self, body: _types.CreateMemoryStoreRequest, *, content_type: str = "application/json", **kwargs: Any + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: """Create a memory store. Creates a memory store resource with the provided configuration. :param body: Required. - :type body: ~azure.ai.projects.types.CreateMemoryStoreRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9310,7 +9221,7 @@ async def create( @distributed_trace_async async def create( self, - body: Union[JSON, _types.CreateMemoryStoreRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, name: str = _Unset, definition: _models.MemoryStoreDefinition = _Unset, @@ -9322,8 +9233,8 @@ async def create( Creates a memory store resource with the provided configuration. - :param body: Is one of the following types: JSON, CreateMemoryStoreRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.CreateMemoryStoreRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword name: The name of the memory store. Required. :paramtype name: str :keyword definition: The memory store definition. Required. @@ -9439,7 +9350,7 @@ async def update( @overload async def update( - self, name: str, body: _types.UpdateMemoryStoreRequest, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: """Update a memory store. @@ -9448,7 +9359,7 @@ async def update( :param name: The name of the memory store to update. Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.UpdateMemoryStoreRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9481,7 +9392,7 @@ async def update( async def update( self, name: str, - body: Union[JSON, _types.UpdateMemoryStoreRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, description: Optional[str] = None, metadata: Optional[dict[str, str]] = None, @@ -9493,8 +9404,8 @@ async def update( :param name: The name of the memory store to update. Required. :type name: str - :param body: Is one of the following types: JSON, UpdateMemoryStoreRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.UpdateMemoryStoreRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword description: A human-readable description of the memory store. Default value is None. :paramtype description: str :keyword metadata: Arbitrary key-value metadata to associate with the memory store. Default @@ -9812,7 +9723,7 @@ async def _search_memories( ) -> _models.MemoryStoreSearchResult: ... @overload async def _search_memories( - self, name: str, body: _types.SearchMemoriesRequest, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreSearchResult: ... @overload async def _search_memories( @@ -9823,7 +9734,7 @@ async def _search_memories( async def _search_memories( self, name: str, - body: Union[JSON, _types.SearchMemoriesRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, items: Optional[List[dict[str, Any]]] = None, @@ -9837,8 +9748,8 @@ async def _search_memories( :param name: The name of the memory store to search. Required. :type name: str - :param body: Is one of the following types: JSON, SearchMemoriesRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.SearchMemoriesRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -9926,7 +9837,7 @@ async def _search_memories( async def _update_memories_initial( self, name: str, - body: Union[JSON, _types.UpdateMemoriesRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, items: Optional[List[dict[str, Any]]] = None, @@ -10022,7 +9933,7 @@ async def _begin_update_memories( ) -> AsyncLROPoller[_models.MemoryStoreUpdateCompletedResult]: ... @overload async def _begin_update_memories( - self, name: str, body: _types.UpdateMemoriesRequest, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.MemoryStoreUpdateCompletedResult]: ... @overload async def _begin_update_memories( @@ -10033,7 +9944,7 @@ async def _begin_update_memories( async def _begin_update_memories( self, name: str, - body: Union[JSON, _types.UpdateMemoriesRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, items: Optional[List[dict[str, Any]]] = None, @@ -10048,8 +9959,8 @@ async def _begin_update_memories( :param name: The name of the memory store to update. Required. :type name: str - :param body: Is one of the following types: JSON, UpdateMemoriesRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.UpdateMemoriesRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -10155,7 +10066,7 @@ async def delete_scope( @overload async def delete_scope( - self, name: str, body: _types.DeleteScopeRequest, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: """Delete memories by scope. @@ -10164,7 +10075,7 @@ async def delete_scope( :param name: The name of the memory store. Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.DeleteScopeRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10197,12 +10108,7 @@ async def delete_scope( @distributed_trace_async async def delete_scope( - self, - name: str, - body: Union[JSON, _types.DeleteScopeRequest, IO[bytes]] = _Unset, - *, - scope: str = _Unset, - **kwargs: Any + self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: """Delete memories by scope. @@ -10210,8 +10116,8 @@ async def delete_scope( :param name: The name of the memory store. Required. :type name: str - :param body: Is one of the following types: JSON, DeleteScopeRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.DeleteScopeRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories to delete, such as a user ID. Required. :paramtype scope: str @@ -10325,7 +10231,7 @@ async def create_memory( @overload async def create_memory( - self, name: str, body: _types.CreateMemoryRequest, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: """Create a memory item. @@ -10334,7 +10240,7 @@ async def create_memory( :param name: The name of the memory store. Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.CreateMemoryRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10367,7 +10273,7 @@ async def create_memory( async def create_memory( self, name: str, - body: Union[JSON, _types.CreateMemoryRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, content: str = _Unset, @@ -10380,8 +10286,8 @@ async def create_memory( :param name: The name of the memory store. Required. :type name: str - :param body: Is one of the following types: JSON, CreateMemoryRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.CreateMemoryRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -10492,13 +10398,7 @@ async def update_memory( @overload async def update_memory( - self, - name: str, - memory_id: str, - body: _types.UpdateMemoryRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, name: str, memory_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: """Update a memory item. @@ -10509,7 +10409,7 @@ async def update_memory( :param memory_id: The ID of the memory item to update. Required. :type memory_id: str :param body: Required. - :type body: ~azure.ai.projects.types.UpdateMemoryRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10542,13 +10442,7 @@ async def update_memory( @distributed_trace_async async def update_memory( - self, - name: str, - memory_id: str, - body: Union[JSON, _types.UpdateMemoryRequest, IO[bytes]] = _Unset, - *, - content: str = _Unset, - **kwargs: Any + self, name: str, memory_id: str, body: Union[JSON, IO[bytes]] = _Unset, *, content: str = _Unset, **kwargs: Any ) -> _models.MemoryItem: """Update a memory item. @@ -10558,8 +10452,8 @@ async def update_memory( :type name: str :param memory_id: The ID of the memory item to update. Required. :type memory_id: str - :param body: Is one of the following types: JSON, UpdateMemoryRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.UpdateMemoryRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword content: The updated content of the memory. Required. :paramtype content: str :return: MemoryItem. The MemoryItem is compatible with MutableMapping @@ -10758,7 +10652,7 @@ def list_memories( def list_memories( self, name: str, - body: _types.ListMemoriesRequest, + body: JSON, *, kind: Optional[Union[str, _models.MemoryItemKind]] = None, limit: Optional[int] = None, @@ -10774,7 +10668,7 @@ def list_memories( :param name: The name of the memory store. Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.ListMemoriesRequest + :type body: JSON :keyword kind: The kind of the memory item. Known values are: "user_profile", "chat_summary", and "procedural". Default value is None. :paramtype kind: str or ~azure.ai.projects.models.MemoryItemKind @@ -10850,7 +10744,7 @@ def list_memories( def list_memories( self, name: str, - body: Union[JSON, _types.ListMemoriesRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, kind: Optional[Union[str, _models.MemoryItemKind]] = None, @@ -10865,8 +10759,8 @@ def list_memories( :param name: The name of the memory store. Required. :type name: str - :param body: Is one of the following types: JSON, ListMemoriesRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.ListMemoriesRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -11392,7 +11286,7 @@ async def update( self, name: str, version: str, - model_version_update: _types.UpdateModelVersionRequest, + model_version_update: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -11407,7 +11301,7 @@ async def update( Required. :type version: str :param model_version_update: The UpdateModelVersionRequest to create or update. Required. - :type model_version_update: ~azure.ai.projects.types.UpdateModelVersionRequest + :type model_version_update: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -11450,7 +11344,7 @@ async def update( self, name: str, version: str, - model_version_update: Union[_models.UpdateModelVersionRequest, _types.UpdateModelVersionRequest, IO[bytes]], + model_version_update: Union[_models.UpdateModelVersionRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.ModelVersion: """Update a model version. @@ -11462,10 +11356,10 @@ async def update( :param version: The specific version id of the UpdateModelVersionRequest to create or update. Required. :type version: str - :param model_version_update: The UpdateModelVersionRequest to create or update. Is either a - UpdateModelVersionRequest type or a IO[bytes] type. Required. - :type model_version_update: ~azure.ai.projects.models.UpdateModelVersionRequest or - ~azure.ai.projects.types.UpdateModelVersionRequest or IO[bytes] + :param model_version_update: The UpdateModelVersionRequest to create or update. Is one of the + following types: UpdateModelVersionRequest, JSON, IO[bytes] Required. + :type model_version_update: ~azure.ai.projects.models.UpdateModelVersionRequest or JSON or + IO[bytes] :return: ModelVersion. The ModelVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.ModelVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -11563,13 +11457,7 @@ async def pending_create_version( @overload async def pending_create_version( - self, - name: str, - version: str, - model_version: _types.ModelVersion, - *, - content_type: str = "application/json", - **kwargs: Any + self, name: str, version: str, model_version: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CreateAsyncResponse: """Create a model version async. @@ -11581,7 +11469,7 @@ async def pending_create_version( :param version: Version of the model. Required. :type version: str :param model_version: Model version to create. Required. - :type model_version: ~azure.ai.projects.types.ModelVersion + :type model_version: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11621,11 +11509,7 @@ async def pending_create_version( @distributed_trace_async async def pending_create_version( - self, - name: str, - version: str, - model_version: Union[_models.ModelVersion, _types.ModelVersion, IO[bytes]], - **kwargs: Any + self, name: str, version: str, model_version: Union[_models.ModelVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.CreateAsyncResponse: """Create a model version async. @@ -11636,10 +11520,9 @@ async def pending_create_version( :type name: str :param version: Version of the model. Required. :type version: str - :param model_version: Model version to create. Is either a ModelVersion type or a IO[bytes] - type. Required. - :type model_version: ~azure.ai.projects.models.ModelVersion or - ~azure.ai.projects.types.ModelVersion or IO[bytes] + :param model_version: Model version to create. Is one of the following types: ModelVersion, + JSON, IO[bytes] Required. + :type model_version: ~azure.ai.projects.models.ModelVersion or JSON or IO[bytes] :return: CreateAsyncResponse. The CreateAsyncResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.CreateAsyncResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -11743,7 +11626,7 @@ async def pending_upload( self, name: str, version: str, - pending_upload_request: _types.ModelPendingUploadRequest, + pending_upload_request: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -11757,7 +11640,7 @@ async def pending_upload( :param version: Version of the model. Required. :type version: str :param pending_upload_request: The pending upload request request body. Required. - :type pending_upload_request: ~azure.ai.projects.types.ModelPendingUploadRequest + :type pending_upload_request: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11801,7 +11684,7 @@ async def pending_upload( self, name: str, version: str, - pending_upload_request: Union[_models.ModelPendingUploadRequest, _types.ModelPendingUploadRequest, IO[bytes]], + pending_upload_request: Union[_models.ModelPendingUploadRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.ModelPendingUploadResponse: """Start a pending upload. @@ -11812,10 +11695,10 @@ async def pending_upload( :type name: str :param version: Version of the model. Required. :type version: str - :param pending_upload_request: The pending upload request request body. Is either a - ModelPendingUploadRequest type or a IO[bytes] type. Required. - :type pending_upload_request: ~azure.ai.projects.models.ModelPendingUploadRequest or - ~azure.ai.projects.types.ModelPendingUploadRequest or IO[bytes] + :param pending_upload_request: The pending upload request request body. Is one of the following + types: ModelPendingUploadRequest, JSON, IO[bytes] Required. + :type pending_upload_request: ~azure.ai.projects.models.ModelPendingUploadRequest or JSON or + IO[bytes] :return: ModelPendingUploadResponse. The ModelPendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.ModelPendingUploadResponse @@ -11916,7 +11799,7 @@ async def get_credentials( self, name: str, version: str, - credential_request: _types.ModelCredentialRequest, + credential_request: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -11930,7 +11813,7 @@ async def get_credentials( :param version: Version of the model. Required. :type version: str :param credential_request: The credential request request body. Required. - :type credential_request: ~azure.ai.projects.types.ModelCredentialRequest + :type credential_request: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11972,7 +11855,7 @@ async def get_credentials( self, name: str, version: str, - credential_request: Union[_models.ModelCredentialRequest, _types.ModelCredentialRequest, IO[bytes]], + credential_request: Union[_models.ModelCredentialRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.DatasetCredential: """Get model asset credentials. @@ -11983,10 +11866,9 @@ async def get_credentials( :type name: str :param version: Version of the model. Required. :type version: str - :param credential_request: The credential request request body. Is either a - ModelCredentialRequest type or a IO[bytes] type. Required. - :type credential_request: ~azure.ai.projects.models.ModelCredentialRequest or - ~azure.ai.projects.types.ModelCredentialRequest or IO[bytes] + :param credential_request: The credential request request body. Is one of the following types: + ModelCredentialRequest, JSON, IO[bytes] Required. + :type credential_request: ~azure.ai.projects.models.ModelCredentialRequest or JSON or IO[bytes] :return: DatasetCredential. The DatasetCredential is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetCredential :raises ~azure.core.exceptions.HttpResponseError: @@ -12243,15 +12125,13 @@ async def create( """ @overload - async def create( - self, red_team: _types.RedTeam, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RedTeam: + async def create(self, red_team: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.RedTeam: """Create a redteam run. Submits a new redteam run for execution with the provided configuration. :param red_team: Redteam to be run. Required. - :type red_team: ~azure.ai.projects.types.RedTeam + :type red_team: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -12279,16 +12159,14 @@ async def create( """ @distributed_trace_async - async def create( - self, red_team: Union[_models.RedTeam, _types.RedTeam, IO[bytes]], **kwargs: Any - ) -> _models.RedTeam: + async def create(self, red_team: Union[_models.RedTeam, JSON, IO[bytes]], **kwargs: Any) -> _models.RedTeam: """Create a redteam run. Submits a new redteam run for execution with the provided configuration. - :param red_team: Redteam to be run. Is either a RedTeam type or a IO[bytes] type. Required. - :type red_team: ~azure.ai.projects.models.RedTeam or ~azure.ai.projects.types.RedTeam or - IO[bytes] + :param red_team: Redteam to be run. Is one of the following types: RedTeam, JSON, IO[bytes] + Required. + :type red_team: ~azure.ai.projects.models.RedTeam or JSON or IO[bytes] :return: RedTeam. The RedTeam is compatible with MutableMapping :rtype: ~azure.ai.projects.models.RedTeam :raises ~azure.core.exceptions.HttpResponseError: @@ -12412,12 +12290,7 @@ async def create_or_update( @overload async def create_or_update( - self, - routine_name: str, - body: _types.CreateOrUpdateRoutineRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, routine_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Routine: """Create or update a routine. @@ -12426,7 +12299,7 @@ async def create_or_update( :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. - :type body: ~azure.ai.projects.types.CreateOrUpdateRoutineRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -12459,7 +12332,7 @@ async def create_or_update( async def create_or_update( self, routine_name: str, - body: Union[JSON, _types.CreateOrUpdateRoutineRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, description: Optional[str] = None, enabled: Optional[bool] = None, @@ -12473,9 +12346,8 @@ async def create_or_update( :param routine_name: The unique name of the routine. Required. :type routine_name: str - :param body: Is one of the following types: JSON, CreateOrUpdateRoutineRequest, IO[bytes] - Required. - :type body: JSON or ~azure.ai.projects.types.CreateOrUpdateRoutineRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword description: A human-readable description of the routine. Default value is None. :paramtype description: str :keyword enabled: Whether the routine is enabled. Default value is None. @@ -12760,7 +12632,12 @@ async def disable(self, routine_name: str, **kwargs: Any) -> _models.Routine: @distributed_trace def list( - self, *, limit: Optional[int] = None, before: Optional[str] = None, order: Optional[str] = None, **kwargs: Any + self, + *, + limit: Optional[int] = None, + after: Optional[str] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + **kwargs: Any ) -> AsyncItemPaged["_models.Routine"]: """List routines. @@ -12768,12 +12645,14 @@ def list( :keyword limit: The maximum number of routines to return. Default value is None. :paramtype limit: int - :keyword before: Unsupported. Reserved for future backward pagination support. Default value is - None. - :paramtype before: str - :keyword order: The ordering direction. Supported values are asc and desc. Default value is - None. - :paramtype order: str + :keyword after: An opaque continuation token identifying where to resume the list. Prefer + following the ``next_link`` returned by the previous response, which embeds this value. Default + value is None. + :paramtype after: str + :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 :return: An iterator like instance of Routine :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.Routine] :raises ~azure.core.exceptions.HttpResponseError: @@ -12791,21 +12670,47 @@ def list( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(_continuation_token=None): + def prepare_request(next_link=None): + if not next_link: + + _request = build_beta_routines_list_request( + limit=limit, + after=after, + order=order, + 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) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_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) - _request = build_beta_routines_list_request( - limit=limit, - after=_continuation_token, - before=before, - order=order, - 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): @@ -12816,10 +12721,10 @@ async def extract_data(pipeline_response): ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("last_id") or None, AsyncList(list_of_elem) + return deserialized.get("next_link") or None, AsyncList(list_of_elem) - async def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) + async def get_next(next_link=None): + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access @@ -12900,8 +12805,8 @@ def list_runs( *, filter: Optional[str] = None, limit: Optional[int] = None, - before: Optional[str] = None, - order: Optional[str] = None, + after: Optional[str] = None, + order: Optional[Union[str, _models.PageOrder]] = None, **kwargs: Any ) -> AsyncItemPaged["_models.RoutineRun"]: """List prior runs for a routine. @@ -12915,12 +12820,14 @@ def list_runs( :paramtype filter: str :keyword limit: The maximum number of runs to return. Default value is None. :paramtype limit: int - :keyword before: Unsupported. Reserved for future backward pagination support. Default value is - None. - :paramtype before: str - :keyword order: The ordering direction. Supported values are asc and desc. Default value is - None. - :paramtype order: str + :keyword after: An opaque continuation token identifying where to resume the list. Prefer + following the ``next_link`` returned by the previous response, which embeds this value. Default + value is None. + :paramtype after: str + :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 :return: An iterator like instance of RoutineRun :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.RoutineRun] :raises ~azure.core.exceptions.HttpResponseError: @@ -12938,23 +12845,49 @@ def list_runs( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(_continuation_token=None): + def prepare_request(next_link=None): + if not next_link: + + _request = build_beta_routines_list_runs_request( + routine_name=routine_name, + filter=filter, + limit=limit, + after=after, + order=order, + 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) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_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) - _request = build_beta_routines_list_runs_request( - routine_name=routine_name, - filter=filter, - limit=limit, - after=_continuation_token, - before=before, - order=order, - 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): @@ -12965,10 +12898,10 @@ async def extract_data(pipeline_response): ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("last_id") or None, AsyncList(list_of_elem) + return deserialized.get("next_link") or None, AsyncList(list_of_elem) - async def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) + async def get_next(next_link=None): + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access @@ -13016,12 +12949,7 @@ async def dispatch( @overload async def dispatch( - self, - routine_name: str, - body: _types.DispatchRoutineAsyncRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, routine_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. @@ -13030,7 +12958,7 @@ async def dispatch( :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. - :type body: ~azure.ai.projects.types.DispatchRoutineAsyncRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -13063,7 +12991,7 @@ async def dispatch( async def dispatch( self, routine_name: str, - body: Union[JSON, _types.DispatchRoutineAsyncRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, payload: Optional[_models.RoutineDispatchPayload] = None, **kwargs: Any @@ -13074,9 +13002,8 @@ async def dispatch( :param routine_name: The unique name of the routine. Required. :type routine_name: str - :param body: Is one of the following types: JSON, DispatchRoutineAsyncRequest, IO[bytes] - Required. - :type body: JSON or ~azure.ai.projects.types.DispatchRoutineAsyncRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword payload: A direct action-input override sent downstream when testing a routine. Default value is None. :paramtype payload: ~azure.ai.projects.models.RoutineDispatchPayload @@ -13408,7 +13335,7 @@ async def create_or_update( @overload async def create_or_update( - self, schedule_id: str, schedule: _types.Schedule, *, content_type: str = "application/json", **kwargs: Any + self, schedule_id: str, schedule: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Schedule: """Create or update a schedule. @@ -13417,7 +13344,7 @@ async def create_or_update( :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str :param schedule: The resource instance. Required. - :type schedule: ~azure.ai.projects.types.Schedule + :type schedule: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -13448,7 +13375,7 @@ async def create_or_update( @distributed_trace_async async def create_or_update( - self, schedule_id: str, schedule: Union[_models.Schedule, _types.Schedule, IO[bytes]], **kwargs: Any + self, schedule_id: str, schedule: Union[_models.Schedule, JSON, IO[bytes]], **kwargs: Any ) -> _models.Schedule: """Create or update a schedule. @@ -13456,10 +13383,9 @@ async def create_or_update( :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str - :param schedule: The resource instance. Is either a Schedule type or a IO[bytes] type. - Required. - :type schedule: ~azure.ai.projects.models.Schedule or ~azure.ai.projects.types.Schedule or - IO[bytes] + :param schedule: The resource instance. Is one of the following types: Schedule, JSON, + IO[bytes] Required. + :type schedule: ~azure.ai.projects.models.Schedule or JSON or IO[bytes] :return: Schedule. The Schedule is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Schedule :raises ~azure.core.exceptions.HttpResponseError: @@ -13902,7 +13828,7 @@ async def update( @overload async def update( - self, name: str, body: _types.UpdateSkillRequest, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SkillDetails: """Update a skill. @@ -13911,7 +13837,7 @@ async def update( :param name: The name of the skill to update. Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.UpdateSkillRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -13942,12 +13868,7 @@ async def update( @distributed_trace_async async def update( - self, - name: str, - body: Union[JSON, _types.UpdateSkillRequest, IO[bytes]] = _Unset, - *, - default_version: str = _Unset, - **kwargs: Any + self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, default_version: str = _Unset, **kwargs: Any ) -> _models.SkillDetails: """Update a skill. @@ -13955,8 +13876,8 @@ async def update( :param name: The name of the skill to update. Required. :type name: str - :param body: Is one of the following types: JSON, UpdateSkillRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.UpdateSkillRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword default_version: The version identifier that the skill should point to. When set, the skill's default version will resolve to this version instead of the latest. Required. :paramtype default_version: str @@ -14132,12 +14053,7 @@ async def create( @overload async def create( - self, - name: str, - body: _types.CreateSkillVersionRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SkillVersion: """Create a new version of a skill. @@ -14146,7 +14062,7 @@ async def create( :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.CreateSkillVersionRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -14179,7 +14095,7 @@ async def create( async def create( self, name: str, - body: Union[JSON, _types.CreateSkillVersionRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, inline_content: Optional[_models.SkillInlineContent] = None, default: Optional[bool] = None, @@ -14191,9 +14107,8 @@ async def create( :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str - :param body: Is one of the following types: JSON, CreateSkillVersionRequest, IO[bytes] - Required. - :type body: JSON or ~azure.ai.projects.types.CreateSkillVersionRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword inline_content: Inline skill content for simple skills without file uploads. Foundry-specific extension. Default value is None. :paramtype inline_content: ~azure.ai.projects.models.SkillInlineContent @@ -14289,9 +14204,7 @@ async def create_from_files( """ @overload - async def create_from_files( - self, name: str, content: _types.CreateSkillVersionFromFilesBody, **kwargs: Any - ) -> _models.SkillVersion: + async def create_from_files(self, name: str, content: JSON, **kwargs: Any) -> _models.SkillVersion: """Create a skill version from uploaded files. Creates a new version of a skill from uploaded files via multipart form data. @@ -14299,7 +14212,7 @@ async def create_from_files( :param name: The name of the skill. Required. :type name: str :param content: The multipart request content. Required. - :type content: ~azure.ai.projects.types.CreateSkillVersionFromFilesBody + :type content: JSON :return: SkillVersion. The SkillVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.SkillVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -14307,10 +14220,7 @@ async def create_from_files( @distributed_trace_async async def create_from_files( - self, - name: str, - content: Union[_models.CreateSkillVersionFromFilesBody, _types.CreateSkillVersionFromFilesBody], - **kwargs: Any + self, name: str, content: Union[_models.CreateSkillVersionFromFilesBody, JSON], **kwargs: Any ) -> _models.SkillVersion: """Create a skill version from uploaded files. @@ -14318,10 +14228,9 @@ async def create_from_files( :param name: The name of the skill. Required. :type name: str - :param content: The multipart request content. Is one of the following types: - CreateSkillVersionFromFilesBody Required. - :type content: ~azure.ai.projects.models.CreateSkillVersionFromFilesBody or - ~azure.ai.projects.types.CreateSkillVersionFromFilesBody + :param content: The multipart request content. Is either a CreateSkillVersionFromFilesBody type + or a JSON type. Required. + :type content: ~azure.ai.projects.models.CreateSkillVersionFromFilesBody or JSON :return: SkillVersion. The SkillVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.SkillVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -14943,7 +14852,7 @@ async def get_next(_continuation_token=None): async def _create_generation_job_initial( self, - job: Union[_models.DataGenerationJob, _types.DataGenerationJob, IO[bytes]], + job: Union[_models.DataGenerationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -15042,19 +14951,14 @@ async def begin_create_generation_job( @overload async def begin_create_generation_job( - self, - job: _types.DataGenerationJob, - *, - operation_id: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any + self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.DataGenerationJobResult]: """Create a data generation job. Submits a new data generation job for asynchronous execution. :param job: The job to create. Required. - :type job: ~azure.ai.projects.types.DataGenerationJob + :type job: JSON :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -15097,7 +15001,7 @@ async def begin_create_generation_job( @distributed_trace_async async def begin_create_generation_job( self, - job: Union[_models.DataGenerationJob, _types.DataGenerationJob, IO[bytes]], + job: Union[_models.DataGenerationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -15106,10 +15010,9 @@ async def begin_create_generation_job( Submits a new data generation job for asynchronous execution. - :param job: The job to create. Is either a DataGenerationJob type or a IO[bytes] type. - Required. - :type job: ~azure.ai.projects.models.DataGenerationJob or - ~azure.ai.projects.types.DataGenerationJob or IO[bytes] + :param job: The job to create. Is one of the following types: DataGenerationJob, JSON, + IO[bytes] Required. + :type job: ~azure.ai.projects.models.DataGenerationJob or JSON or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -15317,7 +15220,7 @@ def __init__(self, *args, **kwargs) -> None: async def _create_optimization_job_initial( self, - job: Union[_models.AgentOptimizationJob, _types.AgentOptimizationJob, IO[bytes]], + job: Union[_models.AgentOptimizationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -15418,12 +15321,7 @@ async def begin_create_optimization_job( @overload async def begin_create_optimization_job( - self, - job: _types.AgentOptimizationJob, - *, - operation_id: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any + self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.AgentOptimizationJobResult]: """Create an agent optimization job. @@ -15431,7 +15329,7 @@ async def begin_create_optimization_job( retry. :param job: The job to create. Required. - :type job: ~azure.ai.projects.types.AgentOptimizationJob + :type job: JSON :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -15477,7 +15375,7 @@ async def begin_create_optimization_job( @distributed_trace_async async def begin_create_optimization_job( self, - job: Union[_models.AgentOptimizationJob, _types.AgentOptimizationJob, IO[bytes]], + job: Union[_models.AgentOptimizationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -15487,10 +15385,9 @@ async def begin_create_optimization_job( Creates an optimization job and returns the queued job. Honors ``Operation-Id`` for idempotent retry. - :param job: The job to create. Is either a AgentOptimizationJob type or a IO[bytes] type. - Required. - :type job: ~azure.ai.projects.models.AgentOptimizationJob or - ~azure.ai.projects.types.AgentOptimizationJob or IO[bytes] + :param job: The job to create. Is one of the following types: AgentOptimizationJob, JSON, + IO[bytes] Required. + :type job: ~azure.ai.projects.models.AgentOptimizationJob or JSON or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str 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 d893d0919896..a6251719043e 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 @@ -354,6 +354,7 @@ SharepointGroundingToolParameters, SharepointPreviewTool, SimpleQnADataGenerationJobOptions, + SimulationSeedDataGenerationJobOptions, SkillDetails, SkillInlineContent, SkillReferenceParam, @@ -363,7 +364,6 @@ SpecificProgrammaticToolCallingParam, StructuredInputDefinition, StructuredOutputDefinition, - TaskGenerationDataGenerationJobOptions, TaxonomyCategory, TaxonomySubCategory, TelemetryConfig, @@ -1023,6 +1023,7 @@ "SharepointGroundingToolParameters", "SharepointPreviewTool", "SimpleQnADataGenerationJobOptions", + "SimulationSeedDataGenerationJobOptions", "SkillDetails", "SkillInlineContent", "SkillReferenceParam", @@ -1032,7 +1033,6 @@ "SpecificProgrammaticToolCallingParam", "StructuredInputDefinition", "StructuredOutputDefinition", - "TaskGenerationDataGenerationJobOptions", "TaxonomyCategory", "TaxonomySubCategory", "TelemetryConfig", 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 96d8984ad7d9..2d93c869a191 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 @@ -37,8 +37,8 @@ class _FoundryFeaturesOptInKeys(str, Enum, metaclass=CaseInsensitiveEnumMeta): """INSIGHTS_V1_PREVIEW.""" MEMORY_STORES_V1_PREVIEW = "MemoryStores=V1Preview" """MEMORY_STORES_V1_PREVIEW.""" - ROUTINES_V1_PREVIEW = "Routines=V1Preview" - """ROUTINES_V1_PREVIEW.""" + ROUTINES_V2_PREVIEW = "Routines=V2Preview" + """ROUTINES_V2_PREVIEW.""" SKILLS_V1_PREVIEW = "Skills=V1Preview" """SKILLS_V1_PREVIEW.""" DATA_GENERATION_JOBS_V1_PREVIEW = "DataGenerationJobs=V1Preview" @@ -447,8 +447,8 @@ class DataGenerationJobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Single turn query and response from agent traces.""" TOOL_USE = "tool_use" """Tool calling conversation between user and agent.""" - TASK_GENERATION = "task_generation" - """Task generation for evaluation scenarios.""" + SIMULATION_SEED = "simulation_seed" + """Simulation seed for evaluation scenarios.""" class DatasetType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -1704,12 +1704,12 @@ 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. + 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. + 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. + 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 57df6906fdef..f276c74b6f48 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 @@ -4576,16 +4576,31 @@ class ContainerConfiguration(_Model): # pylint: disable=docstring-keyword-shoul :ivar image: The container image for the hosted agent. Required. :vartype image: str + :ivar registry_connection_id: The id (or name) of the Foundry project connection that provides + the credentials used to authenticate to the private container registry hosting ``image``. The + connection abstracts the auth mechanism — for example a managed-identity-federated token + exchange, or a username/token secret — so registry credentials are never part of the agent + definition. Omit for public images or registries already reachable by the platform's default + identity (for example, Azure Container Registry). + :vartype registry_connection_id: str """ image: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The container image for the hosted agent. Required.""" + registry_connection_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The id (or name) of the Foundry project connection that provides the credentials used to + authenticate to the private container registry hosting ``image``. The connection abstracts the + auth mechanism — for example a managed-identity-federated token exchange, or a username/token + secret — so registry credentials are never part of the agent definition. Omit for public images + or registries already reachable by the platform's default identity (for example, Azure + Container Registry).""" @overload def __init__( self, *, image: str, + registry_connection_id: Optional[str] = None, ) -> None: ... @overload @@ -5580,11 +5595,11 @@ class DataGenerationJobOptions(_Model): # pylint: disable=docstring-keyword-sho """Options for managing data generation jobs. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - SimpleQnADataGenerationJobOptions, TaskGenerationDataGenerationJobOptions, + SimpleQnADataGenerationJobOptions, SimulationSeedDataGenerationJobOptions, ToolUseFineTuningDataGenerationJobOptions, TracesDataGenerationJobOptions :ivar type: The data generation job type. Required. Known values are: "simple_qna", "traces", - "tool_use", and "task_generation". + "tool_use", and "simulation_seed". :vartype type: str or ~azure.ai.projects.models.DataGenerationJobType :ivar max_samples: Maximum number of samples to generate. Required. :vartype max_samples: int @@ -5598,7 +5613,7 @@ class DataGenerationJobOptions(_Model): # pylint: disable=docstring-keyword-sho __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) """The data generation job type. Required. Known values are: \"simple_qna\", \"traces\", - \"tool_use\", and \"task_generation\".""" + \"tool_use\", and \"simulation_seed\".""" max_samples: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Maximum number of samples to generate. Required.""" train_split: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -16048,6 +16063,50 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = DataGenerationJobType.SIMPLE_QNA # type: ignore +class SimulationSeedDataGenerationJobOptions( + DataGenerationJobOptions, discriminator="simulation_seed" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The options for a simulation seed 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 max_samples: Maximum number of samples to generate. Required. + :vartype max_samples: int + :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, + *, + max_samples: int, + 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 SkillDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A skill resource. @@ -16472,50 +16531,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TaskGenerationDataGenerationJobOptions( - DataGenerationJobOptions, discriminator="task_generation" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """The options 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 max_samples: Maximum number of samples to generate. Required. - :vartype max_samples: int - :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 TaskGeneration for this model. Required. - Task generation for evaluation scenarios. - :vartype type: str or ~azure.ai.projects.models.TASK_GENERATION - """ - - type: Literal[DataGenerationJobType.TASK_GENERATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The data generation job type, which is TaskGeneration for this model. Required. Task generation - for evaluation scenarios.""" - - @overload - def __init__( - self, - *, - max_samples: int, - 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.TASK_GENERATION # type: ignore - - class TaxonomyCategory(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Taxonomy category definition. @@ -17792,11 +17807,17 @@ class TracesDataGenerationJobOptions( :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 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[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.""" + 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__( @@ -17805,6 +17826,7 @@ def __init__( max_samples: int, train_split: Optional[float] = None, model_options: Optional["_models.DataGenerationModelOptions"] = None, + redact_private_content: Optional[bool] = None, ) -> None: ... @overload @@ -22700,6 +22722,9 @@ class VoiceAgentServerEventSessionCreated(_Model): # pylint: disable=docstring- :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 conversation_id: The id of the persisted conversation. Only present when conversation + persistence is enabled for the session. + :vartype conversation_id: str :ivar session: The initial effective voice-agent session configuration. Required. :vartype session: ~azure.ai.projects.models.VoiceAgentSessionResponseConfig """ @@ -22710,6 +22735,9 @@ class VoiceAgentServerEventSessionCreated(_Model): # pylint: disable=docstring- visibility=["read", "create", "update", "delete", "query"] ) """The event type, must be ``session.created``. Required. SESSION_CREATED.""" + conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The id of the persisted conversation. Only present when conversation persistence is enabled for + the session.""" session: "_models.VoiceAgentSessionResponseConfig" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -22722,6 +22750,7 @@ def __init__( event_id: str, type: Literal[RealtimeServerEventType.SESSION_CREATED], session: "_models.VoiceAgentSessionResponseConfig", + conversation_id: Optional[str] = None, ) -> None: ... @overload @@ -23731,14 +23760,13 @@ class VoiceAudioOutputConfig(_Model): # pylint: disable=docstring-keyword-shoul * `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`. + `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. + `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 @@ -25031,9 +25059,7 @@ class VoiceResponse(OmitPropertiesRealtimeResponse): # pylint: disable=docstrin :vartype completed_at: ~datetime.datetime """ - id: str = rest_field( # type: ignore[reportIncompatibleVariableOverride] - visibility=["read", "create", "update", "delete", "query"] - ) + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) # type: ignore[reportIncompatibleVariableOverride] """The unique id of the response. Required.""" output: Optional[list["_models.VoiceConversationItem"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] @@ -25042,9 +25068,7 @@ class VoiceResponse(OmitPropertiesRealtimeResponse): # pylint: disable=docstrin response (GET .../responses/{response_id}) or use the paged response-items route (GET .../responses/{response_id}/items) for its output items. Each item's ``response_id`` also links it back to this response in the conversation-level items list.""" - conversation_id: str = rest_field( # type: ignore[reportIncompatibleVariableOverride] - visibility=["read", "create", "update", "delete", "query"] - ) + conversation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) # type: ignore[reportIncompatibleVariableOverride] """The id of the conversation this response belongs to. Required.""" audio: Optional["_models.VoiceResponseAudio"] = rest_field( visibility=["read", "create", "update", "delete", "query"] @@ -25832,7 +25856,10 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class WorkflowAgentDefinition( AgentDefinition, discriminator="workflow" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """The workflow agent definition. + """The workflow agent definition. Microsoft Foundry is retiring workflows on December 1, 2026. If + you're looking to build new workflows, use Microsoft Agent Framework. To migrate existing + workflows, see the `Migration guide + `_. :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. :vartype rai_config: ~azure.ai.projects.models.RaiConfig 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 12c590316275..fbabc0a3ec57 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 @@ -62,7 +62,7 @@ "memory_stores": _FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW.value, "models": _FoundryFeaturesOptInKeys.MODELS_V1_PREVIEW.value, "red_teams": _FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW.value, - "routines": _FoundryFeaturesOptInKeys.ROUTINES_V1_PREVIEW.value, + "routines": _FoundryFeaturesOptInKeys.ROUTINES_V2_PREVIEW.value, "schedules": _FoundryFeaturesOptInKeys.SCHEDULES_V1_PREVIEW.value, "skills": _FoundryFeaturesOptInKeys.SKILLS_V1_PREVIEW.value, "datasets": _FoundryFeaturesOptInKeys.DATA_GENERATION_JOBS_V1_PREVIEW.value, 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 b449b819327e..79ec534146bd 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 @@ -33,7 +33,7 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from .. import models as _models, types as _types +from .. import models as _models from .._configuration import AIProjectClientConfiguration from .._utils.model_base import Model as _Model, SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._utils.serialization import Deserializer, Serializer @@ -3202,8 +3202,7 @@ def build_beta_routines_list_request( *, limit: Optional[int] = None, after: Optional[str] = None, - before: Optional[str] = None, - order: Optional[str] = None, + order: Optional[Union[str, _models.PageOrder]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -3220,8 +3219,6 @@ def build_beta_routines_list_request( _params["limit"] = _SERIALIZER.query("limit", limit, "int") if after is not None: _params["after"] = _SERIALIZER.query("after", after, "str") - if before is not None: - _params["before"] = _SERIALIZER.query("before", before, "str") if order is not None: _params["order"] = _SERIALIZER.query("order", order, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -3256,8 +3253,7 @@ def build_beta_routines_list_runs_request( filter: Optional[str] = None, limit: Optional[int] = None, after: Optional[str] = None, - before: Optional[str] = None, - order: Optional[str] = None, + order: Optional[Union[str, _models.PageOrder]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -3281,8 +3277,6 @@ def build_beta_routines_list_runs_request( _params["limit"] = _SERIALIZER.query("limit", limit, "int") if after is not None: _params["after"] = _SERIALIZER.query("after", after, "str") - if before is not None: - _params["before"] = _SERIALIZER.query("before", before, "str") if order is not None: _params["order"] = _SERIALIZER.query("order", order, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -4186,7 +4180,7 @@ def generate_agent( @overload def generate_agent( - self, body: _types.GenerateAgentRequest, *, content_type: str = "application/json", **kwargs: Any + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentDetails: """Generate an agent. @@ -4194,7 +4188,7 @@ def generate_agent( remains fully editable through the standard agent versioning operations. :param body: Required. - :type body: ~azure.ai.projects.types.GenerateAgentRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4224,19 +4218,15 @@ def generate_agent( @distributed_trace def generate_agent( - self, - body: Union[JSON, _types.GenerateAgentRequest, IO[bytes]] = _Unset, - *, - kind: Union[str, _models.AgentKind] = _Unset, - **kwargs: Any + self, body: Union[JSON, IO[bytes]] = _Unset, *, kind: Union[str, _models.AgentKind] = _Unset, **kwargs: Any ) -> _models.AgentDetails: """Generate an agent. Generates and creates an agent from kind-specific high-level inputs. The generated definition remains fully editable through the standard agent versioning operations. - :param body: Is one of the following types: JSON, GenerateAgentRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.GenerateAgentRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword kind: The kind of agent to generate. Known values are: "prompt", "hosted", "workflow", "external", and "voice". Required. :paramtype kind: str or ~azure.ai.projects.models.AgentKind @@ -4538,12 +4528,7 @@ def create_version( @overload def create_version( - self, - agent_name: str, - body: _types.CreateAgentVersionRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentVersionDetails: """Create an agent version. @@ -4557,7 +4542,7 @@ def create_version( * Must not exceed 63 characters. Required. :type agent_name: str :param body: Required. - :type body: ~azure.ai.projects.types.CreateAgentVersionRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4595,7 +4580,7 @@ def create_version( def create_version( self, agent_name: str, - body: Union[JSON, _types.CreateAgentVersionRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, definition: _models.AgentDefinition = _Unset, metadata: Optional[dict[str, str]] = None, @@ -4615,9 +4600,8 @@ def create_version( * Can contain hyphens in the middle * Must not exceed 63 characters. Required. :type agent_name: str - :param body: Is one of the following types: JSON, CreateAgentVersionRequest, IO[bytes] - Required. - :type body: JSON or ~azure.ai.projects.types.CreateAgentVersionRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword definition: The agent definition. This can be a prompt, workflow, hosted, external, or voice agent definition. Required. :paramtype definition: ~azure.ai.projects.models.AgentDefinition @@ -4764,12 +4748,7 @@ def create_version_from_manifest( @overload def create_version_from_manifest( - self, - agent_name: str, - body: _types.CreateAgentVersionFromManifestRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentVersionDetails: """Create an agent version from manifest. @@ -4783,7 +4762,7 @@ def create_version_from_manifest( * Must not exceed 63 characters. Required. :type agent_name: str :param body: Required. - :type body: ~azure.ai.projects.types.CreateAgentVersionFromManifestRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4821,7 +4800,7 @@ def create_version_from_manifest( def create_version_from_manifest( self, agent_name: str, - body: Union[JSON, _types.CreateAgentVersionFromManifestRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, manifest_id: str = _Unset, parameter_values: dict[str, Any] = _Unset, @@ -4840,9 +4819,8 @@ def create_version_from_manifest( * Can contain hyphens in the middle * Must not exceed 63 characters. Required. :type agent_name: str - :param body: Is one of the following types: JSON, CreateAgentVersionFromManifestRequest, - IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.CreateAgentVersionFromManifestRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword manifest_id: The manifest ID to import the agent version from. Required. :paramtype manifest_id: str :keyword parameter_values: The inputs to the manifest that will result in a fully materialized @@ -5221,12 +5199,7 @@ def update_details( @overload def update_details( - self, - agent_name: str, - body: _types.PatchAgentObjectRequest, - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any + self, agent_name: str, body: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.AgentDetails: """Update an agent endpoint. @@ -5235,7 +5208,7 @@ def update_details( :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str :param body: Required. - :type body: ~azure.ai.projects.types.PatchAgentObjectRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -5268,7 +5241,7 @@ def update_details( def update_details( self, agent_name: str, - body: Union[JSON, _types.PatchAgentObjectRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, agent_endpoint: Optional[_models.AgentEndpointConfig] = None, agent_card: Optional[_models.AgentCard] = None, @@ -5280,8 +5253,8 @@ def update_details( :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str - :param body: Is one of the following types: JSON, PatchAgentObjectRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.PatchAgentObjectRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword agent_endpoint: The endpoint configuration for the agent. Default value is None. :paramtype agent_endpoint: ~azure.ai.projects.models.AgentEndpointConfig :keyword agent_card: Optional agent card for the agent. Default value is None. @@ -5369,19 +5342,14 @@ def _create_version_from_code( ) -> _models.AgentVersionDetails: ... @overload def _create_version_from_code( - self, - agent_name: str, - content: _types._CreateAgentVersionFromCodeContent, - *, - code_zip_sha256: str, - **kwargs: Any + self, agent_name: str, content: JSON, *, code_zip_sha256: str, **kwargs: Any ) -> _models.AgentVersionDetails: ... @distributed_trace def _create_version_from_code( self, agent_name: str, - content: Union[_models._models._CreateAgentVersionFromCodeContent, _types._CreateAgentVersionFromCodeContent], + content: Union[_models._models._CreateAgentVersionFromCodeContent, JSON], *, code_zip_sha256: str, **kwargs: Any @@ -5400,10 +5368,9 @@ def _create_version_from_code( * Can contain hyphens in the middle * Must not exceed 63 characters. Required. :type agent_name: str - :param content: The content multipart request content. Is one of the following types: - _CreateAgentVersionFromCodeContent Required. - :type content: ~azure.ai.projects.models._models._CreateAgentVersionFromCodeContent or - ~azure.ai.projects.types._CreateAgentVersionFromCodeContent + :param content: The content multipart request content. Is either a + _CreateAgentVersionFromCodeContent type or a JSON type. Required. + :type content: ~azure.ai.projects.models._models._CreateAgentVersionFromCodeContent or JSON :keyword code_zip_sha256: SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity verification. Required. :paramtype code_zip_sha256: str @@ -5698,12 +5665,7 @@ def create_session( @overload def create_session( - self, - agent_name: str, - body: _types.CreateSessionRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentSessionResource: """Create a session. @@ -5714,7 +5676,7 @@ def create_session( :param agent_name: The name of the agent to create a session for. Required. :type agent_name: str :param body: Required. - :type body: ~azure.ai.projects.types.CreateSessionRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5749,7 +5711,7 @@ def create_session( def create_session( self, agent_name: str, - body: Union[JSON, _types.CreateSessionRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, version_indicator: _models.VersionIndicator = _Unset, agent_session_id: Optional[str] = None, @@ -5763,8 +5725,8 @@ def create_session( :param agent_name: The name of the agent to create a session for. Required. :type agent_name: str - :param body: Is one of the following types: JSON, CreateSessionRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.CreateSessionRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword version_indicator: Determines which agent version backs the session. Required. :paramtype version_indicator: ~azure.ai.projects.models.VersionIndicator :keyword agent_session_id: Optional caller-provided session ID. If specified, it must be unique @@ -6142,9 +6104,7 @@ 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: @@ -6202,7 +6162,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 ) @@ -7946,7 +7906,7 @@ def create_or_update( @overload def create_or_update( - self, id: str, evaluation_rule: _types.EvaluationRule, *, content_type: str = "application/json", **kwargs: Any + self, id: str, evaluation_rule: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationRule: """Create or update an evaluation rule. @@ -7955,7 +7915,7 @@ def create_or_update( :param id: Unique identifier for the evaluation rule. Required. :type id: str :param evaluation_rule: Evaluation rule resource. Required. - :type evaluation_rule: ~azure.ai.projects.types.EvaluationRule + :type evaluation_rule: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7986,7 +7946,7 @@ def create_or_update( @distributed_trace def create_or_update( - self, id: str, evaluation_rule: Union[_models.EvaluationRule, _types.EvaluationRule, IO[bytes]], **kwargs: Any + self, id: str, evaluation_rule: Union[_models.EvaluationRule, JSON, IO[bytes]], **kwargs: Any ) -> _models.EvaluationRule: """Create or update an evaluation rule. @@ -7994,10 +7954,9 @@ def create_or_update( :param id: Unique identifier for the evaluation rule. Required. :type id: str - :param evaluation_rule: Evaluation rule resource. Is either a EvaluationRule type or a - IO[bytes] type. Required. - :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule or - ~azure.ai.projects.types.EvaluationRule or IO[bytes] + :param evaluation_rule: Evaluation rule resource. Is one of the following types: + EvaluationRule, JSON, IO[bytes] Required. + :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule or JSON or IO[bytes] :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationRule :raises ~azure.core.exceptions.HttpResponseError: @@ -8787,7 +8746,7 @@ def create_or_update( self, name: str, version: str, - dataset_version: _types.DatasetVersion, + dataset_version: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -8801,7 +8760,7 @@ def create_or_update( :param version: The specific version id of the DatasetVersion to create or update. Required. :type version: str :param dataset_version: The DatasetVersion to create or update. Required. - :type dataset_version: ~azure.ai.projects.types.DatasetVersion + :type dataset_version: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -8840,11 +8799,7 @@ def create_or_update( @distributed_trace def create_or_update( - self, - name: str, - version: str, - dataset_version: Union[_models.DatasetVersion, _types.DatasetVersion, IO[bytes]], - **kwargs: Any + self, name: str, version: str, dataset_version: Union[_models.DatasetVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.DatasetVersion: """Create or update a version. @@ -8854,10 +8809,9 @@ def create_or_update( :type name: str :param version: The specific version id of the DatasetVersion to create or update. Required. :type version: str - :param dataset_version: The DatasetVersion to create or update. Is either a DatasetVersion type - or a IO[bytes] type. Required. - :type dataset_version: ~azure.ai.projects.models.DatasetVersion or - ~azure.ai.projects.types.DatasetVersion or IO[bytes] + :param dataset_version: The DatasetVersion to create or update. Is one of the following types: + DatasetVersion, JSON, IO[bytes] Required. + :type dataset_version: ~azure.ai.projects.models.DatasetVersion or JSON or IO[bytes] :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -8957,7 +8911,7 @@ def pending_upload( self, name: str, version: str, - pending_upload_request: _types.PendingUploadRequest, + pending_upload_request: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -8971,7 +8925,7 @@ def pending_upload( :param version: The specific version id of the DatasetVersion to operate on. Required. :type version: str :param pending_upload_request: The pending upload request parameters. Required. - :type pending_upload_request: ~azure.ai.projects.types.PendingUploadRequest + :type pending_upload_request: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9013,7 +8967,7 @@ def pending_upload( self, name: str, version: str, - pending_upload_request: Union[_models.PendingUploadRequest, _types.PendingUploadRequest, IO[bytes]], + pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.PendingUploadResponse: """Start a pending upload. @@ -9024,10 +8978,10 @@ def pending_upload( :type name: str :param version: The specific version id of the DatasetVersion to operate on. Required. :type version: str - :param pending_upload_request: The pending upload request parameters. Is either a - PendingUploadRequest type or a IO[bytes] type. Required. - :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or - ~azure.ai.projects.types.PendingUploadRequest or IO[bytes] + :param pending_upload_request: The pending upload request parameters. Is one of the following + types: PendingUploadRequest, JSON, IO[bytes] Required. + :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or JSON or + IO[bytes] :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -9707,13 +9661,7 @@ def create_or_update( @overload def create_or_update( - self, - name: str, - version: str, - index: _types.Index, - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any + self, name: str, version: str, index: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.Index: """Create or update a version. @@ -9724,7 +9672,7 @@ def create_or_update( :param version: The specific version id of the Index to create or update. Required. :type version: str :param index: The Index to create or update. Required. - :type index: ~azure.ai.projects.types.Index + :type index: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -9763,7 +9711,7 @@ def create_or_update( @distributed_trace def create_or_update( - self, name: str, version: str, index: Union[_models.Index, _types.Index, IO[bytes]], **kwargs: Any + self, name: str, version: str, index: Union[_models.Index, JSON, IO[bytes]], **kwargs: Any ) -> _models.Index: """Create or update a version. @@ -9773,9 +9721,9 @@ def create_or_update( :type name: str :param version: The specific version id of the Index to create or update. Required. :type version: str - :param index: The Index to create or update. Is either a Index type or a IO[bytes] type. - Required. - :type index: ~azure.ai.projects.models.Index or ~azure.ai.projects.types.Index or IO[bytes] + :param index: The Index to create or update. Is one of the following types: Index, JSON, + IO[bytes] Required. + :type index: ~azure.ai.projects.models.Index or JSON or IO[bytes] :return: Index. The Index is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Index :raises ~azure.core.exceptions.HttpResponseError: @@ -9903,12 +9851,7 @@ def create_version( @overload def create_version( - self, - name: str, - body: _types.CreateToolboxVersionRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ToolboxVersionObject: """Create a new version of a toolbox. @@ -9918,7 +9861,7 @@ def create_version( Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.CreateToolboxVersionRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9952,7 +9895,7 @@ def create_version( def create_version( self, name: str, - body: Union[JSON, _types.CreateToolboxVersionRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, tools: List[_models.ToolboxTool] = _Unset, description: Optional[str] = None, @@ -9968,9 +9911,8 @@ def create_version( :param name: The name of the toolbox. If the toolbox does not exist, it will be created. Required. :type name: str - :param body: Is one of the following types: JSON, CreateToolboxVersionRequest, IO[bytes] - Required. - :type body: JSON or ~azure.ai.projects.types.CreateToolboxVersionRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword tools: The list of tools to include in this version. Required. :paramtype tools: list[~azure.ai.projects.models.ToolboxTool] :keyword description: A human-readable description of the toolbox. Default value is None. @@ -10412,7 +10354,7 @@ def update( @overload def update( - self, name: str, body: _types.UpdateToolboxRequest1, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. @@ -10421,7 +10363,7 @@ def update( :param name: The name of the toolbox to update. Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.UpdateToolboxRequest1 + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10452,12 +10394,7 @@ def update( @distributed_trace def update( - self, - name: str, - body: Union[JSON, _types.UpdateToolboxRequest1, IO[bytes]] = _Unset, - *, - default_version: str = _Unset, - **kwargs: Any + self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, default_version: str = _Unset, **kwargs: Any ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. @@ -10465,8 +10402,8 @@ def update( :param name: The name of the toolbox to update. Required. :type name: str - :param body: Is one of the following types: JSON, UpdateToolboxRequest1, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.UpdateToolboxRequest1 or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword 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. :paramtype default_version: str @@ -10909,7 +10846,7 @@ def create( @overload def create( - self, name: str, taxonomy: _types.EvaluationTaxonomy, *, content_type: str = "application/json", **kwargs: Any + self, name: str, taxonomy: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. @@ -10918,7 +10855,7 @@ def create( :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. - :type taxonomy: ~azure.ai.projects.types.EvaluationTaxonomy + :type taxonomy: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10949,10 +10886,7 @@ def create( @distributed_trace def create( - self, - name: str, - taxonomy: Union[_models.EvaluationTaxonomy, _types.EvaluationTaxonomy, IO[bytes]], - **kwargs: Any + self, name: str, taxonomy: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], **kwargs: Any ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. @@ -10960,10 +10894,9 @@ def create( :param name: The name of the evaluation taxonomy. Required. :type name: str - :param taxonomy: The evaluation taxonomy. Is either a EvaluationTaxonomy type or a IO[bytes] - type. Required. - :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or - ~azure.ai.projects.types.EvaluationTaxonomy or IO[bytes] + :param taxonomy: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, + JSON, IO[bytes] Required. + :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: @@ -11051,7 +10984,7 @@ def update( @overload def update( - self, name: str, taxonomy: _types.EvaluationTaxonomy, *, content_type: str = "application/json", **kwargs: Any + self, name: str, taxonomy: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. @@ -11060,7 +10993,7 @@ def update( :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. - :type taxonomy: ~azure.ai.projects.types.EvaluationTaxonomy + :type taxonomy: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11091,10 +11024,7 @@ def update( @distributed_trace def update( - self, - name: str, - taxonomy: Union[_models.EvaluationTaxonomy, _types.EvaluationTaxonomy, IO[bytes]], - **kwargs: Any + self, name: str, taxonomy: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], **kwargs: Any ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. @@ -11102,10 +11032,9 @@ def update( :param name: The name of the evaluation taxonomy. Required. :type name: str - :param taxonomy: The evaluation taxonomy. Is either a EvaluationTaxonomy type or a IO[bytes] - type. Required. - :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or - ~azure.ai.projects.types.EvaluationTaxonomy or IO[bytes] + :param taxonomy: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, + JSON, IO[bytes] Required. + :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: @@ -11551,12 +11480,7 @@ def create_version( @overload def create_version( - self, - name: str, - evaluator_version: _types.EvaluatorVersion, - *, - content_type: str = "application/json", - **kwargs: Any + self, name: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: """Create an evaluator version. @@ -11565,7 +11489,7 @@ def create_version( :param name: The name of the resource. Required. :type name: str :param evaluator_version: Required. - :type evaluator_version: ~azure.ai.projects.types.EvaluatorVersion + :type evaluator_version: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11596,10 +11520,7 @@ def create_version( @distributed_trace def create_version( - self, - name: str, - evaluator_version: Union[_models.EvaluatorVersion, _types.EvaluatorVersion, IO[bytes]], - **kwargs: Any + self, name: str, evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.EvaluatorVersion: """Create an evaluator version. @@ -11607,9 +11528,9 @@ def create_version( :param name: The name of the resource. Required. :type name: str - :param evaluator_version: Is either a EvaluatorVersion type or a IO[bytes] type. Required. - :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or - ~azure.ai.projects.types.EvaluatorVersion or IO[bytes] + :param evaluator_version: Is one of the following types: EvaluatorVersion, JSON, IO[bytes] + Required. + :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or JSON or IO[bytes] :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -11705,13 +11626,7 @@ def update_version( @overload def update_version( - self, - name: str, - version: str, - evaluator_version: _types.EvaluatorVersion, - *, - content_type: str = "application/json", - **kwargs: Any + self, name: str, version: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: """Update an evaluator version. @@ -11722,7 +11637,7 @@ def update_version( :param version: The version of the EvaluatorVersion to update. Required. :type version: str :param evaluator_version: Evaluator resource. Required. - :type evaluator_version: ~azure.ai.projects.types.EvaluatorVersion + :type evaluator_version: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11764,7 +11679,7 @@ def update_version( self, name: str, version: str, - evaluator_version: Union[_models.EvaluatorVersion, _types.EvaluatorVersion, IO[bytes]], + evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.EvaluatorVersion: """Update an evaluator version. @@ -11775,10 +11690,9 @@ def update_version( :type name: str :param version: The version of the EvaluatorVersion to update. Required. :type version: str - :param evaluator_version: Evaluator resource. Is either a EvaluatorVersion type or a IO[bytes] - type. Required. - :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or - ~azure.ai.projects.types.EvaluatorVersion or IO[bytes] + :param evaluator_version: Evaluator resource. Is one of the following types: EvaluatorVersion, + JSON, IO[bytes] Required. + :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or JSON or IO[bytes] :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -11879,7 +11793,7 @@ def pending_upload( self, name: str, version: str, - pending_upload_request: _types.PendingUploadRequest, + pending_upload_request: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -11894,7 +11808,7 @@ def pending_upload( :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str :param pending_upload_request: The pending upload request parameters. Required. - :type pending_upload_request: ~azure.ai.projects.types.PendingUploadRequest + :type pending_upload_request: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11937,7 +11851,7 @@ def pending_upload( self, name: str, version: str, - pending_upload_request: Union[_models.PendingUploadRequest, _types.PendingUploadRequest, IO[bytes]], + pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.PendingUploadResponse: """Start a pending upload. @@ -11949,10 +11863,10 @@ def pending_upload( :type name: str :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str - :param pending_upload_request: The pending upload request parameters. Is either a - PendingUploadRequest type or a IO[bytes] type. Required. - :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or - ~azure.ai.projects.types.PendingUploadRequest or IO[bytes] + :param pending_upload_request: The pending upload request parameters. Is one of the following + types: PendingUploadRequest, JSON, IO[bytes] Required. + :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or JSON or + IO[bytes] :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -12057,7 +11971,7 @@ def get_credentials( self, name: str, version: str, - credential_request: _types.EvaluatorCredentialRequest, + credential_request: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -12072,7 +11986,7 @@ def get_credentials( :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str :param credential_request: The credential request parameters. Required. - :type credential_request: ~azure.ai.projects.types.EvaluatorCredentialRequest + :type credential_request: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -12115,7 +12029,7 @@ def get_credentials( self, name: str, version: str, - credential_request: Union[_models.EvaluatorCredentialRequest, _types.EvaluatorCredentialRequest, IO[bytes]], + credential_request: Union[_models.EvaluatorCredentialRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.DatasetCredential: """Get evaluator credentials. @@ -12127,10 +12041,10 @@ def get_credentials( :type name: str :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str - :param credential_request: The credential request parameters. Is either a - EvaluatorCredentialRequest type or a IO[bytes] type. Required. - :type credential_request: ~azure.ai.projects.models.EvaluatorCredentialRequest or - ~azure.ai.projects.types.EvaluatorCredentialRequest or IO[bytes] + :param credential_request: The credential request parameters. Is one of the following types: + EvaluatorCredentialRequest, JSON, IO[bytes] Required. + :type credential_request: ~azure.ai.projects.models.EvaluatorCredentialRequest or JSON or + IO[bytes] :return: DatasetCredential. The DatasetCredential is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetCredential :raises ~azure.core.exceptions.HttpResponseError: @@ -12203,7 +12117,7 @@ def get_credentials( def _create_generation_job_initial( self, - job: Union[_models.EvaluatorGenerationJob, _types.EvaluatorGenerationJob, IO[bytes]], + job: Union[_models.EvaluatorGenerationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -12303,12 +12217,7 @@ def begin_create_generation_job( @overload def begin_create_generation_job( - self, - job: _types.EvaluatorGenerationJob, - *, - operation_id: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any + self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.EvaluatorVersion]: """Create an evaluator generation job. @@ -12316,7 +12225,7 @@ def begin_create_generation_job( from the provided source materials asynchronously. :param job: The job to create. Required. - :type job: ~azure.ai.projects.types.EvaluatorGenerationJob + :type job: JSON :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -12360,7 +12269,7 @@ def begin_create_generation_job( @distributed_trace def begin_create_generation_job( self, - job: Union[_models.EvaluatorGenerationJob, _types.EvaluatorGenerationJob, IO[bytes]], + job: Union[_models.EvaluatorGenerationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -12370,10 +12279,9 @@ def begin_create_generation_job( Creates an evaluator generation job. The service generates rubric-based evaluator definitions from the provided source materials asynchronously. - :param job: The job to create. Is either a EvaluatorGenerationJob type or a IO[bytes] type. - Required. - :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or - ~azure.ai.projects.types.EvaluatorGenerationJob or IO[bytes] + :param job: The job to create. Is one of the following types: EvaluatorGenerationJob, JSON, + IO[bytes] Required. + :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or JSON or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -12765,16 +12673,14 @@ def generate( """ @overload - def generate( - self, insight: _types.Insight, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Insight: + def generate(self, insight: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.Insight: """Generate insights. Generates an insights report from the provided evaluation configuration. :param insight: Complete evaluation configuration including data source, evaluators, and result settings. Required. - :type insight: ~azure.ai.projects.types.Insight + :type insight: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -12801,15 +12707,14 @@ def generate(self, insight: IO[bytes], *, content_type: str = "application/json" """ @distributed_trace - def generate(self, insight: Union[_models.Insight, _types.Insight, IO[bytes]], **kwargs: Any) -> _models.Insight: + def generate(self, insight: Union[_models.Insight, JSON, IO[bytes]], **kwargs: Any) -> _models.Insight: """Generate insights. Generates an insights report from the provided evaluation configuration. :param insight: Complete evaluation configuration including data source, evaluators, and result - settings. Is either a Insight type or a IO[bytes] type. Required. - :type insight: ~azure.ai.projects.models.Insight or ~azure.ai.projects.types.Insight or - IO[bytes] + settings. Is one of the following types: Insight, JSON, IO[bytes] Required. + :type insight: ~azure.ai.projects.models.Insight or JSON or IO[bytes] :return: Insight. The Insight is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Insight :raises ~azure.core.exceptions.HttpResponseError: @@ -13121,14 +13026,14 @@ def create( @overload def create( - self, body: _types.CreateMemoryStoreRequest, *, content_type: str = "application/json", **kwargs: Any + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: """Create a memory store. Creates a memory store resource with the provided configuration. :param body: Required. - :type body: ~azure.ai.projects.types.CreateMemoryStoreRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -13158,7 +13063,7 @@ def create( @distributed_trace def create( self, - body: Union[JSON, _types.CreateMemoryStoreRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, name: str = _Unset, definition: _models.MemoryStoreDefinition = _Unset, @@ -13170,8 +13075,8 @@ def create( Creates a memory store resource with the provided configuration. - :param body: Is one of the following types: JSON, CreateMemoryStoreRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.CreateMemoryStoreRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword name: The name of the memory store. Required. :paramtype name: str :keyword definition: The memory store definition. Required. @@ -13287,7 +13192,7 @@ def update( @overload def update( - self, name: str, body: _types.UpdateMemoryStoreRequest, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: """Update a memory store. @@ -13296,7 +13201,7 @@ def update( :param name: The name of the memory store to update. Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.UpdateMemoryStoreRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -13329,7 +13234,7 @@ def update( def update( self, name: str, - body: Union[JSON, _types.UpdateMemoryStoreRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, description: Optional[str] = None, metadata: Optional[dict[str, str]] = None, @@ -13341,8 +13246,8 @@ def update( :param name: The name of the memory store to update. Required. :type name: str - :param body: Is one of the following types: JSON, UpdateMemoryStoreRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.UpdateMemoryStoreRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword description: A human-readable description of the memory store. Default value is None. :paramtype description: str :keyword metadata: Arbitrary key-value metadata to associate with the memory store. Default @@ -13660,7 +13565,7 @@ def _search_memories( ) -> _models.MemoryStoreSearchResult: ... @overload def _search_memories( - self, name: str, body: _types.SearchMemoriesRequest, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreSearchResult: ... @overload def _search_memories( @@ -13671,7 +13576,7 @@ def _search_memories( def _search_memories( self, name: str, - body: Union[JSON, _types.SearchMemoriesRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, items: Optional[List[dict[str, Any]]] = None, @@ -13685,8 +13590,8 @@ def _search_memories( :param name: The name of the memory store to search. Required. :type name: str - :param body: Is one of the following types: JSON, SearchMemoriesRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.SearchMemoriesRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -13774,7 +13679,7 @@ def _search_memories( def _update_memories_initial( self, name: str, - body: Union[JSON, _types.UpdateMemoriesRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, items: Optional[List[dict[str, Any]]] = None, @@ -13870,7 +13775,7 @@ def _begin_update_memories( ) -> LROPoller[_models.MemoryStoreUpdateCompletedResult]: ... @overload def _begin_update_memories( - self, name: str, body: _types.UpdateMemoriesRequest, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.MemoryStoreUpdateCompletedResult]: ... @overload def _begin_update_memories( @@ -13881,7 +13786,7 @@ def _begin_update_memories( def _begin_update_memories( self, name: str, - body: Union[JSON, _types.UpdateMemoriesRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, items: Optional[List[dict[str, Any]]] = None, @@ -13896,8 +13801,8 @@ def _begin_update_memories( :param name: The name of the memory store to update. Required. :type name: str - :param body: Is one of the following types: JSON, UpdateMemoriesRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.UpdateMemoriesRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -14002,7 +13907,7 @@ def delete_scope( @overload def delete_scope( - self, name: str, body: _types.DeleteScopeRequest, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: """Delete memories by scope. @@ -14011,7 +13916,7 @@ def delete_scope( :param name: The name of the memory store. Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.DeleteScopeRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -14044,12 +13949,7 @@ def delete_scope( @distributed_trace def delete_scope( - self, - name: str, - body: Union[JSON, _types.DeleteScopeRequest, IO[bytes]] = _Unset, - *, - scope: str = _Unset, - **kwargs: Any + self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: """Delete memories by scope. @@ -14057,8 +13957,8 @@ def delete_scope( :param name: The name of the memory store. Required. :type name: str - :param body: Is one of the following types: JSON, DeleteScopeRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.DeleteScopeRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories to delete, such as a user ID. Required. :paramtype scope: str @@ -14172,7 +14072,7 @@ def create_memory( @overload def create_memory( - self, name: str, body: _types.CreateMemoryRequest, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: """Create a memory item. @@ -14181,7 +14081,7 @@ def create_memory( :param name: The name of the memory store. Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.CreateMemoryRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -14214,7 +14114,7 @@ def create_memory( def create_memory( self, name: str, - body: Union[JSON, _types.CreateMemoryRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, content: str = _Unset, @@ -14227,8 +14127,8 @@ def create_memory( :param name: The name of the memory store. Required. :type name: str - :param body: Is one of the following types: JSON, CreateMemoryRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.CreateMemoryRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -14339,13 +14239,7 @@ def update_memory( @overload def update_memory( - self, - name: str, - memory_id: str, - body: _types.UpdateMemoryRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, name: str, memory_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: """Update a memory item. @@ -14356,7 +14250,7 @@ def update_memory( :param memory_id: The ID of the memory item to update. Required. :type memory_id: str :param body: Required. - :type body: ~azure.ai.projects.types.UpdateMemoryRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -14389,13 +14283,7 @@ def update_memory( @distributed_trace def update_memory( - self, - name: str, - memory_id: str, - body: Union[JSON, _types.UpdateMemoryRequest, IO[bytes]] = _Unset, - *, - content: str = _Unset, - **kwargs: Any + self, name: str, memory_id: str, body: Union[JSON, IO[bytes]] = _Unset, *, content: str = _Unset, **kwargs: Any ) -> _models.MemoryItem: """Update a memory item. @@ -14405,8 +14293,8 @@ def update_memory( :type name: str :param memory_id: The ID of the memory item to update. Required. :type memory_id: str - :param body: Is one of the following types: JSON, UpdateMemoryRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.UpdateMemoryRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword content: The updated content of the memory. Required. :paramtype content: str :return: MemoryItem. The MemoryItem is compatible with MutableMapping @@ -14605,7 +14493,7 @@ def list_memories( def list_memories( self, name: str, - body: _types.ListMemoriesRequest, + body: JSON, *, kind: Optional[Union[str, _models.MemoryItemKind]] = None, limit: Optional[int] = None, @@ -14621,7 +14509,7 @@ def list_memories( :param name: The name of the memory store. Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.ListMemoriesRequest + :type body: JSON :keyword kind: The kind of the memory item. Known values are: "user_profile", "chat_summary", and "procedural". Default value is None. :paramtype kind: str or ~azure.ai.projects.models.MemoryItemKind @@ -14697,7 +14585,7 @@ def list_memories( def list_memories( self, name: str, - body: Union[JSON, _types.ListMemoriesRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, kind: Optional[Union[str, _models.MemoryItemKind]] = None, @@ -14712,8 +14600,8 @@ def list_memories( :param name: The name of the memory store. Required. :type name: str - :param body: Is one of the following types: JSON, ListMemoriesRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.ListMemoriesRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -15239,7 +15127,7 @@ def update( self, name: str, version: str, - model_version_update: _types.UpdateModelVersionRequest, + model_version_update: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -15254,7 +15142,7 @@ def update( Required. :type version: str :param model_version_update: The UpdateModelVersionRequest to create or update. Required. - :type model_version_update: ~azure.ai.projects.types.UpdateModelVersionRequest + :type model_version_update: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -15297,7 +15185,7 @@ def update( self, name: str, version: str, - model_version_update: Union[_models.UpdateModelVersionRequest, _types.UpdateModelVersionRequest, IO[bytes]], + model_version_update: Union[_models.UpdateModelVersionRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.ModelVersion: """Update a model version. @@ -15309,10 +15197,10 @@ def update( :param version: The specific version id of the UpdateModelVersionRequest to create or update. Required. :type version: str - :param model_version_update: The UpdateModelVersionRequest to create or update. Is either a - UpdateModelVersionRequest type or a IO[bytes] type. Required. - :type model_version_update: ~azure.ai.projects.models.UpdateModelVersionRequest or - ~azure.ai.projects.types.UpdateModelVersionRequest or IO[bytes] + :param model_version_update: The UpdateModelVersionRequest to create or update. Is one of the + following types: UpdateModelVersionRequest, JSON, IO[bytes] Required. + :type model_version_update: ~azure.ai.projects.models.UpdateModelVersionRequest or JSON or + IO[bytes] :return: ModelVersion. The ModelVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.ModelVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -15410,13 +15298,7 @@ def pending_create_version( @overload def pending_create_version( - self, - name: str, - version: str, - model_version: _types.ModelVersion, - *, - content_type: str = "application/json", - **kwargs: Any + self, name: str, version: str, model_version: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CreateAsyncResponse: """Create a model version async. @@ -15428,7 +15310,7 @@ def pending_create_version( :param version: Version of the model. Required. :type version: str :param model_version: Model version to create. Required. - :type model_version: ~azure.ai.projects.types.ModelVersion + :type model_version: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -15468,11 +15350,7 @@ def pending_create_version( @distributed_trace def pending_create_version( - self, - name: str, - version: str, - model_version: Union[_models.ModelVersion, _types.ModelVersion, IO[bytes]], - **kwargs: Any + self, name: str, version: str, model_version: Union[_models.ModelVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.CreateAsyncResponse: """Create a model version async. @@ -15483,10 +15361,9 @@ def pending_create_version( :type name: str :param version: Version of the model. Required. :type version: str - :param model_version: Model version to create. Is either a ModelVersion type or a IO[bytes] - type. Required. - :type model_version: ~azure.ai.projects.models.ModelVersion or - ~azure.ai.projects.types.ModelVersion or IO[bytes] + :param model_version: Model version to create. Is one of the following types: ModelVersion, + JSON, IO[bytes] Required. + :type model_version: ~azure.ai.projects.models.ModelVersion or JSON or IO[bytes] :return: CreateAsyncResponse. The CreateAsyncResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.CreateAsyncResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -15590,7 +15467,7 @@ def pending_upload( self, name: str, version: str, - pending_upload_request: _types.ModelPendingUploadRequest, + pending_upload_request: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -15604,7 +15481,7 @@ def pending_upload( :param version: Version of the model. Required. :type version: str :param pending_upload_request: The pending upload request request body. Required. - :type pending_upload_request: ~azure.ai.projects.types.ModelPendingUploadRequest + :type pending_upload_request: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -15648,7 +15525,7 @@ def pending_upload( self, name: str, version: str, - pending_upload_request: Union[_models.ModelPendingUploadRequest, _types.ModelPendingUploadRequest, IO[bytes]], + pending_upload_request: Union[_models.ModelPendingUploadRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.ModelPendingUploadResponse: """Start a pending upload. @@ -15659,10 +15536,10 @@ def pending_upload( :type name: str :param version: Version of the model. Required. :type version: str - :param pending_upload_request: The pending upload request request body. Is either a - ModelPendingUploadRequest type or a IO[bytes] type. Required. - :type pending_upload_request: ~azure.ai.projects.models.ModelPendingUploadRequest or - ~azure.ai.projects.types.ModelPendingUploadRequest or IO[bytes] + :param pending_upload_request: The pending upload request request body. Is one of the following + types: ModelPendingUploadRequest, JSON, IO[bytes] Required. + :type pending_upload_request: ~azure.ai.projects.models.ModelPendingUploadRequest or JSON or + IO[bytes] :return: ModelPendingUploadResponse. The ModelPendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.ModelPendingUploadResponse @@ -15763,7 +15640,7 @@ def get_credentials( self, name: str, version: str, - credential_request: _types.ModelCredentialRequest, + credential_request: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -15777,7 +15654,7 @@ def get_credentials( :param version: Version of the model. Required. :type version: str :param credential_request: The credential request request body. Required. - :type credential_request: ~azure.ai.projects.types.ModelCredentialRequest + :type credential_request: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -15819,7 +15696,7 @@ def get_credentials( self, name: str, version: str, - credential_request: Union[_models.ModelCredentialRequest, _types.ModelCredentialRequest, IO[bytes]], + credential_request: Union[_models.ModelCredentialRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.DatasetCredential: """Get model asset credentials. @@ -15830,10 +15707,9 @@ def get_credentials( :type name: str :param version: Version of the model. Required. :type version: str - :param credential_request: The credential request request body. Is either a - ModelCredentialRequest type or a IO[bytes] type. Required. - :type credential_request: ~azure.ai.projects.models.ModelCredentialRequest or - ~azure.ai.projects.types.ModelCredentialRequest or IO[bytes] + :param credential_request: The credential request request body. Is one of the following types: + ModelCredentialRequest, JSON, IO[bytes] Required. + :type credential_request: ~azure.ai.projects.models.ModelCredentialRequest or JSON or IO[bytes] :return: DatasetCredential. The DatasetCredential is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetCredential :raises ~azure.core.exceptions.HttpResponseError: @@ -16090,15 +15966,13 @@ def create( """ @overload - def create( - self, red_team: _types.RedTeam, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RedTeam: + def create(self, red_team: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.RedTeam: """Create a redteam run. Submits a new redteam run for execution with the provided configuration. :param red_team: Redteam to be run. Required. - :type red_team: ~azure.ai.projects.types.RedTeam + :type red_team: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -16124,14 +15998,14 @@ def create(self, red_team: IO[bytes], *, content_type: str = "application/json", """ @distributed_trace - def create(self, red_team: Union[_models.RedTeam, _types.RedTeam, IO[bytes]], **kwargs: Any) -> _models.RedTeam: + def create(self, red_team: Union[_models.RedTeam, JSON, IO[bytes]], **kwargs: Any) -> _models.RedTeam: """Create a redteam run. Submits a new redteam run for execution with the provided configuration. - :param red_team: Redteam to be run. Is either a RedTeam type or a IO[bytes] type. Required. - :type red_team: ~azure.ai.projects.models.RedTeam or ~azure.ai.projects.types.RedTeam or - IO[bytes] + :param red_team: Redteam to be run. Is one of the following types: RedTeam, JSON, IO[bytes] + Required. + :type red_team: ~azure.ai.projects.models.RedTeam or JSON or IO[bytes] :return: RedTeam. The RedTeam is compatible with MutableMapping :rtype: ~azure.ai.projects.models.RedTeam :raises ~azure.core.exceptions.HttpResponseError: @@ -16255,12 +16129,7 @@ def create_or_update( @overload def create_or_update( - self, - routine_name: str, - body: _types.CreateOrUpdateRoutineRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, routine_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Routine: """Create or update a routine. @@ -16269,7 +16138,7 @@ def create_or_update( :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. - :type body: ~azure.ai.projects.types.CreateOrUpdateRoutineRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -16302,7 +16171,7 @@ def create_or_update( def create_or_update( self, routine_name: str, - body: Union[JSON, _types.CreateOrUpdateRoutineRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, description: Optional[str] = None, enabled: Optional[bool] = None, @@ -16316,9 +16185,8 @@ def create_or_update( :param routine_name: The unique name of the routine. Required. :type routine_name: str - :param body: Is one of the following types: JSON, CreateOrUpdateRoutineRequest, IO[bytes] - Required. - :type body: JSON or ~azure.ai.projects.types.CreateOrUpdateRoutineRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword description: A human-readable description of the routine. Default value is None. :paramtype description: str :keyword enabled: Whether the routine is enabled. Default value is None. @@ -16603,7 +16471,12 @@ def disable(self, routine_name: str, **kwargs: Any) -> _models.Routine: @distributed_trace def list( - self, *, limit: Optional[int] = None, before: Optional[str] = None, order: Optional[str] = None, **kwargs: Any + self, + *, + limit: Optional[int] = None, + after: Optional[str] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + **kwargs: Any ) -> ItemPaged["_models.Routine"]: """List routines. @@ -16611,12 +16484,14 @@ def list( :keyword limit: The maximum number of routines to return. Default value is None. :paramtype limit: int - :keyword before: Unsupported. Reserved for future backward pagination support. Default value is - None. - :paramtype before: str - :keyword order: The ordering direction. Supported values are asc and desc. Default value is - None. - :paramtype order: str + :keyword after: An opaque continuation token identifying where to resume the list. Prefer + following the ``next_link`` returned by the previous response, which embeds this value. Default + value is None. + :paramtype after: str + :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 :return: An iterator like instance of Routine :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.Routine] :raises ~azure.core.exceptions.HttpResponseError: @@ -16634,21 +16509,47 @@ def list( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(_continuation_token=None): + def prepare_request(next_link=None): + if not next_link: + + _request = build_beta_routines_list_request( + limit=limit, + after=after, + order=order, + 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) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_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) - _request = build_beta_routines_list_request( - limit=limit, - after=_continuation_token, - before=before, - order=order, - 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): @@ -16659,10 +16560,10 @@ def extract_data(pipeline_response): ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("last_id") or None, iter(list_of_elem) + return deserialized.get("next_link") or None, iter(list_of_elem) - def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) + def get_next(next_link=None): + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access @@ -16743,8 +16644,8 @@ def list_runs( *, filter: Optional[str] = None, limit: Optional[int] = None, - before: Optional[str] = None, - order: Optional[str] = None, + after: Optional[str] = None, + order: Optional[Union[str, _models.PageOrder]] = None, **kwargs: Any ) -> ItemPaged["_models.RoutineRun"]: """List prior runs for a routine. @@ -16758,12 +16659,14 @@ def list_runs( :paramtype filter: str :keyword limit: The maximum number of runs to return. Default value is None. :paramtype limit: int - :keyword before: Unsupported. Reserved for future backward pagination support. Default value is - None. - :paramtype before: str - :keyword order: The ordering direction. Supported values are asc and desc. Default value is - None. - :paramtype order: str + :keyword after: An opaque continuation token identifying where to resume the list. Prefer + following the ``next_link`` returned by the previous response, which embeds this value. Default + value is None. + :paramtype after: str + :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 :return: An iterator like instance of RoutineRun :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.RoutineRun] :raises ~azure.core.exceptions.HttpResponseError: @@ -16781,23 +16684,49 @@ def list_runs( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(_continuation_token=None): + def prepare_request(next_link=None): + if not next_link: + + _request = build_beta_routines_list_runs_request( + routine_name=routine_name, + filter=filter, + limit=limit, + after=after, + order=order, + 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) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_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) - _request = build_beta_routines_list_runs_request( - routine_name=routine_name, - filter=filter, - limit=limit, - after=_continuation_token, - before=before, - order=order, - 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): @@ -16808,10 +16737,10 @@ def extract_data(pipeline_response): ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("last_id") or None, iter(list_of_elem) + return deserialized.get("next_link") or None, iter(list_of_elem) - def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) + def get_next(next_link=None): + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access @@ -16859,12 +16788,7 @@ def dispatch( @overload def dispatch( - self, - routine_name: str, - body: _types.DispatchRoutineAsyncRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, routine_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. @@ -16873,7 +16797,7 @@ def dispatch( :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. - :type body: ~azure.ai.projects.types.DispatchRoutineAsyncRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -16906,7 +16830,7 @@ def dispatch( def dispatch( self, routine_name: str, - body: Union[JSON, _types.DispatchRoutineAsyncRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, payload: Optional[_models.RoutineDispatchPayload] = None, **kwargs: Any @@ -16917,9 +16841,8 @@ def dispatch( :param routine_name: The unique name of the routine. Required. :type routine_name: str - :param body: Is one of the following types: JSON, DispatchRoutineAsyncRequest, IO[bytes] - Required. - :type body: JSON or ~azure.ai.projects.types.DispatchRoutineAsyncRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword payload: A direct action-input override sent downstream when testing a routine. Default value is None. :paramtype payload: ~azure.ai.projects.models.RoutineDispatchPayload @@ -17251,7 +17174,7 @@ def create_or_update( @overload def create_or_update( - self, schedule_id: str, schedule: _types.Schedule, *, content_type: str = "application/json", **kwargs: Any + self, schedule_id: str, schedule: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Schedule: """Create or update a schedule. @@ -17260,7 +17183,7 @@ def create_or_update( :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str :param schedule: The resource instance. Required. - :type schedule: ~azure.ai.projects.types.Schedule + :type schedule: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -17291,7 +17214,7 @@ def create_or_update( @distributed_trace def create_or_update( - self, schedule_id: str, schedule: Union[_models.Schedule, _types.Schedule, IO[bytes]], **kwargs: Any + self, schedule_id: str, schedule: Union[_models.Schedule, JSON, IO[bytes]], **kwargs: Any ) -> _models.Schedule: """Create or update a schedule. @@ -17299,10 +17222,9 @@ def create_or_update( :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str - :param schedule: The resource instance. Is either a Schedule type or a IO[bytes] type. - Required. - :type schedule: ~azure.ai.projects.models.Schedule or ~azure.ai.projects.types.Schedule or - IO[bytes] + :param schedule: The resource instance. Is one of the following types: Schedule, JSON, + IO[bytes] Required. + :type schedule: ~azure.ai.projects.models.Schedule or JSON or IO[bytes] :return: Schedule. The Schedule is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Schedule :raises ~azure.core.exceptions.HttpResponseError: @@ -17745,7 +17667,7 @@ def update( @overload def update( - self, name: str, body: _types.UpdateSkillRequest, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SkillDetails: """Update a skill. @@ -17754,7 +17676,7 @@ def update( :param name: The name of the skill to update. Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.UpdateSkillRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -17785,12 +17707,7 @@ def update( @distributed_trace def update( - self, - name: str, - body: Union[JSON, _types.UpdateSkillRequest, IO[bytes]] = _Unset, - *, - default_version: str = _Unset, - **kwargs: Any + self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, default_version: str = _Unset, **kwargs: Any ) -> _models.SkillDetails: """Update a skill. @@ -17798,8 +17715,8 @@ def update( :param name: The name of the skill to update. Required. :type name: str - :param body: Is one of the following types: JSON, UpdateSkillRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.UpdateSkillRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword default_version: The version identifier that the skill should point to. When set, the skill's default version will resolve to this version instead of the latest. Required. :paramtype default_version: str @@ -17975,12 +17892,7 @@ def create( @overload def create( - self, - name: str, - body: _types.CreateSkillVersionRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SkillVersion: """Create a new version of a skill. @@ -17989,7 +17901,7 @@ def create( :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.CreateSkillVersionRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -18022,7 +17934,7 @@ def create( def create( self, name: str, - body: Union[JSON, _types.CreateSkillVersionRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, inline_content: Optional[_models.SkillInlineContent] = None, default: Optional[bool] = None, @@ -18034,9 +17946,8 @@ def create( :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str - :param body: Is one of the following types: JSON, CreateSkillVersionRequest, IO[bytes] - Required. - :type body: JSON or ~azure.ai.projects.types.CreateSkillVersionRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword inline_content: Inline skill content for simple skills without file uploads. Foundry-specific extension. Default value is None. :paramtype inline_content: ~azure.ai.projects.models.SkillInlineContent @@ -18132,9 +18043,7 @@ def create_from_files( """ @overload - def create_from_files( - self, name: str, content: _types.CreateSkillVersionFromFilesBody, **kwargs: Any - ) -> _models.SkillVersion: + def create_from_files(self, name: str, content: JSON, **kwargs: Any) -> _models.SkillVersion: """Create a skill version from uploaded files. Creates a new version of a skill from uploaded files via multipart form data. @@ -18142,7 +18051,7 @@ def create_from_files( :param name: The name of the skill. Required. :type name: str :param content: The multipart request content. Required. - :type content: ~azure.ai.projects.types.CreateSkillVersionFromFilesBody + :type content: JSON :return: SkillVersion. The SkillVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.SkillVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -18150,10 +18059,7 @@ def create_from_files( @distributed_trace def create_from_files( - self, - name: str, - content: Union[_models.CreateSkillVersionFromFilesBody, _types.CreateSkillVersionFromFilesBody], - **kwargs: Any + self, name: str, content: Union[_models.CreateSkillVersionFromFilesBody, JSON], **kwargs: Any ) -> _models.SkillVersion: """Create a skill version from uploaded files. @@ -18161,10 +18067,9 @@ def create_from_files( :param name: The name of the skill. Required. :type name: str - :param content: The multipart request content. Is one of the following types: - CreateSkillVersionFromFilesBody Required. - :type content: ~azure.ai.projects.models.CreateSkillVersionFromFilesBody or - ~azure.ai.projects.types.CreateSkillVersionFromFilesBody + :param content: The multipart request content. Is either a CreateSkillVersionFromFilesBody type + or a JSON type. Required. + :type content: ~azure.ai.projects.models.CreateSkillVersionFromFilesBody or JSON :return: SkillVersion. The SkillVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.SkillVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -18786,7 +18691,7 @@ def get_next(_continuation_token=None): def _create_generation_job_initial( self, - job: Union[_models.DataGenerationJob, _types.DataGenerationJob, IO[bytes]], + job: Union[_models.DataGenerationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -18885,19 +18790,14 @@ def begin_create_generation_job( @overload def begin_create_generation_job( - self, - job: _types.DataGenerationJob, - *, - operation_id: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any + self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.DataGenerationJobResult]: """Create a data generation job. Submits a new data generation job for asynchronous execution. :param job: The job to create. Required. - :type job: ~azure.ai.projects.types.DataGenerationJob + :type job: JSON :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -18940,7 +18840,7 @@ def begin_create_generation_job( @distributed_trace def begin_create_generation_job( self, - job: Union[_models.DataGenerationJob, _types.DataGenerationJob, IO[bytes]], + job: Union[_models.DataGenerationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -18949,10 +18849,9 @@ def begin_create_generation_job( Submits a new data generation job for asynchronous execution. - :param job: The job to create. Is either a DataGenerationJob type or a IO[bytes] type. - Required. - :type job: ~azure.ai.projects.models.DataGenerationJob or - ~azure.ai.projects.types.DataGenerationJob or IO[bytes] + :param job: The job to create. Is one of the following types: DataGenerationJob, JSON, + IO[bytes] Required. + :type job: ~azure.ai.projects.models.DataGenerationJob or JSON or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -19161,7 +19060,7 @@ def __init__(self, *args, **kwargs) -> None: def _create_optimization_job_initial( self, - job: Union[_models.AgentOptimizationJob, _types.AgentOptimizationJob, IO[bytes]], + job: Union[_models.AgentOptimizationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -19261,12 +19160,7 @@ def begin_create_optimization_job( @overload def begin_create_optimization_job( - self, - job: _types.AgentOptimizationJob, - *, - operation_id: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any + self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.AgentOptimizationJobResult]: """Create an agent optimization job. @@ -19274,7 +19168,7 @@ def begin_create_optimization_job( retry. :param job: The job to create. Required. - :type job: ~azure.ai.projects.types.AgentOptimizationJob + :type job: JSON :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -19318,7 +19212,7 @@ def begin_create_optimization_job( @distributed_trace def begin_create_optimization_job( self, - job: Union[_models.AgentOptimizationJob, _types.AgentOptimizationJob, IO[bytes]], + job: Union[_models.AgentOptimizationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -19328,10 +19222,9 @@ def begin_create_optimization_job( Creates an optimization job and returns the queued job. Honors ``Operation-Id`` for idempotent retry. - :param job: The job to create. Is either a AgentOptimizationJob type or a IO[bytes] type. - Required. - :type job: ~azure.ai.projects.models.AgentOptimizationJob or - ~azure.ai.projects.types.AgentOptimizationJob or IO[bytes] + :param job: The job to create. Is one of the following types: AgentOptimizationJob, JSON, + IO[bytes] Required. + :type job: ~azure.ai.projects.models.AgentOptimizationJob or JSON or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/types.py b/sdk/ai/azure-ai-projects/azure/ai/projects/types.py index bad33838f680..dc42ffcb6038 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/types.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/types.py @@ -6879,8 +6879,8 @@ class StructuredOutputDefinition(TypedDict, total=False): """Whether to enforce strict validation. Default ``true``. Required.""" -class TaskGenerationDataGenerationJobOptions(TypedDict, total=False): - """The options for a task generation data generation job. Use with multiturn evaluation scenarios +class SimulationSeedDataGenerationJobOptions(TypedDict, total=False): + """The options for a simulation seed 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``. @@ -6891,9 +6891,9 @@ class TaskGenerationDataGenerationJobOptions(TypedDict, total=False): :vartype train_split: float :ivar model_options: The LLM model options. :vartype model_options: "DataGenerationModelOptions" - :ivar type: The data generation job type, which is TaskGeneration for this model. Required. - Task generation for evaluation scenarios. - :vartype type: Literal[DataGenerationJobType.TASK_GENERATION] + :ivar type: The data generation job type, which is SimulationSeed for this model. Required. + Simulation seed for evaluation scenarios. + :vartype type: Literal[DataGenerationJobType.SIMULATION_SEED] """ max_samples: Required[int] @@ -6903,8 +6903,8 @@ class TaskGenerationDataGenerationJobOptions(TypedDict, total=False): fine-tuning. The rest will be used for validation. Value should be between 0 and 1.""" model_options: "DataGenerationModelOptions" """The LLM model options.""" - type: Required[Literal[DataGenerationJobType.TASK_GENERATION]] - """The data generation job type, which is TaskGeneration for this model. Required. Task generation + type: Required[Literal[DataGenerationJobType.SIMULATION_SEED]] + """The data generation job type, which is SimulationSeed for this model. Required. Simulation seed for evaluation scenarios.""" @@ -12063,7 +12063,7 @@ class UpdateToolboxRequest1(TypedDict, total=False): ] DataGenerationJobOptions = Union[ SimpleQnADataGenerationJobOptions, - TaskGenerationDataGenerationJobOptions, + SimulationSeedDataGenerationJobOptions, ToolUseFineTuningDataGenerationJobOptions, TracesDataGenerationJobOptions, ] diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_function_tool.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_function_tool.py new file mode 100644 index 000000000000..eac56d8a979a --- /dev/null +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_function_tool.py @@ -0,0 +1,166 @@ +# pylint: disable=line-too-long,useless-suppression +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +""" +DESCRIPTION: + This sample demonstrates handling a client-executed `function` tool during + a live voice-agent session: + + 1) Create a voice agent configured with a `get_weather` function tool. + 2) Open a realtime session and send a text turn that should trigger the tool. + 3) Listen for `response.function_call_arguments.done`, execute the function + locally, and send the result back with `conversation.item.create` + + `response.create` so the agent can finish its reply using the tool output. + +USAGE: + python sample_voice_agent_function_tool.py + + Before running the sample: + + pip install "azure-ai-projects>=2.0.0" python-dotenv + + Set these environment variables with your own values: + 1) FOUNDRY_PROJECT_ENDPOINT - The Azure AI Project endpoint. + 2) FOUNDRY_VOICE_AGENT_NAME - Optional. Name for the sample voice agent + created and deleted by this script. Defaults to + "sample-voice-agent-function-tool". +""" + +import json +import os +from typing import Any, Final, cast + +from dotenv import load_dotenv +from azure.identity import DefaultAzureCredential +from azure.ai.projects import AIProjectClient +from azure.ai.projects.models import ( + RealtimeConversationItemFunctionCallOutput, + RealtimeConversationItemMessageUser, + RealtimeConversationItemMessageUserContent, + RealtimeFunctionTool, + RealtimeServerEventError, + VoiceAgentDefinition, + VoiceAgentServerEventResponseDone, + VoiceAgentServerEventResponseFunctionCallArgumentsDone, + VoiceAgentServerEventResponseTextDone, + VoiceOutputModality, +) + +load_dotenv() + +# Seconds to wait for the agent to finish a response. +_RESPONSE_TIMEOUT: Final = 45 + + +def get_weather(city: str) -> str: + """A trivial local "tool" implementation the agent can call. + + :param city: The city to look up. + :type city: str + :return: A canned weather report for the city. + :rtype: str + """ + return json.dumps({"city": city, "condition": "sunny", "temperature_f": 72}) + + +def _run_turn_with_tool_support(client: AIProjectClient, agent_name: str, prompt: str) -> None: + """Send one turn and resolve any function-call the agent makes before printing its reply. + + :param client: The Foundry project client. + :param agent_name: The voice agent name. + :param prompt: The user's message for this turn. + :type client: ~azure.ai.projects.AIProjectClient + :type agent_name: str + :type prompt: str + """ + with client.realtime.connect(agent_name=agent_name) as conn: + conn.conversation.item.create( + item=RealtimeConversationItemMessageUser( + content=[RealtimeConversationItemMessageUserContent(type="input_text", text=prompt)] + ) + ) + conn.response.create() + + for event in conn: + if isinstance(event, VoiceAgentServerEventResponseFunctionCallArgumentsDone): + # The service forwards the call to us; execute it locally and + # send the result back so the agent can use it in its reply. + args = json.loads(event.arguments) + print(f"Tool call: {event.name}({args})") + if event.name == "get_weather": + result = get_weather(**args) + else: + result = json.dumps({"error": f"Unknown tool: {event.name}"}) + + conn.conversation.item.create( + item=RealtimeConversationItemFunctionCallOutput(call_id=event.call_id, output=result) + ) + conn.response.create() + elif isinstance(event, VoiceAgentServerEventResponseTextDone): + # The sample agent uses a text-only output modality, so the + # reply arrives as output text rather than an audio transcript. + print(f"Agent: {event.text}") + elif isinstance(event, VoiceAgentServerEventResponseDone): + # A response.done that isn't a function call is the final answer for this turn. + # Output items surface as plain mappings (open union), so use dict-style access. + if not any( + (item.get("type") if isinstance(item, dict) else getattr(item, "type", None)) == "function_call" + for item in (event.response.output or []) + ): + return + elif isinstance(event, RealtimeServerEventError): + print(f"Session error: {event.error.message}") + return + + +def main() -> None: + endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] + agent_name = os.environ.get("FOUNDRY_VOICE_AGENT_NAME") or "sample-voice-agent-function-tool" + + get_weather_tool = RealtimeFunctionTool( + type="function", + name="get_weather", + description="Get the current weather for a city.", + parameters=cast( + Any, + { + "type": "object", + "properties": {"city": {"type": "string", "description": "City name, e.g. Seattle."}}, + "required": ["city"], + }, + ), + ) + + with ( + DefaultAzureCredential() as credential, + AIProjectClient(endpoint=endpoint, credential=credential, allow_preview=True) as project_client, + ): + try: + project_client.agents.create_version( + agent_name=agent_name, + definition=VoiceAgentDefinition( + model_type="managed", + model="gpt-realtime", + instructions=( + "You are a helpful voice assistant. Use the get_weather tool when the " + "caller asks about the weather, then answer using its result." + ), + output_modalities=[VoiceOutputModality.TEXT], + tools=[get_weather_tool], # type: ignore[list-item] + ), + ) + print(f"Created voice agent: {agent_name}") + + _run_turn_with_tool_support( + project_client, agent_name, "What's the weather like in Seattle right now?" + ) + finally: + project_client.agents.delete(agent_name=agent_name) + print(f"Deleted voice agent: {agent_name}") + + +if __name__ == "__main__": + main() diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py index 4aea0c2630b9..79fb8993d191 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py @@ -60,6 +60,7 @@ VoiceAgentServerEventResponseAudioDelta, VoiceAgentServerEventResponseAudioTranscriptDone, VoiceAgentServerEventResponseDone, + VoiceAgentServerEventSessionCreated, RealtimeServerEventError, ) @@ -233,7 +234,11 @@ async def _run_audio_conversation(client: AIProjectClient, agent_name: str) -> O try: async for event in conn: - if isinstance(event, VoiceAgentServerEventInputAudioBufferSpeechStarted): + if isinstance(event, VoiceAgentServerEventSessionCreated): + # The persisted conversation id (only present when conversation + # persistence is enabled) is set here, not on response.done. + conversation_id = event.conversation_id or conversation_id + elif isinstance(event, VoiceAgentServerEventInputAudioBufferSpeechStarted): # Barge-in: stop the active response and drop whatever reply # audio is still queued locally. The service only supports # output_audio_buffer.clear in avatar mode. @@ -251,7 +256,7 @@ async def _run_audio_conversation(client: AIProjectClient, agent_name: str) -> O elif isinstance(event, VoiceAgentServerEventResponseAudioTranscriptDone): print(f"Agent: {event.transcript}") elif isinstance(event, VoiceAgentServerEventResponseDone): - conversation_id = event.response.conversation_id or conversation_id + pass except (KeyboardInterrupt, asyncio.CancelledError): # Ctrl-C ends the session; read back whatever was persisted so far. print("\n(ending session...)") diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py index ac113503963a..fc1ce6930b29 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py @@ -51,6 +51,7 @@ VoiceAgentServerEventResponseAudioDelta, VoiceAgentServerEventResponseAudioTranscriptDone, VoiceAgentServerEventResponseDone, + VoiceAgentServerEventSessionCreated, RealtimeServerEventError, ) @@ -142,8 +143,11 @@ def _run_text_conversation(client: AIProjectClient, agent_name: str) -> Optional def pump() -> None: nonlocal conversation_id, audio_delta_count for event in conn: + if isinstance(event, VoiceAgentServerEventSessionCreated): + # The persisted conversation id (only present when conversation + # persistence is enabled) is set here, not on response.done. + conversation_id = event.conversation_id or conversation_id if isinstance(event, VoiceAgentServerEventResponseDone): - conversation_id = event.response.conversation_id or conversation_id return if isinstance(event, RealtimeServerEventError): print(f"Session error: {event.error.message}") diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py index 15b18fd6c5a8..072ff93c7365 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py @@ -49,6 +49,7 @@ VoiceAgentServerEventResponseAudioDelta, VoiceAgentServerEventResponseAudioTranscriptDone, VoiceAgentServerEventResponseDone, + VoiceAgentServerEventSessionCreated, RealtimeServerEventError, ) @@ -139,8 +140,11 @@ async def _run_text_conversation(client: AIProjectClient, agent_name: str) -> Op async def pump() -> None: nonlocal conversation_id, audio_delta_count async for event in conn: + if isinstance(event, VoiceAgentServerEventSessionCreated): + # The persisted conversation id (only present when conversation + # persistence is enabled) is set here, not on response.done. + conversation_id = event.conversation_id or conversation_id if isinstance(event, VoiceAgentServerEventResponseDone): - conversation_id = event.response.conversation_id or conversation_id return if isinstance(event, RealtimeServerEventError): print(f"Session error: {event.error.message}") diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud.py b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud.py index b4f13b7cb810..5580a7c50251 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud.py @@ -90,9 +90,7 @@ def make_definition(instructions: str) -> VoiceAgentDefinition: # Get the voice agent. retrieved_agent: AgentDetails = project_client.agents.get(agent_name=agent_name) - self._validate_agent( - retrieved_agent, expected_name=agent_name, expected_latest_version=agent_version2.version - ) + self._validate_agent(retrieved_agent, expected_name=agent_name, expected_latest_version=agent_version2.version) # Retrieve a specific version. retrieved_agent_version: AgentVersionDetails = project_client.agents.get_version( diff --git a/sdk/ai/azure-ai-projects/tests/foundry_features_header/test_foundry_features_header_on_agent_endpoint_conversations_async.py b/sdk/ai/azure-ai-projects/tests/foundry_features_header/test_foundry_features_header_on_agent_endpoint_conversations_async.py index bf86d5f8460f..9609c04e8106 100644 --- a/sdk/ai/azure-ai-projects/tests/foundry_features_header/test_foundry_features_header_on_agent_endpoint_conversations_async.py +++ b/sdk/ai/azure-ai-projects/tests/foundry_features_header/test_foundry_features_header_on_agent_endpoint_conversations_async.py @@ -126,9 +126,7 @@ async def test_foundry_features_header_present_on_agent_endpoint_conversations_w subclient_name, method_attr = method_name.split(".") sc = getattr(async_client_preview_enabled, subclient_name) method = getattr(sc, method_attr) - await self._assert_header_present_async( - f"{method_name} (allow_preview=True)", self._make_fake_call(method) - ) + await self._assert_header_present_async(f"{method_name} (allow_preview=True)", self._make_fake_call(method)) @pytest.mark.asyncio @pytest.mark.parametrize("method_name", _AGENT_ENDPOINT_CONVERSATIONS_TEST_CASES) @@ -141,6 +139,4 @@ async def test_foundry_features_header_present_on_agent_endpoint_conversations_w subclient_name, method_attr = method_name.split(".") sc = getattr(async_client_preview_disabled, subclient_name) method = getattr(sc, method_attr) - await self._assert_header_present_async( - f"{method_name} (allow_preview unset)", self._make_fake_call(method) - ) + await self._assert_header_present_async(f"{method_name} (allow_preview unset)", self._make_fake_call(method)) diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml b/sdk/ai/azure-ai-projects/tsp-location.yaml index 0318ebd65cef..20e048f193a4 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml @@ -1,28 +1,28 @@ directory: specification/ai-foundry/data-plane/Foundry/src/sdk-python-js-azure-ai-projects -commit: 387a89cd76214595babe8031d538b0408914d9c6 +commit: 959894f28ce0c52303f730962b4777c25ed65ecf repo: Azure/azure-rest-api-specs additionalDirectories: - - specification/ai-foundry/data-plane/Foundry/src/agents - - specification/ai-foundry/data-plane/Foundry/src/agents-optimization - - specification/ai-foundry/data-plane/Foundry/src/agents-session-files - - specification/ai-foundry/data-plane/Foundry/src/common - - specification/ai-foundry/data-plane/Foundry/src/connections - - specification/ai-foundry/data-plane/Foundry/src/data_generation_jobs - - specification/ai-foundry/data-plane/Foundry/src/datasets - - specification/ai-foundry/data-plane/Foundry/src/deployments - - specification/ai-foundry/data-plane/Foundry/src/evaluation-rules - - specification/ai-foundry/data-plane/Foundry/src/evaluation-taxonomies - - specification/ai-foundry/data-plane/Foundry/src/evaluators - - specification/ai-foundry/data-plane/Foundry/src/indexes - - specification/ai-foundry/data-plane/Foundry/src/insights - - specification/ai-foundry/data-plane/Foundry/src/memory-stores - - specification/ai-foundry/data-plane/Foundry/src/models - - specification/ai-foundry/data-plane/Foundry/src/openai - - specification/ai-foundry/data-plane/Foundry/src/red-teams - - specification/ai-foundry/data-plane/Foundry/src/routines - - specification/ai-foundry/data-plane/Foundry/src/schedules - - specification/ai-foundry/data-plane/Foundry/src/sdk-common - - specification/ai-foundry/data-plane/Foundry/src/skills - - specification/ai-foundry/data-plane/Foundry/src/toolboxes - - specification/ai-foundry/data-plane/Foundry/src/tools - - specification/ai-foundry/data-plane/Foundry/src/voice-agents +- specification/ai-foundry/data-plane/Foundry/src/agents +- specification/ai-foundry/data-plane/Foundry/src/agents-optimization +- specification/ai-foundry/data-plane/Foundry/src/agents-session-files +- specification/ai-foundry/data-plane/Foundry/src/common +- specification/ai-foundry/data-plane/Foundry/src/connections +- specification/ai-foundry/data-plane/Foundry/src/data_generation_jobs +- specification/ai-foundry/data-plane/Foundry/src/datasets +- specification/ai-foundry/data-plane/Foundry/src/deployments +- specification/ai-foundry/data-plane/Foundry/src/evaluation-rules +- specification/ai-foundry/data-plane/Foundry/src/evaluation-taxonomies +- specification/ai-foundry/data-plane/Foundry/src/evaluators +- specification/ai-foundry/data-plane/Foundry/src/indexes +- specification/ai-foundry/data-plane/Foundry/src/insights +- specification/ai-foundry/data-plane/Foundry/src/memory-stores +- specification/ai-foundry/data-plane/Foundry/src/models +- specification/ai-foundry/data-plane/Foundry/src/openai +- specification/ai-foundry/data-plane/Foundry/src/red-teams +- specification/ai-foundry/data-plane/Foundry/src/routines +- specification/ai-foundry/data-plane/Foundry/src/schedules +- specification/ai-foundry/data-plane/Foundry/src/sdk-common +- specification/ai-foundry/data-plane/Foundry/src/skills +- specification/ai-foundry/data-plane/Foundry/src/toolboxes +- specification/ai-foundry/data-plane/Foundry/src/tools +- specification/ai-foundry/data-plane/Foundry/src/voice-agents From 104696d185991a0d13f21c46a07695220da363a5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 19 Aug 2026 04:01:35 +0000 Subject: [PATCH 30/56] Fix azure-ai-projects API consistency Co-authored-by: xitzhang <11403681+xitzhang@users.noreply.github.com> --- sdk/ai/azure-ai-projects/api.md | 3568 ++++++++------------- sdk/ai/azure-ai-projects/api.metadata.yml | 2 +- sdk/ai/azure-ai-projects/pyproject.toml | 1 + 3 files changed, 1380 insertions(+), 2191 deletions(-) diff --git a/sdk/ai/azure-ai-projects/api.md b/sdk/ai/azure-ai-projects/api.md index 935dfa2186ee..2d7054d14082 100644 --- a/sdk/ai/azure-ai-projects/api.md +++ b/sdk/ai/azure-ai-projects/api.md @@ -369,7 +369,7 @@ namespace azure.ai.projects.aio.operations async def create_session( self, agent_name: str, - body: CreateSessionRequest, + body: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -449,7 +449,7 @@ namespace azure.ai.projects.aio.operations async def create_version_from_manifest( self, agent_name: str, - body: CreateAgentVersionFromManifestRequest, + body: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -548,7 +548,7 @@ namespace azure.ai.projects.aio.operations @overload async def generate_agent( self, - body: GenerateAgentRequest, + body: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -665,7 +665,7 @@ namespace azure.ai.projects.aio.operations async def update_details( self, agent_name: str, - body: PatchAgentObjectRequest, + body: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -727,7 +727,7 @@ namespace azure.ai.projects.aio.operations @overload async def begin_create_optimization_job( self, - job: AgentOptimizationJob, + job: JSON, *, content_type: str = "application/json", operation_id: Optional[str] = ..., @@ -799,7 +799,7 @@ namespace azure.ai.projects.aio.operations @overload async def begin_create_generation_job( self, - job: DataGenerationJob, + job: JSON, *, content_type: str = "application/json", operation_id: Optional[str] = ..., @@ -870,7 +870,7 @@ namespace azure.ai.projects.aio.operations async def create( self, name: str, - taxonomy: EvaluationTaxonomy, + taxonomy: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -923,7 +923,7 @@ namespace azure.ai.projects.aio.operations async def update( self, name: str, - taxonomy: EvaluationTaxonomy, + taxonomy: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -961,7 +961,7 @@ namespace azure.ai.projects.aio.operations @overload async def begin_create_generation_job( self, - job: EvaluatorGenerationJob, + job: JSON, *, content_type: str = "application/json", operation_id: Optional[str] = ..., @@ -999,7 +999,7 @@ namespace azure.ai.projects.aio.operations async def create_version( self, name: str, - evaluator_version: EvaluatorVersion, + evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -1046,7 +1046,7 @@ namespace azure.ai.projects.aio.operations self, name: str, version: str, - credential_request: EvaluatorCredentialRequest, + credential_request: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -1123,7 +1123,7 @@ namespace azure.ai.projects.aio.operations self, name: str, version: str, - pending_upload_request: PendingUploadRequest, + pending_upload_request: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -1156,7 +1156,7 @@ namespace azure.ai.projects.aio.operations self, name: str, version: str, - evaluator_version: EvaluatorVersion, + evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -1194,7 +1194,7 @@ namespace azure.ai.projects.aio.operations @overload async def generate( self, - insight: Insight, + insight: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -1287,7 +1287,7 @@ namespace azure.ai.projects.aio.operations @overload async def create( self, - body: CreateMemoryStoreRequest, + body: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -1318,7 +1318,7 @@ namespace azure.ai.projects.aio.operations async def create_memory( self, name: str, - body: CreateMemoryRequest, + body: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -1363,7 +1363,7 @@ namespace azure.ai.projects.aio.operations async def delete_scope( self, name: str, - body: DeleteScopeRequest, + body: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -1422,7 +1422,7 @@ namespace azure.ai.projects.aio.operations def list_memories( self, name: str, - body: ListMemoriesRequest, + body: JSON, *, before: Optional[str] = ..., content_type: str = "application/json", @@ -1494,7 +1494,7 @@ namespace azure.ai.projects.aio.operations async def update( self, name: str, - body: UpdateMemoryStoreRequest, + body: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -1526,7 +1526,7 @@ namespace azure.ai.projects.aio.operations self, name: str, memory_id: str, - body: UpdateMemoryRequest, + body: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -1618,7 +1618,7 @@ namespace azure.ai.projects.aio.operations self, name: str, version: str, - credential_request: ModelCredentialRequest, + credential_request: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -1661,7 +1661,7 @@ namespace azure.ai.projects.aio.operations self, name: str, version: str, - model_version: ModelVersion, + model_version: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -1694,7 +1694,7 @@ namespace azure.ai.projects.aio.operations self, name: str, version: str, - pending_upload_request: ModelPendingUploadRequest, + pending_upload_request: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -1727,7 +1727,7 @@ namespace azure.ai.projects.aio.operations self, name: str, version: str, - model_version_update: UpdateModelVersionRequest, + model_version_update: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -1785,7 +1785,7 @@ namespace azure.ai.projects.aio.operations @overload async def create( self, - red_team: RedTeam, + red_team: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -1836,7 +1836,7 @@ namespace azure.ai.projects.aio.operations async def create_or_update( self, routine_name: str, - body: CreateOrUpdateRoutineRequest, + body: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -1880,7 +1880,7 @@ namespace azure.ai.projects.aio.operations async def dispatch( self, routine_name: str, - body: DispatchRoutineAsyncRequest, + body: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -1914,9 +1914,9 @@ namespace azure.ai.projects.aio.operations def list( self, *, - before: Optional[str] = ..., + after: Optional[str] = ..., limit: Optional[int] = ..., - order: Optional[str] = ..., + order: Optional[Union[str, PageOrder]] = ..., **kwargs: Any ) -> AsyncItemPaged[Routine]: ... @@ -1925,10 +1925,10 @@ namespace azure.ai.projects.aio.operations self, routine_name: str, *, - before: Optional[str] = ..., + after: Optional[str] = ..., filter: Optional[str] = ..., limit: Optional[int] = ..., - order: Optional[str] = ..., + order: Optional[Union[str, PageOrder]] = ..., **kwargs: Any ) -> AsyncItemPaged[RoutineRun]: ... @@ -1955,7 +1955,7 @@ namespace azure.ai.projects.aio.operations async def create_or_update( self, schedule_id: str, - schedule: Schedule, + schedule: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -2036,7 +2036,7 @@ namespace azure.ai.projects.aio.operations async def create( self, name: str, - body: CreateSkillVersionRequest, + body: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -2064,7 +2064,7 @@ namespace azure.ai.projects.aio.operations async def create_from_files( self, name: str, - content: CreateSkillVersionFromFilesBody, + content: JSON, **kwargs: Any ) -> SkillVersion: ... @@ -2148,7 +2148,7 @@ namespace azure.ai.projects.aio.operations async def update( self, name: str, - body: UpdateSkillRequest, + body: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -2225,7 +2225,7 @@ namespace azure.ai.projects.aio.operations self, name: str, version: str, - dataset_version: DatasetVersion, + dataset_version: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -2292,7 +2292,7 @@ namespace azure.ai.projects.aio.operations self, name: str, version: str, - pending_upload_request: PendingUploadRequest, + pending_upload_request: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -2446,7 +2446,7 @@ namespace azure.ai.projects.aio.operations self, name: str, version: str, - index: Index, + index: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -2524,7 +2524,7 @@ namespace azure.ai.projects.aio.operations async def create_version( self, name: str, - body: CreateToolboxVersionRequest, + body: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -2605,7 +2605,7 @@ namespace azure.ai.projects.aio.operations async def update( self, name: str, - body: UpdateToolboxRequest1, + body: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -3556,21 +3556,21 @@ namespace azure.ai.projects.models class azure.ai.projects.models.AzureAIAgentTargetParam(TypedDict, total=False): - key "name": Required[str] key "tool_descriptions": List[ToolDescriptionParam] - key "type": Required[Literal["azure_ai_agent"]] key "version": str + name: Required[str] + type: Required[Literal["azure_ai_agent"]] class azure.ai.projects.models.AzureAIBenchmarkPreviewEvalRunDataSource(TypedDict, total=False): key "input_messages": InputMessagesItemReference - key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] - key "type": Required[Literal["azure_ai_benchmark_preview"]] + target: Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] + type: Required[Literal["azure_ai_benchmark_preview"]] class azure.ai.projects.models.AzureAIDataSourceConfig(TypedDict, total=False): - key "scenario": Required[str] - key "type": Required[Literal["azure_ai_source"]] + scenario: Required[str] + type: Required[Literal["azure_ai_source"]] class azure.ai.projects.models.AzureAIModelTarget(EvaluationTarget, discriminator='azure_ai_model'): @@ -3593,14 +3593,14 @@ namespace azure.ai.projects.models class azure.ai.projects.models.AzureAIModelTargetParam(TypedDict, total=False): key "model": str key "sampling_params": ModelSamplingConfigParam - key "type": Required[Literal["azure_ai_model"]] + type: Required[Literal["azure_ai_model"]] class azure.ai.projects.models.AzureAIResponsesEvalRunDataSource(TypedDict, total=False): key "event_configuration_id": str - key "item_generation_params": Required[ResponseRetrievalItemGenerationParams] key "max_runs_hourly": int - key "type": Required[Literal["azure_ai_responses"]] + item_generation_params: Required[ResponseRetrievalItemGenerationParams] + type: Required[Literal["azure_ai_responses"]] class azure.ai.projects.models.AzureAISearchIndex(Index, discriminator='AzureSearch'): @@ -4354,12 +4354,14 @@ namespace azure.ai.projects.models class azure.ai.projects.models.ContainerConfiguration(_Model): image: str + registry_connection_id: Optional[str] @overload def __init__( self, *, - image: str + image: str, + registry_connection_id: Optional[str] = ... ) -> None: ... @overload @@ -4848,7 +4850,7 @@ namespace azure.ai.projects.models class azure.ai.projects.models.DataGenerationJobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): SIMPLE_QNA = "simple_qna" - TASK_GENERATION = "task_generation" + SIMULATION_SEED = "simulation_seed" TOOL_USE = "tool_use" TRACES = "traces" @@ -5208,13 +5210,13 @@ namespace azure.ai.projects.models class azure.ai.projects.models.EvalCsvFileIdSource(TypedDict, total=False): - key "id": Required[str] - key "type": Required[Literal["file_id"]] + id: Required[str] + type: Required[Literal["file_id"]] class azure.ai.projects.models.EvalCsvRunDataSource(TypedDict, total=False): - key "source": Required[EvalCsvFileIdSource] - key "type": Required[Literal["csv"]] + source: Required[EvalCsvFileIdSource] + type: Required[Literal["csv"]] class azure.ai.projects.models.EvalResult(_Model): @@ -8981,9 +8983,9 @@ namespace azure.ai.projects.models class azure.ai.projects.models.RedTeamEvalRunDataSource(TypedDict, total=False): - key "item_generation_params": Required[Any] - key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] - key "type": Required[Literal["azure_ai_red_team"]] + item_generation_params: Required[Any] + target: Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] + type: Required[Literal["azure_ai_red_team"]] class azure.ai.projects.models.RedTeamTargetConfig(_Model): @@ -9020,10 +9022,10 @@ namespace azure.ai.projects.models class azure.ai.projects.models.ResponseRetrievalItemGenerationParams(TypedDict, total=False): - key "data_mapping": Required[Dict[str, str]] key "max_num_turns": int - key "source": Required[Union[SourceFileContent, SourceFileID]] - key "type": Required[Literal["response_retrieval"]] + data_mapping: Required[Dict[str, str]] + source: Required[Union[SourceFileContent, SourceFileID]] + type: Required[Literal["response_retrieval"]] class azure.ai.projects.models.ResponseUsageInputTokensDetails(_Model): @@ -9528,6 +9530,25 @@ namespace azure.ai.projects.models SHORT_ANSWER = "short_answer" + class azure.ai.projects.models.SimulationSeedDataGenerationJobOptions(DataGenerationJobOptions, discriminator='simulation_seed'): + max_samples: int + model_options: DataGenerationModelOptions + train_split: float + type: Literal[DataGenerationJobType.SIMULATION_SEED] + + @overload + def __init__( + self, + *, + max_samples: int, + model_options: Optional[DataGenerationModelOptions] = ..., + train_split: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.SkillDetails(_Model): created_at: datetime default_version: str @@ -9688,29 +9709,10 @@ namespace azure.ai.projects.models class azure.ai.projects.models.TargetCompletionEvalRunDataSource(TypedDict, total=False): - key "input_messages": Required[InputMessagesItemReference] - key "source": Required[Union[SourceFileContent, SourceFileID]] - key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] - key "type": Required[Literal["azure_ai_target_completions"]] - - - class azure.ai.projects.models.TaskGenerationDataGenerationJobOptions(DataGenerationJobOptions, discriminator='task_generation'): - max_samples: int - model_options: DataGenerationModelOptions - train_split: float - type: Literal[DataGenerationJobType.TASK_GENERATION] - - @overload - def __init__( - self, - *, - max_samples: int, - model_options: Optional[DataGenerationModelOptions] = ..., - train_split: Optional[float] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + input_messages: Required[InputMessagesItemReference] + source: Required[Union[SourceFileContent, SourceFileID]] + target: Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] + type: Required[Literal["azure_ai_target_completions"]] class azure.ai.projects.models.TaxonomyCategory(_Model): @@ -9841,11 +9843,11 @@ namespace azure.ai.projects.models class azure.ai.projects.models.TestingCriterionAzureAIEvaluator(TypedDict, total=False): key "data_mapping": Dict[str, str] - key "evaluator_name": Required[str] key "evaluator_version": str key "initialization_parameters": Dict[str, Any] - key "name": Required[str] - key "type": Required[Literal["azure_ai_evaluator"]] + evaluator_name: Required[str] + name: Required[str] + type: Required[Literal["azure_ai_evaluator"]] class azure.ai.projects.models.TextResponseFormat(_Model): @@ -10417,6 +10419,7 @@ namespace azure.ai.projects.models class azure.ai.projects.models.TracesDataGenerationJobOptions(DataGenerationJobOptions, discriminator='traces'): max_samples: int model_options: DataGenerationModelOptions + redact_private_content: Optional[bool] train_split: float type: Literal[DataGenerationJobType.TRACES] @@ -10426,6 +10429,7 @@ namespace azure.ai.projects.models *, max_samples: int, model_options: Optional[DataGenerationModelOptions] = ..., + redact_private_content: Optional[bool] = ..., train_split: Optional[float] = ... ) -> None: ... @@ -10491,7 +10495,7 @@ namespace azure.ai.projects.models key "lookback_hours": int key "max_traces": int key "trace_ids": List[str] - key "type": Required[Literal["azure_ai_traces_preview"]] + type: Required[Literal["azure_ai_traces_preview"]] class azure.ai.projects.models.TranscriptTextUsageDuration(CreateTranscriptionResponseJsonUsage, discriminator='duration'): @@ -12401,6 +12405,7 @@ namespace azure.ai.projects.models class azure.ai.projects.models.VoiceAgentServerEventSessionCreated(_Model): + conversation_id: Optional[str] event_id: str session: VoiceAgentSessionResponseConfig type: Literal[RealtimeServerEventType.SESSION_CREATED] @@ -12409,6 +12414,7 @@ namespace azure.ai.projects.models def __init__( self, *, + conversation_id: Optional[str] = ..., event_id: str, session: VoiceAgentSessionResponseConfig, type: Literal[RealtimeServerEventType.SESSION_CREATED] @@ -13967,7 +13973,7 @@ namespace azure.ai.projects.operations def create_session( self, agent_name: str, - body: CreateSessionRequest, + body: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -14047,7 +14053,7 @@ namespace azure.ai.projects.operations def create_version_from_manifest( self, agent_name: str, - body: CreateAgentVersionFromManifestRequest, + body: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -14146,7 +14152,7 @@ namespace azure.ai.projects.operations @overload def generate_agent( self, - body: GenerateAgentRequest, + body: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -14263,7 +14269,7 @@ namespace azure.ai.projects.operations def update_details( self, agent_name: str, - body: PatchAgentObjectRequest, + body: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -14325,7 +14331,7 @@ namespace azure.ai.projects.operations @overload def begin_create_optimization_job( self, - job: AgentOptimizationJob, + job: JSON, *, content_type: str = "application/json", operation_id: Optional[str] = ..., @@ -14397,7 +14403,7 @@ namespace azure.ai.projects.operations @overload def begin_create_generation_job( self, - job: DataGenerationJob, + job: JSON, *, content_type: str = "application/json", operation_id: Optional[str] = ..., @@ -14468,7 +14474,7 @@ namespace azure.ai.projects.operations def create( self, name: str, - taxonomy: EvaluationTaxonomy, + taxonomy: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -14521,7 +14527,7 @@ namespace azure.ai.projects.operations def update( self, name: str, - taxonomy: EvaluationTaxonomy, + taxonomy: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -14559,7 +14565,7 @@ namespace azure.ai.projects.operations @overload def begin_create_generation_job( self, - job: EvaluatorGenerationJob, + job: JSON, *, content_type: str = "application/json", operation_id: Optional[str] = ..., @@ -14597,7 +14603,7 @@ namespace azure.ai.projects.operations def create_version( self, name: str, - evaluator_version: EvaluatorVersion, + evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -14644,7 +14650,7 @@ namespace azure.ai.projects.operations self, name: str, version: str, - credential_request: EvaluatorCredentialRequest, + credential_request: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -14721,7 +14727,7 @@ namespace azure.ai.projects.operations self, name: str, version: str, - pending_upload_request: PendingUploadRequest, + pending_upload_request: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -14754,7 +14760,7 @@ namespace azure.ai.projects.operations self, name: str, version: str, - evaluator_version: EvaluatorVersion, + evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -14792,7 +14798,7 @@ namespace azure.ai.projects.operations @overload def generate( self, - insight: Insight, + insight: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -14885,7 +14891,7 @@ namespace azure.ai.projects.operations @overload def create( self, - body: CreateMemoryStoreRequest, + body: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -14916,7 +14922,7 @@ namespace azure.ai.projects.operations def create_memory( self, name: str, - body: CreateMemoryRequest, + body: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -14961,7 +14967,7 @@ namespace azure.ai.projects.operations def delete_scope( self, name: str, - body: DeleteScopeRequest, + body: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -15020,7 +15026,7 @@ namespace azure.ai.projects.operations def list_memories( self, name: str, - body: ListMemoriesRequest, + body: JSON, *, before: Optional[str] = ..., content_type: str = "application/json", @@ -15092,7 +15098,7 @@ namespace azure.ai.projects.operations def update( self, name: str, - body: UpdateMemoryStoreRequest, + body: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -15124,7 +15130,7 @@ namespace azure.ai.projects.operations self, name: str, memory_id: str, - body: UpdateMemoryRequest, + body: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -15218,7 +15224,7 @@ namespace azure.ai.projects.operations self, name: str, version: str, - credential_request: ModelCredentialRequest, + credential_request: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -15261,7 +15267,7 @@ namespace azure.ai.projects.operations self, name: str, version: str, - model_version: ModelVersion, + model_version: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -15294,7 +15300,7 @@ namespace azure.ai.projects.operations self, name: str, version: str, - pending_upload_request: ModelPendingUploadRequest, + pending_upload_request: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -15327,7 +15333,7 @@ namespace azure.ai.projects.operations self, name: str, version: str, - model_version_update: UpdateModelVersionRequest, + model_version_update: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -15385,7 +15391,7 @@ namespace azure.ai.projects.operations @overload def create( self, - red_team: RedTeam, + red_team: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -15436,7 +15442,7 @@ namespace azure.ai.projects.operations def create_or_update( self, routine_name: str, - body: CreateOrUpdateRoutineRequest, + body: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -15480,7 +15486,7 @@ namespace azure.ai.projects.operations def dispatch( self, routine_name: str, - body: DispatchRoutineAsyncRequest, + body: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -15514,9 +15520,9 @@ namespace azure.ai.projects.operations def list( self, *, - before: Optional[str] = ..., + after: Optional[str] = ..., limit: Optional[int] = ..., - order: Optional[str] = ..., + order: Optional[Union[str, PageOrder]] = ..., **kwargs: Any ) -> ItemPaged[Routine]: ... @@ -15525,10 +15531,10 @@ namespace azure.ai.projects.operations self, routine_name: str, *, - before: Optional[str] = ..., + after: Optional[str] = ..., filter: Optional[str] = ..., limit: Optional[int] = ..., - order: Optional[str] = ..., + order: Optional[Union[str, PageOrder]] = ..., **kwargs: Any ) -> ItemPaged[RoutineRun]: ... @@ -15555,7 +15561,7 @@ namespace azure.ai.projects.operations def create_or_update( self, schedule_id: str, - schedule: Schedule, + schedule: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -15636,7 +15642,7 @@ namespace azure.ai.projects.operations def create( self, name: str, - body: CreateSkillVersionRequest, + body: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -15664,7 +15670,7 @@ namespace azure.ai.projects.operations def create_from_files( self, name: str, - content: CreateSkillVersionFromFilesBody, + content: JSON, **kwargs: Any ) -> SkillVersion: ... @@ -15748,7 +15754,7 @@ namespace azure.ai.projects.operations def update( self, name: str, - body: UpdateSkillRequest, + body: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -15825,7 +15831,7 @@ namespace azure.ai.projects.operations self, name: str, version: str, - dataset_version: DatasetVersion, + dataset_version: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -15892,7 +15898,7 @@ namespace azure.ai.projects.operations self, name: str, version: str, - pending_upload_request: PendingUploadRequest, + pending_upload_request: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -16046,7 +16052,7 @@ namespace azure.ai.projects.operations self, name: str, version: str, - index: Index, + index: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -16124,7 +16130,7 @@ namespace azure.ai.projects.operations def create_version( self, name: str, - body: CreateToolboxVersionRequest, + body: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -16205,7 +16211,7 @@ namespace azure.ai.projects.operations def update( self, name: str, - body: UpdateToolboxRequest1, + body: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -16274,12 +16280,11 @@ namespace azure.ai.projects.types key "base_url": str key "project_connection_id": str key "send_credentials_for_agent_card": bool - key "type": Required[Literal[ToolType.A2A_PREVIEW]] agent_card_path: str base_url: str project_connection_id: str send_credentials_for_agent_card: bool - type: Literal[ToolType.A2A_PREVIEW] + type: Required[Literal[ToolType.A2A_PREVIEW]] class azure.ai.projects.types.A2APreviewToolboxTool(TypedDict, total=False): @@ -16289,7 +16294,7 @@ namespace azure.ai.projects.types key "name": str key "project_connection_id": str key "send_credentials_for_agent_card": bool - key "type": Required[Literal[ToolboxToolType.A2A_PREVIEW]] + key "tool_configs": dict[str, ToolConfig] agent_card_path: str base_url: str description: str @@ -16297,7 +16302,7 @@ namespace azure.ai.projects.types project_connection_id: str send_credentials_for_agent_card: bool tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.A2A_PREVIEW] + type: Required[Literal[ToolboxToolType.A2A_PREVIEW]] class azure.ai.projects.types.A2AProtocolConfiguration(TypedDict, total=False): @@ -16324,10 +16329,8 @@ namespace azure.ai.projects.types class azure.ai.projects.types.AgentBlueprintReference(TypedDict, total=False): - key "blueprint_id": Required[str] - key "type": Required[Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT]] - blueprint_id: str - type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] + blueprint_id: Required[str] + type: Required[Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT]] class azure.ai.projects.types.AgentBlueprintReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -16336,49 +16339,41 @@ namespace azure.ai.projects.types class azure.ai.projects.types.AgentCard(TypedDict, total=False): key "description": str - key "skills": Required[list[AgentCardSkill]] - key "version": Required[str] description: str - skills: list[AgentCardSkill] - version: str + skills: Required[list[AgentCardSkill]] + version: Required[str] class azure.ai.projects.types.AgentCardSkill(TypedDict, total=False): key "description": str - key "id": Required[str] - key "name": Required[str] + key "examples": list[str] + key "tags": list[str] description: str examples: list[str] - id: str - name: str + id: Required[str] + name: Required[str] tags: list[str] class azure.ai.projects.types.AgentClusterInsightRequest(TypedDict, total=False): - key "agentName": Required[str] - key "modelConfiguration": ForwardRef('InsightModelConfiguration', module='types') - key "type": Required[Literal[InsightType.AGENT_CLUSTER_INSIGHT]] - agentName: str + key "modelConfiguration": ForwardRef('InsightModelConfiguration') + agentName: Required[str] modelConfiguration: InsightModelConfiguration - type: Literal[InsightType.AGENT_CLUSTER_INSIGHT] + type: Required[Literal[InsightType.AGENT_CLUSTER_INSIGHT]] class azure.ai.projects.types.AgentClusterInsightResult(TypedDict, total=False): - key "clusterInsight": Required[ClusterInsightResult] - key "type": Required[Literal[InsightType.AGENT_CLUSTER_INSIGHT]] - clusterInsight: ClusterInsightResult - type: Literal[InsightType.AGENT_CLUSTER_INSIGHT] + clusterInsight: Required[ClusterInsightResult] + type: Required[Literal[InsightType.AGENT_CLUSTER_INSIGHT]] class azure.ai.projects.types.AgentDataGenerationJobSource(TypedDict, total=False): - key "agent_name": Required[str] key "agent_version": str key "description": str - key "type": Required[Literal[DataGenerationJobSourceType.AGENT]] - agent_name: str + agent_name: Required[str] agent_version: str description: str - type: Literal[DataGenerationJobSourceType.AGENT] + type: Required[Literal[DataGenerationJobSourceType.AGENT]] class azure.ai.projects.types.AgentEndpointAuthorizationSchemeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -16389,22 +16384,21 @@ namespace azure.ai.projects.types class azure.ai.projects.types.AgentEndpointConfig(TypedDict, total=False): - key "protocol_configuration": ForwardRef('ProtocolConfiguration', module='types') - key "version_selector": ForwardRef('VersionSelector', module='types') + key "authorization_schemes": list[AgentEndpointAuthorizationScheme] + key "protocol_configuration": ForwardRef('ProtocolConfiguration') + key "version_selector": ForwardRef('VersionSelector') authorization_schemes: list[AgentEndpointAuthorizationScheme] protocol_configuration: ProtocolConfiguration version_selector: VersionSelector class azure.ai.projects.types.AgentEvaluatorGenerationJobSource(TypedDict, total=False): - key "agent_name": Required[str] key "agent_version": str key "description": str - key "type": Required[Literal[EvaluatorGenerationJobSourceType.AGENT]] - agent_name: str + agent_name: Required[str] agent_version: str description: str - type: Literal[EvaluatorGenerationJobSourceType.AGENT] + type: Required[Literal[EvaluatorGenerationJobSourceType.AGENT]] class azure.ai.projects.types.AgentKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -16416,28 +16410,24 @@ namespace azure.ai.projects.types class azure.ai.projects.types.AgentOptimizationCandidate(TypedDict, total=False): - key "avg_score": Required[float] - key "avg_tokens": Required[float] key "candidate_id": str key "eval_id": str key "eval_run_id": str - key "name": Required[str] - key "promotion": ForwardRef('PromotionInfo', module='types') - avg_score: float - avg_tokens: float + key "mutations": dict[str, Any] + key "promotion": ForwardRef('PromotionInfo') + avg_score: Required[float] + avg_tokens: Required[float] candidate_id: str eval_id: str eval_run_id: str mutations: dict[str, Any] - name: str + name: Required[str] promotion: PromotionInfo class azure.ai.projects.types.AgentOptimizationDatasetCriterion(TypedDict, total=False): - key "instruction": Required[str] - key "name": Required[str] - instruction: str - name: str + instruction: Required[str] + name: Required[str] class azure.ai.projects.types.AgentOptimizationDatasetInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -16446,6 +16436,7 @@ namespace azure.ai.projects.types class azure.ai.projects.types.AgentOptimizationDatasetItem(TypedDict, total=False): + key "criteria": list[AgentOptimizationDatasetCriterion] key "desired_num_turns": int key "ground_truth": str key "query": str @@ -16456,64 +16447,53 @@ namespace azure.ai.projects.types class azure.ai.projects.types.AgentOptimizationEvaluatorRef(TypedDict, total=False): - key "name": Required[str] key "version": str - name: str + name: Required[str] version: str class azure.ai.projects.types.AgentOptimizationInlineDatasetInput(TypedDict, total=False): - key "items": Required[list[AgentOptimizationDatasetItem]] - key "type": Required[Literal[AgentOptimizationDatasetInputType.INLINE]] - items: list[AgentOptimizationDatasetItem] - type: Literal[AgentOptimizationDatasetInputType.INLINE] + items: Required[list[AgentOptimizationDatasetItem]] + type: Required[Literal[AgentOptimizationDatasetInputType.INLINE]] class azure.ai.projects.types.AgentOptimizationJob(TypedDict, total=False): - key "created_at": Required[int] - key "error": ForwardRef('ApiError', module='types') - key "id": Required[str] - key "inputs": ForwardRef('AgentOptimizationJobInputs', module='types') - key "progress": ForwardRef('AgentOptimizationJobProgress', module='types') - key "result": ForwardRef('AgentOptimizationJobResult', module='types') - key "status": Required[Union[str, JobStatus]] - key "updated_at": Required[int] - created_at: int + key "error": ForwardRef('ApiError') + key "inputs": ForwardRef('AgentOptimizationJobInputs') + key "progress": ForwardRef('AgentOptimizationJobProgress') + key "result": ForwardRef('AgentOptimizationJobResult') + key "warnings": list[str] + created_at: Required[int] error: ApiError - id: str + id: Required[str] inputs: AgentOptimizationJobInputs progress: AgentOptimizationJobProgress result: AgentOptimizationJobResult - status: Union[str, JobStatus] - updated_at: int + status: Required[Union[str, JobStatus]] + updated_at: Required[int] warnings: list[str] class azure.ai.projects.types.AgentOptimizationJobInputs(TypedDict, total=False): - key "agent": Required[OptimizedAgentIdentifier] - key "evaluators": Required[list[AgentOptimizationEvaluatorRef]] - key "options": ForwardRef('AgentOptimizationOptions', module='types') - key "train_dataset": Required[AgentOptimizationDatasetInput] - key "validation_dataset": ForwardRef('AgentOptimizationDatasetInput', module='types') - agent: OptimizedAgentIdentifier - evaluators: list[AgentOptimizationEvaluatorRef] + key "options": ForwardRef('AgentOptimizationOptions') + key "validation_dataset": ForwardRef('AgentOptimizationDatasetInput') + agent: Required[OptimizedAgentIdentifier] + evaluators: Required[list[AgentOptimizationEvaluatorRef]] options: AgentOptimizationOptions - train_dataset: AgentOptimizationDatasetInput + train_dataset: Required[AgentOptimizationDatasetInput] validation_dataset: AgentOptimizationDatasetInput class azure.ai.projects.types.AgentOptimizationJobProgress(TypedDict, total=False): - key "best_score": Required[float] - key "candidates_completed": Required[int] - key "elapsed_seconds": Required[float] - best_score: float - candidates_completed: int - elapsed_seconds: float + best_score: Required[float] + candidates_completed: Required[int] + elapsed_seconds: Required[float] class azure.ai.projects.types.AgentOptimizationJobResult(TypedDict, total=False): key "baseline": str key "best": str + key "candidates": list[AgentOptimizationCandidate] baseline: str best: str candidates: list[AgentOptimizationCandidate] @@ -16524,6 +16504,7 @@ namespace azure.ai.projects.types key "evaluation_level": Union[str, EvaluationLevel] key "max_candidates": int key "max_stalls": int + key "optimization_config": dict[str, Any] key "optimization_model": str eval_model: str evaluation_level: Union[str, EvaluationLevel] @@ -16534,42 +16515,37 @@ namespace azure.ai.projects.types class azure.ai.projects.types.AgentOptimizationReferenceDatasetInput(TypedDict, total=False): - key "name": Required[str] - key "type": Required[Literal[AgentOptimizationDatasetInputType.REFERENCE]] key "version": str - name: str - type: Literal[AgentOptimizationDatasetInputType.REFERENCE] + name: Required[str] + type: Required[Literal[AgentOptimizationDatasetInputType.REFERENCE]] version: str class azure.ai.projects.types.AgentTaxonomyInput(TypedDict, total=False): - key "riskCategories": Required[list[Union[str, RiskCategory]]] - key "target": Required[EvaluationTarget] - key "type": Required[Literal[EvaluationTaxonomyInputType.AGENT]] - riskCategories: list[Union[str, RiskCategory]] - target: EvaluationTarget - type: Literal[EvaluationTaxonomyInputType.AGENT] + riskCategories: Required[list[Union[str, RiskCategory]]] + target: Required[EvaluationTarget] + type: Required[Literal[EvaluationTaxonomyInputType.AGENT]] class azure.ai.projects.types.ApiError(TypedDict, total=False): - key "code": Required[Optional[str]] - key "message": Required[str] + key "additionalInfo": dict[str, Any] + key "debugInfo": dict[str, Any] + key "details": list[ApiError] key "param": Optional[str] key "type": str additionalInfo: dict[str, Any] - code: str + code: Required[Optional[str]] debugInfo: dict[str, Any] details: list[ApiError] - message: str + message: Required[str] param: str type: str class azure.ai.projects.types.ApplyPatchToolParam(TypedDict, total=False): key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] - key "type": Required[Literal[ToolType.APPLY_PATCH]] allowed_callers: list[Union[str, CallableToolAllowedCaller]] - type: Literal[ToolType.APPLY_PATCH] + type: Required[Literal[ToolType.APPLY_PATCH]] class azure.ai.projects.types.ApproximateLocation(TypedDict, total=False): @@ -16577,291 +16553,248 @@ namespace azure.ai.projects.types key "country": Optional[str] key "region": Optional[str] key "timezone": Optional[str] - key "type": Required[Literal["approximate"]] city: str country: str region: str timezone: str - type: Literal[approximate] + type: Required[Literal["approximate"]] class azure.ai.projects.types.ArtifactProfile(TypedDict, total=False): - key "category": Required[Union[str, FoundryModelArtifactProfileCategory]] - category: Union[str, FoundryModelArtifactProfileCategory] + key "signals": list[Union[str, FoundryModelArtifactProfileSignal]] + category: Required[Union[str, FoundryModelArtifactProfileCategory]] signals: list[Union[str, FoundryModelArtifactProfileSignal]] class azure.ai.projects.types.AutoCodeInterpreterToolParam(TypedDict, total=False): + key "file_ids": list[str] key "memory_limit": Optional[Union[str, ContainerMemoryLimit]] - key "network_policy": ForwardRef('ContainerNetworkPolicyParam', module='types') - key "type": Required[Literal["auto"]] + key "network_policy": ForwardRef('ContainerNetworkPolicyParam') file_ids: list[str] memory_limit: Union[str, ContainerMemoryLimit] network_policy: ContainerNetworkPolicyParam - type: Literal[auto] + type: Required[Literal["auto"]] class azure.ai.projects.types.AzureAIAgentTarget(TypedDict, total=False): - key "name": Required[str] - key "type": Required[Literal["azure_ai_agent"]] + key "tool_descriptions": list[ToolDescription] + key "tools": list[Tool] key "version": str - name: str + name: Required[str] tool_descriptions: list[ToolDescription] tools: list[Tool] - type: Literal[azure_ai_agent] + type: Required[Literal["azure_ai_agent"]] version: str class azure.ai.projects.types.AzureAIModelTarget(TypedDict, total=False): key "model": str - key "sampling_params": ForwardRef('ModelSamplingParams', module='types') - key "type": Required[Literal["azure_ai_model"]] + key "sampling_params": ForwardRef('ModelSamplingParams') model: str sampling_params: ModelSamplingParams - type: Literal[azure_ai_model] + type: Required[Literal["azure_ai_model"]] class azure.ai.projects.types.AzureAISearchIndex(TypedDict, total=False): - key "connectionName": Required[str] key "description": str - key "fieldMapping": ForwardRef('FieldMapping', module='types') + key "fieldMapping": ForwardRef('FieldMapping') key "id": str - key "indexName": Required[str] - key "name": Required[str] - key "type": Required[Literal[IndexType.AZURE_SEARCH]] - key "version": Required[str] - connectionName: str + key "tags": dict[str, str] + connectionName: Required[str] description: str fieldMapping: FieldMapping id: str - indexName: str - name: str + indexName: Required[str] + name: Required[str] tags: dict[str, str] - type: Literal[IndexType.AZURE_SEARCH] - version: str + type: Required[Literal[IndexType.AZURE_SEARCH]] + version: Required[str] class azure.ai.projects.types.AzureAISearchTool(TypedDict, total=False): - key "azure_ai_search": Required[AzureAISearchToolResource] key "description": str key "name": str - key "type": Required[Literal[ToolType.AZURE_AI_SEARCH]] - azure_ai_search: AzureAISearchToolResource + key "tool_configs": dict[str, ToolConfig] + azure_ai_search: Required[AzureAISearchToolResource] description: str name: str tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.AZURE_AI_SEARCH] + type: Required[Literal[ToolType.AZURE_AI_SEARCH]] class azure.ai.projects.types.AzureAISearchToolResource(TypedDict, total=False): - key "indexes": Required[list[AISearchIndexResource]] - indexes: list[AISearchIndexResource] + indexes: Required[list[AISearchIndexResource]] class azure.ai.projects.types.AzureAISearchToolboxTool(TypedDict, total=False): - key "azure_ai_search": Required[AzureAISearchToolResource] key "description": str key "name": str - key "type": Required[Literal[ToolboxToolType.AZURE_AI_SEARCH]] - azure_ai_search: AzureAISearchToolResource + key "tool_configs": dict[str, ToolConfig] + azure_ai_search: Required[AzureAISearchToolResource] description: str name: str tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.AZURE_AI_SEARCH] + type: Required[Literal[ToolboxToolType.AZURE_AI_SEARCH]] class azure.ai.projects.types.AzureFunctionBinding(TypedDict, total=False): - key "storage_queue": Required[AzureFunctionStorageQueue] - key "type": Required[Literal["storage_queue"]] - storage_queue: AzureFunctionStorageQueue - type: Literal[storage_queue] + storage_queue: Required[AzureFunctionStorageQueue] + type: Required[Literal["storage_queue"]] class azure.ai.projects.types.AzureFunctionDefinition(TypedDict, total=False): - key "function": Required[AzureFunctionDefinitionFunction] - key "input_binding": Required[AzureFunctionBinding] - key "output_binding": Required[AzureFunctionBinding] - function: AzureFunctionDefinitionFunction - input_binding: AzureFunctionBinding - output_binding: AzureFunctionBinding + function: Required[AzureFunctionDefinitionFunction] + input_binding: Required[AzureFunctionBinding] + output_binding: Required[AzureFunctionBinding] class azure.ai.projects.types.AzureFunctionDefinitionFunction(TypedDict, total=False): key "description": str - key "name": Required[str] - key "parameters": Required[dict[str, Any]] description: str - name: str - parameters: dict[str, Any] + name: Required[str] + parameters: Required[dict[str, Any]] class azure.ai.projects.types.AzureFunctionStorageQueue(TypedDict, total=False): - key "queue_name": Required[str] - key "queue_service_endpoint": Required[str] - queue_name: str - queue_service_endpoint: str + queue_name: Required[str] + queue_service_endpoint: Required[str] class azure.ai.projects.types.AzureFunctionTool(TypedDict, total=False): - key "azure_function": Required[AzureFunctionDefinition] - key "type": Required[Literal[ToolType.AZURE_FUNCTION]] - azure_function: AzureFunctionDefinition + key "tool_configs": dict[str, ToolConfig] + azure_function: Required[AzureFunctionDefinition] tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.AZURE_FUNCTION] + type: Required[Literal[ToolType.AZURE_FUNCTION]] class azure.ai.projects.types.AzureOpenAIModelConfiguration(TypedDict, total=False): - key "modelDeploymentName": Required[str] - key "type": Required[Literal["AzureOpenAIModel"]] - modelDeploymentName: str - type: Literal[AzureOpenAIModel] + modelDeploymentName: Required[str] + type: Required[Literal["AzureOpenAIModel"]] class azure.ai.projects.types.BingCustomSearchConfiguration(TypedDict, total=False): key "count": int key "freshness": str - key "instance_name": Required[str] key "market": str - key "project_connection_id": Required[str] key "set_lang": str count: int freshness: str - instance_name: str + instance_name: Required[str] market: str - project_connection_id: str + project_connection_id: Required[str] set_lang: str class azure.ai.projects.types.BingCustomSearchPreviewTool(TypedDict, total=False): - key "bing_custom_search_preview": Required[BingCustomSearchToolParameters] - key "type": Required[Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW]] - bing_custom_search_preview: BingCustomSearchToolParameters - type: Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW] + bing_custom_search_preview: Required[BingCustomSearchToolParameters] + type: Required[Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW]] class azure.ai.projects.types.BingCustomSearchToolParameters(TypedDict, total=False): - key "search_configurations": Required[list[BingCustomSearchConfiguration]] - search_configurations: list[BingCustomSearchConfiguration] + search_configurations: Required[list[BingCustomSearchConfiguration]] class azure.ai.projects.types.BingGroundingSearchConfiguration(TypedDict, total=False): key "count": int key "freshness": str key "market": str - key "project_connection_id": Required[str] key "set_lang": str count: int freshness: str market: str - project_connection_id: str + project_connection_id: Required[str] set_lang: str class azure.ai.projects.types.BingGroundingSearchToolParameters(TypedDict, total=False): - key "search_configurations": Required[list[BingGroundingSearchConfiguration]] - search_configurations: list[BingGroundingSearchConfiguration] + search_configurations: Required[list[BingGroundingSearchConfiguration]] class azure.ai.projects.types.BingGroundingTool(TypedDict, total=False): - key "bing_grounding": Required[BingGroundingSearchToolParameters] key "description": str key "name": str - key "type": Required[Literal[ToolType.BING_GROUNDING]] - bing_grounding: BingGroundingSearchToolParameters + key "tool_configs": dict[str, ToolConfig] + bing_grounding: Required[BingGroundingSearchToolParameters] description: str name: str tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.BING_GROUNDING] + type: Required[Literal[ToolType.BING_GROUNDING]] class azure.ai.projects.types.BotServiceAuthorizationScheme(TypedDict, total=False): - key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE]] - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE] + type: Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE]] class azure.ai.projects.types.BotServiceRbacAuthorizationScheme(TypedDict, total=False): - key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC]] - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC] + type: Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC]] class azure.ai.projects.types.BotServiceTenantAuthorizationScheme(TypedDict, total=False): - key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT]] - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT] + type: Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT]] class azure.ai.projects.types.BrowserAutomationPreviewTool(TypedDict, total=False): - key "browser_automation_preview": Required[BrowserAutomationToolParameters] - key "type": Required[Literal[ToolType.BROWSER_AUTOMATION_PREVIEW]] - browser_automation_preview: BrowserAutomationToolParameters - type: Literal[ToolType.BROWSER_AUTOMATION_PREVIEW] + browser_automation_preview: Required[BrowserAutomationToolParameters] + type: Required[Literal[ToolType.BROWSER_AUTOMATION_PREVIEW]] class azure.ai.projects.types.BrowserAutomationPreviewToolboxTool(TypedDict, total=False): - key "browser_automation_preview": Required[BrowserAutomationToolParameters] key "description": str key "name": str - key "type": Required[Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW]] - browser_automation_preview: BrowserAutomationToolParameters + key "tool_configs": dict[str, ToolConfig] + browser_automation_preview: Required[BrowserAutomationToolParameters] description: str name: str tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW] + type: Required[Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW]] class azure.ai.projects.types.BrowserAutomationToolConnectionParameters(TypedDict, total=False): - key "project_connection_id": Required[str] - project_connection_id: str + project_connection_id: Required[str] class azure.ai.projects.types.BrowserAutomationToolParameters(TypedDict, total=False): - key "connection": Required[BrowserAutomationToolConnectionParameters] - connection: BrowserAutomationToolConnectionParameters + connection: Required[BrowserAutomationToolConnectionParameters] class azure.ai.projects.types.CaptureStructuredOutputsTool(TypedDict, total=False): key "description": str key "name": str - key "outputs": Required[StructuredOutputDefinition] - key "type": Required[Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS]] + key "tool_configs": dict[str, ToolConfig] description: str name: str - outputs: StructuredOutputDefinition + outputs: Required[StructuredOutputDefinition] tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS] + type: Required[Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS]] class azure.ai.projects.types.ChartCoordinate(TypedDict, total=False): - key "size": Required[int] - key "x": Required[int] - key "y": Required[int] - size: int - x: int - y: int + size: Required[int] + x: Required[int] + y: Required[int] class azure.ai.projects.types.ClusterInsightResult(TypedDict, total=False): - key "clusters": Required[list[InsightCluster]] - key "summary": Required[InsightSummary] - clusters: list[InsightCluster] + key "coordinates": dict[str, ChartCoordinate] + clusters: Required[list[InsightCluster]] coordinates: dict[str, ChartCoordinate] - summary: InsightSummary + summary: Required[InsightSummary] class azure.ai.projects.types.ClusterTokenUsage(TypedDict, total=False): - key "inputTokenUsage": Required[int] - key "outputTokenUsage": Required[int] - key "totalTokenUsage": Required[int] - inputTokenUsage: int - outputTokenUsage: int - totalTokenUsage: int + inputTokenUsage: Required[int] + outputTokenUsage: Required[int] + totalTokenUsage: Required[int] class azure.ai.projects.types.CodeBasedEvaluatorDefinition(TypedDict, total=False): key "blob_uri": str key "code_text": str + key "data_schema": dict[str, Any] key "entry_point": str key "image_tag": str - key "type": Required[Literal[EvaluatorDefinitionType.CODE]] + key "init_parameters": dict[str, Any] + key "metrics": dict[str, EvaluatorMetric] blob_uri: str code_text: str data_schema: dict[str, Any] @@ -16869,18 +16802,15 @@ namespace azure.ai.projects.types image_tag: str init_parameters: dict[str, Any] metrics: dict[str, EvaluatorMetric] - type: Literal[EvaluatorDefinitionType.CODE] + type: Required[Literal[EvaluatorDefinitionType.CODE]] class azure.ai.projects.types.CodeConfiguration(TypedDict, total=False): key "content_hash": str - key "dependency_resolution": Required[Union[str, CodeDependencyResolution]] - key "entry_point": Required[list[str]] - key "runtime": Required[str] content_hash: str - dependency_resolution: Union[str, CodeDependencyResolution] - entry_point: list[str] - runtime: str + dependency_resolution: Required[Union[str, CodeDependencyResolution]] + entry_point: Required[list[str]] + runtime: Required[str] class azure.ai.projects.types.CodeInterpreterTool(TypedDict, total=False): @@ -16888,13 +16818,13 @@ namespace azure.ai.projects.types key "container": Union[str, AutoCodeInterpreterToolParam] key "description": str key "name": str - key "type": Required[Literal[ToolType.CODE_INTERPRETER]] + key "tool_configs": dict[str, ToolConfig] allowed_callers: list[Union[str, CallableToolAllowedCaller]] container: Union[str, AutoCodeInterpreterToolParam] description: str name: str tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.CODE_INTERPRETER] + type: Required[Literal[ToolType.CODE_INTERPRETER]] class azure.ai.projects.types.CodeInterpreterToolboxTool(TypedDict, total=False): @@ -16902,83 +16832,68 @@ namespace azure.ai.projects.types key "container": Union[str, AutoCodeInterpreterToolParam] key "description": str key "name": str - key "type": Required[Literal[ToolboxToolType.CODE_INTERPRETER]] + key "tool_configs": dict[str, ToolConfig] allowed_callers: list[Union[str, CallableToolAllowedCaller]] container: Union[str, AutoCodeInterpreterToolParam] description: str name: str tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.CODE_INTERPRETER] + type: Required[Literal[ToolboxToolType.CODE_INTERPRETER]] class azure.ai.projects.types.ComparisonFilter(TypedDict, total=False): - key "key": Required[str] - key "type": Required[Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]] - key "value": Required[Union[str, float, bool, list[Union[str, float]]]] - key: str - type: Literal[eq, ne, gt, gte, lt, lte, in, nin] - value: Union[str, float, bool, list[Union[str, float]]] + key: Required[str] + type: Required[Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]] + value: Required[Union[str, float, bool, list[Union[str, float]]]] class azure.ai.projects.types.CompoundFilter(TypedDict, total=False): - key "filters": Required[list[Union[ComparisonFilter, Any]]] - key "type": Required[Literal["and", "or"]] - filters: list[Union[ComparisonFilter, Any]] - type: Literal[and, or] + filters: Required[list[Union[ComparisonFilter, Any]]] + type: Required[Literal["and", "or"]] class azure.ai.projects.types.ComputerTool(TypedDict, total=False): - key "type": Required[Literal[ToolType.COMPUTER]] - type: Literal[ToolType.COMPUTER] + type: Required[Literal[ToolType.COMPUTER]] class azure.ai.projects.types.ComputerUsePreviewTool(TypedDict, total=False): - key "display_height": Required[int] - key "display_width": Required[int] - key "environment": Required[Union[str, ComputerEnvironment]] - key "type": Required[Literal[ToolType.COMPUTER_USE_PREVIEW]] - display_height: int - display_width: int - environment: Union[str, ComputerEnvironment] - type: Literal[ToolType.COMPUTER_USE_PREVIEW] + display_height: Required[int] + display_width: Required[int] + environment: Required[Union[str, ComputerEnvironment]] + type: Required[Literal[ToolType.COMPUTER_USE_PREVIEW]] class azure.ai.projects.types.ContainerAutoParam(TypedDict, total=False): + key "file_ids": list[str] key "memory_limit": Optional[Union[str, ContainerMemoryLimit]] - key "network_policy": ForwardRef('ContainerNetworkPolicyParam', module='types') - key "type": Required[Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO]] + key "network_policy": ForwardRef('ContainerNetworkPolicyParam') + key "skills": list[ContainerSkill] file_ids: list[str] memory_limit: Union[str, ContainerMemoryLimit] network_policy: ContainerNetworkPolicyParam skills: list[ContainerSkill] - type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO] + type: Required[Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO]] class azure.ai.projects.types.ContainerConfiguration(TypedDict, total=False): - key "image": Required[str] - image: str + image: Required[str] class azure.ai.projects.types.ContainerNetworkPolicyAllowlistParam(TypedDict, total=False): - key "allowed_domains": Required[list[str]] - key "type": Required[Literal[ContainerNetworkPolicyParamType.ALLOWLIST]] - allowed_domains: list[str] + key "domain_secrets": list[ContainerNetworkPolicyDomainSecretParam] + allowed_domains: Required[list[str]] domain_secrets: list[ContainerNetworkPolicyDomainSecretParam] - type: Literal[ContainerNetworkPolicyParamType.ALLOWLIST] + type: Required[Literal[ContainerNetworkPolicyParamType.ALLOWLIST]] class azure.ai.projects.types.ContainerNetworkPolicyDisabledParam(TypedDict, total=False): - key "type": Required[Literal[ContainerNetworkPolicyParamType.DISABLED]] - type: Literal[ContainerNetworkPolicyParamType.DISABLED] + type: Required[Literal[ContainerNetworkPolicyParamType.DISABLED]] class azure.ai.projects.types.ContainerNetworkPolicyDomainSecretParam(TypedDict, total=False): - key "domain": Required[str] - key "name": Required[str] - key "value": Required[str] - domain: str - name: str - value: str + domain: Required[str] + name: Required[str] + value: Required[str] class azure.ai.projects.types.ContainerNetworkPolicyParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -16992,85 +16907,72 @@ namespace azure.ai.projects.types class azure.ai.projects.types.ContinuousEvaluationRuleAction(TypedDict, total=False): - key "evalId": Required[str] key "maxHourlyRuns": int key "samplingRate": float - key "type": Required[Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION]] - evalId: str + evalId: Required[str] maxHourlyRuns: int samplingRate: float - type: Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION] + type: Required[Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION]] class azure.ai.projects.types.CosmosDBIndex(TypedDict, total=False): - key "connectionName": Required[str] - key "containerName": Required[str] - key "databaseName": Required[str] key "description": str - key "embeddingConfiguration": Required[EmbeddingConfiguration] - key "fieldMapping": Required[FieldMapping] key "id": str - key "name": Required[str] - key "type": Required[Literal[IndexType.COSMOS_DB]] - key "version": Required[str] - connectionName: str - containerName: str - databaseName: str + key "tags": dict[str, str] + connectionName: Required[str] + containerName: Required[str] + databaseName: Required[str] description: str - embeddingConfiguration: EmbeddingConfiguration - fieldMapping: FieldMapping + embeddingConfiguration: Required[EmbeddingConfiguration] + fieldMapping: Required[FieldMapping] id: str - name: str + name: Required[str] tags: dict[str, str] - type: Literal[IndexType.COSMOS_DB] - version: str + type: Required[Literal[IndexType.COSMOS_DB]] + version: Required[str] class azure.ai.projects.types.CreateAgentVersionFromManifestRequest(TypedDict, total=False): key "description": str - key "manifest_id": Required[str] - key "parameter_values": Required[dict[str, Any]] + key "metadata": dict[str, str] description: str - manifest_id: str + manifest_id: Required[str] metadata: dict[str, str] - parameter_values: dict[str, Any] + parameter_values: Required[dict[str, Any]] class azure.ai.projects.types.CreateAgentVersionRequest(TypedDict, total=False): - key "blueprint_reference": ForwardRef('AgentBlueprintReference', module='types') - key "definition": Required[AgentDefinition] + key "blueprint_reference": ForwardRef('AgentBlueprintReference') key "description": str key "draft": bool + key "metadata": dict[str, str] blueprint_reference: AgentBlueprintReference - definition: AgentDefinition + definition: Required[AgentDefinition] description: str draft: bool metadata: dict[str, str] class azure.ai.projects.types.CreateMemoryRequest(TypedDict, total=False): - key "content": Required[str] - key "kind": Required[Union[str, MemoryItemKind]] - key "scope": Required[str] - content: str - kind: Union[str, MemoryItemKind] - scope: str + content: Required[str] + kind: Required[Union[str, MemoryItemKind]] + scope: Required[str] class azure.ai.projects.types.CreateMemoryStoreRequest(TypedDict, total=False): - key "definition": Required[MemoryStoreDefinition] key "description": str - key "name": Required[str] - definition: MemoryStoreDefinition + key "metadata": dict[str, str] + definition: Required[MemoryStoreDefinition] description: str metadata: dict[str, str] - name: str + name: Required[str] class azure.ai.projects.types.CreateOrUpdateRoutineRequest(TypedDict, total=False): - key "action": ForwardRef('RoutineAction', module='types') + key "action": ForwardRef('RoutineAction') key "description": str key "enabled": bool + key "triggers": dict[str, RoutineTrigger] action: RoutineAction description: str enabled: bool @@ -17079,34 +16981,33 @@ namespace azure.ai.projects.types class azure.ai.projects.types.CreateSessionRequest(TypedDict, total=False): key "agent_session_id": str - key "version_indicator": Required[VersionIndicator] agent_session_id: str - version_indicator: VersionIndicator + version_indicator: Required[VersionIndicator] class azure.ai.projects.types.CreateSkillVersionFromFilesBody(TypedDict, total=False): key "default": bool - key "files": Required[list[Union[str, bytes, IO[str], IO[bytes], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]]], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]], Optional[str]]]]] default: bool - files: list[FileType] + files: Required[list[Union[str, bytes, IO[str], IO[bytes], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]]], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]], Optional[str]]]]] class azure.ai.projects.types.CreateSkillVersionRequest(TypedDict, total=False): key "default": bool - key "inline_content": ForwardRef('SkillInlineContent', module='types') + key "inline_content": ForwardRef('SkillInlineContent') default: bool inline_content: SkillInlineContent class azure.ai.projects.types.CreateToolboxVersionRequest(TypedDict, total=False): key "description": str - key "policies": ForwardRef('ToolboxPolicies', module='types') - key "tools": Required[list[ToolboxTool]] + key "metadata": dict[str, str] + key "policies": ForwardRef('ToolboxPolicies') + key "skills": list[ToolboxSkill] description: str metadata: dict[str, str] policies: ToolboxPolicies skills: list[ToolboxSkill] - tools: list[ToolboxTool] + tools: Required[list[ToolboxTool]] class azure.ai.projects.types.CreateTranscriptionResponseJsonUsageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -17116,55 +17017,44 @@ namespace azure.ai.projects.types class azure.ai.projects.types.CronTrigger(TypedDict, total=False): key "endTime": str - key "expression": Required[str] key "startTime": str key "timeZone": str - key "type": Required[Literal[TriggerType.CRON]] endTime: str - expression: str + expression: Required[str] startTime: str timeZone: str - type: Literal[TriggerType.CRON] + type: Required[Literal[TriggerType.CRON]] class azure.ai.projects.types.CustomGrammarFormatParam(TypedDict, total=False): - key "definition": Required[str] - key "syntax": Required[Union[str, GrammarSyntax1]] - key "type": Required[Literal[CustomToolParamFormatType.GRAMMAR]] - definition: str - syntax: Union[str, GrammarSyntax1] - type: Literal[CustomToolParamFormatType.GRAMMAR] + definition: Required[str] + syntax: Required[Union[str, GrammarSyntax1]] + type: Required[Literal[CustomToolParamFormatType.GRAMMAR]] class azure.ai.projects.types.CustomRoutineTrigger(TypedDict, total=False): key "event_name": str - key "parameters": Required[dict[str, Any]] - key "provider": Required[str] - key "type": Required[Literal[RoutineTriggerType.CUSTOM]] event_name: str - parameters: dict[str, Any] - provider: str - type: Literal[RoutineTriggerType.CUSTOM] + parameters: Required[dict[str, Any]] + provider: Required[str] + type: Required[Literal[RoutineTriggerType.CUSTOM]] class azure.ai.projects.types.CustomTextFormatParam(TypedDict, total=False): - key "type": Required[Literal[CustomToolParamFormatType.TEXT]] - type: Literal[CustomToolParamFormatType.TEXT] + type: Required[Literal[CustomToolParamFormatType.TEXT]] class azure.ai.projects.types.CustomToolParam(TypedDict, total=False): key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] key "defer_loading": bool key "description": str - key "format": ForwardRef('CustomToolParamFormat', module='types') - key "name": Required[str] - key "type": Required[Literal[ToolType.CUSTOM]] + key "format": ForwardRef('CustomToolParamFormat') allowed_callers: list[Union[str, CallableToolAllowedCaller]] defer_loading: bool description: str format: CustomToolParamFormat - name: str - type: Literal[ToolType.CUSTOM] + name: Required[str] + type: Required[Literal[ToolType.CUSTOM]] class azure.ai.projects.types.CustomToolParamFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -17173,45 +17063,37 @@ namespace azure.ai.projects.types class azure.ai.projects.types.DailyRecurrenceSchedule(TypedDict, total=False): - key "hours": Required[list[int]] - key "type": Required[Literal[RecurrenceType.DAILY]] - hours: list[int] - type: Literal[RecurrenceType.DAILY] + hours: Required[list[int]] + type: Required[Literal[RecurrenceType.DAILY]] class azure.ai.projects.types.DataGenerationJob(TypedDict, total=False): - key "created_at": Required[int] - key "error": ForwardRef('ApiError', module='types') + key "error": ForwardRef('ApiError') key "finished_at": int - key "id": Required[str] - key "inputs": ForwardRef('DataGenerationJobInputs', module='types') - key "result": ForwardRef('DataGenerationJobResult', module='types') - key "status": Required[Union[str, JobStatus]] - created_at: int + key "inputs": ForwardRef('DataGenerationJobInputs') + key "result": ForwardRef('DataGenerationJobResult') + created_at: Required[int] error: ApiError finished_at: int - id: str + id: Required[str] inputs: DataGenerationJobInputs result: DataGenerationJobResult - status: Union[str, JobStatus] + status: Required[Union[str, JobStatus]] class azure.ai.projects.types.DataGenerationJobInputs(TypedDict, total=False): - key "name": Required[str] - key "options": Required[DataGenerationJobOptions] - key "output_options": ForwardRef('DataGenerationJobOutputOptions', module='types') - key "scenario": Required[Union[str, DataGenerationJobScenario]] - key "sources": Required[list[DataGenerationJobSource]] - name: str - options: DataGenerationJobOptions + key "output_options": ForwardRef('DataGenerationJobOutputOptions') + name: Required[str] + options: Required[DataGenerationJobOptions] output_options: DataGenerationJobOutputOptions - scenario: Union[str, DataGenerationJobScenario] - sources: list[DataGenerationJobSource] + scenario: Required[Union[str, DataGenerationJobScenario]] + sources: Required[list[DataGenerationJobSource]] class azure.ai.projects.types.DataGenerationJobOutputOptions(TypedDict, total=False): key "description": str key "name": str + key "tags": dict[str, str] description: str name: str tags: dict[str, str] @@ -17223,9 +17105,9 @@ namespace azure.ai.projects.types class azure.ai.projects.types.DataGenerationJobResult(TypedDict, total=False): - key "generated_samples": Required[int] - key "token_usage": ForwardRef('DataGenerationTokenUsage', module='types') - generated_samples: int + key "outputs": list[DataGenerationJobOutput] + key "token_usage": ForwardRef('DataGenerationTokenUsage') + generated_samples: Required[int] outputs: list[DataGenerationJobOutput] token_usage: DataGenerationTokenUsage @@ -17239,55 +17121,47 @@ namespace azure.ai.projects.types class azure.ai.projects.types.DataGenerationJobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): SIMPLE_QNA = "simple_qna" - TASK_GENERATION = "task_generation" + SIMULATION_SEED = "simulation_seed" TOOL_USE = "tool_use" TRACES = "traces" class azure.ai.projects.types.DataGenerationModelOptions(TypedDict, total=False): - key "model": Required[str] - model: str + model: Required[str] class azure.ai.projects.types.DataGenerationTokenUsage(TypedDict, total=False): - key "completion_tokens": Required[int] - key "prompt_tokens": Required[int] - key "total_tokens": Required[int] - completion_tokens: int - prompt_tokens: int - total_tokens: int + completion_tokens: Required[int] + prompt_tokens: Required[int] + total_tokens: Required[int] class azure.ai.projects.types.DatasetDataGenerationJobOutput(TypedDict, total=False): key "description": str key "id": str key "name": str - key "type": Required[Literal[DataGenerationJobOutputType.DATASET]] + key "tags": dict[str, str] key "version": str description: str id: str name: str tags: dict[str, str] - type: Literal[DataGenerationJobOutputType.DATASET] + type: Required[Literal[DataGenerationJobOutputType.DATASET]] version: str class azure.ai.projects.types.DatasetEvaluatorGenerationJobSource(TypedDict, total=False): key "description": str - key "name": Required[str] - key "type": Required[Literal[EvaluatorGenerationJobSourceType.DATASET]] key "version": str description: str - name: str - type: Literal[EvaluatorGenerationJobSourceType.DATASET] + name: Required[str] + type: Required[Literal[EvaluatorGenerationJobSourceType.DATASET]] version: str class azure.ai.projects.types.DatasetReference(TypedDict, total=False): - key "name": Required[str] - key "version": Required[str] - name: str - version: str + name: Required[str] + version: Required[str] class azure.ai.projects.types.DatasetType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -17296,149 +17170,108 @@ namespace azure.ai.projects.types class azure.ai.projects.types.DeleteScopeRequest(TypedDict, total=False): - key "scope": Required[str] - scope: str + scope: Required[str] class azure.ai.projects.types.Dimension(TypedDict, total=False): key "always_applicable": bool - key "description": Required[str] - key "id": Required[str] - key "weight": Required[int] always_applicable: bool - description: str - id: str - weight: int + description: Required[str] + id: Required[str] + weight: Required[int] class azure.ai.projects.types.DispatchRoutineAsyncRequest(TypedDict, total=False): - key "payload": ForwardRef('RoutineDispatchPayload', module='types') + key "payload": ForwardRef('RoutineDispatchPayload') payload: RoutineDispatchPayload class azure.ai.projects.types.EmbeddingConfiguration(TypedDict, total=False): - key "embeddingField": Required[str] - key "modelDeploymentName": Required[str] - embeddingField: str - modelDeploymentName: str + embeddingField: Required[str] + modelDeploymentName: Required[str] class azure.ai.projects.types.EmptyModelParam(TypedDict, total=False): class azure.ai.projects.types.EndpointBasedEvaluatorDefinition(TypedDict, total=False): - key "connection_name": Required[str] - key "type": Required[Literal[EvaluatorDefinitionType.ENDPOINT]] - connection_name: str + key "data_schema": dict[str, Any] + key "init_parameters": dict[str, Any] + key "metrics": dict[str, EvaluatorMetric] + connection_name: Required[str] data_schema: dict[str, Any] init_parameters: dict[str, Any] metrics: dict[str, EvaluatorMetric] - type: Literal[EvaluatorDefinitionType.ENDPOINT] + type: Required[Literal[EvaluatorDefinitionType.ENDPOINT]] class azure.ai.projects.types.EntraAuthorizationScheme(TypedDict, total=False): - key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.ENTRA]] - type: Literal[AgentEndpointAuthorizationSchemeType.ENTRA] + type: Required[Literal[AgentEndpointAuthorizationSchemeType.ENTRA]] class azure.ai.projects.types.EvalResult(TypedDict, total=False): - key "name": Required[str] - key "passed": Required[bool] - key "score": Required[float] - key "type": Required[str] - name: str - passed: bool - score: float - type: str + name: Required[str] + passed: Required[bool] + score: Required[float] + type: Required[str] class azure.ai.projects.types.EvalRunResultCompareItem(TypedDict, total=False): - key "deltaEstimate": Required[float] - key "pValue": Required[float] - key "treatmentEffect": Required[Union[str, TreatmentEffectType]] - key "treatmentRunId": Required[str] - key "treatmentRunSummary": Required[EvalRunResultSummary] - deltaEstimate: float - pValue: float - treatmentEffect: Union[str, TreatmentEffectType] - treatmentRunId: str - treatmentRunSummary: EvalRunResultSummary + deltaEstimate: Required[float] + pValue: Required[float] + treatmentEffect: Required[Union[str, TreatmentEffectType]] + treatmentRunId: Required[str] + treatmentRunSummary: Required[EvalRunResultSummary] class azure.ai.projects.types.EvalRunResultComparison(TypedDict, total=False): - key "baselineRunSummary": Required[EvalRunResultSummary] - key "compareItems": Required[list[EvalRunResultCompareItem]] - key "evaluator": Required[str] - key "metric": Required[str] - key "testingCriteria": Required[str] - baselineRunSummary: EvalRunResultSummary - compareItems: list[EvalRunResultCompareItem] - evaluator: str - metric: str - testingCriteria: str + baselineRunSummary: Required[EvalRunResultSummary] + compareItems: Required[list[EvalRunResultCompareItem]] + evaluator: Required[str] + metric: Required[str] + testingCriteria: Required[str] class azure.ai.projects.types.EvalRunResultSummary(TypedDict, total=False): - key "average": Required[float] - key "runId": Required[str] - key "sampleCount": Required[int] - key "standardDeviation": Required[float] - average: float - runId: str - sampleCount: int - standardDeviation: float + average: Required[float] + runId: Required[str] + sampleCount: Required[int] + standardDeviation: Required[float] class azure.ai.projects.types.EvaluationComparisonInsightRequest(TypedDict, total=False): - key "baselineRunId": Required[str] - key "evalId": Required[str] - key "treatmentRunIds": Required[list[str]] - key "type": Required[Literal[InsightType.EVALUATION_COMPARISON]] - baselineRunId: str - evalId: str - treatmentRunIds: list[str] - type: Literal[InsightType.EVALUATION_COMPARISON] + baselineRunId: Required[str] + evalId: Required[str] + treatmentRunIds: Required[list[str]] + type: Required[Literal[InsightType.EVALUATION_COMPARISON]] class azure.ai.projects.types.EvaluationComparisonInsightResult(TypedDict, total=False): - key "comparisons": Required[list[EvalRunResultComparison]] - key "method": Required[str] - key "type": Required[Literal[InsightType.EVALUATION_COMPARISON]] - comparisons: list[EvalRunResultComparison] - method: str - type: Literal[InsightType.EVALUATION_COMPARISON] + comparisons: Required[list[EvalRunResultComparison]] + method: Required[str] + type: Required[Literal[InsightType.EVALUATION_COMPARISON]] class azure.ai.projects.types.EvaluationResultSample(TypedDict, total=False): - key "correlationInfo": Required[dict[str, Any]] - key "evaluationResult": Required[EvalResult] - key "features": Required[dict[str, Any]] - key "id": Required[str] - key "type": Required[Literal[SampleType.EVALUATION_RESULT_SAMPLE]] - correlationInfo: dict[str, Any] - evaluationResult: EvalResult - features: dict[str, Any] - id: str - type: Literal[SampleType.EVALUATION_RESULT_SAMPLE] + correlationInfo: Required[dict[str, Any]] + evaluationResult: Required[EvalResult] + features: Required[dict[str, Any]] + id: Required[str] + type: Required[Literal[SampleType.EVALUATION_RESULT_SAMPLE]] class azure.ai.projects.types.EvaluationRule(TypedDict, total=False): - key "action": Required[EvaluationRuleAction] key "description": str key "displayName": str - key "enabled": Required[bool] - key "eventType": Required[Union[str, EvaluationRuleEventType]] - key "filter": ForwardRef('EvaluationRuleFilter', module='types') - key "id": Required[str] - key "systemData": Required[dict[str, str]] - action: EvaluationRuleAction + key "filter": ForwardRef('EvaluationRuleFilter') + action: Required[EvaluationRuleAction] description: str displayName: str - enabled: bool - eventType: Union[str, EvaluationRuleEventType] + enabled: Required[bool] + eventType: Required[Union[str, EvaluationRuleEventType]] filter: EvaluationRuleFilter - id: str - systemData: dict[str, str] + id: Required[str] + systemData: Required[dict[str, str]] class azure.ai.projects.types.EvaluationRuleActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -17447,61 +17280,50 @@ namespace azure.ai.projects.types class azure.ai.projects.types.EvaluationRuleFilter(TypedDict, total=False): - key "agentName": Required[str] - agentName: str + agentName: Required[str] class azure.ai.projects.types.EvaluationRunClusterInsightRequest(TypedDict, total=False): - key "evalId": Required[str] - key "modelConfiguration": ForwardRef('InsightModelConfiguration', module='types') - key "runIds": Required[list[str]] - key "type": Required[Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT]] - evalId: str + key "modelConfiguration": ForwardRef('InsightModelConfiguration') + evalId: Required[str] modelConfiguration: InsightModelConfiguration - runIds: list[str] - type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] + runIds: Required[list[str]] + type: Required[Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT]] class azure.ai.projects.types.EvaluationRunClusterInsightResult(TypedDict, total=False): - key "clusterInsight": Required[ClusterInsightResult] - key "type": Required[Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT]] - clusterInsight: ClusterInsightResult - type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] + clusterInsight: Required[ClusterInsightResult] + type: Required[Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT]] class azure.ai.projects.types.EvaluationScheduleTask(TypedDict, total=False): - key "evalId": Required[str] - key "evalRun": Required[dict[str, Any]] - key "type": Required[Literal[ScheduleTaskType.EVALUATION]] + key "configuration": dict[str, str] configuration: dict[str, str] - evalId: str - evalRun: dict[str, Any] - type: Literal[ScheduleTaskType.EVALUATION] + evalId: Required[str] + evalRun: Required[dict[str, Any]] + type: Required[Literal[ScheduleTaskType.EVALUATION]] class azure.ai.projects.types.EvaluationTaxonomy(TypedDict, total=False): key "description": str key "id": str - key "name": Required[str] - key "taxonomyInput": Required[EvaluationTaxonomyInput] - key "version": Required[str] + key "properties": dict[str, str] + key "tags": dict[str, str] + key "taxonomyCategories": list[TaxonomyCategory] description: str id: str - name: str + name: Required[str] properties: dict[str, str] tags: dict[str, str] taxonomyCategories: list[TaxonomyCategory] - taxonomyInput: EvaluationTaxonomyInput - version: str + taxonomyInput: Required[EvaluationTaxonomyInput] + version: Required[str] class azure.ai.projects.types.EvaluationTaxonomyInput(TypedDict, total=False): - key "riskCategories": Required[list[Union[str, RiskCategory]]] - key "target": Required[EvaluationTarget] - key "type": Required[Literal[EvaluationTaxonomyInputType.AGENT]] - riskCategories: list[Union[str, RiskCategory]] - target: EvaluationTarget - type: Literal[EvaluationTaxonomyInputType.AGENT] + riskCategories: Required[list[Union[str, RiskCategory]]] + target: Required[EvaluationTarget] + type: Required[Literal[EvaluationTaxonomyInputType.AGENT]] class azure.ai.projects.types.EvaluationTaxonomyInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -17510,8 +17332,7 @@ namespace azure.ai.projects.types class azure.ai.projects.types.EvaluatorCredentialRequest(TypedDict, total=False): - key "blob_uri": Required[str] - blob_uri: str + blob_uri: Required[str] class azure.ai.projects.types.EvaluatorDefinitionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -17525,42 +17346,35 @@ namespace azure.ai.projects.types class azure.ai.projects.types.EvaluatorGenerationArtifacts(TypedDict, total=False): - key "dataset": Required[DatasetReference] - key "kinds": Required[list[str]] - dataset: DatasetReference - kinds: list[str] + dataset: Required[DatasetReference] + kinds: Required[list[str]] class azure.ai.projects.types.EvaluatorGenerationInputs(TypedDict, total=False): key "evaluator_description": str key "evaluator_display_name": str - key "evaluator_name": Required[str] - key "model": Required[str] - key "sources": Required[list[EvaluatorGenerationJobSource]] evaluator_description: str evaluator_display_name: str - evaluator_name: str - model: str - sources: list[EvaluatorGenerationJobSource] + evaluator_name: Required[str] + model: Required[str] + sources: Required[list[EvaluatorGenerationJobSource]] class azure.ai.projects.types.EvaluatorGenerationJob(TypedDict, total=False): - key "created_at": Required[int] - key "error": ForwardRef('ApiError', module='types') + key "error": ForwardRef('ApiError') key "finished_at": int - key "id": Required[str] - key "inputs": ForwardRef('EvaluatorGenerationInputs', module='types') - key "result": ForwardRef('EvaluatorVersion', module='types') - key "status": Required[Union[str, JobStatus]] - key "usage": ForwardRef('EvaluatorGenerationTokenUsage', module='types') - created_at: int + key "input_quality_warnings": list[RubricGenerationInputQualityWarning] + key "inputs": ForwardRef('EvaluatorGenerationInputs') + key "result": ForwardRef('EvaluatorVersion') + key "usage": ForwardRef('EvaluatorGenerationTokenUsage') + created_at: Required[int] error: ApiError finished_at: int - id: str + id: Required[str] input_quality_warnings: list[RubricGenerationInputQualityWarning] inputs: EvaluatorGenerationInputs result: EvaluatorVersion - status: Union[str, JobStatus] + status: Required[Union[str, JobStatus]] usage: EvaluatorGenerationTokenUsage @@ -17572,12 +17386,9 @@ namespace azure.ai.projects.types class azure.ai.projects.types.EvaluatorGenerationTokenUsage(TypedDict, total=False): - key "input_tokens": Required[int] - key "output_tokens": Required[int] - key "total_tokens": Required[int] - input_tokens: int - output_tokens: int - total_tokens: int + input_tokens: Required[int] + output_tokens: Required[int] + total_tokens: Required[int] class azure.ai.projects.types.EvaluatorMetric(TypedDict, total=False): @@ -17596,88 +17407,82 @@ namespace azure.ai.projects.types class azure.ai.projects.types.EvaluatorVersion(TypedDict, total=False): - key "categories": Required[list[Union[str, EvaluatorCategory]]] - key "created_at": Required[str] - key "created_by": Required[str] - key "definition": Required[EvaluatorDefinition] key "description": str key "display_name": str - key "evaluator_type": Required[Union[str, EvaluatorType]] - key "generation_artifacts": ForwardRef('EvaluatorGenerationArtifacts', module='types') + key "generation_artifacts": ForwardRef('EvaluatorGenerationArtifacts') key "generation_job_id": str key "id": str - key "modified_at": Required[str] - key "name": Required[str] - key "version": Required[str] - categories: list[Union[str, EvaluatorCategory]] - created_at: str - created_by: str - definition: EvaluatorDefinition + key "metadata": dict[str, str] + key "supported_evaluation_levels": list[Union[str, EvaluationLevel]] + key "tags": dict[str, str] + key "warnings": list[Union[str, GenerationWarningType]] + categories: Required[list[Union[str, EvaluatorCategory]]] + created_at: Required[str] + created_by: Required[str] + definition: Required[EvaluatorDefinition] description: str display_name: str - evaluator_type: Union[str, EvaluatorType] + evaluator_type: Required[Union[str, EvaluatorType]] generation_artifacts: EvaluatorGenerationArtifacts generation_job_id: str id: str metadata: dict[str, str] - modified_at: str - name: str + modified_at: Required[str] + name: Required[str] supported_evaluation_levels: list[Union[str, EvaluationLevel]] tags: dict[str, str] - version: str + version: Required[str] warnings: list[Union[str, GenerationWarningType]] class azure.ai.projects.types.ExternalAgentDefinition(TypedDict, total=False): - key "kind": Required[Literal[AgentKind.EXTERNAL]] key "otel_agent_id": str - key "rai_config": ForwardRef('RaiConfig', module='types') - kind: Literal[AgentKind.EXTERNAL] + key "rai_config": ForwardRef('RaiConfig') + kind: Required[Literal[AgentKind.EXTERNAL]] otel_agent_id: str rai_config: RaiConfig class azure.ai.projects.types.FabricDataAgentToolParameters(TypedDict, total=False): + key "project_connections": list[ToolProjectConnection] project_connections: list[ToolProjectConnection] class azure.ai.projects.types.FabricIQPreviewTool(TypedDict, total=False): - key "project_connection_id": Required[str] key "require_approval": Optional[Union[MCPToolRequireApproval, str]] key "server_label": str key "server_url": str - key "type": Required[Literal[ToolType.FABRIC_IQ_PREVIEW]] - project_connection_id: str + project_connection_id: Required[str] require_approval: Union[MCPToolRequireApproval, str] server_label: str server_url: str - type: Literal[ToolType.FABRIC_IQ_PREVIEW] + type: Required[Literal[ToolType.FABRIC_IQ_PREVIEW]] class azure.ai.projects.types.FabricIQPreviewToolboxTool(TypedDict, total=False): key "description": str key "name": str - key "project_connection_id": Required[str] key "require_approval": Optional[Union[MCPToolRequireApproval, str]] key "server_label": str key "server_url": str - key "type": Required[Literal[ToolboxToolType.FABRIC_IQ_PREVIEW]] + key "tool_configs": dict[str, ToolConfig] description: str name: str - project_connection_id: str + project_connection_id: Required[str] require_approval: Union[MCPToolRequireApproval, str] server_label: str server_url: str tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.FABRIC_IQ_PREVIEW] + type: Required[Literal[ToolboxToolType.FABRIC_IQ_PREVIEW]] class azure.ai.projects.types.FieldMapping(TypedDict, total=False): - key "contentFields": Required[list[str]] key "filepathField": str + key "metadataFields": list[str] key "titleField": str key "urlField": str - contentFields: list[str] + key "vectorFields": list[str] + contentFields: Required[list[str]] filepathField: str metadataFields: list[str] titleField: str @@ -17686,41 +17491,33 @@ namespace azure.ai.projects.types class azure.ai.projects.types.FileDataGenerationJobOutput(TypedDict, total=False): - key "filename": Required[str] - key "id": Required[str] - key "type": Required[Literal[DataGenerationJobOutputType.FILE]] - filename: str - id: str - type: Literal[DataGenerationJobOutputType.FILE] + filename: Required[str] + id: Required[str] + type: Required[Literal[DataGenerationJobOutputType.FILE]] class azure.ai.projects.types.FileDataGenerationJobSource(TypedDict, total=False): key "description": str - key "id": Required[str] - key "type": Required[Literal[DataGenerationJobSourceType.FILE]] description: str - id: str - type: Literal[DataGenerationJobSourceType.FILE] + id: Required[str] + type: Required[Literal[DataGenerationJobSourceType.FILE]] class azure.ai.projects.types.FileDatasetVersion(TypedDict, total=False): key "connectionName": str - key "dataUri": Required[str] key "description": str key "id": str key "isReference": bool - key "name": Required[str] - key "type": Required[Literal[DatasetType.URI_FILE]] - key "version": Required[str] + key "tags": dict[str, str] connectionName: str - dataUri: str + dataUri: Required[str] description: str id: str isReference: bool - name: str + name: Required[str] tags: dict[str, str] - type: Literal[DatasetType.URI_FILE] - version: str + type: Required[Literal[DatasetType.URI_FILE]] + version: Required[str] class azure.ai.projects.types.FileSearchTool(TypedDict, total=False): @@ -17728,17 +17525,16 @@ namespace azure.ai.projects.types key "filters": Optional[Filters] key "max_num_results": int key "name": str - key "ranking_options": ForwardRef('RankingOptions', module='types') - key "type": Required[Literal[ToolType.FILE_SEARCH]] - key "vector_store_ids": Required[list[str]] + key "ranking_options": ForwardRef('RankingOptions') + key "tool_configs": dict[str, ToolConfig] description: str filters: Filters max_num_results: int name: str ranking_options: RankingOptions tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.FILE_SEARCH] - vector_store_ids: list[str] + type: Required[Literal[ToolType.FILE_SEARCH]] + vector_store_ids: Required[list[str]] class azure.ai.projects.types.FileSearchToolboxTool(TypedDict, total=False): @@ -17746,45 +17542,40 @@ namespace azure.ai.projects.types key "filters": Optional[Filters] key "max_num_results": int key "name": str - key "ranking_options": ForwardRef('RankingOptions', module='types') - key "type": Required[Literal[ToolboxToolType.FILE_SEARCH]] + key "ranking_options": ForwardRef('RankingOptions') + key "tool_configs": dict[str, ToolConfig] + key "vector_store_ids": list[str] description: str filters: Filters max_num_results: int name: str ranking_options: RankingOptions tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.FILE_SEARCH] + type: Required[Literal[ToolboxToolType.FILE_SEARCH]] vector_store_ids: list[str] class azure.ai.projects.types.FixedRatioVersionSelectionRule(TypedDict, total=False): - key "agent_version": Required[str] - key "traffic_percentage": Required[int] - key "type": Required[Literal[VersionSelectorType.FIXED_RATIO]] - agent_version: str - traffic_percentage: int - type: Literal[VersionSelectorType.FIXED_RATIO] + agent_version: Required[str] + traffic_percentage: Required[int] + type: Required[Literal[VersionSelectorType.FIXED_RATIO]] class azure.ai.projects.types.FolderDatasetVersion(TypedDict, total=False): key "connectionName": str - key "dataUri": Required[str] key "description": str key "id": str key "isReference": bool - key "name": Required[str] - key "type": Required[Literal[DatasetType.URI_FOLDER]] - key "version": Required[str] + key "tags": dict[str, str] connectionName: str - dataUri: str + dataUri: Required[str] description: str id: str isReference: bool - name: str + name: Required[str] tags: dict[str, str] - type: Literal[DatasetType.URI_FOLDER] - version: str + type: Required[Literal[DatasetType.URI_FOLDER]] + version: Required[str] class azure.ai.projects.types.FoundryModelWarning(TypedDict, total=False): @@ -17799,26 +17590,24 @@ namespace azure.ai.projects.types key "description": str key "environment": Optional[FunctionShellToolParamEnvironment] key "name": str - key "type": Required[Literal[ToolType.SHELL]] + key "tool_configs": dict[str, ToolConfig] allowed_callers: list[Union[str, CallableToolAllowedCaller]] description: str environment: FunctionShellToolParamEnvironment name: str tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.SHELL] + type: Required[Literal[ToolType.SHELL]] class azure.ai.projects.types.FunctionShellToolParamEnvironmentContainerReferenceParam(TypedDict, total=False): - key "container_id": Required[str] - key "type": Required[Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE]] - container_id: str - type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE] + container_id: Required[str] + type: Required[Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE]] class azure.ai.projects.types.FunctionShellToolParamEnvironmentLocalEnvironmentParam(TypedDict, total=False): - key "type": Required[Literal[FunctionShellToolParamEnvironmentType.LOCAL]] + key "skills": list[LocalSkillParam] skills: list[LocalSkillParam] - type: Literal[FunctionShellToolParamEnvironmentType.LOCAL] + type: Required[Literal[FunctionShellToolParamEnvironmentType.LOCAL]] class azure.ai.projects.types.FunctionShellToolParamEnvironmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -17831,105 +17620,83 @@ namespace azure.ai.projects.types key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] key "defer_loading": bool key "description": Optional[str] - key "name": Required[str] key "output_schema": Optional[dict[str, Any]] - key "parameters": Required[Optional[dict[str, Any]]] - key "strict": Required[Optional[bool]] - key "type": Required[Literal[ToolType.FUNCTION]] allowed_callers: list[Union[str, CallableToolAllowedCaller]] defer_loading: bool description: str - name: str + name: Required[str] output_schema: dict[str, Any] - parameters: dict[str, Any] - strict: bool - type: Literal[ToolType.FUNCTION] + parameters: Required[Optional[dict[str, Any]]] + strict: Required[Optional[bool]] + type: Required[Literal[ToolType.FUNCTION]] class azure.ai.projects.types.FunctionToolParam(TypedDict, total=False): key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] key "defer_loading": bool key "description": Optional[str] - key "name": Required[str] key "output_schema": Optional[dict[str, Any]] key "parameters": Optional[EmptyModelParam] key "strict": Optional[bool] - key "type": Required[Literal["function"]] allowed_callers: list[Union[str, CallableToolAllowedCaller]] defer_loading: bool description: str - name: str + name: Required[str] output_schema: dict[str, Any] parameters: EmptyModelParam strict: bool - type: Literal[function] + type: Required[Literal["function"]] class azure.ai.projects.types.GenerateAgentRequest(TypedDict, total=False): - key "kind": Required[Union[str, AgentKind]] - kind: Union[str, AgentKind] + kind: Required[Union[str, AgentKind]] class azure.ai.projects.types.GitHubIssueRoutineTrigger(TypedDict, total=False): - key "connection_id": Required[str] - key "issue_event": Required[Union[str, GitHubIssueEvent]] - key "owner": Required[str] - key "repository": Required[str] - key "type": Required[Literal[RoutineTriggerType.GITHUB_ISSUE]] - connection_id: str - issue_event: Union[str, GitHubIssueEvent] - owner: str - repository: str - type: Literal[RoutineTriggerType.GITHUB_ISSUE] + connection_id: Required[str] + issue_event: Required[Union[str, GitHubIssueEvent]] + owner: Required[str] + repository: Required[str] + type: Required[Literal[RoutineTriggerType.GITHUB_ISSUE]] class azure.ai.projects.types.HeaderTelemetryEndpointAuth(TypedDict, total=False): - key "header_name": Required[str] - key "secret_id": Required[str] - key "secret_key": Required[str] - key "type": Required[Literal[TelemetryEndpointAuthType.HEADER]] - header_name: str - secret_id: str - secret_key: str - type: Literal[TelemetryEndpointAuthType.HEADER] + header_name: Required[str] + secret_id: Required[str] + secret_key: Required[str] + type: Required[Literal[TelemetryEndpointAuthType.HEADER]] class azure.ai.projects.types.HostedAgentDefinition(TypedDict, total=False): - key "code_configuration": ForwardRef('CodeConfiguration', module='types') - key "container_configuration": ForwardRef('ContainerConfiguration', module='types') - key "cpu": Required[str] - key "kind": Required[Literal[AgentKind.HOSTED]] - key "memory": Required[str] - key "rai_config": ForwardRef('RaiConfig', module='types') - key "telemetry_config": ForwardRef('TelemetryConfig', module='types') + key "code_configuration": ForwardRef('CodeConfiguration') + key "container_configuration": ForwardRef('ContainerConfiguration') + key "environment_variables": dict[str, str] + key "protocol_versions": list[ProtocolVersionRecord] + key "rai_config": ForwardRef('RaiConfig') + key "telemetry_config": ForwardRef('TelemetryConfig') code_configuration: CodeConfiguration container_configuration: ContainerConfiguration - cpu: str + cpu: Required[str] environment_variables: dict[str, str] - kind: Literal[AgentKind.HOSTED] - memory: str + kind: Required[Literal[AgentKind.HOSTED]] + memory: Required[str] protocol_versions: list[ProtocolVersionRecord] rai_config: RaiConfig telemetry_config: TelemetryConfig class azure.ai.projects.types.HourlyRecurrenceSchedule(TypedDict, total=False): - key "type": Required[Literal[RecurrenceType.HOURLY]] - type: Literal[RecurrenceType.HOURLY] + type: Required[Literal[RecurrenceType.HOURLY]] class azure.ai.projects.types.HumanEvaluationPreviewRuleAction(TypedDict, total=False): - key "templateId": Required[str] - key "type": Required[Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW]] - templateId: str - type: Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW] + templateId: Required[str] + type: Required[Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW]] class azure.ai.projects.types.HybridSearchOptions(TypedDict, total=False): - key "embedding_weight": Required[float] - key "text_weight": Required[float] - embedding_weight: float - text_weight: float + embedding_weight: Required[float] + text_weight: Required[float] class azure.ai.projects.types.ImageGenTool(TypedDict, total=False): @@ -17937,7 +17704,7 @@ namespace azure.ai.projects.types key "background": Literal["transparent", "opaque", "auto"] key "description": str key "input_fidelity": Optional[Union[str, InputFidelity]] - key "input_image_mask": ForwardRef('ImageGenToolInputImageMask', module='types') + key "input_image_mask": ForwardRef('ImageGenToolInputImageMask') key "model": Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], Literal["gpt-image-5"], str] key "moderation": Literal["auto", "low"] key "name": str @@ -17946,7 +17713,7 @@ namespace azure.ai.projects.types key "partial_images": int key "quality": Literal["low", "medium", "high", "auto"] key "size": Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str] - key "type": Required[Literal[ToolType.IMAGE_GENERATION]] + key "tool_configs": dict[str, ToolConfig] action: Union[str, ImageGenAction] background: Literal[transparent, opaque, auto] description: str @@ -17961,7 +17728,7 @@ namespace azure.ai.projects.types quality: Literal[low, medium, high, auto] size: Union[Literal[1024x1024], Literal[1024x1536], Literal[1536x1024], Literal[auto], str] tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.IMAGE_GENERATION] + type: Required[Literal[ToolType.IMAGE_GENERATION]] class azure.ai.projects.types.ImageGenToolInputImageMask(TypedDict, total=False): @@ -17978,94 +17745,66 @@ namespace azure.ai.projects.types class azure.ai.projects.types.InlineSkillParam(TypedDict, total=False): - key "description": Required[str] - key "name": Required[str] - key "source": Required[InlineSkillSourceParam] - key "type": Required[Literal[ContainerSkillType.INLINE]] - description: str - name: str - source: InlineSkillSourceParam - type: Literal[ContainerSkillType.INLINE] + description: Required[str] + name: Required[str] + source: Required[InlineSkillSourceParam] + type: Required[Literal[ContainerSkillType.INLINE]] class azure.ai.projects.types.InlineSkillSourceParam(TypedDict, total=False): - key "data": Required[str] - key "media_type": Required[Literal["application/zip"]] - key "type": Required[Literal["base64"]] - data: str - media_type: Literal[application/zip] - type: Literal[base64] + data: Required[str] + media_type: Required[Literal["application/zip"]] + type: Required[Literal["base64"]] class azure.ai.projects.types.Insight(TypedDict, total=False): - key "displayName": Required[str] - key "id": Required[str] - key "metadata": Required[InsightsMetadata] - key "request": Required[InsightRequest] - key "result": ForwardRef('InsightResult', module='types') - key "state": Required[Union[str, OperationState]] - displayName: str - id: str - metadata: InsightsMetadata - request: InsightRequest + key "result": ForwardRef('InsightResult') + displayName: Required[str] + id: Required[str] + metadata: Required[InsightsMetadata] + request: Required[InsightRequest] result: InsightResult - state: Union[str, OperationState] + state: Required[Union[str, OperationState]] class azure.ai.projects.types.InsightCluster(TypedDict, total=False): - key "description": Required[str] - key "id": Required[str] - key "label": Required[str] - key "suggestion": Required[str] - key "suggestionTitle": Required[str] - key "weight": Required[int] - description: str - id: str - label: str + key "samples": list[InsightSample] + key "subClusters": list[InsightCluster] + description: Required[str] + id: Required[str] + label: Required[str] samples: list[InsightSample] subClusters: list[InsightCluster] - suggestion: str - suggestionTitle: str - weight: int + suggestion: Required[str] + suggestionTitle: Required[str] + weight: Required[int] class azure.ai.projects.types.InsightModelConfiguration(TypedDict, total=False): - key "modelDeploymentName": Required[str] - modelDeploymentName: str + modelDeploymentName: Required[str] class azure.ai.projects.types.InsightSample(TypedDict, total=False): - key "correlationInfo": Required[dict[str, Any]] - key "evaluationResult": Required[EvalResult] - key "features": Required[dict[str, Any]] - key "id": Required[str] - key "type": Required[Literal[SampleType.EVALUATION_RESULT_SAMPLE]] - correlationInfo: dict[str, Any] - evaluationResult: EvalResult - features: dict[str, Any] - id: str - type: Literal[SampleType.EVALUATION_RESULT_SAMPLE] + correlationInfo: Required[dict[str, Any]] + evaluationResult: Required[EvalResult] + features: Required[dict[str, Any]] + id: Required[str] + type: Required[Literal[SampleType.EVALUATION_RESULT_SAMPLE]] class azure.ai.projects.types.InsightScheduleTask(TypedDict, total=False): - key "insight": Required[Insight] - key "type": Required[Literal[ScheduleTaskType.INSIGHT]] + key "configuration": dict[str, str] configuration: dict[str, str] - insight: Insight - type: Literal[ScheduleTaskType.INSIGHT] + insight: Required[Insight] + type: Required[Literal[ScheduleTaskType.INSIGHT]] class azure.ai.projects.types.InsightSummary(TypedDict, total=False): - key "method": Required[str] - key "sampleCount": Required[int] - key "uniqueClusterCount": Required[int] - key "uniqueSubclusterCount": Required[int] - key "usage": Required[ClusterTokenUsage] - method: str - sampleCount: int - uniqueClusterCount: int - uniqueSubclusterCount: int - usage: ClusterTokenUsage + method: Required[str] + sampleCount: Required[int] + uniqueClusterCount: Required[int] + uniqueSubclusterCount: Required[int] + usage: Required[ClusterTokenUsage] class azure.ai.projects.types.InsightType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -18076,9 +17815,8 @@ namespace azure.ai.projects.types class azure.ai.projects.types.InsightsMetadata(TypedDict, total=False): key "completedAt": str - key "createdAt": Required[str] completedAt: str - createdAt: str + createdAt: Required[str] class azure.ai.projects.types.InvocationsProtocolConfiguration(TypedDict, total=False): @@ -18088,10 +17826,8 @@ namespace azure.ai.projects.types class azure.ai.projects.types.InvokeAgentInvocationsApiDispatchPayload(TypedDict, total=False): - key "input": Required[Any] - key "type": Required[Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API]] - input: Any - type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API] + input: Required[Any] + type: Required[Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API]] class azure.ai.projects.types.InvokeAgentInvocationsApiRoutineAction(TypedDict, total=False): @@ -18099,19 +17835,16 @@ namespace azure.ai.projects.types key "agent_name": str key "input": Any key "session_id": str - key "type": Required[Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API]] agent_endpoint_id: str agent_name: str input: Any session_id: str - type: Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API] + type: Required[Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API]] class azure.ai.projects.types.InvokeAgentResponsesApiDispatchPayload(TypedDict, total=False): - key "input": Required[Any] - key "type": Required[Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API]] - input: Any - type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API] + input: Required[Any] + type: Required[Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API]] class azure.ai.projects.types.InvokeAgentResponsesApiRoutineAction(TypedDict, total=False): @@ -18119,60 +17852,51 @@ namespace azure.ai.projects.types key "agent_name": str key "conversation": str key "input": Any - key "type": Required[Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API]] agent_endpoint_id: str agent_name: str conversation: str input: Any - type: Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API] + type: Required[Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API]] class azure.ai.projects.types.ListMemoriesRequest(TypedDict, total=False): - key "scope": Required[str] - scope: str + scope: Required[str] class azure.ai.projects.types.LlmGeneratedVoiceGreetingConfig(TypedDict, total=False): - key "prompt": Required[str] - key "tool_choice": ForwardRef('VoiceAgentToolChoice', module='types') - key "type": Required[Literal["llm_generated"]] - prompt: str + key "tool_choice": ForwardRef('VoiceAgentToolChoice') + prompt: Required[str] tool_choice: VoiceAgentToolChoice - type: Literal[llm_generated] + type: Required[Literal["llm_generated"]] class azure.ai.projects.types.LocalShellToolParam(TypedDict, total=False): key "description": str key "name": str - key "type": Required[Literal[ToolType.LOCAL_SHELL]] + key "tool_configs": dict[str, ToolConfig] description: str name: str tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.LOCAL_SHELL] + type: Required[Literal[ToolType.LOCAL_SHELL]] class azure.ai.projects.types.LocalSkillParam(TypedDict, total=False): - key "description": Required[str] - key "name": Required[str] - key "path": Required[str] - description: str - name: str - path: str + description: Required[str] + name: Required[str] + path: Required[str] class azure.ai.projects.types.LogProbProperties(TypedDict, total=False): - key "bytes": Required[list[int]] - key "logprob": Required[float] - key "token": Required[str] - bytes: list[int] - logprob: float - token: str + bytes: Required[list[int]] + logprob: Required[float] + token: Required[str] class azure.ai.projects.types.LoraConfig(TypedDict, total=False): key "alpha": int key "dropout": float key "rank": int + key "targetModules": list[str] alpha: int dropout: float rank: int @@ -18182,12 +17906,10 @@ namespace azure.ai.projects.types class azure.ai.projects.types.MCPListToolsTool(TypedDict, total=False): key "annotations": Optional[MCPListToolsToolAnnotations] key "description": Optional[str] - key "input_schema": Required[MCPListToolsToolInputSchema] - key "name": Required[str] annotations: MCPListToolsToolAnnotations description: str - input_schema: MCPListToolsToolInputSchema - name: str + input_schema: Required[MCPListToolsToolInputSchema] + name: Required[str] class azure.ai.projects.types.MCPListToolsToolAnnotations(TypedDict, total=False): @@ -18206,10 +17928,9 @@ namespace azure.ai.projects.types key "project_connection_id": str key "require_approval": Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] key "server_description": str - key "server_label": Required[str] key "server_url": str + key "tool_configs": dict[str, ToolConfig] key "tunnel_id": str - key "type": Required[Literal[ToolType.MCP]] allowed_callers: list[Union[str, CallableToolAllowedCaller]] allowed_tools: Union[list[str], MCPToolFilter] authorization: str @@ -18219,22 +17940,23 @@ namespace azure.ai.projects.types project_connection_id: str require_approval: Union[MCPToolRequireApproval, Literal[always], Literal[never]] server_description: str - server_label: str + server_label: Required[str] server_url: str tool_configs: dict[str, ToolConfig] tunnel_id: str - type: Literal[ToolType.MCP] + type: Required[Literal[ToolType.MCP]] class azure.ai.projects.types.MCPToolFilter(TypedDict, total=False): key "read_only": bool + key "tool_names": list[str] read_only: bool tool_names: list[str] class azure.ai.projects.types.MCPToolRequireApproval(TypedDict, total=False): - key "always": ForwardRef('MCPToolFilter', module='types') - key "never": ForwardRef('MCPToolFilter', module='types') + key "always": ForwardRef('MCPToolFilter') + key "never": ForwardRef('MCPToolFilter') always: MCPToolFilter never: MCPToolFilter @@ -18251,10 +17973,9 @@ namespace azure.ai.projects.types key "project_connection_id": str key "require_approval": Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] key "server_description": str - key "server_label": Required[str] key "server_url": str + key "tool_configs": dict[str, ToolConfig] key "tunnel_id": str - key "type": Required[Literal[ToolboxToolType.MCP]] allowed_callers: list[Union[str, CallableToolAllowedCaller]] allowed_tools: Union[list[str], MCPToolFilter] authorization: str @@ -18266,34 +17987,29 @@ namespace azure.ai.projects.types project_connection_id: str require_approval: Union[MCPToolRequireApproval, Literal[always], Literal[never]] server_description: str - server_label: str + server_label: Required[str] server_url: str tool_configs: dict[str, ToolConfig] tunnel_id: str - type: Literal[ToolboxToolType.MCP] + type: Required[Literal[ToolboxToolType.MCP]] class azure.ai.projects.types.ManagedAgentIdentityBlueprintReference(TypedDict, total=False): - key "blueprint_id": Required[str] - key "type": Required[Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT]] - blueprint_id: str - type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] + blueprint_id: Required[str] + type: Required[Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT]] class azure.ai.projects.types.ManagedAzureAISearchIndex(TypedDict, total=False): key "description": str key "id": str - key "name": Required[str] - key "type": Required[Literal[IndexType.MANAGED_AZURE_SEARCH]] - key "vectorStoreId": Required[str] - key "version": Required[str] + key "tags": dict[str, str] description: str id: str - name: str + name: Required[str] tags: dict[str, str] - type: Literal[IndexType.MANAGED_AZURE_SEARCH] - vectorStoreId: str - version: str + type: Required[Literal[IndexType.MANAGED_AZURE_SEARCH]] + vectorStoreId: Required[str] + version: Required[str] class azure.ai.projects.types.McpProtocolConfiguration(TypedDict, total=False): @@ -18305,50 +18021,39 @@ namespace azure.ai.projects.types class azure.ai.projects.types.MemorySearchPreviewTool(TypedDict, total=False): - key "memory_store_name": Required[str] - key "scope": Required[str] - key "search_options": ForwardRef('MemorySearchOptions', module='types') - key "type": Required[Literal[ToolType.MEMORY_SEARCH_PREVIEW]] + key "search_options": ForwardRef('MemorySearchOptions') key "update_delay": int - memory_store_name: str - scope: str + memory_store_name: Required[str] + scope: Required[str] search_options: MemorySearchOptions - type: Literal[ToolType.MEMORY_SEARCH_PREVIEW] + type: Required[Literal[ToolType.MEMORY_SEARCH_PREVIEW]] update_delay: int class azure.ai.projects.types.MemoryStoreDefaultDefinition(TypedDict, total=False): - key "chat_model": Required[str] - key "embedding_model": Required[str] - key "kind": Required[Literal[MemoryStoreKind.DEFAULT]] - key "options": ForwardRef('MemoryStoreDefaultOptions', module='types') - chat_model: str - embedding_model: str - kind: Literal[MemoryStoreKind.DEFAULT] + key "options": ForwardRef('MemoryStoreDefaultOptions') + chat_model: Required[str] + embedding_model: Required[str] + kind: Required[Literal[MemoryStoreKind.DEFAULT]] options: MemoryStoreDefaultOptions class azure.ai.projects.types.MemoryStoreDefaultOptions(TypedDict, total=False): - key "chat_summary_enabled": Required[bool] key "default_ttl_seconds": str key "procedural_memory_enabled": bool key "user_profile_details": str - key "user_profile_enabled": Required[bool] - chat_summary_enabled: bool + chat_summary_enabled: Required[bool] default_ttl_seconds: str procedural_memory_enabled: bool user_profile_details: str - user_profile_enabled: bool + user_profile_enabled: Required[bool] class azure.ai.projects.types.MemoryStoreDefinition(TypedDict, total=False): - key "chat_model": Required[str] - key "embedding_model": Required[str] - key "kind": Required[Literal[MemoryStoreKind.DEFAULT]] - key "options": ForwardRef('MemoryStoreDefaultOptions', module='types') - chat_model: str - embedding_model: str - kind: Literal[MemoryStoreKind.DEFAULT] + key "options": ForwardRef('MemoryStoreDefaultOptions') + chat_model: Required[str] + embedding_model: Required[str] + kind: Required[Literal[MemoryStoreKind.DEFAULT]] options: MemoryStoreDefaultOptions @@ -18360,24 +18065,20 @@ namespace azure.ai.projects.types class azure.ai.projects.types.MicrosoftFabricPreviewTool(TypedDict, total=False): - key "fabric_dataagent_preview": Required[FabricDataAgentToolParameters] - key "type": Required[Literal[ToolType.FABRIC_DATAAGENT_PREVIEW]] - fabric_dataagent_preview: FabricDataAgentToolParameters - type: Literal[ToolType.FABRIC_DATAAGENT_PREVIEW] + fabric_dataagent_preview: Required[FabricDataAgentToolParameters] + type: Required[Literal[ToolType.FABRIC_DATAAGENT_PREVIEW]] class azure.ai.projects.types.ModelCredentialRequest(TypedDict, total=False): - key "blobUri": Required[str] - blobUri: str + blobUri: Required[str] class azure.ai.projects.types.ModelPendingUploadRequest(TypedDict, total=False): key "connectionName": str key "pendingUploadId": str - key "pendingUploadType": Required[Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE]] connectionName: str pendingUploadId: str - pendingUploadType: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] + pendingUploadType: Required[Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE]] class azure.ai.projects.types.ModelSamplingParams(TypedDict, total=False): @@ -18399,46 +18100,39 @@ namespace azure.ai.projects.types class azure.ai.projects.types.ModelVersion(TypedDict, total=False): - key "artifactProfile": ForwardRef('ArtifactProfile', module='types') + key "artifactProfile": ForwardRef('ArtifactProfile') key "baseModel": str - key "blobUri": Required[str] key "description": str key "id": str - key "loraConfig": ForwardRef('LoraConfig', module='types') - key "name": Required[str] - key "source": ForwardRef('ModelSourceData', module='types') - key "version": Required[str] + key "loraConfig": ForwardRef('LoraConfig') + key "source": ForwardRef('ModelSourceData') + key "tags": dict[str, str] + key "warnings": list[FoundryModelWarning] key "weightType": Union[str, FoundryModelWeightType] artifactProfile: ArtifactProfile baseModel: str - blobUri: str + blobUri: Required[str] description: str id: str loraConfig: LoraConfig - name: str + name: Required[str] source: ModelSourceData tags: dict[str, str] - version: str + version: Required[str] warnings: list[FoundryModelWarning] weightType: Union[str, FoundryModelWeightType] class azure.ai.projects.types.MonthlyRecurrenceSchedule(TypedDict, total=False): - key "daysOfMonth": Required[list[int]] - key "type": Required[Literal[RecurrenceType.MONTHLY]] - daysOfMonth: list[int] - type: Literal[RecurrenceType.MONTHLY] + daysOfMonth: Required[list[int]] + type: Required[Literal[RecurrenceType.MONTHLY]] class azure.ai.projects.types.NamespaceToolParam(TypedDict, total=False): - key "description": Required[str] - key "name": Required[str] - key "tools": Required[list[Union[FunctionToolParam, CustomToolParam]]] - key "type": Required[Literal[ToolType.NAMESPACE]] - description: str - name: str - tools: list[Union[FunctionToolParam, CustomToolParam]] - type: Literal[ToolType.NAMESPACE] + description: Required[str] + name: Required[str] + tools: Required[list[Union[FunctionToolParam, CustomToolParam]]] + type: Required[Literal[ToolType.NAMESPACE]] class azure.ai.projects.types.OmitPropertiesRealtimeResponse1(TypedDict, total=False): @@ -18447,15 +18141,16 @@ namespace azure.ai.projects.types key "max_output_tokens": Union[int, Literal["inf"]] key "metadata": Optional[Metadata] key "object": Literal["response"] + key "output_modalities": list[Literal["text", "audio"]] key "status": Literal["completed", "cancelled", "failed", "incomplete", "in_progress"] - key "status_details": ForwardRef('RealtimeResponseStatusDetails', module='types') - key "usage": ForwardRef('RealtimeResponseUsage', module='types') + key "status_details": ForwardRef('RealtimeResponseStatusDetails') + key "usage": ForwardRef('RealtimeResponseUsage') conversation_id: str id: str max_output_tokens: Union[int, Literal[inf]] metadata: Metadata object: Literal[response] - output_modalities: list[Literal["text", "audio"]] + output_modalities: list[Literal[text, audio]] status: Literal[completed, cancelled, failed, incomplete, in_progress] status_details: RealtimeResponseStatusDetails usage: RealtimeResponseUsage @@ -18463,16 +18158,13 @@ namespace azure.ai.projects.types class azure.ai.projects.types.OneTimeTrigger(TypedDict, total=False): key "timeZone": str - key "triggerAt": Required[str] - key "type": Required[Literal[TriggerType.ONE_TIME]] timeZone: str - triggerAt: str - type: Literal[TriggerType.ONE_TIME] + triggerAt: Required[str] + type: Required[Literal[TriggerType.ONE_TIME]] class azure.ai.projects.types.OpenApiAnonymousAuthDetails(TypedDict, total=False): - key "type": Required[Literal[OpenApiAuthType.ANONYMOUS]] - type: Literal[OpenApiAuthType.ANONYMOUS] + type: Required[Literal[OpenApiAuthType.ANONYMOUS]] class azure.ai.projects.types.OpenApiAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -18482,94 +18174,78 @@ namespace azure.ai.projects.types class azure.ai.projects.types.OpenApiFunctionDefinition(TypedDict, total=False): - key "auth": Required[OpenApiAuthDetails] + key "default_params": list[str] key "description": str - key "name": Required[str] - key "spec": Required[dict[str, Any]] - auth: OpenApiAuthDetails + key "functions": list[OpenApiFunctionDefinitionFunction] + auth: Required[OpenApiAuthDetails] default_params: list[str] description: str functions: list[OpenApiFunctionDefinitionFunction] - name: str - spec: dict[str, Any] + name: Required[str] + spec: Required[dict[str, Any]] class azure.ai.projects.types.OpenApiFunctionDefinitionFunction(TypedDict, total=False): key "description": str - key "name": Required[str] - key "parameters": Required[dict[str, Any]] description: str - name: str - parameters: dict[str, Any] + name: Required[str] + parameters: Required[dict[str, Any]] class azure.ai.projects.types.OpenApiManagedAuthDetails(TypedDict, total=False): - key "security_scheme": Required[OpenApiManagedSecurityScheme] - key "type": Required[Literal[OpenApiAuthType.MANAGED_IDENTITY]] - security_scheme: OpenApiManagedSecurityScheme - type: Literal[OpenApiAuthType.MANAGED_IDENTITY] + security_scheme: Required[OpenApiManagedSecurityScheme] + type: Required[Literal[OpenApiAuthType.MANAGED_IDENTITY]] class azure.ai.projects.types.OpenApiManagedSecurityScheme(TypedDict, total=False): - key "audience": Required[str] - audience: str + audience: Required[str] class azure.ai.projects.types.OpenApiProjectConnectionAuthDetails(TypedDict, total=False): - key "security_scheme": Required[OpenApiProjectConnectionSecurityScheme] - key "type": Required[Literal[OpenApiAuthType.PROJECT_CONNECTION]] - security_scheme: OpenApiProjectConnectionSecurityScheme - type: Literal[OpenApiAuthType.PROJECT_CONNECTION] + security_scheme: Required[OpenApiProjectConnectionSecurityScheme] + type: Required[Literal[OpenApiAuthType.PROJECT_CONNECTION]] class azure.ai.projects.types.OpenApiProjectConnectionSecurityScheme(TypedDict, total=False): - key "project_connection_id": Required[str] - project_connection_id: str + project_connection_id: Required[str] class azure.ai.projects.types.OpenApiTool(TypedDict, total=False): - key "openapi": Required[OpenApiFunctionDefinition] - key "type": Required[Literal[ToolType.OPENAPI]] - openapi: OpenApiFunctionDefinition + key "tool_configs": dict[str, ToolConfig] + openapi: Required[OpenApiFunctionDefinition] tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.OPENAPI] + type: Required[Literal[ToolType.OPENAPI]] class azure.ai.projects.types.OpenApiToolboxTool(TypedDict, total=False): key "description": str key "name": str - key "openapi": Required[OpenApiFunctionDefinition] - key "type": Required[Literal[ToolboxToolType.OPENAPI]] + key "tool_configs": dict[str, ToolConfig] description: str name: str - openapi: OpenApiFunctionDefinition + openapi: Required[OpenApiFunctionDefinition] tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.OPENAPI] + type: Required[Literal[ToolboxToolType.OPENAPI]] class azure.ai.projects.types.OptimizedAgentIdentifier(TypedDict, total=False): - key "agent_name": Required[str] key "agent_version": str - agent_name: str + agent_name: Required[str] agent_version: str class azure.ai.projects.types.OtlpTelemetryEndpoint(TypedDict, total=False): - key "auth": ForwardRef('TelemetryEndpointAuth', module='types') - key "data": Required[list[Union[str, TelemetryDataKind]]] - key "endpoint": Required[str] - key "kind": Required[Literal[TelemetryEndpointKind.OTLP]] - key "protocol": Required[Union[str, TelemetryTransportProtocol]] + key "auth": ForwardRef('TelemetryEndpointAuth') auth: TelemetryEndpointAuth - data: list[Union[str, TelemetryDataKind]] - endpoint: str - kind: Literal[TelemetryEndpointKind.OTLP] - protocol: Union[str, TelemetryTransportProtocol] + data: Required[list[Union[str, TelemetryDataKind]]] + endpoint: Required[str] + kind: Required[Literal[TelemetryEndpointKind.OTLP]] + protocol: Required[Union[str, TelemetryTransportProtocol]] class azure.ai.projects.types.PatchAgentObjectRequest(TypedDict, total=False): - key "agent_card": ForwardRef('AgentCard', module='types') - key "agent_endpoint": ForwardRef('AgentEndpointConfig', module='types') + key "agent_card": ForwardRef('AgentCard') + key "agent_endpoint": ForwardRef('AgentEndpointConfig') agent_card: AgentCard agent_endpoint: AgentEndpointConfig @@ -18577,10 +18253,9 @@ namespace azure.ai.projects.types class azure.ai.projects.types.PendingUploadRequest(TypedDict, total=False): key "connectionName": str key "pendingUploadId": str - key "pendingUploadType": Required[Literal[PendingUploadType.BLOB_REFERENCE]] connectionName: str pendingUploadId: str - pendingUploadType: Literal[PendingUploadType.BLOB_REFERENCE] + pendingUploadType: Required[Literal[PendingUploadType.BLOB_REFERENCE]] class azure.ai.projects.types.PendingUploadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -18590,37 +18265,33 @@ namespace azure.ai.projects.types class azure.ai.projects.types.PickPropertiesVoiceAudioConfig(TypedDict, total=False): - key "output": ForwardRef('VoiceAudioOutputConfig', module='types') + key "output": ForwardRef('VoiceAudioOutputConfig') output: VoiceAudioOutputConfig class azure.ai.projects.types.ProgrammaticToolCallingParam(TypedDict, total=False): - key "type": Required[Literal[ToolType.PROGRAMMATIC_TOOL_CALLING]] - type: Literal[ToolType.PROGRAMMATIC_TOOL_CALLING] + type: Required[Literal[ToolType.PROGRAMMATIC_TOOL_CALLING]] class azure.ai.projects.types.PromotionInfo(TypedDict, total=False): - key "agent_name": Required[str] - key "agent_version": Required[str] - key "promoted_at": Required[int] - agent_name: str - agent_version: str - promoted_at: int + agent_name: Required[str] + agent_version: Required[str] + promoted_at: Required[int] class azure.ai.projects.types.PromptAgentDefinition(TypedDict, total=False): key "instructions": Optional[str] - key "kind": Required[Literal[AgentKind.PROMPT]] - key "model": Required[str] - key "rai_config": ForwardRef('RaiConfig', module='types') + key "rai_config": ForwardRef('RaiConfig') key "reasoning": Optional[Reasoning] + key "structured_inputs": dict[str, StructuredInputDefinition] key "temperature": Optional[float] - key "text": ForwardRef('PromptAgentDefinitionTextOptions', module='types') + key "text": ForwardRef('PromptAgentDefinitionTextOptions') key "tool_choice": Union[str, ToolChoiceParam] + key "tools": list[Tool] key "top_p": Optional[float] instructions: str - kind: Literal[AgentKind.PROMPT] - model: str + kind: Required[Literal[AgentKind.PROMPT]] + model: Required[str] rai_config: RaiConfig reasoning: Reasoning structured_inputs: dict[str, StructuredInputDefinition] @@ -18632,45 +18303,42 @@ namespace azure.ai.projects.types class azure.ai.projects.types.PromptAgentDefinitionTextOptions(TypedDict, total=False): - key "format": ForwardRef('TextResponseFormat', module='types') + key "format": ForwardRef('TextResponseFormat') format: TextResponseFormat class azure.ai.projects.types.PromptBasedEvaluatorDefinition(TypedDict, total=False): - key "prompt_text": Required[str] - key "type": Required[Literal[EvaluatorDefinitionType.PROMPT]] + key "data_schema": dict[str, Any] + key "init_parameters": dict[str, Any] + key "metrics": dict[str, EvaluatorMetric] data_schema: dict[str, Any] init_parameters: dict[str, Any] metrics: dict[str, EvaluatorMetric] - prompt_text: str - type: Literal[EvaluatorDefinitionType.PROMPT] + prompt_text: Required[str] + type: Required[Literal[EvaluatorDefinitionType.PROMPT]] class azure.ai.projects.types.PromptDataGenerationJobSource(TypedDict, total=False): key "description": str - key "prompt": Required[str] - key "type": Required[Literal[DataGenerationJobSourceType.PROMPT]] description: str - prompt: str - type: Literal[DataGenerationJobSourceType.PROMPT] + prompt: Required[str] + type: Required[Literal[DataGenerationJobSourceType.PROMPT]] class azure.ai.projects.types.PromptEvaluatorGenerationJobSource(TypedDict, total=False): key "description": str - key "prompt": Required[str] - key "type": Required[Literal[EvaluatorGenerationJobSourceType.PROMPT]] description: str - prompt: str - type: Literal[EvaluatorGenerationJobSourceType.PROMPT] + prompt: Required[str] + type: Required[Literal[EvaluatorGenerationJobSourceType.PROMPT]] class azure.ai.projects.types.ProtocolConfiguration(TypedDict, total=False): - key "a2a": ForwardRef('A2AProtocolConfiguration', module='types') - key "activity": ForwardRef('ActivityProtocolConfiguration', module='types') - key "invocations": ForwardRef('InvocationsProtocolConfiguration', module='types') - key "invocations_ws": ForwardRef('InvocationsWsProtocolConfiguration', module='types') - key "mcp": ForwardRef('McpProtocolConfiguration', module='types') - key "responses": ForwardRef('ResponsesProtocolConfiguration', module='types') + key "a2a": ForwardRef('A2AProtocolConfiguration') + key "activity": ForwardRef('ActivityProtocolConfiguration') + key "invocations": ForwardRef('InvocationsProtocolConfiguration') + key "invocations_ws": ForwardRef('InvocationsWsProtocolConfiguration') + key "mcp": ForwardRef('McpProtocolConfiguration') + key "responses": ForwardRef('ResponsesProtocolConfiguration') a2a: A2AProtocolConfiguration activity: ActivityProtocolConfiguration invocations: InvocationsProtocolConfiguration @@ -18680,19 +18348,16 @@ namespace azure.ai.projects.types class azure.ai.projects.types.ProtocolVersionRecord(TypedDict, total=False): - key "protocol": Required[Union[str, AgentEndpointProtocol]] - key "version": Required[str] - protocol: Union[str, AgentEndpointProtocol] - version: str + protocol: Required[Union[str, AgentEndpointProtocol]] + version: Required[str] class azure.ai.projects.types.RaiConfig(TypedDict, total=False): - key "rai_policy_name": Required[str] - rai_policy_name: str + rai_policy_name: Required[str] class azure.ai.projects.types.RankingOptions(TypedDict, total=False): - key "hybrid_search": ForwardRef('HybridSearchOptions', module='types') + key "hybrid_search": ForwardRef('HybridSearchOptions') key "ranker": Union[str, RankerVersionType] key "score_threshold": float hybrid_search: HybridSearchOptions @@ -18702,19 +18367,16 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeAudioFormatsAudioPcm(TypedDict, total=False): key "rate": Literal[24000] - key "type": Required[Literal[RealtimeAudioFormatsType.AUDIO_PCM]] rate: Literal[24000] - type: Literal[RealtimeAudioFormatsType.AUDIO_PCM] + type: Required[Literal[RealtimeAudioFormatsType.AUDIO_PCM]] class azure.ai.projects.types.RealtimeAudioFormatsAudioPcma(TypedDict, total=False): - key "type": Required[Literal[RealtimeAudioFormatsType.AUDIO_PCMA]] - type: Literal[RealtimeAudioFormatsType.AUDIO_PCMA] + type: Required[Literal[RealtimeAudioFormatsType.AUDIO_PCMA]] class azure.ai.projects.types.RealtimeAudioFormatsAudioPcmu(TypedDict, total=False): - key "type": Required[Literal[RealtimeAudioFormatsType.AUDIO_PCMU]] - type: Literal[RealtimeAudioFormatsType.AUDIO_PCMU] + type: Required[Literal[RealtimeAudioFormatsType.AUDIO_PCMU]] class azure.ai.projects.types.RealtimeAudioFormatsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -18738,50 +18400,41 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeConversationItemFunctionCall(TypedDict, total=False): - key "arguments": Required[str] key "call_id": str key "id": str - key "name": Required[str] key "object": Literal["item"] key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal[RealtimeConversationItemType.FUNCTION_CALL]] - arguments: str + arguments: Required[str] call_id: str id: str - name: str + name: Required[str] object: Literal[item] status: Literal[completed, incomplete, in_progress] - type: Literal[RealtimeConversationItemType.FUNCTION_CALL] + type: Required[Literal[RealtimeConversationItemType.FUNCTION_CALL]] class azure.ai.projects.types.RealtimeConversationItemFunctionCallOutput(TypedDict, total=False): - key "call_id": Required[str] key "id": str key "object": Literal["item"] - key "output": Required[str] key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT]] - call_id: str + call_id: Required[str] id: str object: Literal[item] - output: str + output: Required[str] status: Literal[completed, incomplete, in_progress] - type: Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT] + type: Required[Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT]] class azure.ai.projects.types.RealtimeConversationItemMessageAssistant(TypedDict, total=False): - key "content": Required[list[RealtimeConversationItemMessageAssistantContent]] key "id": str key "object": Literal["item"] - key "role": Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal["message"]] - content: list[RealtimeConversationItemMessageAssistantContent] + content: Required[list[RealtimeConversationItemMessageAssistantContent]] id: str object: Literal[item] - role: Literal[RealtimeConversationItemMessageType.ASSISTANT] + role: Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] status: Literal[completed, incomplete, in_progress] - type: Literal[message] + type: Required[Literal["message"]] class azure.ai.projects.types.RealtimeConversationItemMessageAssistantContent(TypedDict, total=False): @@ -18796,18 +18449,15 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeConversationItemMessageSystem(TypedDict, total=False): - key "content": Required[list[RealtimeConversationItemMessageSystemContent]] key "id": str key "object": Literal["item"] - key "role": Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal["message"]] - content: list[RealtimeConversationItemMessageSystemContent] + content: Required[list[RealtimeConversationItemMessageSystemContent]] id: str object: Literal[item] - role: Literal[RealtimeConversationItemMessageType.SYSTEM] + role: Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] status: Literal[completed, incomplete, in_progress] - type: Literal[message] + type: Required[Literal["message"]] class azure.ai.projects.types.RealtimeConversationItemMessageSystemContent(TypedDict, total=False): @@ -18824,18 +18474,15 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeConversationItemMessageUser(TypedDict, total=False): - key "content": Required[list[RealtimeConversationItemMessageUserContent]] key "id": str key "object": Literal["item"] - key "role": Required[Literal[RealtimeConversationItemMessageType.USER]] key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal["message"]] - content: list[RealtimeConversationItemMessageUserContent] + content: Required[list[RealtimeConversationItemMessageUserContent]] id: str object: Literal[item] - role: Literal[RealtimeConversationItemMessageType.USER] + role: Required[Literal[RealtimeConversationItemMessageType.USER]] status: Literal[completed, incomplete, in_progress] - type: Literal[message] + type: Required[Literal["message"]] class azure.ai.projects.types.RealtimeConversationItemMessageUserContent(TypedDict, total=False): @@ -18865,7 +18512,7 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeFunctionTool(TypedDict, total=False): key "description": str key "name": str - key "parameters": ForwardRef('RealtimeFunctionToolParameters', module='types') + key "parameters": ForwardRef('RealtimeFunctionToolParameters') key "type": Literal["function"] description: str name: str @@ -18877,84 +18524,59 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeMCPApprovalRequest(TypedDict, total=False): - key "arguments": Required[str] - key "id": Required[str] - key "name": Required[str] - key "server_label": Required[str] - key "type": Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST]] - arguments: str - id: str - name: str - server_label: str - type: Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST] + arguments: Required[str] + id: Required[str] + name: Required[str] + server_label: Required[str] + type: Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST]] class azure.ai.projects.types.RealtimeMCPApprovalResponse(TypedDict, total=False): - key "approval_request_id": Required[str] - key "approve": Required[bool] - key "id": Required[str] key "reason": Optional[str] - key "type": Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE]] - approval_request_id: str - approve: bool - id: str + approval_request_id: Required[str] + approve: Required[bool] + id: Required[str] reason: str - type: Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE] + type: Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE]] class azure.ai.projects.types.RealtimeMCPHTTPError(TypedDict, total=False): - key "code": Required[int] - key "message": Required[str] - key "type": Required[Literal[RealtimeMcpErrorType.HTTP_ERROR]] - code: int - message: str - type: Literal[RealtimeMcpErrorType.HTTP_ERROR] + code: Required[int] + message: Required[str] + type: Required[Literal[RealtimeMcpErrorType.HTTP_ERROR]] class azure.ai.projects.types.RealtimeMCPListTools(TypedDict, total=False): key "id": str - key "server_label": Required[str] - key "tools": Required[list[MCPListToolsTool]] - key "type": Required[Literal[RealtimeConversationItemType.MCP_LIST_TOOLS]] id: str - server_label: str - tools: list[MCPListToolsTool] - type: Literal[RealtimeConversationItemType.MCP_LIST_TOOLS] + server_label: Required[str] + tools: Required[list[MCPListToolsTool]] + type: Required[Literal[RealtimeConversationItemType.MCP_LIST_TOOLS]] class azure.ai.projects.types.RealtimeMCPProtocolError(TypedDict, total=False): - key "code": Required[int] - key "message": Required[str] - key "type": Required[Literal[RealtimeMcpErrorType.PROTOCOL_ERROR]] - code: int - message: str - type: Literal[RealtimeMcpErrorType.PROTOCOL_ERROR] + code: Required[int] + message: Required[str] + type: Required[Literal[RealtimeMcpErrorType.PROTOCOL_ERROR]] class azure.ai.projects.types.RealtimeMCPToolCall(TypedDict, total=False): key "approval_request_id": Optional[str] - key "arguments": Required[str] - key "error": ForwardRef('RealtimeMCPError', module='types') - key "id": Required[str] - key "name": Required[str] + key "error": ForwardRef('RealtimeMCPError') key "output": Optional[str] - key "server_label": Required[str] - key "type": Required[Literal[RealtimeConversationItemType.MCP_CALL]] approval_request_id: str - arguments: str + arguments: Required[str] error: RealtimeMCPError - id: str - name: str + id: Required[str] + name: Required[str] output: str - server_label: str - type: Literal[RealtimeConversationItemType.MCP_CALL] + server_label: Required[str] + type: Required[Literal[RealtimeConversationItemType.MCP_CALL]] class azure.ai.projects.types.RealtimeMCPToolExecutionError(TypedDict, total=False): - key "message": Required[str] - key "type": Required[Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR]] - message: str - type: Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR] + message: Required[str] + type: Required[Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR]] class azure.ai.projects.types.RealtimeMcpErrorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -18969,7 +18591,7 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeResponseStatusDetails(TypedDict, total=False): - key "error": ForwardRef('RealtimeResponseStatusDetailsError', module='types') + key "error": ForwardRef('RealtimeResponseStatusDetailsError') key "reason": Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"] key "type": Literal["completed", "cancelled", "failed", "incomplete"] error: RealtimeResponseStatusDetailsError @@ -18985,9 +18607,9 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeResponseUsage(TypedDict, total=False): - key "input_token_details": ForwardRef('RealtimeResponseUsageInputTokenDetails', module='types') + key "input_token_details": ForwardRef('RealtimeResponseUsageInputTokenDetails') key "input_tokens": int - key "output_token_details": ForwardRef('RealtimeResponseUsageOutputTokenDetails', module='types') + key "output_token_details": ForwardRef('RealtimeResponseUsageOutputTokenDetails') key "output_tokens": int key "total_tokens": int input_token_details: RealtimeResponseUsageInputTokenDetails @@ -19000,7 +18622,7 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeResponseUsageInputTokenDetails(TypedDict, total=False): key "audio_tokens": int key "cached_tokens": int - key "cached_tokens_details": ForwardRef('RealtimeResponseUsageInputTokenDetailsCachedTokensDetails', module='types') + key "cached_tokens_details": ForwardRef('RealtimeResponseUsageInputTokenDetailsCachedTokensDetails') key "image_tokens": int key "text_tokens": int audio_tokens: int @@ -19027,20 +18649,13 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeServerEvent(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "part": Required[RealtimeServerEventResponseContentPartAddedPart] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED]] - content_index: int - event_id: str - item_id: str - output_index: int - part: RealtimeServerEventResponseContentPartAddedPart - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED] + content_index: Required[int] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + part: Required[RealtimeServerEventResponseContentPartAddedPart] + response_id: Required[str] + type: Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED]] class azure.ai.projects.types.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError(TypedDict, total=False): @@ -19055,25 +18670,20 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeServerEventError(TypedDict, total=False): - key "error": Required[RealtimeServerEventErrorError] - key "event_id": Required[str] - key "type": Required[Literal["error"]] - error: RealtimeServerEventErrorError - event_id: str - type: Literal[error] + error: Required[RealtimeServerEventErrorError] + event_id: Required[str] + type: Required[Literal["error"]] class azure.ai.projects.types.RealtimeServerEventErrorError(TypedDict, total=False): key "code": Optional[str] key "event_id": Optional[str] - key "message": Required[str] key "param": Optional[str] - key "type": Required[str] code: str event_id: str - message: str + message: Required[str] param: str - type: str + type: Required[str] class azure.ai.projects.types.RealtimeServerEventRateLimitsUpdatedRateLimits(TypedDict, total=False): @@ -19088,20 +18698,13 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeServerEventResponseContentPartAdded(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "part": Required[RealtimeServerEventResponseContentPartAddedPart] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED]] - content_index: int - event_id: str - item_id: str - output_index: int - part: RealtimeServerEventResponseContentPartAddedPart - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED] + content_index: Required[int] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + part: Required[RealtimeServerEventResponseContentPartAddedPart] + response_id: Required[str] + type: Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED]] class azure.ai.projects.types.RealtimeServerEventResponseContentPartAddedPart(TypedDict, total=False): @@ -19179,17 +18782,14 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RecurrenceTrigger(TypedDict, total=False): key "endTime": str - key "interval": Required[int] - key "schedule": Required[RecurrenceSchedule] key "startTime": str key "timeZone": str - key "type": Required[Literal[TriggerType.RECURRENCE]] endTime: str - interval: int - schedule: RecurrenceSchedule + interval: Required[int] + schedule: Required[RecurrenceSchedule] startTime: str timeZone: str - type: Literal[TriggerType.RECURRENCE] + type: Required[Literal[TriggerType.RECURRENCE]] class azure.ai.projects.types.RecurrenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -19201,40 +18801,40 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RedTeam(TypedDict, total=False): key "applicationScenario": str + key "attackStrategies": list[Union[str, AttackStrategy]] key "displayName": str - key "id": Required[str] key "numTurns": int + key "properties": dict[str, str] + key "riskCategories": list[Union[str, RiskCategory]] key "simulationOnly": bool key "status": str - key "target": Required[RedTeamTargetConfig] + key "tags": dict[str, str] applicationScenario: str attackStrategies: list[Union[str, AttackStrategy]] displayName: str - id: str + id: Required[str] numTurns: int properties: dict[str, str] riskCategories: list[Union[str, RiskCategory]] simulationOnly: bool status: str tags: dict[str, str] - target: RedTeamTargetConfig + target: Required[RedTeamTargetConfig] class azure.ai.projects.types.RedTeamTargetConfig(TypedDict, total=False): - key "modelDeploymentName": Required[str] - key "type": Required[Literal["AzureOpenAIModel"]] - modelDeploymentName: str - type: Literal[AzureOpenAIModel] + modelDeploymentName: Required[str] + type: Required[Literal["AzureOpenAIModel"]] class azure.ai.projects.types.ReminderPreviewToolboxTool(TypedDict, total=False): key "description": str key "name": str - key "type": Required[Literal[ToolboxToolType.REMINDER_PREVIEW]] + key "tool_configs": dict[str, ToolConfig] description: str name: str tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.REMINDER_PREVIEW] + type: Required[Literal[ToolboxToolType.REMINDER_PREVIEW]] class azure.ai.projects.types.ResponsesProtocolConfiguration(TypedDict, total=False): @@ -19258,27 +18858,24 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RubricBasedEvaluatorDefinition(TypedDict, total=False): - key "dimensions": Required[list[Dimension]] + key "data_schema": dict[str, Any] + key "init_parameters": dict[str, Any] + key "metrics": dict[str, EvaluatorMetric] key "pass_threshold": float - key "type": Required[Literal[EvaluatorDefinitionType.RUBRIC]] data_schema: dict[str, Any] - dimensions: list[Dimension] + dimensions: Required[list[Dimension]] init_parameters: dict[str, Any] metrics: dict[str, EvaluatorMetric] pass_threshold: float - type: Literal[EvaluatorDefinitionType.RUBRIC] + type: Required[Literal[EvaluatorDefinitionType.RUBRIC]] class azure.ai.projects.types.RubricGenerationInputQualityWarning(TypedDict, total=False): - key "code": Required[Union[str, RubricGenerationInputQualityWarningCode]] - key "message": Required[str] - key "severity": Required[Union[str, RubricGenerationInputQualityWarningSeverity]] - key "source": Required[Union[str, RubricGenerationInputQualityWarningSource]] key "source_index": int - code: Union[str, RubricGenerationInputQualityWarningCode] - message: str - severity: Union[str, RubricGenerationInputQualityWarningSeverity] - source: Union[str, RubricGenerationInputQualityWarningSource] + code: Required[Union[str, RubricGenerationInputQualityWarningCode]] + message: Required[str] + severity: Required[Union[str, RubricGenerationInputQualityWarningSeverity]] + source: Required[Union[str, RubricGenerationInputQualityWarningSource]] source_index: int @@ -19289,31 +18886,25 @@ namespace azure.ai.projects.types class azure.ai.projects.types.Schedule(TypedDict, total=False): key "description": str key "displayName": str - key "enabled": Required[bool] - key "id": Required[str] + key "properties": dict[str, str] key "provisioningStatus": Union[str, ScheduleProvisioningStatus] - key "systemData": Required[dict[str, str]] - key "task": Required[ScheduleTask] - key "trigger": Required[Trigger] + key "tags": dict[str, str] description: str displayName: str - enabled: bool - id: str + enabled: Required[bool] + id: Required[str] properties: dict[str, str] provisioningStatus: Union[str, ScheduleProvisioningStatus] - systemData: dict[str, str] + systemData: Required[dict[str, str]] tags: dict[str, str] - task: ScheduleTask - trigger: Trigger + task: Required[ScheduleTask] + trigger: Required[Trigger] class azure.ai.projects.types.ScheduleRoutineTrigger(TypedDict, total=False): - key "cron_expression": Required[str] - key "time_zone": Required[str] - key "type": Required[Literal[RoutineTriggerType.SCHEDULE]] - cron_expression: str - time_zone: str - type: Literal[RoutineTriggerType.SCHEDULE] + cron_expression: Required[str] + time_zone: Required[str] + type: Required[Literal[RoutineTriggerType.SCHEDULE]] class azure.ai.projects.types.ScheduleTaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -19322,79 +18913,82 @@ namespace azure.ai.projects.types class azure.ai.projects.types.SearchMemoriesRequest(TypedDict, total=False): - key "options": ForwardRef('MemorySearchOptions', module='types') + key "items": list[dict[str, Any]] + key "options": ForwardRef('MemorySearchOptions') key "previous_search_id": str - key "scope": Required[str] items: list[dict[str, Any]] options: MemorySearchOptions previous_search_id: str - scope: str + scope: Required[str] class azure.ai.projects.types.SharepointGroundingToolParameters(TypedDict, total=False): + key "project_connections": list[ToolProjectConnection] project_connections: list[ToolProjectConnection] class azure.ai.projects.types.SharepointPreviewTool(TypedDict, total=False): - key "sharepoint_grounding_preview": Required[SharepointGroundingToolParameters] - key "type": Required[Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW]] - sharepoint_grounding_preview: SharepointGroundingToolParameters - type: Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW] + sharepoint_grounding_preview: Required[SharepointGroundingToolParameters] + type: Required[Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW]] class azure.ai.projects.types.SimpleQnADataGenerationJobOptions(TypedDict, total=False): - key "max_samples": Required[int] - key "model_options": ForwardRef('DataGenerationModelOptions', module='types') + key "model_options": ForwardRef('DataGenerationModelOptions') + key "question_types": list[Union[str, SimpleQnAFineTuningQuestionType]] key "train_split": float - key "type": Required[Literal[DataGenerationJobType.SIMPLE_QNA]] - max_samples: int + max_samples: Required[int] model_options: DataGenerationModelOptions question_types: list[Union[str, SimpleQnAFineTuningQuestionType]] train_split: float - type: Literal[DataGenerationJobType.SIMPLE_QNA] + type: Required[Literal[DataGenerationJobType.SIMPLE_QNA]] + + + class azure.ai.projects.types.SimulationSeedDataGenerationJobOptions(TypedDict, total=False): + key "model_options": ForwardRef('DataGenerationModelOptions') + key "train_split": float + max_samples: Required[int] + model_options: DataGenerationModelOptions + train_split: float + type: Required[Literal[DataGenerationJobType.SIMULATION_SEED]] class azure.ai.projects.types.SkillInlineContent(TypedDict, total=False): + key "allowed_tools": list[str] key "compatibility": str - key "description": Required[str] - key "instructions": Required[str] key "license": str + key "metadata": dict[str, str] allowed_tools: list[str] compatibility: str - description: str - instructions: str + description: Required[str] + instructions: Required[str] license: str metadata: dict[str, str] class azure.ai.projects.types.SkillReferenceParam(TypedDict, total=False): - key "skill_id": Required[str] - key "type": Required[Literal[ContainerSkillType.SKILL_REFERENCE]] key "version": str - skill_id: str - type: Literal[ContainerSkillType.SKILL_REFERENCE] + skill_id: Required[str] + type: Required[Literal[ContainerSkillType.SKILL_REFERENCE]] version: str class azure.ai.projects.types.SpecificApplyPatchParam(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.APPLY_PATCH]] - type: Literal[ToolChoiceParamType.APPLY_PATCH] + type: Required[Literal[ToolChoiceParamType.APPLY_PATCH]] class azure.ai.projects.types.SpecificFunctionShellParam(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.SHELL]] - type: Literal[ToolChoiceParamType.SHELL] + type: Required[Literal[ToolChoiceParamType.SHELL]] class azure.ai.projects.types.SpecificProgrammaticToolCallingParam(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING]] - type: Literal[ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING] + type: Required[Literal[ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING]] class azure.ai.projects.types.StructuredInputDefinition(TypedDict, total=False): key "default_value": Any key "description": str key "required": bool + key "schema": dict[str, Any] default_value: Any description: str required: bool @@ -19402,80 +18996,51 @@ namespace azure.ai.projects.types class azure.ai.projects.types.StructuredOutputDefinition(TypedDict, total=False): - key "description": Required[str] - key "name": Required[str] - key "schema": Required[dict[str, Any]] - key "strict": Required[Optional[bool]] - description: str - name: str - schema: dict[str, Any] - strict: bool - - - class azure.ai.projects.types.TaskGenerationDataGenerationJobOptions(TypedDict, total=False): - key "max_samples": Required[int] - key "model_options": ForwardRef('DataGenerationModelOptions', module='types') - key "train_split": float - key "type": Required[Literal[DataGenerationJobType.TASK_GENERATION]] - max_samples: int - model_options: DataGenerationModelOptions - train_split: float - type: Literal[DataGenerationJobType.TASK_GENERATION] + description: Required[str] + name: Required[str] + schema: Required[dict[str, Any]] + strict: Required[Optional[bool]] class azure.ai.projects.types.TaxonomyCategory(TypedDict, total=False): key "description": str - key "id": Required[str] - key "name": Required[str] - key "riskCategory": Required[Union[str, RiskCategory]] - key "subCategories": Required[list[TaxonomySubCategory]] + key "properties": dict[str, str] description: str - id: str - name: str + id: Required[str] + name: Required[str] properties: dict[str, str] - riskCategory: Union[str, RiskCategory] - subCategories: list[TaxonomySubCategory] + riskCategory: Required[Union[str, RiskCategory]] + subCategories: Required[list[TaxonomySubCategory]] class azure.ai.projects.types.TaxonomySubCategory(TypedDict, total=False): key "description": str - key "enabled": Required[bool] - key "id": Required[str] - key "name": Required[str] + key "properties": dict[str, str] description: str - enabled: bool - id: str - name: str + enabled: Required[bool] + id: Required[str] + name: Required[str] properties: dict[str, str] class azure.ai.projects.types.TelemetryConfig(TypedDict, total=False): - key "endpoints": Required[list[TelemetryEndpoint]] - endpoints: list[TelemetryEndpoint] + endpoints: Required[list[TelemetryEndpoint]] class azure.ai.projects.types.TelemetryEndpoint(TypedDict, total=False): - key "auth": ForwardRef('TelemetryEndpointAuth', module='types') - key "data": Required[list[Union[str, TelemetryDataKind]]] - key "endpoint": Required[str] - key "kind": Required[Literal[TelemetryEndpointKind.OTLP]] - key "protocol": Required[Union[str, TelemetryTransportProtocol]] + key "auth": ForwardRef('TelemetryEndpointAuth') auth: TelemetryEndpointAuth - data: list[Union[str, TelemetryDataKind]] - endpoint: str - kind: Literal[TelemetryEndpointKind.OTLP] - protocol: Union[str, TelemetryTransportProtocol] + data: Required[list[Union[str, TelemetryDataKind]]] + endpoint: Required[str] + kind: Required[Literal[TelemetryEndpointKind.OTLP]] + protocol: Required[Union[str, TelemetryTransportProtocol]] class azure.ai.projects.types.TelemetryEndpointAuth(TypedDict, total=False): - key "header_name": Required[str] - key "secret_id": Required[str] - key "secret_key": Required[str] - key "type": Required[Literal[TelemetryEndpointAuthType.HEADER]] - header_name: str - secret_id: str - secret_key: str - type: Literal[TelemetryEndpointAuthType.HEADER] + header_name: Required[str] + secret_id: Required[str] + secret_key: Required[str] + type: Required[Literal[TelemetryEndpointAuthType.HEADER]] class azure.ai.projects.types.TelemetryEndpointAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -19487,10 +19052,8 @@ namespace azure.ai.projects.types class azure.ai.projects.types.TemplateVoiceGreetingConfig(TypedDict, total=False): - key "text": Required[str] - key "type": Required[Literal["template"]] - text: str - type: Literal[template] + text: Required[str] + type: Required[Literal["template"]] class azure.ai.projects.types.TextResponseFormatConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -19500,95 +19063,74 @@ namespace azure.ai.projects.types class azure.ai.projects.types.TextResponseFormatJsonObject(TypedDict, total=False): - key "type": Required[Literal[TextResponseFormatConfigurationType.JSON_OBJECT]] - type: Literal[TextResponseFormatConfigurationType.JSON_OBJECT] + type: Required[Literal[TextResponseFormatConfigurationType.JSON_OBJECT]] class azure.ai.projects.types.TextResponseFormatJsonSchema(TypedDict, total=False): key "description": str - key "name": Required[str] - key "schema": Required[dict[str, Any]] key "strict": Optional[bool] - key "type": Required[Literal[TextResponseFormatConfigurationType.JSON_SCHEMA]] description: str - name: str - schema: dict[str, Any] + name: Required[str] + schema: Required[dict[str, Any]] strict: bool - type: Literal[TextResponseFormatConfigurationType.JSON_SCHEMA] + type: Required[Literal[TextResponseFormatConfigurationType.JSON_SCHEMA]] class azure.ai.projects.types.TextResponseFormatText(TypedDict, total=False): - key "type": Required[Literal[TextResponseFormatConfigurationType.TEXT]] - type: Literal[TextResponseFormatConfigurationType.TEXT] + type: Required[Literal[TextResponseFormatConfigurationType.TEXT]] class azure.ai.projects.types.TimerRoutineTrigger(TypedDict, total=False): key "at": int - key "type": Required[Literal[RoutineTriggerType.TIMER]] at: int - type: Literal[RoutineTriggerType.TIMER] + type: Required[Literal[RoutineTriggerType.TIMER]] class azure.ai.projects.types.ToolChoiceAllowed(TypedDict, total=False): - key "mode": Required[Literal["auto", "required"]] - key "tools": Required[list[dict[str, Any]]] - key "type": Required[Literal[ToolChoiceParamType.ALLOWED_TOOLS]] - mode: Literal[auto, required] - tools: list[dict[str, Any]] - type: Literal[ToolChoiceParamType.ALLOWED_TOOLS] + mode: Required[Literal["auto", "required"]] + tools: Required[list[dict[str, Any]]] + type: Required[Literal[ToolChoiceParamType.ALLOWED_TOOLS]] class azure.ai.projects.types.ToolChoiceCodeInterpreter(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.CODE_INTERPRETER]] - type: Literal[ToolChoiceParamType.CODE_INTERPRETER] + type: Required[Literal[ToolChoiceParamType.CODE_INTERPRETER]] class azure.ai.projects.types.ToolChoiceComputer(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.COMPUTER]] - type: Literal[ToolChoiceParamType.COMPUTER] + type: Required[Literal[ToolChoiceParamType.COMPUTER]] class azure.ai.projects.types.ToolChoiceComputerUse(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.COMPUTER_USE]] - type: Literal[ToolChoiceParamType.COMPUTER_USE] + type: Required[Literal[ToolChoiceParamType.COMPUTER_USE]] class azure.ai.projects.types.ToolChoiceComputerUsePreview(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW]] - type: Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW] + type: Required[Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW]] class azure.ai.projects.types.ToolChoiceCustom(TypedDict, total=False): - key "name": Required[str] - key "type": Required[Literal[ToolChoiceParamType.CUSTOM]] - name: str - type: Literal[ToolChoiceParamType.CUSTOM] + name: Required[str] + type: Required[Literal[ToolChoiceParamType.CUSTOM]] class azure.ai.projects.types.ToolChoiceFileSearch(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.FILE_SEARCH]] - type: Literal[ToolChoiceParamType.FILE_SEARCH] + type: Required[Literal[ToolChoiceParamType.FILE_SEARCH]] class azure.ai.projects.types.ToolChoiceFunction(TypedDict, total=False): - key "name": Required[str] - key "type": Required[Literal[ToolChoiceParamType.FUNCTION]] - name: str - type: Literal[ToolChoiceParamType.FUNCTION] + name: Required[str] + type: Required[Literal[ToolChoiceParamType.FUNCTION]] class azure.ai.projects.types.ToolChoiceImageGeneration(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.IMAGE_GENERATION]] - type: Literal[ToolChoiceParamType.IMAGE_GENERATION] + type: Required[Literal[ToolChoiceParamType.IMAGE_GENERATION]] class azure.ai.projects.types.ToolChoiceMCP(TypedDict, total=False): key "name": Optional[str] - key "server_label": Required[str] - key "type": Required[Literal[ToolChoiceParamType.MCP]] name: str - server_label: str - type: Literal[ToolChoiceParamType.MCP] + server_label: Required[str] + type: Required[Literal[ToolChoiceParamType.MCP]] class azure.ai.projects.types.ToolChoiceParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -19610,13 +19152,11 @@ namespace azure.ai.projects.types class azure.ai.projects.types.ToolChoiceWebSearchPreview(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW]] - type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW] + type: Required[Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW]] class azure.ai.projects.types.ToolChoiceWebSearchPreview20250311(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11]] - type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11] + type: Required[Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11]] class azure.ai.projects.types.ToolConfig(TypedDict, total=False): @@ -19634,29 +19174,27 @@ namespace azure.ai.projects.types class azure.ai.projects.types.ToolProjectConnection(TypedDict, total=False): - key "project_connection_id": Required[str] - project_connection_id: str + project_connection_id: Required[str] class azure.ai.projects.types.ToolSearchToolParam(TypedDict, total=False): key "description": Optional[str] key "execution": Union[str, ToolSearchExecutionType] key "parameters": Optional[EmptyModelParam] - key "type": Required[Literal[ToolType.TOOL_SEARCH]] description: str execution: Union[str, ToolSearchExecutionType] parameters: EmptyModelParam - type: Literal[ToolType.TOOL_SEARCH] + type: Required[Literal[ToolType.TOOL_SEARCH]] class azure.ai.projects.types.ToolSearchToolboxTool(TypedDict, total=False): key "description": str key "name": str - key "type": Required[Literal[ToolboxToolType.TOOLBOX_SEARCH]] + key "tool_configs": dict[str, ToolConfig] description: str name: str tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.TOOLBOX_SEARCH] + type: Required[Literal[ToolboxToolType.TOOLBOX_SEARCH]] class azure.ai.projects.types.ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -19693,46 +19231,40 @@ namespace azure.ai.projects.types class azure.ai.projects.types.ToolUseFineTuningDataGenerationJobOptions(TypedDict, total=False): - key "max_samples": Required[int] - key "model_options": ForwardRef('DataGenerationModelOptions', module='types') + key "model_options": ForwardRef('DataGenerationModelOptions') key "train_split": float - key "type": Required[Literal[DataGenerationJobType.TOOL_USE]] - max_samples: int + max_samples: Required[int] model_options: DataGenerationModelOptions train_split: float - type: Literal[DataGenerationJobType.TOOL_USE] + type: Required[Literal[DataGenerationJobType.TOOL_USE]] class azure.ai.projects.types.ToolboxPolicies(TypedDict, total=False): - key "rai_config": ForwardRef('RaiConfig', module='types') + key "rai_config": ForwardRef('RaiConfig') rai_config: RaiConfig class azure.ai.projects.types.ToolboxSearchPreviewToolboxTool(TypedDict, total=False): key "description": str key "name": str - key "type": Required[Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW]] + key "tool_configs": dict[str, ToolConfig] description: str name: str tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW] + type: Required[Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW]] class azure.ai.projects.types.ToolboxSkill(TypedDict, total=False): - key "name": Required[str] - key "type": Required[Literal["skill_reference"]] key "version": str - name: str - type: Literal[skill_reference] + name: Required[str] + type: Required[Literal["skill_reference"]] version: str class azure.ai.projects.types.ToolboxSkillReference(TypedDict, total=False): - key "name": Required[str] - key "type": Required[Literal["skill_reference"]] key "version": str - name: str - type: Literal[skill_reference] + name: Required[str] + type: Required[Literal["skill_reference"]] version: str @@ -19753,14 +19285,12 @@ namespace azure.ai.projects.types class azure.ai.projects.types.TracesDataGenerationJobOptions(TypedDict, total=False): - key "max_samples": Required[int] - key "model_options": ForwardRef('DataGenerationModelOptions', module='types') + key "model_options": ForwardRef('DataGenerationModelOptions') key "train_split": float - key "type": Required[Literal[DataGenerationJobType.TRACES]] - max_samples: int + max_samples: Required[int] model_options: DataGenerationModelOptions train_split: float - type: Literal[DataGenerationJobType.TRACES] + type: Required[Literal[DataGenerationJobType.TRACES]] class azure.ai.projects.types.TracesDataGenerationJobSource(TypedDict, total=False): @@ -19769,15 +19299,13 @@ namespace azure.ai.projects.types key "agent_version": str key "description": str key "end_time": int - key "start_time": Required[int] - key "type": Required[Literal[DataGenerationJobSourceType.TRACES]] agent_id: str agent_name: str agent_version: str description: str end_time: int - start_time: int - type: Literal[DataGenerationJobSourceType.TRACES] + start_time: Required[int] + type: Required[Literal[DataGenerationJobSourceType.TRACES]] class azure.ai.projects.types.TracesEvaluatorGenerationJobSource(TypedDict, total=False): @@ -19786,35 +19314,27 @@ namespace azure.ai.projects.types key "agent_version": str key "description": str key "end_time": int - key "start_time": Required[int] - key "type": Required[Literal[EvaluatorGenerationJobSourceType.TRACES]] agent_id: str agent_name: str agent_version: str description: str end_time: int - start_time: int - type: Literal[EvaluatorGenerationJobSourceType.TRACES] + start_time: Required[int] + type: Required[Literal[EvaluatorGenerationJobSourceType.TRACES]] class azure.ai.projects.types.TranscriptTextUsageDuration(TypedDict, total=False): - key "seconds": Required[str] - key "type": Required[Literal[CreateTranscriptionResponseJsonUsageType.DURATION]] - seconds: str - type: Literal[CreateTranscriptionResponseJsonUsageType.DURATION] + seconds: Required[str] + type: Required[Literal[CreateTranscriptionResponseJsonUsageType.DURATION]] class azure.ai.projects.types.TranscriptTextUsageTokens(TypedDict, total=False): - key "input_token_details": ForwardRef('TranscriptTextUsageTokensInputTokenDetails', module='types') - key "input_tokens": Required[int] - key "output_tokens": Required[int] - key "total_tokens": Required[int] - key "type": Required[Literal[CreateTranscriptionResponseJsonUsageType.TOKENS]] + key "input_token_details": ForwardRef('TranscriptTextUsageTokensInputTokenDetails') input_token_details: TranscriptTextUsageTokensInputTokenDetails - input_tokens: int - output_tokens: int - total_tokens: int - type: Literal[CreateTranscriptionResponseJsonUsageType.TOKENS] + input_tokens: Required[int] + output_tokens: Required[int] + total_tokens: Required[int] + type: Required[Literal[CreateTranscriptionResponseJsonUsageType.TOKENS]] class azure.ai.projects.types.TranscriptTextUsageTokensInputTokenDetails(TypedDict, total=False): @@ -19831,52 +19351,48 @@ namespace azure.ai.projects.types class azure.ai.projects.types.UpdateMemoriesRequest(TypedDict, total=False): + key "items": list[dict[str, Any]] key "previous_update_id": str - key "scope": Required[str] key "update_delay": int items: list[dict[str, Any]] previous_update_id: str - scope: str + scope: Required[str] update_delay: int class azure.ai.projects.types.UpdateMemoryRequest(TypedDict, total=False): - key "content": Required[str] - content: str + content: Required[str] class azure.ai.projects.types.UpdateMemoryStoreRequest(TypedDict, total=False): key "description": str + key "metadata": dict[str, str] description: str metadata: dict[str, str] class azure.ai.projects.types.UpdateModelVersionRequest(TypedDict, total=False): key "description": str + key "tags": dict[str, str] description: str tags: dict[str, str] class azure.ai.projects.types.UpdateSkillRequest(TypedDict, total=False): - key "default_version": Required[str] - default_version: str + default_version: Required[str] class azure.ai.projects.types.UpdateToolboxRequest(TypedDict, total=False): - key "default_version": Required[str] - default_version: str + default_version: Required[str] class azure.ai.projects.types.UpdateToolboxRequest1(TypedDict, total=False): - key "default_version": Required[str] - default_version: str + default_version: Required[str] class azure.ai.projects.types.VersionIndicator(TypedDict, total=False): - key "agent_version": Required[str] - key "type": Required[Literal[VersionIndicatorType.VERSION_REF]] - agent_version: str - type: Literal[VersionIndicatorType.VERSION_REF] + agent_version: Required[str] + type: Required[Literal[VersionIndicatorType.VERSION_REF]] class azure.ai.projects.types.VersionIndicatorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -19884,24 +19400,18 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VersionRefIndicator(TypedDict, total=False): - key "agent_version": Required[str] - key "type": Required[Literal[VersionIndicatorType.VERSION_REF]] - agent_version: str - type: Literal[VersionIndicatorType.VERSION_REF] + agent_version: Required[str] + type: Required[Literal[VersionIndicatorType.VERSION_REF]] class azure.ai.projects.types.VersionSelectionRule(TypedDict, total=False): - key "agent_version": Required[str] - key "traffic_percentage": Required[int] - key "type": Required[Literal[VersionSelectorType.FIXED_RATIO]] - agent_version: str - traffic_percentage: int - type: Literal[VersionSelectorType.FIXED_RATIO] + agent_version: Required[str] + traffic_percentage: Required[int] + type: Required[Literal[VersionSelectorType.FIXED_RATIO]] class azure.ai.projects.types.VersionSelector(TypedDict, total=False): - key "version_selection_rules": Required[list[VersionSelectionRule]] - version_selection_rules: list[VersionSelectionRule] + version_selection_rules: Required[list[VersionSelectionRule]] class azure.ai.projects.types.VersionSelectorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -19910,16 +19420,16 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceAgentAnimationConfig(TypedDict, total=False): key "model_name": str + key "outputs": list[Union[str, VoiceAgentAnimationOutputType]] model_name: str outputs: list[Union[str, VoiceAgentAnimationOutputType]] class azure.ai.projects.types.VoiceAgentAvatarIceServer(TypedDict, total=False): key "credential": Optional[str] - key "urls": Required[list[str]] key "username": Optional[str] credential: str - urls: list[str] + urls: Required[list[str]] username: str @@ -19948,19 +19458,17 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceAgentAvatarVideoCrop(TypedDict, total=False): - key "bottom_right": Required[list[int]] - key "top_left": Required[list[int]] - bottom_right: list[int] - top_left: list[int] + bottom_right: Required[list[int]] + top_left: Required[list[int]] class azure.ai.projects.types.VoiceAgentAvatarVideoParams(TypedDict, total=False): - key "background": ForwardRef('VoiceAgentAvatarVideoBackground', module='types') + key "background": ForwardRef('VoiceAgentAvatarVideoBackground') key "bitrate": int key "codec": Literal["h264"] - key "crop": ForwardRef('VoiceAgentAvatarVideoCrop', module='types') + key "crop": ForwardRef('VoiceAgentAvatarVideoCrop') key "gop_size": int - key "resolution": ForwardRef('VoiceAgentAvatarVideoResolution', module='types') + key "resolution": ForwardRef('VoiceAgentAvatarVideoResolution') background: VoiceAgentAvatarVideoBackground bitrate: int codec: Literal[h264] @@ -19970,144 +19478,122 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceAgentAvatarVideoResolution(TypedDict, total=False): - key "height": Required[int] - key "width": Required[int] - height: int - width: int + height: Required[int] + width: Required[int] class azure.ai.projects.types.VoiceAgentClientEventConversationItemCreate(TypedDict, total=False): key "event_id": str - key "item": Required[VoiceAgentCreateConversationItem] key "previous_item_id": str - key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE]] event_id: str - item: VoiceAgentCreateConversationItem + item: Required[VoiceAgentCreateConversationItem] previous_item_id: str - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE] + type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE]] class azure.ai.projects.types.VoiceAgentClientEventConversationItemDelete(TypedDict, total=False): key "event_id": str - key "item_id": Required[str] - key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE]] event_id: str - item_id: str - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE] + item_id: Required[str] + type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE]] class azure.ai.projects.types.VoiceAgentClientEventConversationItemRetrieve(TypedDict, total=False): key "event_id": str - key "item_id": Required[str] - key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE]] event_id: str - item_id: str - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE] + item_id: Required[str] + type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE]] class azure.ai.projects.types.VoiceAgentClientEventConversationItemTruncate(TypedDict, total=False): - key "audio_end_ms": Required[int] - key "content_index": Required[int] key "event_id": str - key "item_id": Required[str] - key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE]] - audio_end_ms: int - content_index: int + audio_end_ms: Required[int] + content_index: Required[int] event_id: str - item_id: str - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE] + item_id: Required[str] + type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE]] class azure.ai.projects.types.VoiceAgentClientEventInputAudioBufferAppend(TypedDict, total=False): - key "audio": Required[str] key "event_id": str - key "type": Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND]] - audio: str + audio: Required[str] event_id: str - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND] + type: Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND]] class azure.ai.projects.types.VoiceAgentClientEventInputAudioBufferClear(TypedDict, total=False): key "event_id": str - key "type": Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR]] event_id: str - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR] + type: Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR]] class azure.ai.projects.types.VoiceAgentClientEventInputAudioBufferCommit(TypedDict, total=False): key "event_id": str - key "type": Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT]] event_id: str - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT] + type: Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT]] class azure.ai.projects.types.VoiceAgentClientEventOutputAudioBufferClear(TypedDict, total=False): key "event_id": str - key "type": Required[Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR]] event_id: str - type: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR] + type: Required[Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR]] class azure.ai.projects.types.VoiceAgentClientEventResponseCancel(TypedDict, total=False): key "event_id": str key "response_id": str - key "type": Required[Literal[RealtimeClientEventType.RESPONSE_CANCEL]] event_id: str response_id: str - type: Literal[RealtimeClientEventType.RESPONSE_CANCEL] + type: Required[Literal[RealtimeClientEventType.RESPONSE_CANCEL]] class azure.ai.projects.types.VoiceAgentClientEventResponseCreate(TypedDict, total=False): key "event_id": str - key "response": ForwardRef('VoiceAgentResponseCreateParams', module='types') - key "type": Required[Literal[RealtimeClientEventType.RESPONSE_CREATE]] + key "response": ForwardRef('VoiceAgentResponseCreateParams') event_id: str response: VoiceAgentResponseCreateParams - type: Literal[RealtimeClientEventType.RESPONSE_CREATE] + type: Required[Literal[RealtimeClientEventType.RESPONSE_CREATE]] class azure.ai.projects.types.VoiceAgentClientEventSessionAvatarConnect(TypedDict, total=False): - key "client_sdp": Required[str] key "event_id": str - key "type": Required[Literal["connect"]] - client_sdp: str + client_sdp: Required[str] event_id: str - type: Literal[connect] + type: Required[Literal["connect"]] class azure.ai.projects.types.VoiceAgentClientEventSessionUpdate(TypedDict, total=False): key "event_id": str - key "session": Required[VoiceAgentSessionUpdateConfig] - key "type": Required[Literal[RealtimeClientEventType.SESSION_UPDATE]] event_id: str - session: VoiceAgentSessionUpdateConfig - type: Literal[RealtimeClientEventType.SESSION_UPDATE] + session: Required[VoiceAgentSessionUpdateConfig] + type: Required[Literal[RealtimeClientEventType.SESSION_UPDATE]] class azure.ai.projects.types.VoiceAgentDefinition(TypedDict, total=False): - key "audio": ForwardRef('VoiceAudioConfig', module='types') - key "avatar": ForwardRef('VoiceAvatarConfig', module='types') - key "greeting": ForwardRef('VoiceGreetingConfig', module='types') + key "audio": ForwardRef('VoiceAudioConfig') + key "avatar": ForwardRef('VoiceAvatarConfig') + key "greeting": ForwardRef('VoiceGreetingConfig') + key "include": list[Union[str, VoiceAgentSessionIncludeOption]] key "instructions": str - key "interim_response": ForwardRef('VoiceAgentInterimResponse', module='types') - key "kind": Required[Literal[AgentKind.VOICE]] - key "max_output_tokens": ForwardRef('VoiceAgentMaxOutputTokens', module='types') - key "model": Required[str] - key "model_type": Required[Union[str, VoiceModelType]] + key "interim_response": ForwardRef('VoiceAgentInterimResponse') + key "max_output_tokens": ForwardRef('VoiceAgentMaxOutputTokens') + key "output_modalities": list[Union[str, VoiceOutputModality]] key "parallel_tool_calls": bool - key "rai_config": ForwardRef('RaiConfig', module='types') + key "rai_config": ForwardRef('RaiConfig') key "store": bool - key "tool_choice": ForwardRef('VoiceAgentToolChoice', module='types') + key "structured_inputs": dict[str, StructuredInputDefinition] + key "tool_choice": ForwardRef('VoiceAgentToolChoice') + key "tools": list[VoiceAgentTool] audio: VoiceAudioConfig avatar: VoiceAvatarConfig greeting: VoiceGreetingConfig include: list[Union[str, VoiceAgentSessionIncludeOption]] instructions: str interim_response: VoiceAgentInterimResponse - kind: Literal[AgentKind.VOICE] + kind: Required[Literal[AgentKind.VOICE]] max_output_tokens: VoiceAgentMaxOutputTokens - model: str - model_type: Union[str, VoiceModelType] + model: Required[str] + model_type: Required[Union[str, VoiceModelType]] output_modalities: list[Union[str, VoiceOutputModality]] parallel_tool_calls: bool rai_config: RaiConfig @@ -20120,21 +19606,18 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceAgentEchoCancellation(TypedDict, total=False): key "channels": int key "reference_source": Union[str, VoiceAgentEchoCancellationReferenceSource] - key "type": Required[Literal["server_echo_cancellation"]] channels: int reference_source: Union[str, VoiceAgentEchoCancellationReferenceSource] - type: Literal[server_echo_cancellation] + type: Required[Literal["server_echo_cancellation"]] class azure.ai.projects.types.VoiceAgentFunctionTool(TypedDict, total=False): key "description": str - key "name": Required[str] - key "parameters": ForwardRef('RealtimeFunctionToolParameters', module='types') - key "type": Required[Literal["function"]] + key "parameters": ForwardRef('RealtimeFunctionToolParameters') description: str - name: str + name: Required[str] parameters: RealtimeFunctionToolParameters - type: Literal[function] + type: Required[Literal["function"]] class azure.ai.projects.types.VoiceAgentLlmInterimResponseConfig(TypedDict, total=False): @@ -20142,13 +19625,13 @@ namespace azure.ai.projects.types key "latency_threshold_ms": int key "max_completion_tokens": int key "model": str - key "type": Required[Literal["llm_interim_response"]] + key "triggers": list[Union[str, VoiceAgentInterimResponseTrigger]] instructions: str latency_threshold_ms: int max_completion_tokens: int model: str triggers: list[Union[str, VoiceAgentInterimResponseTrigger]] - type: Literal[llm_interim_response] + type: Required[Literal["llm_interim_response"]] class azure.ai.projects.types.VoiceAgentMcpTool(TypedDict, total=False): @@ -20161,9 +19644,8 @@ namespace azure.ai.projects.types key "require_approval": Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] key "response_scheduling": Union[str, VoiceAgentToolResponseScheduling] key "server_description": str - key "server_label": Required[str] key "server_url": str - key "type": Required[Literal["mcp"]] + key "tool_configs": dict[str, ToolConfig] allowed_callers: list[Union[str, CallableToolAllowedCaller]] allowed_tools: Union[list[str], MCPToolFilter] authorization: str @@ -20173,22 +19655,24 @@ namespace azure.ai.projects.types require_approval: Union[MCPToolRequireApproval, Literal[always], Literal[never]] response_scheduling: Union[str, VoiceAgentToolResponseScheduling] server_description: str - server_label: str + server_label: Required[str] server_url: str tool_configs: dict[str, ToolConfig] - type: Literal[mcp] + type: Required[Literal["mcp"]] class azure.ai.projects.types.VoiceAgentRealtimeResponse(OmitPropertiesRealtimeResponse1): - key "audio": ForwardRef('VoiceResponseAudio', module='types') + key "audio": ForwardRef('VoiceResponseAudio') key "conversation_id": str key "id": str key "max_output_tokens": Union[int, Literal["inf"]] key "metadata": Optional[Metadata] key "object": Literal["response"] + key "output": list[VoiceAgentResponseItem] + key "output_modalities": list[Literal["text", "audio"]] key "status": Literal["completed", "cancelled", "failed", "incomplete", "in_progress"] - key "status_details": ForwardRef('RealtimeResponseStatusDetails', module='types') - key "usage": ForwardRef('RealtimeResponseUsage', module='types') + key "status_details": ForwardRef('RealtimeResponseStatusDetails') + key "usage": ForwardRef('RealtimeResponseUsage') audio: VoiceResponseAudio conversation_id: str id: str @@ -20196,23 +19680,26 @@ namespace azure.ai.projects.types metadata: Metadata object: Literal[response] output: list[VoiceAgentResponseItem] - output_modalities: list[Literal["text", "audio"]] + output_modalities: list[Literal[text, audio]] status: Literal[completed, cancelled, failed, incomplete, in_progress] status_details: RealtimeResponseStatusDetails usage: RealtimeResponseUsage class azure.ai.projects.types.VoiceAgentResponseCreateParams(TypedDict, total=False): - key "audio": ForwardRef('PickPropertiesVoiceAudioConfig', module='types') + key "audio": ForwardRef('PickPropertiesVoiceAudioConfig') key "conversation": Union[Literal["auto"], Literal["none"], str] + key "input": list[RealtimeConversationItem] key "instructions": str key "interim_response": Optional[VoiceAgentInterimResponse] key "max_output_tokens": Union[int, Literal["inf"]] key "metadata": Optional[Metadata] + key "output_modalities": list[Union[str, VoiceOutputModality]] key "parallel_tool_calls": bool key "pre_generated_assistant_message": Optional[RealtimeConversationItemMessageAssistant] - key "reasoning": ForwardRef('RealtimeReasoning', module='types') + key "reasoning": ForwardRef('RealtimeReasoning') key "tool_choice": Union[str, ToolChoiceOptions, ToolChoiceFunction, ToolChoiceMCP] + key "tools": list[Union[RealtimeFunctionTool, MCPTool]] audio: PickPropertiesVoiceAudioConfig conversation: Union[Literal[auto], Literal[none], str] input: list[RealtimeConversationItem] @@ -20230,7 +19717,7 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceAgentResponseEventContentPart(TypedDict, total=False): key "audio": str - key "format": ForwardRef('VoiceAudioFormat', module='types') + key "format": ForwardRef('VoiceAudioFormat') key "text": str key "transcript": str key "type": Literal["audio", "text"] @@ -20246,700 +19733,453 @@ namespace azure.ai.projects.types key "create_response": bool key "eagerness": Literal["low", "medium", "high", "auto"] key "interrupt_response": bool - key "type": Required[Literal[VoiceTurnDetectionType.SEMANTIC_VAD]] auto_truncate: bool create_response: bool eagerness: Literal[low, medium, high, auto] interrupt_response: bool - type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD] + type: Required[Literal[VoiceTurnDetectionType.SEMANTIC_VAD]] class azure.ai.projects.types.VoiceAgentServerEventConversationItemAdded(TypedDict, total=False): - key "event_id": Required[str] - key "item": Required[VoiceAgentResponseItem] key "previous_item_id": Optional[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED]] - event_id: str - item: VoiceAgentResponseItem + event_id: Required[str] + item: Required[VoiceAgentResponseItem] previous_item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED] + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED]] class azure.ai.projects.types.VoiceAgentServerEventConversationItemCreated(TypedDict, total=False): - key "event_id": Required[str] - key "item": Required[VoiceAgentResponseItem] key "previous_item_id": Optional[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED]] - event_id: str - item: VoiceAgentResponseItem + event_id: Required[str] + item: Required[VoiceAgentResponseItem] previous_item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED] + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED]] class azure.ai.projects.types.VoiceAgentServerEventConversationItemDeleted(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED]] - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED] + event_id: Required[str] + item_id: Required[str] + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED]] class azure.ai.projects.types.VoiceAgentServerEventConversationItemDone(TypedDict, total=False): - key "event_id": Required[str] - key "item": Required[VoiceAgentResponseItem] key "previous_item_id": Optional[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE]] - event_id: str - item: VoiceAgentResponseItem + event_id: Required[str] + item: Required[VoiceAgentResponseItem] previous_item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE] + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE]] class azure.ai.projects.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] key "logprobs": Optional[list[LogProbProperties]] key "phrases": Optional[list[VoiceAgentTranscriptionPhrase]] - key "transcript": Required[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED]] - key "usage": Required[Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration]] - content_index: int - event_id: str - item_id: str + content_index: Required[int] + event_id: Required[str] + item_id: Required[str] logprobs: list[LogProbProperties] phrases: list[VoiceAgentTranscriptionPhrase] - transcript: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED] - usage: Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration] + transcript: Required[str] + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED]] + usage: Required[Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration]] class azure.ai.projects.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta(TypedDict, total=False): key "content_index": int key "delta": str - key "event_id": Required[str] - key "item_id": Required[str] key "logprobs": Optional[list[LogProbProperties]] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA]] content_index: int delta: str - event_id: str - item_id: str + event_id: Required[str] + item_id: Required[str] logprobs: list[LogProbProperties] - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA] + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA]] class azure.ai.projects.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed(TypedDict, total=False): - key "content_index": Required[int] - key "error": Required[RealtimeServerEventConversationItemInputAudioTranscriptionFailedError] - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED]] - content_index: int - error: RealtimeServerEventConversationItemInputAudioTranscriptionFailedError - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED] + content_index: Required[int] + error: Required[RealtimeServerEventConversationItemInputAudioTranscriptionFailedError] + event_id: Required[str] + item_id: Required[str] + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED]] class azure.ai.projects.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment(TypedDict, total=False): - key "content_index": Required[int] - key "end": Required[float] - key "event_id": Required[str] - key "id": Required[str] - key "item_id": Required[str] - key "speaker": Required[str] - key "start": Required[float] - key "text": Required[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT]] - content_index: int - end: float - event_id: str - id: str - item_id: str - speaker: str - start: float - text: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT] + content_index: Required[int] + end: Required[float] + event_id: Required[str] + id: Required[str] + item_id: Required[str] + speaker: Required[str] + start: Required[float] + text: Required[str] + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT]] class azure.ai.projects.types.VoiceAgentServerEventConversationItemRetrieved(TypedDict, total=False): - key "event_id": Required[str] - key "item": Required[VoiceAgentResponseItem] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED]] - event_id: str - item: VoiceAgentResponseItem - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED] + event_id: Required[str] + item: Required[VoiceAgentResponseItem] + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED]] class azure.ai.projects.types.VoiceAgentServerEventConversationItemTruncated(TypedDict, total=False): - key "audio_end_ms": Required[int] - key "content_index": Required[int] - key "event_id": Required[str] - key "item": ForwardRef('RealtimeConversationItemMessageAssistant', module='types') - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED]] - audio_end_ms: int - content_index: int - event_id: str + key "item": ForwardRef('RealtimeConversationItemMessageAssistant') + audio_end_ms: Required[int] + content_index: Required[int] + event_id: Required[str] item: RealtimeConversationItemMessageAssistant - item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED] + item_id: Required[str] + type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED]] class azure.ai.projects.types.VoiceAgentServerEventInputAudioBufferCleared(TypedDict, total=False): - key "event_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED]] - event_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED] + event_id: Required[str] + type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED]] class azure.ai.projects.types.VoiceAgentServerEventInputAudioBufferCommitted(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] key "previous_item_id": Optional[str] - key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED]] - event_id: str - item_id: str + event_id: Required[str] + item_id: Required[str] previous_item_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED] + type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED]] class azure.ai.projects.types.VoiceAgentServerEventInputAudioBufferSpeechStarted(TypedDict, total=False): - key "audio_start_ms": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED]] - audio_start_ms: int - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED] + audio_start_ms: Required[int] + event_id: Required[str] + item_id: Required[str] + type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED]] class azure.ai.projects.types.VoiceAgentServerEventInputAudioBufferSpeechStopped(TypedDict, total=False): - key "audio_end_ms": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED]] - audio_end_ms: int - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED] + audio_end_ms: Required[int] + event_id: Required[str] + item_id: Required[str] + type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED]] class azure.ai.projects.types.VoiceAgentServerEventInputAudioBufferTimeoutTriggered(TypedDict, total=False): - key "audio_end_ms": Required[int] - key "audio_start_ms": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED]] - audio_end_ms: int - audio_start_ms: int - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED] + audio_end_ms: Required[int] + audio_start_ms: Required[int] + event_id: Required[str] + item_id: Required[str] + type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED]] class azure.ai.projects.types.VoiceAgentServerEventMcpListToolsCompleted(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED]] - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED] + event_id: Required[str] + item_id: Required[str] + type: Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED]] class azure.ai.projects.types.VoiceAgentServerEventMcpListToolsFailed(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED]] - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED] + event_id: Required[str] + item_id: Required[str] + type: Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED]] class azure.ai.projects.types.VoiceAgentServerEventMcpListToolsInProgress(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS]] - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS] + event_id: Required[str] + item_id: Required[str] + type: Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS]] class azure.ai.projects.types.VoiceAgentServerEventOutputAudioBufferCleared(TypedDict, total=False): - key "event_id": Required[str] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED]] - event_id: str - response_id: str - type: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED] + event_id: Required[str] + response_id: Required[str] + type: Required[Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED]] class azure.ai.projects.types.VoiceAgentServerEventRateLimitsUpdated(TypedDict, total=False): - key "event_id": Required[str] - key "rate_limits": Required[list[RealtimeServerEventRateLimitsUpdatedRateLimits]] - key "type": Required[Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED]] - event_id: str - rate_limits: list[RealtimeServerEventRateLimitsUpdatedRateLimits] - type: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED] + event_id: Required[str] + rate_limits: Required[list[RealtimeServerEventRateLimitsUpdatedRateLimits]] + type: Required[Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED]] class azure.ai.projects.types.VoiceAgentServerEventResponseAnimationBlendshapesDelta(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "frame_index": Required[int] - key "frames": Required[list[list[float]]] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal["delta"]] - content_index: int - event_id: str - frame_index: int - frames: list[list[float]] - item_id: str - output_index: int - response_id: str - type: Literal[delta] + content_index: Required[int] + event_id: Required[str] + frame_index: Required[int] + frames: Required[list[list[float]]] + item_id: Required[str] + output_index: Required[int] + response_id: Required[str] + type: Required[Literal["delta"]] class azure.ai.projects.types.VoiceAgentServerEventResponseAnimationBlendshapesDone(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal["done"]] - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[done] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + response_id: Required[str] + type: Required[Literal["done"]] class azure.ai.projects.types.VoiceAgentServerEventResponseAnimationVisemeDelta(TypedDict, total=False): - key "audio_offset_ms": Required[int] - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal["delta"]] - key "viseme_id": Required[int] - audio_offset_ms: int - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[delta] - viseme_id: int + audio_offset_ms: Required[int] + content_index: Required[int] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + response_id: Required[str] + type: Required[Literal["delta"]] + viseme_id: Required[int] class azure.ai.projects.types.VoiceAgentServerEventResponseAnimationVisemeDone(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal["done"]] - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[done] + content_index: Required[int] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + response_id: Required[str] + type: Required[Literal["done"]] class azure.ai.projects.types.VoiceAgentServerEventResponseAudioDelta(TypedDict, total=False): - key "content_index": Required[int] - key "delta": Required[str] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA]] - content_index: int - delta: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA] + content_index: Required[int] + delta: Required[str] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + response_id: Required[str] + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA]] class azure.ai.projects.types.VoiceAgentServerEventResponseAudioDone(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE]] - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE] + content_index: Required[int] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + response_id: Required[str] + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE]] class azure.ai.projects.types.VoiceAgentServerEventResponseAudioTimestampDelta(TypedDict, total=False): - key "audio_duration_ms": Required[int] - key "audio_offset_ms": Required[int] - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "text": Required[str] - key "timestamp_type": Required[Literal["word"]] - key "type": Required[Literal["delta"]] - audio_duration_ms: int - audio_offset_ms: int - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - text: str - timestamp_type: Literal[word] - type: Literal[delta] + audio_duration_ms: Required[int] + audio_offset_ms: Required[int] + content_index: Required[int] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + response_id: Required[str] + text: Required[str] + timestamp_type: Required[Literal["word"]] + type: Required[Literal["delta"]] class azure.ai.projects.types.VoiceAgentServerEventResponseAudioTimestampDone(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal["done"]] - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[done] + content_index: Required[int] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + response_id: Required[str] + type: Required[Literal["done"]] class azure.ai.projects.types.VoiceAgentServerEventResponseAudioTranscriptDelta(TypedDict, total=False): - key "content_index": Required[int] - key "delta": Required[str] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA]] - content_index: int - delta: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA] + content_index: Required[int] + delta: Required[str] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + response_id: Required[str] + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA]] class azure.ai.projects.types.VoiceAgentServerEventResponseAudioTranscriptDone(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "transcript": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE]] - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - transcript: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE] + content_index: Required[int] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + response_id: Required[str] + transcript: Required[str] + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE]] class azure.ai.projects.types.VoiceAgentServerEventResponseContentPartDone(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "part": Required[VoiceAgentResponseEventContentPart] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE]] - content_index: int - event_id: str - item_id: str - output_index: int - part: VoiceAgentResponseEventContentPart - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE] + content_index: Required[int] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + part: Required[VoiceAgentResponseEventContentPart] + response_id: Required[str] + type: Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE]] class azure.ai.projects.types.VoiceAgentServerEventResponseCreated(TypedDict, total=False): - key "event_id": Required[str] - key "response": Required[VoiceAgentRealtimeResponse] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CREATED]] - event_id: str - response: VoiceAgentRealtimeResponse - type: Literal[RealtimeServerEventType.RESPONSE_CREATED] + event_id: Required[str] + response: Required[VoiceAgentRealtimeResponse] + type: Required[Literal[RealtimeServerEventType.RESPONSE_CREATED]] class azure.ai.projects.types.VoiceAgentServerEventResponseDone(TypedDict, total=False): - key "event_id": Required[str] - key "response": Required[VoiceAgentRealtimeResponse] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_DONE]] - event_id: str - response: VoiceAgentRealtimeResponse - type: Literal[RealtimeServerEventType.RESPONSE_DONE] + event_id: Required[str] + response: Required[VoiceAgentRealtimeResponse] + type: Required[Literal[RealtimeServerEventType.RESPONSE_DONE]] class azure.ai.projects.types.VoiceAgentServerEventResponseFunctionCallArgumentsDelta(TypedDict, total=False): - key "call_id": Required[str] - key "delta": Required[str] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA]] - call_id: str - delta: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA] + call_id: Required[str] + delta: Required[str] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + response_id: Required[str] + type: Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA]] class azure.ai.projects.types.VoiceAgentServerEventResponseFunctionCallArgumentsDone(TypedDict, total=False): - key "arguments": Required[str] - key "call_id": Required[str] - key "event_id": Required[str] - key "item_id": Required[str] - key "name": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE]] - arguments: str - call_id: str - event_id: str - item_id: str - name: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE] + arguments: Required[str] + call_id: Required[str] + event_id: Required[str] + item_id: Required[str] + name: Required[str] + output_index: Required[int] + response_id: Required[str] + type: Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE]] class azure.ai.projects.types.VoiceAgentServerEventResponseMcpCallArgumentsDelta(TypedDict, total=False): - key "delta": Required[str] - key "event_id": Required[str] - key "item_id": Required[str] key "obfuscation": Optional[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA]] - delta: str - event_id: str - item_id: str + delta: Required[str] + event_id: Required[str] + item_id: Required[str] obfuscation: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA] + output_index: Required[int] + response_id: Required[str] + type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA]] class azure.ai.projects.types.VoiceAgentServerEventResponseMcpCallArgumentsDone(TypedDict, total=False): - key "arguments": Required[str] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE]] - arguments: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE] + arguments: Required[str] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + response_id: Required[str] + type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE]] class azure.ai.projects.types.VoiceAgentServerEventResponseMcpCallCompleted(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED]] - event_id: str - item_id: str - output_index: int - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED]] class azure.ai.projects.types.VoiceAgentServerEventResponseMcpCallFailed(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED]] - event_id: str - item_id: str - output_index: int - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED]] class azure.ai.projects.types.VoiceAgentServerEventResponseMcpCallInProgress(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS]] - event_id: str - item_id: str - output_index: int - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS]] class azure.ai.projects.types.VoiceAgentServerEventResponseOutputItemAdded(TypedDict, total=False): - key "event_id": Required[str] - key "item": Required[VoiceAgentResponseItem] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED]] - event_id: str - item: VoiceAgentResponseItem - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED] + event_id: Required[str] + item: Required[VoiceAgentResponseItem] + output_index: Required[int] + response_id: Required[str] + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED]] class azure.ai.projects.types.VoiceAgentServerEventResponseOutputItemDone(TypedDict, total=False): - key "event_id": Required[str] - key "item": Required[VoiceAgentResponseItem] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE]] - event_id: str - item: VoiceAgentResponseItem - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE] + event_id: Required[str] + item: Required[VoiceAgentResponseItem] + output_index: Required[int] + response_id: Required[str] + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE]] class azure.ai.projects.types.VoiceAgentServerEventResponseTextDelta(TypedDict, total=False): - key "content_index": Required[int] - key "delta": Required[str] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA]] - content_index: int - delta: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA] + content_index: Required[int] + delta: Required[str] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + response_id: Required[str] + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA]] class azure.ai.projects.types.VoiceAgentServerEventResponseTextDone(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "text": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE]] - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - text: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE] + content_index: Required[int] + event_id: Required[str] + item_id: Required[str] + output_index: Required[int] + response_id: Required[str] + text: Required[str] + type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE]] class azure.ai.projects.types.VoiceAgentServerEventResponseVideoDelta(TypedDict, total=False): - key "codec": Required[str] - key "delta": Required[str] - key "event_id": Required[str] - key "output_index": Required[int] - key "type": Required[Literal["delta"]] - codec: str - delta: str - event_id: str - output_index: int - type: Literal[delta] + codec: Required[str] + delta: Required[str] + event_id: Required[str] + output_index: Required[int] + type: Required[Literal["delta"]] class azure.ai.projects.types.VoiceAgentServerEventSessionAvatarConnecting(TypedDict, total=False): - key "event_id": Required[str] - key "server_sdp": Required[str] - key "type": Required[Literal["connecting"]] - event_id: str - server_sdp: str - type: Literal[connecting] + event_id: Required[str] + server_sdp: Required[str] + type: Required[Literal["connecting"]] class azure.ai.projects.types.VoiceAgentServerEventSessionAvatarSwitchToIdle(TypedDict, total=False): - key "event_id": Required[str] key "turn_id": str - key "type": Required[Literal["switch_to_idle"]] - event_id: str + event_id: Required[str] turn_id: str - type: Literal[switch_to_idle] + type: Required[Literal["switch_to_idle"]] class azure.ai.projects.types.VoiceAgentServerEventSessionAvatarSwitchToSpeaking(TypedDict, total=False): - key "event_id": Required[str] key "turn_id": str - key "type": Required[Literal["switch_to_speaking"]] - event_id: str + event_id: Required[str] turn_id: str - type: Literal[switch_to_speaking] + type: Required[Literal["switch_to_speaking"]] class azure.ai.projects.types.VoiceAgentServerEventSessionCreated(TypedDict, total=False): - key "event_id": Required[str] - key "session": Required[VoiceAgentSessionResponseConfig] - key "type": Required[Literal[RealtimeServerEventType.SESSION_CREATED]] - event_id: str - session: VoiceAgentSessionResponseConfig - type: Literal[RealtimeServerEventType.SESSION_CREATED] + event_id: Required[str] + session: Required[VoiceAgentSessionResponseConfig] + type: Required[Literal[RealtimeServerEventType.SESSION_CREATED]] class azure.ai.projects.types.VoiceAgentServerEventSessionUpdated(TypedDict, total=False): - key "event_id": Required[str] - key "session": Required[VoiceAgentSessionResponseConfig] - key "type": Required[Literal[RealtimeServerEventType.SESSION_UPDATED]] - event_id: str - session: VoiceAgentSessionResponseConfig - type: Literal[RealtimeServerEventType.SESSION_UPDATED] + event_id: Required[str] + session: Required[VoiceAgentSessionResponseConfig] + type: Required[Literal[RealtimeServerEventType.SESSION_UPDATED]] class azure.ai.projects.types.VoiceAgentServerEventWarning(TypedDict, total=False): - key "event_id": Required[str] - key "type": Required[Literal["warning"]] - key "warning": Required[VoiceAgentServerEventWarningDetails] - event_id: str - type: Literal[warning] - warning: VoiceAgentServerEventWarningDetails + event_id: Required[str] + type: Required[Literal["warning"]] + warning: Required[VoiceAgentServerEventWarningDetails] class azure.ai.projects.types.VoiceAgentServerEventWarningDetails(TypedDict, total=False): key "code": str - key "message": Required[str] key "param": str code: str - message: str + message: Required[str] param: str class azure.ai.projects.types.VoiceAgentSessionAvatarConfig(VoiceAvatarConfig): - key "character": Required[str] key "customized": bool key "ice_servers": Optional[list[VoiceAgentAvatarIceServer]] key "model": str key "output_audit_audio": bool key "output_protocol": Union[str, VoiceAvatarOutputProtocol] - key "scene": ForwardRef('VoiceAgentAvatarScene', module='types') + key "scene": ForwardRef('VoiceAgentAvatarScene') key "style": str - key "type": Required[Union[str, VoiceAvatarType]] - key "video": ForwardRef('VoiceAgentAvatarVideoParams', module='types') - character: str + key "video": ForwardRef('VoiceAgentAvatarVideoParams') + character: Required[str] customized: bool ice_servers: list[VoiceAgentAvatarIceServer] model: str @@ -20947,62 +20187,65 @@ namespace azure.ai.projects.types output_protocol: Union[str, VoiceAvatarOutputProtocol] scene: VoiceAgentAvatarScene style: str - type: Union[str, VoiceAvatarType] + type: Required[Union[str, VoiceAvatarType]] video: VoiceAgentAvatarVideoParams class azure.ai.projects.types.VoiceAgentSessionResponseConfig(TypedDict, total=False): - key "animation": ForwardRef('VoiceAgentAnimationConfig', module='types') - key "audio": ForwardRef('VoiceAudioConfig', module='types') - key "avatar": ForwardRef('VoiceAgentSessionAvatarConfig', module='types') + key "animation": ForwardRef('VoiceAgentAnimationConfig') + key "audio": ForwardRef('VoiceAudioConfig') + key "avatar": ForwardRef('VoiceAgentSessionAvatarConfig') key "expires_at": Optional[int] - key "greeting": ForwardRef('VoiceGreetingConfig', module='types') - key "id": Required[str] + key "greeting": ForwardRef('VoiceGreetingConfig') + key "include": list[Union[str, VoiceAgentSessionIncludeOption]] key "instructions": str - key "interim_response": ForwardRef('VoiceAgentInterimResponse', module='types') - key "max_output_tokens": ForwardRef('VoiceAgentMaxOutputTokens', module='types') - key "model": Required[str] - key "object": Required[Literal["session"]] + key "interim_response": ForwardRef('VoiceAgentInterimResponse') + key "max_output_tokens": ForwardRef('VoiceAgentMaxOutputTokens') + key "metadata": dict[str, str] + key "output_modalities": list[Union[str, VoiceOutputModality]] key "parallel_tool_calls": bool - key "reasoning": ForwardRef('RealtimeReasoning', module='types') + key "reasoning": ForwardRef('RealtimeReasoning') key "temperature": float - key "tool_choice": ForwardRef('VoiceAgentToolChoice', module='types') - key "type": Required[Literal["realtime"]] + key "tool_choice": ForwardRef('VoiceAgentToolChoice') + key "tools": list[VoiceAgentTool] animation: VoiceAgentAnimationConfig audio: VoiceAudioConfig avatar: VoiceAgentSessionAvatarConfig expires_at: int greeting: VoiceGreetingConfig - id: str + id: Required[str] include: list[Union[str, VoiceAgentSessionIncludeOption]] instructions: str interim_response: VoiceAgentInterimResponse max_output_tokens: VoiceAgentMaxOutputTokens metadata: dict[str, str] - model: str - object: Literal[session] + model: Required[str] + object: Required[Literal["session"]] output_modalities: list[Union[str, VoiceOutputModality]] parallel_tool_calls: bool reasoning: RealtimeReasoning temperature: float tool_choice: VoiceAgentToolChoice tools: list[VoiceAgentTool] - type: Literal[realtime] + type: Required[Literal["realtime"]] class azure.ai.projects.types.VoiceAgentSessionUpdateConfig(TypedDict, total=False): - key "animation": ForwardRef('VoiceAgentAnimationConfig', module='types') - key "audio": ForwardRef('VoiceAudioConfig', module='types') - key "avatar": ForwardRef('VoiceAgentSessionAvatarConfig', module='types') - key "greeting": ForwardRef('VoiceGreetingConfig', module='types') + key "animation": ForwardRef('VoiceAgentAnimationConfig') + key "audio": ForwardRef('VoiceAudioConfig') + key "avatar": ForwardRef('VoiceAgentSessionAvatarConfig') + key "greeting": ForwardRef('VoiceGreetingConfig') + key "include": list[Union[str, VoiceAgentSessionIncludeOption]] key "instructions": str - key "interim_response": ForwardRef('VoiceAgentInterimResponse', module='types') - key "max_output_tokens": ForwardRef('VoiceAgentMaxOutputTokens', module='types') + key "interim_response": ForwardRef('VoiceAgentInterimResponse') + key "max_output_tokens": ForwardRef('VoiceAgentMaxOutputTokens') + key "metadata": dict[str, str] + key "output_modalities": list[Union[str, VoiceOutputModality]] key "parallel_tool_calls": bool - key "reasoning": ForwardRef('RealtimeReasoning', module='types') + key "reasoning": ForwardRef('RealtimeReasoning') key "temperature": float - key "tool_choice": ForwardRef('VoiceAgentToolChoice', module='types') - key "type": Required[Literal["realtime"]] + key "tool_choice": ForwardRef('VoiceAgentToolChoice') + key "tools": list[VoiceAgentTool] animation: VoiceAgentAnimationConfig audio: VoiceAudioConfig avatar: VoiceAgentSessionAvatarConfig @@ -21018,78 +20261,69 @@ namespace azure.ai.projects.types temperature: float tool_choice: VoiceAgentToolChoice tools: list[VoiceAgentTool] - type: Literal[realtime] + type: Required[Literal["realtime"]] class azure.ai.projects.types.VoiceAgentStaticInterimResponseConfig(TypedDict, total=False): key "latency_threshold_ms": int - key "type": Required[Literal["static_interim_response"]] + key "texts": list[str] + key "triggers": list[Union[str, VoiceAgentInterimResponseTrigger]] latency_threshold_ms: int texts: list[str] triggers: list[Union[str, VoiceAgentInterimResponseTrigger]] - type: Literal[static_interim_response] + type: Required[Literal["static_interim_response"]] class azure.ai.projects.types.VoiceAgentTranscriptionPhrase(TypedDict, total=False): key "confidence": Optional[float] - key "duration_milliseconds": Required[int] key "locale": Optional[str] - key "offset_milliseconds": Required[int] - key "text": Required[str] key "words": Optional[list[VoiceAgentTranscriptionWord]] confidence: float - duration_milliseconds: int + duration_milliseconds: Required[int] locale: str - offset_milliseconds: int - text: str + offset_milliseconds: Required[int] + text: Required[str] words: list[VoiceAgentTranscriptionWord] class azure.ai.projects.types.VoiceAgentTranscriptionWord(TypedDict, total=False): - key "duration_milliseconds": Required[int] - key "offset_milliseconds": Required[int] - key "text": Required[str] - duration_milliseconds: int - offset_milliseconds: int - text: str + duration_milliseconds: Required[int] + offset_milliseconds: Required[int] + text: Required[str] class azure.ai.projects.types.VoiceAssistantMessageItem(TypedDict, total=False): - key "content": Required[list[RealtimeConversationItemMessageAssistantContent]] key "created_at": int key "id": str key "object": Literal["item"] key "response_id": str - key "role": Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal[VoiceConversationItemType.MESSAGE]] - content: list[RealtimeConversationItemMessageAssistantContent] + content: Required[list[RealtimeConversationItemMessageAssistantContent]] created_at: int id: str object: Literal[item] response_id: str - role: Literal[RealtimeConversationItemMessageType.ASSISTANT] + role: Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] status: Literal[completed, incomplete, in_progress] - type: Literal[VoiceConversationItemType.MESSAGE] + type: Required[Literal[VoiceConversationItemType.MESSAGE]] class azure.ai.projects.types.VoiceAudioConfig(TypedDict, total=False): - key "input": ForwardRef('VoiceAudioInputConfig', module='types') - key "output": ForwardRef('VoiceAudioOutputConfig', module='types') + key "input": ForwardRef('VoiceAudioInputConfig') + key "output": ForwardRef('VoiceAudioOutputConfig') input: VoiceAudioInputConfig output: VoiceAudioOutputConfig class azure.ai.projects.types.VoiceAudioFormat(TypedDict, total=False): key "rate": int - key "type": Required[Union[str, VoiceAudioFormatType]] rate: int - type: Union[str, VoiceAudioFormatType] + type: Required[Union[str, VoiceAudioFormatType]] class azure.ai.projects.types.VoiceAudioInputConfig(TypedDict, total=False): key "echo_cancellation": Optional[VoiceAgentEchoCancellation] - key "format": ForwardRef('VoiceAudioFormat', module='types') + key "format": ForwardRef('VoiceAudioFormat') key "noise_reduction": Optional[VoiceNoiseReduction] key "transcription": Optional[VoiceInputTranscription] key "turn_detection": Optional[VoiceAgentTurnDetection] @@ -21104,9 +20338,11 @@ namespace azure.ai.projects.types key "custom_lexicon_url": str key "custom_text_normalization_url": str key "custom_voice_endpoint_id": str - key "format": ForwardRef('VoiceAudioFormat', module='types') + key "format": ForwardRef('VoiceAudioFormat') + key "output_audio_timestamp_types": list[Union[str, VoiceAudioTimestampType]] key "personal_voice_model": str key "pitch": str + key "prefer_locales": list[str] key "speed": float key "style": str key "voice": str @@ -21132,23 +20368,21 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceAvatarConfig(TypedDict, total=False): - key "character": Required[str] key "customized": bool key "model": str key "output_audit_audio": bool key "output_protocol": Union[str, VoiceAvatarOutputProtocol] - key "scene": ForwardRef('VoiceAgentAvatarScene', module='types') + key "scene": ForwardRef('VoiceAgentAvatarScene') key "style": str - key "type": Required[Union[str, VoiceAvatarType]] - key "video": ForwardRef('VoiceAgentAvatarVideoParams', module='types') - character: str + key "video": ForwardRef('VoiceAgentAvatarVideoParams') + character: Required[str] customized: bool model: str output_audit_audio: bool output_protocol: Union[str, VoiceAvatarOutputProtocol] scene: VoiceAgentAvatarScene style: str - type: Union[str, VoiceAvatarType] + type: Required[Union[str, VoiceAvatarType]] video: VoiceAgentAvatarVideoParams @@ -21163,7 +20397,6 @@ namespace azure.ai.projects.types key "silence_duration_ms": str key "speech_duration_ms": str key "threshold": float - key "type": Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN]] auto_truncate: bool create_response: bool end_of_utterance_detection: VoiceEndOfUtteranceDetection @@ -21174,7 +20407,7 @@ namespace azure.ai.projects.types silence_duration_ms: str speech_duration_ms: str threshold: float - type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN] + type: Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN]] class azure.ai.projects.types.VoiceAzureSemanticVadMultilingualTurnDetection(TypedDict, total=False): @@ -21183,12 +20416,12 @@ namespace azure.ai.projects.types key "end_of_utterance_detection": Optional[VoiceEndOfUtteranceDetection] key "idle_timeout_ms": str key "interrupt_response": bool + key "languages": list[str] key "prefix_padding_ms": str key "remove_filler_words": bool key "silence_duration_ms": str key "speech_duration_ms": str key "threshold": float - key "type": Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL]] auto_truncate: bool create_response: bool end_of_utterance_detection: VoiceEndOfUtteranceDetection @@ -21200,7 +20433,7 @@ namespace azure.ai.projects.types silence_duration_ms: str speech_duration_ms: str threshold: float - type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] + type: Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL]] class azure.ai.projects.types.VoiceAzureSemanticVadTurnDetection(TypedDict, total=False): @@ -21209,12 +20442,12 @@ namespace azure.ai.projects.types key "end_of_utterance_detection": Optional[VoiceEndOfUtteranceDetection] key "idle_timeout_ms": str key "interrupt_response": bool + key "languages": list[str] key "prefix_padding_ms": str key "remove_filler_words": bool key "silence_duration_ms": str key "speech_duration_ms": str key "threshold": float - key "type": Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD]] auto_truncate: bool create_response: bool end_of_utterance_detection: VoiceEndOfUtteranceDetection @@ -21226,7 +20459,7 @@ namespace azure.ai.projects.types silence_duration_ms: str speech_duration_ms: str threshold: float - type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD] + type: Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD]] class azure.ai.projects.types.VoiceConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -21240,153 +20473,129 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceEndOfUtteranceDetection(TypedDict, total=False): - key "model": Required[Union[str, VoiceEndOfUtteranceDetectionModel]] key "threshold_level": Union[str, VoiceEndOfUtteranceThresholdLevel] key "timeout_ms": str - model: Union[str, VoiceEndOfUtteranceDetectionModel] + model: Required[Union[str, VoiceEndOfUtteranceDetectionModel]] threshold_level: Union[str, VoiceEndOfUtteranceThresholdLevel] timeout_ms: str class azure.ai.projects.types.VoiceFunctionCallItem(TypedDict, total=False): - key "arguments": Required[str] key "call_id": str key "created_at": int key "id": str - key "name": Required[str] key "object": Literal["item"] key "response_id": str key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal[VoiceConversationItemType.FUNCTION_CALL]] - arguments: str + arguments: Required[str] call_id: str created_at: int id: str - name: str + name: Required[str] object: Literal[item] response_id: str status: Literal[completed, incomplete, in_progress] - type: Literal[VoiceConversationItemType.FUNCTION_CALL] + type: Required[Literal[VoiceConversationItemType.FUNCTION_CALL]] class azure.ai.projects.types.VoiceFunctionCallOutputItem(TypedDict, total=False): - key "call_id": Required[str] key "created_at": int key "id": str key "name": str key "object": Literal["item"] - key "output": Required[str] key "response_id": str key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT]] - call_id: str + call_id: Required[str] created_at: int id: str name: str object: Literal[item] - output: str + output: Required[str] response_id: str status: Literal[completed, incomplete, in_progress] - type: Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT] + type: Required[Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT]] class azure.ai.projects.types.VoiceInputTranscription(TypedDict, total=False): + key "custom_speech": dict[str, str] key "delay": Literal["minimal", "low", "medium", "high", "xhigh"] key "language": str - key "model": Required[Union[str, VoiceInputTranscriptionModel]] + key "phrase_list": list[str] key "prompt": str custom_speech: dict[str, str] delay: Literal[minimal, low, medium, high, xhigh] language: str - model: Union[str, VoiceInputTranscriptionModel] + model: Required[Union[str, VoiceInputTranscriptionModel]] phrase_list: list[str] prompt: str class azure.ai.projects.types.VoiceMcpApprovalRequestItem(TypedDict, total=False): - key "arguments": Required[str] key "created_at": int - key "id": Required[str] - key "name": Required[str] key "response_id": str - key "server_label": Required[str] - key "type": Required[Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST]] - arguments: str + arguments: Required[str] created_at: int - id: str - name: str + id: Required[str] + name: Required[str] response_id: str - server_label: str - type: Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST] + server_label: Required[str] + type: Required[Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST]] class azure.ai.projects.types.VoiceMcpApprovalResponseItem(TypedDict, total=False): - key "approval_request_id": Required[str] - key "approve": Required[bool] key "created_at": int - key "id": Required[str] key "reason": Optional[str] key "response_id": str - key "type": Required[Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE]] - approval_request_id: str - approve: bool + approval_request_id: Required[str] + approve: Required[bool] created_at: int - id: str + id: Required[str] reason: str response_id: str - type: Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE] + type: Required[Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE]] class azure.ai.projects.types.VoiceMcpCallItem(TypedDict, total=False): key "approval_request_id": Optional[str] - key "arguments": Required[str] key "created_at": int - key "error": ForwardRef('RealtimeMCPError', module='types') - key "id": Required[str] - key "name": Required[str] + key "error": ForwardRef('RealtimeMCPError') key "output": Optional[str] key "response_id": str - key "server_label": Required[str] - key "type": Required[Literal[VoiceConversationItemType.MCP_CALL]] approval_request_id: str - arguments: str + arguments: Required[str] created_at: int error: RealtimeMCPError - id: str - name: str + id: Required[str] + name: Required[str] output: str response_id: str - server_label: str - type: Literal[VoiceConversationItemType.MCP_CALL] + server_label: Required[str] + type: Required[Literal[VoiceConversationItemType.MCP_CALL]] class azure.ai.projects.types.VoiceMcpListToolsItem(TypedDict, total=False): key "created_at": int key "id": str key "response_id": str - key "server_label": Required[str] - key "tools": Required[list[MCPListToolsTool]] - key "type": Required[Literal[VoiceConversationItemType.MCP_LIST_TOOLS]] created_at: int id: str response_id: str - server_label: str - tools: list[MCPListToolsTool] - type: Literal[VoiceConversationItemType.MCP_LIST_TOOLS] + server_label: Required[str] + tools: Required[list[MCPListToolsTool]] + type: Required[Literal[VoiceConversationItemType.MCP_LIST_TOOLS]] class azure.ai.projects.types.VoiceNoiseReduction(TypedDict, total=False): - key "type": Required[Union[str, VoiceNoiseReductionType]] - type: Union[str, VoiceNoiseReductionType] + type: Required[Union[str, VoiceNoiseReductionType]] class azure.ai.projects.types.VoiceResponseAudio(TypedDict, total=False): - key "output": ForwardRef('VoiceResponseAudioOutput', module='types') + key "output": ForwardRef('VoiceResponseAudioOutput') output: VoiceResponseAudioOutput class azure.ai.projects.types.VoiceResponseAudioOutput(TypedDict, total=False): - key "format": ForwardRef('RealtimeAudioFormats', module='types') + key "format": ForwardRef('RealtimeAudioFormats') key "voice": str key "voice_locale": str key "voice_type": str @@ -21406,7 +20615,6 @@ namespace azure.ai.projects.types key "silence_duration_ms": int key "speech_duration_ms": int key "threshold": float - key "type": Required[Literal[VoiceTurnDetectionType.SERVER_VAD]] auto_truncate: bool create_response: bool end_of_utterance_detection: VoiceEndOfUtteranceDetection @@ -21416,46 +20624,38 @@ namespace azure.ai.projects.types silence_duration_ms: int speech_duration_ms: int threshold: float - type: Literal[VoiceTurnDetectionType.SERVER_VAD] + type: Required[Literal[VoiceTurnDetectionType.SERVER_VAD]] class azure.ai.projects.types.VoiceSystemMessageItem(TypedDict, total=False): - key "content": Required[list[RealtimeConversationItemMessageSystemContent]] key "created_at": int key "id": str key "object": Literal["item"] key "response_id": str - key "role": Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal[VoiceConversationItemType.MESSAGE]] - content: list[RealtimeConversationItemMessageSystemContent] + content: Required[list[RealtimeConversationItemMessageSystemContent]] created_at: int id: str object: Literal[item] response_id: str - role: Literal[RealtimeConversationItemMessageType.SYSTEM] + role: Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] status: Literal[completed, incomplete, in_progress] - type: Literal[VoiceConversationItemType.MESSAGE] + type: Required[Literal[VoiceConversationItemType.MESSAGE]] class azure.ai.projects.types.VoiceSystemTool(TypedDict, total=False): key "description": str - key "name": Required[Union[str, VoiceSystemToolName]] - key "type": Required[Literal["system"]] description: str - name: Union[str, VoiceSystemToolName] - type: Literal[system] + name: Required[Union[str, VoiceSystemToolName]] + type: Required[Literal["system"]] class azure.ai.projects.types.VoiceToolboxTool(TypedDict, total=False): key "response_scheduling": Union[str, VoiceAgentToolResponseScheduling] - key "toolbox_name": Required[str] - key "toolbox_version": Required[str] - key "type": Required[Literal["toolbox"]] response_scheduling: Union[str, VoiceAgentToolResponseScheduling] - toolbox_name: str - toolbox_version: str - type: Literal[toolbox] + toolbox_name: Required[str] + toolbox_version: Required[str] + type: Required[Literal["toolbox"]] class azure.ai.projects.types.VoiceTurnDetectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -21467,22 +20667,19 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceUserMessageItem(TypedDict, total=False): - key "content": Required[list[RealtimeConversationItemMessageUserContent]] key "created_at": int key "id": str key "object": Literal["item"] key "response_id": str - key "role": Required[Literal[RealtimeConversationItemMessageType.USER]] key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal[VoiceConversationItemType.MESSAGE]] - content: list[RealtimeConversationItemMessageUserContent] + content: Required[list[RealtimeConversationItemMessageUserContent]] created_at: int id: str object: Literal[item] response_id: str - role: Literal[RealtimeConversationItemMessageType.USER] + role: Required[Literal[RealtimeConversationItemMessageType.USER]] status: Literal[completed, incomplete, in_progress] - type: Literal[VoiceConversationItemType.MESSAGE] + type: Required[Literal[VoiceConversationItemType.MESSAGE]] class azure.ai.projects.types.WebSearchApproximateLocation(TypedDict, total=False): @@ -21490,38 +20687,35 @@ namespace azure.ai.projects.types key "country": Optional[str] key "region": Optional[str] key "timezone": Optional[str] - key "type": Required[Literal["approximate"]] city: str country: str region: str timezone: str - type: Literal[approximate] + type: Required[Literal["approximate"]] class azure.ai.projects.types.WebSearchConfiguration(TypedDict, total=False): - key "instance_name": Required[str] - key "project_connection_id": Required[str] - instance_name: str - project_connection_id: str + instance_name: Required[str] + project_connection_id: Required[str] class azure.ai.projects.types.WebSearchPreviewTool(TypedDict, total=False): + key "search_content_types": list[Union[str, SearchContentType]] key "search_context_size": Union[str, SearchContextSize] - key "type": Required[Literal[ToolType.WEB_SEARCH_PREVIEW]] key "user_location": Optional[ApproximateLocation] search_content_types: list[Union[str, SearchContentType]] search_context_size: Union[str, SearchContextSize] - type: Literal[ToolType.WEB_SEARCH_PREVIEW] + type: Required[Literal[ToolType.WEB_SEARCH_PREVIEW]] user_location: ApproximateLocation class azure.ai.projects.types.WebSearchTool(TypedDict, total=False): - key "custom_search_configuration": ForwardRef('WebSearchConfiguration', module='types') + key "custom_search_configuration": ForwardRef('WebSearchConfiguration') key "description": str key "filters": Optional[WebSearchToolFilters] key "name": str key "search_context_size": Literal["low", "medium", "high"] - key "type": Required[Literal[ToolType.WEB_SEARCH]] + key "tool_configs": dict[str, ToolConfig] key "user_location": Optional[WebSearchApproximateLocation] custom_search_configuration: WebSearchConfiguration description: str @@ -21529,7 +20723,7 @@ namespace azure.ai.projects.types name: str search_context_size: Literal[low, medium, high] tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.WEB_SEARCH] + type: Required[Literal[ToolType.WEB_SEARCH]] user_location: WebSearchApproximateLocation @@ -21539,12 +20733,12 @@ namespace azure.ai.projects.types class azure.ai.projects.types.WebSearchToolboxTool(TypedDict, total=False): - key "custom_search_configuration": ForwardRef('WebSearchConfiguration', module='types') + key "custom_search_configuration": ForwardRef('WebSearchConfiguration') key "description": str key "filters": Optional[WebSearchToolFilters] key "name": str key "search_context_size": Literal["low", "medium", "high"] - key "type": Required[Literal[ToolboxToolType.WEB_SEARCH]] + key "tool_configs": dict[str, ToolConfig] key "user_location": Optional[WebSearchApproximateLocation] custom_search_configuration: WebSearchConfiguration description: str @@ -21552,41 +20746,35 @@ namespace azure.ai.projects.types name: str search_context_size: Literal[low, medium, high] tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.WEB_SEARCH] + type: Required[Literal[ToolboxToolType.WEB_SEARCH]] user_location: WebSearchApproximateLocation class azure.ai.projects.types.WeeklyRecurrenceSchedule(TypedDict, total=False): - key "daysOfWeek": Required[list[Union[str, DayOfWeek]]] - key "type": Required[Literal[RecurrenceType.WEEKLY]] - daysOfWeek: list[Union[str, DayOfWeek]] - type: Literal[RecurrenceType.WEEKLY] + daysOfWeek: Required[list[Union[str, DayOfWeek]]] + type: Required[Literal[RecurrenceType.WEEKLY]] class azure.ai.projects.types.WorkIQPreviewTool(TypedDict, total=False): - key "project_connection_id": Required[str] - key "type": Required[Literal[ToolType.WORK_IQ_PREVIEW]] - project_connection_id: str - type: Literal[ToolType.WORK_IQ_PREVIEW] + project_connection_id: Required[str] + type: Required[Literal[ToolType.WORK_IQ_PREVIEW]] class azure.ai.projects.types.WorkIQPreviewToolboxTool(TypedDict, total=False): key "description": str key "name": str - key "project_connection_id": Required[str] - key "type": Required[Literal[ToolboxToolType.WORK_IQ_PREVIEW]] + key "tool_configs": dict[str, ToolConfig] description: str name: str - project_connection_id: str + project_connection_id: Required[str] tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.WORK_IQ_PREVIEW] + type: Required[Literal[ToolboxToolType.WORK_IQ_PREVIEW]] class azure.ai.projects.types.WorkflowAgentDefinition(TypedDict, total=False): - key "kind": Required[Literal[AgentKind.WORKFLOW]] - key "rai_config": ForwardRef('RaiConfig', module='types') + key "rai_config": ForwardRef('RaiConfig') key "workflow": str - kind: Literal[AgentKind.WORKFLOW] + kind: Required[Literal[AgentKind.WORKFLOW]] rai_config: RaiConfig workflow: str diff --git a/sdk/ai/azure-ai-projects/api.metadata.yml b/sdk/ai/azure-ai-projects/api.metadata.yml index c9f97de99bda..2a2d54107636 100644 --- a/sdk/ai/azure-ai-projects/api.metadata.yml +++ b/sdk/ai/azure-ai-projects/api.metadata.yml @@ -1,3 +1,3 @@ -apiMdSha256: e8747d9614fde34654e3ac76a960aff0fbf2408b485b74c4ca92ebb7abe6dc6f +apiMdSha256: 0d888036ea7693ab8273a7ee5fae970ea137982acb6e3646db5dd62a298724fe parserVersion: 0.3.31 pythonVersion: 3.13.14 diff --git a/sdk/ai/azure-ai-projects/pyproject.toml b/sdk/ai/azure-ai-projects/pyproject.toml index 44f29b83dac8..84b216ce7b7a 100644 --- a/sdk/ai/azure-ai-projects/pyproject.toml +++ b/sdk/ai/azure-ai-projects/pyproject.toml @@ -37,6 +37,7 @@ dependencies = [ "typing-extensions>=4.11", "azure-identity>=1.15.0", "openai>=2.8.0", + "httpx>=0.25.0", "azure-storage-blob>=12.15.0", ] dynamic = [ From ddc8099a0682612cf401aa47d8967fc5635fb3cb Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Tue, 18 Aug 2026 22:49:13 -0700 Subject: [PATCH 31/56] Fix sphinx docstring warnings, pyright httpx type errors, stale routines header test fixture, and remove voice_agent_web_socket from docs --- sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py | 4 +++- sdk/ai/azure-ai-projects/azure/ai/projects/_patch.pyi | 4 ++-- sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py | 4 +++- sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.pyi | 4 ++-- .../azure-ai-projects/azure/ai/projects/models/_enums.py | 8 ++++---- .../azure-ai-projects/azure/ai/projects/models/_models.py | 7 ++++--- sdk/ai/azure-ai-projects/docs/public-methods.md | 7 ++----- .../foundry_features_header_test_base.py | 2 +- 8 files changed, 21 insertions(+), 19 deletions(-) diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py index bc5fe415a4e1..3e9e96cf3240 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py @@ -305,7 +305,9 @@ def _get_openai_http_client(self, kwargs: dict): logging_kwargs = getattr(self, "_kwargs", {}) logging_enabled = bool(logging_kwargs.get("logging_enable", False)) - return DefaultHttpxClient(transport=_OpenAILoggingTransport(logging_enabled=logging_enabled)) + return DefaultHttpxClient( + transport=_OpenAILoggingTransport(logging_enabled=logging_enabled) + ) # type: ignore[arg-type] @distributed_trace def get_openai_client( diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.pyi b/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.pyi index 070856b73677..37d028f10fc9 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.pyi +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.pyi @@ -54,7 +54,7 @@ from .models import ( ) class _AzureEvalRuns(Runs): - def create( + def create( # type: ignore[reportIncompatibleMethodOverride] self, eval_id: str, *, @@ -78,7 +78,7 @@ class _AzureEvalRuns(Runs): ) -> RunCreateResponse: ... class _AzureEvals(Evals): - def create( + def create( # type: ignore[reportIncompatibleMethodOverride] self, *, data_source_config: Union[ diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py index a0739cefbdf4..7d45d38524ab 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py @@ -246,7 +246,9 @@ def _get_openai_http_client(self, kwargs: dict): logging_kwargs = getattr(self, "_kwargs", {}) logging_enabled = bool(logging_kwargs.get("logging_enable", False)) - return DefaultAsyncHttpxClient(transport=_OpenAILoggingTransport(logging_enabled=logging_enabled)) + return DefaultAsyncHttpxClient( + transport=_OpenAILoggingTransport(logging_enabled=logging_enabled) + ) # type: ignore[arg-type] @distributed_trace def get_openai_client( diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.pyi b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.pyi index afbddb34ddb9..1fd66617ec81 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.pyi +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.pyi @@ -53,7 +53,7 @@ from ..models import ( ) class _AzureAsyncEvalRuns(AsyncRuns): - async def create( + async def create( # type: ignore[reportIncompatibleMethodOverride] self, eval_id: str, *, @@ -77,7 +77,7 @@ class _AzureAsyncEvalRuns(AsyncRuns): ) -> RunCreateResponse: ... class _AzureAsyncEvals(AsyncEvals): - async def create( + async def create( # type: ignore[reportIncompatibleMethodOverride] self, *, data_source_config: Union[ 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 2d93c869a191..7034dacc971c 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 @@ -1704,12 +1704,12 @@ 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. + 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. + 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. + 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 f276c74b6f48..307df7c17903 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 @@ -23760,13 +23760,14 @@ class VoiceAudioOutputConfig(_Model): # pylint: disable=docstring-keyword-shoul * `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`. + `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. + `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 diff --git a/sdk/ai/azure-ai-projects/docs/public-methods.md b/sdk/ai/azure-ai-projects/docs/public-methods.md index bcf47e462f86..bd942fe517e6 100644 --- a/sdk/ai/azure-ai-projects/docs/public-methods.md +++ b/sdk/ai/azure-ai-projects/docs/public-methods.md @@ -4,9 +4,9 @@ This document lists all public methods available on `AIProjectClient` and its su ## Summary -There are a total of 154 unique public methods: +There are a total of 153 unique public methods: - 5 stable methods on the client -- 68 stable methods on top-level sub-clients +- 67 stable methods on top-level sub-clients - 81 beta methods on nested beta sub-clients ### Top-level sub-clients (stable operations) @@ -22,7 +22,6 @@ There are a total of 154 unique public methods: | `indexes` | IndexesOperations | 5 | | `telemetry` | TelemetryOperations | 1 | | `toolboxes` | ToolboxesOperations | 8 | -| `voice_agent_web_socket` | VoiceAgentWebSocketOperations | 1 | ### Nested sub-clients (beta operations) @@ -133,8 +132,6 @@ Alphabetically sorted. An asterisk at the end of the method name means is a hand .toolboxes.list .toolboxes.list_versions .toolboxes.update - -.voice_agent_web_socket.connect_voice_agent ``` ## Beta methods on nested sub-clients diff --git a/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py b/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py index 17157375d783..8e7660f50680 100644 --- a/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py +++ b/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py @@ -41,7 +41,7 @@ "memory_stores": "MemoryStores=V1Preview", "models": "Models=V1Preview", "red_teams": "RedTeams=V1Preview", - "routines": "Routines=V1Preview", + "routines": "Routines=V2Preview", "schedules": "Schedules=V1Preview", "skills": "Skills=V1Preview", "datasets": "DataGenerationJobs=V1Preview", From 00f2dc4e0790ac4e31157ff8681d22c12ac635d3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 19 Aug 2026 06:07:17 +0000 Subject: [PATCH 32/56] Update azure-ai-projects API snapshot Co-authored-by: xitzhang <11403681+xitzhang@users.noreply.github.com> --- sdk/ai/azure-ai-projects/api.md | 3352 +++++++++++++-------- sdk/ai/azure-ai-projects/api.metadata.yml | 2 +- 2 files changed, 2086 insertions(+), 1268 deletions(-) diff --git a/sdk/ai/azure-ai-projects/api.md b/sdk/ai/azure-ai-projects/api.md index 2d7054d14082..f5b917a15012 100644 --- a/sdk/ai/azure-ai-projects/api.md +++ b/sdk/ai/azure-ai-projects/api.md @@ -3556,21 +3556,21 @@ namespace azure.ai.projects.models class azure.ai.projects.models.AzureAIAgentTargetParam(TypedDict, total=False): + key "name": Required[str] key "tool_descriptions": List[ToolDescriptionParam] + key "type": Required[Literal["azure_ai_agent"]] key "version": str - name: Required[str] - type: Required[Literal["azure_ai_agent"]] class azure.ai.projects.models.AzureAIBenchmarkPreviewEvalRunDataSource(TypedDict, total=False): key "input_messages": InputMessagesItemReference - target: Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] - type: Required[Literal["azure_ai_benchmark_preview"]] + key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] + key "type": Required[Literal["azure_ai_benchmark_preview"]] class azure.ai.projects.models.AzureAIDataSourceConfig(TypedDict, total=False): - scenario: Required[str] - type: Required[Literal["azure_ai_source"]] + key "scenario": Required[str] + key "type": Required[Literal["azure_ai_source"]] class azure.ai.projects.models.AzureAIModelTarget(EvaluationTarget, discriminator='azure_ai_model'): @@ -3593,14 +3593,14 @@ namespace azure.ai.projects.models class azure.ai.projects.models.AzureAIModelTargetParam(TypedDict, total=False): key "model": str key "sampling_params": ModelSamplingConfigParam - type: Required[Literal["azure_ai_model"]] + key "type": Required[Literal["azure_ai_model"]] class azure.ai.projects.models.AzureAIResponsesEvalRunDataSource(TypedDict, total=False): key "event_configuration_id": str + key "item_generation_params": Required[ResponseRetrievalItemGenerationParams] key "max_runs_hourly": int - item_generation_params: Required[ResponseRetrievalItemGenerationParams] - type: Required[Literal["azure_ai_responses"]] + key "type": Required[Literal["azure_ai_responses"]] class azure.ai.projects.models.AzureAISearchIndex(Index, discriminator='AzureSearch'): @@ -5210,13 +5210,13 @@ namespace azure.ai.projects.models class azure.ai.projects.models.EvalCsvFileIdSource(TypedDict, total=False): - id: Required[str] - type: Required[Literal["file_id"]] + key "id": Required[str] + key "type": Required[Literal["file_id"]] class azure.ai.projects.models.EvalCsvRunDataSource(TypedDict, total=False): - source: Required[EvalCsvFileIdSource] - type: Required[Literal["csv"]] + key "source": Required[EvalCsvFileIdSource] + key "type": Required[Literal["csv"]] class azure.ai.projects.models.EvalResult(_Model): @@ -8983,9 +8983,9 @@ namespace azure.ai.projects.models class azure.ai.projects.models.RedTeamEvalRunDataSource(TypedDict, total=False): - item_generation_params: Required[Any] - target: Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] - type: Required[Literal["azure_ai_red_team"]] + key "item_generation_params": Required[Any] + key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] + key "type": Required[Literal["azure_ai_red_team"]] class azure.ai.projects.models.RedTeamTargetConfig(_Model): @@ -9022,10 +9022,10 @@ namespace azure.ai.projects.models class azure.ai.projects.models.ResponseRetrievalItemGenerationParams(TypedDict, total=False): + key "data_mapping": Required[Dict[str, str]] key "max_num_turns": int - data_mapping: Required[Dict[str, str]] - source: Required[Union[SourceFileContent, SourceFileID]] - type: Required[Literal["response_retrieval"]] + key "source": Required[Union[SourceFileContent, SourceFileID]] + key "type": Required[Literal["response_retrieval"]] class azure.ai.projects.models.ResponseUsageInputTokensDetails(_Model): @@ -9709,10 +9709,10 @@ namespace azure.ai.projects.models class azure.ai.projects.models.TargetCompletionEvalRunDataSource(TypedDict, total=False): - input_messages: Required[InputMessagesItemReference] - source: Required[Union[SourceFileContent, SourceFileID]] - target: Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] - type: Required[Literal["azure_ai_target_completions"]] + key "input_messages": Required[InputMessagesItemReference] + key "source": Required[Union[SourceFileContent, SourceFileID]] + key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] + key "type": Required[Literal["azure_ai_target_completions"]] class azure.ai.projects.models.TaxonomyCategory(_Model): @@ -9843,11 +9843,11 @@ namespace azure.ai.projects.models class azure.ai.projects.models.TestingCriterionAzureAIEvaluator(TypedDict, total=False): key "data_mapping": Dict[str, str] + key "evaluator_name": Required[str] key "evaluator_version": str key "initialization_parameters": Dict[str, Any] - evaluator_name: Required[str] - name: Required[str] - type: Required[Literal["azure_ai_evaluator"]] + key "name": Required[str] + key "type": Required[Literal["azure_ai_evaluator"]] class azure.ai.projects.models.TextResponseFormat(_Model): @@ -10495,7 +10495,7 @@ namespace azure.ai.projects.models key "lookback_hours": int key "max_traces": int key "trace_ids": List[str] - type: Required[Literal["azure_ai_traces_preview"]] + key "type": Required[Literal["azure_ai_traces_preview"]] class azure.ai.projects.models.TranscriptTextUsageDuration(CreateTranscriptionResponseJsonUsage, discriminator='duration'): @@ -16280,11 +16280,12 @@ namespace azure.ai.projects.types key "base_url": str key "project_connection_id": str key "send_credentials_for_agent_card": bool + key "type": Required[Literal[ToolType.A2A_PREVIEW]] agent_card_path: str base_url: str project_connection_id: str send_credentials_for_agent_card: bool - type: Required[Literal[ToolType.A2A_PREVIEW]] + type: Literal[ToolType.A2A_PREVIEW] class azure.ai.projects.types.A2APreviewToolboxTool(TypedDict, total=False): @@ -16294,7 +16295,7 @@ namespace azure.ai.projects.types key "name": str key "project_connection_id": str key "send_credentials_for_agent_card": bool - key "tool_configs": dict[str, ToolConfig] + key "type": Required[Literal[ToolboxToolType.A2A_PREVIEW]] agent_card_path: str base_url: str description: str @@ -16302,7 +16303,7 @@ namespace azure.ai.projects.types project_connection_id: str send_credentials_for_agent_card: bool tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolboxToolType.A2A_PREVIEW]] + type: Literal[ToolboxToolType.A2A_PREVIEW] class azure.ai.projects.types.A2AProtocolConfiguration(TypedDict, total=False): @@ -16329,8 +16330,10 @@ namespace azure.ai.projects.types class azure.ai.projects.types.AgentBlueprintReference(TypedDict, total=False): - blueprint_id: Required[str] - type: Required[Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT]] + key "blueprint_id": Required[str] + key "type": Required[Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT]] + blueprint_id: str + type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] class azure.ai.projects.types.AgentBlueprintReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -16339,41 +16342,49 @@ namespace azure.ai.projects.types class azure.ai.projects.types.AgentCard(TypedDict, total=False): key "description": str + key "skills": Required[list[AgentCardSkill]] + key "version": Required[str] description: str - skills: Required[list[AgentCardSkill]] - version: Required[str] + skills: list[AgentCardSkill] + version: str class azure.ai.projects.types.AgentCardSkill(TypedDict, total=False): key "description": str - key "examples": list[str] - key "tags": list[str] + key "id": Required[str] + key "name": Required[str] description: str examples: list[str] - id: Required[str] - name: Required[str] + id: str + name: str tags: list[str] class azure.ai.projects.types.AgentClusterInsightRequest(TypedDict, total=False): - key "modelConfiguration": ForwardRef('InsightModelConfiguration') - agentName: Required[str] + key "agentName": Required[str] + key "modelConfiguration": ForwardRef('InsightModelConfiguration', module='types') + key "type": Required[Literal[InsightType.AGENT_CLUSTER_INSIGHT]] + agentName: str modelConfiguration: InsightModelConfiguration - type: Required[Literal[InsightType.AGENT_CLUSTER_INSIGHT]] + type: Literal[InsightType.AGENT_CLUSTER_INSIGHT] class azure.ai.projects.types.AgentClusterInsightResult(TypedDict, total=False): - clusterInsight: Required[ClusterInsightResult] - type: Required[Literal[InsightType.AGENT_CLUSTER_INSIGHT]] + key "clusterInsight": Required[ClusterInsightResult] + key "type": Required[Literal[InsightType.AGENT_CLUSTER_INSIGHT]] + clusterInsight: ClusterInsightResult + type: Literal[InsightType.AGENT_CLUSTER_INSIGHT] class azure.ai.projects.types.AgentDataGenerationJobSource(TypedDict, total=False): + key "agent_name": Required[str] key "agent_version": str key "description": str - agent_name: Required[str] + key "type": Required[Literal[DataGenerationJobSourceType.AGENT]] + agent_name: str agent_version: str description: str - type: Required[Literal[DataGenerationJobSourceType.AGENT]] + type: Literal[DataGenerationJobSourceType.AGENT] class azure.ai.projects.types.AgentEndpointAuthorizationSchemeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -16384,21 +16395,22 @@ namespace azure.ai.projects.types class azure.ai.projects.types.AgentEndpointConfig(TypedDict, total=False): - key "authorization_schemes": list[AgentEndpointAuthorizationScheme] - key "protocol_configuration": ForwardRef('ProtocolConfiguration') - key "version_selector": ForwardRef('VersionSelector') + key "protocol_configuration": ForwardRef('ProtocolConfiguration', module='types') + key "version_selector": ForwardRef('VersionSelector', module='types') authorization_schemes: list[AgentEndpointAuthorizationScheme] protocol_configuration: ProtocolConfiguration version_selector: VersionSelector class azure.ai.projects.types.AgentEvaluatorGenerationJobSource(TypedDict, total=False): + key "agent_name": Required[str] key "agent_version": str key "description": str - agent_name: Required[str] + key "type": Required[Literal[EvaluatorGenerationJobSourceType.AGENT]] + agent_name: str agent_version: str description: str - type: Required[Literal[EvaluatorGenerationJobSourceType.AGENT]] + type: Literal[EvaluatorGenerationJobSourceType.AGENT] class azure.ai.projects.types.AgentKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -16410,24 +16422,28 @@ namespace azure.ai.projects.types class azure.ai.projects.types.AgentOptimizationCandidate(TypedDict, total=False): + key "avg_score": Required[float] + key "avg_tokens": Required[float] key "candidate_id": str key "eval_id": str key "eval_run_id": str - key "mutations": dict[str, Any] - key "promotion": ForwardRef('PromotionInfo') - avg_score: Required[float] - avg_tokens: Required[float] + key "name": Required[str] + key "promotion": ForwardRef('PromotionInfo', module='types') + avg_score: float + avg_tokens: float candidate_id: str eval_id: str eval_run_id: str mutations: dict[str, Any] - name: Required[str] + name: str promotion: PromotionInfo class azure.ai.projects.types.AgentOptimizationDatasetCriterion(TypedDict, total=False): - instruction: Required[str] - name: Required[str] + key "instruction": Required[str] + key "name": Required[str] + instruction: str + name: str class azure.ai.projects.types.AgentOptimizationDatasetInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -16436,7 +16452,6 @@ namespace azure.ai.projects.types class azure.ai.projects.types.AgentOptimizationDatasetItem(TypedDict, total=False): - key "criteria": list[AgentOptimizationDatasetCriterion] key "desired_num_turns": int key "ground_truth": str key "query": str @@ -16447,53 +16462,64 @@ namespace azure.ai.projects.types class azure.ai.projects.types.AgentOptimizationEvaluatorRef(TypedDict, total=False): + key "name": Required[str] key "version": str - name: Required[str] + name: str version: str class azure.ai.projects.types.AgentOptimizationInlineDatasetInput(TypedDict, total=False): - items: Required[list[AgentOptimizationDatasetItem]] - type: Required[Literal[AgentOptimizationDatasetInputType.INLINE]] + key "items": Required[list[AgentOptimizationDatasetItem]] + key "type": Required[Literal[AgentOptimizationDatasetInputType.INLINE]] + items: list[AgentOptimizationDatasetItem] + type: Literal[AgentOptimizationDatasetInputType.INLINE] class azure.ai.projects.types.AgentOptimizationJob(TypedDict, total=False): - key "error": ForwardRef('ApiError') - key "inputs": ForwardRef('AgentOptimizationJobInputs') - key "progress": ForwardRef('AgentOptimizationJobProgress') - key "result": ForwardRef('AgentOptimizationJobResult') - key "warnings": list[str] - created_at: Required[int] + key "created_at": Required[int] + key "error": ForwardRef('ApiError', module='types') + key "id": Required[str] + key "inputs": ForwardRef('AgentOptimizationJobInputs', module='types') + key "progress": ForwardRef('AgentOptimizationJobProgress', module='types') + key "result": ForwardRef('AgentOptimizationJobResult', module='types') + key "status": Required[Union[str, JobStatus]] + key "updated_at": Required[int] + created_at: int error: ApiError - id: Required[str] + id: str inputs: AgentOptimizationJobInputs progress: AgentOptimizationJobProgress result: AgentOptimizationJobResult - status: Required[Union[str, JobStatus]] - updated_at: Required[int] + status: Union[str, JobStatus] + updated_at: int warnings: list[str] class azure.ai.projects.types.AgentOptimizationJobInputs(TypedDict, total=False): - key "options": ForwardRef('AgentOptimizationOptions') - key "validation_dataset": ForwardRef('AgentOptimizationDatasetInput') - agent: Required[OptimizedAgentIdentifier] - evaluators: Required[list[AgentOptimizationEvaluatorRef]] + key "agent": Required[OptimizedAgentIdentifier] + key "evaluators": Required[list[AgentOptimizationEvaluatorRef]] + key "options": ForwardRef('AgentOptimizationOptions', module='types') + key "train_dataset": Required[AgentOptimizationDatasetInput] + key "validation_dataset": ForwardRef('AgentOptimizationDatasetInput', module='types') + agent: OptimizedAgentIdentifier + evaluators: list[AgentOptimizationEvaluatorRef] options: AgentOptimizationOptions - train_dataset: Required[AgentOptimizationDatasetInput] + train_dataset: AgentOptimizationDatasetInput validation_dataset: AgentOptimizationDatasetInput class azure.ai.projects.types.AgentOptimizationJobProgress(TypedDict, total=False): - best_score: Required[float] - candidates_completed: Required[int] - elapsed_seconds: Required[float] + key "best_score": Required[float] + key "candidates_completed": Required[int] + key "elapsed_seconds": Required[float] + best_score: float + candidates_completed: int + elapsed_seconds: float class azure.ai.projects.types.AgentOptimizationJobResult(TypedDict, total=False): key "baseline": str key "best": str - key "candidates": list[AgentOptimizationCandidate] baseline: str best: str candidates: list[AgentOptimizationCandidate] @@ -16504,7 +16530,6 @@ namespace azure.ai.projects.types key "evaluation_level": Union[str, EvaluationLevel] key "max_candidates": int key "max_stalls": int - key "optimization_config": dict[str, Any] key "optimization_model": str eval_model: str evaluation_level: Union[str, EvaluationLevel] @@ -16515,37 +16540,42 @@ namespace azure.ai.projects.types class azure.ai.projects.types.AgentOptimizationReferenceDatasetInput(TypedDict, total=False): + key "name": Required[str] + key "type": Required[Literal[AgentOptimizationDatasetInputType.REFERENCE]] key "version": str - name: Required[str] - type: Required[Literal[AgentOptimizationDatasetInputType.REFERENCE]] + name: str + type: Literal[AgentOptimizationDatasetInputType.REFERENCE] version: str class azure.ai.projects.types.AgentTaxonomyInput(TypedDict, total=False): - riskCategories: Required[list[Union[str, RiskCategory]]] - target: Required[EvaluationTarget] - type: Required[Literal[EvaluationTaxonomyInputType.AGENT]] + key "riskCategories": Required[list[Union[str, RiskCategory]]] + key "target": Required[EvaluationTarget] + key "type": Required[Literal[EvaluationTaxonomyInputType.AGENT]] + riskCategories: list[Union[str, RiskCategory]] + target: EvaluationTarget + type: Literal[EvaluationTaxonomyInputType.AGENT] class azure.ai.projects.types.ApiError(TypedDict, total=False): - key "additionalInfo": dict[str, Any] - key "debugInfo": dict[str, Any] - key "details": list[ApiError] + key "code": Required[Optional[str]] + key "message": Required[str] key "param": Optional[str] key "type": str additionalInfo: dict[str, Any] - code: Required[Optional[str]] + code: str debugInfo: dict[str, Any] details: list[ApiError] - message: Required[str] + message: str param: str type: str class azure.ai.projects.types.ApplyPatchToolParam(TypedDict, total=False): key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] + key "type": Required[Literal[ToolType.APPLY_PATCH]] allowed_callers: list[Union[str, CallableToolAllowedCaller]] - type: Required[Literal[ToolType.APPLY_PATCH]] + type: Literal[ToolType.APPLY_PATCH] class azure.ai.projects.types.ApproximateLocation(TypedDict, total=False): @@ -16553,248 +16583,291 @@ namespace azure.ai.projects.types key "country": Optional[str] key "region": Optional[str] key "timezone": Optional[str] + key "type": Required[Literal["approximate"]] city: str country: str region: str timezone: str - type: Required[Literal["approximate"]] + type: Literal[approximate] class azure.ai.projects.types.ArtifactProfile(TypedDict, total=False): - key "signals": list[Union[str, FoundryModelArtifactProfileSignal]] - category: Required[Union[str, FoundryModelArtifactProfileCategory]] + key "category": Required[Union[str, FoundryModelArtifactProfileCategory]] + category: Union[str, FoundryModelArtifactProfileCategory] signals: list[Union[str, FoundryModelArtifactProfileSignal]] class azure.ai.projects.types.AutoCodeInterpreterToolParam(TypedDict, total=False): - key "file_ids": list[str] key "memory_limit": Optional[Union[str, ContainerMemoryLimit]] - key "network_policy": ForwardRef('ContainerNetworkPolicyParam') + key "network_policy": ForwardRef('ContainerNetworkPolicyParam', module='types') + key "type": Required[Literal["auto"]] file_ids: list[str] memory_limit: Union[str, ContainerMemoryLimit] network_policy: ContainerNetworkPolicyParam - type: Required[Literal["auto"]] + type: Literal[auto] class azure.ai.projects.types.AzureAIAgentTarget(TypedDict, total=False): - key "tool_descriptions": list[ToolDescription] - key "tools": list[Tool] + key "name": Required[str] + key "type": Required[Literal["azure_ai_agent"]] key "version": str - name: Required[str] + name: str tool_descriptions: list[ToolDescription] tools: list[Tool] - type: Required[Literal["azure_ai_agent"]] + type: Literal[azure_ai_agent] version: str class azure.ai.projects.types.AzureAIModelTarget(TypedDict, total=False): key "model": str - key "sampling_params": ForwardRef('ModelSamplingParams') + key "sampling_params": ForwardRef('ModelSamplingParams', module='types') + key "type": Required[Literal["azure_ai_model"]] model: str sampling_params: ModelSamplingParams - type: Required[Literal["azure_ai_model"]] + type: Literal[azure_ai_model] class azure.ai.projects.types.AzureAISearchIndex(TypedDict, total=False): + key "connectionName": Required[str] key "description": str - key "fieldMapping": ForwardRef('FieldMapping') + key "fieldMapping": ForwardRef('FieldMapping', module='types') key "id": str - key "tags": dict[str, str] - connectionName: Required[str] + key "indexName": Required[str] + key "name": Required[str] + key "type": Required[Literal[IndexType.AZURE_SEARCH]] + key "version": Required[str] + connectionName: str description: str fieldMapping: FieldMapping id: str - indexName: Required[str] - name: Required[str] + indexName: str + name: str tags: dict[str, str] - type: Required[Literal[IndexType.AZURE_SEARCH]] - version: Required[str] + type: Literal[IndexType.AZURE_SEARCH] + version: str class azure.ai.projects.types.AzureAISearchTool(TypedDict, total=False): + key "azure_ai_search": Required[AzureAISearchToolResource] key "description": str key "name": str - key "tool_configs": dict[str, ToolConfig] - azure_ai_search: Required[AzureAISearchToolResource] + key "type": Required[Literal[ToolType.AZURE_AI_SEARCH]] + azure_ai_search: AzureAISearchToolResource description: str name: str tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolType.AZURE_AI_SEARCH]] + type: Literal[ToolType.AZURE_AI_SEARCH] class azure.ai.projects.types.AzureAISearchToolResource(TypedDict, total=False): - indexes: Required[list[AISearchIndexResource]] + key "indexes": Required[list[AISearchIndexResource]] + indexes: list[AISearchIndexResource] class azure.ai.projects.types.AzureAISearchToolboxTool(TypedDict, total=False): + key "azure_ai_search": Required[AzureAISearchToolResource] key "description": str key "name": str - key "tool_configs": dict[str, ToolConfig] - azure_ai_search: Required[AzureAISearchToolResource] + key "type": Required[Literal[ToolboxToolType.AZURE_AI_SEARCH]] + azure_ai_search: AzureAISearchToolResource description: str name: str tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolboxToolType.AZURE_AI_SEARCH]] + type: Literal[ToolboxToolType.AZURE_AI_SEARCH] class azure.ai.projects.types.AzureFunctionBinding(TypedDict, total=False): - storage_queue: Required[AzureFunctionStorageQueue] - type: Required[Literal["storage_queue"]] + key "storage_queue": Required[AzureFunctionStorageQueue] + key "type": Required[Literal["storage_queue"]] + storage_queue: AzureFunctionStorageQueue + type: Literal[storage_queue] class azure.ai.projects.types.AzureFunctionDefinition(TypedDict, total=False): - function: Required[AzureFunctionDefinitionFunction] - input_binding: Required[AzureFunctionBinding] - output_binding: Required[AzureFunctionBinding] + key "function": Required[AzureFunctionDefinitionFunction] + key "input_binding": Required[AzureFunctionBinding] + key "output_binding": Required[AzureFunctionBinding] + function: AzureFunctionDefinitionFunction + input_binding: AzureFunctionBinding + output_binding: AzureFunctionBinding class azure.ai.projects.types.AzureFunctionDefinitionFunction(TypedDict, total=False): key "description": str + key "name": Required[str] + key "parameters": Required[dict[str, Any]] description: str - name: Required[str] - parameters: Required[dict[str, Any]] + name: str + parameters: dict[str, Any] class azure.ai.projects.types.AzureFunctionStorageQueue(TypedDict, total=False): - queue_name: Required[str] - queue_service_endpoint: Required[str] + key "queue_name": Required[str] + key "queue_service_endpoint": Required[str] + queue_name: str + queue_service_endpoint: str class azure.ai.projects.types.AzureFunctionTool(TypedDict, total=False): - key "tool_configs": dict[str, ToolConfig] - azure_function: Required[AzureFunctionDefinition] + key "azure_function": Required[AzureFunctionDefinition] + key "type": Required[Literal[ToolType.AZURE_FUNCTION]] + azure_function: AzureFunctionDefinition tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolType.AZURE_FUNCTION]] + type: Literal[ToolType.AZURE_FUNCTION] class azure.ai.projects.types.AzureOpenAIModelConfiguration(TypedDict, total=False): - modelDeploymentName: Required[str] - type: Required[Literal["AzureOpenAIModel"]] + key "modelDeploymentName": Required[str] + key "type": Required[Literal["AzureOpenAIModel"]] + modelDeploymentName: str + type: Literal[AzureOpenAIModel] class azure.ai.projects.types.BingCustomSearchConfiguration(TypedDict, total=False): key "count": int key "freshness": str + key "instance_name": Required[str] key "market": str + key "project_connection_id": Required[str] key "set_lang": str count: int freshness: str - instance_name: Required[str] + instance_name: str market: str - project_connection_id: Required[str] + project_connection_id: str set_lang: str class azure.ai.projects.types.BingCustomSearchPreviewTool(TypedDict, total=False): - bing_custom_search_preview: Required[BingCustomSearchToolParameters] - type: Required[Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW]] + key "bing_custom_search_preview": Required[BingCustomSearchToolParameters] + key "type": Required[Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW]] + bing_custom_search_preview: BingCustomSearchToolParameters + type: Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW] class azure.ai.projects.types.BingCustomSearchToolParameters(TypedDict, total=False): - search_configurations: Required[list[BingCustomSearchConfiguration]] + key "search_configurations": Required[list[BingCustomSearchConfiguration]] + search_configurations: list[BingCustomSearchConfiguration] class azure.ai.projects.types.BingGroundingSearchConfiguration(TypedDict, total=False): key "count": int key "freshness": str key "market": str + key "project_connection_id": Required[str] key "set_lang": str count: int freshness: str market: str - project_connection_id: Required[str] + project_connection_id: str set_lang: str class azure.ai.projects.types.BingGroundingSearchToolParameters(TypedDict, total=False): - search_configurations: Required[list[BingGroundingSearchConfiguration]] + key "search_configurations": Required[list[BingGroundingSearchConfiguration]] + search_configurations: list[BingGroundingSearchConfiguration] class azure.ai.projects.types.BingGroundingTool(TypedDict, total=False): + key "bing_grounding": Required[BingGroundingSearchToolParameters] key "description": str key "name": str - key "tool_configs": dict[str, ToolConfig] - bing_grounding: Required[BingGroundingSearchToolParameters] + key "type": Required[Literal[ToolType.BING_GROUNDING]] + bing_grounding: BingGroundingSearchToolParameters description: str name: str tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolType.BING_GROUNDING]] + type: Literal[ToolType.BING_GROUNDING] class azure.ai.projects.types.BotServiceAuthorizationScheme(TypedDict, total=False): - type: Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE]] + key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE]] + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE] class azure.ai.projects.types.BotServiceRbacAuthorizationScheme(TypedDict, total=False): - type: Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC]] + key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC]] + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC] class azure.ai.projects.types.BotServiceTenantAuthorizationScheme(TypedDict, total=False): - type: Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT]] + key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT]] + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT] class azure.ai.projects.types.BrowserAutomationPreviewTool(TypedDict, total=False): - browser_automation_preview: Required[BrowserAutomationToolParameters] - type: Required[Literal[ToolType.BROWSER_AUTOMATION_PREVIEW]] + key "browser_automation_preview": Required[BrowserAutomationToolParameters] + key "type": Required[Literal[ToolType.BROWSER_AUTOMATION_PREVIEW]] + browser_automation_preview: BrowserAutomationToolParameters + type: Literal[ToolType.BROWSER_AUTOMATION_PREVIEW] class azure.ai.projects.types.BrowserAutomationPreviewToolboxTool(TypedDict, total=False): + key "browser_automation_preview": Required[BrowserAutomationToolParameters] key "description": str key "name": str - key "tool_configs": dict[str, ToolConfig] - browser_automation_preview: Required[BrowserAutomationToolParameters] + key "type": Required[Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW]] + browser_automation_preview: BrowserAutomationToolParameters description: str name: str tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW]] + type: Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW] class azure.ai.projects.types.BrowserAutomationToolConnectionParameters(TypedDict, total=False): - project_connection_id: Required[str] + key "project_connection_id": Required[str] + project_connection_id: str class azure.ai.projects.types.BrowserAutomationToolParameters(TypedDict, total=False): - connection: Required[BrowserAutomationToolConnectionParameters] + key "connection": Required[BrowserAutomationToolConnectionParameters] + connection: BrowserAutomationToolConnectionParameters class azure.ai.projects.types.CaptureStructuredOutputsTool(TypedDict, total=False): key "description": str key "name": str - key "tool_configs": dict[str, ToolConfig] + key "outputs": Required[StructuredOutputDefinition] + key "type": Required[Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS]] description: str name: str - outputs: Required[StructuredOutputDefinition] + outputs: StructuredOutputDefinition tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS]] + type: Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS] class azure.ai.projects.types.ChartCoordinate(TypedDict, total=False): - size: Required[int] - x: Required[int] - y: Required[int] + key "size": Required[int] + key "x": Required[int] + key "y": Required[int] + size: int + x: int + y: int class azure.ai.projects.types.ClusterInsightResult(TypedDict, total=False): - key "coordinates": dict[str, ChartCoordinate] - clusters: Required[list[InsightCluster]] + key "clusters": Required[list[InsightCluster]] + key "summary": Required[InsightSummary] + clusters: list[InsightCluster] coordinates: dict[str, ChartCoordinate] - summary: Required[InsightSummary] + summary: InsightSummary class azure.ai.projects.types.ClusterTokenUsage(TypedDict, total=False): - inputTokenUsage: Required[int] - outputTokenUsage: Required[int] - totalTokenUsage: Required[int] + key "inputTokenUsage": Required[int] + key "outputTokenUsage": Required[int] + key "totalTokenUsage": Required[int] + inputTokenUsage: int + outputTokenUsage: int + totalTokenUsage: int class azure.ai.projects.types.CodeBasedEvaluatorDefinition(TypedDict, total=False): key "blob_uri": str key "code_text": str - key "data_schema": dict[str, Any] key "entry_point": str key "image_tag": str - key "init_parameters": dict[str, Any] - key "metrics": dict[str, EvaluatorMetric] + key "type": Required[Literal[EvaluatorDefinitionType.CODE]] blob_uri: str code_text: str data_schema: dict[str, Any] @@ -16802,15 +16875,18 @@ namespace azure.ai.projects.types image_tag: str init_parameters: dict[str, Any] metrics: dict[str, EvaluatorMetric] - type: Required[Literal[EvaluatorDefinitionType.CODE]] + type: Literal[EvaluatorDefinitionType.CODE] class azure.ai.projects.types.CodeConfiguration(TypedDict, total=False): key "content_hash": str + key "dependency_resolution": Required[Union[str, CodeDependencyResolution]] + key "entry_point": Required[list[str]] + key "runtime": Required[str] content_hash: str - dependency_resolution: Required[Union[str, CodeDependencyResolution]] - entry_point: Required[list[str]] - runtime: Required[str] + dependency_resolution: Union[str, CodeDependencyResolution] + entry_point: list[str] + runtime: str class azure.ai.projects.types.CodeInterpreterTool(TypedDict, total=False): @@ -16818,13 +16894,13 @@ namespace azure.ai.projects.types key "container": Union[str, AutoCodeInterpreterToolParam] key "description": str key "name": str - key "tool_configs": dict[str, ToolConfig] + key "type": Required[Literal[ToolType.CODE_INTERPRETER]] allowed_callers: list[Union[str, CallableToolAllowedCaller]] container: Union[str, AutoCodeInterpreterToolParam] description: str name: str tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolType.CODE_INTERPRETER]] + type: Literal[ToolType.CODE_INTERPRETER] class azure.ai.projects.types.CodeInterpreterToolboxTool(TypedDict, total=False): @@ -16832,68 +16908,83 @@ namespace azure.ai.projects.types key "container": Union[str, AutoCodeInterpreterToolParam] key "description": str key "name": str - key "tool_configs": dict[str, ToolConfig] + key "type": Required[Literal[ToolboxToolType.CODE_INTERPRETER]] allowed_callers: list[Union[str, CallableToolAllowedCaller]] container: Union[str, AutoCodeInterpreterToolParam] description: str name: str tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolboxToolType.CODE_INTERPRETER]] + type: Literal[ToolboxToolType.CODE_INTERPRETER] class azure.ai.projects.types.ComparisonFilter(TypedDict, total=False): - key: Required[str] - type: Required[Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]] - value: Required[Union[str, float, bool, list[Union[str, float]]]] + key "key": Required[str] + key "type": Required[Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]] + key "value": Required[Union[str, float, bool, list[Union[str, float]]]] + key: str + type: Literal[eq, ne, gt, gte, lt, lte, in, nin] + value: Union[str, float, bool, list[Union[str, float]]] class azure.ai.projects.types.CompoundFilter(TypedDict, total=False): - filters: Required[list[Union[ComparisonFilter, Any]]] - type: Required[Literal["and", "or"]] + key "filters": Required[list[Union[ComparisonFilter, Any]]] + key "type": Required[Literal["and", "or"]] + filters: list[Union[ComparisonFilter, Any]] + type: Literal[and, or] class azure.ai.projects.types.ComputerTool(TypedDict, total=False): - type: Required[Literal[ToolType.COMPUTER]] + key "type": Required[Literal[ToolType.COMPUTER]] + type: Literal[ToolType.COMPUTER] class azure.ai.projects.types.ComputerUsePreviewTool(TypedDict, total=False): - display_height: Required[int] - display_width: Required[int] - environment: Required[Union[str, ComputerEnvironment]] - type: Required[Literal[ToolType.COMPUTER_USE_PREVIEW]] + key "display_height": Required[int] + key "display_width": Required[int] + key "environment": Required[Union[str, ComputerEnvironment]] + key "type": Required[Literal[ToolType.COMPUTER_USE_PREVIEW]] + display_height: int + display_width: int + environment: Union[str, ComputerEnvironment] + type: Literal[ToolType.COMPUTER_USE_PREVIEW] class azure.ai.projects.types.ContainerAutoParam(TypedDict, total=False): - key "file_ids": list[str] key "memory_limit": Optional[Union[str, ContainerMemoryLimit]] - key "network_policy": ForwardRef('ContainerNetworkPolicyParam') - key "skills": list[ContainerSkill] + key "network_policy": ForwardRef('ContainerNetworkPolicyParam', module='types') + key "type": Required[Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO]] file_ids: list[str] memory_limit: Union[str, ContainerMemoryLimit] network_policy: ContainerNetworkPolicyParam skills: list[ContainerSkill] - type: Required[Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO]] + type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO] class azure.ai.projects.types.ContainerConfiguration(TypedDict, total=False): - image: Required[str] + key "image": Required[str] + image: str class azure.ai.projects.types.ContainerNetworkPolicyAllowlistParam(TypedDict, total=False): - key "domain_secrets": list[ContainerNetworkPolicyDomainSecretParam] - allowed_domains: Required[list[str]] + key "allowed_domains": Required[list[str]] + key "type": Required[Literal[ContainerNetworkPolicyParamType.ALLOWLIST]] + allowed_domains: list[str] domain_secrets: list[ContainerNetworkPolicyDomainSecretParam] - type: Required[Literal[ContainerNetworkPolicyParamType.ALLOWLIST]] + type: Literal[ContainerNetworkPolicyParamType.ALLOWLIST] class azure.ai.projects.types.ContainerNetworkPolicyDisabledParam(TypedDict, total=False): - type: Required[Literal[ContainerNetworkPolicyParamType.DISABLED]] + key "type": Required[Literal[ContainerNetworkPolicyParamType.DISABLED]] + type: Literal[ContainerNetworkPolicyParamType.DISABLED] class azure.ai.projects.types.ContainerNetworkPolicyDomainSecretParam(TypedDict, total=False): - domain: Required[str] - name: Required[str] - value: Required[str] + key "domain": Required[str] + key "name": Required[str] + key "value": Required[str] + domain: str + name: str + value: str class azure.ai.projects.types.ContainerNetworkPolicyParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -16907,72 +16998,85 @@ namespace azure.ai.projects.types class azure.ai.projects.types.ContinuousEvaluationRuleAction(TypedDict, total=False): + key "evalId": Required[str] key "maxHourlyRuns": int key "samplingRate": float - evalId: Required[str] + key "type": Required[Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION]] + evalId: str maxHourlyRuns: int samplingRate: float - type: Required[Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION]] + type: Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION] class azure.ai.projects.types.CosmosDBIndex(TypedDict, total=False): + key "connectionName": Required[str] + key "containerName": Required[str] + key "databaseName": Required[str] key "description": str + key "embeddingConfiguration": Required[EmbeddingConfiguration] + key "fieldMapping": Required[FieldMapping] key "id": str - key "tags": dict[str, str] - connectionName: Required[str] - containerName: Required[str] - databaseName: Required[str] + key "name": Required[str] + key "type": Required[Literal[IndexType.COSMOS_DB]] + key "version": Required[str] + connectionName: str + containerName: str + databaseName: str description: str - embeddingConfiguration: Required[EmbeddingConfiguration] - fieldMapping: Required[FieldMapping] + embeddingConfiguration: EmbeddingConfiguration + fieldMapping: FieldMapping id: str - name: Required[str] + name: str tags: dict[str, str] - type: Required[Literal[IndexType.COSMOS_DB]] - version: Required[str] + type: Literal[IndexType.COSMOS_DB] + version: str class azure.ai.projects.types.CreateAgentVersionFromManifestRequest(TypedDict, total=False): key "description": str - key "metadata": dict[str, str] + key "manifest_id": Required[str] + key "parameter_values": Required[dict[str, Any]] description: str - manifest_id: Required[str] + manifest_id: str metadata: dict[str, str] - parameter_values: Required[dict[str, Any]] + parameter_values: dict[str, Any] class azure.ai.projects.types.CreateAgentVersionRequest(TypedDict, total=False): - key "blueprint_reference": ForwardRef('AgentBlueprintReference') + key "blueprint_reference": ForwardRef('AgentBlueprintReference', module='types') + key "definition": Required[AgentDefinition] key "description": str key "draft": bool - key "metadata": dict[str, str] blueprint_reference: AgentBlueprintReference - definition: Required[AgentDefinition] + definition: AgentDefinition description: str draft: bool metadata: dict[str, str] class azure.ai.projects.types.CreateMemoryRequest(TypedDict, total=False): - content: Required[str] - kind: Required[Union[str, MemoryItemKind]] - scope: Required[str] + key "content": Required[str] + key "kind": Required[Union[str, MemoryItemKind]] + key "scope": Required[str] + content: str + kind: Union[str, MemoryItemKind] + scope: str class azure.ai.projects.types.CreateMemoryStoreRequest(TypedDict, total=False): + key "definition": Required[MemoryStoreDefinition] key "description": str - key "metadata": dict[str, str] - definition: Required[MemoryStoreDefinition] + key "name": Required[str] + definition: MemoryStoreDefinition description: str metadata: dict[str, str] - name: Required[str] + name: str class azure.ai.projects.types.CreateOrUpdateRoutineRequest(TypedDict, total=False): - key "action": ForwardRef('RoutineAction') + key "action": ForwardRef('RoutineAction', module='types') key "description": str key "enabled": bool - key "triggers": dict[str, RoutineTrigger] action: RoutineAction description: str enabled: bool @@ -16981,33 +17085,34 @@ namespace azure.ai.projects.types class azure.ai.projects.types.CreateSessionRequest(TypedDict, total=False): key "agent_session_id": str + key "version_indicator": Required[VersionIndicator] agent_session_id: str - version_indicator: Required[VersionIndicator] + version_indicator: VersionIndicator class azure.ai.projects.types.CreateSkillVersionFromFilesBody(TypedDict, total=False): key "default": bool + key "files": Required[list[Union[str, bytes, IO[str], IO[bytes], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]]], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]], Optional[str]]]]] default: bool - files: Required[list[Union[str, bytes, IO[str], IO[bytes], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]]], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]], Optional[str]]]]] + files: list[FileType] class azure.ai.projects.types.CreateSkillVersionRequest(TypedDict, total=False): key "default": bool - key "inline_content": ForwardRef('SkillInlineContent') + key "inline_content": ForwardRef('SkillInlineContent', module='types') default: bool inline_content: SkillInlineContent class azure.ai.projects.types.CreateToolboxVersionRequest(TypedDict, total=False): key "description": str - key "metadata": dict[str, str] - key "policies": ForwardRef('ToolboxPolicies') - key "skills": list[ToolboxSkill] + key "policies": ForwardRef('ToolboxPolicies', module='types') + key "tools": Required[list[ToolboxTool]] description: str metadata: dict[str, str] policies: ToolboxPolicies skills: list[ToolboxSkill] - tools: Required[list[ToolboxTool]] + tools: list[ToolboxTool] class azure.ai.projects.types.CreateTranscriptionResponseJsonUsageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -17017,44 +17122,55 @@ namespace azure.ai.projects.types class azure.ai.projects.types.CronTrigger(TypedDict, total=False): key "endTime": str + key "expression": Required[str] key "startTime": str key "timeZone": str + key "type": Required[Literal[TriggerType.CRON]] endTime: str - expression: Required[str] + expression: str startTime: str timeZone: str - type: Required[Literal[TriggerType.CRON]] + type: Literal[TriggerType.CRON] class azure.ai.projects.types.CustomGrammarFormatParam(TypedDict, total=False): - definition: Required[str] - syntax: Required[Union[str, GrammarSyntax1]] - type: Required[Literal[CustomToolParamFormatType.GRAMMAR]] + key "definition": Required[str] + key "syntax": Required[Union[str, GrammarSyntax1]] + key "type": Required[Literal[CustomToolParamFormatType.GRAMMAR]] + definition: str + syntax: Union[str, GrammarSyntax1] + type: Literal[CustomToolParamFormatType.GRAMMAR] class azure.ai.projects.types.CustomRoutineTrigger(TypedDict, total=False): key "event_name": str + key "parameters": Required[dict[str, Any]] + key "provider": Required[str] + key "type": Required[Literal[RoutineTriggerType.CUSTOM]] event_name: str - parameters: Required[dict[str, Any]] - provider: Required[str] - type: Required[Literal[RoutineTriggerType.CUSTOM]] + parameters: dict[str, Any] + provider: str + type: Literal[RoutineTriggerType.CUSTOM] class azure.ai.projects.types.CustomTextFormatParam(TypedDict, total=False): - type: Required[Literal[CustomToolParamFormatType.TEXT]] + key "type": Required[Literal[CustomToolParamFormatType.TEXT]] + type: Literal[CustomToolParamFormatType.TEXT] class azure.ai.projects.types.CustomToolParam(TypedDict, total=False): key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] key "defer_loading": bool key "description": str - key "format": ForwardRef('CustomToolParamFormat') + key "format": ForwardRef('CustomToolParamFormat', module='types') + key "name": Required[str] + key "type": Required[Literal[ToolType.CUSTOM]] allowed_callers: list[Union[str, CallableToolAllowedCaller]] defer_loading: bool description: str format: CustomToolParamFormat - name: Required[str] - type: Required[Literal[ToolType.CUSTOM]] + name: str + type: Literal[ToolType.CUSTOM] class azure.ai.projects.types.CustomToolParamFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -17063,37 +17179,45 @@ namespace azure.ai.projects.types class azure.ai.projects.types.DailyRecurrenceSchedule(TypedDict, total=False): - hours: Required[list[int]] - type: Required[Literal[RecurrenceType.DAILY]] + key "hours": Required[list[int]] + key "type": Required[Literal[RecurrenceType.DAILY]] + hours: list[int] + type: Literal[RecurrenceType.DAILY] class azure.ai.projects.types.DataGenerationJob(TypedDict, total=False): - key "error": ForwardRef('ApiError') + key "created_at": Required[int] + key "error": ForwardRef('ApiError', module='types') key "finished_at": int - key "inputs": ForwardRef('DataGenerationJobInputs') - key "result": ForwardRef('DataGenerationJobResult') - created_at: Required[int] + key "id": Required[str] + key "inputs": ForwardRef('DataGenerationJobInputs', module='types') + key "result": ForwardRef('DataGenerationJobResult', module='types') + key "status": Required[Union[str, JobStatus]] + created_at: int error: ApiError finished_at: int - id: Required[str] + id: str inputs: DataGenerationJobInputs result: DataGenerationJobResult - status: Required[Union[str, JobStatus]] + status: Union[str, JobStatus] class azure.ai.projects.types.DataGenerationJobInputs(TypedDict, total=False): - key "output_options": ForwardRef('DataGenerationJobOutputOptions') - name: Required[str] - options: Required[DataGenerationJobOptions] + key "name": Required[str] + key "options": Required[DataGenerationJobOptions] + key "output_options": ForwardRef('DataGenerationJobOutputOptions', module='types') + key "scenario": Required[Union[str, DataGenerationJobScenario]] + key "sources": Required[list[DataGenerationJobSource]] + name: str + options: DataGenerationJobOptions output_options: DataGenerationJobOutputOptions - scenario: Required[Union[str, DataGenerationJobScenario]] - sources: Required[list[DataGenerationJobSource]] + scenario: Union[str, DataGenerationJobScenario] + sources: list[DataGenerationJobSource] class azure.ai.projects.types.DataGenerationJobOutputOptions(TypedDict, total=False): key "description": str key "name": str - key "tags": dict[str, str] description: str name: str tags: dict[str, str] @@ -17105,9 +17229,9 @@ namespace azure.ai.projects.types class azure.ai.projects.types.DataGenerationJobResult(TypedDict, total=False): - key "outputs": list[DataGenerationJobOutput] - key "token_usage": ForwardRef('DataGenerationTokenUsage') - generated_samples: Required[int] + key "generated_samples": Required[int] + key "token_usage": ForwardRef('DataGenerationTokenUsage', module='types') + generated_samples: int outputs: list[DataGenerationJobOutput] token_usage: DataGenerationTokenUsage @@ -17127,41 +17251,49 @@ namespace azure.ai.projects.types class azure.ai.projects.types.DataGenerationModelOptions(TypedDict, total=False): - model: Required[str] + key "model": Required[str] + model: str class azure.ai.projects.types.DataGenerationTokenUsage(TypedDict, total=False): - completion_tokens: Required[int] - prompt_tokens: Required[int] - total_tokens: Required[int] + key "completion_tokens": Required[int] + key "prompt_tokens": Required[int] + key "total_tokens": Required[int] + completion_tokens: int + prompt_tokens: int + total_tokens: int class azure.ai.projects.types.DatasetDataGenerationJobOutput(TypedDict, total=False): key "description": str key "id": str key "name": str - key "tags": dict[str, str] + key "type": Required[Literal[DataGenerationJobOutputType.DATASET]] key "version": str description: str id: str name: str tags: dict[str, str] - type: Required[Literal[DataGenerationJobOutputType.DATASET]] + type: Literal[DataGenerationJobOutputType.DATASET] version: str class azure.ai.projects.types.DatasetEvaluatorGenerationJobSource(TypedDict, total=False): key "description": str + key "name": Required[str] + key "type": Required[Literal[EvaluatorGenerationJobSourceType.DATASET]] key "version": str description: str - name: Required[str] - type: Required[Literal[EvaluatorGenerationJobSourceType.DATASET]] + name: str + type: Literal[EvaluatorGenerationJobSourceType.DATASET] version: str class azure.ai.projects.types.DatasetReference(TypedDict, total=False): - name: Required[str] - version: Required[str] + key "name": Required[str] + key "version": Required[str] + name: str + version: str class azure.ai.projects.types.DatasetType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -17170,108 +17302,149 @@ namespace azure.ai.projects.types class azure.ai.projects.types.DeleteScopeRequest(TypedDict, total=False): - scope: Required[str] + key "scope": Required[str] + scope: str class azure.ai.projects.types.Dimension(TypedDict, total=False): key "always_applicable": bool + key "description": Required[str] + key "id": Required[str] + key "weight": Required[int] always_applicable: bool - description: Required[str] - id: Required[str] - weight: Required[int] + description: str + id: str + weight: int class azure.ai.projects.types.DispatchRoutineAsyncRequest(TypedDict, total=False): - key "payload": ForwardRef('RoutineDispatchPayload') + key "payload": ForwardRef('RoutineDispatchPayload', module='types') payload: RoutineDispatchPayload class azure.ai.projects.types.EmbeddingConfiguration(TypedDict, total=False): - embeddingField: Required[str] - modelDeploymentName: Required[str] + key "embeddingField": Required[str] + key "modelDeploymentName": Required[str] + embeddingField: str + modelDeploymentName: str class azure.ai.projects.types.EmptyModelParam(TypedDict, total=False): class azure.ai.projects.types.EndpointBasedEvaluatorDefinition(TypedDict, total=False): - key "data_schema": dict[str, Any] - key "init_parameters": dict[str, Any] - key "metrics": dict[str, EvaluatorMetric] - connection_name: Required[str] + key "connection_name": Required[str] + key "type": Required[Literal[EvaluatorDefinitionType.ENDPOINT]] + connection_name: str data_schema: dict[str, Any] init_parameters: dict[str, Any] metrics: dict[str, EvaluatorMetric] - type: Required[Literal[EvaluatorDefinitionType.ENDPOINT]] + type: Literal[EvaluatorDefinitionType.ENDPOINT] class azure.ai.projects.types.EntraAuthorizationScheme(TypedDict, total=False): - type: Required[Literal[AgentEndpointAuthorizationSchemeType.ENTRA]] + key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.ENTRA]] + type: Literal[AgentEndpointAuthorizationSchemeType.ENTRA] class azure.ai.projects.types.EvalResult(TypedDict, total=False): - name: Required[str] - passed: Required[bool] - score: Required[float] - type: Required[str] + key "name": Required[str] + key "passed": Required[bool] + key "score": Required[float] + key "type": Required[str] + name: str + passed: bool + score: float + type: str class azure.ai.projects.types.EvalRunResultCompareItem(TypedDict, total=False): - deltaEstimate: Required[float] - pValue: Required[float] - treatmentEffect: Required[Union[str, TreatmentEffectType]] - treatmentRunId: Required[str] - treatmentRunSummary: Required[EvalRunResultSummary] + key "deltaEstimate": Required[float] + key "pValue": Required[float] + key "treatmentEffect": Required[Union[str, TreatmentEffectType]] + key "treatmentRunId": Required[str] + key "treatmentRunSummary": Required[EvalRunResultSummary] + deltaEstimate: float + pValue: float + treatmentEffect: Union[str, TreatmentEffectType] + treatmentRunId: str + treatmentRunSummary: EvalRunResultSummary class azure.ai.projects.types.EvalRunResultComparison(TypedDict, total=False): - baselineRunSummary: Required[EvalRunResultSummary] - compareItems: Required[list[EvalRunResultCompareItem]] - evaluator: Required[str] - metric: Required[str] - testingCriteria: Required[str] + key "baselineRunSummary": Required[EvalRunResultSummary] + key "compareItems": Required[list[EvalRunResultCompareItem]] + key "evaluator": Required[str] + key "metric": Required[str] + key "testingCriteria": Required[str] + baselineRunSummary: EvalRunResultSummary + compareItems: list[EvalRunResultCompareItem] + evaluator: str + metric: str + testingCriteria: str class azure.ai.projects.types.EvalRunResultSummary(TypedDict, total=False): - average: Required[float] - runId: Required[str] - sampleCount: Required[int] - standardDeviation: Required[float] + key "average": Required[float] + key "runId": Required[str] + key "sampleCount": Required[int] + key "standardDeviation": Required[float] + average: float + runId: str + sampleCount: int + standardDeviation: float class azure.ai.projects.types.EvaluationComparisonInsightRequest(TypedDict, total=False): - baselineRunId: Required[str] - evalId: Required[str] - treatmentRunIds: Required[list[str]] - type: Required[Literal[InsightType.EVALUATION_COMPARISON]] + key "baselineRunId": Required[str] + key "evalId": Required[str] + key "treatmentRunIds": Required[list[str]] + key "type": Required[Literal[InsightType.EVALUATION_COMPARISON]] + baselineRunId: str + evalId: str + treatmentRunIds: list[str] + type: Literal[InsightType.EVALUATION_COMPARISON] class azure.ai.projects.types.EvaluationComparisonInsightResult(TypedDict, total=False): - comparisons: Required[list[EvalRunResultComparison]] - method: Required[str] - type: Required[Literal[InsightType.EVALUATION_COMPARISON]] + key "comparisons": Required[list[EvalRunResultComparison]] + key "method": Required[str] + key "type": Required[Literal[InsightType.EVALUATION_COMPARISON]] + comparisons: list[EvalRunResultComparison] + method: str + type: Literal[InsightType.EVALUATION_COMPARISON] class azure.ai.projects.types.EvaluationResultSample(TypedDict, total=False): - correlationInfo: Required[dict[str, Any]] - evaluationResult: Required[EvalResult] - features: Required[dict[str, Any]] - id: Required[str] - type: Required[Literal[SampleType.EVALUATION_RESULT_SAMPLE]] + key "correlationInfo": Required[dict[str, Any]] + key "evaluationResult": Required[EvalResult] + key "features": Required[dict[str, Any]] + key "id": Required[str] + key "type": Required[Literal[SampleType.EVALUATION_RESULT_SAMPLE]] + correlationInfo: dict[str, Any] + evaluationResult: EvalResult + features: dict[str, Any] + id: str + type: Literal[SampleType.EVALUATION_RESULT_SAMPLE] class azure.ai.projects.types.EvaluationRule(TypedDict, total=False): + key "action": Required[EvaluationRuleAction] key "description": str key "displayName": str - key "filter": ForwardRef('EvaluationRuleFilter') - action: Required[EvaluationRuleAction] + key "enabled": Required[bool] + key "eventType": Required[Union[str, EvaluationRuleEventType]] + key "filter": ForwardRef('EvaluationRuleFilter', module='types') + key "id": Required[str] + key "systemData": Required[dict[str, str]] + action: EvaluationRuleAction description: str displayName: str - enabled: Required[bool] - eventType: Required[Union[str, EvaluationRuleEventType]] + enabled: bool + eventType: Union[str, EvaluationRuleEventType] filter: EvaluationRuleFilter - id: Required[str] - systemData: Required[dict[str, str]] + id: str + systemData: dict[str, str] class azure.ai.projects.types.EvaluationRuleActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -17280,50 +17453,61 @@ namespace azure.ai.projects.types class azure.ai.projects.types.EvaluationRuleFilter(TypedDict, total=False): - agentName: Required[str] + key "agentName": Required[str] + agentName: str class azure.ai.projects.types.EvaluationRunClusterInsightRequest(TypedDict, total=False): - key "modelConfiguration": ForwardRef('InsightModelConfiguration') - evalId: Required[str] + key "evalId": Required[str] + key "modelConfiguration": ForwardRef('InsightModelConfiguration', module='types') + key "runIds": Required[list[str]] + key "type": Required[Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT]] + evalId: str modelConfiguration: InsightModelConfiguration - runIds: Required[list[str]] - type: Required[Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT]] + runIds: list[str] + type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] class azure.ai.projects.types.EvaluationRunClusterInsightResult(TypedDict, total=False): - clusterInsight: Required[ClusterInsightResult] - type: Required[Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT]] + key "clusterInsight": Required[ClusterInsightResult] + key "type": Required[Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT]] + clusterInsight: ClusterInsightResult + type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] class azure.ai.projects.types.EvaluationScheduleTask(TypedDict, total=False): - key "configuration": dict[str, str] + key "evalId": Required[str] + key "evalRun": Required[dict[str, Any]] + key "type": Required[Literal[ScheduleTaskType.EVALUATION]] configuration: dict[str, str] - evalId: Required[str] - evalRun: Required[dict[str, Any]] - type: Required[Literal[ScheduleTaskType.EVALUATION]] + evalId: str + evalRun: dict[str, Any] + type: Literal[ScheduleTaskType.EVALUATION] class azure.ai.projects.types.EvaluationTaxonomy(TypedDict, total=False): key "description": str key "id": str - key "properties": dict[str, str] - key "tags": dict[str, str] - key "taxonomyCategories": list[TaxonomyCategory] + key "name": Required[str] + key "taxonomyInput": Required[EvaluationTaxonomyInput] + key "version": Required[str] description: str id: str - name: Required[str] + name: str properties: dict[str, str] tags: dict[str, str] taxonomyCategories: list[TaxonomyCategory] - taxonomyInput: Required[EvaluationTaxonomyInput] - version: Required[str] + taxonomyInput: EvaluationTaxonomyInput + version: str class azure.ai.projects.types.EvaluationTaxonomyInput(TypedDict, total=False): - riskCategories: Required[list[Union[str, RiskCategory]]] - target: Required[EvaluationTarget] - type: Required[Literal[EvaluationTaxonomyInputType.AGENT]] + key "riskCategories": Required[list[Union[str, RiskCategory]]] + key "target": Required[EvaluationTarget] + key "type": Required[Literal[EvaluationTaxonomyInputType.AGENT]] + riskCategories: list[Union[str, RiskCategory]] + target: EvaluationTarget + type: Literal[EvaluationTaxonomyInputType.AGENT] class azure.ai.projects.types.EvaluationTaxonomyInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -17332,7 +17516,8 @@ namespace azure.ai.projects.types class azure.ai.projects.types.EvaluatorCredentialRequest(TypedDict, total=False): - blob_uri: Required[str] + key "blob_uri": Required[str] + blob_uri: str class azure.ai.projects.types.EvaluatorDefinitionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -17346,35 +17531,42 @@ namespace azure.ai.projects.types class azure.ai.projects.types.EvaluatorGenerationArtifacts(TypedDict, total=False): - dataset: Required[DatasetReference] - kinds: Required[list[str]] + key "dataset": Required[DatasetReference] + key "kinds": Required[list[str]] + dataset: DatasetReference + kinds: list[str] class azure.ai.projects.types.EvaluatorGenerationInputs(TypedDict, total=False): key "evaluator_description": str key "evaluator_display_name": str + key "evaluator_name": Required[str] + key "model": Required[str] + key "sources": Required[list[EvaluatorGenerationJobSource]] evaluator_description: str evaluator_display_name: str - evaluator_name: Required[str] - model: Required[str] - sources: Required[list[EvaluatorGenerationJobSource]] + evaluator_name: str + model: str + sources: list[EvaluatorGenerationJobSource] class azure.ai.projects.types.EvaluatorGenerationJob(TypedDict, total=False): - key "error": ForwardRef('ApiError') + key "created_at": Required[int] + key "error": ForwardRef('ApiError', module='types') key "finished_at": int - key "input_quality_warnings": list[RubricGenerationInputQualityWarning] - key "inputs": ForwardRef('EvaluatorGenerationInputs') - key "result": ForwardRef('EvaluatorVersion') - key "usage": ForwardRef('EvaluatorGenerationTokenUsage') - created_at: Required[int] + key "id": Required[str] + key "inputs": ForwardRef('EvaluatorGenerationInputs', module='types') + key "result": ForwardRef('EvaluatorVersion', module='types') + key "status": Required[Union[str, JobStatus]] + key "usage": ForwardRef('EvaluatorGenerationTokenUsage', module='types') + created_at: int error: ApiError finished_at: int - id: Required[str] + id: str input_quality_warnings: list[RubricGenerationInputQualityWarning] inputs: EvaluatorGenerationInputs result: EvaluatorVersion - status: Required[Union[str, JobStatus]] + status: Union[str, JobStatus] usage: EvaluatorGenerationTokenUsage @@ -17386,9 +17578,12 @@ namespace azure.ai.projects.types class azure.ai.projects.types.EvaluatorGenerationTokenUsage(TypedDict, total=False): - input_tokens: Required[int] - output_tokens: Required[int] - total_tokens: Required[int] + key "input_tokens": Required[int] + key "output_tokens": Required[int] + key "total_tokens": Required[int] + input_tokens: int + output_tokens: int + total_tokens: int class azure.ai.projects.types.EvaluatorMetric(TypedDict, total=False): @@ -17407,82 +17602,88 @@ namespace azure.ai.projects.types class azure.ai.projects.types.EvaluatorVersion(TypedDict, total=False): + key "categories": Required[list[Union[str, EvaluatorCategory]]] + key "created_at": Required[str] + key "created_by": Required[str] + key "definition": Required[EvaluatorDefinition] key "description": str key "display_name": str - key "generation_artifacts": ForwardRef('EvaluatorGenerationArtifacts') + key "evaluator_type": Required[Union[str, EvaluatorType]] + key "generation_artifacts": ForwardRef('EvaluatorGenerationArtifacts', module='types') key "generation_job_id": str key "id": str - key "metadata": dict[str, str] - key "supported_evaluation_levels": list[Union[str, EvaluationLevel]] - key "tags": dict[str, str] - key "warnings": list[Union[str, GenerationWarningType]] - categories: Required[list[Union[str, EvaluatorCategory]]] - created_at: Required[str] - created_by: Required[str] - definition: Required[EvaluatorDefinition] + key "modified_at": Required[str] + key "name": Required[str] + key "version": Required[str] + categories: list[Union[str, EvaluatorCategory]] + created_at: str + created_by: str + definition: EvaluatorDefinition description: str display_name: str - evaluator_type: Required[Union[str, EvaluatorType]] + evaluator_type: Union[str, EvaluatorType] generation_artifacts: EvaluatorGenerationArtifacts generation_job_id: str id: str metadata: dict[str, str] - modified_at: Required[str] - name: Required[str] + modified_at: str + name: str supported_evaluation_levels: list[Union[str, EvaluationLevel]] tags: dict[str, str] - version: Required[str] + version: str warnings: list[Union[str, GenerationWarningType]] class azure.ai.projects.types.ExternalAgentDefinition(TypedDict, total=False): + key "kind": Required[Literal[AgentKind.EXTERNAL]] key "otel_agent_id": str - key "rai_config": ForwardRef('RaiConfig') - kind: Required[Literal[AgentKind.EXTERNAL]] + key "rai_config": ForwardRef('RaiConfig', module='types') + kind: Literal[AgentKind.EXTERNAL] otel_agent_id: str rai_config: RaiConfig class azure.ai.projects.types.FabricDataAgentToolParameters(TypedDict, total=False): - key "project_connections": list[ToolProjectConnection] project_connections: list[ToolProjectConnection] class azure.ai.projects.types.FabricIQPreviewTool(TypedDict, total=False): + key "project_connection_id": Required[str] key "require_approval": Optional[Union[MCPToolRequireApproval, str]] key "server_label": str key "server_url": str - project_connection_id: Required[str] + key "type": Required[Literal[ToolType.FABRIC_IQ_PREVIEW]] + project_connection_id: str require_approval: Union[MCPToolRequireApproval, str] server_label: str server_url: str - type: Required[Literal[ToolType.FABRIC_IQ_PREVIEW]] + type: Literal[ToolType.FABRIC_IQ_PREVIEW] class azure.ai.projects.types.FabricIQPreviewToolboxTool(TypedDict, total=False): key "description": str key "name": str + key "project_connection_id": Required[str] key "require_approval": Optional[Union[MCPToolRequireApproval, str]] key "server_label": str key "server_url": str - key "tool_configs": dict[str, ToolConfig] + key "type": Required[Literal[ToolboxToolType.FABRIC_IQ_PREVIEW]] description: str name: str - project_connection_id: Required[str] + project_connection_id: str require_approval: Union[MCPToolRequireApproval, str] server_label: str server_url: str tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolboxToolType.FABRIC_IQ_PREVIEW]] + type: Literal[ToolboxToolType.FABRIC_IQ_PREVIEW] class azure.ai.projects.types.FieldMapping(TypedDict, total=False): + key "contentFields": Required[list[str]] key "filepathField": str - key "metadataFields": list[str] key "titleField": str key "urlField": str - key "vectorFields": list[str] - contentFields: Required[list[str]] + contentFields: list[str] filepathField: str metadataFields: list[str] titleField: str @@ -17491,33 +17692,41 @@ namespace azure.ai.projects.types class azure.ai.projects.types.FileDataGenerationJobOutput(TypedDict, total=False): - filename: Required[str] - id: Required[str] - type: Required[Literal[DataGenerationJobOutputType.FILE]] + key "filename": Required[str] + key "id": Required[str] + key "type": Required[Literal[DataGenerationJobOutputType.FILE]] + filename: str + id: str + type: Literal[DataGenerationJobOutputType.FILE] class azure.ai.projects.types.FileDataGenerationJobSource(TypedDict, total=False): key "description": str + key "id": Required[str] + key "type": Required[Literal[DataGenerationJobSourceType.FILE]] description: str - id: Required[str] - type: Required[Literal[DataGenerationJobSourceType.FILE]] + id: str + type: Literal[DataGenerationJobSourceType.FILE] class azure.ai.projects.types.FileDatasetVersion(TypedDict, total=False): key "connectionName": str + key "dataUri": Required[str] key "description": str key "id": str key "isReference": bool - key "tags": dict[str, str] + key "name": Required[str] + key "type": Required[Literal[DatasetType.URI_FILE]] + key "version": Required[str] connectionName: str - dataUri: Required[str] + dataUri: str description: str id: str isReference: bool - name: Required[str] + name: str tags: dict[str, str] - type: Required[Literal[DatasetType.URI_FILE]] - version: Required[str] + type: Literal[DatasetType.URI_FILE] + version: str class azure.ai.projects.types.FileSearchTool(TypedDict, total=False): @@ -17525,16 +17734,17 @@ namespace azure.ai.projects.types key "filters": Optional[Filters] key "max_num_results": int key "name": str - key "ranking_options": ForwardRef('RankingOptions') - key "tool_configs": dict[str, ToolConfig] + key "ranking_options": ForwardRef('RankingOptions', module='types') + key "type": Required[Literal[ToolType.FILE_SEARCH]] + key "vector_store_ids": Required[list[str]] description: str filters: Filters max_num_results: int name: str ranking_options: RankingOptions tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolType.FILE_SEARCH]] - vector_store_ids: Required[list[str]] + type: Literal[ToolType.FILE_SEARCH] + vector_store_ids: list[str] class azure.ai.projects.types.FileSearchToolboxTool(TypedDict, total=False): @@ -17542,40 +17752,45 @@ namespace azure.ai.projects.types key "filters": Optional[Filters] key "max_num_results": int key "name": str - key "ranking_options": ForwardRef('RankingOptions') - key "tool_configs": dict[str, ToolConfig] - key "vector_store_ids": list[str] + key "ranking_options": ForwardRef('RankingOptions', module='types') + key "type": Required[Literal[ToolboxToolType.FILE_SEARCH]] description: str filters: Filters max_num_results: int name: str ranking_options: RankingOptions tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolboxToolType.FILE_SEARCH]] + type: Literal[ToolboxToolType.FILE_SEARCH] vector_store_ids: list[str] class azure.ai.projects.types.FixedRatioVersionSelectionRule(TypedDict, total=False): - agent_version: Required[str] - traffic_percentage: Required[int] - type: Required[Literal[VersionSelectorType.FIXED_RATIO]] + key "agent_version": Required[str] + key "traffic_percentage": Required[int] + key "type": Required[Literal[VersionSelectorType.FIXED_RATIO]] + agent_version: str + traffic_percentage: int + type: Literal[VersionSelectorType.FIXED_RATIO] class azure.ai.projects.types.FolderDatasetVersion(TypedDict, total=False): key "connectionName": str + key "dataUri": Required[str] key "description": str key "id": str key "isReference": bool - key "tags": dict[str, str] + key "name": Required[str] + key "type": Required[Literal[DatasetType.URI_FOLDER]] + key "version": Required[str] connectionName: str - dataUri: Required[str] + dataUri: str description: str id: str isReference: bool - name: Required[str] + name: str tags: dict[str, str] - type: Required[Literal[DatasetType.URI_FOLDER]] - version: Required[str] + type: Literal[DatasetType.URI_FOLDER] + version: str class azure.ai.projects.types.FoundryModelWarning(TypedDict, total=False): @@ -17590,24 +17805,26 @@ namespace azure.ai.projects.types key "description": str key "environment": Optional[FunctionShellToolParamEnvironment] key "name": str - key "tool_configs": dict[str, ToolConfig] + key "type": Required[Literal[ToolType.SHELL]] allowed_callers: list[Union[str, CallableToolAllowedCaller]] description: str environment: FunctionShellToolParamEnvironment name: str tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolType.SHELL]] + type: Literal[ToolType.SHELL] class azure.ai.projects.types.FunctionShellToolParamEnvironmentContainerReferenceParam(TypedDict, total=False): - container_id: Required[str] - type: Required[Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE]] + key "container_id": Required[str] + key "type": Required[Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE]] + container_id: str + type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE] class azure.ai.projects.types.FunctionShellToolParamEnvironmentLocalEnvironmentParam(TypedDict, total=False): - key "skills": list[LocalSkillParam] + key "type": Required[Literal[FunctionShellToolParamEnvironmentType.LOCAL]] skills: list[LocalSkillParam] - type: Required[Literal[FunctionShellToolParamEnvironmentType.LOCAL]] + type: Literal[FunctionShellToolParamEnvironmentType.LOCAL] class azure.ai.projects.types.FunctionShellToolParamEnvironmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -17620,83 +17837,105 @@ namespace azure.ai.projects.types key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] key "defer_loading": bool key "description": Optional[str] + key "name": Required[str] key "output_schema": Optional[dict[str, Any]] + key "parameters": Required[Optional[dict[str, Any]]] + key "strict": Required[Optional[bool]] + key "type": Required[Literal[ToolType.FUNCTION]] allowed_callers: list[Union[str, CallableToolAllowedCaller]] defer_loading: bool description: str - name: Required[str] + name: str output_schema: dict[str, Any] - parameters: Required[Optional[dict[str, Any]]] - strict: Required[Optional[bool]] - type: Required[Literal[ToolType.FUNCTION]] + parameters: dict[str, Any] + strict: bool + type: Literal[ToolType.FUNCTION] class azure.ai.projects.types.FunctionToolParam(TypedDict, total=False): key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] key "defer_loading": bool key "description": Optional[str] + key "name": Required[str] key "output_schema": Optional[dict[str, Any]] key "parameters": Optional[EmptyModelParam] key "strict": Optional[bool] + key "type": Required[Literal["function"]] allowed_callers: list[Union[str, CallableToolAllowedCaller]] defer_loading: bool description: str - name: Required[str] + name: str output_schema: dict[str, Any] parameters: EmptyModelParam strict: bool - type: Required[Literal["function"]] + type: Literal[function] class azure.ai.projects.types.GenerateAgentRequest(TypedDict, total=False): - kind: Required[Union[str, AgentKind]] + key "kind": Required[Union[str, AgentKind]] + kind: Union[str, AgentKind] class azure.ai.projects.types.GitHubIssueRoutineTrigger(TypedDict, total=False): - connection_id: Required[str] - issue_event: Required[Union[str, GitHubIssueEvent]] - owner: Required[str] - repository: Required[str] - type: Required[Literal[RoutineTriggerType.GITHUB_ISSUE]] + key "connection_id": Required[str] + key "issue_event": Required[Union[str, GitHubIssueEvent]] + key "owner": Required[str] + key "repository": Required[str] + key "type": Required[Literal[RoutineTriggerType.GITHUB_ISSUE]] + connection_id: str + issue_event: Union[str, GitHubIssueEvent] + owner: str + repository: str + type: Literal[RoutineTriggerType.GITHUB_ISSUE] class azure.ai.projects.types.HeaderTelemetryEndpointAuth(TypedDict, total=False): - header_name: Required[str] - secret_id: Required[str] - secret_key: Required[str] - type: Required[Literal[TelemetryEndpointAuthType.HEADER]] + key "header_name": Required[str] + key "secret_id": Required[str] + key "secret_key": Required[str] + key "type": Required[Literal[TelemetryEndpointAuthType.HEADER]] + header_name: str + secret_id: str + secret_key: str + type: Literal[TelemetryEndpointAuthType.HEADER] class azure.ai.projects.types.HostedAgentDefinition(TypedDict, total=False): - key "code_configuration": ForwardRef('CodeConfiguration') - key "container_configuration": ForwardRef('ContainerConfiguration') - key "environment_variables": dict[str, str] - key "protocol_versions": list[ProtocolVersionRecord] - key "rai_config": ForwardRef('RaiConfig') - key "telemetry_config": ForwardRef('TelemetryConfig') + key "code_configuration": ForwardRef('CodeConfiguration', module='types') + key "container_configuration": ForwardRef('ContainerConfiguration', module='types') + key "cpu": Required[str] + key "kind": Required[Literal[AgentKind.HOSTED]] + key "memory": Required[str] + key "rai_config": ForwardRef('RaiConfig', module='types') + key "telemetry_config": ForwardRef('TelemetryConfig', module='types') code_configuration: CodeConfiguration container_configuration: ContainerConfiguration - cpu: Required[str] + cpu: str environment_variables: dict[str, str] - kind: Required[Literal[AgentKind.HOSTED]] - memory: Required[str] + kind: Literal[AgentKind.HOSTED] + memory: str protocol_versions: list[ProtocolVersionRecord] rai_config: RaiConfig telemetry_config: TelemetryConfig class azure.ai.projects.types.HourlyRecurrenceSchedule(TypedDict, total=False): - type: Required[Literal[RecurrenceType.HOURLY]] + key "type": Required[Literal[RecurrenceType.HOURLY]] + type: Literal[RecurrenceType.HOURLY] class azure.ai.projects.types.HumanEvaluationPreviewRuleAction(TypedDict, total=False): - templateId: Required[str] - type: Required[Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW]] + key "templateId": Required[str] + key "type": Required[Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW]] + templateId: str + type: Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW] class azure.ai.projects.types.HybridSearchOptions(TypedDict, total=False): - embedding_weight: Required[float] - text_weight: Required[float] + key "embedding_weight": Required[float] + key "text_weight": Required[float] + embedding_weight: float + text_weight: float class azure.ai.projects.types.ImageGenTool(TypedDict, total=False): @@ -17704,7 +17943,7 @@ namespace azure.ai.projects.types key "background": Literal["transparent", "opaque", "auto"] key "description": str key "input_fidelity": Optional[Union[str, InputFidelity]] - key "input_image_mask": ForwardRef('ImageGenToolInputImageMask') + key "input_image_mask": ForwardRef('ImageGenToolInputImageMask', module='types') key "model": Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], Literal["gpt-image-5"], str] key "moderation": Literal["auto", "low"] key "name": str @@ -17713,7 +17952,7 @@ namespace azure.ai.projects.types key "partial_images": int key "quality": Literal["low", "medium", "high", "auto"] key "size": Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str] - key "tool_configs": dict[str, ToolConfig] + key "type": Required[Literal[ToolType.IMAGE_GENERATION]] action: Union[str, ImageGenAction] background: Literal[transparent, opaque, auto] description: str @@ -17728,7 +17967,7 @@ namespace azure.ai.projects.types quality: Literal[low, medium, high, auto] size: Union[Literal[1024x1024], Literal[1024x1536], Literal[1536x1024], Literal[auto], str] tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolType.IMAGE_GENERATION]] + type: Literal[ToolType.IMAGE_GENERATION] class azure.ai.projects.types.ImageGenToolInputImageMask(TypedDict, total=False): @@ -17745,66 +17984,94 @@ namespace azure.ai.projects.types class azure.ai.projects.types.InlineSkillParam(TypedDict, total=False): - description: Required[str] - name: Required[str] - source: Required[InlineSkillSourceParam] - type: Required[Literal[ContainerSkillType.INLINE]] + key "description": Required[str] + key "name": Required[str] + key "source": Required[InlineSkillSourceParam] + key "type": Required[Literal[ContainerSkillType.INLINE]] + description: str + name: str + source: InlineSkillSourceParam + type: Literal[ContainerSkillType.INLINE] class azure.ai.projects.types.InlineSkillSourceParam(TypedDict, total=False): - data: Required[str] - media_type: Required[Literal["application/zip"]] - type: Required[Literal["base64"]] + key "data": Required[str] + key "media_type": Required[Literal["application/zip"]] + key "type": Required[Literal["base64"]] + data: str + media_type: Literal[application/zip] + type: Literal[base64] class azure.ai.projects.types.Insight(TypedDict, total=False): - key "result": ForwardRef('InsightResult') - displayName: Required[str] - id: Required[str] - metadata: Required[InsightsMetadata] - request: Required[InsightRequest] - result: InsightResult - state: Required[Union[str, OperationState]] - - + key "displayName": Required[str] + key "id": Required[str] + key "metadata": Required[InsightsMetadata] + key "request": Required[InsightRequest] + key "result": ForwardRef('InsightResult', module='types') + key "state": Required[Union[str, OperationState]] + displayName: str + id: str + metadata: InsightsMetadata + request: InsightRequest + result: InsightResult + state: Union[str, OperationState] + + class azure.ai.projects.types.InsightCluster(TypedDict, total=False): - key "samples": list[InsightSample] - key "subClusters": list[InsightCluster] - description: Required[str] - id: Required[str] - label: Required[str] + key "description": Required[str] + key "id": Required[str] + key "label": Required[str] + key "suggestion": Required[str] + key "suggestionTitle": Required[str] + key "weight": Required[int] + description: str + id: str + label: str samples: list[InsightSample] subClusters: list[InsightCluster] - suggestion: Required[str] - suggestionTitle: Required[str] - weight: Required[int] + suggestion: str + suggestionTitle: str + weight: int class azure.ai.projects.types.InsightModelConfiguration(TypedDict, total=False): - modelDeploymentName: Required[str] + key "modelDeploymentName": Required[str] + modelDeploymentName: str class azure.ai.projects.types.InsightSample(TypedDict, total=False): - correlationInfo: Required[dict[str, Any]] - evaluationResult: Required[EvalResult] - features: Required[dict[str, Any]] - id: Required[str] - type: Required[Literal[SampleType.EVALUATION_RESULT_SAMPLE]] + key "correlationInfo": Required[dict[str, Any]] + key "evaluationResult": Required[EvalResult] + key "features": Required[dict[str, Any]] + key "id": Required[str] + key "type": Required[Literal[SampleType.EVALUATION_RESULT_SAMPLE]] + correlationInfo: dict[str, Any] + evaluationResult: EvalResult + features: dict[str, Any] + id: str + type: Literal[SampleType.EVALUATION_RESULT_SAMPLE] class azure.ai.projects.types.InsightScheduleTask(TypedDict, total=False): - key "configuration": dict[str, str] + key "insight": Required[Insight] + key "type": Required[Literal[ScheduleTaskType.INSIGHT]] configuration: dict[str, str] - insight: Required[Insight] - type: Required[Literal[ScheduleTaskType.INSIGHT]] + insight: Insight + type: Literal[ScheduleTaskType.INSIGHT] class azure.ai.projects.types.InsightSummary(TypedDict, total=False): - method: Required[str] - sampleCount: Required[int] - uniqueClusterCount: Required[int] - uniqueSubclusterCount: Required[int] - usage: Required[ClusterTokenUsage] + key "method": Required[str] + key "sampleCount": Required[int] + key "uniqueClusterCount": Required[int] + key "uniqueSubclusterCount": Required[int] + key "usage": Required[ClusterTokenUsage] + method: str + sampleCount: int + uniqueClusterCount: int + uniqueSubclusterCount: int + usage: ClusterTokenUsage class azure.ai.projects.types.InsightType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -17815,8 +18082,9 @@ namespace azure.ai.projects.types class azure.ai.projects.types.InsightsMetadata(TypedDict, total=False): key "completedAt": str + key "createdAt": Required[str] completedAt: str - createdAt: Required[str] + createdAt: str class azure.ai.projects.types.InvocationsProtocolConfiguration(TypedDict, total=False): @@ -17826,8 +18094,10 @@ namespace azure.ai.projects.types class azure.ai.projects.types.InvokeAgentInvocationsApiDispatchPayload(TypedDict, total=False): - input: Required[Any] - type: Required[Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API]] + key "input": Required[Any] + key "type": Required[Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API]] + input: Any + type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API] class azure.ai.projects.types.InvokeAgentInvocationsApiRoutineAction(TypedDict, total=False): @@ -17835,16 +18105,19 @@ namespace azure.ai.projects.types key "agent_name": str key "input": Any key "session_id": str + key "type": Required[Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API]] agent_endpoint_id: str agent_name: str input: Any session_id: str - type: Required[Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API]] + type: Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API] class azure.ai.projects.types.InvokeAgentResponsesApiDispatchPayload(TypedDict, total=False): - input: Required[Any] - type: Required[Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API]] + key "input": Required[Any] + key "type": Required[Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API]] + input: Any + type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API] class azure.ai.projects.types.InvokeAgentResponsesApiRoutineAction(TypedDict, total=False): @@ -17852,51 +18125,60 @@ namespace azure.ai.projects.types key "agent_name": str key "conversation": str key "input": Any + key "type": Required[Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API]] agent_endpoint_id: str agent_name: str conversation: str input: Any - type: Required[Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API]] + type: Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API] class azure.ai.projects.types.ListMemoriesRequest(TypedDict, total=False): - scope: Required[str] + key "scope": Required[str] + scope: str class azure.ai.projects.types.LlmGeneratedVoiceGreetingConfig(TypedDict, total=False): - key "tool_choice": ForwardRef('VoiceAgentToolChoice') - prompt: Required[str] + key "prompt": Required[str] + key "tool_choice": ForwardRef('VoiceAgentToolChoice', module='types') + key "type": Required[Literal["llm_generated"]] + prompt: str tool_choice: VoiceAgentToolChoice - type: Required[Literal["llm_generated"]] + type: Literal[llm_generated] class azure.ai.projects.types.LocalShellToolParam(TypedDict, total=False): key "description": str key "name": str - key "tool_configs": dict[str, ToolConfig] + key "type": Required[Literal[ToolType.LOCAL_SHELL]] description: str name: str tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolType.LOCAL_SHELL]] + type: Literal[ToolType.LOCAL_SHELL] class azure.ai.projects.types.LocalSkillParam(TypedDict, total=False): - description: Required[str] - name: Required[str] - path: Required[str] + key "description": Required[str] + key "name": Required[str] + key "path": Required[str] + description: str + name: str + path: str class azure.ai.projects.types.LogProbProperties(TypedDict, total=False): - bytes: Required[list[int]] - logprob: Required[float] - token: Required[str] + key "bytes": Required[list[int]] + key "logprob": Required[float] + key "token": Required[str] + bytes: list[int] + logprob: float + token: str class azure.ai.projects.types.LoraConfig(TypedDict, total=False): key "alpha": int key "dropout": float key "rank": int - key "targetModules": list[str] alpha: int dropout: float rank: int @@ -17906,10 +18188,12 @@ namespace azure.ai.projects.types class azure.ai.projects.types.MCPListToolsTool(TypedDict, total=False): key "annotations": Optional[MCPListToolsToolAnnotations] key "description": Optional[str] + key "input_schema": Required[MCPListToolsToolInputSchema] + key "name": Required[str] annotations: MCPListToolsToolAnnotations description: str - input_schema: Required[MCPListToolsToolInputSchema] - name: Required[str] + input_schema: MCPListToolsToolInputSchema + name: str class azure.ai.projects.types.MCPListToolsToolAnnotations(TypedDict, total=False): @@ -17928,9 +18212,10 @@ namespace azure.ai.projects.types key "project_connection_id": str key "require_approval": Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] key "server_description": str + key "server_label": Required[str] key "server_url": str - key "tool_configs": dict[str, ToolConfig] key "tunnel_id": str + key "type": Required[Literal[ToolType.MCP]] allowed_callers: list[Union[str, CallableToolAllowedCaller]] allowed_tools: Union[list[str], MCPToolFilter] authorization: str @@ -17940,23 +18225,22 @@ namespace azure.ai.projects.types project_connection_id: str require_approval: Union[MCPToolRequireApproval, Literal[always], Literal[never]] server_description: str - server_label: Required[str] + server_label: str server_url: str tool_configs: dict[str, ToolConfig] tunnel_id: str - type: Required[Literal[ToolType.MCP]] + type: Literal[ToolType.MCP] class azure.ai.projects.types.MCPToolFilter(TypedDict, total=False): key "read_only": bool - key "tool_names": list[str] read_only: bool tool_names: list[str] class azure.ai.projects.types.MCPToolRequireApproval(TypedDict, total=False): - key "always": ForwardRef('MCPToolFilter') - key "never": ForwardRef('MCPToolFilter') + key "always": ForwardRef('MCPToolFilter', module='types') + key "never": ForwardRef('MCPToolFilter', module='types') always: MCPToolFilter never: MCPToolFilter @@ -17973,9 +18257,10 @@ namespace azure.ai.projects.types key "project_connection_id": str key "require_approval": Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] key "server_description": str + key "server_label": Required[str] key "server_url": str - key "tool_configs": dict[str, ToolConfig] key "tunnel_id": str + key "type": Required[Literal[ToolboxToolType.MCP]] allowed_callers: list[Union[str, CallableToolAllowedCaller]] allowed_tools: Union[list[str], MCPToolFilter] authorization: str @@ -17987,29 +18272,34 @@ namespace azure.ai.projects.types project_connection_id: str require_approval: Union[MCPToolRequireApproval, Literal[always], Literal[never]] server_description: str - server_label: Required[str] + server_label: str server_url: str tool_configs: dict[str, ToolConfig] tunnel_id: str - type: Required[Literal[ToolboxToolType.MCP]] + type: Literal[ToolboxToolType.MCP] class azure.ai.projects.types.ManagedAgentIdentityBlueprintReference(TypedDict, total=False): - blueprint_id: Required[str] - type: Required[Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT]] + key "blueprint_id": Required[str] + key "type": Required[Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT]] + blueprint_id: str + type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] class azure.ai.projects.types.ManagedAzureAISearchIndex(TypedDict, total=False): key "description": str key "id": str - key "tags": dict[str, str] + key "name": Required[str] + key "type": Required[Literal[IndexType.MANAGED_AZURE_SEARCH]] + key "vectorStoreId": Required[str] + key "version": Required[str] description: str id: str - name: Required[str] + name: str tags: dict[str, str] - type: Required[Literal[IndexType.MANAGED_AZURE_SEARCH]] - vectorStoreId: Required[str] - version: Required[str] + type: Literal[IndexType.MANAGED_AZURE_SEARCH] + vectorStoreId: str + version: str class azure.ai.projects.types.McpProtocolConfiguration(TypedDict, total=False): @@ -18021,39 +18311,50 @@ namespace azure.ai.projects.types class azure.ai.projects.types.MemorySearchPreviewTool(TypedDict, total=False): - key "search_options": ForwardRef('MemorySearchOptions') + key "memory_store_name": Required[str] + key "scope": Required[str] + key "search_options": ForwardRef('MemorySearchOptions', module='types') + key "type": Required[Literal[ToolType.MEMORY_SEARCH_PREVIEW]] key "update_delay": int - memory_store_name: Required[str] - scope: Required[str] + memory_store_name: str + scope: str search_options: MemorySearchOptions - type: Required[Literal[ToolType.MEMORY_SEARCH_PREVIEW]] + type: Literal[ToolType.MEMORY_SEARCH_PREVIEW] update_delay: int class azure.ai.projects.types.MemoryStoreDefaultDefinition(TypedDict, total=False): - key "options": ForwardRef('MemoryStoreDefaultOptions') - chat_model: Required[str] - embedding_model: Required[str] - kind: Required[Literal[MemoryStoreKind.DEFAULT]] + key "chat_model": Required[str] + key "embedding_model": Required[str] + key "kind": Required[Literal[MemoryStoreKind.DEFAULT]] + key "options": ForwardRef('MemoryStoreDefaultOptions', module='types') + chat_model: str + embedding_model: str + kind: Literal[MemoryStoreKind.DEFAULT] options: MemoryStoreDefaultOptions class azure.ai.projects.types.MemoryStoreDefaultOptions(TypedDict, total=False): + key "chat_summary_enabled": Required[bool] key "default_ttl_seconds": str key "procedural_memory_enabled": bool key "user_profile_details": str - chat_summary_enabled: Required[bool] + key "user_profile_enabled": Required[bool] + chat_summary_enabled: bool default_ttl_seconds: str procedural_memory_enabled: bool user_profile_details: str - user_profile_enabled: Required[bool] + user_profile_enabled: bool class azure.ai.projects.types.MemoryStoreDefinition(TypedDict, total=False): - key "options": ForwardRef('MemoryStoreDefaultOptions') - chat_model: Required[str] - embedding_model: Required[str] - kind: Required[Literal[MemoryStoreKind.DEFAULT]] + key "chat_model": Required[str] + key "embedding_model": Required[str] + key "kind": Required[Literal[MemoryStoreKind.DEFAULT]] + key "options": ForwardRef('MemoryStoreDefaultOptions', module='types') + chat_model: str + embedding_model: str + kind: Literal[MemoryStoreKind.DEFAULT] options: MemoryStoreDefaultOptions @@ -18065,20 +18366,24 @@ namespace azure.ai.projects.types class azure.ai.projects.types.MicrosoftFabricPreviewTool(TypedDict, total=False): - fabric_dataagent_preview: Required[FabricDataAgentToolParameters] - type: Required[Literal[ToolType.FABRIC_DATAAGENT_PREVIEW]] + key "fabric_dataagent_preview": Required[FabricDataAgentToolParameters] + key "type": Required[Literal[ToolType.FABRIC_DATAAGENT_PREVIEW]] + fabric_dataagent_preview: FabricDataAgentToolParameters + type: Literal[ToolType.FABRIC_DATAAGENT_PREVIEW] class azure.ai.projects.types.ModelCredentialRequest(TypedDict, total=False): - blobUri: Required[str] + key "blobUri": Required[str] + blobUri: str class azure.ai.projects.types.ModelPendingUploadRequest(TypedDict, total=False): key "connectionName": str key "pendingUploadId": str + key "pendingUploadType": Required[Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE]] connectionName: str pendingUploadId: str - pendingUploadType: Required[Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE]] + pendingUploadType: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] class azure.ai.projects.types.ModelSamplingParams(TypedDict, total=False): @@ -18100,39 +18405,46 @@ namespace azure.ai.projects.types class azure.ai.projects.types.ModelVersion(TypedDict, total=False): - key "artifactProfile": ForwardRef('ArtifactProfile') + key "artifactProfile": ForwardRef('ArtifactProfile', module='types') key "baseModel": str + key "blobUri": Required[str] key "description": str key "id": str - key "loraConfig": ForwardRef('LoraConfig') - key "source": ForwardRef('ModelSourceData') - key "tags": dict[str, str] - key "warnings": list[FoundryModelWarning] + key "loraConfig": ForwardRef('LoraConfig', module='types') + key "name": Required[str] + key "source": ForwardRef('ModelSourceData', module='types') + key "version": Required[str] key "weightType": Union[str, FoundryModelWeightType] artifactProfile: ArtifactProfile baseModel: str - blobUri: Required[str] + blobUri: str description: str id: str loraConfig: LoraConfig - name: Required[str] + name: str source: ModelSourceData tags: dict[str, str] - version: Required[str] + version: str warnings: list[FoundryModelWarning] weightType: Union[str, FoundryModelWeightType] class azure.ai.projects.types.MonthlyRecurrenceSchedule(TypedDict, total=False): - daysOfMonth: Required[list[int]] - type: Required[Literal[RecurrenceType.MONTHLY]] + key "daysOfMonth": Required[list[int]] + key "type": Required[Literal[RecurrenceType.MONTHLY]] + daysOfMonth: list[int] + type: Literal[RecurrenceType.MONTHLY] class azure.ai.projects.types.NamespaceToolParam(TypedDict, total=False): - description: Required[str] - name: Required[str] - tools: Required[list[Union[FunctionToolParam, CustomToolParam]]] - type: Required[Literal[ToolType.NAMESPACE]] + key "description": Required[str] + key "name": Required[str] + key "tools": Required[list[Union[FunctionToolParam, CustomToolParam]]] + key "type": Required[Literal[ToolType.NAMESPACE]] + description: str + name: str + tools: list[Union[FunctionToolParam, CustomToolParam]] + type: Literal[ToolType.NAMESPACE] class azure.ai.projects.types.OmitPropertiesRealtimeResponse1(TypedDict, total=False): @@ -18141,16 +18453,15 @@ namespace azure.ai.projects.types key "max_output_tokens": Union[int, Literal["inf"]] key "metadata": Optional[Metadata] key "object": Literal["response"] - key "output_modalities": list[Literal["text", "audio"]] key "status": Literal["completed", "cancelled", "failed", "incomplete", "in_progress"] - key "status_details": ForwardRef('RealtimeResponseStatusDetails') - key "usage": ForwardRef('RealtimeResponseUsage') + key "status_details": ForwardRef('RealtimeResponseStatusDetails', module='types') + key "usage": ForwardRef('RealtimeResponseUsage', module='types') conversation_id: str id: str max_output_tokens: Union[int, Literal[inf]] metadata: Metadata object: Literal[response] - output_modalities: list[Literal[text, audio]] + output_modalities: list[Literal["text", "audio"]] status: Literal[completed, cancelled, failed, incomplete, in_progress] status_details: RealtimeResponseStatusDetails usage: RealtimeResponseUsage @@ -18158,13 +18469,16 @@ namespace azure.ai.projects.types class azure.ai.projects.types.OneTimeTrigger(TypedDict, total=False): key "timeZone": str + key "triggerAt": Required[str] + key "type": Required[Literal[TriggerType.ONE_TIME]] timeZone: str - triggerAt: Required[str] - type: Required[Literal[TriggerType.ONE_TIME]] + triggerAt: str + type: Literal[TriggerType.ONE_TIME] class azure.ai.projects.types.OpenApiAnonymousAuthDetails(TypedDict, total=False): - type: Required[Literal[OpenApiAuthType.ANONYMOUS]] + key "type": Required[Literal[OpenApiAuthType.ANONYMOUS]] + type: Literal[OpenApiAuthType.ANONYMOUS] class azure.ai.projects.types.OpenApiAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -18174,78 +18488,94 @@ namespace azure.ai.projects.types class azure.ai.projects.types.OpenApiFunctionDefinition(TypedDict, total=False): - key "default_params": list[str] + key "auth": Required[OpenApiAuthDetails] key "description": str - key "functions": list[OpenApiFunctionDefinitionFunction] - auth: Required[OpenApiAuthDetails] + key "name": Required[str] + key "spec": Required[dict[str, Any]] + auth: OpenApiAuthDetails default_params: list[str] description: str functions: list[OpenApiFunctionDefinitionFunction] - name: Required[str] - spec: Required[dict[str, Any]] + name: str + spec: dict[str, Any] class azure.ai.projects.types.OpenApiFunctionDefinitionFunction(TypedDict, total=False): key "description": str + key "name": Required[str] + key "parameters": Required[dict[str, Any]] description: str - name: Required[str] - parameters: Required[dict[str, Any]] + name: str + parameters: dict[str, Any] class azure.ai.projects.types.OpenApiManagedAuthDetails(TypedDict, total=False): - security_scheme: Required[OpenApiManagedSecurityScheme] - type: Required[Literal[OpenApiAuthType.MANAGED_IDENTITY]] + key "security_scheme": Required[OpenApiManagedSecurityScheme] + key "type": Required[Literal[OpenApiAuthType.MANAGED_IDENTITY]] + security_scheme: OpenApiManagedSecurityScheme + type: Literal[OpenApiAuthType.MANAGED_IDENTITY] class azure.ai.projects.types.OpenApiManagedSecurityScheme(TypedDict, total=False): - audience: Required[str] + key "audience": Required[str] + audience: str class azure.ai.projects.types.OpenApiProjectConnectionAuthDetails(TypedDict, total=False): - security_scheme: Required[OpenApiProjectConnectionSecurityScheme] - type: Required[Literal[OpenApiAuthType.PROJECT_CONNECTION]] + key "security_scheme": Required[OpenApiProjectConnectionSecurityScheme] + key "type": Required[Literal[OpenApiAuthType.PROJECT_CONNECTION]] + security_scheme: OpenApiProjectConnectionSecurityScheme + type: Literal[OpenApiAuthType.PROJECT_CONNECTION] class azure.ai.projects.types.OpenApiProjectConnectionSecurityScheme(TypedDict, total=False): - project_connection_id: Required[str] + key "project_connection_id": Required[str] + project_connection_id: str class azure.ai.projects.types.OpenApiTool(TypedDict, total=False): - key "tool_configs": dict[str, ToolConfig] - openapi: Required[OpenApiFunctionDefinition] + key "openapi": Required[OpenApiFunctionDefinition] + key "type": Required[Literal[ToolType.OPENAPI]] + openapi: OpenApiFunctionDefinition tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolType.OPENAPI]] + type: Literal[ToolType.OPENAPI] class azure.ai.projects.types.OpenApiToolboxTool(TypedDict, total=False): key "description": str key "name": str - key "tool_configs": dict[str, ToolConfig] + key "openapi": Required[OpenApiFunctionDefinition] + key "type": Required[Literal[ToolboxToolType.OPENAPI]] description: str name: str - openapi: Required[OpenApiFunctionDefinition] + openapi: OpenApiFunctionDefinition tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolboxToolType.OPENAPI]] + type: Literal[ToolboxToolType.OPENAPI] class azure.ai.projects.types.OptimizedAgentIdentifier(TypedDict, total=False): + key "agent_name": Required[str] key "agent_version": str - agent_name: Required[str] + agent_name: str agent_version: str class azure.ai.projects.types.OtlpTelemetryEndpoint(TypedDict, total=False): - key "auth": ForwardRef('TelemetryEndpointAuth') + key "auth": ForwardRef('TelemetryEndpointAuth', module='types') + key "data": Required[list[Union[str, TelemetryDataKind]]] + key "endpoint": Required[str] + key "kind": Required[Literal[TelemetryEndpointKind.OTLP]] + key "protocol": Required[Union[str, TelemetryTransportProtocol]] auth: TelemetryEndpointAuth - data: Required[list[Union[str, TelemetryDataKind]]] - endpoint: Required[str] - kind: Required[Literal[TelemetryEndpointKind.OTLP]] - protocol: Required[Union[str, TelemetryTransportProtocol]] + data: list[Union[str, TelemetryDataKind]] + endpoint: str + kind: Literal[TelemetryEndpointKind.OTLP] + protocol: Union[str, TelemetryTransportProtocol] class azure.ai.projects.types.PatchAgentObjectRequest(TypedDict, total=False): - key "agent_card": ForwardRef('AgentCard') - key "agent_endpoint": ForwardRef('AgentEndpointConfig') + key "agent_card": ForwardRef('AgentCard', module='types') + key "agent_endpoint": ForwardRef('AgentEndpointConfig', module='types') agent_card: AgentCard agent_endpoint: AgentEndpointConfig @@ -18253,9 +18583,10 @@ namespace azure.ai.projects.types class azure.ai.projects.types.PendingUploadRequest(TypedDict, total=False): key "connectionName": str key "pendingUploadId": str + key "pendingUploadType": Required[Literal[PendingUploadType.BLOB_REFERENCE]] connectionName: str pendingUploadId: str - pendingUploadType: Required[Literal[PendingUploadType.BLOB_REFERENCE]] + pendingUploadType: Literal[PendingUploadType.BLOB_REFERENCE] class azure.ai.projects.types.PendingUploadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -18265,33 +18596,37 @@ namespace azure.ai.projects.types class azure.ai.projects.types.PickPropertiesVoiceAudioConfig(TypedDict, total=False): - key "output": ForwardRef('VoiceAudioOutputConfig') + key "output": ForwardRef('VoiceAudioOutputConfig', module='types') output: VoiceAudioOutputConfig class azure.ai.projects.types.ProgrammaticToolCallingParam(TypedDict, total=False): - type: Required[Literal[ToolType.PROGRAMMATIC_TOOL_CALLING]] + key "type": Required[Literal[ToolType.PROGRAMMATIC_TOOL_CALLING]] + type: Literal[ToolType.PROGRAMMATIC_TOOL_CALLING] class azure.ai.projects.types.PromotionInfo(TypedDict, total=False): - agent_name: Required[str] - agent_version: Required[str] - promoted_at: Required[int] + key "agent_name": Required[str] + key "agent_version": Required[str] + key "promoted_at": Required[int] + agent_name: str + agent_version: str + promoted_at: int class azure.ai.projects.types.PromptAgentDefinition(TypedDict, total=False): key "instructions": Optional[str] - key "rai_config": ForwardRef('RaiConfig') + key "kind": Required[Literal[AgentKind.PROMPT]] + key "model": Required[str] + key "rai_config": ForwardRef('RaiConfig', module='types') key "reasoning": Optional[Reasoning] - key "structured_inputs": dict[str, StructuredInputDefinition] key "temperature": Optional[float] - key "text": ForwardRef('PromptAgentDefinitionTextOptions') + key "text": ForwardRef('PromptAgentDefinitionTextOptions', module='types') key "tool_choice": Union[str, ToolChoiceParam] - key "tools": list[Tool] key "top_p": Optional[float] instructions: str - kind: Required[Literal[AgentKind.PROMPT]] - model: Required[str] + kind: Literal[AgentKind.PROMPT] + model: str rai_config: RaiConfig reasoning: Reasoning structured_inputs: dict[str, StructuredInputDefinition] @@ -18303,42 +18638,45 @@ namespace azure.ai.projects.types class azure.ai.projects.types.PromptAgentDefinitionTextOptions(TypedDict, total=False): - key "format": ForwardRef('TextResponseFormat') + key "format": ForwardRef('TextResponseFormat', module='types') format: TextResponseFormat class azure.ai.projects.types.PromptBasedEvaluatorDefinition(TypedDict, total=False): - key "data_schema": dict[str, Any] - key "init_parameters": dict[str, Any] - key "metrics": dict[str, EvaluatorMetric] + key "prompt_text": Required[str] + key "type": Required[Literal[EvaluatorDefinitionType.PROMPT]] data_schema: dict[str, Any] init_parameters: dict[str, Any] metrics: dict[str, EvaluatorMetric] - prompt_text: Required[str] - type: Required[Literal[EvaluatorDefinitionType.PROMPT]] + prompt_text: str + type: Literal[EvaluatorDefinitionType.PROMPT] class azure.ai.projects.types.PromptDataGenerationJobSource(TypedDict, total=False): key "description": str + key "prompt": Required[str] + key "type": Required[Literal[DataGenerationJobSourceType.PROMPT]] description: str - prompt: Required[str] - type: Required[Literal[DataGenerationJobSourceType.PROMPT]] + prompt: str + type: Literal[DataGenerationJobSourceType.PROMPT] class azure.ai.projects.types.PromptEvaluatorGenerationJobSource(TypedDict, total=False): key "description": str + key "prompt": Required[str] + key "type": Required[Literal[EvaluatorGenerationJobSourceType.PROMPT]] description: str - prompt: Required[str] - type: Required[Literal[EvaluatorGenerationJobSourceType.PROMPT]] + prompt: str + type: Literal[EvaluatorGenerationJobSourceType.PROMPT] class azure.ai.projects.types.ProtocolConfiguration(TypedDict, total=False): - key "a2a": ForwardRef('A2AProtocolConfiguration') - key "activity": ForwardRef('ActivityProtocolConfiguration') - key "invocations": ForwardRef('InvocationsProtocolConfiguration') - key "invocations_ws": ForwardRef('InvocationsWsProtocolConfiguration') - key "mcp": ForwardRef('McpProtocolConfiguration') - key "responses": ForwardRef('ResponsesProtocolConfiguration') + key "a2a": ForwardRef('A2AProtocolConfiguration', module='types') + key "activity": ForwardRef('ActivityProtocolConfiguration', module='types') + key "invocations": ForwardRef('InvocationsProtocolConfiguration', module='types') + key "invocations_ws": ForwardRef('InvocationsWsProtocolConfiguration', module='types') + key "mcp": ForwardRef('McpProtocolConfiguration', module='types') + key "responses": ForwardRef('ResponsesProtocolConfiguration', module='types') a2a: A2AProtocolConfiguration activity: ActivityProtocolConfiguration invocations: InvocationsProtocolConfiguration @@ -18348,16 +18686,19 @@ namespace azure.ai.projects.types class azure.ai.projects.types.ProtocolVersionRecord(TypedDict, total=False): - protocol: Required[Union[str, AgentEndpointProtocol]] - version: Required[str] + key "protocol": Required[Union[str, AgentEndpointProtocol]] + key "version": Required[str] + protocol: Union[str, AgentEndpointProtocol] + version: str class azure.ai.projects.types.RaiConfig(TypedDict, total=False): - rai_policy_name: Required[str] + key "rai_policy_name": Required[str] + rai_policy_name: str class azure.ai.projects.types.RankingOptions(TypedDict, total=False): - key "hybrid_search": ForwardRef('HybridSearchOptions') + key "hybrid_search": ForwardRef('HybridSearchOptions', module='types') key "ranker": Union[str, RankerVersionType] key "score_threshold": float hybrid_search: HybridSearchOptions @@ -18367,16 +18708,19 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeAudioFormatsAudioPcm(TypedDict, total=False): key "rate": Literal[24000] + key "type": Required[Literal[RealtimeAudioFormatsType.AUDIO_PCM]] rate: Literal[24000] - type: Required[Literal[RealtimeAudioFormatsType.AUDIO_PCM]] + type: Literal[RealtimeAudioFormatsType.AUDIO_PCM] class azure.ai.projects.types.RealtimeAudioFormatsAudioPcma(TypedDict, total=False): - type: Required[Literal[RealtimeAudioFormatsType.AUDIO_PCMA]] + key "type": Required[Literal[RealtimeAudioFormatsType.AUDIO_PCMA]] + type: Literal[RealtimeAudioFormatsType.AUDIO_PCMA] class azure.ai.projects.types.RealtimeAudioFormatsAudioPcmu(TypedDict, total=False): - type: Required[Literal[RealtimeAudioFormatsType.AUDIO_PCMU]] + key "type": Required[Literal[RealtimeAudioFormatsType.AUDIO_PCMU]] + type: Literal[RealtimeAudioFormatsType.AUDIO_PCMU] class azure.ai.projects.types.RealtimeAudioFormatsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -18400,41 +18744,50 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeConversationItemFunctionCall(TypedDict, total=False): + key "arguments": Required[str] key "call_id": str key "id": str + key "name": Required[str] key "object": Literal["item"] key "status": Literal["completed", "incomplete", "in_progress"] - arguments: Required[str] + key "type": Required[Literal[RealtimeConversationItemType.FUNCTION_CALL]] + arguments: str call_id: str id: str - name: Required[str] + name: str object: Literal[item] status: Literal[completed, incomplete, in_progress] - type: Required[Literal[RealtimeConversationItemType.FUNCTION_CALL]] + type: Literal[RealtimeConversationItemType.FUNCTION_CALL] class azure.ai.projects.types.RealtimeConversationItemFunctionCallOutput(TypedDict, total=False): + key "call_id": Required[str] key "id": str key "object": Literal["item"] + key "output": Required[str] key "status": Literal["completed", "incomplete", "in_progress"] - call_id: Required[str] + key "type": Required[Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT]] + call_id: str id: str object: Literal[item] - output: Required[str] + output: str status: Literal[completed, incomplete, in_progress] - type: Required[Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT]] + type: Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT] class azure.ai.projects.types.RealtimeConversationItemMessageAssistant(TypedDict, total=False): + key "content": Required[list[RealtimeConversationItemMessageAssistantContent]] key "id": str key "object": Literal["item"] + key "role": Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] key "status": Literal["completed", "incomplete", "in_progress"] - content: Required[list[RealtimeConversationItemMessageAssistantContent]] + key "type": Required[Literal["message"]] + content: list[RealtimeConversationItemMessageAssistantContent] id: str object: Literal[item] - role: Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] + role: Literal[RealtimeConversationItemMessageType.ASSISTANT] status: Literal[completed, incomplete, in_progress] - type: Required[Literal["message"]] + type: Literal[message] class azure.ai.projects.types.RealtimeConversationItemMessageAssistantContent(TypedDict, total=False): @@ -18449,15 +18802,18 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeConversationItemMessageSystem(TypedDict, total=False): + key "content": Required[list[RealtimeConversationItemMessageSystemContent]] key "id": str key "object": Literal["item"] + key "role": Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] key "status": Literal["completed", "incomplete", "in_progress"] - content: Required[list[RealtimeConversationItemMessageSystemContent]] + key "type": Required[Literal["message"]] + content: list[RealtimeConversationItemMessageSystemContent] id: str object: Literal[item] - role: Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] + role: Literal[RealtimeConversationItemMessageType.SYSTEM] status: Literal[completed, incomplete, in_progress] - type: Required[Literal["message"]] + type: Literal[message] class azure.ai.projects.types.RealtimeConversationItemMessageSystemContent(TypedDict, total=False): @@ -18474,15 +18830,18 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeConversationItemMessageUser(TypedDict, total=False): + key "content": Required[list[RealtimeConversationItemMessageUserContent]] key "id": str key "object": Literal["item"] + key "role": Required[Literal[RealtimeConversationItemMessageType.USER]] key "status": Literal["completed", "incomplete", "in_progress"] - content: Required[list[RealtimeConversationItemMessageUserContent]] + key "type": Required[Literal["message"]] + content: list[RealtimeConversationItemMessageUserContent] id: str object: Literal[item] - role: Required[Literal[RealtimeConversationItemMessageType.USER]] + role: Literal[RealtimeConversationItemMessageType.USER] status: Literal[completed, incomplete, in_progress] - type: Required[Literal["message"]] + type: Literal[message] class azure.ai.projects.types.RealtimeConversationItemMessageUserContent(TypedDict, total=False): @@ -18512,7 +18871,7 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeFunctionTool(TypedDict, total=False): key "description": str key "name": str - key "parameters": ForwardRef('RealtimeFunctionToolParameters') + key "parameters": ForwardRef('RealtimeFunctionToolParameters', module='types') key "type": Literal["function"] description: str name: str @@ -18524,59 +18883,84 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeMCPApprovalRequest(TypedDict, total=False): - arguments: Required[str] - id: Required[str] - name: Required[str] - server_label: Required[str] - type: Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST]] + key "arguments": Required[str] + key "id": Required[str] + key "name": Required[str] + key "server_label": Required[str] + key "type": Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST]] + arguments: str + id: str + name: str + server_label: str + type: Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST] class azure.ai.projects.types.RealtimeMCPApprovalResponse(TypedDict, total=False): + key "approval_request_id": Required[str] + key "approve": Required[bool] + key "id": Required[str] key "reason": Optional[str] - approval_request_id: Required[str] - approve: Required[bool] - id: Required[str] + key "type": Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE]] + approval_request_id: str + approve: bool + id: str reason: str - type: Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE]] + type: Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE] class azure.ai.projects.types.RealtimeMCPHTTPError(TypedDict, total=False): - code: Required[int] - message: Required[str] - type: Required[Literal[RealtimeMcpErrorType.HTTP_ERROR]] + key "code": Required[int] + key "message": Required[str] + key "type": Required[Literal[RealtimeMcpErrorType.HTTP_ERROR]] + code: int + message: str + type: Literal[RealtimeMcpErrorType.HTTP_ERROR] class azure.ai.projects.types.RealtimeMCPListTools(TypedDict, total=False): key "id": str + key "server_label": Required[str] + key "tools": Required[list[MCPListToolsTool]] + key "type": Required[Literal[RealtimeConversationItemType.MCP_LIST_TOOLS]] id: str - server_label: Required[str] - tools: Required[list[MCPListToolsTool]] - type: Required[Literal[RealtimeConversationItemType.MCP_LIST_TOOLS]] + server_label: str + tools: list[MCPListToolsTool] + type: Literal[RealtimeConversationItemType.MCP_LIST_TOOLS] class azure.ai.projects.types.RealtimeMCPProtocolError(TypedDict, total=False): - code: Required[int] - message: Required[str] - type: Required[Literal[RealtimeMcpErrorType.PROTOCOL_ERROR]] + key "code": Required[int] + key "message": Required[str] + key "type": Required[Literal[RealtimeMcpErrorType.PROTOCOL_ERROR]] + code: int + message: str + type: Literal[RealtimeMcpErrorType.PROTOCOL_ERROR] class azure.ai.projects.types.RealtimeMCPToolCall(TypedDict, total=False): key "approval_request_id": Optional[str] - key "error": ForwardRef('RealtimeMCPError') + key "arguments": Required[str] + key "error": ForwardRef('RealtimeMCPError', module='types') + key "id": Required[str] + key "name": Required[str] key "output": Optional[str] + key "server_label": Required[str] + key "type": Required[Literal[RealtimeConversationItemType.MCP_CALL]] approval_request_id: str - arguments: Required[str] + arguments: str error: RealtimeMCPError - id: Required[str] - name: Required[str] + id: str + name: str output: str - server_label: Required[str] - type: Required[Literal[RealtimeConversationItemType.MCP_CALL]] + server_label: str + type: Literal[RealtimeConversationItemType.MCP_CALL] class azure.ai.projects.types.RealtimeMCPToolExecutionError(TypedDict, total=False): - message: Required[str] - type: Required[Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR]] + key "message": Required[str] + key "type": Required[Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR]] + message: str + type: Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR] class azure.ai.projects.types.RealtimeMcpErrorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -18591,7 +18975,7 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeResponseStatusDetails(TypedDict, total=False): - key "error": ForwardRef('RealtimeResponseStatusDetailsError') + key "error": ForwardRef('RealtimeResponseStatusDetailsError', module='types') key "reason": Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"] key "type": Literal["completed", "cancelled", "failed", "incomplete"] error: RealtimeResponseStatusDetailsError @@ -18607,9 +18991,9 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeResponseUsage(TypedDict, total=False): - key "input_token_details": ForwardRef('RealtimeResponseUsageInputTokenDetails') + key "input_token_details": ForwardRef('RealtimeResponseUsageInputTokenDetails', module='types') key "input_tokens": int - key "output_token_details": ForwardRef('RealtimeResponseUsageOutputTokenDetails') + key "output_token_details": ForwardRef('RealtimeResponseUsageOutputTokenDetails', module='types') key "output_tokens": int key "total_tokens": int input_token_details: RealtimeResponseUsageInputTokenDetails @@ -18622,7 +19006,7 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeResponseUsageInputTokenDetails(TypedDict, total=False): key "audio_tokens": int key "cached_tokens": int - key "cached_tokens_details": ForwardRef('RealtimeResponseUsageInputTokenDetailsCachedTokensDetails') + key "cached_tokens_details": ForwardRef('RealtimeResponseUsageInputTokenDetailsCachedTokensDetails', module='types') key "image_tokens": int key "text_tokens": int audio_tokens: int @@ -18649,13 +19033,20 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeServerEvent(TypedDict, total=False): - content_index: Required[int] - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - part: Required[RealtimeServerEventResponseContentPartAddedPart] - response_id: Required[str] - type: Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED]] + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "part": Required[RealtimeServerEventResponseContentPartAddedPart] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED]] + content_index: int + event_id: str + item_id: str + output_index: int + part: RealtimeServerEventResponseContentPartAddedPart + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED] class azure.ai.projects.types.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError(TypedDict, total=False): @@ -18670,20 +19061,25 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeServerEventError(TypedDict, total=False): - error: Required[RealtimeServerEventErrorError] - event_id: Required[str] - type: Required[Literal["error"]] + key "error": Required[RealtimeServerEventErrorError] + key "event_id": Required[str] + key "type": Required[Literal["error"]] + error: RealtimeServerEventErrorError + event_id: str + type: Literal[error] class azure.ai.projects.types.RealtimeServerEventErrorError(TypedDict, total=False): key "code": Optional[str] key "event_id": Optional[str] + key "message": Required[str] key "param": Optional[str] + key "type": Required[str] code: str event_id: str - message: Required[str] + message: str param: str - type: Required[str] + type: str class azure.ai.projects.types.RealtimeServerEventRateLimitsUpdatedRateLimits(TypedDict, total=False): @@ -18698,13 +19094,20 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RealtimeServerEventResponseContentPartAdded(TypedDict, total=False): - content_index: Required[int] - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - part: Required[RealtimeServerEventResponseContentPartAddedPart] - response_id: Required[str] - type: Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED]] + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "part": Required[RealtimeServerEventResponseContentPartAddedPart] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED]] + content_index: int + event_id: str + item_id: str + output_index: int + part: RealtimeServerEventResponseContentPartAddedPart + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED] class azure.ai.projects.types.RealtimeServerEventResponseContentPartAddedPart(TypedDict, total=False): @@ -18782,14 +19185,17 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RecurrenceTrigger(TypedDict, total=False): key "endTime": str + key "interval": Required[int] + key "schedule": Required[RecurrenceSchedule] key "startTime": str key "timeZone": str + key "type": Required[Literal[TriggerType.RECURRENCE]] endTime: str - interval: Required[int] - schedule: Required[RecurrenceSchedule] + interval: int + schedule: RecurrenceSchedule startTime: str timeZone: str - type: Required[Literal[TriggerType.RECURRENCE]] + type: Literal[TriggerType.RECURRENCE] class azure.ai.projects.types.RecurrenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -18801,40 +19207,40 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RedTeam(TypedDict, total=False): key "applicationScenario": str - key "attackStrategies": list[Union[str, AttackStrategy]] key "displayName": str + key "id": Required[str] key "numTurns": int - key "properties": dict[str, str] - key "riskCategories": list[Union[str, RiskCategory]] key "simulationOnly": bool key "status": str - key "tags": dict[str, str] + key "target": Required[RedTeamTargetConfig] applicationScenario: str attackStrategies: list[Union[str, AttackStrategy]] displayName: str - id: Required[str] + id: str numTurns: int properties: dict[str, str] riskCategories: list[Union[str, RiskCategory]] simulationOnly: bool status: str tags: dict[str, str] - target: Required[RedTeamTargetConfig] + target: RedTeamTargetConfig class azure.ai.projects.types.RedTeamTargetConfig(TypedDict, total=False): - modelDeploymentName: Required[str] - type: Required[Literal["AzureOpenAIModel"]] + key "modelDeploymentName": Required[str] + key "type": Required[Literal["AzureOpenAIModel"]] + modelDeploymentName: str + type: Literal[AzureOpenAIModel] class azure.ai.projects.types.ReminderPreviewToolboxTool(TypedDict, total=False): key "description": str key "name": str - key "tool_configs": dict[str, ToolConfig] + key "type": Required[Literal[ToolboxToolType.REMINDER_PREVIEW]] description: str name: str tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolboxToolType.REMINDER_PREVIEW]] + type: Literal[ToolboxToolType.REMINDER_PREVIEW] class azure.ai.projects.types.ResponsesProtocolConfiguration(TypedDict, total=False): @@ -18858,24 +19264,27 @@ namespace azure.ai.projects.types class azure.ai.projects.types.RubricBasedEvaluatorDefinition(TypedDict, total=False): - key "data_schema": dict[str, Any] - key "init_parameters": dict[str, Any] - key "metrics": dict[str, EvaluatorMetric] + key "dimensions": Required[list[Dimension]] key "pass_threshold": float + key "type": Required[Literal[EvaluatorDefinitionType.RUBRIC]] data_schema: dict[str, Any] - dimensions: Required[list[Dimension]] + dimensions: list[Dimension] init_parameters: dict[str, Any] metrics: dict[str, EvaluatorMetric] pass_threshold: float - type: Required[Literal[EvaluatorDefinitionType.RUBRIC]] + type: Literal[EvaluatorDefinitionType.RUBRIC] class azure.ai.projects.types.RubricGenerationInputQualityWarning(TypedDict, total=False): + key "code": Required[Union[str, RubricGenerationInputQualityWarningCode]] + key "message": Required[str] + key "severity": Required[Union[str, RubricGenerationInputQualityWarningSeverity]] + key "source": Required[Union[str, RubricGenerationInputQualityWarningSource]] key "source_index": int - code: Required[Union[str, RubricGenerationInputQualityWarningCode]] - message: Required[str] - severity: Required[Union[str, RubricGenerationInputQualityWarningSeverity]] - source: Required[Union[str, RubricGenerationInputQualityWarningSource]] + code: Union[str, RubricGenerationInputQualityWarningCode] + message: str + severity: Union[str, RubricGenerationInputQualityWarningSeverity] + source: Union[str, RubricGenerationInputQualityWarningSource] source_index: int @@ -18886,25 +19295,31 @@ namespace azure.ai.projects.types class azure.ai.projects.types.Schedule(TypedDict, total=False): key "description": str key "displayName": str - key "properties": dict[str, str] + key "enabled": Required[bool] + key "id": Required[str] key "provisioningStatus": Union[str, ScheduleProvisioningStatus] - key "tags": dict[str, str] + key "systemData": Required[dict[str, str]] + key "task": Required[ScheduleTask] + key "trigger": Required[Trigger] description: str displayName: str - enabled: Required[bool] - id: Required[str] + enabled: bool + id: str properties: dict[str, str] provisioningStatus: Union[str, ScheduleProvisioningStatus] - systemData: Required[dict[str, str]] + systemData: dict[str, str] tags: dict[str, str] - task: Required[ScheduleTask] - trigger: Required[Trigger] + task: ScheduleTask + trigger: Trigger class azure.ai.projects.types.ScheduleRoutineTrigger(TypedDict, total=False): - cron_expression: Required[str] - time_zone: Required[str] - type: Required[Literal[RoutineTriggerType.SCHEDULE]] + key "cron_expression": Required[str] + key "time_zone": Required[str] + key "type": Required[Literal[RoutineTriggerType.SCHEDULE]] + cron_expression: str + time_zone: str + type: Literal[RoutineTriggerType.SCHEDULE] class azure.ai.projects.types.ScheduleTaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -18913,82 +19328,90 @@ namespace azure.ai.projects.types class azure.ai.projects.types.SearchMemoriesRequest(TypedDict, total=False): - key "items": list[dict[str, Any]] - key "options": ForwardRef('MemorySearchOptions') + key "options": ForwardRef('MemorySearchOptions', module='types') key "previous_search_id": str + key "scope": Required[str] items: list[dict[str, Any]] options: MemorySearchOptions previous_search_id: str - scope: Required[str] + scope: str class azure.ai.projects.types.SharepointGroundingToolParameters(TypedDict, total=False): - key "project_connections": list[ToolProjectConnection] project_connections: list[ToolProjectConnection] class azure.ai.projects.types.SharepointPreviewTool(TypedDict, total=False): - sharepoint_grounding_preview: Required[SharepointGroundingToolParameters] - type: Required[Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW]] + key "sharepoint_grounding_preview": Required[SharepointGroundingToolParameters] + key "type": Required[Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW]] + sharepoint_grounding_preview: SharepointGroundingToolParameters + type: Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW] class azure.ai.projects.types.SimpleQnADataGenerationJobOptions(TypedDict, total=False): - key "model_options": ForwardRef('DataGenerationModelOptions') - key "question_types": list[Union[str, SimpleQnAFineTuningQuestionType]] + key "max_samples": Required[int] + key "model_options": ForwardRef('DataGenerationModelOptions', module='types') key "train_split": float - max_samples: Required[int] + key "type": Required[Literal[DataGenerationJobType.SIMPLE_QNA]] + max_samples: int model_options: DataGenerationModelOptions question_types: list[Union[str, SimpleQnAFineTuningQuestionType]] train_split: float - type: Required[Literal[DataGenerationJobType.SIMPLE_QNA]] + type: Literal[DataGenerationJobType.SIMPLE_QNA] class azure.ai.projects.types.SimulationSeedDataGenerationJobOptions(TypedDict, total=False): - key "model_options": ForwardRef('DataGenerationModelOptions') + key "max_samples": Required[int] + key "model_options": ForwardRef('DataGenerationModelOptions', module='types') key "train_split": float - max_samples: Required[int] + key "type": Required[Literal[DataGenerationJobType.SIMULATION_SEED]] + max_samples: int model_options: DataGenerationModelOptions train_split: float - type: Required[Literal[DataGenerationJobType.SIMULATION_SEED]] + type: Literal[DataGenerationJobType.SIMULATION_SEED] class azure.ai.projects.types.SkillInlineContent(TypedDict, total=False): - key "allowed_tools": list[str] key "compatibility": str + key "description": Required[str] + key "instructions": Required[str] key "license": str - key "metadata": dict[str, str] allowed_tools: list[str] compatibility: str - description: Required[str] - instructions: Required[str] + description: str + instructions: str license: str metadata: dict[str, str] class azure.ai.projects.types.SkillReferenceParam(TypedDict, total=False): + key "skill_id": Required[str] + key "type": Required[Literal[ContainerSkillType.SKILL_REFERENCE]] key "version": str - skill_id: Required[str] - type: Required[Literal[ContainerSkillType.SKILL_REFERENCE]] + skill_id: str + type: Literal[ContainerSkillType.SKILL_REFERENCE] version: str class azure.ai.projects.types.SpecificApplyPatchParam(TypedDict, total=False): - type: Required[Literal[ToolChoiceParamType.APPLY_PATCH]] + key "type": Required[Literal[ToolChoiceParamType.APPLY_PATCH]] + type: Literal[ToolChoiceParamType.APPLY_PATCH] class azure.ai.projects.types.SpecificFunctionShellParam(TypedDict, total=False): - type: Required[Literal[ToolChoiceParamType.SHELL]] + key "type": Required[Literal[ToolChoiceParamType.SHELL]] + type: Literal[ToolChoiceParamType.SHELL] class azure.ai.projects.types.SpecificProgrammaticToolCallingParam(TypedDict, total=False): - type: Required[Literal[ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING]] + key "type": Required[Literal[ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING]] + type: Literal[ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING] class azure.ai.projects.types.StructuredInputDefinition(TypedDict, total=False): key "default_value": Any key "description": str key "required": bool - key "schema": dict[str, Any] default_value: Any description: str required: bool @@ -18996,51 +19419,69 @@ namespace azure.ai.projects.types class azure.ai.projects.types.StructuredOutputDefinition(TypedDict, total=False): - description: Required[str] - name: Required[str] - schema: Required[dict[str, Any]] - strict: Required[Optional[bool]] + key "description": Required[str] + key "name": Required[str] + key "schema": Required[dict[str, Any]] + key "strict": Required[Optional[bool]] + description: str + name: str + schema: dict[str, Any] + strict: bool class azure.ai.projects.types.TaxonomyCategory(TypedDict, total=False): key "description": str - key "properties": dict[str, str] + key "id": Required[str] + key "name": Required[str] + key "riskCategory": Required[Union[str, RiskCategory]] + key "subCategories": Required[list[TaxonomySubCategory]] description: str - id: Required[str] - name: Required[str] + id: str + name: str properties: dict[str, str] - riskCategory: Required[Union[str, RiskCategory]] - subCategories: Required[list[TaxonomySubCategory]] + riskCategory: Union[str, RiskCategory] + subCategories: list[TaxonomySubCategory] class azure.ai.projects.types.TaxonomySubCategory(TypedDict, total=False): key "description": str - key "properties": dict[str, str] + key "enabled": Required[bool] + key "id": Required[str] + key "name": Required[str] description: str - enabled: Required[bool] - id: Required[str] - name: Required[str] + enabled: bool + id: str + name: str properties: dict[str, str] class azure.ai.projects.types.TelemetryConfig(TypedDict, total=False): - endpoints: Required[list[TelemetryEndpoint]] + key "endpoints": Required[list[TelemetryEndpoint]] + endpoints: list[TelemetryEndpoint] class azure.ai.projects.types.TelemetryEndpoint(TypedDict, total=False): - key "auth": ForwardRef('TelemetryEndpointAuth') + key "auth": ForwardRef('TelemetryEndpointAuth', module='types') + key "data": Required[list[Union[str, TelemetryDataKind]]] + key "endpoint": Required[str] + key "kind": Required[Literal[TelemetryEndpointKind.OTLP]] + key "protocol": Required[Union[str, TelemetryTransportProtocol]] auth: TelemetryEndpointAuth - data: Required[list[Union[str, TelemetryDataKind]]] - endpoint: Required[str] - kind: Required[Literal[TelemetryEndpointKind.OTLP]] - protocol: Required[Union[str, TelemetryTransportProtocol]] + data: list[Union[str, TelemetryDataKind]] + endpoint: str + kind: Literal[TelemetryEndpointKind.OTLP] + protocol: Union[str, TelemetryTransportProtocol] class azure.ai.projects.types.TelemetryEndpointAuth(TypedDict, total=False): - header_name: Required[str] - secret_id: Required[str] - secret_key: Required[str] - type: Required[Literal[TelemetryEndpointAuthType.HEADER]] + key "header_name": Required[str] + key "secret_id": Required[str] + key "secret_key": Required[str] + key "type": Required[Literal[TelemetryEndpointAuthType.HEADER]] + header_name: str + secret_id: str + secret_key: str + type: Literal[TelemetryEndpointAuthType.HEADER] class azure.ai.projects.types.TelemetryEndpointAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -19052,8 +19493,10 @@ namespace azure.ai.projects.types class azure.ai.projects.types.TemplateVoiceGreetingConfig(TypedDict, total=False): - text: Required[str] - type: Required[Literal["template"]] + key "text": Required[str] + key "type": Required[Literal["template"]] + text: str + type: Literal[template] class azure.ai.projects.types.TextResponseFormatConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -19063,74 +19506,95 @@ namespace azure.ai.projects.types class azure.ai.projects.types.TextResponseFormatJsonObject(TypedDict, total=False): - type: Required[Literal[TextResponseFormatConfigurationType.JSON_OBJECT]] + key "type": Required[Literal[TextResponseFormatConfigurationType.JSON_OBJECT]] + type: Literal[TextResponseFormatConfigurationType.JSON_OBJECT] class azure.ai.projects.types.TextResponseFormatJsonSchema(TypedDict, total=False): key "description": str + key "name": Required[str] + key "schema": Required[dict[str, Any]] key "strict": Optional[bool] + key "type": Required[Literal[TextResponseFormatConfigurationType.JSON_SCHEMA]] description: str - name: Required[str] - schema: Required[dict[str, Any]] + name: str + schema: dict[str, Any] strict: bool - type: Required[Literal[TextResponseFormatConfigurationType.JSON_SCHEMA]] + type: Literal[TextResponseFormatConfigurationType.JSON_SCHEMA] class azure.ai.projects.types.TextResponseFormatText(TypedDict, total=False): - type: Required[Literal[TextResponseFormatConfigurationType.TEXT]] + key "type": Required[Literal[TextResponseFormatConfigurationType.TEXT]] + type: Literal[TextResponseFormatConfigurationType.TEXT] class azure.ai.projects.types.TimerRoutineTrigger(TypedDict, total=False): key "at": int + key "type": Required[Literal[RoutineTriggerType.TIMER]] at: int - type: Required[Literal[RoutineTriggerType.TIMER]] + type: Literal[RoutineTriggerType.TIMER] class azure.ai.projects.types.ToolChoiceAllowed(TypedDict, total=False): - mode: Required[Literal["auto", "required"]] - tools: Required[list[dict[str, Any]]] - type: Required[Literal[ToolChoiceParamType.ALLOWED_TOOLS]] + key "mode": Required[Literal["auto", "required"]] + key "tools": Required[list[dict[str, Any]]] + key "type": Required[Literal[ToolChoiceParamType.ALLOWED_TOOLS]] + mode: Literal[auto, required] + tools: list[dict[str, Any]] + type: Literal[ToolChoiceParamType.ALLOWED_TOOLS] class azure.ai.projects.types.ToolChoiceCodeInterpreter(TypedDict, total=False): - type: Required[Literal[ToolChoiceParamType.CODE_INTERPRETER]] + key "type": Required[Literal[ToolChoiceParamType.CODE_INTERPRETER]] + type: Literal[ToolChoiceParamType.CODE_INTERPRETER] class azure.ai.projects.types.ToolChoiceComputer(TypedDict, total=False): - type: Required[Literal[ToolChoiceParamType.COMPUTER]] + key "type": Required[Literal[ToolChoiceParamType.COMPUTER]] + type: Literal[ToolChoiceParamType.COMPUTER] class azure.ai.projects.types.ToolChoiceComputerUse(TypedDict, total=False): - type: Required[Literal[ToolChoiceParamType.COMPUTER_USE]] + key "type": Required[Literal[ToolChoiceParamType.COMPUTER_USE]] + type: Literal[ToolChoiceParamType.COMPUTER_USE] class azure.ai.projects.types.ToolChoiceComputerUsePreview(TypedDict, total=False): - type: Required[Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW]] + key "type": Required[Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW]] + type: Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW] class azure.ai.projects.types.ToolChoiceCustom(TypedDict, total=False): - name: Required[str] - type: Required[Literal[ToolChoiceParamType.CUSTOM]] + key "name": Required[str] + key "type": Required[Literal[ToolChoiceParamType.CUSTOM]] + name: str + type: Literal[ToolChoiceParamType.CUSTOM] class azure.ai.projects.types.ToolChoiceFileSearch(TypedDict, total=False): - type: Required[Literal[ToolChoiceParamType.FILE_SEARCH]] + key "type": Required[Literal[ToolChoiceParamType.FILE_SEARCH]] + type: Literal[ToolChoiceParamType.FILE_SEARCH] class azure.ai.projects.types.ToolChoiceFunction(TypedDict, total=False): - name: Required[str] - type: Required[Literal[ToolChoiceParamType.FUNCTION]] + key "name": Required[str] + key "type": Required[Literal[ToolChoiceParamType.FUNCTION]] + name: str + type: Literal[ToolChoiceParamType.FUNCTION] class azure.ai.projects.types.ToolChoiceImageGeneration(TypedDict, total=False): - type: Required[Literal[ToolChoiceParamType.IMAGE_GENERATION]] + key "type": Required[Literal[ToolChoiceParamType.IMAGE_GENERATION]] + type: Literal[ToolChoiceParamType.IMAGE_GENERATION] class azure.ai.projects.types.ToolChoiceMCP(TypedDict, total=False): key "name": Optional[str] + key "server_label": Required[str] + key "type": Required[Literal[ToolChoiceParamType.MCP]] name: str - server_label: Required[str] - type: Required[Literal[ToolChoiceParamType.MCP]] + server_label: str + type: Literal[ToolChoiceParamType.MCP] class azure.ai.projects.types.ToolChoiceParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -19152,11 +19616,13 @@ namespace azure.ai.projects.types class azure.ai.projects.types.ToolChoiceWebSearchPreview(TypedDict, total=False): - type: Required[Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW]] + key "type": Required[Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW]] + type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW] class azure.ai.projects.types.ToolChoiceWebSearchPreview20250311(TypedDict, total=False): - type: Required[Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11]] + key "type": Required[Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11]] + type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11] class azure.ai.projects.types.ToolConfig(TypedDict, total=False): @@ -19174,27 +19640,29 @@ namespace azure.ai.projects.types class azure.ai.projects.types.ToolProjectConnection(TypedDict, total=False): - project_connection_id: Required[str] + key "project_connection_id": Required[str] + project_connection_id: str class azure.ai.projects.types.ToolSearchToolParam(TypedDict, total=False): key "description": Optional[str] key "execution": Union[str, ToolSearchExecutionType] key "parameters": Optional[EmptyModelParam] + key "type": Required[Literal[ToolType.TOOL_SEARCH]] description: str execution: Union[str, ToolSearchExecutionType] parameters: EmptyModelParam - type: Required[Literal[ToolType.TOOL_SEARCH]] + type: Literal[ToolType.TOOL_SEARCH] class azure.ai.projects.types.ToolSearchToolboxTool(TypedDict, total=False): key "description": str key "name": str - key "tool_configs": dict[str, ToolConfig] + key "type": Required[Literal[ToolboxToolType.TOOLBOX_SEARCH]] description: str name: str tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolboxToolType.TOOLBOX_SEARCH]] + type: Literal[ToolboxToolType.TOOLBOX_SEARCH] class azure.ai.projects.types.ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -19231,40 +19699,46 @@ namespace azure.ai.projects.types class azure.ai.projects.types.ToolUseFineTuningDataGenerationJobOptions(TypedDict, total=False): - key "model_options": ForwardRef('DataGenerationModelOptions') + key "max_samples": Required[int] + key "model_options": ForwardRef('DataGenerationModelOptions', module='types') key "train_split": float - max_samples: Required[int] + key "type": Required[Literal[DataGenerationJobType.TOOL_USE]] + max_samples: int model_options: DataGenerationModelOptions train_split: float - type: Required[Literal[DataGenerationJobType.TOOL_USE]] + type: Literal[DataGenerationJobType.TOOL_USE] class azure.ai.projects.types.ToolboxPolicies(TypedDict, total=False): - key "rai_config": ForwardRef('RaiConfig') + key "rai_config": ForwardRef('RaiConfig', module='types') rai_config: RaiConfig class azure.ai.projects.types.ToolboxSearchPreviewToolboxTool(TypedDict, total=False): key "description": str key "name": str - key "tool_configs": dict[str, ToolConfig] + key "type": Required[Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW]] description: str name: str tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW]] + type: Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW] class azure.ai.projects.types.ToolboxSkill(TypedDict, total=False): + key "name": Required[str] + key "type": Required[Literal["skill_reference"]] key "version": str - name: Required[str] - type: Required[Literal["skill_reference"]] + name: str + type: Literal[skill_reference] version: str class azure.ai.projects.types.ToolboxSkillReference(TypedDict, total=False): + key "name": Required[str] + key "type": Required[Literal["skill_reference"]] key "version": str - name: Required[str] - type: Required[Literal["skill_reference"]] + name: str + type: Literal[skill_reference] version: str @@ -19285,12 +19759,14 @@ namespace azure.ai.projects.types class azure.ai.projects.types.TracesDataGenerationJobOptions(TypedDict, total=False): - key "model_options": ForwardRef('DataGenerationModelOptions') + key "max_samples": Required[int] + key "model_options": ForwardRef('DataGenerationModelOptions', module='types') key "train_split": float - max_samples: Required[int] + key "type": Required[Literal[DataGenerationJobType.TRACES]] + max_samples: int model_options: DataGenerationModelOptions train_split: float - type: Required[Literal[DataGenerationJobType.TRACES]] + type: Literal[DataGenerationJobType.TRACES] class azure.ai.projects.types.TracesDataGenerationJobSource(TypedDict, total=False): @@ -19299,13 +19775,15 @@ namespace azure.ai.projects.types key "agent_version": str key "description": str key "end_time": int + key "start_time": Required[int] + key "type": Required[Literal[DataGenerationJobSourceType.TRACES]] agent_id: str agent_name: str agent_version: str description: str end_time: int - start_time: Required[int] - type: Required[Literal[DataGenerationJobSourceType.TRACES]] + start_time: int + type: Literal[DataGenerationJobSourceType.TRACES] class azure.ai.projects.types.TracesEvaluatorGenerationJobSource(TypedDict, total=False): @@ -19314,27 +19792,35 @@ namespace azure.ai.projects.types key "agent_version": str key "description": str key "end_time": int + key "start_time": Required[int] + key "type": Required[Literal[EvaluatorGenerationJobSourceType.TRACES]] agent_id: str agent_name: str agent_version: str description: str end_time: int - start_time: Required[int] - type: Required[Literal[EvaluatorGenerationJobSourceType.TRACES]] + start_time: int + type: Literal[EvaluatorGenerationJobSourceType.TRACES] class azure.ai.projects.types.TranscriptTextUsageDuration(TypedDict, total=False): - seconds: Required[str] - type: Required[Literal[CreateTranscriptionResponseJsonUsageType.DURATION]] + key "seconds": Required[str] + key "type": Required[Literal[CreateTranscriptionResponseJsonUsageType.DURATION]] + seconds: str + type: Literal[CreateTranscriptionResponseJsonUsageType.DURATION] class azure.ai.projects.types.TranscriptTextUsageTokens(TypedDict, total=False): - key "input_token_details": ForwardRef('TranscriptTextUsageTokensInputTokenDetails') + key "input_token_details": ForwardRef('TranscriptTextUsageTokensInputTokenDetails', module='types') + key "input_tokens": Required[int] + key "output_tokens": Required[int] + key "total_tokens": Required[int] + key "type": Required[Literal[CreateTranscriptionResponseJsonUsageType.TOKENS]] input_token_details: TranscriptTextUsageTokensInputTokenDetails - input_tokens: Required[int] - output_tokens: Required[int] - total_tokens: Required[int] - type: Required[Literal[CreateTranscriptionResponseJsonUsageType.TOKENS]] + input_tokens: int + output_tokens: int + total_tokens: int + type: Literal[CreateTranscriptionResponseJsonUsageType.TOKENS] class azure.ai.projects.types.TranscriptTextUsageTokensInputTokenDetails(TypedDict, total=False): @@ -19351,48 +19837,52 @@ namespace azure.ai.projects.types class azure.ai.projects.types.UpdateMemoriesRequest(TypedDict, total=False): - key "items": list[dict[str, Any]] key "previous_update_id": str + key "scope": Required[str] key "update_delay": int items: list[dict[str, Any]] previous_update_id: str - scope: Required[str] + scope: str update_delay: int class azure.ai.projects.types.UpdateMemoryRequest(TypedDict, total=False): - content: Required[str] + key "content": Required[str] + content: str class azure.ai.projects.types.UpdateMemoryStoreRequest(TypedDict, total=False): key "description": str - key "metadata": dict[str, str] description: str metadata: dict[str, str] class azure.ai.projects.types.UpdateModelVersionRequest(TypedDict, total=False): key "description": str - key "tags": dict[str, str] description: str tags: dict[str, str] class azure.ai.projects.types.UpdateSkillRequest(TypedDict, total=False): - default_version: Required[str] + key "default_version": Required[str] + default_version: str class azure.ai.projects.types.UpdateToolboxRequest(TypedDict, total=False): - default_version: Required[str] + key "default_version": Required[str] + default_version: str class azure.ai.projects.types.UpdateToolboxRequest1(TypedDict, total=False): - default_version: Required[str] + key "default_version": Required[str] + default_version: str class azure.ai.projects.types.VersionIndicator(TypedDict, total=False): - agent_version: Required[str] - type: Required[Literal[VersionIndicatorType.VERSION_REF]] + key "agent_version": Required[str] + key "type": Required[Literal[VersionIndicatorType.VERSION_REF]] + agent_version: str + type: Literal[VersionIndicatorType.VERSION_REF] class azure.ai.projects.types.VersionIndicatorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -19400,18 +19890,24 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VersionRefIndicator(TypedDict, total=False): - agent_version: Required[str] - type: Required[Literal[VersionIndicatorType.VERSION_REF]] + key "agent_version": Required[str] + key "type": Required[Literal[VersionIndicatorType.VERSION_REF]] + agent_version: str + type: Literal[VersionIndicatorType.VERSION_REF] class azure.ai.projects.types.VersionSelectionRule(TypedDict, total=False): - agent_version: Required[str] - traffic_percentage: Required[int] - type: Required[Literal[VersionSelectorType.FIXED_RATIO]] + key "agent_version": Required[str] + key "traffic_percentage": Required[int] + key "type": Required[Literal[VersionSelectorType.FIXED_RATIO]] + agent_version: str + traffic_percentage: int + type: Literal[VersionSelectorType.FIXED_RATIO] class azure.ai.projects.types.VersionSelector(TypedDict, total=False): - version_selection_rules: Required[list[VersionSelectionRule]] + key "version_selection_rules": Required[list[VersionSelectionRule]] + version_selection_rules: list[VersionSelectionRule] class azure.ai.projects.types.VersionSelectorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -19420,16 +19916,16 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceAgentAnimationConfig(TypedDict, total=False): key "model_name": str - key "outputs": list[Union[str, VoiceAgentAnimationOutputType]] model_name: str outputs: list[Union[str, VoiceAgentAnimationOutputType]] class azure.ai.projects.types.VoiceAgentAvatarIceServer(TypedDict, total=False): key "credential": Optional[str] + key "urls": Required[list[str]] key "username": Optional[str] credential: str - urls: Required[list[str]] + urls: list[str] username: str @@ -19458,17 +19954,19 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceAgentAvatarVideoCrop(TypedDict, total=False): - bottom_right: Required[list[int]] - top_left: Required[list[int]] + key "bottom_right": Required[list[int]] + key "top_left": Required[list[int]] + bottom_right: list[int] + top_left: list[int] class azure.ai.projects.types.VoiceAgentAvatarVideoParams(TypedDict, total=False): - key "background": ForwardRef('VoiceAgentAvatarVideoBackground') + key "background": ForwardRef('VoiceAgentAvatarVideoBackground', module='types') key "bitrate": int key "codec": Literal["h264"] - key "crop": ForwardRef('VoiceAgentAvatarVideoCrop') + key "crop": ForwardRef('VoiceAgentAvatarVideoCrop', module='types') key "gop_size": int - key "resolution": ForwardRef('VoiceAgentAvatarVideoResolution') + key "resolution": ForwardRef('VoiceAgentAvatarVideoResolution', module='types') background: VoiceAgentAvatarVideoBackground bitrate: int codec: Literal[h264] @@ -19478,122 +19976,144 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceAgentAvatarVideoResolution(TypedDict, total=False): - height: Required[int] - width: Required[int] + key "height": Required[int] + key "width": Required[int] + height: int + width: int class azure.ai.projects.types.VoiceAgentClientEventConversationItemCreate(TypedDict, total=False): key "event_id": str + key "item": Required[VoiceAgentCreateConversationItem] key "previous_item_id": str + key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE]] event_id: str - item: Required[VoiceAgentCreateConversationItem] + item: VoiceAgentCreateConversationItem previous_item_id: str - type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE]] + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE] class azure.ai.projects.types.VoiceAgentClientEventConversationItemDelete(TypedDict, total=False): key "event_id": str + key "item_id": Required[str] + key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE]] event_id: str - item_id: Required[str] - type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE]] + item_id: str + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE] class azure.ai.projects.types.VoiceAgentClientEventConversationItemRetrieve(TypedDict, total=False): key "event_id": str + key "item_id": Required[str] + key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE]] event_id: str - item_id: Required[str] - type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE]] + item_id: str + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE] class azure.ai.projects.types.VoiceAgentClientEventConversationItemTruncate(TypedDict, total=False): + key "audio_end_ms": Required[int] + key "content_index": Required[int] key "event_id": str - audio_end_ms: Required[int] - content_index: Required[int] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE]] + audio_end_ms: int + content_index: int event_id: str - item_id: Required[str] - type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE]] + item_id: str + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE] class azure.ai.projects.types.VoiceAgentClientEventInputAudioBufferAppend(TypedDict, total=False): + key "audio": Required[str] key "event_id": str - audio: Required[str] + key "type": Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND]] + audio: str event_id: str - type: Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND]] + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND] class azure.ai.projects.types.VoiceAgentClientEventInputAudioBufferClear(TypedDict, total=False): key "event_id": str + key "type": Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR]] event_id: str - type: Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR]] + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR] class azure.ai.projects.types.VoiceAgentClientEventInputAudioBufferCommit(TypedDict, total=False): key "event_id": str + key "type": Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT]] event_id: str - type: Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT]] + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT] class azure.ai.projects.types.VoiceAgentClientEventOutputAudioBufferClear(TypedDict, total=False): key "event_id": str + key "type": Required[Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR]] event_id: str - type: Required[Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR]] + type: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR] class azure.ai.projects.types.VoiceAgentClientEventResponseCancel(TypedDict, total=False): key "event_id": str key "response_id": str + key "type": Required[Literal[RealtimeClientEventType.RESPONSE_CANCEL]] event_id: str response_id: str - type: Required[Literal[RealtimeClientEventType.RESPONSE_CANCEL]] + type: Literal[RealtimeClientEventType.RESPONSE_CANCEL] class azure.ai.projects.types.VoiceAgentClientEventResponseCreate(TypedDict, total=False): key "event_id": str - key "response": ForwardRef('VoiceAgentResponseCreateParams') + key "response": ForwardRef('VoiceAgentResponseCreateParams', module='types') + key "type": Required[Literal[RealtimeClientEventType.RESPONSE_CREATE]] event_id: str response: VoiceAgentResponseCreateParams - type: Required[Literal[RealtimeClientEventType.RESPONSE_CREATE]] + type: Literal[RealtimeClientEventType.RESPONSE_CREATE] class azure.ai.projects.types.VoiceAgentClientEventSessionAvatarConnect(TypedDict, total=False): + key "client_sdp": Required[str] key "event_id": str - client_sdp: Required[str] + key "type": Required[Literal["connect"]] + client_sdp: str event_id: str - type: Required[Literal["connect"]] + type: Literal[connect] class azure.ai.projects.types.VoiceAgentClientEventSessionUpdate(TypedDict, total=False): key "event_id": str + key "session": Required[VoiceAgentSessionUpdateConfig] + key "type": Required[Literal[RealtimeClientEventType.SESSION_UPDATE]] event_id: str - session: Required[VoiceAgentSessionUpdateConfig] - type: Required[Literal[RealtimeClientEventType.SESSION_UPDATE]] + session: VoiceAgentSessionUpdateConfig + type: Literal[RealtimeClientEventType.SESSION_UPDATE] class azure.ai.projects.types.VoiceAgentDefinition(TypedDict, total=False): - key "audio": ForwardRef('VoiceAudioConfig') - key "avatar": ForwardRef('VoiceAvatarConfig') - key "greeting": ForwardRef('VoiceGreetingConfig') - key "include": list[Union[str, VoiceAgentSessionIncludeOption]] + key "audio": ForwardRef('VoiceAudioConfig', module='types') + key "avatar": ForwardRef('VoiceAvatarConfig', module='types') + key "greeting": ForwardRef('VoiceGreetingConfig', module='types') key "instructions": str - key "interim_response": ForwardRef('VoiceAgentInterimResponse') - key "max_output_tokens": ForwardRef('VoiceAgentMaxOutputTokens') - key "output_modalities": list[Union[str, VoiceOutputModality]] + key "interim_response": ForwardRef('VoiceAgentInterimResponse', module='types') + key "kind": Required[Literal[AgentKind.VOICE]] + key "max_output_tokens": ForwardRef('VoiceAgentMaxOutputTokens', module='types') + key "model": Required[str] + key "model_type": Required[Union[str, VoiceModelType]] key "parallel_tool_calls": bool - key "rai_config": ForwardRef('RaiConfig') + key "rai_config": ForwardRef('RaiConfig', module='types') key "store": bool - key "structured_inputs": dict[str, StructuredInputDefinition] - key "tool_choice": ForwardRef('VoiceAgentToolChoice') - key "tools": list[VoiceAgentTool] + key "tool_choice": ForwardRef('VoiceAgentToolChoice', module='types') audio: VoiceAudioConfig avatar: VoiceAvatarConfig greeting: VoiceGreetingConfig include: list[Union[str, VoiceAgentSessionIncludeOption]] instructions: str interim_response: VoiceAgentInterimResponse - kind: Required[Literal[AgentKind.VOICE]] + kind: Literal[AgentKind.VOICE] max_output_tokens: VoiceAgentMaxOutputTokens - model: Required[str] - model_type: Required[Union[str, VoiceModelType]] + model: str + model_type: Union[str, VoiceModelType] output_modalities: list[Union[str, VoiceOutputModality]] parallel_tool_calls: bool rai_config: RaiConfig @@ -19606,18 +20126,21 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceAgentEchoCancellation(TypedDict, total=False): key "channels": int key "reference_source": Union[str, VoiceAgentEchoCancellationReferenceSource] + key "type": Required[Literal["server_echo_cancellation"]] channels: int reference_source: Union[str, VoiceAgentEchoCancellationReferenceSource] - type: Required[Literal["server_echo_cancellation"]] + type: Literal[server_echo_cancellation] class azure.ai.projects.types.VoiceAgentFunctionTool(TypedDict, total=False): key "description": str - key "parameters": ForwardRef('RealtimeFunctionToolParameters') + key "name": Required[str] + key "parameters": ForwardRef('RealtimeFunctionToolParameters', module='types') + key "type": Required[Literal["function"]] description: str - name: Required[str] + name: str parameters: RealtimeFunctionToolParameters - type: Required[Literal["function"]] + type: Literal[function] class azure.ai.projects.types.VoiceAgentLlmInterimResponseConfig(TypedDict, total=False): @@ -19625,13 +20148,13 @@ namespace azure.ai.projects.types key "latency_threshold_ms": int key "max_completion_tokens": int key "model": str - key "triggers": list[Union[str, VoiceAgentInterimResponseTrigger]] + key "type": Required[Literal["llm_interim_response"]] instructions: str latency_threshold_ms: int max_completion_tokens: int model: str triggers: list[Union[str, VoiceAgentInterimResponseTrigger]] - type: Required[Literal["llm_interim_response"]] + type: Literal[llm_interim_response] class azure.ai.projects.types.VoiceAgentMcpTool(TypedDict, total=False): @@ -19644,8 +20167,9 @@ namespace azure.ai.projects.types key "require_approval": Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] key "response_scheduling": Union[str, VoiceAgentToolResponseScheduling] key "server_description": str + key "server_label": Required[str] key "server_url": str - key "tool_configs": dict[str, ToolConfig] + key "type": Required[Literal["mcp"]] allowed_callers: list[Union[str, CallableToolAllowedCaller]] allowed_tools: Union[list[str], MCPToolFilter] authorization: str @@ -19655,24 +20179,22 @@ namespace azure.ai.projects.types require_approval: Union[MCPToolRequireApproval, Literal[always], Literal[never]] response_scheduling: Union[str, VoiceAgentToolResponseScheduling] server_description: str - server_label: Required[str] + server_label: str server_url: str tool_configs: dict[str, ToolConfig] - type: Required[Literal["mcp"]] + type: Literal[mcp] class azure.ai.projects.types.VoiceAgentRealtimeResponse(OmitPropertiesRealtimeResponse1): - key "audio": ForwardRef('VoiceResponseAudio') + key "audio": ForwardRef('VoiceResponseAudio', module='types') key "conversation_id": str key "id": str key "max_output_tokens": Union[int, Literal["inf"]] key "metadata": Optional[Metadata] key "object": Literal["response"] - key "output": list[VoiceAgentResponseItem] - key "output_modalities": list[Literal["text", "audio"]] key "status": Literal["completed", "cancelled", "failed", "incomplete", "in_progress"] - key "status_details": ForwardRef('RealtimeResponseStatusDetails') - key "usage": ForwardRef('RealtimeResponseUsage') + key "status_details": ForwardRef('RealtimeResponseStatusDetails', module='types') + key "usage": ForwardRef('RealtimeResponseUsage', module='types') audio: VoiceResponseAudio conversation_id: str id: str @@ -19680,26 +20202,23 @@ namespace azure.ai.projects.types metadata: Metadata object: Literal[response] output: list[VoiceAgentResponseItem] - output_modalities: list[Literal[text, audio]] + output_modalities: list[Literal["text", "audio"]] status: Literal[completed, cancelled, failed, incomplete, in_progress] status_details: RealtimeResponseStatusDetails usage: RealtimeResponseUsage class azure.ai.projects.types.VoiceAgentResponseCreateParams(TypedDict, total=False): - key "audio": ForwardRef('PickPropertiesVoiceAudioConfig') + key "audio": ForwardRef('PickPropertiesVoiceAudioConfig', module='types') key "conversation": Union[Literal["auto"], Literal["none"], str] - key "input": list[RealtimeConversationItem] key "instructions": str key "interim_response": Optional[VoiceAgentInterimResponse] key "max_output_tokens": Union[int, Literal["inf"]] key "metadata": Optional[Metadata] - key "output_modalities": list[Union[str, VoiceOutputModality]] key "parallel_tool_calls": bool key "pre_generated_assistant_message": Optional[RealtimeConversationItemMessageAssistant] - key "reasoning": ForwardRef('RealtimeReasoning') + key "reasoning": ForwardRef('RealtimeReasoning', module='types') key "tool_choice": Union[str, ToolChoiceOptions, ToolChoiceFunction, ToolChoiceMCP] - key "tools": list[Union[RealtimeFunctionTool, MCPTool]] audio: PickPropertiesVoiceAudioConfig conversation: Union[Literal[auto], Literal[none], str] input: list[RealtimeConversationItem] @@ -19717,7 +20236,7 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceAgentResponseEventContentPart(TypedDict, total=False): key "audio": str - key "format": ForwardRef('VoiceAudioFormat') + key "format": ForwardRef('VoiceAudioFormat', module='types') key "text": str key "transcript": str key "type": Literal["audio", "text"] @@ -19733,453 +20252,700 @@ namespace azure.ai.projects.types key "create_response": bool key "eagerness": Literal["low", "medium", "high", "auto"] key "interrupt_response": bool + key "type": Required[Literal[VoiceTurnDetectionType.SEMANTIC_VAD]] auto_truncate: bool create_response: bool eagerness: Literal[low, medium, high, auto] interrupt_response: bool - type: Required[Literal[VoiceTurnDetectionType.SEMANTIC_VAD]] + type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD] class azure.ai.projects.types.VoiceAgentServerEventConversationItemAdded(TypedDict, total=False): + key "event_id": Required[str] + key "item": Required[VoiceAgentResponseItem] key "previous_item_id": Optional[str] - event_id: Required[str] - item: Required[VoiceAgentResponseItem] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED]] + event_id: str + item: VoiceAgentResponseItem previous_item_id: str - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED]] + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED] class azure.ai.projects.types.VoiceAgentServerEventConversationItemCreated(TypedDict, total=False): + key "event_id": Required[str] + key "item": Required[VoiceAgentResponseItem] key "previous_item_id": Optional[str] - event_id: Required[str] - item: Required[VoiceAgentResponseItem] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED]] + event_id: str + item: VoiceAgentResponseItem previous_item_id: str - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED]] + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED] class azure.ai.projects.types.VoiceAgentServerEventConversationItemDeleted(TypedDict, total=False): - event_id: Required[str] - item_id: Required[str] - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED]] + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED]] + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED] class azure.ai.projects.types.VoiceAgentServerEventConversationItemDone(TypedDict, total=False): + key "event_id": Required[str] + key "item": Required[VoiceAgentResponseItem] key "previous_item_id": Optional[str] - event_id: Required[str] - item: Required[VoiceAgentResponseItem] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE]] + event_id: str + item: VoiceAgentResponseItem previous_item_id: str - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE]] + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE] class azure.ai.projects.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted(TypedDict, total=False): + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] key "logprobs": Optional[list[LogProbProperties]] key "phrases": Optional[list[VoiceAgentTranscriptionPhrase]] - content_index: Required[int] - event_id: Required[str] - item_id: Required[str] + key "transcript": Required[str] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED]] + key "usage": Required[Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration]] + content_index: int + event_id: str + item_id: str logprobs: list[LogProbProperties] phrases: list[VoiceAgentTranscriptionPhrase] - transcript: Required[str] - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED]] - usage: Required[Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration]] + transcript: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED] + usage: Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration] class azure.ai.projects.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta(TypedDict, total=False): key "content_index": int key "delta": str + key "event_id": Required[str] + key "item_id": Required[str] key "logprobs": Optional[list[LogProbProperties]] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA]] content_index: int delta: str - event_id: Required[str] - item_id: Required[str] + event_id: str + item_id: str logprobs: list[LogProbProperties] - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA]] + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA] class azure.ai.projects.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed(TypedDict, total=False): - content_index: Required[int] - error: Required[RealtimeServerEventConversationItemInputAudioTranscriptionFailedError] - event_id: Required[str] - item_id: Required[str] - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED]] + key "content_index": Required[int] + key "error": Required[RealtimeServerEventConversationItemInputAudioTranscriptionFailedError] + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED]] + content_index: int + error: RealtimeServerEventConversationItemInputAudioTranscriptionFailedError + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED] class azure.ai.projects.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment(TypedDict, total=False): - content_index: Required[int] - end: Required[float] - event_id: Required[str] - id: Required[str] - item_id: Required[str] - speaker: Required[str] - start: Required[float] - text: Required[str] - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT]] + key "content_index": Required[int] + key "end": Required[float] + key "event_id": Required[str] + key "id": Required[str] + key "item_id": Required[str] + key "speaker": Required[str] + key "start": Required[float] + key "text": Required[str] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT]] + content_index: int + end: float + event_id: str + id: str + item_id: str + speaker: str + start: float + text: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT] class azure.ai.projects.types.VoiceAgentServerEventConversationItemRetrieved(TypedDict, total=False): - event_id: Required[str] - item: Required[VoiceAgentResponseItem] - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED]] + key "event_id": Required[str] + key "item": Required[VoiceAgentResponseItem] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED]] + event_id: str + item: VoiceAgentResponseItem + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED] class azure.ai.projects.types.VoiceAgentServerEventConversationItemTruncated(TypedDict, total=False): - key "item": ForwardRef('RealtimeConversationItemMessageAssistant') - audio_end_ms: Required[int] - content_index: Required[int] - event_id: Required[str] + key "audio_end_ms": Required[int] + key "content_index": Required[int] + key "event_id": Required[str] + key "item": ForwardRef('RealtimeConversationItemMessageAssistant', module='types') + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED]] + audio_end_ms: int + content_index: int + event_id: str item: RealtimeConversationItemMessageAssistant - item_id: Required[str] - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED]] + item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED] class azure.ai.projects.types.VoiceAgentServerEventInputAudioBufferCleared(TypedDict, total=False): - event_id: Required[str] - type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED]] + key "event_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED]] + event_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED] class azure.ai.projects.types.VoiceAgentServerEventInputAudioBufferCommitted(TypedDict, total=False): + key "event_id": Required[str] + key "item_id": Required[str] key "previous_item_id": Optional[str] - event_id: Required[str] - item_id: Required[str] + key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED]] + event_id: str + item_id: str previous_item_id: str - type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED]] + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED] class azure.ai.projects.types.VoiceAgentServerEventInputAudioBufferSpeechStarted(TypedDict, total=False): - audio_start_ms: Required[int] - event_id: Required[str] - item_id: Required[str] - type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED]] + key "audio_start_ms": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED]] + audio_start_ms: int + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED] class azure.ai.projects.types.VoiceAgentServerEventInputAudioBufferSpeechStopped(TypedDict, total=False): - audio_end_ms: Required[int] - event_id: Required[str] - item_id: Required[str] - type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED]] + key "audio_end_ms": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED]] + audio_end_ms: int + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED] class azure.ai.projects.types.VoiceAgentServerEventInputAudioBufferTimeoutTriggered(TypedDict, total=False): - audio_end_ms: Required[int] - audio_start_ms: Required[int] - event_id: Required[str] - item_id: Required[str] - type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED]] + key "audio_end_ms": Required[int] + key "audio_start_ms": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED]] + audio_end_ms: int + audio_start_ms: int + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED] class azure.ai.projects.types.VoiceAgentServerEventMcpListToolsCompleted(TypedDict, total=False): - event_id: Required[str] - item_id: Required[str] - type: Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED]] + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED]] + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED] class azure.ai.projects.types.VoiceAgentServerEventMcpListToolsFailed(TypedDict, total=False): - event_id: Required[str] - item_id: Required[str] - type: Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED]] + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED]] + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED] class azure.ai.projects.types.VoiceAgentServerEventMcpListToolsInProgress(TypedDict, total=False): - event_id: Required[str] - item_id: Required[str] - type: Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS]] + key "event_id": Required[str] + key "item_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS]] + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS] class azure.ai.projects.types.VoiceAgentServerEventOutputAudioBufferCleared(TypedDict, total=False): - event_id: Required[str] - response_id: Required[str] - type: Required[Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED]] + key "event_id": Required[str] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED]] + event_id: str + response_id: str + type: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED] class azure.ai.projects.types.VoiceAgentServerEventRateLimitsUpdated(TypedDict, total=False): - event_id: Required[str] - rate_limits: Required[list[RealtimeServerEventRateLimitsUpdatedRateLimits]] - type: Required[Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED]] + key "event_id": Required[str] + key "rate_limits": Required[list[RealtimeServerEventRateLimitsUpdatedRateLimits]] + key "type": Required[Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED]] + event_id: str + rate_limits: list[RealtimeServerEventRateLimitsUpdatedRateLimits] + type: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED] class azure.ai.projects.types.VoiceAgentServerEventResponseAnimationBlendshapesDelta(TypedDict, total=False): - content_index: Required[int] - event_id: Required[str] - frame_index: Required[int] - frames: Required[list[list[float]]] - item_id: Required[str] - output_index: Required[int] - response_id: Required[str] - type: Required[Literal["delta"]] + key "content_index": Required[int] + key "event_id": Required[str] + key "frame_index": Required[int] + key "frames": Required[list[list[float]]] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal["delta"]] + content_index: int + event_id: str + frame_index: int + frames: list[list[float]] + item_id: str + output_index: int + response_id: str + type: Literal[delta] class azure.ai.projects.types.VoiceAgentServerEventResponseAnimationBlendshapesDone(TypedDict, total=False): - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - response_id: Required[str] - type: Required[Literal["done"]] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal["done"]] + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[done] class azure.ai.projects.types.VoiceAgentServerEventResponseAnimationVisemeDelta(TypedDict, total=False): - audio_offset_ms: Required[int] - content_index: Required[int] - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - response_id: Required[str] - type: Required[Literal["delta"]] - viseme_id: Required[int] + key "audio_offset_ms": Required[int] + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal["delta"]] + key "viseme_id": Required[int] + audio_offset_ms: int + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[delta] + viseme_id: int class azure.ai.projects.types.VoiceAgentServerEventResponseAnimationVisemeDone(TypedDict, total=False): - content_index: Required[int] - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - response_id: Required[str] - type: Required[Literal["done"]] + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal["done"]] + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[done] class azure.ai.projects.types.VoiceAgentServerEventResponseAudioDelta(TypedDict, total=False): - content_index: Required[int] - delta: Required[str] - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - response_id: Required[str] - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA]] + key "content_index": Required[int] + key "delta": Required[str] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA]] + content_index: int + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA] class azure.ai.projects.types.VoiceAgentServerEventResponseAudioDone(TypedDict, total=False): - content_index: Required[int] - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - response_id: Required[str] - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE]] + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE]] + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE] class azure.ai.projects.types.VoiceAgentServerEventResponseAudioTimestampDelta(TypedDict, total=False): - audio_duration_ms: Required[int] - audio_offset_ms: Required[int] - content_index: Required[int] - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - response_id: Required[str] - text: Required[str] - timestamp_type: Required[Literal["word"]] - type: Required[Literal["delta"]] + key "audio_duration_ms": Required[int] + key "audio_offset_ms": Required[int] + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "text": Required[str] + key "timestamp_type": Required[Literal["word"]] + key "type": Required[Literal["delta"]] + audio_duration_ms: int + audio_offset_ms: int + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + text: str + timestamp_type: Literal[word] + type: Literal[delta] class azure.ai.projects.types.VoiceAgentServerEventResponseAudioTimestampDone(TypedDict, total=False): - content_index: Required[int] - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - response_id: Required[str] - type: Required[Literal["done"]] + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal["done"]] + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[done] class azure.ai.projects.types.VoiceAgentServerEventResponseAudioTranscriptDelta(TypedDict, total=False): - content_index: Required[int] - delta: Required[str] - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - response_id: Required[str] - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA]] + key "content_index": Required[int] + key "delta": Required[str] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA]] + content_index: int + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA] class azure.ai.projects.types.VoiceAgentServerEventResponseAudioTranscriptDone(TypedDict, total=False): - content_index: Required[int] - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - response_id: Required[str] - transcript: Required[str] - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE]] + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "transcript": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE]] + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + transcript: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE] class azure.ai.projects.types.VoiceAgentServerEventResponseContentPartDone(TypedDict, total=False): - content_index: Required[int] - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - part: Required[VoiceAgentResponseEventContentPart] - response_id: Required[str] - type: Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE]] + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "part": Required[VoiceAgentResponseEventContentPart] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE]] + content_index: int + event_id: str + item_id: str + output_index: int + part: VoiceAgentResponseEventContentPart + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE] class azure.ai.projects.types.VoiceAgentServerEventResponseCreated(TypedDict, total=False): - event_id: Required[str] - response: Required[VoiceAgentRealtimeResponse] - type: Required[Literal[RealtimeServerEventType.RESPONSE_CREATED]] + key "event_id": Required[str] + key "response": Required[VoiceAgentRealtimeResponse] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CREATED]] + event_id: str + response: VoiceAgentRealtimeResponse + type: Literal[RealtimeServerEventType.RESPONSE_CREATED] class azure.ai.projects.types.VoiceAgentServerEventResponseDone(TypedDict, total=False): - event_id: Required[str] - response: Required[VoiceAgentRealtimeResponse] - type: Required[Literal[RealtimeServerEventType.RESPONSE_DONE]] + key "event_id": Required[str] + key "response": Required[VoiceAgentRealtimeResponse] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_DONE]] + event_id: str + response: VoiceAgentRealtimeResponse + type: Literal[RealtimeServerEventType.RESPONSE_DONE] class azure.ai.projects.types.VoiceAgentServerEventResponseFunctionCallArgumentsDelta(TypedDict, total=False): - call_id: Required[str] - delta: Required[str] - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - response_id: Required[str] - type: Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA]] + key "call_id": Required[str] + key "delta": Required[str] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA]] + call_id: str + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA] class azure.ai.projects.types.VoiceAgentServerEventResponseFunctionCallArgumentsDone(TypedDict, total=False): - arguments: Required[str] - call_id: Required[str] - event_id: Required[str] - item_id: Required[str] - name: Required[str] - output_index: Required[int] - response_id: Required[str] - type: Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE]] + key "arguments": Required[str] + key "call_id": Required[str] + key "event_id": Required[str] + key "item_id": Required[str] + key "name": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE]] + arguments: str + call_id: str + event_id: str + item_id: str + name: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE] class azure.ai.projects.types.VoiceAgentServerEventResponseMcpCallArgumentsDelta(TypedDict, total=False): + key "delta": Required[str] + key "event_id": Required[str] + key "item_id": Required[str] key "obfuscation": Optional[str] - delta: Required[str] - event_id: Required[str] - item_id: Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA]] + delta: str + event_id: str + item_id: str obfuscation: str - output_index: Required[int] - response_id: Required[str] - type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA]] + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA] class azure.ai.projects.types.VoiceAgentServerEventResponseMcpCallArgumentsDone(TypedDict, total=False): - arguments: Required[str] - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - response_id: Required[str] - type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE]] + key "arguments": Required[str] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE]] + arguments: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE] class azure.ai.projects.types.VoiceAgentServerEventResponseMcpCallCompleted(TypedDict, total=False): - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED]] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED]] + event_id: str + item_id: str + output_index: int + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED] class azure.ai.projects.types.VoiceAgentServerEventResponseMcpCallFailed(TypedDict, total=False): - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED]] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED]] + event_id: str + item_id: str + output_index: int + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED] class azure.ai.projects.types.VoiceAgentServerEventResponseMcpCallInProgress(TypedDict, total=False): - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS]] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS]] + event_id: str + item_id: str + output_index: int + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS] class azure.ai.projects.types.VoiceAgentServerEventResponseOutputItemAdded(TypedDict, total=False): - event_id: Required[str] - item: Required[VoiceAgentResponseItem] - output_index: Required[int] - response_id: Required[str] - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED]] + key "event_id": Required[str] + key "item": Required[VoiceAgentResponseItem] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED]] + event_id: str + item: VoiceAgentResponseItem + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED] class azure.ai.projects.types.VoiceAgentServerEventResponseOutputItemDone(TypedDict, total=False): - event_id: Required[str] - item: Required[VoiceAgentResponseItem] - output_index: Required[int] - response_id: Required[str] - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE]] + key "event_id": Required[str] + key "item": Required[VoiceAgentResponseItem] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE]] + event_id: str + item: VoiceAgentResponseItem + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE] class azure.ai.projects.types.VoiceAgentServerEventResponseTextDelta(TypedDict, total=False): - content_index: Required[int] - delta: Required[str] - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - response_id: Required[str] - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA]] + key "content_index": Required[int] + key "delta": Required[str] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA]] + content_index: int + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA] class azure.ai.projects.types.VoiceAgentServerEventResponseTextDone(TypedDict, total=False): - content_index: Required[int] - event_id: Required[str] - item_id: Required[str] - output_index: Required[int] - response_id: Required[str] - text: Required[str] - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE]] + key "content_index": Required[int] + key "event_id": Required[str] + key "item_id": Required[str] + key "output_index": Required[int] + key "response_id": Required[str] + key "text": Required[str] + key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE]] + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + text: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE] class azure.ai.projects.types.VoiceAgentServerEventResponseVideoDelta(TypedDict, total=False): - codec: Required[str] - delta: Required[str] - event_id: Required[str] - output_index: Required[int] - type: Required[Literal["delta"]] + key "codec": Required[str] + key "delta": Required[str] + key "event_id": Required[str] + key "output_index": Required[int] + key "type": Required[Literal["delta"]] + codec: str + delta: str + event_id: str + output_index: int + type: Literal[delta] class azure.ai.projects.types.VoiceAgentServerEventSessionAvatarConnecting(TypedDict, total=False): - event_id: Required[str] - server_sdp: Required[str] - type: Required[Literal["connecting"]] + key "event_id": Required[str] + key "server_sdp": Required[str] + key "type": Required[Literal["connecting"]] + event_id: str + server_sdp: str + type: Literal[connecting] class azure.ai.projects.types.VoiceAgentServerEventSessionAvatarSwitchToIdle(TypedDict, total=False): + key "event_id": Required[str] key "turn_id": str - event_id: Required[str] + key "type": Required[Literal["switch_to_idle"]] + event_id: str turn_id: str - type: Required[Literal["switch_to_idle"]] + type: Literal[switch_to_idle] class azure.ai.projects.types.VoiceAgentServerEventSessionAvatarSwitchToSpeaking(TypedDict, total=False): + key "event_id": Required[str] key "turn_id": str - event_id: Required[str] + key "type": Required[Literal["switch_to_speaking"]] + event_id: str turn_id: str - type: Required[Literal["switch_to_speaking"]] + type: Literal[switch_to_speaking] class azure.ai.projects.types.VoiceAgentServerEventSessionCreated(TypedDict, total=False): - event_id: Required[str] - session: Required[VoiceAgentSessionResponseConfig] - type: Required[Literal[RealtimeServerEventType.SESSION_CREATED]] + key "event_id": Required[str] + key "session": Required[VoiceAgentSessionResponseConfig] + key "type": Required[Literal[RealtimeServerEventType.SESSION_CREATED]] + event_id: str + session: VoiceAgentSessionResponseConfig + type: Literal[RealtimeServerEventType.SESSION_CREATED] class azure.ai.projects.types.VoiceAgentServerEventSessionUpdated(TypedDict, total=False): - event_id: Required[str] - session: Required[VoiceAgentSessionResponseConfig] - type: Required[Literal[RealtimeServerEventType.SESSION_UPDATED]] + key "event_id": Required[str] + key "session": Required[VoiceAgentSessionResponseConfig] + key "type": Required[Literal[RealtimeServerEventType.SESSION_UPDATED]] + event_id: str + session: VoiceAgentSessionResponseConfig + type: Literal[RealtimeServerEventType.SESSION_UPDATED] class azure.ai.projects.types.VoiceAgentServerEventWarning(TypedDict, total=False): - event_id: Required[str] - type: Required[Literal["warning"]] - warning: Required[VoiceAgentServerEventWarningDetails] + key "event_id": Required[str] + key "type": Required[Literal["warning"]] + key "warning": Required[VoiceAgentServerEventWarningDetails] + event_id: str + type: Literal[warning] + warning: VoiceAgentServerEventWarningDetails class azure.ai.projects.types.VoiceAgentServerEventWarningDetails(TypedDict, total=False): key "code": str + key "message": Required[str] key "param": str code: str - message: Required[str] + message: str param: str class azure.ai.projects.types.VoiceAgentSessionAvatarConfig(VoiceAvatarConfig): + key "character": Required[str] key "customized": bool key "ice_servers": Optional[list[VoiceAgentAvatarIceServer]] key "model": str key "output_audit_audio": bool key "output_protocol": Union[str, VoiceAvatarOutputProtocol] - key "scene": ForwardRef('VoiceAgentAvatarScene') + key "scene": ForwardRef('VoiceAgentAvatarScene', module='types') key "style": str - key "video": ForwardRef('VoiceAgentAvatarVideoParams') - character: Required[str] + key "type": Required[Union[str, VoiceAvatarType]] + key "video": ForwardRef('VoiceAgentAvatarVideoParams', module='types') + character: str customized: bool ice_servers: list[VoiceAgentAvatarIceServer] model: str @@ -20187,65 +20953,62 @@ namespace azure.ai.projects.types output_protocol: Union[str, VoiceAvatarOutputProtocol] scene: VoiceAgentAvatarScene style: str - type: Required[Union[str, VoiceAvatarType]] + type: Union[str, VoiceAvatarType] video: VoiceAgentAvatarVideoParams class azure.ai.projects.types.VoiceAgentSessionResponseConfig(TypedDict, total=False): - key "animation": ForwardRef('VoiceAgentAnimationConfig') - key "audio": ForwardRef('VoiceAudioConfig') - key "avatar": ForwardRef('VoiceAgentSessionAvatarConfig') + key "animation": ForwardRef('VoiceAgentAnimationConfig', module='types') + key "audio": ForwardRef('VoiceAudioConfig', module='types') + key "avatar": ForwardRef('VoiceAgentSessionAvatarConfig', module='types') key "expires_at": Optional[int] - key "greeting": ForwardRef('VoiceGreetingConfig') - key "include": list[Union[str, VoiceAgentSessionIncludeOption]] + key "greeting": ForwardRef('VoiceGreetingConfig', module='types') + key "id": Required[str] key "instructions": str - key "interim_response": ForwardRef('VoiceAgentInterimResponse') - key "max_output_tokens": ForwardRef('VoiceAgentMaxOutputTokens') - key "metadata": dict[str, str] - key "output_modalities": list[Union[str, VoiceOutputModality]] + key "interim_response": ForwardRef('VoiceAgentInterimResponse', module='types') + key "max_output_tokens": ForwardRef('VoiceAgentMaxOutputTokens', module='types') + key "model": Required[str] + key "object": Required[Literal["session"]] key "parallel_tool_calls": bool - key "reasoning": ForwardRef('RealtimeReasoning') + key "reasoning": ForwardRef('RealtimeReasoning', module='types') key "temperature": float - key "tool_choice": ForwardRef('VoiceAgentToolChoice') - key "tools": list[VoiceAgentTool] + key "tool_choice": ForwardRef('VoiceAgentToolChoice', module='types') + key "type": Required[Literal["realtime"]] animation: VoiceAgentAnimationConfig audio: VoiceAudioConfig avatar: VoiceAgentSessionAvatarConfig expires_at: int greeting: VoiceGreetingConfig - id: Required[str] + id: str include: list[Union[str, VoiceAgentSessionIncludeOption]] instructions: str interim_response: VoiceAgentInterimResponse max_output_tokens: VoiceAgentMaxOutputTokens metadata: dict[str, str] - model: Required[str] - object: Required[Literal["session"]] + model: str + object: Literal[session] output_modalities: list[Union[str, VoiceOutputModality]] parallel_tool_calls: bool reasoning: RealtimeReasoning temperature: float tool_choice: VoiceAgentToolChoice tools: list[VoiceAgentTool] - type: Required[Literal["realtime"]] + type: Literal[realtime] class azure.ai.projects.types.VoiceAgentSessionUpdateConfig(TypedDict, total=False): - key "animation": ForwardRef('VoiceAgentAnimationConfig') - key "audio": ForwardRef('VoiceAudioConfig') - key "avatar": ForwardRef('VoiceAgentSessionAvatarConfig') - key "greeting": ForwardRef('VoiceGreetingConfig') - key "include": list[Union[str, VoiceAgentSessionIncludeOption]] + key "animation": ForwardRef('VoiceAgentAnimationConfig', module='types') + key "audio": ForwardRef('VoiceAudioConfig', module='types') + key "avatar": ForwardRef('VoiceAgentSessionAvatarConfig', module='types') + key "greeting": ForwardRef('VoiceGreetingConfig', module='types') key "instructions": str - key "interim_response": ForwardRef('VoiceAgentInterimResponse') - key "max_output_tokens": ForwardRef('VoiceAgentMaxOutputTokens') - key "metadata": dict[str, str] - key "output_modalities": list[Union[str, VoiceOutputModality]] + key "interim_response": ForwardRef('VoiceAgentInterimResponse', module='types') + key "max_output_tokens": ForwardRef('VoiceAgentMaxOutputTokens', module='types') key "parallel_tool_calls": bool - key "reasoning": ForwardRef('RealtimeReasoning') + key "reasoning": ForwardRef('RealtimeReasoning', module='types') key "temperature": float - key "tool_choice": ForwardRef('VoiceAgentToolChoice') - key "tools": list[VoiceAgentTool] + key "tool_choice": ForwardRef('VoiceAgentToolChoice', module='types') + key "type": Required[Literal["realtime"]] animation: VoiceAgentAnimationConfig audio: VoiceAudioConfig avatar: VoiceAgentSessionAvatarConfig @@ -20261,69 +21024,78 @@ namespace azure.ai.projects.types temperature: float tool_choice: VoiceAgentToolChoice tools: list[VoiceAgentTool] - type: Required[Literal["realtime"]] + type: Literal[realtime] class azure.ai.projects.types.VoiceAgentStaticInterimResponseConfig(TypedDict, total=False): key "latency_threshold_ms": int - key "texts": list[str] - key "triggers": list[Union[str, VoiceAgentInterimResponseTrigger]] + key "type": Required[Literal["static_interim_response"]] latency_threshold_ms: int texts: list[str] triggers: list[Union[str, VoiceAgentInterimResponseTrigger]] - type: Required[Literal["static_interim_response"]] + type: Literal[static_interim_response] class azure.ai.projects.types.VoiceAgentTranscriptionPhrase(TypedDict, total=False): key "confidence": Optional[float] + key "duration_milliseconds": Required[int] key "locale": Optional[str] + key "offset_milliseconds": Required[int] + key "text": Required[str] key "words": Optional[list[VoiceAgentTranscriptionWord]] confidence: float - duration_milliseconds: Required[int] + duration_milliseconds: int locale: str - offset_milliseconds: Required[int] - text: Required[str] + offset_milliseconds: int + text: str words: list[VoiceAgentTranscriptionWord] class azure.ai.projects.types.VoiceAgentTranscriptionWord(TypedDict, total=False): - duration_milliseconds: Required[int] - offset_milliseconds: Required[int] - text: Required[str] + key "duration_milliseconds": Required[int] + key "offset_milliseconds": Required[int] + key "text": Required[str] + duration_milliseconds: int + offset_milliseconds: int + text: str class azure.ai.projects.types.VoiceAssistantMessageItem(TypedDict, total=False): + key "content": Required[list[RealtimeConversationItemMessageAssistantContent]] key "created_at": int key "id": str key "object": Literal["item"] key "response_id": str + key "role": Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] key "status": Literal["completed", "incomplete", "in_progress"] - content: Required[list[RealtimeConversationItemMessageAssistantContent]] + key "type": Required[Literal[VoiceConversationItemType.MESSAGE]] + content: list[RealtimeConversationItemMessageAssistantContent] created_at: int id: str object: Literal[item] response_id: str - role: Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] + role: Literal[RealtimeConversationItemMessageType.ASSISTANT] status: Literal[completed, incomplete, in_progress] - type: Required[Literal[VoiceConversationItemType.MESSAGE]] + type: Literal[VoiceConversationItemType.MESSAGE] class azure.ai.projects.types.VoiceAudioConfig(TypedDict, total=False): - key "input": ForwardRef('VoiceAudioInputConfig') - key "output": ForwardRef('VoiceAudioOutputConfig') + key "input": ForwardRef('VoiceAudioInputConfig', module='types') + key "output": ForwardRef('VoiceAudioOutputConfig', module='types') input: VoiceAudioInputConfig output: VoiceAudioOutputConfig class azure.ai.projects.types.VoiceAudioFormat(TypedDict, total=False): key "rate": int + key "type": Required[Union[str, VoiceAudioFormatType]] rate: int - type: Required[Union[str, VoiceAudioFormatType]] + type: Union[str, VoiceAudioFormatType] class azure.ai.projects.types.VoiceAudioInputConfig(TypedDict, total=False): key "echo_cancellation": Optional[VoiceAgentEchoCancellation] - key "format": ForwardRef('VoiceAudioFormat') + key "format": ForwardRef('VoiceAudioFormat', module='types') key "noise_reduction": Optional[VoiceNoiseReduction] key "transcription": Optional[VoiceInputTranscription] key "turn_detection": Optional[VoiceAgentTurnDetection] @@ -20338,11 +21110,9 @@ namespace azure.ai.projects.types key "custom_lexicon_url": str key "custom_text_normalization_url": str key "custom_voice_endpoint_id": str - key "format": ForwardRef('VoiceAudioFormat') - key "output_audio_timestamp_types": list[Union[str, VoiceAudioTimestampType]] + key "format": ForwardRef('VoiceAudioFormat', module='types') key "personal_voice_model": str key "pitch": str - key "prefer_locales": list[str] key "speed": float key "style": str key "voice": str @@ -20368,21 +21138,23 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceAvatarConfig(TypedDict, total=False): + key "character": Required[str] key "customized": bool key "model": str key "output_audit_audio": bool key "output_protocol": Union[str, VoiceAvatarOutputProtocol] - key "scene": ForwardRef('VoiceAgentAvatarScene') + key "scene": ForwardRef('VoiceAgentAvatarScene', module='types') key "style": str - key "video": ForwardRef('VoiceAgentAvatarVideoParams') - character: Required[str] + key "type": Required[Union[str, VoiceAvatarType]] + key "video": ForwardRef('VoiceAgentAvatarVideoParams', module='types') + character: str customized: bool model: str output_audit_audio: bool output_protocol: Union[str, VoiceAvatarOutputProtocol] scene: VoiceAgentAvatarScene style: str - type: Required[Union[str, VoiceAvatarType]] + type: Union[str, VoiceAvatarType] video: VoiceAgentAvatarVideoParams @@ -20397,6 +21169,7 @@ namespace azure.ai.projects.types key "silence_duration_ms": str key "speech_duration_ms": str key "threshold": float + key "type": Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN]] auto_truncate: bool create_response: bool end_of_utterance_detection: VoiceEndOfUtteranceDetection @@ -20407,7 +21180,7 @@ namespace azure.ai.projects.types silence_duration_ms: str speech_duration_ms: str threshold: float - type: Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN]] + type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN] class azure.ai.projects.types.VoiceAzureSemanticVadMultilingualTurnDetection(TypedDict, total=False): @@ -20416,12 +21189,12 @@ namespace azure.ai.projects.types key "end_of_utterance_detection": Optional[VoiceEndOfUtteranceDetection] key "idle_timeout_ms": str key "interrupt_response": bool - key "languages": list[str] key "prefix_padding_ms": str key "remove_filler_words": bool key "silence_duration_ms": str key "speech_duration_ms": str key "threshold": float + key "type": Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL]] auto_truncate: bool create_response: bool end_of_utterance_detection: VoiceEndOfUtteranceDetection @@ -20433,7 +21206,7 @@ namespace azure.ai.projects.types silence_duration_ms: str speech_duration_ms: str threshold: float - type: Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL]] + type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] class azure.ai.projects.types.VoiceAzureSemanticVadTurnDetection(TypedDict, total=False): @@ -20442,12 +21215,12 @@ namespace azure.ai.projects.types key "end_of_utterance_detection": Optional[VoiceEndOfUtteranceDetection] key "idle_timeout_ms": str key "interrupt_response": bool - key "languages": list[str] key "prefix_padding_ms": str key "remove_filler_words": bool key "silence_duration_ms": str key "speech_duration_ms": str key "threshold": float + key "type": Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD]] auto_truncate: bool create_response: bool end_of_utterance_detection: VoiceEndOfUtteranceDetection @@ -20459,7 +21232,7 @@ namespace azure.ai.projects.types silence_duration_ms: str speech_duration_ms: str threshold: float - type: Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD]] + type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD] class azure.ai.projects.types.VoiceConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -20473,129 +21246,153 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceEndOfUtteranceDetection(TypedDict, total=False): + key "model": Required[Union[str, VoiceEndOfUtteranceDetectionModel]] key "threshold_level": Union[str, VoiceEndOfUtteranceThresholdLevel] key "timeout_ms": str - model: Required[Union[str, VoiceEndOfUtteranceDetectionModel]] + model: Union[str, VoiceEndOfUtteranceDetectionModel] threshold_level: Union[str, VoiceEndOfUtteranceThresholdLevel] timeout_ms: str class azure.ai.projects.types.VoiceFunctionCallItem(TypedDict, total=False): + key "arguments": Required[str] key "call_id": str key "created_at": int key "id": str + key "name": Required[str] key "object": Literal["item"] key "response_id": str key "status": Literal["completed", "incomplete", "in_progress"] - arguments: Required[str] + key "type": Required[Literal[VoiceConversationItemType.FUNCTION_CALL]] + arguments: str call_id: str created_at: int id: str - name: Required[str] + name: str object: Literal[item] response_id: str status: Literal[completed, incomplete, in_progress] - type: Required[Literal[VoiceConversationItemType.FUNCTION_CALL]] + type: Literal[VoiceConversationItemType.FUNCTION_CALL] class azure.ai.projects.types.VoiceFunctionCallOutputItem(TypedDict, total=False): + key "call_id": Required[str] key "created_at": int key "id": str key "name": str key "object": Literal["item"] + key "output": Required[str] key "response_id": str key "status": Literal["completed", "incomplete", "in_progress"] - call_id: Required[str] + key "type": Required[Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT]] + call_id: str created_at: int id: str name: str object: Literal[item] - output: Required[str] + output: str response_id: str status: Literal[completed, incomplete, in_progress] - type: Required[Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT]] + type: Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT] class azure.ai.projects.types.VoiceInputTranscription(TypedDict, total=False): - key "custom_speech": dict[str, str] key "delay": Literal["minimal", "low", "medium", "high", "xhigh"] key "language": str - key "phrase_list": list[str] + key "model": Required[Union[str, VoiceInputTranscriptionModel]] key "prompt": str custom_speech: dict[str, str] delay: Literal[minimal, low, medium, high, xhigh] language: str - model: Required[Union[str, VoiceInputTranscriptionModel]] + model: Union[str, VoiceInputTranscriptionModel] phrase_list: list[str] prompt: str class azure.ai.projects.types.VoiceMcpApprovalRequestItem(TypedDict, total=False): + key "arguments": Required[str] key "created_at": int + key "id": Required[str] + key "name": Required[str] key "response_id": str - arguments: Required[str] + key "server_label": Required[str] + key "type": Required[Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST]] + arguments: str created_at: int - id: Required[str] - name: Required[str] + id: str + name: str response_id: str - server_label: Required[str] - type: Required[Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST]] + server_label: str + type: Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST] class azure.ai.projects.types.VoiceMcpApprovalResponseItem(TypedDict, total=False): + key "approval_request_id": Required[str] + key "approve": Required[bool] key "created_at": int + key "id": Required[str] key "reason": Optional[str] key "response_id": str - approval_request_id: Required[str] - approve: Required[bool] + key "type": Required[Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE]] + approval_request_id: str + approve: bool created_at: int - id: Required[str] + id: str reason: str response_id: str - type: Required[Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE]] + type: Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE] class azure.ai.projects.types.VoiceMcpCallItem(TypedDict, total=False): key "approval_request_id": Optional[str] + key "arguments": Required[str] key "created_at": int - key "error": ForwardRef('RealtimeMCPError') + key "error": ForwardRef('RealtimeMCPError', module='types') + key "id": Required[str] + key "name": Required[str] key "output": Optional[str] key "response_id": str + key "server_label": Required[str] + key "type": Required[Literal[VoiceConversationItemType.MCP_CALL]] approval_request_id: str - arguments: Required[str] + arguments: str created_at: int error: RealtimeMCPError - id: Required[str] - name: Required[str] + id: str + name: str output: str response_id: str - server_label: Required[str] - type: Required[Literal[VoiceConversationItemType.MCP_CALL]] + server_label: str + type: Literal[VoiceConversationItemType.MCP_CALL] class azure.ai.projects.types.VoiceMcpListToolsItem(TypedDict, total=False): key "created_at": int key "id": str key "response_id": str + key "server_label": Required[str] + key "tools": Required[list[MCPListToolsTool]] + key "type": Required[Literal[VoiceConversationItemType.MCP_LIST_TOOLS]] created_at: int id: str response_id: str - server_label: Required[str] - tools: Required[list[MCPListToolsTool]] - type: Required[Literal[VoiceConversationItemType.MCP_LIST_TOOLS]] + server_label: str + tools: list[MCPListToolsTool] + type: Literal[VoiceConversationItemType.MCP_LIST_TOOLS] class azure.ai.projects.types.VoiceNoiseReduction(TypedDict, total=False): - type: Required[Union[str, VoiceNoiseReductionType]] + key "type": Required[Union[str, VoiceNoiseReductionType]] + type: Union[str, VoiceNoiseReductionType] class azure.ai.projects.types.VoiceResponseAudio(TypedDict, total=False): - key "output": ForwardRef('VoiceResponseAudioOutput') + key "output": ForwardRef('VoiceResponseAudioOutput', module='types') output: VoiceResponseAudioOutput class azure.ai.projects.types.VoiceResponseAudioOutput(TypedDict, total=False): - key "format": ForwardRef('RealtimeAudioFormats') + key "format": ForwardRef('RealtimeAudioFormats', module='types') key "voice": str key "voice_locale": str key "voice_type": str @@ -20615,6 +21412,7 @@ namespace azure.ai.projects.types key "silence_duration_ms": int key "speech_duration_ms": int key "threshold": float + key "type": Required[Literal[VoiceTurnDetectionType.SERVER_VAD]] auto_truncate: bool create_response: bool end_of_utterance_detection: VoiceEndOfUtteranceDetection @@ -20624,38 +21422,46 @@ namespace azure.ai.projects.types silence_duration_ms: int speech_duration_ms: int threshold: float - type: Required[Literal[VoiceTurnDetectionType.SERVER_VAD]] + type: Literal[VoiceTurnDetectionType.SERVER_VAD] class azure.ai.projects.types.VoiceSystemMessageItem(TypedDict, total=False): + key "content": Required[list[RealtimeConversationItemMessageSystemContent]] key "created_at": int key "id": str key "object": Literal["item"] key "response_id": str + key "role": Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] key "status": Literal["completed", "incomplete", "in_progress"] - content: Required[list[RealtimeConversationItemMessageSystemContent]] + key "type": Required[Literal[VoiceConversationItemType.MESSAGE]] + content: list[RealtimeConversationItemMessageSystemContent] created_at: int id: str object: Literal[item] response_id: str - role: Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] + role: Literal[RealtimeConversationItemMessageType.SYSTEM] status: Literal[completed, incomplete, in_progress] - type: Required[Literal[VoiceConversationItemType.MESSAGE]] + type: Literal[VoiceConversationItemType.MESSAGE] class azure.ai.projects.types.VoiceSystemTool(TypedDict, total=False): key "description": str + key "name": Required[Union[str, VoiceSystemToolName]] + key "type": Required[Literal["system"]] description: str - name: Required[Union[str, VoiceSystemToolName]] - type: Required[Literal["system"]] + name: Union[str, VoiceSystemToolName] + type: Literal[system] class azure.ai.projects.types.VoiceToolboxTool(TypedDict, total=False): key "response_scheduling": Union[str, VoiceAgentToolResponseScheduling] + key "toolbox_name": Required[str] + key "toolbox_version": Required[str] + key "type": Required[Literal["toolbox"]] response_scheduling: Union[str, VoiceAgentToolResponseScheduling] - toolbox_name: Required[str] - toolbox_version: Required[str] - type: Required[Literal["toolbox"]] + toolbox_name: str + toolbox_version: str + type: Literal[toolbox] class azure.ai.projects.types.VoiceTurnDetectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -20667,19 +21473,22 @@ namespace azure.ai.projects.types class azure.ai.projects.types.VoiceUserMessageItem(TypedDict, total=False): + key "content": Required[list[RealtimeConversationItemMessageUserContent]] key "created_at": int key "id": str key "object": Literal["item"] key "response_id": str + key "role": Required[Literal[RealtimeConversationItemMessageType.USER]] key "status": Literal["completed", "incomplete", "in_progress"] - content: Required[list[RealtimeConversationItemMessageUserContent]] + key "type": Required[Literal[VoiceConversationItemType.MESSAGE]] + content: list[RealtimeConversationItemMessageUserContent] created_at: int id: str object: Literal[item] response_id: str - role: Required[Literal[RealtimeConversationItemMessageType.USER]] + role: Literal[RealtimeConversationItemMessageType.USER] status: Literal[completed, incomplete, in_progress] - type: Required[Literal[VoiceConversationItemType.MESSAGE]] + type: Literal[VoiceConversationItemType.MESSAGE] class azure.ai.projects.types.WebSearchApproximateLocation(TypedDict, total=False): @@ -20687,35 +21496,38 @@ namespace azure.ai.projects.types key "country": Optional[str] key "region": Optional[str] key "timezone": Optional[str] + key "type": Required[Literal["approximate"]] city: str country: str region: str timezone: str - type: Required[Literal["approximate"]] + type: Literal[approximate] class azure.ai.projects.types.WebSearchConfiguration(TypedDict, total=False): - instance_name: Required[str] - project_connection_id: Required[str] + key "instance_name": Required[str] + key "project_connection_id": Required[str] + instance_name: str + project_connection_id: str class azure.ai.projects.types.WebSearchPreviewTool(TypedDict, total=False): - key "search_content_types": list[Union[str, SearchContentType]] key "search_context_size": Union[str, SearchContextSize] + key "type": Required[Literal[ToolType.WEB_SEARCH_PREVIEW]] key "user_location": Optional[ApproximateLocation] search_content_types: list[Union[str, SearchContentType]] search_context_size: Union[str, SearchContextSize] - type: Required[Literal[ToolType.WEB_SEARCH_PREVIEW]] + type: Literal[ToolType.WEB_SEARCH_PREVIEW] user_location: ApproximateLocation class azure.ai.projects.types.WebSearchTool(TypedDict, total=False): - key "custom_search_configuration": ForwardRef('WebSearchConfiguration') + key "custom_search_configuration": ForwardRef('WebSearchConfiguration', module='types') key "description": str key "filters": Optional[WebSearchToolFilters] key "name": str key "search_context_size": Literal["low", "medium", "high"] - key "tool_configs": dict[str, ToolConfig] + key "type": Required[Literal[ToolType.WEB_SEARCH]] key "user_location": Optional[WebSearchApproximateLocation] custom_search_configuration: WebSearchConfiguration description: str @@ -20723,7 +21535,7 @@ namespace azure.ai.projects.types name: str search_context_size: Literal[low, medium, high] tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolType.WEB_SEARCH]] + type: Literal[ToolType.WEB_SEARCH] user_location: WebSearchApproximateLocation @@ -20733,12 +21545,12 @@ namespace azure.ai.projects.types class azure.ai.projects.types.WebSearchToolboxTool(TypedDict, total=False): - key "custom_search_configuration": ForwardRef('WebSearchConfiguration') + key "custom_search_configuration": ForwardRef('WebSearchConfiguration', module='types') key "description": str key "filters": Optional[WebSearchToolFilters] key "name": str key "search_context_size": Literal["low", "medium", "high"] - key "tool_configs": dict[str, ToolConfig] + key "type": Required[Literal[ToolboxToolType.WEB_SEARCH]] key "user_location": Optional[WebSearchApproximateLocation] custom_search_configuration: WebSearchConfiguration description: str @@ -20746,35 +21558,41 @@ namespace azure.ai.projects.types name: str search_context_size: Literal[low, medium, high] tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolboxToolType.WEB_SEARCH]] + type: Literal[ToolboxToolType.WEB_SEARCH] user_location: WebSearchApproximateLocation class azure.ai.projects.types.WeeklyRecurrenceSchedule(TypedDict, total=False): - daysOfWeek: Required[list[Union[str, DayOfWeek]]] - type: Required[Literal[RecurrenceType.WEEKLY]] + key "daysOfWeek": Required[list[Union[str, DayOfWeek]]] + key "type": Required[Literal[RecurrenceType.WEEKLY]] + daysOfWeek: list[Union[str, DayOfWeek]] + type: Literal[RecurrenceType.WEEKLY] class azure.ai.projects.types.WorkIQPreviewTool(TypedDict, total=False): - project_connection_id: Required[str] - type: Required[Literal[ToolType.WORK_IQ_PREVIEW]] + key "project_connection_id": Required[str] + key "type": Required[Literal[ToolType.WORK_IQ_PREVIEW]] + project_connection_id: str + type: Literal[ToolType.WORK_IQ_PREVIEW] class azure.ai.projects.types.WorkIQPreviewToolboxTool(TypedDict, total=False): key "description": str key "name": str - key "tool_configs": dict[str, ToolConfig] + key "project_connection_id": Required[str] + key "type": Required[Literal[ToolboxToolType.WORK_IQ_PREVIEW]] description: str name: str - project_connection_id: Required[str] + project_connection_id: str tool_configs: dict[str, ToolConfig] - type: Required[Literal[ToolboxToolType.WORK_IQ_PREVIEW]] + type: Literal[ToolboxToolType.WORK_IQ_PREVIEW] class azure.ai.projects.types.WorkflowAgentDefinition(TypedDict, total=False): - key "rai_config": ForwardRef('RaiConfig') + key "kind": Required[Literal[AgentKind.WORKFLOW]] + key "rai_config": ForwardRef('RaiConfig', module='types') key "workflow": str - kind: Required[Literal[AgentKind.WORKFLOW]] + kind: Literal[AgentKind.WORKFLOW] rai_config: RaiConfig workflow: str diff --git a/sdk/ai/azure-ai-projects/api.metadata.yml b/sdk/ai/azure-ai-projects/api.metadata.yml index 2a2d54107636..6dc88a5476de 100644 --- a/sdk/ai/azure-ai-projects/api.metadata.yml +++ b/sdk/ai/azure-ai-projects/api.metadata.yml @@ -1,3 +1,3 @@ -apiMdSha256: 0d888036ea7693ab8273a7ee5fae970ea137982acb6e3646db5dd62a298724fe +apiMdSha256: 9cc6120024eec745ae6bfbc3bf02c2155a34ca4b0af5da10ff8a05d718227c83 parserVersion: 0.3.31 pythonVersion: 3.13.14 From 80859bbcf8d2251871f6b852d6f55ba6c0f971a1 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Wed, 19 Aug 2026 17:10:14 -0700 Subject: [PATCH 33/56] Regenerate voice agent SDK from TypeSpec PR #45357, fix samples and tests - Bump tsp-location.yaml to PR #45357 latest commit (4b80e4d91a9c7940812f8c0e9c07611eb9f5be2e) - Fix _realtime.py/aio/_realtime.py ConversationItem union for RealtimeConversationItem* -> Voice*Item rename - Add Foundry-Features header injection + 403 message enhancement to generate_agent in _patch_agents.py/_patch_agents_async.py, matching create_version - Work around upstream typespec-python codegen bug: merge generate_agent's redundant single-member @overload into one plain method (PostEmitter.ps1 + hand patch) - Update voice agent samples for the generate_agent(name=...) calling-convention change and Voice*Item rename - Redesign the 3 streaming samples (live_text_conversation[_async], live_audio_conversation_async) to be self-contained: generate agent -> converse -> fetch persisted conversation -> delete agent - Rename sample_voice_agent_function_tool.py -> sample_voice_agent_live_function_tool.py (it uses client.realtime.connect) - Use strong enum types instead of hardcoded strings throughout voice agent samples - Update test docstrings noting the generate_agent name-field bug is now fixed upstream --- sdk/ai/azure-ai-projects/PostEmitter.ps1 | 41 + .../azure-ai-projects/apiview-properties.json | 18 +- .../azure/ai/projects/_realtime.py | 24 +- .../azure/ai/projects/_unions.py | 27 +- .../azure/ai/projects/aio/_realtime.py | 24 +- .../ai/projects/aio/operations/_operations.py | 85 +- .../aio/operations/_patch_agents_async.py | 47 +- .../azure/ai/projects/models/__init__.py | 28 +- .../azure/ai/projects/models/_enums.py | 49 +- .../azure/ai/projects/models/_models.py | 1122 ++++------------ .../ai/projects/operations/_operations.py | 85 +- .../ai/projects/operations/_patch_agents.py | 47 +- .../azure/ai/projects/types.py | 1193 +++++++---------- .../agents/voice/sample_voice_agent_basic.py | 11 +- .../voice/sample_voice_agent_basic_async.py | 6 +- .../voice/sample_voice_agent_generate.py | 8 +- ...ice_agent_live_audio_conversation_async.py | 72 +- ... sample_voice_agent_live_function_tool.py} | 19 +- ...mple_voice_agent_live_text_conversation.py | 75 +- ...oice_agent_live_text_conversation_async.py | 75 +- .../voice/sample_voice_agent_versions.py | 4 +- .../voice/sample_voice_agent_with_tools.py | 9 +- .../tests/agents/test_voice_agent_crud.py | 6 +- .../agents/test_voice_agent_crud_async.py | 6 +- sdk/ai/azure-ai-projects/tsp-location.yaml | 2 +- 25 files changed, 1132 insertions(+), 1951 deletions(-) rename sdk/ai/azure-ai-projects/samples/agents/voice/{sample_voice_agent_function_tool.py => sample_voice_agent_live_function_tool.py} (91%) diff --git a/sdk/ai/azure-ai-projects/PostEmitter.ps1 b/sdk/ai/azure-ai-projects/PostEmitter.ps1 index ecfc398a3240..7b6cb43d4fbe 100644 --- a/sdk/ai/azure-ai-projects/PostEmitter.ps1 +++ b/sdk/ai/azure-ai-projects/PostEmitter.ps1 @@ -186,6 +186,47 @@ for ($i = 0; $i -lt $lines.Length; $i++) { } Set-Content $f $lines +# Fix pyright errors on generate_agent caused by a known typespec-python emitter bug: when a +# discriminated union has exactly one member, the emitter emits `GenerateAgentRequest = +# "_models.GenerateVoiceAgentRequest"` in _unions.py (a bare string, not wrapped in Union[...] like +# every other alias in that file), and generates only a single @overload for generate_agent instead +# of 0 or 2+. Confirmed present in both @azure-tools/typespec-python 0.63.4-dev.11 and 0.64.0-dev.6 +# (latest mirrored builds as of 2026-08-19) - a real upstream codegen bug, not fixable here at the +# TypeSpec/source level. Silence the two resulting pyright errors rather than hand-restructure +# generated code. +$files = 'azure\ai\projects\operations\_operations.py', 'azure\ai\projects\aio\operations\_operations.py' +foreach ($f in $files) { + $lines = Get-Content $f + $out = New-Object System.Collections.Generic.List[string] + for ($i = 0; $i -lt $lines.Length; $i++) { + # Drop the redundant lone @overload stub for generate_agent (invalid: pyright/mypy both + # require 0 or 2+ overloads, never exactly 1). This exists because the "use union + # generation request" TypeSpec commit made GenerateAgentRequest a union of exactly one + # member, and the emitter doesn't collapse that back to a plain (non-overloaded) method. + if ($lines[$i] -match '^\s*@overload\s*$' -and $lines[$i + 1] -match '(async )?def generate_agent\(') { + # Skip past the docstring's closing triple-quote (find the second occurrence of a + # lone closing-quote line after the opening one). + $quoteCount = 0 + $j = $i + while ($quoteCount -lt 2) { + if ($lines[$j] -match '"""') { $quoteCount++ } + $j++ + } + # Skip the blank line separating the stub from the concrete implementation. + while ($lines[$j].Trim() -eq '') { $j++ } + $i = $j - 1 + continue + } + $out.Add($lines[$i]) + } + Set-Content $f $out +} +foreach ($f in $files) { + $c = Get-Content $f -Raw + $c = $c -replace '(def generate_agent\(self, body: )"_unions\.GenerateAgentRequest"', '${1}_models.GenerateVoiceAgentRequest' + Set-Content $f $c -NoNewline +} + # Finishing by running 'black' tool to format code. pip install black black --config ../../../eng/black-pyproject.toml . diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index 03e4fc81a39d..1d397fe67e0c 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -190,6 +190,7 @@ "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.GitHubIssueRoutineTrigger": "Azure.AI.Projects.GitHubIssueRoutineTrigger", "azure.ai.projects.models.TelemetryEndpointAuth": "Azure.AI.Projects.TelemetryEndpointAuth", "azure.ai.projects.models.HeaderTelemetryEndpointAuth": "Azure.AI.Projects.HeaderTelemetryEndpointAuth", @@ -292,25 +293,14 @@ "azure.ai.projects.models.RealtimeAudioFormatsAudioPcm": "OpenAI.RealtimeAudioFormatsAudioPcm", "azure.ai.projects.models.RealtimeAudioFormatsAudioPcma": "OpenAI.RealtimeAudioFormatsAudioPcma", "azure.ai.projects.models.RealtimeAudioFormatsAudioPcmu": "OpenAI.RealtimeAudioFormatsAudioPcmu", - "azure.ai.projects.models.RealtimeConversationItem": "OpenAI.RealtimeConversationItem", - "azure.ai.projects.models.RealtimeConversationItemFunctionCall": "OpenAI.RealtimeConversationItemFunctionCall", - "azure.ai.projects.models.RealtimeConversationItemFunctionCallOutput": "OpenAI.RealtimeConversationItemFunctionCallOutput", - "azure.ai.projects.models.RealtimeConversationItemMessage": "OpenAI.RealtimeConversationItemMessage", - "azure.ai.projects.models.RealtimeConversationItemMessageAssistant": "OpenAI.RealtimeConversationItemMessageAssistant", "azure.ai.projects.models.RealtimeConversationItemMessageAssistantContent": "OpenAI.RealtimeConversationItemMessageAssistantContent", - "azure.ai.projects.models.RealtimeConversationItemMessageSystem": "OpenAI.RealtimeConversationItemMessageSystem", "azure.ai.projects.models.RealtimeConversationItemMessageSystemContent": "OpenAI.RealtimeConversationItemMessageSystemContent", - "azure.ai.projects.models.RealtimeConversationItemMessageUser": "OpenAI.RealtimeConversationItemMessageUser", "azure.ai.projects.models.RealtimeConversationItemMessageUserContent": "OpenAI.RealtimeConversationItemMessageUserContent", "azure.ai.projects.models.RealtimeFunctionTool": "OpenAI.RealtimeFunctionTool", "azure.ai.projects.models.RealtimeFunctionToolParameters": "OpenAI.RealtimeFunctionToolParameters", - "azure.ai.projects.models.RealtimeMCPApprovalRequest": "OpenAI.RealtimeMCPApprovalRequest", - "azure.ai.projects.models.RealtimeMCPApprovalResponse": "OpenAI.RealtimeMCPApprovalResponse", "azure.ai.projects.models.RealtimeMCPError": "OpenAI.RealtimeMCPError", "azure.ai.projects.models.RealtimeMCPHTTPError": "OpenAI.RealtimeMCPHTTPError", - "azure.ai.projects.models.RealtimeMCPListTools": "OpenAI.RealtimeMCPListTools", "azure.ai.projects.models.RealtimeMCPProtocolError": "OpenAI.RealtimeMCPProtocolError", - "azure.ai.projects.models.RealtimeMCPToolCall": "OpenAI.RealtimeMCPToolCall", "azure.ai.projects.models.RealtimeMCPToolExecutionError": "OpenAI.RealtimeMCPToolExecutionError", "azure.ai.projects.models.RealtimeReasoning": "OpenAI.RealtimeReasoning", "azure.ai.projects.models.RealtimeResponseStatusDetails": "OpenAI.RealtimeResponseStatusDetails", @@ -613,7 +603,6 @@ "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.ToolChoiceOptions": "OpenAI.ToolChoiceOptions", "azure.ai.projects.models.VoiceAudioFormatType": "Azure.AI.Projects.VoiceAudioFormatType", "azure.ai.projects.models.VoiceNoiseReductionType": "Azure.AI.Projects.VoiceNoiseReductionType", "azure.ai.projects.models.VoiceTurnDetectionType": "Azure.AI.Projects.VoiceTurnDetectionType", @@ -621,6 +610,7 @@ "azure.ai.projects.models.VoiceEndOfUtteranceThresholdLevel": "Azure.AI.Projects.VoiceEndOfUtteranceThresholdLevel", "azure.ai.projects.models.VoiceAgentEchoCancellationReferenceSource": "Azure.AI.Projects.VoiceAgentEchoCancellationReferenceSource", "azure.ai.projects.models.VoiceInputTranscriptionModel": "Azure.AI.Projects.VoiceInputTranscriptionModel", + "azure.ai.projects.models.VoiceType": "Azure.AI.Projects.VoiceType", "azure.ai.projects.models.VoiceAudioTimestampType": "Azure.AI.Projects.VoiceAudioTimestampType", "azure.ai.projects.models.VoiceOutputModality": "Azure.AI.Projects.VoiceOutputModality", "azure.ai.projects.models.VoiceAgentSessionIncludeOption": "Azure.AI.Projects.VoiceAgentSessionIncludeOption", @@ -656,7 +646,7 @@ "azure.ai.projects.models.ToolboxToolType": "Azure.AI.Projects.ToolboxToolType", "azure.ai.projects.models.MemoryStoreUpdateStatus": "Azure.AI.Projects.MemoryStoreUpdateStatus", "azure.ai.projects.models.RealtimeClientEventType": "OpenAI.RealtimeClientEventType", - "azure.ai.projects.models.RealtimeConversationItemType": "OpenAI.RealtimeConversationItemType", + "azure.ai.projects.models.ToolChoiceOptions": "OpenAI.ToolChoiceOptions", "azure.ai.projects.models.RealtimeReasoningEffort": "OpenAI.RealtimeReasoningEffort", "azure.ai.projects.models.VoiceAgentAnimationOutputType": "Azure.AI.Projects.VoiceAgentAnimationOutputType", "azure.ai.projects.models.RealtimeServerEventType": "OpenAI.RealtimeServerEventType", @@ -788,5 +778,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": "9e9ec56d1a91" + "CrossLanguageVersion": "5c47fb4d0cd0" } \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py index 05c5a1573f71..c724f3a7569d 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py @@ -79,12 +79,12 @@ # The conversation item variants accepted by ``conversation.item.create``. ConversationItem = Union[ - _models.RealtimeConversationItemMessageSystem, - _models.RealtimeConversationItemMessageUser, - _models.RealtimeConversationItemMessageAssistant, - _models.RealtimeConversationItemFunctionCall, - _models.RealtimeConversationItemFunctionCallOutput, - _models.RealtimeMCPApprovalResponse, + _models.VoiceSystemMessageItem, + _models.VoiceUserMessageItem, + _models.VoiceAssistantMessageItem, + _models.VoiceFunctionCallItem, + _models.VoiceFunctionCallOutputItem, + _models.VoiceMcpApprovalResponseItem, Mapping[str, Any], ] @@ -380,12 +380,12 @@ def create( """Insert an item into the conversation. :keyword item: The conversation item to create. - :paramtype item: ~azure.ai.projects.models.RealtimeConversationItemMessageSystem or - ~azure.ai.projects.models.RealtimeConversationItemMessageUser or - ~azure.ai.projects.models.RealtimeConversationItemMessageAssistant or - ~azure.ai.projects.models.RealtimeConversationItemFunctionCall or - ~azure.ai.projects.models.RealtimeConversationItemFunctionCallOutput or - ~azure.ai.projects.models.RealtimeMCPApprovalResponse or Mapping[str, Any] + :paramtype item: ~azure.ai.projects.models.VoiceSystemMessageItem or + ~azure.ai.projects.models.VoiceUserMessageItem or + ~azure.ai.projects.models.VoiceAssistantMessageItem or + ~azure.ai.projects.models.VoiceFunctionCallItem or + ~azure.ai.projects.models.VoiceFunctionCallOutputItem or + ~azure.ai.projects.models.VoiceMcpApprovalResponseItem or Mapping[str, Any] :keyword previous_item_id: The ID of the preceding item after which the new item will be inserted. Default value is None. :paramtype previous_item_id: str or None 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 25a892edd3d4..b4afefa8ae51 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_unions.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_unions.py @@ -12,7 +12,9 @@ from . import models as _models Filters = Union["_models.ComparisonFilter", "_models.CompoundFilter"] RoutineRunStatus = str -VoiceAgentToolChoice = Union[str, "_models.ToolChoiceOptions", "_models.ToolChoiceFunction", "_models.ToolChoiceMCP"] +VoiceAgentToolChoice = Union[ + Literal["none"], Literal["auto"], Literal["required"], "_models.ToolChoiceFunction", "_models.ToolChoiceMCP" +] VoiceAgentTurnDetection = Union[ "_models.VoiceServerVadTurnDetection", "_models.VoiceAgentSemanticVadTurnDetection", @@ -24,25 +26,4 @@ VoiceAgentInterimResponse = Union[ "_models.VoiceAgentStaticInterimResponseConfig", "_models.VoiceAgentLlmInterimResponseConfig" ] -VoiceAgentRequestConversationItem = Union[ - "_models.RealtimeConversationItemMessageSystem", - "_models.RealtimeConversationItemMessageUser", - "_models.RealtimeConversationItemMessageAssistant", - "_models.RealtimeConversationItemFunctionCall", - "_models.RealtimeConversationItemFunctionCallOutput", -] -VoiceAgentCreateConversationItem = Union["VoiceAgentRequestConversationItem", "_models.RealtimeMCPApprovalResponse"] -VoiceAgentResponseMessageItem = Union[ - "_models.RealtimeConversationItemMessageSystem", - "_models.RealtimeConversationItemMessageUser", - "_models.RealtimeConversationItemMessageAssistant", -] -VoiceAgentResponseItem = Union[ - "VoiceAgentResponseMessageItem", - "_models.VoiceFunctionCallItem", - "_models.VoiceFunctionCallOutputItem", - "_models.VoiceMcpListToolsItem", - "_models.VoiceMcpCallItem", - "_models.VoiceMcpApprovalRequestItem", - "_models.VoiceMcpApprovalResponseItem", -] +GenerateAgentRequest = "_models.GenerateVoiceAgentRequest" diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py index cc40fc39bae7..c29c36eea144 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py @@ -93,12 +93,12 @@ # The conversation item variants accepted by ``conversation.item.create``. ConversationItem = Union[ - _models.RealtimeConversationItemMessageSystem, - _models.RealtimeConversationItemMessageUser, - _models.RealtimeConversationItemMessageAssistant, - _models.RealtimeConversationItemFunctionCall, - _models.RealtimeConversationItemFunctionCallOutput, - _models.RealtimeMCPApprovalResponse, + _models.VoiceSystemMessageItem, + _models.VoiceUserMessageItem, + _models.VoiceAssistantMessageItem, + _models.VoiceFunctionCallItem, + _models.VoiceFunctionCallOutputItem, + _models.VoiceMcpApprovalResponseItem, Mapping[str, Any], ] @@ -394,12 +394,12 @@ async def create( """Insert an item into the conversation. :keyword item: The conversation item to create. - :paramtype item: ~azure.ai.projects.models.RealtimeConversationItemMessageSystem or - ~azure.ai.projects.models.RealtimeConversationItemMessageUser or - ~azure.ai.projects.models.RealtimeConversationItemMessageAssistant or - ~azure.ai.projects.models.RealtimeConversationItemFunctionCall or - ~azure.ai.projects.models.RealtimeConversationItemFunctionCallOutput or - ~azure.ai.projects.models.RealtimeMCPApprovalResponse or Mapping[str, Any] + :paramtype item: ~azure.ai.projects.models.VoiceSystemMessageItem or + ~azure.ai.projects.models.VoiceUserMessageItem or + ~azure.ai.projects.models.VoiceAssistantMessageItem or + ~azure.ai.projects.models.VoiceFunctionCallItem or + ~azure.ai.projects.models.VoiceFunctionCallOutputItem or + ~azure.ai.projects.models.VoiceMcpApprovalResponseItem or Mapping[str, Any] :keyword previous_item_id: The ID of the preceding item after which the new item will be inserted. Default value is None. :paramtype previous_item_id: str or None 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 5b71fdfdae83..ad1220bef998 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 @@ -9,7 +9,7 @@ from collections.abc import MutableMapping from io import IOBase import json -from typing import Any, AsyncIterator, Callable, IO, Literal, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, IO, Literal, Optional, TYPE_CHECKING, TypeVar, Union, cast, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -186,6 +186,8 @@ ) from .._configuration import AIProjectClientConfiguration +if TYPE_CHECKING: + from ... import _unions JSON = MutableMapping[str, Any] _Unset: Any = object() T = TypeVar("T") @@ -309,78 +311,16 @@ async def get(self, agent_name: str, **kwargs: Any) -> _models.AgentDetails: return deserialized # type: ignore - @overload - async def generate_agent( - self, *, kind: Union[str, _models.AgentKind], content_type: str = "application/json", **kwargs: Any - ) -> _models.AgentDetails: - """Generate an agent. - - Generates and creates an agent from kind-specific high-level inputs. The generated definition - remains fully editable through the standard agent versioning operations. - - :keyword kind: The kind of agent to generate. Known values are: "prompt", "hosted", "workflow", - "external", and "voice". Required. - :paramtype kind: str or ~azure.ai.projects.models.AgentKind - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: AgentDetails. The AgentDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def generate_agent( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.AgentDetails: - """Generate an agent. - - Generates and creates an agent from kind-specific high-level inputs. The generated definition - remains fully editable through the standard agent versioning operations. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: AgentDetails. The AgentDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def generate_agent( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.AgentDetails: - """Generate an agent. - - Generates and creates an agent from kind-specific high-level inputs. The generated definition - remains fully editable through the standard agent versioning operations. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: AgentDetails. The AgentDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace_async - async def generate_agent( - self, body: Union[JSON, IO[bytes]] = _Unset, *, kind: Union[str, _models.AgentKind] = _Unset, **kwargs: Any - ) -> _models.AgentDetails: + async def generate_agent(self, body: _models.GenerateVoiceAgentRequest, **kwargs: Any) -> _models.AgentDetails: """Generate an agent. Generates and creates an agent from kind-specific high-level inputs. The generated definition remains fully editable through the standard agent versioning operations. - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword kind: The kind of agent to generate. Known values are: "prompt", "hosted", "workflow", - "external", and "voice". Required. - :paramtype kind: str or ~azure.ai.projects.models.AgentKind + :param body: The kind-specific inputs for generating and creating an agent. Is one of the + following types: GenerateVoiceAgentRequest Required. + :type body: ~azure.ai.projects.models.GenerateVoiceAgentRequest :return: AgentDetails. The AgentDetails is compatible with MutableMapping :rtype: ~azure.ai.projects.models.AgentDetails :raises ~azure.core.exceptions.HttpResponseError: @@ -399,17 +339,8 @@ async def generate_agent( content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.AgentDetails] = kwargs.pop("cls", None) - if body is _Unset: - if kind is _Unset: - raise TypeError("missing required argument: kind") - body = {"kind": kind} - body = {k: v for k, v in body.items() if v is not None} content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_agents_generate_agent_request( content_type=content_type, diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py index ec67c0b34159..7439196bf2bf 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py @@ -8,7 +8,7 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import Union, Optional, Any, IO, overload +from typing import Union, Optional, Any, IO, overload, TYPE_CHECKING from azure.core.exceptions import HttpResponseError from azure.core.tracing.decorator_async import distributed_trace_async from ._operations import AgentsOperations as GeneratedAgentsOperations, JSON, _Unset @@ -22,6 +22,9 @@ _PREVIEW_FEATURE_ADDED_ERROR_MESSAGE, ) +if TYPE_CHECKING: + from ... import _unions + class AgentsOperations(GeneratedAgentsOperations): """ @@ -314,3 +317,45 @@ async def create_version_from_code( new_exc.model = exc.model raise new_exc from exc raise + + @distributed_trace_async + async def generate_agent(self, body: _models.GenerateVoiceAgentRequest, **kwargs: Any) -> _models.AgentDetails: # type: ignore[override] + """Generate an agent. + + Generates and creates an agent from kind-specific high-level inputs. The generated definition + remains fully editable through the standard agent versioning operations. When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param body: The kind-specific inputs for generating and creating an agent. Required. + :type body: ~azure.ai.projects.models.GenerateVoiceAgentRequest + :return: AgentDetails. The AgentDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + + if getattr(self._config, "allow_preview", False): + # Add Foundry-Features header if not already present + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS + kwargs["headers"] = headers + + try: + return await super().generate_agent(body, **kwargs) # type: ignore[misc] + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise 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 a6251719043e..a2bc1699bd9e 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 @@ -191,6 +191,7 @@ FunctionShellToolParamEnvironmentLocalEnvironmentParam, FunctionTool, FunctionToolParam, + GenerateVoiceAgentRequest, GitHubIssueRoutineTrigger, HeaderTelemetryEndpointAuth, HostedAgentDefinition, @@ -293,25 +294,14 @@ RealtimeAudioFormatsAudioPcm, RealtimeAudioFormatsAudioPcma, RealtimeAudioFormatsAudioPcmu, - RealtimeConversationItem, - RealtimeConversationItemFunctionCall, - RealtimeConversationItemFunctionCallOutput, - RealtimeConversationItemMessage, - RealtimeConversationItemMessageAssistant, RealtimeConversationItemMessageAssistantContent, - RealtimeConversationItemMessageSystem, RealtimeConversationItemMessageSystemContent, - RealtimeConversationItemMessageUser, RealtimeConversationItemMessageUserContent, RealtimeFunctionTool, RealtimeFunctionToolParameters, - RealtimeMCPApprovalRequest, - RealtimeMCPApprovalResponse, RealtimeMCPError, RealtimeMCPHTTPError, - RealtimeMCPListTools, RealtimeMCPProtocolError, - RealtimeMCPToolCall, RealtimeMCPToolExecutionError, RealtimeReasoning, RealtimeResponseStatusDetails, @@ -618,7 +608,6 @@ RealtimeAudioFormatsType, RealtimeClientEventType, RealtimeConversationItemMessageType, - RealtimeConversationItemType, RealtimeMcpErrorType, RealtimeReasoningEffort, RealtimeServerEventType, @@ -678,6 +667,7 @@ VoiceOutputModality, VoiceSystemToolName, VoiceTurnDetectionType, + VoiceType, ) from ._patch import __all__ as _patch_all from ._patch import * @@ -860,6 +850,7 @@ "FunctionShellToolParamEnvironmentLocalEnvironmentParam", "FunctionTool", "FunctionToolParam", + "GenerateVoiceAgentRequest", "GitHubIssueRoutineTrigger", "HeaderTelemetryEndpointAuth", "HostedAgentDefinition", @@ -962,25 +953,14 @@ "RealtimeAudioFormatsAudioPcm", "RealtimeAudioFormatsAudioPcma", "RealtimeAudioFormatsAudioPcmu", - "RealtimeConversationItem", - "RealtimeConversationItemFunctionCall", - "RealtimeConversationItemFunctionCallOutput", - "RealtimeConversationItemMessage", - "RealtimeConversationItemMessageAssistant", "RealtimeConversationItemMessageAssistantContent", - "RealtimeConversationItemMessageSystem", "RealtimeConversationItemMessageSystemContent", - "RealtimeConversationItemMessageUser", "RealtimeConversationItemMessageUserContent", "RealtimeFunctionTool", "RealtimeFunctionToolParameters", - "RealtimeMCPApprovalRequest", - "RealtimeMCPApprovalResponse", "RealtimeMCPError", "RealtimeMCPHTTPError", - "RealtimeMCPListTools", "RealtimeMCPProtocolError", - "RealtimeMCPToolCall", "RealtimeMCPToolExecutionError", "RealtimeReasoning", "RealtimeResponseStatusDetails", @@ -1284,7 +1264,6 @@ "RealtimeAudioFormatsType", "RealtimeClientEventType", "RealtimeConversationItemMessageType", - "RealtimeConversationItemType", "RealtimeMcpErrorType", "RealtimeReasoningEffort", "RealtimeServerEventType", @@ -1344,6 +1323,7 @@ "VoiceOutputModality", "VoiceSystemToolName", "VoiceTurnDetectionType", + "VoiceType", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() 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 7034dacc971c..15ed7fffec5a 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 @@ -922,23 +922,6 @@ class RealtimeConversationItemMessageType(str, Enum, metaclass=CaseInsensitiveEn """ASSISTANT.""" -class RealtimeConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of RealtimeConversationItemType.""" - - FUNCTION_CALL = "function_call" - """FUNCTION_CALL.""" - FUNCTION_CALL_OUTPUT = "function_call_output" - """FUNCTION_CALL_OUTPUT.""" - MCP_APPROVAL_RESPONSE = "mcp_approval_response" - """MCP_APPROVAL_RESPONSE.""" - MCP_LIST_TOOLS = "mcp_list_tools" - """MCP_LIST_TOOLS.""" - MCP_CALL = "mcp_call" - """MCP_CALL.""" - MCP_APPROVAL_REQUEST = "mcp_approval_request" - """MCP_APPROVAL_REQUEST.""" - - class RealtimeMcpErrorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of RealtimeMcpErrorType.""" @@ -1704,12 +1687,12 @@ 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. + 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. + 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. + finalization. """ IN_PROGRESS = "in_progress" @@ -1750,9 +1733,10 @@ class VoiceEndOfUtteranceThresholdLevel(str, Enum, metaclass=CaseInsensitiveEnum class VoiceInputTranscriptionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The input-audio transcription model. 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 added over time. + """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 + added over time. """ WHISPER1 = "whisper-1" @@ -1834,3 +1818,20 @@ class VoiceTurnDetectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """English-optimized Azure semantic voice activity detection.""" AZURE_SEMANTIC_VAD_MULTILINGUAL = "azure_semantic_vad_multilingual" """Multilingual Azure semantic voice activity detection.""" + + +class VoiceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The voice implementation. Additional values may be added over time.""" + + OPENAI = "openai" + """An OpenAI voice.""" + AZURE_STANDARD = "azure-standard" + """An Azure standard voice.""" + AZURE_CUSTOM = "azure-custom" + """An Azure custom voice.""" + AZURE_PERSONAL = "azure-personal" + """An Azure personal voice.""" + AVATAR_VOICE_SYNC = "avatar-voice-sync" + """A voice synchronized with an avatar.""" + AZURE_REALTIME_NATIVE = "azure-realtime-native" + """An Azure native realtime voice.""" 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 307df7c17903..0c80f84b8be0 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 @@ -44,7 +44,6 @@ RealtimeAudioFormatsType, RealtimeClientEventType, RealtimeConversationItemMessageType, - RealtimeConversationItemType, RealtimeMcpErrorType, RealtimeServerEventType, RecurrenceType, @@ -8698,6 +8697,99 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["function"] = "function" +class GenerateVoiceAgentRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The inputs for generating a voice agent. Only ``kind`` and ``name`` are always required. The + authoring service expands these inputs into a full, editable ``VoiceAgentDefinition``, which is + then created through ``POST /agents``. The generated ``instructions`` and audio/voice settings + are stored as separate fields on the resulting agent definition, so the caller can edit or + override any of them afterward via standard agent versioning. + + :ivar kind: The agent kind. Always ``voice``. Required. VOICE. + :vartype kind: str or ~azure.ai.projects.models.VOICE + :ivar name: The unique name for the agent to create. Must be a non-empty DNS-like agent name. + Required. + :vartype name: str + :ivar model_type: Optional inference mode. When omitted, the authoring service uses + ``managed``. When supplied, use ``managed`` or ``self_deployed``. Known values are: "managed" + and "self_deployed". + :vartype model_type: str or ~azure.ai.projects.models.VoiceModelType + :ivar model: Optional model identifier. Required when ``model_type`` is ``self_deployed``; + optional when ``model_type`` is ``managed`` or omitted. The service never invents a customer + deployment name. + :vartype model: str + :ivar use_case: An optional authoring use case. An empty string is accepted. + :vartype use_case: str + :ivar goal: An optional natural-language description of what the agent should do. When + supplied, it seeds the generated instructions. + :vartype goal: str + :ivar description: An optional agent description. The authoring service resolves its fallback + when omitted. + :vartype description: str + :ivar tools: Optional tools carried through verbatim onto the generated agent (see + ``VoiceAgentTool``). + :vartype tools: list[~azure.ai.projects.models.VoiceAgentTool] + :ivar draft: (Preview) When ``true``, the generated voice agent is created as a draft — an + editable, unpublished version the caller can review and refine before publishing it via the + standard create/version path. The service defaults to ``false`` if a value is not specified by + the caller, in which case the agent is created and published normally. + :vartype draft: bool + """ + + kind: Literal[AgentKind.VOICE] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The agent kind. Always ``voice``. Required. VOICE.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique name for the agent to create. Must be a non-empty DNS-like agent name. Required.""" + model_type: Optional[Union[str, "_models.VoiceModelType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional inference mode. When omitted, the authoring service uses ``managed``. When supplied, + use ``managed`` or ``self_deployed``. Known values are: \"managed\" and \"self_deployed\".""" + model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional model identifier. Required when ``model_type`` is ``self_deployed``; optional when + ``model_type`` is ``managed`` or omitted. The service never invents a customer deployment name.""" + use_case: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional authoring use case. An empty string is accepted.""" + goal: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional natural-language description of what the agent should do. When supplied, it seeds + the generated instructions.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional agent description. The authoring service resolves its fallback when omitted.""" + tools: Optional[list["_models.VoiceAgentTool"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional tools carried through verbatim onto the generated agent (see ``VoiceAgentTool``).""" + draft: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """(Preview) When ``true``, the generated voice agent is created as a draft — an editable, + unpublished version the caller can review and refine before publishing it via the standard + create/version path. The service defaults to ``false`` if a value is not specified by the + caller, in which case the agent is created and published normally.""" + + @overload + def __init__( + self, + *, + kind: Literal[AgentKind.VOICE], + name: str, + model_type: Optional[Union[str, "_models.VoiceModelType"]] = None, + model: Optional[str] = None, + use_case: Optional[str] = None, + goal: Optional[str] = None, + description: Optional[str] = None, + tools: Optional[list["_models.VoiceAgentTool"]] = None, + draft: 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 GitHubIssueRoutineTrigger( RoutineTrigger, discriminator="github_issue" ): # pylint: disable=docstring-keyword-should-match-keyword-only @@ -9887,10 +9979,10 @@ class LlmGeneratedVoiceGreetingConfig( :ivar prompt: The Handlebars prompt that guides the opening turn. Required. :vartype prompt: str :ivar tool_choice: The tool-selection policy for the opening response. Defaults to ``none``. Is - one of the following types: Union[str, "_models.ToolChoiceOptions"], ToolChoiceFunction, - ToolChoiceMCP - :vartype tool_choice: str or ~azure.ai.projects.models.ToolChoiceOptions or - ~azure.ai.projects.models.ToolChoiceFunction or ~azure.ai.projects.models.ToolChoiceMCP + 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 """ type: Literal["llm_generated"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore @@ -9901,7 +9993,8 @@ class LlmGeneratedVoiceGreetingConfig( visibility=["read", "create", "update", "delete", "query"] ) """The tool-selection policy for the opening response. Defaults to ``none``. Is one of the - following types: Union[str, \"_models.ToolChoiceOptions\"], ToolChoiceFunction, ToolChoiceMCP""" + following types: Literal[\"none\"], Literal[\"auto\"], Literal[\"required\"], + ToolChoiceFunction, ToolChoiceMCP""" @overload def __init__( @@ -13354,274 +13447,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RealtimeAudioFormatsType.AUDIO_PCMU # 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 - - :ivar type: Required. Known values are: "function_call", "function_call_output", - "mcp_approval_response", "mcp_list_tools", "mcp_call", and "mcp_approval_request". - :vartype type: str or ~azure.ai.projects.models.RealtimeConversationItemType - """ - - __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\", and \"mcp_approval_request\".""" - - @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 RealtimeConversationItemFunctionCall( - RealtimeConversationItem, discriminator="function_call" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime function call item. - - :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 - """ - - 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"] - ) - """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.""" - - @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, - ) -> 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 = 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. - - :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 - """ - - 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.""" - - @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, - ) -> 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 = RealtimeConversationItemType.FUNCTION_CALL_OUTPUT # type: ignore - - -class RealtimeConversationItemMessage(_Model): # 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 - - :ivar role: Required. Known values are: "system", "user", and "assistant". - :vartype role: str or ~azure.ai.projects.models.RealtimeConversationItemMessageType - """ - - __mapping__: dict[str, _Model] = {} - role: str = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"system\", \"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 RealtimeConversationItemMessageAssistant( - RealtimeConversationItemMessage, discriminator="assistant" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime assistant message item. - - :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. Default value is "message". - :vartype type: str - :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] - """ - - 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["message"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The type of the item. Always ``message``. Required. Default value is \"message\".""" - 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.""" - - @overload - def __init__( - self, - *, - 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 - 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 = RealtimeConversationItemMessageType.ASSISTANT # type: ignore - self.type: Literal["message"] = "message" - - class RealtimeConversationItemMessageAssistantContent( _Model ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only @@ -13666,70 +13491,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeConversationItemMessageSystem( - RealtimeConversationItemMessage, discriminator="system" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime system message item. - - :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. Default value is "message". - :vartype type: str - :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] - """ - - 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["message"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The type of the item. Always ``message``. Required. Default value is \"message\".""" - 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.""" - - @overload - def __init__( - self, - *, - 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 - 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 = RealtimeConversationItemMessageType.SYSTEM # type: ignore - self.type: Literal["message"] = "message" - - class RealtimeConversationItemMessageSystemContent( _Model ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only @@ -13742,77 +13503,15 @@ class RealtimeConversationItemMessageSystemContent( """ 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, - *, - type: Optional[Literal["input_text"]] = None, - 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 RealtimeConversationItemMessageUser( - RealtimeConversationItemMessage, discriminator="user" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime user message item. - - :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. Default value is "message". - :vartype type: str - :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] - """ - - 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["message"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The type of the item. Always ``message``. Required. Default value is \"message\".""" - 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.""" + """Default value is \"input_text\".""" + text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - 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, + type: Optional[Literal["input_text"]] = None, + text: Optional[str] = None, ) -> None: ... @overload @@ -13824,8 +13523,6 @@ 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: Literal["message"] = "message" class RealtimeConversationItemMessageUserContent( @@ -13936,107 +13633,6 @@ class RealtimeFunctionToolParameters(_Model): """RealtimeFunctionToolParameters.""" -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 - """ - - 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.""" - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - server_label: str, - name: str, - arguments: 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 = RealtimeConversationItemType.MCP_APPROVAL_REQUEST # type: ignore - - -class RealtimeMCPApprovalResponse( - RealtimeConversationItem, discriminator="mcp_approval_response" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime MCP approval response. - - :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 - """ - - 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"]) - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - approval_request_id: str, - approve: bool, - reason: 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 = RealtimeConversationItemType.MCP_APPROVAL_RESPONSE # type: ignore - - class RealtimeMCPError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """RealtimeMCPError. @@ -14110,51 +13706,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RealtimeMcpErrorType.HTTP_ERROR # type: ignore -class RealtimeMCPListTools( - RealtimeConversationItem, discriminator="mcp_list_tools" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime MCP list tools. - - :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] - """ - - 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.""" - - @overload - def __init__( - self, - *, - server_label: str, - tools: list["_models.MCPListToolsTool"], - id: Optional[str] = None, # 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) - self.type = RealtimeConversationItemType.MCP_LIST_TOOLS # type: ignore - - class RealtimeMCPProtocolError( RealtimeMCPError, discriminator="protocol_error" ): # pylint: disable=docstring-keyword-should-match-keyword-only @@ -14195,68 +13746,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RealtimeMcpErrorType.PROTOCOL_ERROR # type: ignore -class RealtimeMCPToolCall( - RealtimeConversationItem, discriminator="mcp_call" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime MCP tool call. - - :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 - """ - - 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"]) - - @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, - ) -> 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 = RealtimeConversationItemType.MCP_CALL # type: ignore - - class RealtimeMCPToolExecutionError( RealtimeMCPError, discriminator="tool_execution_error" ): # pylint: disable=docstring-keyword-should-match-keyword-only @@ -18511,8 +18000,6 @@ class VoiceAgentAvatarVideoParams(_Model): # pylint: disable=docstring-keyword- :ivar bitrate: :vartype bitrate: int - :ivar codec: Default value is "h264". - :vartype codec: str :ivar crop: :vartype crop: ~azure.ai.projects.models.VoiceAgentAvatarVideoCrop :ivar resolution: @@ -18524,8 +18011,6 @@ class VoiceAgentAvatarVideoParams(_Model): # pylint: disable=docstring-keyword- """ bitrate: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - codec: Optional[Literal["h264"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Default value is \"h264\".""" crop: Optional["_models.VoiceAgentAvatarVideoCrop"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -18542,7 +18027,6 @@ def __init__( self, *, bitrate: Optional[int] = None, - codec: Optional[Literal["h264"]] = None, crop: Optional["_models.VoiceAgentAvatarVideoCrop"] = None, resolution: Optional["_models.VoiceAgentAvatarVideoResolution"] = None, background: Optional["_models.VoiceAgentAvatarVideoBackground"] = None, @@ -18609,14 +18093,8 @@ class VoiceAgentClientEventConversationItemCreate( 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: The conversation item to create. Required. Is either a - "_unions.VoiceAgentRequestConversationItem" type or a RealtimeMCPApprovalResponse type. - :vartype item: ~azure.ai.projects.models.RealtimeConversationItemMessageSystem or - ~azure.ai.projects.models.RealtimeConversationItemMessageUser or - ~azure.ai.projects.models.RealtimeConversationItemMessageAssistant or - ~azure.ai.projects.models.RealtimeConversationItemFunctionCall or - ~azure.ai.projects.models.RealtimeConversationItemFunctionCallOutput or - ~azure.ai.projects.models.RealtimeMCPApprovalResponse + :ivar item: The conversation item to create. Required. + :vartype item: ~azure.ai.projects.models.VoiceConversationItem """ event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -18631,18 +18109,15 @@ class VoiceAgentClientEventConversationItemCreate( 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: "_unions.VoiceAgentCreateConversationItem" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The conversation item to create. Required. Is either a - \"_unions.VoiceAgentRequestConversationItem\" type or a RealtimeMCPApprovalResponse type.""" + item: "_models.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The conversation item to create. Required.""" @overload def __init__( self, *, type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE], - item: "_unions.VoiceAgentCreateConversationItem", + item: "_models.VoiceConversationItem", event_id: Optional[str] = None, previous_item_id: Optional[str] = None, ) -> None: ... @@ -19192,9 +18667,10 @@ class VoiceAgentDefinition( :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: Union[str, "_models.ToolChoiceOptions"], ToolChoiceFunction, ToolChoiceMCP - :vartype tool_choice: str or ~azure.ai.projects.models.ToolChoiceOptions or - ~azure.ai.projects.models.ToolChoiceFunction or ~azure.ai.projects.models.ToolChoiceMCP + 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 @@ -19274,7 +18750,7 @@ class VoiceAgentDefinition( """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: - Union[str, \"_models.ToolChoiceOptions\"], ToolChoiceFunction, ToolChoiceMCP""" + 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( @@ -19464,7 +18940,7 @@ class VoiceAgentInterimResponseConfig(_Model): # pylint: disable=docstring-keyw :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: int + :vartype latency_threshold_ms: ~datetime.timedelta """ __mapping__: dict[str, _Model] = {} @@ -19474,7 +18950,9 @@ class VoiceAgentInterimResponseConfig(_Model): # pylint: disable=docstring-keyw visibility=["read", "create", "update", "delete", "query"] ) """Conditions that may trigger one interim response.""" - latency_threshold_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + latency_threshold_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) """The latency threshold in milliseconds.""" @overload @@ -19483,7 +18961,7 @@ def __init__( *, type: str, triggers: Optional[list[Union[str, "_models.VoiceAgentInterimResponseTrigger"]]] = None, - latency_threshold_ms: Optional[int] = None, + latency_threshold_ms: Optional[datetime.timedelta] = None, ) -> None: ... @overload @@ -19505,7 +18983,7 @@ class VoiceAgentLlmInterimResponseConfig( :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: int + :vartype latency_threshold_ms: ~datetime.timedelta :ivar type: Required. Default value is "llm_interim_response". :vartype type: str :ivar model: The model used to generate interim responses. @@ -19530,7 +19008,7 @@ def __init__( self, *, triggers: Optional[list[Union[str, "_models.VoiceAgentInterimResponseTrigger"]]] = None, - latency_threshold_ms: Optional[int] = None, + latency_threshold_ms: Optional[datetime.timedelta] = None, model: Optional[str] = None, instructions: Optional[str] = None, max_completion_tokens: Optional[int] = None, @@ -19699,14 +19177,7 @@ class VoiceAgentRealtimeResponse( locale, and format fields under ``output``. :vartype audio: ~azure.ai.projects.models.VoiceResponseAudio :ivar output: The items produced by the live response. - :vartype output: list[~azure.ai.projects.models.RealtimeConversationItemMessageSystem or - ~azure.ai.projects.models.RealtimeConversationItemMessageUser or - ~azure.ai.projects.models.RealtimeConversationItemMessageAssistant or - ~azure.ai.projects.models.VoiceFunctionCallItem or - ~azure.ai.projects.models.VoiceFunctionCallOutputItem or - ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem - or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or - ~azure.ai.projects.models.VoiceMcpApprovalResponseItem] + :vartype output: list[~azure.ai.projects.models.VoiceConversationItem] """ audio: Optional["_models.VoiceResponseAudio"] = rest_field( @@ -19714,7 +19185,7 @@ class VoiceAgentRealtimeResponse( ) """The audio configuration used by the live response, including flat voice provider, locale, and format fields under ``output``.""" - output: Optional[list["_unions.VoiceAgentResponseItem"]] = rest_field( + output: Optional[list["_models.VoiceConversationItem"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The items produced by the live response.""" @@ -19733,7 +19204,7 @@ def __init__( output_modalities: Optional[list[Literal["text", "audio"]]] = None, max_output_tokens: Optional[Union[int, Literal["inf"]]] = None, audio: Optional["_models.VoiceResponseAudio"] = None, - output: Optional[list["_unions.VoiceAgentResponseItem"]] = None, + output: Optional[list["_models.VoiceConversationItem"]] = None, ) -> None: ... @overload @@ -19785,19 +19256,15 @@ class VoiceAgentResponseCreateParams(_Model): # pylint: disable=docstring-keywo :vartype conversation: str or str or str :ivar metadata: :vartype metadata: ~azure.ai.projects.models.Metadata - :ivar input: Input items to include in the prompt for the model. Using this field creates a new - context for this Response instead of using the default conversation. An empty array ``[]`` will - clear the context for this Response. Note that this can include references to items that - previously appeared in the session using their id. - :vartype input: list[~azure.ai.projects.models.RealtimeConversationItem] :ivar output_modalities: Modalities that the response may return. :vartype output_modalities: list[str or ~azure.ai.projects.models.VoiceOutputModality] :ivar audio: Response-specific audio settings. :vartype audio: ~azure.ai.projects.models.PickPropertiesVoiceAudioConfig + :ivar input: Conversation items used as inline response input. + :vartype input: list[~azure.ai.projects.models.VoiceConversationItem] :ivar pre_generated_assistant_message: A pre-generated assistant message used to begin the response. - :vartype pre_generated_assistant_message: - ~azure.ai.projects.models.RealtimeConversationItemMessageAssistant + :vartype pre_generated_assistant_message: ~azure.ai.projects.models.VoiceAssistantMessageItem :ivar interim_response: Interim-response settings for this response. Is either a VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. :vartype interim_response: ~azure.ai.projects.models.VoiceAgentStaticInterimResponseConfig or @@ -19845,13 +19312,6 @@ class VoiceAgentResponseCreateParams(_Model): # pylint: disable=docstring-keywo response which will not add items to default conversation. Is one of the following types: Literal[\"auto\"], Literal[\"none\"], str""" metadata: Optional["_models.Metadata"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - input: Optional[list["_models.RealtimeConversationItem"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Input items to include in the prompt for the model. Using this field creates a new context for - this Response instead of using the default conversation. An empty array ``[]`` will clear the - context for this Response. Note that this can include references to items that previously - appeared in the session using their id.""" output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -19860,7 +19320,11 @@ class VoiceAgentResponseCreateParams(_Model): # pylint: disable=docstring-keywo visibility=["read", "create", "update", "delete", "query"] ) """Response-specific audio settings.""" - pre_generated_assistant_message: Optional["_models.RealtimeConversationItemMessageAssistant"] = rest_field( + input: Optional[list["_models.VoiceConversationItem"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Conversation items used as inline response input.""" + pre_generated_assistant_message: Optional["_models.VoiceAssistantMessageItem"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """A pre-generated assistant message used to begin the response.""" @@ -19884,10 +19348,10 @@ def __init__( max_output_tokens: Optional[Union[int, Literal["inf"]]] = None, conversation: Optional[Union[Literal["auto"], Literal["none"], str]] = None, metadata: Optional["_models.Metadata"] = None, - input: Optional[list["_models.RealtimeConversationItem"]] = None, output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = None, audio: Optional["_models.PickPropertiesVoiceAudioConfig"] = None, - pre_generated_assistant_message: Optional["_models.RealtimeConversationItemMessageAssistant"] = None, + input: Optional[list["_models.VoiceConversationItem"]] = None, + pre_generated_assistant_message: Optional["_models.VoiceAssistantMessageItem"] = None, interim_response: Optional["_unions.VoiceAgentInterimResponse"] = None, ) -> None: ... @@ -20055,18 +19519,8 @@ class VoiceAgentServerEventConversationItemAdded( :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_ADDED :ivar previous_item_id: :vartype previous_item_id: str - :ivar item: The item added to the conversation. Required. Is one of the following types: - "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem - :vartype item: ~azure.ai.projects.models.RealtimeConversationItemMessageSystem or - ~azure.ai.projects.models.RealtimeConversationItemMessageUser or - ~azure.ai.projects.models.RealtimeConversationItemMessageAssistant or - ~azure.ai.projects.models.VoiceFunctionCallItem or - ~azure.ai.projects.models.VoiceFunctionCallOutputItem or - ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem - or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or - ~azure.ai.projects.models.VoiceMcpApprovalResponseItem + :ivar item: The item added to the conversation. Required. + :vartype item: ~azure.ai.projects.models.VoiceConversationItem """ event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -20076,11 +19530,8 @@ class VoiceAgentServerEventConversationItemAdded( ) """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: "_unions.VoiceAgentResponseItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The item added to the conversation. Required. Is one of the following types: - \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem""" + item: "_models.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The item added to the conversation. Required.""" @overload def __init__( @@ -20088,7 +19539,7 @@ def __init__( *, event_id: str, type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED], - item: "_unions.VoiceAgentResponseItem", + item: "_models.VoiceConversationItem", previous_item_id: Optional[str] = None, ) -> None: ... @@ -20115,18 +19566,8 @@ class VoiceAgentServerEventConversationItemCreated( :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_CREATED :ivar previous_item_id: :vartype previous_item_id: str - :ivar item: The created conversation item. Required. Is one of the following types: - "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem - :vartype item: ~azure.ai.projects.models.RealtimeConversationItemMessageSystem or - ~azure.ai.projects.models.RealtimeConversationItemMessageUser or - ~azure.ai.projects.models.RealtimeConversationItemMessageAssistant or - ~azure.ai.projects.models.VoiceFunctionCallItem or - ~azure.ai.projects.models.VoiceFunctionCallOutputItem or - ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem - or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or - ~azure.ai.projects.models.VoiceMcpApprovalResponseItem + :ivar item: The created conversation item. Required. + :vartype item: ~azure.ai.projects.models.VoiceConversationItem """ event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -20136,11 +19577,8 @@ class VoiceAgentServerEventConversationItemCreated( ) """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: "_unions.VoiceAgentResponseItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The created conversation item. Required. Is one of the following types: - \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem""" + item: "_models.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The created conversation item. Required.""" @overload def __init__( @@ -20148,7 +19586,7 @@ def __init__( *, event_id: str, type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED], - item: "_unions.VoiceAgentResponseItem", + item: "_models.VoiceConversationItem", previous_item_id: Optional[str] = None, ) -> None: ... @@ -20218,18 +19656,8 @@ class VoiceAgentServerEventConversationItemDone( :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_DONE :ivar previous_item_id: :vartype previous_item_id: str - :ivar item: The completed conversation item. Required. Is one of the following types: - "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem - :vartype item: ~azure.ai.projects.models.RealtimeConversationItemMessageSystem or - ~azure.ai.projects.models.RealtimeConversationItemMessageUser or - ~azure.ai.projects.models.RealtimeConversationItemMessageAssistant or - ~azure.ai.projects.models.VoiceFunctionCallItem or - ~azure.ai.projects.models.VoiceFunctionCallOutputItem or - ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem - or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or - ~azure.ai.projects.models.VoiceMcpApprovalResponseItem + :ivar item: The completed conversation item. Required. + :vartype item: ~azure.ai.projects.models.VoiceConversationItem """ event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -20239,11 +19667,8 @@ class VoiceAgentServerEventConversationItemDone( ) """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: "_unions.VoiceAgentResponseItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The completed conversation item. Required. Is one of the following types: - \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem""" + item: "_models.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The completed conversation item. Required.""" @overload def __init__( @@ -20251,7 +19676,7 @@ def __init__( *, event_id: str, type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE], - item: "_unions.VoiceAgentResponseItem", + item: "_models.VoiceConversationItem", previous_item_id: Optional[str] = None, ) -> None: ... @@ -20550,18 +19975,8 @@ class VoiceAgentServerEventConversationItemRetrieved( :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: The retrieved conversation item. Required. Is one of the following types: - "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem - :vartype item: ~azure.ai.projects.models.RealtimeConversationItemMessageSystem or - ~azure.ai.projects.models.RealtimeConversationItemMessageUser or - ~azure.ai.projects.models.RealtimeConversationItemMessageAssistant or - ~azure.ai.projects.models.VoiceFunctionCallItem or - ~azure.ai.projects.models.VoiceFunctionCallOutputItem or - ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem - or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or - ~azure.ai.projects.models.VoiceMcpApprovalResponseItem + :ivar item: The retrieved conversation item. Required. + :vartype item: ~azure.ai.projects.models.VoiceConversationItem """ event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -20570,11 +19985,8 @@ class VoiceAgentServerEventConversationItemRetrieved( visibility=["read", "create", "update", "delete", "query"] ) """The event type, must be ``conversation.item.retrieved``. Required. CONVERSATION_ITEM_RETRIEVED.""" - item: "_unions.VoiceAgentResponseItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The retrieved conversation item. Required. Is one of the following types: - \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem""" + item: "_models.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The retrieved conversation item. Required.""" @overload def __init__( @@ -20582,7 +19994,7 @@ def __init__( *, event_id: str, type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED], - item: "_unions.VoiceAgentResponseItem", + item: "_models.VoiceConversationItem", ) -> None: ... @overload @@ -20614,7 +20026,7 @@ class VoiceAgentServerEventConversationItemTruncated( 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.RealtimeConversationItemMessageAssistant + :vartype item: ~azure.ai.projects.models.VoiceAssistantMessageItem """ event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -20629,7 +20041,7 @@ class VoiceAgentServerEventConversationItemTruncated( """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.RealtimeConversationItemMessageAssistant"] = rest_field( + item: Optional["_models.VoiceAssistantMessageItem"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The assistant message after truncation, when the service returns the updated item.""" @@ -20643,7 +20055,7 @@ def __init__( item_id: str, content_index: int, audio_end_ms: int, - item: Optional["_models.RealtimeConversationItemMessageAssistant"] = None, + item: Optional["_models.VoiceAssistantMessageItem"] = None, ) -> None: ... @overload @@ -21257,7 +20669,7 @@ class VoiceAgentServerEventResponseAnimationVisemeDelta( :ivar content_index: Required. :vartype content_index: int :ivar audio_offset_ms: Required. - :vartype audio_offset_ms: int + :vartype audio_offset_ms: ~datetime.timedelta :ivar viseme_id: Required. :vartype viseme_id: int """ @@ -21276,7 +20688,9 @@ class VoiceAgentServerEventResponseAnimationVisemeDelta( """Required.""" content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" - audio_offset_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + audio_offset_ms: datetime.timedelta = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) """Required.""" viseme_id: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" @@ -21290,7 +20704,7 @@ def __init__( item_id: str, output_index: int, content_index: int, - audio_offset_ms: int, + audio_offset_ms: datetime.timedelta, viseme_id: int, ) -> None: ... @@ -21498,9 +20912,9 @@ class VoiceAgentServerEventResponseAudioTimestampDelta( :ivar content_index: Required. :vartype content_index: int :ivar audio_offset_ms: Required. - :vartype audio_offset_ms: int + :vartype audio_offset_ms: ~datetime.timedelta :ivar audio_duration_ms: Required. - :vartype audio_duration_ms: int + :vartype audio_duration_ms: ~datetime.timedelta :ivar text: Required. :vartype text: str :ivar timestamp_type: Required. Default value is "word". @@ -21521,9 +20935,13 @@ class VoiceAgentServerEventResponseAudioTimestampDelta( """Required.""" content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" - audio_offset_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + audio_offset_ms: datetime.timedelta = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) """Required.""" - audio_duration_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + audio_duration_ms: datetime.timedelta = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) """Required.""" text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" @@ -21539,8 +20957,8 @@ def __init__( item_id: str, output_index: int, content_index: int, - audio_offset_ms: int, - audio_duration_ms: int, + audio_offset_ms: datetime.timedelta, + audio_duration_ms: datetime.timedelta, text: str, ) -> None: ... @@ -22305,18 +21723,8 @@ class VoiceAgentServerEventResponseOutputItemAdded( :vartype response_id: str :ivar output_index: The index of the output item in the Response. Required. :vartype output_index: int - :ivar item: The output item that was added. Required. Is one of the following types: - "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem - :vartype item: ~azure.ai.projects.models.RealtimeConversationItemMessageSystem or - ~azure.ai.projects.models.RealtimeConversationItemMessageUser or - ~azure.ai.projects.models.RealtimeConversationItemMessageAssistant or - ~azure.ai.projects.models.VoiceFunctionCallItem or - ~azure.ai.projects.models.VoiceFunctionCallOutputItem or - ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem - or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or - ~azure.ai.projects.models.VoiceMcpApprovalResponseItem + :ivar item: The output item that was added. Required. + :vartype item: ~azure.ai.projects.models.VoiceConversationItem """ event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -22329,11 +21737,8 @@ class VoiceAgentServerEventResponseOutputItemAdded( """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: "_unions.VoiceAgentResponseItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The output item that was added. Required. Is one of the following types: - \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem""" + item: "_models.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The output item that was added. Required.""" @overload def __init__( @@ -22343,7 +21748,7 @@ def __init__( type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED], response_id: str, output_index: int, - item: "_unions.VoiceAgentResponseItem", + item: "_models.VoiceConversationItem", ) -> None: ... @overload @@ -22371,18 +21776,8 @@ class VoiceAgentServerEventResponseOutputItemDone( :vartype response_id: str :ivar output_index: The index of the output item in the Response. Required. :vartype output_index: int - :ivar item: The output item that finished streaming. Required. Is one of the following types: - "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem - :vartype item: ~azure.ai.projects.models.RealtimeConversationItemMessageSystem or - ~azure.ai.projects.models.RealtimeConversationItemMessageUser or - ~azure.ai.projects.models.RealtimeConversationItemMessageAssistant or - ~azure.ai.projects.models.VoiceFunctionCallItem or - ~azure.ai.projects.models.VoiceFunctionCallOutputItem or - ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem - or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or - ~azure.ai.projects.models.VoiceMcpApprovalResponseItem + :ivar item: The output item that finished streaming. Required. + :vartype item: ~azure.ai.projects.models.VoiceConversationItem """ event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -22395,11 +21790,8 @@ class VoiceAgentServerEventResponseOutputItemDone( """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: "_unions.VoiceAgentResponseItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The output item that finished streaming. Required. Is one of the following types: - \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem""" + item: "_models.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The output item that finished streaming. Required.""" @overload def __init__( @@ -22409,7 +21801,7 @@ def __init__( type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE], response_id: str, output_index: int, - item: "_unions.VoiceAgentResponseItem", + item: "_models.VoiceConversationItem", ) -> None: ... @overload @@ -23039,9 +22431,9 @@ class VoiceAgentSessionResponseConfig(_Model): # pylint: disable=docstring-keyw :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: - Union[str, "_models.ToolChoiceOptions"], ToolChoiceFunction, ToolChoiceMCP - :vartype tool_choice: str or ~azure.ai.projects.models.ToolChoiceOptions or - ~azure.ai.projects.models.ToolChoiceFunction or ~azure.ai.projects.models.ToolChoiceMCP + 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. @@ -23099,8 +22491,8 @@ class VoiceAgentSessionResponseConfig(_Model): # pylint: disable=docstring-keyw 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: Union[str, - \"_models.ToolChoiceOptions\"], ToolChoiceFunction, ToolChoiceMCP""" + """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"] ) @@ -23193,9 +22585,9 @@ class VoiceAgentSessionUpdateConfig(_Model): # pylint: disable=docstring-keywor :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: - Union[str, "_models.ToolChoiceOptions"], ToolChoiceFunction, ToolChoiceMCP - :vartype tool_choice: str or ~azure.ai.projects.models.ToolChoiceOptions or - ~azure.ai.projects.models.ToolChoiceFunction or ~azure.ai.projects.models.ToolChoiceMCP + 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. @@ -23244,8 +22636,8 @@ class VoiceAgentSessionUpdateConfig(_Model): # pylint: disable=docstring-keywor 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: Union[str, - \"_models.ToolChoiceOptions\"], ToolChoiceFunction, ToolChoiceMCP""" + """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"] ) @@ -23309,7 +22701,7 @@ class VoiceAgentStaticInterimResponseConfig( :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: int + :vartype latency_threshold_ms: ~datetime.timedelta :ivar type: Required. Default value is "static_interim_response". :vartype type: str :ivar texts: Candidate text values for the interim response. @@ -23326,7 +22718,7 @@ def __init__( self, *, triggers: Optional[list[Union[str, "_models.VoiceAgentInterimResponseTrigger"]]] = None, - latency_threshold_ms: Optional[int] = None, + latency_threshold_ms: Optional[datetime.timedelta] = None, texts: Optional[list[str]] = None, ) -> None: ... @@ -23347,9 +22739,9 @@ class VoiceAgentTranscriptionPhrase(_Model): # pylint: disable=docstring-keywor :ivar offset_milliseconds: The phrase offset from the beginning of the audio, in milliseconds. Required. - :vartype offset_milliseconds: int + :vartype offset_milliseconds: ~datetime.timedelta :ivar duration_milliseconds: The phrase duration in milliseconds. Required. - :vartype duration_milliseconds: int + :vartype duration_milliseconds: ~datetime.timedelta :ivar text: The transcribed phrase text. Required. :vartype text: str :ivar words: Word-level timing details, when available. @@ -23360,9 +22752,13 @@ class VoiceAgentTranscriptionPhrase(_Model): # pylint: disable=docstring-keywor :vartype confidence: float """ - offset_milliseconds: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + offset_milliseconds: datetime.timedelta = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) """The phrase offset from the beginning of the audio, in milliseconds. Required.""" - duration_milliseconds: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + duration_milliseconds: datetime.timedelta = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) """The phrase duration in milliseconds. Required.""" text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The transcribed phrase text. Required.""" @@ -23379,8 +22775,8 @@ class VoiceAgentTranscriptionPhrase(_Model): # pylint: disable=docstring-keywor def __init__( self, *, - offset_milliseconds: int, - duration_milliseconds: int, + offset_milliseconds: datetime.timedelta, + duration_milliseconds: datetime.timedelta, text: str, words: Optional[list["_models.VoiceAgentTranscriptionWord"]] = None, locale: Optional[str] = None, @@ -23405,16 +22801,20 @@ class VoiceAgentTranscriptionWord(_Model): # pylint: disable=docstring-keyword- :vartype text: str :ivar offset_milliseconds: The word offset from the beginning of the audio, in milliseconds. Required. - :vartype offset_milliseconds: int + :vartype offset_milliseconds: ~datetime.timedelta :ivar duration_milliseconds: The word duration in milliseconds. Required. - :vartype duration_milliseconds: int + :vartype duration_milliseconds: ~datetime.timedelta """ text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The transcribed word text. Required.""" - offset_milliseconds: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + offset_milliseconds: datetime.timedelta = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) """The word offset from the beginning of the audio, in milliseconds. Required.""" - duration_milliseconds: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + duration_milliseconds: datetime.timedelta = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) """The word duration in milliseconds. Required.""" @overload @@ -23422,8 +22822,8 @@ def __init__( self, *, text: str, - offset_milliseconds: int, - duration_milliseconds: int, + offset_milliseconds: datetime.timedelta, + duration_milliseconds: datetime.timedelta, ) -> None: ... @overload @@ -23459,11 +22859,9 @@ class VoiceConversationItem(_Model): # pylint: disable=docstring-keyword-should """The type of the conversation item. Required. Known values are: \"message\", \"function_call\", \"function_call_output\", \"mcp_list_tools\", \"mcp_call\", \"mcp_approval_request\", and \"mcp_approval_response\".""" - created_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) + 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", "create", "update", "delete", "query"]) + response_id: Optional[str] = rest_field(visibility=["read"]) """The id of the response that produced this item, when applicable.""" @overload @@ -23471,8 +22869,6 @@ def __init__( self, *, type: str, - created_at: Optional[datetime.datetime] = None, - response_id: Optional[str] = None, ) -> None: ... @overload @@ -23517,8 +22913,6 @@ def __init__( self, *, role: str, - created_at: Optional[datetime.datetime] = None, - response_id: Optional[str] = None, ) -> None: ... @overload @@ -23584,8 +22978,6 @@ def __init__( self, *, content: list["_models.RealtimeConversationItemMessageAssistantContent"], - created_at: Optional[datetime.datetime] = None, - response_id: Optional[str] = None, id: Optional[str] = None, # pylint: disable=redefined-builtin object: Optional[Literal["realtime.item"]] = None, status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, @@ -23760,14 +23152,13 @@ class VoiceAudioOutputConfig(_Model): # pylint: disable=docstring-keyword-shoul * `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`. + `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. + `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 @@ -23777,10 +23168,9 @@ class VoiceAudioOutputConfig(_Model): # pylint: disable=docstring-keyword-shoul ``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``. The - string is extensible so future values do not require SDK type changes. - :vartype voice_type: 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 @@ -23827,10 +23217,11 @@ class VoiceAudioOutputConfig(_Model): # pylint: disable=docstring-keyword-shoul """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[str] = 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``. The string is - extensible so future values do not require SDK type changes.""" + 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``.""" @@ -23876,7 +23267,7 @@ def __init__( *, format: Optional["_models.VoiceAudioFormat"] = None, voice: Optional[str] = None, - voice_type: 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, @@ -24378,8 +23769,6 @@ def __init__( *, name: str, arguments: str, - created_at: Optional[datetime.datetime] = None, - response_id: Optional[str] = None, id: Optional[str] = None, # pylint: disable=redefined-builtin object: Optional[Literal["realtime.item"]] = None, status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, @@ -24455,8 +23844,6 @@ def __init__( *, call_id: str, output: str, - created_at: Optional[datetime.datetime] = None, - response_id: Optional[str] = None, id: Optional[str] = None, # pylint: disable=redefined-builtin object: Optional[Literal["realtime.item"]] = None, status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, @@ -24494,12 +23881,12 @@ class VoiceInputTranscription(_Model): # pylint: disable=docstring-keyword-shou ``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 to use. 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". + :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.VoiceInputTranscriptionModel - :ivar custom_speech: Optional custom speech model configuration, keyed by locale. + :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] @@ -24525,12 +23912,12 @@ class VoiceInputTranscription(_Model): # pylint: disable=docstring-keyword-shou model: Union[str, "_models.VoiceInputTranscriptionModel"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The transcription model to use. 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\".""" + """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 custom speech model configuration, keyed by locale.""" + """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.""" @@ -24689,8 +24076,6 @@ def __init__( server_label: str, name: str, arguments: str, - created_at: Optional[datetime.datetime] = None, - response_id: Optional[str] = None, ) -> None: ... @overload @@ -24743,8 +24128,6 @@ def __init__( id: str, # pylint: disable=redefined-builtin approval_request_id: str, approve: bool, - created_at: Optional[datetime.datetime] = None, - response_id: Optional[str] = None, reason: Optional[str] = None, ) -> None: ... @@ -24809,8 +24192,6 @@ def __init__( server_label: str, name: str, arguments: str, - created_at: Optional[datetime.datetime] = None, - response_id: Optional[str] = None, approval_request_id: Optional[str] = None, output: Optional[str] = None, error: Optional["_models.RealtimeMCPError"] = None, @@ -24862,8 +24243,6 @@ def __init__( *, server_label: str, tools: list["_models.MCPListToolsTool"], - created_at: Optional[datetime.datetime] = None, - response_id: Optional[str] = None, id: Optional[str] = None, # pylint: disable=redefined-builtin ) -> None: ... @@ -25157,8 +24536,9 @@ class VoiceResponseAudioOutput(_Model): # pylint: disable=docstring-keyword-sho :ivar voice: The voice name used for the response's audio output. :vartype voice: str :ivar voice_type: The extensible provider/type of the voice used for the response's audio - output. - :vartype voice_type: str + output. 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 BCP-47 locale of the voice used for the response's audio output. :vartype voice_locale: str :ivar format: The audio format used for the response's audio output. @@ -25167,8 +24547,12 @@ class VoiceResponseAudioOutput(_Model): # pylint: disable=docstring-keyword-sho voice: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The voice name used for the response's audio output.""" - voice_type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The extensible provider/type of the voice used for the response's audio output.""" + voice_type: Optional[Union[str, "_models.VoiceType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The extensible provider/type of the voice used for the response's audio output. 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 BCP-47 locale of the voice used for the response's audio output.""" format: Optional["_models.RealtimeAudioFormats"] = rest_field( @@ -25181,7 +24565,7 @@ def __init__( self, *, voice: Optional[str] = None, - voice_type: Optional[str] = None, + voice_type: Optional[Union[str, "_models.VoiceType"]] = None, voice_locale: Optional[str] = None, format: Optional["_models.RealtimeAudioFormats"] = None, ) -> None: ... @@ -25221,7 +24605,7 @@ class VoiceServerVadTurnDetection( :vartype type: str or ~azure.ai.projects.models.SERVER_VAD :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in milliseconds. - :vartype speech_duration_ms: int + :vartype speech_duration_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.VoiceEndOfUtteranceDetection @@ -25235,7 +24619,9 @@ class VoiceServerVadTurnDetection( idle_timeout_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) type: Literal[VoiceTurnDetectionType.SERVER_VAD] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Required. Server-side voice activity detection.""" - speech_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + 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.""" end_of_utterance_detection: Optional["_models.VoiceEndOfUtteranceDetection"] = rest_field( visibility=["read", "create", "update", "delete", "query"] @@ -25253,7 +24639,7 @@ def __init__( create_response: Optional[bool] = None, interrupt_response: Optional[bool] = None, idle_timeout_ms: Optional[int] = None, - speech_duration_ms: Optional[int] = None, + speech_duration_ms: Optional[datetime.timedelta] = None, end_of_utterance_detection: Optional["_models.VoiceEndOfUtteranceDetection"] = None, ) -> None: ... @@ -25318,8 +24704,6 @@ def __init__( self, *, content: list["_models.RealtimeConversationItemMessageSystemContent"], - created_at: Optional[datetime.datetime] = None, - response_id: Optional[str] = None, id: Optional[str] = None, # pylint: disable=redefined-builtin object: Optional[Literal["realtime.item"]] = None, status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, @@ -25482,8 +24866,6 @@ def __init__( self, *, content: list["_models.RealtimeConversationItemMessageUserContent"], - created_at: Optional[datetime.datetime] = None, - response_id: Optional[str] = None, id: Optional[str] = None, # pylint: disable=redefined-builtin object: Optional[Literal["realtime.item"]] = None, status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, 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 79ec534146bd..9e21c72f7f61 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 @@ -10,7 +10,7 @@ import datetime from io import IOBase import json -from typing import Any, Callable, IO, Iterator, Literal, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, IO, Iterator, Literal, Optional, TYPE_CHECKING, TypeVar, Union, cast, overload import urllib.parse import uuid @@ -39,6 +39,8 @@ from .._utils.serialization import Deserializer, Serializer from .._utils.utils import prepare_multipart_form_data +if TYPE_CHECKING: + from .. import _unions JSON = MutableMapping[str, Any] _Unset: Any = object() T = TypeVar("T") @@ -4158,78 +4160,16 @@ def get(self, agent_name: str, **kwargs: Any) -> _models.AgentDetails: return deserialized # type: ignore - @overload - def generate_agent( - self, *, kind: Union[str, _models.AgentKind], content_type: str = "application/json", **kwargs: Any - ) -> _models.AgentDetails: - """Generate an agent. - - Generates and creates an agent from kind-specific high-level inputs. The generated definition - remains fully editable through the standard agent versioning operations. - - :keyword kind: The kind of agent to generate. Known values are: "prompt", "hosted", "workflow", - "external", and "voice". Required. - :paramtype kind: str or ~azure.ai.projects.models.AgentKind - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: AgentDetails. The AgentDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def generate_agent( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.AgentDetails: - """Generate an agent. - - Generates and creates an agent from kind-specific high-level inputs. The generated definition - remains fully editable through the standard agent versioning operations. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: AgentDetails. The AgentDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def generate_agent( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.AgentDetails: - """Generate an agent. - - Generates and creates an agent from kind-specific high-level inputs. The generated definition - remains fully editable through the standard agent versioning operations. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: AgentDetails. The AgentDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace - def generate_agent( - self, body: Union[JSON, IO[bytes]] = _Unset, *, kind: Union[str, _models.AgentKind] = _Unset, **kwargs: Any - ) -> _models.AgentDetails: + def generate_agent(self, body: _models.GenerateVoiceAgentRequest, **kwargs: Any) -> _models.AgentDetails: """Generate an agent. Generates and creates an agent from kind-specific high-level inputs. The generated definition remains fully editable through the standard agent versioning operations. - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword kind: The kind of agent to generate. Known values are: "prompt", "hosted", "workflow", - "external", and "voice". Required. - :paramtype kind: str or ~azure.ai.projects.models.AgentKind + :param body: The kind-specific inputs for generating and creating an agent. Is one of the + following types: GenerateVoiceAgentRequest Required. + :type body: ~azure.ai.projects.models.GenerateVoiceAgentRequest :return: AgentDetails. The AgentDetails is compatible with MutableMapping :rtype: ~azure.ai.projects.models.AgentDetails :raises ~azure.core.exceptions.HttpResponseError: @@ -4248,17 +4188,8 @@ def generate_agent( content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.AgentDetails] = kwargs.pop("cls", None) - if body is _Unset: - if kind is _Unset: - raise TypeError("missing required argument: kind") - body = {"kind": kind} - body = {k: v for k, v in body.items() if v is not None} content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_agents_generate_agent_request( content_type=content_type, diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py index f4c52a648dc0..7d9ebc522d75 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py @@ -10,7 +10,7 @@ import hashlib from io import IOBase -from typing import Union, Optional, Any, IO, overload +from typing import Union, Optional, Any, IO, overload, TYPE_CHECKING from azure.core.exceptions import HttpResponseError from azure.core.tracing.decorator import distributed_trace from ._operations import AgentsOperations as GeneratedAgentsOperations, JSON, _Unset @@ -23,6 +23,9 @@ _PREVIEW_FEATURE_ADDED_ERROR_MESSAGE, ) +if TYPE_CHECKING: + from .. import _unions + def _compute_sha256_from_stream(stream: IO[bytes], *, chunk_size: int = 1024 * 1024) -> str: if not isinstance(stream, IOBase) or not stream.seekable(): @@ -348,3 +351,45 @@ def create_version_from_code( new_exc.model = exc.model raise new_exc from exc raise + + @distributed_trace + def generate_agent(self, body: _models.GenerateVoiceAgentRequest, **kwargs: Any) -> _models.AgentDetails: # type: ignore[override] + """Generate an agent. + + Generates and creates an agent from kind-specific high-level inputs. The generated definition + remains fully editable through the standard agent versioning operations. When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param body: The kind-specific inputs for generating and creating an agent. Required. + :type body: ~azure.ai.projects.models.GenerateVoiceAgentRequest + :return: AgentDetails. The AgentDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + + if getattr(self._config, "allow_preview", False): + # Add Foundry-Features header if not already present + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS + kwargs["headers"] = headers + + try: + return super().generate_agent(body, **kwargs) # type: ignore[misc] + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/types.py b/sdk/ai/azure-ai-projects/azure/ai/projects/types.py index dc42ffcb6038..1afb14c97fc1 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/types.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/types.py @@ -37,7 +37,6 @@ RealtimeAudioFormatsType, RealtimeClientEventType, RealtimeConversationItemMessageType, - RealtimeConversationItemType, RealtimeMcpErrorType, RealtimeServerEventType, RecurrenceType, @@ -123,6 +122,7 @@ VoiceNoiseReductionType, VoiceOutputModality, VoiceSystemToolName, + VoiceType, ) @@ -329,10 +329,10 @@ class AgentClusterInsightRequest(TypedDict, total=False): :ivar type: The type of request. Required. Cluster Insight on an Agent. :vartype type: Literal[InsightType.AGENT_CLUSTER_INSIGHT] - :ivar agentName: Identifier for the agent. Required. - :vartype agentName: str - :ivar modelConfiguration: Configuration of the model used in the insight generation. - :vartype modelConfiguration: "InsightModelConfiguration" + :ivar agent_name: Identifier for the agent. Required. + :vartype agent_name: str + :ivar model_configuration: Configuration of the model used in the insight generation. + :vartype model_configuration: "InsightModelConfiguration" """ type: Required[Literal[InsightType.AGENT_CLUSTER_INSIGHT]] @@ -348,8 +348,8 @@ class AgentClusterInsightResult(TypedDict, total=False): :ivar type: The type of insights result. Required. Cluster Insight on an Agent. :vartype type: Literal[InsightType.AGENT_CLUSTER_INSIGHT] - :ivar clusterInsight: Required. - :vartype clusterInsight: "ClusterInsightResult" + :ivar cluster_insight: Required. + :vartype cluster_insight: "ClusterInsightResult" """ type: Required[Literal[InsightType.AGENT_CLUSTER_INSIGHT]] @@ -535,8 +535,8 @@ class AgentOptimizationInlineDatasetInput(TypedDict, total=False): :ivar type: Dataset input type discriminator. Required. Inline dataset — items are provided directly in the request body. :vartype type: Literal[AgentOptimizationDatasetInputType.INLINE] - :ivar items: Dataset items. Required. - :vartype items: list["AgentOptimizationDatasetItem"] + :ivar dataset_items: Dataset items. Required. + :vartype dataset_items: list["AgentOptimizationDatasetItem"] """ type: Required[Literal[AgentOptimizationDatasetInputType.INLINE]] @@ -747,8 +747,8 @@ class AgentTaxonomyInput(TypedDict, total=False): :vartype type: Literal[EvaluationTaxonomyInputType.AGENT] :ivar target: Target configuration for the agent. Required. :vartype target: "EvaluationTarget" - :ivar riskCategories: List of risk categories to evaluate against. Required. - :vartype riskCategories: list[Union[str, "RiskCategory"]] + :ivar risk_categories: List of risk categories to evaluate against. Required. + :vartype risk_categories: list[Union[str, "RiskCategory"]] """ type: Required[Literal[EvaluationTaxonomyInputType.AGENT]] @@ -807,10 +807,10 @@ class ApiError(TypedDict, total=False): :vartype type: str :ivar details: :vartype details: list["ApiError"] - :ivar additionalInfo: - :vartype additionalInfo: dict[str, Any] - :ivar debugInfo: - :vartype debugInfo: dict[str, Any] + :ivar additional_info: + :vartype additional_info: dict[str, Any] + :ivar debug_info: + :vartype debug_info: dict[str, Any] """ code: Required[Optional[str]] @@ -966,12 +966,12 @@ class AzureAISearchIndex(TypedDict, total=False): :vartype tags: dict[str, str] :ivar type: Type of index. Required. Azure search. :vartype type: Literal[IndexType.AZURE_SEARCH] - :ivar connectionName: Name of connection to Azure AI Search. Required. - :vartype connectionName: str - :ivar indexName: Name of index in Azure AI Search resource to attach. Required. - :vartype indexName: str - :ivar fieldMapping: Field mapping configuration. - :vartype fieldMapping: "FieldMapping" + :ivar connection_name: Name of connection to Azure AI Search. Required. + :vartype connection_name: str + :ivar index_name: Name of index in Azure AI Search resource to attach. Required. + :vartype index_name: str + :ivar field_mapping: Field mapping configuration. + :vartype field_mapping: "FieldMapping" """ id: str @@ -1171,10 +1171,10 @@ class AzureOpenAIModelConfiguration(TypedDict, total=False): :ivar type: Required. Default value is "AzureOpenAIModel". :vartype type: Literal["AzureOpenAIModel"] - :ivar modelDeploymentName: Deployment name for AOAI model. Example: gpt-4o if in AIServices or - connection based ``connection_name/deployment_name`` (e.g. ``my-aoai-connection/gpt-4o``). + :ivar model_deployment_name: Deployment name for AOAI model. Example: gpt-4o if in AIServices + or connection based ``connection_name/deployment_name`` (e.g. ``my-aoai-connection/gpt-4o``). Required. - :vartype modelDeploymentName: str + :vartype model_deployment_name: str """ type: Required[Literal["AzureOpenAIModel"]] @@ -1533,12 +1533,12 @@ class ClusterInsightResult(TypedDict, total=False): class ClusterTokenUsage(TypedDict, total=False): """Token usage for cluster analysis. - :ivar inputTokenUsage: input token usage. Required. - :vartype inputTokenUsage: int - :ivar outputTokenUsage: output token usage. Required. - :vartype outputTokenUsage: int - :ivar totalTokenUsage: total token usage. Required. - :vartype totalTokenUsage: int + :ivar input_token_usage: input token usage. Required. + :vartype input_token_usage: int + :ivar output_token_usage: output token usage. Required. + :vartype output_token_usage: int + :ivar total_token_usage: total token usage. Required. + :vartype total_token_usage: int """ inputTokenUsage: Required[int] @@ -1840,10 +1840,24 @@ class ContainerConfiguration(TypedDict, total=False): :ivar image: The container image for the hosted agent. Required. :vartype image: str + :ivar registry_connection_id: The id (or name) of the Foundry project connection that provides + the credentials used to authenticate to the private container registry hosting ``image``. The + connection abstracts the auth mechanism — for example a managed-identity-federated token + exchange, or a username/token secret — so registry credentials are never part of the agent + definition. Omit for public images or registries already reachable by the platform's default + identity (for example, Azure Container Registry). + :vartype registry_connection_id: str """ image: Required[str] """The container image for the hosted agent. Required.""" + registry_connection_id: str + """The id (or name) of the Foundry project connection that provides the credentials used to + authenticate to the private container registry hosting ``image``. The connection abstracts the + auth mechanism — for example a managed-identity-federated token exchange, or a username/token + secret — so registry credentials are never part of the agent definition. Omit for public images + or registries already reachable by the platform's default identity (for example, Azure + Container Registry).""" class ContainerNetworkPolicyAllowlistParam(TypedDict, total=False): @@ -1902,14 +1916,14 @@ class ContinuousEvaluationRuleAction(TypedDict, total=False): :ivar type: Required. Continuous evaluation. :vartype type: Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION] - :ivar evalId: Eval Id to add continuous evaluation runs to. Required. - :vartype evalId: str - :ivar maxHourlyRuns: Maximum number of evaluation runs allowed per hour. - :vartype maxHourlyRuns: int - :ivar samplingRate: Percentage (0-100] chance that a matching event triggers an evaluation. + :ivar eval_id: Eval Id to add continuous evaluation runs to. Required. + :vartype eval_id: str + :ivar max_hourly_runs: Maximum number of evaluation runs allowed per hour. + :vartype max_hourly_runs: int + :ivar sampling_rate: Percentage (0-100] chance that a matching event triggers an evaluation. When omitted, the service-default is to evaluate every event, which is equivalent to setting a sampling rate of 100. - :vartype samplingRate: float + :vartype sampling_rate: float """ type: Required[Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION]] @@ -1939,16 +1953,16 @@ class CosmosDBIndex(TypedDict, total=False): :vartype tags: dict[str, str] :ivar type: Type of index. Required. CosmosDB. :vartype type: Literal[IndexType.COSMOS_DB] - :ivar connectionName: Name of connection to CosmosDB. Required. - :vartype connectionName: str - :ivar databaseName: Name of the CosmosDB Database. Required. - :vartype databaseName: str - :ivar containerName: Name of CosmosDB Container. Required. - :vartype containerName: str - :ivar embeddingConfiguration: Embedding model configuration. Required. - :vartype embeddingConfiguration: "EmbeddingConfiguration" - :ivar fieldMapping: Field mapping configuration. Required. - :vartype fieldMapping: "FieldMapping" + :ivar connection_name: Name of connection to CosmosDB. Required. + :vartype connection_name: str + :ivar database_name: Name of the CosmosDB Database. Required. + :vartype database_name: str + :ivar container_name: Name of CosmosDB Container. Required. + :vartype container_name: str + :ivar embedding_configuration: Embedding model configuration. Required. + :vartype embedding_configuration: "EmbeddingConfiguration" + :ivar field_mapping: Field mapping configuration. Required. + :vartype field_mapping: "FieldMapping" """ id: str @@ -2001,12 +2015,12 @@ class CronTrigger(TypedDict, total=False): :vartype type: Literal[TriggerType.CRON] :ivar expression: Cron expression that defines the schedule frequency. Required. :vartype expression: str - :ivar timeZone: Time zone for the cron schedule. Defaults to ``UTC``. - :vartype timeZone: str - :ivar startTime: Start time for the cron schedule in ISO 8601 format. - :vartype startTime: str - :ivar endTime: End time for the cron schedule in ISO 8601 format. - :vartype endTime: str + :ivar time_zone: Time zone for the cron schedule. Defaults to ``UTC``. + :vartype time_zone: str + :ivar start_time: Start time for the cron schedule in ISO 8601 format. + :vartype start_time: str + :ivar end_time: End time for the cron schedule in ISO 8601 format. + :vartype end_time: str """ type: Required[Literal[TriggerType.CRON]] @@ -2388,11 +2402,11 @@ class Dimension(TypedDict, total=False): class EmbeddingConfiguration(TypedDict, total=False): """Embedding configuration class. - :ivar modelDeploymentName: Deployment name of embedding model. It can point to a model + :ivar model_deployment_name: Deployment name of embedding model. It can point to a model deployment either in the parent AIServices or a connection. Required. - :vartype modelDeploymentName: str - :ivar embeddingField: Embedding field. Required. - :vartype embeddingField: str + :vartype model_deployment_name: str + :ivar embedding_field: Embedding field. Required. + :vartype embedding_field: str """ modelDeploymentName: Required[str] @@ -2486,17 +2500,17 @@ class EvalResult(TypedDict, total=False): class EvalRunResultCompareItem(TypedDict, total=False): """Metric comparison for a treatment against the baseline. - :ivar treatmentRunId: The treatment run ID. Required. - :vartype treatmentRunId: str - :ivar treatmentRunSummary: Summary statistics of the treatment run. Required. - :vartype treatmentRunSummary: "EvalRunResultSummary" - :ivar deltaEstimate: Estimated difference between treatment and baseline. Required. - :vartype deltaEstimate: float - :ivar pValue: P-value for the treatment effect. Required. - :vartype pValue: float - :ivar treatmentEffect: Type of treatment effect. Required. Known values are: "TooFewSamples", + :ivar treatment_run_id: The treatment run ID. Required. + :vartype treatment_run_id: str + :ivar treatment_run_summary: Summary statistics of the treatment run. Required. + :vartype treatment_run_summary: "EvalRunResultSummary" + :ivar delta_estimate: Estimated difference between treatment and baseline. Required. + :vartype delta_estimate: float + :ivar p_value: P-value for the treatment effect. Required. + :vartype p_value: float + :ivar treatment_effect: Type of treatment effect. Required. Known values are: "TooFewSamples", "Inconclusive", "Changed", "Improved", and "Degraded". - :vartype treatmentEffect: Union[str, "TreatmentEffectType"] + :vartype treatment_effect: Union[str, "TreatmentEffectType"] """ treatmentRunId: Required[str] @@ -2515,16 +2529,16 @@ class EvalRunResultCompareItem(TypedDict, total=False): class EvalRunResultComparison(TypedDict, total=False): """Comparison results for treatment runs against the baseline. - :ivar testingCriteria: Name of the testing criteria. Required. - :vartype testingCriteria: str + :ivar testing_criteria: Name of the testing criteria. Required. + :vartype testing_criteria: str :ivar metric: Metric being evaluated. Required. :vartype metric: str :ivar evaluator: Name of the evaluator for this testing criteria. Required. :vartype evaluator: str - :ivar baselineRunSummary: Summary statistics of the baseline run. Required. - :vartype baselineRunSummary: "EvalRunResultSummary" - :ivar compareItems: List of comparison results for each treatment run. Required. - :vartype compareItems: list["EvalRunResultCompareItem"] + :ivar baseline_run_summary: Summary statistics of the baseline run. Required. + :vartype baseline_run_summary: "EvalRunResultSummary" + :ivar compare_items: List of comparison results for each treatment run. Required. + :vartype compare_items: list["EvalRunResultCompareItem"] """ testingCriteria: Required[str] @@ -2542,14 +2556,14 @@ class EvalRunResultComparison(TypedDict, total=False): class EvalRunResultSummary(TypedDict, total=False): """Summary statistics of a metric in an evaluation run. - :ivar runId: The evaluation run ID. Required. - :vartype runId: str - :ivar sampleCount: Number of samples in the evaluation run. Required. - :vartype sampleCount: int + :ivar run_id: The evaluation run ID. Required. + :vartype run_id: str + :ivar sample_count: Number of samples in the evaluation run. Required. + :vartype sample_count: int :ivar average: Average value of the metric in the evaluation run. Required. :vartype average: float - :ivar standardDeviation: Standard deviation of the metric in the evaluation run. Required. - :vartype standardDeviation: float + :ivar standard_deviation: Standard deviation of the metric in the evaluation run. Required. + :vartype standard_deviation: float """ runId: Required[str] @@ -2567,12 +2581,12 @@ class EvaluationComparisonInsightRequest(TypedDict, total=False): :ivar type: The type of request. Required. Evaluation Comparison. :vartype type: Literal[InsightType.EVALUATION_COMPARISON] - :ivar evalId: Identifier for the evaluation. Required. - :vartype evalId: str - :ivar baselineRunId: The baseline run ID for comparison. Required. - :vartype baselineRunId: str - :ivar treatmentRunIds: List of treatment run IDs for comparison. Required. - :vartype treatmentRunIds: list[str] + :ivar eval_id: Identifier for the evaluation. Required. + :vartype eval_id: str + :ivar baseline_run_id: The baseline run ID for comparison. Required. + :vartype baseline_run_id: str + :ivar treatment_run_ids: List of treatment run IDs for comparison. Required. + :vartype treatment_run_ids: list[str] """ type: Required[Literal[InsightType.EVALUATION_COMPARISON]] @@ -2611,12 +2625,12 @@ class EvaluationResultSample(TypedDict, total=False): :vartype id: str :ivar features: Features to help with additional filtering of data in UX. Required. :vartype features: dict[str, Any] - :ivar correlationInfo: Info about the correlation for the analysis sample. Required. - :vartype correlationInfo: dict[str, Any] + :ivar correlation_info: Info about the correlation for the analysis sample. Required. + :vartype correlation_info: dict[str, Any] :ivar type: Evaluation Result Sample Type. Required. A sample from the evaluation result. :vartype type: Literal[SampleType.EVALUATION_RESULT_SAMPLE] - :ivar evaluationResult: Evaluation result for the analysis sample. Required. - :vartype evaluationResult: "EvalResult" + :ivar evaluation_result: Evaluation result for the analysis sample. Required. + :vartype evaluation_result: "EvalResult" """ id: Required[str] @@ -2636,21 +2650,21 @@ class EvaluationRule(TypedDict, total=False): :ivar id: Unique identifier for the evaluation rule. Required. :vartype id: str - :ivar displayName: Display Name for the evaluation rule. - :vartype displayName: str + :ivar display_name: Display Name for the evaluation rule. + :vartype display_name: str :ivar description: Description for the evaluation rule. :vartype description: str :ivar action: Definition of the evaluation rule action. Required. :vartype action: "EvaluationRuleAction" :ivar filter: Filter condition of the evaluation rule. :vartype filter: "EvaluationRuleFilter" - :ivar eventType: Event type that the evaluation rule applies to. Required. Known values are: + :ivar event_type: Event type that the evaluation rule applies to. Required. Known values are: "responseCompleted" and "manual". - :vartype eventType: Union[str, "EvaluationRuleEventType"] + :vartype event_type: Union[str, "EvaluationRuleEventType"] :ivar enabled: Indicates whether the evaluation rule is enabled. Default is true. Required. :vartype enabled: bool - :ivar systemData: System metadata for the evaluation rule. Required. - :vartype systemData: dict[str, str] + :ivar system_data: System metadata for the evaluation rule. Required. + :vartype system_data: dict[str, str] """ id: Required[str] @@ -2675,8 +2689,8 @@ class EvaluationRule(TypedDict, total=False): class EvaluationRuleFilter(TypedDict, total=False): """Evaluation filter model. - :ivar agentName: Filter by agent name. Required. - :vartype agentName: str + :ivar agent_name: Filter by agent name. Required. + :vartype agent_name: str """ agentName: Required[str] @@ -2688,12 +2702,12 @@ class EvaluationRunClusterInsightRequest(TypedDict, total=False): :ivar type: The type of insights request. Required. Insights on an Evaluation run result. :vartype type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] - :ivar evalId: Evaluation Id for the insights. Required. - :vartype evalId: str - :ivar runIds: List of evaluation run IDs for the insights. Required. - :vartype runIds: list[str] - :ivar modelConfiguration: Configuration of the model used in the insight generation. - :vartype modelConfiguration: "InsightModelConfiguration" + :ivar eval_id: Evaluation Id for the insights. Required. + :vartype eval_id: str + :ivar run_ids: List of evaluation run IDs for the insights. Required. + :vartype run_ids: list[str] + :ivar model_configuration: Configuration of the model used in the insight generation. + :vartype model_configuration: "InsightModelConfiguration" """ type: Required[Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT]] @@ -2711,8 +2725,8 @@ class EvaluationRunClusterInsightResult(TypedDict, total=False): :ivar type: The type of insights result. Required. Insights on an Evaluation run result. :vartype type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] - :ivar clusterInsight: Required. - :vartype clusterInsight: "ClusterInsightResult" + :ivar cluster_insight: Required. + :vartype cluster_insight: "ClusterInsightResult" """ type: Required[Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT]] @@ -2728,10 +2742,10 @@ class EvaluationScheduleTask(TypedDict, total=False): :vartype configuration: dict[str, str] :ivar type: Required. Evaluation task. :vartype type: Literal[ScheduleTaskType.EVALUATION] - :ivar evalId: Identifier of the evaluation group. Required. - :vartype evalId: str - :ivar evalRun: The evaluation run payload. Required. - :vartype evalRun: dict[str, Any] + :ivar eval_id: Identifier of the evaluation group. Required. + :vartype eval_id: str + :ivar eval_run: The evaluation run payload. Required. + :vartype eval_run: dict[str, Any] """ configuration: dict[str, str] @@ -2757,10 +2771,10 @@ class EvaluationTaxonomy(TypedDict, total=False): :vartype description: str :ivar tags: Tag dictionary. Tags can be added, removed, and updated. :vartype tags: dict[str, str] - :ivar taxonomyInput: Input configuration for the evaluation taxonomy. Required. - :vartype taxonomyInput: "EvaluationTaxonomyInput" - :ivar taxonomyCategories: List of taxonomy categories. - :vartype taxonomyCategories: list["TaxonomyCategory"] + :ivar taxonomy_input: Input configuration for the evaluation taxonomy. Required. + :vartype taxonomy_input: "EvaluationTaxonomyInput" + :ivar taxonomy_categories: List of taxonomy categories. + :vartype taxonomy_categories: list["TaxonomyCategory"] :ivar properties: Additional properties for the evaluation taxonomy. :vartype properties: dict[str, str] """ @@ -3221,18 +3235,18 @@ class FabricIQPreviewToolboxTool(TypedDict, total=False): class FieldMapping(TypedDict, total=False): """Field mapping configuration class. - :ivar contentFields: List of fields with text content. Required. - :vartype contentFields: list[str] - :ivar filepathField: Path of file to be used as a source of text content. - :vartype filepathField: str - :ivar titleField: Field containing the title of the document. - :vartype titleField: str - :ivar urlField: Field containing the url of the document. - :vartype urlField: str - :ivar vectorFields: List of fields with vector content. - :vartype vectorFields: list[str] - :ivar metadataFields: List of fields with metadata content. - :vartype metadataFields: list[str] + :ivar content_fields: List of fields with text content. Required. + :vartype content_fields: list[str] + :ivar filepath_field: Path of file to be used as a source of text content. + :vartype filepath_field: str + :ivar title_field: Field containing the title of the document. + :vartype title_field: str + :ivar url_field: Field containing the url of the document. + :vartype url_field: str + :ivar vector_fields: List of fields with vector content. + :vartype vector_fields: list[str] + :ivar metadata_fields: List of fields with metadata content. + :vartype metadata_fields: list[str] """ contentFields: Required[list[str]] @@ -3294,16 +3308,16 @@ class FileDataGenerationJobSource(TypedDict, total=False): class FileDatasetVersion(TypedDict, total=False): """FileDatasetVersion Definition. - :ivar dataUri: URI of the data (`example `_). + :ivar data_uri: URI of the data (`example `_). Required. - :vartype dataUri: str - :ivar isReference: Indicates if the dataset holds a reference to the storage, or the dataset + :vartype data_uri: str + :ivar is_reference: Indicates if the dataset holds a reference to the storage, or the dataset manages storage itself. If true, the underlying data will not be deleted when the dataset version is deleted. - :vartype isReference: bool - :ivar connectionName: The Azure Storage Account connection name. Required if + :vartype is_reference: bool + :ivar connection_name: The Azure Storage Account connection name. Required if startPendingUploadVersion was not called before creating the Dataset. - :vartype connectionName: str + :vartype connection_name: str :ivar id: Asset ID, a unique identifier for the asset. :vartype id: str :ivar name: The name of the resource. Required. @@ -3449,16 +3463,16 @@ class FixedRatioVersionSelectionRule(TypedDict, total=False): class FolderDatasetVersion(TypedDict, total=False): """FileDatasetVersion Definition. - :ivar dataUri: URI of the data (`example `_). + :ivar data_uri: URI of the data (`example `_). Required. - :vartype dataUri: str - :ivar isReference: Indicates if the dataset holds a reference to the storage, or the dataset + :vartype data_uri: str + :ivar is_reference: Indicates if the dataset holds a reference to the storage, or the dataset manages storage itself. If true, the underlying data will not be deleted when the dataset version is deleted. - :vartype isReference: bool - :ivar connectionName: The Azure Storage Account connection name. Required if + :vartype is_reference: bool + :ivar connection_name: The Azure Storage Account connection name. Required if startPendingUploadVersion was not called before creating the Dataset. - :vartype connectionName: str + :vartype connection_name: str :ivar id: Asset ID, a unique identifier for the asset. :vartype id: str :ivar name: The name of the resource. Required. @@ -3643,6 +3657,70 @@ class FunctionToolParam(TypedDict, total=False): allowed_callers: Optional[list[Union[str, "CallableToolAllowedCaller"]]] +class GenerateVoiceAgentRequest(TypedDict, total=False): + """The inputs for generating a voice agent. Only ``kind`` and ``name`` are always required. The + authoring service expands these inputs into a full, editable ``VoiceAgentDefinition``, which is + then created through ``POST /agents``. The generated ``instructions`` and audio/voice settings + are stored as separate fields on the resulting agent definition, so the caller can edit or + override any of them afterward via standard agent versioning. + + :ivar kind: The agent kind. Always ``voice``. Required. VOICE. + :vartype kind: Literal[AgentKind.VOICE] + :ivar name: The unique name for the agent to create. Must be a non-empty DNS-like agent name. + Required. + :vartype name: str + :ivar model_type: Optional inference mode. When omitted, the authoring service uses + ``managed``. When supplied, use ``managed`` or ``self_deployed``. Known values are: "managed" + and "self_deployed". + :vartype model_type: Union[str, "VoiceModelType"] + :ivar model: Optional model identifier. Required when ``model_type`` is ``self_deployed``; + optional when ``model_type`` is ``managed`` or omitted. The service never invents a customer + deployment name. + :vartype model: str + :ivar use_case: An optional authoring use case. An empty string is accepted. + :vartype use_case: str + :ivar goal: An optional natural-language description of what the agent should do. When + supplied, it seeds the generated instructions. + :vartype goal: str + :ivar description: An optional agent description. The authoring service resolves its fallback + when omitted. + :vartype description: str + :ivar tools: Optional tools carried through verbatim onto the generated agent (see + ``VoiceAgentTool``). + :vartype tools: list["VoiceAgentTool"] + :ivar draft: (Preview) When ``true``, the generated voice agent is created as a draft — an + editable, unpublished version the caller can review and refine before publishing it via the + standard create/version path. The service defaults to ``false`` if a value is not specified by + the caller, in which case the agent is created and published normally. + :vartype draft: bool + """ + + kind: Required[Literal[AgentKind.VOICE]] + """The agent kind. Always ``voice``. Required. VOICE.""" + name: Required[str] + """The unique name for the agent to create. Must be a non-empty DNS-like agent name. Required.""" + model_type: Union[str, "VoiceModelType"] + """Optional inference mode. When omitted, the authoring service uses ``managed``. When supplied, + use ``managed`` or ``self_deployed``. Known values are: \"managed\" and \"self_deployed\".""" + model: str + """Optional model identifier. Required when ``model_type`` is ``self_deployed``; optional when + ``model_type`` is ``managed`` or omitted. The service never invents a customer deployment name.""" + use_case: str + """An optional authoring use case. An empty string is accepted.""" + goal: str + """An optional natural-language description of what the agent should do. When supplied, it seeds + the generated instructions.""" + description: str + """An optional agent description. The authoring service resolves its fallback when omitted.""" + tools: list["VoiceAgentTool"] + """Optional tools carried through verbatim onto the generated agent (see ``VoiceAgentTool``).""" + draft: bool + """(Preview) When ``true``, the generated voice agent is created as a draft — an editable, + unpublished version the caller can review and refine before publishing it via the standard + create/version path. The service defaults to ``false`` if a value is not specified by the + caller, in which case the agent is created and published normally.""" + + class GitHubIssueRoutineTrigger(TypedDict, total=False): """A GitHub issue routine trigger. @@ -3769,8 +3847,8 @@ class HumanEvaluationPreviewRuleAction(TypedDict, total=False): :ivar type: Required. Human evaluation preview. :vartype type: Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW] - :ivar templateId: Human evaluation template Id. Required. - :vartype templateId: str + :ivar template_id: Human evaluation template Id. Required. + :vartype template_id: str """ type: Required[Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW]] @@ -3966,15 +4044,15 @@ class InlineSkillSourceParam(TypedDict, total=False): class Insight(TypedDict, total=False): """The response body for cluster insights. - :ivar id: The unique identifier for the insights report. Required. - :vartype id: str + :ivar insight_id: The unique identifier for the insights report. Required. + :vartype insight_id: str :ivar metadata: Metadata about the insights report. Required. :vartype metadata: "InsightsMetadata" :ivar state: The current state of the insights. Required. Known values are: "NotStarted", "Running", "Succeeded", "Failed", and "Canceled". :vartype state: Union[str, "OperationState"] - :ivar displayName: User friendly display name for the insight. Required. - :vartype displayName: str + :ivar display_name: User friendly display name for the insight. Required. + :vartype display_name: str :ivar request: Request for the insights analysis. Required. :vartype request: "InsightRequest" :ivar result: The result of the insights report. @@ -4005,15 +4083,15 @@ class InsightCluster(TypedDict, total=False): :vartype label: str :ivar suggestion: Suggestion for the cluster. Required. :vartype suggestion: str - :ivar suggestionTitle: The title of the suggestion for the cluster. Required. - :vartype suggestionTitle: str + :ivar suggestion_title: The title of the suggestion for the cluster. Required. + :vartype suggestion_title: str :ivar description: Description of the analysis cluster. Required. :vartype description: str :ivar weight: The weight of the analysis cluster. This indicate number of samples in the cluster. Required. :vartype weight: int - :ivar subClusters: List of subclusters within this cluster. Empty if no subclusters exist. - :vartype subClusters: list["InsightCluster"] + :ivar sub_clusters: List of subclusters within this cluster. Empty if no subclusters exist. + :vartype sub_clusters: list["InsightCluster"] :ivar samples: List of samples that belong to this cluster. Empty if samples are part of subclusters. :vartype samples: list["InsightSample"] @@ -4040,9 +4118,10 @@ class InsightCluster(TypedDict, total=False): class InsightModelConfiguration(TypedDict, total=False): """Configuration of the model used in the insight generation. - :ivar modelDeploymentName: The model deployment to be evaluated. Accepts either the deployment - name alone or with the connection name as '{connectionName}/'. Required. - :vartype modelDeploymentName: str + :ivar model_deployment_name: The model deployment to be evaluated. Accepts either the + deployment name alone or with the connection name as '{connectionName}/'. + Required. + :vartype model_deployment_name: str """ modelDeploymentName: Required[str] @@ -4072,10 +4151,10 @@ class InsightScheduleTask(TypedDict, total=False): class InsightsMetadata(TypedDict, total=False): """Metadata about the insights. - :ivar createdAt: The timestamp when the insights were created. Required. - :vartype createdAt: str - :ivar completedAt: The timestamp when the insights were completed. - :vartype completedAt: str + :ivar created_at: The timestamp when the insights were created. Required. + :vartype created_at: str + :ivar completed_at: The timestamp when the insights were completed. + :vartype completed_at: str """ createdAt: Required[str] @@ -4087,12 +4166,12 @@ class InsightsMetadata(TypedDict, total=False): class InsightSummary(TypedDict, total=False): """Summary of the error cluster analysis. - :ivar sampleCount: Total number of samples analyzed. Required. - :vartype sampleCount: int - :ivar uniqueSubclusterCount: Total number of unique subcluster labels. Required. - :vartype uniqueSubclusterCount: int - :ivar uniqueClusterCount: Total number of unique clusters. Required. - :vartype uniqueClusterCount: int + :ivar sample_count: Total number of samples analyzed. Required. + :vartype sample_count: int + :ivar unique_subcluster_count: Total number of unique subcluster labels. Required. + :vartype unique_subcluster_count: int + :ivar unique_cluster_count: Total number of unique clusters. Required. + :vartype unique_cluster_count: int :ivar method: Method used for clustering. Required. :vartype method: str :ivar usage: Token usage while performing clustering analysis. Required. @@ -4228,8 +4307,8 @@ class LlmGeneratedVoiceGreetingConfig(TypedDict, total=False): :ivar prompt: The Handlebars prompt that guides the opening turn. Required. :vartype prompt: str :ivar tool_choice: The tool-selection policy for the opening response. Defaults to ``none``. Is - one of the following types: Union[str, "_models.ToolChoiceOptions"], ToolChoiceFunction, - ToolChoiceMCP + one of the following types: Literal["none"], Literal["auto"], Literal["required"], + ToolChoiceFunction, ToolChoiceMCP :vartype tool_choice: "_unions.VoiceAgentToolChoice" """ @@ -4239,7 +4318,8 @@ class LlmGeneratedVoiceGreetingConfig(TypedDict, total=False): """The Handlebars prompt that guides the opening turn. Required.""" tool_choice: "_unions.VoiceAgentToolChoice" """The tool-selection policy for the opening response. Defaults to ``none``. Is one of the - following types: Union[str, \"_models.ToolChoiceOptions\"], ToolChoiceFunction, ToolChoiceMCP""" + following types: Literal[\"none\"], Literal[\"auto\"], Literal[\"required\"], + ToolChoiceFunction, ToolChoiceMCP""" class LocalShellToolParam(TypedDict, total=False): @@ -4313,9 +4393,9 @@ class LoraConfig(TypedDict, total=False): :vartype rank: int :ivar alpha: LoRA scaling factor (α). Positive integer; typically 2× the rank. :vartype alpha: int - :ivar targetModules: Model layers modified by the adapter (e.g., q_proj, v_proj). Auto-detected - from adapter_config.json if omitted. - :vartype targetModules: list[str] + :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 """ @@ -4361,8 +4441,8 @@ class ManagedAzureAISearchIndex(TypedDict, total=False): :vartype tags: dict[str, str] :ivar type: Type of index. Required. Managed Azure Search. :vartype type: Literal[IndexType.MANAGED_AZURE_SEARCH] - :ivar vectorStoreId: Vector store id of managed index. Required. - :vartype vectorStoreId: str + :ivar vector_store_id: Vector store id of managed index. Required. + :vartype vector_store_id: str """ id: str @@ -4824,8 +4904,8 @@ class MicrosoftFabricPreviewTool(TypedDict, total=False): class ModelCredentialRequest(TypedDict, total=False): """Request to fetch credentials for a model asset. - :ivar blobUri: Blob URI of the model asset to fetch credentials for. Required. - :vartype blobUri: str + :ivar blob_uri: Blob URI of the model asset to fetch credentials for. Required. + :vartype blob_uri: str """ blobUri: Required[str] @@ -4835,14 +4915,14 @@ class ModelCredentialRequest(TypedDict, total=False): class ModelPendingUploadRequest(TypedDict, total=False): """Represents a request for a pending upload of a model version. - :ivar pendingUploadId: If PendingUploadId is not provided, a random GUID will be used. - :vartype pendingUploadId: str - :ivar connectionName: Azure Storage Account connection name to use for generating temporary SAS - token. - :vartype connectionName: str - :ivar pendingUploadType: The type of pending upload. Only TemporaryBlobReference is supported + :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 pendingUploadType: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] + :vartype pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] """ pendingUploadId: str @@ -4881,11 +4961,11 @@ class ModelSamplingParams(TypedDict, total=False): class ModelSourceData(TypedDict, total=False): """Source information for the model. - :ivar sourceType: The source type of the model. Known values are: "LocalUpload" and + :ivar source_type: The source type of the model. Known values are: "LocalUpload" and "TrainingJob". - :vartype sourceType: Union[str, "FoundryModelSourceType"] - :ivar jobId: The job ID that produced this model. - :vartype jobId: str + :vartype source_type: Union[str, "FoundryModelSourceType"] + :ivar job_id: The job ID that produced this model. + :vartype job_id: str """ sourceType: Union[str, "FoundryModelSourceType"] @@ -4897,21 +4977,21 @@ class ModelSourceData(TypedDict, total=False): class ModelVersion(TypedDict, total=False): """Model Version Definition. - :ivar blobUri: URI of the model artifact in blob storage. Required. - :vartype blobUri: str - :ivar weightType: The weight type of the model. Known values are: "FullWeight", "LoRA", and + :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 weightType: Union[str, "FoundryModelWeightType"] - :ivar baseModel: Base model asset ID. - :vartype baseModel: str + :vartype weight_type: Union[str, "FoundryModelWeightType"] + :ivar base_model: Base model asset ID. + :vartype base_model: str :ivar source: The source of the model. :vartype source: "ModelSourceData" - :ivar loraConfig: Adapter-specific configuration. Required when weight_type is lora; ignored + :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 loraConfig: "LoraConfig" - :ivar artifactProfile: The artifact profile of the model. - :vartype artifactProfile: "ArtifactProfile" + :vartype lora_config: "LoraConfig" + :ivar artifact_profile: The artifact profile of the model. + :vartype artifact_profile: "ArtifactProfile" :ivar warnings: Service-computed advisory warnings derived from the artifact profile. :vartype warnings: list["FoundryModelWarning"] :ivar id: Asset ID, a unique identifier for the asset. @@ -4959,8 +5039,8 @@ class MonthlyRecurrenceSchedule(TypedDict, total=False): :ivar type: Monthly recurrence type. Required. Monthly recurrence pattern. :vartype type: Literal[RecurrenceType.MONTHLY] - :ivar daysOfMonth: Days of the month for the recurrence schedule. Required. - :vartype daysOfMonth: list[int] + :ivar days_of_month: Days of the month for the recurrence schedule. Required. + :vartype days_of_month: list[int] """ type: Required[Literal[RecurrenceType.MONTHLY]] @@ -5065,10 +5145,10 @@ class OneTimeTrigger(TypedDict, total=False): :ivar type: Required. One-time trigger. :vartype type: Literal[TriggerType.ONE_TIME] - :ivar triggerAt: Date and time for the one-time trigger in ISO 8601 format. Required. - :vartype triggerAt: str - :ivar timeZone: Time zone for the one-time trigger. Defaults to ``UTC``. - :vartype timeZone: str + :ivar trigger_at: Date and time for the one-time trigger in ISO 8601 format. Required. + :vartype trigger_at: str + :ivar time_zone: Time zone for the one-time trigger. Defaults to ``UTC``. + :vartype time_zone: str """ type: Required[Literal[TriggerType.ONE_TIME]] @@ -5300,14 +5380,14 @@ class OtlpTelemetryEndpoint(TypedDict, total=False): class PendingUploadRequest(TypedDict, total=False): """Represents a request for a pending upload. - :ivar pendingUploadId: If PendingUploadId is not provided, a random GUID will be used. - :vartype pendingUploadId: str - :ivar connectionName: Azure Storage Account connection name to use for generating temporary SAS - token. - :vartype connectionName: str - :ivar pendingUploadType: The type of pending upload. Required. Deprecated: the service never + :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 pendingUploadType: Literal[PendingUploadType.BLOB_REFERENCE] + :vartype pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] """ pendingUploadId: str @@ -5646,123 +5726,6 @@ class RealtimeAudioFormatsAudioPcmu(TypedDict, total=False): """Required. AUDIO_PCMU.""" -class RealtimeConversationItemFunctionCall(TypedDict, total=False): - """Realtime function call item. - - :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: Literal["realtime.item"] - :ivar type: The type of the item. Always ``function_call``. Required. FUNCTION_CALL. - :vartype type: Literal[RealtimeConversationItemType.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: Literal["completed", "incomplete", "in_progress"] - :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 - """ - - id: str - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Literal["realtime.item"] - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - type: Required[Literal[RealtimeConversationItemType.FUNCTION_CALL]] - """The type of the item. Always ``function_call``. Required. FUNCTION_CALL.""" - status: Literal["completed", "incomplete", "in_progress"] - """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 - """The ID of the function call.""" - name: Required[str] - """The name of the function being called. Required.""" - arguments: Required[str] - """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.""" - - -class RealtimeConversationItemFunctionCallOutput(TypedDict, total=False): # pylint: disable=name-too-long - """Realtime function call output item. - - :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: Literal["realtime.item"] - :ivar type: The type of the item. Always ``function_call_output``. Required. - FUNCTION_CALL_OUTPUT. - :vartype type: Literal[RealtimeConversationItemType.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: Literal["completed", "incomplete", "in_progress"] - :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 - """ - - id: str - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Literal["realtime.item"] - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - type: Required[Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT]] - """The type of the item. Always ``function_call_output``. Required. FUNCTION_CALL_OUTPUT.""" - status: Literal["completed", "incomplete", "in_progress"] - """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: Required[str] - """The ID of the function call this output is for. Required.""" - output: Required[str] - """The output of the function call, this is free text and can contain any information or simply be - empty. Required.""" - - -class RealtimeConversationItemMessageAssistant(TypedDict, total=False): - """Realtime assistant message item. - - :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: Literal["realtime.item"] - :ivar type: The type of the item. Always ``message``. Required. Default value is "message". - :vartype type: Literal["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: Literal["completed", "incomplete", "in_progress"] - :ivar role: The role of the message sender. Always ``assistant``. Required. ASSISTANT. - :vartype role: Literal[RealtimeConversationItemMessageType.ASSISTANT] - :ivar content: The content of the message. Required. - :vartype content: list["RealtimeConversationItemMessageAssistantContent"] - """ - - id: str - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Literal["realtime.item"] - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - type: Required[Literal["message"]] - """The type of the item. Always ``message``. Required. Default value is \"message\".""" - status: Literal["completed", "incomplete", "in_progress"] - """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: Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] - """The role of the message sender. Always ``assistant``. Required. ASSISTANT.""" - content: Required[list["RealtimeConversationItemMessageAssistantContent"]] - """The content of the message. Required.""" - - class RealtimeConversationItemMessageAssistantContent(TypedDict, total=False): # pylint: disable=name-too-long """RealtimeConversationItemMessageAssistantContent. @@ -5783,42 +5746,6 @@ class RealtimeConversationItemMessageAssistantContent(TypedDict, total=False): transcript: str -class RealtimeConversationItemMessageSystem(TypedDict, total=False): - """Realtime system message item. - - :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: Literal["realtime.item"] - :ivar type: The type of the item. Always ``message``. Required. Default value is "message". - :vartype type: Literal["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: Literal["completed", "incomplete", "in_progress"] - :ivar role: The role of the message sender. Always ``system``. Required. SYSTEM. - :vartype role: Literal[RealtimeConversationItemMessageType.SYSTEM] - :ivar content: The content of the message. Required. - :vartype content: list["RealtimeConversationItemMessageSystemContent"] - """ - - id: str - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Literal["realtime.item"] - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - type: Required[Literal["message"]] - """The type of the item. Always ``message``. Required. Default value is \"message\".""" - status: Literal["completed", "incomplete", "in_progress"] - """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: Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] - """The role of the message sender. Always ``system``. Required. SYSTEM.""" - content: Required[list["RealtimeConversationItemMessageSystemContent"]] - """The content of the message. Required.""" - - class RealtimeConversationItemMessageSystemContent(TypedDict, total=False): # pylint: disable=name-too-long """RealtimeConversationItemMessageSystemContent. @@ -5833,42 +5760,6 @@ class RealtimeConversationItemMessageSystemContent(TypedDict, total=False): # p text: str -class RealtimeConversationItemMessageUser(TypedDict, total=False): - """Realtime user message item. - - :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: Literal["realtime.item"] - :ivar type: The type of the item. Always ``message``. Required. Default value is "message". - :vartype type: Literal["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: Literal["completed", "incomplete", "in_progress"] - :ivar role: The role of the message sender. Always ``user``. Required. USER. - :vartype role: Literal[RealtimeConversationItemMessageType.USER] - :ivar content: The content of the message. Required. - :vartype content: list["RealtimeConversationItemMessageUserContent"] - """ - - id: str - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Literal["realtime.item"] - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - type: Required[Literal["message"]] - """The type of the item. Always ``message``. Required. Default value is \"message\".""" - status: Literal["completed", "incomplete", "in_progress"] - """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: Required[Literal[RealtimeConversationItemMessageType.USER]] - """The role of the message sender. Always ``user``. Required. USER.""" - content: Required[list["RealtimeConversationItemMessageUserContent"]] - """The content of the message. Required.""" - - class RealtimeConversationItemMessageUserContent(TypedDict, total=False): # pylint: disable=name-too-long """RealtimeConversationItemMessageUserContent. @@ -5927,61 +5818,6 @@ class RealtimeFunctionToolParameters(TypedDict, total=False): """RealtimeFunctionToolParameters.""" -class RealtimeMCPApprovalRequest(TypedDict, total=False): - """Realtime MCP approval request. - - :ivar type: The type of the item. Always ``mcp_approval_request``. Required. - MCP_APPROVAL_REQUEST. - :vartype type: Literal[RealtimeConversationItemType.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 - """ - - type: Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST]] - """The type of the item. Always ``mcp_approval_request``. Required. MCP_APPROVAL_REQUEST.""" - id: Required[str] - """The unique ID of the approval request. Required.""" - server_label: Required[str] - """The label of the MCP server making the request. Required.""" - name: Required[str] - """The name of the tool to run. Required.""" - arguments: Required[str] - """A JSON string of arguments for the tool. Required.""" - - -class RealtimeMCPApprovalResponse(TypedDict, total=False): - """Realtime MCP approval response. - - :ivar type: The type of the item. Always ``mcp_approval_response``. Required. - MCP_APPROVAL_RESPONSE. - :vartype type: Literal[RealtimeConversationItemType.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 - """ - - type: Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE]] - """The type of the item. Always ``mcp_approval_response``. Required. MCP_APPROVAL_RESPONSE.""" - id: Required[str] - """The unique ID of the approval response. Required.""" - approval_request_id: Required[str] - """The ID of the approval request being answered. Required.""" - approve: Required[bool] - """Whether the request was approved. Required.""" - reason: Optional[str] - - class RealtimeMCPHTTPError(TypedDict, total=False): """Realtime MCP HTTP error. @@ -6001,29 +5837,6 @@ class RealtimeMCPHTTPError(TypedDict, total=False): """Required.""" -class RealtimeMCPListTools(TypedDict, total=False): - """Realtime MCP list tools. - - :ivar type: The type of the item. Always ``mcp_list_tools``. Required. MCP_LIST_TOOLS. - :vartype type: Literal[RealtimeConversationItemType.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["MCPListToolsTool"] - """ - - type: Required[Literal[RealtimeConversationItemType.MCP_LIST_TOOLS]] - """The type of the item. Always ``mcp_list_tools``. Required. MCP_LIST_TOOLS.""" - id: str - """The unique ID of the list.""" - server_label: Required[str] - """The label of the MCP server. Required.""" - tools: Required[list["MCPListToolsTool"]] - """The tools available on the server. Required.""" - - class RealtimeMCPProtocolError(TypedDict, total=False): """Realtime MCP protocol error. @@ -6043,42 +5856,6 @@ class RealtimeMCPProtocolError(TypedDict, total=False): """Required.""" -class RealtimeMCPToolCall(TypedDict, total=False): - """Realtime MCP tool call. - - :ivar type: The type of the item. Always ``mcp_call``. Required. MCP_CALL. - :vartype type: Literal[RealtimeConversationItemType.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: "RealtimeMCPError" - """ - - type: Required[Literal[RealtimeConversationItemType.MCP_CALL]] - """The type of the item. Always ``mcp_call``. Required. MCP_CALL.""" - id: Required[str] - """The unique ID of the tool call. Required.""" - server_label: Required[str] - """The label of the MCP server running the tool. Required.""" - name: Required[str] - """The name of the tool that was run. Required.""" - arguments: Required[str] - """A JSON string of the arguments passed to the tool. Required.""" - approval_request_id: Optional[str] - output: Optional[str] - error: "RealtimeMCPError" - - class RealtimeMCPToolExecutionError(TypedDict, total=False): """Realtime MCP tool execution error. @@ -6397,12 +6174,12 @@ class RecurrenceTrigger(TypedDict, total=False): :ivar type: Type of the trigger. Required. Recurrence based trigger. :vartype type: Literal[TriggerType.RECURRENCE] - :ivar startTime: Start time for the recurrence schedule in ISO 8601 format. - :vartype startTime: str - :ivar endTime: End time for the recurrence schedule in ISO 8601 format. - :vartype endTime: str - :ivar timeZone: Time zone for the recurrence schedule. Defaults to ``UTC``. - :vartype timeZone: str + :ivar start_time: Start time for the recurrence schedule in ISO 8601 format. + :vartype start_time: str + :ivar end_time: End time for the recurrence schedule in ISO 8601 format. + :vartype end_time: str + :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. @@ -6426,23 +6203,23 @@ class RecurrenceTrigger(TypedDict, total=False): class RedTeam(TypedDict, total=False): """Red team details. - :ivar id: Identifier of the red team run. Required. - :vartype id: str - :ivar displayName: Name of the red-team run. - :vartype displayName: str - :ivar numTurns: Number of simulation rounds. - :vartype numTurns: int - :ivar attackStrategies: List of attack strategies or nested lists of attack strategies. - :vartype attackStrategies: list[Union[str, "AttackStrategy"]] - :ivar simulationOnly: Simulation-only or Simulation + Evaluation. If ``true`` the scan outputs + :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[Union[str, "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 simulationOnly: bool - :ivar riskCategories: List of risk categories to generate attack objectives for. - :vartype riskCategories: list[Union[str, "RiskCategory"]] - :ivar applicationScenario: Application scenario for the red team operation, to generate + :vartype simulation_only: bool + :ivar risk_categories: List of risk categories to generate attack objectives for. + :vartype risk_categories: list[Union[str, "RiskCategory"]] + :ivar application_scenario: Application scenario for the red team operation, to generate scenario specific attacks. - :vartype applicationScenario: str + :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 @@ -6610,17 +6387,17 @@ class RubricGenerationInputQualityWarning(TypedDict, total=False): class Schedule(TypedDict, total=False): """Schedule model. - :ivar id: Identifier of the schedule. Required. - :vartype id: str - :ivar displayName: Name of the schedule. - :vartype displayName: str + :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 provisioningStatus: Provisioning status of the schedule. Known values are: "Creating", + :ivar provisioning_status: Provisioning status of the schedule. Known values are: "Creating", "Updating", "Deleting", "Succeeded", and "Failed". - :vartype provisioningStatus: Union[str, "ScheduleProvisioningStatus"] + :vartype provisioning_status: Union[str, "ScheduleProvisioningStatus"] :ivar trigger: Trigger for the schedule. Required. :vartype trigger: "Trigger" :ivar task: Task for the schedule. Required. @@ -6630,8 +6407,8 @@ class Schedule(TypedDict, total=False): :ivar properties: Schedule's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed. :vartype properties: dict[str, str] - :ivar systemData: System metadata for the resource. Required. - :vartype systemData: dict[str, str] + :ivar system_data: System metadata for the resource. Required. + :vartype system_data: dict[str, str] """ id: Required[str] @@ -6740,6 +6517,35 @@ class SimpleQnADataGenerationJobOptions(TypedDict, total=False): """The question types to generate. Used only for fine-tuning scenarios.""" +class SimulationSeedDataGenerationJobOptions(TypedDict, total=False): + """The options for a simulation seed 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 max_samples: Maximum number of samples to generate. Required. + :vartype max_samples: int + :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: "DataGenerationModelOptions" + :ivar type: The data generation job type, which is SimulationSeed for this model. Required. + Simulation seed for evaluation scenarios. + :vartype type: Literal[DataGenerationJobType.SIMULATION_SEED] + """ + + max_samples: Required[int] + """Maximum number of samples to generate. Required.""" + train_split: float + """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.""" + model_options: "DataGenerationModelOptions" + """The LLM model options.""" + type: Required[Literal[DataGenerationJobType.SIMULATION_SEED]] + """The data generation job type, which is SimulationSeed for this model. Required. Simulation seed + for evaluation scenarios.""" + + class SkillInlineContent(TypedDict, total=False): """Inline content for defining a simple skill without uploading files. Follows the agentskills.io SKILL.md specification. @@ -6879,35 +6685,6 @@ class StructuredOutputDefinition(TypedDict, total=False): """Whether to enforce strict validation. Default ``true``. Required.""" -class SimulationSeedDataGenerationJobOptions(TypedDict, total=False): - """The options for a simulation seed 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 max_samples: Maximum number of samples to generate. Required. - :vartype max_samples: int - :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: "DataGenerationModelOptions" - :ivar type: The data generation job type, which is SimulationSeed for this model. Required. - Simulation seed for evaluation scenarios. - :vartype type: Literal[DataGenerationJobType.SIMULATION_SEED] - """ - - max_samples: Required[int] - """Maximum number of samples to generate. Required.""" - train_split: float - """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.""" - model_options: "DataGenerationModelOptions" - """The LLM model options.""" - type: Required[Literal[DataGenerationJobType.SIMULATION_SEED]] - """The data generation job type, which is SimulationSeed for this model. Required. Simulation seed - for evaluation scenarios.""" - - class TaxonomyCategory(TypedDict, total=False): """Taxonomy category definition. @@ -6917,13 +6694,13 @@ class TaxonomyCategory(TypedDict, total=False): :vartype name: str :ivar description: Description of the taxonomy category. :vartype description: str - :ivar riskCategory: Risk category associated with this taxonomy category. Required. Known + :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 riskCategory: Union[str, "RiskCategory"] - :ivar subCategories: List of taxonomy sub categories. Required. - :vartype subCategories: list["TaxonomySubCategory"] + :vartype risk_category: Union[str, "RiskCategory"] + :ivar sub_categories: List of taxonomy sub categories. Required. + :vartype sub_categories: list["TaxonomySubCategory"] :ivar properties: Additional properties for the taxonomy category. :vartype properties: dict[str, str] """ @@ -7453,6 +7230,9 @@ class TracesDataGenerationJobOptions(TypedDict, total=False): :ivar type: The data generation job type, which is Traces for this model. Required. Single turn query and response from agent traces. :vartype type: Literal[DataGenerationJobType.TRACES] + :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 """ max_samples: Required[int] @@ -7465,6 +7245,9 @@ class TracesDataGenerationJobOptions(TypedDict, total=False): type: Required[Literal[DataGenerationJobType.TRACES]] """The data generation job type, which is Traces for this model. Required. Single turn query and response from agent traces.""" + redact_private_content: bool + """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.""" class TracesDataGenerationJobSource(TypedDict, total=False): @@ -7765,8 +7548,6 @@ class VoiceAgentAvatarVideoParams(TypedDict, total=False): :ivar bitrate: :vartype bitrate: int - :ivar codec: Default value is "h264". - :vartype codec: Literal["h264"] :ivar crop: :vartype crop: "VoiceAgentAvatarVideoCrop" :ivar resolution: @@ -7778,8 +7559,6 @@ class VoiceAgentAvatarVideoParams(TypedDict, total=False): """ bitrate: int - codec: Literal["h264"] - """Default value is \"h264\".""" crop: "VoiceAgentAvatarVideoCrop" resolution: "VoiceAgentAvatarVideoResolution" background: "VoiceAgentAvatarVideoBackground" @@ -7815,9 +7594,8 @@ class VoiceAgentClientEventConversationItemCreate(TypedDict, total=False): # py 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: The conversation item to create. Required. Is either a - "_unions.VoiceAgentRequestConversationItem" type or a RealtimeMCPApprovalResponse type. - :vartype item: "_unions.VoiceAgentCreateConversationItem" + :ivar item: The conversation item to create. Required. + :vartype item: "VoiceConversationItem" """ event_id: str @@ -7830,9 +7608,8 @@ class VoiceAgentClientEventConversationItemCreate(TypedDict, total=False): # py 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: Required["_unions.VoiceAgentCreateConversationItem"] - """The conversation item to create. Required. Is either a - \"_unions.VoiceAgentRequestConversationItem\" type or a RealtimeMCPApprovalResponse type.""" + item: Required["VoiceConversationItem"] + """The conversation item to create. Required.""" class VoiceAgentClientEventConversationItemDelete(TypedDict, total=False): # pylint: disable=name-too-long @@ -8118,7 +7895,8 @@ class VoiceAgentDefinition(TypedDict, total=False): :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: Union[str, "_models.ToolChoiceOptions"], ToolChoiceFunction, ToolChoiceMCP + the following types: Literal["none"], Literal["auto"], Literal["required"], ToolChoiceFunction, + ToolChoiceMCP :vartype tool_choice: "_unions.VoiceAgentToolChoice" :ivar parallel_tool_calls: Whether the model may call multiple tools in parallel. :vartype parallel_tool_calls: bool @@ -8183,7 +7961,7 @@ class VoiceAgentDefinition(TypedDict, total=False): """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: - Union[str, \"_models.ToolChoiceOptions\"], ToolChoiceFunction, ToolChoiceMCP""" + Literal[\"none\"], Literal[\"auto\"], Literal[\"required\"], ToolChoiceFunction, ToolChoiceMCP""" parallel_tool_calls: bool """Whether the model may call multiple tools in parallel.""" structured_inputs: dict[str, "StructuredInputDefinition"] @@ -8255,7 +8033,7 @@ class VoiceAgentLlmInterimResponseConfig(TypedDict, total=False): :ivar triggers: Conditions that may trigger one interim response. :vartype triggers: list[Union[str, "VoiceAgentInterimResponseTrigger"]] :ivar latency_threshold_ms: The latency threshold in milliseconds. - :vartype latency_threshold_ms: int + :vartype latency_threshold_ms: str :ivar type: Required. Default value is "llm_interim_response". :vartype type: Literal["llm_interim_response"] :ivar model: The model used to generate interim responses. @@ -8268,7 +8046,7 @@ class VoiceAgentLlmInterimResponseConfig(TypedDict, total=False): triggers: list[Union[str, "VoiceAgentInterimResponseTrigger"]] """Conditions that may trigger one interim response.""" - latency_threshold_ms: int + latency_threshold_ms: str """The latency threshold in milliseconds.""" type: Required[Literal["llm_interim_response"]] """Required. Default value is \"llm_interim_response\".""" @@ -8388,13 +8166,13 @@ class VoiceAgentRealtimeResponse(OmitPropertiesRealtimeResponse1): locale, and format fields under ``output``. :vartype audio: "VoiceResponseAudio" :ivar output: The items produced by the live response. - :vartype output: list["_unions.VoiceAgentResponseItem"] + :vartype output: list["VoiceConversationItem"] """ audio: "VoiceResponseAudio" """The audio configuration used by the live response, including flat voice provider, locale, and format fields under ``output``.""" - output: list["_unions.VoiceAgentResponseItem"] + output: list["VoiceConversationItem"] """The items produced by the live response.""" @@ -8434,18 +8212,15 @@ class VoiceAgentResponseCreateParams(TypedDict, total=False): :vartype conversation: Union[Literal["auto"], Literal["none"], str] :ivar metadata: :vartype metadata: "Metadata" - :ivar input: Input items to include in the prompt for the model. Using this field creates a new - context for this Response instead of using the default conversation. An empty array ``[]`` will - clear the context for this Response. Note that this can include references to items that - previously appeared in the session using their id. - :vartype input: list["RealtimeConversationItem"] :ivar output_modalities: Modalities that the response may return. :vartype output_modalities: list[Union[str, "VoiceOutputModality"]] :ivar audio: Response-specific audio settings. :vartype audio: "PickPropertiesVoiceAudioConfig" + :ivar input: Conversation items used as inline response input. + :vartype input: list["VoiceConversationItem"] :ivar pre_generated_assistant_message: A pre-generated assistant message used to begin the response. - :vartype pre_generated_assistant_message: "RealtimeConversationItemMessageAssistant" + :vartype pre_generated_assistant_message: "VoiceAssistantMessageItem" :ivar interim_response: Interim-response settings for this response. Is either a VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. :vartype interim_response: "_unions.VoiceAgentInterimResponse" @@ -8482,16 +8257,13 @@ class VoiceAgentResponseCreateParams(TypedDict, total=False): response which will not add items to default conversation. Is one of the following types: Literal[\"auto\"], Literal[\"none\"], str""" metadata: Optional["Metadata"] - input: list["RealtimeConversationItem"] - """Input items to include in the prompt for the model. Using this field creates a new context for - this Response instead of using the default conversation. An empty array ``[]`` will clear the - context for this Response. Note that this can include references to items that previously - appeared in the session using their id.""" output_modalities: list[Union[str, "VoiceOutputModality"]] """Modalities that the response may return.""" audio: "PickPropertiesVoiceAudioConfig" """Response-specific audio settings.""" - pre_generated_assistant_message: Optional["RealtimeConversationItemMessageAssistant"] + input: list["VoiceConversationItem"] + """Conversation items used as inline response input.""" + pre_generated_assistant_message: Optional["VoiceAssistantMessageItem"] """A pre-generated assistant message used to begin the response.""" interim_response: Optional["_unions.VoiceAgentInterimResponse"] """Interim-response settings for this response. Is either a VoiceAgentStaticInterimResponseConfig @@ -8560,11 +8332,8 @@ class VoiceAgentServerEventConversationItemAdded(TypedDict, total=False): # pyl :vartype type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED] :ivar previous_item_id: :vartype previous_item_id: str - :ivar item: The item added to the conversation. Required. Is one of the following types: - "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem - :vartype item: "_unions.VoiceAgentResponseItem" + :ivar item: The item added to the conversation. Required. + :vartype item: "VoiceConversationItem" """ event_id: Required[str] @@ -8572,11 +8341,8 @@ class VoiceAgentServerEventConversationItemAdded(TypedDict, total=False): # pyl type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED]] """The event type, must be ``conversation.item.added``. Required. CONVERSATION_ITEM_ADDED.""" previous_item_id: Optional[str] - item: Required["_unions.VoiceAgentResponseItem"] - """The item added to the conversation. Required. Is one of the following types: - \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem""" + item: Required["VoiceConversationItem"] + """The item added to the conversation. Required.""" class VoiceAgentServerEventConversationItemCreated(TypedDict, total=False): # pylint: disable=name-too-long @@ -8589,11 +8355,8 @@ class VoiceAgentServerEventConversationItemCreated(TypedDict, total=False): # p :vartype type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED] :ivar previous_item_id: :vartype previous_item_id: str - :ivar item: The created conversation item. Required. Is one of the following types: - "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem - :vartype item: "_unions.VoiceAgentResponseItem" + :ivar item: The created conversation item. Required. + :vartype item: "VoiceConversationItem" """ event_id: Required[str] @@ -8601,11 +8364,8 @@ class VoiceAgentServerEventConversationItemCreated(TypedDict, total=False): # p type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED]] """The event type, must be ``conversation.item.created``. Required. CONVERSATION_ITEM_CREATED.""" previous_item_id: Optional[str] - item: Required["_unions.VoiceAgentResponseItem"] - """The created conversation item. Required. Is one of the following types: - \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem""" + item: Required["VoiceConversationItem"] + """The created conversation item. Required.""" class VoiceAgentServerEventConversationItemDeleted(TypedDict, total=False): # pylint: disable=name-too-long @@ -8638,11 +8398,8 @@ class VoiceAgentServerEventConversationItemDone(TypedDict, total=False): # pyli :vartype type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE] :ivar previous_item_id: :vartype previous_item_id: str - :ivar item: The completed conversation item. Required. Is one of the following types: - "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem - :vartype item: "_unions.VoiceAgentResponseItem" + :ivar item: The completed conversation item. Required. + :vartype item: "VoiceConversationItem" """ event_id: Required[str] @@ -8650,11 +8407,8 @@ class VoiceAgentServerEventConversationItemDone(TypedDict, total=False): # pyli type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE]] """The event type, must be ``conversation.item.done``. Required. CONVERSATION_ITEM_DONE.""" previous_item_id: Optional[str] - item: Required["_unions.VoiceAgentResponseItem"] - """The completed conversation item. Required. Is one of the following types: - \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem""" + item: Required["VoiceConversationItem"] + """The completed conversation item. Required.""" class VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted( @@ -8827,22 +8581,16 @@ class VoiceAgentServerEventConversationItemRetrieved(TypedDict, total=False): # :ivar type: The event type, must be ``conversation.item.retrieved``. Required. CONVERSATION_ITEM_RETRIEVED. :vartype type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED] - :ivar item: The retrieved conversation item. Required. Is one of the following types: - "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem - :vartype item: "_unions.VoiceAgentResponseItem" + :ivar item: The retrieved conversation item. Required. + :vartype item: "VoiceConversationItem" """ event_id: Required[str] """The unique ID of the server event. Required.""" type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED]] """The event type, must be ``conversation.item.retrieved``. Required. CONVERSATION_ITEM_RETRIEVED.""" - item: Required["_unions.VoiceAgentResponseItem"] - """The retrieved conversation item. Required. Is one of the following types: - \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem""" + item: Required["VoiceConversationItem"] + """The retrieved conversation item. Required.""" class VoiceAgentServerEventConversationItemTruncated(TypedDict, total=False): # pylint: disable=name-too-long @@ -8861,7 +8609,7 @@ class VoiceAgentServerEventConversationItemTruncated(TypedDict, total=False): # Required. :vartype audio_end_ms: int :ivar item: The assistant message after truncation, when the service returns the updated item. - :vartype item: "RealtimeConversationItemMessageAssistant" + :vartype item: "VoiceAssistantMessageItem" """ event_id: Required[str] @@ -8874,7 +8622,7 @@ class VoiceAgentServerEventConversationItemTruncated(TypedDict, total=False): # """The index of the content part that was truncated. Required.""" audio_end_ms: Required[int] """The duration up to which the audio was truncated, in milliseconds. Required.""" - item: "RealtimeConversationItemMessageAssistant" + item: "VoiceAssistantMessageItem" """The assistant message after truncation, when the service returns the updated item.""" @@ -9190,7 +8938,7 @@ class VoiceAgentServerEventResponseAnimationVisemeDelta(TypedDict, total=False): :ivar content_index: Required. :vartype content_index: int :ivar audio_offset_ms: Required. - :vartype audio_offset_ms: int + :vartype audio_offset_ms: str :ivar viseme_id: Required. :vartype viseme_id: int """ @@ -9207,7 +8955,7 @@ class VoiceAgentServerEventResponseAnimationVisemeDelta(TypedDict, total=False): """Required.""" content_index: Required[int] """Required.""" - audio_offset_ms: Required[int] + audio_offset_ms: Required[str] """Required.""" viseme_id: Required[int] """Required.""" @@ -9328,9 +9076,9 @@ class VoiceAgentServerEventResponseAudioTimestampDelta(TypedDict, total=False): :ivar content_index: Required. :vartype content_index: int :ivar audio_offset_ms: Required. - :vartype audio_offset_ms: int + :vartype audio_offset_ms: str :ivar audio_duration_ms: Required. - :vartype audio_duration_ms: int + :vartype audio_duration_ms: str :ivar text: Required. :vartype text: str :ivar timestamp_type: Required. Default value is "word". @@ -9349,9 +9097,9 @@ class VoiceAgentServerEventResponseAudioTimestampDelta(TypedDict, total=False): """Required.""" content_index: Required[int] """Required.""" - audio_offset_ms: Required[int] + audio_offset_ms: Required[str] """Required.""" - audio_duration_ms: Required[int] + audio_duration_ms: Required[str] """Required.""" text: Required[str] """Required.""" @@ -9770,11 +9518,8 @@ class VoiceAgentServerEventResponseOutputItemAdded(TypedDict, total=False): # p :vartype response_id: str :ivar output_index: The index of the output item in the Response. Required. :vartype output_index: int - :ivar item: The output item that was added. Required. Is one of the following types: - "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem - :vartype item: "_unions.VoiceAgentResponseItem" + :ivar item: The output item that was added. Required. + :vartype item: "VoiceConversationItem" """ event_id: Required[str] @@ -9785,11 +9530,8 @@ class VoiceAgentServerEventResponseOutputItemAdded(TypedDict, total=False): # p """The ID of the Response to which the item belongs. Required.""" output_index: Required[int] """The index of the output item in the Response. Required.""" - item: Required["_unions.VoiceAgentResponseItem"] - """The output item that was added. Required. Is one of the following types: - \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem""" + item: Required["VoiceConversationItem"] + """The output item that was added. Required.""" class VoiceAgentServerEventResponseOutputItemDone(TypedDict, total=False): # pylint: disable=name-too-long @@ -9804,11 +9546,8 @@ class VoiceAgentServerEventResponseOutputItemDone(TypedDict, total=False): # py :vartype response_id: str :ivar output_index: The index of the output item in the Response. Required. :vartype output_index: int - :ivar item: The output item that finished streaming. Required. Is one of the following types: - "_unions.VoiceAgentResponseMessageItem", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem - :vartype item: "_unions.VoiceAgentResponseItem" + :ivar item: The output item that finished streaming. Required. + :vartype item: "VoiceConversationItem" """ event_id: Required[str] @@ -9819,11 +9558,8 @@ class VoiceAgentServerEventResponseOutputItemDone(TypedDict, total=False): # py """The ID of the Response to which the item belongs. Required.""" output_index: Required[int] """The index of the output item in the Response. Required.""" - item: Required["_unions.VoiceAgentResponseItem"] - """The output item that finished streaming. Required. Is one of the following types: - \"_unions.VoiceAgentResponseMessageItem\", VoiceFunctionCallItem, VoiceFunctionCallOutputItem, - VoiceMcpListToolsItem, VoiceMcpCallItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem""" + item: Required["VoiceConversationItem"] + """The output item that finished streaming. Required.""" class VoiceAgentServerEventResponseTextDelta(TypedDict, total=False): @@ -9987,6 +9723,9 @@ class VoiceAgentServerEventSessionCreated(TypedDict, total=False): :vartype event_id: str :ivar type: The event type, must be ``session.created``. Required. SESSION_CREATED. :vartype type: Literal[RealtimeServerEventType.SESSION_CREATED] + :ivar conversation_id: The id of the persisted conversation. Only present when conversation + persistence is enabled for the session. + :vartype conversation_id: str :ivar session: The initial effective voice-agent session configuration. Required. :vartype session: "VoiceAgentSessionResponseConfig" """ @@ -9995,6 +9734,9 @@ class VoiceAgentServerEventSessionCreated(TypedDict, total=False): """The unique ID of the server event. Required.""" type: Required[Literal[RealtimeServerEventType.SESSION_CREATED]] """The event type, must be ``session.created``. Required. SESSION_CREATED.""" + conversation_id: str + """The id of the persisted conversation. Only present when conversation persistence is enabled for + the session.""" session: Required["VoiceAgentSessionResponseConfig"] """The initial effective voice-agent session configuration. Required.""" @@ -10152,7 +9894,7 @@ class VoiceAgentSessionResponseConfig(TypedDict, total=False): :ivar tools: Tools available to the session. :vartype tools: list["VoiceAgentTool"] :ivar tool_choice: Tool-selection behavior for the session. Is one of the following types: - Union[str, "_models.ToolChoiceOptions"], ToolChoiceFunction, ToolChoiceMCP + Literal["none"], Literal["auto"], Literal["required"], ToolChoiceFunction, ToolChoiceMCP :vartype tool_choice: "_unions.VoiceAgentToolChoice" :ivar reasoning: Reasoning settings for compatible realtime models. :vartype reasoning: "RealtimeReasoning" @@ -10198,8 +9940,8 @@ class VoiceAgentSessionResponseConfig(TypedDict, total=False): tools: list["VoiceAgentTool"] """Tools available to the session.""" tool_choice: "_unions.VoiceAgentToolChoice" - """Tool-selection behavior for the session. Is one of the following types: Union[str, - \"_models.ToolChoiceOptions\"], ToolChoiceFunction, ToolChoiceMCP""" + """Tool-selection behavior for the session. Is one of the following types: Literal[\"none\"], + Literal[\"auto\"], Literal[\"required\"], ToolChoiceFunction, ToolChoiceMCP""" reasoning: "RealtimeReasoning" """Reasoning settings for compatible realtime models.""" parallel_tool_calls: bool @@ -10246,7 +9988,7 @@ class VoiceAgentSessionUpdateConfig(TypedDict, total=False): :ivar tools: Tools available to the session. :vartype tools: list["VoiceAgentTool"] :ivar tool_choice: Tool-selection behavior for the session. Is one of the following types: - Union[str, "_models.ToolChoiceOptions"], ToolChoiceFunction, ToolChoiceMCP + Literal["none"], Literal["auto"], Literal["required"], ToolChoiceFunction, ToolChoiceMCP :vartype tool_choice: "_unions.VoiceAgentToolChoice" :ivar reasoning: Reasoning settings for compatible realtime models. :vartype reasoning: "RealtimeReasoning" @@ -10283,8 +10025,8 @@ class VoiceAgentSessionUpdateConfig(TypedDict, total=False): tools: list["VoiceAgentTool"] """Tools available to the session.""" tool_choice: "_unions.VoiceAgentToolChoice" - """Tool-selection behavior for the session. Is one of the following types: Union[str, - \"_models.ToolChoiceOptions\"], ToolChoiceFunction, ToolChoiceMCP""" + """Tool-selection behavior for the session. Is one of the following types: Literal[\"none\"], + Literal[\"auto\"], Literal[\"required\"], ToolChoiceFunction, ToolChoiceMCP""" reasoning: "RealtimeReasoning" """Reasoning settings for compatible realtime models.""" parallel_tool_calls: bool @@ -10306,7 +10048,7 @@ class VoiceAgentStaticInterimResponseConfig(TypedDict, total=False): :ivar triggers: Conditions that may trigger one interim response. :vartype triggers: list[Union[str, "VoiceAgentInterimResponseTrigger"]] :ivar latency_threshold_ms: The latency threshold in milliseconds. - :vartype latency_threshold_ms: int + :vartype latency_threshold_ms: str :ivar type: Required. Default value is "static_interim_response". :vartype type: Literal["static_interim_response"] :ivar texts: Candidate text values for the interim response. @@ -10315,7 +10057,7 @@ class VoiceAgentStaticInterimResponseConfig(TypedDict, total=False): triggers: list[Union[str, "VoiceAgentInterimResponseTrigger"]] """Conditions that may trigger one interim response.""" - latency_threshold_ms: int + latency_threshold_ms: str """The latency threshold in milliseconds.""" type: Required[Literal["static_interim_response"]] """Required. Default value is \"static_interim_response\".""" @@ -10328,9 +10070,9 @@ class VoiceAgentTranscriptionPhrase(TypedDict, total=False): :ivar offset_milliseconds: The phrase offset from the beginning of the audio, in milliseconds. Required. - :vartype offset_milliseconds: int + :vartype offset_milliseconds: str :ivar duration_milliseconds: The phrase duration in milliseconds. Required. - :vartype duration_milliseconds: int + :vartype duration_milliseconds: str :ivar text: The transcribed phrase text. Required. :vartype text: str :ivar words: Word-level timing details, when available. @@ -10341,9 +10083,9 @@ class VoiceAgentTranscriptionPhrase(TypedDict, total=False): :vartype confidence: float """ - offset_milliseconds: Required[int] + offset_milliseconds: Required[str] """The phrase offset from the beginning of the audio, in milliseconds. Required.""" - duration_milliseconds: Required[int] + duration_milliseconds: Required[str] """The phrase duration in milliseconds. Required.""" text: Required[str] """The transcribed phrase text. Required.""" @@ -10362,16 +10104,16 @@ class VoiceAgentTranscriptionWord(TypedDict, total=False): :vartype text: str :ivar offset_milliseconds: The word offset from the beginning of the audio, in milliseconds. Required. - :vartype offset_milliseconds: int + :vartype offset_milliseconds: str :ivar duration_milliseconds: The word duration in milliseconds. Required. - :vartype duration_milliseconds: int + :vartype duration_milliseconds: str """ text: Required[str] """The transcribed word text. Required.""" - offset_milliseconds: Required[int] + offset_milliseconds: Required[str] """The word offset from the beginning of the audio, in milliseconds. Required.""" - duration_milliseconds: Required[int] + duration_milliseconds: Required[str] """The word duration in milliseconds. Required.""" @@ -10500,14 +10242,13 @@ class VoiceAudioOutputConfig(TypedDict, total=False): * `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`. + `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. + `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 @@ -10517,10 +10258,9 @@ class VoiceAudioOutputConfig(TypedDict, total=False): ``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``. The - string is extensible so future values do not require SDK type changes. - :vartype voice_type: 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: Union[str, "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 @@ -10564,10 +10304,9 @@ class VoiceAudioOutputConfig(TypedDict, total=False): """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: str - """The voice implementation. Known values are ``openai``, ``azure-standard``, ``azure-custom``, - ``azure-personal``, ``avatar-voice-sync``, and ``azure-realtime-native``. The string is - extensible so future values do not require SDK type changes.""" + voice_type: Union[str, "VoiceType"] + """The voice implementation. Known values are: \"openai\", \"azure-standard\", \"azure-custom\", + \"azure-personal\", \"avatar-voice-sync\", and \"azure-realtime-native\".""" voice_locale: str """The enforced BCP-47 output locale. Applies to ``azure-standard``, ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``.""" @@ -10919,12 +10658,12 @@ class VoiceInputTranscription(TypedDict, total=False): ``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: Literal["minimal", "low", "medium", "high", "xhigh"] - :ivar model: The transcription model to use. 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". + :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: Union[str, "VoiceInputTranscriptionModel"] - :ivar custom_speech: Optional custom speech model configuration, keyed by locale. + :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] @@ -10946,12 +10685,12 @@ class VoiceInputTranscription(TypedDict, total=False): GA Realtime sessions. Is one of the following types: Literal[\"minimal\"], Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"], Literal[\"xhigh\"]""" model: Required[Union[str, "VoiceInputTranscriptionModel"]] - """The transcription model to use. 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\".""" + """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: dict[str, str] - """Optional custom speech model configuration, keyed by locale.""" + """Optional customer custom speech deployment configuration, keyed by locale.""" phrase_list: list[str] """Optional phrase hints that bias recognition toward domain terms.""" @@ -11131,8 +10870,9 @@ class VoiceResponseAudioOutput(TypedDict, total=False): :ivar voice: The voice name used for the response's audio output. :vartype voice: str :ivar voice_type: The extensible provider/type of the voice used for the response's audio - output. - :vartype voice_type: str + output. Known values are: "openai", "azure-standard", "azure-custom", "azure-personal", + "avatar-voice-sync", and "azure-realtime-native". + :vartype voice_type: Union[str, "VoiceType"] :ivar voice_locale: The BCP-47 locale of the voice used for the response's audio output. :vartype voice_locale: str :ivar format: The audio format used for the response's audio output. @@ -11141,8 +10881,10 @@ class VoiceResponseAudioOutput(TypedDict, total=False): voice: str """The voice name used for the response's audio output.""" - voice_type: str - """The extensible provider/type of the voice used for the response's audio output.""" + voice_type: Union[str, "VoiceType"] + """The extensible provider/type of the voice used for the response's audio output. Known values + are: \"openai\", \"azure-standard\", \"azure-custom\", \"azure-personal\", + \"avatar-voice-sync\", and \"azure-realtime-native\".""" voice_locale: str """The BCP-47 locale of the voice used for the response's audio output.""" format: "RealtimeAudioFormats" @@ -11171,7 +10913,7 @@ class VoiceServerVadTurnDetection(TypedDict, total=False): :vartype type: Literal[VoiceTurnDetectionType.SERVER_VAD] :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in milliseconds. - :vartype speech_duration_ms: int + :vartype speech_duration_ms: str :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. Set to null to disable it. :vartype end_of_utterance_detection: "VoiceEndOfUtteranceDetection" @@ -11187,7 +10929,7 @@ class VoiceServerVadTurnDetection(TypedDict, total=False): idle_timeout_ms: Optional[int] type: Required[Literal[VoiceTurnDetectionType.SERVER_VAD]] """Required. Server-side voice activity detection.""" - speech_duration_ms: int + speech_duration_ms: str """Minimum speech duration required to trigger detection, in milliseconds.""" end_of_utterance_detection: Optional["VoiceEndOfUtteranceDetection"] """Semantic end-of-utterance detection configuration. Set to null to disable it.""" @@ -11507,8 +11249,8 @@ class WeeklyRecurrenceSchedule(TypedDict, total=False): :ivar type: Weekly recurrence type. Required. Weekly recurrence pattern. :vartype type: Literal[RecurrenceType.WEEKLY] - :ivar daysOfWeek: Days of the week for the recurrence schedule. Required. - :vartype daysOfWeek: list[Union[str, "DayOfWeek"]] + :ivar days_of_week: Days of the week for the recurrence schedule. Required. + :vartype days_of_week: list[Union[str, "DayOfWeek"]] """ type: Required[Literal[RecurrenceType.WEEKLY]] @@ -11518,7 +11260,10 @@ class WeeklyRecurrenceSchedule(TypedDict, total=False): class WorkflowAgentDefinition(TypedDict, total=False): - """The workflow agent definition. + """The workflow agent definition. Microsoft Foundry is retiring workflows on December 1, 2026. If + you're looking to build new workflows, use Microsoft Agent Framework. To migrate existing + workflows, see the `Migration guide + `_. :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. :vartype rai_config: "RaiConfig" @@ -11652,8 +11397,8 @@ class UpdateMemoriesRequest(TypedDict, total=False): :ivar scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :vartype scope: str - :ivar items: Conversation items to be stored in memory. - :vartype items: list[dict[str, Any]] + :ivar items_property: Conversation items to be stored in memory. + :vartype items_property: list[dict[str, Any]] :ivar previous_update_id: The unique ID of the previous update request, enabling incremental memory updates from where the last operation left off. :vartype previous_update_id: str @@ -11798,19 +11543,6 @@ class CreateSkillVersionRequest(TypedDict, total=False): """Whether to set this version as the default.""" -class GenerateAgentRequest(TypedDict, total=False): - """GenerateAgentRequest. - - :ivar kind: The kind of agent to generate. Required. Known values are: "prompt", "hosted", - "workflow", "external", and "voice". - :vartype kind: Union[str, "AgentKind"] - """ - - kind: Required[Union[str, "AgentKind"]] - """The kind of agent to generate. Required. Known values are: \"prompt\", \"hosted\", - \"workflow\", \"external\", and \"voice\".""" - - class CreateAgentVersionRequest(TypedDict, total=False): """CreateAgentVersionRequest. @@ -12080,17 +11812,6 @@ class UpdateToolboxRequest1(TypedDict, total=False): OpenApiAuthDetails = Union[OpenApiAnonymousAuthDetails, OpenApiManagedAuthDetails, OpenApiProjectConnectionAuthDetails] TelemetryEndpoint = Union[OtlpTelemetryEndpoint] RealtimeAudioFormats = Union[RealtimeAudioFormatsAudioPcm, RealtimeAudioFormatsAudioPcma, RealtimeAudioFormatsAudioPcmu] -RealtimeConversationItem = Union[ - RealtimeConversationItemFunctionCall, - RealtimeConversationItemFunctionCallOutput, - RealtimeMCPApprovalRequest, - RealtimeMCPApprovalResponse, - RealtimeMCPToolCall, - RealtimeMCPListTools, -] -RealtimeConversationItemMessage = Union[ - RealtimeConversationItemMessageAssistant, RealtimeConversationItemMessageSystem, RealtimeConversationItemMessageUser -] RealtimeMCPError = Union[RealtimeMCPHTTPError, RealtimeMCPProtocolError, RealtimeMCPToolExecutionError] RealtimeServerEvent = Union[RealtimeServerEventResponseContentPartAdded] ToolChoiceParam = Union[ diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_basic.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_basic.py index 6ee1f059f4eb..06eea164ba76 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_basic.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_basic.py @@ -37,10 +37,13 @@ from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( + AgentKind, VoiceAgentDefinition, VoiceAudioConfig, VoiceAudioOutputConfig, + VoiceModelType, VoiceOutputModality, + VoiceType, ) load_dotenv() @@ -57,11 +60,11 @@ definition = VoiceAgentDefinition( # `managed` uses a service-hosted model; use `self_deployed` with a Foundry # deployment name to bring your own model. - model_type="managed", + model_type=VoiceModelType.MANAGED, model=model, instructions="You are a friendly voice assistant. Keep replies short and natural.", audio=VoiceAudioConfig( - output=VoiceAudioOutputConfig(voice="en-US-AvaNeural", voice_type="azure-standard"), + output=VoiceAudioOutputConfig(voice="en-US-AvaNeural", voice_type=VoiceType.AZURE_STANDARD), ), output_modalities=[VoiceOutputModality.AUDIO], # Persist conversations so the transcript and audio can be read back later @@ -76,14 +79,14 @@ print(f"Retrieved voice agent: {agent.name} (state={agent.state})") print("Voice agents in this project:") - for item in project_client.agents.list(kind="voice"): + for item in project_client.agents.list(kind=AgentKind.VOICE): print(f" - {item.name}") # Each update produces a new immutable version. updated_version = project_client.agents.create_version( agent_name=agent_name, definition=VoiceAgentDefinition( - model_type="managed", + model_type=VoiceModelType.MANAGED, model=model, instructions="You are a friendly voice assistant. Always greet the caller warmly.", audio=definition.audio, diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_basic_async.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_basic_async.py index 8f17aba4dd2c..dcb227097034 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_basic_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_basic_async.py @@ -31,7 +31,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 VoiceAgentDefinition +from azure.ai.projects.models import AgentKind, VoiceAgentDefinition, VoiceModelType load_dotenv() @@ -49,7 +49,7 @@ async def main() -> None: created_version = await project_client.agents.create_version( agent_name=agent_name, definition=VoiceAgentDefinition( - model_type="managed", + model_type=VoiceModelType.MANAGED, model=model, instructions="You are a friendly voice assistant. Keep replies short and natural.", # Persist conversations so they can be read back later. Defaults to False. @@ -62,7 +62,7 @@ async def main() -> None: print(f"Retrieved voice agent: {agent.name}") print("Voice agents in this project:") - async for item in project_client.agents.list(kind="voice"): + async for item in project_client.agents.list(kind=AgentKind.VOICE): print(f" - {item.name}") finally: await project_client.agents.delete(agent_name=agent_name) diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_generate.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_generate.py index 9f3e23a0f771..24a5ed53261d 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_generate.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_generate.py @@ -19,24 +19,28 @@ pip install "azure-ai-projects>=2.0.0" python-dotenv - Set this environment variable with your own value: + Set these environment variables with your own values: 1) FOUNDRY_PROJECT_ENDPOINT - The Azure AI Project endpoint. + 2) FOUNDRY_VOICE_AGENT_NAME - Optional. The name of the voice agent. If not + set, defaults to "MyGeneratedVoiceAgent". """ import os from dotenv import load_dotenv from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient +from azure.ai.projects.models import AgentKind, GenerateVoiceAgentRequest load_dotenv() endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] +agent_name = os.environ.get("FOUNDRY_VOICE_AGENT_NAME") or "MyGeneratedVoiceAgent" with ( DefaultAzureCredential() as credential, AIProjectClient(endpoint=endpoint, credential=credential, allow_preview=True) as project_client, ): - agent = project_client.agents.generate_agent(kind="voice") + agent = project_client.agents.generate_agent(GenerateVoiceAgentRequest(kind=AgentKind.VOICE, name=agent_name)) print(f"Generated voice agent: {agent.name}") print(f"Instructions:\n{agent.versions.latest.definition.instructions}") # type: ignore[attr-defined] diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py index 79fb8993d191..3b7f8ec87ebb 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py @@ -6,17 +6,19 @@ """ DESCRIPTION: - End-to-end hands-free, bidirectional voice conversation against an - existing voice agent, using the ``client.realtime`` namespace added on top - of the generated azure-ai-projects client (see - ``azure.ai.projects.aio.AsyncRealtime``). This mirrors the ergonomics of - the OpenAI Python realtime client. - - 1. Stream live mic audio and let the agent's server-side VAD detect your + End-to-end hands-free, bidirectional voice conversation using the + ``client.realtime`` namespace added on top of the generated + azure-ai-projects client (see ``azure.ai.projects.aio.AsyncRealtime``). + This mirrors the ergonomics of the OpenAI Python realtime client. + + 1. Generate a starter voice agent (see sample_voice_agent_generate.py), + then publish a version with `store=True` so the conversation can be + read back afterward. + 2. Stream live mic audio and let the agent's server-side VAD detect your turns: your speech is transcribed, the agent replies through the speakers, and talking over it barges in. - 2. Read the persisted conversation back (requires the agent to have been - created with `store=True`; see sample_voice_agent_basic.py). + 3. Fetch the persisted conversation back by id. + 4. Delete the agent created for this sample. Capture and playback use non-blocking pyaudio callbacks; reply audio is sequence-numbered so a barge-in can skip whatever is still queued. The @@ -35,9 +37,8 @@ Environment variables: 1) FOUNDRY_PROJECT_ENDPOINT (required) - Foundry project endpoint: https://.services.ai.azure.com/api/projects/ - 2) FOUNDRY_VOICE_AGENT_NAME (required) - name of an existing voice agent to - converse with (created with `store=True` to persist conversations; see - sample_voice_agent_basic.py). + 2) FOUNDRY_VOICE_AGENT_NAME - Optional. Name for the agent created by this + sample. Defaults to "sample-live-audio-conversation-agent-async". Runs until you press Ctrl-C. Authenticates with DefaultAzureCredential, so sign in first (e.g. `az login`). @@ -48,6 +49,7 @@ import queue from typing import Any, Final, Optional +from dotenv import load_dotenv from azure.core.exceptions import HttpResponseError from azure.identity.aio import DefaultAzureCredential @@ -55,6 +57,9 @@ # static import resolution cannot trace that, but the symbol is valid (verified by Pyright/mypy). from azure.ai.projects.aio import AsyncRealtimeConnection, AIProjectClient # pylint: disable=no-name-in-module from azure.ai.projects.models import ( + AgentKind, + GenerateVoiceAgentRequest, + VoiceAgentDefinition, VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted, VoiceAgentServerEventInputAudioBufferSpeechStarted, VoiceAgentServerEventResponseAudioDelta, @@ -64,6 +69,8 @@ RealtimeServerEventError, ) +load_dotenv() + # Audio is streamed both ways as PCM16, mono, 24 kHz. _SAMPLE_RATE: Final = 24000 @@ -295,28 +302,61 @@ async def _read_conversation(client: AIProjectClient, agent_name: str, conversat async def audio_conversation() -> None: endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] - agent_name = os.environ["FOUNDRY_VOICE_AGENT_NAME"] + agent_name = os.environ.get("FOUNDRY_VOICE_AGENT_NAME") or "sample-live-audio-conversation-agent-async" async with ( DefaultAzureCredential() as credential, - AIProjectClient(endpoint=endpoint, credential=credential) as project_client, + AIProjectClient(endpoint=endpoint, credential=credential, allow_preview=True) as project_client, ): try: - # 1) Hold a live microphone conversation with the existing agent. + # 1) Generate a starter voice agent (see sample_voice_agent_generate.py). + generated = await project_client.agents.generate_agent( + GenerateVoiceAgentRequest(kind=AgentKind.VOICE, name=agent_name) + ) + definition = generated.versions.latest.definition # type: ignore[attr-defined] + + # 2) Publish a new version with conversation persistence enabled (`store=True`) so the + # session's conversation can be fetched back by id afterward. + await project_client.agents.create_version( + agent_name=agent_name, + definition=VoiceAgentDefinition( + model_type=definition.model_type, + model=definition.model, + instructions=definition.instructions, + store=True, + ), + ) + + # 3) Hold a live microphone conversation with the freshly created agent. print(f"Starting realtime session with agent: {agent_name}") conversation_id = await _run_audio_conversation(project_client, agent_name) - # 2) Read the persisted conversation back. + # 4) Fetch the persisted conversation back by id. if conversation_id: print(f"Reading persisted conversation {conversation_id!r}...") try: await _read_conversation(project_client, agent_name, conversation_id) except HttpResponseError as e: print(f"Could not read conversation: {e.status_code} {e.reason}") + # To fetch this session's audio afterward, use + # `project_client.agent_endpoint_conversations`: + # - get_agent_conversation_audio(agent_name, conversation_id) for the merged + # whole-call stereo recording's metadata, then + # get_agent_conversation_audio_content(agent_name, conversation_id) to stream + # the WAV bytes. + # - get_agent_conversation_item_audio(agent_name, conversation_id, item_id) for a + # single turn's audio metadata, then + # get_agent_conversation_item_audio_content(agent_name, conversation_id, item_id) + # to stream that turn's bytes. + # See sample_voice_agent_read_conversation_audio.py for a full example. else: print("No conversation id was returned; nothing to read.") except HttpResponseError as e: print(f"Service responded with an error: {e.status_code} {e.reason}") + finally: + # 5) Clean up the agent created for this sample. + await project_client.agents.delete(agent_name=agent_name) + print(f"Deleted voice agent: {agent_name}") if __name__ == "__main__": diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_function_tool.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_function_tool.py similarity index 91% rename from sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_function_tool.py rename to sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_function_tool.py index eac56d8a979a..7ddd33c51127 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_function_tool.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_function_tool.py @@ -16,7 +16,7 @@ `response.create` so the agent can finish its reply using the tool output. USAGE: - python sample_voice_agent_function_tool.py + python sample_voice_agent_live_function_tool.py Before running the sample: @@ -37,8 +37,6 @@ from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( - RealtimeConversationItemFunctionCallOutput, - RealtimeConversationItemMessageUser, RealtimeConversationItemMessageUserContent, RealtimeFunctionTool, RealtimeServerEventError, @@ -46,7 +44,10 @@ VoiceAgentServerEventResponseDone, VoiceAgentServerEventResponseFunctionCallArgumentsDone, VoiceAgentServerEventResponseTextDone, + VoiceFunctionCallOutputItem, + VoiceModelType, VoiceOutputModality, + VoiceUserMessageItem, ) load_dotenv() @@ -78,7 +79,7 @@ def _run_turn_with_tool_support(client: AIProjectClient, agent_name: str, prompt """ with client.realtime.connect(agent_name=agent_name) as conn: conn.conversation.item.create( - item=RealtimeConversationItemMessageUser( + item=VoiceUserMessageItem( content=[RealtimeConversationItemMessageUserContent(type="input_text", text=prompt)] ) ) @@ -95,9 +96,7 @@ def _run_turn_with_tool_support(client: AIProjectClient, agent_name: str, prompt else: result = json.dumps({"error": f"Unknown tool: {event.name}"}) - conn.conversation.item.create( - item=RealtimeConversationItemFunctionCallOutput(call_id=event.call_id, output=result) - ) + conn.conversation.item.create(item=VoiceFunctionCallOutputItem(call_id=event.call_id, output=result)) conn.response.create() elif isinstance(event, VoiceAgentServerEventResponseTextDone): # The sample agent uses a text-only output modality, so the @@ -142,7 +141,7 @@ def main() -> None: project_client.agents.create_version( agent_name=agent_name, definition=VoiceAgentDefinition( - model_type="managed", + model_type=VoiceModelType.MANAGED, model="gpt-realtime", instructions=( "You are a helpful voice assistant. Use the get_weather tool when the " @@ -154,9 +153,7 @@ def main() -> None: ) print(f"Created voice agent: {agent_name}") - _run_turn_with_tool_support( - project_client, agent_name, "What's the weather like in Seattle right now?" - ) + _run_turn_with_tool_support(project_client, agent_name, "What's the weather like in Seattle right now?") finally: project_client.agents.delete(agent_name=agent_name) print(f"Deleted voice agent: {agent_name}") diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py index fc1ce6930b29..3a9ba356ee55 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py @@ -6,16 +6,19 @@ """ DESCRIPTION: - End-to-end typed conversation against an existing voice agent, using the - ``client.realtime`` namespace added on top of the generated - azure-ai-projects client (see ``azure.ai.projects.Realtime``). - - 1. Hold a typed, multi-turn conversation: each prompt is sent as a - ``RealtimeConversationItemMessageUser`` and the reply streams back as + End-to-end typed conversation using the ``client.realtime`` namespace added + on top of the generated azure-ai-projects client (see + ``azure.ai.projects.Realtime``). + + 1. Generate a starter voice agent (see sample_voice_agent_generate.py), + then publish a version with `store=True` so the conversation can be + read back afterward. + 2. Hold a typed, multi-turn conversation: each prompt is sent as a + ``VoiceUserMessageItem`` and the reply streams back as typed audio and transcript events. Blank line (or ``exit`` / ``quit``) ends it. - 2. Read the persisted conversation back (requires the agent to have been - created with `store=True`; see sample_voice_agent_basic.py). + 3. Fetch the persisted conversation back by id. + 4. Delete the agent created for this sample. Reply audio is PCM16, mono, 24 kHz and plays through the speakers when ``pyaudio`` is installed; runs headless otherwise. For a hands-free mic @@ -32,9 +35,8 @@ Environment variables: 1) FOUNDRY_PROJECT_ENDPOINT (required) - Foundry project endpoint: https://.services.ai.azure.com/api/projects/ - 2) FOUNDRY_VOICE_AGENT_NAME (required) - name of an existing voice agent to - converse with (created with `store=True` to persist conversations; see - sample_voice_agent_basic.py). + 2) FOUNDRY_VOICE_AGENT_NAME - Optional. Name for the agent created by this + sample. Defaults to "sample-live-text-conversation-agent". Authenticates with DefaultAzureCredential, so sign in first (e.g. `az login`). """ @@ -42,19 +44,25 @@ import os from typing import Final, Optional +from dotenv import load_dotenv from azure.core.exceptions import HttpResponseError from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( - RealtimeConversationItemMessageUser, + AgentKind, + GenerateVoiceAgentRequest, RealtimeConversationItemMessageUserContent, + VoiceAgentDefinition, VoiceAgentServerEventResponseAudioDelta, VoiceAgentServerEventResponseAudioTranscriptDone, VoiceAgentServerEventResponseDone, VoiceAgentServerEventSessionCreated, RealtimeServerEventError, + VoiceUserMessageItem, ) +load_dotenv() + # Seconds to wait for the agent to finish its reply. _RESPONSE_TIMEOUT: Final = 45 @@ -166,7 +174,7 @@ def pump() -> None: # Send the turn and ask the agent to respond. conn.conversation.item.create( - item=RealtimeConversationItemMessageUser( + item=VoiceUserMessageItem( content=[RealtimeConversationItemMessageUserContent(type="input_text", text=prompt)] ) ) @@ -213,28 +221,61 @@ def _read_conversation(client: AIProjectClient, agent_name: str, conversation_id def text_conversation() -> None: endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] - agent_name = os.environ["FOUNDRY_VOICE_AGENT_NAME"] + agent_name = os.environ.get("FOUNDRY_VOICE_AGENT_NAME") or "sample-live-text-conversation-agent" with ( DefaultAzureCredential() as credential, - AIProjectClient(endpoint=endpoint, credential=credential) as project_client, + AIProjectClient(endpoint=endpoint, credential=credential, allow_preview=True) as project_client, ): try: - # 1) Hold the realtime conversation against the existing agent. + # 1) Generate a starter voice agent (see sample_voice_agent_generate.py). + generated = project_client.agents.generate_agent( + GenerateVoiceAgentRequest(kind=AgentKind.VOICE, name=agent_name) + ) + definition = generated.versions.latest.definition # type: ignore[attr-defined] + + # 2) Publish a new version with conversation persistence enabled (`store=True`) so the + # session's conversation can be fetched back by id afterward. + project_client.agents.create_version( + agent_name=agent_name, + definition=VoiceAgentDefinition( + model_type=definition.model_type, + model=definition.model, + instructions=definition.instructions, + store=True, + ), + ) + + # 3) Hold the realtime conversation against the freshly created agent. print(f"Starting realtime session with agent: {agent_name}") conversation_id = _run_text_conversation(project_client, agent_name) - # 2) Read the persisted conversation back. + # 4) Fetch the persisted conversation back by id. if conversation_id: print(f"Reading persisted conversation {conversation_id}...") try: _read_conversation(project_client, agent_name, conversation_id) except HttpResponseError as e: print(f"Could not read conversation: {e.status_code} {e.reason}") + # To fetch this session's audio afterward, use + # `project_client.agent_endpoint_conversations`: + # - get_agent_conversation_audio(agent_name, conversation_id) for the merged + # whole-call stereo recording's metadata, then + # get_agent_conversation_audio_content(agent_name, conversation_id) to stream + # the WAV bytes. + # - get_agent_conversation_item_audio(agent_name, conversation_id, item_id) for a + # single turn's audio metadata, then + # get_agent_conversation_item_audio_content(agent_name, conversation_id, item_id) + # to stream that turn's bytes. + # See sample_voice_agent_read_conversation_audio.py for a full example. else: print("No conversation id was returned; nothing to read.") except HttpResponseError as e: print(f"Service responded with an error: {e.status_code} {e.reason}") + finally: + # 5) Clean up the agent created for this sample. + project_client.agents.delete(agent_name=agent_name) + print(f"Deleted voice agent: {agent_name}") if __name__ == "__main__": diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py index 072ff93c7365..cc551354e513 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py @@ -6,16 +6,19 @@ """ DESCRIPTION: - End-to-end typed conversation against an existing voice agent, using the - ``client.realtime`` namespace added on top of the generated - azure-ai-projects client (see ``azure.ai.projects.aio.AsyncRealtime``). - - 1. Hold a typed, multi-turn conversation: each prompt is sent as a - ``RealtimeConversationItemMessageUser`` and the reply streams back as + End-to-end typed conversation using the ``client.realtime`` namespace added + on top of the generated azure-ai-projects client (see + ``azure.ai.projects.aio.AsyncRealtime``). + + 1. Generate a starter voice agent (see sample_voice_agent_generate.py), + then publish a version with `store=True` so the conversation can be + read back afterward. + 2. Hold a typed, multi-turn conversation: each prompt is sent as a + ``VoiceUserMessageItem`` and the reply streams back as typed audio and transcript events. Blank line (or ``exit`` / ``quit``) ends it. - 2. Read the persisted conversation back (requires the agent to have been - created with `store=True`; see sample_voice_agent_basic.py). + 3. Fetch the persisted conversation back by id. + 4. Delete the agent created for this sample. Reply audio is PCM16, mono, 24 kHz and plays through the speakers when ``pyaudio`` is installed; runs headless otherwise. For a hands-free mic @@ -29,9 +32,8 @@ Environment variables: 1) FOUNDRY_PROJECT_ENDPOINT (required) - Foundry project endpoint: https://.services.ai.azure.com/api/projects/ - 2) FOUNDRY_VOICE_AGENT_NAME (required) - name of an existing voice agent to - converse with (created with `store=True` to persist conversations; see - sample_voice_agent_basic.py). + 2) FOUNDRY_VOICE_AGENT_NAME - Optional. Name for the agent created by this + sample. Defaults to "sample-live-text-conversation-agent-async". Authenticates with DefaultAzureCredential, so sign in first (e.g. `az login`). """ @@ -40,19 +42,25 @@ import os from typing import Final, Optional +from dotenv import load_dotenv from azure.core.exceptions import HttpResponseError from azure.identity.aio import DefaultAzureCredential from azure.ai.projects.aio import AIProjectClient from azure.ai.projects.models import ( - RealtimeConversationItemMessageUser, + AgentKind, + GenerateVoiceAgentRequest, RealtimeConversationItemMessageUserContent, + VoiceAgentDefinition, VoiceAgentServerEventResponseAudioDelta, VoiceAgentServerEventResponseAudioTranscriptDone, VoiceAgentServerEventResponseDone, VoiceAgentServerEventSessionCreated, RealtimeServerEventError, + VoiceUserMessageItem, ) +load_dotenv() + # Seconds to wait for the agent to finish its reply. _RESPONSE_TIMEOUT: Final = 45 @@ -164,7 +172,7 @@ async def pump() -> None: # Send the turn and ask the agent to respond. await conn.conversation.item.create( - item=RealtimeConversationItemMessageUser( + item=VoiceUserMessageItem( content=[RealtimeConversationItemMessageUserContent(type="input_text", text=prompt)] ) ) @@ -215,28 +223,61 @@ async def _read_conversation(client: AIProjectClient, agent_name: str, conversat async def text_conversation() -> None: endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] - agent_name = os.environ["FOUNDRY_VOICE_AGENT_NAME"] + agent_name = os.environ.get("FOUNDRY_VOICE_AGENT_NAME") or "sample-live-text-conversation-agent-async" async with ( DefaultAzureCredential() as credential, - AIProjectClient(endpoint=endpoint, credential=credential) as project_client, + AIProjectClient(endpoint=endpoint, credential=credential, allow_preview=True) as project_client, ): try: - # 1) Hold the realtime conversation against the existing agent. + # 1) Generate a starter voice agent (see sample_voice_agent_generate.py). + generated = await project_client.agents.generate_agent( + GenerateVoiceAgentRequest(kind=AgentKind.VOICE, name=agent_name) + ) + definition = generated.versions.latest.definition # type: ignore[attr-defined] + + # 2) Publish a new version with conversation persistence enabled (`store=True`) so the + # session's conversation can be fetched back by id afterward. + await project_client.agents.create_version( + agent_name=agent_name, + definition=VoiceAgentDefinition( + model_type=definition.model_type, + model=definition.model, + instructions=definition.instructions, + store=True, + ), + ) + + # 3) Hold the realtime conversation against the freshly created agent. print(f"Starting realtime session with agent: {agent_name}") conversation_id = await _run_text_conversation(project_client, agent_name) - # 2) Read the persisted conversation back. + # 4) Fetch the persisted conversation back by id. if conversation_id: print(f"Reading persisted conversation {conversation_id}...") try: await _read_conversation(project_client, agent_name, conversation_id) except HttpResponseError as e: print(f"Could not read conversation: {e.status_code} {e.reason}") + # To fetch this session's audio afterward, use + # `project_client.agent_endpoint_conversations`: + # - get_agent_conversation_audio(agent_name, conversation_id) for the merged + # whole-call stereo recording's metadata, then + # get_agent_conversation_audio_content(agent_name, conversation_id) to stream + # the WAV bytes. + # - get_agent_conversation_item_audio(agent_name, conversation_id, item_id) for a + # single turn's audio metadata, then + # get_agent_conversation_item_audio_content(agent_name, conversation_id, item_id) + # to stream that turn's bytes. + # See sample_voice_agent_read_conversation_audio.py for a full example. else: print("No conversation id was returned; nothing to read.") except HttpResponseError as e: print(f"Service responded with an error: {e.status_code} {e.reason}") + finally: + # 5) Clean up the agent created for this sample. + await project_client.agents.delete(agent_name=agent_name) + print(f"Deleted voice agent: {agent_name}") if __name__ == "__main__": diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_versions.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_versions.py index 0c373c780988..7a381a837056 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_versions.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_versions.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 VoiceAgentDefinition +from azure.ai.projects.models import VoiceAgentDefinition, VoiceModelType load_dotenv() @@ -39,7 +39,7 @@ def make_definition(instructions: str) -> VoiceAgentDefinition: # Each version differs only by its instructions; the rest is identical. - return VoiceAgentDefinition(model_type="managed", model=model, instructions=instructions) + return VoiceAgentDefinition(model_type=VoiceModelType.MANAGED, model=model, instructions=instructions) with ( diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_with_tools.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_with_tools.py index 5cf3040ca401..aba853d4c383 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_with_tools.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_with_tools.py @@ -45,15 +45,18 @@ VoiceAgentMcpTool, VoiceAudioConfig, VoiceAudioFormat, + VoiceAudioFormatType, VoiceAudioInputConfig, VoiceAudioOutputConfig, VoiceInputTranscription, + VoiceInputTranscriptionModel, VoiceModelType, VoiceOutputModality, VoiceServerVadTurnDetection, VoiceSystemTool, VoiceSystemToolName, VoiceToolboxTool, + VoiceType, ) load_dotenv() @@ -108,16 +111,16 @@ # auto-responds when the caller stops speaking, plus input-audio # transcription so user speech is transcribed. input=VoiceAudioInputConfig( - format=VoiceAudioFormat(type="audio/pcm", rate=24000), + format=VoiceAudioFormat(type=VoiceAudioFormatType.PCM, rate=24000), turn_detection=VoiceServerVadTurnDetection( threshold=0.5, prefix_padding_ms=300, silence_duration_ms=500, ), - transcription=VoiceInputTranscription(model="whisper-1"), + transcription=VoiceInputTranscription(model=VoiceInputTranscriptionModel.WHISPER1), ), # Output (agent speech) side: the voice the agent speaks with. - output=VoiceAudioOutputConfig(voice="en-US-AvaNeural", voice_type="azure-standard"), + output=VoiceAudioOutputConfig(voice="en-US-AvaNeural", voice_type=VoiceType.AZURE_STANDARD), ), output_modalities=[VoiceOutputModality.AUDIO], # Attach the self-contained tools. `_example_mcp_tool` and `_example_toolbox_tool` diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud.py b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud.py index 5580a7c50251..da3eb74b5ac6 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud.py @@ -24,14 +24,16 @@ class TestVoiceAgentCrud(TestBase): NOTE: Some voice-agent REST APIs are intentionally NOT covered here because they are currently blocked by known service-side bugs (see this package's engineering notes): - - `agents.generate_agent(kind="voice")` - returns a `400 invalid_payload` error from the - service even though the SDK sends the TypeSpec-documented-correct payload. - Reading back a conversation (`project_client.agent_endpoint_conversations.*`) using a `conversation_id` produced by a live realtime WebSocket session - the service's REST conversation-ID validator rejects the ID format generated by the realtime WS subsystem. This is also not practical to cover with HTTP-only recorded tests since it requires an actual WebSocket session. Once these are fixed service-side, tests can be added for them. + + `agents.generate_agent(GenerateVoiceAgentRequest(kind="voice", name=...))` was previously + blocked by a service-side bug (missing required `name`); that has since been fixed upstream, + but no recorded test has been added for it yet. """ # To run only this test: diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud_async.py b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud_async.py index 9b582eb945d4..9a1bb3c41e49 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud_async.py @@ -25,14 +25,16 @@ class TestVoiceAgentCrudAsync(TestBase): NOTE: Some voice-agent REST APIs are intentionally NOT covered here because they are currently blocked by known service-side bugs (see this package's engineering notes): - - `agents.generate_agent(kind="voice")` - returns a `400 invalid_payload` error from the - service even though the SDK sends the TypeSpec-documented-correct payload. - Reading back a conversation (`project_client.agent_endpoint_conversations.*`) using a `conversation_id` produced by a live realtime WebSocket session - the service's REST conversation-ID validator rejects the ID format generated by the realtime WS subsystem. This is also not practical to cover with HTTP-only recorded tests since it requires an actual WebSocket session. Once these are fixed service-side, tests can be added for them. + + `agents.generate_agent(GenerateVoiceAgentRequest(kind="voice", name=...))` was previously + blocked by a service-side bug (missing required `name`); that has since been fixed upstream, + but no recorded test has been added for it yet. """ # To run only this test: diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml b/sdk/ai/azure-ai-projects/tsp-location.yaml index 20e048f193a4..db28a996969a 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: 959894f28ce0c52303f730962b4777c25ed65ecf +commit: 4b80e4d91a9c7940812f8c0e9c07611eb9f5be2e repo: Azure/azure-rest-api-specs additionalDirectories: - specification/ai-foundry/data-plane/Foundry/src/agents From 56856701b939657b5e680a309953b38644605186 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Wed, 19 Aug 2026 19:19:19 -0700 Subject: [PATCH 34/56] Fix voice_agent_web_socket static/runtime mismatch, sphinx docstring warnings, and httpx dependency upper bound - Remove the generated voice_agent_web_socket operation group from the client's public surface entirely (import, docstring, __init__ assignment), instead of only deleting the instance attribute at runtime. The generated operation only does a plain HTTP GET and discards the connection; leaving it statically declared while runtime-deleting it made it type-check as present but raise AttributeError when accessed. Added a matching PostEmitter.ps1 rule for future regens. - Fix 3 Sphinx docutils 'Bullet list ends without a blank line; unexpected unindent' warnings (which -W turns into build failures) in VoiceAudioOutputConfig (_models.py and its TypedDict twin in types.py) and VoiceConversationStatus (_enums.py), caused by the emitter wrapping long bullet-list items across lines without proper continuation indentation. Added a matching PostEmitter.ps1 rule for future regens. - Cap httpx to '>=0.25.0,<0.29.0' in pyproject.toml. This PR added httpx as an explicit top-level dependency (needed for _OpenAILoggingTransport) with no upper bound; on main httpx is only pulled in transitively through openai's own tighter constraint. The unbounded direct dependency let CI's resolver pick a newer httpx than openai was built against, causing an AssertionError (isinstance(request.stream, SyncByteStream)) deep in httpx's own transport code for any get_openai_client() + responses.create() call, which explained the widespread CI test failures on this branch that don't reproduce on main. --- sdk/ai/azure-ai-projects/PostEmitter.ps1 | 40 +++++++++++++++++++ .../azure/ai/projects/_client.py | 6 --- .../azure/ai/projects/_patch.py | 6 --- .../azure/ai/projects/aio/_client.py | 6 --- .../azure/ai/projects/aio/_patch.py | 6 --- .../azure/ai/projects/models/_enums.py | 10 ++--- .../azure/ai/projects/models/_models.py | 8 ++-- .../azure/ai/projects/types.py | 8 ++-- sdk/ai/azure-ai-projects/pyproject.toml | 2 +- 9 files changed, 50 insertions(+), 42 deletions(-) diff --git a/sdk/ai/azure-ai-projects/PostEmitter.ps1 b/sdk/ai/azure-ai-projects/PostEmitter.ps1 index 7b6cb43d4fbe..3648a45ed8ea 100644 --- a/sdk/ai/azure-ai-projects/PostEmitter.ps1 +++ b/sdk/ai/azure-ai-projects/PostEmitter.ps1 @@ -227,6 +227,46 @@ foreach ($f in $files) { Set-Content $f $c -NoNewline } +# Remove the generated `voice_agent_web_socket` operation group from the client's public surface +# entirely (import, docstring, and __init__ assignment), instead of deleting the instance attribute +# at runtime in _patch.py/aio/_patch.py. The generated operation only performs a plain HTTP GET (no +# WebSocket upgrade handshake) and discards the connection - it's not a usable client and was never +# meant to be public (the real voice-agent WebSocket client is `.realtime`). Deleting it only at +# runtime left a static/runtime mismatch: pyright/mypy still saw `voice_agent_web_socket: +# VoiceAgentWebSocketOperations` as always present (it's an unconditional generated __init__ +# assignment), so callers' code type-checked fine but raised AttributeError at runtime. Stripping it +# here removes the mismatch at its source. +$files = 'azure\ai\projects\_client.py', 'azure\ai\projects\aio\_client.py' +foreach ($f in $files) { + $c = Get-Content $f -Raw + $c = $c -replace '(?m)^ :ivar voice_agent_web_socket: VoiceAgentWebSocketOperations operations\r?\n :vartype voice_agent_web_socket: [^\r\n]*\r?\n', '' + $c = $c -replace '(?m)^ self\.voice_agent_web_socket = VoiceAgentWebSocketOperations\(\r?\n self\._client, self\._config, self\._serialize, self\._deserialize\r?\n \)\r?\n', '' + $c = $c -replace '(?m)^\s*VoiceAgentWebSocketOperations,\r?\n', '' + Set-Content $f $c -NoNewline +} + +# Fix Sphinx docutils "Bullet list ends without a blank line; unexpected unindent" errors (the +# `-W` sphinx flag turns these into build failures) in VoiceAudioOutputConfig (_models.py and its +# TypedDict twin in types.py) and VoiceConversationStatus (_enums.py). The emitter wraps long +# bullet-list items across multiple physical lines without indenting the continuation under the +# bullet's text, which docutils doesn't recognize as part of the same list item. Join each +# wrapped item back into one physical line; VoiceAudioOutputConfig also needs a blank line +# inserted before its trailing non-bulleted closing sentence to properly terminate the list. +$files = 'azure\ai\projects\models\_models.py', 'azure\ai\projects\types.py' +foreach ($f in $files) { + $c = Get-Content $f -Raw + $c = $c -replace '(`voice_temperature`,)\r?\n (`custom_lexicon_url`,)\r?\n (`custom_text_normalization_url`)', '$1 $2 $3' + $c = $c -replace '(plus)\r?\n (`personal_voice_model`; the voice name is derived from the avatar\.)', '$1 $2' + $c = $c -replace '(\* `azure-realtime-native`: `voice` and `speed`\.)\r?\n (`format` and `output_audio_timestamp_types` apply to every voice type\.)', "`$1`r`n`r`n `$2" + Set-Content $f $c -NoNewline +} +$f = 'azure\ai\projects\models\_enums.py' +$c = Get-Content $f -Raw +$c = $c -replace '(is)\r?\n (pending\.)', '$1 $2' +$c = $c -replace '(a)\r?\n (max-duration `1001`)\r?\n (close, or a client or network disconnect that the service can still finalize\.)', '$1 $2 $3' +$c = $c -replace '(prevented)\r?\n (finalization\.)', '$1 $2' +Set-Content $f $c -NoNewline + # Finishing by running 'black' tool to format code. pip install black black --config ../../../eng/black-pyproject.toml . diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py index 29fc344d6a6a..fbb310d5efda 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py @@ -26,7 +26,6 @@ EvaluationRulesOperations, IndexesOperations, ToolboxesOperations, - VoiceAgentWebSocketOperations, ) if sys.version_info >= (3, 11): @@ -45,8 +44,6 @@ class AIProjectClient: # pylint: disable=too-many-instance-attributes,docstring :vartype beta: azure.ai.projects.operations.BetaOperations :ivar agents: AgentsOperations operations :vartype agents: azure.ai.projects.operations.AgentsOperations - :ivar voice_agent_web_socket: VoiceAgentWebSocketOperations operations - :vartype voice_agent_web_socket: azure.ai.projects.operations.VoiceAgentWebSocketOperations :ivar agent_endpoint_conversations: AgentEndpointConversationsOperations operations :vartype agent_endpoint_conversations: azure.ai.projects.operations.AgentEndpointConversationsOperations @@ -113,9 +110,6 @@ def __init__( self._serialize.client_side_validation = False self.beta = BetaOperations(self._client, self._config, self._serialize, self._deserialize) self.agents = AgentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.voice_agent_web_socket = VoiceAgentWebSocketOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.agent_endpoint_conversations = AgentEndpointConversationsOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py index 3e9e96cf3240..c1bcdd3a0d6f 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py @@ -250,12 +250,6 @@ def __init__( self.telemetry = TelemetryOperations(self) # type: ignore self._realtime: Optional[Realtime] = None - # The generated `voice_agent_web_socket` operation group only performs a plain HTTP GET - # (no WebSocket upgrade handshake) and discards the connection, returning None. It is not a - # usable WebSocket client. Remove it from the public surface so it can't be mistaken for the - # real, functional voice-agent WebSocket client exposed via `.realtime`. - if hasattr(self, "voice_agent_web_socket"): - del self.voice_agent_web_socket # Voice-agent conversation reads require the VoiceAgents=V1Preview opt-in header, which # isn't part of the standard agent preview headers; inject it transparently. # Guarded with hasattr since some tests mock out the generated __init__ entirely, in which diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py index bf15e25b782f..7fc3b32df9ab 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py @@ -26,7 +26,6 @@ EvaluationRulesOperations, IndexesOperations, ToolboxesOperations, - VoiceAgentWebSocketOperations, ) if sys.version_info >= (3, 11): @@ -45,8 +44,6 @@ class AIProjectClient: # pylint: disable=too-many-instance-attributes,docstring :vartype beta: azure.ai.projects.aio.operations.BetaOperations :ivar agents: AgentsOperations operations :vartype agents: azure.ai.projects.aio.operations.AgentsOperations - :ivar voice_agent_web_socket: VoiceAgentWebSocketOperations operations - :vartype voice_agent_web_socket: azure.ai.projects.aio.operations.VoiceAgentWebSocketOperations :ivar agent_endpoint_conversations: AgentEndpointConversationsOperations operations :vartype agent_endpoint_conversations: azure.ai.projects.aio.operations.AgentEndpointConversationsOperations @@ -113,9 +110,6 @@ def __init__( self._serialize.client_side_validation = False self.beta = BetaOperations(self._client, self._config, self._serialize, self._deserialize) self.agents = AgentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.voice_agent_web_socket = VoiceAgentWebSocketOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.agent_endpoint_conversations = AgentEndpointConversationsOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py index 7d45d38524ab..9929964f9213 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py @@ -181,12 +181,6 @@ def __init__( self.telemetry = TelemetryOperations(self) # type: ignore self._realtime: Optional[AsyncRealtime] = None - # The generated `voice_agent_web_socket` operation group only performs a plain HTTP GET - # (no WebSocket upgrade handshake) and discards the connection, returning None. It is not a - # usable WebSocket client. Remove it from the public surface so it can't be mistaken for the - # real, functional voice-agent WebSocket client exposed via `.realtime`. - if hasattr(self, "voice_agent_web_socket"): - del self.voice_agent_web_socket # Voice-agent conversation reads require the VoiceAgents=V1Preview opt-in header, which # isn't part of the standard agent preview headers; inject it transparently. # These attribute-presence checks are guarded with hasattr since some tests mock out the 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 15ed7fffec5a..a9434582679c 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 @@ -1686,13 +1686,9 @@ class VoiceConversationItemType(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 0c80f84b8be0..42ff283d74b1 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 @@ -23151,14 +23151,12 @@ class VoiceAudioOutputConfig(_Model): # pylint: disable=docstring-keyword-shoul 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. + * `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 diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/types.py b/sdk/ai/azure-ai-projects/azure/ai/projects/types.py index 1afb14c97fc1..c2ed95217e6e 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/types.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/types.py @@ -10241,14 +10241,12 @@ class VoiceAudioOutputConfig(TypedDict, total=False): 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. + * `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 diff --git a/sdk/ai/azure-ai-projects/pyproject.toml b/sdk/ai/azure-ai-projects/pyproject.toml index 84b216ce7b7a..1629b6c74832 100644 --- a/sdk/ai/azure-ai-projects/pyproject.toml +++ b/sdk/ai/azure-ai-projects/pyproject.toml @@ -37,7 +37,7 @@ dependencies = [ "typing-extensions>=4.11", "azure-identity>=1.15.0", "openai>=2.8.0", - "httpx>=0.25.0", + "httpx>=0.25.0,<0.29.0", "azure-storage-blob>=12.15.0", ] dynamic = [ From b5847a8e6760338cbc4cb440527bc7501b0ee9f1 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Wed, 19 Aug 2026 20:34:57 -0700 Subject: [PATCH 35/56] Cap openai to <3.0.0 to avoid httpx2 transport incompatibility with custom httpx-based logging transport --- sdk/ai/azure-ai-projects/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/ai/azure-ai-projects/pyproject.toml b/sdk/ai/azure-ai-projects/pyproject.toml index 1629b6c74832..8a46dd598423 100644 --- a/sdk/ai/azure-ai-projects/pyproject.toml +++ b/sdk/ai/azure-ai-projects/pyproject.toml @@ -36,7 +36,7 @@ dependencies = [ "azure-core>=1.37.0", "typing-extensions>=4.11", "azure-identity>=1.15.0", - "openai>=2.8.0", + "openai>=2.8.0,<3.0.0", "httpx>=0.25.0,<0.29.0", "azure-storage-blob>=12.15.0", ] From 532ab7ef64146375d7b3376877feede8ef492aa5 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Thu, 20 Aug 2026 10:39:12 -0700 Subject: [PATCH 36/56] Fix get_session_log_stream duplicate stream kwarg and resolve mypy union-attr/attr-defined errors in samples --- sdk/ai/azure-ai-projects/PostEmitter.ps1 | 12 ++++++++++++ .../azure/ai/projects/aio/operations/_operations.py | 2 +- .../azure/ai/projects/operations/_operations.py | 2 +- .../samples/agents/sample_workflow_multi_agent.py | 4 ++-- .../agents/sample_workflow_multi_agent_async.py | 4 ++-- .../sample_workflow_multi_agent_with_mcp_approval.py | 4 ++-- ...mple_voice_agent_live_audio_conversation_async.py | 6 +++--- .../sample_voice_agent_live_text_conversation.py | 6 +++--- ...ample_voice_agent_live_text_conversation_async.py | 6 +++--- 9 files changed, 29 insertions(+), 17 deletions(-) diff --git a/sdk/ai/azure-ai-projects/PostEmitter.ps1 b/sdk/ai/azure-ai-projects/PostEmitter.ps1 index 3648a45ed8ea..9cea06567ff3 100644 --- a/sdk/ai/azure-ai-projects/PostEmitter.ps1 +++ b/sdk/ai/azure-ai-projects/PostEmitter.ps1 @@ -267,6 +267,18 @@ $c = $c -replace '(a)\r?\n (max-duration `1001`)\r?\n (close, or a client $c = $c -replace '(prevented)\r?\n (finalization\.)', '$1 $2' Set-Content $f $c -NoNewline +# Fix get_session_log_stream hardcoding `_stream = True` instead of popping it from kwargs like +# every other streaming operation in this file does (`kwargs.pop("stream", True/False)`). Since it +# never pops "stream" out of kwargs, a caller passing stream=True (as the SSE-streaming contract of +# this operation invites) collides with the explicit `stream=_stream` kwarg forwarded to +# `self._client._pipeline.run()`, raising "got multiple values for keyword argument 'stream'". +$files = 'azure\ai\projects\operations\_operations.py', 'azure\ai\projects\aio\operations\_operations.py' +foreach ($f in $files) { + $c = Get-Content $f -Raw + $c = $c -replace '(_decompress = kwargs\.pop\("decompress", True\)\r?\n )_stream = True(\r?\n pipeline_response: PipelineResponse = (?:await )?self\._client\._pipeline\.run)', '${1}_stream = kwargs.pop("stream", True)$2' + Set-Content $f $c -NoNewline +} + # Finishing by running 'black' tool to format code. pip install black black --config ../../../eng/black-pyproject.toml . 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 ad1220bef998..543e1760b02b 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 @@ -2244,7 +2244,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", 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/operations/_operations.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py index 9e21c72f7f61..d6c77cc82b25 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 @@ -6093,7 +6093,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", True) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) diff --git a/sdk/ai/azure-ai-projects/samples/agents/sample_workflow_multi_agent.py b/sdk/ai/azure-ai-projects/samples/agents/sample_workflow_multi_agent.py index f2ce47c55b7c..fdecc0674a7d 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/sample_workflow_multi_agent.py +++ b/sdk/ai/azure-ai-projects/samples/agents/sample_workflow_multi_agent.py @@ -159,9 +159,9 @@ print(f"Event {event.sequence_number} type '{event.type}'", end="") if ( event.type in ("response.output_item.added", "response.output_item.done") - ) and event.item.type == "workflow_action": # pyright: ignore [reportAttributeAccessIssue] + ) and event.item.type == "workflow_action": # type: ignore[union-attr] # pyright: ignore [reportAttributeAccessIssue] print( - f": item action ID '{event.item.action_id}' is '{event.item.status}' (previous action ID: '{event.item.previous_action_id}')", # pyright: ignore [reportAttributeAccessIssue] + f": item action ID '{event.item.action_id}' is '{event.item.status}' (previous action ID: '{event.item.previous_action_id}')", # type: ignore[union-attr] # pyright: ignore [reportAttributeAccessIssue] end="", ) elif event.type == "response.completed": diff --git a/sdk/ai/azure-ai-projects/samples/agents/sample_workflow_multi_agent_async.py b/sdk/ai/azure-ai-projects/samples/agents/sample_workflow_multi_agent_async.py index 8673b7ac284d..c9f48d485b41 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/sample_workflow_multi_agent_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/sample_workflow_multi_agent_async.py @@ -161,9 +161,9 @@ async def main(): print(f"Event {event.sequence_number} type '{event.type}'", end="") if ( event.type in ("response.output_item.added", "response.output_item.done") - ) and event.item.type == "workflow_action": # pyright: ignore [reportAttributeAccessIssue] + ) and event.item.type == "workflow_action": # type: ignore[union-attr] # pyright: ignore [reportAttributeAccessIssue] print( - f": item action ID '{event.item.action_id}' is '{event.item.status}' (previous action ID: '{event.item.previous_action_id}')", # pyright: ignore [reportAttributeAccessIssue] + f": item action ID '{event.item.action_id}' is '{event.item.status}' (previous action ID: '{event.item.previous_action_id}')", # type: ignore[union-attr] # pyright: ignore [reportAttributeAccessIssue] end="", ) elif event.type == "response.completed": 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..666cfb2bea32 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 @@ -181,9 +181,9 @@ print(f"Event {event.sequence_number} type '{event.type}'", end="") if ( event.type in ("response.output_item.added", "response.output_item.done") - ) and event.item.type == "workflow_action": # pyright: ignore [reportAttributeAccessIssue] + ) and event.item.type == "workflow_action": # type: ignore[union-attr] # pyright: ignore [reportAttributeAccessIssue] print( - f": item action ID '{event.item.action_id}' is '{event.item.status}' (previous action ID: '{event.item.previous_action_id}')", # pyright: ignore [reportAttributeAccessIssue] + f": item action ID '{event.item.action_id}' is '{event.item.status}' (previous action ID: '{event.item.previous_action_id}')", # type: ignore[union-attr] # pyright: ignore [reportAttributeAccessIssue] end="", ) elif ( diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py index 3b7f8ec87ebb..6fc4a7fd8c68 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py @@ -320,9 +320,9 @@ async def audio_conversation() -> None: await project_client.agents.create_version( agent_name=agent_name, definition=VoiceAgentDefinition( - model_type=definition.model_type, - model=definition.model, - instructions=definition.instructions, + model_type=definition.model_type, # type: ignore[attr-defined] + model=definition.model, # type: ignore[attr-defined] + instructions=definition.instructions, # type: ignore[attr-defined] store=True, ), ) diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py index 3a9ba356ee55..c246be042c50 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py @@ -239,9 +239,9 @@ def text_conversation() -> None: project_client.agents.create_version( agent_name=agent_name, definition=VoiceAgentDefinition( - model_type=definition.model_type, - model=definition.model, - instructions=definition.instructions, + model_type=definition.model_type, # type: ignore[attr-defined] + model=definition.model, # type: ignore[attr-defined] + instructions=definition.instructions, # type: ignore[attr-defined] store=True, ), ) diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py index cc551354e513..882cde958ff4 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py @@ -241,9 +241,9 @@ async def text_conversation() -> None: await project_client.agents.create_version( agent_name=agent_name, definition=VoiceAgentDefinition( - model_type=definition.model_type, - model=definition.model, - instructions=definition.instructions, + model_type=definition.model_type, # type: ignore[attr-defined] + model=definition.model, # type: ignore[attr-defined] + instructions=definition.instructions, # type: ignore[attr-defined] store=True, ), ) From 7ff4a9512901b126965c67776b1524227657f5bf Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Thu, 20 Aug 2026 13:57:29 -0700 Subject: [PATCH 37/56] Regenerate SDK from TypeSpec (voice agents PR), fix generate_agent preview header injection - Regenerate from azure-rest-api-specs voice-agent PR latest commit (dcfcf524) - Fix generate_agent header-injection override: was defined on BetaAgentsOperations (which has no real generate_agent method) instead of AgentsOperations (where project_client.agents.generate_agent actually resolves), causing a live 403 preview_feature_required error. Fixed in both sync and async patch files. - Re-add PostEmitter.ps1 fixes dropped by the main-branch merge: voice_agent_web_socket removal, generate_agent single-overload merge, VoiceResponse Optional-narrowing type:ignore - Add regression test case for agents.generate_agent in foundry-features-header suite - Update docs/public-methods.md (stale agents method count/list) - Update tsp-location.yaml.saved, remove tsp-location.yaml per current workflow --- sdk/ai/azure-ai-projects/PostEmitter.ps1 | 201 +- .../azure-ai-projects/apiview-properties.json | 5 +- .../azure/ai/projects/_client.py | 2 +- .../azure/ai/projects/_configuration.py | 3 +- .../azure/ai/projects/_utils/model_base.py | 18 +- .../azure/ai/projects/_utils/serialization.py | 6 +- .../azure/ai/projects/aio/_client.py | 2 +- .../azure/ai/projects/aio/_configuration.py | 3 +- .../ai/projects/aio/operations/_operations.py | 2019 ++- .../aio/operations/_patch_agents_async.py | 84 +- .../azure/ai/projects/models/__init__.py | 18 + .../azure/ai/projects/models/_enums.py | 51 +- .../azure/ai/projects/models/_models.py | 12899 +++++++++++++--- .../ai/projects/operations/_operations.py | 987 +- .../ai/projects/operations/_patch_agents.py | 84 +- .../azure/ai/projects/types.py | 199 +- .../azure-ai-projects/docs/public-methods.md | 7 +- .../foundry_features_header_test_base.py | 4 + sdk/ai/azure-ai-projects/tsp-location.yaml | 28 - .../azure-ai-projects/tsp-location.yaml.saved | 3 +- 20 files changed, 13305 insertions(+), 3318 deletions(-) delete mode 100644 sdk/ai/azure-ai-projects/tsp-location.yaml diff --git a/sdk/ai/azure-ai-projects/PostEmitter.ps1 b/sdk/ai/azure-ai-projects/PostEmitter.ps1 index 4a7f6f2e519e..a5da85c8b185 100644 --- a/sdk/ai/azure-ai-projects/PostEmitter.ps1 +++ b/sdk/ai/azure-ai-projects/PostEmitter.ps1 @@ -26,7 +26,36 @@ git restore pyproject.toml # recursive-include samples *.py *.md git restore MANIFEST.in -# Force streaming in get_session_log_stream for both sync and async operations. +# Remove the generated `voice_agent_web_socket` operation group from the client's public surface +# entirely (import, docstring, and __init__ assignment). The generated operation only performs a +# plain HTTP GET (no WebSocket upgrade handshake) and discards the connection - it's not a usable +# client and was never meant to be public (the real voice-agent WebSocket client is `.realtime`). +$files = 'azure\ai\projects\_client.py', 'azure\ai\projects\aio\_client.py' +foreach ($f in $files) { + $lines = Get-Content $f + $out = New-Object System.Collections.Generic.List[string] + $skipUntilCloseParen = $false + foreach ($line in $lines) { + if ($skipUntilCloseParen) { + if ($line -match '^\s*\)\s*$') { $skipUntilCloseParen = $false } + continue + } + if ($line -match '^\s*VoiceAgentWebSocketOperations,\s*$') { continue } + if ($line -match '^\s*:ivar voice_agent_web_socket:') { continue } + if ($line -match '^\s*:vartype voice_agent_web_socket:') { continue } + if ($line -match '^\s*self\.voice_agent_web_socket = VoiceAgentWebSocketOperations\(\s*$') { + $skipUntilCloseParen = $true + continue + } + $out.Add($line) + } + Set-Content $f $out +} + +# get_session_log_stream must always treat the response as an SSE stream, but must still pop any +# caller-supplied stream= kwarg first -- otherwise it collides with the explicit stream=_stream +# argument passed to self._client._pipeline.run(), raising "got multiple values for keyword +# argument 'stream'" (hit by samples calling get_session_log_stream(..., stream=True)). $files = 'azure\ai\projects\operations\_operations.py', 'azure\ai\projects\aio\operations\_operations.py' foreach ($f in $files) { $lines = Get-Content $f @@ -39,9 +68,9 @@ foreach ($f in $files) { if ($inFunc -and $lines[$i] -match '^\s*(async\s+)?def\s+\w+\(') { $inFunc = $false } - if ($inFunc -and $lines[$i] -match 'kwargs\.pop\(.+stream.+False\)') { + if ($inFunc -and $lines[$i] -match '^\s*_stream = (True|kwargs\.pop\(.+\))\s*$') { $indent = ([regex]::Match($lines[$i], '^\s*')).Value - $lines[$i] = $indent + '_stream = True' + $lines[$i] = $indent + '_stream = kwargs.pop("stream", True)' } } Set-Content $f $lines @@ -86,6 +115,172 @@ foreach ($f in $files) { Set-Content $f $c -NoNewline } +# A block of code in the implementation of "list_memories", in both sync +# and async _operations.py files, needs to be moved up. It's emitted in the wrong place, +# in the inline function named "prepare_request". Instead it should be moved up into the +# main body of the "list_memories" method, right after the line `error_map.update(kwargs.pop("error_map", {}) or {})`. +# If you don't do this, the PR pipeline will show failures in Pyright (`error: "body" is unbound (reportUnboundVariable)`) +# and some tests will fail. This is the block of code that needs to move up: +# if body is _Unset: +# if scope is _Unset: +# raise TypeError("missing required argument: scope") +# body = {"scope": scope} +# body = {k: v for k, v in body.items() if v is not None} +# The block inside prepare_request has 12-space indentation; after moving to the main function body it needs 8-space indentation. +# Strategy: Find the last list_memories method, then do a targeted string replacement that moves the block right after error_map.update. +$oldPattern = @" + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + def prepare_request(_continuation_token=None): + if body is _Unset: + if scope is _Unset: + raise TypeError("missing required argument: scope") + body = {"scope": scope} + body = {k: v for k, v in body.items() if v is not None} + + _request = build_beta_memory_stores_list_memories_request( +"@ +$newPattern = @" + error_map.update(kwargs.pop("error_map", {}) or {}) + if body is _Unset: + if scope is _Unset: + raise TypeError("missing required argument: scope") + body = {"scope": scope} + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + def prepare_request(_continuation_token=None): + _request = build_beta_memory_stores_list_memories_request( +"@ +$files = 'azure\ai\projects\operations\_operations.py', 'azure\ai\projects\aio\operations\_operations.py' +foreach ($f in $files) { + $c = Get-Content $f -Raw + # Find all occurrences of "def list_memories(" and get the index of the last one + $methodMatches = [regex]::Matches($c, 'def list_memories\(') + if ($methodMatches.Count -eq 0) { continue } + $lastMethodStart = $methodMatches[$methodMatches.Count - 1].Index + + # Find the pattern to replace - first occurrence after the last list_memories method + $patternEscaped = [regex]::Escape($oldPattern) + $patternMatches = [regex]::Matches($c, $patternEscaped) + $matchToReplace = $null + foreach ($m in $patternMatches) { + if ($m.Index -gt $lastMethodStart) { + $matchToReplace = $m + break + } + } + if ($matchToReplace -eq $null) { continue } + + # Replace only that specific occurrence + $c = $c.Substring(0, $matchToReplace.Index) + $newPattern + $c.Substring($matchToReplace.Index + $matchToReplace.Length) + + Set-Content $f $c -NoNewline +} + + +# GenerateAgentRequest is a single-member union in TypeSpec (only GenerateVoiceAgentRequest so +# far), which makes the emitter produce exactly ONE @overload stub for generate_agent. That +# triggers two pyright errors in both sync and async _operations.py: +# - reportInconsistentOverload: a function needs 0 or 2+ @overloads, never exactly 1. +# - reportInvalidTypeForm: the real impl's body param is typed as the bare forward-reference +# string "_unions.GenerateAgentRequest", which isn't a proper importable type (single-member +# unions are emitted as a plain runtime alias, not a type pyright can resolve). +# Fix: drop the redundant single @overload stub entirely, and retype the real implementation's +# body parameter with the concrete model type (matching the overload stub's own type). Add a new +# @overload here (making it 2+) if a second voice/agent kind is ever added upstream instead. +$oldPatternSync = @" + @overload + def generate_agent( + self, body: _models.GenerateVoiceAgentRequest, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AgentDetails: + """Generate an agent. + + Generates and creates an agent from kind-specific high-level inputs. The generated definition + remains fully editable through the standard agent versioning operations. + + :param body: The kind-specific inputs for generating and creating an agent. Required. + :type body: ~azure.ai.projects.models.GenerateVoiceAgentRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AgentDetails. The AgentDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def generate_agent(self, body: "_unions.GenerateAgentRequest", **kwargs: Any) -> _models.AgentDetails: +"@ +$newPatternSync = @" + @distributed_trace + def generate_agent(self, body: _models.GenerateVoiceAgentRequest, **kwargs: Any) -> _models.AgentDetails: +"@ +$oldPatternAsync = @" + @overload + async def generate_agent( + self, body: _models.GenerateVoiceAgentRequest, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AgentDetails: + """Generate an agent. + + Generates and creates an agent from kind-specific high-level inputs. The generated definition + remains fully editable through the standard agent versioning operations. + + :param body: The kind-specific inputs for generating and creating an agent. Required. + :type body: ~azure.ai.projects.models.GenerateVoiceAgentRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AgentDetails. The AgentDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def generate_agent(self, body: "_unions.GenerateAgentRequest", **kwargs: Any) -> _models.AgentDetails: +"@ +$newPatternAsync = @" + @distributed_trace_async + async def generate_agent(self, body: _models.GenerateVoiceAgentRequest, **kwargs: Any) -> _models.AgentDetails: +"@ +$f = 'azure\ai\projects\operations\_operations.py' +$c = Get-Content $f -Raw +$c = $c.Replace($oldPatternSync, $newPatternSync) +Set-Content $f $c -NoNewline +$f = 'azure\ai\projects\aio\operations\_operations.py' +$c = Get-Content $f -Raw +$c = $c.Replace($oldPatternAsync, $newPatternAsync) +Set-Content $f $c -NoNewline + +# VoiceResponse narrows OmitPropertiesRealtimeResponse's optional `id`/`conversation_id` +# (Optional[str]) to required `str`, per the TypeSpec spec's explicit "Required." docstrings -- +# an intentional Azure-specific tightening of OpenAI's generic realtime response template (a +# persisted voice response always has both set). Pyright's reportIncompatibleVariableOverride +# flags this because narrowing a *mutable* attribute's type in a subclass isn't sound in general, +# but it's safe here by construction (the service never omits these for a persisted response). +$f = 'azure\ai\projects\models\_models.py' +$c = Get-Content $f -Raw +$c = $c.Replace( + " id: str = rest_field(visibility=[`"read`", `"create`", `"update`", `"delete`", `"query`"])`n `"`"`"The unique id of the response. Required.`"`"`"", + " id: str = rest_field(visibility=[`"read`", `"create`", `"update`", `"delete`", `"query`"]) # type: ignore[reportIncompatibleVariableOverride]`n `"`"`"The unique id of the response. Required.`"`"`"" +) +$c = $c.Replace( + " conversation_id: str = rest_field(visibility=[`"read`", `"create`", `"update`", `"delete`", `"query`"])`n `"`"`"The id of the conversation this response belongs to. Required.`"`"`"", + " conversation_id: str = rest_field(visibility=[`"read`", `"create`", `"update`", `"delete`", `"query`"]) # type: ignore[reportIncompatibleVariableOverride]`n `"`"`"The id of the conversation this response belongs to. Required.`"`"`"" +) +Set-Content $f $c -NoNewline + # Finishing by running 'black' tool to format code. pip install black black --config ../../../eng/black-pyproject.toml . diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index ddeb5405ace4..a7d4d4ab2ae9 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -333,6 +333,7 @@ "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.SessionConfiguration": "Azure.AI.Projects.SessionConfiguration", "azure.ai.projects.models.SessionDirectoryEntry": "Azure.AI.Projects.SessionDirectoryEntry", "azure.ai.projects.models.SessionFileWriteResult": "Azure.AI.Projects.SessionFileWriteResponse", "azure.ai.projects.models.SessionLogEvent": "Azure.AI.Projects.SessionLogEvent", @@ -516,6 +517,8 @@ "azure.ai.projects.models.VoiceSystemTool": "Azure.AI.Projects.VoiceSystemTool", "azure.ai.projects.models.VoiceToolboxTool": "Azure.AI.Projects.VoiceToolboxTool", "azure.ai.projects.models.VoiceUserMessageItem": "Azure.AI.Projects.VoiceUserMessageItem", + "azure.ai.projects.models.WebIQPreviewTool": "Azure.AI.Projects.WebIQPreviewTool", + "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", @@ -781,5 +784,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": "f23cc7b21030" + "CrossLanguageVersion": "ffc293e5009c" } \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py index fbb310d5efda..ac92e6ab8879 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py @@ -37,7 +37,7 @@ from azure.core.credentials import TokenCredential -class AIProjectClient: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only +class AIProjectClient: # pylint: disable=too-many-instance-attributes """AIProjectClient. :ivar beta: BetaOperations operations diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_configuration.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_configuration.py index 71772d698792..dbc21038f880 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_configuration.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_configuration.py @@ -1,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -17,7 +16,7 @@ from azure.core.credentials import TokenCredential -class AIProjectClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only +class AIProjectClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for AIProjectClient. Note that all parameters used to create this instance are saved as instance diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/model_base.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/model_base.py index 88aaf1823543..1934415c1369 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/model_base.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/model_base.py @@ -158,15 +158,7 @@ def _is_readonly(p): class SdkJSONEncoder(JSONEncoder): - """A JSON encoder that's capable of serializing datetime objects and bytes. - - :param args: Additional positional arguments passed to the base ``JSONEncoder``. - :type args: typing.Any - :keyword exclude_readonly: Whether to exclude readonly properties. Defaults to False. - :paramtype exclude_readonly: bool - :keyword format: The format to use for serialization. Defaults to None. - :paramtype format: typing.Optional[str] - """ + """A JSON encoder that's capable of serializing datetime objects and bytes.""" def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): super().__init__(*args, **kwargs) @@ -350,12 +342,6 @@ def _deserialize_int_as_str(attr): return int(attr) -def _deserialize_bool_as_str(attr): - if isinstance(attr, bool): - return attr - return attr.lower() == "true" - - _DESERIALIZE_MAPPING = { datetime: _deserialize_datetime, date: _deserialize_date, @@ -383,8 +369,6 @@ def _deserialize_bool_as_str(attr): def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): if annotation is int and rf and rf._format == "str": return _deserialize_int_as_str - if annotation is bool and rf and rf._format == "str": - return _deserialize_bool_as_str if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) if rf and rf._format: diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/serialization.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/serialization.py index ae08f9d89f74..75906e2eb77f 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/serialization.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/serialization.py @@ -480,11 +480,7 @@ def _decode_attribute_map_key(key): class Serializer: # pylint: disable=too-many-public-methods - """Request object model serializer. - - :param classes: Mapping of model names to model types, used to resolve models during serialization. - :type classes: typing.Optional[typing.Mapping[str, type]] - """ + """Request object model serializer.""" basic_types = {str: "str", int: "int", bool: "bool", float: "float"} diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py index 7fc3b32df9ab..1dd6ecac6c5e 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py @@ -37,7 +37,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class AIProjectClient: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only +class AIProjectClient: # pylint: disable=too-many-instance-attributes """AIProjectClient. :ivar beta: BetaOperations operations diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_configuration.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_configuration.py index 52e5a14d7b8b..bb5588e5968e 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_configuration.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_configuration.py @@ -1,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -17,7 +16,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class AIProjectClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only +class AIProjectClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for AIProjectClient. Note that all parameters used to create this instance are saved as instance 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 f3411470012d..3c78cbc8e408 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 @@ -32,7 +32,7 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict -from ... import models as _models +from ... import models as _models, types as _types from ..._utils.model_base import Model as _Model, SdkJSONEncoder, _deserialize, _failsafe_deserialize from ..._utils.serialization import Deserializer, Serializer from ..._utils.utils import prepare_multipart_form_data @@ -195,7 +195,7 @@ List = list -class BetaOperations: # pylint: disable=docstring-missing-param,too-many-instance-attributes +class BetaOperations: # pylint: disable=too-many-instance-attributes """ .. warning:: **DO NOT** instantiate this class directly. @@ -227,7 +227,7 @@ def __init__(self, *args, **kwargs) -> None: self.agents = BetaAgentsOperations(self._client, self._config, self._serialize, self._deserialize) -class AgentsOperations: # pylint: disable=docstring-missing-param,too-many-public-methods +class AgentsOperations: # pylint: disable=too-many-public-methods """ .. warning:: **DO NOT** instantiate this class directly. @@ -612,7 +612,12 @@ async def create_version( @overload async def create_version( - self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: _types.CreateAgentVersionRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentVersionDetails: """Create an agent version. @@ -626,7 +631,7 @@ async def create_version( * Must not exceed 63 characters. Required. :type agent_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateAgentVersionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -664,7 +669,7 @@ async def create_version( async def create_version( self, agent_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateAgentVersionRequest, IO[bytes]] = _Unset, *, definition: _models.AgentDefinition = _Unset, metadata: Optional[dict[str, str]] = None, @@ -684,8 +689,9 @@ async def create_version( * Can contain hyphens in the middle * Must not exceed 63 characters. Required. :type agent_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateAgentVersionRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.projects.types.CreateAgentVersionRequest or IO[bytes] :keyword definition: The agent definition. This can be a prompt, workflow, hosted, external, or voice agent definition. Required. :paramtype definition: ~azure.ai.projects.models.AgentDefinition @@ -832,7 +838,12 @@ async def create_version_from_manifest( @overload async def create_version_from_manifest( - self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: _types.CreateAgentVersionFromManifestRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentVersionDetails: """Create an agent version from manifest. @@ -846,7 +857,7 @@ async def create_version_from_manifest( * Must not exceed 63 characters. Required. :type agent_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateAgentVersionFromManifestRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -884,7 +895,7 @@ async def create_version_from_manifest( async def create_version_from_manifest( self, agent_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateAgentVersionFromManifestRequest, IO[bytes]] = _Unset, *, manifest_id: str = _Unset, parameter_values: dict[str, Any] = _Unset, @@ -903,8 +914,9 @@ async def create_version_from_manifest( * Can contain hyphens in the middle * Must not exceed 63 characters. Required. :type agent_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateAgentVersionFromManifestRequest, + IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.CreateAgentVersionFromManifestRequest or IO[bytes] :keyword manifest_id: The manifest ID to import the agent version from. Required. :paramtype manifest_id: str :keyword parameter_values: The inputs to the manifest that will result in a fully materialized @@ -1283,7 +1295,12 @@ async def update_details( @overload async def update_details( - self, agent_name: str, body: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any + self, + agent_name: str, + body: _types.PatchAgentObjectRequest, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any ) -> _models.AgentDetails: """Update an agent endpoint. @@ -1292,7 +1309,7 @@ async def update_details( :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.PatchAgentObjectRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -1325,7 +1342,7 @@ async def update_details( async def update_details( self, agent_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.PatchAgentObjectRequest, IO[bytes]] = _Unset, *, agent_endpoint: Optional[_models.AgentEndpointConfig] = None, agent_card: Optional[_models.AgentCard] = None, @@ -1337,8 +1354,8 @@ async def update_details( :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, PatchAgentObjectRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.PatchAgentObjectRequest or IO[bytes] :keyword agent_endpoint: The endpoint configuration for the agent. Default value is None. :paramtype agent_endpoint: ~azure.ai.projects.models.AgentEndpointConfig :keyword agent_card: Optional agent card for the agent. Default value is None. @@ -1426,14 +1443,19 @@ async def _create_version_from_code( ) -> _models.AgentVersionDetails: ... @overload async def _create_version_from_code( - self, agent_name: str, content: JSON, *, code_zip_sha256: str, **kwargs: Any + self, + agent_name: str, + content: _types._CreateAgentVersionFromCodeContent, + *, + code_zip_sha256: str, + **kwargs: Any ) -> _models.AgentVersionDetails: ... @distributed_trace_async async def _create_version_from_code( self, agent_name: str, - content: Union[_models._models._CreateAgentVersionFromCodeContent, JSON], + content: Union[_models._models._CreateAgentVersionFromCodeContent, _types._CreateAgentVersionFromCodeContent], *, code_zip_sha256: str, **kwargs: Any @@ -1452,9 +1474,10 @@ async def _create_version_from_code( * Can contain hyphens in the middle * Must not exceed 63 characters. Required. :type agent_name: str - :param content: The content multipart request content. Is either a - _CreateAgentVersionFromCodeContent type or a JSON type. Required. - :type content: ~azure.ai.projects.models._models._CreateAgentVersionFromCodeContent or JSON + :param content: The content multipart request content. Is one of the following types: + _CreateAgentVersionFromCodeContent Required. + :type content: ~azure.ai.projects.models._models._CreateAgentVersionFromCodeContent or + ~azure.ai.projects.types._CreateAgentVersionFromCodeContent :keyword code_zip_sha256: SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity verification. Required. :paramtype code_zip_sha256: str @@ -1751,7 +1774,12 @@ async def create_session( @overload async def create_session( - self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: _types.CreateSessionRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentSessionResource: """Create a session. @@ -1762,7 +1790,7 @@ async def create_session( :param agent_name: The name of the agent to create a session for. Required. :type agent_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateSessionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1797,7 +1825,7 @@ async def create_session( async def create_session( self, agent_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateSessionRequest, IO[bytes]] = _Unset, *, version_indicator: _models.VersionIndicator = _Unset, agent_session_id: Optional[str] = None, @@ -1811,8 +1839,8 @@ async def create_session( :param agent_name: The name of the agent to create a session for. Required. :type agent_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateSessionRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.CreateSessionRequest or IO[bytes] :keyword version_indicator: Determines which agent version backs the session. Required. :paramtype version_indicator: ~azure.ai.projects.models.VersionIndicator :keyword agent_session_id: Optional caller-provided session ID. If specified, it must be unique @@ -2277,16 +2305,9 @@ async def get_session_log_stream( return deserialized # type: ignore - @overload + @distributed_trace_async async def upload_session_file( - self, - agent_name: str, - session_id: str, - content: bytes, - *, - path: str, - content_type: str = "application/octet-stream", - **kwargs: Any + self, agent_name: str, session_id: str, content: bytes, *, path: str, **kwargs: Any ) -> _models.SessionFileWriteResult: """Upload a session file. @@ -2302,65 +2323,6 @@ async def upload_session_file( :keyword path: The destination file path within the sandbox, relative to the session home directory. Required. :paramtype path: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/octet-stream". - :paramtype content_type: str - :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.SessionFileWriteResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def upload_session_file( - self, - agent_name: str, - session_id: str, - content: IO[bytes], - *, - path: str, - content_type: str = "application/octet-stream", - **kwargs: Any - ) -> _models.SessionFileWriteResult: - """Upload a session file. - - Uploads binary file content to the specified path in the session sandbox. The service stores - the file relative to the session home directory and rejects payloads larger than 50 MB. - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param session_id: The session ID. Required. - :type session_id: str - :param content: Required. - :type content: IO[bytes] - :keyword path: The destination file path within the sandbox, relative to the session home - directory. Required. - :paramtype path: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/octet-stream". - :paramtype content_type: str - :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.SessionFileWriteResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def upload_session_file( - self, agent_name: str, session_id: str, content: Union[bytes, IO[bytes]], *, path: str, **kwargs: Any - ) -> _models.SessionFileWriteResult: - """Upload a session file. - - Uploads binary file content to the specified path in the session sandbox. The service stores - the file relative to the session home directory and rejects payloads larger than 50 MB. - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param session_id: The session ID. Required. - :type session_id: str - :param content: Is either a bytes type or a IO[bytes] type. Required. - :type content: bytes or IO[bytes] - :keyword path: The destination file path within the sandbox, relative to the session home - directory. Required. - :paramtype path: str :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping :rtype: ~azure.ai.projects.models.SessionFileWriteResult :raises ~azure.core.exceptions.HttpResponseError: @@ -2376,10 +2338,9 @@ async def upload_session_file( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/octet-stream")) cls: ClsType[_models.SessionFileWriteResult] = kwargs.pop("cls", None) - content_type = content_type or "application/octet-stream" _content = content _request = build_agents_upload_session_file_request( @@ -2559,78 +2520,1229 @@ def list_session_files( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(_continuation_token=None): + def prepare_request(_continuation_token=None): + + _request = build_agents_list_session_files_request( + agent_name=agent_name, + session_id=session_id, + path=path, + 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.SessionDirectoryEntry], + deserialized.get("entries", []), + ) + 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 delete_session_file( + self, agent_name: str, session_id: str, *, path: str, recursive: Optional[bool] = None, **kwargs: Any + ) -> None: + """Delete a session file. + + Deletes the specified file or directory from the session sandbox. When ``recursive`` is false, + deleting a non-empty directory returns 409 Conflict. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param session_id: The session ID. Required. + :type session_id: str + :keyword path: The file or directory path to delete, relative to the session home directory. + Required. + :paramtype path: str + :keyword recursive: Whether to recursively delete directory contents. The service defaults to + ``false`` if a value is not specified by the caller. Default value is None. + :paramtype recursive: bool + :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_agents_delete_session_file_request( + agent_name=agent_name, + session_id=session_id, + path=path, + recursive=recursive, + 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 + + +class VoiceAgentWebSocketOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.aio.AIProjectClient`'s + :attr:`voice_agent_web_socket` 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_async + async def connect_voice_agent( + self, + agent_name: str, + *, + agent_session_id: Optional[str] = None, + store: Optional[bool] = None, + agent_version_override: Optional[str] = None, + websocket_subprotocol: Optional[Union[str, _models.VoiceAgentWebSocketSubprotocol]] = None, + structured_inputs: Optional[str] = None, + **kwargs: Any + ) -> None: + """Connect to a voice agent. + + Connects to a voice agent over WebSocket. The client must send an HTTP GET with ``Upgrade: + websocket`` + headers. The optional ``realtime`` subprotocol is the only accepted subprotocol value. + + If the target agent is disabled, the HTTP WebSocket handshake fails before the ``101 Switching + Protocols`` + upgrade. The service returns ``409 Conflict`` using the shared Foundry ``ApiErrorResponse`` + shape with + ``error.code = agent_disabled``. This failure is terminal until the caller enables the agent. + + :param agent_name: The name of the voice agent. Required. + :type agent_name: str + :keyword agent_session_id: An optional identifier used to correlate the voice session. Default + value is None. + :paramtype agent_session_id: str + :keyword store: Whether to persist the conversation created by this WebSocket session. If + omitted, the service honors the + persisted voice agent definition's configured ``store`` value. If supplied, this value + overrides the + definition's ``store`` setting for this session only. Default value is None. + :paramtype store: bool + :keyword agent_version_override: Selects a specific version of the voice agent for this + session. Default value is None. + :paramtype agent_version_override: str + :keyword websocket_subprotocol: The requested WebSocket subprotocol. Omit this header or + request exactly ``realtime``. "realtime" Default value is None. + :paramtype websocket_subprotocol: str or + ~azure.ai.projects.models.VoiceAgentWebSocketSubprotocol + :keyword structured_inputs: A JSON object that maps structured-input names to their values for + this session. Default value is None. + :paramtype structured_inputs: 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_voice_agent_web_socket_connect_voice_agent_request( + agent_name=agent_name, + agent_session_id=agent_session_id, + store=store, + agent_version_override=agent_version_override, + websocket_subprotocol=websocket_subprotocol, + structured_inputs=structured_inputs, + 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 [101]: + 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["Sec-WebSocket-Protocol"] = self._deserialize( + "str", response.headers.get("Sec-WebSocket-Protocol") + ) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + +class AgentEndpointConversationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.aio.AIProjectClient`'s + :attr:`agent_endpoint_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_agent_conversations( + self, + agent_name: str, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.VoiceConversation"]: + """List voice agent conversations. + + Returns the conversations persisted for the specified voice agent endpoint. Conversations are + present only when the agent definition has ``store = true``. + + :param agent_name: The name of the 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 VoiceConversation + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.VoiceConversation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VoiceConversation]] = 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_agent_endpoint_conversations_list_agent_conversations_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.VoiceConversation], + 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_agent_conversation( + self, agent_name: str, conversation_id: str, **kwargs: Any + ) -> _models.VoiceConversation: + """Get a voice agent conversation. + + Retrieves a single conversation recorded for the specified voice agent endpoint by its id. + Returns ``404`` when the conversation was not persisted (``store = false``) or does not exist. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation to retrieve. Required. + :type conversation_id: str + :return: VoiceConversation. The VoiceConversation is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceConversation + :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.VoiceConversation] = kwargs.pop("cls", None) + + _request = build_agent_endpoint_conversations_get_agent_conversation_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.VoiceConversation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete_agent_conversation(self, agent_name: str, conversation_id: str, **kwargs: Any) -> None: + """Delete a voice agent conversation. + + Deletes a conversation and all of its stored data — responses, items, and any audio (cascade). + This is the customer's explicit data-deletion control for voice conversations. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation to delete. 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_agent_endpoint_conversations_delete_agent_conversation_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_agent_conversation_responses( + 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.VoiceResponse"]: + """List responses in a voice agent conversation. + + Returns a paged collection of the responses (model inference turns) recorded for the specified + conversation. The per-response ``output`` projection may be omitted here; use the + response-items route for the canonical paged output. Returns ``404`` when the conversation was + not persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose responses are listed. 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 VoiceResponse + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.VoiceResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VoiceResponse]] = 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_agent_endpoint_conversations_list_agent_conversation_responses_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.VoiceResponse], + 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_agent_conversation_response( + self, agent_name: str, conversation_id: str, response_id: str, **kwargs: Any + ) -> _models.VoiceResponse: + """Get a voice agent conversation response. + + Retrieves a single response from the specified conversation by its id, including its ``output`` + items, ``usage``, and status. Returns ``404`` when the conversation or response was not + persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the response. Required. + :type conversation_id: str + :param response_id: The id of the response to retrieve. Required. + :type response_id: str + :return: VoiceResponse. The VoiceResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceResponse + :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.VoiceResponse] = kwargs.pop("cls", None) + + _request = build_agent_endpoint_conversations_get_agent_conversation_response_request( + agent_name=agent_name, + conversation_id=conversation_id, + response_id=response_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.VoiceResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_agent_conversation_response_items( + self, + agent_name: str, + conversation_id: str, + response_id: str, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.VoiceConversationItem"]: + """List items produced by a voice agent conversation response. + + Returns a paged collection of the output items produced by a specific response (the response's + output projection). For the complete ordered conversation history — including user input and + client-created tool outputs — use the conversation items route instead. Returns ``404`` when + the conversation or response was not persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the response. Required. + :type conversation_id: str + :param response_id: The id of the response whose output items are listed. Required. + :type response_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 VoiceConversationItem + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.VoiceConversationItem] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VoiceConversationItem]] = 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_agent_endpoint_conversations_list_agent_conversation_response_items_request( + agent_name=agent_name, + conversation_id=conversation_id, + response_id=response_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.VoiceConversationItem], + 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 + def list_agent_conversation_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.VoiceConversationItem"]: + """List items in a voice agent conversation. + + Returns a paged collection of items — the complete ordered conversation history, including user + input, assistant output, and client-created tool outputs (transcripts + tool events). Returns + ``404`` when the conversation was not persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose items are listed. 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 VoiceConversationItem + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.VoiceConversationItem] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VoiceConversationItem]] = 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_agent_endpoint_conversations_list_agent_conversation_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.VoiceConversationItem], + 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_agent_conversation_item( + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.VoiceConversationItem: + """Get a voice agent conversation item. + + Retrieves a single item from the specified conversation by its id, including its transcript. An + ``input_audio``/``output_audio`` content part indicates that audio is available for the item; + the canonical per-item audio metadata is the ``/items/{item_id}/audio`` resource, and the bytes + are streamed by ``/items/{item_id}/audio/content``. Returns ``404`` when the conversation or + item was not persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item to retrieve. Required. + :type item_id: str + :return: VoiceConversationItem. The VoiceConversationItem is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceConversationItem + :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.VoiceConversationItem] = kwargs.pop("cls", None) + + _request = build_agent_endpoint_conversations_get_agent_conversation_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.VoiceConversationItem, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_agent_conversation_item_audio( + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.VoiceItemAudioResponse: + """Get a voice agent conversation item's audio metadata. + + Returns metadata for a single conversation item's audio segment, including the common playback + facts (role, format/codec, sample rate, channels, offset, duration) for both Foundry-managed + and bring-your-own-storage (BYOS) recordings; for BYOS the response additionally includes + ``blob_uri``, the URI of the recording in the customer's own storage (no SAS) that the customer + downloads with their own credentials. Requires the conversation to have persisted audio + (``store = true``); returns ``404`` when the conversation, item, or its audio was not + persisted. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose audio metadata is retrieved. Required. + :type item_id: str + :return: VoiceItemAudioResponse. The VoiceItemAudioResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceItemAudioResponse + :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.VoiceItemAudioResponse] = kwargs.pop("cls", None) + + _request = build_agent_endpoint_conversations_get_agent_conversation_item_audio_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.VoiceItemAudioResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_agent_conversation_item_audio_content( # pylint: disable=name-too-long + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + """Stream a voice agent conversation item's audio. + + Streams a single conversation item's audio as a WAV (``audio/wav``) byte stream through the + service (no SAS URL). This route serves Foundry-managed storage only. For + bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download + directly from customer storage using the ``blob_uri`` returned by the item's ``/audio`` + metadata route — so this route returns ``409 Conflict`` for BYOS recordings. Returns ``404`` + when the conversation, item, or its audio was not persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose audio is streamed. 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_agent_endpoint_conversations_get_agent_conversation_item_audio_content_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_agent_conversation_audio( + self, agent_name: str, conversation_id: str, **kwargs: Any + ) -> _models.VoiceRecordingResponse: + """Get a voice agent conversation's merged recording metadata. + + Returns metadata for the whole-call merged stereo recording (user audio on the left channel, + agent audio on the right). The common metadata (format, sample rate, channels, channel layout, + duration) is returned for both Foundry-managed and bring-your-own-storage (BYOS) recordings; + for BYOS the response additionally includes ``blob_uri``, the URI of the recording in the + customer's own storage (no SAS) that the customer downloads with their own credentials. The + recording is built once from the per-turn segments after persistence finalization succeeds. + While the conversation is ``in_progress``, this route returns retriable ``409 Conflict`` with + ``error.code = recording_not_ready`` and a ``Retry-After`` header when retry guidance is + available. When the conversation is ``failed``, it returns terminal ``409 Conflict`` with + ``error.code = recording_unavailable``. For a ``completed`` conversation, metadata is available + subject to the existing BYOS behavior. Requires the conversation to have persisted audio + (``store = true``); otherwise returns ``404``. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose merged recording metadata is + retrieved. Required. + :type conversation_id: str + :return: VoiceRecordingResponse. The VoiceRecordingResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceRecordingResponse + :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 {} - _request = build_agents_list_session_files_request( - agent_name=agent_name, - session_id=session_id, - path=path, - 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 + cls: ClsType[_models.VoiceRecordingResponse] = kwargs.pop("cls", None) - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.SessionDirectoryEntry], - deserialized.get("entries", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("last_id") or None, AsyncList(list_of_elem) + _request = build_agent_endpoint_conversations_get_agent_conversation_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) - async def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) + _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 + ) - _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, ) - response = pipeline_response.http_response + raise HttpResponseError(response=response, model=error) - 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) + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VoiceRecordingResponse, response.json()) - return pipeline_response + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore - return AsyncItemPaged(get_next, extract_data) + return deserialized # type: ignore @distributed_trace_async - async def delete_session_file( - self, agent_name: str, session_id: str, *, path: str, recursive: Optional[bool] = None, **kwargs: Any - ) -> None: - """Delete a session file. - - Deletes the specified file or directory from the session sandbox. When ``recursive`` is false, - deleting a non-empty directory returns 409 Conflict. + async def get_agent_conversation_audio_content( + self, agent_name: str, conversation_id: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + """Stream a voice agent conversation's merged recording. + + Streams the whole-call merged stereo recording as a WAV (``audio/wav``) byte stream through the + service (no SAS URL). This route serves Foundry-managed storage only. For + bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download + directly from customer storage using the ``blob_uri`` returned by the metadata route — so this + route returns ``409 Conflict`` for BYOS recordings. While the conversation is ``in_progress``, + this route returns retriable ``409 Conflict`` with ``error.code = recording_not_ready`` and a + ``Retry-After`` header when retry guidance is available. When the conversation is ``failed``, + it returns terminal ``409 Conflict`` with ``error.code = recording_unavailable``. For a + ``completed`` conversation, content is available subject to the existing BYOS behavior. A + conversation without persisted audio (``store = false``) returns ``404``. :param agent_name: The name of the agent. Required. :type agent_name: str - :param session_id: The session ID. Required. - :type session_id: str - :keyword path: The file or directory path to delete, relative to the session home directory. + :param conversation_id: The id of the conversation whose merged recording is streamed. Required. - :paramtype path: str - :keyword recursive: Whether to recursively delete directory contents. The service defaults to - ``false`` if a value is not specified by the caller. Default value is None. - :paramtype recursive: bool - :return: None - :rtype: None + :type conversation_id: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2644,13 +3756,11 @@ async def delete_session_file( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_agents_delete_session_file_request( + _request = build_agent_endpoint_conversations_get_agent_conversation_audio_content_request( agent_name=agent_name, - session_id=session_id, - path=path, - recursive=recursive, + conversation_id=conversation_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -2660,14 +3770,20 @@ async def delete_session_file( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _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 [204]: + 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, @@ -2675,11 +3791,18 @@ async def delete_session_file( ) 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, None, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore -class EvaluationRulesOperations: # pylint: disable=docstring-missing-param +class EvaluationRulesOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -2831,7 +3954,7 @@ async def create_or_update( @overload async def create_or_update( - self, id: str, evaluation_rule: JSON, *, content_type: str = "application/json", **kwargs: Any + self, id: str, evaluation_rule: _types.EvaluationRule, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationRule: """Create or update an evaluation rule. @@ -2840,7 +3963,7 @@ async def create_or_update( :param id: Unique identifier for the evaluation rule. Required. :type id: str :param evaluation_rule: Evaluation rule resource. Required. - :type evaluation_rule: JSON + :type evaluation_rule: ~azure.ai.projects.types.EvaluationRule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2871,7 +3994,7 @@ async def create_or_update( @distributed_trace_async async def create_or_update( - self, id: str, evaluation_rule: Union[_models.EvaluationRule, JSON, IO[bytes]], **kwargs: Any + self, id: str, evaluation_rule: Union[_models.EvaluationRule, _types.EvaluationRule, IO[bytes]], **kwargs: Any ) -> _models.EvaluationRule: """Create or update an evaluation rule. @@ -2879,9 +4002,10 @@ async def create_or_update( :param id: Unique identifier for the evaluation rule. Required. :type id: str - :param evaluation_rule: Evaluation rule resource. Is one of the following types: - EvaluationRule, JSON, IO[bytes] Required. - :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule or JSON or IO[bytes] + :param evaluation_rule: Evaluation rule resource. Is either a EvaluationRule type or a + IO[bytes] type. Required. + :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule or + ~azure.ai.projects.types.EvaluationRule or IO[bytes] :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationRule :raises ~azure.core.exceptions.HttpResponseError: @@ -3056,7 +4180,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class ConnectionsOperations: # pylint: disable=docstring-missing-param +class ConnectionsOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -3317,7 +4441,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class DatasetsOperations: # pylint: disable=docstring-missing-param +class DatasetsOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -3671,7 +4795,7 @@ async def create_or_update( self, name: str, version: str, - dataset_version: JSON, + dataset_version: _types.DatasetVersion, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -3685,7 +4809,7 @@ async def create_or_update( :param version: The specific version id of the DatasetVersion to create or update. Required. :type version: str :param dataset_version: The DatasetVersion to create or update. Required. - :type dataset_version: JSON + :type dataset_version: ~azure.ai.projects.types.DatasetVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -3724,7 +4848,11 @@ async def create_or_update( @distributed_trace_async async def create_or_update( - self, name: str, version: str, dataset_version: Union[_models.DatasetVersion, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + version: str, + dataset_version: Union[_models.DatasetVersion, _types.DatasetVersion, IO[bytes]], + **kwargs: Any ) -> _models.DatasetVersion: """Create or update a version. @@ -3734,9 +4862,10 @@ async def create_or_update( :type name: str :param version: The specific version id of the DatasetVersion to create or update. Required. :type version: str - :param dataset_version: The DatasetVersion to create or update. Is one of the following types: - DatasetVersion, JSON, IO[bytes] Required. - :type dataset_version: ~azure.ai.projects.models.DatasetVersion or JSON or IO[bytes] + :param dataset_version: The DatasetVersion to create or update. Is either a DatasetVersion type + or a IO[bytes] type. Required. + :type dataset_version: ~azure.ai.projects.models.DatasetVersion or + ~azure.ai.projects.types.DatasetVersion or IO[bytes] :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -3836,7 +4965,7 @@ async def pending_upload( self, name: str, version: str, - pending_upload_request: JSON, + pending_upload_request: _types.PendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any @@ -3850,7 +4979,7 @@ async def pending_upload( :param version: The specific version id of the DatasetVersion to operate on. Required. :type version: str :param pending_upload_request: The pending upload request parameters. Required. - :type pending_upload_request: JSON + :type pending_upload_request: ~azure.ai.projects.types.PendingUploadRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3892,7 +5021,7 @@ async def pending_upload( self, name: str, version: str, - pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], + pending_upload_request: Union[_models.PendingUploadRequest, _types.PendingUploadRequest, IO[bytes]], **kwargs: Any ) -> _models.PendingUploadResponse: """Start a pending upload. @@ -3903,10 +5032,10 @@ async def pending_upload( :type name: str :param version: The specific version id of the DatasetVersion to operate on. Required. :type version: str - :param pending_upload_request: The pending upload request parameters. Is one of the following - types: PendingUploadRequest, JSON, IO[bytes] Required. - :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or JSON or - IO[bytes] + :param pending_upload_request: The pending upload request parameters. Is either a + PendingUploadRequest type or a IO[bytes] type. Required. + :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or + ~azure.ai.projects.types.PendingUploadRequest or IO[bytes] :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -4040,7 +5169,7 @@ async def get_credentials(self, name: str, version: str, **kwargs: Any) -> _mode return deserialized # type: ignore -class DeploymentsOperations: # pylint: disable=docstring-missing-param +class DeploymentsOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -4235,7 +5364,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class IndexesOperations: # pylint: disable=docstring-missing-param +class IndexesOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -4586,7 +5715,13 @@ async def create_or_update( @overload async def create_or_update( - self, name: str, version: str, index: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any + self, + name: str, + version: str, + index: _types.Index, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any ) -> _models.Index: """Create or update a version. @@ -4597,7 +5732,7 @@ async def create_or_update( :param version: The specific version id of the Index to create or update. Required. :type version: str :param index: The Index to create or update. Required. - :type index: JSON + :type index: ~azure.ai.projects.types.Index :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -4636,7 +5771,7 @@ async def create_or_update( @distributed_trace_async async def create_or_update( - self, name: str, version: str, index: Union[_models.Index, JSON, IO[bytes]], **kwargs: Any + self, name: str, version: str, index: Union[_models.Index, _types.Index, IO[bytes]], **kwargs: Any ) -> _models.Index: """Create or update a version. @@ -4646,9 +5781,9 @@ async def create_or_update( :type name: str :param version: The specific version id of the Index to create or update. Required. :type version: str - :param index: The Index to create or update. Is one of the following types: Index, JSON, - IO[bytes] Required. - :type index: ~azure.ai.projects.models.Index or JSON or IO[bytes] + :param index: The Index to create or update. Is either a Index type or a IO[bytes] type. + Required. + :type index: ~azure.ai.projects.models.Index or ~azure.ai.projects.types.Index or IO[bytes] :return: Index. The Index is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Index :raises ~azure.core.exceptions.HttpResponseError: @@ -4716,7 +5851,7 @@ async def create_or_update( return deserialized # type: ignore -class ToolboxesOperations: # pylint: disable=docstring-missing-param +class ToolboxesOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -4776,7 +5911,12 @@ async def create_version( @overload async def create_version( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + body: _types.CreateToolboxVersionRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.ToolboxVersionObject: """Create a new version of a toolbox. @@ -4786,7 +5926,7 @@ async def create_version( Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateToolboxVersionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4820,7 +5960,7 @@ async def create_version( async def create_version( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateToolboxVersionRequest, IO[bytes]] = _Unset, *, tools: List[_models.ToolboxTool] = _Unset, description: Optional[str] = None, @@ -4836,8 +5976,9 @@ async def create_version( :param name: The name of the toolbox. If the toolbox does not exist, it will be created. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateToolboxVersionRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.projects.types.CreateToolboxVersionRequest or IO[bytes] :keyword tools: The list of tools to include in this version. Required. :paramtype tools: list[~azure.ai.projects.models.ToolboxTool] :keyword description: A human-readable description of the toolbox. Default value is None. @@ -5279,7 +6420,7 @@ async def update( @overload async def update( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.UpdateToolboxRequest1, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. @@ -5288,7 +6429,7 @@ async def update( :param name: The name of the toolbox to update. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.UpdateToolboxRequest1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5319,7 +6460,12 @@ async def update( @distributed_trace_async async def update( - self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, default_version: str = _Unset, **kwargs: Any + self, + name: str, + body: Union[JSON, _types.UpdateToolboxRequest1, IO[bytes]] = _Unset, + *, + default_version: str = _Unset, + **kwargs: Any ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. @@ -5327,8 +6473,8 @@ async def update( :param name: The name of the toolbox to update. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, UpdateToolboxRequest1, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.UpdateToolboxRequest1 or IO[bytes] :keyword 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. :paramtype default_version: str @@ -5518,7 +6664,7 @@ async def delete_version(self, name: str, version: str, **kwargs: Any) -> None: return cls(pipeline_response, None, {}) # type: ignore -class BetaEvaluationTaxonomiesOperations: # pylint: disable=docstring-missing-param +class BetaEvaluationTaxonomiesOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -5769,7 +6915,7 @@ async def create( @overload async def create( - self, name: str, taxonomy: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, taxonomy: _types.EvaluationTaxonomy, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. @@ -5778,7 +6924,7 @@ async def create( :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. - :type taxonomy: JSON + :type taxonomy: ~azure.ai.projects.types.EvaluationTaxonomy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5809,7 +6955,10 @@ async def create( @distributed_trace_async async def create( - self, name: str, taxonomy: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + taxonomy: Union[_models.EvaluationTaxonomy, _types.EvaluationTaxonomy, IO[bytes]], + **kwargs: Any ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. @@ -5817,9 +6966,10 @@ async def create( :param name: The name of the evaluation taxonomy. Required. :type name: str - :param taxonomy: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, - JSON, IO[bytes] Required. - :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] + :param taxonomy: The evaluation taxonomy. Is either a EvaluationTaxonomy type or a IO[bytes] + type. Required. + :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or + ~azure.ai.projects.types.EvaluationTaxonomy or IO[bytes] :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: @@ -5907,7 +7057,7 @@ async def update( @overload async def update( - self, name: str, taxonomy: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, taxonomy: _types.EvaluationTaxonomy, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. @@ -5916,7 +7066,7 @@ async def update( :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. - :type taxonomy: JSON + :type taxonomy: ~azure.ai.projects.types.EvaluationTaxonomy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5947,7 +7097,10 @@ async def update( @distributed_trace_async async def update( - self, name: str, taxonomy: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + taxonomy: Union[_models.EvaluationTaxonomy, _types.EvaluationTaxonomy, IO[bytes]], + **kwargs: Any ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. @@ -5955,9 +7108,10 @@ async def update( :param name: The name of the evaluation taxonomy. Required. :type name: str - :param taxonomy: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, - JSON, IO[bytes] Required. - :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] + :param taxonomy: The evaluation taxonomy. Is either a EvaluationTaxonomy type or a IO[bytes] + type. Required. + :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or + ~azure.ai.projects.types.EvaluationTaxonomy or IO[bytes] :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: @@ -6024,7 +7178,7 @@ async def update( return deserialized # type: ignore -class BetaEvaluatorsOperations: # pylint: disable=docstring-missing-param +class BetaEvaluatorsOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -6401,7 +7555,12 @@ async def create_version( @overload async def create_version( - self, name: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + evaluator_version: _types.EvaluatorVersion, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.EvaluatorVersion: """Create an evaluator version. @@ -6410,7 +7569,7 @@ async def create_version( :param name: The name of the resource. Required. :type name: str :param evaluator_version: Required. - :type evaluator_version: JSON + :type evaluator_version: ~azure.ai.projects.types.EvaluatorVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6441,7 +7600,10 @@ async def create_version( @distributed_trace_async async def create_version( - self, name: str, evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + evaluator_version: Union[_models.EvaluatorVersion, _types.EvaluatorVersion, IO[bytes]], + **kwargs: Any ) -> _models.EvaluatorVersion: """Create an evaluator version. @@ -6449,9 +7611,9 @@ async def create_version( :param name: The name of the resource. Required. :type name: str - :param evaluator_version: Is one of the following types: EvaluatorVersion, JSON, IO[bytes] - Required. - :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or JSON or IO[bytes] + :param evaluator_version: Is either a EvaluatorVersion type or a IO[bytes] type. Required. + :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or + ~azure.ai.projects.types.EvaluatorVersion or IO[bytes] :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -6547,7 +7709,13 @@ async def update_version( @overload async def update_version( - self, name: str, version: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + version: str, + evaluator_version: _types.EvaluatorVersion, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.EvaluatorVersion: """Update an evaluator version. @@ -6558,7 +7726,7 @@ async def update_version( :param version: The version of the EvaluatorVersion to update. Required. :type version: str :param evaluator_version: Evaluator resource. Required. - :type evaluator_version: JSON + :type evaluator_version: ~azure.ai.projects.types.EvaluatorVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6600,7 +7768,7 @@ async def update_version( self, name: str, version: str, - evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], + evaluator_version: Union[_models.EvaluatorVersion, _types.EvaluatorVersion, IO[bytes]], **kwargs: Any ) -> _models.EvaluatorVersion: """Update an evaluator version. @@ -6611,9 +7779,10 @@ async def update_version( :type name: str :param version: The version of the EvaluatorVersion to update. Required. :type version: str - :param evaluator_version: Evaluator resource. Is one of the following types: EvaluatorVersion, - JSON, IO[bytes] Required. - :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or JSON or IO[bytes] + :param evaluator_version: Evaluator resource. Is either a EvaluatorVersion type or a IO[bytes] + type. Required. + :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or + ~azure.ai.projects.types.EvaluatorVersion or IO[bytes] :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -6714,7 +7883,7 @@ async def pending_upload( self, name: str, version: str, - pending_upload_request: JSON, + pending_upload_request: _types.PendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any @@ -6729,7 +7898,7 @@ async def pending_upload( :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str :param pending_upload_request: The pending upload request parameters. Required. - :type pending_upload_request: JSON + :type pending_upload_request: ~azure.ai.projects.types.PendingUploadRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6772,7 +7941,7 @@ async def pending_upload( self, name: str, version: str, - pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], + pending_upload_request: Union[_models.PendingUploadRequest, _types.PendingUploadRequest, IO[bytes]], **kwargs: Any ) -> _models.PendingUploadResponse: """Start a pending upload. @@ -6784,10 +7953,10 @@ async def pending_upload( :type name: str :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str - :param pending_upload_request: The pending upload request parameters. Is one of the following - types: PendingUploadRequest, JSON, IO[bytes] Required. - :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or JSON or - IO[bytes] + :param pending_upload_request: The pending upload request parameters. Is either a + PendingUploadRequest type or a IO[bytes] type. Required. + :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or + ~azure.ai.projects.types.PendingUploadRequest or IO[bytes] :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -6892,7 +8061,7 @@ async def get_credentials( self, name: str, version: str, - credential_request: JSON, + credential_request: _types.EvaluatorCredentialRequest, *, content_type: str = "application/json", **kwargs: Any @@ -6907,7 +8076,7 @@ async def get_credentials( :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str :param credential_request: The credential request parameters. Required. - :type credential_request: JSON + :type credential_request: ~azure.ai.projects.types.EvaluatorCredentialRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6950,7 +8119,7 @@ async def get_credentials( self, name: str, version: str, - credential_request: Union[_models.EvaluatorCredentialRequest, JSON, IO[bytes]], + credential_request: Union[_models.EvaluatorCredentialRequest, _types.EvaluatorCredentialRequest, IO[bytes]], **kwargs: Any ) -> _models.DatasetCredential: """Get evaluator credentials. @@ -6962,10 +8131,10 @@ async def get_credentials( :type name: str :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str - :param credential_request: The credential request parameters. Is one of the following types: - EvaluatorCredentialRequest, JSON, IO[bytes] Required. - :type credential_request: ~azure.ai.projects.models.EvaluatorCredentialRequest or JSON or - IO[bytes] + :param credential_request: The credential request parameters. Is either a + EvaluatorCredentialRequest type or a IO[bytes] type. Required. + :type credential_request: ~azure.ai.projects.models.EvaluatorCredentialRequest or + ~azure.ai.projects.types.EvaluatorCredentialRequest or IO[bytes] :return: DatasetCredential. The DatasetCredential is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetCredential :raises ~azure.core.exceptions.HttpResponseError: @@ -7038,7 +8207,7 @@ async def get_credentials( async def _create_generation_job_initial( self, - job: Union[_models.EvaluatorGenerationJob, JSON, IO[bytes]], + job: Union[_models.EvaluatorGenerationJob, _types.EvaluatorGenerationJob, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -7138,7 +8307,12 @@ async def begin_create_generation_job( @overload async def begin_create_generation_job( - self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any + self, + job: _types.EvaluatorGenerationJob, + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any ) -> AsyncLROPoller[_models.EvaluatorVersion]: """Create an evaluator generation job. @@ -7146,7 +8320,7 @@ async def begin_create_generation_job( from the provided source materials asynchronously. :param job: The job to create. Required. - :type job: JSON + :type job: ~azure.ai.projects.types.EvaluatorGenerationJob :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -7190,7 +8364,7 @@ async def begin_create_generation_job( @distributed_trace_async async def begin_create_generation_job( self, - job: Union[_models.EvaluatorGenerationJob, JSON, IO[bytes]], + job: Union[_models.EvaluatorGenerationJob, _types.EvaluatorGenerationJob, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -7200,9 +8374,10 @@ async def begin_create_generation_job( Creates an evaluator generation job. The service generates rubric-based evaluator definitions from the provided source materials asynchronously. - :param job: The job to create. Is one of the following types: EvaluatorGenerationJob, JSON, - IO[bytes] Required. - :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or JSON or IO[bytes] + :param job: The job to create. Is either a EvaluatorGenerationJob type or a IO[bytes] type. + Required. + :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or + ~azure.ai.projects.types.EvaluatorGenerationJob or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -7557,7 +8732,7 @@ async def delete_generation_job(self, job_id: str, **kwargs: Any) -> None: return cls(pipeline_response, None, {}) # type: ignore -class BetaInsightsOperations: # pylint: disable=docstring-missing-param +class BetaInsightsOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -7595,7 +8770,7 @@ async def generate( @overload async def generate( - self, insight: JSON, *, content_type: str = "application/json", **kwargs: Any + self, insight: _types.Insight, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Insight: """Generate insights. @@ -7603,7 +8778,7 @@ async def generate( :param insight: Complete evaluation configuration including data source, evaluators, and result settings. Required. - :type insight: JSON + :type insight: ~azure.ai.projects.types.Insight :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7632,14 +8807,17 @@ async def generate( """ @distributed_trace_async - async def generate(self, insight: Union[_models.Insight, JSON, IO[bytes]], **kwargs: Any) -> _models.Insight: + async def generate( + self, insight: Union[_models.Insight, _types.Insight, IO[bytes]], **kwargs: Any + ) -> _models.Insight: """Generate insights. Generates an insights report from the provided evaluation configuration. :param insight: Complete evaluation configuration including data source, evaluators, and result - settings. Is one of the following types: Insight, JSON, IO[bytes] Required. - :type insight: ~azure.ai.projects.models.Insight or JSON or IO[bytes] + settings. Is either a Insight type or a IO[bytes] type. Required. + :type insight: ~azure.ai.projects.models.Insight or ~azure.ai.projects.types.Insight or + IO[bytes] :return: Insight. The Insight is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Insight :raises ~azure.core.exceptions.HttpResponseError: @@ -7902,7 +9080,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class BetaMemoryStoresOperations: # pylint: disable=docstring-missing-param +class BetaMemoryStoresOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -7953,14 +9131,14 @@ async def create( @overload async def create( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, body: _types.CreateMemoryStoreRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: """Create a memory store. Creates a memory store resource with the provided configuration. :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateMemoryStoreRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7990,7 +9168,7 @@ async def create( @distributed_trace_async async def create( self, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateMemoryStoreRequest, IO[bytes]] = _Unset, *, name: str = _Unset, definition: _models.MemoryStoreDefinition = _Unset, @@ -8002,8 +9180,8 @@ async def create( Creates a memory store resource with the provided configuration. - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateMemoryStoreRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.CreateMemoryStoreRequest or IO[bytes] :keyword name: The name of the memory store. Required. :paramtype name: str :keyword definition: The memory store definition. Required. @@ -8119,7 +9297,7 @@ async def update( @overload async def update( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.UpdateMemoryStoreRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: """Update a memory store. @@ -8128,7 +9306,7 @@ async def update( :param name: The name of the memory store to update. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.UpdateMemoryStoreRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -8161,7 +9339,7 @@ async def update( async def update( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.UpdateMemoryStoreRequest, IO[bytes]] = _Unset, *, description: Optional[str] = None, metadata: Optional[dict[str, str]] = None, @@ -8173,8 +9351,8 @@ async def update( :param name: The name of the memory store to update. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, UpdateMemoryStoreRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.UpdateMemoryStoreRequest or IO[bytes] :keyword description: A human-readable description of the memory store. Default value is None. :paramtype description: str :keyword metadata: Arbitrary key-value metadata to associate with the memory store. Default @@ -8492,7 +9670,7 @@ async def _search_memories( ) -> _models.MemoryStoreSearchResult: ... @overload async def _search_memories( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.SearchMemoriesRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreSearchResult: ... @overload async def _search_memories( @@ -8503,7 +9681,7 @@ async def _search_memories( async def _search_memories( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.SearchMemoriesRequest, IO[bytes]] = _Unset, *, scope: str = _Unset, items: Optional[List[dict[str, Any]]] = None, @@ -8517,8 +9695,8 @@ async def _search_memories( :param name: The name of the memory store to search. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, SearchMemoriesRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.SearchMemoriesRequest or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -8606,7 +9784,7 @@ async def _search_memories( async def _update_memories_initial( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.UpdateMemoriesRequest, IO[bytes]] = _Unset, *, scope: str = _Unset, items: Optional[List[dict[str, Any]]] = None, @@ -8702,7 +9880,7 @@ async def _begin_update_memories( ) -> AsyncLROPoller[_models.MemoryStoreUpdateCompletedResult]: ... @overload async def _begin_update_memories( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.UpdateMemoriesRequest, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.MemoryStoreUpdateCompletedResult]: ... @overload async def _begin_update_memories( @@ -8713,7 +9891,7 @@ async def _begin_update_memories( async def _begin_update_memories( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.UpdateMemoriesRequest, IO[bytes]] = _Unset, *, scope: str = _Unset, items: Optional[List[dict[str, Any]]] = None, @@ -8728,8 +9906,8 @@ async def _begin_update_memories( :param name: The name of the memory store to update. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, UpdateMemoriesRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.UpdateMemoriesRequest or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -8835,7 +10013,7 @@ async def delete_scope( @overload async def delete_scope( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.DeleteScopeRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: """Delete memories by scope. @@ -8844,7 +10022,7 @@ async def delete_scope( :param name: The name of the memory store. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.DeleteScopeRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -8877,7 +10055,12 @@ async def delete_scope( @distributed_trace_async async def delete_scope( - self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, **kwargs: Any + self, + name: str, + body: Union[JSON, _types.DeleteScopeRequest, IO[bytes]] = _Unset, + *, + scope: str = _Unset, + **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: """Delete memories by scope. @@ -8885,8 +10068,8 @@ async def delete_scope( :param name: The name of the memory store. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, DeleteScopeRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.DeleteScopeRequest or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories to delete, such as a user ID. Required. :paramtype scope: str @@ -9000,7 +10183,7 @@ async def create_memory( @overload async def create_memory( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.CreateMemoryRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: """Create a memory item. @@ -9009,7 +10192,7 @@ async def create_memory( :param name: The name of the memory store. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateMemoryRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9042,7 +10225,7 @@ async def create_memory( async def create_memory( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateMemoryRequest, IO[bytes]] = _Unset, *, scope: str = _Unset, content: str = _Unset, @@ -9055,8 +10238,8 @@ async def create_memory( :param name: The name of the memory store. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateMemoryRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.CreateMemoryRequest or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -9167,7 +10350,13 @@ async def update_memory( @overload async def update_memory( - self, name: str, memory_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + memory_id: str, + body: _types.UpdateMemoryRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.MemoryItem: """Update a memory item. @@ -9178,7 +10367,7 @@ async def update_memory( :param memory_id: The ID of the memory item to update. Required. :type memory_id: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.UpdateMemoryRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9211,7 +10400,13 @@ async def update_memory( @distributed_trace_async async def update_memory( - self, name: str, memory_id: str, body: Union[JSON, IO[bytes]] = _Unset, *, content: str = _Unset, **kwargs: Any + self, + name: str, + memory_id: str, + body: Union[JSON, _types.UpdateMemoryRequest, IO[bytes]] = _Unset, + *, + content: str = _Unset, + **kwargs: Any ) -> _models.MemoryItem: """Update a memory item. @@ -9221,8 +10416,8 @@ async def update_memory( :type name: str :param memory_id: The ID of the memory item to update. Required. :type memory_id: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, UpdateMemoryRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.UpdateMemoryRequest or IO[bytes] :keyword content: The updated content of the memory. Required. :paramtype content: str :return: MemoryItem. The MemoryItem is compatible with MutableMapping @@ -9421,7 +10616,7 @@ def list_memories( def list_memories( self, name: str, - body: JSON, + body: _types.ListMemoriesRequest, *, kind: Optional[Union[str, _models.MemoryItemKind]] = None, limit: Optional[int] = None, @@ -9437,7 +10632,7 @@ def list_memories( :param name: The name of the memory store. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.ListMemoriesRequest :keyword kind: The kind of the memory item. Known values are: "user_profile", "chat_summary", and "procedural". Default value is None. :paramtype kind: str or ~azure.ai.projects.models.MemoryItemKind @@ -9513,7 +10708,7 @@ def list_memories( def list_memories( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.ListMemoriesRequest, IO[bytes]] = _Unset, *, scope: str = _Unset, kind: Optional[Union[str, _models.MemoryItemKind]] = None, @@ -9528,8 +10723,8 @@ def list_memories( :param name: The name of the memory store. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, ListMemoriesRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.ListMemoriesRequest or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -9702,7 +10897,7 @@ async def delete_memory(self, name: str, memory_id: str, **kwargs: Any) -> _mode return deserialized # type: ignore -class BetaModelsOperations: # pylint: disable=docstring-missing-param +class BetaModelsOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -10055,7 +11250,7 @@ async def update( self, name: str, version: str, - model_version_update: JSON, + model_version_update: _types.UpdateModelVersionRequest, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -10070,7 +11265,7 @@ async def update( Required. :type version: str :param model_version_update: The UpdateModelVersionRequest to create or update. Required. - :type model_version_update: JSON + :type model_version_update: ~azure.ai.projects.types.UpdateModelVersionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -10113,7 +11308,7 @@ async def update( self, name: str, version: str, - model_version_update: Union[_models.UpdateModelVersionRequest, JSON, IO[bytes]], + model_version_update: Union[_models.UpdateModelVersionRequest, _types.UpdateModelVersionRequest, IO[bytes]], **kwargs: Any ) -> _models.ModelVersion: """Update a model version. @@ -10125,10 +11320,10 @@ async def update( :param version: The specific version id of the UpdateModelVersionRequest to create or update. Required. :type version: str - :param model_version_update: The UpdateModelVersionRequest to create or update. Is one of the - following types: UpdateModelVersionRequest, JSON, IO[bytes] Required. - :type model_version_update: ~azure.ai.projects.models.UpdateModelVersionRequest or JSON or - IO[bytes] + :param model_version_update: The UpdateModelVersionRequest to create or update. Is either a + UpdateModelVersionRequest type or a IO[bytes] type. Required. + :type model_version_update: ~azure.ai.projects.models.UpdateModelVersionRequest or + ~azure.ai.projects.types.UpdateModelVersionRequest or IO[bytes] :return: ModelVersion. The ModelVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.ModelVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -10226,7 +11421,13 @@ async def pending_create_version( @overload async def pending_create_version( - self, name: str, version: str, model_version: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + version: str, + model_version: _types.ModelVersion, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.CreateAsyncResponse: """Create a model version async. @@ -10238,7 +11439,7 @@ async def pending_create_version( :param version: Version of the model. Required. :type version: str :param model_version: Model version to create. Required. - :type model_version: JSON + :type model_version: ~azure.ai.projects.types.ModelVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10278,7 +11479,11 @@ async def pending_create_version( @distributed_trace_async async def pending_create_version( - self, name: str, version: str, model_version: Union[_models.ModelVersion, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + version: str, + model_version: Union[_models.ModelVersion, _types.ModelVersion, IO[bytes]], + **kwargs: Any ) -> _models.CreateAsyncResponse: """Create a model version async. @@ -10289,9 +11494,10 @@ async def pending_create_version( :type name: str :param version: Version of the model. Required. :type version: str - :param model_version: Model version to create. Is one of the following types: ModelVersion, - JSON, IO[bytes] Required. - :type model_version: ~azure.ai.projects.models.ModelVersion or JSON or IO[bytes] + :param model_version: Model version to create. Is either a ModelVersion type or a IO[bytes] + type. Required. + :type model_version: ~azure.ai.projects.models.ModelVersion or + ~azure.ai.projects.types.ModelVersion or IO[bytes] :return: CreateAsyncResponse. The CreateAsyncResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.CreateAsyncResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -10395,7 +11601,7 @@ async def pending_upload( self, name: str, version: str, - pending_upload_request: JSON, + pending_upload_request: _types.ModelPendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any @@ -10409,7 +11615,7 @@ async def pending_upload( :param version: Version of the model. Required. :type version: str :param pending_upload_request: The pending upload request request body. Required. - :type pending_upload_request: JSON + :type pending_upload_request: ~azure.ai.projects.types.ModelPendingUploadRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10453,7 +11659,7 @@ async def pending_upload( self, name: str, version: str, - pending_upload_request: Union[_models.ModelPendingUploadRequest, JSON, IO[bytes]], + pending_upload_request: Union[_models.ModelPendingUploadRequest, _types.ModelPendingUploadRequest, IO[bytes]], **kwargs: Any ) -> _models.ModelPendingUploadResponse: """Start a pending upload. @@ -10464,10 +11670,10 @@ async def pending_upload( :type name: str :param version: Version of the model. Required. :type version: str - :param pending_upload_request: The pending upload request request body. Is one of the following - types: ModelPendingUploadRequest, JSON, IO[bytes] Required. - :type pending_upload_request: ~azure.ai.projects.models.ModelPendingUploadRequest or JSON or - IO[bytes] + :param pending_upload_request: The pending upload request request body. Is either a + ModelPendingUploadRequest type or a IO[bytes] type. Required. + :type pending_upload_request: ~azure.ai.projects.models.ModelPendingUploadRequest or + ~azure.ai.projects.types.ModelPendingUploadRequest or IO[bytes] :return: ModelPendingUploadResponse. The ModelPendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.ModelPendingUploadResponse @@ -10568,7 +11774,7 @@ async def get_credentials( self, name: str, version: str, - credential_request: JSON, + credential_request: _types.ModelCredentialRequest, *, content_type: str = "application/json", **kwargs: Any @@ -10582,7 +11788,7 @@ async def get_credentials( :param version: Version of the model. Required. :type version: str :param credential_request: The credential request request body. Required. - :type credential_request: JSON + :type credential_request: ~azure.ai.projects.types.ModelCredentialRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10624,7 +11830,7 @@ async def get_credentials( self, name: str, version: str, - credential_request: Union[_models.ModelCredentialRequest, JSON, IO[bytes]], + credential_request: Union[_models.ModelCredentialRequest, _types.ModelCredentialRequest, IO[bytes]], **kwargs: Any ) -> _models.DatasetCredential: """Get model asset credentials. @@ -10635,9 +11841,10 @@ async def get_credentials( :type name: str :param version: Version of the model. Required. :type version: str - :param credential_request: The credential request request body. Is one of the following types: - ModelCredentialRequest, JSON, IO[bytes] Required. - :type credential_request: ~azure.ai.projects.models.ModelCredentialRequest or JSON or IO[bytes] + :param credential_request: The credential request request body. Is either a + ModelCredentialRequest type or a IO[bytes] type. Required. + :type credential_request: ~azure.ai.projects.models.ModelCredentialRequest or + ~azure.ai.projects.types.ModelCredentialRequest or IO[bytes] :return: DatasetCredential. The DatasetCredential is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetCredential :raises ~azure.core.exceptions.HttpResponseError: @@ -10705,7 +11912,7 @@ async def get_credentials( return deserialized # type: ignore -class BetaRedTeamsOperations: # pylint: disable=docstring-missing-param +class BetaRedTeamsOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -10894,13 +12101,15 @@ async def create( """ @overload - async def create(self, red_team: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.RedTeam: + async def create( + self, red_team: _types.RedTeam, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.RedTeam: """Create a redteam run. Submits a new redteam run for execution with the provided configuration. :param red_team: Redteam to be run. Required. - :type red_team: JSON + :type red_team: ~azure.ai.projects.types.RedTeam :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10928,14 +12137,16 @@ async def create( """ @distributed_trace_async - async def create(self, red_team: Union[_models.RedTeam, JSON, IO[bytes]], **kwargs: Any) -> _models.RedTeam: + async def create( + self, red_team: Union[_models.RedTeam, _types.RedTeam, IO[bytes]], **kwargs: Any + ) -> _models.RedTeam: """Create a redteam run. Submits a new redteam run for execution with the provided configuration. - :param red_team: Redteam to be run. Is one of the following types: RedTeam, JSON, IO[bytes] - Required. - :type red_team: ~azure.ai.projects.models.RedTeam or JSON or IO[bytes] + :param red_team: Redteam to be run. Is either a RedTeam type or a IO[bytes] type. Required. + :type red_team: ~azure.ai.projects.models.RedTeam or ~azure.ai.projects.types.RedTeam or + IO[bytes] :return: RedTeam. The RedTeam is compatible with MutableMapping :rtype: ~azure.ai.projects.models.RedTeam :raises ~azure.core.exceptions.HttpResponseError: @@ -11005,7 +12216,7 @@ async def create(self, red_team: Union[_models.RedTeam, JSON, IO[bytes]], **kwar return deserialized # type: ignore -class BetaRoutinesOperations: # pylint: disable=docstring-missing-param +class BetaRoutinesOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -11059,7 +12270,12 @@ async def create_or_update( @overload async def create_or_update( - self, routine_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + routine_name: str, + body: _types.CreateOrUpdateRoutineRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.Routine: """Create or update a routine. @@ -11068,7 +12284,7 @@ async def create_or_update( :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateOrUpdateRoutineRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11101,7 +12317,7 @@ async def create_or_update( async def create_or_update( self, routine_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateOrUpdateRoutineRequest, IO[bytes]] = _Unset, *, description: Optional[str] = None, enabled: Optional[bool] = None, @@ -11115,8 +12331,9 @@ async def create_or_update( :param routine_name: The unique name of the routine. Required. :type routine_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateOrUpdateRoutineRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.projects.types.CreateOrUpdateRoutineRequest or IO[bytes] :keyword description: A human-readable description of the routine. Default value is None. :paramtype description: str :keyword enabled: Whether the routine is enabled. Default value is None. @@ -11718,7 +12935,12 @@ async def dispatch( @overload async def dispatch( - self, routine_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + routine_name: str, + body: _types.DispatchRoutineAsyncRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. @@ -11727,7 +12949,7 @@ async def dispatch( :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.DispatchRoutineAsyncRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11760,7 +12982,7 @@ async def dispatch( async def dispatch( self, routine_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.DispatchRoutineAsyncRequest, IO[bytes]] = _Unset, *, payload: Optional[_models.RoutineDispatchPayload] = None, **kwargs: Any @@ -11771,8 +12993,9 @@ async def dispatch( :param routine_name: The unique name of the routine. Required. :type routine_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, DispatchRoutineAsyncRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.projects.types.DispatchRoutineAsyncRequest or IO[bytes] :keyword payload: A direct action-input override sent downstream when testing a routine. Default value is None. :paramtype payload: ~azure.ai.projects.models.RoutineDispatchPayload @@ -11849,7 +13072,7 @@ async def dispatch( return deserialized # type: ignore -class BetaSchedulesOperations: # pylint: disable=docstring-missing-param +class BetaSchedulesOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -12104,7 +13327,7 @@ async def create_or_update( @overload async def create_or_update( - self, schedule_id: str, schedule: JSON, *, content_type: str = "application/json", **kwargs: Any + self, schedule_id: str, schedule: _types.Schedule, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Schedule: """Create or update a schedule. @@ -12113,7 +13336,7 @@ async def create_or_update( :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str :param schedule: The resource instance. Required. - :type schedule: JSON + :type schedule: ~azure.ai.projects.types.Schedule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -12144,7 +13367,7 @@ async def create_or_update( @distributed_trace_async async def create_or_update( - self, schedule_id: str, schedule: Union[_models.Schedule, JSON, IO[bytes]], **kwargs: Any + self, schedule_id: str, schedule: Union[_models.Schedule, _types.Schedule, IO[bytes]], **kwargs: Any ) -> _models.Schedule: """Create or update a schedule. @@ -12152,9 +13375,10 @@ async def create_or_update( :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str - :param schedule: The resource instance. Is one of the following types: Schedule, JSON, - IO[bytes] Required. - :type schedule: ~azure.ai.projects.models.Schedule or JSON or IO[bytes] + :param schedule: The resource instance. Is either a Schedule type or a IO[bytes] type. + Required. + :type schedule: ~azure.ai.projects.models.Schedule or ~azure.ai.projects.types.Schedule or + IO[bytes] :return: Schedule. The Schedule is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Schedule :raises ~azure.core.exceptions.HttpResponseError: @@ -12398,7 +13622,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class BetaSkillsOperations: # pylint: disable=docstring-missing-param +class BetaSkillsOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -12597,7 +13821,7 @@ async def update( @overload async def update( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.UpdateSkillRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SkillDetails: """Update a skill. @@ -12606,7 +13830,7 @@ async def update( :param name: The name of the skill to update. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.UpdateSkillRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -12637,7 +13861,12 @@ async def update( @distributed_trace_async async def update( - self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, default_version: str = _Unset, **kwargs: Any + self, + name: str, + body: Union[JSON, _types.UpdateSkillRequest, IO[bytes]] = _Unset, + *, + default_version: str = _Unset, + **kwargs: Any ) -> _models.SkillDetails: """Update a skill. @@ -12645,8 +13874,8 @@ async def update( :param name: The name of the skill to update. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, UpdateSkillRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.UpdateSkillRequest or IO[bytes] :keyword default_version: The version identifier that the skill should point to. When set, the skill's default version will resolve to this version instead of the latest. Required. :paramtype default_version: str @@ -12822,7 +14051,12 @@ async def create( @overload async def create( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + body: _types.CreateSkillVersionRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.SkillVersion: """Create a new version of a skill. @@ -12831,7 +14065,7 @@ async def create( :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateSkillVersionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -12864,7 +14098,7 @@ async def create( async def create( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateSkillVersionRequest, IO[bytes]] = _Unset, *, inline_content: Optional[_models.SkillInlineContent] = None, default: Optional[bool] = None, @@ -12876,8 +14110,9 @@ async def create( :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateSkillVersionRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.projects.types.CreateSkillVersionRequest or IO[bytes] :keyword inline_content: Inline skill content for simple skills without file uploads. Foundry-specific extension. Default value is None. :paramtype inline_content: ~azure.ai.projects.models.SkillInlineContent @@ -12973,7 +14208,9 @@ async def create_from_files( """ @overload - async def create_from_files(self, name: str, content: JSON, **kwargs: Any) -> _models.SkillVersion: + async def create_from_files( + self, name: str, content: _types.CreateSkillVersionFromFilesBody, **kwargs: Any + ) -> _models.SkillVersion: """Create a skill version from uploaded files. Creates a new version of a skill from uploaded files via multipart form data. @@ -12981,7 +14218,7 @@ async def create_from_files(self, name: str, content: JSON, **kwargs: Any) -> _m :param name: The name of the skill. Required. :type name: str :param content: The multipart request content. Required. - :type content: JSON + :type content: ~azure.ai.projects.types.CreateSkillVersionFromFilesBody :return: SkillVersion. The SkillVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.SkillVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -12989,7 +14226,10 @@ async def create_from_files(self, name: str, content: JSON, **kwargs: Any) -> _m @distributed_trace_async async def create_from_files( - self, name: str, content: Union[_models.CreateSkillVersionFromFilesBody, JSON], **kwargs: Any + self, + name: str, + content: Union[_models.CreateSkillVersionFromFilesBody, _types.CreateSkillVersionFromFilesBody], + **kwargs: Any ) -> _models.SkillVersion: """Create a skill version from uploaded files. @@ -12997,9 +14237,10 @@ async def create_from_files( :param name: The name of the skill. Required. :type name: str - :param content: The multipart request content. Is either a CreateSkillVersionFromFilesBody type - or a JSON type. Required. - :type content: ~azure.ai.projects.models.CreateSkillVersionFromFilesBody or JSON + :param content: The multipart request content. Is one of the following types: + CreateSkillVersionFromFilesBody Required. + :type content: ~azure.ai.projects.models.CreateSkillVersionFromFilesBody or + ~azure.ai.projects.types.CreateSkillVersionFromFilesBody :return: SkillVersion. The SkillVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.SkillVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -13440,7 +14681,7 @@ async def delete_version(self, name: str, version: str, **kwargs: Any) -> _model return deserialized # type: ignore -class BetaDatasetsOperations: # pylint: disable=docstring-missing-param +class BetaDatasetsOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -13621,7 +14862,7 @@ async def get_next(_continuation_token=None): async def _create_generation_job_initial( self, - job: Union[_models.DataGenerationJob, JSON, IO[bytes]], + job: Union[_models.DataGenerationJob, _types.DataGenerationJob, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -13720,14 +14961,19 @@ async def begin_create_generation_job( @overload async def begin_create_generation_job( - self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any + self, + job: _types.DataGenerationJob, + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any ) -> AsyncLROPoller[_models.DataGenerationJobResult]: """Create a data generation job. Submits a new data generation job for asynchronous execution. :param job: The job to create. Required. - :type job: JSON + :type job: ~azure.ai.projects.types.DataGenerationJob :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -13770,7 +15016,7 @@ async def begin_create_generation_job( @distributed_trace_async async def begin_create_generation_job( self, - job: Union[_models.DataGenerationJob, JSON, IO[bytes]], + job: Union[_models.DataGenerationJob, _types.DataGenerationJob, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -13779,9 +15025,10 @@ async def begin_create_generation_job( Submits a new data generation job for asynchronous execution. - :param job: The job to create. Is one of the following types: DataGenerationJob, JSON, - IO[bytes] Required. - :type job: ~azure.ai.projects.models.DataGenerationJob or JSON or IO[bytes] + :param job: The job to create. Is either a DataGenerationJob type or a IO[bytes] type. + Required. + :type job: ~azure.ai.projects.models.DataGenerationJob or + ~azure.ai.projects.types.DataGenerationJob or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -13970,7 +15217,7 @@ async def delete_generation_job(self, job_id: str, **kwargs: Any) -> None: return cls(pipeline_response, None, {}) # type: ignore -class BetaAgentsOperations: # pylint: disable=docstring-missing-param +class BetaAgentsOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -13989,7 +15236,7 @@ def __init__(self, *args, **kwargs) -> None: async def _create_optimization_job_initial( self, - job: Union[_models.AgentOptimizationJob, JSON, IO[bytes]], + job: Union[_models.AgentOptimizationJob, _types.AgentOptimizationJob, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -14090,7 +15337,12 @@ async def begin_create_optimization_job( @overload async def begin_create_optimization_job( - self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any + self, + job: _types.AgentOptimizationJob, + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any ) -> AsyncLROPoller[_models.AgentOptimizationJobResult]: """Create an agent optimization job. @@ -14098,7 +15350,7 @@ async def begin_create_optimization_job( retry. :param job: The job to create. Required. - :type job: JSON + :type job: ~azure.ai.projects.types.AgentOptimizationJob :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -14144,7 +15396,7 @@ async def begin_create_optimization_job( @distributed_trace_async async def begin_create_optimization_job( self, - job: Union[_models.AgentOptimizationJob, JSON, IO[bytes]], + job: Union[_models.AgentOptimizationJob, _types.AgentOptimizationJob, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -14154,9 +15406,10 @@ async def begin_create_optimization_job( Creates an optimization job and returns the queued job. Honors ``Operation-Id`` for idempotent retry. - :param job: The job to create. Is one of the following types: AgentOptimizationJob, JSON, - IO[bytes] Required. - :type job: ~azure.ai.projects.models.AgentOptimizationJob or JSON or IO[bytes] + :param job: The job to create. Is either a AgentOptimizationJob type or a IO[bytes] type. + Required. + :type job: ~azure.ai.projects.models.AgentOptimizationJob or + ~azure.ai.projects.types.AgentOptimizationJob or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py index 42d242b5109f..77bdb8ae3154 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py @@ -328,6 +328,48 @@ async def create_version_from_code( raise new_exc from exc raise + @distributed_trace_async + async def generate_agent(self, body: _models.GenerateVoiceAgentRequest, **kwargs: Any) -> _models.AgentDetails: # type: ignore[override] + """Generate an agent. + + Generates and creates an agent from kind-specific high-level inputs. The generated definition + remains fully editable through the standard agent versioning operations. When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param body: The kind-specific inputs for generating and creating an agent. Required. + :type body: ~azure.ai.projects.models.GenerateVoiceAgentRequest + :return: AgentDetails. The AgentDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + + if getattr(self._config, "allow_preview", False): + # Add Foundry-Features header if not already present + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS + kwargs["headers"] = headers + + try: + return await super().generate_agent(body, **kwargs) # type: ignore[misc] + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + class BetaAgentsOperations(BetaAgentsOperationsGenerated): """Custom async operations for beta agent optimization jobs.""" @@ -440,45 +482,3 @@ def get_long_running_output(pipeline_response): return AsyncAgentOptimizationLROPoller( # type: ignore self._client, raw_result, get_long_running_output, polling_method ) - - @distributed_trace_async - async def generate_agent(self, body: _models.GenerateVoiceAgentRequest, **kwargs: Any) -> _models.AgentDetails: # type: ignore[override] - """Generate an agent. - - Generates and creates an agent from kind-specific high-level inputs. The generated definition - remains fully editable through the standard agent versioning operations. When the client is - constructed with ``allow_preview=True``, the required preview opt-in header is added - automatically. - - :param body: The kind-specific inputs for generating and creating an agent. Required. - :type body: ~azure.ai.projects.models.GenerateVoiceAgentRequest - :return: AgentDetails. The AgentDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - - if getattr(self._config, "allow_preview", False): - # Add Foundry-Features header if not already present - headers = kwargs.get("headers") - if headers is None: - kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} - elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): - headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS - kwargs["headers"] = headers - - try: - return await super().generate_agent(body, **kwargs) # type: ignore[misc] - except HttpResponseError as exc: - if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: - api_error_response = exc.model - if hasattr(api_error_response, "error") and api_error_response.error is not None: - if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: - new_exc = HttpResponseError( - message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", - ) - new_exc.status_code = exc.status_code - new_exc.reason = exc.reason - new_exc.response = exc.response - new_exc.model = exc.model - raise new_exc from exc - raise 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 48b63098b16f..63c2dd411032 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 @@ -340,6 +340,7 @@ ScheduleRoutineTrigger, ScheduleRun, ScheduleTask, + SessionConfiguration, SessionDirectoryEntry, SessionFileWriteResult, SessionLogEvent, @@ -530,6 +531,8 @@ VoiceToolboxTool, VoiceTurnDetection, VoiceUserMessageItem, + WebIQPreviewTool, + WebIQPreviewToolboxTool, WebSearchApproximateLocation, WebSearchConfiguration, WebSearchPreviewTool, @@ -608,6 +611,12 @@ PageOrder, PendingUploadType, RankerVersionType, + RealtimeAudioFormatsType, + RealtimeClientEventType, + RealtimeConversationItemMessageType, + RealtimeMcpErrorType, + RealtimeReasoningEffort, + RealtimeServerEventType, ReasoningEffort, ReasoningModeEnum, RecurrenceType, @@ -996,6 +1005,7 @@ "ScheduleRoutineTrigger", "ScheduleRun", "ScheduleTask", + "SessionConfiguration", "SessionDirectoryEntry", "SessionFileWriteResult", "SessionLogEvent", @@ -1186,6 +1196,8 @@ "VoiceToolboxTool", "VoiceTurnDetection", "VoiceUserMessageItem", + "WebIQPreviewTool", + "WebIQPreviewToolboxTool", "WebSearchApproximateLocation", "WebSearchConfiguration", "WebSearchPreviewTool", @@ -1261,6 +1273,12 @@ "PageOrder", "PendingUploadType", "RankerVersionType", + "RealtimeAudioFormatsType", + "RealtimeClientEventType", + "RealtimeConversationItemMessageType", + "RealtimeMcpErrorType", + "RealtimeReasoningEffort", + "RealtimeServerEventType", "ReasoningEffort", "ReasoningModeEnum", "RecurrenceType", 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 0439ce1504b3..441f60a38aeb 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 @@ -880,39 +880,6 @@ class RankerVersionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """DEFAULT_2024_11_15.""" -class ReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Constrains effort on reasoning for reasoning models. Currently supported values are ``none``, - ``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. - """ - - NONE = "none" - """NONE.""" - MINIMAL = "minimal" - """MINIMAL.""" - LOW = "low" - """LOW.""" - MEDIUM = "medium" - """MEDIUM.""" - HIGH = "high" - """HIGH.""" - XHIGH = "xhigh" - """XHIGH.""" - MAX = "max" - """MAX.""" - - -class ReasoningModeEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of ReasoningModeEnum.""" - - STANDARD = "standard" - """STANDARD.""" - PRO = "pro" - """PRO.""" - - class RealtimeAudioFormatsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of RealtimeAudioFormatsType.""" @@ -1401,8 +1368,6 @@ class ToolboxToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """AZURE_AI_SEARCH.""" OPENAPI = "openapi" """OPENAPI.""" - A2_A = "a2a" - """A2_A.""" A2A_PREVIEW = "a2a_preview" """A2A_PREVIEW.""" BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" @@ -1417,6 +1382,10 @@ class ToolboxToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """TOOLBOX_SEARCH.""" TOOLBOX_SEARCH_PREVIEW = "toolbox_search_preview" """TOOLBOX_SEARCH_PREVIEW.""" + WEB_IQ_PREVIEW = "web_iq_preview" + """WEB_IQ_PREVIEW.""" + A2_A = "a2a" + """A2_A.""" class ToolChoiceOptions(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -1527,6 +1496,8 @@ class ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """FABRIC_IQ_PREVIEW.""" TOOLBOX_SEARCH_PREVIEW = "toolbox_search_preview" """TOOLBOX_SEARCH_PREVIEW.""" + WEB_IQ_PREVIEW = "web_iq_preview" + """WEB_IQ_PREVIEW.""" A2_A = "a2a" """A2_A.""" AZURE_AI_SEARCH = "azure_ai_search" @@ -1730,9 +1701,13 @@ class VoiceConversationItemType(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 ea6304481654..9894806f100d 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 @@ -69,7 +69,7 @@ from .. import _unions, models as _models -class _CreateAgentVersionFromCodeContent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class _CreateAgentVersionFromCodeContent(_Model): """Multipart request body for updating or versioning a code-based agent (POST /agents/{name} and POST /agents/{name}/versions). @@ -107,7 +107,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class _CreateAgentVersionFromCodeMetadata(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class _CreateAgentVersionFromCodeMetadata(_Model): """JSON metadata for code-based agent operations (create, update, create version). The agent name comes from the URL path parameter or the ``x-ms-agent-name`` header, so it is not included in this model. The content hash (SHA-256 of the zip) is carried in the ``x-ms-code-zip-sha256`` @@ -160,7 +160,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Tool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class Tool(_Model): """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: @@ -170,7 +170,7 @@ class Tool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-on CustomToolParam, MicrosoftFabricPreviewTool, FabricIQPreviewTool, FileSearchTool, FunctionTool, ImageGenTool, LocalShellToolParam, MCPTool, MemorySearchPreviewTool, NamespaceToolParam, OpenApiTool, ProgrammaticToolCallingParam, SharepointPreviewTool, FunctionShellToolParam, - ToolSearchToolParam, WebSearchTool, WebSearchPreviewTool, WorkIQPreviewTool + ToolSearchToolParam, WebIQPreviewTool, WebSearchTool, WebSearchPreviewTool, WorkIQPreviewTool :ivar type: Required. Known values are: "function", "file_search", "computer", "computer_use_preview", "web_search", "mcp", "code_interpreter", "programmatic_tool_calling", @@ -178,8 +178,8 @@ class Tool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-on "web_search_preview", "apply_patch", "a2a_preview", "bing_custom_search_preview", "browser_automation_preview", "fabric_dataagent_preview", "sharepoint_grounding_preview", "memory_search_preview", "work_iq_preview", "fabric_iq_preview", "toolbox_search_preview", - "a2a", "azure_ai_search", "azure_function", "bing_grounding", "capture_structured_outputs", and - "openapi". + "web_iq_preview", "a2a", "azure_ai_search", "azure_function", "bing_grounding", + "capture_structured_outputs", and "openapi". :vartype type: str or ~azure.ai.projects.models.ToolType """ @@ -191,8 +191,9 @@ class Tool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-on \"namespace\", \"tool_search\", \"web_search_preview\", \"apply_patch\", \"a2a_preview\", \"bing_custom_search_preview\", \"browser_automation_preview\", \"fabric_dataagent_preview\", \"sharepoint_grounding_preview\", \"memory_search_preview\", \"work_iq_preview\", - \"fabric_iq_preview\", \"toolbox_search_preview\", \"a2a\", \"azure_ai_search\", - \"azure_function\", \"bing_grounding\", \"capture_structured_outputs\", and \"openapi\".""" + \"fabric_iq_preview\", \"toolbox_search_preview\", \"web_iq_preview\", \"a2a\", + \"azure_ai_search\", \"azure_function\", \"bing_grounding\", \"capture_structured_outputs\", + and \"openapi\".""" @overload def __init__( @@ -212,7 +213,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class A2APreviewTool(Tool, discriminator="a2a_preview"): # pylint: disable=docstring-keyword-should-match-keyword-only +class A2APreviewTool(Tool, discriminator="a2a_preview"): """An agent implementing the A2A protocol. :ivar type: The type of the tool. Always ``"a2a_preview``. Required. A2A_PREVIEW. @@ -270,20 +271,20 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.A2A_PREVIEW # type: ignore -class ToolboxTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class ToolboxTool(_Model): """An abstract representation of a tool stored in a toolbox. You probably want to use the sub-classes and not this class directly. Known sub-classes are: A2AToolboxTool, A2APreviewToolboxTool, AzureAISearchToolboxTool, BrowserAutomationPreviewToolboxTool, CodeInterpreterToolboxTool, FabricIQPreviewToolboxTool, FileSearchToolboxTool, MCPToolboxTool, OpenApiToolboxTool, ReminderPreviewToolboxTool, - ToolSearchToolboxTool, ToolboxSearchPreviewToolboxTool, WebSearchToolboxTool, - WorkIQPreviewToolboxTool + 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", "a2a_preview", - "browser_automation_preview", "reminder_preview", "work_iq_preview", "fabric_iq_preview", - "toolbox_search", and "toolbox_search_preview". + "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", "web_iq_preview", and "a2a". :vartype type: str or ~azure.ai.projects.models.ToolboxToolType :ivar name: Optional user-defined name for this tool or configuration. :vartype name: str @@ -298,9 +299,10 @@ class ToolboxTool(_Model): # pylint: disable=docstring-keyword-should-match-key __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) """The type of tool. Required. Known values are: \"code_interpreter\", \"file_search\", - \"web_search\", \"mcp\", \"azure_ai_search\", \"openapi\", \"a2a\", \"a2a_preview\", + \"web_search\", \"mcp\", \"azure_ai_search\", \"openapi\", \"a2a_preview\", \"browser_automation_preview\", \"reminder_preview\", \"work_iq_preview\", - \"fabric_iq_preview\", \"toolbox_search\", and \"toolbox_search_preview\".""" + \"fabric_iq_preview\", \"toolbox_search\", \"toolbox_search_preview\", \"web_iq_preview\", and + \"a2a\".""" 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"]) @@ -333,9 +335,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class A2APreviewToolboxTool( - ToolboxTool, discriminator="a2a_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class A2APreviewToolboxTool(ToolboxTool, discriminator="a2a_preview"): """An A2A tool stored in a toolbox. :ivar name: Optional user-defined name for this tool or configuration. @@ -408,7 +408,7 @@ class A2AProtocolConfiguration(_Model): """Configuration specific to the A2A protocol.""" -class A2ATool(Tool, discriminator="a2a"): # pylint: disable=docstring-keyword-should-match-keyword-only +class A2ATool(Tool, discriminator="a2a"): """An agent implementing the A2A protocol. :ivar type: The type of the tool. Always ``"a2a"``. Required. A2_A. @@ -473,7 +473,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.A2_A # type: ignore -class A2AToolboxTool(ToolboxTool, discriminator="a2a"): # pylint: disable=docstring-keyword-should-match-keyword-only +class A2AToolboxTool(ToolboxTool, discriminator="a2a"): """An A2A tool stored in a toolbox. :ivar name: Optional user-defined name for this tool or configuration. @@ -549,7 +549,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolboxToolType.A2_A # type: ignore -class ActivityProtocolConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class ActivityProtocolConfiguration(_Model): """Configuration specific to the activity protocol. :ivar enable_m365_public_endpoint: Whether to enable the M365 public endpoint for the activity @@ -578,7 +578,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentBlueprintReference(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class AgentBlueprintReference(_Model): """AgentBlueprintReference. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -610,7 +610,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentCard(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class AgentCard(_Model): """AgentCard. :ivar version: The version of the agent card. Required. @@ -648,7 +648,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentCardSkill(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class AgentCardSkill(_Model): """AgentCardSkill. :ivar id: a unique identifier for the skill. Required. @@ -696,7 +696,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InsightRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class InsightRequest(_Model): """The request of the insights report. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -731,9 +731,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentClusterInsightRequest( - InsightRequest, discriminator="AgentClusterInsight" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class AgentClusterInsightRequest(InsightRequest, discriminator="AgentClusterInsight"): """Insights on set of Agent Evaluation Results. :ivar type: The type of request. Required. Cluster Insight on an Agent. @@ -773,7 +771,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = InsightType.AGENT_CLUSTER_INSIGHT # type: ignore -class InsightResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class InsightResult(_Model): """The result of the insights. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -807,9 +805,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentClusterInsightResult( - InsightResult, discriminator="AgentClusterInsight" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class AgentClusterInsightResult(InsightResult, discriminator="AgentClusterInsight"): """Insights from the agent cluster analysis. :ivar type: The type of insights result. Required. Cluster Insight on an Agent. @@ -844,7 +840,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = InsightType.AGENT_CLUSTER_INSIGHT # type: ignore -class DataGenerationJobSource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class DataGenerationJobSource(_Model): """The base source model for data generation jobs. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -887,9 +883,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentDataGenerationJobSource( - DataGenerationJobSource, discriminator="agent" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class AgentDataGenerationJobSource(DataGenerationJobSource, discriminator="agent"): """Agent source for data generation jobs — references an agent to fetch instructions and metadata from. @@ -934,7 +928,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = DataGenerationJobSourceType.AGENT # type: ignore -class AgentDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class AgentDefinition(_Model): """AgentDefinition. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -973,7 +967,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class AgentDetails(_Model): """AgentDetails. :ivar object: The object type, which is always 'agent'. Required. AGENT. @@ -1053,7 +1047,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentEndpointAuthorizationScheme(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class AgentEndpointAuthorizationScheme(_Model): """AgentEndpointAuthorizationScheme. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -1088,7 +1082,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentEndpointConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class AgentEndpointConfig(_Model): """AgentEndpointConfig. :ivar version_selector: The version selector of the agent endpoint determines how traffic is @@ -1135,7 +1129,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorGenerationJobSource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class EvaluatorGenerationJobSource(_Model): """The base source model for evaluator generation jobs. Polymorphic over ``type``. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -1170,9 +1164,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentEvaluatorGenerationJobSource( - EvaluatorGenerationJobSource, discriminator="agent" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class AgentEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator="agent"): """Agent source for evaluator generation jobs — references an agent to fetch instructions and metadata from. @@ -1221,7 +1213,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = EvaluatorGenerationJobSourceType.AGENT # type: ignore -class BaseCredentials(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class BaseCredentials(_Model): """A base class for connection credentials. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -1283,7 +1275,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = CredentialType.AGENTIC_IDENTITY_PREVIEW # type: ignore -class AgentIdentity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class AgentIdentity(_Model): """AgentIdentity. :ivar principal_id: The principal ID of the agent instance. Required. @@ -1326,7 +1318,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentObjectVersions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class AgentObjectVersions(_Model): """AgentObjectVersions. :ivar latest: Required. @@ -1354,7 +1346,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentOptimizationCandidate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class AgentOptimizationCandidate(_Model): """Aggregated evaluation result for a single candidate agent configuration across all tasks. :ivar candidate_id: Server-assigned candidate identifier. Use with GET /candidates/{id} @@ -1420,7 +1412,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentOptimizationDatasetCriterion(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class AgentOptimizationDatasetCriterion(_Model): """Evaluation criterion: a name + instruction pair used for per-item scoring. :ivar name: Criterion name. Required. @@ -1453,7 +1445,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentOptimizationDatasetInput(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class AgentOptimizationDatasetInput(_Model): """Base discriminated model for dataset input. Either inline items or a registered reference. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -1486,7 +1478,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentOptimizationDatasetItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class AgentOptimizationDatasetItem(_Model): """A single item in an inline dataset. :ivar query: The user query / prompt. @@ -1531,7 +1523,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentOptimizationEvaluatorRef(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class AgentOptimizationEvaluatorRef(_Model): """Reference to a named evaluator, optionally pinned to a version. :ivar name: Evaluator name. Required. @@ -1564,9 +1556,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentOptimizationInlineDatasetInput( - AgentOptimizationDatasetInput, discriminator="inline" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class AgentOptimizationInlineDatasetInput(AgentOptimizationDatasetInput, discriminator="inline"): """Inline dataset — items supplied directly in the request body. :ivar type: Dataset input type discriminator. Required. Inline dataset — items are provided @@ -1603,7 +1593,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = AgentOptimizationDatasetInputType.INLINE # type: ignore -class AgentOptimizationJob(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class AgentOptimizationJob(_Model): """Agent optimization job resource — a long-running job that optimizes an agent's configuration (instructions, model, skills, tools) to maximize evaluation scores. On success, the result contains scored candidates. @@ -1671,7 +1661,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentOptimizationJobInputs(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class AgentOptimizationJobInputs(_Model): """Caller-supplied inputs for an optimization job. :ivar agent: The agent (and pinned version) being optimized. Required. @@ -1771,7 +1761,7 @@ class AgentOptimizationJobListItem(_Model): """The agent targeted by this optimization job.""" -class AgentOptimizationJobProgress(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class AgentOptimizationJobProgress(_Model): """In-flight progress; only populated while status is queued or in_progress. :ivar candidates_completed: Number of candidates whose evaluation has completed so far. @@ -1811,7 +1801,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentOptimizationJobResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class AgentOptimizationJobResult(_Model): """Terminal-state result body. Populated when status is succeeded or failed. :ivar baseline: Candidate ID of the original (un-optimized) baseline evaluation. @@ -1851,7 +1841,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentOptimizationOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class AgentOptimizationOptions(_Model): """Tuning knobs and run-mode for an optimization job. :ivar max_candidates: Maximum number of optimization candidates to generate. Must be >= 1. @@ -1929,9 +1919,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentOptimizationReferenceDatasetInput( - AgentOptimizationDatasetInput, discriminator="reference" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class AgentOptimizationReferenceDatasetInput(AgentOptimizationDatasetInput, discriminator="reference"): """Reference to a registered Foundry dataset. :ivar type: Dataset input type discriminator. Required. Reference to a registered Foundry @@ -1971,7 +1959,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = AgentOptimizationDatasetInputType.REFERENCE # type: ignore -class AgentSessionResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class AgentSessionResource(_Model): """An agent session providing a long-lived compute sandbox for hosted agent invocations. :ivar agent_session_id: The session identifier. Required. @@ -2031,7 +2019,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationTaxonomyInput(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class EvaluationTaxonomyInput(_Model): """Input configuration for the evaluation taxonomy. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -2064,9 +2052,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentTaxonomyInput( - EvaluationTaxonomyInput, discriminator="agent" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class AgentTaxonomyInput(EvaluationTaxonomyInput, discriminator="agent"): """Input configuration for the evaluation taxonomy when the input type is agent. :ivar type: Input type of the evaluation taxonomy. Required. Agent. @@ -2106,7 +2092,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = EvaluationTaxonomyInputType.AGENT # type: ignore -class AgentVersionDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class AgentVersionDetails(_Model): """AgentVersionDetails. :ivar metadata: Set of 16 key-value pairs that can be attached to an object. This can be @@ -2222,7 +2208,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AISearchIndexResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class AISearchIndexResource(_Model): """A AI Search Index resource. :ivar project_connection_id: An index connection ID in an IndexResource attached to this agent. @@ -2281,7 +2267,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ApiError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class ApiError(_Model): """ApiError. :ivar code: Required. @@ -2338,7 +2324,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ApiErrorResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class ApiErrorResponse(_Model): """Error response for API failures. :ivar error: Required. @@ -2397,9 +2383,7 @@ 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 +class ApplyPatchToolParam(Tool, discriminator="apply_patch"): """Apply patch tool. :ivar type: The type of the tool. Always ``apply_patch``. Required. APPLY_PATCH. @@ -2433,7 +2417,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.APPLY_PATCH # type: ignore -class ApproximateLocation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class ApproximateLocation(_Model): """ApproximateLocation. :ivar type: The type of location approximation. Always ``approximate``. Required. Default value @@ -2479,7 +2463,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["approximate"] = "approximate" -class ArtifactProfile(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class ArtifactProfile(_Model): """Artifact profile of the model. :ivar category: The category of the artifact profile. Required. Known values are: "DataOnly", @@ -2518,7 +2502,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AutoCodeInterpreterToolParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class AutoCodeInterpreterToolParam(_Model): """Automatic Code Interpreter Tool Parameters. :ivar type: Always ``auto``. Required. Default value is "auto". @@ -2564,7 +2548,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["auto"] = "auto" -class EvaluationTarget(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class EvaluationTarget(_Model): """Base class for targets with discriminator support. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -2596,9 +2580,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AzureAIAgentTarget( - EvaluationTarget, discriminator="azure_ai_agent" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class AzureAIAgentTarget(EvaluationTarget, discriminator="azure_ai_agent"): """Represents a target specifying an Azure AI agent. :ivar type: The type of target, always ``azure_ai_agent``. Required. Default value is @@ -2649,9 +2631,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = "azure_ai_agent" # type: ignore -class AzureAIModelTarget( - EvaluationTarget, discriminator="azure_ai_model" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class AzureAIModelTarget(EvaluationTarget, discriminator="azure_ai_model"): """Represents a target specifying an Azure AI model for operations requiring model selection. :ivar type: The type of target, always ``azure_ai_model``. Required. Default value is @@ -2693,7 +2673,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = "azure_ai_model" # type: ignore -class Index(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class Index(_Model): """Index resource Definition. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -2749,9 +2729,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AzureAISearchIndex( - Index, discriminator="AzureSearch" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class AzureAISearchIndex(Index, discriminator="AzureSearch"): """Azure AI Search Index Definition. :ivar id: Asset ID, a unique identifier for the asset. @@ -2806,9 +2784,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = IndexType.AZURE_SEARCH # type: ignore -class AzureAISearchTool( - Tool, discriminator="azure_ai_search" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class AzureAISearchTool(Tool, discriminator="azure_ai_search"): """The input definition information for an Azure AI search tool as used to configure an agent. :ivar type: The object type, which is always 'azure_ai_search'. Required. AZURE_AI_SEARCH. @@ -2862,9 +2838,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.AZURE_AI_SEARCH # type: ignore -class AzureAISearchToolboxTool( - ToolboxTool, discriminator="azure_ai_search" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class AzureAISearchToolboxTool(ToolboxTool, discriminator="azure_ai_search"): """An Azure AI Search tool stored in a toolbox. :ivar name: Optional user-defined name for this tool or configuration. @@ -2910,7 +2884,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolboxToolType.AZURE_AI_SEARCH # type: ignore -class AzureAISearchToolResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class AzureAISearchToolResource(_Model): """A set of index resources used by the ``azure_ai_search`` tool. :ivar indexes: The indices attached to this agent. There can be a maximum of 1 index resource @@ -2942,7 +2916,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AzureFunctionBinding(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class AzureFunctionBinding(_Model): """The structure for keeping storage queue name and URI. :ivar type: The type of binding, which is always 'storage_queue'. Required. Default value is @@ -2979,7 +2953,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["storage_queue"] = "storage_queue" -class AzureFunctionDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class AzureFunctionDefinition(_Model): """The definition of Azure function. :ivar function: The definition of azure function and its parameters. Required. @@ -3027,7 +3001,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AzureFunctionDefinitionFunction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class AzureFunctionDefinitionFunction(_Model): """AzureFunctionDefinitionFunction. :ivar name: The name of the function to be called. Required. @@ -3068,7 +3042,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AzureFunctionStorageQueue(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class AzureFunctionStorageQueue(_Model): """The structure for keeping storage queue name and URI. :ivar queue_service_endpoint: URI to the Azure Storage Queue service allowing you to manipulate @@ -3102,9 +3076,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AzureFunctionTool( - Tool, discriminator="azure_function" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class AzureFunctionTool(Tool, discriminator="azure_function"): """The input definition information for an Azure Function Tool, as used to configure an Agent. :ivar type: The object type, which is always 'browser_automation'. Required. AZURE_FUNCTION. @@ -3147,7 +3119,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.AZURE_FUNCTION # type: ignore -class RedTeamTargetConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class RedTeamTargetConfig(_Model): """Abstract class for target configuration. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -3179,9 +3151,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AzureOpenAIModelConfiguration( - RedTeamTargetConfig, discriminator="AzureOpenAIModel" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class AzureOpenAIModelConfiguration(RedTeamTargetConfig, discriminator="AzureOpenAIModel"): """Azure OpenAI model configuration. The API version would be selected by the service for querying the model. @@ -3220,7 +3190,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = "AzureOpenAIModel" # type: ignore -class BingCustomSearchConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class BingCustomSearchConfiguration(_Model): """A bing custom search configuration. :ivar project_connection_id: Project connection id for grounding with bing search. Required. @@ -3275,9 +3245,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class BingCustomSearchPreviewTool( - Tool, discriminator="bing_custom_search_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class BingCustomSearchPreviewTool(Tool, discriminator="bing_custom_search_preview"): """The input definition information for a Bing custom search tool as used to configure an agent. :ivar type: The object type, which is always 'bing_custom_search_preview'. Required. @@ -3314,7 +3282,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.BING_CUSTOM_SEARCH_PREVIEW # type: ignore -class BingCustomSearchToolParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class BingCustomSearchToolParameters(_Model): """The bing custom search tool parameters. :ivar search_configurations: The project connections attached to this tool. There can be a @@ -3346,7 +3314,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class BingGroundingSearchConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class BingGroundingSearchConfiguration(_Model): """Search configuration for Bing Grounding. :ivar project_connection_id: Project connection id for grounding with bing search. Required. @@ -3396,7 +3364,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class BingGroundingSearchToolParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class BingGroundingSearchToolParameters(_Model): """The bing grounding search tool parameters. :ivar search_configurations: The search configurations attached to this tool. There can be a @@ -3429,9 +3397,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class BingGroundingTool( - Tool, discriminator="bing_grounding" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class BingGroundingTool(Tool, discriminator="bing_grounding"): """The input definition information for a bing grounding search tool as used to configure an agent. @@ -3486,7 +3452,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.BING_GROUNDING # type: ignore -class BlobReference(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class BlobReference(_Model): """Blob reference details. :ivar blob_uri: Blob URI path for client to upload data. Example: @@ -3530,7 +3496,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class BlobReferenceSasCredential(_Model): # pylint: disable=docstring-missing-param +class BlobReferenceSasCredential(_Model): """SAS Credential definition. :ivar sas_uri: SAS uri. Required. @@ -3630,9 +3596,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT # type: ignore -class BrowserAutomationPreviewTool( - Tool, discriminator="browser_automation_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class BrowserAutomationPreviewTool(Tool, discriminator="browser_automation_preview"): """The input definition information for a Browser Automation Tool, as used to configure an Agent. :ivar type: The object type, which is always 'browser_automation_preview'. Required. @@ -3669,9 +3633,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.BROWSER_AUTOMATION_PREVIEW # type: ignore -class BrowserAutomationPreviewToolboxTool( - ToolboxTool, discriminator="browser_automation_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class BrowserAutomationPreviewToolboxTool(ToolboxTool, discriminator="browser_automation_preview"): """A browser automation tool stored in a toolbox. :ivar name: Optional user-defined name for this tool or configuration. @@ -3717,9 +3679,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolboxToolType.BROWSER_AUTOMATION_PREVIEW # type: ignore -class BrowserAutomationToolConnectionParameters( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only +class BrowserAutomationToolConnectionParameters(_Model): # pylint: disable=name-too-long """Definition of input parameters for the connection used by the Browser Automation Tool. :ivar project_connection_id: The ID of the project connection to your Azure Playwright @@ -3748,7 +3708,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class BrowserAutomationToolParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class BrowserAutomationToolParameters(_Model): """Definition of input parameters for the Browser Automation Tool. :ivar connection: The project connection parameters associated with the Browser Automation @@ -3779,9 +3739,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CaptureStructuredOutputsTool( - Tool, discriminator="capture_structured_outputs" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class CaptureStructuredOutputsTool(Tool, discriminator="capture_structured_outputs"): """A tool for capturing structured outputs. :ivar type: The type of the tool. Always ``capture_structured_outputs``. Required. @@ -3837,7 +3795,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.CAPTURE_STRUCTURED_OUTPUTS # type: ignore -class ChartCoordinate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class ChartCoordinate(_Model): """Coordinates for the analysis chart. :ivar x: X-axis coordinate. Required. @@ -3875,7 +3833,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class MemoryItem(_Model): """A single memory item stored in the memory store, containing content and metadata. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -3932,9 +3890,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ChatSummaryMemoryItem( - MemoryItem, discriminator="chat_summary" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class ChatSummaryMemoryItem(MemoryItem, discriminator="chat_summary"): """A memory item containing a summary extracted from conversations. :ivar memory_id: The unique ID of the memory item. Required. @@ -3975,7 +3931,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = MemoryItemKind.CHAT_SUMMARY # type: ignore -class ClusterInsightResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class ClusterInsightResult(_Model): """Insights from the cluster analysis. :ivar summary: Summary of the insights report. Required. @@ -4052,7 +4008,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ClusterTokenUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class ClusterTokenUsage(_Model): """Token usage for cluster analysis. :ivar input_token_usage: input token usage. Required. @@ -4096,7 +4052,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class EvaluatorDefinition(_Model): """Base evaluator configuration with discriminator. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -4152,9 +4108,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CodeBasedEvaluatorDefinition( - EvaluatorDefinition, discriminator="code" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class CodeBasedEvaluatorDefinition(EvaluatorDefinition, discriminator="code"): """Code-based evaluator definition using python code. :ivar init_parameters: The JSON schema (Draft 2020-12) for the evaluator's input parameters. @@ -4215,7 +4169,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = EvaluatorDefinitionType.CODE # type: ignore -class CodeConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class CodeConfiguration(_Model): """Code-based deployment configuration for a hosted agent. :ivar runtime: The runtime identifier for code execution (e.g., 'python_3_11', 'python_3_12', @@ -4272,9 +4226,7 @@ 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 +class CodeInterpreterTool(Tool, discriminator="code_interpreter"): """Code interpreter. :ivar type: The type of the code interpreter tool. Always ``code_interpreter``. Required. @@ -4341,9 +4293,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.CODE_INTERPRETER # type: ignore -class CodeInterpreterToolboxTool( - ToolboxTool, discriminator="code_interpreter" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class CodeInterpreterToolboxTool(ToolboxTool, discriminator="code_interpreter"): """A code interpreter tool stored in a toolbox. :ivar name: Optional user-defined name for this tool or configuration. @@ -4401,7 +4351,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolboxToolType.CODE_INTERPRETER # type: ignore -class ComparisonFilter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class ComparisonFilter(_Model): """Comparison Filter. :ivar type: Specifies the comparison operator: ``eq``, ``ne``, ``gt``, ``gte``, ``lt``, @@ -4468,7 +4418,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CompoundFilter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class CompoundFilter(_Model): """Compound Filter. :ivar type: Type of operation: ``and`` or ``or``. Required. Is either a Literal["and"] type or @@ -4533,9 +4483,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.COMPUTER # type: ignore -class ComputerUsePreviewTool( - Tool, discriminator="computer_use_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class ComputerUsePreviewTool(Tool, discriminator="computer_use_preview"): """Computer use preview. :ivar type: The type of the computer use tool. Always ``computer_use_preview``. Required. @@ -4624,7 +4572,7 @@ class Connection(_Model): """Metadata of the connection. Required.""" -class FunctionShellToolParamEnvironment(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class FunctionShellToolParamEnvironment(_Model): """FunctionShellToolParamEnvironment. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -4657,9 +4605,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ContainerAutoParam( - FunctionShellToolParamEnvironment, discriminator="container_auto" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class ContainerAutoParam(FunctionShellToolParamEnvironment, discriminator="container_auto"): """ContainerAutoParam. :ivar type: Automatically creates a container for this request. Required. CONTAINER_AUTO. @@ -4712,7 +4658,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = FunctionShellToolParamEnvironmentType.CONTAINER_AUTO # type: ignore -class ContainerConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class ContainerConfiguration(_Model): """Container-based deployment configuration for a hosted agent. :ivar image: The container image for the hosted agent. Required. @@ -4755,7 +4701,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ContainerNetworkPolicyParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class ContainerNetworkPolicyParam(_Model): """Network access policy for the container. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -4787,9 +4733,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ContainerNetworkPolicyAllowlistParam( - ContainerNetworkPolicyParam, discriminator="allowlist" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class ContainerNetworkPolicyAllowlistParam(ContainerNetworkPolicyParam, discriminator="allowlist"): """ContainerNetworkPolicyAllowlistParam. :ivar type: Allow outbound network access only to specified domains. Always ``allowlist``. @@ -4859,7 +4803,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ContainerNetworkPolicyParamType.DISABLED # type: ignore -class ContainerNetworkPolicyDomainSecretParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class ContainerNetworkPolicyDomainSecretParam(_Model): """ContainerNetworkPolicyDomainSecretParam. :ivar domain: The domain associated with the secret. Required. @@ -4897,7 +4841,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ContainerSkill(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class ContainerSkill(_Model): """ContainerSkill. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -4929,7 +4873,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationRuleAction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class EvaluationRuleAction(_Model): """Evaluation action model. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -4963,9 +4907,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ContinuousEvaluationRuleAction( - EvaluationRuleAction, discriminator="continuousEvaluation" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class ContinuousEvaluationRuleAction(EvaluationRuleAction, discriminator="continuousEvaluation"): """Evaluation rule action for continuous evaluation. :ivar type: Required. Continuous evaluation. @@ -5016,9 +4958,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = EvaluationRuleActionType.CONTINUOUS_EVALUATION # type: ignore -class CosmosDBIndex( - Index, discriminator="CosmosDBNoSqlVectorStore" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class CosmosDBIndex(Index, discriminator="CosmosDBNoSqlVectorStore"): """CosmosDB Vector Store Index Definition. :ivar id: Asset ID, a unique identifier for the asset. @@ -5085,7 +5025,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = IndexType.COSMOS_DB # type: ignore -class CreateAsyncResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class CreateAsyncResponse(_Model): """CreateAsyncResponse. :ivar location: URL to poll for operation status. @@ -5121,7 +5061,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CreateSkillVersionFromFilesBody(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class CreateSkillVersionFromFilesBody(_Model): """Multipart request body for creating a skill version from files. Accepts either a single zip file or multiple individual skill files (directory upload). For zip uploads, the server extracts and validates contents. For directory uploads, files are validated as-is. @@ -5160,7 +5100,39 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Trigger(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class CreateTranscriptionResponseJsonUsage(_Model): + """Token usage statistics for the request. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + TranscriptTextUsageDuration, TranscriptTextUsageTokens + + :ivar type: Required. Known values are: "tokens" and "duration". + :vartype type: str or ~azure.ai.projects.models.CreateTranscriptionResponseJsonUsageType + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"tokens\" and \"duration\".""" + + @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 Trigger(_Model): """Base model for Trigger of the schedule. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -5193,7 +5165,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CronTrigger(Trigger, discriminator="Cron"): # pylint: disable=docstring-keyword-should-match-keyword-only +class CronTrigger(Trigger, discriminator="Cron"): """Cron based trigger. :ivar type: Required. Cron based trigger. @@ -5272,7 +5244,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = CredentialType.CUSTOM # type: ignore -class CustomToolParamFormat(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class CustomToolParamFormat(_Model): """The input format for the custom tool. Default is unconstrained text. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -5304,9 +5276,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CustomGrammarFormatParam( - CustomToolParamFormat, discriminator="grammar" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class CustomGrammarFormatParam(CustomToolParamFormat, discriminator="grammar"): """Grammar format. :ivar type: Grammar format. Always ``grammar``. Required. GRAMMAR. @@ -5348,7 +5318,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = CustomToolParamFormatType.GRAMMAR # type: ignore -class RoutineTrigger(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class RoutineTrigger(_Model): """Base model for a routine trigger. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -5382,9 +5352,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CustomRoutineTrigger( - RoutineTrigger, discriminator="custom" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class CustomRoutineTrigger(RoutineTrigger, discriminator="custom"): """A custom event routine trigger. :ivar type: The trigger type. Required. A custom event trigger. @@ -5454,7 +5422,7 @@ 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(Tool, discriminator="custom"): """Custom tool. :ivar type: The type of the custom tool. Always ``custom``. Required. CUSTOM. @@ -5510,7 +5478,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.CUSTOM # type: ignore -class RecurrenceSchedule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class RecurrenceSchedule(_Model): """Recurrence schedule model. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -5545,9 +5513,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DailyRecurrenceSchedule( - RecurrenceSchedule, discriminator="Daily" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class DailyRecurrenceSchedule(RecurrenceSchedule, discriminator="Daily"): """Daily recurrence schedule. :ivar type: Daily recurrence type. Required. Daily recurrence pattern. @@ -5580,7 +5546,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RecurrenceType.DAILY # type: ignore -class DataGenerationJob(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class DataGenerationJob(_Model): """Data Generation Job resource. :ivar id: Server-assigned unique identifier. Required. @@ -5640,7 +5606,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DataGenerationJobInputs(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class DataGenerationJobInputs(_Model): """Caller-supplied inputs for a data generation job. :ivar name: The display name of the data generation job. Required. @@ -5700,7 +5666,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DataGenerationJobOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class DataGenerationJobOptions(_Model): """Options for managing data generation jobs. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -5754,7 +5720,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DataGenerationJobOutput(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class DataGenerationJobOutput(_Model): """Output information for a data generation job. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -5786,7 +5752,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DataGenerationJobOutputOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class DataGenerationJobOutputOptions(_Model): """Output options for data generation job. :ivar name: Name to assign to the output. Used as the filename for Azure OpenAI file outputs @@ -5830,7 +5796,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DataGenerationJobResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class DataGenerationJobResult(_Model): """Result produced by a successful data generation job. :ivar outputs: The final job outputs: Azure OpenAI files for fine-tuning, or datasets for @@ -5873,7 +5839,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DataGenerationModelOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class DataGenerationModelOptions(_Model): """LLM model options for data generation jobs. :ivar model: Base model name used to generate data. Required. @@ -5920,7 +5886,7 @@ class DataGenerationTokenUsage(_Model): """Total number of tokens used. Required.""" -class DatasetCredential(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class DatasetCredential(_Model): """Represents a reference to a blob for consumption. :ivar blob_reference: Credential info to access the storage account. Required. @@ -5997,9 +5963,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = DataGenerationJobOutputType.DATASET # type: ignore -class DatasetEvaluatorGenerationJobSource( - EvaluatorGenerationJobSource, discriminator="dataset" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class DatasetEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator="dataset"): """Dataset source for evaluator generation jobs — reference to a dataset. :ivar description: Optional description of what this source represents — helps the pipeline @@ -6047,7 +6011,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = EvaluatorGenerationJobSourceType.DATASET # type: ignore -class DatasetReference(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class DatasetReference(_Model): """Reference to a versioned Foundry Dataset. :ivar name: Dataset name. Required. @@ -6080,7 +6044,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DatasetVersion(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class DatasetVersion(_Model): """DatasetVersion Definition. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -6154,7 +6118,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DeleteAgentResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class DeleteAgentResponse(_Model): """A deleted agent Object. :ivar object: The object type. Always 'agent.deleted'. Required. AGENT_DELETED. @@ -6194,7 +6158,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DeleteAgentVersionResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class DeleteAgentVersionResponse(_Model): """A deleted agent version Object. :ivar object: The object type. Always 'agent.version.deleted'. Required. AGENT_VERSION_DELETED. @@ -6239,7 +6203,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DeleteMemoryResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class DeleteMemoryResult(_Model): """Response for deleting a memory item from a memory store. :ivar object: The object type. Always 'memory_store.item.deleted'. Required. MEMORY_DELETED. @@ -6279,7 +6243,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DeleteMemoryStoreResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class DeleteMemoryStoreResult(_Model): """DeleteMemoryStoreResult. :ivar object: The object type. Always 'memory_store.deleted'. Required. MEMORY_STORE_DELETED. @@ -6319,7 +6283,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DeleteSkillResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class DeleteSkillResult(_Model): """A deleted skill. :ivar id: The unique identifier of the deleted skill. Required. @@ -6357,7 +6321,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DeleteSkillVersionResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class DeleteSkillVersionResult(_Model): """A deleted skill version. :ivar id: The unique identifier of the deleted skill version. Required. @@ -6400,7 +6364,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Deployment(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class Deployment(_Model): """Model Deployment Definition. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -6436,7 +6400,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Dimension(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class Dimension(_Model): """A single dimension — one independent, measurable quality dimension within a rubric evaluator's scoring blueprint. @@ -6497,7 +6461,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DispatchRoutineResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class DispatchRoutineResult(_Model): """Identifiers returned after a routine dispatch is queued. :ivar dispatch_id: The dispatch identifier created for the routine dispatch. @@ -6535,7 +6499,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EmbeddingConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class EmbeddingConfiguration(_Model): """Embedding configuration class. :ivar model_deployment_name: Deployment name of embedding model. It can point to a model @@ -6574,9 +6538,7 @@ class EmptyModelParam(_Model): """EmptyModelParam.""" -class EndpointBasedEvaluatorDefinition( - EvaluatorDefinition, discriminator="endpoint" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class EndpointBasedEvaluatorDefinition(EvaluatorDefinition, discriminator="endpoint"): """Endpoint-based evaluator definition. The customer owns and hosts an HTTP endpoint that implements the evaluation contract. The evaluator references a Project Connection by name; the connection stores the endpoint URL and credentials (API Key or Entra ID). At execution time, @@ -6686,7 +6648,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = CredentialType.ENTRA_ID # type: ignore -class EvalResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class EvalResult(_Model): """Result of the evaluation. :ivar name: name of the check. Required. @@ -6729,7 +6691,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvalRunResultCompareItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class EvalRunResultCompareItem(_Model): """Metric comparison for a treatment against the baseline. :ivar treatment_run_id: The treatment run ID. Required. @@ -6785,7 +6747,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvalRunResultComparison(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class EvalRunResultComparison(_Model): """Comparison results for treatment runs against the baseline. :ivar testing_criteria: Name of the testing criteria. Required. @@ -6839,7 +6801,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvalRunResultSummary(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class EvalRunResultSummary(_Model): """Summary statistics of a metric in an evaluation run. :ivar run_id: The evaluation run ID. Required. @@ -6884,9 +6846,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationComparisonInsightRequest( - InsightRequest, discriminator="EvaluationComparison" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class EvaluationComparisonInsightRequest(InsightRequest, discriminator="EvaluationComparison"): """Evaluation Comparison Request. :ivar type: The type of request. Required. Evaluation Comparison. @@ -6931,9 +6891,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = InsightType.EVALUATION_COMPARISON # type: ignore -class EvaluationComparisonInsightResult( - InsightResult, discriminator="EvaluationComparison" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class EvaluationComparisonInsightResult(InsightResult, discriminator="EvaluationComparison"): """Insights from the evaluation comparison. :ivar type: The type of insights result. Required. Evaluation Comparison. @@ -6973,7 +6931,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = InsightType.EVALUATION_COMPARISON # type: ignore -class InsightSample(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class InsightSample(_Model): """A sample from the analysis. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -7022,9 +6980,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationResultSample( - InsightSample, discriminator="EvaluationResultSample" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class EvaluationResultSample(InsightSample, discriminator="EvaluationResultSample"): """A sample from the evaluation result. :ivar id: The unique identifier for the analysis sample. Required. @@ -7068,7 +7024,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = SampleType.EVALUATION_RESULT_SAMPLE # type: ignore -class EvaluationRule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class EvaluationRule(_Model): """Evaluation rule model. :ivar id: Unique identifier for the evaluation rule. Required. @@ -7137,7 +7093,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationRuleFilter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class EvaluationRuleFilter(_Model): """Evaluation filter model. :ivar agent_name: Filter by agent name. Required. @@ -7165,9 +7121,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationRunClusterInsightRequest( - InsightRequest, discriminator="EvaluationRunClusterInsight" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class EvaluationRunClusterInsightRequest(InsightRequest, discriminator="EvaluationRunClusterInsight"): """Insights on set of Evaluation Results. :ivar type: The type of insights request. Required. Insights on an Evaluation run result. @@ -7212,9 +7166,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = InsightType.EVALUATION_RUN_CLUSTER_INSIGHT # type: ignore -class EvaluationRunClusterInsightResult( - InsightResult, discriminator="EvaluationRunClusterInsight" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class EvaluationRunClusterInsightResult(InsightResult, discriminator="EvaluationRunClusterInsight"): """Insights from the evaluation run cluster analysis. :ivar type: The type of insights result. Required. Insights on an Evaluation run result. @@ -7249,7 +7201,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = InsightType.EVALUATION_RUN_CLUSTER_INSIGHT # type: ignore -class ScheduleTask(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class ScheduleTask(_Model): """Schedule task model. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -7286,9 +7238,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationScheduleTask( - ScheduleTask, discriminator="Evaluation" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class EvaluationScheduleTask(ScheduleTask, discriminator="Evaluation"): """Evaluation task for the schedule. :ivar configuration: Configuration for the task. @@ -7329,7 +7279,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ScheduleTaskType.EVALUATION # type: ignore -class EvaluationTaxonomy(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class EvaluationTaxonomy(_Model): """Evaluation Taxonomy Definition. :ivar id: Asset ID, a unique identifier for the asset. @@ -7393,7 +7343,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorCredentialRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class EvaluatorCredentialRequest(_Model): """Request body for getting evaluator credentials. :ivar blob_uri: The blob URI for the evaluator storage. Example: @@ -7423,7 +7373,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorGenerationArtifacts(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class EvaluatorGenerationArtifacts(_Model): """Service-managed provenance artifacts produced by an evaluator generation job. Present only on EvaluatorVersion resources created via the generation pipeline. The combined-JSONL Foundry Dataset is read-only and resolves to a versioned dataset in a service-reserved namespace. @@ -7472,7 +7422,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorGenerationInputs(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class EvaluatorGenerationInputs(_Model): """Caller-supplied inputs for an evaluator generation job. :ivar sources: Source materials for generation — agent descriptions, prompts, traces, or @@ -7555,7 +7505,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorGenerationJob(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class EvaluatorGenerationJob(_Model): """Evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions from source materials. On success, the result is the persisted EvaluatorVersion. @@ -7632,7 +7582,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorGenerationTokenUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class EvaluatorGenerationTokenUsage(_Model): """Token consumption summary for an evaluator generation job. Populated when the job reaches a terminal state. @@ -7671,7 +7621,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorMetric(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class EvaluatorMetric(_Model): """Evaluator Metric. :ivar type: Type of the metric. Known values are: "ordinal", "continuous", and "boolean". @@ -7730,7 +7680,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorVersion(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class EvaluatorVersion(_Model): """Evaluator Definition. :ivar display_name: Display Name for evaluator. It helps to find the evaluator easily in AI @@ -7859,9 +7809,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ExternalAgentDefinition( - AgentDefinition, discriminator="external" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class ExternalAgentDefinition(AgentDefinition, discriminator="external"): """The external agent definition. Represents a third-party agent hosted outside Foundry (for example, on GCP or AWS). Registration is metadata-only: Foundry records the agent definition to light up observability experiences (traces, evaluations) over customer-emitted OpenTelemetry @@ -7909,7 +7857,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = AgentKind.EXTERNAL # type: ignore -class FabricDataAgentToolParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class FabricDataAgentToolParameters(_Model): """The fabric data agent tool parameters. :ivar project_connections: The project connections attached to this tool. There can be a @@ -7941,9 +7889,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class FabricIQPreviewTool( - Tool, discriminator="fabric_iq_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class FabricIQPreviewTool(Tool, discriminator="fabric_iq_preview"): """A FabricIQ server-side tool. :ivar type: The object type, which is always 'fabric_iq_preview'. Required. FABRIC_IQ_PREVIEW. @@ -7997,9 +7943,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.FABRIC_IQ_PREVIEW # type: ignore -class FabricIQPreviewToolboxTool( - ToolboxTool, discriminator="fabric_iq_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class FabricIQPreviewToolboxTool(ToolboxTool, discriminator="fabric_iq_preview"): """A FabricIQ tool stored in a toolbox. :ivar name: Optional user-defined name for this tool or configuration. @@ -8064,7 +8008,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolboxToolType.FABRIC_IQ_PREVIEW # type: ignore -class FieldMapping(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class FieldMapping(_Model): """Field mapping configuration class. :ivar content_fields: List of fields with text content. Required. @@ -8152,9 +8096,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = DataGenerationJobOutputType.FILE # type: ignore -class FileDataGenerationJobSource( - DataGenerationJobSource, discriminator="file" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class FileDataGenerationJobSource(DataGenerationJobSource, discriminator="file"): """File source for data generation jobs — Azure OpenAI file input. :ivar description: Optional description of what this source represents — helps the pipeline @@ -8193,9 +8135,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = DataGenerationJobSourceType.FILE # type: ignore -class FileDatasetVersion( - DatasetVersion, discriminator="uri_file" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class FileDatasetVersion(DatasetVersion, discriminator="uri_file"): """FileDatasetVersion Definition. :ivar data_uri: URI of the data (`example `_). @@ -8247,7 +8187,7 @@ 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 +class FileSearchTool(Tool, discriminator="file_search"): """File search. :ivar type: The type of the file search tool. Always ``file_search``. Required. FILE_SEARCH. @@ -8318,9 +8258,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.FILE_SEARCH # type: ignore -class FileSearchToolboxTool( - ToolboxTool, discriminator="file_search" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class FileSearchToolboxTool(ToolboxTool, discriminator="file_search"): """A file search tool stored in a toolbox. :ivar name: Optional user-defined name for this tool or configuration. @@ -8383,7 +8321,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolboxToolType.FILE_SEARCH # type: ignore -class VersionSelectionRule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class VersionSelectionRule(_Model): """VersionSelectionRule. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -8420,9 +8358,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class FixedRatioVersionSelectionRule( - VersionSelectionRule, discriminator="FixedRatio" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class FixedRatioVersionSelectionRule(VersionSelectionRule, discriminator="FixedRatio"): """FixedRatioVersionSelectionRule. :ivar agent_version: The agent version to route traffic to. Required. @@ -8459,9 +8395,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = VersionSelectorType.FIXED_RATIO # type: ignore -class FolderDatasetVersion( - DatasetVersion, discriminator="uri_folder" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class FolderDatasetVersion(DatasetVersion, discriminator="uri_folder"): """FileDatasetVersion Definition. :ivar data_uri: URI of the data (`example `_). @@ -8513,7 +8447,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = DatasetType.URI_FOLDER # type: ignore -class FoundryModelWarning(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class FoundryModelWarning(_Model): """A warning associated with a model. :ivar code: The warning code. Known values are: "RuntimeDependentArtifact" and @@ -8549,9 +8483,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class FunctionShellToolParam( - Tool, discriminator="shell" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class FunctionShellToolParam(Tool, discriminator="shell"): """Shell tool. :ivar type: The type of the shell tool. Always ``shell``. Required. SHELL. @@ -8612,7 +8544,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class FunctionShellToolParamEnvironmentContainerReferenceParam( FunctionShellToolParamEnvironment, discriminator="container_reference" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only +): # pylint: disable=name-too-long """FunctionShellToolParamEnvironmentContainerReferenceParam. :ivar type: References a container created with the /v1/containers endpoint. Required. @@ -8648,7 +8580,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class FunctionShellToolParamEnvironmentLocalEnvironmentParam( FunctionShellToolParamEnvironment, discriminator="local" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only +): # pylint: disable=name-too-long """FunctionShellToolParamEnvironmentLocalEnvironmentParam. :ivar type: Use a local computer environment. Required. LOCAL. @@ -8683,7 +8615,7 @@ 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 +class FunctionTool(Tool, discriminator="function"): """Function. :ivar type: The type of the function tool. Always ``function``. Required. FUNCTION. @@ -8745,7 +8677,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.FUNCTION # type: ignore -class FunctionToolParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class FunctionToolParam(_Model): """FunctionToolParam. :ivar name: Required. @@ -8807,9 +8739,100 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["function"] = "function" -class GitHubIssueRoutineTrigger( - RoutineTrigger, discriminator="github_issue" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class GenerateVoiceAgentRequest(_Model): + """The inputs for generating a voice agent. Only ``kind`` and ``name`` are always required. The + authoring service expands these inputs into a full, editable ``VoiceAgentDefinition``, which is + then created through ``POST /agents``. The generated ``instructions`` and audio/voice settings + are stored as separate fields on the resulting agent definition, so the caller can edit or + override any of them afterward via standard agent versioning. + + :ivar kind: The agent kind. Always ``voice``. Required. VOICE. + :vartype kind: str or ~azure.ai.projects.models.VOICE + :ivar name: The unique name for the agent to create. Must be a non-empty DNS-like agent name. + Required. + :vartype name: str + :ivar model_type: Optional inference mode. When omitted, the authoring service uses + ``managed``. When supplied, use ``managed`` or ``self_deployed``. Known values are: "managed" + and "self_deployed". + :vartype model_type: str or ~azure.ai.projects.models.VoiceModelType + :ivar model: Optional model identifier. Required when ``model_type`` is ``self_deployed``; + optional when ``model_type`` is ``managed`` or omitted. The service never invents a customer + deployment name. + :vartype model: str + :ivar use_case: An optional authoring use case. An empty string is accepted. + :vartype use_case: str + :ivar goal: An optional natural-language description of what the agent should do. When + supplied, it seeds the generated instructions. + :vartype goal: str + :ivar description: An optional agent description. The authoring service resolves its fallback + when omitted. + :vartype description: str + :ivar tools: Optional tools carried through verbatim onto the generated agent (see + ``VoiceAgentTool``). + :vartype tools: list[~azure.ai.projects.models.VoiceAgentTool] + :ivar draft: (Preview) When ``true``, the generated voice agent is created as a draft — an + editable, unpublished version the caller can review and refine before publishing it via the + standard create/version path. The service defaults to ``false`` if a value is not specified by + the caller, in which case the agent is created and published normally. + :vartype draft: bool + """ + + kind: Literal[AgentKind.VOICE] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The agent kind. Always ``voice``. Required. VOICE.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique name for the agent to create. Must be a non-empty DNS-like agent name. Required.""" + model_type: Optional[Union[str, "_models.VoiceModelType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional inference mode. When omitted, the authoring service uses ``managed``. When supplied, + use ``managed`` or ``self_deployed``. Known values are: \"managed\" and \"self_deployed\".""" + model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional model identifier. Required when ``model_type`` is ``self_deployed``; optional when + ``model_type`` is ``managed`` or omitted. The service never invents a customer deployment name.""" + use_case: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional authoring use case. An empty string is accepted.""" + goal: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional natural-language description of what the agent should do. When supplied, it seeds + the generated instructions.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional agent description. The authoring service resolves its fallback when omitted.""" + tools: Optional[list["_models.VoiceAgentTool"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional tools carried through verbatim onto the generated agent (see ``VoiceAgentTool``).""" + draft: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """(Preview) When ``true``, the generated voice agent is created as a draft — an editable, + unpublished version the caller can review and refine before publishing it via the standard + create/version path. The service defaults to ``false`` if a value is not specified by the + caller, in which case the agent is created and published normally.""" + + @overload + def __init__( + self, + *, + kind: Literal[AgentKind.VOICE], + name: str, + model_type: Optional[Union[str, "_models.VoiceModelType"]] = None, + model: Optional[str] = None, + use_case: Optional[str] = None, + goal: Optional[str] = None, + description: Optional[str] = None, + tools: Optional[list["_models.VoiceAgentTool"]] = None, + draft: 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 GitHubIssueRoutineTrigger(RoutineTrigger, discriminator="github_issue"): """A GitHub issue routine trigger. :ivar type: The trigger type. Required. A GitHub issue trigger. @@ -8865,7 +8888,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RoutineTriggerType.GITHUB_ISSUE # type: ignore -class TelemetryEndpointAuth(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class TelemetryEndpointAuth(_Model): """Authentication configuration for a telemetry endpoint. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -8897,9 +8920,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HeaderTelemetryEndpointAuth( - TelemetryEndpointAuth, discriminator="header" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class HeaderTelemetryEndpointAuth(TelemetryEndpointAuth, discriminator="header"): """Header-based secret authentication for a telemetry endpoint. The resolved secret value is injected as an HTTP header. @@ -8945,9 +8966,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = TelemetryEndpointAuthType.HEADER # type: ignore -class HostedAgentDefinition( - AgentDefinition, discriminator="hosted" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class HostedAgentDefinition(AgentDefinition, discriminator="hosted"): """The hosted agent definition. :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. @@ -8973,6 +8992,9 @@ class HostedAgentDefinition( :ivar telemetry_config: Optional customer-supplied telemetry configuration for exporting container logs, traces, and metrics. :vartype telemetry_config: ~azure.ai.projects.models.TelemetryConfig + :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 """ kind: Literal[AgentKind.HOSTED] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore @@ -9004,6 +9026,11 @@ class HostedAgentDefinition( ) """Optional customer-supplied telemetry configuration for exporting container logs, traces, and metrics.""" + session_configuration: Optional["_models.SessionConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional session defaults (for example, the idle timeout) applied to sessions created for this + agent version.""" @overload def __init__( @@ -9017,6 +9044,7 @@ def __init__( protocol_versions: Optional[list["_models.ProtocolVersionRecord"]] = None, code_configuration: Optional["_models.CodeConfiguration"] = None, telemetry_config: Optional["_models.TelemetryConfig"] = None, + session_configuration: Optional["_models.SessionConfiguration"] = None, ) -> None: ... @overload @@ -9058,9 +9086,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RecurrenceType.HOURLY # type: ignore -class HumanEvaluationPreviewRuleAction( - EvaluationRuleAction, discriminator="humanEvaluationPreview" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class HumanEvaluationPreviewRuleAction(EvaluationRuleAction, discriminator="humanEvaluationPreview"): """Evaluation rule action for human evaluation. :ivar type: Required. Human evaluation preview. @@ -9093,7 +9119,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW # type: ignore -class HybridSearchOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class HybridSearchOptions(_Model): """HybridSearchOptions. :ivar embedding_weight: The weight of the embedding in the reciprocal ranking fusion. Required. @@ -9126,9 +9152,7 @@ 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 +class ImageGenTool(Tool, discriminator="image_generation"): """Image generation tool. :ivar type: The type of the image generation tool. Always ``image_generation``. Required. @@ -9292,7 +9316,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.IMAGE_GENERATION # type: ignore -class ImageGenToolInputImageMask(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class ImageGenToolInputImageMask(_Model): """ImageGenToolInputImageMask. :ivar image_url: @@ -9323,9 +9347,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InlineSkillParam( - ContainerSkill, discriminator="inline" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class InlineSkillParam(ContainerSkill, discriminator="inline"): """InlineSkillParam. :ivar type: Defines an inline skill for this request. Required. INLINE. @@ -9368,7 +9390,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ContainerSkillType.INLINE # type: ignore -class InlineSkillSourceParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class InlineSkillSourceParam(_Model): """Inline skill payload. :ivar type: The type of the inline skill source. Must be ``base64``. Required. Default value is @@ -9409,7 +9431,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.media_type: Literal["application/zip"] = "application/zip" -class Insight(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class Insight(_Model): """The response body for cluster insights. :ivar insight_id: The unique identifier for the insights report. Required. @@ -9460,7 +9482,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InsightCluster(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class InsightCluster(_Model): """A cluster of analysis samples. :ivar id: The id of the analysis cluster. Required. @@ -9531,7 +9553,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InsightModelConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class InsightModelConfiguration(_Model): """Configuration of the model used in the insight generation. :ivar model_deployment_name: The model deployment to be evaluated. Accepts either the @@ -9564,9 +9586,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InsightScheduleTask( - ScheduleTask, discriminator="Insight" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class InsightScheduleTask(ScheduleTask, discriminator="Insight"): """Insight task for the schedule. :ivar configuration: Configuration for the task. @@ -9602,7 +9622,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ScheduleTaskType.INSIGHT # type: ignore -class InsightsMetadata(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class InsightsMetadata(_Model): """Metadata about the insights. :ivar created_at: The timestamp when the insights were created. Required. @@ -9639,7 +9659,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InsightSummary(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class InsightSummary(_Model): """Summary of the error cluster analysis. :ivar sample_count: Total number of samples analyzed. Required. @@ -9699,7 +9719,7 @@ class InvocationsWsProtocolConfiguration(_Model): """Configuration specific to the WebSocket-based invocations protocol.""" -class RoutineDispatchPayload(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class RoutineDispatchPayload(_Model): """Base model for a manual dispatch payload. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -9733,9 +9753,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InvokeAgentInvocationsApiDispatchPayload( - RoutineDispatchPayload, discriminator="invoke_agent_invocations_api" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class InvokeAgentInvocationsApiDispatchPayload(RoutineDispatchPayload, discriminator="invoke_agent_invocations_api"): """A manual payload used to test an invocations API routine dispatch. :ivar type: The manual dispatch payload type. Required. A manual payload for an invocations API @@ -9772,7 +9790,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API # type: ignore -class RoutineAction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class RoutineAction(_Model): """Base model for a routine action. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -9806,9 +9824,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InvokeAgentInvocationsApiRoutineAction( - RoutineAction, discriminator="invoke_agent_invocations_api" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class InvokeAgentInvocationsApiRoutineAction(RoutineAction, discriminator="invoke_agent_invocations_api"): """Dispatches a routine through the raw invocations API. Exactly one of agent_name or agent_endpoint_id must be provided. @@ -9861,9 +9877,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RoutineActionType.INVOKE_AGENT_INVOCATIONS_API # type: ignore -class InvokeAgentResponsesApiDispatchPayload( - RoutineDispatchPayload, discriminator="invoke_agent_responses_api" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class InvokeAgentResponsesApiDispatchPayload(RoutineDispatchPayload, discriminator="invoke_agent_responses_api"): """A manual payload used to test a responses API routine dispatch. :ivar type: The manual dispatch payload type. Required. A manual payload for a responses API @@ -9900,9 +9914,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API # type: ignore -class InvokeAgentResponsesApiRoutineAction( - RoutineAction, discriminator="invoke_agent_responses_api" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class InvokeAgentResponsesApiRoutineAction(RoutineAction, discriminator="invoke_agent_responses_api"): """Dispatches a routine through the responses API. Exactly one of agent_name or agent_endpoint_id must be provided. @@ -9954,9 +9966,84 @@ 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 +class VoiceGreetingConfig(_Model): + """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: + LlmGeneratedVoiceGreetingConfig, TemplateVoiceGreetingConfig + + :ivar type: The greeting mode. 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 greeting mode. 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 LlmGeneratedVoiceGreetingConfig(VoiceGreetingConfig, discriminator="llm_generated"): + """A greeting authored by the session model from a scoped opening-turn prompt. + + :ivar type: Required. Default value is "llm_generated". + :vartype type: str + :ivar prompt: The Handlebars prompt that guides the opening turn. Required. + :vartype prompt: str + :ivar tool_choice: The tool-selection policy for the opening response. Defaults to ``none``. 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 + """ + + type: Literal["llm_generated"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"llm_generated\".""" + prompt: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Handlebars prompt that guides the opening turn. Required.""" + tool_choice: Optional["_unions.VoiceAgentToolChoice"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The tool-selection policy for the opening response. Defaults to ``none``. Is one of the + following types: Literal[\"none\"], Literal[\"auto\"], Literal[\"required\"], + ToolChoiceFunction, ToolChoiceMCP""" + + @overload + def __init__( + self, + *, + prompt: str, + tool_choice: Optional["_unions.VoiceAgentToolChoice"] = 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 = "llm_generated" # type: ignore + + +class LocalShellToolParam(Tool, discriminator="local_shell"): """Local shell tool. :ivar type: The type of the local shell tool. Always ``local_shell``. Required. LOCAL_SHELL. @@ -10003,7 +10090,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.LOCAL_SHELL # type: ignore -class LocalSkillParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class LocalSkillParam(_Model): """LocalSkillParam. :ivar name: The name of the skill. Required. @@ -10041,7 +10128,45 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class LoraConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class LogProbProperties(_Model): + """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): """Adapter-specific metadata for LoRA models. Drives serving engine configuration at deployment time. @@ -10089,9 +10214,7 @@ 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 +class ManagedAgentIdentityBlueprintReference(AgentBlueprintReference, discriminator="ManagedAgentIdentityBlueprint"): """ManagedAgentIdentityBlueprintReference. :ivar type: Required. MANAGED_AGENT_IDENTITY_BLUEPRINT. @@ -10124,9 +10247,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT # type: ignore -class ManagedAzureAISearchIndex( - Index, discriminator="ManagedAzureSearch" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class ManagedAzureAISearchIndex(Index, discriminator="ManagedAzureSearch"): """Managed Azure AI Search Index Definition. :ivar id: Asset ID, a unique identifier for the asset. @@ -10171,7 +10292,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = IndexType.MANAGED_AZURE_SEARCH # type: ignore -class MCPListToolsTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class MCPListToolsTool(_Model): """MCP list tools tool. :ivar name: The name of the tool. Required. @@ -10228,7 +10349,7 @@ class McpProtocolConfiguration(_Model): """Configuration specific to the MCP protocol.""" -class MCPTool(Tool, discriminator="mcp"): # pylint: disable=docstring-keyword-should-match-keyword-only +class MCPTool(Tool, discriminator="mcp"): """MCP tool. :ivar type: The type of the MCP tool. Always ``mcp``. Required. MCP. @@ -10393,7 +10514,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.MCP # type: ignore -class MCPToolboxTool(ToolboxTool, discriminator="mcp"): # pylint: disable=docstring-keyword-should-match-keyword-only +class MCPToolboxTool(ToolboxTool, discriminator="mcp"): """An MCP tool stored in a toolbox. :ivar name: Optional user-defined name for this tool or configuration. @@ -10561,7 +10682,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolboxToolType.MCP # type: ignore -class MCPToolFilter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class MCPToolFilter(_Model): """MCP tool filter. :ivar tool_names: MCP allowed tools. @@ -10600,7 +10721,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MCPToolRequireApproval(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class MCPToolRequireApproval(_Model): """MCPToolRequireApproval. :ivar always: @@ -10631,7 +10752,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryOperation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class MemoryOperation(_Model): """Represents a single memory operation (create, update, or delete) performed on a memory item. :ivar kind: The type of memory operation being performed. Required. Known values are: "create", @@ -10668,7 +10789,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemorySearchItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class MemorySearchItem(_Model): """A retrieved memory item from memory search. :ivar memory_item: Retrieved memory item. Required. @@ -10696,7 +10817,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemorySearchOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class MemorySearchOptions(_Model): """Memory search options. :ivar max_memories: Maximum number of memory items to return. @@ -10724,9 +10845,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemorySearchPreviewTool( - Tool, discriminator="memory_search_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class MemorySearchPreviewTool(Tool, discriminator="memory_search_preview"): """A tool for integrating memories into the agent. :ivar type: The type of the tool. Always ``memory_search_preview``. Required. @@ -10782,7 +10901,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.MEMORY_SEARCH_PREVIEW # type: ignore -class MemoryStoreDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class MemoryStoreDefinition(_Model): """Base definition for memory store configurations. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -10814,9 +10933,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryStoreDefaultDefinition( - MemoryStoreDefinition, discriminator="default" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class MemoryStoreDefaultDefinition(MemoryStoreDefinition, discriminator="default"): """Default memory store implementation. :ivar kind: The kind of the memory store. Required. The default memory store implementation. @@ -10862,7 +10979,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = MemoryStoreKind.DEFAULT # type: ignore -class MemoryStoreDefaultOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class MemoryStoreDefaultOptions(_Model): """Default memory store configurations. :ivar user_profile_enabled: Whether to enable user profile extraction and storage. Default is @@ -10919,7 +11036,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryStoreDeleteScopeResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class MemoryStoreDeleteScopeResult(_Model): """Response for deleting memories from a scope. :ivar object: The object type. Always 'memory_store.scope.deleted'. Required. @@ -10965,7 +11082,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryStoreDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class MemoryStoreDetails(_Model): """A memory store that can store and retrieve user memories. :ivar object: The object type, which is always 'memory_store'. Required. MEMORY_STORE. @@ -11035,7 +11152,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryStoreOperationUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class MemoryStoreOperationUsage(_Model): """Usage statistics of a memory store operation. :ivar embedding_tokens: The number of embedding tokens. Required. @@ -11092,7 +11209,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryStoreSearchResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class MemoryStoreSearchResult(_Model): """Memory search response. :ivar search_id: The unique ID of this search request. Use this value as previous_search_id in @@ -11132,7 +11249,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryStoreUpdateCompletedResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class MemoryStoreUpdateCompletedResult(_Model): """Memory update result. :ivar memory_operations: A list of individual memory operations that were performed during the @@ -11168,7 +11285,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryStoreUpdateResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class MemoryStoreUpdateResult(_Model): """Provides the status of a memory store update operation. :ivar update_id: The unique ID of this update request. Use this value as previous_update_id in @@ -11226,9 +11343,16 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MicrosoftFabricPreviewTool( - Tool, discriminator="fabric_dataagent_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only +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 MicrosoftFabricPreviewTool(Tool, discriminator="fabric_dataagent_preview"): """The input definition information for a Microsoft Fabric tool as used to configure an agent. :ivar type: The object type, which is always 'fabric_dataagent_preview'. Required. @@ -11265,7 +11389,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.FABRIC_DATAAGENT_PREVIEW # type: ignore -class ModelCredentialRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class ModelCredentialRequest(_Model): """Request to fetch credentials for a model asset. :ivar blob_uri: Blob URI of the model asset to fetch credentials for. Required. @@ -11346,7 +11470,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = DeploymentType.MODEL_DEPLOYMENT # type: ignore -class ModelDeploymentSku(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class ModelDeploymentSku(_Model): """Sku information. :ivar capacity: Sku capacity. Required. @@ -11394,7 +11518,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ModelPendingUploadRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class ModelPendingUploadRequest(_Model): """Represents a request for a pending upload of a model version. :ivar pending_upload_id: If PendingUploadId is not provided, a random GUID will be used. @@ -11441,7 +11565,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ModelPendingUploadResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class ModelPendingUploadResponse(_Model): """Represents the response for a model pending upload request. :ivar blob_reference: Container-level read, write, list SAS. Required. @@ -11493,7 +11617,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ModelSamplingParams(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class ModelSamplingParams(_Model): """Represents a set of parameters used to control the sampling behavior of a language model during text generation. @@ -11537,7 +11661,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ModelSourceData(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class ModelSourceData(_Model): """Source information for the model. :ivar source_type: The source type of the model. Known values are: "LocalUpload" and @@ -11573,7 +11697,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ModelVersion(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class ModelVersion(_Model): """Model Version Definition. :ivar blob_uri: URI of the model artifact in blob storage. Required. @@ -11658,9 +11782,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MonthlyRecurrenceSchedule( - RecurrenceSchedule, discriminator="Monthly" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class MonthlyRecurrenceSchedule(RecurrenceSchedule, discriminator="Monthly"): """Monthly recurrence schedule. :ivar type: Monthly recurrence type. Required. Monthly recurrence pattern. @@ -11695,9 +11817,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RecurrenceType.MONTHLY # type: ignore -class NamespaceToolParam( - Tool, discriminator="namespace" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class NamespaceToolParam(Tool, discriminator="namespace"): """Namespace. :ivar type: The type of the tool. Always ``namespace``. Required. NAMESPACE. @@ -11770,7 +11890,213 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = CredentialType.NONE # type: ignore -class OneTimeTrigger(Trigger, discriminator="OneTime"): # pylint: disable=docstring-keyword-should-match-keyword-only +class OmitPropertiesRealtimeResponse(_Model): + """The template for omitting properties. + + :ivar id: The unique ID of the response, will look like ``resp_1234``. + :vartype id: str + :ivar object: The object type, must be ``realtime.response``. Default value is + "realtime.response". + :vartype object: str + :ivar status: The final status of the response (``completed``, ``cancelled``, ``failed``, or + ``incomplete``, ``in_progress``). Is one of the following types: Literal["completed"], + Literal["cancelled"], Literal["failed"], Literal["incomplete"], Literal["in_progress"] + :vartype status: str or str or str or str or str + :ivar status_details: Additional details about the status. + :vartype status_details: ~azure.ai.projects.models.RealtimeResponseStatusDetails + :ivar usage: Usage statistics for the Response, this will correspond to billing. A Realtime API + session will maintain a conversation context and append new Items to the Conversation, thus + output from previous turns (text and audio tokens) will become the input for later turns. + :vartype usage: ~azure.ai.projects.models.RealtimeResponseUsage + :ivar conversation_id: Which conversation the response is added to, determined by the + ``conversation`` field in the ``response.create`` event. If ``auto``, the response will be + added to the default conversation and the value of ``conversation_id`` will be an id like + ``conv_1234``. If ``none``, the response will not be added to any conversation and the value of + ``conversation_id`` will be ``null``. If responses are being triggered automatically by VAD the + response will be added to the default conversation. + :vartype conversation_id: str + :ivar output_modalities: The set of modalities the model used to respond, currently the only + possible values are ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text + transcript. Setting the output to mode ``text`` will disable audio output from the model. + :vartype output_modalities: list[str or str] + :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, + inclusive of tool calls, that was used in this response. Is either a int type or a + Literal["inf"] type. + :vartype max_output_tokens: int or str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the response, will look like ``resp_1234``.""" + object: Optional[Literal["realtime.response"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The object type, must be ``realtime.response``. Default value is \"realtime.response\".""" + status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The final status of the response (``completed``, ``cancelled``, ``failed``, or ``incomplete``, + ``in_progress``). Is one of the following types: Literal[\"completed\"], + Literal[\"cancelled\"], Literal[\"failed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" + status_details: Optional["_models.RealtimeResponseStatusDetails"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Additional details about the status.""" + usage: Optional["_models.RealtimeResponseUsage"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Usage statistics for the Response, this will correspond to billing. A Realtime API session will + maintain a conversation context and append new Items to the Conversation, thus output from + previous turns (text and audio tokens) will become the input for later turns.""" + conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Which conversation the response is added to, determined by the ``conversation`` field in the + ``response.create`` event. If ``auto``, the response will be added to the default conversation + and the value of ``conversation_id`` will be an id like ``conv_1234``. If ``none``, the + response will not be added to any conversation and the value of ``conversation_id`` will be + ``null``. If responses are being triggered automatically by VAD the response will be added to + the default conversation.""" + output_modalities: Optional[list[Literal["text", "audio"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The set of modalities the model used to respond, currently the only possible values are + ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text transcript. Setting the + output to mode ``text`` will disable audio output from the model.""" + max_output_tokens: Optional[Union[int, Literal["inf"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Maximum number of output tokens for a single assistant response, inclusive of tool calls, that + was used in this response. Is either a int type or a Literal[\"inf\"] type.""" + + @overload + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + object: Optional[Literal["realtime.response"]] = None, + status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] = None, + status_details: Optional["_models.RealtimeResponseStatusDetails"] = None, + usage: Optional["_models.RealtimeResponseUsage"] = None, + conversation_id: Optional[str] = None, + output_modalities: Optional[list[Literal["text", "audio"]]] = None, + max_output_tokens: Optional[Union[int, Literal["inf"]]] = 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 OmitPropertiesRealtimeResponse1(_Model): + """The template for omitting properties. + + :ivar id: The unique ID of the response, will look like ``resp_1234``. + :vartype id: str + :ivar object: The object type, must be ``realtime.response``. Default value is + "realtime.response". + :vartype object: str + :ivar status: The final status of the response (``completed``, ``cancelled``, ``failed``, or + ``incomplete``, ``in_progress``). Is one of the following types: Literal["completed"], + Literal["cancelled"], Literal["failed"], Literal["incomplete"], Literal["in_progress"] + :vartype status: str or str or str or str or str + :ivar status_details: Additional details about the status. + :vartype status_details: ~azure.ai.projects.models.RealtimeResponseStatusDetails + :ivar metadata: + :vartype metadata: ~azure.ai.projects.models.Metadata + :ivar usage: Usage statistics for the Response, this will correspond to billing. A Realtime API + session will maintain a conversation context and append new Items to the Conversation, thus + output from previous turns (text and audio tokens) will become the input for later turns. + :vartype usage: ~azure.ai.projects.models.RealtimeResponseUsage + :ivar conversation_id: Which conversation the response is added to, determined by the + ``conversation`` field in the ``response.create`` event. If ``auto``, the response will be + added to the default conversation and the value of ``conversation_id`` will be an id like + ``conv_1234``. If ``none``, the response will not be added to any conversation and the value of + ``conversation_id`` will be ``null``. If responses are being triggered automatically by VAD the + response will be added to the default conversation. + :vartype conversation_id: str + :ivar output_modalities: The set of modalities the model used to respond, currently the only + possible values are ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text + transcript. Setting the output to mode ``text`` will disable audio output from the model. + :vartype output_modalities: list[str or str] + :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, + inclusive of tool calls, that was used in this response. Is either a int type or a + Literal["inf"] type. + :vartype max_output_tokens: int or str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the response, will look like ``resp_1234``.""" + object: Optional[Literal["realtime.response"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The object type, must be ``realtime.response``. Default value is \"realtime.response\".""" + status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The final status of the response (``completed``, ``cancelled``, ``failed``, or ``incomplete``, + ``in_progress``). Is one of the following types: Literal[\"completed\"], + Literal[\"cancelled\"], Literal[\"failed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" + status_details: Optional["_models.RealtimeResponseStatusDetails"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Additional details about the status.""" + metadata: Optional["_models.Metadata"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + usage: Optional["_models.RealtimeResponseUsage"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Usage statistics for the Response, this will correspond to billing. A Realtime API session will + maintain a conversation context and append new Items to the Conversation, thus output from + previous turns (text and audio tokens) will become the input for later turns.""" + conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Which conversation the response is added to, determined by the ``conversation`` field in the + ``response.create`` event. If ``auto``, the response will be added to the default conversation + and the value of ``conversation_id`` will be an id like ``conv_1234``. If ``none``, the + response will not be added to any conversation and the value of ``conversation_id`` will be + ``null``. If responses are being triggered automatically by VAD the response will be added to + the default conversation.""" + output_modalities: Optional[list[Literal["text", "audio"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The set of modalities the model used to respond, currently the only possible values are + ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text transcript. Setting the + output to mode ``text`` will disable audio output from the model.""" + max_output_tokens: Optional[Union[int, Literal["inf"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Maximum number of output tokens for a single assistant response, inclusive of tool calls, that + was used in this response. Is either a int type or a Literal[\"inf\"] type.""" + + @overload + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + object: Optional[Literal["realtime.response"]] = None, + status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] = None, + status_details: Optional["_models.RealtimeResponseStatusDetails"] = None, + metadata: Optional["_models.Metadata"] = None, + usage: Optional["_models.RealtimeResponseUsage"] = None, + conversation_id: Optional[str] = None, + output_modalities: Optional[list[Literal["text", "audio"]]] = None, + max_output_tokens: Optional[Union[int, Literal["inf"]]] = 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 OneTimeTrigger(Trigger, discriminator="OneTime"): """One-time trigger. :ivar type: Required. One-time trigger. @@ -11810,7 +12136,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = TriggerType.ONE_TIME # type: ignore -class OpenApiAuthDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class OpenApiAuthDetails(_Model): """authentication details for OpenApiFunctionDefinition. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -11871,7 +12197,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = OpenApiAuthType.ANONYMOUS # type: ignore -class OpenApiFunctionDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class OpenApiFunctionDefinition(_Model): """The input definition information for an openapi function. :ivar name: The name of the function to be called. Required. @@ -11925,7 +12251,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OpenApiFunctionDefinitionFunction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class OpenApiFunctionDefinitionFunction(_Model): """OpenApiFunctionDefinitionFunction. :ivar name: The name of the function to be called. Required. @@ -11966,9 +12292,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OpenApiManagedAuthDetails( - OpenApiAuthDetails, discriminator="managed_identity" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class OpenApiManagedAuthDetails(OpenApiAuthDetails, discriminator="managed_identity"): """Security details for OpenApi managed_identity authentication. :ivar type: The object type, which is always 'managed_identity'. Required. MANAGED_IDENTITY. @@ -12003,7 +12327,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = OpenApiAuthType.MANAGED_IDENTITY # type: ignore -class OpenApiManagedSecurityScheme(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class OpenApiManagedSecurityScheme(_Model): """Security scheme for OpenApi managed_identity authentication. :ivar audience: Authentication scope for managed_identity auth type. Required. @@ -12031,9 +12355,7 @@ 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 +class OpenApiProjectConnectionAuthDetails(OpenApiAuthDetails, discriminator="project_connection"): """Security details for OpenApi project connection authentication. :ivar type: The object type, which is always 'project_connection'. Required. @@ -12069,7 +12391,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = OpenApiAuthType.PROJECT_CONNECTION # type: ignore -class OpenApiProjectConnectionSecurityScheme(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class OpenApiProjectConnectionSecurityScheme(_Model): """Security scheme for OpenApi managed_identity authentication. :ivar project_connection_id: Project connection id for Project Connection auth type. Required. @@ -12097,7 +12419,7 @@ 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 +class OpenApiTool(Tool, discriminator="openapi"): """The input definition information for an OpenAPI tool as used to configure an agent. :ivar type: The object type, which is always 'openapi'. Required. OPENAPI. @@ -12140,9 +12462,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.OPENAPI # type: ignore -class OpenApiToolboxTool( - ToolboxTool, discriminator="openapi" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class OpenApiToolboxTool(ToolboxTool, discriminator="openapi"): """An OpenAPI tool stored in a toolbox. :ivar name: Optional user-defined name for this tool or configuration. @@ -12188,7 +12508,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolboxToolType.OPENAPI # type: ignore -class OptimizedAgentIdentifier(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class OptimizedAgentIdentifier(_Model): """Identifies the registered Foundry agent to optimize (request-only). Skills, tools, and system_prompt are specified in options.optimization_config. @@ -12222,7 +12542,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TelemetryEndpoint(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class TelemetryEndpoint(_Model): """A telemetry export endpoint configuration. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -12269,9 +12589,7 @@ 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 +class OtlpTelemetryEndpoint(TelemetryEndpoint, discriminator="OTLP"): """An OTLP (OpenTelemetry Protocol) telemetry export endpoint. :ivar data: Data types to export to this endpoint. Use an empty array to export no data. @@ -12322,7 +12640,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = TelemetryEndpointKind.OTLP # type: ignore -class PendingUploadRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class PendingUploadRequest(_Model): """Represents a request for a pending upload. :ivar pending_upload_id: If PendingUploadId is not provided, a random GUID will be used. @@ -12369,7 +12687,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PendingUploadResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class PendingUploadResponse(_Model): """Represents the response for a pending upload request. :ivar blob_reference: Container-level read, write, list SAS. Required. @@ -12421,9 +12739,37 @@ 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 +class PickPropertiesVoiceAudioConfig(_Model): + """The template for picking properties. + + :ivar output: Output (agent speech) audio configuration. + :vartype output: ~azure.ai.projects.models.VoiceAudioOutputConfig + """ + + output: Optional["_models.VoiceAudioOutputConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Output (agent speech) audio configuration.""" + + @overload + def __init__( + self, + *, + output: Optional["_models.VoiceAudioOutputConfig"] = 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 ProceduralMemoryItem(MemoryItem, discriminator="procedural"): """A memory item containing a procedure extracted from conversations. :ivar memory_id: The unique ID of the memory item. Required. @@ -12494,7 +12840,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.PROGRAMMATIC_TOOL_CALLING # type: ignore -class PromotionInfo(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class PromotionInfo(_Model): """Promotion metadata recorded when a candidate is deployed to a Foundry agent. :ivar promoted_at: Timestamp when promotion occurred, represented in Unix time. Required. @@ -12534,9 +12880,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PromptAgentDefinition( - AgentDefinition, discriminator="prompt" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class PromptAgentDefinition(AgentDefinition, discriminator="prompt"): """The prompt agent definition. :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. @@ -12638,7 +12982,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = AgentKind.PROMPT # type: ignore -class PromptAgentDefinitionTextOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class PromptAgentDefinitionTextOptions(_Model): """Configuration options for a text response from the model. Can be plain text or structured JSON data. @@ -12668,9 +13012,7 @@ 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 +class PromptBasedEvaluatorDefinition(EvaluatorDefinition, discriminator="prompt"): """Prompt-based evaluator. :ivar init_parameters: The JSON schema (Draft 2020-12) for the evaluator's input parameters. @@ -12714,9 +13056,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = EvaluatorDefinitionType.PROMPT # type: ignore -class PromptDataGenerationJobSource( - DataGenerationJobSource, discriminator="prompt" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class PromptDataGenerationJobSource(DataGenerationJobSource, discriminator="prompt"): """Prompt source for data generation jobs — inline text provided by the user. :ivar description: Optional description of what this source represents — helps the pipeline @@ -12757,9 +13097,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = DataGenerationJobSourceType.PROMPT # type: ignore -class PromptEvaluatorGenerationJobSource( - EvaluatorGenerationJobSource, discriminator="prompt" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class PromptEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator="prompt"): """Prompt source for evaluator generation jobs — inline text provided by the user. :ivar description: Optional description of what this source represents — helps the pipeline @@ -12803,7 +13141,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = EvaluatorGenerationJobSourceType.PROMPT # type: ignore -class ProtocolConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class ProtocolConfiguration(_Model): """Per-protocol configuration for the agent endpoint. :ivar activity: Configuration for the activity protocol. @@ -12868,7 +13206,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ProtocolVersionRecord(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class ProtocolVersionRecord(_Model): """A record mapping for a single protocol and its version. :ivar protocol: The protocol type. Required. Known values are: "activity", "responses", "a2a", @@ -12905,7 +13243,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RaiConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class RaiConfig(_Model): """Configuration for Responsible AI (RAI) content filtering and safety features. :ivar rai_policy_name: The name of the RAI policy to apply. Required. @@ -12933,7 +13271,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RankingOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class RankingOptions(_Model): """RankingOptions. :ivar ranker: The ranker to use for the file search. Known values are: "auto" and @@ -12981,57 +13319,25 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Reasoning(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Reasoning. +class RealtimeAudioFormats(_Model): + """RealtimeAudioFormats. - :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 + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + RealtimeAudioFormatsAudioPcm, RealtimeAudioFormatsAudioPcma, RealtimeAudioFormatsAudioPcmu + + :ivar type: Required. Known values are: "audio/pcm", "audio/pcmu", and "audio/pcma". + :vartype type: str or ~azure.ai.projects.models.RealtimeAudioFormatsType """ - 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\"]""" + __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, *, - 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, + type: str, ) -> None: ... @overload @@ -13045,51 +13351,25 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RecurrenceTrigger( - Trigger, discriminator="Recurrence" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Recurrence based trigger. +class RealtimeAudioFormatsAudioPcm(RealtimeAudioFormats, discriminator="audio/pcm"): + """RealtimeAudioFormatsAudioPcm. - :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 type: Required. AUDIO_PCM. + :vartype type: str or ~azure.ai.projects.models.AUDIO_PCM + :ivar rate: Default value is 24000. + :vartype rate: int """ - 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.""" + 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, *, - interval: int, - schedule: "_models.RecurrenceSchedule", - start_time: Optional[datetime.datetime] = None, - end_time: Optional[datetime.datetime] = None, - time_zone: Optional[str] = None, + rate: Optional[Literal[24000]] = None, ) -> None: ... @overload @@ -13101,88 +13381,22 @@ 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 = RealtimeAudioFormatsType.AUDIO_PCM # type: ignore -class RedTeam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Red team details. +class RealtimeAudioFormatsAudioPcma(RealtimeAudioFormats, discriminator="audio/pcma"): + """RealtimeAudioFormatsAudioPcma. - :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 type: Required. AUDIO_PCMA. + :vartype type: str or ~azure.ai.projects.models.AUDIO_PCMA """ - 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.""" + type: Literal[RealtimeAudioFormatsType.AUDIO_PCMA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. AUDIO_PCMA.""" @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 @@ -13194,35 +13408,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 ReminderPreviewToolboxTool( - ToolboxTool, discriminator="reminder_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A reminder tool stored in a toolbox. +class RealtimeAudioFormatsAudioPcmu(RealtimeAudioFormats, discriminator="audio/pcmu"): + """RealtimeAudioFormatsAudioPcmu. - :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 type: Required. AUDIO_PCMU. + :vartype type: str or ~azure.ai.projects.models.AUDIO_PCMU """ - type: Literal[ToolboxToolType.REMINDER_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. REMINDER_PREVIEW.""" + type: Literal[RealtimeAudioFormatsType.AUDIO_PCMU] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. AUDIO_PCMU.""" @overload def __init__( self, - *, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -13234,33 +13435,70 @@ 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 + self.type = RealtimeAudioFormatsType.AUDIO_PCMU # type: ignore -class ResponsesProtocolConfiguration(_Model): - """Configuration specific to the responses protocol.""" +class RealtimeConversationItemMessageAssistantContent(_Model): # pylint: disable=name-too-long + """RealtimeConversationItemMessageAssistantContent. + :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 + """ -class ResponseUsageInputTokensDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """ResponseUsageInputTokensDetails. + 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"]) - :ivar cached_tokens: Required. - :vartype cached_tokens: int - :ivar cache_write_tokens: Required. - :vartype cache_write_tokens: int + @overload + def __init__( + self, + *, + type: Optional[Literal["output_text", "output_audio"]] = None, + text: Optional[str] = None, + audio: Optional[str] = None, + transcript: 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 RealtimeConversationItemMessageSystemContent(_Model): # pylint: disable=name-too-long + """RealtimeConversationItemMessageSystemContent. + + :ivar type: Default value is "input_text". + :vartype type: str + :ivar text: + :vartype text: 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.""" + 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, *, - cached_tokens: int, - cache_write_tokens: int, + type: Optional[Literal["input_text"]] = None, + text: Optional[str] = None, ) -> None: ... @overload @@ -13274,21 +13512,48 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ResponseUsageOutputTokensDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """ResponseUsageOutputTokensDetails. +class RealtimeConversationItemMessageUserContent(_Model): # pylint: disable=name-too-long + """RealtimeConversationItemMessageUserContent. - :ivar reasoning_tokens: Required. - :vartype reasoning_tokens: int + :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 """ - reasoning_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """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, *, - reasoning_tokens: int, + 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 @@ -13302,57 +13567,40 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Routine(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A routine definition returned by the service. +class RealtimeFunctionTool(_Model): + """Function tool. - :ivar name: The routine name. + :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: A human-readable description of the routine. + :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 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 parameters: Parameters of the function in JSON Schema. + :vartype parameters: ~azure.ai.projects.models.RealtimeFunctionToolParameters """ + 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 routine name.""" + """The name of the function.""" 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( + """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"] ) - """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.""" + """Parameters of the function in JSON Schema.""" @overload def __init__( self, *, - enabled: bool, + type: Optional[Literal["function"]] = None, 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, + parameters: Optional["_models.RealtimeFunctionToolParameters"] = None, ) -> None: ... @overload @@ -13366,25 +13614,1162 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RoutineRun(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A single routine run returned from the run history API. +class RealtimeFunctionToolParameters(_Model): + """RealtimeFunctionToolParameters.""" - :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: + +class RealtimeMCPError(_Model): + """RealtimeMCPError. + + 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 + """ + + __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, + *, + 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 RealtimeMCPHTTPError(RealtimeMCPError, discriminator="http_error"): + """Realtime MCP HTTP error. + + :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 + """ + + 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, + *, + code: int, + 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] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeMcpErrorType.HTTP_ERROR # type: ignore + + +class RealtimeMCPProtocolError(RealtimeMCPError, discriminator="protocol_error"): + """Realtime MCP protocol error. + + :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 + """ + + 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, + *, + code: int, + 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] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeMcpErrorType.PROTOCOL_ERROR # type: ignore + + +class RealtimeMCPToolExecutionError(RealtimeMCPError, discriminator="tool_execution_error"): + """Realtime MCP tool execution error. + + :ivar type: Required. TOOL_EXECUTION_ERROR. + :vartype type: str or ~azure.ai.projects.models.TOOL_EXECUTION_ERROR + :ivar message: Required. + :vartype message: str + """ + + 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, + *, + 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] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RealtimeMcpErrorType.TOOL_EXECUTION_ERROR # type: ignore + + +class RealtimeReasoning(_Model): + """Realtime reasoning configuration. + + :ivar effort: Known values are: "minimal", "low", "medium", "high", and "xhigh". + :vartype effort: str or ~azure.ai.projects.models.RealtimeReasoningEffort + """ + + 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, + *, + effort: Optional[Union[str, "_models.RealtimeReasoningEffort"]] = 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 RealtimeResponseStatusDetails(_Model): + """RealtimeResponseStatusDetails. + + :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 + """ + + 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"] + ) + + @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, + ) -> 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 RealtimeResponseStatusDetailsError(_Model): + """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 RealtimeResponseUsage(_Model): + """RealtimeResponseUsage. + + :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 + """ + + 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"] + ) + + @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, + ) -> 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 RealtimeResponseUsageInputTokenDetails(_Model): + """RealtimeResponseUsageInputTokenDetails. + + :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 + """ + + 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"] + ) + + @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, + ) -> 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 RealtimeResponseUsageInputTokenDetailsCachedTokensDetails(_Model): # pylint: disable=name-too-long + """RealtimeResponseUsageInputTokenDetailsCachedTokensDetails. + + :ivar text_tokens: + :vartype text_tokens: int + :ivar image_tokens: + :vartype image_tokens: int + :ivar audio_tokens: + :vartype audio_tokens: int + """ + + 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, + *, + text_tokens: Optional[int] = None, + image_tokens: Optional[int] = None, + audio_tokens: 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 RealtimeResponseUsageOutputTokenDetails(_Model): + """RealtimeResponseUsageOutputTokenDetails. + + :ivar text_tokens: + :vartype text_tokens: int + :ivar audio_tokens: + :vartype audio_tokens: int + """ + + 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, + *, + text_tokens: Optional[int] = None, + audio_tokens: 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 RealtimeServerEvent(_Model): + """A realtime server event. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + RealtimeServerEventResponseContentPartAdded + + :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", and "response.mcp_call.failed". + :vartype type: str or ~azure.ai.projects.models.RealtimeServerEventType + """ + + __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\", and \"response.mcp_call.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 RealtimeServerEventConversationItemInputAudioTranscriptionFailedError(_Model): # pylint: disable=name-too-long + """RealtimeServerEventConversationItemInputAudioTranscriptionFailedError. + + :ivar type: + :vartype type: str + :ivar code: + :vartype code: str + :ivar message: + :vartype message: str + :ivar param: + :vartype param: str + """ + + 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, + *, + type: Optional[str] = None, + code: Optional[str] = None, + message: Optional[str] = None, + 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) + + +class RealtimeServerEventError(_Model): + """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 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 + """ + + 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"] + ) + """Details of the error. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + error: "_models.RealtimeServerEventErrorError", + ) -> 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["error"] = "error" + + +class RealtimeServerEventErrorError(_Model): + """RealtimeServerEventErrorError. + + :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 + """ + + 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, + *, + type: str, + message: str, + code: Optional[str] = None, + param: Optional[str] = None, + 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 RealtimeServerEventRateLimitsUpdatedRateLimits(_Model): # pylint: disable=name-too-long + """RealtimeServerEventRateLimitsUpdatedRateLimits. + + :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 + """ + + 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 + 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 RealtimeServerEventResponseContentPartAdded( + RealtimeServerEvent, discriminator="response.content_part.added" +): # pylint: disable=name-too-long + """Returned when a new content part is added to an assistant message item 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.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 + """ + + 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.""" + + @overload + def __init__( + self, + *, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + part: "_models.RealtimeServerEventResponseContentPartAddedPart", + ) -> 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_CONTENT_PART_ADDED # type: ignore + + +class RealtimeServerEventResponseContentPartAddedPart(_Model): # pylint: disable=name-too-long + """RealtimeServerEventResponseContentPartAddedPart. + + :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 + """ + + 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, + *, + type: Optional[Literal["audio", "text"]] = None, + text: Optional[str] = None, + audio: Optional[str] = None, + transcript: 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 Reasoning(_Model): + """Reasoning. + + :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 + """ + + 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, + *, + 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 + 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 RecurrenceTrigger(Trigger, discriminator="Recurrence"): + """Recurrence based trigger. + + :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 + """ + + 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, + *, + interval: int, + schedule: "_models.RecurrenceSchedule", + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_zone: 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 = TriggerType.RECURRENCE # type: ignore + + +class RedTeam(_Model): + """Red team details. + + :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 + """ + + 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 ReminderPreviewToolboxTool(ToolboxTool, discriminator="reminder_preview"): + """A reminder 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. REMINDER_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.REMINDER_PREVIEW + """ + + type: Literal[ToolboxToolType.REMINDER_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. REMINDER_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.REMINDER_PREVIEW # type: ignore + + +class ResponsesProtocolConfiguration(_Model): + """Configuration specific to the responses protocol.""" + + +class ResponseUsageInputTokensDetails(_Model): + """ResponseUsageInputTokensDetails. + + :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 ResponseUsageOutputTokensDetails(_Model): + """ResponseUsageOutputTokensDetails. + + :ivar reasoning_tokens: Required. + :vartype reasoning_tokens: int + """ + + reasoning_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + reasoning_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 Routine(_Model): + """A routine definition returned by the service. + + :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 + """ + + 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.""" + + @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, + ) -> 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 RoutineRun(_Model): + """A single routine run returned from the run history API. + + :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: @@ -13392,136 +14777,6063 @@ class RoutineRun(_Model): # pylint: disable=docstring-keyword-should-match-keyw :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. + :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 + """ + + 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, + *, + 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 + 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 RubricBasedEvaluatorDefinition(EvaluatorDefinition, discriminator="rubric"): + """Rubric-based evaluator definition — stores dimensions produced by the generate API. Used for + both quality and safety evaluators. + + :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 + """ + + 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, + *, + 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 + 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 = EvaluatorDefinitionType.RUBRIC # type: ignore + + +class RubricGenerationInputQualityWarning(_Model): + """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 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.inputs.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 + """ + + 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( + 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.inputs.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, + *, + code: Union[str, "_models.RubricGenerationInputQualityWarningCode"], + severity: Union[str, "_models.RubricGenerationInputQualityWarningSeverity"], + message: str, + source: Union[str, "_models.RubricGenerationInputQualityWarningSource"], + source_index: 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 SASCredentials(BaseCredentials, discriminator="SAS"): + """Shared Access Signature (SAS) credential definition. + + :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 + """ + + 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, + ) -> 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 = CredentialType.SAS # type: ignore + + +class Schedule(_Model): + """Schedule model. + + :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] + """ + + 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.""" + + @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"): + """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): + """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 SessionConfiguration(_Model): + """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. Optional — when unset, the server default of 900 seconds is used. Must be between + 300 and 3600 seconds (inclusive). + :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. Optional — when unset, + the server default of 900 seconds is used. Must be between 300 and 3600 seconds (inclusive).""" + + @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): + """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): + """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): + """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): + """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"): + """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 SimpleQnADataGenerationJobOptions(DataGenerationJobOptions, discriminator="simple_qna"): + """The options for a data generation job with SimpleQnA type. + + :ivar max_samples: Maximum number of samples to generate. Required. + :vartype max_samples: int + :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 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.""" + 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 SimulationSeedDataGenerationJobOptions(DataGenerationJobOptions, discriminator="simulation_seed"): + """The options for a simulation seed 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 max_samples: Maximum number of samples to generate. Required. + :vartype max_samples: int + :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, + *, + max_samples: int, + 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 SkillDetails(_Model): + """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): + """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 SkillReferenceParam(ContainerSkill, discriminator="skill_reference"): + """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): + """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): + """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 StructuredInputDefinition(_Model): + """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): + """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 TaxonomyCategory(_Model): + """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): + """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 TelemetryConfig(_Model): + """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 TemplateVoiceGreetingConfig(VoiceGreetingConfig, discriminator="template"): + """A deterministic greeting rendered with the voice agent's structured inputs and synthesized + without model-authored generation. + + :ivar type: Required. Default value is "template". + :vartype type: str + :ivar text: The Handlebars text template spoken at session start. Required. + :vartype text: str + """ + + type: Literal["template"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"template\".""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Handlebars text template spoken at session start. 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 = "template" # type: ignore + + +class TextResponseFormat(_Model): + """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"): + """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, + *, + name: str, + schema: dict[str, Any], + description: Optional[str] = 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 = TextResponseFormatConfigurationType.JSON_SCHEMA # type: ignore + + +class TextResponseFormatText(TextResponseFormat, discriminator="text"): + """Text. + + :ivar type: The type of response format being defined. Always ``text``. Required. TEXT. + :vartype type: str or ~azure.ai.projects.models.TEXT + """ + + 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"): + """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 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 ToolboxObject(_Model): + """A toolbox that stores reusable tool definitions for agents. + + :ivar id: The unique identifier of the toolbox. Required. + :vartype id: str + :ivar name: The name of the toolbox. Required. + :vartype name: str + :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 + """ + + 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.""" + 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, + *, + id: str, # pylint: disable=redefined-builtin + name: str, + default_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 ToolboxPolicies(_Model): + """Policy configuration for a toolbox, including content safety and other governance settings. + + :ivar rai_config: Responsible AI content filtering configuration. + :vartype rai_config: ~azure.ai.projects.models.RaiConfig + """ + + rai_config: Optional["_models.RaiConfig"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Responsible AI content filtering configuration.""" + + @overload + def __init__( + self, + *, + rai_config: Optional["_models.RaiConfig"] = 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 ToolboxSearchPreviewToolboxTool(ToolboxTool, discriminator="toolbox_search_preview"): + """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_preview``. Required. + TOOLBOX_SEARCH_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.TOOLBOX_SEARCH_PREVIEW + """ + + 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, + *, + 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_PREVIEW # type: ignore + + +class ToolboxSkill(_Model): + """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 + + :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"]) + """The type of skill source. 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 ToolboxSkillReference(ToolboxSkill, discriminator="skill_reference"): + """A reference to an existing skill to include in a toolbox. + + :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["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 + 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 = "skill_reference" # type: ignore + + +class ToolboxVersionObject(_Model): + """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. + + 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 + """ + + 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.""" + + @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 + 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 ToolChoiceAllowed(ToolChoiceParam, discriminator="allowed_tools"): + """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 + + [ + { "type": "function", "name": "get_weather" }, + { "type": "mcp", "server_label": "deepwiki" }, + { "type": "image_generation" } + ] + :vartype tools: list[dict[str, any]] + """ + + 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, + *, + mode: Literal["auto", "required"], + tools: list[dict[str, Any]], + ) -> 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.ALLOWED_TOOLS # 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 `_. + + :ivar type: Required. CODE_INTERPRETER. + :vartype type: str or ~azure.ai.projects.models.CODE_INTERPRETER + """ + + type: Literal[ToolChoiceParamType.CODE_INTERPRETER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. CODE_INTERPRETER.""" + + @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.CODE_INTERPRETER # 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 `_. + + :ivar type: Required. COMPUTER. + :vartype type: str or ~azure.ai.projects.models.COMPUTER + """ + + type: Literal[ToolChoiceParamType.COMPUTER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """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 = 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 `_. + + :ivar type: Required. COMPUTER_USE. + :vartype type: str or ~azure.ai.projects.models.COMPUTER_USE + """ + + type: Literal[ToolChoiceParamType.COMPUTER_USE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. COMPUTER_USE.""" + + @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.COMPUTER_USE # 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 `_. + + :ivar type: Required. COMPUTER_USE_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.COMPUTER_USE_PREVIEW + """ + + 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, + ) -> 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.COMPUTER_USE_PREVIEW # type: ignore + + +class ToolChoiceCustom(ToolChoiceParam, discriminator="custom"): + """Custom tool. + + :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[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, + *, + 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 = ToolChoiceParamType.CUSTOM # 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 `_. + + :ivar type: Required. FILE_SEARCH. + :vartype type: str or ~azure.ai.projects.models.FILE_SEARCH + """ + + type: Literal[ToolChoiceParamType.FILE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. FILE_SEARCH.""" + + @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.FILE_SEARCH # type: ignore + + +class ToolChoiceFunction(ToolChoiceParam, discriminator="function"): + """Function tool. + + :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 + """ + + 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, + *, + 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 = ToolChoiceParamType.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 `_. + + :ivar type: Required. IMAGE_GENERATION. + :vartype type: str or ~azure.ai.projects.models.IMAGE_GENERATION + """ + + type: Literal[ToolChoiceParamType.IMAGE_GENERATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. IMAGE_GENERATION.""" + + @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.IMAGE_GENERATION # type: ignore + + +class ToolChoiceMCP(ToolChoiceParam, discriminator="mcp"): + """MCP 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: + :vartype name: str + """ + + 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, + *, + 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): + """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): + """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): + """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"): + """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"): + """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 + 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.TOOL_SEARCH # type: ignore + + +class ToolUseFineTuningDataGenerationJobOptions( + DataGenerationJobOptions, discriminator="tool_use" +): # pylint: disable=name-too-long + """The options for a data generation job with ToolUse type. Used only for fine-tuning scenarios. + + :ivar max_samples: Maximum number of samples to generate. Required. + :vartype max_samples: int + :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 + """ + + 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.""" + + @overload + def __init__( + self, + *, + max_samples: int, + 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.TOOL_USE # type: ignore + + +class TracesDataGenerationJobOptions(DataGenerationJobOptions, discriminator="traces"): + """The options for a data generation job with Traces type. + + :ivar max_samples: Maximum number of samples to generate. Required. + :vartype max_samples: int + :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 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[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.""" + 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, + *, + max_samples: int, + train_split: Optional[float] = None, + model_options: Optional["_models.DataGenerationModelOptions"] = None, + redact_private_content: 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 = DataGenerationJobType.TRACES # type: ignore + + +class TracesDataGenerationJobSource(DataGenerationJobSource, discriminator="traces"): + """Traces source for data generation jobs — conversation traces from Application Insights. + + :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 + """ + + 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.""" + + @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, + ) -> 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 = DataGenerationJobSourceType.TRACES # type: ignore + + +class TracesEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator="traces"): + """Traces source for evaluator generation jobs — conversation traces from Application Insights. + + :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 + """ + + 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" + ) + """End of the time window (Unix timestamp in seconds). Defaults to current time.""" + + @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, + ) -> 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.TRACES # type: ignore + + +class TranscriptTextUsageDuration(CreateTranscriptionResponseJsonUsage, discriminator="duration"): + """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[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, + *, + seconds: datetime.timedelta, + ) -> 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 = CreateTranscriptionResponseJsonUsageType.DURATION # type: ignore + + +class TranscriptTextUsageTokens(CreateTranscriptionResponseJsonUsage, discriminator="tokens"): + """Token Usage. + + :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[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, + *, + input_tokens: int, + output_tokens: int, + total_tokens: int, + input_token_details: Optional["_models.TranscriptTextUsageTokensInputTokenDetails"] = 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 = CreateTranscriptionResponseJsonUsageType.TOKENS # type: ignore + + +class TranscriptTextUsageTokensInputTokenDetails(_Model): # pylint: disable=name-too-long + """TranscriptTextUsageTokensInputTokenDetails. + + :ivar text_tokens: + :vartype text_tokens: int + :ivar audio_tokens: + :vartype audio_tokens: int + """ + + 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, + *, + text_tokens: Optional[int] = None, + audio_tokens: 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 UpdateModelVersionRequest(_Model): + """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, + *, + 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) + + +class UpdateToolboxRequest(_Model): + """UpdateToolboxRequest. + + :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 + """ + + 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, + *, + default_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 UserProfileMemoryItem(MemoryItem, discriminator="user_profile"): + """A memory item specifically containing user profile information extracted from conversations, + such as preferences, interests, and personal details. + + :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 + """ + + 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, + *, + memory_id: str, + updated_at: datetime.datetime, + scope: str, + content: 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 = MemoryItemKind.USER_PROFILE # type: ignore + + +class VersionIndicator(_Model): + """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 + + :ivar type: The type of version indicator. Required. "version_ref" + :vartype type: str or ~azure.ai.projects.models.VersionIndicatorType + """ + + __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, + *, + 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 VersionRefIndicator(VersionIndicator, discriminator="version_ref"): + """Version indicator that references a specific agent version by name. + + :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 + """ + + 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, + *, + agent_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) + self.type = VersionIndicatorType.VERSION_REF # type: ignore + + +class VersionSelector(_Model): + """VersionSelector. + + :ivar version_selection_rules: Required. + :vartype version_selection_rules: list[~azure.ai.projects.models.VersionSelectionRule] + """ + + version_selection_rules: list["_models.VersionSelectionRule"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required.""" + + @overload + def __init__( + self, + *, + version_selection_rules: list["_models.VersionSelectionRule"], + ) -> 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 VoiceAgentAnimationConfig(_Model): + """Animation settings for a voice-agent session. + + :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] + """ + + 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"] + ) + """The requested animation output kinds.""" + + @overload + def __init__( + self, + *, + model_name: Optional[str] = None, + outputs: Optional[list[Union[str, "_models.VoiceAgentAnimationOutputType"]]] = 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 VoiceAgentAvatarIceServer(_Model): + """An ICE server used for avatar WebRTC negotiation. + + :ivar urls: Required. + :vartype urls: list[str] + :ivar username: + :vartype username: str + :ivar credential: + :vartype credential: str + """ + + 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, + *, + urls: list[str], + username: Optional[str] = None, + credential: 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 VoiceAgentAvatarScene(_Model): + """Avatar placement and motion settings. + + :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 + """ + + 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, + *, + 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 + 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 VoiceAgentAvatarVideoBackground(_Model): + """The avatar video background. + + :ivar image_url: + :vartype image_url: str + :ivar color: + :vartype color: str + """ + + 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, + *, + image_url: Optional[str] = None, + color: 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 VoiceAgentAvatarVideoCrop(_Model): + """The rectangular crop applied to avatar video. + + :ivar bottom_right: Required. + :vartype bottom_right: list[int] + :ivar top_left: Required. + :vartype top_left: list[int] + """ + + 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, + *, + bottom_right: list[int], + top_left: 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 VoiceAgentAvatarVideoParams(_Model): + """Avatar video encoder and presentation settings. + + :ivar bitrate: + :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 + """ + + bitrate: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + crop: Optional["_models.VoiceAgentAvatarVideoCrop"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + 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, + *, + 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 + 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 VoiceAgentAvatarVideoResolution(_Model): + """The avatar video resolution. + + :ivar width: Required. + :vartype width: int + :ivar height: Required. + :vartype height: int + """ + + 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, + *, + width: int, + 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) + + +class VoiceAgentClientEventConversationItemCreate(_Model): # pylint: disable=name-too-long + """The ``conversation.item.create`` client event. + + :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: The conversation item to create. Required. + :vartype item: ~azure.ai.projects.models.VoiceConversationItem + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The conversation item to create. Required.""" + + @overload + def __init__( + self, + *, + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE], + item: "_models.VoiceConversationItem", + event_id: Optional[str] = None, + previous_item_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 VoiceAgentClientEventConversationItemDelete(_Model): # pylint: disable=name-too-long + """The ``conversation.item.delete`` client event. + + :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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE], + 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) + + +class VoiceAgentClientEventConversationItemRetrieve(_Model): # pylint: disable=name-too-long + """The ``conversation.item.retrieve`` client event. + + :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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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.""" + + @overload + def __init__( + self, + *, + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE], + 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) + + +class VoiceAgentClientEventConversationItemTruncate(_Model): # pylint: disable=name-too-long + """The ``conversation.item.truncate`` client event. + + :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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE], + item_id: str, + content_index: int, + audio_end_ms: int, + 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 VoiceAgentClientEventInputAudioBufferAppend(_Model): # pylint: disable=name-too-long + """The ``input_audio_buffer.append`` client event. + + :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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND], + 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) + + +class VoiceAgentClientEventInputAudioBufferClear(_Model): # pylint: disable=name-too-long + """The ``input_audio_buffer.clear`` client event. + + :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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The event type, must be ``input_audio_buffer.clear``. Required. INPUT_AUDIO_BUFFER_CLEAR.""" + + @overload + def __init__( + self, + *, + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR], + 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 VoiceAgentClientEventInputAudioBufferCommit(_Model): # pylint: disable=name-too-long + """The ``input_audio_buffer.commit`` client event. + + :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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The event type, must be ``input_audio_buffer.commit``. Required. INPUT_AUDIO_BUFFER_COMMIT.""" + + @overload + def __init__( + self, + *, + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT], + 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 VoiceAgentClientEventOutputAudioBufferClear(_Model): # pylint: disable=name-too-long + """The ``output_audio_buffer.clear`` client event. + + :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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The event type, must be ``output_audio_buffer.clear``. Required. OUTPUT_AUDIO_BUFFER_CLEAR.""" + + @overload + def __init__( + self, + *, + type: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR], + 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 VoiceAgentClientEventResponseCancel(_Model): + """The ``response.cancel`` client event. + + :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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + type: Literal[RealtimeClientEventType.RESPONSE_CANCEL], + event_id: Optional[str] = None, + 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) + + +class VoiceAgentClientEventResponseCreate(_Model): + """The ``response.create`` client event. + + :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: Parameters for the new response. + :vartype response: ~azure.ai.projects.models.VoiceAgentResponseCreateParams + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The event type, must be ``response.create``. Required. RESPONSE_CREATE.""" + response: Optional["_models.VoiceAgentResponseCreateParams"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Parameters for the new response.""" + + @overload + def __init__( + self, + *, + type: Literal[RealtimeClientEventType.RESPONSE_CREATE], + event_id: Optional[str] = None, + response: Optional["_models.VoiceAgentResponseCreateParams"] = 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 VoiceAgentClientEventSessionAvatarConnect(_Model): # pylint: disable=name-too-long + """The ``session.avatar.connect`` client event. + + :ivar type: The event type. Always ``session.avatar.connect``. Required. Default value is + "session.avatar.connect". + :vartype type: str + :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 + """ + + type: Literal["session.avatar.connect"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event type. Always ``session.avatar.connect``. Required. Default value is + \"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, + *, + client_sdp: 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: Literal["session.avatar.connect"] = "session.avatar.connect" + + +class VoiceAgentClientEventSessionUpdate(_Model): + """The ``session.update`` client event. + + :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 stable realtime session fields to update. Required. + :vartype session: ~azure.ai.projects.models.VoiceAgentSessionUpdateConfig + """ + + 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: "_models.VoiceAgentSessionUpdateConfig" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The stable realtime session fields to update. Required.""" + + @overload + def __init__( + self, + *, + type: Literal[RealtimeClientEventType.SESSION_UPDATE], + session: "_models.VoiceAgentSessionUpdateConfig", + 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 VoiceAgentDefinition(AgentDefinition, discriminator="voice"): + """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 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 agent is served. Together with ``model``, this + selects the model up front. ``managed`` uses a service-managed model; ``self_deployed`` uses + the customer's own Foundry deployment. This is independent of the architecture (realtime or + cascaded), which the service derives from the selected model. Required. 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, paired with ``model_type``: the service-managed + model name when ``model_type`` is ``managed``, or the customer's Foundry deployment name when + ``model_type`` is ``self_deployed``. The model must support realtime or cascaded voice. The + service derives the architecture from the selected model. Required. + :vartype model: str + :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.VoiceGreetingConfig + :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.VoiceAudioConfig + :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. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. + :vartype interim_response: ~azure.ai.projects.models.VoiceAgentStaticInterimResponseConfig or + ~azure.ai.projects.models.VoiceAgentLlmInterimResponseConfig + :ivar avatar: Optional avatar configuration. These values are session defaults and may be + overridden when connecting. + :vartype avatar: ~azure.ai.projects.models.VoiceAvatarConfig + :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 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 + """ + + 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: Union[str, "_models.VoiceModelType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """How the model backing this agent is served. Together with ``model``, this selects the model up + front. ``managed`` uses a service-managed model; ``self_deployed`` uses the customer's own + Foundry deployment. This is independent of the architecture (realtime or cascaded), which the + service derives from the selected model. Required. Known values are: \"managed\" and + \"self_deployed\".""" + model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The model to use for this agent, paired with ``model_type``: the service-managed model name + when ``model_type`` is ``managed``, or the customer's Foundry deployment name when + ``model_type`` is ``self_deployed``. The model must support realtime or cascaded voice. The + service derives the architecture from the selected model. Required.""" + 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.VoiceGreetingConfig"] = 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.VoiceAudioConfig"] = 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["_unions.VoiceAgentInterimResponse"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Interim-response settings for latency and tool execution. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type.""" + avatar: Optional["_models.VoiceAvatarConfig"] = 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( + visibility=["read", "create", "update", "delete", "query"] + ) + """Set of structured inputs that participate in prompt template substitution, rendered per session + before the live session starts.""" + 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.""" + + @overload + def __init__( + self, + *, + model_type: Union[str, "_models.VoiceModelType"], + model: str, + rai_config: Optional["_models.RaiConfig"] = None, + instructions: Optional[str] = None, + greeting: Optional["_models.VoiceGreetingConfig"] = None, + audio: Optional["_models.VoiceAudioConfig"] = 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["_unions.VoiceAgentInterimResponse"] = None, + avatar: Optional["_models.VoiceAvatarConfig"] = 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, + store: 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.kind = AgentKind.VOICE # type: ignore + + +class VoiceAgentEchoCancellation(_Model): + """Server-side echo cancellation settings for input audio. + + :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 + """ + + 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, + *, + reference_source: Optional[Union[str, "_models.VoiceAgentEchoCancellationReferenceSource"]] = None, + channels: 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: Literal["server_echo_cancellation"] = "server_echo_cancellation" + + +class VoiceAgentTool(_Model): + """A tool usable by a voice agent. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + VoiceAgentFunctionTool, VoiceAgentMcpTool, VoiceSystemTool, VoiceToolboxTool + + :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 tool kind. 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 VoiceAgentFunctionTool(VoiceAgentTool, discriminator="function"): + """A native function tool executed by the client. + + :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 + """ + + 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, + *, + name: str, + description: Optional[str] = None, + parameters: Optional["_models.RealtimeFunctionToolParameters"] = 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 = "function" # type: ignore + + +class VoiceAgentInterimResponseConfig(_Model): + """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 + + :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 + """ + + __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.""" + + @overload + def __init__( + self, + *, + type: str, + triggers: Optional[list[Union[str, "_models.VoiceAgentInterimResponseTrigger"]]] = None, + latency_threshold_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 VoiceAgentLlmInterimResponseConfig(VoiceAgentInterimResponseConfig, discriminator="llm_interim_response"): + """An interim response generated by a language model. + + :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 type: Required. Default value is "llm_interim_response". + :vartype type: str + :ivar model: The model used to generate interim responses. + :vartype model: str + :ivar instructions: Optional instructions for generating interim responses. + :vartype instructions: str + :ivar max_completion_tokens: The maximum completion-token count for an interim response. + :vartype max_completion_tokens: int + """ + + type: Literal["llm_interim_response"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"llm_interim_response\".""" + model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The model used to generate interim responses.""" + instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional instructions for generating interim responses.""" + max_completion_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The maximum completion-token count for an interim response.""" + + @overload + def __init__( + self, + *, + triggers: Optional[list[Union[str, "_models.VoiceAgentInterimResponseTrigger"]]] = None, + latency_threshold_ms: Optional[datetime.timedelta] = None, + model: Optional[str] = None, + instructions: Optional[str] = None, + max_completion_tokens: 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 = "llm_interim_response" # type: ignore + + +class VoiceAgentMcpTool(VoiceAgentTool, discriminator="mcp"): + """An MCP tool available to a voice agent. + + :ivar server_label: A label for this MCP server, used to identify it in tool calls. Required. + :vartype server_label: 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] + :ivar type: Required. Default value is "mcp". + :vartype type: str + :ivar server_url: The URL for the MCP server. + :vartype server_url: str + :ivar response_scheduling: When the MCP invocation creates a follow-up response. Defaults to + ``when_idle``. Known values are: "silent", "when_idle", "interrupt", and "skip_if_busy". + :vartype response_scheduling: str or ~azure.ai.projects.models.VoiceAgentToolResponseScheduling + """ + + 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.""" + 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.""" + type: Literal["mcp"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"mcp\".""" + server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The URL for the MCP server.""" + response_scheduling: Optional[Union[str, "_models.VoiceAgentToolResponseScheduling"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """When the MCP invocation creates a follow-up response. Defaults to ``when_idle``. Known values + are: \"silent\", \"when_idle\", \"interrupt\", and \"skip_if_busy\".""" + + @overload + def __init__( + self, + *, + server_label: str, + 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, + server_url: Optional[str] = None, + response_scheduling: Optional[Union[str, "_models.VoiceAgentToolResponseScheduling"]] = 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 = "mcp" # type: ignore + + +class VoiceAgentRealtimeResponse(OmitPropertiesRealtimeResponse1): + """A live realtime response returned by the voice-agent service in both ``response.created`` and + ``response.done`` events. + + :ivar id: The unique ID of the response, will look like ``resp_1234``. + :vartype id: str + :ivar object: The object type, must be ``realtime.response``. Default value is + "realtime.response". + :vartype object: str + :ivar status: The final status of the response (``completed``, ``cancelled``, ``failed``, or + ``incomplete``, ``in_progress``). Is one of the following types: Literal["completed"], + Literal["cancelled"], Literal["failed"], Literal["incomplete"], Literal["in_progress"] + :vartype status: str or str or str or str or str + :ivar status_details: Additional details about the status. + :vartype status_details: ~azure.ai.projects.models.RealtimeResponseStatusDetails + :ivar metadata: + :vartype metadata: ~azure.ai.projects.models.Metadata + :ivar usage: Usage statistics for the Response, this will correspond to billing. A Realtime API + session will maintain a conversation context and append new Items to the Conversation, thus + output from previous turns (text and audio tokens) will become the input for later turns. + :vartype usage: ~azure.ai.projects.models.RealtimeResponseUsage + :ivar conversation_id: Which conversation the response is added to, determined by the + ``conversation`` field in the ``response.create`` event. If ``auto``, the response will be + added to the default conversation and the value of ``conversation_id`` will be an id like + ``conv_1234``. If ``none``, the response will not be added to any conversation and the value of + ``conversation_id`` will be ``null``. If responses are being triggered automatically by VAD the + response will be added to the default conversation. :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. + :ivar output_modalities: The set of modalities the model used to respond, currently the only + possible values are ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text + transcript. Setting the output to mode ``text`` will disable audio output from the model. + :vartype output_modalities: list[str or str] + :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, + inclusive of tool calls, that was used in this response. Is either a int type or a + Literal["inf"] type. + :vartype max_output_tokens: int or str + :ivar audio: The audio configuration used by the live response, including flat voice provider, + locale, and format fields under ``output``. + :vartype audio: ~azure.ai.projects.models.VoiceResponseAudio + :ivar output: The items produced by the live response. + :vartype output: list[~azure.ai.projects.models.VoiceConversationItem] + """ + + audio: Optional["_models.VoiceResponseAudio"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The audio configuration used by the live response, including flat voice provider, locale, and + format fields under ``output``.""" + output: Optional[list["_models.VoiceConversationItem"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The items produced by the live response.""" + + @overload + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + object: Optional[Literal["realtime.response"]] = None, + status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] = None, + status_details: Optional["_models.RealtimeResponseStatusDetails"] = None, + metadata: Optional["_models.Metadata"] = None, + usage: Optional["_models.RealtimeResponseUsage"] = None, + conversation_id: Optional[str] = None, + output_modalities: Optional[list[Literal["text", "audio"]]] = None, + max_output_tokens: Optional[Union[int, Literal["inf"]]] = None, + audio: Optional["_models.VoiceResponseAudio"] = None, + output: Optional[list["_models.VoiceConversationItem"]] = 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 VoiceAgentResponseCreateParams(_Model): + """Parameters accepted by a voice-agent ``response.create`` event. + + :ivar instructions: The default system instructions (i.e. system message) prepended to model + calls. This field allows the client to guide the model on desired responses. The model can be + instructed on response content and format, (e.g. "be extremely succinct", "act friendly", "here + are examples of good responses") and on audio behavior (e.g. "talk quickly", "inject emotion + into your voice", "laugh frequently"). The instructions are not guaranteed to be followed by + the model, but they provide guidance to the model on the desired behavior. Note that the server + sets default instructions which will be used if this field is not set and are visible in the + ``session.created`` event at the start of the session. + :vartype instructions: str + :ivar tools: Tools available to the model. + :vartype tools: list[~azure.ai.projects.models.RealtimeFunctionTool or + ~azure.ai.projects.models.MCPTool] + :ivar tool_choice: How the model chooses tools. Provide one of the string modes or force a + specific function/MCP tool. Is one of the following types: Union[str, + "_models.ToolChoiceOptions"], ToolChoiceFunction, ToolChoiceMCP + :vartype tool_choice: str or ~azure.ai.projects.models.ToolChoiceOptions 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. Only + supported by reasoning Realtime models such as ``gpt-realtime-2``. + :vartype parallel_tool_calls: bool + :ivar reasoning: + :vartype reasoning: ~azure.ai.projects.models.RealtimeReasoning + :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, + inclusive of tool calls. Provide an integer between 1 and 4096 to limit output tokens, or + ``inf`` for the maximum available tokens for a given model. Defaults to ``inf``. Is either a + int type or a Literal["inf"] type. + :vartype max_output_tokens: int or str + :ivar conversation: Controls which conversation the response is added to. Currently supports + ``auto`` and ``none``, with ``auto`` as the default value. The ``auto`` value means that the + contents of the response will be added to the default conversation. Set this to ``none`` to + create an out-of-band response which will not add items to default conversation. Is one of the + following types: Literal["auto"], Literal["none"], str + :vartype conversation: str or str or str + :ivar metadata: + :vartype metadata: ~azure.ai.projects.models.Metadata + :ivar output_modalities: Modalities that the response may return. + :vartype output_modalities: list[str or ~azure.ai.projects.models.VoiceOutputModality] + :ivar audio: Response-specific audio settings. + :vartype audio: ~azure.ai.projects.models.PickPropertiesVoiceAudioConfig + :ivar input: Conversation items used as inline response input. + :vartype input: list[~azure.ai.projects.models.VoiceConversationItem] + :ivar pre_generated_assistant_message: A pre-generated assistant message used to begin the + response. + :vartype pre_generated_assistant_message: ~azure.ai.projects.models.VoiceAssistantMessageItem + :ivar interim_response: Interim-response settings for this response. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. + :vartype interim_response: ~azure.ai.projects.models.VoiceAgentStaticInterimResponseConfig or + ~azure.ai.projects.models.VoiceAgentLlmInterimResponseConfig + """ + + instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The default system instructions (i.e. system message) prepended to model calls. This field + allows the client to guide the model on desired responses. The model can be instructed on + response content and format, (e.g. \"be extremely succinct\", \"act friendly\", \"here are + examples of good responses\") and on audio behavior (e.g. \"talk quickly\", \"inject emotion + into your voice\", \"laugh frequently\"). The instructions are not guaranteed to be followed by + the model, but they provide guidance to the model on the desired behavior. Note that the server + sets default instructions which will be used if this field is not set and are visible in the + ``session.created`` event at the start of the session.""" + tools: Optional[list[Union["_models.RealtimeFunctionTool", "_models.MCPTool"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Tools available to the model.""" + tool_choice: Optional[ + Union[str, "_models.ToolChoiceOptions", "_models.ToolChoiceFunction", "_models.ToolChoiceMCP"] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """How the model chooses tools. Provide one of the string modes or force a specific function/MCP + tool. Is one of the following types: Union[str, \"_models.ToolChoiceOptions\"], + ToolChoiceFunction, ToolChoiceMCP""" + parallel_tool_calls: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the model may call multiple tools in parallel. Only supported by reasoning Realtime + models such as ``gpt-realtime-2``.""" + reasoning: Optional["_models.RealtimeReasoning"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + max_output_tokens: Optional[Union[int, Literal["inf"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Maximum number of output tokens for a single assistant response, inclusive of tool calls. + Provide an integer between 1 and 4096 to limit output tokens, or ``inf`` for the maximum + available tokens for a given model. Defaults to ``inf``. Is either a int type or a + Literal[\"inf\"] type.""" + conversation: Optional[Union[Literal["auto"], Literal["none"], str]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Controls which conversation the response is added to. Currently supports ``auto`` and ``none``, + with ``auto`` as the default value. The ``auto`` value means that the contents of the response + will be added to the default conversation. Set this to ``none`` to create an out-of-band + response which will not add items to default conversation. Is one of the following types: + Literal[\"auto\"], Literal[\"none\"], str""" + metadata: Optional["_models.Metadata"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Modalities that the response may return.""" + audio: Optional["_models.PickPropertiesVoiceAudioConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Response-specific audio settings.""" + input: Optional[list["_models.VoiceConversationItem"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Conversation items used as inline response input.""" + pre_generated_assistant_message: Optional["_models.VoiceAssistantMessageItem"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """A pre-generated assistant message used to begin the response.""" + interim_response: Optional["_unions.VoiceAgentInterimResponse"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Interim-response settings for this response. Is either a VoiceAgentStaticInterimResponseConfig + type or a VoiceAgentLlmInterimResponseConfig type.""" + + @overload + def __init__( + self, + *, + instructions: Optional[str] = None, + tools: Optional[list[Union["_models.RealtimeFunctionTool", "_models.MCPTool"]]] = None, + tool_choice: Optional[ + Union[str, "_models.ToolChoiceOptions", "_models.ToolChoiceFunction", "_models.ToolChoiceMCP"] + ] = None, + parallel_tool_calls: Optional[bool] = None, + reasoning: Optional["_models.RealtimeReasoning"] = None, + max_output_tokens: Optional[Union[int, Literal["inf"]]] = None, + conversation: Optional[Union[Literal["auto"], Literal["none"], str]] = None, + metadata: Optional["_models.Metadata"] = None, + output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = None, + audio: Optional["_models.PickPropertiesVoiceAudioConfig"] = None, + input: Optional[list["_models.VoiceConversationItem"]] = None, + pre_generated_assistant_message: Optional["_models.VoiceAssistantMessageItem"] = None, + interim_response: Optional["_unions.VoiceAgentInterimResponse"] = 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 VoiceAgentResponseEventContentPart(_Model): + """A content part carried by a ``response.content_part.*`` server event. + + :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.VoiceAudioFormat + """ + + 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.VoiceAudioFormat"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The audio format, when this is an audio content part.""" + + @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.VoiceAudioFormat"] = 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 VoiceTurnDetection(_Model): + """Turn-detection configuration for a voice agent. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + VoiceAzureSemanticVadTurnDetection, VoiceAzureSemanticVadEnTurnDetection, + VoiceAzureSemanticVadMultilingualTurnDetection, VoiceAgentSemanticVadTurnDetection, + VoiceServerVadTurnDetection + + :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.VoiceTurnDetectionType + :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech + stops. + :vartype auto_truncate: bool + """ + + __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, + *, + type: str, + auto_truncate: 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 VoiceAgentSemanticVadTurnDetection(VoiceTurnDetection, discriminator="semantic_vad"): + """OpenAI semantic VAD turn-detection settings. + + :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech + stops. + :vartype auto_truncate: bool + :ivar eagerness: Is one of the following types: Literal["low"], Literal["medium"], + Literal["high"], Literal["auto"] + :vartype eagerness: str or str or str or str + :ivar create_response: + :vartype create_response: bool + :ivar interrupt_response: + :vartype interrupt_response: bool + :ivar type: Required. Semantic voice activity detection. + :vartype type: str or ~azure.ai.projects.models.SEMANTIC_VAD + """ + + eagerness: Optional[Literal["low", "medium", "high", "auto"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is one of the following types: Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"], + Literal[\"auto\"]""" + create_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + interrupt_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Semantic voice activity detection.""" + + @overload + def __init__( + self, + *, + auto_truncate: Optional[bool] = None, + eagerness: Optional[Literal["low", "medium", "high", "auto"]] = 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 = VoiceTurnDetectionType.SEMANTIC_VAD # type: ignore + + +class VoiceAgentServerEventConversationItemAdded(_Model): # pylint: disable=name-too-long + """The ``conversation.item.added`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :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: + :vartype previous_item_id: str + :ivar item: The item added to the conversation. Required. + :vartype item: ~azure.ai.projects.models.VoiceConversationItem + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The item added to the conversation. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED], + item: "_models.VoiceConversationItem", + previous_item_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 VoiceAgentServerEventConversationItemCreated(_Model): # pylint: disable=name-too-long + """The ``conversation.item.created`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :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: The created conversation item. Required. + :vartype item: ~azure.ai.projects.models.VoiceConversationItem + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The created conversation item. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED], + item: "_models.VoiceConversationItem", + previous_item_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 VoiceAgentServerEventConversationItemDeleted(_Model): # pylint: disable=name-too-long + """The ``conversation.item.deleted`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :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. + :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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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 item that was deleted. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED], + item_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 VoiceAgentServerEventConversationItemDone(_Model): # pylint: disable=name-too-long + """The ``conversation.item.done`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :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: The completed conversation item. Required. + :vartype item: ~azure.ai.projects.models.VoiceConversationItem + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The completed conversation item. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE], + item: "_models.VoiceConversationItem", + previous_item_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 VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted(_Model): # pylint: disable=name-too-long + """The ``conversation.item.input_audio_transcription.completed`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :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 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.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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.""" + 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, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED], + item_id: str, + content_index: int, + transcript: str, + usage: Union["_models.TranscriptTextUsageTokens", "_models.TranscriptTextUsageDuration"], + logprobs: Optional[list["_models.LogProbProperties"]] = None, + phrases: Optional[list["_models.VoiceAgentTranscriptionPhrase"]] = 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 VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta(_Model): # pylint: disable=name-too-long + """The ``conversation.item.input_audio_transcription.delta`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :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] + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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"] + ) + + @overload + def __init__( + self, + *, + event_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA], + item_id: str, + content_index: Optional[int] = None, + delta: Optional[str] = None, + logprobs: Optional[list["_models.LogProbProperties"]] = 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 VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed(_Model): # pylint: disable=name-too-long + """The ``conversation.item.input_audio_transcription.failed`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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.""" + + @overload + def __init__( + self, + *, + event_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED], + item_id: str, + content_index: int, + error: "_models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError", + ) -> 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 VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment(_Model): # pylint: disable=name-too-long + """The ``conversation.item.input_audio_transcription.segment`` server event. + + :ivar event_id: The unique ID of the server event. Required. + :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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT], + item_id: str, + content_index: int, + text: str, + id: str, # pylint: disable=redefined-builtin + speaker: str, + start: float, + end: 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 VoiceAgentServerEventConversationItemRetrieved(_Model): # pylint: disable=name-too-long + """The ``conversation.item.retrieved`` server event. + + :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: The retrieved conversation item. Required. + :vartype item: ~azure.ai.projects.models.VoiceConversationItem + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The event type, must be ``conversation.item.retrieved``. Required. CONVERSATION_ITEM_RETRIEVED.""" + item: "_models.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The retrieved conversation item. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED], + item: "_models.VoiceConversationItem", + ) -> 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 VoiceAgentServerEventConversationItemTruncated(_Model): # pylint: disable=name-too-long + """The ``conversation.item.truncated`` server event. + + :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.VoiceAssistantMessageItem + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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.VoiceAssistantMessageItem"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The assistant message after truncation, when the service returns the updated item.""" + + @overload + def __init__( + self, + *, + event_id: str, + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED], + item_id: str, + content_index: int, + audio_end_ms: int, + item: Optional["_models.VoiceAssistantMessageItem"] = 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 VoiceAgentServerEventInputAudioBufferCleared(_Model): # pylint: disable=name-too-long + """The ``input_audio_buffer.cleared`` server event. + + :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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The event type, must be ``input_audio_buffer.cleared``. Required. INPUT_AUDIO_BUFFER_CLEARED.""" + + @overload + def __init__( + self, + *, + event_id: str, + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED], + ) -> 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 VoiceAgentServerEventInputAudioBufferCommitted(_Model): # pylint: disable=name-too-long + """The ``input_audio_buffer.committed`` server event. + + :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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + event_id: str, + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED], + item_id: str, + previous_item_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 VoiceAgentServerEventInputAudioBufferSpeechStarted(_Model): # pylint: disable=name-too-long + """The ``input_audio_buffer.speech_started`` server event. + + :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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + event_id: str, + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED], + audio_start_ms: int, + item_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 VoiceAgentServerEventInputAudioBufferSpeechStopped(_Model): # pylint: disable=name-too-long + """The ``input_audio_buffer.speech_stopped`` server event. + + :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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + event_id: str, + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED], + audio_end_ms: int, + item_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 VoiceAgentServerEventInputAudioBufferTimeoutTriggered(_Model): # pylint: disable=name-too-long + """The ``input_audio_buffer.timeout_triggered`` server event. + + :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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + event_id: str, + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED], + audio_start_ms: int, + audio_end_ms: int, + item_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 VoiceAgentServerEventMcpListToolsCompleted(_Model): # pylint: disable=name-too-long + """The ``mcp_list_tools.completed`` server event. + + :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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + event_id: str, + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED], + item_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 VoiceAgentServerEventMcpListToolsFailed(_Model): + """The ``mcp_list_tools.failed`` server event. + + :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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + event_id: str, + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED], + item_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 VoiceAgentServerEventMcpListToolsInProgress(_Model): # pylint: disable=name-too-long + """The ``mcp_list_tools.in_progress`` server event. + + :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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + event_id: str, + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS], + item_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 VoiceAgentServerEventOutputAudioBufferCleared(_Model): # pylint: disable=name-too-long + """The ``output_audio_buffer.cleared`` server event. + + :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 - :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 """ - id: str = rest_field(visibility=["read"]) - """The unique run identifier for the routine attempt. Required.""" - status: Optional["_unions.RoutineRunStatus"] = rest_field( + 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_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( + """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, + *, + event_id: str, + type: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED], + response_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 VoiceAgentServerEventRateLimitsUpdated(_Model): + """The ``rate_limits.updated`` server event. + + :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] + """ + + 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_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( + """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"] ) - """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( + """List of rate limit information. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + type: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED], + rate_limits: list["_models.RealtimeServerEventRateLimitsUpdatedRateLimits"], + ) -> 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 VoiceAgentServerEventResponseAnimationBlendshapesDelta(_Model): # pylint: disable=name-too-long + """The ``response.animation_blendshapes.delta`` server event. + + :ivar type: Required. Default value is "response.animation_blendshapes.delta". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int + :ivar frames: Animation frames as numeric blendshape weights. Required. + :vartype frames: list[list[float]] + :ivar frame_index: The index of the first frame in this delta. Required. + :vartype frame_index: int + """ + + type: Literal["response.animation_blendshapes.delta"] = 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( + """Required. Default value is \"response.animation_blendshapes.delta\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + frames: list[list[float]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Animation frames as numeric blendshape weights. Required.""" + frame_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the first frame in this delta. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + frames: list[list[float]], + frame_index: 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: Literal["response.animation_blendshapes.delta"] = "response.animation_blendshapes.delta" + + +class VoiceAgentServerEventResponseAnimationBlendshapesDone(_Model): # pylint: disable=name-too-long + """The ``response.animation_blendshapes.done`` server event. + + :ivar type: Required. Default value is "response.animation_blendshapes.done". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + """ + + type: Literal["response.animation_blendshapes.done"] = 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( + """Required. Default value is \"response.animation_blendshapes.done\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = 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, + ) -> 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["response.animation_blendshapes.done"] = "response.animation_blendshapes.done" + + +class VoiceAgentServerEventResponseAnimationVisemeDelta(_Model): # pylint: disable=name-too-long + """The ``response.animation_viseme.delta`` server event. + + :ivar type: Required. Default value is "response.animation_viseme.delta". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int + :ivar audio_offset_ms: Required. + :vartype audio_offset_ms: ~datetime.timedelta + :ivar viseme_id: Required. + :vartype viseme_id: int + """ + + type: Literal["response.animation_viseme.delta"] = 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" + """Required. Default value is \"response.animation_viseme.delta\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + audio_offset_ms: datetime.timedelta = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" ) - """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" + """Required.""" + viseme_id: int = 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, + audio_offset_ms: datetime.timedelta, + viseme_id: 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: Literal["response.animation_viseme.delta"] = "response.animation_viseme.delta" + + +class VoiceAgentServerEventResponseAnimationVisemeDone(_Model): # pylint: disable=name-too-long + """The ``response.animation_viseme.done`` server event. + + :ivar type: Required. Default value is "response.animation_viseme.done". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int + """ + + type: Literal["response.animation_viseme.done"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Default value is \"response.animation_viseme.done\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + content_index: int = 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, + ) -> 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["response.animation_viseme.done"] = "response.animation_viseme.done" + + +class VoiceAgentServerEventResponseAudioDelta(_Model): + """The ``response.output_audio.delta`` server event. + + :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: 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Base64-encoded audio data delta. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA], + response_id: str, + item_id: str, + output_index: int, + content_index: int, + delta: 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 VoiceAgentServerEventResponseAudioDone(_Model): + """The ``response.output_audio.done`` server event. + + :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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE], + response_id: str, + item_id: str, + output_index: int, + content_index: 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 VoiceAgentServerEventResponseAudioTimestampDelta(_Model): # pylint: disable=name-too-long + """The ``response.audio_timestamp.delta`` server event. + + :ivar type: Required. Default value is "response.audio_timestamp.delta". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int + :ivar audio_offset_ms: Required. + :vartype audio_offset_ms: ~datetime.timedelta + :ivar audio_duration_ms: Required. + :vartype audio_duration_ms: ~datetime.timedelta + :ivar text: Required. + :vartype text: str + :ivar timestamp_type: Required. Default value is "word". + :vartype timestamp_type: str + """ + + type: Literal["response.audio_timestamp.delta"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """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" + """Required. Default value is \"response.audio_timestamp.delta\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + audio_offset_ms: datetime.timedelta = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" ) - """The time when the underlying run started.""" - ended_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + """Required.""" + audio_duration_ms: datetime.timedelta = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" ) - """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.""" + """Required.""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + timestamp_type: Literal["word"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"word\".""" @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, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + audio_offset_ms: datetime.timedelta, + audio_duration_ms: datetime.timedelta, + text: str, ) -> None: ... @overload @@ -13533,63 +20845,51 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["response.audio_timestamp.delta"] = "response.audio_timestamp.delta" + self.timestamp_type: Literal["word"] = "word" -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 VoiceAgentServerEventResponseAudioTimestampDone(_Model): # pylint: disable=name-too-long + """The ``response.audio_timestamp.done`` server event. - :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 type: Required. Default value is "response.audio_timestamp.done". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int """ - 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.""" + type: Literal["response.audio_timestamp.done"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Default value is \"response.audio_timestamp.done\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """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, + item_id: str, + output_index: int, + content_index: int, ) -> None: ... @overload @@ -13601,66 +20901,58 @@ 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: Literal["response.audio_timestamp.done"] = "response.audio_timestamp.done" -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 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.inputs.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 - """ +class VoiceAgentServerEventResponseAudioTranscriptDelta(_Model): # pylint: disable=name-too-long + """The ``response.output_audio_transcript.delta`` server event. - 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( + :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 + """ + + 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_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.inputs.sources`` when the warning applies to a - specific source. Omitted for aggregate warnings and for warnings not tied to one source.""" + """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, *, - 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, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA], + response_id: str, + item_id: str, + output_index: int, + content_index: int, + delta: str, ) -> None: ... @overload @@ -13674,23 +20966,55 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SASCredentials(BaseCredentials, discriminator="SAS"): - """Shared Access Signature (SAS) credential definition. - - :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 - """ +class VoiceAgentServerEventResponseAudioTranscriptDone(_Model): # pylint: disable=name-too-long + """The ``response.output_audio_transcript.done`` server event. - 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.""" + :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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, + *, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE], + response_id: str, + item_id: str, + output_index: int, + content_index: int, + transcript: str, ) -> None: ... @overload @@ -13702,74 +21026,58 @@ 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. - :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] - """ +class VoiceAgentServerEventResponseContentPartDone(_Model): # pylint: disable=name-too-long + """The ``response.content_part.done`` server event. - 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"] + :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 finished streaming. Required. + :vartype part: ~azure.ai.projects.models.VoiceAgentResponseEventContentPart + """ + + 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_field( + 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"] + """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.VoiceAgentResponseEventContentPart" = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """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.""" + """The content part that finished streaming. 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, + type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE], + response_id: str, + item_id: str, + output_index: int, + content_index: int, + part: "_models.VoiceAgentResponseEventContentPart", ) -> None: ... @overload @@ -13783,34 +21091,35 @@ 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.""" +class VoiceAgentServerEventResponseCreated(_Model): + """The ``response.created`` server event. + + :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: The created voice-agent response. Required. + :vartype response: ~azure.ai.projects.models.VoiceAgentRealtimeResponse + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The event type, must be ``response.created``. Required. RESPONSE_CREATED.""" + response: "_models.VoiceAgentRealtimeResponse" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The created voice-agent response. Required.""" @overload def __init__( self, *, - cron_expression: str, - time_zone: str, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_CREATED], + response: "_models.VoiceAgentRealtimeResponse", ) -> None: ... @overload @@ -13822,47 +21131,37 @@ 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 -class ScheduleRun(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Schedule run model. +class VoiceAgentServerEventResponseDone(_Model): + """The ``response.done`` server event. - :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.done``. Required. RESPONSE_DONE. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_DONE + :ivar response: The completed voice-agent response. Required. + :vartype response: ~azure.ai.projects.models.VoiceAgentRealtimeResponse """ - 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" + 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_field( + visibility=["read", "create", "update", "delete", "query"] ) - """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.""" + """The event type, must be ``response.done``. Required. RESPONSE_DONE.""" + response: "_models.VoiceAgentRealtimeResponse" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The completed voice-agent response. Required.""" @overload def __init__( self, *, - schedule_id: str, - trigger_time: Optional[datetime.datetime] = None, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_DONE], + response: "_models.VoiceAgentRealtimeResponse", ) -> None: ... @overload @@ -13876,38 +21175,55 @@ 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 - """ +class VoiceAgentServerEventResponseFunctionCallArgumentsDelta(_Model): # pylint: disable=name-too-long + """The ``response.function_call_arguments.delta`` server event. - 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" + :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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The Unix timestamp (in seconds) when the file was last modified. Required.""" + """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, *, - name: str, - size: int, - is_directory: bool, - modified_time: datetime.datetime, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA], + response_id: str, + item_id: str, + output_index: int, + call_id: str, + delta: str, ) -> None: ... @overload @@ -13921,27 +21237,60 @@ 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. +class VoiceAgentServerEventResponseFunctionCallArgumentsDone(_Model): # pylint: disable=name-too-long + """The ``response.function_call_arguments.done`` server event. - :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 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 """ - 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.""" + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, *, - path: str, - bytes_written: int, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE], + response_id: str, + item_id: str, + output_index: int, + call_id: str, + name: str, + arguments: str, ) -> None: ... @overload @@ -13955,51 +21304,54 @@ 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 - """ +class VoiceAgentServerEventResponseMcpCallArgumentsDelta(_Model): # pylint: disable=name-too-long + """The ``response.mcp_call_arguments.delta`` server event. - event: Union[str, "_models.SessionLogEventType"] = rest_field( + :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_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 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, *, - event: Union[str, "_models.SessionLogEventType"], - data: str, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA], + response_id: str, + item_id: str, + output_index: int, + delta: str, + obfuscation: Optional[str] = None, ) -> None: ... @overload @@ -14013,25 +21365,50 @@ 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. +class VoiceAgentServerEventResponseMcpCallArgumentsDone(_Model): # pylint: disable=name-too-long + """The ``response.mcp_call_arguments.done`` server event. - :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 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 """ - project_connections: Optional[list["_models.ToolProjectConnection"]] = 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_MCP_CALL_ARGUMENTS_DONE] = 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 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, *, - project_connections: Optional[list["_models.ToolProjectConnection"]] = None, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE], + response_id: str, + item_id: str, + output_index: int, + arguments: str, ) -> None: ... @overload @@ -14045,32 +21422,39 @@ 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. +class VoiceAgentServerEventResponseMcpCallCompleted(_Model): # pylint: disable=name-too-long + """The ``response.mcp_call.completed`` server event. - :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.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 """ - 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_MCP_CALL_COMPLETED] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The sharepoint grounding tool parameters. Required.""" + """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, *, - sharepoint_grounding_preview: "_models.SharepointGroundingToolParameters", + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED], + output_index: int, + item_id: str, ) -> None: ... @overload @@ -14082,44 +21466,41 @@ 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 -class SimpleQnADataGenerationJobOptions( - DataGenerationJobOptions, discriminator="simple_qna" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """The options for a data generation job with SimpleQnA type. +class VoiceAgentServerEventResponseMcpCallFailed(_Model): # pylint: disable=name-too-long + """The ``response.mcp_call.failed`` server event. - :ivar max_samples: Maximum number of samples to generate. Required. - :vartype max_samples: int - :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 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.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 """ - 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.""" - question_types: Optional[list[Union[str, "_models.SimpleQnAFineTuningQuestionType"]]] = 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_MCP_CALL_FAILED] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The question types to generate. Used only for fine-tuning scenarios.""" + """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, *, - 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, + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED], + output_index: int, + item_id: str, ) -> None: ... @overload @@ -14131,39 +21512,42 @@ 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 -class SimulationSeedDataGenerationJobOptions( - DataGenerationJobOptions, discriminator="simulation_seed" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """The options 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``. +class VoiceAgentServerEventResponseMcpCallInProgress(_Model): # pylint: disable=name-too-long + """The ``response.mcp_call.in_progress`` server event. - :ivar max_samples: Maximum number of samples to generate. Required. - :vartype max_samples: int - :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.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[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_MCP_CALL_IN_PROGRESS] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, *, - max_samples: int, - train_split: Optional[float] = None, - model_options: Optional["_models.DataGenerationModelOptions"] = None, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS], + output_index: int, + item_id: str, ) -> None: ... @overload @@ -14175,52 +21559,46 @@ 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 -class SkillDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A skill resource. +class VoiceAgentServerEventResponseOutputItemAdded(_Model): # pylint: disable=name-too-long + """The ``response.output_item.added`` server event. - :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.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: The output item that was added. Required. + :vartype item: ~azure.ai.projects.models.VoiceConversationItem """ - 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" + 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_field( + visibility=["read", "create", "update", "delete", "query"] ) - """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.""" + """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.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The output item that was added. 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, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED], + response_id: str, + output_index: int, + item: "_models.VoiceConversationItem", ) -> None: ... @overload @@ -14234,50 +21612,44 @@ 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.""" +class VoiceAgentServerEventResponseOutputItemDone(_Model): # pylint: disable=name-too-long + """The ``response.output_item.done`` server event. + + :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: The output item that finished streaming. Required. + :vartype item: ~azure.ai.projects.models.VoiceConversationItem + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The output item that finished streaming. 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, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE], + response_id: str, + output_index: int, + item: "_models.VoiceConversationItem", ) -> None: ... @overload @@ -14291,32 +21663,54 @@ 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 - """ +class VoiceAgentServerEventResponseTextDelta(_Model): + """The ``response.output_text.delta`` server event. - 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.""" + :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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, *, - skill_id: str, - version: Optional[str] = None, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA], + response_id: str, + item_id: str, + output_index: int, + content_index: int, + delta: str, ) -> None: ... @overload @@ -14328,51 +21722,56 @@ 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 - -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 - """ +class VoiceAgentServerEventResponseTextDone(_Model): + """The ``response.output_text.done`` server event. - 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" + :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 + """ + + 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_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The Unix timestamp (seconds) when the skill version was created. Required.""" + """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, *, - id: str, # pylint: disable=redefined-builtin - skill_id: str, - name: str, - version: str, - description: str, - created_at: datetime.datetime, + event_id: str, + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE], + response_id: str, + item_id: str, + output_index: int, + content_index: int, + text: str, ) -> None: ... @overload @@ -14386,36 +21785,40 @@ 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 - """ +class VoiceAgentServerEventResponseVideoDelta(_Model): + """The ``response.video.delta`` server event. - __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\".""" + :ivar type: Required. Default value is "response.video.delta". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar codec: Required. + :vartype codec: str + :ivar delta: The base64-encoded video frame data. Required. + :vartype delta: str + """ + + type: Literal["response.video.delta"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"response.video.delta\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + codec: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The base64-encoded video frame data. Required.""" @overload def __init__( self, *, - type: str, + event_id: str, + output_index: int, + codec: str, + delta: str, ) -> None: ... @overload @@ -14427,21 +21830,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["response.video.delta"] = "response.video.delta" -class SpecificApplyPatchParam(ToolChoiceParam, discriminator="apply_patch"): - """Specific apply patch tool choice. +class VoiceAgentServerEventSessionAvatarConnecting(_Model): # pylint: disable=name-too-long + """The ``session.avatar.connecting`` server event. - :ivar type: The tool to call. Always ``apply_patch``. Required. APPLY_PATCH. - :vartype type: str or ~azure.ai.projects.models.APPLY_PATCH + :ivar type: Required. Default value is "session.avatar.connecting". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar server_sdp: The server's SDP answer for avatar media negotiation. Required. + :vartype server_sdp: 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.""" + type: Literal["session.avatar.connecting"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"session.avatar.connecting\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + server_sdp: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The server's SDP answer for avatar media negotiation. Required.""" @overload def __init__( self, + *, + event_id: str, + server_sdp: str, ) -> None: ... @overload @@ -14453,22 +21868,34 @@ 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: Literal["session.avatar.connecting"] = "session.avatar.connecting" -class SpecificFunctionShellParam(ToolChoiceParam, discriminator="shell"): - """Specific shell tool choice. +class VoiceAgentServerEventSessionAvatarSwitchToIdle(_Model): # pylint: disable=name-too-long + """The ``session.avatar.switch_to_idle`` server event. - :ivar type: The tool to call. Always ``shell``. Required. SHELL. - :vartype type: str or ~azure.ai.projects.models.SHELL + :ivar type: Required. Default value is "session.avatar.switch_to_idle". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar turn_id: + :vartype turn_id: 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.""" + type: Literal["session.avatar.switch_to_idle"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Default value is \"session.avatar.switch_to_idle\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + turn_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, + *, + event_id: str, + turn_id: Optional[str] = None, ) -> None: ... @overload @@ -14480,23 +21907,34 @@ 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: Literal["session.avatar.switch_to_idle"] = "session.avatar.switch_to_idle" -class SpecificProgrammaticToolCallingParam(ToolChoiceParam, discriminator="programmatic_tool_calling"): - """SpecificProgrammaticToolCallingParam. +class VoiceAgentServerEventSessionAvatarSwitchToSpeaking(_Model): # pylint: disable=name-too-long + """The ``session.avatar.switch_to_speaking`` server event. - :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 type: Required. Default value is "session.avatar.switch_to_speaking". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar turn_id: + :vartype turn_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.""" + type: Literal["session.avatar.switch_to_speaking"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Default value is \"session.avatar.switch_to_speaking\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + turn_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, + *, + event_id: str, + turn_id: Optional[str] = None, ) -> None: ... @overload @@ -14508,42 +21946,45 @@ 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: Literal["session.avatar.switch_to_speaking"] = "session.avatar.switch_to_speaking" -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 VoiceAgentServerEventSessionCreated(_Model): + """The ``session.created`` server event. - :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 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 conversation_id: The id of the persisted conversation. Only present when conversation + persistence is enabled for the session. + :vartype conversation_id: str + :ivar session: The initial effective voice-agent session configuration. Required. + :vartype session: ~azure.ai.projects.models.VoiceAgentSessionResponseConfig """ - 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.""" + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The event type, must be ``session.created``. Required. SESSION_CREATED.""" + conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The id of the persisted conversation. Only present when conversation persistence is enabled for + the session.""" + session: "_models.VoiceAgentSessionResponseConfig" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The initial effective voice-agent session configuration. Required.""" @overload def __init__( self, *, - description: Optional[str] = None, - default_value: Optional[Any] = None, - schema: Optional[dict[str, Any]] = None, - required: Optional[bool] = None, + event_id: str, + type: Literal[RealtimeServerEventType.SESSION_CREATED], + session: "_models.VoiceAgentSessionResponseConfig", + conversation_id: Optional[str] = None, ) -> None: ... @overload @@ -14557,38 +21998,35 @@ 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 VoiceAgentServerEventSessionUpdated(_Model): + """The ``session.updated`` server event. - :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 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 effective voice-agent session configuration after the update. Required. + :vartype session: ~azure.ai.projects.models.VoiceAgentSessionResponseConfig """ - 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.""" + 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_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The event type, must be ``session.updated``. Required. SESSION_UPDATED.""" + session: "_models.VoiceAgentSessionResponseConfig" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The effective voice-agent session configuration after the update. Required.""" @overload def __init__( self, *, - name: str, - description: str, - schema: dict[str, Any], - strict: bool, + event_id: str, + type: Literal[RealtimeServerEventType.SESSION_UPDATED], + session: "_models.VoiceAgentSessionResponseConfig", ) -> None: ... @overload @@ -14602,56 +22040,32 @@ 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 VoiceAgentServerEventWarning(_Model): + """The ``warning`` server event. - :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] + :ivar type: Required. Default value is "warning". + :vartype type: str + :ivar event_id: Required. + :vartype event_id: str + :ivar warning: Required. + :vartype warning: ~azure.ai.projects.models.VoiceAgentServerEventWarningDetails """ - 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"] + type: Literal["warning"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"warning\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + warning: "_models.VoiceAgentServerEventWarningDetails" = rest_field( + 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.""" + """Required.""" @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, + event_id: str, + warning: "_models.VoiceAgentServerEventWarningDetails", ) -> None: ... @overload @@ -14663,43 +22077,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["warning"] = "warning" -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] - """ +class VoiceAgentServerEventWarningDetails(_Model): + """Details of a non-fatal warning. - 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.""" + :ivar message: Required. + :vartype message: str + :ivar code: + :vartype code: str + :ivar param: + :vartype param: str + """ + + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + code: 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, *, - id: str, # pylint: disable=redefined-builtin - name: str, - enabled: bool, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, + message: str, + code: Optional[str] = None, + param: Optional[str] = None, ) -> None: ... @overload @@ -14713,23 +22116,70 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -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] - """ +class VoiceAvatarConfig(_Model): + """Avatar configuration for a voice agent. These values are session defaults and may be overridden + when connecting. - endpoints: list["_models.TelemetryEndpoint"] = rest_field( + :ivar type: The avatar type. Required. Known values are: "video_avatar" and "photo_avatar". + :vartype type: str or ~azure.ai.projects.models.VoiceAvatarType + :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", "websocket", and "websocket-binary". + :vartype output_protocol: str or ~azure.ai.projects.models.VoiceAvatarOutputProtocol + :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 + """ + + type: Union[str, "_models.VoiceAvatarType"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """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.VoiceAvatarOutputProtocol"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Customer-supplied telemetry export endpoint configurations. Required.""" + """The transport used to deliver the avatar video stream. Known values are: \"webrtc\", + \"websocket\", and \"websocket-binary\".""" + 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, *, - endpoints: list["_models.TelemetryEndpoint"], + type: Union[str, "_models.VoiceAvatarType"], + character: str, + style: Optional[str] = None, + customized: Optional[bool] = None, + output_protocol: Optional[Union[str, "_models.VoiceAvatarOutputProtocol"]] = None, + model: Optional[str] = None, + video: Optional["_models.VoiceAgentAvatarVideoParams"] = None, + scene: Optional["_models.VoiceAgentAvatarScene"] = None, + output_audit_audio: Optional[bool] = None, ) -> None: ... @overload @@ -14743,31 +22193,50 @@ 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 +class VoiceAgentSessionAvatarConfig(VoiceAvatarConfig): + """Avatar settings accepted by the stable voice-agent WebSocket contract. - :ivar type: Required. Known values are: "text", "json_schema", and "json_object". - :vartype type: str or ~azure.ai.projects.models.TextResponseFormatConfigurationType + :ivar type: The avatar type. Required. Known values are: "video_avatar" and "photo_avatar". + :vartype type: str or ~azure.ai.projects.models.VoiceAvatarType + :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", "websocket", and "websocket-binary". + :vartype output_protocol: str or ~azure.ai.projects.models.VoiceAvatarOutputProtocol + :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 ice_servers: + :vartype ice_servers: list[~azure.ai.projects.models.VoiceAgentAvatarIceServer] """ - __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\".""" + ice_servers: Optional[list["_models.VoiceAgentAvatarIceServer"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) @overload def __init__( self, *, - type: str, + type: Union[str, "_models.VoiceAvatarType"], + character: str, + style: Optional[str] = None, + customized: Optional[bool] = None, + output_protocol: Optional[Union[str, "_models.VoiceAvatarOutputProtocol"]] = None, + model: Optional[str] = None, + video: Optional["_models.VoiceAgentAvatarVideoParams"] = None, + scene: Optional["_models.VoiceAgentAvatarScene"] = None, + output_audit_audio: Optional[bool] = None, + ice_servers: Optional[list["_models.VoiceAgentAvatarIceServer"]] = None, ) -> None: ... @overload @@ -14781,20 +22250,145 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TextResponseFormatJsonObject(TextResponseFormat, discriminator="json_object"): - """JSON object. +class VoiceAgentSessionResponseConfig(_Model): + """The effective stable realtime session settings returned by the voice-agent service. - :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 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.VoiceAudioConfig + :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. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. + :vartype interim_response: ~azure.ai.projects.models.VoiceAgentStaticInterimResponseConfig or + ~azure.ai.projects.models.VoiceAgentLlmInterimResponseConfig + :ivar greeting: A proactive assistant greeting started after session configuration. + :vartype greeting: ~azure.ai.projects.models.VoiceGreetingConfig + :ivar object: The object type. Always ``realtime.session``. Required. Default value is + "realtime.session". + :vartype object: str + :ivar id: The session identifier. Required. + :vartype id: str + :ivar model: The selected model. Required. + :vartype model: str + :ivar expires_at: The session expiration time as a Unix timestamp in seconds. + :vartype expires_at: ~datetime.datetime """ - 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["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.VoiceAudioConfig"] = 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["_unions.VoiceAgentInterimResponse"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Interim-response settings for latency and tool execution. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type.""" + greeting: Optional["_models.VoiceGreetingConfig"] = rest_field( + 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.""" @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.VoiceAudioConfig"] = 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["_unions.VoiceAgentInterimResponse"] = None, + greeting: Optional["_models.VoiceGreetingConfig"] = None, + expires_at: Optional[datetime.datetime] = None, ) -> None: ... @overload @@ -14806,49 +22400,127 @@ 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: Literal["realtime"] = "realtime" + self.object: Literal["realtime.session"] = "realtime.session" -class TextResponseFormatJsonSchema( - TextResponseFormat, discriminator="json_schema" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """JSON schema. +class VoiceAgentSessionUpdateConfig(_Model): + """The stable realtime session settings accepted in a ``session.update`` client event. - :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 + :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.VoiceAudioConfig + :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. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. + :vartype interim_response: ~azure.ai.projects.models.VoiceAgentStaticInterimResponseConfig or + ~azure.ai.projects.models.VoiceAgentLlmInterimResponseConfig + :ivar greeting: A proactive assistant greeting started after session configuration. + :vartype greeting: ~azure.ai.projects.models.VoiceGreetingConfig """ - 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"]) + 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.VoiceAudioConfig"] = 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["_unions.VoiceAgentInterimResponse"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Interim-response settings for latency and tool execution. Is either a + VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type.""" + greeting: Optional["_models.VoiceGreetingConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """A proactive assistant greeting started after session configuration.""" @overload def __init__( self, *, - name: str, - schema: dict[str, Any], - description: Optional[str] = None, - strict: Optional[bool] = None, + 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.VoiceAudioConfig"] = 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["_unions.VoiceAgentInterimResponse"] = None, + greeting: Optional["_models.VoiceGreetingConfig"] = None, ) -> None: ... @overload @@ -14860,22 +22532,34 @@ 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 + self.type: Literal["realtime"] = "realtime" -class TextResponseFormatText(TextResponseFormat, discriminator="text"): - """Text. +class VoiceAgentStaticInterimResponseConfig(VoiceAgentInterimResponseConfig, discriminator="static_interim_response"): + """A static interim response selected from configured text. - :ivar type: The type of response format being defined. Always ``text``. Required. TEXT. - :vartype type: str or ~azure.ai.projects.models.TEXT + :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 type: Required. Default value is "static_interim_response". + :vartype type: str + :ivar texts: Candidate text values for the interim response. + :vartype texts: list[str] """ - 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.""" + type: Literal["static_interim_response"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"static_interim_response\".""" + texts: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Candidate text values for the interim response.""" @overload def __init__( self, + *, + triggers: Optional[list[Union[str, "_models.VoiceAgentInterimResponseTrigger"]]] = None, + latency_threshold_ms: Optional[datetime.timedelta] = None, + texts: Optional[list[str]] = None, ) -> None: ... @overload @@ -14887,32 +22571,56 @@ 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 + self.type = "static_interim_response" # 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 - """ +class VoiceAgentTranscriptionPhrase(_Model): + """A transcribed phrase with timing information. - 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" + :ivar offset_milliseconds: The phrase offset from the beginning of the audio, in milliseconds. + Required. + :vartype offset_milliseconds: ~datetime.timedelta + :ivar duration_milliseconds: The phrase duration in milliseconds. Required. + :vartype duration_milliseconds: ~datetime.timedelta + :ivar text: The transcribed phrase text. Required. + :vartype text: str + :ivar words: Word-level timing details, when available. + :vartype words: list[~azure.ai.projects.models.VoiceAgentTranscriptionWord] + :ivar locale: The detected locale. + :vartype locale: str + :ivar confidence: The transcription confidence score. + :vartype confidence: float + """ + + offset_milliseconds: datetime.timedelta = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """The phrase offset from the beginning of the audio, in milliseconds. Required.""" + duration_milliseconds: datetime.timedelta = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """The phrase duration in milliseconds. Required.""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The transcribed phrase text. Required.""" + words: Optional[list["_models.VoiceAgentTranscriptionWord"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The UTC date and time at which the timer fires.""" + """Word-level timing details, when available.""" + locale: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The detected locale.""" + confidence: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The transcription confidence score.""" @overload def __init__( self, *, - at: Optional[datetime.datetime] = None, + offset_milliseconds: datetime.timedelta, + duration_milliseconds: datetime.timedelta, + text: str, + words: Optional[list["_models.VoiceAgentTranscriptionWord"]] = None, + locale: Optional[str] = None, + confidence: Optional[float] = None, ) -> None: ... @overload @@ -14924,36 +22632,38 @@ 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 -class ToolboxObject(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A toolbox that stores reusable tool definitions for agents. +class VoiceAgentTranscriptionWord(_Model): + """A time-stamped word in an input-audio transcription. - :ivar id: The unique identifier of the toolbox. Required. - :vartype id: str - :ivar name: The name of the toolbox. Required. - :vartype name: str - :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 text: The transcribed word text. Required. + :vartype text: str + :ivar offset_milliseconds: The word offset from the beginning of the audio, in milliseconds. + Required. + :vartype offset_milliseconds: ~datetime.timedelta + :ivar duration_milliseconds: The word duration in milliseconds. Required. + :vartype duration_milliseconds: ~datetime.timedelta """ - 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.""" - 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.""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The transcribed word text. Required.""" + offset_milliseconds: datetime.timedelta = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """The word offset from the beginning of the audio, in milliseconds. Required.""" + duration_milliseconds: datetime.timedelta = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """The word duration in milliseconds. Required.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - name: str, - default_version: str, + text: str, + offset_milliseconds: datetime.timedelta, + duration_milliseconds: datetime.timedelta, ) -> None: ... @overload @@ -14967,21 +22677,38 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ToolboxPolicies(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Policy configuration for a toolbox, including content safety and other governance settings. +class VoiceConversationItem(_Model): + """A persisted item in a voice conversation. - :ivar rai_config: Responsible AI content filtering configuration. - :vartype rai_config: ~azure.ai.projects.models.RaiConfig + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + VoiceFunctionCallItem, VoiceFunctionCallOutputItem, VoiceMcpApprovalRequestItem, + VoiceMcpApprovalResponseItem, VoiceMcpCallItem, VoiceMcpListToolsItem, VoiceMessageItem + + :ivar type: The type of the conversation item. Required. Known values are: "message", + "function_call", "function_call_output", "mcp_list_tools", "mcp_call", "mcp_approval_request", + and "mcp_approval_response". + :vartype type: str or ~azure.ai.projects.models.VoiceConversationItemType + :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 """ - rai_config: Optional["_models.RaiConfig"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Responsible AI content filtering configuration.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The type of the conversation item. Required. Known values are: \"message\", \"function_call\", + \"function_call_output\", \"mcp_list_tools\", \"mcp_call\", \"mcp_approval_request\", and + \"mcp_approval_response\".""" + 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, *, - rai_config: Optional["_models.RaiConfig"] = None, + type: str, ) -> None: ... @overload @@ -14995,34 +22722,35 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ToolboxSearchPreviewToolboxTool( - ToolboxTool, discriminator="toolbox_search_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A toolbox search tool stored in a toolbox. +class VoiceMessageItem(VoiceConversationItem, discriminator="message"): + """A persisted message item in a voice conversation. - :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 + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + VoiceAssistantMessageItem, VoiceSystemMessageItem, VoiceUserMessageItem + + :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: Required. A message item. + :vartype type: str or ~azure.ai.projects.models.MESSAGE + :ivar role: The role of the message sender. Required. Known values are: "system", "user", and + "assistant". + :vartype role: str or ~azure.ai.projects.models.RealtimeConversationItemMessageType """ - 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.""" + __mapping__: dict[str, _Model] = {} + type: Literal[VoiceConversationItemType.MESSAGE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. A message item.""" + role: str = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) + """The role of the message sender. Required. Known values are: \"system\", \"user\", and + \"assistant\".""" @overload def __init__( self, *, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + role: str, ) -> None: ... @overload @@ -15034,28 +22762,61 @@ 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 = VoiceConversationItemType.MESSAGE # 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 VoiceAssistantMessageItem(VoiceMessageItem, discriminator="assistant"): + """An assistant message item. Only ``output_text`` and ``output_audio`` content are valid for + assistant messages. - :ivar type: The type of skill source. Required. Default value is None. - :vartype type: 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 type: Required. A message item. + :vartype type: str or ~azure.ai.projects.models.MESSAGE + :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 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 content: The content of the message. Required. + :vartype content: + list[~azure.ai.projects.models.RealtimeConversationItemMessageAssistantContent] + :ivar role: Required. ASSISTANT. + :vartype role: str or ~azure.ai.projects.models.ASSISTANT """ __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.""" + 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\"]""" + content: list["_models.RealtimeConversationItemMessageAssistantContent"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The content of the message. Required.""" + role: Literal[RealtimeConversationItemMessageType.ASSISTANT] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. ASSISTANT.""" @overload def __init__( self, *, - type: str, + 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 @@ -15067,36 +22828,34 @@ 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 -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 VoiceAudioConfig(_Model): + """The audio configuration for a voice agent. These values are session defaults and may be + overridden when connecting. - :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 input: Input (microphone) audio configuration. + :vartype input: ~azure.ai.projects.models.VoiceAudioInputConfig + :ivar output: Output (agent speech) audio configuration. + :vartype output: ~azure.ai.projects.models.VoiceAudioOutputConfig """ - 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.""" + input: Optional["_models.VoiceAudioInputConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Input (microphone) audio configuration.""" + output: Optional["_models.VoiceAudioOutputConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Output (agent speech) audio configuration.""" @overload def __init__( self, *, - name: str, - version: Optional[str] = None, + input: Optional["_models.VoiceAudioInputConfig"] = None, + output: Optional["_models.VoiceAudioOutputConfig"] = None, ) -> None: ... @overload @@ -15108,82 +22867,37 @@ 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 - -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 VoiceAudioFormat(_Model): + """An audio format. Follows the OpenAI Realtime session schema; ``type`` carries the media + subtype. - 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: The audio format type, e.g. 'audio/pcm' (16-bit PCM), 'audio/pcmu' (G.711 mu-law), + or 'audio/pcma' (G.711 A-law). Required. Known values are: "audio/pcm", "audio/pcmu", and + "audio/pcma". + :vartype type: str or ~azure.ai.projects.models.VoiceAudioFormatType + :ivar rate: The sample rate in Hz. Applies to 'audio/pcm' (e.g. 24000); omit for telephony + G.711 formats (8 kHz). + :vartype rate: int """ - 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( + type: Union[str, "_models.VoiceAudioFormatType"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Policy configuration for the toolbox version.""" + """The audio format type, e.g. 'audio/pcm' (16-bit PCM), 'audio/pcmu' (G.711 mu-law), or + 'audio/pcma' (G.711 A-law). Required. Known values are: \"audio/pcm\", \"audio/pcmu\", and + \"audio/pcma\".""" + rate: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sample rate in Hz. Applies to 'audio/pcm' (e.g. 24000); omit for telephony G.711 formats (8 + kHz).""" @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, + type: Union[str, "_models.VoiceAudioFormatType"], + rate: Optional[int] = None, ) -> None: ... @overload @@ -15197,56 +22911,64 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -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 VoiceAudioInputConfig(_Model): + """Input audio configuration for a voice agent. - [ - { "type": "function", "name": "get_weather" }, - { "type": "mcp", "server_label": "deepwiki" }, - { "type": "image_generation" } - ] - :vartype tools: list[dict[str, any]] + :ivar format: The input audio format. + :vartype format: ~azure.ai.projects.models.VoiceAudioFormat + :ivar noise_reduction: Input noise reduction. Set to null to disable. + :vartype noise_reduction: ~azure.ai.projects.models.VoiceNoiseReduction + :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. + Is one of the following types: VoiceServerVadTurnDetection, VoiceAgentSemanticVadTurnDetection, + VoiceAzureSemanticVadTurnDetection, VoiceAzureSemanticVadEnTurnDetection, + VoiceAzureSemanticVadMultilingualTurnDetection + :vartype turn_detection: ~azure.ai.projects.models.VoiceServerVadTurnDetection or + ~azure.ai.projects.models.VoiceAgentSemanticVadTurnDetection or + ~azure.ai.projects.models.VoiceAzureSemanticVadTurnDetection or + ~azure.ai.projects.models.VoiceAzureSemanticVadEnTurnDetection or + ~azure.ai.projects.models.VoiceAzureSemanticVadMultilingualTurnDetection + :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.VoiceInputTranscription """ - 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\" } - ]""" + format: Optional["_models.VoiceAudioFormat"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The input audio format.""" + noise_reduction: Optional["_models.VoiceNoiseReduction"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Input noise reduction. Set to null to disable.""" + turn_detection: Optional["_unions.VoiceAgentTurnDetection"] = 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. Is one of the + following types: VoiceServerVadTurnDetection, VoiceAgentSemanticVadTurnDetection, + VoiceAzureSemanticVadTurnDetection, VoiceAzureSemanticVadEnTurnDetection, + VoiceAzureSemanticVadMultilingualTurnDetection""" + echo_cancellation: Optional["_models.VoiceAgentEchoCancellation"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional server-side echo cancellation settings.""" + transcription: Optional["_models.VoiceInputTranscription"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Asynchronous input-audio transcription. Set to null to disable transcription.""" @overload def __init__( self, *, - mode: Literal["auto", "required"], - tools: list[dict[str, Any]], + format: Optional["_models.VoiceAudioFormat"] = None, + noise_reduction: Optional["_models.VoiceNoiseReduction"] = None, + turn_detection: Optional["_unions.VoiceAgentTurnDetection"] = None, + echo_cancellation: Optional["_models.VoiceAgentEchoCancellation"] = None, + transcription: Optional["_models.VoiceInputTranscription"] = None, ) -> None: ... @overload @@ -15258,23 +22980,142 @@ 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 -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 VoiceAudioOutputConfig(_Model): + """Output audio configuration for a voice agent. + Provider-specific fields are selected by ``voice_type``: - :ivar type: Required. CODE_INTERPRETER. - :vartype type: str or ~azure.ai.projects.models.CODE_INTERPRETER + * `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.VoiceAudioFormat + :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.VoiceAudioTimestampType] """ - type: Literal[ToolChoiceParamType.CODE_INTERPRETER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. CODE_INTERPRETER.""" + format: Optional["_models.VoiceAudioFormat"] = 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.VoiceAudioTimestampType"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Timestamp kinds to include with output audio. Applies to every ``voice_type``.""" @overload def __init__( self, + *, + format: Optional["_models.VoiceAudioFormat"] = 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.VoiceAudioTimestampType"]]] = None, ) -> None: ... @overload @@ -15286,23 +23127,83 @@ 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 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 type: Required. COMPUTER. - :vartype type: str or ~azure.ai.projects.models.COMPUTER - """ +class VoiceAzureSemanticVadEnTurnDetection(VoiceTurnDetection, discriminator="azure_semantic_vad_en"): + """English-optimized Azure semantic voice activity detection. - type: Literal[ToolChoiceParamType.COMPUTER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. COMPUTER.""" + :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.VoiceEndOfUtteranceDetection + :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[VoiceTurnDetectionType.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.VoiceEndOfUtteranceDetection"] = 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.VoiceEndOfUtteranceDetection"] = 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 @@ -15314,23 +23215,91 @@ 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 - + self.type = VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN # 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 `_. - :ivar type: Required. COMPUTER_USE. - :vartype type: str or ~azure.ai.projects.models.COMPUTER_USE - """ +class VoiceAzureSemanticVadMultilingualTurnDetection( + VoiceTurnDetection, discriminator="azure_semantic_vad_multilingual" +): # pylint: disable=name-too-long + """Multilingual Azure semantic voice activity detection. - type: Literal[ToolChoiceParamType.COMPUTER_USE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. COMPUTER_USE.""" + :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.VoiceEndOfUtteranceDetection + :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[VoiceTurnDetectionType.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.VoiceEndOfUtteranceDetection"] = 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.VoiceEndOfUtteranceDetection"] = 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 @@ -15342,23 +23311,89 @@ 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 = VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL # 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 `_. - :ivar type: Required. COMPUTER_USE_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.COMPUTER_USE_PREVIEW - """ +class VoiceAzureSemanticVadTurnDetection(VoiceTurnDetection, discriminator="azure_semantic_vad"): + """Azure semantic voice activity detection. - type: Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. COMPUTER_USE_PREVIEW.""" + :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.VoiceEndOfUtteranceDetection + :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[VoiceTurnDetectionType.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.VoiceEndOfUtteranceDetection"] = 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.VoiceEndOfUtteranceDetection"] = 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 @@ -15370,30 +23405,84 @@ 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 + self.type = VoiceTurnDetectionType.AZURE_SEMANTIC_VAD # type: ignore -class ToolChoiceCustom( - ToolChoiceParam, discriminator="custom" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Custom tool. +class VoiceConversation(_Model): + """A persisted voice conversation. The Foundry envelope that owns a voice agent's stored + transcript, responses, per-turn metrics, and audio. It is the parent, retention, and delete + boundary: deleting it cascades to its responses, items, metrics, and audio. When finalization + fails, any partial persisted responses, items, and item audio remain readable. - :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 + :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 usage: Final aggregate token usage across all responses in this conversation. Absent + while ``status`` is ``in_progress`` and populated after successful ``completed`` finalization; + it may be absent when ``status`` is ``failed``, and values are not guaranteed to be reported + incrementally. + :vartype usage: ~azure.ai.projects.models.RealtimeResponseUsage + :ivar last_error: The terminal error that prevented persistence finalization. Present only when + ``status`` is ``failed``. + :vartype last_error: ~azure.ai.projects.models.ApiError """ - 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.""" + 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.""" + usage: Optional["_models.RealtimeResponseUsage"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Final aggregate token usage across all responses in this conversation. Absent while ``status`` + is ``in_progress`` and populated after successful ``completed`` finalization; it may be absent + when ``status`` is ``failed``, and values are not guaranteed to be reported incrementally.""" + 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``.""" @overload def __init__( self, *, - name: str, + 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, + usage: Optional["_models.RealtimeResponseUsage"] = None, + last_error: Optional["_models.ApiError"] = None, ) -> None: ... @overload @@ -15405,23 +23494,45 @@ 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.object: Literal["voice.conversation"] = "voice.conversation" -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 VoiceEndOfUtteranceDetection(_Model): + """Semantic end-of-utterance detection configuration. - :ivar type: Required. FILE_SEARCH. - :vartype type: str or ~azure.ai.projects.models.FILE_SEARCH + :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.VoiceEndOfUtteranceDetectionModel + :ivar threshold_level: The sensitivity threshold. Known values are: "low", "medium", "high", + and "default". + :vartype threshold_level: str or ~azure.ai.projects.models.VoiceEndOfUtteranceThresholdLevel + :ivar timeout_ms: The detection timeout in milliseconds. + :vartype timeout_ms: ~datetime.timedelta """ - type: Literal[ToolChoiceParamType.FILE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. FILE_SEARCH.""" + model: Union[str, "_models.VoiceEndOfUtteranceDetectionModel"] = 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.VoiceEndOfUtteranceThresholdLevel"]] = 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, + *, + model: Union[str, "_models.VoiceEndOfUtteranceDetectionModel"], + threshold_level: Optional[Union[str, "_models.VoiceEndOfUtteranceThresholdLevel"]] = None, + timeout_ms: Optional[datetime.timedelta] = None, ) -> None: ... @overload @@ -15433,30 +23544,65 @@ 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 -class ToolChoiceFunction( - ToolChoiceParam, discriminator="function" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Function tool. +class VoiceFunctionCallItem(VoiceConversationItem, discriminator="function_call"): + """A function call request item. - :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. + :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 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 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 - """ - - 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.""" + :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 type: Required. A function-call request item. + :vartype type: str or ~azure.ai.projects.models.FUNCTION_CALL + """ + + 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\"]""" + 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 to call. Required.""" + """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.""" + type: Literal[VoiceConversationItemType.FUNCTION_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. A function-call request item.""" @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, ) -> None: ... @overload @@ -15468,23 +23614,68 @@ 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 = VoiceConversationItemType.FUNCTION_CALL # 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 VoiceFunctionCallOutputItem(VoiceConversationItem, discriminator="function_call_output"): + """A function call output item. - :ivar type: Required. IMAGE_GENERATION. - :vartype type: str or ~azure.ai.projects.models.IMAGE_GENERATION + :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 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 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 type: Required. A function-call output item. + :vartype type: str or ~azure.ai.projects.models.FUNCTION_CALL_OUTPUT + :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: Literal[ToolChoiceParamType.IMAGE_GENERATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. IMAGE_GENERATION.""" + 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\"]""" + 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.""" + type: Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. A function-call output item.""" + 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, + *, + 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 @@ -15496,34 +23687,78 @@ 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 = VoiceConversationItemType.FUNCTION_CALL_OUTPUT # type: ignore -class ToolChoiceMCP( - ToolChoiceParam, discriminator="mcp" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """MCP 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: - :vartype name: str - """ +class VoiceInputTranscription(_Model): + """Asynchronous input-audio transcription configuration. Extends the OpenAI Realtime transcription + options with the Azure and MAI transcription models, custom speech models, and phrase hints. - 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"]) + :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 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.VoiceInputTranscriptionModel + :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] + """ + + 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.""" + 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.VoiceInputTranscriptionModel"] = 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.""" @overload def __init__( self, *, - server_label: str, - name: Optional[str] = None, + model: Union[str, "_models.VoiceInputTranscriptionModel"], + language: Optional[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 @@ -15535,23 +23770,87 @@ 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 `_. +class VoiceItemAudioResponse(_Model): + """Metadata for a single conversation item's audio segment. For bring-your-own-storage (BYOS), the + response includes ``blob_uri``, a direct customer-storage URI without a SAS token, that the + customer accesses with their own credentials. For Foundry-managed storage, ``blob_uri`` is + absent and the bytes are streamed through the item's ``/audio/content`` route. - :ivar type: Required. WEB_SEARCH_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_PREVIEW + :ivar conversation_id: The id of the conversation the item belongs to. Required. + :vartype conversation_id: str + :ivar item_id: The id of the item this audio belongs to. Required. + :vartype item_id: str + :ivar role: The role the audio belongs to. Known values are: "user" and "agent". + :vartype role: str or ~azure.ai.projects.models.VoiceAudioRole + :ivar format: The container format of the audio. "wav" + :vartype format: str or ~azure.ai.projects.models.VoiceAudioContainerFormat + :ivar codec: The audio codec. Known values are: "pcm16", "pcmu", and "pcma". + :vartype codec: str or ~azure.ai.projects.models.VoiceAudioCodec + :ivar sample_rate: The sample rate in Hz. + :vartype sample_rate: int + :ivar channels: The number of audio channels. + :vartype channels: int + :ivar start_offset_ms: The offset from the session start at which this segment begins. + :vartype start_offset_ms: ~datetime.timedelta + :ivar duration_ms: The duration of the audio segment. + :vartype duration_ms: ~datetime.timedelta + :ivar blob_uri: For bring-your-own-storage (BYOS) recordings only: the URI of the recording in + the customer's own storage, without a SAS token. The customer downloads it using their own + storage credentials. Absent for Foundry-managed storage, where the bytes are streamed via the + item's ``/audio/content`` route instead. + :vartype blob_uri: str """ - type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. WEB_SEARCH_PREVIEW.""" + conversation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The id of the conversation the item belongs to. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The id of the item this audio belongs to. Required.""" + role: Optional[Union[str, "_models.VoiceAudioRole"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The role the audio belongs to. Known values are: \"user\" and \"agent\".""" + format: Optional[Union[str, "_models.VoiceAudioContainerFormat"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The container format of the audio. \"wav\"""" + codec: Optional[Union[str, "_models.VoiceAudioCodec"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The audio codec. Known values are: \"pcm16\", \"pcmu\", and \"pcma\".""" + sample_rate: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sample rate in Hz.""" + channels: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of audio channels.""" + start_offset_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """The offset from the session start at which this segment begins.""" + duration_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """The duration of the audio segment.""" + blob_uri: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """For bring-your-own-storage (BYOS) recordings only: the URI of the recording in the customer's + own storage, without a SAS token. The customer downloads it using their own storage + credentials. Absent for Foundry-managed storage, where the bytes are streamed via the item's + ``/audio/content`` route instead.""" @overload def __init__( self, + *, + conversation_id: str, + item_id: str, + role: Optional[Union[str, "_models.VoiceAudioRole"]] = None, + format: Optional[Union[str, "_models.VoiceAudioContainerFormat"]] = None, + codec: Optional[Union[str, "_models.VoiceAudioCodec"]] = None, + sample_rate: Optional[int] = None, + channels: Optional[int] = None, + start_offset_ms: Optional[datetime.timedelta] = None, + duration_ms: Optional[datetime.timedelta] = None, + blob_uri: Optional[str] = None, ) -> None: ... @overload @@ -15563,23 +23862,46 @@ 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 -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 VoiceMcpApprovalRequestItem(VoiceConversationItem, discriminator="mcp_approval_request"): + """An MCP approval request item. - :ivar type: Required. WEB_SEARCH_PREVIEW_2025_03_11. - :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_PREVIEW_2025_03_11 + :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 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 type: Required. An MCP approval request item. + :vartype type: str or ~azure.ai.projects.models.MCP_APPROVAL_REQUEST """ - 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.""" + 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.""" + type: Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. An MCP approval request item.""" @overload def __init__( self, + *, + id: str, # pylint: disable=redefined-builtin + server_label: str, + name: str, + arguments: str, ) -> None: ... @overload @@ -15591,35 +23913,46 @@ 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 = VoiceConversationItemType.MCP_APPROVAL_REQUEST # type: ignore -class ToolConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Per-tool configuration that controls tool visibility and search behavior. +class VoiceMcpApprovalResponseItem(VoiceConversationItem, discriminator="mcp_approval_response"): + """An MCP approval response item (client-created). - :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 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 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 type: Required. An MCP approval response item. + :vartype type: str or ~azure.ai.projects.models.MCP_APPROVAL_RESPONSE """ - 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.""" + 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"]) + type: Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. An MCP approval response item.""" @overload def __init__( self, *, - pin: Optional[bool] = None, - additional_search_text: Optional[str] = None, + id: str, # pylint: disable=redefined-builtin + approval_request_id: str, + approve: bool, + reason: Optional[str] = None, ) -> None: ... @overload @@ -15631,28 +23964,59 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = VoiceConversationItemType.MCP_APPROVAL_RESPONSE # 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 VoiceMcpCallItem(VoiceConversationItem, discriminator="mcp_call"): + """An MCP call item. - :ivar name: The name of the tool. + :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 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 description: A brief description of the tool's purpose. - :vartype description: 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 type: Required. An MCP call item. + :vartype type: str or ~azure.ai.projects.models.MCP_CALL """ - 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.""" + 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"]) + type: Literal[VoiceConversationItemType.MCP_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. An MCP call item.""" @overload def __init__( self, *, - name: Optional[str] = None, - description: Optional[str] = None, + 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 @@ -15664,24 +24028,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = VoiceConversationItemType.MCP_CALL # type: ignore -class ToolProjectConnection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A project connection resource. +class VoiceMcpListToolsItem(VoiceConversationItem, discriminator="mcp_list_tools"): + """An MCP list-tools item. - :ivar project_connection_id: A project connection in a ToolProjectConnectionList attached to - this tool. Required. - :vartype project_connection_id: 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 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 type: Required. An MCP list-tools item. + :vartype type: str or ~azure.ai.projects.models.MCP_LIST_TOOLS """ - project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A project connection in a ToolProjectConnectionList attached to this tool. Required.""" + 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.""" + type: Literal[VoiceConversationItemType.MCP_LIST_TOOLS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. An MCP list-tools item.""" @overload def __init__( self, *, - project_connection_id: str, + server_label: str, + tools: list["_models.MCPListToolsTool"], + id: Optional[str] = None, # pylint: disable=redefined-builtin ) -> None: ... @overload @@ -15693,35 +24075,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = VoiceConversationItemType.MCP_LIST_TOOLS # type: ignore -class ToolSearchToolboxTool( - ToolboxTool, discriminator="toolbox_search" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A toolbox search tool stored in a toolbox. +class VoiceNoiseReduction(_Model): + """Input audio noise reduction configuration. - :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 + :ivar type: The noise reduction mode. Required. Known values are: "near_field", "far_field", + and "azure_deep_noise_suppression". + :vartype type: str or ~azure.ai.projects.models.VoiceNoiseReductionType """ - 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: Union[str, "_models.VoiceNoiseReductionType"] = 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\".""" @overload def __init__( self, *, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + type: Union[str, "_models.VoiceNoiseReductionType"], ) -> None: ... @overload @@ -15733,44 +24108,94 @@ 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 -class ToolSearchToolParam( - Tool, discriminator="tool_search" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Tool search tool. +class VoiceRecordingChannelLayout(_Model): + """The role assigned to each channel of a merged stereo voice recording. - :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 left: The role carried on the left channel. Always ``user``. Required. Default value is + "user". + :vartype left: str + :ivar right: The role carried on the right channel. Always ``agent``. Required. Default value + is "agent". + :vartype right: str """ - 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( + left: Literal["user"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The role carried on the left channel. Always ``user``. Required. Default value is \"user\".""" + right: Literal["agent"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The role carried on the right channel. Always ``agent``. Required. Default value is \"agent\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.left: Literal["user"] = "user" + self.right: Literal["agent"] = "agent" + + +class VoiceRecordingResponse(_Model): + """Metadata for the merged, whole-call stereo recording of a voice conversation (user audio on the + left channel, agent audio on the right). Built once from the per-turn segments after the + session ends and durably cached. The common metadata (format, sample rate, channels, channel + layout, duration) is returned for both Foundry-managed and bring-your-own-storage (BYOS) + recordings. For BYOS the response also includes ``blob_uri``, the URI of the recording in the + customer's own storage (no SAS token), which the customer downloads using their own storage + credentials. For Foundry-managed storage ``blob_uri`` is absent and the bytes are streamed via + the ``/audio/content`` route instead. + + :ivar conversation_id: The id of the conversation this recording belongs to. Required. + :vartype conversation_id: str + :ivar format: The container format of the recording. Required. "wav" + :vartype format: str or ~azure.ai.projects.models.VoiceAudioContainerFormat + :ivar sample_rate: The sample rate of the recording in Hz, e.g. 24000. Required. + :vartype sample_rate: int + :ivar channels: The number of audio channels. The merged recording is stereo (``2``). Required. + :vartype channels: int + :ivar channel_layout: The role assigned to each stereo channel. Required. + :vartype channel_layout: ~azure.ai.projects.models.VoiceRecordingChannelLayout + :ivar duration_ms: The total duration of the recording. Required. + :vartype duration_ms: ~datetime.timedelta + :ivar blob_uri: For bring-your-own-storage (BYOS) recordings only: the URI of the recording in + the customer's own storage, without a SAS token. The customer downloads it using their own + storage credentials. Absent for Foundry-managed storage, where the bytes are streamed via the + ``/audio/content`` route instead. + :vartype blob_uri: str + """ + + conversation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The id of the conversation this recording belongs to. Required.""" + format: Union[str, "_models.VoiceAudioContainerFormat"] = 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( + """The container format of the recording. Required. \"wav\"""" + sample_rate: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sample rate of the recording in Hz, e.g. 24000. Required.""" + channels: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of audio channels. The merged recording is stereo (``2``). Required.""" + channel_layout: "_models.VoiceRecordingChannelLayout" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) + """The role assigned to each stereo channel. Required.""" + duration_ms: datetime.timedelta = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """The total duration of the recording. Required.""" + blob_uri: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """For bring-your-own-storage (BYOS) recordings only: the URI of the recording in the customer's + own storage, without a SAS token. The customer downloads it using their own storage + credentials. Absent for Foundry-managed storage, where the bytes are streamed via the + ``/audio/content`` route instead.""" @overload def __init__( self, *, - execution: Optional[Union[str, "_models.ToolSearchExecutionType"]] = None, - description: Optional[str] = None, - parameters: Optional["_models.EmptyModelParam"] = None, + conversation_id: str, + format: Union[str, "_models.VoiceAudioContainerFormat"], + sample_rate: int, + channels: int, + channel_layout: "_models.VoiceRecordingChannelLayout", + duration_ms: datetime.timedelta, + blob_uri: Optional[str] = None, ) -> None: ... @overload @@ -15782,37 +24207,105 @@ 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 -class ToolUseFineTuningDataGenerationJobOptions( - DataGenerationJobOptions, discriminator="tool_use" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The options for a data generation job with ToolUse type. Used only for fine-tuning scenarios. +class VoiceResponse(OmitPropertiesRealtimeResponse): + """A persisted voice response representing one model inference turn within a conversation. In list + results the ``output`` projection may be omitted; retrieve the full response (``GET + .../responses/{response_id}``) or the paged response-items route (``GET + .../responses/{response_id}/items``) for its output items. ``created_at``/``completed_at`` are + Foundry durable ordering extensions. - :ivar max_samples: Maximum number of samples to generate. Required. - :vartype max_samples: int - :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 object: The object type, must be ``realtime.response``. Default value is + "realtime.response". + :vartype object: str + :ivar status: The final status of the response (``completed``, ``cancelled``, ``failed``, or + ``incomplete``, ``in_progress``). Is one of the following types: Literal["completed"], + Literal["cancelled"], Literal["failed"], Literal["incomplete"], Literal["in_progress"] + :vartype status: str or str or str or str or str + :ivar status_details: Additional details about the status. + :vartype status_details: ~azure.ai.projects.models.RealtimeResponseStatusDetails + :ivar usage: Usage statistics for the Response, this will correspond to billing. A Realtime API + session will maintain a conversation context and append new Items to the Conversation, thus + output from previous turns (text and audio tokens) will become the input for later turns. + :vartype usage: ~azure.ai.projects.models.RealtimeResponseUsage + :ivar output_modalities: The set of modalities the model used to respond, currently the only + possible values are ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text + transcript. Setting the output to mode ``text`` will disable audio output from the model. + :vartype output_modalities: list[str or str] + :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, + inclusive of tool calls, that was used in this response. Is either a int type or a + Literal["inf"] type. + :vartype max_output_tokens: int or str + :ivar id: The unique id of the response. Required. + :vartype id: str + :ivar output: The output items produced by the response. May be omitted in list results; + retrieve the full response (GET .../responses/{response_id}) or use the paged response-items + route (GET .../responses/{response_id}/items) for its output items. Each item's ``response_id`` + also links it back to this response in the conversation-level items list. + :vartype output: list[~azure.ai.projects.models.VoiceConversationItem] + :ivar conversation_id: The id of the conversation this response belongs to. Required. + :vartype conversation_id: str + :ivar audio: The audio configuration used for the response, including the voice and audio + format used for output. + :vartype audio: ~azure.ai.projects.models.VoiceResponseAudio + :ivar metadata: A set of key-value pairs attached to the response. + :vartype metadata: dict[str, str] + :ivar temperature: The sampling temperature used for the response. + :vartype temperature: float + :ivar created_at: The Unix timestamp (in seconds) for when the response was created. + :vartype created_at: ~datetime.datetime + :ivar completed_at: The Unix timestamp (in seconds) for when the response completed. + :vartype completed_at: ~datetime.datetime """ - 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.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) # type: ignore[reportIncompatibleVariableOverride] + """The unique id of the response. Required.""" + output: Optional[list["_models.VoiceConversationItem"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The output items produced by the response. May be omitted in list results; retrieve the full + response (GET .../responses/{response_id}) or use the paged response-items route (GET + .../responses/{response_id}/items) for its output items. Each item's ``response_id`` also links + it back to this response in the conversation-level items list.""" + conversation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) # type: ignore[reportIncompatibleVariableOverride] + """The id of the conversation this response belongs to. Required.""" + audio: Optional["_models.VoiceResponseAudio"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The audio configuration used for the response, including the voice and audio format used for + output.""" + metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A set of key-value pairs attached to the response.""" + temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sampling temperature used for the response.""" + created_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the response was created.""" + completed_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the response completed.""" @overload def __init__( self, *, - max_samples: int, - train_split: Optional[float] = None, - model_options: Optional["_models.DataGenerationModelOptions"] = None, + id: str, # pylint: disable=redefined-builtin + conversation_id: str, + object: Optional[Literal["realtime.response"]] = None, + status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] = None, + status_details: Optional["_models.RealtimeResponseStatusDetails"] = None, + usage: Optional["_models.RealtimeResponseUsage"] = None, + output_modalities: Optional[list[Literal["text", "audio"]]] = None, + max_output_tokens: Optional[Union[int, Literal["inf"]]] = None, + output: Optional[list["_models.VoiceConversationItem"]] = None, + audio: Optional["_models.VoiceResponseAudio"] = None, + metadata: Optional[dict[str, str]] = None, + temperature: Optional[float] = None, + created_at: Optional[datetime.datetime] = None, + completed_at: Optional[datetime.datetime] = None, ) -> None: ... @overload @@ -15824,44 +24317,25 @@ 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 TracesDataGenerationJobOptions( - DataGenerationJobOptions, discriminator="traces" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """The options for a data generation job with Traces type. +class VoiceResponseAudio(_Model): + """Audio configuration for a response. Follows the OpenAI Realtime GA ``audio`` object shape. - :ivar max_samples: Maximum number of samples to generate. Required. - :vartype max_samples: int - :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 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 output: The audio output configuration used for the response. + :vartype output: ~azure.ai.projects.models.VoiceResponseAudioOutput """ - 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.""" - 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.""" + output: Optional["_models.VoiceResponseAudioOutput"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The audio output configuration used for the response.""" @overload def __init__( self, *, - max_samples: int, - train_split: Optional[float] = None, - model_options: Optional["_models.DataGenerationModelOptions"] = None, - redact_private_content: Optional[bool] = None, + output: Optional["_models.VoiceResponseAudioOutput"] = None, ) -> None: ... @overload @@ -15873,68 +24347,47 @@ 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 -class TracesDataGenerationJobSource( - DataGenerationJobSource, discriminator="traces" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Traces source for data generation jobs — conversation traces from Application Insights. +class VoiceResponseAudioOutput(_Model): + """The flat response audio-output projection, with optional ``voice``, ``voice_type``, + ``voice_locale``, and ``format`` fields. - :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 voice: The voice name used for the response's audio output. + :vartype voice: str + :ivar voice_type: The extensible provider/type of the voice used for the response's audio + output. 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 BCP-47 locale of the voice used for the response's audio output. + :vartype voice_locale: str + :ivar format: The audio format used for the response's audio output. + :vartype format: ~azure.ai.projects.models.RealtimeAudioFormats """ - 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" + voice: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The voice name used for the response's audio output.""" + voice_type: Optional[Union[str, "_models.VoiceType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """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" + """The extensible provider/type of the voice used for the response's audio output. 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 BCP-47 locale of the voice used for the response's audio output.""" + format: Optional["_models.RealtimeAudioFormats"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """End of the time window (Unix timestamp in seconds). Defaults to current time.""" + """The audio format used for the response's audio output.""" @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, + voice: Optional[str] = None, + voice_type: Optional[Union[str, "_models.VoiceType"]] = None, + voice_locale: Optional[str] = None, + format: Optional["_models.RealtimeAudioFormats"] = None, ) -> None: ... @overload @@ -15946,71 +24399,66 @@ 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 VoiceServerVadTurnDetection(VoiceTurnDetection, discriminator="server_vad"): + """Server-side voice activity detection. - :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 auto_truncate: Whether the input audio buffer is truncated automatically when speech + stops. + :vartype auto_truncate: bool + :ivar threshold: + :vartype threshold: float + :ivar prefix_padding_ms: + :vartype prefix_padding_ms: int + :ivar silence_duration_ms: + :vartype silence_duration_ms: int + :ivar create_response: + :vartype create_response: bool + :ivar interrupt_response: + :vartype interrupt_response: bool + :ivar idle_timeout_ms: + :vartype idle_timeout_ms: int + :ivar type: Required. Server-side voice activity detection. + :vartype type: str or ~azure.ai.projects.models.SERVER_VAD + :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in + milliseconds. + :vartype speech_duration_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.VoiceEndOfUtteranceDetection """ - 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" + threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + prefix_padding_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + silence_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + create_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + interrupt_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + idle_timeout_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[VoiceTurnDetectionType.SERVER_VAD] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Server-side voice activity detection.""" + 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.""" + end_of_utterance_detection: Optional["_models.VoiceEndOfUtteranceDetection"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """End of the time window (Unix timestamp in seconds). Defaults to current time.""" + """Semantic end-of-utterance detection configuration. Set to null to disable it.""" @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, + auto_truncate: Optional[bool] = None, + threshold: Optional[float] = None, + prefix_padding_ms: Optional[int] = None, + silence_duration_ms: Optional[int] = None, + create_response: Optional[bool] = None, + interrupt_response: Optional[bool] = None, + idle_timeout_ms: Optional[int] = None, + speech_duration_ms: Optional[datetime.timedelta] = None, + end_of_utterance_detection: Optional["_models.VoiceEndOfUtteranceDetection"] = None, ) -> None: ... @overload @@ -16022,29 +24470,59 @@ 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 + self.type = VoiceTurnDetectionType.SERVER_VAD # 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 VoiceSystemMessageItem(VoiceMessageItem, discriminator="system"): + """A system message item. Only ``input_text`` content is valid for system messages. - :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 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: Required. A message item. + :vartype type: str or ~azure.ai.projects.models.MESSAGE + :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 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 content: The content of the message. Required. + :vartype content: list[~azure.ai.projects.models.RealtimeConversationItemMessageSystemContent] + :ivar role: Required. SYSTEM. + :vartype role: str or ~azure.ai.projects.models.SYSTEM """ - 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.""" + __mapping__: dict[str, _Model] = {} + 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\"]""" + content: list["_models.RealtimeConversationItemMessageSystemContent"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The content of the message. Required.""" + role: Literal[RealtimeConversationItemMessageType.SYSTEM] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. SYSTEM.""" @overload def __init__( self, *, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, + 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 @@ -16056,25 +24534,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 -class UpdateToolboxRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """UpdateToolboxRequest. +class VoiceSystemTool(VoiceAgentTool, discriminator="system"): + """A service-managed control that acts on the active voice session without customer code or + external authentication. - :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: 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.VoiceSystemToolName + :ivar description: An optional description of the system tool. + :vartype description: 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["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: Union[str, "_models.VoiceSystemToolName"] = rest_field( + 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, *, - default_version: str, + name: Union[str, "_models.VoiceSystemToolName"], + description: Optional[str] = None, ) -> None: ... @overload @@ -16086,39 +24577,43 @@ 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 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 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 - """ +class VoiceToolboxTool(VoiceAgentTool, discriminator="toolbox"): + """A reference to a Foundry toolbox, which is a versioned bundle of tools executed through its MCP + endpoint. - 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.""" + :ivar type: The type of the tool. Always ``toolbox``. Required. Default value is "toolbox". + :vartype type: str + :ivar toolbox_name: The name of the toolbox to attach. Required. + :vartype toolbox_name: str + :ivar toolbox_version: The immutable version of the toolbox to attach. Required. + :vartype toolbox_version: str + :ivar response_scheduling: When the toolbox invocation creates a follow-up response. Defaults + to ``when_idle``. Known values are: "silent", "when_idle", "interrupt", and "skip_if_busy". + :vartype response_scheduling: str or ~azure.ai.projects.models.VoiceAgentToolResponseScheduling + """ + + type: Literal["toolbox"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the tool. Always ``toolbox``. Required. Default value is \"toolbox\".""" + toolbox_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the toolbox to attach. Required.""" + toolbox_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The immutable version of the toolbox to attach. Required.""" + response_scheduling: Optional[Union[str, "_models.VoiceAgentToolResponseScheduling"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """When the toolbox invocation creates a follow-up response. Defaults to ``when_idle``. Known + values are: \"silent\", \"when_idle\", \"interrupt\", and \"skip_if_busy\".""" @overload def __init__( self, *, - memory_id: str, - updated_at: datetime.datetime, - scope: str, - content: str, + toolbox_name: str, + toolbox_version: str, + response_scheduling: Optional[Union[str, "_models.VoiceAgentToolResponseScheduling"]] = None, ) -> None: ... @overload @@ -16130,28 +24625,60 @@ 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 + self.type = "toolbox" # 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 VoiceUserMessageItem(VoiceMessageItem, discriminator="user"): + """A user message item. ``input_text``, ``input_audio``, and ``input_image`` content are valid for + user messages. - :ivar type: The type of version indicator. Required. "version_ref" - :vartype type: str or ~azure.ai.projects.models.VersionIndicatorType + :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: Required. A message item. + :vartype type: str or ~azure.ai.projects.models.MESSAGE + :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 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 content: The content of the message. Required. + :vartype content: list[~azure.ai.projects.models.RealtimeConversationItemMessageUserContent] + :ivar role: Required. USER. + :vartype role: str or ~azure.ai.projects.models.USER """ __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of version indicator. Required. \"version_ref\"""" + 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\"]""" + content: list["_models.RealtimeConversationItemMessageUserContent"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The content of the message. Required.""" + role: Literal[RealtimeConversationItemMessageType.USER] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. USER.""" @overload def __init__( self, *, - type: str, + 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 @@ -16163,30 +24690,45 @@ 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 -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 WebIQPreviewTool(Tool, discriminator="web_iq_preview"): + """A WebIQ server-side tool. - :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 type: The object type, which is always 'web_iq_preview'. Required. WEB_IQ_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.WEB_IQ_PREVIEW + :ivar project_connection_id: The ID of the WebIQ project connection. Required. + :vartype project_connection_id: str + :ivar server_label: The label of the WebIQ MCP server to connect to. When omitted, the service + defaults to connection name extracted from project_connection_id. + :vartype server_label: str + :ivar require_approval: Whether the agent requires approval before executing actions. When + omitted, the service defaults to "always". Is either a MCPToolRequireApproval type or a str + type. + :vartype require_approval: ~azure.ai.projects.models.MCPToolRequireApproval or 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.""" + type: Literal[ToolType.WEB_IQ_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'web_iq_preview'. Required. WEB_IQ_PREVIEW.""" + project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the WebIQ project connection. Required.""" + server_label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The label of the WebIQ MCP server to connect to. When omitted, the service defaults to + connection name extracted from project_connection_id.""" + require_approval: Optional[Union["_models.MCPToolRequireApproval", str]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Whether the agent requires approval before executing actions. When omitted, the service + defaults to \"always\". Is either a MCPToolRequireApproval type or a str type.""" @overload def __init__( self, *, - agent_version: str, + project_connection_id: str, + server_label: Optional[str] = None, + require_approval: Optional[Union["_models.MCPToolRequireApproval", str]] = None, ) -> None: ... @overload @@ -16198,26 +24740,56 @@ 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 + self.type = ToolType.WEB_IQ_PREVIEW # type: ignore -class VersionSelector(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """VersionSelector. +class WebIQPreviewToolboxTool(ToolboxTool, discriminator="web_iq_preview"): + """A WebIQ tool stored in a toolbox. - :ivar version_selection_rules: Required. - :vartype version_selection_rules: list[~azure.ai.projects.models.VersionSelectionRule] + :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. WEB_IQ_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.WEB_IQ_PREVIEW + :ivar project_connection_id: The ID of the WebIQ project connection. Required. + :vartype project_connection_id: str + :ivar server_label: The label of the WebIQ MCP server to connect to. When omitted, the service + defaults to connection name extracted from project_connection_id. + :vartype server_label: str + :ivar require_approval: Whether the agent requires approval before executing actions. When + omitted, the service defaults to "always". Is either a MCPToolRequireApproval type or a str + type. + :vartype require_approval: ~azure.ai.projects.models.MCPToolRequireApproval or str """ - version_selection_rules: list["_models.VersionSelectionRule"] = rest_field( + type: Literal[ToolboxToolType.WEB_IQ_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. WEB_IQ_PREVIEW.""" + project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the WebIQ project connection. Required.""" + server_label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The label of the WebIQ MCP server to connect to. When omitted, the service defaults to + connection name extracted from project_connection_id.""" + require_approval: Optional[Union["_models.MCPToolRequireApproval", str]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Required.""" + """Whether the agent requires approval before executing actions. When omitted, the service + defaults to \"always\". Is either a MCPToolRequireApproval type or a str type.""" @overload def __init__( self, *, - version_selection_rules: list["_models.VersionSelectionRule"], + project_connection_id: str, + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + server_label: Optional[str] = None, + require_approval: Optional[Union["_models.MCPToolRequireApproval", str]] = None, ) -> None: ... @overload @@ -16229,9 +24801,10 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolboxToolType.WEB_IQ_PREVIEW # type: ignore -class WebSearchApproximateLocation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class WebSearchApproximateLocation(_Model): """Web search approximate location. :ivar type: The type of location approximation. Always ``approximate``. Required. Default value @@ -16277,7 +24850,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["approximate"] = "approximate" -class WebSearchConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class WebSearchConfiguration(_Model): """A web search configuration for bing custom search. :ivar project_connection_id: Project connection id for grounding with bing custom search. @@ -16311,9 +24884,7 @@ 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 +class WebSearchPreviewTool(Tool, discriminator="web_search_preview"): """Web search preview. :ivar type: The type of the web search tool. One of ``web_search_preview`` or @@ -16366,7 +24937,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.WEB_SEARCH_PREVIEW # type: ignore -class WebSearchTool(Tool, discriminator="web_search"): # pylint: disable=docstring-keyword-should-match-keyword-only +class WebSearchTool(Tool, discriminator="web_search"): """Web search. :ivar type: The type of the web search tool. One of ``web_search`` or @@ -16447,9 +25018,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.WEB_SEARCH # type: ignore -class WebSearchToolboxTool( - ToolboxTool, discriminator="web_search" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class WebSearchToolboxTool(ToolboxTool, discriminator="web_search"): """A web search tool stored in a toolbox. :ivar name: Optional user-defined name for this tool or configuration. @@ -16520,7 +25089,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolboxToolType.WEB_SEARCH # type: ignore -class WebSearchToolFilters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class WebSearchToolFilters(_Model): """WebSearchToolFilters. :ivar allowed_domains: @@ -16547,9 +25116,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class WeeklyRecurrenceSchedule( - RecurrenceSchedule, discriminator="Weekly" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class WeeklyRecurrenceSchedule(RecurrenceSchedule, discriminator="Weekly"): """Weekly recurrence schedule. :ivar type: Weekly recurrence type. Required. Weekly recurrence pattern. @@ -16584,9 +25151,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RecurrenceType.WEEKLY # type: ignore -class WorkflowAgentDefinition( - AgentDefinition, discriminator="workflow" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class WorkflowAgentDefinition(AgentDefinition, discriminator="workflow"): """The workflow agent definition. Microsoft Foundry is retiring workflows on December 1, 2026. If you're looking to build new workflows, use Microsoft Agent Framework. To migrate existing workflows, see the `Migration guide @@ -16625,9 +25190,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = AgentKind.WORKFLOW # type: ignore -class WorkIQPreviewTool( - Tool, discriminator="work_iq_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class WorkIQPreviewTool(Tool, discriminator="work_iq_preview"): """A WorkIQ server-side tool. :ivar type: The object type, which is always 'work_iq_preview'. Required. WORK_IQ_PREVIEW. @@ -16660,9 +25223,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.WORK_IQ_PREVIEW # type: ignore -class WorkIQPreviewToolboxTool( - ToolboxTool, discriminator="work_iq_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only +class WorkIQPreviewToolboxTool(ToolboxTool, discriminator="work_iq_preview"): """A WorkIQ tool stored in a toolbox. :ivar name: Optional user-defined name for this tool or configuration. 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 d6a01c5fe185..662f3c9bbc14 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 @@ -33,7 +33,7 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from .. import models as _models +from .. import models as _models, types as _types from .._configuration import AIProjectClientConfiguration from .._utils.model_base import Model as _Model, SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._utils.serialization import Deserializer, Serializer @@ -595,8 +595,7 @@ def build_agents_upload_session_file_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type: str = kwargs.pop("content_type") api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") @@ -614,10 +613,7 @@ def build_agents_upload_session_file_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) @@ -3208,7 +3204,6 @@ def build_beta_routines_list_request( limit: Optional[int] = None, after: Optional[str] = None, order: Optional[Union[str, _models.PageOrder]] = None, - order: Optional[Union[str, _models.PageOrder]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -3260,7 +3255,6 @@ def build_beta_routines_list_runs_request( limit: Optional[int] = None, after: Optional[str] = None, order: Optional[Union[str, _models.PageOrder]] = None, - order: Optional[Union[str, _models.PageOrder]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -4049,8 +4043,7 @@ def build_beta_agents_delete_optimization_job_request( # pylint: disable=name-t return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -class BetaOperations: # pylint: disable=docstring-missing-param,too-many-instance-attributes -class BetaOperations: # pylint: disable=docstring-missing-param,too-many-instance-attributes +class BetaOperations: # pylint: disable=too-many-instance-attributes """ .. warning:: **DO NOT** instantiate this class directly. @@ -4082,8 +4075,7 @@ def __init__(self, *args, **kwargs) -> None: self.agents = BetaAgentsOperations(self._client, self._config, self._serialize, self._deserialize) -class AgentsOperations: # pylint: disable=docstring-missing-param,too-many-public-methods -class AgentsOperations: # pylint: disable=docstring-missing-param,too-many-public-methods +class AgentsOperations: # pylint: disable=too-many-public-methods """ .. warning:: **DO NOT** instantiate this class directly. @@ -4466,7 +4458,12 @@ def create_version( @overload def create_version( - self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: _types.CreateAgentVersionRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentVersionDetails: """Create an agent version. @@ -4480,7 +4477,7 @@ def create_version( * Must not exceed 63 characters. Required. :type agent_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateAgentVersionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4518,7 +4515,7 @@ def create_version( def create_version( self, agent_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateAgentVersionRequest, IO[bytes]] = _Unset, *, definition: _models.AgentDefinition = _Unset, metadata: Optional[dict[str, str]] = None, @@ -4538,8 +4535,9 @@ def create_version( * Can contain hyphens in the middle * Must not exceed 63 characters. Required. :type agent_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateAgentVersionRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.projects.types.CreateAgentVersionRequest or IO[bytes] :keyword definition: The agent definition. This can be a prompt, workflow, hosted, external, or voice agent definition. Required. :paramtype definition: ~azure.ai.projects.models.AgentDefinition @@ -4686,7 +4684,12 @@ def create_version_from_manifest( @overload def create_version_from_manifest( - self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: _types.CreateAgentVersionFromManifestRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentVersionDetails: """Create an agent version from manifest. @@ -4700,7 +4703,7 @@ def create_version_from_manifest( * Must not exceed 63 characters. Required. :type agent_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateAgentVersionFromManifestRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4738,7 +4741,7 @@ def create_version_from_manifest( def create_version_from_manifest( self, agent_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateAgentVersionFromManifestRequest, IO[bytes]] = _Unset, *, manifest_id: str = _Unset, parameter_values: dict[str, Any] = _Unset, @@ -4757,8 +4760,9 @@ def create_version_from_manifest( * Can contain hyphens in the middle * Must not exceed 63 characters. Required. :type agent_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateAgentVersionFromManifestRequest, + IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.CreateAgentVersionFromManifestRequest or IO[bytes] :keyword manifest_id: The manifest ID to import the agent version from. Required. :paramtype manifest_id: str :keyword parameter_values: The inputs to the manifest that will result in a fully materialized @@ -5137,7 +5141,12 @@ def update_details( @overload def update_details( - self, agent_name: str, body: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any + self, + agent_name: str, + body: _types.PatchAgentObjectRequest, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any ) -> _models.AgentDetails: """Update an agent endpoint. @@ -5146,7 +5155,7 @@ def update_details( :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.PatchAgentObjectRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -5179,7 +5188,7 @@ def update_details( def update_details( self, agent_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.PatchAgentObjectRequest, IO[bytes]] = _Unset, *, agent_endpoint: Optional[_models.AgentEndpointConfig] = None, agent_card: Optional[_models.AgentCard] = None, @@ -5191,8 +5200,8 @@ def update_details( :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, PatchAgentObjectRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.PatchAgentObjectRequest or IO[bytes] :keyword agent_endpoint: The endpoint configuration for the agent. Default value is None. :paramtype agent_endpoint: ~azure.ai.projects.models.AgentEndpointConfig :keyword agent_card: Optional agent card for the agent. Default value is None. @@ -5280,14 +5289,19 @@ def _create_version_from_code( ) -> _models.AgentVersionDetails: ... @overload def _create_version_from_code( - self, agent_name: str, content: JSON, *, code_zip_sha256: str, **kwargs: Any + self, + agent_name: str, + content: _types._CreateAgentVersionFromCodeContent, + *, + code_zip_sha256: str, + **kwargs: Any ) -> _models.AgentVersionDetails: ... @distributed_trace def _create_version_from_code( self, agent_name: str, - content: Union[_models._models._CreateAgentVersionFromCodeContent, JSON], + content: Union[_models._models._CreateAgentVersionFromCodeContent, _types._CreateAgentVersionFromCodeContent], *, code_zip_sha256: str, **kwargs: Any @@ -5306,9 +5320,10 @@ def _create_version_from_code( * Can contain hyphens in the middle * Must not exceed 63 characters. Required. :type agent_name: str - :param content: The content multipart request content. Is either a - _CreateAgentVersionFromCodeContent type or a JSON type. Required. - :type content: ~azure.ai.projects.models._models._CreateAgentVersionFromCodeContent or JSON + :param content: The content multipart request content. Is one of the following types: + _CreateAgentVersionFromCodeContent Required. + :type content: ~azure.ai.projects.models._models._CreateAgentVersionFromCodeContent or + ~azure.ai.projects.types._CreateAgentVersionFromCodeContent :keyword code_zip_sha256: SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity verification. Required. :paramtype code_zip_sha256: str @@ -5603,7 +5618,12 @@ def create_session( @overload def create_session( - self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: _types.CreateSessionRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentSessionResource: """Create a session. @@ -5614,7 +5634,7 @@ def create_session( :param agent_name: The name of the agent to create a session for. Required. :type agent_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateSessionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5649,7 +5669,7 @@ def create_session( def create_session( self, agent_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateSessionRequest, IO[bytes]] = _Unset, *, version_indicator: _models.VersionIndicator = _Unset, agent_session_id: Optional[str] = None, @@ -5663,8 +5683,8 @@ def create_session( :param agent_name: The name of the agent to create a session for. Required. :type agent_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateSessionRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.CreateSessionRequest or IO[bytes] :keyword version_indicator: Determines which agent version backs the session. Required. :paramtype version_indicator: ~azure.ai.projects.models.VersionIndicator :keyword agent_session_id: Optional caller-provided session ID. If specified, it must be unique @@ -6133,117 +6153,9 @@ def get_session_log_stream( return deserialized # type: ignore - @overload - @overload - def upload_session_file( - self, - agent_name: str, - session_id: str, - content: bytes, - *, - path: str, - content_type: str = "application/octet-stream", - **kwargs: Any - self, - agent_name: str, - session_id: str, - content: bytes, - *, - path: str, - content_type: str = "application/octet-stream", - **kwargs: Any - ) -> _models.SessionFileWriteResult: - """Upload a session file. - - Uploads binary file content to the specified path in the session sandbox. The service stores - the file relative to the session home directory and rejects payloads larger than 50 MB. - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param session_id: The session ID. Required. - :type session_id: str - :param content: Required. - :type content: bytes - :keyword path: The destination file path within the sandbox, relative to the session home - directory. Required. - :paramtype path: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/octet-stream". - :paramtype content_type: str - :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.SessionFileWriteResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def upload_session_file( - self, - agent_name: str, - session_id: str, - content: IO[bytes], - *, - path: str, - content_type: str = "application/octet-stream", - **kwargs: Any - ) -> _models.SessionFileWriteResult: - """Upload a session file. - - Uploads binary file content to the specified path in the session sandbox. The service stores - the file relative to the session home directory and rejects payloads larger than 50 MB. - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param session_id: The session ID. Required. - :type session_id: str - :param content: Required. - :type content: IO[bytes] - :keyword path: The destination file path within the sandbox, relative to the session home - directory. Required. - :paramtype path: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/octet-stream". - :paramtype content_type: str - :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.SessionFileWriteResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace def upload_session_file( - self, agent_name: str, session_id: str, content: Union[bytes, IO[bytes]], *, path: str, **kwargs: Any - ) -> _models.SessionFileWriteResult: - """Upload a session file. - - Uploads binary file content to the specified path in the session sandbox. The service stores - the file relative to the session home directory and rejects payloads larger than 50 MB. - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param session_id: The session ID. Required. - :type session_id: str - :param content: Is either a bytes type or a IO[bytes] type. Required. - :type content: bytes or IO[bytes] - :keyword path: The destination file path within the sandbox, relative to the session home - directory. Required. - :paramtype path: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/octet-stream". - :paramtype content_type: str - :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.SessionFileWriteResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def upload_session_file( - self, - agent_name: str, - session_id: str, - content: IO[bytes], - *, - path: str, - content_type: str = "application/octet-stream", - **kwargs: Any + self, agent_name: str, session_id: str, content: bytes, *, path: str, **kwargs: Any ) -> _models.SessionFileWriteResult: """Upload a session file. @@ -6255,33 +6167,7 @@ def upload_session_file( :param session_id: The session ID. Required. :type session_id: str :param content: Required. - :type content: IO[bytes] - :keyword path: The destination file path within the sandbox, relative to the session home - directory. Required. - :paramtype path: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/octet-stream". - :paramtype content_type: str - :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.SessionFileWriteResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def upload_session_file( - self, agent_name: str, session_id: str, content: Union[bytes, IO[bytes]], *, path: str, **kwargs: Any - ) -> _models.SessionFileWriteResult: - """Upload a session file. - - Uploads binary file content to the specified path in the session sandbox. The service stores - the file relative to the session home directory and rejects payloads larger than 50 MB. - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param session_id: The session ID. Required. - :type session_id: str - :param content: Is either a bytes type or a IO[bytes] type. Required. - :type content: bytes or IO[bytes] + :type content: bytes :keyword path: The destination file path within the sandbox, relative to the session home directory. Required. :paramtype path: str @@ -6300,12 +6186,9 @@ def upload_session_file( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/octet-stream")) cls: ClsType[_models.SessionFileWriteResult] = kwargs.pop("cls", None) - content_type = content_type or "application/octet-stream" - content_type = content_type or "application/octet-stream" _content = content _request = build_agents_upload_session_file_request( @@ -6602,7 +6485,7 @@ def delete_session_file( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore -class VoiceAgentWebSocketOperations: # pylint: disable=docstring-missing-param +class VoiceAgentWebSocketOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -6721,7 +6604,7 @@ def connect_voice_agent( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, response_headers) # type: ignore -class AgentEndpointConversationsOperations: # pylint: disable=docstring-missing-param +class AgentEndpointConversationsOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -7762,7 +7645,7 @@ def get_agent_conversation_audio_content( return deserialized # type: ignore -class EvaluationRulesOperations: # pylint: disable=docstring-missing-param +class EvaluationRulesOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -7914,7 +7797,7 @@ def create_or_update( @overload def create_or_update( - self, id: str, evaluation_rule: JSON, *, content_type: str = "application/json", **kwargs: Any + self, id: str, evaluation_rule: _types.EvaluationRule, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationRule: """Create or update an evaluation rule. @@ -7923,7 +7806,7 @@ def create_or_update( :param id: Unique identifier for the evaluation rule. Required. :type id: str :param evaluation_rule: Evaluation rule resource. Required. - :type evaluation_rule: JSON + :type evaluation_rule: ~azure.ai.projects.types.EvaluationRule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7954,7 +7837,7 @@ def create_or_update( @distributed_trace def create_or_update( - self, id: str, evaluation_rule: Union[_models.EvaluationRule, JSON, IO[bytes]], **kwargs: Any + self, id: str, evaluation_rule: Union[_models.EvaluationRule, _types.EvaluationRule, IO[bytes]], **kwargs: Any ) -> _models.EvaluationRule: """Create or update an evaluation rule. @@ -7962,9 +7845,10 @@ def create_or_update( :param id: Unique identifier for the evaluation rule. Required. :type id: str - :param evaluation_rule: Evaluation rule resource. Is one of the following types: - EvaluationRule, JSON, IO[bytes] Required. - :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule or JSON or IO[bytes] + :param evaluation_rule: Evaluation rule resource. Is either a EvaluationRule type or a + IO[bytes] type. Required. + :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule or + ~azure.ai.projects.types.EvaluationRule or IO[bytes] :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationRule :raises ~azure.core.exceptions.HttpResponseError: @@ -8139,8 +8023,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class ConnectionsOperations: # pylint: disable=docstring-missing-param -class ConnectionsOperations: # pylint: disable=docstring-missing-param +class ConnectionsOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -8401,8 +8284,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class DatasetsOperations: # pylint: disable=docstring-missing-param -class DatasetsOperations: # pylint: disable=docstring-missing-param +class DatasetsOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -8756,7 +8638,7 @@ def create_or_update( self, name: str, version: str, - dataset_version: JSON, + dataset_version: _types.DatasetVersion, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -8770,7 +8652,7 @@ def create_or_update( :param version: The specific version id of the DatasetVersion to create or update. Required. :type version: str :param dataset_version: The DatasetVersion to create or update. Required. - :type dataset_version: JSON + :type dataset_version: ~azure.ai.projects.types.DatasetVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -8809,7 +8691,11 @@ def create_or_update( @distributed_trace def create_or_update( - self, name: str, version: str, dataset_version: Union[_models.DatasetVersion, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + version: str, + dataset_version: Union[_models.DatasetVersion, _types.DatasetVersion, IO[bytes]], + **kwargs: Any ) -> _models.DatasetVersion: """Create or update a version. @@ -8819,9 +8705,10 @@ def create_or_update( :type name: str :param version: The specific version id of the DatasetVersion to create or update. Required. :type version: str - :param dataset_version: The DatasetVersion to create or update. Is one of the following types: - DatasetVersion, JSON, IO[bytes] Required. - :type dataset_version: ~azure.ai.projects.models.DatasetVersion or JSON or IO[bytes] + :param dataset_version: The DatasetVersion to create or update. Is either a DatasetVersion type + or a IO[bytes] type. Required. + :type dataset_version: ~azure.ai.projects.models.DatasetVersion or + ~azure.ai.projects.types.DatasetVersion or IO[bytes] :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -8921,7 +8808,7 @@ def pending_upload( self, name: str, version: str, - pending_upload_request: JSON, + pending_upload_request: _types.PendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any @@ -8935,7 +8822,7 @@ def pending_upload( :param version: The specific version id of the DatasetVersion to operate on. Required. :type version: str :param pending_upload_request: The pending upload request parameters. Required. - :type pending_upload_request: JSON + :type pending_upload_request: ~azure.ai.projects.types.PendingUploadRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -8977,7 +8864,7 @@ def pending_upload( self, name: str, version: str, - pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], + pending_upload_request: Union[_models.PendingUploadRequest, _types.PendingUploadRequest, IO[bytes]], **kwargs: Any ) -> _models.PendingUploadResponse: """Start a pending upload. @@ -8988,10 +8875,10 @@ def pending_upload( :type name: str :param version: The specific version id of the DatasetVersion to operate on. Required. :type version: str - :param pending_upload_request: The pending upload request parameters. Is one of the following - types: PendingUploadRequest, JSON, IO[bytes] Required. - :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or JSON or - IO[bytes] + :param pending_upload_request: The pending upload request parameters. Is either a + PendingUploadRequest type or a IO[bytes] type. Required. + :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or + ~azure.ai.projects.types.PendingUploadRequest or IO[bytes] :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -9125,8 +9012,7 @@ def get_credentials(self, name: str, version: str, **kwargs: Any) -> _models.Dat return deserialized # type: ignore -class DeploymentsOperations: # pylint: disable=docstring-missing-param -class DeploymentsOperations: # pylint: disable=docstring-missing-param +class DeploymentsOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -9321,8 +9207,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class IndexesOperations: # pylint: disable=docstring-missing-param -class IndexesOperations: # pylint: disable=docstring-missing-param +class IndexesOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -9673,7 +9558,13 @@ def create_or_update( @overload def create_or_update( - self, name: str, version: str, index: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any + self, + name: str, + version: str, + index: _types.Index, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any ) -> _models.Index: """Create or update a version. @@ -9684,7 +9575,7 @@ def create_or_update( :param version: The specific version id of the Index to create or update. Required. :type version: str :param index: The Index to create or update. Required. - :type index: JSON + :type index: ~azure.ai.projects.types.Index :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -9723,7 +9614,7 @@ def create_or_update( @distributed_trace def create_or_update( - self, name: str, version: str, index: Union[_models.Index, JSON, IO[bytes]], **kwargs: Any + self, name: str, version: str, index: Union[_models.Index, _types.Index, IO[bytes]], **kwargs: Any ) -> _models.Index: """Create or update a version. @@ -9733,9 +9624,9 @@ def create_or_update( :type name: str :param version: The specific version id of the Index to create or update. Required. :type version: str - :param index: The Index to create or update. Is one of the following types: Index, JSON, - IO[bytes] Required. - :type index: ~azure.ai.projects.models.Index or JSON or IO[bytes] + :param index: The Index to create or update. Is either a Index type or a IO[bytes] type. + Required. + :type index: ~azure.ai.projects.models.Index or ~azure.ai.projects.types.Index or IO[bytes] :return: Index. The Index is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Index :raises ~azure.core.exceptions.HttpResponseError: @@ -9803,8 +9694,7 @@ def create_or_update( return deserialized # type: ignore -class ToolboxesOperations: # pylint: disable=docstring-missing-param -class ToolboxesOperations: # pylint: disable=docstring-missing-param +class ToolboxesOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -9864,7 +9754,12 @@ def create_version( @overload def create_version( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + body: _types.CreateToolboxVersionRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.ToolboxVersionObject: """Create a new version of a toolbox. @@ -9874,7 +9769,7 @@ def create_version( Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateToolboxVersionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9908,7 +9803,7 @@ def create_version( def create_version( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateToolboxVersionRequest, IO[bytes]] = _Unset, *, tools: List[_models.ToolboxTool] = _Unset, description: Optional[str] = None, @@ -9924,8 +9819,9 @@ def create_version( :param name: The name of the toolbox. If the toolbox does not exist, it will be created. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateToolboxVersionRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.projects.types.CreateToolboxVersionRequest or IO[bytes] :keyword tools: The list of tools to include in this version. Required. :paramtype tools: list[~azure.ai.projects.models.ToolboxTool] :keyword description: A human-readable description of the toolbox. Default value is None. @@ -10367,7 +10263,7 @@ def update( @overload def update( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.UpdateToolboxRequest1, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. @@ -10376,7 +10272,7 @@ def update( :param name: The name of the toolbox to update. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.UpdateToolboxRequest1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10407,7 +10303,12 @@ def update( @distributed_trace def update( - self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, default_version: str = _Unset, **kwargs: Any + self, + name: str, + body: Union[JSON, _types.UpdateToolboxRequest1, IO[bytes]] = _Unset, + *, + default_version: str = _Unset, + **kwargs: Any ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. @@ -10415,8 +10316,8 @@ def update( :param name: The name of the toolbox to update. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, UpdateToolboxRequest1, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.UpdateToolboxRequest1 or IO[bytes] :keyword 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. :paramtype default_version: str @@ -10608,8 +10509,7 @@ def delete_version( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore -class BetaEvaluationTaxonomiesOperations: # pylint: disable=docstring-missing-param -class BetaEvaluationTaxonomiesOperations: # pylint: disable=docstring-missing-param +class BetaEvaluationTaxonomiesOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -10860,7 +10760,7 @@ def create( @overload def create( - self, name: str, taxonomy: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, taxonomy: _types.EvaluationTaxonomy, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. @@ -10869,7 +10769,7 @@ def create( :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. - :type taxonomy: JSON + :type taxonomy: ~azure.ai.projects.types.EvaluationTaxonomy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10900,7 +10800,10 @@ def create( @distributed_trace def create( - self, name: str, taxonomy: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + taxonomy: Union[_models.EvaluationTaxonomy, _types.EvaluationTaxonomy, IO[bytes]], + **kwargs: Any ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. @@ -10908,9 +10811,10 @@ def create( :param name: The name of the evaluation taxonomy. Required. :type name: str - :param taxonomy: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, - JSON, IO[bytes] Required. - :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] + :param taxonomy: The evaluation taxonomy. Is either a EvaluationTaxonomy type or a IO[bytes] + type. Required. + :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or + ~azure.ai.projects.types.EvaluationTaxonomy or IO[bytes] :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: @@ -10998,7 +10902,7 @@ def update( @overload def update( - self, name: str, taxonomy: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, taxonomy: _types.EvaluationTaxonomy, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. @@ -11007,7 +10911,7 @@ def update( :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. - :type taxonomy: JSON + :type taxonomy: ~azure.ai.projects.types.EvaluationTaxonomy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11038,7 +10942,10 @@ def update( @distributed_trace def update( - self, name: str, taxonomy: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + taxonomy: Union[_models.EvaluationTaxonomy, _types.EvaluationTaxonomy, IO[bytes]], + **kwargs: Any ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. @@ -11046,9 +10953,10 @@ def update( :param name: The name of the evaluation taxonomy. Required. :type name: str - :param taxonomy: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, - JSON, IO[bytes] Required. - :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] + :param taxonomy: The evaluation taxonomy. Is either a EvaluationTaxonomy type or a IO[bytes] + type. Required. + :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or + ~azure.ai.projects.types.EvaluationTaxonomy or IO[bytes] :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: @@ -11115,8 +11023,7 @@ def update( return deserialized # type: ignore -class BetaEvaluatorsOperations: # pylint: disable=docstring-missing-param -class BetaEvaluatorsOperations: # pylint: disable=docstring-missing-param +class BetaEvaluatorsOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -11495,7 +11402,12 @@ def create_version( @overload def create_version( - self, name: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + evaluator_version: _types.EvaluatorVersion, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.EvaluatorVersion: """Create an evaluator version. @@ -11504,7 +11416,7 @@ def create_version( :param name: The name of the resource. Required. :type name: str :param evaluator_version: Required. - :type evaluator_version: JSON + :type evaluator_version: ~azure.ai.projects.types.EvaluatorVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11535,7 +11447,10 @@ def create_version( @distributed_trace def create_version( - self, name: str, evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + evaluator_version: Union[_models.EvaluatorVersion, _types.EvaluatorVersion, IO[bytes]], + **kwargs: Any ) -> _models.EvaluatorVersion: """Create an evaluator version. @@ -11543,9 +11458,9 @@ def create_version( :param name: The name of the resource. Required. :type name: str - :param evaluator_version: Is one of the following types: EvaluatorVersion, JSON, IO[bytes] - Required. - :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or JSON or IO[bytes] + :param evaluator_version: Is either a EvaluatorVersion type or a IO[bytes] type. Required. + :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or + ~azure.ai.projects.types.EvaluatorVersion or IO[bytes] :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -11641,7 +11556,13 @@ def update_version( @overload def update_version( - self, name: str, version: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + version: str, + evaluator_version: _types.EvaluatorVersion, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.EvaluatorVersion: """Update an evaluator version. @@ -11652,7 +11573,7 @@ def update_version( :param version: The version of the EvaluatorVersion to update. Required. :type version: str :param evaluator_version: Evaluator resource. Required. - :type evaluator_version: JSON + :type evaluator_version: ~azure.ai.projects.types.EvaluatorVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11694,7 +11615,7 @@ def update_version( self, name: str, version: str, - evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], + evaluator_version: Union[_models.EvaluatorVersion, _types.EvaluatorVersion, IO[bytes]], **kwargs: Any ) -> _models.EvaluatorVersion: """Update an evaluator version. @@ -11705,9 +11626,10 @@ def update_version( :type name: str :param version: The version of the EvaluatorVersion to update. Required. :type version: str - :param evaluator_version: Evaluator resource. Is one of the following types: EvaluatorVersion, - JSON, IO[bytes] Required. - :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or JSON or IO[bytes] + :param evaluator_version: Evaluator resource. Is either a EvaluatorVersion type or a IO[bytes] + type. Required. + :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or + ~azure.ai.projects.types.EvaluatorVersion or IO[bytes] :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -11808,7 +11730,7 @@ def pending_upload( self, name: str, version: str, - pending_upload_request: JSON, + pending_upload_request: _types.PendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any @@ -11823,7 +11745,7 @@ def pending_upload( :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str :param pending_upload_request: The pending upload request parameters. Required. - :type pending_upload_request: JSON + :type pending_upload_request: ~azure.ai.projects.types.PendingUploadRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11866,7 +11788,7 @@ def pending_upload( self, name: str, version: str, - pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], + pending_upload_request: Union[_models.PendingUploadRequest, _types.PendingUploadRequest, IO[bytes]], **kwargs: Any ) -> _models.PendingUploadResponse: """Start a pending upload. @@ -11878,10 +11800,10 @@ def pending_upload( :type name: str :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str - :param pending_upload_request: The pending upload request parameters. Is one of the following - types: PendingUploadRequest, JSON, IO[bytes] Required. - :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or JSON or - IO[bytes] + :param pending_upload_request: The pending upload request parameters. Is either a + PendingUploadRequest type or a IO[bytes] type. Required. + :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or + ~azure.ai.projects.types.PendingUploadRequest or IO[bytes] :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -11986,7 +11908,7 @@ def get_credentials( self, name: str, version: str, - credential_request: JSON, + credential_request: _types.EvaluatorCredentialRequest, *, content_type: str = "application/json", **kwargs: Any @@ -12001,7 +11923,7 @@ def get_credentials( :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str :param credential_request: The credential request parameters. Required. - :type credential_request: JSON + :type credential_request: ~azure.ai.projects.types.EvaluatorCredentialRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -12044,7 +11966,7 @@ def get_credentials( self, name: str, version: str, - credential_request: Union[_models.EvaluatorCredentialRequest, JSON, IO[bytes]], + credential_request: Union[_models.EvaluatorCredentialRequest, _types.EvaluatorCredentialRequest, IO[bytes]], **kwargs: Any ) -> _models.DatasetCredential: """Get evaluator credentials. @@ -12056,10 +11978,10 @@ def get_credentials( :type name: str :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str - :param credential_request: The credential request parameters. Is one of the following types: - EvaluatorCredentialRequest, JSON, IO[bytes] Required. - :type credential_request: ~azure.ai.projects.models.EvaluatorCredentialRequest or JSON or - IO[bytes] + :param credential_request: The credential request parameters. Is either a + EvaluatorCredentialRequest type or a IO[bytes] type. Required. + :type credential_request: ~azure.ai.projects.models.EvaluatorCredentialRequest or + ~azure.ai.projects.types.EvaluatorCredentialRequest or IO[bytes] :return: DatasetCredential. The DatasetCredential is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetCredential :raises ~azure.core.exceptions.HttpResponseError: @@ -12132,7 +12054,7 @@ def get_credentials( def _create_generation_job_initial( self, - job: Union[_models.EvaluatorGenerationJob, JSON, IO[bytes]], + job: Union[_models.EvaluatorGenerationJob, _types.EvaluatorGenerationJob, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -12232,7 +12154,12 @@ def begin_create_generation_job( @overload def begin_create_generation_job( - self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any + self, + job: _types.EvaluatorGenerationJob, + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any ) -> LROPoller[_models.EvaluatorVersion]: """Create an evaluator generation job. @@ -12240,7 +12167,7 @@ def begin_create_generation_job( from the provided source materials asynchronously. :param job: The job to create. Required. - :type job: JSON + :type job: ~azure.ai.projects.types.EvaluatorGenerationJob :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -12284,7 +12211,7 @@ def begin_create_generation_job( @distributed_trace def begin_create_generation_job( self, - job: Union[_models.EvaluatorGenerationJob, JSON, IO[bytes]], + job: Union[_models.EvaluatorGenerationJob, _types.EvaluatorGenerationJob, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -12294,9 +12221,10 @@ def begin_create_generation_job( Creates an evaluator generation job. The service generates rubric-based evaluator definitions from the provided source materials asynchronously. - :param job: The job to create. Is one of the following types: EvaluatorGenerationJob, JSON, - IO[bytes] Required. - :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or JSON or IO[bytes] + :param job: The job to create. Is either a EvaluatorGenerationJob type or a IO[bytes] type. + Required. + :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or + ~azure.ai.projects.types.EvaluatorGenerationJob or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -12651,8 +12579,7 @@ def delete_generation_job( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore -class BetaInsightsOperations: # pylint: disable=docstring-missing-param -class BetaInsightsOperations: # pylint: disable=docstring-missing-param +class BetaInsightsOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -12689,14 +12616,16 @@ def generate( """ @overload - def generate(self, insight: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.Insight: + def generate( + self, insight: _types.Insight, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Insight: """Generate insights. Generates an insights report from the provided evaluation configuration. :param insight: Complete evaluation configuration including data source, evaluators, and result settings. Required. - :type insight: JSON + :type insight: ~azure.ai.projects.types.Insight :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -12723,14 +12652,15 @@ def generate(self, insight: IO[bytes], *, content_type: str = "application/json" """ @distributed_trace - def generate(self, insight: Union[_models.Insight, JSON, IO[bytes]], **kwargs: Any) -> _models.Insight: + def generate(self, insight: Union[_models.Insight, _types.Insight, IO[bytes]], **kwargs: Any) -> _models.Insight: """Generate insights. Generates an insights report from the provided evaluation configuration. :param insight: Complete evaluation configuration including data source, evaluators, and result - settings. Is one of the following types: Insight, JSON, IO[bytes] Required. - :type insight: ~azure.ai.projects.models.Insight or JSON or IO[bytes] + settings. Is either a Insight type or a IO[bytes] type. Required. + :type insight: ~azure.ai.projects.models.Insight or ~azure.ai.projects.types.Insight or + IO[bytes] :return: Insight. The Insight is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Insight :raises ~azure.core.exceptions.HttpResponseError: @@ -12991,8 +12921,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class BetaMemoryStoresOperations: # pylint: disable=docstring-missing-param -class BetaMemoryStoresOperations: # pylint: disable=docstring-missing-param +class BetaMemoryStoresOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -13043,14 +12972,14 @@ def create( @overload def create( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, body: _types.CreateMemoryStoreRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: """Create a memory store. Creates a memory store resource with the provided configuration. :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateMemoryStoreRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -13080,7 +13009,7 @@ def create( @distributed_trace def create( self, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateMemoryStoreRequest, IO[bytes]] = _Unset, *, name: str = _Unset, definition: _models.MemoryStoreDefinition = _Unset, @@ -13092,8 +13021,8 @@ def create( Creates a memory store resource with the provided configuration. - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateMemoryStoreRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.CreateMemoryStoreRequest or IO[bytes] :keyword name: The name of the memory store. Required. :paramtype name: str :keyword definition: The memory store definition. Required. @@ -13209,7 +13138,7 @@ def update( @overload def update( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.UpdateMemoryStoreRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: """Update a memory store. @@ -13218,7 +13147,7 @@ def update( :param name: The name of the memory store to update. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.UpdateMemoryStoreRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -13251,7 +13180,7 @@ def update( def update( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.UpdateMemoryStoreRequest, IO[bytes]] = _Unset, *, description: Optional[str] = None, metadata: Optional[dict[str, str]] = None, @@ -13263,8 +13192,8 @@ def update( :param name: The name of the memory store to update. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, UpdateMemoryStoreRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.UpdateMemoryStoreRequest or IO[bytes] :keyword description: A human-readable description of the memory store. Default value is None. :paramtype description: str :keyword metadata: Arbitrary key-value metadata to associate with the memory store. Default @@ -13582,7 +13511,7 @@ def _search_memories( ) -> _models.MemoryStoreSearchResult: ... @overload def _search_memories( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.SearchMemoriesRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreSearchResult: ... @overload def _search_memories( @@ -13593,7 +13522,7 @@ def _search_memories( def _search_memories( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.SearchMemoriesRequest, IO[bytes]] = _Unset, *, scope: str = _Unset, items: Optional[List[dict[str, Any]]] = None, @@ -13607,8 +13536,8 @@ def _search_memories( :param name: The name of the memory store to search. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, SearchMemoriesRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.SearchMemoriesRequest or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -13696,7 +13625,7 @@ def _search_memories( def _update_memories_initial( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.UpdateMemoriesRequest, IO[bytes]] = _Unset, *, scope: str = _Unset, items: Optional[List[dict[str, Any]]] = None, @@ -13792,7 +13721,7 @@ def _begin_update_memories( ) -> LROPoller[_models.MemoryStoreUpdateCompletedResult]: ... @overload def _begin_update_memories( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.UpdateMemoriesRequest, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.MemoryStoreUpdateCompletedResult]: ... @overload def _begin_update_memories( @@ -13803,7 +13732,7 @@ def _begin_update_memories( def _begin_update_memories( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.UpdateMemoriesRequest, IO[bytes]] = _Unset, *, scope: str = _Unset, items: Optional[List[dict[str, Any]]] = None, @@ -13818,8 +13747,8 @@ def _begin_update_memories( :param name: The name of the memory store to update. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, UpdateMemoriesRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.UpdateMemoriesRequest or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -13924,7 +13853,7 @@ def delete_scope( @overload def delete_scope( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.DeleteScopeRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: """Delete memories by scope. @@ -13933,7 +13862,7 @@ def delete_scope( :param name: The name of the memory store. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.DeleteScopeRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -13966,7 +13895,12 @@ def delete_scope( @distributed_trace def delete_scope( - self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, **kwargs: Any + self, + name: str, + body: Union[JSON, _types.DeleteScopeRequest, IO[bytes]] = _Unset, + *, + scope: str = _Unset, + **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: """Delete memories by scope. @@ -13974,8 +13908,8 @@ def delete_scope( :param name: The name of the memory store. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, DeleteScopeRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.DeleteScopeRequest or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories to delete, such as a user ID. Required. :paramtype scope: str @@ -14089,7 +14023,7 @@ def create_memory( @overload def create_memory( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.CreateMemoryRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: """Create a memory item. @@ -14098,7 +14032,7 @@ def create_memory( :param name: The name of the memory store. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateMemoryRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -14131,7 +14065,7 @@ def create_memory( def create_memory( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateMemoryRequest, IO[bytes]] = _Unset, *, scope: str = _Unset, content: str = _Unset, @@ -14144,8 +14078,8 @@ def create_memory( :param name: The name of the memory store. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateMemoryRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.CreateMemoryRequest or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -14256,7 +14190,13 @@ def update_memory( @overload def update_memory( - self, name: str, memory_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + memory_id: str, + body: _types.UpdateMemoryRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.MemoryItem: """Update a memory item. @@ -14267,7 +14207,7 @@ def update_memory( :param memory_id: The ID of the memory item to update. Required. :type memory_id: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.UpdateMemoryRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -14300,7 +14240,13 @@ def update_memory( @distributed_trace def update_memory( - self, name: str, memory_id: str, body: Union[JSON, IO[bytes]] = _Unset, *, content: str = _Unset, **kwargs: Any + self, + name: str, + memory_id: str, + body: Union[JSON, _types.UpdateMemoryRequest, IO[bytes]] = _Unset, + *, + content: str = _Unset, + **kwargs: Any ) -> _models.MemoryItem: """Update a memory item. @@ -14310,8 +14256,8 @@ def update_memory( :type name: str :param memory_id: The ID of the memory item to update. Required. :type memory_id: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, UpdateMemoryRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.UpdateMemoryRequest or IO[bytes] :keyword content: The updated content of the memory. Required. :paramtype content: str :return: MemoryItem. The MemoryItem is compatible with MutableMapping @@ -14510,7 +14456,7 @@ def list_memories( def list_memories( self, name: str, - body: JSON, + body: _types.ListMemoriesRequest, *, kind: Optional[Union[str, _models.MemoryItemKind]] = None, limit: Optional[int] = None, @@ -14526,7 +14472,7 @@ def list_memories( :param name: The name of the memory store. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.ListMemoriesRequest :keyword kind: The kind of the memory item. Known values are: "user_profile", "chat_summary", and "procedural". Default value is None. :paramtype kind: str or ~azure.ai.projects.models.MemoryItemKind @@ -14602,7 +14548,7 @@ def list_memories( def list_memories( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.ListMemoriesRequest, IO[bytes]] = _Unset, *, scope: str = _Unset, kind: Optional[Union[str, _models.MemoryItemKind]] = None, @@ -14617,8 +14563,8 @@ def list_memories( :param name: The name of the memory store. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, ListMemoriesRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.ListMemoriesRequest or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -14791,8 +14737,7 @@ def delete_memory(self, name: str, memory_id: str, **kwargs: Any) -> _models.Del return deserialized # type: ignore -class BetaModelsOperations: # pylint: disable=docstring-missing-param -class BetaModelsOperations: # pylint: disable=docstring-missing-param +class BetaModelsOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -15145,7 +15090,7 @@ def update( self, name: str, version: str, - model_version_update: JSON, + model_version_update: _types.UpdateModelVersionRequest, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -15160,7 +15105,7 @@ def update( Required. :type version: str :param model_version_update: The UpdateModelVersionRequest to create or update. Required. - :type model_version_update: JSON + :type model_version_update: ~azure.ai.projects.types.UpdateModelVersionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -15203,7 +15148,7 @@ def update( self, name: str, version: str, - model_version_update: Union[_models.UpdateModelVersionRequest, JSON, IO[bytes]], + model_version_update: Union[_models.UpdateModelVersionRequest, _types.UpdateModelVersionRequest, IO[bytes]], **kwargs: Any ) -> _models.ModelVersion: """Update a model version. @@ -15215,10 +15160,10 @@ def update( :param version: The specific version id of the UpdateModelVersionRequest to create or update. Required. :type version: str - :param model_version_update: The UpdateModelVersionRequest to create or update. Is one of the - following types: UpdateModelVersionRequest, JSON, IO[bytes] Required. - :type model_version_update: ~azure.ai.projects.models.UpdateModelVersionRequest or JSON or - IO[bytes] + :param model_version_update: The UpdateModelVersionRequest to create or update. Is either a + UpdateModelVersionRequest type or a IO[bytes] type. Required. + :type model_version_update: ~azure.ai.projects.models.UpdateModelVersionRequest or + ~azure.ai.projects.types.UpdateModelVersionRequest or IO[bytes] :return: ModelVersion. The ModelVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.ModelVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -15316,7 +15261,13 @@ def pending_create_version( @overload def pending_create_version( - self, name: str, version: str, model_version: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + version: str, + model_version: _types.ModelVersion, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.CreateAsyncResponse: """Create a model version async. @@ -15328,7 +15279,7 @@ def pending_create_version( :param version: Version of the model. Required. :type version: str :param model_version: Model version to create. Required. - :type model_version: JSON + :type model_version: ~azure.ai.projects.types.ModelVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -15368,7 +15319,11 @@ def pending_create_version( @distributed_trace def pending_create_version( - self, name: str, version: str, model_version: Union[_models.ModelVersion, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + version: str, + model_version: Union[_models.ModelVersion, _types.ModelVersion, IO[bytes]], + **kwargs: Any ) -> _models.CreateAsyncResponse: """Create a model version async. @@ -15379,9 +15334,10 @@ def pending_create_version( :type name: str :param version: Version of the model. Required. :type version: str - :param model_version: Model version to create. Is one of the following types: ModelVersion, - JSON, IO[bytes] Required. - :type model_version: ~azure.ai.projects.models.ModelVersion or JSON or IO[bytes] + :param model_version: Model version to create. Is either a ModelVersion type or a IO[bytes] + type. Required. + :type model_version: ~azure.ai.projects.models.ModelVersion or + ~azure.ai.projects.types.ModelVersion or IO[bytes] :return: CreateAsyncResponse. The CreateAsyncResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.CreateAsyncResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -15485,7 +15441,7 @@ def pending_upload( self, name: str, version: str, - pending_upload_request: JSON, + pending_upload_request: _types.ModelPendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any @@ -15499,7 +15455,7 @@ def pending_upload( :param version: Version of the model. Required. :type version: str :param pending_upload_request: The pending upload request request body. Required. - :type pending_upload_request: JSON + :type pending_upload_request: ~azure.ai.projects.types.ModelPendingUploadRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -15543,7 +15499,7 @@ def pending_upload( self, name: str, version: str, - pending_upload_request: Union[_models.ModelPendingUploadRequest, JSON, IO[bytes]], + pending_upload_request: Union[_models.ModelPendingUploadRequest, _types.ModelPendingUploadRequest, IO[bytes]], **kwargs: Any ) -> _models.ModelPendingUploadResponse: """Start a pending upload. @@ -15554,10 +15510,10 @@ def pending_upload( :type name: str :param version: Version of the model. Required. :type version: str - :param pending_upload_request: The pending upload request request body. Is one of the following - types: ModelPendingUploadRequest, JSON, IO[bytes] Required. - :type pending_upload_request: ~azure.ai.projects.models.ModelPendingUploadRequest or JSON or - IO[bytes] + :param pending_upload_request: The pending upload request request body. Is either a + ModelPendingUploadRequest type or a IO[bytes] type. Required. + :type pending_upload_request: ~azure.ai.projects.models.ModelPendingUploadRequest or + ~azure.ai.projects.types.ModelPendingUploadRequest or IO[bytes] :return: ModelPendingUploadResponse. The ModelPendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.ModelPendingUploadResponse @@ -15658,7 +15614,7 @@ def get_credentials( self, name: str, version: str, - credential_request: JSON, + credential_request: _types.ModelCredentialRequest, *, content_type: str = "application/json", **kwargs: Any @@ -15672,7 +15628,7 @@ def get_credentials( :param version: Version of the model. Required. :type version: str :param credential_request: The credential request request body. Required. - :type credential_request: JSON + :type credential_request: ~azure.ai.projects.types.ModelCredentialRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -15714,7 +15670,7 @@ def get_credentials( self, name: str, version: str, - credential_request: Union[_models.ModelCredentialRequest, JSON, IO[bytes]], + credential_request: Union[_models.ModelCredentialRequest, _types.ModelCredentialRequest, IO[bytes]], **kwargs: Any ) -> _models.DatasetCredential: """Get model asset credentials. @@ -15725,9 +15681,10 @@ def get_credentials( :type name: str :param version: Version of the model. Required. :type version: str - :param credential_request: The credential request request body. Is one of the following types: - ModelCredentialRequest, JSON, IO[bytes] Required. - :type credential_request: ~azure.ai.projects.models.ModelCredentialRequest or JSON or IO[bytes] + :param credential_request: The credential request request body. Is either a + ModelCredentialRequest type or a IO[bytes] type. Required. + :type credential_request: ~azure.ai.projects.models.ModelCredentialRequest or + ~azure.ai.projects.types.ModelCredentialRequest or IO[bytes] :return: DatasetCredential. The DatasetCredential is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetCredential :raises ~azure.core.exceptions.HttpResponseError: @@ -15795,8 +15752,7 @@ def get_credentials( return deserialized # type: ignore -class BetaRedTeamsOperations: # pylint: disable=docstring-missing-param -class BetaRedTeamsOperations: # pylint: disable=docstring-missing-param +class BetaRedTeamsOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -15985,13 +15941,15 @@ def create( """ @overload - def create(self, red_team: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.RedTeam: + def create( + self, red_team: _types.RedTeam, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.RedTeam: """Create a redteam run. Submits a new redteam run for execution with the provided configuration. :param red_team: Redteam to be run. Required. - :type red_team: JSON + :type red_team: ~azure.ai.projects.types.RedTeam :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -16017,14 +15975,14 @@ def create(self, red_team: IO[bytes], *, content_type: str = "application/json", """ @distributed_trace - def create(self, red_team: Union[_models.RedTeam, JSON, IO[bytes]], **kwargs: Any) -> _models.RedTeam: + def create(self, red_team: Union[_models.RedTeam, _types.RedTeam, IO[bytes]], **kwargs: Any) -> _models.RedTeam: """Create a redteam run. Submits a new redteam run for execution with the provided configuration. - :param red_team: Redteam to be run. Is one of the following types: RedTeam, JSON, IO[bytes] - Required. - :type red_team: ~azure.ai.projects.models.RedTeam or JSON or IO[bytes] + :param red_team: Redteam to be run. Is either a RedTeam type or a IO[bytes] type. Required. + :type red_team: ~azure.ai.projects.models.RedTeam or ~azure.ai.projects.types.RedTeam or + IO[bytes] :return: RedTeam. The RedTeam is compatible with MutableMapping :rtype: ~azure.ai.projects.models.RedTeam :raises ~azure.core.exceptions.HttpResponseError: @@ -16094,8 +16052,7 @@ def create(self, red_team: Union[_models.RedTeam, JSON, IO[bytes]], **kwargs: An return deserialized # type: ignore -class BetaRoutinesOperations: # pylint: disable=docstring-missing-param -class BetaRoutinesOperations: # pylint: disable=docstring-missing-param +class BetaRoutinesOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -16149,7 +16106,12 @@ def create_or_update( @overload def create_or_update( - self, routine_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + routine_name: str, + body: _types.CreateOrUpdateRoutineRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.Routine: """Create or update a routine. @@ -16158,7 +16120,7 @@ def create_or_update( :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateOrUpdateRoutineRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -16191,7 +16153,7 @@ def create_or_update( def create_or_update( self, routine_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateOrUpdateRoutineRequest, IO[bytes]] = _Unset, *, description: Optional[str] = None, enabled: Optional[bool] = None, @@ -16205,8 +16167,9 @@ def create_or_update( :param routine_name: The unique name of the routine. Required. :type routine_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateOrUpdateRoutineRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.projects.types.CreateOrUpdateRoutineRequest or IO[bytes] :keyword description: A human-readable description of the routine. Default value is None. :paramtype description: str :keyword enabled: Whether the routine is enabled. Default value is None. @@ -16497,12 +16460,6 @@ def list( after: Optional[str] = None, order: Optional[Union[str, _models.PageOrder]] = None, **kwargs: Any - self, - *, - limit: Optional[int] = None, - after: Optional[str] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - **kwargs: Any ) -> ItemPaged["_models.Routine"]: """List routines. @@ -16518,14 +16475,6 @@ def list( 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 after: An opaque continuation token identifying where to resume the list. Prefer - following the ``next_link`` returned by the previous response, which embeds this value. Default - value is None. - :paramtype after: str - :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 :return: An iterator like instance of Routine :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.Routine] :raises ~azure.core.exceptions.HttpResponseError: @@ -16545,46 +16494,6 @@ def list( def prepare_request(next_link=None): if not next_link: - def prepare_request(next_link=None): - if not next_link: - - _request = build_beta_routines_list_request( - limit=limit, - after=after, - order=order, - 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) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_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) _request = build_beta_routines_list_request( limit=limit, @@ -16635,10 +16544,7 @@ def extract_data(pipeline_response): if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("next_link") or None, iter(list_of_elem) - return deserialized.get("next_link") or None, iter(list_of_elem) - def get_next(next_link=None): - _request = prepare_request(next_link) def get_next(next_link=None): _request = prepare_request(next_link) @@ -16723,8 +16629,6 @@ def list_runs( limit: Optional[int] = None, after: Optional[str] = None, order: Optional[Union[str, _models.PageOrder]] = None, - after: Optional[str] = None, - order: Optional[Union[str, _models.PageOrder]] = None, **kwargs: Any ) -> ItemPaged["_models.RoutineRun"]: """List prior runs for a routine. @@ -16746,14 +16650,6 @@ def list_runs( 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 after: An opaque continuation token identifying where to resume the list. Prefer - following the ``next_link`` returned by the previous response, which embeds this value. Default - value is None. - :paramtype after: str - :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 :return: An iterator like instance of RoutineRun :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.RoutineRun] :raises ~azure.core.exceptions.HttpResponseError: @@ -16771,8 +16667,6 @@ def list_runs( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: def prepare_request(next_link=None): if not next_link: @@ -16793,46 +16687,6 @@ def prepare_request(next_link=None): } _request.url = self._client.format_url(_request.url, **path_format_arguments) - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_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) - - _request = build_beta_routines_list_runs_request( - routine_name=routine_name, - filter=filter, - limit=limit, - after=after, - order=order, - 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) - else: # make call to next link with the client's api-version _parsed_next_link = urllib.parse.urlparse(next_link) @@ -16867,10 +16721,7 @@ def extract_data(pipeline_response): if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("next_link") or None, iter(list_of_elem) - return deserialized.get("next_link") or None, iter(list_of_elem) - def get_next(next_link=None): - _request = prepare_request(next_link) def get_next(next_link=None): _request = prepare_request(next_link) @@ -16920,7 +16771,12 @@ def dispatch( @overload def dispatch( - self, routine_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + routine_name: str, + body: _types.DispatchRoutineAsyncRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. @@ -16929,7 +16785,7 @@ def dispatch( :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.DispatchRoutineAsyncRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -16962,7 +16818,7 @@ def dispatch( def dispatch( self, routine_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.DispatchRoutineAsyncRequest, IO[bytes]] = _Unset, *, payload: Optional[_models.RoutineDispatchPayload] = None, **kwargs: Any @@ -16973,8 +16829,9 @@ def dispatch( :param routine_name: The unique name of the routine. Required. :type routine_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, DispatchRoutineAsyncRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.projects.types.DispatchRoutineAsyncRequest or IO[bytes] :keyword payload: A direct action-input override sent downstream when testing a routine. Default value is None. :paramtype payload: ~azure.ai.projects.models.RoutineDispatchPayload @@ -17051,8 +16908,7 @@ def dispatch( return deserialized # type: ignore -class BetaSchedulesOperations: # pylint: disable=docstring-missing-param -class BetaSchedulesOperations: # pylint: disable=docstring-missing-param +class BetaSchedulesOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -17307,7 +17163,7 @@ def create_or_update( @overload def create_or_update( - self, schedule_id: str, schedule: JSON, *, content_type: str = "application/json", **kwargs: Any + self, schedule_id: str, schedule: _types.Schedule, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Schedule: """Create or update a schedule. @@ -17316,7 +17172,7 @@ def create_or_update( :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str :param schedule: The resource instance. Required. - :type schedule: JSON + :type schedule: ~azure.ai.projects.types.Schedule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -17347,7 +17203,7 @@ def create_or_update( @distributed_trace def create_or_update( - self, schedule_id: str, schedule: Union[_models.Schedule, JSON, IO[bytes]], **kwargs: Any + self, schedule_id: str, schedule: Union[_models.Schedule, _types.Schedule, IO[bytes]], **kwargs: Any ) -> _models.Schedule: """Create or update a schedule. @@ -17355,9 +17211,10 @@ def create_or_update( :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str - :param schedule: The resource instance. Is one of the following types: Schedule, JSON, - IO[bytes] Required. - :type schedule: ~azure.ai.projects.models.Schedule or JSON or IO[bytes] + :param schedule: The resource instance. Is either a Schedule type or a IO[bytes] type. + Required. + :type schedule: ~azure.ai.projects.models.Schedule or ~azure.ai.projects.types.Schedule or + IO[bytes] :return: Schedule. The Schedule is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Schedule :raises ~azure.core.exceptions.HttpResponseError: @@ -17601,8 +17458,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class BetaSkillsOperations: # pylint: disable=docstring-missing-param -class BetaSkillsOperations: # pylint: disable=docstring-missing-param +class BetaSkillsOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -17801,7 +17657,7 @@ def update( @overload def update( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.UpdateSkillRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SkillDetails: """Update a skill. @@ -17810,7 +17666,7 @@ def update( :param name: The name of the skill to update. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.UpdateSkillRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -17841,7 +17697,12 @@ def update( @distributed_trace def update( - self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, default_version: str = _Unset, **kwargs: Any + self, + name: str, + body: Union[JSON, _types.UpdateSkillRequest, IO[bytes]] = _Unset, + *, + default_version: str = _Unset, + **kwargs: Any ) -> _models.SkillDetails: """Update a skill. @@ -17849,8 +17710,8 @@ def update( :param name: The name of the skill to update. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, UpdateSkillRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.UpdateSkillRequest or IO[bytes] :keyword default_version: The version identifier that the skill should point to. When set, the skill's default version will resolve to this version instead of the latest. Required. :paramtype default_version: str @@ -18026,7 +17887,12 @@ def create( @overload def create( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + body: _types.CreateSkillVersionRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.SkillVersion: """Create a new version of a skill. @@ -18035,7 +17901,7 @@ def create( :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateSkillVersionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -18068,7 +17934,7 @@ def create( def create( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateSkillVersionRequest, IO[bytes]] = _Unset, *, inline_content: Optional[_models.SkillInlineContent] = None, default: Optional[bool] = None, @@ -18080,8 +17946,9 @@ def create( :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateSkillVersionRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.projects.types.CreateSkillVersionRequest or IO[bytes] :keyword inline_content: Inline skill content for simple skills without file uploads. Foundry-specific extension. Default value is None. :paramtype inline_content: ~azure.ai.projects.models.SkillInlineContent @@ -18177,7 +18044,9 @@ def create_from_files( """ @overload - def create_from_files(self, name: str, content: JSON, **kwargs: Any) -> _models.SkillVersion: + def create_from_files( + self, name: str, content: _types.CreateSkillVersionFromFilesBody, **kwargs: Any + ) -> _models.SkillVersion: """Create a skill version from uploaded files. Creates a new version of a skill from uploaded files via multipart form data. @@ -18185,7 +18054,7 @@ def create_from_files(self, name: str, content: JSON, **kwargs: Any) -> _models. :param name: The name of the skill. Required. :type name: str :param content: The multipart request content. Required. - :type content: JSON + :type content: ~azure.ai.projects.types.CreateSkillVersionFromFilesBody :return: SkillVersion. The SkillVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.SkillVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -18193,7 +18062,10 @@ def create_from_files(self, name: str, content: JSON, **kwargs: Any) -> _models. @distributed_trace def create_from_files( - self, name: str, content: Union[_models.CreateSkillVersionFromFilesBody, JSON], **kwargs: Any + self, + name: str, + content: Union[_models.CreateSkillVersionFromFilesBody, _types.CreateSkillVersionFromFilesBody], + **kwargs: Any ) -> _models.SkillVersion: """Create a skill version from uploaded files. @@ -18201,9 +18073,10 @@ def create_from_files( :param name: The name of the skill. Required. :type name: str - :param content: The multipart request content. Is either a CreateSkillVersionFromFilesBody type - or a JSON type. Required. - :type content: ~azure.ai.projects.models.CreateSkillVersionFromFilesBody or JSON + :param content: The multipart request content. Is one of the following types: + CreateSkillVersionFromFilesBody Required. + :type content: ~azure.ai.projects.models.CreateSkillVersionFromFilesBody or + ~azure.ai.projects.types.CreateSkillVersionFromFilesBody :return: SkillVersion. The SkillVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.SkillVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -18644,8 +18517,7 @@ def delete_version(self, name: str, version: str, **kwargs: Any) -> _models.Dele return deserialized # type: ignore -class BetaDatasetsOperations: # pylint: disable=docstring-missing-param -class BetaDatasetsOperations: # pylint: disable=docstring-missing-param +class BetaDatasetsOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -18826,7 +18698,7 @@ def get_next(_continuation_token=None): def _create_generation_job_initial( self, - job: Union[_models.DataGenerationJob, JSON, IO[bytes]], + job: Union[_models.DataGenerationJob, _types.DataGenerationJob, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -18925,14 +18797,19 @@ def begin_create_generation_job( @overload def begin_create_generation_job( - self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any + self, + job: _types.DataGenerationJob, + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any ) -> LROPoller[_models.DataGenerationJobResult]: """Create a data generation job. Submits a new data generation job for asynchronous execution. :param job: The job to create. Required. - :type job: JSON + :type job: ~azure.ai.projects.types.DataGenerationJob :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -18975,7 +18852,7 @@ def begin_create_generation_job( @distributed_trace def begin_create_generation_job( self, - job: Union[_models.DataGenerationJob, JSON, IO[bytes]], + job: Union[_models.DataGenerationJob, _types.DataGenerationJob, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -18984,9 +18861,10 @@ def begin_create_generation_job( Submits a new data generation job for asynchronous execution. - :param job: The job to create. Is one of the following types: DataGenerationJob, JSON, - IO[bytes] Required. - :type job: ~azure.ai.projects.models.DataGenerationJob or JSON or IO[bytes] + :param job: The job to create. Is either a DataGenerationJob type or a IO[bytes] type. + Required. + :type job: ~azure.ai.projects.models.DataGenerationJob or + ~azure.ai.projects.types.DataGenerationJob or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -19176,8 +19054,7 @@ def delete_generation_job( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore -class BetaAgentsOperations: # pylint: disable=docstring-missing-param -class BetaAgentsOperations: # pylint: disable=docstring-missing-param +class BetaAgentsOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -19196,12 +19073,7 @@ def __init__(self, *args, **kwargs) -> None: def _create_optimization_job_initial( self, - job: Union[_models.AgentOptimizationJob, JSON, IO[bytes]], - *, - operation_id: Optional[str] = None, - **kwargs: Any - self, - job: Union[_models.AgentOptimizationJob, JSON, IO[bytes]], + job: Union[_models.AgentOptimizationJob, _types.AgentOptimizationJob, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -19275,12 +19147,10 @@ def _create_optimization_job_initial( def begin_create_optimization_job( self, job: _models.AgentOptimizationJob, - job: _models.AgentOptimizationJob, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.AgentOptimizationJobResult]: ) -> LROPoller[_models.AgentOptimizationJobResult]: """Create an agent optimization job. @@ -19289,7 +19159,6 @@ def begin_create_optimization_job( :param job: The job to create. Required. :type job: ~azure.ai.projects.models.AgentOptimizationJob - :type job: ~azure.ai.projects.models.AgentOptimizationJob :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -19299,16 +19168,17 @@ def begin_create_optimization_job( :return: An instance of LROPoller that returns AgentOptimizationJobResult. The AgentOptimizationJobResult is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.AgentOptimizationJobResult] - :return: An instance of LROPoller that returns AgentOptimizationJobResult. The - AgentOptimizationJobResult is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.AgentOptimizationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ @overload def begin_create_optimization_job( - self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.AgentOptimizationJobResult]: + self, + job: _types.AgentOptimizationJob, + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any ) -> LROPoller[_models.AgentOptimizationJobResult]: """Create an agent optimization job. @@ -19316,7 +19186,7 @@ def begin_create_optimization_job( retry. :param job: The job to create. Required. - :type job: JSON + :type job: ~azure.ai.projects.types.AgentOptimizationJob :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -19326,9 +19196,6 @@ def begin_create_optimization_job( :return: An instance of LROPoller that returns AgentOptimizationJobResult. The AgentOptimizationJobResult is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.AgentOptimizationJobResult] - :return: An instance of LROPoller that returns AgentOptimizationJobResult. The - AgentOptimizationJobResult is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.AgentOptimizationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -19340,7 +19207,6 @@ def begin_create_optimization_job( operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.AgentOptimizationJobResult]: ) -> LROPoller[_models.AgentOptimizationJobResult]: """Create an agent optimization job. @@ -19358,22 +19224,13 @@ def begin_create_optimization_job( :return: An instance of LROPoller that returns AgentOptimizationJobResult. The AgentOptimizationJobResult is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.AgentOptimizationJobResult] - :return: An instance of LROPoller that returns AgentOptimizationJobResult. The - AgentOptimizationJobResult is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.AgentOptimizationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace def begin_create_optimization_job( self, - job: Union[_models.AgentOptimizationJob, JSON, IO[bytes]], - *, - operation_id: Optional[str] = None, - **kwargs: Any - ) -> LROPoller[_models.AgentOptimizationJobResult]: - self, - job: Union[_models.AgentOptimizationJob, JSON, IO[bytes]], + job: Union[_models.AgentOptimizationJob, _types.AgentOptimizationJob, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -19383,21 +19240,16 @@ def begin_create_optimization_job( Creates an optimization job and returns the queued job. Honors ``Operation-Id`` for idempotent retry. - :param job: The job to create. Is one of the following types: AgentOptimizationJob, JSON, - IO[bytes] Required. - :type job: ~azure.ai.projects.models.AgentOptimizationJob or JSON or IO[bytes] - :param job: The job to create. Is one of the following types: AgentOptimizationJob, JSON, - IO[bytes] Required. - :type job: ~azure.ai.projects.models.AgentOptimizationJob or JSON or IO[bytes] + :param job: The job to create. Is either a AgentOptimizationJob type or a IO[bytes] type. + Required. + :type job: ~azure.ai.projects.models.AgentOptimizationJob or + ~azure.ai.projects.types.AgentOptimizationJob or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str :return: An instance of LROPoller that returns AgentOptimizationJobResult. The AgentOptimizationJobResult is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.AgentOptimizationJobResult] - :return: An instance of LROPoller that returns AgentOptimizationJobResult. The - AgentOptimizationJobResult is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.AgentOptimizationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -19405,7 +19257,6 @@ def begin_create_optimization_job( content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.AgentOptimizationJobResult] = kwargs.pop("cls", None) - cls: ClsType[_models.AgentOptimizationJobResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -19430,7 +19281,6 @@ def get_long_running_output(pipeline_response): ) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - deserialized = _deserialize(_models.AgentOptimizationJobResult, response.json().get("result", {})) deserialized = _deserialize(_models.AgentOptimizationJobResult, response.json().get("result", {})) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -19449,20 +19299,17 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.AgentOptimizationJobResult].from_continuation_token( return LROPoller[_models.AgentOptimizationJobResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.AgentOptimizationJobResult]( return LROPoller[_models.AgentOptimizationJobResult]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @distributed_trace - def get_optimization_job(self, job_id: str, **kwargs: Any) -> _models.AgentOptimizationJob: def get_optimization_job(self, job_id: str, **kwargs: Any) -> _models.AgentOptimizationJob: """Get an agent optimization job. @@ -19472,8 +19319,6 @@ def get_optimization_job(self, job_id: str, **kwargs: Any) -> _models.AgentOptim :type job_id: str :return: AgentOptimizationJob. The AgentOptimizationJob is compatible with MutableMapping :rtype: ~azure.ai.projects.models.AgentOptimizationJob - :return: AgentOptimizationJob. The AgentOptimizationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentOptimizationJob :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -19487,7 +19332,6 @@ def get_optimization_job(self, job_id: str, **kwargs: Any) -> _models.AgentOptim _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.AgentOptimizationJob] = kwargs.pop("cls", None) cls: ClsType[_models.AgentOptimizationJob] = kwargs.pop("cls", None) _request = build_beta_agents_get_optimization_job_request( @@ -19529,7 +19373,6 @@ def get_optimization_job(self, job_id: str, **kwargs: Any) -> _models.AgentOptim deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.AgentOptimizationJob, response.json()) - deserialized = _deserialize(_models.AgentOptimizationJob, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -19546,7 +19389,6 @@ def list_optimization_jobs( status: Optional[Union[str, _models.JobStatus]] = None, agent_name: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.AgentOptimizationJobListItem"]: ) -> ItemPaged["_models.AgentOptimizationJobListItem"]: """List agent optimization jobs. @@ -19573,14 +19415,11 @@ def list_optimization_jobs( :paramtype agent_name: str :return: An iterator like instance of AgentOptimizationJobListItem :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.AgentOptimizationJobListItem] - :return: An iterator like instance of AgentOptimizationJobListItem - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.AgentOptimizationJobListItem] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.AgentOptimizationJobListItem]] = kwargs.pop("cls", None) cls: ClsType[List[_models.AgentOptimizationJobListItem]] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -19613,7 +19452,6 @@ def prepare_request(_continuation_token=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.AgentOptimizationJobListItem], List[_models.AgentOptimizationJobListItem], deserialized.get("data", []), ) @@ -19643,7 +19481,6 @@ def get_next(_continuation_token=None): return ItemPaged(get_next, extract_data) @distributed_trace - def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.AgentOptimizationJob: def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.AgentOptimizationJob: """Cancel an agent optimization job. @@ -19654,8 +19491,6 @@ def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.AgentOp :type job_id: str :return: AgentOptimizationJob. The AgentOptimizationJob is compatible with MutableMapping :rtype: ~azure.ai.projects.models.AgentOptimizationJob - :return: AgentOptimizationJob. The AgentOptimizationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentOptimizationJob :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -19669,7 +19504,6 @@ def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.AgentOp _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.AgentOptimizationJob] = kwargs.pop("cls", None) cls: ClsType[_models.AgentOptimizationJob] = kwargs.pop("cls", None) _request = build_beta_agents_cancel_optimization_job_request( @@ -19708,7 +19542,6 @@ def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.AgentOp deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.AgentOptimizationJob, response.json()) - deserialized = _deserialize(_models.AgentOptimizationJob, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py index d9d477230b36..19b047b10be3 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py @@ -362,6 +362,48 @@ def create_version_from_code( raise new_exc from exc raise + @distributed_trace + def generate_agent(self, body: _models.GenerateVoiceAgentRequest, **kwargs: Any) -> _models.AgentDetails: # type: ignore[override] + """Generate an agent. + + Generates and creates an agent from kind-specific high-level inputs. The generated definition + remains fully editable through the standard agent versioning operations. When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param body: The kind-specific inputs for generating and creating an agent. Required. + :type body: ~azure.ai.projects.models.GenerateVoiceAgentRequest + :return: AgentDetails. The AgentDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + + if getattr(self._config, "allow_preview", False): + # Add Foundry-Features header if not already present + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS + kwargs["headers"] = headers + + try: + return super().generate_agent(body, **kwargs) # type: ignore[misc] + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + class BetaAgentsOperations(BetaAgentsOperationsGenerated): """Custom operations for beta agent optimization jobs.""" @@ -471,45 +513,3 @@ def get_long_running_output(pipeline_response): ) assert raw_result is not None return AgentOptimizationLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def generate_agent(self, body: _models.GenerateVoiceAgentRequest, **kwargs: Any) -> _models.AgentDetails: # type: ignore[override] - """Generate an agent. - - Generates and creates an agent from kind-specific high-level inputs. The generated definition - remains fully editable through the standard agent versioning operations. When the client is - constructed with ``allow_preview=True``, the required preview opt-in header is added - automatically. - - :param body: The kind-specific inputs for generating and creating an agent. Required. - :type body: ~azure.ai.projects.models.GenerateVoiceAgentRequest - :return: AgentDetails. The AgentDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - - if getattr(self._config, "allow_preview", False): - # Add Foundry-Features header if not already present - headers = kwargs.get("headers") - if headers is None: - kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} - elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): - headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS - kwargs["headers"] = headers - - try: - return super().generate_agent(body, **kwargs) # type: ignore[misc] - except HttpResponseError as exc: - if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: - api_error_response = exc.model - if hasattr(api_error_response, "error") and api_error_response.error is not None: - if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: - new_exc = HttpResponseError( - message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", - ) - new_exc.status_code = exc.status_code - new_exc.reason = exc.reason - new_exc.response = exc.response - new_exc.model = exc.model - raise new_exc from exc - raise diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/types.py b/sdk/ai/azure-ai-projects/azure/ai/projects/types.py index c2ed95217e6e..5b63dbc0d9d7 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/types.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/types.py @@ -61,6 +61,7 @@ if TYPE_CHECKING: from . import _unions from .models import ( + A2AProtocolVersion, AgentEndpointProtocol, AttackStrategy, AzureAISearchQueryType, @@ -266,6 +267,100 @@ class A2AProtocolConfiguration(TypedDict, total=False): """Configuration specific to the A2A protocol.""" +class A2ATool(TypedDict, total=False): + """An agent implementing the A2A protocol. + + :ivar type: The type of the tool. Always ``"a2a"``. Required. A2_A. + :vartype type: Literal[ToolType.A2_A] + :ivar base_url: Base URL of the agent. + :vartype base_url: str + :ivar agent_card_path: The path to the agent card relative to the ``base_url``. If not + provided, defaults to ``/.well-known/agent-card.json``. + :vartype agent_card_path: str + :ivar project_connection_id: The connection ID in the project for the A2A server. The + connection stores authentication and other connection details needed to connect to the A2A + server. + :vartype project_connection_id: str + :ivar send_credentials_for_agent_card: When ``true``, Foundry sends its credentials when + fetching the remote agent's Agent Card. The service defaults to ``false`` if a value is not + specified by the caller (anonymous fetch). + :vartype send_credentials_for_agent_card: bool + :ivar a2a_version: The A2A protocol version supported by the agent. Required. "1.0" + :vartype a2a_version: Union[str, "A2AProtocolVersion"] + """ + + type: Required[Literal[ToolType.A2_A]] + """The type of the tool. Always ``\"a2a\"``. Required. A2_A.""" + base_url: str + """Base URL of the agent.""" + agent_card_path: str + """The path to the agent card relative to the ``base_url``. If not provided, defaults to + ``/.well-known/agent-card.json``.""" + project_connection_id: str + """The connection ID in the project for the A2A server. The connection stores authentication and + other connection details needed to connect to the A2A server.""" + send_credentials_for_agent_card: bool + """When ``true``, Foundry sends its credentials when fetching the remote agent's Agent Card. The + service defaults to ``false`` if a value is not specified by the caller (anonymous fetch).""" + a2a_version: Required[Union[str, "A2AProtocolVersion"]] + """The A2A protocol version supported by the agent. Required. \"1.0\"""" + + +class A2AToolboxTool(TypedDict, total=False): + """An A2A 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, "ToolConfig"] + :ivar type: Required. A2_A. + :vartype type: Literal[ToolboxToolType.A2_A] + :ivar base_url: Base URL of the agent. + :vartype base_url: str + :ivar agent_card_path: The path to the agent card relative to the ``base_url``. If not + provided, defaults to ``/.well-known/agent-card.json``. + :vartype agent_card_path: str + :ivar project_connection_id: The connection ID in the project for the A2A server. The + connection stores authentication and other connection details needed to connect to the A2A + server. + :vartype project_connection_id: str + :ivar send_credentials_for_agent_card: When ``true``, Foundry sends its credentials when + fetching the remote agent's Agent Card. The service defaults to ``false`` if a value is not + specified by the caller (anonymous fetch). + :vartype send_credentials_for_agent_card: bool + :ivar a2a_version: The A2A protocol version supported by the agent. Required. "1.0" + :vartype a2a_version: Union[str, "A2AProtocolVersion"] + """ + + name: str + """Optional user-defined name for this tool or configuration.""" + description: str + """Optional user-defined description for this tool or configuration.""" + tool_configs: dict[str, "ToolConfig"] + """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.""" + type: Required[Literal[ToolboxToolType.A2_A]] + """Required. A2_A.""" + base_url: str + """Base URL of the agent.""" + agent_card_path: str + """The path to the agent card relative to the ``base_url``. If not provided, defaults to + ``/.well-known/agent-card.json``.""" + project_connection_id: str + """The connection ID in the project for the A2A server. The connection stores authentication and + other connection details needed to connect to the A2A server.""" + send_credentials_for_agent_card: bool + """When ``true``, Foundry sends its credentials when fetching the remote agent's Agent Card. The + service defaults to ``false`` if a value is not specified by the caller (anonymous fetch).""" + a2a_version: Required[Union[str, "A2AProtocolVersion"]] + """The A2A protocol version supported by the agent. Required. \"1.0\"""" + + class ActivityProtocolConfiguration(TypedDict, total=False): """Configuration specific to the activity protocol. @@ -3806,6 +3901,9 @@ class HostedAgentDefinition(TypedDict, total=False): :ivar telemetry_config: Optional customer-supplied telemetry configuration for exporting container logs, traces, and metrics. :vartype telemetry_config: "TelemetryConfig" + :ivar session_configuration: Optional session defaults (for example, the idle timeout) applied + to sessions created for this agent version. + :vartype session_configuration: "SessionConfiguration" """ rai_config: "RaiConfig" @@ -3829,6 +3927,9 @@ class HostedAgentDefinition(TypedDict, total=False): telemetry_config: "TelemetryConfig" """Optional customer-supplied telemetry configuration for exporting container logs, traces, and metrics.""" + session_configuration: "SessionConfiguration" + """Optional session defaults (for example, the idle timeout) applied to sessions created for this + agent version.""" class HourlyRecurrenceSchedule(TypedDict, total=False): @@ -6456,6 +6557,20 @@ class ScheduleRoutineTrigger(TypedDict, total=False): """An IANA or Windows time zone identifier for the schedule. Required.""" +class SessionConfiguration(TypedDict, total=False): + """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. Optional — when unset, the server default of 900 seconds is used. Must be between + 300 and 3600 seconds (inclusive). + :vartype idle_timeout_seconds: str + """ + + idle_timeout_seconds: str + """The idle duration, in seconds, before a session's sandbox is suspended. Optional — when unset, + the server default of 900 seconds is used. Must be between 300 and 3600 seconds (inclusive).""" + + class SharepointGroundingToolParameters(TypedDict, total=False): """The sharepoint grounding tool parameters. @@ -10241,12 +10356,14 @@ class VoiceAudioOutputConfig(TypedDict, total=False): 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. + * `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 @@ -11070,6 +11187,78 @@ class VoiceUserMessageItem(TypedDict, total=False): """Required. USER.""" +class WebIQPreviewTool(TypedDict, total=False): + """A WebIQ server-side tool. + + :ivar type: The object type, which is always 'web_iq_preview'. Required. WEB_IQ_PREVIEW. + :vartype type: Literal[ToolType.WEB_IQ_PREVIEW] + :ivar project_connection_id: The ID of the WebIQ project connection. Required. + :vartype project_connection_id: str + :ivar server_label: The label of the WebIQ MCP server to connect to. When omitted, the service + defaults to connection name extracted from project_connection_id. + :vartype server_label: str + :ivar require_approval: Whether the agent requires approval before executing actions. When + omitted, the service defaults to "always". Is either a MCPToolRequireApproval type or a str + type. + :vartype require_approval: Union["MCPToolRequireApproval", str] + """ + + type: Required[Literal[ToolType.WEB_IQ_PREVIEW]] + """The object type, which is always 'web_iq_preview'. Required. WEB_IQ_PREVIEW.""" + project_connection_id: Required[str] + """The ID of the WebIQ project connection. Required.""" + server_label: str + """The label of the WebIQ MCP server to connect to. When omitted, the service defaults to + connection name extracted from project_connection_id.""" + require_approval: Optional[Union["MCPToolRequireApproval", str]] + """Whether the agent requires approval before executing actions. When omitted, the service + defaults to \"always\". Is either a MCPToolRequireApproval type or a str type.""" + + +class WebIQPreviewToolboxTool(TypedDict, total=False): + """A WebIQ 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, "ToolConfig"] + :ivar type: Required. WEB_IQ_PREVIEW. + :vartype type: Literal[ToolboxToolType.WEB_IQ_PREVIEW] + :ivar project_connection_id: The ID of the WebIQ project connection. Required. + :vartype project_connection_id: str + :ivar server_label: The label of the WebIQ MCP server to connect to. When omitted, the service + defaults to connection name extracted from project_connection_id. + :vartype server_label: str + :ivar require_approval: Whether the agent requires approval before executing actions. When + omitted, the service defaults to "always". Is either a MCPToolRequireApproval type or a str + type. + :vartype require_approval: Union["MCPToolRequireApproval", str] + """ + + name: str + """Optional user-defined name for this tool or configuration.""" + description: str + """Optional user-defined description for this tool or configuration.""" + tool_configs: dict[str, "ToolConfig"] + """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.""" + type: Required[Literal[ToolboxToolType.WEB_IQ_PREVIEW]] + """Required. WEB_IQ_PREVIEW.""" + project_connection_id: Required[str] + """The ID of the WebIQ project connection. Required.""" + server_label: str + """The label of the WebIQ MCP server to connect to. When omitted, the service defaults to + connection name extracted from project_connection_id.""" + require_approval: Optional[Union["MCPToolRequireApproval", str]] + """Whether the agent requires approval before executing actions. When omitted, the service + defaults to \"always\". Is either a MCPToolRequireApproval type or a str type.""" + + class WebSearchApproximateLocation(TypedDict, total=False): """Web search approximate location. @@ -11694,6 +11883,7 @@ class UpdateToolboxRequest1(TypedDict, total=False): Tool = Union[ + A2ATool, A2APreviewTool, ApplyPatchToolParam, AzureAISearchTool, @@ -11720,11 +11910,13 @@ class UpdateToolboxRequest1(TypedDict, total=False): SharepointPreviewTool, FunctionShellToolParam, ToolSearchToolParam, + WebIQPreviewTool, WebSearchTool, WebSearchPreviewTool, WorkIQPreviewTool, ] ToolboxTool = Union[ + A2AToolboxTool, A2APreviewToolboxTool, AzureAISearchToolboxTool, BrowserAutomationPreviewToolboxTool, @@ -11736,6 +11928,7 @@ class UpdateToolboxRequest1(TypedDict, total=False): ReminderPreviewToolboxTool, ToolSearchToolboxTool, ToolboxSearchPreviewToolboxTool, + WebIQPreviewToolboxTool, WebSearchToolboxTool, WorkIQPreviewToolboxTool, ] diff --git a/sdk/ai/azure-ai-projects/docs/public-methods.md b/sdk/ai/azure-ai-projects/docs/public-methods.md index bb82f621bd9f..c97415c1f34d 100644 --- a/sdk/ai/azure-ai-projects/docs/public-methods.md +++ b/sdk/ai/azure-ai-projects/docs/public-methods.md @@ -4,16 +4,16 @@ This document lists all public methods available on `AIProjectClient` and its su ## Summary -There are a total of 153 unique public methods: +There are a total of 154 unique public methods: - 5 stable methods on the client -- 67 stable methods on top-level sub-clients +- 68 stable methods on top-level sub-clients - 81 beta methods on nested beta sub-clients ### Top-level sub-clients (stable operations) | Subclient | Class Name | Methods Count | |-----------|------------|----------------| -| `agents` | AgentsOperations | 23 | +| `agents` | AgentsOperations | 24 | | `agent_endpoint_conversations` | AgentEndpointConversationsOperations | 12 | | `connections` | ConnectionsOperations | 3 | | `datasets` | DatasetsOperations | 9 | @@ -69,6 +69,7 @@ Alphabetically sorted. An asterisk at the end of the method name means is a hand .agents.download_code .agents.download_session_file .agents.enable +.agents.generate_agent* .agents.get .agents.get_session .agents.get_session_log_stream diff --git a/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py b/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py index 8e7660f50680..2f2692095394 100644 --- a/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py +++ b/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py @@ -85,6 +85,10 @@ "agents.create_version", "WorkflowAgents=V1Preview,ExternalAgents=V1Preview,VoiceAgents=V1Preview,DraftAgents=V1Preview,AgentsOptimization=V2Preview", ), + pytest.param( + "agents.generate_agent", + "WorkflowAgents=V1Preview,ExternalAgents=V1Preview,VoiceAgents=V1Preview,DraftAgents=V1Preview,AgentsOptimization=V2Preview", + ), pytest.param( "evaluation_rules.create_or_update", "Evaluations=V1Preview", diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml b/sdk/ai/azure-ai-projects/tsp-location.yaml deleted file mode 100644 index db28a996969a..000000000000 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml +++ /dev/null @@ -1,28 +0,0 @@ -directory: specification/ai-foundry/data-plane/Foundry/src/sdk-python-js-azure-ai-projects -commit: 4b80e4d91a9c7940812f8c0e9c07611eb9f5be2e -repo: Azure/azure-rest-api-specs -additionalDirectories: -- specification/ai-foundry/data-plane/Foundry/src/agents -- specification/ai-foundry/data-plane/Foundry/src/agents-optimization -- specification/ai-foundry/data-plane/Foundry/src/agents-session-files -- specification/ai-foundry/data-plane/Foundry/src/common -- specification/ai-foundry/data-plane/Foundry/src/connections -- specification/ai-foundry/data-plane/Foundry/src/data_generation_jobs -- specification/ai-foundry/data-plane/Foundry/src/datasets -- specification/ai-foundry/data-plane/Foundry/src/deployments -- specification/ai-foundry/data-plane/Foundry/src/evaluation-rules -- specification/ai-foundry/data-plane/Foundry/src/evaluation-taxonomies -- specification/ai-foundry/data-plane/Foundry/src/evaluators -- specification/ai-foundry/data-plane/Foundry/src/indexes -- specification/ai-foundry/data-plane/Foundry/src/insights -- specification/ai-foundry/data-plane/Foundry/src/memory-stores -- specification/ai-foundry/data-plane/Foundry/src/models -- specification/ai-foundry/data-plane/Foundry/src/openai -- specification/ai-foundry/data-plane/Foundry/src/red-teams -- specification/ai-foundry/data-plane/Foundry/src/routines -- specification/ai-foundry/data-plane/Foundry/src/schedules -- specification/ai-foundry/data-plane/Foundry/src/sdk-common -- specification/ai-foundry/data-plane/Foundry/src/skills -- specification/ai-foundry/data-plane/Foundry/src/toolboxes -- specification/ai-foundry/data-plane/Foundry/src/tools -- specification/ai-foundry/data-plane/Foundry/src/voice-agents diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml.saved b/sdk/ai/azure-ai-projects/tsp-location.yaml.saved index 259cd043ef1f..7d086bbc82a2 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml.saved +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml.saved @@ -1,5 +1,5 @@ directory: specification/ai-foundry/data-plane/Foundry/src/sdk-python-js-azure-ai-projects -commit: 9a1ee382eb32ff2af52911bf3106d97d0a6ab226 +commit: dcfcf524cecab2843efb6a7e1645aa135aa1622e repo: Azure/azure-rest-api-specs additionalDirectories: - specification/ai-foundry/data-plane/Foundry/src/agents @@ -25,3 +25,4 @@ additionalDirectories: - specification/ai-foundry/data-plane/Foundry/src/skills - specification/ai-foundry/data-plane/Foundry/src/toolboxes - specification/ai-foundry/data-plane/Foundry/src/tools +- specification/ai-foundry/data-plane/Foundry/src/voice-agents From 2b31ed1af7e979c217d90a790df0bbbc5d714995 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Thu, 20 Aug 2026 21:10:37 -0700 Subject: [PATCH 38/56] Fix sphinx docs build and pyright/mypy/pylint errors - Fix RST bullet-list continuation-line indentation in VoiceAudioOutputConfig (types.py + models/_models.py) and VoiceConversationStatus (models/_enums.py), fixing sphinx -W docs build failure (3 docutils warnings -> 0) - Fix generate_agent single-overload merge + VoiceResponse Optional-narrowing (previously fixed, re-dropped by main merge, now re-fixed) -- resolved 4 of 12 pyright errors - Fix begin_create_optimization_job/begin_create_generation_job job parameter type in _patch_agents.py, _patch_datasets.py, _patch_evaluators.py (+ async): was typed as generic JSON alias, but generated base class expects the specific _types. TypedDict -- resolves remaining pyright/mypy arg-type and override-incompatible errors - Re-add all corresponding PostEmitter.ps1 fixes so they survive future regens - Verified CI-exact clean: pyright 0 errors, mypy (--ignore-missing-imports) 0 errors, pylint (repo pylintrc) 10.00/10 --- sdk/ai/azure-ai-projects/PostEmitter.ps1 | 59 +++++++++++++++++++ .../aio/operations/_patch_agents_async.py | 8 +-- .../aio/operations/_patch_datasets_async.py | 11 ++-- .../aio/operations/_patch_evaluators_async.py | 11 ++-- .../azure/ai/projects/models/_enums.py | 8 +-- .../azure/ai/projects/models/_models.py | 7 ++- .../ai/projects/operations/_patch_agents.py | 8 +-- .../ai/projects/operations/_patch_datasets.py | 11 ++-- .../projects/operations/_patch_evaluators.py | 11 ++-- .../azure/ai/projects/types.py | 7 ++- 10 files changed, 95 insertions(+), 46 deletions(-) diff --git a/sdk/ai/azure-ai-projects/PostEmitter.ps1 b/sdk/ai/azure-ai-projects/PostEmitter.ps1 index a5da85c8b185..2cf7063e2f4b 100644 --- a/sdk/ai/azure-ai-projects/PostEmitter.ps1 +++ b/sdk/ai/azure-ai-projects/PostEmitter.ps1 @@ -115,6 +115,65 @@ foreach ($f in $files) { Set-Content $f $c -NoNewline } +# Fix Sphinx docutils "Bullet list ends without a blank line; unexpected unindent" warnings in +# VoiceAudioOutputConfig (types.py + models/_models.py) and VoiceConversationStatus +# (models/_enums.py). The emitter wraps long bullet-item lines without indenting the +# continuation lines to align with the bullet's text, and (for VoiceAudioOutputConfig) runs the +# trailing summary sentence straight into the last bullet with no blank line to end the list. +$oldVoiceAudioOutputConfig = @" + * `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. +"@ +$newVoiceAudioOutputConfig = @" + * `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. +"@ +$files = 'azure\ai\projects\types.py', 'azure\ai\projects\models\_models.py' +foreach ($f in $files) { + $c = Get-Content $f -Raw + $c = $c.Replace($oldVoiceAudioOutputConfig, $newVoiceAudioOutputConfig) + Set-Content $f $c -NoNewline +} + +$f = 'azure\ai\projects\models\_enums.py' +$c = Get-Content $f -Raw +$c = $c.Replace( +@" + * `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. +"@ +) +Set-Content $f $c -NoNewline + # A block of code in the implementation of "list_memories", in both sync # and async _operations.py files, needs to be moved up. It's emitted in the wrong place, # in the inline function named "prepare_request". Instead it should be moved up into the diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py index 77bdb8ae3154..e247fdef5a45 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py @@ -20,7 +20,7 @@ JSON, _Unset, ) -from ... import models as _models +from ... import models as _models, types as _types from ..._utils.model_base import _deserialize from ...models import AsyncAgentOptimizationLROPoller from ...operations._patch_agents import _compute_sha256_from_stream @@ -387,7 +387,7 @@ async def begin_create_optimization_job( @overload async def begin_create_optimization_job( self, - job: JSON, + job: _types.AgentOptimizationJob, *, operation_id: Optional[str] = None, content_type: str = "application/json", @@ -407,7 +407,7 @@ async def begin_create_optimization_job( @distributed_trace_async async def begin_create_optimization_job( self, - job: Union[_models.AgentOptimizationJob, JSON, IO[bytes]], + job: Union[_models.AgentOptimizationJob, _types.AgentOptimizationJob, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any, @@ -415,7 +415,7 @@ async def begin_create_optimization_job( """Create an agent optimization job. :param job: The job to create. Required. - :type job: ~azure.ai.projects.models.AgentOptimizationJob or JSON or IO[bytes] + :type job: ~azure.ai.projects.models.AgentOptimizationJob or ~azure.ai.projects.types.AgentOptimizationJob or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_datasets_async.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_datasets_async.py index 6612e31eacad..304fc8d14b75 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_datasets_async.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_datasets_async.py @@ -12,7 +12,6 @@ import re import logging from typing import Any, IO, Tuple, Optional, Union, cast, overload -from collections.abc import MutableMapping from pathlib import Path from urllib.parse import urlsplit from azure.storage.blob.aio import ContainerClient @@ -25,7 +24,7 @@ BetaDatasetsOperations as BetaDatasetsOperationsGenerated, DatasetsOperations as DatasetsOperationsGenerated, ) -from ... import models as _models +from ... import models as _models, types as _types from ..._utils.model_base import _deserialize from ...models import AsyncDatasetGenerationLROPoller from ...models._models import ( @@ -38,8 +37,6 @@ logger = logging.getLogger(__name__) -JSON = MutableMapping[str, Any] - class BetaDatasetsOperations(BetaDatasetsOperationsGenerated): """Custom async operations for beta data generation jobs.""" @@ -57,7 +54,7 @@ async def begin_create_generation_job( @overload async def begin_create_generation_job( self, - job: JSON, + job: _types.DataGenerationJob, *, operation_id: Optional[str] = None, content_type: str = "application/json", @@ -77,7 +74,7 @@ async def begin_create_generation_job( @distributed_trace_async async def begin_create_generation_job( self, - job: Union[_models.DataGenerationJob, JSON, IO[bytes]], + job: Union[_models.DataGenerationJob, _types.DataGenerationJob, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any, @@ -85,7 +82,7 @@ async def begin_create_generation_job( """Create a data generation job. :param job: The job to create. Required. - :type job: ~azure.ai.projects.models.DataGenerationJob or JSON or IO[bytes] + :type job: ~azure.ai.projects.models.DataGenerationJob or ~azure.ai.projects.types.DataGenerationJob or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_evaluators_async.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_evaluators_async.py index 50876c48cdfe..1986db0501bf 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_evaluators_async.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_evaluators_async.py @@ -5,7 +5,6 @@ # ------------------------------------ """Custom async evaluator operations.""" -from collections.abc import MutableMapping from typing import Any, IO, Optional, Union, cast, overload from azure.core.polling import AsyncNoPolling, AsyncPollingMethod @@ -14,12 +13,10 @@ from azure.core.utils import case_insensitive_dict from ._operations import BetaEvaluatorsOperations as BetaEvaluatorsOperationsGenerated -from ... import models as _models +from ... import models as _models, types as _types from ..._utils.model_base import _deserialize from ...models import AsyncEvaluatorGenerationLROPoller -JSON = MutableMapping[str, Any] - class BetaEvaluatorsOperations(BetaEvaluatorsOperationsGenerated): """Custom async operations for beta evaluator generation jobs.""" @@ -37,7 +34,7 @@ async def begin_create_generation_job( @overload async def begin_create_generation_job( self, - job: JSON, + job: _types.EvaluatorGenerationJob, *, operation_id: Optional[str] = None, content_type: str = "application/json", @@ -57,7 +54,7 @@ async def begin_create_generation_job( @distributed_trace_async async def begin_create_generation_job( self, - job: Union[_models.EvaluatorGenerationJob, JSON, IO[bytes]], + job: Union[_models.EvaluatorGenerationJob, _types.EvaluatorGenerationJob, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any, @@ -65,7 +62,7 @@ async def begin_create_generation_job( """Create an evaluator generation job. :param job: The job to create. Required. - :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or JSON or IO[bytes] + :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or ~azure.ai.projects.types.EvaluatorGenerationJob or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str 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 441f60a38aeb..f66fd2c6b88e 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 @@ -1702,12 +1702,12 @@ 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. + 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. + 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. + 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 9894806f100d..6b410f34e8c0 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 @@ -22988,13 +22988,14 @@ class VoiceAudioOutputConfig(_Model): * `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`. + `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. + `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 diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py index 19b047b10be3..b7580f63baa2 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py @@ -22,7 +22,7 @@ JSON, _Unset, ) -from .. import models as _models +from .. import models as _models, types as _types from .._utils.model_base import _deserialize from ..models import AgentOptimizationLROPoller from ..models._patch import ( @@ -421,7 +421,7 @@ def begin_create_optimization_job( @overload def begin_create_optimization_job( self, - job: JSON, + job: _types.AgentOptimizationJob, *, operation_id: Optional[str] = None, content_type: str = "application/json", @@ -441,7 +441,7 @@ def begin_create_optimization_job( @distributed_trace def begin_create_optimization_job( self, - job: Union[_models.AgentOptimizationJob, JSON, IO[bytes]], + job: Union[_models.AgentOptimizationJob, _types.AgentOptimizationJob, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any, @@ -449,7 +449,7 @@ def begin_create_optimization_job( """Create an agent optimization job. :param job: The job to create. Required. - :type job: ~azure.ai.projects.models.AgentOptimizationJob or JSON or IO[bytes] + :type job: ~azure.ai.projects.models.AgentOptimizationJob or ~azure.ai.projects.types.AgentOptimizationJob or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_datasets.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_datasets.py index be33b5a2763d..df1da9920a5c 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_datasets.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_datasets.py @@ -12,7 +12,6 @@ import re import logging from typing import Any, IO, Tuple, Optional, Union, cast, overload -from collections.abc import MutableMapping from pathlib import Path from urllib.parse import urlsplit from azure.storage.blob import ContainerClient @@ -24,7 +23,7 @@ BetaDatasetsOperations as BetaDatasetsOperationsGenerated, DatasetsOperations as DatasetsOperationsGenerated, ) -from .. import models as _models +from .. import models as _models, types as _types from .._utils.model_base import _deserialize from ..models import DatasetGenerationLROPoller from ..models._models import ( @@ -37,8 +36,6 @@ logger = logging.getLogger(__name__) -JSON = MutableMapping[str, Any] - class BetaDatasetsOperations(BetaDatasetsOperationsGenerated): """Custom operations for beta data generation jobs.""" @@ -56,7 +53,7 @@ def begin_create_generation_job( @overload def begin_create_generation_job( self, - job: JSON, + job: _types.DataGenerationJob, *, operation_id: Optional[str] = None, content_type: str = "application/json", @@ -76,7 +73,7 @@ def begin_create_generation_job( @distributed_trace def begin_create_generation_job( self, - job: Union[_models.DataGenerationJob, JSON, IO[bytes]], + job: Union[_models.DataGenerationJob, _types.DataGenerationJob, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any, @@ -84,7 +81,7 @@ def begin_create_generation_job( """Create a data generation job. :param job: The job to create. Required. - :type job: ~azure.ai.projects.models.DataGenerationJob or JSON or IO[bytes] + :type job: ~azure.ai.projects.models.DataGenerationJob or ~azure.ai.projects.types.DataGenerationJob or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_evaluators.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_evaluators.py index 240e6afef83c..73815fcf08f0 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_evaluators.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_evaluators.py @@ -5,7 +5,6 @@ # ------------------------------------ """Custom evaluator operations.""" -from collections.abc import MutableMapping from typing import Any, IO, Optional, Union, cast, overload from azure.core.polling import NoPolling, PollingMethod @@ -14,12 +13,10 @@ from azure.core.utils import case_insensitive_dict from ._operations import BetaEvaluatorsOperations as BetaEvaluatorsOperationsGenerated -from .. import models as _models +from .. import models as _models, types as _types from .._utils.model_base import _deserialize from ..models import EvaluatorGenerationLROPoller -JSON = MutableMapping[str, Any] - class BetaEvaluatorsOperations(BetaEvaluatorsOperationsGenerated): """Custom operations for beta evaluator generation jobs.""" @@ -37,7 +34,7 @@ def begin_create_generation_job( @overload def begin_create_generation_job( self, - job: JSON, + job: _types.EvaluatorGenerationJob, *, operation_id: Optional[str] = None, content_type: str = "application/json", @@ -57,7 +54,7 @@ def begin_create_generation_job( @distributed_trace def begin_create_generation_job( self, - job: Union[_models.EvaluatorGenerationJob, JSON, IO[bytes]], + job: Union[_models.EvaluatorGenerationJob, _types.EvaluatorGenerationJob, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any, @@ -65,7 +62,7 @@ def begin_create_generation_job( """Create an evaluator generation job. :param job: The job to create. Required. - :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or JSON or IO[bytes] + :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or ~azure.ai.projects.types.EvaluatorGenerationJob or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/types.py b/sdk/ai/azure-ai-projects/azure/ai/projects/types.py index 5b63dbc0d9d7..62850fe24bc6 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/types.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/types.py @@ -10357,13 +10357,14 @@ class VoiceAudioOutputConfig(TypedDict, total=False): * `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`. + `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. + `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 From dbd5dd41d7ee40acedda76f33c06c5b7ad37e685 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Fri, 21 Aug 2026 11:03:08 -0700 Subject: [PATCH 39/56] Regenerate SDK from TypeSpec commit 28f4aa2 (align realtime item hierarchy) - VoiceMessageItem class and VoiceConversationItemType enum removed; voice conversation item classes (VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, VoiceFunctionCallOutputItem, VoiceMcp*Item) now extend the corresponding OpenAI Realtime conversation-item classes directly. VoiceConversationItem is now a Union type alias instead of a model class. - New RealtimeConversationItem, RealtimeConversationItemMessage(System/User/Assistant), RealtimeConversationItemFunctionCall(Output), RealtimeMCPListTools, RealtimeMCPToolCall, RealtimeMCPApprovalRequest/Response classes and RealtimeConversationItemType enum exposed. - Reapplied PostEmitter.ps1 fixes that failed to auto-apply this run: docstring indentation for VoiceConversationStatus/VoiceAudioOutputConfig, and VoiceResponse id/conversation_id reportIncompatibleVariableOverride type:ignore. - Updated tsp-location.yaml.saved to the new commit hash. Verified: pyright 0 errors, mypy clean, pylint 10.00/10, sphinx docs build succeeds. No sample/test changes needed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../azure-ai-projects/apiview-properties.json | 19 +- .../azure/ai/projects/_unions.py | 11 + .../ai/projects/aio/operations/_operations.py | 59 +- .../azure/ai/projects/models/__init__.py | 30 +- .../azure/ai/projects/models/_enums.py | 36 +- .../azure/ai/projects/models/_models.py | 1217 ++++++++++++----- .../ai/projects/operations/_operations.py | 59 +- .../azure/ai/projects/types.py | 687 +++++++--- .../azure-ai-projects/tsp-location.yaml.saved | 2 +- 9 files changed, 1482 insertions(+), 638 deletions(-) diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index a7d4d4ab2ae9..18ae677dc828 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -295,14 +295,25 @@ "azure.ai.projects.models.RealtimeAudioFormatsAudioPcm": "OpenAI.RealtimeAudioFormatsAudioPcm", "azure.ai.projects.models.RealtimeAudioFormatsAudioPcma": "OpenAI.RealtimeAudioFormatsAudioPcma", "azure.ai.projects.models.RealtimeAudioFormatsAudioPcmu": "OpenAI.RealtimeAudioFormatsAudioPcmu", + "azure.ai.projects.models.RealtimeConversationItem": "OpenAI.RealtimeConversationItem", + "azure.ai.projects.models.RealtimeConversationItemFunctionCall": "OpenAI.RealtimeConversationItemFunctionCall", + "azure.ai.projects.models.RealtimeConversationItemFunctionCallOutput": "OpenAI.RealtimeConversationItemFunctionCallOutput", + "azure.ai.projects.models.RealtimeConversationItemMessage": "OpenAI.RealtimeConversationItemMessage", + "azure.ai.projects.models.RealtimeConversationItemMessageAssistant": "OpenAI.RealtimeConversationItemMessageAssistant", "azure.ai.projects.models.RealtimeConversationItemMessageAssistantContent": "OpenAI.RealtimeConversationItemMessageAssistantContent", + "azure.ai.projects.models.RealtimeConversationItemMessageSystem": "OpenAI.RealtimeConversationItemMessageSystem", "azure.ai.projects.models.RealtimeConversationItemMessageSystemContent": "OpenAI.RealtimeConversationItemMessageSystemContent", + "azure.ai.projects.models.RealtimeConversationItemMessageUser": "OpenAI.RealtimeConversationItemMessageUser", "azure.ai.projects.models.RealtimeConversationItemMessageUserContent": "OpenAI.RealtimeConversationItemMessageUserContent", "azure.ai.projects.models.RealtimeFunctionTool": "OpenAI.RealtimeFunctionTool", "azure.ai.projects.models.RealtimeFunctionToolParameters": "OpenAI.RealtimeFunctionToolParameters", + "azure.ai.projects.models.RealtimeMCPApprovalRequest": "OpenAI.RealtimeMCPApprovalRequest", + "azure.ai.projects.models.RealtimeMCPApprovalResponse": "OpenAI.RealtimeMCPApprovalResponse", "azure.ai.projects.models.RealtimeMCPError": "OpenAI.RealtimeMCPError", "azure.ai.projects.models.RealtimeMCPHTTPError": "OpenAI.RealtimeMCPHTTPError", + "azure.ai.projects.models.RealtimeMCPListTools": "OpenAI.RealtimeMCPListTools", "azure.ai.projects.models.RealtimeMCPProtocolError": "OpenAI.RealtimeMCPProtocolError", + "azure.ai.projects.models.RealtimeMCPToolCall": "OpenAI.RealtimeMCPToolCall", "azure.ai.projects.models.RealtimeMCPToolExecutionError": "OpenAI.RealtimeMCPToolExecutionError", "azure.ai.projects.models.RealtimeReasoning": "OpenAI.RealtimeReasoning", "azure.ai.projects.models.RealtimeResponseStatusDetails": "OpenAI.RealtimeResponseStatusDetails", @@ -486,8 +497,6 @@ "azure.ai.projects.models.VoiceAgentStaticInterimResponseConfig": "Azure.AI.Projects.VoiceAgentStaticInterimResponseConfig", "azure.ai.projects.models.VoiceAgentTranscriptionPhrase": "Azure.AI.Projects.VoiceAgentTranscriptionPhrase", "azure.ai.projects.models.VoiceAgentTranscriptionWord": "Azure.AI.Projects.VoiceAgentTranscriptionWord", - "azure.ai.projects.models.VoiceConversationItem": "Azure.AI.Projects.VoiceConversationItem", - "azure.ai.projects.models.VoiceMessageItem": "Azure.AI.Projects.VoiceMessageItem", "azure.ai.projects.models.VoiceAssistantMessageItem": "Azure.AI.Projects.VoiceAssistantMessageItem", "azure.ai.projects.models.VoiceAudioConfig": "Azure.AI.Projects.VoiceAudioConfig", "azure.ai.projects.models.VoiceAudioFormat": "Azure.AI.Projects.VoiceAudioFormat", @@ -635,9 +644,9 @@ "azure.ai.projects.models.SessionLogEventType": "Azure.AI.Projects.SessionLogEventType", "azure.ai.projects.models.VoiceAgentWebSocketSubprotocol": "Azure.AI.Projects.VoiceAgentWebSocketSubprotocol", "azure.ai.projects.models.VoiceConversationStatus": "Azure.AI.Projects.VoiceConversationStatus", - "azure.ai.projects.models.VoiceConversationItemType": "Azure.AI.Projects.VoiceConversationItemType", - "azure.ai.projects.models.RealtimeMcpErrorType": "OpenAI.RealtimeMcpErrorType", "azure.ai.projects.models.RealtimeConversationItemMessageType": "OpenAI.RealtimeConversationItemMessageType", + "azure.ai.projects.models.RealtimeConversationItemType": "OpenAI.RealtimeConversationItemType", + "azure.ai.projects.models.RealtimeMcpErrorType": "OpenAI.RealtimeMcpErrorType", "azure.ai.projects.models.RealtimeAudioFormatsType": "OpenAI.RealtimeAudioFormatsType", "azure.ai.projects.models.VoiceAudioRole": "Azure.AI.Projects.VoiceAudioRole", "azure.ai.projects.models.VoiceAudioContainerFormat": "Azure.AI.Projects.VoiceAudioContainerFormat", @@ -784,5 +793,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": "ffc293e5009c" + "CrossLanguageVersion": "9872c35ac0b9" } \ 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 b4afefa8ae51..c58f9a73aea9 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,15 @@ VoiceAgentInterimResponse = Union[ "_models.VoiceAgentStaticInterimResponseConfig", "_models.VoiceAgentLlmInterimResponseConfig" ] +VoiceConversationItem = Union[ + "_models.VoiceSystemMessageItem", + "_models.VoiceUserMessageItem", + "_models.VoiceAssistantMessageItem", + "_models.VoiceFunctionCallItem", + "_models.VoiceFunctionCallOutputItem", + "_models.VoiceMcpListToolsItem", + "_models.VoiceMcpCallItem", + "_models.VoiceMcpApprovalRequestItem", + "_models.VoiceMcpApprovalResponseItem", +] GenerateAgentRequest = "_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 3c78cbc8e408..bbf45cb8dc64 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 @@ -3195,7 +3195,7 @@ def list_agent_conversation_response_items( order: Optional[Union[str, _models.PageOrder]] = None, before: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.VoiceConversationItem"]: + ) -> AsyncItemPaged["_unions.VoiceConversationItem"]: """List items produced by a voice agent conversation response. Returns a paged collection of the output items produced by a specific response (the response's @@ -3223,15 +3223,25 @@ def list_agent_conversation_response_items( 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 VoiceConversationItem + :return: An iterator like instance of VoiceSystemMessageItem or VoiceUserMessageItem or + VoiceAssistantMessageItem or VoiceFunctionCallItem or VoiceFunctionCallOutputItem or + VoiceMcpListToolsItem or VoiceMcpCallItem or VoiceMcpApprovalRequestItem or + VoiceMcpApprovalResponseItem :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.VoiceConversationItem] + ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.VoiceSystemMessageItem or + ~azure.ai.projects.models.VoiceUserMessageItem or + ~azure.ai.projects.models.VoiceAssistantMessageItem or + ~azure.ai.projects.models.VoiceFunctionCallItem or + ~azure.ai.projects.models.VoiceFunctionCallOutputItem or + ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem + or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or + ~azure.ai.projects.models.VoiceMcpApprovalResponseItem] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.VoiceConversationItem]] = kwargs.pop("cls", None) + cls: ClsType[List["_unions.VoiceConversationItem"]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3264,7 +3274,7 @@ def prepare_request(_continuation_token=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.VoiceConversationItem], + List["_unions.VoiceConversationItem"], deserialized.get("data", []), ) if cls: @@ -3302,7 +3312,7 @@ def list_agent_conversation_items( order: Optional[Union[str, _models.PageOrder]] = None, before: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.VoiceConversationItem"]: + ) -> AsyncItemPaged["_unions.VoiceConversationItem"]: """List items in a voice agent conversation. Returns a paged collection of items — the complete ordered conversation history, including user @@ -3327,15 +3337,25 @@ def list_agent_conversation_items( 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 VoiceConversationItem + :return: An iterator like instance of VoiceSystemMessageItem or VoiceUserMessageItem or + VoiceAssistantMessageItem or VoiceFunctionCallItem or VoiceFunctionCallOutputItem or + VoiceMcpListToolsItem or VoiceMcpCallItem or VoiceMcpApprovalRequestItem or + VoiceMcpApprovalResponseItem :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.VoiceConversationItem] + ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.VoiceSystemMessageItem or + ~azure.ai.projects.models.VoiceUserMessageItem or + ~azure.ai.projects.models.VoiceAssistantMessageItem or + ~azure.ai.projects.models.VoiceFunctionCallItem or + ~azure.ai.projects.models.VoiceFunctionCallOutputItem or + ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem + or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or + ~azure.ai.projects.models.VoiceMcpApprovalResponseItem] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.VoiceConversationItem]] = kwargs.pop("cls", None) + cls: ClsType[List["_unions.VoiceConversationItem"]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3367,7 +3387,7 @@ def prepare_request(_continuation_token=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.VoiceConversationItem], + List["_unions.VoiceConversationItem"], deserialized.get("data", []), ) if cls: @@ -3398,7 +3418,7 @@ async def get_next(_continuation_token=None): @distributed_trace_async async def get_agent_conversation_item( self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any - ) -> _models.VoiceConversationItem: + ) -> "_unions.VoiceConversationItem": """Get a voice agent conversation item. Retrieves a single item from the specified conversation by its id, including its transcript. An @@ -3413,8 +3433,17 @@ async def get_agent_conversation_item( :type conversation_id: str :param item_id: The id of the conversation item to retrieve. Required. :type item_id: str - :return: VoiceConversationItem. The VoiceConversationItem is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.VoiceConversationItem + :return: VoiceSystemMessageItem or VoiceUserMessageItem or VoiceAssistantMessageItem or + VoiceFunctionCallItem or VoiceFunctionCallOutputItem or VoiceMcpListToolsItem or + VoiceMcpCallItem or VoiceMcpApprovalRequestItem or VoiceMcpApprovalResponseItem + :rtype: ~azure.ai.projects.models.VoiceSystemMessageItem or + ~azure.ai.projects.models.VoiceUserMessageItem or + ~azure.ai.projects.models.VoiceAssistantMessageItem or + ~azure.ai.projects.models.VoiceFunctionCallItem or + ~azure.ai.projects.models.VoiceFunctionCallOutputItem or + ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem + or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or + ~azure.ai.projects.models.VoiceMcpApprovalResponseItem :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3428,7 +3457,7 @@ async def get_agent_conversation_item( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.VoiceConversationItem] = kwargs.pop("cls", None) + cls: ClsType["_unions.VoiceConversationItem"] = kwargs.pop("cls", None) _request = build_agent_endpoint_conversations_get_agent_conversation_item_request( agent_name=agent_name, @@ -3467,7 +3496,7 @@ async def get_agent_conversation_item( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.VoiceConversationItem, response.json()) + deserialized = _deserialize("_unions.VoiceConversationItem", response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore 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 63c2dd411032..18c70de26437 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 @@ -296,14 +296,25 @@ RealtimeAudioFormatsAudioPcm, RealtimeAudioFormatsAudioPcma, RealtimeAudioFormatsAudioPcmu, + RealtimeConversationItem, + RealtimeConversationItemFunctionCall, + RealtimeConversationItemFunctionCallOutput, + RealtimeConversationItemMessage, + RealtimeConversationItemMessageAssistant, RealtimeConversationItemMessageAssistantContent, + RealtimeConversationItemMessageSystem, RealtimeConversationItemMessageSystemContent, + RealtimeConversationItemMessageUser, RealtimeConversationItemMessageUserContent, RealtimeFunctionTool, RealtimeFunctionToolParameters, + RealtimeMCPApprovalRequest, + RealtimeMCPApprovalResponse, RealtimeMCPError, RealtimeMCPHTTPError, + RealtimeMCPListTools, RealtimeMCPProtocolError, + RealtimeMCPToolCall, RealtimeMCPToolExecutionError, RealtimeReasoning, RealtimeResponseStatusDetails, @@ -507,7 +518,6 @@ VoiceAzureSemanticVadMultilingualTurnDetection, VoiceAzureSemanticVadTurnDetection, VoiceConversation, - VoiceConversationItem, VoiceEndOfUtteranceDetection, VoiceFunctionCallItem, VoiceFunctionCallOutputItem, @@ -518,7 +528,6 @@ VoiceMcpApprovalResponseItem, VoiceMcpCallItem, VoiceMcpListToolsItem, - VoiceMessageItem, VoiceNoiseReduction, VoiceRecordingChannelLayout, VoiceRecordingResponse, @@ -614,6 +623,7 @@ RealtimeAudioFormatsType, RealtimeClientEventType, RealtimeConversationItemMessageType, + RealtimeConversationItemType, RealtimeMcpErrorType, RealtimeReasoningEffort, RealtimeServerEventType, @@ -663,7 +673,6 @@ VoiceAudioTimestampType, VoiceAvatarOutputProtocol, VoiceAvatarType, - VoiceConversationItemType, VoiceConversationStatus, VoiceEndOfUtteranceDetectionModel, VoiceEndOfUtteranceThresholdLevel, @@ -961,14 +970,25 @@ "RealtimeAudioFormatsAudioPcm", "RealtimeAudioFormatsAudioPcma", "RealtimeAudioFormatsAudioPcmu", + "RealtimeConversationItem", + "RealtimeConversationItemFunctionCall", + "RealtimeConversationItemFunctionCallOutput", + "RealtimeConversationItemMessage", + "RealtimeConversationItemMessageAssistant", "RealtimeConversationItemMessageAssistantContent", + "RealtimeConversationItemMessageSystem", "RealtimeConversationItemMessageSystemContent", + "RealtimeConversationItemMessageUser", "RealtimeConversationItemMessageUserContent", "RealtimeFunctionTool", "RealtimeFunctionToolParameters", + "RealtimeMCPApprovalRequest", + "RealtimeMCPApprovalResponse", "RealtimeMCPError", "RealtimeMCPHTTPError", + "RealtimeMCPListTools", "RealtimeMCPProtocolError", + "RealtimeMCPToolCall", "RealtimeMCPToolExecutionError", "RealtimeReasoning", "RealtimeResponseStatusDetails", @@ -1172,7 +1192,6 @@ "VoiceAzureSemanticVadMultilingualTurnDetection", "VoiceAzureSemanticVadTurnDetection", "VoiceConversation", - "VoiceConversationItem", "VoiceEndOfUtteranceDetection", "VoiceFunctionCallItem", "VoiceFunctionCallOutputItem", @@ -1183,7 +1202,6 @@ "VoiceMcpApprovalResponseItem", "VoiceMcpCallItem", "VoiceMcpListToolsItem", - "VoiceMessageItem", "VoiceNoiseReduction", "VoiceRecordingChannelLayout", "VoiceRecordingResponse", @@ -1276,6 +1294,7 @@ "RealtimeAudioFormatsType", "RealtimeClientEventType", "RealtimeConversationItemMessageType", + "RealtimeConversationItemType", "RealtimeMcpErrorType", "RealtimeReasoningEffort", "RealtimeServerEventType", @@ -1325,7 +1344,6 @@ "VoiceAudioTimestampType", "VoiceAvatarOutputProtocol", "VoiceAvatarType", - "VoiceConversationItemType", "VoiceConversationStatus", "VoiceEndOfUtteranceDetectionModel", "VoiceEndOfUtteranceThresholdLevel", 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 f66fd2c6b88e..198080e2cab6 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 @@ -929,6 +929,23 @@ class RealtimeConversationItemMessageType(str, Enum, metaclass=CaseInsensitiveEn """ASSISTANT.""" +class RealtimeConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of RealtimeConversationItemType.""" + + FUNCTION_CALL = "function_call" + """FUNCTION_CALL.""" + FUNCTION_CALL_OUTPUT = "function_call_output" + """FUNCTION_CALL_OUTPUT.""" + MCP_APPROVAL_RESPONSE = "mcp_approval_response" + """MCP_APPROVAL_RESPONSE.""" + MCP_LIST_TOOLS = "mcp_list_tools" + """MCP_LIST_TOOLS.""" + MCP_CALL = "mcp_call" + """MCP_CALL.""" + MCP_APPROVAL_REQUEST = "mcp_approval_request" + """MCP_APPROVAL_REQUEST.""" + + class RealtimeMcpErrorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of RealtimeMcpErrorType.""" @@ -1679,25 +1696,6 @@ class VoiceAvatarType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """PHOTO_AVATAR.""" -class VoiceConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of a persisted voice conversation item.""" - - MESSAGE = "message" - """A message item.""" - FUNCTION_CALL = "function_call" - """A function-call request item.""" - FUNCTION_CALL_OUTPUT = "function_call_output" - """A function-call output item.""" - MCP_LIST_TOOLS = "mcp_list_tools" - """An MCP list-tools item.""" - MCP_CALL = "mcp_call" - """An MCP call item.""" - MCP_APPROVAL_REQUEST = "mcp_approval_request" - """An MCP approval request item.""" - MCP_APPROVAL_RESPONSE = "mcp_approval_response" - """An MCP approval response item.""" - - class VoiceConversationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The lifecycle status of a persisted voice conversation: 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 6b410f34e8c0..d9de3e292211 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 @@ -44,6 +44,7 @@ RealtimeAudioFormatsType, RealtimeClientEventType, RealtimeConversationItemMessageType, + RealtimeConversationItemType, RealtimeMcpErrorType, RealtimeServerEventType, RecurrenceType, @@ -61,7 +62,6 @@ TriggerType, VersionIndicatorType, VersionSelectorType, - VoiceConversationItemType, VoiceTurnDetectionType, ) @@ -13438,6 +13438,270 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RealtimeAudioFormatsType.AUDIO_PCMU # type: ignore +class RealtimeConversationItem(_Model): + """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 + + :ivar type: Required. Known values are: "function_call", "function_call_output", + "mcp_approval_response", "mcp_list_tools", "mcp_call", and "mcp_approval_request". + :vartype type: str or ~azure.ai.projects.models.RealtimeConversationItemType + """ + + __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\", and \"mcp_approval_request\".""" + + @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 RealtimeConversationItemFunctionCall(RealtimeConversationItem, discriminator="function_call"): + """Realtime function call item. + + :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 + """ + + 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"] + ) + """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.""" + + @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, + ) -> 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 = RealtimeConversationItemType.FUNCTION_CALL # type: ignore + + +class RealtimeConversationItemFunctionCallOutput( + RealtimeConversationItem, discriminator="function_call_output" +): # pylint: disable=name-too-long + """Realtime function call output item. + + :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 + """ + + 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.""" + + @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, + ) -> 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 = RealtimeConversationItemType.FUNCTION_CALL_OUTPUT # type: ignore + + +class RealtimeConversationItemMessage(_Model): + """RealtimeConversationItemMessage. + + 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 + """ + + __mapping__: dict[str, _Model] = {} + role: str = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"system\", \"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 RealtimeConversationItemMessageAssistant(RealtimeConversationItemMessage, discriminator="assistant"): + """Realtime assistant message item. + + :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. Default value is "message". + :vartype type: str + :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] + """ + + 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["message"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the item. Always ``message``. Required. Default value is \"message\".""" + 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.""" + + @overload + def __init__( + self, + *, + 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 + 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 = RealtimeConversationItemMessageType.ASSISTANT # type: ignore + self.type: Literal["message"] = "message" + + class RealtimeConversationItemMessageAssistantContent(_Model): # pylint: disable=name-too-long """RealtimeConversationItemMessageAssistantContent. @@ -13480,6 +13744,68 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class RealtimeConversationItemMessageSystem(RealtimeConversationItemMessage, discriminator="system"): + """Realtime system message item. + + :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. Default value is "message". + :vartype type: str + :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] + """ + + 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["message"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the item. Always ``message``. Required. Default value is \"message\".""" + 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.""" + + @overload + def __init__( + self, + *, + 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 + 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 = RealtimeConversationItemMessageType.SYSTEM # type: ignore + self.type: Literal["message"] = "message" + + class RealtimeConversationItemMessageSystemContent(_Model): # pylint: disable=name-too-long """RealtimeConversationItemMessageSystemContent. @@ -13497,8 +13823,68 @@ class RealtimeConversationItemMessageSystemContent(_Model): # pylint: disable=n def __init__( self, *, - type: Optional[Literal["input_text"]] = None, - text: Optional[str] = None, + type: Optional[Literal["input_text"]] = None, + 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 RealtimeConversationItemMessageUser(RealtimeConversationItemMessage, discriminator="user"): + """Realtime user message item. + + :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. Default value is "message". + :vartype type: str + :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] + """ + + 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["message"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the item. Always ``message``. Required. Default value is \"message\".""" + 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.""" + + @overload + def __init__( + self, + *, + 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 @@ -13510,6 +13896,8 @@ 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: Literal["message"] = "message" class RealtimeConversationItemMessageUserContent(_Model): # pylint: disable=name-too-long @@ -13618,6 +14006,103 @@ class RealtimeFunctionToolParameters(_Model): """RealtimeFunctionToolParameters.""" +class RealtimeMCPApprovalRequest(RealtimeConversationItem, discriminator="mcp_approval_request"): + """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 + """ + + 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.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + server_label: str, + name: str, + arguments: 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 = RealtimeConversationItemType.MCP_APPROVAL_REQUEST # type: ignore + + +class RealtimeMCPApprovalResponse(RealtimeConversationItem, discriminator="mcp_approval_response"): + """Realtime MCP approval response. + + :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 + """ + + 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"]) + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + approval_request_id: str, + approve: bool, + reason: 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 = RealtimeConversationItemType.MCP_APPROVAL_RESPONSE # type: ignore + + class RealtimeMCPError(_Model): """RealtimeMCPError. @@ -13689,6 +14174,49 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RealtimeMcpErrorType.HTTP_ERROR # type: ignore +class RealtimeMCPListTools(RealtimeConversationItem, discriminator="mcp_list_tools"): + """Realtime MCP list tools. + + :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] + """ + + 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.""" + + @overload + def __init__( + self, + *, + server_label: str, + tools: list["_models.MCPListToolsTool"], + id: Optional[str] = None, # 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) + self.type = RealtimeConversationItemType.MCP_LIST_TOOLS # type: ignore + + class RealtimeMCPProtocolError(RealtimeMCPError, discriminator="protocol_error"): """Realtime MCP protocol error. @@ -13727,6 +14255,66 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RealtimeMcpErrorType.PROTOCOL_ERROR # type: ignore +class RealtimeMCPToolCall(RealtimeConversationItem, discriminator="mcp_call"): + """Realtime MCP tool call. + + :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 + """ + + 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"]) + + @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, + ) -> 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 = RealtimeConversationItemType.MCP_CALL # type: ignore + + class RealtimeMCPToolExecutionError(RealtimeMCPError, discriminator="tool_execution_error"): """Realtime MCP tool execution error. @@ -18041,8 +18629,18 @@ class VoiceAgentClientEventConversationItemCreate(_Model): # pylint: disable=na 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: The conversation item to create. Required. - :vartype item: ~azure.ai.projects.models.VoiceConversationItem + :ivar item: The conversation item to create. Required. Is one of the following types: + VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, + VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem + :vartype item: ~azure.ai.projects.models.VoiceSystemMessageItem or + ~azure.ai.projects.models.VoiceUserMessageItem or + ~azure.ai.projects.models.VoiceAssistantMessageItem or + ~azure.ai.projects.models.VoiceFunctionCallItem or + ~azure.ai.projects.models.VoiceFunctionCallOutputItem or + ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem + or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or + ~azure.ai.projects.models.VoiceMcpApprovalResponseItem """ event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -18057,15 +18655,18 @@ class VoiceAgentClientEventConversationItemCreate(_Model): # pylint: disable=na 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.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The conversation item to create. Required.""" + item: "_unions.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The conversation item to create. Required. Is one of the following types: + VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, + VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem""" @overload def __init__( self, *, type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE], - item: "_models.VoiceConversationItem", + item: "_unions.VoiceConversationItem", event_id: Optional[str] = None, previous_item_id: Optional[str] = None, ) -> None: ... @@ -19099,7 +19700,14 @@ class VoiceAgentRealtimeResponse(OmitPropertiesRealtimeResponse1): locale, and format fields under ``output``. :vartype audio: ~azure.ai.projects.models.VoiceResponseAudio :ivar output: The items produced by the live response. - :vartype output: list[~azure.ai.projects.models.VoiceConversationItem] + :vartype output: list[~azure.ai.projects.models.VoiceSystemMessageItem or + ~azure.ai.projects.models.VoiceUserMessageItem or + ~azure.ai.projects.models.VoiceAssistantMessageItem or + ~azure.ai.projects.models.VoiceFunctionCallItem or + ~azure.ai.projects.models.VoiceFunctionCallOutputItem or + ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem + or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or + ~azure.ai.projects.models.VoiceMcpApprovalResponseItem] """ audio: Optional["_models.VoiceResponseAudio"] = rest_field( @@ -19107,7 +19715,7 @@ class VoiceAgentRealtimeResponse(OmitPropertiesRealtimeResponse1): ) """The audio configuration used by the live response, including flat voice provider, locale, and format fields under ``output``.""" - output: Optional[list["_models.VoiceConversationItem"]] = rest_field( + output: Optional[list["_unions.VoiceConversationItem"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The items produced by the live response.""" @@ -19126,7 +19734,7 @@ def __init__( output_modalities: Optional[list[Literal["text", "audio"]]] = None, max_output_tokens: Optional[Union[int, Literal["inf"]]] = None, audio: Optional["_models.VoiceResponseAudio"] = None, - output: Optional[list["_models.VoiceConversationItem"]] = None, + output: Optional[list["_unions.VoiceConversationItem"]] = None, ) -> None: ... @overload @@ -19183,7 +19791,14 @@ class VoiceAgentResponseCreateParams(_Model): :ivar audio: Response-specific audio settings. :vartype audio: ~azure.ai.projects.models.PickPropertiesVoiceAudioConfig :ivar input: Conversation items used as inline response input. - :vartype input: list[~azure.ai.projects.models.VoiceConversationItem] + :vartype input: list[~azure.ai.projects.models.VoiceSystemMessageItem or + ~azure.ai.projects.models.VoiceUserMessageItem or + ~azure.ai.projects.models.VoiceAssistantMessageItem or + ~azure.ai.projects.models.VoiceFunctionCallItem or + ~azure.ai.projects.models.VoiceFunctionCallOutputItem or + ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem + or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or + ~azure.ai.projects.models.VoiceMcpApprovalResponseItem] :ivar pre_generated_assistant_message: A pre-generated assistant message used to begin the response. :vartype pre_generated_assistant_message: ~azure.ai.projects.models.VoiceAssistantMessageItem @@ -19242,7 +19857,7 @@ class VoiceAgentResponseCreateParams(_Model): visibility=["read", "create", "update", "delete", "query"] ) """Response-specific audio settings.""" - input: Optional[list["_models.VoiceConversationItem"]] = rest_field( + input: Optional[list["_unions.VoiceConversationItem"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Conversation items used as inline response input.""" @@ -19272,7 +19887,7 @@ def __init__( metadata: Optional["_models.Metadata"] = None, output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = None, audio: Optional["_models.PickPropertiesVoiceAudioConfig"] = None, - input: Optional[list["_models.VoiceConversationItem"]] = None, + input: Optional[list["_unions.VoiceConversationItem"]] = None, pre_generated_assistant_message: Optional["_models.VoiceAssistantMessageItem"] = None, interim_response: Optional["_unions.VoiceAgentInterimResponse"] = None, ) -> None: ... @@ -19437,8 +20052,18 @@ class VoiceAgentServerEventConversationItemAdded(_Model): # pylint: disable=nam :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_ADDED :ivar previous_item_id: :vartype previous_item_id: str - :ivar item: The item added to the conversation. Required. - :vartype item: ~azure.ai.projects.models.VoiceConversationItem + :ivar item: The item added to the conversation. Required. Is one of the following types: + VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, + VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem + :vartype item: ~azure.ai.projects.models.VoiceSystemMessageItem or + ~azure.ai.projects.models.VoiceUserMessageItem or + ~azure.ai.projects.models.VoiceAssistantMessageItem or + ~azure.ai.projects.models.VoiceFunctionCallItem or + ~azure.ai.projects.models.VoiceFunctionCallOutputItem or + ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem + or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or + ~azure.ai.projects.models.VoiceMcpApprovalResponseItem """ event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -19448,8 +20073,11 @@ class VoiceAgentServerEventConversationItemAdded(_Model): # pylint: disable=nam ) """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.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The item added to the conversation. Required.""" + item: "_unions.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The item added to the conversation. Required. Is one of the following types: + VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, + VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem""" @overload def __init__( @@ -19457,7 +20085,7 @@ def __init__( *, event_id: str, type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED], - item: "_models.VoiceConversationItem", + item: "_unions.VoiceConversationItem", previous_item_id: Optional[str] = None, ) -> None: ... @@ -19482,8 +20110,18 @@ class VoiceAgentServerEventConversationItemCreated(_Model): # pylint: disable=n :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_CREATED :ivar previous_item_id: :vartype previous_item_id: str - :ivar item: The created conversation item. Required. - :vartype item: ~azure.ai.projects.models.VoiceConversationItem + :ivar item: The created conversation item. Required. Is one of the following types: + VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, + VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem + :vartype item: ~azure.ai.projects.models.VoiceSystemMessageItem or + ~azure.ai.projects.models.VoiceUserMessageItem or + ~azure.ai.projects.models.VoiceAssistantMessageItem or + ~azure.ai.projects.models.VoiceFunctionCallItem or + ~azure.ai.projects.models.VoiceFunctionCallOutputItem or + ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem + or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or + ~azure.ai.projects.models.VoiceMcpApprovalResponseItem """ event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -19493,8 +20131,11 @@ class VoiceAgentServerEventConversationItemCreated(_Model): # pylint: disable=n ) """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.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The created conversation item. Required.""" + item: "_unions.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The created conversation item. Required. Is one of the following types: VoiceSystemMessageItem, + VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, + VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem""" @overload def __init__( @@ -19502,7 +20143,7 @@ def __init__( *, event_id: str, type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED], - item: "_models.VoiceConversationItem", + item: "_unions.VoiceConversationItem", previous_item_id: Optional[str] = None, ) -> None: ... @@ -19568,8 +20209,18 @@ class VoiceAgentServerEventConversationItemDone(_Model): # pylint: disable=name :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_DONE :ivar previous_item_id: :vartype previous_item_id: str - :ivar item: The completed conversation item. Required. - :vartype item: ~azure.ai.projects.models.VoiceConversationItem + :ivar item: The completed conversation item. Required. Is one of the following types: + VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, + VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem + :vartype item: ~azure.ai.projects.models.VoiceSystemMessageItem or + ~azure.ai.projects.models.VoiceUserMessageItem or + ~azure.ai.projects.models.VoiceAssistantMessageItem or + ~azure.ai.projects.models.VoiceFunctionCallItem or + ~azure.ai.projects.models.VoiceFunctionCallOutputItem or + ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem + or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or + ~azure.ai.projects.models.VoiceMcpApprovalResponseItem """ event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -19579,8 +20230,11 @@ class VoiceAgentServerEventConversationItemDone(_Model): # pylint: disable=name ) """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.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The completed conversation item. Required.""" + item: "_unions.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The completed conversation item. Required. Is one of the following types: + VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, + VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem""" @overload def __init__( @@ -19588,7 +20242,7 @@ def __init__( *, event_id: str, type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE], - item: "_models.VoiceConversationItem", + item: "_unions.VoiceConversationItem", previous_item_id: Optional[str] = None, ) -> None: ... @@ -19877,8 +20531,18 @@ class VoiceAgentServerEventConversationItemRetrieved(_Model): # pylint: disable :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: The retrieved conversation item. Required. - :vartype item: ~azure.ai.projects.models.VoiceConversationItem + :ivar item: The retrieved conversation item. Required. Is one of the following types: + VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, + VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem + :vartype item: ~azure.ai.projects.models.VoiceSystemMessageItem or + ~azure.ai.projects.models.VoiceUserMessageItem or + ~azure.ai.projects.models.VoiceAssistantMessageItem or + ~azure.ai.projects.models.VoiceFunctionCallItem or + ~azure.ai.projects.models.VoiceFunctionCallOutputItem or + ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem + or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or + ~azure.ai.projects.models.VoiceMcpApprovalResponseItem """ event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -19887,8 +20551,11 @@ class VoiceAgentServerEventConversationItemRetrieved(_Model): # pylint: disable visibility=["read", "create", "update", "delete", "query"] ) """The event type, must be ``conversation.item.retrieved``. Required. CONVERSATION_ITEM_RETRIEVED.""" - item: "_models.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The retrieved conversation item. Required.""" + item: "_unions.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The retrieved conversation item. Required. Is one of the following types: + VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, + VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem""" @overload def __init__( @@ -19896,7 +20563,7 @@ def __init__( *, event_id: str, type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED], - item: "_models.VoiceConversationItem", + item: "_unions.VoiceConversationItem", ) -> None: ... @overload @@ -21573,8 +22240,18 @@ class VoiceAgentServerEventResponseOutputItemAdded(_Model): # pylint: disable=n :vartype response_id: str :ivar output_index: The index of the output item in the Response. Required. :vartype output_index: int - :ivar item: The output item that was added. Required. - :vartype item: ~azure.ai.projects.models.VoiceConversationItem + :ivar item: The output item that was added. Required. Is one of the following types: + VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, + VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem + :vartype item: ~azure.ai.projects.models.VoiceSystemMessageItem or + ~azure.ai.projects.models.VoiceUserMessageItem or + ~azure.ai.projects.models.VoiceAssistantMessageItem or + ~azure.ai.projects.models.VoiceFunctionCallItem or + ~azure.ai.projects.models.VoiceFunctionCallOutputItem or + ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem + or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or + ~azure.ai.projects.models.VoiceMcpApprovalResponseItem """ event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -21587,8 +22264,11 @@ class VoiceAgentServerEventResponseOutputItemAdded(_Model): # pylint: disable=n """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.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The output item that was added. Required.""" + item: "_unions.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The output item that was added. Required. Is one of the following types: + VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, + VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem""" @overload def __init__( @@ -21598,7 +22278,7 @@ def __init__( type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED], response_id: str, output_index: int, - item: "_models.VoiceConversationItem", + item: "_unions.VoiceConversationItem", ) -> None: ... @overload @@ -21624,8 +22304,18 @@ class VoiceAgentServerEventResponseOutputItemDone(_Model): # pylint: disable=na :vartype response_id: str :ivar output_index: The index of the output item in the Response. Required. :vartype output_index: int - :ivar item: The output item that finished streaming. Required. - :vartype item: ~azure.ai.projects.models.VoiceConversationItem + :ivar item: The output item that finished streaming. Required. Is one of the following types: + VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, + VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem + :vartype item: ~azure.ai.projects.models.VoiceSystemMessageItem or + ~azure.ai.projects.models.VoiceUserMessageItem or + ~azure.ai.projects.models.VoiceAssistantMessageItem or + ~azure.ai.projects.models.VoiceFunctionCallItem or + ~azure.ai.projects.models.VoiceFunctionCallOutputItem or + ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem + or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or + ~azure.ai.projects.models.VoiceMcpApprovalResponseItem """ event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -21638,8 +22328,11 @@ class VoiceAgentServerEventResponseOutputItemDone(_Model): # pylint: disable=na """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.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The output item that finished streaming. Required.""" + item: "_unions.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The output item that finished streaming. Required. Is one of the following types: + VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, + VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem""" @overload def __init__( @@ -21649,7 +22342,7 @@ def __init__( type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE], response_id: str, output_index: int, - item: "_models.VoiceConversationItem", + item: "_unions.VoiceConversationItem", ) -> None: ... @overload @@ -22648,109 +23341,22 @@ class VoiceAgentTranscriptionWord(_Model): text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The transcribed word text. Required.""" - offset_milliseconds: datetime.timedelta = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """The word offset from the beginning of the audio, in milliseconds. Required.""" - duration_milliseconds: datetime.timedelta = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """The word duration in milliseconds. Required.""" - - @overload - def __init__( - self, - *, - text: str, - offset_milliseconds: datetime.timedelta, - duration_milliseconds: datetime.timedelta, - ) -> 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 VoiceConversationItem(_Model): - """A persisted item in a voice conversation. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - VoiceFunctionCallItem, VoiceFunctionCallOutputItem, VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem, VoiceMcpCallItem, VoiceMcpListToolsItem, VoiceMessageItem - - :ivar type: The type of the conversation item. Required. Known values are: "message", - "function_call", "function_call_output", "mcp_list_tools", "mcp_call", "mcp_approval_request", - and "mcp_approval_response". - :vartype type: str or ~azure.ai.projects.models.VoiceConversationItemType - :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 - """ - - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of the conversation item. Required. Known values are: \"message\", \"function_call\", - \"function_call_output\", \"mcp_list_tools\", \"mcp_call\", \"mcp_approval_request\", and - \"mcp_approval_response\".""" - 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: 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 VoiceMessageItem(VoiceConversationItem, discriminator="message"): - """A persisted message item in a voice conversation. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - VoiceAssistantMessageItem, VoiceSystemMessageItem, VoiceUserMessageItem - - :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: Required. A message item. - :vartype type: str or ~azure.ai.projects.models.MESSAGE - :ivar role: The role of the message sender. Required. Known values are: "system", "user", and - "assistant". - :vartype role: str or ~azure.ai.projects.models.RealtimeConversationItemMessageType - """ - - __mapping__: dict[str, _Model] = {} - type: Literal[VoiceConversationItemType.MESSAGE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. A message item.""" - role: str = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) - """The role of the message sender. Required. Known values are: \"system\", \"user\", and - \"assistant\".""" + offset_milliseconds: datetime.timedelta = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """The word offset from the beginning of the audio, in milliseconds. Required.""" + duration_milliseconds: datetime.timedelta = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """The word duration in milliseconds. Required.""" @overload def __init__( self, *, - role: str, + text: str, + offset_milliseconds: datetime.timedelta, + duration_milliseconds: datetime.timedelta, ) -> None: ... @overload @@ -22762,52 +23368,38 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = VoiceConversationItemType.MESSAGE # type: ignore -class VoiceAssistantMessageItem(VoiceMessageItem, discriminator="assistant"): +class VoiceAssistantMessageItem(RealtimeConversationItemMessageAssistant): """An assistant message item. Only ``output_text`` and ``output_audio`` content are valid for assistant messages. - :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: Required. A message item. - :vartype type: str or ~azure.ai.projects.models.MESSAGE :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. Default value is "message". + :vartype type: str :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 role: Required. ASSISTANT. - :vartype role: str or ~azure.ai.projects.models.ASSISTANT + :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 """ - __mapping__: dict[str, _Model] = {} - 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\"]""" - content: list["_models.RealtimeConversationItemMessageAssistantContent"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The content of the message. Required.""" - role: Literal[RealtimeConversationItemMessageType.ASSISTANT] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. ASSISTANT.""" + 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__( @@ -22828,7 +23420,6 @@ 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 class VoiceAudioConfig(_Model): @@ -23547,19 +24138,17 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceFunctionCallItem(VoiceConversationItem, discriminator="function_call"): +class VoiceFunctionCallItem(RealtimeConversationItemFunctionCall): """A function call request item. - :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 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 @@ -23570,29 +24159,16 @@ class VoiceFunctionCallItem(VoiceConversationItem, discriminator="function_call" :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 type: Required. A function-call request item. - :vartype type: str or ~azure.ai.projects.models.FUNCTION_CALL + :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\"]""" - 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.""" - type: Literal[VoiceConversationItemType.FUNCTION_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. A function-call request item.""" + 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__( @@ -23615,22 +24191,20 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = VoiceConversationItemType.FUNCTION_CALL # type: ignore -class VoiceFunctionCallOutputItem(VoiceConversationItem, discriminator="function_call_output"): +class VoiceFunctionCallOutputItem(RealtimeConversationItemFunctionCallOutput): """A function call output item. - :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 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 @@ -23639,30 +24213,19 @@ class VoiceFunctionCallOutputItem(VoiceConversationItem, discriminator="function :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 type: Required. A function-call output item. - :vartype type: str or ~azure.ai.projects.models.FUNCTION_CALL_OUTPUT + :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 """ - 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\"]""" - 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.""" - type: Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. A function-call output item.""" + 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``.""" @@ -23688,7 +24251,6 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = VoiceConversationItemType.FUNCTION_CALL_OUTPUT # type: ignore class VoiceInputTranscription(_Model): @@ -23865,13 +24427,12 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceMcpApprovalRequestItem(VoiceConversationItem, discriminator="mcp_approval_request"): +class VoiceMcpApprovalRequestItem(RealtimeMCPApprovalRequest): """An MCP approval request item. - :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 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. @@ -23880,20 +24441,16 @@ class VoiceMcpApprovalRequestItem(VoiceConversationItem, discriminator="mcp_appr :vartype name: str :ivar arguments: A JSON string of arguments for the tool. Required. :vartype arguments: str - :ivar type: Required. An MCP approval request item. - :vartype type: str or ~azure.ai.projects.models.MCP_APPROVAL_REQUEST + :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: 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.""" - type: Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. An MCP approval request item.""" + 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__( @@ -23914,16 +24471,14 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = VoiceConversationItemType.MCP_APPROVAL_REQUEST # type: ignore -class VoiceMcpApprovalResponseItem(VoiceConversationItem, discriminator="mcp_approval_response"): +class VoiceMcpApprovalResponseItem(RealtimeMCPApprovalResponse): """An MCP approval response item (client-created). - :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 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. @@ -23932,19 +24487,16 @@ class VoiceMcpApprovalResponseItem(VoiceConversationItem, discriminator="mcp_app :vartype approve: bool :ivar reason: :vartype reason: str - :ivar type: Required. An MCP approval response item. - :vartype type: str or ~azure.ai.projects.models.MCP_APPROVAL_RESPONSE + :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: 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"]) - type: Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. An MCP approval response item.""" + 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__( @@ -23965,16 +24517,13 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = VoiceConversationItemType.MCP_APPROVAL_RESPONSE # type: ignore -class VoiceMcpCallItem(VoiceConversationItem, discriminator="mcp_call"): +class VoiceMcpCallItem(RealtimeMCPToolCall): """An MCP call item. - :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 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. @@ -23989,23 +24538,16 @@ class VoiceMcpCallItem(VoiceConversationItem, discriminator="mcp_call"): :vartype output: str :ivar error: :vartype error: ~azure.ai.projects.models.RealtimeMCPError - :ivar type: Required. An MCP call item. - :vartype type: str or ~azure.ai.projects.models.MCP_CALL + :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: 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"]) - type: Literal[VoiceConversationItemType.MCP_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. An MCP call item.""" + 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__( @@ -24029,34 +24571,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = VoiceConversationItemType.MCP_CALL # type: ignore -class VoiceMcpListToolsItem(VoiceConversationItem, discriminator="mcp_list_tools"): +class VoiceMcpListToolsItem(RealtimeMCPListTools): """An MCP list-tools item. - :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 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 type: Required. An MCP list-tools item. - :vartype type: str or ~azure.ai.projects.models.MCP_LIST_TOOLS + :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 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.""" - type: Literal[VoiceConversationItemType.MCP_LIST_TOOLS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. An MCP list-tools item.""" + 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__( @@ -24076,7 +24613,6 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = VoiceConversationItemType.MCP_LIST_TOOLS # type: ignore class VoiceNoiseReduction(_Model): @@ -24244,7 +24780,14 @@ class VoiceResponse(OmitPropertiesRealtimeResponse): retrieve the full response (GET .../responses/{response_id}) or use the paged response-items route (GET .../responses/{response_id}/items) for its output items. Each item's ``response_id`` also links it back to this response in the conversation-level items list. - :vartype output: list[~azure.ai.projects.models.VoiceConversationItem] + :vartype output: list[~azure.ai.projects.models.VoiceSystemMessageItem or + ~azure.ai.projects.models.VoiceUserMessageItem or + ~azure.ai.projects.models.VoiceAssistantMessageItem or + ~azure.ai.projects.models.VoiceFunctionCallItem or + ~azure.ai.projects.models.VoiceFunctionCallOutputItem or + ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem + or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or + ~azure.ai.projects.models.VoiceMcpApprovalResponseItem] :ivar conversation_id: The id of the conversation this response belongs to. Required. :vartype conversation_id: str :ivar audio: The audio configuration used for the response, including the voice and audio @@ -24262,7 +24805,7 @@ class VoiceResponse(OmitPropertiesRealtimeResponse): id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) # type: ignore[reportIncompatibleVariableOverride] """The unique id of the response. Required.""" - output: Optional[list["_models.VoiceConversationItem"]] = rest_field( + output: Optional[list["_unions.VoiceConversationItem"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The output items produced by the response. May be omitted in list results; retrieve the full @@ -24301,7 +24844,7 @@ def __init__( usage: Optional["_models.RealtimeResponseUsage"] = None, output_modalities: Optional[list[Literal["text", "audio"]]] = None, max_output_tokens: Optional[Union[int, Literal["inf"]]] = None, - output: Optional[list["_models.VoiceConversationItem"]] = None, + output: Optional[list["_unions.VoiceConversationItem"]] = None, audio: Optional["_models.VoiceResponseAudio"] = None, metadata: Optional[dict[str, str]] = None, temperature: Optional[float] = None, @@ -24474,47 +25017,34 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = VoiceTurnDetectionType.SERVER_VAD # type: ignore -class VoiceSystemMessageItem(VoiceMessageItem, discriminator="system"): +class VoiceSystemMessageItem(RealtimeConversationItemMessageSystem): """A system message item. Only ``input_text`` content is valid for system messages. - :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: Required. A message item. - :vartype type: str or ~azure.ai.projects.models.MESSAGE :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. Default value is "message". + :vartype type: str :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 role: Required. SYSTEM. - :vartype role: str or ~azure.ai.projects.models.SYSTEM + :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 """ - __mapping__: dict[str, _Model] = {} - 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\"]""" - content: list["_models.RealtimeConversationItemMessageSystemContent"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The content of the message. Required.""" - role: Literal[RealtimeConversationItemMessageType.SYSTEM] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. SYSTEM.""" + 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__( @@ -24535,7 +25065,6 @@ 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 class VoiceSystemTool(VoiceAgentTool, discriminator="system"): @@ -24629,48 +25158,35 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = "toolbox" # type: ignore -class VoiceUserMessageItem(VoiceMessageItem, discriminator="user"): +class VoiceUserMessageItem(RealtimeConversationItemMessageUser): """A user message item. ``input_text``, ``input_audio``, and ``input_image`` content are valid for user messages. - :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: Required. A message item. - :vartype type: str or ~azure.ai.projects.models.MESSAGE :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. Default value is "message". + :vartype type: str :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 role: Required. USER. - :vartype role: str or ~azure.ai.projects.models.USER + :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 """ - __mapping__: dict[str, _Model] = {} - 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\"]""" - content: list["_models.RealtimeConversationItemMessageUserContent"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The content of the message. Required.""" - role: Literal[RealtimeConversationItemMessageType.USER] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. USER.""" + 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__( @@ -24691,7 +25207,6 @@ 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 class WebIQPreviewTool(Tool, discriminator="web_iq_preview"): 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 662f3c9bbc14..1200fab3b0e5 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 @@ -7040,7 +7040,7 @@ def list_agent_conversation_response_items( order: Optional[Union[str, _models.PageOrder]] = None, before: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.VoiceConversationItem"]: + ) -> ItemPaged["_unions.VoiceConversationItem"]: """List items produced by a voice agent conversation response. Returns a paged collection of the output items produced by a specific response (the response's @@ -7068,14 +7068,24 @@ def list_agent_conversation_response_items( 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 VoiceConversationItem - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.VoiceConversationItem] + :return: An iterator like instance of VoiceSystemMessageItem or VoiceUserMessageItem or + VoiceAssistantMessageItem or VoiceFunctionCallItem or VoiceFunctionCallOutputItem or + VoiceMcpListToolsItem or VoiceMcpCallItem or VoiceMcpApprovalRequestItem or + VoiceMcpApprovalResponseItem + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.VoiceSystemMessageItem or + ~azure.ai.projects.models.VoiceUserMessageItem or + ~azure.ai.projects.models.VoiceAssistantMessageItem or + ~azure.ai.projects.models.VoiceFunctionCallItem or + ~azure.ai.projects.models.VoiceFunctionCallOutputItem or + ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem + or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or + ~azure.ai.projects.models.VoiceMcpApprovalResponseItem] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.VoiceConversationItem]] = kwargs.pop("cls", None) + cls: ClsType[List["_unions.VoiceConversationItem"]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -7108,7 +7118,7 @@ def prepare_request(_continuation_token=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.VoiceConversationItem], + List["_unions.VoiceConversationItem"], deserialized.get("data", []), ) if cls: @@ -7146,7 +7156,7 @@ def list_agent_conversation_items( order: Optional[Union[str, _models.PageOrder]] = None, before: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.VoiceConversationItem"]: + ) -> ItemPaged["_unions.VoiceConversationItem"]: """List items in a voice agent conversation. Returns a paged collection of items — the complete ordered conversation history, including user @@ -7171,14 +7181,24 @@ def list_agent_conversation_items( 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 VoiceConversationItem - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.VoiceConversationItem] + :return: An iterator like instance of VoiceSystemMessageItem or VoiceUserMessageItem or + VoiceAssistantMessageItem or VoiceFunctionCallItem or VoiceFunctionCallOutputItem or + VoiceMcpListToolsItem or VoiceMcpCallItem or VoiceMcpApprovalRequestItem or + VoiceMcpApprovalResponseItem + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.VoiceSystemMessageItem or + ~azure.ai.projects.models.VoiceUserMessageItem or + ~azure.ai.projects.models.VoiceAssistantMessageItem or + ~azure.ai.projects.models.VoiceFunctionCallItem or + ~azure.ai.projects.models.VoiceFunctionCallOutputItem or + ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem + or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or + ~azure.ai.projects.models.VoiceMcpApprovalResponseItem] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.VoiceConversationItem]] = kwargs.pop("cls", None) + cls: ClsType[List["_unions.VoiceConversationItem"]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -7210,7 +7230,7 @@ def prepare_request(_continuation_token=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.VoiceConversationItem], + List["_unions.VoiceConversationItem"], deserialized.get("data", []), ) if cls: @@ -7241,7 +7261,7 @@ def get_next(_continuation_token=None): @distributed_trace def get_agent_conversation_item( self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any - ) -> _models.VoiceConversationItem: + ) -> "_unions.VoiceConversationItem": """Get a voice agent conversation item. Retrieves a single item from the specified conversation by its id, including its transcript. An @@ -7256,8 +7276,17 @@ def get_agent_conversation_item( :type conversation_id: str :param item_id: The id of the conversation item to retrieve. Required. :type item_id: str - :return: VoiceConversationItem. The VoiceConversationItem is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.VoiceConversationItem + :return: VoiceSystemMessageItem or VoiceUserMessageItem or VoiceAssistantMessageItem or + VoiceFunctionCallItem or VoiceFunctionCallOutputItem or VoiceMcpListToolsItem or + VoiceMcpCallItem or VoiceMcpApprovalRequestItem or VoiceMcpApprovalResponseItem + :rtype: ~azure.ai.projects.models.VoiceSystemMessageItem or + ~azure.ai.projects.models.VoiceUserMessageItem or + ~azure.ai.projects.models.VoiceAssistantMessageItem or + ~azure.ai.projects.models.VoiceFunctionCallItem or + ~azure.ai.projects.models.VoiceFunctionCallOutputItem or + ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem + or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or + ~azure.ai.projects.models.VoiceMcpApprovalResponseItem :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -7271,7 +7300,7 @@ def get_agent_conversation_item( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.VoiceConversationItem] = kwargs.pop("cls", None) + cls: ClsType["_unions.VoiceConversationItem"] = kwargs.pop("cls", None) _request = build_agent_endpoint_conversations_get_agent_conversation_item_request( agent_name=agent_name, @@ -7310,7 +7339,7 @@ def get_agent_conversation_item( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.VoiceConversationItem, response.json()) + deserialized = _deserialize("_unions.VoiceConversationItem", response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/types.py b/sdk/ai/azure-ai-projects/azure/ai/projects/types.py index 62850fe24bc6..1bf3a9856939 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/types.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/types.py @@ -37,6 +37,7 @@ RealtimeAudioFormatsType, RealtimeClientEventType, RealtimeConversationItemMessageType, + RealtimeConversationItemType, RealtimeMcpErrorType, RealtimeServerEventType, RecurrenceType, @@ -54,7 +55,6 @@ TriggerType, VersionIndicatorType, VersionSelectorType, - VoiceConversationItemType, VoiceTurnDetectionType, ) @@ -5827,6 +5827,123 @@ class RealtimeAudioFormatsAudioPcmu(TypedDict, total=False): """Required. AUDIO_PCMU.""" +class RealtimeConversationItemFunctionCall(TypedDict, total=False): + """Realtime function call item. + + :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: Literal["realtime.item"] + :ivar type: The type of the item. Always ``function_call``. Required. FUNCTION_CALL. + :vartype type: Literal[RealtimeConversationItemType.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: Literal["completed", "incomplete", "in_progress"] + :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 + """ + + id: str + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Literal["realtime.item"] + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + type: Required[Literal[RealtimeConversationItemType.FUNCTION_CALL]] + """The type of the item. Always ``function_call``. Required. FUNCTION_CALL.""" + status: Literal["completed", "incomplete", "in_progress"] + """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 + """The ID of the function call.""" + name: Required[str] + """The name of the function being called. Required.""" + arguments: Required[str] + """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.""" + + +class RealtimeConversationItemFunctionCallOutput(TypedDict, total=False): # pylint: disable=name-too-long + """Realtime function call output item. + + :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: Literal["realtime.item"] + :ivar type: The type of the item. Always ``function_call_output``. Required. + FUNCTION_CALL_OUTPUT. + :vartype type: Literal[RealtimeConversationItemType.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: Literal["completed", "incomplete", "in_progress"] + :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 + """ + + id: str + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Literal["realtime.item"] + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + type: Required[Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT]] + """The type of the item. Always ``function_call_output``. Required. FUNCTION_CALL_OUTPUT.""" + status: Literal["completed", "incomplete", "in_progress"] + """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: Required[str] + """The ID of the function call this output is for. Required.""" + output: Required[str] + """The output of the function call, this is free text and can contain any information or simply be + empty. Required.""" + + +class RealtimeConversationItemMessageAssistant(TypedDict, total=False): + """Realtime assistant message item. + + :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: Literal["realtime.item"] + :ivar type: The type of the item. Always ``message``. Required. Default value is "message". + :vartype type: Literal["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: Literal["completed", "incomplete", "in_progress"] + :ivar role: The role of the message sender. Always ``assistant``. Required. ASSISTANT. + :vartype role: Literal[RealtimeConversationItemMessageType.ASSISTANT] + :ivar content: The content of the message. Required. + :vartype content: list["RealtimeConversationItemMessageAssistantContent"] + """ + + id: str + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Literal["realtime.item"] + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + type: Required[Literal["message"]] + """The type of the item. Always ``message``. Required. Default value is \"message\".""" + status: Literal["completed", "incomplete", "in_progress"] + """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: Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] + """The role of the message sender. Always ``assistant``. Required. ASSISTANT.""" + content: Required[list["RealtimeConversationItemMessageAssistantContent"]] + """The content of the message. Required.""" + + class RealtimeConversationItemMessageAssistantContent(TypedDict, total=False): # pylint: disable=name-too-long """RealtimeConversationItemMessageAssistantContent. @@ -5847,6 +5964,42 @@ class RealtimeConversationItemMessageAssistantContent(TypedDict, total=False): transcript: str +class RealtimeConversationItemMessageSystem(TypedDict, total=False): + """Realtime system message item. + + :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: Literal["realtime.item"] + :ivar type: The type of the item. Always ``message``. Required. Default value is "message". + :vartype type: Literal["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: Literal["completed", "incomplete", "in_progress"] + :ivar role: The role of the message sender. Always ``system``. Required. SYSTEM. + :vartype role: Literal[RealtimeConversationItemMessageType.SYSTEM] + :ivar content: The content of the message. Required. + :vartype content: list["RealtimeConversationItemMessageSystemContent"] + """ + + id: str + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Literal["realtime.item"] + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + type: Required[Literal["message"]] + """The type of the item. Always ``message``. Required. Default value is \"message\".""" + status: Literal["completed", "incomplete", "in_progress"] + """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: Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] + """The role of the message sender. Always ``system``. Required. SYSTEM.""" + content: Required[list["RealtimeConversationItemMessageSystemContent"]] + """The content of the message. Required.""" + + class RealtimeConversationItemMessageSystemContent(TypedDict, total=False): # pylint: disable=name-too-long """RealtimeConversationItemMessageSystemContent. @@ -5861,6 +6014,42 @@ class RealtimeConversationItemMessageSystemContent(TypedDict, total=False): # p text: str +class RealtimeConversationItemMessageUser(TypedDict, total=False): + """Realtime user message item. + + :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: Literal["realtime.item"] + :ivar type: The type of the item. Always ``message``. Required. Default value is "message". + :vartype type: Literal["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: Literal["completed", "incomplete", "in_progress"] + :ivar role: The role of the message sender. Always ``user``. Required. USER. + :vartype role: Literal[RealtimeConversationItemMessageType.USER] + :ivar content: The content of the message. Required. + :vartype content: list["RealtimeConversationItemMessageUserContent"] + """ + + id: str + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Literal["realtime.item"] + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + type: Required[Literal["message"]] + """The type of the item. Always ``message``. Required. Default value is \"message\".""" + status: Literal["completed", "incomplete", "in_progress"] + """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: Required[Literal[RealtimeConversationItemMessageType.USER]] + """The role of the message sender. Always ``user``. Required. USER.""" + content: Required[list["RealtimeConversationItemMessageUserContent"]] + """The content of the message. Required.""" + + class RealtimeConversationItemMessageUserContent(TypedDict, total=False): # pylint: disable=name-too-long """RealtimeConversationItemMessageUserContent. @@ -5919,6 +6108,61 @@ class RealtimeFunctionToolParameters(TypedDict, total=False): """RealtimeFunctionToolParameters.""" +class RealtimeMCPApprovalRequest(TypedDict, total=False): + """Realtime MCP approval request. + + :ivar type: The type of the item. Always ``mcp_approval_request``. Required. + MCP_APPROVAL_REQUEST. + :vartype type: Literal[RealtimeConversationItemType.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 + """ + + type: Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST]] + """The type of the item. Always ``mcp_approval_request``. Required. MCP_APPROVAL_REQUEST.""" + id: Required[str] + """The unique ID of the approval request. Required.""" + server_label: Required[str] + """The label of the MCP server making the request. Required.""" + name: Required[str] + """The name of the tool to run. Required.""" + arguments: Required[str] + """A JSON string of arguments for the tool. Required.""" + + +class RealtimeMCPApprovalResponse(TypedDict, total=False): + """Realtime MCP approval response. + + :ivar type: The type of the item. Always ``mcp_approval_response``. Required. + MCP_APPROVAL_RESPONSE. + :vartype type: Literal[RealtimeConversationItemType.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 + """ + + type: Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE]] + """The type of the item. Always ``mcp_approval_response``. Required. MCP_APPROVAL_RESPONSE.""" + id: Required[str] + """The unique ID of the approval response. Required.""" + approval_request_id: Required[str] + """The ID of the approval request being answered. Required.""" + approve: Required[bool] + """Whether the request was approved. Required.""" + reason: Optional[str] + + class RealtimeMCPHTTPError(TypedDict, total=False): """Realtime MCP HTTP error. @@ -5938,6 +6182,29 @@ class RealtimeMCPHTTPError(TypedDict, total=False): """Required.""" +class RealtimeMCPListTools(TypedDict, total=False): + """Realtime MCP list tools. + + :ivar type: The type of the item. Always ``mcp_list_tools``. Required. MCP_LIST_TOOLS. + :vartype type: Literal[RealtimeConversationItemType.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["MCPListToolsTool"] + """ + + type: Required[Literal[RealtimeConversationItemType.MCP_LIST_TOOLS]] + """The type of the item. Always ``mcp_list_tools``. Required. MCP_LIST_TOOLS.""" + id: str + """The unique ID of the list.""" + server_label: Required[str] + """The label of the MCP server. Required.""" + tools: Required[list["MCPListToolsTool"]] + """The tools available on the server. Required.""" + + class RealtimeMCPProtocolError(TypedDict, total=False): """Realtime MCP protocol error. @@ -5957,6 +6224,42 @@ class RealtimeMCPProtocolError(TypedDict, total=False): """Required.""" +class RealtimeMCPToolCall(TypedDict, total=False): + """Realtime MCP tool call. + + :ivar type: The type of the item. Always ``mcp_call``. Required. MCP_CALL. + :vartype type: Literal[RealtimeConversationItemType.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: "RealtimeMCPError" + """ + + type: Required[Literal[RealtimeConversationItemType.MCP_CALL]] + """The type of the item. Always ``mcp_call``. Required. MCP_CALL.""" + id: Required[str] + """The unique ID of the tool call. Required.""" + server_label: Required[str] + """The label of the MCP server running the tool. Required.""" + name: Required[str] + """The name of the tool that was run. Required.""" + arguments: Required[str] + """A JSON string of the arguments passed to the tool. Required.""" + approval_request_id: Optional[str] + output: Optional[str] + error: "RealtimeMCPError" + + class RealtimeMCPToolExecutionError(TypedDict, total=False): """Realtime MCP tool execution error. @@ -7709,8 +8012,11 @@ class VoiceAgentClientEventConversationItemCreate(TypedDict, total=False): # py 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: The conversation item to create. Required. - :vartype item: "VoiceConversationItem" + :ivar item: The conversation item to create. Required. Is one of the following types: + VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, + VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem + :vartype item: "_unions.VoiceConversationItem" """ event_id: str @@ -7723,8 +8029,11 @@ class VoiceAgentClientEventConversationItemCreate(TypedDict, total=False): # py 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: Required["VoiceConversationItem"] - """The conversation item to create. Required.""" + item: Required["_unions.VoiceConversationItem"] + """The conversation item to create. Required. Is one of the following types: + VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, + VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem""" class VoiceAgentClientEventConversationItemDelete(TypedDict, total=False): # pylint: disable=name-too-long @@ -8281,13 +8590,13 @@ class VoiceAgentRealtimeResponse(OmitPropertiesRealtimeResponse1): locale, and format fields under ``output``. :vartype audio: "VoiceResponseAudio" :ivar output: The items produced by the live response. - :vartype output: list["VoiceConversationItem"] + :vartype output: list["_unions.VoiceConversationItem"] """ audio: "VoiceResponseAudio" """The audio configuration used by the live response, including flat voice provider, locale, and format fields under ``output``.""" - output: list["VoiceConversationItem"] + output: list["_unions.VoiceConversationItem"] """The items produced by the live response.""" @@ -8332,7 +8641,7 @@ class VoiceAgentResponseCreateParams(TypedDict, total=False): :ivar audio: Response-specific audio settings. :vartype audio: "PickPropertiesVoiceAudioConfig" :ivar input: Conversation items used as inline response input. - :vartype input: list["VoiceConversationItem"] + :vartype input: list["_unions.VoiceConversationItem"] :ivar pre_generated_assistant_message: A pre-generated assistant message used to begin the response. :vartype pre_generated_assistant_message: "VoiceAssistantMessageItem" @@ -8376,7 +8685,7 @@ class VoiceAgentResponseCreateParams(TypedDict, total=False): """Modalities that the response may return.""" audio: "PickPropertiesVoiceAudioConfig" """Response-specific audio settings.""" - input: list["VoiceConversationItem"] + input: list["_unions.VoiceConversationItem"] """Conversation items used as inline response input.""" pre_generated_assistant_message: Optional["VoiceAssistantMessageItem"] """A pre-generated assistant message used to begin the response.""" @@ -8447,8 +8756,11 @@ class VoiceAgentServerEventConversationItemAdded(TypedDict, total=False): # pyl :vartype type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED] :ivar previous_item_id: :vartype previous_item_id: str - :ivar item: The item added to the conversation. Required. - :vartype item: "VoiceConversationItem" + :ivar item: The item added to the conversation. Required. Is one of the following types: + VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, + VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem + :vartype item: "_unions.VoiceConversationItem" """ event_id: Required[str] @@ -8456,8 +8768,11 @@ class VoiceAgentServerEventConversationItemAdded(TypedDict, total=False): # pyl type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED]] """The event type, must be ``conversation.item.added``. Required. CONVERSATION_ITEM_ADDED.""" previous_item_id: Optional[str] - item: Required["VoiceConversationItem"] - """The item added to the conversation. Required.""" + item: Required["_unions.VoiceConversationItem"] + """The item added to the conversation. Required. Is one of the following types: + VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, + VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem""" class VoiceAgentServerEventConversationItemCreated(TypedDict, total=False): # pylint: disable=name-too-long @@ -8470,8 +8785,11 @@ class VoiceAgentServerEventConversationItemCreated(TypedDict, total=False): # p :vartype type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED] :ivar previous_item_id: :vartype previous_item_id: str - :ivar item: The created conversation item. Required. - :vartype item: "VoiceConversationItem" + :ivar item: The created conversation item. Required. Is one of the following types: + VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, + VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem + :vartype item: "_unions.VoiceConversationItem" """ event_id: Required[str] @@ -8479,8 +8797,11 @@ class VoiceAgentServerEventConversationItemCreated(TypedDict, total=False): # p type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED]] """The event type, must be ``conversation.item.created``. Required. CONVERSATION_ITEM_CREATED.""" previous_item_id: Optional[str] - item: Required["VoiceConversationItem"] - """The created conversation item. Required.""" + item: Required["_unions.VoiceConversationItem"] + """The created conversation item. Required. Is one of the following types: VoiceSystemMessageItem, + VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, + VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem""" class VoiceAgentServerEventConversationItemDeleted(TypedDict, total=False): # pylint: disable=name-too-long @@ -8513,8 +8834,11 @@ class VoiceAgentServerEventConversationItemDone(TypedDict, total=False): # pyli :vartype type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE] :ivar previous_item_id: :vartype previous_item_id: str - :ivar item: The completed conversation item. Required. - :vartype item: "VoiceConversationItem" + :ivar item: The completed conversation item. Required. Is one of the following types: + VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, + VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem + :vartype item: "_unions.VoiceConversationItem" """ event_id: Required[str] @@ -8522,8 +8846,11 @@ class VoiceAgentServerEventConversationItemDone(TypedDict, total=False): # pyli type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE]] """The event type, must be ``conversation.item.done``. Required. CONVERSATION_ITEM_DONE.""" previous_item_id: Optional[str] - item: Required["VoiceConversationItem"] - """The completed conversation item. Required.""" + item: Required["_unions.VoiceConversationItem"] + """The completed conversation item. Required. Is one of the following types: + VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, + VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem""" class VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted( @@ -8696,16 +9023,22 @@ class VoiceAgentServerEventConversationItemRetrieved(TypedDict, total=False): # :ivar type: The event type, must be ``conversation.item.retrieved``. Required. CONVERSATION_ITEM_RETRIEVED. :vartype type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED] - :ivar item: The retrieved conversation item. Required. - :vartype item: "VoiceConversationItem" + :ivar item: The retrieved conversation item. Required. Is one of the following types: + VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, + VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem + :vartype item: "_unions.VoiceConversationItem" """ event_id: Required[str] """The unique ID of the server event. Required.""" type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED]] """The event type, must be ``conversation.item.retrieved``. Required. CONVERSATION_ITEM_RETRIEVED.""" - item: Required["VoiceConversationItem"] - """The retrieved conversation item. Required.""" + item: Required["_unions.VoiceConversationItem"] + """The retrieved conversation item. Required. Is one of the following types: + VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, + VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem""" class VoiceAgentServerEventConversationItemTruncated(TypedDict, total=False): # pylint: disable=name-too-long @@ -9633,8 +9966,11 @@ class VoiceAgentServerEventResponseOutputItemAdded(TypedDict, total=False): # p :vartype response_id: str :ivar output_index: The index of the output item in the Response. Required. :vartype output_index: int - :ivar item: The output item that was added. Required. - :vartype item: "VoiceConversationItem" + :ivar item: The output item that was added. Required. Is one of the following types: + VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, + VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem + :vartype item: "_unions.VoiceConversationItem" """ event_id: Required[str] @@ -9645,8 +9981,11 @@ class VoiceAgentServerEventResponseOutputItemAdded(TypedDict, total=False): # p """The ID of the Response to which the item belongs. Required.""" output_index: Required[int] """The index of the output item in the Response. Required.""" - item: Required["VoiceConversationItem"] - """The output item that was added. Required.""" + item: Required["_unions.VoiceConversationItem"] + """The output item that was added. Required. Is one of the following types: + VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, + VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem""" class VoiceAgentServerEventResponseOutputItemDone(TypedDict, total=False): # pylint: disable=name-too-long @@ -9661,8 +10000,11 @@ class VoiceAgentServerEventResponseOutputItemDone(TypedDict, total=False): # py :vartype response_id: str :ivar output_index: The index of the output item in the Response. Required. :vartype output_index: int - :ivar item: The output item that finished streaming. Required. - :vartype item: "VoiceConversationItem" + :ivar item: The output item that finished streaming. Required. Is one of the following types: + VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, + VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem + :vartype item: "_unions.VoiceConversationItem" """ event_id: Required[str] @@ -9673,8 +10015,11 @@ class VoiceAgentServerEventResponseOutputItemDone(TypedDict, total=False): # py """The ID of the Response to which the item belongs. Required.""" output_index: Required[int] """The index of the output item in the Response. Required.""" - item: Required["VoiceConversationItem"] - """The output item that finished streaming. Required.""" + item: Required["_unions.VoiceConversationItem"] + """The output item that finished streaming. Required. Is one of the following types: + VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, + VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, + VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem""" class VoiceAgentServerEventResponseTextDelta(TypedDict, total=False): @@ -10232,49 +10577,35 @@ class VoiceAgentTranscriptionWord(TypedDict, total=False): """The word duration in milliseconds. Required.""" -class VoiceAssistantMessageItem(TypedDict, total=False): +class VoiceAssistantMessageItem(RealtimeConversationItemMessageAssistant): """An assistant message item. Only ``output_text`` and ``output_audio`` content are valid for assistant messages. - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: int - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str - :ivar type: Required. A message item. - :vartype type: Literal[VoiceConversationItemType.MESSAGE] :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: Literal["realtime.item"] + :ivar type: The type of the item. Always ``message``. Required. Default value is "message". + :vartype type: Literal["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: Literal["completed", "incomplete", "in_progress"] + :ivar role: The role of the message sender. Always ``assistant``. Required. ASSISTANT. + :vartype role: Literal[RealtimeConversationItemMessageType.ASSISTANT] :ivar content: The content of the message. Required. :vartype content: list["RealtimeConversationItemMessageAssistantContent"] - :ivar role: Required. ASSISTANT. - :vartype role: Literal[RealtimeConversationItemMessageType.ASSISTANT] + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: int + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str """ created_at: int """The Unix timestamp (in seconds) for when the item was persisted.""" response_id: str """The id of the response that produced this item, when applicable.""" - type: Required[Literal[VoiceConversationItemType.MESSAGE]] - """Required. A message item.""" - id: str - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Literal["realtime.item"] - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - status: Literal["completed", "incomplete", "in_progress"] - """The status of the item. Has no effect on the conversation. Is one of the following types: - Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" - content: Required[list["RealtimeConversationItemMessageAssistantContent"]] - """The content of the message. Required.""" - role: Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] - """Required. ASSISTANT.""" class VoiceAudioConfig(TypedDict, total=False): @@ -10653,19 +10984,17 @@ class VoiceEndOfUtteranceDetection(TypedDict, total=False): """The detection timeout in milliseconds.""" -class VoiceFunctionCallItem(TypedDict, total=False): +class VoiceFunctionCallItem(RealtimeConversationItemFunctionCall): """A function call request item. - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: int - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_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: Literal["realtime.item"] + :ivar type: The type of the item. Always ``function_call``. Required. FUNCTION_CALL. + :vartype type: Literal[RealtimeConversationItemType.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: Literal["completed", "incomplete", "in_progress"] @@ -10676,46 +11005,30 @@ class VoiceFunctionCallItem(TypedDict, total=False): :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 type: Required. A function-call request item. - :vartype type: Literal[VoiceConversationItemType.FUNCTION_CALL] + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: int + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str """ created_at: int """The Unix timestamp (in seconds) for when the item was persisted.""" response_id: str """The id of the response that produced this item, when applicable.""" - id: str - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Literal["realtime.item"] - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - status: Literal["completed", "incomplete", "in_progress"] - """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 - """The ID of the function call.""" - name: Required[str] - """The name of the function being called. Required.""" - arguments: Required[str] - """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.""" - type: Required[Literal[VoiceConversationItemType.FUNCTION_CALL]] - """Required. A function-call request item.""" -class VoiceFunctionCallOutputItem(TypedDict, total=False): +class VoiceFunctionCallOutputItem(RealtimeConversationItemFunctionCallOutput): """A function call output item. - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: int - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_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: Literal["realtime.item"] + :ivar type: The type of the item. Always ``function_call_output``. Required. + FUNCTION_CALL_OUTPUT. + :vartype type: Literal[RealtimeConversationItemType.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: Literal["completed", "incomplete", "in_progress"] @@ -10724,8 +11037,10 @@ class VoiceFunctionCallOutputItem(TypedDict, total=False): :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 type: Required. A function-call output item. - :vartype type: Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT] + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: int + :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 @@ -10735,21 +11050,6 @@ class VoiceFunctionCallOutputItem(TypedDict, total=False): """The Unix timestamp (in seconds) for when the item was persisted.""" response_id: str """The id of the response that produced this item, when applicable.""" - id: str - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Literal["realtime.item"] - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - status: Literal["completed", "incomplete", "in_progress"] - """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: Required[str] - """The ID of the function call this output is for. Required.""" - output: Required[str] - """The output of the function call, this is free text and can contain any information or simply be - empty. Required.""" - type: Required[Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT]] - """Required. A function-call output item.""" name: str """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``.""" @@ -10811,13 +11111,12 @@ class VoiceInputTranscription(TypedDict, total=False): """Optional phrase hints that bias recognition toward domain terms.""" -class VoiceMcpApprovalRequestItem(TypedDict, total=False): +class VoiceMcpApprovalRequestItem(RealtimeMCPApprovalRequest): """An MCP approval request item. - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: int - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str + :ivar type: The type of the item. Always ``mcp_approval_request``. Required. + MCP_APPROVAL_REQUEST. + :vartype type: Literal[RealtimeConversationItemType.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. @@ -10826,33 +11125,24 @@ class VoiceMcpApprovalRequestItem(TypedDict, total=False): :vartype name: str :ivar arguments: A JSON string of arguments for the tool. Required. :vartype arguments: str - :ivar type: Required. An MCP approval request item. - :vartype type: Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST] + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: int + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str """ created_at: int """The Unix timestamp (in seconds) for when the item was persisted.""" response_id: str """The id of the response that produced this item, when applicable.""" - id: Required[str] - """The unique ID of the approval request. Required.""" - server_label: Required[str] - """The label of the MCP server making the request. Required.""" - name: Required[str] - """The name of the tool to run. Required.""" - arguments: Required[str] - """A JSON string of arguments for the tool. Required.""" - type: Required[Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST]] - """Required. An MCP approval request item.""" -class VoiceMcpApprovalResponseItem(TypedDict, total=False): +class VoiceMcpApprovalResponseItem(RealtimeMCPApprovalResponse): """An MCP approval response item (client-created). - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: int - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str + :ivar type: The type of the item. Always ``mcp_approval_response``. Required. + MCP_APPROVAL_RESPONSE. + :vartype type: Literal[RealtimeConversationItemType.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. @@ -10861,32 +11151,23 @@ class VoiceMcpApprovalResponseItem(TypedDict, total=False): :vartype approve: bool :ivar reason: :vartype reason: str - :ivar type: Required. An MCP approval response item. - :vartype type: Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE] + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: int + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str """ created_at: int """The Unix timestamp (in seconds) for when the item was persisted.""" response_id: str """The id of the response that produced this item, when applicable.""" - id: Required[str] - """The unique ID of the approval response. Required.""" - approval_request_id: Required[str] - """The ID of the approval request being answered. Required.""" - approve: Required[bool] - """Whether the request was approved. Required.""" - reason: Optional[str] - type: Required[Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE]] - """Required. An MCP approval response item.""" -class VoiceMcpCallItem(TypedDict, total=False): +class VoiceMcpCallItem(RealtimeMCPToolCall): """An MCP call item. - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: int - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str + :ivar type: The type of the item. Always ``mcp_call``. Required. MCP_CALL. + :vartype type: Literal[RealtimeConversationItemType.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. @@ -10901,58 +11182,39 @@ class VoiceMcpCallItem(TypedDict, total=False): :vartype output: str :ivar error: :vartype error: "RealtimeMCPError" - :ivar type: Required. An MCP call item. - :vartype type: Literal[VoiceConversationItemType.MCP_CALL] + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: int + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str """ created_at: int """The Unix timestamp (in seconds) for when the item was persisted.""" response_id: str """The id of the response that produced this item, when applicable.""" - id: Required[str] - """The unique ID of the tool call. Required.""" - server_label: Required[str] - """The label of the MCP server running the tool. Required.""" - name: Required[str] - """The name of the tool that was run. Required.""" - arguments: Required[str] - """A JSON string of the arguments passed to the tool. Required.""" - approval_request_id: Optional[str] - output: Optional[str] - error: "RealtimeMCPError" - type: Required[Literal[VoiceConversationItemType.MCP_CALL]] - """Required. An MCP call item.""" -class VoiceMcpListToolsItem(TypedDict, total=False): +class VoiceMcpListToolsItem(RealtimeMCPListTools): """An MCP list-tools item. - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: int - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str + :ivar type: The type of the item. Always ``mcp_list_tools``. Required. MCP_LIST_TOOLS. + :vartype type: Literal[RealtimeConversationItemType.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["MCPListToolsTool"] - :ivar type: Required. An MCP list-tools item. - :vartype type: Literal[VoiceConversationItemType.MCP_LIST_TOOLS] + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: int + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str """ created_at: int """The Unix timestamp (in seconds) for when the item was persisted.""" response_id: str """The id of the response that produced this item, when applicable.""" - id: str - """The unique ID of the list.""" - server_label: Required[str] - """The label of the MCP server. Required.""" - tools: Required[list["MCPListToolsTool"]] - """The tools available on the server. Required.""" - type: Required[Literal[VoiceConversationItemType.MCP_LIST_TOOLS]] - """Required. An MCP list-tools item.""" class VoiceNoiseReduction(TypedDict, total=False): @@ -11051,48 +11313,34 @@ class VoiceServerVadTurnDetection(TypedDict, total=False): """Semantic end-of-utterance detection configuration. Set to null to disable it.""" -class VoiceSystemMessageItem(TypedDict, total=False): +class VoiceSystemMessageItem(RealtimeConversationItemMessageSystem): """A system message item. Only ``input_text`` content is valid for system messages. - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: int - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str - :ivar type: Required. A message item. - :vartype type: Literal[VoiceConversationItemType.MESSAGE] :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: Literal["realtime.item"] + :ivar type: The type of the item. Always ``message``. Required. Default value is "message". + :vartype type: Literal["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: Literal["completed", "incomplete", "in_progress"] + :ivar role: The role of the message sender. Always ``system``. Required. SYSTEM. + :vartype role: Literal[RealtimeConversationItemMessageType.SYSTEM] :ivar content: The content of the message. Required. :vartype content: list["RealtimeConversationItemMessageSystemContent"] - :ivar role: Required. SYSTEM. - :vartype role: Literal[RealtimeConversationItemMessageType.SYSTEM] + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: int + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str """ created_at: int """The Unix timestamp (in seconds) for when the item was persisted.""" response_id: str """The id of the response that produced this item, when applicable.""" - type: Required[Literal[VoiceConversationItemType.MESSAGE]] - """Required. A message item.""" - id: str - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Literal["realtime.item"] - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - status: Literal["completed", "incomplete", "in_progress"] - """The status of the item. Has no effect on the conversation. Is one of the following types: - Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" - content: Required[list["RealtimeConversationItemMessageSystemContent"]] - """The content of the message. Required.""" - role: Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] - """Required. SYSTEM.""" class VoiceSystemTool(TypedDict, total=False): @@ -11143,49 +11391,35 @@ class VoiceToolboxTool(TypedDict, total=False): values are: \"silent\", \"when_idle\", \"interrupt\", and \"skip_if_busy\".""" -class VoiceUserMessageItem(TypedDict, total=False): +class VoiceUserMessageItem(RealtimeConversationItemMessageUser): """A user message item. ``input_text``, ``input_audio``, and ``input_image`` content are valid for user messages. - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: int - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str - :ivar type: Required. A message item. - :vartype type: Literal[VoiceConversationItemType.MESSAGE] :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: Literal["realtime.item"] + :ivar type: The type of the item. Always ``message``. Required. Default value is "message". + :vartype type: Literal["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: Literal["completed", "incomplete", "in_progress"] + :ivar role: The role of the message sender. Always ``user``. Required. USER. + :vartype role: Literal[RealtimeConversationItemMessageType.USER] :ivar content: The content of the message. Required. :vartype content: list["RealtimeConversationItemMessageUserContent"] - :ivar role: Required. USER. - :vartype role: Literal[RealtimeConversationItemMessageType.USER] + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: int + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str """ created_at: int """The Unix timestamp (in seconds) for when the item was persisted.""" response_id: str """The id of the response that produced this item, when applicable.""" - type: Required[Literal[VoiceConversationItemType.MESSAGE]] - """Required. A message item.""" - id: str - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Literal["realtime.item"] - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - status: Literal["completed", "incomplete", "in_progress"] - """The status of the item. Has no effect on the conversation. Is one of the following types: - Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" - content: Required[list["RealtimeConversationItemMessageUserContent"]] - """The content of the message. Required.""" - role: Required[Literal[RealtimeConversationItemMessageType.USER]] - """Required. USER.""" class WebIQPreviewTool(TypedDict, total=False): @@ -12004,6 +12238,17 @@ class UpdateToolboxRequest1(TypedDict, total=False): OpenApiAuthDetails = Union[OpenApiAnonymousAuthDetails, OpenApiManagedAuthDetails, OpenApiProjectConnectionAuthDetails] TelemetryEndpoint = Union[OtlpTelemetryEndpoint] RealtimeAudioFormats = Union[RealtimeAudioFormatsAudioPcm, RealtimeAudioFormatsAudioPcma, RealtimeAudioFormatsAudioPcmu] +RealtimeConversationItem = Union[ + RealtimeConversationItemFunctionCall, + RealtimeConversationItemFunctionCallOutput, + RealtimeMCPApprovalRequest, + RealtimeMCPApprovalResponse, + RealtimeMCPToolCall, + RealtimeMCPListTools, +] +RealtimeConversationItemMessage = Union[ + RealtimeConversationItemMessageAssistant, RealtimeConversationItemMessageSystem, RealtimeConversationItemMessageUser +] RealtimeMCPError = Union[RealtimeMCPHTTPError, RealtimeMCPProtocolError, RealtimeMCPToolExecutionError] RealtimeServerEvent = Union[RealtimeServerEventResponseContentPartAdded] ToolChoiceParam = Union[ @@ -12035,13 +12280,3 @@ class UpdateToolboxRequest1(TypedDict, total=False): VoiceAgentSemanticVadTurnDetection, VoiceServerVadTurnDetection, ] -VoiceMessageItem = Union[VoiceAssistantMessageItem, VoiceSystemMessageItem, VoiceUserMessageItem] -VoiceConversationItem = Union[ - VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, - VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem, - VoiceMcpCallItem, - VoiceMcpListToolsItem, - VoiceMessageItem, -] diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml.saved b/sdk/ai/azure-ai-projects/tsp-location.yaml.saved index 7d086bbc82a2..c33c5ae1aab6 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml.saved +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml.saved @@ -1,5 +1,5 @@ directory: specification/ai-foundry/data-plane/Foundry/src/sdk-python-js-azure-ai-projects -commit: dcfcf524cecab2843efb6a7e1645aa135aa1622e +commit: 28f4aa282161f8a6ab91813a51d287ddb762e7d2 repo: Azure/azure-rest-api-specs additionalDirectories: - specification/ai-foundry/data-plane/Foundry/src/agents From dbfd60ef1e04d89f2a41de6d3190e5925c380eea Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Sat, 22 Aug 2026 17:00:09 -0700 Subject: [PATCH 40/56] Regenerate SDK from TypeSpec commit 8692ffec (voice agents v1 preview opt-in, session file IO[bytes] uploads) - Add foundry_features_query opt-in parameter (_AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW) to the voice agent WebSocket connect operation - Widen AgentsOperations.upload_session_file to accept IO[bytes] in addition to bytes - Simplify several create/patch body overloads to Union[JSON, IO[bytes]], dropping now-unused typed-dict overloads - Reword output_modalities docstring - Bump version to 2.6.0 and update CHANGELOG Co-Authored-By: Claude Sonnet 5 --- sdk/ai/azure-ai-projects/CHANGELOG.md | 16 + sdk/ai/azure-ai-projects/PostEmitter.ps1 | 39 +- .../azure-ai-projects/apiview-properties.json | 3 +- .../azure/ai/projects/_client.py | 2 +- .../azure/ai/projects/_configuration.py | 3 +- .../azure/ai/projects/_utils/model_base.py | 18 +- .../azure/ai/projects/_utils/serialization.py | 6 +- .../azure/ai/projects/_version.py | 2 +- .../azure/ai/projects/aio/_client.py | 2 +- .../azure/ai/projects/aio/_configuration.py | 3 +- .../ai/projects/aio/operations/_operations.py | 744 ++++----- .../aio/operations/_patch_agents_async.py | 6 +- .../aio/operations/_patch_datasets_async.py | 6 +- .../aio/operations/_patch_evaluators_async.py | 6 +- .../azure/ai/projects/models/__init__.py | 2 + .../azure/ai/projects/models/_models.py | 1403 +++++++++++------ .../ai/projects/operations/_operations.py | 750 ++++----- .../ai/projects/operations/_patch_agents.py | 6 +- .../ai/projects/operations/_patch_datasets.py | 6 +- .../projects/operations/_patch_evaluators.py | 6 +- .../azure-ai-projects/tsp-location.yaml.saved | 2 +- 21 files changed, 1665 insertions(+), 1366 deletions(-) diff --git a/sdk/ai/azure-ai-projects/CHANGELOG.md b/sdk/ai/azure-ai-projects/CHANGELOG.md index f1c0bb9dff89..e1f88fb372e4 100644 --- a/sdk/ai/azure-ai-projects/CHANGELOG.md +++ b/sdk/ai/azure-ai-projects/CHANGELOG.md @@ -1,5 +1,21 @@ # Release History +## 2.6.0 (Unreleased) + +### Features Added + +* Added voice agents, unified with the rest of the Agents API as a new `kind="voice"` on `AgentDefinition`: + * Define a voice agent with `VoiceAgentDefinition`, configuring its model (`VoiceModelType`), audio input/output (`VoiceAudioConfig`, `VoiceAudioInputConfig`, `VoiceAudioOutputConfig`), turn detection (`VoiceTurnDetection` and its `VoiceServerVadTurnDetection` / `VoiceSemanticVadTurnDetection` / `VoiceAzureSemanticVadTurnDetection` variants), greeting (`VoiceGreetingConfig`), tools (`VoiceAgentTool`, `VoiceAgentFunctionTool`, `VoiceAgentMcpTool`, `VoiceToolboxTool`), and avatar (`VoiceAvatarConfig`). Manage it like any other agent through `project_client.agents` (`create_version`, `get`, `list`, `disable`/`enable`, `delete`). + * Added guided authoring via `project_client.agents.generate_agent(GenerateVoiceAgentRequest(kind=AgentKind.VOICE, ...))`, which returns a service-generated starter definition that can be edited afterward through the standard `create_version`/`update` flow. + * Added a new `client.realtime` / `async_client.realtime` entry point for realtime speech-to-speech streaming. Use `with client.realtime.connect(agent_name=...) as connection:` to open a WebSocket connection, `connection.send(...)` to send strongly-typed client events (or use the `connection.response`, `connection.item`, and `connection.session` helpers), and iterate over `connection` to receive strongly-typed server events (`VoiceAgentServerEvent*`, `RealtimeServerEvent*`). The new types `Realtime`, `RealtimeConnection`, and `RealtimeConnectionManager` (and their async equivalents `AsyncRealtime`, `AsyncRealtimeConnection`, `AsyncRealtimeConnectionManager`) are exported from `azure.ai.projects` / `azure.ai.projects.aio`. Requires the optional `websockets` package. + * Added the `agent_endpoint_conversations` operation group for reading back persisted voice-agent conversation transcripts and audio, for agents created with `store=True`. + * Added the underlying `RealtimeConversationItem*`, `RealtimeMCP*`, `RealtimeResponseUsage`, and related realtime event/session models used by the voice agent WebSocket protocol. +* Added 11 new samples under `samples/agents/voice/`, covering basic agent lifecycle, guided generation, live audio and text conversations (sync and async), function tools, versioning, and reading back conversation transcripts and audio. + +### Dependency update + +* Added an optional dependency on `websockets`, required only when using the new `client.realtime` / `async_client.realtime` voice agent streaming APIs. + ## 2.5.0 (2026-08-20) ### Dependency update diff --git a/sdk/ai/azure-ai-projects/PostEmitter.ps1 b/sdk/ai/azure-ai-projects/PostEmitter.ps1 index 2cf7063e2f4b..233f4ffb6fcf 100644 --- a/sdk/ai/azure-ai-projects/PostEmitter.ps1 +++ b/sdk/ai/azure-ai-projects/PostEmitter.ps1 @@ -120,7 +120,16 @@ foreach ($f in $files) { # (models/_enums.py). The emitter wraps long bullet-item lines without indenting the # continuation lines to align with the bullet's text, and (for VoiceAudioOutputConfig) runs the # trailing summary sentence straight into the last bullet with no blank line to end the list. -$oldVoiceAudioOutputConfig = @" +# +# NOTE: these here-strings use single-quoted @'...'@ delimiters (not @"..."@) on purpose. +# Double-quoted here-strings still process backtick escape sequences, and since this text is +# full of literal Markdown backticks (`` `azure-standard` ``, etc.), any backtick not immediately +# followed by a recognized escape letter (n, r, t, 0, a, b, f, v, e, #, ', ", `) gets silently +# DROPPED by the PowerShell parser -- with no error or warning. That corrupts $oldVoiceAudioOutputConfig +# so it can never match the real (backtick-containing) generated file content, and .Replace() then +# just silently no-ops. Single-quoted here-strings disable all escape/interpolation processing, so +# the backticks survive exactly as written. +$oldVoiceAudioOutputConfig = @' * `azure-standard`: `voice`, `voice_locale`, `speed`, `voice_temperature`, `custom_lexicon_url`, `custom_text_normalization_url`, `prefer_locales`, `style`, `pitch`, and `volume`. @@ -130,8 +139,8 @@ $oldVoiceAudioOutputConfig = @" `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. -"@ -$newVoiceAudioOutputConfig = @" +'@ +$newVoiceAudioOutputConfig = @' * `azure-standard`: `voice`, `voice_locale`, `speed`, `voice_temperature`, `custom_lexicon_url`, `custom_text_normalization_url`, `prefer_locales`, `style`, `pitch`, and `volume`. @@ -142,7 +151,7 @@ $newVoiceAudioOutputConfig = @" * `azure-realtime-native`: `voice` and `speed`. `format` and `output_audio_timestamp_types` apply to every voice type. -"@ +'@ $files = 'azure\ai\projects\types.py', 'azure\ai\projects\models\_models.py' foreach ($f in $files) { $c = Get-Content $f -Raw @@ -152,8 +161,9 @@ foreach ($f in $files) { $f = 'azure\ai\projects\models\_enums.py' $c = Get-Content $f -Raw +# NOTE: single-quoted @'...'@ here-strings -- see comment above the VoiceAudioOutputConfig fix for why. $c = $c.Replace( -@" +@' * `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 @@ -161,8 +171,8 @@ $c = $c.Replace( 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 @@ -170,7 +180,7 @@ $c = $c.Replace( 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. -"@ +'@ ) Set-Content $f $c -NoNewline @@ -328,16 +338,13 @@ Set-Content $f $c -NoNewline # persisted voice response always has both set). Pyright's reportIncompatibleVariableOverride # flags this because narrowing a *mutable* attribute's type in a subclass isn't sound in general, # but it's safe here by construction (the service never omits these for a persisted response). +# NOTE: uses -replace with a \r?\n-tolerant regex (not .Replace() with a literal `n), since `n +# always resolves to a bare LF and can never match this file's real CRLF line endings -- the +# $1/$2 replacement backreferences preserve whatever newline the regex actually matched. $f = 'azure\ai\projects\models\_models.py' $c = Get-Content $f -Raw -$c = $c.Replace( - " id: str = rest_field(visibility=[`"read`", `"create`", `"update`", `"delete`", `"query`"])`n `"`"`"The unique id of the response. Required.`"`"`"", - " id: str = rest_field(visibility=[`"read`", `"create`", `"update`", `"delete`", `"query`"]) # type: ignore[reportIncompatibleVariableOverride]`n `"`"`"The unique id of the response. Required.`"`"`"" -) -$c = $c.Replace( - " conversation_id: str = rest_field(visibility=[`"read`", `"create`", `"update`", `"delete`", `"query`"])`n `"`"`"The id of the conversation this response belongs to. Required.`"`"`"", - " conversation_id: str = rest_field(visibility=[`"read`", `"create`", `"update`", `"delete`", `"query`"]) # type: ignore[reportIncompatibleVariableOverride]`n `"`"`"The id of the conversation this response belongs to. Required.`"`"`"" -) +$c = $c -replace '(id: str = rest_field\(visibility=\["read", "create", "update", "delete", "query"\]\))(\r?\n """The unique id of the response\. Required\.""")', '$1 # type: ignore[reportIncompatibleVariableOverride]$2' +$c = $c -replace '(conversation_id: str = rest_field\(visibility=\["read", "create", "update", "delete", "query"\]\))(\r?\n """The id of the conversation this response belongs to\. Required\.""")', '$1 # type: ignore[reportIncompatibleVariableOverride]$2' Set-Content $f $c -NoNewline # Finishing by running 'black' tool to format code. diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index 18ae677dc828..8ffc24bf213c 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -643,6 +643,7 @@ "azure.ai.projects.models.AgentSessionStatus": "Azure.AI.Projects.AgentSessionStatus", "azure.ai.projects.models.SessionLogEventType": "Azure.AI.Projects.SessionLogEventType", "azure.ai.projects.models.VoiceAgentWebSocketSubprotocol": "Azure.AI.Projects.VoiceAgentWebSocketSubprotocol", + "azure.ai.projects.models._AgentDefinitionOptInKeys": "Azure.AI.Projects.AgentDefinitionOptInKeys", "azure.ai.projects.models.VoiceConversationStatus": "Azure.AI.Projects.VoiceConversationStatus", "azure.ai.projects.models.RealtimeConversationItemMessageType": "OpenAI.RealtimeConversationItemMessageType", "azure.ai.projects.models.RealtimeConversationItemType": "OpenAI.RealtimeConversationItemType", @@ -793,5 +794,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": "9872c35ac0b9" + "CrossLanguageVersion": "0e6d765a5930" } \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py index ac92e6ab8879..fbb310d5efda 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py @@ -37,7 +37,7 @@ from azure.core.credentials import TokenCredential -class AIProjectClient: # pylint: disable=too-many-instance-attributes +class AIProjectClient: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """AIProjectClient. :ivar beta: BetaOperations operations diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_configuration.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_configuration.py index dbc21038f880..71772d698792 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_configuration.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_configuration.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -16,7 +17,7 @@ from azure.core.credentials import TokenCredential -class AIProjectClientConfiguration: # pylint: disable=too-many-instance-attributes +class AIProjectClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """Configuration for AIProjectClient. Note that all parameters used to create this instance are saved as instance diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/model_base.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/model_base.py index 1934415c1369..88aaf1823543 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/model_base.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/model_base.py @@ -158,7 +158,15 @@ def _is_readonly(p): class SdkJSONEncoder(JSONEncoder): - """A JSON encoder that's capable of serializing datetime objects and bytes.""" + """A JSON encoder that's capable of serializing datetime objects and bytes. + + :param args: Additional positional arguments passed to the base ``JSONEncoder``. + :type args: typing.Any + :keyword exclude_readonly: Whether to exclude readonly properties. Defaults to False. + :paramtype exclude_readonly: bool + :keyword format: The format to use for serialization. Defaults to None. + :paramtype format: typing.Optional[str] + """ def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): super().__init__(*args, **kwargs) @@ -342,6 +350,12 @@ def _deserialize_int_as_str(attr): return int(attr) +def _deserialize_bool_as_str(attr): + if isinstance(attr, bool): + return attr + return attr.lower() == "true" + + _DESERIALIZE_MAPPING = { datetime: _deserialize_datetime, date: _deserialize_date, @@ -369,6 +383,8 @@ def _deserialize_int_as_str(attr): def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): if annotation is int and rf and rf._format == "str": return _deserialize_int_as_str + if annotation is bool and rf and rf._format == "str": + return _deserialize_bool_as_str if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) if rf and rf._format: diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/serialization.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/serialization.py index 75906e2eb77f..ae08f9d89f74 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/serialization.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/serialization.py @@ -480,7 +480,11 @@ def _decode_attribute_map_key(key): class Serializer: # pylint: disable=too-many-public-methods - """Request object model serializer.""" + """Request object model serializer. + + :param classes: Mapping of model names to model types, used to resolve models during serialization. + :type classes: typing.Optional[typing.Mapping[str, type]] + """ basic_types = {str: "str", int: "int", bool: "bool", float: "float"} 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 602c3a5f5b94..454133e48caa 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.5.0" +VERSION = "2.6.0" diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py index 1dd6ecac6c5e..7fc3b32df9ab 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py @@ -37,7 +37,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class AIProjectClient: # pylint: disable=too-many-instance-attributes +class AIProjectClient: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """AIProjectClient. :ivar beta: BetaOperations operations diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_configuration.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_configuration.py index bb5588e5968e..52e5a14d7b8b 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_configuration.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_configuration.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -16,7 +17,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class AIProjectClientConfiguration: # pylint: disable=too-many-instance-attributes +class AIProjectClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """Configuration for AIProjectClient. Note that all parameters used to create this instance are saved as instance 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 bbf45cb8dc64..c732e40da317 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 @@ -32,10 +32,11 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict -from ... import models as _models, types as _types +from ... import models as _models from ..._utils.model_base import Model as _Model, SdkJSONEncoder, _deserialize, _failsafe_deserialize from ..._utils.serialization import Deserializer, Serializer from ..._utils.utils import prepare_multipart_form_data +from ...models._enums import _AgentDefinitionOptInKeys from ...operations._operations import ( build_agent_endpoint_conversations_delete_agent_conversation_request, build_agent_endpoint_conversations_get_agent_conversation_audio_content_request, @@ -195,7 +196,7 @@ List = list -class BetaOperations: # pylint: disable=too-many-instance-attributes +class BetaOperations: # pylint: disable=docstring-missing-param,too-many-instance-attributes """ .. warning:: **DO NOT** instantiate this class directly. @@ -227,7 +228,7 @@ def __init__(self, *args, **kwargs) -> None: self.agents = BetaAgentsOperations(self._client, self._config, self._serialize, self._deserialize) -class AgentsOperations: # pylint: disable=too-many-public-methods +class AgentsOperations: # pylint: disable=docstring-missing-param,too-many-public-methods """ .. warning:: **DO NOT** instantiate this class directly. @@ -612,12 +613,7 @@ async def create_version( @overload async def create_version( - self, - agent_name: str, - body: _types.CreateAgentVersionRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentVersionDetails: """Create an agent version. @@ -631,7 +627,7 @@ async def create_version( * Must not exceed 63 characters. Required. :type agent_name: str :param body: Required. - :type body: ~azure.ai.projects.types.CreateAgentVersionRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -669,7 +665,7 @@ async def create_version( async def create_version( self, agent_name: str, - body: Union[JSON, _types.CreateAgentVersionRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, definition: _models.AgentDefinition = _Unset, metadata: Optional[dict[str, str]] = None, @@ -689,9 +685,8 @@ async def create_version( * Can contain hyphens in the middle * Must not exceed 63 characters. Required. :type agent_name: str - :param body: Is one of the following types: JSON, CreateAgentVersionRequest, IO[bytes] - Required. - :type body: JSON or ~azure.ai.projects.types.CreateAgentVersionRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword definition: The agent definition. This can be a prompt, workflow, hosted, external, or voice agent definition. Required. :paramtype definition: ~azure.ai.projects.models.AgentDefinition @@ -838,12 +833,7 @@ async def create_version_from_manifest( @overload async def create_version_from_manifest( - self, - agent_name: str, - body: _types.CreateAgentVersionFromManifestRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentVersionDetails: """Create an agent version from manifest. @@ -857,7 +847,7 @@ async def create_version_from_manifest( * Must not exceed 63 characters. Required. :type agent_name: str :param body: Required. - :type body: ~azure.ai.projects.types.CreateAgentVersionFromManifestRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -895,7 +885,7 @@ async def create_version_from_manifest( async def create_version_from_manifest( self, agent_name: str, - body: Union[JSON, _types.CreateAgentVersionFromManifestRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, manifest_id: str = _Unset, parameter_values: dict[str, Any] = _Unset, @@ -914,9 +904,8 @@ async def create_version_from_manifest( * Can contain hyphens in the middle * Must not exceed 63 characters. Required. :type agent_name: str - :param body: Is one of the following types: JSON, CreateAgentVersionFromManifestRequest, - IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.CreateAgentVersionFromManifestRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword manifest_id: The manifest ID to import the agent version from. Required. :paramtype manifest_id: str :keyword parameter_values: The inputs to the manifest that will result in a fully materialized @@ -1295,12 +1284,7 @@ async def update_details( @overload async def update_details( - self, - agent_name: str, - body: _types.PatchAgentObjectRequest, - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any + self, agent_name: str, body: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.AgentDetails: """Update an agent endpoint. @@ -1309,7 +1293,7 @@ async def update_details( :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str :param body: Required. - :type body: ~azure.ai.projects.types.PatchAgentObjectRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -1342,7 +1326,7 @@ async def update_details( async def update_details( self, agent_name: str, - body: Union[JSON, _types.PatchAgentObjectRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, agent_endpoint: Optional[_models.AgentEndpointConfig] = None, agent_card: Optional[_models.AgentCard] = None, @@ -1354,8 +1338,8 @@ async def update_details( :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str - :param body: Is one of the following types: JSON, PatchAgentObjectRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.PatchAgentObjectRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword agent_endpoint: The endpoint configuration for the agent. Default value is None. :paramtype agent_endpoint: ~azure.ai.projects.models.AgentEndpointConfig :keyword agent_card: Optional agent card for the agent. Default value is None. @@ -1443,19 +1427,14 @@ async def _create_version_from_code( ) -> _models.AgentVersionDetails: ... @overload async def _create_version_from_code( - self, - agent_name: str, - content: _types._CreateAgentVersionFromCodeContent, - *, - code_zip_sha256: str, - **kwargs: Any + self, agent_name: str, content: JSON, *, code_zip_sha256: str, **kwargs: Any ) -> _models.AgentVersionDetails: ... @distributed_trace_async async def _create_version_from_code( self, agent_name: str, - content: Union[_models._models._CreateAgentVersionFromCodeContent, _types._CreateAgentVersionFromCodeContent], + content: Union[_models._models._CreateAgentVersionFromCodeContent, JSON], *, code_zip_sha256: str, **kwargs: Any @@ -1474,10 +1453,9 @@ async def _create_version_from_code( * Can contain hyphens in the middle * Must not exceed 63 characters. Required. :type agent_name: str - :param content: The content multipart request content. Is one of the following types: - _CreateAgentVersionFromCodeContent Required. - :type content: ~azure.ai.projects.models._models._CreateAgentVersionFromCodeContent or - ~azure.ai.projects.types._CreateAgentVersionFromCodeContent + :param content: The content multipart request content. Is either a + _CreateAgentVersionFromCodeContent type or a JSON type. Required. + :type content: ~azure.ai.projects.models._models._CreateAgentVersionFromCodeContent or JSON :keyword code_zip_sha256: SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity verification. Required. :paramtype code_zip_sha256: str @@ -1774,12 +1752,7 @@ async def create_session( @overload async def create_session( - self, - agent_name: str, - body: _types.CreateSessionRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentSessionResource: """Create a session. @@ -1790,7 +1763,7 @@ async def create_session( :param agent_name: The name of the agent to create a session for. Required. :type agent_name: str :param body: Required. - :type body: ~azure.ai.projects.types.CreateSessionRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1825,7 +1798,7 @@ async def create_session( async def create_session( self, agent_name: str, - body: Union[JSON, _types.CreateSessionRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, version_indicator: _models.VersionIndicator = _Unset, agent_session_id: Optional[str] = None, @@ -1839,8 +1812,8 @@ async def create_session( :param agent_name: The name of the agent to create a session for. Required. :type agent_name: str - :param body: Is one of the following types: JSON, CreateSessionRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.CreateSessionRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword version_indicator: Determines which agent version backs the session. Required. :paramtype version_indicator: ~azure.ai.projects.models.VersionIndicator :keyword agent_session_id: Optional caller-provided session ID. If specified, it must be unique @@ -2305,9 +2278,16 @@ async def get_session_log_stream( return deserialized # type: ignore - @distributed_trace_async + @overload async def upload_session_file( - self, agent_name: str, session_id: str, content: bytes, *, path: str, **kwargs: Any + self, + agent_name: str, + session_id: str, + content: bytes, + *, + path: str, + content_type: str = "application/octet-stream", + **kwargs: Any ) -> _models.SessionFileWriteResult: """Upload a session file. @@ -2323,6 +2303,65 @@ async def upload_session_file( :keyword path: The destination file path within the sandbox, relative to the session home directory. Required. :paramtype path: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/octet-stream". + :paramtype content_type: str + :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.SessionFileWriteResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def upload_session_file( + self, + agent_name: str, + session_id: str, + content: IO[bytes], + *, + path: str, + content_type: str = "application/octet-stream", + **kwargs: Any + ) -> _models.SessionFileWriteResult: + """Upload a session file. + + Uploads binary file content to the specified path in the session sandbox. The service stores + the file relative to the session home directory and rejects payloads larger than 50 MB. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param session_id: The session ID. Required. + :type session_id: str + :param content: Required. + :type content: IO[bytes] + :keyword path: The destination file path within the sandbox, relative to the session home + directory. Required. + :paramtype path: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/octet-stream". + :paramtype content_type: str + :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.SessionFileWriteResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def upload_session_file( + self, agent_name: str, session_id: str, content: Union[bytes, IO[bytes]], *, path: str, **kwargs: Any + ) -> _models.SessionFileWriteResult: + """Upload a session file. + + Uploads binary file content to the specified path in the session sandbox. The service stores + the file relative to the session home directory and rejects payloads larger than 50 MB. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param session_id: The session ID. Required. + :type session_id: str + :param content: Is either a bytes type or a IO[bytes] type. Required. + :type content: bytes or IO[bytes] + :keyword path: The destination file path within the sandbox, relative to the session home + directory. Required. + :paramtype path: str :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping :rtype: ~azure.ai.projects.models.SessionFileWriteResult :raises ~azure.core.exceptions.HttpResponseError: @@ -2338,9 +2377,10 @@ async def upload_session_file( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/octet-stream")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SessionFileWriteResult] = kwargs.pop("cls", None) + content_type = content_type or "application/octet-stream" _content = content _request = build_agents_upload_session_file_request( @@ -2640,7 +2680,7 @@ async def delete_session_file( return cls(pipeline_response, None, {}) # type: ignore -class VoiceAgentWebSocketOperations: +class VoiceAgentWebSocketOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2662,6 +2702,7 @@ async def connect_voice_agent( self, agent_name: str, *, + foundry_features_query: Optional[Literal[_AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW]] = None, agent_session_id: Optional[str] = None, store: Optional[bool] = None, agent_version_override: Optional[str] = None, @@ -2673,7 +2714,11 @@ async def connect_voice_agent( Connects to a voice agent over WebSocket. The client must send an HTTP GET with ``Upgrade: websocket`` - headers. The optional ``realtime`` subprotocol is the only accepted subprotocol value. + headers. The optional ``realtime`` subprotocol is the only accepted subprotocol value. Supply + the + ``VoiceAgents=V1Preview`` opt-in through either the ``Foundry-Features`` header or the + ``foundry_features`` + query parameter. If the target agent is disabled, the HTTP WebSocket handshake fails before the ``101 Switching Protocols`` @@ -2683,6 +2728,12 @@ async def connect_voice_agent( :param agent_name: The name of the voice agent. Required. :type agent_name: str + :keyword foundry_features_query: A query alternative to the ``Foundry-Features`` header for + clients that cannot set headers during a + WebSocket handshake. Set this to ``VoiceAgents=V1Preview``. Either this query parameter or the + header is + required. VOICE_AGENTS_V1_PREVIEW. Default value is None. + :paramtype foundry_features_query: str or ~azure.ai.projects.models.VOICE_AGENTS_V1_PREVIEW :keyword agent_session_id: An optional identifier used to correlate the voice session. Default value is None. :paramtype agent_session_id: str @@ -2721,6 +2772,7 @@ async def connect_voice_agent( _request = build_voice_agent_web_socket_connect_voice_agent_request( agent_name=agent_name, + foundry_features_query=foundry_features_query, agent_session_id=agent_session_id, store=store, agent_version_override=agent_version_override, @@ -2759,7 +2811,7 @@ async def connect_voice_agent( return cls(pipeline_response, None, response_headers) # type: ignore -class AgentEndpointConversationsOperations: +class AgentEndpointConversationsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -3831,7 +3883,7 @@ async def get_agent_conversation_audio_content( return deserialized # type: ignore -class EvaluationRulesOperations: +class EvaluationRulesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -3983,7 +4035,7 @@ async def create_or_update( @overload async def create_or_update( - self, id: str, evaluation_rule: _types.EvaluationRule, *, content_type: str = "application/json", **kwargs: Any + self, id: str, evaluation_rule: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationRule: """Create or update an evaluation rule. @@ -3992,7 +4044,7 @@ async def create_or_update( :param id: Unique identifier for the evaluation rule. Required. :type id: str :param evaluation_rule: Evaluation rule resource. Required. - :type evaluation_rule: ~azure.ai.projects.types.EvaluationRule + :type evaluation_rule: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4023,7 +4075,7 @@ async def create_or_update( @distributed_trace_async async def create_or_update( - self, id: str, evaluation_rule: Union[_models.EvaluationRule, _types.EvaluationRule, IO[bytes]], **kwargs: Any + self, id: str, evaluation_rule: Union[_models.EvaluationRule, JSON, IO[bytes]], **kwargs: Any ) -> _models.EvaluationRule: """Create or update an evaluation rule. @@ -4031,10 +4083,9 @@ async def create_or_update( :param id: Unique identifier for the evaluation rule. Required. :type id: str - :param evaluation_rule: Evaluation rule resource. Is either a EvaluationRule type or a - IO[bytes] type. Required. - :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule or - ~azure.ai.projects.types.EvaluationRule or IO[bytes] + :param evaluation_rule: Evaluation rule resource. Is one of the following types: + EvaluationRule, JSON, IO[bytes] Required. + :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule or JSON or IO[bytes] :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationRule :raises ~azure.core.exceptions.HttpResponseError: @@ -4209,7 +4260,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class ConnectionsOperations: +class ConnectionsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -4470,7 +4521,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class DatasetsOperations: +class DatasetsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -4824,7 +4875,7 @@ async def create_or_update( self, name: str, version: str, - dataset_version: _types.DatasetVersion, + dataset_version: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -4838,7 +4889,7 @@ async def create_or_update( :param version: The specific version id of the DatasetVersion to create or update. Required. :type version: str :param dataset_version: The DatasetVersion to create or update. Required. - :type dataset_version: ~azure.ai.projects.types.DatasetVersion + :type dataset_version: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -4877,11 +4928,7 @@ async def create_or_update( @distributed_trace_async async def create_or_update( - self, - name: str, - version: str, - dataset_version: Union[_models.DatasetVersion, _types.DatasetVersion, IO[bytes]], - **kwargs: Any + self, name: str, version: str, dataset_version: Union[_models.DatasetVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.DatasetVersion: """Create or update a version. @@ -4891,10 +4938,9 @@ async def create_or_update( :type name: str :param version: The specific version id of the DatasetVersion to create or update. Required. :type version: str - :param dataset_version: The DatasetVersion to create or update. Is either a DatasetVersion type - or a IO[bytes] type. Required. - :type dataset_version: ~azure.ai.projects.models.DatasetVersion or - ~azure.ai.projects.types.DatasetVersion or IO[bytes] + :param dataset_version: The DatasetVersion to create or update. Is one of the following types: + DatasetVersion, JSON, IO[bytes] Required. + :type dataset_version: ~azure.ai.projects.models.DatasetVersion or JSON or IO[bytes] :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -4994,7 +5040,7 @@ async def pending_upload( self, name: str, version: str, - pending_upload_request: _types.PendingUploadRequest, + pending_upload_request: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -5008,7 +5054,7 @@ async def pending_upload( :param version: The specific version id of the DatasetVersion to operate on. Required. :type version: str :param pending_upload_request: The pending upload request parameters. Required. - :type pending_upload_request: ~azure.ai.projects.types.PendingUploadRequest + :type pending_upload_request: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5050,7 +5096,7 @@ async def pending_upload( self, name: str, version: str, - pending_upload_request: Union[_models.PendingUploadRequest, _types.PendingUploadRequest, IO[bytes]], + pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.PendingUploadResponse: """Start a pending upload. @@ -5061,10 +5107,10 @@ async def pending_upload( :type name: str :param version: The specific version id of the DatasetVersion to operate on. Required. :type version: str - :param pending_upload_request: The pending upload request parameters. Is either a - PendingUploadRequest type or a IO[bytes] type. Required. - :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or - ~azure.ai.projects.types.PendingUploadRequest or IO[bytes] + :param pending_upload_request: The pending upload request parameters. Is one of the following + types: PendingUploadRequest, JSON, IO[bytes] Required. + :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or JSON or + IO[bytes] :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -5198,7 +5244,7 @@ async def get_credentials(self, name: str, version: str, **kwargs: Any) -> _mode return deserialized # type: ignore -class DeploymentsOperations: +class DeploymentsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -5393,7 +5439,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class IndexesOperations: +class IndexesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -5744,13 +5790,7 @@ async def create_or_update( @overload async def create_or_update( - self, - name: str, - version: str, - index: _types.Index, - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any + self, name: str, version: str, index: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.Index: """Create or update a version. @@ -5761,7 +5801,7 @@ async def create_or_update( :param version: The specific version id of the Index to create or update. Required. :type version: str :param index: The Index to create or update. Required. - :type index: ~azure.ai.projects.types.Index + :type index: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -5800,7 +5840,7 @@ async def create_or_update( @distributed_trace_async async def create_or_update( - self, name: str, version: str, index: Union[_models.Index, _types.Index, IO[bytes]], **kwargs: Any + self, name: str, version: str, index: Union[_models.Index, JSON, IO[bytes]], **kwargs: Any ) -> _models.Index: """Create or update a version. @@ -5810,9 +5850,9 @@ async def create_or_update( :type name: str :param version: The specific version id of the Index to create or update. Required. :type version: str - :param index: The Index to create or update. Is either a Index type or a IO[bytes] type. - Required. - :type index: ~azure.ai.projects.models.Index or ~azure.ai.projects.types.Index or IO[bytes] + :param index: The Index to create or update. Is one of the following types: Index, JSON, + IO[bytes] Required. + :type index: ~azure.ai.projects.models.Index or JSON or IO[bytes] :return: Index. The Index is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Index :raises ~azure.core.exceptions.HttpResponseError: @@ -5880,7 +5920,7 @@ async def create_or_update( return deserialized # type: ignore -class ToolboxesOperations: +class ToolboxesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -5940,12 +5980,7 @@ async def create_version( @overload async def create_version( - self, - name: str, - body: _types.CreateToolboxVersionRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ToolboxVersionObject: """Create a new version of a toolbox. @@ -5955,7 +5990,7 @@ async def create_version( Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.CreateToolboxVersionRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5989,7 +6024,7 @@ async def create_version( async def create_version( self, name: str, - body: Union[JSON, _types.CreateToolboxVersionRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, tools: List[_models.ToolboxTool] = _Unset, description: Optional[str] = None, @@ -6005,9 +6040,8 @@ async def create_version( :param name: The name of the toolbox. If the toolbox does not exist, it will be created. Required. :type name: str - :param body: Is one of the following types: JSON, CreateToolboxVersionRequest, IO[bytes] - Required. - :type body: JSON or ~azure.ai.projects.types.CreateToolboxVersionRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword tools: The list of tools to include in this version. Required. :paramtype tools: list[~azure.ai.projects.models.ToolboxTool] :keyword description: A human-readable description of the toolbox. Default value is None. @@ -6449,7 +6483,7 @@ async def update( @overload async def update( - self, name: str, body: _types.UpdateToolboxRequest1, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. @@ -6458,7 +6492,7 @@ async def update( :param name: The name of the toolbox to update. Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.UpdateToolboxRequest1 + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6489,12 +6523,7 @@ async def update( @distributed_trace_async async def update( - self, - name: str, - body: Union[JSON, _types.UpdateToolboxRequest1, IO[bytes]] = _Unset, - *, - default_version: str = _Unset, - **kwargs: Any + self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, default_version: str = _Unset, **kwargs: Any ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. @@ -6502,8 +6531,8 @@ async def update( :param name: The name of the toolbox to update. Required. :type name: str - :param body: Is one of the following types: JSON, UpdateToolboxRequest1, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.UpdateToolboxRequest1 or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword 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. :paramtype default_version: str @@ -6693,7 +6722,7 @@ async def delete_version(self, name: str, version: str, **kwargs: Any) -> None: return cls(pipeline_response, None, {}) # type: ignore -class BetaEvaluationTaxonomiesOperations: +class BetaEvaluationTaxonomiesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -6944,7 +6973,7 @@ async def create( @overload async def create( - self, name: str, taxonomy: _types.EvaluationTaxonomy, *, content_type: str = "application/json", **kwargs: Any + self, name: str, taxonomy: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. @@ -6953,7 +6982,7 @@ async def create( :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. - :type taxonomy: ~azure.ai.projects.types.EvaluationTaxonomy + :type taxonomy: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6984,10 +7013,7 @@ async def create( @distributed_trace_async async def create( - self, - name: str, - taxonomy: Union[_models.EvaluationTaxonomy, _types.EvaluationTaxonomy, IO[bytes]], - **kwargs: Any + self, name: str, taxonomy: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], **kwargs: Any ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. @@ -6995,10 +7021,9 @@ async def create( :param name: The name of the evaluation taxonomy. Required. :type name: str - :param taxonomy: The evaluation taxonomy. Is either a EvaluationTaxonomy type or a IO[bytes] - type. Required. - :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or - ~azure.ai.projects.types.EvaluationTaxonomy or IO[bytes] + :param taxonomy: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, + JSON, IO[bytes] Required. + :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: @@ -7086,7 +7111,7 @@ async def update( @overload async def update( - self, name: str, taxonomy: _types.EvaluationTaxonomy, *, content_type: str = "application/json", **kwargs: Any + self, name: str, taxonomy: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. @@ -7095,7 +7120,7 @@ async def update( :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. - :type taxonomy: ~azure.ai.projects.types.EvaluationTaxonomy + :type taxonomy: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7126,10 +7151,7 @@ async def update( @distributed_trace_async async def update( - self, - name: str, - taxonomy: Union[_models.EvaluationTaxonomy, _types.EvaluationTaxonomy, IO[bytes]], - **kwargs: Any + self, name: str, taxonomy: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], **kwargs: Any ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. @@ -7137,10 +7159,9 @@ async def update( :param name: The name of the evaluation taxonomy. Required. :type name: str - :param taxonomy: The evaluation taxonomy. Is either a EvaluationTaxonomy type or a IO[bytes] - type. Required. - :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or - ~azure.ai.projects.types.EvaluationTaxonomy or IO[bytes] + :param taxonomy: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, + JSON, IO[bytes] Required. + :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: @@ -7207,7 +7228,7 @@ async def update( return deserialized # type: ignore -class BetaEvaluatorsOperations: +class BetaEvaluatorsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -7584,12 +7605,7 @@ async def create_version( @overload async def create_version( - self, - name: str, - evaluator_version: _types.EvaluatorVersion, - *, - content_type: str = "application/json", - **kwargs: Any + self, name: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: """Create an evaluator version. @@ -7598,7 +7614,7 @@ async def create_version( :param name: The name of the resource. Required. :type name: str :param evaluator_version: Required. - :type evaluator_version: ~azure.ai.projects.types.EvaluatorVersion + :type evaluator_version: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7629,10 +7645,7 @@ async def create_version( @distributed_trace_async async def create_version( - self, - name: str, - evaluator_version: Union[_models.EvaluatorVersion, _types.EvaluatorVersion, IO[bytes]], - **kwargs: Any + self, name: str, evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.EvaluatorVersion: """Create an evaluator version. @@ -7640,9 +7653,9 @@ async def create_version( :param name: The name of the resource. Required. :type name: str - :param evaluator_version: Is either a EvaluatorVersion type or a IO[bytes] type. Required. - :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or - ~azure.ai.projects.types.EvaluatorVersion or IO[bytes] + :param evaluator_version: Is one of the following types: EvaluatorVersion, JSON, IO[bytes] + Required. + :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or JSON or IO[bytes] :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -7738,13 +7751,7 @@ async def update_version( @overload async def update_version( - self, - name: str, - version: str, - evaluator_version: _types.EvaluatorVersion, - *, - content_type: str = "application/json", - **kwargs: Any + self, name: str, version: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: """Update an evaluator version. @@ -7755,7 +7762,7 @@ async def update_version( :param version: The version of the EvaluatorVersion to update. Required. :type version: str :param evaluator_version: Evaluator resource. Required. - :type evaluator_version: ~azure.ai.projects.types.EvaluatorVersion + :type evaluator_version: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7797,7 +7804,7 @@ async def update_version( self, name: str, version: str, - evaluator_version: Union[_models.EvaluatorVersion, _types.EvaluatorVersion, IO[bytes]], + evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.EvaluatorVersion: """Update an evaluator version. @@ -7808,10 +7815,9 @@ async def update_version( :type name: str :param version: The version of the EvaluatorVersion to update. Required. :type version: str - :param evaluator_version: Evaluator resource. Is either a EvaluatorVersion type or a IO[bytes] - type. Required. - :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or - ~azure.ai.projects.types.EvaluatorVersion or IO[bytes] + :param evaluator_version: Evaluator resource. Is one of the following types: EvaluatorVersion, + JSON, IO[bytes] Required. + :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or JSON or IO[bytes] :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -7912,7 +7918,7 @@ async def pending_upload( self, name: str, version: str, - pending_upload_request: _types.PendingUploadRequest, + pending_upload_request: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -7927,7 +7933,7 @@ async def pending_upload( :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str :param pending_upload_request: The pending upload request parameters. Required. - :type pending_upload_request: ~azure.ai.projects.types.PendingUploadRequest + :type pending_upload_request: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7970,7 +7976,7 @@ async def pending_upload( self, name: str, version: str, - pending_upload_request: Union[_models.PendingUploadRequest, _types.PendingUploadRequest, IO[bytes]], + pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.PendingUploadResponse: """Start a pending upload. @@ -7982,10 +7988,10 @@ async def pending_upload( :type name: str :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str - :param pending_upload_request: The pending upload request parameters. Is either a - PendingUploadRequest type or a IO[bytes] type. Required. - :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or - ~azure.ai.projects.types.PendingUploadRequest or IO[bytes] + :param pending_upload_request: The pending upload request parameters. Is one of the following + types: PendingUploadRequest, JSON, IO[bytes] Required. + :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or JSON or + IO[bytes] :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -8090,7 +8096,7 @@ async def get_credentials( self, name: str, version: str, - credential_request: _types.EvaluatorCredentialRequest, + credential_request: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -8105,7 +8111,7 @@ async def get_credentials( :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str :param credential_request: The credential request parameters. Required. - :type credential_request: ~azure.ai.projects.types.EvaluatorCredentialRequest + :type credential_request: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -8148,7 +8154,7 @@ async def get_credentials( self, name: str, version: str, - credential_request: Union[_models.EvaluatorCredentialRequest, _types.EvaluatorCredentialRequest, IO[bytes]], + credential_request: Union[_models.EvaluatorCredentialRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.DatasetCredential: """Get evaluator credentials. @@ -8160,10 +8166,10 @@ async def get_credentials( :type name: str :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str - :param credential_request: The credential request parameters. Is either a - EvaluatorCredentialRequest type or a IO[bytes] type. Required. - :type credential_request: ~azure.ai.projects.models.EvaluatorCredentialRequest or - ~azure.ai.projects.types.EvaluatorCredentialRequest or IO[bytes] + :param credential_request: The credential request parameters. Is one of the following types: + EvaluatorCredentialRequest, JSON, IO[bytes] Required. + :type credential_request: ~azure.ai.projects.models.EvaluatorCredentialRequest or JSON or + IO[bytes] :return: DatasetCredential. The DatasetCredential is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetCredential :raises ~azure.core.exceptions.HttpResponseError: @@ -8236,7 +8242,7 @@ async def get_credentials( async def _create_generation_job_initial( self, - job: Union[_models.EvaluatorGenerationJob, _types.EvaluatorGenerationJob, IO[bytes]], + job: Union[_models.EvaluatorGenerationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -8336,12 +8342,7 @@ async def begin_create_generation_job( @overload async def begin_create_generation_job( - self, - job: _types.EvaluatorGenerationJob, - *, - operation_id: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any + self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.EvaluatorVersion]: """Create an evaluator generation job. @@ -8349,7 +8350,7 @@ async def begin_create_generation_job( from the provided source materials asynchronously. :param job: The job to create. Required. - :type job: ~azure.ai.projects.types.EvaluatorGenerationJob + :type job: JSON :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -8393,7 +8394,7 @@ async def begin_create_generation_job( @distributed_trace_async async def begin_create_generation_job( self, - job: Union[_models.EvaluatorGenerationJob, _types.EvaluatorGenerationJob, IO[bytes]], + job: Union[_models.EvaluatorGenerationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -8403,10 +8404,9 @@ async def begin_create_generation_job( Creates an evaluator generation job. The service generates rubric-based evaluator definitions from the provided source materials asynchronously. - :param job: The job to create. Is either a EvaluatorGenerationJob type or a IO[bytes] type. - Required. - :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or - ~azure.ai.projects.types.EvaluatorGenerationJob or IO[bytes] + :param job: The job to create. Is one of the following types: EvaluatorGenerationJob, JSON, + IO[bytes] Required. + :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or JSON or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -8761,7 +8761,7 @@ async def delete_generation_job(self, job_id: str, **kwargs: Any) -> None: return cls(pipeline_response, None, {}) # type: ignore -class BetaInsightsOperations: +class BetaInsightsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -8799,7 +8799,7 @@ async def generate( @overload async def generate( - self, insight: _types.Insight, *, content_type: str = "application/json", **kwargs: Any + self, insight: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Insight: """Generate insights. @@ -8807,7 +8807,7 @@ async def generate( :param insight: Complete evaluation configuration including data source, evaluators, and result settings. Required. - :type insight: ~azure.ai.projects.types.Insight + :type insight: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -8836,17 +8836,14 @@ async def generate( """ @distributed_trace_async - async def generate( - self, insight: Union[_models.Insight, _types.Insight, IO[bytes]], **kwargs: Any - ) -> _models.Insight: + async def generate(self, insight: Union[_models.Insight, JSON, IO[bytes]], **kwargs: Any) -> _models.Insight: """Generate insights. Generates an insights report from the provided evaluation configuration. :param insight: Complete evaluation configuration including data source, evaluators, and result - settings. Is either a Insight type or a IO[bytes] type. Required. - :type insight: ~azure.ai.projects.models.Insight or ~azure.ai.projects.types.Insight or - IO[bytes] + settings. Is one of the following types: Insight, JSON, IO[bytes] Required. + :type insight: ~azure.ai.projects.models.Insight or JSON or IO[bytes] :return: Insight. The Insight is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Insight :raises ~azure.core.exceptions.HttpResponseError: @@ -9109,7 +9106,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class BetaMemoryStoresOperations: +class BetaMemoryStoresOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -9160,14 +9157,14 @@ async def create( @overload async def create( - self, body: _types.CreateMemoryStoreRequest, *, content_type: str = "application/json", **kwargs: Any + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: """Create a memory store. Creates a memory store resource with the provided configuration. :param body: Required. - :type body: ~azure.ai.projects.types.CreateMemoryStoreRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9197,7 +9194,7 @@ async def create( @distributed_trace_async async def create( self, - body: Union[JSON, _types.CreateMemoryStoreRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, name: str = _Unset, definition: _models.MemoryStoreDefinition = _Unset, @@ -9209,8 +9206,8 @@ async def create( Creates a memory store resource with the provided configuration. - :param body: Is one of the following types: JSON, CreateMemoryStoreRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.CreateMemoryStoreRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword name: The name of the memory store. Required. :paramtype name: str :keyword definition: The memory store definition. Required. @@ -9326,7 +9323,7 @@ async def update( @overload async def update( - self, name: str, body: _types.UpdateMemoryStoreRequest, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: """Update a memory store. @@ -9335,7 +9332,7 @@ async def update( :param name: The name of the memory store to update. Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.UpdateMemoryStoreRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9368,7 +9365,7 @@ async def update( async def update( self, name: str, - body: Union[JSON, _types.UpdateMemoryStoreRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, description: Optional[str] = None, metadata: Optional[dict[str, str]] = None, @@ -9380,8 +9377,8 @@ async def update( :param name: The name of the memory store to update. Required. :type name: str - :param body: Is one of the following types: JSON, UpdateMemoryStoreRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.UpdateMemoryStoreRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword description: A human-readable description of the memory store. Default value is None. :paramtype description: str :keyword metadata: Arbitrary key-value metadata to associate with the memory store. Default @@ -9699,7 +9696,7 @@ async def _search_memories( ) -> _models.MemoryStoreSearchResult: ... @overload async def _search_memories( - self, name: str, body: _types.SearchMemoriesRequest, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreSearchResult: ... @overload async def _search_memories( @@ -9710,7 +9707,7 @@ async def _search_memories( async def _search_memories( self, name: str, - body: Union[JSON, _types.SearchMemoriesRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, items: Optional[List[dict[str, Any]]] = None, @@ -9724,8 +9721,8 @@ async def _search_memories( :param name: The name of the memory store to search. Required. :type name: str - :param body: Is one of the following types: JSON, SearchMemoriesRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.SearchMemoriesRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -9813,7 +9810,7 @@ async def _search_memories( async def _update_memories_initial( self, name: str, - body: Union[JSON, _types.UpdateMemoriesRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, items: Optional[List[dict[str, Any]]] = None, @@ -9909,7 +9906,7 @@ async def _begin_update_memories( ) -> AsyncLROPoller[_models.MemoryStoreUpdateCompletedResult]: ... @overload async def _begin_update_memories( - self, name: str, body: _types.UpdateMemoriesRequest, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.MemoryStoreUpdateCompletedResult]: ... @overload async def _begin_update_memories( @@ -9920,7 +9917,7 @@ async def _begin_update_memories( async def _begin_update_memories( self, name: str, - body: Union[JSON, _types.UpdateMemoriesRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, items: Optional[List[dict[str, Any]]] = None, @@ -9935,8 +9932,8 @@ async def _begin_update_memories( :param name: The name of the memory store to update. Required. :type name: str - :param body: Is one of the following types: JSON, UpdateMemoriesRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.UpdateMemoriesRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -10042,7 +10039,7 @@ async def delete_scope( @overload async def delete_scope( - self, name: str, body: _types.DeleteScopeRequest, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: """Delete memories by scope. @@ -10051,7 +10048,7 @@ async def delete_scope( :param name: The name of the memory store. Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.DeleteScopeRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10084,12 +10081,7 @@ async def delete_scope( @distributed_trace_async async def delete_scope( - self, - name: str, - body: Union[JSON, _types.DeleteScopeRequest, IO[bytes]] = _Unset, - *, - scope: str = _Unset, - **kwargs: Any + self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: """Delete memories by scope. @@ -10097,8 +10089,8 @@ async def delete_scope( :param name: The name of the memory store. Required. :type name: str - :param body: Is one of the following types: JSON, DeleteScopeRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.DeleteScopeRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories to delete, such as a user ID. Required. :paramtype scope: str @@ -10212,7 +10204,7 @@ async def create_memory( @overload async def create_memory( - self, name: str, body: _types.CreateMemoryRequest, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: """Create a memory item. @@ -10221,7 +10213,7 @@ async def create_memory( :param name: The name of the memory store. Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.CreateMemoryRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10254,7 +10246,7 @@ async def create_memory( async def create_memory( self, name: str, - body: Union[JSON, _types.CreateMemoryRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, content: str = _Unset, @@ -10267,8 +10259,8 @@ async def create_memory( :param name: The name of the memory store. Required. :type name: str - :param body: Is one of the following types: JSON, CreateMemoryRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.CreateMemoryRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -10379,13 +10371,7 @@ async def update_memory( @overload async def update_memory( - self, - name: str, - memory_id: str, - body: _types.UpdateMemoryRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, name: str, memory_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: """Update a memory item. @@ -10396,7 +10382,7 @@ async def update_memory( :param memory_id: The ID of the memory item to update. Required. :type memory_id: str :param body: Required. - :type body: ~azure.ai.projects.types.UpdateMemoryRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10429,13 +10415,7 @@ async def update_memory( @distributed_trace_async async def update_memory( - self, - name: str, - memory_id: str, - body: Union[JSON, _types.UpdateMemoryRequest, IO[bytes]] = _Unset, - *, - content: str = _Unset, - **kwargs: Any + self, name: str, memory_id: str, body: Union[JSON, IO[bytes]] = _Unset, *, content: str = _Unset, **kwargs: Any ) -> _models.MemoryItem: """Update a memory item. @@ -10445,8 +10425,8 @@ async def update_memory( :type name: str :param memory_id: The ID of the memory item to update. Required. :type memory_id: str - :param body: Is one of the following types: JSON, UpdateMemoryRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.UpdateMemoryRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword content: The updated content of the memory. Required. :paramtype content: str :return: MemoryItem. The MemoryItem is compatible with MutableMapping @@ -10645,7 +10625,7 @@ def list_memories( def list_memories( self, name: str, - body: _types.ListMemoriesRequest, + body: JSON, *, kind: Optional[Union[str, _models.MemoryItemKind]] = None, limit: Optional[int] = None, @@ -10661,7 +10641,7 @@ def list_memories( :param name: The name of the memory store. Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.ListMemoriesRequest + :type body: JSON :keyword kind: The kind of the memory item. Known values are: "user_profile", "chat_summary", and "procedural". Default value is None. :paramtype kind: str or ~azure.ai.projects.models.MemoryItemKind @@ -10737,7 +10717,7 @@ def list_memories( def list_memories( self, name: str, - body: Union[JSON, _types.ListMemoriesRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, kind: Optional[Union[str, _models.MemoryItemKind]] = None, @@ -10752,8 +10732,8 @@ def list_memories( :param name: The name of the memory store. Required. :type name: str - :param body: Is one of the following types: JSON, ListMemoriesRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.ListMemoriesRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -10926,7 +10906,7 @@ async def delete_memory(self, name: str, memory_id: str, **kwargs: Any) -> _mode return deserialized # type: ignore -class BetaModelsOperations: +class BetaModelsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -11279,7 +11259,7 @@ async def update( self, name: str, version: str, - model_version_update: _types.UpdateModelVersionRequest, + model_version_update: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -11294,7 +11274,7 @@ async def update( Required. :type version: str :param model_version_update: The UpdateModelVersionRequest to create or update. Required. - :type model_version_update: ~azure.ai.projects.types.UpdateModelVersionRequest + :type model_version_update: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -11337,7 +11317,7 @@ async def update( self, name: str, version: str, - model_version_update: Union[_models.UpdateModelVersionRequest, _types.UpdateModelVersionRequest, IO[bytes]], + model_version_update: Union[_models.UpdateModelVersionRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.ModelVersion: """Update a model version. @@ -11349,10 +11329,10 @@ async def update( :param version: The specific version id of the UpdateModelVersionRequest to create or update. Required. :type version: str - :param model_version_update: The UpdateModelVersionRequest to create or update. Is either a - UpdateModelVersionRequest type or a IO[bytes] type. Required. - :type model_version_update: ~azure.ai.projects.models.UpdateModelVersionRequest or - ~azure.ai.projects.types.UpdateModelVersionRequest or IO[bytes] + :param model_version_update: The UpdateModelVersionRequest to create or update. Is one of the + following types: UpdateModelVersionRequest, JSON, IO[bytes] Required. + :type model_version_update: ~azure.ai.projects.models.UpdateModelVersionRequest or JSON or + IO[bytes] :return: ModelVersion. The ModelVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.ModelVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -11450,13 +11430,7 @@ async def pending_create_version( @overload async def pending_create_version( - self, - name: str, - version: str, - model_version: _types.ModelVersion, - *, - content_type: str = "application/json", - **kwargs: Any + self, name: str, version: str, model_version: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CreateAsyncResponse: """Create a model version async. @@ -11468,7 +11442,7 @@ async def pending_create_version( :param version: Version of the model. Required. :type version: str :param model_version: Model version to create. Required. - :type model_version: ~azure.ai.projects.types.ModelVersion + :type model_version: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11508,11 +11482,7 @@ async def pending_create_version( @distributed_trace_async async def pending_create_version( - self, - name: str, - version: str, - model_version: Union[_models.ModelVersion, _types.ModelVersion, IO[bytes]], - **kwargs: Any + self, name: str, version: str, model_version: Union[_models.ModelVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.CreateAsyncResponse: """Create a model version async. @@ -11523,10 +11493,9 @@ async def pending_create_version( :type name: str :param version: Version of the model. Required. :type version: str - :param model_version: Model version to create. Is either a ModelVersion type or a IO[bytes] - type. Required. - :type model_version: ~azure.ai.projects.models.ModelVersion or - ~azure.ai.projects.types.ModelVersion or IO[bytes] + :param model_version: Model version to create. Is one of the following types: ModelVersion, + JSON, IO[bytes] Required. + :type model_version: ~azure.ai.projects.models.ModelVersion or JSON or IO[bytes] :return: CreateAsyncResponse. The CreateAsyncResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.CreateAsyncResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -11630,7 +11599,7 @@ async def pending_upload( self, name: str, version: str, - pending_upload_request: _types.ModelPendingUploadRequest, + pending_upload_request: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -11644,7 +11613,7 @@ async def pending_upload( :param version: Version of the model. Required. :type version: str :param pending_upload_request: The pending upload request request body. Required. - :type pending_upload_request: ~azure.ai.projects.types.ModelPendingUploadRequest + :type pending_upload_request: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11688,7 +11657,7 @@ async def pending_upload( self, name: str, version: str, - pending_upload_request: Union[_models.ModelPendingUploadRequest, _types.ModelPendingUploadRequest, IO[bytes]], + pending_upload_request: Union[_models.ModelPendingUploadRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.ModelPendingUploadResponse: """Start a pending upload. @@ -11699,10 +11668,10 @@ async def pending_upload( :type name: str :param version: Version of the model. Required. :type version: str - :param pending_upload_request: The pending upload request request body. Is either a - ModelPendingUploadRequest type or a IO[bytes] type. Required. - :type pending_upload_request: ~azure.ai.projects.models.ModelPendingUploadRequest or - ~azure.ai.projects.types.ModelPendingUploadRequest or IO[bytes] + :param pending_upload_request: The pending upload request request body. Is one of the following + types: ModelPendingUploadRequest, JSON, IO[bytes] Required. + :type pending_upload_request: ~azure.ai.projects.models.ModelPendingUploadRequest or JSON or + IO[bytes] :return: ModelPendingUploadResponse. The ModelPendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.ModelPendingUploadResponse @@ -11803,7 +11772,7 @@ async def get_credentials( self, name: str, version: str, - credential_request: _types.ModelCredentialRequest, + credential_request: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -11817,7 +11786,7 @@ async def get_credentials( :param version: Version of the model. Required. :type version: str :param credential_request: The credential request request body. Required. - :type credential_request: ~azure.ai.projects.types.ModelCredentialRequest + :type credential_request: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11859,7 +11828,7 @@ async def get_credentials( self, name: str, version: str, - credential_request: Union[_models.ModelCredentialRequest, _types.ModelCredentialRequest, IO[bytes]], + credential_request: Union[_models.ModelCredentialRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.DatasetCredential: """Get model asset credentials. @@ -11870,10 +11839,9 @@ async def get_credentials( :type name: str :param version: Version of the model. Required. :type version: str - :param credential_request: The credential request request body. Is either a - ModelCredentialRequest type or a IO[bytes] type. Required. - :type credential_request: ~azure.ai.projects.models.ModelCredentialRequest or - ~azure.ai.projects.types.ModelCredentialRequest or IO[bytes] + :param credential_request: The credential request request body. Is one of the following types: + ModelCredentialRequest, JSON, IO[bytes] Required. + :type credential_request: ~azure.ai.projects.models.ModelCredentialRequest or JSON or IO[bytes] :return: DatasetCredential. The DatasetCredential is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetCredential :raises ~azure.core.exceptions.HttpResponseError: @@ -11941,7 +11909,7 @@ async def get_credentials( return deserialized # type: ignore -class BetaRedTeamsOperations: +class BetaRedTeamsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -12130,15 +12098,13 @@ async def create( """ @overload - async def create( - self, red_team: _types.RedTeam, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RedTeam: + async def create(self, red_team: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.RedTeam: """Create a redteam run. Submits a new redteam run for execution with the provided configuration. :param red_team: Redteam to be run. Required. - :type red_team: ~azure.ai.projects.types.RedTeam + :type red_team: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -12166,16 +12132,14 @@ async def create( """ @distributed_trace_async - async def create( - self, red_team: Union[_models.RedTeam, _types.RedTeam, IO[bytes]], **kwargs: Any - ) -> _models.RedTeam: + async def create(self, red_team: Union[_models.RedTeam, JSON, IO[bytes]], **kwargs: Any) -> _models.RedTeam: """Create a redteam run. Submits a new redteam run for execution with the provided configuration. - :param red_team: Redteam to be run. Is either a RedTeam type or a IO[bytes] type. Required. - :type red_team: ~azure.ai.projects.models.RedTeam or ~azure.ai.projects.types.RedTeam or - IO[bytes] + :param red_team: Redteam to be run. Is one of the following types: RedTeam, JSON, IO[bytes] + Required. + :type red_team: ~azure.ai.projects.models.RedTeam or JSON or IO[bytes] :return: RedTeam. The RedTeam is compatible with MutableMapping :rtype: ~azure.ai.projects.models.RedTeam :raises ~azure.core.exceptions.HttpResponseError: @@ -12245,7 +12209,7 @@ async def create( return deserialized # type: ignore -class BetaRoutinesOperations: +class BetaRoutinesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -12299,12 +12263,7 @@ async def create_or_update( @overload async def create_or_update( - self, - routine_name: str, - body: _types.CreateOrUpdateRoutineRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, routine_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Routine: """Create or update a routine. @@ -12313,7 +12272,7 @@ async def create_or_update( :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. - :type body: ~azure.ai.projects.types.CreateOrUpdateRoutineRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -12346,7 +12305,7 @@ async def create_or_update( async def create_or_update( self, routine_name: str, - body: Union[JSON, _types.CreateOrUpdateRoutineRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, description: Optional[str] = None, enabled: Optional[bool] = None, @@ -12360,9 +12319,8 @@ async def create_or_update( :param routine_name: The unique name of the routine. Required. :type routine_name: str - :param body: Is one of the following types: JSON, CreateOrUpdateRoutineRequest, IO[bytes] - Required. - :type body: JSON or ~azure.ai.projects.types.CreateOrUpdateRoutineRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword description: A human-readable description of the routine. Default value is None. :paramtype description: str :keyword enabled: Whether the routine is enabled. Default value is None. @@ -12964,12 +12922,7 @@ async def dispatch( @overload async def dispatch( - self, - routine_name: str, - body: _types.DispatchRoutineAsyncRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, routine_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. @@ -12978,7 +12931,7 @@ async def dispatch( :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. - :type body: ~azure.ai.projects.types.DispatchRoutineAsyncRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -13011,7 +12964,7 @@ async def dispatch( async def dispatch( self, routine_name: str, - body: Union[JSON, _types.DispatchRoutineAsyncRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, payload: Optional[_models.RoutineDispatchPayload] = None, **kwargs: Any @@ -13022,9 +12975,8 @@ async def dispatch( :param routine_name: The unique name of the routine. Required. :type routine_name: str - :param body: Is one of the following types: JSON, DispatchRoutineAsyncRequest, IO[bytes] - Required. - :type body: JSON or ~azure.ai.projects.types.DispatchRoutineAsyncRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword payload: A direct action-input override sent downstream when testing a routine. Default value is None. :paramtype payload: ~azure.ai.projects.models.RoutineDispatchPayload @@ -13101,7 +13053,7 @@ async def dispatch( return deserialized # type: ignore -class BetaSchedulesOperations: +class BetaSchedulesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -13356,7 +13308,7 @@ async def create_or_update( @overload async def create_or_update( - self, schedule_id: str, schedule: _types.Schedule, *, content_type: str = "application/json", **kwargs: Any + self, schedule_id: str, schedule: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Schedule: """Create or update a schedule. @@ -13365,7 +13317,7 @@ async def create_or_update( :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str :param schedule: The resource instance. Required. - :type schedule: ~azure.ai.projects.types.Schedule + :type schedule: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -13396,7 +13348,7 @@ async def create_or_update( @distributed_trace_async async def create_or_update( - self, schedule_id: str, schedule: Union[_models.Schedule, _types.Schedule, IO[bytes]], **kwargs: Any + self, schedule_id: str, schedule: Union[_models.Schedule, JSON, IO[bytes]], **kwargs: Any ) -> _models.Schedule: """Create or update a schedule. @@ -13404,10 +13356,9 @@ async def create_or_update( :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str - :param schedule: The resource instance. Is either a Schedule type or a IO[bytes] type. - Required. - :type schedule: ~azure.ai.projects.models.Schedule or ~azure.ai.projects.types.Schedule or - IO[bytes] + :param schedule: The resource instance. Is one of the following types: Schedule, JSON, + IO[bytes] Required. + :type schedule: ~azure.ai.projects.models.Schedule or JSON or IO[bytes] :return: Schedule. The Schedule is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Schedule :raises ~azure.core.exceptions.HttpResponseError: @@ -13651,7 +13602,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class BetaSkillsOperations: +class BetaSkillsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -13850,7 +13801,7 @@ async def update( @overload async def update( - self, name: str, body: _types.UpdateSkillRequest, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SkillDetails: """Update a skill. @@ -13859,7 +13810,7 @@ async def update( :param name: The name of the skill to update. Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.UpdateSkillRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -13890,12 +13841,7 @@ async def update( @distributed_trace_async async def update( - self, - name: str, - body: Union[JSON, _types.UpdateSkillRequest, IO[bytes]] = _Unset, - *, - default_version: str = _Unset, - **kwargs: Any + self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, default_version: str = _Unset, **kwargs: Any ) -> _models.SkillDetails: """Update a skill. @@ -13903,8 +13849,8 @@ async def update( :param name: The name of the skill to update. Required. :type name: str - :param body: Is one of the following types: JSON, UpdateSkillRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.UpdateSkillRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword default_version: The version identifier that the skill should point to. When set, the skill's default version will resolve to this version instead of the latest. Required. :paramtype default_version: str @@ -14080,12 +14026,7 @@ async def create( @overload async def create( - self, - name: str, - body: _types.CreateSkillVersionRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SkillVersion: """Create a new version of a skill. @@ -14094,7 +14035,7 @@ async def create( :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.CreateSkillVersionRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -14127,7 +14068,7 @@ async def create( async def create( self, name: str, - body: Union[JSON, _types.CreateSkillVersionRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, inline_content: Optional[_models.SkillInlineContent] = None, default: Optional[bool] = None, @@ -14139,9 +14080,8 @@ async def create( :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str - :param body: Is one of the following types: JSON, CreateSkillVersionRequest, IO[bytes] - Required. - :type body: JSON or ~azure.ai.projects.types.CreateSkillVersionRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword inline_content: Inline skill content for simple skills without file uploads. Foundry-specific extension. Default value is None. :paramtype inline_content: ~azure.ai.projects.models.SkillInlineContent @@ -14237,9 +14177,7 @@ async def create_from_files( """ @overload - async def create_from_files( - self, name: str, content: _types.CreateSkillVersionFromFilesBody, **kwargs: Any - ) -> _models.SkillVersion: + async def create_from_files(self, name: str, content: JSON, **kwargs: Any) -> _models.SkillVersion: """Create a skill version from uploaded files. Creates a new version of a skill from uploaded files via multipart form data. @@ -14247,7 +14185,7 @@ async def create_from_files( :param name: The name of the skill. Required. :type name: str :param content: The multipart request content. Required. - :type content: ~azure.ai.projects.types.CreateSkillVersionFromFilesBody + :type content: JSON :return: SkillVersion. The SkillVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.SkillVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -14255,10 +14193,7 @@ async def create_from_files( @distributed_trace_async async def create_from_files( - self, - name: str, - content: Union[_models.CreateSkillVersionFromFilesBody, _types.CreateSkillVersionFromFilesBody], - **kwargs: Any + self, name: str, content: Union[_models.CreateSkillVersionFromFilesBody, JSON], **kwargs: Any ) -> _models.SkillVersion: """Create a skill version from uploaded files. @@ -14266,10 +14201,9 @@ async def create_from_files( :param name: The name of the skill. Required. :type name: str - :param content: The multipart request content. Is one of the following types: - CreateSkillVersionFromFilesBody Required. - :type content: ~azure.ai.projects.models.CreateSkillVersionFromFilesBody or - ~azure.ai.projects.types.CreateSkillVersionFromFilesBody + :param content: The multipart request content. Is either a CreateSkillVersionFromFilesBody type + or a JSON type. Required. + :type content: ~azure.ai.projects.models.CreateSkillVersionFromFilesBody or JSON :return: SkillVersion. The SkillVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.SkillVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -14710,7 +14644,7 @@ async def delete_version(self, name: str, version: str, **kwargs: Any) -> _model return deserialized # type: ignore -class BetaDatasetsOperations: +class BetaDatasetsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -14891,7 +14825,7 @@ async def get_next(_continuation_token=None): async def _create_generation_job_initial( self, - job: Union[_models.DataGenerationJob, _types.DataGenerationJob, IO[bytes]], + job: Union[_models.DataGenerationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -14990,19 +14924,14 @@ async def begin_create_generation_job( @overload async def begin_create_generation_job( - self, - job: _types.DataGenerationJob, - *, - operation_id: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any + self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.DataGenerationJobResult]: """Create a data generation job. Submits a new data generation job for asynchronous execution. :param job: The job to create. Required. - :type job: ~azure.ai.projects.types.DataGenerationJob + :type job: JSON :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -15045,7 +14974,7 @@ async def begin_create_generation_job( @distributed_trace_async async def begin_create_generation_job( self, - job: Union[_models.DataGenerationJob, _types.DataGenerationJob, IO[bytes]], + job: Union[_models.DataGenerationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -15054,10 +14983,9 @@ async def begin_create_generation_job( Submits a new data generation job for asynchronous execution. - :param job: The job to create. Is either a DataGenerationJob type or a IO[bytes] type. - Required. - :type job: ~azure.ai.projects.models.DataGenerationJob or - ~azure.ai.projects.types.DataGenerationJob or IO[bytes] + :param job: The job to create. Is one of the following types: DataGenerationJob, JSON, + IO[bytes] Required. + :type job: ~azure.ai.projects.models.DataGenerationJob or JSON or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -15246,7 +15174,7 @@ async def delete_generation_job(self, job_id: str, **kwargs: Any) -> None: return cls(pipeline_response, None, {}) # type: ignore -class BetaAgentsOperations: +class BetaAgentsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -15265,7 +15193,7 @@ def __init__(self, *args, **kwargs) -> None: async def _create_optimization_job_initial( self, - job: Union[_models.AgentOptimizationJob, _types.AgentOptimizationJob, IO[bytes]], + job: Union[_models.AgentOptimizationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -15366,12 +15294,7 @@ async def begin_create_optimization_job( @overload async def begin_create_optimization_job( - self, - job: _types.AgentOptimizationJob, - *, - operation_id: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any + self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.AgentOptimizationJobResult]: """Create an agent optimization job. @@ -15379,7 +15302,7 @@ async def begin_create_optimization_job( retry. :param job: The job to create. Required. - :type job: ~azure.ai.projects.types.AgentOptimizationJob + :type job: JSON :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -15425,7 +15348,7 @@ async def begin_create_optimization_job( @distributed_trace_async async def begin_create_optimization_job( self, - job: Union[_models.AgentOptimizationJob, _types.AgentOptimizationJob, IO[bytes]], + job: Union[_models.AgentOptimizationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -15435,10 +15358,9 @@ async def begin_create_optimization_job( Creates an optimization job and returns the queued job. Honors ``Operation-Id`` for idempotent retry. - :param job: The job to create. Is either a AgentOptimizationJob type or a IO[bytes] type. - Required. - :type job: ~azure.ai.projects.models.AgentOptimizationJob or - ~azure.ai.projects.types.AgentOptimizationJob or IO[bytes] + :param job: The job to create. Is one of the following types: AgentOptimizationJob, JSON, + IO[bytes] Required. + :type job: ~azure.ai.projects.models.AgentOptimizationJob or JSON or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py index e247fdef5a45..73b708057861 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py @@ -374,7 +374,7 @@ async def generate_agent(self, body: _models.GenerateVoiceAgentRequest, **kwargs class BetaAgentsOperations(BetaAgentsOperationsGenerated): """Custom async operations for beta agent optimization jobs.""" - @overload + @overload # type: ignore[override] async def begin_create_optimization_job( self, job: _models.AgentOptimizationJob, @@ -405,7 +405,7 @@ async def begin_create_optimization_job( ) -> AsyncAgentOptimizationLROPoller: ... @distributed_trace_async - async def begin_create_optimization_job( + async def begin_create_optimization_job( # type: ignore[reportIncompatibleMethodOverride, override] self, job: Union[_models.AgentOptimizationJob, _types.AgentOptimizationJob, IO[bytes]], *, @@ -434,7 +434,7 @@ async def begin_create_optimization_job( raw_result = None if continuation_token is None: raw_result = await self._create_optimization_job_initial( - job=job, + job=job, # type: ignore[reportArgumentType, arg-type] operation_id=operation_id, content_type=content_type, cls=lambda x, y, z: x, diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_datasets_async.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_datasets_async.py index 304fc8d14b75..5662b6fdd15a 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_datasets_async.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_datasets_async.py @@ -41,7 +41,7 @@ class BetaDatasetsOperations(BetaDatasetsOperationsGenerated): """Custom async operations for beta data generation jobs.""" - @overload + @overload # type: ignore[override] async def begin_create_generation_job( self, job: _models.DataGenerationJob, @@ -72,7 +72,7 @@ async def begin_create_generation_job( ) -> AsyncDatasetGenerationLROPoller: ... @distributed_trace_async - async def begin_create_generation_job( + async def begin_create_generation_job( # type: ignore[reportIncompatibleMethodOverride, override] self, job: Union[_models.DataGenerationJob, _types.DataGenerationJob, IO[bytes]], *, @@ -101,7 +101,7 @@ async def begin_create_generation_job( raw_result = None if continuation_token is None: raw_result = await self._create_generation_job_initial( - job=job, + job=job, # type: ignore[reportArgumentType, arg-type] operation_id=operation_id, content_type=content_type, cls=lambda x, y, z: x, diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_evaluators_async.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_evaluators_async.py index 1986db0501bf..d0a1aaaaf0df 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_evaluators_async.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_evaluators_async.py @@ -21,7 +21,7 @@ class BetaEvaluatorsOperations(BetaEvaluatorsOperationsGenerated): """Custom async operations for beta evaluator generation jobs.""" - @overload + @overload # type: ignore[override] async def begin_create_generation_job( self, job: _models.EvaluatorGenerationJob, @@ -52,7 +52,7 @@ async def begin_create_generation_job( ) -> AsyncEvaluatorGenerationLROPoller: ... @distributed_trace_async - async def begin_create_generation_job( + async def begin_create_generation_job( # type: ignore[reportIncompatibleMethodOverride, override] self, job: Union[_models.EvaluatorGenerationJob, _types.EvaluatorGenerationJob, IO[bytes]], *, @@ -81,7 +81,7 @@ async def begin_create_generation_job( raw_result = None if continuation_token is None: raw_result = await self._create_generation_job_initial( - job=job, + job=job, # type: ignore[reportArgumentType, arg-type] operation_id=operation_id, content_type=content_type, cls=lambda x, y, z: x, 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 18c70de26437..c11035aae62e 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 @@ -683,6 +683,7 @@ VoiceSystemToolName, VoiceTurnDetectionType, VoiceType, + _AgentDefinitionOptInKeys, ) from ._patch import __all__ as _patch_all from ._patch import * @@ -1354,6 +1355,7 @@ "VoiceSystemToolName", "VoiceTurnDetectionType", "VoiceType", + "_AgentDefinitionOptInKeys", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() 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 d9de3e292211..8c6af3263d87 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 @@ -69,7 +69,7 @@ from .. import _unions, models as _models -class _CreateAgentVersionFromCodeContent(_Model): +class _CreateAgentVersionFromCodeContent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Multipart request body for updating or versioning a code-based agent (POST /agents/{name} and POST /agents/{name}/versions). @@ -107,7 +107,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class _CreateAgentVersionFromCodeMetadata(_Model): +class _CreateAgentVersionFromCodeMetadata(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """JSON metadata for code-based agent operations (create, update, create version). The agent name comes from the URL path parameter or the ``x-ms-agent-name`` header, so it is not included in this model. The content hash (SHA-256 of the zip) is carried in the ``x-ms-code-zip-sha256`` @@ -160,7 +160,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Tool(_Model): +class Tool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """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: @@ -213,7 +213,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class A2APreviewTool(Tool, discriminator="a2a_preview"): +class A2APreviewTool(Tool, discriminator="a2a_preview"): # pylint: disable=docstring-keyword-should-match-keyword-only """An agent implementing the A2A protocol. :ivar type: The type of the tool. Always ``"a2a_preview``. Required. A2A_PREVIEW. @@ -271,7 +271,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.A2A_PREVIEW # type: ignore -class ToolboxTool(_Model): +class ToolboxTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """An abstract representation of a tool stored in a toolbox. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -335,7 +335,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class A2APreviewToolboxTool(ToolboxTool, discriminator="a2a_preview"): +class A2APreviewToolboxTool( + ToolboxTool, discriminator="a2a_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only """An A2A tool stored in a toolbox. :ivar name: Optional user-defined name for this tool or configuration. @@ -408,7 +410,7 @@ class A2AProtocolConfiguration(_Model): """Configuration specific to the A2A protocol.""" -class A2ATool(Tool, discriminator="a2a"): +class A2ATool(Tool, discriminator="a2a"): # pylint: disable=docstring-keyword-should-match-keyword-only """An agent implementing the A2A protocol. :ivar type: The type of the tool. Always ``"a2a"``. Required. A2_A. @@ -473,7 +475,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.A2_A # type: ignore -class A2AToolboxTool(ToolboxTool, discriminator="a2a"): +class A2AToolboxTool(ToolboxTool, discriminator="a2a"): # pylint: disable=docstring-keyword-should-match-keyword-only """An A2A tool stored in a toolbox. :ivar name: Optional user-defined name for this tool or configuration. @@ -549,7 +551,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolboxToolType.A2_A # type: ignore -class ActivityProtocolConfiguration(_Model): +class ActivityProtocolConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Configuration specific to the activity protocol. :ivar enable_m365_public_endpoint: Whether to enable the M365 public endpoint for the activity @@ -578,7 +580,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentBlueprintReference(_Model): +class AgentBlueprintReference(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """AgentBlueprintReference. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -610,7 +612,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentCard(_Model): +class AgentCard(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """AgentCard. :ivar version: The version of the agent card. Required. @@ -648,7 +650,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentCardSkill(_Model): +class AgentCardSkill(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """AgentCardSkill. :ivar id: a unique identifier for the skill. Required. @@ -696,7 +698,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InsightRequest(_Model): +class InsightRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The request of the insights report. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -731,7 +733,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentClusterInsightRequest(InsightRequest, discriminator="AgentClusterInsight"): +class AgentClusterInsightRequest( + InsightRequest, discriminator="AgentClusterInsight" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Insights on set of Agent Evaluation Results. :ivar type: The type of request. Required. Cluster Insight on an Agent. @@ -771,7 +775,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = InsightType.AGENT_CLUSTER_INSIGHT # type: ignore -class InsightResult(_Model): +class InsightResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The result of the insights. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -805,7 +809,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentClusterInsightResult(InsightResult, discriminator="AgentClusterInsight"): +class AgentClusterInsightResult( + InsightResult, discriminator="AgentClusterInsight" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Insights from the agent cluster analysis. :ivar type: The type of insights result. Required. Cluster Insight on an Agent. @@ -840,7 +846,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = InsightType.AGENT_CLUSTER_INSIGHT # type: ignore -class DataGenerationJobSource(_Model): +class DataGenerationJobSource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The base source model for data generation jobs. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -883,7 +889,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentDataGenerationJobSource(DataGenerationJobSource, discriminator="agent"): +class AgentDataGenerationJobSource( + DataGenerationJobSource, discriminator="agent" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Agent source for data generation jobs — references an agent to fetch instructions and metadata from. @@ -928,7 +936,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = DataGenerationJobSourceType.AGENT # type: ignore -class AgentDefinition(_Model): +class AgentDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """AgentDefinition. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -967,7 +975,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentDetails(_Model): +class AgentDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """AgentDetails. :ivar object: The object type, which is always 'agent'. Required. AGENT. @@ -1047,7 +1055,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentEndpointAuthorizationScheme(_Model): +class AgentEndpointAuthorizationScheme(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """AgentEndpointAuthorizationScheme. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -1082,7 +1090,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentEndpointConfig(_Model): +class AgentEndpointConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """AgentEndpointConfig. :ivar version_selector: The version selector of the agent endpoint determines how traffic is @@ -1129,7 +1137,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorGenerationJobSource(_Model): +class EvaluatorGenerationJobSource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The base source model for evaluator generation jobs. Polymorphic over ``type``. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -1164,7 +1172,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator="agent"): +class AgentEvaluatorGenerationJobSource( + EvaluatorGenerationJobSource, discriminator="agent" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Agent source for evaluator generation jobs — references an agent to fetch instructions and metadata from. @@ -1213,7 +1223,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = EvaluatorGenerationJobSourceType.AGENT # type: ignore -class BaseCredentials(_Model): +class BaseCredentials(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A base class for connection credentials. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -1275,7 +1285,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = CredentialType.AGENTIC_IDENTITY_PREVIEW # type: ignore -class AgentIdentity(_Model): +class AgentIdentity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """AgentIdentity. :ivar principal_id: The principal ID of the agent instance. Required. @@ -1318,7 +1328,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentObjectVersions(_Model): +class AgentObjectVersions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """AgentObjectVersions. :ivar latest: Required. @@ -1346,7 +1356,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentOptimizationCandidate(_Model): +class AgentOptimizationCandidate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Aggregated evaluation result for a single candidate agent configuration across all tasks. :ivar candidate_id: Server-assigned candidate identifier. Use with GET /candidates/{id} @@ -1412,7 +1422,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentOptimizationDatasetCriterion(_Model): +class AgentOptimizationDatasetCriterion(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Evaluation criterion: a name + instruction pair used for per-item scoring. :ivar name: Criterion name. Required. @@ -1445,7 +1455,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentOptimizationDatasetInput(_Model): +class AgentOptimizationDatasetInput(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Base discriminated model for dataset input. Either inline items or a registered reference. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -1478,7 +1488,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentOptimizationDatasetItem(_Model): +class AgentOptimizationDatasetItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A single item in an inline dataset. :ivar query: The user query / prompt. @@ -1523,7 +1533,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentOptimizationEvaluatorRef(_Model): +class AgentOptimizationEvaluatorRef(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Reference to a named evaluator, optionally pinned to a version. :ivar name: Evaluator name. Required. @@ -1556,7 +1566,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentOptimizationInlineDatasetInput(AgentOptimizationDatasetInput, discriminator="inline"): +class AgentOptimizationInlineDatasetInput( + AgentOptimizationDatasetInput, discriminator="inline" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Inline dataset — items supplied directly in the request body. :ivar type: Dataset input type discriminator. Required. Inline dataset — items are provided @@ -1593,7 +1605,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = AgentOptimizationDatasetInputType.INLINE # type: ignore -class AgentOptimizationJob(_Model): +class AgentOptimizationJob(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Agent optimization job resource — a long-running job that optimizes an agent's configuration (instructions, model, skills, tools) to maximize evaluation scores. On success, the result contains scored candidates. @@ -1661,7 +1673,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentOptimizationJobInputs(_Model): +class AgentOptimizationJobInputs(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Caller-supplied inputs for an optimization job. :ivar agent: The agent (and pinned version) being optimized. Required. @@ -1761,7 +1773,7 @@ class AgentOptimizationJobListItem(_Model): """The agent targeted by this optimization job.""" -class AgentOptimizationJobProgress(_Model): +class AgentOptimizationJobProgress(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """In-flight progress; only populated while status is queued or in_progress. :ivar candidates_completed: Number of candidates whose evaluation has completed so far. @@ -1801,7 +1813,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentOptimizationJobResult(_Model): +class AgentOptimizationJobResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Terminal-state result body. Populated when status is succeeded or failed. :ivar baseline: Candidate ID of the original (un-optimized) baseline evaluation. @@ -1841,7 +1853,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentOptimizationOptions(_Model): +class AgentOptimizationOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Tuning knobs and run-mode for an optimization job. :ivar max_candidates: Maximum number of optimization candidates to generate. Must be >= 1. @@ -1919,7 +1931,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentOptimizationReferenceDatasetInput(AgentOptimizationDatasetInput, discriminator="reference"): +class AgentOptimizationReferenceDatasetInput( + AgentOptimizationDatasetInput, discriminator="reference" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Reference to a registered Foundry dataset. :ivar type: Dataset input type discriminator. Required. Reference to a registered Foundry @@ -1959,7 +1973,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = AgentOptimizationDatasetInputType.REFERENCE # type: ignore -class AgentSessionResource(_Model): +class AgentSessionResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """An agent session providing a long-lived compute sandbox for hosted agent invocations. :ivar agent_session_id: The session identifier. Required. @@ -2019,7 +2033,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationTaxonomyInput(_Model): +class EvaluationTaxonomyInput(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Input configuration for the evaluation taxonomy. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -2052,7 +2066,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentTaxonomyInput(EvaluationTaxonomyInput, discriminator="agent"): +class AgentTaxonomyInput( + EvaluationTaxonomyInput, discriminator="agent" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Input configuration for the evaluation taxonomy when the input type is agent. :ivar type: Input type of the evaluation taxonomy. Required. Agent. @@ -2092,7 +2108,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = EvaluationTaxonomyInputType.AGENT # type: ignore -class AgentVersionDetails(_Model): +class AgentVersionDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """AgentVersionDetails. :ivar metadata: Set of 16 key-value pairs that can be attached to an object. This can be @@ -2208,7 +2224,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AISearchIndexResource(_Model): +class AISearchIndexResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A AI Search Index resource. :ivar project_connection_id: An index connection ID in an IndexResource attached to this agent. @@ -2267,7 +2283,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ApiError(_Model): +class ApiError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """ApiError. :ivar code: Required. @@ -2324,7 +2340,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ApiErrorResponse(_Model): +class ApiErrorResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Error response for API failures. :ivar error: Required. @@ -2383,7 +2399,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = CredentialType.API_KEY # type: ignore -class ApplyPatchToolParam(Tool, discriminator="apply_patch"): +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. @@ -2417,7 +2435,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.APPLY_PATCH # type: ignore -class ApproximateLocation(_Model): +class ApproximateLocation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """ApproximateLocation. :ivar type: The type of location approximation. Always ``approximate``. Required. Default value @@ -2463,7 +2481,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["approximate"] = "approximate" -class ArtifactProfile(_Model): +class ArtifactProfile(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Artifact profile of the model. :ivar category: The category of the artifact profile. Required. Known values are: "DataOnly", @@ -2502,7 +2520,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AutoCodeInterpreterToolParam(_Model): +class AutoCodeInterpreterToolParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Automatic Code Interpreter Tool Parameters. :ivar type: Always ``auto``. Required. Default value is "auto". @@ -2548,7 +2566,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["auto"] = "auto" -class EvaluationTarget(_Model): +class EvaluationTarget(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Base class for targets with discriminator support. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -2580,7 +2598,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AzureAIAgentTarget(EvaluationTarget, discriminator="azure_ai_agent"): +class AzureAIAgentTarget( + EvaluationTarget, discriminator="azure_ai_agent" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents a target specifying an Azure AI agent. :ivar type: The type of target, always ``azure_ai_agent``. Required. Default value is @@ -2631,7 +2651,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = "azure_ai_agent" # type: ignore -class AzureAIModelTarget(EvaluationTarget, discriminator="azure_ai_model"): +class AzureAIModelTarget( + EvaluationTarget, discriminator="azure_ai_model" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents a target specifying an Azure AI model for operations requiring model selection. :ivar type: The type of target, always ``azure_ai_model``. Required. Default value is @@ -2673,7 +2695,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = "azure_ai_model" # type: ignore -class Index(_Model): +class Index(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Index resource Definition. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -2729,7 +2751,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AzureAISearchIndex(Index, discriminator="AzureSearch"): +class AzureAISearchIndex( + Index, discriminator="AzureSearch" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Azure AI Search Index Definition. :ivar id: Asset ID, a unique identifier for the asset. @@ -2784,7 +2808,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = IndexType.AZURE_SEARCH # type: ignore -class AzureAISearchTool(Tool, discriminator="azure_ai_search"): +class AzureAISearchTool( + Tool, discriminator="azure_ai_search" +): # pylint: disable=docstring-keyword-should-match-keyword-only """The input definition information for an Azure AI search tool as used to configure an agent. :ivar type: The object type, which is always 'azure_ai_search'. Required. AZURE_AI_SEARCH. @@ -2838,7 +2864,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.AZURE_AI_SEARCH # type: ignore -class AzureAISearchToolboxTool(ToolboxTool, discriminator="azure_ai_search"): +class AzureAISearchToolboxTool( + ToolboxTool, discriminator="azure_ai_search" +): # pylint: disable=docstring-keyword-should-match-keyword-only """An Azure AI Search tool stored in a toolbox. :ivar name: Optional user-defined name for this tool or configuration. @@ -2884,7 +2912,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolboxToolType.AZURE_AI_SEARCH # type: ignore -class AzureAISearchToolResource(_Model): +class AzureAISearchToolResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A set of index resources used by the ``azure_ai_search`` tool. :ivar indexes: The indices attached to this agent. There can be a maximum of 1 index resource @@ -2916,7 +2944,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AzureFunctionBinding(_Model): +class AzureFunctionBinding(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The structure for keeping storage queue name and URI. :ivar type: The type of binding, which is always 'storage_queue'. Required. Default value is @@ -2953,7 +2981,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["storage_queue"] = "storage_queue" -class AzureFunctionDefinition(_Model): +class AzureFunctionDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The definition of Azure function. :ivar function: The definition of azure function and its parameters. Required. @@ -3001,7 +3029,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AzureFunctionDefinitionFunction(_Model): +class AzureFunctionDefinitionFunction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """AzureFunctionDefinitionFunction. :ivar name: The name of the function to be called. Required. @@ -3042,7 +3070,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AzureFunctionStorageQueue(_Model): +class AzureFunctionStorageQueue(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The structure for keeping storage queue name and URI. :ivar queue_service_endpoint: URI to the Azure Storage Queue service allowing you to manipulate @@ -3076,7 +3104,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AzureFunctionTool(Tool, discriminator="azure_function"): +class AzureFunctionTool( + Tool, discriminator="azure_function" +): # pylint: disable=docstring-keyword-should-match-keyword-only """The input definition information for an Azure Function Tool, as used to configure an Agent. :ivar type: The object type, which is always 'browser_automation'. Required. AZURE_FUNCTION. @@ -3119,7 +3149,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.AZURE_FUNCTION # type: ignore -class RedTeamTargetConfig(_Model): +class RedTeamTargetConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Abstract class for target configuration. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -3151,7 +3181,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AzureOpenAIModelConfiguration(RedTeamTargetConfig, discriminator="AzureOpenAIModel"): +class AzureOpenAIModelConfiguration( + RedTeamTargetConfig, discriminator="AzureOpenAIModel" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Azure OpenAI model configuration. The API version would be selected by the service for querying the model. @@ -3190,7 +3222,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = "AzureOpenAIModel" # type: ignore -class BingCustomSearchConfiguration(_Model): +class BingCustomSearchConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A bing custom search configuration. :ivar project_connection_id: Project connection id for grounding with bing search. Required. @@ -3245,7 +3277,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class BingCustomSearchPreviewTool(Tool, discriminator="bing_custom_search_preview"): +class BingCustomSearchPreviewTool( + Tool, discriminator="bing_custom_search_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only """The input definition information for a Bing custom search tool as used to configure an agent. :ivar type: The object type, which is always 'bing_custom_search_preview'. Required. @@ -3282,7 +3316,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.BING_CUSTOM_SEARCH_PREVIEW # type: ignore -class BingCustomSearchToolParameters(_Model): +class BingCustomSearchToolParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The bing custom search tool parameters. :ivar search_configurations: The project connections attached to this tool. There can be a @@ -3314,7 +3348,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class BingGroundingSearchConfiguration(_Model): +class BingGroundingSearchConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Search configuration for Bing Grounding. :ivar project_connection_id: Project connection id for grounding with bing search. Required. @@ -3364,7 +3398,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class BingGroundingSearchToolParameters(_Model): +class BingGroundingSearchToolParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The bing grounding search tool parameters. :ivar search_configurations: The search configurations attached to this tool. There can be a @@ -3397,7 +3431,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class BingGroundingTool(Tool, discriminator="bing_grounding"): +class BingGroundingTool( + Tool, discriminator="bing_grounding" +): # pylint: disable=docstring-keyword-should-match-keyword-only """The input definition information for a bing grounding search tool as used to configure an agent. @@ -3452,7 +3488,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.BING_GROUNDING # type: ignore -class BlobReference(_Model): +class BlobReference(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Blob reference details. :ivar blob_uri: Blob URI path for client to upload data. Example: @@ -3496,7 +3532,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class BlobReferenceSasCredential(_Model): +class BlobReferenceSasCredential(_Model): # pylint: disable=docstring-missing-param """SAS Credential definition. :ivar sas_uri: SAS uri. Required. @@ -3596,7 +3632,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT # type: ignore -class BrowserAutomationPreviewTool(Tool, discriminator="browser_automation_preview"): +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. :ivar type: The object type, which is always 'browser_automation_preview'. Required. @@ -3633,7 +3671,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.BROWSER_AUTOMATION_PREVIEW # type: ignore -class BrowserAutomationPreviewToolboxTool(ToolboxTool, discriminator="browser_automation_preview"): +class BrowserAutomationPreviewToolboxTool( + ToolboxTool, discriminator="browser_automation_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A browser automation tool stored in a toolbox. :ivar name: Optional user-defined name for this tool or configuration. @@ -3679,7 +3719,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolboxToolType.BROWSER_AUTOMATION_PREVIEW # type: ignore -class BrowserAutomationToolConnectionParameters(_Model): # pylint: disable=name-too-long +class BrowserAutomationToolConnectionParameters( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """Definition of input parameters for the connection used by the Browser Automation Tool. :ivar project_connection_id: The ID of the project connection to your Azure Playwright @@ -3708,7 +3750,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class BrowserAutomationToolParameters(_Model): +class BrowserAutomationToolParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Definition of input parameters for the Browser Automation Tool. :ivar connection: The project connection parameters associated with the Browser Automation @@ -3739,7 +3781,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CaptureStructuredOutputsTool(Tool, discriminator="capture_structured_outputs"): +class CaptureStructuredOutputsTool( + Tool, discriminator="capture_structured_outputs" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A tool for capturing structured outputs. :ivar type: The type of the tool. Always ``capture_structured_outputs``. Required. @@ -3795,7 +3839,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.CAPTURE_STRUCTURED_OUTPUTS # type: ignore -class ChartCoordinate(_Model): +class ChartCoordinate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Coordinates for the analysis chart. :ivar x: X-axis coordinate. Required. @@ -3833,7 +3877,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryItem(_Model): +class MemoryItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A single memory item stored in the memory store, containing content and metadata. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -3890,7 +3934,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ChatSummaryMemoryItem(MemoryItem, discriminator="chat_summary"): +class ChatSummaryMemoryItem( + MemoryItem, discriminator="chat_summary" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A memory item containing a summary extracted from conversations. :ivar memory_id: The unique ID of the memory item. Required. @@ -3931,7 +3977,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = MemoryItemKind.CHAT_SUMMARY # type: ignore -class ClusterInsightResult(_Model): +class ClusterInsightResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Insights from the cluster analysis. :ivar summary: Summary of the insights report. Required. @@ -4008,7 +4054,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ClusterTokenUsage(_Model): +class ClusterTokenUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Token usage for cluster analysis. :ivar input_token_usage: input token usage. Required. @@ -4052,7 +4098,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorDefinition(_Model): +class EvaluatorDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Base evaluator configuration with discriminator. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -4108,7 +4154,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CodeBasedEvaluatorDefinition(EvaluatorDefinition, discriminator="code"): +class CodeBasedEvaluatorDefinition( + EvaluatorDefinition, discriminator="code" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Code-based evaluator definition using python code. :ivar init_parameters: The JSON schema (Draft 2020-12) for the evaluator's input parameters. @@ -4169,7 +4217,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = EvaluatorDefinitionType.CODE # type: ignore -class CodeConfiguration(_Model): +class CodeConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Code-based deployment configuration for a hosted agent. :ivar runtime: The runtime identifier for code execution (e.g., 'python_3_11', 'python_3_12', @@ -4226,7 +4274,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CodeInterpreterTool(Tool, discriminator="code_interpreter"): +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. @@ -4293,7 +4343,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.CODE_INTERPRETER # type: ignore -class CodeInterpreterToolboxTool(ToolboxTool, discriminator="code_interpreter"): +class CodeInterpreterToolboxTool( + ToolboxTool, discriminator="code_interpreter" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A code interpreter tool stored in a toolbox. :ivar name: Optional user-defined name for this tool or configuration. @@ -4351,7 +4403,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolboxToolType.CODE_INTERPRETER # type: ignore -class ComparisonFilter(_Model): +class ComparisonFilter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Comparison Filter. :ivar type: Specifies the comparison operator: ``eq``, ``ne``, ``gt``, ``gte``, ``lt``, @@ -4418,7 +4470,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CompoundFilter(_Model): +class CompoundFilter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Compound Filter. :ivar type: Type of operation: ``and`` or ``or``. Required. Is either a Literal["and"] type or @@ -4483,7 +4535,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.COMPUTER # type: ignore -class ComputerUsePreviewTool(Tool, discriminator="computer_use_preview"): +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. @@ -4572,7 +4626,7 @@ class Connection(_Model): """Metadata of the connection. Required.""" -class FunctionShellToolParamEnvironment(_Model): +class FunctionShellToolParamEnvironment(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """FunctionShellToolParamEnvironment. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -4605,7 +4659,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ContainerAutoParam(FunctionShellToolParamEnvironment, discriminator="container_auto"): +class ContainerAutoParam( + FunctionShellToolParamEnvironment, discriminator="container_auto" +): # pylint: disable=docstring-keyword-should-match-keyword-only """ContainerAutoParam. :ivar type: Automatically creates a container for this request. Required. CONTAINER_AUTO. @@ -4658,7 +4714,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = FunctionShellToolParamEnvironmentType.CONTAINER_AUTO # type: ignore -class ContainerConfiguration(_Model): +class ContainerConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Container-based deployment configuration for a hosted agent. :ivar image: The container image for the hosted agent. Required. @@ -4701,7 +4757,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ContainerNetworkPolicyParam(_Model): +class ContainerNetworkPolicyParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Network access policy for the container. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -4733,7 +4789,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ContainerNetworkPolicyAllowlistParam(ContainerNetworkPolicyParam, discriminator="allowlist"): +class ContainerNetworkPolicyAllowlistParam( + ContainerNetworkPolicyParam, discriminator="allowlist" +): # pylint: disable=docstring-keyword-should-match-keyword-only """ContainerNetworkPolicyAllowlistParam. :ivar type: Allow outbound network access only to specified domains. Always ``allowlist``. @@ -4803,7 +4861,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ContainerNetworkPolicyParamType.DISABLED # type: ignore -class ContainerNetworkPolicyDomainSecretParam(_Model): +class ContainerNetworkPolicyDomainSecretParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """ContainerNetworkPolicyDomainSecretParam. :ivar domain: The domain associated with the secret. Required. @@ -4841,7 +4899,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ContainerSkill(_Model): +class ContainerSkill(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """ContainerSkill. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -4873,7 +4931,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationRuleAction(_Model): +class EvaluationRuleAction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Evaluation action model. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -4907,7 +4965,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ContinuousEvaluationRuleAction(EvaluationRuleAction, discriminator="continuousEvaluation"): +class ContinuousEvaluationRuleAction( + EvaluationRuleAction, discriminator="continuousEvaluation" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Evaluation rule action for continuous evaluation. :ivar type: Required. Continuous evaluation. @@ -4958,7 +5018,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = EvaluationRuleActionType.CONTINUOUS_EVALUATION # type: ignore -class CosmosDBIndex(Index, discriminator="CosmosDBNoSqlVectorStore"): +class CosmosDBIndex( + Index, discriminator="CosmosDBNoSqlVectorStore" +): # pylint: disable=docstring-keyword-should-match-keyword-only """CosmosDB Vector Store Index Definition. :ivar id: Asset ID, a unique identifier for the asset. @@ -5025,7 +5087,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = IndexType.COSMOS_DB # type: ignore -class CreateAsyncResponse(_Model): +class CreateAsyncResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """CreateAsyncResponse. :ivar location: URL to poll for operation status. @@ -5061,7 +5123,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CreateSkillVersionFromFilesBody(_Model): +class CreateSkillVersionFromFilesBody(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Multipart request body for creating a skill version from files. Accepts either a single zip file or multiple individual skill files (directory upload). For zip uploads, the server extracts and validates contents. For directory uploads, files are validated as-is. @@ -5100,7 +5162,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CreateTranscriptionResponseJsonUsage(_Model): +class CreateTranscriptionResponseJsonUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Token usage statistics for the request. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -5132,7 +5194,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Trigger(_Model): +class Trigger(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Base model for Trigger of the schedule. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -5165,7 +5227,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CronTrigger(Trigger, discriminator="Cron"): +class CronTrigger(Trigger, discriminator="Cron"): # pylint: disable=docstring-keyword-should-match-keyword-only """Cron based trigger. :ivar type: Required. Cron based trigger. @@ -5244,7 +5306,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = CredentialType.CUSTOM # type: ignore -class CustomToolParamFormat(_Model): +class CustomToolParamFormat(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The input format for the custom tool. Default is unconstrained text. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -5276,7 +5338,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CustomGrammarFormatParam(CustomToolParamFormat, discriminator="grammar"): +class CustomGrammarFormatParam( + CustomToolParamFormat, discriminator="grammar" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Grammar format. :ivar type: Grammar format. Always ``grammar``. Required. GRAMMAR. @@ -5318,7 +5382,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = CustomToolParamFormatType.GRAMMAR # type: ignore -class RoutineTrigger(_Model): +class RoutineTrigger(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Base model for a routine trigger. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -5352,7 +5416,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CustomRoutineTrigger(RoutineTrigger, discriminator="custom"): +class CustomRoutineTrigger( + RoutineTrigger, discriminator="custom" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A custom event routine trigger. :ivar type: The trigger type. Required. A custom event trigger. @@ -5422,7 +5488,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = CustomToolParamFormatType.TEXT # type: ignore -class CustomToolParam(Tool, discriminator="custom"): +class CustomToolParam(Tool, discriminator="custom"): # pylint: disable=docstring-keyword-should-match-keyword-only """Custom tool. :ivar type: The type of the custom tool. Always ``custom``. Required. CUSTOM. @@ -5478,7 +5544,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.CUSTOM # type: ignore -class RecurrenceSchedule(_Model): +class RecurrenceSchedule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Recurrence schedule model. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -5513,7 +5579,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DailyRecurrenceSchedule(RecurrenceSchedule, discriminator="Daily"): +class DailyRecurrenceSchedule( + RecurrenceSchedule, discriminator="Daily" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Daily recurrence schedule. :ivar type: Daily recurrence type. Required. Daily recurrence pattern. @@ -5546,7 +5614,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RecurrenceType.DAILY # type: ignore -class DataGenerationJob(_Model): +class DataGenerationJob(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Data Generation Job resource. :ivar id: Server-assigned unique identifier. Required. @@ -5606,7 +5674,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DataGenerationJobInputs(_Model): +class DataGenerationJobInputs(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Caller-supplied inputs for a data generation job. :ivar name: The display name of the data generation job. Required. @@ -5666,7 +5734,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DataGenerationJobOptions(_Model): +class DataGenerationJobOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Options for managing data generation jobs. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -5720,7 +5788,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DataGenerationJobOutput(_Model): +class DataGenerationJobOutput(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Output information for a data generation job. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -5752,7 +5820,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DataGenerationJobOutputOptions(_Model): +class DataGenerationJobOutputOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Output options for data generation job. :ivar name: Name to assign to the output. Used as the filename for Azure OpenAI file outputs @@ -5796,7 +5864,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DataGenerationJobResult(_Model): +class DataGenerationJobResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Result produced by a successful data generation job. :ivar outputs: The final job outputs: Azure OpenAI files for fine-tuning, or datasets for @@ -5839,7 +5907,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DataGenerationModelOptions(_Model): +class DataGenerationModelOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """LLM model options for data generation jobs. :ivar model: Base model name used to generate data. Required. @@ -5886,7 +5954,7 @@ class DataGenerationTokenUsage(_Model): """Total number of tokens used. Required.""" -class DatasetCredential(_Model): +class DatasetCredential(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents a reference to a blob for consumption. :ivar blob_reference: Credential info to access the storage account. Required. @@ -5963,7 +6031,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = DataGenerationJobOutputType.DATASET # type: ignore -class DatasetEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator="dataset"): +class DatasetEvaluatorGenerationJobSource( + EvaluatorGenerationJobSource, discriminator="dataset" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Dataset source for evaluator generation jobs — reference to a dataset. :ivar description: Optional description of what this source represents — helps the pipeline @@ -6011,7 +6081,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = EvaluatorGenerationJobSourceType.DATASET # type: ignore -class DatasetReference(_Model): +class DatasetReference(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Reference to a versioned Foundry Dataset. :ivar name: Dataset name. Required. @@ -6044,7 +6114,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DatasetVersion(_Model): +class DatasetVersion(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """DatasetVersion Definition. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -6118,7 +6188,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DeleteAgentResponse(_Model): +class DeleteAgentResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A deleted agent Object. :ivar object: The object type. Always 'agent.deleted'. Required. AGENT_DELETED. @@ -6158,7 +6228,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DeleteAgentVersionResponse(_Model): +class DeleteAgentVersionResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A deleted agent version Object. :ivar object: The object type. Always 'agent.version.deleted'. Required. AGENT_VERSION_DELETED. @@ -6203,7 +6273,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DeleteMemoryResult(_Model): +class DeleteMemoryResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Response for deleting a memory item from a memory store. :ivar object: The object type. Always 'memory_store.item.deleted'. Required. MEMORY_DELETED. @@ -6243,7 +6313,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DeleteMemoryStoreResult(_Model): +class DeleteMemoryStoreResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """DeleteMemoryStoreResult. :ivar object: The object type. Always 'memory_store.deleted'. Required. MEMORY_STORE_DELETED. @@ -6283,7 +6353,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DeleteSkillResult(_Model): +class DeleteSkillResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A deleted skill. :ivar id: The unique identifier of the deleted skill. Required. @@ -6321,7 +6391,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DeleteSkillVersionResult(_Model): +class DeleteSkillVersionResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A deleted skill version. :ivar id: The unique identifier of the deleted skill version. Required. @@ -6364,7 +6434,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Deployment(_Model): +class Deployment(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Model Deployment Definition. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -6400,7 +6470,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Dimension(_Model): +class Dimension(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A single dimension — one independent, measurable quality dimension within a rubric evaluator's scoring blueprint. @@ -6461,7 +6531,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DispatchRoutineResult(_Model): +class DispatchRoutineResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Identifiers returned after a routine dispatch is queued. :ivar dispatch_id: The dispatch identifier created for the routine dispatch. @@ -6499,7 +6569,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EmbeddingConfiguration(_Model): +class EmbeddingConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Embedding configuration class. :ivar model_deployment_name: Deployment name of embedding model. It can point to a model @@ -6538,7 +6608,9 @@ class EmptyModelParam(_Model): """EmptyModelParam.""" -class EndpointBasedEvaluatorDefinition(EvaluatorDefinition, discriminator="endpoint"): +class EndpointBasedEvaluatorDefinition( + EvaluatorDefinition, discriminator="endpoint" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Endpoint-based evaluator definition. The customer owns and hosts an HTTP endpoint that implements the evaluation contract. The evaluator references a Project Connection by name; the connection stores the endpoint URL and credentials (API Key or Entra ID). At execution time, @@ -6648,7 +6720,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = CredentialType.ENTRA_ID # type: ignore -class EvalResult(_Model): +class EvalResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Result of the evaluation. :ivar name: name of the check. Required. @@ -6691,7 +6763,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvalRunResultCompareItem(_Model): +class EvalRunResultCompareItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Metric comparison for a treatment against the baseline. :ivar treatment_run_id: The treatment run ID. Required. @@ -6747,7 +6819,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvalRunResultComparison(_Model): +class EvalRunResultComparison(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Comparison results for treatment runs against the baseline. :ivar testing_criteria: Name of the testing criteria. Required. @@ -6801,7 +6873,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvalRunResultSummary(_Model): +class EvalRunResultSummary(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Summary statistics of a metric in an evaluation run. :ivar run_id: The evaluation run ID. Required. @@ -6846,7 +6918,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationComparisonInsightRequest(InsightRequest, discriminator="EvaluationComparison"): +class EvaluationComparisonInsightRequest( + InsightRequest, discriminator="EvaluationComparison" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Evaluation Comparison Request. :ivar type: The type of request. Required. Evaluation Comparison. @@ -6891,7 +6965,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = InsightType.EVALUATION_COMPARISON # type: ignore -class EvaluationComparisonInsightResult(InsightResult, discriminator="EvaluationComparison"): +class EvaluationComparisonInsightResult( + InsightResult, discriminator="EvaluationComparison" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Insights from the evaluation comparison. :ivar type: The type of insights result. Required. Evaluation Comparison. @@ -6931,7 +7007,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = InsightType.EVALUATION_COMPARISON # type: ignore -class InsightSample(_Model): +class InsightSample(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A sample from the analysis. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -6980,7 +7056,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationResultSample(InsightSample, discriminator="EvaluationResultSample"): +class EvaluationResultSample( + InsightSample, discriminator="EvaluationResultSample" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A sample from the evaluation result. :ivar id: The unique identifier for the analysis sample. Required. @@ -7024,7 +7102,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = SampleType.EVALUATION_RESULT_SAMPLE # type: ignore -class EvaluationRule(_Model): +class EvaluationRule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Evaluation rule model. :ivar id: Unique identifier for the evaluation rule. Required. @@ -7093,7 +7171,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationRuleFilter(_Model): +class EvaluationRuleFilter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Evaluation filter model. :ivar agent_name: Filter by agent name. Required. @@ -7121,7 +7199,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationRunClusterInsightRequest(InsightRequest, discriminator="EvaluationRunClusterInsight"): +class EvaluationRunClusterInsightRequest( + InsightRequest, discriminator="EvaluationRunClusterInsight" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Insights on set of Evaluation Results. :ivar type: The type of insights request. Required. Insights on an Evaluation run result. @@ -7166,7 +7246,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = InsightType.EVALUATION_RUN_CLUSTER_INSIGHT # type: ignore -class EvaluationRunClusterInsightResult(InsightResult, discriminator="EvaluationRunClusterInsight"): +class EvaluationRunClusterInsightResult( + InsightResult, discriminator="EvaluationRunClusterInsight" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Insights from the evaluation run cluster analysis. :ivar type: The type of insights result. Required. Insights on an Evaluation run result. @@ -7201,7 +7283,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = InsightType.EVALUATION_RUN_CLUSTER_INSIGHT # type: ignore -class ScheduleTask(_Model): +class ScheduleTask(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Schedule task model. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -7238,7 +7320,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationScheduleTask(ScheduleTask, discriminator="Evaluation"): +class EvaluationScheduleTask( + ScheduleTask, discriminator="Evaluation" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Evaluation task for the schedule. :ivar configuration: Configuration for the task. @@ -7279,7 +7363,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ScheduleTaskType.EVALUATION # type: ignore -class EvaluationTaxonomy(_Model): +class EvaluationTaxonomy(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Evaluation Taxonomy Definition. :ivar id: Asset ID, a unique identifier for the asset. @@ -7343,7 +7427,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorCredentialRequest(_Model): +class EvaluatorCredentialRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Request body for getting evaluator credentials. :ivar blob_uri: The blob URI for the evaluator storage. Example: @@ -7373,7 +7457,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorGenerationArtifacts(_Model): +class EvaluatorGenerationArtifacts(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Service-managed provenance artifacts produced by an evaluator generation job. Present only on EvaluatorVersion resources created via the generation pipeline. The combined-JSONL Foundry Dataset is read-only and resolves to a versioned dataset in a service-reserved namespace. @@ -7422,7 +7506,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorGenerationInputs(_Model): +class EvaluatorGenerationInputs(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Caller-supplied inputs for an evaluator generation job. :ivar sources: Source materials for generation — agent descriptions, prompts, traces, or @@ -7505,7 +7589,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorGenerationJob(_Model): +class EvaluatorGenerationJob(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions from source materials. On success, the result is the persisted EvaluatorVersion. @@ -7582,7 +7666,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorGenerationTokenUsage(_Model): +class EvaluatorGenerationTokenUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Token consumption summary for an evaluator generation job. Populated when the job reaches a terminal state. @@ -7621,7 +7705,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorMetric(_Model): +class EvaluatorMetric(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Evaluator Metric. :ivar type: Type of the metric. Known values are: "ordinal", "continuous", and "boolean". @@ -7680,7 +7764,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorVersion(_Model): +class EvaluatorVersion(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Evaluator Definition. :ivar display_name: Display Name for evaluator. It helps to find the evaluator easily in AI @@ -7809,7 +7893,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ExternalAgentDefinition(AgentDefinition, discriminator="external"): +class ExternalAgentDefinition( + AgentDefinition, discriminator="external" +): # pylint: disable=docstring-keyword-should-match-keyword-only """The external agent definition. Represents a third-party agent hosted outside Foundry (for example, on GCP or AWS). Registration is metadata-only: Foundry records the agent definition to light up observability experiences (traces, evaluations) over customer-emitted OpenTelemetry @@ -7857,7 +7943,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = AgentKind.EXTERNAL # type: ignore -class FabricDataAgentToolParameters(_Model): +class FabricDataAgentToolParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The fabric data agent tool parameters. :ivar project_connections: The project connections attached to this tool. There can be a @@ -7889,7 +7975,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class FabricIQPreviewTool(Tool, discriminator="fabric_iq_preview"): +class FabricIQPreviewTool( + Tool, discriminator="fabric_iq_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A FabricIQ server-side tool. :ivar type: The object type, which is always 'fabric_iq_preview'. Required. FABRIC_IQ_PREVIEW. @@ -7943,7 +8031,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.FABRIC_IQ_PREVIEW # type: ignore -class FabricIQPreviewToolboxTool(ToolboxTool, discriminator="fabric_iq_preview"): +class FabricIQPreviewToolboxTool( + ToolboxTool, discriminator="fabric_iq_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A FabricIQ tool stored in a toolbox. :ivar name: Optional user-defined name for this tool or configuration. @@ -8008,7 +8098,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolboxToolType.FABRIC_IQ_PREVIEW # type: ignore -class FieldMapping(_Model): +class FieldMapping(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Field mapping configuration class. :ivar content_fields: List of fields with text content. Required. @@ -8096,7 +8186,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = DataGenerationJobOutputType.FILE # type: ignore -class FileDataGenerationJobSource(DataGenerationJobSource, discriminator="file"): +class FileDataGenerationJobSource( + DataGenerationJobSource, discriminator="file" +): # pylint: disable=docstring-keyword-should-match-keyword-only """File source for data generation jobs — Azure OpenAI file input. :ivar description: Optional description of what this source represents — helps the pipeline @@ -8135,7 +8227,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = DataGenerationJobSourceType.FILE # type: ignore -class FileDatasetVersion(DatasetVersion, discriminator="uri_file"): +class FileDatasetVersion( + DatasetVersion, discriminator="uri_file" +): # pylint: disable=docstring-keyword-should-match-keyword-only """FileDatasetVersion Definition. :ivar data_uri: URI of the data (`example `_). @@ -8187,7 +8281,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = DatasetType.URI_FILE # type: ignore -class FileSearchTool(Tool, discriminator="file_search"): +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. @@ -8258,7 +8352,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.FILE_SEARCH # type: ignore -class FileSearchToolboxTool(ToolboxTool, discriminator="file_search"): +class FileSearchToolboxTool( + ToolboxTool, discriminator="file_search" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A file search tool stored in a toolbox. :ivar name: Optional user-defined name for this tool or configuration. @@ -8321,7 +8417,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolboxToolType.FILE_SEARCH # type: ignore -class VersionSelectionRule(_Model): +class VersionSelectionRule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """VersionSelectionRule. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -8358,7 +8454,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class FixedRatioVersionSelectionRule(VersionSelectionRule, discriminator="FixedRatio"): +class FixedRatioVersionSelectionRule( + VersionSelectionRule, discriminator="FixedRatio" +): # pylint: disable=docstring-keyword-should-match-keyword-only """FixedRatioVersionSelectionRule. :ivar agent_version: The agent version to route traffic to. Required. @@ -8395,7 +8493,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = VersionSelectorType.FIXED_RATIO # type: ignore -class FolderDatasetVersion(DatasetVersion, discriminator="uri_folder"): +class FolderDatasetVersion( + DatasetVersion, discriminator="uri_folder" +): # pylint: disable=docstring-keyword-should-match-keyword-only """FileDatasetVersion Definition. :ivar data_uri: URI of the data (`example `_). @@ -8447,7 +8547,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = DatasetType.URI_FOLDER # type: ignore -class FoundryModelWarning(_Model): +class FoundryModelWarning(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A warning associated with a model. :ivar code: The warning code. Known values are: "RuntimeDependentArtifact" and @@ -8483,7 +8583,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class FunctionShellToolParam(Tool, discriminator="shell"): +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. @@ -8544,7 +8646,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class FunctionShellToolParamEnvironmentContainerReferenceParam( FunctionShellToolParamEnvironment, discriminator="container_reference" -): # pylint: disable=name-too-long +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """FunctionShellToolParamEnvironmentContainerReferenceParam. :ivar type: References a container created with the /v1/containers endpoint. Required. @@ -8580,7 +8682,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class FunctionShellToolParamEnvironmentLocalEnvironmentParam( FunctionShellToolParamEnvironment, discriminator="local" -): # pylint: disable=name-too-long +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """FunctionShellToolParamEnvironmentLocalEnvironmentParam. :ivar type: Use a local computer environment. Required. LOCAL. @@ -8615,7 +8717,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = FunctionShellToolParamEnvironmentType.LOCAL # type: ignore -class FunctionTool(Tool, discriminator="function"): +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. @@ -8677,7 +8779,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.FUNCTION # type: ignore -class FunctionToolParam(_Model): +class FunctionToolParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """FunctionToolParam. :ivar name: Required. @@ -8739,7 +8841,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["function"] = "function" -class GenerateVoiceAgentRequest(_Model): +class GenerateVoiceAgentRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The inputs for generating a voice agent. Only ``kind`` and ``name`` are always required. The authoring service expands these inputs into a full, editable ``VoiceAgentDefinition``, which is then created through ``POST /agents``. The generated ``instructions`` and audio/voice settings @@ -8832,7 +8934,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class GitHubIssueRoutineTrigger(RoutineTrigger, discriminator="github_issue"): +class GitHubIssueRoutineTrigger( + RoutineTrigger, discriminator="github_issue" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A GitHub issue routine trigger. :ivar type: The trigger type. Required. A GitHub issue trigger. @@ -8888,7 +8992,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RoutineTriggerType.GITHUB_ISSUE # type: ignore -class TelemetryEndpointAuth(_Model): +class TelemetryEndpointAuth(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Authentication configuration for a telemetry endpoint. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -8920,7 +9024,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HeaderTelemetryEndpointAuth(TelemetryEndpointAuth, discriminator="header"): +class HeaderTelemetryEndpointAuth( + TelemetryEndpointAuth, discriminator="header" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Header-based secret authentication for a telemetry endpoint. The resolved secret value is injected as an HTTP header. @@ -8966,7 +9072,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = TelemetryEndpointAuthType.HEADER # type: ignore -class HostedAgentDefinition(AgentDefinition, discriminator="hosted"): +class HostedAgentDefinition( + AgentDefinition, discriminator="hosted" +): # pylint: disable=docstring-keyword-should-match-keyword-only """The hosted agent definition. :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. @@ -9086,7 +9194,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RecurrenceType.HOURLY # type: ignore -class HumanEvaluationPreviewRuleAction(EvaluationRuleAction, discriminator="humanEvaluationPreview"): +class HumanEvaluationPreviewRuleAction( + EvaluationRuleAction, discriminator="humanEvaluationPreview" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Evaluation rule action for human evaluation. :ivar type: Required. Human evaluation preview. @@ -9119,7 +9229,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW # type: ignore -class HybridSearchOptions(_Model): +class HybridSearchOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """HybridSearchOptions. :ivar embedding_weight: The weight of the embedding in the reciprocal ranking fusion. Required. @@ -9152,7 +9262,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ImageGenTool(Tool, discriminator="image_generation"): +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. @@ -9316,7 +9428,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.IMAGE_GENERATION # type: ignore -class ImageGenToolInputImageMask(_Model): +class ImageGenToolInputImageMask(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """ImageGenToolInputImageMask. :ivar image_url: @@ -9347,7 +9459,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InlineSkillParam(ContainerSkill, discriminator="inline"): +class InlineSkillParam( + ContainerSkill, discriminator="inline" +): # pylint: disable=docstring-keyword-should-match-keyword-only """InlineSkillParam. :ivar type: Defines an inline skill for this request. Required. INLINE. @@ -9390,7 +9504,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ContainerSkillType.INLINE # type: ignore -class InlineSkillSourceParam(_Model): +class InlineSkillSourceParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Inline skill payload. :ivar type: The type of the inline skill source. Must be ``base64``. Required. Default value is @@ -9431,7 +9545,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.media_type: Literal["application/zip"] = "application/zip" -class Insight(_Model): +class Insight(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The response body for cluster insights. :ivar insight_id: The unique identifier for the insights report. Required. @@ -9482,7 +9596,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InsightCluster(_Model): +class InsightCluster(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A cluster of analysis samples. :ivar id: The id of the analysis cluster. Required. @@ -9553,7 +9667,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InsightModelConfiguration(_Model): +class InsightModelConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Configuration of the model used in the insight generation. :ivar model_deployment_name: The model deployment to be evaluated. Accepts either the @@ -9586,7 +9700,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InsightScheduleTask(ScheduleTask, discriminator="Insight"): +class InsightScheduleTask( + ScheduleTask, discriminator="Insight" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Insight task for the schedule. :ivar configuration: Configuration for the task. @@ -9622,7 +9738,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ScheduleTaskType.INSIGHT # type: ignore -class InsightsMetadata(_Model): +class InsightsMetadata(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Metadata about the insights. :ivar created_at: The timestamp when the insights were created. Required. @@ -9659,7 +9775,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InsightSummary(_Model): +class InsightSummary(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Summary of the error cluster analysis. :ivar sample_count: Total number of samples analyzed. Required. @@ -9719,7 +9835,7 @@ class InvocationsWsProtocolConfiguration(_Model): """Configuration specific to the WebSocket-based invocations protocol.""" -class RoutineDispatchPayload(_Model): +class RoutineDispatchPayload(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Base model for a manual dispatch payload. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -9753,7 +9869,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InvokeAgentInvocationsApiDispatchPayload(RoutineDispatchPayload, discriminator="invoke_agent_invocations_api"): +class InvokeAgentInvocationsApiDispatchPayload( + RoutineDispatchPayload, discriminator="invoke_agent_invocations_api" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A manual payload used to test an invocations API routine dispatch. :ivar type: The manual dispatch payload type. Required. A manual payload for an invocations API @@ -9790,7 +9908,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API # type: ignore -class RoutineAction(_Model): +class RoutineAction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Base model for a routine action. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -9824,7 +9942,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InvokeAgentInvocationsApiRoutineAction(RoutineAction, discriminator="invoke_agent_invocations_api"): +class InvokeAgentInvocationsApiRoutineAction( + RoutineAction, discriminator="invoke_agent_invocations_api" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Dispatches a routine through the raw invocations API. Exactly one of agent_name or agent_endpoint_id must be provided. @@ -9877,7 +9997,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RoutineActionType.INVOKE_AGENT_INVOCATIONS_API # type: ignore -class InvokeAgentResponsesApiDispatchPayload(RoutineDispatchPayload, discriminator="invoke_agent_responses_api"): +class InvokeAgentResponsesApiDispatchPayload( + RoutineDispatchPayload, discriminator="invoke_agent_responses_api" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A manual payload used to test a responses API routine dispatch. :ivar type: The manual dispatch payload type. Required. A manual payload for a responses API @@ -9914,7 +10036,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API # type: ignore -class InvokeAgentResponsesApiRoutineAction(RoutineAction, discriminator="invoke_agent_responses_api"): +class InvokeAgentResponsesApiRoutineAction( + RoutineAction, discriminator="invoke_agent_responses_api" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Dispatches a routine through the responses API. Exactly one of agent_name or agent_endpoint_id must be provided. @@ -9966,7 +10090,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RoutineActionType.INVOKE_AGENT_RESPONSES_API # type: ignore -class VoiceGreetingConfig(_Model): +class VoiceGreetingConfig(_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: @@ -9998,7 +10122,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class LlmGeneratedVoiceGreetingConfig(VoiceGreetingConfig, discriminator="llm_generated"): +class LlmGeneratedVoiceGreetingConfig( + VoiceGreetingConfig, discriminator="llm_generated" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A greeting authored by the session model from a scoped opening-turn prompt. :ivar type: Required. Default value is "llm_generated". @@ -10043,7 +10169,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = "llm_generated" # type: ignore -class LocalShellToolParam(Tool, discriminator="local_shell"): +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. @@ -10090,7 +10218,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.LOCAL_SHELL # type: ignore -class LocalSkillParam(_Model): +class LocalSkillParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """LocalSkillParam. :ivar name: The name of the skill. Required. @@ -10128,7 +10256,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class LogProbProperties(_Model): +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. @@ -10166,7 +10294,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class LoraConfig(_Model): +class LoraConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Adapter-specific metadata for LoRA models. Drives serving engine configuration at deployment time. @@ -10214,7 +10342,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ManagedAgentIdentityBlueprintReference(AgentBlueprintReference, discriminator="ManagedAgentIdentityBlueprint"): +class ManagedAgentIdentityBlueprintReference( + AgentBlueprintReference, discriminator="ManagedAgentIdentityBlueprint" +): # pylint: disable=docstring-keyword-should-match-keyword-only """ManagedAgentIdentityBlueprintReference. :ivar type: Required. MANAGED_AGENT_IDENTITY_BLUEPRINT. @@ -10247,7 +10377,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT # type: ignore -class ManagedAzureAISearchIndex(Index, discriminator="ManagedAzureSearch"): +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. @@ -10292,7 +10424,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = IndexType.MANAGED_AZURE_SEARCH # type: ignore -class MCPListToolsTool(_Model): +class MCPListToolsTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """MCP list tools tool. :ivar name: The name of the tool. Required. @@ -10349,7 +10481,7 @@ class McpProtocolConfiguration(_Model): """Configuration specific to the MCP protocol.""" -class MCPTool(Tool, discriminator="mcp"): +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. @@ -10514,7 +10646,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.MCP # type: ignore -class MCPToolboxTool(ToolboxTool, discriminator="mcp"): +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. @@ -10682,7 +10814,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolboxToolType.MCP # type: ignore -class MCPToolFilter(_Model): +class MCPToolFilter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """MCP tool filter. :ivar tool_names: MCP allowed tools. @@ -10721,7 +10853,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MCPToolRequireApproval(_Model): +class MCPToolRequireApproval(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """MCPToolRequireApproval. :ivar always: @@ -10752,7 +10884,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryOperation(_Model): +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 kind: The type of memory operation being performed. Required. Known values are: "create", @@ -10789,7 +10921,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemorySearchItem(_Model): +class MemorySearchItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A retrieved memory item from memory search. :ivar memory_item: Retrieved memory item. Required. @@ -10817,7 +10949,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemorySearchOptions(_Model): +class MemorySearchOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Memory search options. :ivar max_memories: Maximum number of memory items to return. @@ -10845,7 +10977,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemorySearchPreviewTool(Tool, discriminator="memory_search_preview"): +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 type of the tool. Always ``memory_search_preview``. Required. @@ -10901,7 +11035,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.MEMORY_SEARCH_PREVIEW # type: ignore -class MemoryStoreDefinition(_Model): +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: @@ -10933,7 +11067,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryStoreDefaultDefinition(MemoryStoreDefinition, discriminator="default"): +class MemoryStoreDefaultDefinition( + MemoryStoreDefinition, discriminator="default" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Default memory store implementation. :ivar kind: The kind of the memory store. Required. The default memory store implementation. @@ -10979,7 +11115,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = MemoryStoreKind.DEFAULT # type: ignore -class MemoryStoreDefaultOptions(_Model): +class MemoryStoreDefaultOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Default memory store configurations. :ivar user_profile_enabled: Whether to enable user profile extraction and storage. Default is @@ -11036,7 +11172,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryStoreDeleteScopeResult(_Model): +class MemoryStoreDeleteScopeResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Response for deleting memories from a scope. :ivar object: The object type. Always 'memory_store.scope.deleted'. Required. @@ -11082,7 +11218,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryStoreDetails(_Model): +class MemoryStoreDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A memory store that can store and retrieve user memories. :ivar object: The object type, which is always 'memory_store'. Required. MEMORY_STORE. @@ -11152,7 +11288,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryStoreOperationUsage(_Model): +class MemoryStoreOperationUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Usage statistics of a memory store operation. :ivar embedding_tokens: The number of embedding tokens. Required. @@ -11209,7 +11345,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryStoreSearchResult(_Model): +class MemoryStoreSearchResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Memory search response. :ivar search_id: The unique ID of this search request. Use this value as previous_search_id in @@ -11249,7 +11385,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryStoreUpdateCompletedResult(_Model): +class MemoryStoreUpdateCompletedResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Memory update result. :ivar memory_operations: A list of individual memory operations that were performed during the @@ -11285,7 +11421,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryStoreUpdateResult(_Model): +class MemoryStoreUpdateResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Provides the status of a memory store update operation. :ivar update_id: The unique ID of this update request. Use this value as previous_update_id in @@ -11352,7 +11488,9 @@ class Metadata(_Model): """ -class MicrosoftFabricPreviewTool(Tool, discriminator="fabric_dataagent_preview"): +class MicrosoftFabricPreviewTool( + Tool, discriminator="fabric_dataagent_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only """The input definition information for a Microsoft Fabric tool as used to configure an agent. :ivar type: The object type, which is always 'fabric_dataagent_preview'. Required. @@ -11389,7 +11527,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.FABRIC_DATAAGENT_PREVIEW # type: ignore -class ModelCredentialRequest(_Model): +class ModelCredentialRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Request to fetch credentials for a model asset. :ivar blob_uri: Blob URI of the model asset to fetch credentials for. Required. @@ -11470,7 +11608,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = DeploymentType.MODEL_DEPLOYMENT # type: ignore -class ModelDeploymentSku(_Model): +class ModelDeploymentSku(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Sku information. :ivar capacity: Sku capacity. Required. @@ -11518,7 +11656,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ModelPendingUploadRequest(_Model): +class ModelPendingUploadRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents a request for a pending upload of a model version. :ivar pending_upload_id: If PendingUploadId is not provided, a random GUID will be used. @@ -11565,7 +11703,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ModelPendingUploadResponse(_Model): +class ModelPendingUploadResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents the response for a model pending upload request. :ivar blob_reference: Container-level read, write, list SAS. Required. @@ -11617,7 +11755,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ModelSamplingParams(_Model): +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. @@ -11661,7 +11799,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ModelSourceData(_Model): +class ModelSourceData(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Source information for the model. :ivar source_type: The source type of the model. Known values are: "LocalUpload" and @@ -11697,7 +11835,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ModelVersion(_Model): +class ModelVersion(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Model Version Definition. :ivar blob_uri: URI of the model artifact in blob storage. Required. @@ -11782,7 +11920,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MonthlyRecurrenceSchedule(RecurrenceSchedule, discriminator="Monthly"): +class MonthlyRecurrenceSchedule( + RecurrenceSchedule, discriminator="Monthly" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Monthly recurrence schedule. :ivar type: Monthly recurrence type. Required. Monthly recurrence pattern. @@ -11817,7 +11957,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RecurrenceType.MONTHLY # type: ignore -class NamespaceToolParam(Tool, discriminator="namespace"): +class NamespaceToolParam( + Tool, discriminator="namespace" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Namespace. :ivar type: The type of the tool. Always ``namespace``. Required. NAMESPACE. @@ -11890,7 +12032,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = CredentialType.NONE # type: ignore -class OmitPropertiesRealtimeResponse(_Model): +class OmitPropertiesRealtimeResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The template for omitting properties. :ivar id: The unique ID of the response, will look like ``resp_1234``. @@ -11991,7 +12133,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OmitPropertiesRealtimeResponse1(_Model): +class OmitPropertiesRealtimeResponse1(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The template for omitting properties. :ivar id: The unique ID of the response, will look like ``resp_1234``. @@ -12096,7 +12238,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OneTimeTrigger(Trigger, discriminator="OneTime"): +class OneTimeTrigger(Trigger, discriminator="OneTime"): # pylint: disable=docstring-keyword-should-match-keyword-only """One-time trigger. :ivar type: Required. One-time trigger. @@ -12136,7 +12278,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = TriggerType.ONE_TIME # type: ignore -class OpenApiAuthDetails(_Model): +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: @@ -12197,7 +12339,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = OpenApiAuthType.ANONYMOUS # type: ignore -class OpenApiFunctionDefinition(_Model): +class OpenApiFunctionDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The input definition information for an openapi function. :ivar name: The name of the function to be called. Required. @@ -12251,7 +12393,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OpenApiFunctionDefinitionFunction(_Model): +class OpenApiFunctionDefinitionFunction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """OpenApiFunctionDefinitionFunction. :ivar name: The name of the function to be called. Required. @@ -12292,7 +12434,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OpenApiManagedAuthDetails(OpenApiAuthDetails, discriminator="managed_identity"): +class OpenApiManagedAuthDetails( + OpenApiAuthDetails, discriminator="managed_identity" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Security details for OpenApi managed_identity authentication. :ivar type: The object type, which is always 'managed_identity'. Required. MANAGED_IDENTITY. @@ -12327,7 +12471,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = OpenApiAuthType.MANAGED_IDENTITY # type: ignore -class OpenApiManagedSecurityScheme(_Model): +class OpenApiManagedSecurityScheme(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Security scheme for OpenApi managed_identity authentication. :ivar audience: Authentication scope for managed_identity auth type. Required. @@ -12355,7 +12499,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OpenApiProjectConnectionAuthDetails(OpenApiAuthDetails, discriminator="project_connection"): +class OpenApiProjectConnectionAuthDetails( + OpenApiAuthDetails, discriminator="project_connection" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Security details for OpenApi project connection authentication. :ivar type: The object type, which is always 'project_connection'. Required. @@ -12391,7 +12537,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = OpenApiAuthType.PROJECT_CONNECTION # type: ignore -class OpenApiProjectConnectionSecurityScheme(_Model): +class OpenApiProjectConnectionSecurityScheme(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Security scheme for OpenApi managed_identity authentication. :ivar project_connection_id: Project connection id for Project Connection auth type. Required. @@ -12419,7 +12565,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OpenApiTool(Tool, discriminator="openapi"): +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 type: The object type, which is always 'openapi'. Required. OPENAPI. @@ -12462,7 +12608,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.OPENAPI # type: ignore -class OpenApiToolboxTool(ToolboxTool, discriminator="openapi"): +class OpenApiToolboxTool( + ToolboxTool, discriminator="openapi" +): # pylint: disable=docstring-keyword-should-match-keyword-only """An OpenAPI tool stored in a toolbox. :ivar name: Optional user-defined name for this tool or configuration. @@ -12508,7 +12656,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolboxToolType.OPENAPI # type: ignore -class OptimizedAgentIdentifier(_Model): +class OptimizedAgentIdentifier(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Identifies the registered Foundry agent to optimize (request-only). Skills, tools, and system_prompt are specified in options.optimization_config. @@ -12542,7 +12690,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TelemetryEndpoint(_Model): +class TelemetryEndpoint(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A telemetry export endpoint configuration. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -12589,7 +12737,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OtlpTelemetryEndpoint(TelemetryEndpoint, discriminator="OTLP"): +class OtlpTelemetryEndpoint( + TelemetryEndpoint, discriminator="OTLP" +): # pylint: disable=docstring-keyword-should-match-keyword-only """An OTLP (OpenTelemetry Protocol) telemetry export endpoint. :ivar data: Data types to export to this endpoint. Use an empty array to export no data. @@ -12640,7 +12790,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = TelemetryEndpointKind.OTLP # type: ignore -class PendingUploadRequest(_Model): +class PendingUploadRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents a request for a pending upload. :ivar pending_upload_id: If PendingUploadId is not provided, a random GUID will be used. @@ -12687,7 +12837,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PendingUploadResponse(_Model): +class PendingUploadResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents the response for a pending upload request. :ivar blob_reference: Container-level read, write, list SAS. Required. @@ -12739,7 +12889,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PickPropertiesVoiceAudioConfig(_Model): +class PickPropertiesVoiceAudioConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The template for picking properties. :ivar output: Output (agent speech) audio configuration. @@ -12769,7 +12919,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ProceduralMemoryItem(MemoryItem, discriminator="procedural"): +class ProceduralMemoryItem( + MemoryItem, discriminator="procedural" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A memory item containing a procedure extracted from conversations. :ivar memory_id: The unique ID of the memory item. Required. @@ -12840,7 +12992,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.PROGRAMMATIC_TOOL_CALLING # type: ignore -class PromotionInfo(_Model): +class PromotionInfo(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Promotion metadata recorded when a candidate is deployed to a Foundry agent. :ivar promoted_at: Timestamp when promotion occurred, represented in Unix time. Required. @@ -12880,7 +13032,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PromptAgentDefinition(AgentDefinition, discriminator="prompt"): +class PromptAgentDefinition( + AgentDefinition, discriminator="prompt" +): # pylint: disable=docstring-keyword-should-match-keyword-only """The prompt agent definition. :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. @@ -12982,7 +13136,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = AgentKind.PROMPT # type: ignore -class PromptAgentDefinitionTextOptions(_Model): +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. @@ -13012,7 +13166,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PromptBasedEvaluatorDefinition(EvaluatorDefinition, discriminator="prompt"): +class PromptBasedEvaluatorDefinition( + EvaluatorDefinition, discriminator="prompt" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Prompt-based evaluator. :ivar init_parameters: The JSON schema (Draft 2020-12) for the evaluator's input parameters. @@ -13056,7 +13212,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = EvaluatorDefinitionType.PROMPT # type: ignore -class PromptDataGenerationJobSource(DataGenerationJobSource, discriminator="prompt"): +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 description: Optional description of what this source represents — helps the pipeline @@ -13097,7 +13255,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = DataGenerationJobSourceType.PROMPT # type: ignore -class PromptEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator="prompt"): +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 @@ -13141,7 +13301,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = EvaluatorGenerationJobSourceType.PROMPT # type: ignore -class ProtocolConfiguration(_Model): +class ProtocolConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Per-protocol configuration for the agent endpoint. :ivar activity: Configuration for the activity protocol. @@ -13206,7 +13366,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ProtocolVersionRecord(_Model): +class ProtocolVersionRecord(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A record mapping for a single protocol and its version. :ivar protocol: The protocol type. Required. Known values are: "activity", "responses", "a2a", @@ -13243,7 +13403,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RaiConfig(_Model): +class RaiConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Configuration for Responsible AI (RAI) content filtering and safety features. :ivar rai_policy_name: The name of the RAI policy to apply. Required. @@ -13271,7 +13431,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RankingOptions(_Model): +class RankingOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """RankingOptions. :ivar ranker: The ranker to use for the file search. Known values are: "auto" and @@ -13319,7 +13479,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeAudioFormats(_Model): +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: @@ -13351,7 +13511,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeAudioFormatsAudioPcm(RealtimeAudioFormats, discriminator="audio/pcm"): +class RealtimeAudioFormatsAudioPcm( + RealtimeAudioFormats, discriminator="audio/pcm" +): # pylint: disable=docstring-keyword-should-match-keyword-only """RealtimeAudioFormatsAudioPcm. :ivar type: Required. AUDIO_PCM. @@ -13438,7 +13600,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RealtimeAudioFormatsType.AUDIO_PCMU # type: ignore -class RealtimeConversationItem(_Model): +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: @@ -13474,7 +13636,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeConversationItemFunctionCall(RealtimeConversationItem, discriminator="function_call"): +class RealtimeConversationItemFunctionCall( + RealtimeConversationItem, discriminator="function_call" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Realtime function call item. :ivar id: The unique ID of the item. This may be provided by the client or generated by the @@ -13543,7 +13707,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class RealtimeConversationItemFunctionCallOutput( RealtimeConversationItem, discriminator="function_call_output" -): # pylint: disable=name-too-long +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """Realtime function call output item. :ivar id: The unique ID of the item. This may be provided by the client or generated by the @@ -13606,7 +13770,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RealtimeConversationItemType.FUNCTION_CALL_OUTPUT # type: ignore -class RealtimeConversationItemMessage(_Model): +class RealtimeConversationItemMessage(_Model): # 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: @@ -13639,7 +13803,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeConversationItemMessageAssistant(RealtimeConversationItemMessage, discriminator="assistant"): +class RealtimeConversationItemMessageAssistant( + RealtimeConversationItemMessage, discriminator="assistant" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Realtime assistant message item. :ivar id: The unique ID of the item. This may be provided by the client or generated by the @@ -13702,7 +13868,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["message"] = "message" -class RealtimeConversationItemMessageAssistantContent(_Model): # pylint: disable=name-too-long +class RealtimeConversationItemMessageAssistantContent( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """RealtimeConversationItemMessageAssistantContent. :ivar type: Is either a Literal["output_text"] type or a Literal["output_audio"] type. @@ -13744,7 +13912,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeConversationItemMessageSystem(RealtimeConversationItemMessage, discriminator="system"): +class RealtimeConversationItemMessageSystem( + RealtimeConversationItemMessage, discriminator="system" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Realtime system message item. :ivar id: The unique ID of the item. This may be provided by the client or generated by the @@ -13806,7 +13976,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["message"] = "message" -class RealtimeConversationItemMessageSystemContent(_Model): # pylint: disable=name-too-long +class RealtimeConversationItemMessageSystemContent( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """RealtimeConversationItemMessageSystemContent. :ivar type: Default value is "input_text". @@ -13838,7 +14010,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeConversationItemMessageUser(RealtimeConversationItemMessage, discriminator="user"): +class RealtimeConversationItemMessageUser( + RealtimeConversationItemMessage, discriminator="user" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Realtime user message item. :ivar id: The unique ID of the item. This may be provided by the client or generated by the @@ -13900,7 +14074,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["message"] = "message" -class RealtimeConversationItemMessageUserContent(_Model): # pylint: disable=name-too-long +class RealtimeConversationItemMessageUserContent( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """RealtimeConversationItemMessageUserContent. :ivar type: Is one of the following types: Literal["input_text"], Literal["input_audio"], @@ -13955,7 +14131,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeFunctionTool(_Model): +class RealtimeFunctionTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Function tool. :ivar type: The type of the tool, i.e. ``function``. Default value is "function". @@ -14006,7 +14182,9 @@ class RealtimeFunctionToolParameters(_Model): """RealtimeFunctionToolParameters.""" -class RealtimeMCPApprovalRequest(RealtimeConversationItem, discriminator="mcp_approval_request"): +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. @@ -14055,7 +14233,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RealtimeConversationItemType.MCP_APPROVAL_REQUEST # type: ignore -class RealtimeMCPApprovalResponse(RealtimeConversationItem, discriminator="mcp_approval_response"): +class RealtimeMCPApprovalResponse( + RealtimeConversationItem, discriminator="mcp_approval_response" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Realtime MCP approval response. :ivar type: The type of the item. Always ``mcp_approval_response``. Required. @@ -14103,7 +14283,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RealtimeConversationItemType.MCP_APPROVAL_RESPONSE # type: ignore -class RealtimeMCPError(_Model): +class RealtimeMCPError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """RealtimeMCPError. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -14136,7 +14316,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeMCPHTTPError(RealtimeMCPError, discriminator="http_error"): +class RealtimeMCPHTTPError( + RealtimeMCPError, discriminator="http_error" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Realtime MCP HTTP error. :ivar type: Required. HTTP_ERROR. @@ -14174,7 +14356,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RealtimeMcpErrorType.HTTP_ERROR # type: ignore -class RealtimeMCPListTools(RealtimeConversationItem, discriminator="mcp_list_tools"): +class RealtimeMCPListTools( + RealtimeConversationItem, discriminator="mcp_list_tools" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Realtime MCP list tools. :ivar type: The type of the item. Always ``mcp_list_tools``. Required. MCP_LIST_TOOLS. @@ -14217,7 +14401,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RealtimeConversationItemType.MCP_LIST_TOOLS # type: ignore -class RealtimeMCPProtocolError(RealtimeMCPError, discriminator="protocol_error"): +class RealtimeMCPProtocolError( + RealtimeMCPError, discriminator="protocol_error" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Realtime MCP protocol error. :ivar type: Required. PROTOCOL_ERROR. @@ -14255,7 +14441,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RealtimeMcpErrorType.PROTOCOL_ERROR # type: ignore -class RealtimeMCPToolCall(RealtimeConversationItem, discriminator="mcp_call"): +class RealtimeMCPToolCall( + RealtimeConversationItem, discriminator="mcp_call" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Realtime MCP tool call. :ivar type: The type of the item. Always ``mcp_call``. Required. MCP_CALL. @@ -14315,7 +14503,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RealtimeConversationItemType.MCP_CALL # type: ignore -class RealtimeMCPToolExecutionError(RealtimeMCPError, discriminator="tool_execution_error"): +class RealtimeMCPToolExecutionError( + RealtimeMCPError, discriminator="tool_execution_error" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Realtime MCP tool execution error. :ivar type: Required. TOOL_EXECUTION_ERROR. @@ -14348,7 +14538,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RealtimeMcpErrorType.TOOL_EXECUTION_ERROR # type: ignore -class RealtimeReasoning(_Model): +class RealtimeReasoning(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Realtime reasoning configuration. :ivar effort: Known values are: "minimal", "low", "medium", "high", and "xhigh". @@ -14378,7 +14568,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeResponseStatusDetails(_Model): +class RealtimeResponseStatusDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """RealtimeResponseStatusDetails. :ivar type: Is one of the following types: Literal["completed"], Literal["cancelled"], @@ -14425,7 +14615,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeResponseStatusDetailsError(_Model): +class RealtimeResponseStatusDetailsError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """RealtimeResponseStatusDetailsError. :ivar type: @@ -14456,7 +14646,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeResponseUsage(_Model): +class RealtimeResponseUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """RealtimeResponseUsage. :ivar total_tokens: @@ -14504,7 +14694,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeResponseUsageInputTokenDetails(_Model): +class RealtimeResponseUsageInputTokenDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """RealtimeResponseUsageInputTokenDetails. :ivar cached_tokens: @@ -14550,7 +14740,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeResponseUsageInputTokenDetailsCachedTokensDetails(_Model): # pylint: disable=name-too-long +class RealtimeResponseUsageInputTokenDetailsCachedTokensDetails( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """RealtimeResponseUsageInputTokenDetailsCachedTokensDetails. :ivar text_tokens: @@ -14585,7 +14777,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeResponseUsageOutputTokenDetails(_Model): +class RealtimeResponseUsageOutputTokenDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """RealtimeResponseUsageOutputTokenDetails. :ivar text_tokens: @@ -14616,7 +14808,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeServerEvent(_Model): +class RealtimeServerEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A realtime server event. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -14686,7 +14878,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeServerEventConversationItemInputAudioTranscriptionFailedError(_Model): # pylint: disable=name-too-long +class RealtimeServerEventConversationItemInputAudioTranscriptionFailedError( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """RealtimeServerEventConversationItemInputAudioTranscriptionFailedError. :ivar type: @@ -14725,7 +14919,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeServerEventError(_Model): +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. @@ -14767,7 +14961,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["error"] = "error" -class RealtimeServerEventErrorError(_Model): +class RealtimeServerEventErrorError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """RealtimeServerEventErrorError. :ivar type: Required. @@ -14812,7 +15006,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeServerEventRateLimitsUpdatedRateLimits(_Model): # pylint: disable=name-too-long +class RealtimeServerEventRateLimitsUpdatedRateLimits( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """RealtimeServerEventRateLimitsUpdatedRateLimits. :ivar name: Is either a Literal["requests"] type or a Literal["tokens"] type. @@ -14856,7 +15052,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class RealtimeServerEventResponseContentPartAdded( RealtimeServerEvent, discriminator="response.content_part.added" -): # pylint: disable=name-too-long +): # 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. @@ -14918,7 +15114,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED # type: ignore -class RealtimeServerEventResponseContentPartAddedPart(_Model): # pylint: disable=name-too-long +class RealtimeServerEventResponseContentPartAddedPart( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """RealtimeServerEventResponseContentPartAddedPart. :ivar type: Is either a Literal["audio"] type or a Literal["text"] type. @@ -14958,7 +15156,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Reasoning(_Model): +class Reasoning(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Reasoning. :ivar mode: Controls the reasoning execution mode for the request. When returned on a response, @@ -15022,7 +15220,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RecurrenceTrigger(Trigger, discriminator="Recurrence"): +class RecurrenceTrigger( + Trigger, discriminator="Recurrence" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Recurrence based trigger. :ivar type: Type of the trigger. Required. Recurrence based trigger. @@ -15079,7 +15279,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = TriggerType.RECURRENCE # type: ignore -class RedTeam(_Model): +class RedTeam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Red team details. :ivar name: Identifier of the red team run. Required. @@ -15171,7 +15371,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ReminderPreviewToolboxTool(ToolboxTool, discriminator="reminder_preview"): +class ReminderPreviewToolboxTool( + ToolboxTool, discriminator="reminder_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A reminder tool stored in a toolbox. :ivar name: Optional user-defined name for this tool or configuration. @@ -15214,7 +15416,7 @@ class ResponsesProtocolConfiguration(_Model): """Configuration specific to the responses protocol.""" -class ResponseUsageInputTokensDetails(_Model): +class ResponseUsageInputTokensDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """ResponseUsageInputTokensDetails. :ivar cached_tokens: Required. @@ -15247,7 +15449,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ResponseUsageOutputTokensDetails(_Model): +class ResponseUsageOutputTokensDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """ResponseUsageOutputTokensDetails. :ivar reasoning_tokens: Required. @@ -15275,7 +15477,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Routine(_Model): +class Routine(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A routine definition returned by the service. :ivar name: The routine name. @@ -15339,7 +15541,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RoutineRun(_Model): +class RoutineRun(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A single routine run returned from the run history API. :ivar id: The unique run identifier for the routine attempt. Required. @@ -15508,7 +15710,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RubricBasedEvaluatorDefinition(EvaluatorDefinition, discriminator="rubric"): +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. @@ -15575,7 +15779,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = EvaluatorDefinitionType.RUBRIC # type: ignore -class RubricGenerationInputQualityWarning(_Model): +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. @@ -15676,7 +15880,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = CredentialType.SAS # type: ignore -class Schedule(_Model): +class Schedule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Schedule model. :ivar schedule_id: Identifier of the schedule. Required. @@ -15754,7 +15958,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ScheduleRoutineTrigger(RoutineTrigger, discriminator="schedule"): +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. @@ -15794,7 +16000,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RoutineTriggerType.SCHEDULE # type: ignore -class ScheduleRun(_Model): +class ScheduleRun(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Schedule run model. :ivar run_id: Identifier of the schedule run. Required. @@ -15845,7 +16051,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SessionConfiguration(_Model): +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 @@ -15878,7 +16084,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SessionDirectoryEntry(_Model): +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. @@ -15923,7 +16129,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SessionFileWriteResult(_Model): +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. @@ -15957,7 +16163,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SessionLogEvent(_Model): +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`` @@ -16015,7 +16221,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SharepointGroundingToolParameters(_Model): +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 @@ -16047,7 +16253,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SharepointPreviewTool(Tool, discriminator="sharepoint_grounding_preview"): +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. @@ -16085,7 +16293,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.SHAREPOINT_GROUNDING_PREVIEW # type: ignore -class SimpleQnADataGenerationJobOptions(DataGenerationJobOptions, discriminator="simple_qna"): +class SimpleQnADataGenerationJobOptions( + DataGenerationJobOptions, discriminator="simple_qna" +): # pylint: disable=docstring-keyword-should-match-keyword-only """The options for a data generation job with SimpleQnA type. :ivar max_samples: Maximum number of samples to generate. Required. @@ -16132,8 +16342,10 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = DataGenerationJobType.SIMPLE_QNA # type: ignore -class SimulationSeedDataGenerationJobOptions(DataGenerationJobOptions, discriminator="simulation_seed"): - """The options for a simulation seed data generation job. Use with multiturn evaluation scenarios +class SimulationSeedDataGenerationJobOptions( + DataGenerationJobOptions, discriminator="simulation_seed" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The options 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``. @@ -16174,7 +16386,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = DataGenerationJobType.SIMULATION_SEED # type: ignore -class SkillDetails(_Model): +class SkillDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A skill resource. :ivar id: The unique identifier of the skill. Required. @@ -16230,7 +16442,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SkillInlineContent(_Model): +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. @@ -16287,7 +16499,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SkillReferenceParam(ContainerSkill, discriminator="skill_reference"): +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. @@ -16325,7 +16539,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ContainerSkillType.SKILL_REFERENCE # type: ignore -class SkillVersion(_Model): +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. @@ -16380,7 +16594,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ToolChoiceParam(_Model): +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. @@ -16505,7 +16719,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING # type: ignore -class StructuredInputDefinition(_Model): +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. @@ -16551,7 +16765,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class StructuredOutputDefinition(_Model): +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. @@ -16596,7 +16810,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TaxonomyCategory(_Model): +class TaxonomyCategory(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Taxonomy category definition. :ivar id: Unique identifier of the taxonomy category. Required. @@ -16659,7 +16873,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TaxonomySubCategory(_Model): +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. @@ -16707,7 +16921,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TelemetryConfig(_Model): +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. @@ -16737,7 +16951,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TemplateVoiceGreetingConfig(VoiceGreetingConfig, discriminator="template"): +class TemplateVoiceGreetingConfig( + VoiceGreetingConfig, discriminator="template" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A deterministic greeting rendered with the voice agent's structured inputs and synthesized without model-authored generation. @@ -16771,7 +16987,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = "template" # type: ignore -class TextResponseFormat(_Model): +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 `_. @@ -16837,7 +17053,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = TextResponseFormatConfigurationType.JSON_OBJECT # type: ignore -class TextResponseFormatJsonSchema(TextResponseFormat, discriminator="json_schema"): +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. @@ -16916,7 +17134,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = TextResponseFormatConfigurationType.TEXT # type: ignore -class TimerRoutineTrigger(RoutineTrigger, discriminator="timer"): +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. @@ -16951,7 +17171,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RoutineTriggerType.TIMER # type: ignore -class ToolboxObject(_Model): +class ToolboxObject(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A toolbox that stores reusable tool definitions for agents. :ivar id: The unique identifier of the toolbox. Required. @@ -16991,7 +17211,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ToolboxPolicies(_Model): +class ToolboxPolicies(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Policy configuration for a toolbox, including content safety and other governance settings. :ivar rai_config: Responsible AI content filtering configuration. @@ -17019,7 +17239,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ToolboxSearchPreviewToolboxTool(ToolboxTool, discriminator="toolbox_search_preview"): +class ToolboxSearchPreviewToolboxTool( + ToolboxTool, discriminator="toolbox_search_preview" +): # 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. @@ -17059,7 +17281,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolboxToolType.TOOLBOX_SEARCH_PREVIEW # type: ignore -class ToolboxSkill(_Model): +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: @@ -17091,7 +17313,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ToolboxSkillReference(ToolboxSkill, discriminator="skill_reference"): +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 skill source. Required. Default value is "skill_reference". @@ -17131,7 +17355,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = "skill_reference" # type: ignore -class ToolboxVersionObject(_Model): +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 @@ -17217,7 +17441,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ToolChoiceAllowed(ToolChoiceParam, discriminator="allowed_tools"): +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. @@ -17391,7 +17617,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolChoiceParamType.COMPUTER_USE_PREVIEW # type: ignore -class ToolChoiceCustom(ToolChoiceParam, discriminator="custom"): +class ToolChoiceCustom( + ToolChoiceParam, discriminator="custom" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Custom tool. :ivar type: For custom tool calling, the type is always ``custom``. Required. CUSTOM. @@ -17452,7 +17680,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolChoiceParamType.FILE_SEARCH # type: ignore -class ToolChoiceFunction(ToolChoiceParam, discriminator="function"): +class ToolChoiceFunction( + ToolChoiceParam, discriminator="function" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Function tool. :ivar type: For function calling, the type is always ``function``. Required. FUNCTION. @@ -17513,7 +17743,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolChoiceParamType.IMAGE_GENERATION # type: ignore -class ToolChoiceMCP(ToolChoiceParam, discriminator="mcp"): +class ToolChoiceMCP( + ToolChoiceParam, discriminator="mcp" +): # pylint: disable=docstring-keyword-should-match-keyword-only """MCP tool. :ivar type: For MCP tools, the type is always ``mcp``. Required. MCP. @@ -17606,7 +17838,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11 # type: ignore -class ToolConfig(_Model): +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 @@ -17645,7 +17877,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ToolDescription(_Model): +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. @@ -17678,7 +17910,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ToolProjectConnection(_Model): +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 @@ -17707,7 +17939,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ToolSearchToolboxTool(ToolboxTool, discriminator="toolbox_search"): +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. @@ -17746,7 +17980,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolboxToolType.TOOLBOX_SEARCH # type: ignore -class ToolSearchToolParam(Tool, discriminator="tool_search"): +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. @@ -17795,7 +18031,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ToolUseFineTuningDataGenerationJobOptions( DataGenerationJobOptions, discriminator="tool_use" -): # pylint: disable=name-too-long +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The options for a data generation job with ToolUse type. Used only for fine-tuning scenarios. :ivar max_samples: Maximum number of samples to generate. Required. @@ -17835,7 +18071,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = DataGenerationJobType.TOOL_USE # type: ignore -class TracesDataGenerationJobOptions(DataGenerationJobOptions, discriminator="traces"): +class TracesDataGenerationJobOptions( + DataGenerationJobOptions, discriminator="traces" +): # pylint: disable=docstring-keyword-should-match-keyword-only """The options for a data generation job with Traces type. :ivar max_samples: Maximum number of samples to generate. Required. @@ -17882,7 +18120,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = DataGenerationJobType.TRACES # type: ignore -class TracesDataGenerationJobSource(DataGenerationJobSource, discriminator="traces"): +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 description: Optional description of what this source represents — helps the pipeline @@ -17953,7 +18193,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = DataGenerationJobSourceType.TRACES # type: ignore -class TracesEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator="traces"): +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 description: Optional description of what this source represents — helps the pipeline @@ -18027,7 +18269,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = EvaluatorGenerationJobSourceType.TRACES # type: ignore -class TranscriptTextUsageDuration(CreateTranscriptionResponseJsonUsage, discriminator="duration"): +class TranscriptTextUsageDuration( + CreateTranscriptionResponseJsonUsage, discriminator="duration" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Duration Usage. :ivar type: The type of the usage object. Always ``duration`` for this variant. Required. @@ -18063,7 +18307,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = CreateTranscriptionResponseJsonUsageType.DURATION # type: ignore -class TranscriptTextUsageTokens(CreateTranscriptionResponseJsonUsage, discriminator="tokens"): +class TranscriptTextUsageTokens( + CreateTranscriptionResponseJsonUsage, discriminator="tokens" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Token Usage. :ivar type: The type of the usage object. Always ``tokens`` for this variant. Required. TOKENS. @@ -18114,7 +18360,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = CreateTranscriptionResponseJsonUsageType.TOKENS # type: ignore -class TranscriptTextUsageTokensInputTokenDetails(_Model): # pylint: disable=name-too-long +class TranscriptTextUsageTokensInputTokenDetails( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """TranscriptTextUsageTokensInputTokenDetails. :ivar text_tokens: @@ -18145,7 +18393,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class UpdateModelVersionRequest(_Model): +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. @@ -18178,7 +18426,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class UpdateToolboxRequest(_Model): +class UpdateToolboxRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """UpdateToolboxRequest. :ivar default_version: The version identifier that the toolbox should point to. When set, the @@ -18208,7 +18456,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class UserProfileMemoryItem(MemoryItem, discriminator="user_profile"): +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. @@ -18251,7 +18501,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = MemoryItemKind.USER_PROFILE # type: ignore -class VersionIndicator(_Model): +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: @@ -18283,7 +18533,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VersionRefIndicator(VersionIndicator, discriminator="version_ref"): +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 type: Discriminator value for version_ref. Required. Direct reference to a specific agent @@ -18317,7 +18569,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = VersionIndicatorType.VERSION_REF # type: ignore -class VersionSelector(_Model): +class VersionSelector(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """VersionSelector. :ivar version_selection_rules: Required. @@ -18347,7 +18599,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentAnimationConfig(_Model): +class VoiceAgentAnimationConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Animation settings for a voice-agent session. :ivar model_name: The animation model name. @@ -18382,7 +18634,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentAvatarIceServer(_Model): +class VoiceAgentAvatarIceServer(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """An ICE server used for avatar WebRTC negotiation. :ivar urls: Required. @@ -18418,7 +18670,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentAvatarScene(_Model): +class VoiceAgentAvatarScene(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Avatar placement and motion settings. :ivar zoom: @@ -18469,7 +18721,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentAvatarVideoBackground(_Model): +class VoiceAgentAvatarVideoBackground(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The avatar video background. :ivar image_url: @@ -18500,7 +18752,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentAvatarVideoCrop(_Model): +class VoiceAgentAvatarVideoCrop(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The rectangular crop applied to avatar video. :ivar bottom_right: Required. @@ -18533,7 +18785,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentAvatarVideoParams(_Model): +class VoiceAgentAvatarVideoParams(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Avatar video encoder and presentation settings. :ivar bitrate: @@ -18582,7 +18834,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentAvatarVideoResolution(_Model): +class VoiceAgentAvatarVideoResolution(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The avatar video resolution. :ivar width: Required. @@ -18615,7 +18867,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentClientEventConversationItemCreate(_Model): # pylint: disable=name-too-long +class VoiceAgentClientEventConversationItemCreate( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``conversation.item.create`` client event. :ivar event_id: Optional client-generated ID used to identify this event. @@ -18682,7 +18936,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentClientEventConversationItemDelete(_Model): # pylint: disable=name-too-long +class VoiceAgentClientEventConversationItemDelete( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``conversation.item.delete`` client event. :ivar event_id: Optional client-generated ID used to identify this event. @@ -18723,7 +18979,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentClientEventConversationItemRetrieve(_Model): # pylint: disable=name-too-long +class VoiceAgentClientEventConversationItemRetrieve( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``conversation.item.retrieve`` client event. :ivar event_id: Optional client-generated ID used to identify this event. @@ -18764,7 +19022,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentClientEventConversationItemTruncate(_Model): # pylint: disable=name-too-long +class VoiceAgentClientEventConversationItemTruncate( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``conversation.item.truncate`` client event. :ivar event_id: Optional client-generated ID used to identify this event. @@ -18820,7 +19080,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentClientEventInputAudioBufferAppend(_Model): # pylint: disable=name-too-long +class VoiceAgentClientEventInputAudioBufferAppend( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``input_audio_buffer.append`` client event. :ivar event_id: Optional client-generated ID used to identify this event. @@ -18863,7 +19125,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentClientEventInputAudioBufferClear(_Model): # pylint: disable=name-too-long +class VoiceAgentClientEventInputAudioBufferClear( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``input_audio_buffer.clear`` client event. :ivar event_id: Optional client-generated ID used to identify this event. @@ -18899,7 +19163,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentClientEventInputAudioBufferCommit(_Model): # pylint: disable=name-too-long +class VoiceAgentClientEventInputAudioBufferCommit( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``input_audio_buffer.commit`` client event. :ivar event_id: Optional client-generated ID used to identify this event. @@ -18935,7 +19201,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentClientEventOutputAudioBufferClear(_Model): # pylint: disable=name-too-long +class VoiceAgentClientEventOutputAudioBufferClear( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``output_audio_buffer.clear`` client event. :ivar event_id: The unique ID of the client event used for error handling. @@ -18971,7 +19239,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentClientEventResponseCancel(_Model): +class VoiceAgentClientEventResponseCancel(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The ``response.cancel`` client event. :ivar event_id: Optional client-generated ID used to identify this event. @@ -19013,7 +19281,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentClientEventResponseCreate(_Model): +class VoiceAgentClientEventResponseCreate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The ``response.create`` client event. :ivar event_id: Optional client-generated ID used to identify this event. @@ -19055,7 +19323,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentClientEventSessionAvatarConnect(_Model): # pylint: disable=name-too-long +class VoiceAgentClientEventSessionAvatarConnect( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``session.avatar.connect`` client event. :ivar type: The event type. Always ``session.avatar.connect``. Required. Default value is @@ -19095,7 +19365,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["session.avatar.connect"] = "session.avatar.connect" -class VoiceAgentClientEventSessionUpdate(_Model): +class VoiceAgentClientEventSessionUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The ``session.update`` client event. :ivar event_id: Optional client-generated ID used to identify this event. This is an arbitrary @@ -19141,7 +19411,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentDefinition(AgentDefinition, discriminator="voice"): +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 @@ -19332,7 +19604,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = AgentKind.VOICE # type: ignore -class VoiceAgentEchoCancellation(_Model): +class VoiceAgentEchoCancellation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Server-side echo cancellation settings for input audio. :ivar type: The echo cancellation implementation. Always ``server_echo_cancellation``. @@ -19379,7 +19651,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["server_echo_cancellation"] = "server_echo_cancellation" -class VoiceAgentTool(_Model): +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: @@ -19411,7 +19683,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentFunctionTool(VoiceAgentTool, discriminator="function"): +class VoiceAgentFunctionTool( + VoiceAgentTool, discriminator="function" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A native function tool executed by the client. :ivar description: The description of the function, including guidance on when and how to call @@ -19458,7 +19732,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = "function" # type: ignore -class VoiceAgentInterimResponseConfig(_Model): +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: @@ -19504,7 +19778,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentLlmInterimResponseConfig(VoiceAgentInterimResponseConfig, discriminator="llm_interim_response"): +class VoiceAgentLlmInterimResponseConfig( + VoiceAgentInterimResponseConfig, discriminator="llm_interim_response" +): # pylint: disable=docstring-keyword-should-match-keyword-only """An interim response generated by a language model. :ivar triggers: Conditions that may trigger one interim response. @@ -19553,7 +19829,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = "llm_interim_response" # type: ignore -class VoiceAgentMcpTool(VoiceAgentTool, discriminator="mcp"): +class VoiceAgentMcpTool( + VoiceAgentTool, discriminator="mcp" +): # pylint: disable=docstring-keyword-should-match-keyword-only """An MCP tool available to a voice agent. :ivar server_label: A label for this MCP server, used to identify it in tool calls. Required. @@ -19660,7 +19938,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = "mcp" # type: ignore -class VoiceAgentRealtimeResponse(OmitPropertiesRealtimeResponse1): +class VoiceAgentRealtimeResponse( + OmitPropertiesRealtimeResponse1 +): # pylint: disable=docstring-keyword-should-match-keyword-only """A live realtime response returned by the voice-agent service in both ``response.created`` and ``response.done`` events. @@ -19748,7 +20028,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentResponseCreateParams(_Model): +class VoiceAgentResponseCreateParams(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Parameters accepted by a voice-agent ``response.create`` event. :ivar instructions: The default system instructions (i.e. system message) prepended to model @@ -19903,7 +20183,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentResponseEventContentPart(_Model): +class VoiceAgentResponseEventContentPart(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A content part carried by a ``response.content_part.*`` server event. :ivar type: Is either a Literal["audio"] type or a Literal["text"] type. @@ -19950,7 +20230,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceTurnDetection(_Model): +class VoiceTurnDetection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Turn-detection configuration for a voice agent. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -19993,7 +20273,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentSemanticVadTurnDetection(VoiceTurnDetection, discriminator="semantic_vad"): +class VoiceAgentSemanticVadTurnDetection( + VoiceTurnDetection, discriminator="semantic_vad" +): # pylint: disable=docstring-keyword-should-match-keyword-only """OpenAI semantic VAD turn-detection settings. :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech @@ -20042,7 +20324,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = VoiceTurnDetectionType.SEMANTIC_VAD # type: ignore -class VoiceAgentServerEventConversationItemAdded(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventConversationItemAdded( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``conversation.item.added`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -20100,7 +20384,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventConversationItemCreated(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventConversationItemCreated( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``conversation.item.created`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -20158,7 +20444,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventConversationItemDeleted(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventConversationItemDeleted( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``conversation.item.deleted`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -20199,7 +20487,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventConversationItemDone(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventConversationItemDone( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``conversation.item.done`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -20257,7 +20547,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``conversation.item.input_audio_transcription.completed`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -20335,7 +20627,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``conversation.item.input_audio_transcription.delta`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -20394,7 +20688,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``conversation.item.input_audio_transcription.failed`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -20450,7 +20746,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``conversation.item.input_audio_transcription.segment`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -20523,7 +20821,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventConversationItemRetrieved(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventConversationItemRetrieved( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``conversation.item.retrieved`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -20577,7 +20877,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventConversationItemTruncated(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventConversationItemTruncated( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``conversation.item.truncated`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -20636,7 +20938,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventInputAudioBufferCleared(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventInputAudioBufferCleared( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``input_audio_buffer.cleared`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -20672,7 +20976,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventInputAudioBufferCommitted(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventInputAudioBufferCommitted( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``input_audio_buffer.committed`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -20718,7 +21024,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventInputAudioBufferSpeechStarted(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventInputAudioBufferSpeechStarted( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``input_audio_buffer.speech_started`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -20770,7 +21078,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventInputAudioBufferSpeechStopped(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventInputAudioBufferSpeechStopped( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``input_audio_buffer.speech_stopped`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -20821,7 +21131,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventInputAudioBufferTimeoutTriggered(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventInputAudioBufferTimeoutTriggered( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``input_audio_buffer.timeout_triggered`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -20877,7 +21189,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventMcpListToolsCompleted(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventMcpListToolsCompleted( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``mcp_list_tools.completed`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -20918,7 +21232,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventMcpListToolsFailed(_Model): +class VoiceAgentServerEventMcpListToolsFailed(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The ``mcp_list_tools.failed`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -20958,7 +21272,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventMcpListToolsInProgress(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventMcpListToolsInProgress( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``mcp_list_tools.in_progress`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -20999,7 +21315,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventOutputAudioBufferCleared(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventOutputAudioBufferCleared( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``output_audio_buffer.cleared`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -21040,7 +21358,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventRateLimitsUpdated(_Model): +class VoiceAgentServerEventRateLimitsUpdated(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The ``rate_limits.updated`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -21083,7 +21401,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventResponseAnimationBlendshapesDelta(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventResponseAnimationBlendshapesDelta( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``response.animation_blendshapes.delta`` server event. :ivar type: Required. Default value is "response.animation_blendshapes.delta". @@ -21148,7 +21468,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["response.animation_blendshapes.delta"] = "response.animation_blendshapes.delta" -class VoiceAgentServerEventResponseAnimationBlendshapesDone(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventResponseAnimationBlendshapesDone( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``response.animation_blendshapes.done`` server event. :ivar type: Required. Default value is "response.animation_blendshapes.done". @@ -21198,7 +21520,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["response.animation_blendshapes.done"] = "response.animation_blendshapes.done" -class VoiceAgentServerEventResponseAnimationVisemeDelta(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventResponseAnimationVisemeDelta( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``response.animation_viseme.delta`` server event. :ivar type: Required. Default value is "response.animation_viseme.delta". @@ -21265,7 +21589,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["response.animation_viseme.delta"] = "response.animation_viseme.delta" -class VoiceAgentServerEventResponseAnimationVisemeDone(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventResponseAnimationVisemeDone( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``response.animation_viseme.done`` server event. :ivar type: Required. Default value is "response.animation_viseme.done". @@ -21320,7 +21646,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["response.animation_viseme.done"] = "response.animation_viseme.done" -class VoiceAgentServerEventResponseAudioDelta(_Model): +class VoiceAgentServerEventResponseAudioDelta(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The ``response.output_audio.delta`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -21337,7 +21663,7 @@ class VoiceAgentServerEventResponseAudioDelta(_Model): :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: str + :vartype delta: bytes """ event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -21354,7 +21680,7 @@ class VoiceAgentServerEventResponseAudioDelta(_Model): """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"]) + delta: bytes = rest_field(visibility=["read", "create", "update", "delete", "query"], format="base64") """Base64-encoded audio data delta. Required.""" @overload @@ -21367,7 +21693,7 @@ def __init__( item_id: str, output_index: int, content_index: int, - delta: str, + delta: bytes, ) -> None: ... @overload @@ -21381,7 +21707,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventResponseAudioDone(_Model): +class VoiceAgentServerEventResponseAudioDone(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The ``response.output_audio.done`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -21437,7 +21763,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventResponseAudioTimestampDelta(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventResponseAudioTimestampDelta( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``response.audio_timestamp.delta`` server event. :ivar type: Required. Default value is "response.audio_timestamp.delta". @@ -21516,7 +21844,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.timestamp_type: Literal["word"] = "word" -class VoiceAgentServerEventResponseAudioTimestampDone(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventResponseAudioTimestampDone( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``response.audio_timestamp.done`` server event. :ivar type: Required. Default value is "response.audio_timestamp.done". @@ -21571,7 +21901,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["response.audio_timestamp.done"] = "response.audio_timestamp.done" -class VoiceAgentServerEventResponseAudioTranscriptDelta(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventResponseAudioTranscriptDelta( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``response.output_audio_transcript.delta`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -21633,7 +21965,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventResponseAudioTranscriptDone(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventResponseAudioTranscriptDone( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``response.output_audio_transcript.done`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -21695,7 +22029,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventResponseContentPartDone(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventResponseContentPartDone( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``response.content_part.done`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -21758,7 +22094,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventResponseCreated(_Model): +class VoiceAgentServerEventResponseCreated(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The ``response.created`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -21800,7 +22136,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventResponseDone(_Model): +class VoiceAgentServerEventResponseDone(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The ``response.done`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -21842,7 +22178,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventResponseFunctionCallArgumentsDelta(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventResponseFunctionCallArgumentsDelta( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``response.function_call_arguments.delta`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -21904,7 +22242,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventResponseFunctionCallArgumentsDone(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventResponseFunctionCallArgumentsDone( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``response.function_call_arguments.done`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -21971,7 +22311,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventResponseMcpCallArgumentsDelta(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventResponseMcpCallArgumentsDelta( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``response.mcp_call_arguments.delta`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -22032,7 +22374,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventResponseMcpCallArgumentsDone(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventResponseMcpCallArgumentsDone( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``response.mcp_call_arguments.done`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -22089,7 +22433,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventResponseMcpCallCompleted(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventResponseMcpCallCompleted( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``response.mcp_call.completed`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -22135,7 +22481,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventResponseMcpCallFailed(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventResponseMcpCallFailed( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``response.mcp_call.failed`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -22181,7 +22529,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventResponseMcpCallInProgress(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventResponseMcpCallInProgress( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``response.mcp_call.in_progress`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -22228,7 +22578,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventResponseOutputItemAdded(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventResponseOutputItemAdded( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``response.output_item.added`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -22292,7 +22644,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventResponseOutputItemDone(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventResponseOutputItemDone( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``response.output_item.done`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -22356,7 +22710,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventResponseTextDelta(_Model): +class VoiceAgentServerEventResponseTextDelta(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The ``response.output_text.delta`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -22417,7 +22771,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventResponseTextDone(_Model): +class VoiceAgentServerEventResponseTextDone(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The ``response.output_text.done`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -22478,7 +22832,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventResponseVideoDelta(_Model): +class VoiceAgentServerEventResponseVideoDelta(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The ``response.video.delta`` server event. :ivar type: Required. Default value is "response.video.delta". @@ -22526,7 +22880,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["response.video.delta"] = "response.video.delta" -class VoiceAgentServerEventSessionAvatarConnecting(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventSessionAvatarConnecting( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``session.avatar.connecting`` server event. :ivar type: Required. Default value is "session.avatar.connecting". @@ -22564,7 +22920,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["session.avatar.connecting"] = "session.avatar.connecting" -class VoiceAgentServerEventSessionAvatarSwitchToIdle(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventSessionAvatarSwitchToIdle( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``session.avatar.switch_to_idle`` server event. :ivar type: Required. Default value is "session.avatar.switch_to_idle". @@ -22603,7 +22961,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["session.avatar.switch_to_idle"] = "session.avatar.switch_to_idle" -class VoiceAgentServerEventSessionAvatarSwitchToSpeaking(_Model): # pylint: disable=name-too-long +class VoiceAgentServerEventSessionAvatarSwitchToSpeaking( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The ``session.avatar.switch_to_speaking`` server event. :ivar type: Required. Default value is "session.avatar.switch_to_speaking". @@ -22642,7 +23002,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["session.avatar.switch_to_speaking"] = "session.avatar.switch_to_speaking" -class VoiceAgentServerEventSessionCreated(_Model): +class VoiceAgentServerEventSessionCreated(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The ``session.created`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -22691,7 +23051,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventSessionUpdated(_Model): +class VoiceAgentServerEventSessionUpdated(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The ``session.updated`` server event. :ivar event_id: The unique ID of the server event. Required. @@ -22733,7 +23093,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventWarning(_Model): +class VoiceAgentServerEventWarning(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The ``warning`` server event. :ivar type: Required. Default value is "warning". @@ -22773,7 +23133,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["warning"] = "warning" -class VoiceAgentServerEventWarningDetails(_Model): +class VoiceAgentServerEventWarningDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Details of a non-fatal warning. :ivar message: Required. @@ -22809,7 +23169,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAvatarConfig(_Model): +class VoiceAvatarConfig(_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. @@ -22886,7 +23246,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentSessionAvatarConfig(VoiceAvatarConfig): +class VoiceAgentSessionAvatarConfig(VoiceAvatarConfig): # pylint: disable=docstring-keyword-should-match-keyword-only """Avatar settings accepted by the stable voice-agent WebSocket contract. :ivar type: The avatar type. Required. Known values are: "video_avatar" and "photo_avatar". @@ -22943,7 +23303,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentSessionResponseConfig(_Model): +class VoiceAgentSessionResponseConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The effective stable realtime session settings returned by the voice-agent service. :ivar type: The session type. Always ``realtime``. Required. Default value is "realtime". @@ -23097,7 +23457,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.object: Literal["realtime.session"] = "realtime.session" -class VoiceAgentSessionUpdateConfig(_Model): +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". @@ -23228,7 +23588,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["realtime"] = "realtime" -class VoiceAgentStaticInterimResponseConfig(VoiceAgentInterimResponseConfig, discriminator="static_interim_response"): +class VoiceAgentStaticInterimResponseConfig( + VoiceAgentInterimResponseConfig, discriminator="static_interim_response" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A static interim response selected from configured text. :ivar triggers: Conditions that may trigger one interim response. @@ -23267,7 +23629,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = "static_interim_response" # type: ignore -class VoiceAgentTranscriptionPhrase(_Model): +class VoiceAgentTranscriptionPhrase(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A transcribed phrase with timing information. :ivar offset_milliseconds: The phrase offset from the beginning of the audio, in milliseconds. @@ -23327,7 +23689,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentTranscriptionWord(_Model): +class VoiceAgentTranscriptionWord(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A time-stamped word in an input-audio transcription. :ivar text: The transcribed word text. Required. @@ -23370,7 +23732,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAssistantMessageItem(RealtimeConversationItemMessageAssistant): +class VoiceAssistantMessageItem( + RealtimeConversationItemMessageAssistant +): # pylint: disable=docstring-keyword-should-match-keyword-only """An assistant message item. Only ``output_text`` and ``output_audio`` content are valid for assistant messages. @@ -23422,7 +23786,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAudioConfig(_Model): +class VoiceAudioConfig(_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. @@ -23460,7 +23824,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAudioFormat(_Model): +class VoiceAudioFormat(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """An audio format. Follows the OpenAI Realtime session schema; ``type`` carries the media subtype. @@ -23502,7 +23866,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAudioInputConfig(_Model): +class VoiceAudioInputConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Input audio configuration for a voice agent. :ivar format: The input audio format. @@ -23573,7 +23937,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAudioOutputConfig(_Model): +class VoiceAudioOutputConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Output audio configuration for a voice agent. Provider-specific fields are selected by ``voice_type``: @@ -23721,7 +24085,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAzureSemanticVadEnTurnDetection(VoiceTurnDetection, discriminator="azure_semantic_vad_en"): +class VoiceAzureSemanticVadEnTurnDetection( + VoiceTurnDetection, discriminator="azure_semantic_vad_en" +): # pylint: disable=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 @@ -23812,7 +24178,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class VoiceAzureSemanticVadMultilingualTurnDetection( VoiceTurnDetection, discriminator="azure_semantic_vad_multilingual" -): # pylint: disable=name-too-long +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """Multilingual Azure semantic voice activity detection. :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech @@ -23906,7 +24272,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL # type: ignore -class VoiceAzureSemanticVadTurnDetection(VoiceTurnDetection, discriminator="azure_semantic_vad"): +class VoiceAzureSemanticVadTurnDetection( + VoiceTurnDetection, 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 @@ -24000,7 +24368,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = VoiceTurnDetectionType.AZURE_SEMANTIC_VAD # type: ignore -class VoiceConversation(_Model): +class VoiceConversation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A persisted voice conversation. The Foundry envelope that owns a voice agent's stored transcript, responses, per-turn metrics, and audio. It is the parent, retention, and delete boundary: deleting it cascades to its responses, items, metrics, and audio. When finalization @@ -24089,7 +24457,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.object: Literal["voice.conversation"] = "voice.conversation" -class VoiceEndOfUtteranceDetection(_Model): +class VoiceEndOfUtteranceDetection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Semantic end-of-utterance detection configuration. :ivar model: The semantic detection model. Required. Known values are: "semantic_detection_v1", @@ -24138,7 +24506,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceFunctionCallItem(RealtimeConversationItemFunctionCall): +class VoiceFunctionCallItem( + RealtimeConversationItemFunctionCall +): # pylint: disable=docstring-keyword-should-match-keyword-only """A function call request item. :ivar id: The unique ID of the item. This may be provided by the client or generated by the @@ -24193,7 +24563,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceFunctionCallOutputItem(RealtimeConversationItemFunctionCallOutput): +class VoiceFunctionCallOutputItem( + RealtimeConversationItemFunctionCallOutput +): # pylint: disable=docstring-keyword-should-match-keyword-only """A function call output item. :ivar id: The unique ID of the item. This may be provided by the client or generated by the @@ -24253,7 +24625,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceInputTranscription(_Model): +class VoiceInputTranscription(_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. @@ -24335,7 +24707,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceItemAudioResponse(_Model): +class VoiceItemAudioResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Metadata for a single conversation item's audio segment. For bring-your-own-storage (BYOS), the response includes ``blob_uri``, a direct customer-storage URI without a SAS token, that the customer accesses with their own credentials. For Foundry-managed storage, ``blob_uri`` is @@ -24427,7 +24799,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceMcpApprovalRequestItem(RealtimeMCPApprovalRequest): +class VoiceMcpApprovalRequestItem( + RealtimeMCPApprovalRequest +): # pylint: disable=docstring-keyword-should-match-keyword-only """An MCP approval request item. :ivar type: The type of the item. Always ``mcp_approval_request``. Required. @@ -24473,7 +24847,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceMcpApprovalResponseItem(RealtimeMCPApprovalResponse): +class VoiceMcpApprovalResponseItem( + RealtimeMCPApprovalResponse +): # pylint: disable=docstring-keyword-should-match-keyword-only """An MCP approval response item (client-created). :ivar type: The type of the item. Always ``mcp_approval_response``. Required. @@ -24519,7 +24895,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceMcpCallItem(RealtimeMCPToolCall): +class VoiceMcpCallItem(RealtimeMCPToolCall): # pylint: disable=docstring-keyword-should-match-keyword-only """An MCP call item. :ivar type: The type of the item. Always ``mcp_call``. Required. MCP_CALL. @@ -24573,7 +24949,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceMcpListToolsItem(RealtimeMCPListTools): +class VoiceMcpListToolsItem(RealtimeMCPListTools): # pylint: disable=docstring-keyword-should-match-keyword-only """An MCP list-tools item. :ivar type: The type of the item. Always ``mcp_list_tools``. Required. MCP_LIST_TOOLS. @@ -24615,7 +24991,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceNoiseReduction(_Model): +class VoiceNoiseReduction(_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", @@ -24647,7 +25023,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceRecordingChannelLayout(_Model): +class VoiceRecordingChannelLayout(_Model): # pylint: disable=docstring-missing-param """The role assigned to each channel of a merged stereo voice recording. :ivar left: The role carried on the left channel. Always ``user``. Required. Default value is @@ -24669,7 +25045,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.right: Literal["agent"] = "agent" -class VoiceRecordingResponse(_Model): +class VoiceRecordingResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Metadata for the merged, whole-call stereo recording of a voice conversation (user audio on the left channel, agent audio on the right). Built once from the per-turn segments after the session ends and durably cached. The common metadata (format, sample rate, channels, channel @@ -24746,7 +25122,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceResponse(OmitPropertiesRealtimeResponse): +class VoiceResponse(OmitPropertiesRealtimeResponse): # pylint: disable=docstring-keyword-should-match-keyword-only """A persisted voice response representing one model inference turn within a conversation. In list results the ``output`` projection may be omitted; retrieve the full response (``GET .../responses/{response_id}``) or the paged response-items route (``GET @@ -24766,10 +25142,6 @@ class VoiceResponse(OmitPropertiesRealtimeResponse): session will maintain a conversation context and append new Items to the Conversation, thus output from previous turns (text and audio tokens) will become the input for later turns. :vartype usage: ~azure.ai.projects.models.RealtimeResponseUsage - :ivar output_modalities: The set of modalities the model used to respond, currently the only - possible values are ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text - transcript. Setting the output to mode ``text`` will disable audio output from the model. - :vartype output_modalities: list[str or str] :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, inclusive of tool calls, that was used in this response. Is either a int type or a Literal["inf"] type. @@ -24795,6 +25167,9 @@ class VoiceResponse(OmitPropertiesRealtimeResponse): :vartype audio: ~azure.ai.projects.models.VoiceResponseAudio :ivar metadata: A set of key-value pairs attached to the response. :vartype metadata: dict[str, str] + :ivar output_modalities: The output modalities used for the response, e.g. ``["text", + "audio"]``. Audio output always includes a text transcript. + :vartype output_modalities: list[str or str] :ivar temperature: The sampling temperature used for the response. :vartype temperature: float :ivar created_at: The Unix timestamp (in seconds) for when the response was created. @@ -24842,11 +25217,11 @@ def __init__( status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] = None, status_details: Optional["_models.RealtimeResponseStatusDetails"] = None, usage: Optional["_models.RealtimeResponseUsage"] = None, - output_modalities: Optional[list[Literal["text", "audio"]]] = None, max_output_tokens: Optional[Union[int, Literal["inf"]]] = None, output: Optional[list["_unions.VoiceConversationItem"]] = None, audio: Optional["_models.VoiceResponseAudio"] = None, metadata: Optional[dict[str, str]] = None, + output_modalities: Optional[list[Literal["text", "audio"]]] = None, temperature: Optional[float] = None, created_at: Optional[datetime.datetime] = None, completed_at: Optional[datetime.datetime] = None, @@ -24863,7 +25238,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceResponseAudio(_Model): +class VoiceResponseAudio(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Audio configuration for a response. Follows the OpenAI Realtime GA ``audio`` object shape. :ivar output: The audio output configuration used for the response. @@ -24893,7 +25268,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceResponseAudioOutput(_Model): +class VoiceResponseAudioOutput(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The flat response audio-output projection, with optional ``voice``, ``voice_type``, ``voice_locale``, and ``format`` fields. @@ -24945,7 +25320,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceServerVadTurnDetection(VoiceTurnDetection, discriminator="server_vad"): +class VoiceServerVadTurnDetection( + VoiceTurnDetection, discriminator="server_vad" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Server-side voice activity detection. :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech @@ -25017,7 +25394,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = VoiceTurnDetectionType.SERVER_VAD # type: ignore -class VoiceSystemMessageItem(RealtimeConversationItemMessageSystem): +class VoiceSystemMessageItem( + RealtimeConversationItemMessageSystem +): # pylint: disable=docstring-keyword-should-match-keyword-only """A system message item. Only ``input_text`` content is valid for system messages. :ivar id: The unique ID of the item. This may be provided by the client or generated by the @@ -25067,7 +25446,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceSystemTool(VoiceAgentTool, discriminator="system"): +class VoiceSystemTool( + 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. @@ -25110,7 +25491,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = "system" # type: ignore -class VoiceToolboxTool(VoiceAgentTool, discriminator="toolbox"): +class VoiceToolboxTool( + VoiceAgentTool, discriminator="toolbox" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A reference to a Foundry toolbox, which is a versioned bundle of tools executed through its MCP endpoint. @@ -25158,7 +25541,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = "toolbox" # type: ignore -class VoiceUserMessageItem(RealtimeConversationItemMessageUser): +class VoiceUserMessageItem( + RealtimeConversationItemMessageUser +): # pylint: disable=docstring-keyword-should-match-keyword-only """A user message item. ``input_text``, ``input_audio``, and ``input_image`` content are valid for user messages. @@ -25209,7 +25594,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class WebIQPreviewTool(Tool, discriminator="web_iq_preview"): +class WebIQPreviewTool( + Tool, discriminator="web_iq_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A WebIQ server-side tool. :ivar type: The object type, which is always 'web_iq_preview'. Required. WEB_IQ_PREVIEW. @@ -25259,7 +25646,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.WEB_IQ_PREVIEW # type: ignore -class WebIQPreviewToolboxTool(ToolboxTool, discriminator="web_iq_preview"): +class WebIQPreviewToolboxTool( + ToolboxTool, discriminator="web_iq_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A WebIQ tool stored in a toolbox. :ivar name: Optional user-defined name for this tool or configuration. @@ -25320,7 +25709,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolboxToolType.WEB_IQ_PREVIEW # type: ignore -class WebSearchApproximateLocation(_Model): +class WebSearchApproximateLocation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Web search approximate location. :ivar type: The type of location approximation. Always ``approximate``. Required. Default value @@ -25366,7 +25755,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["approximate"] = "approximate" -class WebSearchConfiguration(_Model): +class WebSearchConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A web search configuration for bing custom search. :ivar project_connection_id: Project connection id for grounding with bing custom search. @@ -25400,7 +25789,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class WebSearchPreviewTool(Tool, discriminator="web_search_preview"): +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 @@ -25453,7 +25844,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.WEB_SEARCH_PREVIEW # type: ignore -class WebSearchTool(Tool, discriminator="web_search"): +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 @@ -25534,7 +25925,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.WEB_SEARCH # type: ignore -class WebSearchToolboxTool(ToolboxTool, discriminator="web_search"): +class WebSearchToolboxTool( + ToolboxTool, discriminator="web_search" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A web search tool stored in a toolbox. :ivar name: Optional user-defined name for this tool or configuration. @@ -25605,7 +25998,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolboxToolType.WEB_SEARCH # type: ignore -class WebSearchToolFilters(_Model): +class WebSearchToolFilters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """WebSearchToolFilters. :ivar allowed_domains: @@ -25632,7 +26025,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class WeeklyRecurrenceSchedule(RecurrenceSchedule, discriminator="Weekly"): +class WeeklyRecurrenceSchedule( + RecurrenceSchedule, discriminator="Weekly" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Weekly recurrence schedule. :ivar type: Weekly recurrence type. Required. Weekly recurrence pattern. @@ -25667,7 +26062,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RecurrenceType.WEEKLY # type: ignore -class WorkflowAgentDefinition(AgentDefinition, discriminator="workflow"): +class WorkflowAgentDefinition( + AgentDefinition, discriminator="workflow" +): # pylint: disable=docstring-keyword-should-match-keyword-only """The workflow agent definition. Microsoft Foundry is retiring workflows on December 1, 2026. If you're looking to build new workflows, use Microsoft Agent Framework. To migrate existing workflows, see the `Migration guide @@ -25706,7 +26103,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = AgentKind.WORKFLOW # type: ignore -class WorkIQPreviewTool(Tool, discriminator="work_iq_preview"): +class WorkIQPreviewTool( + Tool, discriminator="work_iq_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A WorkIQ server-side tool. :ivar type: The object type, which is always 'work_iq_preview'. Required. WORK_IQ_PREVIEW. @@ -25739,7 +26138,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.WORK_IQ_PREVIEW # type: ignore -class WorkIQPreviewToolboxTool(ToolboxTool, discriminator="work_iq_preview"): +class WorkIQPreviewToolboxTool( + ToolboxTool, discriminator="work_iq_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A WorkIQ tool stored in a toolbox. :ivar name: Optional user-defined name for this tool or configuration. 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 1200fab3b0e5..9d59bcade406 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 @@ -33,11 +33,12 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from .. import models as _models, types as _types +from .. import models as _models from .._configuration import AIProjectClientConfiguration from .._utils.model_base import Model as _Model, SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._utils.serialization import Deserializer, Serializer from .._utils.utils import prepare_multipart_form_data +from ..models._enums import _AgentDefinitionOptInKeys if TYPE_CHECKING: from .. import _unions @@ -595,7 +596,7 @@ def build_agents_upload_session_file_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: str = kwargs.pop("content_type") + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") @@ -613,7 +614,8 @@ def build_agents_upload_session_file_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) @@ -719,6 +721,7 @@ def build_agents_delete_session_file_request( def build_voice_agent_web_socket_connect_voice_agent_request( # pylint: disable=name-too-long agent_name: str, *, + foundry_features_query: Optional[Literal[_AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW]] = None, agent_session_id: Optional[str] = None, store: Optional[bool] = None, agent_version_override: Optional[str] = None, @@ -739,6 +742,8 @@ def build_voice_agent_web_socket_connect_voice_agent_request( # pylint: disable _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + if foundry_features_query is not None: + _params["foundry_features"] = _SERIALIZER.query("foundry_features_query", foundry_features_query, "str") if agent_session_id is not None: _params["agent_session_id"] = _SERIALIZER.query("agent_session_id", agent_session_id, "str") if store is not None: @@ -4043,7 +4048,7 @@ def build_beta_agents_delete_optimization_job_request( # pylint: disable=name-t return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -class BetaOperations: # pylint: disable=too-many-instance-attributes +class BetaOperations: # pylint: disable=docstring-missing-param,too-many-instance-attributes """ .. warning:: **DO NOT** instantiate this class directly. @@ -4075,7 +4080,7 @@ def __init__(self, *args, **kwargs) -> None: self.agents = BetaAgentsOperations(self._client, self._config, self._serialize, self._deserialize) -class AgentsOperations: # pylint: disable=too-many-public-methods +class AgentsOperations: # pylint: disable=docstring-missing-param,too-many-public-methods """ .. warning:: **DO NOT** instantiate this class directly. @@ -4458,12 +4463,7 @@ def create_version( @overload def create_version( - self, - agent_name: str, - body: _types.CreateAgentVersionRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentVersionDetails: """Create an agent version. @@ -4477,7 +4477,7 @@ def create_version( * Must not exceed 63 characters. Required. :type agent_name: str :param body: Required. - :type body: ~azure.ai.projects.types.CreateAgentVersionRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4515,7 +4515,7 @@ def create_version( def create_version( self, agent_name: str, - body: Union[JSON, _types.CreateAgentVersionRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, definition: _models.AgentDefinition = _Unset, metadata: Optional[dict[str, str]] = None, @@ -4535,9 +4535,8 @@ def create_version( * Can contain hyphens in the middle * Must not exceed 63 characters. Required. :type agent_name: str - :param body: Is one of the following types: JSON, CreateAgentVersionRequest, IO[bytes] - Required. - :type body: JSON or ~azure.ai.projects.types.CreateAgentVersionRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword definition: The agent definition. This can be a prompt, workflow, hosted, external, or voice agent definition. Required. :paramtype definition: ~azure.ai.projects.models.AgentDefinition @@ -4684,12 +4683,7 @@ def create_version_from_manifest( @overload def create_version_from_manifest( - self, - agent_name: str, - body: _types.CreateAgentVersionFromManifestRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentVersionDetails: """Create an agent version from manifest. @@ -4703,7 +4697,7 @@ def create_version_from_manifest( * Must not exceed 63 characters. Required. :type agent_name: str :param body: Required. - :type body: ~azure.ai.projects.types.CreateAgentVersionFromManifestRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4741,7 +4735,7 @@ def create_version_from_manifest( def create_version_from_manifest( self, agent_name: str, - body: Union[JSON, _types.CreateAgentVersionFromManifestRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, manifest_id: str = _Unset, parameter_values: dict[str, Any] = _Unset, @@ -4760,9 +4754,8 @@ def create_version_from_manifest( * Can contain hyphens in the middle * Must not exceed 63 characters. Required. :type agent_name: str - :param body: Is one of the following types: JSON, CreateAgentVersionFromManifestRequest, - IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.CreateAgentVersionFromManifestRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword manifest_id: The manifest ID to import the agent version from. Required. :paramtype manifest_id: str :keyword parameter_values: The inputs to the manifest that will result in a fully materialized @@ -5141,12 +5134,7 @@ def update_details( @overload def update_details( - self, - agent_name: str, - body: _types.PatchAgentObjectRequest, - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any + self, agent_name: str, body: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.AgentDetails: """Update an agent endpoint. @@ -5155,7 +5143,7 @@ def update_details( :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str :param body: Required. - :type body: ~azure.ai.projects.types.PatchAgentObjectRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -5188,7 +5176,7 @@ def update_details( def update_details( self, agent_name: str, - body: Union[JSON, _types.PatchAgentObjectRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, agent_endpoint: Optional[_models.AgentEndpointConfig] = None, agent_card: Optional[_models.AgentCard] = None, @@ -5200,8 +5188,8 @@ def update_details( :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str - :param body: Is one of the following types: JSON, PatchAgentObjectRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.PatchAgentObjectRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword agent_endpoint: The endpoint configuration for the agent. Default value is None. :paramtype agent_endpoint: ~azure.ai.projects.models.AgentEndpointConfig :keyword agent_card: Optional agent card for the agent. Default value is None. @@ -5289,19 +5277,14 @@ def _create_version_from_code( ) -> _models.AgentVersionDetails: ... @overload def _create_version_from_code( - self, - agent_name: str, - content: _types._CreateAgentVersionFromCodeContent, - *, - code_zip_sha256: str, - **kwargs: Any + self, agent_name: str, content: JSON, *, code_zip_sha256: str, **kwargs: Any ) -> _models.AgentVersionDetails: ... @distributed_trace def _create_version_from_code( self, agent_name: str, - content: Union[_models._models._CreateAgentVersionFromCodeContent, _types._CreateAgentVersionFromCodeContent], + content: Union[_models._models._CreateAgentVersionFromCodeContent, JSON], *, code_zip_sha256: str, **kwargs: Any @@ -5320,10 +5303,9 @@ def _create_version_from_code( * Can contain hyphens in the middle * Must not exceed 63 characters. Required. :type agent_name: str - :param content: The content multipart request content. Is one of the following types: - _CreateAgentVersionFromCodeContent Required. - :type content: ~azure.ai.projects.models._models._CreateAgentVersionFromCodeContent or - ~azure.ai.projects.types._CreateAgentVersionFromCodeContent + :param content: The content multipart request content. Is either a + _CreateAgentVersionFromCodeContent type or a JSON type. Required. + :type content: ~azure.ai.projects.models._models._CreateAgentVersionFromCodeContent or JSON :keyword code_zip_sha256: SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity verification. Required. :paramtype code_zip_sha256: str @@ -5618,12 +5600,7 @@ def create_session( @overload def create_session( - self, - agent_name: str, - body: _types.CreateSessionRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentSessionResource: """Create a session. @@ -5634,7 +5611,7 @@ def create_session( :param agent_name: The name of the agent to create a session for. Required. :type agent_name: str :param body: Required. - :type body: ~azure.ai.projects.types.CreateSessionRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5669,7 +5646,7 @@ def create_session( def create_session( self, agent_name: str, - body: Union[JSON, _types.CreateSessionRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, version_indicator: _models.VersionIndicator = _Unset, agent_session_id: Optional[str] = None, @@ -5683,8 +5660,8 @@ def create_session( :param agent_name: The name of the agent to create a session for. Required. :type agent_name: str - :param body: Is one of the following types: JSON, CreateSessionRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.CreateSessionRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword version_indicator: Determines which agent version backs the session. Required. :paramtype version_indicator: ~azure.ai.projects.models.VersionIndicator :keyword agent_session_id: Optional caller-provided session ID. If specified, it must be unique @@ -6153,9 +6130,16 @@ def get_session_log_stream( return deserialized # type: ignore - @distributed_trace + @overload def upload_session_file( - self, agent_name: str, session_id: str, content: bytes, *, path: str, **kwargs: Any + self, + agent_name: str, + session_id: str, + content: bytes, + *, + path: str, + content_type: str = "application/octet-stream", + **kwargs: Any ) -> _models.SessionFileWriteResult: """Upload a session file. @@ -6171,6 +6155,65 @@ def upload_session_file( :keyword path: The destination file path within the sandbox, relative to the session home directory. Required. :paramtype path: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/octet-stream". + :paramtype content_type: str + :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.SessionFileWriteResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def upload_session_file( + self, + agent_name: str, + session_id: str, + content: IO[bytes], + *, + path: str, + content_type: str = "application/octet-stream", + **kwargs: Any + ) -> _models.SessionFileWriteResult: + """Upload a session file. + + Uploads binary file content to the specified path in the session sandbox. The service stores + the file relative to the session home directory and rejects payloads larger than 50 MB. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param session_id: The session ID. Required. + :type session_id: str + :param content: Required. + :type content: IO[bytes] + :keyword path: The destination file path within the sandbox, relative to the session home + directory. Required. + :paramtype path: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/octet-stream". + :paramtype content_type: str + :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.SessionFileWriteResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def upload_session_file( + self, agent_name: str, session_id: str, content: Union[bytes, IO[bytes]], *, path: str, **kwargs: Any + ) -> _models.SessionFileWriteResult: + """Upload a session file. + + Uploads binary file content to the specified path in the session sandbox. The service stores + the file relative to the session home directory and rejects payloads larger than 50 MB. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param session_id: The session ID. Required. + :type session_id: str + :param content: Is either a bytes type or a IO[bytes] type. Required. + :type content: bytes or IO[bytes] + :keyword path: The destination file path within the sandbox, relative to the session home + directory. Required. + :paramtype path: str :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping :rtype: ~azure.ai.projects.models.SessionFileWriteResult :raises ~azure.core.exceptions.HttpResponseError: @@ -6186,9 +6229,10 @@ def upload_session_file( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/octet-stream")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SessionFileWriteResult] = kwargs.pop("cls", None) + content_type = content_type or "application/octet-stream" _content = content _request = build_agents_upload_session_file_request( @@ -6485,7 +6529,7 @@ def delete_session_file( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore -class VoiceAgentWebSocketOperations: +class VoiceAgentWebSocketOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -6507,6 +6551,7 @@ def connect_voice_agent( # pylint: disable=inconsistent-return-statements self, agent_name: str, *, + foundry_features_query: Optional[Literal[_AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW]] = None, agent_session_id: Optional[str] = None, store: Optional[bool] = None, agent_version_override: Optional[str] = None, @@ -6518,7 +6563,11 @@ def connect_voice_agent( # pylint: disable=inconsistent-return-statements Connects to a voice agent over WebSocket. The client must send an HTTP GET with ``Upgrade: websocket`` - headers. The optional ``realtime`` subprotocol is the only accepted subprotocol value. + headers. The optional ``realtime`` subprotocol is the only accepted subprotocol value. Supply + the + ``VoiceAgents=V1Preview`` opt-in through either the ``Foundry-Features`` header or the + ``foundry_features`` + query parameter. If the target agent is disabled, the HTTP WebSocket handshake fails before the ``101 Switching Protocols`` @@ -6528,6 +6577,12 @@ def connect_voice_agent( # pylint: disable=inconsistent-return-statements :param agent_name: The name of the voice agent. Required. :type agent_name: str + :keyword foundry_features_query: A query alternative to the ``Foundry-Features`` header for + clients that cannot set headers during a + WebSocket handshake. Set this to ``VoiceAgents=V1Preview``. Either this query parameter or the + header is + required. VOICE_AGENTS_V1_PREVIEW. Default value is None. + :paramtype foundry_features_query: str or ~azure.ai.projects.models.VOICE_AGENTS_V1_PREVIEW :keyword agent_session_id: An optional identifier used to correlate the voice session. Default value is None. :paramtype agent_session_id: str @@ -6566,6 +6621,7 @@ def connect_voice_agent( # pylint: disable=inconsistent-return-statements _request = build_voice_agent_web_socket_connect_voice_agent_request( agent_name=agent_name, + foundry_features_query=foundry_features_query, agent_session_id=agent_session_id, store=store, agent_version_override=agent_version_override, @@ -6604,7 +6660,7 @@ def connect_voice_agent( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, response_headers) # type: ignore -class AgentEndpointConversationsOperations: +class AgentEndpointConversationsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -7674,7 +7730,7 @@ def get_agent_conversation_audio_content( return deserialized # type: ignore -class EvaluationRulesOperations: +class EvaluationRulesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -7826,7 +7882,7 @@ def create_or_update( @overload def create_or_update( - self, id: str, evaluation_rule: _types.EvaluationRule, *, content_type: str = "application/json", **kwargs: Any + self, id: str, evaluation_rule: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationRule: """Create or update an evaluation rule. @@ -7835,7 +7891,7 @@ def create_or_update( :param id: Unique identifier for the evaluation rule. Required. :type id: str :param evaluation_rule: Evaluation rule resource. Required. - :type evaluation_rule: ~azure.ai.projects.types.EvaluationRule + :type evaluation_rule: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7866,7 +7922,7 @@ def create_or_update( @distributed_trace def create_or_update( - self, id: str, evaluation_rule: Union[_models.EvaluationRule, _types.EvaluationRule, IO[bytes]], **kwargs: Any + self, id: str, evaluation_rule: Union[_models.EvaluationRule, JSON, IO[bytes]], **kwargs: Any ) -> _models.EvaluationRule: """Create or update an evaluation rule. @@ -7874,10 +7930,9 @@ def create_or_update( :param id: Unique identifier for the evaluation rule. Required. :type id: str - :param evaluation_rule: Evaluation rule resource. Is either a EvaluationRule type or a - IO[bytes] type. Required. - :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule or - ~azure.ai.projects.types.EvaluationRule or IO[bytes] + :param evaluation_rule: Evaluation rule resource. Is one of the following types: + EvaluationRule, JSON, IO[bytes] Required. + :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule or JSON or IO[bytes] :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationRule :raises ~azure.core.exceptions.HttpResponseError: @@ -8052,7 +8107,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class ConnectionsOperations: +class ConnectionsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -8313,7 +8368,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class DatasetsOperations: +class DatasetsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -8667,7 +8722,7 @@ def create_or_update( self, name: str, version: str, - dataset_version: _types.DatasetVersion, + dataset_version: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -8681,7 +8736,7 @@ def create_or_update( :param version: The specific version id of the DatasetVersion to create or update. Required. :type version: str :param dataset_version: The DatasetVersion to create or update. Required. - :type dataset_version: ~azure.ai.projects.types.DatasetVersion + :type dataset_version: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -8720,11 +8775,7 @@ def create_or_update( @distributed_trace def create_or_update( - self, - name: str, - version: str, - dataset_version: Union[_models.DatasetVersion, _types.DatasetVersion, IO[bytes]], - **kwargs: Any + self, name: str, version: str, dataset_version: Union[_models.DatasetVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.DatasetVersion: """Create or update a version. @@ -8734,10 +8785,9 @@ def create_or_update( :type name: str :param version: The specific version id of the DatasetVersion to create or update. Required. :type version: str - :param dataset_version: The DatasetVersion to create or update. Is either a DatasetVersion type - or a IO[bytes] type. Required. - :type dataset_version: ~azure.ai.projects.models.DatasetVersion or - ~azure.ai.projects.types.DatasetVersion or IO[bytes] + :param dataset_version: The DatasetVersion to create or update. Is one of the following types: + DatasetVersion, JSON, IO[bytes] Required. + :type dataset_version: ~azure.ai.projects.models.DatasetVersion or JSON or IO[bytes] :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -8837,7 +8887,7 @@ def pending_upload( self, name: str, version: str, - pending_upload_request: _types.PendingUploadRequest, + pending_upload_request: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -8851,7 +8901,7 @@ def pending_upload( :param version: The specific version id of the DatasetVersion to operate on. Required. :type version: str :param pending_upload_request: The pending upload request parameters. Required. - :type pending_upload_request: ~azure.ai.projects.types.PendingUploadRequest + :type pending_upload_request: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -8893,7 +8943,7 @@ def pending_upload( self, name: str, version: str, - pending_upload_request: Union[_models.PendingUploadRequest, _types.PendingUploadRequest, IO[bytes]], + pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.PendingUploadResponse: """Start a pending upload. @@ -8904,10 +8954,10 @@ def pending_upload( :type name: str :param version: The specific version id of the DatasetVersion to operate on. Required. :type version: str - :param pending_upload_request: The pending upload request parameters. Is either a - PendingUploadRequest type or a IO[bytes] type. Required. - :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or - ~azure.ai.projects.types.PendingUploadRequest or IO[bytes] + :param pending_upload_request: The pending upload request parameters. Is one of the following + types: PendingUploadRequest, JSON, IO[bytes] Required. + :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or JSON or + IO[bytes] :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -9041,7 +9091,7 @@ def get_credentials(self, name: str, version: str, **kwargs: Any) -> _models.Dat return deserialized # type: ignore -class DeploymentsOperations: +class DeploymentsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -9236,7 +9286,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class IndexesOperations: +class IndexesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -9587,13 +9637,7 @@ def create_or_update( @overload def create_or_update( - self, - name: str, - version: str, - index: _types.Index, - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any + self, name: str, version: str, index: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.Index: """Create or update a version. @@ -9604,7 +9648,7 @@ def create_or_update( :param version: The specific version id of the Index to create or update. Required. :type version: str :param index: The Index to create or update. Required. - :type index: ~azure.ai.projects.types.Index + :type index: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -9643,7 +9687,7 @@ def create_or_update( @distributed_trace def create_or_update( - self, name: str, version: str, index: Union[_models.Index, _types.Index, IO[bytes]], **kwargs: Any + self, name: str, version: str, index: Union[_models.Index, JSON, IO[bytes]], **kwargs: Any ) -> _models.Index: """Create or update a version. @@ -9653,9 +9697,9 @@ def create_or_update( :type name: str :param version: The specific version id of the Index to create or update. Required. :type version: str - :param index: The Index to create or update. Is either a Index type or a IO[bytes] type. - Required. - :type index: ~azure.ai.projects.models.Index or ~azure.ai.projects.types.Index or IO[bytes] + :param index: The Index to create or update. Is one of the following types: Index, JSON, + IO[bytes] Required. + :type index: ~azure.ai.projects.models.Index or JSON or IO[bytes] :return: Index. The Index is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Index :raises ~azure.core.exceptions.HttpResponseError: @@ -9723,7 +9767,7 @@ def create_or_update( return deserialized # type: ignore -class ToolboxesOperations: +class ToolboxesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -9783,12 +9827,7 @@ def create_version( @overload def create_version( - self, - name: str, - body: _types.CreateToolboxVersionRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ToolboxVersionObject: """Create a new version of a toolbox. @@ -9798,7 +9837,7 @@ def create_version( Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.CreateToolboxVersionRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9832,7 +9871,7 @@ def create_version( def create_version( self, name: str, - body: Union[JSON, _types.CreateToolboxVersionRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, tools: List[_models.ToolboxTool] = _Unset, description: Optional[str] = None, @@ -9848,9 +9887,8 @@ def create_version( :param name: The name of the toolbox. If the toolbox does not exist, it will be created. Required. :type name: str - :param body: Is one of the following types: JSON, CreateToolboxVersionRequest, IO[bytes] - Required. - :type body: JSON or ~azure.ai.projects.types.CreateToolboxVersionRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword tools: The list of tools to include in this version. Required. :paramtype tools: list[~azure.ai.projects.models.ToolboxTool] :keyword description: A human-readable description of the toolbox. Default value is None. @@ -10292,7 +10330,7 @@ def update( @overload def update( - self, name: str, body: _types.UpdateToolboxRequest1, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. @@ -10301,7 +10339,7 @@ def update( :param name: The name of the toolbox to update. Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.UpdateToolboxRequest1 + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10332,12 +10370,7 @@ def update( @distributed_trace def update( - self, - name: str, - body: Union[JSON, _types.UpdateToolboxRequest1, IO[bytes]] = _Unset, - *, - default_version: str = _Unset, - **kwargs: Any + self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, default_version: str = _Unset, **kwargs: Any ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. @@ -10345,8 +10378,8 @@ def update( :param name: The name of the toolbox to update. Required. :type name: str - :param body: Is one of the following types: JSON, UpdateToolboxRequest1, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.UpdateToolboxRequest1 or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword 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. :paramtype default_version: str @@ -10538,7 +10571,7 @@ def delete_version( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore -class BetaEvaluationTaxonomiesOperations: +class BetaEvaluationTaxonomiesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -10789,7 +10822,7 @@ def create( @overload def create( - self, name: str, taxonomy: _types.EvaluationTaxonomy, *, content_type: str = "application/json", **kwargs: Any + self, name: str, taxonomy: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. @@ -10798,7 +10831,7 @@ def create( :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. - :type taxonomy: ~azure.ai.projects.types.EvaluationTaxonomy + :type taxonomy: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10829,10 +10862,7 @@ def create( @distributed_trace def create( - self, - name: str, - taxonomy: Union[_models.EvaluationTaxonomy, _types.EvaluationTaxonomy, IO[bytes]], - **kwargs: Any + self, name: str, taxonomy: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], **kwargs: Any ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. @@ -10840,10 +10870,9 @@ def create( :param name: The name of the evaluation taxonomy. Required. :type name: str - :param taxonomy: The evaluation taxonomy. Is either a EvaluationTaxonomy type or a IO[bytes] - type. Required. - :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or - ~azure.ai.projects.types.EvaluationTaxonomy or IO[bytes] + :param taxonomy: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, + JSON, IO[bytes] Required. + :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: @@ -10931,7 +10960,7 @@ def update( @overload def update( - self, name: str, taxonomy: _types.EvaluationTaxonomy, *, content_type: str = "application/json", **kwargs: Any + self, name: str, taxonomy: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. @@ -10940,7 +10969,7 @@ def update( :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. - :type taxonomy: ~azure.ai.projects.types.EvaluationTaxonomy + :type taxonomy: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10971,10 +11000,7 @@ def update( @distributed_trace def update( - self, - name: str, - taxonomy: Union[_models.EvaluationTaxonomy, _types.EvaluationTaxonomy, IO[bytes]], - **kwargs: Any + self, name: str, taxonomy: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], **kwargs: Any ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. @@ -10982,10 +11008,9 @@ def update( :param name: The name of the evaluation taxonomy. Required. :type name: str - :param taxonomy: The evaluation taxonomy. Is either a EvaluationTaxonomy type or a IO[bytes] - type. Required. - :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or - ~azure.ai.projects.types.EvaluationTaxonomy or IO[bytes] + :param taxonomy: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, + JSON, IO[bytes] Required. + :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: @@ -11052,7 +11077,7 @@ def update( return deserialized # type: ignore -class BetaEvaluatorsOperations: +class BetaEvaluatorsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -11431,12 +11456,7 @@ def create_version( @overload def create_version( - self, - name: str, - evaluator_version: _types.EvaluatorVersion, - *, - content_type: str = "application/json", - **kwargs: Any + self, name: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: """Create an evaluator version. @@ -11445,7 +11465,7 @@ def create_version( :param name: The name of the resource. Required. :type name: str :param evaluator_version: Required. - :type evaluator_version: ~azure.ai.projects.types.EvaluatorVersion + :type evaluator_version: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11476,10 +11496,7 @@ def create_version( @distributed_trace def create_version( - self, - name: str, - evaluator_version: Union[_models.EvaluatorVersion, _types.EvaluatorVersion, IO[bytes]], - **kwargs: Any + self, name: str, evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.EvaluatorVersion: """Create an evaluator version. @@ -11487,9 +11504,9 @@ def create_version( :param name: The name of the resource. Required. :type name: str - :param evaluator_version: Is either a EvaluatorVersion type or a IO[bytes] type. Required. - :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or - ~azure.ai.projects.types.EvaluatorVersion or IO[bytes] + :param evaluator_version: Is one of the following types: EvaluatorVersion, JSON, IO[bytes] + Required. + :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or JSON or IO[bytes] :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -11585,13 +11602,7 @@ def update_version( @overload def update_version( - self, - name: str, - version: str, - evaluator_version: _types.EvaluatorVersion, - *, - content_type: str = "application/json", - **kwargs: Any + self, name: str, version: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: """Update an evaluator version. @@ -11602,7 +11613,7 @@ def update_version( :param version: The version of the EvaluatorVersion to update. Required. :type version: str :param evaluator_version: Evaluator resource. Required. - :type evaluator_version: ~azure.ai.projects.types.EvaluatorVersion + :type evaluator_version: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11644,7 +11655,7 @@ def update_version( self, name: str, version: str, - evaluator_version: Union[_models.EvaluatorVersion, _types.EvaluatorVersion, IO[bytes]], + evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.EvaluatorVersion: """Update an evaluator version. @@ -11655,10 +11666,9 @@ def update_version( :type name: str :param version: The version of the EvaluatorVersion to update. Required. :type version: str - :param evaluator_version: Evaluator resource. Is either a EvaluatorVersion type or a IO[bytes] - type. Required. - :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or - ~azure.ai.projects.types.EvaluatorVersion or IO[bytes] + :param evaluator_version: Evaluator resource. Is one of the following types: EvaluatorVersion, + JSON, IO[bytes] Required. + :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or JSON or IO[bytes] :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -11759,7 +11769,7 @@ def pending_upload( self, name: str, version: str, - pending_upload_request: _types.PendingUploadRequest, + pending_upload_request: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -11774,7 +11784,7 @@ def pending_upload( :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str :param pending_upload_request: The pending upload request parameters. Required. - :type pending_upload_request: ~azure.ai.projects.types.PendingUploadRequest + :type pending_upload_request: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11817,7 +11827,7 @@ def pending_upload( self, name: str, version: str, - pending_upload_request: Union[_models.PendingUploadRequest, _types.PendingUploadRequest, IO[bytes]], + pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.PendingUploadResponse: """Start a pending upload. @@ -11829,10 +11839,10 @@ def pending_upload( :type name: str :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str - :param pending_upload_request: The pending upload request parameters. Is either a - PendingUploadRequest type or a IO[bytes] type. Required. - :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or - ~azure.ai.projects.types.PendingUploadRequest or IO[bytes] + :param pending_upload_request: The pending upload request parameters. Is one of the following + types: PendingUploadRequest, JSON, IO[bytes] Required. + :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or JSON or + IO[bytes] :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -11937,7 +11947,7 @@ def get_credentials( self, name: str, version: str, - credential_request: _types.EvaluatorCredentialRequest, + credential_request: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -11952,7 +11962,7 @@ def get_credentials( :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str :param credential_request: The credential request parameters. Required. - :type credential_request: ~azure.ai.projects.types.EvaluatorCredentialRequest + :type credential_request: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11995,7 +12005,7 @@ def get_credentials( self, name: str, version: str, - credential_request: Union[_models.EvaluatorCredentialRequest, _types.EvaluatorCredentialRequest, IO[bytes]], + credential_request: Union[_models.EvaluatorCredentialRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.DatasetCredential: """Get evaluator credentials. @@ -12007,10 +12017,10 @@ def get_credentials( :type name: str :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str - :param credential_request: The credential request parameters. Is either a - EvaluatorCredentialRequest type or a IO[bytes] type. Required. - :type credential_request: ~azure.ai.projects.models.EvaluatorCredentialRequest or - ~azure.ai.projects.types.EvaluatorCredentialRequest or IO[bytes] + :param credential_request: The credential request parameters. Is one of the following types: + EvaluatorCredentialRequest, JSON, IO[bytes] Required. + :type credential_request: ~azure.ai.projects.models.EvaluatorCredentialRequest or JSON or + IO[bytes] :return: DatasetCredential. The DatasetCredential is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetCredential :raises ~azure.core.exceptions.HttpResponseError: @@ -12083,7 +12093,7 @@ def get_credentials( def _create_generation_job_initial( self, - job: Union[_models.EvaluatorGenerationJob, _types.EvaluatorGenerationJob, IO[bytes]], + job: Union[_models.EvaluatorGenerationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -12183,12 +12193,7 @@ def begin_create_generation_job( @overload def begin_create_generation_job( - self, - job: _types.EvaluatorGenerationJob, - *, - operation_id: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any + self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.EvaluatorVersion]: """Create an evaluator generation job. @@ -12196,7 +12201,7 @@ def begin_create_generation_job( from the provided source materials asynchronously. :param job: The job to create. Required. - :type job: ~azure.ai.projects.types.EvaluatorGenerationJob + :type job: JSON :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -12240,7 +12245,7 @@ def begin_create_generation_job( @distributed_trace def begin_create_generation_job( self, - job: Union[_models.EvaluatorGenerationJob, _types.EvaluatorGenerationJob, IO[bytes]], + job: Union[_models.EvaluatorGenerationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -12250,10 +12255,9 @@ def begin_create_generation_job( Creates an evaluator generation job. The service generates rubric-based evaluator definitions from the provided source materials asynchronously. - :param job: The job to create. Is either a EvaluatorGenerationJob type or a IO[bytes] type. - Required. - :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or - ~azure.ai.projects.types.EvaluatorGenerationJob or IO[bytes] + :param job: The job to create. Is one of the following types: EvaluatorGenerationJob, JSON, + IO[bytes] Required. + :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or JSON or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -12608,7 +12612,7 @@ def delete_generation_job( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore -class BetaInsightsOperations: +class BetaInsightsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -12645,16 +12649,14 @@ def generate( """ @overload - def generate( - self, insight: _types.Insight, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Insight: + def generate(self, insight: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.Insight: """Generate insights. Generates an insights report from the provided evaluation configuration. :param insight: Complete evaluation configuration including data source, evaluators, and result settings. Required. - :type insight: ~azure.ai.projects.types.Insight + :type insight: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -12681,15 +12683,14 @@ def generate(self, insight: IO[bytes], *, content_type: str = "application/json" """ @distributed_trace - def generate(self, insight: Union[_models.Insight, _types.Insight, IO[bytes]], **kwargs: Any) -> _models.Insight: + def generate(self, insight: Union[_models.Insight, JSON, IO[bytes]], **kwargs: Any) -> _models.Insight: """Generate insights. Generates an insights report from the provided evaluation configuration. :param insight: Complete evaluation configuration including data source, evaluators, and result - settings. Is either a Insight type or a IO[bytes] type. Required. - :type insight: ~azure.ai.projects.models.Insight or ~azure.ai.projects.types.Insight or - IO[bytes] + settings. Is one of the following types: Insight, JSON, IO[bytes] Required. + :type insight: ~azure.ai.projects.models.Insight or JSON or IO[bytes] :return: Insight. The Insight is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Insight :raises ~azure.core.exceptions.HttpResponseError: @@ -12950,7 +12951,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class BetaMemoryStoresOperations: +class BetaMemoryStoresOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -13001,14 +13002,14 @@ def create( @overload def create( - self, body: _types.CreateMemoryStoreRequest, *, content_type: str = "application/json", **kwargs: Any + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: """Create a memory store. Creates a memory store resource with the provided configuration. :param body: Required. - :type body: ~azure.ai.projects.types.CreateMemoryStoreRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -13038,7 +13039,7 @@ def create( @distributed_trace def create( self, - body: Union[JSON, _types.CreateMemoryStoreRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, name: str = _Unset, definition: _models.MemoryStoreDefinition = _Unset, @@ -13050,8 +13051,8 @@ def create( Creates a memory store resource with the provided configuration. - :param body: Is one of the following types: JSON, CreateMemoryStoreRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.CreateMemoryStoreRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword name: The name of the memory store. Required. :paramtype name: str :keyword definition: The memory store definition. Required. @@ -13167,7 +13168,7 @@ def update( @overload def update( - self, name: str, body: _types.UpdateMemoryStoreRequest, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: """Update a memory store. @@ -13176,7 +13177,7 @@ def update( :param name: The name of the memory store to update. Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.UpdateMemoryStoreRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -13209,7 +13210,7 @@ def update( def update( self, name: str, - body: Union[JSON, _types.UpdateMemoryStoreRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, description: Optional[str] = None, metadata: Optional[dict[str, str]] = None, @@ -13221,8 +13222,8 @@ def update( :param name: The name of the memory store to update. Required. :type name: str - :param body: Is one of the following types: JSON, UpdateMemoryStoreRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.UpdateMemoryStoreRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword description: A human-readable description of the memory store. Default value is None. :paramtype description: str :keyword metadata: Arbitrary key-value metadata to associate with the memory store. Default @@ -13540,7 +13541,7 @@ def _search_memories( ) -> _models.MemoryStoreSearchResult: ... @overload def _search_memories( - self, name: str, body: _types.SearchMemoriesRequest, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreSearchResult: ... @overload def _search_memories( @@ -13551,7 +13552,7 @@ def _search_memories( def _search_memories( self, name: str, - body: Union[JSON, _types.SearchMemoriesRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, items: Optional[List[dict[str, Any]]] = None, @@ -13565,8 +13566,8 @@ def _search_memories( :param name: The name of the memory store to search. Required. :type name: str - :param body: Is one of the following types: JSON, SearchMemoriesRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.SearchMemoriesRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -13654,7 +13655,7 @@ def _search_memories( def _update_memories_initial( self, name: str, - body: Union[JSON, _types.UpdateMemoriesRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, items: Optional[List[dict[str, Any]]] = None, @@ -13750,7 +13751,7 @@ def _begin_update_memories( ) -> LROPoller[_models.MemoryStoreUpdateCompletedResult]: ... @overload def _begin_update_memories( - self, name: str, body: _types.UpdateMemoriesRequest, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.MemoryStoreUpdateCompletedResult]: ... @overload def _begin_update_memories( @@ -13761,7 +13762,7 @@ def _begin_update_memories( def _begin_update_memories( self, name: str, - body: Union[JSON, _types.UpdateMemoriesRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, items: Optional[List[dict[str, Any]]] = None, @@ -13776,8 +13777,8 @@ def _begin_update_memories( :param name: The name of the memory store to update. Required. :type name: str - :param body: Is one of the following types: JSON, UpdateMemoriesRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.UpdateMemoriesRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -13882,7 +13883,7 @@ def delete_scope( @overload def delete_scope( - self, name: str, body: _types.DeleteScopeRequest, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: """Delete memories by scope. @@ -13891,7 +13892,7 @@ def delete_scope( :param name: The name of the memory store. Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.DeleteScopeRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -13924,12 +13925,7 @@ def delete_scope( @distributed_trace def delete_scope( - self, - name: str, - body: Union[JSON, _types.DeleteScopeRequest, IO[bytes]] = _Unset, - *, - scope: str = _Unset, - **kwargs: Any + self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: """Delete memories by scope. @@ -13937,8 +13933,8 @@ def delete_scope( :param name: The name of the memory store. Required. :type name: str - :param body: Is one of the following types: JSON, DeleteScopeRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.DeleteScopeRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories to delete, such as a user ID. Required. :paramtype scope: str @@ -14052,7 +14048,7 @@ def create_memory( @overload def create_memory( - self, name: str, body: _types.CreateMemoryRequest, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: """Create a memory item. @@ -14061,7 +14057,7 @@ def create_memory( :param name: The name of the memory store. Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.CreateMemoryRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -14094,7 +14090,7 @@ def create_memory( def create_memory( self, name: str, - body: Union[JSON, _types.CreateMemoryRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, content: str = _Unset, @@ -14107,8 +14103,8 @@ def create_memory( :param name: The name of the memory store. Required. :type name: str - :param body: Is one of the following types: JSON, CreateMemoryRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.CreateMemoryRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -14219,13 +14215,7 @@ def update_memory( @overload def update_memory( - self, - name: str, - memory_id: str, - body: _types.UpdateMemoryRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, name: str, memory_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: """Update a memory item. @@ -14236,7 +14226,7 @@ def update_memory( :param memory_id: The ID of the memory item to update. Required. :type memory_id: str :param body: Required. - :type body: ~azure.ai.projects.types.UpdateMemoryRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -14269,13 +14259,7 @@ def update_memory( @distributed_trace def update_memory( - self, - name: str, - memory_id: str, - body: Union[JSON, _types.UpdateMemoryRequest, IO[bytes]] = _Unset, - *, - content: str = _Unset, - **kwargs: Any + self, name: str, memory_id: str, body: Union[JSON, IO[bytes]] = _Unset, *, content: str = _Unset, **kwargs: Any ) -> _models.MemoryItem: """Update a memory item. @@ -14285,8 +14269,8 @@ def update_memory( :type name: str :param memory_id: The ID of the memory item to update. Required. :type memory_id: str - :param body: Is one of the following types: JSON, UpdateMemoryRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.UpdateMemoryRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword content: The updated content of the memory. Required. :paramtype content: str :return: MemoryItem. The MemoryItem is compatible with MutableMapping @@ -14485,7 +14469,7 @@ def list_memories( def list_memories( self, name: str, - body: _types.ListMemoriesRequest, + body: JSON, *, kind: Optional[Union[str, _models.MemoryItemKind]] = None, limit: Optional[int] = None, @@ -14501,7 +14485,7 @@ def list_memories( :param name: The name of the memory store. Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.ListMemoriesRequest + :type body: JSON :keyword kind: The kind of the memory item. Known values are: "user_profile", "chat_summary", and "procedural". Default value is None. :paramtype kind: str or ~azure.ai.projects.models.MemoryItemKind @@ -14577,7 +14561,7 @@ def list_memories( def list_memories( self, name: str, - body: Union[JSON, _types.ListMemoriesRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, kind: Optional[Union[str, _models.MemoryItemKind]] = None, @@ -14592,8 +14576,8 @@ def list_memories( :param name: The name of the memory store. Required. :type name: str - :param body: Is one of the following types: JSON, ListMemoriesRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.ListMemoriesRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -14766,7 +14750,7 @@ def delete_memory(self, name: str, memory_id: str, **kwargs: Any) -> _models.Del return deserialized # type: ignore -class BetaModelsOperations: +class BetaModelsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -15119,7 +15103,7 @@ def update( self, name: str, version: str, - model_version_update: _types.UpdateModelVersionRequest, + model_version_update: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -15134,7 +15118,7 @@ def update( Required. :type version: str :param model_version_update: The UpdateModelVersionRequest to create or update. Required. - :type model_version_update: ~azure.ai.projects.types.UpdateModelVersionRequest + :type model_version_update: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -15177,7 +15161,7 @@ def update( self, name: str, version: str, - model_version_update: Union[_models.UpdateModelVersionRequest, _types.UpdateModelVersionRequest, IO[bytes]], + model_version_update: Union[_models.UpdateModelVersionRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.ModelVersion: """Update a model version. @@ -15189,10 +15173,10 @@ def update( :param version: The specific version id of the UpdateModelVersionRequest to create or update. Required. :type version: str - :param model_version_update: The UpdateModelVersionRequest to create or update. Is either a - UpdateModelVersionRequest type or a IO[bytes] type. Required. - :type model_version_update: ~azure.ai.projects.models.UpdateModelVersionRequest or - ~azure.ai.projects.types.UpdateModelVersionRequest or IO[bytes] + :param model_version_update: The UpdateModelVersionRequest to create or update. Is one of the + following types: UpdateModelVersionRequest, JSON, IO[bytes] Required. + :type model_version_update: ~azure.ai.projects.models.UpdateModelVersionRequest or JSON or + IO[bytes] :return: ModelVersion. The ModelVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.ModelVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -15290,13 +15274,7 @@ def pending_create_version( @overload def pending_create_version( - self, - name: str, - version: str, - model_version: _types.ModelVersion, - *, - content_type: str = "application/json", - **kwargs: Any + self, name: str, version: str, model_version: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CreateAsyncResponse: """Create a model version async. @@ -15308,7 +15286,7 @@ def pending_create_version( :param version: Version of the model. Required. :type version: str :param model_version: Model version to create. Required. - :type model_version: ~azure.ai.projects.types.ModelVersion + :type model_version: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -15348,11 +15326,7 @@ def pending_create_version( @distributed_trace def pending_create_version( - self, - name: str, - version: str, - model_version: Union[_models.ModelVersion, _types.ModelVersion, IO[bytes]], - **kwargs: Any + self, name: str, version: str, model_version: Union[_models.ModelVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.CreateAsyncResponse: """Create a model version async. @@ -15363,10 +15337,9 @@ def pending_create_version( :type name: str :param version: Version of the model. Required. :type version: str - :param model_version: Model version to create. Is either a ModelVersion type or a IO[bytes] - type. Required. - :type model_version: ~azure.ai.projects.models.ModelVersion or - ~azure.ai.projects.types.ModelVersion or IO[bytes] + :param model_version: Model version to create. Is one of the following types: ModelVersion, + JSON, IO[bytes] Required. + :type model_version: ~azure.ai.projects.models.ModelVersion or JSON or IO[bytes] :return: CreateAsyncResponse. The CreateAsyncResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.CreateAsyncResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -15470,7 +15443,7 @@ def pending_upload( self, name: str, version: str, - pending_upload_request: _types.ModelPendingUploadRequest, + pending_upload_request: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -15484,7 +15457,7 @@ def pending_upload( :param version: Version of the model. Required. :type version: str :param pending_upload_request: The pending upload request request body. Required. - :type pending_upload_request: ~azure.ai.projects.types.ModelPendingUploadRequest + :type pending_upload_request: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -15528,7 +15501,7 @@ def pending_upload( self, name: str, version: str, - pending_upload_request: Union[_models.ModelPendingUploadRequest, _types.ModelPendingUploadRequest, IO[bytes]], + pending_upload_request: Union[_models.ModelPendingUploadRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.ModelPendingUploadResponse: """Start a pending upload. @@ -15539,10 +15512,10 @@ def pending_upload( :type name: str :param version: Version of the model. Required. :type version: str - :param pending_upload_request: The pending upload request request body. Is either a - ModelPendingUploadRequest type or a IO[bytes] type. Required. - :type pending_upload_request: ~azure.ai.projects.models.ModelPendingUploadRequest or - ~azure.ai.projects.types.ModelPendingUploadRequest or IO[bytes] + :param pending_upload_request: The pending upload request request body. Is one of the following + types: ModelPendingUploadRequest, JSON, IO[bytes] Required. + :type pending_upload_request: ~azure.ai.projects.models.ModelPendingUploadRequest or JSON or + IO[bytes] :return: ModelPendingUploadResponse. The ModelPendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.ModelPendingUploadResponse @@ -15643,7 +15616,7 @@ def get_credentials( self, name: str, version: str, - credential_request: _types.ModelCredentialRequest, + credential_request: JSON, *, content_type: str = "application/json", **kwargs: Any @@ -15657,7 +15630,7 @@ def get_credentials( :param version: Version of the model. Required. :type version: str :param credential_request: The credential request request body. Required. - :type credential_request: ~azure.ai.projects.types.ModelCredentialRequest + :type credential_request: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -15699,7 +15672,7 @@ def get_credentials( self, name: str, version: str, - credential_request: Union[_models.ModelCredentialRequest, _types.ModelCredentialRequest, IO[bytes]], + credential_request: Union[_models.ModelCredentialRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.DatasetCredential: """Get model asset credentials. @@ -15710,10 +15683,9 @@ def get_credentials( :type name: str :param version: Version of the model. Required. :type version: str - :param credential_request: The credential request request body. Is either a - ModelCredentialRequest type or a IO[bytes] type. Required. - :type credential_request: ~azure.ai.projects.models.ModelCredentialRequest or - ~azure.ai.projects.types.ModelCredentialRequest or IO[bytes] + :param credential_request: The credential request request body. Is one of the following types: + ModelCredentialRequest, JSON, IO[bytes] Required. + :type credential_request: ~azure.ai.projects.models.ModelCredentialRequest or JSON or IO[bytes] :return: DatasetCredential. The DatasetCredential is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetCredential :raises ~azure.core.exceptions.HttpResponseError: @@ -15781,7 +15753,7 @@ def get_credentials( return deserialized # type: ignore -class BetaRedTeamsOperations: +class BetaRedTeamsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -15970,15 +15942,13 @@ def create( """ @overload - def create( - self, red_team: _types.RedTeam, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RedTeam: + def create(self, red_team: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.RedTeam: """Create a redteam run. Submits a new redteam run for execution with the provided configuration. :param red_team: Redteam to be run. Required. - :type red_team: ~azure.ai.projects.types.RedTeam + :type red_team: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -16004,14 +15974,14 @@ def create(self, red_team: IO[bytes], *, content_type: str = "application/json", """ @distributed_trace - def create(self, red_team: Union[_models.RedTeam, _types.RedTeam, IO[bytes]], **kwargs: Any) -> _models.RedTeam: + def create(self, red_team: Union[_models.RedTeam, JSON, IO[bytes]], **kwargs: Any) -> _models.RedTeam: """Create a redteam run. Submits a new redteam run for execution with the provided configuration. - :param red_team: Redteam to be run. Is either a RedTeam type or a IO[bytes] type. Required. - :type red_team: ~azure.ai.projects.models.RedTeam or ~azure.ai.projects.types.RedTeam or - IO[bytes] + :param red_team: Redteam to be run. Is one of the following types: RedTeam, JSON, IO[bytes] + Required. + :type red_team: ~azure.ai.projects.models.RedTeam or JSON or IO[bytes] :return: RedTeam. The RedTeam is compatible with MutableMapping :rtype: ~azure.ai.projects.models.RedTeam :raises ~azure.core.exceptions.HttpResponseError: @@ -16081,7 +16051,7 @@ def create(self, red_team: Union[_models.RedTeam, _types.RedTeam, IO[bytes]], ** return deserialized # type: ignore -class BetaRoutinesOperations: +class BetaRoutinesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -16135,12 +16105,7 @@ def create_or_update( @overload def create_or_update( - self, - routine_name: str, - body: _types.CreateOrUpdateRoutineRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, routine_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Routine: """Create or update a routine. @@ -16149,7 +16114,7 @@ def create_or_update( :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. - :type body: ~azure.ai.projects.types.CreateOrUpdateRoutineRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -16182,7 +16147,7 @@ def create_or_update( def create_or_update( self, routine_name: str, - body: Union[JSON, _types.CreateOrUpdateRoutineRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, description: Optional[str] = None, enabled: Optional[bool] = None, @@ -16196,9 +16161,8 @@ def create_or_update( :param routine_name: The unique name of the routine. Required. :type routine_name: str - :param body: Is one of the following types: JSON, CreateOrUpdateRoutineRequest, IO[bytes] - Required. - :type body: JSON or ~azure.ai.projects.types.CreateOrUpdateRoutineRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword description: A human-readable description of the routine. Default value is None. :paramtype description: str :keyword enabled: Whether the routine is enabled. Default value is None. @@ -16800,12 +16764,7 @@ def dispatch( @overload def dispatch( - self, - routine_name: str, - body: _types.DispatchRoutineAsyncRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, routine_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. @@ -16814,7 +16773,7 @@ def dispatch( :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. - :type body: ~azure.ai.projects.types.DispatchRoutineAsyncRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -16847,7 +16806,7 @@ def dispatch( def dispatch( self, routine_name: str, - body: Union[JSON, _types.DispatchRoutineAsyncRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, payload: Optional[_models.RoutineDispatchPayload] = None, **kwargs: Any @@ -16858,9 +16817,8 @@ def dispatch( :param routine_name: The unique name of the routine. Required. :type routine_name: str - :param body: Is one of the following types: JSON, DispatchRoutineAsyncRequest, IO[bytes] - Required. - :type body: JSON or ~azure.ai.projects.types.DispatchRoutineAsyncRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword payload: A direct action-input override sent downstream when testing a routine. Default value is None. :paramtype payload: ~azure.ai.projects.models.RoutineDispatchPayload @@ -16937,7 +16895,7 @@ def dispatch( return deserialized # type: ignore -class BetaSchedulesOperations: +class BetaSchedulesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -17192,7 +17150,7 @@ def create_or_update( @overload def create_or_update( - self, schedule_id: str, schedule: _types.Schedule, *, content_type: str = "application/json", **kwargs: Any + self, schedule_id: str, schedule: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Schedule: """Create or update a schedule. @@ -17201,7 +17159,7 @@ def create_or_update( :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str :param schedule: The resource instance. Required. - :type schedule: ~azure.ai.projects.types.Schedule + :type schedule: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -17232,7 +17190,7 @@ def create_or_update( @distributed_trace def create_or_update( - self, schedule_id: str, schedule: Union[_models.Schedule, _types.Schedule, IO[bytes]], **kwargs: Any + self, schedule_id: str, schedule: Union[_models.Schedule, JSON, IO[bytes]], **kwargs: Any ) -> _models.Schedule: """Create or update a schedule. @@ -17240,10 +17198,9 @@ def create_or_update( :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str - :param schedule: The resource instance. Is either a Schedule type or a IO[bytes] type. - Required. - :type schedule: ~azure.ai.projects.models.Schedule or ~azure.ai.projects.types.Schedule or - IO[bytes] + :param schedule: The resource instance. Is one of the following types: Schedule, JSON, + IO[bytes] Required. + :type schedule: ~azure.ai.projects.models.Schedule or JSON or IO[bytes] :return: Schedule. The Schedule is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Schedule :raises ~azure.core.exceptions.HttpResponseError: @@ -17487,7 +17444,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class BetaSkillsOperations: +class BetaSkillsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -17686,7 +17643,7 @@ def update( @overload def update( - self, name: str, body: _types.UpdateSkillRequest, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SkillDetails: """Update a skill. @@ -17695,7 +17652,7 @@ def update( :param name: The name of the skill to update. Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.UpdateSkillRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -17726,12 +17683,7 @@ def update( @distributed_trace def update( - self, - name: str, - body: Union[JSON, _types.UpdateSkillRequest, IO[bytes]] = _Unset, - *, - default_version: str = _Unset, - **kwargs: Any + self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, default_version: str = _Unset, **kwargs: Any ) -> _models.SkillDetails: """Update a skill. @@ -17739,8 +17691,8 @@ def update( :param name: The name of the skill to update. Required. :type name: str - :param body: Is one of the following types: JSON, UpdateSkillRequest, IO[bytes] Required. - :type body: JSON or ~azure.ai.projects.types.UpdateSkillRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword default_version: The version identifier that the skill should point to. When set, the skill's default version will resolve to this version instead of the latest. Required. :paramtype default_version: str @@ -17916,12 +17868,7 @@ def create( @overload def create( - self, - name: str, - body: _types.CreateSkillVersionRequest, - *, - content_type: str = "application/json", - **kwargs: Any + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SkillVersion: """Create a new version of a skill. @@ -17930,7 +17877,7 @@ def create( :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str :param body: Required. - :type body: ~azure.ai.projects.types.CreateSkillVersionRequest + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -17963,7 +17910,7 @@ def create( def create( self, name: str, - body: Union[JSON, _types.CreateSkillVersionRequest, IO[bytes]] = _Unset, + body: Union[JSON, IO[bytes]] = _Unset, *, inline_content: Optional[_models.SkillInlineContent] = None, default: Optional[bool] = None, @@ -17975,9 +17922,8 @@ def create( :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str - :param body: Is one of the following types: JSON, CreateSkillVersionRequest, IO[bytes] - Required. - :type body: JSON or ~azure.ai.projects.types.CreateSkillVersionRequest or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword inline_content: Inline skill content for simple skills without file uploads. Foundry-specific extension. Default value is None. :paramtype inline_content: ~azure.ai.projects.models.SkillInlineContent @@ -18073,9 +18019,7 @@ def create_from_files( """ @overload - def create_from_files( - self, name: str, content: _types.CreateSkillVersionFromFilesBody, **kwargs: Any - ) -> _models.SkillVersion: + def create_from_files(self, name: str, content: JSON, **kwargs: Any) -> _models.SkillVersion: """Create a skill version from uploaded files. Creates a new version of a skill from uploaded files via multipart form data. @@ -18083,7 +18027,7 @@ def create_from_files( :param name: The name of the skill. Required. :type name: str :param content: The multipart request content. Required. - :type content: ~azure.ai.projects.types.CreateSkillVersionFromFilesBody + :type content: JSON :return: SkillVersion. The SkillVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.SkillVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -18091,10 +18035,7 @@ def create_from_files( @distributed_trace def create_from_files( - self, - name: str, - content: Union[_models.CreateSkillVersionFromFilesBody, _types.CreateSkillVersionFromFilesBody], - **kwargs: Any + self, name: str, content: Union[_models.CreateSkillVersionFromFilesBody, JSON], **kwargs: Any ) -> _models.SkillVersion: """Create a skill version from uploaded files. @@ -18102,10 +18043,9 @@ def create_from_files( :param name: The name of the skill. Required. :type name: str - :param content: The multipart request content. Is one of the following types: - CreateSkillVersionFromFilesBody Required. - :type content: ~azure.ai.projects.models.CreateSkillVersionFromFilesBody or - ~azure.ai.projects.types.CreateSkillVersionFromFilesBody + :param content: The multipart request content. Is either a CreateSkillVersionFromFilesBody type + or a JSON type. Required. + :type content: ~azure.ai.projects.models.CreateSkillVersionFromFilesBody or JSON :return: SkillVersion. The SkillVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.SkillVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -18546,7 +18486,7 @@ def delete_version(self, name: str, version: str, **kwargs: Any) -> _models.Dele return deserialized # type: ignore -class BetaDatasetsOperations: +class BetaDatasetsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -18727,7 +18667,7 @@ def get_next(_continuation_token=None): def _create_generation_job_initial( self, - job: Union[_models.DataGenerationJob, _types.DataGenerationJob, IO[bytes]], + job: Union[_models.DataGenerationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -18826,19 +18766,14 @@ def begin_create_generation_job( @overload def begin_create_generation_job( - self, - job: _types.DataGenerationJob, - *, - operation_id: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any + self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.DataGenerationJobResult]: """Create a data generation job. Submits a new data generation job for asynchronous execution. :param job: The job to create. Required. - :type job: ~azure.ai.projects.types.DataGenerationJob + :type job: JSON :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -18881,7 +18816,7 @@ def begin_create_generation_job( @distributed_trace def begin_create_generation_job( self, - job: Union[_models.DataGenerationJob, _types.DataGenerationJob, IO[bytes]], + job: Union[_models.DataGenerationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -18890,10 +18825,9 @@ def begin_create_generation_job( Submits a new data generation job for asynchronous execution. - :param job: The job to create. Is either a DataGenerationJob type or a IO[bytes] type. - Required. - :type job: ~azure.ai.projects.models.DataGenerationJob or - ~azure.ai.projects.types.DataGenerationJob or IO[bytes] + :param job: The job to create. Is one of the following types: DataGenerationJob, JSON, + IO[bytes] Required. + :type job: ~azure.ai.projects.models.DataGenerationJob or JSON or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -19083,7 +19017,7 @@ def delete_generation_job( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore -class BetaAgentsOperations: +class BetaAgentsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -19102,7 +19036,7 @@ def __init__(self, *args, **kwargs) -> None: def _create_optimization_job_initial( self, - job: Union[_models.AgentOptimizationJob, _types.AgentOptimizationJob, IO[bytes]], + job: Union[_models.AgentOptimizationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -19202,12 +19136,7 @@ def begin_create_optimization_job( @overload def begin_create_optimization_job( - self, - job: _types.AgentOptimizationJob, - *, - operation_id: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any + self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.AgentOptimizationJobResult]: """Create an agent optimization job. @@ -19215,7 +19144,7 @@ def begin_create_optimization_job( retry. :param job: The job to create. Required. - :type job: ~azure.ai.projects.types.AgentOptimizationJob + :type job: JSON :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str @@ -19259,7 +19188,7 @@ def begin_create_optimization_job( @distributed_trace def begin_create_optimization_job( self, - job: Union[_models.AgentOptimizationJob, _types.AgentOptimizationJob, IO[bytes]], + job: Union[_models.AgentOptimizationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any @@ -19269,10 +19198,9 @@ def begin_create_optimization_job( Creates an optimization job and returns the queued job. Honors ``Operation-Id`` for idempotent retry. - :param job: The job to create. Is either a AgentOptimizationJob type or a IO[bytes] type. - Required. - :type job: ~azure.ai.projects.models.AgentOptimizationJob or - ~azure.ai.projects.types.AgentOptimizationJob or IO[bytes] + :param job: The job to create. Is one of the following types: AgentOptimizationJob, JSON, + IO[bytes] Required. + :type job: ~azure.ai.projects.models.AgentOptimizationJob or JSON or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py index b7580f63baa2..61650e1b1bfc 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py @@ -408,7 +408,7 @@ def generate_agent(self, body: _models.GenerateVoiceAgentRequest, **kwargs: Any) class BetaAgentsOperations(BetaAgentsOperationsGenerated): """Custom operations for beta agent optimization jobs.""" - @overload + @overload # type: ignore[override] def begin_create_optimization_job( self, job: _models.AgentOptimizationJob, @@ -439,7 +439,7 @@ def begin_create_optimization_job( ) -> AgentOptimizationLROPoller: ... @distributed_trace - def begin_create_optimization_job( + def begin_create_optimization_job( # type: ignore[reportIncompatibleMethodOverride, override] self, job: Union[_models.AgentOptimizationJob, _types.AgentOptimizationJob, IO[bytes]], *, @@ -468,7 +468,7 @@ def begin_create_optimization_job( raw_result = None if continuation_token is None: raw_result = self._create_optimization_job_initial( - job=job, + job=job, # type: ignore[reportArgumentType, arg-type] operation_id=operation_id, content_type=content_type, cls=lambda x, y, z: x, diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_datasets.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_datasets.py index df1da9920a5c..c4abadc89b48 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_datasets.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_datasets.py @@ -40,7 +40,7 @@ class BetaDatasetsOperations(BetaDatasetsOperationsGenerated): """Custom operations for beta data generation jobs.""" - @overload + @overload # type: ignore[override] def begin_create_generation_job( self, job: _models.DataGenerationJob, @@ -71,7 +71,7 @@ def begin_create_generation_job( ) -> DatasetGenerationLROPoller: ... @distributed_trace - def begin_create_generation_job( + def begin_create_generation_job( # type: ignore[reportIncompatibleMethodOverride, override] self, job: Union[_models.DataGenerationJob, _types.DataGenerationJob, IO[bytes]], *, @@ -100,7 +100,7 @@ def begin_create_generation_job( raw_result = None if continuation_token is None: raw_result = self._create_generation_job_initial( - job=job, + job=job, # type: ignore[reportArgumentType, arg-type] operation_id=operation_id, content_type=content_type, cls=lambda x, y, z: x, diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_evaluators.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_evaluators.py index 73815fcf08f0..843c34e9caf2 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_evaluators.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_evaluators.py @@ -21,7 +21,7 @@ class BetaEvaluatorsOperations(BetaEvaluatorsOperationsGenerated): """Custom operations for beta evaluator generation jobs.""" - @overload + @overload # type: ignore[override] def begin_create_generation_job( self, job: _models.EvaluatorGenerationJob, @@ -52,7 +52,7 @@ def begin_create_generation_job( ) -> EvaluatorGenerationLROPoller: ... @distributed_trace - def begin_create_generation_job( + def begin_create_generation_job( # type: ignore[reportIncompatibleMethodOverride, override] self, job: Union[_models.EvaluatorGenerationJob, _types.EvaluatorGenerationJob, IO[bytes]], *, @@ -81,7 +81,7 @@ def begin_create_generation_job( raw_result = None if continuation_token is None: raw_result = self._create_generation_job_initial( - job=job, + job=job, # type: ignore[reportArgumentType, arg-type] operation_id=operation_id, content_type=content_type, cls=lambda x, y, z: x, diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml.saved b/sdk/ai/azure-ai-projects/tsp-location.yaml.saved index c33c5ae1aab6..23af9b82b830 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml.saved +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml.saved @@ -1,5 +1,5 @@ directory: specification/ai-foundry/data-plane/Foundry/src/sdk-python-js-azure-ai-projects -commit: 28f4aa282161f8a6ab91813a51d287ddb762e7d2 +commit: 8692ffec0e4da99a2a8697f6394e321e07b1ec8b repo: Azure/azure-rest-api-specs additionalDirectories: - specification/ai-foundry/data-plane/Foundry/src/agents From b681c71c759aa946d481784b44ed350f6df3574f Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Mon, 31 Aug 2026 20:49:03 -0700 Subject: [PATCH 41/56] Regenerate azure-ai-projects from TypeSpec commit 2e1e4f1d, add agent insights/Microsoft365 publishing, fix beta operation-group restructure - Regenerate SDK from azure-rest-api-specs commit 2e1e4f1d8a43ce114b3a3532d25a34fe1c2fa915 (voice-agent helper-type Voice*->VoiceAgent* rename pass, new agent-insights and agents-microsoft365 TypeSpec directories); update tsp-location.yaml.saved accordingly. - Delete stale types.py (dead TypedDict mirror under generate-typeddict: false that never reflected current models); retype its 6 dependent _patch_*.py overloads to use the generated JSON alias instead. Automate this deletion in PostEmitter.ps1 going forward. - Fix recurring _unions.py forward-ref bug for VoiceAgentSessionResponse/Update in models/_models.py, now automated as a PostEmitter.ps1 fixup. - Update _realtime.py/aio/_realtime.py and affected samples/tests for the Voice*-> VoiceAgent*/Realtime* rename pass and removed message-item classes (now sent as raw dicts). - Handle agent_endpoint_conversations and voice_agent_web_socket moving from top-level client attributes to nested .beta sub-clients upstream, and the new agent_insight_monitors beta sub-client: - Add agent_endpoint_conversations/agent_insight_monitors to _BETA_OPERATION_FEATURE_HEADERS so they get Foundry-Features header injection via the existing generic mechanism. - Remove now-dead top-level header-injection code in _patch.py/aio/_patch.py; fix the accept-encoding-identity workaround to target the new self.beta location (with a hasattr(self, "beta") guard for tests that mock out the generated __init__ - caught by running the full test suite). - Relocate the voice_agent_web_socket hide-from-public-surface PostEmitter.ps1 fixup. - Update 5 samples' client.agent_endpoint_conversations -> client.beta.agent_endpoint_conversations. - Update foundry_features_header tests; retire the now-redundant dedicated agent_endpoint_conversations header tests in favor of the generic beta-operations discovery test, which now covers it (and agent_insight_monitors) automatically. - Update docs/public-methods.md (cross-checked against runtime reality) and CHANGELOG.md. - Regenerate api.md/api.metadata.yml. - Validated: full test suite (826 passed, 105 skipped, 4 pre-existing unrelated failures from missing test recordings), plus all 11 voice-agent samples run live end-to-end. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- sdk/ai/azure-ai-projects/CHANGELOG.md | 13 +- sdk/ai/azure-ai-projects/PostEmitter.ps1 | 66 +- sdk/ai/azure-ai-projects/api.md | 19513 ++++------- sdk/ai/azure-ai-projects/api.metadata.yml | 6 +- .../azure-ai-projects/apiview-properties.json | 283 +- .../azure/ai/projects/_client.py | 7 - .../azure/ai/projects/_patch.py | 16 +- .../azure/ai/projects/_realtime.py | 241 +- .../azure/ai/projects/_unions.py | 23 +- .../azure/ai/projects/aio/_client.py | 7 - .../azure/ai/projects/aio/_patch.py | 26 +- .../azure/ai/projects/aio/_realtime.py | 241 +- .../ai/projects/aio/operations/__init__.py | 4 - .../ai/projects/aio/operations/_operations.py | 6499 ++-- .../ai/projects/aio/operations/_patch.py | 6 + .../aio/operations/_patch_agents_async.py | 8 +- .../aio/operations/_patch_datasets_async.py | 9 +- .../aio/operations/_patch_evaluators_async.py | 10 +- .../azure/ai/projects/models/__init__.py | 442 +- .../azure/ai/projects/models/_enums.py | 436 +- .../azure/ai/projects/models/_models.py | 28054 ++++++++-------- .../azure/ai/projects/models/_patch.py | 5 + .../azure/ai/projects/operations/__init__.py | 4 - .../ai/projects/operations/_operations.py | 11991 ++++--- .../azure/ai/projects/operations/_patch.py | 6 + .../ai/projects/operations/_patch_agents.py | 8 +- .../ai/projects/operations/_patch_datasets.py | 9 +- .../projects/operations/_patch_evaluators.py | 10 +- .../azure/ai/projects/types.py | 12282 ------- .../azure-ai-projects/docs/public-methods.md | 54 +- .../agents/voice/sample_voice_agent_basic.py | 8 +- ...ice_agent_live_audio_conversation_async.py | 28 +- .../sample_voice_agent_live_function_tool.py | 26 +- ...mple_voice_agent_live_text_conversation.py | 37 +- ...oice_agent_live_text_conversation_async.py | 37 +- .../sample_voice_agent_read_conversation.py | 4 +- ...ple_voice_agent_read_conversation_audio.py | 8 +- .../voice/sample_voice_agent_with_tools.py | 37 +- ...est_responses_instrumentor_raw_response.py | 1 - .../tests/agents/test_voice_agent_crud.py | 14 +- .../agents/test_voice_agent_crud_async.py | 14 +- .../foundry_features_header_test_base.py | 30 +- ..._header_on_agent_endpoint_conversations.py | 136 - ...r_on_agent_endpoint_conversations_async.py | 142 - .../azure-ai-projects/tsp-location.yaml.saved | 4 +- 45 files changed, 34278 insertions(+), 46527 deletions(-) delete mode 100644 sdk/ai/azure-ai-projects/azure/ai/projects/types.py delete mode 100644 sdk/ai/azure-ai-projects/tests/foundry_features_header/test_foundry_features_header_on_agent_endpoint_conversations.py delete mode 100644 sdk/ai/azure-ai-projects/tests/foundry_features_header/test_foundry_features_header_on_agent_endpoint_conversations_async.py diff --git a/sdk/ai/azure-ai-projects/CHANGELOG.md b/sdk/ai/azure-ai-projects/CHANGELOG.md index 61b6158ea22c..f1dd18498713 100644 --- a/sdk/ai/azure-ai-projects/CHANGELOG.md +++ b/sdk/ai/azure-ai-projects/CHANGELOG.md @@ -5,12 +5,19 @@ ### Features Added * Added voice agents, unified with the rest of the Agents API as a new `kind="voice"` on `AgentDefinition`: - * Define a voice agent with `VoiceAgentDefinition`, configuring its model (`VoiceModelType`), audio input/output (`VoiceAudioConfig`, `VoiceAudioInputConfig`, `VoiceAudioOutputConfig`), turn detection (`VoiceTurnDetection` and its `VoiceServerVadTurnDetection` / `VoiceSemanticVadTurnDetection` / `VoiceAzureSemanticVadTurnDetection` variants), greeting (`VoiceGreetingConfig`), tools (`VoiceAgentTool`, `VoiceAgentFunctionTool`, `VoiceAgentMcpTool`, `VoiceToolboxTool`), and avatar (`VoiceAvatarConfig`). Manage it like any other agent through `project_client.agents` (`create_version`, `get`, `list`, `disable`/`enable`, `delete`). + * Define a voice agent with `VoiceAgentDefinition`, configuring its model (`VoiceModelType`), audio input/output (`VoiceAgentAudioConfig`, `VoiceAgentAudioInputConfig`, `VoiceAgentAudioOutputConfig`), turn detection (`VoiceAgentTurnDetectionConfig` and its `VoiceAgentServerVadTurnDetection` / `VoiceAgentAzureSemanticVadTurnDetection` / `VoiceAgentAzureSemanticVadEnTurnDetection` / `VoiceAgentAzureSemanticVadMultilingualTurnDetection` variants), greeting (`VoiceAgentGreetingConfig` and its `VoiceAgentTemplateGreetingConfig` / `VoiceAgentLlmGeneratedGreetingConfig` variants), tools (`VoiceAgentTool`, `VoiceAgentFunctionTool`, `VoiceAgentMcpTool`, `VoiceAgentSystemTool`, `VoiceAgentToolboxTool`), and avatar (`VoiceAgentAvatarConfig`). Manage it like any other agent through `project_client.agents` (`create_version`, `get`, `list`, `disable`/`enable`, `delete`). * Added guided authoring via `project_client.agents.generate_agent(GenerateVoiceAgentRequest(kind=AgentKind.VOICE, ...))`, which returns a service-generated starter definition that can be edited afterward through the standard `create_version`/`update` flow. - * Added a new `client.realtime` / `async_client.realtime` entry point for realtime speech-to-speech streaming. Use `with client.realtime.connect(agent_name=...) as connection:` to open a WebSocket connection, `connection.send(...)` to send strongly-typed client events (or use the `connection.response`, `connection.item`, and `connection.session` helpers), and iterate over `connection` to receive strongly-typed server events (`VoiceAgentServerEvent*`, `RealtimeServerEvent*`). The new types `Realtime`, `RealtimeConnection`, and `RealtimeConnectionManager` (and their async equivalents `AsyncRealtime`, `AsyncRealtimeConnection`, `AsyncRealtimeConnectionManager`) are exported from `azure.ai.projects` / `azure.ai.projects.aio`. Requires the optional `websockets` package. - * Added the `agent_endpoint_conversations` operation group for reading back persisted voice-agent conversation transcripts and audio, for agents created with `store=True`. + * Added a new `client.realtime` / `async_client.realtime` entry point for realtime speech-to-speech streaming. Use `with client.realtime.connect(agent_name=...) as connection:` to open a WebSocket connection, `connection.send(...)` to send strongly-typed client events (or use the `connection.response`, `connection.item`, and `connection.session` helpers), and iterate over `connection` to receive strongly-typed server events (`RealtimeServerEvent*`). Conversation items exchanged with `connection.conversation.item.create(...)` are `RealtimeConversationItemFunctionCall`, `RealtimeConversationItemFunctionCallOutput`, `RealtimeMCPApprovalResponse`, or a raw `Mapping[str, Any]` for message-type (system/user/assistant) items, which do not have dedicated generated models in this API version. The new types `Realtime`, `RealtimeConnection`, and `RealtimeConnectionManager` (and their async equivalents `AsyncRealtime`, `AsyncRealtimeConnection`, `AsyncRealtimeConnectionManager`) are exported from `azure.ai.projects` / `azure.ai.projects.aio`. Requires the optional `websockets` package. + * Added the `beta.agent_endpoint_conversations` operation group for reading back persisted voice-agent conversation transcripts and audio, for agents created with `store=True`. * Added the underlying `RealtimeConversationItem*`, `RealtimeMCP*`, `RealtimeResponseUsage`, and related realtime event/session models used by the voice agent WebSocket protocol. * Added 11 new samples under `samples/agents/voice/`, covering basic agent lifecycle, guided generation, live audio and text conversations (sync and async), function tools, versioning, and reading back conversation transcripts and audio. +* Added Microsoft 365 agent publishing: + * `project_client.agents.publish_to_microsoft365(agent_name, publish_scope=...)` publishes a Foundry agent to Microsoft 365 / Microsoft Teams and returns a `Microsoft365PublishResult`. + * `project_client.agents.get_microsoft365_publish_defaults(agent_name)` returns default and previously-published values (`Microsoft365PublishDefaults`) used to pre-populate a publish request. + * `project_client.agents.get_microsoft365_package(agent_name)` downloads the Microsoft 365 app package for an agent. + * Added the supporting `Microsoft365PublishScope`, `Microsoft365PermissionScopes`, `ActivityProtocolAccessBoundary`, `PublishApprovalStatus`, and `DigitalWorkerType` enums. +* Added the `beta.agent_insight_monitors` operation group for creating and managing Agent Insights monitors and their runs (`create`/`get`/`update`/`delete`/`list`/`reset`, `begin_create_run`/`get_run`/`cancel_run`/`list_runs`, `get_insight`/`update_insight`/`list_insights`), along with the supporting `AgentInsightMonitor`, `AgentInsightMonitorCreate`, `AgentInsightMonitorUpdate`, `AgentInsightMonitorListItem`, `AgentInsightRun`, `AgentInsight`, and related models. +* Added an optional `authorization` parameter (`RoutineAuthorization`, `RoutineDispatchIdentity`) to `beta.routines.dispatch`. ### Dependency update diff --git a/sdk/ai/azure-ai-projects/PostEmitter.ps1 b/sdk/ai/azure-ai-projects/PostEmitter.ps1 index 233f4ffb6fcf..62ebc99f8f95 100644 --- a/sdk/ai/azure-ai-projects/PostEmitter.ps1 +++ b/sdk/ai/azure-ai-projects/PostEmitter.ps1 @@ -26,11 +26,29 @@ git restore pyproject.toml # recursive-include samples *.py *.md git restore MANIFEST.in -# Remove the generated `voice_agent_web_socket` operation group from the client's public surface -# entirely (import, docstring, and __init__ assignment). The generated operation only performs a -# plain HTTP GET (no WebSocket upgrade handshake) and discards the connection - it's not a usable -# client and was never meant to be public (the real voice-agent WebSocket client is `.realtime`). -$files = 'azure\ai\projects\_client.py', 'azure\ai\projects\aio\_client.py' +# `types.py` is a dead artifact of the `generate-typeddict: false` tspconfig setting: the emitter +# still rewrites this file's mtime on every run, but its TypedDict content has been byte-for-byte +# frozen/stale since the very first regeneration of this package, regardless of how much the spec's +# models have changed since (confirmed via `git diff --quiet` across multiple TypeSpec commits with +# substantial, unrelated model renames). Delete it outright rather than let it silently ship stale, +# misleading type shapes. The small number of hand-written call sites that referenced it +# (`_patch_agents.py`, `_patch_datasets.py`, `_patch_evaluators.py`, and their aio counterparts) +# now use the emitter's own `JSON` (= MutableMapping[str, Any]) alias instead, matching the same +# "raw JSON body" overload pattern the generated `_operations.py` already uses for these same jobs. +$typesFile = 'azure\ai\projects\types.py' +if (Test-Path $typesFile) { + Remove-Item $typesFile -Force +} + +# Remove the generated `voice_agent_web_socket` operation group from the public surface entirely. +# The generated operation only performs a plain HTTP GET (no WebSocket upgrade handshake) and +# discards the connection - it's not a usable client and was never meant to be public (the real +# voice-agent WebSocket client is `.realtime`). This operation group has moved around in the +# generated output across regenerations (previously wired directly on the top-level client as +# `VoiceAgentWebSocketOperations`; now nested as `BetaVoiceAgentWebSocketOperations` under +# `BetaOperations.__init__` in `_operations.py`) - this fixup targets wherever it currently lives, +# matching either class name, so it keeps working if the spec relocates it again. +$files = 'azure\ai\projects\_client.py', 'azure\ai\projects\aio\_client.py', 'azure\ai\projects\operations\_operations.py', 'azure\ai\projects\aio\operations\_operations.py' foreach ($f in $files) { $lines = Get-Content $f $out = New-Object System.Collections.Generic.List[string] @@ -43,7 +61,7 @@ foreach ($f in $files) { if ($line -match '^\s*VoiceAgentWebSocketOperations,\s*$') { continue } if ($line -match '^\s*:ivar voice_agent_web_socket:') { continue } if ($line -match '^\s*:vartype voice_agent_web_socket:') { continue } - if ($line -match '^\s*self\.voice_agent_web_socket = VoiceAgentWebSocketOperations\(\s*$') { + if ($line -match '^\s*self\.voice_agent_web_socket = (Beta)?VoiceAgentWebSocketOperations\(\s*$') { $skipUntilCloseParen = $true continue } @@ -152,7 +170,10 @@ $newVoiceAudioOutputConfig = @' `format` and `output_audio_timestamp_types` apply to every voice type. '@ -$files = 'azure\ai\projects\types.py', 'azure\ai\projects\models\_models.py' +# NOTE: `types.py` used to be listed here too, but it is now deleted outright (see the fixup +# above) before this point would matter, since its TypedDict mirror of this same class no +# longer exists as a file at all. +$files = 'azure\ai\projects\models\_models.py' foreach ($f in $files) { $c = Get-Content $f -Raw $c = $c.Replace($oldVoiceAudioOutputConfig, $newVoiceAudioOutputConfig) @@ -332,12 +353,14 @@ $c = Get-Content $f -Raw $c = $c.Replace($oldPatternAsync, $newPatternAsync) Set-Content $f $c -NoNewline -# VoiceResponse narrows OmitPropertiesRealtimeResponse's optional `id`/`conversation_id` -# (Optional[str]) to required `str`, per the TypeSpec spec's explicit "Required." docstrings -- -# an intentional Azure-specific tightening of OpenAI's generic realtime response template (a -# persisted voice response always has both set). Pyright's reportIncompatibleVariableOverride -# flags this because narrowing a *mutable* attribute's type in a subclass isn't sound in general, -# but it's safe here by construction (the service never omits these for a persisted response). +# VoiceResponse (formerly OmitPropertiesRealtimeResponse before an upstream TypeSpec rename) narrows +# its base class VoiceResponseBase's optional `id`/`conversation_id` (Optional[str]) to required +# `str`, per the TypeSpec spec's explicit "Required." docstrings -- an intentional Azure-specific +# tightening of OpenAI's generic realtime response template (a persisted voice response always has +# both set). Pyright's reportIncompatibleVariableOverride flags this because narrowing a *mutable* +# attribute's type in a subclass isn't sound in general, but it's safe here by construction (the +# service never omits these for a persisted response). This substitution matches on the field +# pattern itself (not the class name), so it keeps working across upstream class renames. # NOTE: uses -replace with a \r?\n-tolerant regex (not .Replace() with a literal `n), since `n # always resolves to a bare LF and can never match this file's real CRLF line endings -- the # $1/$2 replacement backreferences preserve whatever newline the regex actually matched. @@ -347,6 +370,23 @@ $c = $c -replace '(id: str = rest_field\(visibility=\["read", "create", "update" $c = $c -replace '(conversation_id: str = rest_field\(visibility=\["read", "create", "update", "delete", "query"\]\))(\r?\n """The id of the conversation this response belongs to\. Required\.""")', '$1 # type: ignore[reportIncompatibleVariableOverride]$2' Set-Content $f $c -NoNewline +# VoiceAgentSessionResponse/VoiceAgentSessionUpdate are single-member unions in TypeSpec (only +# VoiceAgentSessionResponseConfig / VoiceAgentSessionUpdateConfig respectively so far), hitting the +# exact same emitter bug as the GenerateAgentRequest case just above: a single-member union is +# recorded in `_unions.py` as a bare forward-reference *string* (e.g. +# `VoiceAgentSessionResponse = "_models.VoiceAgentSessionResponseConfig"`) rather than a real type +# alias, since `Union[X]` collapses to `X` and the emitter's union-alias codegen path isn't taken. +# Every place in `_models.py` that types a field/parameter as `"_unions.VoiceAgentSessionResponse"` +# or `"_unions.VoiceAgentSessionUpdate"` is therefore an invalid forward reference for mypy/pyright +# (`_unions.py`'s `VoiceAgentSessionResponse`/`VoiceAgentSessionUpdate` are plain `str` values at +# runtime, not resolvable types) -- a `[valid-type]` error every round. Fix by pointing the forward +# reference directly at the concrete model instead of routing through `_unions.py`. +$f = 'azure\ai\projects\models\_models.py' +$c = Get-Content $f -Raw +$c = $c.Replace('"_unions.VoiceAgentSessionResponse"', '"_models.VoiceAgentSessionResponseConfig"') +$c = $c.Replace('"_unions.VoiceAgentSessionUpdate"', '"_models.VoiceAgentSessionUpdateConfig"') +Set-Content $f $c -NoNewline + # Finishing by running 'black' tool to format code. pip install black black --config ../../../eng/black-pyproject.toml . diff --git a/sdk/ai/azure-ai-projects/api.md b/sdk/ai/azure-ai-projects/api.md index 6fb0a677b9df..6a3dd90670ea 100644 --- a/sdk/ai/azure-ai-projects/api.md +++ b/sdk/ai/azure-ai-projects/api.md @@ -221,131 +221,6 @@ namespace azure.ai.projects.aio namespace azure.ai.projects.aio.operations - class azure.ai.projects.aio.operations.AgentEndpointConversationsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @distributed_trace_async - async def delete_agent_conversation( - self, - agent_name: str, - conversation_id: str, - **kwargs: Any - ) -> None: ... - - @distributed_trace_async - async def get_agent_conversation( - self, - agent_name: str, - conversation_id: str, - **kwargs: Any - ) -> VoiceConversation: ... - - @distributed_trace_async - async def get_agent_conversation_audio( - self, - agent_name: str, - conversation_id: str, - **kwargs: Any - ) -> VoiceRecordingResponse: ... - - @distributed_trace_async - async def get_agent_conversation_audio_content( - self, - agent_name: str, - conversation_id: str, - **kwargs: Any - ) -> AsyncIterator[bytes]: ... - - @distributed_trace_async - async def get_agent_conversation_item( - self, - agent_name: str, - conversation_id: str, - item_id: str, - **kwargs: Any - ) -> VoiceConversationItem: ... - - @distributed_trace_async - async def get_agent_conversation_item_audio( - self, - agent_name: str, - conversation_id: str, - item_id: str, - **kwargs: Any - ) -> VoiceItemAudioResponse: ... - - @distributed_trace_async - async def get_agent_conversation_item_audio_content( - self, - agent_name: str, - conversation_id: str, - item_id: str, - **kwargs: Any - ) -> AsyncIterator[bytes]: ... - - @distributed_trace_async - async def get_agent_conversation_response( - self, - agent_name: str, - conversation_id: str, - response_id: str, - **kwargs: Any - ) -> VoiceResponse: ... - - @distributed_trace - def list_agent_conversation_items( - self, - agent_name: str, - conversation_id: str, - *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> AsyncItemPaged[VoiceConversationItem]: ... - - @distributed_trace - def list_agent_conversation_response_items( - self, - agent_name: str, - conversation_id: str, - response_id: str, - *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> AsyncItemPaged[VoiceConversationItem]: ... - - @distributed_trace - def list_agent_conversation_responses( - self, - agent_name: str, - conversation_id: str, - *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> AsyncItemPaged[VoiceResponse]: ... - - @distributed_trace - def list_agent_conversations( - self, - agent_name: str, - *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> AsyncItemPaged[VoiceConversation]: ... - - class azure.ai.projects.aio.operations.AgentsOperations(GeneratedAgentsOperations): def __init__( @@ -536,39 +411,73 @@ namespace azure.ai.projects.aio.operations **kwargs: Any ) -> None: ... - @overload + @distributed_trace_async async def generate_agent( self, + body: GenerateVoiceAgentRequest, + **kwargs: Any + ) -> AgentDetails: ... + + @distributed_trace_async + async def get( + self, + agent_name: str, + **kwargs: Any + ) -> AgentDetails: ... + + @overload + async def get_microsoft365_package( + self, + agent_name: str, *, + access_boundaries: Optional[List[Union[str, ActivityProtocolAccessBoundary]]] = ..., + agent_display_name: Optional[str] = ..., + app_version: Optional[str] = ..., + bot_service_arm_id: Optional[str] = ..., + can_respond_without_mention: Optional[bool] = ..., + color_icon_base64: Optional[str] = ..., content_type: str = "application/json", - kind: Union[str, AgentKind], + developer_name: Optional[str] = ..., + developer_website_url: Optional[str] = ..., + full_description: Optional[str] = ..., + optional_permission_scopes: Optional[List[Microsoft365PermissionScopes]] = ..., + outline_icon_base64: Optional[str] = ..., + privacy_url: Optional[str] = ..., + publish_as_autopilot: Optional[bool] = ..., + publish_scope: Union[str, Microsoft365PublishScope], + short_description: Optional[str] = ..., + terms_of_use_url: Optional[str] = ..., **kwargs: Any - ) -> AgentDetails: ... + ) -> AsyncIterator[bytes]: ... @overload - async def generate_agent( + async def get_microsoft365_package( self, + agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AgentDetails: ... + ) -> AsyncIterator[bytes]: ... @overload - async def generate_agent( + async def get_microsoft365_package( self, + agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AgentDetails: ... + ) -> AsyncIterator[bytes]: ... @distributed_trace_async - async def get( + async def get_microsoft365_publish_defaults( self, agent_name: str, + *, + publish_as_digital_worker: Optional[bool] = ..., **kwargs: Any - ) -> AgentDetails: ... + ) -> Microsoft365PublishDefaults: ... @distributed_trace_async async def get_session( @@ -642,6 +551,51 @@ namespace azure.ai.projects.aio.operations **kwargs: Any ) -> AsyncItemPaged[AgentVersionDetails]: ... + @overload + async def publish_to_microsoft365( + self, + agent_name: str, + *, + access_boundaries: Optional[List[Union[str, ActivityProtocolAccessBoundary]]] = ..., + agent_display_name: Optional[str] = ..., + app_version: Optional[str] = ..., + bot_service_arm_id: Optional[str] = ..., + can_respond_without_mention: Optional[bool] = ..., + color_icon_base64: Optional[str] = ..., + content_type: str = "application/json", + developer_name: Optional[str] = ..., + developer_website_url: Optional[str] = ..., + full_description: Optional[str] = ..., + optional_permission_scopes: Optional[List[Microsoft365PermissionScopes]] = ..., + outline_icon_base64: Optional[str] = ..., + privacy_url: Optional[str] = ..., + publish_as_autopilot: Optional[bool] = ..., + publish_scope: Union[str, Microsoft365PublishScope], + short_description: Optional[str] = ..., + terms_of_use_url: Optional[str] = ..., + **kwargs: Any + ) -> Microsoft365PublishResult: ... + + @overload + async def publish_to_microsoft365( + self, + agent_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Microsoft365PublishResult: ... + + @overload + async def publish_to_microsoft365( + self, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Microsoft365PublishResult: ... + @distributed_trace_async async def stop_session( self, @@ -1746,6 +1700,8 @@ namespace azure.ai.projects.aio.operations class azure.ai.projects.aio.operations.BetaOperations(GeneratedBetaOperations): + agent_endpoint_conversations: BetaAgentEndpointConversationsOperations + agent_insight_monitors: BetaAgentInsightMonitorsOperations agents: BetaAgentsOperations datasets: BetaDatasetsOperations evaluation_taxonomies: BetaEvaluationTaxonomiesOperations @@ -1825,6 +1781,7 @@ namespace azure.ai.projects.aio.operations routine_name: str, *, action: Optional[RoutineAction] = ..., + authorization: Optional[RoutineAuthorization] = ..., content_type: str = "application/json", description: Optional[str] = ..., enabled: Optional[bool] = ..., @@ -2622,28 +2579,6 @@ namespace azure.ai.projects.aio.operations ) -> ToolboxObject: ... - class azure.ai.projects.aio.operations.VoiceAgentWebSocketOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @distributed_trace_async - async def connect_voice_agent( - self, - agent_name: str, - *, - agent_session_id: Optional[str] = ..., - agent_version_override: Optional[str] = ..., - store: Optional[bool] = ..., - structured_inputs: Optional[str] = ..., - websocket_subprotocol: Optional[Union[str, VoiceAgentWebSocketSubprotocol]] = ..., - **kwargs: Any - ) -> None: ... - - namespace azure.ai.projects.models class azure.ai.projects.models.A2APreviewTool(Tool, discriminator='a2a_preview'): @@ -2777,7 +2712,29 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.ActivityProtocolAccessBoundary(str, Enum, metaclass=CaseInsensitiveEnumMeta): + READ1_ON1_ALLOWLISTED = "read.1on1.allowlisted" + READ1_ON1_DEVELOPERS = "read.1on1.developers" + READ1_ON1_MANAGER = "read.1on1.manager" + READ1_ON1_TENANT = "read.1on1.tenant" + READ_GROUP_ALLOWLISTED = "read.group.allowlisted" + READ_GROUP_DEVELOPERS = "read.group.developers" + READ_GROUP_MANAGER_INVITED = "read.group.manager-invited" + READ_GROUP_MANAGER_PRESENT = "read.group.manager-present" + READ_GROUP_TENANT = "read.group.tenant" + WRITE1_ON1_ALLOWLISTED = "write.1on1.allowlisted" + WRITE1_ON1_DEVELOPERS = "write.1on1.developers" + WRITE1_ON1_MANAGER = "write.1on1.manager" + WRITE1_ON1_TENANT = "write.1on1.tenant" + WRITE_GROUP_ALLOWLISTED = "write.group.allowlisted" + WRITE_GROUP_DEVELOPERS = "write.group.developers" + WRITE_GROUP_MANAGER_INVITED = "write.group.manager-invited" + WRITE_GROUP_MANAGER_PRESENT = "write.group.manager-present" + WRITE_GROUP_TENANT = "write.group.tenant" + + class azure.ai.projects.models.ActivityProtocolConfiguration(_Model): + access_boundaries: Optional[list[Union[str, ActivityProtocolAccessBoundary]]] enable_m365_public_endpoint: Optional[bool] @overload @@ -2921,6 +2878,7 @@ namespace azure.ai.projects.models agent_endpoint: Optional[AgentEndpointConfig] blueprint: Optional[AgentIdentity] blueprint_reference: Optional[AgentBlueprintReference] + digital_worker_type: Optional[Union[str, DigitalWorkerType]] id: str instance_identity: Optional[AgentIdentity] name: str @@ -2935,6 +2893,7 @@ namespace azure.ai.projects.models *, agent_card: Optional[AgentCard] = ..., agent_endpoint: Optional[AgentEndpointConfig] = ..., + digital_worker_type: Optional[Union[str, DigitalWorkerType]] = ..., id: str, name: str, object: Literal[AgentObjectType.AGENT], @@ -2969,6 +2928,7 @@ namespace azure.ai.projects.models class azure.ai.projects.models.AgentEndpointConfig(_Model): authorization_schemes: Optional[list[AgentEndpointAuthorizationScheme]] protocol_configuration: Optional[ProtocolConfiguration] + publish_approval_status: Optional[Union[str, PublishApprovalStatus]] version_selector: Optional[VersionSelector] @overload @@ -3036,1108 +2996,1138 @@ namespace azure.ai.projects.models DISABLED = "disabled" - class azure.ai.projects.models.AgentKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - EXTERNAL = "external" - HOSTED = "hosted" - PROMPT = "prompt" - VOICE = "voice" - WORKFLOW = "workflow" - - - class azure.ai.projects.models.AgentObjectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENT = "agent" - AGENT_CONTAINER = "agent.container" - AGENT_DELETED = "agent.deleted" - AGENT_VERSION = "agent.version" - AGENT_VERSION_DELETED = "agent.version.deleted" + class azure.ai.projects.models.AgentInsight(_Model): + agent_name: str + agent_version: str + category: str + created_at: datetime + description: str + details: Optional[AgentInsightDetails] + id: str + monitor_id: str + severity: Union[str, AgentInsightSeverity] + status: Union[str, AgentInsightStatus] + title: str + trace_count: int + updated_at: datetime - class azure.ai.projects.models.AgentObjectVersions(_Model): - latest: AgentVersionDetails + class azure.ai.projects.models.AgentInsightDetails(_Model): + highlighted_traces: list[AgentInsightHighlightedTrace] + linked_traces: list[AgentInsightLinkedTrace] + recommended_actions: AgentInsightRecommendedAction @overload def __init__( self, *, - latest: AgentVersionDetails + highlighted_traces: list[AgentInsightHighlightedTrace], + linked_traces: list[AgentInsightLinkedTrace], + recommended_actions: AgentInsightRecommendedAction ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentOptimizationCandidate(_Model): - avg_score: float - avg_tokens: float - candidate_id: Optional[str] - eval_id: Optional[str] - eval_run_id: Optional[str] - mutations: Optional[dict[str, Any]] - name: str - promotion: Optional[PromotionInfo] + class azure.ai.projects.models.AgentInsightEstimatedCost(_Model): + amount: float + currency: Literal["USD"] @overload def __init__( self, *, - avg_score: float, - avg_tokens: float, - candidate_id: Optional[str] = ..., - eval_id: Optional[str] = ..., - eval_run_id: Optional[str] = ..., - mutations: Optional[dict[str, Any]] = ..., - name: str, - promotion: Optional[PromotionInfo] = ... + amount: float ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentOptimizationDatasetCriterion(_Model): - instruction: str - name: str + class azure.ai.projects.models.AgentInsightHighlightedTrace(_Model): + duration_ms: timedelta + summary: str + timestamp: datetime + total_tokens: Optional[int] + trace_id: str @overload def __init__( self, *, - instruction: str, - name: str + duration_ms: timedelta, + summary: str, + timestamp: datetime, + total_tokens: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentOptimizationDatasetInput(_Model): - type: str + class azure.ai.projects.models.AgentInsightLinkedTrace(_Model): + timestamp: datetime + trace_id: str + + + class azure.ai.projects.models.AgentInsightMonitor(_Model): + agent_name: str + enabled: bool + estimated_cost: Optional[AgentInsightEstimatedCost] + id: str + model_deployment_name: str + next_scheduled_run_at: Optional[datetime] + overview: AgentInsightsOverview + run_interval_hours: float + suspension: AgentInsightSuspension + updated_at: datetime + + + class azure.ai.projects.models.AgentInsightMonitorCreate(_Model): + agent_name: str + enabled: Optional[bool] + model_deployment_name: str + run_interval_hours: Optional[float] @overload def __init__( self, *, - type: str + agent_name: str, + enabled: Optional[bool] = ..., + model_deployment_name: str, + run_interval_hours: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentOptimizationDatasetInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - INLINE = "inline" - REFERENCE = "reference" + class azure.ai.projects.models.AgentInsightMonitorListItem(_Model): + agent_name: str + enabled: bool + estimated_cost: Optional[AgentInsightEstimatedCost] + id: str + model_deployment_name: str + next_scheduled_run_at: Optional[datetime] + run_interval_hours: float + suspension: AgentInsightSuspension + updated_at: datetime - class azure.ai.projects.models.AgentOptimizationDatasetItem(_Model): - criteria: Optional[list[AgentOptimizationDatasetCriterion]] - desired_num_turns: Optional[int] - ground_truth: Optional[str] - query: Optional[str] + class azure.ai.projects.models.AgentInsightMonitorUpdate(_Model): + enabled: Optional[bool] + model_deployment_name: Optional[str] + overview_override: Optional[AgentInsightsOverviewOverride] + run_interval_hours: Optional[float] @overload def __init__( self, *, - criteria: Optional[list[AgentOptimizationDatasetCriterion]] = ..., - desired_num_turns: Optional[int] = ..., - ground_truth: Optional[str] = ..., - query: Optional[str] = ... + enabled: Optional[bool] = ..., + model_deployment_name: Optional[str] = ..., + overview_override: Optional[AgentInsightsOverviewOverride] = ..., + run_interval_hours: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentOptimizationEvaluatorRef(_Model): - name: str - version: Optional[str] + class azure.ai.projects.models.AgentInsightOverviewSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + GENERATED = "generated" + USER_OVERRIDE = "user_override" - @overload - def __init__( - self, - *, - name: str, - version: Optional[str] = ... - ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.AgentInsightPromptSurface(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INSTRUCTIONS = "instructions" + TOOL = "tool" - class azure.ai.projects.models.AgentOptimizationInlineDatasetInput(AgentOptimizationDatasetInput, discriminator='inline'): - dataset_items: list[AgentOptimizationDatasetItem] - type: Literal[AgentOptimizationDatasetInputType.INLINE] + class azure.ai.projects.models.AgentInsightProposedFix(_Model): + changes: Optional[list[AgentInsightProposedFixChange]] + kind: Union[str, AgentInsightProposedFixKind] + text: str @overload def __init__( self, *, - dataset_items: list[AgentOptimizationDatasetItem] + changes: Optional[list[AgentInsightProposedFixChange]] = ..., + kind: Union[str, AgentInsightProposedFixKind], + text: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentOptimizationJob(_Model): - created_at: datetime - error: Optional[ApiError] - id: str - inputs: Optional[AgentOptimizationJobInputs] - progress: Optional[AgentOptimizationJobProgress] - result: Optional[AgentOptimizationJobResult] - status: Union[str, JobStatus] - updated_at: datetime - warnings: Optional[list[str]] + class azure.ai.projects.models.AgentInsightProposedFixChange(_Model): + diff: Optional[str] + language: Optional[str] + new_value: Optional[Any] + old_value: Optional[Any] + path: Optional[str] + surface: Optional[Union[str, AgentInsightPromptSurface]] + target: Optional[str] @overload def __init__( self, *, - inputs: Optional[AgentOptimizationJobInputs] = ... + diff: Optional[str] = ..., + language: Optional[str] = ..., + new_value: Optional[Any] = ..., + old_value: Optional[Any] = ..., + path: Optional[str] = ..., + surface: Optional[Union[str, AgentInsightPromptSurface]] = ..., + target: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentOptimizationJobInputs(_Model): - agent: OptimizedAgentIdentifier - evaluators: list[AgentOptimizationEvaluatorRef] - options: Optional[AgentOptimizationOptions] - train_dataset: AgentOptimizationDatasetInput - validation_dataset: Optional[AgentOptimizationDatasetInput] + class azure.ai.projects.models.AgentInsightProposedFixKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CODE_CHANGE = "code_change" + PROMPT_CHANGE = "prompt_change" + PROSE = "prose" + + + class azure.ai.projects.models.AgentInsightRecommendedAction(_Model): + proposed_fix: AgentInsightProposedFix @overload def __init__( self, *, - agent: OptimizedAgentIdentifier, - evaluators: list[AgentOptimizationEvaluatorRef], - options: Optional[AgentOptimizationOptions] = ..., - train_dataset: AgentOptimizationDatasetInput, - validation_dataset: Optional[AgentOptimizationDatasetInput] = ... + proposed_fix: AgentInsightProposedFix ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentOptimizationJobListItem(_Model): - agent: Optional[OptimizedAgentIdentifier] + class azure.ai.projects.models.AgentInsightRun(_Model): + agent_name: str + completed_at: Optional[datetime] created_at: datetime error: Optional[ApiError] id: str - progress: Optional[AgentOptimizationJobProgress] + inputs: Optional[AgentInsightRunCreate] + model_deployment_name: str + monitor_id: str + result: Optional[AgentInsightRunResult] + started_at: Optional[datetime] status: Union[str, JobStatus] + trigger: Union[str, AgentInsightRunTrigger] updated_at: datetime - - - class azure.ai.projects.models.AgentOptimizationJobProgress(_Model): - best_score: float - candidates_completed: int - elapsed_seconds: float + window_end: datetime + window_start: datetime @overload def __init__( self, *, - best_score: float, - candidates_completed: int, - elapsed_seconds: float + inputs: Optional[AgentInsightRunCreate] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentOptimizationJobResult(_Model): - baseline: Optional[str] - best: Optional[str] - candidates: Optional[list[AgentOptimizationCandidate]] + class azure.ai.projects.models.AgentInsightRunCreate(_Model): + lookback_hours: Optional[float] @overload def __init__( self, *, - baseline: Optional[str] = ..., - best: Optional[str] = ..., - candidates: Optional[list[AgentOptimizationCandidate]] = ... + lookback_hours: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentOptimizationLROPoller(LROPoller[AgentOptimizationJobResult]): - property details: Mapping[str, Any] # Read-only + class azure.ai.projects.models.AgentInsightRunResult(_Model): + insights_created: int + insights_reopened: int + insights_updated: int + token_usage: AgentInsightTokenUsage + traces_analyzed: int + traces_in_window: int + @overload def __init__( self, - client: Any, - initial_response: Any, - deserialization_callback: Any, - polling_method: Any + *, + insights_created: int, + insights_reopened: int, + insights_updated: int, + token_usage: AgentInsightTokenUsage, + traces_analyzed: int, + traces_in_window: int ) -> None: ... - @classmethod - def from_continuation_token( - cls, - polling_method: PollingMethod[AgentOptimizationJobResult], - continuation_token: str, - **kwargs: Any - ) -> AgentOptimizationLROPoller: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentOptimizationOptions(_Model): - eval_model: Optional[str] - evaluation_level: Optional[Union[str, EvaluationLevel]] - max_candidates: Optional[int] - max_stalls: Optional[int] - optimization_config: Optional[dict[str, Any]] - optimization_model: Optional[str] + class azure.ai.projects.models.AgentInsightRunTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ON_DEMAND = "on_demand" + SCHEDULED = "scheduled" + + + class azure.ai.projects.models.AgentInsightSeverity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HIGH = "high" + LOW = "low" + MEDIUM = "medium" + + + class azure.ai.projects.models.AgentInsightStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACTIVE = "active" + IGNORED = "ignored" + RESOLVED = "resolved" + + + class azure.ai.projects.models.AgentInsightSuspension(_Model): + code: str + details: Optional[dict[str, Any]] + message: str + occurred_at: datetime @overload def __init__( self, *, - eval_model: Optional[str] = ..., - evaluation_level: Optional[Union[str, EvaluationLevel]] = ..., - max_candidates: Optional[int] = ..., - max_stalls: Optional[int] = ..., - optimization_config: Optional[dict[str, Any]] = ..., - optimization_model: Optional[str] = ... + code: str, + details: Optional[dict[str, Any]] = ..., + message: str, + occurred_at: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentOptimizationReferenceDatasetInput(AgentOptimizationDatasetInput, discriminator='reference'): - name: str - type: Literal[AgentOptimizationDatasetInputType.REFERENCE] - version: Optional[str] + class azure.ai.projects.models.AgentInsightTokenUsage(_Model): + cached_tokens: Optional[int] + input_tokens: int + output_tokens: int + total_tokens: int @overload def __init__( self, *, - name: str, - version: Optional[str] = ... + cached_tokens: Optional[int] = ..., + input_tokens: int, + output_tokens: int, + total_tokens: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentSessionResource(_Model): - agent_session_id: str - created_at: datetime - expires_at: datetime - last_accessed_at: datetime - status: Union[str, AgentSessionStatus] - version_indicator: VersionIndicator + class azure.ai.projects.models.AgentInsightUpdate(_Model): + status: Optional[Union[str, AgentInsightStatus]] @overload def __init__( self, *, - agent_session_id: str, - status: Union[str, AgentSessionStatus], - version_indicator: VersionIndicator + status: Optional[Union[str, AgentInsightStatus]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentSessionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ACTIVE = "active" - CREATING = "creating" - DELETED = "deleted" - DELETING = "deleting" - EXPIRED = "expired" - FAILED = "failed" - IDLE = "idle" - UPDATING = "updating" - - - class azure.ai.projects.models.AgentState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "disabled" - ENABLED = "enabled" - - - class azure.ai.projects.models.AgentStateSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENT_BLUEPRINT = "agent_blueprint" - AGENT_INSTANCE_IDENTITY = "agent_instance_identity" - - - class azure.ai.projects.models.AgentTaxonomyInput(EvaluationTaxonomyInput, discriminator='agent'): - risk_categories: list[Union[str, RiskCategory]] - target: EvaluationTarget - type: Literal[EvaluationTaxonomyInputType.AGENT] + class azure.ai.projects.models.AgentInsightsOverview(_Model): + content: str + source: Union[str, AgentInsightOverviewSource] + updated_at: datetime @overload def __init__( self, *, - risk_categories: list[Union[str, RiskCategory]], - target: EvaluationTarget + content: str, + source: Union[str, AgentInsightOverviewSource], + updated_at: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentVersionDetails(_Model): - agent_guid: Optional[str] - blueprint: Optional[AgentIdentity] - blueprint_reference: Optional[AgentBlueprintReference] - created_at: datetime - definition: AgentDefinition - description: Optional[str] - draft: Optional[bool] - id: str - instance_identity: Optional[AgentIdentity] - metadata: dict[str, str] - name: str - object: Literal[AgentObjectType.AGENT_VERSION] - status: Optional[Union[str, AgentVersionStatus]] - version: str + class azure.ai.projects.models.AgentInsightsOverviewOverride(_Model): + content: str @overload def __init__( self, *, - created_at: datetime, - definition: AgentDefinition, - description: Optional[str] = ..., - draft: Optional[bool] = ..., - id: str, - metadata: dict[str, str], - name: str, - object: Literal[AgentObjectType.AGENT_VERSION], - status: Optional[Union[str, AgentVersionStatus]] = ..., - version: str + content: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentVersionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ACTIVE = "active" - CREATING = "creating" - DELETED = "deleted" - DELETING = "deleting" - FAILED = "failed" - - - class azure.ai.projects.models.AgenticIdentityPreviewCredentials(BaseCredentials, discriminator='AgenticIdentityToken_Preview'): - type: Literal[CredentialType.AGENTIC_IDENTITY_PREVIEW] + class azure.ai.projects.models.AgentKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EXTERNAL = "external" + HOSTED = "hosted" + PROMPT = "prompt" + VOICE = "voice" + WORKFLOW = "workflow" - @overload - def __init__(self) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.AgentObjectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT = "agent" + AGENT_CONTAINER = "agent.container" + AGENT_DELETED = "agent.deleted" + AGENT_VERSION = "agent.version" + AGENT_VERSION_DELETED = "agent.version.deleted" - class azure.ai.projects.models.ApiError(_Model): - additional_info: Optional[dict[str, Any]] - code: str - debug_info: Optional[dict[str, Any]] - details: Optional[list[ApiError]] - message: str - param: Optional[str] - type: Optional[str] + class azure.ai.projects.models.AgentObjectVersions(_Model): + latest: AgentVersionDetails @overload def __init__( self, *, - additional_info: Optional[dict[str, Any]] = ..., - code: str, - debug_info: Optional[dict[str, Any]] = ..., - details: Optional[list[ApiError]] = ..., - message: str, - param: Optional[str] = ..., - type: Optional[str] = ... + latest: AgentVersionDetails ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ApiErrorResponse(_Model): - error: ApiError + class azure.ai.projects.models.AgentOptimizationCandidate(_Model): + avg_score: float + avg_tokens: float + candidate_id: Optional[str] + eval_id: Optional[str] + eval_run_id: Optional[str] + mutations: Optional[dict[str, Any]] + name: str + promotion: Optional[PromotionInfo] @overload def __init__( self, *, - error: ApiError - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.ApiKeyCredentials(BaseCredentials, discriminator='ApiKey'): - api_key: Optional[str] - type: Literal[CredentialType.API_KEY] - - @overload - def __init__(self) -> None: ... + avg_score: float, + avg_tokens: float, + candidate_id: Optional[str] = ..., + eval_id: Optional[str] = ..., + eval_run_id: Optional[str] = ..., + mutations: Optional[dict[str, Any]] = ..., + name: str, + promotion: Optional[PromotionInfo] = ... + ) -> None: ... @overload 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] + class azure.ai.projects.models.AgentOptimizationDatasetCriterion(_Model): + instruction: str + name: str @overload def __init__( self, *, - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ... + instruction: str, + name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ApproximateLocation(_Model): - city: Optional[str] - country: Optional[str] - region: Optional[str] - timezone: Optional[str] - type: Literal["approximate"] + class azure.ai.projects.models.AgentOptimizationDatasetInput(_Model): + type: str @overload def __init__( self, *, - city: Optional[str] = ..., - country: Optional[str] = ..., - region: Optional[str] = ..., - timezone: Optional[str] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ArtifactProfile(_Model): - category: Union[str, FoundryModelArtifactProfileCategory] - signals: Optional[list[Union[str, FoundryModelArtifactProfileSignal]]] + class azure.ai.projects.models.AgentOptimizationDatasetInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INLINE = "inline" + REFERENCE = "reference" + + + class azure.ai.projects.models.AgentOptimizationDatasetItem(_Model): + criteria: Optional[list[AgentOptimizationDatasetCriterion]] + desired_num_turns: Optional[int] + ground_truth: Optional[str] + query: Optional[str] @overload def __init__( self, *, - category: Union[str, FoundryModelArtifactProfileCategory], - signals: Optional[list[Union[str, FoundryModelArtifactProfileSignal]]] = ... + criteria: Optional[list[AgentOptimizationDatasetCriterion]] = ..., + desired_num_turns: Optional[int] = ..., + ground_truth: Optional[str] = ..., + query: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AsyncAgentOptimizationLROPoller(AsyncLROPoller[AgentOptimizationJobResult]): - property details: Mapping[str, Any] # Read-only + class azure.ai.projects.models.AgentOptimizationEvaluatorRef(_Model): + name: str + version: Optional[str] + @overload def __init__( self, - client: Any, - initial_response: Any, - deserialization_callback: Any, - polling_method: Any + *, + name: str, + version: Optional[str] = ... ) -> None: ... - @classmethod - def from_continuation_token( - cls, - polling_method: AsyncPollingMethod[AgentOptimizationJobResult], - continuation_token: str, - **kwargs: Any - ) -> AsyncAgentOptimizationLROPoller: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AsyncDatasetGenerationLROPoller(AsyncLROPoller[DataGenerationJobResult]): - property details: Mapping[str, Any] # Read-only + class azure.ai.projects.models.AgentOptimizationInlineDatasetInput(AgentOptimizationDatasetInput, discriminator='inline'): + dataset_items: list[AgentOptimizationDatasetItem] + type: Literal[AgentOptimizationDatasetInputType.INLINE] + @overload def __init__( self, - client: Any, - initial_response: Any, - deserialization_callback: Any, - polling_method: Any + *, + dataset_items: list[AgentOptimizationDatasetItem] ) -> None: ... - @classmethod - def from_continuation_token( - cls, - polling_method: AsyncPollingMethod[DataGenerationJobResult], - continuation_token: str, - **kwargs: Any - ) -> AsyncDatasetGenerationLROPoller: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AsyncEvaluatorGenerationLROPoller(AsyncLROPoller[EvaluatorVersion]): - property details: Mapping[str, Any] # Read-only + class azure.ai.projects.models.AgentOptimizationJob(_Model): + created_at: datetime + error: Optional[ApiError] + id: str + inputs: Optional[AgentOptimizationJobInputs] + progress: Optional[AgentOptimizationJobProgress] + result: Optional[AgentOptimizationJobResult] + status: Union[str, JobStatus] + updated_at: datetime + warnings: Optional[list[str]] + @overload def __init__( self, - client: Any, - initial_response: Any, - deserialization_callback: Any, - polling_method: Any + *, + inputs: Optional[AgentOptimizationJobInputs] = ... ) -> None: ... - @classmethod - def from_continuation_token( - cls, - polling_method: AsyncPollingMethod[EvaluatorVersion], - continuation_token: str, - **kwargs: Any - ) -> AsyncEvaluatorGenerationLROPoller: ... - - - class azure.ai.projects.models.AsyncUpdateMemoriesLROPoller(AsyncLROPoller[MemoryStoreUpdateCompletedResult]): - property superseded_by: Optional[str] # Read-only - property update_id: str # Read-only - - @classmethod - def from_continuation_token( - cls, - polling_method: AsyncPollingMethod[MemoryStoreUpdateCompletedResult], - continuation_token: str, - **kwargs: Any - ) -> AsyncUpdateMemoriesLROPoller: ... - - - class azure.ai.projects.models.AttackStrategy(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ANSI_ATTACK = "ansi_attack" - ASCII_ART = "ascii_art" - ASCII_SMUGGLER = "ascii_smuggler" - ATBASH = "atbash" - BASE64 = "base64" - BASELINE = "baseline" - BINARY = "binary" - CAESAR = "caesar" - CHARACTER_SPACE = "character_space" - CHARACTER_SWAP = "character_swap" - CRESCENDO = "crescendo" - DIACRITIC = "diacritic" - DIFFICULT = "difficult" - EASY = "easy" - FLIP = "flip" - INDIRECT_JAILBREAK = "indirect_jailbreak" - JAILBREAK = "jailbreak" - LEETSPEAK = "leetspeak" - MODERATE = "moderate" - MORSE = "morse" - MULTI_TURN = "multi_turn" - ROT13 = "rot13" - STRING_JOIN = "string_join" - SUFFIX_APPEND = "suffix_append" - TENSE = "tense" - UNICODE_CONFUSABLE = "unicode_confusable" - UNICODE_SUBSTITUTION = "unicode_substitution" - URL = "url" + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AutoCodeInterpreterToolParam(_Model): - file_ids: Optional[list[str]] - memory_limit: Optional[Union[str, ContainerMemoryLimit]] - network_policy: Optional[ContainerNetworkPolicyParam] - type: Literal["auto"] + class azure.ai.projects.models.AgentOptimizationJobInputs(_Model): + agent: OptimizedAgentIdentifier + evaluators: list[AgentOptimizationEvaluatorRef] + options: Optional[AgentOptimizationOptions] + train_dataset: AgentOptimizationDatasetInput + validation_dataset: Optional[AgentOptimizationDatasetInput] @overload def __init__( self, *, - file_ids: Optional[list[str]] = ..., - memory_limit: Optional[Union[str, ContainerMemoryLimit]] = ..., - network_policy: Optional[ContainerNetworkPolicyParam] = ... + agent: OptimizedAgentIdentifier, + evaluators: list[AgentOptimizationEvaluatorRef], + options: Optional[AgentOptimizationOptions] = ..., + train_dataset: AgentOptimizationDatasetInput, + validation_dataset: Optional[AgentOptimizationDatasetInput] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AzureAIAgentTarget(EvaluationTarget, discriminator='azure_ai_agent'): - name: str - tool_descriptions: Optional[list[ToolDescription]] - tools: Optional[list[Tool]] - type: Literal["azure_ai_agent"] - version: Optional[str] + class azure.ai.projects.models.AgentOptimizationJobListItem(_Model): + agent: Optional[OptimizedAgentIdentifier] + created_at: datetime + error: Optional[ApiError] + id: str + progress: Optional[AgentOptimizationJobProgress] + status: Union[str, JobStatus] + updated_at: datetime + + + class azure.ai.projects.models.AgentOptimizationJobProgress(_Model): + best_score: float + candidates_completed: int + elapsed_seconds: float @overload def __init__( self, *, - name: str, - tool_descriptions: Optional[list[ToolDescription]] = ..., - tools: Optional[list[Tool]] = ..., - version: Optional[str] = ... + best_score: float, + candidates_completed: int, + elapsed_seconds: float ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AzureAIAgentTargetParam(TypedDict, total=False): - key "name": Required[str] - key "tool_descriptions": List[ToolDescriptionParam] - key "type": Required[Literal["azure_ai_agent"]] - key "version": str - - - class azure.ai.projects.models.AzureAIBenchmarkPreviewEvalRunDataSource(TypedDict, total=False): - key "input_messages": InputMessagesItemReference - key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] - key "type": Required[Literal["azure_ai_benchmark_preview"]] - - - class azure.ai.projects.models.AzureAIDataSourceConfig(TypedDict, total=False): - key "scenario": Required[str] - key "type": Required[Literal["azure_ai_source"]] - - - class azure.ai.projects.models.AzureAIModelTarget(EvaluationTarget, discriminator='azure_ai_model'): - model: Optional[str] - sampling_params: Optional[ModelSamplingParams] - type: Literal["azure_ai_model"] + class azure.ai.projects.models.AgentOptimizationJobResult(_Model): + baseline: Optional[str] + best: Optional[str] + candidates: Optional[list[AgentOptimizationCandidate]] @overload def __init__( self, *, - model: Optional[str] = ..., - sampling_params: Optional[ModelSamplingParams] = ... + baseline: Optional[str] = ..., + best: Optional[str] = ..., + candidates: Optional[list[AgentOptimizationCandidate]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AzureAIModelTargetParam(TypedDict, total=False): - key "model": str - key "sampling_params": ModelSamplingConfigParam - key "type": Required[Literal["azure_ai_model"]] + class azure.ai.projects.models.AgentOptimizationLROPoller(LROPoller[AgentOptimizationJobResult]): + property details: Mapping[str, Any] # Read-only - - class azure.ai.projects.models.AzureAIResponsesEvalRunDataSource(TypedDict, total=False): - key "event_configuration_id": str - key "item_generation_params": Required[ResponseRetrievalItemGenerationParams] - key "max_runs_hourly": int - key "type": Required[Literal["azure_ai_responses"]] - - - class azure.ai.projects.models.AzureAISearchIndex(Index, discriminator='AzureSearch'): - connection_name: str - description: str - field_mapping: Optional[FieldMapping] - id: str - index_name: str - name: str - tags: dict[str, str] - type: Literal[IndexType.AZURE_SEARCH] - version: str - - @overload def __init__( self, - *, - connection_name: str, - description: Optional[str] = ..., - field_mapping: Optional[FieldMapping] = ..., - index_name: str, - tags: Optional[dict[str, str]] = ... + client: Any, + initial_response: Any, + deserialization_callback: Any, + polling_method: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.AzureAISearchQueryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - SEMANTIC = "semantic" - SIMPLE = "simple" - VECTOR = "vector" - VECTOR_SEMANTIC_HYBRID = "vector_semantic_hybrid" - VECTOR_SIMPLE_HYBRID = "vector_simple_hybrid" + @classmethod + def from_continuation_token( + cls, + polling_method: PollingMethod[AgentOptimizationJobResult], + continuation_token: str, + **kwargs: Any + ) -> AgentOptimizationLROPoller: ... - class azure.ai.projects.models.AzureAISearchTool(Tool, discriminator='azure_ai_search'): - azure_ai_search: AzureAISearchToolResource - description: Optional[str] - name: Optional[str] - tool_configs: Optional[dict[str, ToolConfig]] - type: Literal[ToolType.AZURE_AI_SEARCH] + class azure.ai.projects.models.AgentOptimizationOptions(_Model): + eval_model: Optional[str] + evaluation_level: Optional[Union[str, EvaluationLevel]] + max_candidates: Optional[int] + max_stalls: Optional[int] + optimization_config: Optional[dict[str, Any]] + optimization_model: Optional[str] @overload def __init__( self, *, - azure_ai_search: AzureAISearchToolResource, - description: Optional[str] = ..., - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + eval_model: Optional[str] = ..., + evaluation_level: Optional[Union[str, EvaluationLevel]] = ..., + max_candidates: Optional[int] = ..., + max_stalls: Optional[int] = ..., + optimization_config: Optional[dict[str, Any]] = ..., + optimization_model: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AzureAISearchToolResource(_Model): - indexes: list[AISearchIndexResource] + class azure.ai.projects.models.AgentOptimizationReferenceDatasetInput(AgentOptimizationDatasetInput, discriminator='reference'): + name: str + type: Literal[AgentOptimizationDatasetInputType.REFERENCE] + version: Optional[str] @overload def __init__( self, *, - indexes: list[AISearchIndexResource] + name: str, + version: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AzureAISearchToolboxTool(ToolboxTool, discriminator='azure_ai_search'): - azure_ai_search: AzureAISearchToolResource - description: str - name: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.AZURE_AI_SEARCH] + class azure.ai.projects.models.AgentSessionResource(_Model): + agent_session_id: str + created_at: datetime + expires_at: datetime + last_accessed_at: datetime + status: Union[str, AgentSessionStatus] + version_indicator: VersionIndicator @overload def __init__( self, *, - azure_ai_search: AzureAISearchToolResource, - description: Optional[str] = ..., - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + agent_session_id: str, + status: Union[str, AgentSessionStatus], + version_indicator: VersionIndicator ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AzureFunctionBinding(_Model): - storage_queue: AzureFunctionStorageQueue - type: Literal["storage_queue"] + class azure.ai.projects.models.AgentSessionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACTIVE = "active" + CREATING = "creating" + DELETED = "deleted" + DELETING = "deleting" + EXPIRED = "expired" + FAILED = "failed" + IDLE = "idle" + UPDATING = "updating" - @overload - def __init__( - self, - *, - storage_queue: AzureFunctionStorageQueue - ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.AgentState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "disabled" + ENABLED = "enabled" - class azure.ai.projects.models.AzureFunctionDefinition(_Model): - function: AzureFunctionDefinitionFunction - input_binding: AzureFunctionBinding - output_binding: AzureFunctionBinding + class azure.ai.projects.models.AgentStateSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT_BLUEPRINT = "agent_blueprint" + AGENT_INSTANCE_IDENTITY = "agent_instance_identity" + + + class azure.ai.projects.models.AgentTaxonomyInput(EvaluationTaxonomyInput, discriminator='agent'): + risk_categories: list[Union[str, RiskCategory]] + target: EvaluationTarget + type: Literal[EvaluationTaxonomyInputType.AGENT] @overload def __init__( self, *, - function: AzureFunctionDefinitionFunction, - input_binding: AzureFunctionBinding, - output_binding: AzureFunctionBinding + risk_categories: list[Union[str, RiskCategory]], + target: EvaluationTarget ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AzureFunctionDefinitionFunction(_Model): + class azure.ai.projects.models.AgentVersionDetails(_Model): + agent_guid: Optional[str] + blueprint: Optional[AgentIdentity] + blueprint_reference: Optional[AgentBlueprintReference] + created_at: datetime + definition: AgentDefinition description: Optional[str] + draft: Optional[bool] + id: str + instance_identity: Optional[AgentIdentity] + metadata: dict[str, str] name: str - parameters: dict[str, Any] + object: Literal[AgentObjectType.AGENT_VERSION] + status: Optional[Union[str, AgentVersionStatus]] + version: str @overload def __init__( self, *, + created_at: datetime, + definition: AgentDefinition, description: Optional[str] = ..., + draft: Optional[bool] = ..., + id: str, + metadata: dict[str, str], name: str, - parameters: dict[str, Any] + object: Literal[AgentObjectType.AGENT_VERSION], + status: Optional[Union[str, AgentVersionStatus]] = ..., + version: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AzureFunctionStorageQueue(_Model): - queue_name: str - queue_service_endpoint: str + class azure.ai.projects.models.AgentVersionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACTIVE = "active" + CREATING = "creating" + DELETED = "deleted" + DELETING = "deleting" + FAILED = "failed" + + + class azure.ai.projects.models.AgenticIdentityPreviewCredentials(BaseCredentials, discriminator='AgenticIdentityToken_Preview'): + type: Literal[CredentialType.AGENTIC_IDENTITY_PREVIEW] @overload - def __init__( - self, - *, - queue_name: str, - queue_service_endpoint: str - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AzureFunctionTool(Tool, discriminator='azure_function'): - azure_function: AzureFunctionDefinition - tool_configs: Optional[dict[str, ToolConfig]] - type: Literal[ToolType.AZURE_FUNCTION] + class azure.ai.projects.models.ApiError(_Model): + additional_info: Optional[dict[str, Any]] + code: str + debug_info: Optional[dict[str, Any]] + details: Optional[list[ApiError]] + message: str + param: Optional[str] + type: Optional[str] @overload def __init__( self, *, - azure_function: AzureFunctionDefinition, - tool_configs: Optional[dict[str, ToolConfig]] = ... + additional_info: Optional[dict[str, Any]] = ..., + code: str, + debug_info: Optional[dict[str, Any]] = ..., + details: Optional[list[ApiError]] = ..., + message: str, + param: Optional[str] = ..., + type: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AzureOpenAIModelConfiguration(RedTeamTargetConfig, discriminator='AzureOpenAIModel'): - model_deployment_name: str - type: Literal["AzureOpenAIModel"] + class azure.ai.projects.models.ApiErrorResponse(_Model): + error: ApiError @overload def __init__( self, *, - model_deployment_name: str + error: ApiError ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.BaseCredentials(_Model): - type: str + class azure.ai.projects.models.ApiKeyCredentials(BaseCredentials, discriminator='ApiKey'): + api_key: Optional[str] + type: Literal[CredentialType.API_KEY] @overload - def __init__( - self, - *, - type: str - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.BingCustomSearchConfiguration(_Model): - count: Optional[int] - freshness: Optional[str] - instance_name: str - market: Optional[str] - project_connection_id: str - set_lang: Optional[str] + 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, *, - count: Optional[int] = ..., - freshness: Optional[str] = ..., - instance_name: str, - market: Optional[str] = ..., - project_connection_id: str, - set_lang: Optional[str] = ... + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.BingCustomSearchPreviewTool(Tool, discriminator='bing_custom_search_preview'): - bing_custom_search_preview: BingCustomSearchToolParameters - type: Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW] + class azure.ai.projects.models.ApproximateLocation(_Model): + city: Optional[str] + country: Optional[str] + region: Optional[str] + timezone: Optional[str] + type: Literal["approximate"] @overload def __init__( self, *, - bing_custom_search_preview: BingCustomSearchToolParameters + city: Optional[str] = ..., + country: Optional[str] = ..., + region: Optional[str] = ..., + timezone: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.BingCustomSearchToolParameters(_Model): - search_configurations: list[BingCustomSearchConfiguration] + class azure.ai.projects.models.ArtifactProfile(_Model): + category: Union[str, FoundryModelArtifactProfileCategory] + signals: Optional[list[Union[str, FoundryModelArtifactProfileSignal]]] @overload def __init__( self, *, - search_configurations: list[BingCustomSearchConfiguration] + category: Union[str, FoundryModelArtifactProfileCategory], + signals: Optional[list[Union[str, FoundryModelArtifactProfileSignal]]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.BingGroundingSearchConfiguration(_Model): - count: Optional[int] - freshness: Optional[str] - market: Optional[str] - project_connection_id: str - set_lang: Optional[str] + class azure.ai.projects.models.AsyncAgentOptimizationLROPoller(AsyncLROPoller[AgentOptimizationJobResult]): + property details: Mapping[str, Any] # Read-only - @overload def __init__( self, - *, - count: Optional[int] = ..., - freshness: Optional[str] = ..., - market: Optional[str] = ..., - project_connection_id: str, - set_lang: Optional[str] = ... + client: Any, + initial_response: Any, + deserialization_callback: Any, + polling_method: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @classmethod + def from_continuation_token( + cls, + polling_method: AsyncPollingMethod[AgentOptimizationJobResult], + continuation_token: str, + **kwargs: Any + ) -> AsyncAgentOptimizationLROPoller: ... - class azure.ai.projects.models.BingGroundingSearchToolParameters(_Model): - search_configurations: list[BingGroundingSearchConfiguration] + class azure.ai.projects.models.AsyncDatasetGenerationLROPoller(AsyncLROPoller[DataGenerationJobResult]): + property details: Mapping[str, Any] # Read-only - @overload def __init__( self, - *, - search_configurations: list[BingGroundingSearchConfiguration] + client: Any, + initial_response: Any, + deserialization_callback: Any, + polling_method: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @classmethod + def from_continuation_token( + cls, + polling_method: AsyncPollingMethod[DataGenerationJobResult], + continuation_token: str, + **kwargs: Any + ) -> AsyncDatasetGenerationLROPoller: ... - class azure.ai.projects.models.BingGroundingTool(Tool, discriminator='bing_grounding'): - bing_grounding: BingGroundingSearchToolParameters - description: Optional[str] - name: Optional[str] - tool_configs: Optional[dict[str, ToolConfig]] - type: Literal[ToolType.BING_GROUNDING] + class azure.ai.projects.models.AsyncEvaluatorGenerationLROPoller(AsyncLROPoller[EvaluatorVersion]): + property details: Mapping[str, Any] # Read-only - @overload def __init__( self, - *, - bing_grounding: BingGroundingSearchToolParameters, - description: Optional[str] = ..., - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + client: Any, + initial_response: Any, + deserialization_callback: Any, + polling_method: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @classmethod + def from_continuation_token( + cls, + polling_method: AsyncPollingMethod[EvaluatorVersion], + continuation_token: str, + **kwargs: Any + ) -> AsyncEvaluatorGenerationLROPoller: ... - class azure.ai.projects.models.BlobReference(_Model): - blob_uri: str - credential: BlobReferenceSasCredential - storage_account_arm_id: str + class azure.ai.projects.models.AsyncUpdateMemoriesLROPoller(AsyncLROPoller[MemoryStoreUpdateCompletedResult]): + property superseded_by: Optional[str] # Read-only + property update_id: str # Read-only + + @classmethod + def from_continuation_token( + cls, + polling_method: AsyncPollingMethod[MemoryStoreUpdateCompletedResult], + continuation_token: str, + **kwargs: Any + ) -> AsyncUpdateMemoriesLROPoller: ... + + + class azure.ai.projects.models.AttackStrategy(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ANSI_ATTACK = "ansi_attack" + ASCII_ART = "ascii_art" + ASCII_SMUGGLER = "ascii_smuggler" + ATBASH = "atbash" + BASE64 = "base64" + BASELINE = "baseline" + BINARY = "binary" + CAESAR = "caesar" + CHARACTER_SPACE = "character_space" + CHARACTER_SWAP = "character_swap" + CRESCENDO = "crescendo" + DIACRITIC = "diacritic" + DIFFICULT = "difficult" + EASY = "easy" + FLIP = "flip" + INDIRECT_JAILBREAK = "indirect_jailbreak" + JAILBREAK = "jailbreak" + LEETSPEAK = "leetspeak" + MODERATE = "moderate" + MORSE = "morse" + MULTI_TURN = "multi_turn" + ROT13 = "rot13" + STRING_JOIN = "string_join" + SUFFIX_APPEND = "suffix_append" + TENSE = "tense" + UNICODE_CONFUSABLE = "unicode_confusable" + UNICODE_SUBSTITUTION = "unicode_substitution" + URL = "url" + + + class azure.ai.projects.models.AutoCodeInterpreterToolParam(_Model): + file_ids: Optional[list[str]] + memory_limit: Optional[Union[str, ContainerMemoryLimit]] + network_policy: Optional[ContainerNetworkPolicyParam] + type: Literal["auto"] @overload def __init__( self, *, - blob_uri: str, - credential: BlobReferenceSasCredential, - storage_account_arm_id: str + file_ids: Optional[list[str]] = ..., + memory_limit: Optional[Union[str, ContainerMemoryLimit]] = ..., + network_policy: Optional[ContainerNetworkPolicyParam] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.BlobReferenceSasCredential(_Model): - sas_uri: str - type: Literal["SAS"] + class azure.ai.projects.models.AzureAIAgentTarget(EvaluationTarget, discriminator='azure_ai_agent'): + name: str + tool_descriptions: Optional[list[ToolDescription]] + tools: Optional[list[Tool]] + type: Literal["azure_ai_agent"] + version: Optional[str] + @overload def __init__( self, - *args: Any, - **kwargs: Any + *, + name: str, + tool_descriptions: Optional[list[ToolDescription]] = ..., + tools: Optional[list[Tool]] = ..., + version: Optional[str] = ... ) -> None: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.BotServiceAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator='BotService'): - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE] - @overload - def __init__(self) -> None: ... + class azure.ai.projects.models.AzureAIAgentTargetParam(TypedDict, total=False): + key "name": Required[str] + key "tool_descriptions": List[ToolDescriptionParam] + key "type": Required[Literal["azure_ai_agent"]] + key "version": str - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.AzureAIBenchmarkPreviewEvalRunDataSource(TypedDict, total=False): + key "input_messages": InputMessagesItemReference + key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] + key "type": Required[Literal["azure_ai_benchmark_preview"]] - class azure.ai.projects.models.BotServiceRbacAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator='BotServiceRbac'): - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC] + + class azure.ai.projects.models.AzureAIDataSourceConfig(TypedDict, total=False): + key "scenario": Required[str] + key "type": Required[Literal["azure_ai_source"]] + + + class azure.ai.projects.models.AzureAIModelTarget(EvaluationTarget, discriminator='azure_ai_model'): + model: Optional[str] + sampling_params: Optional[ModelSamplingParams] + type: Literal["azure_ai_model"] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + model: Optional[str] = ..., + sampling_params: Optional[ModelSamplingParams] = ... + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.BotServiceTenantAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator='BotServiceTenant'): - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT] + class azure.ai.projects.models.AzureAIModelTargetParam(TypedDict, total=False): + key "model": str + key "sampling_params": ModelSamplingConfigParam + key "type": Required[Literal["azure_ai_model"]] - @overload - def __init__(self) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.AzureAIResponsesEvalRunDataSource(TypedDict, total=False): + key "event_configuration_id": str + key "item_generation_params": Required[ResponseRetrievalItemGenerationParams] + key "max_runs_hourly": int + key "type": Required[Literal["azure_ai_responses"]] - class azure.ai.projects.models.BrowserAutomationPreviewTool(Tool, discriminator='browser_automation_preview'): - browser_automation_preview: BrowserAutomationToolParameters - type: Literal[ToolType.BROWSER_AUTOMATION_PREVIEW] + class azure.ai.projects.models.AzureAISearchIndex(Index, discriminator='AzureSearch'): + connection_name: str + description: str + field_mapping: Optional[FieldMapping] + id: str + index_name: str + name: str + tags: dict[str, str] + type: Literal[IndexType.AZURE_SEARCH] + version: str @overload def __init__( self, *, - browser_automation_preview: BrowserAutomationToolParameters + connection_name: str, + description: Optional[str] = ..., + field_mapping: Optional[FieldMapping] = ..., + index_name: str, + tags: Optional[dict[str, str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.BrowserAutomationPreviewToolboxTool(ToolboxTool, discriminator='browser_automation_preview'): - browser_automation_preview: BrowserAutomationToolParameters - description: str - name: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW] + class azure.ai.projects.models.AzureAISearchQueryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SEMANTIC = "semantic" + SIMPLE = "simple" + VECTOR = "vector" + VECTOR_SEMANTIC_HYBRID = "vector_semantic_hybrid" + VECTOR_SIMPLE_HYBRID = "vector_simple_hybrid" + + + class azure.ai.projects.models.AzureAISearchTool(Tool, discriminator='azure_ai_search'): + azure_ai_search: AzureAISearchToolResource + description: Optional[str] + name: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.AZURE_AI_SEARCH] @overload def __init__( self, *, - browser_automation_preview: BrowserAutomationToolParameters, + azure_ai_search: AzureAISearchToolResource, description: Optional[str] = ..., name: Optional[str] = ..., tool_configs: Optional[dict[str, ToolConfig]] = ... @@ -4147,829 +4137,794 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.BrowserAutomationToolConnectionParameters(_Model): - project_connection_id: str + class azure.ai.projects.models.AzureAISearchToolResource(_Model): + indexes: list[AISearchIndexResource] @overload def __init__( self, *, - project_connection_id: str + indexes: list[AISearchIndexResource] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.BrowserAutomationToolParameters(_Model): - connection: BrowserAutomationToolConnectionParameters + class azure.ai.projects.models.AzureAISearchToolboxTool(ToolboxTool, discriminator='azure_ai_search'): + azure_ai_search: AzureAISearchToolResource + description: str + name: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.AZURE_AI_SEARCH] @overload def __init__( self, *, - connection: BrowserAutomationToolConnectionParameters + azure_ai_search: AzureAISearchToolResource, + 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.CallableToolAllowedCaller(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DIRECT = "direct" - PROGRAMMATIC = "programmatic" - - - class azure.ai.projects.models.CaptureStructuredOutputsTool(Tool, discriminator='capture_structured_outputs'): - description: Optional[str] - name: Optional[str] - outputs: StructuredOutputDefinition - tool_configs: Optional[dict[str, ToolConfig]] - type: Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS] + class azure.ai.projects.models.AzureFunctionBinding(_Model): + storage_queue: AzureFunctionStorageQueue + type: Literal["storage_queue"] @overload def __init__( self, *, - description: Optional[str] = ..., - name: Optional[str] = ..., - outputs: StructuredOutputDefinition, - tool_configs: Optional[dict[str, ToolConfig]] = ... + storage_queue: AzureFunctionStorageQueue ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ChartCoordinate(_Model): - size: int - x: int - y: int + class azure.ai.projects.models.AzureFunctionDefinition(_Model): + function: AzureFunctionDefinitionFunction + input_binding: AzureFunctionBinding + output_binding: AzureFunctionBinding @overload def __init__( self, *, - size: int, - x: int, - y: int + function: AzureFunctionDefinitionFunction, + input_binding: AzureFunctionBinding, + output_binding: AzureFunctionBinding ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ChatSummaryMemoryItem(MemoryItem, discriminator='chat_summary'): - content: str - kind: Literal[MemoryItemKind.CHAT_SUMMARY] - memory_id: str - scope: str - updated_at: datetime + class azure.ai.projects.models.AzureFunctionDefinitionFunction(_Model): + description: Optional[str] + name: str + parameters: dict[str, Any] @overload def __init__( self, *, - content: str, - memory_id: str, - scope: str, - updated_at: datetime + description: Optional[str] = ..., + name: str, + parameters: dict[str, Any] ) -> 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]] - summary: InsightSummary + class azure.ai.projects.models.AzureFunctionStorageQueue(_Model): + queue_name: str + queue_service_endpoint: str @overload def __init__( self, *, - clusters: list[InsightCluster], - coordinates: Optional[dict[str, ChartCoordinate]] = ..., - summary: InsightSummary + queue_name: str, + queue_service_endpoint: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ClusterTokenUsage(_Model): - input_token_usage: int - output_token_usage: int - total_token_usage: int + class azure.ai.projects.models.AzureFunctionTool(Tool, discriminator='azure_function'): + azure_function: AzureFunctionDefinition + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.AZURE_FUNCTION] @overload def __init__( self, *, - input_token_usage: int, - output_token_usage: int, - total_token_usage: int + azure_function: AzureFunctionDefinition, + tool_configs: Optional[dict[str, ToolConfig]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CodeBasedEvaluatorDefinition(EvaluatorDefinition, discriminator='code'): - blob_uri: Optional[str] - code_text: Optional[str] - data_schema: dict[str, any] - entry_point: Optional[str] - image_tag: Optional[str] - init_parameters: dict[str, any] - metrics: dict[str, EvaluatorMetric] - type: Literal[EvaluatorDefinitionType.CODE] + class azure.ai.projects.models.AzureOpenAIModelConfiguration(RedTeamTargetConfig, discriminator='AzureOpenAIModel'): + model_deployment_name: str + type: Literal["AzureOpenAIModel"] @overload def __init__( self, *, - blob_uri: Optional[str] = ..., - code_text: Optional[str] = ..., - data_schema: Optional[dict[str, Any]] = ..., - entry_point: Optional[str] = ..., - image_tag: Optional[str] = ..., - init_parameters: Optional[dict[str, Any]] = ..., - metrics: Optional[dict[str, EvaluatorMetric]] = ... + model_deployment_name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CodeConfiguration(_Model): - content_hash: Optional[str] - dependency_resolution: Union[str, CodeDependencyResolution] - entry_point: list[str] - runtime: str + class azure.ai.projects.models.BaseCredentials(_Model): + type: str @overload def __init__( self, *, - dependency_resolution: Union[str, CodeDependencyResolution], - entry_point: list[str], - runtime: str + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CodeDependencyResolution(str, Enum, metaclass=CaseInsensitiveEnumMeta): - BUNDLED = "bundled" - 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] + class azure.ai.projects.models.BingCustomSearchConfiguration(_Model): + count: Optional[int] + freshness: Optional[str] + instance_name: str + market: Optional[str] + project_connection_id: str + set_lang: Optional[str] @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]] = ... + count: Optional[int] = ..., + freshness: Optional[str] = ..., + instance_name: str, + market: Optional[str] = ..., + project_connection_id: str, + set_lang: Optional[str] = ... ) -> 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]] - description: str - name: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.CODE_INTERPRETER] + class azure.ai.projects.models.BingCustomSearchPreviewTool(Tool, discriminator='bing_custom_search_preview'): + bing_custom_search_preview: BingCustomSearchToolParameters + type: Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW] @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]] = ... + bing_custom_search_preview: BingCustomSearchToolParameters ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ComparisonFilter(_Model): - key: str - type: Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"] - value: Union[str, float, bool, list[Union[str, float]]] + class azure.ai.projects.models.BingCustomSearchToolParameters(_Model): + search_configurations: list[BingCustomSearchConfiguration] @overload def __init__( self, *, - key: str, - type: Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"], - value: Union[str, float, bool, list[Union[str, float]]] + search_configurations: list[BingCustomSearchConfiguration] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CompoundFilter(_Model): - filters: list[Union[ComparisonFilter, Any]] - type: Literal["and", "or"] + class azure.ai.projects.models.BingGroundingSearchConfiguration(_Model): + count: Optional[int] + freshness: Optional[str] + market: Optional[str] + project_connection_id: str + set_lang: Optional[str] @overload def __init__( self, *, - filters: list[Union[ComparisonFilter, Any]], - type: Literal["and", "or"] + count: Optional[int] = ..., + freshness: Optional[str] = ..., + market: Optional[str] = ..., + project_connection_id: str, + set_lang: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ComputerEnvironment(str, Enum, metaclass=CaseInsensitiveEnumMeta): - BROWSER = "browser" - LINUX = "linux" - MAC = "mac" - UBUNTU = "ubuntu" - WINDOWS = "windows" + class azure.ai.projects.models.BingGroundingSearchToolParameters(_Model): + search_configurations: list[BingGroundingSearchConfiguration] + @overload + def __init__( + self, + *, + search_configurations: list[BingGroundingSearchConfiguration] + ) -> None: ... - class azure.ai.projects.models.ComputerTool(Tool, discriminator='computer'): - type: Literal[ToolType.COMPUTER] + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.BingGroundingTool(Tool, discriminator='bing_grounding'): + bing_grounding: BingGroundingSearchToolParameters + description: Optional[str] + name: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.BING_GROUNDING] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + bing_grounding: BingGroundingSearchToolParameters, + 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.ComputerUsePreviewTool(Tool, discriminator='computer_use_preview'): - display_height: int - display_width: int - environment: Union[str, ComputerEnvironment] - type: Literal[ToolType.COMPUTER_USE_PREVIEW] + class azure.ai.projects.models.BlobReference(_Model): + blob_uri: str + credential: BlobReferenceSasCredential + storage_account_arm_id: str @overload def __init__( self, *, - display_height: int, - display_width: int, - environment: Union[str, ComputerEnvironment] + blob_uri: str, + credential: BlobReferenceSasCredential, + storage_account_arm_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.Connection(_Model): - credentials: BaseCredentials - id: str - is_default: bool - metadata: dict[str, str] - name: str - target: str - type: Union[str, ConnectionType] + class azure.ai.projects.models.BlobReferenceSasCredential(_Model): + sas_uri: str + type: Literal["SAS"] - - class azure.ai.projects.models.ConnectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - API_KEY = "ApiKey" - APPLICATION_CONFIGURATION = "AppConfig" - APPLICATION_INSIGHTS = "AppInsights" - AZURE_AI_SEARCH = "CognitiveSearch" - AZURE_BLOB_STORAGE = "AzureBlob" - AZURE_OPEN_AI = "AzureOpenAI" - AZURE_STORAGE_ACCOUNT = "AzureStorageAccount" - COSMOS_DB = "CosmosDB" - CUSTOM = "CustomKeys" - REMOTE_TOOL = "RemoteTool_Preview" + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... - class azure.ai.projects.models.ContainerAutoParam(FunctionShellToolParamEnvironment, discriminator='container_auto'): - file_ids: Optional[list[str]] - memory_limit: Optional[Union[str, ContainerMemoryLimit]] - network_policy: Optional[ContainerNetworkPolicyParam] - skills: Optional[list[ContainerSkill]] - type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO] + class azure.ai.projects.models.BotServiceAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator='BotService'): + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE] @overload - def __init__( - self, - *, - file_ids: Optional[list[str]] = ..., - memory_limit: Optional[Union[str, ContainerMemoryLimit]] = ..., - network_policy: Optional[ContainerNetworkPolicyParam] = ..., - skills: Optional[list[ContainerSkill]] = ... - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ContainerConfiguration(_Model): - image: str - registry_connection_id: Optional[str] + class azure.ai.projects.models.BotServiceRbacAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator='BotServiceRbac'): + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC] @overload - def __init__( - self, - *, - image: str, - registry_connection_id: Optional[str] = ... - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ContainerMemoryLimit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - MEMORY_16GB = "16g" - MEMORY_1GB = "1g" - MEMORY_4GB = "4g" - MEMORY_64GB = "64g" - - - class azure.ai.projects.models.ContainerNetworkPolicyAllowlistParam(ContainerNetworkPolicyParam, discriminator='allowlist'): - allowed_domains: list[str] - domain_secrets: Optional[list[ContainerNetworkPolicyDomainSecretParam]] - type: Literal[ContainerNetworkPolicyParamType.ALLOWLIST] + class azure.ai.projects.models.BotServiceTenantAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator='BotServiceTenant'): + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT] @overload - def __init__( - self, - *, - allowed_domains: list[str], - domain_secrets: Optional[list[ContainerNetworkPolicyDomainSecretParam]] = ... - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ContainerNetworkPolicyDisabledParam(ContainerNetworkPolicyParam, discriminator='disabled'): - type: Literal[ContainerNetworkPolicyParamType.DISABLED] + class azure.ai.projects.models.BrowserAutomationPreviewTool(Tool, discriminator='browser_automation_preview'): + browser_automation_preview: BrowserAutomationToolParameters + type: Literal[ToolType.BROWSER_AUTOMATION_PREVIEW] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + browser_automation_preview: BrowserAutomationToolParameters + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ContainerNetworkPolicyDomainSecretParam(_Model): - domain: str + class azure.ai.projects.models.BrowserAutomationPreviewToolboxTool(ToolboxTool, discriminator='browser_automation_preview'): + browser_automation_preview: BrowserAutomationToolParameters + description: str name: str - value: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW] @overload def __init__( self, *, - domain: str, - name: str, - value: str + browser_automation_preview: BrowserAutomationToolParameters, + 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.ContainerNetworkPolicyParam(_Model): - type: str + class azure.ai.projects.models.BrowserAutomationToolConnectionParameters(_Model): + project_connection_id: str @overload def __init__( self, *, - type: str + project_connection_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ContainerNetworkPolicyParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ALLOWLIST = "allowlist" - DISABLED = "disabled" - - - class azure.ai.projects.models.ContainerSkill(_Model): - type: str + class azure.ai.projects.models.BrowserAutomationToolParameters(_Model): + connection: BrowserAutomationToolConnectionParameters @overload def __init__( self, *, - type: str + connection: BrowserAutomationToolConnectionParameters ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ContainerSkillType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - INLINE = "inline" - SKILL_REFERENCE = "skill_reference" + class azure.ai.projects.models.CallableToolAllowedCaller(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DIRECT = "direct" + PROGRAMMATIC = "programmatic" - class azure.ai.projects.models.ContinuousEvaluationRuleAction(EvaluationRuleAction, discriminator='continuousEvaluation'): - eval_id: str - max_hourly_runs: Optional[int] - sampling_rate: Optional[float] - type: Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION] + class azure.ai.projects.models.CaptureStructuredOutputsTool(Tool, discriminator='capture_structured_outputs'): + description: Optional[str] + name: Optional[str] + outputs: StructuredOutputDefinition + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS] @overload def __init__( self, *, - eval_id: str, - max_hourly_runs: Optional[int] = ..., - sampling_rate: Optional[float] = ... + description: Optional[str] = ..., + name: Optional[str] = ..., + outputs: StructuredOutputDefinition, + tool_configs: Optional[dict[str, ToolConfig]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CosmosDBIndex(Index, discriminator='CosmosDBNoSqlVectorStore'): - connection_name: str - container_name: str - database_name: str - description: str - embedding_configuration: EmbeddingConfiguration - field_mapping: FieldMapping - id: str - name: str - tags: dict[str, str] - type: Literal[IndexType.COSMOS_DB] - version: str + class azure.ai.projects.models.ChartCoordinate(_Model): + size: int + x: int + y: int @overload def __init__( self, *, - connection_name: str, - container_name: str, - database_name: str, - description: Optional[str] = ..., - embedding_configuration: EmbeddingConfiguration, - field_mapping: FieldMapping, - tags: Optional[dict[str, str]] = ... + size: int, + x: int, + y: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CreateAsyncResponse(_Model): - location: Optional[str] - operation_result: Optional[str] + class azure.ai.projects.models.ChatSummaryMemoryItem(MemoryItem, discriminator='chat_summary'): + content: str + kind: Literal[MemoryItemKind.CHAT_SUMMARY] + memory_id: str + scope: str + updated_at: datetime @overload def __init__( self, *, - location: Optional[str] = ..., - operation_result: Optional[str] = ... + content: str, + memory_id: str, + scope: str, + updated_at: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CreateSkillVersionFromFilesBody(_Model): - default: Optional[bool] - files: list[Union[str, bytes, IO[str], IO[bytes], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]]], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]], Optional[str]]]] + class azure.ai.projects.models.ClusterInsightResult(_Model): + clusters: list[InsightCluster] + coordinates: Optional[dict[str, ChartCoordinate]] + summary: InsightSummary @overload def __init__( self, *, - default: Optional[bool] = ..., - files: list[FileType] + clusters: list[InsightCluster], + coordinates: Optional[dict[str, ChartCoordinate]] = ..., + summary: InsightSummary ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CreateTranscriptionResponseJsonUsage(_Model): - type: str + class azure.ai.projects.models.ClusterTokenUsage(_Model): + input_token_usage: int + output_token_usage: int + total_token_usage: int @overload def __init__( self, *, - type: str + input_token_usage: int, + output_token_usage: int, + total_token_usage: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CreateTranscriptionResponseJsonUsageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DURATION = "duration" - TOKENS = "tokens" - - - class azure.ai.projects.models.CredentialType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENTIC_IDENTITY_PREVIEW = "AgenticIdentityToken_Preview" - API_KEY = "ApiKey" - CUSTOM = "CustomKeys" - ENTRA_ID = "AAD" - NONE = "None" - SAS = "SAS" - - - class azure.ai.projects.models.CronTrigger(Trigger, discriminator='Cron'): - end_time: Optional[datetime] - expression: str - start_time: Optional[datetime] - time_zone: Optional[str] - type: Literal[TriggerType.CRON] + class azure.ai.projects.models.CodeBasedEvaluatorDefinition(EvaluatorDefinition, discriminator='code'): + blob_uri: Optional[str] + code_text: Optional[str] + data_schema: dict[str, any] + entry_point: Optional[str] + image_tag: Optional[str] + init_parameters: dict[str, any] + metrics: dict[str, EvaluatorMetric] + type: Literal[EvaluatorDefinitionType.CODE] @overload def __init__( self, *, - end_time: Optional[datetime] = ..., - expression: str, - start_time: Optional[datetime] = ..., - time_zone: Optional[str] = ... + blob_uri: Optional[str] = ..., + code_text: Optional[str] = ..., + data_schema: Optional[dict[str, Any]] = ..., + entry_point: Optional[str] = ..., + image_tag: Optional[str] = ..., + init_parameters: Optional[dict[str, Any]] = ..., + metrics: Optional[dict[str, EvaluatorMetric]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CustomCredential(CustomCredentialGenerated, discriminator='CustomKeys'): - credential_keys: Dict[str, str] - type: Union[str, CredentialType] - - def __init__( - self, - *args: Any, - **kwargs: Any - ) -> None: ... - - - class azure.ai.projects.models.CustomGrammarFormatParam(CustomToolParamFormat, discriminator='grammar'): - definition: str - syntax: Union[str, GrammarSyntax1] - type: Literal[CustomToolParamFormatType.GRAMMAR] + class azure.ai.projects.models.CodeConfiguration(_Model): + content_hash: Optional[str] + dependency_resolution: Union[str, CodeDependencyResolution] + entry_point: list[str] + runtime: str @overload def __init__( self, *, - definition: str, - syntax: Union[str, GrammarSyntax1] + dependency_resolution: Union[str, CodeDependencyResolution], + entry_point: list[str], + runtime: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CustomRoutineTrigger(RoutineTrigger, discriminator='custom'): - event_name: Optional[str] - parameters: dict[str, Any] - provider: str - type: Literal[RoutineTriggerType.CUSTOM] + class azure.ai.projects.models.CodeDependencyResolution(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BUNDLED = "bundled" + 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, *, - event_name: Optional[str] = ..., - parameters: dict[str, Any], - provider: str + 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.CustomTextFormatParam(CustomToolParamFormat, discriminator='text'): - type: Literal[CustomToolParamFormatType.TEXT] + class azure.ai.projects.models.CodeInterpreterToolboxTool(ToolboxTool, discriminator='code_interpreter'): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] + container: Optional[Union[str, AutoCodeInterpreterToolParam]] + description: str + name: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.CODE_INTERPRETER] @overload - def __init__(self) -> None: ... + 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.CustomToolParam(Tool, discriminator='custom'): - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] - defer_loading: Optional[bool] - description: Optional[str] - format: Optional[CustomToolParamFormat] - name: str - type: Literal[ToolType.CUSTOM] + class azure.ai.projects.models.ComparisonFilter(_Model): + key: str + type: Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"] + value: Union[str, float, bool, list[Union[str, float]]] @overload def __init__( self, *, - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., - defer_loading: Optional[bool] = ..., - description: Optional[str] = ..., - format: Optional[CustomToolParamFormat] = ..., - name: str + key: str, + type: Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"], + value: Union[str, float, bool, list[Union[str, float]]] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CustomToolParamFormat(_Model): - type: str + class azure.ai.projects.models.CompoundFilter(_Model): + filters: list[Union[ComparisonFilter, Any]] + type: Literal["and", "or"] @overload def __init__( self, *, - type: str + filters: list[Union[ComparisonFilter, Any]], + type: Literal["and", "or"] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CustomToolParamFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - GRAMMAR = "grammar" - TEXT = "text" + class azure.ai.projects.models.ComputerEnvironment(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BROWSER = "browser" + LINUX = "linux" + MAC = "mac" + UBUNTU = "ubuntu" + WINDOWS = "windows" - class azure.ai.projects.models.DailyRecurrenceSchedule(RecurrenceSchedule, discriminator='Daily'): - hours: list[int] - type: Literal[RecurrenceType.DAILY] + class azure.ai.projects.models.ComputerTool(Tool, discriminator='computer'): + type: Literal[ToolType.COMPUTER] @overload - def __init__( - self, - *, - hours: list[int] - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DataGenerationJob(_Model): - created_at: datetime - error: Optional[ApiError] - finished_at: Optional[datetime] - id: str - inputs: Optional[DataGenerationJobInputs] - result: Optional[DataGenerationJobResult] - status: Union[str, JobStatus] + 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, *, - inputs: Optional[DataGenerationJobInputs] = ... + 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.DataGenerationJobInputs(_Model): + class azure.ai.projects.models.Connection(_Model): + credentials: BaseCredentials + id: str + is_default: bool + metadata: dict[str, str] name: str - options: DataGenerationJobOptions - output_options: Optional[DataGenerationJobOutputOptions] - scenario: Union[str, DataGenerationJobScenario] - sources: list[DataGenerationJobSource] + target: str + type: Union[str, ConnectionType] + + + class azure.ai.projects.models.ConnectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + API_KEY = "ApiKey" + APPLICATION_CONFIGURATION = "AppConfig" + APPLICATION_INSIGHTS = "AppInsights" + AZURE_AI_SEARCH = "CognitiveSearch" + AZURE_BLOB_STORAGE = "AzureBlob" + AZURE_OPEN_AI = "AzureOpenAI" + AZURE_STORAGE_ACCOUNT = "AzureStorageAccount" + COSMOS_DB = "CosmosDB" + CUSTOM = "CustomKeys" + REMOTE_TOOL = "RemoteTool_Preview" + + + class azure.ai.projects.models.ContainerAutoParam(FunctionShellToolParamEnvironment, discriminator='container_auto'): + file_ids: Optional[list[str]] + memory_limit: Optional[Union[str, ContainerMemoryLimit]] + network_policy: Optional[ContainerNetworkPolicyParam] + skills: Optional[list[ContainerSkill]] + type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO] @overload def __init__( self, *, - name: str, - options: DataGenerationJobOptions, - output_options: Optional[DataGenerationJobOutputOptions] = ..., - scenario: Union[str, DataGenerationJobScenario], - sources: list[DataGenerationJobSource] + file_ids: Optional[list[str]] = ..., + memory_limit: Optional[Union[str, ContainerMemoryLimit]] = ..., + network_policy: Optional[ContainerNetworkPolicyParam] = ..., + skills: Optional[list[ContainerSkill]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DataGenerationJobOptions(_Model): - max_samples: int - model_options: Optional[DataGenerationModelOptions] - train_split: Optional[float] - type: str + class azure.ai.projects.models.ContainerConfiguration(_Model): + image: str + registry_connection_id: Optional[str] @overload def __init__( self, *, - max_samples: int, - model_options: Optional[DataGenerationModelOptions] = ..., - train_split: Optional[float] = ..., - type: str + image: str, + registry_connection_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DataGenerationJobOutput(_Model): - type: str + class azure.ai.projects.models.ContainerMemoryLimit(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MEMORY_16GB = "16g" + MEMORY_1GB = "1g" + MEMORY_4GB = "4g" + MEMORY_64GB = "64g" + + + class azure.ai.projects.models.ContainerNetworkPolicyAllowlistParam(ContainerNetworkPolicyParam, discriminator='allowlist'): + allowed_domains: list[str] + domain_secrets: Optional[list[ContainerNetworkPolicyDomainSecretParam]] + type: Literal[ContainerNetworkPolicyParamType.ALLOWLIST] @overload def __init__( self, *, - type: str + allowed_domains: list[str], + domain_secrets: Optional[list[ContainerNetworkPolicyDomainSecretParam]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DataGenerationJobOutputOptions(_Model): - description: Optional[str] - name: Optional[str] - tags: Optional[dict[str, str]] + class azure.ai.projects.models.ContainerNetworkPolicyDisabledParam(ContainerNetworkPolicyParam, discriminator='disabled'): + type: Literal[ContainerNetworkPolicyParamType.DISABLED] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ContainerNetworkPolicyDomainSecretParam(_Model): + domain: str + name: str + value: str @overload def __init__( self, *, - description: Optional[str] = ..., - name: Optional[str] = ..., - tags: Optional[dict[str, str]] = ... + domain: str, + name: str, + value: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DataGenerationJobOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DATASET = "dataset" - FILE = "file" - - - class azure.ai.projects.models.DataGenerationJobResult(_Model): - generated_samples: int - outputs: Optional[list[DataGenerationJobOutput]] - token_usage: Optional[DataGenerationTokenUsage] + class azure.ai.projects.models.ContainerNetworkPolicyParam(_Model): + type: str @overload def __init__( self, *, - generated_samples: int, - outputs: Optional[list[DataGenerationJobOutput]] = ..., - token_usage: Optional[DataGenerationTokenUsage] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DataGenerationJobScenario(str, Enum, metaclass=CaseInsensitiveEnumMeta): - EVALUATION = "evaluation" - REINFORCEMENT_FINETUNING = "reinforcement_finetuning" - SUPERVISED_FINETUNING = "supervised_finetuning" + class azure.ai.projects.models.ContainerNetworkPolicyParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ALLOWLIST = "allowlist" + DISABLED = "disabled" - class azure.ai.projects.models.DataGenerationJobSource(_Model): - description: Optional[str] + class azure.ai.projects.models.ContainerSkill(_Model): type: str @overload def __init__( self, *, - description: Optional[str] = ..., type: str ) -> None: ... @@ -4977,148 +4932,99 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DataGenerationJobSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENT = "agent" - FILE = "file" - PROMPT = "prompt" - TRACES = "traces" - - - class azure.ai.projects.models.DataGenerationJobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - SIMPLE_QNA = "simple_qna" - SIMULATION_SEED = "simulation_seed" - TOOL_USE = "tool_use" - TRACES = "traces" + class azure.ai.projects.models.ContainerSkillType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INLINE = "inline" + SKILL_REFERENCE = "skill_reference" - class azure.ai.projects.models.DataGenerationModelOptions(_Model): - model: str + class azure.ai.projects.models.ContinuousEvaluationRuleAction(EvaluationRuleAction, discriminator='continuousEvaluation'): + eval_id: str + max_hourly_runs: Optional[int] + sampling_rate: Optional[float] + type: Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION] @overload def __init__( self, *, - model: str + eval_id: str, + max_hourly_runs: Optional[int] = ..., + sampling_rate: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DataGenerationTokenUsage(_Model): - completion_tokens: int - prompt_tokens: int - total_tokens: int - - - class azure.ai.projects.models.DatasetCredential(_Model): - blob_reference: BlobReference + class azure.ai.projects.models.CosmosDBIndex(Index, discriminator='CosmosDBNoSqlVectorStore'): + connection_name: str + container_name: str + database_name: str + description: str + embedding_configuration: EmbeddingConfiguration + field_mapping: FieldMapping + id: str + name: str + tags: dict[str, str] + type: Literal[IndexType.COSMOS_DB] + version: str @overload def __init__( self, *, - blob_reference: BlobReference + connection_name: str, + container_name: str, + database_name: str, + description: Optional[str] = ..., + embedding_configuration: EmbeddingConfiguration, + field_mapping: FieldMapping, + tags: Optional[dict[str, str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DatasetDataGenerationJobOutput(DataGenerationJobOutput, discriminator='dataset'): - description: Optional[str] - id: Optional[str] - name: Optional[str] - tags: Optional[dict[str, str]] - type: Literal[DataGenerationJobOutputType.DATASET] - version: Optional[str] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.DatasetEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator='dataset'): - description: Optional[str] - name: str - type: Literal[EvaluatorGenerationJobSourceType.DATASET] - version: Optional[str] + class azure.ai.projects.models.CreateAsyncResponse(_Model): + location: Optional[str] + operation_result: Optional[str] @overload def __init__( self, *, - description: Optional[str] = ..., - name: str, - version: Optional[str] = ... + location: Optional[str] = ..., + operation_result: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DatasetGenerationLROPoller(LROPoller[DataGenerationJobResult]): - property details: Mapping[str, Any] # Read-only - - def __init__( - self, - client: Any, - initial_response: Any, - deserialization_callback: Any, - polling_method: Any - ) -> None: ... - - @classmethod - def from_continuation_token( - cls, - polling_method: PollingMethod[DataGenerationJobResult], - continuation_token: str, - **kwargs: Any - ) -> DatasetGenerationLROPoller: ... - - - class azure.ai.projects.models.DatasetReference(_Model): - name: str - version: str + class azure.ai.projects.models.CreateSkillVersionFromFilesBody(_Model): + default: Optional[bool] + files: list[Union[str, bytes, IO[str], IO[bytes], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]]], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]], Optional[str]]]] @overload def __init__( self, *, - name: str, - version: str + default: Optional[bool] = ..., + files: list[FileType] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DatasetType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - URI_FILE = "uri_file" - URI_FOLDER = "uri_folder" - - - class azure.ai.projects.models.DatasetVersion(_Model): - connection_name: Optional[str] - data_uri: str - description: Optional[str] - id: Optional[str] - is_reference: Optional[bool] - name: str - tags: Optional[dict[str, str]] + class azure.ai.projects.models.CreateTranscriptionResponseJsonUsage(_Model): type: str - version: str @overload def __init__( self, *, - connection_name: Optional[str] = ..., - data_uri: str, - description: Optional[str] = ..., - tags: Optional[dict[str, str]] = ..., type: str ) -> None: ... @@ -5126,130 +5032,122 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DayOfWeek(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FRIDAY = "Friday" - MONDAY = "Monday" - SATURDAY = "Saturday" - SUNDAY = "Sunday" - THURSDAY = "Thursday" - TUESDAY = "Tuesday" - WEDNESDAY = "Wednesday" + class azure.ai.projects.models.CreateTranscriptionResponseJsonUsageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DURATION = "duration" + TOKENS = "tokens" - class azure.ai.projects.models.DeleteAgentResponse(_Model): - deleted: bool - name: str - object: Literal[AgentObjectType.AGENT_DELETED] + class azure.ai.projects.models.CredentialType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENTIC_IDENTITY_PREVIEW = "AgenticIdentityToken_Preview" + API_KEY = "ApiKey" + CUSTOM = "CustomKeys" + ENTRA_ID = "AAD" + NONE = "None" + SAS = "SAS" + + + class azure.ai.projects.models.CronTrigger(Trigger, discriminator='Cron'): + end_time: Optional[datetime] + expression: str + start_time: Optional[datetime] + time_zone: Optional[str] + type: Literal[TriggerType.CRON] @overload def __init__( self, *, - deleted: bool, - name: str, - object: Literal[AgentObjectType.AGENT_DELETED] + end_time: Optional[datetime] = ..., + expression: str, + start_time: Optional[datetime] = ..., + time_zone: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DeleteAgentVersionResponse(_Model): - deleted: bool - name: str - object: Literal[AgentObjectType.AGENT_VERSION_DELETED] - version: str + class azure.ai.projects.models.CustomCredential(CustomCredentialGenerated, discriminator='CustomKeys'): + credential_keys: Dict[str, str] + type: Union[str, CredentialType] - @overload def __init__( self, - *, - deleted: bool, - name: str, - object: Literal[AgentObjectType.AGENT_VERSION_DELETED], - version: str + *args: Any, + **kwargs: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.DeleteMemoryResult(_Model): - deleted: bool - memory_id: str - object: Literal[MemoryStoreObjectType.MEMORY_DELETED] + class azure.ai.projects.models.CustomGrammarFormatParam(CustomToolParamFormat, discriminator='grammar'): + definition: str + syntax: Union[str, GrammarSyntax1] + type: Literal[CustomToolParamFormatType.GRAMMAR] @overload def __init__( self, *, - deleted: bool, - memory_id: str, - object: Literal[MemoryStoreObjectType.MEMORY_DELETED] + definition: str, + syntax: Union[str, GrammarSyntax1] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DeleteMemoryStoreResult(_Model): - deleted: bool - name: str - object: Literal[MemoryStoreObjectType.MEMORY_STORE_DELETED] + class azure.ai.projects.models.CustomRoutineTrigger(RoutineTrigger, discriminator='custom'): + event_name: Optional[str] + parameters: dict[str, Any] + provider: str + type: Literal[RoutineTriggerType.CUSTOM] @overload def __init__( self, *, - deleted: bool, - name: str, - object: Literal[MemoryStoreObjectType.MEMORY_STORE_DELETED] + event_name: Optional[str] = ..., + parameters: dict[str, Any], + provider: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DeleteSkillResult(_Model): - deleted: bool - id: str - name: str + class azure.ai.projects.models.CustomTextFormatParam(CustomToolParamFormat, discriminator='text'): + type: Literal[CustomToolParamFormatType.TEXT] @overload - def __init__( - self, - *, - deleted: bool, - id: str, - name: str - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DeleteSkillVersionResult(_Model): - deleted: bool - id: str + class azure.ai.projects.models.CustomToolParam(Tool, discriminator='custom'): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] + defer_loading: Optional[bool] + description: Optional[str] + format: Optional[CustomToolParamFormat] name: str - version: str + type: Literal[ToolType.CUSTOM] @overload def __init__( self, *, - deleted: bool, - id: str, - name: str, - version: str + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., + 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.Deployment(_Model): - name: str + class azure.ai.projects.models.CustomToolParamFormat(_Model): type: str @overload @@ -5263,421 +5161,438 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DeploymentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - MODEL_DEPLOYMENT = "ModelDeployment" + class azure.ai.projects.models.CustomToolParamFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + GRAMMAR = "grammar" + TEXT = "text" - class azure.ai.projects.models.Dimension(_Model): - always_applicable: Optional[bool] - description: str - id: str - weight: int + class azure.ai.projects.models.DailyRecurrenceSchedule(RecurrenceSchedule, discriminator='Daily'): + hours: list[int] + type: Literal[RecurrenceType.DAILY] @overload def __init__( self, *, - always_applicable: Optional[bool] = ..., - description: str, - id: str, - weight: int + hours: list[int] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DispatchRoutineResult(_Model): - action_correlation_id: Optional[str] - dispatch_id: Optional[str] - task_id: Optional[str] + class azure.ai.projects.models.DataGenerationJob(_Model): + created_at: datetime + error: Optional[ApiError] + finished_at: Optional[datetime] + id: str + inputs: Optional[DataGenerationJobInputs] + result: Optional[DataGenerationJobResult] + status: Union[str, JobStatus] @overload def __init__( self, *, - action_correlation_id: Optional[str] = ..., - dispatch_id: Optional[str] = ..., - task_id: Optional[str] = ... + inputs: Optional[DataGenerationJobInputs] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EmbeddingConfiguration(_Model): - embedding_field: str - model_deployment_name: str + class azure.ai.projects.models.DataGenerationJobInputs(_Model): + name: str + options: DataGenerationJobOptions + output_options: Optional[DataGenerationJobOutputOptions] + scenario: Union[str, DataGenerationJobScenario] + sources: list[DataGenerationJobSource] @overload def __init__( self, *, - embedding_field: str, - model_deployment_name: str + name: str, + options: DataGenerationJobOptions, + output_options: Optional[DataGenerationJobOutputOptions] = ..., + scenario: Union[str, DataGenerationJobScenario], + sources: list[DataGenerationJobSource] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EmptyModelParam(_Model): - - - class azure.ai.projects.models.EndpointBasedEvaluatorDefinition(EvaluatorDefinition, discriminator='endpoint'): - connection_name: str - data_schema: dict[str, any] - init_parameters: dict[str, any] - metrics: dict[str, EvaluatorMetric] - type: Literal[EvaluatorDefinitionType.ENDPOINT] + class azure.ai.projects.models.DataGenerationJobOptions(_Model): + max_samples: int + model_options: Optional[DataGenerationModelOptions] + train_split: Optional[float] + type: str @overload def __init__( self, *, - connection_name: str, - data_schema: Optional[dict[str, Any]] = ..., - init_parameters: Optional[dict[str, Any]] = ..., - metrics: Optional[dict[str, EvaluatorMetric]] = ... + max_samples: int, + model_options: Optional[DataGenerationModelOptions] = ..., + train_split: Optional[float] = ..., + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EntraAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator='Entra'): - type: Literal[AgentEndpointAuthorizationSchemeType.ENTRA] + class azure.ai.projects.models.DataGenerationJobOutput(_Model): + type: str @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + type: str + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EntraIDCredentials(BaseCredentials, discriminator='AAD'): - type: Literal[CredentialType.ENTRA_ID] + class azure.ai.projects.models.DataGenerationJobOutputOptions(_Model): + description: Optional[str] + name: Optional[str] + tags: Optional[dict[str, str]] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + description: Optional[str] = ..., + name: Optional[str] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvalCsvFileIdSource(TypedDict, total=False): - key "id": Required[str] - key "type": Required[Literal["file_id"]] - - - class azure.ai.projects.models.EvalCsvRunDataSource(TypedDict, total=False): - key "source": Required[EvalCsvFileIdSource] - key "type": Required[Literal["csv"]] + class azure.ai.projects.models.DataGenerationJobOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DATASET = "dataset" + FILE = "file" - class azure.ai.projects.models.EvalResult(_Model): - name: str - passed: bool - score: float - type: str + class azure.ai.projects.models.DataGenerationJobResult(_Model): + generated_samples: int + outputs: Optional[list[DataGenerationJobOutput]] + token_usage: Optional[DataGenerationTokenUsage] @overload def __init__( self, *, - name: str, - passed: bool, - score: float, - type: str + generated_samples: int, + outputs: Optional[list[DataGenerationJobOutput]] = ..., + token_usage: Optional[DataGenerationTokenUsage] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvalRunResultCompareItem(_Model): - delta_estimate: float - p_value: float - treatment_effect: Union[str, TreatmentEffectType] - treatment_run_id: str - treatment_run_summary: EvalRunResultSummary + class azure.ai.projects.models.DataGenerationJobScenario(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EVALUATION = "evaluation" + REINFORCEMENT_FINETUNING = "reinforcement_finetuning" + SUPERVISED_FINETUNING = "supervised_finetuning" + + + class azure.ai.projects.models.DataGenerationJobSource(_Model): + description: Optional[str] + type: str @overload def __init__( self, *, - delta_estimate: float, - p_value: float, - treatment_effect: Union[str, TreatmentEffectType], - treatment_run_id: str, - treatment_run_summary: EvalRunResultSummary + description: Optional[str] = ..., + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvalRunResultComparison(_Model): - baseline_run_summary: EvalRunResultSummary - compare_items: list[EvalRunResultCompareItem] - evaluator: str - metric: str - testing_criteria: str + class azure.ai.projects.models.DataGenerationJobSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT = "agent" + FILE = "file" + PROMPT = "prompt" + TRACES = "traces" - @overload - def __init__( - self, - *, - baseline_run_summary: EvalRunResultSummary, - compare_items: list[EvalRunResultCompareItem], - evaluator: str, - metric: str, - testing_criteria: str - ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.DataGenerationJobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SIMPLE_QNA = "simple_qna" + SIMULATION_SEED = "simulation_seed" + TOOL_USE = "tool_use" + TRACES = "traces" - class azure.ai.projects.models.EvalRunResultSummary(_Model): - average: float - run_id: str - sample_count: int - standard_deviation: float + class azure.ai.projects.models.DataGenerationModelOptions(_Model): + model: str @overload def __init__( self, *, - average: float, - run_id: str, - sample_count: int, - standard_deviation: float + model: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluationComparisonInsightRequest(InsightRequest, discriminator='EvaluationComparison'): - baseline_run_id: str - eval_id: str - treatment_run_ids: list[str] - type: Literal[InsightType.EVALUATION_COMPARISON] + class azure.ai.projects.models.DataGenerationTokenUsage(_Model): + completion_tokens: int + prompt_tokens: int + total_tokens: int + + + class azure.ai.projects.models.DatasetCredential(_Model): + blob_reference: BlobReference @overload def __init__( self, *, - baseline_run_id: str, - eval_id: str, - treatment_run_ids: list[str] + blob_reference: BlobReference ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluationComparisonInsightResult(InsightResult, discriminator='EvaluationComparison'): - comparisons: list[EvalRunResultComparison] - method: str - type: Literal[InsightType.EVALUATION_COMPARISON] + class azure.ai.projects.models.DatasetDataGenerationJobOutput(DataGenerationJobOutput, discriminator='dataset'): + description: Optional[str] + id: Optional[str] + name: Optional[str] + tags: Optional[dict[str, str]] + type: Literal[DataGenerationJobOutputType.DATASET] + version: Optional[str] @overload - def __init__( - self, - *, - comparisons: list[EvalRunResultComparison], - method: str - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluationLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CONVERSATION = "conversation" - TURN = "turn" - - - class azure.ai.projects.models.EvaluationResultSample(InsightSample, discriminator='EvaluationResultSample'): - correlation_info: dict[str, any] - evaluation_result: EvalResult - features: dict[str, any] - id: str - type: Literal[SampleType.EVALUATION_RESULT_SAMPLE] + class azure.ai.projects.models.DatasetEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator='dataset'): + description: Optional[str] + name: str + type: Literal[EvaluatorGenerationJobSourceType.DATASET] + version: Optional[str] @overload def __init__( self, *, - correlation_info: dict[str, Any], - evaluation_result: EvalResult, - features: dict[str, Any], - id: str + description: Optional[str] = ..., + name: str, + version: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluationRule(_Model): - action: EvaluationRuleAction - description: Optional[str] - display_name: Optional[str] - enabled: bool - event_type: Union[str, EvaluationRuleEventType] - filter: Optional[EvaluationRuleFilter] - id: str - system_data: dict[str, str] + class azure.ai.projects.models.DatasetGenerationLROPoller(LROPoller[DataGenerationJobResult]): + property details: Mapping[str, Any] # Read-only - @overload def __init__( self, - *, - action: EvaluationRuleAction, - description: Optional[str] = ..., - display_name: Optional[str] = ..., - enabled: bool, - event_type: Union[str, EvaluationRuleEventType], - filter: Optional[EvaluationRuleFilter] = ... + client: Any, + initial_response: Any, + deserialization_callback: Any, + polling_method: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @classmethod + def from_continuation_token( + cls, + polling_method: PollingMethod[DataGenerationJobResult], + continuation_token: str, + **kwargs: Any + ) -> DatasetGenerationLROPoller: ... - class azure.ai.projects.models.EvaluationRuleAction(_Model): - type: str + class azure.ai.projects.models.DatasetReference(_Model): + name: str + version: str @overload def __init__( self, *, - type: str + name: str, + version: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluationRuleActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CONTINUOUS_EVALUATION = "continuousEvaluation" - HUMAN_EVALUATION_PREVIEW = "humanEvaluationPreview" - + class azure.ai.projects.models.DatasetType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + URI_FILE = "uri_file" + URI_FOLDER = "uri_folder" - class azure.ai.projects.models.EvaluationRuleEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - MANUAL = "manual" - RESPONSE_COMPLETED = "responseCompleted" + class azure.ai.projects.models.DatasetVersion(_Model): + connection_name: Optional[str] + data_uri: str + description: Optional[str] + id: Optional[str] + is_reference: Optional[bool] + name: str + tags: Optional[dict[str, str]] + type: str + version: str + + @overload + def __init__( + self, + *, + connection_name: Optional[str] = ..., + data_uri: str, + description: Optional[str] = ..., + tags: Optional[dict[str, str]] = ..., + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluationRuleFilter(_Model): - agent_name: str + + class azure.ai.projects.models.DayOfWeek(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FRIDAY = "Friday" + MONDAY = "Monday" + SATURDAY = "Saturday" + SUNDAY = "Sunday" + THURSDAY = "Thursday" + TUESDAY = "Tuesday" + WEDNESDAY = "Wednesday" + + + class azure.ai.projects.models.DeleteAgentResponse(_Model): + deleted: bool + name: str + object: Literal[AgentObjectType.AGENT_DELETED] @overload def __init__( self, *, - agent_name: str + deleted: bool, + name: str, + object: Literal[AgentObjectType.AGENT_DELETED] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluationRunClusterInsightRequest(InsightRequest, discriminator='EvaluationRunClusterInsight'): - eval_id: str - model_configuration: Optional[InsightModelConfiguration] - run_ids: list[str] - type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] + class azure.ai.projects.models.DeleteAgentVersionResponse(_Model): + deleted: bool + name: str + object: Literal[AgentObjectType.AGENT_VERSION_DELETED] + version: str @overload def __init__( self, *, - eval_id: str, - model_configuration: Optional[InsightModelConfiguration] = ..., - run_ids: list[str] + deleted: bool, + name: str, + object: Literal[AgentObjectType.AGENT_VERSION_DELETED], + version: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluationRunClusterInsightResult(InsightResult, discriminator='EvaluationRunClusterInsight'): - cluster_insight: ClusterInsightResult - type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] + class azure.ai.projects.models.DeleteMemoryResult(_Model): + deleted: bool + memory_id: str + object: Literal[MemoryStoreObjectType.MEMORY_DELETED] @overload def __init__( self, *, - cluster_insight: ClusterInsightResult + deleted: bool, + memory_id: str, + object: Literal[MemoryStoreObjectType.MEMORY_DELETED] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluationScheduleTask(ScheduleTask, discriminator='Evaluation'): - configuration: dict[str, str] - eval_id: str - eval_run: dict[str, Any] - type: Literal[ScheduleTaskType.EVALUATION] + class azure.ai.projects.models.DeleteMemoryStoreResult(_Model): + deleted: bool + name: str + object: Literal[MemoryStoreObjectType.MEMORY_STORE_DELETED] @overload def __init__( self, *, - configuration: Optional[dict[str, str]] = ..., - eval_id: str, - eval_run: dict[str, Any] + deleted: bool, + name: str, + object: Literal[MemoryStoreObjectType.MEMORY_STORE_DELETED] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluationTarget(_Model): - type: str + class azure.ai.projects.models.DeleteSkillResult(_Model): + deleted: bool + id: str + name: str @overload def __init__( self, *, - type: str + deleted: bool, + id: str, + name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluationTaxonomy(_Model): - description: Optional[str] - id: Optional[str] + class azure.ai.projects.models.DeleteSkillVersionResult(_Model): + deleted: bool + id: str name: str - properties: Optional[dict[str, str]] - tags: Optional[dict[str, str]] - taxonomy_categories: Optional[list[TaxonomyCategory]] - taxonomy_input: EvaluationTaxonomyInput version: str @overload def __init__( self, *, - description: Optional[str] = ..., - properties: Optional[dict[str, str]] = ..., - tags: Optional[dict[str, str]] = ..., - taxonomy_categories: Optional[list[TaxonomyCategory]] = ..., - taxonomy_input: EvaluationTaxonomyInput + deleted: bool, + id: str, + name: str, + version: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluationTaxonomyInput(_Model): + class azure.ai.projects.models.Deployment(_Model): + name: str type: str @overload @@ -5691,128 +5606,135 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluationTaxonomyInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENT = "agent" - POLICY = "policy" + class azure.ai.projects.models.DeploymentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MODEL_DEPLOYMENT = "ModelDeployment" - class azure.ai.projects.models.EvaluatorCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENTS = "agents" - QUALITY = "quality" - SAFETY = "safety" + class azure.ai.projects.models.DigitalWorkerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + M365 = "m365" - class azure.ai.projects.models.EvaluatorCredentialRequest(_Model): - blob_uri: str + class azure.ai.projects.models.Dimension(_Model): + always_applicable: Optional[bool] + description: str + id: str + weight: int @overload def __init__( self, *, - blob_uri: str + always_applicable: Optional[bool] = ..., + description: str, + id: str, + weight: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluatorDefinition(_Model): - data_schema: Optional[dict[str, Any]] - init_parameters: Optional[dict[str, Any]] - metrics: Optional[dict[str, EvaluatorMetric]] - type: str + class azure.ai.projects.models.DispatchRoutineResult(_Model): + action_correlation_id: Optional[str] + dispatch_id: Optional[str] + task_id: Optional[str] @overload def __init__( self, *, - data_schema: Optional[dict[str, Any]] = ..., - init_parameters: Optional[dict[str, Any]] = ..., - metrics: Optional[dict[str, EvaluatorMetric]] = ..., - type: str + action_correlation_id: Optional[str] = ..., + dispatch_id: Optional[str] = ..., + task_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluatorDefinitionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CODE = "code" - ENDPOINT = "endpoint" - OPENAI_GRADERS = "openai_graders" - PROMPT = "prompt" - PROMPT_AND_CODE = "prompt_and_code" - RUBRIC = "rubric" - SERVICE = "service" - - - class azure.ai.projects.models.EvaluatorGenerationArtifacts(_Model): - dataset: DatasetReference - kinds: list[str] + class azure.ai.projects.models.EmbeddingConfiguration(_Model): + embedding_field: str + model_deployment_name: str @overload def __init__( self, *, - dataset: DatasetReference, - kinds: list[str] + embedding_field: str, + model_deployment_name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluatorGenerationInputs(_Model): - evaluator_description: Optional[str] - evaluator_display_name: Optional[str] - evaluator_name: str - model: str - sources: list[EvaluatorGenerationJobSource] + class azure.ai.projects.models.EmptyModelParam(_Model): + + + class azure.ai.projects.models.EndpointBasedEvaluatorDefinition(EvaluatorDefinition, discriminator='endpoint'): + connection_name: str + data_schema: dict[str, any] + init_parameters: dict[str, any] + metrics: dict[str, EvaluatorMetric] + type: Literal[EvaluatorDefinitionType.ENDPOINT] @overload def __init__( self, *, - evaluator_description: Optional[str] = ..., - evaluator_display_name: Optional[str] = ..., - evaluator_name: str, - model: str, - sources: list[EvaluatorGenerationJobSource] + connection_name: str, + data_schema: Optional[dict[str, Any]] = ..., + init_parameters: Optional[dict[str, Any]] = ..., + metrics: Optional[dict[str, EvaluatorMetric]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluatorGenerationJob(_Model): - created_at: datetime - error: Optional[ApiError] - finished_at: Optional[datetime] - id: str - input_quality_warnings: Optional[list[RubricGenerationInputQualityWarning]] - inputs: Optional[EvaluatorGenerationInputs] - result: Optional[EvaluatorVersion] - status: Union[str, JobStatus] - usage: Optional[EvaluatorGenerationTokenUsage] + class azure.ai.projects.models.EntraAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator='Entra'): + type: Literal[AgentEndpointAuthorizationSchemeType.ENTRA] @overload - def __init__( - self, - *, - inputs: Optional[EvaluatorGenerationInputs] = ... - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluatorGenerationJobSource(_Model): + class azure.ai.projects.models.EntraIDCredentials(BaseCredentials, discriminator='AAD'): + type: Literal[CredentialType.ENTRA_ID] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.EvalCsvFileIdSource(TypedDict, total=False): + key "id": Required[str] + key "type": Required[Literal["file_id"]] + + + class azure.ai.projects.models.EvalCsvRunDataSource(TypedDict, total=False): + key "source": Required[EvalCsvFileIdSource] + key "type": Required[Literal["csv"]] + + + class azure.ai.projects.models.EvalResult(_Model): + name: str + passed: bool + score: float type: str @overload def __init__( self, *, + name: str, + passed: bool, + score: float, type: str ) -> None: ... @@ -5820,458 +5742,340 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluatorGenerationJobSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENT = "agent" - DATASET = "dataset" - PROMPT = "prompt" - TRACES = "traces" - - - class azure.ai.projects.models.EvaluatorGenerationLROPoller(LROPoller[EvaluatorVersion]): - property details: Mapping[str, Any] # Read-only - - def __init__( - self, - client: Any, - initial_response: Any, - deserialization_callback: Any, - polling_method: Any - ) -> None: ... - - @classmethod - def from_continuation_token( - cls, - polling_method: PollingMethod[EvaluatorVersion], - continuation_token: str, - **kwargs: Any - ) -> EvaluatorGenerationLROPoller: ... - - - class azure.ai.projects.models.EvaluatorGenerationTokenUsage(_Model): - input_tokens: int - output_tokens: int - total_tokens: int + class azure.ai.projects.models.EvalRunResultCompareItem(_Model): + delta_estimate: float + p_value: float + treatment_effect: Union[str, TreatmentEffectType] + treatment_run_id: str + treatment_run_summary: EvalRunResultSummary @overload def __init__( self, *, - input_tokens: int, - output_tokens: int, - total_tokens: int + delta_estimate: float, + p_value: float, + treatment_effect: Union[str, TreatmentEffectType], + treatment_run_id: str, + treatment_run_summary: EvalRunResultSummary ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluatorMetric(_Model): - desirable_direction: Optional[Union[str, EvaluatorMetricDirection]] - is_primary: Optional[bool] - max_value: Optional[float] - min_value: Optional[float] - threshold: Optional[float] - type: Optional[Union[str, EvaluatorMetricType]] + class azure.ai.projects.models.EvalRunResultComparison(_Model): + baseline_run_summary: EvalRunResultSummary + compare_items: list[EvalRunResultCompareItem] + evaluator: str + metric: str + testing_criteria: str @overload def __init__( self, *, - desirable_direction: Optional[Union[str, EvaluatorMetricDirection]] = ..., - is_primary: Optional[bool] = ..., - max_value: Optional[float] = ..., - min_value: Optional[float] = ..., - threshold: Optional[float] = ..., - type: Optional[Union[str, EvaluatorMetricType]] = ... + baseline_run_summary: EvalRunResultSummary, + compare_items: list[EvalRunResultCompareItem], + evaluator: str, + metric: str, + testing_criteria: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluatorMetricDirection(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DECREASE = "decrease" - INCREASE = "increase" - NEUTRAL = "neutral" - - - class azure.ai.projects.models.EvaluatorMetricType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - BOOLEAN = "boolean" - CONTINUOUS = "continuous" - ORDINAL = "ordinal" - - - class azure.ai.projects.models.EvaluatorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - BUILT_IN = "builtin" - CUSTOM = "custom" - - - class azure.ai.projects.models.EvaluatorVersion(_Model): - categories: list[Union[str, EvaluatorCategory]] - created_at: datetime - created_by: str - definition: EvaluatorDefinition - description: Optional[str] - display_name: Optional[str] - evaluator_type: Union[str, EvaluatorType] - generation_artifacts: Optional[EvaluatorGenerationArtifacts] - generation_job_id: Optional[str] - id: Optional[str] - metadata: Optional[dict[str, str]] - modified_at: datetime - name: str - supported_evaluation_levels: Optional[list[Union[str, EvaluationLevel]]] - tags: Optional[dict[str, str]] - version: str - warnings: Optional[list[Union[str, GenerationWarningType]]] + class azure.ai.projects.models.EvalRunResultSummary(_Model): + average: float + run_id: str + sample_count: int + standard_deviation: float @overload def __init__( self, *, - categories: list[Union[str, EvaluatorCategory]], - definition: EvaluatorDefinition, - description: Optional[str] = ..., - display_name: Optional[str] = ..., - evaluator_type: Union[str, EvaluatorType], - metadata: Optional[dict[str, str]] = ..., - supported_evaluation_levels: Optional[list[Union[str, EvaluationLevel]]] = ..., - tags: Optional[dict[str, str]] = ... + average: float, + run_id: str, + sample_count: int, + standard_deviation: float ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ExternalAgentDefinition(AgentDefinition, discriminator='external'): - kind: Literal[AgentKind.EXTERNAL] - otel_agent_id: Optional[str] - rai_config: RaiConfig + class azure.ai.projects.models.EvaluationComparisonInsightRequest(InsightRequest, discriminator='EvaluationComparison'): + baseline_run_id: str + eval_id: str + treatment_run_ids: list[str] + type: Literal[InsightType.EVALUATION_COMPARISON] @overload def __init__( self, *, - otel_agent_id: Optional[str] = ..., - rai_config: Optional[RaiConfig] = ... + baseline_run_id: str, + eval_id: str, + treatment_run_ids: list[str] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FabricDataAgentToolParameters(_Model): - project_connections: Optional[list[ToolProjectConnection]] + class azure.ai.projects.models.EvaluationComparisonInsightResult(InsightResult, discriminator='EvaluationComparison'): + comparisons: list[EvalRunResultComparison] + method: str + type: Literal[InsightType.EVALUATION_COMPARISON] @overload def __init__( self, *, - project_connections: Optional[list[ToolProjectConnection]] = ... + comparisons: list[EvalRunResultComparison], + method: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FabricIQPreviewTool(Tool, discriminator='fabric_iq_preview'): - project_connection_id: str - require_approval: Optional[Union[MCPToolRequireApproval, str]] - server_label: Optional[str] - server_url: Optional[str] - type: Literal[ToolType.FABRIC_IQ_PREVIEW] + class azure.ai.projects.models.EvaluationLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONVERSATION = "conversation" + TURN = "turn" + + + class azure.ai.projects.models.EvaluationResultSample(InsightSample, discriminator='EvaluationResultSample'): + correlation_info: dict[str, any] + evaluation_result: EvalResult + features: dict[str, any] + id: str + type: Literal[SampleType.EVALUATION_RESULT_SAMPLE] @overload def __init__( self, *, - project_connection_id: str, - require_approval: Optional[Union[MCPToolRequireApproval, str]] = ..., - server_label: Optional[str] = ..., - server_url: Optional[str] = ... + correlation_info: dict[str, Any], + evaluation_result: EvalResult, + features: dict[str, Any], + id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FabricIQPreviewToolboxTool(ToolboxTool, discriminator='fabric_iq_preview'): - description: str - name: str - project_connection_id: str - require_approval: Optional[Union[MCPToolRequireApproval, str]] - server_label: Optional[str] - server_url: Optional[str] - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.FABRIC_IQ_PREVIEW] + class azure.ai.projects.models.EvaluationRule(_Model): + action: EvaluationRuleAction + description: Optional[str] + display_name: Optional[str] + enabled: bool + event_type: Union[str, EvaluationRuleEventType] + filter: Optional[EvaluationRuleFilter] + id: str + system_data: dict[str, str] @overload def __init__( self, *, + action: EvaluationRuleAction, description: Optional[str] = ..., - name: Optional[str] = ..., - project_connection_id: str, - require_approval: Optional[Union[MCPToolRequireApproval, str]] = ..., - server_label: Optional[str] = ..., - server_url: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + display_name: Optional[str] = ..., + enabled: bool, + event_type: Union[str, EvaluationRuleEventType], + filter: Optional[EvaluationRuleFilter] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FieldMapping(_Model): - content_fields: list[str] - filepath_field: Optional[str] - metadata_fields: Optional[list[str]] - title_field: Optional[str] - url_field: Optional[str] - vector_fields: Optional[list[str]] + class azure.ai.projects.models.EvaluationRuleAction(_Model): + type: str @overload def __init__( self, *, - content_fields: list[str], - filepath_field: Optional[str] = ..., - metadata_fields: Optional[list[str]] = ..., - title_field: Optional[str] = ..., - url_field: Optional[str] = ..., - vector_fields: Optional[list[str]] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FileDataGenerationJobOutput(DataGenerationJobOutput, discriminator='file'): - filename: str - id: str - type: Literal[DataGenerationJobOutputType.FILE] + class azure.ai.projects.models.EvaluationRuleActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONTINUOUS_EVALUATION = "continuousEvaluation" + HUMAN_EVALUATION_PREVIEW = "humanEvaluationPreview" - @overload - def __init__(self) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.EvaluationRuleEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MANUAL = "manual" + RESPONSE_COMPLETED = "responseCompleted" - class azure.ai.projects.models.FileDataGenerationJobSource(DataGenerationJobSource, discriminator='file'): - description: str - id: str - type: Literal[DataGenerationJobSourceType.FILE] + class azure.ai.projects.models.EvaluationRuleFilter(_Model): + agent_name: str @overload def __init__( self, *, - description: Optional[str] = ..., - id: str + agent_name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FileDatasetVersion(DatasetVersion, discriminator='uri_file'): - connection_name: str - data_uri: str - description: str - id: str - is_reference: bool - name: str - tags: dict[str, str] - type: Literal[DatasetType.URI_FILE] - version: str + class azure.ai.projects.models.EvaluationRunClusterInsightRequest(InsightRequest, discriminator='EvaluationRunClusterInsight'): + eval_id: str + model_configuration: Optional[InsightModelConfiguration] + run_ids: list[str] + type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] @overload def __init__( self, *, - connection_name: Optional[str] = ..., - data_uri: str, - description: Optional[str] = ..., - tags: Optional[dict[str, str]] = ... + eval_id: str, + model_configuration: Optional[InsightModelConfiguration] = ..., + run_ids: list[str] ) -> None: ... @overload 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] + class azure.ai.projects.models.EvaluationRunClusterInsightResult(InsightResult, discriminator='EvaluationRunClusterInsight'): + cluster_insight: ClusterInsightResult + type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] @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] + cluster_insight: ClusterInsightResult ) -> 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] - max_num_results: Optional[int] - name: str - ranking_options: Optional[RankingOptions] - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.FILE_SEARCH] - vector_store_ids: Optional[list[str]] + class azure.ai.projects.models.EvaluationScheduleTask(ScheduleTask, discriminator='Evaluation'): + configuration: dict[str, str] + eval_id: str + eval_run: dict[str, Any] + type: Literal[ScheduleTaskType.EVALUATION] @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: Optional[list[str]] = ... + configuration: Optional[dict[str, str]] = ..., + eval_id: str, + eval_run: dict[str, Any] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FixedRatioVersionSelectionRule(VersionSelectionRule, discriminator='FixedRatio'): - agent_version: str - traffic_percentage: int - type: Literal[VersionSelectorType.FIXED_RATIO] + class azure.ai.projects.models.EvaluationTarget(_Model): + type: str @overload def __init__( self, *, - agent_version: str, - traffic_percentage: int + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FolderDatasetVersion(DatasetVersion, discriminator='uri_folder'): - connection_name: str - data_uri: str - description: str - id: str - is_reference: bool + class azure.ai.projects.models.EvaluationTaxonomy(_Model): + description: Optional[str] + id: Optional[str] name: str - tags: dict[str, str] - type: Literal[DatasetType.URI_FOLDER] + properties: Optional[dict[str, str]] + tags: Optional[dict[str, str]] + taxonomy_categories: Optional[list[TaxonomyCategory]] + taxonomy_input: EvaluationTaxonomyInput version: str @overload def __init__( self, *, - connection_name: Optional[str] = ..., - data_uri: str, description: Optional[str] = ..., - tags: Optional[dict[str, str]] = ... + properties: Optional[dict[str, str]] = ..., + tags: Optional[dict[str, str]] = ..., + taxonomy_categories: Optional[list[TaxonomyCategory]] = ..., + taxonomy_input: EvaluationTaxonomyInput ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FoundryModelArtifactProfileCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DATA_ONLY = "DataOnly" - RUNTIME_DEPENDENT = "RuntimeDependent" - UNKNOWN = "Unknown" - - - class azure.ai.projects.models.FoundryModelArtifactProfileSignal(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CUSTOM_PYTHON_CODE = "CustomPythonCode" - DYNAMIC_OPS = "DynamicOps" - NATIVE_BINARY = "NativeBinary" - PICKLE_DESERIALIZATION = "PickleDeserialization" - UNKNOWN_FORMAT = "UnknownFormat" - - - class azure.ai.projects.models.FoundryModelSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - LOCAL_UPLOAD = "LocalUpload" - TRAINING_JOB = "TrainingJob" - - - class azure.ai.projects.models.FoundryModelWarning(_Model): - code: Optional[Union[str, FoundryModelWarningCode]] - message: Optional[str] + class azure.ai.projects.models.EvaluationTaxonomyInput(_Model): + type: str @overload def __init__( self, *, - code: Optional[Union[str, FoundryModelWarningCode]] = ..., - message: Optional[str] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FoundryModelWarningCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - RUNTIME_DEPENDENT_ARTIFACT = "RuntimeDependentArtifact" - UNCLASSIFIED_ARTIFACT = "UnclassifiedArtifact" + class azure.ai.projects.models.EvaluationTaxonomyInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT = "agent" + POLICY = "policy" - class azure.ai.projects.models.FoundryModelWeightType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DRAFT_MODEL = "DraftModel" - FULL_WEIGHT = "FullWeight" - LO_RA = "LoRA" + class azure.ai.projects.models.EvaluatorCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENTS = "agents" + QUALITY = "quality" + SAFETY = "safety" - 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] + class azure.ai.projects.models.EvaluatorCredentialRequest(_Model): + blob_uri: str @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]] = ... + blob_uri: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FunctionShellToolParamEnvironment(_Model): + class azure.ai.projects.models.EvaluatorDefinition(_Model): + data_schema: Optional[dict[str, Any]] + init_parameters: Optional[dict[str, Any]] + metrics: Optional[dict[str, EvaluatorMetric]] type: str @overload def __init__( self, *, + data_schema: Optional[dict[str, Any]] = ..., + init_parameters: Optional[dict[str, Any]] = ..., + metrics: Optional[dict[str, EvaluatorMetric]] = ..., type: str ) -> None: ... @@ -6279,861 +6083,864 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FunctionShellToolParamEnvironmentContainerReferenceParam(FunctionShellToolParamEnvironment, discriminator='container_reference'): - container_id: str - type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE] + class azure.ai.projects.models.EvaluatorDefinitionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CODE = "code" + ENDPOINT = "endpoint" + OPENAI_GRADERS = "openai_graders" + PROMPT = "prompt" + PROMPT_AND_CODE = "prompt_and_code" + RUBRIC = "rubric" + SERVICE = "service" + + + class azure.ai.projects.models.EvaluatorGenerationArtifacts(_Model): + dataset: DatasetReference + kinds: list[str] @overload def __init__( self, *, - container_id: str + dataset: DatasetReference, + kinds: list[str] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FunctionShellToolParamEnvironmentLocalEnvironmentParam(FunctionShellToolParamEnvironment, discriminator='local'): - skills: Optional[list[LocalSkillParam]] - type: Literal[FunctionShellToolParamEnvironmentType.LOCAL] + class azure.ai.projects.models.EvaluatorGenerationInputs(_Model): + evaluator_description: Optional[str] + evaluator_display_name: Optional[str] + evaluator_name: str + model: str + sources: list[EvaluatorGenerationJobSource] @overload def __init__( self, *, - skills: Optional[list[LocalSkillParam]] = ... + evaluator_description: Optional[str] = ..., + evaluator_display_name: Optional[str] = ..., + evaluator_name: str, + model: str, + sources: list[EvaluatorGenerationJobSource] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FunctionShellToolParamEnvironmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CONTAINER_AUTO = "container_auto" - CONTAINER_REFERENCE = "container_reference" - LOCAL = "local" - - - class azure.ai.projects.models.FunctionTool(Tool, discriminator='function'): - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] - 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] + class azure.ai.projects.models.EvaluatorGenerationJob(_Model): + created_at: datetime + error: Optional[ApiError] + finished_at: Optional[datetime] + id: str + input_quality_warnings: Optional[list[RubricGenerationInputQualityWarning]] + inputs: Optional[EvaluatorGenerationInputs] + result: Optional[EvaluatorVersion] + status: Union[str, JobStatus] + usage: Optional[EvaluatorGenerationTokenUsage] @overload def __init__( self, *, - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., - defer_loading: Optional[bool] = ..., - description: Optional[str] = ..., - name: str, - output_schema: Optional[dict[str, Any]] = ..., - parameters: dict[str, Any], - strict: bool + inputs: Optional[EvaluatorGenerationInputs] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FunctionToolParam(_Model): - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] - defer_loading: Optional[bool] - description: Optional[str] - name: str - output_schema: Optional[dict[str, Any]] - parameters: Optional[EmptyModelParam] - strict: Optional[bool] - type: Literal["function"] + class azure.ai.projects.models.EvaluatorGenerationJobSource(_Model): + type: str @overload def __init__( self, *, - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., - defer_loading: Optional[bool] = ..., - description: Optional[str] = ..., - name: str, - output_schema: Optional[dict[str, Any]] = ..., - parameters: Optional[EmptyModelParam] = ..., - strict: Optional[bool] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.GenerationWarningType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - INPUT_QUALITY = "input_quality" - - - class azure.ai.projects.models.GitHubIssueEvent(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CLOSED = "closed" - OPENED = "opened" + class azure.ai.projects.models.EvaluatorGenerationJobSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT = "agent" + DATASET = "dataset" + PROMPT = "prompt" + TRACES = "traces" - class azure.ai.projects.models.GitHubIssueRoutineTrigger(RoutineTrigger, discriminator='github_issue'): - connection_id: str - issue_event: Union[str, GitHubIssueEvent] - owner: str - repository: str - type: Literal[RoutineTriggerType.GITHUB_ISSUE] + class azure.ai.projects.models.EvaluatorGenerationLROPoller(LROPoller[EvaluatorVersion]): + property details: Mapping[str, Any] # Read-only - @overload def __init__( self, - *, - connection_id: str, - issue_event: Union[str, GitHubIssueEvent], - owner: str, - repository: str + client: Any, + initial_response: Any, + deserialization_callback: Any, + polling_method: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.GrammarSyntax1(str, Enum, metaclass=CaseInsensitiveEnumMeta): - LARK = "lark" - REGEX = "regex" + @classmethod + def from_continuation_token( + cls, + polling_method: PollingMethod[EvaluatorVersion], + continuation_token: str, + **kwargs: Any + ) -> EvaluatorGenerationLROPoller: ... - class azure.ai.projects.models.HeaderTelemetryEndpointAuth(TelemetryEndpointAuth, discriminator='header'): - header_name: str - secret_id: str - secret_key: str - type: Literal[TelemetryEndpointAuthType.HEADER] + class azure.ai.projects.models.EvaluatorGenerationTokenUsage(_Model): + input_tokens: int + output_tokens: int + total_tokens: int @overload def __init__( self, *, - header_name: str, - secret_id: str, - secret_key: str + input_tokens: int, + output_tokens: int, + total_tokens: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.HostedAgentDefinition(AgentDefinition, discriminator='hosted'): - code_configuration: Optional[CodeConfiguration] - container_configuration: Optional[ContainerConfiguration] - cpu: str - environment_variables: Optional[dict[str, str]] - kind: Literal[AgentKind.HOSTED] - memory: str - protocol_versions: Optional[list[ProtocolVersionRecord]] - rai_config: RaiConfig - telemetry_config: Optional[TelemetryConfig] + class azure.ai.projects.models.EvaluatorMetric(_Model): + desirable_direction: Optional[Union[str, EvaluatorMetricDirection]] + is_primary: Optional[bool] + max_value: Optional[float] + min_value: Optional[float] + threshold: Optional[float] + type: Optional[Union[str, EvaluatorMetricType]] @overload def __init__( self, *, - code_configuration: Optional[CodeConfiguration] = ..., - container_configuration: Optional[ContainerConfiguration] = ..., - cpu: str, - environment_variables: Optional[dict[str, str]] = ..., - memory: str, - protocol_versions: Optional[list[ProtocolVersionRecord]] = ..., - rai_config: Optional[RaiConfig] = ..., - telemetry_config: Optional[TelemetryConfig] = ... + desirable_direction: Optional[Union[str, EvaluatorMetricDirection]] = ..., + is_primary: Optional[bool] = ..., + max_value: Optional[float] = ..., + min_value: Optional[float] = ..., + threshold: Optional[float] = ..., + type: Optional[Union[str, EvaluatorMetricType]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.HourlyRecurrenceSchedule(RecurrenceSchedule, discriminator='Hourly'): - type: Literal[RecurrenceType.HOURLY] + class azure.ai.projects.models.EvaluatorMetricDirection(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DECREASE = "decrease" + INCREASE = "increase" + NEUTRAL = "neutral" - @overload - def __init__(self) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.EvaluatorMetricType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BOOLEAN = "boolean" + CONTINUOUS = "continuous" + ORDINAL = "ordinal" - class azure.ai.projects.models.HumanEvaluationPreviewRuleAction(EvaluationRuleAction, discriminator='humanEvaluationPreview'): - template_id: str - type: Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW] + class azure.ai.projects.models.EvaluatorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BUILT_IN = "builtin" + CUSTOM = "custom" + + + class azure.ai.projects.models.EvaluatorVersion(_Model): + categories: list[Union[str, EvaluatorCategory]] + created_at: datetime + created_by: str + definition: EvaluatorDefinition + description: Optional[str] + display_name: Optional[str] + evaluator_type: Union[str, EvaluatorType] + generation_artifacts: Optional[EvaluatorGenerationArtifacts] + generation_job_id: Optional[str] + id: Optional[str] + metadata: Optional[dict[str, str]] + modified_at: datetime + name: str + supported_evaluation_levels: Optional[list[Union[str, EvaluationLevel]]] + tags: Optional[dict[str, str]] + version: str + warnings: Optional[list[Union[str, GenerationWarningType]]] @overload def __init__( self, *, - template_id: str + categories: list[Union[str, EvaluatorCategory]], + definition: EvaluatorDefinition, + description: Optional[str] = ..., + display_name: Optional[str] = ..., + evaluator_type: Union[str, EvaluatorType], + metadata: Optional[dict[str, str]] = ..., + supported_evaluation_levels: Optional[list[Union[str, EvaluationLevel]]] = ..., + tags: Optional[dict[str, str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.HybridSearchOptions(_Model): - embedding_weight: float - text_weight: float + class azure.ai.projects.models.ExternalAgentDefinition(AgentDefinition, discriminator='external'): + kind: Literal[AgentKind.EXTERNAL] + otel_agent_id: Optional[str] + rai_config: RaiConfig @overload def __init__( self, *, - embedding_weight: float, - text_weight: float + otel_agent_id: Optional[str] = ..., + rai_config: Optional[RaiConfig] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ImageGenAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AUTO = "auto" - EDIT = "edit" - 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"], 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"]] - size: Optional[Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str]] - tool_configs: Optional[dict[str, ToolConfig]] - type: Literal[ToolType.IMAGE_GENERATION] + class azure.ai.projects.models.FabricDataAgentToolParameters(_Model): + project_connections: Optional[list[ToolProjectConnection]] @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], 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]] = ..., - size: Optional[Union[Literal[1024x1024], Literal[1024x1536], Literal[1536x1024], Literal[auto], str]] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + project_connections: Optional[list[ToolProjectConnection]] = ... ) -> 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] + class azure.ai.projects.models.FabricIQPreviewTool(Tool, discriminator='fabric_iq_preview'): + project_connection_id: str + require_approval: Optional[Union[MCPToolRequireApproval, str]] + server_label: Optional[str] + server_url: Optional[str] + type: Literal[ToolType.FABRIC_IQ_PREVIEW] @overload def __init__( self, *, - file_id: Optional[str] = ..., - image_url: Optional[str] = ... + project_connection_id: str, + require_approval: Optional[Union[MCPToolRequireApproval, str]] = ..., + server_label: Optional[str] = ..., + server_url: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.Index(_Model): - description: Optional[str] - id: Optional[str] + class azure.ai.projects.models.FabricIQPreviewToolboxTool(ToolboxTool, discriminator='fabric_iq_preview'): + description: str name: str - tags: Optional[dict[str, str]] - type: str - version: str + project_connection_id: str + require_approval: Optional[Union[MCPToolRequireApproval, str]] + server_label: Optional[str] + server_url: Optional[str] + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.FABRIC_IQ_PREVIEW] @overload def __init__( self, *, description: Optional[str] = ..., - tags: Optional[dict[str, str]] = ..., - type: str + name: Optional[str] = ..., + project_connection_id: str, + require_approval: Optional[Union[MCPToolRequireApproval, str]] = ..., + server_label: Optional[str] = ..., + server_url: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.IndexType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AZURE_SEARCH = "AzureSearch" - COSMOS_DB = "CosmosDBNoSqlVectorStore" - MANAGED_AZURE_SEARCH = "ManagedAzureSearch" - - - class azure.ai.projects.models.InlineSkillParam(ContainerSkill, discriminator='inline'): - description: str - name: str - source: InlineSkillSourceParam - type: Literal[ContainerSkillType.INLINE] + class azure.ai.projects.models.FieldMapping(_Model): + content_fields: list[str] + filepath_field: Optional[str] + metadata_fields: Optional[list[str]] + title_field: Optional[str] + url_field: Optional[str] + vector_fields: Optional[list[str]] @overload def __init__( self, *, - description: str, - name: str, - source: InlineSkillSourceParam + content_fields: list[str], + filepath_field: Optional[str] = ..., + metadata_fields: Optional[list[str]] = ..., + title_field: Optional[str] = ..., + url_field: Optional[str] = ..., + vector_fields: Optional[list[str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.InlineSkillSourceParam(_Model): - data: str - media_type: Literal["application/zip"] - type: Literal["base64"] + class azure.ai.projects.models.FileDataGenerationJobOutput(DataGenerationJobOutput, discriminator='file'): + filename: str + id: str + type: Literal[DataGenerationJobOutputType.FILE] @overload - def __init__( - self, - *, - data: str - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.InputFidelity(str, Enum, metaclass=CaseInsensitiveEnumMeta): - HIGH = "high" - LOW = "low" - - - class azure.ai.projects.models.Insight(_Model): - display_name: str - insight_id: str - metadata: InsightsMetadata - request: InsightRequest - result: Optional[InsightResult] - state: Union[str, OperationState] + class azure.ai.projects.models.FileDataGenerationJobSource(DataGenerationJobSource, discriminator='file'): + description: str + id: str + type: Literal[DataGenerationJobSourceType.FILE] @overload def __init__( self, *, - display_name: str, - request: InsightRequest + description: Optional[str] = ..., + id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.InsightCluster(_Model): + class azure.ai.projects.models.FileDatasetVersion(DatasetVersion, discriminator='uri_file'): + connection_name: str + data_uri: str description: str id: str - label: str - samples: Optional[list[InsightSample]] - sub_clusters: Optional[list[InsightCluster]] - suggestion: str - suggestion_title: str - weight: int + is_reference: bool + name: str + tags: dict[str, str] + type: Literal[DatasetType.URI_FILE] + version: str @overload def __init__( self, *, - description: str, - id: str, - label: str, - samples: Optional[list[InsightSample]] = ..., - sub_clusters: Optional[list[InsightCluster]] = ..., - suggestion: str, - suggestion_title: str, - weight: int + connection_name: Optional[str] = ..., + data_uri: str, + description: Optional[str] = ..., + tags: Optional[dict[str, str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.InsightModelConfiguration(_Model): - model_deployment_name: str + 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, *, - model_deployment_name: str + 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.InsightRequest(_Model): - type: str + class azure.ai.projects.models.FileSearchToolboxTool(ToolboxTool, discriminator='file_search'): + description: str + filters: Optional[Filters] + max_num_results: Optional[int] + name: str + ranking_options: Optional[RankingOptions] + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.FILE_SEARCH] + vector_store_ids: Optional[list[str]] @overload def __init__( self, *, - type: str + 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: Optional[list[str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.InsightResult(_Model): - type: str + class azure.ai.projects.models.FixedRatioVersionSelectionRule(VersionSelectionRule, discriminator='FixedRatio'): + agent_version: str + traffic_percentage: int + type: Literal[VersionSelectorType.FIXED_RATIO] @overload def __init__( self, *, - type: str + agent_version: str, + traffic_percentage: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.InsightSample(_Model): - correlation_info: dict[str, Any] - features: dict[str, Any] + class azure.ai.projects.models.FolderDatasetVersion(DatasetVersion, discriminator='uri_folder'): + connection_name: str + data_uri: str + description: str id: str - type: str - - @overload - def __init__( - self, - *, - correlation_info: dict[str, Any], - features: dict[str, Any], - id: str, - type: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.InsightScheduleTask(ScheduleTask, discriminator='Insight'): - configuration: dict[str, str] - insight: Insight - type: Literal[ScheduleTaskType.INSIGHT] + is_reference: bool + name: str + tags: dict[str, str] + type: Literal[DatasetType.URI_FOLDER] + version: str @overload def __init__( self, *, - configuration: Optional[dict[str, str]] = ..., - insight: Insight + connection_name: Optional[str] = ..., + data_uri: str, + description: Optional[str] = ..., + tags: Optional[dict[str, str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.InsightSummary(_Model): - method: str - sample_count: int - unique_cluster_count: int - unique_subcluster_count: int - usage: ClusterTokenUsage + class azure.ai.projects.models.FoundryModelArtifactProfileCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DATA_ONLY = "DataOnly" + RUNTIME_DEPENDENT = "RuntimeDependent" + UNKNOWN = "Unknown" - @overload - def __init__( - self, - *, - method: str, - sample_count: int, - unique_cluster_count: int, - unique_subcluster_count: int, - usage: ClusterTokenUsage - ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.FoundryModelArtifactProfileSignal(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CUSTOM_PYTHON_CODE = "CustomPythonCode" + DYNAMIC_OPS = "DynamicOps" + NATIVE_BINARY = "NativeBinary" + PICKLE_DESERIALIZATION = "PickleDeserialization" + UNKNOWN_FORMAT = "UnknownFormat" - class azure.ai.projects.models.InsightType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENT_CLUSTER_INSIGHT = "AgentClusterInsight" - EVALUATION_COMPARISON = "EvaluationComparison" - EVALUATION_RUN_CLUSTER_INSIGHT = "EvaluationRunClusterInsight" + class azure.ai.projects.models.FoundryModelSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LOCAL_UPLOAD = "LocalUpload" + TRAINING_JOB = "TrainingJob" - class azure.ai.projects.models.InsightsMetadata(_Model): - completed_at: Optional[datetime] - created_at: datetime + class azure.ai.projects.models.FoundryModelWarning(_Model): + code: Optional[Union[str, FoundryModelWarningCode]] + message: Optional[str] @overload def __init__( self, *, - completed_at: Optional[datetime] = ..., - created_at: datetime + code: Optional[Union[str, FoundryModelWarningCode]] = ..., + message: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.InvocationsProtocolConfiguration(_Model): + class azure.ai.projects.models.FoundryModelWarningCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + RUNTIME_DEPENDENT_ARTIFACT = "RuntimeDependentArtifact" + UNCLASSIFIED_ARTIFACT = "UnclassifiedArtifact" - class azure.ai.projects.models.InvocationsWsProtocolConfiguration(_Model): + class azure.ai.projects.models.FoundryModelWeightType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DRAFT_MODEL = "DraftModel" + FULL_WEIGHT = "FullWeight" + LO_RA = "LoRA" - class azure.ai.projects.models.InvokeAgentInvocationsApiDispatchPayload(RoutineDispatchPayload, discriminator='invoke_agent_invocations_api'): - input: Any - type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API] + 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, *, - input: Any + 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.InvokeAgentInvocationsApiRoutineAction(RoutineAction, discriminator='invoke_agent_invocations_api'): - agent_endpoint_id: Optional[str] - agent_name: Optional[str] - input: Optional[Any] - session_id: Optional[str] - type: Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API] + class azure.ai.projects.models.FunctionShellToolParamEnvironment(_Model): + type: str @overload def __init__( self, *, - agent_endpoint_id: Optional[str] = ..., - agent_name: Optional[str] = ..., - input: Optional[Any] = ..., - session_id: Optional[str] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.InvokeAgentResponsesApiDispatchPayload(RoutineDispatchPayload, discriminator='invoke_agent_responses_api'): - input: Any - type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API] + class azure.ai.projects.models.FunctionShellToolParamEnvironmentContainerReferenceParam(FunctionShellToolParamEnvironment, discriminator='container_reference'): + container_id: str + type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE] @overload def __init__( self, *, - input: Any + container_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.InvokeAgentResponsesApiRoutineAction(RoutineAction, discriminator='invoke_agent_responses_api'): - agent_endpoint_id: Optional[str] - agent_name: Optional[str] - conversation: Optional[str] - input: Optional[Any] - type: Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API] + class azure.ai.projects.models.FunctionShellToolParamEnvironmentLocalEnvironmentParam(FunctionShellToolParamEnvironment, discriminator='local'): + skills: Optional[list[LocalSkillParam]] + type: Literal[FunctionShellToolParamEnvironmentType.LOCAL] @overload def __init__( self, *, - agent_endpoint_id: Optional[str] = ..., - agent_name: Optional[str] = ..., - conversation: Optional[str] = ..., - input: Optional[Any] = ... + skills: Optional[list[LocalSkillParam]] = ... ) -> 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.FunctionShellToolParamEnvironmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONTAINER_AUTO = "container_auto" + CONTAINER_REFERENCE = "container_reference" + LOCAL = "local" - class azure.ai.projects.models.LlmGeneratedVoiceGreetingConfig(VoiceGreetingConfig, discriminator='llm_generated'): - prompt: str - tool_choice: Optional[VoiceAgentToolChoice] - type: Literal["llm_generated"] + class azure.ai.projects.models.FunctionTool(Tool, discriminator='function'): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] + 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, *, - prompt: str, - tool_choice: Optional[VoiceAgentToolChoice] = ... + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., + 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.LocalShellToolParam(Tool, discriminator='local_shell'): + class azure.ai.projects.models.FunctionToolParam(_Model): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] + defer_loading: Optional[bool] description: Optional[str] - name: Optional[str] - tool_configs: Optional[dict[str, ToolConfig]] - type: Literal[ToolType.LOCAL_SHELL] - + name: str + output_schema: Optional[dict[str, Any]] + parameters: Optional[EmptyModelParam] + strict: Optional[bool] + type: Literal["function"] + @overload def __init__( self, *, + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., + defer_loading: Optional[bool] = ..., description: Optional[str] = ..., - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + name: str, + output_schema: Optional[dict[str, Any]] = ..., + parameters: Optional[EmptyModelParam] = ..., + strict: Optional[bool] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.LocalSkillParam(_Model): - description: str + class azure.ai.projects.models.GenerateVoiceAgentRequest(_Model): + description: Optional[str] + draft: Optional[bool] + goal: Optional[str] + kind: Literal[AgentKind.VOICE] + model: Optional[str] + model_type: Optional[Union[str, VoiceModelType]] name: str - path: str + tools: Optional[list[VoiceAgentTool]] + use_case: Optional[str] @overload def __init__( self, *, - description: str, + description: Optional[str] = ..., + draft: Optional[bool] = ..., + goal: Optional[str] = ..., + kind: Literal[AgentKind.VOICE], + model: Optional[str] = ..., + model_type: Optional[Union[str, VoiceModelType]] = ..., name: str, - path: str + tools: Optional[list[VoiceAgentTool]] = ..., + use_case: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.LogProbProperties(_Model): - bytes: list[int] - logprob: float - token: str + class azure.ai.projects.models.GenerationWarningType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INPUT_QUALITY = "input_quality" + + + class azure.ai.projects.models.GitHubIssueEvent(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CLOSED = "closed" + OPENED = "opened" + + + class azure.ai.projects.models.GitHubIssueRoutineTrigger(RoutineTrigger, discriminator='github_issue'): + connection_id: str + issue_event: Union[str, GitHubIssueEvent] + owner: str + repository: str + type: Literal[RoutineTriggerType.GITHUB_ISSUE] @overload def __init__( self, *, - bytes: list[int], - logprob: float, - token: str + connection_id: str, + issue_event: Union[str, GitHubIssueEvent], + owner: str, + repository: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.LoraConfig(_Model): - alpha: Optional[int] - dropout: Optional[float] - rank: Optional[int] - target_modules: Optional[list[str]] + class azure.ai.projects.models.GrammarSyntax1(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LARK = "lark" + REGEX = "regex" + + + class azure.ai.projects.models.HeaderTelemetryEndpointAuth(TelemetryEndpointAuth, discriminator='header'): + header_name: str + secret_id: str + secret_key: str + type: Literal[TelemetryEndpointAuthType.HEADER] @overload def __init__( self, *, - alpha: Optional[int] = ..., - dropout: Optional[float] = ..., - rank: Optional[int] = ..., - target_modules: Optional[list[str]] = ... + header_name: str, + secret_id: str, + secret_key: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MCPListToolsTool(_Model): - annotations: Optional[MCPListToolsToolAnnotations] - description: Optional[str] - input_schema: MCPListToolsToolInputSchema - name: str + class azure.ai.projects.models.HostedAgentDefinition(AgentDefinition, discriminator='hosted'): + code_configuration: Optional[CodeConfiguration] + container_configuration: Optional[ContainerConfiguration] + cpu: str + environment_variables: Optional[dict[str, str]] + kind: Literal[AgentKind.HOSTED] + memory: str + protocol_versions: Optional[list[ProtocolVersionRecord]] + rai_config: RaiConfig + session_configuration: Optional[SessionConfiguration] + telemetry_config: Optional[TelemetryConfig] @overload def __init__( self, *, - annotations: Optional[MCPListToolsToolAnnotations] = ..., - description: Optional[str] = ..., - input_schema: MCPListToolsToolInputSchema, - name: str + code_configuration: Optional[CodeConfiguration] = ..., + container_configuration: Optional[ContainerConfiguration] = ..., + cpu: str, + environment_variables: Optional[dict[str, str]] = ..., + memory: str, + protocol_versions: Optional[list[ProtocolVersionRecord]] = ..., + rai_config: Optional[RaiConfig] = ..., + session_configuration: Optional[SessionConfiguration] = ..., + telemetry_config: Optional[TelemetryConfig] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MCPListToolsToolAnnotations(_Model): - - - class azure.ai.projects.models.MCPListToolsToolInputSchema(_Model): - - - class azure.ai.projects.models.MCPTool(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] + class azure.ai.projects.models.HourlyRecurrenceSchedule(RecurrenceSchedule, discriminator='Hourly'): + type: Literal[RecurrenceType.HOURLY] @overload - def __init__( - self, - *, - 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: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MCPToolFilter(_Model): - read_only: Optional[bool] - tool_names: Optional[list[str]] + class azure.ai.projects.models.HumanEvaluationPreviewRuleAction(EvaluationRuleAction, discriminator='humanEvaluationPreview'): + template_id: str + type: Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW] @overload def __init__( self, *, - read_only: Optional[bool] = ..., - tool_names: Optional[list[str]] = ... + template_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MCPToolRequireApproval(_Model): - always: Optional[MCPToolFilter] - never: Optional[MCPToolFilter] + class azure.ai.projects.models.HybridSearchOptions(_Model): + embedding_weight: float + text_weight: float @overload def __init__( self, *, - always: Optional[MCPToolFilter] = ..., - never: Optional[MCPToolFilter] = ... + embedding_weight: float, + text_weight: float ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MCPToolboxTool(ToolboxTool, 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] - description: str - headers: Optional[dict[str, str]] - name: 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: dict[str, ToolConfig] - tunnel_id: Optional[str] - type: Literal[ToolboxToolType.MCP] + class azure.ai.projects.models.ImageGenAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "auto" + EDIT = "edit" + 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"], 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"]] + 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, *, - 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] = ..., + action: Optional[Union[str, ImageGenAction]] = ..., + background: Optional[Literal[transparent, opaque, auto]] = ..., description: Optional[str] = ..., - headers: Optional[dict[str, 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], str]] = ..., + moderation: Optional[Literal[auto, low]] = ..., name: Optional[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] = ... + output_compression: Optional[int] = ..., + output_format: Optional[Literal[png, webp, jpeg]] = ..., + partial_images: Optional[int] = ..., + 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: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ManagedAgentIdentityBlueprintReference(AgentBlueprintReference, discriminator='ManagedAgentIdentityBlueprint'): - blueprint_id: str - type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] + class azure.ai.projects.models.ImageGenToolInputImageMask(_Model): + file_id: Optional[str] + image_url: Optional[str] @overload def __init__( self, *, - blueprint_id: str + file_id: Optional[str] = ..., + image_url: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ManagedAzureAISearchIndex(Index, discriminator='ManagedAzureSearch'): - description: str - id: str + class azure.ai.projects.models.Index(_Model): + description: Optional[str] + id: Optional[str] name: str - tags: dict[str, str] - type: Literal[IndexType.MANAGED_AZURE_SEARCH] - vector_store_id: str + tags: Optional[dict[str, str]] + type: str version: str @overload @@ -7142,917 +6949,993 @@ namespace azure.ai.projects.models *, description: Optional[str] = ..., tags: Optional[dict[str, str]] = ..., - vector_store_id: str + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.McpProtocolConfiguration(_Model): + class azure.ai.projects.models.IndexType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_SEARCH = "AzureSearch" + COSMOS_DB = "CosmosDBNoSqlVectorStore" + MANAGED_AZURE_SEARCH = "ManagedAzureSearch" - class azure.ai.projects.models.MemoryItem(_Model): - content: str - kind: str - memory_id: str - scope: str - updated_at: datetime + class azure.ai.projects.models.InlineSkillParam(ContainerSkill, discriminator='inline'): + description: str + name: str + source: InlineSkillSourceParam + type: Literal[ContainerSkillType.INLINE] @overload def __init__( self, *, - content: str, - kind: str, - memory_id: str, - scope: str, - updated_at: datetime + description: str, + name: str, + source: InlineSkillSourceParam ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryItemKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CHAT_SUMMARY = "chat_summary" - PROCEDURAL = "procedural" - USER_PROFILE = "user_profile" - - - class azure.ai.projects.models.MemoryOperation(_Model): - kind: Union[str, MemoryOperationKind] - memory_item: MemoryItem + class azure.ai.projects.models.InlineSkillSourceParam(_Model): + data: str + media_type: Literal["application/zip"] + type: Literal["base64"] @overload def __init__( self, *, - kind: Union[str, MemoryOperationKind], - memory_item: MemoryItem + data: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryOperationKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CREATE = "create" - DELETE = "delete" - UPDATE = "update" + class azure.ai.projects.models.InputFidelity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HIGH = "high" + LOW = "low" - class azure.ai.projects.models.MemorySearchItem(_Model): - memory_item: MemoryItem + class azure.ai.projects.models.Insight(_Model): + display_name: str + insight_id: str + metadata: InsightsMetadata + request: InsightRequest + result: Optional[InsightResult] + state: Union[str, OperationState] @overload def __init__( self, *, - memory_item: MemoryItem + display_name: str, + request: InsightRequest ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemorySearchOptions(_Model): - max_memories: Optional[int] + class azure.ai.projects.models.InsightCluster(_Model): + description: str + id: str + label: str + samples: Optional[list[InsightSample]] + sub_clusters: Optional[list[InsightCluster]] + suggestion: str + suggestion_title: str + weight: int @overload def __init__( self, *, - max_memories: Optional[int] = ... + description: str, + id: str, + label: str, + samples: Optional[list[InsightSample]] = ..., + sub_clusters: Optional[list[InsightCluster]] = ..., + suggestion: str, + suggestion_title: str, + weight: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemorySearchPreviewTool(Tool, discriminator='memory_search_preview'): - memory_store_name: str - scope: str - search_options: Optional[MemorySearchOptions] - type: Literal[ToolType.MEMORY_SEARCH_PREVIEW] - update_delay: Optional[int] + class azure.ai.projects.models.InsightModelConfiguration(_Model): + model_deployment_name: str @overload def __init__( self, *, - memory_store_name: str, - scope: str, - search_options: Optional[MemorySearchOptions] = ..., - update_delay: Optional[int] = ... + model_deployment_name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryStoreDefaultDefinition(MemoryStoreDefinition, discriminator='default'): - chat_model: str - embedding_model: str - kind: Literal[MemoryStoreKind.DEFAULT] - options: Optional[MemoryStoreDefaultOptions] + class azure.ai.projects.models.InsightRequest(_Model): + type: str @overload def __init__( self, *, - chat_model: str, - embedding_model: str, - options: Optional[MemoryStoreDefaultOptions] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryStoreDefaultOptions(_Model): - chat_summary_enabled: bool - default_ttl_seconds: Optional[timedelta] - procedural_memory_enabled: Optional[bool] - user_profile_details: Optional[str] - user_profile_enabled: bool + class azure.ai.projects.models.InsightResult(_Model): + type: str @overload def __init__( self, *, - chat_summary_enabled: bool, - default_ttl_seconds: Optional[timedelta] = ..., - procedural_memory_enabled: Optional[bool] = ..., - user_profile_details: Optional[str] = ..., - user_profile_enabled: bool + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryStoreDefinition(_Model): - kind: str + class azure.ai.projects.models.InsightSample(_Model): + correlation_info: dict[str, Any] + features: dict[str, Any] + id: str + type: str @overload def __init__( self, *, - kind: str + correlation_info: dict[str, Any], + features: dict[str, Any], + id: str, + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryStoreDeleteScopeResult(_Model): - deleted: bool - name: str - object: Literal[MemoryStoreObjectType.MEMORY_STORE_SCOPE_DELETED] - scope: str + class azure.ai.projects.models.InsightScheduleTask(ScheduleTask, discriminator='Insight'): + configuration: dict[str, str] + insight: Insight + type: Literal[ScheduleTaskType.INSIGHT] @overload def __init__( self, *, - deleted: bool, - name: str, - object: Literal[MemoryStoreObjectType.MEMORY_STORE_SCOPE_DELETED], - scope: str + configuration: Optional[dict[str, str]] = ..., + insight: Insight ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryStoreDetails(_Model): - created_at: datetime - definition: MemoryStoreDefinition - description: Optional[str] - id: str - metadata: Optional[dict[str, str]] - name: str - object: Literal[MemoryStoreObjectType.MEMORY_STORE] - updated_at: datetime + class azure.ai.projects.models.InsightSummary(_Model): + method: str + sample_count: int + unique_cluster_count: int + unique_subcluster_count: int + usage: ClusterTokenUsage @overload def __init__( self, *, - created_at: datetime, - definition: MemoryStoreDefinition, - description: Optional[str] = ..., - id: str, - metadata: Optional[dict[str, str]] = ..., - name: str, - object: Literal[MemoryStoreObjectType.MEMORY_STORE], - updated_at: datetime + method: str, + sample_count: int, + unique_cluster_count: int, + unique_subcluster_count: int, + usage: ClusterTokenUsage ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryStoreKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DEFAULT = "default" - - - class azure.ai.projects.models.MemoryStoreObjectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - MEMORY_DELETED = "memory_store.item.deleted" - MEMORY_STORE = "memory_store" - MEMORY_STORE_DELETED = "memory_store.deleted" - MEMORY_STORE_SCOPE_DELETED = "memory_store.scope.deleted" + class azure.ai.projects.models.InsightType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT_CLUSTER_INSIGHT = "AgentClusterInsight" + EVALUATION_COMPARISON = "EvaluationComparison" + EVALUATION_RUN_CLUSTER_INSIGHT = "EvaluationRunClusterInsight" - class azure.ai.projects.models.MemoryStoreOperationUsage(_Model): - embedding_tokens: int - input_tokens: int - input_tokens_details: ResponseUsageInputTokensDetails - output_tokens: int - output_tokens_details: ResponseUsageOutputTokensDetails - total_tokens: int + class azure.ai.projects.models.InsightsMetadata(_Model): + completed_at: Optional[datetime] + created_at: datetime @overload def __init__( self, *, - embedding_tokens: int, - input_tokens: int, - input_tokens_details: ResponseUsageInputTokensDetails, - output_tokens: int, - output_tokens_details: ResponseUsageOutputTokensDetails, - total_tokens: int + completed_at: Optional[datetime] = ..., + created_at: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryStoreSearchResult(_Model): - memories: list[MemorySearchItem] - search_id: str - usage: MemoryStoreOperationUsage + class azure.ai.projects.models.InvocationsProtocolConfiguration(_Model): + + + class azure.ai.projects.models.InvocationsWsProtocolConfiguration(_Model): + + + class azure.ai.projects.models.InvokeAgentInvocationsApiDispatchPayload(RoutineDispatchPayload, discriminator='invoke_agent_invocations_api'): + input: Any + type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API] @overload def __init__( self, *, - memories: list[MemorySearchItem], - search_id: str, - usage: MemoryStoreOperationUsage + input: Any ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryStoreUpdateCompletedResult(_Model): - memory_operations: list[MemoryOperation] - usage: MemoryStoreOperationUsage + class azure.ai.projects.models.InvokeAgentInvocationsApiRoutineAction(RoutineAction, discriminator='invoke_agent_invocations_api'): + agent_endpoint_id: Optional[str] + agent_name: Optional[str] + input: Optional[Any] + session_id: Optional[str] + type: Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API] @overload def __init__( self, *, - memory_operations: list[MemoryOperation], - usage: MemoryStoreOperationUsage + agent_endpoint_id: Optional[str] = ..., + agent_name: Optional[str] = ..., + input: Optional[Any] = ..., + session_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryStoreUpdateResult(_Model): - error: Optional[ApiError] - result: Optional[MemoryStoreUpdateCompletedResult] - status: Union[str, MemoryStoreUpdateStatus] - superseded_by: Optional[str] - update_id: str + class azure.ai.projects.models.InvokeAgentResponsesApiDispatchPayload(RoutineDispatchPayload, discriminator='invoke_agent_responses_api'): + input: Any + type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API] @overload def __init__( self, *, - error: Optional[ApiError] = ..., - result: Optional[MemoryStoreUpdateCompletedResult] = ..., - status: Union[str, MemoryStoreUpdateStatus], - superseded_by: Optional[str] = ..., - update_id: str + input: Any ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryStoreUpdateStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - COMPLETED = "completed" - FAILED = "failed" - IN_PROGRESS = "in_progress" - QUEUED = "queued" - SUPERSEDED = "superseded" - - - class azure.ai.projects.models.Metadata(_Model): - - - class azure.ai.projects.models.MicrosoftFabricPreviewTool(Tool, discriminator='fabric_dataagent_preview'): - fabric_dataagent_preview: FabricDataAgentToolParameters - type: Literal[ToolType.FABRIC_DATAAGENT_PREVIEW] + class azure.ai.projects.models.InvokeAgentResponsesApiRoutineAction(RoutineAction, discriminator='invoke_agent_responses_api'): + agent_endpoint_id: Optional[str] + agent_name: Optional[str] + conversation: Optional[str] + input: Optional[Any] + type: Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API] @overload def __init__( self, *, - fabric_dataagent_preview: FabricDataAgentToolParameters + 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.ModelCredentialRequest(_Model): - blob_uri: str + 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.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, *, - blob_uri: str + 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.ModelDeployment(Deployment, discriminator='ModelDeployment'): - capabilities: dict[str, str] - connection_name: Optional[str] - model_name: str - model_publisher: str - model_version: str + class azure.ai.projects.models.LocalSkillParam(_Model): + description: str name: str - sku: ModelDeploymentSku - type: Literal[DeploymentType.MODEL_DEPLOYMENT] + path: str @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + description: str, + name: str, + path: str + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ModelDeploymentSku(_Model): - capacity: int - family: str - name: str - size: str - tier: str + class azure.ai.projects.models.LogProbProperties(_Model): + bytes: list[int] + logprob: float + token: str @overload def __init__( self, *, - capacity: int, - family: str, - name: str, - size: str, - tier: str + bytes: list[int], + logprob: float, + token: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ModelPendingUploadRequest(_Model): - connection_name: Optional[str] - pending_upload_id: Optional[str] - pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] + class azure.ai.projects.models.LoraConfig(_Model): + alpha: Optional[int] + dropout: Optional[float] + rank: Optional[int] + target_modules: Optional[list[str]] @overload def __init__( self, *, - connection_name: Optional[str] = ..., - pending_upload_id: Optional[str] = ..., - pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] + alpha: Optional[int] = ..., + dropout: Optional[float] = ..., + rank: Optional[int] = ..., + target_modules: Optional[list[str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ModelPendingUploadResponse(_Model): - blob_reference: BlobReference - pending_upload_id: str - pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] - version: Optional[str] + class azure.ai.projects.models.MCPListToolsTool(_Model): + annotations: Optional[MCPListToolsToolAnnotations] + description: Optional[str] + input_schema: MCPListToolsToolInputSchema + name: str @overload def __init__( self, *, - blob_reference: BlobReference, - pending_upload_id: str, - pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE], - version: Optional[str] = ... + annotations: Optional[MCPListToolsToolAnnotations] = ..., + description: Optional[str] = ..., + input_schema: MCPListToolsToolInputSchema, + name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ModelSamplingConfigParam(TypedDict, total=False): - key "max_completion_tokens": int - key "seed": int - key "temperature": float - key "top_p": float + class azure.ai.projects.models.MCPListToolsToolAnnotations(_Model): - class azure.ai.projects.models.ModelSamplingParams(_Model): - max_completion_tokens: Optional[int] - seed: Optional[int] - temperature: Optional[float] - top_p: Optional[float] + class azure.ai.projects.models.MCPListToolsToolInputSchema(_Model): + + + class azure.ai.projects.models.MCPTool(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, *, - max_completion_tokens: Optional[int] = ..., - seed: Optional[int] = ..., - temperature: Optional[float] = ..., - top_p: Optional[float] = ... + 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.ModelSourceData(_Model): - job_id: Optional[str] - source_type: Optional[Union[str, FoundryModelSourceType]] + class azure.ai.projects.models.MCPToolFilter(_Model): + read_only: Optional[bool] + tool_names: Optional[list[str]] @overload def __init__( self, *, - job_id: Optional[str] = ..., - source_type: Optional[Union[str, FoundryModelSourceType]] = ... + read_only: Optional[bool] = ..., + tool_names: Optional[list[str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ModelVersion(_Model): - artifact_profile: Optional[ArtifactProfile] - base_model: Optional[str] - blob_uri: str - description: Optional[str] - id: Optional[str] - lora_config: Optional[LoraConfig] - name: str - source: Optional[ModelSourceData] - tags: Optional[dict[str, str]] - version: str - warnings: Optional[list[FoundryModelWarning]] - weight_type: Optional[Union[str, FoundryModelWeightType]] + class azure.ai.projects.models.MCPToolRequireApproval(_Model): + always: Optional[MCPToolFilter] + never: Optional[MCPToolFilter] @overload def __init__( self, *, - base_model: Optional[str] = ..., - blob_uri: str, - description: Optional[str] = ..., - lora_config: Optional[LoraConfig] = ..., - source: Optional[ModelSourceData] = ..., - tags: Optional[dict[str, str]] = ..., - weight_type: Optional[Union[str, FoundryModelWeightType]] = ... + always: Optional[MCPToolFilter] = ..., + never: Optional[MCPToolFilter] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MonthlyRecurrenceSchedule(RecurrenceSchedule, discriminator='Monthly'): - days_of_month: list[int] - type: Literal[RecurrenceType.MONTHLY] + class azure.ai.projects.models.MCPToolboxTool(ToolboxTool, 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] + description: str + headers: Optional[dict[str, str]] + name: 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: dict[str, ToolConfig] + tunnel_id: Optional[str] + type: Literal[ToolboxToolType.MCP] @overload def __init__( self, *, - days_of_month: list[int] + 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] = ..., + description: Optional[str] = ..., + headers: Optional[dict[str, str]] = ..., + name: Optional[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.NamespaceToolParam(Tool, discriminator='namespace'): - description: str - name: str - tools: list[Union[FunctionToolParam, CustomToolParam]] - type: Literal[ToolType.NAMESPACE] + class azure.ai.projects.models.ManagedAgentIdentityBlueprintReference(AgentBlueprintReference, discriminator='ManagedAgentIdentityBlueprint'): + blueprint_id: str + type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] @overload def __init__( self, *, - description: str, - name: str, - tools: list[Union[FunctionToolParam, CustomToolParam]] + blueprint_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.NoAuthenticationCredentials(BaseCredentials, discriminator='None'): - type: Literal[CredentialType.NONE] + class azure.ai.projects.models.ManagedAzureAISearchIndex(Index, discriminator='ManagedAzureSearch'): + description: str + id: str + name: str + tags: dict[str, str] + type: Literal[IndexType.MANAGED_AZURE_SEARCH] + vector_store_id: str + version: str @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + description: Optional[str] = ..., + tags: Optional[dict[str, str]] = ..., + vector_store_id: str + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OmitPropertiesRealtimeResponse(_Model): - conversation_id: Optional[str] - id: Optional[str] - max_output_tokens: Optional[Union[int, Literal["inf"]]] - object: Optional[Literal["response"]] - output_modalities: Optional[list[Literal["text", "audio"]]] - status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] - status_details: Optional[RealtimeResponseStatusDetails] - usage: Optional[RealtimeResponseUsage] + class azure.ai.projects.models.McpProtocolConfiguration(_Model): + + + class azure.ai.projects.models.MemoryItem(_Model): + content: str + kind: str + memory_id: str + scope: str + updated_at: datetime @overload def __init__( self, *, - conversation_id: Optional[str] = ..., - id: Optional[str] = ..., - max_output_tokens: Optional[Union[int, Literal[inf]]] = ..., - object: Optional[Literal[response]] = ..., - output_modalities: Optional[list[Literal[text, audio]]] = ..., - status: Optional[Literal[completed, cancelled, failed, incomplete, in_progress]] = ..., - status_details: Optional[RealtimeResponseStatusDetails] = ..., - usage: Optional[RealtimeResponseUsage] = ... + content: str, + kind: str, + memory_id: str, + scope: str, + updated_at: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OmitPropertiesRealtimeResponse1(_Model): - conversation_id: Optional[str] - id: Optional[str] - max_output_tokens: Optional[Union[int, Literal["inf"]]] - metadata: Optional[Metadata] - object: Optional[Literal["response"]] - output_modalities: Optional[list[Literal["text", "audio"]]] - status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] - status_details: Optional[RealtimeResponseStatusDetails] - usage: Optional[RealtimeResponseUsage] + class azure.ai.projects.models.MemoryItemKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CHAT_SUMMARY = "chat_summary" + PROCEDURAL = "procedural" + USER_PROFILE = "user_profile" + + + class azure.ai.projects.models.MemoryOperation(_Model): + kind: Union[str, MemoryOperationKind] + memory_item: MemoryItem @overload def __init__( self, *, - conversation_id: Optional[str] = ..., - id: Optional[str] = ..., - max_output_tokens: Optional[Union[int, Literal[inf]]] = ..., - metadata: Optional[Metadata] = ..., - object: Optional[Literal[response]] = ..., - output_modalities: Optional[list[Literal[text, audio]]] = ..., - status: Optional[Literal[completed, cancelled, failed, incomplete, in_progress]] = ..., - status_details: Optional[RealtimeResponseStatusDetails] = ..., - usage: Optional[RealtimeResponseUsage] = ... + kind: Union[str, MemoryOperationKind], + memory_item: MemoryItem ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OneTimeTrigger(Trigger, discriminator='OneTime'): - time_zone: Optional[str] - trigger_at: datetime - type: Literal[TriggerType.ONE_TIME] + class azure.ai.projects.models.MemoryOperationKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CREATE = "create" + DELETE = "delete" + UPDATE = "update" + + + class azure.ai.projects.models.MemorySearchItem(_Model): + memory_item: MemoryItem @overload def __init__( self, *, - time_zone: Optional[str] = ..., - trigger_at: datetime + memory_item: MemoryItem ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OpenApiAnonymousAuthDetails(OpenApiAuthDetails, discriminator='anonymous'): - type: Literal[OpenApiAuthType.ANONYMOUS] + class azure.ai.projects.models.MemorySearchOptions(_Model): + max_memories: Optional[int] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + max_memories: Optional[int] = ... + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OpenApiAuthDetails(_Model): - type: str + class azure.ai.projects.models.MemorySearchPreviewTool(Tool, discriminator='memory_search_preview'): + memory_store_name: str + scope: str + search_options: Optional[MemorySearchOptions] + type: Literal[ToolType.MEMORY_SEARCH_PREVIEW] + update_delay: Optional[int] @overload def __init__( self, *, - type: str + memory_store_name: str, + scope: str, + search_options: Optional[MemorySearchOptions] = ..., + update_delay: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OpenApiAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ANONYMOUS = "anonymous" - MANAGED_IDENTITY = "managed_identity" - PROJECT_CONNECTION = "project_connection" - - - class azure.ai.projects.models.OpenApiFunctionDefinition(_Model): - auth: OpenApiAuthDetails - default_params: Optional[list[str]] - description: Optional[str] - functions: Optional[list[OpenApiFunctionDefinitionFunction]] - name: str - spec: dict[str, Any] + class azure.ai.projects.models.MemoryStoreDefaultDefinition(MemoryStoreDefinition, discriminator='default'): + chat_model: str + embedding_model: str + kind: Literal[MemoryStoreKind.DEFAULT] + options: Optional[MemoryStoreDefaultOptions] @overload def __init__( self, *, - auth: OpenApiAuthDetails, - default_params: Optional[list[str]] = ..., - description: Optional[str] = ..., - name: str, - spec: dict[str, Any] + chat_model: str, + embedding_model: str, + options: Optional[MemoryStoreDefaultOptions] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OpenApiFunctionDefinitionFunction(_Model): - description: Optional[str] - name: str - parameters: dict[str, Any] + class azure.ai.projects.models.MemoryStoreDefaultOptions(_Model): + chat_summary_enabled: bool + default_ttl_seconds: Optional[timedelta] + procedural_memory_enabled: Optional[bool] + user_profile_details: Optional[str] + user_profile_enabled: bool @overload def __init__( self, *, - description: Optional[str] = ..., - name: str, - parameters: dict[str, Any] + chat_summary_enabled: bool, + default_ttl_seconds: Optional[timedelta] = ..., + procedural_memory_enabled: Optional[bool] = ..., + user_profile_details: Optional[str] = ..., + user_profile_enabled: bool ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OpenApiManagedAuthDetails(OpenApiAuthDetails, discriminator='managed_identity'): - security_scheme: OpenApiManagedSecurityScheme - type: Literal[OpenApiAuthType.MANAGED_IDENTITY] + class azure.ai.projects.models.MemoryStoreDefinition(_Model): + kind: str @overload def __init__( self, *, - security_scheme: OpenApiManagedSecurityScheme + kind: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OpenApiManagedSecurityScheme(_Model): - audience: str + class azure.ai.projects.models.MemoryStoreDeleteScopeResult(_Model): + deleted: bool + name: str + object: Literal[MemoryStoreObjectType.MEMORY_STORE_SCOPE_DELETED] + scope: str @overload def __init__( self, *, - audience: str + deleted: bool, + name: str, + object: Literal[MemoryStoreObjectType.MEMORY_STORE_SCOPE_DELETED], + scope: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OpenApiProjectConnectionAuthDetails(OpenApiAuthDetails, discriminator='project_connection'): - security_scheme: OpenApiProjectConnectionSecurityScheme - type: Literal[OpenApiAuthType.PROJECT_CONNECTION] + class azure.ai.projects.models.MemoryStoreDetails(_Model): + created_at: datetime + definition: MemoryStoreDefinition + description: Optional[str] + id: str + metadata: Optional[dict[str, str]] + name: str + object: Literal[MemoryStoreObjectType.MEMORY_STORE] + updated_at: datetime @overload def __init__( self, *, - security_scheme: OpenApiProjectConnectionSecurityScheme + created_at: datetime, + definition: MemoryStoreDefinition, + description: Optional[str] = ..., + id: str, + metadata: Optional[dict[str, str]] = ..., + name: str, + object: Literal[MemoryStoreObjectType.MEMORY_STORE], + updated_at: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OpenApiProjectConnectionSecurityScheme(_Model): - project_connection_id: str + class azure.ai.projects.models.MemoryStoreKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DEFAULT = "default" + + + class azure.ai.projects.models.MemoryStoreObjectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MEMORY_DELETED = "memory_store.item.deleted" + MEMORY_STORE = "memory_store" + MEMORY_STORE_DELETED = "memory_store.deleted" + MEMORY_STORE_SCOPE_DELETED = "memory_store.scope.deleted" + + + class azure.ai.projects.models.MemoryStoreOperationUsage(_Model): + embedding_tokens: int + input_tokens: int + input_tokens_details: ResponseUsageInputTokensDetails + output_tokens: int + output_tokens_details: ResponseUsageOutputTokensDetails + total_tokens: int @overload def __init__( self, *, - project_connection_id: str + embedding_tokens: int, + input_tokens: int, + input_tokens_details: ResponseUsageInputTokensDetails, + output_tokens: int, + output_tokens_details: ResponseUsageOutputTokensDetails, + total_tokens: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OpenApiTool(Tool, discriminator='openapi'): - openapi: OpenApiFunctionDefinition - tool_configs: Optional[dict[str, ToolConfig]] - type: Literal[ToolType.OPENAPI] + class azure.ai.projects.models.MemoryStoreSearchResult(_Model): + memories: list[MemorySearchItem] + search_id: str + usage: MemoryStoreOperationUsage @overload def __init__( self, *, - openapi: OpenApiFunctionDefinition, - tool_configs: Optional[dict[str, ToolConfig]] = ... + memories: list[MemorySearchItem], + search_id: str, + usage: MemoryStoreOperationUsage ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OpenApiToolboxTool(ToolboxTool, discriminator='openapi'): - description: str - name: str - openapi: OpenApiFunctionDefinition - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.OPENAPI] + class azure.ai.projects.models.MemoryStoreUpdateCompletedResult(_Model): + memory_operations: list[MemoryOperation] + usage: MemoryStoreOperationUsage @overload def __init__( self, *, - description: Optional[str] = ..., - name: Optional[str] = ..., - openapi: OpenApiFunctionDefinition, - tool_configs: Optional[dict[str, ToolConfig]] = ... + memory_operations: list[MemoryOperation], + usage: MemoryStoreOperationUsage ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OperationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CANCELED = "Canceled" - FAILED = "Failed" - NOT_STARTED = "NotStarted" - RUNNING = "Running" - SUCCEEDED = "Succeeded" - - - class azure.ai.projects.models.OptimizedAgentIdentifier(_Model): - agent_name: str - agent_version: Optional[str] + class azure.ai.projects.models.MemoryStoreUpdateResult(_Model): + error: Optional[ApiError] + result: Optional[MemoryStoreUpdateCompletedResult] + status: Union[str, MemoryStoreUpdateStatus] + superseded_by: Optional[str] + update_id: str @overload def __init__( self, *, - agent_name: str, - agent_version: Optional[str] = ... + error: Optional[ApiError] = ..., + result: Optional[MemoryStoreUpdateCompletedResult] = ..., + status: Union[str, MemoryStoreUpdateStatus], + superseded_by: Optional[str] = ..., + update_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OtlpTelemetryEndpoint(TelemetryEndpoint, discriminator='OTLP'): - auth: TelemetryEndpointAuth - data: Union[list[str, TelemetryDataKind]] - endpoint: str - kind: Literal[TelemetryEndpointKind.OTLP] - protocol: Union[str, TelemetryTransportProtocol] + class azure.ai.projects.models.MemoryStoreUpdateStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMPLETED = "completed" + FAILED = "failed" + IN_PROGRESS = "in_progress" + QUEUED = "queued" + SUPERSEDED = "superseded" + + + class azure.ai.projects.models.Metadata(_Model): + + + class azure.ai.projects.models.Microsoft365PermissionScopes(_Model): + resource_app_id: str + scopes: list[str] @overload def __init__( self, *, - auth: Optional[TelemetryEndpointAuth] = ..., - data: list[Union[str, TelemetryDataKind]], - endpoint: str, - protocol: Union[str, TelemetryTransportProtocol] + resource_app_id: str, + scopes: list[str] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PageOrder(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ASC = "asc" - DESC = "desc" - - - class azure.ai.projects.models.PendingUploadRequest(_Model): - connection_name: Optional[str] - pending_upload_id: Optional[str] - pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] + class azure.ai.projects.models.Microsoft365PublishDefaults(_Model): + agent_display_name: Optional[str] + agent_name: Optional[str] + app_publish_scope: Optional[Union[str, Microsoft365PublishScope]] + app_registration_client_id: Optional[str] + app_version: Optional[str] + bot_service_arm_id: Optional[str] + developer_name: Optional[str] + developer_website_url: Optional[str] + full_description: Optional[str] + privacy_url: Optional[str] + recommended_next_app_version: Optional[str] + short_description: Optional[str] + teams_app_id: Optional[str] + terms_of_use_url: Optional[str] + title_id: Optional[str] @overload def __init__( self, *, - connection_name: Optional[str] = ..., - pending_upload_id: Optional[str] = ..., - pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] + agent_display_name: Optional[str] = ..., + agent_name: Optional[str] = ..., + app_publish_scope: Optional[Union[str, Microsoft365PublishScope]] = ..., + app_registration_client_id: Optional[str] = ..., + app_version: Optional[str] = ..., + bot_service_arm_id: Optional[str] = ..., + developer_name: Optional[str] = ..., + developer_website_url: Optional[str] = ..., + full_description: Optional[str] = ..., + privacy_url: Optional[str] = ..., + recommended_next_app_version: Optional[str] = ..., + short_description: Optional[str] = ..., + teams_app_id: Optional[str] = ..., + terms_of_use_url: Optional[str] = ..., + title_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PendingUploadResponse(_Model): - blob_reference: BlobReference - pending_upload_id: str - pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] - version: Optional[str] + class azure.ai.projects.models.Microsoft365PublishResult(_Model): + teams_app_id: Optional[str] + title_id: Optional[str] @overload def __init__( self, *, - blob_reference: BlobReference, - pending_upload_id: str, - pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE], - version: Optional[str] = ... + teams_app_id: Optional[str] = ..., + title_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PendingUploadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - BLOB_REFERENCE = "BlobReference" - NONE = "None" - TEMPORARY_BLOB_REFERENCE = "TemporaryBlobReference" + class azure.ai.projects.models.Microsoft365PublishScope(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PERSONAL = "Personal" + SHARED = "Shared" + TENANT = "Tenant" - class azure.ai.projects.models.PickPropertiesVoiceAudioConfig(_Model): - output: Optional[VoiceAudioOutputConfig] + class azure.ai.projects.models.MicrosoftFabricPreviewTool(Tool, discriminator='fabric_dataagent_preview'): + fabric_dataagent_preview: FabricDataAgentToolParameters + type: Literal[ToolType.FABRIC_DATAAGENT_PREVIEW] @overload def __init__( self, *, - output: Optional[VoiceAudioOutputConfig] = ... + fabric_dataagent_preview: FabricDataAgentToolParameters ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ProceduralMemoryItem(MemoryItem, discriminator='procedural'): - content: str - kind: Literal[MemoryItemKind.PROCEDURAL] - memory_id: str - scope: str - updated_at: datetime + class azure.ai.projects.models.ModelCredentialRequest(_Model): + blob_uri: str @overload def __init__( self, *, - content: str, - memory_id: str, - scope: str, - updated_at: datetime + blob_uri: str ) -> None: ... @overload 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] + class azure.ai.projects.models.ModelDeployment(Deployment, discriminator='ModelDeployment'): + capabilities: dict[str, str] + connection_name: Optional[str] + model_name: str + model_publisher: str + model_version: str + name: str + sku: ModelDeploymentSku + type: Literal[DeploymentType.MODEL_DEPLOYMENT] @overload def __init__(self) -> None: ... @@ -8061,869 +7944,774 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PromotionInfo(_Model): - agent_name: str - agent_version: str - promoted_at: datetime + class azure.ai.projects.models.ModelDeploymentSku(_Model): + capacity: int + family: str + name: str + size: str + tier: str @overload def __init__( self, *, - agent_name: str, - agent_version: str, - promoted_at: datetime + capacity: int, + family: str, + name: str, + size: str, + tier: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PromptAgentDefinition(AgentDefinition, discriminator='prompt'): - instructions: Optional[str] - kind: Literal[AgentKind.PROMPT] - model: str - rai_config: RaiConfig - reasoning: Optional[Reasoning] - structured_inputs: Optional[dict[str, StructuredInputDefinition]] - temperature: Optional[float] - text: Optional[PromptAgentDefinitionTextOptions] - tool_choice: Optional[Union[str, ToolChoiceParam]] - tools: Optional[list[Tool]] - top_p: Optional[float] + class azure.ai.projects.models.ModelPendingUploadRequest(_Model): + connection_name: Optional[str] + pending_upload_id: Optional[str] + pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] @overload def __init__( self, *, - instructions: Optional[str] = ..., - model: str, - rai_config: Optional[RaiConfig] = ..., - reasoning: Optional[Reasoning] = ..., - structured_inputs: Optional[dict[str, StructuredInputDefinition]] = ..., - temperature: Optional[float] = ..., - text: Optional[PromptAgentDefinitionTextOptions] = ..., - tool_choice: Optional[Union[str, ToolChoiceParam]] = ..., - tools: Optional[list[Tool]] = ..., - top_p: Optional[float] = ... + connection_name: Optional[str] = ..., + pending_upload_id: Optional[str] = ..., + pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PromptAgentDefinitionTextOptions(_Model): - format: Optional[TextResponseFormat] + class azure.ai.projects.models.ModelPendingUploadResponse(_Model): + blob_reference: BlobReference + pending_upload_id: str + pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] + version: Optional[str] @overload def __init__( self, *, - format: Optional[TextResponseFormat] = ... + blob_reference: BlobReference, + pending_upload_id: str, + pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE], + version: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PromptBasedEvaluatorDefinition(EvaluatorDefinition, discriminator='prompt'): - data_schema: dict[str, any] - init_parameters: dict[str, any] - metrics: dict[str, EvaluatorMetric] - prompt_text: str - type: Literal[EvaluatorDefinitionType.PROMPT] + class azure.ai.projects.models.ModelSamplingConfigParam(TypedDict, total=False): + key "max_completion_tokens": int + key "seed": int + key "temperature": float + key "top_p": float + + + class azure.ai.projects.models.ModelSamplingParams(_Model): + max_completion_tokens: Optional[int] + seed: Optional[int] + temperature: Optional[float] + top_p: Optional[float] @overload def __init__( self, *, - data_schema: Optional[dict[str, Any]] = ..., - init_parameters: Optional[dict[str, Any]] = ..., - metrics: Optional[dict[str, EvaluatorMetric]] = ..., - prompt_text: str + max_completion_tokens: Optional[int] = ..., + seed: Optional[int] = ..., + temperature: Optional[float] = ..., + top_p: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PromptDataGenerationJobSource(DataGenerationJobSource, discriminator='prompt'): - description: str - prompt: str - type: Literal[DataGenerationJobSourceType.PROMPT] + class azure.ai.projects.models.ModelSourceData(_Model): + job_id: Optional[str] + source_type: Optional[Union[str, FoundryModelSourceType]] @overload def __init__( self, *, - description: Optional[str] = ..., - prompt: str + job_id: Optional[str] = ..., + source_type: Optional[Union[str, FoundryModelSourceType]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PromptEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator='prompt'): + class azure.ai.projects.models.ModelVersion(_Model): + artifact_profile: Optional[ArtifactProfile] + base_model: Optional[str] + blob_uri: str description: Optional[str] - prompt: str - type: Literal[EvaluatorGenerationJobSourceType.PROMPT] + id: Optional[str] + lora_config: Optional[LoraConfig] + name: str + source: Optional[ModelSourceData] + tags: Optional[dict[str, str]] + version: str + warnings: Optional[list[FoundryModelWarning]] + weight_type: Optional[Union[str, FoundryModelWeightType]] @overload def __init__( self, *, + base_model: Optional[str] = ..., + blob_uri: str, description: Optional[str] = ..., - prompt: str + lora_config: Optional[LoraConfig] = ..., + source: Optional[ModelSourceData] = ..., + tags: Optional[dict[str, str]] = ..., + weight_type: Optional[Union[str, FoundryModelWeightType]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ProtocolConfiguration(_Model): - a2a: Optional[A2AProtocolConfiguration] - activity: Optional[ActivityProtocolConfiguration] - invocations: Optional[InvocationsProtocolConfiguration] - invocations_ws: Optional[InvocationsWsProtocolConfiguration] - mcp: Optional[McpProtocolConfiguration] - responses: Optional[ResponsesProtocolConfiguration] + class azure.ai.projects.models.MonthlyRecurrenceSchedule(RecurrenceSchedule, discriminator='Monthly'): + days_of_month: list[int] + type: Literal[RecurrenceType.MONTHLY] @overload def __init__( self, *, - a2a: Optional[A2AProtocolConfiguration] = ..., - activity: Optional[ActivityProtocolConfiguration] = ..., - invocations: Optional[InvocationsProtocolConfiguration] = ..., - invocations_ws: Optional[InvocationsWsProtocolConfiguration] = ..., - mcp: Optional[McpProtocolConfiguration] = ..., - responses: Optional[ResponsesProtocolConfiguration] = ... + days_of_month: list[int] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ProtocolVersionRecord(_Model): - protocol: Union[str, AgentEndpointProtocol] - version: str + class azure.ai.projects.models.NamespaceToolParam(Tool, discriminator='namespace'): + description: str + name: str + tools: list[Union[FunctionToolParam, CustomToolParam]] + type: Literal[ToolType.NAMESPACE] @overload def __init__( self, *, - protocol: Union[str, AgentEndpointProtocol], - version: str + description: str, + name: str, + tools: list[Union[FunctionToolParam, CustomToolParam]] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RaiConfig(_Model): - rai_policy_name: str + class azure.ai.projects.models.NoAuthenticationCredentials(BaseCredentials, discriminator='None'): + type: Literal[CredentialType.NONE] @overload - def __init__( - self, - *, - rai_policy_name: str - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RankerVersionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AUTO = "auto" - DEFAULT_2024_11_15 = "default-2024-11-15" - - - class azure.ai.projects.models.RankingOptions(_Model): - hybrid_search: Optional[HybridSearchOptions] - ranker: Optional[Union[str, RankerVersionType]] - score_threshold: Optional[float] + class azure.ai.projects.models.OneTimeTrigger(Trigger, discriminator='OneTime'): + time_zone: Optional[str] + trigger_at: datetime + type: Literal[TriggerType.ONE_TIME] @overload def __init__( self, *, - hybrid_search: Optional[HybridSearchOptions] = ..., - ranker: Optional[Union[str, RankerVersionType]] = ..., - score_threshold: Optional[float] = ... + time_zone: Optional[str] = ..., + trigger_at: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeAudioFormats(_Model): - type: str + class azure.ai.projects.models.OpenApiAnonymousAuthDetails(OpenApiAuthDetails, discriminator='anonymous'): + type: Literal[OpenApiAuthType.ANONYMOUS] @overload - def __init__( - self, - *, - type: str - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeAudioFormatsAudioPcm(RealtimeAudioFormats, discriminator='audio/pcm'): - rate: Optional[Literal[24000]] - type: Literal[RealtimeAudioFormatsType.AUDIO_PCM] + class azure.ai.projects.models.OpenApiAuthDetails(_Model): + type: str @overload def __init__( self, *, - rate: Optional[Literal[24000]] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeAudioFormatsAudioPcma(RealtimeAudioFormats, discriminator='audio/pcma'): - type: Literal[RealtimeAudioFormatsType.AUDIO_PCMA] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.RealtimeAudioFormatsAudioPcmu(RealtimeAudioFormats, discriminator='audio/pcmu'): - type: Literal[RealtimeAudioFormatsType.AUDIO_PCMU] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.RealtimeAudioFormatsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AUDIO_PCM = "audio/pcm" - AUDIO_PCMA = "audio/pcma" - AUDIO_PCMU = "audio/pcmu" - - - class azure.ai.projects.models.RealtimeClientEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CONVERSATION_ITEM_CREATE = "conversation.item.create" - CONVERSATION_ITEM_DELETE = "conversation.item.delete" - CONVERSATION_ITEM_RETRIEVE = "conversation.item.retrieve" - CONVERSATION_ITEM_TRUNCATE = "conversation.item.truncate" - INPUT_AUDIO_BUFFER_APPEND = "input_audio_buffer.append" - INPUT_AUDIO_BUFFER_CLEAR = "input_audio_buffer.clear" - INPUT_AUDIO_BUFFER_COMMIT = "input_audio_buffer.commit" - OUTPUT_AUDIO_BUFFER_CLEAR = "output_audio_buffer.clear" - RESPONSE_CANCEL = "response.cancel" - RESPONSE_CREATE = "response.create" - SESSION_UPDATE = "session.update" + class azure.ai.projects.models.OpenApiAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ANONYMOUS = "anonymous" + MANAGED_IDENTITY = "managed_identity" + PROJECT_CONNECTION = "project_connection" - class azure.ai.projects.models.RealtimeConversationItem(_Model): - type: str + class azure.ai.projects.models.OpenApiFunctionDefinition(_Model): + auth: OpenApiAuthDetails + default_params: Optional[list[str]] + description: Optional[str] + functions: Optional[list[OpenApiFunctionDefinitionFunction]] + name: str + spec: dict[str, Any] @overload def __init__( self, *, - type: str + auth: OpenApiAuthDetails, + default_params: Optional[list[str]] = ..., + description: Optional[str] = ..., + name: str, + spec: dict[str, Any] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeConversationItemFunctionCall(RealtimeConversationItem, discriminator='function_call'): - arguments: str - call_id: Optional[str] - id: Optional[str] + class azure.ai.projects.models.OpenApiFunctionDefinitionFunction(_Model): + description: Optional[str] name: str - object: Optional[Literal["item"]] - status: Optional[Literal["completed", "incomplete", "in_progress"]] - type: Literal[RealtimeConversationItemType.FUNCTION_CALL] + parameters: dict[str, Any] @overload def __init__( self, *, - arguments: str, - call_id: Optional[str] = ..., - id: Optional[str] = ..., + description: Optional[str] = ..., name: str, - object: Optional[Literal[item]] = ..., - status: Optional[Literal[completed, incomplete, in_progress]] = ... + parameters: dict[str, Any] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeConversationItemFunctionCallOutput(RealtimeConversationItem, discriminator='function_call_output'): - call_id: str - id: Optional[str] - object: Optional[Literal["item"]] - output: str - status: Optional[Literal["completed", "incomplete", "in_progress"]] - type: Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT] + class azure.ai.projects.models.OpenApiManagedAuthDetails(OpenApiAuthDetails, discriminator='managed_identity'): + security_scheme: OpenApiManagedSecurityScheme + type: Literal[OpenApiAuthType.MANAGED_IDENTITY] @overload def __init__( self, *, - call_id: str, - id: Optional[str] = ..., - object: Optional[Literal[item]] = ..., - output: str, - status: Optional[Literal[completed, incomplete, in_progress]] = ... + security_scheme: OpenApiManagedSecurityScheme ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeConversationItemMessage(_Model): - role: str + class azure.ai.projects.models.OpenApiManagedSecurityScheme(_Model): + audience: str @overload def __init__( self, *, - role: str + audience: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeConversationItemMessageAssistant(RealtimeConversationItemMessage, discriminator='assistant'): - content: list[RealtimeConversationItemMessageAssistantContent] - id: Optional[str] - object: Optional[Literal["item"]] - role: Literal[RealtimeConversationItemMessageType.ASSISTANT] - status: Optional[Literal["completed", "incomplete", "in_progress"]] - type: Literal["message"] + class azure.ai.projects.models.OpenApiProjectConnectionAuthDetails(OpenApiAuthDetails, discriminator='project_connection'): + security_scheme: OpenApiProjectConnectionSecurityScheme + type: Literal[OpenApiAuthType.PROJECT_CONNECTION] @overload def __init__( self, *, - content: list[RealtimeConversationItemMessageAssistantContent], - id: Optional[str] = ..., - object: Optional[Literal[item]] = ..., - status: Optional[Literal[completed, incomplete, in_progress]] = ... + security_scheme: OpenApiProjectConnectionSecurityScheme ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeConversationItemMessageAssistantContent(_Model): - audio: Optional[str] - text: Optional[str] - transcript: Optional[str] - type: Optional[Literal["output_text", "output_audio"]] + class azure.ai.projects.models.OpenApiProjectConnectionSecurityScheme(_Model): + project_connection_id: str @overload def __init__( self, *, - audio: Optional[str] = ..., - text: Optional[str] = ..., - transcript: Optional[str] = ..., - type: Optional[Literal[output_text, output_audio]] = ... + project_connection_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeConversationItemMessageSystem(RealtimeConversationItemMessage, discriminator='system'): - content: list[RealtimeConversationItemMessageSystemContent] - id: Optional[str] - object: Optional[Literal["item"]] - role: Literal[RealtimeConversationItemMessageType.SYSTEM] - status: Optional[Literal["completed", "incomplete", "in_progress"]] - type: Literal["message"] + class azure.ai.projects.models.OpenApiTool(Tool, discriminator='openapi'): + openapi: OpenApiFunctionDefinition + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.OPENAPI] @overload def __init__( self, *, - content: list[RealtimeConversationItemMessageSystemContent], - id: Optional[str] = ..., - object: Optional[Literal[item]] = ..., - status: Optional[Literal[completed, incomplete, in_progress]] = ... + openapi: OpenApiFunctionDefinition, + tool_configs: Optional[dict[str, ToolConfig]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeConversationItemMessageSystemContent(_Model): - text: Optional[str] - type: Optional[Literal["input_text"]] + class azure.ai.projects.models.OpenApiToolboxTool(ToolboxTool, discriminator='openapi'): + description: str + name: str + openapi: OpenApiFunctionDefinition + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.OPENAPI] @overload def __init__( self, *, - text: Optional[str] = ..., - type: Optional[Literal[input_text]] = ... + description: Optional[str] = ..., + name: Optional[str] = ..., + openapi: OpenApiFunctionDefinition, + tool_configs: Optional[dict[str, ToolConfig]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeConversationItemMessageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ASSISTANT = "assistant" - SYSTEM = "system" - USER = "user" + class azure.ai.projects.models.OperationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELED = "Canceled" + FAILED = "Failed" + NOT_STARTED = "NotStarted" + RUNNING = "Running" + SUCCEEDED = "Succeeded" - class azure.ai.projects.models.RealtimeConversationItemMessageUser(RealtimeConversationItemMessage, discriminator='user'): - content: list[RealtimeConversationItemMessageUserContent] - id: Optional[str] - object: Optional[Literal["item"]] - role: Literal[RealtimeConversationItemMessageType.USER] - status: Optional[Literal["completed", "incomplete", "in_progress"]] - type: Literal["message"] + class azure.ai.projects.models.OptimizedAgentIdentifier(_Model): + agent_name: str + agent_version: Optional[str] @overload def __init__( self, *, - content: list[RealtimeConversationItemMessageUserContent], - id: Optional[str] = ..., - object: Optional[Literal[item]] = ..., - status: Optional[Literal[completed, incomplete, in_progress]] = ... + agent_name: str, + agent_version: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeConversationItemMessageUserContent(_Model): - audio: Optional[str] - detail: Optional[Literal["auto", "low", "high"]] - image_url: Optional[str] - text: Optional[str] - transcript: Optional[str] - type: Optional[Literal["input_text", "input_audio", "input_image"]] + class azure.ai.projects.models.OtlpTelemetryEndpoint(TelemetryEndpoint, discriminator='OTLP'): + auth: TelemetryEndpointAuth + data: Union[list[str, TelemetryDataKind]] + endpoint: str + kind: Literal[TelemetryEndpointKind.OTLP] + protocol: Union[str, TelemetryTransportProtocol] @overload def __init__( self, *, - audio: Optional[str] = ..., - detail: Optional[Literal[auto, low, high]] = ..., - image_url: Optional[str] = ..., - text: Optional[str] = ..., - transcript: Optional[str] = ..., - type: Optional[Literal[input_text, input_audio, input_image]] = ... + auth: Optional[TelemetryEndpointAuth] = ..., + data: list[Union[str, TelemetryDataKind]], + endpoint: str, + protocol: Union[str, TelemetryTransportProtocol] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FUNCTION_CALL = "function_call" - FUNCTION_CALL_OUTPUT = "function_call_output" - MCP_APPROVAL_REQUEST = "mcp_approval_request" - MCP_APPROVAL_RESPONSE = "mcp_approval_response" - MCP_CALL = "mcp_call" - MCP_LIST_TOOLS = "mcp_list_tools" + class azure.ai.projects.models.PageOrder(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ASC = "asc" + DESC = "desc" - class azure.ai.projects.models.RealtimeFunctionTool(_Model): - description: Optional[str] - name: Optional[str] - parameters: Optional[RealtimeFunctionToolParameters] - type: Optional[Literal["function"]] + class azure.ai.projects.models.PendingUploadRequest(_Model): + connection_name: Optional[str] + pending_upload_id: Optional[str] + pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] @overload def __init__( self, *, - description: Optional[str] = ..., - name: Optional[str] = ..., - parameters: Optional[RealtimeFunctionToolParameters] = ..., - type: Optional[Literal[function]] = ... + connection_name: Optional[str] = ..., + pending_upload_id: Optional[str] = ..., + pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeFunctionToolParameters(_Model): - - - class azure.ai.projects.models.RealtimeMCPApprovalRequest(RealtimeConversationItem, discriminator='mcp_approval_request'): - arguments: str - id: str - name: str - server_label: str - type: Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST] + class azure.ai.projects.models.PendingUploadResponse(_Model): + blob_reference: BlobReference + pending_upload_id: str + pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] + version: Optional[str] @overload def __init__( self, *, - arguments: str, - id: str, - name: str, - server_label: str + blob_reference: BlobReference, + pending_upload_id: str, + pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE], + version: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeMCPApprovalResponse(RealtimeConversationItem, discriminator='mcp_approval_response'): - approval_request_id: str - approve: bool - id: str - reason: Optional[str] - type: Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE] + class azure.ai.projects.models.PendingUploadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BLOB_REFERENCE = "BlobReference" + NONE = "None" + TEMPORARY_BLOB_REFERENCE = "TemporaryBlobReference" + + + class azure.ai.projects.models.PickPropertiesVoiceAgentAudioConfig(_Model): + output: Optional[VoiceAgentAudioOutputConfig] @overload def __init__( self, *, - approval_request_id: str, - approve: bool, - id: str, - reason: Optional[str] = ... + output: Optional[VoiceAgentAudioOutputConfig] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeMCPError(_Model): - type: str + class azure.ai.projects.models.ProceduralMemoryItem(MemoryItem, discriminator='procedural'): + content: str + kind: Literal[MemoryItemKind.PROCEDURAL] + memory_id: str + scope: str + updated_at: datetime @overload def __init__( self, *, - type: str - ) -> None: ... - - @overload + content: str, + memory_id: str, + scope: str, + updated_at: datetime + ) -> None: ... + + @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeMCPHTTPError(RealtimeMCPError, discriminator='http_error'): - code: int - message: str - type: Literal[RealtimeMcpErrorType.HTTP_ERROR] + class azure.ai.projects.models.ProgrammaticToolCallingParam(Tool, discriminator='programmatic_tool_calling'): + type: Literal[ToolType.PROGRAMMATIC_TOOL_CALLING] @overload - def __init__( - self, - *, - code: int, - message: str - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeMCPListTools(RealtimeConversationItem, discriminator='mcp_list_tools'): - id: Optional[str] - server_label: str - tools: list[MCPListToolsTool] - type: Literal[RealtimeConversationItemType.MCP_LIST_TOOLS] + class azure.ai.projects.models.PromotionInfo(_Model): + agent_name: str + agent_version: str + promoted_at: datetime @overload def __init__( self, *, - id: Optional[str] = ..., - server_label: str, - tools: list[MCPListToolsTool] + agent_name: str, + agent_version: str, + promoted_at: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeMCPProtocolError(RealtimeMCPError, discriminator='protocol_error'): - code: int - message: str - type: Literal[RealtimeMcpErrorType.PROTOCOL_ERROR] + class azure.ai.projects.models.PromptAgentDefinition(AgentDefinition, discriminator='prompt'): + instructions: Optional[str] + kind: Literal[AgentKind.PROMPT] + model: str + rai_config: RaiConfig + reasoning: Optional[Reasoning] + structured_inputs: Optional[dict[str, StructuredInputDefinition]] + temperature: Optional[float] + text: Optional[PromptAgentDefinitionTextOptions] + tool_choice: Optional[Union[str, ToolChoiceParam]] + tools: Optional[list[Tool]] + top_p: Optional[float] @overload def __init__( self, *, - code: int, - message: str + instructions: Optional[str] = ..., + model: str, + rai_config: Optional[RaiConfig] = ..., + reasoning: Optional[Reasoning] = ..., + structured_inputs: Optional[dict[str, StructuredInputDefinition]] = ..., + temperature: Optional[float] = ..., + text: Optional[PromptAgentDefinitionTextOptions] = ..., + tool_choice: Optional[Union[str, ToolChoiceParam]] = ..., + tools: Optional[list[Tool]] = ..., + top_p: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeMCPToolCall(RealtimeConversationItem, discriminator='mcp_call'): - approval_request_id: Optional[str] - arguments: str - error: Optional[RealtimeMCPError] - id: str - name: str - output: Optional[str] - server_label: str - type: Literal[RealtimeConversationItemType.MCP_CALL] + class azure.ai.projects.models.PromptAgentDefinitionTextOptions(_Model): + format: Optional[TextResponseFormat] @overload def __init__( self, *, - approval_request_id: Optional[str] = ..., - arguments: str, - error: Optional[RealtimeMCPError] = ..., - id: str, - name: str, - output: Optional[str] = ..., - server_label: str + format: Optional[TextResponseFormat] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeMCPToolExecutionError(RealtimeMCPError, discriminator='tool_execution_error'): - message: str - type: Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR] + class azure.ai.projects.models.PromptBasedEvaluatorDefinition(EvaluatorDefinition, discriminator='prompt'): + data_schema: dict[str, any] + init_parameters: dict[str, any] + metrics: dict[str, EvaluatorMetric] + prompt_text: str + type: Literal[EvaluatorDefinitionType.PROMPT] @overload def __init__( self, *, - message: str + data_schema: Optional[dict[str, Any]] = ..., + init_parameters: Optional[dict[str, Any]] = ..., + metrics: Optional[dict[str, EvaluatorMetric]] = ..., + prompt_text: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeMcpErrorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - HTTP_ERROR = "http_error" - PROTOCOL_ERROR = "protocol_error" - TOOL_EXECUTION_ERROR = "tool_execution_error" - - - class azure.ai.projects.models.RealtimeReasoning(_Model): - effort: Optional[Union[str, RealtimeReasoningEffort]] + class azure.ai.projects.models.PromptDataGenerationJobSource(DataGenerationJobSource, discriminator='prompt'): + description: str + prompt: str + type: Literal[DataGenerationJobSourceType.PROMPT] @overload def __init__( self, *, - effort: Optional[Union[str, RealtimeReasoningEffort]] = ... + description: Optional[str] = ..., + prompt: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): - HIGH = "high" - LOW = "low" - MEDIUM = "medium" - MINIMAL = "minimal" - XHIGH = "xhigh" - - - class azure.ai.projects.models.RealtimeResponseStatusDetails(_Model): - error: Optional[RealtimeResponseStatusDetailsError] - reason: Optional[Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"]] - type: Optional[Literal["completed", "cancelled", "failed", "incomplete"]] + class azure.ai.projects.models.PromptEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator='prompt'): + description: Optional[str] + prompt: str + type: Literal[EvaluatorGenerationJobSourceType.PROMPT] @overload def __init__( self, *, - error: Optional[RealtimeResponseStatusDetailsError] = ..., - reason: Optional[Literal[turn_detected, client_cancelled, max_output_tokens, content_filter]] = ..., - type: Optional[Literal[completed, cancelled, failed, incomplete]] = ... + description: Optional[str] = ..., + prompt: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeResponseStatusDetailsError(_Model): - code: Optional[str] - type: Optional[str] + class azure.ai.projects.models.ProtocolConfiguration(_Model): + a2a: Optional[A2AProtocolConfiguration] + activity: Optional[ActivityProtocolConfiguration] + invocations: Optional[InvocationsProtocolConfiguration] + invocations_ws: Optional[InvocationsWsProtocolConfiguration] + mcp: Optional[McpProtocolConfiguration] + responses: Optional[ResponsesProtocolConfiguration] @overload def __init__( self, *, - code: Optional[str] = ..., - type: Optional[str] = ... + a2a: Optional[A2AProtocolConfiguration] = ..., + activity: Optional[ActivityProtocolConfiguration] = ..., + invocations: Optional[InvocationsProtocolConfiguration] = ..., + invocations_ws: Optional[InvocationsWsProtocolConfiguration] = ..., + mcp: Optional[McpProtocolConfiguration] = ..., + responses: Optional[ResponsesProtocolConfiguration] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeResponseUsage(_Model): - input_token_details: Optional[RealtimeResponseUsageInputTokenDetails] - input_tokens: Optional[int] - output_token_details: Optional[RealtimeResponseUsageOutputTokenDetails] - output_tokens: Optional[int] - total_tokens: Optional[int] + class azure.ai.projects.models.ProtocolVersionRecord(_Model): + protocol: Union[str, AgentEndpointProtocol] + version: str @overload def __init__( self, *, - input_token_details: Optional[RealtimeResponseUsageInputTokenDetails] = ..., - input_tokens: Optional[int] = ..., - output_token_details: Optional[RealtimeResponseUsageOutputTokenDetails] = ..., - output_tokens: Optional[int] = ..., - total_tokens: Optional[int] = ... + protocol: Union[str, AgentEndpointProtocol], + version: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeResponseUsageInputTokenDetails(_Model): - audio_tokens: Optional[int] - cached_tokens: Optional[int] - cached_tokens_details: Optional[RealtimeResponseUsageInputTokenDetailsCachedTokensDetails] - image_tokens: Optional[int] - text_tokens: Optional[int] + class azure.ai.projects.models.PublishApprovalStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + APPROVED = "approved" + NOT_PUBLISHED = "not_published" + NO_APPROVAL_NEEDED = "no_approval_needed" + PENDING = "pending" + REJECTED = "rejected" + + + class azure.ai.projects.models.RaiConfig(_Model): + rai_policy_name: str @overload def __init__( self, *, - audio_tokens: Optional[int] = ..., - cached_tokens: Optional[int] = ..., - cached_tokens_details: Optional[RealtimeResponseUsageInputTokenDetailsCachedTokensDetails] = ..., - image_tokens: Optional[int] = ..., - text_tokens: Optional[int] = ... + rai_policy_name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails(_Model): - audio_tokens: Optional[int] - image_tokens: Optional[int] - text_tokens: Optional[int] + class azure.ai.projects.models.RankerVersionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "auto" + DEFAULT_2024_11_15 = "default-2024-11-15" + + + class azure.ai.projects.models.RankingOptions(_Model): + hybrid_search: Optional[HybridSearchOptions] + ranker: Optional[Union[str, RankerVersionType]] + score_threshold: Optional[float] @overload def __init__( self, *, - audio_tokens: Optional[int] = ..., - image_tokens: Optional[int] = ..., - text_tokens: Optional[int] = ... + hybrid_search: Optional[HybridSearchOptions] = ..., + ranker: Optional[Union[str, RankerVersionType]] = ..., + score_threshold: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeResponseUsageOutputTokenDetails(_Model): - audio_tokens: Optional[int] - text_tokens: Optional[int] + class azure.ai.projects.models.RealtimeAudioFormats(_Model): + type: str @overload def __init__( self, *, - audio_tokens: Optional[int] = ..., - text_tokens: Optional[int] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEvent(_Model): - type: str + class azure.ai.projects.models.RealtimeAudioFormatsAudioPcm(RealtimeAudioFormats, discriminator='audio/pcm'): + rate: Optional[Literal[24000]] + type: Literal[RealtimeAudioFormatsType.AUDIO_PCM] @overload def __init__( self, *, - type: str + rate: Optional[Literal[24000]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError(_Model): - code: Optional[str] - message: Optional[str] - param: Optional[str] - type: Optional[str] + class azure.ai.projects.models.RealtimeAudioFormatsAudioPcma(RealtimeAudioFormats, discriminator='audio/pcma'): + type: Literal[RealtimeAudioFormatsType.AUDIO_PCMA] @overload - def __init__( - self, - *, - code: Optional[str] = ..., - message: Optional[str] = ..., - param: Optional[str] = ..., - type: Optional[str] = ... - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventError(_Model): - error: RealtimeServerEventErrorError - event_id: str - type: Literal["error"] + class azure.ai.projects.models.RealtimeAudioFormatsAudioPcmu(RealtimeAudioFormats, discriminator='audio/pcmu'): + type: Literal[RealtimeAudioFormatsType.AUDIO_PCMU] @overload - def __init__( - self, - *, - error: RealtimeServerEventErrorError, - event_id: str - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventErrorError(_Model): - code: Optional[str] - event_id: Optional[str] - message: str - param: Optional[str] + class azure.ai.projects.models.RealtimeAudioFormatsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUDIO_PCM = "audio/pcm" + AUDIO_PCMA = "audio/pcma" + AUDIO_PCMU = "audio/pcmu" + + + class azure.ai.projects.models.RealtimeClientEvent(_Model): type: str @overload def __init__( self, *, - code: Optional[str] = ..., - event_id: Optional[str] = ..., - message: str, - param: Optional[str] = ..., type: str ) -> None: ... @@ -8931,462 +8719,338 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventRateLimitsUpdatedRateLimits(_Model): - limit: Optional[int] - name: Optional[Literal["requests", "tokens"]] - remaining: Optional[int] - reset_seconds: Optional[float] + class azure.ai.projects.models.RealtimeClientEventConversationItemCreate(RealtimeClientEvent, discriminator='conversation.item.create'): + event_id: Optional[str] + item: RealtimeConversationItem + previous_item_id: Optional[str] + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE] @overload def __init__( self, *, - limit: Optional[int] = ..., - name: Optional[Literal[requests, tokens]] = ..., - remaining: Optional[int] = ..., - reset_seconds: Optional[float] = ... + event_id: Optional[str] = ..., + item: RealtimeConversationItem, + previous_item_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseContentPartAdded(RealtimeServerEvent, discriminator='response.content_part.added'): - content_index: int - event_id: str + class azure.ai.projects.models.RealtimeClientEventConversationItemDelete(RealtimeClientEvent, discriminator='conversation.item.delete'): + event_id: Optional[str] item_id: str - output_index: int - part: RealtimeServerEventResponseContentPartAddedPart - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED] + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE] @overload def __init__( self, *, - content_index: int, - event_id: str, - item_id: str, - output_index: int, - part: RealtimeServerEventResponseContentPartAddedPart, - response_id: str + event_id: Optional[str] = ..., + item_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseContentPartAddedPart(_Model): - audio: Optional[str] - text: Optional[str] - transcript: Optional[str] - type: Optional[Literal["audio", "text"]] + class azure.ai.projects.models.RealtimeClientEventConversationItemRetrieve(RealtimeClientEvent, discriminator='conversation.item.retrieve'): + event_id: Optional[str] + item_id: str + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE] @overload def __init__( self, *, - audio: Optional[str] = ..., - text: Optional[str] = ..., - transcript: Optional[str] = ..., - type: Optional[Literal[audio, text]] = ... + event_id: Optional[str] = ..., + item_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CONVERSATION_CREATED = "conversation.created" - CONVERSATION_ITEM_ADDED = "conversation.item.added" - CONVERSATION_ITEM_CREATED = "conversation.item.created" - CONVERSATION_ITEM_DELETED = "conversation.item.deleted" - CONVERSATION_ITEM_DONE = "conversation.item.done" - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED = "conversation.item.input_audio_transcription.completed" - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA = "conversation.item.input_audio_transcription.delta" - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED = "conversation.item.input_audio_transcription.failed" - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT = "conversation.item.input_audio_transcription.segment" - CONVERSATION_ITEM_RETRIEVED = "conversation.item.retrieved" - CONVERSATION_ITEM_TRUNCATED = "conversation.item.truncated" - ERROR = "error" - INPUT_AUDIO_BUFFER_CLEARED = "input_audio_buffer.cleared" - INPUT_AUDIO_BUFFER_COMMITTED = "input_audio_buffer.committed" - INPUT_AUDIO_BUFFER_DTMF_EVENT_RECEIVED = "input_audio_buffer.dtmf_event_received" - INPUT_AUDIO_BUFFER_SPEECH_STARTED = "input_audio_buffer.speech_started" - INPUT_AUDIO_BUFFER_SPEECH_STOPPED = "input_audio_buffer.speech_stopped" - INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED = "input_audio_buffer.timeout_triggered" - MCP_LIST_TOOLS_COMPLETED = "mcp_list_tools.completed" - MCP_LIST_TOOLS_FAILED = "mcp_list_tools.failed" - MCP_LIST_TOOLS_IN_PROGRESS = "mcp_list_tools.in_progress" - OUTPUT_AUDIO_BUFFER_CLEARED = "output_audio_buffer.cleared" - OUTPUT_AUDIO_BUFFER_STARTED = "output_audio_buffer.started" - OUTPUT_AUDIO_BUFFER_STOPPED = "output_audio_buffer.stopped" - RATE_LIMITS_UPDATED = "rate_limits.updated" - RESPONSE_CONTENT_PART_ADDED = "response.content_part.added" - RESPONSE_CONTENT_PART_DONE = "response.content_part.done" - RESPONSE_CREATED = "response.created" - RESPONSE_DONE = "response.done" - RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA = "response.function_call_arguments.delta" - RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE = "response.function_call_arguments.done" - RESPONSE_MCP_CALL_ARGUMENTS_DELTA = "response.mcp_call_arguments.delta" - RESPONSE_MCP_CALL_ARGUMENTS_DONE = "response.mcp_call_arguments.done" - RESPONSE_MCP_CALL_COMPLETED = "response.mcp_call.completed" - RESPONSE_MCP_CALL_FAILED = "response.mcp_call.failed" - RESPONSE_MCP_CALL_IN_PROGRESS = "response.mcp_call.in_progress" - RESPONSE_OUTPUT_AUDIO_DELTA = "response.output_audio.delta" - RESPONSE_OUTPUT_AUDIO_DONE = "response.output_audio.done" - RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA = "response.output_audio_transcript.delta" - RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE = "response.output_audio_transcript.done" - RESPONSE_OUTPUT_ITEM_ADDED = "response.output_item.added" - RESPONSE_OUTPUT_ITEM_DONE = "response.output_item.done" - RESPONSE_OUTPUT_TEXT_DELTA = "response.output_text.delta" - RESPONSE_OUTPUT_TEXT_DONE = "response.output_text.done" - SESSION_CREATED = "session.created" - SESSION_UPDATED = "session.updated" - - - class azure.ai.projects.models.Reasoning(_Model): - context: Optional[Literal["auto", "current_turn", "all_turns"]] - effort: Optional[Union[str, ReasoningEffort]] - generate_summary: Optional[Literal["auto", "concise", "detailed"]] - mode: Optional[Union[str, ReasoningModeEnum]] - summary: Optional[Literal["auto", "concise", "detailed"]] + class azure.ai.projects.models.RealtimeClientEventConversationItemTruncate(RealtimeClientEvent, discriminator='conversation.item.truncate'): + audio_end_ms: int + content_index: int + event_id: Optional[str] + item_id: str + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE] @overload def __init__( self, *, - context: Optional[Literal[auto, current_turn, all_turns]] = ..., - effort: Optional[Union[str, ReasoningEffort]] = ..., - generate_summary: Optional[Literal[auto, concise, detailed]] = ..., - mode: Optional[Union[str, ReasoningModeEnum]] = ..., - summary: Optional[Literal[auto, concise, detailed]] = ... + audio_end_ms: int, + content_index: int, + event_id: Optional[str] = ..., + item_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): - HIGH = "high" - LOW = "low" - MAX = "max" - MEDIUM = "medium" - MINIMAL = "minimal" - NONE = "none" - XHIGH = "xhigh" - - - class azure.ai.projects.models.ReasoningModeEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): - PRO = "pro" - STANDARD = "standard" - - - class azure.ai.projects.models.RecurrenceSchedule(_Model): - type: str + class azure.ai.projects.models.RealtimeClientEventInputAudioBufferAppend(RealtimeClientEvent, discriminator='input_audio_buffer.append'): + audio: str + event_id: Optional[str] + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND] @overload def __init__( self, *, - type: str + audio: str, + event_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RecurrenceTrigger(Trigger, discriminator='Recurrence'): - end_time: Optional[datetime] - interval: int - schedule: RecurrenceSchedule - start_time: Optional[datetime] - time_zone: Optional[str] - type: Literal[TriggerType.RECURRENCE] + class azure.ai.projects.models.RealtimeClientEventInputAudioBufferClear(RealtimeClientEvent, discriminator='input_audio_buffer.clear'): + event_id: Optional[str] + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR] @overload def __init__( self, *, - end_time: Optional[datetime] = ..., - interval: int, - schedule: RecurrenceSchedule, - start_time: Optional[datetime] = ..., - time_zone: Optional[str] = ... + event_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RecurrenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DAILY = "Daily" - HOURLY = "Hourly" - MONTHLY = "Monthly" - WEEKLY = "Weekly" - - - class azure.ai.projects.models.RedTeam(_Model): - application_scenario: Optional[str] - attack_strategies: Optional[list[Union[str, AttackStrategy]]] - display_name: Optional[str] - name: str - num_turns: Optional[int] - properties: Optional[dict[str, str]] - risk_categories: Optional[list[Union[str, RiskCategory]]] - simulation_only: Optional[bool] - status: Optional[str] - tags: Optional[dict[str, str]] - target: RedTeamTargetConfig + class azure.ai.projects.models.RealtimeClientEventInputAudioBufferCommit(RealtimeClientEvent, discriminator='input_audio_buffer.commit'): + event_id: Optional[str] + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT] @overload def __init__( self, *, - application_scenario: Optional[str] = ..., - attack_strategies: Optional[list[Union[str, AttackStrategy]]] = ..., - display_name: Optional[str] = ..., - num_turns: Optional[int] = ..., - properties: Optional[dict[str, str]] = ..., - risk_categories: Optional[list[Union[str, RiskCategory]]] = ..., - simulation_only: Optional[bool] = ..., - tags: Optional[dict[str, str]] = ..., - target: RedTeamTargetConfig + event_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RedTeamEvalRunDataSource(TypedDict, total=False): - key "item_generation_params": Required[Any] - key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] - key "type": Required[Literal["azure_ai_red_team"]] - - - class azure.ai.projects.models.RedTeamTargetConfig(_Model): - type: str + class azure.ai.projects.models.RealtimeClientEventOutputAudioBufferClear(RealtimeClientEvent, discriminator='output_audio_buffer.clear'): + event_id: Optional[str] + type: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR] @overload def __init__( self, *, - type: str + event_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ReminderPreviewToolboxTool(ToolboxTool, discriminator='reminder_preview'): - description: str - name: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.REMINDER_PREVIEW] + class azure.ai.projects.models.RealtimeClientEventResponseCancel(RealtimeClientEvent, discriminator='response.cancel'): + event_id: Optional[str] + response_id: Optional[str] + type: Literal[RealtimeClientEventType.RESPONSE_CANCEL] @overload def __init__( self, *, - description: Optional[str] = ..., - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + event_id: Optional[str] = ..., + response_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ResponseRetrievalItemGenerationParams(TypedDict, total=False): - key "data_mapping": Required[Dict[str, str]] - key "max_num_turns": int - key "source": Required[Union[SourceFileContent, SourceFileID]] - key "type": Required[Literal["response_retrieval"]] - - - class azure.ai.projects.models.ResponseUsageInputTokensDetails(_Model): - cache_write_tokens: int - cached_tokens: int + class azure.ai.projects.models.RealtimeClientEventResponseCreate(RealtimeClientEvent, discriminator='response.create'): + event_id: Optional[str] + response: Optional[VoiceAgentResponseCreateParams] + type: Literal[RealtimeClientEventType.RESPONSE_CREATE] @overload def __init__( self, *, - cache_write_tokens: int, - cached_tokens: int + event_id: Optional[str] = ..., + response: Optional[VoiceAgentResponseCreateParams] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ResponseUsageOutputTokensDetails(_Model): - reasoning_tokens: int + class azure.ai.projects.models.RealtimeClientEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONVERSATION_ITEM_CREATE = "conversation.item.create" + CONVERSATION_ITEM_DELETE = "conversation.item.delete" + CONVERSATION_ITEM_RETRIEVE = "conversation.item.retrieve" + CONVERSATION_ITEM_TRUNCATE = "conversation.item.truncate" + INPUT_AUDIO_BUFFER_APPEND = "input_audio_buffer.append" + INPUT_AUDIO_BUFFER_CLEAR = "input_audio_buffer.clear" + INPUT_AUDIO_BUFFER_COMMIT = "input_audio_buffer.commit" + OUTPUT_AUDIO_BUFFER_CLEAR = "output_audio_buffer.clear" + RESPONSE_CANCEL = "response.cancel" + RESPONSE_CREATE = "response.create" + SESSION_AVATAR_CONNECT = "session.avatar.connect" + SESSION_UPDATE = "session.update" + + + class azure.ai.projects.models.RealtimeConversationItem(_Model): + type: str @overload def __init__( self, *, - reasoning_tokens: int + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ResponsesProtocolConfiguration(_Model): - + class azure.ai.projects.models.RealtimeConversationItemFunctionCall(RealtimeConversationItem, discriminator='function_call'): + arguments: str + call_id: Optional[str] + created_at: Optional[datetime] + id: Optional[str] + name: str + object: Optional[Literal["item"]] + response_id: Optional[str] + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Literal[RealtimeConversationItemType.FUNCTION_CALL] - class azure.ai.projects.models.RiskCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CODE_VULNERABILITY = "CodeVulnerability" - HATE_UNFAIRNESS = "HateUnfairness" - PROHIBITED_ACTIONS = "ProhibitedActions" - PROTECTED_MATERIAL = "ProtectedMaterial" - SELF_HARM = "SelfHarm" - SENSITIVE_DATA_LEAKAGE = "SensitiveDataLeakage" - SEXUAL = "Sexual" - TASK_ADHERENCE = "TaskAdherence" - UNGROUNDED_ATTRIBUTES = "UngroundedAttributes" - VIOLENCE = "Violence" + @overload + def __init__( + self, + *, + arguments: str, + call_id: Optional[str] = ..., + id: Optional[str] = ..., + name: str, + object: Optional[Literal[item]] = ..., + status: Optional[Literal[completed, incomplete, in_progress]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.Routine(_Model): - action: Optional[RoutineAction] + class azure.ai.projects.models.RealtimeConversationItemFunctionCallOutput(RealtimeConversationItem, discriminator='function_call_output'): + call_id: str created_at: Optional[datetime] - description: Optional[str] - enabled: bool + id: Optional[str] name: Optional[str] - triggers: Optional[dict[str, RoutineTrigger]] - updated_at: Optional[datetime] + object: Optional[Literal["item"]] + output: str + response_id: Optional[str] + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT] @overload def __init__( self, *, - action: Optional[RoutineAction] = ..., - created_at: Optional[datetime] = ..., - description: Optional[str] = ..., - enabled: bool, + call_id: str, + id: Optional[str] = ..., name: Optional[str] = ..., - triggers: Optional[dict[str, RoutineTrigger]] = ..., - updated_at: Optional[datetime] = ... + object: Optional[Literal[item]] = ..., + output: str, + status: Optional[Literal[completed, incomplete, in_progress]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RoutineAction(_Model): - type: str + class azure.ai.projects.models.RealtimeConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FUNCTION_CALL = "function_call" + FUNCTION_CALL_OUTPUT = "function_call_output" + MCP_APPROVAL_REQUEST = "mcp_approval_request" + MCP_APPROVAL_RESPONSE = "mcp_approval_response" + MCP_CALL = "mcp_call" + MCP_LIST_TOOLS = "mcp_list_tools" + + + class azure.ai.projects.models.RealtimeFunctionTool(_Model): + description: Optional[str] + name: Optional[str] + parameters: Optional[RealtimeFunctionToolParameters] + type: Optional[Literal["function"]] @overload def __init__( self, *, - type: str + description: Optional[str] = ..., + name: Optional[str] = ..., + parameters: Optional[RealtimeFunctionToolParameters] = ..., + type: Optional[Literal[function]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RoutineActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - INVOKE_AGENT_INVOCATIONS_API = "invoke_agent_invocations_api" - INVOKE_AGENT_RESPONSES_API = "invoke_agent_responses_api" - - - class azure.ai.projects.models.RoutineAttemptSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): - EVENT_FIRE = "event_fire" - MANUAL_DISPATCH = "manual_dispatch" - QUEUED_DISPATCH = "queued_dispatch" - SCHEDULE_DELIVERY = "schedule_delivery" - TIMER_DELIVERY = "timer_delivery" + class azure.ai.projects.models.RealtimeFunctionToolParameters(_Model): - class azure.ai.projects.models.RoutineDispatchPayload(_Model): - type: str + class azure.ai.projects.models.RealtimeMCPApprovalRequest(RealtimeConversationItem, discriminator='mcp_approval_request'): + arguments: str + created_at: Optional[datetime] + id: str + name: str + response_id: Optional[str] + server_label: str + type: Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST] @overload def __init__( self, *, - type: str + arguments: str, + id: str, + name: str, + server_label: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RoutineDispatchPayloadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - INVOKE_AGENT_INVOCATIONS_API = "invoke_agent_invocations_api" - INVOKE_AGENT_RESPONSES_API = "invoke_agent_responses_api" - - - class azure.ai.projects.models.RoutineRun(_Model): - action_correlation_id: Optional[str] - action_type: Optional[Union[str, RoutineActionType]] - agent_endpoint_id: Optional[str] - agent_id: Optional[str] - attempt_source: Optional[Union[str, RoutineAttemptSource]] - conversation_id: Optional[str] - dispatch_id: Optional[str] - ended_at: Optional[datetime] - error_message: Optional[str] - error_status_code: Optional[int] - error_type: Optional[str] + class azure.ai.projects.models.RealtimeMCPApprovalResponse(RealtimeConversationItem, discriminator='mcp_approval_response'): + approval_request_id: str + approve: bool + created_at: Optional[datetime] id: str - phase: Optional[Union[str, RoutineRunPhase]] + reason: Optional[str] response_id: Optional[str] - scheduled_fire_at: Optional[datetime] - session_id: Optional[str] - started_at: Optional[datetime] - status: Optional[RoutineRunStatus] - task_id: Optional[str] - trigger_event_payload: Optional[dict[str, Any]] - trigger_name: Optional[str] - trigger_type: Optional[Union[str, RoutineTriggerType]] - triggered_at: Optional[datetime] + type: Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE] @overload def __init__( self, *, - action_correlation_id: Optional[str] = ..., - action_type: Optional[Union[str, RoutineActionType]] = ..., - agent_endpoint_id: Optional[str] = ..., - agent_id: Optional[str] = ..., - attempt_source: Optional[Union[str, RoutineAttemptSource]] = ..., - conversation_id: Optional[str] = ..., - dispatch_id: Optional[str] = ..., - ended_at: Optional[datetime] = ..., - error_message: Optional[str] = ..., - error_status_code: Optional[int] = ..., - error_type: Optional[str] = ..., - phase: Optional[Union[str, RoutineRunPhase]] = ..., - response_id: Optional[str] = ..., - scheduled_fire_at: Optional[datetime] = ..., - session_id: Optional[str] = ..., - started_at: Optional[datetime] = ..., - status: Optional[RoutineRunStatus] = ..., - task_id: Optional[str] = ..., - trigger_event_payload: Optional[dict[str, Any]] = ..., - trigger_name: Optional[str] = ..., - trigger_type: Optional[Union[str, RoutineTriggerType]] = ..., - triggered_at: Optional[datetime] = ... + approval_request_id: str, + approve: bool, + id: str, + reason: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RoutineRunPhase(str, Enum, metaclass=CaseInsensitiveEnumMeta): - COMPLETED = "completed" - DISPATCHING = "dispatching" - FAILED = "failed" - QUEUED = "queued" - - - class azure.ai.projects.models.RoutineTrigger(_Model): + class azure.ai.projects.models.RealtimeMCPError(_Model): type: str @overload @@ -9400,588 +9064,525 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RoutineTriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CUSTOM = "custom" - GITHUB_ISSUE = "github_issue" - SCHEDULE = "schedule" - TIMER = "timer" - - - class azure.ai.projects.models.RubricBasedEvaluatorDefinition(EvaluatorDefinition, discriminator='rubric'): - data_schema: dict[str, any] - dimensions: list[Dimension] - init_parameters: dict[str, any] - metrics: dict[str, EvaluatorMetric] - pass_threshold: Optional[float] - type: Literal[EvaluatorDefinitionType.RUBRIC] + class azure.ai.projects.models.RealtimeMCPHTTPError(RealtimeMCPError, discriminator='http_error'): + code: int + message: str + type: Literal[RealtimeMcpErrorType.HTTP_ERROR] @overload def __init__( self, *, - data_schema: Optional[dict[str, Any]] = ..., - dimensions: list[Dimension], - init_parameters: Optional[dict[str, Any]] = ..., - metrics: Optional[dict[str, EvaluatorMetric]] = ..., - pass_threshold: Optional[float] = ... + code: int, + message: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RubricGenerationInputQualityWarning(_Model): - code: Union[str, RubricGenerationInputQualityWarningCode] - message: str - severity: Union[str, RubricGenerationInputQualityWarningSeverity] - source: Union[str, RubricGenerationInputQualityWarningSource] - source_index: Optional[int] + class azure.ai.projects.models.RealtimeMCPListTools(RealtimeConversationItem, discriminator='mcp_list_tools'): + created_at: Optional[datetime] + id: Optional[str] + response_id: Optional[str] + server_label: str + tools: list[MCPListToolsTool] + type: Literal[RealtimeConversationItemType.MCP_LIST_TOOLS] @overload def __init__( self, *, - code: Union[str, RubricGenerationInputQualityWarningCode], - message: str, - severity: Union[str, RubricGenerationInputQualityWarningSeverity], - source: Union[str, RubricGenerationInputQualityWarningSource], - source_index: Optional[int] = ... + id: Optional[str] = ..., + server_label: str, + tools: list[MCPListToolsTool] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RubricGenerationInputQualityWarningCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - EMPTY_AGENT_INSTRUCTIONS = "empty_agent_instructions" - EMPTY_DATASET_CONTENT = "empty_dataset_content" - EMPTY_PROMPT = "empty_prompt" - INSUFFICIENT_TOTAL_INPUT = "insufficient_total_input" - LOW_TRACE_COUNT = "low_trace_count" - SHORT_AGENT_INSTRUCTIONS = "short_agent_instructions" - SHORT_DATASET_CONTENT = "short_dataset_content" - SHORT_PROMPT = "short_prompt" - - - class azure.ai.projects.models.RubricGenerationInputQualityWarningSeverity(str, Enum, metaclass=CaseInsensitiveEnumMeta): - WARNING = "warning" - - - class azure.ai.projects.models.RubricGenerationInputQualityWarningSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENT = "agent" - AGGREGATE = "aggregate" - DATASET = "dataset" - PROMPT = "prompt" - - - class azure.ai.projects.models.SASCredentials(BaseCredentials, discriminator='SAS'): - sas_token: Optional[str] - type: Literal[CredentialType.SAS] + class azure.ai.projects.models.RealtimeMCPProtocolError(RealtimeMCPError, discriminator='protocol_error'): + code: int + message: str + type: Literal[RealtimeMcpErrorType.PROTOCOL_ERROR] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + code: int, + message: str + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SampleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - EVALUATION_RESULT_SAMPLE = "EvaluationResultSample" - - - class azure.ai.projects.models.Schedule(_Model): - description: Optional[str] - display_name: Optional[str] - enabled: bool - properties: Optional[dict[str, str]] - provisioning_status: Optional[Union[str, ScheduleProvisioningStatus]] - schedule_id: str - system_data: dict[str, str] - tags: Optional[dict[str, str]] - task: ScheduleTask - trigger: Trigger + class azure.ai.projects.models.RealtimeMCPToolCall(RealtimeConversationItem, discriminator='mcp_call'): + approval_request_id: Optional[str] + arguments: str + created_at: Optional[datetime] + error: Optional[RealtimeMCPError] + id: str + name: str + output: Optional[str] + response_id: Optional[str] + server_label: str + type: Literal[RealtimeConversationItemType.MCP_CALL] @overload def __init__( self, *, - description: Optional[str] = ..., - display_name: Optional[str] = ..., - enabled: bool, - properties: Optional[dict[str, str]] = ..., - tags: Optional[dict[str, str]] = ..., - task: ScheduleTask, - trigger: Trigger + approval_request_id: Optional[str] = ..., + arguments: str, + error: Optional[RealtimeMCPError] = ..., + id: str, + name: str, + output: Optional[str] = ..., + server_label: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ScheduleProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CREATING = "Creating" - DELETING = "Deleting" - FAILED = "Failed" - SUCCEEDED = "Succeeded" - UPDATING = "Updating" - - - class azure.ai.projects.models.ScheduleRoutineTrigger(RoutineTrigger, discriminator='schedule'): - cron_expression: str - time_zone: str - type: Literal[RoutineTriggerType.SCHEDULE] + class azure.ai.projects.models.RealtimeMCPToolExecutionError(RealtimeMCPError, discriminator='tool_execution_error'): + message: str + type: Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR] @overload def __init__( self, *, - cron_expression: str, - time_zone: str + message: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ScheduleRun(_Model): - error: Optional[str] - properties: dict[str, str] - run_id: str - schedule_id: str - success: bool - trigger_time: Optional[datetime] - - @overload - def __init__( - self, - *, - schedule_id: str, - trigger_time: Optional[datetime] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.RealtimeMcpErrorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HTTP_ERROR = "http_error" + PROTOCOL_ERROR = "protocol_error" + TOOL_EXECUTION_ERROR = "tool_execution_error" - class azure.ai.projects.models.ScheduleTask(_Model): - configuration: Optional[dict[str, str]] - type: str + class azure.ai.projects.models.RealtimeReasoning(_Model): + effort: Optional[Union[str, RealtimeReasoningEffort]] @overload def __init__( self, *, - configuration: Optional[dict[str, str]] = ..., - type: str + effort: Optional[Union[str, RealtimeReasoningEffort]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ScheduleTaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - EVALUATION = "Evaluation" - INSIGHT = "Insight" - - - class azure.ai.projects.models.SearchContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - IMAGE = "image" - TEXT = "text" - - - class azure.ai.projects.models.SearchContextSize(str, Enum, metaclass=CaseInsensitiveEnumMeta): + class azure.ai.projects.models.RealtimeReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): HIGH = "high" LOW = "low" MEDIUM = "medium" + MINIMAL = "minimal" + XHIGH = "xhigh" - class azure.ai.projects.models.SessionDirectoryEntry(_Model): - is_directory: bool - modified_time: datetime - name: str - size: int + class azure.ai.projects.models.RealtimeResponseStatusDetails(_Model): + error: Optional[RealtimeResponseStatusDetailsError] + reason: Optional[Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"]] + type: Optional[Literal["completed", "cancelled", "failed", "incomplete"]] @overload def __init__( self, *, - is_directory: bool, - modified_time: datetime, - name: str, - size: int + error: Optional[RealtimeResponseStatusDetailsError] = ..., + reason: Optional[Literal[turn_detected, client_cancelled, max_output_tokens, content_filter]] = ..., + type: Optional[Literal[completed, cancelled, failed, incomplete]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SessionFileWriteResult(_Model): - bytes_written: int - path: str + class azure.ai.projects.models.RealtimeResponseStatusDetailsError(_Model): + code: Optional[str] + type: Optional[str] @overload def __init__( self, *, - bytes_written: int, - path: str + code: Optional[str] = ..., + type: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SessionLogEvent(_Model): - data: str - event: Union[str, SessionLogEventType] + class azure.ai.projects.models.RealtimeResponseUsage(_Model): + input_token_details: Optional[RealtimeResponseUsageInputTokenDetails] + input_tokens: Optional[int] + output_token_details: Optional[RealtimeResponseUsageOutputTokenDetails] + output_tokens: Optional[int] + total_tokens: Optional[int] @overload def __init__( self, *, - data: str, - event: Union[str, SessionLogEventType] + input_token_details: Optional[RealtimeResponseUsageInputTokenDetails] = ..., + input_tokens: Optional[int] = ..., + output_token_details: Optional[RealtimeResponseUsageOutputTokenDetails] = ..., + output_tokens: Optional[int] = ..., + total_tokens: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SessionLogEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - LOG = "log" - - - class azure.ai.projects.models.SharepointGroundingToolParameters(_Model): - project_connections: Optional[list[ToolProjectConnection]] + class azure.ai.projects.models.RealtimeResponseUsageInputTokenDetails(_Model): + audio_tokens: Optional[int] + cached_tokens: Optional[int] + cached_tokens_details: Optional[RealtimeResponseUsageInputTokenDetailsCachedTokensDetails] + image_tokens: Optional[int] + text_tokens: Optional[int] @overload def __init__( self, *, - project_connections: Optional[list[ToolProjectConnection]] = ... + audio_tokens: Optional[int] = ..., + cached_tokens: Optional[int] = ..., + cached_tokens_details: Optional[RealtimeResponseUsageInputTokenDetailsCachedTokensDetails] = ..., + image_tokens: Optional[int] = ..., + text_tokens: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SharepointPreviewTool(Tool, discriminator='sharepoint_grounding_preview'): - sharepoint_grounding_preview: SharepointGroundingToolParameters - type: Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW] + class azure.ai.projects.models.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails(_Model): + audio_tokens: Optional[int] + image_tokens: Optional[int] + text_tokens: Optional[int] @overload def __init__( self, *, - sharepoint_grounding_preview: SharepointGroundingToolParameters + audio_tokens: Optional[int] = ..., + image_tokens: Optional[int] = ..., + text_tokens: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SimpleQnADataGenerationJobOptions(DataGenerationJobOptions, discriminator='simple_qna'): - max_samples: int - model_options: DataGenerationModelOptions - question_types: Optional[list[Union[str, SimpleQnAFineTuningQuestionType]]] - train_split: float - type: Literal[DataGenerationJobType.SIMPLE_QNA] + class azure.ai.projects.models.RealtimeResponseUsageOutputTokenDetails(_Model): + audio_tokens: Optional[int] + text_tokens: Optional[int] @overload def __init__( self, *, - max_samples: int, - model_options: Optional[DataGenerationModelOptions] = ..., - question_types: Optional[list[Union[str, SimpleQnAFineTuningQuestionType]]] = ..., - train_split: Optional[float] = ... + audio_tokens: Optional[int] = ..., + text_tokens: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SimpleQnAFineTuningQuestionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - LONG_ANSWER = "long_answer" - SHORT_ANSWER = "short_answer" - - - class azure.ai.projects.models.SimulationSeedDataGenerationJobOptions(DataGenerationJobOptions, discriminator='simulation_seed'): - max_samples: int - model_options: DataGenerationModelOptions - train_split: float - type: Literal[DataGenerationJobType.SIMULATION_SEED] + class azure.ai.projects.models.RealtimeServerEvent(_Model): + type: str @overload def __init__( self, *, - max_samples: int, - model_options: Optional[DataGenerationModelOptions] = ..., - train_split: Optional[float] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SkillDetails(_Model): - created_at: datetime - default_version: str - description: str - id: str - latest_version: str - name: str + class azure.ai.projects.models.RealtimeServerEventConversationItemAdded(RealtimeServerEvent, discriminator='conversation.item.added'): + event_id: str + item: RealtimeConversationItem + previous_item_id: Optional[str] + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED] @overload def __init__( self, *, - created_at: datetime, - default_version: str, - description: str, - id: str, - latest_version: str, - name: str + event_id: str, + item: RealtimeConversationItem, + previous_item_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SkillInlineContent(_Model): - allowed_tools: Optional[list[str]] - compatibility: Optional[str] - description: str - instructions: str - license: Optional[str] - metadata: Optional[dict[str, str]] + class azure.ai.projects.models.RealtimeServerEventConversationItemCreated(RealtimeServerEvent, discriminator='conversation.item.created'): + event_id: str + item: RealtimeConversationItem + previous_item_id: Optional[str] + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED] @overload def __init__( self, *, - allowed_tools: Optional[list[str]] = ..., - compatibility: Optional[str] = ..., - description: str, - instructions: str, - license: Optional[str] = ..., - metadata: Optional[dict[str, str]] = ... + event_id: str, + item: RealtimeConversationItem, + previous_item_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SkillReferenceParam(ContainerSkill, discriminator='skill_reference'): - skill_id: str - type: Literal[ContainerSkillType.SKILL_REFERENCE] - version: Optional[str] + class azure.ai.projects.models.RealtimeServerEventConversationItemDeleted(RealtimeServerEvent, discriminator='conversation.item.deleted'): + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED] @overload def __init__( self, *, - skill_id: str, - version: Optional[str] = ... + event_id: str, + item_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SkillVersion(_Model): - created_at: datetime - description: str - id: str - name: str - skill_id: str - version: str + class azure.ai.projects.models.RealtimeServerEventConversationItemDone(RealtimeServerEvent, discriminator='conversation.item.done'): + event_id: str + item: RealtimeConversationItem + previous_item_id: Optional[str] + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE] @overload def __init__( self, *, - created_at: datetime, - description: str, - id: str, - name: str, - skill_id: str, - version: str + event_id: str, + item: RealtimeConversationItem, + previous_item_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SpecificApplyPatchParam(ToolChoiceParam, discriminator='apply_patch'): - type: Literal[ToolChoiceParamType.APPLY_PATCH] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.SpecificFunctionShellParam(ToolChoiceParam, discriminator='shell'): - type: Literal[ToolChoiceParamType.SHELL] + class azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionCompleted(RealtimeServerEvent, discriminator='conversation.item.input_audio_transcription.completed'): + content_index: int + event_id: str + item_id: str + logprobs: Optional[list[LogProbProperties]] + phrases: Optional[list[VoiceAgentTranscriptionPhrase]] + transcript: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED] + usage: Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + content_index: int, + event_id: str, + item_id: str, + logprobs: Optional[list[LogProbProperties]] = ..., + phrases: Optional[list[VoiceAgentTranscriptionPhrase]] = ..., + transcript: str, + usage: Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration] + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SpecificProgrammaticToolCallingParam(ToolChoiceParam, discriminator='programmatic_tool_calling'): - type: Literal[ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING] + class azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionDelta(RealtimeServerEvent, discriminator='conversation.item.input_audio_transcription.delta'): + content_index: Optional[int] + delta: Optional[str] + event_id: str + item_id: str + logprobs: Optional[list[LogProbProperties]] + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + content_index: Optional[int] = ..., + delta: Optional[str] = ..., + event_id: str, + item_id: str, + logprobs: Optional[list[LogProbProperties]] = ... + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.StructuredInputDefinition(_Model): - default_value: Optional[Any] - description: Optional[str] - required: Optional[bool] - schema: Optional[dict[str, Any]] + class azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionFailed(RealtimeServerEvent, discriminator='conversation.item.input_audio_transcription.failed'): + content_index: int + error: RealtimeServerEventConversationItemInputAudioTranscriptionFailedError + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED] @overload def __init__( self, *, - default_value: Optional[Any] = ..., - description: Optional[str] = ..., - required: Optional[bool] = ..., - schema: Optional[dict[str, Any]] = ... + content_index: int, + error: RealtimeServerEventConversationItemInputAudioTranscriptionFailedError, + event_id: str, + item_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.StructuredOutputDefinition(_Model): - description: str - name: str - schema: dict[str, Any] - strict: bool + class azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError(_Model): + code: Optional[str] + message: Optional[str] + param: Optional[str] + type: Optional[str] @overload def __init__( self, *, - description: str, - name: str, - schema: dict[str, Any], - strict: bool + code: Optional[str] = ..., + message: Optional[str] = ..., + param: Optional[str] = ..., + type: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TargetCompletionEvalRunDataSource(TypedDict, total=False): - key "input_messages": Required[InputMessagesItemReference] - key "source": Required[Union[SourceFileContent, SourceFileID]] - key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] - key "type": Required[Literal["azure_ai_target_completions"]] - - - class azure.ai.projects.models.TaxonomyCategory(_Model): - description: Optional[str] + class azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionSegment(RealtimeServerEvent, discriminator='conversation.item.input_audio_transcription.segment'): + content_index: int + end: float + event_id: str id: str - name: str - properties: Optional[dict[str, str]] - risk_category: Union[str, RiskCategory] - sub_categories: list[TaxonomySubCategory] + item_id: str + speaker: str + start: float + text: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT] @overload def __init__( self, *, - description: Optional[str] = ..., + content_index: int, + end: float, + event_id: str, id: str, - name: str, - properties: Optional[dict[str, str]] = ..., - risk_category: Union[str, RiskCategory], - sub_categories: list[TaxonomySubCategory] + item_id: str, + speaker: str, + start: float, + text: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TaxonomySubCategory(_Model): - description: Optional[str] - enabled: bool - id: str - name: str - properties: Optional[dict[str, str]] + class azure.ai.projects.models.RealtimeServerEventConversationItemRetrieved(RealtimeServerEvent, discriminator='conversation.item.retrieved'): + event_id: str + item: RealtimeConversationItem + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED] @overload def __init__( self, *, - description: Optional[str] = ..., - enabled: bool, - id: str, - name: str, - properties: Optional[dict[str, str]] = ... + event_id: str, + item: RealtimeConversationItem ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelemetryConfig(_Model): - endpoints: list[TelemetryEndpoint] + class azure.ai.projects.models.RealtimeServerEventConversationItemTruncated(RealtimeServerEvent, discriminator='conversation.item.truncated'): + audio_end_ms: int + content_index: int + event_id: str + item: Optional[RealtimeConversationItem] + item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED] @overload def __init__( self, *, - endpoints: list[TelemetryEndpoint] + audio_end_ms: int, + content_index: int, + event_id: str, + item: Optional[RealtimeConversationItem] = ..., + item_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelemetryDataKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CONTAINER_OTEL = "ContainerOtel" - CONTAINER_STDOUT_STDERR = "ContainerStdoutStderr" - METRICS = "Metrics" - - - class azure.ai.projects.models.TelemetryEndpoint(_Model): - auth: Optional[TelemetryEndpointAuth] - data: list[Union[str, TelemetryDataKind]] - kind: str + class azure.ai.projects.models.RealtimeServerEventError(_Model): + error: RealtimeServerEventErrorError + event_id: str + type: Literal["error"] @overload def __init__( self, *, - auth: Optional[TelemetryEndpointAuth] = ..., - data: list[Union[str, TelemetryDataKind]], - kind: str + error: RealtimeServerEventErrorError, + event_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelemetryEndpointAuth(_Model): + class azure.ai.projects.models.RealtimeServerEventErrorError(_Model): + code: Optional[str] + event_id: Optional[str] + message: str + param: Optional[str] type: str @overload def __init__( self, *, + code: Optional[str] = ..., + event_id: Optional[str] = ..., + message: str, + param: Optional[str] = ..., type: str ) -> None: ... @@ -9989,754 +9590,893 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelemetryEndpointAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - HEADER = "header" - - - class azure.ai.projects.models.TelemetryEndpointKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - OTLP = "OTLP" + class azure.ai.projects.models.RealtimeServerEventInputAudioBufferCleared(RealtimeServerEvent, discriminator='input_audio_buffer.cleared'): + event_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED] + @overload + def __init__( + self, + *, + event_id: str + ) -> None: ... - class azure.ai.projects.models.TelemetryTransportProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - GRPC = "Grpc" - HTTP = "Http" + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TemplateVoiceGreetingConfig(VoiceGreetingConfig, discriminator='template'): - text: str - type: Literal["template"] + class azure.ai.projects.models.RealtimeServerEventInputAudioBufferCommitted(RealtimeServerEvent, discriminator='input_audio_buffer.committed'): + event_id: str + item_id: str + previous_item_id: Optional[str] + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED] @overload def __init__( self, *, - text: str + event_id: str, + item_id: str, + previous_item_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TestingCriterionAzureAIEvaluator(TypedDict, total=False): - key "data_mapping": Dict[str, str] - key "evaluator_name": Required[str] - key "evaluator_version": str - key "initialization_parameters": Dict[str, Any] - key "name": Required[str] - key "type": Required[Literal["azure_ai_evaluator"]] - - - class azure.ai.projects.models.TextResponseFormat(_Model): - type: str + class azure.ai.projects.models.RealtimeServerEventInputAudioBufferSpeechStarted(RealtimeServerEvent, discriminator='input_audio_buffer.speech_started'): + audio_start_ms: int + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED] @overload def __init__( self, *, - type: str + audio_start_ms: int, + event_id: str, + item_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TextResponseFormatConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - JSON_OBJECT = "json_object" - JSON_SCHEMA = "json_schema" - TEXT = "text" - - - class azure.ai.projects.models.TextResponseFormatJsonObject(TextResponseFormat, discriminator='json_object'): - type: Literal[TextResponseFormatConfigurationType.JSON_OBJECT] + class azure.ai.projects.models.RealtimeServerEventInputAudioBufferSpeechStopped(RealtimeServerEvent, discriminator='input_audio_buffer.speech_stopped'): + audio_end_ms: int + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + audio_end_ms: int, + event_id: str, + item_id: str + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TextResponseFormatJsonSchema(TextResponseFormat, discriminator='json_schema'): - description: Optional[str] - name: str - schema: dict[str, Any] - strict: Optional[bool] - type: Literal[TextResponseFormatConfigurationType.JSON_SCHEMA] + class azure.ai.projects.models.RealtimeServerEventInputAudioBufferTimeoutTriggered(RealtimeServerEvent, discriminator='input_audio_buffer.timeout_triggered'): + audio_end_ms: int + audio_start_ms: int + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED] @overload def __init__( self, *, - description: Optional[str] = ..., - name: str, - schema: dict[str, Any], - strict: Optional[bool] = ... + audio_end_ms: int, + audio_start_ms: int, + event_id: str, + item_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TextResponseFormatText(TextResponseFormat, discriminator='text'): - type: Literal[TextResponseFormatConfigurationType.TEXT] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.TimerRoutineTrigger(RoutineTrigger, discriminator='timer'): - at: Optional[datetime] - type: Literal[RoutineTriggerType.TIMER] + class azure.ai.projects.models.RealtimeServerEventMCPListToolsCompleted(RealtimeServerEvent, discriminator='mcp_list_tools.completed'): + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED] @overload def __init__( self, *, - at: Optional[datetime] = ... + event_id: str, + item_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.Tool(_Model): - type: str + class azure.ai.projects.models.RealtimeServerEventMCPListToolsFailed(RealtimeServerEvent, discriminator='mcp_list_tools.failed'): + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED] @overload def __init__( self, *, - type: str + event_id: str, + item_id: str ) -> 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]] - type: Literal[ToolChoiceParamType.ALLOWED_TOOLS] + class azure.ai.projects.models.RealtimeServerEventMCPListToolsInProgress(RealtimeServerEvent, discriminator='mcp_list_tools.in_progress'): + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS] @overload def __init__( self, *, - mode: Literal["auto", "required"], - tools: list[dict[str, Any]] + event_id: str, + item_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceCodeInterpreter(ToolChoiceParam, discriminator='code_interpreter'): - type: Literal[ToolChoiceParamType.CODE_INTERPRETER] + class azure.ai.projects.models.RealtimeServerEventOutputAudioBufferCleared(RealtimeServerEvent, discriminator='output_audio_buffer.cleared'): + event_id: str + response_id: str + type: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + event_id: str, + response_id: str + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceComputer(ToolChoiceParam, discriminator='computer'): - type: Literal[ToolChoiceParamType.COMPUTER] + class azure.ai.projects.models.RealtimeServerEventRateLimitsUpdated(RealtimeServerEvent, discriminator='rate_limits.updated'): + event_id: str + rate_limits: list[RealtimeServerEventRateLimitsUpdatedRateLimits] + type: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + event_id: str, + rate_limits: list[RealtimeServerEventRateLimitsUpdatedRateLimits] + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceComputerUse(ToolChoiceParam, discriminator='computer_use'): - type: Literal[ToolChoiceParamType.COMPUTER_USE] + class azure.ai.projects.models.RealtimeServerEventRateLimitsUpdatedRateLimits(_Model): + limit: Optional[int] + name: Optional[Literal["requests", "tokens"]] + remaining: Optional[int] + reset_seconds: Optional[float] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + limit: Optional[int] = ..., + name: Optional[Literal[requests, tokens]] = ..., + remaining: Optional[int] = ..., + reset_seconds: Optional[float] = ... + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceComputerUsePreview(ToolChoiceParam, discriminator='computer_use_preview'): - type: Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW] + class azure.ai.projects.models.RealtimeServerEventResponseAudioDelta(RealtimeServerEvent, discriminator='response.output_audio.delta'): + content_index: int + delta: bytes + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + content_index: int, + delta: bytes, + event_id: str, + item_id: str, + output_index: int, + response_id: str + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceCustom(ToolChoiceParam, discriminator='custom'): - name: str - type: Literal[ToolChoiceParamType.CUSTOM] + class azure.ai.projects.models.RealtimeServerEventResponseAudioDone(RealtimeServerEvent, discriminator='response.output_audio.done'): + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE] @overload def __init__( self, *, - name: str + content_index: int, + event_id: str, + item_id: str, + output_index: int, + response_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceFileSearch(ToolChoiceParam, discriminator='file_search'): - type: Literal[ToolChoiceParamType.FILE_SEARCH] + class azure.ai.projects.models.RealtimeServerEventResponseAudioTranscriptDelta(RealtimeServerEvent, discriminator='response.output_audio_transcript.delta'): + content_index: int + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + content_index: int, + delta: str, + event_id: str, + item_id: str, + output_index: int, + response_id: str + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceFunction(ToolChoiceParam, discriminator='function'): - name: str - type: Literal[ToolChoiceParamType.FUNCTION] + class azure.ai.projects.models.RealtimeServerEventResponseAudioTranscriptDone(RealtimeServerEvent, discriminator='response.output_audio_transcript.done'): + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + transcript: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE] @overload def __init__( self, *, - name: str + content_index: int, + event_id: str, + item_id: str, + output_index: int, + response_id: str, + transcript: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceImageGeneration(ToolChoiceParam, discriminator='image_generation'): - type: Literal[ToolChoiceParamType.IMAGE_GENERATION] + class azure.ai.projects.models.RealtimeServerEventResponseContentPartAdded(RealtimeServerEvent, discriminator='response.content_part.added'): + content_index: int + event_id: str + item_id: str + output_index: int + part: RealtimeServerEventResponseContentPartAddedPart + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + content_index: int, + event_id: str, + item_id: str, + output_index: int, + part: RealtimeServerEventResponseContentPartAddedPart, + response_id: str + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceMCP(ToolChoiceParam, discriminator='mcp'): - name: Optional[str] - server_label: str - type: Literal[ToolChoiceParamType.MCP] + class azure.ai.projects.models.RealtimeServerEventResponseContentPartAddedPart(_Model): + audio: Optional[str] + text: Optional[str] + transcript: Optional[str] + type: Optional[Literal["audio", "text"]] @overload def __init__( self, *, - name: Optional[str] = ..., - server_label: str + audio: Optional[str] = ..., + text: Optional[str] = ..., + transcript: Optional[str] = ..., + type: Optional[Literal[audio, text]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceOptions(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AUTO = "auto" - NONE = "none" - REQUIRED = "required" - - - class azure.ai.projects.models.ToolChoiceParam(_Model): - type: str + class azure.ai.projects.models.RealtimeServerEventResponseContentPartDone(RealtimeServerEvent, discriminator='response.content_part.done'): + content_index: int + event_id: str + item_id: str + output_index: int + part: RealtimeServerEventResponseContentPartDonePart + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE] @overload def __init__( self, *, - type: str + content_index: int, + event_id: str, + item_id: str, + output_index: int, + part: RealtimeServerEventResponseContentPartDonePart, + response_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ALLOWED_TOOLS = "allowed_tools" - APPLY_PATCH = "apply_patch" - CODE_INTERPRETER = "code_interpreter" - COMPUTER = "computer" - COMPUTER_USE = "computer_use" - COMPUTER_USE_PREVIEW = "computer_use_preview" - CUSTOM = "custom" - FILE_SEARCH = "file_search" - FUNCTION = "function" - IMAGE_GENERATION = "image_generation" - MCP = "mcp" - PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" - SHELL = "shell" - WEB_SEARCH_PREVIEW = "web_search_preview" - WEB_SEARCH_PREVIEW_2025_03_11 = "web_search_preview_2025_03_11" - - - class azure.ai.projects.models.ToolChoiceWebSearchPreview(ToolChoiceParam, discriminator='web_search_preview'): - type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW] + class azure.ai.projects.models.RealtimeServerEventResponseContentPartDonePart(_Model): + audio: Optional[str] + format: Optional[RealtimeAudioFormats] + text: Optional[str] + transcript: Optional[str] + type: Optional[Literal["audio", "text"]] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + audio: Optional[str] = ..., + format: Optional[RealtimeAudioFormats] = ..., + text: Optional[str] = ..., + transcript: Optional[str] = ..., + type: Optional[Literal[audio, text]] = ... + ) -> None: ... @overload 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.RealtimeServerEventResponseCreated(RealtimeServerEvent, discriminator='response.created'): + event_id: str + response: VoiceAgentRealtimeResponse + type: Literal[RealtimeServerEventType.RESPONSE_CREATED] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + event_id: str, + response: VoiceAgentRealtimeResponse + ) -> 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.RealtimeServerEventResponseDone(RealtimeServerEvent, discriminator='response.done'): + event_id: str + response: VoiceAgentRealtimeResponse + type: Literal[RealtimeServerEventType.RESPONSE_DONE] @overload def __init__( self, *, - additional_search_text: Optional[str] = ..., - pin: Optional[bool] = ... + event_id: str, + response: VoiceAgentRealtimeResponse ) -> 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.RealtimeServerEventResponseFunctionCallArgumentsDelta(RealtimeServerEvent, discriminator='response.function_call_arguments.delta'): + call_id: str + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA] @overload def __init__( self, *, - description: Optional[str] = ..., - name: Optional[str] = ... + call_id: str, + delta: str, + event_id: str, + item_id: str, + output_index: int, + response_id: 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.ToolProjectConnection(_Model): - project_connection_id: str + class azure.ai.projects.models.RealtimeServerEventResponseFunctionCallArgumentsDone(RealtimeServerEvent, discriminator='response.function_call_arguments.done'): + arguments: str + call_id: str + event_id: str + item_id: str + name: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE] @overload def __init__( self, *, - project_connection_id: str + arguments: str, + call_id: str, + event_id: str, + item_id: str, + name: str, + output_index: int, + response_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolSearchExecutionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CLIENT = "client" - 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.RealtimeServerEventResponseMCPCallArgumentsDelta(RealtimeServerEvent, discriminator='response.mcp_call_arguments.delta'): + delta: str + event_id: str + item_id: str + obfuscation: Optional[str] + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA] @overload def __init__( self, *, - description: Optional[str] = ..., - execution: Optional[Union[str, ToolSearchExecutionType]] = ..., - parameters: Optional[EmptyModelParam] = ... + delta: str, + event_id: str, + item_id: str, + obfuscation: Optional[str] = ..., + output_index: int, + response_id: str ) -> 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.RealtimeServerEventResponseMCPCallArgumentsDone(RealtimeServerEvent, discriminator='response.mcp_call_arguments.done'): + arguments: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE] @overload def __init__( self, *, - description: Optional[str] = ..., - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + arguments: str, + event_id: str, + item_id: str, + output_index: int, + response_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - A2A_PREVIEW = "a2a_preview" - A2_A = "a2a" - APPLY_PATCH = "apply_patch" - AZURE_AI_SEARCH = "azure_ai_search" - AZURE_FUNCTION = "azure_function" - BING_CUSTOM_SEARCH_PREVIEW = "bing_custom_search_preview" - BING_GROUNDING = "bing_grounding" - BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" - CAPTURE_STRUCTURED_OUTPUTS = "capture_structured_outputs" - CODE_INTERPRETER = "code_interpreter" - COMPUTER = "computer" - COMPUTER_USE_PREVIEW = "computer_use_preview" - CUSTOM = "custom" - FABRIC_DATAAGENT_PREVIEW = "fabric_dataagent_preview" - FABRIC_IQ_PREVIEW = "fabric_iq_preview" - FILE_SEARCH = "file_search" - FUNCTION = "function" - IMAGE_GENERATION = "image_generation" - LOCAL_SHELL = "local_shell" - MCP = "mcp" - MEMORY_SEARCH_PREVIEW = "memory_search_preview" - NAMESPACE = "namespace" - OPENAPI = "openapi" - PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" - SHAREPOINT_GROUNDING_PREVIEW = "sharepoint_grounding_preview" - SHELL = "shell" - TOOLBOX_SEARCH_PREVIEW = "toolbox_search_preview" - TOOL_SEARCH = "tool_search" - WEB_SEARCH = "web_search" - WEB_SEARCH_PREVIEW = "web_search_preview" - WORK_IQ_PREVIEW = "work_iq_preview" - - - class azure.ai.projects.models.ToolUseFineTuningDataGenerationJobOptions(DataGenerationJobOptions, discriminator='tool_use'): - max_samples: int - model_options: DataGenerationModelOptions - train_split: float - type: Literal[DataGenerationJobType.TOOL_USE] + class azure.ai.projects.models.RealtimeServerEventResponseMCPCallCompleted(RealtimeServerEvent, discriminator='response.mcp_call.completed'): + event_id: str + item_id: str + output_index: int + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED] @overload def __init__( self, *, - max_samples: int, - model_options: Optional[DataGenerationModelOptions] = ..., - train_split: Optional[float] = ... + event_id: str, + item_id: str, + output_index: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxObject(_Model): - default_version: str - id: str - name: str + class azure.ai.projects.models.RealtimeServerEventResponseMCPCallFailed(RealtimeServerEvent, discriminator='response.mcp_call.failed'): + event_id: str + item_id: str + output_index: int + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED] @overload def __init__( self, *, - default_version: str, - id: str, - name: str + event_id: str, + item_id: str, + output_index: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxPolicies(_Model): - rai_config: Optional[RaiConfig] + class azure.ai.projects.models.RealtimeServerEventResponseMCPCallInProgress(RealtimeServerEvent, discriminator='response.mcp_call.in_progress'): + event_id: str + item_id: str + output_index: int + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS] @overload def __init__( self, *, - rai_config: Optional[RaiConfig] = ... + event_id: str, + item_id: str, + output_index: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxSearchPreviewToolboxTool(ToolboxTool, discriminator='toolbox_search_preview'): - description: str - name: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW] + class azure.ai.projects.models.RealtimeServerEventResponseOutputItemAdded(RealtimeServerEvent, discriminator='response.output_item.added'): + event_id: str + item: RealtimeConversationItem + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED] @overload def __init__( self, *, - description: Optional[str] = ..., - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + event_id: str, + item: RealtimeConversationItem, + output_index: int, + response_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxSkill(_Model): - type: str + class azure.ai.projects.models.RealtimeServerEventResponseOutputItemDone(RealtimeServerEvent, discriminator='response.output_item.done'): + event_id: str + item: RealtimeConversationItem + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE] @overload def __init__( self, *, - type: str + event_id: str, + item: RealtimeConversationItem, + output_index: int, + response_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxSkillReference(ToolboxSkill, discriminator='skill_reference'): - name: str - type: Literal["skill_reference"] - version: Optional[str] + class azure.ai.projects.models.RealtimeServerEventResponseTextDelta(RealtimeServerEvent, discriminator='response.output_text.delta'): + content_index: int + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA] @overload def __init__( self, *, - name: str, - version: Optional[str] = ... + content_index: int, + delta: str, + event_id: str, + item_id: str, + output_index: int, + response_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxTool(_Model): - description: Optional[str] - name: Optional[str] - tool_configs: Optional[dict[str, ToolConfig]] - type: str + class azure.ai.projects.models.RealtimeServerEventResponseTextDone(RealtimeServerEvent, discriminator='response.output_text.done'): + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + text: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE] @overload def __init__( self, *, - description: Optional[str] = ..., - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ..., - type: str + content_index: int, + event_id: str, + item_id: str, + output_index: int, + response_id: str, + text: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - A2A_PREVIEW = "a2a_preview" - A2_A = "a2a" - AZURE_AI_SEARCH = "azure_ai_search" - BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" - CODE_INTERPRETER = "code_interpreter" - FABRIC_IQ_PREVIEW = "fabric_iq_preview" - FILE_SEARCH = "file_search" - MCP = "mcp" - OPENAPI = "openapi" - REMINDER_PREVIEW = "reminder_preview" - TOOLBOX_SEARCH = "toolbox_search" - TOOLBOX_SEARCH_PREVIEW = "toolbox_search_preview" - WEB_SEARCH = "web_search" - WORK_IQ_PREVIEW = "work_iq_preview" - - - class azure.ai.projects.models.ToolboxVersionObject(_Model): - created_at: datetime - description: Optional[str] - id: str - metadata: dict[str, str] - name: str - policies: Optional[ToolboxPolicies] - skills: Optional[list[ToolboxSkill]] - tools: list[ToolboxTool] - version: str + class azure.ai.projects.models.RealtimeServerEventSessionCreated(RealtimeServerEvent, discriminator='session.created'): + conversation_id: Optional[str] + event_id: str + session: VoiceAgentSessionResponseConfig + type: Literal[RealtimeServerEventType.SESSION_CREATED] @overload def __init__( self, *, - created_at: datetime, - description: Optional[str] = ..., - id: str, - metadata: dict[str, str], - name: str, - policies: Optional[ToolboxPolicies] = ..., - skills: Optional[list[ToolboxSkill]] = ..., - tools: list[ToolboxTool], - version: str + conversation_id: Optional[str] = ..., + event_id: str, + session: VoiceAgentSessionResponseConfig ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TracesDataGenerationJobOptions(DataGenerationJobOptions, discriminator='traces'): - max_samples: int - model_options: DataGenerationModelOptions - redact_private_content: Optional[bool] - train_split: float - type: Literal[DataGenerationJobType.TRACES] + class azure.ai.projects.models.RealtimeServerEventSessionUpdated(RealtimeServerEvent, discriminator='session.updated'): + event_id: str + session: VoiceAgentSessionResponseConfig + type: Literal[RealtimeServerEventType.SESSION_UPDATED] @overload def __init__( self, *, - max_samples: int, - model_options: Optional[DataGenerationModelOptions] = ..., - redact_private_content: Optional[bool] = ..., - train_split: Optional[float] = ... + event_id: str, + session: VoiceAgentSessionResponseConfig ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TracesDataGenerationJobSource(DataGenerationJobSource, discriminator='traces'): - agent_id: Optional[str] - agent_name: Optional[str] - agent_version: Optional[str] - description: str - end_time: Optional[datetime] - start_time: datetime - type: Literal[DataGenerationJobSourceType.TRACES] - - @overload - def __init__( - self, - *, - agent_id: Optional[str] = ..., - agent_name: Optional[str] = ..., - agent_version: Optional[str] = ..., - description: Optional[str] = ..., - end_time: Optional[datetime] = ..., - start_time: datetime - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.RealtimeServerEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONVERSATION_CREATED = "conversation.created" + CONVERSATION_ITEM_ADDED = "conversation.item.added" + CONVERSATION_ITEM_CREATED = "conversation.item.created" + CONVERSATION_ITEM_DELETED = "conversation.item.deleted" + CONVERSATION_ITEM_DONE = "conversation.item.done" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED = "conversation.item.input_audio_transcription.completed" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA = "conversation.item.input_audio_transcription.delta" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED = "conversation.item.input_audio_transcription.failed" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT = "conversation.item.input_audio_transcription.segment" + CONVERSATION_ITEM_RETRIEVED = "conversation.item.retrieved" + CONVERSATION_ITEM_TRUNCATED = "conversation.item.truncated" + ERROR = "error" + INPUT_AUDIO_BUFFER_CLEARED = "input_audio_buffer.cleared" + INPUT_AUDIO_BUFFER_COMMITTED = "input_audio_buffer.committed" + INPUT_AUDIO_BUFFER_DTMF_EVENT_RECEIVED = "input_audio_buffer.dtmf_event_received" + INPUT_AUDIO_BUFFER_SPEECH_STARTED = "input_audio_buffer.speech_started" + INPUT_AUDIO_BUFFER_SPEECH_STOPPED = "input_audio_buffer.speech_stopped" + INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED = "input_audio_buffer.timeout_triggered" + MCP_LIST_TOOLS_COMPLETED = "mcp_list_tools.completed" + MCP_LIST_TOOLS_FAILED = "mcp_list_tools.failed" + MCP_LIST_TOOLS_IN_PROGRESS = "mcp_list_tools.in_progress" + OUTPUT_AUDIO_BUFFER_CLEARED = "output_audio_buffer.cleared" + OUTPUT_AUDIO_BUFFER_STARTED = "output_audio_buffer.started" + OUTPUT_AUDIO_BUFFER_STOPPED = "output_audio_buffer.stopped" + RATE_LIMITS_UPDATED = "rate_limits.updated" + RESPONSE_ANIMATION_BLENDSHAPES_DELTA = "response.animation_blendshapes.delta" + RESPONSE_ANIMATION_BLENDSHAPES_DONE = "response.animation_blendshapes.done" + RESPONSE_ANIMATION_VISEME_DELTA = "response.animation_viseme.delta" + RESPONSE_ANIMATION_VISEME_DONE = "response.animation_viseme.done" + RESPONSE_AUDIO_TIMESTAMP_DELTA = "response.audio_timestamp.delta" + RESPONSE_AUDIO_TIMESTAMP_DONE = "response.audio_timestamp.done" + RESPONSE_CONTENT_PART_ADDED = "response.content_part.added" + RESPONSE_CONTENT_PART_DONE = "response.content_part.done" + RESPONSE_CREATED = "response.created" + RESPONSE_DONE = "response.done" + RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA = "response.function_call_arguments.delta" + RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE = "response.function_call_arguments.done" + RESPONSE_MCP_CALL_ARGUMENTS_DELTA = "response.mcp_call_arguments.delta" + RESPONSE_MCP_CALL_ARGUMENTS_DONE = "response.mcp_call_arguments.done" + RESPONSE_MCP_CALL_COMPLETED = "response.mcp_call.completed" + RESPONSE_MCP_CALL_FAILED = "response.mcp_call.failed" + RESPONSE_MCP_CALL_IN_PROGRESS = "response.mcp_call.in_progress" + RESPONSE_OUTPUT_AUDIO_DELTA = "response.output_audio.delta" + RESPONSE_OUTPUT_AUDIO_DONE = "response.output_audio.done" + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA = "response.output_audio_transcript.delta" + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE = "response.output_audio_transcript.done" + RESPONSE_OUTPUT_ITEM_ADDED = "response.output_item.added" + RESPONSE_OUTPUT_ITEM_DONE = "response.output_item.done" + RESPONSE_OUTPUT_TEXT_DELTA = "response.output_text.delta" + RESPONSE_OUTPUT_TEXT_DONE = "response.output_text.done" + RESPONSE_VIDEO_DELTA = "response.video.delta" + SESSION_AVATAR_CONNECTING = "session.avatar.connecting" + SESSION_AVATAR_SWITCH_TO_IDLE = "session.avatar.switch_to_idle" + SESSION_AVATAR_SWITCH_TO_SPEAKING = "session.avatar.switch_to_speaking" + SESSION_CREATED = "session.created" + SESSION_UPDATED = "session.updated" + WARNING = "warning" - class azure.ai.projects.models.TracesEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator='traces'): - agent_id: Optional[str] - agent_name: Optional[str] - agent_version: Optional[str] - description: Optional[str] - end_time: Optional[datetime] - start_time: datetime - type: Literal[EvaluatorGenerationJobSourceType.TRACES] + class azure.ai.projects.models.Reasoning(_Model): + context: Optional[Literal["auto", "current_turn", "all_turns"]] + effort: Optional[Union[str, ReasoningEffort]] + generate_summary: Optional[Literal["auto", "concise", "detailed"]] + mode: Optional[Union[str, ReasoningModeEnum]] + summary: Optional[Literal["auto", "concise", "detailed"]] @overload def __init__( self, *, - agent_id: Optional[str] = ..., - agent_name: Optional[str] = ..., - agent_version: Optional[str] = ..., - description: Optional[str] = ..., - end_time: Optional[datetime] = ..., - start_time: datetime + context: Optional[Literal[auto, current_turn, all_turns]] = ..., + effort: Optional[Union[str, ReasoningEffort]] = ..., + generate_summary: Optional[Literal[auto, concise, detailed]] = ..., + mode: Optional[Union[str, ReasoningModeEnum]] = ..., + summary: Optional[Literal[auto, concise, detailed]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TracesPreviewEvalRunDataSource(TypedDict, total=False): - key "agent_id": str - key "agent_name": str - key "end_time": datetime - key "ingestion_delay_seconds": int - key "lookback_hours": int - key "max_traces": int - key "trace_ids": List[str] - key "type": Required[Literal["azure_ai_traces_preview"]] + class azure.ai.projects.models.ReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HIGH = "high" + LOW = "low" + MAX = "max" + MEDIUM = "medium" + MINIMAL = "minimal" + NONE = "none" + XHIGH = "xhigh" - class azure.ai.projects.models.TranscriptTextUsageDuration(CreateTranscriptionResponseJsonUsage, discriminator='duration'): - seconds: timedelta - type: Literal[CreateTranscriptionResponseJsonUsageType.DURATION] + class azure.ai.projects.models.ReasoningModeEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PRO = "pro" + STANDARD = "standard" + + + class azure.ai.projects.models.RecurrenceSchedule(_Model): + type: str @overload def __init__( self, *, - seconds: timedelta + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TranscriptTextUsageTokens(CreateTranscriptionResponseJsonUsage, discriminator='tokens'): - input_token_details: Optional[TranscriptTextUsageTokensInputTokenDetails] - input_tokens: int - output_tokens: int - total_tokens: int - type: Literal[CreateTranscriptionResponseJsonUsageType.TOKENS] + class azure.ai.projects.models.RecurrenceTrigger(Trigger, discriminator='Recurrence'): + end_time: Optional[datetime] + interval: int + schedule: RecurrenceSchedule + start_time: Optional[datetime] + time_zone: Optional[str] + type: Literal[TriggerType.RECURRENCE] @overload def __init__( self, *, - input_token_details: Optional[TranscriptTextUsageTokensInputTokenDetails] = ..., - input_tokens: int, - output_tokens: int, - total_tokens: int + end_time: Optional[datetime] = ..., + interval: int, + schedule: RecurrenceSchedule, + start_time: Optional[datetime] = ..., + time_zone: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TranscriptTextUsageTokensInputTokenDetails(_Model): - audio_tokens: Optional[int] - text_tokens: Optional[int] + class azure.ai.projects.models.RecurrenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DAILY = "Daily" + HOURLY = "Hourly" + MONTHLY = "Monthly" + WEEKLY = "Weekly" + + + class azure.ai.projects.models.RedTeam(_Model): + application_scenario: Optional[str] + attack_strategies: Optional[list[Union[str, AttackStrategy]]] + display_name: Optional[str] + name: str + num_turns: Optional[int] + properties: Optional[dict[str, str]] + risk_categories: Optional[list[Union[str, RiskCategory]]] + simulation_only: Optional[bool] + status: Optional[str] + tags: Optional[dict[str, str]] + target: RedTeamTargetConfig @overload def __init__( self, *, - audio_tokens: Optional[int] = ..., - text_tokens: Optional[int] = ... + application_scenario: Optional[str] = ..., + attack_strategies: Optional[list[Union[str, AttackStrategy]]] = ..., + display_name: Optional[str] = ..., + num_turns: Optional[int] = ..., + properties: Optional[dict[str, str]] = ..., + risk_categories: Optional[list[Union[str, RiskCategory]]] = ..., + simulation_only: Optional[bool] = ..., + tags: Optional[dict[str, str]] = ..., + target: RedTeamTargetConfig ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TreatmentEffectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CHANGED = "Changed" - DEGRADED = "Degraded" - IMPROVED = "Improved" - INCONCLUSIVE = "Inconclusive" - TOO_FEW_SAMPLES = "TooFewSamples" + class azure.ai.projects.models.RedTeamEvalRunDataSource(TypedDict, total=False): + key "item_generation_params": Required[Any] + key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] + key "type": Required[Literal["azure_ai_red_team"]] - class azure.ai.projects.models.Trigger(_Model): + class azure.ai.projects.models.RedTeamTargetConfig(_Model): type: str @overload @@ -10750,118 +10490,111 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CRON = "Cron" - ONE_TIME = "OneTime" - RECURRENCE = "Recurrence" - - - class azure.ai.projects.models.UpdateMemoriesLROPoller(LROPoller[MemoryStoreUpdateCompletedResult]): - property superseded_by: Optional[str] # Read-only - property update_id: str # Read-only - - @classmethod - def from_continuation_token( - cls, - polling_method: PollingMethod[MemoryStoreUpdateCompletedResult], - continuation_token: str, - **kwargs: Any - ) -> UpdateMemoriesLROPoller: ... - - - class azure.ai.projects.models.UpdateModelVersionRequest(_Model): - description: Optional[str] - tags: Optional[dict[str, str]] + class azure.ai.projects.models.ReminderPreviewToolboxTool(ToolboxTool, discriminator='reminder_preview'): + description: str + name: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.REMINDER_PREVIEW] @overload def __init__( self, *, description: Optional[str] = ..., - tags: Optional[dict[str, 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.UpdateToolboxRequest(_Model): - default_version: str + class azure.ai.projects.models.ResponseRetrievalItemGenerationParams(TypedDict, total=False): + key "data_mapping": Required[Dict[str, str]] + key "max_num_turns": int + key "source": Required[Union[SourceFileContent, SourceFileID]] + key "type": Required[Literal["response_retrieval"]] - @overload - def __init__( - self, - *, - default_version: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.UserProfileMemoryItem(MemoryItem, discriminator='user_profile'): - content: str - kind: Literal[MemoryItemKind.USER_PROFILE] - memory_id: str - scope: str - updated_at: datetime + class azure.ai.projects.models.ResponseUsageInputTokensDetails(_Model): + cache_write_tokens: int + cached_tokens: int @overload def __init__( self, *, - content: str, - memory_id: str, - scope: str, - updated_at: datetime + cache_write_tokens: int, + cached_tokens: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VersionIndicator(_Model): - type: str + class azure.ai.projects.models.ResponseUsageOutputTokensDetails(_Model): + reasoning_tokens: int @overload def __init__( self, *, - type: str + reasoning_tokens: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VersionIndicatorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - VERSION_REF = "version_ref" + class azure.ai.projects.models.ResponsesProtocolConfiguration(_Model): - class azure.ai.projects.models.VersionRefIndicator(VersionIndicator, discriminator='version_ref'): - agent_version: str - type: Literal[VersionIndicatorType.VERSION_REF] + class azure.ai.projects.models.RiskCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CODE_VULNERABILITY = "CodeVulnerability" + HATE_UNFAIRNESS = "HateUnfairness" + PROHIBITED_ACTIONS = "ProhibitedActions" + PROTECTED_MATERIAL = "ProtectedMaterial" + SELF_HARM = "SelfHarm" + SENSITIVE_DATA_LEAKAGE = "SensitiveDataLeakage" + SEXUAL = "Sexual" + TASK_ADHERENCE = "TaskAdherence" + UNGROUNDED_ATTRIBUTES = "UngroundedAttributes" + VIOLENCE = "Violence" + + + class azure.ai.projects.models.Routine(_Model): + action: Optional[RoutineAction] + created_at: Optional[datetime] + description: Optional[str] + enabled: bool + name: Optional[str] + triggers: Optional[dict[str, RoutineTrigger]] + updated_at: Optional[datetime] @overload def __init__( self, *, - agent_version: str + action: Optional[RoutineAction] = ..., + created_at: Optional[datetime] = ..., + description: Optional[str] = ..., + enabled: bool, + name: Optional[str] = ..., + triggers: Optional[dict[str, RoutineTrigger]] = ..., + updated_at: Optional[datetime] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VersionSelectionRule(_Model): - agent_version: str + class azure.ai.projects.models.RoutineAction(_Model): type: str @overload def __init__( self, *, - agent_version: str, type: str ) -> None: ... @@ -10869,1943 +10602,1655 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VersionSelector(_Model): - version_selection_rules: list[VersionSelectionRule] + class azure.ai.projects.models.RoutineActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INVOKE_AGENT_INVOCATIONS_API = "invoke_agent_invocations_api" + INVOKE_AGENT_RESPONSES_API = "invoke_agent_responses_api" + + + class azure.ai.projects.models.RoutineAttemptSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EVENT_FIRE = "event_fire" + MANUAL_DISPATCH = "manual_dispatch" + QUEUED_DISPATCH = "queued_dispatch" + SCHEDULE_DELIVERY = "schedule_delivery" + TIMER_DELIVERY = "timer_delivery" + + + class azure.ai.projects.models.RoutineAuthorization(_Model): + identity: Optional[Union[str, RoutineDispatchIdentity]] @overload def __init__( self, *, - version_selection_rules: list[VersionSelectionRule] + identity: Optional[Union[str, RoutineDispatchIdentity]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VersionSelectorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FIXED_RATIO = "FixedRatio" + class azure.ai.projects.models.RoutineDispatchIdentity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT = "agent" + CREATOR = "creator" - class azure.ai.projects.models.VoiceAgentAnimationConfig(_Model): - model_name: Optional[str] - outputs: Optional[list[Union[str, VoiceAgentAnimationOutputType]]] + class azure.ai.projects.models.RoutineDispatchPayload(_Model): + type: str @overload def __init__( self, *, - model_name: Optional[str] = ..., - outputs: Optional[list[Union[str, VoiceAgentAnimationOutputType]]] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentAnimationOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - BLENDSHAPES = "blendshapes" - VISEME_ID = "viseme_id" + class azure.ai.projects.models.RoutineDispatchPayloadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INVOKE_AGENT_INVOCATIONS_API = "invoke_agent_invocations_api" + INVOKE_AGENT_RESPONSES_API = "invoke_agent_responses_api" - class azure.ai.projects.models.VoiceAgentAvatarIceServer(_Model): - credential: Optional[str] - urls: list[str] - username: Optional[str] + class azure.ai.projects.models.RoutineRun(_Model): + action_correlation_id: Optional[str] + action_type: Optional[Union[str, RoutineActionType]] + agent_endpoint_id: Optional[str] + agent_id: Optional[str] + attempt_source: Optional[Union[str, RoutineAttemptSource]] + conversation_id: Optional[str] + dispatch_id: Optional[str] + ended_at: Optional[datetime] + error_message: Optional[str] + error_status_code: Optional[int] + error_type: Optional[str] + id: str + phase: Optional[Union[str, RoutineRunPhase]] + response_id: Optional[str] + scheduled_fire_at: Optional[datetime] + session_id: Optional[str] + started_at: Optional[datetime] + status: Optional[RoutineRunStatus] + task_id: Optional[str] + trigger_event_payload: Optional[dict[str, Any]] + trigger_name: Optional[str] + trigger_type: Optional[Union[str, RoutineTriggerType]] + triggered_at: Optional[datetime] @overload def __init__( self, *, - credential: Optional[str] = ..., - urls: list[str], - username: Optional[str] = ... + action_correlation_id: Optional[str] = ..., + action_type: Optional[Union[str, RoutineActionType]] = ..., + agent_endpoint_id: Optional[str] = ..., + agent_id: Optional[str] = ..., + attempt_source: Optional[Union[str, RoutineAttemptSource]] = ..., + conversation_id: Optional[str] = ..., + dispatch_id: Optional[str] = ..., + ended_at: Optional[datetime] = ..., + error_message: Optional[str] = ..., + error_status_code: Optional[int] = ..., + error_type: Optional[str] = ..., + phase: Optional[Union[str, RoutineRunPhase]] = ..., + response_id: Optional[str] = ..., + scheduled_fire_at: Optional[datetime] = ..., + session_id: Optional[str] = ..., + started_at: Optional[datetime] = ..., + status: Optional[RoutineRunStatus] = ..., + task_id: Optional[str] = ..., + trigger_event_payload: Optional[dict[str, Any]] = ..., + trigger_name: Optional[str] = ..., + trigger_type: Optional[Union[str, RoutineTriggerType]] = ..., + triggered_at: Optional[datetime] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentAvatarScene(_Model): - amplitude: Optional[float] - position_x: Optional[float] - position_y: Optional[float] - rotation_x: Optional[float] - rotation_y: Optional[float] - rotation_z: Optional[float] - zoom: Optional[float] + class azure.ai.projects.models.RoutineRunPhase(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMPLETED = "completed" + DISPATCHING = "dispatching" + FAILED = "failed" + QUEUED = "queued" + + + class azure.ai.projects.models.RoutineTrigger(_Model): + type: str @overload def __init__( self, *, - amplitude: Optional[float] = ..., - position_x: Optional[float] = ..., - position_y: Optional[float] = ..., - rotation_x: Optional[float] = ..., - rotation_y: Optional[float] = ..., - rotation_z: Optional[float] = ..., - zoom: Optional[float] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentAvatarVideoBackground(_Model): - color: Optional[str] - image_url: Optional[str] + class azure.ai.projects.models.RoutineTriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CUSTOM = "custom" + GITHUB_ISSUE = "github_issue" + SCHEDULE = "schedule" + TIMER = "timer" + + + class azure.ai.projects.models.RubricBasedEvaluatorDefinition(EvaluatorDefinition, discriminator='rubric'): + data_schema: dict[str, any] + dimensions: list[Dimension] + init_parameters: dict[str, any] + metrics: dict[str, EvaluatorMetric] + pass_threshold: Optional[float] + type: Literal[EvaluatorDefinitionType.RUBRIC] @overload def __init__( self, *, - color: Optional[str] = ..., - image_url: Optional[str] = ... + data_schema: Optional[dict[str, Any]] = ..., + dimensions: list[Dimension], + init_parameters: Optional[dict[str, Any]] = ..., + metrics: Optional[dict[str, EvaluatorMetric]] = ..., + pass_threshold: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentAvatarVideoCrop(_Model): - bottom_right: list[int] - top_left: list[int] + class azure.ai.projects.models.RubricGenerationInputQualityWarning(_Model): + code: Union[str, RubricGenerationInputQualityWarningCode] + message: str + severity: Union[str, RubricGenerationInputQualityWarningSeverity] + source: Union[str, RubricGenerationInputQualityWarningSource] + source_index: Optional[int] @overload def __init__( self, *, - bottom_right: list[int], - top_left: list[int] + code: Union[str, RubricGenerationInputQualityWarningCode], + message: str, + severity: Union[str, RubricGenerationInputQualityWarningSeverity], + source: Union[str, RubricGenerationInputQualityWarningSource], + source_index: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentAvatarVideoParams(_Model): - background: Optional[VoiceAgentAvatarVideoBackground] - bitrate: Optional[int] - codec: Optional[Literal["h264"]] - crop: Optional[VoiceAgentAvatarVideoCrop] - gop_size: Optional[int] - resolution: Optional[VoiceAgentAvatarVideoResolution] + class azure.ai.projects.models.RubricGenerationInputQualityWarningCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EMPTY_AGENT_INSTRUCTIONS = "empty_agent_instructions" + EMPTY_DATASET_CONTENT = "empty_dataset_content" + EMPTY_PROMPT = "empty_prompt" + INSUFFICIENT_TOTAL_INPUT = "insufficient_total_input" + LOW_TRACE_COUNT = "low_trace_count" + SHORT_AGENT_INSTRUCTIONS = "short_agent_instructions" + SHORT_DATASET_CONTENT = "short_dataset_content" + SHORT_PROMPT = "short_prompt" - @overload - def __init__( - self, - *, - background: Optional[VoiceAgentAvatarVideoBackground] = ..., - bitrate: Optional[int] = ..., - codec: Optional[Literal[h264]] = ..., - crop: Optional[VoiceAgentAvatarVideoCrop] = ..., - gop_size: Optional[int] = ..., - resolution: Optional[VoiceAgentAvatarVideoResolution] = ... - ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.RubricGenerationInputQualityWarningSeverity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + WARNING = "warning" - class azure.ai.projects.models.VoiceAgentAvatarVideoResolution(_Model): - height: int - width: int + class azure.ai.projects.models.RubricGenerationInputQualityWarningSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT = "agent" + AGGREGATE = "aggregate" + DATASET = "dataset" + PROMPT = "prompt" - @overload - def __init__( - self, - *, - height: int, - width: int - ) -> None: ... + + class azure.ai.projects.models.SASCredentials(BaseCredentials, discriminator='SAS'): + sas_token: Optional[str] + type: Literal[CredentialType.SAS] + + @overload + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentClientEventConversationItemCreate(_Model): - event_id: Optional[str] - item: VoiceAgentCreateConversationItem - previous_item_id: Optional[str] - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE] + class azure.ai.projects.models.SampleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EVALUATION_RESULT_SAMPLE = "EvaluationResultSample" + + + class azure.ai.projects.models.Schedule(_Model): + description: Optional[str] + display_name: Optional[str] + enabled: bool + properties: Optional[dict[str, str]] + provisioning_status: Optional[Union[str, ScheduleProvisioningStatus]] + schedule_id: str + system_data: dict[str, str] + tags: Optional[dict[str, str]] + task: ScheduleTask + trigger: Trigger @overload def __init__( self, *, - event_id: Optional[str] = ..., - item: VoiceAgentCreateConversationItem, - previous_item_id: Optional[str] = ..., - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE] + description: Optional[str] = ..., + display_name: Optional[str] = ..., + enabled: bool, + properties: Optional[dict[str, str]] = ..., + tags: Optional[dict[str, str]] = ..., + task: ScheduleTask, + trigger: Trigger ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentClientEventConversationItemDelete(_Model): - event_id: Optional[str] - item_id: str - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE] + class azure.ai.projects.models.ScheduleProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + UPDATING = "Updating" + + + class azure.ai.projects.models.ScheduleRoutineTrigger(RoutineTrigger, discriminator='schedule'): + cron_expression: str + time_zone: str + type: Literal[RoutineTriggerType.SCHEDULE] @overload def __init__( self, *, - event_id: Optional[str] = ..., - item_id: str, - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE] + cron_expression: str, + time_zone: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentClientEventConversationItemRetrieve(_Model): - event_id: Optional[str] - item_id: str - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE] + class azure.ai.projects.models.ScheduleRun(_Model): + error: Optional[str] + properties: dict[str, str] + run_id: str + schedule_id: str + success: bool + trigger_time: Optional[datetime] @overload def __init__( self, *, - event_id: Optional[str] = ..., - item_id: str, - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE] + schedule_id: str, + trigger_time: Optional[datetime] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentClientEventConversationItemTruncate(_Model): - audio_end_ms: int - content_index: int - event_id: Optional[str] - item_id: str - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE] + class azure.ai.projects.models.ScheduleTask(_Model): + configuration: Optional[dict[str, str]] + type: str @overload def __init__( self, *, - audio_end_ms: int, - content_index: int, - event_id: Optional[str] = ..., - item_id: str, - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE] + configuration: Optional[dict[str, str]] = ..., + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentClientEventInputAudioBufferAppend(_Model): - audio: str - event_id: Optional[str] - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND] + class azure.ai.projects.models.ScheduleTaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EVALUATION = "Evaluation" + INSIGHT = "Insight" - @overload - def __init__( - self, - *, - audio: str, - event_id: Optional[str] = ..., - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND] - ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.SearchContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + IMAGE = "image" + TEXT = "text" - class azure.ai.projects.models.VoiceAgentClientEventInputAudioBufferClear(_Model): - event_id: Optional[str] - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR] + class azure.ai.projects.models.SearchContextSize(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HIGH = "high" + LOW = "low" + MEDIUM = "medium" + + + class azure.ai.projects.models.SessionConfiguration(_Model): + idle_timeout_seconds: Optional[timedelta] @overload def __init__( self, *, - event_id: Optional[str] = ..., - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR] + idle_timeout_seconds: Optional[timedelta] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentClientEventInputAudioBufferCommit(_Model): - event_id: Optional[str] - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT] + class azure.ai.projects.models.SessionDirectoryEntry(_Model): + is_directory: bool + modified_time: datetime + name: str + size: int @overload def __init__( self, *, - event_id: Optional[str] = ..., - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT] + is_directory: bool, + modified_time: datetime, + name: str, + size: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentClientEventOutputAudioBufferClear(_Model): - event_id: Optional[str] - type: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR] + class azure.ai.projects.models.SessionFileWriteResult(_Model): + bytes_written: int + path: str @overload def __init__( self, *, - event_id: Optional[str] = ..., - type: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR] + bytes_written: int, + path: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentClientEventResponseCancel(_Model): - event_id: Optional[str] - response_id: Optional[str] - type: Literal[RealtimeClientEventType.RESPONSE_CANCEL] + class azure.ai.projects.models.SessionLogEvent(_Model): + data: str + event: Union[str, SessionLogEventType] @overload def __init__( self, *, - event_id: Optional[str] = ..., - response_id: Optional[str] = ..., - type: Literal[RealtimeClientEventType.RESPONSE_CANCEL] + data: str, + event: Union[str, SessionLogEventType] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentClientEventResponseCreate(_Model): - event_id: Optional[str] - response: Optional[VoiceAgentResponseCreateParams] - type: Literal[RealtimeClientEventType.RESPONSE_CREATE] + class azure.ai.projects.models.SessionLogEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LOG = "log" + + + class azure.ai.projects.models.SharepointGroundingToolParameters(_Model): + project_connections: Optional[list[ToolProjectConnection]] @overload def __init__( self, *, - event_id: Optional[str] = ..., - response: Optional[VoiceAgentResponseCreateParams] = ..., - type: Literal[RealtimeClientEventType.RESPONSE_CREATE] + project_connections: Optional[list[ToolProjectConnection]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentClientEventSessionAvatarConnect(_Model): - client_sdp: str - event_id: Optional[str] - type: Literal["connect"] + class azure.ai.projects.models.SharepointPreviewTool(Tool, discriminator='sharepoint_grounding_preview'): + sharepoint_grounding_preview: SharepointGroundingToolParameters + type: Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW] @overload def __init__( self, *, - client_sdp: str, - event_id: Optional[str] = ... + sharepoint_grounding_preview: SharepointGroundingToolParameters ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentClientEventSessionUpdate(_Model): - event_id: Optional[str] - session: VoiceAgentSessionUpdateConfig - type: Literal[RealtimeClientEventType.SESSION_UPDATE] + class azure.ai.projects.models.ShellToolboxTool(ToolboxTool, discriminator='shell'): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] + description: str + environment: ToolboxShellEnvironment + name: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.SHELL] @overload def __init__( self, *, - event_id: Optional[str] = ..., - session: VoiceAgentSessionUpdateConfig, - type: Literal[RealtimeClientEventType.SESSION_UPDATE] + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., + description: Optional[str] = ..., + environment: ToolboxShellEnvironment, + name: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentDefinition(AgentDefinition, discriminator='voice'): - audio: Optional[VoiceAudioConfig] - avatar: Optional[VoiceAvatarConfig] - greeting: Optional[VoiceGreetingConfig] - include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] - instructions: Optional[str] - interim_response: Optional[VoiceAgentInterimResponse] - kind: Literal[AgentKind.VOICE] - max_output_tokens: Optional[VoiceAgentMaxOutputTokens] - model: str - model_type: 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]] - tool_choice: Optional[VoiceAgentToolChoice] - tools: Optional[list[VoiceAgentTool]] + class azure.ai.projects.models.SimpleQnADataGenerationJobOptions(DataGenerationJobOptions, discriminator='simple_qna'): + max_samples: int + model_options: DataGenerationModelOptions + question_types: Optional[list[Union[str, SimpleQnAFineTuningQuestionType]]] + train_split: float + type: Literal[DataGenerationJobType.SIMPLE_QNA] @overload def __init__( self, *, - audio: Optional[VoiceAudioConfig] = ..., - avatar: Optional[VoiceAvatarConfig] = ..., - greeting: Optional[VoiceGreetingConfig] = ..., - include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] = ..., - instructions: Optional[str] = ..., - interim_response: Optional[VoiceAgentInterimResponse] = ..., - max_output_tokens: Optional[VoiceAgentMaxOutputTokens] = ..., - model: str, - model_type: Union[str, VoiceModelType], - output_modalities: Optional[list[Union[str, VoiceOutputModality]]] = ..., - parallel_tool_calls: Optional[bool] = ..., - rai_config: Optional[RaiConfig] = ..., - store: Optional[bool] = ..., - structured_inputs: Optional[dict[str, StructuredInputDefinition]] = ..., - tool_choice: Optional[VoiceAgentToolChoice] = ..., - tools: Optional[list[VoiceAgentTool]] = ... + max_samples: int, + model_options: Optional[DataGenerationModelOptions] = ..., + question_types: Optional[list[Union[str, SimpleQnAFineTuningQuestionType]]] = ..., + train_split: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentEchoCancellation(_Model): - channels: Optional[int] - reference_source: Optional[Union[str, VoiceAgentEchoCancellationReferenceSource]] - type: Literal["server_echo_cancellation"] + class azure.ai.projects.models.SimpleQnAFineTuningQuestionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LONG_ANSWER = "long_answer" + SHORT_ANSWER = "short_answer" + + + class azure.ai.projects.models.SimulationSeedDataGenerationJobOptions(DataGenerationJobOptions, discriminator='simulation_seed'): + max_samples: int + model_options: DataGenerationModelOptions + train_split: float + type: Literal[DataGenerationJobType.SIMULATION_SEED] @overload def __init__( self, *, - channels: Optional[int] = ..., - reference_source: Optional[Union[str, VoiceAgentEchoCancellationReferenceSource]] = ... + max_samples: int, + model_options: Optional[DataGenerationModelOptions] = ..., + train_split: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentEchoCancellationReferenceSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CLIENT = "client" - SERVER = "server" - - - class azure.ai.projects.models.VoiceAgentFunctionTool(VoiceAgentTool, discriminator='function'): - description: Optional[str] + class azure.ai.projects.models.SkillDetails(_Model): + created_at: datetime + default_version: str + description: str + id: str + latest_version: str name: str - parameters: Optional[RealtimeFunctionToolParameters] - type: Literal["function"] @overload def __init__( self, *, - description: Optional[str] = ..., - name: str, - parameters: Optional[RealtimeFunctionToolParameters] = ... + created_at: datetime, + default_version: str, + description: str, + id: str, + latest_version: str, + name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentInterimResponseConfig(_Model): - latency_threshold_ms: Optional[int] - triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] - type: str + class azure.ai.projects.models.SkillInlineContent(_Model): + allowed_tools: Optional[list[str]] + compatibility: Optional[str] + description: str + instructions: str + license: Optional[str] + metadata: Optional[dict[str, str]] @overload def __init__( self, *, - latency_threshold_ms: Optional[int] = ..., - triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] = ..., - type: str + allowed_tools: Optional[list[str]] = ..., + compatibility: Optional[str] = ..., + description: str, + instructions: str, + license: Optional[str] = ..., + metadata: Optional[dict[str, str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentInterimResponseTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): - LATENCY = "latency" - TOOL = "tool" - - - class azure.ai.projects.models.VoiceAgentLlmInterimResponseConfig(VoiceAgentInterimResponseConfig, discriminator='llm_interim_response'): - instructions: Optional[str] - latency_threshold_ms: int - max_completion_tokens: Optional[int] - model: Optional[str] - triggers: Union[list[str, VoiceAgentInterimResponseTrigger]] - type: Literal["llm_interim_response"] + class azure.ai.projects.models.SkillReferenceParam(ContainerSkill, discriminator='skill_reference'): + skill_id: str + type: Literal[ContainerSkillType.SKILL_REFERENCE] + version: Optional[str] @overload def __init__( self, *, - instructions: Optional[str] = ..., - latency_threshold_ms: Optional[int] = ..., - max_completion_tokens: Optional[int] = ..., - model: Optional[str] = ..., - triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] = ... + skill_id: str, + version: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentMcpTool(VoiceAgentTool, discriminator='mcp'): - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] - allowed_tools: Optional[Union[list[str], MCPToolFilter]] - authorization: Optional[str] - defer_loading: Optional[bool] - headers: Optional[dict[str, str]] - project_connection_id: Optional[str] - require_approval: Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] - response_scheduling: Optional[Union[str, VoiceAgentToolResponseScheduling]] - server_description: Optional[str] - server_label: str - server_url: Optional[str] - tool_configs: Optional[dict[str, ToolConfig]] - type: Literal["mcp"] + class azure.ai.projects.models.SkillVersion(_Model): + created_at: datetime + description: str + id: str + name: str + skill_id: str + version: str @overload def __init__( self, *, - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., - allowed_tools: Optional[Union[list[str], MCPToolFilter]] = ..., - authorization: Optional[str] = ..., - defer_loading: Optional[bool] = ..., - headers: Optional[dict[str, str]] = ..., - project_connection_id: Optional[str] = ..., - require_approval: Optional[Union[MCPToolRequireApproval, Literal[always], Literal[never]]] = ..., - response_scheduling: Optional[Union[str, VoiceAgentToolResponseScheduling]] = ..., - server_description: Optional[str] = ..., - server_label: str, - server_url: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + created_at: datetime, + description: str, + id: str, + name: str, + skill_id: str, + version: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentRealtimeResponse(OmitPropertiesRealtimeResponse1): - audio: Optional[VoiceResponseAudio] - conversation_id: str - id: str - max_output_tokens: Union[int, str] - metadata: Metadata - object: str - output: Optional[list[VoiceAgentResponseItem]] - output_modalities: Union[list[str, str]] - status: Union[str, str, str, str, str] - status_details: RealtimeResponseStatusDetails - usage: RealtimeResponseUsage + class azure.ai.projects.models.SpecificApplyPatchParam(ToolChoiceParam, discriminator='apply_patch'): + type: Literal[ToolChoiceParamType.APPLY_PATCH] @overload - def __init__( - self, - *, - audio: Optional[VoiceResponseAudio] = ..., - conversation_id: Optional[str] = ..., - id: Optional[str] = ..., - max_output_tokens: Optional[Union[int, Literal[inf]]] = ..., - metadata: Optional[Metadata] = ..., - object: Optional[Literal[response]] = ..., - output: Optional[list[VoiceAgentResponseItem]] = ..., - output_modalities: Optional[list[Literal[text, audio]]] = ..., - status: Optional[Literal[completed, cancelled, failed, incomplete, in_progress]] = ..., - status_details: Optional[RealtimeResponseStatusDetails] = ..., - usage: Optional[RealtimeResponseUsage] = ... - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentResponseCreateParams(_Model): - audio: Optional[PickPropertiesVoiceAudioConfig] - conversation: Optional[Union[Literal["auto"], Literal["none"], str]] - input: Optional[list[RealtimeConversationItem]] - instructions: Optional[str] - interim_response: Optional[VoiceAgentInterimResponse] - max_output_tokens: Optional[Union[int, Literal["inf"]]] - metadata: Optional[Metadata] - output_modalities: Optional[list[Union[str, VoiceOutputModality]]] - parallel_tool_calls: Optional[bool] - pre_generated_assistant_message: Optional[RealtimeConversationItemMessageAssistant] - reasoning: Optional[RealtimeReasoning] - tool_choice: Optional[Union[str, ToolChoiceOptions, ToolChoiceFunction, ToolChoiceMCP]] - tools: Optional[list[Union[RealtimeFunctionTool, MCPTool]]] + class azure.ai.projects.models.SpecificFunctionShellParam(ToolChoiceParam, discriminator='shell'): + type: Literal[ToolChoiceParamType.SHELL] @overload - def __init__( - self, - *, - audio: Optional[PickPropertiesVoiceAudioConfig] = ..., - conversation: Optional[Union[Literal[auto], Literal[none], str]] = ..., - input: Optional[list[RealtimeConversationItem]] = ..., - instructions: Optional[str] = ..., - interim_response: Optional[VoiceAgentInterimResponse] = ..., - max_output_tokens: Optional[Union[int, Literal[inf]]] = ..., - metadata: Optional[Metadata] = ..., - output_modalities: Optional[list[Union[str, VoiceOutputModality]]] = ..., - parallel_tool_calls: Optional[bool] = ..., - pre_generated_assistant_message: Optional[RealtimeConversationItemMessageAssistant] = ..., - reasoning: Optional[RealtimeReasoning] = ..., - tool_choice: Optional[Union[str, ToolChoiceOptions, ToolChoiceFunction, ToolChoiceMCP]] = ..., - tools: Optional[list[Union[RealtimeFunctionTool, MCPTool]]] = ... - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentResponseEventContentPart(_Model): - audio: Optional[str] - format: Optional[VoiceAudioFormat] - text: Optional[str] - transcript: Optional[str] - type: Optional[Literal["audio", "text"]] + class azure.ai.projects.models.SpecificProgrammaticToolCallingParam(ToolChoiceParam, discriminator='programmatic_tool_calling'): + type: Literal[ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING] @overload - def __init__( - self, - *, - audio: Optional[str] = ..., - format: Optional[VoiceAudioFormat] = ..., - text: Optional[str] = ..., - transcript: Optional[str] = ..., - type: Optional[Literal[audio, text]] = ... - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentSemanticVadTurnDetection(VoiceTurnDetection, discriminator='semantic_vad'): - auto_truncate: bool - create_response: Optional[bool] - eagerness: Optional[Literal["low", "medium", "high", "auto"]] - interrupt_response: Optional[bool] - type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD] + class azure.ai.projects.models.StructuredInputDefinition(_Model): + default_value: Optional[Any] + description: Optional[str] + required: Optional[bool] + schema: Optional[dict[str, Any]] @overload def __init__( self, *, - auto_truncate: Optional[bool] = ..., - create_response: Optional[bool] = ..., - eagerness: Optional[Literal[low, medium, high, auto]] = ..., - interrupt_response: Optional[bool] = ... + default_value: Optional[Any] = ..., + description: Optional[str] = ..., + required: Optional[bool] = ..., + schema: Optional[dict[str, Any]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventConversationItemAdded(_Model): - event_id: str - item: VoiceAgentResponseItem - previous_item_id: Optional[str] - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED] + class azure.ai.projects.models.StructuredOutputDefinition(_Model): + description: str + name: str + schema: dict[str, Any] + strict: bool @overload def __init__( self, *, - event_id: str, - item: VoiceAgentResponseItem, - previous_item_id: Optional[str] = ..., - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED] + description: str, + name: str, + schema: dict[str, Any], + strict: bool ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventConversationItemCreated(_Model): - event_id: str - item: VoiceAgentResponseItem - previous_item_id: Optional[str] - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED] + class azure.ai.projects.models.TargetCompletionEvalRunDataSource(TypedDict, total=False): + key "input_messages": Required[InputMessagesItemReference] + key "source": Required[Union[SourceFileContent, SourceFileID]] + key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] + key "type": Required[Literal["azure_ai_target_completions"]] + + + class azure.ai.projects.models.TaxonomyCategory(_Model): + description: Optional[str] + id: str + name: str + properties: Optional[dict[str, str]] + risk_category: Union[str, RiskCategory] + sub_categories: list[TaxonomySubCategory] @overload def __init__( self, *, - event_id: str, - item: VoiceAgentResponseItem, - previous_item_id: Optional[str] = ..., - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED] + description: Optional[str] = ..., + id: str, + name: str, + properties: Optional[dict[str, str]] = ..., + risk_category: Union[str, RiskCategory], + sub_categories: list[TaxonomySubCategory] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventConversationItemDeleted(_Model): - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED] + class azure.ai.projects.models.TaxonomySubCategory(_Model): + description: Optional[str] + enabled: bool + id: str + name: str + properties: Optional[dict[str, str]] @overload def __init__( self, *, - event_id: str, - item_id: str, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED] + description: Optional[str] = ..., + enabled: bool, + id: str, + name: str, + properties: Optional[dict[str, str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventConversationItemDone(_Model): - event_id: str - item: VoiceAgentResponseItem - previous_item_id: Optional[str] - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE] + class azure.ai.projects.models.TelemetryConfig(_Model): + endpoints: list[TelemetryEndpoint] @overload def __init__( self, *, - event_id: str, - item: VoiceAgentResponseItem, - previous_item_id: Optional[str] = ..., - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE] + endpoints: list[TelemetryEndpoint] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted(_Model): - content_index: int - event_id: str - item_id: str - logprobs: Optional[list[LogProbProperties]] - phrases: Optional[list[VoiceAgentTranscriptionPhrase]] - transcript: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED] - usage: Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration] + class azure.ai.projects.models.TelemetryDataKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONTAINER_OTEL = "ContainerOtel" + CONTAINER_STDOUT_STDERR = "ContainerStdoutStderr" + METRICS = "Metrics" + + + class azure.ai.projects.models.TelemetryEndpoint(_Model): + auth: Optional[TelemetryEndpointAuth] + data: list[Union[str, TelemetryDataKind]] + kind: str @overload def __init__( self, *, - content_index: int, - event_id: str, - item_id: str, - logprobs: Optional[list[LogProbProperties]] = ..., - phrases: Optional[list[VoiceAgentTranscriptionPhrase]] = ..., - transcript: str, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED], - usage: Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration] + auth: Optional[TelemetryEndpointAuth] = ..., + data: list[Union[str, TelemetryDataKind]], + kind: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta(_Model): - content_index: Optional[int] - delta: Optional[str] - event_id: str - item_id: str - logprobs: Optional[list[LogProbProperties]] - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA] + class azure.ai.projects.models.TelemetryEndpointAuth(_Model): + type: str @overload def __init__( self, *, - content_index: Optional[int] = ..., - delta: Optional[str] = ..., - event_id: str, - item_id: str, - logprobs: Optional[list[LogProbProperties]] = ..., - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA] + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed(_Model): - content_index: int - error: RealtimeServerEventConversationItemInputAudioTranscriptionFailedError - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED] + class azure.ai.projects.models.TelemetryEndpointAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HEADER = "header" + + + class azure.ai.projects.models.TelemetryEndpointKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + OTLP = "OTLP" + + + class azure.ai.projects.models.TelemetryTransportProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + GRPC = "Grpc" + HTTP = "Http" + + + class azure.ai.projects.models.TestingCriterionAzureAIEvaluator(TypedDict, total=False): + key "data_mapping": Dict[str, str] + key "evaluator_name": Required[str] + key "evaluator_version": str + key "initialization_parameters": Dict[str, Any] + key "name": Required[str] + key "type": Required[Literal["azure_ai_evaluator"]] + + + class azure.ai.projects.models.TextResponseFormat(_Model): + type: str @overload def __init__( self, *, - content_index: int, - error: RealtimeServerEventConversationItemInputAudioTranscriptionFailedError, - event_id: str, - item_id: str, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED] + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment(_Model): - content_index: int - end: float - event_id: str - id: str - item_id: str - speaker: str - start: float - text: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT] + class azure.ai.projects.models.TextResponseFormatConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + JSON_OBJECT = "json_object" + JSON_SCHEMA = "json_schema" + TEXT = "text" + + + class azure.ai.projects.models.TextResponseFormatJsonObject(TextResponseFormat, discriminator='json_object'): + type: Literal[TextResponseFormatConfigurationType.JSON_OBJECT] @overload - def __init__( - self, - *, - content_index: int, - end: float, - event_id: str, - id: str, - item_id: str, - speaker: str, - start: float, - text: str, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT] - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventConversationItemRetrieved(_Model): - event_id: str - item: VoiceAgentResponseItem - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED] + class azure.ai.projects.models.TextResponseFormatJsonSchema(TextResponseFormat, discriminator='json_schema'): + description: Optional[str] + name: str + schema: dict[str, Any] + strict: Optional[bool] + type: Literal[TextResponseFormatConfigurationType.JSON_SCHEMA] @overload def __init__( self, *, - event_id: str, - item: VoiceAgentResponseItem, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED] + description: Optional[str] = ..., + name: str, + schema: dict[str, Any], + strict: Optional[bool] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventConversationItemTruncated(_Model): - audio_end_ms: int - content_index: int - event_id: str - item: Optional[RealtimeConversationItemMessageAssistant] - item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED] + class azure.ai.projects.models.TextResponseFormatText(TextResponseFormat, discriminator='text'): + type: Literal[TextResponseFormatConfigurationType.TEXT] @overload - def __init__( - self, - *, - audio_end_ms: int, - content_index: int, - event_id: str, - item: Optional[RealtimeConversationItemMessageAssistant] = ..., - item_id: str, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED] - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventInputAudioBufferCleared(_Model): - event_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED] + class azure.ai.projects.models.TimerRoutineTrigger(RoutineTrigger, discriminator='timer'): + at: Optional[datetime] + type: Literal[RoutineTriggerType.TIMER] @overload def __init__( self, *, - event_id: str, - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED] + at: Optional[datetime] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventInputAudioBufferCommitted(_Model): - event_id: str - item_id: str - previous_item_id: Optional[str] - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED] + class azure.ai.projects.models.Tool(_Model): + type: str @overload def __init__( self, *, - event_id: str, - item_id: str, - previous_item_id: Optional[str] = ..., - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED] + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventInputAudioBufferSpeechStarted(_Model): - audio_start_ms: int - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED] + class azure.ai.projects.models.ToolChoiceAllowed(ToolChoiceParam, discriminator='allowed_tools'): + mode: Literal["auto", "required"] + tools: list[dict[str, Any]] + type: Literal[ToolChoiceParamType.ALLOWED_TOOLS] @overload def __init__( self, *, - audio_start_ms: int, - event_id: str, - item_id: str, - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED] + mode: Literal["auto", "required"], + tools: list[dict[str, Any]] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventInputAudioBufferSpeechStopped(_Model): - audio_end_ms: int - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED] + class azure.ai.projects.models.ToolChoiceCodeInterpreter(ToolChoiceParam, discriminator='code_interpreter'): + type: Literal[ToolChoiceParamType.CODE_INTERPRETER] @overload - def __init__( - self, - *, - audio_end_ms: int, - event_id: str, - item_id: str, - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED] - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventInputAudioBufferTimeoutTriggered(_Model): - audio_end_ms: int - audio_start_ms: int - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED] + class azure.ai.projects.models.ToolChoiceComputer(ToolChoiceParam, discriminator='computer'): + type: Literal[ToolChoiceParamType.COMPUTER] @overload - def __init__( - self, - *, - audio_end_ms: int, - audio_start_ms: int, - event_id: str, - item_id: str, - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED] - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventMcpListToolsCompleted(_Model): - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED] + class azure.ai.projects.models.ToolChoiceComputerUse(ToolChoiceParam, discriminator='computer_use'): + type: Literal[ToolChoiceParamType.COMPUTER_USE] @overload - def __init__( - self, - *, - event_id: str, - item_id: str, - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED] - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventMcpListToolsFailed(_Model): - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED] + class azure.ai.projects.models.ToolChoiceComputerUsePreview(ToolChoiceParam, discriminator='computer_use_preview'): + type: Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW] @overload - def __init__( - self, - *, - event_id: str, - item_id: str, - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED] - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventMcpListToolsInProgress(_Model): - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS] + class azure.ai.projects.models.ToolChoiceCustom(ToolChoiceParam, discriminator='custom'): + name: str + type: Literal[ToolChoiceParamType.CUSTOM] @overload def __init__( self, *, - event_id: str, - item_id: str, - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS] + name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventOutputAudioBufferCleared(_Model): - event_id: str - response_id: str - type: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED] + class azure.ai.projects.models.ToolChoiceFileSearch(ToolChoiceParam, discriminator='file_search'): + type: Literal[ToolChoiceParamType.FILE_SEARCH] @overload - def __init__( - self, - *, - event_id: str, - response_id: str, - type: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED] - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventRateLimitsUpdated(_Model): - event_id: str - rate_limits: list[RealtimeServerEventRateLimitsUpdatedRateLimits] - type: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED] + class azure.ai.projects.models.ToolChoiceFunction(ToolChoiceParam, discriminator='function'): + name: str + type: Literal[ToolChoiceParamType.FUNCTION] @overload def __init__( self, *, - event_id: str, - rate_limits: list[RealtimeServerEventRateLimitsUpdatedRateLimits], - type: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED] + name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventResponseAnimationBlendshapesDelta(_Model): - content_index: int - event_id: str - frame_index: int - frames: list[list[float]] - item_id: str - output_index: int - response_id: str - type: Literal["delta"] + class azure.ai.projects.models.ToolChoiceImageGeneration(ToolChoiceParam, discriminator='image_generation'): + type: Literal[ToolChoiceParamType.IMAGE_GENERATION] @overload - def __init__( - self, - *, - content_index: int, - event_id: str, - frame_index: int, - frames: list[list[float]], - item_id: str, - output_index: int, - response_id: str - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventResponseAnimationBlendshapesDone(_Model): - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal["done"] + class azure.ai.projects.models.ToolChoiceMCP(ToolChoiceParam, discriminator='mcp'): + name: Optional[str] + server_label: str + type: Literal[ToolChoiceParamType.MCP] @overload def __init__( self, *, - event_id: str, - item_id: str, - output_index: int, - response_id: str + name: Optional[str] = ..., + server_label: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventResponseAnimationVisemeDelta(_Model): - audio_offset_ms: int - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal["delta"] - viseme_id: int + class azure.ai.projects.models.ToolChoiceOptions(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "auto" + NONE = "none" + REQUIRED = "required" + + + class azure.ai.projects.models.ToolChoiceParam(_Model): + type: str @overload def __init__( self, *, - audio_offset_ms: int, - content_index: int, - event_id: str, - item_id: str, - output_index: int, - response_id: str, - viseme_id: int + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventResponseAnimationVisemeDone(_Model): - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal["done"] + class azure.ai.projects.models.ToolChoiceParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ALLOWED_TOOLS = "allowed_tools" + APPLY_PATCH = "apply_patch" + CODE_INTERPRETER = "code_interpreter" + COMPUTER = "computer" + COMPUTER_USE = "computer_use" + COMPUTER_USE_PREVIEW = "computer_use_preview" + CUSTOM = "custom" + FILE_SEARCH = "file_search" + FUNCTION = "function" + IMAGE_GENERATION = "image_generation" + MCP = "mcp" + PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" + SHELL = "shell" + WEB_SEARCH_PREVIEW = "web_search_preview" + WEB_SEARCH_PREVIEW_2025_03_11 = "web_search_preview_2025_03_11" + + + class azure.ai.projects.models.ToolChoiceWebSearchPreview(ToolChoiceParam, discriminator='web_search_preview'): + type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW] @overload - def __init__( - self, - *, - content_index: int, - event_id: str, - item_id: str, - output_index: int, - response_id: str - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventResponseAudioDelta(_Model): - content_index: int - delta: bytes - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA] + 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, - *, - content_index: int, - delta: bytes, - event_id: str, - item_id: str, - output_index: int, - response_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA] - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventResponseAudioDone(_Model): - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE] + class azure.ai.projects.models.ToolConfig(_Model): + additional_search_text: Optional[str] + pin: Optional[bool] @overload def __init__( self, *, - content_index: int, - event_id: str, - item_id: str, - output_index: int, - response_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE] + additional_search_text: Optional[str] = ..., + pin: Optional[bool] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventResponseAudioTimestampDelta(_Model): - audio_duration_ms: int - audio_offset_ms: int - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - text: str - timestamp_type: Literal["word"] - type: Literal["delta"] + class azure.ai.projects.models.ToolDescription(_Model): + description: Optional[str] + name: Optional[str] @overload def __init__( self, *, - audio_duration_ms: int, - audio_offset_ms: int, - content_index: int, - event_id: str, - item_id: str, - output_index: int, - response_id: str, - text: str + description: Optional[str] = ..., + name: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventResponseAudioTimestampDone(_Model): - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal["done"] + class azure.ai.projects.models.ToolDescriptionParam(TypedDict, total=False): + key "description": str + key "name": str + + + class azure.ai.projects.models.ToolProjectConnection(_Model): + project_connection_id: str @overload def __init__( self, *, - content_index: int, - event_id: str, - item_id: str, - output_index: int, - response_id: str + project_connection_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventResponseAudioTranscriptDelta(_Model): - content_index: int - delta: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA] + class azure.ai.projects.models.ToolSearchExecutionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CLIENT = "client" + 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] @overload def __init__( self, *, - content_index: int, - delta: str, - event_id: str, - item_id: str, - output_index: int, - response_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA] + description: Optional[str] = ..., + execution: Optional[Union[str, ToolSearchExecutionType]] = ..., + parameters: Optional[EmptyModelParam] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventResponseAudioTranscriptDone(_Model): - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - transcript: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE] + 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, *, - content_index: int, - event_id: str, - item_id: str, - output_index: int, - response_id: str, - transcript: str, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE] + 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.VoiceAgentServerEventResponseContentPartDone(_Model): - content_index: int - event_id: str - item_id: str - output_index: int - part: VoiceAgentResponseEventContentPart - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE] + class azure.ai.projects.models.ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + A2A_PREVIEW = "a2a_preview" + A2_A = "a2a" + APPLY_PATCH = "apply_patch" + AZURE_AI_SEARCH = "azure_ai_search" + AZURE_FUNCTION = "azure_function" + BING_CUSTOM_SEARCH_PREVIEW = "bing_custom_search_preview" + BING_GROUNDING = "bing_grounding" + BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" + CAPTURE_STRUCTURED_OUTPUTS = "capture_structured_outputs" + CODE_INTERPRETER = "code_interpreter" + COMPUTER = "computer" + COMPUTER_USE_PREVIEW = "computer_use_preview" + CUSTOM = "custom" + FABRIC_DATAAGENT_PREVIEW = "fabric_dataagent_preview" + FABRIC_IQ_PREVIEW = "fabric_iq_preview" + FILE_SEARCH = "file_search" + FUNCTION = "function" + IMAGE_GENERATION = "image_generation" + LOCAL_SHELL = "local_shell" + MCP = "mcp" + MEMORY_SEARCH_PREVIEW = "memory_search_preview" + NAMESPACE = "namespace" + OPENAPI = "openapi" + PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" + SHAREPOINT_GROUNDING_PREVIEW = "sharepoint_grounding_preview" + SHELL = "shell" + TOOLBOX_SEARCH_PREVIEW = "toolbox_search_preview" + TOOL_SEARCH = "tool_search" + WEB_IQ_PREVIEW = "web_iq_preview" + WEB_SEARCH = "web_search" + WEB_SEARCH_PREVIEW = "web_search_preview" + WORK_IQ_PREVIEW = "work_iq_preview" + + + class azure.ai.projects.models.ToolUseFineTuningDataGenerationJobOptions(DataGenerationJobOptions, discriminator='tool_use'): + max_samples: int + model_options: DataGenerationModelOptions + train_split: float + type: Literal[DataGenerationJobType.TOOL_USE] @overload def __init__( self, *, - content_index: int, - event_id: str, - item_id: str, - output_index: int, - part: VoiceAgentResponseEventContentPart, - response_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE] + max_samples: int, + model_options: Optional[DataGenerationModelOptions] = ..., + train_split: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventResponseCreated(_Model): - event_id: str - response: VoiceAgentRealtimeResponse - type: Literal[RealtimeServerEventType.RESPONSE_CREATED] + class azure.ai.projects.models.ToolboxObject(_Model): + default_version: str + id: str + name: str @overload def __init__( self, *, - event_id: str, - response: VoiceAgentRealtimeResponse, - type: Literal[RealtimeServerEventType.RESPONSE_CREATED] + default_version: str, + id: str, + name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventResponseDone(_Model): - event_id: str - response: VoiceAgentRealtimeResponse - type: Literal[RealtimeServerEventType.RESPONSE_DONE] + class azure.ai.projects.models.ToolboxPolicies(_Model): + rai_config: Optional[RaiConfig] @overload def __init__( self, *, - event_id: str, - response: VoiceAgentRealtimeResponse, - type: Literal[RealtimeServerEventType.RESPONSE_DONE] + rai_config: Optional[RaiConfig] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventResponseFunctionCallArgumentsDelta(_Model): - call_id: str - delta: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA] + class azure.ai.projects.models.ToolboxSearchPreviewToolboxTool(ToolboxTool, discriminator='toolbox_search_preview'): + description: str + name: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW] @overload def __init__( self, *, - call_id: str, - delta: str, - event_id: str, - item_id: str, - output_index: int, - response_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA] + 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.VoiceAgentServerEventResponseFunctionCallArgumentsDone(_Model): - arguments: str - call_id: str - event_id: str - item_id: str - name: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE] + class azure.ai.projects.models.ToolboxShellContainerAutoEnvironment(ToolboxShellEnvironment, discriminator='container_auto'): + file_ids: Optional[list[str]] + memory_limit: Optional[Union[str, ContainerMemoryLimit]] + network_policy: Optional[ToolboxShellNetworkPolicy] + skills: Optional[list[ContainerSkill]] + type: Literal["container_auto"] @overload def __init__( self, *, - arguments: str, - call_id: str, - event_id: str, - item_id: str, - name: str, - output_index: int, - response_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE] + file_ids: Optional[list[str]] = ..., + memory_limit: Optional[Union[str, ContainerMemoryLimit]] = ..., + network_policy: Optional[ToolboxShellNetworkPolicy] = ..., + skills: Optional[list[ContainerSkill]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventResponseMcpCallArgumentsDelta(_Model): - delta: str - event_id: str - item_id: str - obfuscation: Optional[str] - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA] + class azure.ai.projects.models.ToolboxShellContainerReferenceEnvironment(ToolboxShellEnvironment, discriminator='container_reference'): + container_id: str + type: Literal["container_reference"] @overload def __init__( self, *, - delta: str, - event_id: str, - item_id: str, - obfuscation: Optional[str] = ..., - output_index: int, - response_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA] + container_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventResponseMcpCallArgumentsDone(_Model): - arguments: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE] + class azure.ai.projects.models.ToolboxShellEnvironment(_Model): + type: str @overload def __init__( self, *, - arguments: str, - event_id: str, - item_id: str, - output_index: int, - response_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE] + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventResponseMcpCallCompleted(_Model): - event_id: str - item_id: str - output_index: int - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED] + class azure.ai.projects.models.ToolboxShellNetworkPolicy(_Model): + type: str @overload def __init__( self, *, - event_id: str, - item_id: str, - output_index: int, - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED] + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventResponseMcpCallFailed(_Model): - event_id: str - item_id: str - output_index: int - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED] + class azure.ai.projects.models.ToolboxShellNetworkPolicyDisabled(ToolboxShellNetworkPolicy, discriminator='disabled'): + type: Literal["disabled"] @overload - def __init__( - self, - *, - event_id: str, - item_id: str, - output_index: int, - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED] - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventResponseMcpCallInProgress(_Model): - event_id: str - item_id: str - output_index: int - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS] + class azure.ai.projects.models.ToolboxSkill(_Model): + type: str @overload def __init__( self, *, - event_id: str, - item_id: str, - output_index: int, - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS] + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventResponseOutputItemAdded(_Model): - event_id: str - item: VoiceAgentResponseItem - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED] + class azure.ai.projects.models.ToolboxSkillReference(ToolboxSkill, discriminator='skill_reference'): + name: str + type: Literal["skill_reference"] + version: Optional[str] @overload def __init__( self, *, - event_id: str, - item: VoiceAgentResponseItem, - output_index: int, - response_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED] + name: str, + version: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventResponseOutputItemDone(_Model): - event_id: str - item: VoiceAgentResponseItem - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE] + class azure.ai.projects.models.ToolboxTool(_Model): + description: Optional[str] + name: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] + type: str @overload def __init__( self, *, - event_id: str, - item: VoiceAgentResponseItem, - output_index: int, - response_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE] + description: Optional[str] = ..., + name: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ..., + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventResponseTextDelta(_Model): - content_index: int - delta: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA] + class azure.ai.projects.models.ToolboxToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + A2A_PREVIEW = "a2a_preview" + A2_A = "a2a" + AZURE_AI_SEARCH = "azure_ai_search" + BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" + CODE_INTERPRETER = "code_interpreter" + FABRIC_IQ_PREVIEW = "fabric_iq_preview" + FILE_SEARCH = "file_search" + MCP = "mcp" + OPENAPI = "openapi" + REMINDER_PREVIEW = "reminder_preview" + SHELL = "shell" + TOOLBOX_SEARCH = "toolbox_search" + TOOLBOX_SEARCH_PREVIEW = "toolbox_search_preview" + WEB_IQ_PREVIEW = "web_iq_preview" + WEB_SEARCH = "web_search" + WORK_IQ_PREVIEW = "work_iq_preview" + + + class azure.ai.projects.models.ToolboxVersionObject(_Model): + created_at: datetime + description: Optional[str] + id: str + metadata: dict[str, str] + name: str + policies: Optional[ToolboxPolicies] + skills: Optional[list[ToolboxSkill]] + tools: list[ToolboxTool] + version: str @overload def __init__( self, *, - content_index: int, - delta: str, - event_id: str, - item_id: str, - output_index: int, - response_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA] + created_at: datetime, + description: Optional[str] = ..., + id: str, + metadata: dict[str, str], + name: str, + policies: Optional[ToolboxPolicies] = ..., + skills: Optional[list[ToolboxSkill]] = ..., + tools: list[ToolboxTool], + version: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventResponseTextDone(_Model): - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - text: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE] + class azure.ai.projects.models.TracesDataGenerationJobOptions(DataGenerationJobOptions, discriminator='traces'): + max_samples: int + model_options: DataGenerationModelOptions + redact_private_content: Optional[bool] + train_split: float + type: Literal[DataGenerationJobType.TRACES] @overload def __init__( self, *, - content_index: int, - event_id: str, - item_id: str, - output_index: int, - response_id: str, - text: str, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE] + max_samples: int, + model_options: Optional[DataGenerationModelOptions] = ..., + redact_private_content: Optional[bool] = ..., + train_split: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventResponseVideoDelta(_Model): - codec: str - delta: str - event_id: str - output_index: int - type: Literal["delta"] + class azure.ai.projects.models.TracesDataGenerationJobSource(DataGenerationJobSource, discriminator='traces'): + agent_id: Optional[str] + agent_name: Optional[str] + agent_version: Optional[str] + description: str + end_time: Optional[datetime] + start_time: datetime + type: Literal[DataGenerationJobSourceType.TRACES] @overload def __init__( self, *, - codec: str, - delta: str, - event_id: str, - output_index: int + agent_id: Optional[str] = ..., + agent_name: Optional[str] = ..., + agent_version: Optional[str] = ..., + description: Optional[str] = ..., + end_time: Optional[datetime] = ..., + start_time: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventSessionAvatarConnecting(_Model): - event_id: str - server_sdp: str - type: Literal["connecting"] + class azure.ai.projects.models.TracesEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator='traces'): + agent_id: Optional[str] + agent_name: Optional[str] + agent_version: Optional[str] + description: Optional[str] + end_time: Optional[datetime] + start_time: datetime + type: Literal[EvaluatorGenerationJobSourceType.TRACES] @overload def __init__( self, *, - event_id: str, - server_sdp: str + agent_id: Optional[str] = ..., + agent_name: Optional[str] = ..., + agent_version: Optional[str] = ..., + description: Optional[str] = ..., + end_time: Optional[datetime] = ..., + start_time: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventSessionAvatarSwitchToIdle(_Model): - event_id: str - turn_id: Optional[str] - type: Literal["switch_to_idle"] + class azure.ai.projects.models.TracesPreviewEvalRunDataSource(TypedDict, total=False): + key "agent_id": str + key "agent_name": str + key "end_time": datetime + key "ingestion_delay_seconds": int + key "lookback_hours": int + key "max_traces": int + key "trace_ids": List[str] + key "type": Required[Literal["azure_ai_traces_preview"]] + + + class azure.ai.projects.models.TranscriptTextUsageDuration(CreateTranscriptionResponseJsonUsage, discriminator='duration'): + seconds: timedelta + type: Literal[CreateTranscriptionResponseJsonUsageType.DURATION] @overload def __init__( self, *, - event_id: str, - turn_id: Optional[str] = ... + seconds: timedelta ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventSessionAvatarSwitchToSpeaking(_Model): - event_id: str - turn_id: Optional[str] - type: Literal["switch_to_speaking"] + class azure.ai.projects.models.TranscriptTextUsageTokens(CreateTranscriptionResponseJsonUsage, discriminator='tokens'): + input_token_details: Optional[TranscriptTextUsageTokensInputTokenDetails] + input_tokens: int + output_tokens: int + total_tokens: int + type: Literal[CreateTranscriptionResponseJsonUsageType.TOKENS] @overload def __init__( self, *, - event_id: str, - turn_id: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.VoiceAgentServerEventSessionCreated(_Model): - conversation_id: Optional[str] - event_id: str - session: VoiceAgentSessionResponseConfig - type: Literal[RealtimeServerEventType.SESSION_CREATED] - - @overload - def __init__( - self, - *, - conversation_id: Optional[str] = ..., - event_id: str, - session: VoiceAgentSessionResponseConfig, - type: Literal[RealtimeServerEventType.SESSION_CREATED] + input_token_details: Optional[TranscriptTextUsageTokensInputTokenDetails] = ..., + input_tokens: int, + output_tokens: int, + total_tokens: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventSessionUpdated(_Model): - event_id: str - session: VoiceAgentSessionResponseConfig - type: Literal[RealtimeServerEventType.SESSION_UPDATED] + class azure.ai.projects.models.TranscriptTextUsageTokensInputTokenDetails(_Model): + audio_tokens: Optional[int] + text_tokens: Optional[int] @overload def __init__( self, *, - event_id: str, - session: VoiceAgentSessionResponseConfig, - type: Literal[RealtimeServerEventType.SESSION_UPDATED] + audio_tokens: Optional[int] = ..., + text_tokens: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventWarning(_Model): - event_id: str - type: Literal["warning"] - warning: VoiceAgentServerEventWarningDetails - - @overload - def __init__( - self, - *, - event_id: str, - warning: VoiceAgentServerEventWarningDetails - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.TreatmentEffectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CHANGED = "Changed" + DEGRADED = "Degraded" + IMPROVED = "Improved" + INCONCLUSIVE = "Inconclusive" + TOO_FEW_SAMPLES = "TooFewSamples" - class azure.ai.projects.models.VoiceAgentServerEventWarningDetails(_Model): - code: Optional[str] - message: str - param: Optional[str] + class azure.ai.projects.models.Trigger(_Model): + type: str @overload def __init__( self, *, - code: Optional[str] = ..., - message: str, - param: Optional[str] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentSessionAvatarConfig(VoiceAvatarConfig): - character: str - customized: bool - ice_servers: Optional[list[VoiceAgentAvatarIceServer]] - model: str - output_audit_audio: bool - output_protocol: Union[str, VoiceAvatarOutputProtocol] - scene: VoiceAgentAvatarScene - style: str - type: Union[str, VoiceAvatarType] - video: VoiceAgentAvatarVideoParams - - @overload - def __init__( - self, - *, - character: str, - customized: Optional[bool] = ..., - ice_servers: Optional[list[VoiceAgentAvatarIceServer]] = ..., - model: Optional[str] = ..., - output_audit_audio: Optional[bool] = ..., - output_protocol: Optional[Union[str, VoiceAvatarOutputProtocol]] = ..., - scene: Optional[VoiceAgentAvatarScene] = ..., - style: Optional[str] = ..., - type: Union[str, VoiceAvatarType], - video: Optional[VoiceAgentAvatarVideoParams] = ... - ) -> None: ... + class azure.ai.projects.models.TriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CRON = "Cron" + ONE_TIME = "OneTime" + RECURRENCE = "Recurrence" - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.UpdateMemoriesLROPoller(LROPoller[MemoryStoreUpdateCompletedResult]): + property superseded_by: Optional[str] # Read-only + property update_id: str # Read-only - class azure.ai.projects.models.VoiceAgentSessionIncludeOption(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FILE_SEARCH_CALL_RESULTS = "file_search_call.results" - INPUT_AUDIO_TRANSCRIPTION_LOGPROBS = "item.input_audio_transcription.logprobs" - INPUT_AUDIO_TRANSCRIPTION_PHRASES = "item.input_audio_transcription.phrases" + @classmethod + def from_continuation_token( + cls, + polling_method: PollingMethod[MemoryStoreUpdateCompletedResult], + continuation_token: str, + **kwargs: Any + ) -> UpdateMemoriesLROPoller: ... - class azure.ai.projects.models.VoiceAgentSessionResponseConfig(_Model): - animation: Optional[VoiceAgentAnimationConfig] - audio: Optional[VoiceAudioConfig] - avatar: Optional[VoiceAgentSessionAvatarConfig] - expires_at: Optional[datetime] - greeting: Optional[VoiceGreetingConfig] - id: str - include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] - instructions: Optional[str] - interim_response: Optional[VoiceAgentInterimResponse] - max_output_tokens: Optional[VoiceAgentMaxOutputTokens] - metadata: Optional[dict[str, str]] - model: str - object: Literal["session"] - output_modalities: Optional[list[Union[str, VoiceOutputModality]]] - parallel_tool_calls: Optional[bool] - reasoning: Optional[RealtimeReasoning] - temperature: Optional[float] - tool_choice: Optional[VoiceAgentToolChoice] - tools: Optional[list[VoiceAgentTool]] - type: Literal["realtime"] + class azure.ai.projects.models.UpdateModelVersionRequest(_Model): + description: Optional[str] + tags: Optional[dict[str, str]] @overload def __init__( self, *, - animation: Optional[VoiceAgentAnimationConfig] = ..., - audio: Optional[VoiceAudioConfig] = ..., - avatar: Optional[VoiceAgentSessionAvatarConfig] = ..., - expires_at: Optional[datetime] = ..., - greeting: Optional[VoiceGreetingConfig] = ..., - id: str, - include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] = ..., - instructions: Optional[str] = ..., - interim_response: Optional[VoiceAgentInterimResponse] = ..., - max_output_tokens: Optional[VoiceAgentMaxOutputTokens] = ..., - metadata: Optional[dict[str, str]] = ..., - model: str, - output_modalities: Optional[list[Union[str, VoiceOutputModality]]] = ..., - parallel_tool_calls: Optional[bool] = ..., - reasoning: Optional[RealtimeReasoning] = ..., - temperature: Optional[float] = ..., - tool_choice: Optional[VoiceAgentToolChoice] = ..., - tools: Optional[list[VoiceAgentTool]] = ... + description: Optional[str] = ..., + tags: Optional[dict[str, str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentSessionUpdateConfig(_Model): - animation: Optional[VoiceAgentAnimationConfig] - audio: Optional[VoiceAudioConfig] - avatar: Optional[VoiceAgentSessionAvatarConfig] - greeting: Optional[VoiceGreetingConfig] - include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] - instructions: Optional[str] - interim_response: Optional[VoiceAgentInterimResponse] - max_output_tokens: Optional[VoiceAgentMaxOutputTokens] - metadata: Optional[dict[str, str]] - output_modalities: Optional[list[Union[str, VoiceOutputModality]]] - parallel_tool_calls: Optional[bool] - reasoning: Optional[RealtimeReasoning] - temperature: Optional[float] - tool_choice: Optional[VoiceAgentToolChoice] - tools: Optional[list[VoiceAgentTool]] - type: Literal["realtime"] + class azure.ai.projects.models.UpdateToolboxRequest(_Model): + default_version: str @overload def __init__( self, *, - animation: Optional[VoiceAgentAnimationConfig] = ..., - audio: Optional[VoiceAudioConfig] = ..., - avatar: Optional[VoiceAgentSessionAvatarConfig] = ..., - greeting: Optional[VoiceGreetingConfig] = ..., - include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] = ..., - instructions: Optional[str] = ..., - interim_response: Optional[VoiceAgentInterimResponse] = ..., - max_output_tokens: Optional[VoiceAgentMaxOutputTokens] = ..., - metadata: Optional[dict[str, str]] = ..., - output_modalities: Optional[list[Union[str, VoiceOutputModality]]] = ..., - parallel_tool_calls: Optional[bool] = ..., - reasoning: Optional[RealtimeReasoning] = ..., - temperature: Optional[float] = ..., - tool_choice: Optional[VoiceAgentToolChoice] = ..., - tools: Optional[list[VoiceAgentTool]] = ... + default_version: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentStaticInterimResponseConfig(VoiceAgentInterimResponseConfig, discriminator='static_interim_response'): - latency_threshold_ms: int - texts: Optional[list[str]] - triggers: Union[list[str, VoiceAgentInterimResponseTrigger]] - type: Literal["static_interim_response"] + class azure.ai.projects.models.UserProfileMemoryItem(MemoryItem, discriminator='user_profile'): + content: str + kind: Literal[MemoryItemKind.USER_PROFILE] + memory_id: str + scope: str + updated_at: datetime @overload def __init__( self, *, - latency_threshold_ms: Optional[int] = ..., - texts: Optional[list[str]] = ..., - triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] = ... + content: str, + memory_id: str, + scope: str, + updated_at: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentTool(_Model): + class azure.ai.projects.models.VersionIndicator(_Model): type: str @overload @@ -12819,161 +12264,124 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentToolResponseScheduling(str, Enum, metaclass=CaseInsensitiveEnumMeta): - INTERRUPT = "interrupt" - SILENT = "silent" - SKIP_IF_BUSY = "skip_if_busy" - WHEN_IDLE = "when_idle" + class azure.ai.projects.models.VersionIndicatorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + VERSION_REF = "version_ref" - class azure.ai.projects.models.VoiceAgentTranscriptionPhrase(_Model): - confidence: Optional[float] - duration_milliseconds: int - locale: Optional[str] - offset_milliseconds: int - text: str - words: Optional[list[VoiceAgentTranscriptionWord]] + class azure.ai.projects.models.VersionRefIndicator(VersionIndicator, discriminator='version_ref'): + agent_version: str + type: Literal[VersionIndicatorType.VERSION_REF] @overload def __init__( self, *, - confidence: Optional[float] = ..., - duration_milliseconds: int, - locale: Optional[str] = ..., - offset_milliseconds: int, - text: str, - words: Optional[list[VoiceAgentTranscriptionWord]] = ... + agent_version: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentTranscriptionWord(_Model): - duration_milliseconds: int - offset_milliseconds: int - text: str + class azure.ai.projects.models.VersionSelectionRule(_Model): + agent_version: str + type: str @overload def __init__( self, *, - duration_milliseconds: int, - offset_milliseconds: int, - text: str + agent_version: str, + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentWebSocketSubprotocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - REALTIME = "realtime" - - - class azure.ai.projects.models.VoiceAssistantMessageItem(VoiceMessageItem, discriminator='assistant'): - content: list[RealtimeConversationItemMessageAssistantContent] - created_at: datetime - id: Optional[str] - object: Optional[Literal["item"]] - response_id: str - role: Literal[RealtimeConversationItemMessageType.ASSISTANT] - status: Optional[Literal["completed", "incomplete", "in_progress"]] - type: Union[str, azure.ai.projects.models.MESSAGE] + class azure.ai.projects.models.VersionSelector(_Model): + version_selection_rules: list[VersionSelectionRule] @overload def __init__( self, *, - content: list[RealtimeConversationItemMessageAssistantContent], - created_at: Optional[datetime] = ..., - id: Optional[str] = ..., - object: Optional[Literal[item]] = ..., - response_id: Optional[str] = ..., - status: Optional[Literal[completed, incomplete, in_progress]] = ... + version_selection_rules: list[VersionSelectionRule] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAudioCodec(str, Enum, metaclass=CaseInsensitiveEnumMeta): - PCM16 = "pcm16" - PCMA = "pcma" - PCMU = "pcmu" + class azure.ai.projects.models.VersionSelectorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FIXED_RATIO = "FixedRatio" - class azure.ai.projects.models.VoiceAudioConfig(_Model): - input: Optional[VoiceAudioInputConfig] - output: Optional[VoiceAudioOutputConfig] + class azure.ai.projects.models.VoiceAgentAnimationConfig(_Model): + model_name: Optional[str] + outputs: Optional[list[Union[str, VoiceAgentAnimationOutputType]]] @overload def __init__( self, *, - input: Optional[VoiceAudioInputConfig] = ..., - output: Optional[VoiceAudioOutputConfig] = ... + model_name: Optional[str] = ..., + outputs: Optional[list[Union[str, VoiceAgentAnimationOutputType]]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAudioContainerFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): - WAV = "wav" + class azure.ai.projects.models.VoiceAgentAnimationOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BLENDSHAPES = "blendshapes" + VISEME_ID = "viseme_id" - class azure.ai.projects.models.VoiceAudioFormat(_Model): - rate: Optional[int] - type: Union[str, VoiceAudioFormatType] + class azure.ai.projects.models.VoiceAgentAudioConfig(_Model): + input: Optional[VoiceAgentAudioInputConfig] + output: Optional[VoiceAgentAudioOutputConfig] @overload def __init__( self, *, - rate: Optional[int] = ..., - type: Union[str, VoiceAudioFormatType] + input: Optional[VoiceAgentAudioInputConfig] = ..., + output: Optional[VoiceAgentAudioOutputConfig] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAudioFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - PCM = "audio/pcm" - PCMA = "audio/pcma" - PCMU = "audio/pcmu" - - - class azure.ai.projects.models.VoiceAudioInputConfig(_Model): + class azure.ai.projects.models.VoiceAgentAudioInputConfig(_Model): echo_cancellation: Optional[VoiceAgentEchoCancellation] - format: Optional[VoiceAudioFormat] - noise_reduction: Optional[VoiceNoiseReduction] - transcription: Optional[VoiceInputTranscription] - turn_detection: Optional[VoiceAgentTurnDetection] + format: Optional[RealtimeAudioFormats] + noise_reduction: Optional[VoiceAgentNoiseReduction] + transcription: Optional[VoiceAgentInputTranscription] + turn_detection: Optional[VoiceAgentTurnDetectionConfig] @overload def __init__( self, *, echo_cancellation: Optional[VoiceAgentEchoCancellation] = ..., - format: Optional[VoiceAudioFormat] = ..., - noise_reduction: Optional[VoiceNoiseReduction] = ..., - transcription: Optional[VoiceInputTranscription] = ..., - turn_detection: Optional[VoiceAgentTurnDetection] = ... + format: Optional[RealtimeAudioFormats] = ..., + noise_reduction: Optional[VoiceAgentNoiseReduction] = ..., + transcription: Optional[VoiceAgentInputTranscription] = ..., + turn_detection: Optional[VoiceAgentTurnDetectionConfig] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAudioOutputConfig(_Model): + class azure.ai.projects.models.VoiceAgentAudioOutputConfig(_Model): custom_lexicon_url: Optional[str] custom_text_normalization_url: Optional[str] custom_voice_endpoint_id: Optional[str] - format: Optional[VoiceAudioFormat] - output_audio_timestamp_types: Optional[list[Union[str, VoiceAudioTimestampType]]] + format: Optional[RealtimeAudioFormats] + output_audio_timestamp_types: Optional[list[Union[str, VoiceAgentAudioTimestampType]]] personal_voice_model: Optional[str] pitch: Optional[str] prefer_locales: Optional[list[str]] @@ -12982,7 +12390,7 @@ namespace azure.ai.projects.models voice: Optional[str] voice_locale: Optional[str] voice_temperature: Optional[float] - voice_type: Optional[str] + voice_type: Optional[Union[str, VoiceType]] volume: Optional[str] @overload @@ -12992,8 +12400,8 @@ namespace azure.ai.projects.models custom_lexicon_url: Optional[str] = ..., custom_text_normalization_url: Optional[str] = ..., custom_voice_endpoint_id: Optional[str] = ..., - format: Optional[VoiceAudioFormat] = ..., - output_audio_timestamp_types: Optional[list[Union[str, VoiceAudioTimestampType]]] = ..., + format: Optional[RealtimeAudioFormats] = ..., + output_audio_timestamp_types: Optional[list[Union[str, VoiceAgentAudioTimestampType]]] = ..., personal_voice_model: Optional[str] = ..., pitch: Optional[str] = ..., prefer_locales: Optional[list[str]] = ..., @@ -13002,7 +12410,7 @@ namespace azure.ai.projects.models voice: Optional[str] = ..., voice_locale: Optional[str] = ..., voice_temperature: Optional[float] = ..., - voice_type: Optional[str] = ..., + voice_type: Optional[Union[str, VoiceType]] = ..., volume: Optional[str] = ... ) -> None: ... @@ -13010,24 +12418,19 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAudioRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENT = "agent" - USER = "user" - - - class azure.ai.projects.models.VoiceAudioTimestampType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + class azure.ai.projects.models.VoiceAgentAudioTimestampType(str, Enum, metaclass=CaseInsensitiveEnumMeta): WORD = "word" - class azure.ai.projects.models.VoiceAvatarConfig(_Model): + class azure.ai.projects.models.VoiceAgentAvatarConfig(_Model): character: str customized: Optional[bool] model: Optional[str] output_audit_audio: Optional[bool] - output_protocol: Optional[Union[str, VoiceAvatarOutputProtocol]] + output_protocol: Optional[Union[str, VoiceAgentAvatarOutputProtocol]] scene: Optional[VoiceAgentAvatarScene] style: Optional[str] - type: Union[str, VoiceAvatarType] + type: Union[str, VoiceAgentAvatarType] video: Optional[VoiceAgentAvatarVideoParams] @overload @@ -13038,10 +12441,10 @@ namespace azure.ai.projects.models customized: Optional[bool] = ..., model: Optional[str] = ..., output_audit_audio: Optional[bool] = ..., - output_protocol: Optional[Union[str, VoiceAvatarOutputProtocol]] = ..., + output_protocol: Optional[Union[str, VoiceAgentAvatarOutputProtocol]] = ..., scene: Optional[VoiceAgentAvatarScene] = ..., style: Optional[str] = ..., - type: Union[str, VoiceAvatarType], + type: Union[str, VoiceAgentAvatarType], video: Optional[VoiceAgentAvatarVideoParams] = ... ) -> None: ... @@ -13049,21 +12452,135 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAvatarOutputProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + class azure.ai.projects.models.VoiceAgentAvatarIceServer(_Model): + credential: Optional[str] + urls: list[str] + username: Optional[str] + + @overload + def __init__( + self, + *, + credential: Optional[str] = ..., + urls: list[str], + username: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentAvatarOutputProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): WEBRTC = "webrtc" WEBSOCKET = "websocket" WEBSOCKET_BINARY = "websocket-binary" - class azure.ai.projects.models.VoiceAvatarType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + class azure.ai.projects.models.VoiceAgentAvatarScene(_Model): + amplitude: Optional[float] + position_x: Optional[float] + position_y: Optional[float] + rotation_x: Optional[float] + rotation_y: Optional[float] + rotation_z: Optional[float] + zoom: Optional[float] + + @overload + def __init__( + self, + *, + amplitude: Optional[float] = ..., + position_x: Optional[float] = ..., + position_y: Optional[float] = ..., + rotation_x: Optional[float] = ..., + rotation_y: Optional[float] = ..., + rotation_z: Optional[float] = ..., + zoom: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentAvatarType(str, Enum, metaclass=CaseInsensitiveEnumMeta): PHOTO_AVATAR = "photo_avatar" VIDEO_AVATAR = "video_avatar" - class azure.ai.projects.models.VoiceAzureSemanticVadEnTurnDetection(VoiceTurnDetection, discriminator='azure_semantic_vad_en'): + class azure.ai.projects.models.VoiceAgentAvatarVideoBackground(_Model): + color: Optional[str] + image_url: Optional[str] + + @overload + def __init__( + self, + *, + color: Optional[str] = ..., + image_url: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentAvatarVideoCrop(_Model): + bottom_right: list[int] + top_left: list[int] + + @overload + def __init__( + self, + *, + bottom_right: list[int], + top_left: list[int] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentAvatarVideoParams(_Model): + background: Optional[VoiceAgentAvatarVideoBackground] + bitrate: Optional[int] + crop: Optional[VoiceAgentAvatarVideoCrop] + gop_size: Optional[int] + resolution: Optional[VoiceAgentAvatarVideoResolution] + + @overload + def __init__( + self, + *, + background: Optional[VoiceAgentAvatarVideoBackground] = ..., + bitrate: Optional[int] = ..., + crop: Optional[VoiceAgentAvatarVideoCrop] = ..., + gop_size: Optional[int] = ..., + resolution: Optional[VoiceAgentAvatarVideoResolution] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentAvatarVideoResolution(_Model): + height: int + width: int + + @overload + def __init__( + self, + *, + height: int, + width: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentAzureSemanticVadEnTurnDetection(VoiceAgentTurnDetectionConfig, discriminator='azure_semantic_vad_en'): auto_truncate: bool create_response: Optional[bool] - end_of_utterance_detection: Optional[VoiceEndOfUtteranceDetection] + end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] idle_timeout_ms: Optional[timedelta] interrupt_response: Optional[bool] prefix_padding_ms: Optional[timedelta] @@ -13071,7 +12588,7 @@ namespace azure.ai.projects.models silence_duration_ms: Optional[timedelta] speech_duration_ms: Optional[timedelta] threshold: Optional[float] - type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN] + type: Literal[VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD_EN] @overload def __init__( @@ -13079,7 +12596,7 @@ namespace azure.ai.projects.models *, auto_truncate: Optional[bool] = ..., create_response: Optional[bool] = ..., - end_of_utterance_detection: Optional[VoiceEndOfUtteranceDetection] = ..., + end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] = ..., idle_timeout_ms: Optional[timedelta] = ..., interrupt_response: Optional[bool] = ..., prefix_padding_ms: Optional[timedelta] = ..., @@ -13093,10 +12610,10 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAzureSemanticVadMultilingualTurnDetection(VoiceTurnDetection, discriminator='azure_semantic_vad_multilingual'): + class azure.ai.projects.models.VoiceAgentAzureSemanticVadMultilingualTurnDetection(VoiceAgentTurnDetectionConfig, discriminator='azure_semantic_vad_multilingual'): auto_truncate: bool create_response: Optional[bool] - end_of_utterance_detection: Optional[VoiceEndOfUtteranceDetection] + end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] idle_timeout_ms: Optional[timedelta] interrupt_response: Optional[bool] languages: Optional[list[str]] @@ -13105,7 +12622,7 @@ namespace azure.ai.projects.models silence_duration_ms: Optional[timedelta] speech_duration_ms: Optional[timedelta] threshold: Optional[float] - type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] + type: Literal[VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] @overload def __init__( @@ -13113,7 +12630,7 @@ namespace azure.ai.projects.models *, auto_truncate: Optional[bool] = ..., create_response: Optional[bool] = ..., - end_of_utterance_detection: Optional[VoiceEndOfUtteranceDetection] = ..., + end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] = ..., idle_timeout_ms: Optional[timedelta] = ..., interrupt_response: Optional[bool] = ..., languages: Optional[list[str]] = ..., @@ -13128,10 +12645,10 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAzureSemanticVadTurnDetection(VoiceTurnDetection, discriminator='azure_semantic_vad'): + class azure.ai.projects.models.VoiceAgentAzureSemanticVadTurnDetection(VoiceAgentTurnDetectionConfig, discriminator='azure_semantic_vad'): auto_truncate: bool create_response: Optional[bool] - end_of_utterance_detection: Optional[VoiceEndOfUtteranceDetection] + end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] idle_timeout_ms: Optional[timedelta] interrupt_response: Optional[bool] languages: Optional[list[str]] @@ -13140,7 +12657,7 @@ namespace azure.ai.projects.models silence_duration_ms: Optional[timedelta] speech_duration_ms: Optional[timedelta] threshold: Optional[float] - type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD] + type: Literal[VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD] @overload def __init__( @@ -13148,7 +12665,7 @@ namespace azure.ai.projects.models *, auto_truncate: Optional[bool] = ..., create_response: Optional[bool] = ..., - end_of_utterance_detection: Optional[VoiceEndOfUtteranceDetection] = ..., + end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] = ..., idle_timeout_ms: Optional[timedelta] = ..., interrupt_response: Optional[bool] = ..., languages: Optional[list[str]] = ..., @@ -13163,78 +12680,119 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceConversation(_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[RealtimeResponseUsage] + class azure.ai.projects.models.VoiceAgentClientEventSessionAvatarConnect(RealtimeClientEvent, discriminator='session.avatar.connect'): + client_sdp: str + event_id: Optional[str] + type: Literal[RealtimeClientEventType.SESSION_AVATAR_CONNECT] @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[RealtimeResponseUsage] = ... + client_sdp: str, + event_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceConversationItem(_Model): - created_at: Optional[datetime] - response_id: Optional[str] - type: str + class azure.ai.projects.models.VoiceAgentClientEventSessionUpdate(_Model): + event_id: Optional[str] + session: VoiceAgentSessionUpdateConfig + type: Literal[RealtimeClientEventType.SESSION_UPDATE] @overload def __init__( self, *, - created_at: Optional[datetime] = ..., - response_id: Optional[str] = ..., - type: str + event_id: Optional[str] = ..., + session: VoiceAgentSessionUpdateConfig, + type: Literal[RealtimeClientEventType.SESSION_UPDATE] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FUNCTION_CALL = "function_call" - FUNCTION_CALL_OUTPUT = "function_call_output" - MCP_APPROVAL_REQUEST = "mcp_approval_request" - MCP_APPROVAL_RESPONSE = "mcp_approval_response" - MCP_CALL = "mcp_call" - MCP_LIST_TOOLS = "mcp_list_tools" - MESSAGE = "message" + class azure.ai.projects.models.VoiceAgentDefinition(AgentDefinition, discriminator='voice'): + audio: Optional[VoiceAgentAudioConfig] + avatar: Optional[VoiceAgentAvatarConfig] + greeting: Optional[VoiceAgentGreetingConfig] + include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] + instructions: Optional[str] + interim_response: Optional[VoiceAgentInterimResponseConfig] + kind: Literal[AgentKind.VOICE] + max_output_tokens: Optional[VoiceAgentMaxOutputTokens] + model: str + model_type: 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]] + tool_choice: Optional[VoiceAgentToolChoice] + tools: Optional[list[VoiceAgentTool]] + @overload + def __init__( + self, + *, + audio: Optional[VoiceAgentAudioConfig] = ..., + avatar: Optional[VoiceAgentAvatarConfig] = ..., + greeting: Optional[VoiceAgentGreetingConfig] = ..., + include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] = ..., + instructions: Optional[str] = ..., + interim_response: Optional[VoiceAgentInterimResponseConfig] = ..., + max_output_tokens: Optional[VoiceAgentMaxOutputTokens] = ..., + model: str, + model_type: Union[str, VoiceModelType], + output_modalities: Optional[list[Union[str, VoiceOutputModality]]] = ..., + parallel_tool_calls: Optional[bool] = ..., + rai_config: Optional[RaiConfig] = ..., + store: Optional[bool] = ..., + structured_inputs: Optional[dict[str, StructuredInputDefinition]] = ..., + tool_choice: Optional[VoiceAgentToolChoice] = ..., + tools: Optional[list[VoiceAgentTool]] = ... + ) -> None: ... - class azure.ai.projects.models.VoiceConversationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - COMPLETED = "completed" - FAILED = "failed" - IN_PROGRESS = "in_progress" + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentEchoCancellation(_Model): + channels: Optional[int] + reference_source: Optional[Union[str, VoiceAgentEchoCancellationReferenceSource]] + type: Literal["server_echo_cancellation"] + + @overload + def __init__( + self, + *, + channels: Optional[int] = ..., + reference_source: Optional[Union[str, VoiceAgentEchoCancellationReferenceSource]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentEchoCancellationReferenceSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CLIENT = "client" + SERVER = "server" - class azure.ai.projects.models.VoiceEndOfUtteranceDetection(_Model): - model: Union[str, VoiceEndOfUtteranceDetectionModel] - threshold_level: Optional[Union[str, VoiceEndOfUtteranceThresholdLevel]] + class azure.ai.projects.models.VoiceAgentEndOfUtteranceDetection(_Model): + model: Union[str, VoiceAgentEndOfUtteranceDetectionModel] + threshold_level: Optional[Union[str, VoiceAgentEndOfUtteranceThresholdLevel]] timeout_ms: Optional[timedelta] @overload def __init__( self, *, - model: Union[str, VoiceEndOfUtteranceDetectionModel], - threshold_level: Optional[Union[str, VoiceEndOfUtteranceThresholdLevel]] = ..., + model: Union[str, VoiceAgentEndOfUtteranceDetectionModel], + threshold_level: Optional[Union[str, VoiceAgentEndOfUtteranceThresholdLevel]] = ..., timeout_ms: Optional[timedelta] = ... ) -> None: ... @@ -13242,97 +12800,58 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceEndOfUtteranceDetectionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + class azure.ai.projects.models.VoiceAgentEndOfUtteranceDetectionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): SEMANTIC_DETECTION_V1 = "semantic_detection_v1" SEMANTIC_DETECTION_V1_EN = "semantic_detection_v1_en" SEMANTIC_DETECTION_V1_MULTILINGUAL = "semantic_detection_v1_multilingual" SMART_END_OF_TURN_DETECTION = "smart_end_of_turn_detection" - class azure.ai.projects.models.VoiceEndOfUtteranceThresholdLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + class azure.ai.projects.models.VoiceAgentEndOfUtteranceThresholdLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): DEFAULT = "default" HIGH = "high" LOW = "low" MEDIUM = "medium" - class azure.ai.projects.models.VoiceFunctionCallItem(VoiceConversationItem, discriminator='function_call'): - arguments: str - call_id: Optional[str] - created_at: datetime - id: Optional[str] + class azure.ai.projects.models.VoiceAgentFunctionTool(VoiceAgentTool, discriminator='function'): + description: Optional[str] name: str - object: Optional[Literal["item"]] - response_id: str - status: Optional[Literal["completed", "incomplete", "in_progress"]] - type: Literal[VoiceConversationItemType.FUNCTION_CALL] + parameters: Optional[RealtimeFunctionToolParameters] + type: Literal["function"] @overload def __init__( self, *, - arguments: str, - call_id: Optional[str] = ..., - created_at: Optional[datetime] = ..., - id: Optional[str] = ..., + description: Optional[str] = ..., name: str, - object: Optional[Literal[item]] = ..., - response_id: Optional[str] = ..., - status: Optional[Literal[completed, incomplete, in_progress]] = ... + parameters: Optional[RealtimeFunctionToolParameters] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceFunctionCallOutputItem(VoiceConversationItem, discriminator='function_call_output'): - call_id: str - created_at: datetime - id: Optional[str] - name: Optional[str] - object: Optional[Literal["item"]] - output: str - response_id: str - status: Optional[Literal["completed", "incomplete", "in_progress"]] - type: Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT] + class azure.ai.projects.models.VoiceAgentGreetingConfig(_Model): + type: str @overload def __init__( self, *, - call_id: str, - created_at: Optional[datetime] = ..., - id: Optional[str] = ..., - name: Optional[str] = ..., - object: Optional[Literal[item]] = ..., - output: str, - response_id: Optional[str] = ..., - status: Optional[Literal[completed, incomplete, in_progress]] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceGreetingConfig(_Model): - type: str - - @overload - def __init__( - self, - *, - type: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.VoiceInputTranscription(_Model): + class azure.ai.projects.models.VoiceAgentInputTranscription(_Model): custom_speech: Optional[dict[str, str]] delay: Optional[Literal["minimal", "low", "medium", "high", "xhigh"]] language: Optional[str] - model: Union[str, VoiceInputTranscriptionModel] + model: Union[str, VoiceAgentInputTranscriptionModel] phrase_list: Optional[list[str]] prompt: Optional[str] @@ -13343,7 +12862,7 @@ namespace azure.ai.projects.models custom_speech: Optional[dict[str, str]] = ..., delay: Optional[Literal[minimal, low, medium, high, xhigh]] = ..., language: Optional[str] = ..., - model: Union[str, VoiceInputTranscriptionModel], + model: Union[str, VoiceAgentInputTranscriptionModel], phrase_list: Optional[list[str]] = ..., prompt: Optional[str] = ... ) -> None: ... @@ -13352,7 +12871,7 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceInputTranscriptionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + class azure.ai.projects.models.VoiceAgentInputTranscriptionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): AZURE_SPEECH = "azure-speech" GPT4_O_MINI_TRANSCRIBE = "gpt-4o-mini-transcribe" GPT4_O_TRANSCRIBE = "gpt-4o-transcribe" @@ -13364,244 +12883,137 @@ namespace azure.ai.projects.models WHISPER1 = "whisper-1" - class azure.ai.projects.models.VoiceItemAudioResponse(_Model): - blob_uri: Optional[str] - channels: Optional[int] - codec: Optional[Union[str, VoiceAudioCodec]] - conversation_id: str - duration_ms: Optional[timedelta] - format: Optional[Union[str, VoiceAudioContainerFormat]] - item_id: str - role: Optional[Union[str, VoiceAudioRole]] - sample_rate: Optional[int] - start_offset_ms: Optional[timedelta] + class azure.ai.projects.models.VoiceAgentInterimResponseConfig(_Model): + latency_threshold_ms: Optional[timedelta] + triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] + type: str @overload def __init__( self, *, - blob_uri: Optional[str] = ..., - channels: Optional[int] = ..., - codec: Optional[Union[str, VoiceAudioCodec]] = ..., - conversation_id: str, - duration_ms: Optional[timedelta] = ..., - format: Optional[Union[str, VoiceAudioContainerFormat]] = ..., - item_id: str, - role: Optional[Union[str, VoiceAudioRole]] = ..., - sample_rate: Optional[int] = ..., - start_offset_ms: Optional[timedelta] = ... + latency_threshold_ms: Optional[timedelta] = ..., + triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] = ..., + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceMcpApprovalRequestItem(VoiceConversationItem, discriminator='mcp_approval_request'): - arguments: str - created_at: datetime - id: str - name: str - response_id: str - server_label: str - type: Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST] - - @overload - def __init__( - self, - *, - arguments: str, - created_at: Optional[datetime] = ..., - id: str, - name: str, - response_id: Optional[str] = ..., - server_label: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.VoiceAgentInterimResponseTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LATENCY = "latency" + TOOL = "tool" - class azure.ai.projects.models.VoiceMcpApprovalResponseItem(VoiceConversationItem, discriminator='mcp_approval_response'): - approval_request_id: str - approve: bool - created_at: datetime - id: str - reason: Optional[str] - response_id: str - type: Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE] + class azure.ai.projects.models.VoiceAgentLlmGeneratedGreetingConfig(VoiceAgentGreetingConfig, discriminator='llm_generated'): + prompt: str + tool_choice: Optional[VoiceAgentToolChoice] + type: Literal["llm_generated"] @overload def __init__( self, *, - approval_request_id: str, - approve: bool, - created_at: Optional[datetime] = ..., - id: str, - reason: Optional[str] = ..., - response_id: Optional[str] = ... + prompt: str, + tool_choice: Optional[VoiceAgentToolChoice] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceMcpCallItem(VoiceConversationItem, discriminator='mcp_call'): - approval_request_id: Optional[str] - arguments: str - created_at: datetime - error: Optional[RealtimeMCPError] - id: str - name: str - output: Optional[str] - response_id: str - server_label: str - type: Literal[VoiceConversationItemType.MCP_CALL] + class azure.ai.projects.models.VoiceAgentLlmInterimResponseConfig(VoiceAgentInterimResponseConfig, discriminator='llm_interim_response'): + instructions: Optional[str] + latency_threshold_ms: timedelta + max_completion_tokens: Optional[int] + model: Optional[str] + triggers: Union[list[str, VoiceAgentInterimResponseTrigger]] + type: Literal["llm_interim_response"] @overload def __init__( self, *, - approval_request_id: Optional[str] = ..., - arguments: str, - created_at: Optional[datetime] = ..., - error: Optional[RealtimeMCPError] = ..., - id: str, - name: str, - output: Optional[str] = ..., - response_id: Optional[str] = ..., - server_label: str + instructions: Optional[str] = ..., + latency_threshold_ms: Optional[timedelta] = ..., + max_completion_tokens: Optional[int] = ..., + model: Optional[str] = ..., + triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceMcpListToolsItem(VoiceConversationItem, discriminator='mcp_list_tools'): - created_at: datetime - id: Optional[str] - response_id: str + class azure.ai.projects.models.VoiceAgentMcpTool(VoiceAgentTool, discriminator='mcp'): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] + allowed_tools: Optional[Union[list[str], MCPToolFilter]] + authorization: Optional[str] + defer_loading: Optional[bool] + headers: Optional[dict[str, str]] + project_connection_id: Optional[str] + require_approval: Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] + response_scheduling: Optional[Union[str, VoiceAgentToolResponseScheduling]] + server_description: Optional[str] server_label: str - tools: list[MCPListToolsTool] - type: Literal[VoiceConversationItemType.MCP_LIST_TOOLS] + server_url: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal["mcp"] @overload def __init__( self, *, - created_at: Optional[datetime] = ..., - id: Optional[str] = ..., - response_id: Optional[str] = ..., + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., + allowed_tools: Optional[Union[list[str], MCPToolFilter]] = ..., + authorization: Optional[str] = ..., + defer_loading: Optional[bool] = ..., + headers: Optional[dict[str, str]] = ..., + project_connection_id: Optional[str] = ..., + require_approval: Optional[Union[MCPToolRequireApproval, Literal[always], Literal[never]]] = ..., + response_scheduling: Optional[Union[str, VoiceAgentToolResponseScheduling]] = ..., + server_description: Optional[str] = ..., server_label: str, - tools: list[MCPListToolsTool] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.VoiceMessageItem(VoiceConversationItem, discriminator='message'): - created_at: datetime - response_id: str - role: str - type: Literal[VoiceConversationItemType.MESSAGE] - - @overload - def __init__( - self, - *, - created_at: Optional[datetime] = ..., - response_id: Optional[str] = ..., - role: str + server_url: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceModelType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - MANAGED = "managed" - SELF_DEPLOYED = "self_deployed" - - - class azure.ai.projects.models.VoiceNoiseReduction(_Model): - type: Union[str, VoiceNoiseReductionType] + class azure.ai.projects.models.VoiceAgentNoiseReduction(_Model): + type: Union[str, VoiceAgentNoiseReductionType] @overload def __init__( self, *, - type: Union[str, VoiceNoiseReductionType] + type: Union[str, VoiceAgentNoiseReductionType] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceNoiseReductionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + class azure.ai.projects.models.VoiceAgentNoiseReductionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): AZURE_DEEP_NOISE_SUPPRESSION = "azure_deep_noise_suppression" FAR_FIELD = "far_field" NEAR_FIELD = "near_field" - class azure.ai.projects.models.VoiceOutputModality(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ANIMATION = "animation" - AUDIO = "audio" - AVATAR = "avatar" - TEXT = "text" - - - class azure.ai.projects.models.VoiceRecordingChannelLayout(_Model): - left: Literal["user"] - right: Literal["agent"] - - def __init__( - self, - *args: Any, - **kwargs: Any - ) -> None: ... - - - class azure.ai.projects.models.VoiceRecordingResponse(_Model): - blob_uri: Optional[str] - channel_layout: VoiceRecordingChannelLayout - channels: int - conversation_id: str - duration_ms: timedelta - format: Union[str, VoiceAudioContainerFormat] - sample_rate: int - - @overload - def __init__( - self, - *, - blob_uri: Optional[str] = ..., - channel_layout: VoiceRecordingChannelLayout, - channels: int, - conversation_id: str, - duration_ms: timedelta, - format: Union[str, VoiceAudioContainerFormat], - sample_rate: int - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.VoiceResponse(OmitPropertiesRealtimeResponse): + class azure.ai.projects.models.VoiceAgentRealtimeResponse(VoiceAgentRealtimeResponseBase): audio: Optional[VoiceResponseAudio] - completed_at: Optional[datetime] conversation_id: str - created_at: Optional[datetime] id: str max_output_tokens: Union[int, str] - metadata: Optional[dict[str, str]] + metadata: Metadata object: str - output: Optional[list[VoiceConversationItem]] + output: Optional[list[RealtimeConversationItem]] output_modalities: Union[list[str, str]] status: Union[str, str, str, str, str] status_details: RealtimeResponseStatusDetails - temperature: Optional[float] usage: RealtimeResponseUsage @overload @@ -13609,18 +13021,15 @@ namespace azure.ai.projects.models self, *, audio: Optional[VoiceResponseAudio] = ..., - completed_at: Optional[datetime] = ..., - conversation_id: str, - created_at: Optional[datetime] = ..., - id: str, + conversation_id: Optional[str] = ..., + id: Optional[str] = ..., max_output_tokens: Optional[Union[int, Literal[inf]]] = ..., - metadata: Optional[dict[str, str]] = ..., + metadata: Optional[Metadata] = ..., object: Optional[Literal[response]] = ..., - output: Optional[list[VoiceConversationItem]] = ..., + output: Optional[list[RealtimeConversationItem]] = ..., output_modalities: Optional[list[Literal[text, audio]]] = ..., status: Optional[Literal[completed, cancelled, failed, incomplete, in_progress]] = ..., status_details: Optional[RealtimeResponseStatusDetails] = ..., - temperature: Optional[float] = ..., usage: Optional[RealtimeResponseUsage] = ... ) -> None: ... @@ -13628,51 +13037,80 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceResponseAudio(_Model): - output: Optional[VoiceResponseAudioOutput] + class azure.ai.projects.models.VoiceAgentRealtimeResponseBase(_Model): + conversation_id: Optional[str] + id: Optional[str] + max_output_tokens: Optional[Union[int, Literal["inf"]]] + metadata: Optional[Metadata] + object: Optional[Literal["response"]] + output_modalities: Optional[list[Literal["text", "audio"]]] + status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] + status_details: Optional[RealtimeResponseStatusDetails] + usage: Optional[RealtimeResponseUsage] @overload def __init__( self, *, - output: Optional[VoiceResponseAudioOutput] = ... + conversation_id: Optional[str] = ..., + id: Optional[str] = ..., + max_output_tokens: Optional[Union[int, Literal[inf]]] = ..., + metadata: Optional[Metadata] = ..., + object: Optional[Literal[response]] = ..., + output_modalities: Optional[list[Literal[text, audio]]] = ..., + status: Optional[Literal[completed, cancelled, failed, incomplete, in_progress]] = ..., + status_details: Optional[RealtimeResponseStatusDetails] = ..., + usage: Optional[RealtimeResponseUsage] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceResponseAudioOutput(_Model): - format: Optional[RealtimeAudioFormats] - voice: Optional[str] - voice_locale: Optional[str] - voice_type: Optional[str] + class azure.ai.projects.models.VoiceAgentResponseCreateParams(_Model): + audio: Optional[PickPropertiesVoiceAgentAudioConfig] + conversation: Optional[Union[Literal["auto"], Literal["none"], str]] + input: Optional[list[RealtimeConversationItem]] + instructions: Optional[str] + interim_response: Optional[VoiceAgentInterimResponseConfig] + max_output_tokens: Optional[Union[int, Literal["inf"]]] + metadata: Optional[Metadata] + output_modalities: Optional[list[Union[str, VoiceOutputModality]]] + parallel_tool_calls: Optional[bool] + pre_generated_assistant_message: Optional[RealtimeConversationItem] + reasoning: Optional[RealtimeReasoning] + tool_choice: Optional[Union[str, ToolChoiceOptions, ToolChoiceFunction, ToolChoiceMCP]] + tools: Optional[list[Union[RealtimeFunctionTool, MCPTool]]] @overload def __init__( self, *, - format: Optional[RealtimeAudioFormats] = ..., - voice: Optional[str] = ..., - voice_locale: Optional[str] = ..., - voice_type: Optional[str] = ... - ) -> None: ... - - @overload + audio: Optional[PickPropertiesVoiceAgentAudioConfig] = ..., + conversation: Optional[Union[Literal[auto], Literal[none], str]] = ..., + input: Optional[list[RealtimeConversationItem]] = ..., + instructions: Optional[str] = ..., + interim_response: Optional[VoiceAgentInterimResponseConfig] = ..., + max_output_tokens: Optional[Union[int, Literal[inf]]] = ..., + metadata: Optional[Metadata] = ..., + output_modalities: Optional[list[Union[str, VoiceOutputModality]]] = ..., + parallel_tool_calls: Optional[bool] = ..., + pre_generated_assistant_message: Optional[RealtimeConversationItem] = ..., + reasoning: Optional[RealtimeReasoning] = ..., + tool_choice: Optional[Union[str, ToolChoiceOptions, ToolChoiceFunction, ToolChoiceMCP]] = ..., + tools: Optional[list[Union[RealtimeFunctionTool, MCPTool]]] = ... + ) -> None: ... + + @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceServerVadTurnDetection(VoiceTurnDetection, discriminator='server_vad'): + class azure.ai.projects.models.VoiceAgentSemanticVadTurnDetection(VoiceAgentTurnDetectionConfig, discriminator='semantic_vad'): auto_truncate: bool create_response: Optional[bool] - end_of_utterance_detection: Optional[VoiceEndOfUtteranceDetection] - idle_timeout_ms: Optional[int] + eagerness: Optional[Literal["low", "medium", "high", "auto"]] interrupt_response: Optional[bool] - prefix_padding_ms: Optional[int] - silence_duration_ms: Optional[int] - speech_duration_ms: Optional[int] - threshold: Optional[float] - type: Literal[VoiceTurnDetectionType.SERVER_VAD] + type: Literal[VoiceAgentTurnDetectionType.SEMANTIC_VAD] @overload def __init__( @@ -13680,1653 +13118,1659 @@ namespace azure.ai.projects.models *, auto_truncate: Optional[bool] = ..., create_response: Optional[bool] = ..., - end_of_utterance_detection: Optional[VoiceEndOfUtteranceDetection] = ..., - idle_timeout_ms: Optional[int] = ..., - interrupt_response: Optional[bool] = ..., - prefix_padding_ms: Optional[int] = ..., - silence_duration_ms: Optional[int] = ..., - speech_duration_ms: Optional[int] = ..., - threshold: Optional[float] = ... + eagerness: Optional[Literal[low, medium, high, auto]] = ..., + interrupt_response: Optional[bool] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceSystemMessageItem(VoiceMessageItem, discriminator='system'): - content: list[RealtimeConversationItemMessageSystemContent] - created_at: datetime - id: Optional[str] - object: Optional[Literal["item"]] + class azure.ai.projects.models.VoiceAgentServerEventResponseAnimationBlendshapesDelta(RealtimeServerEvent, discriminator='response.animation_blendshapes.delta'): + content_index: int + event_id: str + frame_index: int + frames: list[list[float]] + item_id: str + output_index: int response_id: str - role: Literal[RealtimeConversationItemMessageType.SYSTEM] - status: Optional[Literal["completed", "incomplete", "in_progress"]] - type: Union[str, azure.ai.projects.models.MESSAGE] + type: Literal[RealtimeServerEventType.RESPONSE_ANIMATION_BLENDSHAPES_DELTA] @overload def __init__( self, *, - content: list[RealtimeConversationItemMessageSystemContent], - created_at: Optional[datetime] = ..., - id: Optional[str] = ..., - object: Optional[Literal[item]] = ..., - response_id: Optional[str] = ..., - status: Optional[Literal[completed, incomplete, in_progress]] = ... + content_index: int, + event_id: str, + frame_index: int, + frames: list[list[float]], + item_id: str, + output_index: int, + response_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceSystemTool(VoiceAgentTool, discriminator='system'): - description: Optional[str] - name: Union[str, VoiceSystemToolName] - type: Literal["system"] + class azure.ai.projects.models.VoiceAgentServerEventResponseAnimationBlendshapesDone(RealtimeServerEvent, discriminator='response.animation_blendshapes.done'): + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_ANIMATION_BLENDSHAPES_DONE] @overload def __init__( self, *, - description: Optional[str] = ..., - name: Union[str, VoiceSystemToolName] + event_id: str, + item_id: str, + output_index: int, + response_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceSystemToolName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - END_CONVERSATION = "end_conversation" - - - class azure.ai.projects.models.VoiceToolboxTool(VoiceAgentTool, discriminator='toolbox'): - response_scheduling: Optional[Union[str, VoiceAgentToolResponseScheduling]] - toolbox_name: str - toolbox_version: str - type: Literal["toolbox"] + class azure.ai.projects.models.VoiceAgentServerEventResponseAnimationVisemeDelta(RealtimeServerEvent, discriminator='response.animation_viseme.delta'): + audio_offset_ms: timedelta + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_ANIMATION_VISEME_DELTA] + viseme_id: int @overload def __init__( self, *, - response_scheduling: Optional[Union[str, VoiceAgentToolResponseScheduling]] = ..., - toolbox_name: str, - toolbox_version: str + audio_offset_ms: timedelta, + content_index: int, + event_id: str, + item_id: str, + output_index: int, + response_id: str, + viseme_id: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceTurnDetection(_Model): - auto_truncate: Optional[bool] - type: str + class azure.ai.projects.models.VoiceAgentServerEventResponseAnimationVisemeDone(RealtimeServerEvent, discriminator='response.animation_viseme.done'): + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_ANIMATION_VISEME_DONE] @overload def __init__( self, *, - auto_truncate: Optional[bool] = ..., - type: str + content_index: int, + event_id: str, + item_id: str, + output_index: int, + response_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceTurnDetectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AZURE_SEMANTIC_VAD = "azure_semantic_vad" - AZURE_SEMANTIC_VAD_EN = "azure_semantic_vad_en" - AZURE_SEMANTIC_VAD_MULTILINGUAL = "azure_semantic_vad_multilingual" - SEMANTIC_VAD = "semantic_vad" - SERVER_VAD = "server_vad" - - - class azure.ai.projects.models.VoiceUserMessageItem(VoiceMessageItem, discriminator='user'): - content: list[RealtimeConversationItemMessageUserContent] - created_at: datetime - id: Optional[str] - object: Optional[Literal["item"]] + class azure.ai.projects.models.VoiceAgentServerEventResponseAudioTimestampDelta(RealtimeServerEvent, discriminator='response.audio_timestamp.delta'): + audio_duration_ms: timedelta + audio_offset_ms: timedelta + content_index: int + event_id: str + item_id: str + output_index: int response_id: str - role: Literal[RealtimeConversationItemMessageType.USER] - status: Optional[Literal["completed", "incomplete", "in_progress"]] - type: Union[str, azure.ai.projects.models.MESSAGE] + text: str + timestamp_type: Literal["word"] + type: Literal[RealtimeServerEventType.RESPONSE_AUDIO_TIMESTAMP_DELTA] @overload def __init__( self, *, - content: list[RealtimeConversationItemMessageUserContent], - created_at: Optional[datetime] = ..., - id: Optional[str] = ..., - object: Optional[Literal[item]] = ..., - response_id: Optional[str] = ..., - status: Optional[Literal[completed, incomplete, in_progress]] = ... + audio_duration_ms: timedelta, + audio_offset_ms: timedelta, + content_index: int, + event_id: str, + item_id: str, + output_index: int, + response_id: str, + text: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.WebSearchApproximateLocation(_Model): - city: Optional[str] - country: Optional[str] - region: Optional[str] - timezone: Optional[str] - type: Literal["approximate"] + class azure.ai.projects.models.VoiceAgentServerEventResponseAudioTimestampDone(RealtimeServerEvent, discriminator='response.audio_timestamp.done'): + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_AUDIO_TIMESTAMP_DONE] @overload def __init__( self, *, - city: Optional[str] = ..., - country: Optional[str] = ..., - region: Optional[str] = ..., - timezone: Optional[str] = ... + content_index: int, + event_id: str, + item_id: str, + output_index: int, + response_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.WebSearchConfiguration(_Model): - instance_name: str - project_connection_id: str + class azure.ai.projects.models.VoiceAgentServerEventResponseVideoDelta(RealtimeServerEvent, discriminator='response.video.delta'): + codec: str + delta: str + event_id: str + output_index: int + type: Literal[RealtimeServerEventType.RESPONSE_VIDEO_DELTA] @overload def __init__( self, *, - instance_name: str, - project_connection_id: str + codec: str, + delta: str, + event_id: str, + output_index: int ) -> None: ... @overload 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] + class azure.ai.projects.models.VoiceAgentServerEventSessionAvatarConnecting(RealtimeServerEvent, discriminator='session.avatar.connecting'): + event_id: str + server_sdp: str + type: Literal[RealtimeServerEventType.SESSION_AVATAR_CONNECTING] @overload def __init__( self, *, - search_content_types: Optional[list[Union[str, SearchContentType]]] = ..., - search_context_size: Optional[Union[str, SearchContextSize]] = ..., - user_location: Optional[ApproximateLocation] = ... + event_id: str, + server_sdp: str ) -> 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] - 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] + class azure.ai.projects.models.VoiceAgentServerEventSessionAvatarSwitchToIdle(RealtimeServerEvent, discriminator='session.avatar.switch_to_idle'): + event_id: str + turn_id: Optional[str] + type: Literal[RealtimeServerEventType.SESSION_AVATAR_SWITCH_TO_IDLE] @overload def __init__( self, *, - custom_search_configuration: Optional[WebSearchConfiguration] = ..., - description: Optional[str] = ..., - filters: Optional[WebSearchToolFilters] = ..., - name: Optional[str] = ..., - search_context_size: Optional[Literal[low, medium, high]] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ..., - user_location: Optional[WebSearchApproximateLocation] = ... + event_id: str, + turn_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.WebSearchToolFilters(_Model): - allowed_domains: Optional[list[str]] + class azure.ai.projects.models.VoiceAgentServerEventSessionAvatarSwitchToSpeaking(RealtimeServerEvent, discriminator='session.avatar.switch_to_speaking'): + event_id: str + turn_id: Optional[str] + type: Literal[RealtimeServerEventType.SESSION_AVATAR_SWITCH_TO_SPEAKING] @overload def __init__( self, *, - allowed_domains: Optional[list[str]] = ... + event_id: str, + turn_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.WebSearchToolboxTool(ToolboxTool, discriminator='web_search'): - custom_search_configuration: Optional[WebSearchConfiguration] - description: str - filters: Optional[WebSearchToolFilters] - name: str - search_context_size: Optional[Literal["low", "medium", "high"]] - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.WEB_SEARCH] - user_location: Optional[WebSearchApproximateLocation] + class azure.ai.projects.models.VoiceAgentServerEventWarning(RealtimeServerEvent, discriminator='warning'): + event_id: str + type: Literal[RealtimeServerEventType.WARNING] + warning: VoiceAgentServerEventWarningDetails @overload def __init__( self, *, - custom_search_configuration: Optional[WebSearchConfiguration] = ..., - description: Optional[str] = ..., - filters: Optional[WebSearchToolFilters] = ..., - name: Optional[str] = ..., - search_context_size: Optional[Literal[low, medium, high]] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ..., - user_location: Optional[WebSearchApproximateLocation] = ... + event_id: str, + warning: VoiceAgentServerEventWarningDetails ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.WeeklyRecurrenceSchedule(RecurrenceSchedule, discriminator='Weekly'): - days_of_week: list[Union[str, DayOfWeek]] - type: Literal[RecurrenceType.WEEKLY] + class azure.ai.projects.models.VoiceAgentServerEventWarningDetails(_Model): + code: Optional[str] + message: str + param: Optional[str] @overload def __init__( self, *, - days_of_week: list[Union[str, DayOfWeek]] + code: Optional[str] = ..., + message: str, + param: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.WorkIQPreviewTool(Tool, discriminator='work_iq_preview'): - project_connection_id: str - type: Literal[ToolType.WORK_IQ_PREVIEW] + class azure.ai.projects.models.VoiceAgentServerVadTurnDetection(VoiceAgentTurnDetectionConfig, discriminator='server_vad'): + auto_truncate: bool + create_response: Optional[bool] + end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] + idle_timeout_ms: Optional[int] + interrupt_response: Optional[bool] + prefix_padding_ms: Optional[int] + silence_duration_ms: Optional[int] + speech_duration_ms: Optional[timedelta] + threshold: Optional[float] + type: Literal[VoiceAgentTurnDetectionType.SERVER_VAD] @overload def __init__( self, *, - project_connection_id: str + auto_truncate: Optional[bool] = ..., + create_response: Optional[bool] = ..., + end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] = ..., + idle_timeout_ms: Optional[int] = ..., + interrupt_response: Optional[bool] = ..., + prefix_padding_ms: Optional[int] = ..., + silence_duration_ms: Optional[int] = ..., + speech_duration_ms: Optional[timedelta] = ..., + threshold: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.WorkIQPreviewToolboxTool(ToolboxTool, discriminator='work_iq_preview'): - description: str - name: str - project_connection_id: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.WORK_IQ_PREVIEW] - - @overload - def __init__( - self, - *, - description: Optional[str] = ..., - name: Optional[str] = ..., - project_connection_id: str, - tool_configs: Optional[dict[str, ToolConfig]] = ... + class azure.ai.projects.models.VoiceAgentSessionAvatarConfig(VoiceAgentAvatarConfig): + character: str + customized: bool + ice_servers: Optional[list[VoiceAgentAvatarIceServer]] + model: str + output_audit_audio: bool + output_protocol: Union[str, VoiceAgentAvatarOutputProtocol] + scene: VoiceAgentAvatarScene + style: str + type: Union[str, VoiceAgentAvatarType] + video: VoiceAgentAvatarVideoParams + + @overload + def __init__( + self, + *, + character: str, + customized: Optional[bool] = ..., + ice_servers: Optional[list[VoiceAgentAvatarIceServer]] = ..., + model: Optional[str] = ..., + output_audit_audio: Optional[bool] = ..., + output_protocol: Optional[Union[str, VoiceAgentAvatarOutputProtocol]] = ..., + scene: Optional[VoiceAgentAvatarScene] = ..., + style: Optional[str] = ..., + type: Union[str, VoiceAgentAvatarType], + video: Optional[VoiceAgentAvatarVideoParams] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.WorkflowAgentDefinition(AgentDefinition, discriminator='workflow'): - kind: Literal[AgentKind.WORKFLOW] - rai_config: RaiConfig - workflow: Optional[str] + class azure.ai.projects.models.VoiceAgentSessionIncludeOption(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FILE_SEARCH_CALL_RESULTS = "file_search_call.results" + INPUT_AUDIO_TRANSCRIPTION_LOGPROBS = "item.input_audio_transcription.logprobs" + INPUT_AUDIO_TRANSCRIPTION_PHRASES = "item.input_audio_transcription.phrases" + + + class azure.ai.projects.models.VoiceAgentSessionResponseConfig(_Model): + animation: Optional[VoiceAgentAnimationConfig] + audio: Optional[VoiceAgentAudioConfig] + avatar: Optional[VoiceAgentSessionAvatarConfig] + expires_at: Optional[datetime] + greeting: Optional[VoiceAgentGreetingConfig] + id: str + include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] + instructions: Optional[str] + interim_response: Optional[VoiceAgentInterimResponseConfig] + max_output_tokens: Optional[VoiceAgentMaxOutputTokens] + metadata: Optional[dict[str, str]] + model: str + object: Literal["session"] + output_modalities: Optional[list[Union[str, VoiceOutputModality]]] + parallel_tool_calls: Optional[bool] + reasoning: Optional[RealtimeReasoning] + temperature: Optional[float] + tool_choice: Optional[VoiceAgentToolChoice] + tools: Optional[list[VoiceAgentTool]] + type: Literal["realtime"] @overload def __init__( self, *, - rai_config: Optional[RaiConfig] = ..., - workflow: Optional[str] = ... + animation: Optional[VoiceAgentAnimationConfig] = ..., + audio: Optional[VoiceAgentAudioConfig] = ..., + avatar: Optional[VoiceAgentSessionAvatarConfig] = ..., + expires_at: Optional[datetime] = ..., + greeting: Optional[VoiceAgentGreetingConfig] = ..., + id: str, + include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] = ..., + instructions: Optional[str] = ..., + interim_response: Optional[VoiceAgentInterimResponseConfig] = ..., + max_output_tokens: Optional[VoiceAgentMaxOutputTokens] = ..., + metadata: Optional[dict[str, str]] = ..., + model: str, + output_modalities: Optional[list[Union[str, VoiceOutputModality]]] = ..., + parallel_tool_calls: Optional[bool] = ..., + reasoning: Optional[RealtimeReasoning] = ..., + temperature: Optional[float] = ..., + tool_choice: Optional[VoiceAgentToolChoice] = ..., + tools: Optional[list[VoiceAgentTool]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... -namespace azure.ai.projects.operations - - class azure.ai.projects.operations.AgentEndpointConversationsOperations: + class azure.ai.projects.models.VoiceAgentSessionUpdateConfig(_Model): + animation: Optional[VoiceAgentAnimationConfig] + audio: Optional[VoiceAgentAudioConfig] + avatar: Optional[VoiceAgentSessionAvatarConfig] + greeting: Optional[VoiceAgentGreetingConfig] + include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] + instructions: Optional[str] + interim_response: Optional[VoiceAgentInterimResponseConfig] + max_output_tokens: Optional[VoiceAgentMaxOutputTokens] + metadata: Optional[dict[str, str]] + output_modalities: Optional[list[Union[str, VoiceOutputModality]]] + parallel_tool_calls: Optional[bool] + reasoning: Optional[RealtimeReasoning] + temperature: Optional[float] + tool_choice: Optional[VoiceAgentToolChoice] + tools: Optional[list[VoiceAgentTool]] + type: Literal["realtime"] + @overload def __init__( self, - *args, - **kwargs + *, + animation: Optional[VoiceAgentAnimationConfig] = ..., + audio: Optional[VoiceAgentAudioConfig] = ..., + avatar: Optional[VoiceAgentSessionAvatarConfig] = ..., + greeting: Optional[VoiceAgentGreetingConfig] = ..., + include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] = ..., + instructions: Optional[str] = ..., + interim_response: Optional[VoiceAgentInterimResponseConfig] = ..., + max_output_tokens: Optional[VoiceAgentMaxOutputTokens] = ..., + metadata: Optional[dict[str, str]] = ..., + output_modalities: Optional[list[Union[str, VoiceOutputModality]]] = ..., + parallel_tool_calls: Optional[bool] = ..., + reasoning: Optional[RealtimeReasoning] = ..., + temperature: Optional[float] = ..., + tool_choice: Optional[VoiceAgentToolChoice] = ..., + tools: Optional[list[VoiceAgentTool]] = ... ) -> None: ... - @distributed_trace - def delete_agent_conversation( + @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]] + triggers: Union[list[str, VoiceAgentInterimResponseTrigger]] + type: Literal["static_interim_response"] + + @overload + def __init__( self, - agent_name: str, - conversation_id: str, - **kwargs: Any + *, + latency_threshold_ms: Optional[timedelta] = ..., + texts: Optional[list[str]] = ..., + triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] = ... ) -> None: ... - @distributed_trace - def get_agent_conversation( - self, - agent_name: str, - conversation_id: str, - **kwargs: Any - ) -> VoiceConversation: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def get_agent_conversation_audio( - self, - agent_name: str, - conversation_id: str, - **kwargs: Any - ) -> VoiceRecordingResponse: ... - @distributed_trace - def get_agent_conversation_audio_content( - self, - agent_name: str, - conversation_id: str, - **kwargs: Any - ) -> Iterator[bytes]: ... + class azure.ai.projects.models.VoiceAgentSystemTool(VoiceAgentTool, discriminator='system'): + description: Optional[str] + name: Union[str, VoiceAgentSystemToolName] + type: Literal["system"] - @distributed_trace - def get_agent_conversation_item( + @overload + def __init__( self, - agent_name: str, - conversation_id: str, - item_id: str, - **kwargs: Any - ) -> VoiceConversationItem: ... + *, + description: Optional[str] = ..., + name: Union[str, VoiceAgentSystemToolName] + ) -> None: ... - @distributed_trace - def get_agent_conversation_item_audio( - self, - agent_name: str, - conversation_id: str, - item_id: str, - **kwargs: Any - ) -> VoiceItemAudioResponse: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def get_agent_conversation_item_audio_content( - self, - agent_name: str, - conversation_id: str, - item_id: str, - **kwargs: Any - ) -> Iterator[bytes]: ... - @distributed_trace - def get_agent_conversation_response( - self, - agent_name: str, - conversation_id: str, - response_id: str, - **kwargs: Any - ) -> VoiceResponse: ... + class azure.ai.projects.models.VoiceAgentSystemToolName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + END_CONVERSATION = "end_conversation" - @distributed_trace - def list_agent_conversation_items( - self, - agent_name: str, - conversation_id: str, - *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> ItemPaged[VoiceConversationItem]: ... - @distributed_trace - def list_agent_conversation_response_items( - self, - agent_name: str, - conversation_id: str, - response_id: str, - *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> ItemPaged[VoiceConversationItem]: ... + class azure.ai.projects.models.VoiceAgentTemplateGreetingConfig(VoiceAgentGreetingConfig, discriminator='template'): + text: str + type: Literal["template"] - @distributed_trace - def list_agent_conversation_responses( + @overload + def __init__( self, - agent_name: str, - conversation_id: str, *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> ItemPaged[VoiceResponse]: ... + text: str + ) -> None: ... - @distributed_trace - def list_agent_conversations( - self, - agent_name: str, - *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> ItemPaged[VoiceConversation]: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.operations.AgentsOperations(GeneratedAgentsOperations): + class azure.ai.projects.models.VoiceAgentTool(_Model): + type: str + @overload def __init__( self, - *args, - **kwargs + *, + type: str ) -> None: ... @overload - def create_session( - self, - agent_name: str, - *, - agent_session_id: Optional[str] = ..., - content_type: str = "application/json", - version_indicator: VersionIndicator, - **kwargs: Any - ) -> AgentSessionResource: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentToolResponseScheduling(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INTERRUPT = "interrupt" + SILENT = "silent" + SKIP_IF_BUSY = "skip_if_busy" + WHEN_IDLE = "when_idle" + + + class azure.ai.projects.models.VoiceAgentToolboxTool(VoiceAgentTool, discriminator='toolbox'): + response_scheduling: Optional[Union[str, VoiceAgentToolResponseScheduling]] + toolbox_name: str + toolbox_version: str + type: Literal["toolbox"] @overload - def create_session( + def __init__( self, - agent_name: str, - body: JSON, *, - content_type: str = "application/json", - **kwargs: Any - ) -> AgentSessionResource: ... + response_scheduling: Optional[Union[str, VoiceAgentToolResponseScheduling]] = ..., + toolbox_name: str, + toolbox_version: str + ) -> None: ... @overload - def create_session( - self, - agent_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AgentSessionResource: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @overload - def create_version( - self, - agent_name: str, - *, - blueprint_reference: Optional[AgentBlueprintReference] = ..., - content_type: str = "application/json", - definition: AgentDefinition, - description: Optional[str] = ..., - draft: Optional[bool] = ..., - metadata: Optional[dict[str, str]] = ..., - **kwargs: Any - ) -> AgentVersionDetails: ... + + class azure.ai.projects.models.VoiceAgentTranscriptionPhrase(_Model): + confidence: Optional[float] + duration_milliseconds: timedelta + locale: Optional[str] + offset_milliseconds: timedelta + text: str + words: Optional[list[VoiceAgentTranscriptionWord]] @overload - def create_version( + def __init__( self, - agent_name: str, - body: JSON, *, - content_type: str = "application/json", - **kwargs: Any - ) -> AgentVersionDetails: ... + confidence: Optional[float] = ..., + duration_milliseconds: timedelta, + locale: Optional[str] = ..., + offset_milliseconds: timedelta, + text: str, + words: Optional[list[VoiceAgentTranscriptionWord]] = ... + ) -> None: ... @overload - def create_version( - self, - agent_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AgentVersionDetails: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def create_version_from_code( - self, - agent_name: str, - *, - code: IO[bytes], - code_zip_sha256: Optional[str] = ..., - definition: HostedAgentDefinition, - description: Optional[str] = ..., - metadata: Optional[dict[str, str]] = ..., - **kwargs: Any - ) -> AgentVersionDetails: ... - @overload - def create_version_from_manifest( - self, - agent_name: str, - *, - content_type: str = "application/json", - description: Optional[str] = ..., - manifest_id: str, - metadata: Optional[dict[str, str]] = ..., - parameter_values: dict[str, Any], - **kwargs: Any - ) -> AgentVersionDetails: ... + class azure.ai.projects.models.VoiceAgentTranscriptionWord(_Model): + duration_milliseconds: timedelta + offset_milliseconds: timedelta + text: str @overload - def create_version_from_manifest( + def __init__( self, - agent_name: str, - body: JSON, *, - content_type: str = "application/json", - **kwargs: Any - ) -> AgentVersionDetails: ... + duration_milliseconds: timedelta, + offset_milliseconds: timedelta, + text: str + ) -> None: ... @overload - def create_version_from_manifest( - self, - agent_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AgentVersionDetails: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def delete( - self, - agent_name: str, - *, - force: Optional[bool] = ..., - **kwargs: Any - ) -> DeleteAgentResponse: ... - @distributed_trace - def delete_session( - self, - agent_name: str, - session_id: str, - **kwargs: Any - ) -> None: ... + class azure.ai.projects.models.VoiceAgentTurnDetectionConfig(_Model): + auto_truncate: Optional[bool] + type: str - @distributed_trace - def delete_session_file( + @overload + def __init__( self, - agent_name: str, - session_id: str, *, - path: str, - recursive: Optional[bool] = ..., - **kwargs: Any + auto_truncate: Optional[bool] = ..., + type: str ) -> None: ... - @distributed_trace - def delete_version( - self, - agent_name: str, - agent_version: str, - *, - force: Optional[bool] = ..., - **kwargs: Any - ) -> DeleteAgentVersionResponse: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def disable( - self, - agent_name: str, - **kwargs: Any - ) -> None: ... - @distributed_trace - def download_code( - self, - agent_name: str, - *, - agent_version: Optional[str] = ..., - **kwargs: Any - ) -> Iterator[bytes]: ... + class azure.ai.projects.models.VoiceAgentTurnDetectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_SEMANTIC_VAD = "azure_semantic_vad" + AZURE_SEMANTIC_VAD_EN = "azure_semantic_vad_en" + AZURE_SEMANTIC_VAD_MULTILINGUAL = "azure_semantic_vad_multilingual" + SEMANTIC_VAD = "semantic_vad" + SERVER_VAD = "server_vad" - @distributed_trace - def download_session_file( - self, - agent_name: str, - session_id: str, - *, - path: str, - **kwargs: Any - ) -> Iterator[bytes]: ... - @distributed_trace - def enable( - self, - agent_name: str, - **kwargs: Any - ) -> None: ... + class azure.ai.projects.models.VoiceAgentWebSocketSubprotocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + REALTIME = "realtime" - @overload - def generate_agent( - self, - *, - content_type: str = "application/json", - kind: Union[str, AgentKind], - **kwargs: Any - ) -> AgentDetails: ... - @overload - def generate_agent( - self, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AgentDetails: ... + class azure.ai.projects.models.VoiceAudioCodec(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PCM16 = "pcm16" + PCMA = "pcma" + PCMU = "pcmu" - @overload - def generate_agent( - self, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AgentDetails: ... - @distributed_trace - def get( - self, - agent_name: str, - **kwargs: Any - ) -> AgentDetails: ... + class azure.ai.projects.models.VoiceAudioContainerFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): + WAV = "wav" - @distributed_trace - def get_session( - self, - agent_name: str, - session_id: str, - **kwargs: Any - ) -> AgentSessionResource: ... - @distributed_trace - def get_session_log_stream( - self, - agent_name: str, - agent_version: str, - session_id: str, - **kwargs: Any - ) -> SessionLogEvent: ... + class azure.ai.projects.models.VoiceAudioRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT = "agent" + USER = "user" - @distributed_trace - def get_version( - self, - agent_name: str, - agent_version: str, - **kwargs: Any - ) -> AgentVersionDetails: ... - @distributed_trace - def list( - self, - *, - before: Optional[str] = ..., - kind: Optional[Union[str, AgentKind]] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> ItemPaged[AgentDetails]: ... + class azure.ai.projects.models.VoiceConversation(_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[RealtimeResponseUsage] - @distributed_trace - def list_session_files( + @overload + def __init__( self, - agent_name: str, - session_id: str, *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - path: Optional[str] = ..., - **kwargs: Any - ) -> ItemPaged[SessionDirectoryEntry]: ... + completed_at: Optional[datetime] = ..., + created_at: datetime, + id: str, + last_error: Optional[ApiError] = ..., + metadata: Optional[dict[str, str]] = ..., + status: Union[str, VoiceConversationStatus], + usage: Optional[RealtimeResponseUsage] = ... + ) -> None: ... - @distributed_trace - def list_sessions( - self, - agent_name: str, - *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> ItemPaged[AgentSessionResource]: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def list_versions( - self, - agent_name: str, - *, - before: Optional[str] = ..., - include_drafts: Optional[bool] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> ItemPaged[AgentVersionDetails]: ... - @distributed_trace - def stop_session( - self, - agent_name: str, - session_id: str, - **kwargs: Any - ) -> None: ... + class azure.ai.projects.models.VoiceConversationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMPLETED = "completed" + FAILED = "failed" + IN_PROGRESS = "in_progress" - @overload - def update_details( - self, - agent_name: str, - *, - agent_card: Optional[AgentCard] = ..., - agent_endpoint: Optional[AgentEndpointConfig] = ..., - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> AgentDetails: ... - @overload - def update_details( - self, - agent_name: str, - body: JSON, - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> AgentDetails: ... + class azure.ai.projects.models.VoiceItemAudioResponse(_Model): + blob_uri: Optional[str] + channels: Optional[int] + codec: Optional[Union[str, VoiceAudioCodec]] + conversation_id: str + duration_ms: Optional[timedelta] + format: Optional[Union[str, VoiceAudioContainerFormat]] + item_id: str + role: Optional[Union[str, VoiceAudioRole]] + sample_rate: Optional[int] + start_offset_ms: Optional[timedelta] @overload - def update_details( + def __init__( self, - agent_name: str, - body: IO[bytes], *, - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> AgentDetails: ... + blob_uri: Optional[str] = ..., + channels: Optional[int] = ..., + codec: Optional[Union[str, VoiceAudioCodec]] = ..., + conversation_id: str, + duration_ms: Optional[timedelta] = ..., + format: Optional[Union[str, VoiceAudioContainerFormat]] = ..., + item_id: str, + role: Optional[Union[str, VoiceAudioRole]] = ..., + sample_rate: Optional[int] = ..., + start_offset_ms: Optional[timedelta] = ... + ) -> None: ... @overload - def upload_session_file( - self, - agent_name: str, - session_id: str, - content: bytes, - *, - content_type: str = "application/octet-stream", - path: str, - **kwargs: Any - ) -> SessionFileWriteResult: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @overload - def upload_session_file( - self, - agent_name: str, - session_id: str, - content: IO[bytes], - *, - content_type: str = "application/octet-stream", - path: str, - **kwargs: Any - ) -> SessionFileWriteResult: ... + + class azure.ai.projects.models.VoiceModelType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MANAGED = "managed" + SELF_DEPLOYED = "self_deployed" - class azure.ai.projects.operations.BetaAgentsOperations(BetaAgentsOperationsGenerated): + class azure.ai.projects.models.VoiceOutputModality(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ANIMATION = "animation" + AUDIO = "audio" + AVATAR = "avatar" + TEXT = "text" + + + class azure.ai.projects.models.VoiceRecordingChannelLayout(_Model): + left: Literal["user"] + right: Literal["agent"] def __init__( self, - *args, - **kwargs + *args: Any, + **kwargs: Any ) -> None: ... + + class azure.ai.projects.models.VoiceRecordingResponse(_Model): + blob_uri: Optional[str] + channel_layout: VoiceRecordingChannelLayout + channels: int + conversation_id: str + duration_ms: timedelta + format: Union[str, VoiceAudioContainerFormat] + sample_rate: int + @overload - def begin_create_optimization_job( + def __init__( self, - job: AgentOptimizationJob, *, - content_type: str = "application/json", - operation_id: Optional[str] = ..., - **kwargs: Any - ) -> AgentOptimizationLROPoller: ... + blob_uri: Optional[str] = ..., + channel_layout: VoiceRecordingChannelLayout, + channels: int, + conversation_id: str, + duration_ms: timedelta, + format: Union[str, VoiceAudioContainerFormat], + sample_rate: int + ) -> None: ... @overload - def begin_create_optimization_job( - self, - job: JSON, - *, - content_type: str = "application/json", - operation_id: Optional[str] = ..., - **kwargs: Any - ) -> AgentOptimizationLROPoller: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceResponse(VoiceResponseBase): + audio: Optional[VoiceResponseAudio] + completed_at: Optional[datetime] + conversation_id: str + created_at: Optional[datetime] + id: str + max_output_tokens: Union[int, str] + metadata: Optional[dict[str, str]] + object: str + output: Optional[list[RealtimeConversationItem]] + output_modalities: Union[list[str, str]] + status: Union[str, str, str, str, str] + status_details: RealtimeResponseStatusDetails + temperature: Optional[float] + usage: RealtimeResponseUsage @overload - def begin_create_optimization_job( + def __init__( self, - job: IO[bytes], *, - content_type: str = "application/json", - operation_id: Optional[str] = ..., - **kwargs: Any - ) -> AgentOptimizationLROPoller: ... + audio: Optional[VoiceResponseAudio] = ..., + completed_at: Optional[datetime] = ..., + conversation_id: str, + created_at: Optional[datetime] = ..., + id: str, + max_output_tokens: Optional[Union[int, Literal[inf]]] = ..., + metadata: Optional[dict[str, str]] = ..., + object: Optional[Literal[response]] = ..., + output: Optional[list[RealtimeConversationItem]] = ..., + output_modalities: Optional[list[Literal[text, audio]]] = ..., + status: Optional[Literal[completed, cancelled, failed, incomplete, in_progress]] = ..., + status_details: Optional[RealtimeResponseStatusDetails] = ..., + temperature: Optional[float] = ..., + usage: Optional[RealtimeResponseUsage] = ... + ) -> None: ... - @distributed_trace - def cancel_optimization_job( - self, - job_id: str, - **kwargs: Any - ) -> AgentOptimizationJob: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def delete_optimization_job( - self, - job_id: str, - **kwargs: Any - ) -> None: ... - @distributed_trace - def get_optimization_job( - self, - job_id: str, - **kwargs: Any - ) -> AgentOptimizationJob: ... + class azure.ai.projects.models.VoiceResponseAudio(_Model): + output: Optional[VoiceResponseAudioOutput] - @distributed_trace - def list_optimization_jobs( + @overload + def __init__( self, *, - agent_name: Optional[str] = ..., - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - status: Optional[Union[str, JobStatus]] = ..., - **kwargs: Any - ) -> ItemPaged[AgentOptimizationJobListItem]: ... + output: Optional[VoiceResponseAudioOutput] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.operations.BetaDatasetsOperations(BetaDatasetsOperationsGenerated): + class azure.ai.projects.models.VoiceResponseAudioOutput(_Model): + format: Optional[RealtimeAudioFormats] + voice: Optional[str] + voice_locale: Optional[str] + voice_type: Optional[Union[str, VoiceType]] + @overload def __init__( self, - *args, - **kwargs + *, + format: Optional[RealtimeAudioFormats] = ..., + voice: Optional[str] = ..., + voice_locale: Optional[str] = ..., + voice_type: Optional[Union[str, VoiceType]] = ... ) -> None: ... @overload - def begin_create_generation_job( - self, - job: DataGenerationJob, - *, - content_type: str = "application/json", - operation_id: Optional[str] = ..., - **kwargs: Any - ) -> DatasetGenerationLROPoller: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceResponseBase(_Model): + conversation_id: Optional[str] + id: Optional[str] + max_output_tokens: Optional[Union[int, Literal["inf"]]] + object: Optional[Literal["response"]] + output_modalities: Optional[list[Literal["text", "audio"]]] + status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] + status_details: Optional[RealtimeResponseStatusDetails] + usage: Optional[RealtimeResponseUsage] @overload - def begin_create_generation_job( + def __init__( self, - job: JSON, *, - content_type: str = "application/json", - operation_id: Optional[str] = ..., - **kwargs: Any - ) -> DatasetGenerationLROPoller: ... + conversation_id: Optional[str] = ..., + id: Optional[str] = ..., + max_output_tokens: Optional[Union[int, Literal[inf]]] = ..., + object: Optional[Literal[response]] = ..., + output_modalities: Optional[list[Literal[text, audio]]] = ..., + status: Optional[Literal[completed, cancelled, failed, incomplete, in_progress]] = ..., + status_details: Optional[RealtimeResponseStatusDetails] = ..., + usage: Optional[RealtimeResponseUsage] = ... + ) -> None: ... @overload - def begin_create_generation_job( - self, - job: IO[bytes], - *, - content_type: str = "application/json", - operation_id: Optional[str] = ..., - **kwargs: Any - ) -> DatasetGenerationLROPoller: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def cancel_generation_job( - self, - job_id: str, - **kwargs: Any - ) -> DataGenerationJob: ... - @distributed_trace - def delete_generation_job( - self, - job_id: str, - **kwargs: Any - ) -> None: ... + class azure.ai.projects.models.VoiceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AVATAR_VOICE_SYNC = "avatar-voice-sync" + AZURE_CUSTOM = "azure-custom" + AZURE_PERSONAL = "azure-personal" + AZURE_REALTIME_NATIVE = "azure-realtime-native" + AZURE_STANDARD = "azure-standard" + OPENAI = "openai" - @distributed_trace - def get_generation_job( - self, - job_id: str, - **kwargs: Any - ) -> DataGenerationJob: ... - @distributed_trace - def list_generation_jobs( + class azure.ai.projects.models.WebIQPreviewTool(Tool, discriminator='web_iq_preview'): + project_connection_id: str + require_approval: Optional[Union[MCPToolRequireApproval, str]] + server_label: Optional[str] + type: Literal[ToolType.WEB_IQ_PREVIEW] + + @overload + def __init__( self, *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> ItemPaged[DataGenerationJob]: ... + project_connection_id: str, + require_approval: Optional[Union[MCPToolRequireApproval, str]] = ..., + server_label: Optional[str] = ... + ) -> None: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.operations.BetaEvaluationTaxonomiesOperations: + class azure.ai.projects.models.WebIQPreviewToolboxTool(ToolboxTool, discriminator='web_iq_preview'): + description: str + name: str + project_connection_id: str + require_approval: Optional[Union[MCPToolRequireApproval, str]] + server_label: Optional[str] + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.WEB_IQ_PREVIEW] + + @overload def __init__( self, - *args, - **kwargs + *, + description: Optional[str] = ..., + name: Optional[str] = ..., + project_connection_id: str, + require_approval: Optional[Union[MCPToolRequireApproval, str]] = ..., + server_label: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... ) -> None: ... @overload - def create( - self, - name: str, - taxonomy: EvaluationTaxonomy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> EvaluationTaxonomy: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.WebSearchApproximateLocation(_Model): + city: Optional[str] + country: Optional[str] + region: Optional[str] + timezone: Optional[str] + type: Literal["approximate"] @overload - def create( + def __init__( self, - name: str, - taxonomy: JSON, *, - content_type: str = "application/json", - **kwargs: Any - ) -> EvaluationTaxonomy: ... + city: Optional[str] = ..., + country: Optional[str] = ..., + region: Optional[str] = ..., + timezone: Optional[str] = ... + ) -> None: ... @overload - def create( - self, - name: str, - taxonomy: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> EvaluationTaxonomy: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def delete( - self, - name: str, - **kwargs: Any - ) -> None: ... - @distributed_trace - def get( - self, - name: str, - **kwargs: Any - ) -> EvaluationTaxonomy: ... + class azure.ai.projects.models.WebSearchConfiguration(_Model): + instance_name: str + project_connection_id: str - @distributed_trace - def list( + @overload + def __init__( self, *, - input_name: Optional[str] = ..., - input_type: Optional[str] = ..., - **kwargs: Any - ) -> ItemPaged[EvaluationTaxonomy]: ... + instance_name: str, + project_connection_id: str + ) -> None: ... @overload - def update( - self, - name: str, - taxonomy: EvaluationTaxonomy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> EvaluationTaxonomy: ... + 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 update( + def __init__( self, - name: str, - taxonomy: JSON, *, - content_type: str = "application/json", - **kwargs: Any - ) -> EvaluationTaxonomy: ... + search_content_types: Optional[list[Union[str, SearchContentType]]] = ..., + search_context_size: Optional[Union[str, SearchContextSize]] = ..., + user_location: Optional[ApproximateLocation] = ... + ) -> None: ... @overload - def update( - self, - name: str, - taxonomy: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> EvaluationTaxonomy: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.operations.BetaEvaluatorsOperations(BetaEvaluatorsOperationsGenerated): + class azure.ai.projects.models.WebSearchTool(Tool, discriminator='web_search'): + custom_search_configuration: Optional[WebSearchConfiguration] + description: Optional[str] + 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, - *args, - **kwargs + *, + custom_search_configuration: Optional[WebSearchConfiguration] = ..., + description: Optional[str] = ..., + 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 begin_create_generation_job( - self, - job: EvaluatorGenerationJob, - *, - content_type: str = "application/json", - operation_id: Optional[str] = ..., - **kwargs: Any - ) -> EvaluatorGenerationLROPoller: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.WebSearchToolFilters(_Model): + allowed_domains: Optional[list[str]] @overload - def begin_create_generation_job( + def __init__( self, - job: JSON, *, - content_type: str = "application/json", - operation_id: Optional[str] = ..., - **kwargs: Any - ) -> EvaluatorGenerationLROPoller: ... + allowed_domains: Optional[list[str]] = ... + ) -> None: ... @overload - def begin_create_generation_job( - self, - job: IO[bytes], - *, - content_type: str = "application/json", - operation_id: Optional[str] = ..., - **kwargs: Any - ) -> EvaluatorGenerationLROPoller: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @distributed_trace - def cancel_generation_job( - self, - job_id: str, - **kwargs: Any - ) -> EvaluatorGenerationJob: ... - @overload - def create_version( + class azure.ai.projects.models.WebSearchToolboxTool(ToolboxTool, discriminator='web_search'): + custom_search_configuration: Optional[WebSearchConfiguration] + description: str + filters: Optional[WebSearchToolFilters] + name: str + search_context_size: Optional[Literal["low", "medium", "high"]] + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.WEB_SEARCH] + user_location: Optional[WebSearchApproximateLocation] + + @overload + def __init__( self, - name: str, - evaluator_version: EvaluatorVersion, *, - content_type: str = "application/json", - **kwargs: Any - ) -> EvaluatorVersion: ... + custom_search_configuration: Optional[WebSearchConfiguration] = ..., + description: Optional[str] = ..., + 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 create_version( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.WeeklyRecurrenceSchedule(RecurrenceSchedule, discriminator='Weekly'): + days_of_week: list[Union[str, DayOfWeek]] + type: Literal[RecurrenceType.WEEKLY] + + @overload + def __init__( self, - name: str, - evaluator_version: JSON, *, - content_type: str = "application/json", - **kwargs: Any - ) -> EvaluatorVersion: ... + days_of_week: list[Union[str, DayOfWeek]] + ) -> None: ... @overload - def create_version( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.WorkIQPreviewTool(Tool, discriminator='work_iq_preview'): + project_connection_id: str + type: Literal[ToolType.WORK_IQ_PREVIEW] + + @overload + def __init__( self, - name: str, - evaluator_version: IO[bytes], *, - content_type: str = "application/json", - **kwargs: Any - ) -> EvaluatorVersion: ... + project_connection_id: str + ) -> None: ... - @distributed_trace - def delete_generation_job( + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.WorkIQPreviewToolboxTool(ToolboxTool, discriminator='work_iq_preview'): + description: str + name: str + project_connection_id: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.WORK_IQ_PREVIEW] + + @overload + def __init__( self, - job_id: str, - **kwargs: Any + *, + description: Optional[str] = ..., + name: Optional[str] = ..., + project_connection_id: str, + tool_configs: Optional[dict[str, ToolConfig]] = ... ) -> None: ... - @distributed_trace - def delete_version( + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.WorkflowAgentDefinition(AgentDefinition, discriminator='workflow'): + kind: Literal[AgentKind.WORKFLOW] + rai_config: RaiConfig + workflow: Optional[str] + + @overload + def __init__( self, - name: str, - version: str, - **kwargs: Any + *, + rai_config: Optional[RaiConfig] = ..., + workflow: Optional[str] = ... ) -> None: ... @overload - def get_credentials( + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + +namespace azure.ai.projects.operations + + class azure.ai.projects.operations.AgentsOperations(GeneratedAgentsOperations): + + def __init__( self, - name: str, - version: str, - credential_request: EvaluatorCredentialRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> DatasetCredential: ... + *args, + **kwargs + ) -> None: ... @overload - def get_credentials( + def create_session( self, - name: str, - version: str, - credential_request: JSON, + agent_name: str, *, + agent_session_id: Optional[str] = ..., content_type: str = "application/json", + version_indicator: VersionIndicator, **kwargs: Any - ) -> DatasetCredential: ... + ) -> AgentSessionResource: ... @overload - def get_credentials( + def create_session( self, - name: str, - version: str, - credential_request: IO[bytes], + agent_name: str, + body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> DatasetCredential: ... + ) -> AgentSessionResource: ... - @distributed_trace - def get_generation_job( + @overload + def create_session( self, - job_id: str, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", **kwargs: Any - ) -> EvaluatorGenerationJob: ... + ) -> AgentSessionResource: ... - @distributed_trace - def get_version( + @overload + def create_version( self, - name: str, - version: str, + agent_name: str, + *, + blueprint_reference: Optional[AgentBlueprintReference] = ..., + content_type: str = "application/json", + definition: AgentDefinition, + description: Optional[str] = ..., + draft: Optional[bool] = ..., + metadata: Optional[dict[str, str]] = ..., **kwargs: Any - ) -> EvaluatorVersion: ... + ) -> AgentVersionDetails: ... - @distributed_trace - def list( + @overload + def create_version( self, + agent_name: str, + body: JSON, *, - limit: Optional[int] = ..., - type: Optional[Union[Literal[builtin], Literal[custom], Literal[all], str]] = ..., + content_type: str = "application/json", **kwargs: Any - ) -> ItemPaged[EvaluatorVersion]: ... + ) -> AgentVersionDetails: ... - @distributed_trace - def list_generation_jobs( + @overload + def create_version( self, + agent_name: str, + body: IO[bytes], *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., + content_type: str = "application/json", **kwargs: Any - ) -> ItemPaged[EvaluatorGenerationJob]: ... + ) -> AgentVersionDetails: ... @distributed_trace - def list_versions( + def create_version_from_code( self, - name: str, + agent_name: str, *, - limit: Optional[int] = ..., - type: Optional[Union[Literal[builtin], Literal[custom], Literal[all], str]] = ..., + code: IO[bytes], + code_zip_sha256: Optional[str] = ..., + definition: HostedAgentDefinition, + description: Optional[str] = ..., + metadata: Optional[dict[str, str]] = ..., **kwargs: Any - ) -> ItemPaged[EvaluatorVersion]: ... + ) -> AgentVersionDetails: ... @overload - def pending_upload( + def create_version_from_manifest( self, - name: str, - version: str, - pending_upload_request: PendingUploadRequest, + agent_name: str, *, content_type: str = "application/json", + description: Optional[str] = ..., + manifest_id: str, + metadata: Optional[dict[str, str]] = ..., + parameter_values: dict[str, Any], **kwargs: Any - ) -> PendingUploadResponse: ... + ) -> AgentVersionDetails: ... @overload - def pending_upload( + def create_version_from_manifest( self, - name: str, - version: str, - pending_upload_request: JSON, + agent_name: str, + body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> PendingUploadResponse: ... + ) -> AgentVersionDetails: ... @overload - def pending_upload( + def create_version_from_manifest( self, - name: str, - version: str, - pending_upload_request: IO[bytes], + agent_name: str, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> PendingUploadResponse: ... + ) -> AgentVersionDetails: ... - @overload - def update_version( + @distributed_trace + def delete( self, - name: str, - version: str, - evaluator_version: EvaluatorVersion, + agent_name: str, *, - content_type: str = "application/json", + force: Optional[bool] = ..., **kwargs: Any - ) -> EvaluatorVersion: ... + ) -> DeleteAgentResponse: ... - @overload - def update_version( + @distributed_trace + def delete_session( self, - name: str, - version: str, - evaluator_version: JSON, - *, - content_type: str = "application/json", + agent_name: str, + session_id: str, **kwargs: Any - ) -> EvaluatorVersion: ... + ) -> None: ... - @overload - def update_version( + @distributed_trace + def delete_session_file( self, - name: str, - version: str, - evaluator_version: IO[bytes], + agent_name: str, + session_id: str, *, - content_type: str = "application/json", + path: str, + recursive: Optional[bool] = ..., **kwargs: Any - ) -> EvaluatorVersion: ... - - - class azure.ai.projects.operations.BetaInsightsOperations: - - def __init__( - self, - *args, - **kwargs ) -> None: ... - @overload - def generate( + @distributed_trace + def delete_version( self, - insight: Insight, + agent_name: str, + agent_version: str, *, - content_type: str = "application/json", + force: Optional[bool] = ..., **kwargs: Any - ) -> Insight: ... + ) -> DeleteAgentVersionResponse: ... - @overload - def generate( + @distributed_trace + def disable( self, - insight: JSON, - *, - content_type: str = "application/json", + agent_name: str, **kwargs: Any - ) -> Insight: ... + ) -> None: ... - @overload - def generate( + @distributed_trace + def download_code( self, - insight: IO[bytes], + agent_name: str, *, - content_type: str = "application/json", + agent_version: Optional[str] = ..., **kwargs: Any - ) -> Insight: ... + ) -> Iterator[bytes]: ... @distributed_trace - def get( + def download_session_file( self, - insight_id: str, + agent_name: str, + session_id: str, *, - include_coordinates: Optional[bool] = ..., + path: str, **kwargs: Any - ) -> Insight: ... + ) -> Iterator[bytes]: ... @distributed_trace - def list( + def enable( self, - *, - agent_name: Optional[str] = ..., - eval_id: Optional[str] = ..., - include_coordinates: Optional[bool] = ..., - run_id: Optional[str] = ..., - type: Optional[Union[str, InsightType]] = ..., + agent_name: str, **kwargs: Any - ) -> ItemPaged[Insight]: ... - + ) -> None: ... - class azure.ai.projects.operations.BetaMemoryStoresOperations(GenerateBetaMemoryStoresOperations): + @distributed_trace + def generate_agent( + self, + body: GenerateVoiceAgentRequest, + **kwargs: Any + ) -> AgentDetails: ... - def __init__( + @distributed_trace + def get( self, - *args, - **kwargs - ) -> None: ... + agent_name: str, + **kwargs: Any + ) -> AgentDetails: ... @overload - def begin_update_memories( + def get_microsoft365_package( self, - name: str, + agent_name: str, *, + access_boundaries: Optional[List[Union[str, ActivityProtocolAccessBoundary]]] = ..., + agent_display_name: Optional[str] = ..., + app_version: Optional[str] = ..., + bot_service_arm_id: Optional[str] = ..., + can_respond_without_mention: Optional[bool] = ..., + color_icon_base64: Optional[str] = ..., content_type: str = "application/json", - items: Optional[Union[str, ResponseInputParam]] = ..., - previous_update_id: Optional[str] = ..., - scope: str, - update_delay: Optional[int] = ..., + developer_name: Optional[str] = ..., + developer_website_url: Optional[str] = ..., + full_description: Optional[str] = ..., + optional_permission_scopes: Optional[List[Microsoft365PermissionScopes]] = ..., + outline_icon_base64: Optional[str] = ..., + privacy_url: Optional[str] = ..., + publish_as_autopilot: Optional[bool] = ..., + publish_scope: Union[str, Microsoft365PublishScope], + short_description: Optional[str] = ..., + terms_of_use_url: Optional[str] = ..., **kwargs: Any - ) -> UpdateMemoriesLROPoller: ... + ) -> Iterator[bytes]: ... @overload - def begin_update_memories( + def get_microsoft365_package( self, - name: str, + agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> UpdateMemoriesLROPoller: ... + ) -> Iterator[bytes]: ... @overload - def begin_update_memories( + def get_microsoft365_package( self, - name: str, + agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> UpdateMemoriesLROPoller: ... + ) -> Iterator[bytes]: ... - @overload - def create( + @distributed_trace + def get_microsoft365_publish_defaults( self, + agent_name: str, *, - content_type: str = "application/json", - definition: MemoryStoreDefinition, - description: Optional[str] = ..., - metadata: Optional[dict[str, str]] = ..., - name: str, + publish_as_digital_worker: Optional[bool] = ..., **kwargs: Any - ) -> MemoryStoreDetails: ... + ) -> Microsoft365PublishDefaults: ... - @overload - def create( + @distributed_trace + def get_session( self, - body: JSON, - *, - content_type: str = "application/json", + agent_name: str, + session_id: str, **kwargs: Any - ) -> MemoryStoreDetails: ... + ) -> AgentSessionResource: ... - @overload - def create( + @distributed_trace + def get_session_log_stream( self, - body: IO[bytes], - *, - content_type: str = "application/json", + agent_name: str, + agent_version: str, + session_id: str, **kwargs: Any - ) -> MemoryStoreDetails: ... + ) -> SessionLogEvent: ... - @overload - def create_memory( + @distributed_trace + def get_version( self, - name: str, - *, - content: str, - content_type: str = "application/json", - kind: Union[str, MemoryItemKind], - scope: str, + agent_name: str, + agent_version: str, **kwargs: Any - ) -> MemoryItem: ... + ) -> AgentVersionDetails: ... - @overload - def create_memory( + @distributed_trace + def list( self, - name: str, - body: JSON, *, - content_type: str = "application/json", + before: Optional[str] = ..., + kind: Optional[Union[str, AgentKind]] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., **kwargs: Any - ) -> MemoryItem: ... + ) -> ItemPaged[AgentDetails]: ... - @overload - def create_memory( + @distributed_trace + def list_session_files( self, - name: str, - body: IO[bytes], + agent_name: str, + session_id: str, *, - content_type: str = "application/json", + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + path: Optional[str] = ..., **kwargs: Any - ) -> MemoryItem: ... + ) -> ItemPaged[SessionDirectoryEntry]: ... @distributed_trace - def delete( + def list_sessions( self, - name: str, + agent_name: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., **kwargs: Any - ) -> DeleteMemoryStoreResult: ... + ) -> ItemPaged[AgentSessionResource]: ... @distributed_trace - def delete_memory( + def list_versions( self, - name: str, - memory_id: str, + agent_name: str, + *, + before: Optional[str] = ..., + include_drafts: Optional[bool] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., **kwargs: Any - ) -> DeleteMemoryResult: ... + ) -> ItemPaged[AgentVersionDetails]: ... @overload - def delete_scope( + def publish_to_microsoft365( self, - name: str, + agent_name: str, *, + access_boundaries: Optional[List[Union[str, ActivityProtocolAccessBoundary]]] = ..., + agent_display_name: Optional[str] = ..., + app_version: Optional[str] = ..., + bot_service_arm_id: Optional[str] = ..., + can_respond_without_mention: Optional[bool] = ..., + color_icon_base64: Optional[str] = ..., content_type: str = "application/json", - scope: str, + developer_name: Optional[str] = ..., + developer_website_url: Optional[str] = ..., + full_description: Optional[str] = ..., + optional_permission_scopes: Optional[List[Microsoft365PermissionScopes]] = ..., + outline_icon_base64: Optional[str] = ..., + privacy_url: Optional[str] = ..., + publish_as_autopilot: Optional[bool] = ..., + publish_scope: Union[str, Microsoft365PublishScope], + short_description: Optional[str] = ..., + terms_of_use_url: Optional[str] = ..., **kwargs: Any - ) -> MemoryStoreDeleteScopeResult: ... + ) -> Microsoft365PublishResult: ... @overload - def delete_scope( + def publish_to_microsoft365( self, - name: str, + agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> MemoryStoreDeleteScopeResult: ... + ) -> Microsoft365PublishResult: ... @overload - def delete_scope( + def publish_to_microsoft365( self, - name: str, + agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> MemoryStoreDeleteScopeResult: ... + ) -> Microsoft365PublishResult: ... @distributed_trace - def get( + def stop_session( self, - name: str, + agent_name: str, + session_id: str, **kwargs: Any - ) -> MemoryStoreDetails: ... + ) -> None: ... - @distributed_trace - def get_memory( + @overload + def update_details( self, - name: str, - memory_id: str, + agent_name: str, + *, + agent_card: Optional[AgentCard] = ..., + agent_endpoint: Optional[AgentEndpointConfig] = ..., + content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> MemoryItem: ... + ) -> AgentDetails: ... - @distributed_trace - def list( + @overload + def update_details( self, + agent_name: str, + body: JSON, *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., + content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> ItemPaged[MemoryStoreDetails]: ... + ) -> AgentDetails: ... @overload - def list_memories( + def update_details( self, - name: str, + agent_name: str, + body: IO[bytes], *, - before: Optional[str] = ..., - content_type: str = "application/json", - kind: Optional[Union[str, MemoryItemKind]] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - scope: str, + content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> ItemPaged[MemoryItem]: ... + ) -> AgentDetails: ... @overload - def list_memories( + def upload_session_file( self, - name: str, - body: JSON, + agent_name: str, + session_id: str, + content: bytes, *, - before: Optional[str] = ..., - content_type: str = "application/json", - kind: Optional[Union[str, MemoryItemKind]] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., + content_type: str = "application/octet-stream", + path: str, **kwargs: Any - ) -> ItemPaged[MemoryItem]: ... + ) -> SessionFileWriteResult: ... @overload - def list_memories( + def upload_session_file( self, - name: str, - body: IO[bytes], + agent_name: str, + session_id: str, + content: IO[bytes], *, - before: Optional[str] = ..., - content_type: str = "application/json", - kind: Optional[Union[str, MemoryItemKind]] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., + content_type: str = "application/octet-stream", + path: str, **kwargs: Any - ) -> ItemPaged[MemoryItem]: ... + ) -> SessionFileWriteResult: ... + + + class azure.ai.projects.operations.BetaAgentsOperations(BetaAgentsOperationsGenerated): + + def __init__( + self, + *args, + **kwargs + ) -> None: ... @overload - def search_memories( + def begin_create_optimization_job( self, - name: str, + job: AgentOptimizationJob, *, content_type: str = "application/json", - items: Optional[Union[str, ResponseInputParam]] = ..., - options: Optional[MemorySearchOptions] = ..., - previous_search_id: Optional[str] = ..., - scope: str, + operation_id: Optional[str] = ..., **kwargs: Any - ) -> MemoryStoreSearchResult: ... + ) -> AgentOptimizationLROPoller: ... @overload - def search_memories( + def begin_create_optimization_job( self, - name: str, - body: JSON, + job: JSON, *, content_type: str = "application/json", + operation_id: Optional[str] = ..., **kwargs: Any - ) -> MemoryStoreSearchResult: ... + ) -> AgentOptimizationLROPoller: ... @overload - def search_memories( + def begin_create_optimization_job( self, - name: str, - body: IO[bytes], + job: IO[bytes], *, content_type: str = "application/json", + operation_id: Optional[str] = ..., **kwargs: Any - ) -> MemoryStoreSearchResult: ... + ) -> AgentOptimizationLROPoller: ... - @overload - def update( + @distributed_trace + def cancel_optimization_job( self, - name: str, - *, - content_type: str = "application/json", - description: Optional[str] = ..., - metadata: Optional[dict[str, str]] = ..., + job_id: str, **kwargs: Any - ) -> MemoryStoreDetails: ... + ) -> AgentOptimizationJob: ... - @overload - def update( + @distributed_trace + def delete_optimization_job( + self, + job_id: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get_optimization_job( + self, + job_id: str, + **kwargs: Any + ) -> AgentOptimizationJob: ... + + @distributed_trace + def list_optimization_jobs( self, - name: str, - body: JSON, *, - content_type: str = "application/json", + agent_name: Optional[str] = ..., + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + status: Optional[Union[str, JobStatus]] = ..., **kwargs: Any - ) -> MemoryStoreDetails: ... + ) -> ItemPaged[AgentOptimizationJobListItem]: ... + + + class azure.ai.projects.operations.BetaDatasetsOperations(BetaDatasetsOperationsGenerated): + + def __init__( + self, + *args, + **kwargs + ) -> None: ... @overload - def update( + def begin_create_generation_job( self, - name: str, - body: IO[bytes], + job: DataGenerationJob, *, content_type: str = "application/json", + operation_id: Optional[str] = ..., **kwargs: Any - ) -> MemoryStoreDetails: ... + ) -> DatasetGenerationLROPoller: ... @overload - def update_memory( + def begin_create_generation_job( self, - name: str, - memory_id: str, + job: JSON, *, - content: str, content_type: str = "application/json", + operation_id: Optional[str] = ..., **kwargs: Any - ) -> MemoryItem: ... + ) -> DatasetGenerationLROPoller: ... @overload - def update_memory( + def begin_create_generation_job( self, - name: str, - memory_id: str, - body: JSON, + job: IO[bytes], *, content_type: str = "application/json", + operation_id: Optional[str] = ..., **kwargs: Any - ) -> MemoryItem: ... + ) -> DatasetGenerationLROPoller: ... - @overload - def update_memory( + @distributed_trace + def cancel_generation_job( + self, + job_id: str, + **kwargs: Any + ) -> DataGenerationJob: ... + + @distributed_trace + def delete_generation_job( + self, + job_id: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get_generation_job( + self, + job_id: str, + **kwargs: Any + ) -> DataGenerationJob: ... + + @distributed_trace + def list_generation_jobs( self, - name: str, - memory_id: str, - body: IO[bytes], *, - content_type: str = "application/json", + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., **kwargs: Any - ) -> MemoryItem: ... + ) -> ItemPaged[DataGenerationJob]: ... - class azure.ai.projects.operations.BetaModelsOperations(BetaModelsOperationsGenerated): + class azure.ai.projects.operations.BetaEvaluationTaxonomiesOperations: def __init__( self, @@ -15337,44 +14781,37 @@ namespace azure.ai.projects.operations @overload def create( self, - *, - azcopy_path: Optional[str] = ..., - base_model: Optional[str] = ..., - description: Optional[str] = ..., name: str, - polling_interval: float = 2.0, - polling_timeout: float = 300.0, - source: Union[str, PathLike[str]], - tags: Optional[dict[str, str]] = ..., - version: str, - wait_for_commit: Literal[True] = True, - weight_type: Optional[str] = ..., + taxonomy: EvaluationTaxonomy, + *, + content_type: str = "application/json", **kwargs: Any - ) -> ModelVersion: ... + ) -> EvaluationTaxonomy: ... @overload def create( self, + name: str, + taxonomy: JSON, *, - azcopy_path: Optional[str] = ..., - base_model: Optional[str] = ..., - description: Optional[str] = ..., + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationTaxonomy: ... + + @overload + def create( + self, name: str, - polling_interval: float = 2.0, - polling_timeout: float = 300.0, - source: Union[str, PathLike[str]], - tags: Optional[dict[str, str]] = ..., - version: str, - wait_for_commit: Literal[False], - weight_type: Optional[str] = ..., + taxonomy: IO[bytes], + *, + content_type: str = "application/json", **kwargs: Any - ) -> None: ... + ) -> EvaluationTaxonomy: ... @distributed_trace def delete( self, name: str, - version: str, **kwargs: Any ) -> None: ... @@ -15382,96 +14819,226 @@ namespace azure.ai.projects.operations def get( self, name: str, - version: str, **kwargs: Any - ) -> ModelVersion: ... + ) -> EvaluationTaxonomy: ... - @overload - def get_credentials( + @distributed_trace + def list( self, - name: str, - version: str, - credential_request: ModelCredentialRequest, *, - content_type: str = "application/json", + input_name: Optional[str] = ..., + input_type: Optional[str] = ..., **kwargs: Any - ) -> DatasetCredential: ... + ) -> ItemPaged[EvaluationTaxonomy]: ... @overload - def get_credentials( + def update( self, name: str, - version: str, - credential_request: JSON, + taxonomy: EvaluationTaxonomy, *, content_type: str = "application/json", **kwargs: Any - ) -> DatasetCredential: ... + ) -> EvaluationTaxonomy: ... @overload - def get_credentials( + def update( self, name: str, - version: str, - credential_request: IO[bytes], + taxonomy: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> DatasetCredential: ... + ) -> EvaluationTaxonomy: ... + + @overload + def update( + self, + name: str, + taxonomy: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationTaxonomy: ... + + + class azure.ai.projects.operations.BetaEvaluatorsOperations(BetaEvaluatorsOperationsGenerated): + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_generation_job( + self, + job: EvaluatorGenerationJob, + *, + content_type: str = "application/json", + operation_id: Optional[str] = ..., + **kwargs: Any + ) -> EvaluatorGenerationLROPoller: ... + + @overload + def begin_create_generation_job( + self, + job: JSON, + *, + content_type: str = "application/json", + operation_id: Optional[str] = ..., + **kwargs: Any + ) -> EvaluatorGenerationLROPoller: ... + + @overload + def begin_create_generation_job( + self, + job: IO[bytes], + *, + content_type: str = "application/json", + operation_id: Optional[str] = ..., + **kwargs: Any + ) -> EvaluatorGenerationLROPoller: ... @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged[ModelVersion]: ... + def cancel_generation_job( + self, + job_id: str, + **kwargs: Any + ) -> EvaluatorGenerationJob: ... + + @overload + def create_version( + self, + name: str, + evaluator_version: EvaluatorVersion, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluatorVersion: ... + + @overload + def create_version( + self, + name: str, + evaluator_version: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluatorVersion: ... + + @overload + def create_version( + self, + name: str, + evaluator_version: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluatorVersion: ... @distributed_trace - def list_versions( + def delete_generation_job( + self, + job_id: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def delete_version( self, name: str, + version: str, **kwargs: Any - ) -> ItemPaged[ModelVersion]: ... + ) -> None: ... @overload - def pending_create_version( + def get_credentials( self, name: str, version: str, - model_version: ModelVersion, + credential_request: EvaluatorCredentialRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> CreateAsyncResponse: ... + ) -> DatasetCredential: ... @overload - def pending_create_version( + def get_credentials( self, name: str, version: str, - model_version: JSON, + credential_request: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> CreateAsyncResponse: ... + ) -> DatasetCredential: ... @overload - def pending_create_version( + def get_credentials( self, name: str, version: str, - model_version: IO[bytes], + credential_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> CreateAsyncResponse: ... + ) -> DatasetCredential: ... + + @distributed_trace + def get_generation_job( + self, + job_id: str, + **kwargs: Any + ) -> EvaluatorGenerationJob: ... + + @distributed_trace + def get_version( + self, + name: str, + version: str, + **kwargs: Any + ) -> EvaluatorVersion: ... + + @distributed_trace + def list( + self, + *, + limit: Optional[int] = ..., + type: Optional[Union[Literal[builtin], Literal[custom], Literal[all], str]] = ..., + **kwargs: Any + ) -> ItemPaged[EvaluatorVersion]: ... + + @distributed_trace + def list_generation_jobs( + self, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[EvaluatorGenerationJob]: ... + + @distributed_trace + def list_versions( + self, + name: str, + *, + limit: Optional[int] = ..., + type: Optional[Union[Literal[builtin], Literal[custom], Literal[all], str]] = ..., + **kwargs: Any + ) -> ItemPaged[EvaluatorVersion]: ... @overload def pending_upload( self, name: str, version: str, - pending_upload_request: ModelPendingUploadRequest, + pending_upload_request: PendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> ModelPendingUploadResponse: ... + ) -> PendingUploadResponse: ... @overload def pending_upload( @@ -15482,7 +15049,7 @@ namespace azure.ai.projects.operations *, content_type: str = "application/json", **kwargs: Any - ) -> ModelPendingUploadResponse: ... + ) -> PendingUploadResponse: ... @overload def pending_upload( @@ -15493,63 +15060,43 @@ namespace azure.ai.projects.operations *, content_type: str = "application/json", **kwargs: Any - ) -> ModelPendingUploadResponse: ... + ) -> PendingUploadResponse: ... @overload - def update( + def update_version( self, name: str, version: str, - model_version_update: UpdateModelVersionRequest, + evaluator_version: EvaluatorVersion, *, - content_type: str = "application/merge-patch+json", + content_type: str = "application/json", **kwargs: Any - ) -> ModelVersion: ... + ) -> EvaluatorVersion: ... @overload - def update( + def update_version( self, name: str, version: str, - model_version_update: JSON, + evaluator_version: JSON, *, - content_type: str = "application/merge-patch+json", + content_type: str = "application/json", **kwargs: Any - ) -> ModelVersion: ... + ) -> EvaluatorVersion: ... @overload - def update( + def update_version( self, name: str, version: str, - model_version_update: IO[bytes], + evaluator_version: IO[bytes], *, - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> ModelVersion: ... - - - class azure.ai.projects.operations.BetaOperations(GeneratedBetaOperations): - agents: BetaAgentsOperations - datasets: BetaDatasetsOperations - evaluation_taxonomies: BetaEvaluationTaxonomiesOperations - evaluators: BetaEvaluatorsOperations - insights: BetaInsightsOperations - memory_stores: BetaMemoryStoresOperations - models: BetaModelsOperations - red_teams: BetaRedTeamsOperations - routines: BetaRoutinesOperations - schedules: BetaSchedulesOperations - skills: BetaSkillsOperations - - def __init__( - self, - *args: Any, + content_type: str = "application/json", **kwargs: Any - ) -> None: ... + ) -> EvaluatorVersion: ... - class azure.ai.projects.operations.BetaRedTeamsOperations: + class azure.ai.projects.operations.BetaInsightsOperations: def __init__( self, @@ -15558,44 +15105,55 @@ namespace azure.ai.projects.operations ) -> None: ... @overload - def create( + def generate( self, - red_team: RedTeam, + insight: Insight, *, content_type: str = "application/json", **kwargs: Any - ) -> RedTeam: ... + ) -> Insight: ... @overload - def create( + def generate( self, - red_team: JSON, + insight: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> RedTeam: ... + ) -> Insight: ... @overload - def create( + def generate( self, - red_team: IO[bytes], + insight: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> RedTeam: ... + ) -> Insight: ... @distributed_trace def get( self, - name: str, + insight_id: str, + *, + include_coordinates: Optional[bool] = ..., **kwargs: Any - ) -> RedTeam: ... + ) -> Insight: ... @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged[RedTeam]: ... + def list( + self, + *, + agent_name: Optional[str] = ..., + eval_id: Optional[str] = ..., + include_coordinates: Optional[bool] = ..., + run_id: Optional[str] = ..., + type: Optional[Union[str, InsightType]] = ..., + **kwargs: Any + ) -> ItemPaged[Insight]: ... - class azure.ai.projects.operations.BetaRoutinesOperations: + class azure.ai.projects.operations.BetaMemoryStoresOperations(GenerateBetaMemoryStoresOperations): def __init__( self, @@ -15604,352 +15162,311 @@ namespace azure.ai.projects.operations ) -> None: ... @overload - def create_or_update( + def begin_update_memories( self, - routine_name: str, + name: str, *, - action: Optional[RoutineAction] = ..., content_type: str = "application/json", - description: Optional[str] = ..., - enabled: Optional[bool] = ..., - triggers: Optional[dict[str, RoutineTrigger]] = ..., + items: Optional[Union[str, ResponseInputParam]] = ..., + previous_update_id: Optional[str] = ..., + scope: str, + update_delay: Optional[int] = ..., **kwargs: Any - ) -> Routine: ... + ) -> UpdateMemoriesLROPoller: ... @overload - def create_or_update( + def begin_update_memories( self, - routine_name: str, + name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> Routine: ... + ) -> UpdateMemoriesLROPoller: ... @overload - def create_or_update( + def begin_update_memories( self, - routine_name: str, + name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> Routine: ... - - @distributed_trace - def delete( - self, - routine_name: str, - **kwargs: Any - ) -> None: ... - - @distributed_trace - def disable( - self, - routine_name: str, - **kwargs: Any - ) -> Routine: ... + ) -> UpdateMemoriesLROPoller: ... @overload - def dispatch( + def create( self, - routine_name: str, *, content_type: str = "application/json", - payload: Optional[RoutineDispatchPayload] = ..., + definition: MemoryStoreDefinition, + description: Optional[str] = ..., + metadata: Optional[dict[str, str]] = ..., + name: str, **kwargs: Any - ) -> DispatchRoutineResult: ... + ) -> MemoryStoreDetails: ... @overload - def dispatch( + def create( self, - routine_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> DispatchRoutineResult: ... + ) -> MemoryStoreDetails: ... @overload - def dispatch( + def create( self, - routine_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> DispatchRoutineResult: ... + ) -> MemoryStoreDetails: ... - @distributed_trace - def enable( + @overload + def create_memory( self, - routine_name: str, + name: str, + *, + content: str, + content_type: str = "application/json", + kind: Union[str, MemoryItemKind], + scope: str, **kwargs: Any - ) -> Routine: ... + ) -> MemoryItem: ... - @distributed_trace - def get( + @overload + def create_memory( self, - routine_name: str, + name: str, + body: JSON, + *, + content_type: str = "application/json", **kwargs: Any - ) -> Routine: ... + ) -> MemoryItem: ... - @distributed_trace - def list( + @overload + def create_memory( self, + name: str, + body: IO[bytes], *, - after: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., + content_type: str = "application/json", **kwargs: Any - ) -> ItemPaged[Routine]: ... + ) -> MemoryItem: ... @distributed_trace - def list_runs( + def delete( self, - routine_name: str, - *, - after: Optional[str] = ..., - filter: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., + name: str, **kwargs: Any - ) -> ItemPaged[RoutineRun]: ... - - - class azure.ai.projects.operations.BetaSchedulesOperations: + ) -> DeleteMemoryStoreResult: ... - def __init__( + @distributed_trace + def delete_memory( self, - *args, - **kwargs - ) -> None: ... + name: str, + memory_id: str, + **kwargs: Any + ) -> DeleteMemoryResult: ... @overload - def create_or_update( + def delete_scope( self, - schedule_id: str, - schedule: Schedule, + name: str, *, content_type: str = "application/json", + scope: str, **kwargs: Any - ) -> Schedule: ... + ) -> MemoryStoreDeleteScopeResult: ... @overload - def create_or_update( + def delete_scope( self, - schedule_id: str, - schedule: JSON, + name: str, + body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> Schedule: ... + ) -> MemoryStoreDeleteScopeResult: ... @overload - def create_or_update( + def delete_scope( self, - schedule_id: str, - schedule: IO[bytes], + name: str, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> Schedule: ... - - @distributed_trace - def delete( - self, - schedule_id: str, - **kwargs: Any - ) -> None: ... + ) -> MemoryStoreDeleteScopeResult: ... @distributed_trace def get( self, - schedule_id: str, + name: str, **kwargs: Any - ) -> Schedule: ... + ) -> MemoryStoreDetails: ... @distributed_trace - def get_run( + def get_memory( self, - schedule_id: str, - run_id: str, + name: str, + memory_id: str, **kwargs: Any - ) -> ScheduleRun: ... + ) -> MemoryItem: ... @distributed_trace def list( self, *, - enabled: Optional[bool] = ..., - type: Optional[Union[str, ScheduleTaskType]] = ..., - **kwargs: Any - ) -> ItemPaged[Schedule]: ... - - @distributed_trace - def list_runs( - self, - schedule_id: str, - *, - enabled: Optional[bool] = ..., - type: Optional[Union[str, ScheduleTaskType]] = ..., + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., **kwargs: Any - ) -> ItemPaged[ScheduleRun]: ... - - - class azure.ai.projects.operations.BetaSkillsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... + ) -> ItemPaged[MemoryStoreDetails]: ... @overload - def create( + def list_memories( self, name: str, *, + before: Optional[str] = ..., content_type: str = "application/json", - default: Optional[bool] = ..., - inline_content: Optional[SkillInlineContent] = ..., + kind: Optional[Union[str, MemoryItemKind]] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + scope: str, **kwargs: Any - ) -> SkillVersion: ... + ) -> ItemPaged[MemoryItem]: ... @overload - def create( + def list_memories( self, name: str, body: JSON, *, + before: Optional[str] = ..., content_type: str = "application/json", + kind: Optional[Union[str, MemoryItemKind]] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., **kwargs: Any - ) -> SkillVersion: ... + ) -> ItemPaged[MemoryItem]: ... @overload - def create( + def list_memories( self, name: str, body: IO[bytes], *, + before: Optional[str] = ..., content_type: str = "application/json", + kind: Optional[Union[str, MemoryItemKind]] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., **kwargs: Any - ) -> SkillVersion: ... + ) -> ItemPaged[MemoryItem]: ... @overload - def create_from_files( + def search_memories( self, name: str, - content: CreateSkillVersionFromFilesBody, + *, + content_type: str = "application/json", + items: Optional[Union[str, ResponseInputParam]] = ..., + options: Optional[MemorySearchOptions] = ..., + previous_search_id: Optional[str] = ..., + scope: str, **kwargs: Any - ) -> SkillVersion: ... + ) -> MemoryStoreSearchResult: ... @overload - def create_from_files( + def search_memories( self, name: str, - content: JSON, + body: JSON, + *, + content_type: str = "application/json", **kwargs: Any - ) -> SkillVersion: ... + ) -> MemoryStoreSearchResult: ... - @distributed_trace - def delete( + @overload + def search_memories( self, name: str, + body: IO[bytes], + *, + content_type: str = "application/json", **kwargs: Any - ) -> DeleteSkillResult: ... + ) -> MemoryStoreSearchResult: ... - @distributed_trace - def delete_version( + @overload + def update( self, name: str, - version: str, + *, + content_type: str = "application/json", + description: Optional[str] = ..., + metadata: Optional[dict[str, str]] = ..., **kwargs: Any - ) -> DeleteSkillVersionResult: ... + ) -> MemoryStoreDetails: ... - @distributed_trace - def download( + @overload + def update( self, name: str, + body: JSON, + *, + content_type: str = "application/json", **kwargs: Any - ) -> Iterator[bytes]: ... - - @distributed_trace - def download_version( - self, - name: str, - version: str, - **kwargs: Any - ) -> Iterator[bytes]: ... - - @distributed_trace - def get( - self, - name: str, - **kwargs: Any - ) -> SkillDetails: ... - - @distributed_trace - def get_version( - self, - name: str, - version: str, - **kwargs: Any - ) -> SkillVersion: ... - - @distributed_trace - def list( - self, - *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> ItemPaged[SkillDetails]: ... + ) -> MemoryStoreDetails: ... - @distributed_trace - def list_versions( + @overload + def update( self, name: str, + body: IO[bytes], *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., + content_type: str = "application/json", **kwargs: Any - ) -> ItemPaged[SkillVersion]: ... + ) -> MemoryStoreDetails: ... @overload - def update( + def update_memory( self, name: str, + memory_id: str, *, + content: str, content_type: str = "application/json", - default_version: str, **kwargs: Any - ) -> SkillDetails: ... + ) -> MemoryItem: ... @overload - def update( + def update_memory( self, name: str, + memory_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> SkillDetails: ... + ) -> MemoryItem: ... @overload - def update( + def update_memory( self, name: str, + memory_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> SkillDetails: ... + ) -> MemoryItem: ... - class azure.ai.projects.operations.ConnectionsOperations(ConnectionsOperationsGenerated): + class azure.ai.projects.operations.BetaModelsOperations(BetaModelsOperationsGenerated): def __init__( self, @@ -15957,119 +15474,144 @@ namespace azure.ai.projects.operations **kwargs ) -> None: ... - @distributed_trace - def get( + @overload + def create( self, - name: str, *, - include_credentials: Optional[bool] = False, + azcopy_path: Optional[str] = ..., + base_model: Optional[str] = ..., + description: Optional[str] = ..., + name: str, + polling_interval: float = 2.0, + polling_timeout: float = 300.0, + source: Union[str, PathLike[str]], + tags: Optional[dict[str, str]] = ..., + version: str, + wait_for_commit: Literal[True] = True, + weight_type: Optional[str] = ..., **kwargs: Any - ) -> Connection: ... + ) -> ModelVersion: ... - @distributed_trace - def get_default( + @overload + def create( self, - connection_type: Union[str, ConnectionType], *, - include_credentials: Optional[bool] = False, + azcopy_path: Optional[str] = ..., + base_model: Optional[str] = ..., + description: Optional[str] = ..., + name: str, + polling_interval: float = 2.0, + polling_timeout: float = 300.0, + source: Union[str, PathLike[str]], + tags: Optional[dict[str, str]] = ..., + version: str, + wait_for_commit: Literal[False], + weight_type: Optional[str] = ..., **kwargs: Any - ) -> Connection: ... + ) -> None: ... @distributed_trace - def list( + def delete( self, - *, - connection_type: Optional[Union[str, ConnectionType]] = ..., - default_connection: Optional[bool] = ..., + name: str, + version: str, **kwargs: Any - ) -> ItemPaged[Connection]: ... - - - class azure.ai.projects.operations.DatasetsOperations(DatasetsOperationsGenerated): + ) -> None: ... - def __init__( + @distributed_trace + def get( self, - *args, - **kwargs - ) -> None: ... + name: str, + version: str, + **kwargs: Any + ) -> ModelVersion: ... @overload - def create_or_update( + def get_credentials( self, name: str, version: str, - dataset_version: DatasetVersion, + credential_request: ModelCredentialRequest, *, - content_type: str = "application/merge-patch+json", + content_type: str = "application/json", **kwargs: Any - ) -> DatasetVersion: ... + ) -> DatasetCredential: ... @overload - def create_or_update( + def get_credentials( self, name: str, version: str, - dataset_version: JSON, + credential_request: JSON, *, - content_type: str = "application/merge-patch+json", + content_type: str = "application/json", **kwargs: Any - ) -> DatasetVersion: ... + ) -> DatasetCredential: ... @overload - def create_or_update( + def get_credentials( self, name: str, version: str, - dataset_version: IO[bytes], + credential_request: IO[bytes], *, - content_type: str = "application/merge-patch+json", + content_type: str = "application/json", **kwargs: Any - ) -> DatasetVersion: ... + ) -> DatasetCredential: ... @distributed_trace - def delete( + def list(self, **kwargs: Any) -> ItemPaged[ModelVersion]: ... + + @distributed_trace + def list_versions( self, name: str, - version: str, **kwargs: Any - ) -> None: ... + ) -> ItemPaged[ModelVersion]: ... - @distributed_trace - def get( + @overload + def pending_create_version( self, name: str, version: str, + model_version: ModelVersion, + *, + content_type: str = "application/json", **kwargs: Any - ) -> DatasetVersion: ... + ) -> CreateAsyncResponse: ... - @distributed_trace - def get_credentials( + @overload + def pending_create_version( self, name: str, version: str, + model_version: JSON, + *, + content_type: str = "application/json", **kwargs: Any - ) -> DatasetCredential: ... - - @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged[DatasetVersion]: ... + ) -> CreateAsyncResponse: ... - @distributed_trace - def list_versions( + @overload + def pending_create_version( self, name: str, + version: str, + model_version: IO[bytes], + *, + content_type: str = "application/json", **kwargs: Any - ) -> ItemPaged[DatasetVersion]: ... + ) -> CreateAsyncResponse: ... @overload def pending_upload( self, name: str, version: str, - pending_upload_request: PendingUploadRequest, + pending_upload_request: ModelPendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> PendingUploadResponse: ... + ) -> ModelPendingUploadResponse: ... @overload def pending_upload( @@ -16080,7 +15622,7 @@ namespace azure.ai.projects.operations *, content_type: str = "application/json", **kwargs: Any - ) -> PendingUploadResponse: ... + ) -> ModelPendingUploadResponse: ... @overload def pending_upload( @@ -16091,33 +15633,65 @@ namespace azure.ai.projects.operations *, content_type: str = "application/json", **kwargs: Any - ) -> PendingUploadResponse: ... + ) -> ModelPendingUploadResponse: ... - @distributed_trace - def upload_file( + @overload + def update( self, - *, - connection_name: Optional[str] = ..., - file_path: str, name: str, version: str, + model_version_update: UpdateModelVersionRequest, + *, + content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> FileDatasetVersion: ... + ) -> ModelVersion: ... - @distributed_trace - def upload_folder( + @overload + def update( self, + name: str, + version: str, + model_version_update: JSON, *, - connection_name: Optional[str] = ..., - file_pattern: Optional[Pattern] = ..., - folder: str, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> ModelVersion: ... + + @overload + def update( + self, name: str, version: str, + model_version_update: IO[bytes], + *, + content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> FolderDatasetVersion: ... + ) -> ModelVersion: ... - class azure.ai.projects.operations.DeploymentsOperations: + class azure.ai.projects.operations.BetaOperations(GeneratedBetaOperations): + agent_endpoint_conversations: BetaAgentEndpointConversationsOperations + agent_insight_monitors: BetaAgentInsightMonitorsOperations + agents: BetaAgentsOperations + datasets: BetaDatasetsOperations + evaluation_taxonomies: BetaEvaluationTaxonomiesOperations + evaluators: BetaEvaluatorsOperations + insights: BetaInsightsOperations + memory_stores: BetaMemoryStoresOperations + models: BetaModelsOperations + red_teams: BetaRedTeamsOperations + routines: BetaRoutinesOperations + schedules: BetaSchedulesOperations + skills: BetaSkillsOperations + + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... + + + class azure.ai.projects.operations.BetaRedTeamsOperations: def __init__( self, @@ -16125,25 +15699,45 @@ namespace azure.ai.projects.operations **kwargs ) -> None: ... - @distributed_trace - def get( + @overload + def create( self, - name: str, + red_team: RedTeam, + *, + content_type: str = "application/json", **kwargs: Any - ) -> Deployment: ... + ) -> RedTeam: ... - @distributed_trace - def list( + @overload + def create( self, + red_team: JSON, *, - deployment_type: Optional[Union[str, DeploymentType]] = ..., - model_name: Optional[str] = ..., - model_publisher: Optional[str] = ..., + content_type: str = "application/json", **kwargs: Any - ) -> ItemPaged[Deployment]: ... + ) -> RedTeam: ... + @overload + def create( + self, + red_team: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> RedTeam: ... - class azure.ai.projects.operations.EvaluationRulesOperations(GeneratedEvaluationRulesOperations): + @distributed_trace + def get( + self, + name: str, + **kwargs: Any + ) -> RedTeam: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[RedTeam]: ... + + + class azure.ai.projects.operations.BetaRoutinesOperations: def __init__( self, @@ -16154,59 +15748,119 @@ namespace azure.ai.projects.operations @overload def create_or_update( self, - id: str, - evaluation_rule: EvaluationRule, + routine_name: str, *, + action: Optional[RoutineAction] = ..., + authorization: Optional[RoutineAuthorization] = ..., content_type: str = "application/json", + description: Optional[str] = ..., + enabled: Optional[bool] = ..., + triggers: Optional[dict[str, RoutineTrigger]] = ..., **kwargs: Any - ) -> EvaluationRule: ... + ) -> Routine: ... @overload def create_or_update( self, - id: str, - evaluation_rule: JSON, + routine_name: str, + body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> EvaluationRule: ... + ) -> Routine: ... @overload def create_or_update( self, - id: str, - evaluation_rule: IO[bytes], + routine_name: str, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> EvaluationRule: ... + ) -> Routine: ... @distributed_trace def delete( self, - id: str, + routine_name: str, **kwargs: Any ) -> None: ... + @distributed_trace + def disable( + self, + routine_name: str, + **kwargs: Any + ) -> Routine: ... + + @overload + def dispatch( + self, + routine_name: str, + *, + content_type: str = "application/json", + payload: Optional[RoutineDispatchPayload] = ..., + **kwargs: Any + ) -> DispatchRoutineResult: ... + + @overload + def dispatch( + self, + routine_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DispatchRoutineResult: ... + + @overload + def dispatch( + self, + routine_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DispatchRoutineResult: ... + + @distributed_trace + def enable( + self, + routine_name: str, + **kwargs: Any + ) -> Routine: ... + @distributed_trace def get( self, - id: str, + routine_name: str, **kwargs: Any - ) -> EvaluationRule: ... + ) -> Routine: ... @distributed_trace def list( self, *, - action_type: Optional[Union[str, EvaluationRuleActionType]] = ..., - agent_name: Optional[str] = ..., - enabled: Optional[bool] = ..., + after: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., **kwargs: Any - ) -> ItemPaged[EvaluationRule]: ... + ) -> ItemPaged[Routine]: ... + + @distributed_trace + def list_runs( + self, + routine_name: str, + *, + after: Optional[str] = ..., + filter: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[RoutineRun]: ... - class azure.ai.projects.operations.IndexesOperations: + class azure.ai.projects.operations.BetaSchedulesOperations: def __init__( self, @@ -16217,72 +15871,76 @@ namespace azure.ai.projects.operations @overload def create_or_update( self, - name: str, - version: str, - index: Index, + schedule_id: str, + schedule: Schedule, *, - content_type: str = "application/merge-patch+json", + content_type: str = "application/json", **kwargs: Any - ) -> Index: ... + ) -> Schedule: ... @overload def create_or_update( self, - name: str, - version: str, - index: JSON, + schedule_id: str, + schedule: JSON, *, - content_type: str = "application/merge-patch+json", + content_type: str = "application/json", **kwargs: Any - ) -> Index: ... + ) -> Schedule: ... @overload def create_or_update( self, - name: str, - version: str, - index: IO[bytes], + schedule_id: str, + schedule: IO[bytes], *, - content_type: str = "application/merge-patch+json", + content_type: str = "application/json", **kwargs: Any - ) -> Index: ... + ) -> Schedule: ... @distributed_trace def delete( self, - name: str, - version: str, + schedule_id: str, **kwargs: Any ) -> None: ... @distributed_trace def get( self, - name: str, - version: str, + schedule_id: str, **kwargs: Any - ) -> Index: ... + ) -> Schedule: ... @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged[Index]: ... + def get_run( + self, + schedule_id: str, + run_id: str, + **kwargs: Any + ) -> ScheduleRun: ... @distributed_trace - def list_versions( + def list( self, - name: str, + *, + enabled: Optional[bool] = ..., + type: Optional[Union[str, ScheduleTaskType]] = ..., **kwargs: Any - ) -> ItemPaged[Index]: ... - - - class azure.ai.projects.operations.TelemetryOperations: - - def __init__(self, outer_instance: AIProjectClient) -> None: ... + ) -> ItemPaged[Schedule]: ... @distributed_trace - def get_application_insights_connection_string(self) -> str: ... + def list_runs( + self, + schedule_id: str, + *, + enabled: Optional[bool] = ..., + type: Optional[Union[str, ScheduleTaskType]] = ..., + **kwargs: Any + ) -> ItemPaged[ScheduleRun]: ... - class azure.ai.projects.operations.ToolboxesOperations: + class azure.ai.projects.operations.BetaSkillsOperations: def __init__( self, @@ -16291,45 +15949,58 @@ namespace azure.ai.projects.operations ) -> None: ... @overload - def create_version( + def create( self, name: str, *, content_type: str = "application/json", - description: Optional[str] = ..., - metadata: Optional[dict[str, str]] = ..., - policies: Optional[ToolboxPolicies] = ..., - skills: Optional[List[ToolboxSkill]] = ..., - tools: List[ToolboxTool], + default: Optional[bool] = ..., + inline_content: Optional[SkillInlineContent] = ..., **kwargs: Any - ) -> ToolboxVersionObject: ... + ) -> SkillVersion: ... @overload - def create_version( + def create( self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> ToolboxVersionObject: ... + ) -> SkillVersion: ... @overload - def create_version( + def create( self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> ToolboxVersionObject: ... + ) -> SkillVersion: ... + + @overload + def create_from_files( + self, + name: str, + content: CreateSkillVersionFromFilesBody, + **kwargs: Any + ) -> SkillVersion: ... + + @overload + def create_from_files( + self, + name: str, + content: JSON, + **kwargs: Any + ) -> SkillVersion: ... @distributed_trace def delete( self, name: str, **kwargs: Any - ) -> None: ... + ) -> DeleteSkillResult: ... @distributed_trace def delete_version( @@ -16337,14 +16008,29 @@ namespace azure.ai.projects.operations name: str, version: str, **kwargs: Any - ) -> None: ... + ) -> DeleteSkillVersionResult: ... + + @distributed_trace + def download( + self, + name: str, + **kwargs: Any + ) -> Iterator[bytes]: ... + + @distributed_trace + def download_version( + self, + name: str, + version: str, + **kwargs: Any + ) -> Iterator[bytes]: ... @distributed_trace def get( self, name: str, **kwargs: Any - ) -> ToolboxObject: ... + ) -> SkillDetails: ... @distributed_trace def get_version( @@ -16352,7 +16038,7 @@ namespace azure.ai.projects.operations name: str, version: str, **kwargs: Any - ) -> ToolboxVersionObject: ... + ) -> SkillVersion: ... @distributed_trace def list( @@ -16362,7 +16048,7 @@ namespace azure.ai.projects.operations limit: Optional[int] = ..., order: Optional[Union[str, PageOrder]] = ..., **kwargs: Any - ) -> ItemPaged[ToolboxObject]: ... + ) -> ItemPaged[SkillDetails]: ... @distributed_trace def list_versions( @@ -16373,7 +16059,7 @@ namespace azure.ai.projects.operations limit: Optional[int] = ..., order: Optional[Union[str, PageOrder]] = ..., **kwargs: Any - ) -> ItemPaged[ToolboxVersionObject]: ... + ) -> ItemPaged[SkillVersion]: ... @overload def update( @@ -16383,7 +16069,7 @@ namespace azure.ai.projects.operations content_type: str = "application/json", default_version: str, **kwargs: Any - ) -> ToolboxObject: ... + ) -> SkillDetails: ... @overload def update( @@ -16393,7 +16079,7 @@ namespace azure.ai.projects.operations *, content_type: str = "application/json", **kwargs: Any - ) -> ToolboxObject: ... + ) -> SkillDetails: ... @overload def update( @@ -16403,10 +16089,10 @@ namespace azure.ai.projects.operations *, content_type: str = "application/json", **kwargs: Any - ) -> ToolboxObject: ... + ) -> SkillDetails: ... - class azure.ai.projects.operations.VoiceAgentWebSocketOperations: + class azure.ai.projects.operations.ConnectionsOperations(ConnectionsOperationsGenerated): def __init__( self, @@ -16415,5364 +16101,475 @@ namespace azure.ai.projects.operations ) -> None: ... @distributed_trace - def connect_voice_agent( + def get( self, - agent_name: str, + name: str, *, - agent_session_id: Optional[str] = ..., - agent_version_override: Optional[str] = ..., - store: Optional[bool] = ..., - structured_inputs: Optional[str] = ..., - websocket_subprotocol: Optional[Union[str, VoiceAgentWebSocketSubprotocol]] = ..., + include_credentials: Optional[bool] = False, **kwargs: Any - ) -> None: ... - - -namespace azure.ai.projects.telemetry + ) -> Connection: ... - def azure.ai.projects.telemetry.trace_function(span_name: Optional[str] = None) -> Callable: ... + @distributed_trace + def get_default( + self, + connection_type: Union[str, ConnectionType], + *, + include_credentials: Optional[bool] = False, + **kwargs: Any + ) -> Connection: ... + @distributed_trace + def list( + self, + *, + connection_type: Optional[Union[str, ConnectionType]] = ..., + default_connection: Optional[bool] = ..., + **kwargs: Any + ) -> ItemPaged[Connection]: ... - class azure.ai.projects.telemetry.AIProjectInstrumentor: - def __init__(self) -> None: ... + class azure.ai.projects.operations.DatasetsOperations(DatasetsOperationsGenerated): - def instrument( + def __init__( self, - enable_content_recording: Optional[bool] = None, - enable_trace_context_propagation: Optional[bool] = None, - enable_baggage_propagation: Optional[bool] = None + *args, + **kwargs ) -> None: ... - def is_content_recording_enabled(self) -> bool: ... - - def is_instrumented(self) -> bool: ... + @overload + def create_or_update( + self, + name: str, + version: str, + dataset_version: DatasetVersion, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> DatasetVersion: ... - def uninstrument(self) -> None: ... + @overload + def create_or_update( + self, + name: str, + version: str, + dataset_version: JSON, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> DatasetVersion: ... + @overload + def create_or_update( + self, + name: str, + version: str, + dataset_version: IO[bytes], + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> DatasetVersion: ... -namespace azure.ai.projects.types + @distributed_trace + def delete( + self, + name: str, + version: str, + **kwargs: Any + ) -> None: ... - class azure.ai.projects.types.A2APreviewTool(TypedDict, total=False): - key "agent_card_path": str - key "base_url": str - key "project_connection_id": str - key "send_credentials_for_agent_card": bool - key "type": Required[Literal[ToolType.A2A_PREVIEW]] - agent_card_path: str - base_url: str - project_connection_id: str - send_credentials_for_agent_card: bool - type: Literal[ToolType.A2A_PREVIEW] + @distributed_trace + def get( + self, + name: str, + version: str, + **kwargs: Any + ) -> DatasetVersion: ... + @distributed_trace + def get_credentials( + self, + name: str, + version: str, + **kwargs: Any + ) -> DatasetCredential: ... - class azure.ai.projects.types.A2APreviewToolboxTool(TypedDict, total=False): - key "agent_card_path": str - key "base_url": str - key "description": str - key "name": str - key "project_connection_id": str - key "send_credentials_for_agent_card": bool - key "type": Required[Literal[ToolboxToolType.A2A_PREVIEW]] - agent_card_path: str - base_url: str - description: str - name: str - project_connection_id: str - send_credentials_for_agent_card: bool - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.A2A_PREVIEW] + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[DatasetVersion]: ... + @distributed_trace + def list_versions( + self, + name: str, + **kwargs: Any + ) -> ItemPaged[DatasetVersion]: ... - class azure.ai.projects.types.A2AProtocolConfiguration(TypedDict, total=False): + @overload + def pending_upload( + self, + name: str, + version: str, + pending_upload_request: PendingUploadRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PendingUploadResponse: ... + @overload + def pending_upload( + self, + name: str, + version: str, + pending_upload_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PendingUploadResponse: ... - class azure.ai.projects.types.AISearchIndexResource(TypedDict, total=False): - key "filter": str - key "index_asset_id": str - key "index_name": str - key "project_connection_id": str - key "query_type": Union[str, AzureAISearchQueryType] - key "top_k": int - filter: str - index_asset_id: str - index_name: str - project_connection_id: str - query_type: Union[str, AzureAISearchQueryType] - top_k: int + @overload + def pending_upload( + self, + name: str, + version: str, + pending_upload_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PendingUploadResponse: ... + @distributed_trace + def upload_file( + self, + *, + connection_name: Optional[str] = ..., + file_path: str, + name: str, + version: str, + **kwargs: Any + ) -> FileDatasetVersion: ... - class azure.ai.projects.types.ActivityProtocolConfiguration(TypedDict, total=False): - key "enable_m365_public_endpoint": bool - enable_m365_public_endpoint: bool + @distributed_trace + def upload_folder( + self, + *, + connection_name: Optional[str] = ..., + file_pattern: Optional[Pattern] = ..., + folder: str, + name: str, + version: str, + **kwargs: Any + ) -> FolderDatasetVersion: ... - class azure.ai.projects.types.AgentBlueprintReference(TypedDict, total=False): - key "blueprint_id": Required[str] - key "type": Required[Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT]] - blueprint_id: str - type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] + class azure.ai.projects.operations.DeploymentsOperations: + def __init__( + self, + *args, + **kwargs + ) -> None: ... - class azure.ai.projects.types.AgentBlueprintReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - MANAGED_AGENT_IDENTITY_BLUEPRINT = "ManagedAgentIdentityBlueprint" + @distributed_trace + def get( + self, + name: str, + **kwargs: Any + ) -> Deployment: ... + @distributed_trace + def list( + self, + *, + deployment_type: Optional[Union[str, DeploymentType]] = ..., + model_name: Optional[str] = ..., + model_publisher: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[Deployment]: ... - class azure.ai.projects.types.AgentCard(TypedDict, total=False): - key "description": str - key "skills": Required[list[AgentCardSkill]] - key "version": Required[str] - description: str - skills: list[AgentCardSkill] - version: str + class azure.ai.projects.operations.EvaluationRulesOperations(GeneratedEvaluationRulesOperations): - class azure.ai.projects.types.AgentCardSkill(TypedDict, total=False): - key "description": str - key "id": Required[str] - key "name": Required[str] - description: str - examples: list[str] - id: str - name: str - tags: list[str] + def __init__( + self, + *args, + **kwargs + ) -> None: ... + @overload + def create_or_update( + self, + id: str, + evaluation_rule: EvaluationRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationRule: ... - class azure.ai.projects.types.AgentClusterInsightRequest(TypedDict, total=False): - key "agentName": Required[str] - key "modelConfiguration": ForwardRef('InsightModelConfiguration', module='types') - key "type": Required[Literal[InsightType.AGENT_CLUSTER_INSIGHT]] - agentName: str - modelConfiguration: InsightModelConfiguration - type: Literal[InsightType.AGENT_CLUSTER_INSIGHT] + @overload + def create_or_update( + self, + id: str, + evaluation_rule: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationRule: ... + @overload + def create_or_update( + self, + id: str, + evaluation_rule: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationRule: ... - class azure.ai.projects.types.AgentClusterInsightResult(TypedDict, total=False): - key "clusterInsight": Required[ClusterInsightResult] - key "type": Required[Literal[InsightType.AGENT_CLUSTER_INSIGHT]] - clusterInsight: ClusterInsightResult - type: Literal[InsightType.AGENT_CLUSTER_INSIGHT] + @distributed_trace + def delete( + self, + id: str, + **kwargs: Any + ) -> None: ... + @distributed_trace + def get( + self, + id: str, + **kwargs: Any + ) -> EvaluationRule: ... - class azure.ai.projects.types.AgentDataGenerationJobSource(TypedDict, total=False): - key "agent_name": Required[str] - key "agent_version": str - key "description": str - key "type": Required[Literal[DataGenerationJobSourceType.AGENT]] - agent_name: str - agent_version: str - description: str - type: Literal[DataGenerationJobSourceType.AGENT] - - - class azure.ai.projects.types.AgentEndpointAuthorizationSchemeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - BOT_SERVICE = "BotService" - BOT_SERVICE_RBAC = "BotServiceRbac" - BOT_SERVICE_TENANT = "BotServiceTenant" - ENTRA = "Entra" - - - class azure.ai.projects.types.AgentEndpointConfig(TypedDict, total=False): - key "protocol_configuration": ForwardRef('ProtocolConfiguration', module='types') - key "version_selector": ForwardRef('VersionSelector', module='types') - authorization_schemes: list[AgentEndpointAuthorizationScheme] - protocol_configuration: ProtocolConfiguration - version_selector: VersionSelector - - - class azure.ai.projects.types.AgentEvaluatorGenerationJobSource(TypedDict, total=False): - key "agent_name": Required[str] - key "agent_version": str - key "description": str - key "type": Required[Literal[EvaluatorGenerationJobSourceType.AGENT]] - agent_name: str - agent_version: str - description: str - type: Literal[EvaluatorGenerationJobSourceType.AGENT] - - - class azure.ai.projects.types.AgentKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - EXTERNAL = "external" - HOSTED = "hosted" - PROMPT = "prompt" - VOICE = "voice" - WORKFLOW = "workflow" - - - class azure.ai.projects.types.AgentOptimizationCandidate(TypedDict, total=False): - key "avg_score": Required[float] - key "avg_tokens": Required[float] - key "candidate_id": str - key "eval_id": str - key "eval_run_id": str - key "name": Required[str] - key "promotion": ForwardRef('PromotionInfo', module='types') - avg_score: float - avg_tokens: float - candidate_id: str - eval_id: str - eval_run_id: str - mutations: dict[str, Any] - name: str - promotion: PromotionInfo - - - class azure.ai.projects.types.AgentOptimizationDatasetCriterion(TypedDict, total=False): - key "instruction": Required[str] - key "name": Required[str] - instruction: str - name: str - - - class azure.ai.projects.types.AgentOptimizationDatasetInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - INLINE = "inline" - REFERENCE = "reference" - - - class azure.ai.projects.types.AgentOptimizationDatasetItem(TypedDict, total=False): - key "desired_num_turns": int - key "ground_truth": str - key "query": str - criteria: list[AgentOptimizationDatasetCriterion] - desired_num_turns: int - ground_truth: str - query: str - - - class azure.ai.projects.types.AgentOptimizationEvaluatorRef(TypedDict, total=False): - key "name": Required[str] - key "version": str - name: str - version: str - - - class azure.ai.projects.types.AgentOptimizationInlineDatasetInput(TypedDict, total=False): - key "items": Required[list[AgentOptimizationDatasetItem]] - key "type": Required[Literal[AgentOptimizationDatasetInputType.INLINE]] - items: list[AgentOptimizationDatasetItem] - type: Literal[AgentOptimizationDatasetInputType.INLINE] - - - class azure.ai.projects.types.AgentOptimizationJob(TypedDict, total=False): - key "created_at": Required[int] - key "error": ForwardRef('ApiError', module='types') - key "id": Required[str] - key "inputs": ForwardRef('AgentOptimizationJobInputs', module='types') - key "progress": ForwardRef('AgentOptimizationJobProgress', module='types') - key "result": ForwardRef('AgentOptimizationJobResult', module='types') - key "status": Required[Union[str, JobStatus]] - key "updated_at": Required[int] - created_at: int - error: ApiError - id: str - inputs: AgentOptimizationJobInputs - progress: AgentOptimizationJobProgress - result: AgentOptimizationJobResult - status: Union[str, JobStatus] - updated_at: int - warnings: list[str] - - - class azure.ai.projects.types.AgentOptimizationJobInputs(TypedDict, total=False): - key "agent": Required[OptimizedAgentIdentifier] - key "evaluators": Required[list[AgentOptimizationEvaluatorRef]] - key "options": ForwardRef('AgentOptimizationOptions', module='types') - key "train_dataset": Required[AgentOptimizationDatasetInput] - key "validation_dataset": ForwardRef('AgentOptimizationDatasetInput', module='types') - agent: OptimizedAgentIdentifier - evaluators: list[AgentOptimizationEvaluatorRef] - options: AgentOptimizationOptions - train_dataset: AgentOptimizationDatasetInput - validation_dataset: AgentOptimizationDatasetInput - - - class azure.ai.projects.types.AgentOptimizationJobProgress(TypedDict, total=False): - key "best_score": Required[float] - key "candidates_completed": Required[int] - key "elapsed_seconds": Required[float] - best_score: float - candidates_completed: int - elapsed_seconds: float - - - class azure.ai.projects.types.AgentOptimizationJobResult(TypedDict, total=False): - key "baseline": str - key "best": str - baseline: str - best: str - candidates: list[AgentOptimizationCandidate] - - - class azure.ai.projects.types.AgentOptimizationOptions(TypedDict, total=False): - key "eval_model": str - key "evaluation_level": Union[str, EvaluationLevel] - key "max_candidates": int - key "max_stalls": int - key "optimization_model": str - eval_model: str - evaluation_level: Union[str, EvaluationLevel] - max_candidates: int - max_stalls: int - optimization_config: dict[str, Any] - optimization_model: str - - - class azure.ai.projects.types.AgentOptimizationReferenceDatasetInput(TypedDict, total=False): - key "name": Required[str] - key "type": Required[Literal[AgentOptimizationDatasetInputType.REFERENCE]] - key "version": str - name: str - type: Literal[AgentOptimizationDatasetInputType.REFERENCE] - version: str - - - class azure.ai.projects.types.AgentTaxonomyInput(TypedDict, total=False): - key "riskCategories": Required[list[Union[str, RiskCategory]]] - key "target": Required[EvaluationTarget] - key "type": Required[Literal[EvaluationTaxonomyInputType.AGENT]] - riskCategories: list[Union[str, RiskCategory]] - target: EvaluationTarget - type: Literal[EvaluationTaxonomyInputType.AGENT] - - - class azure.ai.projects.types.ApiError(TypedDict, total=False): - key "code": Required[Optional[str]] - key "message": Required[str] - key "param": Optional[str] - key "type": str - additionalInfo: dict[str, Any] - code: str - debugInfo: dict[str, Any] - details: list[ApiError] - message: str - param: str - type: str - - - class azure.ai.projects.types.ApplyPatchToolParam(TypedDict, total=False): - key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] - key "type": Required[Literal[ToolType.APPLY_PATCH]] - allowed_callers: list[Union[str, CallableToolAllowedCaller]] - type: Literal[ToolType.APPLY_PATCH] - - - class azure.ai.projects.types.ApproximateLocation(TypedDict, total=False): - key "city": Optional[str] - key "country": Optional[str] - key "region": Optional[str] - key "timezone": Optional[str] - key "type": Required[Literal["approximate"]] - city: str - country: str - region: str - timezone: str - type: Literal[approximate] - - - class azure.ai.projects.types.ArtifactProfile(TypedDict, total=False): - key "category": Required[Union[str, FoundryModelArtifactProfileCategory]] - category: Union[str, FoundryModelArtifactProfileCategory] - signals: list[Union[str, FoundryModelArtifactProfileSignal]] - - - class azure.ai.projects.types.AutoCodeInterpreterToolParam(TypedDict, total=False): - key "memory_limit": Optional[Union[str, ContainerMemoryLimit]] - key "network_policy": ForwardRef('ContainerNetworkPolicyParam', module='types') - key "type": Required[Literal["auto"]] - file_ids: list[str] - memory_limit: Union[str, ContainerMemoryLimit] - network_policy: ContainerNetworkPolicyParam - type: Literal[auto] - - - class azure.ai.projects.types.AzureAIAgentTarget(TypedDict, total=False): - key "name": Required[str] - key "type": Required[Literal["azure_ai_agent"]] - key "version": str - name: str - tool_descriptions: list[ToolDescription] - tools: list[Tool] - type: Literal[azure_ai_agent] - version: str - - - class azure.ai.projects.types.AzureAIModelTarget(TypedDict, total=False): - key "model": str - key "sampling_params": ForwardRef('ModelSamplingParams', module='types') - key "type": Required[Literal["azure_ai_model"]] - model: str - sampling_params: ModelSamplingParams - type: Literal[azure_ai_model] - - - class azure.ai.projects.types.AzureAISearchIndex(TypedDict, total=False): - key "connectionName": Required[str] - key "description": str - key "fieldMapping": ForwardRef('FieldMapping', module='types') - key "id": str - key "indexName": Required[str] - key "name": Required[str] - key "type": Required[Literal[IndexType.AZURE_SEARCH]] - key "version": Required[str] - connectionName: str - description: str - fieldMapping: FieldMapping - id: str - indexName: str - name: str - tags: dict[str, str] - type: Literal[IndexType.AZURE_SEARCH] - version: str - - - class azure.ai.projects.types.AzureAISearchTool(TypedDict, total=False): - key "azure_ai_search": Required[AzureAISearchToolResource] - key "description": str - key "name": str - key "type": Required[Literal[ToolType.AZURE_AI_SEARCH]] - azure_ai_search: AzureAISearchToolResource - description: str - name: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.AZURE_AI_SEARCH] - - - class azure.ai.projects.types.AzureAISearchToolResource(TypedDict, total=False): - key "indexes": Required[list[AISearchIndexResource]] - indexes: list[AISearchIndexResource] - - - class azure.ai.projects.types.AzureAISearchToolboxTool(TypedDict, total=False): - key "azure_ai_search": Required[AzureAISearchToolResource] - key "description": str - key "name": str - key "type": Required[Literal[ToolboxToolType.AZURE_AI_SEARCH]] - azure_ai_search: AzureAISearchToolResource - description: str - name: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.AZURE_AI_SEARCH] - - - class azure.ai.projects.types.AzureFunctionBinding(TypedDict, total=False): - key "storage_queue": Required[AzureFunctionStorageQueue] - key "type": Required[Literal["storage_queue"]] - storage_queue: AzureFunctionStorageQueue - type: Literal[storage_queue] - - - class azure.ai.projects.types.AzureFunctionDefinition(TypedDict, total=False): - key "function": Required[AzureFunctionDefinitionFunction] - key "input_binding": Required[AzureFunctionBinding] - key "output_binding": Required[AzureFunctionBinding] - function: AzureFunctionDefinitionFunction - input_binding: AzureFunctionBinding - output_binding: AzureFunctionBinding - - - class azure.ai.projects.types.AzureFunctionDefinitionFunction(TypedDict, total=False): - key "description": str - key "name": Required[str] - key "parameters": Required[dict[str, Any]] - description: str - name: str - parameters: dict[str, Any] - - - class azure.ai.projects.types.AzureFunctionStorageQueue(TypedDict, total=False): - key "queue_name": Required[str] - key "queue_service_endpoint": Required[str] - queue_name: str - queue_service_endpoint: str - - - class azure.ai.projects.types.AzureFunctionTool(TypedDict, total=False): - key "azure_function": Required[AzureFunctionDefinition] - key "type": Required[Literal[ToolType.AZURE_FUNCTION]] - azure_function: AzureFunctionDefinition - tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.AZURE_FUNCTION] - - - class azure.ai.projects.types.AzureOpenAIModelConfiguration(TypedDict, total=False): - key "modelDeploymentName": Required[str] - key "type": Required[Literal["AzureOpenAIModel"]] - modelDeploymentName: str - type: Literal[AzureOpenAIModel] - - - class azure.ai.projects.types.BingCustomSearchConfiguration(TypedDict, total=False): - key "count": int - key "freshness": str - key "instance_name": Required[str] - key "market": str - key "project_connection_id": Required[str] - key "set_lang": str - count: int - freshness: str - instance_name: str - market: str - project_connection_id: str - set_lang: str - - - class azure.ai.projects.types.BingCustomSearchPreviewTool(TypedDict, total=False): - key "bing_custom_search_preview": Required[BingCustomSearchToolParameters] - key "type": Required[Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW]] - bing_custom_search_preview: BingCustomSearchToolParameters - type: Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW] - - - class azure.ai.projects.types.BingCustomSearchToolParameters(TypedDict, total=False): - key "search_configurations": Required[list[BingCustomSearchConfiguration]] - search_configurations: list[BingCustomSearchConfiguration] - - - class azure.ai.projects.types.BingGroundingSearchConfiguration(TypedDict, total=False): - key "count": int - key "freshness": str - key "market": str - key "project_connection_id": Required[str] - key "set_lang": str - count: int - freshness: str - market: str - project_connection_id: str - set_lang: str - - - class azure.ai.projects.types.BingGroundingSearchToolParameters(TypedDict, total=False): - key "search_configurations": Required[list[BingGroundingSearchConfiguration]] - search_configurations: list[BingGroundingSearchConfiguration] - - - class azure.ai.projects.types.BingGroundingTool(TypedDict, total=False): - key "bing_grounding": Required[BingGroundingSearchToolParameters] - key "description": str - key "name": str - key "type": Required[Literal[ToolType.BING_GROUNDING]] - bing_grounding: BingGroundingSearchToolParameters - description: str - name: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.BING_GROUNDING] - - - class azure.ai.projects.types.BotServiceAuthorizationScheme(TypedDict, total=False): - key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE]] - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE] - - - class azure.ai.projects.types.BotServiceRbacAuthorizationScheme(TypedDict, total=False): - key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC]] - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC] - - - class azure.ai.projects.types.BotServiceTenantAuthorizationScheme(TypedDict, total=False): - key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT]] - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT] - - - class azure.ai.projects.types.BrowserAutomationPreviewTool(TypedDict, total=False): - key "browser_automation_preview": Required[BrowserAutomationToolParameters] - key "type": Required[Literal[ToolType.BROWSER_AUTOMATION_PREVIEW]] - browser_automation_preview: BrowserAutomationToolParameters - type: Literal[ToolType.BROWSER_AUTOMATION_PREVIEW] - - - class azure.ai.projects.types.BrowserAutomationPreviewToolboxTool(TypedDict, total=False): - key "browser_automation_preview": Required[BrowserAutomationToolParameters] - key "description": str - key "name": str - key "type": Required[Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW]] - browser_automation_preview: BrowserAutomationToolParameters - description: str - name: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW] - - - class azure.ai.projects.types.BrowserAutomationToolConnectionParameters(TypedDict, total=False): - key "project_connection_id": Required[str] - project_connection_id: str - - - class azure.ai.projects.types.BrowserAutomationToolParameters(TypedDict, total=False): - key "connection": Required[BrowserAutomationToolConnectionParameters] - connection: BrowserAutomationToolConnectionParameters - - - class azure.ai.projects.types.CaptureStructuredOutputsTool(TypedDict, total=False): - key "description": str - key "name": str - key "outputs": Required[StructuredOutputDefinition] - key "type": Required[Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS]] - description: str - name: str - outputs: StructuredOutputDefinition - tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS] - - - class azure.ai.projects.types.ChartCoordinate(TypedDict, total=False): - key "size": Required[int] - key "x": Required[int] - key "y": Required[int] - size: int - x: int - y: int - - - class azure.ai.projects.types.ClusterInsightResult(TypedDict, total=False): - key "clusters": Required[list[InsightCluster]] - key "summary": Required[InsightSummary] - clusters: list[InsightCluster] - coordinates: dict[str, ChartCoordinate] - summary: InsightSummary - - - class azure.ai.projects.types.ClusterTokenUsage(TypedDict, total=False): - key "inputTokenUsage": Required[int] - key "outputTokenUsage": Required[int] - key "totalTokenUsage": Required[int] - inputTokenUsage: int - outputTokenUsage: int - totalTokenUsage: int - - - class azure.ai.projects.types.CodeBasedEvaluatorDefinition(TypedDict, total=False): - key "blob_uri": str - key "code_text": str - key "entry_point": str - key "image_tag": str - key "type": Required[Literal[EvaluatorDefinitionType.CODE]] - blob_uri: str - code_text: str - data_schema: dict[str, Any] - entry_point: str - image_tag: str - init_parameters: dict[str, Any] - metrics: dict[str, EvaluatorMetric] - type: Literal[EvaluatorDefinitionType.CODE] - - - class azure.ai.projects.types.CodeConfiguration(TypedDict, total=False): - key "content_hash": str - key "dependency_resolution": Required[Union[str, CodeDependencyResolution]] - key "entry_point": Required[list[str]] - key "runtime": Required[str] - content_hash: str - dependency_resolution: Union[str, CodeDependencyResolution] - entry_point: list[str] - runtime: str - - - class azure.ai.projects.types.CodeInterpreterTool(TypedDict, total=False): - key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] - key "container": Union[str, AutoCodeInterpreterToolParam] - key "description": str - key "name": str - key "type": Required[Literal[ToolType.CODE_INTERPRETER]] - allowed_callers: list[Union[str, CallableToolAllowedCaller]] - container: Union[str, AutoCodeInterpreterToolParam] - description: str - name: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.CODE_INTERPRETER] - - - class azure.ai.projects.types.CodeInterpreterToolboxTool(TypedDict, total=False): - key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] - key "container": Union[str, AutoCodeInterpreterToolParam] - key "description": str - key "name": str - key "type": Required[Literal[ToolboxToolType.CODE_INTERPRETER]] - allowed_callers: list[Union[str, CallableToolAllowedCaller]] - container: Union[str, AutoCodeInterpreterToolParam] - description: str - name: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.CODE_INTERPRETER] - - - class azure.ai.projects.types.ComparisonFilter(TypedDict, total=False): - key "key": Required[str] - key "type": Required[Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]] - key "value": Required[Union[str, float, bool, list[Union[str, float]]]] - key: str - type: Literal[eq, ne, gt, gte, lt, lte, in, nin] - value: Union[str, float, bool, list[Union[str, float]]] - - - class azure.ai.projects.types.CompoundFilter(TypedDict, total=False): - key "filters": Required[list[Union[ComparisonFilter, Any]]] - key "type": Required[Literal["and", "or"]] - filters: list[Union[ComparisonFilter, Any]] - type: Literal[and, or] - - - class azure.ai.projects.types.ComputerTool(TypedDict, total=False): - key "type": Required[Literal[ToolType.COMPUTER]] - type: Literal[ToolType.COMPUTER] - - - class azure.ai.projects.types.ComputerUsePreviewTool(TypedDict, total=False): - key "display_height": Required[int] - key "display_width": Required[int] - key "environment": Required[Union[str, ComputerEnvironment]] - key "type": Required[Literal[ToolType.COMPUTER_USE_PREVIEW]] - display_height: int - display_width: int - environment: Union[str, ComputerEnvironment] - type: Literal[ToolType.COMPUTER_USE_PREVIEW] - - - class azure.ai.projects.types.ContainerAutoParam(TypedDict, total=False): - key "memory_limit": Optional[Union[str, ContainerMemoryLimit]] - key "network_policy": ForwardRef('ContainerNetworkPolicyParam', module='types') - key "type": Required[Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO]] - file_ids: list[str] - memory_limit: Union[str, ContainerMemoryLimit] - network_policy: ContainerNetworkPolicyParam - skills: list[ContainerSkill] - type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO] - - - class azure.ai.projects.types.ContainerConfiguration(TypedDict, total=False): - key "image": Required[str] - image: str - - - class azure.ai.projects.types.ContainerNetworkPolicyAllowlistParam(TypedDict, total=False): - key "allowed_domains": Required[list[str]] - key "type": Required[Literal[ContainerNetworkPolicyParamType.ALLOWLIST]] - allowed_domains: list[str] - domain_secrets: list[ContainerNetworkPolicyDomainSecretParam] - type: Literal[ContainerNetworkPolicyParamType.ALLOWLIST] - - - class azure.ai.projects.types.ContainerNetworkPolicyDisabledParam(TypedDict, total=False): - key "type": Required[Literal[ContainerNetworkPolicyParamType.DISABLED]] - type: Literal[ContainerNetworkPolicyParamType.DISABLED] - - - class azure.ai.projects.types.ContainerNetworkPolicyDomainSecretParam(TypedDict, total=False): - key "domain": Required[str] - key "name": Required[str] - key "value": Required[str] - domain: str - name: str - value: str - - - class azure.ai.projects.types.ContainerNetworkPolicyParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ALLOWLIST = "allowlist" - DISABLED = "disabled" - - - class azure.ai.projects.types.ContainerSkillType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - INLINE = "inline" - SKILL_REFERENCE = "skill_reference" - - - class azure.ai.projects.types.ContinuousEvaluationRuleAction(TypedDict, total=False): - key "evalId": Required[str] - key "maxHourlyRuns": int - key "samplingRate": float - key "type": Required[Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION]] - evalId: str - maxHourlyRuns: int - samplingRate: float - type: Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION] - - - class azure.ai.projects.types.CosmosDBIndex(TypedDict, total=False): - key "connectionName": Required[str] - key "containerName": Required[str] - key "databaseName": Required[str] - key "description": str - key "embeddingConfiguration": Required[EmbeddingConfiguration] - key "fieldMapping": Required[FieldMapping] - key "id": str - key "name": Required[str] - key "type": Required[Literal[IndexType.COSMOS_DB]] - key "version": Required[str] - connectionName: str - containerName: str - databaseName: str - description: str - embeddingConfiguration: EmbeddingConfiguration - fieldMapping: FieldMapping - id: str - name: str - tags: dict[str, str] - type: Literal[IndexType.COSMOS_DB] - version: str - - - class azure.ai.projects.types.CreateAgentVersionFromManifestRequest(TypedDict, total=False): - key "description": str - key "manifest_id": Required[str] - key "parameter_values": Required[dict[str, Any]] - description: str - manifest_id: str - metadata: dict[str, str] - parameter_values: dict[str, Any] - - - class azure.ai.projects.types.CreateAgentVersionRequest(TypedDict, total=False): - key "blueprint_reference": ForwardRef('AgentBlueprintReference', module='types') - key "definition": Required[AgentDefinition] - key "description": str - key "draft": bool - blueprint_reference: AgentBlueprintReference - definition: AgentDefinition - description: str - draft: bool - metadata: dict[str, str] - - - class azure.ai.projects.types.CreateMemoryRequest(TypedDict, total=False): - key "content": Required[str] - key "kind": Required[Union[str, MemoryItemKind]] - key "scope": Required[str] - content: str - kind: Union[str, MemoryItemKind] - scope: str - - - class azure.ai.projects.types.CreateMemoryStoreRequest(TypedDict, total=False): - key "definition": Required[MemoryStoreDefinition] - key "description": str - key "name": Required[str] - definition: MemoryStoreDefinition - description: str - metadata: dict[str, str] - name: str - - - class azure.ai.projects.types.CreateOrUpdateRoutineRequest(TypedDict, total=False): - key "action": ForwardRef('RoutineAction', module='types') - key "description": str - key "enabled": bool - action: RoutineAction - description: str - enabled: bool - triggers: dict[str, RoutineTrigger] - - - class azure.ai.projects.types.CreateSessionRequest(TypedDict, total=False): - key "agent_session_id": str - key "version_indicator": Required[VersionIndicator] - agent_session_id: str - version_indicator: VersionIndicator - - - class azure.ai.projects.types.CreateSkillVersionFromFilesBody(TypedDict, total=False): - key "default": bool - key "files": Required[list[Union[str, bytes, IO[str], IO[bytes], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]]], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]], Optional[str]]]]] - default: bool - files: list[FileType] - - - class azure.ai.projects.types.CreateSkillVersionRequest(TypedDict, total=False): - key "default": bool - key "inline_content": ForwardRef('SkillInlineContent', module='types') - default: bool - inline_content: SkillInlineContent - - - class azure.ai.projects.types.CreateToolboxVersionRequest(TypedDict, total=False): - key "description": str - key "policies": ForwardRef('ToolboxPolicies', module='types') - key "tools": Required[list[ToolboxTool]] - description: str - metadata: dict[str, str] - policies: ToolboxPolicies - skills: list[ToolboxSkill] - tools: list[ToolboxTool] - - - class azure.ai.projects.types.CreateTranscriptionResponseJsonUsageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DURATION = "duration" - TOKENS = "tokens" - - - class azure.ai.projects.types.CronTrigger(TypedDict, total=False): - key "endTime": str - key "expression": Required[str] - key "startTime": str - key "timeZone": str - key "type": Required[Literal[TriggerType.CRON]] - endTime: str - expression: str - startTime: str - timeZone: str - type: Literal[TriggerType.CRON] - - - class azure.ai.projects.types.CustomGrammarFormatParam(TypedDict, total=False): - key "definition": Required[str] - key "syntax": Required[Union[str, GrammarSyntax1]] - key "type": Required[Literal[CustomToolParamFormatType.GRAMMAR]] - definition: str - syntax: Union[str, GrammarSyntax1] - type: Literal[CustomToolParamFormatType.GRAMMAR] - - - class azure.ai.projects.types.CustomRoutineTrigger(TypedDict, total=False): - key "event_name": str - key "parameters": Required[dict[str, Any]] - key "provider": Required[str] - key "type": Required[Literal[RoutineTriggerType.CUSTOM]] - event_name: str - parameters: dict[str, Any] - provider: str - type: Literal[RoutineTriggerType.CUSTOM] - - - class azure.ai.projects.types.CustomTextFormatParam(TypedDict, total=False): - key "type": Required[Literal[CustomToolParamFormatType.TEXT]] - type: Literal[CustomToolParamFormatType.TEXT] - - - class azure.ai.projects.types.CustomToolParam(TypedDict, total=False): - key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] - key "defer_loading": bool - key "description": str - key "format": ForwardRef('CustomToolParamFormat', module='types') - key "name": Required[str] - key "type": Required[Literal[ToolType.CUSTOM]] - allowed_callers: list[Union[str, CallableToolAllowedCaller]] - defer_loading: bool - description: str - format: CustomToolParamFormat - name: str - type: Literal[ToolType.CUSTOM] - - - class azure.ai.projects.types.CustomToolParamFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - GRAMMAR = "grammar" - TEXT = "text" - - - class azure.ai.projects.types.DailyRecurrenceSchedule(TypedDict, total=False): - key "hours": Required[list[int]] - key "type": Required[Literal[RecurrenceType.DAILY]] - hours: list[int] - type: Literal[RecurrenceType.DAILY] - - - class azure.ai.projects.types.DataGenerationJob(TypedDict, total=False): - key "created_at": Required[int] - key "error": ForwardRef('ApiError', module='types') - key "finished_at": int - key "id": Required[str] - key "inputs": ForwardRef('DataGenerationJobInputs', module='types') - key "result": ForwardRef('DataGenerationJobResult', module='types') - key "status": Required[Union[str, JobStatus]] - created_at: int - error: ApiError - finished_at: int - id: str - inputs: DataGenerationJobInputs - result: DataGenerationJobResult - status: Union[str, JobStatus] - - - class azure.ai.projects.types.DataGenerationJobInputs(TypedDict, total=False): - key "name": Required[str] - key "options": Required[DataGenerationJobOptions] - key "output_options": ForwardRef('DataGenerationJobOutputOptions', module='types') - key "scenario": Required[Union[str, DataGenerationJobScenario]] - key "sources": Required[list[DataGenerationJobSource]] - name: str - options: DataGenerationJobOptions - output_options: DataGenerationJobOutputOptions - scenario: Union[str, DataGenerationJobScenario] - sources: list[DataGenerationJobSource] - - - class azure.ai.projects.types.DataGenerationJobOutputOptions(TypedDict, total=False): - key "description": str - key "name": str - description: str - name: str - tags: dict[str, str] - - - class azure.ai.projects.types.DataGenerationJobOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DATASET = "dataset" - FILE = "file" - - - class azure.ai.projects.types.DataGenerationJobResult(TypedDict, total=False): - key "generated_samples": Required[int] - key "token_usage": ForwardRef('DataGenerationTokenUsage', module='types') - generated_samples: int - outputs: list[DataGenerationJobOutput] - token_usage: DataGenerationTokenUsage - - - class azure.ai.projects.types.DataGenerationJobSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENT = "agent" - FILE = "file" - PROMPT = "prompt" - TRACES = "traces" - - - class azure.ai.projects.types.DataGenerationJobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - SIMPLE_QNA = "simple_qna" - SIMULATION_SEED = "simulation_seed" - TOOL_USE = "tool_use" - TRACES = "traces" - - - class azure.ai.projects.types.DataGenerationModelOptions(TypedDict, total=False): - key "model": Required[str] - model: str - - - class azure.ai.projects.types.DataGenerationTokenUsage(TypedDict, total=False): - key "completion_tokens": Required[int] - key "prompt_tokens": Required[int] - key "total_tokens": Required[int] - completion_tokens: int - prompt_tokens: int - total_tokens: int - - - class azure.ai.projects.types.DatasetDataGenerationJobOutput(TypedDict, total=False): - key "description": str - key "id": str - key "name": str - key "type": Required[Literal[DataGenerationJobOutputType.DATASET]] - key "version": str - description: str - id: str - name: str - tags: dict[str, str] - type: Literal[DataGenerationJobOutputType.DATASET] - version: str - - - class azure.ai.projects.types.DatasetEvaluatorGenerationJobSource(TypedDict, total=False): - key "description": str - key "name": Required[str] - key "type": Required[Literal[EvaluatorGenerationJobSourceType.DATASET]] - key "version": str - description: str - name: str - type: Literal[EvaluatorGenerationJobSourceType.DATASET] - version: str - - - class azure.ai.projects.types.DatasetReference(TypedDict, total=False): - key "name": Required[str] - key "version": Required[str] - name: str - version: str - - - class azure.ai.projects.types.DatasetType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - URI_FILE = "uri_file" - URI_FOLDER = "uri_folder" - - - class azure.ai.projects.types.DeleteScopeRequest(TypedDict, total=False): - key "scope": Required[str] - scope: str - - - class azure.ai.projects.types.Dimension(TypedDict, total=False): - key "always_applicable": bool - key "description": Required[str] - key "id": Required[str] - key "weight": Required[int] - always_applicable: bool - description: str - id: str - weight: int - - - class azure.ai.projects.types.DispatchRoutineAsyncRequest(TypedDict, total=False): - key "payload": ForwardRef('RoutineDispatchPayload', module='types') - payload: RoutineDispatchPayload - - - class azure.ai.projects.types.EmbeddingConfiguration(TypedDict, total=False): - key "embeddingField": Required[str] - key "modelDeploymentName": Required[str] - embeddingField: str - modelDeploymentName: str - - - class azure.ai.projects.types.EmptyModelParam(TypedDict, total=False): - - - class azure.ai.projects.types.EndpointBasedEvaluatorDefinition(TypedDict, total=False): - key "connection_name": Required[str] - key "type": Required[Literal[EvaluatorDefinitionType.ENDPOINT]] - connection_name: str - data_schema: dict[str, Any] - init_parameters: dict[str, Any] - metrics: dict[str, EvaluatorMetric] - type: Literal[EvaluatorDefinitionType.ENDPOINT] - - - class azure.ai.projects.types.EntraAuthorizationScheme(TypedDict, total=False): - key "type": Required[Literal[AgentEndpointAuthorizationSchemeType.ENTRA]] - type: Literal[AgentEndpointAuthorizationSchemeType.ENTRA] - - - class azure.ai.projects.types.EvalResult(TypedDict, total=False): - key "name": Required[str] - key "passed": Required[bool] - key "score": Required[float] - key "type": Required[str] - name: str - passed: bool - score: float - type: str - - - class azure.ai.projects.types.EvalRunResultCompareItem(TypedDict, total=False): - key "deltaEstimate": Required[float] - key "pValue": Required[float] - key "treatmentEffect": Required[Union[str, TreatmentEffectType]] - key "treatmentRunId": Required[str] - key "treatmentRunSummary": Required[EvalRunResultSummary] - deltaEstimate: float - pValue: float - treatmentEffect: Union[str, TreatmentEffectType] - treatmentRunId: str - treatmentRunSummary: EvalRunResultSummary - - - class azure.ai.projects.types.EvalRunResultComparison(TypedDict, total=False): - key "baselineRunSummary": Required[EvalRunResultSummary] - key "compareItems": Required[list[EvalRunResultCompareItem]] - key "evaluator": Required[str] - key "metric": Required[str] - key "testingCriteria": Required[str] - baselineRunSummary: EvalRunResultSummary - compareItems: list[EvalRunResultCompareItem] - evaluator: str - metric: str - testingCriteria: str - - - class azure.ai.projects.types.EvalRunResultSummary(TypedDict, total=False): - key "average": Required[float] - key "runId": Required[str] - key "sampleCount": Required[int] - key "standardDeviation": Required[float] - average: float - runId: str - sampleCount: int - standardDeviation: float - - - class azure.ai.projects.types.EvaluationComparisonInsightRequest(TypedDict, total=False): - key "baselineRunId": Required[str] - key "evalId": Required[str] - key "treatmentRunIds": Required[list[str]] - key "type": Required[Literal[InsightType.EVALUATION_COMPARISON]] - baselineRunId: str - evalId: str - treatmentRunIds: list[str] - type: Literal[InsightType.EVALUATION_COMPARISON] - - - class azure.ai.projects.types.EvaluationComparisonInsightResult(TypedDict, total=False): - key "comparisons": Required[list[EvalRunResultComparison]] - key "method": Required[str] - key "type": Required[Literal[InsightType.EVALUATION_COMPARISON]] - comparisons: list[EvalRunResultComparison] - method: str - type: Literal[InsightType.EVALUATION_COMPARISON] - - - class azure.ai.projects.types.EvaluationResultSample(TypedDict, total=False): - key "correlationInfo": Required[dict[str, Any]] - key "evaluationResult": Required[EvalResult] - key "features": Required[dict[str, Any]] - key "id": Required[str] - key "type": Required[Literal[SampleType.EVALUATION_RESULT_SAMPLE]] - correlationInfo: dict[str, Any] - evaluationResult: EvalResult - features: dict[str, Any] - id: str - type: Literal[SampleType.EVALUATION_RESULT_SAMPLE] - - - class azure.ai.projects.types.EvaluationRule(TypedDict, total=False): - key "action": Required[EvaluationRuleAction] - key "description": str - key "displayName": str - key "enabled": Required[bool] - key "eventType": Required[Union[str, EvaluationRuleEventType]] - key "filter": ForwardRef('EvaluationRuleFilter', module='types') - key "id": Required[str] - key "systemData": Required[dict[str, str]] - action: EvaluationRuleAction - description: str - displayName: str - enabled: bool - eventType: Union[str, EvaluationRuleEventType] - filter: EvaluationRuleFilter - id: str - systemData: dict[str, str] - - - class azure.ai.projects.types.EvaluationRuleActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CONTINUOUS_EVALUATION = "continuousEvaluation" - HUMAN_EVALUATION_PREVIEW = "humanEvaluationPreview" - - - class azure.ai.projects.types.EvaluationRuleFilter(TypedDict, total=False): - key "agentName": Required[str] - agentName: str - - - class azure.ai.projects.types.EvaluationRunClusterInsightRequest(TypedDict, total=False): - key "evalId": Required[str] - key "modelConfiguration": ForwardRef('InsightModelConfiguration', module='types') - key "runIds": Required[list[str]] - key "type": Required[Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT]] - evalId: str - modelConfiguration: InsightModelConfiguration - runIds: list[str] - type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] - - - class azure.ai.projects.types.EvaluationRunClusterInsightResult(TypedDict, total=False): - key "clusterInsight": Required[ClusterInsightResult] - key "type": Required[Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT]] - clusterInsight: ClusterInsightResult - type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] - - - class azure.ai.projects.types.EvaluationScheduleTask(TypedDict, total=False): - key "evalId": Required[str] - key "evalRun": Required[dict[str, Any]] - key "type": Required[Literal[ScheduleTaskType.EVALUATION]] - configuration: dict[str, str] - evalId: str - evalRun: dict[str, Any] - type: Literal[ScheduleTaskType.EVALUATION] - - - class azure.ai.projects.types.EvaluationTaxonomy(TypedDict, total=False): - key "description": str - key "id": str - key "name": Required[str] - key "taxonomyInput": Required[EvaluationTaxonomyInput] - key "version": Required[str] - description: str - id: str - name: str - properties: dict[str, str] - tags: dict[str, str] - taxonomyCategories: list[TaxonomyCategory] - taxonomyInput: EvaluationTaxonomyInput - version: str - - - class azure.ai.projects.types.EvaluationTaxonomyInput(TypedDict, total=False): - key "riskCategories": Required[list[Union[str, RiskCategory]]] - key "target": Required[EvaluationTarget] - key "type": Required[Literal[EvaluationTaxonomyInputType.AGENT]] - riskCategories: list[Union[str, RiskCategory]] - target: EvaluationTarget - type: Literal[EvaluationTaxonomyInputType.AGENT] - - - class azure.ai.projects.types.EvaluationTaxonomyInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENT = "agent" - POLICY = "policy" - - - class azure.ai.projects.types.EvaluatorCredentialRequest(TypedDict, total=False): - key "blob_uri": Required[str] - blob_uri: str - - - class azure.ai.projects.types.EvaluatorDefinitionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CODE = "code" - ENDPOINT = "endpoint" - OPENAI_GRADERS = "openai_graders" - PROMPT = "prompt" - PROMPT_AND_CODE = "prompt_and_code" - RUBRIC = "rubric" - SERVICE = "service" - - - class azure.ai.projects.types.EvaluatorGenerationArtifacts(TypedDict, total=False): - key "dataset": Required[DatasetReference] - key "kinds": Required[list[str]] - dataset: DatasetReference - kinds: list[str] - - - class azure.ai.projects.types.EvaluatorGenerationInputs(TypedDict, total=False): - key "evaluator_description": str - key "evaluator_display_name": str - key "evaluator_name": Required[str] - key "model": Required[str] - key "sources": Required[list[EvaluatorGenerationJobSource]] - evaluator_description: str - evaluator_display_name: str - evaluator_name: str - model: str - sources: list[EvaluatorGenerationJobSource] - - - class azure.ai.projects.types.EvaluatorGenerationJob(TypedDict, total=False): - key "created_at": Required[int] - key "error": ForwardRef('ApiError', module='types') - key "finished_at": int - key "id": Required[str] - key "inputs": ForwardRef('EvaluatorGenerationInputs', module='types') - key "result": ForwardRef('EvaluatorVersion', module='types') - key "status": Required[Union[str, JobStatus]] - key "usage": ForwardRef('EvaluatorGenerationTokenUsage', module='types') - created_at: int - error: ApiError - finished_at: int - id: str - input_quality_warnings: list[RubricGenerationInputQualityWarning] - inputs: EvaluatorGenerationInputs - result: EvaluatorVersion - status: Union[str, JobStatus] - usage: EvaluatorGenerationTokenUsage - - - class azure.ai.projects.types.EvaluatorGenerationJobSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENT = "agent" - DATASET = "dataset" - PROMPT = "prompt" - TRACES = "traces" - - - class azure.ai.projects.types.EvaluatorGenerationTokenUsage(TypedDict, total=False): - key "input_tokens": Required[int] - key "output_tokens": Required[int] - key "total_tokens": Required[int] - input_tokens: int - output_tokens: int - total_tokens: int - - - class azure.ai.projects.types.EvaluatorMetric(TypedDict, total=False): - key "desirable_direction": Union[str, EvaluatorMetricDirection] - key "is_primary": bool - key "max_value": float - key "min_value": float - key "threshold": float - key "type": Union[str, EvaluatorMetricType] - desirable_direction: Union[str, EvaluatorMetricDirection] - is_primary: bool - max_value: float - min_value: float - threshold: float - type: Union[str, EvaluatorMetricType] - - - class azure.ai.projects.types.EvaluatorVersion(TypedDict, total=False): - key "categories": Required[list[Union[str, EvaluatorCategory]]] - key "created_at": Required[str] - key "created_by": Required[str] - key "definition": Required[EvaluatorDefinition] - key "description": str - key "display_name": str - key "evaluator_type": Required[Union[str, EvaluatorType]] - key "generation_artifacts": ForwardRef('EvaluatorGenerationArtifacts', module='types') - key "generation_job_id": str - key "id": str - key "modified_at": Required[str] - key "name": Required[str] - key "version": Required[str] - categories: list[Union[str, EvaluatorCategory]] - created_at: str - created_by: str - definition: EvaluatorDefinition - description: str - display_name: str - evaluator_type: Union[str, EvaluatorType] - generation_artifacts: EvaluatorGenerationArtifacts - generation_job_id: str - id: str - metadata: dict[str, str] - modified_at: str - name: str - supported_evaluation_levels: list[Union[str, EvaluationLevel]] - tags: dict[str, str] - version: str - warnings: list[Union[str, GenerationWarningType]] - - - class azure.ai.projects.types.ExternalAgentDefinition(TypedDict, total=False): - key "kind": Required[Literal[AgentKind.EXTERNAL]] - key "otel_agent_id": str - key "rai_config": ForwardRef('RaiConfig', module='types') - kind: Literal[AgentKind.EXTERNAL] - otel_agent_id: str - rai_config: RaiConfig - - - class azure.ai.projects.types.FabricDataAgentToolParameters(TypedDict, total=False): - project_connections: list[ToolProjectConnection] - - - class azure.ai.projects.types.FabricIQPreviewTool(TypedDict, total=False): - key "project_connection_id": Required[str] - key "require_approval": Optional[Union[MCPToolRequireApproval, str]] - key "server_label": str - key "server_url": str - key "type": Required[Literal[ToolType.FABRIC_IQ_PREVIEW]] - project_connection_id: str - require_approval: Union[MCPToolRequireApproval, str] - server_label: str - server_url: str - type: Literal[ToolType.FABRIC_IQ_PREVIEW] - - - class azure.ai.projects.types.FabricIQPreviewToolboxTool(TypedDict, total=False): - key "description": str - key "name": str - key "project_connection_id": Required[str] - key "require_approval": Optional[Union[MCPToolRequireApproval, str]] - key "server_label": str - key "server_url": str - key "type": Required[Literal[ToolboxToolType.FABRIC_IQ_PREVIEW]] - description: str - name: str - project_connection_id: str - require_approval: Union[MCPToolRequireApproval, str] - server_label: str - server_url: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.FABRIC_IQ_PREVIEW] - - - class azure.ai.projects.types.FieldMapping(TypedDict, total=False): - key "contentFields": Required[list[str]] - key "filepathField": str - key "titleField": str - key "urlField": str - contentFields: list[str] - filepathField: str - metadataFields: list[str] - titleField: str - urlField: str - vectorFields: list[str] - - - class azure.ai.projects.types.FileDataGenerationJobOutput(TypedDict, total=False): - key "filename": Required[str] - key "id": Required[str] - key "type": Required[Literal[DataGenerationJobOutputType.FILE]] - filename: str - id: str - type: Literal[DataGenerationJobOutputType.FILE] - - - class azure.ai.projects.types.FileDataGenerationJobSource(TypedDict, total=False): - key "description": str - key "id": Required[str] - key "type": Required[Literal[DataGenerationJobSourceType.FILE]] - description: str - id: str - type: Literal[DataGenerationJobSourceType.FILE] - - - class azure.ai.projects.types.FileDatasetVersion(TypedDict, total=False): - key "connectionName": str - key "dataUri": Required[str] - key "description": str - key "id": str - key "isReference": bool - key "name": Required[str] - key "type": Required[Literal[DatasetType.URI_FILE]] - key "version": Required[str] - connectionName: str - dataUri: str - description: str - id: str - isReference: bool - name: str - tags: dict[str, str] - type: Literal[DatasetType.URI_FILE] - version: str - - - class azure.ai.projects.types.FileSearchTool(TypedDict, total=False): - key "description": str - key "filters": Optional[Filters] - key "max_num_results": int - key "name": str - key "ranking_options": ForwardRef('RankingOptions', module='types') - key "type": Required[Literal[ToolType.FILE_SEARCH]] - key "vector_store_ids": Required[list[str]] - description: str - filters: Filters - max_num_results: int - name: str - ranking_options: RankingOptions - tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.FILE_SEARCH] - vector_store_ids: list[str] - - - class azure.ai.projects.types.FileSearchToolboxTool(TypedDict, total=False): - key "description": str - key "filters": Optional[Filters] - key "max_num_results": int - key "name": str - key "ranking_options": ForwardRef('RankingOptions', module='types') - key "type": Required[Literal[ToolboxToolType.FILE_SEARCH]] - description: str - filters: Filters - max_num_results: int - name: str - ranking_options: RankingOptions - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.FILE_SEARCH] - vector_store_ids: list[str] - - - class azure.ai.projects.types.FixedRatioVersionSelectionRule(TypedDict, total=False): - key "agent_version": Required[str] - key "traffic_percentage": Required[int] - key "type": Required[Literal[VersionSelectorType.FIXED_RATIO]] - agent_version: str - traffic_percentage: int - type: Literal[VersionSelectorType.FIXED_RATIO] - - - class azure.ai.projects.types.FolderDatasetVersion(TypedDict, total=False): - key "connectionName": str - key "dataUri": Required[str] - key "description": str - key "id": str - key "isReference": bool - key "name": Required[str] - key "type": Required[Literal[DatasetType.URI_FOLDER]] - key "version": Required[str] - connectionName: str - dataUri: str - description: str - id: str - isReference: bool - name: str - tags: dict[str, str] - type: Literal[DatasetType.URI_FOLDER] - version: str - - - class azure.ai.projects.types.FoundryModelWarning(TypedDict, total=False): - key "code": Union[str, FoundryModelWarningCode] - key "message": str - code: Union[str, FoundryModelWarningCode] - message: str - - - class azure.ai.projects.types.FunctionShellToolParam(TypedDict, total=False): - key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] - key "description": str - key "environment": Optional[FunctionShellToolParamEnvironment] - key "name": str - key "type": Required[Literal[ToolType.SHELL]] - allowed_callers: list[Union[str, CallableToolAllowedCaller]] - description: str - environment: FunctionShellToolParamEnvironment - name: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.SHELL] - - - class azure.ai.projects.types.FunctionShellToolParamEnvironmentContainerReferenceParam(TypedDict, total=False): - key "container_id": Required[str] - key "type": Required[Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE]] - container_id: str - type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE] - - - class azure.ai.projects.types.FunctionShellToolParamEnvironmentLocalEnvironmentParam(TypedDict, total=False): - key "type": Required[Literal[FunctionShellToolParamEnvironmentType.LOCAL]] - skills: list[LocalSkillParam] - type: Literal[FunctionShellToolParamEnvironmentType.LOCAL] - - - class azure.ai.projects.types.FunctionShellToolParamEnvironmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CONTAINER_AUTO = "container_auto" - CONTAINER_REFERENCE = "container_reference" - LOCAL = "local" - - - class azure.ai.projects.types.FunctionTool(TypedDict, total=False): - key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] - key "defer_loading": bool - key "description": Optional[str] - key "name": Required[str] - key "output_schema": Optional[dict[str, Any]] - key "parameters": Required[Optional[dict[str, Any]]] - key "strict": Required[Optional[bool]] - key "type": Required[Literal[ToolType.FUNCTION]] - allowed_callers: list[Union[str, CallableToolAllowedCaller]] - defer_loading: bool - description: str - name: str - output_schema: dict[str, Any] - parameters: dict[str, Any] - strict: bool - type: Literal[ToolType.FUNCTION] - - - class azure.ai.projects.types.FunctionToolParam(TypedDict, total=False): - key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] - key "defer_loading": bool - key "description": Optional[str] - key "name": Required[str] - key "output_schema": Optional[dict[str, Any]] - key "parameters": Optional[EmptyModelParam] - key "strict": Optional[bool] - key "type": Required[Literal["function"]] - allowed_callers: list[Union[str, CallableToolAllowedCaller]] - defer_loading: bool - description: str - name: str - output_schema: dict[str, Any] - parameters: EmptyModelParam - strict: bool - type: Literal[function] - - - class azure.ai.projects.types.GenerateAgentRequest(TypedDict, total=False): - key "kind": Required[Union[str, AgentKind]] - kind: Union[str, AgentKind] - - - class azure.ai.projects.types.GitHubIssueRoutineTrigger(TypedDict, total=False): - key "connection_id": Required[str] - key "issue_event": Required[Union[str, GitHubIssueEvent]] - key "owner": Required[str] - key "repository": Required[str] - key "type": Required[Literal[RoutineTriggerType.GITHUB_ISSUE]] - connection_id: str - issue_event: Union[str, GitHubIssueEvent] - owner: str - repository: str - type: Literal[RoutineTriggerType.GITHUB_ISSUE] - - - class azure.ai.projects.types.HeaderTelemetryEndpointAuth(TypedDict, total=False): - key "header_name": Required[str] - key "secret_id": Required[str] - key "secret_key": Required[str] - key "type": Required[Literal[TelemetryEndpointAuthType.HEADER]] - header_name: str - secret_id: str - secret_key: str - type: Literal[TelemetryEndpointAuthType.HEADER] - - - class azure.ai.projects.types.HostedAgentDefinition(TypedDict, total=False): - key "code_configuration": ForwardRef('CodeConfiguration', module='types') - key "container_configuration": ForwardRef('ContainerConfiguration', module='types') - key "cpu": Required[str] - key "kind": Required[Literal[AgentKind.HOSTED]] - key "memory": Required[str] - key "rai_config": ForwardRef('RaiConfig', module='types') - key "telemetry_config": ForwardRef('TelemetryConfig', module='types') - code_configuration: CodeConfiguration - container_configuration: ContainerConfiguration - cpu: str - environment_variables: dict[str, str] - kind: Literal[AgentKind.HOSTED] - memory: str - protocol_versions: list[ProtocolVersionRecord] - rai_config: RaiConfig - telemetry_config: TelemetryConfig - - - class azure.ai.projects.types.HourlyRecurrenceSchedule(TypedDict, total=False): - key "type": Required[Literal[RecurrenceType.HOURLY]] - type: Literal[RecurrenceType.HOURLY] - - - class azure.ai.projects.types.HumanEvaluationPreviewRuleAction(TypedDict, total=False): - key "templateId": Required[str] - key "type": Required[Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW]] - templateId: str - type: Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW] - - - class azure.ai.projects.types.HybridSearchOptions(TypedDict, total=False): - key "embedding_weight": Required[float] - key "text_weight": Required[float] - embedding_weight: float - text_weight: float - - - class azure.ai.projects.types.ImageGenTool(TypedDict, total=False): - key "action": Union[str, ImageGenAction] - key "background": Literal["transparent", "opaque", "auto"] - key "description": str - key "input_fidelity": Optional[Union[str, InputFidelity]] - key "input_image_mask": ForwardRef('ImageGenToolInputImageMask', module='types') - key "model": Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], Literal["gpt-image-5"], str] - key "moderation": Literal["auto", "low"] - key "name": str - key "output_compression": int - key "output_format": Literal["png", "webp", "jpeg"] - key "partial_images": int - key "quality": Literal["low", "medium", "high", "auto"] - key "size": Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str] - key "type": Required[Literal[ToolType.IMAGE_GENERATION]] - action: Union[str, ImageGenAction] - background: Literal[transparent, opaque, auto] - description: str - input_fidelity: Union[str, InputFidelity] - input_image_mask: ImageGenToolInputImageMask - model: Union[Literal[gpt-image-1], Literal[gpt-image-1-mini], Literal[gpt-image-5], str] - moderation: Literal[auto, low] - name: str - output_compression: int - output_format: Literal[png, webp, jpeg] - partial_images: int - quality: Literal[low, medium, high, auto] - size: Union[Literal[1024x1024], Literal[1024x1536], Literal[1536x1024], Literal[auto], str] - tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.IMAGE_GENERATION] - - - class azure.ai.projects.types.ImageGenToolInputImageMask(TypedDict, total=False): - key "file_id": str - key "image_url": str - file_id: str - image_url: str - - - class azure.ai.projects.types.IndexType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AZURE_SEARCH = "AzureSearch" - COSMOS_DB = "CosmosDBNoSqlVectorStore" - MANAGED_AZURE_SEARCH = "ManagedAzureSearch" - - - class azure.ai.projects.types.InlineSkillParam(TypedDict, total=False): - key "description": Required[str] - key "name": Required[str] - key "source": Required[InlineSkillSourceParam] - key "type": Required[Literal[ContainerSkillType.INLINE]] - description: str - name: str - source: InlineSkillSourceParam - type: Literal[ContainerSkillType.INLINE] - - - class azure.ai.projects.types.InlineSkillSourceParam(TypedDict, total=False): - key "data": Required[str] - key "media_type": Required[Literal["application/zip"]] - key "type": Required[Literal["base64"]] - data: str - media_type: Literal[application/zip] - type: Literal[base64] - - - class azure.ai.projects.types.Insight(TypedDict, total=False): - key "displayName": Required[str] - key "id": Required[str] - key "metadata": Required[InsightsMetadata] - key "request": Required[InsightRequest] - key "result": ForwardRef('InsightResult', module='types') - key "state": Required[Union[str, OperationState]] - displayName: str - id: str - metadata: InsightsMetadata - request: InsightRequest - result: InsightResult - state: Union[str, OperationState] - - - class azure.ai.projects.types.InsightCluster(TypedDict, total=False): - key "description": Required[str] - key "id": Required[str] - key "label": Required[str] - key "suggestion": Required[str] - key "suggestionTitle": Required[str] - key "weight": Required[int] - description: str - id: str - label: str - samples: list[InsightSample] - subClusters: list[InsightCluster] - suggestion: str - suggestionTitle: str - weight: int - - - class azure.ai.projects.types.InsightModelConfiguration(TypedDict, total=False): - key "modelDeploymentName": Required[str] - modelDeploymentName: str - - - class azure.ai.projects.types.InsightSample(TypedDict, total=False): - key "correlationInfo": Required[dict[str, Any]] - key "evaluationResult": Required[EvalResult] - key "features": Required[dict[str, Any]] - key "id": Required[str] - key "type": Required[Literal[SampleType.EVALUATION_RESULT_SAMPLE]] - correlationInfo: dict[str, Any] - evaluationResult: EvalResult - features: dict[str, Any] - id: str - type: Literal[SampleType.EVALUATION_RESULT_SAMPLE] - - - class azure.ai.projects.types.InsightScheduleTask(TypedDict, total=False): - key "insight": Required[Insight] - key "type": Required[Literal[ScheduleTaskType.INSIGHT]] - configuration: dict[str, str] - insight: Insight - type: Literal[ScheduleTaskType.INSIGHT] - - - class azure.ai.projects.types.InsightSummary(TypedDict, total=False): - key "method": Required[str] - key "sampleCount": Required[int] - key "uniqueClusterCount": Required[int] - key "uniqueSubclusterCount": Required[int] - key "usage": Required[ClusterTokenUsage] - method: str - sampleCount: int - uniqueClusterCount: int - uniqueSubclusterCount: int - usage: ClusterTokenUsage - - - class azure.ai.projects.types.InsightType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENT_CLUSTER_INSIGHT = "AgentClusterInsight" - EVALUATION_COMPARISON = "EvaluationComparison" - EVALUATION_RUN_CLUSTER_INSIGHT = "EvaluationRunClusterInsight" - - - class azure.ai.projects.types.InsightsMetadata(TypedDict, total=False): - key "completedAt": str - key "createdAt": Required[str] - completedAt: str - createdAt: str - - - class azure.ai.projects.types.InvocationsProtocolConfiguration(TypedDict, total=False): - - - class azure.ai.projects.types.InvocationsWsProtocolConfiguration(TypedDict, total=False): - - - class azure.ai.projects.types.InvokeAgentInvocationsApiDispatchPayload(TypedDict, total=False): - key "input": Required[Any] - key "type": Required[Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API]] - input: Any - type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API] - - - class azure.ai.projects.types.InvokeAgentInvocationsApiRoutineAction(TypedDict, total=False): - key "agent_endpoint_id": str - key "agent_name": str - key "input": Any - key "session_id": str - key "type": Required[Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API]] - agent_endpoint_id: str - agent_name: str - input: Any - session_id: str - type: Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API] - - - class azure.ai.projects.types.InvokeAgentResponsesApiDispatchPayload(TypedDict, total=False): - key "input": Required[Any] - key "type": Required[Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API]] - input: Any - type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API] - - - class azure.ai.projects.types.InvokeAgentResponsesApiRoutineAction(TypedDict, total=False): - key "agent_endpoint_id": str - key "agent_name": str - key "conversation": str - key "input": Any - key "type": Required[Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API]] - agent_endpoint_id: str - agent_name: str - conversation: str - input: Any - type: Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API] - - - class azure.ai.projects.types.ListMemoriesRequest(TypedDict, total=False): - key "scope": Required[str] - scope: str - - - class azure.ai.projects.types.LlmGeneratedVoiceGreetingConfig(TypedDict, total=False): - key "prompt": Required[str] - key "tool_choice": ForwardRef('VoiceAgentToolChoice', module='types') - key "type": Required[Literal["llm_generated"]] - prompt: str - tool_choice: VoiceAgentToolChoice - type: Literal[llm_generated] - - - class azure.ai.projects.types.LocalShellToolParam(TypedDict, total=False): - key "description": str - key "name": str - key "type": Required[Literal[ToolType.LOCAL_SHELL]] - description: str - name: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.LOCAL_SHELL] - - - class azure.ai.projects.types.LocalSkillParam(TypedDict, total=False): - key "description": Required[str] - key "name": Required[str] - key "path": Required[str] - description: str - name: str - path: str - - - class azure.ai.projects.types.LogProbProperties(TypedDict, total=False): - key "bytes": Required[list[int]] - key "logprob": Required[float] - key "token": Required[str] - bytes: list[int] - logprob: float - token: str - - - class azure.ai.projects.types.LoraConfig(TypedDict, total=False): - key "alpha": int - key "dropout": float - key "rank": int - alpha: int - dropout: float - rank: int - targetModules: list[str] - - - class azure.ai.projects.types.MCPListToolsTool(TypedDict, total=False): - key "annotations": Optional[MCPListToolsToolAnnotations] - key "description": Optional[str] - key "input_schema": Required[MCPListToolsToolInputSchema] - key "name": Required[str] - annotations: MCPListToolsToolAnnotations - description: str - input_schema: MCPListToolsToolInputSchema - name: str - - - class azure.ai.projects.types.MCPListToolsToolAnnotations(TypedDict, total=False): - - - class azure.ai.projects.types.MCPListToolsToolInputSchema(TypedDict, total=False): - - - class azure.ai.projects.types.MCPTool(TypedDict, total=False): - key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] - key "allowed_tools": Optional[Union[list[str], MCPToolFilter]] - key "authorization": str - key "connector_id": Literal["connector_dropbox", "connector_gmail", "connector_googlecalendar", "connector_googledrive", "connector_microsoftteams", "connector_outlookcalendar", "connector_outlookemail", "connector_sharepoint"] - key "defer_loading": bool - key "headers": Optional[dict[str, str]] - key "project_connection_id": str - key "require_approval": Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] - key "server_description": str - key "server_label": Required[str] - key "server_url": str - key "tunnel_id": str - key "type": Required[Literal[ToolType.MCP]] - allowed_callers: list[Union[str, CallableToolAllowedCaller]] - allowed_tools: Union[list[str], MCPToolFilter] - authorization: str - connector_id: Literal[connector_dropbox, connector_gmail, connector_googlecalendar, connector_googledrive, connector_microsoftteams, - defer_loading: bool - headers: dict[str, str] - project_connection_id: str - require_approval: Union[MCPToolRequireApproval, Literal[always], Literal[never]] - server_description: str - server_label: str - server_url: str - tool_configs: dict[str, ToolConfig] - tunnel_id: str - type: Literal[ToolType.MCP] - - - class azure.ai.projects.types.MCPToolFilter(TypedDict, total=False): - key "read_only": bool - read_only: bool - tool_names: list[str] - - - class azure.ai.projects.types.MCPToolRequireApproval(TypedDict, total=False): - key "always": ForwardRef('MCPToolFilter', module='types') - key "never": ForwardRef('MCPToolFilter', module='types') - always: MCPToolFilter - never: MCPToolFilter - - - class azure.ai.projects.types.MCPToolboxTool(TypedDict, total=False): - key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] - key "allowed_tools": Optional[Union[list[str], MCPToolFilter]] - key "authorization": str - key "connector_id": Literal["connector_dropbox", "connector_gmail", "connector_googlecalendar", "connector_googledrive", "connector_microsoftteams", "connector_outlookcalendar", "connector_outlookemail", "connector_sharepoint"] - key "defer_loading": bool - key "description": str - key "headers": Optional[dict[str, str]] - key "name": str - key "project_connection_id": str - key "require_approval": Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] - key "server_description": str - key "server_label": Required[str] - key "server_url": str - key "tunnel_id": str - key "type": Required[Literal[ToolboxToolType.MCP]] - allowed_callers: list[Union[str, CallableToolAllowedCaller]] - allowed_tools: Union[list[str], MCPToolFilter] - authorization: str - connector_id: Literal[connector_dropbox, connector_gmail, connector_googlecalendar, connector_googledrive, connector_microsoftteams, - defer_loading: bool - description: str - headers: dict[str, str] - name: str - project_connection_id: str - require_approval: Union[MCPToolRequireApproval, Literal[always], Literal[never]] - server_description: str - server_label: str - server_url: str - tool_configs: dict[str, ToolConfig] - tunnel_id: str - type: Literal[ToolboxToolType.MCP] - - - class azure.ai.projects.types.ManagedAgentIdentityBlueprintReference(TypedDict, total=False): - key "blueprint_id": Required[str] - key "type": Required[Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT]] - blueprint_id: str - type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] - - - class azure.ai.projects.types.ManagedAzureAISearchIndex(TypedDict, total=False): - key "description": str - key "id": str - key "name": Required[str] - key "type": Required[Literal[IndexType.MANAGED_AZURE_SEARCH]] - key "vectorStoreId": Required[str] - key "version": Required[str] - description: str - id: str - name: str - tags: dict[str, str] - type: Literal[IndexType.MANAGED_AZURE_SEARCH] - vectorStoreId: str - version: str - - - class azure.ai.projects.types.McpProtocolConfiguration(TypedDict, total=False): - - - class azure.ai.projects.types.MemorySearchOptions(TypedDict, total=False): - key "max_memories": int - max_memories: int - - - class azure.ai.projects.types.MemorySearchPreviewTool(TypedDict, total=False): - key "memory_store_name": Required[str] - key "scope": Required[str] - key "search_options": ForwardRef('MemorySearchOptions', module='types') - key "type": Required[Literal[ToolType.MEMORY_SEARCH_PREVIEW]] - key "update_delay": int - memory_store_name: str - scope: str - search_options: MemorySearchOptions - type: Literal[ToolType.MEMORY_SEARCH_PREVIEW] - update_delay: int - - - class azure.ai.projects.types.MemoryStoreDefaultDefinition(TypedDict, total=False): - key "chat_model": Required[str] - key "embedding_model": Required[str] - key "kind": Required[Literal[MemoryStoreKind.DEFAULT]] - key "options": ForwardRef('MemoryStoreDefaultOptions', module='types') - chat_model: str - embedding_model: str - kind: Literal[MemoryStoreKind.DEFAULT] - options: MemoryStoreDefaultOptions - - - class azure.ai.projects.types.MemoryStoreDefaultOptions(TypedDict, total=False): - key "chat_summary_enabled": Required[bool] - key "default_ttl_seconds": str - key "procedural_memory_enabled": bool - key "user_profile_details": str - key "user_profile_enabled": Required[bool] - chat_summary_enabled: bool - default_ttl_seconds: str - procedural_memory_enabled: bool - user_profile_details: str - user_profile_enabled: bool - - - class azure.ai.projects.types.MemoryStoreDefinition(TypedDict, total=False): - key "chat_model": Required[str] - key "embedding_model": Required[str] - key "kind": Required[Literal[MemoryStoreKind.DEFAULT]] - key "options": ForwardRef('MemoryStoreDefaultOptions', module='types') - chat_model: str - embedding_model: str - kind: Literal[MemoryStoreKind.DEFAULT] - options: MemoryStoreDefaultOptions - - - class azure.ai.projects.types.MemoryStoreKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DEFAULT = "default" - - - class azure.ai.projects.types.Metadata(TypedDict, total=False): - - - class azure.ai.projects.types.MicrosoftFabricPreviewTool(TypedDict, total=False): - key "fabric_dataagent_preview": Required[FabricDataAgentToolParameters] - key "type": Required[Literal[ToolType.FABRIC_DATAAGENT_PREVIEW]] - fabric_dataagent_preview: FabricDataAgentToolParameters - type: Literal[ToolType.FABRIC_DATAAGENT_PREVIEW] - - - class azure.ai.projects.types.ModelCredentialRequest(TypedDict, total=False): - key "blobUri": Required[str] - blobUri: str - - - class azure.ai.projects.types.ModelPendingUploadRequest(TypedDict, total=False): - key "connectionName": str - key "pendingUploadId": str - key "pendingUploadType": Required[Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE]] - connectionName: str - pendingUploadId: str - pendingUploadType: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] - - - class azure.ai.projects.types.ModelSamplingParams(TypedDict, total=False): - key "max_completion_tokens": int - key "seed": int - key "temperature": float - key "top_p": float - max_completion_tokens: int - seed: int - temperature: float - top_p: float - - - class azure.ai.projects.types.ModelSourceData(TypedDict, total=False): - key "jobId": str - key "sourceType": Union[str, FoundryModelSourceType] - jobId: str - sourceType: Union[str, FoundryModelSourceType] - - - class azure.ai.projects.types.ModelVersion(TypedDict, total=False): - key "artifactProfile": ForwardRef('ArtifactProfile', module='types') - key "baseModel": str - key "blobUri": Required[str] - key "description": str - key "id": str - key "loraConfig": ForwardRef('LoraConfig', module='types') - key "name": Required[str] - key "source": ForwardRef('ModelSourceData', module='types') - key "version": Required[str] - key "weightType": Union[str, FoundryModelWeightType] - artifactProfile: ArtifactProfile - baseModel: str - blobUri: str - description: str - id: str - loraConfig: LoraConfig - name: str - source: ModelSourceData - tags: dict[str, str] - version: str - warnings: list[FoundryModelWarning] - weightType: Union[str, FoundryModelWeightType] - - - class azure.ai.projects.types.MonthlyRecurrenceSchedule(TypedDict, total=False): - key "daysOfMonth": Required[list[int]] - key "type": Required[Literal[RecurrenceType.MONTHLY]] - daysOfMonth: list[int] - type: Literal[RecurrenceType.MONTHLY] - - - class azure.ai.projects.types.NamespaceToolParam(TypedDict, total=False): - key "description": Required[str] - key "name": Required[str] - key "tools": Required[list[Union[FunctionToolParam, CustomToolParam]]] - key "type": Required[Literal[ToolType.NAMESPACE]] - description: str - name: str - tools: list[Union[FunctionToolParam, CustomToolParam]] - type: Literal[ToolType.NAMESPACE] - - - class azure.ai.projects.types.OmitPropertiesRealtimeResponse1(TypedDict, total=False): - key "conversation_id": str - key "id": str - key "max_output_tokens": Union[int, Literal["inf"]] - key "metadata": Optional[Metadata] - key "object": Literal["response"] - key "status": Literal["completed", "cancelled", "failed", "incomplete", "in_progress"] - key "status_details": ForwardRef('RealtimeResponseStatusDetails', module='types') - key "usage": ForwardRef('RealtimeResponseUsage', module='types') - conversation_id: str - id: str - max_output_tokens: Union[int, Literal[inf]] - metadata: Metadata - object: Literal[response] - output_modalities: list[Literal["text", "audio"]] - status: Literal[completed, cancelled, failed, incomplete, in_progress] - status_details: RealtimeResponseStatusDetails - usage: RealtimeResponseUsage - - - class azure.ai.projects.types.OneTimeTrigger(TypedDict, total=False): - key "timeZone": str - key "triggerAt": Required[str] - key "type": Required[Literal[TriggerType.ONE_TIME]] - timeZone: str - triggerAt: str - type: Literal[TriggerType.ONE_TIME] - - - class azure.ai.projects.types.OpenApiAnonymousAuthDetails(TypedDict, total=False): - key "type": Required[Literal[OpenApiAuthType.ANONYMOUS]] - type: Literal[OpenApiAuthType.ANONYMOUS] - - - class azure.ai.projects.types.OpenApiAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ANONYMOUS = "anonymous" - MANAGED_IDENTITY = "managed_identity" - PROJECT_CONNECTION = "project_connection" - - - class azure.ai.projects.types.OpenApiFunctionDefinition(TypedDict, total=False): - key "auth": Required[OpenApiAuthDetails] - key "description": str - key "name": Required[str] - key "spec": Required[dict[str, Any]] - auth: OpenApiAuthDetails - default_params: list[str] - description: str - functions: list[OpenApiFunctionDefinitionFunction] - name: str - spec: dict[str, Any] - - - class azure.ai.projects.types.OpenApiFunctionDefinitionFunction(TypedDict, total=False): - key "description": str - key "name": Required[str] - key "parameters": Required[dict[str, Any]] - description: str - name: str - parameters: dict[str, Any] - - - class azure.ai.projects.types.OpenApiManagedAuthDetails(TypedDict, total=False): - key "security_scheme": Required[OpenApiManagedSecurityScheme] - key "type": Required[Literal[OpenApiAuthType.MANAGED_IDENTITY]] - security_scheme: OpenApiManagedSecurityScheme - type: Literal[OpenApiAuthType.MANAGED_IDENTITY] - - - class azure.ai.projects.types.OpenApiManagedSecurityScheme(TypedDict, total=False): - key "audience": Required[str] - audience: str - - - class azure.ai.projects.types.OpenApiProjectConnectionAuthDetails(TypedDict, total=False): - key "security_scheme": Required[OpenApiProjectConnectionSecurityScheme] - key "type": Required[Literal[OpenApiAuthType.PROJECT_CONNECTION]] - security_scheme: OpenApiProjectConnectionSecurityScheme - type: Literal[OpenApiAuthType.PROJECT_CONNECTION] - - - class azure.ai.projects.types.OpenApiProjectConnectionSecurityScheme(TypedDict, total=False): - key "project_connection_id": Required[str] - project_connection_id: str - - - class azure.ai.projects.types.OpenApiTool(TypedDict, total=False): - key "openapi": Required[OpenApiFunctionDefinition] - key "type": Required[Literal[ToolType.OPENAPI]] - openapi: OpenApiFunctionDefinition - tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.OPENAPI] - - - class azure.ai.projects.types.OpenApiToolboxTool(TypedDict, total=False): - key "description": str - key "name": str - key "openapi": Required[OpenApiFunctionDefinition] - key "type": Required[Literal[ToolboxToolType.OPENAPI]] - description: str - name: str - openapi: OpenApiFunctionDefinition - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.OPENAPI] - - - class azure.ai.projects.types.OptimizedAgentIdentifier(TypedDict, total=False): - key "agent_name": Required[str] - key "agent_version": str - agent_name: str - agent_version: str - - - class azure.ai.projects.types.OtlpTelemetryEndpoint(TypedDict, total=False): - key "auth": ForwardRef('TelemetryEndpointAuth', module='types') - key "data": Required[list[Union[str, TelemetryDataKind]]] - key "endpoint": Required[str] - key "kind": Required[Literal[TelemetryEndpointKind.OTLP]] - key "protocol": Required[Union[str, TelemetryTransportProtocol]] - auth: TelemetryEndpointAuth - data: list[Union[str, TelemetryDataKind]] - endpoint: str - kind: Literal[TelemetryEndpointKind.OTLP] - protocol: Union[str, TelemetryTransportProtocol] - - - class azure.ai.projects.types.PatchAgentObjectRequest(TypedDict, total=False): - key "agent_card": ForwardRef('AgentCard', module='types') - key "agent_endpoint": ForwardRef('AgentEndpointConfig', module='types') - agent_card: AgentCard - agent_endpoint: AgentEndpointConfig - - - class azure.ai.projects.types.PendingUploadRequest(TypedDict, total=False): - key "connectionName": str - key "pendingUploadId": str - key "pendingUploadType": Required[Literal[PendingUploadType.BLOB_REFERENCE]] - connectionName: str - pendingUploadId: str - pendingUploadType: Literal[PendingUploadType.BLOB_REFERENCE] - - - class azure.ai.projects.types.PendingUploadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - BLOB_REFERENCE = "BlobReference" - NONE = "None" - TEMPORARY_BLOB_REFERENCE = "TemporaryBlobReference" - - - class azure.ai.projects.types.PickPropertiesVoiceAudioConfig(TypedDict, total=False): - key "output": ForwardRef('VoiceAudioOutputConfig', module='types') - output: VoiceAudioOutputConfig - - - class azure.ai.projects.types.ProgrammaticToolCallingParam(TypedDict, total=False): - key "type": Required[Literal[ToolType.PROGRAMMATIC_TOOL_CALLING]] - type: Literal[ToolType.PROGRAMMATIC_TOOL_CALLING] - - - class azure.ai.projects.types.PromotionInfo(TypedDict, total=False): - key "agent_name": Required[str] - key "agent_version": Required[str] - key "promoted_at": Required[int] - agent_name: str - agent_version: str - promoted_at: int - - - class azure.ai.projects.types.PromptAgentDefinition(TypedDict, total=False): - key "instructions": Optional[str] - key "kind": Required[Literal[AgentKind.PROMPT]] - key "model": Required[str] - key "rai_config": ForwardRef('RaiConfig', module='types') - key "reasoning": Optional[Reasoning] - key "temperature": Optional[float] - key "text": ForwardRef('PromptAgentDefinitionTextOptions', module='types') - key "tool_choice": Union[str, ToolChoiceParam] - key "top_p": Optional[float] - instructions: str - kind: Literal[AgentKind.PROMPT] - model: str - rai_config: RaiConfig - reasoning: Reasoning - structured_inputs: dict[str, StructuredInputDefinition] - temperature: float - text: PromptAgentDefinitionTextOptions - tool_choice: Union[str, ToolChoiceParam] - tools: list[Tool] - top_p: float - - - class azure.ai.projects.types.PromptAgentDefinitionTextOptions(TypedDict, total=False): - key "format": ForwardRef('TextResponseFormat', module='types') - format: TextResponseFormat - - - class azure.ai.projects.types.PromptBasedEvaluatorDefinition(TypedDict, total=False): - key "prompt_text": Required[str] - key "type": Required[Literal[EvaluatorDefinitionType.PROMPT]] - data_schema: dict[str, Any] - init_parameters: dict[str, Any] - metrics: dict[str, EvaluatorMetric] - prompt_text: str - type: Literal[EvaluatorDefinitionType.PROMPT] - - - class azure.ai.projects.types.PromptDataGenerationJobSource(TypedDict, total=False): - key "description": str - key "prompt": Required[str] - key "type": Required[Literal[DataGenerationJobSourceType.PROMPT]] - description: str - prompt: str - type: Literal[DataGenerationJobSourceType.PROMPT] - - - class azure.ai.projects.types.PromptEvaluatorGenerationJobSource(TypedDict, total=False): - key "description": str - key "prompt": Required[str] - key "type": Required[Literal[EvaluatorGenerationJobSourceType.PROMPT]] - description: str - prompt: str - type: Literal[EvaluatorGenerationJobSourceType.PROMPT] - - - class azure.ai.projects.types.ProtocolConfiguration(TypedDict, total=False): - key "a2a": ForwardRef('A2AProtocolConfiguration', module='types') - key "activity": ForwardRef('ActivityProtocolConfiguration', module='types') - key "invocations": ForwardRef('InvocationsProtocolConfiguration', module='types') - key "invocations_ws": ForwardRef('InvocationsWsProtocolConfiguration', module='types') - key "mcp": ForwardRef('McpProtocolConfiguration', module='types') - key "responses": ForwardRef('ResponsesProtocolConfiguration', module='types') - a2a: A2AProtocolConfiguration - activity: ActivityProtocolConfiguration - invocations: InvocationsProtocolConfiguration - invocations_ws: InvocationsWsProtocolConfiguration - mcp: McpProtocolConfiguration - responses: ResponsesProtocolConfiguration - - - class azure.ai.projects.types.ProtocolVersionRecord(TypedDict, total=False): - key "protocol": Required[Union[str, AgentEndpointProtocol]] - key "version": Required[str] - protocol: Union[str, AgentEndpointProtocol] - version: str - - - class azure.ai.projects.types.RaiConfig(TypedDict, total=False): - key "rai_policy_name": Required[str] - rai_policy_name: str - - - class azure.ai.projects.types.RankingOptions(TypedDict, total=False): - key "hybrid_search": ForwardRef('HybridSearchOptions', module='types') - key "ranker": Union[str, RankerVersionType] - key "score_threshold": float - hybrid_search: HybridSearchOptions - ranker: Union[str, RankerVersionType] - score_threshold: float - - - class azure.ai.projects.types.RealtimeAudioFormatsAudioPcm(TypedDict, total=False): - key "rate": Literal[24000] - key "type": Required[Literal[RealtimeAudioFormatsType.AUDIO_PCM]] - rate: Literal[24000] - type: Literal[RealtimeAudioFormatsType.AUDIO_PCM] - - - class azure.ai.projects.types.RealtimeAudioFormatsAudioPcma(TypedDict, total=False): - key "type": Required[Literal[RealtimeAudioFormatsType.AUDIO_PCMA]] - type: Literal[RealtimeAudioFormatsType.AUDIO_PCMA] - - - class azure.ai.projects.types.RealtimeAudioFormatsAudioPcmu(TypedDict, total=False): - key "type": Required[Literal[RealtimeAudioFormatsType.AUDIO_PCMU]] - type: Literal[RealtimeAudioFormatsType.AUDIO_PCMU] - - - class azure.ai.projects.types.RealtimeAudioFormatsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AUDIO_PCM = "audio/pcm" - AUDIO_PCMA = "audio/pcma" - AUDIO_PCMU = "audio/pcmu" - - - class azure.ai.projects.types.RealtimeClientEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CONVERSATION_ITEM_CREATE = "conversation.item.create" - CONVERSATION_ITEM_DELETE = "conversation.item.delete" - CONVERSATION_ITEM_RETRIEVE = "conversation.item.retrieve" - CONVERSATION_ITEM_TRUNCATE = "conversation.item.truncate" - INPUT_AUDIO_BUFFER_APPEND = "input_audio_buffer.append" - INPUT_AUDIO_BUFFER_CLEAR = "input_audio_buffer.clear" - INPUT_AUDIO_BUFFER_COMMIT = "input_audio_buffer.commit" - OUTPUT_AUDIO_BUFFER_CLEAR = "output_audio_buffer.clear" - RESPONSE_CANCEL = "response.cancel" - RESPONSE_CREATE = "response.create" - SESSION_UPDATE = "session.update" - - - class azure.ai.projects.types.RealtimeConversationItemFunctionCall(TypedDict, total=False): - key "arguments": Required[str] - key "call_id": str - key "id": str - key "name": Required[str] - key "object": Literal["item"] - key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal[RealtimeConversationItemType.FUNCTION_CALL]] - arguments: str - call_id: str - id: str - name: str - object: Literal[item] - status: Literal[completed, incomplete, in_progress] - type: Literal[RealtimeConversationItemType.FUNCTION_CALL] - - - class azure.ai.projects.types.RealtimeConversationItemFunctionCallOutput(TypedDict, total=False): - key "call_id": Required[str] - key "id": str - key "object": Literal["item"] - key "output": Required[str] - key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT]] - call_id: str - id: str - object: Literal[item] - output: str - status: Literal[completed, incomplete, in_progress] - type: Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT] - - - class azure.ai.projects.types.RealtimeConversationItemMessageAssistant(TypedDict, total=False): - key "content": Required[list[RealtimeConversationItemMessageAssistantContent]] - key "id": str - key "object": Literal["item"] - key "role": Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] - key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal["message"]] - content: list[RealtimeConversationItemMessageAssistantContent] - id: str - object: Literal[item] - role: Literal[RealtimeConversationItemMessageType.ASSISTANT] - status: Literal[completed, incomplete, in_progress] - type: Literal[message] - - - class azure.ai.projects.types.RealtimeConversationItemMessageAssistantContent(TypedDict, total=False): - key "audio": str - key "text": str - key "transcript": str - key "type": Literal["output_text", "output_audio"] - audio: str - text: str - transcript: str - type: Literal[output_text, output_audio] - - - class azure.ai.projects.types.RealtimeConversationItemMessageSystem(TypedDict, total=False): - key "content": Required[list[RealtimeConversationItemMessageSystemContent]] - key "id": str - key "object": Literal["item"] - key "role": Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] - key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal["message"]] - content: list[RealtimeConversationItemMessageSystemContent] - id: str - object: Literal[item] - role: Literal[RealtimeConversationItemMessageType.SYSTEM] - status: Literal[completed, incomplete, in_progress] - type: Literal[message] - - - class azure.ai.projects.types.RealtimeConversationItemMessageSystemContent(TypedDict, total=False): - key "text": str - key "type": Literal["input_text"] - text: str - type: Literal[input_text] - - - class azure.ai.projects.types.RealtimeConversationItemMessageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ASSISTANT = "assistant" - SYSTEM = "system" - USER = "user" - - - class azure.ai.projects.types.RealtimeConversationItemMessageUser(TypedDict, total=False): - key "content": Required[list[RealtimeConversationItemMessageUserContent]] - key "id": str - key "object": Literal["item"] - key "role": Required[Literal[RealtimeConversationItemMessageType.USER]] - key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal["message"]] - content: list[RealtimeConversationItemMessageUserContent] - id: str - object: Literal[item] - role: Literal[RealtimeConversationItemMessageType.USER] - status: Literal[completed, incomplete, in_progress] - type: Literal[message] - - - class azure.ai.projects.types.RealtimeConversationItemMessageUserContent(TypedDict, total=False): - key "audio": str - key "detail": Literal["auto", "low", "high"] - key "image_url": str - key "text": str - key "transcript": str - key "type": Literal["input_text", "input_audio", "input_image"] - audio: str - detail: Literal[auto, low, high] - image_url: str - text: str - transcript: str - type: Literal[input_text, input_audio, input_image] - - - class azure.ai.projects.types.RealtimeConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FUNCTION_CALL = "function_call" - FUNCTION_CALL_OUTPUT = "function_call_output" - MCP_APPROVAL_REQUEST = "mcp_approval_request" - MCP_APPROVAL_RESPONSE = "mcp_approval_response" - MCP_CALL = "mcp_call" - MCP_LIST_TOOLS = "mcp_list_tools" - - - class azure.ai.projects.types.RealtimeFunctionTool(TypedDict, total=False): - key "description": str - key "name": str - key "parameters": ForwardRef('RealtimeFunctionToolParameters', module='types') - key "type": Literal["function"] - description: str - name: str - parameters: RealtimeFunctionToolParameters - type: Literal[function] - - - class azure.ai.projects.types.RealtimeFunctionToolParameters(TypedDict, total=False): - - - class azure.ai.projects.types.RealtimeMCPApprovalRequest(TypedDict, total=False): - key "arguments": Required[str] - key "id": Required[str] - key "name": Required[str] - key "server_label": Required[str] - key "type": Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST]] - arguments: str - id: str - name: str - server_label: str - type: Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST] - - - class azure.ai.projects.types.RealtimeMCPApprovalResponse(TypedDict, total=False): - key "approval_request_id": Required[str] - key "approve": Required[bool] - key "id": Required[str] - key "reason": Optional[str] - key "type": Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE]] - approval_request_id: str - approve: bool - id: str - reason: str - type: Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE] - - - class azure.ai.projects.types.RealtimeMCPHTTPError(TypedDict, total=False): - key "code": Required[int] - key "message": Required[str] - key "type": Required[Literal[RealtimeMcpErrorType.HTTP_ERROR]] - code: int - message: str - type: Literal[RealtimeMcpErrorType.HTTP_ERROR] - - - class azure.ai.projects.types.RealtimeMCPListTools(TypedDict, total=False): - key "id": str - key "server_label": Required[str] - key "tools": Required[list[MCPListToolsTool]] - key "type": Required[Literal[RealtimeConversationItemType.MCP_LIST_TOOLS]] - id: str - server_label: str - tools: list[MCPListToolsTool] - type: Literal[RealtimeConversationItemType.MCP_LIST_TOOLS] - - - class azure.ai.projects.types.RealtimeMCPProtocolError(TypedDict, total=False): - key "code": Required[int] - key "message": Required[str] - key "type": Required[Literal[RealtimeMcpErrorType.PROTOCOL_ERROR]] - code: int - message: str - type: Literal[RealtimeMcpErrorType.PROTOCOL_ERROR] - - - class azure.ai.projects.types.RealtimeMCPToolCall(TypedDict, total=False): - key "approval_request_id": Optional[str] - key "arguments": Required[str] - key "error": ForwardRef('RealtimeMCPError', module='types') - key "id": Required[str] - key "name": Required[str] - key "output": Optional[str] - key "server_label": Required[str] - key "type": Required[Literal[RealtimeConversationItemType.MCP_CALL]] - approval_request_id: str - arguments: str - error: RealtimeMCPError - id: str - name: str - output: str - server_label: str - type: Literal[RealtimeConversationItemType.MCP_CALL] - - - class azure.ai.projects.types.RealtimeMCPToolExecutionError(TypedDict, total=False): - key "message": Required[str] - key "type": Required[Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR]] - message: str - type: Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR] - - - class azure.ai.projects.types.RealtimeMcpErrorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - HTTP_ERROR = "http_error" - PROTOCOL_ERROR = "protocol_error" - TOOL_EXECUTION_ERROR = "tool_execution_error" - - - class azure.ai.projects.types.RealtimeReasoning(TypedDict, total=False): - key "effort": Union[str, RealtimeReasoningEffort] - effort: Union[str, RealtimeReasoningEffort] - - - class azure.ai.projects.types.RealtimeResponseStatusDetails(TypedDict, total=False): - key "error": ForwardRef('RealtimeResponseStatusDetailsError', module='types') - key "reason": Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"] - key "type": Literal["completed", "cancelled", "failed", "incomplete"] - error: RealtimeResponseStatusDetailsError - reason: Literal[turn_detected, client_cancelled, max_output_tokens, content_filter] - type: Literal[completed, cancelled, failed, incomplete] - - - class azure.ai.projects.types.RealtimeResponseStatusDetailsError(TypedDict, total=False): - key "code": str - key "type": str - code: str - type: str - - - class azure.ai.projects.types.RealtimeResponseUsage(TypedDict, total=False): - key "input_token_details": ForwardRef('RealtimeResponseUsageInputTokenDetails', module='types') - key "input_tokens": int - key "output_token_details": ForwardRef('RealtimeResponseUsageOutputTokenDetails', module='types') - key "output_tokens": int - key "total_tokens": int - input_token_details: RealtimeResponseUsageInputTokenDetails - input_tokens: int - output_token_details: RealtimeResponseUsageOutputTokenDetails - output_tokens: int - total_tokens: int - - - class azure.ai.projects.types.RealtimeResponseUsageInputTokenDetails(TypedDict, total=False): - key "audio_tokens": int - key "cached_tokens": int - key "cached_tokens_details": ForwardRef('RealtimeResponseUsageInputTokenDetailsCachedTokensDetails', module='types') - key "image_tokens": int - key "text_tokens": int - audio_tokens: int - cached_tokens: int - cached_tokens_details: RealtimeResponseUsageInputTokenDetailsCachedTokensDetails - image_tokens: int - text_tokens: int - - - class azure.ai.projects.types.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails(TypedDict, total=False): - key "audio_tokens": int - key "image_tokens": int - key "text_tokens": int - audio_tokens: int - image_tokens: int - text_tokens: int - - - class azure.ai.projects.types.RealtimeResponseUsageOutputTokenDetails(TypedDict, total=False): - key "audio_tokens": int - key "text_tokens": int - audio_tokens: int - text_tokens: int - - - class azure.ai.projects.types.RealtimeServerEvent(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "part": Required[RealtimeServerEventResponseContentPartAddedPart] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED]] - content_index: int - event_id: str - item_id: str - output_index: int - part: RealtimeServerEventResponseContentPartAddedPart - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED] - - - class azure.ai.projects.types.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError(TypedDict, total=False): - key "code": str - key "message": str - key "param": str - key "type": str - code: str - message: str - param: str - type: str - - - class azure.ai.projects.types.RealtimeServerEventError(TypedDict, total=False): - key "error": Required[RealtimeServerEventErrorError] - key "event_id": Required[str] - key "type": Required[Literal["error"]] - error: RealtimeServerEventErrorError - event_id: str - type: Literal[error] - - - class azure.ai.projects.types.RealtimeServerEventErrorError(TypedDict, total=False): - key "code": Optional[str] - key "event_id": Optional[str] - key "message": Required[str] - key "param": Optional[str] - key "type": Required[str] - code: str - event_id: str - message: str - param: str - type: str - - - class azure.ai.projects.types.RealtimeServerEventRateLimitsUpdatedRateLimits(TypedDict, total=False): - key "limit": int - key "name": Literal["requests", "tokens"] - key "remaining": int - key "reset_seconds": float - limit: int - name: Literal[requests, tokens] - remaining: int - reset_seconds: float - - - class azure.ai.projects.types.RealtimeServerEventResponseContentPartAdded(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "part": Required[RealtimeServerEventResponseContentPartAddedPart] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED]] - content_index: int - event_id: str - item_id: str - output_index: int - part: RealtimeServerEventResponseContentPartAddedPart - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED] - - - class azure.ai.projects.types.RealtimeServerEventResponseContentPartAddedPart(TypedDict, total=False): - key "audio": str - key "text": str - key "transcript": str - key "type": Literal["audio", "text"] - audio: str - text: str - transcript: str - type: Literal[audio, text] - - - class azure.ai.projects.types.RealtimeServerEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CONVERSATION_CREATED = "conversation.created" - CONVERSATION_ITEM_ADDED = "conversation.item.added" - CONVERSATION_ITEM_CREATED = "conversation.item.created" - CONVERSATION_ITEM_DELETED = "conversation.item.deleted" - CONVERSATION_ITEM_DONE = "conversation.item.done" - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED = "conversation.item.input_audio_transcription.completed" - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA = "conversation.item.input_audio_transcription.delta" - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED = "conversation.item.input_audio_transcription.failed" - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT = "conversation.item.input_audio_transcription.segment" - CONVERSATION_ITEM_RETRIEVED = "conversation.item.retrieved" - CONVERSATION_ITEM_TRUNCATED = "conversation.item.truncated" - ERROR = "error" - INPUT_AUDIO_BUFFER_CLEARED = "input_audio_buffer.cleared" - INPUT_AUDIO_BUFFER_COMMITTED = "input_audio_buffer.committed" - INPUT_AUDIO_BUFFER_DTMF_EVENT_RECEIVED = "input_audio_buffer.dtmf_event_received" - INPUT_AUDIO_BUFFER_SPEECH_STARTED = "input_audio_buffer.speech_started" - INPUT_AUDIO_BUFFER_SPEECH_STOPPED = "input_audio_buffer.speech_stopped" - INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED = "input_audio_buffer.timeout_triggered" - MCP_LIST_TOOLS_COMPLETED = "mcp_list_tools.completed" - MCP_LIST_TOOLS_FAILED = "mcp_list_tools.failed" - MCP_LIST_TOOLS_IN_PROGRESS = "mcp_list_tools.in_progress" - OUTPUT_AUDIO_BUFFER_CLEARED = "output_audio_buffer.cleared" - OUTPUT_AUDIO_BUFFER_STARTED = "output_audio_buffer.started" - OUTPUT_AUDIO_BUFFER_STOPPED = "output_audio_buffer.stopped" - RATE_LIMITS_UPDATED = "rate_limits.updated" - RESPONSE_CONTENT_PART_ADDED = "response.content_part.added" - RESPONSE_CONTENT_PART_DONE = "response.content_part.done" - RESPONSE_CREATED = "response.created" - RESPONSE_DONE = "response.done" - RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA = "response.function_call_arguments.delta" - RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE = "response.function_call_arguments.done" - RESPONSE_MCP_CALL_ARGUMENTS_DELTA = "response.mcp_call_arguments.delta" - RESPONSE_MCP_CALL_ARGUMENTS_DONE = "response.mcp_call_arguments.done" - RESPONSE_MCP_CALL_COMPLETED = "response.mcp_call.completed" - RESPONSE_MCP_CALL_FAILED = "response.mcp_call.failed" - RESPONSE_MCP_CALL_IN_PROGRESS = "response.mcp_call.in_progress" - RESPONSE_OUTPUT_AUDIO_DELTA = "response.output_audio.delta" - RESPONSE_OUTPUT_AUDIO_DONE = "response.output_audio.done" - RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA = "response.output_audio_transcript.delta" - RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE = "response.output_audio_transcript.done" - RESPONSE_OUTPUT_ITEM_ADDED = "response.output_item.added" - RESPONSE_OUTPUT_ITEM_DONE = "response.output_item.done" - RESPONSE_OUTPUT_TEXT_DELTA = "response.output_text.delta" - RESPONSE_OUTPUT_TEXT_DONE = "response.output_text.done" - SESSION_CREATED = "session.created" - SESSION_UPDATED = "session.updated" - - - class azure.ai.projects.types.Reasoning(TypedDict, total=False): - key "context": Optional[Literal["auto", "current_turn", "all_turns"]] - key "effort": Optional[Union[str, ReasoningEffort]] - key "generate_summary": Optional[Literal["auto", "concise", "detailed"]] - key "mode": Union[str, ReasoningModeEnum] - key "summary": Optional[Literal["auto", "concise", "detailed"]] - context: Literal[auto, current_turn, all_turns] - effort: Union[str, ReasoningEffort] - generate_summary: Literal[auto, concise, detailed] - mode: Union[str, ReasoningModeEnum] - summary: Literal[auto, concise, detailed] - - - class azure.ai.projects.types.RecurrenceTrigger(TypedDict, total=False): - key "endTime": str - key "interval": Required[int] - key "schedule": Required[RecurrenceSchedule] - key "startTime": str - key "timeZone": str - key "type": Required[Literal[TriggerType.RECURRENCE]] - endTime: str - interval: int - schedule: RecurrenceSchedule - startTime: str - timeZone: str - type: Literal[TriggerType.RECURRENCE] - - - class azure.ai.projects.types.RecurrenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DAILY = "Daily" - HOURLY = "Hourly" - MONTHLY = "Monthly" - WEEKLY = "Weekly" - - - class azure.ai.projects.types.RedTeam(TypedDict, total=False): - key "applicationScenario": str - key "displayName": str - key "id": Required[str] - key "numTurns": int - key "simulationOnly": bool - key "status": str - key "target": Required[RedTeamTargetConfig] - applicationScenario: str - attackStrategies: list[Union[str, AttackStrategy]] - displayName: str - id: str - numTurns: int - properties: dict[str, str] - riskCategories: list[Union[str, RiskCategory]] - simulationOnly: bool - status: str - tags: dict[str, str] - target: RedTeamTargetConfig - - - class azure.ai.projects.types.RedTeamTargetConfig(TypedDict, total=False): - key "modelDeploymentName": Required[str] - key "type": Required[Literal["AzureOpenAIModel"]] - modelDeploymentName: str - type: Literal[AzureOpenAIModel] - - - class azure.ai.projects.types.ReminderPreviewToolboxTool(TypedDict, total=False): - key "description": str - key "name": str - key "type": Required[Literal[ToolboxToolType.REMINDER_PREVIEW]] - description: str - name: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.REMINDER_PREVIEW] - - - class azure.ai.projects.types.ResponsesProtocolConfiguration(TypedDict, total=False): - - - class azure.ai.projects.types.RoutineActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - INVOKE_AGENT_INVOCATIONS_API = "invoke_agent_invocations_api" - INVOKE_AGENT_RESPONSES_API = "invoke_agent_responses_api" - - - class azure.ai.projects.types.RoutineDispatchPayloadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - INVOKE_AGENT_INVOCATIONS_API = "invoke_agent_invocations_api" - INVOKE_AGENT_RESPONSES_API = "invoke_agent_responses_api" - - - class azure.ai.projects.types.RoutineTriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CUSTOM = "custom" - GITHUB_ISSUE = "github_issue" - SCHEDULE = "schedule" - TIMER = "timer" - - - class azure.ai.projects.types.RubricBasedEvaluatorDefinition(TypedDict, total=False): - key "dimensions": Required[list[Dimension]] - key "pass_threshold": float - key "type": Required[Literal[EvaluatorDefinitionType.RUBRIC]] - data_schema: dict[str, Any] - dimensions: list[Dimension] - init_parameters: dict[str, Any] - metrics: dict[str, EvaluatorMetric] - pass_threshold: float - type: Literal[EvaluatorDefinitionType.RUBRIC] - - - class azure.ai.projects.types.RubricGenerationInputQualityWarning(TypedDict, total=False): - key "code": Required[Union[str, RubricGenerationInputQualityWarningCode]] - key "message": Required[str] - key "severity": Required[Union[str, RubricGenerationInputQualityWarningSeverity]] - key "source": Required[Union[str, RubricGenerationInputQualityWarningSource]] - key "source_index": int - code: Union[str, RubricGenerationInputQualityWarningCode] - message: str - severity: Union[str, RubricGenerationInputQualityWarningSeverity] - source: Union[str, RubricGenerationInputQualityWarningSource] - source_index: int - - - class azure.ai.projects.types.SampleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - EVALUATION_RESULT_SAMPLE = "EvaluationResultSample" - - - class azure.ai.projects.types.Schedule(TypedDict, total=False): - key "description": str - key "displayName": str - key "enabled": Required[bool] - key "id": Required[str] - key "provisioningStatus": Union[str, ScheduleProvisioningStatus] - key "systemData": Required[dict[str, str]] - key "task": Required[ScheduleTask] - key "trigger": Required[Trigger] - description: str - displayName: str - enabled: bool - id: str - properties: dict[str, str] - provisioningStatus: Union[str, ScheduleProvisioningStatus] - systemData: dict[str, str] - tags: dict[str, str] - task: ScheduleTask - trigger: Trigger - - - class azure.ai.projects.types.ScheduleRoutineTrigger(TypedDict, total=False): - key "cron_expression": Required[str] - key "time_zone": Required[str] - key "type": Required[Literal[RoutineTriggerType.SCHEDULE]] - cron_expression: str - time_zone: str - type: Literal[RoutineTriggerType.SCHEDULE] - - - class azure.ai.projects.types.ScheduleTaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - EVALUATION = "Evaluation" - INSIGHT = "Insight" - - - class azure.ai.projects.types.SearchMemoriesRequest(TypedDict, total=False): - key "options": ForwardRef('MemorySearchOptions', module='types') - key "previous_search_id": str - key "scope": Required[str] - items: list[dict[str, Any]] - options: MemorySearchOptions - previous_search_id: str - scope: str - - - class azure.ai.projects.types.SharepointGroundingToolParameters(TypedDict, total=False): - project_connections: list[ToolProjectConnection] - - - class azure.ai.projects.types.SharepointPreviewTool(TypedDict, total=False): - key "sharepoint_grounding_preview": Required[SharepointGroundingToolParameters] - key "type": Required[Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW]] - sharepoint_grounding_preview: SharepointGroundingToolParameters - type: Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW] - - - class azure.ai.projects.types.SimpleQnADataGenerationJobOptions(TypedDict, total=False): - key "max_samples": Required[int] - key "model_options": ForwardRef('DataGenerationModelOptions', module='types') - key "train_split": float - key "type": Required[Literal[DataGenerationJobType.SIMPLE_QNA]] - max_samples: int - model_options: DataGenerationModelOptions - question_types: list[Union[str, SimpleQnAFineTuningQuestionType]] - train_split: float - type: Literal[DataGenerationJobType.SIMPLE_QNA] - - - class azure.ai.projects.types.SimulationSeedDataGenerationJobOptions(TypedDict, total=False): - key "max_samples": Required[int] - key "model_options": ForwardRef('DataGenerationModelOptions', module='types') - key "train_split": float - key "type": Required[Literal[DataGenerationJobType.SIMULATION_SEED]] - max_samples: int - model_options: DataGenerationModelOptions - train_split: float - type: Literal[DataGenerationJobType.SIMULATION_SEED] - - - class azure.ai.projects.types.SkillInlineContent(TypedDict, total=False): - key "compatibility": str - key "description": Required[str] - key "instructions": Required[str] - key "license": str - allowed_tools: list[str] - compatibility: str - description: str - instructions: str - license: str - metadata: dict[str, str] - - - class azure.ai.projects.types.SkillReferenceParam(TypedDict, total=False): - key "skill_id": Required[str] - key "type": Required[Literal[ContainerSkillType.SKILL_REFERENCE]] - key "version": str - skill_id: str - type: Literal[ContainerSkillType.SKILL_REFERENCE] - version: str - - - class azure.ai.projects.types.SpecificApplyPatchParam(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.APPLY_PATCH]] - type: Literal[ToolChoiceParamType.APPLY_PATCH] - - - class azure.ai.projects.types.SpecificFunctionShellParam(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.SHELL]] - type: Literal[ToolChoiceParamType.SHELL] - - - class azure.ai.projects.types.SpecificProgrammaticToolCallingParam(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING]] - type: Literal[ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING] - - - class azure.ai.projects.types.StructuredInputDefinition(TypedDict, total=False): - key "default_value": Any - key "description": str - key "required": bool - default_value: Any - description: str - required: bool - schema: dict[str, Any] - - - class azure.ai.projects.types.StructuredOutputDefinition(TypedDict, total=False): - key "description": Required[str] - key "name": Required[str] - key "schema": Required[dict[str, Any]] - key "strict": Required[Optional[bool]] - description: str - name: str - schema: dict[str, Any] - strict: bool - - - class azure.ai.projects.types.TaxonomyCategory(TypedDict, total=False): - key "description": str - key "id": Required[str] - key "name": Required[str] - key "riskCategory": Required[Union[str, RiskCategory]] - key "subCategories": Required[list[TaxonomySubCategory]] - description: str - id: str - name: str - properties: dict[str, str] - riskCategory: Union[str, RiskCategory] - subCategories: list[TaxonomySubCategory] - - - class azure.ai.projects.types.TaxonomySubCategory(TypedDict, total=False): - key "description": str - key "enabled": Required[bool] - key "id": Required[str] - key "name": Required[str] - description: str - enabled: bool - id: str - name: str - properties: dict[str, str] - - - class azure.ai.projects.types.TelemetryConfig(TypedDict, total=False): - key "endpoints": Required[list[TelemetryEndpoint]] - endpoints: list[TelemetryEndpoint] - - - class azure.ai.projects.types.TelemetryEndpoint(TypedDict, total=False): - key "auth": ForwardRef('TelemetryEndpointAuth', module='types') - key "data": Required[list[Union[str, TelemetryDataKind]]] - key "endpoint": Required[str] - key "kind": Required[Literal[TelemetryEndpointKind.OTLP]] - key "protocol": Required[Union[str, TelemetryTransportProtocol]] - auth: TelemetryEndpointAuth - data: list[Union[str, TelemetryDataKind]] - endpoint: str - kind: Literal[TelemetryEndpointKind.OTLP] - protocol: Union[str, TelemetryTransportProtocol] - - - class azure.ai.projects.types.TelemetryEndpointAuth(TypedDict, total=False): - key "header_name": Required[str] - key "secret_id": Required[str] - key "secret_key": Required[str] - key "type": Required[Literal[TelemetryEndpointAuthType.HEADER]] - header_name: str - secret_id: str - secret_key: str - type: Literal[TelemetryEndpointAuthType.HEADER] - - - class azure.ai.projects.types.TelemetryEndpointAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - HEADER = "header" - - - class azure.ai.projects.types.TelemetryEndpointKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - OTLP = "OTLP" - - - class azure.ai.projects.types.TemplateVoiceGreetingConfig(TypedDict, total=False): - key "text": Required[str] - key "type": Required[Literal["template"]] - text: str - type: Literal[template] - - - class azure.ai.projects.types.TextResponseFormatConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - JSON_OBJECT = "json_object" - JSON_SCHEMA = "json_schema" - TEXT = "text" - - - class azure.ai.projects.types.TextResponseFormatJsonObject(TypedDict, total=False): - key "type": Required[Literal[TextResponseFormatConfigurationType.JSON_OBJECT]] - type: Literal[TextResponseFormatConfigurationType.JSON_OBJECT] - - - class azure.ai.projects.types.TextResponseFormatJsonSchema(TypedDict, total=False): - key "description": str - key "name": Required[str] - key "schema": Required[dict[str, Any]] - key "strict": Optional[bool] - key "type": Required[Literal[TextResponseFormatConfigurationType.JSON_SCHEMA]] - description: str - name: str - schema: dict[str, Any] - strict: bool - type: Literal[TextResponseFormatConfigurationType.JSON_SCHEMA] - - - class azure.ai.projects.types.TextResponseFormatText(TypedDict, total=False): - key "type": Required[Literal[TextResponseFormatConfigurationType.TEXT]] - type: Literal[TextResponseFormatConfigurationType.TEXT] - - - class azure.ai.projects.types.TimerRoutineTrigger(TypedDict, total=False): - key "at": int - key "type": Required[Literal[RoutineTriggerType.TIMER]] - at: int - type: Literal[RoutineTriggerType.TIMER] - - - class azure.ai.projects.types.ToolChoiceAllowed(TypedDict, total=False): - key "mode": Required[Literal["auto", "required"]] - key "tools": Required[list[dict[str, Any]]] - key "type": Required[Literal[ToolChoiceParamType.ALLOWED_TOOLS]] - mode: Literal[auto, required] - tools: list[dict[str, Any]] - type: Literal[ToolChoiceParamType.ALLOWED_TOOLS] - - - class azure.ai.projects.types.ToolChoiceCodeInterpreter(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.CODE_INTERPRETER]] - type: Literal[ToolChoiceParamType.CODE_INTERPRETER] - - - class azure.ai.projects.types.ToolChoiceComputer(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.COMPUTER]] - type: Literal[ToolChoiceParamType.COMPUTER] - - - class azure.ai.projects.types.ToolChoiceComputerUse(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.COMPUTER_USE]] - type: Literal[ToolChoiceParamType.COMPUTER_USE] - - - class azure.ai.projects.types.ToolChoiceComputerUsePreview(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW]] - type: Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW] - - - class azure.ai.projects.types.ToolChoiceCustom(TypedDict, total=False): - key "name": Required[str] - key "type": Required[Literal[ToolChoiceParamType.CUSTOM]] - name: str - type: Literal[ToolChoiceParamType.CUSTOM] - - - class azure.ai.projects.types.ToolChoiceFileSearch(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.FILE_SEARCH]] - type: Literal[ToolChoiceParamType.FILE_SEARCH] - - - class azure.ai.projects.types.ToolChoiceFunction(TypedDict, total=False): - key "name": Required[str] - key "type": Required[Literal[ToolChoiceParamType.FUNCTION]] - name: str - type: Literal[ToolChoiceParamType.FUNCTION] - - - class azure.ai.projects.types.ToolChoiceImageGeneration(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.IMAGE_GENERATION]] - type: Literal[ToolChoiceParamType.IMAGE_GENERATION] - - - class azure.ai.projects.types.ToolChoiceMCP(TypedDict, total=False): - key "name": Optional[str] - key "server_label": Required[str] - key "type": Required[Literal[ToolChoiceParamType.MCP]] - name: str - server_label: str - type: Literal[ToolChoiceParamType.MCP] - - - class azure.ai.projects.types.ToolChoiceParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ALLOWED_TOOLS = "allowed_tools" - APPLY_PATCH = "apply_patch" - CODE_INTERPRETER = "code_interpreter" - COMPUTER = "computer" - COMPUTER_USE = "computer_use" - COMPUTER_USE_PREVIEW = "computer_use_preview" - CUSTOM = "custom" - FILE_SEARCH = "file_search" - FUNCTION = "function" - IMAGE_GENERATION = "image_generation" - MCP = "mcp" - PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" - SHELL = "shell" - WEB_SEARCH_PREVIEW = "web_search_preview" - WEB_SEARCH_PREVIEW_2025_03_11 = "web_search_preview_2025_03_11" - - - class azure.ai.projects.types.ToolChoiceWebSearchPreview(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW]] - type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW] - - - class azure.ai.projects.types.ToolChoiceWebSearchPreview20250311(TypedDict, total=False): - key "type": Required[Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11]] - type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11] - - - class azure.ai.projects.types.ToolConfig(TypedDict, total=False): - key "additional_search_text": str - key "pin": bool - additional_search_text: str - pin: bool - - - class azure.ai.projects.types.ToolDescription(TypedDict, total=False): - key "description": str - key "name": str - description: str - name: str - - - class azure.ai.projects.types.ToolProjectConnection(TypedDict, total=False): - key "project_connection_id": Required[str] - project_connection_id: str - - - class azure.ai.projects.types.ToolSearchToolParam(TypedDict, total=False): - key "description": Optional[str] - key "execution": Union[str, ToolSearchExecutionType] - key "parameters": Optional[EmptyModelParam] - key "type": Required[Literal[ToolType.TOOL_SEARCH]] - description: str - execution: Union[str, ToolSearchExecutionType] - parameters: EmptyModelParam - type: Literal[ToolType.TOOL_SEARCH] - - - class azure.ai.projects.types.ToolSearchToolboxTool(TypedDict, total=False): - key "description": str - key "name": str - key "type": Required[Literal[ToolboxToolType.TOOLBOX_SEARCH]] - description: str - name: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.TOOLBOX_SEARCH] - - - class azure.ai.projects.types.ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - A2A_PREVIEW = "a2a_preview" - APPLY_PATCH = "apply_patch" - AZURE_AI_SEARCH = "azure_ai_search" - AZURE_FUNCTION = "azure_function" - BING_CUSTOM_SEARCH_PREVIEW = "bing_custom_search_preview" - BING_GROUNDING = "bing_grounding" - BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" - CAPTURE_STRUCTURED_OUTPUTS = "capture_structured_outputs" - CODE_INTERPRETER = "code_interpreter" - COMPUTER = "computer" - COMPUTER_USE_PREVIEW = "computer_use_preview" - CUSTOM = "custom" - FABRIC_DATAAGENT_PREVIEW = "fabric_dataagent_preview" - FABRIC_IQ_PREVIEW = "fabric_iq_preview" - FILE_SEARCH = "file_search" - FUNCTION = "function" - IMAGE_GENERATION = "image_generation" - LOCAL_SHELL = "local_shell" - MCP = "mcp" - MEMORY_SEARCH_PREVIEW = "memory_search_preview" - NAMESPACE = "namespace" - OPENAPI = "openapi" - PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" - SHAREPOINT_GROUNDING_PREVIEW = "sharepoint_grounding_preview" - SHELL = "shell" - TOOLBOX_SEARCH_PREVIEW = "toolbox_search_preview" - TOOL_SEARCH = "tool_search" - WEB_SEARCH = "web_search" - WEB_SEARCH_PREVIEW = "web_search_preview" - WORK_IQ_PREVIEW = "work_iq_preview" - - - class azure.ai.projects.types.ToolUseFineTuningDataGenerationJobOptions(TypedDict, total=False): - key "max_samples": Required[int] - key "model_options": ForwardRef('DataGenerationModelOptions', module='types') - key "train_split": float - key "type": Required[Literal[DataGenerationJobType.TOOL_USE]] - max_samples: int - model_options: DataGenerationModelOptions - train_split: float - type: Literal[DataGenerationJobType.TOOL_USE] - - - class azure.ai.projects.types.ToolboxPolicies(TypedDict, total=False): - key "rai_config": ForwardRef('RaiConfig', module='types') - rai_config: RaiConfig - - - class azure.ai.projects.types.ToolboxSearchPreviewToolboxTool(TypedDict, total=False): - key "description": str - key "name": str - key "type": Required[Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW]] - description: str - name: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW] - - - class azure.ai.projects.types.ToolboxSkill(TypedDict, total=False): - key "name": Required[str] - key "type": Required[Literal["skill_reference"]] - key "version": str - name: str - type: Literal[skill_reference] - version: str - - - class azure.ai.projects.types.ToolboxSkillReference(TypedDict, total=False): - key "name": Required[str] - key "type": Required[Literal["skill_reference"]] - key "version": str - name: str - type: Literal[skill_reference] - version: str - - - class azure.ai.projects.types.ToolboxToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - A2A_PREVIEW = "a2a_preview" - AZURE_AI_SEARCH = "azure_ai_search" - BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" - CODE_INTERPRETER = "code_interpreter" - FABRIC_IQ_PREVIEW = "fabric_iq_preview" - FILE_SEARCH = "file_search" - MCP = "mcp" - OPENAPI = "openapi" - REMINDER_PREVIEW = "reminder_preview" - TOOLBOX_SEARCH = "toolbox_search" - TOOLBOX_SEARCH_PREVIEW = "toolbox_search_preview" - WEB_SEARCH = "web_search" - WORK_IQ_PREVIEW = "work_iq_preview" - - - class azure.ai.projects.types.TracesDataGenerationJobOptions(TypedDict, total=False): - key "max_samples": Required[int] - key "model_options": ForwardRef('DataGenerationModelOptions', module='types') - key "train_split": float - key "type": Required[Literal[DataGenerationJobType.TRACES]] - max_samples: int - model_options: DataGenerationModelOptions - train_split: float - type: Literal[DataGenerationJobType.TRACES] - - - class azure.ai.projects.types.TracesDataGenerationJobSource(TypedDict, total=False): - key "agent_id": str - key "agent_name": str - key "agent_version": str - key "description": str - key "end_time": int - key "start_time": Required[int] - key "type": Required[Literal[DataGenerationJobSourceType.TRACES]] - agent_id: str - agent_name: str - agent_version: str - description: str - end_time: int - start_time: int - type: Literal[DataGenerationJobSourceType.TRACES] - - - class azure.ai.projects.types.TracesEvaluatorGenerationJobSource(TypedDict, total=False): - key "agent_id": str - key "agent_name": str - key "agent_version": str - key "description": str - key "end_time": int - key "start_time": Required[int] - key "type": Required[Literal[EvaluatorGenerationJobSourceType.TRACES]] - agent_id: str - agent_name: str - agent_version: str - description: str - end_time: int - start_time: int - type: Literal[EvaluatorGenerationJobSourceType.TRACES] - - - class azure.ai.projects.types.TranscriptTextUsageDuration(TypedDict, total=False): - key "seconds": Required[str] - key "type": Required[Literal[CreateTranscriptionResponseJsonUsageType.DURATION]] - seconds: str - type: Literal[CreateTranscriptionResponseJsonUsageType.DURATION] - - - class azure.ai.projects.types.TranscriptTextUsageTokens(TypedDict, total=False): - key "input_token_details": ForwardRef('TranscriptTextUsageTokensInputTokenDetails', module='types') - key "input_tokens": Required[int] - key "output_tokens": Required[int] - key "total_tokens": Required[int] - key "type": Required[Literal[CreateTranscriptionResponseJsonUsageType.TOKENS]] - input_token_details: TranscriptTextUsageTokensInputTokenDetails - input_tokens: int - output_tokens: int - total_tokens: int - type: Literal[CreateTranscriptionResponseJsonUsageType.TOKENS] - - - class azure.ai.projects.types.TranscriptTextUsageTokensInputTokenDetails(TypedDict, total=False): - key "audio_tokens": int - key "text_tokens": int - audio_tokens: int - text_tokens: int - - - class azure.ai.projects.types.TriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CRON = "Cron" - ONE_TIME = "OneTime" - RECURRENCE = "Recurrence" - - - class azure.ai.projects.types.UpdateMemoriesRequest(TypedDict, total=False): - key "previous_update_id": str - key "scope": Required[str] - key "update_delay": int - items: list[dict[str, Any]] - previous_update_id: str - scope: str - update_delay: int - - - class azure.ai.projects.types.UpdateMemoryRequest(TypedDict, total=False): - key "content": Required[str] - content: str - - - class azure.ai.projects.types.UpdateMemoryStoreRequest(TypedDict, total=False): - key "description": str - description: str - metadata: dict[str, str] - - - class azure.ai.projects.types.UpdateModelVersionRequest(TypedDict, total=False): - key "description": str - description: str - tags: dict[str, str] - - - class azure.ai.projects.types.UpdateSkillRequest(TypedDict, total=False): - key "default_version": Required[str] - default_version: str - - - class azure.ai.projects.types.UpdateToolboxRequest(TypedDict, total=False): - key "default_version": Required[str] - default_version: str - - - class azure.ai.projects.types.UpdateToolboxRequest1(TypedDict, total=False): - key "default_version": Required[str] - default_version: str - - - class azure.ai.projects.types.VersionIndicator(TypedDict, total=False): - key "agent_version": Required[str] - key "type": Required[Literal[VersionIndicatorType.VERSION_REF]] - agent_version: str - type: Literal[VersionIndicatorType.VERSION_REF] - - - class azure.ai.projects.types.VersionIndicatorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - VERSION_REF = "version_ref" - - - class azure.ai.projects.types.VersionRefIndicator(TypedDict, total=False): - key "agent_version": Required[str] - key "type": Required[Literal[VersionIndicatorType.VERSION_REF]] - agent_version: str - type: Literal[VersionIndicatorType.VERSION_REF] - - - class azure.ai.projects.types.VersionSelectionRule(TypedDict, total=False): - key "agent_version": Required[str] - key "traffic_percentage": Required[int] - key "type": Required[Literal[VersionSelectorType.FIXED_RATIO]] - agent_version: str - traffic_percentage: int - type: Literal[VersionSelectorType.FIXED_RATIO] - - - class azure.ai.projects.types.VersionSelector(TypedDict, total=False): - key "version_selection_rules": Required[list[VersionSelectionRule]] - version_selection_rules: list[VersionSelectionRule] - - - class azure.ai.projects.types.VersionSelectorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FIXED_RATIO = "FixedRatio" - - - class azure.ai.projects.types.VoiceAgentAnimationConfig(TypedDict, total=False): - key "model_name": str - model_name: str - outputs: list[Union[str, VoiceAgentAnimationOutputType]] - - - class azure.ai.projects.types.VoiceAgentAvatarIceServer(TypedDict, total=False): - key "credential": Optional[str] - key "urls": Required[list[str]] - key "username": Optional[str] - credential: str - urls: list[str] - username: str - - - class azure.ai.projects.types.VoiceAgentAvatarScene(TypedDict, total=False): - key "amplitude": float - key "position_x": float - key "position_y": float - key "rotation_x": float - key "rotation_y": float - key "rotation_z": float - key "zoom": float - amplitude: float - position_x: float - position_y: float - rotation_x: float - rotation_y: float - rotation_z: float - zoom: float - - - class azure.ai.projects.types.VoiceAgentAvatarVideoBackground(TypedDict, total=False): - key "color": str - key "image_url": str - color: str - image_url: str - - - class azure.ai.projects.types.VoiceAgentAvatarVideoCrop(TypedDict, total=False): - key "bottom_right": Required[list[int]] - key "top_left": Required[list[int]] - bottom_right: list[int] - top_left: list[int] - - - class azure.ai.projects.types.VoiceAgentAvatarVideoParams(TypedDict, total=False): - key "background": ForwardRef('VoiceAgentAvatarVideoBackground', module='types') - key "bitrate": int - key "codec": Literal["h264"] - key "crop": ForwardRef('VoiceAgentAvatarVideoCrop', module='types') - key "gop_size": int - key "resolution": ForwardRef('VoiceAgentAvatarVideoResolution', module='types') - background: VoiceAgentAvatarVideoBackground - bitrate: int - codec: Literal[h264] - crop: VoiceAgentAvatarVideoCrop - gop_size: int - resolution: VoiceAgentAvatarVideoResolution - - - class azure.ai.projects.types.VoiceAgentAvatarVideoResolution(TypedDict, total=False): - key "height": Required[int] - key "width": Required[int] - height: int - width: int - - - class azure.ai.projects.types.VoiceAgentClientEventConversationItemCreate(TypedDict, total=False): - key "event_id": str - key "item": Required[VoiceAgentCreateConversationItem] - key "previous_item_id": str - key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE]] - event_id: str - item: VoiceAgentCreateConversationItem - previous_item_id: str - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE] - - - class azure.ai.projects.types.VoiceAgentClientEventConversationItemDelete(TypedDict, total=False): - key "event_id": str - key "item_id": Required[str] - key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE]] - event_id: str - item_id: str - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE] - - - class azure.ai.projects.types.VoiceAgentClientEventConversationItemRetrieve(TypedDict, total=False): - key "event_id": str - key "item_id": Required[str] - key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE]] - event_id: str - item_id: str - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE] - - - class azure.ai.projects.types.VoiceAgentClientEventConversationItemTruncate(TypedDict, total=False): - key "audio_end_ms": Required[int] - key "content_index": Required[int] - key "event_id": str - key "item_id": Required[str] - key "type": Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE]] - audio_end_ms: int - content_index: int - event_id: str - item_id: str - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE] - - - class azure.ai.projects.types.VoiceAgentClientEventInputAudioBufferAppend(TypedDict, total=False): - key "audio": Required[str] - key "event_id": str - key "type": Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND]] - audio: str - event_id: str - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND] - - - class azure.ai.projects.types.VoiceAgentClientEventInputAudioBufferClear(TypedDict, total=False): - key "event_id": str - key "type": Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR]] - event_id: str - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR] - - - class azure.ai.projects.types.VoiceAgentClientEventInputAudioBufferCommit(TypedDict, total=False): - key "event_id": str - key "type": Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT]] - event_id: str - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT] - - - class azure.ai.projects.types.VoiceAgentClientEventOutputAudioBufferClear(TypedDict, total=False): - key "event_id": str - key "type": Required[Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR]] - event_id: str - type: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR] - - - class azure.ai.projects.types.VoiceAgentClientEventResponseCancel(TypedDict, total=False): - key "event_id": str - key "response_id": str - key "type": Required[Literal[RealtimeClientEventType.RESPONSE_CANCEL]] - event_id: str - response_id: str - type: Literal[RealtimeClientEventType.RESPONSE_CANCEL] - - - class azure.ai.projects.types.VoiceAgentClientEventResponseCreate(TypedDict, total=False): - key "event_id": str - key "response": ForwardRef('VoiceAgentResponseCreateParams', module='types') - key "type": Required[Literal[RealtimeClientEventType.RESPONSE_CREATE]] - event_id: str - response: VoiceAgentResponseCreateParams - type: Literal[RealtimeClientEventType.RESPONSE_CREATE] - - - class azure.ai.projects.types.VoiceAgentClientEventSessionAvatarConnect(TypedDict, total=False): - key "client_sdp": Required[str] - key "event_id": str - key "type": Required[Literal["connect"]] - client_sdp: str - event_id: str - type: Literal[connect] - - - class azure.ai.projects.types.VoiceAgentClientEventSessionUpdate(TypedDict, total=False): - key "event_id": str - key "session": Required[VoiceAgentSessionUpdateConfig] - key "type": Required[Literal[RealtimeClientEventType.SESSION_UPDATE]] - event_id: str - session: VoiceAgentSessionUpdateConfig - type: Literal[RealtimeClientEventType.SESSION_UPDATE] - - - class azure.ai.projects.types.VoiceAgentDefinition(TypedDict, total=False): - key "audio": ForwardRef('VoiceAudioConfig', module='types') - key "avatar": ForwardRef('VoiceAvatarConfig', module='types') - key "greeting": ForwardRef('VoiceGreetingConfig', module='types') - key "instructions": str - key "interim_response": ForwardRef('VoiceAgentInterimResponse', module='types') - key "kind": Required[Literal[AgentKind.VOICE]] - key "max_output_tokens": ForwardRef('VoiceAgentMaxOutputTokens', module='types') - key "model": Required[str] - key "model_type": Required[Union[str, VoiceModelType]] - key "parallel_tool_calls": bool - key "rai_config": ForwardRef('RaiConfig', module='types') - key "store": bool - key "tool_choice": ForwardRef('VoiceAgentToolChoice', module='types') - audio: VoiceAudioConfig - avatar: VoiceAvatarConfig - greeting: VoiceGreetingConfig - include: list[Union[str, VoiceAgentSessionIncludeOption]] - instructions: str - interim_response: VoiceAgentInterimResponse - kind: Literal[AgentKind.VOICE] - max_output_tokens: VoiceAgentMaxOutputTokens - model: str - model_type: Union[str, VoiceModelType] - output_modalities: list[Union[str, VoiceOutputModality]] - parallel_tool_calls: bool - rai_config: RaiConfig - store: bool - structured_inputs: dict[str, StructuredInputDefinition] - tool_choice: VoiceAgentToolChoice - tools: list[VoiceAgentTool] - - - class azure.ai.projects.types.VoiceAgentEchoCancellation(TypedDict, total=False): - key "channels": int - key "reference_source": Union[str, VoiceAgentEchoCancellationReferenceSource] - key "type": Required[Literal["server_echo_cancellation"]] - channels: int - reference_source: Union[str, VoiceAgentEchoCancellationReferenceSource] - type: Literal[server_echo_cancellation] - - - class azure.ai.projects.types.VoiceAgentFunctionTool(TypedDict, total=False): - key "description": str - key "name": Required[str] - key "parameters": ForwardRef('RealtimeFunctionToolParameters', module='types') - key "type": Required[Literal["function"]] - description: str - name: str - parameters: RealtimeFunctionToolParameters - type: Literal[function] - - - class azure.ai.projects.types.VoiceAgentLlmInterimResponseConfig(TypedDict, total=False): - key "instructions": str - key "latency_threshold_ms": int - key "max_completion_tokens": int - key "model": str - key "type": Required[Literal["llm_interim_response"]] - instructions: str - latency_threshold_ms: int - max_completion_tokens: int - model: str - triggers: list[Union[str, VoiceAgentInterimResponseTrigger]] - type: Literal[llm_interim_response] - - - class azure.ai.projects.types.VoiceAgentMcpTool(TypedDict, total=False): - key "allowed_callers": Optional[list[Union[str, CallableToolAllowedCaller]]] - key "allowed_tools": Optional[Union[list[str], MCPToolFilter]] - key "authorization": str - key "defer_loading": bool - key "headers": Optional[dict[str, str]] - key "project_connection_id": str - key "require_approval": Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] - key "response_scheduling": Union[str, VoiceAgentToolResponseScheduling] - key "server_description": str - key "server_label": Required[str] - key "server_url": str - key "type": Required[Literal["mcp"]] - allowed_callers: list[Union[str, CallableToolAllowedCaller]] - allowed_tools: Union[list[str], MCPToolFilter] - authorization: str - defer_loading: bool - headers: dict[str, str] - project_connection_id: str - require_approval: Union[MCPToolRequireApproval, Literal[always], Literal[never]] - response_scheduling: Union[str, VoiceAgentToolResponseScheduling] - server_description: str - server_label: str - server_url: str - tool_configs: dict[str, ToolConfig] - type: Literal[mcp] - - - class azure.ai.projects.types.VoiceAgentRealtimeResponse(OmitPropertiesRealtimeResponse1): - key "audio": ForwardRef('VoiceResponseAudio', module='types') - key "conversation_id": str - key "id": str - key "max_output_tokens": Union[int, Literal["inf"]] - key "metadata": Optional[Metadata] - key "object": Literal["response"] - key "status": Literal["completed", "cancelled", "failed", "incomplete", "in_progress"] - key "status_details": ForwardRef('RealtimeResponseStatusDetails', module='types') - key "usage": ForwardRef('RealtimeResponseUsage', module='types') - audio: VoiceResponseAudio - conversation_id: str - id: str - max_output_tokens: Union[int, Literal[inf]] - metadata: Metadata - object: Literal[response] - output: list[VoiceAgentResponseItem] - output_modalities: list[Literal["text", "audio"]] - status: Literal[completed, cancelled, failed, incomplete, in_progress] - status_details: RealtimeResponseStatusDetails - usage: RealtimeResponseUsage - - - class azure.ai.projects.types.VoiceAgentResponseCreateParams(TypedDict, total=False): - key "audio": ForwardRef('PickPropertiesVoiceAudioConfig', module='types') - key "conversation": Union[Literal["auto"], Literal["none"], str] - key "instructions": str - key "interim_response": Optional[VoiceAgentInterimResponse] - key "max_output_tokens": Union[int, Literal["inf"]] - key "metadata": Optional[Metadata] - key "parallel_tool_calls": bool - key "pre_generated_assistant_message": Optional[RealtimeConversationItemMessageAssistant] - key "reasoning": ForwardRef('RealtimeReasoning', module='types') - key "tool_choice": Union[str, ToolChoiceOptions, ToolChoiceFunction, ToolChoiceMCP] - audio: PickPropertiesVoiceAudioConfig - conversation: Union[Literal[auto], Literal[none], str] - input: list[RealtimeConversationItem] - instructions: str - interim_response: VoiceAgentInterimResponse - max_output_tokens: Union[int, Literal[inf]] - metadata: Metadata - output_modalities: list[Union[str, VoiceOutputModality]] - parallel_tool_calls: bool - pre_generated_assistant_message: RealtimeConversationItemMessageAssistant - reasoning: RealtimeReasoning - tool_choice: Union[str, ToolChoiceOptions, ToolChoiceFunction, ToolChoiceMCP] - tools: list[Union[RealtimeFunctionTool, MCPTool]] - - - class azure.ai.projects.types.VoiceAgentResponseEventContentPart(TypedDict, total=False): - key "audio": str - key "format": ForwardRef('VoiceAudioFormat', module='types') - key "text": str - key "transcript": str - key "type": Literal["audio", "text"] - audio: str - format: VoiceAudioFormat - text: str - transcript: str - type: Literal[audio, text] - - - class azure.ai.projects.types.VoiceAgentSemanticVadTurnDetection(TypedDict, total=False): - key "auto_truncate": bool - key "create_response": bool - key "eagerness": Literal["low", "medium", "high", "auto"] - key "interrupt_response": bool - key "type": Required[Literal[VoiceTurnDetectionType.SEMANTIC_VAD]] - auto_truncate: bool - create_response: bool - eagerness: Literal[low, medium, high, auto] - interrupt_response: bool - type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD] - - - class azure.ai.projects.types.VoiceAgentServerEventConversationItemAdded(TypedDict, total=False): - key "event_id": Required[str] - key "item": Required[VoiceAgentResponseItem] - key "previous_item_id": Optional[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED]] - event_id: str - item: VoiceAgentResponseItem - previous_item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED] - - - class azure.ai.projects.types.VoiceAgentServerEventConversationItemCreated(TypedDict, total=False): - key "event_id": Required[str] - key "item": Required[VoiceAgentResponseItem] - key "previous_item_id": Optional[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED]] - event_id: str - item: VoiceAgentResponseItem - previous_item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED] - - - class azure.ai.projects.types.VoiceAgentServerEventConversationItemDeleted(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED]] - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED] - - - class azure.ai.projects.types.VoiceAgentServerEventConversationItemDone(TypedDict, total=False): - key "event_id": Required[str] - key "item": Required[VoiceAgentResponseItem] - key "previous_item_id": Optional[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE]] - event_id: str - item: VoiceAgentResponseItem - previous_item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE] - - - class azure.ai.projects.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "logprobs": Optional[list[LogProbProperties]] - key "phrases": Optional[list[VoiceAgentTranscriptionPhrase]] - key "transcript": Required[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED]] - key "usage": Required[Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration]] - content_index: int - event_id: str - item_id: str - logprobs: list[LogProbProperties] - phrases: list[VoiceAgentTranscriptionPhrase] - transcript: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED] - usage: Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration] - - - class azure.ai.projects.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta(TypedDict, total=False): - key "content_index": int - key "delta": str - key "event_id": Required[str] - key "item_id": Required[str] - key "logprobs": Optional[list[LogProbProperties]] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA]] - content_index: int - delta: str - event_id: str - item_id: str - logprobs: list[LogProbProperties] - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA] - - - class azure.ai.projects.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed(TypedDict, total=False): - key "content_index": Required[int] - key "error": Required[RealtimeServerEventConversationItemInputAudioTranscriptionFailedError] - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED]] - content_index: int - error: RealtimeServerEventConversationItemInputAudioTranscriptionFailedError - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED] - - - class azure.ai.projects.types.VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment(TypedDict, total=False): - key "content_index": Required[int] - key "end": Required[float] - key "event_id": Required[str] - key "id": Required[str] - key "item_id": Required[str] - key "speaker": Required[str] - key "start": Required[float] - key "text": Required[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT]] - content_index: int - end: float - event_id: str - id: str - item_id: str - speaker: str - start: float - text: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT] - - - class azure.ai.projects.types.VoiceAgentServerEventConversationItemRetrieved(TypedDict, total=False): - key "event_id": Required[str] - key "item": Required[VoiceAgentResponseItem] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED]] - event_id: str - item: VoiceAgentResponseItem - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED] - - - class azure.ai.projects.types.VoiceAgentServerEventConversationItemTruncated(TypedDict, total=False): - key "audio_end_ms": Required[int] - key "content_index": Required[int] - key "event_id": Required[str] - key "item": ForwardRef('RealtimeConversationItemMessageAssistant', module='types') - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED]] - audio_end_ms: int - content_index: int - event_id: str - item: RealtimeConversationItemMessageAssistant - item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED] - - - class azure.ai.projects.types.VoiceAgentServerEventInputAudioBufferCleared(TypedDict, total=False): - key "event_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED]] - event_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED] - - - class azure.ai.projects.types.VoiceAgentServerEventInputAudioBufferCommitted(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "previous_item_id": Optional[str] - key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED]] - event_id: str - item_id: str - previous_item_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED] - - - class azure.ai.projects.types.VoiceAgentServerEventInputAudioBufferSpeechStarted(TypedDict, total=False): - key "audio_start_ms": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED]] - audio_start_ms: int - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED] - - - class azure.ai.projects.types.VoiceAgentServerEventInputAudioBufferSpeechStopped(TypedDict, total=False): - key "audio_end_ms": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED]] - audio_end_ms: int - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED] - - - class azure.ai.projects.types.VoiceAgentServerEventInputAudioBufferTimeoutTriggered(TypedDict, total=False): - key "audio_end_ms": Required[int] - key "audio_start_ms": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED]] - audio_end_ms: int - audio_start_ms: int - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED] - - - class azure.ai.projects.types.VoiceAgentServerEventMcpListToolsCompleted(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED]] - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED] - - - class azure.ai.projects.types.VoiceAgentServerEventMcpListToolsFailed(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED]] - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED] - - - class azure.ai.projects.types.VoiceAgentServerEventMcpListToolsInProgress(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS]] - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS] - - - class azure.ai.projects.types.VoiceAgentServerEventOutputAudioBufferCleared(TypedDict, total=False): - key "event_id": Required[str] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED]] - event_id: str - response_id: str - type: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED] - - - class azure.ai.projects.types.VoiceAgentServerEventRateLimitsUpdated(TypedDict, total=False): - key "event_id": Required[str] - key "rate_limits": Required[list[RealtimeServerEventRateLimitsUpdatedRateLimits]] - key "type": Required[Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED]] - event_id: str - rate_limits: list[RealtimeServerEventRateLimitsUpdatedRateLimits] - type: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED] - - - class azure.ai.projects.types.VoiceAgentServerEventResponseAnimationBlendshapesDelta(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "frame_index": Required[int] - key "frames": Required[list[list[float]]] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal["delta"]] - content_index: int - event_id: str - frame_index: int - frames: list[list[float]] - item_id: str - output_index: int - response_id: str - type: Literal[delta] - - - class azure.ai.projects.types.VoiceAgentServerEventResponseAnimationBlendshapesDone(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal["done"]] - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[done] - - - class azure.ai.projects.types.VoiceAgentServerEventResponseAnimationVisemeDelta(TypedDict, total=False): - key "audio_offset_ms": Required[int] - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal["delta"]] - key "viseme_id": Required[int] - audio_offset_ms: int - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[delta] - viseme_id: int - - - class azure.ai.projects.types.VoiceAgentServerEventResponseAnimationVisemeDone(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal["done"]] - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[done] - - - class azure.ai.projects.types.VoiceAgentServerEventResponseAudioDelta(TypedDict, total=False): - key "content_index": Required[int] - key "delta": Required[str] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA]] - content_index: int - delta: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA] - - - class azure.ai.projects.types.VoiceAgentServerEventResponseAudioDone(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE]] - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE] - - - class azure.ai.projects.types.VoiceAgentServerEventResponseAudioTimestampDelta(TypedDict, total=False): - key "audio_duration_ms": Required[int] - key "audio_offset_ms": Required[int] - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "text": Required[str] - key "timestamp_type": Required[Literal["word"]] - key "type": Required[Literal["delta"]] - audio_duration_ms: int - audio_offset_ms: int - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - text: str - timestamp_type: Literal[word] - type: Literal[delta] - - - class azure.ai.projects.types.VoiceAgentServerEventResponseAudioTimestampDone(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal["done"]] - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[done] - - - class azure.ai.projects.types.VoiceAgentServerEventResponseAudioTranscriptDelta(TypedDict, total=False): - key "content_index": Required[int] - key "delta": Required[str] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA]] - content_index: int - delta: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA] - - - class azure.ai.projects.types.VoiceAgentServerEventResponseAudioTranscriptDone(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "transcript": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE]] - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - transcript: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE] - - - class azure.ai.projects.types.VoiceAgentServerEventResponseContentPartDone(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "part": Required[VoiceAgentResponseEventContentPart] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE]] - content_index: int - event_id: str - item_id: str - output_index: int - part: VoiceAgentResponseEventContentPart - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE] - - - class azure.ai.projects.types.VoiceAgentServerEventResponseCreated(TypedDict, total=False): - key "event_id": Required[str] - key "response": Required[VoiceAgentRealtimeResponse] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_CREATED]] - event_id: str - response: VoiceAgentRealtimeResponse - type: Literal[RealtimeServerEventType.RESPONSE_CREATED] - - - class azure.ai.projects.types.VoiceAgentServerEventResponseDone(TypedDict, total=False): - key "event_id": Required[str] - key "response": Required[VoiceAgentRealtimeResponse] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_DONE]] - event_id: str - response: VoiceAgentRealtimeResponse - type: Literal[RealtimeServerEventType.RESPONSE_DONE] - - - class azure.ai.projects.types.VoiceAgentServerEventResponseFunctionCallArgumentsDelta(TypedDict, total=False): - key "call_id": Required[str] - key "delta": Required[str] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA]] - call_id: str - delta: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA] - - - class azure.ai.projects.types.VoiceAgentServerEventResponseFunctionCallArgumentsDone(TypedDict, total=False): - key "arguments": Required[str] - key "call_id": Required[str] - key "event_id": Required[str] - key "item_id": Required[str] - key "name": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE]] - arguments: str - call_id: str - event_id: str - item_id: str - name: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE] - - - class azure.ai.projects.types.VoiceAgentServerEventResponseMcpCallArgumentsDelta(TypedDict, total=False): - key "delta": Required[str] - key "event_id": Required[str] - key "item_id": Required[str] - key "obfuscation": Optional[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA]] - delta: str - event_id: str - item_id: str - obfuscation: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA] - - - class azure.ai.projects.types.VoiceAgentServerEventResponseMcpCallArgumentsDone(TypedDict, total=False): - key "arguments": Required[str] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE]] - arguments: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE] - - - class azure.ai.projects.types.VoiceAgentServerEventResponseMcpCallCompleted(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED]] - event_id: str - item_id: str - output_index: int - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED] - - - class azure.ai.projects.types.VoiceAgentServerEventResponseMcpCallFailed(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED]] - event_id: str - item_id: str - output_index: int - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED] - - - class azure.ai.projects.types.VoiceAgentServerEventResponseMcpCallInProgress(TypedDict, total=False): - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS]] - event_id: str - item_id: str - output_index: int - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS] - - - class azure.ai.projects.types.VoiceAgentServerEventResponseOutputItemAdded(TypedDict, total=False): - key "event_id": Required[str] - key "item": Required[VoiceAgentResponseItem] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED]] - event_id: str - item: VoiceAgentResponseItem - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED] - - - class azure.ai.projects.types.VoiceAgentServerEventResponseOutputItemDone(TypedDict, total=False): - key "event_id": Required[str] - key "item": Required[VoiceAgentResponseItem] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE]] - event_id: str - item: VoiceAgentResponseItem - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE] - - - class azure.ai.projects.types.VoiceAgentServerEventResponseTextDelta(TypedDict, total=False): - key "content_index": Required[int] - key "delta": Required[str] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA]] - content_index: int - delta: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA] - - - class azure.ai.projects.types.VoiceAgentServerEventResponseTextDone(TypedDict, total=False): - key "content_index": Required[int] - key "event_id": Required[str] - key "item_id": Required[str] - key "output_index": Required[int] - key "response_id": Required[str] - key "text": Required[str] - key "type": Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE]] - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - text: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE] - - - class azure.ai.projects.types.VoiceAgentServerEventResponseVideoDelta(TypedDict, total=False): - key "codec": Required[str] - key "delta": Required[str] - key "event_id": Required[str] - key "output_index": Required[int] - key "type": Required[Literal["delta"]] - codec: str - delta: str - event_id: str - output_index: int - type: Literal[delta] - - - class azure.ai.projects.types.VoiceAgentServerEventSessionAvatarConnecting(TypedDict, total=False): - key "event_id": Required[str] - key "server_sdp": Required[str] - key "type": Required[Literal["connecting"]] - event_id: str - server_sdp: str - type: Literal[connecting] - - - class azure.ai.projects.types.VoiceAgentServerEventSessionAvatarSwitchToIdle(TypedDict, total=False): - key "event_id": Required[str] - key "turn_id": str - key "type": Required[Literal["switch_to_idle"]] - event_id: str - turn_id: str - type: Literal[switch_to_idle] - - - class azure.ai.projects.types.VoiceAgentServerEventSessionAvatarSwitchToSpeaking(TypedDict, total=False): - key "event_id": Required[str] - key "turn_id": str - key "type": Required[Literal["switch_to_speaking"]] - event_id: str - turn_id: str - type: Literal[switch_to_speaking] - - - class azure.ai.projects.types.VoiceAgentServerEventSessionCreated(TypedDict, total=False): - key "event_id": Required[str] - key "session": Required[VoiceAgentSessionResponseConfig] - key "type": Required[Literal[RealtimeServerEventType.SESSION_CREATED]] - event_id: str - session: VoiceAgentSessionResponseConfig - type: Literal[RealtimeServerEventType.SESSION_CREATED] - - - class azure.ai.projects.types.VoiceAgentServerEventSessionUpdated(TypedDict, total=False): - key "event_id": Required[str] - key "session": Required[VoiceAgentSessionResponseConfig] - key "type": Required[Literal[RealtimeServerEventType.SESSION_UPDATED]] - event_id: str - session: VoiceAgentSessionResponseConfig - type: Literal[RealtimeServerEventType.SESSION_UPDATED] - - - class azure.ai.projects.types.VoiceAgentServerEventWarning(TypedDict, total=False): - key "event_id": Required[str] - key "type": Required[Literal["warning"]] - key "warning": Required[VoiceAgentServerEventWarningDetails] - event_id: str - type: Literal[warning] - warning: VoiceAgentServerEventWarningDetails - - - class azure.ai.projects.types.VoiceAgentServerEventWarningDetails(TypedDict, total=False): - key "code": str - key "message": Required[str] - key "param": str - code: str - message: str - param: str - - - class azure.ai.projects.types.VoiceAgentSessionAvatarConfig(VoiceAvatarConfig): - key "character": Required[str] - key "customized": bool - key "ice_servers": Optional[list[VoiceAgentAvatarIceServer]] - key "model": str - key "output_audit_audio": bool - key "output_protocol": Union[str, VoiceAvatarOutputProtocol] - key "scene": ForwardRef('VoiceAgentAvatarScene', module='types') - key "style": str - key "type": Required[Union[str, VoiceAvatarType]] - key "video": ForwardRef('VoiceAgentAvatarVideoParams', module='types') - character: str - customized: bool - ice_servers: list[VoiceAgentAvatarIceServer] - model: str - output_audit_audio: bool - output_protocol: Union[str, VoiceAvatarOutputProtocol] - scene: VoiceAgentAvatarScene - style: str - type: Union[str, VoiceAvatarType] - video: VoiceAgentAvatarVideoParams - - - class azure.ai.projects.types.VoiceAgentSessionResponseConfig(TypedDict, total=False): - key "animation": ForwardRef('VoiceAgentAnimationConfig', module='types') - key "audio": ForwardRef('VoiceAudioConfig', module='types') - key "avatar": ForwardRef('VoiceAgentSessionAvatarConfig', module='types') - key "expires_at": Optional[int] - key "greeting": ForwardRef('VoiceGreetingConfig', module='types') - key "id": Required[str] - key "instructions": str - key "interim_response": ForwardRef('VoiceAgentInterimResponse', module='types') - key "max_output_tokens": ForwardRef('VoiceAgentMaxOutputTokens', module='types') - key "model": Required[str] - key "object": Required[Literal["session"]] - key "parallel_tool_calls": bool - key "reasoning": ForwardRef('RealtimeReasoning', module='types') - key "temperature": float - key "tool_choice": ForwardRef('VoiceAgentToolChoice', module='types') - key "type": Required[Literal["realtime"]] - animation: VoiceAgentAnimationConfig - audio: VoiceAudioConfig - avatar: VoiceAgentSessionAvatarConfig - expires_at: int - greeting: VoiceGreetingConfig - id: str - include: list[Union[str, VoiceAgentSessionIncludeOption]] - instructions: str - interim_response: VoiceAgentInterimResponse - max_output_tokens: VoiceAgentMaxOutputTokens - metadata: dict[str, str] - model: str - object: Literal[session] - output_modalities: list[Union[str, VoiceOutputModality]] - parallel_tool_calls: bool - reasoning: RealtimeReasoning - temperature: float - tool_choice: VoiceAgentToolChoice - tools: list[VoiceAgentTool] - type: Literal[realtime] - - - class azure.ai.projects.types.VoiceAgentSessionUpdateConfig(TypedDict, total=False): - key "animation": ForwardRef('VoiceAgentAnimationConfig', module='types') - key "audio": ForwardRef('VoiceAudioConfig', module='types') - key "avatar": ForwardRef('VoiceAgentSessionAvatarConfig', module='types') - key "greeting": ForwardRef('VoiceGreetingConfig', module='types') - key "instructions": str - key "interim_response": ForwardRef('VoiceAgentInterimResponse', module='types') - key "max_output_tokens": ForwardRef('VoiceAgentMaxOutputTokens', module='types') - key "parallel_tool_calls": bool - key "reasoning": ForwardRef('RealtimeReasoning', module='types') - key "temperature": float - key "tool_choice": ForwardRef('VoiceAgentToolChoice', module='types') - key "type": Required[Literal["realtime"]] - animation: VoiceAgentAnimationConfig - audio: VoiceAudioConfig - avatar: VoiceAgentSessionAvatarConfig - greeting: VoiceGreetingConfig - include: list[Union[str, VoiceAgentSessionIncludeOption]] - instructions: str - interim_response: VoiceAgentInterimResponse - max_output_tokens: VoiceAgentMaxOutputTokens - metadata: dict[str, str] - output_modalities: list[Union[str, VoiceOutputModality]] - parallel_tool_calls: bool - reasoning: RealtimeReasoning - temperature: float - tool_choice: VoiceAgentToolChoice - tools: list[VoiceAgentTool] - type: Literal[realtime] - - - class azure.ai.projects.types.VoiceAgentStaticInterimResponseConfig(TypedDict, total=False): - key "latency_threshold_ms": int - key "type": Required[Literal["static_interim_response"]] - latency_threshold_ms: int - texts: list[str] - triggers: list[Union[str, VoiceAgentInterimResponseTrigger]] - type: Literal[static_interim_response] - - - class azure.ai.projects.types.VoiceAgentTranscriptionPhrase(TypedDict, total=False): - key "confidence": Optional[float] - key "duration_milliseconds": Required[int] - key "locale": Optional[str] - key "offset_milliseconds": Required[int] - key "text": Required[str] - key "words": Optional[list[VoiceAgentTranscriptionWord]] - confidence: float - duration_milliseconds: int - locale: str - offset_milliseconds: int - text: str - words: list[VoiceAgentTranscriptionWord] - - - class azure.ai.projects.types.VoiceAgentTranscriptionWord(TypedDict, total=False): - key "duration_milliseconds": Required[int] - key "offset_milliseconds": Required[int] - key "text": Required[str] - duration_milliseconds: int - offset_milliseconds: int - text: str - - - class azure.ai.projects.types.VoiceAssistantMessageItem(TypedDict, total=False): - key "content": Required[list[RealtimeConversationItemMessageAssistantContent]] - key "created_at": int - key "id": str - key "object": Literal["item"] - key "response_id": str - key "role": Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] - key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal[VoiceConversationItemType.MESSAGE]] - content: list[RealtimeConversationItemMessageAssistantContent] - created_at: int - id: str - object: Literal[item] - response_id: str - role: Literal[RealtimeConversationItemMessageType.ASSISTANT] - status: Literal[completed, incomplete, in_progress] - type: Literal[VoiceConversationItemType.MESSAGE] - - - class azure.ai.projects.types.VoiceAudioConfig(TypedDict, total=False): - key "input": ForwardRef('VoiceAudioInputConfig', module='types') - key "output": ForwardRef('VoiceAudioOutputConfig', module='types') - input: VoiceAudioInputConfig - output: VoiceAudioOutputConfig - - - class azure.ai.projects.types.VoiceAudioFormat(TypedDict, total=False): - key "rate": int - key "type": Required[Union[str, VoiceAudioFormatType]] - rate: int - type: Union[str, VoiceAudioFormatType] - - - class azure.ai.projects.types.VoiceAudioInputConfig(TypedDict, total=False): - key "echo_cancellation": Optional[VoiceAgentEchoCancellation] - key "format": ForwardRef('VoiceAudioFormat', module='types') - key "noise_reduction": Optional[VoiceNoiseReduction] - key "transcription": Optional[VoiceInputTranscription] - key "turn_detection": Optional[VoiceAgentTurnDetection] - echo_cancellation: VoiceAgentEchoCancellation - format: VoiceAudioFormat - noise_reduction: VoiceNoiseReduction - transcription: VoiceInputTranscription - turn_detection: VoiceAgentTurnDetection - - - class azure.ai.projects.types.VoiceAudioOutputConfig(TypedDict, total=False): - key "custom_lexicon_url": str - key "custom_text_normalization_url": str - key "custom_voice_endpoint_id": str - key "format": ForwardRef('VoiceAudioFormat', module='types') - key "personal_voice_model": str - key "pitch": str - key "speed": float - key "style": str - key "voice": str - key "voice_locale": str - key "voice_temperature": float - key "voice_type": str - key "volume": str - custom_lexicon_url: str - custom_text_normalization_url: str - custom_voice_endpoint_id: str - format: VoiceAudioFormat - output_audio_timestamp_types: list[Union[str, VoiceAudioTimestampType]] - personal_voice_model: str - pitch: str - prefer_locales: list[str] - speed: float - style: str - voice: str - voice_locale: str - voice_temperature: float - voice_type: str - volume: str - - - class azure.ai.projects.types.VoiceAvatarConfig(TypedDict, total=False): - key "character": Required[str] - key "customized": bool - key "model": str - key "output_audit_audio": bool - key "output_protocol": Union[str, VoiceAvatarOutputProtocol] - key "scene": ForwardRef('VoiceAgentAvatarScene', module='types') - key "style": str - key "type": Required[Union[str, VoiceAvatarType]] - key "video": ForwardRef('VoiceAgentAvatarVideoParams', module='types') - character: str - customized: bool - model: str - output_audit_audio: bool - output_protocol: Union[str, VoiceAvatarOutputProtocol] - scene: VoiceAgentAvatarScene - style: str - type: Union[str, VoiceAvatarType] - video: VoiceAgentAvatarVideoParams - - - class azure.ai.projects.types.VoiceAzureSemanticVadEnTurnDetection(TypedDict, total=False): - key "auto_truncate": bool - key "create_response": bool - key "end_of_utterance_detection": Optional[VoiceEndOfUtteranceDetection] - key "idle_timeout_ms": str - key "interrupt_response": bool - key "prefix_padding_ms": str - key "remove_filler_words": bool - key "silence_duration_ms": str - key "speech_duration_ms": str - key "threshold": float - key "type": Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN]] - auto_truncate: bool - create_response: bool - end_of_utterance_detection: VoiceEndOfUtteranceDetection - idle_timeout_ms: str - interrupt_response: bool - prefix_padding_ms: str - remove_filler_words: bool - silence_duration_ms: str - speech_duration_ms: str - threshold: float - type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN] - - - class azure.ai.projects.types.VoiceAzureSemanticVadMultilingualTurnDetection(TypedDict, total=False): - key "auto_truncate": bool - key "create_response": bool - key "end_of_utterance_detection": Optional[VoiceEndOfUtteranceDetection] - key "idle_timeout_ms": str - key "interrupt_response": bool - key "prefix_padding_ms": str - key "remove_filler_words": bool - key "silence_duration_ms": str - key "speech_duration_ms": str - key "threshold": float - key "type": Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL]] - auto_truncate: bool - create_response: bool - end_of_utterance_detection: VoiceEndOfUtteranceDetection - idle_timeout_ms: str - interrupt_response: bool - languages: list[str] - prefix_padding_ms: str - remove_filler_words: bool - silence_duration_ms: str - speech_duration_ms: str - threshold: float - type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] - - - class azure.ai.projects.types.VoiceAzureSemanticVadTurnDetection(TypedDict, total=False): - key "auto_truncate": bool - key "create_response": bool - key "end_of_utterance_detection": Optional[VoiceEndOfUtteranceDetection] - key "idle_timeout_ms": str - key "interrupt_response": bool - key "prefix_padding_ms": str - key "remove_filler_words": bool - key "silence_duration_ms": str - key "speech_duration_ms": str - key "threshold": float - key "type": Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD]] - auto_truncate: bool - create_response: bool - end_of_utterance_detection: VoiceEndOfUtteranceDetection - idle_timeout_ms: str - interrupt_response: bool - languages: list[str] - prefix_padding_ms: str - remove_filler_words: bool - silence_duration_ms: str - speech_duration_ms: str - threshold: float - type: Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD] - - - class azure.ai.projects.types.VoiceConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FUNCTION_CALL = "function_call" - FUNCTION_CALL_OUTPUT = "function_call_output" - MCP_APPROVAL_REQUEST = "mcp_approval_request" - MCP_APPROVAL_RESPONSE = "mcp_approval_response" - MCP_CALL = "mcp_call" - MCP_LIST_TOOLS = "mcp_list_tools" - MESSAGE = "message" - - - class azure.ai.projects.types.VoiceEndOfUtteranceDetection(TypedDict, total=False): - key "model": Required[Union[str, VoiceEndOfUtteranceDetectionModel]] - key "threshold_level": Union[str, VoiceEndOfUtteranceThresholdLevel] - key "timeout_ms": str - model: Union[str, VoiceEndOfUtteranceDetectionModel] - threshold_level: Union[str, VoiceEndOfUtteranceThresholdLevel] - timeout_ms: str - - - class azure.ai.projects.types.VoiceFunctionCallItem(TypedDict, total=False): - key "arguments": Required[str] - key "call_id": str - key "created_at": int - key "id": str - key "name": Required[str] - key "object": Literal["item"] - key "response_id": str - key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal[VoiceConversationItemType.FUNCTION_CALL]] - arguments: str - call_id: str - created_at: int - id: str - name: str - object: Literal[item] - response_id: str - status: Literal[completed, incomplete, in_progress] - type: Literal[VoiceConversationItemType.FUNCTION_CALL] - - - class azure.ai.projects.types.VoiceFunctionCallOutputItem(TypedDict, total=False): - key "call_id": Required[str] - key "created_at": int - key "id": str - key "name": str - key "object": Literal["item"] - key "output": Required[str] - key "response_id": str - key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT]] - call_id: str - created_at: int - id: str - name: str - object: Literal[item] - output: str - response_id: str - status: Literal[completed, incomplete, in_progress] - type: Literal[VoiceConversationItemType.FUNCTION_CALL_OUTPUT] - - - class azure.ai.projects.types.VoiceInputTranscription(TypedDict, total=False): - key "delay": Literal["minimal", "low", "medium", "high", "xhigh"] - key "language": str - key "model": Required[Union[str, VoiceInputTranscriptionModel]] - key "prompt": str - custom_speech: dict[str, str] - delay: Literal[minimal, low, medium, high, xhigh] - language: str - model: Union[str, VoiceInputTranscriptionModel] - phrase_list: list[str] - prompt: str - + @distributed_trace + def list( + self, + *, + action_type: Optional[Union[str, EvaluationRuleActionType]] = ..., + agent_name: Optional[str] = ..., + enabled: Optional[bool] = ..., + **kwargs: Any + ) -> ItemPaged[EvaluationRule]: ... - class azure.ai.projects.types.VoiceMcpApprovalRequestItem(TypedDict, total=False): - key "arguments": Required[str] - key "created_at": int - key "id": Required[str] - key "name": Required[str] - key "response_id": str - key "server_label": Required[str] - key "type": Required[Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST]] - arguments: str - created_at: int - id: str - name: str - response_id: str - server_label: str - type: Literal[VoiceConversationItemType.MCP_APPROVAL_REQUEST] + class azure.ai.projects.operations.IndexesOperations: - class azure.ai.projects.types.VoiceMcpApprovalResponseItem(TypedDict, total=False): - key "approval_request_id": Required[str] - key "approve": Required[bool] - key "created_at": int - key "id": Required[str] - key "reason": Optional[str] - key "response_id": str - key "type": Required[Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE]] - approval_request_id: str - approve: bool - created_at: int - id: str - reason: str - response_id: str - type: Literal[VoiceConversationItemType.MCP_APPROVAL_RESPONSE] + def __init__( + self, + *args, + **kwargs + ) -> None: ... + @overload + def create_or_update( + self, + name: str, + version: str, + index: Index, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> Index: ... - class azure.ai.projects.types.VoiceMcpCallItem(TypedDict, total=False): - key "approval_request_id": Optional[str] - key "arguments": Required[str] - key "created_at": int - key "error": ForwardRef('RealtimeMCPError', module='types') - key "id": Required[str] - key "name": Required[str] - key "output": Optional[str] - key "response_id": str - key "server_label": Required[str] - key "type": Required[Literal[VoiceConversationItemType.MCP_CALL]] - approval_request_id: str - arguments: str - created_at: int - error: RealtimeMCPError - id: str - name: str - output: str - response_id: str - server_label: str - type: Literal[VoiceConversationItemType.MCP_CALL] + @overload + def create_or_update( + self, + name: str, + version: str, + index: JSON, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> Index: ... + @overload + def create_or_update( + self, + name: str, + version: str, + index: IO[bytes], + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> Index: ... - class azure.ai.projects.types.VoiceMcpListToolsItem(TypedDict, total=False): - key "created_at": int - key "id": str - key "response_id": str - key "server_label": Required[str] - key "tools": Required[list[MCPListToolsTool]] - key "type": Required[Literal[VoiceConversationItemType.MCP_LIST_TOOLS]] - created_at: int - id: str - response_id: str - server_label: str - tools: list[MCPListToolsTool] - type: Literal[VoiceConversationItemType.MCP_LIST_TOOLS] + @distributed_trace + def delete( + self, + name: str, + version: str, + **kwargs: Any + ) -> None: ... + @distributed_trace + def get( + self, + name: str, + version: str, + **kwargs: Any + ) -> Index: ... - class azure.ai.projects.types.VoiceNoiseReduction(TypedDict, total=False): - key "type": Required[Union[str, VoiceNoiseReductionType]] - type: Union[str, VoiceNoiseReductionType] + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[Index]: ... + @distributed_trace + def list_versions( + self, + name: str, + **kwargs: Any + ) -> ItemPaged[Index]: ... - class azure.ai.projects.types.VoiceResponseAudio(TypedDict, total=False): - key "output": ForwardRef('VoiceResponseAudioOutput', module='types') - output: VoiceResponseAudioOutput + class azure.ai.projects.operations.TelemetryOperations: - class azure.ai.projects.types.VoiceResponseAudioOutput(TypedDict, total=False): - key "format": ForwardRef('RealtimeAudioFormats', module='types') - key "voice": str - key "voice_locale": str - key "voice_type": str - format: RealtimeAudioFormats - voice: str - voice_locale: str - voice_type: str + def __init__(self, outer_instance: AIProjectClient) -> None: ... + @distributed_trace + def get_application_insights_connection_string(self) -> str: ... - class azure.ai.projects.types.VoiceServerVadTurnDetection(TypedDict, total=False): - key "auto_truncate": bool - key "create_response": bool - key "end_of_utterance_detection": Optional[VoiceEndOfUtteranceDetection] - key "idle_timeout_ms": Optional[int] - key "interrupt_response": bool - key "prefix_padding_ms": int - key "silence_duration_ms": int - key "speech_duration_ms": int - key "threshold": float - key "type": Required[Literal[VoiceTurnDetectionType.SERVER_VAD]] - auto_truncate: bool - create_response: bool - end_of_utterance_detection: VoiceEndOfUtteranceDetection - idle_timeout_ms: int - interrupt_response: bool - prefix_padding_ms: int - silence_duration_ms: int - speech_duration_ms: int - threshold: float - type: Literal[VoiceTurnDetectionType.SERVER_VAD] - - - class azure.ai.projects.types.VoiceSystemMessageItem(TypedDict, total=False): - key "content": Required[list[RealtimeConversationItemMessageSystemContent]] - key "created_at": int - key "id": str - key "object": Literal["item"] - key "response_id": str - key "role": Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] - key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal[VoiceConversationItemType.MESSAGE]] - content: list[RealtimeConversationItemMessageSystemContent] - created_at: int - id: str - object: Literal[item] - response_id: str - role: Literal[RealtimeConversationItemMessageType.SYSTEM] - status: Literal[completed, incomplete, in_progress] - type: Literal[VoiceConversationItemType.MESSAGE] + class azure.ai.projects.operations.ToolboxesOperations: - class azure.ai.projects.types.VoiceSystemTool(TypedDict, total=False): - key "description": str - key "name": Required[Union[str, VoiceSystemToolName]] - key "type": Required[Literal["system"]] - description: str - name: Union[str, VoiceSystemToolName] - type: Literal[system] + def __init__( + self, + *args, + **kwargs + ) -> None: ... + @overload + def create_version( + self, + name: str, + *, + content_type: str = "application/json", + description: Optional[str] = ..., + metadata: Optional[dict[str, str]] = ..., + policies: Optional[ToolboxPolicies] = ..., + skills: Optional[List[ToolboxSkill]] = ..., + tools: List[ToolboxTool], + **kwargs: Any + ) -> ToolboxVersionObject: ... - class azure.ai.projects.types.VoiceToolboxTool(TypedDict, total=False): - key "response_scheduling": Union[str, VoiceAgentToolResponseScheduling] - key "toolbox_name": Required[str] - key "toolbox_version": Required[str] - key "type": Required[Literal["toolbox"]] - response_scheduling: Union[str, VoiceAgentToolResponseScheduling] - toolbox_name: str - toolbox_version: str - type: Literal[toolbox] + @overload + def create_version( + self, + name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ToolboxVersionObject: ... + @overload + def create_version( + self, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ToolboxVersionObject: ... - class azure.ai.projects.types.VoiceTurnDetectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AZURE_SEMANTIC_VAD = "azure_semantic_vad" - AZURE_SEMANTIC_VAD_EN = "azure_semantic_vad_en" - AZURE_SEMANTIC_VAD_MULTILINGUAL = "azure_semantic_vad_multilingual" - SEMANTIC_VAD = "semantic_vad" - SERVER_VAD = "server_vad" + @distributed_trace + def delete( + self, + name: str, + **kwargs: Any + ) -> None: ... + @distributed_trace + def delete_version( + self, + name: str, + version: str, + **kwargs: Any + ) -> None: ... - class azure.ai.projects.types.VoiceUserMessageItem(TypedDict, total=False): - key "content": Required[list[RealtimeConversationItemMessageUserContent]] - key "created_at": int - key "id": str - key "object": Literal["item"] - key "response_id": str - key "role": Required[Literal[RealtimeConversationItemMessageType.USER]] - key "status": Literal["completed", "incomplete", "in_progress"] - key "type": Required[Literal[VoiceConversationItemType.MESSAGE]] - content: list[RealtimeConversationItemMessageUserContent] - created_at: int - id: str - object: Literal[item] - response_id: str - role: Literal[RealtimeConversationItemMessageType.USER] - status: Literal[completed, incomplete, in_progress] - type: Literal[VoiceConversationItemType.MESSAGE] - - - class azure.ai.projects.types.WebSearchApproximateLocation(TypedDict, total=False): - key "city": Optional[str] - key "country": Optional[str] - key "region": Optional[str] - key "timezone": Optional[str] - key "type": Required[Literal["approximate"]] - city: str - country: str - region: str - timezone: str - type: Literal[approximate] - - - class azure.ai.projects.types.WebSearchConfiguration(TypedDict, total=False): - key "instance_name": Required[str] - key "project_connection_id": Required[str] - instance_name: str - project_connection_id: str + @distributed_trace + def get( + self, + name: str, + **kwargs: Any + ) -> ToolboxObject: ... + @distributed_trace + def get_version( + self, + name: str, + version: str, + **kwargs: Any + ) -> ToolboxVersionObject: ... - class azure.ai.projects.types.WebSearchPreviewTool(TypedDict, total=False): - key "search_context_size": Union[str, SearchContextSize] - key "type": Required[Literal[ToolType.WEB_SEARCH_PREVIEW]] - key "user_location": Optional[ApproximateLocation] - search_content_types: list[Union[str, SearchContentType]] - search_context_size: Union[str, SearchContextSize] - type: Literal[ToolType.WEB_SEARCH_PREVIEW] - user_location: ApproximateLocation + @distributed_trace + def list( + self, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[ToolboxObject]: ... + @distributed_trace + def list_versions( + self, + name: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[ToolboxVersionObject]: ... - class azure.ai.projects.types.WebSearchTool(TypedDict, total=False): - key "custom_search_configuration": ForwardRef('WebSearchConfiguration', module='types') - key "description": str - key "filters": Optional[WebSearchToolFilters] - key "name": str - key "search_context_size": Literal["low", "medium", "high"] - key "type": Required[Literal[ToolType.WEB_SEARCH]] - key "user_location": Optional[WebSearchApproximateLocation] - custom_search_configuration: WebSearchConfiguration - description: str - filters: WebSearchToolFilters - name: str - search_context_size: Literal[low, medium, high] - tool_configs: dict[str, ToolConfig] - type: Literal[ToolType.WEB_SEARCH] - user_location: WebSearchApproximateLocation + @overload + def update( + self, + name: str, + *, + content_type: str = "application/json", + default_version: str, + **kwargs: Any + ) -> ToolboxObject: ... + @overload + def update( + self, + name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ToolboxObject: ... - class azure.ai.projects.types.WebSearchToolFilters(TypedDict, total=False): - key "allowed_domains": Optional[list[str]] - allowed_domains: list[str] + @overload + def update( + self, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ToolboxObject: ... - class azure.ai.projects.types.WebSearchToolboxTool(TypedDict, total=False): - key "custom_search_configuration": ForwardRef('WebSearchConfiguration', module='types') - key "description": str - key "filters": Optional[WebSearchToolFilters] - key "name": str - key "search_context_size": Literal["low", "medium", "high"] - key "type": Required[Literal[ToolboxToolType.WEB_SEARCH]] - key "user_location": Optional[WebSearchApproximateLocation] - custom_search_configuration: WebSearchConfiguration - description: str - filters: WebSearchToolFilters - name: str - search_context_size: Literal[low, medium, high] - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.WEB_SEARCH] - user_location: WebSearchApproximateLocation +namespace azure.ai.projects.telemetry + def azure.ai.projects.telemetry.trace_function(span_name: Optional[str] = None) -> Callable: ... - class azure.ai.projects.types.WeeklyRecurrenceSchedule(TypedDict, total=False): - key "daysOfWeek": Required[list[Union[str, DayOfWeek]]] - key "type": Required[Literal[RecurrenceType.WEEKLY]] - daysOfWeek: list[Union[str, DayOfWeek]] - type: Literal[RecurrenceType.WEEKLY] + class azure.ai.projects.telemetry.AIProjectInstrumentor: - class azure.ai.projects.types.WorkIQPreviewTool(TypedDict, total=False): - key "project_connection_id": Required[str] - key "type": Required[Literal[ToolType.WORK_IQ_PREVIEW]] - project_connection_id: str - type: Literal[ToolType.WORK_IQ_PREVIEW] + def __init__(self) -> None: ... + def instrument( + self, + enable_content_recording: Optional[bool] = None, + enable_trace_context_propagation: Optional[bool] = None, + enable_baggage_propagation: Optional[bool] = None + ) -> None: ... - class azure.ai.projects.types.WorkIQPreviewToolboxTool(TypedDict, total=False): - key "description": str - key "name": str - key "project_connection_id": Required[str] - key "type": Required[Literal[ToolboxToolType.WORK_IQ_PREVIEW]] - description: str - name: str - project_connection_id: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.WORK_IQ_PREVIEW] + def is_content_recording_enabled(self) -> bool: ... + def is_instrumented(self) -> bool: ... - class azure.ai.projects.types.WorkflowAgentDefinition(TypedDict, total=False): - key "kind": Required[Literal[AgentKind.WORKFLOW]] - key "rai_config": ForwardRef('RaiConfig', module='types') - key "workflow": str - kind: Literal[AgentKind.WORKFLOW] - rai_config: RaiConfig - workflow: str + def uninstrument(self) -> None: ... ``` \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/api.metadata.yml b/sdk/ai/azure-ai-projects/api.metadata.yml index 5923ed96d577..5e272b63910b 100644 --- a/sdk/ai/azure-ai-projects/api.metadata.yml +++ b/sdk/ai/azure-ai-projects/api.metadata.yml @@ -1,3 +1,3 @@ -apiMdSha256: 55a629feb8b0501f399dfa3740cf44231ebfef50128f7fb7c85ce0e60bbefe96 -parserVersion: 0.3.28 -pythonVersion: 3.14.3 +apiMdSha256: 0e81f337eff9e8deff3910dfbe15c9091e0bbb2975f6b633e6a9fbddc1a80279 +parserVersion: 0.3.30 +pythonVersion: 3.13.2 diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index 8ffc24bf213c..822d48028682 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -27,6 +27,26 @@ "azure.ai.projects.models.BaseCredentials": "Azure.AI.Projects.BaseCredentials", "azure.ai.projects.models.AgenticIdentityPreviewCredentials": "Azure.AI.Projects.AgenticIdentityPreviewCredentials", "azure.ai.projects.models.AgentIdentity": "Azure.AI.Projects.AgentIdentity", + "azure.ai.projects.models.AgentInsight": "Azure.AI.Projects.AgentInsight", + "azure.ai.projects.models.AgentInsightDetails": "Azure.AI.Projects.AgentInsightDetails", + "azure.ai.projects.models.AgentInsightEstimatedCost": "Azure.AI.Projects.AgentInsightEstimatedCost", + "azure.ai.projects.models.AgentInsightHighlightedTrace": "Azure.AI.Projects.AgentInsightHighlightedTrace", + "azure.ai.projects.models.AgentInsightLinkedTrace": "Azure.AI.Projects.AgentInsightLinkedTrace", + "azure.ai.projects.models.AgentInsightMonitor": "Azure.AI.Projects.AgentInsightMonitor", + "azure.ai.projects.models.AgentInsightMonitorCreate": "Azure.AI.Projects.AgentInsightMonitorCreate", + "azure.ai.projects.models.AgentInsightMonitorListItem": "Azure.AI.Projects.AgentInsightMonitorListItem", + "azure.ai.projects.models.AgentInsightMonitorUpdate": "Azure.AI.Projects.AgentInsightMonitorUpdate", + "azure.ai.projects.models.AgentInsightProposedFix": "Azure.AI.Projects.AgentInsightProposedFix", + "azure.ai.projects.models.AgentInsightProposedFixChange": "Azure.AI.Projects.AgentInsightProposedFixChange", + "azure.ai.projects.models.AgentInsightRecommendedAction": "Azure.AI.Projects.AgentInsightRecommendedAction", + "azure.ai.projects.models.AgentInsightRun": "Azure.AI.Projects.AgentInsightRun", + "azure.ai.projects.models.AgentInsightRunCreate": "Azure.AI.Projects.AgentInsightRunCreate", + "azure.ai.projects.models.AgentInsightRunResult": "Azure.AI.Projects.AgentInsightRunResult", + "azure.ai.projects.models.AgentInsightsOverview": "Azure.AI.Projects.AgentInsightsOverview", + "azure.ai.projects.models.AgentInsightsOverviewOverride": "Azure.AI.Projects.AgentInsightsOverviewOverride", + "azure.ai.projects.models.AgentInsightSuspension": "Azure.AI.Projects.AgentInsightSuspension", + "azure.ai.projects.models.AgentInsightTokenUsage": "Azure.AI.Projects.AgentInsightTokenUsage", + "azure.ai.projects.models.AgentInsightUpdate": "Azure.AI.Projects.AgentInsightUpdate", "azure.ai.projects.models.AgentObjectVersions": "Azure.AI.Projects.AgentObject.versions.anonymous", "azure.ai.projects.models.AgentOptimizationCandidate": "Azure.AI.Projects.AgentOptimizationCandidate", "azure.ai.projects.models.AgentOptimizationDatasetCriterion": "Azure.AI.Projects.AgentOptimizationDatasetCriterion", @@ -218,8 +238,6 @@ "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.VoiceGreetingConfig": "Azure.AI.Projects.VoiceGreetingConfig", - "azure.ai.projects.models.LlmGeneratedVoiceGreetingConfig": "Azure.AI.Projects.LlmGeneratedVoiceGreetingConfig", "azure.ai.projects.models.LocalShellToolParam": "OpenAI.LocalShellToolParam", "azure.ai.projects.models.LocalSkillParam": "OpenAI.LocalSkillParam", "azure.ai.projects.models.LogProbProperties": "OpenAI.LogProbProperties", @@ -248,6 +266,9 @@ "azure.ai.projects.models.MemoryStoreUpdateCompletedResult": "Azure.AI.Projects.MemoryStoreUpdateCompletedResult", "azure.ai.projects.models.MemoryStoreUpdateResult": "Azure.AI.Projects.MemoryStoreUpdateResponse", "azure.ai.projects.models.Metadata": "OpenAI.Metadata", + "azure.ai.projects.models.Microsoft365PermissionScopes": "Azure.AI.Projects.Microsoft365PermissionScopes", + "azure.ai.projects.models.Microsoft365PublishDefaults": "Azure.AI.Projects.Microsoft365PublishDefaults", + "azure.ai.projects.models.Microsoft365PublishResult": "Azure.AI.Projects.Microsoft365PublishResponse", "azure.ai.projects.models.MicrosoftFabricPreviewTool": "Azure.AI.Projects.MicrosoftFabricPreviewTool", "azure.ai.projects.models.ModelCredentialRequest": "Azure.AI.Projects.ModelCredentialRequest", "azure.ai.projects.models.ModelDeployment": "Azure.AI.Projects.ModelDeployment", @@ -260,8 +281,6 @@ "azure.ai.projects.models.MonthlyRecurrenceSchedule": "Azure.AI.Projects.MonthlyRecurrenceSchedule", "azure.ai.projects.models.NamespaceToolParam": "OpenAI.NamespaceToolParam", "azure.ai.projects.models.NoAuthenticationCredentials": "Azure.AI.Projects.NoAuthenticationCredentials", - "azure.ai.projects.models.OmitPropertiesRealtimeResponse": "TypeSpec.OmitProperties", - "azure.ai.projects.models.OmitPropertiesRealtimeResponse1": "TypeSpec.OmitProperties", "azure.ai.projects.models.OneTimeTrigger": "Azure.AI.Projects.OneTimeTrigger", "azure.ai.projects.models.OpenApiAuthDetails": "Azure.AI.Projects.OpenApiAuthDetails", "azure.ai.projects.models.OpenApiAnonymousAuthDetails": "Azure.AI.Projects.OpenApiAnonymousAuthDetails", @@ -278,7 +297,7 @@ "azure.ai.projects.models.OtlpTelemetryEndpoint": "Azure.AI.Projects.OtlpTelemetryEndpoint", "azure.ai.projects.models.PendingUploadRequest": "Azure.AI.Projects.PendingUploadRequest", "azure.ai.projects.models.PendingUploadResponse": "Azure.AI.Projects.PendingUploadResponse", - "azure.ai.projects.models.PickPropertiesVoiceAudioConfig": "TypeSpec.PickProperties", + "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.PromotionInfo": "Azure.AI.Projects.PromotionInfo", @@ -295,16 +314,20 @@ "azure.ai.projects.models.RealtimeAudioFormatsAudioPcm": "OpenAI.RealtimeAudioFormatsAudioPcm", "azure.ai.projects.models.RealtimeAudioFormatsAudioPcma": "OpenAI.RealtimeAudioFormatsAudioPcma", "azure.ai.projects.models.RealtimeAudioFormatsAudioPcmu": "OpenAI.RealtimeAudioFormatsAudioPcmu", + "azure.ai.projects.models.RealtimeClientEvent": "OpenAI.RealtimeClientEvent", + "azure.ai.projects.models.RealtimeClientEventConversationItemCreate": "OpenAI.RealtimeClientEventConversationItemCreate", + "azure.ai.projects.models.RealtimeClientEventConversationItemDelete": "OpenAI.RealtimeClientEventConversationItemDelete", + "azure.ai.projects.models.RealtimeClientEventConversationItemRetrieve": "OpenAI.RealtimeClientEventConversationItemRetrieve", + "azure.ai.projects.models.RealtimeClientEventConversationItemTruncate": "OpenAI.RealtimeClientEventConversationItemTruncate", + "azure.ai.projects.models.RealtimeClientEventInputAudioBufferAppend": "OpenAI.RealtimeClientEventInputAudioBufferAppend", + "azure.ai.projects.models.RealtimeClientEventInputAudioBufferClear": "OpenAI.RealtimeClientEventInputAudioBufferClear", + "azure.ai.projects.models.RealtimeClientEventInputAudioBufferCommit": "OpenAI.RealtimeClientEventInputAudioBufferCommit", + "azure.ai.projects.models.RealtimeClientEventOutputAudioBufferClear": "OpenAI.RealtimeClientEventOutputAudioBufferClear", + "azure.ai.projects.models.RealtimeClientEventResponseCancel": "OpenAI.RealtimeClientEventResponseCancel", + "azure.ai.projects.models.RealtimeClientEventResponseCreate": "OpenAI.RealtimeClientEventResponseCreate", "azure.ai.projects.models.RealtimeConversationItem": "OpenAI.RealtimeConversationItem", "azure.ai.projects.models.RealtimeConversationItemFunctionCall": "OpenAI.RealtimeConversationItemFunctionCall", "azure.ai.projects.models.RealtimeConversationItemFunctionCallOutput": "OpenAI.RealtimeConversationItemFunctionCallOutput", - "azure.ai.projects.models.RealtimeConversationItemMessage": "OpenAI.RealtimeConversationItemMessage", - "azure.ai.projects.models.RealtimeConversationItemMessageAssistant": "OpenAI.RealtimeConversationItemMessageAssistant", - "azure.ai.projects.models.RealtimeConversationItemMessageAssistantContent": "OpenAI.RealtimeConversationItemMessageAssistantContent", - "azure.ai.projects.models.RealtimeConversationItemMessageSystem": "OpenAI.RealtimeConversationItemMessageSystem", - "azure.ai.projects.models.RealtimeConversationItemMessageSystemContent": "OpenAI.RealtimeConversationItemMessageSystemContent", - "azure.ai.projects.models.RealtimeConversationItemMessageUser": "OpenAI.RealtimeConversationItemMessageUser", - "azure.ai.projects.models.RealtimeConversationItemMessageUserContent": "OpenAI.RealtimeConversationItemMessageUserContent", "azure.ai.projects.models.RealtimeFunctionTool": "OpenAI.RealtimeFunctionTool", "azure.ai.projects.models.RealtimeFunctionToolParameters": "OpenAI.RealtimeFunctionToolParameters", "azure.ai.projects.models.RealtimeMCPApprovalRequest": "OpenAI.RealtimeMCPApprovalRequest", @@ -323,12 +346,53 @@ "azure.ai.projects.models.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails": "OpenAI.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails", "azure.ai.projects.models.RealtimeResponseUsageOutputTokenDetails": "OpenAI.RealtimeResponseUsageOutputTokenDetails", "azure.ai.projects.models.RealtimeServerEvent": "OpenAI.RealtimeServerEvent", + "azure.ai.projects.models.RealtimeServerEventConversationItemAdded": "OpenAI.RealtimeServerEventConversationItemAdded", + "azure.ai.projects.models.RealtimeServerEventConversationItemCreated": "OpenAI.RealtimeServerEventConversationItemCreated", + "azure.ai.projects.models.RealtimeServerEventConversationItemDeleted": "OpenAI.RealtimeServerEventConversationItemDeleted", + "azure.ai.projects.models.RealtimeServerEventConversationItemDone": "OpenAI.RealtimeServerEventConversationItemDone", + "azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionCompleted": "OpenAI.RealtimeServerEventConversationItemInputAudioTranscriptionCompleted", + "azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionDelta": "OpenAI.RealtimeServerEventConversationItemInputAudioTranscriptionDelta", + "azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionFailed": "OpenAI.RealtimeServerEventConversationItemInputAudioTranscriptionFailed", "azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError": "OpenAI.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError", + "azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionSegment": "OpenAI.RealtimeServerEventConversationItemInputAudioTranscriptionSegment", + "azure.ai.projects.models.RealtimeServerEventConversationItemRetrieved": "OpenAI.RealtimeServerEventConversationItemRetrieved", + "azure.ai.projects.models.RealtimeServerEventConversationItemTruncated": "OpenAI.RealtimeServerEventConversationItemTruncated", "azure.ai.projects.models.RealtimeServerEventError": "OpenAI.RealtimeServerEventError", "azure.ai.projects.models.RealtimeServerEventErrorError": "OpenAI.RealtimeServerEventErrorError", + "azure.ai.projects.models.RealtimeServerEventInputAudioBufferCleared": "OpenAI.RealtimeServerEventInputAudioBufferCleared", + "azure.ai.projects.models.RealtimeServerEventInputAudioBufferCommitted": "OpenAI.RealtimeServerEventInputAudioBufferCommitted", + "azure.ai.projects.models.RealtimeServerEventInputAudioBufferSpeechStarted": "OpenAI.RealtimeServerEventInputAudioBufferSpeechStarted", + "azure.ai.projects.models.RealtimeServerEventInputAudioBufferSpeechStopped": "OpenAI.RealtimeServerEventInputAudioBufferSpeechStopped", + "azure.ai.projects.models.RealtimeServerEventInputAudioBufferTimeoutTriggered": "OpenAI.RealtimeServerEventInputAudioBufferTimeoutTriggered", + "azure.ai.projects.models.RealtimeServerEventMCPListToolsCompleted": "OpenAI.RealtimeServerEventMCPListToolsCompleted", + "azure.ai.projects.models.RealtimeServerEventMCPListToolsFailed": "OpenAI.RealtimeServerEventMCPListToolsFailed", + "azure.ai.projects.models.RealtimeServerEventMCPListToolsInProgress": "OpenAI.RealtimeServerEventMCPListToolsInProgress", + "azure.ai.projects.models.RealtimeServerEventOutputAudioBufferCleared": "OpenAI.RealtimeServerEventOutputAudioBufferCleared", + "azure.ai.projects.models.RealtimeServerEventRateLimitsUpdated": "OpenAI.RealtimeServerEventRateLimitsUpdated", "azure.ai.projects.models.RealtimeServerEventRateLimitsUpdatedRateLimits": "OpenAI.RealtimeServerEventRateLimitsUpdatedRateLimits", + "azure.ai.projects.models.RealtimeServerEventResponseAudioDelta": "OpenAI.RealtimeServerEventResponseAudioDelta", + "azure.ai.projects.models.RealtimeServerEventResponseAudioDone": "OpenAI.RealtimeServerEventResponseAudioDone", + "azure.ai.projects.models.RealtimeServerEventResponseAudioTranscriptDelta": "OpenAI.RealtimeServerEventResponseAudioTranscriptDelta", + "azure.ai.projects.models.RealtimeServerEventResponseAudioTranscriptDone": "OpenAI.RealtimeServerEventResponseAudioTranscriptDone", "azure.ai.projects.models.RealtimeServerEventResponseContentPartAdded": "OpenAI.RealtimeServerEventResponseContentPartAdded", "azure.ai.projects.models.RealtimeServerEventResponseContentPartAddedPart": "OpenAI.RealtimeServerEventResponseContentPartAddedPart", + "azure.ai.projects.models.RealtimeServerEventResponseContentPartDone": "OpenAI.RealtimeServerEventResponseContentPartDone", + "azure.ai.projects.models.RealtimeServerEventResponseContentPartDonePart": "OpenAI.RealtimeServerEventResponseContentPartDonePart", + "azure.ai.projects.models.RealtimeServerEventResponseCreated": "OpenAI.RealtimeServerEventResponseCreated", + "azure.ai.projects.models.RealtimeServerEventResponseDone": "OpenAI.RealtimeServerEventResponseDone", + "azure.ai.projects.models.RealtimeServerEventResponseFunctionCallArgumentsDelta": "OpenAI.RealtimeServerEventResponseFunctionCallArgumentsDelta", + "azure.ai.projects.models.RealtimeServerEventResponseFunctionCallArgumentsDone": "OpenAI.RealtimeServerEventResponseFunctionCallArgumentsDone", + "azure.ai.projects.models.RealtimeServerEventResponseMCPCallArgumentsDelta": "OpenAI.RealtimeServerEventResponseMCPCallArgumentsDelta", + "azure.ai.projects.models.RealtimeServerEventResponseMCPCallArgumentsDone": "OpenAI.RealtimeServerEventResponseMCPCallArgumentsDone", + "azure.ai.projects.models.RealtimeServerEventResponseMCPCallCompleted": "OpenAI.RealtimeServerEventResponseMCPCallCompleted", + "azure.ai.projects.models.RealtimeServerEventResponseMCPCallFailed": "OpenAI.RealtimeServerEventResponseMCPCallFailed", + "azure.ai.projects.models.RealtimeServerEventResponseMCPCallInProgress": "OpenAI.RealtimeServerEventResponseMCPCallInProgress", + "azure.ai.projects.models.RealtimeServerEventResponseOutputItemAdded": "OpenAI.RealtimeServerEventResponseOutputItemAdded", + "azure.ai.projects.models.RealtimeServerEventResponseOutputItemDone": "OpenAI.RealtimeServerEventResponseOutputItemDone", + "azure.ai.projects.models.RealtimeServerEventResponseTextDelta": "OpenAI.RealtimeServerEventResponseTextDelta", + "azure.ai.projects.models.RealtimeServerEventResponseTextDone": "OpenAI.RealtimeServerEventResponseTextDone", + "azure.ai.projects.models.RealtimeServerEventSessionCreated": "OpenAI.RealtimeServerEventSessionCreated", + "azure.ai.projects.models.RealtimeServerEventSessionUpdated": "OpenAI.RealtimeServerEventSessionUpdated", "azure.ai.projects.models.Reasoning": "OpenAI.Reasoning", "azure.ai.projects.models.RecurrenceTrigger": "Azure.AI.Projects.RecurrenceTrigger", "azure.ai.projects.models.RedTeam": "Azure.AI.Projects.RedTeam", @@ -337,6 +401,7 @@ "azure.ai.projects.models.ResponseUsageInputTokensDetails": "OpenAI.ResponseUsageInputTokensDetails", "azure.ai.projects.models.ResponseUsageOutputTokensDetails": "OpenAI.ResponseUsageOutputTokensDetails", "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", "azure.ai.projects.models.RubricBasedEvaluatorDefinition": "Azure.AI.Projects.RubricBasedEvaluatorDefinition", "azure.ai.projects.models.RubricGenerationInputQualityWarning": "Azure.AI.Projects.RubricGenerationInputQualityWarning", @@ -350,6 +415,7 @@ "azure.ai.projects.models.SessionLogEvent": "Azure.AI.Projects.SessionLogEvent", "azure.ai.projects.models.SharepointGroundingToolParameters": "Azure.AI.Projects.SharepointGroundingToolParameters", "azure.ai.projects.models.SharepointPreviewTool": "Azure.AI.Projects.SharepointPreviewTool", + "azure.ai.projects.models.ShellToolboxTool": "Azure.AI.Projects.ShellToolboxTool", "azure.ai.projects.models.SimpleQnADataGenerationJobOptions": "Azure.AI.Projects.SimpleQnADataGenerationJobOptions", "azure.ai.projects.models.SimulationSeedDataGenerationJobOptions": "Azure.AI.Projects.SimulationSeedDataGenerationJobOptions", "azure.ai.projects.models.SkillDetails": "Azure.AI.Projects.Skill", @@ -365,7 +431,6 @@ "azure.ai.projects.models.TaxonomyCategory": "Azure.AI.Projects.TaxonomyCategory", "azure.ai.projects.models.TaxonomySubCategory": "Azure.AI.Projects.TaxonomySubCategory", "azure.ai.projects.models.TelemetryConfig": "Azure.AI.Projects.TelemetryConfig", - "azure.ai.projects.models.TemplateVoiceGreetingConfig": "Azure.AI.Projects.TemplateVoiceGreetingConfig", "azure.ai.projects.models.TextResponseFormat": "OpenAI.TextResponseFormatConfiguration", "azure.ai.projects.models.TextResponseFormatJsonObject": "OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject", "azure.ai.projects.models.TextResponseFormatJsonSchema": "OpenAI.TextResponseFormatJsonSchema", @@ -374,6 +439,11 @@ "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", + "azure.ai.projects.models.ToolboxShellEnvironment": "Azure.AI.Projects.ToolboxShellEnvironment", + "azure.ai.projects.models.ToolboxShellContainerAutoEnvironment": "Azure.AI.Projects.ToolboxShellContainerAutoEnvironment", + "azure.ai.projects.models.ToolboxShellContainerReferenceEnvironment": "Azure.AI.Projects.ToolboxShellContainerReferenceEnvironment", + "azure.ai.projects.models.ToolboxShellNetworkPolicy": "Azure.AI.Projects.ToolboxShellNetworkPolicy", + "azure.ai.projects.models.ToolboxShellNetworkPolicyDisabled": "Azure.AI.Projects.ToolboxShellNetworkPolicyDisabled", "azure.ai.projects.models.ToolboxSkill": "Azure.AI.Projects.ToolboxSkill", "azure.ai.projects.models.ToolboxSkillReference": "Azure.AI.Projects.ToolboxSkillReference", "azure.ai.projects.models.ToolboxVersionObject": "Azure.AI.Projects.ToolboxVersionObject", @@ -408,124 +478,68 @@ "azure.ai.projects.models.VersionRefIndicator": "Azure.AI.Projects.VersionRefIndicator", "azure.ai.projects.models.VersionSelector": "Azure.AI.Projects.VersionSelector", "azure.ai.projects.models.VoiceAgentAnimationConfig": "Azure.AI.Projects.VoiceAgentAnimationConfig", + "azure.ai.projects.models.VoiceAgentAudioConfig": "Azure.AI.Projects.VoiceAgentAudioConfig", + "azure.ai.projects.models.VoiceAgentAudioInputConfig": "Azure.AI.Projects.VoiceAgentAudioInputConfig", + "azure.ai.projects.models.VoiceAgentAudioOutputConfig": "Azure.AI.Projects.VoiceAgentAudioOutputConfig", + "azure.ai.projects.models.VoiceAgentAvatarConfig": "Azure.AI.Projects.VoiceAgentAvatarConfig", "azure.ai.projects.models.VoiceAgentAvatarIceServer": "Azure.AI.Projects.VoiceAgentAvatarIceServer", "azure.ai.projects.models.VoiceAgentAvatarScene": "Azure.AI.Projects.VoiceAgentAvatarScene", "azure.ai.projects.models.VoiceAgentAvatarVideoBackground": "Azure.AI.Projects.VoiceAgentAvatarVideoBackground", "azure.ai.projects.models.VoiceAgentAvatarVideoCrop": "Azure.AI.Projects.VoiceAgentAvatarVideoCrop", "azure.ai.projects.models.VoiceAgentAvatarVideoParams": "Azure.AI.Projects.VoiceAgentAvatarVideoParams", "azure.ai.projects.models.VoiceAgentAvatarVideoResolution": "Azure.AI.Projects.VoiceAgentAvatarVideoResolution", - "azure.ai.projects.models.VoiceAgentClientEventConversationItemCreate": "Azure.AI.Projects.VoiceAgentClientEventConversationItemCreate", - "azure.ai.projects.models.VoiceAgentClientEventConversationItemDelete": "Azure.AI.Projects.VoiceAgentClientEventConversationItemDelete", - "azure.ai.projects.models.VoiceAgentClientEventConversationItemRetrieve": "Azure.AI.Projects.VoiceAgentClientEventConversationItemRetrieve", - "azure.ai.projects.models.VoiceAgentClientEventConversationItemTruncate": "Azure.AI.Projects.VoiceAgentClientEventConversationItemTruncate", - "azure.ai.projects.models.VoiceAgentClientEventInputAudioBufferAppend": "Azure.AI.Projects.VoiceAgentClientEventInputAudioBufferAppend", - "azure.ai.projects.models.VoiceAgentClientEventInputAudioBufferClear": "Azure.AI.Projects.VoiceAgentClientEventInputAudioBufferClear", - "azure.ai.projects.models.VoiceAgentClientEventInputAudioBufferCommit": "Azure.AI.Projects.VoiceAgentClientEventInputAudioBufferCommit", - "azure.ai.projects.models.VoiceAgentClientEventOutputAudioBufferClear": "Azure.AI.Projects.VoiceAgentClientEventOutputAudioBufferClear", - "azure.ai.projects.models.VoiceAgentClientEventResponseCancel": "Azure.AI.Projects.VoiceAgentClientEventResponseCancel", - "azure.ai.projects.models.VoiceAgentClientEventResponseCreate": "Azure.AI.Projects.VoiceAgentClientEventResponseCreate", + "azure.ai.projects.models.VoiceAgentTurnDetectionConfig": "Azure.AI.Projects.VoiceAgentTurnDetectionConfig", + "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.VoiceAgentClientEventSessionAvatarConnect": "Azure.AI.Projects.VoiceAgentClientEventSessionAvatarConnect", "azure.ai.projects.models.VoiceAgentClientEventSessionUpdate": "Azure.AI.Projects.VoiceAgentClientEventSessionUpdate", "azure.ai.projects.models.VoiceAgentDefinition": "Azure.AI.Projects.VoiceAgentDefinition", "azure.ai.projects.models.VoiceAgentEchoCancellation": "Azure.AI.Projects.VoiceAgentEchoCancellation", + "azure.ai.projects.models.VoiceAgentEndOfUtteranceDetection": "Azure.AI.Projects.VoiceAgentEndOfUtteranceDetection", "azure.ai.projects.models.VoiceAgentTool": "Azure.AI.Projects.VoiceAgentTool", "azure.ai.projects.models.VoiceAgentFunctionTool": "Azure.AI.Projects.VoiceAgentFunctionTool", + "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.VoiceAgentLlmGeneratedGreetingConfig": "Azure.AI.Projects.VoiceAgentLlmGeneratedGreetingConfig", "azure.ai.projects.models.VoiceAgentLlmInterimResponseConfig": "Azure.AI.Projects.VoiceAgentLlmInterimResponseConfig", "azure.ai.projects.models.VoiceAgentMcpTool": "Azure.AI.Projects.VoiceAgentMcpTool", + "azure.ai.projects.models.VoiceAgentNoiseReduction": "Azure.AI.Projects.VoiceAgentNoiseReduction", + "azure.ai.projects.models.VoiceAgentRealtimeResponseBase": "Azure.AI.Projects.VoiceAgentRealtimeResponseBase", "azure.ai.projects.models.VoiceAgentRealtimeResponse": "Azure.AI.Projects.VoiceAgentRealtimeResponse", "azure.ai.projects.models.VoiceAgentResponseCreateParams": "Azure.AI.Projects.VoiceAgentResponseCreateParams", - "azure.ai.projects.models.VoiceAgentResponseEventContentPart": "Azure.AI.Projects.VoiceAgentResponseEventContentPart", - "azure.ai.projects.models.VoiceTurnDetection": "Azure.AI.Projects.VoiceTurnDetection", "azure.ai.projects.models.VoiceAgentSemanticVadTurnDetection": "Azure.AI.Projects.VoiceAgentSemanticVadTurnDetection", - "azure.ai.projects.models.VoiceAgentServerEventConversationItemAdded": "Azure.AI.Projects.VoiceAgentServerEventConversationItemAdded", - "azure.ai.projects.models.VoiceAgentServerEventConversationItemCreated": "Azure.AI.Projects.VoiceAgentServerEventConversationItemCreated", - "azure.ai.projects.models.VoiceAgentServerEventConversationItemDeleted": "Azure.AI.Projects.VoiceAgentServerEventConversationItemDeleted", - "azure.ai.projects.models.VoiceAgentServerEventConversationItemDone": "Azure.AI.Projects.VoiceAgentServerEventConversationItemDone", - "azure.ai.projects.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted": "Azure.AI.Projects.VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted", - "azure.ai.projects.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta": "Azure.AI.Projects.VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta", - "azure.ai.projects.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed": "Azure.AI.Projects.VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed", - "azure.ai.projects.models.VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment": "Azure.AI.Projects.VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment", - "azure.ai.projects.models.VoiceAgentServerEventConversationItemRetrieved": "Azure.AI.Projects.VoiceAgentServerEventConversationItemRetrieved", - "azure.ai.projects.models.VoiceAgentServerEventConversationItemTruncated": "Azure.AI.Projects.VoiceAgentServerEventConversationItemTruncated", - "azure.ai.projects.models.VoiceAgentServerEventInputAudioBufferCleared": "Azure.AI.Projects.VoiceAgentServerEventInputAudioBufferCleared", - "azure.ai.projects.models.VoiceAgentServerEventInputAudioBufferCommitted": "Azure.AI.Projects.VoiceAgentServerEventInputAudioBufferCommitted", - "azure.ai.projects.models.VoiceAgentServerEventInputAudioBufferSpeechStarted": "Azure.AI.Projects.VoiceAgentServerEventInputAudioBufferSpeechStarted", - "azure.ai.projects.models.VoiceAgentServerEventInputAudioBufferSpeechStopped": "Azure.AI.Projects.VoiceAgentServerEventInputAudioBufferSpeechStopped", - "azure.ai.projects.models.VoiceAgentServerEventInputAudioBufferTimeoutTriggered": "Azure.AI.Projects.VoiceAgentServerEventInputAudioBufferTimeoutTriggered", - "azure.ai.projects.models.VoiceAgentServerEventMcpListToolsCompleted": "Azure.AI.Projects.VoiceAgentServerEventMcpListToolsCompleted", - "azure.ai.projects.models.VoiceAgentServerEventMcpListToolsFailed": "Azure.AI.Projects.VoiceAgentServerEventMcpListToolsFailed", - "azure.ai.projects.models.VoiceAgentServerEventMcpListToolsInProgress": "Azure.AI.Projects.VoiceAgentServerEventMcpListToolsInProgress", - "azure.ai.projects.models.VoiceAgentServerEventOutputAudioBufferCleared": "Azure.AI.Projects.VoiceAgentServerEventOutputAudioBufferCleared", - "azure.ai.projects.models.VoiceAgentServerEventRateLimitsUpdated": "Azure.AI.Projects.VoiceAgentServerEventRateLimitsUpdated", "azure.ai.projects.models.VoiceAgentServerEventResponseAnimationBlendshapesDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseAnimationBlendshapesDelta", "azure.ai.projects.models.VoiceAgentServerEventResponseAnimationBlendshapesDone": "Azure.AI.Projects.VoiceAgentServerEventResponseAnimationBlendshapesDone", "azure.ai.projects.models.VoiceAgentServerEventResponseAnimationVisemeDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseAnimationVisemeDelta", "azure.ai.projects.models.VoiceAgentServerEventResponseAnimationVisemeDone": "Azure.AI.Projects.VoiceAgentServerEventResponseAnimationVisemeDone", - "azure.ai.projects.models.VoiceAgentServerEventResponseAudioDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseAudioDelta", - "azure.ai.projects.models.VoiceAgentServerEventResponseAudioDone": "Azure.AI.Projects.VoiceAgentServerEventResponseAudioDone", "azure.ai.projects.models.VoiceAgentServerEventResponseAudioTimestampDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseAudioTimestampDelta", "azure.ai.projects.models.VoiceAgentServerEventResponseAudioTimestampDone": "Azure.AI.Projects.VoiceAgentServerEventResponseAudioTimestampDone", - "azure.ai.projects.models.VoiceAgentServerEventResponseAudioTranscriptDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseAudioTranscriptDelta", - "azure.ai.projects.models.VoiceAgentServerEventResponseAudioTranscriptDone": "Azure.AI.Projects.VoiceAgentServerEventResponseAudioTranscriptDone", - "azure.ai.projects.models.VoiceAgentServerEventResponseContentPartDone": "Azure.AI.Projects.VoiceAgentServerEventResponseContentPartDone", - "azure.ai.projects.models.VoiceAgentServerEventResponseCreated": "Azure.AI.Projects.VoiceAgentServerEventResponseCreated", - "azure.ai.projects.models.VoiceAgentServerEventResponseDone": "Azure.AI.Projects.VoiceAgentServerEventResponseDone", - "azure.ai.projects.models.VoiceAgentServerEventResponseFunctionCallArgumentsDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseFunctionCallArgumentsDelta", - "azure.ai.projects.models.VoiceAgentServerEventResponseFunctionCallArgumentsDone": "Azure.AI.Projects.VoiceAgentServerEventResponseFunctionCallArgumentsDone", - "azure.ai.projects.models.VoiceAgentServerEventResponseMcpCallArgumentsDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseMcpCallArgumentsDelta", - "azure.ai.projects.models.VoiceAgentServerEventResponseMcpCallArgumentsDone": "Azure.AI.Projects.VoiceAgentServerEventResponseMcpCallArgumentsDone", - "azure.ai.projects.models.VoiceAgentServerEventResponseMcpCallCompleted": "Azure.AI.Projects.VoiceAgentServerEventResponseMcpCallCompleted", - "azure.ai.projects.models.VoiceAgentServerEventResponseMcpCallFailed": "Azure.AI.Projects.VoiceAgentServerEventResponseMcpCallFailed", - "azure.ai.projects.models.VoiceAgentServerEventResponseMcpCallInProgress": "Azure.AI.Projects.VoiceAgentServerEventResponseMcpCallInProgress", - "azure.ai.projects.models.VoiceAgentServerEventResponseOutputItemAdded": "Azure.AI.Projects.VoiceAgentServerEventResponseOutputItemAdded", - "azure.ai.projects.models.VoiceAgentServerEventResponseOutputItemDone": "Azure.AI.Projects.VoiceAgentServerEventResponseOutputItemDone", - "azure.ai.projects.models.VoiceAgentServerEventResponseTextDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseTextDelta", - "azure.ai.projects.models.VoiceAgentServerEventResponseTextDone": "Azure.AI.Projects.VoiceAgentServerEventResponseTextDone", "azure.ai.projects.models.VoiceAgentServerEventResponseVideoDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseVideoDelta", "azure.ai.projects.models.VoiceAgentServerEventSessionAvatarConnecting": "Azure.AI.Projects.VoiceAgentServerEventSessionAvatarConnecting", "azure.ai.projects.models.VoiceAgentServerEventSessionAvatarSwitchToIdle": "Azure.AI.Projects.VoiceAgentServerEventSessionAvatarSwitchToIdle", "azure.ai.projects.models.VoiceAgentServerEventSessionAvatarSwitchToSpeaking": "Azure.AI.Projects.VoiceAgentServerEventSessionAvatarSwitchToSpeaking", - "azure.ai.projects.models.VoiceAgentServerEventSessionCreated": "Azure.AI.Projects.VoiceAgentServerEventSessionCreated", - "azure.ai.projects.models.VoiceAgentServerEventSessionUpdated": "Azure.AI.Projects.VoiceAgentServerEventSessionUpdated", "azure.ai.projects.models.VoiceAgentServerEventWarning": "Azure.AI.Projects.VoiceAgentServerEventWarning", "azure.ai.projects.models.VoiceAgentServerEventWarningDetails": "Azure.AI.Projects.VoiceAgentServerEventWarningDetails", - "azure.ai.projects.models.VoiceAvatarConfig": "Azure.AI.Projects.VoiceAvatarConfig", + "azure.ai.projects.models.VoiceAgentServerVadTurnDetection": "Azure.AI.Projects.VoiceAgentServerVadTurnDetection", "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.VoiceAgentStaticInterimResponseConfig": "Azure.AI.Projects.VoiceAgentStaticInterimResponseConfig", + "azure.ai.projects.models.VoiceAgentSystemTool": "Azure.AI.Projects.VoiceAgentSystemTool", + "azure.ai.projects.models.VoiceAgentTemplateGreetingConfig": "Azure.AI.Projects.VoiceAgentTemplateGreetingConfig", + "azure.ai.projects.models.VoiceAgentToolboxTool": "Azure.AI.Projects.VoiceAgentToolboxTool", "azure.ai.projects.models.VoiceAgentTranscriptionPhrase": "Azure.AI.Projects.VoiceAgentTranscriptionPhrase", "azure.ai.projects.models.VoiceAgentTranscriptionWord": "Azure.AI.Projects.VoiceAgentTranscriptionWord", - "azure.ai.projects.models.VoiceAssistantMessageItem": "Azure.AI.Projects.VoiceAssistantMessageItem", - "azure.ai.projects.models.VoiceAudioConfig": "Azure.AI.Projects.VoiceAudioConfig", - "azure.ai.projects.models.VoiceAudioFormat": "Azure.AI.Projects.VoiceAudioFormat", - "azure.ai.projects.models.VoiceAudioInputConfig": "Azure.AI.Projects.VoiceAudioInputConfig", - "azure.ai.projects.models.VoiceAudioOutputConfig": "Azure.AI.Projects.VoiceAudioOutputConfig", - "azure.ai.projects.models.VoiceAzureSemanticVadEnTurnDetection": "Azure.AI.Projects.VoiceAzureSemanticVadEnTurnDetection", - "azure.ai.projects.models.VoiceAzureSemanticVadMultilingualTurnDetection": "Azure.AI.Projects.VoiceAzureSemanticVadMultilingualTurnDetection", - "azure.ai.projects.models.VoiceAzureSemanticVadTurnDetection": "Azure.AI.Projects.VoiceAzureSemanticVadTurnDetection", "azure.ai.projects.models.VoiceConversation": "Azure.AI.Projects.VoiceConversation", - "azure.ai.projects.models.VoiceEndOfUtteranceDetection": "Azure.AI.Projects.VoiceEndOfUtteranceDetection", - "azure.ai.projects.models.VoiceFunctionCallItem": "Azure.AI.Projects.VoiceFunctionCallItem", - "azure.ai.projects.models.VoiceFunctionCallOutputItem": "Azure.AI.Projects.VoiceFunctionCallOutputItem", - "azure.ai.projects.models.VoiceInputTranscription": "Azure.AI.Projects.VoiceInputTranscription", "azure.ai.projects.models.VoiceItemAudioResponse": "Azure.AI.Projects.VoiceItemAudioResponse", - "azure.ai.projects.models.VoiceMcpApprovalRequestItem": "Azure.AI.Projects.VoiceMcpApprovalRequestItem", - "azure.ai.projects.models.VoiceMcpApprovalResponseItem": "Azure.AI.Projects.VoiceMcpApprovalResponseItem", - "azure.ai.projects.models.VoiceMcpCallItem": "Azure.AI.Projects.VoiceMcpCallItem", - "azure.ai.projects.models.VoiceMcpListToolsItem": "Azure.AI.Projects.VoiceMcpListToolsItem", - "azure.ai.projects.models.VoiceNoiseReduction": "Azure.AI.Projects.VoiceNoiseReduction", "azure.ai.projects.models.VoiceRecordingChannelLayout": "Azure.AI.Projects.VoiceRecordingChannelLayout", "azure.ai.projects.models.VoiceRecordingResponse": "Azure.AI.Projects.VoiceRecordingResponse", + "azure.ai.projects.models.VoiceResponseBase": "Azure.AI.Projects.VoiceResponseBase", "azure.ai.projects.models.VoiceResponse": "Azure.AI.Projects.VoiceResponse", "azure.ai.projects.models.VoiceResponseAudio": "Azure.AI.Projects.VoiceResponseAudio", "azure.ai.projects.models.VoiceResponseAudioOutput": "Azure.AI.Projects.VoiceResponseAudioOutput", - "azure.ai.projects.models.VoiceServerVadTurnDetection": "Azure.AI.Projects.VoiceServerVadTurnDetection", - "azure.ai.projects.models.VoiceSystemMessageItem": "Azure.AI.Projects.VoiceSystemMessageItem", - "azure.ai.projects.models.VoiceSystemTool": "Azure.AI.Projects.VoiceSystemTool", - "azure.ai.projects.models.VoiceToolboxTool": "Azure.AI.Projects.VoiceToolboxTool", - "azure.ai.projects.models.VoiceUserMessageItem": "Azure.AI.Projects.VoiceUserMessageItem", "azure.ai.projects.models.WebIQPreviewTool": "Azure.AI.Projects.WebIQPreviewTool", "azure.ai.projects.models.WebIQPreviewToolboxTool": "Azure.AI.Projects.WebIQPreviewToolboxTool", "azure.ai.projects.models.WebSearchApproximateLocation": "OpenAI.WebSearchApproximateLocation", @@ -538,6 +552,24 @@ "azure.ai.projects.models.WorkflowAgentDefinition": "Azure.AI.Projects.WorkflowAgentDefinition", "azure.ai.projects.models.WorkIQPreviewTool": "Azure.AI.Projects.WorkIQPreviewTool", "azure.ai.projects.models.WorkIQPreviewToolboxTool": "Azure.AI.Projects.WorkIQPreviewToolboxTool", + "azure.ai.projects.models.VoiceAgentWebSocketSubprotocol": "Azure.AI.Projects.VoiceAgentWebSocketSubprotocol", + "azure.ai.projects.models._AgentDefinitionOptInKeys": "Azure.AI.Projects.AgentDefinitionOptInKeys", + "azure.ai.projects.models.VoiceConversationStatus": "Azure.AI.Projects.VoiceConversationStatus", + "azure.ai.projects.models.PageOrder": "Azure.AI.Projects.PageOrder", + "azure.ai.projects.models.RealtimeConversationItemType": "OpenAI.RealtimeConversationItemType", + "azure.ai.projects.models.RealtimeMcpErrorType": "OpenAI.RealtimeMcpErrorType", + "azure.ai.projects.models.VoiceType": "Azure.AI.Projects.VoiceType", + "azure.ai.projects.models.RealtimeAudioFormatsType": "OpenAI.RealtimeAudioFormatsType", + "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.AgentInsightOverviewSource": "Azure.AI.Projects.AgentInsightOverviewSource", + "azure.ai.projects.models.JobStatus": "Azure.AI.Projects.JobStatus", + "azure.ai.projects.models.AgentInsightRunTrigger": "Azure.AI.Projects.AgentInsightRunTrigger", + "azure.ai.projects.models.AgentInsightSeverity": "Azure.AI.Projects.AgentInsightSeverity", + "azure.ai.projects.models.AgentInsightStatus": "Azure.AI.Projects.AgentInsightStatus", + "azure.ai.projects.models.AgentInsightProposedFixKind": "Azure.AI.Projects.AgentInsightProposedFixKind", + "azure.ai.projects.models.AgentInsightPromptSurface": "Azure.AI.Projects.AgentInsightPromptSurface", "azure.ai.projects.models.EvaluationTaxonomyInputType": "Azure.AI.Projects.EvaluationTaxonomyInputType", "azure.ai.projects.models.ToolType": "OpenAI.ToolType", "azure.ai.projects.models.A2AProtocolVersion": "Azure.AI.Projects.A2AProtocolVersion", @@ -567,11 +599,9 @@ "azure.ai.projects.models.GenerationWarningType": "Azure.AI.Projects.GenerationWarningType", "azure.ai.projects.models.PendingUploadType": "Azure.AI.Projects.PendingUploadType", "azure.ai.projects.models.EvaluatorGenerationJobSourceType": "Azure.AI.Projects.EvaluatorGenerationJobSourceType", - "azure.ai.projects.models.JobStatus": "Azure.AI.Projects.JobStatus", "azure.ai.projects.models.RubricGenerationInputQualityWarningCode": "Azure.AI.Projects.RubricGenerationInputQualityWarningCode", "azure.ai.projects.models.RubricGenerationInputQualityWarningSeverity": "Azure.AI.Projects.RubricGenerationInputQualityWarningSeverity", "azure.ai.projects.models.RubricGenerationInputQualityWarningSource": "Azure.AI.Projects.RubricGenerationInputQualityWarningSource", - "azure.ai.projects.models.PageOrder": "Azure.AI.Projects.PageOrder", "azure.ai.projects.models.OperationState": "Azure.Core.Foundations.OperationState", "azure.ai.projects.models.InsightType": "Azure.AI.Projects.InsightType", "azure.ai.projects.models.SampleType": "Azure.AI.Projects.SampleType", @@ -589,6 +619,7 @@ "azure.ai.projects.models.RoutineTriggerType": "Azure.AI.Projects.RoutineTriggerType", "azure.ai.projects.models.GitHubIssueEvent": "Azure.AI.Projects.GitHubIssueEvent", "azure.ai.projects.models.RoutineActionType": "Azure.AI.Projects.RoutineActionType", + "azure.ai.projects.models.RoutineDispatchIdentity": "Azure.AI.Projects.RoutineDispatchIdentity", "azure.ai.projects.models.RoutineRunPhase": "Azure.AI.Projects.RoutineRunPhase", "azure.ai.projects.models.RoutineAttemptSource": "Azure.AI.Projects.RoutineAttemptSource", "azure.ai.projects.models.RoutineDispatchPayloadType": "Azure.AI.Projects.RoutineDispatchPayloadType", @@ -618,40 +649,32 @@ "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.VoiceAudioFormatType": "Azure.AI.Projects.VoiceAudioFormatType", - "azure.ai.projects.models.VoiceNoiseReductionType": "Azure.AI.Projects.VoiceNoiseReductionType", - "azure.ai.projects.models.VoiceTurnDetectionType": "Azure.AI.Projects.VoiceTurnDetectionType", - "azure.ai.projects.models.VoiceEndOfUtteranceDetectionModel": "Azure.AI.Projects.VoiceEndOfUtteranceDetectionModel", - "azure.ai.projects.models.VoiceEndOfUtteranceThresholdLevel": "Azure.AI.Projects.VoiceEndOfUtteranceThresholdLevel", + "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.VoiceInputTranscriptionModel": "Azure.AI.Projects.VoiceInputTranscriptionModel", - "azure.ai.projects.models.VoiceType": "Azure.AI.Projects.VoiceType", - "azure.ai.projects.models.VoiceAudioTimestampType": "Azure.AI.Projects.VoiceAudioTimestampType", + "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.VoiceAvatarType": "Azure.AI.Projects.VoiceAvatarType", - "azure.ai.projects.models.VoiceAvatarOutputProtocol": "Azure.AI.Projects.VoiceAvatarOutputProtocol", + "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.VoiceSystemToolName": "Azure.AI.Projects.VoiceSystemToolName", + "azure.ai.projects.models.VoiceAgentSystemToolName": "Azure.AI.Projects.VoiceAgentSystemToolName", "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", "azure.ai.projects.models.VersionSelectorType": "Azure.AI.Projects.VersionSelectorType", + "azure.ai.projects.models.ActivityProtocolAccessBoundary": "Azure.AI.Projects.ActivityProtocolAccessBoundary", "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.VersionIndicatorType": "Azure.AI.Projects.VersionIndicatorType", "azure.ai.projects.models.AgentSessionStatus": "Azure.AI.Projects.AgentSessionStatus", "azure.ai.projects.models.SessionLogEventType": "Azure.AI.Projects.SessionLogEventType", - "azure.ai.projects.models.VoiceAgentWebSocketSubprotocol": "Azure.AI.Projects.VoiceAgentWebSocketSubprotocol", - "azure.ai.projects.models._AgentDefinitionOptInKeys": "Azure.AI.Projects.AgentDefinitionOptInKeys", - "azure.ai.projects.models.VoiceConversationStatus": "Azure.AI.Projects.VoiceConversationStatus", - "azure.ai.projects.models.RealtimeConversationItemMessageType": "OpenAI.RealtimeConversationItemMessageType", - "azure.ai.projects.models.RealtimeConversationItemType": "OpenAI.RealtimeConversationItemType", - "azure.ai.projects.models.RealtimeMcpErrorType": "OpenAI.RealtimeMcpErrorType", - "azure.ai.projects.models.RealtimeAudioFormatsType": "OpenAI.RealtimeAudioFormatsType", - "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.Microsoft365PublishScope": "Azure.AI.Projects.Microsoft365PublishScope", "azure.ai.projects.models.EvaluationRuleActionType": "Azure.AI.Projects.EvaluationRuleActionType", "azure.ai.projects.models.EvaluationRuleEventType": "Azure.AI.Projects.EvaluationRuleEventType", "azure.ai.projects.models.ConnectionType": "Azure.AI.Projects.ConnectionType", @@ -661,10 +684,10 @@ "azure.ai.projects.models.IndexType": "Azure.AI.Projects.IndexType", "azure.ai.projects.models.ToolboxToolType": "Azure.AI.Projects.ToolboxToolType", "azure.ai.projects.models.MemoryStoreUpdateStatus": "Azure.AI.Projects.MemoryStoreUpdateStatus", + "azure.ai.projects.models.VoiceAgentAnimationOutputType": "Azure.AI.Projects.VoiceAgentAnimationOutputType", + "azure.ai.projects.models.RealtimeReasoningEffort": "OpenAI.RealtimeReasoningEffort", "azure.ai.projects.models.RealtimeClientEventType": "OpenAI.RealtimeClientEventType", "azure.ai.projects.models.ToolChoiceOptions": "OpenAI.ToolChoiceOptions", - "azure.ai.projects.models.RealtimeReasoningEffort": "OpenAI.RealtimeReasoningEffort", - "azure.ai.projects.models.VoiceAgentAnimationOutputType": "Azure.AI.Projects.VoiceAgentAnimationOutputType", "azure.ai.projects.models.RealtimeServerEventType": "OpenAI.RealtimeServerEventType", "azure.ai.projects.models.CreateTranscriptionResponseJsonUsageType": "OpenAI.CreateTranscriptionResponseJsonUsageType", "azure.ai.projects.operations.AgentsOperations.get": "Azure.AI.Projects.Agents.getAgent", @@ -705,6 +728,12 @@ "azure.ai.projects.aio.operations.AgentsOperations.list_sessions": "Azure.AI.Projects.Agents.listSessions", "azure.ai.projects.operations.AgentsOperations.get_session_log_stream": "Azure.AI.Projects.Agents.getSessionLogStream", "azure.ai.projects.aio.operations.AgentsOperations.get_session_log_stream": "Azure.AI.Projects.Agents.getSessionLogStream", + "azure.ai.projects.operations.AgentsOperations.publish_to_microsoft365": "Azure.AI.Projects.Microsoft365Publishing.publishAgentToMicrosoft365", + "azure.ai.projects.aio.operations.AgentsOperations.publish_to_microsoft365": "Azure.AI.Projects.Microsoft365Publishing.publishAgentToMicrosoft365", + "azure.ai.projects.operations.AgentsOperations.get_microsoft365_package": "Azure.AI.Projects.Microsoft365Publishing.getMicrosoft365AppPackage", + "azure.ai.projects.aio.operations.AgentsOperations.get_microsoft365_package": "Azure.AI.Projects.Microsoft365Publishing.getMicrosoft365AppPackage", + "azure.ai.projects.operations.AgentsOperations.get_microsoft365_publish_defaults": "Azure.AI.Projects.Microsoft365Publishing.getMicrosoft365PublishDefaults", + "azure.ai.projects.aio.operations.AgentsOperations.get_microsoft365_publish_defaults": "Azure.AI.Projects.Microsoft365Publishing.getMicrosoft365PublishDefaults", "azure.ai.projects.operations.AgentsOperations.upload_session_file": "Azure.AI.Projects.AgentSessionFiles.uploadSessionFile", "azure.ai.projects.aio.operations.AgentsOperations.upload_session_file": "Azure.AI.Projects.AgentSessionFiles.uploadSessionFile", "azure.ai.projects.operations.AgentsOperations.download_session_file": "Azure.AI.Projects.AgentSessionFiles.downloadSessionFile", @@ -713,32 +742,6 @@ "azure.ai.projects.aio.operations.AgentsOperations.list_session_files": "Azure.AI.Projects.AgentSessionFiles.listSessionFiles", "azure.ai.projects.operations.AgentsOperations.delete_session_file": "Azure.AI.Projects.AgentSessionFiles.deleteSessionFile", "azure.ai.projects.aio.operations.AgentsOperations.delete_session_file": "Azure.AI.Projects.AgentSessionFiles.deleteSessionFile", - "azure.ai.projects.operations.VoiceAgentWebSocketOperations.connect_voice_agent": "Azure.AI.Projects.VoiceAgentWebSocket.connectVoiceAgent", - "azure.ai.projects.aio.operations.VoiceAgentWebSocketOperations.connect_voice_agent": "Azure.AI.Projects.VoiceAgentWebSocket.connectVoiceAgent", - "azure.ai.projects.operations.AgentEndpointConversationsOperations.list_agent_conversations": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversations", - "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.list_agent_conversations": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversations", - "azure.ai.projects.operations.AgentEndpointConversationsOperations.get_agent_conversation": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversation", - "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversation", - "azure.ai.projects.operations.AgentEndpointConversationsOperations.delete_agent_conversation": "Azure.AI.Projects.AgentEndpointConversations.deleteAgentConversation", - "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.delete_agent_conversation": "Azure.AI.Projects.AgentEndpointConversations.deleteAgentConversation", - "azure.ai.projects.operations.AgentEndpointConversationsOperations.list_agent_conversation_responses": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversationResponses", - "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.list_agent_conversation_responses": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversationResponses", - "azure.ai.projects.operations.AgentEndpointConversationsOperations.get_agent_conversation_response": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationResponse", - "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_response": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationResponse", - "azure.ai.projects.operations.AgentEndpointConversationsOperations.list_agent_conversation_response_items": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversationResponseItems", - "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.list_agent_conversation_response_items": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversationResponseItems", - "azure.ai.projects.operations.AgentEndpointConversationsOperations.list_agent_conversation_items": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversationItems", - "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.list_agent_conversation_items": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversationItems", - "azure.ai.projects.operations.AgentEndpointConversationsOperations.get_agent_conversation_item": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItem", - "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_item": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItem", - "azure.ai.projects.operations.AgentEndpointConversationsOperations.get_agent_conversation_item_audio": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItemAudio", - "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_item_audio": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItemAudio", - "azure.ai.projects.operations.AgentEndpointConversationsOperations.get_agent_conversation_item_audio_content": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItemAudioContent", - "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_item_audio_content": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItemAudioContent", - "azure.ai.projects.operations.AgentEndpointConversationsOperations.get_agent_conversation_audio": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationAudio", - "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_audio": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationAudio", - "azure.ai.projects.operations.AgentEndpointConversationsOperations.get_agent_conversation_audio_content": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationAudioContent", - "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_audio_content": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationAudioContent", "azure.ai.projects.operations.EvaluationRulesOperations.get": "Azure.AI.Projects.EvaluationRules.get", "azure.ai.projects.aio.operations.EvaluationRulesOperations.get": "Azure.AI.Projects.EvaluationRules.get", "azure.ai.projects.operations.EvaluationRulesOperations.delete": "Azure.AI.Projects.EvaluationRules.delete", @@ -794,5 +797,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": "0e6d765a5930" + "CrossLanguageVersion": "7e0039cfc367" } \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py index fbb310d5efda..7052e3b647c9 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py @@ -17,7 +17,6 @@ from ._configuration import AIProjectClientConfiguration from ._utils.serialization import Deserializer, Serializer from .operations import ( - AgentEndpointConversationsOperations, AgentsOperations, BetaOperations, ConnectionsOperations, @@ -44,9 +43,6 @@ class AIProjectClient: # pylint: disable=too-many-instance-attributes,docstring :vartype beta: azure.ai.projects.operations.BetaOperations :ivar agents: AgentsOperations operations :vartype agents: azure.ai.projects.operations.AgentsOperations - :ivar agent_endpoint_conversations: AgentEndpointConversationsOperations operations - :vartype agent_endpoint_conversations: - azure.ai.projects.operations.AgentEndpointConversationsOperations :ivar evaluation_rules: EvaluationRulesOperations operations :vartype evaluation_rules: azure.ai.projects.operations.EvaluationRulesOperations :ivar connections: ConnectionsOperations operations @@ -110,9 +106,6 @@ def __init__( self._serialize.client_side_validation = False self.beta = BetaOperations(self._client, self._config, self._serialize, self._deserialize) self.agents = AgentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.agent_endpoint_conversations = AgentEndpointConversationsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.evaluation_rules = EvaluationRulesOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py index 0aba5c4319fa..a1bcb82067e9 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py @@ -19,8 +19,6 @@ from azure.identity import get_bearer_token_provider from ._client import AIProjectClient as AIProjectClientGenerated from .operations import TelemetryOperations -from .operations._patch import _OperationMethodHeaderProxy -from .models._enums import _AgentDefinitionOptInKeys from .models._patch import _BETA_OPERATION_FEATURE_HEADERS, _FOUNDRY_FEATURES_HEADER_NAME, _has_header_case_insensitive from ._realtime import ( Realtime, @@ -250,15 +248,11 @@ def __init__( self.telemetry = TelemetryOperations(self) # type: ignore self._realtime: Optional[Realtime] = None - # Voice-agent conversation reads require the VoiceAgents=V1Preview opt-in header, which - # isn't part of the standard agent preview headers; inject it transparently. - # Guarded with hasattr since some tests mock out the generated __init__ entirely, in which - # case none of the generated operation-group attributes are set on `self`. - if hasattr(self, "agent_endpoint_conversations"): - self.agent_endpoint_conversations = _OperationMethodHeaderProxy( # type: ignore - self.agent_endpoint_conversations, - _AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.value, - ) + # NOTE: voice-agent conversation reads (`agent_endpoint_conversations`) used to require + # hand-wiring the VoiceAgents=V1Preview opt-in header here, since that sub-client used to + # live directly on `self`. It has since moved under `self.beta` upstream, so its header + # injection is now handled generically by `_BETA_OPERATION_FEATURE_HEADERS` in + # `operations/_patch.py`'s `BetaOperations.__init__` -- see that file. @property def realtime(self) -> Realtime: diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py index c724f3a7569d..4871bcf07bda 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py @@ -61,30 +61,29 @@ # Union of the client event models sendable over the connection, plus a raw mapping escape # hatch for forward compatibility with event types not yet represented in the generated models. ClientEvent = Union[ - _models.VoiceAgentClientEventConversationItemCreate, - _models.VoiceAgentClientEventConversationItemDelete, - _models.VoiceAgentClientEventConversationItemRetrieve, - _models.VoiceAgentClientEventConversationItemTruncate, - _models.VoiceAgentClientEventInputAudioBufferAppend, - _models.VoiceAgentClientEventInputAudioBufferClear, - _models.VoiceAgentClientEventInputAudioBufferCommit, - _models.VoiceAgentClientEventOutputAudioBufferClear, - _models.VoiceAgentClientEventResponseCancel, - _models.VoiceAgentClientEventResponseCreate, + _models.RealtimeClientEventConversationItemCreate, + _models.RealtimeClientEventConversationItemDelete, + _models.RealtimeClientEventConversationItemRetrieve, + _models.RealtimeClientEventConversationItemTruncate, + _models.RealtimeClientEventInputAudioBufferAppend, + _models.RealtimeClientEventInputAudioBufferClear, + _models.RealtimeClientEventInputAudioBufferCommit, + _models.RealtimeClientEventOutputAudioBufferClear, + _models.RealtimeClientEventResponseCancel, + _models.RealtimeClientEventResponseCreate, _models.VoiceAgentClientEventSessionAvatarConnect, _models.VoiceAgentClientEventSessionUpdate, str, Mapping[str, Any], ] -# The conversation item variants accepted by ``conversation.item.create``. +# The conversation item variants accepted by ``conversation.item.create``. Message-type items +# (system/user/assistant) no longer have dedicated generated models in this API version and +# must be passed as a raw mapping. ConversationItem = Union[ - _models.VoiceSystemMessageItem, - _models.VoiceUserMessageItem, - _models.VoiceAssistantMessageItem, - _models.VoiceFunctionCallItem, - _models.VoiceFunctionCallOutputItem, - _models.VoiceMcpApprovalResponseItem, + _models.RealtimeConversationItemFunctionCall, + _models.RealtimeConversationItemFunctionCallOutput, + _models.RealtimeMCPApprovalResponse, Mapping[str, Any], ] @@ -93,36 +92,36 @@ # generated model in this package (for example ``conversation.created``) are intentionally # left out here and fall back to a plain ``dict``, as do any newly-added service events. _SERVER_EVENT_TYPES: Dict[str, Type[_Model]] = { - "conversation.item.added": _models.VoiceAgentServerEventConversationItemAdded, - "conversation.item.created": _models.VoiceAgentServerEventConversationItemCreated, - "conversation.item.deleted": _models.VoiceAgentServerEventConversationItemDeleted, - "conversation.item.done": _models.VoiceAgentServerEventConversationItemDone, + "conversation.item.added": _models.RealtimeServerEventConversationItemAdded, + "conversation.item.created": _models.RealtimeServerEventConversationItemCreated, + "conversation.item.deleted": _models.RealtimeServerEventConversationItemDeleted, + "conversation.item.done": _models.RealtimeServerEventConversationItemDone, "conversation.item.input_audio_transcription.completed": ( - _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted + _models.RealtimeServerEventConversationItemInputAudioTranscriptionCompleted ), "conversation.item.input_audio_transcription.delta": ( - _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta + _models.RealtimeServerEventConversationItemInputAudioTranscriptionDelta ), "conversation.item.input_audio_transcription.failed": ( - _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed + _models.RealtimeServerEventConversationItemInputAudioTranscriptionFailed ), "conversation.item.input_audio_transcription.segment": ( - _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment + _models.RealtimeServerEventConversationItemInputAudioTranscriptionSegment ), - "conversation.item.retrieved": _models.VoiceAgentServerEventConversationItemRetrieved, - "conversation.item.truncated": _models.VoiceAgentServerEventConversationItemTruncated, + "conversation.item.retrieved": _models.RealtimeServerEventConversationItemRetrieved, + "conversation.item.truncated": _models.RealtimeServerEventConversationItemTruncated, # Shared OpenAI-style Realtime error event (not voice-agent specific in this package). "error": _models.RealtimeServerEventError, - "input_audio_buffer.cleared": _models.VoiceAgentServerEventInputAudioBufferCleared, - "input_audio_buffer.committed": _models.VoiceAgentServerEventInputAudioBufferCommitted, - "input_audio_buffer.speech_started": _models.VoiceAgentServerEventInputAudioBufferSpeechStarted, - "input_audio_buffer.speech_stopped": _models.VoiceAgentServerEventInputAudioBufferSpeechStopped, - "input_audio_buffer.timeout_triggered": (_models.VoiceAgentServerEventInputAudioBufferTimeoutTriggered), - "mcp_list_tools.completed": _models.VoiceAgentServerEventMcpListToolsCompleted, - "mcp_list_tools.failed": _models.VoiceAgentServerEventMcpListToolsFailed, - "mcp_list_tools.in_progress": _models.VoiceAgentServerEventMcpListToolsInProgress, - "output_audio_buffer.cleared": _models.VoiceAgentServerEventOutputAudioBufferCleared, - "rate_limits.updated": _models.VoiceAgentServerEventRateLimitsUpdated, + "input_audio_buffer.cleared": _models.RealtimeServerEventInputAudioBufferCleared, + "input_audio_buffer.committed": _models.RealtimeServerEventInputAudioBufferCommitted, + "input_audio_buffer.speech_started": _models.RealtimeServerEventInputAudioBufferSpeechStarted, + "input_audio_buffer.speech_stopped": _models.RealtimeServerEventInputAudioBufferSpeechStopped, + "input_audio_buffer.timeout_triggered": (_models.RealtimeServerEventInputAudioBufferTimeoutTriggered), + "mcp_list_tools.completed": _models.RealtimeServerEventMCPListToolsCompleted, + "mcp_list_tools.failed": _models.RealtimeServerEventMCPListToolsFailed, + "mcp_list_tools.in_progress": _models.RealtimeServerEventMCPListToolsInProgress, + "output_audio_buffer.cleared": _models.RealtimeServerEventOutputAudioBufferCleared, + "rate_limits.updated": _models.RealtimeServerEventRateLimitsUpdated, "response.animation_blendshapes.delta": (_models.VoiceAgentServerEventResponseAnimationBlendshapesDelta), "response.animation_blendshapes.done": (_models.VoiceAgentServerEventResponseAnimationBlendshapesDone), "response.animation_viseme.delta": _models.VoiceAgentServerEventResponseAnimationVisemeDelta, @@ -130,30 +129,30 @@ "response.audio_timestamp.delta": _models.VoiceAgentServerEventResponseAudioTimestampDelta, "response.audio_timestamp.done": _models.VoiceAgentServerEventResponseAudioTimestampDone, "response.content_part.added": _models.RealtimeServerEventResponseContentPartAdded, - "response.content_part.done": _models.VoiceAgentServerEventResponseContentPartDone, - "response.created": _models.VoiceAgentServerEventResponseCreated, - "response.done": _models.VoiceAgentServerEventResponseDone, - "response.function_call_arguments.delta": (_models.VoiceAgentServerEventResponseFunctionCallArgumentsDelta), - "response.function_call_arguments.done": (_models.VoiceAgentServerEventResponseFunctionCallArgumentsDone), - "response.mcp_call.completed": _models.VoiceAgentServerEventResponseMcpCallCompleted, - "response.mcp_call.failed": _models.VoiceAgentServerEventResponseMcpCallFailed, - "response.mcp_call.in_progress": _models.VoiceAgentServerEventResponseMcpCallInProgress, - "response.mcp_call_arguments.delta": _models.VoiceAgentServerEventResponseMcpCallArgumentsDelta, - "response.mcp_call_arguments.done": _models.VoiceAgentServerEventResponseMcpCallArgumentsDone, - "response.output_audio.delta": _models.VoiceAgentServerEventResponseAudioDelta, - "response.output_audio.done": _models.VoiceAgentServerEventResponseAudioDone, - "response.output_audio_transcript.delta": (_models.VoiceAgentServerEventResponseAudioTranscriptDelta), - "response.output_audio_transcript.done": (_models.VoiceAgentServerEventResponseAudioTranscriptDone), - "response.output_item.added": _models.VoiceAgentServerEventResponseOutputItemAdded, - "response.output_item.done": _models.VoiceAgentServerEventResponseOutputItemDone, - "response.output_text.delta": _models.VoiceAgentServerEventResponseTextDelta, - "response.output_text.done": _models.VoiceAgentServerEventResponseTextDone, + "response.content_part.done": _models.RealtimeServerEventResponseContentPartDone, + "response.created": _models.RealtimeServerEventResponseCreated, + "response.done": _models.RealtimeServerEventResponseDone, + "response.function_call_arguments.delta": (_models.RealtimeServerEventResponseFunctionCallArgumentsDelta), + "response.function_call_arguments.done": (_models.RealtimeServerEventResponseFunctionCallArgumentsDone), + "response.mcp_call.completed": _models.RealtimeServerEventResponseMCPCallCompleted, + "response.mcp_call.failed": _models.RealtimeServerEventResponseMCPCallFailed, + "response.mcp_call.in_progress": _models.RealtimeServerEventResponseMCPCallInProgress, + "response.mcp_call_arguments.delta": _models.RealtimeServerEventResponseMCPCallArgumentsDelta, + "response.mcp_call_arguments.done": _models.RealtimeServerEventResponseMCPCallArgumentsDone, + "response.output_audio.delta": _models.RealtimeServerEventResponseAudioDelta, + "response.output_audio.done": _models.RealtimeServerEventResponseAudioDone, + "response.output_audio_transcript.delta": (_models.RealtimeServerEventResponseAudioTranscriptDelta), + "response.output_audio_transcript.done": (_models.RealtimeServerEventResponseAudioTranscriptDone), + "response.output_item.added": _models.RealtimeServerEventResponseOutputItemAdded, + "response.output_item.done": _models.RealtimeServerEventResponseOutputItemDone, + "response.output_text.delta": _models.RealtimeServerEventResponseTextDelta, + "response.output_text.done": _models.RealtimeServerEventResponseTextDone, "response.video.delta": _models.VoiceAgentServerEventResponseVideoDelta, "session.avatar.connecting": _models.VoiceAgentServerEventSessionAvatarConnecting, "session.avatar.switch_to_idle": _models.VoiceAgentServerEventSessionAvatarSwitchToIdle, "session.avatar.switch_to_speaking": _models.VoiceAgentServerEventSessionAvatarSwitchToSpeaking, - "session.created": _models.VoiceAgentServerEventSessionCreated, - "session.updated": _models.VoiceAgentServerEventSessionUpdated, + "session.created": _models.RealtimeServerEventSessionCreated, + "session.updated": _models.RealtimeServerEventSessionUpdated, "warning": _models.VoiceAgentServerEventWarning, } @@ -161,56 +160,56 @@ ServerEvent = Union[ _models.RealtimeServerEventError, _models.RealtimeServerEventResponseContentPartAdded, - _models.VoiceAgentServerEventConversationItemAdded, - _models.VoiceAgentServerEventConversationItemCreated, - _models.VoiceAgentServerEventConversationItemDeleted, - _models.VoiceAgentServerEventConversationItemDone, - _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted, - _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta, - _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed, - _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment, - _models.VoiceAgentServerEventConversationItemRetrieved, - _models.VoiceAgentServerEventConversationItemTruncated, - _models.VoiceAgentServerEventInputAudioBufferCleared, - _models.VoiceAgentServerEventInputAudioBufferCommitted, - _models.VoiceAgentServerEventInputAudioBufferSpeechStarted, - _models.VoiceAgentServerEventInputAudioBufferSpeechStopped, - _models.VoiceAgentServerEventInputAudioBufferTimeoutTriggered, - _models.VoiceAgentServerEventMcpListToolsCompleted, - _models.VoiceAgentServerEventMcpListToolsFailed, - _models.VoiceAgentServerEventMcpListToolsInProgress, - _models.VoiceAgentServerEventOutputAudioBufferCleared, - _models.VoiceAgentServerEventRateLimitsUpdated, + _models.RealtimeServerEventConversationItemAdded, + _models.RealtimeServerEventConversationItemCreated, + _models.RealtimeServerEventConversationItemDeleted, + _models.RealtimeServerEventConversationItemDone, + _models.RealtimeServerEventConversationItemInputAudioTranscriptionCompleted, + _models.RealtimeServerEventConversationItemInputAudioTranscriptionDelta, + _models.RealtimeServerEventConversationItemInputAudioTranscriptionFailed, + _models.RealtimeServerEventConversationItemInputAudioTranscriptionSegment, + _models.RealtimeServerEventConversationItemRetrieved, + _models.RealtimeServerEventConversationItemTruncated, + _models.RealtimeServerEventInputAudioBufferCleared, + _models.RealtimeServerEventInputAudioBufferCommitted, + _models.RealtimeServerEventInputAudioBufferSpeechStarted, + _models.RealtimeServerEventInputAudioBufferSpeechStopped, + _models.RealtimeServerEventInputAudioBufferTimeoutTriggered, + _models.RealtimeServerEventMCPListToolsCompleted, + _models.RealtimeServerEventMCPListToolsFailed, + _models.RealtimeServerEventMCPListToolsInProgress, + _models.RealtimeServerEventOutputAudioBufferCleared, + _models.RealtimeServerEventRateLimitsUpdated, _models.VoiceAgentServerEventResponseAnimationBlendshapesDelta, _models.VoiceAgentServerEventResponseAnimationBlendshapesDone, _models.VoiceAgentServerEventResponseAnimationVisemeDelta, _models.VoiceAgentServerEventResponseAnimationVisemeDone, - _models.VoiceAgentServerEventResponseAudioDelta, - _models.VoiceAgentServerEventResponseAudioDone, + _models.RealtimeServerEventResponseAudioDelta, + _models.RealtimeServerEventResponseAudioDone, _models.VoiceAgentServerEventResponseAudioTimestampDelta, _models.VoiceAgentServerEventResponseAudioTimestampDone, - _models.VoiceAgentServerEventResponseAudioTranscriptDelta, - _models.VoiceAgentServerEventResponseAudioTranscriptDone, - _models.VoiceAgentServerEventResponseContentPartDone, - _models.VoiceAgentServerEventResponseCreated, - _models.VoiceAgentServerEventResponseDone, - _models.VoiceAgentServerEventResponseFunctionCallArgumentsDelta, - _models.VoiceAgentServerEventResponseFunctionCallArgumentsDone, - _models.VoiceAgentServerEventResponseMcpCallArgumentsDelta, - _models.VoiceAgentServerEventResponseMcpCallArgumentsDone, - _models.VoiceAgentServerEventResponseMcpCallCompleted, - _models.VoiceAgentServerEventResponseMcpCallFailed, - _models.VoiceAgentServerEventResponseMcpCallInProgress, - _models.VoiceAgentServerEventResponseOutputItemAdded, - _models.VoiceAgentServerEventResponseOutputItemDone, - _models.VoiceAgentServerEventResponseTextDelta, - _models.VoiceAgentServerEventResponseTextDone, + _models.RealtimeServerEventResponseAudioTranscriptDelta, + _models.RealtimeServerEventResponseAudioTranscriptDone, + _models.RealtimeServerEventResponseContentPartDone, + _models.RealtimeServerEventResponseCreated, + _models.RealtimeServerEventResponseDone, + _models.RealtimeServerEventResponseFunctionCallArgumentsDelta, + _models.RealtimeServerEventResponseFunctionCallArgumentsDone, + _models.RealtimeServerEventResponseMCPCallArgumentsDelta, + _models.RealtimeServerEventResponseMCPCallArgumentsDone, + _models.RealtimeServerEventResponseMCPCallCompleted, + _models.RealtimeServerEventResponseMCPCallFailed, + _models.RealtimeServerEventResponseMCPCallInProgress, + _models.RealtimeServerEventResponseOutputItemAdded, + _models.RealtimeServerEventResponseOutputItemDone, + _models.RealtimeServerEventResponseTextDelta, + _models.RealtimeServerEventResponseTextDone, _models.VoiceAgentServerEventResponseVideoDelta, _models.VoiceAgentServerEventSessionAvatarConnecting, _models.VoiceAgentServerEventSessionAvatarSwitchToIdle, _models.VoiceAgentServerEventSessionAvatarSwitchToSpeaking, - _models.VoiceAgentServerEventSessionCreated, - _models.VoiceAgentServerEventSessionUpdated, + _models.RealtimeServerEventSessionCreated, + _models.RealtimeServerEventSessionUpdated, _models.VoiceAgentServerEventWarning, Mapping[str, Any], ] @@ -319,8 +318,7 @@ def append(self, *, audio: Union[str, bytes], event_id: Optional[str] = None) -> if isinstance(audio, (bytes, bytearray)): audio = base64.b64encode(bytes(audio)).decode("ascii") self._send( - _models.VoiceAgentClientEventInputAudioBufferAppend( - type=_models.RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND, + _models.RealtimeClientEventInputAudioBufferAppend( audio=audio, event_id=event_id, ) @@ -332,11 +330,7 @@ def commit(self, *, event_id: Optional[str] = None) -> None: :keyword event_id: Optional client-generated ID used to identify this event. :paramtype event_id: str or None """ - self._send( - _models.VoiceAgentClientEventInputAudioBufferCommit( - type=_models.RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT, event_id=event_id - ) - ) + self._send(_models.RealtimeClientEventInputAudioBufferCommit(event_id=event_id)) def clear(self, *, event_id: Optional[str] = None) -> None: """Discard any buffered input audio. @@ -344,11 +338,7 @@ def clear(self, *, event_id: Optional[str] = None) -> None: :keyword event_id: Optional client-generated ID used to identify this event. :paramtype event_id: str or None """ - self._send( - _models.VoiceAgentClientEventInputAudioBufferClear( - type=_models.RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR, event_id=event_id - ) - ) + self._send(_models.RealtimeClientEventInputAudioBufferClear(event_id=event_id)) class OutputAudioBufferResource(_BaseResource): # pylint: disable=too-few-public-methods @@ -360,11 +350,7 @@ def clear(self, *, event_id: Optional[str] = None) -> None: :keyword event_id: Optional client-generated ID used to identify this event. :paramtype event_id: str or None """ - self._send( - _models.VoiceAgentClientEventOutputAudioBufferClear( - type=_models.RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR, event_id=event_id - ) - ) + self._send(_models.RealtimeClientEventOutputAudioBufferClear(event_id=event_id)) class ConversationItemResource(_BaseResource): @@ -380,12 +366,9 @@ def create( """Insert an item into the conversation. :keyword item: The conversation item to create. - :paramtype item: ~azure.ai.projects.models.VoiceSystemMessageItem or - ~azure.ai.projects.models.VoiceUserMessageItem or - ~azure.ai.projects.models.VoiceAssistantMessageItem or - ~azure.ai.projects.models.VoiceFunctionCallItem or - ~azure.ai.projects.models.VoiceFunctionCallOutputItem or - ~azure.ai.projects.models.VoiceMcpApprovalResponseItem or Mapping[str, Any] + :paramtype item: ~azure.ai.projects.models.RealtimeConversationItemFunctionCall or + ~azure.ai.projects.models.RealtimeConversationItemFunctionCallOutput or + ~azure.ai.projects.models.RealtimeMCPApprovalResponse or Mapping[str, Any] :keyword previous_item_id: The ID of the preceding item after which the new item will be inserted. Default value is None. :paramtype previous_item_id: str or None @@ -393,8 +376,7 @@ def create( :paramtype event_id: str or None """ self._send( - cast(Any, _models.VoiceAgentClientEventConversationItemCreate)( - type=_models.RealtimeClientEventType.CONVERSATION_ITEM_CREATE, + cast(Any, _models.RealtimeClientEventConversationItemCreate)( item=item, previous_item_id=previous_item_id, event_id=event_id, @@ -409,8 +391,7 @@ def delete(self, *, item_id: str, event_id: Optional[str] = None) -> None: :paramtype event_id: str or None """ self._send( - _models.VoiceAgentClientEventConversationItemDelete( - type=_models.RealtimeClientEventType.CONVERSATION_ITEM_DELETE, + _models.RealtimeClientEventConversationItemDelete( item_id=item_id, event_id=event_id, ) @@ -424,8 +405,7 @@ def retrieve(self, *, item_id: str, event_id: Optional[str] = None) -> None: :paramtype event_id: str or None """ self._send( - _models.VoiceAgentClientEventConversationItemRetrieve( - type=_models.RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE, + _models.RealtimeClientEventConversationItemRetrieve( item_id=item_id, event_id=event_id, ) @@ -441,8 +421,7 @@ def truncate(self, *, item_id: str, content_index: int, audio_end_ms: int, event :paramtype event_id: str or None """ self._send( - _models.VoiceAgentClientEventConversationItemTruncate( - type=_models.RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE, + _models.RealtimeClientEventConversationItemTruncate( item_id=item_id, content_index=content_index, audio_end_ms=audio_end_ms, @@ -477,8 +456,7 @@ def create( :paramtype event_id: str or None """ self._send( - cast(Any, _models.VoiceAgentClientEventResponseCreate)( - type=_models.RealtimeClientEventType.RESPONSE_CREATE, + cast(Any, _models.RealtimeClientEventResponseCreate)( response=response, event_id=event_id, ) @@ -494,8 +472,7 @@ def cancel(self, *, response_id: Optional[str] = None, event_id: Optional[str] = :paramtype event_id: str or None """ self._send( - _models.VoiceAgentClientEventResponseCancel( - type=_models.RealtimeClientEventType.RESPONSE_CANCEL, + _models.RealtimeClientEventResponseCancel( response_id=response_id, event_id=event_id, ) 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 c58f9a73aea9..729a849b7653 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_unions.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_unions.py @@ -15,26 +15,7 @@ VoiceAgentToolChoice = Union[ Literal["none"], Literal["auto"], Literal["required"], "_models.ToolChoiceFunction", "_models.ToolChoiceMCP" ] -VoiceAgentTurnDetection = Union[ - "_models.VoiceServerVadTurnDetection", - "_models.VoiceAgentSemanticVadTurnDetection", - "_models.VoiceAzureSemanticVadTurnDetection", - "_models.VoiceAzureSemanticVadEnTurnDetection", - "_models.VoiceAzureSemanticVadMultilingualTurnDetection", -] VoiceAgentMaxOutputTokens = Union[int, Literal["inf"]] -VoiceAgentInterimResponse = Union[ - "_models.VoiceAgentStaticInterimResponseConfig", "_models.VoiceAgentLlmInterimResponseConfig" -] -VoiceConversationItem = Union[ - "_models.VoiceSystemMessageItem", - "_models.VoiceUserMessageItem", - "_models.VoiceAssistantMessageItem", - "_models.VoiceFunctionCallItem", - "_models.VoiceFunctionCallOutputItem", - "_models.VoiceMcpListToolsItem", - "_models.VoiceMcpCallItem", - "_models.VoiceMcpApprovalRequestItem", - "_models.VoiceMcpApprovalResponseItem", -] +VoiceAgentSessionUpdate = "_models.VoiceAgentSessionUpdateConfig" +VoiceAgentSessionResponse = "_models.VoiceAgentSessionResponseConfig" GenerateAgentRequest = "_models.GenerateVoiceAgentRequest" diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py index 7fc3b32df9ab..dd68e26b6d8a 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py @@ -17,7 +17,6 @@ from .._utils.serialization import Deserializer, Serializer from ._configuration import AIProjectClientConfiguration from .operations import ( - AgentEndpointConversationsOperations, AgentsOperations, BetaOperations, ConnectionsOperations, @@ -44,9 +43,6 @@ class AIProjectClient: # pylint: disable=too-many-instance-attributes,docstring :vartype beta: azure.ai.projects.aio.operations.BetaOperations :ivar agents: AgentsOperations operations :vartype agents: azure.ai.projects.aio.operations.AgentsOperations - :ivar agent_endpoint_conversations: AgentEndpointConversationsOperations operations - :vartype agent_endpoint_conversations: - azure.ai.projects.aio.operations.AgentEndpointConversationsOperations :ivar evaluation_rules: EvaluationRulesOperations operations :vartype evaluation_rules: azure.ai.projects.aio.operations.EvaluationRulesOperations :ivar connections: ConnectionsOperations operations @@ -110,9 +106,6 @@ def __init__( self._serialize.client_side_validation = False self.beta = BetaOperations(self._client, self._config, self._serialize, self._deserialize) self.agents = AgentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.agent_endpoint_conversations = AgentEndpointConversationsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.evaluation_rules = EvaluationRulesOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py index 47a013cf43bf..32b6bc9c1e08 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py @@ -29,8 +29,7 @@ ) from ._client import AIProjectClient as AIProjectClientGenerated from .operations import TelemetryOperations -from ..operations._patch import _OperationMethodHeaderProxy, _method_accepts_keyword_headers -from ..models._enums import _AgentDefinitionOptInKeys +from ..operations._patch import _method_accepts_keyword_headers from ..models._patch import _has_header_case_insensitive from ._realtime import ( AsyncRealtime, @@ -181,24 +180,21 @@ def __init__( self.telemetry = TelemetryOperations(self) # type: ignore self._realtime: Optional[AsyncRealtime] = None - # Voice-agent conversation reads require the VoiceAgents=V1Preview opt-in header, which - # isn't part of the standard agent preview headers; inject it transparently. - # These attribute-presence checks are guarded with hasattr since some tests mock out the - # generated __init__ entirely, in which case none of the generated operation-group - # attributes are set on `self`. - if hasattr(self, "agent_endpoint_conversations"): - self.agent_endpoint_conversations = _OperationMethodHeaderProxy( # type: ignore - self.agent_endpoint_conversations, - _AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.value, - ) + # NOTE: voice-agent conversation reads (`agent_endpoint_conversations`) used to require + # hand-wiring the VoiceAgents=V1Preview opt-in header here, since that sub-client used to + # live directly on `self`. It has since moved under `self.beta` upstream, so its header + # injection is now handled generically by `_BETA_OPERATION_FEATURE_HEADERS` in + # `operations/_patch.py`'s `BetaOperations.__init__` -- see that file. # Work around a known async aiohttp transport issue (spurious UnicodeDecodeError caused by # compressed response bodies reaching text/JSON deserialization before decompression) by # disabling response compression for these two operation groups only. + # Guarded with hasattr since some tests mock out the generated __init__ entirely, in which + # case none of the generated operation-group attributes (including `beta` itself) are set. if hasattr(self, "agents"): self.agents = _AcceptEncodingIdentityProxy(self.agents) # type: ignore - if hasattr(self, "agent_endpoint_conversations"): - self.agent_endpoint_conversations = _AcceptEncodingIdentityProxy( # type: ignore - self.agent_endpoint_conversations + if hasattr(self, "beta") and hasattr(self.beta, "agent_endpoint_conversations"): + self.beta.agent_endpoint_conversations = _AcceptEncodingIdentityProxy( # type: ignore + self.beta.agent_endpoint_conversations ) @property diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py index c29c36eea144..fcd117e635a3 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py @@ -75,30 +75,29 @@ # Union of the client event models sendable over the connection, plus a raw mapping escape # hatch for forward compatibility with event types not yet represented in the generated models. ClientEvent = Union[ - _models.VoiceAgentClientEventConversationItemCreate, - _models.VoiceAgentClientEventConversationItemDelete, - _models.VoiceAgentClientEventConversationItemRetrieve, - _models.VoiceAgentClientEventConversationItemTruncate, - _models.VoiceAgentClientEventInputAudioBufferAppend, - _models.VoiceAgentClientEventInputAudioBufferClear, - _models.VoiceAgentClientEventInputAudioBufferCommit, - _models.VoiceAgentClientEventOutputAudioBufferClear, - _models.VoiceAgentClientEventResponseCancel, - _models.VoiceAgentClientEventResponseCreate, + _models.RealtimeClientEventConversationItemCreate, + _models.RealtimeClientEventConversationItemDelete, + _models.RealtimeClientEventConversationItemRetrieve, + _models.RealtimeClientEventConversationItemTruncate, + _models.RealtimeClientEventInputAudioBufferAppend, + _models.RealtimeClientEventInputAudioBufferClear, + _models.RealtimeClientEventInputAudioBufferCommit, + _models.RealtimeClientEventOutputAudioBufferClear, + _models.RealtimeClientEventResponseCancel, + _models.RealtimeClientEventResponseCreate, _models.VoiceAgentClientEventSessionAvatarConnect, _models.VoiceAgentClientEventSessionUpdate, str, Mapping[str, Any], ] -# The conversation item variants accepted by ``conversation.item.create``. +# The conversation item variants accepted by ``conversation.item.create``. Message-type items +# (system/user/assistant) no longer have dedicated generated models in this API version and +# must be passed as a raw mapping. ConversationItem = Union[ - _models.VoiceSystemMessageItem, - _models.VoiceUserMessageItem, - _models.VoiceAssistantMessageItem, - _models.VoiceFunctionCallItem, - _models.VoiceFunctionCallOutputItem, - _models.VoiceMcpApprovalResponseItem, + _models.RealtimeConversationItemFunctionCall, + _models.RealtimeConversationItemFunctionCallOutput, + _models.RealtimeMCPApprovalResponse, Mapping[str, Any], ] @@ -107,36 +106,36 @@ # generated model in this package (for example ``conversation.created``) are intentionally # left out here and fall back to a plain ``dict``, as do any newly-added service events. _SERVER_EVENT_TYPES: Dict[str, Type[_Model]] = { - "conversation.item.added": _models.VoiceAgentServerEventConversationItemAdded, - "conversation.item.created": _models.VoiceAgentServerEventConversationItemCreated, - "conversation.item.deleted": _models.VoiceAgentServerEventConversationItemDeleted, - "conversation.item.done": _models.VoiceAgentServerEventConversationItemDone, + "conversation.item.added": _models.RealtimeServerEventConversationItemAdded, + "conversation.item.created": _models.RealtimeServerEventConversationItemCreated, + "conversation.item.deleted": _models.RealtimeServerEventConversationItemDeleted, + "conversation.item.done": _models.RealtimeServerEventConversationItemDone, "conversation.item.input_audio_transcription.completed": ( - _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted + _models.RealtimeServerEventConversationItemInputAudioTranscriptionCompleted ), "conversation.item.input_audio_transcription.delta": ( - _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta + _models.RealtimeServerEventConversationItemInputAudioTranscriptionDelta ), "conversation.item.input_audio_transcription.failed": ( - _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed + _models.RealtimeServerEventConversationItemInputAudioTranscriptionFailed ), "conversation.item.input_audio_transcription.segment": ( - _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment + _models.RealtimeServerEventConversationItemInputAudioTranscriptionSegment ), - "conversation.item.retrieved": _models.VoiceAgentServerEventConversationItemRetrieved, - "conversation.item.truncated": _models.VoiceAgentServerEventConversationItemTruncated, + "conversation.item.retrieved": _models.RealtimeServerEventConversationItemRetrieved, + "conversation.item.truncated": _models.RealtimeServerEventConversationItemTruncated, # Shared OpenAI-style Realtime error event (not voice-agent specific in this package). "error": _models.RealtimeServerEventError, - "input_audio_buffer.cleared": _models.VoiceAgentServerEventInputAudioBufferCleared, - "input_audio_buffer.committed": _models.VoiceAgentServerEventInputAudioBufferCommitted, - "input_audio_buffer.speech_started": _models.VoiceAgentServerEventInputAudioBufferSpeechStarted, - "input_audio_buffer.speech_stopped": _models.VoiceAgentServerEventInputAudioBufferSpeechStopped, - "input_audio_buffer.timeout_triggered": (_models.VoiceAgentServerEventInputAudioBufferTimeoutTriggered), - "mcp_list_tools.completed": _models.VoiceAgentServerEventMcpListToolsCompleted, - "mcp_list_tools.failed": _models.VoiceAgentServerEventMcpListToolsFailed, - "mcp_list_tools.in_progress": _models.VoiceAgentServerEventMcpListToolsInProgress, - "output_audio_buffer.cleared": _models.VoiceAgentServerEventOutputAudioBufferCleared, - "rate_limits.updated": _models.VoiceAgentServerEventRateLimitsUpdated, + "input_audio_buffer.cleared": _models.RealtimeServerEventInputAudioBufferCleared, + "input_audio_buffer.committed": _models.RealtimeServerEventInputAudioBufferCommitted, + "input_audio_buffer.speech_started": _models.RealtimeServerEventInputAudioBufferSpeechStarted, + "input_audio_buffer.speech_stopped": _models.RealtimeServerEventInputAudioBufferSpeechStopped, + "input_audio_buffer.timeout_triggered": (_models.RealtimeServerEventInputAudioBufferTimeoutTriggered), + "mcp_list_tools.completed": _models.RealtimeServerEventMCPListToolsCompleted, + "mcp_list_tools.failed": _models.RealtimeServerEventMCPListToolsFailed, + "mcp_list_tools.in_progress": _models.RealtimeServerEventMCPListToolsInProgress, + "output_audio_buffer.cleared": _models.RealtimeServerEventOutputAudioBufferCleared, + "rate_limits.updated": _models.RealtimeServerEventRateLimitsUpdated, "response.animation_blendshapes.delta": (_models.VoiceAgentServerEventResponseAnimationBlendshapesDelta), "response.animation_blendshapes.done": (_models.VoiceAgentServerEventResponseAnimationBlendshapesDone), "response.animation_viseme.delta": _models.VoiceAgentServerEventResponseAnimationVisemeDelta, @@ -144,30 +143,30 @@ "response.audio_timestamp.delta": _models.VoiceAgentServerEventResponseAudioTimestampDelta, "response.audio_timestamp.done": _models.VoiceAgentServerEventResponseAudioTimestampDone, "response.content_part.added": _models.RealtimeServerEventResponseContentPartAdded, - "response.content_part.done": _models.VoiceAgentServerEventResponseContentPartDone, - "response.created": _models.VoiceAgentServerEventResponseCreated, - "response.done": _models.VoiceAgentServerEventResponseDone, - "response.function_call_arguments.delta": (_models.VoiceAgentServerEventResponseFunctionCallArgumentsDelta), - "response.function_call_arguments.done": (_models.VoiceAgentServerEventResponseFunctionCallArgumentsDone), - "response.mcp_call.completed": _models.VoiceAgentServerEventResponseMcpCallCompleted, - "response.mcp_call.failed": _models.VoiceAgentServerEventResponseMcpCallFailed, - "response.mcp_call.in_progress": _models.VoiceAgentServerEventResponseMcpCallInProgress, - "response.mcp_call_arguments.delta": _models.VoiceAgentServerEventResponseMcpCallArgumentsDelta, - "response.mcp_call_arguments.done": _models.VoiceAgentServerEventResponseMcpCallArgumentsDone, - "response.output_audio.delta": _models.VoiceAgentServerEventResponseAudioDelta, - "response.output_audio.done": _models.VoiceAgentServerEventResponseAudioDone, - "response.output_audio_transcript.delta": (_models.VoiceAgentServerEventResponseAudioTranscriptDelta), - "response.output_audio_transcript.done": (_models.VoiceAgentServerEventResponseAudioTranscriptDone), - "response.output_item.added": _models.VoiceAgentServerEventResponseOutputItemAdded, - "response.output_item.done": _models.VoiceAgentServerEventResponseOutputItemDone, - "response.output_text.delta": _models.VoiceAgentServerEventResponseTextDelta, - "response.output_text.done": _models.VoiceAgentServerEventResponseTextDone, + "response.content_part.done": _models.RealtimeServerEventResponseContentPartDone, + "response.created": _models.RealtimeServerEventResponseCreated, + "response.done": _models.RealtimeServerEventResponseDone, + "response.function_call_arguments.delta": (_models.RealtimeServerEventResponseFunctionCallArgumentsDelta), + "response.function_call_arguments.done": (_models.RealtimeServerEventResponseFunctionCallArgumentsDone), + "response.mcp_call.completed": _models.RealtimeServerEventResponseMCPCallCompleted, + "response.mcp_call.failed": _models.RealtimeServerEventResponseMCPCallFailed, + "response.mcp_call.in_progress": _models.RealtimeServerEventResponseMCPCallInProgress, + "response.mcp_call_arguments.delta": _models.RealtimeServerEventResponseMCPCallArgumentsDelta, + "response.mcp_call_arguments.done": _models.RealtimeServerEventResponseMCPCallArgumentsDone, + "response.output_audio.delta": _models.RealtimeServerEventResponseAudioDelta, + "response.output_audio.done": _models.RealtimeServerEventResponseAudioDone, + "response.output_audio_transcript.delta": (_models.RealtimeServerEventResponseAudioTranscriptDelta), + "response.output_audio_transcript.done": (_models.RealtimeServerEventResponseAudioTranscriptDone), + "response.output_item.added": _models.RealtimeServerEventResponseOutputItemAdded, + "response.output_item.done": _models.RealtimeServerEventResponseOutputItemDone, + "response.output_text.delta": _models.RealtimeServerEventResponseTextDelta, + "response.output_text.done": _models.RealtimeServerEventResponseTextDone, "response.video.delta": _models.VoiceAgentServerEventResponseVideoDelta, "session.avatar.connecting": _models.VoiceAgentServerEventSessionAvatarConnecting, "session.avatar.switch_to_idle": _models.VoiceAgentServerEventSessionAvatarSwitchToIdle, "session.avatar.switch_to_speaking": _models.VoiceAgentServerEventSessionAvatarSwitchToSpeaking, - "session.created": _models.VoiceAgentServerEventSessionCreated, - "session.updated": _models.VoiceAgentServerEventSessionUpdated, + "session.created": _models.RealtimeServerEventSessionCreated, + "session.updated": _models.RealtimeServerEventSessionUpdated, "warning": _models.VoiceAgentServerEventWarning, } @@ -175,56 +174,56 @@ ServerEvent = Union[ _models.RealtimeServerEventError, _models.RealtimeServerEventResponseContentPartAdded, - _models.VoiceAgentServerEventConversationItemAdded, - _models.VoiceAgentServerEventConversationItemCreated, - _models.VoiceAgentServerEventConversationItemDeleted, - _models.VoiceAgentServerEventConversationItemDone, - _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted, - _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta, - _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed, - _models.VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment, - _models.VoiceAgentServerEventConversationItemRetrieved, - _models.VoiceAgentServerEventConversationItemTruncated, - _models.VoiceAgentServerEventInputAudioBufferCleared, - _models.VoiceAgentServerEventInputAudioBufferCommitted, - _models.VoiceAgentServerEventInputAudioBufferSpeechStarted, - _models.VoiceAgentServerEventInputAudioBufferSpeechStopped, - _models.VoiceAgentServerEventInputAudioBufferTimeoutTriggered, - _models.VoiceAgentServerEventMcpListToolsCompleted, - _models.VoiceAgentServerEventMcpListToolsFailed, - _models.VoiceAgentServerEventMcpListToolsInProgress, - _models.VoiceAgentServerEventOutputAudioBufferCleared, - _models.VoiceAgentServerEventRateLimitsUpdated, + _models.RealtimeServerEventConversationItemAdded, + _models.RealtimeServerEventConversationItemCreated, + _models.RealtimeServerEventConversationItemDeleted, + _models.RealtimeServerEventConversationItemDone, + _models.RealtimeServerEventConversationItemInputAudioTranscriptionCompleted, + _models.RealtimeServerEventConversationItemInputAudioTranscriptionDelta, + _models.RealtimeServerEventConversationItemInputAudioTranscriptionFailed, + _models.RealtimeServerEventConversationItemInputAudioTranscriptionSegment, + _models.RealtimeServerEventConversationItemRetrieved, + _models.RealtimeServerEventConversationItemTruncated, + _models.RealtimeServerEventInputAudioBufferCleared, + _models.RealtimeServerEventInputAudioBufferCommitted, + _models.RealtimeServerEventInputAudioBufferSpeechStarted, + _models.RealtimeServerEventInputAudioBufferSpeechStopped, + _models.RealtimeServerEventInputAudioBufferTimeoutTriggered, + _models.RealtimeServerEventMCPListToolsCompleted, + _models.RealtimeServerEventMCPListToolsFailed, + _models.RealtimeServerEventMCPListToolsInProgress, + _models.RealtimeServerEventOutputAudioBufferCleared, + _models.RealtimeServerEventRateLimitsUpdated, _models.VoiceAgentServerEventResponseAnimationBlendshapesDelta, _models.VoiceAgentServerEventResponseAnimationBlendshapesDone, _models.VoiceAgentServerEventResponseAnimationVisemeDelta, _models.VoiceAgentServerEventResponseAnimationVisemeDone, - _models.VoiceAgentServerEventResponseAudioDelta, - _models.VoiceAgentServerEventResponseAudioDone, + _models.RealtimeServerEventResponseAudioDelta, + _models.RealtimeServerEventResponseAudioDone, _models.VoiceAgentServerEventResponseAudioTimestampDelta, _models.VoiceAgentServerEventResponseAudioTimestampDone, - _models.VoiceAgentServerEventResponseAudioTranscriptDelta, - _models.VoiceAgentServerEventResponseAudioTranscriptDone, - _models.VoiceAgentServerEventResponseContentPartDone, - _models.VoiceAgentServerEventResponseCreated, - _models.VoiceAgentServerEventResponseDone, - _models.VoiceAgentServerEventResponseFunctionCallArgumentsDelta, - _models.VoiceAgentServerEventResponseFunctionCallArgumentsDone, - _models.VoiceAgentServerEventResponseMcpCallArgumentsDelta, - _models.VoiceAgentServerEventResponseMcpCallArgumentsDone, - _models.VoiceAgentServerEventResponseMcpCallCompleted, - _models.VoiceAgentServerEventResponseMcpCallFailed, - _models.VoiceAgentServerEventResponseMcpCallInProgress, - _models.VoiceAgentServerEventResponseOutputItemAdded, - _models.VoiceAgentServerEventResponseOutputItemDone, - _models.VoiceAgentServerEventResponseTextDelta, - _models.VoiceAgentServerEventResponseTextDone, + _models.RealtimeServerEventResponseAudioTranscriptDelta, + _models.RealtimeServerEventResponseAudioTranscriptDone, + _models.RealtimeServerEventResponseContentPartDone, + _models.RealtimeServerEventResponseCreated, + _models.RealtimeServerEventResponseDone, + _models.RealtimeServerEventResponseFunctionCallArgumentsDelta, + _models.RealtimeServerEventResponseFunctionCallArgumentsDone, + _models.RealtimeServerEventResponseMCPCallArgumentsDelta, + _models.RealtimeServerEventResponseMCPCallArgumentsDone, + _models.RealtimeServerEventResponseMCPCallCompleted, + _models.RealtimeServerEventResponseMCPCallFailed, + _models.RealtimeServerEventResponseMCPCallInProgress, + _models.RealtimeServerEventResponseOutputItemAdded, + _models.RealtimeServerEventResponseOutputItemDone, + _models.RealtimeServerEventResponseTextDelta, + _models.RealtimeServerEventResponseTextDone, _models.VoiceAgentServerEventResponseVideoDelta, _models.VoiceAgentServerEventSessionAvatarConnecting, _models.VoiceAgentServerEventSessionAvatarSwitchToIdle, _models.VoiceAgentServerEventSessionAvatarSwitchToSpeaking, - _models.VoiceAgentServerEventSessionCreated, - _models.VoiceAgentServerEventSessionUpdated, + _models.RealtimeServerEventSessionCreated, + _models.RealtimeServerEventSessionUpdated, _models.VoiceAgentServerEventWarning, Mapping[str, Any], ] @@ -333,8 +332,7 @@ async def append(self, *, audio: Union[str, bytes], event_id: Optional[str] = No if isinstance(audio, (bytes, bytearray)): audio = base64.b64encode(bytes(audio)).decode("ascii") await self._send( - _models.VoiceAgentClientEventInputAudioBufferAppend( - type=_models.RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND, + _models.RealtimeClientEventInputAudioBufferAppend( audio=audio, event_id=event_id, ) @@ -346,11 +344,7 @@ async def commit(self, *, event_id: Optional[str] = None) -> None: :keyword event_id: Optional client-generated ID used to identify this event. :paramtype event_id: str or None """ - await self._send( - _models.VoiceAgentClientEventInputAudioBufferCommit( - type=_models.RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT, event_id=event_id - ) - ) + await self._send(_models.RealtimeClientEventInputAudioBufferCommit(event_id=event_id)) async def clear(self, *, event_id: Optional[str] = None) -> None: """Discard any buffered input audio. @@ -358,11 +352,7 @@ async def clear(self, *, event_id: Optional[str] = None) -> None: :keyword event_id: Optional client-generated ID used to identify this event. :paramtype event_id: str or None """ - await self._send( - _models.VoiceAgentClientEventInputAudioBufferClear( - type=_models.RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR, event_id=event_id - ) - ) + await self._send(_models.RealtimeClientEventInputAudioBufferClear(event_id=event_id)) class OutputAudioBufferResource(_BaseResource): # pylint: disable=too-few-public-methods @@ -374,11 +364,7 @@ async def clear(self, *, event_id: Optional[str] = None) -> None: :keyword event_id: Optional client-generated ID used to identify this event. :paramtype event_id: str or None """ - await self._send( - _models.VoiceAgentClientEventOutputAudioBufferClear( - type=_models.RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR, event_id=event_id - ) - ) + await self._send(_models.RealtimeClientEventOutputAudioBufferClear(event_id=event_id)) class ConversationItemResource(_BaseResource): @@ -394,12 +380,9 @@ async def create( """Insert an item into the conversation. :keyword item: The conversation item to create. - :paramtype item: ~azure.ai.projects.models.VoiceSystemMessageItem or - ~azure.ai.projects.models.VoiceUserMessageItem or - ~azure.ai.projects.models.VoiceAssistantMessageItem or - ~azure.ai.projects.models.VoiceFunctionCallItem or - ~azure.ai.projects.models.VoiceFunctionCallOutputItem or - ~azure.ai.projects.models.VoiceMcpApprovalResponseItem or Mapping[str, Any] + :paramtype item: ~azure.ai.projects.models.RealtimeConversationItemFunctionCall or + ~azure.ai.projects.models.RealtimeConversationItemFunctionCallOutput or + ~azure.ai.projects.models.RealtimeMCPApprovalResponse or Mapping[str, Any] :keyword previous_item_id: The ID of the preceding item after which the new item will be inserted. Default value is None. :paramtype previous_item_id: str or None @@ -407,8 +390,7 @@ async def create( :paramtype event_id: str or None """ await self._send( - cast(Any, _models.VoiceAgentClientEventConversationItemCreate)( - type=_models.RealtimeClientEventType.CONVERSATION_ITEM_CREATE, + cast(Any, _models.RealtimeClientEventConversationItemCreate)( item=item, previous_item_id=previous_item_id, event_id=event_id, @@ -423,8 +405,7 @@ async def delete(self, *, item_id: str, event_id: Optional[str] = None) -> None: :paramtype event_id: str or None """ await self._send( - _models.VoiceAgentClientEventConversationItemDelete( - type=_models.RealtimeClientEventType.CONVERSATION_ITEM_DELETE, + _models.RealtimeClientEventConversationItemDelete( item_id=item_id, event_id=event_id, ) @@ -438,8 +419,7 @@ async def retrieve(self, *, item_id: str, event_id: Optional[str] = None) -> Non :paramtype event_id: str or None """ await self._send( - _models.VoiceAgentClientEventConversationItemRetrieve( - type=_models.RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE, + _models.RealtimeClientEventConversationItemRetrieve( item_id=item_id, event_id=event_id, ) @@ -457,8 +437,7 @@ async def truncate( :paramtype event_id: str or None """ await self._send( - _models.VoiceAgentClientEventConversationItemTruncate( - type=_models.RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE, + _models.RealtimeClientEventConversationItemTruncate( item_id=item_id, content_index=content_index, audio_end_ms=audio_end_ms, @@ -493,8 +472,7 @@ async def create( :paramtype event_id: str or None """ await self._send( - cast(Any, _models.VoiceAgentClientEventResponseCreate)( - type=_models.RealtimeClientEventType.RESPONSE_CREATE, + cast(Any, _models.RealtimeClientEventResponseCreate)( response=response, event_id=event_id, ) @@ -510,8 +488,7 @@ async def cancel(self, *, response_id: Optional[str] = None, event_id: Optional[ :paramtype event_id: str or None """ await self._send( - _models.VoiceAgentClientEventResponseCancel( - type=_models.RealtimeClientEventType.RESPONSE_CANCEL, + _models.RealtimeClientEventResponseCancel( response_id=response_id, event_id=event_id, ) diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/__init__.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/__init__.py index fb5ec672ba20..d6cf67b4d8cf 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/__init__.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/__init__.py @@ -14,8 +14,6 @@ from ._operations import BetaOperations # type: ignore from ._operations import AgentsOperations # type: ignore -from ._operations import VoiceAgentWebSocketOperations # type: ignore -from ._operations import AgentEndpointConversationsOperations # type: ignore from ._operations import EvaluationRulesOperations # type: ignore from ._operations import ConnectionsOperations # type: ignore from ._operations import DatasetsOperations # type: ignore @@ -30,8 +28,6 @@ __all__ = [ "BetaOperations", "AgentsOperations", - "VoiceAgentWebSocketOperations", - "AgentEndpointConversationsOperations", "EvaluationRulesOperations", "ConnectionsOperations", "DatasetsOperations", 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 c732e40da317..f019050110f0 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 @@ -38,18 +38,6 @@ from ..._utils.utils import prepare_multipart_form_data from ...models._enums import _AgentDefinitionOptInKeys from ...operations._operations import ( - build_agent_endpoint_conversations_delete_agent_conversation_request, - build_agent_endpoint_conversations_get_agent_conversation_audio_content_request, - build_agent_endpoint_conversations_get_agent_conversation_audio_request, - build_agent_endpoint_conversations_get_agent_conversation_item_audio_content_request, - build_agent_endpoint_conversations_get_agent_conversation_item_audio_request, - build_agent_endpoint_conversations_get_agent_conversation_item_request, - build_agent_endpoint_conversations_get_agent_conversation_request, - build_agent_endpoint_conversations_get_agent_conversation_response_request, - build_agent_endpoint_conversations_list_agent_conversation_items_request, - build_agent_endpoint_conversations_list_agent_conversation_response_items_request, - build_agent_endpoint_conversations_list_agent_conversation_responses_request, - build_agent_endpoint_conversations_list_agent_conversations_request, build_agents_create_session_request, build_agents_create_version_from_code_request, build_agents_create_version_from_manifest_request, @@ -63,6 +51,8 @@ build_agents_download_session_file_request, build_agents_enable_request, build_agents_generate_agent_request, + build_agents_get_microsoft365_package_request, + build_agents_get_microsoft365_publish_defaults_request, build_agents_get_request, build_agents_get_session_log_stream_request, build_agents_get_session_request, @@ -71,9 +61,35 @@ build_agents_list_session_files_request, build_agents_list_sessions_request, build_agents_list_versions_request, + build_agents_publish_to_microsoft365_request, build_agents_stop_session_request, build_agents_update_details_request, build_agents_upload_session_file_request, + build_beta_agent_endpoint_conversations_delete_agent_conversation_request, + build_beta_agent_endpoint_conversations_get_agent_conversation_audio_content_request, + build_beta_agent_endpoint_conversations_get_agent_conversation_audio_request, + build_beta_agent_endpoint_conversations_get_agent_conversation_item_audio_content_request, + build_beta_agent_endpoint_conversations_get_agent_conversation_item_audio_request, + build_beta_agent_endpoint_conversations_get_agent_conversation_item_request, + build_beta_agent_endpoint_conversations_get_agent_conversation_request, + build_beta_agent_endpoint_conversations_get_agent_conversation_response_request, + build_beta_agent_endpoint_conversations_list_agent_conversation_items_request, + build_beta_agent_endpoint_conversations_list_agent_conversation_response_items_request, + build_beta_agent_endpoint_conversations_list_agent_conversation_responses_request, + build_beta_agent_endpoint_conversations_list_agent_conversations_request, + build_beta_agent_insight_monitors_cancel_run_request, + build_beta_agent_insight_monitors_create_request, + build_beta_agent_insight_monitors_create_run_request, + build_beta_agent_insight_monitors_delete_request, + build_beta_agent_insight_monitors_get_insight_request, + build_beta_agent_insight_monitors_get_request, + build_beta_agent_insight_monitors_get_run_request, + build_beta_agent_insight_monitors_list_insights_request, + build_beta_agent_insight_monitors_list_request, + build_beta_agent_insight_monitors_list_runs_request, + build_beta_agent_insight_monitors_reset_request, + build_beta_agent_insight_monitors_update_insight_request, + build_beta_agent_insight_monitors_update_request, build_beta_agents_cancel_optimization_job_request, build_beta_agents_create_optimization_job_request, build_beta_agents_delete_optimization_job_request, @@ -154,6 +170,7 @@ build_beta_skills_list_request, build_beta_skills_list_versions_request, build_beta_skills_update_request, + build_beta_voice_agent_web_socket_connect_voice_agent_request, build_connections_get_request, build_connections_get_with_credentials_request, build_connections_list_request, @@ -183,7 +200,6 @@ build_toolboxes_list_request, build_toolboxes_list_versions_request, build_toolboxes_update_request, - build_voice_agent_web_socket_connect_voice_agent_request, ) from .._configuration import AIProjectClientConfiguration @@ -213,6 +229,12 @@ def __init__(self, *args, **kwargs) -> None: 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") + self.agent_endpoint_conversations = BetaAgentEndpointConversationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.agent_insight_monitors = BetaAgentInsightMonitorsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.evaluation_taxonomies = BetaEvaluationTaxonomiesOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -570,6 +592,7 @@ async def create_version( metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, blueprint_reference: Optional[_models.AgentBlueprintReference] = None, + digital_worker_type: Optional[Union[str, _models.DigitalWorkerType]] = None, draft: Optional[bool] = None, **kwargs: Any ) -> _models.AgentVersionDetails: @@ -601,6 +624,9 @@ async def create_version( :paramtype description: str :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. :paramtype blueprint_reference: ~azure.ai.projects.models.AgentBlueprintReference + :keyword digital_worker_type: (Preview) The type of digital worker (previously known as + ``autopilot``). If omitted, it is not a digital worker. "m365" Default value is None. + :paramtype digital_worker_type: str or ~azure.ai.projects.models.DigitalWorkerType :keyword draft: (Preview) Whether this agent version is a draft (candidate) rather than a release. The service defaults to ``false`` if a value is not specified by the caller. Draft versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. @@ -671,6 +697,7 @@ async def create_version( metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, blueprint_reference: Optional[_models.AgentBlueprintReference] = None, + digital_worker_type: Optional[Union[str, _models.DigitalWorkerType]] = None, draft: Optional[bool] = None, **kwargs: Any ) -> _models.AgentVersionDetails: @@ -701,6 +728,9 @@ async def create_version( :paramtype description: str :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. :paramtype blueprint_reference: ~azure.ai.projects.models.AgentBlueprintReference + :keyword digital_worker_type: (Preview) The type of digital worker (previously known as + ``autopilot``). If omitted, it is not a digital worker. "m365" Default value is None. + :paramtype digital_worker_type: str or ~azure.ai.projects.models.DigitalWorkerType :keyword draft: (Preview) Whether this agent version is a draft (candidate) rather than a release. The service defaults to ``false`` if a value is not specified by the caller. Draft versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. @@ -731,6 +761,7 @@ async def create_version( "blueprint_reference": blueprint_reference, "definition": definition, "description": description, + "digital_worker_type": digital_worker_type, "draft": draft, "metadata": metadata, } @@ -2279,91 +2310,271 @@ async def get_session_log_stream( return deserialized # type: ignore @overload - async def upload_session_file( + async def publish_to_microsoft365( self, agent_name: str, - session_id: str, - content: bytes, *, - path: str, - content_type: str = "application/octet-stream", + publish_scope: Union[str, _models.Microsoft365PublishScope], + content_type: str = "application/json", + agent_display_name: Optional[str] = None, + bot_service_arm_id: Optional[str] = None, + publish_as_autopilot: Optional[bool] = None, + access_boundaries: Optional[List[Union[str, _models.ActivityProtocolAccessBoundary]]] = None, + optional_permission_scopes: Optional[List[_models.Microsoft365PermissionScopes]] = None, + can_respond_without_mention: Optional[bool] = None, + app_version: 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, + color_icon_base64: Optional[str] = None, + outline_icon_base64: Optional[str] = None, **kwargs: Any - ) -> _models.SessionFileWriteResult: - """Upload a session file. + ) -> _models.Microsoft365PublishResult: + """Publish an agent to Microsoft 365. - Uploads binary file content to the specified path in the session sandbox. The service stores - the file relative to the session home directory and rejects payloads larger than 50 MB. + Publishes a Foundry agent to Microsoft 365 / Microsoft Teams and returns the published title + and Teams app ids. - :param agent_name: The name of the agent. Required. + :param agent_name: The name of the agent to publish. Required. :type agent_name: str - :param session_id: The session ID. Required. - :type session_id: str - :param content: Required. - :type content: bytes - :keyword path: The destination file path within the sandbox, relative to the session home - directory. Required. - :paramtype path: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/octet-stream". + :keyword publish_scope: Publish scope for the Teams app. Known values are: "Personal", + "Shared", and "Tenant". Required. + :paramtype publish_scope: str or ~azure.ai.projects.models.Microsoft365PublishScope + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". :paramtype content_type: str - :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.SessionFileWriteResult + :keyword agent_display_name: Display name used as the published Teams app name. When omitted, + the agent name from the route is + used. Default value is None. + :paramtype agent_display_name: str + :keyword bot_service_arm_id: ARM resource id of the Azure Bot Service that fronts this agent in + Microsoft Teams. Required for + workspaces on the default bot-based Teams backend; optional for workspaces on the API-based + backend. + Must not be supplied when ``publishAsAutopilot`` is true. Default value is None. + :paramtype bot_service_arm_id: str + :keyword publish_as_autopilot: When true, the agent is published as an autopilot (digital + worker) agent: the bot id is taken from + the agent's blueprint identity and the generated Teams manifest is marked as a digital worker. + Default value is None. + :paramtype publish_as_autopilot: bool + :keyword access_boundaries: Activity-protocol access boundaries to apply to the agent when + publishing as an autopilot agent. + An empty list clears the existing boundaries. When omitted, the existing boundaries are left + unchanged. Default value is None. + :paramtype access_boundaries: list[str or + ~azure.ai.projects.models.ActivityProtocolAccessBoundary] + :keyword optional_permission_scopes: Exact selection of delegated permission scopes to grant to + the autopilot blueprint. May only be + supplied when ``publishAsAutopilot`` is true. When omitted or empty, the platform's default + permission set is used. Mandatory platform permissions are always granted and are not affected + by + this value. Default value is None. + :paramtype optional_permission_scopes: + list[~azure.ai.projects.models.Microsoft365PermissionScopes] + :keyword can_respond_without_mention: Controls how the published agent responds to Teams + messages: when true it responds to all messages + on its surfaces, when false only when it is at-mentioned. When omitted, the agent's existing + Teams + message-notification setting is left unchanged. Default value is None. + :paramtype can_respond_without_mention: bool + :keyword app_version: App version (for example ``1.2.3``) written into the Teams manifest. May + contain only digits and + periods, must not start with ``0``, and must end with a digit. When omitted, a platform + default is + used. Default value is None. + :paramtype app_version: str + :keyword short_description: Short, one-line description shown in the Teams app listing. Default + value is None. + :paramtype short_description: str + :keyword full_description: Full description shown on the Teams app details page. Default value + is None. + :paramtype full_description: str + :keyword developer_name: Display name of the developer / publisher shown in the Teams app + listing. Default value is None. + :paramtype developer_name: str + :keyword developer_website_url: Developer / publisher website URL shown in the Teams app + listing. Must be an https URL. Default value is None. + :paramtype developer_website_url: str + :keyword privacy_url: Privacy policy URL shown in the Teams app listing. Must be an http or + https URL. Default value is None. + :paramtype privacy_url: str + :keyword terms_of_use_url: Terms-of-use URL shown in the Teams app listing. Default value is + None. + :paramtype terms_of_use_url: str + :keyword color_icon_base64: Optional base64-encoded PNG used as the color (full-bleed) icon in + the Teams app package. Must be a + 192x192 PNG (perfect square, no border or rounded corners). Max 1 MB after decode. When + omitted, the + platform default color icon is used. Default value is None. + :paramtype color_icon_base64: str + :keyword outline_icon_base64: Optional base64-encoded PNG used as the outline icon in the Teams + app package. Must be a 32x32 PNG. + Max 1 MB after decode. When omitted, the platform default outline icon is used. Default value + is None. + :paramtype outline_icon_base64: str + :return: Microsoft365PublishResult. The Microsoft365PublishResult is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.Microsoft365PublishResult :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def upload_session_file( - self, - agent_name: str, - session_id: str, - content: IO[bytes], - *, - path: str, - content_type: str = "application/octet-stream", - **kwargs: Any - ) -> _models.SessionFileWriteResult: - """Upload a session file. + async def publish_to_microsoft365( + self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Microsoft365PublishResult: + """Publish an agent to Microsoft 365. - Uploads binary file content to the specified path in the session sandbox. The service stores - the file relative to the session home directory and rejects payloads larger than 50 MB. + Publishes a Foundry agent to Microsoft 365 / Microsoft Teams and returns the published title + and Teams app ids. - :param agent_name: The name of the agent. Required. + :param agent_name: The name of the agent to publish. Required. :type agent_name: str - :param session_id: The session ID. Required. - :type session_id: str - :param content: Required. - :type content: IO[bytes] - :keyword path: The destination file path within the sandbox, relative to the session home - directory. Required. - :paramtype path: str + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Microsoft365PublishResult. The Microsoft365PublishResult is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.Microsoft365PublishResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def publish_to_microsoft365( + self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Microsoft365PublishResult: + """Publish an agent to Microsoft 365. + + Publishes a Foundry agent to Microsoft 365 / Microsoft Teams and returns the published title + and Teams app ids. + + :param agent_name: The name of the agent to publish. Required. + :type agent_name: str + :param body: Required. + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/octet-stream". + Default value is "application/json". :paramtype content_type: str - :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.SessionFileWriteResult + :return: Microsoft365PublishResult. The Microsoft365PublishResult is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.Microsoft365PublishResult :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def upload_session_file( - self, agent_name: str, session_id: str, content: Union[bytes, IO[bytes]], *, path: str, **kwargs: Any - ) -> _models.SessionFileWriteResult: - """Upload a session file. + async def publish_to_microsoft365( # pylint: disable=too-many-locals + self, + agent_name: str, + body: Union[JSON, IO[bytes]] = _Unset, + *, + publish_scope: Union[str, _models.Microsoft365PublishScope] = _Unset, + agent_display_name: Optional[str] = None, + bot_service_arm_id: Optional[str] = None, + publish_as_autopilot: Optional[bool] = None, + access_boundaries: Optional[List[Union[str, _models.ActivityProtocolAccessBoundary]]] = None, + optional_permission_scopes: Optional[List[_models.Microsoft365PermissionScopes]] = None, + can_respond_without_mention: Optional[bool] = None, + app_version: 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, + color_icon_base64: Optional[str] = None, + outline_icon_base64: Optional[str] = None, + **kwargs: Any + ) -> _models.Microsoft365PublishResult: + """Publish an agent to Microsoft 365. - Uploads binary file content to the specified path in the session sandbox. The service stores - the file relative to the session home directory and rejects payloads larger than 50 MB. + Publishes a Foundry agent to Microsoft 365 / Microsoft Teams and returns the published title + and Teams app ids. - :param agent_name: The name of the agent. Required. + :param agent_name: The name of the agent to publish. Required. :type agent_name: str - :param session_id: The session ID. Required. - :type session_id: str - :param content: Is either a bytes type or a IO[bytes] type. Required. - :type content: bytes or IO[bytes] - :keyword path: The destination file path within the sandbox, relative to the session home - directory. Required. - :paramtype path: str - :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.SessionFileWriteResult + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword publish_scope: Publish scope for the Teams app. Known values are: "Personal", + "Shared", and "Tenant". Required. + :paramtype publish_scope: str or ~azure.ai.projects.models.Microsoft365PublishScope + :keyword agent_display_name: Display name used as the published Teams app name. When omitted, + the agent name from the route is + used. Default value is None. + :paramtype agent_display_name: str + :keyword bot_service_arm_id: ARM resource id of the Azure Bot Service that fronts this agent in + Microsoft Teams. Required for + workspaces on the default bot-based Teams backend; optional for workspaces on the API-based + backend. + Must not be supplied when ``publishAsAutopilot`` is true. Default value is None. + :paramtype bot_service_arm_id: str + :keyword publish_as_autopilot: When true, the agent is published as an autopilot (digital + worker) agent: the bot id is taken from + the agent's blueprint identity and the generated Teams manifest is marked as a digital worker. + Default value is None. + :paramtype publish_as_autopilot: bool + :keyword access_boundaries: Activity-protocol access boundaries to apply to the agent when + publishing as an autopilot agent. + An empty list clears the existing boundaries. When omitted, the existing boundaries are left + unchanged. Default value is None. + :paramtype access_boundaries: list[str or + ~azure.ai.projects.models.ActivityProtocolAccessBoundary] + :keyword optional_permission_scopes: Exact selection of delegated permission scopes to grant to + the autopilot blueprint. May only be + supplied when ``publishAsAutopilot`` is true. When omitted or empty, the platform's default + permission set is used. Mandatory platform permissions are always granted and are not affected + by + this value. Default value is None. + :paramtype optional_permission_scopes: + list[~azure.ai.projects.models.Microsoft365PermissionScopes] + :keyword can_respond_without_mention: Controls how the published agent responds to Teams + messages: when true it responds to all messages + on its surfaces, when false only when it is at-mentioned. When omitted, the agent's existing + Teams + message-notification setting is left unchanged. Default value is None. + :paramtype can_respond_without_mention: bool + :keyword app_version: App version (for example ``1.2.3``) written into the Teams manifest. May + contain only digits and + periods, must not start with ``0``, and must end with a digit. When omitted, a platform + default is + used. Default value is None. + :paramtype app_version: str + :keyword short_description: Short, one-line description shown in the Teams app listing. Default + value is None. + :paramtype short_description: str + :keyword full_description: Full description shown on the Teams app details page. Default value + is None. + :paramtype full_description: str + :keyword developer_name: Display name of the developer / publisher shown in the Teams app + listing. Default value is None. + :paramtype developer_name: str + :keyword developer_website_url: Developer / publisher website URL shown in the Teams app + listing. Must be an https URL. Default value is None. + :paramtype developer_website_url: str + :keyword privacy_url: Privacy policy URL shown in the Teams app listing. Must be an http or + https URL. Default value is None. + :paramtype privacy_url: str + :keyword terms_of_use_url: Terms-of-use URL shown in the Teams app listing. Default value is + None. + :paramtype terms_of_use_url: str + :keyword color_icon_base64: Optional base64-encoded PNG used as the color (full-bleed) icon in + the Teams app package. Must be a + 192x192 PNG (perfect square, no border or rounded corners). Max 1 MB after decode. When + omitted, the + platform default color icon is used. Default value is None. + :paramtype color_icon_base64: str + :keyword outline_icon_base64: Optional base64-encoded PNG used as the outline icon in the Teams + app package. Must be a 32x32 PNG. + Max 1 MB after decode. When omitted, the platform default outline icon is used. Default value + is None. + :paramtype outline_icon_base64: str + :return: Microsoft365PublishResult. The Microsoft365PublishResult is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.Microsoft365PublishResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2378,15 +2589,39 @@ async def upload_session_file( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SessionFileWriteResult] = kwargs.pop("cls", None) + cls: ClsType[_models.Microsoft365PublishResult] = kwargs.pop("cls", None) - content_type = content_type or "application/octet-stream" - _content = content + if body is _Unset: + if publish_scope is _Unset: + raise TypeError("missing required argument: publish_scope") + body = { + "accessBoundaries": access_boundaries, + "agentDisplayName": agent_display_name, + "appVersion": app_version, + "botServiceArmId": bot_service_arm_id, + "canRespondWithoutMention": can_respond_without_mention, + "colorIconBase64": color_icon_base64, + "developerName": developer_name, + "developerWebsiteUrl": developer_website_url, + "fullDescription": full_description, + "optionalPermissionScopes": optional_permission_scopes, + "outlineIconBase64": outline_icon_base64, + "privacyUrl": privacy_url, + "publishAsAutopilot": publish_as_autopilot, + "publishScope": publish_scope, + "shortDescription": short_description, + "termsOfUseUrl": terms_of_use_url, + } + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_agents_upload_session_file_request( + _request = build_agents_publish_to_microsoft365_request( agent_name=agent_name, - session_id=session_id, - path=path, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -2406,7 +2641,7 @@ async def upload_session_file( response = pipeline_response.http_response - if response.status_code not in [201]: + if response.status_code not in [200]: if _stream: try: await response.read() # Load the body in memory and close the socket @@ -2422,29 +2657,273 @@ async def upload_session_file( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.SessionFileWriteResult, response.json()) + deserialized = _deserialize(_models.Microsoft365PublishResult, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + @overload + async def get_microsoft365_package( + self, + agent_name: str, + *, + publish_scope: Union[str, _models.Microsoft365PublishScope], + content_type: str = "application/json", + agent_display_name: Optional[str] = None, + bot_service_arm_id: Optional[str] = None, + publish_as_autopilot: Optional[bool] = None, + access_boundaries: Optional[List[Union[str, _models.ActivityProtocolAccessBoundary]]] = None, + optional_permission_scopes: Optional[List[_models.Microsoft365PermissionScopes]] = None, + can_respond_without_mention: Optional[bool] = None, + app_version: 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, + color_icon_base64: Optional[str] = None, + outline_icon_base64: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Generate a Microsoft 365 app package. + + Generates the Microsoft Teams app package (zip) for a Foundry agent from the supplied publish + request, without publishing it. Returns the app package as ``application/zip``. + + :param agent_name: The name of the agent to generate the app package for. Required. + :type agent_name: str + :keyword publish_scope: Publish scope for the Teams app. Known values are: "Personal", + "Shared", and "Tenant". Required. + :paramtype publish_scope: str or ~azure.ai.projects.models.Microsoft365PublishScope + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword agent_display_name: Display name used as the published Teams app name. When omitted, + the agent name from the route is + used. Default value is None. + :paramtype agent_display_name: str + :keyword bot_service_arm_id: ARM resource id of the Azure Bot Service that fronts this agent in + Microsoft Teams. Required for + workspaces on the default bot-based Teams backend; optional for workspaces on the API-based + backend. + Must not be supplied when ``publishAsAutopilot`` is true. Default value is None. + :paramtype bot_service_arm_id: str + :keyword publish_as_autopilot: When true, the agent is published as an autopilot (digital + worker) agent: the bot id is taken from + the agent's blueprint identity and the generated Teams manifest is marked as a digital worker. + Default value is None. + :paramtype publish_as_autopilot: bool + :keyword access_boundaries: Activity-protocol access boundaries to apply to the agent when + publishing as an autopilot agent. + An empty list clears the existing boundaries. When omitted, the existing boundaries are left + unchanged. Default value is None. + :paramtype access_boundaries: list[str or + ~azure.ai.projects.models.ActivityProtocolAccessBoundary] + :keyword optional_permission_scopes: Exact selection of delegated permission scopes to grant to + the autopilot blueprint. May only be + supplied when ``publishAsAutopilot`` is true. When omitted or empty, the platform's default + permission set is used. Mandatory platform permissions are always granted and are not affected + by + this value. Default value is None. + :paramtype optional_permission_scopes: + list[~azure.ai.projects.models.Microsoft365PermissionScopes] + :keyword can_respond_without_mention: Controls how the published agent responds to Teams + messages: when true it responds to all messages + on its surfaces, when false only when it is at-mentioned. When omitted, the agent's existing + Teams + message-notification setting is left unchanged. Default value is None. + :paramtype can_respond_without_mention: bool + :keyword app_version: App version (for example ``1.2.3``) written into the Teams manifest. May + contain only digits and + periods, must not start with ``0``, and must end with a digit. When omitted, a platform + default is + used. Default value is None. + :paramtype app_version: str + :keyword short_description: Short, one-line description shown in the Teams app listing. Default + value is None. + :paramtype short_description: str + :keyword full_description: Full description shown on the Teams app details page. Default value + is None. + :paramtype full_description: str + :keyword developer_name: Display name of the developer / publisher shown in the Teams app + listing. Default value is None. + :paramtype developer_name: str + :keyword developer_website_url: Developer / publisher website URL shown in the Teams app + listing. Must be an https URL. Default value is None. + :paramtype developer_website_url: str + :keyword privacy_url: Privacy policy URL shown in the Teams app listing. Must be an http or + https URL. Default value is None. + :paramtype privacy_url: str + :keyword terms_of_use_url: Terms-of-use URL shown in the Teams app listing. Default value is + None. + :paramtype terms_of_use_url: str + :keyword color_icon_base64: Optional base64-encoded PNG used as the color (full-bleed) icon in + the Teams app package. Must be a + 192x192 PNG (perfect square, no border or rounded corners). Max 1 MB after decode. When + omitted, the + platform default color icon is used. Default value is None. + :paramtype color_icon_base64: str + :keyword outline_icon_base64: Optional base64-encoded PNG used as the outline icon in the Teams + app package. Must be a 32x32 PNG. + Max 1 MB after decode. When omitted, the platform default outline icon is used. Default value + is None. + :paramtype outline_icon_base64: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def get_microsoft365_package( + self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> AsyncIterator[bytes]: + """Generate a Microsoft 365 app package. + + Generates the Microsoft Teams app package (zip) for a Foundry agent from the supplied publish + request, without publishing it. Returns the app package as ``application/zip``. + + :param agent_name: The name of the agent to generate the app package for. Required. + :type agent_name: str + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def get_microsoft365_package( + self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> AsyncIterator[bytes]: + """Generate a Microsoft 365 app package. + + Generates the Microsoft Teams app package (zip) for a Foundry agent from the supplied publish + request, without publishing it. Returns the app package as ``application/zip``. + + :param agent_name: The name of the agent to generate the app package for. Required. + :type agent_name: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace_async - async def download_session_file( - self, agent_name: str, session_id: str, *, path: str, **kwargs: Any + async def get_microsoft365_package( # pylint: disable=too-many-locals + self, + agent_name: str, + body: Union[JSON, IO[bytes]] = _Unset, + *, + publish_scope: Union[str, _models.Microsoft365PublishScope] = _Unset, + agent_display_name: Optional[str] = None, + bot_service_arm_id: Optional[str] = None, + publish_as_autopilot: Optional[bool] = None, + access_boundaries: Optional[List[Union[str, _models.ActivityProtocolAccessBoundary]]] = None, + optional_permission_scopes: Optional[List[_models.Microsoft365PermissionScopes]] = None, + can_respond_without_mention: Optional[bool] = None, + app_version: 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, + color_icon_base64: Optional[str] = None, + outline_icon_base64: Optional[str] = None, + **kwargs: Any ) -> AsyncIterator[bytes]: - """Download a session file. + """Generate a Microsoft 365 app package. - Downloads the file at the specified sandbox path as a binary stream. The path is resolved - relative to the session home directory. + Generates the Microsoft Teams app package (zip) for a Foundry agent from the supplied publish + request, without publishing it. Returns the app package as ``application/zip``. - :param agent_name: The name of the agent. Required. + :param agent_name: The name of the agent to generate the app package for. Required. :type agent_name: str - :param session_id: The session ID. Required. - :type session_id: str - :keyword path: The file path to download from the sandbox, relative to the session home - directory. Required. - :paramtype path: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword publish_scope: Publish scope for the Teams app. Known values are: "Personal", + "Shared", and "Tenant". Required. + :paramtype publish_scope: str or ~azure.ai.projects.models.Microsoft365PublishScope + :keyword agent_display_name: Display name used as the published Teams app name. When omitted, + the agent name from the route is + used. Default value is None. + :paramtype agent_display_name: str + :keyword bot_service_arm_id: ARM resource id of the Azure Bot Service that fronts this agent in + Microsoft Teams. Required for + workspaces on the default bot-based Teams backend; optional for workspaces on the API-based + backend. + Must not be supplied when ``publishAsAutopilot`` is true. Default value is None. + :paramtype bot_service_arm_id: str + :keyword publish_as_autopilot: When true, the agent is published as an autopilot (digital + worker) agent: the bot id is taken from + the agent's blueprint identity and the generated Teams manifest is marked as a digital worker. + Default value is None. + :paramtype publish_as_autopilot: bool + :keyword access_boundaries: Activity-protocol access boundaries to apply to the agent when + publishing as an autopilot agent. + An empty list clears the existing boundaries. When omitted, the existing boundaries are left + unchanged. Default value is None. + :paramtype access_boundaries: list[str or + ~azure.ai.projects.models.ActivityProtocolAccessBoundary] + :keyword optional_permission_scopes: Exact selection of delegated permission scopes to grant to + the autopilot blueprint. May only be + supplied when ``publishAsAutopilot`` is true. When omitted or empty, the platform's default + permission set is used. Mandatory platform permissions are always granted and are not affected + by + this value. Default value is None. + :paramtype optional_permission_scopes: + list[~azure.ai.projects.models.Microsoft365PermissionScopes] + :keyword can_respond_without_mention: Controls how the published agent responds to Teams + messages: when true it responds to all messages + on its surfaces, when false only when it is at-mentioned. When omitted, the agent's existing + Teams + message-notification setting is left unchanged. Default value is None. + :paramtype can_respond_without_mention: bool + :keyword app_version: App version (for example ``1.2.3``) written into the Teams manifest. May + contain only digits and + periods, must not start with ``0``, and must end with a digit. When omitted, a platform + default is + used. Default value is None. + :paramtype app_version: str + :keyword short_description: Short, one-line description shown in the Teams app listing. Default + value is None. + :paramtype short_description: str + :keyword full_description: Full description shown on the Teams app details page. Default value + is None. + :paramtype full_description: str + :keyword developer_name: Display name of the developer / publisher shown in the Teams app + listing. Default value is None. + :paramtype developer_name: str + :keyword developer_website_url: Developer / publisher website URL shown in the Teams app + listing. Must be an https URL. Default value is None. + :paramtype developer_website_url: str + :keyword privacy_url: Privacy policy URL shown in the Teams app listing. Must be an http or + https URL. Default value is None. + :paramtype privacy_url: str + :keyword terms_of_use_url: Terms-of-use URL shown in the Teams app listing. Default value is + None. + :paramtype terms_of_use_url: str + :keyword color_icon_base64: Optional base64-encoded PNG used as the color (full-bleed) icon in + the Teams app package. Must be a + 192x192 PNG (perfect square, no border or rounded corners). Max 1 MB after decode. When + omitted, the + platform default color icon is used. Default value is None. + :paramtype color_icon_base64: str + :keyword outline_icon_base64: Optional base64-encoded PNG used as the outline icon in the Teams + app package. Must be a 32x32 PNG. + Max 1 MB after decode. When omitted, the platform default outline icon is used. Default value + is None. + :paramtype outline_icon_base64: str :return: AsyncIterator[bytes] :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: @@ -2457,16 +2936,46 @@ async def download_session_file( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_agents_download_session_file_request( + if body is _Unset: + if publish_scope is _Unset: + raise TypeError("missing required argument: publish_scope") + body = { + "accessBoundaries": access_boundaries, + "agentDisplayName": agent_display_name, + "appVersion": app_version, + "botServiceArmId": bot_service_arm_id, + "canRespondWithoutMention": can_respond_without_mention, + "colorIconBase64": color_icon_base64, + "developerName": developer_name, + "developerWebsiteUrl": developer_website_url, + "fullDescription": full_description, + "optionalPermissionScopes": optional_permission_scopes, + "outlineIconBase64": outline_icon_base64, + "privacyUrl": privacy_url, + "publishAsAutopilot": publish_as_autopilot, + "publishScope": publish_scope, + "shortDescription": short_description, + "termsOfUseUrl": terms_of_use_url, + } + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_agents_get_microsoft365_package_request( agent_name=agent_name, - session_id=session_id, - path=path, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -2496,62 +3005,35 @@ async def download_session_file( ) 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, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @distributed_trace - def list_session_files( - self, - agent_name: str, - session_id: str, - *, - path: Optional[str] = None, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.SessionDirectoryEntry"]: - """List session files. + @distributed_trace_async + async def get_microsoft365_publish_defaults( + self, agent_name: str, *, publish_as_digital_worker: Optional[bool] = None, **kwargs: Any + ) -> _models.Microsoft365PublishDefaults: + """Get Microsoft 365 publish defaults. - Returns files and directories at the specified path in the session sandbox. The response - includes only the immediate children of the target directory and defaults to the session home - directory when no path is supplied. + Returns default and previously-published values used to pre-populate a Microsoft 365 publish + request for a Foundry agent. - :param agent_name: The name of the agent. Required. + :param agent_name: The name of the agent to get publish defaults for. Required. :type agent_name: str - :param session_id: The session ID. Required. - :type session_id: str - :keyword path: The directory path to list, relative to the session home directory. Defaults to - the home directory if not provided. Default value is None. - :paramtype path: 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 SessionDirectoryEntry - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.SessionDirectoryEntry] + :keyword publish_as_digital_worker: When true, returns defaults for publishing the agent as an + autopilot (digital worker) agent. Default value is None. + :paramtype publish_as_digital_worker: bool + :return: Microsoft365PublishDefaults. The Microsoft365PublishDefaults is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.Microsoft365PublishDefaults :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.SessionDirectoryEntry]] = kwargs.pop("cls", None) - error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -2560,78 +3042,140 @@ def list_session_files( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(_continuation_token=None): + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - _request = build_agents_list_session_files_request( - agent_name=agent_name, - session_id=session_id, - path=path, - 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 + cls: ClsType[_models.Microsoft365PublishDefaults] = kwargs.pop("cls", None) - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.SessionDirectoryEntry], - deserialized.get("entries", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("last_id") or None, AsyncList(list_of_elem) + _request = build_agents_get_microsoft365_publish_defaults_request( + agent_name=agent_name, + publish_as_digital_worker=publish_as_digital_worker, + 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) - async def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) + _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 + ) - _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, ) - response = pipeline_response.http_response + raise HttpResponseError(response=response, model=error) - 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) + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Microsoft365PublishDefaults, response.json()) - return pipeline_response + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore - return AsyncItemPaged(get_next, extract_data) + return deserialized # type: ignore + + @overload + async def upload_session_file( + self, + agent_name: str, + session_id: str, + content: bytes, + *, + path: str, + content_type: str = "application/octet-stream", + **kwargs: Any + ) -> _models.SessionFileWriteResult: + """Upload a session file. + + Uploads binary file content to the specified path in the session sandbox. The service stores + the file relative to the session home directory and rejects payloads larger than 50 MB. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param session_id: The session ID. Required. + :type session_id: str + :param content: Required. + :type content: bytes + :keyword path: The destination file path within the sandbox, relative to the session home + directory. Required. + :paramtype path: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/octet-stream". + :paramtype content_type: str + :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.SessionFileWriteResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def upload_session_file( + self, + agent_name: str, + session_id: str, + content: IO[bytes], + *, + path: str, + content_type: str = "application/octet-stream", + **kwargs: Any + ) -> _models.SessionFileWriteResult: + """Upload a session file. + + Uploads binary file content to the specified path in the session sandbox. The service stores + the file relative to the session home directory and rejects payloads larger than 50 MB. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param session_id: The session ID. Required. + :type session_id: str + :param content: Required. + :type content: IO[bytes] + :keyword path: The destination file path within the sandbox, relative to the session home + directory. Required. + :paramtype path: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/octet-stream". + :paramtype content_type: str + :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.SessionFileWriteResult + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async - async def delete_session_file( - self, agent_name: str, session_id: str, *, path: str, recursive: Optional[bool] = None, **kwargs: Any - ) -> None: - """Delete a session file. + async def upload_session_file( + self, agent_name: str, session_id: str, content: Union[bytes, IO[bytes]], *, path: str, **kwargs: Any + ) -> _models.SessionFileWriteResult: + """Upload a session file. - Deletes the specified file or directory from the session sandbox. When ``recursive`` is false, - deleting a non-empty directory returns 409 Conflict. + Uploads binary file content to the specified path in the session sandbox. The service stores + the file relative to the session home directory and rejects payloads larger than 50 MB. :param agent_name: The name of the agent. Required. :type agent_name: str :param session_id: The session ID. Required. :type session_id: str - :keyword path: The file or directory path to delete, relative to the session home directory. - Required. + :param content: Is either a bytes type or a IO[bytes] type. Required. + :type content: bytes or IO[bytes] + :keyword path: The destination file path within the sandbox, relative to the session home + directory. Required. :paramtype path: str - :keyword recursive: Whether to recursively delete directory contents. The service defaults to - ``false`` if a value is not specified by the caller. Default value is None. - :paramtype recursive: bool - :return: None - :rtype: None + :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.SessionFileWriteResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2642,17 +3186,22 @@ async def delete_session_file( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SessionFileWriteResult] = kwargs.pop("cls", None) - _request = build_agents_delete_session_file_request( + content_type = content_type or "application/octet-stream" + _content = content + + _request = build_agents_upload_session_file_request( agent_name=agent_name, session_id=session_id, path=path, - recursive=recursive, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -2661,14 +3210,20 @@ async def delete_session_file( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _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 [204]: + if response.status_code not in [201]: + 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, @@ -2676,108 +3231,53 @@ async def delete_session_file( ) raise HttpResponseError(response=response, model=error) + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SessionFileWriteResult, response.json()) + if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized # type: ignore -class VoiceAgentWebSocketOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. + @distributed_trace_async + async def download_session_file( + self, agent_name: str, session_id: str, *, path: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + """Download a session file. - Instead, you should access the following operations through - :class:`~azure.ai.projects.aio.AIProjectClient`'s - :attr:`voice_agent_web_socket` attribute. - """ + Downloads the file at the specified sandbox path as a binary stream. The path is resolved + relative to the session home directory. - 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_async - async def connect_voice_agent( - self, - agent_name: str, - *, - foundry_features_query: Optional[Literal[_AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW]] = None, - agent_session_id: Optional[str] = None, - store: Optional[bool] = None, - agent_version_override: Optional[str] = None, - websocket_subprotocol: Optional[Union[str, _models.VoiceAgentWebSocketSubprotocol]] = None, - structured_inputs: Optional[str] = None, - **kwargs: Any - ) -> None: - """Connect to a voice agent. - - Connects to a voice agent over WebSocket. The client must send an HTTP GET with ``Upgrade: - websocket`` - headers. The optional ``realtime`` subprotocol is the only accepted subprotocol value. Supply - the - ``VoiceAgents=V1Preview`` opt-in through either the ``Foundry-Features`` header or the - ``foundry_features`` - query parameter. - - If the target agent is disabled, the HTTP WebSocket handshake fails before the ``101 Switching - Protocols`` - upgrade. The service returns ``409 Conflict`` using the shared Foundry ``ApiErrorResponse`` - shape with - ``error.code = agent_disabled``. This failure is terminal until the caller enables the agent. - - :param agent_name: The name of the voice agent. Required. - :type agent_name: str - :keyword foundry_features_query: A query alternative to the ``Foundry-Features`` header for - clients that cannot set headers during a - WebSocket handshake. Set this to ``VoiceAgents=V1Preview``. Either this query parameter or the - header is - required. VOICE_AGENTS_V1_PREVIEW. Default value is None. - :paramtype foundry_features_query: str or ~azure.ai.projects.models.VOICE_AGENTS_V1_PREVIEW - :keyword agent_session_id: An optional identifier used to correlate the voice session. Default - value is None. - :paramtype agent_session_id: str - :keyword store: Whether to persist the conversation created by this WebSocket session. If - omitted, the service honors the - persisted voice agent definition's configured ``store`` value. If supplied, this value - overrides the - definition's ``store`` setting for this session only. Default value is None. - :paramtype store: bool - :keyword agent_version_override: Selects a specific version of the voice agent for this - session. Default value is None. - :paramtype agent_version_override: str - :keyword websocket_subprotocol: The requested WebSocket subprotocol. Omit this header or - request exactly ``realtime``. "realtime" Default value is None. - :paramtype websocket_subprotocol: str or - ~azure.ai.projects.models.VoiceAgentWebSocketSubprotocol - :keyword structured_inputs: A JSON object that maps structured-input names to their values for - this session. Default value is None. - :paramtype structured_inputs: 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 {}) + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param session_id: The session ID. Required. + :type session_id: str + :keyword path: The file path to download from the sandbox, relative to the session home + directory. Required. + :paramtype path: 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[None] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_voice_agent_web_socket_connect_voice_agent_request( + _request = build_agents_download_session_file_request( agent_name=agent_name, - foundry_features_query=foundry_features_query, - agent_session_id=agent_session_id, - store=store, - agent_version_override=agent_version_override, - websocket_subprotocol=websocket_subprotocol, - structured_inputs=structured_inputs, + session_id=session_id, + path=path, api_version=self._config.api_version, headers=_headers, params=_params, @@ -2787,14 +3287,20 @@ async def connect_voice_agent( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _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 [101]: + 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, @@ -2802,49 +3308,38 @@ async def connect_voice_agent( ) raise HttpResponseError(response=response, model=error) - response_headers = {} - response_headers["Sec-WebSocket-Protocol"] = self._deserialize( - "str", response.headers.get("Sec-WebSocket-Protocol") - ) + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - - -class AgentEndpointConversationsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.projects.aio.AIProjectClient`'s - :attr:`agent_endpoint_conversations` attribute. - """ + return cls(pipeline_response, deserialized, {}) # type: ignore - 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") + return deserialized # type: ignore @distributed_trace - def list_agent_conversations( + def list_session_files( self, agent_name: str, + session_id: str, *, + path: Optional[str] = None, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, before: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.VoiceConversation"]: - """List voice agent conversations. + ) -> AsyncItemPaged["_models.SessionDirectoryEntry"]: + """List session files. - Returns the conversations persisted for the specified voice agent endpoint. Conversations are - present only when the agent definition has ``store = true``. + Returns files and directories at the specified path in the session sandbox. The response + includes only the immediate children of the target directory and defaults to the session home + directory when no path is supplied. :param agent_name: The name of the agent. Required. :type agent_name: str + :param session_id: The session ID. Required. + :type session_id: str + :keyword path: The directory path to list, relative to the session home directory. Defaults to + the home directory if not provided. Default value is None. + :paramtype path: 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. @@ -2859,14 +3354,15 @@ def list_agent_conversations( 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 VoiceConversation - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.VoiceConversation] + :return: An iterator like instance of SessionDirectoryEntry + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.SessionDirectoryEntry] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.VoiceConversation]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.SessionDirectoryEntry]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2878,8 +3374,10 @@ def list_agent_conversations( def prepare_request(_continuation_token=None): - _request = build_agent_endpoint_conversations_list_agent_conversations_request( + _request = build_agents_list_session_files_request( agent_name=agent_name, + session_id=session_id, + path=path, limit=limit, order=order, after=_continuation_token, @@ -2897,8 +3395,8 @@ def prepare_request(_continuation_token=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.VoiceConversation], - deserialized.get("data", []), + List[_models.SessionDirectoryEntry], + deserialized.get("entries", []), ) if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -2926,20 +3424,26 @@ async def get_next(_continuation_token=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def get_agent_conversation( - self, agent_name: str, conversation_id: str, **kwargs: Any - ) -> _models.VoiceConversation: - """Get a voice agent conversation. + async def delete_session_file( + self, agent_name: str, session_id: str, *, path: str, recursive: Optional[bool] = None, **kwargs: Any + ) -> None: + """Delete a session file. - Retrieves a single conversation recorded for the specified voice agent endpoint by its id. - Returns ``404`` when the conversation was not persisted (``store = false``) or does not exist. + Deletes the specified file or directory from the session sandbox. When ``recursive`` is false, + deleting a non-empty directory returns 409 Conflict. :param agent_name: The name of the agent. Required. :type agent_name: str - :param conversation_id: The id of the conversation to retrieve. Required. - :type conversation_id: str - :return: VoiceConversation. The VoiceConversation is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.VoiceConversation + :param session_id: The session ID. Required. + :type session_id: str + :keyword path: The file or directory path to delete, relative to the session home directory. + Required. + :paramtype path: str + :keyword recursive: Whether to recursively delete directory contents. The service defaults to + ``false`` if a value is not specified by the caller. Default value is None. + :paramtype recursive: bool + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2953,11 +3457,13 @@ async def get_agent_conversation( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.VoiceConversation] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_agent_endpoint_conversations_get_agent_conversation_request( + _request = build_agents_delete_session_file_request( agent_name=agent_name, - conversation_id=conversation_id, + session_id=session_id, + path=path, + recursive=recursive, api_version=self._config.api_version, headers=_headers, params=_params, @@ -2967,20 +3473,14 @@ async def get_agent_conversation( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _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 + 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, @@ -2988,29 +3488,37 @@ async def get_agent_conversation( ) raise HttpResponseError(response=response, model=error) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.VoiceConversation, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, None, {}) # type: ignore - return deserialized # type: ignore + +class EvaluationRulesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.aio.AIProjectClient`'s + :attr:`evaluation_rules` 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_async - async def delete_agent_conversation(self, agent_name: str, conversation_id: str, **kwargs: Any) -> None: - """Delete a voice agent conversation. + async def get(self, id: str, **kwargs: Any) -> _models.EvaluationRule: + """Get an evaluation rule. - Deletes a conversation and all of its stored data — responses, items, and any audio (cascade). - This is the customer's explicit data-deletion control for voice conversations. + Retrieves the specified evaluation rule and its configuration. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation to delete. Required. - :type conversation_id: str - :return: None - :rtype: None + :param id: Unique identifier for the evaluation rule. Required. + :type id: str + :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluationRule :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3024,11 +3532,10 @@ async def delete_agent_conversation(self, agent_name: str, conversation_id: str, _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[_models.EvaluationRule] = kwargs.pop("cls", None) - _request = build_agent_endpoint_conversations_delete_agent_conversation_request( - agent_name=agent_name, - conversation_id=conversation_id, + _request = build_evaluation_rules_get_request( + id=id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -3038,69 +3545,45 @@ async def delete_agent_conversation(self, agent_name: str, conversation_id: str, } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _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 [204]: + 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) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.EvaluationRule, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore - @distributed_trace - def list_agent_conversation_responses( - 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.VoiceResponse"]: - """List responses in a voice agent conversation. + return deserialized # type: ignore - Returns a paged collection of the responses (model inference turns) recorded for the specified - conversation. The per-response ``output`` projection may be omitted here; use the - response-items route for the canonical paged output. Returns ``404`` when the conversation was - not persisted (``store = false``). + @distributed_trace_async + async def delete(self, id: str, **kwargs: Any) -> None: + """Delete an evaluation rule. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation whose responses are listed. 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 VoiceResponse - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.VoiceResponse] + Removes the specified evaluation rule from the project. + + :param id: Unique identifier for the evaluation rule. Required. + :type id: str + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.VoiceResponse]] = kwargs.pop("cls", None) - error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -3109,74 +3592,111 @@ def list_agent_conversation_responses( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(_continuation_token=None): + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - _request = build_agent_endpoint_conversations_list_agent_conversation_responses_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 + cls: ClsType[None] = kwargs.pop("cls", None) - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.VoiceResponse], - 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) + _request = build_evaluation_rules_delete_request( + id=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) - 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 + ) - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response + 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) + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) - return pipeline_response + if cls: + return cls(pipeline_response, None, {}) # type: ignore - return AsyncItemPaged(get_next, extract_data) + @overload + async def create_or_update( + self, id: str, evaluation_rule: _models.EvaluationRule, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.EvaluationRule: + """Create or update an evaluation rule. + + Creates a new evaluation rule, or replaces the existing rule when the identifier matches. + + :param id: Unique identifier for the evaluation rule. Required. + :type id: str + :param evaluation_rule: Evaluation rule resource. Required. + :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluationRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, id: str, evaluation_rule: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.EvaluationRule: + """Create or update an evaluation rule. + + Creates a new evaluation rule, or replaces the existing rule when the identifier matches. + + :param id: Unique identifier for the evaluation rule. Required. + :type id: str + :param evaluation_rule: Evaluation rule resource. Required. + :type evaluation_rule: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluationRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, id: str, evaluation_rule: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.EvaluationRule: + """Create or update an evaluation rule. + + Creates a new evaluation rule, or replaces the existing rule when the identifier matches. + + :param id: Unique identifier for the evaluation rule. Required. + :type id: str + :param evaluation_rule: Evaluation rule resource. Required. + :type evaluation_rule: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluationRule + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async - async def get_agent_conversation_response( - self, agent_name: str, conversation_id: str, response_id: str, **kwargs: Any - ) -> _models.VoiceResponse: - """Get a voice agent conversation response. + async def create_or_update( + self, id: str, evaluation_rule: Union[_models.EvaluationRule, JSON, IO[bytes]], **kwargs: Any + ) -> _models.EvaluationRule: + """Create or update an evaluation rule. - Retrieves a single response from the specified conversation by its id, including its ``output`` - items, ``usage``, and status. Returns ``404`` when the conversation or response was not - persisted (``store = false``). + Creates a new evaluation rule, or replaces the existing rule when the identifier matches. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the response. Required. - :type conversation_id: str - :param response_id: The id of the response to retrieve. Required. - :type response_id: str - :return: VoiceResponse. The VoiceResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.VoiceResponse + :param id: Unique identifier for the evaluation rule. Required. + :type id: str + :param evaluation_rule: Evaluation rule resource. Is one of the following types: + EvaluationRule, JSON, IO[bytes] Required. + :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule or JSON or IO[bytes] + :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluationRule :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3187,16 +3707,24 @@ async def get_agent_conversation_response( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.VoiceResponse] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EvaluationRule] = kwargs.pop("cls", None) - _request = build_agent_endpoint_conversations_get_agent_conversation_response_request( - agent_name=agent_name, - conversation_id=conversation_id, - response_id=response_id, + content_type = content_type or "application/json" + _content = None + if isinstance(evaluation_rule, (IOBase, bytes)): + _content = evaluation_rule + else: + _content = json.dumps(evaluation_rule, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_evaluation_rules_create_or_update_request( + id=id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -3213,23 +3741,19 @@ async def get_agent_conversation_response( response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 201]: 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) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.VoiceResponse, response.json()) + deserialized = _deserialize(_models.EvaluationRule, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3237,63 +3761,34 @@ async def get_agent_conversation_response( return deserialized # type: ignore @distributed_trace - def list_agent_conversation_response_items( + def list( self, - agent_name: str, - conversation_id: str, - response_id: str, *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, + action_type: Optional[Union[str, _models.EvaluationRuleActionType]] = None, + agent_name: Optional[str] = None, + enabled: Optional[bool] = None, **kwargs: Any - ) -> AsyncItemPaged["_unions.VoiceConversationItem"]: - """List items produced by a voice agent conversation response. + ) -> AsyncItemPaged["_models.EvaluationRule"]: + """List evaluation rules. - Returns a paged collection of the output items produced by a specific response (the response's - output projection). For the complete ordered conversation history — including user input and - client-created tool outputs — use the conversation items route instead. Returns ``404`` when - the conversation or response was not persisted (``store = false``). + Returns the evaluation rules configured for the project, optionally filtered by action type, + agent name, or enabled state. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the response. Required. - :type conversation_id: str - :param response_id: The id of the response whose output items are listed. Required. - :type response_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 VoiceSystemMessageItem or VoiceUserMessageItem or - VoiceAssistantMessageItem or VoiceFunctionCallItem or VoiceFunctionCallOutputItem or - VoiceMcpListToolsItem or VoiceMcpCallItem or VoiceMcpApprovalRequestItem or - VoiceMcpApprovalResponseItem - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.VoiceSystemMessageItem or - ~azure.ai.projects.models.VoiceUserMessageItem or - ~azure.ai.projects.models.VoiceAssistantMessageItem or - ~azure.ai.projects.models.VoiceFunctionCallItem or - ~azure.ai.projects.models.VoiceFunctionCallOutputItem or - ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem - or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or - ~azure.ai.projects.models.VoiceMcpApprovalResponseItem] + :keyword action_type: Filter by the type of evaluation rule. Known values are: + "continuousEvaluation" and "humanEvaluationPreview". Default value is None. + :paramtype action_type: str or ~azure.ai.projects.models.EvaluationRuleActionType + :keyword agent_name: Filter by the agent name. Default value is None. + :paramtype agent_name: str + :keyword enabled: Filter by the enabled status. Default value is None. + :paramtype enabled: bool + :return: An iterator like instance of EvaluationRule + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.EvaluationRule] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List["_unions.VoiceConversationItem"]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.EvaluationRule]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3303,38 +3798,61 @@ def list_agent_conversation_response_items( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(_continuation_token=None): + def prepare_request(next_link=None): + if not next_link: + + _request = build_evaluation_rules_list_request( + action_type=action_type, + agent_name=agent_name, + enabled=enabled, + 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) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_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) - _request = build_agent_endpoint_conversations_list_agent_conversation_response_items_request( - agent_name=agent_name, - conversation_id=conversation_id, - response_id=response_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["_unions.VoiceConversationItem"], - deserialized.get("data", []), + List[_models.EvaluationRule], + deserialized.get("value", []), ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("last_id") or None, AsyncList(list_of_elem) + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - async def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) + async def get_next(next_link=None): + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access @@ -3344,158 +3862,41 @@ async def get_next(_continuation_token=None): 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) + raise HttpResponseError(response=response) return pipeline_response return AsyncItemPaged(get_next, extract_data) - @distributed_trace - def list_agent_conversation_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["_unions.VoiceConversationItem"]: - """List items in a voice agent conversation. - - Returns a paged collection of items — the complete ordered conversation history, including user - input, assistant output, and client-created tool outputs (transcripts + tool events). Returns - ``404`` when the conversation was not persisted (``store = false``). - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation whose items are listed. 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 VoiceSystemMessageItem or VoiceUserMessageItem or - VoiceAssistantMessageItem or VoiceFunctionCallItem or VoiceFunctionCallOutputItem or - VoiceMcpListToolsItem or VoiceMcpCallItem or VoiceMcpApprovalRequestItem or - VoiceMcpApprovalResponseItem - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.VoiceSystemMessageItem or - ~azure.ai.projects.models.VoiceUserMessageItem or - ~azure.ai.projects.models.VoiceAssistantMessageItem or - ~azure.ai.projects.models.VoiceFunctionCallItem or - ~azure.ai.projects.models.VoiceFunctionCallOutputItem or - ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem - or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or - ~azure.ai.projects.models.VoiceMcpApprovalResponseItem] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List["_unions.VoiceConversationItem"]] = 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_agent_endpoint_conversations_list_agent_conversation_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["_unions.VoiceConversationItem"], - 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) +class ConnectionsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. - return pipeline_response + Instead, you should access the following operations through + :class:`~azure.ai.projects.aio.AIProjectClient`'s + :attr:`connections` attribute. + """ - return AsyncItemPaged(get_next, extract_data) + 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_async - async def get_agent_conversation_item( - self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any - ) -> "_unions.VoiceConversationItem": - """Get a voice agent conversation item. + async def _get(self, name: str, **kwargs: Any) -> _models.Connection: + """Get a connection. - Retrieves a single item from the specified conversation by its id, including its transcript. An - ``input_audio``/``output_audio`` content part indicates that audio is available for the item; - the canonical per-item audio metadata is the ``/items/{item_id}/audio`` resource, and the bytes - are streamed by ``/items/{item_id}/audio/content``. Returns ``404`` when the conversation or - item was not persisted (``store = false``). + Retrieves the specified connection and its configuration details without including credential + values. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the item. Required. - :type conversation_id: str - :param item_id: The id of the conversation item to retrieve. Required. - :type item_id: str - :return: VoiceSystemMessageItem or VoiceUserMessageItem or VoiceAssistantMessageItem or - VoiceFunctionCallItem or VoiceFunctionCallOutputItem or VoiceMcpListToolsItem or - VoiceMcpCallItem or VoiceMcpApprovalRequestItem or VoiceMcpApprovalResponseItem - :rtype: ~azure.ai.projects.models.VoiceSystemMessageItem or - ~azure.ai.projects.models.VoiceUserMessageItem or - ~azure.ai.projects.models.VoiceAssistantMessageItem or - ~azure.ai.projects.models.VoiceFunctionCallItem or - ~azure.ai.projects.models.VoiceFunctionCallOutputItem or - ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem - or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or - ~azure.ai.projects.models.VoiceMcpApprovalResponseItem + :param name: The friendly name of the connection, provided by the user. Required. + :type name: str + :return: Connection. The Connection is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.Connection :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3509,12 +3910,10 @@ async def get_agent_conversation_item( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType["_unions.VoiceConversationItem"] = kwargs.pop("cls", None) + cls: ClsType[_models.Connection] = kwargs.pop("cls", None) - _request = build_agent_endpoint_conversations_get_agent_conversation_item_request( - agent_name=agent_name, - conversation_id=conversation_id, - item_id=item_id, + _request = build_connections_get_request( + name=name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -3539,44 +3938,33 @@ async def get_agent_conversation_item( 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) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["x-ms-client-request-id"] = self._deserialize( + "str", response.headers.get("x-ms-client-request-id") + ) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize("_unions.VoiceConversationItem", response.json()) + deserialized = _deserialize(_models.Connection, response.json()) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace_async - async def get_agent_conversation_item_audio( - self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any - ) -> _models.VoiceItemAudioResponse: - """Get a voice agent conversation item's audio metadata. + async def _get_with_credentials(self, name: str, **kwargs: Any) -> _models.Connection: + """Get a connection with credentials. - Returns metadata for a single conversation item's audio segment, including the common playback - facts (role, format/codec, sample rate, channels, offset, duration) for both Foundry-managed - and bring-your-own-storage (BYOS) recordings; for BYOS the response additionally includes - ``blob_uri``, the URI of the recording in the customer's own storage (no SAS) that the customer - downloads with their own credentials. Requires the conversation to have persisted audio - (``store = true``); returns ``404`` when the conversation, item, or its audio was not - persisted. + Retrieves the specified connection together with its credential values. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the item. Required. - :type conversation_id: str - :param item_id: The id of the conversation item whose audio metadata is retrieved. Required. - :type item_id: str - :return: VoiceItemAudioResponse. The VoiceItemAudioResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.VoiceItemAudioResponse + :param name: The friendly name of the connection, provided by the user. Required. + :type name: str + :return: Connection. The Connection is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.Connection :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3590,12 +3978,10 @@ async def get_agent_conversation_item_audio( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.VoiceItemAudioResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.Connection] = kwargs.pop("cls", None) - _request = build_agent_endpoint_conversations_get_agent_conversation_item_audio_request( - agent_name=agent_name, - conversation_id=conversation_id, - item_id=item_id, + _request = build_connections_get_with_credentials_request( + name=name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -3620,45 +4006,52 @@ async def get_agent_conversation_item_audio( 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) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["x-ms-client-request-id"] = self._deserialize( + "str", response.headers.get("x-ms-client-request-id") + ) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.VoiceItemAudioResponse, response.json()) + deserialized = _deserialize(_models.Connection, response.json()) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @distributed_trace_async - async def get_agent_conversation_item_audio_content( # pylint: disable=name-too-long - self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - """Stream a voice agent conversation item's audio. + @distributed_trace + def list( + self, + *, + connection_type: Optional[Union[str, _models.ConnectionType]] = None, + default_connection: Optional[bool] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.Connection"]: + """List connections. - Streams a single conversation item's audio as a WAV (``audio/wav``) byte stream through the - service (no SAS URL). This route serves Foundry-managed storage only. For - bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download - directly from customer storage using the ``blob_uri`` returned by the item's ``/audio`` - metadata route — so this route returns ``409 Conflict`` for BYOS recordings. Returns ``404`` - when the conversation, item, or its audio was not persisted (``store = false``). + Returns the connections available in the current project, optionally filtered by type or + default status. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the item. Required. - :type conversation_id: str - :param item_id: The id of the conversation item whose audio is streamed. Required. - :type item_id: str - :return: AsyncIterator[bytes] - :rtype: AsyncIterator[bytes] + :keyword connection_type: Lists connections of this specific type. Known values are: + "AzureOpenAI", "AzureBlob", "AzureStorageAccount", "CognitiveSearch", "CosmosDB", "ApiKey", + "AppConfig", "AppInsights", "CustomKeys", and "RemoteTool_Preview". Default value is None. + :paramtype connection_type: str or ~azure.ai.projects.models.ConnectionType + :keyword default_connection: Lists connections that are default connections. Default value is + None. + :paramtype default_connection: bool + :return: An iterator like instance of Connection + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.Connection] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Connection]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -3667,83 +4060,110 @@ async def get_agent_conversation_item_audio_content( # pylint: disable=name-too } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + def prepare_request(next_link=None): + if not next_link: - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + _request = build_connections_list_request( + connection_type=connection_type, + default_connection=default_connection, + 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) - _request = build_agent_endpoint_conversations_get_agent_conversation_item_audio_content_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) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_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 - ) + return _request - response = pipeline_response.http_response + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Connection], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - 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, + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - raise HttpResponseError(response=response, model=error) + response = pipeline_response.http_response - response_headers = {} - response_headers["Content-Type"] = self._deserialize("str", response.headers.get("Content-Type")) + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + return pipeline_response - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return AsyncItemPaged(get_next, extract_data) - return deserialized # type: ignore - @distributed_trace_async - async def get_agent_conversation_audio( - self, agent_name: str, conversation_id: str, **kwargs: Any - ) -> _models.VoiceRecordingResponse: - """Get a voice agent conversation's merged recording metadata. +class DatasetsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. - Returns metadata for the whole-call merged stereo recording (user audio on the left channel, - agent audio on the right). The common metadata (format, sample rate, channels, channel layout, - duration) is returned for both Foundry-managed and bring-your-own-storage (BYOS) recordings; - for BYOS the response additionally includes ``blob_uri``, the URI of the recording in the - customer's own storage (no SAS) that the customer downloads with their own credentials. The - recording is built once from the per-turn segments after persistence finalization succeeds. - While the conversation is ``in_progress``, this route returns retriable ``409 Conflict`` with - ``error.code = recording_not_ready`` and a ``Retry-After`` header when retry guidance is - available. When the conversation is ``failed``, it returns terminal ``409 Conflict`` with - ``error.code = recording_unavailable``. For a ``completed`` conversation, metadata is available - subject to the existing BYOS behavior. Requires the conversation to have persisted audio - (``store = true``); otherwise returns ``404``. + Instead, you should access the following operations through + :class:`~azure.ai.projects.aio.AIProjectClient`'s + :attr:`datasets` attribute. + """ - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation whose merged recording metadata is - retrieved. Required. - :type conversation_id: str - :return: VoiceRecordingResponse. The VoiceRecordingResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.VoiceRecordingResponse + 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_versions(self, name: str, **kwargs: Any) -> AsyncItemPaged["_models.DatasetVersion"]: + """List versions. + + List all versions of the given DatasetVersion. + + :param name: The name of the resource. Required. + :type name: str + :return: An iterator like instance of DatasetVersion + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.DatasetVersion] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatasetVersion]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -3752,80 +4172,89 @@ async def get_agent_conversation_audio( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.VoiceRecordingResponse] = kwargs.pop("cls", None) + def prepare_request(next_link=None): + if not next_link: - _request = build_agent_endpoint_conversations_get_agent_conversation_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) + _request = build_datasets_list_versions_request( + name=name, + 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 - ) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_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) - response = pipeline_response.http_response + return _request - 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, + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatasetVersion], + deserialized.get("value", []), ) - raise HttpResponseError(response=response, model=error) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.VoiceRecordingResponse, response.json()) + async def get_next(next_link=None): + _request = prepare_request(next_link) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response - return deserialized # type: ignore + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) - @distributed_trace_async - async def get_agent_conversation_audio_content( - self, agent_name: str, conversation_id: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - """Stream a voice agent conversation's merged recording. + return pipeline_response - Streams the whole-call merged stereo recording as a WAV (``audio/wav``) byte stream through the - service (no SAS URL). This route serves Foundry-managed storage only. For - bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download - directly from customer storage using the ``blob_uri`` returned by the metadata route — so this - route returns ``409 Conflict`` for BYOS recordings. While the conversation is ``in_progress``, - this route returns retriable ``409 Conflict`` with ``error.code = recording_not_ready`` and a - ``Retry-After`` header when retry guidance is available. When the conversation is ``failed``, - it returns terminal ``409 Conflict`` with ``error.code = recording_unavailable``. For a - ``completed`` conversation, content is available subject to the existing BYOS behavior. A - conversation without persisted audio (``store = false``) returns ``404``. + return AsyncItemPaged(get_next, extract_data) - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation whose merged recording is streamed. - Required. - :type conversation_id: str - :return: AsyncIterator[bytes] - :rtype: AsyncIterator[bytes] + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.DatasetVersion"]: + """List latest versions. + + List the latest version of each DatasetVersion. + + :return: An iterator like instance of DatasetVersion + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.DatasetVersion] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatasetVersion]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -3834,82 +4263,86 @@ async def get_agent_conversation_audio_content( } 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) + def prepare_request(next_link=None): + if not next_link: - _request = build_agent_endpoint_conversations_get_agent_conversation_audio_content_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) + _request = build_datasets_list_request( + 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 - ) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_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) - response = pipeline_response.http_response + return _request - 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, + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatasetVersion], + deserialized.get("value", []), ) - 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 + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - return deserialized # type: ignore + async def get_next(next_link=None): + _request = prepare_request(next_link) + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response -class EvaluationRulesOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) - Instead, you should access the following operations through - :class:`~azure.ai.projects.aio.AIProjectClient`'s - :attr:`evaluation_rules` attribute. - """ + return pipeline_response - 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") + return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def get(self, id: str, **kwargs: Any) -> _models.EvaluationRule: - """Get an evaluation rule. + async def get(self, name: str, version: str, **kwargs: Any) -> _models.DatasetVersion: + """Get a version. - Retrieves the specified evaluation rule and its configuration. + Get the specific version of the DatasetVersion. The service returns 404 Not Found error if the + DatasetVersion does not exist. - :param id: Unique identifier for the evaluation rule. Required. - :type id: str - :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationRule + :param name: The name of the resource. Required. + :type name: str + :param version: The specific version id of the DatasetVersion to retrieve. Required. + :type version: str + :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3923,10 +4356,11 @@ async def get(self, id: str, **kwargs: Any) -> _models.EvaluationRule: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.EvaluationRule] = kwargs.pop("cls", None) + cls: ClsType[_models.DatasetVersion] = kwargs.pop("cls", None) - _request = build_evaluation_rules_get_request( - id=id, + _request = build_datasets_get_request( + name=name, + version=version, api_version=self._config.api_version, headers=_headers, params=_params, @@ -3956,7 +4390,7 @@ async def get(self, id: str, **kwargs: Any) -> _models.EvaluationRule: if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.EvaluationRule, response.json()) + deserialized = _deserialize(_models.DatasetVersion, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3964,13 +4398,16 @@ async def get(self, id: str, **kwargs: Any) -> _models.EvaluationRule: return deserialized # type: ignore @distributed_trace_async - async def delete(self, id: str, **kwargs: Any) -> None: - """Delete an evaluation rule. + async def delete(self, name: str, version: str, **kwargs: Any) -> None: + """Delete a version. - Removes the specified evaluation rule from the project. + Delete the specific version of the DatasetVersion. The service returns 204 No Content if the + DatasetVersion was deleted successfully or if the DatasetVersion does not exist. - :param id: Unique identifier for the evaluation rule. Required. - :type id: str + :param name: The name of the resource. Required. + :type name: str + :param version: The version of the DatasetVersion to delete. Required. + :type version: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -3988,8 +4425,9 @@ async def delete(self, id: str, **kwargs: Any) -> None: cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_evaluation_rules_delete_request( - id=id, + _request = build_datasets_delete_request( + name=name, + version=version, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4015,79 +4453,105 @@ async def delete(self, id: str, **kwargs: Any) -> None: @overload async def create_or_update( - self, id: str, evaluation_rule: _models.EvaluationRule, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluationRule: - """Create or update an evaluation rule. - - Creates a new evaluation rule, or replaces the existing rule when the identifier matches. + self, + name: str, + version: str, + dataset_version: _models.DatasetVersion, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> _models.DatasetVersion: + """Create or update a version. - :param id: Unique identifier for the evaluation rule. Required. - :type id: str - :param evaluation_rule: Evaluation rule resource. Required. - :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule + Create a new or update an existing DatasetVersion with the given version id. + + :param name: The name of the resource. Required. + :type name: str + :param version: The specific version id of the DatasetVersion to create or update. Required. + :type version: str + :param dataset_version: The DatasetVersion to create or update. Required. + :type dataset_version: ~azure.ai.projects.models.DatasetVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". + Default value is "application/merge-patch+json". :paramtype content_type: str - :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationRule + :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create_or_update( - self, id: str, evaluation_rule: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluationRule: - """Create or update an evaluation rule. + self, + name: str, + version: str, + dataset_version: JSON, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> _models.DatasetVersion: + """Create or update a version. - Creates a new evaluation rule, or replaces the existing rule when the identifier matches. + Create a new or update an existing DatasetVersion with the given version id. - :param id: Unique identifier for the evaluation rule. Required. - :type id: str - :param evaluation_rule: Evaluation rule resource. Required. - :type evaluation_rule: JSON + :param name: The name of the resource. Required. + :type name: str + :param version: The specific version id of the DatasetVersion to create or update. Required. + :type version: str + :param dataset_version: The DatasetVersion to create or update. Required. + :type dataset_version: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". + Default value is "application/merge-patch+json". :paramtype content_type: str - :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationRule + :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create_or_update( - self, id: str, evaluation_rule: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluationRule: - """Create or update an evaluation rule. + self, + name: str, + version: str, + dataset_version: IO[bytes], + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> _models.DatasetVersion: + """Create or update a version. - Creates a new evaluation rule, or replaces the existing rule when the identifier matches. + Create a new or update an existing DatasetVersion with the given version id. - :param id: Unique identifier for the evaluation rule. Required. - :type id: str - :param evaluation_rule: Evaluation rule resource. Required. - :type evaluation_rule: IO[bytes] + :param name: The name of the resource. Required. + :type name: str + :param version: The specific version id of the DatasetVersion to create or update. Required. + :type version: str + :param dataset_version: The DatasetVersion to create or update. Required. + :type dataset_version: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". + Default value is "application/merge-patch+json". :paramtype content_type: str - :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationRule + :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def create_or_update( - self, id: str, evaluation_rule: Union[_models.EvaluationRule, JSON, IO[bytes]], **kwargs: Any - ) -> _models.EvaluationRule: - """Create or update an evaluation rule. + self, name: str, version: str, dataset_version: Union[_models.DatasetVersion, JSON, IO[bytes]], **kwargs: Any + ) -> _models.DatasetVersion: + """Create or update a version. - Creates a new evaluation rule, or replaces the existing rule when the identifier matches. + Create a new or update an existing DatasetVersion with the given version id. - :param id: Unique identifier for the evaluation rule. Required. - :type id: str - :param evaluation_rule: Evaluation rule resource. Is one of the following types: - EvaluationRule, JSON, IO[bytes] Required. - :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule or JSON or IO[bytes] - :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationRule + :param name: The name of the resource. Required. + :type name: str + :param version: The specific version id of the DatasetVersion to create or update. Required. + :type version: str + :param dataset_version: The DatasetVersion to create or update. Is one of the following types: + DatasetVersion, JSON, IO[bytes] Required. + :type dataset_version: ~azure.ai.projects.models.DatasetVersion or JSON or IO[bytes] + :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4102,17 +4566,18 @@ async def create_or_update( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EvaluationRule] = kwargs.pop("cls", None) + cls: ClsType[_models.DatasetVersion] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/merge-patch+json" _content = None - if isinstance(evaluation_rule, (IOBase, bytes)): - _content = evaluation_rule + if isinstance(dataset_version, (IOBase, bytes)): + _content = dataset_version else: - _content = json.dumps(evaluation_rule, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(dataset_version, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_evaluation_rules_create_or_update_request( - id=id, + _request = build_datasets_create_or_update_request( + name=name, + version=version, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -4144,43 +4609,121 @@ async def create_or_update( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.EvaluationRule, response.json()) + deserialized = _deserialize(_models.DatasetVersion, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace - def list( + @overload + async def pending_upload( self, + name: str, + version: str, + pending_upload_request: _models.PendingUploadRequest, *, - action_type: Optional[Union[str, _models.EvaluationRuleActionType]] = None, - agent_name: Optional[str] = None, - enabled: Optional[bool] = None, + content_type: str = "application/json", **kwargs: Any - ) -> AsyncItemPaged["_models.EvaluationRule"]: - """List evaluation rules. + ) -> _models.PendingUploadResponse: + """Start a pending upload. - Returns the evaluation rules configured for the project, optionally filtered by action type, - agent name, or enabled state. + Initiates a new pending upload or retrieves an existing one for the specified dataset version. - :keyword action_type: Filter by the type of evaluation rule. Known values are: - "continuousEvaluation" and "humanEvaluationPreview". Default value is None. - :paramtype action_type: str or ~azure.ai.projects.models.EvaluationRuleActionType - :keyword agent_name: Filter by the agent name. Default value is None. - :paramtype agent_name: str - :keyword enabled: Filter by the enabled status. Default value is None. - :paramtype enabled: bool - :return: An iterator like instance of EvaluationRule - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.EvaluationRule] + :param name: The name of the resource. Required. + :type name: str + :param version: The specific version id of the DatasetVersion to operate on. Required. + :type version: str + :param pending_upload_request: The pending upload request parameters. Required. + :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.EvaluationRule]] = kwargs.pop("cls", None) + @overload + async def pending_upload( + self, + name: str, + version: str, + pending_upload_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PendingUploadResponse: + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified dataset version. + + :param name: The name of the resource. Required. + :type name: str + :param version: The specific version id of the DatasetVersion to operate on. Required. + :type version: str + :param pending_upload_request: The pending upload request parameters. Required. + :type pending_upload_request: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.PendingUploadResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def pending_upload( + self, + name: str, + version: str, + pending_upload_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PendingUploadResponse: + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified dataset version. + + :param name: The name of the resource. Required. + :type name: str + :param version: The specific version id of the DatasetVersion to operate on. Required. + :type version: str + :param pending_upload_request: The pending upload request parameters. Required. + :type pending_upload_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.PendingUploadResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def pending_upload( + self, + name: str, + version: str, + pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.PendingUploadResponse: + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified dataset version. + :param name: The name of the resource. Required. + :type name: str + :param version: The specific version id of the DatasetVersion to operate on. Required. + :type version: str + :param pending_upload_request: The pending upload request parameters. Is one of the following + types: PendingUploadRequest, JSON, IO[bytes] Required. + :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or JSON or + IO[bytes] + :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.PendingUploadResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -4189,105 +4732,72 @@ def list( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - _request = build_evaluation_rules_list_request( - action_type=action_type, - agent_name=agent_name, - enabled=enabled, - 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) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_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.EvaluationRule], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PendingUploadResponse] = kwargs.pop("cls", None) - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response + content_type = content_type or "application/json" + _content = None + if isinstance(pending_upload_request, (IOBase, bytes)): + _content = pending_upload_request + else: + _content = json.dumps(pending_upload_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + _request = build_datasets_pending_upload_request( + name=name, + version=version, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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 pipeline_response + _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 + ) - return AsyncItemPaged(get_next, extract_data) + 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) + raise HttpResponseError(response=response) -class ConnectionsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.PendingUploadResponse, response.json()) - Instead, you should access the following operations through - :class:`~azure.ai.projects.aio.AIProjectClient`'s - :attr:`connections` attribute. - """ + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore - 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") + return deserialized # type: ignore @distributed_trace_async - async def _get(self, name: str, **kwargs: Any) -> _models.Connection: - """Get a connection. + async def get_credentials(self, name: str, version: str, **kwargs: Any) -> _models.DatasetCredential: + """Get dataset credentials. - Retrieves the specified connection and its configuration details without including credential - values. + Retrieves the SAS credential to access the storage account associated with a dataset version. - :param name: The friendly name of the connection, provided by the user. Required. + :param name: The name of the resource. Required. :type name: str - :return: Connection. The Connection is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Connection + :param version: The specific version id of the DatasetVersion to operate on. Required. + :type version: str + :return: DatasetCredential. The DatasetCredential is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.DatasetCredential :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4301,10 +4811,11 @@ async def _get(self, name: str, **kwargs: Any) -> _models.Connection: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Connection] = kwargs.pop("cls", None) + cls: ClsType[_models.DatasetCredential] = kwargs.pop("cls", None) - _request = build_connections_get_request( + _request = build_datasets_get_credentials_request( name=name, + version=version, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4331,31 +4842,44 @@ async def _get(self, name: str, **kwargs: Any) -> _models.Connection: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - response_headers = {} - response_headers["x-ms-client-request-id"] = self._deserialize( - "str", response.headers.get("x-ms-client-request-id") - ) - if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Connection, response.json()) + deserialized = _deserialize(_models.DatasetCredential, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + +class DeploymentsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.aio.AIProjectClient`'s + :attr:`deployments` 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_async - async def _get_with_credentials(self, name: str, **kwargs: Any) -> _models.Connection: - """Get a connection with credentials. + async def get(self, name: str, **kwargs: Any) -> _models.Deployment: + """Get a deployment. - Retrieves the specified connection together with its credential values. + Retrieves a deployed model. - :param name: The friendly name of the connection, provided by the user. Required. + :param name: Name of the deployment. Required. :type name: str - :return: Connection. The Connection is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Connection + :return: Deployment. The Deployment is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.Deployment :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4369,9 +4893,9 @@ async def _get_with_credentials(self, name: str, **kwargs: Any) -> _models.Conne _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Connection] = kwargs.pop("cls", None) + cls: ClsType[_models.Deployment] = kwargs.pop("cls", None) - _request = build_connections_get_with_credentials_request( + _request = build_deployments_get_request( name=name, api_version=self._config.api_version, headers=_headers, @@ -4407,7 +4931,7 @@ async def _get_with_credentials(self, name: str, **kwargs: Any) -> _models.Conne if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Connection, response.json()) + deserialized = _deserialize(_models.Deployment, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4418,30 +4942,32 @@ async def _get_with_credentials(self, name: str, **kwargs: Any) -> _models.Conne def list( self, *, - connection_type: Optional[Union[str, _models.ConnectionType]] = None, - default_connection: Optional[bool] = None, + model_publisher: Optional[str] = None, + model_name: Optional[str] = None, + deployment_type: Optional[Union[str, _models.DeploymentType]] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.Connection"]: - """List connections. + ) -> AsyncItemPaged["_models.Deployment"]: + """List deployments. - Returns the connections available in the current project, optionally filtered by type or - default status. + Returns the deployed models available in the current project, optionally filtered by publisher, + model name, or deployment type. - :keyword connection_type: Lists connections of this specific type. Known values are: - "AzureOpenAI", "AzureBlob", "AzureStorageAccount", "CognitiveSearch", "CosmosDB", "ApiKey", - "AppConfig", "AppInsights", "CustomKeys", and "RemoteTool_Preview". Default value is None. - :paramtype connection_type: str or ~azure.ai.projects.models.ConnectionType - :keyword default_connection: Lists connections that are default connections. Default value is - None. - :paramtype default_connection: bool - :return: An iterator like instance of Connection - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.Connection] + :keyword model_publisher: Model publisher to filter models by. Default value is None. + :paramtype model_publisher: str + :keyword model_name: Model name (the publisher specific name) to filter models by. Default + value is None. + :paramtype model_name: str + :keyword deployment_type: Type of deployment to filter list by. "ModelDeployment" Default value + is None. + :paramtype deployment_type: str or ~azure.ai.projects.models.DeploymentType + :return: An iterator like instance of Deployment + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.Deployment] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Connection]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Deployment]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4454,9 +4980,10 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_connections_list_request( - connection_type=connection_type, - default_connection=default_connection, + _request = build_deployments_list_request( + model_publisher=model_publisher, + model_name=model_name, + deployment_type=deployment_type, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4496,7 +5023,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.Connection], + List[_models.Deployment], deserialized.get("value", []), ) if cls: @@ -4521,14 +5048,14 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class DatasetsOperations: # pylint: disable=docstring-missing-param +class IndexesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.ai.projects.aio.AIProjectClient`'s - :attr:`datasets` attribute. + :attr:`indexes` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -4539,21 +5066,21 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list_versions(self, name: str, **kwargs: Any) -> AsyncItemPaged["_models.DatasetVersion"]: + def list_versions(self, name: str, **kwargs: Any) -> AsyncItemPaged["_models.Index"]: """List versions. - List all versions of the given DatasetVersion. + List all versions of the given Index. :param name: The name of the resource. Required. :type name: str - :return: An iterator like instance of DatasetVersion - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.DatasetVersion] + :return: An iterator like instance of Index + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.Index] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.DatasetVersion]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Index]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4566,7 +5093,7 @@ def list_versions(self, name: str, **kwargs: Any) -> AsyncItemPaged["_models.Dat def prepare_request(next_link=None): if not next_link: - _request = build_datasets_list_versions_request( + _request = build_indexes_list_versions_request( name=name, api_version=self._config.api_version, headers=_headers, @@ -4607,7 +5134,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.DatasetVersion], + List[_models.Index], deserialized.get("value", []), ) if cls: @@ -4632,19 +5159,19 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def list(self, **kwargs: Any) -> AsyncItemPaged["_models.DatasetVersion"]: + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Index"]: """List latest versions. - List the latest version of each DatasetVersion. + List the latest version of each Index. - :return: An iterator like instance of DatasetVersion - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.DatasetVersion] + :return: An iterator like instance of Index + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.Index] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.DatasetVersion]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Index]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4657,7 +5184,7 @@ def list(self, **kwargs: Any) -> AsyncItemPaged["_models.DatasetVersion"]: def prepare_request(next_link=None): if not next_link: - _request = build_datasets_list_request( + _request = build_indexes_list_request( api_version=self._config.api_version, headers=_headers, params=_params, @@ -4697,7 +5224,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.DatasetVersion], + List[_models.Index], deserialized.get("value", []), ) if cls: @@ -4722,18 +5249,18 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def get(self, name: str, version: str, **kwargs: Any) -> _models.DatasetVersion: + async def get(self, name: str, version: str, **kwargs: Any) -> _models.Index: """Get a version. - Get the specific version of the DatasetVersion. The service returns 404 Not Found error if the - DatasetVersion does not exist. + Get the specific version of the Index. The service returns 404 Not Found error if the Index + does not exist. :param name: The name of the resource. Required. :type name: str - :param version: The specific version id of the DatasetVersion to retrieve. Required. + :param version: The specific version id of the Index to retrieve. Required. :type version: str - :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetVersion + :return: Index. The Index is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.Index :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4747,9 +5274,9 @@ async def get(self, name: str, version: str, **kwargs: Any) -> _models.DatasetVe _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DatasetVersion] = kwargs.pop("cls", None) + cls: ClsType[_models.Index] = kwargs.pop("cls", None) - _request = build_datasets_get_request( + _request = build_indexes_get_request( name=name, version=version, api_version=self._config.api_version, @@ -4781,7 +5308,7 @@ async def get(self, name: str, version: str, **kwargs: Any) -> _models.DatasetVe if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.DatasetVersion, response.json()) + deserialized = _deserialize(_models.Index, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4792,12 +5319,12 @@ async def get(self, name: str, version: str, **kwargs: Any) -> _models.DatasetVe async def delete(self, name: str, version: str, **kwargs: Any) -> None: """Delete a version. - Delete the specific version of the DatasetVersion. The service returns 204 No Content if the - DatasetVersion was deleted successfully or if the DatasetVersion does not exist. + Delete the specific version of the Index. The service returns 204 No Content if the Index was + deleted successfully or if the Index does not exist. :param name: The name of the resource. Required. :type name: str - :param version: The version of the DatasetVersion to delete. Required. + :param version: The version of the Index to delete. Required. :type version: str :return: None :rtype: None @@ -4816,7 +5343,7 @@ async def delete(self, name: str, version: str, **kwargs: Any) -> None: cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_datasets_delete_request( + _request = build_indexes_delete_request( name=name, version=version, api_version=self._config.api_version, @@ -4847,54 +5374,48 @@ async def create_or_update( self, name: str, version: str, - dataset_version: _models.DatasetVersion, + index: _models.Index, *, content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> _models.DatasetVersion: + ) -> _models.Index: """Create or update a version. - Create a new or update an existing DatasetVersion with the given version id. + Create a new or update an existing Index with the given version id. :param name: The name of the resource. Required. :type name: str - :param version: The specific version id of the DatasetVersion to create or update. Required. + :param version: The specific version id of the Index to create or update. Required. :type version: str - :param dataset_version: The DatasetVersion to create or update. Required. - :type dataset_version: ~azure.ai.projects.models.DatasetVersion + :param index: The Index to create or update. Required. + :type index: ~azure.ai.projects.models.Index :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str - :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetVersion + :return: Index. The Index is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.Index :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create_or_update( - self, - name: str, - version: str, - dataset_version: JSON, - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> _models.DatasetVersion: + self, name: str, version: str, index: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any + ) -> _models.Index: """Create or update a version. - Create a new or update an existing DatasetVersion with the given version id. + Create a new or update an existing Index with the given version id. :param name: The name of the resource. Required. :type name: str - :param version: The specific version id of the DatasetVersion to create or update. Required. + :param version: The specific version id of the Index to create or update. Required. :type version: str - :param dataset_version: The DatasetVersion to create or update. Required. - :type dataset_version: JSON + :param index: The Index to create or update. Required. + :type index: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str - :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetVersion + :return: Index. The Index is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.Index :raises ~azure.core.exceptions.HttpResponseError: """ @@ -4903,46 +5424,46 @@ async def create_or_update( self, name: str, version: str, - dataset_version: IO[bytes], + index: IO[bytes], *, content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> _models.DatasetVersion: + ) -> _models.Index: """Create or update a version. - Create a new or update an existing DatasetVersion with the given version id. + Create a new or update an existing Index with the given version id. :param name: The name of the resource. Required. :type name: str - :param version: The specific version id of the DatasetVersion to create or update. Required. + :param version: The specific version id of the Index to create or update. Required. :type version: str - :param dataset_version: The DatasetVersion to create or update. Required. - :type dataset_version: IO[bytes] + :param index: The Index to create or update. Required. + :type index: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/merge-patch+json". :paramtype content_type: str - :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetVersion + :return: Index. The Index is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.Index :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def create_or_update( - self, name: str, version: str, dataset_version: Union[_models.DatasetVersion, JSON, IO[bytes]], **kwargs: Any - ) -> _models.DatasetVersion: + self, name: str, version: str, index: Union[_models.Index, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Index: """Create or update a version. - Create a new or update an existing DatasetVersion with the given version id. + Create a new or update an existing Index with the given version id. :param name: The name of the resource. Required. :type name: str - :param version: The specific version id of the DatasetVersion to create or update. Required. + :param version: The specific version id of the Index to create or update. Required. :type version: str - :param dataset_version: The DatasetVersion to create or update. Is one of the following types: - DatasetVersion, JSON, IO[bytes] Required. - :type dataset_version: ~azure.ai.projects.models.DatasetVersion or JSON or IO[bytes] - :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetVersion + :param index: The Index to create or update. Is one of the following types: Index, JSON, + IO[bytes] Required. + :type index: ~azure.ai.projects.models.Index or JSON or IO[bytes] + :return: Index. The Index is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.Index :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4957,16 +5478,16 @@ async def create_or_update( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DatasetVersion] = kwargs.pop("cls", None) + cls: ClsType[_models.Index] = kwargs.pop("cls", None) content_type = content_type or "application/merge-patch+json" _content = None - if isinstance(dataset_version, (IOBase, bytes)): - _content = dataset_version + if isinstance(index, (IOBase, bytes)): + _content = index else: - _content = json.dumps(dataset_version, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(index, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_datasets_create_or_update_request( + _request = build_indexes_create_or_update_request( name=name, version=version, content_type=content_type, @@ -4988,131 +5509,1688 @@ async def create_or_update( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 201]: + 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) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Index, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ToolboxesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.aio.AIProjectClient`'s + :attr:`toolboxes` 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") + + @overload + async def create_version( + self, + name: str, + *, + tools: List[_models.ToolboxTool], + content_type: str = "application/json", + description: Optional[str] = None, + metadata: Optional[dict[str, str]] = None, + skills: Optional[List[_models.ToolboxSkill]] = None, + policies: Optional[_models.ToolboxPolicies] = None, + **kwargs: Any + ) -> _models.ToolboxVersionObject: + """Create a new version of a toolbox. + + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. + + :param name: The name of the toolbox. If the toolbox does not exist, it will be created. + Required. + :type name: str + :keyword tools: The list of tools to include in this version. Required. + :paramtype tools: list[~azure.ai.projects.models.ToolboxTool] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword description: A human-readable description of the toolbox. Default value is None. + :paramtype description: str + :keyword metadata: Arbitrary key-value metadata to associate with the toolbox. Default value is + None. + :paramtype metadata: dict[str, str] + :keyword skills: The list of skill sources to include in this version. A skill reference + specifies a skill name and optionally a version. If version is omitted, the skill's default + version is used. Default value is None. + :paramtype skills: list[~azure.ai.projects.models.ToolboxSkill] + :keyword policies: Policy configuration for this toolbox version. Default value is None. + :paramtype policies: ~azure.ai.projects.models.ToolboxPolicies + :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxVersionObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_version( + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ToolboxVersionObject: + """Create a new version of a toolbox. + + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. + + :param name: The name of the toolbox. If the toolbox does not exist, it will be created. + Required. + :type name: str + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxVersionObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_version( + self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ToolboxVersionObject: + """Create a new version of a toolbox. + + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. + + :param name: The name of the toolbox. If the toolbox does not exist, it will be created. + Required. + :type name: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxVersionObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_version( + self, + name: str, + body: Union[JSON, IO[bytes]] = _Unset, + *, + tools: List[_models.ToolboxTool] = _Unset, + description: Optional[str] = None, + metadata: Optional[dict[str, str]] = None, + skills: Optional[List[_models.ToolboxSkill]] = None, + policies: Optional[_models.ToolboxPolicies] = None, + **kwargs: Any + ) -> _models.ToolboxVersionObject: + """Create a new version of a toolbox. + + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. + + :param name: The name of the toolbox. If the toolbox does not exist, it will be created. + Required. + :type name: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword tools: The list of tools to include in this version. Required. + :paramtype tools: list[~azure.ai.projects.models.ToolboxTool] + :keyword description: A human-readable description of the toolbox. Default value is None. + :paramtype description: str + :keyword metadata: Arbitrary key-value metadata to associate with the toolbox. Default value is + None. + :paramtype metadata: dict[str, str] + :keyword skills: The list of skill sources to include in this version. A skill reference + specifies a skill name and optionally a version. If version is omitted, the skill's default + version is used. Default value is None. + :paramtype skills: list[~azure.ai.projects.models.ToolboxSkill] + :keyword policies: Policy configuration for this toolbox version. Default value is None. + :paramtype policies: ~azure.ai.projects.models.ToolboxPolicies + :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxVersionObject + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ToolboxVersionObject] = kwargs.pop("cls", None) + + if body is _Unset: + if tools is _Unset: + raise TypeError("missing required argument: tools") + body = { + "description": description, + "metadata": metadata, + "policies": policies, + "skills": skills, + "tools": tools, + } + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_toolboxes_create_version_request( + name=name, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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.ToolboxVersionObject, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get(self, name: str, **kwargs: Any) -> _models.ToolboxObject: + """Retrieve a toolbox. + + Retrieves the specified toolbox and its current configuration. + + :param name: The name of the toolbox to retrieve. Required. + :type name: str + :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxObject + :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.ToolboxObject] = kwargs.pop("cls", None) + + _request = build_toolboxes_get_request( + name=name, + 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.ToolboxObject, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list( + self, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.ToolboxObject"]: + """List toolboxes. + + Returns the toolboxes available in the current project. + + :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 ToolboxObject + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.ToolboxObject] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ToolboxObject]] = 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_toolboxes_list_request( + 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.ToolboxObject], + 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 + def list_versions( + self, + name: str, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.ToolboxVersionObject"]: + """List toolbox versions. + + Returns the available versions for the specified toolbox. + + :param name: The name of the toolbox to list versions for. Required. + :type 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 ToolboxVersionObject + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.ToolboxVersionObject] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ToolboxVersionObject]] = 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_toolboxes_list_versions_request( + name=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.ToolboxVersionObject], + 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_version(self, name: str, version: str, **kwargs: Any) -> _models.ToolboxVersionObject: + """Retrieve a specific version of a toolbox. + + Retrieves the specified version of a toolbox by name and version identifier. + + :param name: The name of the toolbox. Required. + :type name: str + :param version: The version identifier to retrieve. Required. + :type version: str + :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxVersionObject + :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.ToolboxVersionObject] = kwargs.pop("cls", None) + + _request = build_toolboxes_get_version_request( + name=name, + version=version, + 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.ToolboxVersionObject, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update( + self, name: str, *, default_version: str, content_type: str = "application/json", **kwargs: Any + ) -> _models.ToolboxObject: + """Update a toolbox to point to a specific version. + + Updates the toolbox's default version pointer to the specified version. + + :param name: The name of the toolbox to update. Required. + :type name: str + :keyword 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. + :paramtype default_version: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ToolboxObject: + """Update a toolbox to point to a specific version. + + Updates the toolbox's default version pointer to the specified version. + + :param name: The name of the toolbox to update. Required. + :type name: str + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ToolboxObject: + """Update a toolbox to point to a specific version. + + Updates the toolbox's default version pointer to the specified version. + + :param name: The name of the toolbox to update. Required. + :type name: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, default_version: str = _Unset, **kwargs: Any + ) -> _models.ToolboxObject: + """Update a toolbox to point to a specific version. + + Updates the toolbox's default version pointer to the specified version. + + :param name: The name of the toolbox to update. Required. + :type name: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword 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. + :paramtype default_version: str + :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxObject + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ToolboxObject] = kwargs.pop("cls", None) + + if body is _Unset: + if default_version is _Unset: + raise TypeError("missing required argument: default_version") + body = {"default_version": default_version} + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_toolboxes_update_request( + name=name, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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.ToolboxObject, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete(self, name: str, **kwargs: Any) -> None: + """Delete a toolbox. + + Removes the specified toolbox along with all of its versions. + + :param name: The name of the toolbox to delete. Required. + :type name: 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_toolboxes_delete_request( + name=name, + 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_async + async def delete_version(self, name: str, version: str, **kwargs: Any) -> None: + """Delete a specific version of a toolbox. + + Removes the specified version of a toolbox. + + :param name: The name of the toolbox. Required. + :type name: str + :param version: The version identifier to delete. Required. + :type version: 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_toolboxes_delete_version_request( + name=name, + version=version, + 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 + + +class BetaVoiceAgentWebSocketOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.aio.AIProjectClient`'s + :attr:`voice_agent_web_socket` 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_async + async def connect_voice_agent( + self, + agent_name: str, + *, + foundry_features_query: Optional[Literal[_AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW]] = None, + store: Optional[bool] = None, + agent_version_override: Optional[str] = None, + websocket_subprotocol: Optional[Union[str, _models.VoiceAgentWebSocketSubprotocol]] = None, + **kwargs: Any + ) -> None: + """Connect to a voice agent. + + Connects to a voice agent over WebSocket. The client must send an HTTP GET with ``Upgrade: + websocket`` + headers. The optional ``realtime`` subprotocol is the only accepted subprotocol value. Supply + the + ``VoiceAgents=V1Preview`` opt-in through either the ``Foundry-Features`` header or the + ``foundry_features`` + query parameter. + + If the target agent is disabled, the HTTP WebSocket handshake fails before the ``101 Switching + Protocols`` + upgrade. The service returns ``409 Conflict`` using the shared Foundry ``ApiErrorResponse`` + shape with + ``error.code = agent_disabled``. This failure is terminal until the caller enables the agent. + + :param agent_name: The name of the voice agent. Required. + :type agent_name: str + :keyword foundry_features_query: A query alternative to the ``Foundry-Features`` header for + clients that cannot set headers during a + WebSocket handshake. Set this to ``VoiceAgents=V1Preview``. Either this query parameter or the + header is + required. VOICE_AGENTS_V1_PREVIEW. Default value is None. + :paramtype foundry_features_query: str or ~azure.ai.projects.models.VOICE_AGENTS_V1_PREVIEW + :keyword store: Whether to persist the conversation created by this WebSocket session. If + omitted, the service honors the + persisted voice agent definition's configured ``store`` value. If supplied, this value + overrides the + definition's ``store`` setting for this session only. Default value is None. + :paramtype store: bool + :keyword agent_version_override: Selects a specific version of the voice agent for this + session. Default value is None. + :paramtype agent_version_override: str + :keyword websocket_subprotocol: The requested WebSocket subprotocol. Omit this header or + request exactly ``realtime``. "realtime" Default value is None. + :paramtype websocket_subprotocol: str or + ~azure.ai.projects.models.VoiceAgentWebSocketSubprotocol + :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_agent_web_socket_connect_voice_agent_request( + agent_name=agent_name, + foundry_features_query=foundry_features_query, + store=store, + agent_version_override=agent_version_override, + websocket_subprotocol=websocket_subprotocol, + 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 [101]: + 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["Sec-WebSocket-Protocol"] = self._deserialize( + "str", response.headers.get("Sec-WebSocket-Protocol") + ) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + +class BetaAgentEndpointConversationsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.aio.AIProjectClient`'s + :attr:`agent_endpoint_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_agent_conversations( + self, + agent_name: str, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.VoiceConversation"]: + """List voice agent conversations. + + Returns the conversations persisted for the specified voice agent endpoint. Conversations are + present when the session's effective ``store`` setting is ``true``, whether inherited from the + agent definition or enabled by the WebSocket session override. + + :param agent_name: The name of the 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 VoiceConversation + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.VoiceConversation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VoiceConversation]] = 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_agent_endpoint_conversations_list_agent_conversations_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.VoiceConversation], + 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_agent_conversation( + self, agent_name: str, conversation_id: str, **kwargs: Any + ) -> _models.VoiceConversation: + """Get a voice agent conversation. + + Retrieves a single conversation recorded for the specified voice agent endpoint by its id. + Returns ``404`` when the conversation was not persisted (``store = false``) or does not exist. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation to retrieve. Required. + :type conversation_id: str + :return: VoiceConversation. The VoiceConversation is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceConversation + :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.VoiceConversation] = kwargs.pop("cls", None) + + _request = build_beta_agent_endpoint_conversations_get_agent_conversation_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.VoiceConversation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete_agent_conversation(self, agent_name: str, conversation_id: str, **kwargs: Any) -> None: + """Delete a voice agent conversation. + + Deletes a conversation and all of its stored data — responses, items, and any audio (cascade). + This is the customer's explicit data-deletion control for voice conversations. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation to delete. 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_agent_endpoint_conversations_delete_agent_conversation_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_agent_conversation_responses( + 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.VoiceResponse"]: + """List responses in a voice agent conversation. + + Returns a paged collection of the responses (model inference turns) recorded for the specified + conversation. The per-response ``output`` projection may be omitted here; use the + response-items route for the canonical paged output. Returns ``404`` when the conversation was + not persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose responses are listed. 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 VoiceResponse + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.VoiceResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VoiceResponse]] = 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_agent_endpoint_conversations_list_agent_conversation_responses_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.VoiceResponse], + 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_agent_conversation_response( + self, agent_name: str, conversation_id: str, response_id: str, **kwargs: Any + ) -> _models.VoiceResponse: + """Get a voice agent conversation response. + + Retrieves a single response from the specified conversation by its id, including its ``output`` + items, ``usage``, and status. Returns ``404`` when the conversation or response was not + persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the response. Required. + :type conversation_id: str + :param response_id: The id of the response to retrieve. Required. + :type response_id: str + :return: VoiceResponse. The VoiceResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceResponse + :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.VoiceResponse] = kwargs.pop("cls", None) + + _request = build_beta_agent_endpoint_conversations_get_agent_conversation_response_request( + agent_name=agent_name, + conversation_id=conversation_id, + response_id=response_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.VoiceResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_agent_conversation_response_items( + self, + agent_name: str, + conversation_id: str, + response_id: str, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.RealtimeConversationItem"]: + """List items produced by a voice agent conversation response. + + Returns a paged collection of the output items produced by a specific response (the response's + output projection). For the complete ordered conversation history — including user input and + client-created tool outputs — use the conversation items route instead. Returns ``404`` when + the conversation or response was not persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the response. Required. + :type conversation_id: str + :param response_id: The id of the response whose output items are listed. Required. + :type response_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 RealtimeConversationItem + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.RealtimeConversationItem] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.RealtimeConversationItem]] = 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_agent_endpoint_conversations_list_agent_conversation_response_items_request( + agent_name=agent_name, + conversation_id=conversation_id, + response_id=response_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.RealtimeConversationItem], + 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 + def list_agent_conversation_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.RealtimeConversationItem"]: + """List items in a voice agent conversation. + + Returns a paged collection of items — the complete ordered conversation history, including user + input, assistant output, and client-created tool outputs (transcripts + tool events). Returns + ``404`` when the conversation was not persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose items are listed. 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 RealtimeConversationItem + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.RealtimeConversationItem] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.RealtimeConversationItem]] = 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_agent_endpoint_conversations_list_agent_conversation_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.RealtimeConversationItem], + 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_agent_conversation_item( + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.RealtimeConversationItem: + """Get a voice agent conversation item. + + Retrieves a single item from the specified conversation by its id, including its transcript. An + ``input_audio``/``output_audio`` content part indicates that audio is available for the item; + the canonical per-item audio metadata is the ``/items/{item_id}/audio`` resource, and the bytes + are streamed by ``/items/{item_id}/audio/content``. Returns ``404`` when the conversation or + item was not persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item to retrieve. Required. + :type item_id: str + :return: RealtimeConversationItem. The RealtimeConversationItem is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.RealtimeConversationItem + :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.RealtimeConversationItem] = kwargs.pop("cls", None) + + _request = build_beta_agent_endpoint_conversations_get_agent_conversation_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) - raise HttpResponseError(response=response) + 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.DatasetVersion, response.json()) + deserialized = _deserialize(_models.RealtimeConversationItem, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @overload - async def pending_upload( - self, - name: str, - version: str, - pending_upload_request: _models.PendingUploadRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PendingUploadResponse: - """Start a pending upload. - - Initiates a new pending upload or retrieves an existing one for the specified dataset version. - - :param name: The name of the resource. Required. - :type name: str - :param version: The specific version id of the DatasetVersion to operate on. Required. - :type version: str - :param pending_upload_request: The pending upload request parameters. Required. - :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def pending_upload( - self, - name: str, - version: str, - pending_upload_request: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PendingUploadResponse: - """Start a pending upload. - - Initiates a new pending upload or retrieves an existing one for the specified dataset version. - - :param name: The name of the resource. Required. - :type name: str - :param version: The specific version id of the DatasetVersion to operate on. Required. - :type version: str - :param pending_upload_request: The pending upload request parameters. Required. - :type pending_upload_request: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def pending_upload( - self, - name: str, - version: str, - pending_upload_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PendingUploadResponse: - """Start a pending upload. - - Initiates a new pending upload or retrieves an existing one for the specified dataset version. - - :param name: The name of the resource. Required. - :type name: str - :param version: The specific version id of the DatasetVersion to operate on. Required. - :type version: str - :param pending_upload_request: The pending upload request parameters. Required. - :type pending_upload_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace_async - async def pending_upload( - self, - name: str, - version: str, - pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.PendingUploadResponse: - """Start a pending upload. + async def get_agent_conversation_item_audio( + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.VoiceItemAudioResponse: + """Get a voice agent conversation item's audio metadata. - Initiates a new pending upload or retrieves an existing one for the specified dataset version. + Returns metadata for a single conversation item's audio segment, including the common playback + facts (role, format/codec, sample rate, channels, offset, duration) for both Foundry-managed + and bring-your-own-storage (BYOS) recordings; for BYOS the response additionally includes + ``blob_uri``, the URI of the recording in the customer's own storage (no SAS) that the customer + downloads with their own credentials. Requires the conversation to have persisted audio + (``store = true``); returns ``404`` when the conversation, item, or its audio was not + persisted. - :param name: The name of the resource. Required. - :type name: str - :param version: The specific version id of the DatasetVersion to operate on. Required. - :type version: str - :param pending_upload_request: The pending upload request parameters. Is one of the following - types: PendingUploadRequest, JSON, IO[bytes] Required. - :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or JSON or - IO[bytes] - :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose audio metadata is retrieved. Required. + :type item_id: str + :return: VoiceItemAudioResponse. The VoiceItemAudioResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceItemAudioResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5123,25 +7201,16 @@ async def pending_upload( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PendingUploadResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(pending_upload_request, (IOBase, bytes)): - _content = pending_upload_request - else: - _content = json.dumps(pending_upload_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.VoiceItemAudioResponse] = kwargs.pop("cls", None) - _request = build_datasets_pending_upload_request( - name=name, - version=version, - content_type=content_type, + _request = build_beta_agent_endpoint_conversations_get_agent_conversation_item_audio_request( + agent_name=agent_name, + conversation_id=conversation_id, + item_id=item_id, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -5165,12 +7234,16 @@ async def pending_upload( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + 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.PendingUploadResponse, response.json()) + deserialized = _deserialize(_models.VoiceItemAudioResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -5178,17 +7251,26 @@ async def pending_upload( return deserialized # type: ignore @distributed_trace_async - async def get_credentials(self, name: str, version: str, **kwargs: Any) -> _models.DatasetCredential: - """Get dataset credentials. + async def get_agent_conversation_item_audio_content( # pylint: disable=name-too-long + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + """Stream a voice agent conversation item's audio. - Retrieves the SAS credential to access the storage account associated with a dataset version. + Streams a single conversation item's audio as a WAV (``audio/wav``) byte stream through the + service (no SAS URL). This route serves Foundry-managed storage only. For + bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download + directly from customer storage using the ``blob_uri`` returned by the item's ``/audio`` + metadata route — so this route returns ``409 Conflict`` for BYOS recordings. Returns ``404`` + when the conversation, item, or its audio was not persisted (``store = false``). - :param name: The name of the resource. Required. - :type name: str - :param version: The specific version id of the DatasetVersion to operate on. Required. - :type version: str - :return: DatasetCredential. The DatasetCredential is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetCredential + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose audio is streamed. Required. + :type item_id: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5202,11 +7284,12 @@ async def get_credentials(self, name: str, version: str, **kwargs: Any) -> _mode _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DatasetCredential] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_datasets_get_credentials_request( - name=name, - version=version, + _request = build_beta_agent_endpoint_conversations_get_agent_conversation_item_audio_content_request( + agent_name=agent_name, + conversation_id=conversation_id, + item_id=item_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5217,7 +7300,7 @@ async def get_credentials(self, name: str, version: str, **kwargs: Any) -> _mode _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = kwargs.pop("stream", True) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -5231,46 +7314,48 @@ async def get_credentials(self, name: str, version: str, **kwargs: Any) -> _mode except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + 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.DatasetCredential, response.json()) + 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, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - -class DeploymentsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.projects.aio.AIProjectClient`'s - :attr:`deployments` 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_async - async def get(self, name: str, **kwargs: Any) -> _models.Deployment: - """Get a deployment. + async def get_agent_conversation_audio( + self, agent_name: str, conversation_id: str, **kwargs: Any + ) -> _models.VoiceRecordingResponse: + """Get a voice agent conversation's merged recording metadata. - Retrieves a deployed model. + Returns metadata for the whole-call merged stereo recording (user audio on the left channel, + agent audio on the right). The common metadata (format, sample rate, channels, channel layout, + duration) is returned for both Foundry-managed and bring-your-own-storage (BYOS) recordings; + for BYOS the response additionally includes ``blob_uri``, the URI of the recording in the + customer's own storage (no SAS) that the customer downloads with their own credentials. The + recording is built once from the per-turn segments after persistence finalization succeeds. + While the conversation is ``in_progress``, this route returns retriable ``409 Conflict`` with + ``error.code = recording_not_ready`` and a ``Retry-After`` header when retry guidance is + available. When the conversation is ``failed``, it returns terminal ``409 Conflict`` with + ``error.code = recording_unavailable``. For a ``completed`` conversation, metadata is available + subject to the existing BYOS behavior. Requires the conversation to have persisted audio + (``store = true``); otherwise returns ``404``. - :param name: Name of the deployment. Required. - :type name: str - :return: Deployment. The Deployment is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Deployment + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose merged recording metadata is + retrieved. Required. + :type conversation_id: str + :return: VoiceRecordingResponse. The VoiceRecordingResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceRecordingResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5284,10 +7369,11 @@ async def get(self, name: str, **kwargs: Any) -> _models.Deployment: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Deployment] = kwargs.pop("cls", None) + cls: ClsType[_models.VoiceRecordingResponse] = kwargs.pop("cls", None) - _request = build_deployments_get_request( - name=name, + _request = build_beta_agent_endpoint_conversations_get_agent_conversation_audio_request( + agent_name=agent_name, + conversation_id=conversation_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5312,54 +7398,48 @@ async def get(self, name: str, **kwargs: Any) -> _models.Deployment: except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["x-ms-client-request-id"] = self._deserialize( - "str", response.headers.get("x-ms-client-request-id") - ) + 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.Deployment, response.json()) + deserialized = _deserialize(_models.VoiceRecordingResponse, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace - def list( - self, - *, - model_publisher: Optional[str] = None, - model_name: Optional[str] = None, - deployment_type: Optional[Union[str, _models.DeploymentType]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.Deployment"]: - """List deployments. + @distributed_trace_async + async def get_agent_conversation_audio_content( + self, agent_name: str, conversation_id: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + """Stream a voice agent conversation's merged recording. - Returns the deployed models available in the current project, optionally filtered by publisher, - model name, or deployment type. + Streams the whole-call merged stereo recording as a WAV (``audio/wav``) byte stream through the + service (no SAS URL). This route serves Foundry-managed storage only. For + bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download + directly from customer storage using the ``blob_uri`` returned by the metadata route — so this + route returns ``409 Conflict`` for BYOS recordings. While the conversation is ``in_progress``, + this route returns retriable ``409 Conflict`` with ``error.code = recording_not_ready`` and a + ``Retry-After`` header when retry guidance is available. When the conversation is ``failed``, + it returns terminal ``409 Conflict`` with ``error.code = recording_unavailable``. For a + ``completed`` conversation, content is available subject to the existing BYOS behavior. A + conversation without persisted audio (``store = false``) returns ``404``. - :keyword model_publisher: Model publisher to filter models by. Default value is None. - :paramtype model_publisher: str - :keyword model_name: Model name (the publisher specific name) to filter models by. Default - value is None. - :paramtype model_name: str - :keyword deployment_type: Type of deployment to filter list by. "ModelDeployment" Default value - is None. - :paramtype deployment_type: str or ~azure.ai.projects.models.DeploymentType - :return: An iterator like instance of Deployment - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.Deployment] + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose merged recording is streamed. + Required. + :type conversation_id: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Deployment]] = kwargs.pop("cls", None) - error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -5368,85 +7448,63 @@ def list( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_deployments_list_request( - model_publisher=model_publisher, - model_name=model_name, - deployment_type=deployment_type, - 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) + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_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) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - return _request + _request = build_beta_agent_endpoint_conversations_get_agent_conversation_audio_content_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) - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Deployment], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + _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 + ) - async def get_next(next_link=None): - _request = prepare_request(next_link) + response = pipeline_response.http_response - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + 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, ) - response = pipeline_response.http_response + raise HttpResponseError(response=response, model=error) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + response_headers = {} + response_headers["Content-Type"] = self._deserialize("str", response.headers.get("Content-Type")) - return pipeline_response + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - return AsyncItemPaged(get_next, extract_data) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore -class IndexesOperations: # pylint: disable=docstring-missing-param +class BetaAgentInsightMonitorsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.ai.projects.aio.AIProjectClient`'s - :attr:`indexes` attribute. + :attr:`agent_insight_monitors` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -5457,21 +7515,36 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list_versions(self, name: str, **kwargs: Any) -> AsyncItemPaged["_models.Index"]: - """List versions. - - List all versions of the given Index. + def list( + self, + *, + before: Optional[str] = None, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + agent_name: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.AgentInsightMonitorListItem"]: + """List Agent Insights monitors, optionally filtered by agent name. - :param name: The name of the resource. Required. - :type name: str - :return: An iterator like instance of Index - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.Index] + :keyword before: A cursor that identifies the first item in the next page. Default value is + None. + :paramtype before: str + :keyword limit: The maximum number of items to return. Defaults to 20. Default value is None. + :paramtype limit: int + :keyword order: Sort order by creation time. Defaults to descending. Known values are: "asc" + and "desc". Default value is None. + :paramtype order: str or ~azure.ai.projects.models.PageOrder + :keyword agent_name: Filter monitors by agent name. Default value is None. + :paramtype agent_name: str + :return: An iterator like instance of AgentInsightMonitorListItem + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.AgentInsightMonitorListItem] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Index]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.AgentInsightMonitorListItem]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5481,59 +7554,36 @@ def list_versions(self, name: str, **kwargs: Any) -> AsyncItemPaged["_models.Ind } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_indexes_list_versions_request( - name=name, - 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) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_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) + def prepare_request(_continuation_token=None): + _request = build_beta_agent_insight_monitors_list_request( + after=_continuation_token, + before=before, + limit=limit, + order=order, + agent_name=agent_name, + 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.Index], - deserialized.get("value", []), + List[_models.AgentInsightMonitorListItem], + deserialized.get("data", []), ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) + 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 @@ -5543,27 +7593,77 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) return pipeline_response return AsyncItemPaged(get_next, extract_data) - @distributed_trace - def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Index"]: - """List latest versions. + @overload + async def create( + self, monitor: _models.AgentInsightMonitorCreate, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AgentInsightMonitor: + """Create an Agent Insights monitor for an agent. - List the latest version of each Index. + :param monitor: The monitor to create. Required. + :type monitor: ~azure.ai.projects.models.AgentInsightMonitorCreate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AgentInsightMonitor. The AgentInsightMonitor is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsightMonitor + :raises ~azure.core.exceptions.HttpResponseError: + """ - :return: An iterator like instance of Index - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.Index] + @overload + async def create( + self, monitor: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AgentInsightMonitor: + """Create an Agent Insights monitor for an agent. + + :param monitor: The monitor to create. Required. + :type monitor: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AgentInsightMonitor. The AgentInsightMonitor is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsightMonitor :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Index]] = kwargs.pop("cls", None) + @overload + async def create( + self, monitor: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AgentInsightMonitor: + """Create an Agent Insights monitor for an agent. + + :param monitor: The monitor to create. Required. + :type monitor: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AgentInsightMonitor. The AgentInsightMonitor is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsightMonitor + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create( + self, monitor: Union[_models.AgentInsightMonitorCreate, JSON, IO[bytes]], **kwargs: Any + ) -> _models.AgentInsightMonitor: + """Create an Agent Insights monitor for an agent. + :param monitor: The monitor to create. Is one of the following types: + AgentInsightMonitorCreate, JSON, IO[bytes] Required. + :type monitor: ~azure.ai.projects.models.AgentInsightMonitorCreate or JSON or IO[bytes] + :return: AgentInsightMonitor. The AgentInsightMonitor is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsightMonitor + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -5572,86 +7672,73 @@ def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Index"]: } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - _request = build_indexes_list_request( - 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) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AgentInsightMonitor] = kwargs.pop("cls", None) - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_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) + content_type = content_type or "application/json" + _content = None + if isinstance(monitor, (IOBase, bytes)): + _content = monitor + else: + _content = json.dumps(monitor, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - return _request + _request = build_beta_agent_insight_monitors_create_request( + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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) - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Index], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + _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 + ) - async def get_next(next_link=None): - _request = prepare_request(next_link) + response = pipeline_response.http_response - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + if response.status_code not in [201]: + 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, ) - response = pipeline_response.http_response + raise HttpResponseError(response=response, model=error) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - return pipeline_response + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.AgentInsightMonitor, response.json()) - return AsyncItemPaged(get_next, extract_data) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore - @distributed_trace_async - async def get(self, name: str, version: str, **kwargs: Any) -> _models.Index: - """Get a version. + return deserialized # type: ignore - Get the specific version of the Index. The service returns 404 Not Found error if the Index - does not exist. + @distributed_trace_async + async def get(self, monitor_id: str, **kwargs: Any) -> _models.AgentInsightMonitor: + """Get an Agent Insights monitor. - :param name: The name of the resource. Required. - :type name: str - :param version: The specific version id of the Index to retrieve. Required. - :type version: str - :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :return: AgentInsightMonitor. The AgentInsightMonitor is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsightMonitor :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5665,11 +7752,10 @@ async def get(self, name: str, version: str, **kwargs: Any) -> _models.Index: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Index] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentInsightMonitor] = kwargs.pop("cls", None) - _request = build_indexes_get_request( - name=name, - version=version, + _request = build_beta_agent_insight_monitors_get_request( + monitor_id=monitor_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5694,12 +7780,16 @@ async def get(self, name: str, version: str, **kwargs: Any) -> _models.Index: except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + 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.Index, response.json()) + deserialized = _deserialize(_models.AgentInsightMonitor, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -5707,16 +7797,11 @@ async def get(self, name: str, version: str, **kwargs: Any) -> _models.Index: return deserialized # type: ignore @distributed_trace_async - async def delete(self, name: str, version: str, **kwargs: Any) -> None: - """Delete a version. - - Delete the specific version of the Index. The service returns 204 No Content if the Index was - deleted successfully or if the Index does not exist. + async def delete(self, monitor_id: str, **kwargs: Any) -> None: + """Delete an Agent Insights monitor and all of its runs, insights, and state. - :param name: The name of the resource. Required. - :type name: str - :param version: The version of the Index to delete. Required. - :type version: str + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -5734,9 +7819,8 @@ async def delete(self, name: str, version: str, **kwargs: Any) -> None: cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_indexes_delete_request( - name=name, - version=version, + _request = build_beta_agent_insight_monitors_delete_request( + monitor_id=monitor_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5755,106 +7839,87 @@ async def delete(self, name: str, version: str, **kwargs: Any) -> None: if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) if cls: return cls(pipeline_response, None, {}) # type: ignore @overload - async def create_or_update( + async def update( self, - name: str, - version: str, - index: _models.Index, + monitor_id: str, + monitor: _models.AgentInsightMonitorUpdate, *, content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> _models.Index: - """Create or update a version. - - Create a new or update an existing Index with the given version id. + ) -> _models.AgentInsightMonitor: + """Update an Agent Insights monitor. - :param name: The name of the resource. Required. - :type name: str - :param version: The specific version id of the Index to create or update. Required. - :type version: str - :param index: The Index to create or update. Required. - :type index: ~azure.ai.projects.models.Index + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :param monitor: The monitor fields to update. Required. + :type monitor: ~azure.ai.projects.models.AgentInsightMonitorUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str - :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :return: AgentInsightMonitor. The AgentInsightMonitor is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsightMonitor :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def create_or_update( - self, name: str, version: str, index: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> _models.Index: - """Create or update a version. - - Create a new or update an existing Index with the given version id. - - :param name: The name of the resource. Required. - :type name: str - :param version: The specific version id of the Index to create or update. Required. - :type version: str - :param index: The Index to create or update. Required. - :type index: JSON + async def update( + self, monitor_id: str, monitor: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any + ) -> _models.AgentInsightMonitor: + """Update an Agent Insights monitor. + + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :param monitor: The monitor fields to update. Required. + :type monitor: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str - :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :return: AgentInsightMonitor. The AgentInsightMonitor is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsightMonitor :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def create_or_update( - self, - name: str, - version: str, - index: IO[bytes], - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> _models.Index: - """Create or update a version. - - Create a new or update an existing Index with the given version id. - - :param name: The name of the resource. Required. - :type name: str - :param version: The specific version id of the Index to create or update. Required. - :type version: str - :param index: The Index to create or update. Required. - :type index: IO[bytes] + async def update( + self, monitor_id: str, monitor: IO[bytes], *, content_type: str = "application/merge-patch+json", **kwargs: Any + ) -> _models.AgentInsightMonitor: + """Update an Agent Insights monitor. + + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :param monitor: The monitor fields to update. Required. + :type monitor: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/merge-patch+json". :paramtype content_type: str - :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :return: AgentInsightMonitor. The AgentInsightMonitor is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsightMonitor :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, name: str, version: str, index: Union[_models.Index, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Index: - """Create or update a version. - - Create a new or update an existing Index with the given version id. - - :param name: The name of the resource. Required. - :type name: str - :param version: The specific version id of the Index to create or update. Required. - :type version: str - :param index: The Index to create or update. Is one of the following types: Index, JSON, - IO[bytes] Required. - :type index: ~azure.ai.projects.models.Index or JSON or IO[bytes] - :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + """ + + @distributed_trace_async + async def update( + self, monitor_id: str, monitor: Union[_models.AgentInsightMonitorUpdate, JSON, IO[bytes]], **kwargs: Any + ) -> _models.AgentInsightMonitor: + """Update an Agent Insights monitor. + + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :param monitor: The monitor fields to update. Is one of the following types: + AgentInsightMonitorUpdate, JSON, IO[bytes] Required. + :type monitor: ~azure.ai.projects.models.AgentInsightMonitorUpdate or JSON or IO[bytes] + :return: AgentInsightMonitor. The AgentInsightMonitor is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsightMonitor :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5869,18 +7934,17 @@ async def create_or_update( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Index] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentInsightMonitor] = kwargs.pop("cls", None) content_type = content_type or "application/merge-patch+json" _content = None - if isinstance(index, (IOBase, bytes)): - _content = index + if isinstance(monitor, (IOBase, bytes)): + _content = monitor else: - _content = json.dumps(index, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(monitor, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_indexes_create_or_update_request( - name=name, - version=version, + _request = build_beta_agent_insight_monitors_update_request( + monitor_id=monitor_id, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -5900,163 +7964,396 @@ async def create_or_update( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + 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) - raise HttpResponseError(response=response) + 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.Index, response.json()) + deserialized = _deserialize(_models.AgentInsightMonitor, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + @distributed_trace_async + async def reset(self, monitor_id: str, **kwargs: Any) -> None: + """Reset an Agent Insights monitor's overview, checkpoint, and active insight state. -class ToolboxesOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. + :param monitor_id: The identifier of the monitor. Required. + :type monitor_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 {}) - Instead, you should access the following operations through - :class:`~azure.ai.projects.aio.AIProjectClient`'s - :attr:`toolboxes` attribute. - """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - 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") + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_beta_agent_insight_monitors_reset_request( + monitor_id=monitor_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 + + async def _create_run_initial( + self, monitor_id: str, run: Union[_models.AgentInsightRunCreate, JSON, IO[bytes]], **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(run, (IOBase, bytes)): + _content = run + else: + _content = json.dumps(run, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_beta_agent_insight_monitors_create_run_request( + monitor_id=monitor_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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 = 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 [201]: + 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["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + 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 @overload - async def create_version( + async def begin_create_run( self, - name: str, + monitor_id: str, + run: _models.AgentInsightRunCreate, *, - tools: List[_models.ToolboxTool], content_type: str = "application/json", - description: Optional[str] = None, - metadata: Optional[dict[str, str]] = None, - skills: Optional[List[_models.ToolboxSkill]] = None, - policies: Optional[_models.ToolboxPolicies] = None, **kwargs: Any - ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. + ) -> AsyncLROPoller[_models.AgentInsightRunResult]: + """Start an Agent Insights run for a monitor. - Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :param run: Run inputs. Send an empty object to use the default 168-hour lookback window. + Required. + :type run: ~azure.ai.projects.models.AgentInsightRunCreate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns AgentInsightRunResult. The + AgentInsightRunResult is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.AgentInsightRunResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ - :param name: The name of the toolbox. If the toolbox does not exist, it will be created. + @overload + async def begin_create_run( + self, monitor_id: str, run: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> AsyncLROPoller[_models.AgentInsightRunResult]: + """Start an Agent Insights run for a monitor. + + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :param run: Run inputs. Send an empty object to use the default 168-hour lookback window. Required. - :type name: str - :keyword tools: The list of tools to include in this version. Required. - :paramtype tools: list[~azure.ai.projects.models.ToolboxTool] + :type run: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword description: A human-readable description of the toolbox. Default value is None. - :paramtype description: str - :keyword metadata: Arbitrary key-value metadata to associate with the toolbox. Default value is + :return: An instance of AsyncLROPoller that returns AgentInsightRunResult. The + AgentInsightRunResult is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.AgentInsightRunResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_run( + self, monitor_id: str, run: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> AsyncLROPoller[_models.AgentInsightRunResult]: + """Start an Agent Insights run for a monitor. + + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :param run: Run inputs. Send an empty object to use the default 168-hour lookback window. + Required. + :type run: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns AgentInsightRunResult. The + AgentInsightRunResult is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.AgentInsightRunResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_run( + self, monitor_id: str, run: Union[_models.AgentInsightRunCreate, JSON, IO[bytes]], **kwargs: Any + ) -> AsyncLROPoller[_models.AgentInsightRunResult]: + """Start an Agent Insights run for a monitor. + + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :param run: Run inputs. Send an empty object to use the default 168-hour lookback window. Is + one of the following types: AgentInsightRunCreate, JSON, IO[bytes] Required. + :type run: ~azure.ai.projects.models.AgentInsightRunCreate or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns AgentInsightRunResult. The + AgentInsightRunResult is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.AgentInsightRunResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AgentInsightRunResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_run_initial( + monitor_id=monitor_id, + run=run, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Operation-Location"] = self._deserialize( + "str", response.headers.get("Operation-Location") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = _deserialize(_models.AgentInsightRunResult, response.json().get("result", {})) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AgentInsightRunResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AgentInsightRunResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_runs( + self, + monitor_id: str, + *, + before: Optional[str] = None, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + status: Optional[Union[str, _models.JobStatus]] = None, + trigger: Optional[Union[str, _models.AgentInsightRunTrigger]] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.AgentInsightRun"]: + """List Agent Insights runs for a monitor. + + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :keyword before: A cursor that identifies the first item in the next page. Default value is None. - :paramtype metadata: dict[str, str] - :keyword skills: The list of skill sources to include in this version. A skill reference - specifies a skill name and optionally a version. If version is omitted, the skill's default - version is used. Default value is None. - :paramtype skills: list[~azure.ai.projects.models.ToolboxSkill] - :keyword policies: Policy configuration for this toolbox version. Default value is None. - :paramtype policies: ~azure.ai.projects.models.ToolboxPolicies - :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxVersionObject + :paramtype before: str + :keyword limit: The maximum number of items to return. Defaults to 20. Default value is None. + :paramtype limit: int + :keyword order: Sort order by creation time. Defaults to descending. Known values are: "asc" + and "desc". Default value is None. + :paramtype order: str or ~azure.ai.projects.models.PageOrder + :keyword status: Filter runs by status. Known values are: "queued", "in_progress", "succeeded", + "failed", and "cancelled". Default value is None. + :paramtype status: str or ~azure.ai.projects.models.JobStatus + :keyword trigger: Filter runs by trigger. Known values are: "on_demand" and "scheduled". + Default value is None. + :paramtype trigger: str or ~azure.ai.projects.models.AgentInsightRunTrigger + :return: An iterator like instance of AgentInsightRun + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.AgentInsightRun] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AgentInsightRun]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - @overload - async def create_version( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. + def prepare_request(_continuation_token=None): - Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. + _request = build_beta_agent_insight_monitors_list_runs_request( + monitor_id=monitor_id, + after=_continuation_token, + before=before, + limit=limit, + order=order, + status=status, + trigger=trigger, + 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 - :param name: The name of the toolbox. If the toolbox does not exist, it will be created. - Required. - :type name: str - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxVersionObject - :raises ~azure.core.exceptions.HttpResponseError: - """ + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.AgentInsightRun], + 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) - @overload - async def create_version( - self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. + async def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) - Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response - :param name: The name of the toolbox. If the toolbox does not exist, it will be created. - Required. - :type name: str - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxVersionObject - :raises ~azure.core.exceptions.HttpResponseError: - """ + 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) - @distributed_trace_async - async def create_version( - self, - name: str, - body: Union[JSON, IO[bytes]] = _Unset, - *, - tools: List[_models.ToolboxTool] = _Unset, - description: Optional[str] = None, - metadata: Optional[dict[str, str]] = None, - skills: Optional[List[_models.ToolboxSkill]] = None, - policies: Optional[_models.ToolboxPolicies] = None, - **kwargs: Any - ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. + return pipeline_response - Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. + return AsyncItemPaged(get_next, extract_data) - :param name: The name of the toolbox. If the toolbox does not exist, it will be created. - Required. - :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword tools: The list of tools to include in this version. Required. - :paramtype tools: list[~azure.ai.projects.models.ToolboxTool] - :keyword description: A human-readable description of the toolbox. Default value is None. - :paramtype description: str - :keyword metadata: Arbitrary key-value metadata to associate with the toolbox. Default value is - None. - :paramtype metadata: dict[str, str] - :keyword skills: The list of skill sources to include in this version. A skill reference - specifies a skill name and optionally a version. If version is omitted, the skill's default - version is used. Default value is None. - :paramtype skills: list[~azure.ai.projects.models.ToolboxSkill] - :keyword policies: Policy configuration for this toolbox version. Default value is None. - :paramtype policies: ~azure.ai.projects.models.ToolboxPolicies - :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxVersionObject + @distributed_trace_async + async def get_run(self, monitor_id: str, run_id: str, **kwargs: Any) -> _models.AgentInsightRun: + """Get an Agent Insights run. + + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :param run_id: The identifier of the run. Required. + :type run_id: str + :return: AgentInsightRun. The AgentInsightRun is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsightRun :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6067,35 +8364,15 @@ async def create_version( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ToolboxVersionObject] = kwargs.pop("cls", None) - - if body is _Unset: - if tools is _Unset: - raise TypeError("missing required argument: tools") - body = { - "description": description, - "metadata": metadata, - "policies": policies, - "skills": skills, - "tools": tools, - } - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.AgentInsightRun] = kwargs.pop("cls", None) - _request = build_toolboxes_create_version_request( - name=name, - content_type=content_type, + _request = build_beta_agent_insight_monitors_get_run_request( + monitor_id=monitor_id, + run_id=run_id, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -6128,7 +8405,7 @@ async def create_version( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ToolboxVersionObject, response.json()) + deserialized = _deserialize(_models.AgentInsightRun, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -6136,15 +8413,15 @@ async def create_version( return deserialized # type: ignore @distributed_trace_async - async def get(self, name: str, **kwargs: Any) -> _models.ToolboxObject: - """Retrieve a toolbox. - - Retrieves the specified toolbox and its current configuration. + async def cancel_run(self, monitor_id: str, run_id: str, **kwargs: Any) -> _models.AgentInsightRun: + """Cancel an Agent Insights run. - :param name: The name of the toolbox to retrieve. Required. - :type name: str - :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxObject + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :param run_id: The identifier of the run. Required. + :type run_id: str + :return: AgentInsightRun. The AgentInsightRun is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsightRun :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6158,10 +8435,11 @@ async def get(self, name: str, **kwargs: Any) -> _models.ToolboxObject: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ToolboxObject] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentInsightRun] = kwargs.pop("cls", None) - _request = build_toolboxes_get_request( - name=name, + _request = build_beta_agent_insight_monitors_cancel_run_request( + monitor_id=monitor_id, + run_id=run_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -6195,7 +8473,7 @@ async def get(self, name: str, **kwargs: Any) -> _models.ToolboxObject: if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ToolboxObject, response.json()) + deserialized = _deserialize(_models.AgentInsightRun, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -6203,135 +8481,50 @@ async def get(self, name: str, **kwargs: Any) -> _models.ToolboxObject: return deserialized # type: ignore @distributed_trace - def list( - self, - *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.ToolboxObject"]: - """List toolboxes. - - Returns the toolboxes available in the current project. - - :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 ToolboxObject - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.ToolboxObject] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ToolboxObject]] = 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_toolboxes_list_request( - 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.ToolboxObject], - 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 - def list_versions( + def list_insights( self, - name: str, + monitor_id: str, *, + before: Optional[str] = None, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, + category: Optional[str] = None, + severity: Optional[Union[str, _models.AgentInsightSeverity]] = None, + status: Optional[Union[str, _models.AgentInsightStatus]] = None, + include_details: Optional[bool] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.ToolboxVersionObject"]: - """List toolbox versions. + ) -> AsyncItemPaged["_models.AgentInsight"]: + """List current insights for an Agent Insights monitor. - Returns the available versions for the specified toolbox. - - :param name: The name of the toolbox to list versions for. Required. - :type 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. + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :keyword before: A cursor that identifies the first item in the next page. Default value is + None. + :paramtype before: str + :keyword limit: The maximum number of items to return. Defaults to 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. + :keyword order: Sort order by creation time. Defaults to descending. 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. + :keyword category: Filter insights by category. Default value is None. + :paramtype category: str + :keyword severity: Filter insights by severity. Known values are: "high", "medium", and "low". Default value is None. - :paramtype before: str - :return: An iterator like instance of ToolboxVersionObject - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.ToolboxVersionObject] + :paramtype severity: str or ~azure.ai.projects.models.AgentInsightSeverity + :keyword status: Filter insights by lifecycle status. Known values are: "active", "resolved", + and "ignored". Default value is None. + :paramtype status: str or ~azure.ai.projects.models.AgentInsightStatus + :keyword include_details: Whether to include expanded insight details such as evidence and run + links in the response. Defaults to false. Default value is None. + :paramtype include_details: bool + :return: An iterator like instance of AgentInsight + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.AgentInsight] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ToolboxVersionObject]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.AgentInsight]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -6343,12 +8536,16 @@ def list_versions( def prepare_request(_continuation_token=None): - _request = build_toolboxes_list_versions_request( - name=name, - limit=limit, - order=order, + _request = build_beta_agent_insight_monitors_list_insights_request( + monitor_id=monitor_id, after=_continuation_token, before=before, + limit=limit, + order=order, + category=category, + severity=severity, + status=status, + include_details=include_details, api_version=self._config.api_version, headers=_headers, params=_params, @@ -6362,7 +8559,7 @@ def prepare_request(_continuation_token=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.ToolboxVersionObject], + List[_models.AgentInsight], deserialized.get("data", []), ) if cls: @@ -6391,17 +8588,20 @@ async def get_next(_continuation_token=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def get_version(self, name: str, version: str, **kwargs: Any) -> _models.ToolboxVersionObject: - """Retrieve a specific version of a toolbox. - - Retrieves the specified version of a toolbox by name and version identifier. - - :param name: The name of the toolbox. Required. - :type name: str - :param version: The version identifier to retrieve. Required. - :type version: str - :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxVersionObject + async def get_insight( + self, monitor_id: str, insight_id: str, *, include_details: Optional[bool] = None, **kwargs: Any + ) -> _models.AgentInsight: + """Get a full insight for an Agent Insights monitor. + + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :param insight_id: The identifier of the insight. Required. + :type insight_id: str + :keyword include_details: Whether to include expanded insight details such as evidence and run + links in the response. Defaults to false. Default value is None. + :paramtype include_details: bool + :return: AgentInsight. The AgentInsight is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsight :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6415,11 +8615,12 @@ async def get_version(self, name: str, version: str, **kwargs: Any) -> _models.T _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ToolboxVersionObject] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentInsight] = kwargs.pop("cls", None) - _request = build_toolboxes_get_version_request( - name=name, - version=version, + _request = build_beta_agent_insight_monitors_get_insight_request( + monitor_id=monitor_id, + insight_id=insight_id, + include_details=include_details, api_version=self._config.api_version, headers=_headers, params=_params, @@ -6453,7 +8654,7 @@ async def get_version(self, name: str, version: str, **kwargs: Any) -> _models.T if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ToolboxVersionObject, response.json()) + deserialized = _deserialize(_models.AgentInsight, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -6461,83 +8662,102 @@ async def get_version(self, name: str, version: str, **kwargs: Any) -> _models.T return deserialized # type: ignore @overload - async def update( - self, name: str, *, default_version: str, content_type: str = "application/json", **kwargs: Any - ) -> _models.ToolboxObject: - """Update a toolbox to point to a specific version. - - Updates the toolbox's default version pointer to the specified version. + async def update_insight( + self, + monitor_id: str, + insight_id: str, + update: _models.AgentInsightUpdate, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> _models.AgentInsight: + """Update the lifecycle status of an insight. - :param name: The name of the toolbox to update. Required. - :type name: str - :keyword 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. - :paramtype default_version: str + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :param insight_id: The identifier of the insight. Required. + :type insight_id: str + :param update: The insight fields to update. Required. + :type update: ~azure.ai.projects.models.AgentInsightUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". + Default value is "application/merge-patch+json". :paramtype content_type: str - :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxObject + :return: AgentInsight. The AgentInsight is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsight :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def update( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ToolboxObject: - """Update a toolbox to point to a specific version. - - Updates the toolbox's default version pointer to the specified version. + async def update_insight( + self, + monitor_id: str, + insight_id: str, + update: JSON, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> _models.AgentInsight: + """Update the lifecycle status of an insight. - :param name: The name of the toolbox to update. Required. - :type name: str - :param body: Required. - :type body: JSON + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :param insight_id: The identifier of the insight. Required. + :type insight_id: str + :param update: The insight fields to update. Required. + :type update: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". + Default value is "application/merge-patch+json". :paramtype content_type: str - :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxObject + :return: AgentInsight. The AgentInsight is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsight :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def update( - self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ToolboxObject: - """Update a toolbox to point to a specific version. - - Updates the toolbox's default version pointer to the specified version. + async def update_insight( + self, + monitor_id: str, + insight_id: str, + update: IO[bytes], + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> _models.AgentInsight: + """Update the lifecycle status of an insight. - :param name: The name of the toolbox to update. Required. - :type name: str - :param body: Required. - :type body: IO[bytes] + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :param insight_id: The identifier of the insight. Required. + :type insight_id: str + :param update: The insight fields to update. Required. + :type update: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". + Default value is "application/merge-patch+json". :paramtype content_type: str - :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxObject + :return: AgentInsight. The AgentInsight is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsight :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def update( - self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, default_version: str = _Unset, **kwargs: Any - ) -> _models.ToolboxObject: - """Update a toolbox to point to a specific version. - - Updates the toolbox's default version pointer to the specified version. + async def update_insight( + self, + monitor_id: str, + insight_id: str, + update: Union[_models.AgentInsightUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.AgentInsight: + """Update the lifecycle status of an insight. - :param name: The name of the toolbox to update. Required. - :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword 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. - :paramtype default_version: str - :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxObject + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :param insight_id: The identifier of the insight. Required. + :type insight_id: str + :param update: The insight fields to update. Is one of the following types: AgentInsightUpdate, + JSON, IO[bytes] Required. + :type update: ~azure.ai.projects.models.AgentInsightUpdate or JSON or IO[bytes] + :return: AgentInsight. The AgentInsight is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsight :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6552,22 +8772,18 @@ async def update( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ToolboxObject] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentInsight] = kwargs.pop("cls", None) - if body is _Unset: - if default_version is _Unset: - raise TypeError("missing required argument: default_version") - body = {"default_version": default_version} - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" + content_type = content_type or "application/merge-patch+json" _content = None - if isinstance(body, (IOBase, bytes)): - _content = body + if isinstance(update, (IOBase, bytes)): + _content = update else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(update, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_toolboxes_update_request( - name=name, + _request = build_beta_agent_insight_monitors_update_insight_request( + monitor_id=monitor_id, + insight_id=insight_id, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -6603,124 +8819,13 @@ async def update( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ToolboxObject, response.json()) + deserialized = _deserialize(_models.AgentInsight, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace_async - async def delete(self, name: str, **kwargs: Any) -> None: - """Delete a toolbox. - - Removes the specified toolbox along with all of its versions. - - :param name: The name of the toolbox to delete. Required. - :type name: 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_toolboxes_delete_request( - name=name, - 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_async - async def delete_version(self, name: str, version: str, **kwargs: Any) -> None: - """Delete a specific version of a toolbox. - - Removes the specified version of a toolbox. - - :param name: The name of the toolbox. Required. - :type name: str - :param version: The version identifier to delete. Required. - :type version: 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_toolboxes_delete_version_request( - name=name, - version=version, - 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 - class BetaEvaluationTaxonomiesOperations: # pylint: disable=docstring-missing-param """ @@ -12236,6 +14341,7 @@ async def create_or_update( enabled: Optional[bool] = None, triggers: Optional[dict[str, _models.RoutineTrigger]] = None, action: Optional[_models.RoutineAction] = None, + authorization: Optional[_models.RoutineAuthorization] = None, **kwargs: Any ) -> _models.Routine: """Create or update a routine. @@ -12256,6 +14362,9 @@ async def create_or_update( :paramtype triggers: dict[str, ~azure.ai.projects.models.RoutineTrigger] :keyword action: The action executed when the routine fires. Default value is None. :paramtype action: ~azure.ai.projects.models.RoutineAction + :keyword authorization: Optional authorization configuration for dispatching a newly created + routine. Ignored when updating an existing routine. Default value is None. + :paramtype authorization: ~azure.ai.projects.models.RoutineAuthorization :return: Routine. The Routine is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Routine :raises ~azure.core.exceptions.HttpResponseError: @@ -12311,6 +14420,7 @@ async def create_or_update( enabled: Optional[bool] = None, triggers: Optional[dict[str, _models.RoutineTrigger]] = None, action: Optional[_models.RoutineAction] = None, + authorization: Optional[_models.RoutineAuthorization] = None, **kwargs: Any ) -> _models.Routine: """Create or update a routine. @@ -12330,6 +14440,9 @@ async def create_or_update( :paramtype triggers: dict[str, ~azure.ai.projects.models.RoutineTrigger] :keyword action: The action executed when the routine fires. Default value is None. :paramtype action: ~azure.ai.projects.models.RoutineAction + :keyword authorization: Optional authorization configuration for dispatching a newly created + routine. Ignored when updating an existing routine. Default value is None. + :paramtype authorization: ~azure.ai.projects.models.RoutineAuthorization :return: Routine. The Routine is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Routine :raises ~azure.core.exceptions.HttpResponseError: @@ -12349,7 +14462,13 @@ async def create_or_update( cls: ClsType[_models.Routine] = kwargs.pop("cls", None) if body is _Unset: - body = {"action": action, "description": description, "enabled": enabled, "triggers": triggers} + body = { + "action": action, + "authorization": authorization, + "description": description, + "enabled": enabled, + "triggers": triggers, + } body = {k: v for k, v in body.items() if v is not None} content_type = content_type or "application/json" _content = None diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch.py index 5bb74cf4fe6d..3c765532b1af 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch.py @@ -19,6 +19,8 @@ from ._patch_models_async import BetaModelsOperations from ...operations._patch import _BETA_OPERATION_FEATURE_HEADERS, _OperationMethodHeaderProxy from ._operations import ( + BetaAgentEndpointConversationsOperations, + BetaAgentInsightMonitorsOperations, BetaEvaluationTaxonomiesOperations, BetaInsightsOperations, BetaOperations as GeneratedBetaOperations, @@ -41,6 +43,10 @@ class BetaOperations(GeneratedBetaOperations): agents: BetaAgentsOperations """:class:`~azure.ai.projects.aio.operations.BetaAgentsOperations` operations""" + agent_endpoint_conversations: BetaAgentEndpointConversationsOperations + """:class:`~azure.ai.projects.aio.operations.BetaAgentEndpointConversationsOperations` operations""" + agent_insight_monitors: BetaAgentInsightMonitorsOperations + """:class:`~azure.ai.projects.aio.operations.BetaAgentInsightMonitorsOperations` operations""" evaluation_taxonomies: BetaEvaluationTaxonomiesOperations """:class:`~azure.ai.projects.aio.operations.BetaEvaluationTaxonomiesOperations` operations""" evaluators: BetaEvaluatorsOperations diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py index 73b708057861..1e6210e482b1 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py @@ -20,7 +20,7 @@ JSON, _Unset, ) -from ... import models as _models, types as _types +from ... import models as _models from ..._utils.model_base import _deserialize from ...models import AsyncAgentOptimizationLROPoller from ...operations._patch_agents import _compute_sha256_from_stream @@ -387,7 +387,7 @@ async def begin_create_optimization_job( @overload async def begin_create_optimization_job( self, - job: _types.AgentOptimizationJob, + job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", @@ -407,7 +407,7 @@ async def begin_create_optimization_job( @distributed_trace_async async def begin_create_optimization_job( # type: ignore[reportIncompatibleMethodOverride, override] self, - job: Union[_models.AgentOptimizationJob, _types.AgentOptimizationJob, IO[bytes]], + job: Union[_models.AgentOptimizationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any, @@ -415,7 +415,7 @@ async def begin_create_optimization_job( # type: ignore[reportIncompatibleMetho """Create an agent optimization job. :param job: The job to create. Required. - :type job: ~azure.ai.projects.models.AgentOptimizationJob or ~azure.ai.projects.types.AgentOptimizationJob or IO[bytes] + :type job: ~azure.ai.projects.models.AgentOptimizationJob or JSON or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_datasets_async.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_datasets_async.py index 5662b6fdd15a..a0c389b051e9 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_datasets_async.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_datasets_async.py @@ -23,8 +23,9 @@ from ._operations import ( BetaDatasetsOperations as BetaDatasetsOperationsGenerated, DatasetsOperations as DatasetsOperationsGenerated, + JSON, ) -from ... import models as _models, types as _types +from ... import models as _models from ..._utils.model_base import _deserialize from ...models import AsyncDatasetGenerationLROPoller from ...models._models import ( @@ -54,7 +55,7 @@ async def begin_create_generation_job( @overload async def begin_create_generation_job( self, - job: _types.DataGenerationJob, + job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", @@ -74,7 +75,7 @@ async def begin_create_generation_job( @distributed_trace_async async def begin_create_generation_job( # type: ignore[reportIncompatibleMethodOverride, override] self, - job: Union[_models.DataGenerationJob, _types.DataGenerationJob, IO[bytes]], + job: Union[_models.DataGenerationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any, @@ -82,7 +83,7 @@ async def begin_create_generation_job( # type: ignore[reportIncompatibleMethodO """Create a data generation job. :param job: The job to create. Required. - :type job: ~azure.ai.projects.models.DataGenerationJob or ~azure.ai.projects.types.DataGenerationJob or IO[bytes] + :type job: ~azure.ai.projects.models.DataGenerationJob or JSON or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_evaluators_async.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_evaluators_async.py index d0a1aaaaf0df..f1e76ff5c3d9 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_evaluators_async.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_evaluators_async.py @@ -12,8 +12,8 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict -from ._operations import BetaEvaluatorsOperations as BetaEvaluatorsOperationsGenerated -from ... import models as _models, types as _types +from ._operations import BetaEvaluatorsOperations as BetaEvaluatorsOperationsGenerated, JSON +from ... import models as _models from ..._utils.model_base import _deserialize from ...models import AsyncEvaluatorGenerationLROPoller @@ -34,7 +34,7 @@ async def begin_create_generation_job( @overload async def begin_create_generation_job( self, - job: _types.EvaluatorGenerationJob, + job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", @@ -54,7 +54,7 @@ async def begin_create_generation_job( @distributed_trace_async async def begin_create_generation_job( # type: ignore[reportIncompatibleMethodOverride, override] self, - job: Union[_models.EvaluatorGenerationJob, _types.EvaluatorGenerationJob, IO[bytes]], + job: Union[_models.EvaluatorGenerationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any, @@ -62,7 +62,7 @@ async def begin_create_generation_job( # type: ignore[reportIncompatibleMethodO """Create an evaluator generation job. :param job: The job to create. Required. - :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or ~azure.ai.projects.types.EvaluatorGenerationJob or IO[bytes] + :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or JSON or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str 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 c11035aae62e..d85cbcf22377 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 @@ -34,6 +34,26 @@ AgentEndpointConfig, AgentEvaluatorGenerationJobSource, AgentIdentity, + AgentInsight, + AgentInsightDetails, + AgentInsightEstimatedCost, + AgentInsightHighlightedTrace, + AgentInsightLinkedTrace, + AgentInsightMonitor, + AgentInsightMonitorCreate, + AgentInsightMonitorListItem, + AgentInsightMonitorUpdate, + AgentInsightProposedFix, + AgentInsightProposedFixChange, + AgentInsightRecommendedAction, + AgentInsightRun, + AgentInsightRunCreate, + AgentInsightRunResult, + AgentInsightSuspension, + AgentInsightTokenUsage, + AgentInsightUpdate, + AgentInsightsOverview, + AgentInsightsOverviewOverride, AgentObjectVersions, AgentOptimizationCandidate, AgentOptimizationDatasetCriterion, @@ -220,7 +240,6 @@ InvokeAgentInvocationsApiRoutineAction, InvokeAgentResponsesApiDispatchPayload, InvokeAgentResponsesApiRoutineAction, - LlmGeneratedVoiceGreetingConfig, LocalShellToolParam, LocalSkillParam, LogProbProperties, @@ -250,6 +269,9 @@ MemoryStoreUpdateCompletedResult, MemoryStoreUpdateResult, Metadata, + Microsoft365PermissionScopes, + Microsoft365PublishDefaults, + Microsoft365PublishResult, MicrosoftFabricPreviewTool, ModelCredentialRequest, ModelDeployment, @@ -262,8 +284,6 @@ MonthlyRecurrenceSchedule, NamespaceToolParam, NoAuthenticationCredentials, - OmitPropertiesRealtimeResponse, - OmitPropertiesRealtimeResponse1, OneTimeTrigger, OpenApiAnonymousAuthDetails, OpenApiAuthDetails, @@ -279,7 +299,7 @@ OtlpTelemetryEndpoint, PendingUploadRequest, PendingUploadResponse, - PickPropertiesVoiceAudioConfig, + PickPropertiesVoiceAgentAudioConfig, ProceduralMemoryItem, ProgrammaticToolCallingParam, PromotionInfo, @@ -296,16 +316,20 @@ RealtimeAudioFormatsAudioPcm, RealtimeAudioFormatsAudioPcma, RealtimeAudioFormatsAudioPcmu, + RealtimeClientEvent, + RealtimeClientEventConversationItemCreate, + RealtimeClientEventConversationItemDelete, + RealtimeClientEventConversationItemRetrieve, + RealtimeClientEventConversationItemTruncate, + RealtimeClientEventInputAudioBufferAppend, + RealtimeClientEventInputAudioBufferClear, + RealtimeClientEventInputAudioBufferCommit, + RealtimeClientEventOutputAudioBufferClear, + RealtimeClientEventResponseCancel, + RealtimeClientEventResponseCreate, RealtimeConversationItem, RealtimeConversationItemFunctionCall, RealtimeConversationItemFunctionCallOutput, - RealtimeConversationItemMessage, - RealtimeConversationItemMessageAssistant, - RealtimeConversationItemMessageAssistantContent, - RealtimeConversationItemMessageSystem, - RealtimeConversationItemMessageSystemContent, - RealtimeConversationItemMessageUser, - RealtimeConversationItemMessageUserContent, RealtimeFunctionTool, RealtimeFunctionToolParameters, RealtimeMCPApprovalRequest, @@ -324,12 +348,53 @@ RealtimeResponseUsageInputTokenDetailsCachedTokensDetails, RealtimeResponseUsageOutputTokenDetails, RealtimeServerEvent, + RealtimeServerEventConversationItemAdded, + RealtimeServerEventConversationItemCreated, + RealtimeServerEventConversationItemDeleted, + RealtimeServerEventConversationItemDone, + RealtimeServerEventConversationItemInputAudioTranscriptionCompleted, + RealtimeServerEventConversationItemInputAudioTranscriptionDelta, + RealtimeServerEventConversationItemInputAudioTranscriptionFailed, RealtimeServerEventConversationItemInputAudioTranscriptionFailedError, + RealtimeServerEventConversationItemInputAudioTranscriptionSegment, + RealtimeServerEventConversationItemRetrieved, + RealtimeServerEventConversationItemTruncated, RealtimeServerEventError, RealtimeServerEventErrorError, + RealtimeServerEventInputAudioBufferCleared, + RealtimeServerEventInputAudioBufferCommitted, + RealtimeServerEventInputAudioBufferSpeechStarted, + RealtimeServerEventInputAudioBufferSpeechStopped, + RealtimeServerEventInputAudioBufferTimeoutTriggered, + RealtimeServerEventMCPListToolsCompleted, + RealtimeServerEventMCPListToolsFailed, + RealtimeServerEventMCPListToolsInProgress, + RealtimeServerEventOutputAudioBufferCleared, + RealtimeServerEventRateLimitsUpdated, RealtimeServerEventRateLimitsUpdatedRateLimits, + RealtimeServerEventResponseAudioDelta, + RealtimeServerEventResponseAudioDone, + RealtimeServerEventResponseAudioTranscriptDelta, + RealtimeServerEventResponseAudioTranscriptDone, RealtimeServerEventResponseContentPartAdded, RealtimeServerEventResponseContentPartAddedPart, + RealtimeServerEventResponseContentPartDone, + RealtimeServerEventResponseContentPartDonePart, + RealtimeServerEventResponseCreated, + RealtimeServerEventResponseDone, + RealtimeServerEventResponseFunctionCallArgumentsDelta, + RealtimeServerEventResponseFunctionCallArgumentsDone, + RealtimeServerEventResponseMCPCallArgumentsDelta, + RealtimeServerEventResponseMCPCallArgumentsDone, + RealtimeServerEventResponseMCPCallCompleted, + RealtimeServerEventResponseMCPCallFailed, + RealtimeServerEventResponseMCPCallInProgress, + RealtimeServerEventResponseOutputItemAdded, + RealtimeServerEventResponseOutputItemDone, + RealtimeServerEventResponseTextDelta, + RealtimeServerEventResponseTextDone, + RealtimeServerEventSessionCreated, + RealtimeServerEventSessionUpdated, Reasoning, RecurrenceSchedule, RecurrenceTrigger, @@ -341,6 +406,7 @@ ResponsesProtocolConfiguration, Routine, RoutineAction, + RoutineAuthorization, RoutineDispatchPayload, RoutineRun, RoutineTrigger, @@ -357,6 +423,7 @@ SessionLogEvent, SharepointGroundingToolParameters, SharepointPreviewTool, + ShellToolboxTool, SimpleQnADataGenerationJobOptions, SimulationSeedDataGenerationJobOptions, SkillDetails, @@ -373,7 +440,6 @@ TelemetryConfig, TelemetryEndpoint, TelemetryEndpointAuth, - TemplateVoiceGreetingConfig, TextResponseFormat, TextResponseFormatJsonObject, TextResponseFormatJsonSchema, @@ -402,6 +468,11 @@ ToolboxObject, ToolboxPolicies, ToolboxSearchPreviewToolboxTool, + ToolboxShellContainerAutoEnvironment, + ToolboxShellContainerReferenceEnvironment, + ToolboxShellEnvironment, + ToolboxShellNetworkPolicy, + ToolboxShellNetworkPolicyDisabled, ToolboxSkill, ToolboxSkillReference, ToolboxTool, @@ -421,125 +492,68 @@ VersionSelectionRule, VersionSelector, VoiceAgentAnimationConfig, + VoiceAgentAudioConfig, + VoiceAgentAudioInputConfig, + VoiceAgentAudioOutputConfig, + VoiceAgentAvatarConfig, VoiceAgentAvatarIceServer, VoiceAgentAvatarScene, VoiceAgentAvatarVideoBackground, VoiceAgentAvatarVideoCrop, VoiceAgentAvatarVideoParams, VoiceAgentAvatarVideoResolution, - VoiceAgentClientEventConversationItemCreate, - VoiceAgentClientEventConversationItemDelete, - VoiceAgentClientEventConversationItemRetrieve, - VoiceAgentClientEventConversationItemTruncate, - VoiceAgentClientEventInputAudioBufferAppend, - VoiceAgentClientEventInputAudioBufferClear, - VoiceAgentClientEventInputAudioBufferCommit, - VoiceAgentClientEventOutputAudioBufferClear, - VoiceAgentClientEventResponseCancel, - VoiceAgentClientEventResponseCreate, + VoiceAgentAzureSemanticVadEnTurnDetection, + VoiceAgentAzureSemanticVadMultilingualTurnDetection, + VoiceAgentAzureSemanticVadTurnDetection, VoiceAgentClientEventSessionAvatarConnect, VoiceAgentClientEventSessionUpdate, VoiceAgentDefinition, VoiceAgentEchoCancellation, + VoiceAgentEndOfUtteranceDetection, VoiceAgentFunctionTool, + VoiceAgentGreetingConfig, + VoiceAgentInputTranscription, VoiceAgentInterimResponseConfig, + VoiceAgentLlmGeneratedGreetingConfig, VoiceAgentLlmInterimResponseConfig, VoiceAgentMcpTool, + VoiceAgentNoiseReduction, VoiceAgentRealtimeResponse, + VoiceAgentRealtimeResponseBase, VoiceAgentResponseCreateParams, - VoiceAgentResponseEventContentPart, VoiceAgentSemanticVadTurnDetection, - VoiceAgentServerEventConversationItemAdded, - VoiceAgentServerEventConversationItemCreated, - VoiceAgentServerEventConversationItemDeleted, - VoiceAgentServerEventConversationItemDone, - VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted, - VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta, - VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed, - VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment, - VoiceAgentServerEventConversationItemRetrieved, - VoiceAgentServerEventConversationItemTruncated, - VoiceAgentServerEventInputAudioBufferCleared, - VoiceAgentServerEventInputAudioBufferCommitted, - VoiceAgentServerEventInputAudioBufferSpeechStarted, - VoiceAgentServerEventInputAudioBufferSpeechStopped, - VoiceAgentServerEventInputAudioBufferTimeoutTriggered, - VoiceAgentServerEventMcpListToolsCompleted, - VoiceAgentServerEventMcpListToolsFailed, - VoiceAgentServerEventMcpListToolsInProgress, - VoiceAgentServerEventOutputAudioBufferCleared, - VoiceAgentServerEventRateLimitsUpdated, VoiceAgentServerEventResponseAnimationBlendshapesDelta, VoiceAgentServerEventResponseAnimationBlendshapesDone, VoiceAgentServerEventResponseAnimationVisemeDelta, VoiceAgentServerEventResponseAnimationVisemeDone, - VoiceAgentServerEventResponseAudioDelta, - VoiceAgentServerEventResponseAudioDone, VoiceAgentServerEventResponseAudioTimestampDelta, VoiceAgentServerEventResponseAudioTimestampDone, - VoiceAgentServerEventResponseAudioTranscriptDelta, - VoiceAgentServerEventResponseAudioTranscriptDone, - VoiceAgentServerEventResponseContentPartDone, - VoiceAgentServerEventResponseCreated, - VoiceAgentServerEventResponseDone, - VoiceAgentServerEventResponseFunctionCallArgumentsDelta, - VoiceAgentServerEventResponseFunctionCallArgumentsDone, - VoiceAgentServerEventResponseMcpCallArgumentsDelta, - VoiceAgentServerEventResponseMcpCallArgumentsDone, - VoiceAgentServerEventResponseMcpCallCompleted, - VoiceAgentServerEventResponseMcpCallFailed, - VoiceAgentServerEventResponseMcpCallInProgress, - VoiceAgentServerEventResponseOutputItemAdded, - VoiceAgentServerEventResponseOutputItemDone, - VoiceAgentServerEventResponseTextDelta, - VoiceAgentServerEventResponseTextDone, VoiceAgentServerEventResponseVideoDelta, VoiceAgentServerEventSessionAvatarConnecting, VoiceAgentServerEventSessionAvatarSwitchToIdle, VoiceAgentServerEventSessionAvatarSwitchToSpeaking, - VoiceAgentServerEventSessionCreated, - VoiceAgentServerEventSessionUpdated, VoiceAgentServerEventWarning, VoiceAgentServerEventWarningDetails, + VoiceAgentServerVadTurnDetection, VoiceAgentSessionAvatarConfig, VoiceAgentSessionResponseConfig, VoiceAgentSessionUpdateConfig, VoiceAgentStaticInterimResponseConfig, + VoiceAgentSystemTool, + VoiceAgentTemplateGreetingConfig, VoiceAgentTool, + VoiceAgentToolboxTool, VoiceAgentTranscriptionPhrase, VoiceAgentTranscriptionWord, - VoiceAssistantMessageItem, - VoiceAudioConfig, - VoiceAudioFormat, - VoiceAudioInputConfig, - VoiceAudioOutputConfig, - VoiceAvatarConfig, - VoiceAzureSemanticVadEnTurnDetection, - VoiceAzureSemanticVadMultilingualTurnDetection, - VoiceAzureSemanticVadTurnDetection, + VoiceAgentTurnDetectionConfig, VoiceConversation, - VoiceEndOfUtteranceDetection, - VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, - VoiceGreetingConfig, - VoiceInputTranscription, VoiceItemAudioResponse, - VoiceMcpApprovalRequestItem, - VoiceMcpApprovalResponseItem, - VoiceMcpCallItem, - VoiceMcpListToolsItem, - VoiceNoiseReduction, VoiceRecordingChannelLayout, VoiceRecordingResponse, VoiceResponse, VoiceResponseAudio, VoiceResponseAudioOutput, - VoiceServerVadTurnDetection, - VoiceSystemMessageItem, - VoiceSystemTool, - VoiceToolboxTool, - VoiceTurnDetection, - VoiceUserMessageItem, + VoiceResponseBase, WebIQPreviewTool, WebIQPreviewToolboxTool, WebSearchApproximateLocation, @@ -556,10 +570,17 @@ from ._enums import ( # type: ignore A2AProtocolVersion, + ActivityProtocolAccessBoundary, AgentBlueprintReferenceType, AgentEndpointAuthorizationSchemeType, AgentEndpointProtocol, AgentIdentityStatus, + AgentInsightOverviewSource, + AgentInsightPromptSurface, + AgentInsightProposedFixKind, + AgentInsightRunTrigger, + AgentInsightSeverity, + AgentInsightStatus, AgentKind, AgentObjectType, AgentOptimizationDatasetInputType, @@ -586,6 +607,7 @@ DatasetType, DayOfWeek, DeploymentType, + DigitalWorkerType, EvaluationLevel, EvaluationRuleActionType, EvaluationRuleEventType, @@ -615,14 +637,15 @@ MemoryStoreKind, MemoryStoreObjectType, MemoryStoreUpdateStatus, + Microsoft365PublishScope, OpenApiAuthType, OperationState, PageOrder, PendingUploadType, + PublishApprovalStatus, RankerVersionType, RealtimeAudioFormatsType, RealtimeClientEventType, - RealtimeConversationItemMessageType, RealtimeConversationItemType, RealtimeMcpErrorType, RealtimeReasoningEffort, @@ -633,6 +656,7 @@ RiskCategory, RoutineActionType, RoutineAttemptSource, + RoutineDispatchIdentity, RoutineDispatchPayloadType, RoutineRunPhase, RoutineTriggerType, @@ -661,27 +685,26 @@ VersionIndicatorType, VersionSelectorType, VoiceAgentAnimationOutputType, + VoiceAgentAudioTimestampType, + VoiceAgentAvatarOutputProtocol, + VoiceAgentAvatarType, VoiceAgentEchoCancellationReferenceSource, + VoiceAgentEndOfUtteranceDetectionModel, + VoiceAgentEndOfUtteranceThresholdLevel, + VoiceAgentInputTranscriptionModel, VoiceAgentInterimResponseTrigger, + VoiceAgentNoiseReductionType, VoiceAgentSessionIncludeOption, + VoiceAgentSystemToolName, VoiceAgentToolResponseScheduling, + VoiceAgentTurnDetectionType, VoiceAgentWebSocketSubprotocol, VoiceAudioCodec, VoiceAudioContainerFormat, - VoiceAudioFormatType, VoiceAudioRole, - VoiceAudioTimestampType, - VoiceAvatarOutputProtocol, - VoiceAvatarType, VoiceConversationStatus, - VoiceEndOfUtteranceDetectionModel, - VoiceEndOfUtteranceThresholdLevel, - VoiceInputTranscriptionModel, VoiceModelType, - VoiceNoiseReductionType, VoiceOutputModality, - VoiceSystemToolName, - VoiceTurnDetectionType, VoiceType, _AgentDefinitionOptInKeys, ) @@ -709,6 +732,26 @@ "AgentEndpointConfig", "AgentEvaluatorGenerationJobSource", "AgentIdentity", + "AgentInsight", + "AgentInsightDetails", + "AgentInsightEstimatedCost", + "AgentInsightHighlightedTrace", + "AgentInsightLinkedTrace", + "AgentInsightMonitor", + "AgentInsightMonitorCreate", + "AgentInsightMonitorListItem", + "AgentInsightMonitorUpdate", + "AgentInsightProposedFix", + "AgentInsightProposedFixChange", + "AgentInsightRecommendedAction", + "AgentInsightRun", + "AgentInsightRunCreate", + "AgentInsightRunResult", + "AgentInsightSuspension", + "AgentInsightTokenUsage", + "AgentInsightUpdate", + "AgentInsightsOverview", + "AgentInsightsOverviewOverride", "AgentObjectVersions", "AgentOptimizationCandidate", "AgentOptimizationDatasetCriterion", @@ -895,7 +938,6 @@ "InvokeAgentInvocationsApiRoutineAction", "InvokeAgentResponsesApiDispatchPayload", "InvokeAgentResponsesApiRoutineAction", - "LlmGeneratedVoiceGreetingConfig", "LocalShellToolParam", "LocalSkillParam", "LogProbProperties", @@ -925,6 +967,9 @@ "MemoryStoreUpdateCompletedResult", "MemoryStoreUpdateResult", "Metadata", + "Microsoft365PermissionScopes", + "Microsoft365PublishDefaults", + "Microsoft365PublishResult", "MicrosoftFabricPreviewTool", "ModelCredentialRequest", "ModelDeployment", @@ -937,8 +982,6 @@ "MonthlyRecurrenceSchedule", "NamespaceToolParam", "NoAuthenticationCredentials", - "OmitPropertiesRealtimeResponse", - "OmitPropertiesRealtimeResponse1", "OneTimeTrigger", "OpenApiAnonymousAuthDetails", "OpenApiAuthDetails", @@ -954,7 +997,7 @@ "OtlpTelemetryEndpoint", "PendingUploadRequest", "PendingUploadResponse", - "PickPropertiesVoiceAudioConfig", + "PickPropertiesVoiceAgentAudioConfig", "ProceduralMemoryItem", "ProgrammaticToolCallingParam", "PromotionInfo", @@ -971,16 +1014,20 @@ "RealtimeAudioFormatsAudioPcm", "RealtimeAudioFormatsAudioPcma", "RealtimeAudioFormatsAudioPcmu", + "RealtimeClientEvent", + "RealtimeClientEventConversationItemCreate", + "RealtimeClientEventConversationItemDelete", + "RealtimeClientEventConversationItemRetrieve", + "RealtimeClientEventConversationItemTruncate", + "RealtimeClientEventInputAudioBufferAppend", + "RealtimeClientEventInputAudioBufferClear", + "RealtimeClientEventInputAudioBufferCommit", + "RealtimeClientEventOutputAudioBufferClear", + "RealtimeClientEventResponseCancel", + "RealtimeClientEventResponseCreate", "RealtimeConversationItem", "RealtimeConversationItemFunctionCall", "RealtimeConversationItemFunctionCallOutput", - "RealtimeConversationItemMessage", - "RealtimeConversationItemMessageAssistant", - "RealtimeConversationItemMessageAssistantContent", - "RealtimeConversationItemMessageSystem", - "RealtimeConversationItemMessageSystemContent", - "RealtimeConversationItemMessageUser", - "RealtimeConversationItemMessageUserContent", "RealtimeFunctionTool", "RealtimeFunctionToolParameters", "RealtimeMCPApprovalRequest", @@ -999,12 +1046,53 @@ "RealtimeResponseUsageInputTokenDetailsCachedTokensDetails", "RealtimeResponseUsageOutputTokenDetails", "RealtimeServerEvent", + "RealtimeServerEventConversationItemAdded", + "RealtimeServerEventConversationItemCreated", + "RealtimeServerEventConversationItemDeleted", + "RealtimeServerEventConversationItemDone", + "RealtimeServerEventConversationItemInputAudioTranscriptionCompleted", + "RealtimeServerEventConversationItemInputAudioTranscriptionDelta", + "RealtimeServerEventConversationItemInputAudioTranscriptionFailed", "RealtimeServerEventConversationItemInputAudioTranscriptionFailedError", + "RealtimeServerEventConversationItemInputAudioTranscriptionSegment", + "RealtimeServerEventConversationItemRetrieved", + "RealtimeServerEventConversationItemTruncated", "RealtimeServerEventError", "RealtimeServerEventErrorError", + "RealtimeServerEventInputAudioBufferCleared", + "RealtimeServerEventInputAudioBufferCommitted", + "RealtimeServerEventInputAudioBufferSpeechStarted", + "RealtimeServerEventInputAudioBufferSpeechStopped", + "RealtimeServerEventInputAudioBufferTimeoutTriggered", + "RealtimeServerEventMCPListToolsCompleted", + "RealtimeServerEventMCPListToolsFailed", + "RealtimeServerEventMCPListToolsInProgress", + "RealtimeServerEventOutputAudioBufferCleared", + "RealtimeServerEventRateLimitsUpdated", "RealtimeServerEventRateLimitsUpdatedRateLimits", + "RealtimeServerEventResponseAudioDelta", + "RealtimeServerEventResponseAudioDone", + "RealtimeServerEventResponseAudioTranscriptDelta", + "RealtimeServerEventResponseAudioTranscriptDone", "RealtimeServerEventResponseContentPartAdded", "RealtimeServerEventResponseContentPartAddedPart", + "RealtimeServerEventResponseContentPartDone", + "RealtimeServerEventResponseContentPartDonePart", + "RealtimeServerEventResponseCreated", + "RealtimeServerEventResponseDone", + "RealtimeServerEventResponseFunctionCallArgumentsDelta", + "RealtimeServerEventResponseFunctionCallArgumentsDone", + "RealtimeServerEventResponseMCPCallArgumentsDelta", + "RealtimeServerEventResponseMCPCallArgumentsDone", + "RealtimeServerEventResponseMCPCallCompleted", + "RealtimeServerEventResponseMCPCallFailed", + "RealtimeServerEventResponseMCPCallInProgress", + "RealtimeServerEventResponseOutputItemAdded", + "RealtimeServerEventResponseOutputItemDone", + "RealtimeServerEventResponseTextDelta", + "RealtimeServerEventResponseTextDone", + "RealtimeServerEventSessionCreated", + "RealtimeServerEventSessionUpdated", "Reasoning", "RecurrenceSchedule", "RecurrenceTrigger", @@ -1016,6 +1104,7 @@ "ResponsesProtocolConfiguration", "Routine", "RoutineAction", + "RoutineAuthorization", "RoutineDispatchPayload", "RoutineRun", "RoutineTrigger", @@ -1032,6 +1121,7 @@ "SessionLogEvent", "SharepointGroundingToolParameters", "SharepointPreviewTool", + "ShellToolboxTool", "SimpleQnADataGenerationJobOptions", "SimulationSeedDataGenerationJobOptions", "SkillDetails", @@ -1048,7 +1138,6 @@ "TelemetryConfig", "TelemetryEndpoint", "TelemetryEndpointAuth", - "TemplateVoiceGreetingConfig", "TextResponseFormat", "TextResponseFormatJsonObject", "TextResponseFormatJsonSchema", @@ -1077,6 +1166,11 @@ "ToolboxObject", "ToolboxPolicies", "ToolboxSearchPreviewToolboxTool", + "ToolboxShellContainerAutoEnvironment", + "ToolboxShellContainerReferenceEnvironment", + "ToolboxShellEnvironment", + "ToolboxShellNetworkPolicy", + "ToolboxShellNetworkPolicyDisabled", "ToolboxSkill", "ToolboxSkillReference", "ToolboxTool", @@ -1096,125 +1190,68 @@ "VersionSelectionRule", "VersionSelector", "VoiceAgentAnimationConfig", + "VoiceAgentAudioConfig", + "VoiceAgentAudioInputConfig", + "VoiceAgentAudioOutputConfig", + "VoiceAgentAvatarConfig", "VoiceAgentAvatarIceServer", "VoiceAgentAvatarScene", "VoiceAgentAvatarVideoBackground", "VoiceAgentAvatarVideoCrop", "VoiceAgentAvatarVideoParams", "VoiceAgentAvatarVideoResolution", - "VoiceAgentClientEventConversationItemCreate", - "VoiceAgentClientEventConversationItemDelete", - "VoiceAgentClientEventConversationItemRetrieve", - "VoiceAgentClientEventConversationItemTruncate", - "VoiceAgentClientEventInputAudioBufferAppend", - "VoiceAgentClientEventInputAudioBufferClear", - "VoiceAgentClientEventInputAudioBufferCommit", - "VoiceAgentClientEventOutputAudioBufferClear", - "VoiceAgentClientEventResponseCancel", - "VoiceAgentClientEventResponseCreate", + "VoiceAgentAzureSemanticVadEnTurnDetection", + "VoiceAgentAzureSemanticVadMultilingualTurnDetection", + "VoiceAgentAzureSemanticVadTurnDetection", "VoiceAgentClientEventSessionAvatarConnect", "VoiceAgentClientEventSessionUpdate", "VoiceAgentDefinition", "VoiceAgentEchoCancellation", + "VoiceAgentEndOfUtteranceDetection", "VoiceAgentFunctionTool", + "VoiceAgentGreetingConfig", + "VoiceAgentInputTranscription", "VoiceAgentInterimResponseConfig", + "VoiceAgentLlmGeneratedGreetingConfig", "VoiceAgentLlmInterimResponseConfig", "VoiceAgentMcpTool", + "VoiceAgentNoiseReduction", "VoiceAgentRealtimeResponse", + "VoiceAgentRealtimeResponseBase", "VoiceAgentResponseCreateParams", - "VoiceAgentResponseEventContentPart", "VoiceAgentSemanticVadTurnDetection", - "VoiceAgentServerEventConversationItemAdded", - "VoiceAgentServerEventConversationItemCreated", - "VoiceAgentServerEventConversationItemDeleted", - "VoiceAgentServerEventConversationItemDone", - "VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted", - "VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta", - "VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed", - "VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment", - "VoiceAgentServerEventConversationItemRetrieved", - "VoiceAgentServerEventConversationItemTruncated", - "VoiceAgentServerEventInputAudioBufferCleared", - "VoiceAgentServerEventInputAudioBufferCommitted", - "VoiceAgentServerEventInputAudioBufferSpeechStarted", - "VoiceAgentServerEventInputAudioBufferSpeechStopped", - "VoiceAgentServerEventInputAudioBufferTimeoutTriggered", - "VoiceAgentServerEventMcpListToolsCompleted", - "VoiceAgentServerEventMcpListToolsFailed", - "VoiceAgentServerEventMcpListToolsInProgress", - "VoiceAgentServerEventOutputAudioBufferCleared", - "VoiceAgentServerEventRateLimitsUpdated", "VoiceAgentServerEventResponseAnimationBlendshapesDelta", "VoiceAgentServerEventResponseAnimationBlendshapesDone", "VoiceAgentServerEventResponseAnimationVisemeDelta", "VoiceAgentServerEventResponseAnimationVisemeDone", - "VoiceAgentServerEventResponseAudioDelta", - "VoiceAgentServerEventResponseAudioDone", "VoiceAgentServerEventResponseAudioTimestampDelta", "VoiceAgentServerEventResponseAudioTimestampDone", - "VoiceAgentServerEventResponseAudioTranscriptDelta", - "VoiceAgentServerEventResponseAudioTranscriptDone", - "VoiceAgentServerEventResponseContentPartDone", - "VoiceAgentServerEventResponseCreated", - "VoiceAgentServerEventResponseDone", - "VoiceAgentServerEventResponseFunctionCallArgumentsDelta", - "VoiceAgentServerEventResponseFunctionCallArgumentsDone", - "VoiceAgentServerEventResponseMcpCallArgumentsDelta", - "VoiceAgentServerEventResponseMcpCallArgumentsDone", - "VoiceAgentServerEventResponseMcpCallCompleted", - "VoiceAgentServerEventResponseMcpCallFailed", - "VoiceAgentServerEventResponseMcpCallInProgress", - "VoiceAgentServerEventResponseOutputItemAdded", - "VoiceAgentServerEventResponseOutputItemDone", - "VoiceAgentServerEventResponseTextDelta", - "VoiceAgentServerEventResponseTextDone", "VoiceAgentServerEventResponseVideoDelta", "VoiceAgentServerEventSessionAvatarConnecting", "VoiceAgentServerEventSessionAvatarSwitchToIdle", "VoiceAgentServerEventSessionAvatarSwitchToSpeaking", - "VoiceAgentServerEventSessionCreated", - "VoiceAgentServerEventSessionUpdated", "VoiceAgentServerEventWarning", "VoiceAgentServerEventWarningDetails", + "VoiceAgentServerVadTurnDetection", "VoiceAgentSessionAvatarConfig", "VoiceAgentSessionResponseConfig", "VoiceAgentSessionUpdateConfig", "VoiceAgentStaticInterimResponseConfig", + "VoiceAgentSystemTool", + "VoiceAgentTemplateGreetingConfig", "VoiceAgentTool", + "VoiceAgentToolboxTool", "VoiceAgentTranscriptionPhrase", "VoiceAgentTranscriptionWord", - "VoiceAssistantMessageItem", - "VoiceAudioConfig", - "VoiceAudioFormat", - "VoiceAudioInputConfig", - "VoiceAudioOutputConfig", - "VoiceAvatarConfig", - "VoiceAzureSemanticVadEnTurnDetection", - "VoiceAzureSemanticVadMultilingualTurnDetection", - "VoiceAzureSemanticVadTurnDetection", + "VoiceAgentTurnDetectionConfig", "VoiceConversation", - "VoiceEndOfUtteranceDetection", - "VoiceFunctionCallItem", - "VoiceFunctionCallOutputItem", - "VoiceGreetingConfig", - "VoiceInputTranscription", "VoiceItemAudioResponse", - "VoiceMcpApprovalRequestItem", - "VoiceMcpApprovalResponseItem", - "VoiceMcpCallItem", - "VoiceMcpListToolsItem", - "VoiceNoiseReduction", "VoiceRecordingChannelLayout", "VoiceRecordingResponse", "VoiceResponse", "VoiceResponseAudio", "VoiceResponseAudioOutput", - "VoiceServerVadTurnDetection", - "VoiceSystemMessageItem", - "VoiceSystemTool", - "VoiceToolboxTool", - "VoiceTurnDetection", - "VoiceUserMessageItem", + "VoiceResponseBase", "WebIQPreviewTool", "WebIQPreviewToolboxTool", "WebSearchApproximateLocation", @@ -1228,10 +1265,17 @@ "WorkIQPreviewToolboxTool", "WorkflowAgentDefinition", "A2AProtocolVersion", + "ActivityProtocolAccessBoundary", "AgentBlueprintReferenceType", "AgentEndpointAuthorizationSchemeType", "AgentEndpointProtocol", "AgentIdentityStatus", + "AgentInsightOverviewSource", + "AgentInsightPromptSurface", + "AgentInsightProposedFixKind", + "AgentInsightRunTrigger", + "AgentInsightSeverity", + "AgentInsightStatus", "AgentKind", "AgentObjectType", "AgentOptimizationDatasetInputType", @@ -1258,6 +1302,7 @@ "DatasetType", "DayOfWeek", "DeploymentType", + "DigitalWorkerType", "EvaluationLevel", "EvaluationRuleActionType", "EvaluationRuleEventType", @@ -1287,14 +1332,15 @@ "MemoryStoreKind", "MemoryStoreObjectType", "MemoryStoreUpdateStatus", + "Microsoft365PublishScope", "OpenApiAuthType", "OperationState", "PageOrder", "PendingUploadType", + "PublishApprovalStatus", "RankerVersionType", "RealtimeAudioFormatsType", "RealtimeClientEventType", - "RealtimeConversationItemMessageType", "RealtimeConversationItemType", "RealtimeMcpErrorType", "RealtimeReasoningEffort", @@ -1305,6 +1351,7 @@ "RiskCategory", "RoutineActionType", "RoutineAttemptSource", + "RoutineDispatchIdentity", "RoutineDispatchPayloadType", "RoutineRunPhase", "RoutineTriggerType", @@ -1333,27 +1380,26 @@ "VersionIndicatorType", "VersionSelectorType", "VoiceAgentAnimationOutputType", + "VoiceAgentAudioTimestampType", + "VoiceAgentAvatarOutputProtocol", + "VoiceAgentAvatarType", "VoiceAgentEchoCancellationReferenceSource", + "VoiceAgentEndOfUtteranceDetectionModel", + "VoiceAgentEndOfUtteranceThresholdLevel", + "VoiceAgentInputTranscriptionModel", "VoiceAgentInterimResponseTrigger", + "VoiceAgentNoiseReductionType", "VoiceAgentSessionIncludeOption", + "VoiceAgentSystemToolName", "VoiceAgentToolResponseScheduling", + "VoiceAgentTurnDetectionType", "VoiceAgentWebSocketSubprotocol", "VoiceAudioCodec", "VoiceAudioContainerFormat", - "VoiceAudioFormatType", "VoiceAudioRole", - "VoiceAudioTimestampType", - "VoiceAvatarOutputProtocol", - "VoiceAvatarType", "VoiceConversationStatus", - "VoiceEndOfUtteranceDetectionModel", - "VoiceEndOfUtteranceThresholdLevel", - "VoiceInputTranscriptionModel", "VoiceModelType", - "VoiceNoiseReductionType", "VoiceOutputModality", - "VoiceSystemToolName", - "VoiceTurnDetectionType", "VoiceType", "_AgentDefinitionOptInKeys", ] 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 198080e2cab6..322a9e120d91 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 @@ -22,6 +22,8 @@ class _AgentDefinitionOptInKeys(str, Enum, metaclass=CaseInsensitiveEnumMeta): """DRAFT_AGENTS_V1_PREVIEW.""" VOICE_AGENTS_V1_PREVIEW = "VoiceAgents=V1Preview" """VOICE_AGENTS_V1_PREVIEW.""" + DIGITAL_WORKER_V1_PREVIEW = "DigitalWorker=V1Preview" + """DIGITAL_WORKER_V1_PREVIEW.""" class _FoundryFeaturesOptInKeys(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -35,6 +37,8 @@ class _FoundryFeaturesOptInKeys(str, Enum, metaclass=CaseInsensitiveEnumMeta): """RED_TEAMS_V1_PREVIEW.""" INSIGHTS_V1_PREVIEW = "Insights=V1Preview" """INSIGHTS_V1_PREVIEW.""" + AGENT_INSIGHTS_V1_PREVIEW = "AgentInsights=V1Preview" + """AGENT_INSIGHTS_V1_PREVIEW.""" MEMORY_STORES_V1_PREVIEW = "MemoryStores=V1Preview" """MEMORY_STORES_V1_PREVIEW.""" ROUTINES_V2_PREVIEW = "Routines=V2Preview" @@ -47,6 +51,8 @@ class _FoundryFeaturesOptInKeys(str, Enum, metaclass=CaseInsensitiveEnumMeta): """MODELS_V1_PREVIEW.""" AGENTS_OPTIMIZATION_V2_PREVIEW = "AgentsOptimization=V2Preview" """AGENTS_OPTIMIZATION_V2_PREVIEW.""" + MODEL_ROUTER_CONTROLS_V1_PREVIEW = "ModelRouterControls=V1Preview" + """MODEL_ROUTER_CONTROLS_V1_PREVIEW.""" class A2AProtocolVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -56,6 +62,47 @@ class A2AProtocolVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): """A2A protocol version 1.0.""" +class ActivityProtocolAccessBoundary(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """An access boundary for the activity protocol.""" + + READ1_ON1_DEVELOPERS = "read.1on1.developers" + """Allows read access to one-on-one developer conversations.""" + READ1_ON1_MANAGER = "read.1on1.manager" + """Allows read access to one-on-one manager conversations.""" + READ1_ON1_ALLOWLISTED = "read.1on1.allowlisted" + """Allows read access to allowlisted one-on-one conversations.""" + READ1_ON1_TENANT = "read.1on1.tenant" + """Allows read access to tenant-wide one-on-one conversations.""" + WRITE1_ON1_DEVELOPERS = "write.1on1.developers" + """Allows write access to one-on-one developer conversations.""" + WRITE1_ON1_MANAGER = "write.1on1.manager" + """Allows write access to one-on-one manager conversations.""" + WRITE1_ON1_ALLOWLISTED = "write.1on1.allowlisted" + """Allows write access to allowlisted one-on-one conversations.""" + WRITE1_ON1_TENANT = "write.1on1.tenant" + """Allows write access to tenant-wide one-on-one conversations.""" + READ_GROUP_DEVELOPERS = "read.group.developers" + """Allows read access to developer group conversations.""" + READ_GROUP_ALLOWLISTED = "read.group.allowlisted" + """Allows read access to allowlisted group conversations.""" + READ_GROUP_MANAGER_INVITED = "read.group.manager-invited" + """Allows read access to group conversations where a manager is invited.""" + READ_GROUP_MANAGER_PRESENT = "read.group.manager-present" + """Allows read access to group conversations where a manager is present.""" + READ_GROUP_TENANT = "read.group.tenant" + """Allows read access to tenant-wide group conversations.""" + WRITE_GROUP_DEVELOPERS = "write.group.developers" + """Allows write access to developer group conversations.""" + WRITE_GROUP_ALLOWLISTED = "write.group.allowlisted" + """Allows write access to allowlisted group conversations.""" + WRITE_GROUP_MANAGER_INVITED = "write.group.manager-invited" + """Allows write access to group conversations where a manager is invited.""" + WRITE_GROUP_MANAGER_PRESENT = "write.group.manager-present" + """Allows write access to group conversations where a manager is present.""" + WRITE_GROUP_TENANT = "write.group.tenant" + """Allows write access to tenant-wide group conversations.""" + + class AgentBlueprintReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of AgentBlueprintReferenceType.""" @@ -106,6 +153,66 @@ class AgentIdentityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The agent identity is disabled and cannot be used to access resources.""" +class AgentInsightOverviewSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Identifies where an Agent Insights overview came from.""" + + GENERATED = "generated" + """The overview was generated by Agent Insights.""" + USER_OVERRIDE = "user_override" + """The overview was provided by the user.""" + + +class AgentInsightPromptSurface(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Prompt surface changed by a proposed fix.""" + + INSTRUCTIONS = "instructions" + """The Prompt instructions.""" + TOOL = "tool" + """A function tool definition.""" + + +class AgentInsightProposedFixKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The customer-renderable kind of an agent insight's proposed fix.""" + + PROSE = "prose" + """Text-only remediation guidance.""" + CODE_CHANGE = "code_change" + """A validated source-code change.""" + PROMPT_CHANGE = "prompt_change" + """A validated Prompt change.""" + + +class AgentInsightRunTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The trigger that started an agent insight run.""" + + ON_DEMAND = "on_demand" + """The run was started on demand by a user or client.""" + SCHEDULED = "scheduled" + """The run was started by scheduled insight generation.""" + + +class AgentInsightSeverity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The severity of an agent insight.""" + + HIGH = "high" + """The insight has high severity.""" + MEDIUM = "medium" + """The insight has medium severity.""" + LOW = "low" + """The insight has low severity.""" + + +class AgentInsightStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The lifecycle status of an agent insight.""" + + ACTIVE = "active" + """The insight is active and should be reviewed.""" + RESOLVED = "resolved" + """The insight was resolved by the user.""" + IGNORED = "ignored" + """The insight was ignored by the user.""" + + class AgentKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of AgentKind.""" @@ -493,6 +600,13 @@ class DeploymentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Model deployment.""" +class DigitalWorkerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of digital worker.""" + + M365 = "m365" + """A Microsoft 365 digital worker.""" + + class EvaluationLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The level at which evaluation is performed.""" @@ -819,6 +933,17 @@ class MemoryStoreUpdateStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """SUPERSEDED.""" +class Microsoft365PublishScope(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The publish scope for the generated Microsoft Teams app.""" + + PERSONAL = "Personal" + """Publish the app for the acting user only.""" + SHARED = "Shared" + """Publish the app to a shared scope within the organization.""" + TENANT = "Tenant" + """Publish the app tenant-wide.""" + + class OpenApiAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Authentication type for OpenApi endpoint. Allowed types are: @@ -871,6 +996,24 @@ class PendingUploadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Temporary blob reference.""" +class PublishApprovalStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Microsoft Agent Certification review status of the Microsoft 365 store title published for + an agent. + """ + + NOT_PUBLISHED = "not_published" + """The agent has never been published to the Microsoft 365 store, so there is nothing to review.""" + PENDING = "pending" + """The published title is awaiting a review decision.""" + APPROVED = "approved" + """The title passed review, as of this read.""" + REJECTED = "rejected" + """The title was rejected in review, as of this read.""" + NO_APPROVAL_NEEDED = "no_approval_needed" + """The agent is published at a scope that does not go through Microsoft Agent Certification. Only + tenant-scoped titles are reviewed.""" + + class RankerVersionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of RankerVersionType.""" @@ -916,17 +1059,8 @@ class RealtimeClientEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """RESPONSE_CREATE.""" SESSION_UPDATE = "session.update" """SESSION_UPDATE.""" - - -class RealtimeConversationItemMessageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of RealtimeConversationItemMessageType.""" - - SYSTEM = "system" - """SYSTEM.""" - USER = "user" - """USER.""" - ASSISTANT = "assistant" - """ASSISTANT.""" + SESSION_AVATAR_CONNECT = "session.avatar.connect" + """SESSION_AVATAR_CONNECT.""" class RealtimeConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -1069,6 +1203,28 @@ class RealtimeServerEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """RESPONSE_MCP_CALL_COMPLETED.""" RESPONSE_MCP_CALL_FAILED = "response.mcp_call.failed" """RESPONSE_MCP_CALL_FAILED.""" + WARNING = "warning" + """WARNING.""" + SESSION_AVATAR_CONNECTING = "session.avatar.connecting" + """SESSION_AVATAR_CONNECTING.""" + SESSION_AVATAR_SWITCH_TO_SPEAKING = "session.avatar.switch_to_speaking" + """SESSION_AVATAR_SWITCH_TO_SPEAKING.""" + SESSION_AVATAR_SWITCH_TO_IDLE = "session.avatar.switch_to_idle" + """SESSION_AVATAR_SWITCH_TO_IDLE.""" + RESPONSE_AUDIO_TIMESTAMP_DELTA = "response.audio_timestamp.delta" + """RESPONSE_AUDIO_TIMESTAMP_DELTA.""" + RESPONSE_AUDIO_TIMESTAMP_DONE = "response.audio_timestamp.done" + """RESPONSE_AUDIO_TIMESTAMP_DONE.""" + RESPONSE_ANIMATION_BLENDSHAPES_DELTA = "response.animation_blendshapes.delta" + """RESPONSE_ANIMATION_BLENDSHAPES_DELTA.""" + RESPONSE_ANIMATION_BLENDSHAPES_DONE = "response.animation_blendshapes.done" + """RESPONSE_ANIMATION_BLENDSHAPES_DONE.""" + RESPONSE_ANIMATION_VISEME_DELTA = "response.animation_viseme.delta" + """RESPONSE_ANIMATION_VISEME_DELTA.""" + RESPONSE_ANIMATION_VISEME_DONE = "response.animation_viseme.done" + """RESPONSE_ANIMATION_VISEME_DONE.""" + RESPONSE_VIDEO_DELTA = "response.video.delta" + """RESPONSE_VIDEO_DELTA.""" class ReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -1166,6 +1322,15 @@ class RoutineAttemptSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): """A dispatch fired from a timer delivery.""" +class RoutineDispatchIdentity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The supported identities for routine dispatch authorization.""" + + AGENT = "agent" + """Dispatches with the target agent identity and a foundation token.""" + CREATOR = "creator" + """An explicit customer opt-in to dispatch as the principal that created the routine.""" + + class RoutineDispatchPayloadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The discriminator values supported for manual routine dispatch payloads.""" @@ -1399,10 +1564,12 @@ class ToolboxToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """TOOLBOX_SEARCH.""" TOOLBOX_SEARCH_PREVIEW = "toolbox_search_preview" """TOOLBOX_SEARCH_PREVIEW.""" - WEB_IQ_PREVIEW = "web_iq_preview" - """WEB_IQ_PREVIEW.""" A2_A = "a2a" """A2_A.""" + SHELL = "shell" + """SHELL.""" + WEB_IQ_PREVIEW = "web_iq_preview" + """WEB_IQ_PREVIEW.""" class ToolChoiceOptions(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -1578,6 +1745,33 @@ class VoiceAgentAnimationOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta """VISEME_ID.""" +class VoiceAgentAudioTimestampType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """An output-audio timestamp kind supported by a voice agent.""" + + WORD = "word" + """Word-level timestamps.""" + + +class VoiceAgentAvatarOutputProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The transport used to deliver the avatar video stream.""" + + WEBRTC = "webrtc" + """WEBRTC.""" + WEBSOCKET = "websocket" + """WEBSOCKET.""" + WEBSOCKET_BINARY = "websocket-binary" + """Binary WebSocket transport.""" + + +class VoiceAgentAvatarType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The avatar type.""" + + VIDEO_AVATAR = "video_avatar" + """VIDEO_AVATAR.""" + PHOTO_AVATAR = "photo_avatar" + """PHOTO_AVATAR.""" + + class VoiceAgentEchoCancellationReferenceSource( # pylint: disable=name-too-long str, Enum, metaclass=CaseInsensitiveEnumMeta ): @@ -1589,6 +1783,59 @@ class VoiceAgentEchoCancellationReferenceSource( # pylint: disable=name-too-lon """CLIENT.""" +class VoiceAgentEndOfUtteranceDetectionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The semantic end-of-utterance detection model.""" + + SEMANTIC_DETECTION_V1 = "semantic_detection_v1" + """The default semantic detection model.""" + SEMANTIC_DETECTION_V1_EN = "semantic_detection_v1_en" + """The English-optimized semantic detection model.""" + SEMANTIC_DETECTION_V1_MULTILINGUAL = "semantic_detection_v1_multilingual" + """The multilingual semantic detection model.""" + SMART_END_OF_TURN_DETECTION = "smart_end_of_turn_detection" + """The smart end-of-turn detection model.""" + + +class VoiceAgentEndOfUtteranceThresholdLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The sensitivity threshold for semantic end-of-utterance detection.""" + + LOW = "low" + """The low sensitivity threshold.""" + MEDIUM = "medium" + """The medium sensitivity threshold.""" + HIGH = "high" + """The high sensitivity threshold.""" + DEFAULT = "default" + """The service-selected sensitivity threshold.""" + + +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 + added over time. + """ + + WHISPER1 = "whisper-1" + """OpenAI Whisper.""" + GPT_REALTIME_WHISPER = "gpt-realtime-whisper" + """OpenAI GPT Realtime Whisper.""" + GPT4_O_TRANSCRIBE = "gpt-4o-transcribe" + """OpenAI GPT-4o transcribe.""" + GPT4_O_MINI_TRANSCRIBE = "gpt-4o-mini-transcribe" + """OpenAI GPT-4o mini transcribe.""" + GPT4_O_TRANSCRIBE_DIARIZE = "gpt-4o-transcribe-diarize" + """OpenAI GPT-4o transcribe with speaker diarization.""" + GPT_TRANSCRIBE = "gpt-transcribe" + """OpenAI GPT Transcribe.""" + GPT_LIVE_TRANSCRIBE = "gpt-live-transcribe" + """OpenAI GPT Live Transcribe.""" + MAI_TRANSCRIBE = "mai-transcribe" + """MAI transcription.""" + AZURE_SPEECH = "azure-speech" + """Azure AI Speech to text.""" + + class VoiceAgentInterimResponseTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): """A condition that may trigger an interim response.""" @@ -1598,6 +1845,17 @@ class VoiceAgentInterimResponseTrigger(str, Enum, metaclass=CaseInsensitiveEnumM """TOOL.""" +class VoiceAgentNoiseReductionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The input audio noise reduction mode.""" + + NEAR_FIELD = "near_field" + """NEAR_FIELD.""" + FAR_FIELD = "far_field" + """FAR_FIELD.""" + AZURE_DEEP_NOISE_SUPPRESSION = "azure_deep_noise_suppression" + """Azure deep noise suppression.""" + + class VoiceAgentSessionIncludeOption(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Additional fields that a voice-agent session may include in service outputs.""" @@ -1609,6 +1867,15 @@ class VoiceAgentSessionIncludeOption(str, Enum, metaclass=CaseInsensitiveEnumMet """FILE_SEARCH_CALL_RESULTS.""" +class VoiceAgentSystemToolName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """A service-managed voice-session control action. Known values are stable; additional values may + be added over time. + """ + + END_CONVERSATION = "end_conversation" + """Ends the active conversation.""" + + class VoiceAgentToolResponseScheduling(str, Enum, metaclass=CaseInsensitiveEnumMeta): """When a tool invocation creates a follow-up response. Additional values may be added over time.""" @@ -1622,6 +1889,21 @@ class VoiceAgentToolResponseScheduling(str, Enum, metaclass=CaseInsensitiveEnumM """Create a follow-up response only when no response is active.""" +class VoiceAgentTurnDetectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The turn-detection strategy. Additional values may be added over time.""" + + SERVER_VAD = "server_vad" + """Server-side voice activity detection.""" + SEMANTIC_VAD = "semantic_vad" + """Semantic voice activity detection.""" + AZURE_SEMANTIC_VAD = "azure_semantic_vad" + """Azure semantic voice activity detection.""" + AZURE_SEMANTIC_VAD_EN = "azure_semantic_vad_en" + """English-optimized Azure semantic voice activity detection.""" + AZURE_SEMANTIC_VAD_MULTILINGUAL = "azure_semantic_vad_multilingual" + """Multilingual Azure semantic voice activity detection.""" + + class VoiceAgentWebSocketSubprotocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The WebSocket subprotocol supported by a voice-agent connection.""" @@ -1647,19 +1929,6 @@ class VoiceAudioContainerFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Waveform Audio File Format.""" -class VoiceAudioFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The audio format type. Values follow the OpenAI Realtime wire schema and are exempt from the - snake_case enum-value rule. - """ - - PCM = "audio/pcm" - """16-bit PCM.""" - PCMU = "audio/pcmu" - """G.711 mu-law (telephony).""" - PCMA = "audio/pcma" - """G.711 A-law (telephony).""" - - class VoiceAudioRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): """A voice-audio participant role. Additional values may be added over time.""" @@ -1669,33 +1938,6 @@ class VoiceAudioRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Audio produced by the agent.""" -class VoiceAudioTimestampType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An output-audio timestamp kind supported by a voice agent.""" - - WORD = "word" - """Word-level timestamps.""" - - -class VoiceAvatarOutputProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The transport used to deliver the avatar video stream.""" - - WEBRTC = "webrtc" - """WEBRTC.""" - WEBSOCKET = "websocket" - """WEBSOCKET.""" - WEBSOCKET_BINARY = "websocket-binary" - """Binary WebSocket transport.""" - - -class VoiceAvatarType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The avatar type.""" - - VIDEO_AVATAR = "video_avatar" - """VIDEO_AVATAR.""" - PHOTO_AVATAR = "photo_avatar" - """PHOTO_AVATAR.""" - - class VoiceConversationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The lifecycle status of a persisted voice conversation: @@ -1719,59 +1961,6 @@ class VoiceConversationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): finalization.""" -class VoiceEndOfUtteranceDetectionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The semantic end-of-utterance detection model.""" - - SEMANTIC_DETECTION_V1 = "semantic_detection_v1" - """The default semantic detection model.""" - SEMANTIC_DETECTION_V1_EN = "semantic_detection_v1_en" - """The English-optimized semantic detection model.""" - SEMANTIC_DETECTION_V1_MULTILINGUAL = "semantic_detection_v1_multilingual" - """The multilingual semantic detection model.""" - SMART_END_OF_TURN_DETECTION = "smart_end_of_turn_detection" - """The smart end-of-turn detection model.""" - - -class VoiceEndOfUtteranceThresholdLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The sensitivity threshold for semantic end-of-utterance detection.""" - - LOW = "low" - """The low sensitivity threshold.""" - MEDIUM = "medium" - """The medium sensitivity threshold.""" - HIGH = "high" - """The high sensitivity threshold.""" - DEFAULT = "default" - """The service-selected sensitivity threshold.""" - - -class VoiceInputTranscriptionModel(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 - added over time. - """ - - WHISPER1 = "whisper-1" - """OpenAI Whisper.""" - GPT_REALTIME_WHISPER = "gpt-realtime-whisper" - """OpenAI GPT Realtime Whisper.""" - GPT4_O_TRANSCRIBE = "gpt-4o-transcribe" - """OpenAI GPT-4o transcribe.""" - GPT4_O_MINI_TRANSCRIBE = "gpt-4o-mini-transcribe" - """OpenAI GPT-4o mini transcribe.""" - GPT4_O_TRANSCRIBE_DIARIZE = "gpt-4o-transcribe-diarize" - """OpenAI GPT-4o transcribe with speaker diarization.""" - GPT_TRANSCRIBE = "gpt-transcribe" - """OpenAI GPT Transcribe.""" - GPT_LIVE_TRANSCRIBE = "gpt-live-transcribe" - """OpenAI GPT Live Transcribe.""" - MAI_TRANSCRIBE = "mai-transcribe" - """MAI transcription.""" - AZURE_SPEECH = "azure-speech" - """Azure AI Speech to text.""" - - class VoiceModelType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """How the model backing a voice agent is served. This is independent of the architecture (realtime or cascaded), which the service derives from the selected model. @@ -1783,17 +1972,6 @@ class VoiceModelType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The service uses the customer's own Foundry deployment named by ``model``.""" -class VoiceNoiseReductionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The input audio noise reduction mode.""" - - NEAR_FIELD = "near_field" - """NEAR_FIELD.""" - FAR_FIELD = "far_field" - """FAR_FIELD.""" - AZURE_DEEP_NOISE_SUPPRESSION = "azure_deep_noise_suppression" - """Azure deep noise suppression.""" - - class VoiceOutputModality(str, Enum, metaclass=CaseInsensitiveEnumMeta): """An output modality the agent may produce. ``animation`` and ``avatar`` are used when an avatar is configured. @@ -1809,30 +1987,6 @@ class VoiceOutputModality(str, Enum, metaclass=CaseInsensitiveEnumMeta): """AVATAR.""" -class VoiceSystemToolName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """A service-managed voice-session control action. Known values are stable; additional values may - be added over time. - """ - - END_CONVERSATION = "end_conversation" - """Ends the active conversation.""" - - -class VoiceTurnDetectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The turn-detection strategy. Additional values may be added over time.""" - - SERVER_VAD = "server_vad" - """Server-side voice activity detection.""" - SEMANTIC_VAD = "semantic_vad" - """Semantic voice activity detection.""" - AZURE_SEMANTIC_VAD = "azure_semantic_vad" - """Azure semantic voice activity detection.""" - AZURE_SEMANTIC_VAD_EN = "azure_semantic_vad_en" - """English-optimized Azure semantic voice activity detection.""" - AZURE_SEMANTIC_VAD_MULTILINGUAL = "azure_semantic_vad_multilingual" - """Multilingual Azure semantic voice activity detection.""" - - class VoiceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The voice implementation. 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 8c6af3263d87..530228b75695 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 @@ -43,7 +43,6 @@ PendingUploadType, RealtimeAudioFormatsType, RealtimeClientEventType, - RealtimeConversationItemMessageType, RealtimeConversationItemType, RealtimeMcpErrorType, RealtimeServerEventType, @@ -62,7 +61,7 @@ TriggerType, VersionIndicatorType, VersionSelectorType, - VoiceTurnDetectionType, + VoiceAgentTurnDetectionType, ) if TYPE_CHECKING: @@ -278,13 +277,13 @@ class ToolboxTool(_Model): # pylint: disable=docstring-keyword-should-match-key A2AToolboxTool, A2APreviewToolboxTool, AzureAISearchToolboxTool, BrowserAutomationPreviewToolboxTool, CodeInterpreterToolboxTool, FabricIQPreviewToolboxTool, FileSearchToolboxTool, MCPToolboxTool, OpenApiToolboxTool, ReminderPreviewToolboxTool, - ToolSearchToolboxTool, ToolboxSearchPreviewToolboxTool, WebIQPreviewToolboxTool, - WebSearchToolboxTool, WorkIQPreviewToolboxTool + 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", "web_iq_preview", and "a2a". + "toolbox_search_preview", "a2a", "shell", and "web_iq_preview". :vartype type: str or ~azure.ai.projects.models.ToolboxToolType :ivar name: Optional user-defined name for this tool or configuration. :vartype name: str @@ -301,8 +300,8 @@ class ToolboxTool(_Model): # pylint: disable=docstring-keyword-should-match-key """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\", \"web_iq_preview\", and - \"a2a\".""" + \"fabric_iq_preview\", \"toolbox_search\", \"toolbox_search_preview\", \"a2a\", \"shell\", and + \"web_iq_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"]) @@ -557,10 +556,17 @@ class ActivityProtocolConfiguration(_Model): # pylint: disable=docstring-keywor :ivar enable_m365_public_endpoint: Whether to enable the M365 public endpoint for the activity protocol. :vartype enable_m365_public_endpoint: bool + :ivar access_boundaries: The access boundaries for the activity protocol. + :vartype access_boundaries: list[str or + ~azure.ai.projects.models.ActivityProtocolAccessBoundary] """ enable_m365_public_endpoint: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Whether to enable the M365 public endpoint for the activity protocol.""" + access_boundaries: Optional[list[Union[str, "_models.ActivityProtocolAccessBoundary"]]] = rest_field( + visibility=["read"] + ) + """The access boundaries for the activity protocol.""" @overload def __init__( @@ -995,6 +1001,9 @@ class AgentDetails(_Model): # pylint: disable=docstring-keyword-should-match-ke :vartype versions: ~azure.ai.projects.models.AgentObjectVersions :ivar agent_endpoint: The endpoint configuration for the agent. :vartype agent_endpoint: ~azure.ai.projects.models.AgentEndpointConfig + :ivar digital_worker_type: (Preview) The type of digital worker (previously known as + ``autopilot``). If omitted, it is not a digital worker. "m365" + :vartype digital_worker_type: str or ~azure.ai.projects.models.DigitalWorkerType :ivar instance_identity: The instance identity of the agent. :vartype instance_identity: ~azure.ai.projects.models.AgentIdentity :ivar blueprint: The blueprint for the agent. @@ -1024,6 +1033,11 @@ class AgentDetails(_Model): # pylint: disable=docstring-keyword-should-match-ke visibility=["read", "create", "update", "delete", "query"] ) """The endpoint configuration for the agent.""" + digital_worker_type: Optional[Union[str, "_models.DigitalWorkerType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """(Preview) The type of digital worker (previously known as ``autopilot``). If omitted, it is not + a digital worker. \"m365\"""" instance_identity: Optional["_models.AgentIdentity"] = rest_field(visibility=["read"]) """The instance identity of the agent.""" blueprint: Optional["_models.AgentIdentity"] = rest_field(visibility=["read"]) @@ -1041,6 +1055,7 @@ def __init__( name: str, versions: "_models.AgentObjectVersions", agent_endpoint: Optional["_models.AgentEndpointConfig"] = None, + digital_worker_type: Optional[Union[str, "_models.DigitalWorkerType"]] = None, agent_card: Optional["_models.AgentCard"] = None, ) -> None: ... @@ -1101,6 +1116,13 @@ class AgentEndpointConfig(_Model): # pylint: disable=docstring-keyword-should-m :ivar authorization_schemes: The authorization schemes supported by the agent endpoint. :vartype authorization_schemes: list[~azure.ai.projects.models.AgentEndpointAuthorizationScheme] + :ivar publish_approval_status: The Microsoft Agent Certification review status of the Microsoft + 365 store title published for this agent. Server-populated and best-effort: it is absent when + the status could not be determined, and an absent value must not be interpreted as the agent + not being published. No value is terminal, because publishing a new version of an agent reuses + the same store title and sends it back through review. Known values are: "not_published", + "pending", "approved", "rejected", and "no_approval_needed". + :vartype publish_approval_status: str or ~azure.ai.projects.models.PublishApprovalStatus """ version_selector: Optional["_models.VersionSelector"] = rest_field( @@ -1116,6 +1138,13 @@ class AgentEndpointConfig(_Model): # pylint: disable=docstring-keyword-should-m visibility=["read", "create", "update", "delete", "query"] ) """The authorization schemes supported by the agent endpoint.""" + publish_approval_status: Optional[Union[str, "_models.PublishApprovalStatus"]] = rest_field(visibility=["read"]) + """The Microsoft Agent Certification review status of the Microsoft 365 store title published for + this agent. Server-populated and best-effort: it is absent when the status could not be + determined, and an absent value must not be interpreted as the agent not being published. No + value is terminal, because publishing a new version of an agent reuses the same store title and + sends it back through review. Known values are: \"not_published\", \"pending\", \"approved\", + \"rejected\", and \"no_approval_needed\".""" @overload def __init__( @@ -1328,21 +1357,103 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentObjectVersions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """AgentObjectVersions. +class AgentInsight(_Model): + """A persisted issue discovered from an agent's traces. - :ivar latest: Required. - :vartype latest: ~azure.ai.projects.models.AgentVersionDetails + :ivar id: The insight identifier. Required. + :vartype id: str + :ivar monitor_id: The Agent Insights monitor this insight belongs to. Required. + :vartype monitor_id: str + :ivar agent_name: The agent this insight belongs to. Required. + :vartype agent_name: str + :ivar agent_version: The latest immutable agent version associated with this insight. Required. + :vartype agent_version: str + :ivar title: A short title for the issue. Required. + :vartype title: str + :ivar severity: The severity of the issue. Required. Known values are: "high", "medium", and + "low". + :vartype severity: str or ~azure.ai.projects.models.AgentInsightSeverity + :ivar category: An open, service-generated category label for the issue. Clients must accept + previously unseen values. Required. + :vartype category: str + :ivar status: The lifecycle status of the insight. Required. Known values are: "active", + "resolved", and "ignored". + :vartype status: str or ~azure.ai.projects.models.AgentInsightStatus + :ivar trace_count: The number of traces that provide evidence for this insight. Required. + :vartype trace_count: int + :ivar created_at: The time when this insight was created. Required. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The time when this insight was last updated. Required. + :vartype updated_at: ~datetime.datetime + :ivar description: The root-cause diagnosis for the issue. Required. + :vartype description: str + :ivar details: Additional insight details. Omitted unless details are requested. + :vartype details: ~azure.ai.projects.models.AgentInsightDetails """ - latest: "_models.AgentVersionDetails" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + id: str = rest_field(visibility=["read"]) + """The insight identifier. Required.""" + monitor_id: str = rest_field(visibility=["read"]) + """The Agent Insights monitor this insight belongs to. Required.""" + agent_name: str = rest_field(visibility=["read"]) + """The agent this insight belongs to. Required.""" + agent_version: str = rest_field(visibility=["read"]) + """The latest immutable agent version associated with this insight. Required.""" + title: str = rest_field(visibility=["read"]) + """A short title for the issue. Required.""" + severity: Union[str, "_models.AgentInsightSeverity"] = rest_field(visibility=["read"]) + """The severity of the issue. Required. Known values are: \"high\", \"medium\", and \"low\".""" + category: str = rest_field(visibility=["read"]) + """An open, service-generated category label for the issue. Clients must accept previously unseen + values. Required.""" + status: Union[str, "_models.AgentInsightStatus"] = rest_field(visibility=["read"]) + """The lifecycle status of the insight. Required. Known values are: \"active\", \"resolved\", and + \"ignored\".""" + trace_count: int = rest_field(visibility=["read"]) + """The number of traces that provide evidence for this insight. Required.""" + created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The time when this insight was created. Required.""" + updated_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The time when this insight was last updated. Required.""" + description: str = rest_field(visibility=["read"]) + """The root-cause diagnosis for the issue. Required.""" + details: Optional["_models.AgentInsightDetails"] = rest_field(visibility=["read"]) + """Additional insight details. Omitted unless details are requested.""" + + +class AgentInsightDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Additional insight details. Omitted unless details are requested. + + :ivar highlighted_traces: Up to 5 highlighted traces that provide evidence for this insight. + Required. + :vartype highlighted_traces: list[~azure.ai.projects.models.AgentInsightHighlightedTrace] + :ivar linked_traces: Up to 200 most recent traces linked to this insight as supporting + evidence. Required. + :vartype linked_traces: list[~azure.ai.projects.models.AgentInsightLinkedTrace] + :ivar recommended_actions: The recommended remediation for this insight. Required. + :vartype recommended_actions: ~azure.ai.projects.models.AgentInsightRecommendedAction + """ + + highlighted_traces: list["_models.AgentInsightHighlightedTrace"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Up to 5 highlighted traces that provide evidence for this insight. Required.""" + linked_traces: list["_models.AgentInsightLinkedTrace"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Up to 200 most recent traces linked to this insight as supporting evidence. Required.""" + recommended_actions: "_models.AgentInsightRecommendedAction" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The recommended remediation for this insight. Required.""" @overload def __init__( self, *, - latest: "_models.AgentVersionDetails", + highlighted_traces: list["_models.AgentInsightHighlightedTrace"], + linked_traces: list["_models.AgentInsightLinkedTrace"], + recommended_actions: "_models.AgentInsightRecommendedAction", ) -> None: ... @overload @@ -1356,59 +1467,83 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentOptimizationCandidate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Aggregated evaluation result for a single candidate agent configuration across all tasks. +class AgentInsightEstimatedCost(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Estimated Agent Insights cost. - :ivar candidate_id: Server-assigned candidate identifier. Use with GET /candidates/{id} - sub-endpoints. - :vartype candidate_id: str - :ivar name: Display name of the candidate (e.g., 'baseline', 'instruction-v2'). Required. - :vartype name: str - :ivar mutations: What was mutated from the baseline (e.g., {system_prompt: 'new prompt'}). - :vartype mutations: dict[str, any] - :ivar avg_score: Average composite score across all tasks. Required. - :vartype avg_score: float - :ivar avg_tokens: Average token usage across all tasks. Required. - :vartype avg_tokens: float - :ivar eval_id: Foundry evaluation identifier used to score this candidate. - :vartype eval_id: str - :ivar eval_run_id: Foundry evaluation run identifier for this candidate's scoring run. - :vartype eval_run_id: str - :ivar promotion: Promotion metadata. Null if the candidate has not been promoted. - :vartype promotion: ~azure.ai.projects.models.PromotionInfo + :ivar amount: Estimated cost amount. Required. + :vartype amount: float + :ivar currency: Currency for the estimated cost amount. Agent Insights estimates are reported + in US dollars. Required. Default value is "USD". + :vartype currency: str """ - candidate_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Server-assigned candidate identifier. Use with GET /candidates/{id} sub-endpoints.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Display name of the candidate (e.g., 'baseline', 'instruction-v2'). Required.""" - mutations: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """What was mutated from the baseline (e.g., {system_prompt: 'new prompt'}).""" - avg_score: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Average composite score across all tasks. Required.""" - avg_tokens: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Average token usage across all tasks. Required.""" - eval_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Foundry evaluation identifier used to score this candidate.""" - eval_run_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Foundry evaluation run identifier for this candidate's scoring run.""" - promotion: Optional["_models.PromotionInfo"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + amount: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Estimated cost amount. Required.""" + currency: Literal["USD"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Currency for the estimated cost amount. Agent Insights estimates are reported in US dollars. + Required. Default value is \"USD\".""" + + @overload + def __init__( + self, + *, + amount: 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.currency: Literal["USD"] = "USD" + + +class AgentInsightHighlightedTrace(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A highlighted trace that provides evidence for an agent insight. + + :ivar trace_id: The trace identifier. Required. + :vartype trace_id: str + :ivar summary: A short summary of the trace. Required. + :vartype summary: str + :ivar duration_ms: The end-to-end duration of the trace in milliseconds. Required. + :vartype duration_ms: ~datetime.timedelta + :ivar total_tokens: Aggregate input and output tokens reported across all model inference calls + in this trace, including calls to different models. Intended for relative usage comparison, not + cost estimation. + :vartype total_tokens: int + :ivar timestamp: The time when the trace was recorded. Required. + :vartype timestamp: ~datetime.datetime + """ + + trace_id: str = rest_field(visibility=["read"]) + """The trace identifier. Required.""" + summary: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A short summary of the trace. Required.""" + duration_ms: datetime.timedelta = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" ) - """Promotion metadata. Null if the candidate has not been promoted.""" + """The end-to-end duration of the trace in milliseconds. Required.""" + total_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Aggregate input and output tokens reported across all model inference calls in this trace, + including calls to different models. Intended for relative usage comparison, not cost + estimation.""" + timestamp: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The time when the trace was recorded. Required.""" @overload def __init__( self, *, - name: str, - avg_score: float, - avg_tokens: float, - candidate_id: Optional[str] = None, - mutations: Optional[dict[str, Any]] = None, - eval_id: Optional[str] = None, - eval_run_id: Optional[str] = None, - promotion: Optional["_models.PromotionInfo"] = None, + summary: str, + duration_ms: datetime.timedelta, + timestamp: datetime.datetime, + total_tokens: Optional[int] = None, ) -> None: ... @overload @@ -1422,26 +1557,109 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentOptimizationDatasetCriterion(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Evaluation criterion: a name + instruction pair used for per-item scoring. +class AgentInsightLinkedTrace(_Model): + """A lightweight trace reference linked to an agent insight as supporting evidence. - :ivar name: Criterion name. Required. - :vartype name: str - :ivar instruction: Criterion instruction / description. Required. - :vartype instruction: str + :ivar trace_id: The trace identifier. Required. + :vartype trace_id: str + :ivar timestamp: The time when the trace was recorded. Required. + :vartype timestamp: ~datetime.datetime """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Criterion name. Required.""" - instruction: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Criterion instruction / description. Required.""" + trace_id: str = rest_field(visibility=["read"]) + """The trace identifier. Required.""" + timestamp: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The time when the trace was recorded. Required.""" + + +class AgentInsightMonitor(_Model): + """A per-agent Agent Insights monitor that owns configuration, runs, and discovered insights. + + :ivar id: The monitor identifier. Required. + :vartype id: str + :ivar agent_name: The agent this monitor analyzes. There can be only one monitor per agent. + Required. + :vartype agent_name: str + :ivar enabled: Whether scheduled insight generation is armed for the monitor. Required. + :vartype enabled: bool + :ivar run_interval_hours: Interval between scheduled insight runs, in hours. Required. + :vartype run_interval_hours: float + :ivar model_deployment_name: The model deployment to use for analyzing traces. Accepts either + the deployment name alone or with the connection name as + '{connectionName}/modelDeploymentName'. Required. + :vartype model_deployment_name: str + :ivar next_scheduled_run_at: The next time a scheduled agent insight run will start. Omitted + when scheduled generation is disabled. + :vartype next_scheduled_run_at: ~datetime.datetime + :ivar estimated_cost: Estimated cost accumulated by Agent Insights for this monitor. + :vartype estimated_cost: ~azure.ai.projects.models.AgentInsightEstimatedCost + :ivar suspension: Why the system suspended scheduled generation. Null when the monitor is not + suspended. Required. + :vartype suspension: ~azure.ai.projects.models.AgentInsightSuspension + :ivar overview: The effective overview, or null before an overview is available. Required. + :vartype overview: ~azure.ai.projects.models.AgentInsightsOverview + :ivar updated_at: The time when this monitor was last updated. Required. + :vartype updated_at: ~datetime.datetime + """ + + id: str = rest_field(visibility=["read"]) + """The monitor identifier. Required.""" + agent_name: str = rest_field(visibility=["read"]) + """The agent this monitor analyzes. There can be only one monitor per agent. Required.""" + enabled: bool = rest_field(visibility=["read"]) + """Whether scheduled insight generation is armed for the monitor. Required.""" + run_interval_hours: float = rest_field(visibility=["read"]) + """Interval between scheduled insight runs, in hours. Required.""" + model_deployment_name: str = rest_field(visibility=["read"]) + """The model deployment to use for analyzing traces. Accepts either the deployment name alone or + with the connection name as '{connectionName}/modelDeploymentName'. Required.""" + next_scheduled_run_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") + """The next time a scheduled agent insight run will start. Omitted when scheduled generation is + disabled.""" + estimated_cost: Optional["_models.AgentInsightEstimatedCost"] = rest_field(visibility=["read"]) + """Estimated cost accumulated by Agent Insights for this monitor.""" + suspension: "_models.AgentInsightSuspension" = rest_field(visibility=["read"]) + """Why the system suspended scheduled generation. Null when the monitor is not suspended. + Required.""" + overview: "_models.AgentInsightsOverview" = rest_field(visibility=["read"]) + """The effective overview, or null before an overview is available. Required.""" + updated_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The time when this monitor was last updated. Required.""" + + +class AgentInsightMonitorCreate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Fields accepted when creating an Agent Insights monitor for an agent. + + :ivar agent_name: The agent this monitor should analyze. Required. + :vartype agent_name: str + :ivar enabled: Whether scheduled insight generation should be armed. Defaults to false. + :vartype enabled: bool + :ivar run_interval_hours: Interval between scheduled insight runs, in hours. Defaults to 6. + :vartype run_interval_hours: float + :ivar model_deployment_name: The model deployment to use for analyzing traces. Accepts either + the deployment name alone or with the connection name as + '{connectionName}/modelDeploymentName'. Required. + :vartype model_deployment_name: str + """ + + agent_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The agent this monitor should analyze. Required.""" + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether scheduled insight generation should be armed. Defaults to false.""" + run_interval_hours: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Interval between scheduled insight runs, in hours. Defaults to 6.""" + model_deployment_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The model deployment to use for analyzing traces. Accepts either the deployment name alone or + with the connection name as '{connectionName}/modelDeploymentName'. Required.""" @overload def __init__( self, *, - name: str, - instruction: str, + agent_name: str, + model_deployment_name: str, + enabled: Optional[bool] = None, + run_interval_hours: Optional[float] = None, ) -> None: ... @overload @@ -1455,26 +1673,95 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentOptimizationDatasetInput(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Base discriminated model for dataset input. Either inline items or a registered reference. +class AgentInsightMonitorListItem(_Model): + """An Agent Insights monitor summary returned by list operations. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AgentOptimizationInlineDatasetInput, AgentOptimizationReferenceDatasetInput + :ivar id: The monitor identifier. Required. + :vartype id: str + :ivar agent_name: The agent this monitor analyzes. There can be only one monitor per agent. + Required. + :vartype agent_name: str + :ivar enabled: Whether scheduled insight generation is armed for the monitor. Required. + :vartype enabled: bool + :ivar run_interval_hours: Interval between scheduled insight runs, in hours. Required. + :vartype run_interval_hours: float + :ivar model_deployment_name: The model deployment to use for analyzing traces. Accepts either + the deployment name alone or with the connection name as + '{connectionName}/modelDeploymentName'. Required. + :vartype model_deployment_name: str + :ivar next_scheduled_run_at: The next time a scheduled agent insight run will start. Omitted + when scheduled generation is disabled. + :vartype next_scheduled_run_at: ~datetime.datetime + :ivar estimated_cost: Estimated cost accumulated by Agent Insights for this monitor. + :vartype estimated_cost: ~azure.ai.projects.models.AgentInsightEstimatedCost + :ivar suspension: Why the system suspended scheduled generation. Null when the monitor is not + suspended. Required. + :vartype suspension: ~azure.ai.projects.models.AgentInsightSuspension + :ivar updated_at: The time when this monitor was last updated. Required. + :vartype updated_at: ~datetime.datetime + """ - :ivar type: Dataset input type discriminator. Required. Known values are: "inline" and - "reference". - :vartype type: str or ~azure.ai.projects.models.AgentOptimizationDatasetInputType + id: str = rest_field(visibility=["read"]) + """The monitor identifier. Required.""" + agent_name: str = rest_field(visibility=["read"]) + """The agent this monitor analyzes. There can be only one monitor per agent. Required.""" + enabled: bool = rest_field(visibility=["read"]) + """Whether scheduled insight generation is armed for the monitor. Required.""" + run_interval_hours: float = rest_field(visibility=["read"]) + """Interval between scheduled insight runs, in hours. Required.""" + model_deployment_name: str = rest_field(visibility=["read"]) + """The model deployment to use for analyzing traces. Accepts either the deployment name alone or + with the connection name as '{connectionName}/modelDeploymentName'. Required.""" + next_scheduled_run_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") + """The next time a scheduled agent insight run will start. Omitted when scheduled generation is + disabled.""" + estimated_cost: Optional["_models.AgentInsightEstimatedCost"] = rest_field(visibility=["read"]) + """Estimated cost accumulated by Agent Insights for this monitor.""" + suspension: "_models.AgentInsightSuspension" = rest_field(visibility=["read"]) + """Why the system suspended scheduled generation. Null when the monitor is not suspended. + Required.""" + updated_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The time when this monitor was last updated. Required.""" + + +class AgentInsightMonitorUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Fields that can be updated on an Agent Insights monitor. + + :ivar enabled: Whether scheduled insight generation is armed for the monitor. + :vartype enabled: bool + :ivar run_interval_hours: Interval between scheduled insight runs, in hours. + :vartype run_interval_hours: float + :ivar model_deployment_name: The model deployment to use for analyzing traces. Accepts either + the deployment name alone or with the connection name as + '{connectionName}/modelDeploymentName'. + :vartype model_deployment_name: str + :ivar overview_override: Sets the effective user overview, or clears it when explicitly set to + null. Omission leaves the overview unchanged. This field cannot be combined with other monitor + updates. + :vartype overview_override: ~azure.ai.projects.models.AgentInsightsOverviewOverride """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Dataset input type discriminator. Required. Known values are: \"inline\" and \"reference\".""" + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether scheduled insight generation is armed for the monitor.""" + run_interval_hours: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Interval between scheduled insight runs, in hours.""" + model_deployment_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The model deployment to use for analyzing traces. Accepts either the deployment name alone or + with the connection name as '{connectionName}/modelDeploymentName'.""" + overview_override: Optional["_models.AgentInsightsOverviewOverride"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Sets the effective user overview, or clears it when explicitly set to null. Omission leaves the + overview unchanged. This field cannot be combined with other monitor updates.""" @overload def __init__( self, *, - type: str, + enabled: Optional[bool] = None, + run_interval_hours: Optional[float] = None, + model_deployment_name: Optional[str] = None, + overview_override: Optional["_models.AgentInsightsOverviewOverride"] = None, ) -> None: ... @overload @@ -1488,38 +1775,37 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentOptimizationDatasetItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A single item in an inline dataset. +class AgentInsightProposedFix(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A recommended fix for an agent insight. - :ivar query: The user query / prompt. - :vartype query: str - :ivar ground_truth: Expected ground truth answer. - :vartype ground_truth: str - :ivar desired_num_turns: Desired number of conversation turns for simulation mode (1-20). - :vartype desired_num_turns: int - :ivar criteria: Per-item evaluation criteria. - :vartype criteria: list[~azure.ai.projects.models.AgentOptimizationDatasetCriterion] + :ivar kind: The proposed-fix discriminator. Required. Known values are: "prose", "code_change", + and "prompt_change". + :vartype kind: str or ~azure.ai.projects.models.AgentInsightProposedFixKind + :ivar text: The human-readable remediation guidance. Required. + :vartype text: str + :ivar changes: The concrete changes. Omitted for a prose-only fix. + :vartype changes: list[~azure.ai.projects.models.AgentInsightProposedFixChange] """ - query: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The user query / prompt.""" - ground_truth: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Expected ground truth answer.""" - desired_num_turns: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Desired number of conversation turns for simulation mode (1-20).""" - criteria: Optional[list["_models.AgentOptimizationDatasetCriterion"]] = rest_field( + kind: Union[str, "_models.AgentInsightProposedFixKind"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Per-item evaluation criteria.""" + """The proposed-fix discriminator. Required. Known values are: \"prose\", \"code_change\", and + \"prompt_change\".""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The human-readable remediation guidance. Required.""" + changes: Optional[list["_models.AgentInsightProposedFixChange"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The concrete changes. Omitted for a prose-only fix.""" @overload def __init__( self, *, - query: Optional[str] = None, - ground_truth: Optional[str] = None, - desired_num_turns: Optional[int] = None, - criteria: Optional[list["_models.AgentOptimizationDatasetCriterion"]] = None, + kind: Union[str, "_models.AgentInsightProposedFixKind"], + text: str, + changes: Optional[list["_models.AgentInsightProposedFixChange"]] = None, ) -> None: ... @overload @@ -1533,26 +1819,56 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentOptimizationEvaluatorRef(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Reference to a named evaluator, optionally pinned to a version. +class AgentInsightProposedFixChange(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A customer-renderable change in a proposed fix. - :ivar name: Evaluator name. Required. - :vartype name: str - :ivar version: Evaluator version. If not specified, the latest version is used. - :vartype version: str + :ivar path: The source path changed by a code change. + :vartype path: str + :ivar language: The language of the changed source path. + :vartype language: str + :ivar diff: The unified diff for the changed source path. + :vartype diff: str + :ivar surface: The Prompt surface changed by a Prompt change. Known values are: "instructions" + and "tool". + :vartype surface: str or ~azure.ai.projects.models.AgentInsightPromptSurface + :ivar target: The user-visible target within a Prompt surface, when needed. + :vartype target: str + :ivar old_value: The bounded Prompt value before the change. Present for Prompt changes, + including when null. + :vartype old_value: any + :ivar new_value: The bounded Prompt value after the change. Present for Prompt changes, + including when null. + :vartype new_value: any """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Evaluator name. Required.""" - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Evaluator version. If not specified, the latest version is used.""" + path: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The source path changed by a code change.""" + language: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The language of the changed source path.""" + diff: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unified diff for the changed source path.""" + surface: Optional[Union[str, "_models.AgentInsightPromptSurface"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The Prompt surface changed by a Prompt change. Known values are: \"instructions\" and \"tool\".""" + target: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The user-visible target within a Prompt surface, when needed.""" + old_value: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The bounded Prompt value before the change. Present for Prompt changes, including when null.""" + new_value: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The bounded Prompt value after the change. Present for Prompt changes, including when null.""" @overload def __init__( self, *, - name: str, - version: Optional[str] = None, + path: Optional[str] = None, + language: Optional[str] = None, + diff: Optional[str] = None, + surface: Optional[Union[str, "_models.AgentInsightPromptSurface"]] = None, + target: Optional[str] = None, + old_value: Optional[Any] = None, + new_value: Optional[Any] = None, ) -> None: ... @overload @@ -1566,31 +1882,24 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentOptimizationInlineDatasetInput( - AgentOptimizationDatasetInput, discriminator="inline" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Inline dataset — items supplied directly in the request body. +class AgentInsightRecommendedAction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The recommended remediation for an agent insight. - :ivar type: Dataset input type discriminator. Required. Inline dataset — items are provided - directly in the request body. - :vartype type: str or ~azure.ai.projects.models.INLINE - :ivar dataset_items: Dataset items. Required. - :vartype dataset_items: list[~azure.ai.projects.models.AgentOptimizationDatasetItem] + :ivar proposed_fix: The single recommended fix for the issue represented by the insight. + Required. + :vartype proposed_fix: ~azure.ai.projects.models.AgentInsightProposedFix """ - type: Literal[AgentOptimizationDatasetInputType.INLINE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Dataset input type discriminator. Required. Inline dataset — items are provided directly in the - request body.""" - dataset_items: list["_models.AgentOptimizationDatasetItem"] = rest_field( - name="items", visibility=["read", "create", "update", "delete", "query"] + proposed_fix: "_models.AgentInsightProposedFix" = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Dataset items. Required.""" + """The single recommended fix for the issue represented by the insight. Required.""" @overload def __init__( self, *, - dataset_items: list["_models.AgentOptimizationDatasetItem"], + proposed_fix: "_models.AgentInsightProposedFix", ) -> None: ... @overload @@ -1602,64 +1911,85 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = AgentOptimizationDatasetInputType.INLINE # type: ignore -class AgentOptimizationJob(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Agent optimization job resource — a long-running job that optimizes an agent's configuration - (instructions, model, skills, tools) to maximize evaluation scores. On success, the result - contains scored candidates. +class AgentInsightRun(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A long-running run that analyzes one agent's traces and updates that agent's insights. :ivar id: Server-assigned unique identifier. Required. :vartype id: str :ivar inputs: Caller-supplied inputs. - :vartype inputs: ~azure.ai.projects.models.AgentOptimizationJobInputs + :vartype inputs: ~azure.ai.projects.models.AgentInsightRunCreate :ivar result: Result produced on success. - :vartype result: ~azure.ai.projects.models.AgentOptimizationJobResult + :vartype result: ~azure.ai.projects.models.AgentInsightRunResult :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 created_at: The timestamp when the job was created, represented in Unix time. Required. + :ivar monitor_id: The Agent Insights monitor this run belongs to. Required. + :vartype monitor_id: str + :ivar agent_name: The agent whose traces are analyzed by this run. Required. + :vartype agent_name: str + :ivar trigger: The trigger that started the run. Required. Known values are: "on_demand" and + "scheduled". + :vartype trigger: str or ~azure.ai.projects.models.AgentInsightRunTrigger + :ivar created_at: The time when this run was created. Required. :vartype created_at: ~datetime.datetime - :ivar updated_at: The timestamp when the job was last updated, represented in Unix time. - Required. + :ivar updated_at: The time when this run was last updated. Required. :vartype updated_at: ~datetime.datetime - :ivar progress: Progress snapshot. May be present in terminal states reflecting last-known - progress. - :vartype progress: ~azure.ai.projects.models.AgentOptimizationJobProgress - :ivar warnings: Non-fatal warnings emitted at any point during optimization. - :vartype warnings: list[str] + :ivar window_start: The start of the trace window analyzed by this run. Required. + :vartype window_start: ~datetime.datetime + :ivar window_end: The end of the trace window analyzed by this run. Required. + :vartype window_end: ~datetime.datetime + :ivar started_at: The time when this run started processing. + :vartype started_at: ~datetime.datetime + :ivar completed_at: The time when this run reached a terminal status. + :vartype completed_at: ~datetime.datetime + :ivar model_deployment_name: The model deployment used to analyze traces for this run. + Required. + :vartype model_deployment_name: str """ id: str = rest_field(visibility=["read"]) """Server-assigned unique identifier. Required.""" - inputs: Optional["_models.AgentOptimizationJobInputs"] = rest_field( + inputs: Optional["_models.AgentInsightRunCreate"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Caller-supplied inputs.""" - result: Optional["_models.AgentOptimizationJobResult"] = rest_field(visibility=["read"]) + result: Optional["_models.AgentInsightRunResult"] = rest_field(visibility=["read"]) """Result produced on success.""" status: Union[str, "_models.JobStatus"] = rest_field(visibility=["read"]) """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", \"succeeded\", \"failed\", and \"cancelled\".""" error: Optional["_models.ApiError"] = rest_field(visibility=["read"]) """Error details — populated only on failure.""" + monitor_id: str = rest_field(visibility=["read"]) + """The Agent Insights monitor this run belongs to. Required.""" + agent_name: str = rest_field(visibility=["read"]) + """The agent whose traces are analyzed by this run. Required.""" + trigger: Union[str, "_models.AgentInsightRunTrigger"] = rest_field(visibility=["read"]) + """The trigger that started the run. Required. Known values are: \"on_demand\" and \"scheduled\".""" created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") - """The timestamp when the job was created, represented in Unix time. Required.""" + """The time when this run was created. Required.""" updated_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") - """The timestamp when the job was last updated, represented in Unix time. Required.""" - progress: Optional["_models.AgentOptimizationJobProgress"] = rest_field(visibility=["read"]) - """Progress snapshot. May be present in terminal states reflecting last-known progress.""" - warnings: Optional[list[str]] = rest_field(visibility=["read"]) - """Non-fatal warnings emitted at any point during optimization.""" + """The time when this run was last updated. Required.""" + window_start: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The start of the trace window analyzed by this run. Required.""" + window_end: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The end of the trace window analyzed by this run. Required.""" + started_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") + """The time when this run started processing.""" + completed_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") + """The time when this run reached a terminal status.""" + model_deployment_name: str = rest_field(visibility=["read"]) + """The model deployment used to analyze traces for this run. Required.""" @overload def __init__( self, *, - inputs: Optional["_models.AgentOptimizationJobInputs"] = None, + inputs: Optional["_models.AgentInsightRunCreate"] = None, ) -> None: ... @overload @@ -1673,54 +2003,23 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentOptimizationJobInputs(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Caller-supplied inputs for an optimization job. +class AgentInsightRunCreate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Inputs used when creating an agent insight run. - :ivar agent: The agent (and pinned version) being optimized. Required. - :vartype agent: ~azure.ai.projects.models.OptimizedAgentIdentifier - :ivar train_dataset: Training dataset — either inline items or a reference to a registered - dataset. Required. Required. - :vartype train_dataset: ~azure.ai.projects.models.AgentOptimizationDatasetInput - :ivar validation_dataset: Optional held-out validation dataset for measuring generalization of - the final candidate. - :vartype validation_dataset: ~azure.ai.projects.models.AgentOptimizationDatasetInput - :ivar evaluators: Job-level evaluators referenced by name and optional version. Required; at - least one must be provided. Required. - :vartype evaluators: list[~azure.ai.projects.models.AgentOptimizationEvaluatorRef] - :ivar options: Tuning knobs and run-mode. - :vartype options: ~azure.ai.projects.models.AgentOptimizationOptions + :ivar lookback_hours: Optional finite positive number of hours of trace history to analyze, up + to 2,160. Defaults to 168. + :vartype lookback_hours: float """ - agent: "_models.OptimizedAgentIdentifier" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The agent (and pinned version) being optimized. Required.""" - train_dataset: "_models.AgentOptimizationDatasetInput" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Training dataset — either inline items or a reference to a registered dataset. Required. - Required.""" - validation_dataset: Optional["_models.AgentOptimizationDatasetInput"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Optional held-out validation dataset for measuring generalization of the final candidate.""" - evaluators: list["_models.AgentOptimizationEvaluatorRef"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Job-level evaluators referenced by name and optional version. Required; at least one must be - provided. Required.""" - options: Optional["_models.AgentOptimizationOptions"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Tuning knobs and run-mode.""" + lookback_hours: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional finite positive number of hours of trace history to analyze, up to 2,160. Defaults to + 168.""" @overload def __init__( self, *, - agent: "_models.OptimizedAgentIdentifier", - train_dataset: "_models.AgentOptimizationDatasetInput", - evaluators: list["_models.AgentOptimizationEvaluatorRef"], - validation_dataset: Optional["_models.AgentOptimizationDatasetInput"] = None, - options: Optional["_models.AgentOptimizationOptions"] = None, + lookback_hours: Optional[float] = None, ) -> None: ... @overload @@ -1734,72 +2033,92 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentOptimizationJobListItem(_Model): - """Slim job representation returned by the LIST endpoint. +class AgentInsightRunResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Result statistics produced when an agent insight run succeeds. - :ivar id: Server-assigned unique identifier. Required. - :vartype id: str - :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 created_at: The timestamp when the job was created, represented in Unix time. Required. - :vartype created_at: ~datetime.datetime - :ivar updated_at: The timestamp when the job was last updated, represented in Unix time. - Required. - :vartype updated_at: ~datetime.datetime - :ivar progress: Progress snapshot. May be present in terminal states reflecting last-known - progress. - :vartype progress: ~azure.ai.projects.models.AgentOptimizationJobProgress - :ivar agent: The agent targeted by this optimization job. - :vartype agent: ~azure.ai.projects.models.OptimizedAgentIdentifier + :ivar traces_in_window: The number of traces in the analyzed time window. Required. + :vartype traces_in_window: int + :ivar traces_analyzed: The number of traces analyzed by the run. Required. + :vartype traces_analyzed: int + :ivar insights_created: The number of insights created by the run. Required. + :vartype insights_created: int + :ivar insights_updated: The number of insights updated by the run. Required. + :vartype insights_updated: int + :ivar insights_reopened: The number of insights reopened by the run. Required. + :vartype insights_reopened: int + :ivar token_usage: Token usage for the run's insight-generation analysis. Required. + :vartype token_usage: ~azure.ai.projects.models.AgentInsightTokenUsage """ - id: str = rest_field(visibility=["read"]) - """Server-assigned unique identifier. Required.""" - status: Union[str, "_models.JobStatus"] = rest_field(visibility=["read"]) - """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", - \"succeeded\", \"failed\", and \"cancelled\".""" - error: Optional["_models.ApiError"] = rest_field(visibility=["read"]) - """Error details — populated only on failure.""" - created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") - """The timestamp when the job was created, represented in Unix time. Required.""" - updated_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") - """The timestamp when the job was last updated, represented in Unix time. Required.""" - progress: Optional["_models.AgentOptimizationJobProgress"] = rest_field(visibility=["read"]) - """Progress snapshot. May be present in terminal states reflecting last-known progress.""" - agent: Optional["_models.OptimizedAgentIdentifier"] = rest_field(visibility=["read"]) - """The agent targeted by this optimization job.""" + traces_in_window: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of traces in the analyzed time window. Required.""" + traces_analyzed: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of traces analyzed by the run. Required.""" + insights_created: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of insights created by the run. Required.""" + insights_updated: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of insights updated by the run. Required.""" + insights_reopened: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of insights reopened by the run. Required.""" + token_usage: "_models.AgentInsightTokenUsage" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Token usage for the run's insight-generation analysis. Required.""" + @overload + def __init__( + self, + *, + traces_in_window: int, + traces_analyzed: int, + insights_created: int, + insights_updated: int, + insights_reopened: int, + token_usage: "_models.AgentInsightTokenUsage", + ) -> None: ... -class AgentOptimizationJobProgress(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """In-flight progress; only populated while status is queued or in_progress. + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ - :ivar candidates_completed: Number of candidates whose evaluation has completed so far. - Required. - :vartype candidates_completed: int - :ivar best_score: Best score observed so far across all candidates. Required. - :vartype best_score: float - :ivar elapsed_seconds: Wall-clock time elapsed in seconds since the job began executing. - Required. - :vartype elapsed_seconds: float + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AgentInsightsOverview(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The effective overview for an Agent Insights monitor. + + :ivar content: The overview content. Required. + :vartype content: str + :ivar source: Where the effective overview came from. Required. Known values are: "generated" + and "user_override". + :vartype source: str or ~azure.ai.projects.models.AgentInsightOverviewSource + :ivar updated_at: The time when this overview was last updated. Required. + :vartype updated_at: ~datetime.datetime """ - candidates_completed: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of candidates whose evaluation has completed so far. Required.""" - best_score: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Best score observed so far across all candidates. Required.""" - elapsed_seconds: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Wall-clock time elapsed in seconds since the job began executing. Required.""" + content: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The overview content. Required.""" + source: Union[str, "_models.AgentInsightOverviewSource"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Where the effective overview came from. Required. Known values are: \"generated\" and + \"user_override\".""" + updated_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The time when this overview was last updated. Required.""" @overload def __init__( self, *, - candidates_completed: int, - best_score: float, - elapsed_seconds: float, + content: str, + source: Union[str, "_models.AgentInsightOverviewSource"], + updated_at: datetime.datetime, ) -> None: ... @overload @@ -1813,33 +2132,22 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentOptimizationJobResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Terminal-state result body. Populated when status is succeeded or failed. +class AgentInsightsOverviewOverride(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A user-provided overview that becomes effective immediately and seeds the next generation. - :ivar baseline: Candidate ID of the original (un-optimized) baseline evaluation. - :vartype baseline: str - :ivar best: Candidate ID of the highest-scoring candidate found during optimization. - :vartype best: str - :ivar candidates: All evaluated candidates including baseline. - :vartype candidates: list[~azure.ai.projects.models.AgentOptimizationCandidate] + :ivar content: The nonblank overview content, limited to 64 KiB when encoded as UTF-8. + Required. + :vartype content: str """ - baseline: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Candidate ID of the original (un-optimized) baseline evaluation.""" - best: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Candidate ID of the highest-scoring candidate found during optimization.""" - candidates: Optional[list["_models.AgentOptimizationCandidate"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """All evaluated candidates including baseline.""" + content: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The nonblank overview content, limited to 64 KiB when encoded as UTF-8. Required.""" @overload def __init__( self, *, - baseline: Optional[str] = None, - best: Optional[str] = None, - candidates: Optional[list["_models.AgentOptimizationCandidate"]] = None, + content: str, ) -> None: ... @overload @@ -1853,71 +2161,38 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentOptimizationOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Tuning knobs and run-mode for an optimization job. +class AgentInsightSuspension(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Structured reason why scheduled generation is suspended for a monitor. - :ivar max_candidates: Maximum number of optimization candidates to generate. Must be >= 1. - Default: 5. - :vartype max_candidates: int - :ivar optimization_config: Per-target-attribute configuration overrides. Contains skills, - tools, system_prompt for the agent, plus model space for model optimization. - :vartype optimization_config: dict[str, any] - :ivar eval_model: Model deployment used for evaluation. Defaults to server config (typically - 'gpt-4o'). - :vartype eval_model: str - :ivar optimization_model: Model deployment for optimization reasoning (must be gpt-5 family). - Falls back to the default eval model when not set. - :vartype optimization_model: str - :ivar evaluation_level: Evaluation granularity. Null/omitted means per-item single-turn. Set to - 'conversation' for per-conversation multi-turn simulation scoring. Known values are: "turn" and - "conversation". - :vartype evaluation_level: str or ~azure.ai.projects.models.EvaluationLevel - :ivar max_stalls: Maximum number of consecutive reflective minibatch rejections before stopping - early. A 'stall' occurs when the optimizer proposes a prompt change, evaluates it on a small - subset, and the score does not improve — so no full validation-set evaluation is triggered. The - counter resets whenever a minibatch passes and its full-validation score beats the current - best. Only a sustained plateau of ``max_stalls`` consecutive minibatch failures triggers the - stop. The service defaults to 5 if a value is not specified by the caller. Must be >= 1 when - set. - :vartype max_stalls: int + :ivar code: Stable, machine-readable suspension category. Required. + :vartype code: str + :ivar message: Human-readable description of the suspension. Required. + :vartype message: str + :ivar occurred_at: The time when the suspension occurred. Required. + :vartype occurred_at: ~datetime.datetime + :ivar details: Additional reason-specific suspension details. + :vartype details: dict[str, any] """ - max_candidates: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Maximum number of optimization candidates to generate. Must be >= 1. Default: 5.""" - optimization_config: Optional[dict[str, Any]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Per-target-attribute configuration overrides. Contains skills, tools, system_prompt for the - agent, plus model space for model optimization.""" - eval_model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Model deployment used for evaluation. Defaults to server config (typically 'gpt-4o').""" - optimization_model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Model deployment for optimization reasoning (must be gpt-5 family). Falls back to the default - eval model when not set.""" - evaluation_level: Optional[Union[str, "_models.EvaluationLevel"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Stable, machine-readable suspension category. Required.""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Human-readable description of the suspension. Required.""" + occurred_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" ) - """Evaluation granularity. Null/omitted means per-item single-turn. Set to 'conversation' for - per-conversation multi-turn simulation scoring. Known values are: \"turn\" and - \"conversation\".""" - max_stalls: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Maximum number of consecutive reflective minibatch rejections before stopping early. A 'stall' - occurs when the optimizer proposes a prompt change, evaluates it on a small subset, and the - score does not improve — so no full validation-set evaluation is triggered. The counter resets - whenever a minibatch passes and its full-validation score beats the current best. Only a - sustained plateau of ``max_stalls`` consecutive minibatch failures triggers the stop. The - service defaults to 5 if a value is not specified by the caller. Must be >= 1 when set.""" + """The time when the suspension occurred. Required.""" + details: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Additional reason-specific suspension details.""" @overload def __init__( self, *, - max_candidates: Optional[int] = None, - optimization_config: Optional[dict[str, Any]] = None, - eval_model: Optional[str] = None, - optimization_model: Optional[str] = None, - evaluation_level: Optional[Union[str, "_models.EvaluationLevel"]] = None, - max_stalls: Optional[int] = None, + code: str, + message: str, + occurred_at: datetime.datetime, + details: Optional[dict[str, Any]] = None, ) -> None: ... @overload @@ -1931,34 +2206,36 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentOptimizationReferenceDatasetInput( - AgentOptimizationDatasetInput, discriminator="reference" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Reference to a registered Foundry dataset. +class AgentInsightTokenUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Token usage for an Agent Insights run. - :ivar type: Dataset input type discriminator. Required. Reference to a registered Foundry - dataset by name and version. - :vartype type: str or ~azure.ai.projects.models.REFERENCE - :ivar name: Registered dataset name. Required. - :vartype name: str - :ivar version: Dataset version. If not specified, the latest version is used. - :vartype version: str + :ivar input_tokens: The number of input tokens used by the run. Required. + :vartype input_tokens: int + :ivar output_tokens: The number of output tokens used by the run. Required. + :vartype output_tokens: int + :ivar cached_tokens: The number of input tokens served from cache. + :vartype cached_tokens: int + :ivar total_tokens: The total number of tokens used by the run. Required. + :vartype total_tokens: int """ - type: Literal[AgentOptimizationDatasetInputType.REFERENCE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Dataset input type discriminator. Required. Reference to a registered Foundry dataset by name - and version.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Registered dataset name. Required.""" - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Dataset version. If not specified, the latest version is used.""" + input_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of input tokens used by the run. Required.""" + output_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of output tokens used by the run. Required.""" + cached_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of input tokens served from cache.""" + total_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The total number of tokens used by the run. Required.""" @overload def __init__( self, *, - name: str, - version: Optional[str] = None, + input_tokens: int, + output_tokens: int, + total_tokens: int, + cached_tokens: Optional[int] = None, ) -> None: ... @overload @@ -1970,56 +2247,27 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = AgentOptimizationDatasetInputType.REFERENCE # type: ignore -class AgentSessionResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """An agent session providing a long-lived compute sandbox for hosted agent invocations. +class AgentInsightUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Fields that can be updated on an agent insight. - :ivar agent_session_id: The session identifier. Required. - :vartype agent_session_id: str - :ivar version_indicator: The version indicator determining which agent version backs this - session. Required. - :vartype version_indicator: ~azure.ai.projects.models.VersionIndicator - :ivar status: The current status of the session. Required. Known values are: "creating", - "active", "idle", "updating", "failed", "deleting", "deleted", and "expired". - :vartype status: str or ~azure.ai.projects.models.AgentSessionStatus - :ivar created_at: The Unix timestamp (in seconds) when the session was created. Required. - :vartype created_at: ~datetime.datetime - :ivar last_accessed_at: The Unix timestamp (in seconds) when the session was last accessed. - Required. - :vartype last_accessed_at: ~datetime.datetime - :ivar expires_at: The Unix timestamp (in seconds) when the session expires (rolling, 30 days - from last activity). Required. - :vartype expires_at: ~datetime.datetime + :ivar status: The lifecycle status to apply to the insight. Known values are: "active", + "resolved", and "ignored". + :vartype status: str or ~azure.ai.projects.models.AgentInsightStatus """ - agent_session_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The session identifier. Required.""" - version_indicator: "_models.VersionIndicator" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The version indicator determining which agent version backs this session. Required.""" - status: Union[str, "_models.AgentSessionStatus"] = rest_field( + status: Optional[Union[str, "_models.AgentInsightStatus"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The current status of the session. Required. Known values are: \"creating\", \"active\", - \"idle\", \"updating\", \"failed\", \"deleting\", \"deleted\", and \"expired\".""" - created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") - """The Unix timestamp (in seconds) when the session was created. Required.""" - last_accessed_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") - """The Unix timestamp (in seconds) when the session was last accessed. Required.""" - expires_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") - """The Unix timestamp (in seconds) when the session expires (rolling, 30 days from last activity). - Required.""" + """The lifecycle status to apply to the insight. Known values are: \"active\", \"resolved\", and + \"ignored\".""" @overload def __init__( self, *, - agent_session_id: str, - version_indicator: "_models.VersionIndicator", - status: Union[str, "_models.AgentSessionStatus"], + status: Optional[Union[str, "_models.AgentInsightStatus"]] = None, ) -> None: ... @overload @@ -2033,26 +2281,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationTaxonomyInput(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Input configuration for the evaluation taxonomy. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AgentTaxonomyInput +class AgentObjectVersions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """AgentObjectVersions. - :ivar type: Input type of the evaluation taxonomy. Required. Known values are: "agent" and - "policy". - :vartype type: str or ~azure.ai.projects.models.EvaluationTaxonomyInputType + :ivar latest: Required. + :vartype latest: ~azure.ai.projects.models.AgentVersionDetails """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Input type of the evaluation taxonomy. Required. Known values are: \"agent\" and \"policy\".""" + latest: "_models.AgentVersionDetails" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - type: str, + latest: "_models.AgentVersionDetails", ) -> None: ... @overload @@ -2066,34 +2309,59 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentTaxonomyInput( - EvaluationTaxonomyInput, discriminator="agent" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Input configuration for the evaluation taxonomy when the input type is agent. +class AgentOptimizationCandidate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Aggregated evaluation result for a single candidate agent configuration across all tasks. - :ivar type: Input type of the evaluation taxonomy. Required. Agent. - :vartype type: str or ~azure.ai.projects.models.AGENT - :ivar target: Target configuration for the agent. Required. - :vartype target: ~azure.ai.projects.models.EvaluationTarget - :ivar risk_categories: List of risk categories to evaluate against. Required. - :vartype risk_categories: list[str or ~azure.ai.projects.models.RiskCategory] + :ivar candidate_id: Server-assigned candidate identifier. Use with GET /candidates/{id} + sub-endpoints. + :vartype candidate_id: str + :ivar name: Display name of the candidate (e.g., 'baseline', 'instruction-v2'). Required. + :vartype name: str + :ivar mutations: What was mutated from the baseline (e.g., {system_prompt: 'new prompt'}). + :vartype mutations: dict[str, any] + :ivar avg_score: Average composite score across all tasks. Required. + :vartype avg_score: float + :ivar avg_tokens: Average token usage across all tasks. Required. + :vartype avg_tokens: float + :ivar eval_id: Foundry evaluation identifier used to score this candidate. + :vartype eval_id: str + :ivar eval_run_id: Foundry evaluation run identifier for this candidate's scoring run. + :vartype eval_run_id: str + :ivar promotion: Promotion metadata. Null if the candidate has not been promoted. + :vartype promotion: ~azure.ai.projects.models.PromotionInfo """ - type: Literal[EvaluationTaxonomyInputType.AGENT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Input type of the evaluation taxonomy. Required. Agent.""" - target: "_models.EvaluationTarget" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Target configuration for the agent. Required.""" - risk_categories: list[Union[str, "_models.RiskCategory"]] = rest_field( - name="riskCategories", visibility=["read", "create", "update", "delete", "query"] + candidate_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Server-assigned candidate identifier. Use with GET /candidates/{id} sub-endpoints.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Display name of the candidate (e.g., 'baseline', 'instruction-v2'). Required.""" + mutations: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """What was mutated from the baseline (e.g., {system_prompt: 'new prompt'}).""" + avg_score: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Average composite score across all tasks. Required.""" + avg_tokens: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Average token usage across all tasks. Required.""" + eval_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Foundry evaluation identifier used to score this candidate.""" + eval_run_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Foundry evaluation run identifier for this candidate's scoring run.""" + promotion: Optional["_models.PromotionInfo"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """List of risk categories to evaluate against. Required.""" + """Promotion metadata. Null if the candidate has not been promoted.""" @overload def __init__( self, *, - target: "_models.EvaluationTarget", - risk_categories: list[Union[str, "_models.RiskCategory"]], + name: str, + avg_score: float, + avg_tokens: float, + candidate_id: Optional[str] = None, + mutations: Optional[dict[str, Any]] = None, + eval_id: Optional[str] = None, + eval_run_id: Optional[str] = None, + promotion: Optional["_models.PromotionInfo"] = None, ) -> None: ... @overload @@ -2105,112 +2373,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = EvaluationTaxonomyInputType.AGENT # type: ignore -class AgentVersionDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """AgentVersionDetails. - - :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 AgentOptimizationDatasetCriterion(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Evaluation criterion: a name + instruction pair used for per-item scoring. - 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 object: The object type, which is always 'agent.version'. Required. AGENT_VERSION. - :vartype object: str or ~azure.ai.projects.models.AGENT_VERSION - :ivar id: The unique identifier of the agent version. Required. - :vartype id: str - :ivar name: The name of the agent. Name can be used to retrieve/update/delete the agent. - Required. + :ivar name: Criterion name. Required. :vartype name: str - :ivar version: The version identifier of the agent. Agents are immutable and every update - creates a new version while keeping the name same. Required. - :vartype version: str - :ivar description: A human-readable description of the agent. - :vartype description: str - :ivar created_at: The Unix timestamp (seconds) when the agent was created. Required. - :vartype created_at: ~datetime.datetime - :ivar definition: Required. - :vartype definition: ~azure.ai.projects.models.AgentDefinition - :ivar draft: Whether this agent version is a draft (candidate) rather than a release. Draft - versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. - Defaults to false. - :vartype draft: bool - :ivar status: The provisioning status of the agent version. Defaults to 'active' for non-hosted - agents. For hosted agents, reflects infrastructure readiness. Known values are: "creating", - "active", "failed", "deleting", and "deleted". - :vartype status: str or ~azure.ai.projects.models.AgentVersionStatus - :ivar instance_identity: The instance identity of the agent. - :vartype instance_identity: ~azure.ai.projects.models.AgentIdentity - :ivar blueprint: The blueprint for the agent. - :vartype blueprint: ~azure.ai.projects.models.AgentIdentity - :ivar blueprint_reference: The blueprint for the agent. - :vartype blueprint_reference: ~azure.ai.projects.models.AgentBlueprintReference - :ivar agent_guid: The unique GUID identifier of the agent. - :vartype agent_guid: str + :ivar instruction: Criterion instruction / description. Required. + :vartype instruction: str """ - 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.""" - object: Literal[AgentObjectType.AGENT_VERSION] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The object type, which is always 'agent.version'. Required. AGENT_VERSION.""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the agent version. Required.""" name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the agent. Name can be used to retrieve/update/delete the agent. Required.""" - version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version identifier of the agent. Agents are immutable and every update creates a new - version while keeping the name same. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A human-readable description of the agent.""" - created_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (seconds) when the agent was created. Required.""" - definition: "_models.AgentDefinition" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - draft: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether this agent version is a draft (candidate) rather than a release. Draft versions are - recorded but excluded from default 'latest' resolution and are not auto-promoted. Defaults to - false.""" - status: Optional[Union[str, "_models.AgentVersionStatus"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The provisioning status of the agent version. Defaults to 'active' for non-hosted agents. For - hosted agents, reflects infrastructure readiness. Known values are: \"creating\", \"active\", - \"failed\", \"deleting\", and \"deleted\".""" - instance_identity: Optional["_models.AgentIdentity"] = rest_field(visibility=["read"]) - """The instance identity of the agent.""" - blueprint: Optional["_models.AgentIdentity"] = rest_field(visibility=["read"]) - """The blueprint for the agent.""" - blueprint_reference: Optional["_models.AgentBlueprintReference"] = rest_field(visibility=["read"]) - """The blueprint for the agent.""" - agent_guid: Optional[str] = rest_field(visibility=["read"]) - """The unique GUID identifier of the agent.""" + """Criterion name. Required.""" + instruction: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Criterion instruction / description. Required.""" @overload def __init__( self, *, - metadata: dict[str, str], - object: Literal[AgentObjectType.AGENT_VERSION], - id: str, # pylint: disable=redefined-builtin name: str, - version: str, - created_at: datetime.datetime, - definition: "_models.AgentDefinition", - description: Optional[str] = None, - draft: Optional[bool] = None, - status: Optional[Union[str, "_models.AgentVersionStatus"]] = None, + instruction: str, ) -> None: ... @overload @@ -2224,52 +2408,26 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AISearchIndexResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A AI Search Index resource. +class AgentOptimizationDatasetInput(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Base discriminated model for dataset input. Either inline items or a registered reference. - :ivar project_connection_id: An index connection ID in an IndexResource attached to this agent. - :vartype project_connection_id: str - :ivar index_name: The name of an index in an IndexResource attached to this agent. - :vartype index_name: str - :ivar query_type: Type of query in an AIIndexResource attached to this agent. Known values are: - "simple", "semantic", "vector", "vector_simple_hybrid", and "vector_semantic_hybrid". - :vartype query_type: str or ~azure.ai.projects.models.AzureAISearchQueryType - :ivar top_k: Number of documents to retrieve from search and present to the model. - :vartype top_k: int - :ivar filter: filter string for search resource. `Learn more here - `_. - :vartype filter: str - :ivar index_asset_id: Index asset id for search resource. - :vartype index_asset_id: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AgentOptimizationInlineDatasetInput, AgentOptimizationReferenceDatasetInput + + :ivar type: Dataset input type discriminator. Required. Known values are: "inline" and + "reference". + :vartype type: str or ~azure.ai.projects.models.AgentOptimizationDatasetInputType """ - project_connection_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An index connection ID in an IndexResource attached to this agent.""" - index_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of an index in an IndexResource attached to this agent.""" - query_type: Optional[Union[str, "_models.AzureAISearchQueryType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Type of query in an AIIndexResource attached to this agent. Known values are: \"simple\", - \"semantic\", \"vector\", \"vector_simple_hybrid\", and \"vector_semantic_hybrid\".""" - top_k: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of documents to retrieve from search and present to the model.""" - filter: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """filter string for search resource. `Learn more here - `_.""" - index_asset_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Index asset id for search resource.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Dataset input type discriminator. Required. Known values are: \"inline\" and \"reference\".""" @overload def __init__( self, *, - project_connection_id: Optional[str] = None, - index_name: Optional[str] = None, - query_type: Optional[Union[str, "_models.AzureAISearchQueryType"]] = None, - top_k: Optional[int] = None, - filter: Optional[str] = None, # pylint: disable=redefined-builtin - index_asset_id: Optional[str] = None, + type: str, ) -> None: ... @overload @@ -2283,50 +2441,38 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ApiError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """ApiError. +class AgentOptimizationDatasetItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A single item in an inline dataset. - :ivar code: Required. - :vartype code: str - :ivar message: Required. - :vartype message: str - :ivar param: - :vartype param: str - :ivar type: - :vartype type: str - :ivar details: - :vartype details: list[~azure.ai.projects.models.ApiError] - :ivar additional_info: - :vartype additional_info: dict[str, any] - :ivar debug_info: - :vartype debug_info: dict[str, any] + :ivar query: The user query / prompt. + :vartype query: str + :ivar ground_truth: Expected ground truth answer. + :vartype ground_truth: str + :ivar desired_num_turns: Desired number of conversation turns for simulation mode (1-20). + :vartype desired_num_turns: int + :ivar criteria: Per-item evaluation criteria. + :vartype criteria: list[~azure.ai.projects.models.AgentOptimizationDatasetCriterion] """ - code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - details: Optional[list["_models.ApiError"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - additional_info: Optional[dict[str, Any]] = rest_field( - name="additionalInfo", visibility=["read", "create", "update", "delete", "query"] - ) - debug_info: Optional[dict[str, Any]] = rest_field( - name="debugInfo", visibility=["read", "create", "update", "delete", "query"] + query: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The user query / prompt.""" + ground_truth: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Expected ground truth answer.""" + desired_num_turns: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Desired number of conversation turns for simulation mode (1-20).""" + criteria: Optional[list["_models.AgentOptimizationDatasetCriterion"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) + """Per-item evaluation criteria.""" @overload def __init__( self, *, - code: str, - message: str, - param: Optional[str] = None, - type: Optional[str] = None, - details: Optional[list["_models.ApiError"]] = None, - additional_info: Optional[dict[str, Any]] = None, - debug_info: Optional[dict[str, Any]] = None, + query: Optional[str] = None, + ground_truth: Optional[str] = None, + desired_num_turns: Optional[int] = None, + criteria: Optional[list["_models.AgentOptimizationDatasetCriterion"]] = None, ) -> None: ... @overload @@ -2340,21 +2486,26 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ApiErrorResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Error response for API failures. +class AgentOptimizationEvaluatorRef(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Reference to a named evaluator, optionally pinned to a version. - :ivar error: Required. - :vartype error: ~azure.ai.projects.models.ApiError + :ivar name: Evaluator name. Required. + :vartype name: str + :ivar version: Evaluator version. If not specified, the latest version is used. + :vartype version: str """ - error: "_models.ApiError" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Evaluator name. Required.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Evaluator version. If not specified, the latest version is used.""" @overload def __init__( self, *, - error: "_models.ApiError", + name: str, + version: Optional[str] = None, ) -> None: ... @overload @@ -2368,23 +2519,31 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ApiKeyCredentials(BaseCredentials, discriminator="ApiKey"): - """API Key Credential definition. +class AgentOptimizationInlineDatasetInput( + AgentOptimizationDatasetInput, discriminator="inline" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Inline dataset — items supplied directly in the request body. - :ivar type: The credential type. Required. API Key credential. - :vartype type: str or ~azure.ai.projects.models.API_KEY - :ivar api_key: API Key. - :vartype api_key: str + :ivar type: Dataset input type discriminator. Required. Inline dataset — items are provided + directly in the request body. + :vartype type: str or ~azure.ai.projects.models.INLINE + :ivar dataset_items: Dataset items. Required. + :vartype dataset_items: list[~azure.ai.projects.models.AgentOptimizationDatasetItem] """ - type: Literal[CredentialType.API_KEY] = rest_discriminator(name="type", visibility=["read"]) # type: ignore - """The credential type. Required. API Key credential.""" - api_key: Optional[str] = rest_field(name="key", visibility=["read"]) - """API Key.""" + type: Literal[AgentOptimizationDatasetInputType.INLINE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Dataset input type discriminator. Required. Inline dataset — items are provided directly in the + request body.""" + dataset_items: list["_models.AgentOptimizationDatasetItem"] = rest_field( + name="items", visibility=["read", "create", "update", "delete", "query"] + ) + """Dataset items. Required.""" @overload def __init__( self, + *, + dataset_items: list["_models.AgentOptimizationDatasetItem"], ) -> None: ... @overload @@ -2396,31 +2555,64 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = CredentialType.API_KEY # type: ignore + self.type = AgentOptimizationDatasetInputType.INLINE # type: ignore -class ApplyPatchToolParam( - Tool, discriminator="apply_patch" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Apply patch tool. +class AgentOptimizationJob(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Agent optimization job resource — a long-running job that optimizes an agent's configuration + (instructions, model, skills, tools) to maximize evaluation scores. On success, the result + contains scored candidates. - :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] + :ivar id: Server-assigned unique identifier. Required. + :vartype id: str + :ivar inputs: Caller-supplied inputs. + :vartype inputs: ~azure.ai.projects.models.AgentOptimizationJobInputs + :ivar result: Result produced on success. + :vartype result: ~azure.ai.projects.models.AgentOptimizationJobResult + :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 created_at: The timestamp when the job was created, represented in Unix time. Required. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The timestamp when the job was last updated, represented in Unix time. + Required. + :vartype updated_at: ~datetime.datetime + :ivar progress: Progress snapshot. May be present in terminal states reflecting last-known + progress. + :vartype progress: ~azure.ai.projects.models.AgentOptimizationJobProgress + :ivar warnings: Non-fatal warnings emitted at any point during optimization. + :vartype warnings: list[str] """ - 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( + id: str = rest_field(visibility=["read"]) + """Server-assigned unique identifier. Required.""" + inputs: Optional["_models.AgentOptimizationJobInputs"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) + """Caller-supplied inputs.""" + result: Optional["_models.AgentOptimizationJobResult"] = rest_field(visibility=["read"]) + """Result produced on success.""" + status: Union[str, "_models.JobStatus"] = rest_field(visibility=["read"]) + """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", + \"succeeded\", \"failed\", and \"cancelled\".""" + error: Optional["_models.ApiError"] = rest_field(visibility=["read"]) + """Error details — populated only on failure.""" + created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The timestamp when the job was created, represented in Unix time. Required.""" + updated_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The timestamp when the job was last updated, represented in Unix time. Required.""" + progress: Optional["_models.AgentOptimizationJobProgress"] = rest_field(visibility=["read"]) + """Progress snapshot. May be present in terminal states reflecting last-known progress.""" + warnings: Optional[list[str]] = rest_field(visibility=["read"]) + """Non-fatal warnings emitted at any point during optimization.""" @overload def __init__( self, *, - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, + inputs: Optional["_models.AgentOptimizationJobInputs"] = None, ) -> None: ... @overload @@ -2432,41 +2624,56 @@ 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 ApproximateLocation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """ApproximateLocation. +class AgentOptimizationJobInputs(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Caller-supplied inputs for an optimization job. - :ivar type: The type of location approximation. Always ``approximate``. Required. Default value - is "approximate". - :vartype type: str - :ivar country: - :vartype country: str - :ivar region: - :vartype region: str - :ivar city: - :vartype city: str - :ivar timezone: - :vartype timezone: str + :ivar agent: The agent (and pinned version) being optimized. Required. + :vartype agent: ~azure.ai.projects.models.OptimizedAgentIdentifier + :ivar train_dataset: Training dataset — either inline items or a reference to a registered + dataset. Required. Required. + :vartype train_dataset: ~azure.ai.projects.models.AgentOptimizationDatasetInput + :ivar validation_dataset: Optional held-out validation dataset for measuring generalization of + the final candidate. + :vartype validation_dataset: ~azure.ai.projects.models.AgentOptimizationDatasetInput + :ivar evaluators: Job-level evaluators referenced by name and optional version. Required; at + least one must be provided. Required. + :vartype evaluators: list[~azure.ai.projects.models.AgentOptimizationEvaluatorRef] + :ivar options: Tuning knobs and run-mode. + :vartype options: ~azure.ai.projects.models.AgentOptimizationOptions """ - type: Literal["approximate"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The type of location approximation. Always ``approximate``. Required. Default value is - \"approximate\".""" - country: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - region: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - city: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - timezone: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + agent: "_models.OptimizedAgentIdentifier" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The agent (and pinned version) being optimized. Required.""" + train_dataset: "_models.AgentOptimizationDatasetInput" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Training dataset — either inline items or a reference to a registered dataset. Required. + Required.""" + validation_dataset: Optional["_models.AgentOptimizationDatasetInput"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional held-out validation dataset for measuring generalization of the final candidate.""" + evaluators: list["_models.AgentOptimizationEvaluatorRef"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Job-level evaluators referenced by name and optional version. Required; at least one must be + provided. Required.""" + options: Optional["_models.AgentOptimizationOptions"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Tuning knobs and run-mode.""" @overload def __init__( self, *, - country: Optional[str] = None, - region: Optional[str] = None, - city: Optional[str] = None, - timezone: Optional[str] = None, + agent: "_models.OptimizedAgentIdentifier", + train_dataset: "_models.AgentOptimizationDatasetInput", + evaluators: list["_models.AgentOptimizationEvaluatorRef"], + validation_dataset: Optional["_models.AgentOptimizationDatasetInput"] = None, + options: Optional["_models.AgentOptimizationOptions"] = None, ) -> None: ... @overload @@ -2478,35 +2685,74 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["approximate"] = "approximate" - -class ArtifactProfile(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Artifact profile of the model. - :ivar category: The category of the artifact profile. Required. Known values are: "DataOnly", - "RuntimeDependent", and "Unknown". - :vartype category: str or ~azure.ai.projects.models.FoundryModelArtifactProfileCategory - :ivar signals: Signals detected in the model artifact. - :vartype signals: list[str or ~azure.ai.projects.models.FoundryModelArtifactProfileSignal] - """ +class AgentOptimizationJobListItem(_Model): + """Slim job representation returned by the LIST endpoint. - category: Union[str, "_models.FoundryModelArtifactProfileCategory"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The category of the artifact profile. Required. Known values are: \"DataOnly\", - \"RuntimeDependent\", and \"Unknown\".""" - signals: Optional[list[Union[str, "_models.FoundryModelArtifactProfileSignal"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Signals detected in the model artifact.""" + :ivar id: Server-assigned unique identifier. Required. + :vartype id: str + :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 created_at: The timestamp when the job was created, represented in Unix time. Required. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The timestamp when the job was last updated, represented in Unix time. + Required. + :vartype updated_at: ~datetime.datetime + :ivar progress: Progress snapshot. May be present in terminal states reflecting last-known + progress. + :vartype progress: ~azure.ai.projects.models.AgentOptimizationJobProgress + :ivar agent: The agent targeted by this optimization job. + :vartype agent: ~azure.ai.projects.models.OptimizedAgentIdentifier + """ + + id: str = rest_field(visibility=["read"]) + """Server-assigned unique identifier. Required.""" + status: Union[str, "_models.JobStatus"] = rest_field(visibility=["read"]) + """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", + \"succeeded\", \"failed\", and \"cancelled\".""" + error: Optional["_models.ApiError"] = rest_field(visibility=["read"]) + """Error details — populated only on failure.""" + created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The timestamp when the job was created, represented in Unix time. Required.""" + updated_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The timestamp when the job was last updated, represented in Unix time. Required.""" + progress: Optional["_models.AgentOptimizationJobProgress"] = rest_field(visibility=["read"]) + """Progress snapshot. May be present in terminal states reflecting last-known progress.""" + agent: Optional["_models.OptimizedAgentIdentifier"] = rest_field(visibility=["read"]) + """The agent targeted by this optimization job.""" + + +class AgentOptimizationJobProgress(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """In-flight progress; only populated while status is queued or in_progress. + + :ivar candidates_completed: Number of candidates whose evaluation has completed so far. + Required. + :vartype candidates_completed: int + :ivar best_score: Best score observed so far across all candidates. Required. + :vartype best_score: float + :ivar elapsed_seconds: Wall-clock time elapsed in seconds since the job began executing. + Required. + :vartype elapsed_seconds: float + """ + + candidates_completed: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Number of candidates whose evaluation has completed so far. Required.""" + best_score: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Best score observed so far across all candidates. Required.""" + elapsed_seconds: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Wall-clock time elapsed in seconds since the job began executing. Required.""" @overload def __init__( self, *, - category: Union[str, "_models.FoundryModelArtifactProfileCategory"], - signals: Optional[list[Union[str, "_models.FoundryModelArtifactProfileSignal"]]] = None, + candidates_completed: int, + best_score: float, + elapsed_seconds: float, ) -> None: ... @overload @@ -2520,38 +2766,33 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AutoCodeInterpreterToolParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Automatic Code Interpreter Tool Parameters. +class AgentOptimizationJobResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Terminal-state result body. Populated when status is succeeded or failed. - :ivar type: Always ``auto``. Required. Default value is "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 network_policy: - :vartype network_policy: ~azure.ai.projects.models.ContainerNetworkPolicyParam + :ivar baseline: Candidate ID of the original (un-optimized) baseline evaluation. + :vartype baseline: str + :ivar best: Candidate ID of the highest-scoring candidate found during optimization. + :vartype best: str + :ivar candidates: All evaluated candidates including baseline. + :vartype candidates: list[~azure.ai.projects.models.AgentOptimizationCandidate] """ - type: Literal["auto"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Always ``auto``. Required. Default value is \"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\".""" - network_policy: Optional["_models.ContainerNetworkPolicyParam"] = rest_field( + baseline: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Candidate ID of the original (un-optimized) baseline evaluation.""" + best: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Candidate ID of the highest-scoring candidate found during optimization.""" + candidates: Optional[list["_models.AgentOptimizationCandidate"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) + """All evaluated candidates including baseline.""" @overload def __init__( self, *, - file_ids: Optional[list[str]] = None, - memory_limit: Optional[Union[str, "_models.ContainerMemoryLimit"]] = None, - network_policy: Optional["_models.ContainerNetworkPolicyParam"] = None, + baseline: Optional[str] = None, + best: Optional[str] = None, + candidates: Optional[list["_models.AgentOptimizationCandidate"]] = None, ) -> None: ... @overload @@ -2563,28 +2804,73 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["auto"] = "auto" - -class EvaluationTarget(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Base class for targets with discriminator support. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AzureAIAgentTarget, AzureAIModelTarget +class AgentOptimizationOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Tuning knobs and run-mode for an optimization job. - :ivar type: The type of target. Required. Default value is None. - :vartype type: str + :ivar max_candidates: Maximum number of optimization candidates to generate. Must be >= 1. + Default: 5. + :vartype max_candidates: int + :ivar optimization_config: Per-target-attribute configuration overrides. Contains skills, + tools, system_prompt for the agent, plus model space for model optimization. + :vartype optimization_config: dict[str, any] + :ivar eval_model: Model deployment used for evaluation. Defaults to server config (typically + 'gpt-4o'). + :vartype eval_model: str + :ivar optimization_model: Model deployment for optimization reasoning (must be gpt-5 family). + Falls back to the default eval model when not set. + :vartype optimization_model: str + :ivar evaluation_level: Evaluation granularity. Null/omitted means per-item single-turn. Set to + 'conversation' for per-conversation multi-turn simulation scoring. Known values are: "turn" and + "conversation". + :vartype evaluation_level: str or ~azure.ai.projects.models.EvaluationLevel + :ivar max_stalls: Maximum number of consecutive reflective minibatch rejections before stopping + early. A 'stall' occurs when the optimizer proposes a prompt change, evaluates it on a small + subset, and the score does not improve — so no full validation-set evaluation is triggered. The + counter resets whenever a minibatch passes and its full-validation score beats the current + best. Only a sustained plateau of ``max_stalls`` consecutive minibatch failures triggers the + stop. The service defaults to 5 if a value is not specified by the caller. Must be >= 1 when + set. + :vartype max_stalls: int """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of target. Required. Default value is None.""" + max_candidates: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Maximum number of optimization candidates to generate. Must be >= 1. Default: 5.""" + optimization_config: Optional[dict[str, Any]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Per-target-attribute configuration overrides. Contains skills, tools, system_prompt for the + agent, plus model space for model optimization.""" + eval_model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Model deployment used for evaluation. Defaults to server config (typically 'gpt-4o').""" + optimization_model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Model deployment for optimization reasoning (must be gpt-5 family). Falls back to the default + eval model when not set.""" + evaluation_level: Optional[Union[str, "_models.EvaluationLevel"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Evaluation granularity. Null/omitted means per-item single-turn. Set to 'conversation' for + per-conversation multi-turn simulation scoring. Known values are: \"turn\" and + \"conversation\".""" + max_stalls: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Maximum number of consecutive reflective minibatch rejections before stopping early. A 'stall' + occurs when the optimizer proposes a prompt change, evaluates it on a small subset, and the + score does not improve — so no full validation-set evaluation is triggered. The counter resets + whenever a minibatch passes and its full-validation score beats the current best. Only a + sustained plateau of ``max_stalls`` consecutive minibatch failures triggers the stop. The + service defaults to 5 if a value is not specified by the caller. Must be >= 1 when set.""" @overload def __init__( self, *, - type: str, + max_candidates: Optional[int] = None, + optimization_config: Optional[dict[str, Any]] = None, + eval_model: Optional[str] = None, + optimization_model: Optional[str] = None, + evaluation_level: Optional[Union[str, "_models.EvaluationLevel"]] = None, + max_stalls: Optional[int] = None, ) -> None: ... @overload @@ -2598,36 +2884,27 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AzureAIAgentTarget( - EvaluationTarget, discriminator="azure_ai_agent" +class AgentOptimizationReferenceDatasetInput( + AgentOptimizationDatasetInput, discriminator="reference" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Represents a target specifying an Azure AI agent. + """Reference to a registered Foundry dataset. - :ivar type: The type of target, always ``azure_ai_agent``. Required. Default value is - "azure_ai_agent". - :vartype type: str - :ivar name: The unique identifier of the Azure AI agent. Required. + :ivar type: Dataset input type discriminator. Required. Reference to a registered Foundry + dataset by name and version. + :vartype type: str or ~azure.ai.projects.models.REFERENCE + :ivar name: Registered dataset name. Required. :vartype name: str - :ivar version: The version of the Azure AI agent. + :ivar version: Dataset version. If not specified, the latest version is used. :vartype version: str - :ivar tool_descriptions: The parameters used to control the sampling behavior of the agent - during text generation. - :vartype tool_descriptions: list[~azure.ai.projects.models.ToolDescription] - :ivar tools: - :vartype tools: list[~azure.ai.projects.models.Tool] """ - type: Literal["azure_ai_agent"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of target, always ``azure_ai_agent``. Required. Default value is \"azure_ai_agent\".""" + type: Literal[AgentOptimizationDatasetInputType.REFERENCE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Dataset input type discriminator. Required. Reference to a registered Foundry dataset by name + and version.""" name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the Azure AI agent. Required.""" + """Registered dataset name. Required.""" version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version of the Azure AI agent.""" - tool_descriptions: Optional[list["_models.ToolDescription"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The parameters used to control the sampling behavior of the agent during text generation.""" - tools: Optional[list["_models.Tool"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Dataset version. If not specified, the latest version is used.""" @overload def __init__( @@ -2635,8 +2912,6 @@ def __init__( *, name: str, version: Optional[str] = None, - tool_descriptions: Optional[list["_models.ToolDescription"]] = None, - tools: Optional[list["_models.Tool"]] = None, ) -> None: ... @overload @@ -2648,41 +2923,58 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "azure_ai_agent" # type: ignore + self.type = AgentOptimizationDatasetInputType.REFERENCE # type: ignore -class AzureAIModelTarget( - EvaluationTarget, discriminator="azure_ai_model" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Represents a target specifying an Azure AI model for operations requiring model selection. +class AgentSessionResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An agent session providing a long-lived compute sandbox for hosted agent invocations. - :ivar type: The type of target, always ``azure_ai_model``. Required. Default value is - "azure_ai_model". - :vartype type: str - :ivar model: The unique identifier of the Azure AI model. - :vartype model: str - :ivar sampling_params: The parameters used to control the sampling behavior of the model during - text generation. - :vartype sampling_params: ~azure.ai.projects.models.ModelSamplingParams + :ivar agent_session_id: The session identifier. Required. + :vartype agent_session_id: str + :ivar version_indicator: The version indicator determining which agent version backs this + session. Required. + :vartype version_indicator: ~azure.ai.projects.models.VersionIndicator + :ivar status: The current status of the session. Required. Known values are: "creating", + "active", "idle", "updating", "failed", "deleting", "deleted", and "expired". + :vartype status: str or ~azure.ai.projects.models.AgentSessionStatus + :ivar created_at: The Unix timestamp (in seconds) when the session was created. Required. + :vartype created_at: ~datetime.datetime + :ivar last_accessed_at: The Unix timestamp (in seconds) when the session was last accessed. + Required. + :vartype last_accessed_at: ~datetime.datetime + :ivar expires_at: The Unix timestamp (in seconds) when the session expires (rolling, 30 days + from last activity). Required. + :vartype expires_at: ~datetime.datetime """ - type: Literal["azure_ai_model"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of target, always ``azure_ai_model``. Required. Default value is \"azure_ai_model\".""" - model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the Azure AI model.""" - sampling_params: Optional["_models.ModelSamplingParams"] = rest_field( + agent_session_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The session identifier. Required.""" + version_indicator: "_models.VersionIndicator" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The parameters used to control the sampling behavior of the model during text generation.""" - - @overload - def __init__( - self, - *, - model: Optional[str] = None, - sampling_params: Optional["_models.ModelSamplingParams"] = None, - ) -> None: ... - + """The version indicator determining which agent version backs this session. Required.""" + status: Union[str, "_models.AgentSessionStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The current status of the session. Required. Known values are: \"creating\", \"active\", + \"idle\", \"updating\", \"failed\", \"deleting\", \"deleted\", and \"expired\".""" + created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The Unix timestamp (in seconds) when the session was created. Required.""" + last_accessed_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The Unix timestamp (in seconds) when the session was last accessed. Required.""" + expires_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The Unix timestamp (in seconds) when the session expires (rolling, 30 days from last activity). + Required.""" + + @overload + def __init__( + self, + *, + agent_session_id: str, + version_indicator: "_models.VersionIndicator", + status: Union[str, "_models.AgentSessionStatus"], + ) -> None: ... + @overload def __init__(self, mapping: Mapping[str, Any]) -> None: """ @@ -2692,52 +2984,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "azure_ai_model" # type: ignore -class Index(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Index resource Definition. +class EvaluationTaxonomyInput(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Input configuration for the evaluation taxonomy. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AzureAISearchIndex, CosmosDBIndex, ManagedAzureAISearchIndex + AgentTaxonomyInput - :ivar type: Type of index. Required. Known values are: "AzureSearch", - "CosmosDBNoSqlVectorStore", and "ManagedAzureSearch". - :vartype type: str or ~azure.ai.projects.models.IndexType - :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: Input type of the evaluation taxonomy. Required. Known values are: "agent" and + "policy". + :vartype type: str or ~azure.ai.projects.models.EvaluationTaxonomyInputType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Type of index. Required. Known values are: \"AzureSearch\", \"CosmosDBNoSqlVectorStore\", and - \"ManagedAzureSearch\".""" - 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=["create", "update"]) - """The asset description text.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["create", "update"]) - """Tag dictionary. Tags can be added, removed, and updated.""" + """Input type of the evaluation taxonomy. Required. Known values are: \"agent\" and \"policy\".""" @overload def __init__( self, *, type: str, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -2751,49 +3019,34 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AzureAISearchIndex( - Index, discriminator="AzureSearch" +class AgentTaxonomyInput( + EvaluationTaxonomyInput, discriminator="agent" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Azure AI Search Index Definition. + """Input configuration for the evaluation taxonomy when the input type is agent. - :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. Azure search. - :vartype type: str or ~azure.ai.projects.models.AZURE_SEARCH - :ivar connection_name: Name of connection to Azure AI Search. Required. - :vartype connection_name: str - :ivar index_name: Name of index in Azure AI Search resource to attach. Required. - :vartype index_name: str - :ivar field_mapping: Field mapping configuration. - :vartype field_mapping: ~azure.ai.projects.models.FieldMapping + :ivar type: Input type of the evaluation taxonomy. Required. Agent. + :vartype type: str or ~azure.ai.projects.models.AGENT + :ivar target: Target configuration for the agent. Required. + :vartype target: ~azure.ai.projects.models.EvaluationTarget + :ivar risk_categories: List of risk categories to evaluate against. Required. + :vartype risk_categories: list[str or ~azure.ai.projects.models.RiskCategory] """ - type: Literal[IndexType.AZURE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Type of index. Required. Azure search.""" - connection_name: str = rest_field(name="connectionName", visibility=["create"]) - """Name of connection to Azure AI Search. Required.""" - index_name: str = rest_field(name="indexName", visibility=["create"]) - """Name of index in Azure AI Search resource to attach. Required.""" - field_mapping: Optional["_models.FieldMapping"] = rest_field(name="fieldMapping", visibility=["create"]) - """Field mapping configuration.""" + type: Literal[EvaluationTaxonomyInputType.AGENT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Input type of the evaluation taxonomy. Required. Agent.""" + target: "_models.EvaluationTarget" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Target configuration for the agent. Required.""" + risk_categories: list[Union[str, "_models.RiskCategory"]] = rest_field( + name="riskCategories", visibility=["read", "create", "update", "delete", "query"] + ) + """List of risk categories to evaluate against. Required.""" @overload def __init__( self, *, - connection_name: str, - index_name: str, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, - field_mapping: Optional["_models.FieldMapping"] = None, + target: "_models.EvaluationTarget", + risk_categories: list[Union[str, "_models.RiskCategory"]], ) -> None: ... @overload @@ -2805,51 +3058,112 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = IndexType.AZURE_SEARCH # type: ignore + self.type = EvaluationTaxonomyInputType.AGENT # type: ignore -class AzureAISearchTool( - Tool, discriminator="azure_ai_search" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """The input definition information for an Azure AI search tool as used to configure an agent. +class AgentVersionDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """AgentVersionDetails. - :ivar type: The object type, which is always 'azure_ai_search'. Required. AZURE_AI_SEARCH. - :vartype type: str or ~azure.ai.projects.models.AZURE_AI_SEARCH - :ivar name: Deprecated. This property is deprecated and will be removed in a future version. + :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 object: The object type, which is always 'agent.version'. Required. AGENT_VERSION. + :vartype object: str or ~azure.ai.projects.models.AGENT_VERSION + :ivar id: The unique identifier of the agent version. Required. + :vartype id: str + :ivar name: The name of the agent. Name can be used to retrieve/update/delete the agent. + Required. :vartype name: str - :ivar description: Deprecated. This property is deprecated and will be removed in a future - version. + :ivar version: The version identifier of the agent. Agents are immutable and every update + creates a new version while keeping the name same. Required. + :vartype version: str + :ivar description: A human-readable description of the agent. :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 azure_ai_search: The azure ai search index resource. Required. - :vartype azure_ai_search: ~azure.ai.projects.models.AzureAISearchToolResource + :ivar created_at: The Unix timestamp (seconds) when the agent was created. Required. + :vartype created_at: ~datetime.datetime + :ivar definition: Required. + :vartype definition: ~azure.ai.projects.models.AgentDefinition + :ivar draft: Whether this agent version is a draft (candidate) rather than a release. Draft + versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. + Defaults to false. + :vartype draft: bool + :ivar status: The provisioning status of the agent version. Defaults to 'active' for non-hosted + agents. For hosted agents, reflects infrastructure readiness. Known values are: "creating", + "active", "failed", "deleting", and "deleted". + :vartype status: str or ~azure.ai.projects.models.AgentVersionStatus + :ivar instance_identity: The instance identity of the agent. + :vartype instance_identity: ~azure.ai.projects.models.AgentIdentity + :ivar blueprint: The blueprint for the agent. + :vartype blueprint: ~azure.ai.projects.models.AgentIdentity + :ivar blueprint_reference: The blueprint for the agent. + :vartype blueprint_reference: ~azure.ai.projects.models.AgentBlueprintReference + :ivar agent_guid: The unique GUID identifier of the agent. + :vartype agent_guid: str """ - type: Literal[ToolType.AZURE_AI_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'azure_ai_search'. Required. AZURE_AI_SEARCH.""" - 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( + 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.""" + object: Literal[AgentObjectType.AGENT_VERSION] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Deprecated. This property is deprecated and will be removed in a future version.""" - azure_ai_search: "_models.AzureAISearchToolResource" = rest_field( + """The object type, which is always 'agent.version'. Required. AGENT_VERSION.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the agent version. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the agent. Name can be used to retrieve/update/delete the agent. Required.""" + version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version identifier of the agent. Agents are immutable and every update creates a new + version while keeping the name same. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A human-readable description of the agent.""" + created_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (seconds) when the agent was created. Required.""" + definition: "_models.AgentDefinition" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + draft: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether this agent version is a draft (candidate) rather than a release. Draft versions are + recorded but excluded from default 'latest' resolution and are not auto-promoted. Defaults to + false.""" + status: Optional[Union[str, "_models.AgentVersionStatus"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The azure ai search index resource. Required.""" + """The provisioning status of the agent version. Defaults to 'active' for non-hosted agents. For + hosted agents, reflects infrastructure readiness. Known values are: \"creating\", \"active\", + \"failed\", \"deleting\", and \"deleted\".""" + instance_identity: Optional["_models.AgentIdentity"] = rest_field(visibility=["read"]) + """The instance identity of the agent.""" + blueprint: Optional["_models.AgentIdentity"] = rest_field(visibility=["read"]) + """The blueprint for the agent.""" + blueprint_reference: Optional["_models.AgentBlueprintReference"] = rest_field(visibility=["read"]) + """The blueprint for the agent.""" + agent_guid: Optional[str] = rest_field(visibility=["read"]) + """The unique GUID identifier of the agent.""" @overload def __init__( self, *, - azure_ai_search: "_models.AzureAISearchToolResource", - name: Optional[str] = None, + metadata: dict[str, str], + object: Literal[AgentObjectType.AGENT_VERSION], + id: str, # pylint: disable=redefined-builtin + name: str, + version: str, + created_at: datetime.datetime, + definition: "_models.AgentDefinition", description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + draft: Optional[bool] = None, + status: Optional[Union[str, "_models.AgentVersionStatus"]] = None, ) -> None: ... @overload @@ -2861,43 +3175,54 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.AZURE_AI_SEARCH # type: ignore -class AzureAISearchToolboxTool( - ToolboxTool, discriminator="azure_ai_search" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """An Azure AI 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: Required. AZURE_AI_SEARCH. - :vartype type: str or ~azure.ai.projects.models.AZURE_AI_SEARCH - :ivar azure_ai_search: The azure ai search index resource. Required. - :vartype azure_ai_search: ~azure.ai.projects.models.AzureAISearchToolResource - """ +class AISearchIndexResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A AI Search Index resource. - type: Literal[ToolboxToolType.AZURE_AI_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. AZURE_AI_SEARCH.""" - azure_ai_search: "_models.AzureAISearchToolResource" = rest_field( - visibility=["read", "create", "update", "delete", "query"] + :ivar project_connection_id: An index connection ID in an IndexResource attached to this agent. + :vartype project_connection_id: str + :ivar index_name: The name of an index in an IndexResource attached to this agent. + :vartype index_name: str + :ivar query_type: Type of query in an AIIndexResource attached to this agent. Known values are: + "simple", "semantic", "vector", "vector_simple_hybrid", and "vector_semantic_hybrid". + :vartype query_type: str or ~azure.ai.projects.models.AzureAISearchQueryType + :ivar top_k: Number of documents to retrieve from search and present to the model. + :vartype top_k: int + :ivar filter: filter string for search resource. `Learn more here + `_. + :vartype filter: str + :ivar index_asset_id: Index asset id for search resource. + :vartype index_asset_id: str + """ + + project_connection_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An index connection ID in an IndexResource attached to this agent.""" + index_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of an index in an IndexResource attached to this agent.""" + query_type: Optional[Union[str, "_models.AzureAISearchQueryType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The azure ai search index resource. Required.""" + """Type of query in an AIIndexResource attached to this agent. Known values are: \"simple\", + \"semantic\", \"vector\", \"vector_simple_hybrid\", and \"vector_semantic_hybrid\".""" + top_k: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Number of documents to retrieve from search and present to the model.""" + filter: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """filter string for search resource. `Learn more here + `_.""" + index_asset_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Index asset id for search resource.""" @overload def __init__( self, *, - azure_ai_search: "_models.AzureAISearchToolResource", - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + project_connection_id: Optional[str] = None, + index_name: Optional[str] = None, + query_type: Optional[Union[str, "_models.AzureAISearchQueryType"]] = None, + top_k: Optional[int] = None, + filter: Optional[str] = None, # pylint: disable=redefined-builtin + index_asset_id: Optional[str] = None, ) -> None: ... @overload @@ -2909,28 +3234,52 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolboxToolType.AZURE_AI_SEARCH # type: ignore -class AzureAISearchToolResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A set of index resources used by the ``azure_ai_search`` tool. +class ApiError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ApiError. - :ivar indexes: The indices attached to this agent. There can be a maximum of 1 index resource - attached to the agent. Required. - :vartype indexes: list[~azure.ai.projects.models.AISearchIndexResource] + :ivar code: Required. + :vartype code: str + :ivar message: Required. + :vartype message: str + :ivar param: + :vartype param: str + :ivar type: + :vartype type: str + :ivar details: + :vartype details: list[~azure.ai.projects.models.ApiError] + :ivar additional_info: + :vartype additional_info: dict[str, any] + :ivar debug_info: + :vartype debug_info: dict[str, any] """ - indexes: list["_models.AISearchIndexResource"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + details: Optional[list["_models.ApiError"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + additional_info: Optional[dict[str, Any]] = rest_field( + name="additionalInfo", visibility=["read", "create", "update", "delete", "query"] + ) + debug_info: Optional[dict[str, Any]] = rest_field( + name="debugInfo", visibility=["read", "create", "update", "delete", "query"] ) - """The indices attached to this agent. There can be a maximum of 1 index resource attached to the - agent. Required.""" @overload def __init__( self, *, - indexes: list["_models.AISearchIndexResource"], + code: str, + message: str, + param: Optional[str] = None, + type: Optional[str] = None, + details: Optional[list["_models.ApiError"]] = None, + additional_info: Optional[dict[str, Any]] = None, + debug_info: Optional[dict[str, Any]] = None, ) -> None: ... @overload @@ -2944,29 +3293,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AzureFunctionBinding(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The structure for keeping storage queue name and URI. +class ApiErrorResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Error response for API failures. - :ivar type: The type of binding, which is always 'storage_queue'. Required. Default value is - "storage_queue". - :vartype type: str - :ivar storage_queue: Storage queue. Required. - :vartype storage_queue: ~azure.ai.projects.models.AzureFunctionStorageQueue + :ivar error: Required. + :vartype error: ~azure.ai.projects.models.ApiError """ - type: Literal["storage_queue"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The type of binding, which is always 'storage_queue'. Required. Default value is - \"storage_queue\".""" - storage_queue: "_models.AzureFunctionStorageQueue" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Storage queue. Required.""" + error: "_models.ApiError" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - storage_queue: "_models.AzureFunctionStorageQueue", + error: "_models.ApiError", ) -> None: ... @overload @@ -2978,44 +3319,25 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["storage_queue"] = "storage_queue" -class AzureFunctionDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The definition of Azure function. +class ApiKeyCredentials(BaseCredentials, discriminator="ApiKey"): + """API Key Credential definition. - :ivar function: The definition of azure function and its parameters. Required. - :vartype function: ~azure.ai.projects.models.AzureFunctionDefinitionFunction - :ivar input_binding: Input storage queue. The queue storage trigger runs a function as messages - are added to it. Required. - :vartype input_binding: ~azure.ai.projects.models.AzureFunctionBinding - :ivar output_binding: Output storage queue. The function writes output to this queue when the - input items are processed. Required. - :vartype output_binding: ~azure.ai.projects.models.AzureFunctionBinding + :ivar type: The credential type. Required. API Key credential. + :vartype type: str or ~azure.ai.projects.models.API_KEY + :ivar api_key: API Key. + :vartype api_key: str """ - function: "_models.AzureFunctionDefinitionFunction" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The definition of azure function and its parameters. Required.""" - input_binding: "_models.AzureFunctionBinding" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Input storage queue. The queue storage trigger runs a function as messages are added to it. - Required.""" - output_binding: "_models.AzureFunctionBinding" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Output storage queue. The function writes output to this queue when the input items are - processed. Required.""" + type: Literal[CredentialType.API_KEY] = rest_discriminator(name="type", visibility=["read"]) # type: ignore + """The credential type. Required. API Key credential.""" + api_key: Optional[str] = rest_field(name="key", visibility=["read"]) + """API Key.""" @overload def __init__( self, - *, - function: "_models.AzureFunctionDefinitionFunction", - input_binding: "_models.AzureFunctionBinding", - output_binding: "_models.AzureFunctionBinding", ) -> None: ... @overload @@ -3027,36 +3349,31 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = CredentialType.API_KEY # type: ignore -class AzureFunctionDefinitionFunction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """AzureFunctionDefinitionFunction. +class ApplyPatchToolParam( + Tool, discriminator="apply_patch" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Apply patch tool. - :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 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] """ - 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.""" + 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, *, - name: str, - parameters: dict[str, Any], - description: Optional[str] = None, + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, ) -> None: ... @overload @@ -3068,29 +3385,41 @@ 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 AzureFunctionStorageQueue(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The structure for keeping storage queue name and URI. +class ApproximateLocation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ApproximateLocation. - :ivar queue_service_endpoint: URI to the Azure Storage Queue service allowing you to manipulate - a queue. Required. - :vartype queue_service_endpoint: str - :ivar queue_name: The name of an Azure function storage queue. Required. - :vartype queue_name: str + :ivar type: The type of location approximation. Always ``approximate``. Required. Default value + is "approximate". + :vartype type: str + :ivar country: + :vartype country: str + :ivar region: + :vartype region: str + :ivar city: + :vartype city: str + :ivar timezone: + :vartype timezone: str """ - queue_service_endpoint: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """URI to the Azure Storage Queue service allowing you to manipulate a queue. Required.""" - queue_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of an Azure function storage queue. Required.""" + type: Literal["approximate"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of location approximation. Always ``approximate``. Required. Default value is + \"approximate\".""" + country: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + region: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + city: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + timezone: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - queue_service_endpoint: str, - queue_name: str, + country: Optional[str] = None, + region: Optional[str] = None, + city: Optional[str] = None, + timezone: Optional[str] = None, ) -> None: ... @overload @@ -3102,39 +3431,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["approximate"] = "approximate" -class AzureFunctionTool( - Tool, discriminator="azure_function" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """The input definition information for an Azure Function Tool, as used to configure an Agent. +class ArtifactProfile(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Artifact profile of the model. - :ivar type: The object type, which is always 'browser_automation'. Required. AZURE_FUNCTION. - :vartype type: str or ~azure.ai.projects.models.AZURE_FUNCTION - :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 azure_function: The Azure Function Tool definition. Required. - :vartype azure_function: ~azure.ai.projects.models.AzureFunctionDefinition + :ivar category: The category of the artifact profile. Required. Known values are: "DataOnly", + "RuntimeDependent", and "Unknown". + :vartype category: str or ~azure.ai.projects.models.FoundryModelArtifactProfileCategory + :ivar signals: Signals detected in the model artifact. + :vartype signals: list[str or ~azure.ai.projects.models.FoundryModelArtifactProfileSignal] """ - type: Literal[ToolType.AZURE_FUNCTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'browser_automation'. Required. AZURE_FUNCTION.""" - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( + category: Union[str, "_models.FoundryModelArtifactProfileCategory"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Deprecated. This property is deprecated and will be removed in a future version.""" - azure_function: "_models.AzureFunctionDefinition" = rest_field( + """The category of the artifact profile. Required. Known values are: \"DataOnly\", + \"RuntimeDependent\", and \"Unknown\".""" + signals: Optional[list[Union[str, "_models.FoundryModelArtifactProfileSignal"]]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The Azure Function Tool definition. Required.""" + """Signals detected in the model artifact.""" @overload def __init__( self, *, - azure_function: "_models.AzureFunctionDefinition", - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + category: Union[str, "_models.FoundryModelArtifactProfileCategory"], + signals: Optional[list[Union[str, "_models.FoundryModelArtifactProfileSignal"]]] = None, ) -> None: ... @overload @@ -3146,28 +3471,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.AZURE_FUNCTION # type: ignore - -class RedTeamTargetConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Abstract class for target configuration. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AzureOpenAIModelConfiguration +class AutoCodeInterpreterToolParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Automatic Code Interpreter Tool Parameters. - :ivar type: Type of the model configuration. Required. Default value is None. + :ivar type: Always ``auto``. Required. Default value is "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 network_policy: + :vartype network_policy: ~azure.ai.projects.models.ContainerNetworkPolicyParam """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Type of the model configuration. Required. Default value is None.""" + type: Literal["auto"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Always ``auto``. Required. Default value is \"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\".""" + network_policy: Optional["_models.ContainerNetworkPolicyParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) @overload def __init__( self, *, - type: str, + file_ids: Optional[list[str]] = None, + memory_limit: Optional[Union[str, "_models.ContainerMemoryLimit"]] = None, + network_policy: Optional["_models.ContainerNetworkPolicyParam"] = None, ) -> None: ... @overload @@ -3179,35 +3516,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["auto"] = "auto" -class AzureOpenAIModelConfiguration( - RedTeamTargetConfig, discriminator="AzureOpenAIModel" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Azure OpenAI model configuration. The API version would be selected by the service for querying - the model. +class EvaluationTarget(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Base class for targets with discriminator support. - :ivar type: Required. Default value is "AzureOpenAIModel". + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AzureAIAgentTarget, AzureAIModelTarget + + :ivar type: The type of target. Required. Default value is None. :vartype type: str - :ivar model_deployment_name: Deployment name for AOAI model. Example: gpt-4o if in AIServices - or connection based ``connection_name/deployment_name`` (e.g. ``my-aoai-connection/gpt-4o``). - Required. - :vartype model_deployment_name: str """ - type: Literal["AzureOpenAIModel"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Default value is \"AzureOpenAIModel\".""" - model_deployment_name: str = rest_field( - name="modelDeploymentName", visibility=["read", "create", "update", "delete", "query"] - ) - """Deployment name for AOAI model. Example: gpt-4o if in AIServices or connection based - ``connection_name/deployment_name`` (e.g. ``my-aoai-connection/gpt-4o``). Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The type of target. Required. Default value is None.""" @overload def __init__( self, *, - model_deployment_name: str, + type: str, ) -> None: ... @overload @@ -3219,51 +3549,47 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "AzureOpenAIModel" # type: ignore -class BingCustomSearchConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A bing custom search configuration. +class AzureAIAgentTarget( + EvaluationTarget, discriminator="azure_ai_agent" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents a target specifying an Azure AI agent. - :ivar project_connection_id: Project connection id for grounding with bing search. Required. - :vartype project_connection_id: str - :ivar instance_name: Name of the custom configuration instance given to config. Required. - :vartype instance_name: str - :ivar market: The market where the results come from. - :vartype market: str - :ivar set_lang: The language to use for user interface strings when calling Bing API. - :vartype set_lang: str - :ivar count: The number of search results to return in the bing api response. - :vartype count: int - :ivar freshness: Filter search results by a specific time range. See `accepted values here - `_. - :vartype freshness: str + :ivar type: The type of target, always ``azure_ai_agent``. Required. Default value is + "azure_ai_agent". + :vartype type: str + :ivar name: The unique identifier of the Azure AI agent. Required. + :vartype name: str + :ivar version: The version of the Azure AI agent. + :vartype version: str + :ivar tool_descriptions: The parameters used to control the sampling behavior of the agent + during text generation. + :vartype tool_descriptions: list[~azure.ai.projects.models.ToolDescription] + :ivar tools: + :vartype tools: list[~azure.ai.projects.models.Tool] """ - project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Project connection id for grounding with bing search. Required.""" - instance_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name of the custom configuration instance given to config. Required.""" - market: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The market where the results come from.""" - set_lang: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The language to use for user interface strings when calling Bing API.""" - count: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of search results to return in the bing api response.""" - freshness: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Filter search results by a specific time range. See `accepted values here - `_.""" + type: Literal["azure_ai_agent"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of target, always ``azure_ai_agent``. Required. Default value is \"azure_ai_agent\".""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the Azure AI agent. Required.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version of the Azure AI agent.""" + tool_descriptions: Optional[list["_models.ToolDescription"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The parameters used to control the sampling behavior of the agent during text generation.""" + tools: Optional[list["_models.Tool"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - project_connection_id: str, - instance_name: str, - market: Optional[str] = None, - set_lang: Optional[str] = None, - count: Optional[int] = None, - freshness: Optional[str] = None, + name: str, + version: Optional[str] = None, + tool_descriptions: Optional[list["_models.ToolDescription"]] = None, + tools: Optional[list["_models.Tool"]] = None, ) -> None: ... @overload @@ -3275,33 +3601,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = "azure_ai_agent" # type: ignore -class BingCustomSearchPreviewTool( - Tool, discriminator="bing_custom_search_preview" +class AzureAIModelTarget( + EvaluationTarget, discriminator="azure_ai_model" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """The input definition information for a Bing custom search tool as used to configure an agent. + """Represents a target specifying an Azure AI model for operations requiring model selection. - :ivar type: The object type, which is always 'bing_custom_search_preview'. Required. - BING_CUSTOM_SEARCH_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.BING_CUSTOM_SEARCH_PREVIEW - :ivar bing_custom_search_preview: The bing custom search tool parameters. Required. - :vartype bing_custom_search_preview: ~azure.ai.projects.models.BingCustomSearchToolParameters + :ivar type: The type of target, always ``azure_ai_model``. Required. Default value is + "azure_ai_model". + :vartype type: str + :ivar model: The unique identifier of the Azure AI model. + :vartype model: str + :ivar sampling_params: The parameters used to control the sampling behavior of the model during + text generation. + :vartype sampling_params: ~azure.ai.projects.models.ModelSamplingParams """ - type: Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'bing_custom_search_preview'. Required. - BING_CUSTOM_SEARCH_PREVIEW.""" - bing_custom_search_preview: "_models.BingCustomSearchToolParameters" = rest_field( + type: Literal["azure_ai_model"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of target, always ``azure_ai_model``. Required. Default value is \"azure_ai_model\".""" + model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the Azure AI model.""" + sampling_params: Optional["_models.ModelSamplingParams"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The bing custom search tool parameters. Required.""" + """The parameters used to control the sampling behavior of the model during text generation.""" @overload def __init__( self, *, - bing_custom_search_preview: "_models.BingCustomSearchToolParameters", + model: Optional[str] = None, + sampling_params: Optional["_models.ModelSamplingParams"] = None, ) -> None: ... @overload @@ -3313,28 +3645,52 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.BING_CUSTOM_SEARCH_PREVIEW # type: ignore + self.type = "azure_ai_model" # type: ignore -class BingCustomSearchToolParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The bing custom search tool parameters. +class Index(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Index resource Definition. - :ivar search_configurations: The project connections attached to this tool. There can be a - maximum of 1 connection resource attached to the tool. Required. - :vartype search_configurations: list[~azure.ai.projects.models.BingCustomSearchConfiguration] + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AzureAISearchIndex, CosmosDBIndex, ManagedAzureAISearchIndex + + :ivar type: Type of index. Required. Known values are: "AzureSearch", + "CosmosDBNoSqlVectorStore", and "ManagedAzureSearch". + :vartype type: str or ~azure.ai.projects.models.IndexType + :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] """ - search_configurations: list["_models.BingCustomSearchConfiguration"] = 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. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Type of index. Required. Known values are: \"AzureSearch\", \"CosmosDBNoSqlVectorStore\", and + \"ManagedAzureSearch\".""" + 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=["create", "update"]) + """The asset description text.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["create", "update"]) + """Tag dictionary. Tags can be added, removed, and updated.""" @overload def __init__( self, *, - search_configurations: list["_models.BingCustomSearchConfiguration"], + type: str, + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -3348,43 +3704,49 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class BingGroundingSearchConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Search configuration for Bing Grounding. +class AzureAISearchIndex( + Index, discriminator="AzureSearch" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Azure AI Search Index Definition. - :ivar project_connection_id: Project connection id for grounding with bing search. Required. - :vartype project_connection_id: str - :ivar market: The market where the results come from. - :vartype market: str - :ivar set_lang: The language to use for user interface strings when calling Bing API. - :vartype set_lang: str - :ivar count: The number of search results to return in the bing api response. - :vartype count: int - :ivar freshness: Filter search results by a specific time range. See `accepted values here - `_. - :vartype freshness: str + :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. Azure search. + :vartype type: str or ~azure.ai.projects.models.AZURE_SEARCH + :ivar connection_name: Name of connection to Azure AI Search. Required. + :vartype connection_name: str + :ivar index_name: Name of index in Azure AI Search resource to attach. Required. + :vartype index_name: str + :ivar field_mapping: Field mapping configuration. + :vartype field_mapping: ~azure.ai.projects.models.FieldMapping """ - project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Project connection id for grounding with bing search. Required.""" - market: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The market where the results come from.""" - set_lang: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The language to use for user interface strings when calling Bing API.""" - count: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of search results to return in the bing api response.""" - freshness: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Filter search results by a specific time range. See `accepted values here - `_.""" + type: Literal[IndexType.AZURE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Type of index. Required. Azure search.""" + connection_name: str = rest_field(name="connectionName", visibility=["create"]) + """Name of connection to Azure AI Search. Required.""" + index_name: str = rest_field(name="indexName", visibility=["create"]) + """Name of index in Azure AI Search resource to attach. Required.""" + field_mapping: Optional["_models.FieldMapping"] = rest_field(name="fieldMapping", visibility=["create"]) + """Field mapping configuration.""" @overload def __init__( self, *, - project_connection_id: str, - market: Optional[str] = None, - set_lang: Optional[str] = None, - count: Optional[int] = None, - freshness: Optional[str] = None, + connection_name: str, + index_name: str, + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, + field_mapping: Optional["_models.FieldMapping"] = None, ) -> None: ... @overload @@ -3396,28 +3758,51 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = IndexType.AZURE_SEARCH # type: ignore -class BingGroundingSearchToolParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The bing grounding search tool parameters. +class AzureAISearchTool( + Tool, discriminator="azure_ai_search" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The input definition information for an Azure AI search tool as used to configure an agent. - :ivar search_configurations: The search configurations attached to this tool. There can be a - maximum of 1 search configuration resource attached to the tool. Required. - :vartype search_configurations: - list[~azure.ai.projects.models.BingGroundingSearchConfiguration] + :ivar type: The object type, which is always 'azure_ai_search'. Required. AZURE_AI_SEARCH. + :vartype type: str or ~azure.ai.projects.models.AZURE_AI_SEARCH + :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 azure_ai_search: The azure ai search index resource. Required. + :vartype azure_ai_search: ~azure.ai.projects.models.AzureAISearchToolResource """ - search_configurations: list["_models.BingGroundingSearchConfiguration"] = rest_field( + type: Literal[ToolType.AZURE_AI_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'azure_ai_search'. Required. AZURE_AI_SEARCH.""" + 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"] ) - """The search configurations attached to this tool. There can be a maximum of 1 search - configuration resource attached to the tool. Required.""" + """Deprecated. This property is deprecated and will be removed in a future version.""" + azure_ai_search: "_models.AzureAISearchToolResource" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The azure ai search index resource. Required.""" @overload def __init__( self, *, - search_configurations: list["_models.BingGroundingSearchConfiguration"], + azure_ai_search: "_models.AzureAISearchToolResource", + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -3429,48 +3814,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.AZURE_AI_SEARCH # type: ignore -class BingGroundingTool( - Tool, discriminator="bing_grounding" +class AzureAISearchToolboxTool( + ToolboxTool, discriminator="azure_ai_search" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """The input definition information for a bing grounding search tool as used to configure an - agent. + """An Azure AI Search tool stored in a toolbox. - :ivar type: The object type, which is always 'bing_grounding'. Required. BING_GROUNDING. - :vartype type: str or ~azure.ai.projects.models.BING_GROUNDING - :ivar name: Deprecated. This property is deprecated and will be removed in a future version. + :ivar name: Optional user-defined name for this tool or configuration. :vartype name: str - :ivar description: Deprecated. This property is deprecated and will be removed in a future - version. + :ivar description: Optional user-defined description for this tool or configuration. :vartype description: str - :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future - version. + :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 bing_grounding: The bing grounding search tool parameters. Required. - :vartype bing_grounding: ~azure.ai.projects.models.BingGroundingSearchToolParameters + :ivar type: Required. AZURE_AI_SEARCH. + :vartype type: str or ~azure.ai.projects.models.AZURE_AI_SEARCH + :ivar azure_ai_search: The azure ai search index resource. Required. + :vartype azure_ai_search: ~azure.ai.projects.models.AzureAISearchToolResource """ - type: Literal[ToolType.BING_GROUNDING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'bing_grounding'. Required. BING_GROUNDING.""" - 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.""" - bing_grounding: "_models.BingGroundingSearchToolParameters" = rest_field( + type: Literal[ToolboxToolType.AZURE_AI_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. AZURE_AI_SEARCH.""" + azure_ai_search: "_models.AzureAISearchToolResource" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The bing grounding search tool parameters. Required.""" + """The azure ai search index resource. Required.""" @overload def __init__( self, *, - bing_grounding: "_models.BingGroundingSearchToolParameters", + azure_ai_search: "_models.AzureAISearchToolResource", name: Optional[str] = None, description: Optional[str] = None, tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, @@ -3485,40 +3862,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.BING_GROUNDING # type: ignore + self.type = ToolboxToolType.AZURE_AI_SEARCH # type: ignore -class BlobReference(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Blob reference details. +class AzureAISearchToolResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A set of index resources used by the ``azure_ai_search`` tool. - :ivar blob_uri: Blob URI path for client to upload data. Example: - ``https://blob.windows.core.net/Container/Path``. Required. - :vartype blob_uri: str - :ivar storage_account_arm_id: ARM ID of the storage account to use. Required. - :vartype storage_account_arm_id: str - :ivar credential: Credential info to access the storage account. Required. - :vartype credential: ~azure.ai.projects.models.BlobReferenceSasCredential + :ivar indexes: The indices attached to this agent. There can be a maximum of 1 index resource + attached to the agent. Required. + :vartype indexes: list[~azure.ai.projects.models.AISearchIndexResource] """ - blob_uri: str = rest_field(name="blobUri", visibility=["read", "create", "update", "delete", "query"]) - """Blob URI path for client to upload data. Example: - ``https://blob.windows.core.net/Container/Path``. Required.""" - storage_account_arm_id: str = rest_field( - name="storageAccountArmId", visibility=["read", "create", "update", "delete", "query"] - ) - """ARM ID of the storage account to use. Required.""" - credential: "_models.BlobReferenceSasCredential" = rest_field( + indexes: list["_models.AISearchIndexResource"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Credential info to access the storage account. Required.""" + """The indices attached to this agent. There can be a maximum of 1 index resource attached to the + agent. Required.""" @overload def __init__( self, *, - blob_uri: str, - storage_account_arm_id: str, - credential: "_models.BlobReferenceSasCredential", + indexes: list["_models.AISearchIndexResource"], ) -> None: ... @overload @@ -3532,38 +3897,29 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class BlobReferenceSasCredential(_Model): # pylint: disable=docstring-missing-param - """SAS Credential definition. +class AzureFunctionBinding(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The structure for keeping storage queue name and URI. - :ivar sas_uri: SAS uri. Required. - :vartype sas_uri: str - :ivar type: Type of credential. Required. Default value is "SAS". + :ivar type: The type of binding, which is always 'storage_queue'. Required. Default value is + "storage_queue". :vartype type: str + :ivar storage_queue: Storage queue. Required. + :vartype storage_queue: ~azure.ai.projects.models.AzureFunctionStorageQueue """ - sas_uri: str = rest_field(name="sasUri", visibility=["read"]) - """SAS uri. Required.""" - type: Literal["SAS"] = rest_field(visibility=["read"]) - """Type of credential. Required. Default value is \"SAS\".""" - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type: Literal["SAS"] = "SAS" - - -class BotServiceAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="BotService"): - """BotServiceAuthorizationScheme. - - :ivar type: Required. BOT_SERVICE. - :vartype type: str or ~azure.ai.projects.models.BOT_SERVICE - """ - - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. BOT_SERVICE.""" + type: Literal["storage_queue"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of binding, which is always 'storage_queue'. Required. Default value is + \"storage_queue\".""" + storage_queue: "_models.AzureFunctionStorageQueue" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Storage queue. Required.""" @overload def __init__( self, + *, + storage_queue: "_models.AzureFunctionStorageQueue", ) -> None: ... @overload @@ -3575,22 +3931,44 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = AgentEndpointAuthorizationSchemeType.BOT_SERVICE # type: ignore + self.type: Literal["storage_queue"] = "storage_queue" -class BotServiceRbacAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="BotServiceRbac"): - """BotServiceRbacAuthorizationScheme. +class AzureFunctionDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The definition of Azure function. - :ivar type: Required. BOT_SERVICE_RBAC. - :vartype type: str or ~azure.ai.projects.models.BOT_SERVICE_RBAC + :ivar function: The definition of azure function and its parameters. Required. + :vartype function: ~azure.ai.projects.models.AzureFunctionDefinitionFunction + :ivar input_binding: Input storage queue. The queue storage trigger runs a function as messages + are added to it. Required. + :vartype input_binding: ~azure.ai.projects.models.AzureFunctionBinding + :ivar output_binding: Output storage queue. The function writes output to this queue when the + input items are processed. Required. + :vartype output_binding: ~azure.ai.projects.models.AzureFunctionBinding """ - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. BOT_SERVICE_RBAC.""" + function: "_models.AzureFunctionDefinitionFunction" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The definition of azure function and its parameters. Required.""" + input_binding: "_models.AzureFunctionBinding" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Input storage queue. The queue storage trigger runs a function as messages are added to it. + Required.""" + output_binding: "_models.AzureFunctionBinding" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Output storage queue. The function writes output to this queue when the input items are + processed. Required.""" @overload def __init__( self, + *, + function: "_models.AzureFunctionDefinitionFunction", + input_binding: "_models.AzureFunctionBinding", + output_binding: "_models.AzureFunctionBinding", ) -> None: ... @overload @@ -3602,22 +3980,36 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC # type: ignore -class BotServiceTenantAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="BotServiceTenant"): - """BotServiceTenantAuthorizationScheme. +class AzureFunctionDefinitionFunction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """AzureFunctionDefinitionFunction. - :ivar type: Required. BOT_SERVICE_TENANT. - :vartype type: str or ~azure.ai.projects.models.BOT_SERVICE_TENANT + :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] """ - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. BOT_SERVICE_TENANT.""" + 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, + *, + name: str, + parameters: dict[str, Any], + description: Optional[str] = None, ) -> None: ... @overload @@ -3629,34 +4021,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT # type: ignore -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. - - :ivar type: The object type, which is always 'browser_automation_preview'. Required. - BROWSER_AUTOMATION_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.BROWSER_AUTOMATION_PREVIEW - :ivar browser_automation_preview: The Browser Automation Tool parameters. Required. - :vartype browser_automation_preview: ~azure.ai.projects.models.BrowserAutomationToolParameters - """ +class AzureFunctionStorageQueue(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The structure for keeping storage queue name and URI. - type: Literal[ToolType.BROWSER_AUTOMATION_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'browser_automation_preview'. Required. - BROWSER_AUTOMATION_PREVIEW.""" - browser_automation_preview: "_models.BrowserAutomationToolParameters" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The Browser Automation Tool parameters. Required.""" + :ivar queue_service_endpoint: URI to the Azure Storage Queue service allowing you to manipulate + a queue. Required. + :vartype queue_service_endpoint: str + :ivar queue_name: The name of an Azure function storage queue. Required. + :vartype queue_name: str + """ + + queue_service_endpoint: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """URI to the Azure Storage Queue service allowing you to manipulate a queue. Required.""" + queue_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of an Azure function storage queue. Required.""" @overload def __init__( self, *, - browser_automation_preview: "_models.BrowserAutomationToolParameters", + queue_service_endpoint: str, + queue_name: str, ) -> None: ... @overload @@ -3668,42 +4055,38 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.BROWSER_AUTOMATION_PREVIEW # type: ignore -class BrowserAutomationPreviewToolboxTool( - ToolboxTool, discriminator="browser_automation_preview" +class AzureFunctionTool( + Tool, discriminator="azure_function" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """A browser automation tool stored in a toolbox. + """The input definition information for an Azure Function Tool, as used to configure an Agent. - :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. + :ivar type: The object type, which is always 'browser_automation'. Required. AZURE_FUNCTION. + :vartype type: str or ~azure.ai.projects.models.AZURE_FUNCTION + :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: Required. BROWSER_AUTOMATION_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.BROWSER_AUTOMATION_PREVIEW - :ivar browser_automation_preview: The Browser Automation Tool parameters. Required. - :vartype browser_automation_preview: ~azure.ai.projects.models.BrowserAutomationToolParameters + :ivar azure_function: The Azure Function Tool definition. Required. + :vartype azure_function: ~azure.ai.projects.models.AzureFunctionDefinition """ - type: Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. BROWSER_AUTOMATION_PREVIEW.""" - browser_automation_preview: "_models.BrowserAutomationToolParameters" = rest_field( + type: Literal[ToolType.AZURE_FUNCTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'browser_automation'. Required. AZURE_FUNCTION.""" + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The Browser Automation Tool parameters. Required.""" + """Deprecated. This property is deprecated and will be removed in a future version.""" + azure_function: "_models.AzureFunctionDefinition" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The Azure Function Tool definition. Required.""" @overload def __init__( self, *, - browser_automation_preview: "_models.BrowserAutomationToolParameters", - name: Optional[str] = None, - description: Optional[str] = None, + azure_function: "_models.AzureFunctionDefinition", tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @@ -3716,27 +4099,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolboxToolType.BROWSER_AUTOMATION_PREVIEW # type: ignore + self.type = ToolType.AZURE_FUNCTION # type: ignore -class BrowserAutomationToolConnectionParameters( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Definition of input parameters for the connection used by the Browser Automation Tool. +class RedTeamTargetConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Abstract class for target configuration. - :ivar project_connection_id: The ID of the project connection to your Azure Playwright - resource. Required. - :vartype project_connection_id: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AzureOpenAIModelConfiguration + + :ivar type: Type of the model configuration. Required. Default value is None. + :vartype type: str """ - project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the project connection to your Azure Playwright resource. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Type of the model configuration. Required. Default value is None.""" @overload def __init__( self, *, - project_connection_id: str, + type: str, ) -> None: ... @overload @@ -3750,24 +4134,33 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class BrowserAutomationToolParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Definition of input parameters for the Browser Automation Tool. +class AzureOpenAIModelConfiguration( + RedTeamTargetConfig, discriminator="AzureOpenAIModel" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Azure OpenAI model configuration. The API version would be selected by the service for querying + the model. - :ivar connection: The project connection parameters associated with the Browser Automation - Tool. Required. - :vartype connection: ~azure.ai.projects.models.BrowserAutomationToolConnectionParameters + :ivar type: Required. Default value is "AzureOpenAIModel". + :vartype type: str + :ivar model_deployment_name: Deployment name for AOAI model. Example: gpt-4o if in AIServices + or connection based ``connection_name/deployment_name`` (e.g. ``my-aoai-connection/gpt-4o``). + Required. + :vartype model_deployment_name: str """ - connection: "_models.BrowserAutomationToolConnectionParameters" = rest_field( - visibility=["read", "create", "update", "delete", "query"] + type: Literal["AzureOpenAIModel"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"AzureOpenAIModel\".""" + model_deployment_name: str = rest_field( + name="modelDeploymentName", visibility=["read", "create", "update", "delete", "query"] ) - """The project connection parameters associated with the Browser Automation Tool. Required.""" + """Deployment name for AOAI model. Example: gpt-4o if in AIServices or connection based + ``connection_name/deployment_name`` (e.g. ``my-aoai-connection/gpt-4o``). Required.""" @overload def __init__( self, *, - connection: "_models.BrowserAutomationToolConnectionParameters", + model_deployment_name: str, ) -> None: ... @overload @@ -3779,52 +4172,51 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = "AzureOpenAIModel" # type: ignore -class CaptureStructuredOutputsTool( - Tool, discriminator="capture_structured_outputs" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A tool for capturing structured outputs. +class BingCustomSearchConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A bing custom search configuration. - :ivar type: The type of the tool. Always ``capture_structured_outputs``. Required. - CAPTURE_STRUCTURED_OUTPUTS. - :vartype type: str or ~azure.ai.projects.models.CAPTURE_STRUCTURED_OUTPUTS - :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 outputs: The structured outputs to capture from the model. Required. - :vartype outputs: ~azure.ai.projects.models.StructuredOutputDefinition + :ivar project_connection_id: Project connection id for grounding with bing search. Required. + :vartype project_connection_id: str + :ivar instance_name: Name of the custom configuration instance given to config. Required. + :vartype instance_name: str + :ivar market: The market where the results come from. + :vartype market: str + :ivar set_lang: The language to use for user interface strings when calling Bing API. + :vartype set_lang: str + :ivar count: The number of search results to return in the bing api response. + :vartype count: int + :ivar freshness: Filter search results by a specific time range. See `accepted values here + `_. + :vartype freshness: str """ - type: Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the tool. Always ``capture_structured_outputs``. Required. - CAPTURE_STRUCTURED_OUTPUTS.""" - 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.""" - outputs: "_models.StructuredOutputDefinition" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The structured outputs to capture from the model. Required.""" + project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Project connection id for grounding with bing search. Required.""" + instance_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the custom configuration instance given to config. Required.""" + market: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The market where the results come from.""" + set_lang: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The language to use for user interface strings when calling Bing API.""" + count: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of search results to return in the bing api response.""" + freshness: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Filter search results by a specific time range. See `accepted values here + `_.""" @overload def __init__( self, *, - outputs: "_models.StructuredOutputDefinition", - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + project_connection_id: str, + instance_name: str, + market: Optional[str] = None, + set_lang: Optional[str] = None, + count: Optional[int] = None, + freshness: Optional[str] = None, ) -> None: ... @overload @@ -3836,34 +4228,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.CAPTURE_STRUCTURED_OUTPUTS # type: ignore -class ChartCoordinate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Coordinates for the analysis chart. +class BingCustomSearchPreviewTool( + Tool, discriminator="bing_custom_search_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The input definition information for a Bing custom search tool as used to configure an agent. - :ivar x: X-axis coordinate. Required. - :vartype x: int - :ivar y: Y-axis coordinate. Required. - :vartype y: int - :ivar size: Size of the chart element. Required. - :vartype size: int + :ivar type: The object type, which is always 'bing_custom_search_preview'. Required. + BING_CUSTOM_SEARCH_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.BING_CUSTOM_SEARCH_PREVIEW + :ivar bing_custom_search_preview: The bing custom search tool parameters. Required. + :vartype bing_custom_search_preview: ~azure.ai.projects.models.BingCustomSearchToolParameters """ - x: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """X-axis coordinate. Required.""" - y: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Y-axis coordinate. Required.""" - size: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Size of the chart element. Required.""" + type: Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'bing_custom_search_preview'. Required. + BING_CUSTOM_SEARCH_PREVIEW.""" + bing_custom_search_preview: "_models.BingCustomSearchToolParameters" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The bing custom search tool parameters. Required.""" @overload def __init__( self, *, - x: int, - y: int, - size: int, + bing_custom_search_preview: "_models.BingCustomSearchToolParameters", ) -> None: ... @overload @@ -3875,52 +4266,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.BING_CUSTOM_SEARCH_PREVIEW # type: ignore -class MemoryItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A single memory item stored in the memory store, containing content and metadata. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ChatSummaryMemoryItem, ProceduralMemoryItem, UserProfileMemoryItem +class BingCustomSearchToolParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The bing custom search tool parameters. - :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. Known values are: "user_profile", - "chat_summary", and "procedural". - :vartype kind: str or ~azure.ai.projects.models.MemoryItemKind + :ivar search_configurations: The project connections attached to this tool. There can be a + maximum of 1 connection resource attached to the tool. Required. + :vartype search_configurations: list[~azure.ai.projects.models.BingCustomSearchConfiguration] """ - __mapping__: dict[str, _Model] = {} - memory_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the memory item. Required.""" - updated_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + search_configurations: list["_models.BingCustomSearchConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The last update time of the memory item. Required.""" - scope: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The namespace that logically groups and isolates memories, such as a user ID. Required.""" - content: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The content of the memory. Required.""" - kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) - """The kind of the memory item. Required. Known values are: \"user_profile\", \"chat_summary\", - and \"procedural\".""" + """The project connections attached to this tool. There can be a maximum of 1 connection resource + attached to the tool. Required.""" @overload def __init__( self, *, - memory_id: str, - updated_at: datetime.datetime, - scope: str, - content: str, - kind: str, + search_configurations: list["_models.BingCustomSearchConfiguration"], ) -> None: ... @overload @@ -3934,35 +4301,43 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ChatSummaryMemoryItem( - MemoryItem, discriminator="chat_summary" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A memory item containing a summary extracted from conversations. +class BingGroundingSearchConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Search configuration for Bing Grounding. - :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. Summary of chat conversations. - :vartype kind: str or ~azure.ai.projects.models.CHAT_SUMMARY + :ivar project_connection_id: Project connection id for grounding with bing search. Required. + :vartype project_connection_id: str + :ivar market: The market where the results come from. + :vartype market: str + :ivar set_lang: The language to use for user interface strings when calling Bing API. + :vartype set_lang: str + :ivar count: The number of search results to return in the bing api response. + :vartype count: int + :ivar freshness: Filter search results by a specific time range. See `accepted values here + `_. + :vartype freshness: str """ - kind: Literal[MemoryItemKind.CHAT_SUMMARY] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The kind of the memory item. Required. Summary of chat conversations.""" + project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Project connection id for grounding with bing search. Required.""" + market: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The market where the results come from.""" + set_lang: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The language to use for user interface strings when calling Bing API.""" + count: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of search results to return in the bing api response.""" + freshness: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Filter search results by a specific time range. See `accepted values here + `_.""" @overload def __init__( self, *, - memory_id: str, - updated_at: datetime.datetime, - scope: str, - content: str, + project_connection_id: str, + market: Optional[str] = None, + set_lang: Optional[str] = None, + count: Optional[int] = None, + freshness: Optional[str] = None, ) -> None: ... @overload @@ -3974,73 +4349,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = MemoryItemKind.CHAT_SUMMARY # type: ignore - - -class ClusterInsightResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Insights from the cluster analysis. - - :ivar summary: Summary of the insights report. Required. - :vartype summary: ~azure.ai.projects.models.InsightSummary - :ivar clusters: List of clusters identified in the insights. Required. - :vartype clusters: list[~azure.ai.projects.models.InsightCluster] - :ivar coordinates: Optional mapping of IDs to 2D coordinates used by the UX for - visualization. - - The map keys are string identifiers (for example, a cluster id or a sample id) - and the values are the coordinates and visual size for rendering on a 2D chart. - - This property is omitted unless the client requests coordinates (for example, - by passing ``includeCoordinates=true`` as a query parameter). - - Example: - .. code-block:: - { - "cluster-1": { "x": 12, "y": 34, "size": 8 }, - "sample-123": { "x": 18, "y": 22, "size": 4 } - } +class BingGroundingSearchToolParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The bing grounding search tool parameters. - Coordinates are intended only for client-side visualization and do not - modify the canonical insights results. - :vartype coordinates: dict[str, ~azure.ai.projects.models.ChartCoordinate] + :ivar search_configurations: The search configurations attached to this tool. There can be a + maximum of 1 search configuration resource attached to the tool. Required. + :vartype search_configurations: + list[~azure.ai.projects.models.BingGroundingSearchConfiguration] """ - summary: "_models.InsightSummary" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Summary of the insights report. Required.""" - clusters: list["_models.InsightCluster"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """List of clusters identified in the insights. Required.""" - coordinates: Optional[dict[str, "_models.ChartCoordinate"]] = rest_field( + search_configurations: list["_models.BingGroundingSearchConfiguration"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """ Optional mapping of IDs to 2D coordinates used by the UX for visualization. - - The map keys are string identifiers (for example, a cluster id or a sample id) - and the values are the coordinates and visual size for rendering on a 2D chart. - - This property is omitted unless the client requests coordinates (for example, - by passing ``includeCoordinates=true`` as a query parameter). - - Example: - - .. code-block:: - - { - \"cluster-1\": { \"x\": 12, \"y\": 34, \"size\": 8 }, - \"sample-123\": { \"x\": 18, \"y\": 22, \"size\": 4 } - } - - Coordinates are intended only for client-side visualization and do not - modify the canonical insights results.""" + """The search configurations attached to this tool. There can be a maximum of 1 search + configuration resource attached to the tool. Required.""" @overload def __init__( self, *, - summary: "_models.InsightSummary", - clusters: list["_models.InsightCluster"], - coordinates: Optional[dict[str, "_models.ChartCoordinate"]] = None, + search_configurations: list["_models.BingGroundingSearchConfiguration"], ) -> None: ... @overload @@ -4054,37 +4384,49 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ClusterTokenUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Token usage for cluster analysis. +class BingGroundingTool( + Tool, discriminator="bing_grounding" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The input definition information for a bing grounding search tool as used to configure an + agent. - :ivar input_token_usage: input token usage. Required. - :vartype input_token_usage: int - :ivar output_token_usage: output token usage. Required. - :vartype output_token_usage: int - :ivar total_token_usage: total token usage. Required. - :vartype total_token_usage: int + :ivar type: The object type, which is always 'bing_grounding'. Required. BING_GROUNDING. + :vartype type: str or ~azure.ai.projects.models.BING_GROUNDING + :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 bing_grounding: The bing grounding search tool parameters. Required. + :vartype bing_grounding: ~azure.ai.projects.models.BingGroundingSearchToolParameters """ - input_token_usage: int = rest_field( - name="inputTokenUsage", visibility=["read", "create", "update", "delete", "query"] - ) - """input token usage. Required.""" - output_token_usage: int = rest_field( - name="outputTokenUsage", visibility=["read", "create", "update", "delete", "query"] + type: Literal[ToolType.BING_GROUNDING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'bing_grounding'. Required. BING_GROUNDING.""" + 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"] ) - """output token usage. Required.""" - total_token_usage: int = rest_field( - name="totalTokenUsage", visibility=["read", "create", "update", "delete", "query"] + """Deprecated. This property is deprecated and will be removed in a future version.""" + bing_grounding: "_models.BingGroundingSearchToolParameters" = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """total token usage. Required.""" + """The bing grounding search tool parameters. Required.""" @overload def __init__( self, *, - input_token_usage: int, - output_token_usage: int, - total_token_usage: int, + bing_grounding: "_models.BingGroundingSearchToolParameters", + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -4096,51 +4438,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.BING_GROUNDING # type: ignore -class EvaluatorDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Base evaluator configuration with discriminator. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - CodeBasedEvaluatorDefinition, EndpointBasedEvaluatorDefinition, PromptBasedEvaluatorDefinition, - RubricBasedEvaluatorDefinition +class BlobReference(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Blob reference details. - :ivar type: The type of evaluator definition. Required. Known values are: "prompt", "code", - "prompt_and_code", "service", "openai_graders", "rubric", and "endpoint". - :vartype type: str or ~azure.ai.projects.models.EvaluatorDefinitionType - :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 blob_uri: Blob URI path for client to upload data. Example: + ``https://blob.windows.core.net/Container/Path``. Required. + :vartype blob_uri: str + :ivar storage_account_arm_id: ARM ID of the storage account to use. Required. + :vartype storage_account_arm_id: str + :ivar credential: Credential info to access the storage account. Required. + :vartype credential: ~azure.ai.projects.models.BlobReferenceSasCredential """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of evaluator definition. Required. Known values are: \"prompt\", \"code\", - \"prompt_and_code\", \"service\", \"openai_graders\", \"rubric\", and \"endpoint\".""" - init_parameters: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The JSON schema (Draft 2020-12) for the evaluator's input parameters. This includes parameters - like type, properties, required.""" - data_schema: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The JSON schema (Draft 2020-12) for the evaluator's input data. This includes parameters like - type, properties, required.""" - metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = rest_field( + blob_uri: str = rest_field(name="blobUri", visibility=["read", "create", "update", "delete", "query"]) + """Blob URI path for client to upload data. Example: + ``https://blob.windows.core.net/Container/Path``. Required.""" + storage_account_arm_id: str = rest_field( + name="storageAccountArmId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM ID of the storage account to use. Required.""" + credential: "_models.BlobReferenceSasCredential" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """List of output metrics produced by this evaluator.""" + """Credential info to access the storage account. Required.""" @overload def __init__( self, *, - type: str, - init_parameters: Optional[dict[str, Any]] = None, - data_schema: Optional[dict[str, Any]] = None, - metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, + blob_uri: str, + storage_account_arm_id: str, + credential: "_models.BlobReferenceSasCredential", ) -> None: ... @overload @@ -4154,55 +4485,38 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CodeBasedEvaluatorDefinition( - EvaluatorDefinition, discriminator="code" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Code-based evaluator definition using python code. +class BlobReferenceSasCredential(_Model): # pylint: disable=docstring-missing-param + """SAS Credential definition. - :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. Code-based definition. - :vartype type: str or ~azure.ai.projects.models.CODE - :ivar code_text: Inline code text for the evaluator. - :vartype code_text: str - :ivar entry_point: The entry point Python file name for the uploaded evaluator code (e.g. - 'answer_length_evaluator.py'). - :vartype entry_point: str - :ivar image_tag: The container image tag to use for evaluator code execution. - :vartype image_tag: str - :ivar blob_uri: The blob URI for the evaluator storage. - :vartype blob_uri: str - """ + :ivar sas_uri: SAS uri. Required. + :vartype sas_uri: str + :ivar type: Type of credential. Required. Default value is "SAS". + :vartype type: str + """ - type: Literal[EvaluatorDefinitionType.CODE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Code-based definition.""" - code_text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Inline code text for the evaluator.""" - entry_point: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The entry point Python file name for the uploaded evaluator code (e.g. - 'answer_length_evaluator.py').""" - image_tag: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The container image tag to use for evaluator code execution.""" - blob_uri: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The blob URI for the evaluator storage.""" + sas_uri: str = rest_field(name="sasUri", visibility=["read"]) + """SAS uri. Required.""" + type: Literal["SAS"] = rest_field(visibility=["read"]) + """Type of credential. Required. Default value is \"SAS\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["SAS"] = "SAS" + + +class BotServiceAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="BotService"): + """BotServiceAuthorizationScheme. + + :ivar type: Required. BOT_SERVICE. + :vartype type: str or ~azure.ai.projects.models.BOT_SERVICE + """ + + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. BOT_SERVICE.""" @overload def __init__( self, - *, - init_parameters: Optional[dict[str, Any]] = None, - data_schema: Optional[dict[str, Any]] = None, - metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, - code_text: Optional[str] = None, - entry_point: Optional[str] = None, - image_tag: Optional[str] = None, - blob_uri: Optional[str] = None, ) -> None: ... @overload @@ -4214,53 +4528,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = EvaluatorDefinitionType.CODE # type: ignore + self.type = AgentEndpointAuthorizationSchemeType.BOT_SERVICE # type: ignore -class CodeConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Code-based deployment configuration for a hosted agent. +class BotServiceRbacAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="BotServiceRbac"): + """BotServiceRbacAuthorizationScheme. - :ivar runtime: The runtime identifier for code execution (e.g., 'python_3_11', 'python_3_12', - 'python_3_13'). Required. - :vartype runtime: str - :ivar entry_point: The entry point command and arguments for the code execution. Required. - :vartype entry_point: list[str] - :ivar dependency_resolution: How package dependencies are resolved at deployment time. Defaults - to ``bundled``, where the caller bundles all dependencies into the uploaded zip and the service - performs no remote build. ``remote_build`` instructs the service to build dependencies remotely - from the manifest included in the uploaded zip. Required. Known values are: "bundled" and - "remote_build". - :vartype dependency_resolution: str or ~azure.ai.projects.models.CodeDependencyResolution - :ivar content_hash: The SHA-256 hex digest of the uploaded code zip. Set by the service from - the ``x-ms-code-zip-sha256`` request header; read-only in responses and never accepted in - request payloads. - :vartype content_hash: str + :ivar type: Required. BOT_SERVICE_RBAC. + :vartype type: str or ~azure.ai.projects.models.BOT_SERVICE_RBAC """ - runtime: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The runtime identifier for code execution (e.g., 'python_3_11', 'python_3_12', 'python_3_13'). - Required.""" - entry_point: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The entry point command and arguments for the code execution. Required.""" - dependency_resolution: Union[str, "_models.CodeDependencyResolution"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """How package dependencies are resolved at deployment time. Defaults to ``bundled``, where the - caller bundles all dependencies into the uploaded zip and the service performs no remote build. - ``remote_build`` instructs the service to build dependencies remotely from the manifest - included in the uploaded zip. Required. Known values are: \"bundled\" and \"remote_build\".""" - content_hash: Optional[str] = rest_field(visibility=["read"]) - """The SHA-256 hex digest of the uploaded code zip. Set by the service from the - ``x-ms-code-zip-sha256`` request header; read-only in responses and never accepted in request - payloads.""" + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. BOT_SERVICE_RBAC.""" @overload def __init__( self, - *, - runtime: str, - entry_point: list[str], - dependency_resolution: Union[str, "_models.CodeDependencyResolution"], ) -> None: ... @overload @@ -4272,63 +4555,61 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC # type: ignore -class CodeInterpreterTool( - Tool, discriminator="code_interpreter" +class BotServiceTenantAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="BotServiceTenant"): + """BotServiceTenantAuthorizationScheme. + + :ivar type: Required. BOT_SERVICE_TENANT. + :vartype type: str or ~azure.ai.projects.models.BOT_SERVICE_TENANT + """ + + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. BOT_SERVICE_TENANT.""" + + @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 = AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT # type: ignore + + +class BrowserAutomationPreviewTool( + Tool, discriminator="browser_automation_preview" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Code interpreter. + """The input definition information for a Browser Automation Tool, as used to configure an Agent. - :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 + :ivar type: The object type, which is always 'browser_automation_preview'. Required. + BROWSER_AUTOMATION_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.BROWSER_AUTOMATION_PREVIEW + :ivar browser_automation_preview: The Browser Automation Tool parameters. Required. + :vartype browser_automation_preview: ~azure.ai.projects.models.BrowserAutomationToolParameters """ - 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( + type: Literal[ToolType.BROWSER_AUTOMATION_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'browser_automation_preview'. Required. + BROWSER_AUTOMATION_PREVIEW.""" + browser_automation_preview: "_models.BrowserAutomationToolParameters" = 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.""" + """The Browser Automation Tool parameters. Required.""" @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, + browser_automation_preview: "_models.BrowserAutomationToolParameters", ) -> None: ... @overload @@ -4340,13 +4621,13 @@ 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 + self.type = ToolType.BROWSER_AUTOMATION_PREVIEW # type: ignore -class CodeInterpreterToolboxTool( - ToolboxTool, discriminator="code_interpreter" +class BrowserAutomationPreviewToolboxTool( + ToolboxTool, discriminator="browser_automation_preview" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """A code interpreter tool stored in a toolbox. + """A browser automation tool stored in a toolbox. :ivar name: Optional user-defined name for this tool or configuration. :vartype name: str @@ -4356,39 +4637,27 @@ class CodeInterpreterToolboxTool( 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. 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 type: Required. BROWSER_AUTOMATION_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.BROWSER_AUTOMATION_PREVIEW + :ivar browser_automation_preview: The Browser Automation Tool parameters. Required. + :vartype browser_automation_preview: ~azure.ai.projects.models.BrowserAutomationToolParameters """ - type: Literal[ToolboxToolType.CODE_INTERPRETER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """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( + type: Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. BROWSER_AUTOMATION_PREVIEW.""" + browser_automation_preview: "_models.BrowserAutomationToolParameters" = 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.""" + """The Browser Automation Tool parameters. Required.""" @overload def __init__( self, *, + browser_automation_preview: "_models.BrowserAutomationToolParameters", 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, - container: Optional[Union[str, "_models.AutoCodeInterpreterToolParam"]] = None, ) -> None: ... @overload @@ -4400,63 +4669,27 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolboxToolType.CODE_INTERPRETER # type: ignore - + self.type = ToolboxToolType.BROWSER_AUTOMATION_PREVIEW # type: ignore -class ComparisonFilter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Comparison Filter. - :ivar type: Specifies the comparison operator: ``eq``, ``ne``, ``gt``, ``gte``, ``lt``, - ``lte``, ``in``, ``nin``. +class BrowserAutomationToolConnectionParameters( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Definition of input parameters for the connection used by the Browser Automation Tool. - * `eq`: equals - * `ne`: not equal - * `gt`: greater than - * `gte`: greater than or equal - * `lt`: less than - * `lte`: less than or equal - * `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 - :ivar value: The value to compare against the attribute key; supports string, number, or - boolean types. Required. Is one of the following types: str, float, bool, [Union[str, float]] - :vartype value: str or float or bool or list[str or float] + :ivar project_connection_id: The ID of the project connection to your Azure Playwright + resource. Required. + :vartype project_connection_id: str """ - type: Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies the comparison operator: ``eq``, ``ne``, ``gt``, ``gte``, ``lt``, ``lte``, ``in``, - ``nin``. - - * `eq`: equals - * `ne`: not equal - * `gt`: greater than - * `gte`: greater than or equal - * `lt`: less than - * `lte`: less than or equal - * `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\"]""" - key: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The key to compare against the value. Required.""" - value: Union[str, float, bool, list[Union[str, float]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The value to compare against the attribute key; supports string, number, or boolean types. - Required. Is one of the following types: str, float, bool, [Union[str, float]]""" + project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the project connection to your Azure Playwright resource. Required.""" @overload def __init__( self, *, - type: Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"], - key: str, - value: Union[str, float, bool, list[Union[str, float]]], + project_connection_id: str, ) -> None: ... @overload @@ -4470,31 +4703,24 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CompoundFilter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Compound Filter. +class BrowserAutomationToolParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Definition of input parameters for the Browser Automation Tool. - :ivar type: Type of operation: ``and`` or ``or``. Required. Is either a Literal["and"] type or - a Literal["or"] type. - :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] + :ivar connection: The project connection parameters associated with the Browser Automation + Tool. Required. + :vartype connection: ~azure.ai.projects.models.BrowserAutomationToolConnectionParameters """ - 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( + connection: "_models.BrowserAutomationToolConnectionParameters" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Array of filters to combine. Items can be ``ComparisonFilter`` or ``CompoundFilter``. Required.""" + """The project connection parameters associated with the Browser Automation Tool. Required.""" @overload def __init__( self, *, - type: Literal["and", "or"], - filters: list[Union["_models.ComparisonFilter", Any]], + connection: "_models.BrowserAutomationToolConnectionParameters", ) -> None: ... @overload @@ -4508,19 +4734,50 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ComputerTool(Tool, discriminator="computer"): - """Computer. +class CaptureStructuredOutputsTool( + Tool, discriminator="capture_structured_outputs" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A tool for capturing structured outputs. - :ivar type: The type of the computer tool. Always ``computer``. Required. COMPUTER. - :vartype type: str or ~azure.ai.projects.models.COMPUTER + :ivar type: The type of the tool. Always ``capture_structured_outputs``. Required. + CAPTURE_STRUCTURED_OUTPUTS. + :vartype type: str or ~azure.ai.projects.models.CAPTURE_STRUCTURED_OUTPUTS + :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 outputs: The structured outputs to capture from the model. Required. + :vartype outputs: ~azure.ai.projects.models.StructuredOutputDefinition """ - 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.""" + type: Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the tool. Always ``capture_structured_outputs``. Required. + CAPTURE_STRUCTURED_OUTPUTS.""" + 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.""" + outputs: "_models.StructuredOutputDefinition" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The structured outputs to capture from the model. Required.""" @overload def __init__( self, + *, + outputs: "_models.StructuredOutputDefinition", + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -4532,46 +4789,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.COMPUTER # type: ignore + self.type = ToolType.CAPTURE_STRUCTURED_OUTPUTS # type: ignore -class ComputerUsePreviewTool( - Tool, discriminator="computer_use_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Computer use preview. +class ChartCoordinate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Coordinates for the analysis chart. - :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 + :ivar x: X-axis coordinate. Required. + :vartype x: int + :ivar y: Y-axis coordinate. Required. + :vartype y: int + :ivar size: Size of the chart element. Required. + :vartype size: 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.""" + x: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """X-axis coordinate. Required.""" + y: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Y-axis coordinate. Required.""" + size: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Size of the chart element. Required.""" @overload def __init__( self, *, - environment: Union[str, "_models.ComputerEnvironment"], - display_width: int, - display_height: int, + x: int, + y: int, + size: int, ) -> None: ... @overload @@ -4583,69 +4828,52 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: 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. - - :ivar name: The friendly name of the connection, provided by the user. Required. - :vartype name: str - :ivar id: A unique identifier for the connection, generated by the service. Required. - :vartype id: str - :ivar type: Category of the connection. Required. Known values are: "AzureOpenAI", "AzureBlob", - "AzureStorageAccount", "CognitiveSearch", "CosmosDB", "ApiKey", "AppConfig", "AppInsights", - "CustomKeys", and "RemoteTool_Preview". - :vartype type: str or ~azure.ai.projects.models.ConnectionType - :ivar target: The connection URL to be used for this service. Required. - :vartype target: str - :ivar is_default: Whether the connection is tagged as the default connection of its type. - Required. - :vartype is_default: bool - :ivar credentials: The credentials used by the connection. Required. - :vartype credentials: ~azure.ai.projects.models.BaseCredentials - :ivar metadata: Metadata of the connection. Required. - :vartype metadata: dict[str, str] - """ - - name: str = rest_field(visibility=["read"]) - """The friendly name of the connection, provided by the user. Required.""" - id: str = rest_field(visibility=["read"]) - """A unique identifier for the connection, generated by the service. Required.""" - type: Union[str, "_models.ConnectionType"] = rest_field(visibility=["read"]) - """Category of the connection. Required. Known values are: \"AzureOpenAI\", \"AzureBlob\", - \"AzureStorageAccount\", \"CognitiveSearch\", \"CosmosDB\", \"ApiKey\", \"AppConfig\", - \"AppInsights\", \"CustomKeys\", and \"RemoteTool_Preview\".""" - target: str = rest_field(visibility=["read"]) - """The connection URL to be used for this service. Required.""" - is_default: bool = rest_field(name="isDefault", visibility=["read"]) - """Whether the connection is tagged as the default connection of its type. Required.""" - credentials: "_models.BaseCredentials" = rest_field(visibility=["read"]) - """The credentials used by the connection. Required.""" - metadata: dict[str, str] = rest_field(visibility=["read"]) - """Metadata of the connection. Required.""" -class FunctionShellToolParamEnvironment(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """FunctionShellToolParamEnvironment. +class MemoryItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A single memory item stored in the memory store, containing content and metadata. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ContainerAutoParam, FunctionShellToolParamEnvironmentContainerReferenceParam, - FunctionShellToolParamEnvironmentLocalEnvironmentParam + ChatSummaryMemoryItem, ProceduralMemoryItem, UserProfileMemoryItem - :ivar type: Required. Known values are: "container_auto", "local", and "container_reference". - :vartype type: str or ~azure.ai.projects.models.FunctionShellToolParamEnvironmentType + :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. Known values are: "user_profile", + "chat_summary", and "procedural". + :vartype kind: str or ~azure.ai.projects.models.MemoryItemKind """ __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"container_auto\", \"local\", and \"container_reference\".""" + memory_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the memory item. Required.""" + updated_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The last update time of the memory item. Required.""" + scope: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The namespace that logically groups and isolates memories, such as a user ID. Required.""" + content: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The content of the memory. Required.""" + kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) + """The kind of the memory item. Required. Known values are: \"user_profile\", \"chat_summary\", + and \"procedural\".""" @overload def __init__( self, *, - type: str, + memory_id: str, + updated_at: datetime.datetime, + scope: str, + content: str, + kind: str, ) -> None: ... @overload @@ -4659,47 +4887,35 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ContainerAutoParam( - FunctionShellToolParamEnvironment, discriminator="container_auto" +class ChatSummaryMemoryItem( + MemoryItem, discriminator="chat_summary" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """ContainerAutoParam. + """A memory item containing a summary extracted from conversations. - :ivar type: Automatically creates a container for this request. Required. CONTAINER_AUTO. - :vartype type: str or ~azure.ai.projects.models.CONTAINER_AUTO - :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: - :vartype network_policy: ~azure.ai.projects.models.ContainerNetworkPolicyParam + :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. Summary of chat conversations. + :vartype kind: str or ~azure.ai.projects.models.CHAT_SUMMARY """ - type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Automatically creates a container for this request. Required. 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.ContainerNetworkPolicyParam"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) + kind: Literal[MemoryItemKind.CHAT_SUMMARY] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The kind of the memory item. Required. Summary of chat conversations.""" @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.ContainerNetworkPolicyParam"] = None, + memory_id: str, + updated_at: datetime.datetime, + scope: str, + content: str, ) -> None: ... @overload @@ -4711,71 +4927,73 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = FunctionShellToolParamEnvironmentType.CONTAINER_AUTO # type: ignore - - -class ContainerConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Container-based deployment configuration for a hosted agent. + self.kind = MemoryItemKind.CHAT_SUMMARY # type: ignore - :ivar image: The container image for the hosted agent. Required. - :vartype image: str - :ivar registry_connection_id: The id (or name) of the Foundry project connection that provides - the credentials used to authenticate to the private container registry hosting ``image``. The - connection abstracts the auth mechanism — for example a managed-identity-federated token - exchange, or a username/token secret — so registry credentials are never part of the agent - definition. Omit for public images or registries already reachable by the platform's default - identity (for example, Azure Container Registry). - :vartype registry_connection_id: str - """ - image: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The container image for the hosted agent. Required.""" - registry_connection_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The id (or name) of the Foundry project connection that provides the credentials used to - authenticate to the private container registry hosting ``image``. The connection abstracts the - auth mechanism — for example a managed-identity-federated token exchange, or a username/token - secret — so registry credentials are never part of the agent definition. Omit for public images - or registries already reachable by the platform's default identity (for example, Azure - Container Registry).""" +class ClusterInsightResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Insights from the cluster analysis. - @overload - def __init__( - self, - *, - image: str, - registry_connection_id: Optional[str] = None, - ) -> None: ... + :ivar summary: Summary of the insights report. Required. + :vartype summary: ~azure.ai.projects.models.InsightSummary + :ivar clusters: List of clusters identified in the insights. Required. + :vartype clusters: list[~azure.ai.projects.models.InsightCluster] + :ivar coordinates: Optional mapping of IDs to 2D coordinates used by the UX for + visualization. - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ + The map keys are string identifiers (for example, a cluster id or a sample id) + and the values are the coordinates and visual size for rendering on a 2D chart. - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) + This property is omitted unless the client requests coordinates (for example, + by passing ``includeCoordinates=true`` as a query parameter). + Example: -class ContainerNetworkPolicyParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Network access policy for the container. + .. code-block:: - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ContainerNetworkPolicyAllowlistParam, ContainerNetworkPolicyDisabledParam + { + "cluster-1": { "x": 12, "y": 34, "size": 8 }, + "sample-123": { "x": 18, "y": 22, "size": 4 } + } - :ivar type: Required. Known values are: "disabled" and "allowlist". - :vartype type: str or ~azure.ai.projects.models.ContainerNetworkPolicyParamType + Coordinates are intended only for client-side visualization and do not + modify the canonical insights results. + :vartype coordinates: dict[str, ~azure.ai.projects.models.ChartCoordinate] """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"disabled\" and \"allowlist\".""" + summary: "_models.InsightSummary" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Summary of the insights report. Required.""" + clusters: list["_models.InsightCluster"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of clusters identified in the insights. Required.""" + coordinates: Optional[dict[str, "_models.ChartCoordinate"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """ Optional mapping of IDs to 2D coordinates used by the UX for visualization. + + The map keys are string identifiers (for example, a cluster id or a sample id) + and the values are the coordinates and visual size for rendering on a 2D chart. + + This property is omitted unless the client requests coordinates (for example, + by passing ``includeCoordinates=true`` as a query parameter). + + Example: + + .. code-block:: + + { + \"cluster-1\": { \"x\": 12, \"y\": 34, \"size\": 8 }, + \"sample-123\": { \"x\": 18, \"y\": 22, \"size\": 4 } + } + + Coordinates are intended only for client-side visualization and do not + modify the canonical insights results.""" @overload def __init__( self, *, - type: str, + summary: "_models.InsightSummary", + clusters: list["_models.InsightCluster"], + coordinates: Optional[dict[str, "_models.ChartCoordinate"]] = None, ) -> None: ... @overload @@ -4789,37 +5007,37 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ContainerNetworkPolicyAllowlistParam( - ContainerNetworkPolicyParam, discriminator="allowlist" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """ContainerNetworkPolicyAllowlistParam. +class ClusterTokenUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Token usage for cluster analysis. - :ivar type: Allow outbound network access only to specified domains. Always ``allowlist``. - Required. ALLOWLIST. - :vartype type: str or ~azure.ai.projects.models.ALLOWLIST - :ivar allowed_domains: A list of allowed domains when type is ``allowlist``. Required. - :vartype allowed_domains: list[str] - :ivar domain_secrets: Optional domain-scoped secrets for allowlisted domains. - :vartype domain_secrets: - list[~azure.ai.projects.models.ContainerNetworkPolicyDomainSecretParam] + :ivar input_token_usage: input token usage. Required. + :vartype input_token_usage: int + :ivar output_token_usage: output token usage. Required. + :vartype output_token_usage: int + :ivar total_token_usage: total token usage. Required. + :vartype total_token_usage: int """ - type: Literal[ContainerNetworkPolicyParamType.ALLOWLIST] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Allow outbound network access only to specified domains. Always ``allowlist``. Required. - ALLOWLIST.""" - allowed_domains: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A list of allowed domains when type is ``allowlist``. Required.""" - domain_secrets: Optional[list["_models.ContainerNetworkPolicyDomainSecretParam"]] = rest_field( - visibility=["create"] + input_token_usage: int = rest_field( + name="inputTokenUsage", visibility=["read", "create", "update", "delete", "query"] ) - """Optional domain-scoped secrets for allowlisted domains.""" + """input token usage. Required.""" + output_token_usage: int = rest_field( + name="outputTokenUsage", visibility=["read", "create", "update", "delete", "query"] + ) + """output token usage. Required.""" + total_token_usage: int = rest_field( + name="totalTokenUsage", visibility=["read", "create", "update", "delete", "query"] + ) + """total token usage. Required.""" @overload def __init__( self, *, - allowed_domains: list[str], - domain_secrets: Optional[list["_models.ContainerNetworkPolicyDomainSecretParam"]] = None, + input_token_usage: int, + output_token_usage: int, + total_token_usage: int, ) -> None: ... @overload @@ -4831,22 +5049,51 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ContainerNetworkPolicyParamType.ALLOWLIST # type: ignore -class ContainerNetworkPolicyDisabledParam(ContainerNetworkPolicyParam, discriminator="disabled"): - """ContainerNetworkPolicyDisabledParam. +class EvaluatorDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Base evaluator configuration with discriminator. - :ivar type: Disable outbound network access. Always ``disabled``. Required. DISABLED. - :vartype type: str or ~azure.ai.projects.models.DISABLED + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + CodeBasedEvaluatorDefinition, EndpointBasedEvaluatorDefinition, PromptBasedEvaluatorDefinition, + RubricBasedEvaluatorDefinition + + :ivar type: The type of evaluator definition. Required. Known values are: "prompt", "code", + "prompt_and_code", "service", "openai_graders", "rubric", and "endpoint". + :vartype type: str or ~azure.ai.projects.models.EvaluatorDefinitionType + :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] """ - type: Literal[ContainerNetworkPolicyParamType.DISABLED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Disable outbound network access. Always ``disabled``. Required. DISABLED.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The type of evaluator definition. Required. Known values are: \"prompt\", \"code\", + \"prompt_and_code\", \"service\", \"openai_graders\", \"rubric\", and \"endpoint\".""" + init_parameters: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The JSON schema (Draft 2020-12) for the evaluator's input parameters. This includes parameters + like type, properties, required.""" + data_schema: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The JSON schema (Draft 2020-12) for the evaluator's input data. This includes parameters like + type, properties, required.""" + metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of output metrics produced by this evaluator.""" @overload def __init__( self, + *, + type: str, + init_parameters: Optional[dict[str, Any]] = None, + data_schema: Optional[dict[str, Any]] = None, + metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, ) -> None: ... @overload @@ -4858,34 +5105,57 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ContainerNetworkPolicyParamType.DISABLED # type: ignore -class ContainerNetworkPolicyDomainSecretParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """ContainerNetworkPolicyDomainSecretParam. +class CodeBasedEvaluatorDefinition( + EvaluatorDefinition, discriminator="code" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Code-based evaluator definition using python code. - :ivar domain: The domain associated with the secret. Required. - :vartype domain: str - :ivar name: The name of the secret to inject for the domain. Required. - :vartype name: str - :ivar value: The secret value to inject for the domain. Required. - :vartype value: 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. Code-based definition. + :vartype type: str or ~azure.ai.projects.models.CODE + :ivar code_text: Inline code text for the evaluator. + :vartype code_text: str + :ivar entry_point: The entry point Python file name for the uploaded evaluator code (e.g. + 'answer_length_evaluator.py'). + :vartype entry_point: str + :ivar image_tag: The container image tag to use for evaluator code execution. + :vartype image_tag: str + :ivar blob_uri: The blob URI for the evaluator storage. + :vartype blob_uri: str """ - domain: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The domain associated with the secret. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the secret to inject for the domain. Required.""" - value: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The secret value to inject for the domain. Required.""" + type: Literal[EvaluatorDefinitionType.CODE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Code-based definition.""" + code_text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Inline code text for the evaluator.""" + entry_point: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The entry point Python file name for the uploaded evaluator code (e.g. + 'answer_length_evaluator.py').""" + image_tag: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The container image tag to use for evaluator code execution.""" + blob_uri: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The blob URI for the evaluator storage.""" @overload def __init__( self, *, - domain: str, - name: str, - value: str, + init_parameters: Optional[dict[str, Any]] = None, + data_schema: Optional[dict[str, Any]] = None, + metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, + code_text: Optional[str] = None, + entry_point: Optional[str] = None, + image_tag: Optional[str] = None, + blob_uri: Optional[str] = None, ) -> None: ... @overload @@ -4897,27 +5167,53 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = EvaluatorDefinitionType.CODE # type: ignore -class ContainerSkill(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """ContainerSkill. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - InlineSkillParam, SkillReferenceParam +class CodeConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Code-based deployment configuration for a hosted agent. - :ivar type: Required. Known values are: "skill_reference" and "inline". - :vartype type: str or ~azure.ai.projects.models.ContainerSkillType + :ivar runtime: The runtime identifier for code execution (e.g., 'python_3_11', 'python_3_12', + 'python_3_13'). Required. + :vartype runtime: str + :ivar entry_point: The entry point command and arguments for the code execution. Required. + :vartype entry_point: list[str] + :ivar dependency_resolution: How package dependencies are resolved at deployment time. Defaults + to ``bundled``, where the caller bundles all dependencies into the uploaded zip and the service + performs no remote build. ``remote_build`` instructs the service to build dependencies remotely + from the manifest included in the uploaded zip. Required. Known values are: "bundled" and + "remote_build". + :vartype dependency_resolution: str or ~azure.ai.projects.models.CodeDependencyResolution + :ivar content_hash: The SHA-256 hex digest of the uploaded code zip. Set by the service from + the ``x-ms-code-zip-sha256`` request header; read-only in responses and never accepted in + request payloads. + :vartype content_hash: str """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"skill_reference\" and \"inline\".""" + runtime: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The runtime identifier for code execution (e.g., 'python_3_11', 'python_3_12', 'python_3_13'). + Required.""" + entry_point: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The entry point command and arguments for the code execution. Required.""" + dependency_resolution: Union[str, "_models.CodeDependencyResolution"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """How package dependencies are resolved at deployment time. Defaults to ``bundled``, where the + caller bundles all dependencies into the uploaded zip and the service performs no remote build. + ``remote_build`` instructs the service to build dependencies remotely from the manifest + included in the uploaded zip. Required. Known values are: \"bundled\" and \"remote_build\".""" + content_hash: Optional[str] = rest_field(visibility=["read"]) + """The SHA-256 hex digest of the uploaded code zip. Set by the service from the + ``x-ms-code-zip-sha256`` request header; read-only in responses and never accepted in request + payloads.""" @overload def __init__( self, *, - type: str, + runtime: str, + entry_point: list[str], + dependency_resolution: Union[str, "_models.CodeDependencyResolution"], ) -> None: ... @overload @@ -4931,27 +5227,61 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationRuleAction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Evaluation action model. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ContinuousEvaluationRuleAction, HumanEvaluationPreviewRuleAction +class CodeInterpreterTool( + Tool, discriminator="code_interpreter" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Code interpreter. - :ivar type: Type of the evaluation action. Required. Known values are: "continuousEvaluation" - and "humanEvaluationPreview". - :vartype type: str or ~azure.ai.projects.models.EvaluationRuleActionType + :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 """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Type of the evaluation action. Required. Known values are: \"continuousEvaluation\" and - \"humanEvaluationPreview\".""" + 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, *, - type: str, + 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 @@ -4963,47 +5293,55 @@ 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 ContinuousEvaluationRuleAction( - EvaluationRuleAction, discriminator="continuousEvaluation" +class CodeInterpreterToolboxTool( + ToolboxTool, discriminator="code_interpreter" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Evaluation rule action for continuous evaluation. + """A code interpreter tool stored in a toolbox. - :ivar type: Required. Continuous evaluation. - :vartype type: str or ~azure.ai.projects.models.CONTINUOUS_EVALUATION - :ivar eval_id: Eval Id to add continuous evaluation runs to. Required. - :vartype eval_id: str - :ivar max_hourly_runs: Maximum number of evaluation runs allowed per hour. - :vartype max_hourly_runs: int - :ivar sampling_rate: Percentage (0-100] chance that a matching event triggers an evaluation. - When omitted, the service-default is to evaluate every event, which is equivalent to setting a - sampling rate of 100. - :vartype sampling_rate: float + :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. 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 """ - type: Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Continuous evaluation.""" - eval_id: str = rest_field(name="evalId", visibility=["read", "create", "update", "delete", "query"]) - """Eval Id to add continuous evaluation runs to. Required.""" - max_hourly_runs: Optional[int] = rest_field( - name="maxHourlyRuns", visibility=["read", "create", "update", "delete", "query"] + type: Literal[ToolboxToolType.CODE_INTERPRETER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. CODE_INTERPRETER.""" + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Maximum number of evaluation runs allowed per hour.""" - sampling_rate: Optional[float] = rest_field( - name="samplingRate", visibility=["read", "create", "update", "delete", "query"] + container: Optional[Union[str, "_models.AutoCodeInterpreterToolParam"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Percentage (0-100] chance that a matching event triggers an evaluation. When omitted, the - service-default is to evaluate every event, which is equivalent to setting a sampling rate of - 100.""" + """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, *, - eval_id: str, - max_hourly_runs: Optional[int] = None, - sampling_rate: Optional[float] = None, + 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, + container: Optional[Union[str, "_models.AutoCodeInterpreterToolParam"]] = None, ) -> None: ... @overload @@ -5015,64 +5353,63 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = EvaluationRuleActionType.CONTINUOUS_EVALUATION # type: ignore + self.type = ToolboxToolType.CODE_INTERPRETER # type: ignore -class CosmosDBIndex( - Index, discriminator="CosmosDBNoSqlVectorStore" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """CosmosDB Vector Store Index Definition. +class ComparisonFilter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Comparison Filter. - :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. CosmosDB. - :vartype type: str or ~azure.ai.projects.models.COSMOS_DB - :ivar connection_name: Name of connection to CosmosDB. Required. - :vartype connection_name: str - :ivar database_name: Name of the CosmosDB Database. Required. - :vartype database_name: str - :ivar container_name: Name of CosmosDB Container. Required. - :vartype container_name: str - :ivar embedding_configuration: Embedding model configuration. Required. - :vartype embedding_configuration: ~azure.ai.projects.models.EmbeddingConfiguration - :ivar field_mapping: Field mapping configuration. Required. - :vartype field_mapping: ~azure.ai.projects.models.FieldMapping + :ivar type: Specifies the comparison operator: ``eq``, ``ne``, ``gt``, ``gte``, ``lt``, + ``lte``, ``in``, ``nin``. + + * `eq`: equals + * `ne`: not equal + * `gt`: greater than + * `gte`: greater than or equal + * `lt`: less than + * `lte`: less than or equal + * `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 + :ivar value: The value to compare against the attribute key; supports string, number, or + boolean types. Required. Is one of the following types: str, float, bool, [Union[str, float]] + :vartype value: str or float or bool or list[str or float] """ - type: Literal[IndexType.COSMOS_DB] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Type of index. Required. CosmosDB.""" - connection_name: str = rest_field(name="connectionName", visibility=["create"]) - """Name of connection to CosmosDB. Required.""" - database_name: str = rest_field(name="databaseName", visibility=["create"]) - """Name of the CosmosDB Database. Required.""" - container_name: str = rest_field(name="containerName", visibility=["create"]) - """Name of CosmosDB Container. Required.""" - embedding_configuration: "_models.EmbeddingConfiguration" = rest_field( - name="embeddingConfiguration", visibility=["create"] + type: Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Embedding model configuration. Required.""" - field_mapping: "_models.FieldMapping" = rest_field(name="fieldMapping", visibility=["create"]) - """Field mapping configuration. Required.""" + """Specifies the comparison operator: ``eq``, ``ne``, ``gt``, ``gte``, ``lt``, ``lte``, ``in``, + ``nin``. + + * `eq`: equals + * `ne`: not equal + * `gt`: greater than + * `gte`: greater than or equal + * `lt`: less than + * `lte`: less than or equal + * `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\"]""" + key: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The key to compare against the value. Required.""" + value: Union[str, float, bool, list[Union[str, float]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The value to compare against the attribute key; supports string, number, or boolean types. + Required. Is one of the following types: str, float, bool, [Union[str, float]]""" @overload def __init__( self, *, - connection_name: str, - database_name: str, - container_name: str, - embedding_configuration: "_models.EmbeddingConfiguration", - field_mapping: "_models.FieldMapping", - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, + type: Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"], + key: str, + value: Union[str, float, bool, list[Union[str, float]]], ) -> None: ... @overload @@ -5084,32 +5421,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = IndexType.COSMOS_DB # type: ignore -class CreateAsyncResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """CreateAsyncResponse. +class CompoundFilter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Compound Filter. - :ivar location: URL to poll for operation status. - :vartype location: str - :ivar operation_result: URL to the operation result, or null if the operation is still in - progress. - :vartype operation_result: str + :ivar type: Type of operation: ``and`` or ``or``. Required. Is either a Literal["and"] type or + a Literal["or"] type. + :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] """ - location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """URL to poll for operation status.""" - operation_result: Optional[str] = rest_field( - name="operationResult", visibility=["read", "create", "update", "delete", "query"] + 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( + visibility=["read", "create", "update", "delete", "query"] ) - """URL to the operation result, or null if the operation is still in progress.""" + """Array of filters to combine. Items can be ``ComparisonFilter`` or ``CompoundFilter``. Required.""" @overload def __init__( self, *, - location: Optional[str] = None, - operation_result: Optional[str] = None, + type: Literal["and", "or"], + filters: list[Union["_models.ComparisonFilter", Any]], ) -> None: ... @overload @@ -5123,32 +5461,19 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CreateSkillVersionFromFilesBody(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Multipart request body for creating a skill version from files. Accepts either a single zip - file or multiple individual skill files (directory upload). For zip uploads, the server - extracts and validates contents. For directory uploads, files are validated as-is. +class ComputerTool(Tool, discriminator="computer"): + """Computer. - :ivar files: Skill files to upload. Upload a single zip file or multiple individual files with - relative paths. Required. - :vartype files: list[~azure.ai.projects._utils.utils.FileType] - :ivar default: Whether to set this version as the default. Defaults to false. - :vartype default: bool + :ivar type: The type of the computer tool. Always ``computer``. Required. COMPUTER. + :vartype type: str or ~azure.ai.projects.models.COMPUTER """ - files: list[FileType] = rest_field( - visibility=["read", "create", "update", "delete", "query"], is_multipart_file_input=True - ) - """Skill files to upload. Upload a single zip file or multiple individual files with relative - paths. Required.""" - default: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether to set this version as the default. Defaults to false.""" + 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, - *, - files: list[FileType], - default: Optional[bool] = None, ) -> None: ... @overload @@ -5160,27 +5485,46 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.COMPUTER # type: ignore -class CreateTranscriptionResponseJsonUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Token usage statistics for the request. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - TranscriptTextUsageDuration, TranscriptTextUsageTokens +class ComputerUsePreviewTool( + Tool, discriminator="computer_use_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Computer use preview. - :ivar type: Required. Known values are: "tokens" and "duration". - :vartype type: str or ~azure.ai.projects.models.CreateTranscriptionResponseJsonUsageType + :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 """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"tokens\" and \"duration\".""" + 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, *, - type: str, + environment: Union[str, "_models.ComputerEnvironment"], + display_width: int, + display_height: int, ) -> None: ... @overload @@ -5192,22 +5536,63 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.COMPUTER_USE_PREVIEW # type: ignore -class Trigger(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Base model for Trigger of the schedule. +class Connection(_Model): + """Response from the list and get connections operations. + + :ivar name: The friendly name of the connection, provided by the user. Required. + :vartype name: str + :ivar id: A unique identifier for the connection, generated by the service. Required. + :vartype id: str + :ivar type: Category of the connection. Required. Known values are: "AzureOpenAI", "AzureBlob", + "AzureStorageAccount", "CognitiveSearch", "CosmosDB", "ApiKey", "AppConfig", "AppInsights", + "CustomKeys", and "RemoteTool_Preview". + :vartype type: str or ~azure.ai.projects.models.ConnectionType + :ivar target: The connection URL to be used for this service. Required. + :vartype target: str + :ivar is_default: Whether the connection is tagged as the default connection of its type. + Required. + :vartype is_default: bool + :ivar credentials: The credentials used by the connection. Required. + :vartype credentials: ~azure.ai.projects.models.BaseCredentials + :ivar metadata: Metadata of the connection. Required. + :vartype metadata: dict[str, str] + """ + + name: str = rest_field(visibility=["read"]) + """The friendly name of the connection, provided by the user. Required.""" + id: str = rest_field(visibility=["read"]) + """A unique identifier for the connection, generated by the service. Required.""" + type: Union[str, "_models.ConnectionType"] = rest_field(visibility=["read"]) + """Category of the connection. Required. Known values are: \"AzureOpenAI\", \"AzureBlob\", + \"AzureStorageAccount\", \"CognitiveSearch\", \"CosmosDB\", \"ApiKey\", \"AppConfig\", + \"AppInsights\", \"CustomKeys\", and \"RemoteTool_Preview\".""" + target: str = rest_field(visibility=["read"]) + """The connection URL to be used for this service. Required.""" + is_default: bool = rest_field(name="isDefault", visibility=["read"]) + """Whether the connection is tagged as the default connection of its type. Required.""" + credentials: "_models.BaseCredentials" = rest_field(visibility=["read"]) + """The credentials used by the connection. Required.""" + metadata: dict[str, str] = rest_field(visibility=["read"]) + """Metadata of the connection. Required.""" + + +class FunctionShellToolParamEnvironment(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """FunctionShellToolParamEnvironment. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - CronTrigger, OneTimeTrigger, RecurrenceTrigger + ContainerAutoParam, FunctionShellToolParamEnvironmentContainerReferenceParam, + FunctionShellToolParamEnvironmentLocalEnvironmentParam - :ivar type: Type of the trigger. Required. Known values are: "Cron", "Recurrence", and - "OneTime". - :vartype type: str or ~azure.ai.projects.models.TriggerType + :ivar type: Required. Known values are: "container_auto", "local", and "container_reference". + :vartype type: str or ~azure.ai.projects.models.FunctionShellToolParamEnvironmentType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Type of the trigger. Required. Known values are: \"Cron\", \"Recurrence\", and \"OneTime\".""" + """Required. Known values are: \"container_auto\", \"local\", and \"container_reference\".""" @overload def __init__( @@ -5227,44 +5612,47 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CronTrigger(Trigger, discriminator="Cron"): # pylint: disable=docstring-keyword-should-match-keyword-only - """Cron based trigger. +class ContainerAutoParam( + FunctionShellToolParamEnvironment, discriminator="container_auto" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """ContainerAutoParam. - :ivar type: Required. Cron based trigger. - :vartype type: str or ~azure.ai.projects.models.CRON - :ivar expression: Cron expression that defines the schedule frequency. Required. - :vartype expression: str - :ivar time_zone: Time zone for the cron schedule. Defaults to ``UTC``. - :vartype time_zone: str - :ivar start_time: Start time for the cron schedule in ISO 8601 format. - :vartype start_time: ~datetime.datetime - :ivar end_time: End time for the cron schedule in ISO 8601 format. - :vartype end_time: ~datetime.datetime + :ivar type: Automatically creates a container for this request. Required. CONTAINER_AUTO. + :vartype type: str or ~azure.ai.projects.models.CONTAINER_AUTO + :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: + :vartype network_policy: ~azure.ai.projects.models.ContainerNetworkPolicyParam """ - type: Literal[TriggerType.CRON] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Cron based trigger.""" - expression: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Cron expression that defines the schedule frequency. Required.""" - time_zone: Optional[str] = rest_field(name="timeZone", visibility=["read", "create", "update", "delete", "query"]) - """Time zone for the cron schedule. Defaults to ``UTC``.""" - start_time: Optional[datetime.datetime] = rest_field( - name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Automatically creates a container for this request. Required. 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"] ) - """Start time for the cron schedule in ISO 8601 format.""" - end_time: Optional[datetime.datetime] = rest_field( - name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + """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.ContainerNetworkPolicyParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """End time for the cron schedule in ISO 8601 format.""" @overload def __init__( self, *, - expression: str, - time_zone: Optional[str] = None, - start_time: Optional[datetime.datetime] = None, - end_time: Optional[datetime.datetime] = 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.ContainerNetworkPolicyParam"] = None, ) -> None: ... @overload @@ -5276,22 +5664,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = TriggerType.CRON # type: ignore + self.type = FunctionShellToolParamEnvironmentType.CONTAINER_AUTO # type: ignore -class CustomCredential(BaseCredentials, discriminator="CustomKeys"): - """Custom credential definition. +class ContainerConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Container-based deployment configuration for a hosted agent. - :ivar type: The credential type. Required. Custom credential. - :vartype type: str or ~azure.ai.projects.models.CUSTOM + :ivar image: The container image for the hosted agent. Required. + :vartype image: str + :ivar registry_connection_id: The id (or name) of the Foundry project connection that provides + the credentials used to authenticate to the private container registry hosting ``image``. The + connection abstracts the auth mechanism — for example a managed-identity-federated token + exchange, or a username/token secret — so registry credentials are never part of the agent + definition. Omit for public images or registries already reachable by the platform's default + identity (for example, Azure Container Registry). + :vartype registry_connection_id: str """ - type: Literal[CredentialType.CUSTOM] = rest_discriminator(name="type", visibility=["read"]) # type: ignore - """The credential type. Required. Custom credential.""" + image: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The container image for the hosted agent. Required.""" + registry_connection_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The id (or name) of the Foundry project connection that provides the credentials used to + authenticate to the private container registry hosting ``image``. The connection abstracts the + auth mechanism — for example a managed-identity-federated token exchange, or a username/token + secret — so registry credentials are never part of the agent definition. Omit for public images + or registries already reachable by the platform's default identity (for example, Azure + Container Registry).""" @overload def __init__( self, + *, + image: str, + registry_connection_id: Optional[str] = None, ) -> None: ... @overload @@ -5303,22 +5708,21 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = CredentialType.CUSTOM # type: ignore -class CustomToolParamFormat(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The input format for the custom tool. Default is unconstrained text. +class ContainerNetworkPolicyParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Network access policy for the container. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - CustomGrammarFormatParam, CustomTextFormatParam + ContainerNetworkPolicyAllowlistParam, ContainerNetworkPolicyDisabledParam - :ivar type: Required. Known values are: "text" and "grammar". - :vartype type: str or ~azure.ai.projects.models.CustomToolParamFormatType + :ivar type: Required. Known values are: "disabled" and "allowlist". + :vartype type: str or ~azure.ai.projects.models.ContainerNetworkPolicyParamType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"text\" and \"grammar\".""" + """Required. Known values are: \"disabled\" and \"allowlist\".""" @overload def __init__( @@ -5338,36 +5742,37 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CustomGrammarFormatParam( - CustomToolParamFormat, discriminator="grammar" +class ContainerNetworkPolicyAllowlistParam( + ContainerNetworkPolicyParam, discriminator="allowlist" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Grammar format. + """ContainerNetworkPolicyAllowlistParam. - :ivar type: Grammar format. Always ``grammar``. Required. GRAMMAR. - :vartype type: str or ~azure.ai.projects.models.GRAMMAR - :ivar syntax: The syntax of the grammar definition. One of ``lark`` or ``regex``. Required. - Known values are: "lark" and "regex". - :vartype syntax: str or ~azure.ai.projects.models.GrammarSyntax1 - :ivar definition: The grammar definition. Required. - :vartype definition: str + :ivar type: Allow outbound network access only to specified domains. Always ``allowlist``. + Required. ALLOWLIST. + :vartype type: str or ~azure.ai.projects.models.ALLOWLIST + :ivar allowed_domains: A list of allowed domains when type is ``allowlist``. Required. + :vartype allowed_domains: list[str] + :ivar domain_secrets: Optional domain-scoped secrets for allowlisted domains. + :vartype domain_secrets: + list[~azure.ai.projects.models.ContainerNetworkPolicyDomainSecretParam] """ - type: Literal[CustomToolParamFormatType.GRAMMAR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Grammar format. Always ``grammar``. Required. GRAMMAR.""" - syntax: Union[str, "_models.GrammarSyntax1"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + type: Literal[ContainerNetworkPolicyParamType.ALLOWLIST] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Allow outbound network access only to specified domains. Always ``allowlist``. Required. + ALLOWLIST.""" + allowed_domains: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A list of allowed domains when type is ``allowlist``. Required.""" + domain_secrets: Optional[list["_models.ContainerNetworkPolicyDomainSecretParam"]] = rest_field( + visibility=["create"] ) - """The syntax of the grammar definition. One of ``lark`` or ``regex``. Required. Known values are: - \"lark\" and \"regex\".""" - definition: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The grammar definition. Required.""" + """Optional domain-scoped secrets for allowlisted domains.""" @overload def __init__( self, *, - syntax: Union[str, "_models.GrammarSyntax1"], - definition: str, + allowed_domains: list[str], + domain_secrets: Optional[list["_models.ContainerNetworkPolicyDomainSecretParam"]] = None, ) -> None: ... @overload @@ -5379,30 +5784,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = CustomToolParamFormatType.GRAMMAR # type: ignore - + self.type = ContainerNetworkPolicyParamType.ALLOWLIST # type: ignore -class RoutineTrigger(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Base model for a routine trigger. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - CustomRoutineTrigger, GitHubIssueRoutineTrigger, ScheduleRoutineTrigger, TimerRoutineTrigger +class ContainerNetworkPolicyDisabledParam(ContainerNetworkPolicyParam, discriminator="disabled"): + """ContainerNetworkPolicyDisabledParam. - :ivar type: The trigger type. Required. Known values are: "custom", "github_issue", "schedule", - and "timer". - :vartype type: str or ~azure.ai.projects.models.RoutineTriggerType + :ivar type: Disable outbound network access. Always ``disabled``. Required. DISABLED. + :vartype type: str or ~azure.ai.projects.models.DISABLED """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The trigger type. Required. Known values are: \"custom\", \"github_issue\", \"schedule\", and - \"timer\".""" + type: Literal[ContainerNetworkPolicyParamType.DISABLED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Disable outbound network access. Always ``disabled``. Required. DISABLED.""" @overload def __init__( self, - *, - type: str, ) -> None: ... @overload @@ -5414,39 +5811,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ContainerNetworkPolicyParamType.DISABLED # type: ignore -class CustomRoutineTrigger( - RoutineTrigger, discriminator="custom" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A custom event routine trigger. +class ContainerNetworkPolicyDomainSecretParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ContainerNetworkPolicyDomainSecretParam. - :ivar type: The trigger type. Required. A custom event trigger. - :vartype type: str or ~azure.ai.projects.models.CUSTOM - :ivar provider: The external provider that emits the custom event. Required. - :vartype provider: str - :ivar event_name: The provider-specific event name that fires the routine. - :vartype event_name: str - :ivar parameters: Provider-specific trigger parameters. Required. - :vartype parameters: dict[str, any] + :ivar domain: The domain associated with the secret. Required. + :vartype domain: str + :ivar name: The name of the secret to inject for the domain. Required. + :vartype name: str + :ivar value: The secret value to inject for the domain. Required. + :vartype value: str """ - type: Literal[RoutineTriggerType.CUSTOM] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The trigger type. Required. A custom event trigger.""" - provider: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The external provider that emits the custom event. Required.""" - event_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The provider-specific event name that fires the routine.""" - parameters: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Provider-specific trigger parameters. Required.""" + domain: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The domain associated with the secret. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the secret to inject for the domain. Required.""" + value: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The secret value to inject for the domain. Required.""" @overload def __init__( self, *, - provider: str, - parameters: dict[str, Any], - event_name: Optional[str] = None, + domain: str, + name: str, + value: str, ) -> None: ... @overload @@ -5458,78 +5850,27 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RoutineTriggerType.CUSTOM # type: ignore - - -class CustomTextFormatParam(CustomToolParamFormat, discriminator="text"): - """Text format. - - :ivar type: Unconstrained text format. Always ``text``. Required. TEXT. - :vartype type: str or ~azure.ai.projects.models.TEXT - """ - - type: Literal[CustomToolParamFormatType.TEXT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Unconstrained text format. 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 = CustomToolParamFormatType.TEXT # type: ignore +class ContainerSkill(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ContainerSkill. -class CustomToolParam(Tool, discriminator="custom"): # pylint: disable=docstring-keyword-should-match-keyword-only - """Custom tool. + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + InlineSkillParam, SkillReferenceParam - :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 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] + :ivar type: Required. Known values are: "skill_reference" and "inline". + :vartype type: str or ~azure.ai.projects.models.ContainerSkillType """ - 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.""" - 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"] - ) + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"skill_reference\" and \"inline\".""" @overload def __init__( self, *, - name: str, - description: Optional[str] = None, - format: Optional["_models.CustomToolParamFormat"] = None, - defer_loading: Optional[bool] = None, - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, + type: str, ) -> None: ... @overload @@ -5541,25 +5882,23 @@ 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 -class RecurrenceSchedule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Recurrence schedule model. +class EvaluationRuleAction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Evaluation action model. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - DailyRecurrenceSchedule, HourlyRecurrenceSchedule, MonthlyRecurrenceSchedule, - WeeklyRecurrenceSchedule + ContinuousEvaluationRuleAction, HumanEvaluationPreviewRuleAction - :ivar type: Recurrence type for the recurrence schedule. Required. Known values are: "Hourly", - "Daily", "Weekly", and "Monthly". - :vartype type: str or ~azure.ai.projects.models.RecurrenceType + :ivar type: Type of the evaluation action. Required. Known values are: "continuousEvaluation" + and "humanEvaluationPreview". + :vartype type: str or ~azure.ai.projects.models.EvaluationRuleActionType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Recurrence type for the recurrence schedule. Required. Known values are: \"Hourly\", \"Daily\", - \"Weekly\", and \"Monthly\".""" + """Type of the evaluation action. Required. Known values are: \"continuousEvaluation\" and + \"humanEvaluationPreview\".""" @overload def __init__( @@ -5579,27 +5918,45 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DailyRecurrenceSchedule( - RecurrenceSchedule, discriminator="Daily" +class ContinuousEvaluationRuleAction( + EvaluationRuleAction, discriminator="continuousEvaluation" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Daily recurrence schedule. + """Evaluation rule action for continuous evaluation. - :ivar type: Daily recurrence type. Required. Daily recurrence pattern. - :vartype type: str or ~azure.ai.projects.models.DAILY - :ivar hours: Hours for the recurrence schedule. Required. - :vartype hours: list[int] + :ivar type: Required. Continuous evaluation. + :vartype type: str or ~azure.ai.projects.models.CONTINUOUS_EVALUATION + :ivar eval_id: Eval Id to add continuous evaluation runs to. Required. + :vartype eval_id: str + :ivar max_hourly_runs: Maximum number of evaluation runs allowed per hour. + :vartype max_hourly_runs: int + :ivar sampling_rate: Percentage (0-100] chance that a matching event triggers an evaluation. + When omitted, the service-default is to evaluate every event, which is equivalent to setting a + sampling rate of 100. + :vartype sampling_rate: float """ - type: Literal[RecurrenceType.DAILY] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Daily recurrence type. Required. Daily recurrence pattern.""" - hours: list[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Hours for the recurrence schedule. Required.""" + type: Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Continuous evaluation.""" + eval_id: str = rest_field(name="evalId", visibility=["read", "create", "update", "delete", "query"]) + """Eval Id to add continuous evaluation runs to. Required.""" + max_hourly_runs: Optional[int] = rest_field( + name="maxHourlyRuns", visibility=["read", "create", "update", "delete", "query"] + ) + """Maximum number of evaluation runs allowed per hour.""" + sampling_rate: Optional[float] = rest_field( + name="samplingRate", visibility=["read", "create", "update", "delete", "query"] + ) + """Percentage (0-100] chance that a matching event triggers an evaluation. When omitted, the + service-default is to evaluate every event, which is equivalent to setting a sampling rate of + 100.""" @overload def __init__( self, *, - hours: list[int], + eval_id: str, + max_hourly_runs: Optional[int] = None, + sampling_rate: Optional[float] = None, ) -> None: ... @overload @@ -5611,56 +5968,64 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RecurrenceType.DAILY # type: ignore + self.type = EvaluationRuleActionType.CONTINUOUS_EVALUATION # type: ignore -class DataGenerationJob(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Data Generation Job resource. +class CosmosDBIndex( + Index, discriminator="CosmosDBNoSqlVectorStore" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """CosmosDB Vector Store Index Definition. - :ivar id: Server-assigned unique identifier. Required. + :ivar id: Asset ID, a unique identifier for the asset. :vartype id: str - :ivar inputs: Caller-supplied inputs. - :vartype inputs: ~azure.ai.projects.models.DataGenerationJobInputs - :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 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 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. CosmosDB. + :vartype type: str or ~azure.ai.projects.models.COSMOS_DB + :ivar connection_name: Name of connection to CosmosDB. Required. + :vartype connection_name: str + :ivar database_name: Name of the CosmosDB Database. Required. + :vartype database_name: str + :ivar container_name: Name of CosmosDB Container. Required. + :vartype container_name: str + :ivar embedding_configuration: Embedding model configuration. Required. + :vartype embedding_configuration: ~azure.ai.projects.models.EmbeddingConfiguration + :ivar field_mapping: Field mapping configuration. Required. + :vartype field_mapping: ~azure.ai.projects.models.FieldMapping """ - id: str = rest_field(visibility=["read"]) - """Server-assigned unique identifier. Required.""" - inputs: Optional["_models.DataGenerationJobInputs"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + type: Literal[IndexType.COSMOS_DB] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Type of index. Required. CosmosDB.""" + connection_name: str = rest_field(name="connectionName", visibility=["create"]) + """Name of connection to CosmosDB. Required.""" + database_name: str = rest_field(name="databaseName", visibility=["create"]) + """Name of the CosmosDB Database. Required.""" + container_name: str = rest_field(name="containerName", visibility=["create"]) + """Name of CosmosDB Container. Required.""" + embedding_configuration: "_models.EmbeddingConfiguration" = rest_field( + name="embeddingConfiguration", visibility=["create"] ) - """Caller-supplied inputs.""" - result: Optional["_models.DataGenerationJobResult"] = rest_field(visibility=["read"]) - """Result produced on success.""" - status: Union[str, "_models.JobStatus"] = rest_field(visibility=["read"]) - """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", - \"succeeded\", \"failed\", and \"cancelled\".""" - error: Optional["_models.ApiError"] = rest_field(visibility=["read"]) - """Error details — populated only on failure.""" - created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") - """The timestamp when the job was created, represented in Unix time (seconds since January 1, - 1970). Required.""" - finished_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") - """The timestamp when the job was finished, represented in Unix time (seconds since January 1, - 1970).""" + """Embedding model configuration. Required.""" + field_mapping: "_models.FieldMapping" = rest_field(name="fieldMapping", visibility=["create"]) + """Field mapping configuration. Required.""" @overload def __init__( self, *, - inputs: Optional["_models.DataGenerationJobInputs"] = None, + connection_name: str, + database_name: str, + container_name: str, + embedding_configuration: "_models.EmbeddingConfiguration", + field_mapping: "_models.FieldMapping", + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -5672,55 +6037,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = IndexType.COSMOS_DB # type: ignore -class DataGenerationJobInputs(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Caller-supplied inputs for a data generation job. +class CreateAsyncResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """CreateAsyncResponse. - :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 options: The options for the data generation job. Required. - :vartype options: ~azure.ai.projects.models.DataGenerationJobOptions - :ivar scenario: The scenario of the data generation job. Either for fine-tuning or evaluation. - Required. Known values are: "supervised_finetuning", "reinforcement_finetuning", and - "evaluation". - :vartype scenario: str or ~azure.ai.projects.models.DataGenerationJobScenario - :ivar output_options: Optional caller-supplied metadata for the job's output. See individual - fields for whether they apply to file outputs (fine-tuning scenarios), dataset outputs - (evaluation scenario), or both. - :vartype output_options: ~azure.ai.projects.models.DataGenerationJobOutputOptions + :ivar location: URL to poll for operation status. + :vartype location: str + :ivar operation_result: URL to the operation result, or null if the operation is still in + progress. + :vartype operation_result: str """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The display name of the data generation job. Required.""" - sources: list["_models.DataGenerationJobSource"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The sources used for the data generation job. Required.""" - options: "_models.DataGenerationJobOptions" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The options for the data generation job. Required.""" - scenario: Union[str, "_models.DataGenerationJobScenario"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The scenario of the data generation job. Either for fine-tuning or evaluation. Required. Known - values are: \"supervised_finetuning\", \"reinforcement_finetuning\", and \"evaluation\".""" - output_options: Optional["_models.DataGenerationJobOutputOptions"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """URL to poll for operation status.""" + operation_result: Optional[str] = rest_field( + name="operationResult", visibility=["read", "create", "update", "delete", "query"] ) - """Optional caller-supplied metadata for the job's output. See individual fields for whether they - apply to file outputs (fine-tuning scenarios), dataset outputs (evaluation scenario), or both.""" + """URL to the operation result, or null if the operation is still in progress.""" @overload def __init__( self, *, - name: str, - sources: list["_models.DataGenerationJobSource"], - options: "_models.DataGenerationJobOptions", - scenario: Union[str, "_models.DataGenerationJobScenario"], - output_options: Optional["_models.DataGenerationJobOutputOptions"] = None, + location: Optional[str] = None, + operation_result: Optional[str] = None, ) -> None: ... @overload @@ -5734,47 +6076,32 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DataGenerationJobOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Options for managing data generation jobs. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - SimpleQnADataGenerationJobOptions, SimulationSeedDataGenerationJobOptions, - ToolUseFineTuningDataGenerationJobOptions, TracesDataGenerationJobOptions +class CreateSkillVersionFromFilesBody(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Multipart request body for creating a skill version from files. Accepts either a single zip + file or multiple individual skill files (directory upload). For zip uploads, the server + extracts and validates contents. For directory uploads, files are validated as-is. - :ivar type: The data generation job type. Required. Known values are: "simple_qna", "traces", - "tool_use", and "simulation_seed". - :vartype type: str or ~azure.ai.projects.models.DataGenerationJobType - :ivar max_samples: Maximum number of samples to generate. Required. - :vartype max_samples: int - :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 files: Skill files to upload. Upload a single zip file or multiple individual files with + relative paths. Required. + :vartype files: list[~azure.ai.projects._utils.utils.FileType] + :ivar default: Whether to set this version as the default. Defaults to false. + :vartype default: bool """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The data generation job type. Required. Known values are: \"simple_qna\", \"traces\", - \"tool_use\", and \"simulation_seed\".""" - max_samples: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Maximum number of samples to generate. Required.""" - train_split: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """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.""" - model_options: Optional["_models.DataGenerationModelOptions"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + files: list[FileType] = rest_field( + visibility=["read", "create", "update", "delete", "query"], is_multipart_file_input=True ) - """The LLM model options.""" + """Skill files to upload. Upload a single zip file or multiple individual files with relative + paths. Required.""" + default: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to set this version as the default. Defaults to false.""" @overload def __init__( self, *, - type: str, - max_samples: int, - train_split: Optional[float] = None, - model_options: Optional["_models.DataGenerationModelOptions"] = None, + files: list[FileType], + default: Optional[bool] = None, ) -> None: ... @overload @@ -5788,19 +6115,19 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DataGenerationJobOutput(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Output information for a data generation job. +class CreateTranscriptionResponseJsonUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Token usage statistics for the request. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - DatasetDataGenerationJobOutput, FileDataGenerationJobOutput + TranscriptTextUsageDuration, TranscriptTextUsageTokens - :ivar type: The type of the output. Required. Known values are: "file" and "dataset". - :vartype type: str or ~azure.ai.projects.models.DataGenerationJobOutputType + :ivar type: Required. Known values are: "tokens" and "duration". + :vartype type: str or ~azure.ai.projects.models.CreateTranscriptionResponseJsonUsageType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of the output. Required. Known values are: \"file\" and \"dataset\".""" + """Required. Known values are: \"tokens\" and \"duration\".""" @overload def __init__( @@ -5820,37 +6147,26 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DataGenerationJobOutputOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Output options for data generation job. +class Trigger(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Base model for Trigger of the schedule. - :ivar name: Name to assign to the output. Used as the filename for Azure OpenAI file outputs - (fine-tuning scenarios) and as the dataset name for dataset outputs (evaluation scenario). - :vartype name: str - :ivar description: Description to assign to the output. Applies only to dataset outputs - (evaluation scenario); ignored for Azure OpenAI file outputs. - :vartype description: str - :ivar tags: Tags to assign to the output. Applies only to dataset outputs (evaluation - scenario); ignored for Azure OpenAI file outputs. - :vartype tags: dict[str, str] + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + CronTrigger, OneTimeTrigger, RecurrenceTrigger + + :ivar type: Type of the trigger. Required. Known values are: "Cron", "Recurrence", and + "OneTime". + :vartype type: str or ~azure.ai.projects.models.TriggerType """ - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name to assign to the output. Used as the filename for Azure OpenAI file outputs (fine-tuning - scenarios) and as the dataset name for dataset outputs (evaluation scenario).""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Description to assign to the output. Applies only to dataset outputs (evaluation scenario); - ignored for Azure OpenAI file outputs.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Tags to assign to the output. Applies only to dataset outputs (evaluation scenario); ignored - for Azure OpenAI file outputs.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Type of the trigger. Required. Known values are: \"Cron\", \"Recurrence\", and \"OneTime\".""" @overload def __init__( self, *, - name: Optional[str] = None, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, + type: str, ) -> None: ... @overload @@ -5864,36 +6180,44 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DataGenerationJobResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Result produced by a successful data generation job. +class CronTrigger(Trigger, discriminator="Cron"): # pylint: disable=docstring-keyword-should-match-keyword-only + """Cron based trigger. - :ivar outputs: The final job outputs: Azure OpenAI files for fine-tuning, or datasets for - evaluation. - :vartype outputs: list[~azure.ai.projects.models.DataGenerationJobOutput] - :ivar generated_samples: The number of samples actually generated. Required. - :vartype generated_samples: int - :ivar token_usage: The token usage information for the data generation job. - :vartype token_usage: ~azure.ai.projects.models.DataGenerationTokenUsage + :ivar type: Required. Cron based trigger. + :vartype type: str or ~azure.ai.projects.models.CRON + :ivar expression: Cron expression that defines the schedule frequency. Required. + :vartype expression: str + :ivar time_zone: Time zone for the cron schedule. Defaults to ``UTC``. + :vartype time_zone: str + :ivar start_time: Start time for the cron schedule in ISO 8601 format. + :vartype start_time: ~datetime.datetime + :ivar end_time: End time for the cron schedule in ISO 8601 format. + :vartype end_time: ~datetime.datetime """ - outputs: Optional[list["_models.DataGenerationJobOutput"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + type: Literal[TriggerType.CRON] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Cron based trigger.""" + expression: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Cron expression that defines the schedule frequency. Required.""" + time_zone: Optional[str] = rest_field(name="timeZone", visibility=["read", "create", "update", "delete", "query"]) + """Time zone for the cron schedule. Defaults to ``UTC``.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" ) - """The final job outputs: Azure OpenAI files for fine-tuning, or datasets for evaluation.""" - generated_samples: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of samples actually generated. Required.""" - token_usage: Optional["_models.DataGenerationTokenUsage"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + """Start time for the cron schedule in ISO 8601 format.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" ) - """The token usage information for the data generation job.""" + """End time for the cron schedule in ISO 8601 format.""" @overload def __init__( self, *, - generated_samples: int, - outputs: Optional[list["_models.DataGenerationJobOutput"]] = None, - token_usage: Optional["_models.DataGenerationTokenUsage"] = None, + expression: str, + time_zone: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, ) -> None: ... @overload @@ -5905,23 +6229,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = TriggerType.CRON # type: ignore -class DataGenerationModelOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """LLM model options for data generation jobs. +class CustomCredential(BaseCredentials, discriminator="CustomKeys"): + """Custom credential definition. - :ivar model: Base model name used to generate data. Required. - :vartype model: str + :ivar type: The credential type. Required. Custom credential. + :vartype type: str or ~azure.ai.projects.models.CUSTOM """ - model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Base model name used to generate data. Required.""" + type: Literal[CredentialType.CUSTOM] = rest_discriminator(name="type", visibility=["read"]) # type: ignore + """The credential type. Required. Custom credential.""" @overload def __init__( self, - *, - model: str, ) -> None: ... @overload @@ -5933,44 +6256,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = CredentialType.CUSTOM # type: ignore -class DataGenerationTokenUsage(_Model): - """Token usage information for a data generation job. - - :ivar prompt_tokens: The number of prompt tokens used. Required. - :vartype prompt_tokens: int - :ivar completion_tokens: The number of completion tokens generated. Required. - :vartype completion_tokens: int - :ivar total_tokens: Total number of tokens used. Required. - :vartype total_tokens: int - """ - - prompt_tokens: int = rest_field(visibility=["read"]) - """The number of prompt tokens used. Required.""" - completion_tokens: int = rest_field(visibility=["read"]) - """The number of completion tokens generated. Required.""" - total_tokens: int = rest_field(visibility=["read"]) - """Total number of tokens used. Required.""" - +class CustomToolParamFormat(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The input format for the custom tool. Default is unconstrained text. -class DatasetCredential(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Represents a reference to a blob for consumption. + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + CustomGrammarFormatParam, CustomTextFormatParam - :ivar blob_reference: Credential info to access the storage account. Required. - :vartype blob_reference: ~azure.ai.projects.models.BlobReference + :ivar type: Required. Known values are: "text" and "grammar". + :vartype type: str or ~azure.ai.projects.models.CustomToolParamFormatType """ - blob_reference: "_models.BlobReference" = rest_field( - name="blobReference", visibility=["read", "create", "update", "delete", "query"] - ) - """Credential info to access the storage account. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"text\" and \"grammar\".""" @overload def __init__( self, *, - blob_reference: "_models.BlobReference", + type: str, ) -> None: ... @overload @@ -5984,39 +6291,36 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DatasetDataGenerationJobOutput(DataGenerationJobOutput, discriminator="dataset"): - """Dataset output for a data generation job. +class CustomGrammarFormatParam( + CustomToolParamFormat, discriminator="grammar" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Grammar format. - :ivar type: Dataset output. Required. The generated data is a Dataset. - :vartype type: str or ~azure.ai.projects.models.DATASET - :ivar id: The id of the output dataset created. - :vartype id: str - :ivar name: The name of the output dataset. - :vartype name: str - :ivar version: The version of the output dataset. - :vartype version: str - :ivar description: Description of the output dataset. - :vartype description: str - :ivar tags: Tag dictionary of the output dataset. - :vartype tags: dict[str, str] + :ivar type: Grammar format. Always ``grammar``. Required. GRAMMAR. + :vartype type: str or ~azure.ai.projects.models.GRAMMAR + :ivar syntax: The syntax of the grammar definition. One of ``lark`` or ``regex``. Required. + Known values are: "lark" and "regex". + :vartype syntax: str or ~azure.ai.projects.models.GrammarSyntax1 + :ivar definition: The grammar definition. Required. + :vartype definition: str """ - type: Literal[DataGenerationJobOutputType.DATASET] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Dataset output. Required. The generated data is a Dataset.""" - id: Optional[str] = rest_field(visibility=["read"]) - """The id of the output dataset created.""" - name: Optional[str] = rest_field(visibility=["read"]) - """The name of the output dataset.""" - version: Optional[str] = rest_field(visibility=["read"]) - """The version of the output dataset.""" - description: Optional[str] = rest_field(visibility=["read"]) - """Description of the output dataset.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read"]) - """Tag dictionary of the output dataset.""" + type: Literal[CustomToolParamFormatType.GRAMMAR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Grammar format. Always ``grammar``. Required. GRAMMAR.""" + syntax: Union[str, "_models.GrammarSyntax1"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The syntax of the grammar definition. One of ``lark`` or ``regex``. Required. Known values are: + \"lark\" and \"regex\".""" + definition: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The grammar definition. Required.""" @overload def __init__( self, + *, + syntax: Union[str, "_models.GrammarSyntax1"], + definition: str, ) -> None: ... @overload @@ -6028,45 +6332,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DataGenerationJobOutputType.DATASET # type: ignore + self.type = CustomToolParamFormatType.GRAMMAR # type: ignore -class DatasetEvaluatorGenerationJobSource( - EvaluatorGenerationJobSource, discriminator="dataset" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Dataset source for evaluator generation jobs — reference to a dataset. +class RoutineTrigger(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Base model for a routine trigger. - :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 Dataset. Required. Dataset source — - reference to a dataset. - :vartype type: str or ~azure.ai.projects.models.DATASET - :ivar name: The name of the dataset. Required. - :vartype name: str - :ivar version: The version of the dataset. If not specified, the latest version is used. - :vartype version: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + CustomRoutineTrigger, GitHubIssueRoutineTrigger, ScheduleRoutineTrigger, TimerRoutineTrigger + + :ivar type: The trigger type. Required. Known values are: "custom", "github_issue", "schedule", + and "timer". + :vartype type: str or ~azure.ai.projects.models.RoutineTriggerType """ - 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.DATASET] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The source type for this source, which is Dataset. Required. Dataset source — reference to a - dataset.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the dataset. Required.""" - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version of the dataset. If not specified, the latest version is used.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The trigger type. Required. Known values are: \"custom\", \"github_issue\", \"schedule\", and + \"timer\".""" @overload def __init__( self, *, - name: str, - description: Optional[str] = None, - version: Optional[str] = None, + type: str, ) -> None: ... @overload @@ -6078,29 +6367,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = EvaluatorGenerationJobSourceType.DATASET # type: ignore -class DatasetReference(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Reference to a versioned Foundry Dataset. +class CustomRoutineTrigger( + RoutineTrigger, discriminator="custom" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A custom event routine trigger. - :ivar name: Dataset name. Required. - :vartype name: str - :ivar version: Dataset version. Required. - :vartype version: str + :ivar type: The trigger type. Required. A custom event trigger. + :vartype type: str or ~azure.ai.projects.models.CUSTOM + :ivar provider: The external provider that emits the custom event. Required. + :vartype provider: str + :ivar event_name: The provider-specific event name that fires the routine. + :vartype event_name: str + :ivar parameters: Provider-specific trigger parameters. Required. + :vartype parameters: dict[str, any] """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Dataset name. Required.""" - version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Dataset version. Required.""" + type: Literal[RoutineTriggerType.CUSTOM] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The trigger type. Required. A custom event trigger.""" + provider: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The external provider that emits the custom event. Required.""" + event_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The provider-specific event name that fires the routine.""" + parameters: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Provider-specific trigger parameters. Required.""" @overload def __init__( self, *, - name: str, - version: str, + provider: str, + parameters: dict[str, Any], + event_name: Optional[str] = None, ) -> None: ... @overload @@ -6112,69 +6411,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RoutineTriggerType.CUSTOM # type: ignore -class DatasetVersion(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """DatasetVersion Definition. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - FileDatasetVersion, FolderDatasetVersion +class CustomTextFormatParam(CustomToolParamFormat, discriminator="text"): + """Text format. - :ivar data_uri: URI of the data (`example `_). - Required. - :vartype data_uri: str - :ivar type: Dataset type. Required. Known values are: "uri_file" and "uri_folder". - :vartype type: str or ~azure.ai.projects.models.DatasetType - :ivar is_reference: Indicates if the dataset holds a reference to the storage, or the dataset - manages storage itself. If true, the underlying data will not be deleted when the dataset - version is deleted. - :vartype is_reference: bool - :ivar connection_name: The Azure Storage Account connection name. Required if - startPendingUploadVersion was not called before creating the Dataset. - :vartype connection_name: str - :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: Unconstrained text format. Always ``text``. Required. TEXT. + :vartype type: str or ~azure.ai.projects.models.TEXT """ - __mapping__: dict[str, _Model] = {} - data_uri: str = rest_field(name="dataUri", visibility=["read", "create"]) - """URI of the data (`example `_). Required.""" - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Dataset type. Required. Known values are: \"uri_file\" and \"uri_folder\".""" - is_reference: Optional[bool] = rest_field(name="isReference", visibility=["read"]) - """Indicates if the dataset holds a reference to the storage, or the dataset manages storage - itself. If true, the underlying data will not be deleted when the dataset version is deleted.""" - connection_name: Optional[str] = rest_field(name="connectionName", visibility=["read", "create"]) - """The Azure Storage Account connection name. Required if startPendingUploadVersion was not called - before creating the Dataset.""" - 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=["create", "update"]) - """The asset description text.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["create", "update"]) - """Tag dictionary. Tags can be added, removed, and updated.""" + type: Literal[CustomToolParamFormatType.TEXT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Unconstrained text format. Always ``text``. Required. TEXT.""" @overload def __init__( self, - *, - data_uri: str, - type: str, - connection_name: Optional[str] = None, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -6186,35 +6438,51 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = CustomToolParamFormatType.TEXT # type: ignore -class DeleteAgentResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A deleted agent Object. +class CustomToolParam(Tool, discriminator="custom"): # pylint: disable=docstring-keyword-should-match-keyword-only + """Custom tool. - :ivar object: The object type. Always 'agent.deleted'. Required. AGENT_DELETED. - :vartype object: str or ~azure.ai.projects.models.AGENT_DELETED - :ivar name: The name of the agent. Required. + :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 deleted: Whether the agent was successfully deleted. Required. - :vartype deleted: 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] """ - object: Literal[AgentObjectType.AGENT_DELETED] = rest_field( + 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.""" + 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"] ) - """The object type. Always 'agent.deleted'. Required. AGENT_DELETED.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the agent. Required.""" - deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the agent was successfully deleted. Required.""" @overload def __init__( self, *, - object: Literal[AgentObjectType.AGENT_DELETED], name: str, - deleted: bool, + 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 @@ -6226,40 +6494,31 @@ 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 -class DeleteAgentVersionResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A deleted agent version Object. +class RecurrenceSchedule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Recurrence schedule model. - :ivar object: The object type. Always 'agent.version.deleted'. Required. AGENT_VERSION_DELETED. - :vartype object: str or ~azure.ai.projects.models.AGENT_VERSION_DELETED - :ivar name: The name of the agent. Required. - :vartype name: str - :ivar version: The version identifier of the agent. Required. - :vartype version: str - :ivar deleted: Whether the agent was successfully deleted. Required. - :vartype deleted: bool + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + DailyRecurrenceSchedule, HourlyRecurrenceSchedule, MonthlyRecurrenceSchedule, + WeeklyRecurrenceSchedule + + :ivar type: Recurrence type for the recurrence schedule. Required. Known values are: "Hourly", + "Daily", "Weekly", and "Monthly". + :vartype type: str or ~azure.ai.projects.models.RecurrenceType """ - object: Literal[AgentObjectType.AGENT_VERSION_DELETED] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The object type. Always 'agent.version.deleted'. Required. AGENT_VERSION_DELETED.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the agent. Required.""" - version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version identifier of the agent. Required.""" - deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the agent was successfully deleted. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Recurrence type for the recurrence schedule. Required. Known values are: \"Hourly\", \"Daily\", + \"Weekly\", and \"Monthly\".""" @overload def __init__( self, *, - object: Literal[AgentObjectType.AGENT_VERSION_DELETED], - name: str, - version: str, - deleted: bool, + type: str, ) -> None: ... @overload @@ -6273,33 +6532,27 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DeleteMemoryResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Response for deleting a memory item from a memory store. +class DailyRecurrenceSchedule( + RecurrenceSchedule, discriminator="Daily" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Daily recurrence schedule. - :ivar object: The object type. Always 'memory_store.item.deleted'. Required. MEMORY_DELETED. - :vartype object: str or ~azure.ai.projects.models.MEMORY_DELETED - :ivar memory_id: The unique ID of the deleted memory item. Required. - :vartype memory_id: str - :ivar deleted: Whether the memory item was successfully deleted. Required. - :vartype deleted: bool + :ivar type: Daily recurrence type. Required. Daily recurrence pattern. + :vartype type: str or ~azure.ai.projects.models.DAILY + :ivar hours: Hours for the recurrence schedule. Required. + :vartype hours: list[int] """ - object: Literal[MemoryStoreObjectType.MEMORY_DELETED] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The object type. Always 'memory_store.item.deleted'. Required. MEMORY_DELETED.""" - memory_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the deleted memory item. Required.""" - deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the memory item was successfully deleted. Required.""" + type: Literal[RecurrenceType.DAILY] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Daily recurrence type. Required. Daily recurrence pattern.""" + hours: list[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Hours for the recurrence schedule. Required.""" @overload def __init__( self, *, - object: Literal[MemoryStoreObjectType.MEMORY_DELETED], - memory_id: str, - deleted: bool, + hours: list[int], ) -> None: ... @overload @@ -6311,35 +6564,56 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RecurrenceType.DAILY # type: ignore -class DeleteMemoryStoreResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """DeleteMemoryStoreResult. +class DataGenerationJob(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Data Generation Job resource. - :ivar object: The object type. Always 'memory_store.deleted'. Required. MEMORY_STORE_DELETED. - :vartype object: str or ~azure.ai.projects.models.MEMORY_STORE_DELETED - :ivar name: The name of the memory store. Required. - :vartype name: str - :ivar deleted: Whether the memory store was successfully deleted. Required. - :vartype deleted: bool + :ivar id: Server-assigned unique identifier. Required. + :vartype id: str + :ivar inputs: Caller-supplied inputs. + :vartype inputs: ~azure.ai.projects.models.DataGenerationJobInputs + :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 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 """ - object: Literal[MemoryStoreObjectType.MEMORY_STORE_DELETED] = rest_field( + id: str = rest_field(visibility=["read"]) + """Server-assigned unique identifier. Required.""" + inputs: Optional["_models.DataGenerationJobInputs"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The object type. Always 'memory_store.deleted'. Required. MEMORY_STORE_DELETED.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the memory store. Required.""" - deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the memory store was successfully deleted. Required.""" + """Caller-supplied inputs.""" + result: Optional["_models.DataGenerationJobResult"] = rest_field(visibility=["read"]) + """Result produced on success.""" + status: Union[str, "_models.JobStatus"] = rest_field(visibility=["read"]) + """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", + \"succeeded\", \"failed\", and \"cancelled\".""" + error: Optional["_models.ApiError"] = rest_field(visibility=["read"]) + """Error details — populated only on failure.""" + created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The timestamp when the job was created, represented in Unix time (seconds since January 1, + 1970). Required.""" + finished_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") + """The timestamp when the job was finished, represented in Unix time (seconds since January 1, + 1970).""" @overload def __init__( self, *, - object: Literal[MemoryStoreObjectType.MEMORY_STORE_DELETED], - name: str, - deleted: bool, + inputs: Optional["_models.DataGenerationJobInputs"] = None, ) -> None: ... @overload @@ -6353,31 +6627,53 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DeleteSkillResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A deleted skill. +class DataGenerationJobInputs(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Caller-supplied inputs for a data generation job. - :ivar id: The unique identifier of the deleted skill. Required. - :vartype id: str - :ivar name: The unique name of the skill. Required. + :ivar name: The display name of the data generation job. Required. :vartype name: str - :ivar deleted: Whether the skill was successfully deleted. Required. - :vartype deleted: bool + :ivar sources: The sources used for the data generation job. Required. + :vartype sources: list[~azure.ai.projects.models.DataGenerationJobSource] + :ivar options: The options for the data generation job. Required. + :vartype options: ~azure.ai.projects.models.DataGenerationJobOptions + :ivar scenario: The scenario of the data generation job. Either for fine-tuning or evaluation. + Required. Known values are: "supervised_finetuning", "reinforcement_finetuning", and + "evaluation". + :vartype scenario: str or ~azure.ai.projects.models.DataGenerationJobScenario + :ivar output_options: Optional caller-supplied metadata for the job's output. See individual + fields for whether they apply to file outputs (fine-tuning scenarios), dataset outputs + (evaluation scenario), or both. + :vartype output_options: ~azure.ai.projects.models.DataGenerationJobOutputOptions """ - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the deleted skill. Required.""" name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique name of the skill. Required.""" - deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the skill was successfully deleted. Required.""" + """The display name of the data generation job. Required.""" + sources: list["_models.DataGenerationJobSource"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The sources used for the data generation job. Required.""" + options: "_models.DataGenerationJobOptions" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The options for the data generation job. Required.""" + scenario: Union[str, "_models.DataGenerationJobScenario"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The scenario of the data generation job. Either for fine-tuning or evaluation. Required. Known + values are: \"supervised_finetuning\", \"reinforcement_finetuning\", and \"evaluation\".""" + output_options: Optional["_models.DataGenerationJobOutputOptions"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional caller-supplied metadata for the job's output. See individual fields for whether they + apply to file outputs (fine-tuning scenarios), dataset outputs (evaluation scenario), or both.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin name: str, - deleted: bool, + sources: list["_models.DataGenerationJobSource"], + options: "_models.DataGenerationJobOptions", + scenario: Union[str, "_models.DataGenerationJobScenario"], + output_options: Optional["_models.DataGenerationJobOutputOptions"] = None, ) -> None: ... @overload @@ -6391,36 +6687,47 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DeleteSkillVersionResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A deleted skill version. +class DataGenerationJobOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Options for managing data generation jobs. - :ivar id: The unique identifier of the deleted skill version. Required. - :vartype id: str - :ivar name: The name of the skill. Required. - :vartype name: str - :ivar deleted: Whether the skill version was successfully deleted. Required. - :vartype deleted: bool - :ivar version: The version that was deleted. Required. - :vartype version: str - """ + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + SimpleQnADataGenerationJobOptions, SimulationSeedDataGenerationJobOptions, + ToolUseFineTuningDataGenerationJobOptions, TracesDataGenerationJobOptions - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the deleted skill version. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the skill. Required.""" - deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the skill version was successfully deleted. Required.""" - version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version that was deleted. Required.""" + :ivar type: The data generation job type. Required. Known values are: "simple_qna", "traces", + "tool_use", and "simulation_seed". + :vartype type: str or ~azure.ai.projects.models.DataGenerationJobType + :ivar max_samples: Maximum number of samples to generate. Required. + :vartype max_samples: int + :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 + """ - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - name: str, - deleted: bool, - version: str, + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The data generation job type. Required. Known values are: \"simple_qna\", \"traces\", + \"tool_use\", and \"simulation_seed\".""" + max_samples: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Maximum number of samples to generate. Required.""" + train_split: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """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.""" + model_options: Optional["_models.DataGenerationModelOptions"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The LLM model options.""" + + @overload + def __init__( + self, + *, + type: str, + max_samples: int, + train_split: Optional[float] = None, + model_options: Optional["_models.DataGenerationModelOptions"] = None, ) -> None: ... @overload @@ -6434,23 +6741,19 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Deployment(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Model Deployment Definition. +class DataGenerationJobOutput(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Output information for a data generation job. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ModelDeployment + DatasetDataGenerationJobOutput, FileDataGenerationJobOutput - :ivar type: The type of the deployment. Required. "ModelDeployment" - :vartype type: str or ~azure.ai.projects.models.DeploymentType - :ivar name: Name of the deployment. Required. - :vartype name: str + :ivar type: The type of the output. Required. Known values are: "file" and "dataset". + :vartype type: str or ~azure.ai.projects.models.DataGenerationJobOutputType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of the deployment. Required. \"ModelDeployment\"""" - name: str = rest_field(visibility=["read"]) - """Name of the deployment. Required.""" + """The type of the output. Required. Known values are: \"file\" and \"dataset\".""" @overload def __init__( @@ -6470,54 +6773,37 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Dimension(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A single dimension — one independent, measurable quality dimension within a rubric evaluator's - scoring blueprint. +class DataGenerationJobOutputOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Output options for data generation job. - :ivar id: Stable identifier for this dimension (snake_case, e.g., ``correct_resolution``). - Required. Provided by the user when manually creating a rubric evaluator or during - human-in-the-loop review of a generated set; the generation pipeline produces an initial value - the user can edit. Editable when saving new versions. Required. - :vartype id: str - :ivar description: What this dimension measures (e.g., 'Correctly identifies the user's - reservation intent and pursues the appropriate workflow'). Required. + :ivar name: Name to assign to the output. Used as the filename for Azure OpenAI file outputs + (fine-tuning scenarios) and as the dataset name for dataset outputs (evaluation scenario). + :vartype name: str + :ivar description: Description to assign to the output. Applies only to dataset outputs + (evaluation scenario); ignored for Azure OpenAI file outputs. :vartype description: str - :ivar weight: Relative weight of this dimension (1-10). The generation pipeline assigns exactly - one dimension weight 8-10; all others use 1-6. User edits are not constrained by this - heuristic. Required. - :vartype weight: int - :ivar always_applicable: When true, the LLM judge always scores this dimension regardless of - relevance (skips applicability assessment). The service-generated general quality/policy - dimension has this set to true and is non-editable. Users may set this on their own custom - dimensions. The service defaults to ``false`` if a value is not specified by the caller. - :vartype always_applicable: bool + :ivar tags: Tags to assign to the output. Applies only to dataset outputs (evaluation + scenario); ignored for Azure OpenAI file outputs. + :vartype tags: dict[str, str] """ - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Stable identifier for this dimension (snake_case, e.g., ``correct_resolution``). Required. - Provided by the user when manually creating a rubric evaluator or during human-in-the-loop - review of a generated set; the generation pipeline produces an initial value the user can edit. - Editable when saving new versions. Required.""" - description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """What this dimension measures (e.g., 'Correctly identifies the user's reservation intent and - pursues the appropriate workflow'). Required.""" - weight: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Relative weight of this dimension (1-10). The generation pipeline assigns exactly one dimension - weight 8-10; all others use 1-6. User edits are not constrained by this heuristic. Required.""" - always_applicable: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """When true, the LLM judge always scores this dimension regardless of relevance (skips - applicability assessment). The service-generated general quality/policy dimension has this set - to true and is non-editable. Users may set this on their own custom dimensions. The service - defaults to ``false`` if a value is not specified by the caller.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name to assign to the output. Used as the filename for Azure OpenAI file outputs (fine-tuning + scenarios) and as the dataset name for dataset outputs (evaluation scenario).""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Description to assign to the output. Applies only to dataset outputs (evaluation scenario); + ignored for Azure OpenAI file outputs.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Tags to assign to the output. Applies only to dataset outputs (evaluation scenario); ignored + for Azure OpenAI file outputs.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - description: str, - weight: int, - always_applicable: Optional[bool] = None, + name: Optional[str] = None, + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -6531,31 +6817,36 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DispatchRoutineResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Identifiers returned after a routine dispatch is queued. +class DataGenerationJobResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Result produced by a successful data generation job. - :ivar dispatch_id: The dispatch identifier created for the routine dispatch. - :vartype dispatch_id: str - :ivar action_correlation_id: A downstream action correlation identifier, when available. - :vartype action_correlation_id: str - :ivar task_id: A workspace task identifier created for the dispatch, when available. - :vartype task_id: str + :ivar outputs: The final job outputs: Azure OpenAI files for fine-tuning, or datasets for + evaluation. + :vartype outputs: list[~azure.ai.projects.models.DataGenerationJobOutput] + :ivar generated_samples: The number of samples actually generated. Required. + :vartype generated_samples: int + :ivar token_usage: The token usage information for the data generation job. + :vartype token_usage: ~azure.ai.projects.models.DataGenerationTokenUsage """ - dispatch_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The dispatch identifier created for the routine dispatch.""" - action_correlation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A downstream action correlation identifier, when available.""" - task_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A workspace task identifier created for the dispatch, when available.""" + outputs: Optional[list["_models.DataGenerationJobOutput"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The final job outputs: Azure OpenAI files for fine-tuning, or datasets for evaluation.""" + generated_samples: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of samples actually generated. Required.""" + token_usage: Optional["_models.DataGenerationTokenUsage"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The token usage information for the data generation job.""" @overload def __init__( self, *, - dispatch_id: Optional[str] = None, - action_correlation_id: Optional[str] = None, - task_id: Optional[str] = None, + generated_samples: int, + outputs: Optional[list["_models.DataGenerationJobOutput"]] = None, + token_usage: Optional["_models.DataGenerationTokenUsage"] = None, ) -> None: ... @overload @@ -6569,28 +6860,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EmbeddingConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Embedding configuration class. +class DataGenerationModelOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LLM model options for data generation jobs. - :ivar model_deployment_name: Deployment name of embedding model. It can point to a model - deployment either in the parent AIServices or a connection. Required. - :vartype model_deployment_name: str - :ivar embedding_field: Embedding field. Required. - :vartype embedding_field: str + :ivar model: Base model name used to generate data. Required. + :vartype model: str """ - model_deployment_name: str = rest_field(name="modelDeploymentName", visibility=["create"]) - """Deployment name of embedding model. It can point to a model deployment either in the parent - AIServices or a connection. Required.""" - embedding_field: str = rest_field(name="embeddingField", visibility=["create"]) - """Embedding field. Required.""" + model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Base model name used to generate data. Required.""" @overload def __init__( self, *, - model_deployment_name: str, - embedding_field: str, + model: str, ) -> None: ... @overload @@ -6604,81 +6888,42 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EmptyModelParam(_Model): - """EmptyModelParam.""" - - -class EndpointBasedEvaluatorDefinition( - EvaluatorDefinition, discriminator="endpoint" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Endpoint-based evaluator definition. The customer owns and hosts an HTTP endpoint that - implements the evaluation contract. The evaluator references a Project Connection by name; the - connection stores the endpoint URL and credentials (API Key or Entra ID). At execution time, - the service resolves the connection to obtain the endpoint URL and authentication details, then - calls the endpoint for each evaluation row. +class DataGenerationTokenUsage(_Model): + """Token usage information for a data generation job. - :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. Endpoint-based evaluator definition. References a customer-owned HTTP - endpoint via a Project Connection. - :vartype type: str or ~azure.ai.projects.models.ENDPOINT - :ivar connection_name: Name of the Project Connection that stores the endpoint URL and - credentials. The connection must exist on the project and have a non-empty target URL. - Supported auth types: ApiKey (sends ``api-key`` header) and AAD/Entra ID (acquires a bearer - token via the project's Managed Identity). Required. - :vartype connection_name: str + :ivar prompt_tokens: The number of prompt tokens used. Required. + :vartype prompt_tokens: int + :ivar completion_tokens: The number of completion tokens generated. Required. + :vartype completion_tokens: int + :ivar total_tokens: Total number of tokens used. Required. + :vartype total_tokens: int """ - type: Literal[EvaluatorDefinitionType.ENDPOINT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Endpoint-based evaluator definition. References a customer-owned HTTP endpoint via a - Project Connection.""" - connection_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name of the Project Connection that stores the endpoint URL and credentials. The connection - must exist on the project and have a non-empty target URL. Supported auth types: ApiKey (sends - ``api-key`` header) and AAD/Entra ID (acquires a bearer token via the project's Managed - Identity). Required.""" - - @overload - def __init__( - self, - *, - connection_name: str, - init_parameters: Optional[dict[str, Any]] = None, - data_schema: Optional[dict[str, Any]] = None, - metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = 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 = EvaluatorDefinitionType.ENDPOINT # type: ignore + prompt_tokens: int = rest_field(visibility=["read"]) + """The number of prompt tokens used. Required.""" + completion_tokens: int = rest_field(visibility=["read"]) + """The number of completion tokens generated. Required.""" + total_tokens: int = rest_field(visibility=["read"]) + """Total number of tokens used. Required.""" -class EntraAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="Entra"): - """EntraAuthorizationScheme. +class DatasetCredential(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents a reference to a blob for consumption. - :ivar type: Required. ENTRA. - :vartype type: str or ~azure.ai.projects.models.ENTRA + :ivar blob_reference: Credential info to access the storage account. Required. + :vartype blob_reference: ~azure.ai.projects.models.BlobReference """ - type: Literal[AgentEndpointAuthorizationSchemeType.ENTRA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. ENTRA.""" + blob_reference: "_models.BlobReference" = rest_field( + name="blobReference", visibility=["read", "create", "update", "delete", "query"] + ) + """Credential info to access the storage account. Required.""" @overload def __init__( self, + *, + blob_reference: "_models.BlobReference", ) -> None: ... @overload @@ -6690,18 +6935,37 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = AgentEndpointAuthorizationSchemeType.ENTRA # type: ignore -class EntraIDCredentials(BaseCredentials, discriminator="AAD"): - """Entra ID credential definition. +class DatasetDataGenerationJobOutput(DataGenerationJobOutput, discriminator="dataset"): + """Dataset output for a data generation job. - :ivar type: The credential type. Required. Entra ID credential (formerly known as AAD). - :vartype type: str or ~azure.ai.projects.models.ENTRA_ID + :ivar type: Dataset output. Required. The generated data is a Dataset. + :vartype type: str or ~azure.ai.projects.models.DATASET + :ivar id: The id of the output dataset created. + :vartype id: str + :ivar name: The name of the output dataset. + :vartype name: str + :ivar version: The version of the output dataset. + :vartype version: str + :ivar description: Description of the output dataset. + :vartype description: str + :ivar tags: Tag dictionary of the output dataset. + :vartype tags: dict[str, str] """ - type: Literal[CredentialType.ENTRA_ID] = rest_discriminator(name="type", visibility=["read"]) # type: ignore - """The credential type. Required. Entra ID credential (formerly known as AAD).""" + type: Literal[DataGenerationJobOutputType.DATASET] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Dataset output. Required. The generated data is a Dataset.""" + id: Optional[str] = rest_field(visibility=["read"]) + """The id of the output dataset created.""" + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the output dataset.""" + version: Optional[str] = rest_field(visibility=["read"]) + """The version of the output dataset.""" + description: Optional[str] = rest_field(visibility=["read"]) + """Description of the output dataset.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read"]) + """Tag dictionary of the output dataset.""" @overload def __init__( @@ -6717,39 +6981,45 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = CredentialType.ENTRA_ID # type: ignore + self.type = DataGenerationJobOutputType.DATASET # type: ignore -class EvalResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Result of the evaluation. +class DatasetEvaluatorGenerationJobSource( + EvaluatorGenerationJobSource, discriminator="dataset" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Dataset source for evaluator generation jobs — reference to a dataset. - :ivar name: name of the check. Required. + :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 Dataset. Required. Dataset source — + reference to a dataset. + :vartype type: str or ~azure.ai.projects.models.DATASET + :ivar name: The name of the dataset. Required. :vartype name: str - :ivar type: type of the check. Required. - :vartype type: str - :ivar score: score. Required. - :vartype score: float - :ivar passed: indicates if the check passed or failed. Required. - :vartype passed: bool + :ivar version: The version of the dataset. If not specified, the latest version is used. + :vartype version: 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.DATASET] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The source type for this source, which is Dataset. Required. Dataset source — reference to a + dataset.""" name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """name of the check. Required.""" - type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """type of the check. Required.""" - score: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """score. Required.""" - passed: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """indicates if the check passed or failed. Required.""" + """The name of the dataset. Required.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version of the dataset. If not specified, the latest version is used.""" @overload def __init__( self, *, name: str, - type: str, - score: float, - passed: bool, + description: Optional[str] = None, + version: Optional[str] = None, ) -> None: ... @overload @@ -6761,51 +7031,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = EvaluatorGenerationJobSourceType.DATASET # type: ignore -class EvalRunResultCompareItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Metric comparison for a treatment against the baseline. +class DatasetReference(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Reference to a versioned Foundry Dataset. - :ivar treatment_run_id: The treatment run ID. Required. - :vartype treatment_run_id: str - :ivar treatment_run_summary: Summary statistics of the treatment run. Required. - :vartype treatment_run_summary: ~azure.ai.projects.models.EvalRunResultSummary - :ivar delta_estimate: Estimated difference between treatment and baseline. Required. - :vartype delta_estimate: float - :ivar p_value: P-value for the treatment effect. Required. - :vartype p_value: float - :ivar treatment_effect: Type of treatment effect. Required. Known values are: "TooFewSamples", - "Inconclusive", "Changed", "Improved", and "Degraded". - :vartype treatment_effect: str or ~azure.ai.projects.models.TreatmentEffectType + :ivar name: Dataset name. Required. + :vartype name: str + :ivar version: Dataset version. Required. + :vartype version: str """ - treatment_run_id: str = rest_field( - name="treatmentRunId", visibility=["read", "create", "update", "delete", "query"] - ) - """The treatment run ID. Required.""" - treatment_run_summary: "_models.EvalRunResultSummary" = rest_field( - name="treatmentRunSummary", visibility=["read", "create", "update", "delete", "query"] - ) - """Summary statistics of the treatment run. Required.""" - delta_estimate: float = rest_field(name="deltaEstimate", visibility=["read", "create", "update", "delete", "query"]) - """Estimated difference between treatment and baseline. Required.""" - p_value: float = rest_field(name="pValue", visibility=["read", "create", "update", "delete", "query"]) - """P-value for the treatment effect. Required.""" - treatment_effect: Union[str, "_models.TreatmentEffectType"] = rest_field( - name="treatmentEffect", visibility=["read", "create", "update", "delete", "query"] - ) - """Type of treatment effect. Required. Known values are: \"TooFewSamples\", \"Inconclusive\", - \"Changed\", \"Improved\", and \"Degraded\".""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Dataset name. Required.""" + version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Dataset version. Required.""" @overload def __init__( self, *, - treatment_run_id: str, - treatment_run_summary: "_models.EvalRunResultSummary", - delta_estimate: float, - p_value: float, - treatment_effect: Union[str, "_models.TreatmentEffectType"], + name: str, + version: str, ) -> None: ... @overload @@ -6819,47 +7067,67 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvalRunResultComparison(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Comparison results for treatment runs against the baseline. +class DatasetVersion(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """DatasetVersion Definition. - :ivar testing_criteria: Name of the testing criteria. Required. - :vartype testing_criteria: str - :ivar metric: Metric being evaluated. Required. - :vartype metric: str - :ivar evaluator: Name of the evaluator for this testing criteria. Required. - :vartype evaluator: str - :ivar baseline_run_summary: Summary statistics of the baseline run. Required. - :vartype baseline_run_summary: ~azure.ai.projects.models.EvalRunResultSummary - :ivar compare_items: List of comparison results for each treatment run. Required. - :vartype compare_items: list[~azure.ai.projects.models.EvalRunResultCompareItem] + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + FileDatasetVersion, FolderDatasetVersion + + :ivar data_uri: URI of the data (`example `_). + Required. + :vartype data_uri: str + :ivar type: Dataset type. Required. Known values are: "uri_file" and "uri_folder". + :vartype type: str or ~azure.ai.projects.models.DatasetType + :ivar is_reference: Indicates if the dataset holds a reference to the storage, or the dataset + manages storage itself. If true, the underlying data will not be deleted when the dataset + version is deleted. + :vartype is_reference: bool + :ivar connection_name: The Azure Storage Account connection name. Required if + startPendingUploadVersion was not called before creating the Dataset. + :vartype connection_name: str + :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] """ - testing_criteria: str = rest_field( - name="testingCriteria", visibility=["read", "create", "update", "delete", "query"] - ) - """Name of the testing criteria. Required.""" - metric: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Metric being evaluated. Required.""" - evaluator: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name of the evaluator for this testing criteria. Required.""" - baseline_run_summary: "_models.EvalRunResultSummary" = rest_field( - name="baselineRunSummary", visibility=["read", "create", "update", "delete", "query"] - ) - """Summary statistics of the baseline run. Required.""" - compare_items: list["_models.EvalRunResultCompareItem"] = rest_field( - name="compareItems", visibility=["read", "create", "update", "delete", "query"] - ) - """List of comparison results for each treatment run. Required.""" + __mapping__: dict[str, _Model] = {} + data_uri: str = rest_field(name="dataUri", visibility=["read", "create"]) + """URI of the data (`example `_). Required.""" + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Dataset type. Required. Known values are: \"uri_file\" and \"uri_folder\".""" + is_reference: Optional[bool] = rest_field(name="isReference", visibility=["read"]) + """Indicates if the dataset holds a reference to the storage, or the dataset manages storage + itself. If true, the underlying data will not be deleted when the dataset version is deleted.""" + connection_name: Optional[str] = rest_field(name="connectionName", visibility=["read", "create"]) + """The Azure Storage Account connection name. Required if startPendingUploadVersion was not called + before creating the Dataset.""" + 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=["create", "update"]) + """The asset description text.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["create", "update"]) + """Tag dictionary. Tags can be added, removed, and updated.""" @overload def __init__( self, *, - testing_criteria: str, - metric: str, - evaluator: str, - baseline_run_summary: "_models.EvalRunResultSummary", - compare_items: list["_models.EvalRunResultCompareItem"], + data_uri: str, + type: str, + connection_name: Optional[str] = None, + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -6873,38 +7141,33 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvalRunResultSummary(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Summary statistics of a metric in an evaluation run. +class DeleteAgentResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A deleted agent Object. - :ivar run_id: The evaluation run ID. Required. - :vartype run_id: str - :ivar sample_count: Number of samples in the evaluation run. Required. - :vartype sample_count: int - :ivar average: Average value of the metric in the evaluation run. Required. - :vartype average: float - :ivar standard_deviation: Standard deviation of the metric in the evaluation run. Required. - :vartype standard_deviation: float + :ivar object: The object type. Always 'agent.deleted'. Required. AGENT_DELETED. + :vartype object: str or ~azure.ai.projects.models.AGENT_DELETED + :ivar name: The name of the agent. Required. + :vartype name: str + :ivar deleted: Whether the agent was successfully deleted. Required. + :vartype deleted: bool """ - run_id: str = rest_field(name="runId", visibility=["read", "create", "update", "delete", "query"]) - """The evaluation run ID. Required.""" - sample_count: int = rest_field(name="sampleCount", visibility=["read", "create", "update", "delete", "query"]) - """Number of samples in the evaluation run. Required.""" - average: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Average value of the metric in the evaluation run. Required.""" - standard_deviation: float = rest_field( - name="standardDeviation", visibility=["read", "create", "update", "delete", "query"] + object: Literal[AgentObjectType.AGENT_DELETED] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Standard deviation of the metric in the evaluation run. Required.""" + """The object type. Always 'agent.deleted'. Required. AGENT_DELETED.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the agent. Required.""" + deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the agent was successfully deleted. Required.""" @overload def __init__( self, *, - run_id: str, - sample_count: int, - average: float, - standard_deviation: float, + object: Literal[AgentObjectType.AGENT_DELETED], + name: str, + deleted: bool, ) -> None: ... @overload @@ -6918,39 +7181,38 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationComparisonInsightRequest( - InsightRequest, discriminator="EvaluationComparison" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Evaluation Comparison Request. +class DeleteAgentVersionResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A deleted agent version Object. - :ivar type: The type of request. Required. Evaluation Comparison. - :vartype type: str or ~azure.ai.projects.models.EVALUATION_COMPARISON - :ivar eval_id: Identifier for the evaluation. Required. - :vartype eval_id: str - :ivar baseline_run_id: The baseline run ID for comparison. Required. - :vartype baseline_run_id: str - :ivar treatment_run_ids: List of treatment run IDs for comparison. Required. - :vartype treatment_run_ids: list[str] + :ivar object: The object type. Always 'agent.version.deleted'. Required. AGENT_VERSION_DELETED. + :vartype object: str or ~azure.ai.projects.models.AGENT_VERSION_DELETED + :ivar name: The name of the agent. Required. + :vartype name: str + :ivar version: The version identifier of the agent. Required. + :vartype version: str + :ivar deleted: Whether the agent was successfully deleted. Required. + :vartype deleted: bool """ - type: Literal[InsightType.EVALUATION_COMPARISON] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of request. Required. Evaluation Comparison.""" - eval_id: str = rest_field(name="evalId", visibility=["read", "create", "update", "delete", "query"]) - """Identifier for the evaluation. Required.""" - baseline_run_id: str = rest_field(name="baselineRunId", visibility=["read", "create", "update", "delete", "query"]) - """The baseline run ID for comparison. Required.""" - treatment_run_ids: list[str] = rest_field( - name="treatmentRunIds", visibility=["read", "create", "update", "delete", "query"] + object: Literal[AgentObjectType.AGENT_VERSION_DELETED] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """List of treatment run IDs for comparison. Required.""" + """The object type. Always 'agent.version.deleted'. Required. AGENT_VERSION_DELETED.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the agent. Required.""" + version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version identifier of the agent. Required.""" + deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the agent was successfully deleted. Required.""" @overload def __init__( self, *, - eval_id: str, - baseline_run_id: str, - treatment_run_ids: list[str], + object: Literal[AgentObjectType.AGENT_VERSION_DELETED], + name: str, + version: str, + deleted: bool, ) -> None: ... @overload @@ -6962,37 +7224,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = InsightType.EVALUATION_COMPARISON # type: ignore -class EvaluationComparisonInsightResult( - InsightResult, discriminator="EvaluationComparison" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Insights from the evaluation comparison. +class DeleteMemoryResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Response for deleting a memory item from a memory store. - :ivar type: The type of insights result. Required. Evaluation Comparison. - :vartype type: str or ~azure.ai.projects.models.EVALUATION_COMPARISON - :ivar comparisons: Comparison results for each treatment run against the baseline. Required. - :vartype comparisons: list[~azure.ai.projects.models.EvalRunResultComparison] - :ivar method: The statistical method used for comparison. Required. - :vartype method: str + :ivar object: The object type. Always 'memory_store.item.deleted'. Required. MEMORY_DELETED. + :vartype object: str or ~azure.ai.projects.models.MEMORY_DELETED + :ivar memory_id: The unique ID of the deleted memory item. Required. + :vartype memory_id: str + :ivar deleted: Whether the memory item was successfully deleted. Required. + :vartype deleted: bool """ - type: Literal[InsightType.EVALUATION_COMPARISON] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of insights result. Required. Evaluation Comparison.""" - comparisons: list["_models.EvalRunResultComparison"] = rest_field( + object: Literal[MemoryStoreObjectType.MEMORY_DELETED] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Comparison results for each treatment run against the baseline. Required.""" - method: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The statistical method used for comparison. Required.""" + """The object type. Always 'memory_store.item.deleted'. Required. MEMORY_DELETED.""" + memory_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the deleted memory item. Required.""" + deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the memory item was successfully deleted. Required.""" @overload def __init__( self, *, - comparisons: list["_models.EvalRunResultComparison"], - method: str, + object: Literal[MemoryStoreObjectType.MEMORY_DELETED], + memory_id: str, + deleted: bool, ) -> None: ... @overload @@ -7004,45 +7264,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = InsightType.EVALUATION_COMPARISON # type: ignore -class InsightSample(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A sample from the analysis. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - EvaluationResultSample +class DeleteMemoryStoreResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """DeleteMemoryStoreResult. - :ivar id: The unique identifier for the analysis sample. Required. - :vartype id: str - :ivar type: Sample type. Required. "EvaluationResultSample" - :vartype type: str or ~azure.ai.projects.models.SampleType - :ivar features: Features to help with additional filtering of data in UX. Required. - :vartype features: dict[str, any] - :ivar correlation_info: Info about the correlation for the analysis sample. Required. - :vartype correlation_info: dict[str, any] + :ivar object: The object type. Always 'memory_store.deleted'. Required. MEMORY_STORE_DELETED. + :vartype object: str or ~azure.ai.projects.models.MEMORY_STORE_DELETED + :ivar name: The name of the memory store. Required. + :vartype name: str + :ivar deleted: Whether the memory store was successfully deleted. Required. + :vartype deleted: bool """ - __mapping__: dict[str, _Model] = {} - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier for the analysis sample. Required.""" - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Sample type. Required. \"EvaluationResultSample\"""" - features: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Features to help with additional filtering of data in UX. Required.""" - correlation_info: dict[str, Any] = rest_field( - name="correlationInfo", visibility=["read", "create", "update", "delete", "query"] + object: Literal[MemoryStoreObjectType.MEMORY_STORE_DELETED] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Info about the correlation for the analysis sample. Required.""" + """The object type. Always 'memory_store.deleted'. Required. MEMORY_STORE_DELETED.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the memory store. Required.""" + deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the memory store was successfully deleted. Required.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - type: str, - features: dict[str, Any], - correlation_info: dict[str, Any], + object: Literal[MemoryStoreObjectType.MEMORY_STORE_DELETED], + name: str, + deleted: bool, ) -> None: ... @overload @@ -7056,38 +7306,31 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationResultSample( - InsightSample, discriminator="EvaluationResultSample" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A sample from the evaluation result. +class DeleteSkillResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A deleted skill. - :ivar id: The unique identifier for the analysis sample. Required. + :ivar id: The unique identifier of the deleted skill. Required. :vartype id: str - :ivar features: Features to help with additional filtering of data in UX. Required. - :vartype features: dict[str, any] - :ivar correlation_info: Info about the correlation for the analysis sample. Required. - :vartype correlation_info: dict[str, any] - :ivar type: Evaluation Result Sample Type. Required. A sample from the evaluation result. - :vartype type: str or ~azure.ai.projects.models.EVALUATION_RESULT_SAMPLE - :ivar evaluation_result: Evaluation result for the analysis sample. Required. - :vartype evaluation_result: ~azure.ai.projects.models.EvalResult + :ivar name: The unique name of the skill. Required. + :vartype name: str + :ivar deleted: Whether the skill was successfully deleted. Required. + :vartype deleted: bool """ - type: Literal[SampleType.EVALUATION_RESULT_SAMPLE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Evaluation Result Sample Type. Required. A sample from the evaluation result.""" - evaluation_result: "_models.EvalResult" = rest_field( - name="evaluationResult", visibility=["read", "create", "update", "delete", "query"] - ) - """Evaluation result for the analysis sample. Required.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the deleted skill. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique name of the skill. Required.""" + deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the skill was successfully deleted. Required.""" @overload def __init__( self, *, id: str, # pylint: disable=redefined-builtin - features: dict[str, Any], - correlation_info: dict[str, Any], - evaluation_result: "_models.EvalResult", + name: str, + deleted: bool, ) -> None: ... @overload @@ -7099,65 +7342,38 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = SampleType.EVALUATION_RESULT_SAMPLE # type: ignore -class EvaluationRule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Evaluation rule model. +class DeleteSkillVersionResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A deleted skill version. - :ivar id: Unique identifier for the evaluation rule. Required. + :ivar id: The unique identifier of the deleted skill version. Required. :vartype id: str - :ivar display_name: Display Name for the evaluation rule. - :vartype display_name: str - :ivar description: Description for the evaluation rule. - :vartype description: str - :ivar action: Definition of the evaluation rule action. Required. - :vartype action: ~azure.ai.projects.models.EvaluationRuleAction - :ivar filter: Filter condition of the evaluation rule. - :vartype filter: ~azure.ai.projects.models.EvaluationRuleFilter - :ivar event_type: Event type that the evaluation rule applies to. Required. Known values are: - "responseCompleted" and "manual". - :vartype event_type: str or ~azure.ai.projects.models.EvaluationRuleEventType - :ivar enabled: Indicates whether the evaluation rule is enabled. Default is true. Required. - :vartype enabled: bool - :ivar system_data: System metadata for the evaluation rule. Required. - :vartype system_data: dict[str, str] + :ivar name: The name of the skill. Required. + :vartype name: str + :ivar deleted: Whether the skill version was successfully deleted. Required. + :vartype deleted: bool + :ivar version: The version that was deleted. Required. + :vartype version: str """ - id: str = rest_field(visibility=["read"]) - """Unique identifier for the evaluation rule. Required.""" - display_name: Optional[str] = rest_field( - name="displayName", visibility=["read", "create", "update", "delete", "query"] - ) - """Display Name for the evaluation rule.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Description for the evaluation rule.""" - action: "_models.EvaluationRuleAction" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Definition of the evaluation rule action. Required.""" - filter: Optional["_models.EvaluationRuleFilter"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Filter condition of the evaluation rule.""" - event_type: Union[str, "_models.EvaluationRuleEventType"] = rest_field( - name="eventType", visibility=["read", "create", "update", "delete", "query"] - ) - """Event type that the evaluation rule applies to. Required. Known values are: - \"responseCompleted\" and \"manual\".""" - enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Indicates whether the evaluation rule is enabled. Default is true. Required.""" - system_data: dict[str, str] = rest_field(name="systemData", visibility=["read"]) - """System metadata for the evaluation rule. Required.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the deleted skill version. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the skill. Required.""" + deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the skill version was successfully deleted. Required.""" + version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version that was deleted. Required.""" @overload def __init__( self, *, - action: "_models.EvaluationRuleAction", - event_type: Union[str, "_models.EvaluationRuleEventType"], - enabled: bool, - display_name: Optional[str] = None, - description: Optional[str] = None, - filter: Optional["_models.EvaluationRuleFilter"] = None, # pylint: disable=redefined-builtin + id: str, # pylint: disable=redefined-builtin + name: str, + deleted: bool, + version: str, ) -> None: ... @overload @@ -7171,21 +7387,29 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationRuleFilter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Evaluation filter model. +class Deployment(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Model Deployment Definition. - :ivar agent_name: Filter by agent name. Required. - :vartype agent_name: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ModelDeployment + + :ivar type: The type of the deployment. Required. "ModelDeployment" + :vartype type: str or ~azure.ai.projects.models.DeploymentType + :ivar name: Name of the deployment. Required. + :vartype name: str """ - agent_name: str = rest_field(name="agentName", visibility=["read", "create", "update", "delete", "query"]) - """Filter by agent name. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The type of the deployment. Required. \"ModelDeployment\"""" + name: str = rest_field(visibility=["read"]) + """Name of the deployment. Required.""" @overload def __init__( self, *, - agent_name: str, + type: str, ) -> None: ... @overload @@ -7199,39 +7423,54 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationRunClusterInsightRequest( - InsightRequest, discriminator="EvaluationRunClusterInsight" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Insights on set of Evaluation Results. +class Dimension(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A single dimension — one independent, measurable quality dimension within a rubric evaluator's + scoring blueprint. - :ivar type: The type of insights request. Required. Insights on an Evaluation run result. - :vartype type: str or ~azure.ai.projects.models.EVALUATION_RUN_CLUSTER_INSIGHT - :ivar eval_id: Evaluation Id for the insights. Required. - :vartype eval_id: str - :ivar run_ids: List of evaluation run IDs for the insights. Required. - :vartype run_ids: list[str] - :ivar model_configuration: Configuration of the model used in the insight generation. - :vartype model_configuration: ~azure.ai.projects.models.InsightModelConfiguration + :ivar id: Stable identifier for this dimension (snake_case, e.g., ``correct_resolution``). + Required. Provided by the user when manually creating a rubric evaluator or during + human-in-the-loop review of a generated set; the generation pipeline produces an initial value + the user can edit. Editable when saving new versions. Required. + :vartype id: str + :ivar description: What this dimension measures (e.g., 'Correctly identifies the user's + reservation intent and pursues the appropriate workflow'). Required. + :vartype description: str + :ivar weight: Relative weight of this dimension (1-10). The generation pipeline assigns exactly + one dimension weight 8-10; all others use 1-6. User edits are not constrained by this + heuristic. Required. + :vartype weight: int + :ivar always_applicable: When true, the LLM judge always scores this dimension regardless of + relevance (skips applicability assessment). The service-generated general quality/policy + dimension has this set to true and is non-editable. Users may set this on their own custom + dimensions. The service defaults to ``false`` if a value is not specified by the caller. + :vartype always_applicable: bool """ - type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of insights request. Required. Insights on an Evaluation run result.""" - eval_id: str = rest_field(name="evalId", visibility=["read", "create", "update", "delete", "query"]) - """Evaluation Id for the insights. Required.""" - run_ids: list[str] = rest_field(name="runIds", visibility=["read", "create", "update", "delete", "query"]) - """List of evaluation run IDs for the insights. Required.""" - model_configuration: Optional["_models.InsightModelConfiguration"] = rest_field( - name="modelConfiguration", visibility=["read", "create", "update", "delete", "query"] - ) - """Configuration of the model used in the insight generation.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Stable identifier for this dimension (snake_case, e.g., ``correct_resolution``). Required. + Provided by the user when manually creating a rubric evaluator or during human-in-the-loop + review of a generated set; the generation pipeline produces an initial value the user can edit. + Editable when saving new versions. Required.""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """What this dimension measures (e.g., 'Correctly identifies the user's reservation intent and + pursues the appropriate workflow'). Required.""" + weight: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Relative weight of this dimension (1-10). The generation pipeline assigns exactly one dimension + weight 8-10; all others use 1-6. User edits are not constrained by this heuristic. Required.""" + always_applicable: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """When true, the LLM judge always scores this dimension regardless of relevance (skips + applicability assessment). The service-generated general quality/policy dimension has this set + to true and is non-editable. Users may set this on their own custom dimensions. The service + defaults to ``false`` if a value is not specified by the caller.""" @overload def __init__( self, *, - eval_id: str, - run_ids: list[str], - model_configuration: Optional["_models.InsightModelConfiguration"] = None, + id: str, # pylint: disable=redefined-builtin + description: str, + weight: int, + always_applicable: Optional[bool] = None, ) -> None: ... @overload @@ -7243,32 +7482,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = InsightType.EVALUATION_RUN_CLUSTER_INSIGHT # type: ignore -class EvaluationRunClusterInsightResult( - InsightResult, discriminator="EvaluationRunClusterInsight" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Insights from the evaluation run cluster analysis. +class DispatchRoutineResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Identifiers returned after a routine dispatch is queued. - :ivar type: The type of insights result. Required. Insights on an Evaluation run result. - :vartype type: str or ~azure.ai.projects.models.EVALUATION_RUN_CLUSTER_INSIGHT - :ivar cluster_insight: Required. - :vartype cluster_insight: ~azure.ai.projects.models.ClusterInsightResult + :ivar dispatch_id: The dispatch identifier created for the routine dispatch. + :vartype dispatch_id: str + :ivar action_correlation_id: A downstream action correlation identifier, when available. + :vartype action_correlation_id: str + :ivar task_id: A workspace task identifier created for the dispatch, when available. + :vartype task_id: str """ - type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of insights result. Required. Insights on an Evaluation run result.""" - cluster_insight: "_models.ClusterInsightResult" = rest_field( - name="clusterInsight", visibility=["read", "create", "update", "delete", "query"] - ) - """Required.""" + dispatch_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The dispatch identifier created for the routine dispatch.""" + action_correlation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A downstream action correlation identifier, when available.""" + task_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A workspace task identifier created for the dispatch, when available.""" @overload def __init__( self, *, - cluster_insight: "_models.ClusterInsightResult", + dispatch_id: Optional[str] = None, + action_correlation_id: Optional[str] = None, + task_id: Optional[str] = None, ) -> None: ... @overload @@ -7280,33 +7520,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = InsightType.EVALUATION_RUN_CLUSTER_INSIGHT # type: ignore -class ScheduleTask(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Schedule task model. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - EvaluationScheduleTask, InsightScheduleTask +class EmbeddingConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Embedding configuration class. - :ivar type: Type of the task. Required. Known values are: "Evaluation" and "Insight". - :vartype type: str or ~azure.ai.projects.models.ScheduleTaskType - :ivar configuration: Configuration for the task. - :vartype configuration: dict[str, str] + :ivar model_deployment_name: Deployment name of embedding model. It can point to a model + deployment either in the parent AIServices or a connection. Required. + :vartype model_deployment_name: str + :ivar embedding_field: Embedding field. Required. + :vartype embedding_field: str """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Type of the task. Required. Known values are: \"Evaluation\" and \"Insight\".""" - configuration: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Configuration for the task.""" + model_deployment_name: str = rest_field(name="modelDeploymentName", visibility=["create"]) + """Deployment name of embedding model. It can point to a model deployment either in the parent + AIServices or a connection. Required.""" + embedding_field: str = rest_field(name="embeddingField", visibility=["create"]) + """Embedding field. Required.""" @overload def __init__( self, *, - type: str, - configuration: Optional[dict[str, str]] = None, + model_deployment_name: str, + embedding_field: str, ) -> None: ... @overload @@ -7320,35 +7557,54 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationScheduleTask( - ScheduleTask, discriminator="Evaluation" +class EmptyModelParam(_Model): + """EmptyModelParam.""" + + +class EndpointBasedEvaluatorDefinition( + EvaluatorDefinition, discriminator="endpoint" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Evaluation task for the schedule. + """Endpoint-based evaluator definition. The customer owns and hosts an HTTP endpoint that + implements the evaluation contract. The evaluator references a Project Connection by name; the + connection stores the endpoint URL and credentials (API Key or Entra ID). At execution time, + the service resolves the connection to obtain the endpoint URL and authentication details, then + calls the endpoint for each evaluation row. - :ivar configuration: Configuration for the task. - :vartype configuration: dict[str, str] - :ivar type: Required. Evaluation task. - :vartype type: str or ~azure.ai.projects.models.EVALUATION - :ivar eval_id: Identifier of the evaluation group. Required. - :vartype eval_id: str - :ivar eval_run: The evaluation run payload. Required. - :vartype eval_run: dict[str, any] + :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. Endpoint-based evaluator definition. References a customer-owned HTTP + endpoint via a Project Connection. + :vartype type: str or ~azure.ai.projects.models.ENDPOINT + :ivar connection_name: Name of the Project Connection that stores the endpoint URL and + credentials. The connection must exist on the project and have a non-empty target URL. + Supported auth types: ApiKey (sends ``api-key`` header) and AAD/Entra ID (acquires a bearer + token via the project's Managed Identity). Required. + :vartype connection_name: str """ - type: Literal[ScheduleTaskType.EVALUATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Evaluation task.""" - eval_id: str = rest_field(name="evalId", visibility=["read", "create", "update", "delete", "query"]) - """Identifier of the evaluation group. Required.""" - eval_run: dict[str, Any] = rest_field(name="evalRun", visibility=["read", "create", "update", "delete", "query"]) - """The evaluation run payload. Required.""" + type: Literal[EvaluatorDefinitionType.ENDPOINT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Endpoint-based evaluator definition. References a customer-owned HTTP endpoint via a + Project Connection.""" + connection_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the Project Connection that stores the endpoint URL and credentials. The connection + must exist on the project and have a non-empty target URL. Supported auth types: ApiKey (sends + ``api-key`` header) and AAD/Entra ID (acquires a bearer token via the project's Managed + Identity). Required.""" @overload def __init__( self, *, - eval_id: str, - eval_run: dict[str, Any], - configuration: Optional[dict[str, str]] = None, + connection_name: str, + init_parameters: Optional[dict[str, Any]] = None, + data_schema: Optional[dict[str, Any]] = None, + metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, ) -> None: ... @overload @@ -7360,60 +7616,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ScheduleTaskType.EVALUATION # type: ignore + self.type = EvaluatorDefinitionType.ENDPOINT # type: ignore -class EvaluationTaxonomy(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Evaluation Taxonomy Definition. +class EntraAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="Entra"): + """EntraAuthorizationScheme. - :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 taxonomy_input: Input configuration for the evaluation taxonomy. Required. - :vartype taxonomy_input: ~azure.ai.projects.models.EvaluationTaxonomyInput - :ivar taxonomy_categories: List of taxonomy categories. - :vartype taxonomy_categories: list[~azure.ai.projects.models.TaxonomyCategory] - :ivar properties: Additional properties for the evaluation taxonomy. - :vartype properties: dict[str, str] + :ivar type: Required. ENTRA. + :vartype type: str or ~azure.ai.projects.models.ENTRA """ - 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=["create", "update"]) - """The asset description text.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["create", "update"]) - """Tag dictionary. Tags can be added, removed, and updated.""" - taxonomy_input: "_models.EvaluationTaxonomyInput" = rest_field( - name="taxonomyInput", visibility=["read", "create", "update", "delete", "query"] - ) - """Input configuration for the evaluation taxonomy. Required.""" - taxonomy_categories: Optional[list["_models.TaxonomyCategory"]] = rest_field( - name="taxonomyCategories", visibility=["read", "create", "update", "delete", "query"] - ) - """List of taxonomy categories.""" - properties: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Additional properties for the evaluation taxonomy.""" + type: Literal[AgentEndpointAuthorizationSchemeType.ENTRA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. ENTRA.""" @overload def __init__( self, - *, - taxonomy_input: "_models.EvaluationTaxonomyInput", - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, - taxonomy_categories: Optional[list["_models.TaxonomyCategory"]] = None, - properties: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -7425,25 +7643,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = AgentEndpointAuthorizationSchemeType.ENTRA # type: ignore -class EvaluatorCredentialRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Request body for getting evaluator credentials. +class EntraIDCredentials(BaseCredentials, discriminator="AAD"): + """Entra ID credential definition. - :ivar blob_uri: The blob URI for the evaluator storage. Example: - ``https://account.blob.core.windows.net:443/container``. Required. - :vartype blob_uri: str + :ivar type: The credential type. Required. Entra ID credential (formerly known as AAD). + :vartype type: str or ~azure.ai.projects.models.ENTRA_ID """ - blob_uri: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The blob URI for the evaluator storage. Example: - ``https://account.blob.core.windows.net:443/container``. Required.""" + type: Literal[CredentialType.ENTRA_ID] = rest_discriminator(name="type", visibility=["read"]) # type: ignore + """The credential type. Required. Entra ID credential (formerly known as AAD).""" @overload def __init__( self, - *, - blob_uri: str, ) -> None: ... @overload @@ -7455,44 +7670,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = CredentialType.ENTRA_ID # type: ignore -class EvaluatorGenerationArtifacts(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Service-managed provenance artifacts produced by an evaluator generation job. Present only on - EvaluatorVersion resources created via the generation pipeline. The combined-JSONL Foundry - Dataset is read-only and resolves to a versioned dataset in a service-reserved namespace. - - :ivar dataset: Reference to the single Foundry Dataset (one combined JSONL file, - version-aligned to ``EvaluatorVersion.version``) holding all artifacts produced by the - generation pipeline. Each row in the JSONL carries a ``kind`` field discriminating its content - (e.g. ``spec``, ``tools``, ``context``). Required. - :vartype dataset: ~azure.ai.projects.models.DatasetReference - :ivar kinds: The kinds of rows present in ``dataset``. Always contains ``"spec"`` (the - generated evaluation specification, a Markdown document describing what the evaluator - measures). May additionally contain ``"tools"`` (when the generation pipeline produced or - inferred OpenAI tool schemas) and/or ``"context"`` (when supplementary materials such as file - uploads or trace samples were used during generation). Required. - :vartype kinds: list[str] +class EvalResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Result of the evaluation. + + :ivar name: name of the check. Required. + :vartype name: str + :ivar type: type of the check. Required. + :vartype type: str + :ivar score: score. Required. + :vartype score: float + :ivar passed: indicates if the check passed or failed. Required. + :vartype passed: bool """ - dataset: "_models.DatasetReference" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Reference to the single Foundry Dataset (one combined JSONL file, version-aligned to - ``EvaluatorVersion.version``) holding all artifacts produced by the generation pipeline. Each - row in the JSONL carries a ``kind`` field discriminating its content (e.g. ``spec``, ``tools``, - ``context``). Required.""" - kinds: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The kinds of rows present in ``dataset``. Always contains ``\"spec\"`` (the generated - evaluation specification, a Markdown document describing what the evaluator measures). May - additionally contain ``\"tools\"`` (when the generation pipeline produced or inferred OpenAI - tool schemas) and/or ``\"context\"`` (when supplementary materials such as file uploads or - trace samples were used during generation). Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """name of the check. Required.""" + type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """type of the check. Required.""" + score: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """score. Required.""" + passed: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """indicates if the check passed or failed. Required.""" @overload def __init__( self, *, - dataset: "_models.DatasetReference", - kinds: list[str], + name: str, + type: str, + score: float, + passed: bool, ) -> None: ... @overload @@ -7506,76 +7716,49 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorGenerationInputs(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Caller-supplied inputs for an evaluator generation job. +class EvalRunResultCompareItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Metric comparison for a treatment against the baseline. - :ivar sources: Source materials for generation — agent descriptions, prompts, traces, or - datasets. Each entry is an ``EvaluatorGenerationJobSource`` variant discriminated by ``type``. - Required. - :vartype sources: list[~azure.ai.projects.models.EvaluatorGenerationJobSource] - :ivar model: The LLM model to use for rubric generation (e.g., 'gpt-4o'). Required — users must - provide their own model rather than relying on service-owned capacity. Required. - :vartype model: str - :ivar evaluator_name: The evaluator name (immutable identifier). 1-256 characters; allowed - characters are ASCII letters, digits, underscore (``_``), period (``.``), tilde (``~``), and - hyphen (``-``). The prefix ``builtin.`` is reserved for system-managed evaluators and is - rejected by the service. If an evaluator with this name already exists in the project (and is - rubric-subtype), the service creates a new version under the same name and uses the prior - version's ``dimensions`` as context for incremental improvement (foundation of the post-//build - adaptive loop). Old versions remain queryable via ``get_version(name, version)``. If the - existing evaluator is not a rubric-subtype evaluator (built-in, prompt-based, code-based), the - request is rejected with ``400 Bad Request``. Required. - :vartype evaluator_name: str - :ivar evaluator_display_name: Optional human-friendly display name for the resulting evaluator. - Surfaced as ``EvaluatorVersion.display_name`` on the persisted evaluator. When omitted, the - service uses ``evaluator_name`` as the display name. The ``evaluator_`` prefix disambiguates - this from the immutable ``evaluator_name`` identifier. - :vartype evaluator_display_name: str - :ivar evaluator_description: Optional human-friendly description for the resulting evaluator. - Surfaced as ``EvaluatorVersion.description`` on the persisted evaluator. Typically collected - from the UI alongside ``evaluator_display_name``. The ``evaluator_`` prefix disambiguates this - from any other description fields on related models. - :vartype evaluator_description: str + :ivar treatment_run_id: The treatment run ID. Required. + :vartype treatment_run_id: str + :ivar treatment_run_summary: Summary statistics of the treatment run. Required. + :vartype treatment_run_summary: ~azure.ai.projects.models.EvalRunResultSummary + :ivar delta_estimate: Estimated difference between treatment and baseline. Required. + :vartype delta_estimate: float + :ivar p_value: P-value for the treatment effect. Required. + :vartype p_value: float + :ivar treatment_effect: Type of treatment effect. Required. Known values are: "TooFewSamples", + "Inconclusive", "Changed", "Improved", and "Degraded". + :vartype treatment_effect: str or ~azure.ai.projects.models.TreatmentEffectType """ - sources: list["_models.EvaluatorGenerationJobSource"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + treatment_run_id: str = rest_field( + name="treatmentRunId", visibility=["read", "create", "update", "delete", "query"] ) - """Source materials for generation — agent descriptions, prompts, traces, or datasets. Each entry - is an ``EvaluatorGenerationJobSource`` variant discriminated by ``type``. Required.""" - model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The LLM model to use for rubric generation (e.g., 'gpt-4o'). Required — users must provide - their own model rather than relying on service-owned capacity. Required.""" - evaluator_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The evaluator name (immutable identifier). 1-256 characters; allowed characters are ASCII - letters, digits, underscore (``_``), period (``.``), tilde (``~``), and hyphen (``-``). The - prefix ``builtin.`` is reserved for system-managed evaluators and is rejected by the service. - If an evaluator with this name already exists in the project (and is rubric-subtype), the - service creates a new version under the same name and uses the prior version's ``dimensions`` - as context for incremental improvement (foundation of the post-//build adaptive loop). Old - versions remain queryable via ``get_version(name, version)``. If the existing evaluator is not - a rubric-subtype evaluator (built-in, prompt-based, code-based), the request is rejected with - ``400 Bad Request``. Required.""" - evaluator_display_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional human-friendly display name for the resulting evaluator. Surfaced as - ``EvaluatorVersion.display_name`` on the persisted evaluator. When omitted, the service uses - ``evaluator_name`` as the display name. The ``evaluator_`` prefix disambiguates this from the - immutable ``evaluator_name`` identifier.""" - evaluator_description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional human-friendly description for the resulting evaluator. Surfaced as - ``EvaluatorVersion.description`` on the persisted evaluator. Typically collected from the UI - alongside ``evaluator_display_name``. The ``evaluator_`` prefix disambiguates this from any - other description fields on related models.""" + """The treatment run ID. Required.""" + treatment_run_summary: "_models.EvalRunResultSummary" = rest_field( + name="treatmentRunSummary", visibility=["read", "create", "update", "delete", "query"] + ) + """Summary statistics of the treatment run. Required.""" + delta_estimate: float = rest_field(name="deltaEstimate", visibility=["read", "create", "update", "delete", "query"]) + """Estimated difference between treatment and baseline. Required.""" + p_value: float = rest_field(name="pValue", visibility=["read", "create", "update", "delete", "query"]) + """P-value for the treatment effect. Required.""" + treatment_effect: Union[str, "_models.TreatmentEffectType"] = rest_field( + name="treatmentEffect", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of treatment effect. Required. Known values are: \"TooFewSamples\", \"Inconclusive\", + \"Changed\", \"Improved\", and \"Degraded\".""" @overload def __init__( self, *, - sources: list["_models.EvaluatorGenerationJobSource"], - model: str, - evaluator_name: str, - evaluator_display_name: Optional[str] = None, - evaluator_description: Optional[str] = None, + treatment_run_id: str, + treatment_run_summary: "_models.EvalRunResultSummary", + delta_estimate: float, + p_value: float, + treatment_effect: Union[str, "_models.TreatmentEffectType"], ) -> None: ... @overload @@ -7589,70 +7772,47 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorGenerationJob(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Evaluator Generation Job resource — a long-running job that generates rubric-based evaluator - definitions from source materials. On success, the result is the persisted EvaluatorVersion. +class EvalRunResultComparison(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Comparison results for treatment runs against the baseline. - :ivar id: Server-assigned unique identifier. Required. - :vartype id: str - :ivar inputs: Caller-supplied inputs. - :vartype inputs: ~azure.ai.projects.models.EvaluatorGenerationInputs - :ivar result: Result produced on success. - :vartype result: ~azure.ai.projects.models.EvaluatorVersion - :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 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 finished, represented in Unix time (seconds since - January 1, 1970). - :vartype finished_at: ~datetime.datetime - :ivar usage: Token consumption summary. Populated when the job reaches a terminal state. - :vartype usage: ~azure.ai.projects.models.EvaluatorGenerationTokenUsage - :ivar input_quality_warnings: Non-fatal input-quality advisories produced by the generation - pipeline. Read-only; service-generated; populated only on terminal jobs when advisories fired. - Omitted when generation was clean. Cleared when a subsequent ``PATCH`` to the paired - ``EvaluatorVersion.definition`` invalidates the advisories. - :vartype input_quality_warnings: - list[~azure.ai.projects.models.RubricGenerationInputQualityWarning] + :ivar testing_criteria: Name of the testing criteria. Required. + :vartype testing_criteria: str + :ivar metric: Metric being evaluated. Required. + :vartype metric: str + :ivar evaluator: Name of the evaluator for this testing criteria. Required. + :vartype evaluator: str + :ivar baseline_run_summary: Summary statistics of the baseline run. Required. + :vartype baseline_run_summary: ~azure.ai.projects.models.EvalRunResultSummary + :ivar compare_items: List of comparison results for each treatment run. Required. + :vartype compare_items: list[~azure.ai.projects.models.EvalRunResultCompareItem] """ - id: str = rest_field(visibility=["read"]) - """Server-assigned unique identifier. Required.""" - inputs: Optional["_models.EvaluatorGenerationInputs"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + testing_criteria: str = rest_field( + name="testingCriteria", visibility=["read", "create", "update", "delete", "query"] ) - """Caller-supplied inputs.""" - result: Optional["_models.EvaluatorVersion"] = rest_field(visibility=["read"]) - """Result produced on success.""" - status: Union[str, "_models.JobStatus"] = rest_field(visibility=["read"]) - """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", - \"succeeded\", \"failed\", and \"cancelled\".""" - error: Optional["_models.ApiError"] = rest_field(visibility=["read"]) - """Error details — populated only on failure.""" - created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") - """The timestamp when the job was created, represented in Unix time (seconds since January 1, - 1970). Required.""" - finished_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") - """The timestamp when the job finished, represented in Unix time (seconds since January 1, 1970).""" - usage: Optional["_models.EvaluatorGenerationTokenUsage"] = rest_field(visibility=["read"]) - """Token consumption summary. Populated when the job reaches a terminal state.""" - input_quality_warnings: Optional[list["_models.RubricGenerationInputQualityWarning"]] = rest_field( - visibility=["read"] + """Name of the testing criteria. Required.""" + metric: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Metric being evaluated. Required.""" + evaluator: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the evaluator for this testing criteria. Required.""" + baseline_run_summary: "_models.EvalRunResultSummary" = rest_field( + name="baselineRunSummary", visibility=["read", "create", "update", "delete", "query"] ) - """Non-fatal input-quality advisories produced by the generation pipeline. Read-only; - service-generated; populated only on terminal jobs when advisories fired. Omitted when - generation was clean. Cleared when a subsequent ``PATCH`` to the paired - ``EvaluatorVersion.definition`` invalidates the advisories.""" + """Summary statistics of the baseline run. Required.""" + compare_items: list["_models.EvalRunResultCompareItem"] = rest_field( + name="compareItems", visibility=["read", "create", "update", "delete", "query"] + ) + """List of comparison results for each treatment run. Required.""" @overload def __init__( self, *, - inputs: Optional["_models.EvaluatorGenerationInputs"] = None, + testing_criteria: str, + metric: str, + evaluator: str, + baseline_run_summary: "_models.EvalRunResultSummary", + compare_items: list["_models.EvalRunResultCompareItem"], ) -> None: ... @overload @@ -7666,91 +7826,38 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorGenerationTokenUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Token consumption summary for an evaluator generation job. Populated when the job reaches a - terminal state. +class EvalRunResultSummary(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Summary statistics of a metric in an evaluation run. - :ivar input_tokens: Number of input (prompt) tokens consumed. Required. - :vartype input_tokens: int - :ivar output_tokens: Number of output (completion) tokens generated. Required. - :vartype output_tokens: int - :ivar total_tokens: Total tokens consumed (input + output). Required. - :vartype total_tokens: int + :ivar run_id: The evaluation run ID. Required. + :vartype run_id: str + :ivar sample_count: Number of samples in the evaluation run. Required. + :vartype sample_count: int + :ivar average: Average value of the metric in the evaluation run. Required. + :vartype average: float + :ivar standard_deviation: Standard deviation of the metric in the evaluation run. Required. + :vartype standard_deviation: float """ - input_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of input (prompt) tokens consumed. Required.""" - output_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of output (completion) tokens generated. Required.""" - total_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Total tokens consumed (input + output). Required.""" - - @overload - def __init__( - self, - *, - input_tokens: int, - output_tokens: int, - total_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 EvaluatorMetric(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Evaluator Metric. - - :ivar type: Type of the metric. Known values are: "ordinal", "continuous", and "boolean". - :vartype type: str or ~azure.ai.projects.models.EvaluatorMetricType - :ivar desirable_direction: It indicates whether a higher value is better or a lower value is - better for this metric. Known values are: "increase", "decrease", and "neutral". - :vartype desirable_direction: str or ~azure.ai.projects.models.EvaluatorMetricDirection - :ivar min_value: Minimum value for the metric. - :vartype min_value: float - :ivar max_value: Maximum value for the metric. If not specified, it is assumed to be unbounded. - :vartype max_value: float - :ivar threshold: Default pass/fail threshold for this metric. - :vartype threshold: float - :ivar is_primary: Indicates if this metric is primary when there are multiple metrics. - :vartype is_primary: bool - """ - - type: Optional[Union[str, "_models.EvaluatorMetricType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Type of the metric. Known values are: \"ordinal\", \"continuous\", and \"boolean\".""" - desirable_direction: Optional[Union[str, "_models.EvaluatorMetricDirection"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + run_id: str = rest_field(name="runId", visibility=["read", "create", "update", "delete", "query"]) + """The evaluation run ID. Required.""" + sample_count: int = rest_field(name="sampleCount", visibility=["read", "create", "update", "delete", "query"]) + """Number of samples in the evaluation run. Required.""" + average: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Average value of the metric in the evaluation run. Required.""" + standard_deviation: float = rest_field( + name="standardDeviation", visibility=["read", "create", "update", "delete", "query"] ) - """It indicates whether a higher value is better or a lower value is better for this metric. Known - values are: \"increase\", \"decrease\", and \"neutral\".""" - min_value: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Minimum value for the metric.""" - max_value: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Maximum value for the metric. If not specified, it is assumed to be unbounded.""" - threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Default pass/fail threshold for this metric.""" - is_primary: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Indicates if this metric is primary when there are multiple metrics.""" + """Standard deviation of the metric in the evaluation run. Required.""" @overload def __init__( self, *, - type: Optional[Union[str, "_models.EvaluatorMetricType"]] = None, - desirable_direction: Optional[Union[str, "_models.EvaluatorMetricDirection"]] = None, - min_value: Optional[float] = None, - max_value: Optional[float] = None, - threshold: Optional[float] = None, - is_primary: Optional[bool] = None, + run_id: str, + sample_count: int, + average: float, + standard_deviation: float, ) -> None: ... @overload @@ -7764,122 +7871,39 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorVersion(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Evaluator Definition. +class EvaluationComparisonInsightRequest( + InsightRequest, discriminator="EvaluationComparison" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Evaluation Comparison Request. - :ivar display_name: Display Name for evaluator. It helps to find the evaluator easily in AI - Foundry. It does not need to be unique. - :vartype display_name: str - :ivar metadata: Metadata about the evaluator. - :vartype metadata: dict[str, str] - :ivar evaluator_type: The type of the evaluator. Required. Known values are: "builtin" and - "custom". - :vartype evaluator_type: str or ~azure.ai.projects.models.EvaluatorType - :ivar categories: The categories of the evaluator. Required. - :vartype categories: list[str or ~azure.ai.projects.models.EvaluatorCategory] - :ivar supported_evaluation_levels: Evaluation levels this evaluator supports (e.g., ``turn``, - ``conversation``). When omitted on create, the service defaults to ``["turn"]``. On update, - omitting this field leaves it unchanged; an empty list is rejected. Custom code-based - evaluators support only ``turn``; custom prompt-based evaluators support exactly one level - (``turn`` or ``conversation``). - :vartype supported_evaluation_levels: list[str or ~azure.ai.projects.models.EvaluationLevel] - :ivar definition: Definition of the evaluator. Required. - :vartype definition: ~azure.ai.projects.models.EvaluatorDefinition - :ivar generation_artifacts: Provenance artifacts from the generation pipeline. Read-only; - present only on evaluator versions created via an EvaluatorGenerationJob. Each artifact - resolves to a versioned Foundry Dataset. - :vartype generation_artifacts: ~azure.ai.projects.models.EvaluatorGenerationArtifacts - :ivar generation_job_id: Read-only provenance link back to the EvaluatorGenerationJob that - produced this version. Present only on evaluator versions created via the generation pipeline; - absent for manually-created versions and unaffected by subsequent ``PATCH`` calls. - :vartype generation_job_id: str - :ivar warnings: Categories of warnings surfaced on this generated evaluator version. Present - only on versions created via an EvaluatorGenerationJob when the paired job produced non-empty - warnings. Absent (treat as no warnings) when the version is not from generation, when the - paired job was clean, or when a subsequent ``PATCH`` to ``definition`` cleared the paired job's - advisories. Follow ``generation_job_id`` to fetch the detailed warning payloads. - :vartype warnings: list[str or ~azure.ai.projects.models.GenerationWarningType] - :ivar created_by: Creator of the evaluator. Required. - :vartype created_by: str - :ivar created_at: Creation date/time of the evaluator. Required. - :vartype created_at: ~datetime.datetime - :ivar modified_at: Last modified date/time of the evaluator. Required. - :vartype modified_at: ~datetime.datetime - :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: The type of request. Required. Evaluation Comparison. + :vartype type: str or ~azure.ai.projects.models.EVALUATION_COMPARISON + :ivar eval_id: Identifier for the evaluation. Required. + :vartype eval_id: str + :ivar baseline_run_id: The baseline run ID for comparison. Required. + :vartype baseline_run_id: str + :ivar treatment_run_ids: List of treatment run IDs for comparison. Required. + :vartype treatment_run_ids: list[str] """ - display_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not - need to be unique.""" - metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Metadata about the evaluator.""" - evaluator_type: Union[str, "_models.EvaluatorType"] = rest_field(visibility=["read", "create"]) - """The type of the evaluator. Required. Known values are: \"builtin\" and \"custom\".""" - categories: list[Union[str, "_models.EvaluatorCategory"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The categories of the evaluator. Required.""" - supported_evaluation_levels: Optional[list[Union[str, "_models.EvaluationLevel"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + type: Literal[InsightType.EVALUATION_COMPARISON] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of request. Required. Evaluation Comparison.""" + eval_id: str = rest_field(name="evalId", visibility=["read", "create", "update", "delete", "query"]) + """Identifier for the evaluation. Required.""" + baseline_run_id: str = rest_field(name="baselineRunId", visibility=["read", "create", "update", "delete", "query"]) + """The baseline run ID for comparison. Required.""" + treatment_run_ids: list[str] = rest_field( + name="treatmentRunIds", visibility=["read", "create", "update", "delete", "query"] ) - """Evaluation levels this evaluator supports (e.g., ``turn``, ``conversation``). When omitted on - create, the service defaults to ``[\"turn\"]``. On update, omitting this field leaves it - unchanged; an empty list is rejected. Custom code-based evaluators support only ``turn``; - custom prompt-based evaluators support exactly one level (``turn`` or ``conversation``).""" - definition: "_models.EvaluatorDefinition" = rest_field(visibility=["read", "create"]) - """Definition of the evaluator. Required.""" - generation_artifacts: Optional["_models.EvaluatorGenerationArtifacts"] = rest_field(visibility=["read"]) - """Provenance artifacts from the generation pipeline. Read-only; present only on evaluator - versions created via an EvaluatorGenerationJob. Each artifact resolves to a versioned Foundry - Dataset.""" - generation_job_id: Optional[str] = rest_field(visibility=["read"]) - """Read-only provenance link back to the EvaluatorGenerationJob that produced this version. - Present only on evaluator versions created via the generation pipeline; absent for - manually-created versions and unaffected by subsequent ``PATCH`` calls.""" - warnings: Optional[list[Union[str, "_models.GenerationWarningType"]]] = rest_field(visibility=["read"]) - """Categories of warnings surfaced on this generated evaluator version. Present only on versions - created via an EvaluatorGenerationJob when the paired job produced non-empty warnings. Absent - (treat as no warnings) when the version is not from generation, when the paired job was clean, - or when a subsequent ``PATCH`` to ``definition`` cleared the paired job's advisories. Follow - ``generation_job_id`` to fetch the detailed warning payloads.""" - created_by: str = rest_field(visibility=["read"]) - """Creator of the evaluator. Required.""" - created_at: datetime.datetime = rest_field(visibility=["read"], format="rfc3339") - """Creation date/time of the evaluator. Required.""" - modified_at: datetime.datetime = rest_field(visibility=["read"], format="rfc3339") - """Last modified date/time of the evaluator. Required.""" - 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=["create", "update"]) - """The asset description text.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["create", "update"]) - """Tag dictionary. Tags can be added, removed, and updated.""" + """List of treatment run IDs for comparison. Required.""" @overload def __init__( self, *, - evaluator_type: Union[str, "_models.EvaluatorType"], - categories: list[Union[str, "_models.EvaluatorCategory"]], - definition: "_models.EvaluatorDefinition", - display_name: Optional[str] = None, - metadata: Optional[dict[str, str]] = None, - supported_evaluation_levels: Optional[list[Union[str, "_models.EvaluationLevel"]]] = None, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, + eval_id: str, + baseline_run_id: str, + treatment_run_ids: list[str], ) -> None: ... @overload @@ -7891,44 +7915,37 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = InsightType.EVALUATION_COMPARISON # type: ignore -class ExternalAgentDefinition( - AgentDefinition, discriminator="external" +class EvaluationComparisonInsightResult( + InsightResult, discriminator="EvaluationComparison" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """The external agent definition. Represents a third-party agent hosted outside Foundry (for - example, on GCP or AWS). Registration is metadata-only: Foundry records the agent definition to - light up observability experiences (traces, evaluations) over customer-emitted OpenTelemetry - data. + """Insights from the evaluation comparison. - :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. - :vartype rai_config: ~azure.ai.projects.models.RaiConfig - :ivar kind: Required. EXTERNAL. - :vartype kind: str or ~azure.ai.projects.models.EXTERNAL - :ivar otel_agent_id: The OpenTelemetry agent identifier used to attribute customer-emitted - spans to this Foundry agent. Spans must include the attribute ``gen_ai.agent.id = - `` to appear under this registration. Defaults to the top-level agent name when - omitted. Provide an explicit value only for migration scenarios where the running external - agent already emits a stable id that differs from the Foundry agent name. The resolved value is - always echoed on read. - :vartype otel_agent_id: str + :ivar type: The type of insights result. Required. Evaluation Comparison. + :vartype type: str or ~azure.ai.projects.models.EVALUATION_COMPARISON + :ivar comparisons: Comparison results for each treatment run against the baseline. Required. + :vartype comparisons: list[~azure.ai.projects.models.EvalRunResultComparison] + :ivar method: The statistical method used for comparison. Required. + :vartype method: str """ - kind: Literal[AgentKind.EXTERNAL] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. EXTERNAL.""" - otel_agent_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The OpenTelemetry agent identifier used to attribute customer-emitted spans to this Foundry - agent. Spans must include the attribute ``gen_ai.agent.id = `` to appear under - this registration. Defaults to the top-level agent name when omitted. Provide an explicit value - only for migration scenarios where the running external agent already emits a stable id that - differs from the Foundry agent name. The resolved value is always echoed on read.""" + type: Literal[InsightType.EVALUATION_COMPARISON] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of insights result. Required. Evaluation Comparison.""" + comparisons: list["_models.EvalRunResultComparison"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Comparison results for each treatment run against the baseline. Required.""" + method: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The statistical method used for comparison. Required.""" @overload def __init__( self, *, - rai_config: Optional["_models.RaiConfig"] = None, - otel_agent_id: Optional[str] = None, + comparisons: list["_models.EvalRunResultComparison"], + method: str, ) -> None: ... @overload @@ -7940,28 +7957,45 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = AgentKind.EXTERNAL # type: ignore + self.type = InsightType.EVALUATION_COMPARISON # type: ignore -class FabricDataAgentToolParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The fabric data agent tool parameters. +class InsightSample(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A sample from the analysis. - :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] + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + EvaluationResultSample + + :ivar id: The unique identifier for the analysis sample. Required. + :vartype id: str + :ivar type: Sample type. Required. "EvaluationResultSample" + :vartype type: str or ~azure.ai.projects.models.SampleType + :ivar features: Features to help with additional filtering of data in UX. Required. + :vartype features: dict[str, any] + :ivar correlation_info: Info about the correlation for the analysis sample. Required. + :vartype correlation_info: dict[str, any] """ - project_connections: Optional[list["_models.ToolProjectConnection"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + __mapping__: dict[str, _Model] = {} + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier for the analysis sample. Required.""" + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Sample type. Required. \"EvaluationResultSample\"""" + features: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Features to help with additional filtering of data in UX. Required.""" + correlation_info: dict[str, Any] = rest_field( + name="correlationInfo", 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.""" + """Info about the correlation for the analysis sample. Required.""" @overload def __init__( self, *, - project_connections: Optional[list["_models.ToolProjectConnection"]] = None, + id: str, # pylint: disable=redefined-builtin + type: str, + features: dict[str, Any], + correlation_info: dict[str, Any], ) -> None: ... @overload @@ -7975,48 +8009,38 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class FabricIQPreviewTool( - Tool, discriminator="fabric_iq_preview" +class EvaluationResultSample( + InsightSample, discriminator="EvaluationResultSample" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """A FabricIQ server-side tool. + """A sample from the evaluation result. - :ivar type: The object type, which is always 'fabric_iq_preview'. Required. FABRIC_IQ_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.FABRIC_IQ_PREVIEW - :ivar project_connection_id: The ID of the FabricIQ project connection. Required. - :vartype project_connection_id: str - :ivar server_label: (Optional) The label of the FabricIQ MCP server to connect to. - :vartype server_label: str - :ivar server_url: (Optional) The URL of the FabricIQ MCP server. If not provided, the URL from - the project connection will be used. - :vartype server_url: str - :ivar require_approval: (Optional) Whether the agent requires approval before executing - actions. Default is always. Is either a MCPToolRequireApproval type or a str type. - :vartype require_approval: ~azure.ai.projects.models.MCPToolRequireApproval or str + :ivar id: The unique identifier for the analysis sample. Required. + :vartype id: str + :ivar features: Features to help with additional filtering of data in UX. Required. + :vartype features: dict[str, any] + :ivar correlation_info: Info about the correlation for the analysis sample. Required. + :vartype correlation_info: dict[str, any] + :ivar type: Evaluation Result Sample Type. Required. A sample from the evaluation result. + :vartype type: str or ~azure.ai.projects.models.EVALUATION_RESULT_SAMPLE + :ivar evaluation_result: Evaluation result for the analysis sample. Required. + :vartype evaluation_result: ~azure.ai.projects.models.EvalResult """ - type: Literal[ToolType.FABRIC_IQ_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'fabric_iq_preview'. Required. FABRIC_IQ_PREVIEW.""" - project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the FabricIQ project connection. Required.""" - server_label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """(Optional) The label of the FabricIQ MCP server to connect to.""" - server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """(Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project - connection will be used.""" - require_approval: Optional[Union["_models.MCPToolRequireApproval", str]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + type: Literal[SampleType.EVALUATION_RESULT_SAMPLE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Evaluation Result Sample Type. Required. A sample from the evaluation result.""" + evaluation_result: "_models.EvalResult" = rest_field( + name="evaluationResult", visibility=["read", "create", "update", "delete", "query"] ) - """(Optional) Whether the agent requires approval before executing actions. Default is always. Is - either a MCPToolRequireApproval type or a str type.""" + """Evaluation result for the analysis sample. Required.""" @overload def __init__( self, *, - project_connection_id: str, - server_label: Optional[str] = None, - server_url: Optional[str] = None, - require_approval: Optional[Union["_models.MCPToolRequireApproval", str]] = None, + id: str, # pylint: disable=redefined-builtin + features: dict[str, Any], + correlation_info: dict[str, Any], + evaluation_result: "_models.EvalResult", ) -> None: ... @overload @@ -8028,62 +8052,65 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.FABRIC_IQ_PREVIEW # type: ignore + self.type = SampleType.EVALUATION_RESULT_SAMPLE # type: ignore -class FabricIQPreviewToolboxTool( - ToolboxTool, discriminator="fabric_iq_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A FabricIQ tool stored in a toolbox. +class EvaluationRule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Evaluation rule model. - :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. + :ivar id: Unique identifier for the evaluation rule. Required. + :vartype id: str + :ivar display_name: Display Name for the evaluation rule. + :vartype display_name: str + :ivar description: Description for the evaluation rule. :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. FABRIC_IQ_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.FABRIC_IQ_PREVIEW - :ivar project_connection_id: The ID of the FabricIQ project connection. Required. - :vartype project_connection_id: str - :ivar server_label: (Optional) The label of the FabricIQ MCP server to connect to. - :vartype server_label: str - :ivar server_url: (Optional) The URL of the FabricIQ MCP server. If not provided, the URL from - the project connection will be used. - :vartype server_url: str - :ivar require_approval: (Optional) Whether the agent requires approval before executing - actions. Default is always. Is either a MCPToolRequireApproval type or a str type. - :vartype require_approval: ~azure.ai.projects.models.MCPToolRequireApproval or str + :ivar action: Definition of the evaluation rule action. Required. + :vartype action: ~azure.ai.projects.models.EvaluationRuleAction + :ivar filter: Filter condition of the evaluation rule. + :vartype filter: ~azure.ai.projects.models.EvaluationRuleFilter + :ivar event_type: Event type that the evaluation rule applies to. Required. Known values are: + "responseCompleted" and "manual". + :vartype event_type: str or ~azure.ai.projects.models.EvaluationRuleEventType + :ivar enabled: Indicates whether the evaluation rule is enabled. Default is true. Required. + :vartype enabled: bool + :ivar system_data: System metadata for the evaluation rule. Required. + :vartype system_data: dict[str, str] """ - type: Literal[ToolboxToolType.FABRIC_IQ_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. FABRIC_IQ_PREVIEW.""" - project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the FabricIQ project connection. Required.""" - server_label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """(Optional) The label of the FabricIQ MCP server to connect to.""" - server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """(Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project - connection will be used.""" - require_approval: Optional[Union["_models.MCPToolRequireApproval", str]] = rest_field( + id: str = rest_field(visibility=["read"]) + """Unique identifier for the evaluation rule. Required.""" + display_name: Optional[str] = rest_field( + name="displayName", visibility=["read", "create", "update", "delete", "query"] + ) + """Display Name for the evaluation rule.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Description for the evaluation rule.""" + action: "_models.EvaluationRuleAction" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Definition of the evaluation rule action. Required.""" + filter: Optional["_models.EvaluationRuleFilter"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """(Optional) Whether the agent requires approval before executing actions. Default is always. Is - either a MCPToolRequireApproval type or a str type.""" + """Filter condition of the evaluation rule.""" + event_type: Union[str, "_models.EvaluationRuleEventType"] = rest_field( + name="eventType", visibility=["read", "create", "update", "delete", "query"] + ) + """Event type that the evaluation rule applies to. Required. Known values are: + \"responseCompleted\" and \"manual\".""" + enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Indicates whether the evaluation rule is enabled. Default is true. Required.""" + system_data: dict[str, str] = rest_field(name="systemData", visibility=["read"]) + """System metadata for the evaluation rule. Required.""" @overload def __init__( self, *, - project_connection_id: str, - name: Optional[str] = None, + action: "_models.EvaluationRuleAction", + event_type: Union[str, "_models.EvaluationRuleEventType"], + enabled: bool, + display_name: Optional[str] = None, description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, - server_label: Optional[str] = None, - server_url: Optional[str] = None, - require_approval: Optional[Union["_models.MCPToolRequireApproval", str]] = None, + filter: Optional["_models.EvaluationRuleFilter"] = None, # pylint: disable=redefined-builtin ) -> None: ... @overload @@ -8095,49 +8122,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolboxToolType.FABRIC_IQ_PREVIEW # type: ignore -class FieldMapping(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Field mapping configuration class. +class EvaluationRuleFilter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Evaluation filter model. - :ivar content_fields: List of fields with text content. Required. - :vartype content_fields: list[str] - :ivar filepath_field: Path of file to be used as a source of text content. - :vartype filepath_field: str - :ivar title_field: Field containing the title of the document. - :vartype title_field: str - :ivar url_field: Field containing the url of the document. - :vartype url_field: str - :ivar vector_fields: List of fields with vector content. - :vartype vector_fields: list[str] - :ivar metadata_fields: List of fields with metadata content. - :vartype metadata_fields: list[str] + :ivar agent_name: Filter by agent name. Required. + :vartype agent_name: str """ - content_fields: list[str] = rest_field(name="contentFields", visibility=["create"]) - """List of fields with text content. Required.""" - filepath_field: Optional[str] = rest_field(name="filepathField", visibility=["create"]) - """Path of file to be used as a source of text content.""" - title_field: Optional[str] = rest_field(name="titleField", visibility=["create"]) - """Field containing the title of the document.""" - url_field: Optional[str] = rest_field(name="urlField", visibility=["create"]) - """Field containing the url of the document.""" - vector_fields: Optional[list[str]] = rest_field(name="vectorFields", visibility=["create"]) - """List of fields with vector content.""" - metadata_fields: Optional[list[str]] = rest_field(name="metadataFields", visibility=["create"]) - """List of fields with metadata content.""" + agent_name: str = rest_field(name="agentName", visibility=["read", "create", "update", "delete", "query"]) + """Filter by agent name. Required.""" @overload def __init__( self, *, - content_fields: list[str], - filepath_field: Optional[str] = None, - title_field: Optional[str] = None, - url_field: Optional[str] = None, - vector_fields: Optional[list[str]] = None, - metadata_fields: Optional[list[str]] = None, + agent_name: str, ) -> None: ... @overload @@ -8151,27 +8152,39 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class FileDataGenerationJobOutput(DataGenerationJobOutput, discriminator="file"): - """Azure OpenAI file output for a data generation job. +class EvaluationRunClusterInsightRequest( + InsightRequest, discriminator="EvaluationRunClusterInsight" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Insights on set of Evaluation Results. - :ivar type: Azure OpenAI file output. Required. The generated data is an Azure OpenAI File. - :vartype type: str or ~azure.ai.projects.models.FILE - :ivar id: The id of the output Azure OpenAI file. Required. - :vartype id: str - :ivar filename: The filename of the output Azure OpenAI file. Required. - :vartype filename: str + :ivar type: The type of insights request. Required. Insights on an Evaluation run result. + :vartype type: str or ~azure.ai.projects.models.EVALUATION_RUN_CLUSTER_INSIGHT + :ivar eval_id: Evaluation Id for the insights. Required. + :vartype eval_id: str + :ivar run_ids: List of evaluation run IDs for the insights. Required. + :vartype run_ids: list[str] + :ivar model_configuration: Configuration of the model used in the insight generation. + :vartype model_configuration: ~azure.ai.projects.models.InsightModelConfiguration """ - type: Literal[DataGenerationJobOutputType.FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Azure OpenAI file output. Required. The generated data is an Azure OpenAI File.""" - id: str = rest_field(visibility=["read"]) - """The id of the output Azure OpenAI file. Required.""" - filename: str = rest_field(visibility=["read"]) - """The filename of the output Azure OpenAI file. Required.""" + type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of insights request. Required. Insights on an Evaluation run result.""" + eval_id: str = rest_field(name="evalId", visibility=["read", "create", "update", "delete", "query"]) + """Evaluation Id for the insights. Required.""" + run_ids: list[str] = rest_field(name="runIds", visibility=["read", "create", "update", "delete", "query"]) + """List of evaluation run IDs for the insights. Required.""" + model_configuration: Optional["_models.InsightModelConfiguration"] = rest_field( + name="modelConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Configuration of the model used in the insight generation.""" @overload def __init__( self, + *, + eval_id: str, + run_ids: list[str], + model_configuration: Optional["_models.InsightModelConfiguration"] = None, ) -> None: ... @overload @@ -8183,36 +8196,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DataGenerationJobOutputType.FILE # type: ignore + self.type = InsightType.EVALUATION_RUN_CLUSTER_INSIGHT # type: ignore -class FileDataGenerationJobSource( - DataGenerationJobSource, discriminator="file" +class EvaluationRunClusterInsightResult( + InsightResult, discriminator="EvaluationRunClusterInsight" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """File source for data generation jobs — Azure OpenAI file input. + """Insights from the evaluation run cluster analysis. - :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 job, which is File. Required. File source — Azure OpenAI - file. - :vartype type: str or ~azure.ai.projects.models.FILE - :ivar id: Input Azure Open AI file id used for data generation. Required. - :vartype id: str + :ivar type: The type of insights result. Required. Insights on an Evaluation run result. + :vartype type: str or ~azure.ai.projects.models.EVALUATION_RUN_CLUSTER_INSIGHT + :ivar cluster_insight: Required. + :vartype cluster_insight: ~azure.ai.projects.models.ClusterInsightResult """ - type: Literal[DataGenerationJobSourceType.FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The source type for this job, which is File. Required. File source — Azure OpenAI file.""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Input Azure Open AI file id used for data generation. Required.""" + type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of insights result. Required. Insights on an Evaluation run result.""" + cluster_insight: "_models.ClusterInsightResult" = rest_field( + name="clusterInsight", visibility=["read", "create", "update", "delete", "query"] + ) + """Required.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - description: Optional[str] = None, + cluster_insight: "_models.ClusterInsightResult", ) -> None: ... @overload @@ -8224,49 +8233,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DataGenerationJobSourceType.FILE # type: ignore + self.type = InsightType.EVALUATION_RUN_CLUSTER_INSIGHT # type: ignore -class FileDatasetVersion( - DatasetVersion, discriminator="uri_file" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """FileDatasetVersion Definition. +class ScheduleTask(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Schedule task model. - :ivar data_uri: URI of the data (`example `_). - Required. - :vartype data_uri: str - :ivar is_reference: Indicates if the dataset holds a reference to the storage, or the dataset - manages storage itself. If true, the underlying data will not be deleted when the dataset - version is deleted. - :vartype is_reference: bool - :ivar connection_name: The Azure Storage Account connection name. Required if - startPendingUploadVersion was not called before creating the Dataset. - :vartype connection_name: str - :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: Dataset type. Required. URI file. - :vartype type: str or ~azure.ai.projects.models.URI_FILE + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + EvaluationScheduleTask, InsightScheduleTask + + :ivar type: Type of the task. Required. Known values are: "Evaluation" and "Insight". + :vartype type: str or ~azure.ai.projects.models.ScheduleTaskType + :ivar configuration: Configuration for the task. + :vartype configuration: dict[str, str] """ - type: Literal[DatasetType.URI_FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Dataset type. Required. URI file.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Type of the task. Required. Known values are: \"Evaluation\" and \"Insight\".""" + configuration: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Configuration for the task.""" @overload def __init__( self, *, - data_uri: str, - connection_name: Optional[str] = None, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, + type: str, + configuration: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -8278,66 +8271,37 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DatasetType.URI_FILE # type: ignore -class FileSearchTool(Tool, discriminator="file_search"): # pylint: disable=docstring-keyword-should-match-keyword-only - """File search. +class EvaluationScheduleTask( + ScheduleTask, discriminator="Evaluation" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Evaluation task for the schedule. - :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] + :ivar configuration: Configuration for the task. + :vartype configuration: dict[str, str] + :ivar type: Required. Evaluation task. + :vartype type: str or ~azure.ai.projects.models.EVALUATION + :ivar eval_id: Identifier of the evaluation group. Required. + :vartype eval_id: str + :ivar eval_run: The evaluation run payload. Required. + :vartype eval_run: dict[str, any] """ - 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.""" + type: Literal[ScheduleTaskType.EVALUATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Evaluation task.""" + eval_id: str = rest_field(name="evalId", visibility=["read", "create", "update", "delete", "query"]) + """Identifier of the evaluation group. Required.""" + eval_run: dict[str, Any] = rest_field(name="evalRun", visibility=["read", "create", "update", "delete", "query"]) + """The evaluation run payload. Required.""" @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, + eval_id: str, + eval_run: dict[str, Any], + configuration: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -8349,60 +8313,60 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.FILE_SEARCH # type: ignore + self.type = ScheduleTaskType.EVALUATION # type: ignore -class FileSearchToolboxTool( - ToolboxTool, discriminator="file_search" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A file search tool stored in a toolbox. +class EvaluationTaxonomy(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Evaluation Taxonomy Definition. - :ivar name: Optional user-defined name for this tool or configuration. + :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 description: Optional user-defined description for this tool or configuration. + :ivar version: The version of the resource. Required. + :vartype version: str + :ivar description: The asset description text. :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. FILE_SEARCH. - :vartype type: str or ~azure.ai.projects.models.FILE_SEARCH - :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 vector_store_ids: The IDs of the vector stores to search. - :vartype vector_store_ids: list[str] + :ivar tags: Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar taxonomy_input: Input configuration for the evaluation taxonomy. Required. + :vartype taxonomy_input: ~azure.ai.projects.models.EvaluationTaxonomyInput + :ivar taxonomy_categories: List of taxonomy categories. + :vartype taxonomy_categories: list[~azure.ai.projects.models.TaxonomyCategory] + :ivar properties: Additional properties for the evaluation taxonomy. + :vartype properties: dict[str, str] """ - type: Literal[ToolboxToolType.FILE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. FILE_SEARCH.""" - 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"] + 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=["create", "update"]) + """The asset description text.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["create", "update"]) + """Tag dictionary. Tags can be added, removed, and updated.""" + taxonomy_input: "_models.EvaluationTaxonomyInput" = rest_field( + name="taxonomyInput", 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.""" - vector_store_ids: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The IDs of the vector stores to search.""" + """Input configuration for the evaluation taxonomy. Required.""" + taxonomy_categories: Optional[list["_models.TaxonomyCategory"]] = rest_field( + name="taxonomyCategories", visibility=["read", "create", "update", "delete", "query"] + ) + """List of taxonomy categories.""" + properties: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Additional properties for the evaluation taxonomy.""" @overload def __init__( self, *, - name: Optional[str] = None, + taxonomy_input: "_models.EvaluationTaxonomyInput", description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, - max_num_results: Optional[int] = None, - ranking_options: Optional["_models.RankingOptions"] = None, - filters: Optional["_unions.Filters"] = None, - vector_store_ids: Optional[list[str]] = None, + tags: Optional[dict[str, str]] = None, + taxonomy_categories: Optional[list["_models.TaxonomyCategory"]] = None, + properties: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -8414,33 +8378,25 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolboxToolType.FILE_SEARCH # type: ignore -class VersionSelectionRule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """VersionSelectionRule. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - FixedRatioVersionSelectionRule +class EvaluatorCredentialRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Request body for getting evaluator credentials. - :ivar type: Required. "FixedRatio" - :vartype type: str or ~azure.ai.projects.models.VersionSelectorType - :ivar agent_version: The agent version to route traffic to. Required. - :vartype agent_version: str + :ivar blob_uri: The blob URI for the evaluator storage. Example: + ``https://account.blob.core.windows.net:443/container``. Required. + :vartype blob_uri: str """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. \"FixedRatio\"""" - agent_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The agent version to route traffic to. Required.""" + blob_uri: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The blob URI for the evaluator storage. Example: + ``https://account.blob.core.windows.net:443/container``. Required.""" @overload def __init__( self, *, - type: str, - agent_version: str, + blob_uri: str, ) -> None: ... @overload @@ -8454,31 +8410,42 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class FixedRatioVersionSelectionRule( - VersionSelectionRule, discriminator="FixedRatio" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """FixedRatioVersionSelectionRule. +class EvaluatorGenerationArtifacts(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Service-managed provenance artifacts produced by an evaluator generation job. Present only on + EvaluatorVersion resources created via the generation pipeline. The combined-JSONL Foundry + Dataset is read-only and resolves to a versioned dataset in a service-reserved namespace. - :ivar agent_version: The agent version to route traffic to. Required. - :vartype agent_version: str - :ivar type: Required. FIXED_RATIO. - :vartype type: str or ~azure.ai.projects.models.FIXED_RATIO - :ivar traffic_percentage: The percentage of traffic to route to the version. Must be between 0 - and 100. Required. - :vartype traffic_percentage: int + :ivar dataset: Reference to the single Foundry Dataset (one combined JSONL file, + version-aligned to ``EvaluatorVersion.version``) holding all artifacts produced by the + generation pipeline. Each row in the JSONL carries a ``kind`` field discriminating its content + (e.g. ``spec``, ``tools``, ``context``). Required. + :vartype dataset: ~azure.ai.projects.models.DatasetReference + :ivar kinds: The kinds of rows present in ``dataset``. Always contains ``"spec"`` (the + generated evaluation specification, a Markdown document describing what the evaluator + measures). May additionally contain ``"tools"`` (when the generation pipeline produced or + inferred OpenAI tool schemas) and/or ``"context"`` (when supplementary materials such as file + uploads or trace samples were used during generation). Required. + :vartype kinds: list[str] """ - type: Literal[VersionSelectorType.FIXED_RATIO] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. FIXED_RATIO.""" - traffic_percentage: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The percentage of traffic to route to the version. Must be between 0 and 100. Required.""" + dataset: "_models.DatasetReference" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Reference to the single Foundry Dataset (one combined JSONL file, version-aligned to + ``EvaluatorVersion.version``) holding all artifacts produced by the generation pipeline. Each + row in the JSONL carries a ``kind`` field discriminating its content (e.g. ``spec``, ``tools``, + ``context``). Required.""" + kinds: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The kinds of rows present in ``dataset``. Always contains ``\"spec\"`` (the generated + evaluation specification, a Markdown document describing what the evaluator measures). May + additionally contain ``\"tools\"`` (when the generation pipeline produced or inferred OpenAI + tool schemas) and/or ``\"context\"`` (when supplementary materials such as file uploads or + trace samples were used during generation). Required.""" @overload def __init__( self, *, - agent_version: str, - traffic_percentage: int, + dataset: "_models.DatasetReference", + kinds: list[str], ) -> None: ... @overload @@ -8490,49 +8457,78 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = VersionSelectorType.FIXED_RATIO # type: ignore -class FolderDatasetVersion( - DatasetVersion, discriminator="uri_folder" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """FileDatasetVersion Definition. +class EvaluatorGenerationInputs(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Caller-supplied inputs for an evaluator generation job. - :ivar data_uri: URI of the data (`example `_). + :ivar sources: Source materials for generation — agent descriptions, prompts, traces, or + datasets. Each entry is an ``EvaluatorGenerationJobSource`` variant discriminated by ``type``. Required. - :vartype data_uri: str - :ivar is_reference: Indicates if the dataset holds a reference to the storage, or the dataset - manages storage itself. If true, the underlying data will not be deleted when the dataset - version is deleted. - :vartype is_reference: bool - :ivar connection_name: The Azure Storage Account connection name. Required if - startPendingUploadVersion was not called before creating the Dataset. - :vartype connection_name: str - :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: Dataset type. Required. URI folder. - :vartype type: str or ~azure.ai.projects.models.URI_FOLDER + :vartype sources: list[~azure.ai.projects.models.EvaluatorGenerationJobSource] + :ivar model: The LLM model to use for rubric generation (e.g., 'gpt-4o'). Required — users must + provide their own model rather than relying on service-owned capacity. Required. + :vartype model: str + :ivar evaluator_name: The evaluator name (immutable identifier). 1-256 characters; allowed + characters are ASCII letters, digits, underscore (``_``), period (``.``), tilde (``~``), and + hyphen (``-``). The prefix ``builtin.`` is reserved for system-managed evaluators and is + rejected by the service. If an evaluator with this name already exists in the project (and is + rubric-subtype), the service creates a new version under the same name and uses the prior + version's ``dimensions`` as context for incremental improvement (foundation of the post-//build + adaptive loop). Old versions remain queryable via ``get_version(name, version)``. If the + existing evaluator is not a rubric-subtype evaluator (built-in, prompt-based, code-based), the + request is rejected with ``400 Bad Request``. Required. + :vartype evaluator_name: str + :ivar evaluator_display_name: Optional human-friendly display name for the resulting evaluator. + Surfaced as ``EvaluatorVersion.display_name`` on the persisted evaluator. When omitted, the + service uses ``evaluator_name`` as the display name. The ``evaluator_`` prefix disambiguates + this from the immutable ``evaluator_name`` identifier. + :vartype evaluator_display_name: str + :ivar evaluator_description: Optional human-friendly description for the resulting evaluator. + Surfaced as ``EvaluatorVersion.description`` on the persisted evaluator. Typically collected + from the UI alongside ``evaluator_display_name``. The ``evaluator_`` prefix disambiguates this + from any other description fields on related models. + :vartype evaluator_description: str """ - type: Literal[DatasetType.URI_FOLDER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Dataset type. Required. URI folder.""" + sources: list["_models.EvaluatorGenerationJobSource"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Source materials for generation — agent descriptions, prompts, traces, or datasets. Each entry + is an ``EvaluatorGenerationJobSource`` variant discriminated by ``type``. Required.""" + model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The LLM model to use for rubric generation (e.g., 'gpt-4o'). Required — users must provide + their own model rather than relying on service-owned capacity. Required.""" + evaluator_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The evaluator name (immutable identifier). 1-256 characters; allowed characters are ASCII + letters, digits, underscore (``_``), period (``.``), tilde (``~``), and hyphen (``-``). The + prefix ``builtin.`` is reserved for system-managed evaluators and is rejected by the service. + If an evaluator with this name already exists in the project (and is rubric-subtype), the + service creates a new version under the same name and uses the prior version's ``dimensions`` + as context for incremental improvement (foundation of the post-//build adaptive loop). Old + versions remain queryable via ``get_version(name, version)``. If the existing evaluator is not + a rubric-subtype evaluator (built-in, prompt-based, code-based), the request is rejected with + ``400 Bad Request``. Required.""" + evaluator_display_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional human-friendly display name for the resulting evaluator. Surfaced as + ``EvaluatorVersion.display_name`` on the persisted evaluator. When omitted, the service uses + ``evaluator_name`` as the display name. The ``evaluator_`` prefix disambiguates this from the + immutable ``evaluator_name`` identifier.""" + evaluator_description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional human-friendly description for the resulting evaluator. Surfaced as + ``EvaluatorVersion.description`` on the persisted evaluator. Typically collected from the UI + alongside ``evaluator_display_name``. The ``evaluator_`` prefix disambiguates this from any + other description fields on related models.""" @overload def __init__( self, *, - data_uri: str, - connection_name: Optional[str] = None, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, + sources: list["_models.EvaluatorGenerationJobSource"], + model: str, + evaluator_name: str, + evaluator_display_name: Optional[str] = None, + evaluator_description: Optional[str] = None, ) -> None: ... @overload @@ -8544,32 +8540,72 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DatasetType.URI_FOLDER # type: ignore -class FoundryModelWarning(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A warning associated with a model. +class EvaluatorGenerationJob(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Evaluator Generation Job resource — a long-running job that generates rubric-based evaluator + definitions from source materials. On success, the result is the persisted EvaluatorVersion. - :ivar code: The warning code. Known values are: "RuntimeDependentArtifact" and - "UnclassifiedArtifact". - :vartype code: str or ~azure.ai.projects.models.FoundryModelWarningCode - :ivar message: The warning message. - :vartype message: str + :ivar id: Server-assigned unique identifier. Required. + :vartype id: str + :ivar inputs: Caller-supplied inputs. + :vartype inputs: ~azure.ai.projects.models.EvaluatorGenerationInputs + :ivar result: Result produced on success. + :vartype result: ~azure.ai.projects.models.EvaluatorVersion + :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 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 finished, represented in Unix time (seconds since + January 1, 1970). + :vartype finished_at: ~datetime.datetime + :ivar usage: Token consumption summary. Populated when the job reaches a terminal state. + :vartype usage: ~azure.ai.projects.models.EvaluatorGenerationTokenUsage + :ivar input_quality_warnings: Non-fatal input-quality advisories produced by the generation + pipeline. Read-only; service-generated; populated only on terminal jobs when advisories fired. + Omitted when generation was clean. Cleared when a subsequent ``PATCH`` to the paired + ``EvaluatorVersion.definition`` invalidates the advisories. + :vartype input_quality_warnings: + list[~azure.ai.projects.models.RubricGenerationInputQualityWarning] """ - code: Optional[Union[str, "_models.FoundryModelWarningCode"]] = rest_field( + id: str = rest_field(visibility=["read"]) + """Server-assigned unique identifier. Required.""" + inputs: Optional["_models.EvaluatorGenerationInputs"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The warning code. Known values are: \"RuntimeDependentArtifact\" and \"UnclassifiedArtifact\".""" - message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The warning message.""" + """Caller-supplied inputs.""" + result: Optional["_models.EvaluatorVersion"] = rest_field(visibility=["read"]) + """Result produced on success.""" + status: Union[str, "_models.JobStatus"] = rest_field(visibility=["read"]) + """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", + \"succeeded\", \"failed\", and \"cancelled\".""" + error: Optional["_models.ApiError"] = rest_field(visibility=["read"]) + """Error details — populated only on failure.""" + created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The timestamp when the job was created, represented in Unix time (seconds since January 1, + 1970). Required.""" + finished_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") + """The timestamp when the job finished, represented in Unix time (seconds since January 1, 1970).""" + usage: Optional["_models.EvaluatorGenerationTokenUsage"] = rest_field(visibility=["read"]) + """Token consumption summary. Populated when the job reaches a terminal state.""" + input_quality_warnings: Optional[list["_models.RubricGenerationInputQualityWarning"]] = rest_field( + visibility=["read"] + ) + """Non-fatal input-quality advisories produced by the generation pipeline. Read-only; + service-generated; populated only on terminal jobs when advisories fired. Omitted when + generation was clean. Cleared when a subsequent ``PATCH`` to the paired + ``EvaluatorVersion.definition`` invalidates the advisories.""" @overload def __init__( self, *, - code: Optional[Union[str, "_models.FoundryModelWarningCode"]] = None, - message: Optional[str] = None, + inputs: Optional["_models.EvaluatorGenerationInputs"] = None, ) -> None: ... @overload @@ -8583,53 +8619,32 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class FunctionShellToolParam( - Tool, discriminator="shell" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Shell tool. +class EvaluatorGenerationTokenUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Token consumption summary for an evaluator generation job. Populated when the job reaches a + terminal state. - :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] + :ivar input_tokens: Number of input (prompt) tokens consumed. Required. + :vartype input_tokens: int + :ivar output_tokens: Number of output (completion) tokens generated. Required. + :vartype output_tokens: int + :ivar total_tokens: Total tokens consumed (input + output). Required. + :vartype total_tokens: int """ - 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.""" + input_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Number of input (prompt) tokens consumed. Required.""" + output_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Number of output (completion) tokens generated. Required.""" + total_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Total tokens consumed (input + output). Required.""" @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, + input_tokens: int, + output_tokens: int, + total_tokens: int, ) -> None: ... @overload @@ -8641,31 +8656,54 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: 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 - """FunctionShellToolParamEnvironmentContainerReferenceParam. +class EvaluatorMetric(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Evaluator Metric. - :ivar type: References a container created with the /v1/containers endpoint. Required. - CONTAINER_REFERENCE. - :vartype type: str or ~azure.ai.projects.models.CONTAINER_REFERENCE - :ivar container_id: The ID of the referenced container. Required. - :vartype container_id: str + :ivar type: Type of the metric. Known values are: "ordinal", "continuous", and "boolean". + :vartype type: str or ~azure.ai.projects.models.EvaluatorMetricType + :ivar desirable_direction: It indicates whether a higher value is better or a lower value is + better for this metric. Known values are: "increase", "decrease", and "neutral". + :vartype desirable_direction: str or ~azure.ai.projects.models.EvaluatorMetricDirection + :ivar min_value: Minimum value for the metric. + :vartype min_value: float + :ivar max_value: Maximum value for the metric. If not specified, it is assumed to be unbounded. + :vartype max_value: float + :ivar threshold: Default pass/fail threshold for this metric. + :vartype threshold: float + :ivar is_primary: Indicates if this metric is primary when there are multiple metrics. + :vartype is_primary: bool """ - type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """References a container created with the /v1/containers endpoint. Required. CONTAINER_REFERENCE.""" - container_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the referenced container. Required.""" + type: Optional[Union[str, "_models.EvaluatorMetricType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Type of the metric. Known values are: \"ordinal\", \"continuous\", and \"boolean\".""" + desirable_direction: Optional[Union[str, "_models.EvaluatorMetricDirection"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """It indicates whether a higher value is better or a lower value is better for this metric. Known + values are: \"increase\", \"decrease\", and \"neutral\".""" + min_value: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Minimum value for the metric.""" + max_value: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Maximum value for the metric. If not specified, it is assumed to be unbounded.""" + threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Default pass/fail threshold for this metric.""" + is_primary: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Indicates if this metric is primary when there are multiple metrics.""" @overload def __init__( self, *, - container_id: str, + type: Optional[Union[str, "_models.EvaluatorMetricType"]] = None, + desirable_direction: Optional[Union[str, "_models.EvaluatorMetricDirection"]] = None, + min_value: Optional[float] = None, + max_value: Optional[float] = None, + threshold: Optional[float] = None, + is_primary: Optional[bool] = None, ) -> None: ... @overload @@ -8677,32 +8715,124 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE # type: ignore -class FunctionShellToolParamEnvironmentLocalEnvironmentParam( - FunctionShellToolParamEnvironment, discriminator="local" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """FunctionShellToolParamEnvironmentLocalEnvironmentParam. +class EvaluatorVersion(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Evaluator Definition. - :ivar type: Use a local computer environment. Required. LOCAL. - :vartype type: str or ~azure.ai.projects.models.LOCAL - :ivar skills: An optional list of skills. - :vartype skills: list[~azure.ai.projects.models.LocalSkillParam] + :ivar display_name: Display Name for evaluator. It helps to find the evaluator easily in AI + Foundry. It does not need to be unique. + :vartype display_name: str + :ivar metadata: Metadata about the evaluator. + :vartype metadata: dict[str, str] + :ivar evaluator_type: The type of the evaluator. Required. Known values are: "builtin" and + "custom". + :vartype evaluator_type: str or ~azure.ai.projects.models.EvaluatorType + :ivar categories: The categories of the evaluator. Required. + :vartype categories: list[str or ~azure.ai.projects.models.EvaluatorCategory] + :ivar supported_evaluation_levels: Evaluation levels this evaluator supports (e.g., ``turn``, + ``conversation``). When omitted on create, the service defaults to ``["turn"]``. On update, + omitting this field leaves it unchanged; an empty list is rejected. Custom code-based + evaluators support only ``turn``; custom prompt-based evaluators support exactly one level + (``turn`` or ``conversation``). + :vartype supported_evaluation_levels: list[str or ~azure.ai.projects.models.EvaluationLevel] + :ivar definition: Definition of the evaluator. Required. + :vartype definition: ~azure.ai.projects.models.EvaluatorDefinition + :ivar generation_artifacts: Provenance artifacts from the generation pipeline. Read-only; + present only on evaluator versions created via an EvaluatorGenerationJob. Each artifact + resolves to a versioned Foundry Dataset. + :vartype generation_artifacts: ~azure.ai.projects.models.EvaluatorGenerationArtifacts + :ivar generation_job_id: Read-only provenance link back to the EvaluatorGenerationJob that + produced this version. Present only on evaluator versions created via the generation pipeline; + absent for manually-created versions and unaffected by subsequent ``PATCH`` calls. + :vartype generation_job_id: str + :ivar warnings: Categories of warnings surfaced on this generated evaluator version. Present + only on versions created via an EvaluatorGenerationJob when the paired job produced non-empty + warnings. Absent (treat as no warnings) when the version is not from generation, when the + paired job was clean, or when a subsequent ``PATCH`` to ``definition`` cleared the paired job's + advisories. Follow ``generation_job_id`` to fetch the detailed warning payloads. + :vartype warnings: list[str or ~azure.ai.projects.models.GenerationWarningType] + :ivar created_by: Creator of the evaluator. Required. + :vartype created_by: str + :ivar created_at: Creation date/time of the evaluator. Required. + :vartype created_at: ~datetime.datetime + :ivar modified_at: Last modified date/time of the evaluator. Required. + :vartype modified_at: ~datetime.datetime + :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] """ - type: Literal[FunctionShellToolParamEnvironmentType.LOCAL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Use a local computer environment. Required. LOCAL.""" - skills: Optional[list["_models.LocalSkillParam"]] = rest_field( + display_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not + need to be unique.""" + metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Metadata about the evaluator.""" + evaluator_type: Union[str, "_models.EvaluatorType"] = rest_field(visibility=["read", "create"]) + """The type of the evaluator. Required. Known values are: \"builtin\" and \"custom\".""" + categories: list[Union[str, "_models.EvaluatorCategory"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """An optional list of skills.""" + """The categories of the evaluator. Required.""" + supported_evaluation_levels: Optional[list[Union[str, "_models.EvaluationLevel"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Evaluation levels this evaluator supports (e.g., ``turn``, ``conversation``). When omitted on + create, the service defaults to ``[\"turn\"]``. On update, omitting this field leaves it + unchanged; an empty list is rejected. Custom code-based evaluators support only ``turn``; + custom prompt-based evaluators support exactly one level (``turn`` or ``conversation``).""" + definition: "_models.EvaluatorDefinition" = rest_field(visibility=["read", "create"]) + """Definition of the evaluator. Required.""" + generation_artifacts: Optional["_models.EvaluatorGenerationArtifacts"] = rest_field(visibility=["read"]) + """Provenance artifacts from the generation pipeline. Read-only; present only on evaluator + versions created via an EvaluatorGenerationJob. Each artifact resolves to a versioned Foundry + Dataset.""" + generation_job_id: Optional[str] = rest_field(visibility=["read"]) + """Read-only provenance link back to the EvaluatorGenerationJob that produced this version. + Present only on evaluator versions created via the generation pipeline; absent for + manually-created versions and unaffected by subsequent ``PATCH`` calls.""" + warnings: Optional[list[Union[str, "_models.GenerationWarningType"]]] = rest_field(visibility=["read"]) + """Categories of warnings surfaced on this generated evaluator version. Present only on versions + created via an EvaluatorGenerationJob when the paired job produced non-empty warnings. Absent + (treat as no warnings) when the version is not from generation, when the paired job was clean, + or when a subsequent ``PATCH`` to ``definition`` cleared the paired job's advisories. Follow + ``generation_job_id`` to fetch the detailed warning payloads.""" + created_by: str = rest_field(visibility=["read"]) + """Creator of the evaluator. Required.""" + created_at: datetime.datetime = rest_field(visibility=["read"], format="rfc3339") + """Creation date/time of the evaluator. Required.""" + modified_at: datetime.datetime = rest_field(visibility=["read"], format="rfc3339") + """Last modified date/time of the evaluator. Required.""" + 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=["create", "update"]) + """The asset description text.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["create", "update"]) + """Tag dictionary. Tags can be added, removed, and updated.""" @overload def __init__( self, *, - skills: Optional[list["_models.LocalSkillParam"]] = None, + evaluator_type: Union[str, "_models.EvaluatorType"], + categories: list[Union[str, "_models.EvaluatorCategory"]], + definition: "_models.EvaluatorDefinition", + display_name: Optional[str] = None, + metadata: Optional[dict[str, str]] = None, + supported_evaluation_levels: Optional[list[Union[str, "_models.EvaluationLevel"]]] = None, + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -8714,57 +8844,44 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = FunctionShellToolParamEnvironmentType.LOCAL # type: ignore -class FunctionTool(Tool, discriminator="function"): # pylint: disable=docstring-keyword-should-match-keyword-only - """Function. +class ExternalAgentDefinition( + AgentDefinition, discriminator="external" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The external agent definition. Represents a third-party agent hosted outside Foundry (for + example, on GCP or AWS). Registration is metadata-only: Foundry records the agent definition to + light up observability experiences (traces, evaluations) over customer-emitted OpenTelemetry + data. - :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 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] + :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. + :vartype rai_config: ~azure.ai.projects.models.RaiConfig + :ivar kind: Required. EXTERNAL. + :vartype kind: str or ~azure.ai.projects.models.EXTERNAL + :ivar otel_agent_id: The OpenTelemetry agent identifier used to attribute customer-emitted + spans to this Foundry agent. Spans must include the attribute ``gen_ai.agent.id = + `` to appear under this registration. Defaults to the top-level agent name when + omitted. Provide an explicit value only for migration scenarios where the running external + agent already emits a stable id that differs from the Foundry agent name. The resolved value is + always echoed on read. + :vartype otel_agent_id: str """ - 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.""" - 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"] - ) + kind: Literal[AgentKind.EXTERNAL] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. EXTERNAL.""" + otel_agent_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The OpenTelemetry agent identifier used to attribute customer-emitted spans to this Foundry + agent. Spans must include the attribute ``gen_ai.agent.id = `` to appear under + this registration. Defaults to the top-level agent name when omitted. Provide an explicit value + only for migration scenarios where the running external agent already emits a stable id that + differs from the Foundry agent name. The resolved value is always echoed on read.""" @overload def __init__( self, *, - name: str, - parameters: dict[str, Any], - strict: bool, - 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, + rai_config: Optional["_models.RaiConfig"] = None, + otel_agent_id: Optional[str] = None, ) -> None: ... @overload @@ -8776,57 +8893,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.FUNCTION # type: ignore + self.kind = AgentKind.EXTERNAL # type: ignore -class FunctionToolParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """FunctionToolParam. +class FabricDataAgentToolParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The fabric data agent tool parameters. - :ivar name: Required. - :vartype name: str - :ivar description: - :vartype description: str - :ivar parameters: - :vartype parameters: ~azure.ai.projects.models.EmptyModelParam - :ivar strict: - :vartype strict: bool - :ivar type: Required. Default value is "function". - :vartype type: str - :ivar output_schema: - :vartype output_schema: dict[str, any] - :ivar defer_loading: Whether this function 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] + :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] """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - parameters: Optional["_models.EmptyModelParam"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - strict: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - type: Literal["function"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"function\".""" - output_schema: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - defer_loading: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether this function should be deferred and discovered via tool search.""" - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( + 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, *, - name: str, - description: Optional[str] = None, - parameters: Optional["_models.EmptyModelParam"] = None, - strict: Optional[bool] = None, - output_schema: Optional[dict[str, Any]] = None, - defer_loading: Optional[bool] = None, - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, + project_connections: Optional[list["_models.ToolProjectConnection"]] = None, ) -> None: ... @overload @@ -8838,89 +8926,50 @@ 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 GenerateVoiceAgentRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The inputs for generating a voice agent. Only ``kind`` and ``name`` are always required. The - authoring service expands these inputs into a full, editable ``VoiceAgentDefinition``, which is - then created through ``POST /agents``. The generated ``instructions`` and audio/voice settings - are stored as separate fields on the resulting agent definition, so the caller can edit or - override any of them afterward via standard agent versioning. +class FabricIQPreviewTool( + Tool, discriminator="fabric_iq_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A FabricIQ server-side tool. - :ivar kind: The agent kind. Always ``voice``. Required. VOICE. - :vartype kind: str or ~azure.ai.projects.models.VOICE - :ivar name: The unique name for the agent to create. Must be a non-empty DNS-like agent name. - Required. - :vartype name: str - :ivar model_type: Optional inference mode. When omitted, the authoring service uses - ``managed``. When supplied, use ``managed`` or ``self_deployed``. Known values are: "managed" - and "self_deployed". - :vartype model_type: str or ~azure.ai.projects.models.VoiceModelType - :ivar model: Optional model identifier. Required when ``model_type`` is ``self_deployed``; - optional when ``model_type`` is ``managed`` or omitted. The service never invents a customer - deployment name. - :vartype model: str - :ivar use_case: An optional authoring use case. An empty string is accepted. - :vartype use_case: str - :ivar goal: An optional natural-language description of what the agent should do. When - supplied, it seeds the generated instructions. - :vartype goal: str - :ivar description: An optional agent description. The authoring service resolves its fallback - when omitted. - :vartype description: str - :ivar tools: Optional tools carried through verbatim onto the generated agent (see - ``VoiceAgentTool``). - :vartype tools: list[~azure.ai.projects.models.VoiceAgentTool] - :ivar draft: (Preview) When ``true``, the generated voice agent is created as a draft — an - editable, unpublished version the caller can review and refine before publishing it via the - standard create/version path. The service defaults to ``false`` if a value is not specified by - the caller, in which case the agent is created and published normally. - :vartype draft: bool + :ivar type: The object type, which is always 'fabric_iq_preview'. Required. FABRIC_IQ_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.FABRIC_IQ_PREVIEW + :ivar project_connection_id: The ID of the FabricIQ project connection. Required. + :vartype project_connection_id: str + :ivar server_label: (Optional) The label of the FabricIQ MCP server to connect to. + :vartype server_label: str + :ivar server_url: (Optional) The URL of the FabricIQ MCP server. If not provided, the URL from + the project connection will be used. + :vartype server_url: str + :ivar require_approval: (Optional) Whether the agent requires approval before executing + actions. Default is always. Is either a MCPToolRequireApproval type or a str type. + :vartype require_approval: ~azure.ai.projects.models.MCPToolRequireApproval or str """ - kind: Literal[AgentKind.VOICE] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The agent kind. Always ``voice``. Required. VOICE.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique name for the agent to create. Must be a non-empty DNS-like agent name. Required.""" - model_type: Optional[Union[str, "_models.VoiceModelType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Optional inference mode. When omitted, the authoring service uses ``managed``. When supplied, - use ``managed`` or ``self_deployed``. Known values are: \"managed\" and \"self_deployed\".""" - model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional model identifier. Required when ``model_type`` is ``self_deployed``; optional when - ``model_type`` is ``managed`` or omitted. The service never invents a customer deployment name.""" - use_case: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An optional authoring use case. An empty string is accepted.""" - goal: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An optional natural-language description of what the agent should do. When supplied, it seeds - the generated instructions.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An optional agent description. The authoring service resolves its fallback when omitted.""" - tools: Optional[list["_models.VoiceAgentTool"]] = rest_field( + type: Literal[ToolType.FABRIC_IQ_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'fabric_iq_preview'. Required. FABRIC_IQ_PREVIEW.""" + project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the FabricIQ project connection. Required.""" + server_label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """(Optional) The label of the FabricIQ MCP server to connect to.""" + server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """(Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project + connection will be used.""" + require_approval: Optional[Union["_models.MCPToolRequireApproval", str]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Optional tools carried through verbatim onto the generated agent (see ``VoiceAgentTool``).""" - draft: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """(Preview) When ``true``, the generated voice agent is created as a draft — an editable, - unpublished version the caller can review and refine before publishing it via the standard - create/version path. The service defaults to ``false`` if a value is not specified by the - caller, in which case the agent is created and published normally.""" + """(Optional) Whether the agent requires approval before executing actions. Default is always. Is + either a MCPToolRequireApproval type or a str type.""" @overload def __init__( self, *, - kind: Literal[AgentKind.VOICE], - name: str, - model_type: Optional[Union[str, "_models.VoiceModelType"]] = None, - model: Optional[str] = None, - use_case: Optional[str] = None, - goal: Optional[str] = None, - description: Optional[str] = None, - tools: Optional[list["_models.VoiceAgentTool"]] = None, - draft: Optional[bool] = None, + project_connection_id: str, + server_label: Optional[str] = None, + server_url: Optional[str] = None, + require_approval: Optional[Union["_models.MCPToolRequireApproval", str]] = None, ) -> None: ... @overload @@ -8932,52 +8981,62 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.FABRIC_IQ_PREVIEW # type: ignore -class GitHubIssueRoutineTrigger( - RoutineTrigger, discriminator="github_issue" +class FabricIQPreviewToolboxTool( + ToolboxTool, discriminator="fabric_iq_preview" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """A GitHub issue routine trigger. + """A FabricIQ tool stored in a toolbox. - :ivar type: The trigger type. Required. A GitHub issue trigger. - :vartype type: str or ~azure.ai.projects.models.GITHUB_ISSUE - :ivar connection_id: The workspace connection identifier that resolves the GitHub configuration - for the trigger. Required. - :vartype connection_id: str - :ivar owner: The GitHub owner or organization that scopes which issues can fire the trigger. - Required. - :vartype owner: str - :ivar repository: The GitHub repository filter that scopes which issues can fire the trigger. - Required. - :vartype repository: str - :ivar issue_event: The GitHub issue event that fires the routine. Required. Known values are: - "opened" and "closed". - :vartype issue_event: str or ~azure.ai.projects.models.GitHubIssueEvent + :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. FABRIC_IQ_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.FABRIC_IQ_PREVIEW + :ivar project_connection_id: The ID of the FabricIQ project connection. Required. + :vartype project_connection_id: str + :ivar server_label: (Optional) The label of the FabricIQ MCP server to connect to. + :vartype server_label: str + :ivar server_url: (Optional) The URL of the FabricIQ MCP server. If not provided, the URL from + the project connection will be used. + :vartype server_url: str + :ivar require_approval: (Optional) Whether the agent requires approval before executing + actions. Default is always. Is either a MCPToolRequireApproval type or a str type. + :vartype require_approval: ~azure.ai.projects.models.MCPToolRequireApproval or str """ - type: Literal[RoutineTriggerType.GITHUB_ISSUE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The trigger type. Required. A GitHub issue trigger.""" - connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The workspace connection identifier that resolves the GitHub configuration for the trigger. - Required.""" - owner: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The GitHub owner or organization that scopes which issues can fire the trigger. Required.""" - repository: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The GitHub repository filter that scopes which issues can fire the trigger. Required.""" - issue_event: Union[str, "_models.GitHubIssueEvent"] = rest_field( + type: Literal[ToolboxToolType.FABRIC_IQ_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. FABRIC_IQ_PREVIEW.""" + project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the FabricIQ project connection. Required.""" + server_label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """(Optional) The label of the FabricIQ MCP server to connect to.""" + server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """(Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project + connection will be used.""" + require_approval: Optional[Union["_models.MCPToolRequireApproval", str]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The GitHub issue event that fires the routine. Required. Known values are: \"opened\" and - \"closed\".""" + """(Optional) Whether the agent requires approval before executing actions. Default is always. Is + either a MCPToolRequireApproval type or a str type.""" @overload def __init__( self, *, - connection_id: str, - owner: str, - repository: str, - issue_event: Union[str, "_models.GitHubIssueEvent"], + project_connection_id: str, + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + server_label: Optional[str] = None, + server_url: Optional[str] = None, + require_approval: Optional[Union["_models.MCPToolRequireApproval", str]] = None, ) -> None: ... @overload @@ -8989,75 +9048,49 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RoutineTriggerType.GITHUB_ISSUE # type: ignore - + self.type = ToolboxToolType.FABRIC_IQ_PREVIEW # type: ignore -class TelemetryEndpointAuth(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Authentication configuration for a telemetry endpoint. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - HeaderTelemetryEndpointAuth +class FieldMapping(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Field mapping configuration class. - :ivar type: The authentication type. Required. "header" - :vartype type: str or ~azure.ai.projects.models.TelemetryEndpointAuthType + :ivar content_fields: List of fields with text content. Required. + :vartype content_fields: list[str] + :ivar filepath_field: Path of file to be used as a source of text content. + :vartype filepath_field: str + :ivar title_field: Field containing the title of the document. + :vartype title_field: str + :ivar url_field: Field containing the url of the document. + :vartype url_field: str + :ivar vector_fields: List of fields with vector content. + :vartype vector_fields: list[str] + :ivar metadata_fields: List of fields with metadata content. + :vartype metadata_fields: list[str] """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The authentication type. Required. \"header\"""" - - @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 HeaderTelemetryEndpointAuth( - TelemetryEndpointAuth, discriminator="header" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Header-based secret authentication for a telemetry endpoint. The resolved secret value is - injected as an HTTP header. - - :ivar type: The authentication type, always 'header' for header-based secret authentication. - Required. Header-based secret authentication. - :vartype type: str or ~azure.ai.projects.models.HEADER - :ivar header_name: The name of the HTTP header to inject the secret value into. Required. - :vartype header_name: str - :ivar secret_id: The identifier of the secret store or connection. Required. - :vartype secret_id: str - :ivar secret_key: The key within the secret to retrieve the authentication value. Required. - :vartype secret_key: str - """ - - type: Literal[TelemetryEndpointAuthType.HEADER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The authentication type, always 'header' for header-based secret authentication. Required. - Header-based secret authentication.""" - header_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the HTTP header to inject the secret value into. Required.""" - secret_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The identifier of the secret store or connection. Required.""" - secret_key: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The key within the secret to retrieve the authentication value. Required.""" + content_fields: list[str] = rest_field(name="contentFields", visibility=["create"]) + """List of fields with text content. Required.""" + filepath_field: Optional[str] = rest_field(name="filepathField", visibility=["create"]) + """Path of file to be used as a source of text content.""" + title_field: Optional[str] = rest_field(name="titleField", visibility=["create"]) + """Field containing the title of the document.""" + url_field: Optional[str] = rest_field(name="urlField", visibility=["create"]) + """Field containing the url of the document.""" + vector_fields: Optional[list[str]] = rest_field(name="vectorFields", visibility=["create"]) + """List of fields with vector content.""" + metadata_fields: Optional[list[str]] = rest_field(name="metadataFields", visibility=["create"]) + """List of fields with metadata content.""" @overload def __init__( self, *, - header_name: str, - secret_id: str, - secret_key: str, + content_fields: list[str], + filepath_field: Optional[str] = None, + title_field: Optional[str] = None, + url_field: Optional[str] = None, + vector_fields: Optional[list[str]] = None, + metadata_fields: Optional[list[str]] = None, ) -> None: ... @overload @@ -9069,90 +9102,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = TelemetryEndpointAuthType.HEADER # type: ignore -class HostedAgentDefinition( - AgentDefinition, discriminator="hosted" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """The hosted agent definition. +class FileDataGenerationJobOutput(DataGenerationJobOutput, discriminator="file"): + """Azure OpenAI file output for a data generation job. - :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. - :vartype rai_config: ~azure.ai.projects.models.RaiConfig - :ivar kind: Required. HOSTED. - :vartype kind: str or ~azure.ai.projects.models.HOSTED - :ivar cpu: The CPU configuration for the hosted agent. Required. - :vartype cpu: str - :ivar memory: The memory configuration for the hosted agent. Required. - :vartype memory: str - :ivar environment_variables: Environment variables to set in the hosted agent container. - :vartype environment_variables: dict[str, str] - :ivar container_configuration: Container-based deployment configuration. Provide this for - image-based deployments. Mutually exclusive with code_configuration — the service validates - that exactly one is set. - :vartype container_configuration: ~azure.ai.projects.models.ContainerConfiguration - :ivar protocol_versions: The protocols that the agent supports for ingress communication. - :vartype protocol_versions: list[~azure.ai.projects.models.ProtocolVersionRecord] - :ivar code_configuration: Code-based deployment configuration. Provide this for code-based - deployments. Mutually exclusive with container_configuration — the service validates that - exactly one is set. - :vartype code_configuration: ~azure.ai.projects.models.CodeConfiguration - :ivar telemetry_config: Optional customer-supplied telemetry configuration for exporting - container logs, traces, and metrics. - :vartype telemetry_config: ~azure.ai.projects.models.TelemetryConfig - :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 type: Azure OpenAI file output. Required. The generated data is an Azure OpenAI File. + :vartype type: str or ~azure.ai.projects.models.FILE + :ivar id: The id of the output Azure OpenAI file. Required. + :vartype id: str + :ivar filename: The filename of the output Azure OpenAI file. Required. + :vartype filename: str """ - kind: Literal[AgentKind.HOSTED] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. HOSTED.""" - cpu: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The CPU configuration for the hosted agent. Required.""" - memory: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The memory configuration for the hosted agent. Required.""" - environment_variables: Optional[dict[str, str]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Environment variables to set in the hosted agent container.""" - container_configuration: Optional["_models.ContainerConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Container-based deployment configuration. Provide this for image-based deployments. Mutually - exclusive with code_configuration — the service validates that exactly one is set.""" - protocol_versions: Optional[list["_models.ProtocolVersionRecord"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The protocols that the agent supports for ingress communication.""" - code_configuration: Optional["_models.CodeConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Code-based deployment configuration. Provide this for code-based deployments. Mutually - exclusive with container_configuration — the service validates that exactly one is set.""" - telemetry_config: Optional["_models.TelemetryConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Optional customer-supplied telemetry configuration for exporting container logs, traces, and - metrics.""" - session_configuration: Optional["_models.SessionConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Optional session defaults (for example, the idle timeout) applied to sessions created for this - agent version.""" + type: Literal[DataGenerationJobOutputType.FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Azure OpenAI file output. Required. The generated data is an Azure OpenAI File.""" + id: str = rest_field(visibility=["read"]) + """The id of the output Azure OpenAI file. Required.""" + filename: str = rest_field(visibility=["read"]) + """The filename of the output Azure OpenAI file. Required.""" @overload def __init__( self, - *, - cpu: str, - memory: str, - rai_config: Optional["_models.RaiConfig"] = None, - environment_variables: Optional[dict[str, str]] = None, - container_configuration: Optional["_models.ContainerConfiguration"] = None, - protocol_versions: Optional[list["_models.ProtocolVersionRecord"]] = None, - code_configuration: Optional["_models.CodeConfiguration"] = None, - telemetry_config: Optional["_models.TelemetryConfig"] = None, - session_configuration: Optional["_models.SessionConfiguration"] = None, ) -> None: ... @overload @@ -9164,22 +9136,36 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = AgentKind.HOSTED # type: ignore + self.type = DataGenerationJobOutputType.FILE # type: ignore -class HourlyRecurrenceSchedule(RecurrenceSchedule, discriminator="Hourly"): - """Hourly recurrence schedule. +class FileDataGenerationJobSource( + DataGenerationJobSource, discriminator="file" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """File source for data generation jobs — Azure OpenAI file input. - :ivar type: Required. Hourly recurrence pattern. - :vartype type: str or ~azure.ai.projects.models.HOURLY + :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 job, which is File. Required. File source — Azure OpenAI + file. + :vartype type: str or ~azure.ai.projects.models.FILE + :ivar id: Input Azure Open AI file id used for data generation. Required. + :vartype id: str """ - type: Literal[RecurrenceType.HOURLY] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Hourly recurrence pattern.""" + type: Literal[DataGenerationJobSourceType.FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The source type for this job, which is File. Required. File source — Azure OpenAI file.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Input Azure Open AI file id used for data generation. Required.""" @overload def __init__( self, + *, + id: str, # pylint: disable=redefined-builtin + description: Optional[str] = None, ) -> None: ... @overload @@ -9191,30 +9177,49 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RecurrenceType.HOURLY # type: ignore + self.type = DataGenerationJobSourceType.FILE # type: ignore -class HumanEvaluationPreviewRuleAction( - EvaluationRuleAction, discriminator="humanEvaluationPreview" +class FileDatasetVersion( + DatasetVersion, discriminator="uri_file" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Evaluation rule action for human evaluation. + """FileDatasetVersion Definition. - :ivar type: Required. Human evaluation preview. - :vartype type: str or ~azure.ai.projects.models.HUMAN_EVALUATION_PREVIEW - :ivar template_id: Human evaluation template Id. Required. - :vartype template_id: str + :ivar data_uri: URI of the data (`example `_). + Required. + :vartype data_uri: str + :ivar is_reference: Indicates if the dataset holds a reference to the storage, or the dataset + manages storage itself. If true, the underlying data will not be deleted when the dataset + version is deleted. + :vartype is_reference: bool + :ivar connection_name: The Azure Storage Account connection name. Required if + startPendingUploadVersion was not called before creating the Dataset. + :vartype connection_name: str + :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: Dataset type. Required. URI file. + :vartype type: str or ~azure.ai.projects.models.URI_FILE """ - type: Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Human evaluation preview.""" - template_id: str = rest_field(name="templateId", visibility=["read", "create", "update", "delete", "query"]) - """Human evaluation template Id. Required.""" + type: Literal[DatasetType.URI_FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Dataset type. Required. URI file.""" @overload def __init__( self, *, - template_id: str, + data_uri: str, + connection_name: Optional[str] = None, + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -9226,29 +9231,66 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW # type: ignore + self.type = DatasetType.URI_FILE # type: ignore -class HybridSearchOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """HybridSearchOptions. +class FileSearchTool(Tool, discriminator="file_search"): # pylint: disable=docstring-keyword-should-match-keyword-only + """File search. - :ivar embedding_weight: The weight of the embedding in the reciprocal ranking fusion. Required. - :vartype embedding_weight: float - :ivar text_weight: The weight of the text in the reciprocal ranking fusion. Required. - :vartype text_weight: float + :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] """ - embedding_weight: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The weight of the embedding in the reciprocal ranking fusion. Required.""" - text_weight: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The weight of the text in the reciprocal ranking fusion. Required.""" - - @overload + 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, *, - embedding_weight: float, - text_weight: float, + 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 @@ -9260,160 +9302,60 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.FILE_SEARCH # type: ignore -class ImageGenTool( - Tool, discriminator="image_generation" +class FileSearchToolboxTool( + ToolboxTool, discriminator="file_search" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Image generation tool. + """A file search tool stored in a toolbox. - :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"], str - :vartype model: 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"], - 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: Background type for the generated image. One of ``transparent``, ``opaque``, - or ``auto``. 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. + :ivar name: Optional user-defined name for this tool or configuration. :vartype name: str - :ivar description: Deprecated. This property is deprecated and will be removed in a future - version. + :ivar description: Optional user-defined description for this tool or configuration. :vartype description: str - :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future - version. + :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. FILE_SEARCH. + :vartype type: str or ~azure.ai.projects.models.FILE_SEARCH + :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 vector_store_ids: The IDs of the vector stores to search. + :vartype vector_store_ids: list[str] """ - 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"], 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\"], str""" - quality: Optional[Literal["low", "medium", "high", "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\"]""" - 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""" - 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"] - ) - """Background type for the generated image. One of ``transparent``, ``opaque``, or ``auto``. - 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( + type: Literal[ToolboxToolType.FILE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. FILE_SEARCH.""" + 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"] ) - """Deprecated. This property is deprecated and will be removed in a future version.""" + """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.""" + vector_store_ids: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The IDs of the vector stores to search.""" @overload def __init__( self, *, - model: Optional[ - Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], Literal["gpt-image-1.5"], str] - ] = None, - quality: Optional[Literal["low", "medium", "high", "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, + max_num_results: Optional[int] = None, + ranking_options: Optional["_models.RankingOptions"] = None, + filters: Optional["_unions.Filters"] = None, + vector_store_ids: Optional[list[str]] = None, ) -> None: ... @overload @@ -9425,27 +9367,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.IMAGE_GENERATION # type: ignore + self.type = ToolboxToolType.FILE_SEARCH # type: ignore -class ImageGenToolInputImageMask(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """ImageGenToolInputImageMask. +class VersionSelectionRule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """VersionSelectionRule. - :ivar image_url: - :vartype image_url: str - :ivar file_id: - :vartype file_id: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + FixedRatioVersionSelectionRule + + :ivar type: Required. "FixedRatio" + :vartype type: str or ~azure.ai.projects.models.VersionSelectorType + :ivar agent_version: The agent version to route traffic to. Required. + :vartype agent_version: str """ - image_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - file_id: Optional[str] = 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. \"FixedRatio\"""" + agent_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The agent version to route traffic to. Required.""" @overload def __init__( self, *, - image_url: Optional[str] = None, - file_id: Optional[str] = None, + type: str, + agent_version: str, ) -> None: ... @overload @@ -9459,37 +9407,31 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InlineSkillParam( - ContainerSkill, discriminator="inline" +class FixedRatioVersionSelectionRule( + VersionSelectionRule, discriminator="FixedRatio" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """InlineSkillParam. + """FixedRatioVersionSelectionRule. - :ivar type: Defines an inline skill for this request. Required. INLINE. - :vartype type: str or ~azure.ai.projects.models.INLINE - :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.InlineSkillSourceParam + :ivar agent_version: The agent version to route traffic to. Required. + :vartype agent_version: str + :ivar type: Required. FIXED_RATIO. + :vartype type: str or ~azure.ai.projects.models.FIXED_RATIO + :ivar traffic_percentage: The percentage of traffic to route to the version. Must be between 0 + and 100. Required. + :vartype traffic_percentage: int """ - type: Literal[ContainerSkillType.INLINE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Defines an inline skill for this request. Required. 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.InlineSkillSourceParam" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Inline skill payload. Required.""" + type: Literal[VersionSelectorType.FIXED_RATIO] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. FIXED_RATIO.""" + traffic_percentage: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The percentage of traffic to route to the version. Must be between 0 and 100. Required.""" @overload def __init__( self, *, - name: str, - description: str, - source: "_models.InlineSkillSourceParam", + agent_version: str, + traffic_percentage: int, ) -> None: ... @overload @@ -9501,35 +9443,49 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ContainerSkillType.INLINE # type: ignore + self.type = VersionSelectorType.FIXED_RATIO # type: ignore -class InlineSkillSourceParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Inline skill payload. +class FolderDatasetVersion( + DatasetVersion, discriminator="uri_folder" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """FileDatasetVersion Definition. - :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 + :ivar data_uri: URI of the data (`example `_). + Required. + :vartype data_uri: str + :ivar is_reference: Indicates if the dataset holds a reference to the storage, or the dataset + manages storage itself. If true, the underlying data will not be deleted when the dataset + version is deleted. + :vartype is_reference: bool + :ivar connection_name: The Azure Storage Account connection name. Required if + startPendingUploadVersion was not called before creating the Dataset. + :vartype connection_name: str + :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: Dataset type. Required. URI folder. + :vartype type: str or ~azure.ai.projects.models.URI_FOLDER """ - 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.""" + type: Literal[DatasetType.URI_FOLDER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Dataset type. Required. URI folder.""" @overload def __init__( self, *, - data: str, + data_uri: str, + connection_name: Optional[str] = None, + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -9541,48 +9497,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["base64"] = "base64" - self.media_type: Literal["application/zip"] = "application/zip" + self.type = DatasetType.URI_FOLDER # type: ignore -class Insight(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The response body for cluster insights. +class FoundryModelWarning(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A warning associated with a model. - :ivar insight_id: The unique identifier for the insights report. Required. - :vartype insight_id: str - :ivar metadata: Metadata about the insights report. Required. - :vartype metadata: ~azure.ai.projects.models.InsightsMetadata - :ivar state: The current state of the insights. Required. Known values are: "NotStarted", - "Running", "Succeeded", "Failed", and "Canceled". - :vartype state: str or ~azure.ai.projects.models.OperationState - :ivar display_name: User friendly display name for the insight. Required. - :vartype display_name: str - :ivar request: Request for the insights analysis. Required. - :vartype request: ~azure.ai.projects.models.InsightRequest - :ivar result: The result of the insights report. - :vartype result: ~azure.ai.projects.models.InsightResult + :ivar code: The warning code. Known values are: "RuntimeDependentArtifact" and + "UnclassifiedArtifact". + :vartype code: str or ~azure.ai.projects.models.FoundryModelWarningCode + :ivar message: The warning message. + :vartype message: str """ - insight_id: str = rest_field(name="id", visibility=["read"]) - """The unique identifier for the insights report. Required.""" - metadata: "_models.InsightsMetadata" = rest_field(visibility=["read"]) - """Metadata about the insights report. Required.""" - state: Union[str, "_models.OperationState"] = rest_field(visibility=["read"]) - """The current state of the insights. Required. Known values are: \"NotStarted\", \"Running\", - \"Succeeded\", \"Failed\", and \"Canceled\".""" - display_name: str = rest_field(name="displayName", visibility=["read", "create", "update", "delete", "query"]) - """User friendly display name for the insight. Required.""" - request: "_models.InsightRequest" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Request for the insights analysis. Required.""" - result: Optional["_models.InsightResult"] = rest_field(visibility=["read"]) - """The result of the insights report.""" + code: Optional[Union[str, "_models.FoundryModelWarningCode"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The warning code. Known values are: \"RuntimeDependentArtifact\" and \"UnclassifiedArtifact\".""" + message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The warning message.""" @overload def __init__( self, *, - display_name: str, - request: "_models.InsightRequest", + code: Optional[Union[str, "_models.FoundryModelWarningCode"]] = None, + message: Optional[str] = None, ) -> None: ... @overload @@ -9596,64 +9536,53 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InsightCluster(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A cluster of analysis samples. +class FunctionShellToolParam( + Tool, discriminator="shell" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Shell tool. - :ivar id: The id of the analysis cluster. Required. - :vartype id: str - :ivar label: Label for the cluster. Required. - :vartype label: str - :ivar suggestion: Suggestion for the cluster. Required. - :vartype suggestion: str - :ivar suggestion_title: The title of the suggestion for the cluster. Required. - :vartype suggestion_title: str - :ivar description: Description of the analysis cluster. Required. + :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 weight: The weight of the analysis cluster. This indicate number of samples in the - cluster. Required. - :vartype weight: int - :ivar sub_clusters: List of subclusters within this cluster. Empty if no subclusters exist. - :vartype sub_clusters: list[~azure.ai.projects.models.InsightCluster] - :ivar samples: List of samples that belong to this cluster. Empty if samples are part of - subclusters. - :vartype samples: list[~azure.ai.projects.models.InsightSample] + :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] """ - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The id of the analysis cluster. Required.""" - label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Label for the cluster. Required.""" - suggestion: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Suggestion for the cluster. Required.""" - suggestion_title: str = rest_field( - name="suggestionTitle", visibility=["read", "create", "update", "delete", "query"] + 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"] ) - """The title of the suggestion for the cluster. Required.""" - description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Description of the analysis cluster. Required.""" - weight: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The weight of the analysis cluster. This indicate number of samples in the cluster. Required.""" - sub_clusters: Optional[list["_models.InsightCluster"]] = rest_field( - name="subClusters", visibility=["read", "create", "update", "delete", "query"] + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """List of subclusters within this cluster. Empty if no subclusters exist.""" - samples: Optional[list["_models.InsightSample"]] = rest_field( + 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"] ) - """List of samples that belong to this cluster. Empty if samples are part of subclusters.""" + """Deprecated. This property is deprecated and will be removed in a future version.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - label: str, - suggestion: str, - suggestion_title: str, - description: str, - weight: int, - sub_clusters: Optional[list["_models.InsightCluster"]] = None, - samples: Optional[list["_models.InsightSample"]] = None, + 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 @@ -9665,28 +9594,31 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.SHELL # type: ignore -class InsightModelConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Configuration of the model used in the insight generation. +class FunctionShellToolParamEnvironmentContainerReferenceParam( + FunctionShellToolParamEnvironment, discriminator="container_reference" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """FunctionShellToolParamEnvironmentContainerReferenceParam. - :ivar model_deployment_name: The model deployment to be evaluated. Accepts either the - deployment name alone or with the connection name as '{connectionName}/'. - Required. - :vartype model_deployment_name: str + :ivar type: References a container created with the /v1/containers endpoint. Required. + CONTAINER_REFERENCE. + :vartype type: str or ~azure.ai.projects.models.CONTAINER_REFERENCE + :ivar container_id: The ID of the referenced container. Required. + :vartype container_id: str """ - model_deployment_name: str = rest_field( - name="modelDeploymentName", visibility=["read", "create", "update", "delete", "query"] - ) - """The model deployment to be evaluated. Accepts either the deployment name alone or with the - connection name as '{connectionName}/'. Required.""" + type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """References a container created with the /v1/containers endpoint. Required. CONTAINER_REFERENCE.""" + container_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the referenced container. Required.""" @overload def __init__( self, *, - model_deployment_name: str, + container_id: str, ) -> None: ... @overload @@ -9698,32 +9630,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE # type: ignore -class InsightScheduleTask( - ScheduleTask, discriminator="Insight" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Insight task for the schedule. +class FunctionShellToolParamEnvironmentLocalEnvironmentParam( + FunctionShellToolParamEnvironment, discriminator="local" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """FunctionShellToolParamEnvironmentLocalEnvironmentParam. - :ivar configuration: Configuration for the task. - :vartype configuration: dict[str, str] - :ivar type: Required. Insight task. - :vartype type: str or ~azure.ai.projects.models.INSIGHT - :ivar insight: The insight payload. Required. - :vartype insight: ~azure.ai.projects.models.Insight + :ivar type: Use a local computer environment. Required. LOCAL. + :vartype type: str or ~azure.ai.projects.models.LOCAL + :ivar skills: An optional list of skills. + :vartype skills: list[~azure.ai.projects.models.LocalSkillParam] """ - type: Literal[ScheduleTaskType.INSIGHT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Insight task.""" - insight: "_models.Insight" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The insight payload. Required.""" + type: Literal[FunctionShellToolParamEnvironmentType.LOCAL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Use a local computer environment. Required. LOCAL.""" + skills: Optional[list["_models.LocalSkillParam"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """An optional list of skills.""" @overload def __init__( self, *, - insight: "_models.Insight", - configuration: Optional[dict[str, str]] = None, + skills: Optional[list["_models.LocalSkillParam"]] = None, ) -> None: ... @overload @@ -9735,33 +9667,57 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ScheduleTaskType.INSIGHT # type: ignore + self.type = FunctionShellToolParamEnvironmentType.LOCAL # type: ignore -class InsightsMetadata(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Metadata about the insights. +class FunctionTool(Tool, discriminator="function"): # pylint: disable=docstring-keyword-should-match-keyword-only + """Function. - :ivar created_at: The timestamp when the insights were created. Required. - :vartype created_at: ~datetime.datetime - :ivar completed_at: The timestamp when the insights were completed. - :vartype completed_at: ~datetime.datetime + :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 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] """ - created_at: datetime.datetime = rest_field( - name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """The timestamp when the insights were created. Required.""" - completed_at: Optional[datetime.datetime] = rest_field( - name="completedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + 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.""" + 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"] ) - """The timestamp when the insights were completed.""" @overload def __init__( self, *, - created_at: datetime.datetime, - completed_at: Optional[datetime.datetime] = None, + name: str, + parameters: dict[str, Any], + strict: bool, + 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 @@ -9773,47 +9729,57 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.FUNCTION # type: ignore -class InsightSummary(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Summary of the error cluster analysis. +class FunctionToolParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """FunctionToolParam. - :ivar sample_count: Total number of samples analyzed. Required. - :vartype sample_count: int - :ivar unique_subcluster_count: Total number of unique subcluster labels. Required. - :vartype unique_subcluster_count: int - :ivar unique_cluster_count: Total number of unique clusters. Required. - :vartype unique_cluster_count: int - :ivar method: Method used for clustering. Required. - :vartype method: str - :ivar usage: Token usage while performing clustering analysis. Required. - :vartype usage: ~azure.ai.projects.models.ClusterTokenUsage + :ivar name: Required. + :vartype name: str + :ivar description: + :vartype description: str + :ivar parameters: + :vartype parameters: ~azure.ai.projects.models.EmptyModelParam + :ivar strict: + :vartype strict: bool + :ivar type: Required. Default value is "function". + :vartype type: str + :ivar output_schema: + :vartype output_schema: dict[str, any] + :ivar defer_loading: Whether this function 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] """ - sample_count: int = rest_field(name="sampleCount", visibility=["read", "create", "update", "delete", "query"]) - """Total number of samples analyzed. Required.""" - unique_subcluster_count: int = rest_field( - name="uniqueSubclusterCount", visibility=["read", "create", "update", "delete", "query"] + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + parameters: Optional["_models.EmptyModelParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Total number of unique subcluster labels. Required.""" - unique_cluster_count: int = rest_field( - name="uniqueClusterCount", visibility=["read", "create", "update", "delete", "query"] + strict: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal["function"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"function\".""" + output_schema: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + defer_loading: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether this function should be deferred and discovered via tool search.""" + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Total number of unique clusters. Required.""" - method: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Method used for clustering. Required.""" - usage: "_models.ClusterTokenUsage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Token usage while performing clustering analysis. Required.""" @overload def __init__( self, *, - sample_count: int, - unique_subcluster_count: int, - unique_cluster_count: int, - method: str, - usage: "_models.ClusterTokenUsage", + name: str, + description: Optional[str] = None, + parameters: Optional["_models.EmptyModelParam"] = None, + strict: Optional[bool] = None, + output_schema: Optional[dict[str, Any]] = None, + defer_loading: Optional[bool] = None, + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, ) -> None: ... @overload @@ -9825,37 +9791,89 @@ 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 InvocationsProtocolConfiguration(_Model): - """Configuration specific to the invocations protocol.""" - - -class InvocationsWsProtocolConfiguration(_Model): - """Configuration specific to the WebSocket-based invocations protocol.""" - - -class RoutineDispatchPayload(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Base model for a manual dispatch payload. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - InvokeAgentInvocationsApiDispatchPayload, InvokeAgentResponsesApiDispatchPayload +class GenerateVoiceAgentRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The inputs for generating a voice agent. Only ``kind`` and ``name`` are always required. The + authoring service expands these inputs into a full, editable ``VoiceAgentDefinition``, which is + then created through ``POST /agents``. The generated ``instructions`` and audio/voice settings + are stored as separate fields on the resulting agent definition, so the caller can edit or + override any of them afterward via standard agent versioning. - :ivar type: The manual dispatch payload type. Required. Known values are: - "invoke_agent_responses_api" and "invoke_agent_invocations_api". - :vartype type: str or ~azure.ai.projects.models.RoutineDispatchPayloadType + :ivar kind: The agent kind. Always ``voice``. Required. VOICE. + :vartype kind: str or ~azure.ai.projects.models.VOICE + :ivar name: The unique name for the agent to create. Must be a non-empty DNS-like agent name. + Required. + :vartype name: str + :ivar model_type: Optional inference mode. When omitted, the authoring service uses + ``managed``. When supplied, use ``managed`` or ``self_deployed``. Known values are: "managed" + and "self_deployed". + :vartype model_type: str or ~azure.ai.projects.models.VoiceModelType + :ivar model: Optional model identifier. Required when ``model_type`` is ``self_deployed``; + optional when ``model_type`` is ``managed`` or omitted. The service never invents a customer + deployment name. + :vartype model: str + :ivar use_case: An optional authoring use case. An empty string is accepted. + :vartype use_case: str + :ivar goal: An optional natural-language description of what the agent should do. When + supplied, it seeds the generated instructions. + :vartype goal: str + :ivar description: An optional agent description. The authoring service resolves its fallback + when omitted. + :vartype description: str + :ivar tools: Optional tools carried through verbatim onto the generated agent (see + ``VoiceAgentTool``). + :vartype tools: list[~azure.ai.projects.models.VoiceAgentTool] + :ivar draft: (Preview) When ``true``, the generated voice agent is created as a draft — an + editable, unpublished version the caller can review and refine before publishing it via the + standard create/version path. The service defaults to ``false`` if a value is not specified by + the caller, in which case the agent is created and published normally. + :vartype draft: bool """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The manual dispatch payload type. Required. Known values are: \"invoke_agent_responses_api\" - and \"invoke_agent_invocations_api\".""" + kind: Literal[AgentKind.VOICE] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The agent kind. Always ``voice``. Required. VOICE.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique name for the agent to create. Must be a non-empty DNS-like agent name. Required.""" + model_type: Optional[Union[str, "_models.VoiceModelType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional inference mode. When omitted, the authoring service uses ``managed``. When supplied, + use ``managed`` or ``self_deployed``. Known values are: \"managed\" and \"self_deployed\".""" + model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional model identifier. Required when ``model_type`` is ``self_deployed``; optional when + ``model_type`` is ``managed`` or omitted. The service never invents a customer deployment name.""" + use_case: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional authoring use case. An empty string is accepted.""" + goal: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional natural-language description of what the agent should do. When supplied, it seeds + the generated instructions.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional agent description. The authoring service resolves its fallback when omitted.""" + tools: Optional[list["_models.VoiceAgentTool"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional tools carried through verbatim onto the generated agent (see ``VoiceAgentTool``).""" + draft: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """(Preview) When ``true``, the generated voice agent is created as a draft — an editable, + unpublished version the caller can review and refine before publishing it via the standard + create/version path. The service defaults to ``false`` if a value is not specified by the + caller, in which case the agent is created and published normally.""" @overload def __init__( self, *, - type: str, + kind: Literal[AgentKind.VOICE], + name: str, + model_type: Optional[Union[str, "_models.VoiceModelType"]] = None, + model: Optional[str] = None, + use_case: Optional[str] = None, + goal: Optional[str] = None, + description: Optional[str] = None, + tools: Optional[list["_models.VoiceAgentTool"]] = None, + draft: Optional[bool] = None, ) -> None: ... @overload @@ -9869,66 +9887,50 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InvokeAgentInvocationsApiDispatchPayload( - RoutineDispatchPayload, discriminator="invoke_agent_invocations_api" +class GitHubIssueRoutineTrigger( + RoutineTrigger, discriminator="github_issue" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """A manual payload used to test an invocations API routine dispatch. + """A GitHub issue routine trigger. - :ivar type: The manual dispatch payload type. Required. A manual payload for an invocations API - routine dispatch. - :vartype type: str or ~azure.ai.projects.models.INVOKE_AGENT_INVOCATIONS_API - :ivar input: The JSON value sent as the complete downstream invocations input. The value is - passed through as-is and can be an object, string, number, boolean, array, or null. Required. - :vartype input: any + :ivar type: The trigger type. Required. A GitHub issue trigger. + :vartype type: str or ~azure.ai.projects.models.GITHUB_ISSUE + :ivar connection_id: The workspace connection identifier that resolves the GitHub configuration + for the trigger. Required. + :vartype connection_id: str + :ivar owner: The GitHub owner or organization that scopes which issues can fire the trigger. + Required. + :vartype owner: str + :ivar repository: The GitHub repository filter that scopes which issues can fire the trigger. + Required. + :vartype repository: str + :ivar issue_event: The GitHub issue event that fires the routine. Required. Known values are: + "opened" and "closed". + :vartype issue_event: str or ~azure.ai.projects.models.GitHubIssueEvent """ - type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The manual dispatch payload type. Required. A manual payload for an invocations API routine - dispatch.""" - input: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The JSON value sent as the complete downstream invocations input. The value is passed through - as-is and can be an object, string, number, boolean, array, or null. Required.""" - - @overload - def __init__( - self, - *, - input: Any, - ) -> 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 = RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API # type: ignore - - -class RoutineAction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Base model for a routine action. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - InvokeAgentInvocationsApiRoutineAction, InvokeAgentResponsesApiRoutineAction - - :ivar type: The action type. Required. Known values are: "invoke_agent_responses_api" and - "invoke_agent_invocations_api". - :vartype type: str or ~azure.ai.projects.models.RoutineActionType - """ - - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The action type. Required. Known values are: \"invoke_agent_responses_api\" and - \"invoke_agent_invocations_api\".""" + type: Literal[RoutineTriggerType.GITHUB_ISSUE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The trigger type. Required. A GitHub issue trigger.""" + connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The workspace connection identifier that resolves the GitHub configuration for the trigger. + Required.""" + owner: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The GitHub owner or organization that scopes which issues can fire the trigger. Required.""" + repository: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The GitHub repository filter that scopes which issues can fire the trigger. Required.""" + issue_event: Union[str, "_models.GitHubIssueEvent"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The GitHub issue event that fires the routine. Required. Known values are: \"opened\" and + \"closed\".""" @overload def __init__( self, *, - type: str, + connection_id: str, + owner: str, + repository: str, + issue_event: Union[str, "_models.GitHubIssueEvent"], ) -> None: ... @overload @@ -9940,49 +9942,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RoutineTriggerType.GITHUB_ISSUE # type: ignore -class InvokeAgentInvocationsApiRoutineAction( - RoutineAction, discriminator="invoke_agent_invocations_api" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Dispatches a routine through the raw invocations API. Exactly one of agent_name or - agent_endpoint_id must be provided. +class TelemetryEndpointAuth(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Authentication configuration for a telemetry endpoint. - :ivar type: The action type. Required. Dispatches through the raw invocations API. - :vartype type: str or ~azure.ai.projects.models.INVOKE_AGENT_INVOCATIONS_API - :ivar agent_name: The project-scoped agent name for routine dispatch. - :vartype agent_name: str - :ivar agent_endpoint_id: Legacy endpoint-scoped agent identifier for routine dispatch. - :vartype agent_endpoint_id: str - :ivar input: Static JSON value sent as the complete downstream input when the routine fires. - The value is passed through as-is; no templating is applied. - :vartype input: any - :ivar session_id: An optional existing hosted-agent session identifier to continue during the - downstream dispatch. - :vartype session_id: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + HeaderTelemetryEndpointAuth + + :ivar type: The authentication type. Required. "header" + :vartype type: str or ~azure.ai.projects.models.TelemetryEndpointAuthType """ - type: Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The action type. Required. Dispatches through the raw invocations API.""" - agent_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The project-scoped agent name for routine dispatch.""" - agent_endpoint_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Legacy endpoint-scoped agent identifier for routine dispatch.""" - input: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Static JSON value sent as the complete downstream input when the routine fires. The value is - passed through as-is; no templating is applied.""" - session_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An optional existing hosted-agent session identifier to continue during the downstream - dispatch.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The authentication type. Required. \"header\"""" @overload def __init__( self, *, - agent_name: Optional[str] = None, - agent_endpoint_id: Optional[str] = None, - input: Optional[Any] = None, - session_id: Optional[str] = None, + type: str, ) -> None: ... @overload @@ -9994,34 +9975,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RoutineActionType.INVOKE_AGENT_INVOCATIONS_API # type: ignore -class InvokeAgentResponsesApiDispatchPayload( - RoutineDispatchPayload, discriminator="invoke_agent_responses_api" +class HeaderTelemetryEndpointAuth( + TelemetryEndpointAuth, discriminator="header" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """A manual payload used to test a responses API routine dispatch. + """Header-based secret authentication for a telemetry endpoint. The resolved secret value is + injected as an HTTP header. - :ivar type: The manual dispatch payload type. Required. A manual payload for a responses API - routine dispatch. - :vartype type: str or ~azure.ai.projects.models.INVOKE_AGENT_RESPONSES_API - :ivar input: The JSON value sent as the complete downstream responses input. The value is - passed through as-is and can be an object, string, number, boolean, array, or null. Required. - :vartype input: any + :ivar type: The authentication type, always 'header' for header-based secret authentication. + Required. Header-based secret authentication. + :vartype type: str or ~azure.ai.projects.models.HEADER + :ivar header_name: The name of the HTTP header to inject the secret value into. Required. + :vartype header_name: str + :ivar secret_id: The identifier of the secret store or connection. Required. + :vartype secret_id: str + :ivar secret_key: The key within the secret to retrieve the authentication value. Required. + :vartype secret_key: str """ - type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The manual dispatch payload type. Required. A manual payload for a responses API routine - dispatch.""" - input: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The JSON value sent as the complete downstream responses input. The value is passed through - as-is and can be an object, string, number, boolean, array, or null. Required.""" + type: Literal[TelemetryEndpointAuthType.HEADER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The authentication type, always 'header' for header-based secret authentication. Required. + Header-based secret authentication.""" + header_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the HTTP header to inject the secret value into. Required.""" + secret_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The identifier of the secret store or connection. Required.""" + secret_key: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The key within the secret to retrieve the authentication value. Required.""" @overload def __init__( self, *, - input: Any, + header_name: str, + secret_id: str, + secret_key: str, ) -> None: ... @overload @@ -10033,49 +10022,90 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API # type: ignore + self.type = TelemetryEndpointAuthType.HEADER # type: ignore -class InvokeAgentResponsesApiRoutineAction( - RoutineAction, discriminator="invoke_agent_responses_api" +class HostedAgentDefinition( + AgentDefinition, discriminator="hosted" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Dispatches a routine through the responses API. Exactly one of agent_name or agent_endpoint_id - must be provided. + """The hosted agent definition. - :ivar type: The action type. Required. Dispatches through the responses API. - :vartype type: str or ~azure.ai.projects.models.INVOKE_AGENT_RESPONSES_API - :ivar agent_name: The project-scoped agent name for routine dispatch. - :vartype agent_name: str - :ivar agent_endpoint_id: Legacy endpoint-scoped agent identifier for routine dispatch. - :vartype agent_endpoint_id: str - :ivar input: Static JSON value sent as the complete downstream input when the routine fires. - The value is passed through as-is; no templating is applied. - :vartype input: any - :ivar conversation: An optional existing conversation identifier to continue during the - downstream dispatch. - :vartype conversation: 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. HOSTED. + :vartype kind: str or ~azure.ai.projects.models.HOSTED + :ivar cpu: The CPU configuration for the hosted agent. Required. + :vartype cpu: str + :ivar memory: The memory configuration for the hosted agent. Required. + :vartype memory: str + :ivar environment_variables: Environment variables to set in the hosted agent container. + :vartype environment_variables: dict[str, str] + :ivar container_configuration: Container-based deployment configuration. Provide this for + image-based deployments. Mutually exclusive with code_configuration — the service validates + that exactly one is set. + :vartype container_configuration: ~azure.ai.projects.models.ContainerConfiguration + :ivar protocol_versions: The protocols that the agent supports for ingress communication. + :vartype protocol_versions: list[~azure.ai.projects.models.ProtocolVersionRecord] + :ivar code_configuration: Code-based deployment configuration. Provide this for code-based + deployments. Mutually exclusive with container_configuration — the service validates that + exactly one is set. + :vartype code_configuration: ~azure.ai.projects.models.CodeConfiguration + :ivar telemetry_config: Optional customer-supplied telemetry configuration for exporting + container logs, traces, and metrics. + :vartype telemetry_config: ~azure.ai.projects.models.TelemetryConfig + :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 """ - type: Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The action type. Required. Dispatches through the responses API.""" - agent_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The project-scoped agent name for routine dispatch.""" - agent_endpoint_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Legacy endpoint-scoped agent identifier for routine dispatch.""" - input: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Static JSON value sent as the complete downstream input when the routine fires. The value is - passed through as-is; no templating is applied.""" - conversation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An optional existing conversation identifier to continue during the downstream dispatch.""" + kind: Literal[AgentKind.HOSTED] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. HOSTED.""" + cpu: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The CPU configuration for the hosted agent. Required.""" + memory: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The memory configuration for the hosted agent. Required.""" + environment_variables: Optional[dict[str, str]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Environment variables to set in the hosted agent container.""" + container_configuration: Optional["_models.ContainerConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Container-based deployment configuration. Provide this for image-based deployments. Mutually + exclusive with code_configuration — the service validates that exactly one is set.""" + protocol_versions: Optional[list["_models.ProtocolVersionRecord"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The protocols that the agent supports for ingress communication.""" + code_configuration: Optional["_models.CodeConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Code-based deployment configuration. Provide this for code-based deployments. Mutually + exclusive with container_configuration — the service validates that exactly one is set.""" + telemetry_config: Optional["_models.TelemetryConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional customer-supplied telemetry configuration for exporting container logs, traces, and + metrics.""" + session_configuration: Optional["_models.SessionConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional session defaults (for example, the idle timeout) applied to sessions created for this + agent version.""" @overload def __init__( self, *, - agent_name: Optional[str] = None, - agent_endpoint_id: Optional[str] = None, - input: Optional[Any] = None, - conversation: Optional[str] = None, + cpu: str, + memory: str, + rai_config: Optional["_models.RaiConfig"] = None, + environment_variables: Optional[dict[str, str]] = None, + container_configuration: Optional["_models.ContainerConfiguration"] = None, + protocol_versions: Optional[list["_models.ProtocolVersionRecord"]] = None, + code_configuration: Optional["_models.CodeConfiguration"] = None, + telemetry_config: Optional["_models.TelemetryConfig"] = None, + session_configuration: Optional["_models.SessionConfiguration"] = None, ) -> None: ... @overload @@ -10087,28 +10117,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RoutineActionType.INVOKE_AGENT_RESPONSES_API # type: ignore - + self.kind = AgentKind.HOSTED # type: ignore -class VoiceGreetingConfig(_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: - LlmGeneratedVoiceGreetingConfig, TemplateVoiceGreetingConfig +class HourlyRecurrenceSchedule(RecurrenceSchedule, discriminator="Hourly"): + """Hourly recurrence schedule. - :ivar type: The greeting mode. Required. Default value is None. - :vartype type: str + :ivar type: Required. Hourly recurrence pattern. + :vartype type: str or ~azure.ai.projects.models.HOURLY """ - __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[RecurrenceType.HOURLY] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Hourly recurrence pattern.""" @overload def __init__( self, - *, - type: str, ) -> None: ... @overload @@ -10120,41 +10144,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RecurrenceType.HOURLY # type: ignore -class LlmGeneratedVoiceGreetingConfig( - VoiceGreetingConfig, discriminator="llm_generated" +class HumanEvaluationPreviewRuleAction( + EvaluationRuleAction, discriminator="humanEvaluationPreview" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """A greeting authored by the session model from a scoped opening-turn prompt. + """Evaluation rule action for human evaluation. - :ivar type: Required. Default value is "llm_generated". - :vartype type: str - :ivar prompt: The Handlebars prompt that guides the opening turn. Required. - :vartype prompt: str - :ivar tool_choice: The tool-selection policy for the opening response. Defaults to ``none``. 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 type: Required. Human evaluation preview. + :vartype type: str or ~azure.ai.projects.models.HUMAN_EVALUATION_PREVIEW + :ivar template_id: Human evaluation template Id. Required. + :vartype template_id: str """ - type: Literal["llm_generated"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Default value is \"llm_generated\".""" - prompt: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Handlebars prompt that guides the opening turn. Required.""" - tool_choice: Optional["_unions.VoiceAgentToolChoice"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The tool-selection policy for the opening response. Defaults to ``none``. Is one of the - following types: Literal[\"none\"], Literal[\"auto\"], Literal[\"required\"], - ToolChoiceFunction, ToolChoiceMCP""" + type: Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Human evaluation preview.""" + template_id: str = rest_field(name="templateId", visibility=["read", "create", "update", "delete", "query"]) + """Human evaluation template Id. Required.""" @overload def __init__( self, *, - prompt: str, - tool_choice: Optional["_unions.VoiceAgentToolChoice"] = None, + template_id: str, ) -> None: ... @overload @@ -10166,16 +10179,93 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "llm_generated" # type: ignore + self.type = EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW # type: ignore -class LocalShellToolParam( - Tool, discriminator="local_shell" +class HybridSearchOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """HybridSearchOptions. + + :ivar embedding_weight: The weight of the embedding in the reciprocal ranking fusion. Required. + :vartype embedding_weight: float + :ivar text_weight: The weight of the text in the reciprocal ranking fusion. Required. + :vartype text_weight: float + """ + + embedding_weight: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The weight of the embedding in the reciprocal ranking fusion. Required.""" + text_weight: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The weight of the text in the reciprocal ranking fusion. Required.""" + + @overload + def __init__( + self, + *, + embedding_weight: float, + text_weight: 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 ImageGenTool( + Tool, discriminator="image_generation" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Local shell tool. + """Image generation 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 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"], str + :vartype model: 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"], + 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: Background type for the generated image. One of ``transparent``, ``opaque``, + or ``auto``. 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 @@ -10186,8 +10276,66 @@ class LocalShellToolParam( :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.""" + 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"], 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\"], str""" + quality: Optional[Literal["low", "medium", "high", "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\"]""" + 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""" + 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"] + ) + """Background type for the generated image. One of ``transparent``, ``opaque``, or ``auto``. + 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"]) @@ -10201,6 +10349,21 @@ class LocalShellToolParam( def __init__( self, *, + model: Optional[ + Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], Literal["gpt-image-1.5"], str] + ] = None, + quality: Optional[Literal["low", "medium", "high", "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, @@ -10215,26 +10378,63 @@ 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 = ToolType.IMAGE_GENERATION # type: ignore -class LocalSkillParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """LocalSkillParam. +class ImageGenToolInputImageMask(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ImageGenToolInputImageMask. + + :ivar image_url: + :vartype image_url: str + :ivar file_id: + :vartype file_id: str + """ + + image_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + file_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + image_url: Optional[str] = None, + 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 InlineSkillParam( + ContainerSkill, discriminator="inline" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """InlineSkillParam. + :ivar type: Defines an inline skill for this request. Required. INLINE. + :vartype type: str or ~azure.ai.projects.models.INLINE :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 source: Inline skill payload. Required. + :vartype source: ~azure.ai.projects.models.InlineSkillSourceParam """ + type: Literal[ContainerSkillType.INLINE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Defines an inline skill for this request. Required. 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.""" - path: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The path to the directory containing the skill. Required.""" + source: "_models.InlineSkillSourceParam" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Inline skill payload. Required.""" @overload def __init__( @@ -10242,7 +10442,7 @@ def __init__( *, name: str, description: str, - path: str, + source: "_models.InlineSkillSourceParam", ) -> None: ... @overload @@ -10254,33 +10454,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ContainerSkillType.INLINE # type: ignore -class LogProbProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A log probability object. +class InlineSkillSourceParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Inline skill payload. - :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 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 """ - 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.""" + 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, *, - token: str, - logprob: float, - bytes: list[int], + data: str, ) -> None: ... @overload @@ -10292,43 +10494,48 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["base64"] = "base64" + self.media_type: Literal["application/zip"] = "application/zip" -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 Insight(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The response body for cluster insights. - :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 insight_id: The unique identifier for the insights report. Required. + :vartype insight_id: str + :ivar metadata: Metadata about the insights report. Required. + :vartype metadata: ~azure.ai.projects.models.InsightsMetadata + :ivar state: The current state of the insights. Required. Known values are: "NotStarted", + "Running", "Succeeded", "Failed", and "Canceled". + :vartype state: str or ~azure.ai.projects.models.OperationState + :ivar display_name: User friendly display name for the insight. Required. + :vartype display_name: str + :ivar request: Request for the insights analysis. Required. + :vartype request: ~azure.ai.projects.models.InsightRequest + :ivar result: The result of the insights report. + :vartype result: ~azure.ai.projects.models.InsightResult """ - 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.""" + insight_id: str = rest_field(name="id", visibility=["read"]) + """The unique identifier for the insights report. Required.""" + metadata: "_models.InsightsMetadata" = rest_field(visibility=["read"]) + """Metadata about the insights report. Required.""" + state: Union[str, "_models.OperationState"] = rest_field(visibility=["read"]) + """The current state of the insights. Required. Known values are: \"NotStarted\", \"Running\", + \"Succeeded\", \"Failed\", and \"Canceled\".""" + display_name: str = rest_field(name="displayName", visibility=["read", "create", "update", "delete", "query"]) + """User friendly display name for the insight. Required.""" + request: "_models.InsightRequest" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Request for the insights analysis. Required.""" + result: Optional["_models.InsightResult"] = rest_field(visibility=["read"]) + """The result of the insights report.""" @overload def __init__( self, *, - rank: Optional[int] = None, - alpha: Optional[int] = None, - target_modules: Optional[list[str]] = None, - dropout: Optional[float] = None, + display_name: str, + request: "_models.InsightRequest", ) -> None: ... @overload @@ -10342,27 +10549,64 @@ 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. +class InsightCluster(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A cluster of analysis samples. - :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 id: The id of the analysis cluster. Required. + :vartype id: str + :ivar label: Label for the cluster. Required. + :vartype label: str + :ivar suggestion: Suggestion for the cluster. Required. + :vartype suggestion: str + :ivar suggestion_title: The title of the suggestion for the cluster. Required. + :vartype suggestion_title: str + :ivar description: Description of the analysis cluster. Required. + :vartype description: str + :ivar weight: The weight of the analysis cluster. This indicate number of samples in the + cluster. Required. + :vartype weight: int + :ivar sub_clusters: List of subclusters within this cluster. Empty if no subclusters exist. + :vartype sub_clusters: list[~azure.ai.projects.models.InsightCluster] + :ivar samples: List of samples that belong to this cluster. Empty if samples are part of + subclusters. + :vartype samples: list[~azure.ai.projects.models.InsightSample] """ - 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.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The id of the analysis cluster. Required.""" + label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Label for the cluster. Required.""" + suggestion: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Suggestion for the cluster. Required.""" + suggestion_title: str = rest_field( + name="suggestionTitle", visibility=["read", "create", "update", "delete", "query"] + ) + """The title of the suggestion for the cluster. Required.""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Description of the analysis cluster. Required.""" + weight: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The weight of the analysis cluster. This indicate number of samples in the cluster. Required.""" + sub_clusters: Optional[list["_models.InsightCluster"]] = rest_field( + name="subClusters", visibility=["read", "create", "update", "delete", "query"] + ) + """List of subclusters within this cluster. Empty if no subclusters exist.""" + samples: Optional[list["_models.InsightSample"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of samples that belong to this cluster. Empty if samples are part of subclusters.""" @overload def __init__( self, *, - blueprint_id: str, + id: str, # pylint: disable=redefined-builtin + label: str, + suggestion: str, + suggestion_title: str, + description: str, + weight: int, + sub_clusters: Optional[list["_models.InsightCluster"]] = None, + samples: Optional[list["_models.InsightSample"]] = None, ) -> None: ... @overload @@ -10374,42 +10618,28 @@ 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" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Managed Azure AI Search Index Definition. +class InsightModelConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Configuration of the model used in the insight generation. - :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 model_deployment_name: The model deployment to be evaluated. Accepts either the + deployment name alone or with the connection name as '{connectionName}/'. + Required. + :vartype model_deployment_name: 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.""" + model_deployment_name: str = rest_field( + name="modelDeploymentName", visibility=["read", "create", "update", "delete", "query"] + ) + """The model deployment to be evaluated. Accepts either the deployment name alone or with the + connection name as '{connectionName}/'. Required.""" @overload def __init__( self, *, - vector_store_id: str, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, + model_deployment_name: str, ) -> None: ... @overload @@ -10421,41 +10651,32 @@ 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 MCPListToolsTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """MCP list tools tool. +class InsightScheduleTask( + ScheduleTask, discriminator="Insight" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Insight task for the schedule. - :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 configuration: Configuration for the task. + :vartype configuration: dict[str, str] + :ivar type: Required. Insight task. + :vartype type: str or ~azure.ai.projects.models.INSIGHT + :ivar insight: The insight payload. Required. + :vartype insight: ~azure.ai.projects.models.Insight """ - 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"] - ) + type: Literal[ScheduleTaskType.INSIGHT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Insight task.""" + insight: "_models.Insight" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The insight payload. Required.""" @overload def __init__( self, *, - name: str, - input_schema: "_models.MCPListToolsToolInputSchema", - description: Optional[str] = None, - annotations: Optional["_models.MCPListToolsToolAnnotations"] = None, + insight: "_models.Insight", + configuration: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -10467,171 +10688,85 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ScheduleTaskType.INSIGHT # type: ignore -class MCPListToolsToolAnnotations(_Model): - """MCPListToolsToolAnnotations.""" - - -class MCPListToolsToolInputSchema(_Model): - """MCPListToolsToolInputSchema.""" - +class InsightsMetadata(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Metadata about the insights. -class McpProtocolConfiguration(_Model): - """Configuration specific to the MCP protocol.""" + :ivar created_at: The timestamp when the insights were created. Required. + :vartype created_at: ~datetime.datetime + :ivar completed_at: The timestamp when the insights were completed. + :vartype completed_at: ~datetime.datetime + """ + created_at: datetime.datetime = rest_field( + name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp when the insights were created. Required.""" + completed_at: Optional[datetime.datetime] = rest_field( + name="completedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp when the insights were completed.""" -class MCPTool(Tool, discriminator="mcp"): # pylint: disable=docstring-keyword-should-match-keyword-only - """MCP tool. + @overload + def __init__( + self, + *, + created_at: datetime.datetime, + completed_at: Optional[datetime.datetime] = None, + ) -> None: ... - :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: + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ - * 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] + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class InsightSummary(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Summary of the error cluster analysis. + + :ivar sample_count: Total number of samples analyzed. Required. + :vartype sample_count: int + :ivar unique_subcluster_count: Total number of unique subcluster labels. Required. + :vartype unique_subcluster_count: int + :ivar unique_cluster_count: Total number of unique clusters. Required. + :vartype unique_cluster_count: int + :ivar method: Method used for clustering. Required. + :vartype method: str + :ivar usage: Token usage while performing clustering analysis. Required. + :vartype usage: ~azure.ai.projects.models.ClusterTokenUsage """ - 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 - `_. 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"]) + sample_count: int = rest_field(name="sampleCount", visibility=["read", "create", "update", "delete", "query"]) + """Total number of samples analyzed. Required.""" + unique_subcluster_count: int = rest_field( + name="uniqueSubclusterCount", 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"] + """Total number of unique subcluster labels. Required.""" + unique_cluster_count: int = rest_field( + name="uniqueClusterCount", visibility=["read", "create", "update", "delete", "query"] ) - """Deprecated. This property is deprecated and will be removed in a future version.""" + """Total number of unique clusters. Required.""" + method: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Method used for clustering. Required.""" + usage: "_models.ClusterTokenUsage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Token usage while performing clustering analysis. 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, + sample_count: int, + unique_subcluster_count: int, + unique_cluster_count: int, + method: str, + usage: "_models.ClusterTokenUsage", ) -> None: ... @overload @@ -10643,163 +10778,37 @@ 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 MCPToolboxTool(ToolboxTool, discriminator="mcp"): # pylint: disable=docstring-keyword-should-match-keyword-only - """An MCP tool stored in a toolbox. +class InvocationsProtocolConfiguration(_Model): + """Configuration specific to the invocations protocol.""" - :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 `_. 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 +class InvocationsWsProtocolConfiguration(_Model): + """Configuration specific to the WebSocket-based invocations protocol.""" + + +class RoutineDispatchPayload(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Base model for a manual dispatch payload. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + InvokeAgentInvocationsApiDispatchPayload, InvokeAgentResponsesApiDispatchPayload + + :ivar type: The manual dispatch payload type. Required. Known values are: + "invoke_agent_responses_api" and "invoke_agent_invocations_api". + :vartype type: str or ~azure.ai.projects.models.RoutineDispatchPayloadType """ - 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 - `_. 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.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The manual dispatch payload type. Required. Known values are: \"invoke_agent_responses_api\" + and \"invoke_agent_invocations_api\".""" @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, + type: str, ) -> None: ... @overload @@ -10811,35 +10820,33 @@ 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 MCPToolFilter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """MCP tool filter. +class InvokeAgentInvocationsApiDispatchPayload( + RoutineDispatchPayload, discriminator="invoke_agent_invocations_api" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A manual payload used to test an invocations API routine dispatch. - :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 manual dispatch payload type. Required. A manual payload for an invocations API + routine dispatch. + :vartype type: str or ~azure.ai.projects.models.INVOKE_AGENT_INVOCATIONS_API + :ivar input: The JSON value sent as the complete downstream invocations input. The value is + passed through as-is and can be an object, string, number, boolean, array, or null. Required. + :vartype input: any """ - 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[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The manual dispatch payload type. Required. A manual payload for an invocations API routine + dispatch.""" + input: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The JSON value sent as the complete downstream invocations input. The value is passed through + as-is and can be an object, string, number, boolean, array, or null. Required.""" @overload def __init__( self, *, - tool_names: Optional[list[str]] = None, - read_only: Optional[bool] = None, + input: Any, ) -> None: ... @overload @@ -10851,26 +10858,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API # type: ignore -class MCPToolRequireApproval(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """MCPToolRequireApproval. +class RoutineAction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Base model for a routine action. - :ivar always: - :vartype always: ~azure.ai.projects.models.MCPToolFilter - :ivar never: - :vartype never: ~azure.ai.projects.models.MCPToolFilter + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + InvokeAgentInvocationsApiRoutineAction, InvokeAgentResponsesApiRoutineAction + + :ivar type: The action type. Required. Known values are: "invoke_agent_responses_api" and + "invoke_agent_invocations_api". + :vartype type: str or ~azure.ai.projects.models.RoutineActionType """ - always: Optional["_models.MCPToolFilter"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - never: Optional["_models.MCPToolFilter"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The action type. Required. Known values are: \"invoke_agent_responses_api\" and + \"invoke_agent_invocations_api\".""" @overload def __init__( self, *, - always: Optional["_models.MCPToolFilter"] = None, - never: Optional["_models.MCPToolFilter"] = None, + type: str, ) -> None: ... @overload @@ -10884,30 +10895,140 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -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 InvokeAgentInvocationsApiRoutineAction( + RoutineAction, discriminator="invoke_agent_invocations_api" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Dispatches a routine through the raw invocations API. Exactly one of agent_name or + agent_endpoint_id must be provided. + + :ivar type: The action type. Required. Dispatches through the raw invocations API. + :vartype type: str or ~azure.ai.projects.models.INVOKE_AGENT_INVOCATIONS_API + :ivar agent_name: The project-scoped agent name for routine dispatch. + :vartype agent_name: str + :ivar agent_endpoint_id: Legacy endpoint-scoped agent identifier for routine dispatch. + :vartype agent_endpoint_id: str + :ivar input: Static JSON value sent as the complete downstream input when the routine fires. + The value is passed through as-is; no templating is applied. + :vartype input: any + :ivar session_id: An optional existing hosted-agent session identifier to continue during the + downstream dispatch. + :vartype session_id: str + """ + + type: Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The action type. Required. Dispatches through the raw invocations API.""" + agent_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The project-scoped agent name for routine dispatch.""" + agent_endpoint_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Legacy endpoint-scoped agent identifier for routine dispatch.""" + input: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Static JSON value sent as the complete downstream input when the routine fires. The value is + passed through as-is; no templating is applied.""" + session_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional existing hosted-agent session identifier to continue during the downstream + dispatch.""" + + @overload + def __init__( + self, + *, + agent_name: Optional[str] = None, + agent_endpoint_id: Optional[str] = None, + input: Optional[Any] = None, + session_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 = RoutineActionType.INVOKE_AGENT_INVOCATIONS_API # type: ignore + + +class InvokeAgentResponsesApiDispatchPayload( + RoutineDispatchPayload, discriminator="invoke_agent_responses_api" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A manual payload used to test a responses API routine dispatch. + + :ivar type: The manual dispatch payload type. Required. A manual payload for a responses API + routine dispatch. + :vartype type: str or ~azure.ai.projects.models.INVOKE_AGENT_RESPONSES_API + :ivar input: The JSON value sent as the complete downstream responses input. The value is + passed through as-is and can be an object, string, number, boolean, array, or null. Required. + :vartype input: any + """ + + type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The manual dispatch payload type. Required. A manual payload for a responses API routine + dispatch.""" + input: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The JSON value sent as the complete downstream responses input. The value is passed through + as-is and can be an object, string, number, boolean, array, or null. Required.""" + + @overload + def __init__( + self, + *, + input: Any, + ) -> 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 = RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API # type: ignore + + +class InvokeAgentResponsesApiRoutineAction( + RoutineAction, discriminator="invoke_agent_responses_api" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Dispatches a routine through the responses API. Exactly one of agent_name or agent_endpoint_id + must be provided. - :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 type: The action type. Required. Dispatches through the responses API. + :vartype type: str or ~azure.ai.projects.models.INVOKE_AGENT_RESPONSES_API + :ivar agent_name: The project-scoped agent name for routine dispatch. + :vartype agent_name: str + :ivar agent_endpoint_id: Legacy endpoint-scoped agent identifier for routine dispatch. + :vartype agent_endpoint_id: str + :ivar input: Static JSON value sent as the complete downstream input when the routine fires. + The value is passed through as-is; no templating is applied. + :vartype input: any + :ivar conversation: An optional existing conversation identifier to continue during the + downstream dispatch. + :vartype conversation: str """ - 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.""" + type: Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The action type. Required. Dispatches through the responses API.""" + agent_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The project-scoped agent name for routine dispatch.""" + agent_endpoint_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Legacy endpoint-scoped agent identifier for routine dispatch.""" + input: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Static JSON value sent as the complete downstream input when the routine fires. The value is + passed through as-is; no templating is applied.""" + conversation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional existing conversation identifier to continue during the downstream dispatch.""" @overload def __init__( self, *, - kind: Union[str, "_models.MemoryOperationKind"], - memory_item: "_models.MemoryItem", + agent_name: Optional[str] = None, + agent_endpoint_id: Optional[str] = None, + input: Optional[Any] = None, + conversation: Optional[str] = None, ) -> None: ... @overload @@ -10919,23 +11040,44 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RoutineActionType.INVOKE_AGENT_RESPONSES_API # type: ignore -class MemorySearchItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A retrieved memory item from memory search. +class LocalShellToolParam( + Tool, discriminator="local_shell" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Local shell tool. - :ivar memory_item: Retrieved memory item. Required. - :vartype memory_item: ~azure.ai.projects.models.MemoryItem + :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] """ - memory_item: "_models.MemoryItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Retrieved memory item. 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, *, - memory_item: "_models.MemoryItem", + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -10947,23 +11089,34 @@ 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 MemorySearchOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Memory search options. +class LocalSkillParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LocalSkillParam. - :ivar max_memories: Maximum number of memory items to return. - :vartype max_memories: int + :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 """ - max_memories: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Maximum number of memory items to return.""" + 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, *, - max_memories: Optional[int] = None, + name: str, + description: str, + path: str, ) -> None: ... @overload @@ -10977,50 +11130,31 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemorySearchPreviewTool( - Tool, discriminator="memory_search_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A tool for integrating memories into the agent. +class LogProbProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A log probability object. - :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 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[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.""" + 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, *, - memory_store_name: str, - scope: str, - search_options: Optional["_models.MemorySearchOptions"] = None, - update_delay: Optional[int] = None, + token: str, + logprob: float, + bytes: list[int], ) -> None: ... @overload @@ -11032,28 +11166,43 @@ 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 - -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 LoraConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Adapter-specific metadata for LoRA models. Drives serving engine configuration at deployment + time. - :ivar kind: The kind of the memory store. Required. "default" - :vartype kind: str or ~azure.ai.projects.models.MemoryStoreKind + :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 """ - __mapping__: dict[str, _Model] = {} - kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) - """The kind of the memory store. Required. \"default\"""" + 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, *, - kind: str, + rank: Optional[int] = None, + alpha: Optional[int] = None, + target_modules: Optional[list[str]] = None, + dropout: Optional[float] = None, ) -> None: ... @overload @@ -11067,40 +11216,27 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryStoreDefaultDefinition( - MemoryStoreDefinition, discriminator="default" +class ManagedAgentIdentityBlueprintReference( + AgentBlueprintReference, discriminator="ManagedAgentIdentityBlueprint" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Default memory store implementation. + """ManagedAgentIdentityBlueprintReference. - :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: 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 """ - 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[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, *, - chat_model: str, - embedding_model: str, - options: Optional["_models.MemoryStoreDefaultOptions"] = None, + blueprint_id: str, ) -> None: ... @overload @@ -11109,56 +11245,45 @@ 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 = MemoryStoreKind.DEFAULT # type: ignore - - -class MemoryStoreDefaultOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Default memory store configurations. - - :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 + + 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 """ - 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``.""" + 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, *, - 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, + vector_store_id: str, + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -11170,41 +11295,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 MemoryStoreDeleteScopeResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Response for deleting memories from a scope. +class MCPListToolsTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """MCP list tools tool. - :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. + :ivar name: The name of the tool. 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 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 """ - object: Literal[MemoryStoreObjectType.MEMORY_STORE_SCOPE_DELETED] = rest_field( + 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"] ) - """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, *, - object: Literal[MemoryStoreObjectType.MEMORY_STORE_SCOPE_DELETED], name: str, - scope: str, - deleted: bool, + input_schema: "_models.MCPListToolsToolInputSchema", + description: Optional[str] = None, + annotations: Optional["_models.MCPListToolsToolAnnotations"] = None, ) -> None: ... @overload @@ -11218,63 +11343,169 @@ 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 MCPListToolsToolAnnotations(_Model): + """MCPListToolsToolAnnotations.""" - :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 + +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 `_. 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] """ - object: Literal[MemoryStoreObjectType.MEMORY_STORE] = rest_field( + 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 + `_. 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 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" + """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"] ) - """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" + require_approval: Optional[Union["_models.MCPToolRequireApproval", Literal["always"], Literal["never"]]] = ( + rest_field(visibility=["read", "create", "update", "delete", "query"]) ) - """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.""" + """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, *, - 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, + 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 @@ -11286,52 +11517,163 @@ 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 MemoryStoreOperationUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Usage statistics of a memory store operation. +class MCPToolboxTool(ToolboxTool, discriminator="mcp"): # pylint: disable=docstring-keyword-should-match-keyword-only + """An MCP tool stored in a toolbox. - :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 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 `_. 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 """ - 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( + 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 + `_. 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"] ) - """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( + """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"] ) - """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.""" + 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, *, - embedding_tokens: int, - input_tokens: int, - input_tokens_details: "_models.ResponseUsageInputTokensDetails", - output_tokens: int, - output_tokens_details: "_models.ResponseUsageOutputTokensDetails", - total_tokens: int, + 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, ) -> None: ... @overload @@ -11343,35 +11685,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 MemoryStoreSearchResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Memory search response. +class MCPToolFilter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """MCP tool filter. - :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 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 """ - 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.""" + 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, *, - search_id: str, - memories: list["_models.MemorySearchItem"], - usage: "_models.MemoryStoreOperationUsage", + tool_names: Optional[list[str]] = None, + read_only: Optional[bool] = None, ) -> None: ... @overload @@ -11385,29 +11727,24 @@ 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 MCPToolRequireApproval(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """MCPToolRequireApproval. - :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 always: + :vartype always: ~azure.ai.projects.models.MCPToolFilter + :ivar never: + :vartype never: ~azure.ai.projects.models.MCPToolFilter """ - 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.""" + 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, *, - memory_operations: list["_models.MemoryOperation"], - usage: "_models.MemoryStoreOperationUsage", + always: Optional["_models.MCPToolFilter"] = None, + never: Optional["_models.MCPToolFilter"] = None, ) -> None: ... @overload @@ -11421,51 +11758,30 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryStoreUpdateResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Provides the status of a memory store update operation. +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 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 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 """ - 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( + kind: Union[str, "_models.MemoryOperationKind"] = 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\".""" + """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, *, - update_id: str, - status: Union[str, "_models.MemoryStoreUpdateStatus"], - superseded_by: Optional[str] = None, - result: Optional["_models.MemoryStoreUpdateCompletedResult"] = None, - error: Optional["_models.ApiError"] = None, + kind: Union[str, "_models.MemoryOperationKind"], + memory_item: "_models.MemoryItem", ) -> None: ... @overload @@ -11479,40 +11795,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -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 MicrosoftFabricPreviewTool( - Tool, discriminator="fabric_dataagent_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """The input definition information for a Microsoft Fabric tool as used to configure an agent. +class MemorySearchItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A retrieved memory item from memory search. - :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 memory_item: Retrieved memory item. Required. + :vartype memory_item: ~azure.ai.projects.models.MemoryItem """ - 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.""" + memory_item: "_models.MemoryItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Retrieved memory item. Required.""" @overload def __init__( self, *, - fabric_dataagent_preview: "_models.FabricDataAgentToolParameters", + memory_item: "_models.MemoryItem", ) -> None: ... @overload @@ -11524,24 +11821,23 @@ 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 -class ModelCredentialRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Request to fetch credentials for a model asset. +class MemorySearchOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Memory search options. - :ivar blob_uri: Blob URI of the model asset to fetch credentials for. Required. - :vartype blob_uri: str + :ivar max_memories: Maximum number of memory items to return. + :vartype max_memories: int """ - blob_uri: str = rest_field(name="blobUri", visibility=["read", "create", "update", "delete", "query"]) - """Blob URI of the model asset to fetch credentials for. Required.""" + max_memories: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Maximum number of memory items to return.""" @overload def __init__( self, *, - blob_uri: str, + max_memories: Optional[int] = None, ) -> None: ... @overload @@ -11555,45 +11851,50 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ModelDeployment(Deployment, discriminator="ModelDeployment"): - """Model Deployment Definition. +class MemorySearchPreviewTool( + Tool, discriminator="memory_search_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A tool for integrating memories into the agent. - :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 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[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.""" + 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 @@ -11605,44 +11906,28 @@ 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 + self.type = ToolType.MEMORY_SEARCH_PREVIEW # type: ignore -class ModelDeploymentSku(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Sku information. +class MemoryStoreDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Base definition for memory store configurations. - :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 + 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 """ - 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.""" + __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, *, - capacity: int, - family: str, - name: str, - size: str, - tier: str, + kind: str, ) -> None: ... @overload @@ -11656,40 +11941,40 @@ 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. - - :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 - """ +class MemoryStoreDefaultDefinition( + MemoryStoreDefinition, discriminator="default" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Default memory store implementation. - 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.""" + :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 + """ + + 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, *, - pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE], - pending_upload_id: Optional[str] = None, - connection_name: Optional[str] = None, + chat_model: str, + embedding_model: str, + options: Optional["_models.MemoryStoreDefaultOptions"] = None, ) -> None: ... @overload @@ -11701,47 +11986,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 ModelPendingUploadResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Represents the response for a model pending upload request. +class MemoryStoreDefaultOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Default memory store configurations. - :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 + :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 """ - 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"] + 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 type of pending upload. Only TemporaryBlobReference is supported for models. Required. - Temporary blob reference.""" + """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, *, - blob_reference: "_models.BlobReference", - pending_upload_id: str, - pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE], - version: Optional[str] = None, + 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 @@ -11755,37 +12046,39 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -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 MemoryStoreDeleteScopeResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Response for deleting memories from a scope. - :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 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 """ - 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.""" + 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, *, - temperature: Optional[float] = None, - top_p: Optional[float] = None, - seed: Optional[int] = None, - max_completion_tokens: Optional[int] = None, + object: Literal[MemoryStoreObjectType.MEMORY_STORE_SCOPE_DELETED], + name: str, + scope: str, + deleted: bool, ) -> None: ... @overload @@ -11799,29 +12092,63 @@ 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 MemoryStoreDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A memory store that can store and retrieve user memories. - :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 + :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 """ - source_type: Optional[Union[str, "_models.FoundryModelSourceType"]] = rest_field( - name="sourceType", visibility=["read", "create", "update", "delete", "query"] + object: Literal[MemoryStoreObjectType.MEMORY_STORE] = rest_field( + 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.""" + """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, *, - source_type: Optional[Union[str, "_models.FoundryModelSourceType"]] = None, - job_id: Optional[str] = None, + 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 @@ -11835,78 +12162,50 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ModelVersion(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Model Version Definition. +class MemoryStoreOperationUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Usage statistics of a memory store operation. - :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] + :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 """ - 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"] + 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"] ) - """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.""" + """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, *, - 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, + embedding_tokens: int, + input_tokens: int, + input_tokens_details: "_models.ResponseUsageInputTokensDetails", + output_tokens: int, + output_tokens_details: "_models.ResponseUsageOutputTokensDetails", + total_tokens: int, ) -> None: ... @overload @@ -11920,29 +12219,33 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MonthlyRecurrenceSchedule( - RecurrenceSchedule, discriminator="Monthly" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Monthly recurrence schedule. +class MemoryStoreSearchResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Memory search response. - :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 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[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.""" + 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, *, - days_of_month: list[int], + search_id: str, + memories: list["_models.MemorySearchItem"], + usage: "_models.MemoryStoreOperationUsage", ) -> None: ... @overload @@ -11954,43 +12257,31 @@ 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 MemoryStoreUpdateCompletedResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Memory update result. - :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 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[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( + memory_operations: list["_models.MemoryOperation"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The function/custom tools available inside this namespace. 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, *, - name: str, - description: str, - tools: list[Union["_models.FunctionToolParam", "_models.CustomToolParam"]], + memory_operations: list["_models.MemoryOperation"], + usage: "_models.MemoryStoreOperationUsage", ) -> None: ... @overload @@ -12002,22 +12293,53 @@ 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 MemoryStoreUpdateResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Provides the status of a memory store update operation. - :ivar type: The credential type. Required. No credential. - :vartype type: str or ~azure.ai.projects.models.NONE + :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 """ - type: Literal[CredentialType.NONE] = rest_discriminator(name="type", visibility=["read"]) # type: ignore - """The credential type. Required. No credential.""" + 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 @@ -12029,97 +12351,204 @@ 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 OmitPropertiesRealtimeResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The template for omitting properties. +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. - :ivar id: The unique ID of the response, will look like ``resp_1234``. - :vartype id: str - :ivar object: The object type, must be ``realtime.response``. Default value is - "realtime.response". - :vartype object: str - :ivar status: The final status of the response (``completed``, ``cancelled``, ``failed``, or - ``incomplete``, ``in_progress``). Is one of the following types: Literal["completed"], - Literal["cancelled"], Literal["failed"], Literal["incomplete"], Literal["in_progress"] - :vartype status: str or str or str or str or str - :ivar status_details: Additional details about the status. - :vartype status_details: ~azure.ai.projects.models.RealtimeResponseStatusDetails - :ivar usage: Usage statistics for the Response, this will correspond to billing. A Realtime API - session will maintain a conversation context and append new Items to the Conversation, thus - output from previous turns (text and audio tokens) will become the input for later turns. - :vartype usage: ~azure.ai.projects.models.RealtimeResponseUsage - :ivar conversation_id: Which conversation the response is added to, determined by the - ``conversation`` field in the ``response.create`` event. If ``auto``, the response will be - added to the default conversation and the value of ``conversation_id`` will be an id like - ``conv_1234``. If ``none``, the response will not be added to any conversation and the value of - ``conversation_id`` will be ``null``. If responses are being triggered automatically by VAD the - response will be added to the default conversation. - :vartype conversation_id: str - :ivar output_modalities: The set of modalities the model used to respond, currently the only - possible values are ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text - transcript. Setting the output to mode ``text`` will disable audio output from the model. - :vartype output_modalities: list[str or str] - :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, - inclusive of tool calls, that was used in this response. Is either a int type or a - Literal["inf"] type. - :vartype max_output_tokens: int or str """ - id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the response, will look like ``resp_1234``.""" - object: Optional[Literal["realtime.response"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The object type, must be ``realtime.response``. Default value is \"realtime.response\".""" - status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The final status of the response (``completed``, ``cancelled``, ``failed``, or ``incomplete``, - ``in_progress``). Is one of the following types: Literal[\"completed\"], - Literal[\"cancelled\"], Literal[\"failed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" - status_details: Optional["_models.RealtimeResponseStatusDetails"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Additional details about the status.""" - usage: Optional["_models.RealtimeResponseUsage"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Usage statistics for the Response, this will correspond to billing. A Realtime API session will - maintain a conversation context and append new Items to the Conversation, thus output from - previous turns (text and audio tokens) will become the input for later turns.""" - conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Which conversation the response is added to, determined by the ``conversation`` field in the - ``response.create`` event. If ``auto``, the response will be added to the default conversation - and the value of ``conversation_id`` will be an id like ``conv_1234``. If ``none``, the - response will not be added to any conversation and the value of ``conversation_id`` will be - ``null``. If responses are being triggered automatically by VAD the response will be added to - the default conversation.""" - output_modalities: Optional[list[Literal["text", "audio"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The set of modalities the model used to respond, currently the only possible values are - ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text transcript. Setting the - output to mode ``text`` will disable audio output from the model.""" - max_output_tokens: Optional[Union[int, Literal["inf"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + +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 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.""" + + @overload + def __init__( + self, + *, + resource_app_id: str, + scopes: list[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 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 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 + """ + + 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.""" + + @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, + ) -> 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 Microsoft365PublishResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Response from publishing an agent to Microsoft 365 / Microsoft Teams. + + :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 + """ + + 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"] ) - """Maximum number of output tokens for a single assistant response, inclusive of tool calls, that - was used in this response. Is either a int type or a Literal[\"inf\"] type.""" + """The Microsoft Teams app id of the published app.""" @overload def __init__( self, *, - id: Optional[str] = None, # pylint: disable=redefined-builtin - object: Optional[Literal["realtime.response"]] = None, - status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] = None, - status_details: Optional["_models.RealtimeResponseStatusDetails"] = None, - usage: Optional["_models.RealtimeResponseUsage"] = None, - conversation_id: Optional[str] = None, - output_modalities: Optional[list[Literal["text", "audio"]]] = None, - max_output_tokens: Optional[Union[int, Literal["inf"]]] = None, + title_id: Optional[str] = None, + teams_app_id: Optional[str] = None, ) -> None: ... @overload @@ -12133,98 +12562,31 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OmitPropertiesRealtimeResponse1(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The template for omitting properties. +class MicrosoftFabricPreviewTool( + Tool, discriminator="fabric_dataagent_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The input definition information for a Microsoft Fabric tool as used to configure an agent. - :ivar id: The unique ID of the response, will look like ``resp_1234``. - :vartype id: str - :ivar object: The object type, must be ``realtime.response``. Default value is - "realtime.response". - :vartype object: str - :ivar status: The final status of the response (``completed``, ``cancelled``, ``failed``, or - ``incomplete``, ``in_progress``). Is one of the following types: Literal["completed"], - Literal["cancelled"], Literal["failed"], Literal["incomplete"], Literal["in_progress"] - :vartype status: str or str or str or str or str - :ivar status_details: Additional details about the status. - :vartype status_details: ~azure.ai.projects.models.RealtimeResponseStatusDetails - :ivar metadata: - :vartype metadata: ~azure.ai.projects.models.Metadata - :ivar usage: Usage statistics for the Response, this will correspond to billing. A Realtime API - session will maintain a conversation context and append new Items to the Conversation, thus - output from previous turns (text and audio tokens) will become the input for later turns. - :vartype usage: ~azure.ai.projects.models.RealtimeResponseUsage - :ivar conversation_id: Which conversation the response is added to, determined by the - ``conversation`` field in the ``response.create`` event. If ``auto``, the response will be - added to the default conversation and the value of ``conversation_id`` will be an id like - ``conv_1234``. If ``none``, the response will not be added to any conversation and the value of - ``conversation_id`` will be ``null``. If responses are being triggered automatically by VAD the - response will be added to the default conversation. - :vartype conversation_id: str - :ivar output_modalities: The set of modalities the model used to respond, currently the only - possible values are ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text - transcript. Setting the output to mode ``text`` will disable audio output from the model. - :vartype output_modalities: list[str or str] - :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, - inclusive of tool calls, that was used in this response. Is either a int type or a - Literal["inf"] type. - :vartype max_output_tokens: int or str + :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 """ - id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the response, will look like ``resp_1234``.""" - object: Optional[Literal["realtime.response"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The object type, must be ``realtime.response``. Default value is \"realtime.response\".""" - status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The final status of the response (``completed``, ``cancelled``, ``failed``, or ``incomplete``, - ``in_progress``). Is one of the following types: Literal[\"completed\"], - Literal[\"cancelled\"], Literal[\"failed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" - status_details: Optional["_models.RealtimeResponseStatusDetails"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Additional details about the status.""" - metadata: Optional["_models.Metadata"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - usage: Optional["_models.RealtimeResponseUsage"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Usage statistics for the Response, this will correspond to billing. A Realtime API session will - maintain a conversation context and append new Items to the Conversation, thus output from - previous turns (text and audio tokens) will become the input for later turns.""" - conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Which conversation the response is added to, determined by the ``conversation`` field in the - ``response.create`` event. If ``auto``, the response will be added to the default conversation - and the value of ``conversation_id`` will be an id like ``conv_1234``. If ``none``, the - response will not be added to any conversation and the value of ``conversation_id`` will be - ``null``. If responses are being triggered automatically by VAD the response will be added to - the default conversation.""" - output_modalities: Optional[list[Literal["text", "audio"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The set of modalities the model used to respond, currently the only possible values are - ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text transcript. Setting the - output to mode ``text`` will disable audio output from the model.""" - max_output_tokens: Optional[Union[int, Literal["inf"]]] = 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"] ) - """Maximum number of output tokens for a single assistant response, inclusive of tool calls, that - was used in this response. Is either a int type or a Literal[\"inf\"] type.""" + """The fabric data agent tool parameters. Required.""" @overload def __init__( self, *, - id: Optional[str] = None, # pylint: disable=redefined-builtin - object: Optional[Literal["realtime.response"]] = None, - status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] = None, - status_details: Optional["_models.RealtimeResponseStatusDetails"] = None, - metadata: Optional["_models.Metadata"] = None, - usage: Optional["_models.RealtimeResponseUsage"] = None, - conversation_id: Optional[str] = None, - output_modalities: Optional[list[Literal["text", "audio"]]] = None, - max_output_tokens: Optional[Union[int, Literal["inf"]]] = None, + fabric_dataagent_preview: "_models.FabricDataAgentToolParameters", ) -> None: ... @overload @@ -12236,34 +12598,24 @@ 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 -class OneTimeTrigger(Trigger, discriminator="OneTime"): # pylint: disable=docstring-keyword-should-match-keyword-only - """One-time trigger. +class ModelCredentialRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Request to fetch credentials for a model asset. - :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 blob_uri: Blob URI of the model asset to fetch credentials for. Required. + :vartype blob_uri: str """ - 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``.""" + 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, *, - trigger_at: datetime.datetime, - time_zone: Optional[str] = None, + blob_uri: str, ) -> None: ... @overload @@ -12275,30 +12627,96 @@ 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. +class ModelDeployment(Deployment, discriminator="ModelDeployment"): + """Model Deployment Definition. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - OpenApiAnonymousAuthDetails, OpenApiManagedAuthDetails, OpenApiProjectConnectionAuthDetails + :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 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[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, + ) -> 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 = DeploymentType.MODEL_DEPLOYMENT # type: ignore + + +class ModelDeploymentSku(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Sku information. + + :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 """ - __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\".""" + 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, *, - type: str, + capacity: int, + family: str, + name: str, + size: str, + tier: str, ) -> None: ... @overload @@ -12312,19 +12730,40 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OpenApiAnonymousAuthDetails(OpenApiAuthDetails, discriminator="anonymous"): - """Security details for OpenApi anonymous authentication. +class ModelPendingUploadRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents a request for a pending upload of a model version. - :ivar type: The object type, which is always 'anonymous'. Required. ANONYMOUS. - :vartype type: str or ~azure.ai.projects.models.ANONYMOUS + :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 """ - 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.""" + 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.""" @overload def __init__( self, + *, + pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE], + pending_upload_id: Optional[str] = None, + connection_name: Optional[str] = None, ) -> None: ... @overload @@ -12336,50 +12775,47 @@ 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 -class OpenApiFunctionDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The input definition information for an openapi function. +class ModelPendingUploadResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents the response for a model pending upload request. - :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] + :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 """ - 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.""" + 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.""" @overload def __init__( self, *, - name: str, - spec: dict[str, Any], - auth: "_models.OpenApiAuthDetails", - description: Optional[str] = None, - default_params: Optional[list[str]] = None, + blob_reference: "_models.BlobReference", + pending_upload_id: str, + pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE], + version: Optional[str] = None, ) -> None: ... @overload @@ -12393,34 +12829,37 @@ 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 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 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 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 """ - 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.""" + 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, *, - name: str, - parameters: dict[str, Any], - description: Optional[str] = None, + temperature: Optional[float] = None, + top_p: Optional[float] = None, + seed: Optional[int] = None, + max_completion_tokens: Optional[int] = None, ) -> None: ... @overload @@ -12434,29 +12873,29 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OpenApiManagedAuthDetails( - OpenApiAuthDetails, discriminator="managed_identity" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Security details for OpenApi managed_identity authentication. +class ModelSourceData(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Source information for the model. - :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 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 """ - 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"] + source_type: Optional[Union[str, "_models.FoundryModelSourceType"]] = rest_field( + name="sourceType", visibility=["read", "create", "update", "delete", "query"] ) - """Connection auth security details. Required.""" + """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, *, - security_scheme: "_models.OpenApiManagedSecurityScheme", + source_type: Optional[Union[str, "_models.FoundryModelSourceType"]] = None, + job_id: Optional[str] = None, ) -> None: ... @overload @@ -12468,24 +12907,80 @@ 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 ModelVersion(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Model Version Definition. - :ivar audience: Authentication scope for managed_identity auth type. Required. - :vartype audience: str + :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] """ - audience: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Authentication scope for managed_identity auth type. Required.""" + 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"] + ) + """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, *, - audience: str, + 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 @@ -12499,30 +12994,29 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OpenApiProjectConnectionAuthDetails( - OpenApiAuthDetails, discriminator="project_connection" +class MonthlyRecurrenceSchedule( + RecurrenceSchedule, discriminator="Monthly" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Security details for OpenApi project connection authentication. + """Monthly recurrence schedule. - :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 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] """ - 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"] + 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"] ) - """Project connection auth security details. Required.""" + """Days of the month for the recurrence schedule. Required.""" @overload def __init__( self, *, - security_scheme: "_models.OpenApiProjectConnectionSecurityScheme", + days_of_month: list[int], ) -> None: ... @overload @@ -12534,24 +13028,43 @@ 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 + self.type = RecurrenceType.MONTHLY # type: ignore -class OpenApiProjectConnectionSecurityScheme(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Security scheme for OpenApi managed_identity authentication. +class NamespaceToolParam( + Tool, discriminator="namespace" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Namespace. - :ivar project_connection_id: Project connection id for Project Connection auth type. Required. - :vartype project_connection_id: 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] """ - project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Project connection id for Project Connection auth type. Required.""" + 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, *, - project_connection_id: str, + name: str, + description: str, + tools: list[Union["_models.FunctionToolParam", "_models.CustomToolParam"]], ) -> None: ... @overload @@ -12563,37 +13076,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 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 NoAuthenticationCredentials(BaseCredentials, discriminator="None"): + """Credentials that do not require authentication. - :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 type: The credential type. Required. No credential. + :vartype type: str or ~azure.ai.projects.models.NONE """ - 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.""" + type: Literal[CredentialType.NONE] = rest_discriminator(name="type", visibility=["read"]) # type: ignore + """The credential type. Required. No credential.""" @overload def __init__( self, - *, - openapi: "_models.OpenApiFunctionDefinition", - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -12605,43 +13103,35 @@ 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 + self.type = CredentialType.NONE # type: ignore -class OpenApiToolboxTool( - ToolboxTool, discriminator="openapi" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """An OpenAPI tool stored in a toolbox. +class OneTimeTrigger(Trigger, discriminator="OneTime"): # pylint: disable=docstring-keyword-should-match-keyword-only + """One-time trigger. - :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 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 """ - 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"] + 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" ) - """The openapi function definition. Required.""" + """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, *, - openapi: "_models.OpenApiFunctionDefinition", - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + trigger_at: datetime.datetime, + time_zone: Optional[str] = None, ) -> None: ... @overload @@ -12653,30 +13143,30 @@ 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 + self.type = TriggerType.ONE_TIME # type: ignore -class OptimizedAgentIdentifier(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Identifies the registered Foundry agent to optimize (request-only). Skills, tools, and - system_prompt are specified in options.optimization_config. +class OpenApiAuthDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """authentication details for OpenApiFunctionDefinition. - :ivar agent_name: Registered Foundry agent name (required). Required. - :vartype agent_name: str - :ivar agent_version: Pinned agent version. Defaults to latest if omitted. - :vartype agent_version: str + 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 """ - agent_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Registered Foundry agent name (required). Required.""" - agent_version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Pinned agent version. Defaults to latest if omitted.""" + __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, *, - agent_name: str, - agent_version: Optional[str] = None, + type: str, ) -> None: ... @overload @@ -12690,40 +13180,19 @@ 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. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - OtlpTelemetryEndpoint +class OpenApiAnonymousAuthDetails(OpenApiAuthDetails, discriminator="anonymous"): + """Security details for OpenApi anonymous authentication. - :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 + :ivar type: The object type, which is always 'anonymous'. Required. ANONYMOUS. + :vartype type: str or ~azure.ai.projects.models.ANONYMOUS """ - __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.""" + 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__( self, - *, - kind: str, - data: list[Union[str, "_models.TelemetryDataKind"]], - auth: Optional["_models.TelemetryEndpointAuth"] = None, ) -> None: ... @overload @@ -12735,47 +13204,50 @@ 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 -class OtlpTelemetryEndpoint( - TelemetryEndpoint, discriminator="OTLP" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """An OTLP (OpenTelemetry Protocol) telemetry export endpoint. +class OpenApiFunctionDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The input definition information for an openapi function. - :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 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] """ - 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\".""" + 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, *, - data: list[Union[str, "_models.TelemetryDataKind"]], - endpoint: str, - protocol: Union[str, "_models.TelemetryTransportProtocol"], - auth: Optional["_models.TelemetryEndpointAuth"] = None, + name: str, + spec: dict[str, Any], + auth: "_models.OpenApiAuthDetails", + description: Optional[str] = None, + default_params: Optional[list[str]] = None, ) -> None: ... @overload @@ -12787,43 +13259,36 @@ 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. - :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 - """ - 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.""" +class OpenApiFunctionDefinitionFunction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """OpenApiFunctionDefinitionFunction. + + :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] + """ + + 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, *, - pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE], - pending_upload_id: Optional[str] = None, - connection_name: Optional[str] = None, + name: str, + parameters: dict[str, Any], + description: Optional[str] = None, ) -> None: ... @overload @@ -12837,45 +13302,29 @@ 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 OpenApiManagedAuthDetails( + OpenApiAuthDetails, discriminator="managed_identity" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Security details for OpenApi managed_identity authentication. - :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 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 """ - 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"] + 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"] ) - """The type of pending upload. Required. Deprecated: the service never read this value and - silently ignored it. Use TemporaryBlobReference instead.""" + """Connection auth security details. Required.""" @overload def __init__( self, *, - blob_reference: "_models.BlobReference", - pending_upload_id: str, - pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE], - version: Optional[str] = None, + security_scheme: "_models.OpenApiManagedSecurityScheme", ) -> None: ... @overload @@ -12887,25 +13336,24 @@ 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 PickPropertiesVoiceAudioConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The template for picking properties. +class OpenApiManagedSecurityScheme(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Security scheme for OpenApi managed_identity authentication. - :ivar output: Output (agent speech) audio configuration. - :vartype output: ~azure.ai.projects.models.VoiceAudioOutputConfig + :ivar audience: Authentication scope for managed_identity auth type. Required. + :vartype audience: str """ - output: Optional["_models.VoiceAudioOutputConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Output (agent speech) audio configuration.""" + audience: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Authentication scope for managed_identity auth type. Required.""" @overload def __init__( self, *, - output: Optional["_models.VoiceAudioOutputConfig"] = None, + audience: str, ) -> None: ... @overload @@ -12919,36 +13367,30 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ProceduralMemoryItem( - MemoryItem, discriminator="procedural" +class OpenApiProjectConnectionAuthDetails( + OpenApiAuthDetails, discriminator="project_connection" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """A memory item containing a procedure extracted from conversations. + """Security details for OpenApi project connection authentication. - :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 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 """ - 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.""" + 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, *, - memory_id: str, - updated_at: datetime.datetime, - scope: str, - content: str, + security_scheme: "_models.OpenApiProjectConnectionSecurityScheme", ) -> None: ... @overload @@ -12960,24 +13402,24 @@ 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 + self.type = OpenApiAuthType.PROJECT_CONNECTION # type: ignore -class ProgrammaticToolCallingParam(Tool, discriminator="programmatic_tool_calling"): - """ProgrammaticToolCallingParam. +class OpenApiProjectConnectionSecurityScheme(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Security scheme for OpenApi managed_identity authentication. - :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 project_connection_id: Project connection id for Project Connection auth type. Required. + :vartype project_connection_id: str """ - 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.""" + 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, + *, + project_connection_id: str, ) -> None: ... @overload @@ -12989,36 +13431,37 @@ 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 PromotionInfo(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Promotion metadata recorded when a candidate is deployed to a Foundry agent. +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 promoted_at: Timestamp when promotion occurred, represented in Unix time. Required. - :vartype promoted_at: ~datetime.datetime - :ivar agent_name: Name of the Foundry agent this candidate was promoted to. Required. - :vartype agent_name: str - :ivar agent_version: Version of the Foundry agent this candidate was promoted to. Required. - :vartype agent_version: 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 """ - promoted_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + 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"] ) - """Timestamp when promotion occurred, represented in Unix time. Required.""" - agent_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name of the Foundry agent this candidate was promoted to. Required.""" - agent_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Version of the Foundry agent this candidate was promoted to. Required.""" + """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, *, - promoted_at: datetime.datetime, - agent_name: str, - agent_version: str, + openapi: "_models.OpenApiFunctionDefinition", + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -13030,98 +13473,43 @@ 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 PromptAgentDefinition( - AgentDefinition, discriminator="prompt" +class OpenApiToolboxTool( + ToolboxTool, discriminator="openapi" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """The prompt agent definition. - - :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 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 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] - """ + """An OpenAPI tool stored in a toolbox. - kind: Literal[AgentKind.PROMPT] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. PROMPT.""" - 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.""" - 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( + :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 + """ + + 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"] ) - """Set of structured inputs that can participate in prompt template substitution or tool argument - bindings.""" + """The openapi function definition. Required.""" @overload def __init__( self, *, - model: str, - rai_config: Optional["_models.RaiConfig"] = None, - instructions: Optional[str] = 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, + openapi: "_models.OpenApiFunctionDefinition", + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -13133,26 +13521,30 @@ 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 = ToolboxToolType.OPENAPI # 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 OptimizedAgentIdentifier(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Identifies the registered Foundry agent to optimize (request-only). Skills, tools, and + system_prompt are specified in options.optimization_config. - :ivar format: - :vartype format: ~azure.ai.projects.models.TextResponseFormat + :ivar agent_name: Registered Foundry agent name (required). Required. + :vartype agent_name: str + :ivar agent_version: Pinned agent version. Defaults to latest if omitted. + :vartype agent_version: str """ - format: Optional["_models.TextResponseFormat"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) + agent_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Registered Foundry agent name (required). Required.""" + agent_version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Pinned agent version. Defaults to latest if omitted.""" @overload def __init__( self, *, - format: Optional["_models.TextResponseFormat"] = None, + agent_name: str, + agent_version: Optional[str] = None, ) -> None: ... @overload @@ -13166,38 +13558,40 @@ 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 TelemetryEndpoint(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A telemetry export endpoint configuration. - :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 + 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 """ - 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.""" + __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, *, - prompt_text: str, - init_parameters: Optional[dict[str, Any]] = None, - data_schema: Optional[dict[str, Any]] = None, - metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, + kind: str, + data: list[Union[str, "_models.TelemetryDataKind"]], + auth: Optional["_models.TelemetryEndpointAuth"] = None, ) -> None: ... @overload @@ -13209,38 +13603,47 @@ 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" +class OtlpTelemetryEndpoint( + TelemetryEndpoint, discriminator="OTLP" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Prompt source for data generation jobs — inline text provided by the user. + """An OTLP (OpenTelemetry Protocol) telemetry export endpoint. - :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). + :ivar data: Data types to export to this endpoint. Use an empty array to export no data. Required. - :vartype prompt: str + :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 """ - 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.""" + 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, *, - prompt: str, - description: Optional[str] = None, + data: list[Union[str, "_models.TelemetryDataKind"]], + endpoint: str, + protocol: Union[str, "_models.TelemetryTransportProtocol"], + auth: Optional["_models.TelemetryEndpointAuth"] = None, ) -> None: ... @overload @@ -13252,41 +13655,43 @@ 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 + self.kind = TelemetryEndpointKind.OTLP # 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. +class PendingUploadRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents a request for a pending upload. - :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 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 """ - 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.""" + 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, *, - prompt: str, - description: Optional[str] = None, + pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE], + pending_upload_id: Optional[str] = None, + connection_name: Optional[str] = None, ) -> None: ... @overload @@ -13298,61 +13703,47 @@ 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 -class ProtocolConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Per-protocol configuration for the agent endpoint. +class PendingUploadResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents the response for a pending upload request. - :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 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 """ - 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"] + blob_reference: "_models.BlobReference" = rest_field( + name="blobReference", visibility=["read", "create", "update", "delete", "query"] ) - """Configuration for the MCP protocol.""" - invocations: Optional["_models.InvocationsProtocolConfiguration"] = rest_field( - 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"] ) - """Configuration for the invocations protocol.""" - invocations_ws: Optional["_models.InvocationsWsProtocolConfiguration"] = rest_field( - 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"] ) - """Configuration for the WebSocket-based invocations protocol.""" + """The type of pending upload. Required. Deprecated: the service never read this value and + silently ignored it. Use TemporaryBlobReference instead.""" @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, + blob_reference: "_models.BlobReference", + pending_upload_id: str, + pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE], + version: Optional[str] = None, ) -> None: ... @overload @@ -13366,30 +13757,23 @@ 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 PickPropertiesVoiceAgentAudioConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The template for picking properties. - :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. - :vartype version: str + :ivar output: Output (agent speech) audio configuration. + :vartype output: ~azure.ai.projects.models.VoiceAgentAudioOutputConfig """ - protocol: Union[str, "_models.AgentEndpointProtocol"] = rest_field( + output: Optional["_models.VoiceAgentAudioOutputConfig"] = rest_field( 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.""" + """Output (agent speech) audio configuration.""" @overload def __init__( self, *, - protocol: Union[str, "_models.AgentEndpointProtocol"], - version: str, + output: Optional["_models.VoiceAgentAudioOutputConfig"] = None, ) -> None: ... @overload @@ -13403,21 +13787,36 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RaiConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Configuration for Responsible AI (RAI) content filtering and safety features. +class ProceduralMemoryItem( + MemoryItem, discriminator="procedural" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A memory item containing a procedure extracted from conversations. - :ivar rai_policy_name: The name of the RAI policy to apply. Required. - :vartype rai_policy_name: 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. Routine procedures extracted from + conversations. + :vartype kind: str or ~azure.ai.projects.models.PROCEDURAL """ - rai_policy_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the RAI policy to apply. Required.""" + 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, *, - rai_policy_name: str, + memory_id: str, + updated_at: datetime.datetime, + scope: str, + content: str, ) -> None: ... @overload @@ -13429,43 +13828,24 @@ 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 RankingOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """RankingOptions. +class ProgrammaticToolCallingParam(Tool, discriminator="programmatic_tool_calling"): + """ProgrammaticToolCallingParam. - :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 type of the tool. Always ``programmatic_tool_calling``. Required. + PROGRAMMATIC_TOOL_CALLING. + :vartype type: str or ~azure.ai.projects.models.PROGRAMMATIC_TOOL_CALLING """ - 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[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, - *, - ranker: Optional[Union[str, "_models.RankerVersionType"]] = None, - score_threshold: Optional[float] = None, - hybrid_search: Optional["_models.HybridSearchOptions"] = None, ) -> None: ... @overload @@ -13477,27 +13857,36 @@ 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 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 PromotionInfo(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Promotion metadata recorded when a candidate is deployed to a Foundry agent. - :ivar type: Required. Known values are: "audio/pcm", "audio/pcmu", and "audio/pcma". - :vartype type: str or ~azure.ai.projects.models.RealtimeAudioFormatsType + :ivar promoted_at: Timestamp when promotion occurred, represented in Unix time. Required. + :vartype promoted_at: ~datetime.datetime + :ivar agent_name: Name of the Foundry agent this candidate was promoted to. Required. + :vartype agent_name: str + :ivar agent_version: Version of the Foundry agent this candidate was promoted to. Required. + :vartype agent_version: 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\".""" + promoted_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """Timestamp when promotion occurred, represented in Unix time. Required.""" + agent_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the Foundry agent this candidate was promoted to. Required.""" + agent_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Version of the Foundry agent this candidate was promoted to. Required.""" @overload def __init__( self, *, - type: str, + promoted_at: datetime.datetime, + agent_name: str, + agent_version: str, ) -> None: ... @overload @@ -13511,27 +13900,96 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeAudioFormatsAudioPcm( - RealtimeAudioFormats, discriminator="audio/pcm" +class PromptAgentDefinition( + AgentDefinition, discriminator="prompt" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeAudioFormatsAudioPcm. + """The prompt agent definition. - :ivar type: Required. AUDIO_PCM. - :vartype type: str or ~azure.ai.projects.models.AUDIO_PCM - :ivar rate: Default value is 24000. - :vartype rate: int + :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 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 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] """ - 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.""" + kind: Literal[AgentKind.PROMPT] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. PROMPT.""" + 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.""" + 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( + 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, *, - rate: Optional[Literal[24000]] = None, + model: str, + rai_config: Optional["_models.RaiConfig"] = None, + instructions: Optional[str] = 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 @@ -13543,22 +14001,26 @@ 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 + self.kind = AgentKind.PROMPT # type: ignore -class RealtimeAudioFormatsAudioPcma(RealtimeAudioFormats, discriminator="audio/pcma"): - """RealtimeAudioFormatsAudioPcma. +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: Required. AUDIO_PCMA. - :vartype type: str or ~azure.ai.projects.models.AUDIO_PCMA + :ivar format: + :vartype format: ~azure.ai.projects.models.TextResponseFormat """ - type: Literal[RealtimeAudioFormatsType.AUDIO_PCMA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. AUDIO_PCMA.""" + format: Optional["_models.TextResponseFormat"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) @overload def __init__( self, + *, + format: Optional["_models.TextResponseFormat"] = None, ) -> None: ... @overload @@ -13570,22 +14032,40 @@ 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 RealtimeAudioFormatsAudioPcmu(RealtimeAudioFormats, discriminator="audio/pcmu"): - """RealtimeAudioFormatsAudioPcmu. +class PromptBasedEvaluatorDefinition( + EvaluatorDefinition, discriminator="prompt" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Prompt-based evaluator. - :ivar type: Required. AUDIO_PCMU. - :vartype type: str or ~azure.ai.projects.models.AUDIO_PCMU + :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 """ - type: Literal[RealtimeAudioFormatsType.AUDIO_PCMU] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. AUDIO_PCMU.""" + 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, + *, + 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 @@ -13597,32 +14077,38 @@ 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 - + self.type = EvaluatorDefinitionType.PROMPT # 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 +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: Required. Known values are: "function_call", "function_call_output", - "mcp_approval_response", "mcp_list_tools", "mcp_call", and "mcp_approval_request". - :vartype type: str or ~azure.ai.projects.models.RealtimeConversationItemType + :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 """ - __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\", and \"mcp_approval_request\".""" + 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: str, + prompt: str, + description: Optional[str] = None, ) -> None: ... @overload @@ -13634,63 +14120,41 @@ 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 RealtimeConversationItemFunctionCall( - RealtimeConversationItem, discriminator="function_call" +class PromptEvaluatorGenerationJobSource( + EvaluatorGenerationJobSource, discriminator="prompt" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime function call 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 ``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 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\".""" - 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"] - ) - """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.""" + 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, *, - 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, + prompt: str, + description: Optional[str] = None, ) -> None: ... @overload @@ -13702,60 +14166,61 @@ 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 + self.type = EvaluatorGenerationJobSourceType.PROMPT # 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 ProtocolConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Per-protocol configuration for the agent endpoint. - :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 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 """ - 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( + activity: Optional["_models.ActivityProtocolConfiguration"] = 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.""" + """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"] + ) + """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, *, - 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, + 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 @@ -13767,29 +14232,32 @@ 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(_Model): # 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 +class ProtocolVersionRecord(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A record mapping for a single protocol and its version. - :ivar role: Required. Known values are: "system", "user", and "assistant". - :vartype role: str or ~azure.ai.projects.models.RealtimeConversationItemMessageType + :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. + :vartype version: str """ - __mapping__: dict[str, _Model] = {} - role: str = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"system\", \"user\", and \"assistant\".""" + protocol: Union[str, "_models.AgentEndpointProtocol"] = rest_field( + 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.""" @overload def __init__( self, *, - role: str, + protocol: Union[str, "_models.AgentEndpointProtocol"], + version: str, ) -> None: ... @overload @@ -13803,56 +14271,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeConversationItemMessageAssistant( - RealtimeConversationItemMessage, discriminator="assistant" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime assistant message item. - - :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. Default value is "message". - :vartype type: str - :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] - """ - - 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["message"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The type of the item. Always ``message``. Required. Default value is \"message\".""" - 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.""" +class RaiConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Configuration for Responsible AI (RAI) content filtering and safety features. + + :ivar rai_policy_name: The name of the RAI policy to apply. Required. + :vartype rai_policy_name: str + """ + + rai_policy_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the RAI policy to apply. Required.""" @overload def __init__( self, *, - 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, + rai_policy_name: str, ) -> None: ... @overload @@ -13864,41 +14297,43 @@ 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.type: Literal["message"] = "message" -class RealtimeConversationItemMessageAssistantContent( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """RealtimeConversationItemMessageAssistantContent. +class RankingOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RankingOptions. - :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 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["output_text", "output_audio"]] = rest_field( + ranker: Optional[Union[str, "_models.RankerVersionType"]] = 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"]) + """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["output_text", "output_audio"]] = None, - text: Optional[str] = None, - audio: Optional[str] = None, - transcript: Optional[str] = None, + ranker: Optional[Union[str, "_models.RankerVersionType"]] = None, + score_threshold: Optional[float] = None, + hybrid_search: Optional["_models.HybridSearchOptions"] = None, ) -> None: ... @overload @@ -13912,55 +14347,25 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeConversationItemMessageSystem( - RealtimeConversationItemMessage, discriminator="system" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime system message item. +class RealtimeAudioFormats(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeAudioFormats. - :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. Default value is "message". - :vartype type: str - :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] + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + RealtimeAudioFormatsAudioPcm, RealtimeAudioFormatsAudioPcma, RealtimeAudioFormatsAudioPcmu + + :ivar type: Required. Known values are: "audio/pcm", "audio/pcmu", and "audio/pcma". + :vartype type: str or ~azure.ai.projects.models.RealtimeAudioFormatsType """ - 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["message"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The type of the item. Always ``message``. Required. Default value is \"message\".""" - 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.""" + __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, *, - 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, + type: str, ) -> None: ... @overload @@ -13972,31 +14377,29 @@ 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: Literal["message"] = "message" -class RealtimeConversationItemMessageSystemContent( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """RealtimeConversationItemMessageSystemContent. +class RealtimeAudioFormatsAudioPcm( + RealtimeAudioFormats, discriminator="audio/pcm" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeAudioFormatsAudioPcm. - :ivar type: Default value is "input_text". - :vartype type: str - :ivar text: - :vartype text: str + :ivar type: Required. AUDIO_PCM. + :vartype type: str or ~azure.ai.projects.models.AUDIO_PCM + :ivar rate: Default value is 24000. + :vartype rate: int """ - 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[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, *, - type: Optional[Literal["input_text"]] = None, - text: Optional[str] = None, + rate: Optional[Literal[24000]] = None, ) -> None: ... @overload @@ -14008,57 +14411,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 RealtimeConversationItemMessageUser( - RealtimeConversationItemMessage, discriminator="user" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime user message item. +class RealtimeAudioFormatsAudioPcma(RealtimeAudioFormats, discriminator="audio/pcma"): + """RealtimeAudioFormatsAudioPcma. - :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. Default value is "message". - :vartype type: str - :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 type: Required. AUDIO_PCMA. + :vartype type: str or ~azure.ai.projects.models.AUDIO_PCMA """ - 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["message"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The type of the item. Always ``message``. Required. Default value is \"message\".""" - 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.""" + type: Literal[RealtimeAudioFormatsType.AUDIO_PCMA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. AUDIO_PCMA.""" @overload def __init__( self, - *, - 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 @@ -14070,54 +14438,22 @@ 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: Literal["message"] = "message" + self.type = RealtimeAudioFormatsType.AUDIO_PCMA # type: ignore -class RealtimeConversationItemMessageUserContent( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """RealtimeConversationItemMessageUserContent. +class RealtimeAudioFormatsAudioPcmu(RealtimeAudioFormats, discriminator="audio/pcmu"): + """RealtimeAudioFormatsAudioPcmu. - :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 type: Required. AUDIO_PCMU. + :vartype type: str or ~azure.ai.projects.models.AUDIO_PCMU """ - 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"]) + type: Literal[RealtimeAudioFormatsType.AUDIO_PCMU] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. AUDIO_PCMU.""" @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, ) -> None: ... @overload @@ -14129,42 +14465,39 @@ 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 RealtimeFunctionTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Function tool. +class RealtimeClientEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A realtime client event. - :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 + 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, + VoiceAgentClientEventSessionAvatarConnect + + :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", and "session.avatar.connect". + :vartype type: str or ~azure.ai.projects.models.RealtimeClientEventType """ - 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.""" + __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\", and \"session.avatar.connect\".""" @overload def __init__( self, *, - type: Optional[Literal["function"]] = None, - name: Optional[str] = None, - description: Optional[str] = None, - parameters: Optional["_models.RealtimeFunctionToolParameters"] = None, + type: str, ) -> None: ... @overload @@ -14178,47 +14511,50 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeFunctionToolParameters(_Model): - """RealtimeFunctionToolParameters.""" - - -class RealtimeMCPApprovalRequest( - RealtimeConversationItem, discriminator="mcp_approval_request" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime MCP approval request. +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 respond with a ``conversation.item.created`` + event, otherwise an ``error`` event will be sent. - :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 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 """ - 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.""" + 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.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - server_label: str, - name: str, - arguments: str, + item: "_models.RealtimeConversationItem", + event_id: Optional[str] = None, + previous_item_id: Optional[str] = None, ) -> None: ... @overload @@ -14230,45 +14566,38 @@ 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 + self.type = RealtimeClientEventType.CONVERSATION_ITEM_CREATE # type: ignore -class RealtimeMCPApprovalResponse( - RealtimeConversationItem, discriminator="mcp_approval_response" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime MCP approval response. +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. - :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 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 """ - 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"]) + 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, *, - id: str, # pylint: disable=redefined-builtin - approval_request_id: str, - approve: bool, - reason: Optional[str] = None, + item_id: str, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -14280,29 +14609,40 @@ 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.type = RealtimeClientEventType.CONVERSATION_ITEM_DELETE # type: ignore -class RealtimeMCPError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeMCPError. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - RealtimeMCPHTTPError, RealtimeMCPProtocolError, RealtimeMCPToolExecutionError +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. - :ivar type: Required. Known values are: "protocol_error", "tool_execution_error", and - "http_error". - :vartype type: str or ~azure.ai.projects.models.RealtimeMcpErrorType + :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 """ - __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\".""" + 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.""" @overload def __init__( self, *, - type: str, + item_id: str, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -14314,34 +14654,57 @@ 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 -class RealtimeMCPHTTPError( - RealtimeMCPError, discriminator="http_error" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime MCP HTTP error. +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 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 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 """ - 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.""" + 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, *, - code: int, - message: str, + item_id: str, + content_index: int, + audio_end_ms: int, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -14353,40 +14716,47 @@ 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 = RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE # type: ignore -class RealtimeMCPListTools( - RealtimeConversationItem, discriminator="mcp_list_tools" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime MCP list tools. +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. - :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 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 """ - 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.""" + 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, *, - server_label: str, - tools: list["_models.MCPListToolsTool"], - id: Optional[str] = None, # pylint: disable=redefined-builtin + audio: str, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -14398,35 +14768,32 @@ 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 = RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND # type: ignore -class RealtimeMCPProtocolError( - RealtimeMCPError, discriminator="protocol_error" +class RealtimeClientEventInputAudioBufferClear( + RealtimeClientEvent, discriminator="input_audio_buffer.clear" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime MCP protocol error. + """Send this event to clear the audio bytes in the buffer. The server will respond with an + ``input_audio_buffer.cleared`` event. - :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 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 """ - 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.""" + 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, *, - code: int, - message: str, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -14438,57 +14805,76 @@ 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 = RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR # type: ignore -class RealtimeMCPToolCall( - RealtimeConversationItem, discriminator="mcp_call" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime MCP tool call. +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. - :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 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 """ - 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"]) + 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: 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 = 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 + `_. + + :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 + """ + + 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, *, - 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, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -14500,30 +14886,40 @@ 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 + self.type = RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR # type: ignore -class RealtimeMCPToolExecutionError( - RealtimeMCPError, discriminator="tool_execution_error" +class RealtimeClientEventResponseCancel( + RealtimeClientEvent, discriminator="response.cancel" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime MCP tool execution error. + """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 type: Required. TOOL_EXECUTION_ERROR. - :vartype type: str or ~azure.ai.projects.models.TOOL_EXECUTION_ERROR - :ivar message: Required. - :vartype message: str + :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 """ - 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.""" + 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, *, - message: str, + event_id: Optional[str] = None, + response_id: Optional[str] = None, ) -> None: ... @overload @@ -14535,26 +14931,50 @@ 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 + self.type = RealtimeClientEventType.RESPONSE_CANCEL # type: ignore -class RealtimeReasoning(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime reasoning configuration. +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 effort: Known values are: "minimal", "low", "medium", "high", and "xhigh". - :vartype effort: str or ~azure.ai.projects.models.RealtimeReasoningEffort + :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 """ - effort: Optional[Union[str, "_models.RealtimeReasoningEffort"]] = rest_field( + 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"] ) - """Known values are: \"minimal\", \"low\", \"medium\", \"high\", and \"xhigh\".""" @overload def __init__( self, *, - effort: Optional[Union[str, "_models.RealtimeReasoningEffort"]] = None, + event_id: Optional[str] = None, + response: Optional["_models.VoiceAgentResponseCreateParams"] = None, ) -> None: ... @overload @@ -14566,42 +14986,32 @@ 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 RealtimeResponseStatusDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeResponseStatusDetails. +class RealtimeConversationItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A single item within a Realtime conversation. - :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 + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + RealtimeConversationItemFunctionCall, RealtimeConversationItemFunctionCallOutput, + RealtimeMCPApprovalRequest, RealtimeMCPApprovalResponse, RealtimeMCPToolCall, + RealtimeMCPListTools + + :ivar type: Required. Known values are: "function_call", "function_call_output", + "mcp_approval_response", "mcp_list_tools", "mcp_call", and "mcp_approval_request". + :vartype type: str or ~azure.ai.projects.models.RealtimeConversationItemType """ - 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"] - ) + __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\", and \"mcp_approval_request\".""" @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, + type: str, ) -> None: ... @overload @@ -14615,24 +15025,69 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeResponseStatusDetailsError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeResponseStatusDetailsError. +class RealtimeConversationItemFunctionCall( + RealtimeConversationItem, discriminator="function_call" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime function call item. - :ivar type: - :vartype type: str - :ivar code: - :vartype code: 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``. 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 """ - type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - code: 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] = 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"] + ) + """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, *, - type: Optional[str] = None, - code: Optional[str] = None, + 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 @@ -14644,43 +15099,75 @@ 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 RealtimeResponseUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeResponseUsage. +class RealtimeConversationItemFunctionCallOutput( + RealtimeConversationItem, discriminator="function_call_output" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Realtime function call output item. - :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 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 """ - 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( + 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, *, - 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, + 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 @@ -14692,41 +15179,43 @@ 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 RealtimeResponseUsageInputTokenDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeResponseUsageInputTokenDetails. +class RealtimeFunctionTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Function tool. - :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: 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 """ - 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( + 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, *, - 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, + type: Optional[Literal["function"]] = None, + name: Optional[str] = None, + description: Optional[str] = None, + parameters: Optional["_models.RealtimeFunctionToolParameters"] = None, ) -> None: ... @overload @@ -14740,30 +15229,55 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeResponseUsageInputTokenDetailsCachedTokensDetails( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """RealtimeResponseUsageInputTokenDetailsCachedTokensDetails. +class RealtimeFunctionToolParameters(_Model): + """RealtimeFunctionToolParameters.""" - :ivar text_tokens: - :vartype text_tokens: int - :ivar image_tokens: - :vartype image_tokens: int - :ivar audio_tokens: - :vartype audio_tokens: int + +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 """ - 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[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, *, - text_tokens: Optional[int] = None, - image_tokens: Optional[int] = None, - audio_tokens: Optional[int] = None, + id: str, # pylint: disable=redefined-builtin + server_label: str, + name: str, + arguments: str, ) -> None: ... @overload @@ -14775,26 +15289,53 @@ 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 RealtimeResponseUsageOutputTokenDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeResponseUsageOutputTokenDetails. +class RealtimeMCPApprovalResponse( + RealtimeConversationItem, discriminator="mcp_approval_response" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime MCP approval response. - :ivar text_tokens: - :vartype text_tokens: int - :ivar audio_tokens: - :vartype audio_tokens: int + :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 """ - 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[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, *, - text_tokens: Optional[int] = None, - audio_tokens: Optional[int] = None, + id: str, # pylint: disable=redefined-builtin + approval_request_id: str, + approve: bool, + reason: Optional[str] = None, ) -> None: ... @overload @@ -14806,59 +15347,23 @@ 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 -class RealtimeServerEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A realtime server event. +class RealtimeMCPError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeMCPError. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - RealtimeServerEventResponseContentPartAdded + RealtimeMCPHTTPError, RealtimeMCPProtocolError, RealtimeMCPToolExecutionError - :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", and "response.mcp_call.failed". - :vartype type: str or ~azure.ai.projects.models.RealtimeServerEventType + :ivar type: Required. Known values are: "protocol_error", "tool_execution_error", and + "http_error". + :vartype type: str or ~azure.ai.projects.models.RealtimeMcpErrorType """ __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\", and \"response.mcp_call.failed\".""" + """Required. Known values are: \"protocol_error\", \"tool_execution_error\", and \"http_error\".""" @overload def __init__( @@ -14878,34 +15383,32 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeServerEventConversationItemInputAudioTranscriptionFailedError( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """RealtimeServerEventConversationItemInputAudioTranscriptionFailedError. +class RealtimeMCPHTTPError( + RealtimeMCPError, discriminator="http_error" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime MCP HTTP error. - :ivar type: - :vartype type: str - :ivar code: - :vartype code: str - :ivar message: + :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 param: - :vartype param: str """ - 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"]) + 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, *, - type: Optional[str] = None, - code: Optional[str] = None, - message: Optional[str] = None, - param: Optional[str] = None, + code: int, + message: str, ) -> None: ... @overload @@ -14917,36 +15420,48 @@ 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 -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 RealtimeMCPListTools( + RealtimeConversationItem, discriminator="mcp_list_tools" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """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 ``error``. Required. Default value is "error". - :vartype type: str - :ivar error: Details of the error. Required. - :vartype error: ~azure.ai.projects.models.RealtimeServerEventErrorError + :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 """ - 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"] - ) - """Details of the error. 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, - error: "_models.RealtimeServerEventErrorError", + server_label: str, + tools: list["_models.MCPListToolsTool"], + id: Optional[str] = None, # pylint: disable=redefined-builtin ) -> None: ... @overload @@ -14958,41 +15473,35 @@ 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.MCP_LIST_TOOLS # type: ignore -class RealtimeServerEventErrorError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeServerEventErrorError. +class RealtimeMCPProtocolError( + RealtimeMCPError, discriminator="protocol_error" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime MCP protocol error. - :ivar type: Required. - :vartype type: str - :ivar code: - :vartype code: 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 - :ivar param: - :vartype param: str - :ivar event_id: - :vartype event_id: str """ - type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + 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.""" - 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, *, - type: str, + code: int, message: str, - code: Optional[str] = None, - param: Optional[str] = None, - event_id: Optional[str] = None, ) -> None: ... @overload @@ -15004,39 +15513,65 @@ 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 -class RealtimeServerEventRateLimitsUpdatedRateLimits( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """RealtimeServerEventRateLimitsUpdatedRateLimits. +class RealtimeMCPToolCall( + RealtimeConversationItem, discriminator="mcp_call" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime MCP tool call. - :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 + :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 """ - 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"]) + 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, *, - name: Optional[Literal["requests", "tokens"]] = None, - limit: Optional[int] = None, - remaining: Optional[int] = None, - reset_seconds: Optional[float] = None, + 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 @@ -15048,58 +15583,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_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 @@ -15111,38 +15618,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 @@ -15156,57 +15651,40 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Reasoning(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Reasoning. - - :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 - """ +class RealtimeResponseStatusDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeResponseStatusDetails. - 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( + :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 + """ + + type: Optional[Literal["completed", "cancelled", "failed", "incomplete"]] = 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( + """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[\"auto\"], Literal[\"current_turn\"], - Literal[\"all_turns\"]""" - generate_summary: Optional[Literal["auto", "concise", "detailed"]] = rest_field( + """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"] ) - """Is one of the following types: Literal[\"auto\"], Literal[\"concise\"], Literal[\"detailed\"]""" @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, + 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 @@ -15220,51 +15698,24 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RecurrenceTrigger( - Trigger, discriminator="Recurrence" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Recurrence based trigger. +class RealtimeResponseStatusDetailsError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeResponseStatusDetailsError. - :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 type: + :vartype type: str + :ivar code: + :vartype code: str """ - 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.""" + 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, *, - interval: int, - schedule: "_models.RecurrenceSchedule", - start_time: Optional[datetime.datetime] = None, - end_time: Optional[datetime.datetime] = None, - time_zone: Optional[str] = None, + type: Optional[str] = None, + code: Optional[str] = None, ) -> None: ... @overload @@ -15276,88 +15727,43 @@ 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 RedTeam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Red team details. +class RealtimeResponseUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeResponseUsage. - :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 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 """ - 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"] + 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"] ) - """List of risk categories to generate attack objectives for.""" - application_scenario: Optional[str] = rest_field( - name="applicationScenario", visibility=["read", "create", "update", "delete", "query"] + output_token_details: Optional["_models.RealtimeResponseUsageOutputTokenDetails"] = 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.""" @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, + 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 @@ -15371,33 +15777,39 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ReminderPreviewToolboxTool( - ToolboxTool, discriminator="reminder_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A reminder tool stored in a toolbox. +class RealtimeResponseUsageInputTokenDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeResponseUsageInputTokenDetails. - :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 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 """ - type: Literal[ToolboxToolType.REMINDER_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. REMINDER_PREVIEW.""" + 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"] + ) @overload def __init__( self, *, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + 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 @@ -15409,33 +15821,32 @@ 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.""" -class ResponseUsageInputTokensDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """ResponseUsageInputTokensDetails. +class RealtimeResponseUsageInputTokenDetailsCachedTokensDetails( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeResponseUsageInputTokenDetailsCachedTokensDetails. - :ivar cached_tokens: Required. - :vartype cached_tokens: int - :ivar cache_write_tokens: Required. - :vartype cache_write_tokens: int + :ivar text_tokens: + :vartype text_tokens: int + :ivar image_tokens: + :vartype image_tokens: int + :ivar audio_tokens: + :vartype audio_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.""" + 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, *, - cached_tokens: int, - cache_write_tokens: int, + text_tokens: Optional[int] = None, + image_tokens: Optional[int] = None, + audio_tokens: Optional[int] = None, ) -> None: ... @overload @@ -15449,21 +15860,24 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ResponseUsageOutputTokensDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """ResponseUsageOutputTokensDetails. +class RealtimeResponseUsageOutputTokenDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeResponseUsageOutputTokenDetails. - :ivar reasoning_tokens: Required. - :vartype reasoning_tokens: int + :ivar text_tokens: + :vartype text_tokens: int + :ivar audio_tokens: + :vartype audio_tokens: int """ - reasoning_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """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, *, - reasoning_tokens: int, + text_tokens: Optional[int] = None, + audio_tokens: Optional[int] = None, ) -> None: ... @overload @@ -15477,57 +15891,104 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Routine(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A routine definition returned by the service. +class RealtimeServerEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A realtime server event. - :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 + 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, + VoiceAgentServerEventSessionAvatarConnecting, VoiceAgentServerEventSessionAvatarSwitchToIdle, + VoiceAgentServerEventSessionAvatarSwitchToSpeaking, RealtimeServerEventSessionCreated, + RealtimeServerEventSessionUpdated, VoiceAgentServerEventWarning + + :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.avatar.connecting", "session.avatar.switch_to_speaking", + "session.avatar.switch_to_idle", "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 """ - 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.""" + __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.avatar.connecting\", \"session.avatar.switch_to_speaking\", + \"session.avatar.switch_to_idle\", \"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, *, - 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, + type: str, ) -> None: ... @overload @@ -15541,162 +16002,48 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RoutineRun(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A single routine run returned from the run history API. - - :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 - """ - - 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.""" +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. - @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, + :ivar event_id: The unique ID of the server event. Required. + :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: + :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.""" + 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, + item: "_models.RealtimeConversationItem", + previous_item_id: Optional[str] = None, ) -> None: ... @overload @@ -15708,63 +16055,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_ADDED # 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 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 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 ``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 """ - 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.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, *, - 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, + item: "_models.RealtimeConversationItem", + previous_item_id: Optional[str] = None, ) -> None: ... @overload @@ -15776,66 +16110,38 @@ 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.CONVERSATION_ITEM_CREATED # 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 RealtimeServerEventConversationItemDeleted( + RealtimeServerEvent, discriminator="conversation.item.deleted" +): # 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. - :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.inputs.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 ``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 """ - 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( - 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.inputs.sources`` when the warning applies to a - specific source. Omitted for aggregate warnings and for warnings not tied to one source.""" + 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.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item that was deleted. 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, + item_id: str, ) -> None: ... @overload @@ -15847,25 +16153,42 @@ 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 -class SASCredentials(BaseCredentials, discriminator="SAS"): - """Shared Access Signature (SAS) credential definition. +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 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 event_id: The unique ID of the server event. Required. + :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 """ - 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.""" + 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.""" @overload def __init__( self, + *, + event_id: str, + item: "_models.RealtimeConversationItem", + previous_item_id: Optional[str] = None, ) -> None: ... @overload @@ -15877,74 +16200,79 @@ 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 + self.type = RealtimeServerEventType.CONVERSATION_ITEM_DONE # type: ignore -class Schedule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Schedule model. +class RealtimeServerEventConversationItemInputAudioTranscriptionCompleted( + RealtimeServerEvent, discriminator="conversation.item.input_audio_transcription.completed" +): # 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. - :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 ``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 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] """ - 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.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.""" + 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, *, - 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, + item_id: str, + content_index: int, + transcript: str, + usage: Union["_models.TranscriptTextUsageTokens", "_models.TranscriptTextUsageDuration"], + logprobs: Optional[list["_models.LogProbProperties"]] = None, + phrases: Optional[list["_models.VoiceAgentTranscriptionPhrase"]] = None, ) -> None: ... @overload @@ -15956,36 +16284,55 @@ 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 -class ScheduleRoutineTrigger( - RoutineTrigger, discriminator="schedule" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A recurring cron-based routine trigger. +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 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 ``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] """ - 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.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"] + ) @overload def __init__( self, *, - cron_expression: str, - time_zone: str, + event_id: str, + item_id: str, + content_index: Optional[int] = None, + delta: Optional[str] = None, + logprobs: Optional[list["_models.LogProbProperties"]] = None, ) -> None: ... @overload @@ -15997,47 +16344,53 @@ 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.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA # type: ignore -class ScheduleRun(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Schedule run model. +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 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 ``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 """ - 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" + 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"] ) - """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.""" + """Details of the transcription error. Required.""" @overload def __init__( self, *, - schedule_id: str, - trigger_time: Optional[datetime.datetime] = None, + event_id: str, + item_id: str, + content_index: int, + error: "_models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError", ) -> None: ... @overload @@ -16049,28 +16402,37 @@ 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 -class SessionConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Session defaults applied to sessions created for a hosted agent version. +class RealtimeServerEventConversationItemInputAudioTranscriptionFailedError( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeServerEventConversationItemInputAudioTranscriptionFailedError. - :ivar idle_timeout_seconds: The idle duration, in seconds, before a session's sandbox is - suspended. Optional — when unset, the server default of 900 seconds is used. Must be between - 300 and 3600 seconds (inclusive). - :vartype idle_timeout_seconds: ~datetime.timedelta + :ivar type: + :vartype type: str + :ivar code: + :vartype code: str + :ivar message: + :vartype message: str + :ivar param: + :vartype param: 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. Optional — when unset, - the server default of 900 seconds is used. Must be between 300 and 3600 seconds (inclusive).""" + 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, *, - idle_timeout_seconds: Optional[datetime.timedelta] = None, + type: Optional[str] = None, + code: Optional[str] = None, + message: Optional[str] = None, + param: Optional[str] = None, ) -> None: ... @overload @@ -16084,38 +16446,109 @@ 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. +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 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 ``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 """ - 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.""" + 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.""" + + @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, + ) -> 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.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT # 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. + + :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 + """ + + 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, *, - name: str, - size: int, - is_directory: bool, - modified_time: datetime.datetime, + event_id: str, + item: "_models.RealtimeConversationItem", ) -> None: ... @overload @@ -16127,29 +16560,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 SessionFileWriteResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Response from uploading a file to a session sandbox. +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 path: The path where the file was written, relative to the session home directory. + :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 path: str - :ivar bytes_written: Number of bytes written. Required. - :vartype bytes_written: int + :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 """ - 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.""" + 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.""" @overload def __init__( self, *, - path: str, - bytes_written: int, + event_id: str, + item_id: str, + content_index: int, + audio_end_ms: int, + item: Optional["_models.RealtimeConversationItem"] = None, ) -> None: ... @overload @@ -16161,53 +16623,37 @@ 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 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"} +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 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 + :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 """ - 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["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"] ) - """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.""" + """Details of the error. Required.""" @overload def __init__( self, *, - event: Union[str, "_models.SessionLogEventType"], - data: str, + event_id: str, + error: "_models.RealtimeServerEventErrorError", ) -> None: ... @overload @@ -16219,27 +16665,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 SharepointGroundingToolParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The sharepoint grounding tool parameters. +class RealtimeServerEventErrorError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeServerEventErrorError. - :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: 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 """ - 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.""" + 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, *, - project_connections: Optional[list["_models.ToolProjectConnection"]] = None, + type: str, + message: str, + code: Optional[str] = None, + param: Optional[str] = None, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -16253,32 +16713,29 @@ 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. +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. - :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 ``input_audio_buffer.cleared``. Required. + INPUT_AUDIO_BUFFER_CLEARED. + :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_CLEARED """ - 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.""" + 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, *, - sharepoint_grounding_preview: "_models.SharepointGroundingToolParameters", + event_id: str, ) -> None: ... @overload @@ -16290,44 +16747,43 @@ 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.INPUT_AUDIO_BUFFER_CLEARED # type: ignore -class SimpleQnADataGenerationJobOptions( - DataGenerationJobOptions, discriminator="simple_qna" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """The options for a data generation job with SimpleQnA type. +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. - :ivar max_samples: Maximum number of samples to generate. Required. - :vartype max_samples: int - :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 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 ``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 """ - 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.""" - 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.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, *, - 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, + item_id: str, + previous_item_id: Optional[str] = None, ) -> None: ... @overload @@ -16339,39 +16795,54 @@ 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.INPUT_AUDIO_BUFFER_COMMITTED # type: ignore -class SimulationSeedDataGenerationJobOptions( - DataGenerationJobOptions, discriminator="simulation_seed" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """The options 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``. +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 max_samples: Maximum number of samples to generate. Required. - :vartype max_samples: int - :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 ``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[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.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, *, - max_samples: int, - train_split: Optional[float] = None, - model_options: Optional["_models.DataGenerationModelOptions"] = None, + event_id: str, + audio_start_ms: int, + item_id: str, ) -> None: ... @overload @@ -16383,52 +16854,48 @@ 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.INPUT_AUDIO_BUFFER_SPEECH_STARTED # type: ignore -class SkillDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A skill resource. +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 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 ``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 """ - 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.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, *, - id: str, # pylint: disable=redefined-builtin - name: str, - description: str, - created_at: datetime.datetime, - default_version: str, - latest_version: str, + event_id: str, + audio_end_ms: int, + item_id: str, ) -> None: ... @overload @@ -16440,52 +16907,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 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 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 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 ``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 """ - 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.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, *, - 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, + audio_start_ms: int, + audio_end_ms: int, + item_id: str, ) -> None: ... @overload @@ -16497,34 +16973,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 SkillReferenceParam( - ContainerSkill, discriminator="skill_reference" +class RealtimeServerEventMCPListToolsCompleted( + RealtimeServerEvent, discriminator="mcp_list_tools.completed" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """SkillReferenceParam. + """Returned when listing MCP tools has completed for an item. - :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 ``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 """ - 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.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, *, - skill_id: str, - version: Optional[str] = None, + event_id: str, + item_id: str, ) -> None: ... @overload @@ -16536,51 +17014,35 @@ 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.MCP_LIST_TOOLS_COMPLETED # type: ignore -class SkillVersion(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A specific version of a skill. +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 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 ``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 """ - 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.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, *, - id: str, # pylint: disable=redefined-builtin - skill_id: str, - name: str, - version: str, - description: str, - created_at: datetime.datetime, + event_id: str, + item_id: str, ) -> None: ... @overload @@ -16592,38 +17054,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 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 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 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 ``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 """ - __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.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, *, - type: str, + event_id: str, + item_id: str, ) -> None: ... @overload @@ -16635,21 +17095,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 SpecificApplyPatchParam(ToolChoiceParam, discriminator="apply_patch"): - """Specific apply patch tool choice. +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 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 ``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[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.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, + *, + event_id: str, + response_id: str, ) -> None: ... @overload @@ -16661,22 +17140,40 @@ 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.OUTPUT_AUDIO_BUFFER_CLEARED # type: ignore -class SpecificFunctionShellParam(ToolChoiceParam, discriminator="shell"): - """Specific shell tool choice. +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 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 ``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] """ - 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.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.""" @overload def __init__( self, + *, + event_id: str, + rate_limits: list["_models.RealtimeServerEventRateLimitsUpdatedRateLimits"], ) -> None: ... @overload @@ -16688,23 +17185,40 @@ 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.RATE_LIMITS_UPDATED # type: ignore -class SpecificProgrammaticToolCallingParam(ToolChoiceParam, discriminator="programmatic_tool_calling"): - """SpecificProgrammaticToolCallingParam. +class RealtimeServerEventRateLimitsUpdatedRateLimits( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeServerEventRateLimitsUpdatedRateLimits. - :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 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[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.""" + 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 @@ -16716,42 +17230,55 @@ 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 -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 RealtimeServerEventResponseAudioDelta( + RealtimeServerEvent, discriminator="response.output_audio.delta" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when the model-generated audio is updated. - :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 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 """ - 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.""" + 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, *, - description: Optional[str] = None, - default_value: Optional[Any] = None, - schema: Optional[dict[str, Any]] = None, - required: Optional[bool] = None, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + delta: bytes, ) -> None: ... @overload @@ -16763,40 +17290,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 StructuredOutputDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A structured output that can be produced by the agent. +class RealtimeServerEventResponseAudioDone( + RealtimeServerEvent, discriminator="response.output_audio.done" +): # 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. - :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 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 """ - 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.""" + 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, *, - name: str, - description: str, - schema: dict[str, Any], - strict: bool, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, ) -> None: ... @overload @@ -16808,58 +17347,57 @@ 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 -class TaxonomyCategory(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Taxonomy category definition. +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 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] + :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 """ - 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.""" + 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, *, - 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, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + delta: str, ) -> None: ... @overload @@ -16871,43 +17409,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 TaxonomySubCategory(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Taxonomy sub-category definition. +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 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] + :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 """ - 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.""" + 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, *, - id: str, # pylint: disable=redefined-builtin - name: str, - enabled: bool, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + transcript: str, ) -> None: ... @overload @@ -16919,25 +17472,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 TelemetryConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Customer-supplied telemetry configuration for exporting container logs, traces, and metrics. +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 endpoints: Customer-supplied telemetry export endpoint configurations. Required. - :vartype endpoints: list[~azure.ai.projects.models.TelemetryEndpoint] + :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 """ - endpoints: list["_models.TelemetryEndpoint"] = 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_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"] ) - """Customer-supplied telemetry export endpoint configurations. Required.""" + """The content part that was added. Required.""" @overload def __init__( self, *, - endpoints: list["_models.TelemetryEndpoint"], + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + part: "_models.RealtimeServerEventResponseContentPartAddedPart", ) -> None: ... @overload @@ -16949,30 +17536,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 TemplateVoiceGreetingConfig( - VoiceGreetingConfig, discriminator="template" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A deterministic greeting rendered with the voice agent's structured inputs and synthesized - without model-authored generation. +class RealtimeServerEventResponseContentPartAddedPart( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeServerEventResponseContentPartAddedPart. - :ivar type: Required. Default value is "template". - :vartype type: str - :ivar text: The Handlebars text template spoken at session start. Required. + :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 """ - type: Literal["template"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Default value is \"template\".""" - text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Handlebars text template spoken at session start. 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, *, - text: str, + type: Optional[Literal["audio", "text"]] = None, + text: Optional[str] = None, + audio: Optional[str] = None, + transcript: Optional[str] = None, ) -> None: ... @overload @@ -16984,34 +17579,108 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "template" # 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 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. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - TextResponseFormatJsonObject, TextResponseFormatJsonSchema, TextResponseFormatText + :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: Required. Known values are: "text", "json_schema", and "json_object". - :vartype type: str or ~azure.ai.projects.models.TextResponseFormatConfigurationType + 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 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", + ) -> 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_CONTENT_PART_DONE # type: ignore + + +class RealtimeServerEventResponseContentPartDonePart( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeServerEventResponseContentPartDonePart. + + :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 """ - __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\".""" + 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.""" @overload def __init__( self, *, - type: str, + 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 @@ -17025,20 +17694,35 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TextResponseFormatJsonObject(TextResponseFormat, discriminator="json_object"): - """JSON object. +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``. - :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 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[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.""" + 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"] + ) + """Required.""" @overload def __init__( self, + *, + event_id: str, + response: "_models.VoiceAgentRealtimeResponse", ) -> None: ... @overload @@ -17050,49 +17734,42 @@ 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 = RealtimeServerEventType.RESPONSE_CREATED # type: ignore -class TextResponseFormatJsonSchema( - TextResponseFormat, discriminator="json_schema" +class RealtimeServerEventResponseDone( + RealtimeServerEvent, discriminator="response.done" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """JSON schema. + """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 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 + :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[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"]) + 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"] + ) """Required.""" - strict: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - name: str, - schema: dict[str, Any], - description: Optional[str] = None, - strict: Optional[bool] = None, + event_id: str, + response: "_models.VoiceAgentRealtimeResponse", ) -> None: ... @overload @@ -17104,22 +17781,57 @@ 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 + self.type = RealtimeServerEventType.RESPONSE_DONE # type: ignore -class TextResponseFormatText(TextResponseFormat, discriminator="text"): - """Text. +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 type: The type of response format being defined. Always ``text``. Required. TEXT. - :vartype type: str or ~azure.ai.projects.models.TEXT + :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[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.""" + 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, + *, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + call_id: str, + delta: str, ) -> None: ... @overload @@ -17131,32 +17843,63 @@ 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 + self.type = RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA # type: ignore -class TimerRoutineTrigger( - RoutineTrigger, discriminator="timer" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A one-shot timer routine trigger. +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. - :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 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[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.""" + 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, *, - at: Optional[datetime.datetime] = None, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + call_id: str, + name: str, + arguments: str, ) -> None: ... @overload @@ -17168,36 +17911,56 @@ 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 = RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE # type: ignore -class ToolboxObject(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A toolbox that stores reusable tool definitions for agents. +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 id: The unique identifier of the toolbox. Required. - :vartype id: str - :ivar name: The name of the toolbox. Required. - :vartype name: str - :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 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 """ - 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.""" - 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.""" + 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, *, - id: str, # pylint: disable=redefined-builtin - name: str, - default_version: str, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + delta: str, + obfuscation: Optional[str] = None, ) -> None: ... @overload @@ -17209,23 +17972,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_MCP_CALL_ARGUMENTS_DELTA # 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 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 rai_config: Responsible AI content filtering configuration. - :vartype rai_config: ~azure.ai.projects.models.RaiConfig + :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 """ - rai_config: Optional["_models.RaiConfig"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Responsible AI content filtering configuration.""" + 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, *, - rai_config: Optional["_models.RaiConfig"] = None, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + arguments: str, ) -> None: ... @overload @@ -17237,36 +18029,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 ToolboxSearchPreviewToolboxTool( - ToolboxTool, discriminator="toolbox_search_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A toolbox search tool stored in a toolbox. +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 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 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 """ - 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.""" + 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, *, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + event_id: str, + output_index: int, + item_id: str, ) -> None: ... @overload @@ -17278,28 +18075,41 @@ 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 = RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED # 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 RealtimeServerEventResponseMCPCallFailed( + RealtimeServerEvent, discriminator="response.mcp_call.failed" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when an MCP tool call has failed. - :ivar type: The type of skill source. Required. Default value is None. - :vartype type: 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 """ - __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.""" + 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, *, - type: str, + event_id: str, + output_index: int, + item_id: str, ) -> None: ... @overload @@ -17311,36 +18121,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 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 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: 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 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["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.""" + 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, *, - name: str, - version: Optional[str] = None, + event_id: str, + output_index: int, + item_id: str, ) -> None: ... @overload @@ -17352,82 +18168,46 @@ 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 = RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS # 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 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. - 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 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 """ - 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.""" + 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, *, - 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, + event_id: str, + response_id: str, + output_index: int, + item: "_models.RealtimeConversationItem", ) -> None: ... @overload @@ -17439,58 +18219,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 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 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. - [ - { "type": "function", "name": "get_weather" }, - { "type": "mcp", "server_label": "deepwiki" }, - { "type": "image_generation" } - ] - :vartype tools: list[dict[str, any]] + :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 """ - 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\" } - ]""" - + 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, *, - mode: Literal["auto", "required"], - tools: list[dict[str, Any]], + event_id: str, + response_id: str, + output_index: int, + item: "_models.RealtimeConversationItem", ) -> None: ... @overload @@ -17502,23 +18271,56 @@ 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 = RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE # 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 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: Required. CODE_INTERPRETER. - :vartype type: str or ~azure.ai.projects.models.CODE_INTERPRETER + :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.CODE_INTERPRETER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. CODE_INTERPRETER.""" + 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 @@ -17530,23 +18332,57 @@ 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 = RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA # 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 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: Required. COMPUTER. - :vartype type: str or ~azure.ai.projects.models.COMPUTER + :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.COMPUTER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. COMPUTER.""" + 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 @@ -17558,23 +18394,47 @@ 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 + self.type = RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE # 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 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: Required. COMPUTER_USE. - :vartype type: str or ~azure.ai.projects.models.COMPUTER_USE + :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 id of the persisted conversation. Only present when conversation + persistence is enabled for the session. + :vartype conversation_id: str """ - type: Literal[ToolChoiceParamType.COMPUTER_USE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. COMPUTER_USE.""" + 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: "_models.VoiceAgentSessionResponseConfig" = 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 id of the persisted conversation. Only present when conversation persistence is enabled for + the session.""" @overload def __init__( self, + *, + event_id: str, + session: "_models.VoiceAgentSessionResponseConfig", + conversation_id: Optional[str] = None, ) -> None: ... @overload @@ -17586,23 +18446,39 @@ 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 = RealtimeServerEventType.SESSION_CREATED # 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 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. - :ivar type: Required. COMPUTER_USE_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.COMPUTER_USE_PREVIEW + :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[ToolChoiceParamType.COMPUTER_USE_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. COMPUTER_USE_PREVIEW.""" + 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: "_models.VoiceAgentSessionResponseConfig" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The session configuration. Required. Is one of the following types: + VoiceAgentSessionResponseConfig""" @overload def __init__( self, + *, + event_id: str, + session: "_models.VoiceAgentSessionResponseConfig", ) -> None: ... @overload @@ -17614,30 +18490,60 @@ 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 + self.type = RealtimeServerEventType.SESSION_UPDATED # type: ignore -class ToolChoiceCustom( - ToolChoiceParam, discriminator="custom" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Custom tool. +class Reasoning(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Reasoning. - :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 + :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 """ - 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.""" + 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, *, - name: str, + 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 @@ -17649,23 +18555,53 @@ 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 -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 RecurrenceTrigger( + Trigger, discriminator="Recurrence" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Recurrence based trigger. - :ivar type: Required. FILE_SEARCH. - :vartype type: str or ~azure.ai.projects.models.FILE_SEARCH + :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 """ - type: Literal[ToolChoiceParamType.FILE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. FILE_SEARCH.""" + 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, + *, + interval: int, + schedule: "_models.RecurrenceSchedule", + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_zone: Optional[str] = None, ) -> None: ... @overload @@ -17677,30 +18613,88 @@ 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 = TriggerType.RECURRENCE # type: ignore -class ToolChoiceFunction( - ToolChoiceParam, discriminator="function" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Function tool. +class RedTeam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Red team details. - :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. + :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 """ - 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.""" + 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, *, - name: str, + 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 @@ -17712,23 +18706,35 @@ 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 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 ReminderPreviewToolboxTool( + ToolboxTool, discriminator="reminder_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A reminder tool stored in a toolbox. - :ivar type: Required. IMAGE_GENERATION. - :vartype type: str or ~azure.ai.projects.models.IMAGE_GENERATION + :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 """ - type: Literal[ToolChoiceParamType.IMAGE_GENERATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. IMAGE_GENERATION.""" + type: Literal[ToolboxToolType.REMINDER_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. REMINDER_PREVIEW.""" @overload def __init__( self, + *, + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -17740,34 +18746,33 @@ 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 = ToolboxToolType.REMINDER_PREVIEW # type: ignore -class ToolChoiceMCP( - ToolChoiceParam, discriminator="mcp" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """MCP tool. +class ResponsesProtocolConfiguration(_Model): + """Configuration specific to the responses protocol.""" - :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 + +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 """ - 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"]) + 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, *, - server_label: str, - name: Optional[str] = None, + cached_tokens: int, + cache_write_tokens: int, ) -> None: ... @overload @@ -17779,23 +18784,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 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 ResponseUsageOutputTokensDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ResponseUsageOutputTokensDetails. - :ivar type: Required. WEB_SEARCH_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_PREVIEW + :ivar reasoning_tokens: Required. + :vartype reasoning_tokens: int """ - type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. WEB_SEARCH_PREVIEW.""" + reasoning_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, + *, + reasoning_tokens: int, ) -> None: ... @overload @@ -17807,23 +18812,59 @@ 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 -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 Routine(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A routine definition returned by the service. - :ivar type: Required. WEB_SEARCH_PREVIEW_2025_03_11. - :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_PREVIEW_2025_03_11 + :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 """ - 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.""" + 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.""" @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, ) -> None: ... @overload @@ -17835,35 +18876,29 @@ 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 ToolConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Per-tool configuration that controls tool visibility and search behavior. +class RoutineAuthorization(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Optional authorization configuration for a routine dispatch. - :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 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 """ - 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.""" + 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, *, - pin: Optional[bool] = None, - additional_search_text: Optional[str] = None, + identity: Optional[Union[str, "_models.RoutineDispatchIdentity"]] = None, ) -> None: ... @overload @@ -17877,26 +18912,162 @@ 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. +class RoutineRun(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A single routine run returned from the run history API. - :ivar name: The name of the tool. - :vartype name: str - :ivar description: A brief description of the tool's purpose. - :vartype description: 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 """ - 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.""" + 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, *, - name: Optional[str] = None, - description: Optional[str] = None, + 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 @@ -17910,22 +19081,61 @@ 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. +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 project_connection_id: A project connection in a ToolProjectConnectionList attached to - this tool. Required. - :vartype project_connection_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. 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 """ - project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A project connection in a ToolProjectConnectionList attached to this tool. 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, *, - project_connection_id: str, + 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 @@ -17937,35 +19147,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 ToolSearchToolboxTool( - ToolboxTool, discriminator="toolbox_search" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A toolbox search tool stored in a toolbox. +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 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 + :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.inputs.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 """ - 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.""" + 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( + 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.inputs.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, *, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = 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 @@ -17977,44 +19218,25 @@ 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 -class ToolSearchToolParam( - Tool, discriminator="tool_search" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Tool search tool. +class SASCredentials(BaseCredentials, discriminator="SAS"): + """Shared Access Signature (SAS) credential definition. - :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 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 """ - 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"] - ) + 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, - *, - execution: Optional[Union[str, "_models.ToolSearchExecutionType"]] = None, - description: Optional[str] = None, - parameters: Optional["_models.EmptyModelParam"] = None, ) -> None: ... @overload @@ -18026,37 +19248,74 @@ 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 = CredentialType.SAS # type: ignore -class ToolUseFineTuningDataGenerationJobOptions( - DataGenerationJobOptions, discriminator="tool_use" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The options for a data generation job with ToolUse type. Used only for fine-tuning scenarios. +class Schedule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Schedule model. - :ivar max_samples: Maximum number of samples to generate. Required. - :vartype max_samples: int - :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 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] """ - 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.""" + 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.""" @overload def __init__( self, *, - max_samples: int, - train_split: Optional[float] = None, - model_options: Optional["_models.DataGenerationModelOptions"] = None, + 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 @@ -18068,44 +19327,36 @@ 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 TracesDataGenerationJobOptions( - DataGenerationJobOptions, discriminator="traces" +class ScheduleRoutineTrigger( + RoutineTrigger, discriminator="schedule" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """The options for a data generation job with Traces type. + """A recurring cron-based routine trigger. - :ivar max_samples: Maximum number of samples to generate. Required. - :vartype max_samples: int - :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 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 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[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.""" - 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.""" + 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, *, - max_samples: int, - train_split: Optional[float] = None, - model_options: Optional["_models.DataGenerationModelOptions"] = None, - redact_private_content: Optional[bool] = None, + cron_expression: str, + time_zone: str, ) -> None: ... @overload @@ -18117,68 +19368,80 @@ 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.type = RoutineTriggerType.SCHEDULE # type: ignore -class TracesDataGenerationJobSource( - DataGenerationJobSource, discriminator="traces" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Traces source for data generation jobs — conversation traces from Application Insights. +class ScheduleRun(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Schedule run model. - :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 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] """ - 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" + 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" ) - """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" + """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 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. Optional — when unset, the server default of 900 seconds is used. Must be between + 120 and 3600 seconds (inclusive). + :vartype idle_timeout_seconds: ~datetime.timedelta + """ + + idle_timeout_seconds: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-seconds-int" ) - """End of the time window (Unix timestamp in seconds). Defaults to current time.""" + """The idle duration, in seconds, before a session's sandbox is suspended. Optional — when unset, + the server default of 900 seconds is used. Must be between 120 and 3600 seconds (inclusive).""" @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, + idle_timeout_seconds: Optional[datetime.timedelta] = None, ) -> None: ... @overload @@ -18190,71 +19453,40 @@ 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 SessionDirectoryEntry(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A single entry in a directory listing. - :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 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 """ - 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( + 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" ) - """End of the time window (Unix timestamp in seconds). Defaults to current time.""" + """The Unix timestamp (in seconds) when the file was last modified. Required.""" @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, + name: str, + size: int, + is_directory: bool, + modified_time: datetime.datetime, ) -> None: ... @overload @@ -18266,33 +19498,29 @@ 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 TranscriptTextUsageDuration( - CreateTranscriptionResponseJsonUsage, discriminator="duration" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Duration Usage. +class SessionFileWriteResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Response from uploading a file to a session sandbox. - :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 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 """ - 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.""" + 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, *, - seconds: datetime.timedelta, + path: str, + bytes_written: int, ) -> None: ... @overload @@ -18304,48 +19532,53 @@ 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 SessionLogEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A single Server-Sent Event frame emitted by the hosted agent session log stream. - :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 + 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 """ - 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( + event: Union[str, "_models.SessionLogEventType"] = 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.""" + """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, *, - input_tokens: int, - output_tokens: int, - total_tokens: int, - input_token_details: Optional["_models.TranscriptTextUsageTokensInputTokenDetails"] = None, + event: Union[str, "_models.SessionLogEventType"], + data: str, ) -> None: ... @overload @@ -18357,29 +19590,27 @@ 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 SharepointGroundingToolParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The sharepoint grounding tool parameters. - :ivar text_tokens: - :vartype text_tokens: int - :ivar audio_tokens: - :vartype audio_tokens: int + :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] """ - text_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - audio_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + 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, *, - text_tokens: Optional[int] = None, - audio_tokens: Optional[int] = None, + project_connections: Optional[list["_models.ToolProjectConnection"]] = None, ) -> None: ... @overload @@ -18393,26 +19624,32 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -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 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 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: 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 """ - 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.""" + 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, *, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, + sharepoint_grounding_preview: "_models.SharepointGroundingToolParameters", ) -> None: ... @overload @@ -18424,25 +19661,52 @@ 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 -class UpdateToolboxRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """UpdateToolboxRequest. +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 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 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 """ - 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[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, *, - default_version: str, + 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 @@ -18454,39 +19718,44 @@ 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 -class UserProfileMemoryItem( - MemoryItem, discriminator="user_profile" +class SimpleQnADataGenerationJobOptions( + DataGenerationJobOptions, discriminator="simple_qna" ): # 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. + """The options for a data generation job with SimpleQnA type. - :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 max_samples: Maximum number of samples to generate. Required. + :vartype max_samples: int + :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 question_types: The question types to generate. Used only for fine-tuning scenarios. + :vartype question_types: list[str or ~azure.ai.projects.models.SimpleQnAFineTuningQuestionType] """ - 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.""" + 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.""" + 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, *, - memory_id: str, - updated_at: datetime.datetime, - scope: str, - content: str, + 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 @@ -18498,28 +19767,39 @@ 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 - + self.type = DataGenerationJobType.SIMPLE_QNA # 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 SimulationSeedDataGenerationJobOptions( + DataGenerationJobOptions, discriminator="simulation_seed" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The options 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 type: The type of version indicator. Required. "version_ref" - :vartype type: str or ~azure.ai.projects.models.VersionIndicatorType + :ivar max_samples: Maximum number of samples to generate. Required. + :vartype max_samples: int + :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 """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of version indicator. Required. \"version_ref\"""" + 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, *, - type: str, + max_samples: int, + train_split: Optional[float] = None, + model_options: Optional["_models.DataGenerationModelOptions"] = None, ) -> None: ... @overload @@ -18531,30 +19811,52 @@ 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 -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 SkillDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A skill resource. - :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 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 """ - 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.""" + 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, *, - agent_version: str, + id: str, # pylint: disable=redefined-builtin + name: str, + description: str, + created_at: datetime.datetime, + default_version: str, + latest_version: str, ) -> None: ... @overload @@ -18566,26 +19868,52 @@ 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 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 version_selection_rules: Required. - :vartype version_selection_rules: list[~azure.ai.projects.models.VersionSelectionRule] + :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] """ - version_selection_rules: list["_models.VersionSelectionRule"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required.""" + 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, *, - version_selection_rules: list["_models.VersionSelectionRule"], + 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 @@ -18599,28 +19927,32 @@ 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 SkillReferenceParam( + ContainerSkill, discriminator="skill_reference" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """SkillReferenceParam. - :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 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 """ - 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"] - ) - """The requested animation output kinds.""" + 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, *, - model_name: Optional[str] = None, - outputs: Optional[list[Union[str, "_models.VoiceAgentAnimationOutputType"]]] = None, + skill_id: str, + version: Optional[str] = None, ) -> None: ... @overload @@ -18632,31 +19964,51 @@ 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 -class VoiceAgentAvatarIceServer(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """An ICE server used for avatar WebRTC negotiation. +class SkillVersion(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A specific version of a skill. - :ivar urls: Required. - :vartype urls: list[str] - :ivar username: - :vartype username: str - :ivar credential: - :vartype credential: str + :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 """ - 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"]) + 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, *, - urls: list[str], - username: Optional[str] = None, - credential: Optional[str] = None, + id: str, # pylint: disable=redefined-builtin + skill_id: str, + name: str, + version: str, + description: str, + created_at: datetime.datetime, ) -> None: ... @overload @@ -18670,44 +20022,36 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentAvatarScene(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Avatar placement and motion settings. +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. - :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 + 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 """ - 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"]) + __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, *, - 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, + type: str, ) -> None: ... @overload @@ -18721,24 +20065,19 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentAvatarVideoBackground(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The avatar video background. +class SpecificApplyPatchParam(ToolChoiceParam, discriminator="apply_patch"): + """Specific apply patch tool choice. - :ivar image_url: - :vartype image_url: str - :ivar color: - :vartype color: str + :ivar type: The tool to call. Always ``apply_patch``. Required. APPLY_PATCH. + :vartype type: str or ~azure.ai.projects.models.APPLY_PATCH """ - 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[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, - *, - image_url: Optional[str] = None, - color: Optional[str] = None, ) -> None: ... @overload @@ -18750,28 +20089,22 @@ 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 -class VoiceAgentAvatarVideoCrop(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The rectangular crop applied to avatar video. +class SpecificFunctionShellParam(ToolChoiceParam, discriminator="shell"): + """Specific shell tool choice. - :ivar bottom_right: Required. - :vartype bottom_right: list[int] - :ivar top_left: Required. - :vartype top_left: list[int] + :ivar type: The tool to call. Always ``shell``. Required. SHELL. + :vartype type: str or ~azure.ai.projects.models.SHELL """ - 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.""" + 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, - *, - bottom_right: list[int], - top_left: list[int], ) -> None: ... @overload @@ -18783,44 +20116,23 @@ 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 -class VoiceAgentAvatarVideoParams(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Avatar video encoder and presentation settings. +class SpecificProgrammaticToolCallingParam(ToolChoiceParam, discriminator="programmatic_tool_calling"): + """SpecificProgrammaticToolCallingParam. - :ivar bitrate: - :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 type: The tool to call. Always ``programmatic_tool_calling``. Required. + PROGRAMMATIC_TOOL_CALLING. + :vartype type: str or ~azure.ai.projects.models.PROGRAMMATIC_TOOL_CALLING """ - bitrate: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - crop: Optional["_models.VoiceAgentAvatarVideoCrop"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - 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"]) + 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, - *, - 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 @@ -18832,28 +20144,42 @@ 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 -class VoiceAgentAvatarVideoResolution(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The avatar video resolution. +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 width: Required. - :vartype width: int - :ivar height: Required. - :vartype height: int + :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 """ - width: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - height: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + 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, *, - width: int, - height: int, + description: Optional[str] = None, + default_value: Optional[Any] = None, + schema: Optional[dict[str, Any]] = None, + required: Optional[bool] = None, ) -> None: ... @overload @@ -18867,62 +20193,38 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentClientEventConversationItemCreate( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``conversation.item.create`` client event. +class StructuredOutputDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A structured output that can be produced by the agent. - :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: The conversation item to create. Required. Is one of the following types: - VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, - VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem - :vartype item: ~azure.ai.projects.models.VoiceSystemMessageItem or - ~azure.ai.projects.models.VoiceUserMessageItem or - ~azure.ai.projects.models.VoiceAssistantMessageItem or - ~azure.ai.projects.models.VoiceFunctionCallItem or - ~azure.ai.projects.models.VoiceFunctionCallOutputItem or - ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem - or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or - ~azure.ai.projects.models.VoiceMcpApprovalResponseItem + :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 """ - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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: "_unions.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The conversation item to create. Required. Is one of the following types: - VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, - VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem""" + 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, *, - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE], - item: "_unions.VoiceConversationItem", - event_id: Optional[str] = None, - previous_item_id: Optional[str] = None, + name: str, + description: str, + schema: dict[str, Any], + strict: bool, ) -> None: ... @overload @@ -18935,37 +20237,57 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - -class VoiceAgentClientEventConversationItemDelete( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``conversation.item.delete`` client event. - - :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 + +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] """ - 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_field( - visibility=["read", "create", "update", "delete", "query"] + 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"] ) - """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.""" + """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, *, - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE], - item_id: str, - event_id: Optional[str] = None, + 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 @@ -18979,36 +20301,41 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentClientEventConversationItemRetrieve( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``conversation.item.retrieve`` client event. +class TaxonomySubCategory(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Taxonomy sub-category definition. - :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 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] """ - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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.""" + 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, *, - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE], - item_id: str, - event_id: Optional[str] = None, + id: str, # pylint: disable=redefined-builtin + name: str, + enabled: bool, + description: Optional[str] = None, + properties: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -19022,51 +20349,23 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentClientEventConversationItemTruncate( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``conversation.item.truncate`` client event. +class TelemetryConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Customer-supplied telemetry configuration for exporting container logs, traces, and metrics. - :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 endpoints: Customer-supplied telemetry export endpoint configurations. Required. + :vartype endpoints: list[~azure.ai.projects.models.TelemetryEndpoint] """ - 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_field( + endpoints: list["_models.TelemetryEndpoint"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """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.""" + """Customer-supplied telemetry export endpoint configurations. Required.""" @overload def __init__( self, *, - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE], - item_id: str, - content_index: int, - audio_end_ms: int, - event_id: Optional[str] = None, + endpoints: list["_models.TelemetryEndpoint"], ) -> None: ... @overload @@ -19080,38 +20379,31 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentClientEventInputAudioBufferAppend( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``input_audio_buffer.append`` client event. +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. - :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 + 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 """ - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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.""" + __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: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND], - audio: str, - event_id: Optional[str] = None, + type: str, ) -> None: ... @overload @@ -19125,31 +20417,20 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentClientEventInputAudioBufferClear( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``input_audio_buffer.clear`` client event. +class TextResponseFormatJsonObject(TextResponseFormat, discriminator="json_object"): + """JSON object. - :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 type: The type of response format being defined. Always ``json_object``. Required. + JSON_OBJECT. + :vartype type: str or ~azure.ai.projects.models.JSON_OBJECT """ - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The event type, must be ``input_audio_buffer.clear``. Required. INPUT_AUDIO_BUFFER_CLEAR.""" + 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, - *, - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR], - event_id: Optional[str] = None, ) -> None: ... @overload @@ -19161,33 +20442,49 @@ 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 -class VoiceAgentClientEventInputAudioBufferCommit( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``input_audio_buffer.commit`` client event. +class TextResponseFormatJsonSchema( + TextResponseFormat, discriminator="json_schema" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """JSON schema. - :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 + :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 """ - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The event type, must be ``input_audio_buffer.commit``. Required. INPUT_AUDIO_BUFFER_COMMIT.""" + 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, *, - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT], - event_id: Optional[str] = None, + name: str, + schema: dict[str, Any], + description: Optional[str] = None, + strict: Optional[bool] = None, ) -> None: ... @overload @@ -19199,33 +20496,22 @@ 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 VoiceAgentClientEventOutputAudioBufferClear( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``output_audio_buffer.clear`` client event. - - :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 - """ +class TextResponseFormatText(TextResponseFormat, discriminator="text"): + """Text. - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The event type, must be ``output_audio_buffer.clear``. Required. OUTPUT_AUDIO_BUFFER_CLEAR.""" + :ivar type: The type of response format being defined. Always ``text``. Required. TEXT. + :vartype type: str or ~azure.ai.projects.models.TEXT + """ + + 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, - *, - type: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR], - event_id: Optional[str] = None, ) -> None: ... @overload @@ -19237,37 +20523,32 @@ 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 VoiceAgentClientEventResponseCancel(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``response.cancel`` client event. +class TimerRoutineTrigger( + RoutineTrigger, discriminator="timer" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A one-shot timer routine trigger. - :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 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 """ - 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_field( - visibility=["read", "create", "update", "delete", "query"] + 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 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.""" + """The UTC date and time at which the timer fires.""" @overload def __init__( self, *, - type: Literal[RealtimeClientEventType.RESPONSE_CANCEL], - event_id: Optional[str] = None, - response_id: Optional[str] = None, + at: Optional[datetime.datetime] = None, ) -> None: ... @overload @@ -19279,37 +20560,36 @@ 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 -class VoiceAgentClientEventResponseCreate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``response.create`` client event. +class ToolboxObject(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A toolbox that stores reusable tool definitions for agents. - :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: Parameters for the new response. - :vartype response: ~azure.ai.projects.models.VoiceAgentResponseCreateParams + :ivar id: The unique identifier of the toolbox. Required. + :vartype id: str + :ivar name: The name of the toolbox. Required. + :vartype name: str + :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 """ - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The event type, must be ``response.create``. Required. RESPONSE_CREATE.""" - response: Optional["_models.VoiceAgentResponseCreateParams"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Parameters for the new response.""" + 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.""" + 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, *, - type: Literal[RealtimeClientEventType.RESPONSE_CREATE], - event_id: Optional[str] = None, - response: Optional["_models.VoiceAgentResponseCreateParams"] = None, + id: str, # pylint: disable=redefined-builtin + name: str, + default_version: str, ) -> None: ... @overload @@ -19323,34 +20603,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentClientEventSessionAvatarConnect( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``session.avatar.connect`` client event. +class ToolboxPolicies(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Policy configuration for a toolbox, including content safety and other governance settings. - :ivar type: The event type. Always ``session.avatar.connect``. Required. Default value is - "session.avatar.connect". - :vartype type: str - :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 rai_config: Responsible AI content filtering configuration. + :vartype rai_config: ~azure.ai.projects.models.RaiConfig """ - type: Literal["session.avatar.connect"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The event type. Always ``session.avatar.connect``. Required. Default value is - \"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.""" + rai_config: Optional["_models.RaiConfig"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Responsible AI content filtering configuration.""" @overload def __init__( self, *, - client_sdp: str, - event_id: Optional[str] = None, + rai_config: Optional["_models.RaiConfig"] = None, ) -> None: ... @overload @@ -19362,42 +20629,36 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["session.avatar.connect"] = "session.avatar.connect" -class VoiceAgentClientEventSessionUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``session.update`` client event. +class ToolboxSearchPreviewToolboxTool( + ToolboxTool, discriminator="toolbox_search_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A toolbox search tool stored in a toolbox. - :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 stable realtime session fields to update. Required. - :vartype session: ~azure.ai.projects.models.VoiceAgentSessionUpdateConfig + :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 """ - 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: "_models.VoiceAgentSessionUpdateConfig" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The stable realtime session fields to update. 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: Literal[RealtimeClientEventType.SESSION_UPDATE], - session: "_models.VoiceAgentSessionUpdateConfig", - event_id: Optional[str] = None, + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -19409,187 +20670,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 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. - - :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 agent is served. Together with ``model``, this - selects the model up front. ``managed`` uses a service-managed model; ``self_deployed`` uses - the customer's own Foundry deployment. This is independent of the architecture (realtime or - cascaded), which the service derives from the selected model. Required. 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, paired with ``model_type``: the service-managed - model name when ``model_type`` is ``managed``, or the customer's Foundry deployment name when - ``model_type`` is ``self_deployed``. The model must support realtime or cascaded voice. The - service derives the architecture from the selected model. Required. - :vartype model: str - :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.VoiceGreetingConfig - :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.VoiceAudioConfig - :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. Is either a - VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. - :vartype interim_response: ~azure.ai.projects.models.VoiceAgentStaticInterimResponseConfig or - ~azure.ai.projects.models.VoiceAgentLlmInterimResponseConfig - :ivar avatar: Optional avatar configuration. These values are session defaults and may be - overridden when connecting. - :vartype avatar: ~azure.ai.projects.models.VoiceAvatarConfig - :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 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 - """ +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. - 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: Union[str, "_models.VoiceModelType"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """How the model backing this agent is served. Together with ``model``, this selects the model up - front. ``managed`` uses a service-managed model; ``self_deployed`` uses the customer's own - Foundry deployment. This is independent of the architecture (realtime or cascaded), which the - service derives from the selected model. Required. Known values are: \"managed\" and - \"self_deployed\".""" - model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The model to use for this agent, paired with ``model_type``: the service-managed model name - when ``model_type`` is ``managed``, or the customer's Foundry deployment name when - ``model_type`` is ``self_deployed``. The model must support realtime or cascaded voice. The - service derives the architecture from the selected model. Required.""" - 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.VoiceGreetingConfig"] = 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.VoiceAudioConfig"] = 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["_unions.VoiceAgentInterimResponse"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Interim-response settings for latency and tool execution. Is either a - VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type.""" - avatar: Optional["_models.VoiceAvatarConfig"] = 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( + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ToolboxShellContainerAutoEnvironment, ToolboxShellContainerReferenceEnvironment + + :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 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"] ) - """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( + """Known values are: \"1g\", \"4g\", \"16g\", and \"64g\".""" + skills: Optional[list["_models.ContainerSkill"]] = 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( + """An optional list of skills referenced by id or inline data.""" + network_policy: Optional["_models.ToolboxShellNetworkPolicy"] = 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.""" - 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 network access policy for the container. When omitted, the service defaults to disabled + outbound network access.""" @overload def __init__( self, *, - model_type: Union[str, "_models.VoiceModelType"], - model: str, - rai_config: Optional["_models.RaiConfig"] = None, - instructions: Optional[str] = None, - greeting: Optional["_models.VoiceGreetingConfig"] = None, - audio: Optional["_models.VoiceAudioConfig"] = 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["_unions.VoiceAgentInterimResponse"] = None, - avatar: Optional["_models.VoiceAvatarConfig"] = 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, - store: Optional[bool] = 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 @@ -19601,42 +20763,32 @@ 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 + self.type = "container_auto" # type: ignore -class VoiceAgentEchoCancellation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Server-side echo cancellation settings for input audio. +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. - :ivar type: The echo cancellation implementation. Always ``server_echo_cancellation``. - Required. Default value is "server_echo_cancellation". + :ivar type: The type of the shell execution environment. Always ``container_reference``. + Required. Default value is "container_reference". :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 container_id: The ID of the referenced container. Required. + :vartype container_id: str """ - 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``.""" + 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, *, - reference_source: Optional[Union[str, "_models.VoiceAgentEchoCancellationReferenceSource"]] = None, - channels: Optional[int] = None, + container_id: str, ) -> None: ... @overload @@ -19648,22 +20800,22 @@ 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" + self.type = "container_reference" # type: ignore -class VoiceAgentTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A tool usable by a voice agent. +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: - VoiceAgentFunctionTool, VoiceAgentMcpTool, VoiceSystemTool, VoiceToolboxTool + ToolboxShellNetworkPolicyDisabled - :ivar type: The tool kind. Required. Default value is None. + :ivar type: The type of network access policy. 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 tool kind. Required. Default value is None.""" + """The type of network access policy. Required. Default value is None.""" @overload def __init__( @@ -19683,41 +20835,95 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentFunctionTool( - VoiceAgentTool, discriminator="function" +class ToolboxShellNetworkPolicyDisabled(ToolboxShellNetworkPolicy, discriminator="disabled"): + """A network policy that disables outbound access from a toolbox shell container. + + :ivar type: The type of network access policy. Always ``disabled``. Required. Default value is + "disabled". + :vartype type: str + """ + + 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, + ) -> 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 = "disabled" # 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 + + :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"]) + """The type of skill source. 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 ToolboxSkillReference( + ToolboxSkill, discriminator="skill_reference" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """A native function tool executed by the client. + """A reference to an existing skill to include in a toolbox. - :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". + :ivar type: The type of skill source. Required. Default value is "skill_reference". :vartype type: str - :ivar name: The function name. Required. + :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 """ - 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\".""" + 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 function name. Required.""" + """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, - description: Optional[str] = None, - parameters: Optional["_models.RealtimeFunctionToolParameters"] = None, + version: Optional[str] = None, ) -> None: ... @overload @@ -19729,42 +20935,82 @@ 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 = "skill_reference" # type: ignore -class VoiceAgentInterimResponseConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Fields shared by interim-response configurations. +class ToolboxVersionObject(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A specific version of a toolbox. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - VoiceAgentLlmInterimResponseConfig, VoiceAgentStaticInterimResponseConfig + :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. - :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 + 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 """ - __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( + 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"] ) - """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 list of skill sources included in this toolbox version.""" + policies: Optional["_models.ToolboxPolicies"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The latency threshold in milliseconds.""" + """Policy configuration for the toolbox version.""" @overload def __init__( self, *, - type: str, - triggers: Optional[list[Union[str, "_models.VoiceAgentInterimResponseTrigger"]]] = None, - latency_threshold_ms: Optional[datetime.timedelta] = None, + 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 @@ -19778,43 +21024,56 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentLlmInterimResponseConfig( - VoiceAgentInterimResponseConfig, discriminator="llm_interim_response" +class ToolChoiceAllowed( + ToolChoiceParam, discriminator="allowed_tools" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """An interim response generated by a language model. + """Allowed tools. - :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 type: Required. Default value is "llm_interim_response". - :vartype type: str - :ivar model: The model used to generate interim responses. - :vartype model: str - :ivar instructions: Optional instructions for generating interim responses. - :vartype instructions: str - :ivar max_completion_tokens: The maximum completion-token count for an interim response. - :vartype max_completion_tokens: int + :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["llm_interim_response"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Default value is \"llm_interim_response\".""" - model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The model used to generate interim responses.""" - instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional instructions for generating interim responses.""" - max_completion_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The maximum completion-token count for an interim response.""" + 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, *, - triggers: Optional[list[Union[str, "_models.VoiceAgentInterimResponseTrigger"]]] = None, - latency_threshold_ms: Optional[datetime.timedelta] = None, - model: Optional[str] = None, - instructions: Optional[str] = None, - max_completion_tokens: Optional[int] = None, + mode: Literal["auto", "required"], + tools: list[dict[str, Any]], ) -> None: ... @overload @@ -19826,104 +21085,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "llm_interim_response" # type: ignore + self.type = ToolChoiceParamType.ALLOWED_TOOLS # type: ignore -class VoiceAgentMcpTool( - VoiceAgentTool, discriminator="mcp" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """An MCP tool available to a voice agent. +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 server_label: A label for this MCP server, used to identify it in tool calls. Required. - :vartype server_label: 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] - :ivar type: Required. Default value is "mcp". - :vartype type: str - :ivar server_url: The URL for the MCP server. - :vartype server_url: str - :ivar response_scheduling: When the MCP invocation creates a follow-up response. Defaults to - ``when_idle``. Known values are: "silent", "when_idle", "interrupt", and "skip_if_busy". - :vartype response_scheduling: str or ~azure.ai.projects.models.VoiceAgentToolResponseScheduling + :ivar type: Required. CODE_INTERPRETER. + :vartype type: str or ~azure.ai.projects.models.CODE_INTERPRETER """ - 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.""" - 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.""" - type: Literal["mcp"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Default value is \"mcp\".""" - server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The URL for the MCP server.""" - response_scheduling: Optional[Union[str, "_models.VoiceAgentToolResponseScheduling"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """When the MCP invocation creates a follow-up response. Defaults to ``when_idle``. Known values - are: \"silent\", \"when_idle\", \"interrupt\", and \"skip_if_busy\".""" + type: Literal[ToolChoiceParamType.CODE_INTERPRETER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. CODE_INTERPRETER.""" @overload def __init__( self, - *, - server_label: str, - 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, - server_url: Optional[str] = None, - response_scheduling: Optional[Union[str, "_models.VoiceAgentToolResponseScheduling"]] = None, ) -> None: ... @overload @@ -19935,86 +21113,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "mcp" # type: ignore - + self.type = ToolChoiceParamType.CODE_INTERPRETER # type: ignore -class VoiceAgentRealtimeResponse( - OmitPropertiesRealtimeResponse1 -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A live realtime response returned by the voice-agent service in both ``response.created`` and - ``response.done`` events. - :ivar id: The unique ID of the response, will look like ``resp_1234``. - :vartype id: str - :ivar object: The object type, must be ``realtime.response``. Default value is - "realtime.response". - :vartype object: str - :ivar status: The final status of the response (``completed``, ``cancelled``, ``failed``, or - ``incomplete``, ``in_progress``). Is one of the following types: Literal["completed"], - Literal["cancelled"], Literal["failed"], Literal["incomplete"], Literal["in_progress"] - :vartype status: str or str or str or str or str - :ivar status_details: Additional details about the status. - :vartype status_details: ~azure.ai.projects.models.RealtimeResponseStatusDetails - :ivar metadata: - :vartype metadata: ~azure.ai.projects.models.Metadata - :ivar usage: Usage statistics for the Response, this will correspond to billing. A Realtime API - session will maintain a conversation context and append new Items to the Conversation, thus - output from previous turns (text and audio tokens) will become the input for later turns. - :vartype usage: ~azure.ai.projects.models.RealtimeResponseUsage - :ivar conversation_id: Which conversation the response is added to, determined by the - ``conversation`` field in the ``response.create`` event. If ``auto``, the response will be - added to the default conversation and the value of ``conversation_id`` will be an id like - ``conv_1234``. If ``none``, the response will not be added to any conversation and the value of - ``conversation_id`` will be ``null``. If responses are being triggered automatically by VAD the - response will be added to the default conversation. - :vartype conversation_id: str - :ivar output_modalities: The set of modalities the model used to respond, currently the only - possible values are ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text - transcript. Setting the output to mode ``text`` will disable audio output from the model. - :vartype output_modalities: list[str or str] - :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, - inclusive of tool calls, that was used in this response. Is either a int type or a - Literal["inf"] type. - :vartype max_output_tokens: int or str - :ivar audio: The audio configuration used by the live response, including flat voice provider, - locale, and format fields under ``output``. - :vartype audio: ~azure.ai.projects.models.VoiceResponseAudio - :ivar output: The items produced by the live response. - :vartype output: list[~azure.ai.projects.models.VoiceSystemMessageItem or - ~azure.ai.projects.models.VoiceUserMessageItem or - ~azure.ai.projects.models.VoiceAssistantMessageItem or - ~azure.ai.projects.models.VoiceFunctionCallItem or - ~azure.ai.projects.models.VoiceFunctionCallOutputItem or - ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem - or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or - ~azure.ai.projects.models.VoiceMcpApprovalResponseItem] - """ +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 `_. - audio: Optional["_models.VoiceResponseAudio"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The audio configuration used by the live response, including flat voice provider, locale, and - format fields under ``output``.""" - output: Optional[list["_unions.VoiceConversationItem"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The items produced by the live response.""" + :ivar type: Required. COMPUTER. + :vartype type: str or ~azure.ai.projects.models.COMPUTER + """ + + type: Literal[ToolChoiceParamType.COMPUTER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. COMPUTER.""" @overload def __init__( self, - *, - id: Optional[str] = None, # pylint: disable=redefined-builtin - object: Optional[Literal["realtime.response"]] = None, - status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] = None, - status_details: Optional["_models.RealtimeResponseStatusDetails"] = None, - metadata: Optional["_models.Metadata"] = None, - usage: Optional["_models.RealtimeResponseUsage"] = None, - conversation_id: Optional[str] = None, - output_modalities: Optional[list[Literal["text", "audio"]]] = None, - max_output_tokens: Optional[Union[int, Literal["inf"]]] = None, - audio: Optional["_models.VoiceResponseAudio"] = None, - output: Optional[list["_unions.VoiceConversationItem"]] = None, ) -> None: ... @overload @@ -20026,150 +21141,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 VoiceAgentResponseCreateParams(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Parameters accepted by a voice-agent ``response.create`` event. +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 instructions: The default system instructions (i.e. system message) prepended to model - calls. This field allows the client to guide the model on desired responses. The model can be - instructed on response content and format, (e.g. "be extremely succinct", "act friendly", "here - are examples of good responses") and on audio behavior (e.g. "talk quickly", "inject emotion - into your voice", "laugh frequently"). The instructions are not guaranteed to be followed by - the model, but they provide guidance to the model on the desired behavior. Note that the server - sets default instructions which will be used if this field is not set and are visible in the - ``session.created`` event at the start of the session. - :vartype instructions: str - :ivar tools: Tools available to the model. - :vartype tools: list[~azure.ai.projects.models.RealtimeFunctionTool or - ~azure.ai.projects.models.MCPTool] - :ivar tool_choice: How the model chooses tools. Provide one of the string modes or force a - specific function/MCP tool. Is one of the following types: Union[str, - "_models.ToolChoiceOptions"], ToolChoiceFunction, ToolChoiceMCP - :vartype tool_choice: str or ~azure.ai.projects.models.ToolChoiceOptions 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. Only - supported by reasoning Realtime models such as ``gpt-realtime-2``. - :vartype parallel_tool_calls: bool - :ivar reasoning: - :vartype reasoning: ~azure.ai.projects.models.RealtimeReasoning - :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, - inclusive of tool calls. Provide an integer between 1 and 4096 to limit output tokens, or - ``inf`` for the maximum available tokens for a given model. Defaults to ``inf``. Is either a - int type or a Literal["inf"] type. - :vartype max_output_tokens: int or str - :ivar conversation: Controls which conversation the response is added to. Currently supports - ``auto`` and ``none``, with ``auto`` as the default value. The ``auto`` value means that the - contents of the response will be added to the default conversation. Set this to ``none`` to - create an out-of-band response which will not add items to default conversation. Is one of the - following types: Literal["auto"], Literal["none"], str - :vartype conversation: str or str or str - :ivar metadata: - :vartype metadata: ~azure.ai.projects.models.Metadata - :ivar output_modalities: Modalities that the response may return. - :vartype output_modalities: list[str or ~azure.ai.projects.models.VoiceOutputModality] - :ivar audio: Response-specific audio settings. - :vartype audio: ~azure.ai.projects.models.PickPropertiesVoiceAudioConfig - :ivar input: Conversation items used as inline response input. - :vartype input: list[~azure.ai.projects.models.VoiceSystemMessageItem or - ~azure.ai.projects.models.VoiceUserMessageItem or - ~azure.ai.projects.models.VoiceAssistantMessageItem or - ~azure.ai.projects.models.VoiceFunctionCallItem or - ~azure.ai.projects.models.VoiceFunctionCallOutputItem or - ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem - or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or - ~azure.ai.projects.models.VoiceMcpApprovalResponseItem] - :ivar pre_generated_assistant_message: A pre-generated assistant message used to begin the - response. - :vartype pre_generated_assistant_message: ~azure.ai.projects.models.VoiceAssistantMessageItem - :ivar interim_response: Interim-response settings for this response. Is either a - VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. - :vartype interim_response: ~azure.ai.projects.models.VoiceAgentStaticInterimResponseConfig or - ~azure.ai.projects.models.VoiceAgentLlmInterimResponseConfig + :ivar type: Required. COMPUTER_USE. + :vartype type: str or ~azure.ai.projects.models.COMPUTER_USE """ - instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The default system instructions (i.e. system message) prepended to model calls. This field - allows the client to guide the model on desired responses. The model can be instructed on - response content and format, (e.g. \"be extremely succinct\", \"act friendly\", \"here are - examples of good responses\") and on audio behavior (e.g. \"talk quickly\", \"inject emotion - into your voice\", \"laugh frequently\"). The instructions are not guaranteed to be followed by - the model, but they provide guidance to the model on the desired behavior. Note that the server - sets default instructions which will be used if this field is not set and are visible in the - ``session.created`` event at the start of the session.""" - tools: Optional[list[Union["_models.RealtimeFunctionTool", "_models.MCPTool"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Tools available to the model.""" - tool_choice: Optional[ - Union[str, "_models.ToolChoiceOptions", "_models.ToolChoiceFunction", "_models.ToolChoiceMCP"] - ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """How the model chooses tools. Provide one of the string modes or force a specific function/MCP - tool. Is one of the following types: Union[str, \"_models.ToolChoiceOptions\"], - ToolChoiceFunction, ToolChoiceMCP""" - parallel_tool_calls: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the model may call multiple tools in parallel. Only supported by reasoning Realtime - models such as ``gpt-realtime-2``.""" - reasoning: Optional["_models.RealtimeReasoning"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - max_output_tokens: Optional[Union[int, Literal["inf"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Maximum number of output tokens for a single assistant response, inclusive of tool calls. - Provide an integer between 1 and 4096 to limit output tokens, or ``inf`` for the maximum - available tokens for a given model. Defaults to ``inf``. Is either a int type or a - Literal[\"inf\"] type.""" - conversation: Optional[Union[Literal["auto"], Literal["none"], str]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Controls which conversation the response is added to. Currently supports ``auto`` and ``none``, - with ``auto`` as the default value. The ``auto`` value means that the contents of the response - will be added to the default conversation. Set this to ``none`` to create an out-of-band - response which will not add items to default conversation. Is one of the following types: - Literal[\"auto\"], Literal[\"none\"], str""" - metadata: Optional["_models.Metadata"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Modalities that the response may return.""" - audio: Optional["_models.PickPropertiesVoiceAudioConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Response-specific audio settings.""" - input: Optional[list["_unions.VoiceConversationItem"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Conversation items used as inline response input.""" - pre_generated_assistant_message: Optional["_models.VoiceAssistantMessageItem"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """A pre-generated assistant message used to begin the response.""" - interim_response: Optional["_unions.VoiceAgentInterimResponse"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Interim-response settings for this response. Is either a VoiceAgentStaticInterimResponseConfig - type or a VoiceAgentLlmInterimResponseConfig type.""" + type: Literal[ToolChoiceParamType.COMPUTER_USE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. COMPUTER_USE.""" @overload def __init__( self, - *, - instructions: Optional[str] = None, - tools: Optional[list[Union["_models.RealtimeFunctionTool", "_models.MCPTool"]]] = None, - tool_choice: Optional[ - Union[str, "_models.ToolChoiceOptions", "_models.ToolChoiceFunction", "_models.ToolChoiceMCP"] - ] = None, - parallel_tool_calls: Optional[bool] = None, - reasoning: Optional["_models.RealtimeReasoning"] = None, - max_output_tokens: Optional[Union[int, Literal["inf"]]] = None, - conversation: Optional[Union[Literal["auto"], Literal["none"], str]] = None, - metadata: Optional["_models.Metadata"] = None, - output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = None, - audio: Optional["_models.PickPropertiesVoiceAudioConfig"] = None, - input: Optional[list["_unions.VoiceConversationItem"]] = None, - pre_generated_assistant_message: Optional["_models.VoiceAssistantMessageItem"] = None, - interim_response: Optional["_unions.VoiceAgentInterimResponse"] = None, ) -> None: ... @overload @@ -20181,42 +21169,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_USE # type: ignore -class VoiceAgentResponseEventContentPart(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A content part carried by a ``response.content_part.*`` server event. +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: 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.VoiceAudioFormat + :ivar type: Required. COMPUTER_USE_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.COMPUTER_USE_PREVIEW """ - 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.VoiceAudioFormat"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The audio format, when this is an audio content part.""" + 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: Optional[Literal["audio", "text"]] = None, - text: Optional[str] = None, - audio: Optional[str] = None, - transcript: Optional[str] = None, - format: Optional["_models.VoiceAudioFormat"] = None, ) -> None: ... @overload @@ -20228,38 +21197,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 VoiceTurnDetection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Turn-detection configuration for a voice agent. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - VoiceAzureSemanticVadTurnDetection, VoiceAzureSemanticVadEnTurnDetection, - VoiceAzureSemanticVadMultilingualTurnDetection, VoiceAgentSemanticVadTurnDetection, - VoiceServerVadTurnDetection +class ToolChoiceCustom( + ToolChoiceParam, discriminator="custom" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Custom tool. - :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.VoiceTurnDetectionType - :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech - stops. - :vartype auto_truncate: bool + :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 """ - __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.""" + 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, *, - type: str, - auto_truncate: Optional[bool] = None, + name: str, ) -> None: ... @overload @@ -20271,45 +21232,23 @@ 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 -class VoiceAgentSemanticVadTurnDetection( - VoiceTurnDetection, discriminator="semantic_vad" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """OpenAI semantic VAD turn-detection settings. +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 auto_truncate: Whether the input audio buffer is truncated automatically when speech - stops. - :vartype auto_truncate: bool - :ivar eagerness: Is one of the following types: Literal["low"], Literal["medium"], - Literal["high"], Literal["auto"] - :vartype eagerness: str or str or str or str - :ivar create_response: - :vartype create_response: bool - :ivar interrupt_response: - :vartype interrupt_response: bool - :ivar type: Required. Semantic voice activity detection. - :vartype type: str or ~azure.ai.projects.models.SEMANTIC_VAD + :ivar type: Required. FILE_SEARCH. + :vartype type: str or ~azure.ai.projects.models.FILE_SEARCH """ - eagerness: Optional[Literal["low", "medium", "high", "auto"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Is one of the following types: Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"], - Literal[\"auto\"]""" - create_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - interrupt_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Semantic voice activity detection.""" + type: Literal[ToolChoiceParamType.FILE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. FILE_SEARCH.""" @overload def __init__( self, - *, - auto_truncate: Optional[bool] = None, - eagerness: Optional[Literal["low", "medium", "high", "auto"]] = None, - create_response: Optional[bool] = None, - interrupt_response: Optional[bool] = None, ) -> None: ... @overload @@ -20321,56 +21260,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = VoiceTurnDetectionType.SEMANTIC_VAD # type: ignore + self.type = ToolChoiceParamType.FILE_SEARCH # type: ignore -class VoiceAgentServerEventConversationItemAdded( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``conversation.item.added`` server event. +class ToolChoiceFunction( + ToolChoiceParam, discriminator="function" +): # 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 ``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: The item added to the conversation. Required. Is one of the following types: - VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, - VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem - :vartype item: ~azure.ai.projects.models.VoiceSystemMessageItem or - ~azure.ai.projects.models.VoiceUserMessageItem or - ~azure.ai.projects.models.VoiceAssistantMessageItem or - ~azure.ai.projects.models.VoiceFunctionCallItem or - ~azure.ai.projects.models.VoiceFunctionCallOutputItem or - ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem - or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or - ~azure.ai.projects.models.VoiceMcpApprovalResponseItem + :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 """ - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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: "_unions.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The item added to the conversation. Required. Is one of the following types: - VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, - VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem""" + 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, *, - event_id: str, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED], - item: "_unions.VoiceConversationItem", - previous_item_id: Optional[str] = None, + name: str, ) -> None: ... @overload @@ -20382,55 +21295,23 @@ 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 VoiceAgentServerEventConversationItemCreated( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``conversation.item.created`` server event. +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 event_id: The unique ID of the server event. Required. - :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: The created conversation item. Required. Is one of the following types: - VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, - VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem - :vartype item: ~azure.ai.projects.models.VoiceSystemMessageItem or - ~azure.ai.projects.models.VoiceUserMessageItem or - ~azure.ai.projects.models.VoiceAssistantMessageItem or - ~azure.ai.projects.models.VoiceFunctionCallItem or - ~azure.ai.projects.models.VoiceFunctionCallOutputItem or - ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem - or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or - ~azure.ai.projects.models.VoiceMcpApprovalResponseItem + :ivar type: Required. IMAGE_GENERATION. + :vartype type: str or ~azure.ai.projects.models.IMAGE_GENERATION """ - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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: "_unions.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The created conversation item. Required. Is one of the following types: VoiceSystemMessageItem, - VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, - VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem""" + type: Literal[ToolChoiceParamType.IMAGE_GENERATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. IMAGE_GENERATION.""" @overload def __init__( self, - *, - event_id: str, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED], - item: "_unions.VoiceConversationItem", - previous_item_id: Optional[str] = None, ) -> None: ... @overload @@ -20442,38 +21323,34 @@ 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 -class VoiceAgentServerEventConversationItemDeleted( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``conversation.item.deleted`` server event. +class ToolChoiceMCP( + ToolChoiceParam, discriminator="mcp" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """MCP tool. - :ivar event_id: The unique ID of the server event. Required. - :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. - :vartype item_id: 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 """ - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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 item that was deleted. Required.""" + 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, *, - event_id: str, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED], - item_id: str, + server_label: str, + name: Optional[str] = None, ) -> None: ... @overload @@ -20485,55 +21362,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 VoiceAgentServerEventConversationItemDone( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``conversation.item.done`` server event. +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 event_id: The unique ID of the server event. Required. - :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: The completed conversation item. Required. Is one of the following types: - VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, - VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem - :vartype item: ~azure.ai.projects.models.VoiceSystemMessageItem or - ~azure.ai.projects.models.VoiceUserMessageItem or - ~azure.ai.projects.models.VoiceAssistantMessageItem or - ~azure.ai.projects.models.VoiceFunctionCallItem or - ~azure.ai.projects.models.VoiceFunctionCallOutputItem or - ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem - or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or - ~azure.ai.projects.models.VoiceMcpApprovalResponseItem + :ivar type: Required. WEB_SEARCH_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_PREVIEW """ - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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: "_unions.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The completed conversation item. Required. Is one of the following types: - VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, - VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem""" + 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, - *, - event_id: str, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE], - item: "_unions.VoiceConversationItem", - previous_item_id: Optional[str] = None, ) -> None: ... @overload @@ -20545,75 +21390,23 @@ 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 -class VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``conversation.item.input_audio_transcription.completed`` server event. +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 event_id: The unique ID of the server event. Required. - :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 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: Required. WEB_SEARCH_PREVIEW_2025_03_11. + :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_PREVIEW_2025_03_11 """ - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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.""" - 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.""" + 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, - *, - event_id: str, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED], - item_id: str, - content_index: int, - transcript: str, - usage: Union["_models.TranscriptTextUsageTokens", "_models.TranscriptTextUsageDuration"], - logprobs: Optional[list["_models.LogProbProperties"]] = None, - phrases: Optional[list["_models.VoiceAgentTranscriptionPhrase"]] = None, ) -> None: ... @overload @@ -20625,56 +21418,35 @@ 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 VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``conversation.item.input_audio_transcription.delta`` server event. +class ToolConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Per-tool configuration that controls tool visibility and search behavior. - :ivar event_id: The unique ID of the server event. Required. - :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 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 """ - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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"] - ) + 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, *, - event_id: str, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA], - item_id: str, - content_index: Optional[int] = None, - delta: Optional[str] = None, - logprobs: Optional[list["_models.LogProbProperties"]] = None, + pin: Optional[bool] = None, + additional_search_text: Optional[str] = None, ) -> None: ... @overload @@ -20688,51 +21460,26 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``conversation.item.input_audio_transcription.failed`` server event. +class ToolDescription(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Description of a tool that can be used by an agent. - :ivar event_id: The unique ID of the server event. Required. - :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 name: The name of the tool. + :vartype name: str + :ivar description: A brief description of the tool's purpose. + :vartype description: 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_FAILED] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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.""" + 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, *, - event_id: str, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED], - item_id: str, - content_index: int, - error: "_models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError", + name: Optional[str] = None, + description: Optional[str] = None, ) -> None: ... @overload @@ -20746,68 +21493,22 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``conversation.item.input_audio_transcription.segment`` server event. +class ToolProjectConnection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A project connection resource. - :ivar event_id: The unique ID of the server event. Required. - :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 project_connection_id: A project connection in a ToolProjectConnectionList attached to + this tool. Required. + :vartype project_connection_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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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.""" + 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, *, - event_id: str, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT], - item_id: str, - content_index: int, - text: str, - id: str, # pylint: disable=redefined-builtin - speaker: str, - start: float, - end: float, + project_connection_id: str, ) -> None: ... @overload @@ -20821,49 +21522,33 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventConversationItemRetrieved( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``conversation.item.retrieved`` server event. +class ToolSearchToolboxTool( + ToolboxTool, discriminator="toolbox_search" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A toolbox search tool stored in a toolbox. - :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: The retrieved conversation item. Required. Is one of the following types: - VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, - VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem - :vartype item: ~azure.ai.projects.models.VoiceSystemMessageItem or - ~azure.ai.projects.models.VoiceUserMessageItem or - ~azure.ai.projects.models.VoiceAssistantMessageItem or - ~azure.ai.projects.models.VoiceFunctionCallItem or - ~azure.ai.projects.models.VoiceFunctionCallOutputItem or - ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem - or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or - ~azure.ai.projects.models.VoiceMcpApprovalResponseItem + :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 """ - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The event type, must be ``conversation.item.retrieved``. Required. CONVERSATION_ITEM_RETRIEVED.""" - item: "_unions.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The retrieved conversation item. Required. Is one of the following types: - VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, - VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem""" + 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, *, - event_id: str, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED], - item: "_unions.VoiceConversationItem", + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -20875,56 +21560,44 @@ 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 -class VoiceAgentServerEventConversationItemTruncated( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``conversation.item.truncated`` server event. +class ToolSearchToolParam( + Tool, discriminator="tool_search" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Tool search tool. - :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.VoiceAssistantMessageItem + :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 """ - 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_field( + 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"] ) - """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.VoiceAssistantMessageItem"] = rest_field( + """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"] ) - """The assistant message after truncation, when the service returns the updated item.""" @overload def __init__( self, *, - event_id: str, - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED], - item_id: str, - content_index: int, - audio_end_ms: int, - item: Optional["_models.VoiceAssistantMessageItem"] = None, + execution: Optional[Union[str, "_models.ToolSearchExecutionType"]] = None, + description: Optional[str] = None, + parameters: Optional["_models.EmptyModelParam"] = None, ) -> None: ... @overload @@ -20936,33 +21609,37 @@ 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 -class VoiceAgentServerEventInputAudioBufferCleared( - _Model +class ToolUseFineTuningDataGenerationJobOptions( + DataGenerationJobOptions, discriminator="tool_use" ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``input_audio_buffer.cleared`` server event. + """The options for a data generation job with ToolUse type. Used only for fine-tuning scenarios. - :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 + :ivar max_samples: Maximum number of samples to generate. Required. + :vartype max_samples: int + :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 """ - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The event type, must be ``input_audio_buffer.cleared``. Required. INPUT_AUDIO_BUFFER_CLEARED.""" + 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.""" @overload def __init__( self, *, - event_id: str, - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED], + max_samples: int, + train_split: Optional[float] = None, + model_options: Optional["_models.DataGenerationModelOptions"] = None, ) -> None: ... @overload @@ -20974,43 +21651,44 @@ 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 VoiceAgentServerEventInputAudioBufferCommitted( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``input_audio_buffer.committed`` server event. +class TracesDataGenerationJobOptions( + DataGenerationJobOptions, discriminator="traces" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The options for a data generation job with Traces type. - :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 max_samples: Maximum number of samples to generate. Required. + :vartype max_samples: int + :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 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 """ - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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.""" + 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.""" + 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, *, - event_id: str, - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED], - item_id: str, - previous_item_id: Optional[str] = None, + max_samples: int, + train_split: Optional[float] = None, + model_options: Optional["_models.DataGenerationModelOptions"] = None, + redact_private_content: Optional[bool] = None, ) -> None: ... @overload @@ -21022,49 +21700,68 @@ 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 -class VoiceAgentServerEventInputAudioBufferSpeechStarted( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``input_audio_buffer.speech_started`` server event. +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 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. + :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 item_id: str + :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 """ - 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_field( - visibility=["read", "create", "update", "delete", "query"] + 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" ) - """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.""" + """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, *, - event_id: str, - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED], - audio_start_ms: int, - item_id: str, + 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 @@ -21076,48 +21773,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 VoiceAgentServerEventInputAudioBufferSpeechStopped( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``input_audio_buffer.speech_stopped`` server event. +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 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 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 """ - 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_field( - visibility=["read", "create", "update", "delete", "query"] + 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" ) - """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.""" + """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, *, - event_id: str, - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED], - audio_end_ms: int, - item_id: str, + 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 @@ -21129,53 +21849,33 @@ 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 VoiceAgentServerEventInputAudioBufferTimeoutTriggered( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``input_audio_buffer.timeout_triggered`` server event. +class TranscriptTextUsageDuration( + CreateTranscriptionResponseJsonUsage, discriminator="duration" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Duration Usage. - :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: 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 """ - 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_field( - visibility=["read", "create", "update", "delete", "query"] + 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" ) - """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.""" + """Duration of the input audio in seconds. Required.""" @overload def __init__( self, *, - event_id: str, - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED], - audio_start_ms: int, - audio_end_ms: int, - item_id: str, + seconds: datetime.timedelta, ) -> None: ... @overload @@ -21187,38 +21887,48 @@ 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 VoiceAgentServerEventMcpListToolsCompleted( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``mcp_list_tools.completed`` server event. +class TranscriptTextUsageTokens( + CreateTranscriptionResponseJsonUsage, discriminator="tokens" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Token Usage. - :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 + :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 """ - 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_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"] ) - """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.""" + """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, *, - event_id: str, - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED], - item_id: str, + input_tokens: int, + output_tokens: int, + total_tokens: int, + input_token_details: Optional["_models.TranscriptTextUsageTokensInputTokenDetails"] = None, ) -> None: ... @overload @@ -21230,35 +21940,29 @@ 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 VoiceAgentServerEventMcpListToolsFailed(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``mcp_list_tools.failed`` server event. +class TranscriptTextUsageTokensInputTokenDetails( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """TranscriptTextUsageTokensInputTokenDetails. - :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 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.MCP_LIST_TOOLS_FAILED] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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.""" + 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, - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED], - item_id: str, + text_tokens: Optional[int] = None, + audio_tokens: Optional[int] = None, ) -> None: ... @overload @@ -21272,36 +21976,26 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventMcpListToolsInProgress( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``mcp_list_tools.in_progress`` server event. +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 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 description: The asset description text. + :vartype description: str + :ivar tags: Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, 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_IN_PROGRESS] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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.""" + 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, *, - event_id: str, - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS], - item_id: str, + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -21315,36 +22009,23 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventOutputAudioBufferCleared( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``output_audio_buffer.cleared`` server event. +class UpdateToolboxRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """UpdateToolboxRequest. - :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 + :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 """ - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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.""" + 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, *, - event_id: str, - type: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED], - response_id: str, + default_version: str, ) -> None: ... @overload @@ -21358,36 +22039,37 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventRateLimitsUpdated(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``rate_limits.updated`` server event. +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 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 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 """ - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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.""" + 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, *, - event_id: str, - type: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED], - rate_limits: list["_models.RealtimeServerEventRateLimitsUpdatedRateLimits"], + memory_id: str, + updated_at: datetime.datetime, + scope: str, + content: str, ) -> None: ... @overload @@ -21399,61 +22081,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 VoiceAgentServerEventResponseAnimationBlendshapesDelta( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.animation_blendshapes.delta`` server event. +class VersionIndicator(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Version indicator determining which agent version backs the session. - :ivar type: Required. Default value is "response.animation_blendshapes.delta". - :vartype type: str - :ivar event_id: Required. - :vartype event_id: str - :ivar response_id: Required. - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar content_index: Required. - :vartype content_index: int - :ivar frames: Animation frames as numeric blendshape weights. Required. - :vartype frames: list[list[float]] - :ivar frame_index: The index of the first frame in this delta. Required. - :vartype frame_index: int + 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 """ - type: Literal["response.animation_blendshapes.delta"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Default value is \"response.animation_blendshapes.delta\".""" - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - frames: list[list[float]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Animation frames as numeric blendshape weights. Required.""" - frame_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the first frame in this delta. Required.""" + __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, *, - event_id: str, - response_id: str, - item_id: str, - output_index: int, - content_index: int, - frames: list[list[float]], - frame_index: int, + type: str, ) -> None: ... @overload @@ -21465,47 +22114,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["response.animation_blendshapes.delta"] = "response.animation_blendshapes.delta" -class VoiceAgentServerEventResponseAnimationBlendshapesDone( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.animation_blendshapes.done`` server event. +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 type: Required. Default value is "response.animation_blendshapes.done". - :vartype type: str - :ivar event_id: Required. - :vartype event_id: str - :ivar response_id: Required. - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int + :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 """ - type: Literal["response.animation_blendshapes.done"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Default value is \"response.animation_blendshapes.done\".""" - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """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, *, - event_id: str, - response_id: str, - item_id: str, - output_index: int, + agent_version: str, ) -> None: ... @overload @@ -21517,64 +22149,26 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["response.animation_blendshapes.done"] = "response.animation_blendshapes.done" + self.type = VersionIndicatorType.VERSION_REF # type: ignore -class VoiceAgentServerEventResponseAnimationVisemeDelta( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.animation_viseme.delta`` server event. +class VersionSelector(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """VersionSelector. - :ivar type: Required. Default value is "response.animation_viseme.delta". - :vartype type: str - :ivar event_id: Required. - :vartype event_id: str - :ivar response_id: Required. - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar content_index: Required. - :vartype content_index: int - :ivar audio_offset_ms: Required. - :vartype audio_offset_ms: ~datetime.timedelta - :ivar viseme_id: Required. - :vartype viseme_id: int + :ivar version_selection_rules: Required. + :vartype version_selection_rules: list[~azure.ai.projects.models.VersionSelectionRule] """ - type: Literal["response.animation_viseme.delta"] = rest_field( + version_selection_rules: list["_models.VersionSelectionRule"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Required. Default value is \"response.animation_viseme.delta\".""" - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - audio_offset_ms: datetime.timedelta = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """Required.""" - viseme_id: int = 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, - audio_offset_ms: datetime.timedelta, - viseme_id: int, + version_selection_rules: list["_models.VersionSelectionRule"], ) -> None: ... @overload @@ -21586,52 +22180,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["response.animation_viseme.delta"] = "response.animation_viseme.delta" -class VoiceAgentServerEventResponseAnimationVisemeDone( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.animation_viseme.done`` server event. +class VoiceAgentAnimationConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Animation settings for a voice-agent session. - :ivar type: Required. Default value is "response.animation_viseme.done". - :vartype type: str - :ivar event_id: Required. - :vartype event_id: str - :ivar response_id: Required. - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar content_index: Required. - :vartype content_index: int + :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] """ - type: Literal["response.animation_viseme.done"] = 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"] ) - """Required. Default value is \"response.animation_viseme.done\".""" - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + """The requested animation output kinds.""" @overload def __init__( self, *, - event_id: str, - response_id: str, - item_id: str, - output_index: int, - content_index: int, + model_name: Optional[str] = None, + outputs: Optional[list[Union[str, "_models.VoiceAgentAnimationOutputType"]]] = None, ) -> None: ... @overload @@ -21643,57 +22215,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["response.animation_viseme.done"] = "response.animation_viseme.done" -class VoiceAgentServerEventResponseAudioDelta(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``response.output_audio.delta`` server event. +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 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 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 """ - 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_field( + input: Optional["_models.VoiceAgentAudioInputConfig"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """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.""" + """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, *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA], - response_id: str, - item_id: str, - output_index: int, - content_index: int, - delta: bytes, + input: Optional["_models.VoiceAgentAudioInputConfig"] = None, + output: Optional["_models.VoiceAgentAudioOutputConfig"] = None, ) -> None: ... @overload @@ -21707,49 +22255,54 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventResponseAudioDone(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``response.output_audio.done`` server event. +class VoiceAgentAudioInputConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Input audio configuration for a voice agent. - :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 + :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 """ - 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_field( + format: Optional["_models.RealtimeAudioFormats"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """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.""" + """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, *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE], - response_id: str, - item_id: str, - output_index: int, - content_index: int, + 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 @@ -21763,72 +22316,141 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventResponseAudioTimestampDelta( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.audio_timestamp.delta`` server event. +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 type: Required. Default value is "response.audio_timestamp.delta". - :vartype type: str - :ivar event_id: Required. - :vartype event_id: str - :ivar response_id: Required. - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar content_index: Required. - :vartype content_index: int - :ivar audio_offset_ms: Required. - :vartype audio_offset_ms: ~datetime.timedelta - :ivar audio_duration_ms: Required. - :vartype audio_duration_ms: ~datetime.timedelta - :ivar text: Required. - :vartype text: str - :ivar timestamp_type: Required. Default value is "word". - :vartype timestamp_type: str + * `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] """ - type: Literal["response.audio_timestamp.delta"] = rest_field( + format: Optional["_models.RealtimeAudioFormats"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Required. Default value is \"response.audio_timestamp.delta\".""" - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - audio_offset_ms: datetime.timedelta = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + """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"] ) - """Required.""" - audio_duration_ms: datetime.timedelta = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + """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( + visibility=["read", "create", "update", "delete", "query"] ) - """Required.""" - text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - timestamp_type: Literal["word"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"word\".""" + """Timestamp kinds to include with output audio. Applies to every ``voice_type``.""" @overload def __init__( self, *, - event_id: str, - response_id: str, - item_id: str, - output_index: int, - content_index: int, - audio_offset_ms: datetime.timedelta, - audio_duration_ms: datetime.timedelta, - text: str, + 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 @@ -21840,53 +22462,74 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["response.audio_timestamp.delta"] = "response.audio_timestamp.delta" - self.timestamp_type: Literal["word"] = "word" -class VoiceAgentServerEventResponseAudioTimestampDone( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.audio_timestamp.done`` server event. +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 type: Required. Default value is "response.audio_timestamp.done". - :vartype type: str - :ivar event_id: Required. - :vartype event_id: str - :ivar response_id: Required. - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar content_index: Required. - :vartype content_index: int + :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", "websocket", and "websocket-binary". + :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 """ - type: Literal["response.audio_timestamp.done"] = rest_field( + type: Union[str, "_models.VoiceAgentAvatarType"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Required. Default value is \"response.audio_timestamp.done\".""" - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + """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\", + \"websocket\", and \"websocket-binary\".""" + 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, *, - event_id: str, - response_id: str, - item_id: str, - output_index: int, - content_index: int, + 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 @@ -21898,60 +22541,31 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["response.audio_timestamp.done"] = "response.audio_timestamp.done" -class VoiceAgentServerEventResponseAudioTranscriptDelta( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.output_audio_transcript.delta`` server event. +class VoiceAgentAvatarIceServer(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An ICE server used for avatar WebRTC negotiation. - :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 urls: Required. + :vartype urls: list[str] + :ivar username: + :vartype username: str + :ivar credential: + :vartype credential: 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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.""" + 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, *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA], - response_id: str, - item_id: str, - output_index: int, - content_index: int, - delta: str, + urls: list[str], + username: Optional[str] = None, + credential: Optional[str] = None, ) -> None: ... @overload @@ -21965,57 +22579,44 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventResponseAudioTranscriptDone( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.output_audio_transcript.done`` server event. +class VoiceAgentAvatarScene(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Avatar placement and motion settings. - :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 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 """ - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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.""" + 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, *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE], - response_id: str, - item_id: str, - output_index: int, - content_index: int, - transcript: 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 @@ -22029,58 +22630,24 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventResponseContentPartDone( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.content_part.done`` server event. - - :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 finished streaming. Required. - :vartype part: ~azure.ai.projects.models.VoiceAgentResponseEventContentPart +class VoiceAgentAvatarVideoBackground(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The avatar video background. + + :ivar image_url: + :vartype image_url: str + :ivar color: + :vartype color: 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_DONE] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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.VoiceAgentResponseEventContentPart" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The content part that finished streaming. 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, *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE], - response_id: str, - item_id: str, - output_index: int, - content_index: int, - part: "_models.VoiceAgentResponseEventContentPart", + image_url: Optional[str] = None, + color: Optional[str] = None, ) -> None: ... @overload @@ -22094,35 +22661,26 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventResponseCreated(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``response.created`` server event. +class VoiceAgentAvatarVideoCrop(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The rectangular crop applied to avatar video. - :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: The created voice-agent response. Required. - :vartype response: ~azure.ai.projects.models.VoiceAgentRealtimeResponse + :ivar bottom_right: Required. + :vartype bottom_right: list[int] + :ivar top_left: Required. + :vartype top_left: list[int] """ - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The event type, must be ``response.created``. Required. RESPONSE_CREATED.""" - response: "_models.VoiceAgentRealtimeResponse" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The created voice-agent response. Required.""" + 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, *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_CREATED], - response: "_models.VoiceAgentRealtimeResponse", + bottom_right: list[int], + top_left: list[int], ) -> None: ... @overload @@ -22136,35 +22694,43 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventResponseDone(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``response.done`` server event. +class VoiceAgentAvatarVideoParams(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Avatar video encoder and presentation settings. - :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: The completed voice-agent response. Required. - :vartype response: ~azure.ai.projects.models.VoiceAgentRealtimeResponse + :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 """ - 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_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 event type, must be ``response.done``. Required. RESPONSE_DONE.""" - response: "_models.VoiceAgentRealtimeResponse" = rest_field( + resolution: Optional["_models.VoiceAgentAvatarVideoResolution"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + background: Optional["_models.VoiceAgentAvatarVideoBackground"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The completed voice-agent response. Required.""" + gop_size: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_DONE], - response: "_models.VoiceAgentRealtimeResponse", + 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 @@ -22178,57 +22744,26 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventResponseFunctionCallArgumentsDelta( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.function_call_arguments.delta`` server event. +class VoiceAgentAvatarVideoResolution(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The avatar video resolution. - :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 width: Required. + :vartype width: int + :ivar height: Required. + :vartype height: 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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.""" + 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, *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA], - response_id: str, - item_id: str, - output_index: int, - call_id: str, - delta: str, + width: int, + height: int, ) -> None: ... @overload @@ -22242,62 +22777,36 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventResponseFunctionCallArgumentsDone( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.function_call_arguments.done`` server event. +class VoiceAgentTurnDetectionConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Turn-detection configuration for a voice agent. - :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 + 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 """ - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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.""" + __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, *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE], - response_id: str, - item_id: str, - output_index: int, - call_id: str, - name: str, - arguments: str, + type: str, + auto_truncate: Optional[bool] = None, ) -> None: ... @overload @@ -22311,56 +22820,84 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventResponseMcpCallArgumentsDelta( - _Model +class VoiceAgentAzureSemanticVadEnTurnDetection( + VoiceAgentTurnDetectionConfig, discriminator="azure_semantic_vad_en" ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.mcp_call_arguments.delta`` server event. + """English-optimized Azure semantic voice activity detection. - :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 + :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 """ - 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_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"] ) - """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"]) + """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, *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA], - response_id: str, - item_id: str, - output_index: int, - delta: str, - obfuscation: Optional[str] = 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 @@ -22372,54 +22909,92 @@ 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 VoiceAgentServerEventResponseMcpCallArgumentsDone( - _Model +class VoiceAgentAzureSemanticVadMultilingualTurnDetection( + VoiceAgentTurnDetectionConfig, discriminator="azure_semantic_vad_multilingual" ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.mcp_call_arguments.done`` server event. + """Multilingual Azure semantic voice activity detection. - :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 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] """ - 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_field( + 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"] ) - """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.""" + """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, *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE], - response_id: str, - item_id: str, - output_index: int, - arguments: str, + 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 @@ -22431,43 +23006,92 @@ 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 -class VoiceAgentServerEventResponseMcpCallCompleted( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.mcp_call.completed`` server event. +class VoiceAgentAzureSemanticVadTurnDetection( + VoiceAgentTurnDetectionConfig, discriminator="azure_semantic_vad" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Azure semantic voice activity detection. - :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 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] """ - 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_field( + 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"] ) - """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.""" + """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, *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED], - output_index: int, - item_id: str, + 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 @@ -22479,43 +23103,36 @@ 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 VoiceAgentServerEventResponseMcpCallFailed( - _Model +class VoiceAgentClientEventSessionAvatarConnect( + RealtimeClientEvent, discriminator="session.avatar.connect" ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.mcp_call.failed`` server event. + """The ``session.avatar.connect`` client event. - :ivar event_id: The unique ID of the server event. Required. + :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 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 client_sdp: The client's SDP offer for avatar media negotiation. Required. + :vartype client_sdp: 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_FAILED] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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[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, - *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED], - output_index: int, - item_id: str, + self, + *, + client_sdp: str, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -22527,44 +23144,44 @@ 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 VoiceAgentServerEventResponseMcpCallInProgress( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.mcp_call.in_progress`` server event. +class VoiceAgentClientEventSessionUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``session.update`` client event. - :ivar event_id: The unique ID of the server event. Required. + :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 ``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 + :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 """ - 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_field( + 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 ``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.""" + """The event type, must be ``session.update``. Required. SESSION_UPDATE.""" + session: "_models.VoiceAgentSessionUpdateConfig" = 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, *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS], - output_index: int, - item_id: str, + type: Literal[RealtimeClientEventType.SESSION_UPDATE], + session: "_models.VoiceAgentSessionUpdateConfig", + event_id: Optional[str] = None, ) -> None: ... @overload @@ -22578,59 +23195,184 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventResponseOutputItemAdded( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.output_item.added`` server event. +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. - :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: The output item that was added. Required. Is one of the following types: - VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, - VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem - :vartype item: ~azure.ai.projects.models.VoiceSystemMessageItem or - ~azure.ai.projects.models.VoiceUserMessageItem or - ~azure.ai.projects.models.VoiceAssistantMessageItem or - ~azure.ai.projects.models.VoiceFunctionCallItem or - ~azure.ai.projects.models.VoiceFunctionCallOutputItem or - ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem - or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or - ~azure.ai.projects.models.VoiceMcpApprovalResponseItem + :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 agent is served. Together with ``model``, this + selects the model up front. ``managed`` uses a service-managed model; ``self_deployed`` uses + the customer's own Foundry deployment. This is independent of the architecture (realtime or + cascaded), which the service derives from the selected model. Required. 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, paired with ``model_type``: the service-managed + model name when ``model_type`` is ``managed``, or the customer's Foundry deployment name when + ``model_type`` is ``self_deployed``. The model must support realtime or cascaded voice. The + service derives the architecture from the selected model. Required. + :vartype model: str + :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 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 """ - 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_field( + 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: Union[str, "_models.VoiceModelType"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """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: "_unions.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The output item that was added. Required. Is one of the following types: - VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, - VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem""" + """How the model backing this agent is served. Together with ``model``, this selects the model up + front. ``managed`` uses a service-managed model; ``self_deployed`` uses the customer's own + Foundry deployment. This is independent of the architecture (realtime or cascaded), which the + service derives from the selected model. Required. Known values are: \"managed\" and + \"self_deployed\".""" + model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The model to use for this agent, paired with ``model_type``: the service-managed model name + when ``model_type`` is ``managed``, or the customer's Foundry deployment name when + ``model_type`` is ``self_deployed``. The model must support realtime or cascaded voice. The + service derives the architecture from the selected model. Required.""" + 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( + visibility=["read", "create", "update", "delete", "query"] + ) + """Set of structured inputs that participate in prompt template substitution, rendered per session + before the live session starts.""" + 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.""" @overload def __init__( self, *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED], - response_id: str, - output_index: int, - item: "_unions.VoiceConversationItem", + model_type: Union[str, "_models.VoiceModelType"], + model: str, + rai_config: Optional["_models.RaiConfig"] = 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, + store: Optional[bool] = None, ) -> None: ... @overload @@ -22642,61 +23384,42 @@ 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 VoiceAgentServerEventResponseOutputItemDone( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``response.output_item.done`` server event. +class VoiceAgentEchoCancellation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Server-side echo cancellation settings for input audio. - :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: The output item that finished streaming. Required. Is one of the following types: - VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, - VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem - :vartype item: ~azure.ai.projects.models.VoiceSystemMessageItem or - ~azure.ai.projects.models.VoiceUserMessageItem or - ~azure.ai.projects.models.VoiceAssistantMessageItem or - ~azure.ai.projects.models.VoiceFunctionCallItem or - ~azure.ai.projects.models.VoiceFunctionCallOutputItem or - ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem - or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or - ~azure.ai.projects.models.VoiceMcpApprovalResponseItem + :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 """ - 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_field( + 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"] - ) - """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: "_unions.VoiceConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The output item that finished streaming. Required. Is one of the following types: - VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, - VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem""" + ) + """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, *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE], - response_id: str, - output_index: int, - item: "_unions.VoiceConversationItem", + reference_source: Optional[Union[str, "_models.VoiceAgentEchoCancellationReferenceSource"]] = None, + channels: Optional[int] = None, ) -> None: ... @overload @@ -22708,56 +23431,46 @@ 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 VoiceAgentServerEventResponseTextDelta(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``response.output_text.delta`` server event. +class VoiceAgentEndOfUtteranceDetection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Semantic end-of-utterance detection configuration. - :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 + :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 """ - 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_field( + model: Union[str, "_models.VoiceAgentEndOfUtteranceDetectionModel"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """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.""" + """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, *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA], - response_id: str, - item_id: str, - output_index: int, - content_index: int, - delta: str, + model: Union[str, "_models.VoiceAgentEndOfUtteranceDetectionModel"], + threshold_level: Optional[Union[str, "_models.VoiceAgentEndOfUtteranceThresholdLevel"]] = None, + timeout_ms: Optional[datetime.timedelta] = None, ) -> None: ... @overload @@ -22771,54 +23484,25 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventResponseTextDone(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``response.output_text.done`` server event. +class VoiceAgentTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A tool usable by a voice agent. - :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 + 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 """ - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The tool kind. Required. Default value is None.""" @overload def __init__( self, *, - event_id: str, - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE], - response_id: str, - item_id: str, - output_index: int, - content_index: int, - text: str, + type: str, ) -> None: ... @overload @@ -22832,40 +23516,41 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentServerEventResponseVideoDelta(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``response.video.delta`` server event. +class VoiceAgentFunctionTool( + VoiceAgentTool, discriminator="function" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A native function tool executed by the client. - :ivar type: Required. Default value is "response.video.delta". + :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 event_id: Required. - :vartype event_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar codec: Required. - :vartype codec: str - :ivar delta: The base64-encoded video frame data. Required. - :vartype delta: str + :ivar name: The function name. Required. + :vartype name: str """ - type: Literal["response.video.delta"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"response.video.delta\".""" - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - codec: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The base64-encoded video frame data. 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, *, - event_id: str, - output_index: int, - codec: str, - delta: str, + name: str, + description: Optional[str] = None, + parameters: Optional["_models.RealtimeFunctionToolParameters"] = None, ) -> None: ... @overload @@ -22877,35 +23562,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["response.video.delta"] = "response.video.delta" + self.type = "function" # type: ignore -class VoiceAgentServerEventSessionAvatarConnecting( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``session.avatar.connecting`` server event. +class VoiceAgentGreetingConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Session-start greeting configuration for a voice agent. - :ivar type: Required. Default value is "session.avatar.connecting". + 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 - :ivar event_id: Required. - :vartype event_id: str - :ivar server_sdp: The server's SDP answer for avatar media negotiation. Required. - :vartype server_sdp: str """ - type: Literal["session.avatar.connecting"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"session.avatar.connecting\".""" - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - server_sdp: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The server's SDP answer for avatar media negotiation. Required.""" + __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, *, - event_id: str, - server_sdp: str, + type: str, ) -> None: ... @overload @@ -22917,36 +23595,77 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["session.avatar.connecting"] = "session.avatar.connecting" -class VoiceAgentServerEventSessionAvatarSwitchToIdle( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``session.avatar.switch_to_idle`` server event. +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 type: Required. Default value is "session.avatar.switch_to_idle". - :vartype type: str - :ivar event_id: Required. - :vartype event_id: str - :ivar turn_id: - :vartype turn_id: str + :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 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] """ - type: Literal["session.avatar.switch_to_idle"] = 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.""" + 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"] ) - """Required. Default value is \"session.avatar.switch_to_idle\".""" - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - turn_id: Optional[str] = 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.""" @overload def __init__( self, *, - event_id: str, - turn_id: Optional[str] = None, + model: Union[str, "_models.VoiceAgentInputTranscriptionModel"], + language: Optional[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 @@ -22958,36 +23677,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["session.avatar.switch_to_idle"] = "session.avatar.switch_to_idle" -class VoiceAgentServerEventSessionAvatarSwitchToSpeaking( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``session.avatar.switch_to_speaking`` server event. +class VoiceAgentInterimResponseConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Fields shared by interim-response configurations. - :ivar type: Required. Default value is "session.avatar.switch_to_speaking". + 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 event_id: Required. - :vartype event_id: str - :ivar turn_id: - :vartype turn_id: 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 """ - type: Literal["session.avatar.switch_to_speaking"] = 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"] ) - """Required. Default value is \"session.avatar.switch_to_speaking\".""" - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - turn_id: Optional[str] = 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.""" @overload def __init__( self, *, - event_id: str, - turn_id: Optional[str] = None, + type: str, + triggers: Optional[list[Union[str, "_models.VoiceAgentInterimResponseTrigger"]]] = None, + latency_threshold_ms: Optional[datetime.timedelta] = None, ) -> None: ... @overload @@ -22999,45 +23723,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["session.avatar.switch_to_speaking"] = "session.avatar.switch_to_speaking" -class VoiceAgentServerEventSessionCreated(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``session.created`` server event. +class VoiceAgentLlmGeneratedGreetingConfig( + VoiceAgentGreetingConfig, discriminator="llm_generated" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A greeting authored by the session model from a scoped opening-turn prompt. - :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 conversation_id: The id of the persisted conversation. Only present when conversation - persistence is enabled for the session. - :vartype conversation_id: str - :ivar session: The initial effective voice-agent session configuration. Required. - :vartype session: ~azure.ai.projects.models.VoiceAgentSessionResponseConfig + :ivar type: Required. Default value is "llm_generated". + :vartype type: str + :ivar prompt: The Handlebars prompt that guides the opening turn. Required. + :vartype prompt: str + :ivar tool_choice: The tool-selection policy for the opening response. Defaults to ``none``. 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 """ - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The event type, must be ``session.created``. Required. SESSION_CREATED.""" - conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The id of the persisted conversation. Only present when conversation persistence is enabled for - the session.""" - session: "_models.VoiceAgentSessionResponseConfig" = rest_field( + type: Literal["llm_generated"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"llm_generated\".""" + prompt: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Handlebars prompt that guides the opening turn. Required.""" + tool_choice: Optional["_unions.VoiceAgentToolChoice"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The initial effective voice-agent session configuration. Required.""" + """The tool-selection policy for the opening response. Defaults to ``none``. Is one of the + following types: Literal[\"none\"], Literal[\"auto\"], Literal[\"required\"], + ToolChoiceFunction, ToolChoiceMCP""" @overload def __init__( self, *, - event_id: str, - type: Literal[RealtimeServerEventType.SESSION_CREATED], - session: "_models.VoiceAgentSessionResponseConfig", - conversation_id: Optional[str] = None, + prompt: str, + tool_choice: Optional["_unions.VoiceAgentToolChoice"] = None, ) -> None: ... @overload @@ -23049,37 +23769,46 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = "llm_generated" # type: ignore -class VoiceAgentServerEventSessionUpdated(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``session.updated`` server event. +class VoiceAgentLlmInterimResponseConfig( + VoiceAgentInterimResponseConfig, discriminator="llm_interim_response" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An interim response generated by a language model. - :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 effective voice-agent session configuration after the update. Required. - :vartype session: ~azure.ai.projects.models.VoiceAgentSessionResponseConfig + :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 type: Required. Default value is "llm_interim_response". + :vartype type: str + :ivar model: The model used to generate interim responses. + :vartype model: str + :ivar instructions: Optional instructions for generating interim responses. + :vartype instructions: str + :ivar max_completion_tokens: The maximum completion-token count for an interim response. + :vartype max_completion_tokens: int """ - 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_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The event type, must be ``session.updated``. Required. SESSION_UPDATED.""" - session: "_models.VoiceAgentSessionResponseConfig" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The effective voice-agent session configuration after the update. Required.""" + type: Literal["llm_interim_response"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"llm_interim_response\".""" + model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The model used to generate interim responses.""" + instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional instructions for generating interim responses.""" + max_completion_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The maximum completion-token count for an interim response.""" @overload def __init__( self, *, - event_id: str, - type: Literal[RealtimeServerEventType.SESSION_UPDATED], - session: "_models.VoiceAgentSessionResponseConfig", + triggers: Optional[list[Union[str, "_models.VoiceAgentInterimResponseTrigger"]]] = None, + latency_threshold_ms: Optional[datetime.timedelta] = None, + model: Optional[str] = None, + instructions: Optional[str] = None, + max_completion_tokens: Optional[int] = None, ) -> None: ... @overload @@ -23091,34 +23820,104 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = "llm_interim_response" # type: ignore -class VoiceAgentServerEventWarning(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``warning`` server event. +class VoiceAgentMcpTool( + VoiceAgentTool, discriminator="mcp" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An MCP tool available to a voice agent. - :ivar type: Required. Default value is "warning". + :ivar server_label: A label for this MCP server, used to identify it in tool calls. Required. + :vartype server_label: 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] + :ivar type: Required. Default value is "mcp". :vartype type: str - :ivar event_id: Required. - :vartype event_id: str - :ivar warning: Required. - :vartype warning: ~azure.ai.projects.models.VoiceAgentServerEventWarningDetails + :ivar server_url: The URL for the MCP server. + :vartype server_url: str + :ivar response_scheduling: When the MCP invocation creates a follow-up response. Defaults to + ``when_idle``. Known values are: "silent", "when_idle", "interrupt", and "skip_if_busy". + :vartype response_scheduling: str or ~azure.ai.projects.models.VoiceAgentToolResponseScheduling """ - type: Literal["warning"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"warning\".""" - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - warning: "_models.VoiceAgentServerEventWarningDetails" = rest_field( + 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.""" + 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"] ) - """Required.""" + """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.""" + type: Literal["mcp"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"mcp\".""" + server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The URL for the MCP server.""" + response_scheduling: Optional[Union[str, "_models.VoiceAgentToolResponseScheduling"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """When the MCP invocation creates a follow-up response. Defaults to ``when_idle``. Known values + are: \"silent\", \"when_idle\", \"interrupt\", and \"skip_if_busy\".""" @overload def __init__( self, *, - event_id: str, - warning: "_models.VoiceAgentServerEventWarningDetails", + server_label: str, + 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, + server_url: Optional[str] = None, + response_scheduling: Optional[Union[str, "_models.VoiceAgentToolResponseScheduling"]] = None, ) -> None: ... @overload @@ -23130,32 +23929,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["warning"] = "warning" + self.type = "mcp" # type: ignore -class VoiceAgentServerEventWarningDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Details of a non-fatal warning. +class VoiceAgentNoiseReduction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Input audio noise reduction configuration. - :ivar message: Required. - :vartype message: str - :ivar code: - :vartype code: str - :ivar param: - :vartype param: str + :ivar type: The noise reduction mode. Required. Known values are: "near_field", "far_field", + and "azure_deep_noise_suppression". + :vartype type: str or ~azure.ai.projects.models.VoiceAgentNoiseReductionType """ - message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + 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\".""" @overload def __init__( self, *, - message: str, - code: Optional[str] = None, - param: Optional[str] = None, + type: Union[str, "_models.VoiceAgentNoiseReductionType"], ) -> None: ... @overload @@ -23167,72 +23962,100 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - - -class VoiceAvatarConfig(_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 type: The avatar type. Required. Known values are: "video_avatar" and "photo_avatar". - :vartype type: str or ~azure.ai.projects.models.VoiceAvatarType - :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", "websocket", and "websocket-binary". - :vartype output_protocol: str or ~azure.ai.projects.models.VoiceAvatarOutputProtocol - :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 + + +class VoiceAgentRealtimeResponseBase(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties shared by realtime responses returned by the voice-agent service. + + :ivar id: The unique ID of the response, will look like ``resp_1234``. + :vartype id: str + :ivar object: The object type, must be ``realtime.response``. Default value is + "realtime.response". + :vartype object: str + :ivar status: The final status of the response (``completed``, ``cancelled``, ``failed``, or + ``incomplete``, ``in_progress``). Is one of the following types: Literal["completed"], + Literal["cancelled"], Literal["failed"], Literal["incomplete"], Literal["in_progress"] + :vartype status: str or str or str or str or str + :ivar status_details: Additional details about the status. + :vartype status_details: ~azure.ai.projects.models.RealtimeResponseStatusDetails + :ivar metadata: + :vartype metadata: ~azure.ai.projects.models.Metadata + :ivar usage: Usage statistics for the Response, this will correspond to billing. A Realtime API + session will maintain a conversation context and append new Items to the Conversation, thus + output from previous turns (text and audio tokens) will become the input for later turns. + :vartype usage: ~azure.ai.projects.models.RealtimeResponseUsage + :ivar conversation_id: Which conversation the response is added to, determined by the + ``conversation`` field in the ``response.create`` event. If ``auto``, the response will be + added to the default conversation and the value of ``conversation_id`` will be an id like + ``conv_1234``. If ``none``, the response will not be added to any conversation and the value of + ``conversation_id`` will be ``null``. If responses are being triggered automatically by VAD the + response will be added to the default conversation. + :vartype conversation_id: str + :ivar output_modalities: The set of modalities the model used to respond, currently the only + possible values are ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text + transcript. Setting the output to mode ``text`` will disable audio output from the model. + :vartype output_modalities: list[str or str] + :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, + inclusive of tool calls, that was used in this response. Is either a int type or a + Literal["inf"] type. + :vartype max_output_tokens: int or str """ - type: Union[str, "_models.VoiceAvatarType"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """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.VoiceAvatarOutputProtocol"]] = rest_field( + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the response, will look like ``resp_1234``.""" + object: Optional[Literal["realtime.response"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The transport used to deliver the avatar video stream. Known values are: \"webrtc\", - \"websocket\", and \"websocket-binary\".""" - model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The avatar model identifier.""" - video: Optional["_models.VoiceAgentAvatarVideoParams"] = rest_field( + """The object type, must be ``realtime.response``. Default value is \"realtime.response\".""" + status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Avatar video encoder and presentation settings.""" - scene: Optional["_models.VoiceAgentAvatarScene"] = rest_field( + """The final status of the response (``completed``, ``cancelled``, ``failed``, or ``incomplete``, + ``in_progress``). Is one of the following types: Literal[\"completed\"], + Literal[\"cancelled\"], Literal[\"failed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" + status_details: Optional["_models.RealtimeResponseStatusDetails"] = 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.""" + """Additional details about the status.""" + metadata: Optional["_models.Metadata"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + usage: Optional["_models.RealtimeResponseUsage"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Usage statistics for the Response, this will correspond to billing. A Realtime API session will + maintain a conversation context and append new Items to the Conversation, thus output from + previous turns (text and audio tokens) will become the input for later turns.""" + conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Which conversation the response is added to, determined by the ``conversation`` field in the + ``response.create`` event. If ``auto``, the response will be added to the default conversation + and the value of ``conversation_id`` will be an id like ``conv_1234``. If ``none``, the + response will not be added to any conversation and the value of ``conversation_id`` will be + ``null``. If responses are being triggered automatically by VAD the response will be added to + the default conversation.""" + output_modalities: Optional[list[Literal["text", "audio"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The set of modalities the model used to respond, currently the only possible values are + ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text transcript. Setting the + output to mode ``text`` will disable audio output from the model.""" + max_output_tokens: Optional[Union[int, Literal["inf"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Maximum number of output tokens for a single assistant response, inclusive of tool calls, that + was used in this response. Is either a int type or a Literal[\"inf\"] type.""" @overload def __init__( self, *, - type: Union[str, "_models.VoiceAvatarType"], - character: str, - style: Optional[str] = None, - customized: Optional[bool] = None, - output_protocol: Optional[Union[str, "_models.VoiceAvatarOutputProtocol"]] = None, - model: Optional[str] = None, - video: Optional["_models.VoiceAgentAvatarVideoParams"] = None, - scene: Optional["_models.VoiceAgentAvatarScene"] = None, - output_audit_audio: Optional[bool] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + object: Optional[Literal["realtime.response"]] = None, + status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] = None, + status_details: Optional["_models.RealtimeResponseStatusDetails"] = None, + metadata: Optional["_models.Metadata"] = None, + usage: Optional["_models.RealtimeResponseUsage"] = None, + conversation_id: Optional[str] = None, + output_modalities: Optional[list[Literal["text", "audio"]]] = None, + max_output_tokens: Optional[Union[int, Literal["inf"]]] = None, ) -> None: ... @overload @@ -23246,50 +24069,76 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentSessionAvatarConfig(VoiceAvatarConfig): # pylint: disable=docstring-keyword-should-match-keyword-only - """Avatar settings accepted by the stable voice-agent WebSocket contract. +class VoiceAgentRealtimeResponse( + VoiceAgentRealtimeResponseBase +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A live realtime response returned by the voice-agent service in both ``response.created`` and + ``response.done`` events. - :ivar type: The avatar type. Required. Known values are: "video_avatar" and "photo_avatar". - :vartype type: str or ~azure.ai.projects.models.VoiceAvatarType - :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", "websocket", and "websocket-binary". - :vartype output_protocol: str or ~azure.ai.projects.models.VoiceAvatarOutputProtocol - :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 ice_servers: - :vartype ice_servers: list[~azure.ai.projects.models.VoiceAgentAvatarIceServer] + :ivar id: The unique ID of the response, will look like ``resp_1234``. + :vartype id: str + :ivar object: The object type, must be ``realtime.response``. Default value is + "realtime.response". + :vartype object: str + :ivar status: The final status of the response (``completed``, ``cancelled``, ``failed``, or + ``incomplete``, ``in_progress``). Is one of the following types: Literal["completed"], + Literal["cancelled"], Literal["failed"], Literal["incomplete"], Literal["in_progress"] + :vartype status: str or str or str or str or str + :ivar status_details: Additional details about the status. + :vartype status_details: ~azure.ai.projects.models.RealtimeResponseStatusDetails + :ivar metadata: + :vartype metadata: ~azure.ai.projects.models.Metadata + :ivar usage: Usage statistics for the Response, this will correspond to billing. A Realtime API + session will maintain a conversation context and append new Items to the Conversation, thus + output from previous turns (text and audio tokens) will become the input for later turns. + :vartype usage: ~azure.ai.projects.models.RealtimeResponseUsage + :ivar conversation_id: Which conversation the response is added to, determined by the + ``conversation`` field in the ``response.create`` event. If ``auto``, the response will be + added to the default conversation and the value of ``conversation_id`` will be an id like + ``conv_1234``. If ``none``, the response will not be added to any conversation and the value of + ``conversation_id`` will be ``null``. If responses are being triggered automatically by VAD the + response will be added to the default conversation. + :vartype conversation_id: str + :ivar output_modalities: The set of modalities the model used to respond, currently the only + possible values are ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text + transcript. Setting the output to mode ``text`` will disable audio output from the model. + :vartype output_modalities: list[str or str] + :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, + inclusive of tool calls, that was used in this response. Is either a int type or a + Literal["inf"] type. + :vartype max_output_tokens: int or str + :ivar audio: The audio configuration used by the live response, including flat voice provider, + locale, and format fields under ``output``. + :vartype audio: ~azure.ai.projects.models.VoiceResponseAudio + :ivar output: The items produced by the live response. + :vartype output: list[~azure.ai.projects.models.RealtimeConversationItem] """ - ice_servers: Optional[list["_models.VoiceAgentAvatarIceServer"]] = rest_field( + audio: Optional["_models.VoiceResponseAudio"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The audio configuration used by the live response, including flat voice provider, locale, and + format fields under ``output``.""" + output: Optional[list["_models.RealtimeConversationItem"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) + """The items produced by the live response.""" @overload def __init__( self, *, - type: Union[str, "_models.VoiceAvatarType"], - character: str, - style: Optional[str] = None, - customized: Optional[bool] = None, - output_protocol: Optional[Union[str, "_models.VoiceAvatarOutputProtocol"]] = None, - model: Optional[str] = None, - video: Optional["_models.VoiceAgentAvatarVideoParams"] = None, - scene: Optional["_models.VoiceAgentAvatarScene"] = None, - output_audit_audio: Optional[bool] = None, - ice_servers: Optional[list["_models.VoiceAgentAvatarIceServer"]] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + object: Optional[Literal["realtime.response"]] = None, + status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] = None, + status_details: Optional["_models.RealtimeResponseStatusDetails"] = None, + metadata: Optional["_models.Metadata"] = None, + usage: Optional["_models.RealtimeResponseUsage"] = None, + conversation_id: Optional[str] = None, + output_modalities: Optional[list[Literal["text", "audio"]]] = None, + max_output_tokens: Optional[Union[int, Literal["inf"]]] = None, + audio: Optional["_models.VoiceResponseAudio"] = None, + output: Optional[list["_models.RealtimeConversationItem"]] = None, ) -> None: ... @overload @@ -23303,145 +24152,138 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentSessionResponseConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The effective stable realtime session settings returned by the voice-agent service. +class VoiceAgentResponseCreateParams(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Parameters accepted by a voice-agent ``response.create`` event. - :ivar type: The session type. Always ``realtime``. Required. Default value is "realtime". - :vartype type: str - :ivar instructions: Instructions applied throughout the session. + :ivar instructions: The default system instructions (i.e. system message) prepended to model + calls. This field allows the client to guide the model on desired responses. The model can be + instructed on response content and format, (e.g. "be extremely succinct", "act friendly", "here + are examples of good responses") and on audio behavior (e.g. "talk quickly", "inject emotion + into your voice", "laugh frequently"). The instructions are not guaranteed to be followed by + the model, but they provide guidance to the model on the desired behavior. Note that the server + sets default instructions which will be used if this field is not set and are visible in the + ``session.created`` event at the start of 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.VoiceAudioConfig - :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. + :ivar tools: Tools available to the model. + :vartype tools: list[~azure.ai.projects.models.RealtimeFunctionTool or + ~azure.ai.projects.models.MCPTool] + :ivar tool_choice: How the model chooses tools. Provide one of the string modes or force a + specific function/MCP tool. Is one of the following types: Union[str, + "_models.ToolChoiceOptions"], ToolChoiceFunction, ToolChoiceMCP + :vartype tool_choice: str or ~azure.ai.projects.models.ToolChoiceOptions 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. Only + supported by reasoning Realtime models such as ``gpt-realtime-2``. :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. Is either a - VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. - :vartype interim_response: ~azure.ai.projects.models.VoiceAgentStaticInterimResponseConfig or - ~azure.ai.projects.models.VoiceAgentLlmInterimResponseConfig - :ivar greeting: A proactive assistant greeting started after session configuration. - :vartype greeting: ~azure.ai.projects.models.VoiceGreetingConfig - :ivar object: The object type. Always ``realtime.session``. Required. Default value is - "realtime.session". - :vartype object: str - :ivar id: The session identifier. Required. - :vartype id: str - :ivar model: The selected model. Required. - :vartype model: str - :ivar expires_at: The session expiration time as a Unix timestamp in seconds. - :vartype expires_at: ~datetime.datetime + :ivar reasoning: + :vartype reasoning: ~azure.ai.projects.models.RealtimeReasoning + :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, + inclusive of tool calls. Provide an integer between 1 and 4096 to limit output tokens, or + ``inf`` for the maximum available tokens for a given model. Defaults to ``inf``. Is either a + int type or a Literal["inf"] type. + :vartype max_output_tokens: int or str + :ivar conversation: Controls which conversation the response is added to. Currently supports + ``auto`` and ``none``, with ``auto`` as the default value. The ``auto`` value means that the + contents of the response will be added to the default conversation. Set this to ``none`` to + create an out-of-band response which will not add items to default conversation. Is one of the + following types: Literal["auto"], Literal["none"], str + :vartype conversation: str or str or str + :ivar metadata: + :vartype metadata: ~azure.ai.projects.models.Metadata + :ivar output_modalities: Modalities that the response may return. + :vartype output_modalities: list[str or ~azure.ai.projects.models.VoiceOutputModality] + :ivar audio: Response-specific audio settings. + :vartype audio: ~azure.ai.projects.models.PickPropertiesVoiceAgentAudioConfig + :ivar input: Conversation items used as inline response input. + :vartype input: list[~azure.ai.projects.models.RealtimeConversationItem] + :ivar pre_generated_assistant_message: A pre-generated assistant message used to begin the + response. + :vartype pre_generated_assistant_message: ~azure.ai.projects.models.RealtimeConversationItem + :ivar interim_response: Interim-response settings for this response. + :vartype interim_response: ~azure.ai.projects.models.VoiceAgentInterimResponseConfig """ - 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( + """The default system instructions (i.e. system message) prepended to model calls. This field + allows the client to guide the model on desired responses. The model can be instructed on + response content and format, (e.g. \"be extremely succinct\", \"act friendly\", \"here are + examples of good responses\") and on audio behavior (e.g. \"talk quickly\", \"inject emotion + into your voice\", \"laugh frequently\"). The instructions are not guaranteed to be followed by + the model, but they provide guidance to the model on the desired behavior. Note that the server + sets default instructions which will be used if this field is not set and are visible in the + ``session.created`` event at the start of the session.""" + tools: Optional[list[Union["_models.RealtimeFunctionTool", "_models.MCPTool"]]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The output modalities enabled for the session.""" - audio: Optional["_models.VoiceAudioConfig"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The input- and output-audio settings for the session.""" - avatar: Optional["_models.VoiceAgentSessionAvatarConfig"] = rest_field( + """Tools available to the model.""" + tool_choice: Optional[ + Union[str, "_models.ToolChoiceOptions", "_models.ToolChoiceFunction", "_models.ToolChoiceMCP"] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """How the model chooses tools. Provide one of the string modes or force a specific function/MCP + tool. Is one of the following types: Union[str, \"_models.ToolChoiceOptions\"], + ToolChoiceFunction, ToolChoiceMCP""" + parallel_tool_calls: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the model may call multiple tools in parallel. Only supported by reasoning Realtime + models such as ``gpt-realtime-2``.""" + reasoning: Optional["_models.RealtimeReasoning"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The avatar settings for the session.""" - animation: Optional["_models.VoiceAgentAnimationConfig"] = rest_field( + max_output_tokens: Optional[Union[int, Literal["inf"]]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Animation settings for the session.""" - tools: Optional[list["_models.VoiceAgentTool"]] = rest_field( + """Maximum number of output tokens for a single assistant response, inclusive of tool calls. + Provide an integer between 1 and 4096 to limit output tokens, or ``inf`` for the maximum + available tokens for a given model. Defaults to ``inf``. Is either a int type or a + Literal[\"inf\"] type.""" + conversation: Optional[Union[Literal["auto"], Literal["none"], str]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Tools available to the session.""" - tool_choice: Optional["_unions.VoiceAgentToolChoice"] = rest_field( + """Controls which conversation the response is added to. Currently supports ``auto`` and ``none``, + with ``auto`` as the default value. The ``auto`` value means that the contents of the response + will be added to the default conversation. Set this to ``none`` to create an out-of-band + response which will not add items to default conversation. Is one of the following types: + Literal[\"auto\"], Literal[\"none\"], str""" + metadata: Optional["_models.Metadata"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = 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( + """Modalities that the response may return.""" + audio: Optional["_models.PickPropertiesVoiceAgentAudioConfig"] = 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( + """Response-specific audio settings.""" + input: Optional[list["_models.RealtimeConversationItem"]] = 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["_unions.VoiceAgentInterimResponse"] = rest_field( + """Conversation items used as inline response input.""" + pre_generated_assistant_message: Optional["_models.RealtimeConversationItem"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Interim-response settings for latency and tool execution. Is either a - VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type.""" - greeting: Optional["_models.VoiceGreetingConfig"] = rest_field( + """A pre-generated assistant message used to begin the response.""" + interim_response: Optional["_models.VoiceAgentInterimResponseConfig"] = rest_field( 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.""" + """Interim-response settings for this response.""" @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.VoiceAudioConfig"] = 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, + tools: Optional[list[Union["_models.RealtimeFunctionTool", "_models.MCPTool"]]] = None, + tool_choice: Optional[ + Union[str, "_models.ToolChoiceOptions", "_models.ToolChoiceFunction", "_models.ToolChoiceMCP"] + ] = None, parallel_tool_calls: Optional[bool] = None, - include: Optional[list[Union[str, "_models.VoiceAgentSessionIncludeOption"]]] = None, - metadata: Optional[dict[str, str]] = None, - interim_response: Optional["_unions.VoiceAgentInterimResponse"] = None, - greeting: Optional["_models.VoiceGreetingConfig"] = None, - expires_at: Optional[datetime.datetime] = None, + reasoning: Optional["_models.RealtimeReasoning"] = None, + max_output_tokens: Optional[Union[int, Literal["inf"]]] = None, + conversation: Optional[Union[Literal["auto"], Literal["none"], str]] = None, + metadata: Optional["_models.Metadata"] = None, + output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = None, + audio: Optional["_models.PickPropertiesVoiceAgentAudioConfig"] = None, + input: Optional[list["_models.RealtimeConversationItem"]] = None, + pre_generated_assistant_message: Optional["_models.RealtimeConversationItem"] = None, + interim_response: Optional["_models.VoiceAgentInterimResponseConfig"] = None, ) -> None: ... @overload @@ -23453,127 +24295,110 @@ 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 VoiceAgentSemanticVadTurnDetection( + VoiceAgentTurnDetectionConfig, discriminator="semantic_vad" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """OpenAI semantic VAD turn-detection settings. - :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.VoiceAudioConfig - :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. Is either a - VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. - :vartype interim_response: ~azure.ai.projects.models.VoiceAgentStaticInterimResponseConfig or - ~azure.ai.projects.models.VoiceAgentLlmInterimResponseConfig - :ivar greeting: A proactive assistant greeting started after session configuration. - :vartype greeting: ~azure.ai.projects.models.VoiceGreetingConfig + :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech + stops. + :vartype auto_truncate: bool + :ivar eagerness: Is one of the following types: Literal["low"], Literal["medium"], + Literal["high"], Literal["auto"] + :vartype eagerness: str or str or str or str + :ivar create_response: + :vartype create_response: bool + :ivar interrupt_response: + :vartype interrupt_response: bool + :ivar type: Required. Semantic voice activity detection. + :vartype type: str or ~azure.ai.projects.models.SEMANTIC_VAD """ - 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.VoiceAudioConfig"] = 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["_unions.VoiceAgentInterimResponse"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Interim-response settings for latency and tool execution. Is either a - VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type.""" - greeting: Optional["_models.VoiceGreetingConfig"] = rest_field( + eagerness: Optional[Literal["low", "medium", "high", "auto"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """A proactive assistant greeting started after session configuration.""" + """Is one of the following types: Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"], + Literal[\"auto\"]""" + create_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + interrupt_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[VoiceAgentTurnDetectionType.SEMANTIC_VAD] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Semantic voice activity detection.""" + + @overload + def __init__( + self, + *, + auto_truncate: Optional[bool] = None, + eagerness: Optional[Literal["low", "medium", "high", "auto"]] = 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.SEMANTIC_VAD # type: ignore + + +class VoiceAgentServerEventResponseAnimationBlendshapesDelta( + RealtimeServerEvent, discriminator="response.animation_blendshapes.delta" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.animation_blendshapes.delta`` server event. + + :ivar type: Required. RESPONSE_ANIMATION_BLENDSHAPES_DELTA. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_ANIMATION_BLENDSHAPES_DELTA + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int + :ivar frames: Animation frames as numeric blendshape weights. Required. + :vartype frames: list[list[float]] + :ivar frame_index: The index of the first frame in this delta. Required. + :vartype frame_index: int + """ + + type: Literal[RealtimeServerEventType.RESPONSE_ANIMATION_BLENDSHAPES_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. RESPONSE_ANIMATION_BLENDSHAPES_DELTA.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + frames: list[list[float]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Animation frames as numeric blendshape weights. Required.""" + frame_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the first frame in this delta. Required.""" @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.VoiceAudioConfig"] = 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["_unions.VoiceAgentInterimResponse"] = None, - greeting: Optional["_models.VoiceGreetingConfig"] = None, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + frames: list[list[float]], + frame_index: int, ) -> None: ... @overload @@ -23585,36 +24410,45 @@ 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.type = RealtimeServerEventType.RESPONSE_ANIMATION_BLENDSHAPES_DELTA # type: ignore -class VoiceAgentStaticInterimResponseConfig( - VoiceAgentInterimResponseConfig, discriminator="static_interim_response" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A static interim response selected from configured text. +class VoiceAgentServerEventResponseAnimationBlendshapesDone( + RealtimeServerEvent, discriminator="response.animation_blendshapes.done" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.animation_blendshapes.done`` server event. - :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 type: Required. Default value is "static_interim_response". - :vartype type: str - :ivar texts: Candidate text values for the interim response. - :vartype texts: list[str] + :ivar type: Required. RESPONSE_ANIMATION_BLENDSHAPES_DONE. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_ANIMATION_BLENDSHAPES_DONE + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int """ - type: Literal["static_interim_response"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Default value is \"static_interim_response\".""" - texts: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Candidate text values for the interim response.""" + type: Literal[RealtimeServerEventType.RESPONSE_ANIMATION_BLENDSHAPES_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. RESPONSE_ANIMATION_BLENDSHAPES_DONE.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - triggers: Optional[list[Union[str, "_models.VoiceAgentInterimResponseTrigger"]]] = None, - latency_threshold_ms: Optional[datetime.timedelta] = None, - texts: Optional[list[str]] = None, + event_id: str, + response_id: str, + item_id: str, + output_index: int, ) -> None: ... @overload @@ -23626,56 +24460,62 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "static_interim_response" # type: ignore + self.type = RealtimeServerEventType.RESPONSE_ANIMATION_BLENDSHAPES_DONE # type: ignore -class VoiceAgentTranscriptionPhrase(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A transcribed phrase with timing information. +class VoiceAgentServerEventResponseAnimationVisemeDelta( + RealtimeServerEvent, discriminator="response.animation_viseme.delta" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.animation_viseme.delta`` server event. - :ivar offset_milliseconds: The phrase offset from the beginning of the audio, in milliseconds. - Required. - :vartype offset_milliseconds: ~datetime.timedelta - :ivar duration_milliseconds: The phrase duration in milliseconds. Required. - :vartype duration_milliseconds: ~datetime.timedelta - :ivar text: The transcribed phrase text. Required. - :vartype text: str - :ivar words: Word-level timing details, when available. - :vartype words: list[~azure.ai.projects.models.VoiceAgentTranscriptionWord] - :ivar locale: The detected locale. - :vartype locale: str - :ivar confidence: The transcription confidence score. - :vartype confidence: float + :ivar type: Required. RESPONSE_ANIMATION_VISEME_DELTA. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_ANIMATION_VISEME_DELTA + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int + :ivar audio_offset_ms: Required. + :vartype audio_offset_ms: ~datetime.timedelta + :ivar viseme_id: Required. + :vartype viseme_id: int """ - offset_milliseconds: datetime.timedelta = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """The phrase offset from the beginning of the audio, in milliseconds. Required.""" - duration_milliseconds: datetime.timedelta = rest_field( + type: Literal[RealtimeServerEventType.RESPONSE_ANIMATION_VISEME_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. RESPONSE_ANIMATION_VISEME_DELTA.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + audio_offset_ms: datetime.timedelta = rest_field( visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" ) - """The phrase duration in milliseconds. Required.""" - text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The transcribed phrase text. Required.""" - words: Optional[list["_models.VoiceAgentTranscriptionWord"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Word-level timing details, when available.""" - locale: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The detected locale.""" - confidence: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The transcription confidence score.""" + """Required.""" + viseme_id: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - offset_milliseconds: datetime.timedelta, - duration_milliseconds: datetime.timedelta, - text: str, - words: Optional[list["_models.VoiceAgentTranscriptionWord"]] = None, - locale: Optional[str] = None, - confidence: Optional[float] = None, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + audio_offset_ms: datetime.timedelta, + viseme_id: int, ) -> None: ... @overload @@ -23687,38 +24527,128 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RESPONSE_ANIMATION_VISEME_DELTA # type: ignore -class VoiceAgentTranscriptionWord(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A time-stamped word in an input-audio transcription. +class VoiceAgentServerEventResponseAnimationVisemeDone( + RealtimeServerEvent, discriminator="response.animation_viseme.done" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.animation_viseme.done`` server event. - :ivar text: The transcribed word text. Required. + :ivar type: Required. RESPONSE_ANIMATION_VISEME_DONE. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_ANIMATION_VISEME_DONE + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int + """ + + type: Literal[RealtimeServerEventType.RESPONSE_ANIMATION_VISEME_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. RESPONSE_ANIMATION_VISEME_DONE.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + content_index: int = 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, + ) -> 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_ANIMATION_VISEME_DONE # type: ignore + + +class VoiceAgentServerEventResponseAudioTimestampDelta( + RealtimeServerEvent, discriminator="response.audio_timestamp.delta" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.audio_timestamp.delta`` server event. + + :ivar type: Required. RESPONSE_AUDIO_TIMESTAMP_DELTA. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_AUDIO_TIMESTAMP_DELTA + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int + :ivar audio_offset_ms: Required. + :vartype audio_offset_ms: ~datetime.timedelta + :ivar audio_duration_ms: Required. + :vartype audio_duration_ms: ~datetime.timedelta + :ivar text: Required. :vartype text: str - :ivar offset_milliseconds: The word offset from the beginning of the audio, in milliseconds. - Required. - :vartype offset_milliseconds: ~datetime.timedelta - :ivar duration_milliseconds: The word duration in milliseconds. Required. - :vartype duration_milliseconds: ~datetime.timedelta + :ivar timestamp_type: Required. Default value is "word". + :vartype timestamp_type: str """ - text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The transcribed word text. Required.""" - offset_milliseconds: datetime.timedelta = rest_field( + type: Literal[RealtimeServerEventType.RESPONSE_AUDIO_TIMESTAMP_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. RESPONSE_AUDIO_TIMESTAMP_DELTA.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + audio_offset_ms: datetime.timedelta = rest_field( visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" ) - """The word offset from the beginning of the audio, in milliseconds. Required.""" - duration_milliseconds: datetime.timedelta = rest_field( + """Required.""" + audio_duration_ms: datetime.timedelta = rest_field( visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" ) - """The word duration in milliseconds. Required.""" + """Required.""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + timestamp_type: Literal["word"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"word\".""" @overload def __init__( self, *, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + audio_offset_ms: datetime.timedelta, + audio_duration_ms: datetime.timedelta, text: str, - offset_milliseconds: datetime.timedelta, - duration_milliseconds: datetime.timedelta, ) -> None: ... @overload @@ -23730,49 +24660,51 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RESPONSE_AUDIO_TIMESTAMP_DELTA # type: ignore + self.timestamp_type: Literal["word"] = "word" -class VoiceAssistantMessageItem( - RealtimeConversationItemMessageAssistant -): # pylint: disable=docstring-keyword-should-match-keyword-only - """An assistant message item. Only ``output_text`` and ``output_audio`` content are valid for - assistant messages. +class VoiceAgentServerEventResponseAudioTimestampDone( + RealtimeServerEvent, discriminator="response.audio_timestamp.done" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``response.audio_timestamp.done`` server event. - :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. Default value is "message". - :vartype type: str - :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. + :ivar type: Required. RESPONSE_AUDIO_TIMESTAMP_DONE. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_AUDIO_TIMESTAMP_DONE + :ivar event_id: Required. + :vartype event_id: str + :ivar response_id: Required. :vartype response_id: str + :ivar item_id: Required. + :vartype item_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int """ - 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[RealtimeServerEventType.RESPONSE_AUDIO_TIMESTAMP_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. RESPONSE_AUDIO_TIMESTAMP_DONE.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - 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, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, ) -> None: ... @overload @@ -23784,33 +24716,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_AUDIO_TIMESTAMP_DONE # type: ignore -class VoiceAudioConfig(_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 VoiceAgentServerEventResponseVideoDelta( + RealtimeServerEvent, discriminator="response.video.delta" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``response.video.delta`` server event. - :ivar input: Input (microphone) audio configuration. - :vartype input: ~azure.ai.projects.models.VoiceAudioInputConfig - :ivar output: Output (agent speech) audio configuration. - :vartype output: ~azure.ai.projects.models.VoiceAudioOutputConfig + :ivar type: Required. RESPONSE_VIDEO_DELTA. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_VIDEO_DELTA + :ivar event_id: Required. + :vartype event_id: str + :ivar output_index: Required. + :vartype output_index: int + :ivar codec: Required. + :vartype codec: str + :ivar delta: The base64-encoded video frame data. Required. + :vartype delta: str """ - input: Optional["_models.VoiceAudioInputConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Input (microphone) audio configuration.""" - output: Optional["_models.VoiceAudioOutputConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Output (agent speech) audio configuration.""" + type: Literal[RealtimeServerEventType.RESPONSE_VIDEO_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. RESPONSE_VIDEO_DELTA.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + codec: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The base64-encoded video frame data. Required.""" @overload def __init__( self, *, - input: Optional["_models.VoiceAudioInputConfig"] = None, - output: Optional["_models.VoiceAudioOutputConfig"] = None, + event_id: str, + output_index: int, + codec: str, + delta: str, ) -> None: ... @overload @@ -23822,37 +24766,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_VIDEO_DELTA # type: ignore -class VoiceAudioFormat(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """An audio format. Follows the OpenAI Realtime session schema; ``type`` carries the media - subtype. +class VoiceAgentServerEventSessionAvatarConnecting( + RealtimeServerEvent, discriminator="session.avatar.connecting" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``session.avatar.connecting`` server event. - :ivar type: The audio format type, e.g. 'audio/pcm' (16-bit PCM), 'audio/pcmu' (G.711 mu-law), - or 'audio/pcma' (G.711 A-law). Required. Known values are: "audio/pcm", "audio/pcmu", and - "audio/pcma". - :vartype type: str or ~azure.ai.projects.models.VoiceAudioFormatType - :ivar rate: The sample rate in Hz. Applies to 'audio/pcm' (e.g. 24000); omit for telephony - G.711 formats (8 kHz). - :vartype rate: int + :ivar type: Required. SESSION_AVATAR_CONNECTING. + :vartype type: str or ~azure.ai.projects.models.SESSION_AVATAR_CONNECTING + :ivar event_id: Required. + :vartype event_id: str + :ivar server_sdp: The server's SDP answer for avatar media negotiation. Required. + :vartype server_sdp: str """ - type: Union[str, "_models.VoiceAudioFormatType"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The audio format type, e.g. 'audio/pcm' (16-bit PCM), 'audio/pcmu' (G.711 mu-law), or - 'audio/pcma' (G.711 A-law). Required. Known values are: \"audio/pcm\", \"audio/pcmu\", and - \"audio/pcma\".""" - rate: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The sample rate in Hz. Applies to 'audio/pcm' (e.g. 24000); omit for telephony G.711 formats (8 - kHz).""" + type: Literal[RealtimeServerEventType.SESSION_AVATAR_CONNECTING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. SESSION_AVATAR_CONNECTING.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + server_sdp: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The server's SDP answer for avatar media negotiation. Required.""" @overload def __init__( self, *, - type: Union[str, "_models.VoiceAudioFormatType"], - rate: Optional[int] = None, + event_id: str, + server_sdp: str, ) -> None: ... @overload @@ -23864,66 +24806,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.SESSION_AVATAR_CONNECTING # type: ignore -class VoiceAudioInputConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Input audio configuration for a voice agent. +class VoiceAgentServerEventSessionAvatarSwitchToIdle( + RealtimeServerEvent, discriminator="session.avatar.switch_to_idle" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``session.avatar.switch_to_idle`` server event. - :ivar format: The input audio format. - :vartype format: ~azure.ai.projects.models.VoiceAudioFormat - :ivar noise_reduction: Input noise reduction. Set to null to disable. - :vartype noise_reduction: ~azure.ai.projects.models.VoiceNoiseReduction - :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. - Is one of the following types: VoiceServerVadTurnDetection, VoiceAgentSemanticVadTurnDetection, - VoiceAzureSemanticVadTurnDetection, VoiceAzureSemanticVadEnTurnDetection, - VoiceAzureSemanticVadMultilingualTurnDetection - :vartype turn_detection: ~azure.ai.projects.models.VoiceServerVadTurnDetection or - ~azure.ai.projects.models.VoiceAgentSemanticVadTurnDetection or - ~azure.ai.projects.models.VoiceAzureSemanticVadTurnDetection or - ~azure.ai.projects.models.VoiceAzureSemanticVadEnTurnDetection or - ~azure.ai.projects.models.VoiceAzureSemanticVadMultilingualTurnDetection - :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.VoiceInputTranscription + :ivar type: Required. SESSION_AVATAR_SWITCH_TO_IDLE. + :vartype type: str or ~azure.ai.projects.models.SESSION_AVATAR_SWITCH_TO_IDLE + :ivar event_id: Required. + :vartype event_id: str + :ivar turn_id: + :vartype turn_id: str """ - format: Optional["_models.VoiceAudioFormat"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The input audio format.""" - noise_reduction: Optional["_models.VoiceNoiseReduction"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Input noise reduction. Set to null to disable.""" - turn_detection: Optional["_unions.VoiceAgentTurnDetection"] = 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. Is one of the - following types: VoiceServerVadTurnDetection, VoiceAgentSemanticVadTurnDetection, - VoiceAzureSemanticVadTurnDetection, VoiceAzureSemanticVadEnTurnDetection, - VoiceAzureSemanticVadMultilingualTurnDetection""" - echo_cancellation: Optional["_models.VoiceAgentEchoCancellation"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Optional server-side echo cancellation settings.""" - transcription: Optional["_models.VoiceInputTranscription"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Asynchronous input-audio transcription. Set to null to disable transcription.""" + type: Literal[RealtimeServerEventType.SESSION_AVATAR_SWITCH_TO_IDLE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. SESSION_AVATAR_SWITCH_TO_IDLE.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + turn_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - format: Optional["_models.VoiceAudioFormat"] = None, - noise_reduction: Optional["_models.VoiceNoiseReduction"] = None, - turn_detection: Optional["_unions.VoiceAgentTurnDetection"] = None, - echo_cancellation: Optional["_models.VoiceAgentEchoCancellation"] = None, - transcription: Optional["_models.VoiceInputTranscription"] = None, + event_id: str, + turn_id: Optional[str] = None, ) -> None: ... @overload @@ -23935,143 +24845,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.SESSION_AVATAR_SWITCH_TO_IDLE # type: ignore -class VoiceAudioOutputConfig(_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. - - :ivar format: The output audio format. Applies to every ``voice_type`` and defaults to 24 kHz - PCM. - :vartype format: ~azure.ai.projects.models.VoiceAudioFormat - :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.VoiceAudioTimestampType] - """ - - format: Optional["_models.VoiceAudioFormat"] = 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.VoiceAudioTimestampType"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Timestamp kinds to include with output audio. Applies to every ``voice_type``.""" +class VoiceAgentServerEventSessionAvatarSwitchToSpeaking( + RealtimeServerEvent, discriminator="session.avatar.switch_to_speaking" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``session.avatar.switch_to_speaking`` server event. + + :ivar type: Required. SESSION_AVATAR_SWITCH_TO_SPEAKING. + :vartype type: str or ~azure.ai.projects.models.SESSION_AVATAR_SWITCH_TO_SPEAKING + :ivar event_id: Required. + :vartype event_id: str + :ivar turn_id: + :vartype turn_id: str + """ + + type: Literal[RealtimeServerEventType.SESSION_AVATAR_SWITCH_TO_SPEAKING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. SESSION_AVATAR_SWITCH_TO_SPEAKING.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + turn_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - format: Optional["_models.VoiceAudioFormat"] = 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.VoiceAudioTimestampType"]]] = None, + event_id: str, + turn_id: Optional[str] = None, ) -> None: ... @overload @@ -24083,85 +24884,37 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.SESSION_AVATAR_SWITCH_TO_SPEAKING # type: ignore -class VoiceAzureSemanticVadEnTurnDetection( - VoiceTurnDetection, discriminator="azure_semantic_vad_en" +class VoiceAgentServerEventWarning( + RealtimeServerEvent, discriminator="warning" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """English-optimized Azure semantic voice activity detection. + """The ``warning`` server event. - :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.VoiceEndOfUtteranceDetection - :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 type: Required. WARNING. + :vartype type: str or ~azure.ai.projects.models.WARNING + :ivar event_id: Required. + :vartype event_id: str + :ivar warning: Required. + :vartype warning: ~azure.ai.projects.models.VoiceAgentServerEventWarningDetails """ - type: Literal[VoiceTurnDetectionType.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.VoiceEndOfUtteranceDetection"] = rest_field( + type: Literal[RealtimeServerEventType.WARNING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. WARNING.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + warning: "_models.VoiceAgentServerEventWarningDetails" = 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.""" + """Required.""" @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.VoiceEndOfUtteranceDetection"] = None, - speech_duration_ms: Optional[datetime.timedelta] = None, - remove_filler_words: Optional[bool] = None, - create_response: Optional[bool] = None, - interrupt_response: Optional[bool] = None, + event_id: str, + warning: "_models.VoiceAgentServerEventWarningDetails", ) -> None: ... @overload @@ -24173,75 +24926,92 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN # type: ignore + self.type = RealtimeServerEventType.WARNING # type: ignore -class VoiceAzureSemanticVadMultilingualTurnDetection( - VoiceTurnDetection, discriminator="azure_semantic_vad_multilingual" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Multilingual Azure semantic voice activity detection. +class VoiceAgentServerEventWarningDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Details of a non-fatal warning. + + :ivar message: Required. + :vartype message: str + :ivar code: + :vartype code: str + :ivar param: + :vartype param: str + """ + + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + code: 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, + *, + message: str, + code: Optional[str] = None, + 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) + + +class VoiceAgentServerVadTurnDetection( + VoiceAgentTurnDetectionConfig, discriminator="server_vad" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Server-side voice activity detection. :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. + :ivar threshold: :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.VoiceEndOfUtteranceDetection + :ivar prefix_padding_ms: + :vartype prefix_padding_ms: int + :ivar silence_duration_ms: + :vartype silence_duration_ms: int + :ivar create_response: + :vartype create_response: bool + :ivar interrupt_response: + :vartype interrupt_response: bool + :ivar idle_timeout_ms: + :vartype idle_timeout_ms: int + :ivar type: Required. Server-side voice activity detection. + :vartype type: str or ~azure.ai.projects.models.SERVER_VAD :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 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 """ - type: Literal[VoiceTurnDetectionType.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( + prefix_padding_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + silence_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + create_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + interrupt_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + idle_timeout_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[VoiceAgentTurnDetectionType.SERVER_VAD] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Server-side voice activity detection.""" + speech_duration_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.VoiceEndOfUtteranceDetection"] = rest_field( + """Minimum speech duration required to trigger detection, 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__( @@ -24249,15 +25019,13 @@ def __init__( *, 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.VoiceEndOfUtteranceDetection"] = None, - speech_duration_ms: Optional[datetime.timedelta] = None, - remove_filler_words: Optional[bool] = None, + prefix_padding_ms: Optional[int] = None, + silence_duration_ms: Optional[int] = None, create_response: Optional[bool] = None, interrupt_response: Optional[bool] = None, - languages: Optional[list[str]] = None, + idle_timeout_ms: Optional[int] = None, + speech_duration_ms: Optional[datetime.timedelta] = None, + end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = None, ) -> None: ... @overload @@ -24269,91 +25037,55 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL # type: ignore + self.type = VoiceAgentTurnDetectionType.SERVER_VAD # type: ignore -class VoiceAzureSemanticVadTurnDetection( - VoiceTurnDetection, discriminator="azure_semantic_vad" +class VoiceAgentSessionAvatarConfig( + VoiceAgentAvatarConfig ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Azure semantic voice activity detection. + """Avatar settings accepted by the stable voice-agent WebSocket contract. - :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.VoiceEndOfUtteranceDetection - :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 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", "websocket", and "websocket-binary". + :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 ice_servers: + :vartype ice_servers: list[~azure.ai.projects.models.VoiceAgentAvatarIceServer] """ - type: Literal[VoiceTurnDetectionType.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.VoiceEndOfUtteranceDetection"] = rest_field( + ice_servers: Optional[list["_models.VoiceAgentAvatarIceServer"]] = 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.VoiceEndOfUtteranceDetection"] = 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, + 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, + ice_servers: Optional[list["_models.VoiceAgentAvatarIceServer"]] = None, ) -> None: ... @overload @@ -24365,84 +25097,146 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = VoiceTurnDetectionType.AZURE_SEMANTIC_VAD # type: ignore -class VoiceConversation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A persisted voice conversation. The Foundry envelope that owns a voice agent's stored - transcript, responses, per-turn metrics, and audio. It is the parent, retention, and delete - boundary: deleting it cascades to its responses, items, metrics, and audio. When finalization - fails, any partial persisted responses, items, and item audio remain readable. +class VoiceAgentSessionResponseConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The effective stable realtime session settings returned by the voice-agent service. - :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. + :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 usage: Final aggregate token usage across all responses in this conversation. Absent - while ``status`` is ``in_progress`` and populated after successful ``completed`` finalization; - it may be absent when ``status`` is ``failed``, and values are not guaranteed to be reported - incrementally. - :vartype usage: ~azure.ai.projects.models.RealtimeResponseUsage - :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 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 object: The object type. Always ``realtime.session``. Required. Default value is + "realtime.session". + :vartype object: str + :ivar id: The session identifier. Required. + :vartype id: str + :ivar model: The selected model. Required. + :vartype model: str + :ivar expires_at: The session expiration time as a Unix timestamp in seconds. + :vartype expires_at: ~datetime.datetime """ - 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( + 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 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 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 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 output modalities enabled for the session.""" + audio: Optional["_models.VoiceAgentAudioConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The Unix timestamp (in seconds) for when session and persistence finalization reached the - terminal ``completed`` or ``failed`` status. Absent while ``status`` is ``in_progress``.""" + """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"]) - """A set of key-value pairs attached to the conversation.""" - usage: Optional["_models.RealtimeResponseUsage"] = rest_field( + """Up to 16 string key-value pairs attached to the session.""" + interim_response: Optional["_models.VoiceAgentInterimResponseConfig"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Final aggregate token usage across all responses in this conversation. Absent while ``status`` - is ``in_progress`` and populated after successful ``completed`` finalization; it may be absent - when ``status`` is ``failed``, and values are not guaranteed to be reported incrementally.""" - 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``.""" + """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.""" + 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 - status: Union[str, "_models.VoiceConversationStatus"], - created_at: datetime.datetime, - completed_at: Optional[datetime.datetime] = None, + 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, - usage: Optional["_models.RealtimeResponseUsage"] = None, - last_error: Optional["_models.ApiError"] = None, + interim_response: Optional["_models.VoiceAgentInterimResponseConfig"] = None, + greeting: Optional["_models.VoiceAgentGreetingConfig"] = None, + expires_at: Optional[datetime.datetime] = None, ) -> None: ... @overload @@ -24454,45 +25248,126 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.object: Literal["voice.conversation"] = "voice.conversation" + self.type: Literal["realtime"] = "realtime" + self.object: Literal["realtime.session"] = "realtime.session" -class VoiceEndOfUtteranceDetection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Semantic end-of-utterance detection configuration. +class VoiceAgentSessionUpdateConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The stable realtime session settings accepted in a ``session.update`` client event. - :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.VoiceEndOfUtteranceDetectionModel - :ivar threshold_level: The sensitivity threshold. Known values are: "low", "medium", "high", - and "default". - :vartype threshold_level: str or ~azure.ai.projects.models.VoiceEndOfUtteranceThresholdLevel - :ivar timeout_ms: The detection timeout in milliseconds. - :vartype timeout_ms: ~datetime.timedelta + :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 """ - model: Union[str, "_models.VoiceEndOfUtteranceDetectionModel"] = rest_field( + 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 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.VoiceEndOfUtteranceThresholdLevel"]] = rest_field( + """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 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 output modalities enabled for the session.""" + audio: Optional["_models.VoiceAgentAudioConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The detection timeout in milliseconds.""" + """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, *, - model: Union[str, "_models.VoiceEndOfUtteranceDetectionModel"], - threshold_level: Optional[Union[str, "_models.VoiceEndOfUtteranceThresholdLevel"]] = None, - timeout_ms: Optional[datetime.timedelta] = None, + 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, ) -> None: ... @overload @@ -24504,52 +25379,36 @@ 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 VoiceFunctionCallItem( - RealtimeConversationItemFunctionCall +class VoiceAgentStaticInterimResponseConfig( + VoiceAgentInterimResponseConfig, discriminator="static_interim_response" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """A function call request item. + """A static interim response selected from configured text. - :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 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 type: Required. Default value is "static_interim_response". + :vartype type: str + :ivar texts: Candidate text values for the interim response. + :vartype texts: list[str] """ - 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["static_interim_response"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"static_interim_response\".""" + texts: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Candidate text values for the interim response.""" @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, + triggers: Optional[list[Union[str, "_models.VoiceAgentInterimResponseTrigger"]]] = None, + latency_threshold_ms: Optional[datetime.timedelta] = None, + texts: Optional[list[str]] = None, ) -> None: ... @overload @@ -24561,139 +25420,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = "static_interim_response" # type: ignore -class VoiceFunctionCallOutputItem( - RealtimeConversationItemFunctionCallOutput +class VoiceAgentSystemTool( + VoiceAgentTool, discriminator="system" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """A function call output item. - - :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 - """ - - 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, - *, - 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 - 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 VoiceInputTranscription(_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. + """A service-managed control that acts on the active voice session without customer code or + external authentication. - :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 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.VoiceInputTranscriptionModel - :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 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 """ - 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.""" - 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.VoiceInputTranscriptionModel"] = rest_field( + 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: Union[str, "_models.VoiceAgentSystemToolName"] = 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.""" + """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, - *, - model: Union[str, "_models.VoiceInputTranscriptionModel"], - language: Optional[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, + @overload + def __init__( + self, + *, + name: Union[str, "_models.VoiceAgentSystemToolName"], + description: Optional[str] = None, ) -> None: ... @overload @@ -24705,87 +25465,31 @@ 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 VoiceItemAudioResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Metadata for a single conversation item's audio segment. For bring-your-own-storage (BYOS), the - response includes ``blob_uri``, a direct customer-storage URI without a SAS token, that the - customer accesses with their own credentials. For Foundry-managed storage, ``blob_uri`` is - absent and the bytes are streamed through the item's ``/audio/content`` route. +class VoiceAgentTemplateGreetingConfig( + VoiceAgentGreetingConfig, discriminator="template" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A deterministic greeting rendered with the voice agent's structured inputs and synthesized + without model-authored generation. - :ivar conversation_id: The id of the conversation the item belongs to. Required. - :vartype conversation_id: str - :ivar item_id: The id of the item this audio belongs to. Required. - :vartype item_id: str - :ivar role: The role the audio belongs to. Known values are: "user" and "agent". - :vartype role: str or ~azure.ai.projects.models.VoiceAudioRole - :ivar format: The container format of the audio. "wav" - :vartype format: str or ~azure.ai.projects.models.VoiceAudioContainerFormat - :ivar codec: The audio codec. Known values are: "pcm16", "pcmu", and "pcma". - :vartype codec: str or ~azure.ai.projects.models.VoiceAudioCodec - :ivar sample_rate: The sample rate in Hz. - :vartype sample_rate: int - :ivar channels: The number of audio channels. - :vartype channels: int - :ivar start_offset_ms: The offset from the session start at which this segment begins. - :vartype start_offset_ms: ~datetime.timedelta - :ivar duration_ms: The duration of the audio segment. - :vartype duration_ms: ~datetime.timedelta - :ivar blob_uri: For bring-your-own-storage (BYOS) recordings only: the URI of the recording in - the customer's own storage, without a SAS token. The customer downloads it using their own - storage credentials. Absent for Foundry-managed storage, where the bytes are streamed via the - item's ``/audio/content`` route instead. - :vartype blob_uri: str + :ivar type: Required. Default value is "template". + :vartype type: str + :ivar text: The Handlebars text template spoken at session start. Required. + :vartype text: str """ - conversation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The id of the conversation the item belongs to. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The id of the item this audio belongs to. Required.""" - role: Optional[Union[str, "_models.VoiceAudioRole"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The role the audio belongs to. Known values are: \"user\" and \"agent\".""" - format: Optional[Union[str, "_models.VoiceAudioContainerFormat"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The container format of the audio. \"wav\"""" - codec: Optional[Union[str, "_models.VoiceAudioCodec"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The audio codec. Known values are: \"pcm16\", \"pcmu\", and \"pcma\".""" - sample_rate: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The sample rate in Hz.""" - channels: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of audio channels.""" - start_offset_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """The offset from the session start at which this segment begins.""" - duration_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """The duration of the audio segment.""" - blob_uri: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """For bring-your-own-storage (BYOS) recordings only: the URI of the recording in the customer's - own storage, without a SAS token. The customer downloads it using their own storage - credentials. Absent for Foundry-managed storage, where the bytes are streamed via the item's - ``/audio/content`` route instead.""" + type: Literal["template"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"template\".""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Handlebars text template spoken at session start. Required.""" @overload def __init__( self, *, - conversation_id: str, - item_id: str, - role: Optional[Union[str, "_models.VoiceAudioRole"]] = None, - format: Optional[Union[str, "_models.VoiceAudioContainerFormat"]] = None, - codec: Optional[Union[str, "_models.VoiceAudioCodec"]] = None, - sample_rate: Optional[int] = None, - channels: Optional[int] = None, - start_offset_ms: Optional[datetime.timedelta] = None, - duration_ms: Optional[datetime.timedelta] = None, - blob_uri: Optional[str] = None, + text: str, ) -> None: ... @overload @@ -24797,43 +25501,45 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = "template" # type: ignore -class VoiceMcpApprovalRequestItem( - RealtimeMCPApprovalRequest +class VoiceAgentToolboxTool( + VoiceAgentTool, discriminator="toolbox" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """An MCP approval request item. + """A reference to a Foundry toolbox, which is a versioned bundle of tools executed through its MCP + endpoint. - :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 type: The type of the tool. Always ``toolbox``. Required. Default value is "toolbox". + :vartype type: str + :ivar toolbox_name: The name of the toolbox to attach. Required. + :vartype toolbox_name: str + :ivar toolbox_version: The immutable version of the toolbox to attach. Required. + :vartype toolbox_version: str + :ivar response_scheduling: When the toolbox invocation creates a follow-up response. Defaults + to ``when_idle``. Known values are: "silent", "when_idle", "interrupt", and "skip_if_busy". + :vartype response_scheduling: str or ~azure.ai.projects.models.VoiceAgentToolResponseScheduling """ - 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["toolbox"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the tool. Always ``toolbox``. Required. Default value is \"toolbox\".""" + toolbox_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the toolbox to attach. Required.""" + toolbox_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The immutable version of the toolbox to attach. Required.""" + response_scheduling: Optional[Union[str, "_models.VoiceAgentToolResponseScheduling"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """When the toolbox invocation creates a follow-up response. Defaults to ``when_idle``. Known + values are: \"silent\", \"when_idle\", \"interrupt\", and \"skip_if_busy\".""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - server_label: str, - name: str, - arguments: str, + toolbox_name: str, + toolbox_version: str, + response_scheduling: Optional[Union[str, "_models.VoiceAgentToolResponseScheduling"]] = None, ) -> None: ... @overload @@ -24845,43 +25551,56 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = "toolbox" # type: ignore -class VoiceMcpApprovalResponseItem( - RealtimeMCPApprovalResponse -): # pylint: disable=docstring-keyword-should-match-keyword-only - """An MCP approval response item (client-created). +class VoiceAgentTranscriptionPhrase(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A transcribed phrase with timing information. - :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 offset_milliseconds: The phrase offset from the beginning of the audio, in milliseconds. + Required. + :vartype offset_milliseconds: ~datetime.timedelta + :ivar duration_milliseconds: The phrase duration in milliseconds. Required. + :vartype duration_milliseconds: ~datetime.timedelta + :ivar text: The transcribed phrase text. Required. + :vartype text: str + :ivar words: Word-level timing details, when available. + :vartype words: list[~azure.ai.projects.models.VoiceAgentTranscriptionWord] + :ivar locale: The detected locale. + :vartype locale: str + :ivar confidence: The transcription confidence score. + :vartype confidence: float """ - 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.""" + offset_milliseconds: datetime.timedelta = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """The phrase offset from the beginning of the audio, in milliseconds. Required.""" + duration_milliseconds: datetime.timedelta = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """The phrase duration in milliseconds. Required.""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The transcribed phrase text. Required.""" + words: Optional[list["_models.VoiceAgentTranscriptionWord"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Word-level timing details, when available.""" + locale: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The detected locale.""" + confidence: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The transcription confidence score.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - approval_request_id: str, - approve: bool, - reason: Optional[str] = None, + offset_milliseconds: datetime.timedelta, + duration_milliseconds: datetime.timedelta, + text: str, + words: Optional[list["_models.VoiceAgentTranscriptionWord"]] = None, + locale: Optional[str] = None, + confidence: Optional[float] = None, ) -> None: ... @overload @@ -24895,47 +25614,36 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceMcpCallItem(RealtimeMCPToolCall): # pylint: disable=docstring-keyword-should-match-keyword-only - """An MCP call item. +class VoiceAgentTranscriptionWord(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A time-stamped word in an input-audio transcription. - :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 text: The transcribed word text. Required. + :vartype text: str + :ivar offset_milliseconds: The word offset from the beginning of the audio, in milliseconds. + Required. + :vartype offset_milliseconds: ~datetime.timedelta + :ivar duration_milliseconds: The word duration in milliseconds. Required. + :vartype duration_milliseconds: ~datetime.timedelta """ - 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.""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The transcribed word text. Required.""" + offset_milliseconds: datetime.timedelta = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """The word offset from the beginning of the audio, in milliseconds. Required.""" + duration_milliseconds: datetime.timedelta = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """The word duration in milliseconds. Required.""" @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, + def __init__( + self, + *, + text: str, + offset_milliseconds: datetime.timedelta, + duration_milliseconds: datetime.timedelta, ) -> None: ... @overload @@ -24949,35 +25657,81 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceMcpListToolsItem(RealtimeMCPListTools): # pylint: disable=docstring-keyword-should-match-keyword-only - """An MCP list-tools item. +class VoiceConversation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A persisted voice conversation. The Foundry envelope that owns a voice agent's stored + transcript, responses, per-turn metrics, and audio. It is the parent, retention, and delete + boundary: deleting it cascades to its responses, items, metrics, and audio. When finalization + fails, any partial persisted responses, items, and item audio remain readable. - :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. + :ivar id: The unique id of the conversation. Required. :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. + :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 response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str + :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 usage: Final aggregate token usage across all responses in this conversation. Absent + while ``status`` is ``in_progress`` and populated after successful ``completed`` finalization; + it may be absent when ``status`` is ``failed``, and values are not guaranteed to be reported + incrementally. + :vartype usage: ~azure.ai.projects.models.RealtimeResponseUsage + :ivar last_error: The terminal error that prevented persistence finalization. Present only when + ``status`` is ``failed``. + :vartype last_error: ~azure.ai.projects.models.ApiError """ - 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.""" + 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.""" + usage: Optional["_models.RealtimeResponseUsage"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Final aggregate token usage across all responses in this conversation. Absent while ``status`` + is ``in_progress`` and populated after successful ``completed`` finalization; it may be absent + when ``status`` is ``failed``, and values are not guaranteed to be reported incrementally.""" + 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``.""" @overload def __init__( self, *, - server_label: str, - tools: list["_models.MCPListToolsTool"], - id: Optional[str] = None, # pylint: disable=redefined-builtin + 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, + usage: Optional["_models.RealtimeResponseUsage"] = None, + last_error: Optional["_models.ApiError"] = None, ) -> None: ... @overload @@ -24989,27 +25743,88 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.object: Literal["voice.conversation"] = "voice.conversation" -class VoiceNoiseReduction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Input audio noise reduction configuration. +class VoiceItemAudioResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Metadata for a single conversation item's audio segment. For bring-your-own-storage (BYOS), the + response includes ``blob_uri``, a direct customer-storage URI without a SAS token, that the + customer accesses with their own credentials. For Foundry-managed storage, ``blob_uri`` is + absent and the bytes are streamed through the item's ``/audio/content`` route. - :ivar type: The noise reduction mode. Required. Known values are: "near_field", "far_field", - and "azure_deep_noise_suppression". - :vartype type: str or ~azure.ai.projects.models.VoiceNoiseReductionType + :ivar conversation_id: The id of the conversation the item belongs to. Required. + :vartype conversation_id: str + :ivar item_id: The id of the item this audio belongs to. Required. + :vartype item_id: str + :ivar role: The role the audio belongs to. Known values are: "user" and "agent". + :vartype role: str or ~azure.ai.projects.models.VoiceAudioRole + :ivar format: The container format of the audio. "wav" + :vartype format: str or ~azure.ai.projects.models.VoiceAudioContainerFormat + :ivar codec: The audio codec. Known values are: "pcm16", "pcmu", and "pcma". + :vartype codec: str or ~azure.ai.projects.models.VoiceAudioCodec + :ivar sample_rate: The sample rate in Hz. + :vartype sample_rate: int + :ivar channels: The number of audio channels. + :vartype channels: int + :ivar start_offset_ms: The offset from the session start at which this segment begins. + :vartype start_offset_ms: ~datetime.timedelta + :ivar duration_ms: The duration of the audio segment. + :vartype duration_ms: ~datetime.timedelta + :ivar blob_uri: For bring-your-own-storage (BYOS) recordings only: the URI of the recording in + the customer's own storage, without a SAS token. The customer downloads it using their own + storage credentials. Absent for Foundry-managed storage, where the bytes are streamed via the + item's ``/audio/content`` route instead. + :vartype blob_uri: str """ - type: Union[str, "_models.VoiceNoiseReductionType"] = rest_field( + conversation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The id of the conversation the item belongs to. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The id of the item this audio belongs to. Required.""" + role: Optional[Union[str, "_models.VoiceAudioRole"]] = 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 role the audio belongs to. Known values are: \"user\" and \"agent\".""" + format: Optional[Union[str, "_models.VoiceAudioContainerFormat"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The container format of the audio. \"wav\"""" + codec: Optional[Union[str, "_models.VoiceAudioCodec"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The audio codec. Known values are: \"pcm16\", \"pcmu\", and \"pcma\".""" + sample_rate: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sample rate in Hz.""" + channels: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of audio channels.""" + start_offset_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """The offset from the session start at which this segment begins.""" + duration_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """The duration of the audio segment.""" + blob_uri: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """For bring-your-own-storage (BYOS) recordings only: the URI of the recording in the customer's + own storage, without a SAS token. The customer downloads it using their own storage + credentials. Absent for Foundry-managed storage, where the bytes are streamed via the item's + ``/audio/content`` route instead.""" @overload def __init__( self, *, - type: Union[str, "_models.VoiceNoiseReductionType"], + conversation_id: str, + item_id: str, + role: Optional[Union[str, "_models.VoiceAudioRole"]] = None, + format: Optional[Union[str, "_models.VoiceAudioContainerFormat"]] = None, + codec: Optional[Union[str, "_models.VoiceAudioCodec"]] = None, + sample_rate: Optional[int] = None, + channels: Optional[int] = None, + start_offset_ms: Optional[datetime.timedelta] = None, + duration_ms: Optional[datetime.timedelta] = None, + blob_uri: Optional[str] = None, ) -> None: ... @overload @@ -25122,7 +25937,108 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceResponse(OmitPropertiesRealtimeResponse): # pylint: disable=docstring-keyword-should-match-keyword-only +class VoiceResponseBase(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties shared by persisted voice responses. + + :ivar id: The unique ID of the response, will look like ``resp_1234``. + :vartype id: str + :ivar object: The object type, must be ``realtime.response``. Default value is + "realtime.response". + :vartype object: str + :ivar status: The final status of the response (``completed``, ``cancelled``, ``failed``, or + ``incomplete``, ``in_progress``). Is one of the following types: Literal["completed"], + Literal["cancelled"], Literal["failed"], Literal["incomplete"], Literal["in_progress"] + :vartype status: str or str or str or str or str + :ivar status_details: Additional details about the status. + :vartype status_details: ~azure.ai.projects.models.RealtimeResponseStatusDetails + :ivar usage: Usage statistics for the Response, this will correspond to billing. A Realtime API + session will maintain a conversation context and append new Items to the Conversation, thus + output from previous turns (text and audio tokens) will become the input for later turns. + :vartype usage: ~azure.ai.projects.models.RealtimeResponseUsage + :ivar conversation_id: Which conversation the response is added to, determined by the + ``conversation`` field in the ``response.create`` event. If ``auto``, the response will be + added to the default conversation and the value of ``conversation_id`` will be an id like + ``conv_1234``. If ``none``, the response will not be added to any conversation and the value of + ``conversation_id`` will be ``null``. If responses are being triggered automatically by VAD the + response will be added to the default conversation. + :vartype conversation_id: str + :ivar output_modalities: The set of modalities the model used to respond, currently the only + possible values are ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text + transcript. Setting the output to mode ``text`` will disable audio output from the model. + :vartype output_modalities: list[str or str] + :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, + inclusive of tool calls, that was used in this response. Is either a int type or a + Literal["inf"] type. + :vartype max_output_tokens: int or str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the response, will look like ``resp_1234``.""" + object: Optional[Literal["realtime.response"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The object type, must be ``realtime.response``. Default value is \"realtime.response\".""" + status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The final status of the response (``completed``, ``cancelled``, ``failed``, or ``incomplete``, + ``in_progress``). Is one of the following types: Literal[\"completed\"], + Literal[\"cancelled\"], Literal[\"failed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" + status_details: Optional["_models.RealtimeResponseStatusDetails"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Additional details about the status.""" + usage: Optional["_models.RealtimeResponseUsage"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Usage statistics for the Response, this will correspond to billing. A Realtime API session will + maintain a conversation context and append new Items to the Conversation, thus output from + previous turns (text and audio tokens) will become the input for later turns.""" + conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Which conversation the response is added to, determined by the ``conversation`` field in the + ``response.create`` event. If ``auto``, the response will be added to the default conversation + and the value of ``conversation_id`` will be an id like ``conv_1234``. If ``none``, the + response will not be added to any conversation and the value of ``conversation_id`` will be + ``null``. If responses are being triggered automatically by VAD the response will be added to + the default conversation.""" + output_modalities: Optional[list[Literal["text", "audio"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The set of modalities the model used to respond, currently the only possible values are + ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text transcript. Setting the + output to mode ``text`` will disable audio output from the model.""" + max_output_tokens: Optional[Union[int, Literal["inf"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Maximum number of output tokens for a single assistant response, inclusive of tool calls, that + was used in this response. Is either a int type or a Literal[\"inf\"] type.""" + + @overload + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + object: Optional[Literal["realtime.response"]] = None, + status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] = None, + status_details: Optional["_models.RealtimeResponseStatusDetails"] = None, + usage: Optional["_models.RealtimeResponseUsage"] = None, + conversation_id: Optional[str] = None, + output_modalities: Optional[list[Literal["text", "audio"]]] = None, + max_output_tokens: Optional[Union[int, Literal["inf"]]] = 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 VoiceResponse(VoiceResponseBase): # pylint: disable=docstring-keyword-should-match-keyword-only """A persisted voice response representing one model inference turn within a conversation. In list results the ``output`` projection may be omitted; retrieve the full response (``GET .../responses/{response_id}``) or the paged response-items route (``GET @@ -25142,6 +26058,10 @@ class VoiceResponse(OmitPropertiesRealtimeResponse): # pylint: disable=docstrin session will maintain a conversation context and append new Items to the Conversation, thus output from previous turns (text and audio tokens) will become the input for later turns. :vartype usage: ~azure.ai.projects.models.RealtimeResponseUsage + :ivar output_modalities: The set of modalities the model used to respond, currently the only + possible values are ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text + transcript. Setting the output to mode ``text`` will disable audio output from the model. + :vartype output_modalities: list[str or str] :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, inclusive of tool calls, that was used in this response. Is either a int type or a Literal["inf"] type. @@ -25152,14 +26072,7 @@ class VoiceResponse(OmitPropertiesRealtimeResponse): # pylint: disable=docstrin retrieve the full response (GET .../responses/{response_id}) or use the paged response-items route (GET .../responses/{response_id}/items) for its output items. Each item's ``response_id`` also links it back to this response in the conversation-level items list. - :vartype output: list[~azure.ai.projects.models.VoiceSystemMessageItem or - ~azure.ai.projects.models.VoiceUserMessageItem or - ~azure.ai.projects.models.VoiceAssistantMessageItem or - ~azure.ai.projects.models.VoiceFunctionCallItem or - ~azure.ai.projects.models.VoiceFunctionCallOutputItem or - ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem - or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or - ~azure.ai.projects.models.VoiceMcpApprovalResponseItem] + :vartype output: list[~azure.ai.projects.models.RealtimeConversationItem] :ivar conversation_id: The id of the conversation this response belongs to. Required. :vartype conversation_id: str :ivar audio: The audio configuration used for the response, including the voice and audio @@ -25167,9 +26080,6 @@ class VoiceResponse(OmitPropertiesRealtimeResponse): # pylint: disable=docstrin :vartype audio: ~azure.ai.projects.models.VoiceResponseAudio :ivar metadata: A set of key-value pairs attached to the response. :vartype metadata: dict[str, str] - :ivar output_modalities: The output modalities used for the response, e.g. ``["text", - "audio"]``. Audio output always includes a text transcript. - :vartype output_modalities: list[str or str] :ivar temperature: The sampling temperature used for the response. :vartype temperature: float :ivar created_at: The Unix timestamp (in seconds) for when the response was created. @@ -25180,7 +26090,7 @@ class VoiceResponse(OmitPropertiesRealtimeResponse): # pylint: disable=docstrin id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) # type: ignore[reportIncompatibleVariableOverride] """The unique id of the response. Required.""" - output: Optional[list["_unions.VoiceConversationItem"]] = rest_field( + output: Optional[list["_models.RealtimeConversationItem"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The output items produced by the response. May be omitted in list results; retrieve the full @@ -25217,11 +26127,11 @@ def __init__( status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] = None, status_details: Optional["_models.RealtimeResponseStatusDetails"] = None, usage: Optional["_models.RealtimeResponseUsage"] = None, + output_modalities: Optional[list[Literal["text", "audio"]]] = None, max_output_tokens: Optional[Union[int, Literal["inf"]]] = None, - output: Optional[list["_unions.VoiceConversationItem"]] = None, + output: Optional[list["_models.RealtimeConversationItem"]] = None, audio: Optional["_models.VoiceResponseAudio"] = None, metadata: Optional[dict[str, str]] = None, - output_modalities: Optional[list[Literal["text", "audio"]]] = None, temperature: Optional[float] = None, created_at: Optional[datetime.datetime] = None, completed_at: Optional[datetime.datetime] = None, @@ -25320,280 +26230,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceServerVadTurnDetection( - VoiceTurnDetection, discriminator="server_vad" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Server-side voice activity detection. - - :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech - stops. - :vartype auto_truncate: bool - :ivar threshold: - :vartype threshold: float - :ivar prefix_padding_ms: - :vartype prefix_padding_ms: int - :ivar silence_duration_ms: - :vartype silence_duration_ms: int - :ivar create_response: - :vartype create_response: bool - :ivar interrupt_response: - :vartype interrupt_response: bool - :ivar idle_timeout_ms: - :vartype idle_timeout_ms: int - :ivar type: Required. Server-side voice activity detection. - :vartype type: str or ~azure.ai.projects.models.SERVER_VAD - :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in - milliseconds. - :vartype speech_duration_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.VoiceEndOfUtteranceDetection - """ - - threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - prefix_padding_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - silence_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - create_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - interrupt_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - idle_timeout_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - type: Literal[VoiceTurnDetectionType.SERVER_VAD] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Server-side voice activity detection.""" - 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.""" - end_of_utterance_detection: Optional["_models.VoiceEndOfUtteranceDetection"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Semantic end-of-utterance detection configuration. Set to null to disable it.""" - - @overload - def __init__( - self, - *, - auto_truncate: Optional[bool] = None, - threshold: Optional[float] = None, - prefix_padding_ms: Optional[int] = None, - silence_duration_ms: Optional[int] = None, - create_response: Optional[bool] = None, - interrupt_response: Optional[bool] = None, - idle_timeout_ms: Optional[int] = None, - speech_duration_ms: Optional[datetime.timedelta] = None, - end_of_utterance_detection: Optional["_models.VoiceEndOfUtteranceDetection"] = 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 = VoiceTurnDetectionType.SERVER_VAD # type: ignore - - -class VoiceSystemMessageItem( - RealtimeConversationItemMessageSystem -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A system message item. Only ``input_text`` content is valid for system messages. - - :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. Default value is "message". - :vartype type: str - :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 - """ - - 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, - *, - 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 - 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 VoiceSystemTool( - 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. - - :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.VoiceSystemToolName - :ivar description: An optional description of the system tool. - :vartype description: str - """ - - 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: Union[str, "_models.VoiceSystemToolName"] = rest_field( - 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, - *, - name: Union[str, "_models.VoiceSystemToolName"], - 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 = "system" # type: ignore - - -class VoiceToolboxTool( - VoiceAgentTool, discriminator="toolbox" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A reference to a Foundry toolbox, which is a versioned bundle of tools executed through its MCP - endpoint. - - :ivar type: The type of the tool. Always ``toolbox``. Required. Default value is "toolbox". - :vartype type: str - :ivar toolbox_name: The name of the toolbox to attach. Required. - :vartype toolbox_name: str - :ivar toolbox_version: The immutable version of the toolbox to attach. Required. - :vartype toolbox_version: str - :ivar response_scheduling: When the toolbox invocation creates a follow-up response. Defaults - to ``when_idle``. Known values are: "silent", "when_idle", "interrupt", and "skip_if_busy". - :vartype response_scheduling: str or ~azure.ai.projects.models.VoiceAgentToolResponseScheduling - """ - - type: Literal["toolbox"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the tool. Always ``toolbox``. Required. Default value is \"toolbox\".""" - toolbox_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the toolbox to attach. Required.""" - toolbox_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The immutable version of the toolbox to attach. Required.""" - response_scheduling: Optional[Union[str, "_models.VoiceAgentToolResponseScheduling"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """When the toolbox invocation creates a follow-up response. Defaults to ``when_idle``. Known - values are: \"silent\", \"when_idle\", \"interrupt\", and \"skip_if_busy\".""" - - @overload - def __init__( - self, - *, - toolbox_name: str, - toolbox_version: str, - response_scheduling: Optional[Union[str, "_models.VoiceAgentToolResponseScheduling"]] = 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 = "toolbox" # type: ignore - - -class VoiceUserMessageItem( - RealtimeConversationItemMessageUser -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A user message item. ``input_text``, ``input_audio``, and ``input_image`` content are valid for - user messages. - - :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. Default value is "message". - :vartype type: str - :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 - """ - - 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, - *, - 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 - 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 WebIQPreviewTool( Tool, discriminator="web_iq_preview" ): # pylint: disable=docstring-keyword-should-match-keyword-only 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 e3e3fc5acca6..29c2e4b003b6 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 @@ -65,6 +65,7 @@ "evaluation_taxonomies": _FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW.value, "evaluators": _FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW.value, "insights": _FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW.value, + "agent_insight_monitors": _FoundryFeaturesOptInKeys.AGENT_INSIGHTS_V1_PREVIEW.value, "memory_stores": _FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW.value, "models": _FoundryFeaturesOptInKeys.MODELS_V1_PREVIEW.value, "red_teams": _FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW.value, @@ -73,6 +74,10 @@ "skills": _FoundryFeaturesOptInKeys.SKILLS_V1_PREVIEW.value, "datasets": _FoundryFeaturesOptInKeys.DATA_GENERATION_JOBS_V1_PREVIEW.value, "agents": _AGENT_OPERATION_FEATURE_HEADERS, + # agent_endpoint_conversations moved from a top-level client attribute to a nested `.beta` + # sub-client upstream; it always requires the VoiceAgents=V1Preview opt-in (voice-agent + # conversation reads), matching the same requirement voice-agent definition operations have. + "agent_endpoint_conversations": _AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.value, } """Foundry-Features header values keyed by beta sub-client property name.""" diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/__init__.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/__init__.py index fb5ec672ba20..d6cf67b4d8cf 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/__init__.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/__init__.py @@ -14,8 +14,6 @@ from ._operations import BetaOperations # type: ignore from ._operations import AgentsOperations # type: ignore -from ._operations import VoiceAgentWebSocketOperations # type: ignore -from ._operations import AgentEndpointConversationsOperations # type: ignore from ._operations import EvaluationRulesOperations # type: ignore from ._operations import ConnectionsOperations # type: ignore from ._operations import DatasetsOperations # type: ignore @@ -30,8 +28,6 @@ __all__ = [ "BetaOperations", "AgentsOperations", - "VoiceAgentWebSocketOperations", - "AgentEndpointConversationsOperations", "EvaluationRulesOperations", "ConnectionsOperations", "DatasetsOperations", 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 9d59bcade406..3b8cf9330b4e 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 @@ -590,8 +590,8 @@ def build_agents_get_session_log_stream_request( # pylint: disable=name-too-lon return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_agents_upload_session_file_request( - agent_name: str, session_id: str, *, path: str, **kwargs: Any +def build_agents_publish_to_microsoft365_request( # pylint: disable=name-too-long + agent_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -601,16 +601,14 @@ def build_agents_upload_session_file_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/endpoint/sessions/{agent_session_id}/files/content" + _url = "/agents/{agent_name}/microsoft365/publish" path_format_arguments = { "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "agent_session_id": _SERIALIZER.url("session_id", session_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - _params["path"] = _SERIALIZER.query("path", path, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers @@ -618,47 +616,40 @@ def build_agents_upload_session_file_request( _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_agents_download_session_file_request( # pylint: disable=name-too-long - agent_name: str, session_id: str, *, path: str, **kwargs: Any +def build_agents_get_microsoft365_package_request( # pylint: disable=name-too-long + agent_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/octet-stream") + accept = _headers.pop("Accept", "application/zip") # Construct URL - _url = "/agents/{agent_name}/endpoint/sessions/{agent_session_id}/files/content" + _url = "/agents/{agent_name}/microsoft365/zip" path_format_arguments = { "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "agent_session_id": _SERIALIZER.url("session_id", session_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - _params["path"] = _SERIALIZER.query("path", path, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_agents_list_session_files_request( - agent_name: str, - session_id: str, - *, - path: Optional[str] = None, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - after: Optional[str] = None, - before: Optional[str] = None, - **kwargs: Any +def build_agents_get_microsoft365_publish_defaults_request( # pylint: disable=name-too-long + agent_name: str, *, publish_as_digital_worker: Optional[bool] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -667,25 +658,18 @@ def build_agents_list_session_files_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/endpoint/sessions/{agent_session_id}/files" + _url = "/agents/{agent_name}/microsoft365/publishdefaults" path_format_arguments = { "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "agent_session_id": _SERIALIZER.url("session_id", session_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - if path is not None: - _params["path"] = _SERIALIZER.query("path", path, "str") - 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") + if publish_as_digital_worker is not None: + _params["publishAsDigitalWorker"] = _SERIALIZER.query( + "publish_as_digital_worker", publish_as_digital_worker, "bool" + ) _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers @@ -694,14 +678,18 @@ def build_agents_list_session_files_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_agents_delete_session_file_request( - agent_name: str, session_id: str, *, path: str, recursive: Optional[bool] = None, **kwargs: Any +def build_agents_upload_session_file_request( + agent_name: str, session_id: str, *, path: str, **kwargs: Any ) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) 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/sessions/{agent_session_id}/files" + _url = "/agents/{agent_name}/endpoint/sessions/{agent_session_id}/files/content" path_format_arguments = { "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), "agent_session_id": _SERIALIZER.url("session_id", session_id, "str"), @@ -711,59 +699,49 @@ def build_agents_delete_session_file_request( # Construct parameters _params["path"] = _SERIALIZER.query("path", path, "str") - if recursive is not None: - _params["recursive"] = _SERIALIZER.query("recursive", recursive, "bool") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_voice_agent_web_socket_connect_voice_agent_request( # pylint: disable=name-too-long - agent_name: str, - *, - foundry_features_query: Optional[Literal[_AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW]] = None, - agent_session_id: Optional[str] = None, - store: Optional[bool] = None, - agent_version_override: Optional[str] = None, - websocket_subprotocol: Optional[Union[str, _models.VoiceAgentWebSocketSubprotocol]] = None, - structured_inputs: Optional[str] = None, - **kwargs: Any + +def build_agents_download_session_file_request( # pylint: disable=name-too-long + agent_name: str, session_id: str, *, path: 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/octet-stream") + # Construct URL - _url = "/agents/{agent_name}/endpoint/protocols/voice" + _url = "/agents/{agent_name}/endpoint/sessions/{agent_session_id}/files/content" path_format_arguments = { "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "agent_session_id": _SERIALIZER.url("session_id", session_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - if foundry_features_query is not None: - _params["foundry_features"] = _SERIALIZER.query("foundry_features_query", foundry_features_query, "str") - if agent_session_id is not None: - _params["agent_session_id"] = _SERIALIZER.query("agent_session_id", agent_session_id, "str") - if store is not None: - _params["store"] = _SERIALIZER.query("store", store, "bool") - if agent_version_override is not None: - _params["x-agent-version-override"] = _SERIALIZER.query("agent_version_override", agent_version_override, "str") + _params["path"] = _SERIALIZER.query("path", path, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if websocket_subprotocol is not None: - _headers["Sec-WebSocket-Protocol"] = _SERIALIZER.header("websocket_subprotocol", websocket_subprotocol, "str") - if structured_inputs is not None: - _headers["x-ms-voice-structured-inputs"] = _SERIALIZER.header("structured_inputs", structured_inputs, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_agent_endpoint_conversations_list_agent_conversations_request( # pylint: disable=name-too-long +def build_agents_list_session_files_request( agent_name: str, + session_id: str, *, + path: Optional[str] = None, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, after: Optional[str] = None, @@ -777,14 +755,17 @@ def build_agent_endpoint_conversations_list_agent_conversations_request( # pyli accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations" + _url = "/agents/{agent_name}/endpoint/sessions/{agent_session_id}/files" path_format_arguments = { "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "agent_session_id": _SERIALIZER.url("session_id", session_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + if path is not None: + _params["path"] = _SERIALIZER.query("path", path, "str") if limit is not None: _params["limit"] = _SERIALIZER.query("limit", limit, "int") if order is not None: @@ -801,9 +782,31 @@ def build_agent_endpoint_conversations_list_agent_conversations_request( # pyli return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_agent_endpoint_conversations_get_agent_conversation_request( # pylint: disable=name-too-long - agent_name: str, conversation_id: str, **kwargs: Any +def build_agents_delete_session_file_request( + agent_name: str, session_id: str, *, path: str, recursive: Optional[bool] = None, **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/sessions/{agent_session_id}/files" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "agent_session_id": _SERIALIZER.url("session_id", session_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["path"] = _SERIALIZER.query("path", path, "str") + if recursive is not None: + _params["recursive"] = _SERIALIZER.query("recursive", recursive, "bool") + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_evaluation_rules_get_request(id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -811,10 +814,9 @@ def build_agent_endpoint_conversations_get_agent_conversation_request( # pylint accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}" + _url = "/evaluationrules/{id}" path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + "id": _SERIALIZER.url("id", id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -828,17 +830,14 @@ def build_agent_endpoint_conversations_get_agent_conversation_request( # pylint return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_agent_endpoint_conversations_delete_agent_conversation_request( # pylint: disable=name-too-long - agent_name: str, conversation_id: str, **kwargs: Any -) -> HttpRequest: +def build_evaluation_rules_delete_request(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/conversations/{conversation_id}" + _url = "/evaluationrules/{id}" path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + "id": _SERIALIZER.url("id", id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -849,50 +848,41 @@ def build_agent_endpoint_conversations_delete_agent_conversation_request( # pyl return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_agent_endpoint_conversations_list_agent_conversation_responses_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 +def build_evaluation_rules_create_or_update_request( # pylint: disable=name-too-long + id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) 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/conversations/{conversation_id}/responses" + _url = "/evaluationrules/{id}" path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + "id": _SERIALIZER.url("id", 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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_agent_endpoint_conversations_get_agent_conversation_response_request( # pylint: disable=name-too-long - agent_name: str, conversation_id: str, response_id: str, **kwargs: Any +def build_evaluation_rules_list_request( + *, + action_type: Optional[Union[str, _models.EvaluationRuleActionType]] = None, + agent_name: Optional[str] = None, + enabled: Optional[bool] = None, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -901,17 +891,16 @@ def build_agent_endpoint_conversations_get_agent_conversation_response_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/responses/{response_id}" - path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), - "response_id": _SERIALIZER.url("response_id", response_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore + _url = "/evaluationrules" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if action_type is not None: + _params["actionType"] = _SERIALIZER.query("action_type", action_type, "str") + if agent_name is not None: + _params["agentName"] = _SERIALIZER.query("agent_name", agent_name, "str") + if enabled is not None: + _params["enabled"] = _SERIALIZER.query("enabled", enabled, "bool") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -919,17 +908,7 @@ def build_agent_endpoint_conversations_get_agent_conversation_response_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_agent_endpoint_conversations_list_agent_conversation_response_items_request( # pylint: disable=name-too-long - agent_name: str, - conversation_id: str, - response_id: str, - *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - after: Optional[str] = None, - before: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: +def build_connections_get_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -937,24 +916,14 @@ def build_agent_endpoint_conversations_list_agent_conversation_response_items_re accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/responses/{response_id}/items" + _url = "/connections/{name}" path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), - "response_id": _SERIALIZER.url("response_id", response_id, "str"), + "name": _SERIALIZER.url("name", 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 @@ -963,15 +932,8 @@ def build_agent_endpoint_conversations_list_agent_conversation_response_items_re return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_agent_endpoint_conversations_list_agent_conversation_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 +def build_connections_get_with_credentials_request( # pylint: disable=name-too-long + name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -980,33 +942,27 @@ def build_agent_endpoint_conversations_list_agent_conversation_items_request( # accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/items" + _url = "/connections/{name}/getConnectionWithCredentials" path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + "name": _SERIALIZER.url("name", 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) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_agent_endpoint_conversations_get_agent_conversation_item_request( # pylint: disable=name-too-long - agent_name: str, conversation_id: str, item_id: str, **kwargs: Any +def build_connections_list_request( + *, + connection_type: Optional[Union[str, _models.ConnectionType]] = None, + default_connection: Optional[bool] = None, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1015,17 +971,14 @@ def build_agent_endpoint_conversations_get_agent_conversation_item_request( # p accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/endpoint/protocols/voice/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 + _url = "/connections" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if connection_type is not None: + _params["connectionType"] = _SERIALIZER.query("connection_type", connection_type, "str") + if default_connection is not None: + _params["defaultConnection"] = _SERIALIZER.query("default_connection", default_connection, "bool") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1033,9 +986,7 @@ def build_agent_endpoint_conversations_get_agent_conversation_item_request( # p return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_agent_endpoint_conversations_get_agent_conversation_item_audio_request( # pylint: disable=name-too-long - agent_name: str, conversation_id: str, item_id: str, **kwargs: Any -) -> HttpRequest: +def build_datasets_list_versions_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1043,11 +994,9 @@ def build_agent_endpoint_conversations_get_agent_conversation_item_audio_request accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/items/{item_id}/audio" + _url = "/datasets/{name}/versions" 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"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1061,24 +1010,15 @@ def build_agent_endpoint_conversations_get_agent_conversation_item_audio_request return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_agent_endpoint_conversations_get_agent_conversation_item_audio_content_request( # pylint: disable=name-too-long - agent_name: str, conversation_id: str, item_id: str, **kwargs: Any -) -> HttpRequest: +def build_datasets_list_request(**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") + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/endpoint/protocols/voice/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 + _url = "/datasets" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1089,9 +1029,7 @@ def build_agent_endpoint_conversations_get_agent_conversation_item_audio_content return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_agent_endpoint_conversations_get_agent_conversation_audio_request( # pylint: disable=name-too-long - agent_name: str, conversation_id: str, **kwargs: Any -) -> HttpRequest: +def build_datasets_get_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1099,10 +1037,10 @@ def build_agent_endpoint_conversations_get_agent_conversation_audio_request( # accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/audio" + _url = "/datasets/{name}/versions/{version}" path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1116,20 +1054,15 @@ def build_agent_endpoint_conversations_get_agent_conversation_audio_request( # return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_agent_endpoint_conversations_get_agent_conversation_audio_content_request( # pylint: disable=name-too-long - agent_name: str, conversation_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) +def build_datasets_delete_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _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/conversations/{conversation_id}/audio/content" + _url = "/datasets/{name}/versions/{version}" path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1137,23 +1070,22 @@ def build_agent_endpoint_conversations_get_agent_conversation_audio_content_requ # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_evaluation_rules_get_request(id: str, **kwargs: Any) -> HttpRequest: +def build_datasets_create_or_update_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluationrules/{id}" + _url = "/datasets/{name}/versions/{version}" path_format_arguments = { - "id": _SERIALIZER.url("id", id, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1162,32 +1094,14 @@ def build_evaluation_rules_get_request(id: str, **kwargs: Any) -> HttpRequest: _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_evaluation_rules_delete_request(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 = "/evaluationrules/{id}" - path_format_arguments = { - "id": _SERIALIZER.url("id", 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) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_evaluation_rules_create_or_update_request( # pylint: disable=name-too-long - id: str, **kwargs: Any -) -> HttpRequest: +def build_datasets_pending_upload_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1196,9 +1110,10 @@ def build_evaluation_rules_create_or_update_request( # pylint: disable=name-too accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluationrules/{id}" + _url = "/datasets/{name}/versions/{version}/startPendingUpload" path_format_arguments = { - "id": _SERIALIZER.url("id", id, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1211,41 +1126,10 @@ def build_evaluation_rules_create_or_update_request( # pylint: disable=name-too _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_evaluation_rules_list_request( - *, - action_type: Optional[Union[str, _models.EvaluationRuleActionType]] = None, - agent_name: Optional[str] = None, - enabled: Optional[bool] = 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 = "/evaluationrules" - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if action_type is not None: - _params["actionType"] = _SERIALIZER.query("action_type", action_type, "str") - if agent_name is not None: - _params["agentName"] = _SERIALIZER.query("agent_name", agent_name, "str") - if enabled is not None: - _params["enabled"] = _SERIALIZER.query("enabled", enabled, "bool") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_connections_get_request(name: str, **kwargs: Any) -> HttpRequest: +def build_datasets_get_credentials_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1253,9 +1137,10 @@ def build_connections_get_request(name: str, **kwargs: Any) -> HttpRequest: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/connections/{name}" + _url = "/datasets/{name}/versions/{version}/credentials" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1266,12 +1151,10 @@ def build_connections_get_request(name: str, **kwargs: Any) -> HttpRequest: # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_connections_get_with_credentials_request( # pylint: disable=name-too-long - name: str, **kwargs: Any -) -> HttpRequest: +def build_deployments_get_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1279,7 +1162,7 @@ def build_connections_get_with_credentials_request( # pylint: disable=name-too- accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/connections/{name}/getConnectionWithCredentials" + _url = "/deployments/{name}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), } @@ -1292,13 +1175,14 @@ def build_connections_get_with_credentials_request( # pylint: disable=name-too- # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_connections_list_request( +def build_deployments_list_request( *, - connection_type: Optional[Union[str, _models.ConnectionType]] = None, - default_connection: Optional[bool] = None, + model_publisher: Optional[str] = None, + model_name: Optional[str] = None, + deployment_type: Optional[Union[str, _models.DeploymentType]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1308,14 +1192,16 @@ def build_connections_list_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/connections" + _url = "/deployments" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if connection_type is not None: - _params["connectionType"] = _SERIALIZER.query("connection_type", connection_type, "str") - if default_connection is not None: - _params["defaultConnection"] = _SERIALIZER.query("default_connection", default_connection, "bool") + if model_publisher is not None: + _params["modelPublisher"] = _SERIALIZER.query("model_publisher", model_publisher, "str") + if model_name is not None: + _params["modelName"] = _SERIALIZER.query("model_name", model_name, "str") + if deployment_type is not None: + _params["deploymentType"] = _SERIALIZER.query("deployment_type", deployment_type, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1323,7 +1209,7 @@ def build_connections_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_datasets_list_versions_request(name: str, **kwargs: Any) -> HttpRequest: +def build_indexes_list_versions_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1331,7 +1217,7 @@ def build_datasets_list_versions_request(name: str, **kwargs: Any) -> HttpReques accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/datasets/{name}/versions" + _url = "/indexes/{name}/versions" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), } @@ -1347,7 +1233,7 @@ def build_datasets_list_versions_request(name: str, **kwargs: Any) -> HttpReques return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_datasets_list_request(**kwargs: Any) -> HttpRequest: +def build_indexes_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1355,7 +1241,7 @@ def build_datasets_list_request(**kwargs: Any) -> HttpRequest: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/datasets" + _url = "/indexes" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1366,7 +1252,7 @@ def build_datasets_list_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_datasets_get_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_indexes_get_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1374,7 +1260,7 @@ def build_datasets_get_request(name: str, version: str, **kwargs: Any) -> HttpRe accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/datasets/{name}/versions/{version}" + _url = "/indexes/{name}/versions/{version}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), "version": _SERIALIZER.url("version", version, "str"), @@ -1391,12 +1277,12 @@ def build_datasets_get_request(name: str, version: str, **kwargs: Any) -> HttpRe return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_datasets_delete_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_indexes_delete_request(name: str, version: 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 = "/datasets/{name}/versions/{version}" + _url = "/indexes/{name}/versions/{version}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), "version": _SERIALIZER.url("version", version, "str"), @@ -1410,7 +1296,7 @@ def build_datasets_delete_request(name: str, version: str, **kwargs: Any) -> Htt return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_datasets_create_or_update_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_indexes_create_or_update_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1419,7 +1305,7 @@ def build_datasets_create_or_update_request(name: str, version: str, **kwargs: A accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/datasets/{name}/versions/{version}" + _url = "/indexes/{name}/versions/{version}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), "version": _SERIALIZER.url("version", version, "str"), @@ -1438,7 +1324,7 @@ def build_datasets_create_or_update_request(name: str, version: str, **kwargs: A return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_datasets_pending_upload_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_toolboxes_create_version_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1447,10 +1333,9 @@ def build_datasets_pending_upload_request(name: str, version: str, **kwargs: Any accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/datasets/{name}/versions/{version}/startPendingUpload" + _url = "/toolboxes/{name}/versions" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1466,7 +1351,7 @@ def build_datasets_pending_upload_request(name: str, version: str, **kwargs: Any return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_datasets_get_credentials_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_toolboxes_get_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1474,10 +1359,9 @@ def build_datasets_get_credentials_request(name: str, version: str, **kwargs: An accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/datasets/{name}/versions/{version}/credentials" + _url = "/toolboxes/{name}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1488,10 +1372,17 @@ def build_datasets_get_credentials_request(name: str, version: str, **kwargs: An # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_deployments_get_request(name: str, **kwargs: Any) -> HttpRequest: +def build_toolboxes_list_request( + *, + 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 {}) @@ -1499,14 +1390,17 @@ def build_deployments_get_request(name: str, **kwargs: Any) -> HttpRequest: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/deployments/{name}" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore + _url = "/toolboxes" # 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 @@ -1515,11 +1409,13 @@ def build_deployments_get_request(name: str, **kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_deployments_list_request( +def build_toolboxes_list_versions_request( + name: str, *, - model_publisher: Optional[str] = None, - model_name: Optional[str] = None, - deployment_type: Optional[Union[str, _models.DeploymentType]] = None, + 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 {}) @@ -1529,16 +1425,23 @@ def build_deployments_list_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/deployments" + _url = "/toolboxes/{name}/versions" + path_format_arguments = { + "name": _SERIALIZER.url("name", 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") - if model_publisher is not None: - _params["modelPublisher"] = _SERIALIZER.query("model_publisher", model_publisher, "str") - if model_name is not None: - _params["modelName"] = _SERIALIZER.query("model_name", model_name, "str") - if deployment_type is not None: - _params["deploymentType"] = _SERIALIZER.query("deployment_type", deployment_type, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1546,7 +1449,7 @@ def build_deployments_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_indexes_list_versions_request(name: str, **kwargs: Any) -> HttpRequest: +def build_toolboxes_get_version_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1554,9 +1457,10 @@ def build_indexes_list_versions_request(name: str, **kwargs: Any) -> HttpRequest accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/indexes/{name}/versions" + _url = "/toolboxes/{name}/versions/{version}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1570,37 +1474,41 @@ def build_indexes_list_versions_request(name: str, **kwargs: Any) -> HttpRequest return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_indexes_list_request(**kwargs: Any) -> HttpRequest: +def build_toolboxes_update_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/indexes" + _url = "/toolboxes/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_indexes_get_request(name: str, version: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) +def build_toolboxes_delete_request(name: str, **kwargs: Any) -> HttpRequest: _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 = "/indexes/{name}/versions/{version}" + _url = "/toolboxes/{name}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1608,18 +1516,15 @@ def build_indexes_get_request(name: str, version: str, **kwargs: Any) -> HttpReq # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_indexes_delete_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_toolboxes_delete_version_request(name: str, version: 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 = "/indexes/{name}/versions/{version}" + _url = "/toolboxes/{name}/versions/{version}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), "version": _SERIALIZER.url("version", version, "str"), @@ -1633,62 +1538,86 @@ def build_indexes_delete_request(name: str, version: str, **kwargs: Any) -> Http return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_indexes_create_or_update_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_beta_voice_agent_web_socket_connect_voice_agent_request( # pylint: disable=name-too-long + agent_name: str, + *, + foundry_features_query: Optional[Literal[_AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW]] = None, + store: Optional[bool] = None, + agent_version_override: Optional[str] = None, + websocket_subprotocol: Optional[Union[str, _models.VoiceAgentWebSocketSubprotocol]] = None, + **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") - # Construct URL - _url = "/indexes/{name}/versions/{version}" + _url = "/agents/{agent_name}/endpoint/protocols/voice" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + if foundry_features_query is not None: + _params["foundry_features"] = _SERIALIZER.query("foundry_features_query", foundry_features_query, "str") + if store is not None: + _params["store"] = _SERIALIZER.query("store", store, "bool") + if agent_version_override is not None: + _params["x-agent-version-override"] = _SERIALIZER.query("agent_version_override", agent_version_override, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if websocket_subprotocol is not None: + _headers["Sec-WebSocket-Protocol"] = _SERIALIZER.header("websocket_subprotocol", websocket_subprotocol, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_create_version_request(name: str, **kwargs: Any) -> HttpRequest: +def build_beta_agent_endpoint_conversations_list_agent_conversations_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 {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/toolboxes/{name}/versions" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "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 - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_get_request(name: str, **kwargs: Any) -> HttpRequest: +def build_beta_agent_endpoint_conversations_get_agent_conversation_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 {}) @@ -1696,9 +1625,10 @@ def build_toolboxes_get_request(name: str, **kwargs: Any) -> HttpRequest: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/toolboxes/{name}" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "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 @@ -1712,7 +1642,30 @@ def build_toolboxes_get_request(name: str, **kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_list_request( +def build_beta_agent_endpoint_conversations_delete_agent_conversation_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/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_agent_endpoint_conversations_list_agent_conversation_responses_request( # pylint: disable=name-too-long + agent_name: str, + conversation_id: str, *, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, @@ -1727,7 +1680,13 @@ def build_toolboxes_list_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/toolboxes" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/responses" + 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: @@ -1746,8 +1705,38 @@ def build_toolboxes_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_list_versions_request( - name: str, +def build_beta_agent_endpoint_conversations_get_agent_conversation_response_request( # pylint: disable=name-too-long + agent_name: str, conversation_id: str, response_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/conversations/{conversation_id}/responses/{response_id}" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + "response_id": _SERIALIZER.url("response_id", response_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_agent_endpoint_conversations_list_agent_conversation_response_items_request( # pylint: disable=name-too-long + agent_name: str, + conversation_id: str, + response_id: str, *, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, @@ -1762,9 +1751,11 @@ def build_toolboxes_list_versions_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/toolboxes/{name}/versions" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/responses/{response_id}/items" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + "response_id": _SERIALIZER.url("response_id", response_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1786,7 +1777,16 @@ def build_toolboxes_list_versions_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_get_version_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_beta_agent_endpoint_conversations_list_agent_conversation_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 {}) @@ -1794,15 +1794,23 @@ def build_toolboxes_get_version_request(name: str, version: str, **kwargs: Any) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/toolboxes/{name}/versions/{version}" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/items" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "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 @@ -1811,18 +1819,21 @@ def build_toolboxes_get_version_request(name: str, version: str, **kwargs: Any) return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_update_request(name: str, **kwargs: Any) -> HttpRequest: +def build_beta_agent_endpoint_conversations_get_agent_conversation_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 {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/toolboxes/{name}" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/items/{item_id}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "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 @@ -1831,21 +1842,26 @@ def build_toolboxes_update_request(name: str, **kwargs: Any) -> HttpRequest: _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_delete_request(name: str, **kwargs: Any) -> HttpRequest: +def build_beta_agent_endpoint_conversations_get_agent_conversation_item_audio_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 = "/toolboxes/{name}" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/items/{item_id}/audio" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "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 @@ -1853,18 +1869,27 @@ def build_toolboxes_delete_request(name: str, **kwargs: Any) -> HttpRequest: # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_delete_version_request(name: str, version: str, **kwargs: Any) -> HttpRequest: + +def build_beta_agent_endpoint_conversations_get_agent_conversation_item_audio_content_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 = "/toolboxes/{name}/versions/{version}" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/items/{item_id}/audio/content" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "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 @@ -1872,11 +1897,14 @@ def build_toolboxes_delete_version_request(name: str, version: str, **kwargs: An # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluation_taxonomies_get_request( # pylint: disable=name-too-long - name: str, **kwargs: Any + +def build_beta_agent_endpoint_conversations_get_agent_conversation_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 {}) @@ -1885,9 +1913,10 @@ def build_beta_evaluation_taxonomies_get_request( # pylint: disable=name-too-lo accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluationtaxonomies/{name}" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/audio" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "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 @@ -1901,24 +1930,26 @@ def build_beta_evaluation_taxonomies_get_request( # pylint: disable=name-too-lo return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluation_taxonomies_list_request( # pylint: disable=name-too-long - *, input_name: Optional[str] = None, input_type: Optional[str] = None, **kwargs: Any +def build_beta_agent_endpoint_conversations_get_agent_conversation_audio_content_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") + accept = _headers.pop("Accept", "audio/wav") # Construct URL - _url = "/evaluationtaxonomies" + _url = "/agents/{agent_name}/endpoint/protocols/voice/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") - if input_name is not None: - _params["inputName"] = _SERIALIZER.query("input_name", input_name, "str") - if input_type is not None: - _params["inputType"] = _SERIALIZER.query("input_type", input_type, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1926,58 +1957,44 @@ def build_beta_evaluation_taxonomies_list_request( # pylint: disable=name-too-l return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluation_taxonomies_delete_request( # pylint: disable=name-too-long - name: 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 = "/evaluationtaxonomies/{name}" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "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_evaluation_taxonomies_create_request( # pylint: disable=name-too-long - name: str, **kwargs: Any +def build_beta_agent_insight_monitors_list_request( # pylint: disable=name-too-long + *, + after: Optional[str] = None, + before: Optional[str] = None, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + agent_name: Optional[str] = None, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluationtaxonomies/{name}" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore + _url = "/agent_insight_monitors" # Construct parameters + if after is not None: + _params["after"] = _SERIALIZER.query("after", after, "str") + if before is not None: + _params["before"] = _SERIALIZER.query("before", before, "str") + 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 agent_name is not None: + _params["agent_name"] = _SERIALIZER.query("agent_name", agent_name, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluation_taxonomies_update_request( # pylint: disable=name-too-long - name: str, **kwargs: Any -) -> HttpRequest: +def build_beta_agent_insight_monitors_create_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1986,12 +2003,7 @@ def build_beta_evaluation_taxonomies_update_request( # pylint: disable=name-too accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluationtaxonomies/{name}" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore + _url = "/agent_insight_monitors" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2001,15 +2013,11 @@ def build_beta_evaluation_taxonomies_update_request( # pylint: disable=name-too _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_list_versions_request( # pylint: disable=name-too-long - name: str, - *, - type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, - limit: Optional[int] = None, - **kwargs: Any +def build_beta_agent_insight_monitors_get_request( # pylint: disable=name-too-long + monitor_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2018,19 +2026,15 @@ def build_beta_evaluators_list_versions_request( # pylint: disable=name-too-lon accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluators/{name}/versions" + _url = "/agent_insight_monitors/{monitor_id}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if type is not None: - _params["type"] = _SERIALIZER.query("type", type, "str") - if limit is not None: - _params["limit"] = _SERIALIZER.query("limit", limit, "int") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2038,48 +2042,40 @@ def build_beta_evaluators_list_versions_request( # pylint: disable=name-too-lon return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_list_request( - *, - type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, - limit: Optional[int] = None, - **kwargs: Any +def build_beta_agent_insight_monitors_delete_request( # pylint: disable=name-too-long + monitor_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 = "/evaluators" + _url = "/agent_insight_monitors/{monitor_id}" + path_format_arguments = { + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if type is not None: - _params["type"] = _SERIALIZER.query("type", type, "str") - if limit is not None: - _params["limit"] = _SERIALIZER.query("limit", limit, "int") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_beta_evaluators_get_version_request( # pylint: disable=name-too-long - name: str, version: str, **kwargs: Any +def build_beta_agent_insight_monitors_update_request( # pylint: disable=name-too-long + monitor_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluators/{name}/versions/{version}" + _url = "/agent_insight_monitors/{monitor_id}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2088,22 +2084,23 @@ def build_beta_evaluators_get_version_request( # pylint: disable=name-too-long _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_delete_version_request( # pylint: disable=name-too-long - name: str, version: str, **kwargs: Any +def build_beta_agent_insight_monitors_reset_request( # pylint: disable=name-too-long + monitor_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 = "/evaluators/{name}/versions/{version}" + _url = "/agent_insight_monitors/{monitor_id}:reset" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2111,11 +2108,11 @@ def build_beta_evaluators_delete_version_request( # pylint: disable=name-too-lo # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) -def build_beta_evaluators_create_version_request( # pylint: disable=name-too-long - name: str, **kwargs: Any +def build_beta_agent_insight_monitors_create_run_request( # pylint: disable=name-too-long + monitor_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2125,9 +2122,9 @@ def build_beta_evaluators_create_version_request( # pylint: disable=name-too-lo accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluators/{name}/versions" + _url = "/agent_insight_monitors/{monitor_id}/runs" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2143,51 +2140,66 @@ def build_beta_evaluators_create_version_request( # pylint: disable=name-too-lo return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_update_version_request( # pylint: disable=name-too-long - name: str, version: str, **kwargs: Any +def build_beta_agent_insight_monitors_list_runs_request( # pylint: disable=name-too-long + monitor_id: str, + *, + after: Optional[str] = None, + before: Optional[str] = None, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + status: Optional[Union[str, _models.JobStatus]] = None, + trigger: Optional[Union[str, _models.AgentInsightRunTrigger]] = None, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluators/{name}/versions/{version}" + _url = "/agent_insight_monitors/{monitor_id}/runs" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + if after is not None: + _params["after"] = _SERIALIZER.query("after", after, "str") + if before is not None: + _params["before"] = _SERIALIZER.query("before", before, "str") + 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 status is not None: + _params["status"] = _SERIALIZER.query("status", status, "str") + if trigger is not None: + _params["trigger"] = _SERIALIZER.query("trigger", trigger, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_pending_upload_request( # pylint: disable=name-too-long - name: str, version: str, **kwargs: Any +def build_beta_agent_insight_monitors_get_run_request( # pylint: disable=name-too-long + monitor_id: str, run_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluators/{name}/versions/{version}/startPendingUpload" + _url = "/agent_insight_monitors/{monitor_id}/runs/{run_id}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), + "run_id": _SERIALIZER.url("run_id", run_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2196,28 +2208,25 @@ def build_beta_evaluators_pending_upload_request( # pylint: disable=name-too-lo _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_get_credentials_request( # pylint: disable=name-too-long - name: str, version: str, **kwargs: Any +def build_beta_agent_insight_monitors_cancel_run_request( # pylint: disable=name-too-long + monitor_id: str, run_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluators/{name}/versions/{version}/credentials" + _url = "/agent_insight_monitors/{monitor_id}/runs/{run_id}:cancel" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), + "run_id": _SERIALIZER.url("run_id", run_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2226,41 +2235,65 @@ def build_beta_evaluators_get_credentials_request( # pylint: disable=name-too-l _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_create_generation_job_request( # pylint: disable=name-too-long - *, operation_id: Optional[str] = None, **kwargs: Any +def build_beta_agent_insight_monitors_list_insights_request( # pylint: disable=name-too-long + monitor_id: str, + *, + after: Optional[str] = None, + before: Optional[str] = None, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + category: Optional[str] = None, + severity: Optional[Union[str, _models.AgentInsightSeverity]] = None, + status: Optional[Union[str, _models.AgentInsightStatus]] = None, + include_details: Optional[bool] = None, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluator_generation_jobs" + _url = "/agent_insight_monitors/{monitor_id}/insights" + path_format_arguments = { + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + if after is not None: + _params["after"] = _SERIALIZER.query("after", after, "str") + if before is not None: + _params["before"] = _SERIALIZER.query("before", before, "str") + 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 category is not None: + _params["category"] = _SERIALIZER.query("category", category, "str") + if severity is not None: + _params["severity"] = _SERIALIZER.query("severity", severity, "str") + if status is not None: + _params["status"] = _SERIALIZER.query("status", status, "str") + if include_details is not None: + _params["include_details"] = _SERIALIZER.query("include_details", include_details, "bool") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if operation_id is not None: - _headers["Operation-Id"] = _SERIALIZER.header("operation_id", operation_id, "str") - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_get_generation_job_request( # pylint: disable=name-too-long - job_id: str, **kwargs: Any +def build_beta_agent_insight_monitors_get_insight_request( # pylint: disable=name-too-long + monitor_id: str, insight_id: str, *, include_details: Optional[bool] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2269,14 +2302,17 @@ def build_beta_evaluators_get_generation_job_request( # pylint: disable=name-to accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluator_generation_jobs/{jobId}" + _url = "/agent_insight_monitors/{monitor_id}/insights/{insight_id}" path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), + "insight_id": _SERIALIZER.url("insight_id", insight_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + if include_details is not None: + _params["include_details"] = _SERIALIZER.query("include_details", include_details, "bool") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers @@ -2285,42 +2321,38 @@ def build_beta_evaluators_get_generation_job_request( # pylint: disable=name-to return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_list_generation_jobs_request( # pylint: disable=name-too-long - *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - after: Optional[str] = None, - before: Optional[str] = None, - **kwargs: Any +def build_beta_agent_insight_monitors_update_insight_request( # pylint: disable=name-too-long + monitor_id: str, insight_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluator_generation_jobs" + _url = "/agent_insight_monitors/{monitor_id}/insights/{insight_id}" + path_format_arguments = { + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), + "insight_id": _SERIALIZER.url("insight_id", insight_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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_cancel_generation_job_request( # pylint: disable=name-too-long - job_id: str, **kwargs: Any +def build_beta_evaluation_taxonomies_get_request( # pylint: disable=name-too-long + name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2329,9 +2361,9 @@ def build_beta_evaluators_cancel_generation_job_request( # pylint: disable=name accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluator_generation_jobs/{jobId}:cancel" + _url = "/evaluationtaxonomies/{name}" path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2342,132 +2374,71 @@ def build_beta_evaluators_cancel_generation_job_request( # pylint: disable=name # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_delete_generation_job_request( # pylint: disable=name-too-long - job_id: str, **kwargs: Any +def build_beta_evaluation_taxonomies_list_request( # pylint: disable=name-too-long + *, input_name: Optional[str] = None, input_type: 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")) - # Construct URL - _url = "/evaluator_generation_jobs/{jobId}" - path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), - } + accept = _headers.pop("Accept", "application/json") - _url: str = _url.format(**path_format_arguments) # type: ignore + # Construct URL + _url = "/evaluationtaxonomies" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if input_name is not None: + _params["inputName"] = _SERIALIZER.query("input_name", input_name, "str") + if input_type is not None: + _params["inputType"] = _SERIALIZER.query("input_type", input_type, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_insights_generate_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + +def build_beta_evaluation_taxonomies_delete_request( # pylint: disable=name-too-long + name: str, **kwargs: Any +) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") - # Construct URL - _url = "/insights" - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if "Repeatability-Request-ID" not in _headers: - _headers["Repeatability-Request-ID"] = str(uuid.uuid4()) - if "Repeatability-First-Sent" not in _headers: - _headers["Repeatability-First-Sent"] = _SERIALIZER.serialize_data( - datetime.datetime.now(datetime.timezone.utc), "rfc-1123" - ) - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_beta_insights_get_request( - insight_id: str, *, include_coordinates: Optional[bool] = 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 = "/insights/{id}" + _url = "/evaluationtaxonomies/{name}" path_format_arguments = { - "id": _SERIALIZER.url("insight_id", insight_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - if include_coordinates is not None: - _params["includeCoordinates"] = _SERIALIZER.query("include_coordinates", include_coordinates, "bool") _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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_beta_insights_list_request( - *, - type: Optional[Union[str, _models.InsightType]] = None, - eval_id: Optional[str] = None, - run_id: Optional[str] = None, - agent_name: Optional[str] = None, - include_coordinates: Optional[bool] = None, - **kwargs: Any +def build_beta_evaluation_taxonomies_create_request( # pylint: disable=name-too-long + name: 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 = "/insights" - - # Construct parameters - if type is not None: - _params["type"] = _SERIALIZER.query("type", type, "str") - if eval_id is not None: - _params["evalId"] = _SERIALIZER.query("eval_id", eval_id, "str") - if run_id is not None: - _params["runId"] = _SERIALIZER.query("run_id", run_id, "str") - if agent_name is not None: - _params["agentName"] = _SERIALIZER.query("agent_name", agent_name, "str") - if include_coordinates is not None: - _params["includeCoordinates"] = _SERIALIZER.query("include_coordinates", include_coordinates, "bool") - _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_memory_stores_create_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores" + _url = "/evaluationtaxonomies/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2477,10 +2448,12 @@ def build_beta_memory_stores_create_request(**kwargs: Any) -> HttpRequest: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_memory_stores_update_request(name: str, **kwargs: Any) -> HttpRequest: +def build_beta_evaluation_taxonomies_update_request( # pylint: disable=name-too-long + name: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2489,7 +2462,7 @@ def build_beta_memory_stores_update_request(name: str, **kwargs: Any) -> HttpReq accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores/{name}" + _url = "/evaluationtaxonomies/{name}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), } @@ -2504,10 +2477,16 @@ def build_beta_memory_stores_update_request(name: str, **kwargs: Any) -> HttpReq _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_memory_stores_get_request(name: str, **kwargs: Any) -> HttpRequest: +def build_beta_evaluators_list_versions_request( # pylint: disable=name-too-long + name: str, + *, + type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, + limit: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2515,7 +2494,7 @@ def build_beta_memory_stores_get_request(name: str, **kwargs: Any) -> HttpReques accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores/{name}" + _url = "/evaluators/{name}/versions" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), } @@ -2524,6 +2503,10 @@ def build_beta_memory_stores_get_request(name: str, **kwargs: Any) -> HttpReques # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if type is not None: + _params["type"] = _SERIALIZER.query("type", type, "str") + if limit is not None: + _params["limit"] = _SERIALIZER.query("limit", limit, "int") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2531,12 +2514,10 @@ def build_beta_memory_stores_get_request(name: str, **kwargs: Any) -> HttpReques return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_memory_stores_list_request( +def build_beta_evaluators_list_request( *, + type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, 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 {}) @@ -2546,18 +2527,14 @@ def build_beta_memory_stores_list_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores" + _url = "/evaluators" # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if type is not None: + _params["type"] = _SERIALIZER.query("type", type, "str") 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") @@ -2565,7 +2542,9 @@ def build_beta_memory_stores_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_memory_stores_delete_request(name: str, **kwargs: Any) -> HttpRequest: +def build_beta_evaluators_get_version_request( # pylint: disable=name-too-long + name: str, version: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2573,9 +2552,10 @@ def build_beta_memory_stores_delete_request(name: str, **kwargs: Any) -> HttpReq accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores/{name}" + _url = "/evaluators/{name}/versions/{version}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2586,10 +2566,31 @@ def build_beta_memory_stores_delete_request(name: str, **kwargs: Any) -> HttpReq # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_memory_stores_search_memories_request( # pylint: disable=name-too-long +def build_beta_evaluators_delete_version_request( # pylint: disable=name-too-long + name: str, version: 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 = "/evaluators/{name}/versions/{version}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "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_evaluators_create_version_request( # pylint: disable=name-too-long name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2600,7 +2601,7 @@ def build_beta_memory_stores_search_memories_request( # pylint: disable=name-to accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores/{name}:search_memories" + _url = "/evaluators/{name}/versions" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), } @@ -2618,8 +2619,8 @@ def build_beta_memory_stores_search_memories_request( # pylint: disable=name-to return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_memory_stores_update_memories_request( # pylint: disable=name-too-long - name: str, **kwargs: Any +def build_beta_evaluators_update_version_request( # pylint: disable=name-too-long + name: str, version: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2629,9 +2630,10 @@ def build_beta_memory_stores_update_memories_request( # pylint: disable=name-to accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores/{name}:update_memories" + _url = "/evaluators/{name}/versions/{version}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2644,11 +2646,11 @@ def build_beta_memory_stores_update_memories_request( # pylint: disable=name-to _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_memory_stores_delete_scope_request( # pylint: disable=name-too-long - name: str, **kwargs: Any +def build_beta_evaluators_pending_upload_request( # pylint: disable=name-too-long + name: str, version: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2658,9 +2660,10 @@ def build_beta_memory_stores_delete_scope_request( # pylint: disable=name-too-l accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores/{name}:delete_scope" + _url = "/evaluators/{name}/versions/{version}/startPendingUpload" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2676,8 +2679,8 @@ def build_beta_memory_stores_delete_scope_request( # pylint: disable=name-too-l return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_memory_stores_create_memory_request( # pylint: disable=name-too-long - name: str, **kwargs: Any +def build_beta_evaluators_get_credentials_request( # pylint: disable=name-too-long + name: str, version: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2687,9 +2690,10 @@ def build_beta_memory_stores_create_memory_request( # pylint: disable=name-too- accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores/{name}/items" + _url = "/evaluators/{name}/versions/{version}/credentials" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2705,8 +2709,8 @@ def build_beta_memory_stores_create_memory_request( # pylint: disable=name-too- return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_memory_stores_update_memory_request( # pylint: disable=name-too-long - name: str, memory_id: str, **kwargs: Any +def build_beta_evaluators_create_generation_job_request( # pylint: disable=name-too-long + *, operation_id: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2716,18 +2720,14 @@ def build_beta_memory_stores_update_memory_request( # pylint: disable=name-too- accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores/{name}/items/{memory_id}" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "memory_id": _SERIALIZER.url("memory_id", memory_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore + _url = "/evaluator_generation_jobs" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if operation_id is not None: + _headers["Operation-Id"] = _SERIALIZER.header("operation_id", operation_id, "str") if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2735,8 +2735,8 @@ def build_beta_memory_stores_update_memory_request( # pylint: disable=name-too- return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_memory_stores_get_memory_request( # pylint: disable=name-too-long - name: str, memory_id: str, **kwargs: Any +def build_beta_evaluators_get_generation_job_request( # pylint: disable=name-too-long + job_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2745,10 +2745,9 @@ def build_beta_memory_stores_get_memory_request( # pylint: disable=name-too-lon accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores/{name}/items/{memory_id}" + _url = "/evaluator_generation_jobs/{jobId}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "memory_id": _SERIALIZER.url("memory_id", memory_id, "str"), + "jobId": _SERIALIZER.url("job_id", job_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2762,10 +2761,8 @@ def build_beta_memory_stores_get_memory_request( # pylint: disable=name-too-lon return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_memory_stores_list_memories_request( # pylint: disable=name-too-long - name: str, +def build_beta_evaluators_list_generation_jobs_request( # pylint: disable=name-too-long *, - kind: Optional[Union[str, _models.MemoryItemKind]] = None, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, after: Optional[str] = None, @@ -2775,21 +2772,13 @@ def build_beta_memory_stores_list_memories_request( # pylint: disable=name-too- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores/{name}/items:list" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore + _url = "/evaluator_generation_jobs" # Construct parameters - if kind is not None: - _params["kind"] = _SERIALIZER.query("kind", kind, "str") if limit is not None: _params["limit"] = _SERIALIZER.query("limit", limit, "int") if order is not None: @@ -2801,15 +2790,13 @@ def build_beta_memory_stores_list_memories_request( # pylint: disable=name-too- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_memory_stores_delete_memory_request( # pylint: disable=name-too-long - name: str, memory_id: str, **kwargs: Any +def build_beta_evaluators_cancel_generation_job_request( # pylint: disable=name-too-long + job_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2818,10 +2805,9 @@ def build_beta_memory_stores_delete_memory_request( # pylint: disable=name-too- accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores/{name}/items/{memory_id}" + _url = "/evaluator_generation_jobs/{jobId}:cancel" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "memory_id": _SERIALIZER.url("memory_id", memory_id, "str"), + "jobId": _SERIALIZER.url("job_id", job_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2832,20 +2818,19 @@ def build_beta_memory_stores_delete_memory_request( # pylint: disable=name-too- # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_models_list_versions_request(name: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) +def build_beta_evaluators_delete_generation_job_request( # pylint: disable=name-too-long + job_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")) - accept = _headers.pop("Accept", "application/json") - # Construct URL - _url = "/models/{name}/versions" + _url = "/evaluator_generation_jobs/{jobId}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "jobId": _SERIALIZER.url("job_id", job_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2853,32 +2838,40 @@ def build_beta_models_list_versions_request(name: str, **kwargs: Any) -> HttpReq # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_beta_models_list_request(**kwargs: Any) -> HttpRequest: +def build_beta_insights_generate_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/models" + _url = "/insights" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if "Repeatability-Request-ID" not in _headers: + _headers["Repeatability-Request-ID"] = str(uuid.uuid4()) + if "Repeatability-First-Sent" not in _headers: + _headers["Repeatability-First-Sent"] = _SERIALIZER.serialize_data( + datetime.datetime.now(datetime.timezone.utc), "rfc-1123" + ) + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_models_get_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_beta_insights_get_request( + insight_id: str, *, include_coordinates: Optional[bool] = None, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2886,15 +2879,16 @@ def build_beta_models_get_request(name: str, version: str, **kwargs: Any) -> Htt accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/models/{name}/versions/{version}" + _url = "/insights/{id}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "id": _SERIALIZER.url("insight_id", insight_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + if include_coordinates is not None: + _params["includeCoordinates"] = _SERIALIZER.query("include_coordinates", include_coordinates, "bool") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers @@ -2903,26 +2897,44 @@ def build_beta_models_get_request(name: str, version: str, **kwargs: Any) -> Htt return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_models_delete_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_beta_insights_list_request( + *, + type: Optional[Union[str, _models.InsightType]] = None, + eval_id: Optional[str] = None, + run_id: Optional[str] = None, + agent_name: Optional[str] = None, + include_coordinates: Optional[bool] = 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")) - # Construct URL - _url = "/models/{name}/versions/{version}" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } + accept = _headers.pop("Accept", "application/json") - _url: str = _url.format(**path_format_arguments) # type: ignore + # Construct URL + _url = "/insights" # Construct parameters + if type is not None: + _params["type"] = _SERIALIZER.query("type", type, "str") + if eval_id is not None: + _params["evalId"] = _SERIALIZER.query("eval_id", eval_id, "str") + if run_id is not None: + _params["runId"] = _SERIALIZER.query("run_id", run_id, "str") + if agent_name is not None: + _params["agentName"] = _SERIALIZER.query("agent_name", agent_name, "str") + if include_coordinates is not None: + _params["includeCoordinates"] = _SERIALIZER.query("include_coordinates", include_coordinates, "bool") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_models_update_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_beta_memory_stores_create_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2931,13 +2943,7 @@ def build_beta_models_update_request(name: str, version: str, **kwargs: Any) -> accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/models/{name}/versions/{version}" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore + _url = "/memory_stores" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2947,12 +2953,10 @@ def build_beta_models_update_request(name: str, version: str, **kwargs: Any) -> _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_models_pending_create_version_request( # pylint: disable=name-too-long - name: str, version: str, **kwargs: Any -) -> HttpRequest: +def build_beta_memory_stores_update_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2961,10 +2965,9 @@ def build_beta_models_pending_create_version_request( # pylint: disable=name-to accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/models/{name}/versions/{version}/createAsync" + _url = "/memory_stores/{name}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2980,19 +2983,17 @@ def build_beta_models_pending_create_version_request( # pylint: disable=name-to return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_models_pending_upload_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_beta_memory_stores_get_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/models/{name}/versions/{version}/startPendingUpload" + _url = "/memory_stores/{name}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3001,44 +3002,46 @@ def build_beta_models_pending_upload_request(name: str, version: str, **kwargs: _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_models_get_credentials_request( # pylint: disable=name-too-long - name: str, version: str, **kwargs: Any +def build_beta_memory_stores_list_request( + *, + 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 {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/models/{name}/versions/{version}/credentials" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore + _url = "/memory_stores" # 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 - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_red_teams_get_request(name: str, **kwargs: Any) -> HttpRequest: +def build_beta_memory_stores_delete_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3046,7 +3049,7 @@ def build_beta_red_teams_get_request(name: str, **kwargs: Any) -> HttpRequest: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/redTeams/runs/{name}" + _url = "/memory_stores/{name}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), } @@ -3059,29 +3062,41 @@ def build_beta_red_teams_get_request(name: str, **kwargs: Any) -> HttpRequest: # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_red_teams_list_request(**kwargs: Any) -> HttpRequest: +def build_beta_memory_stores_search_memories_request( # pylint: disable=name-too-long + name: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/redTeams/runs" + _url = "/memory_stores/{name}:search_memories" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_red_teams_create_request(**kwargs: Any) -> HttpRequest: +def build_beta_memory_stores_update_memories_request( # pylint: disable=name-too-long + name: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3090,7 +3105,12 @@ def build_beta_red_teams_create_request(**kwargs: Any) -> HttpRequest: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/redTeams/runs:run" + _url = "/memory_stores/{name}:update_memories" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -3103,8 +3123,8 @@ def build_beta_red_teams_create_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_routines_create_or_update_request( # pylint: disable=name-too-long - routine_name: str, **kwargs: Any +def build_beta_memory_stores_delete_scope_request( # pylint: disable=name-too-long + name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3114,9 +3134,9 @@ def build_beta_routines_create_or_update_request( # pylint: disable=name-too-lo accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/routines/{routine_name}" + _url = "/memory_stores/{name}:delete_scope" path_format_arguments = { - "routine_name": _SERIALIZER.url("routine_name", routine_name, "str"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3129,20 +3149,23 @@ def build_beta_routines_create_or_update_request( # pylint: disable=name-too-lo _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_routines_get_request(routine_name: str, **kwargs: Any) -> HttpRequest: +def build_beta_memory_stores_create_memory_request( # pylint: disable=name-too-long + name: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/routines/{routine_name}" + _url = "/memory_stores/{name}/items" path_format_arguments = { - "routine_name": _SERIALIZER.url("routine_name", routine_name, "str"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3151,22 +3174,28 @@ def build_beta_routines_get_request(routine_name: str, **kwargs: Any) -> HttpReq _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_routines_enable_request(routine_name: str, **kwargs: Any) -> HttpRequest: +def build_beta_memory_stores_update_memory_request( # pylint: disable=name-too-long + name: str, memory_id: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/routines/{routine_name}:enable" + _url = "/memory_stores/{name}/items/{memory_id}" path_format_arguments = { - "routine_name": _SERIALIZER.url("routine_name", routine_name, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "memory_id": _SERIALIZER.url("memory_id", memory_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3175,12 +3204,16 @@ def build_beta_routines_enable_request(routine_name: str, **kwargs: Any) -> Http _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_routines_disable_request(routine_name: str, **kwargs: Any) -> HttpRequest: +def build_beta_memory_stores_get_memory_request( # pylint: disable=name-too-long + name: str, memory_id: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3188,9 +3221,10 @@ def build_beta_routines_disable_request(routine_name: str, **kwargs: Any) -> Htt accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/routines/{routine_name}:disable" + _url = "/memory_stores/{name}/items/{memory_id}" path_format_arguments = { - "routine_name": _SERIALIZER.url("routine_name", routine_name, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "memory_id": _SERIALIZER.url("memory_id", memory_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3201,48 +3235,69 @@ def build_beta_routines_disable_request(routine_name: str, **kwargs: Any) -> Htt # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_routines_list_request( +def build_beta_memory_stores_list_memories_request( # pylint: disable=name-too-long + name: str, *, + kind: Optional[Union[str, _models.MemoryItemKind]] = None, limit: Optional[int] = None, - after: Optional[str] = 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 {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/routines" + _url = "/memory_stores/{name}/items:list" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + if kind is not None: + _params["kind"] = _SERIALIZER.query("kind", kind, "str") if limit is not None: _params["limit"] = _SERIALIZER.query("limit", limit, "int") - if after is not None: - _params["after"] = _SERIALIZER.query("after", after, "str") 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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_routines_delete_request(routine_name: str, **kwargs: Any) -> HttpRequest: +def build_beta_memory_stores_delete_memory_request( # pylint: disable=name-too-long + name: str, memory_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 = "/routines/{routine_name}" + _url = "/memory_stores/{name}/items/{memory_id}" path_format_arguments = { - "routine_name": _SERIALIZER.url("routine_name", routine_name, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "memory_id": _SERIALIZER.url("memory_id", memory_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3250,18 +3305,13 @@ def build_beta_routines_delete_request(routine_name: str, **kwargs: Any) -> Http # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_routines_list_runs_request( - routine_name: str, - *, - filter: Optional[str] = None, - limit: Optional[int] = None, - after: Optional[str] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - **kwargs: Any -) -> HttpRequest: +def build_beta_models_list_versions_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3269,22 +3319,14 @@ def build_beta_routines_list_runs_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/routines/{routine_name}/runs" + _url = "/models/{name}/versions" path_format_arguments = { - "routine_name": _SERIALIZER.url("routine_name", routine_name, "str"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - if filter is not None: - _params["filter"] = _SERIALIZER.query("filter", filter, "str") - if limit is not None: - _params["limit"] = _SERIALIZER.query("limit", limit, "int") - if after is not None: - _params["after"] = _SERIALIZER.query("after", after, "str") - if order is not None: - _params["order"] = _SERIALIZER.query("order", order, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers @@ -3293,18 +3335,37 @@ def build_beta_routines_list_runs_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_routines_dispatch_request(routine_name: str, **kwargs: Any) -> HttpRequest: +def build_beta_models_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/routines/{routine_name}:dispatch_async" + _url = "/models" + + # 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_models_get_request(name: str, version: 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 = "/models/{name}/versions/{version}" path_format_arguments = { - "routine_name": _SERIALIZER.url("routine_name", routine_name, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3313,21 +3374,20 @@ def build_beta_routines_dispatch_request(routine_name: str, **kwargs: Any) -> Ht _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_schedules_delete_request(schedule_id: str, **kwargs: Any) -> HttpRequest: +def build_beta_models_delete_request(name: str, version: 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 = "/schedules/{id}" + _url = "/models/{name}/versions/{version}" path_format_arguments = { - "id": _SERIALIZER.url("schedule_id", schedule_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3338,17 +3398,19 @@ def build_beta_schedules_delete_request(schedule_id: str, **kwargs: Any) -> Http return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_beta_schedules_get_request(schedule_id: str, **kwargs: Any) -> HttpRequest: +def build_beta_models_update_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/schedules/{id}" + _url = "/models/{name}/versions/{version}" path_format_arguments = { - "id": _SERIALIZER.url("schedule_id", schedule_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3357,39 +3419,44 @@ def build_beta_schedules_get_request(schedule_id: str, **kwargs: Any) -> HttpReq _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_schedules_list_request( - *, type: Optional[Union[str, _models.ScheduleTaskType]] = None, enabled: Optional[bool] = None, **kwargs: Any +def build_beta_models_pending_create_version_request( # pylint: disable=name-too-long + name: str, version: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/schedules" + _url = "/models/{name}/versions/{version}/createAsync" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if type is not None: - _params["type"] = _SERIALIZER.query("type", type, "str") - if enabled is not None: - _params["enabled"] = _SERIALIZER.query("enabled", enabled, "bool") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_schedules_create_or_update_request( # pylint: disable=name-too-long - schedule_id: str, **kwargs: Any -) -> HttpRequest: +def build_beta_models_pending_upload_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3398,9 +3465,10 @@ def build_beta_schedules_create_or_update_request( # pylint: disable=name-too-l accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/schedules/{id}" + _url = "/models/{name}/versions/{version}/startPendingUpload" path_format_arguments = { - "id": _SERIALIZER.url("schedule_id", schedule_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3413,21 +3481,24 @@ def build_beta_schedules_create_or_update_request( # pylint: disable=name-too-l _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_schedules_get_run_request(schedule_id: str, run_id: str, **kwargs: Any) -> HttpRequest: +def build_beta_models_get_credentials_request( # pylint: disable=name-too-long + name: str, version: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/schedules/{schedule_id}/runs/{run_id}" + _url = "/models/{name}/versions/{version}/credentials" path_format_arguments = { - "schedule_id": _SERIALIZER.url("schedule_id", schedule_id, "str"), - "run_id": _SERIALIZER.url("run_id", run_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3436,18 +3507,14 @@ def build_beta_schedules_get_run_request(schedule_id: str, run_id: str, **kwargs _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_schedules_list_runs_request( - schedule_id: str, - *, - type: Optional[Union[str, _models.ScheduleTaskType]] = None, - enabled: Optional[bool] = None, - **kwargs: Any -) -> HttpRequest: +def build_beta_red_teams_get_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3455,19 +3522,15 @@ def build_beta_schedules_list_runs_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/schedules/{id}/runs" + _url = "/redTeams/runs/{name}" path_format_arguments = { - "id": _SERIALIZER.url("schedule_id", schedule_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if type is not None: - _params["type"] = _SERIALIZER.query("type", type, "str") - if enabled is not None: - _params["enabled"] = _SERIALIZER.query("enabled", enabled, "bool") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -3475,7 +3538,7 @@ def build_beta_schedules_list_runs_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_skills_get_request(name: str, **kwargs: Any) -> HttpRequest: +def build_beta_red_teams_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3483,12 +3546,7 @@ def build_beta_skills_get_request(name: str, **kwargs: Any) -> HttpRequest: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/skills/{name}" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore + _url = "/redTeams/runs" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -3499,41 +3557,31 @@ def build_beta_skills_get_request(name: str, **kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_skills_list_request( - *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - after: Optional[str] = None, - before: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: +def build_beta_red_teams_create_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/skills" + _url = "/redTeams/runs:run" # 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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_skills_update_request(name: str, **kwargs: Any) -> HttpRequest: +def build_beta_routines_create_or_update_request( # pylint: disable=name-too-long + routine_name: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3542,9 +3590,9 @@ def build_beta_skills_update_request(name: str, **kwargs: Any) -> HttpRequest: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/skills/{name}" + _url = "/routines/{routine_name}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "routine_name": _SERIALIZER.url("routine_name", routine_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3557,10 +3605,10 @@ def build_beta_skills_update_request(name: str, **kwargs: Any) -> HttpRequest: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_skills_delete_request(name: str, **kwargs: Any) -> HttpRequest: +def build_beta_routines_get_request(routine_name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3568,9 +3616,9 @@ def build_beta_skills_delete_request(name: str, **kwargs: Any) -> HttpRequest: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/skills/{name}" + _url = "/routines/{routine_name}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "routine_name": _SERIALIZER.url("routine_name", routine_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3581,21 +3629,20 @@ def build_beta_skills_delete_request(name: str, **kwargs: Any) -> HttpRequest: # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_skills_create_request(name: str, **kwargs: Any) -> HttpRequest: +def build_beta_routines_enable_request(routine_name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/skills/{name}/versions" + _url = "/routines/{routine_name}:enable" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "routine_name": _SERIALIZER.url("routine_name", routine_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3604,16 +3651,12 @@ def build_beta_skills_create_request(name: str, **kwargs: Any) -> HttpRequest: _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_skills_create_from_files_request( # pylint: disable=name-too-long - name: str, **kwargs: Any -) -> HttpRequest: +def build_beta_routines_disable_request(routine_name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3621,9 +3664,9 @@ def build_beta_skills_create_from_files_request( # pylint: disable=name-too-lon accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/skills/{name}/versions" + _url = "/routines/{routine_name}:disable" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "routine_name": _SERIALIZER.url("routine_name", routine_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3637,13 +3680,11 @@ def build_beta_skills_create_from_files_request( # pylint: disable=name-too-lon return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_skills_list_versions_request( - name: str, +def build_beta_routines_list_request( *, limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, after: Optional[str] = None, - before: Optional[str] = None, + order: Optional[Union[str, _models.PageOrder]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -3653,22 +3694,15 @@ def build_beta_skills_list_versions_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/skills/{name}/versions" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore + _url = "/routines" # 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") + if order is not None: + _params["order"] = _SERIALIZER.query("order", order, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers @@ -3677,18 +3711,14 @@ def build_beta_skills_list_versions_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_skills_get_version_request(name: str, version: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) +def build_beta_routines_delete_request(routine_name: str, **kwargs: Any) -> HttpRequest: _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 = "/skills/{name}/versions/{version}" + _url = "/routines/{routine_name}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "routine_name": _SERIALIZER.url("routine_name", routine_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3696,28 +3726,41 @@ def build_beta_skills_get_version_request(name: str, version: str, **kwargs: Any # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_beta_skills_download_request(name: str, **kwargs: Any) -> HttpRequest: +def build_beta_routines_list_runs_request( + routine_name: str, + *, + filter: Optional[str] = None, + limit: Optional[int] = None, + after: Optional[str] = None, + order: Optional[Union[str, _models.PageOrder]] = 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/zip") + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/skills/{name}/content" + _url = "/routines/{routine_name}/runs" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "routine_name": _SERIALIZER.url("routine_name", routine_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + if filter is not None: + _params["filter"] = _SERIALIZER.query("filter", filter, "str") + if limit is not None: + _params["limit"] = _SERIALIZER.query("limit", limit, "int") + if after is not None: + _params["after"] = _SERIALIZER.query("after", after, "str") + if order is not None: + _params["order"] = _SERIALIZER.query("order", order, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers @@ -3726,20 +3769,62 @@ def build_beta_skills_download_request(name: str, **kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_skills_download_version_request( # pylint: disable=name-too-long - name: str, version: str, **kwargs: Any -) -> HttpRequest: +def build_beta_routines_dispatch_request(routine_name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/zip") + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/skills/{name}/versions/{version}/content" + _url = "/routines/{routine_name}:dispatch_async" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "routine_name": _SERIALIZER.url("routine_name", routine_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_schedules_delete_request(schedule_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 = "/schedules/{id}" + path_format_arguments = { + "id": _SERIALIZER.url("schedule_id", schedule_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_schedules_get_request(schedule_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 = "/schedules/{id}" + path_format_arguments = { + "id": _SERIALIZER.url("schedule_id", schedule_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3753,7 +3838,9 @@ def build_beta_skills_download_version_request( # pylint: disable=name-too-long return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_skills_delete_version_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_beta_schedules_list_request( + *, type: Optional[Union[str, _models.ScheduleTaskType]] = None, enabled: Optional[bool] = None, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3761,10 +3848,35 @@ def build_beta_skills_delete_version_request(name: str, version: str, **kwargs: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/skills/{name}/versions/{version}" + _url = "/schedules" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if type is not None: + _params["type"] = _SERIALIZER.query("type", type, "str") + if enabled is not None: + _params["enabled"] = _SERIALIZER.query("enabled", enabled, "bool") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_schedules_create_or_update_request( # pylint: disable=name-too-long + schedule_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/schedules/{id}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "id": _SERIALIZER.url("schedule_id", schedule_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3773,13 +3885,44 @@ def build_beta_skills_delete_version_request(name: str, version: str, **kwargs: _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_datasets_get_generation_job_request( # pylint: disable=name-too-long - job_id: str, **kwargs: Any +def build_beta_schedules_get_run_request(schedule_id: str, run_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 = "/schedules/{schedule_id}/runs/{run_id}" + path_format_arguments = { + "schedule_id": _SERIALIZER.url("schedule_id", schedule_id, "str"), + "run_id": _SERIALIZER.url("run_id", run_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_schedules_list_runs_request( + schedule_id: str, + *, + type: Optional[Union[str, _models.ScheduleTaskType]] = None, + enabled: Optional[bool] = None, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3788,15 +3931,19 @@ def build_beta_datasets_get_generation_job_request( # pylint: disable=name-too- accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/data_generation_jobs/{jobId}" + _url = "/schedules/{id}/runs" path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), + "id": _SERIALIZER.url("schedule_id", schedule_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if type is not None: + _params["type"] = _SERIALIZER.query("type", type, "str") + if enabled is not None: + _params["enabled"] = _SERIALIZER.query("enabled", enabled, "bool") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -3804,7 +3951,31 @@ def build_beta_datasets_get_generation_job_request( # pylint: disable=name-too- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_datasets_list_generation_jobs_request( # pylint: disable=name-too-long +def build_beta_skills_get_request(name: 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 = "/skills/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "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_skills_list_request( *, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, @@ -3819,7 +3990,7 @@ def build_beta_datasets_list_generation_jobs_request( # pylint: disable=name-to accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/data_generation_jobs" + _url = "/skills" # Construct parameters if limit is not None: @@ -3838,9 +4009,7 @@ def build_beta_datasets_list_generation_jobs_request( # pylint: disable=name-to return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_datasets_create_generation_job_request( # pylint: disable=name-too-long - *, operation_id: Optional[str] = None, **kwargs: Any -) -> HttpRequest: +def build_beta_skills_update_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3849,14 +4018,17 @@ def build_beta_datasets_create_generation_job_request( # pylint: disable=name-t accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/data_generation_jobs" + _url = "/skills/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if operation_id is not None: - _headers["Operation-Id"] = _SERIALIZER.header("operation_id", operation_id, "str") if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -3864,9 +4036,7 @@ def build_beta_datasets_create_generation_job_request( # pylint: disable=name-t return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_datasets_cancel_generation_job_request( # pylint: disable=name-too-long - job_id: str, **kwargs: Any -) -> HttpRequest: +def build_beta_skills_delete_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3874,9 +4044,9 @@ def build_beta_datasets_cancel_generation_job_request( # pylint: disable=name-t accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/data_generation_jobs/{jobId}:cancel" + _url = "/skills/{name}" path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3887,32 +4057,10 @@ def build_beta_datasets_cancel_generation_job_request( # pylint: disable=name-t # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_beta_datasets_delete_generation_job_request( # pylint: disable=name-too-long - job_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 = "/data_generation_jobs/{jobId}" - path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_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) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agents_create_optimization_job_request( # pylint: disable=name-too-long - *, operation_id: Optional[str] = None, **kwargs: Any -) -> HttpRequest: +def build_beta_skills_create_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3921,14 +4069,17 @@ def build_beta_agents_create_optimization_job_request( # pylint: disable=name-t accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agent_optimization_jobs" + _url = "/skills/{name}/versions" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if operation_id is not None: - _headers["Operation-Id"] = _SERIALIZER.header("operation_id", operation_id, "str") if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -3936,8 +4087,8 @@ def build_beta_agents_create_optimization_job_request( # pylint: disable=name-t return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agents_get_optimization_job_request( # pylint: disable=name-too-long - job_id: str, **kwargs: Any +def build_beta_skills_create_from_files_request( # pylint: disable=name-too-long + name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3946,9 +4097,9 @@ def build_beta_agents_get_optimization_job_request( # pylint: disable=name-too- accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agent_optimization_jobs/{jobId}" + _url = "/skills/{name}/versions" path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3959,17 +4110,16 @@ def build_beta_agents_get_optimization_job_request( # pylint: disable=name-too- # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agents_list_optimization_jobs_request( # pylint: disable=name-too-long +def build_beta_skills_list_versions_request( + name: str, *, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, after: Optional[str] = None, before: Optional[str] = None, - status: Optional[Union[str, _models.JobStatus]] = None, - agent_name: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -3979,7 +4129,12 @@ def build_beta_agents_list_optimization_jobs_request( # pylint: disable=name-to accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agent_optimization_jobs" + _url = "/skills/{name}/versions" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if limit is not None: @@ -3990,10 +4145,6 @@ def build_beta_agents_list_optimization_jobs_request( # pylint: disable=name-to _params["after"] = _SERIALIZER.query("after", after, "str") if before is not None: _params["before"] = _SERIALIZER.query("before", before, "str") - if status is not None: - _params["status"] = _SERIALIZER.query("status", status, "str") - if agent_name is not None: - _params["agent_name"] = _SERIALIZER.query("agent_name", agent_name, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers @@ -4002,9 +4153,7 @@ def build_beta_agents_list_optimization_jobs_request( # pylint: disable=name-to return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agents_cancel_optimization_job_request( # pylint: disable=name-too-long - job_id: str, **kwargs: Any -) -> HttpRequest: +def build_beta_skills_get_version_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -4012,9 +4161,10 @@ def build_beta_agents_cancel_optimization_job_request( # pylint: disable=name-t accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agent_optimization_jobs/{jobId}:cancel" + _url = "/skills/{name}/versions/{version}" path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -4025,19 +4175,20 @@ def build_beta_agents_cancel_optimization_job_request( # pylint: disable=name-t # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agents_delete_optimization_job_request( # pylint: disable=name-too-long - job_id: str, **kwargs: Any -) -> HttpRequest: +def build_beta_skills_download_request(name: 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/zip") + # Construct URL - _url = "/agent_optimization_jobs/{jobId}" + _url = "/skills/{name}/content" path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -4045,216 +4196,2187 @@ def build_beta_agents_delete_optimization_job_request( # pylint: disable=name-t # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -class BetaOperations: # pylint: disable=docstring-missing-param,too-many-instance-attributes - """ - .. warning:: - **DO NOT** instantiate this class directly. - Instead, you should access the following operations through - :class:`~azure.ai.projects.AIProjectClient`'s - :attr:`beta` attribute. - """ +def build_beta_skills_download_version_request( # pylint: disable=name-too-long + name: str, version: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - 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") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/zip") - self.evaluation_taxonomies = BetaEvaluationTaxonomiesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.evaluators = BetaEvaluatorsOperations(self._client, self._config, self._serialize, self._deserialize) - self.insights = BetaInsightsOperations(self._client, self._config, self._serialize, self._deserialize) - self.memory_stores = BetaMemoryStoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.models = BetaModelsOperations(self._client, self._config, self._serialize, self._deserialize) - self.red_teams = BetaRedTeamsOperations(self._client, self._config, self._serialize, self._deserialize) - self.routines = BetaRoutinesOperations(self._client, self._config, self._serialize, self._deserialize) - self.schedules = BetaSchedulesOperations(self._client, self._config, self._serialize, self._deserialize) - self.skills = BetaSkillsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datasets = BetaDatasetsOperations(self._client, self._config, self._serialize, self._deserialize) - self.agents = BetaAgentsOperations(self._client, self._config, self._serialize, self._deserialize) + # Construct URL + _url = "/skills/{name}/versions/{version}/content" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), + } + _url: str = _url.format(**path_format_arguments) # type: ignore -class AgentsOperations: # pylint: disable=docstring-missing-param,too-many-public-methods - """ - .. warning:: - **DO NOT** instantiate this class directly. + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - Instead, you should access the following operations through - :class:`~azure.ai.projects.AIProjectClient`'s - :attr:`agents` attribute. - """ + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - 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") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - @distributed_trace - def get(self, agent_name: str, **kwargs: Any) -> _models.AgentDetails: - """Get an agent. - Retrieves an agent definition by its unique name. +def build_beta_skills_delete_version_request(name: str, version: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - :param agent_name: The name of the agent to retrieve. Required. - :type agent_name: str - :return: AgentDetails. The AgentDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + # Construct URL + _url = "/skills/{name}/versions/{version}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), + } - cls: ClsType[_models.AgentDetails] = kwargs.pop("cls", None) + _url: str = _url.format(**path_format_arguments) # type: ignore - _request = build_agents_get_request( - agent_name=agent_name, - 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) + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - _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 - ) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - response = pipeline_response.http_response + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - 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.AgentDetails, response.json()) +def build_beta_datasets_get_generation_job_request( # pylint: disable=name-too-long + job_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") - return deserialized # type: ignore + # Construct URL + _url = "/data_generation_jobs/{jobId}" + path_format_arguments = { + "jobId": _SERIALIZER.url("job_id", job_id, "str"), + } - @distributed_trace - def generate_agent(self, body: _models.GenerateVoiceAgentRequest, **kwargs: Any) -> _models.AgentDetails: - """Generate an agent. + _url: str = _url.format(**path_format_arguments) # type: ignore - Generates and creates an agent from kind-specific high-level inputs. The generated definition - remains fully editable through the standard agent versioning operations. + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - :param body: The kind-specific inputs for generating and creating an agent. Is one of the - following types: GenerateVoiceAgentRequest Required. - :type body: ~azure.ai.projects.models.GenerateVoiceAgentRequest - :return: AgentDetails. The AgentDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AgentDetails] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore +def build_beta_datasets_list_generation_jobs_request( # pylint: disable=name-too-long + *, + 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 {}) - _request = build_agents_generate_agent_request( - content_type=content_type, - api_version=self._config.api_version, - content=_content, - 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) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") - _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 - ) + # Construct URL + _url = "/data_generation_jobs" - response = pipeline_response.http_response + # 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") - 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) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.AgentDetails, response.json()) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized # type: ignore +def build_beta_datasets_create_generation_job_request( # pylint: disable=name-too-long + *, operation_id: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - @distributed_trace - def delete(self, agent_name: str, *, force: Optional[bool] = None, **kwargs: Any) -> _models.DeleteAgentResponse: - """Delete an agent. + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") - Deletes an agent. For hosted agents, if any version has active sessions, the request is + # Construct URL + _url = "/data_generation_jobs" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if operation_id is not None: + _headers["Operation-Id"] = _SERIALIZER.header("operation_id", operation_id, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_datasets_cancel_generation_job_request( # pylint: disable=name-too-long + job_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 = "/data_generation_jobs/{jobId}:cancel" + path_format_arguments = { + "jobId": _SERIALIZER.url("job_id", job_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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_datasets_delete_generation_job_request( # pylint: disable=name-too-long + job_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 = "/data_generation_jobs/{jobId}" + path_format_arguments = { + "jobId": _SERIALIZER.url("job_id", job_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_agents_create_optimization_job_request( # pylint: disable=name-too-long + *, operation_id: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/agent_optimization_jobs" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if operation_id is not None: + _headers["Operation-Id"] = _SERIALIZER.header("operation_id", operation_id, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_agents_get_optimization_job_request( # pylint: disable=name-too-long + job_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 = "/agent_optimization_jobs/{jobId}" + path_format_arguments = { + "jobId": _SERIALIZER.url("job_id", job_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_agents_list_optimization_jobs_request( # pylint: disable=name-too-long + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + after: Optional[str] = None, + before: Optional[str] = None, + status: Optional[Union[str, _models.JobStatus]] = None, + agent_name: 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 = "/agent_optimization_jobs" + + # 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") + if status is not None: + _params["status"] = _SERIALIZER.query("status", status, "str") + if agent_name is not None: + _params["agent_name"] = _SERIALIZER.query("agent_name", agent_name, "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_agents_cancel_optimization_job_request( # pylint: disable=name-too-long + job_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 = "/agent_optimization_jobs/{jobId}:cancel" + path_format_arguments = { + "jobId": _SERIALIZER.url("job_id", job_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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_agents_delete_optimization_job_request( # pylint: disable=name-too-long + job_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 = "/agent_optimization_jobs/{jobId}" + path_format_arguments = { + "jobId": _SERIALIZER.url("job_id", job_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) + + +class BetaOperations: # pylint: disable=docstring-missing-param,too-many-instance-attributes + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.AIProjectClient`'s + :attr:`beta` 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") + + self.agent_endpoint_conversations = BetaAgentEndpointConversationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.agent_insight_monitors = BetaAgentInsightMonitorsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.evaluation_taxonomies = BetaEvaluationTaxonomiesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.evaluators = BetaEvaluatorsOperations(self._client, self._config, self._serialize, self._deserialize) + self.insights = BetaInsightsOperations(self._client, self._config, self._serialize, self._deserialize) + self.memory_stores = BetaMemoryStoresOperations(self._client, self._config, self._serialize, self._deserialize) + self.models = BetaModelsOperations(self._client, self._config, self._serialize, self._deserialize) + self.red_teams = BetaRedTeamsOperations(self._client, self._config, self._serialize, self._deserialize) + self.routines = BetaRoutinesOperations(self._client, self._config, self._serialize, self._deserialize) + self.schedules = BetaSchedulesOperations(self._client, self._config, self._serialize, self._deserialize) + self.skills = BetaSkillsOperations(self._client, self._config, self._serialize, self._deserialize) + self.datasets = BetaDatasetsOperations(self._client, self._config, self._serialize, self._deserialize) + self.agents = BetaAgentsOperations(self._client, self._config, self._serialize, self._deserialize) + + +class AgentsOperations: # pylint: disable=docstring-missing-param,too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.AIProjectClient`'s + :attr:`agents` 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 get(self, agent_name: str, **kwargs: Any) -> _models.AgentDetails: + """Get an agent. + + Retrieves an agent definition by its unique name. + + :param agent_name: The name of the agent to retrieve. Required. + :type agent_name: str + :return: AgentDetails. The AgentDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentDetails + :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.AgentDetails] = kwargs.pop("cls", None) + + _request = build_agents_get_request( + agent_name=agent_name, + 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.AgentDetails, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def generate_agent(self, body: _models.GenerateVoiceAgentRequest, **kwargs: Any) -> _models.AgentDetails: + """Generate an agent. + + Generates and creates an agent from kind-specific high-level inputs. The generated definition + remains fully editable through the standard agent versioning operations. + + :param body: The kind-specific inputs for generating and creating an agent. Is one of the + following types: GenerateVoiceAgentRequest Required. + :type body: ~azure.ai.projects.models.GenerateVoiceAgentRequest + :return: AgentDetails. The AgentDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentDetails + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AgentDetails] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_agents_generate_agent_request( + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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.AgentDetails, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete(self, agent_name: str, *, force: Optional[bool] = None, **kwargs: Any) -> _models.DeleteAgentResponse: + """Delete an agent. + + Deletes an agent. For hosted agents, if any version has active sessions, the request is rejected with HTTP 409 unless ``force`` is set to true. When force is true, all associated sessions are cascade-deleted along with the agent and its versions. - :param agent_name: The name of the agent to delete. Required. + :param agent_name: The name of the agent to delete. Required. + :type agent_name: str + :keyword force: For Hosted Agents, if ``true``, force-deletes the agent even if its versions + have active sessions, cascading deletion to all associated sessions. The service defaults to + ``false`` if a value is not specified by the caller. This value is not relevant for other Agent + types. Default value is None. + :paramtype force: bool + :return: DeleteAgentResponse. The DeleteAgentResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.DeleteAgentResponse + :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.DeleteAgentResponse] = kwargs.pop("cls", None) + + _request = build_agents_delete_request( + agent_name=agent_name, + force=force, + 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.DeleteAgentResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list( + self, + *, + kind: Optional[Union[str, _models.AgentKind]] = None, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.AgentDetails"]: + """List agents. + + Returns a paged collection of agent resources. + + :keyword kind: Filter agents by kind. If not provided, all agents are returned. Known values + are: "prompt", "hosted", "workflow", "external", and "voice". Default value is None. + :paramtype kind: str or ~azure.ai.projects.models.AgentKind + :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 AgentDetails + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.AgentDetails] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AgentDetails]] = 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_agents_list_request( + kind=kind, + 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.AgentDetails], + 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) + + @overload + def create_version( + self, + agent_name: str, + *, + definition: _models.AgentDefinition, + content_type: str = "application/json", + metadata: Optional[dict[str, str]] = None, + description: Optional[str] = None, + blueprint_reference: Optional[_models.AgentBlueprintReference] = None, + digital_worker_type: Optional[Union[str, _models.DigitalWorkerType]] = None, + draft: Optional[bool] = None, + **kwargs: Any + ) -> _models.AgentVersionDetails: + """Create an agent version. + + Creates a new version for the specified agent and returns the created version resource. + + :param agent_name: The unique name that identifies the agent. Name can be used to + retrieve/update/delete the agent. + + * Must start and end with alphanumeric characters, + * Can contain hyphens in the middle + * Must not exceed 63 characters. Required. + :type agent_name: str + :keyword definition: The agent definition. This can be a prompt, workflow, hosted, external, or + voice agent definition. Required. + :paramtype definition: ~azure.ai.projects.models.AgentDefinition + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword 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. Default value is None. + :paramtype metadata: dict[str, str] + :keyword description: A human-readable description of the agent. Default value is None. + :paramtype description: str + :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. + :paramtype blueprint_reference: ~azure.ai.projects.models.AgentBlueprintReference + :keyword digital_worker_type: (Preview) The type of digital worker (previously known as + ``autopilot``). If omitted, it is not a digital worker. "m365" Default value is None. + :paramtype digital_worker_type: str or ~azure.ai.projects.models.DigitalWorkerType + :keyword draft: (Preview) Whether this agent version is a draft (candidate) rather than a + release. The service defaults to ``false`` if a value is not specified by the caller. Draft + versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. + Default value is None. + :paramtype draft: bool + :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentVersionDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_version( + self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AgentVersionDetails: + """Create an agent version. + + Creates a new version for the specified agent and returns the created version resource. + + :param agent_name: The unique name that identifies the agent. Name can be used to + retrieve/update/delete the agent. + + * Must start and end with alphanumeric characters, + * Can contain hyphens in the middle + * Must not exceed 63 characters. Required. + :type agent_name: str + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentVersionDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_version( + self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AgentVersionDetails: + """Create an agent version. + + Creates a new version for the specified agent and returns the created version resource. + + :param agent_name: The unique name that identifies the agent. Name can be used to + retrieve/update/delete the agent. + + * Must start and end with alphanumeric characters, + * Can contain hyphens in the middle + * Must not exceed 63 characters. Required. + :type agent_name: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentVersionDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_version( + self, + agent_name: str, + body: Union[JSON, IO[bytes]] = _Unset, + *, + definition: _models.AgentDefinition = _Unset, + metadata: Optional[dict[str, str]] = None, + description: Optional[str] = None, + blueprint_reference: Optional[_models.AgentBlueprintReference] = None, + digital_worker_type: Optional[Union[str, _models.DigitalWorkerType]] = None, + draft: Optional[bool] = None, + **kwargs: Any + ) -> _models.AgentVersionDetails: + """Create an agent version. + + Creates a new version for the specified agent and returns the created version resource. + + :param agent_name: The unique name that identifies the agent. Name can be used to + retrieve/update/delete the agent. + + * Must start and end with alphanumeric characters, + * Can contain hyphens in the middle + * Must not exceed 63 characters. Required. + :type agent_name: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword definition: The agent definition. This can be a prompt, workflow, hosted, external, or + voice agent definition. Required. + :paramtype definition: ~azure.ai.projects.models.AgentDefinition + :keyword 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. Default value is None. + :paramtype metadata: dict[str, str] + :keyword description: A human-readable description of the agent. Default value is None. + :paramtype description: str + :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. + :paramtype blueprint_reference: ~azure.ai.projects.models.AgentBlueprintReference + :keyword digital_worker_type: (Preview) The type of digital worker (previously known as + ``autopilot``). If omitted, it is not a digital worker. "m365" Default value is None. + :paramtype digital_worker_type: str or ~azure.ai.projects.models.DigitalWorkerType + :keyword draft: (Preview) Whether this agent version is a draft (candidate) rather than a + release. The service defaults to ``false`` if a value is not specified by the caller. Draft + versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. + Default value is None. + :paramtype draft: bool + :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentVersionDetails + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AgentVersionDetails] = kwargs.pop("cls", None) + + if body is _Unset: + if definition is _Unset: + raise TypeError("missing required argument: definition") + body = { + "blueprint_reference": blueprint_reference, + "definition": definition, + "description": description, + "digital_worker_type": digital_worker_type, + "draft": draft, + "metadata": metadata, + } + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_agents_create_version_request( + agent_name=agent_name, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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.AgentVersionDetails, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_version_from_manifest( + self, + agent_name: str, + *, + manifest_id: str, + parameter_values: dict[str, Any], + content_type: str = "application/json", + metadata: Optional[dict[str, str]] = None, + description: Optional[str] = None, + **kwargs: Any + ) -> _models.AgentVersionDetails: + """Create an agent version from manifest. + + Imports the provided manifest to create a new version for the specified agent. + + :param agent_name: The unique name that identifies the agent. Name can be used to + retrieve/update/delete the agent. + + * Must start and end with alphanumeric characters, + * Can contain hyphens in the middle + * Must not exceed 63 characters. Required. + :type agent_name: str + :keyword manifest_id: The manifest ID to import the agent version from. Required. + :paramtype manifest_id: str + :keyword parameter_values: The inputs to the manifest that will result in a fully materialized + Agent. Required. + :paramtype parameter_values: dict[str, any] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword 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. Default value is None. + :paramtype metadata: dict[str, str] + :keyword description: A human-readable description of the agent. Default value is None. + :paramtype description: str + :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentVersionDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_version_from_manifest( + self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AgentVersionDetails: + """Create an agent version from manifest. + + Imports the provided manifest to create a new version for the specified agent. + + :param agent_name: The unique name that identifies the agent. Name can be used to + retrieve/update/delete the agent. + + * Must start and end with alphanumeric characters, + * Can contain hyphens in the middle + * Must not exceed 63 characters. Required. + :type agent_name: str + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentVersionDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_version_from_manifest( + self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AgentVersionDetails: + """Create an agent version from manifest. + + Imports the provided manifest to create a new version for the specified agent. + + :param agent_name: The unique name that identifies the agent. Name can be used to + retrieve/update/delete the agent. + + * Must start and end with alphanumeric characters, + * Can contain hyphens in the middle + * Must not exceed 63 characters. Required. + :type agent_name: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentVersionDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_version_from_manifest( + self, + agent_name: str, + body: Union[JSON, IO[bytes]] = _Unset, + *, + manifest_id: str = _Unset, + parameter_values: dict[str, Any] = _Unset, + metadata: Optional[dict[str, str]] = None, + description: Optional[str] = None, + **kwargs: Any + ) -> _models.AgentVersionDetails: + """Create an agent version from manifest. + + Imports the provided manifest to create a new version for the specified agent. + + :param agent_name: The unique name that identifies the agent. Name can be used to + retrieve/update/delete the agent. + + * Must start and end with alphanumeric characters, + * Can contain hyphens in the middle + * Must not exceed 63 characters. Required. + :type agent_name: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword manifest_id: The manifest ID to import the agent version from. Required. + :paramtype manifest_id: str + :keyword parameter_values: The inputs to the manifest that will result in a fully materialized + Agent. Required. + :paramtype parameter_values: dict[str, any] + :keyword 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. Default value is None. + :paramtype metadata: dict[str, str] + :keyword description: A human-readable description of the agent. Default value is None. + :paramtype description: str + :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentVersionDetails + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AgentVersionDetails] = kwargs.pop("cls", None) + + if body is _Unset: + if manifest_id is _Unset: + raise TypeError("missing required argument: manifest_id") + if parameter_values is _Unset: + raise TypeError("missing required argument: parameter_values") + body = { + "description": description, + "manifest_id": manifest_id, + "metadata": metadata, + "parameter_values": parameter_values, + } + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_agents_create_version_from_manifest_request( + agent_name=agent_name, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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.AgentVersionDetails, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_version(self, agent_name: str, agent_version: str, **kwargs: Any) -> _models.AgentVersionDetails: + """Get an agent version. + + Retrieves the specified version of an agent by its agent name and version identifier. + + :param agent_name: The name of the agent to retrieve. Required. + :type agent_name: str + :param agent_version: The version of the agent to retrieve. Required. + :type agent_version: str + :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentVersionDetails + :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.AgentVersionDetails] = kwargs.pop("cls", None) + + _request = build_agents_get_version_request( + agent_name=agent_name, + agent_version=agent_version, + 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.AgentVersionDetails, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete_version( + self, agent_name: str, agent_version: str, *, force: Optional[bool] = None, **kwargs: Any + ) -> _models.DeleteAgentVersionResponse: + """Delete an agent version. + + Deletes a specific version of an agent. For hosted agents, if the version has active sessions, + the request is rejected with HTTP 409 unless ``force`` is set to true. When force is true, all + sessions associated with this version are cascade-deleted. + + :param agent_name: The name of the agent to delete. Required. + :type agent_name: str + :param agent_version: The version of the agent to delete. Required. + :type agent_version: str + :keyword force: For Hosted Agents, if ``true``, force-deletes the version even if it has active + sessions, cascading deletion to all associated sessions. The service defaults to ``false`` if a + value is not specified by the caller. This value is not relevant for other Agent types. Default + value is None. + :paramtype force: bool + :return: DeleteAgentVersionResponse. The DeleteAgentVersionResponse is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.DeleteAgentVersionResponse + :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.DeleteAgentVersionResponse] = kwargs.pop("cls", None) + + _request = build_agents_delete_version_request( + agent_name=agent_name, + agent_version=agent_version, + force=force, + 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.DeleteAgentVersionResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_versions( + self, + agent_name: str, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + include_drafts: Optional[bool] = None, + **kwargs: Any + ) -> ItemPaged["_models.AgentVersionDetails"]: + """List agent versions. + + Returns a paged collection of versions for the specified agent. + + :param agent_name: The name of the agent to retrieve versions for. 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 + :keyword include_drafts: (Preview) Whether to include draft versions in the listing. The + service defaults to ``false`` if a value is not specified by the caller (only non-draft + versions are returned). Default value is None. + :paramtype include_drafts: bool + :return: An iterator like instance of AgentVersionDetails + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.AgentVersionDetails] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AgentVersionDetails]] = 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_agents_list_versions_request( + agent_name=agent_name, + limit=limit, + order=order, + after=_continuation_token, + before=before, + include_drafts=include_drafts, + 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.AgentVersionDetails], + 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) + + @overload + def update_details( + self, + agent_name: str, + *, + content_type: str = "application/merge-patch+json", + agent_endpoint: Optional[_models.AgentEndpointConfig] = None, + agent_card: Optional[_models.AgentCard] = None, + **kwargs: Any + ) -> _models.AgentDetails: + """Update an agent endpoint. + + Applies a merge-patch update to the specified agent endpoint configuration. + + :param agent_name: The name of the agent to retrieve. Required. + :type agent_name: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/merge-patch+json". + :paramtype content_type: str + :keyword agent_endpoint: The endpoint configuration for the agent. Default value is None. + :paramtype agent_endpoint: ~azure.ai.projects.models.AgentEndpointConfig + :keyword agent_card: Optional agent card for the agent. Default value is None. + :paramtype agent_card: ~azure.ai.projects.models.AgentCard + :return: AgentDetails. The AgentDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_details( + self, agent_name: str, body: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any + ) -> _models.AgentDetails: + """Update an agent endpoint. + + Applies a merge-patch update to the specified agent endpoint configuration. + + :param agent_name: The name of the agent to retrieve. Required. + :type agent_name: str + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/merge-patch+json". + :paramtype content_type: str + :return: AgentDetails. The AgentDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_details( + self, agent_name: str, body: IO[bytes], *, content_type: str = "application/merge-patch+json", **kwargs: Any + ) -> _models.AgentDetails: + """Update an agent endpoint. + + Applies a merge-patch update to the specified agent endpoint configuration. + + :param agent_name: The name of the agent to retrieve. Required. + :type agent_name: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/merge-patch+json". + :paramtype content_type: str + :return: AgentDetails. The AgentDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_details( + self, + agent_name: str, + body: Union[JSON, IO[bytes]] = _Unset, + *, + agent_endpoint: Optional[_models.AgentEndpointConfig] = None, + agent_card: Optional[_models.AgentCard] = None, + **kwargs: Any + ) -> _models.AgentDetails: + """Update an agent endpoint. + + Applies a merge-patch update to the specified agent endpoint configuration. + + :param agent_name: The name of the agent to retrieve. Required. + :type agent_name: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword agent_endpoint: The endpoint configuration for the agent. Default value is None. + :paramtype agent_endpoint: ~azure.ai.projects.models.AgentEndpointConfig + :keyword agent_card: Optional agent card for the agent. Default value is None. + :paramtype agent_card: ~azure.ai.projects.models.AgentCard + :return: AgentDetails. The AgentDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentDetails + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AgentDetails] = kwargs.pop("cls", None) + + if body is _Unset: + body = {"agent_card": agent_card, "agent_endpoint": agent_endpoint} + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/merge-patch+json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_agents_update_details_request( + agent_name=agent_name, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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.AgentDetails, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def _create_version_from_code( + self, + agent_name: str, + content: _models._models._CreateAgentVersionFromCodeContent, + *, + code_zip_sha256: str, + **kwargs: Any + ) -> _models.AgentVersionDetails: ... + @overload + def _create_version_from_code( + self, agent_name: str, content: JSON, *, code_zip_sha256: str, **kwargs: Any + ) -> _models.AgentVersionDetails: ... + + @distributed_trace + def _create_version_from_code( + self, + agent_name: str, + content: Union[_models._models._CreateAgentVersionFromCodeContent, JSON], + *, + code_zip_sha256: str, + **kwargs: Any + ) -> _models.AgentVersionDetails: + """Create an agent version from code. + + Creates a new agent version from code. Uploads the code zip and creates a new version for an + existing agent. The SHA-256 hex digest of the zip is provided in the ``x-ms-code-zip-sha256`` + header for integrity and dedup. The request body is multipart/form-data with a JSON metadata + part and a binary code part (part order is irrelevant). Maximum upload size is 250 MB. + + :param agent_name: The unique name that identifies the agent. Name can be used to + retrieve/update/delete the agent. + + * Must start and end with alphanumeric characters, + * Can contain hyphens in the middle + * Must not exceed 63 characters. Required. + :type agent_name: str + :param content: The content multipart request content. Is either a + _CreateAgentVersionFromCodeContent type or a JSON type. Required. + :type content: ~azure.ai.projects.models._models._CreateAgentVersionFromCodeContent or JSON + :keyword code_zip_sha256: SHA-256 hex digest of the uploaded code zip. Used for change + detection (dedup) and integrity verification. Required. + :paramtype code_zip_sha256: str + :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentVersionDetails + :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.AgentVersionDetails] = kwargs.pop("cls", None) + + _body = content.as_dict() if isinstance(content, _Model) else content + _file_fields: list[str] = ["code"] + _data_fields: list[str] = ["metadata"] + _files = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_agents_create_version_from_code_request( + agent_name=agent_name, + code_zip_sha256=code_zip_sha256, + api_version=self._config.api_version, + files=_files, + 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.AgentVersionDetails, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def download_code(self, agent_name: str, *, agent_version: Optional[str] = None, **kwargs: Any) -> Iterator[bytes]: + """Download agent code. + + Downloads the code zip for a code-based hosted agent. + Returns the previously-uploaded zip (``application/zip``). + + If ``agent_version`` is supplied, returns that version's code zip; otherwise + returns the latest version's code zip. + + The SHA-256 digest of the returned bytes matches the ``content_hash`` on the + resolved version's ``code_configuration``. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :keyword agent_version: The version of the agent whose code zip should be downloaded. + If omitted, the latest version's code zip is returned. Default value is None. + :paramtype agent_version: 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_agents_download_code_request( + agent_name=agent_name, + agent_version=agent_version, + 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["x-ms-agent-version"] = self._deserialize("str", response.headers.get("x-ms-agent-version")) + 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 enable(self, agent_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """Enable an agent. + + Enables the specified agent, allowing it to accept new sessions and process requests. This + operation is idempotent — enabling an already-enabled agent returns success with no side + effects. + + :param agent_name: The name of the agent to enable. Required. + :type agent_name: 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_agents_enable_request( + agent_name=agent_name, + 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 disable(self, agent_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """Disable an agent. + + Disables the specified agent, preventing it from accepting new sessions or processing requests. + Existing active sessions are allowed to drain gracefully but no new sessions can be created. + This operation is idempotent — disabling an already-disabled agent returns success with no side + effects. + + :param agent_name: The name of the agent to disable. Required. + :type agent_name: 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_agents_disable_request( + agent_name=agent_name, + 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 + + @overload + def create_session( + self, + agent_name: str, + *, + version_indicator: _models.VersionIndicator, + content_type: str = "application/json", + agent_session_id: Optional[str] = None, + **kwargs: Any + ) -> _models.AgentSessionResource: + """Create a session. + + Creates a new session for an agent endpoint. The endpoint resolves the backing agent version + from ``version_indicator`` and enforces session ownership using the provided user identity for + session-mutating operations. + + :param agent_name: The name of the agent to create a session for. Required. + :type agent_name: str + :keyword version_indicator: Determines which agent version backs the session. Required. + :paramtype version_indicator: ~azure.ai.projects.models.VersionIndicator + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword agent_session_id: Optional caller-provided session ID. If specified, it must be unique + within the agent endpoint. Auto-generated if omitted. Default value is None. + :paramtype agent_session_id: str + :return: AgentSessionResource. The AgentSessionResource is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentSessionResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_session( + self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AgentSessionResource: + """Create a session. + + Creates a new session for an agent endpoint. The endpoint resolves the backing agent version + from ``version_indicator`` and enforces session ownership using the provided user identity for + session-mutating operations. + + :param agent_name: The name of the agent to create a session for. Required. + :type agent_name: str + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AgentSessionResource. The AgentSessionResource is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentSessionResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_session( + self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AgentSessionResource: + """Create a session. + + Creates a new session for an agent endpoint. The endpoint resolves the backing agent version + from ``version_indicator`` and enforces session ownership using the provided user identity for + session-mutating operations. + + :param agent_name: The name of the agent to create a session for. Required. + :type agent_name: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AgentSessionResource. The AgentSessionResource is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentSessionResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_session( + self, + agent_name: str, + body: Union[JSON, IO[bytes]] = _Unset, + *, + version_indicator: _models.VersionIndicator = _Unset, + agent_session_id: Optional[str] = None, + **kwargs: Any + ) -> _models.AgentSessionResource: + """Create a session. + + Creates a new session for an agent endpoint. The endpoint resolves the backing agent version + from ``version_indicator`` and enforces session ownership using the provided user identity for + session-mutating operations. + + :param agent_name: The name of the agent to create a session for. Required. + :type agent_name: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword version_indicator: Determines which agent version backs the session. Required. + :paramtype version_indicator: ~azure.ai.projects.models.VersionIndicator + :keyword agent_session_id: Optional caller-provided session ID. If specified, it must be unique + within the agent endpoint. Auto-generated if omitted. Default value is None. + :paramtype agent_session_id: str + :return: AgentSessionResource. The AgentSessionResource is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentSessionResource + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AgentSessionResource] = kwargs.pop("cls", None) + + if body is _Unset: + if version_indicator is _Unset: + raise TypeError("missing required argument: version_indicator") + body = {"agent_session_id": agent_session_id, "version_indicator": version_indicator} + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_agents_create_session_request( + agent_name=agent_name, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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 [201]: + 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.AgentSessionResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_session(self, agent_name: str, session_id: str, **kwargs: Any) -> _models.AgentSessionResource: + """Get a session. + + Retrieves the details of a hosted agent session by agent name and session identifier. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param session_id: The session identifier. Required. + :type session_id: str + :return: AgentSessionResource. The AgentSessionResource is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentSessionResource + :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.AgentSessionResource] = kwargs.pop("cls", None) + + _request = build_agents_get_session_request( + agent_name=agent_name, + session_id=session_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.AgentSessionResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete_session( # pylint: disable=inconsistent-return-statements + self, agent_name: str, session_id: str, **kwargs: Any + ) -> None: + """Delete a session. + + Deletes a session synchronously. Returns 204 No Content when the session is deleted or does not + exist. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param session_id: The session identifier. Required. + :type session_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_agents_delete_session_request( + agent_name=agent_name, + session_id=session_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 stop_session( # pylint: disable=inconsistent-return-statements + self, agent_name: str, session_id: str, **kwargs: Any + ) -> None: + """Stop a session. + + Terminates the specified hosted agent session and returns 204 No Content when the request + succeeds. + + :param agent_name: The name of the agent. Required. :type agent_name: str - :keyword force: For Hosted Agents, if ``true``, force-deletes the agent even if its versions - have active sessions, cascading deletion to all associated sessions. The service defaults to - ``false`` if a value is not specified by the caller. This value is not relevant for other Agent - types. Default value is None. - :paramtype force: bool - :return: DeleteAgentResponse. The DeleteAgentResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DeleteAgentResponse + :param session_id: The session identifier. Required. + :type session_id: str + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4268,11 +6390,11 @@ def delete(self, agent_name: str, *, force: Optional[bool] = None, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DeleteAgentResponse] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_agents_delete_request( + _request = build_agents_stop_session_request( agent_name=agent_name, - force=force, + session_id=session_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4282,20 +6404,14 @@ def delete(self, agent_name: str, *, force: Optional[bool] = None, **kwargs: Any } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _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 + 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, @@ -4303,33 +6419,25 @@ def delete(self, agent_name: str, *, force: Optional[bool] = None, **kwargs: Any ) raise HttpResponseError(response=response, model=error) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.DeleteAgentResponse, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace - def list( + def list_sessions( self, + agent_name: str, *, - kind: Optional[Union[str, _models.AgentKind]] = None, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, before: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.AgentDetails"]: - """List agents. + ) -> ItemPaged["_models.AgentSessionResource"]: + """List sessions for an agent. - Returns a paged collection of agent resources. + Returns a paged collection of sessions associated with the specified agent endpoint. - :keyword kind: Filter agents by kind. If not provided, all agents are returned. Known values - are: "prompt", "hosted", "workflow", "external", and "voice". Default value is None. - :paramtype kind: str or ~azure.ai.projects.models.AgentKind + :param agent_name: The name of the 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. @@ -4344,14 +6452,14 @@ def list( 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 AgentDetails - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.AgentDetails] + :return: An iterator like instance of AgentSessionResource + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.AgentSessionResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.AgentDetails]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.AgentSessionResource]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4363,8 +6471,8 @@ def list( def prepare_request(_continuation_token=None): - _request = build_agents_list_request( - kind=kind, + _request = build_agents_list_sessions_request( + agent_name=agent_name, limit=limit, order=order, after=_continuation_token, @@ -4382,7 +6490,7 @@ def prepare_request(_continuation_token=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.AgentDetails], + List[_models.AgentSessionResource], deserialized.get("data", []), ) if cls: @@ -4410,154 +6518,375 @@ def get_next(_continuation_token=None): return ItemPaged(get_next, extract_data) + @distributed_trace + def get_session_log_stream( + self, agent_name: str, agent_version: str, session_id: str, **kwargs: Any + ) -> _models.SessionLogEvent: + """Stream console logs for a hosted agent session. + + Streams console logs (stdout / stderr) for a specific hosted agent session + as a Server-Sent Events (SSE) 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) + + Example SSE frames: + + .. code-block:: + + event: log + 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."} + + event: log + 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"} + + The stream remains open until the client disconnects or the server + terminates the connection. Clients should handle reconnection as needed. + + :param agent_name: The name of the hosted agent. Required. + :type agent_name: str + :param agent_version: The version of the agent. Required. + :type agent_version: str + :param session_id: The session ID (maps to an ADC sandbox). Required. + :type session_id: str + :return: SessionLogEvent. The SessionLogEvent is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.SessionLogEvent + :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.SessionLogEvent] = kwargs.pop("cls", None) + + _request = build_agents_get_session_log_stream_request( + agent_name=agent_name, + agent_version=agent_version, + session_id=session_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")) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SessionLogEvent, response.text()) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + @overload - def create_version( + def publish_to_microsoft365( self, agent_name: str, *, - definition: _models.AgentDefinition, + publish_scope: Union[str, _models.Microsoft365PublishScope], content_type: str = "application/json", - metadata: Optional[dict[str, str]] = None, - description: Optional[str] = None, - blueprint_reference: Optional[_models.AgentBlueprintReference] = None, - draft: Optional[bool] = None, + agent_display_name: Optional[str] = None, + bot_service_arm_id: Optional[str] = None, + publish_as_autopilot: Optional[bool] = None, + access_boundaries: Optional[List[Union[str, _models.ActivityProtocolAccessBoundary]]] = None, + optional_permission_scopes: Optional[List[_models.Microsoft365PermissionScopes]] = None, + can_respond_without_mention: Optional[bool] = None, + app_version: 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, + color_icon_base64: Optional[str] = None, + outline_icon_base64: Optional[str] = None, **kwargs: Any - ) -> _models.AgentVersionDetails: - """Create an agent version. - - Creates a new version for the specified agent and returns the created version resource. + ) -> _models.Microsoft365PublishResult: + """Publish an agent to Microsoft 365. - :param agent_name: The unique name that identifies the agent. Name can be used to - retrieve/update/delete the agent. + Publishes a Foundry agent to Microsoft 365 / Microsoft Teams and returns the published title + and Teams app ids. - * Must start and end with alphanumeric characters, - * Can contain hyphens in the middle - * Must not exceed 63 characters. Required. + :param agent_name: The name of the agent to publish. Required. :type agent_name: str - :keyword definition: The agent definition. This can be a prompt, workflow, hosted, external, or - voice agent definition. Required. - :paramtype definition: ~azure.ai.projects.models.AgentDefinition + :keyword publish_scope: Publish scope for the Teams app. Known values are: "Personal", + "Shared", and "Tenant". Required. + :paramtype publish_scope: str or ~azure.ai.projects.models.Microsoft365PublishScope :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword 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. Default value is None. - :paramtype metadata: dict[str, str] - :keyword description: A human-readable description of the agent. Default value is None. - :paramtype description: str - :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. - :paramtype blueprint_reference: ~azure.ai.projects.models.AgentBlueprintReference - :keyword draft: (Preview) Whether this agent version is a draft (candidate) rather than a - release. The service defaults to ``false`` if a value is not specified by the caller. Draft - versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. + :keyword agent_display_name: Display name used as the published Teams app name. When omitted, + the agent name from the route is + used. Default value is None. + :paramtype agent_display_name: str + :keyword bot_service_arm_id: ARM resource id of the Azure Bot Service that fronts this agent in + Microsoft Teams. Required for + workspaces on the default bot-based Teams backend; optional for workspaces on the API-based + backend. + Must not be supplied when ``publishAsAutopilot`` is true. Default value is None. + :paramtype bot_service_arm_id: str + :keyword publish_as_autopilot: When true, the agent is published as an autopilot (digital + worker) agent: the bot id is taken from + the agent's blueprint identity and the generated Teams manifest is marked as a digital worker. Default value is None. - :paramtype draft: bool - :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentVersionDetails + :paramtype publish_as_autopilot: bool + :keyword access_boundaries: Activity-protocol access boundaries to apply to the agent when + publishing as an autopilot agent. + An empty list clears the existing boundaries. When omitted, the existing boundaries are left + unchanged. Default value is None. + :paramtype access_boundaries: list[str or + ~azure.ai.projects.models.ActivityProtocolAccessBoundary] + :keyword optional_permission_scopes: Exact selection of delegated permission scopes to grant to + the autopilot blueprint. May only be + supplied when ``publishAsAutopilot`` is true. When omitted or empty, the platform's default + permission set is used. Mandatory platform permissions are always granted and are not affected + by + this value. Default value is None. + :paramtype optional_permission_scopes: + list[~azure.ai.projects.models.Microsoft365PermissionScopes] + :keyword can_respond_without_mention: Controls how the published agent responds to Teams + messages: when true it responds to all messages + on its surfaces, when false only when it is at-mentioned. When omitted, the agent's existing + Teams + message-notification setting is left unchanged. Default value is None. + :paramtype can_respond_without_mention: bool + :keyword app_version: App version (for example ``1.2.3``) written into the Teams manifest. May + contain only digits and + periods, must not start with ``0``, and must end with a digit. When omitted, a platform + default is + used. Default value is None. + :paramtype app_version: str + :keyword short_description: Short, one-line description shown in the Teams app listing. Default + value is None. + :paramtype short_description: str + :keyword full_description: Full description shown on the Teams app details page. Default value + is None. + :paramtype full_description: str + :keyword developer_name: Display name of the developer / publisher shown in the Teams app + listing. Default value is None. + :paramtype developer_name: str + :keyword developer_website_url: Developer / publisher website URL shown in the Teams app + listing. Must be an https URL. Default value is None. + :paramtype developer_website_url: str + :keyword privacy_url: Privacy policy URL shown in the Teams app listing. Must be an http or + https URL. Default value is None. + :paramtype privacy_url: str + :keyword terms_of_use_url: Terms-of-use URL shown in the Teams app listing. Default value is + None. + :paramtype terms_of_use_url: str + :keyword color_icon_base64: Optional base64-encoded PNG used as the color (full-bleed) icon in + the Teams app package. Must be a + 192x192 PNG (perfect square, no border or rounded corners). Max 1 MB after decode. When + omitted, the + platform default color icon is used. Default value is None. + :paramtype color_icon_base64: str + :keyword outline_icon_base64: Optional base64-encoded PNG used as the outline icon in the Teams + app package. Must be a 32x32 PNG. + Max 1 MB after decode. When omitted, the platform default outline icon is used. Default value + is None. + :paramtype outline_icon_base64: str + :return: Microsoft365PublishResult. The Microsoft365PublishResult is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.Microsoft365PublishResult :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_version( + def publish_to_microsoft365( self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.AgentVersionDetails: - """Create an agent version. + ) -> _models.Microsoft365PublishResult: + """Publish an agent to Microsoft 365. - Creates a new version for the specified agent and returns the created version resource. - - :param agent_name: The unique name that identifies the agent. Name can be used to - retrieve/update/delete the agent. + Publishes a Foundry agent to Microsoft 365 / Microsoft Teams and returns the published title + and Teams app ids. - * Must start and end with alphanumeric characters, - * Can contain hyphens in the middle - * Must not exceed 63 characters. Required. + :param agent_name: The name of the agent to publish. Required. :type agent_name: str :param body: Required. :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentVersionDetails + :return: Microsoft365PublishResult. The Microsoft365PublishResult is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.Microsoft365PublishResult :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_version( + def publish_to_microsoft365( self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.AgentVersionDetails: - """Create an agent version. - - Creates a new version for the specified agent and returns the created version resource. + ) -> _models.Microsoft365PublishResult: + """Publish an agent to Microsoft 365. - :param agent_name: The unique name that identifies the agent. Name can be used to - retrieve/update/delete the agent. + Publishes a Foundry agent to Microsoft 365 / Microsoft Teams and returns the published title + and Teams app ids. - * Must start and end with alphanumeric characters, - * Can contain hyphens in the middle - * Must not exceed 63 characters. Required. + :param agent_name: The name of the agent to publish. Required. :type agent_name: str :param body: Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentVersionDetails + :return: Microsoft365PublishResult. The Microsoft365PublishResult is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.Microsoft365PublishResult :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def create_version( + def publish_to_microsoft365( # pylint: disable=too-many-locals self, agent_name: str, body: Union[JSON, IO[bytes]] = _Unset, *, - definition: _models.AgentDefinition = _Unset, - metadata: Optional[dict[str, str]] = None, - description: Optional[str] = None, - blueprint_reference: Optional[_models.AgentBlueprintReference] = None, - draft: Optional[bool] = None, + publish_scope: Union[str, _models.Microsoft365PublishScope] = _Unset, + agent_display_name: Optional[str] = None, + bot_service_arm_id: Optional[str] = None, + publish_as_autopilot: Optional[bool] = None, + access_boundaries: Optional[List[Union[str, _models.ActivityProtocolAccessBoundary]]] = None, + optional_permission_scopes: Optional[List[_models.Microsoft365PermissionScopes]] = None, + can_respond_without_mention: Optional[bool] = None, + app_version: 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, + color_icon_base64: Optional[str] = None, + outline_icon_base64: Optional[str] = None, **kwargs: Any - ) -> _models.AgentVersionDetails: - """Create an agent version. - - Creates a new version for the specified agent and returns the created version resource. - - :param agent_name: The unique name that identifies the agent. Name can be used to - retrieve/update/delete the agent. + ) -> _models.Microsoft365PublishResult: + """Publish an agent to Microsoft 365. - * Must start and end with alphanumeric characters, - * Can contain hyphens in the middle - * Must not exceed 63 characters. Required. + Publishes a Foundry agent to Microsoft 365 / Microsoft Teams and returns the published title + and Teams app ids. + + :param agent_name: The name of the agent to publish. Required. :type agent_name: str :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] - :keyword definition: The agent definition. This can be a prompt, workflow, hosted, external, or - voice agent definition. Required. - :paramtype definition: ~azure.ai.projects.models.AgentDefinition - :keyword 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. Default value is None. - :paramtype metadata: dict[str, str] - :keyword description: A human-readable description of the agent. Default value is None. - :paramtype description: str - :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. - :paramtype blueprint_reference: ~azure.ai.projects.models.AgentBlueprintReference - :keyword draft: (Preview) Whether this agent version is a draft (candidate) rather than a - release. The service defaults to ``false`` if a value is not specified by the caller. Draft - versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. + :keyword publish_scope: Publish scope for the Teams app. Known values are: "Personal", + "Shared", and "Tenant". Required. + :paramtype publish_scope: str or ~azure.ai.projects.models.Microsoft365PublishScope + :keyword agent_display_name: Display name used as the published Teams app name. When omitted, + the agent name from the route is + used. Default value is None. + :paramtype agent_display_name: str + :keyword bot_service_arm_id: ARM resource id of the Azure Bot Service that fronts this agent in + Microsoft Teams. Required for + workspaces on the default bot-based Teams backend; optional for workspaces on the API-based + backend. + Must not be supplied when ``publishAsAutopilot`` is true. Default value is None. + :paramtype bot_service_arm_id: str + :keyword publish_as_autopilot: When true, the agent is published as an autopilot (digital + worker) agent: the bot id is taken from + the agent's blueprint identity and the generated Teams manifest is marked as a digital worker. Default value is None. - :paramtype draft: bool - :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentVersionDetails + :paramtype publish_as_autopilot: bool + :keyword access_boundaries: Activity-protocol access boundaries to apply to the agent when + publishing as an autopilot agent. + An empty list clears the existing boundaries. When omitted, the existing boundaries are left + unchanged. Default value is None. + :paramtype access_boundaries: list[str or + ~azure.ai.projects.models.ActivityProtocolAccessBoundary] + :keyword optional_permission_scopes: Exact selection of delegated permission scopes to grant to + the autopilot blueprint. May only be + supplied when ``publishAsAutopilot`` is true. When omitted or empty, the platform's default + permission set is used. Mandatory platform permissions are always granted and are not affected + by + this value. Default value is None. + :paramtype optional_permission_scopes: + list[~azure.ai.projects.models.Microsoft365PermissionScopes] + :keyword can_respond_without_mention: Controls how the published agent responds to Teams + messages: when true it responds to all messages + on its surfaces, when false only when it is at-mentioned. When omitted, the agent's existing + Teams + message-notification setting is left unchanged. Default value is None. + :paramtype can_respond_without_mention: bool + :keyword app_version: App version (for example ``1.2.3``) written into the Teams manifest. May + contain only digits and + periods, must not start with ``0``, and must end with a digit. When omitted, a platform + default is + used. Default value is None. + :paramtype app_version: str + :keyword short_description: Short, one-line description shown in the Teams app listing. Default + value is None. + :paramtype short_description: str + :keyword full_description: Full description shown on the Teams app details page. Default value + is None. + :paramtype full_description: str + :keyword developer_name: Display name of the developer / publisher shown in the Teams app + listing. Default value is None. + :paramtype developer_name: str + :keyword developer_website_url: Developer / publisher website URL shown in the Teams app + listing. Must be an https URL. Default value is None. + :paramtype developer_website_url: str + :keyword privacy_url: Privacy policy URL shown in the Teams app listing. Must be an http or + https URL. Default value is None. + :paramtype privacy_url: str + :keyword terms_of_use_url: Terms-of-use URL shown in the Teams app listing. Default value is + None. + :paramtype terms_of_use_url: str + :keyword color_icon_base64: Optional base64-encoded PNG used as the color (full-bleed) icon in + the Teams app package. Must be a + 192x192 PNG (perfect square, no border or rounded corners). Max 1 MB after decode. When + omitted, the + platform default color icon is used. Default value is None. + :paramtype color_icon_base64: str + :keyword outline_icon_base64: Optional base64-encoded PNG used as the outline icon in the Teams + app package. Must be a 32x32 PNG. + Max 1 MB after decode. When omitted, the platform default outline icon is used. Default value + is None. + :paramtype outline_icon_base64: str + :return: Microsoft365PublishResult. The Microsoft365PublishResult is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.Microsoft365PublishResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4572,17 +6901,28 @@ def create_version( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AgentVersionDetails] = kwargs.pop("cls", None) + cls: ClsType[_models.Microsoft365PublishResult] = kwargs.pop("cls", None) if body is _Unset: - if definition is _Unset: - raise TypeError("missing required argument: definition") + if publish_scope is _Unset: + raise TypeError("missing required argument: publish_scope") body = { - "blueprint_reference": blueprint_reference, - "definition": definition, - "description": description, - "draft": draft, - "metadata": metadata, + "accessBoundaries": access_boundaries, + "agentDisplayName": agent_display_name, + "appVersion": app_version, + "botServiceArmId": bot_service_arm_id, + "canRespondWithoutMention": can_respond_without_mention, + "colorIconBase64": color_icon_base64, + "developerName": developer_name, + "developerWebsiteUrl": developer_website_url, + "fullDescription": full_description, + "optionalPermissionScopes": optional_permission_scopes, + "outlineIconBase64": outline_icon_base64, + "privacyUrl": privacy_url, + "publishAsAutopilot": publish_as_autopilot, + "publishScope": publish_scope, + "shortDescription": short_description, + "termsOfUseUrl": terms_of_use_url, } body = {k: v for k, v in body.items() if v is not None} content_type = content_type or "application/json" @@ -4592,7 +6932,7 @@ def create_version( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_agents_create_version_request( + _request = build_agents_publish_to_microsoft365_request( agent_name=agent_name, content_type=content_type, api_version=self._config.api_version, @@ -4629,7 +6969,7 @@ def create_version( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.AgentVersionDetails, response.json()) + deserialized = _deserialize(_models.Microsoft365PublishResult, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4637,141 +6977,267 @@ def create_version( return deserialized # type: ignore @overload - def create_version_from_manifest( + def get_microsoft365_package( self, agent_name: str, *, - manifest_id: str, - parameter_values: dict[str, Any], + publish_scope: Union[str, _models.Microsoft365PublishScope], content_type: str = "application/json", - metadata: Optional[dict[str, str]] = None, - description: Optional[str] = None, + agent_display_name: Optional[str] = None, + bot_service_arm_id: Optional[str] = None, + publish_as_autopilot: Optional[bool] = None, + access_boundaries: Optional[List[Union[str, _models.ActivityProtocolAccessBoundary]]] = None, + optional_permission_scopes: Optional[List[_models.Microsoft365PermissionScopes]] = None, + can_respond_without_mention: Optional[bool] = None, + app_version: 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, + color_icon_base64: Optional[str] = None, + outline_icon_base64: Optional[str] = None, **kwargs: Any - ) -> _models.AgentVersionDetails: - """Create an agent version from manifest. - - Imports the provided manifest to create a new version for the specified agent. + ) -> Iterator[bytes]: + """Generate a Microsoft 365 app package. - :param agent_name: The unique name that identifies the agent. Name can be used to - retrieve/update/delete the agent. + Generates the Microsoft Teams app package (zip) for a Foundry agent from the supplied publish + request, without publishing it. Returns the app package as ``application/zip``. - * Must start and end with alphanumeric characters, - * Can contain hyphens in the middle - * Must not exceed 63 characters. Required. + :param agent_name: The name of the agent to generate the app package for. Required. :type agent_name: str - :keyword manifest_id: The manifest ID to import the agent version from. Required. - :paramtype manifest_id: str - :keyword parameter_values: The inputs to the manifest that will result in a fully materialized - Agent. Required. - :paramtype parameter_values: dict[str, any] + :keyword publish_scope: Publish scope for the Teams app. Known values are: "Personal", + "Shared", and "Tenant". Required. + :paramtype publish_scope: str or ~azure.ai.projects.models.Microsoft365PublishScope :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword 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. Default value is None. - :paramtype metadata: dict[str, str] - :keyword description: A human-readable description of the agent. Default value is None. - :paramtype description: str - :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentVersionDetails + :keyword agent_display_name: Display name used as the published Teams app name. When omitted, + the agent name from the route is + used. Default value is None. + :paramtype agent_display_name: str + :keyword bot_service_arm_id: ARM resource id of the Azure Bot Service that fronts this agent in + Microsoft Teams. Required for + workspaces on the default bot-based Teams backend; optional for workspaces on the API-based + backend. + Must not be supplied when ``publishAsAutopilot`` is true. Default value is None. + :paramtype bot_service_arm_id: str + :keyword publish_as_autopilot: When true, the agent is published as an autopilot (digital + worker) agent: the bot id is taken from + the agent's blueprint identity and the generated Teams manifest is marked as a digital worker. + Default value is None. + :paramtype publish_as_autopilot: bool + :keyword access_boundaries: Activity-protocol access boundaries to apply to the agent when + publishing as an autopilot agent. + An empty list clears the existing boundaries. When omitted, the existing boundaries are left + unchanged. Default value is None. + :paramtype access_boundaries: list[str or + ~azure.ai.projects.models.ActivityProtocolAccessBoundary] + :keyword optional_permission_scopes: Exact selection of delegated permission scopes to grant to + the autopilot blueprint. May only be + supplied when ``publishAsAutopilot`` is true. When omitted or empty, the platform's default + permission set is used. Mandatory platform permissions are always granted and are not affected + by + this value. Default value is None. + :paramtype optional_permission_scopes: + list[~azure.ai.projects.models.Microsoft365PermissionScopes] + :keyword can_respond_without_mention: Controls how the published agent responds to Teams + messages: when true it responds to all messages + on its surfaces, when false only when it is at-mentioned. When omitted, the agent's existing + Teams + message-notification setting is left unchanged. Default value is None. + :paramtype can_respond_without_mention: bool + :keyword app_version: App version (for example ``1.2.3``) written into the Teams manifest. May + contain only digits and + periods, must not start with ``0``, and must end with a digit. When omitted, a platform + default is + used. Default value is None. + :paramtype app_version: str + :keyword short_description: Short, one-line description shown in the Teams app listing. Default + value is None. + :paramtype short_description: str + :keyword full_description: Full description shown on the Teams app details page. Default value + is None. + :paramtype full_description: str + :keyword developer_name: Display name of the developer / publisher shown in the Teams app + listing. Default value is None. + :paramtype developer_name: str + :keyword developer_website_url: Developer / publisher website URL shown in the Teams app + listing. Must be an https URL. Default value is None. + :paramtype developer_website_url: str + :keyword privacy_url: Privacy policy URL shown in the Teams app listing. Must be an http or + https URL. Default value is None. + :paramtype privacy_url: str + :keyword terms_of_use_url: Terms-of-use URL shown in the Teams app listing. Default value is + None. + :paramtype terms_of_use_url: str + :keyword color_icon_base64: Optional base64-encoded PNG used as the color (full-bleed) icon in + the Teams app package. Must be a + 192x192 PNG (perfect square, no border or rounded corners). Max 1 MB after decode. When + omitted, the + platform default color icon is used. Default value is None. + :paramtype color_icon_base64: str + :keyword outline_icon_base64: Optional base64-encoded PNG used as the outline icon in the Teams + app package. Must be a 32x32 PNG. + Max 1 MB after decode. When omitted, the platform default outline icon is used. Default value + is None. + :paramtype outline_icon_base64: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_version_from_manifest( + def get_microsoft365_package( self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.AgentVersionDetails: - """Create an agent version from manifest. - - Imports the provided manifest to create a new version for the specified agent. + ) -> Iterator[bytes]: + """Generate a Microsoft 365 app package. - :param agent_name: The unique name that identifies the agent. Name can be used to - retrieve/update/delete the agent. + Generates the Microsoft Teams app package (zip) for a Foundry agent from the supplied publish + request, without publishing it. Returns the app package as ``application/zip``. - * Must start and end with alphanumeric characters, - * Can contain hyphens in the middle - * Must not exceed 63 characters. Required. + :param agent_name: The name of the agent to generate the app package for. Required. :type agent_name: str :param body: Required. :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentVersionDetails + :return: Iterator[bytes] + :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_version_from_manifest( + def get_microsoft365_package( self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.AgentVersionDetails: - """Create an agent version from manifest. - - Imports the provided manifest to create a new version for the specified agent. + ) -> Iterator[bytes]: + """Generate a Microsoft 365 app package. - :param agent_name: The unique name that identifies the agent. Name can be used to - retrieve/update/delete the agent. + Generates the Microsoft Teams app package (zip) for a Foundry agent from the supplied publish + request, without publishing it. Returns the app package as ``application/zip``. - * Must start and end with alphanumeric characters, - * Can contain hyphens in the middle - * Must not exceed 63 characters. Required. + :param agent_name: The name of the agent to generate the app package for. Required. :type agent_name: str :param body: Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentVersionDetails + :return: Iterator[bytes] + :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def create_version_from_manifest( + def get_microsoft365_package( # pylint: disable=too-many-locals self, agent_name: str, body: Union[JSON, IO[bytes]] = _Unset, *, - manifest_id: str = _Unset, - parameter_values: dict[str, Any] = _Unset, - metadata: Optional[dict[str, str]] = None, - description: Optional[str] = None, + publish_scope: Union[str, _models.Microsoft365PublishScope] = _Unset, + agent_display_name: Optional[str] = None, + bot_service_arm_id: Optional[str] = None, + publish_as_autopilot: Optional[bool] = None, + access_boundaries: Optional[List[Union[str, _models.ActivityProtocolAccessBoundary]]] = None, + optional_permission_scopes: Optional[List[_models.Microsoft365PermissionScopes]] = None, + can_respond_without_mention: Optional[bool] = None, + app_version: 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, + color_icon_base64: Optional[str] = None, + outline_icon_base64: Optional[str] = None, **kwargs: Any - ) -> _models.AgentVersionDetails: - """Create an agent version from manifest. - - Imports the provided manifest to create a new version for the specified agent. + ) -> Iterator[bytes]: + """Generate a Microsoft 365 app package. - :param agent_name: The unique name that identifies the agent. Name can be used to - retrieve/update/delete the agent. + Generates the Microsoft Teams app package (zip) for a Foundry agent from the supplied publish + request, without publishing it. Returns the app package as ``application/zip``. - * Must start and end with alphanumeric characters, - * Can contain hyphens in the middle - * Must not exceed 63 characters. Required. + :param agent_name: The name of the agent to generate the app package for. Required. :type agent_name: str :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] - :keyword manifest_id: The manifest ID to import the agent version from. Required. - :paramtype manifest_id: str - :keyword parameter_values: The inputs to the manifest that will result in a fully materialized - Agent. Required. - :paramtype parameter_values: dict[str, any] - :keyword 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. Default value is None. - :paramtype metadata: dict[str, str] - :keyword description: A human-readable description of the agent. Default value is None. - :paramtype description: str - :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentVersionDetails + :keyword publish_scope: Publish scope for the Teams app. Known values are: "Personal", + "Shared", and "Tenant". Required. + :paramtype publish_scope: str or ~azure.ai.projects.models.Microsoft365PublishScope + :keyword agent_display_name: Display name used as the published Teams app name. When omitted, + the agent name from the route is + used. Default value is None. + :paramtype agent_display_name: str + :keyword bot_service_arm_id: ARM resource id of the Azure Bot Service that fronts this agent in + Microsoft Teams. Required for + workspaces on the default bot-based Teams backend; optional for workspaces on the API-based + backend. + Must not be supplied when ``publishAsAutopilot`` is true. Default value is None. + :paramtype bot_service_arm_id: str + :keyword publish_as_autopilot: When true, the agent is published as an autopilot (digital + worker) agent: the bot id is taken from + the agent's blueprint identity and the generated Teams manifest is marked as a digital worker. + Default value is None. + :paramtype publish_as_autopilot: bool + :keyword access_boundaries: Activity-protocol access boundaries to apply to the agent when + publishing as an autopilot agent. + An empty list clears the existing boundaries. When omitted, the existing boundaries are left + unchanged. Default value is None. + :paramtype access_boundaries: list[str or + ~azure.ai.projects.models.ActivityProtocolAccessBoundary] + :keyword optional_permission_scopes: Exact selection of delegated permission scopes to grant to + the autopilot blueprint. May only be + supplied when ``publishAsAutopilot`` is true. When omitted or empty, the platform's default + permission set is used. Mandatory platform permissions are always granted and are not affected + by + this value. Default value is None. + :paramtype optional_permission_scopes: + list[~azure.ai.projects.models.Microsoft365PermissionScopes] + :keyword can_respond_without_mention: Controls how the published agent responds to Teams + messages: when true it responds to all messages + on its surfaces, when false only when it is at-mentioned. When omitted, the agent's existing + Teams + message-notification setting is left unchanged. Default value is None. + :paramtype can_respond_without_mention: bool + :keyword app_version: App version (for example ``1.2.3``) written into the Teams manifest. May + contain only digits and + periods, must not start with ``0``, and must end with a digit. When omitted, a platform + default is + used. Default value is None. + :paramtype app_version: str + :keyword short_description: Short, one-line description shown in the Teams app listing. Default + value is None. + :paramtype short_description: str + :keyword full_description: Full description shown on the Teams app details page. Default value + is None. + :paramtype full_description: str + :keyword developer_name: Display name of the developer / publisher shown in the Teams app + listing. Default value is None. + :paramtype developer_name: str + :keyword developer_website_url: Developer / publisher website URL shown in the Teams app + listing. Must be an https URL. Default value is None. + :paramtype developer_website_url: str + :keyword privacy_url: Privacy policy URL shown in the Teams app listing. Must be an http or + https URL. Default value is None. + :paramtype privacy_url: str + :keyword terms_of_use_url: Terms-of-use URL shown in the Teams app listing. Default value is + None. + :paramtype terms_of_use_url: str + :keyword color_icon_base64: Optional base64-encoded PNG used as the color (full-bleed) icon in + the Teams app package. Must be a + 192x192 PNG (perfect square, no border or rounded corners). Max 1 MB after decode. When + omitted, the + platform default color icon is used. Default value is None. + :paramtype color_icon_base64: str + :keyword outline_icon_base64: Optional base64-encoded PNG used as the outline icon in the Teams + app package. Must be a 32x32 PNG. + Max 1 MB after decode. When omitted, the platform default outline icon is used. Default value + is None. + :paramtype outline_icon_base64: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4786,18 +7252,28 @@ def create_version_from_manifest( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AgentVersionDetails] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) if body is _Unset: - if manifest_id is _Unset: - raise TypeError("missing required argument: manifest_id") - if parameter_values is _Unset: - raise TypeError("missing required argument: parameter_values") + if publish_scope is _Unset: + raise TypeError("missing required argument: publish_scope") body = { - "description": description, - "manifest_id": manifest_id, - "metadata": metadata, - "parameter_values": parameter_values, + "accessBoundaries": access_boundaries, + "agentDisplayName": agent_display_name, + "appVersion": app_version, + "botServiceArmId": bot_service_arm_id, + "canRespondWithoutMention": can_respond_without_mention, + "colorIconBase64": color_icon_base64, + "developerName": developer_name, + "developerWebsiteUrl": developer_website_url, + "fullDescription": full_description, + "optionalPermissionScopes": optional_permission_scopes, + "outlineIconBase64": outline_icon_base64, + "privacyUrl": privacy_url, + "publishAsAutopilot": publish_as_autopilot, + "publishScope": publish_scope, + "shortDescription": short_description, + "termsOfUseUrl": terms_of_use_url, } body = {k: v for k, v in body.items() if v is not None} content_type = content_type or "application/json" @@ -4807,7 +7283,7 @@ def create_version_from_manifest( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_agents_create_version_from_manifest_request( + _request = build_agents_get_microsoft365_package_request( agent_name=agent_name, content_type=content_type, api_version=self._config.api_version, @@ -4820,6 +7296,81 @@ def create_version_from_manifest( } _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_microsoft365_publish_defaults( + self, agent_name: str, *, publish_as_digital_worker: Optional[bool] = None, **kwargs: Any + ) -> _models.Microsoft365PublishDefaults: + """Get Microsoft 365 publish defaults. + + Returns default and previously-published values used to pre-populate a Microsoft 365 publish + request for a Foundry agent. + + :param agent_name: The name of the agent to get publish defaults for. Required. + :type agent_name: str + :keyword publish_as_digital_worker: When true, returns defaults for publishing the agent as an + autopilot (digital worker) agent. Default value is None. + :paramtype publish_as_digital_worker: bool + :return: Microsoft365PublishDefaults. The Microsoft365PublishDefaults is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.Microsoft365PublishDefaults + :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.Microsoft365PublishDefaults] = kwargs.pop("cls", None) + + _request = build_agents_get_microsoft365_publish_defaults_request( + agent_name=agent_name, + publish_as_digital_worker=publish_as_digital_worker, + 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 @@ -4844,25 +7395,99 @@ def create_version_from_manifest( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.AgentVersionDetails, response.json()) + deserialized = _deserialize(_models.Microsoft365PublishDefaults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def upload_session_file( + self, + agent_name: str, + session_id: str, + content: bytes, + *, + path: str, + content_type: str = "application/octet-stream", + **kwargs: Any + ) -> _models.SessionFileWriteResult: + """Upload a session file. + + Uploads binary file content to the specified path in the session sandbox. The service stores + the file relative to the session home directory and rejects payloads larger than 50 MB. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param session_id: The session ID. Required. + :type session_id: str + :param content: Required. + :type content: bytes + :keyword path: The destination file path within the sandbox, relative to the session home + directory. Required. + :paramtype path: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/octet-stream". + :paramtype content_type: str + :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.SessionFileWriteResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def upload_session_file( + self, + agent_name: str, + session_id: str, + content: IO[bytes], + *, + path: str, + content_type: str = "application/octet-stream", + **kwargs: Any + ) -> _models.SessionFileWriteResult: + """Upload a session file. - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + Uploads binary file content to the specified path in the session sandbox. The service stores + the file relative to the session home directory and rejects payloads larger than 50 MB. - return deserialized # type: ignore + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param session_id: The session ID. Required. + :type session_id: str + :param content: Required. + :type content: IO[bytes] + :keyword path: The destination file path within the sandbox, relative to the session home + directory. Required. + :paramtype path: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/octet-stream". + :paramtype content_type: str + :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.SessionFileWriteResult + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace - def get_version(self, agent_name: str, agent_version: str, **kwargs: Any) -> _models.AgentVersionDetails: - """Get an agent version. + def upload_session_file( + self, agent_name: str, session_id: str, content: Union[bytes, IO[bytes]], *, path: str, **kwargs: Any + ) -> _models.SessionFileWriteResult: + """Upload a session file. - Retrieves the specified version of an agent by its agent name and version identifier. + Uploads binary file content to the specified path in the session sandbox. The service stores + the file relative to the session home directory and rejects payloads larger than 50 MB. - :param agent_name: The name of the agent to retrieve. Required. + :param agent_name: The name of the agent. Required. :type agent_name: str - :param agent_version: The version of the agent to retrieve. Required. - :type agent_version: str - :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentVersionDetails + :param session_id: The session ID. Required. + :type session_id: str + :param content: Is either a bytes type or a IO[bytes] type. Required. + :type content: bytes or IO[bytes] + :keyword path: The destination file path within the sandbox, relative to the session home + directory. Required. + :paramtype path: str + :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.SessionFileWriteResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4873,15 +7498,22 @@ def get_version(self, agent_name: str, agent_version: str, **kwargs: Any) -> _mo } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.AgentVersionDetails] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SessionFileWriteResult] = kwargs.pop("cls", None) - _request = build_agents_get_version_request( + content_type = content_type or "application/octet-stream" + _content = content + + _request = build_agents_upload_session_file_request( agent_name=agent_name, - agent_version=agent_version, + session_id=session_id, + path=path, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -4898,7 +7530,7 @@ def get_version(self, agent_name: str, agent_version: str, **kwargs: Any) -> _mo response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [201]: if _stream: try: response.read() # Load the body in memory and close the socket @@ -4914,7 +7546,7 @@ def get_version(self, agent_name: str, agent_version: str, **kwargs: Any) -> _mo if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.AgentVersionDetails, response.json()) + deserialized = _deserialize(_models.SessionFileWriteResult, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4922,27 +7554,21 @@ def get_version(self, agent_name: str, agent_version: str, **kwargs: Any) -> _mo return deserialized # type: ignore @distributed_trace - def delete_version( - self, agent_name: str, agent_version: str, *, force: Optional[bool] = None, **kwargs: Any - ) -> _models.DeleteAgentVersionResponse: - """Delete an agent version. + def download_session_file(self, agent_name: str, session_id: str, *, path: str, **kwargs: Any) -> Iterator[bytes]: + """Download a session file. - Deletes a specific version of an agent. For hosted agents, if the version has active sessions, - the request is rejected with HTTP 409 unless ``force`` is set to true. When force is true, all - sessions associated with this version are cascade-deleted. + Downloads the file at the specified sandbox path as a binary stream. The path is resolved + relative to the session home directory. - :param agent_name: The name of the agent to delete. Required. + :param agent_name: The name of the agent. Required. :type agent_name: str - :param agent_version: The version of the agent to delete. Required. - :type agent_version: str - :keyword force: For Hosted Agents, if ``true``, force-deletes the version even if it has active - sessions, cascading deletion to all associated sessions. The service defaults to ``false`` if a - value is not specified by the caller. This value is not relevant for other Agent types. Default - value is None. - :paramtype force: bool - :return: DeleteAgentVersionResponse. The DeleteAgentVersionResponse is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.DeleteAgentVersionResponse + :param session_id: The session ID. Required. + :type session_id: str + :keyword path: The file path to download from the sandbox, relative to the session home + directory. Required. + :paramtype path: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4956,12 +7582,12 @@ def delete_version( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DeleteAgentVersionResponse] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_agents_delete_version_request( + _request = build_agents_download_session_file_request( agent_name=agent_name, - agent_version=agent_version, - force=force, + session_id=session_id, + path=path, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4972,7 +7598,7 @@ def delete_version( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = kwargs.pop("stream", True) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -4992,10 +7618,7 @@ def delete_version( ) raise HttpResponseError(response=response, model=error) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.DeleteAgentVersionResponse, response.json()) + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -5003,22 +7626,30 @@ def delete_version( return deserialized # type: ignore @distributed_trace - def list_versions( + def list_session_files( self, agent_name: str, + session_id: str, *, + path: Optional[str] = None, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, before: Optional[str] = None, - include_drafts: Optional[bool] = None, **kwargs: Any - ) -> ItemPaged["_models.AgentVersionDetails"]: - """List agent versions. + ) -> ItemPaged["_models.SessionDirectoryEntry"]: + """List session files. - Returns a paged collection of versions for the specified agent. + Returns files and directories at the specified path in the session sandbox. The response + includes only the immediate children of the target directory and defaults to the session home + directory when no path is supplied. - :param agent_name: The name of the agent to retrieve versions for. Required. + :param agent_name: The name of the agent. Required. :type agent_name: str + :param session_id: The session ID. Required. + :type session_id: str + :keyword path: The directory path to list, relative to the session home directory. Defaults to + the home directory if not provided. Default value is None. + :paramtype path: 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. @@ -5033,18 +7664,14 @@ def list_versions( subsequent call can include before=obj_foo in order to fetch the previous page of the list. Default value is None. :paramtype before: str - :keyword include_drafts: (Preview) Whether to include draft versions in the listing. The - service defaults to ``false`` if a value is not specified by the caller (only non-draft - versions are returned). Default value is None. - :paramtype include_drafts: bool - :return: An iterator like instance of AgentVersionDetails - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.AgentVersionDetails] + :return: An iterator like instance of SessionDirectoryEntry + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.SessionDirectoryEntry] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.AgentVersionDetails]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.SessionDirectoryEntry]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5056,13 +7683,14 @@ def list_versions( def prepare_request(_continuation_token=None): - _request = build_agents_list_versions_request( + _request = build_agents_list_session_files_request( agent_name=agent_name, + session_id=session_id, + path=path, limit=limit, order=order, after=_continuation_token, before=before, - include_drafts=include_drafts, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5076,8 +7704,8 @@ def prepare_request(_continuation_token=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.AgentVersionDetails], - deserialized.get("data", []), + List[_models.SessionDirectoryEntry], + deserialized.get("entries", []), ) if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -5104,98 +7732,27 @@ def get_next(_continuation_token=None): return ItemPaged(get_next, extract_data) - @overload - def update_details( - self, - agent_name: str, - *, - content_type: str = "application/merge-patch+json", - agent_endpoint: Optional[_models.AgentEndpointConfig] = None, - agent_card: Optional[_models.AgentCard] = None, - **kwargs: Any - ) -> _models.AgentDetails: - """Update an agent endpoint. - - Applies a merge-patch update to the specified agent endpoint configuration. - - :param agent_name: The name of the agent to retrieve. Required. - :type agent_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/merge-patch+json". - :paramtype content_type: str - :keyword agent_endpoint: The endpoint configuration for the agent. Default value is None. - :paramtype agent_endpoint: ~azure.ai.projects.models.AgentEndpointConfig - :keyword agent_card: Optional agent card for the agent. Default value is None. - :paramtype agent_card: ~azure.ai.projects.models.AgentCard - :return: AgentDetails. The AgentDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update_details( - self, agent_name: str, body: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> _models.AgentDetails: - """Update an agent endpoint. - - Applies a merge-patch update to the specified agent endpoint configuration. - - :param agent_name: The name of the agent to retrieve. Required. - :type agent_name: str - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/merge-patch+json". - :paramtype content_type: str - :return: AgentDetails. The AgentDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update_details( - self, agent_name: str, body: IO[bytes], *, content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> _models.AgentDetails: - """Update an agent endpoint. - - Applies a merge-patch update to the specified agent endpoint configuration. - - :param agent_name: The name of the agent to retrieve. Required. - :type agent_name: str - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/merge-patch+json". - :paramtype content_type: str - :return: AgentDetails. The AgentDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace - def update_details( - self, - agent_name: str, - body: Union[JSON, IO[bytes]] = _Unset, - *, - agent_endpoint: Optional[_models.AgentEndpointConfig] = None, - agent_card: Optional[_models.AgentCard] = None, - **kwargs: Any - ) -> _models.AgentDetails: - """Update an agent endpoint. + def delete_session_file( # pylint: disable=inconsistent-return-statements + self, agent_name: str, session_id: str, *, path: str, recursive: Optional[bool] = None, **kwargs: Any + ) -> None: + """Delete a session file. - Applies a merge-patch update to the specified agent endpoint configuration. + Deletes the specified file or directory from the session sandbox. When ``recursive`` is false, + deleting a non-empty directory returns 409 Conflict. - :param agent_name: The name of the agent to retrieve. Required. + :param agent_name: The name of the agent. Required. :type agent_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword agent_endpoint: The endpoint configuration for the agent. Default value is None. - :paramtype agent_endpoint: ~azure.ai.projects.models.AgentEndpointConfig - :keyword agent_card: Optional agent card for the agent. Default value is None. - :paramtype agent_card: ~azure.ai.projects.models.AgentCard - :return: AgentDetails. The AgentDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentDetails + :param session_id: The session ID. Required. + :type session_id: str + :keyword path: The file or directory path to delete, relative to the session home directory. + Required. + :paramtype path: str + :keyword recursive: Whether to recursively delete directory contents. The service defaults to + ``false`` if a value is not specified by the caller. Default value is None. + :paramtype recursive: bool + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5206,27 +7763,17 @@ def update_details( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AgentDetails] = kwargs.pop("cls", None) - - if body is _Unset: - body = {"agent_card": agent_card, "agent_endpoint": agent_endpoint} - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/merge-patch+json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_agents_update_details_request( + _request = build_agents_delete_session_file_request( agent_name=agent_name, - content_type=content_type, + session_id=session_id, + path=path, + recursive=recursive, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -5235,20 +7782,14 @@ def update_details( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _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 + 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, @@ -5256,61 +7797,37 @@ def update_details( ) raise HttpResponseError(response=response, model=error) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.AgentDetails, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, None, {}) # type: ignore - return deserialized # type: ignore - @overload - def _create_version_from_code( - self, - agent_name: str, - content: _models._models._CreateAgentVersionFromCodeContent, - *, - code_zip_sha256: str, - **kwargs: Any - ) -> _models.AgentVersionDetails: ... - @overload - def _create_version_from_code( - self, agent_name: str, content: JSON, *, code_zip_sha256: str, **kwargs: Any - ) -> _models.AgentVersionDetails: ... +class EvaluationRulesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. - @distributed_trace - def _create_version_from_code( - self, - agent_name: str, - content: Union[_models._models._CreateAgentVersionFromCodeContent, JSON], - *, - code_zip_sha256: str, - **kwargs: Any - ) -> _models.AgentVersionDetails: - """Create an agent version from code. + Instead, you should access the following operations through + :class:`~azure.ai.projects.AIProjectClient`'s + :attr:`evaluation_rules` attribute. + """ - Creates a new agent version from code. Uploads the code zip and creates a new version for an - existing agent. The SHA-256 hex digest of the zip is provided in the ``x-ms-code-zip-sha256`` - header for integrity and dedup. The request body is multipart/form-data with a JSON metadata - part and a binary code part (part order is irrelevant). Maximum upload size is 250 MB. + 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") - :param agent_name: The unique name that identifies the agent. Name can be used to - retrieve/update/delete the agent. + @distributed_trace + def get(self, id: str, **kwargs: Any) -> _models.EvaluationRule: + """Get an evaluation rule. - * Must start and end with alphanumeric characters, - * Can contain hyphens in the middle - * Must not exceed 63 characters. Required. - :type agent_name: str - :param content: The content multipart request content. Is either a - _CreateAgentVersionFromCodeContent type or a JSON type. Required. - :type content: ~azure.ai.projects.models._models._CreateAgentVersionFromCodeContent or JSON - :keyword code_zip_sha256: SHA-256 hex digest of the uploaded code zip. Used for change - detection (dedup) and integrity verification. Required. - :paramtype code_zip_sha256: str - :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentVersionDetails + Retrieves the specified evaluation rule and its configuration. + + :param id: Unique identifier for the evaluation rule. Required. + :type id: str + :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluationRule :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5324,18 +7841,11 @@ def _create_version_from_code( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.AgentVersionDetails] = kwargs.pop("cls", None) - - _body = content.as_dict() if isinstance(content, _Model) else content - _file_fields: list[str] = ["code"] - _data_fields: list[str] = ["metadata"] - _files = prepare_multipart_form_data(_body, _file_fields, _data_fields) + cls: ClsType[_models.EvaluationRule] = kwargs.pop("cls", None) - _request = build_agents_create_version_from_code_request( - agent_name=agent_name, - code_zip_sha256=code_zip_sha256, + _request = build_evaluation_rules_get_request( + id=id, api_version=self._config.api_version, - files=_files, headers=_headers, params=_params, ) @@ -5359,16 +7869,12 @@ def _create_version_from_code( 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) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.AgentVersionDetails, response.json()) + deserialized = _deserialize(_models.EvaluationRule, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -5376,25 +7882,15 @@ def _create_version_from_code( return deserialized # type: ignore @distributed_trace - def download_code(self, agent_name: str, *, agent_version: Optional[str] = None, **kwargs: Any) -> Iterator[bytes]: - """Download agent code. - - Downloads the code zip for a code-based hosted agent. - Returns the previously-uploaded zip (``application/zip``). - - If ``agent_version`` is supplied, returns that version's code zip; otherwise - returns the latest version's code zip. + def delete(self, id: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """Delete an evaluation rule. - The SHA-256 digest of the returned bytes matches the ``content_hash`` on the - resolved version's ``code_configuration``. + Removes the specified evaluation rule from the project. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :keyword agent_version: The version of the agent whose code zip should be downloaded. - If omitted, the latest version's code zip is returned. Default value is None. - :paramtype agent_version: str - :return: Iterator[bytes] - :rtype: Iterator[bytes] + :param id: Unique identifier for the evaluation rule. Required. + :type id: str + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5408,11 +7904,10 @@ def download_code(self, agent_name: str, *, agent_version: Optional[str] = None, _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_agents_download_code_request( - agent_name=agent_name, - agent_version=agent_version, + _request = build_evaluation_rules_delete_request( + id=id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5422,50 +7917,95 @@ def download_code(self, agent_name: str, *, agent_version: Optional[str] = None, } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", True) + _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 + 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) + raise HttpResponseError(response=response) - response_headers = {} - response_headers["x-ms-agent-version"] = self._deserialize("str", response.headers.get("x-ms-agent-version")) - response_headers["Content-Type"] = self._deserialize("str", response.headers.get("Content-Type")) + if cls: + return cls(pipeline_response, None, {}) # type: ignore - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + @overload + def create_or_update( + self, id: str, evaluation_rule: _models.EvaluationRule, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.EvaluationRule: + """Create or update an evaluation rule. - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + Creates a new evaluation rule, or replaces the existing rule when the identifier matches. - return deserialized # type: ignore + :param id: Unique identifier for the evaluation rule. Required. + :type id: str + :param evaluation_rule: Evaluation rule resource. Required. + :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluationRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, id: str, evaluation_rule: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.EvaluationRule: + """Create or update an evaluation rule. + + Creates a new evaluation rule, or replaces the existing rule when the identifier matches. + + :param id: Unique identifier for the evaluation rule. Required. + :type id: str + :param evaluation_rule: Evaluation rule resource. Required. + :type evaluation_rule: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluationRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, id: str, evaluation_rule: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.EvaluationRule: + """Create or update an evaluation rule. + + Creates a new evaluation rule, or replaces the existing rule when the identifier matches. + + :param id: Unique identifier for the evaluation rule. Required. + :type id: str + :param evaluation_rule: Evaluation rule resource. Required. + :type evaluation_rule: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluationRule + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace - def enable(self, agent_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """Enable an agent. + def create_or_update( + self, id: str, evaluation_rule: Union[_models.EvaluationRule, JSON, IO[bytes]], **kwargs: Any + ) -> _models.EvaluationRule: + """Create or update an evaluation rule. - Enables the specified agent, allowing it to accept new sessions and process requests. This - operation is idempotent — enabling an already-enabled agent returns success with no side - effects. + Creates a new evaluation rule, or replaces the existing rule when the identifier matches. - :param agent_name: The name of the agent to enable. Required. - :type agent_name: str - :return: None - :rtype: None + :param id: Unique identifier for the evaluation rule. Required. + :type id: str + :param evaluation_rule: Evaluation rule resource. Is one of the following types: + EvaluationRule, JSON, IO[bytes] Required. + :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule or JSON or IO[bytes] + :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluationRule :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5476,14 +8016,24 @@ def enable(self, agent_name: str, **kwargs: Any) -> None: # pylint: disable=inc } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EvaluationRule] = kwargs.pop("cls", None) - _request = build_agents_enable_request( - agent_name=agent_name, + content_type = content_type or "application/json" + _content = None + if isinstance(evaluation_rule, (IOBase, bytes)): + _content = evaluation_rule + else: + _content = json.dumps(evaluation_rule, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_evaluation_rules_create_or_update_request( + id=id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -5492,39 +8042,63 @@ def enable(self, agent_name: str, **kwargs: Any) -> None: # pylint: disable=inc } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _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 [204]: + if response.status_code not in [200, 201]: + 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) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.EvaluationRule, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore @distributed_trace - def disable(self, agent_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """Disable an agent. + def list( + self, + *, + action_type: Optional[Union[str, _models.EvaluationRuleActionType]] = None, + agent_name: Optional[str] = None, + enabled: Optional[bool] = None, + **kwargs: Any + ) -> ItemPaged["_models.EvaluationRule"]: + """List evaluation rules. - Disables the specified agent, preventing it from accepting new sessions or processing requests. - Existing active sessions are allowed to drain gracefully but no new sessions can be created. - This operation is idempotent — disabling an already-disabled agent returns success with no side - effects. + Returns the evaluation rules configured for the project, optionally filtered by action type, + agent name, or enabled state. - :param agent_name: The name of the agent to disable. Required. - :type agent_name: str - :return: None - :rtype: None + :keyword action_type: Filter by the type of evaluation rule. Known values are: + "continuousEvaluation" and "humanEvaluationPreview". Default value is None. + :paramtype action_type: str or ~azure.ai.projects.models.EvaluationRuleActionType + :keyword agent_name: Filter by the agent name. Default value is None. + :paramtype agent_name: str + :keyword enabled: Filter by the enabled status. Default value is None. + :paramtype enabled: bool + :return: An iterator like instance of EvaluationRule + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.EvaluationRule] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.EvaluationRule]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -5533,142 +8107,105 @@ def disable(self, agent_name: str, **kwargs: Any) -> None: # pylint: disable=in } 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) + def prepare_request(next_link=None): + if not next_link: - _request = build_agents_disable_request( - agent_name=agent_name, - 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) + _request = build_evaluation_rules_list_request( + action_type=action_type, + agent_name=agent_name, + enabled=enabled, + 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 - ) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_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) - response = pipeline_response.http_response + return _request - 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, + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.EvaluationRule], + deserialized.get("value", []), ) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) - @overload - def create_session( - self, - agent_name: str, - *, - version_indicator: _models.VersionIndicator, - content_type: str = "application/json", - agent_session_id: Optional[str] = None, - **kwargs: Any - ) -> _models.AgentSessionResource: - """Create a session. + def get_next(next_link=None): + _request = prepare_request(next_link) - Creates a new session for an agent endpoint. The endpoint resolves the backing agent version - from ``version_indicator`` and enforces session ownership using the provided user identity for - session-mutating operations. + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response - :param agent_name: The name of the agent to create a session for. Required. - :type agent_name: str - :keyword version_indicator: Determines which agent version backs the session. Required. - :paramtype version_indicator: ~azure.ai.projects.models.VersionIndicator - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword agent_session_id: Optional caller-provided session ID. If specified, it must be unique - within the agent endpoint. Auto-generated if omitted. Default value is None. - :paramtype agent_session_id: str - :return: AgentSessionResource. The AgentSessionResource is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentSessionResource - :raises ~azure.core.exceptions.HttpResponseError: - """ + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) - @overload - def create_session( - self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.AgentSessionResource: - """Create a session. + return pipeline_response - Creates a new session for an agent endpoint. The endpoint resolves the backing agent version - from ``version_indicator`` and enforces session ownership using the provided user identity for - session-mutating operations. + return ItemPaged(get_next, extract_data) - :param agent_name: The name of the agent to create a session for. Required. - :type agent_name: str - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: AgentSessionResource. The AgentSessionResource is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentSessionResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - @overload - def create_session( - self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.AgentSessionResource: - """Create a session. +class ConnectionsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. - Creates a new session for an agent endpoint. The endpoint resolves the backing agent version - from ``version_indicator`` and enforces session ownership using the provided user identity for - session-mutating operations. + Instead, you should access the following operations through + :class:`~azure.ai.projects.AIProjectClient`'s + :attr:`connections` attribute. + """ - :param agent_name: The name of the agent to create a session for. Required. - :type agent_name: str - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: AgentSessionResource. The AgentSessionResource is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentSessionResource - :raises ~azure.core.exceptions.HttpResponseError: - """ + 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 create_session( - self, - agent_name: str, - body: Union[JSON, IO[bytes]] = _Unset, - *, - version_indicator: _models.VersionIndicator = _Unset, - agent_session_id: Optional[str] = None, - **kwargs: Any - ) -> _models.AgentSessionResource: - """Create a session. + def _get(self, name: str, **kwargs: Any) -> _models.Connection: + """Get a connection. - Creates a new session for an agent endpoint. The endpoint resolves the backing agent version - from ``version_indicator`` and enforces session ownership using the provided user identity for - session-mutating operations. + Retrieves the specified connection and its configuration details without including credential + values. - :param agent_name: The name of the agent to create a session for. Required. - :type agent_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword version_indicator: Determines which agent version backs the session. Required. - :paramtype version_indicator: ~azure.ai.projects.models.VersionIndicator - :keyword agent_session_id: Optional caller-provided session ID. If specified, it must be unique - within the agent endpoint. Auto-generated if omitted. Default value is None. - :paramtype agent_session_id: str - :return: AgentSessionResource. The AgentSessionResource is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentSessionResource + :param name: The friendly name of the connection, provided by the user. Required. + :type name: str + :return: Connection. The Connection is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.Connection :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5679,29 +8216,14 @@ def create_session( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AgentSessionResource] = kwargs.pop("cls", None) - - if body is _Unset: - if version_indicator is _Unset: - raise TypeError("missing required argument: version_indicator") - body = {"agent_session_id": agent_session_id, "version_indicator": version_indicator} - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.Connection] = kwargs.pop("cls", None) - _request = build_agents_create_session_request( - agent_name=agent_name, - content_type=content_type, + _request = build_connections_get_request( + name=name, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -5718,41 +8240,40 @@ def create_session( response = pipeline_response.http_response - if response.status_code not in [201]: + 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) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["x-ms-client-request-id"] = self._deserialize( + "str", response.headers.get("x-ms-client-request-id") + ) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.AgentSessionResource, response.json()) + deserialized = _deserialize(_models.Connection, response.json()) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace - def get_session(self, agent_name: str, session_id: str, **kwargs: Any) -> _models.AgentSessionResource: - """Get a session. + def _get_with_credentials(self, name: str, **kwargs: Any) -> _models.Connection: + """Get a connection with credentials. - Retrieves the details of a hosted agent session by agent name and session identifier. + Retrieves the specified connection together with its credential values. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param session_id: The session identifier. Required. - :type session_id: str - :return: AgentSessionResource. The AgentSessionResource is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentSessionResource + :param name: The friendly name of the connection, provided by the user. Required. + :type name: str + :return: Connection. The Connection is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.Connection :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5766,11 +8287,10 @@ def get_session(self, agent_name: str, session_id: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.AgentSessionResource] = kwargs.pop("cls", None) + cls: ClsType[_models.Connection] = kwargs.pop("cls", None) - _request = build_agents_get_session_request( - agent_name=agent_name, - session_id=session_id, + _request = build_connections_get_with_credentials_request( + name=name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5795,39 +8315,52 @@ def get_session(self, agent_name: str, session_id: str, **kwargs: Any) -> _model 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) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["x-ms-client-request-id"] = self._deserialize( + "str", response.headers.get("x-ms-client-request-id") + ) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.AgentSessionResource, response.json()) + deserialized = _deserialize(_models.Connection, response.json()) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace - def delete_session( # pylint: disable=inconsistent-return-statements - self, agent_name: str, session_id: str, **kwargs: Any - ) -> None: - """Delete a session. + def list( + self, + *, + connection_type: Optional[Union[str, _models.ConnectionType]] = None, + default_connection: Optional[bool] = None, + **kwargs: Any + ) -> ItemPaged["_models.Connection"]: + """List connections. - Deletes a session synchronously. Returns 204 No Content when the session is deleted or does not - exist. + Returns the connections available in the current project, optionally filtered by type or + default status. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param session_id: The session identifier. Required. - :type session_id: str - :return: None - :rtype: None + :keyword connection_type: Lists connections of this specific type. Known values are: + "AzureOpenAI", "AzureBlob", "AzureStorageAccount", "CognitiveSearch", "CosmosDB", "ApiKey", + "AppConfig", "AppInsights", "CustomKeys", and "RemoteTool_Preview". Default value is None. + :paramtype connection_type: str or ~azure.ai.projects.models.ConnectionType + :keyword default_connection: Lists connections that are default connections. Default value is + None. + :paramtype default_connection: bool + :return: An iterator like instance of Connection + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.Connection] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Connection]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -5836,58 +8369,110 @@ def delete_session( # pylint: disable=inconsistent-return-statements } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + def prepare_request(next_link=None): + if not next_link: - cls: ClsType[None] = kwargs.pop("cls", None) + _request = build_connections_list_request( + connection_type=connection_type, + default_connection=default_connection, + 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) - _request = build_agents_delete_session_request( - agent_name=agent_name, - session_id=session_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) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_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 - ) + return _request - response = pipeline_response.http_response + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Connection], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) - 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, + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - raise HttpResponseError(response=response, model=error) + response = pipeline_response.http_response - if cls: - return cls(pipeline_response, None, {}) # type: ignore + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) - @distributed_trace - def stop_session( # pylint: disable=inconsistent-return-statements - self, agent_name: str, session_id: str, **kwargs: Any - ) -> None: - """Stop a session. + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class DatasetsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.AIProjectClient`'s + :attr:`datasets` 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") - Terminates the specified hosted agent session and returns 204 No Content when the request - succeeds. + @distributed_trace + def list_versions(self, name: str, **kwargs: Any) -> ItemPaged["_models.DatasetVersion"]: + """List versions. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param session_id: The session identifier. Required. - :type session_id: str - :return: None - :rtype: None + List all versions of the given DatasetVersion. + + :param name: The name of the resource. Required. + :type name: str + :return: An iterator like instance of DatasetVersion + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.DatasetVersion] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatasetVersion]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -5896,79 +8481,88 @@ def stop_session( # pylint: disable=inconsistent-return-statements } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + def prepare_request(next_link=None): + if not next_link: - cls: ClsType[None] = kwargs.pop("cls", None) + _request = build_datasets_list_versions_request( + name=name, + 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) - _request = build_agents_stop_session_request( - agent_name=agent_name, - session_id=session_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) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_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 - ) + return _request - response = pipeline_response.http_response + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatasetVersion], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) - 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, + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - raise HttpResponseError(response=response, model=error) + response = pipeline_response.http_response - if cls: - return cls(pipeline_response, None, {}) # type: ignore + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + return pipeline_response + + return ItemPaged(get_next, extract_data) @distributed_trace - def list_sessions( - self, - agent_name: str, - *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.AgentSessionResource"]: - """List sessions for an agent. + def list(self, **kwargs: Any) -> ItemPaged["_models.DatasetVersion"]: + """List latest versions. - Returns a paged collection of sessions associated with the specified agent endpoint. + List the latest version of each DatasetVersion. - :param agent_name: The name of the 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 AgentSessionResource - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.AgentSessionResource] + :return: An iterator like instance of DatasetVersion + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.DatasetVersion] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.AgentSessionResource]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.DatasetVersion]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5978,36 +8572,58 @@ def list_sessions( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(_continuation_token=None): + def prepare_request(next_link=None): + if not next_link: + + _request = build_datasets_list_request( + 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) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_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) - _request = build_agents_list_sessions_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.AgentSessionResource], - deserialized.get("data", []), + List[_models.DatasetVersion], + deserialized.get("value", []), ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("last_id") or None, iter(list_of_elem) + return deserialized.get("nextLink") or None, iter(list_of_elem) - def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) + def get_next(next_link=None): + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access @@ -6017,57 +8633,25 @@ def get_next(_continuation_token=None): 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) + raise HttpResponseError(response=response) return pipeline_response return ItemPaged(get_next, extract_data) @distributed_trace - def get_session_log_stream( - self, agent_name: str, agent_version: str, session_id: str, **kwargs: Any - ) -> _models.SessionLogEvent: - """Stream console logs for a hosted agent session. - - Streams console logs (stdout / stderr) for a specific hosted agent session - as a Server-Sent Events (SSE) 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) - - Example SSE frames: - - .. code-block:: - - event: log - 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."} - - event: log - 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"} + def get(self, name: str, version: str, **kwargs: Any) -> _models.DatasetVersion: + """Get a version. - The stream remains open until the client disconnects or the server - terminates the connection. Clients should handle reconnection as needed. + Get the specific version of the DatasetVersion. The service returns 404 Not Found error if the + DatasetVersion does not exist. - :param agent_name: The name of the hosted agent. Required. - :type agent_name: str - :param agent_version: The version of the agent. Required. - :type agent_version: str - :param session_id: The session ID (maps to an ADC sandbox). Required. - :type session_id: str - :return: SessionLogEvent. The SessionLogEvent is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.SessionLogEvent + :param name: The name of the resource. Required. + :type name: str + :param version: The specific version id of the DatasetVersion to retrieve. Required. + :type version: str + :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6081,12 +8665,11 @@ def get_session_log_stream( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.SessionLogEvent] = kwargs.pop("cls", None) + cls: ClsType[_models.DatasetVersion] = kwargs.pop("cls", None) - _request = build_agents_get_session_log_stream_request( - agent_name=agent_name, - agent_version=agent_version, - session_id=session_id, + _request = build_datasets_get_request( + name=name, + version=version, api_version=self._config.api_version, headers=_headers, params=_params, @@ -6097,7 +8680,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", True) + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -6111,111 +8694,31 @@ def get_session_log_stream( 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")) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.SessionLogEvent, response.text()) + deserialized = _deserialize(_models.DatasetVersion, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @overload - def upload_session_file( - self, - agent_name: str, - session_id: str, - content: bytes, - *, - path: str, - content_type: str = "application/octet-stream", - **kwargs: Any - ) -> _models.SessionFileWriteResult: - """Upload a session file. - - Uploads binary file content to the specified path in the session sandbox. The service stores - the file relative to the session home directory and rejects payloads larger than 50 MB. - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param session_id: The session ID. Required. - :type session_id: str - :param content: Required. - :type content: bytes - :keyword path: The destination file path within the sandbox, relative to the session home - directory. Required. - :paramtype path: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/octet-stream". - :paramtype content_type: str - :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.SessionFileWriteResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def upload_session_file( - self, - agent_name: str, - session_id: str, - content: IO[bytes], - *, - path: str, - content_type: str = "application/octet-stream", - **kwargs: Any - ) -> _models.SessionFileWriteResult: - """Upload a session file. - - Uploads binary file content to the specified path in the session sandbox. The service stores - the file relative to the session home directory and rejects payloads larger than 50 MB. - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param session_id: The session ID. Required. - :type session_id: str - :param content: Required. - :type content: IO[bytes] - :keyword path: The destination file path within the sandbox, relative to the session home - directory. Required. - :paramtype path: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/octet-stream". - :paramtype content_type: str - :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.SessionFileWriteResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace - def upload_session_file( - self, agent_name: str, session_id: str, content: Union[bytes, IO[bytes]], *, path: str, **kwargs: Any - ) -> _models.SessionFileWriteResult: - """Upload a session file. + def delete(self, name: str, version: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """Delete a version. - Uploads binary file content to the specified path in the session sandbox. The service stores - the file relative to the session home directory and rejects payloads larger than 50 MB. + Delete the specific version of the DatasetVersion. The service returns 204 No Content if the + DatasetVersion was deleted successfully or if the DatasetVersion does not exist. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param session_id: The session ID. Required. - :type session_id: str - :param content: Is either a bytes type or a IO[bytes] type. Required. - :type content: bytes or IO[bytes] - :keyword path: The destination file path within the sandbox, relative to the session home - directory. Required. - :paramtype path: str - :return: SessionFileWriteResult. The SessionFileWriteResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.SessionFileWriteResult + :param name: The name of the resource. Required. + :type name: str + :param version: The version of the DatasetVersion to delete. Required. + :type version: str + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6226,22 +8729,15 @@ def upload_session_file( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SessionFileWriteResult] = kwargs.pop("cls", None) - - content_type = content_type or "application/octet-stream" - _content = content + cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_agents_upload_session_file_request( - agent_name=agent_name, - session_id=session_id, - path=path, - content_type=content_type, + _request = build_datasets_delete_request( + name=name, + version=version, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -6250,53 +8746,121 @@ def upload_session_file( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _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 [201]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + 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 _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.SessionFileWriteResult, response.json()) + raise HttpResponseError(response=response) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, None, {}) # type: ignore - return deserialized # type: ignore + @overload + def create_or_update( + self, + name: str, + version: str, + dataset_version: _models.DatasetVersion, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> _models.DatasetVersion: + """Create or update a version. - @distributed_trace - def download_session_file(self, agent_name: str, session_id: str, *, path: str, **kwargs: Any) -> Iterator[bytes]: - """Download a session file. + Create a new or update an existing DatasetVersion with the given version id. - Downloads the file at the specified sandbox path as a binary stream. The path is resolved - relative to the session home directory. + :param name: The name of the resource. Required. + :type name: str + :param version: The specific version id of the DatasetVersion to create or update. Required. + :type version: str + :param dataset_version: The DatasetVersion to create or update. Required. + :type dataset_version: ~azure.ai.projects.models.DatasetVersion + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/merge-patch+json". + :paramtype content_type: str + :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.DatasetVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + name: str, + version: str, + dataset_version: JSON, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> _models.DatasetVersion: + """Create or update a version. + + Create a new or update an existing DatasetVersion with the given version id. + + :param name: The name of the resource. Required. + :type name: str + :param version: The specific version id of the DatasetVersion to create or update. Required. + :type version: str + :param dataset_version: The DatasetVersion to create or update. Required. + :type dataset_version: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/merge-patch+json". + :paramtype content_type: str + :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.DatasetVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + name: str, + version: str, + dataset_version: IO[bytes], + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> _models.DatasetVersion: + """Create or update a version. + + Create a new or update an existing DatasetVersion with the given version id. + + :param name: The name of the resource. Required. + :type name: str + :param version: The specific version id of the DatasetVersion to create or update. Required. + :type version: str + :param dataset_version: The DatasetVersion to create or update. Required. + :type dataset_version: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/merge-patch+json". + :paramtype content_type: str + :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.DatasetVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, name: str, version: str, dataset_version: Union[_models.DatasetVersion, JSON, IO[bytes]], **kwargs: Any + ) -> _models.DatasetVersion: + """Create or update a version. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param session_id: The session ID. Required. - :type session_id: str - :keyword path: The file path to download from the sandbox, relative to the session home - directory. Required. - :paramtype path: str - :return: Iterator[bytes] - :rtype: Iterator[bytes] + Create a new or update an existing DatasetVersion with the given version id. + + :param name: The name of the resource. Required. + :type name: str + :param version: The specific version id of the DatasetVersion to create or update. Required. + :type version: str + :param dataset_version: The DatasetVersion to create or update. Is one of the following types: + DatasetVersion, JSON, IO[bytes] Required. + :type dataset_version: ~azure.ai.projects.models.DatasetVersion or JSON or IO[bytes] + :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6307,16 +8871,25 @@ def download_session_file(self, agent_name: str, session_id: str, *, path: str, } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatasetVersion] = kwargs.pop("cls", None) - _request = build_agents_download_session_file_request( - agent_name=agent_name, - session_id=session_id, - path=path, + content_type = content_type or "application/merge-patch+json" + _content = None + if isinstance(dataset_version, (IOBase, bytes)): + _content = dataset_version + else: + _content = json.dumps(dataset_version, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_datasets_create_or_update_request( + name=name, + version=version, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -6326,81 +8899,140 @@ def download_session_file(self, agent_name: str, session_id: str, *, path: str, _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", 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 response.status_code not in [200, 201]: 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) + raise HttpResponseError(response=response) - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatasetVersion, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace - def list_session_files( + @overload + def pending_upload( self, - agent_name: str, - session_id: str, + name: str, + version: str, + pending_upload_request: _models.PendingUploadRequest, *, - path: Optional[str] = None, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, + content_type: str = "application/json", **kwargs: Any - ) -> ItemPaged["_models.SessionDirectoryEntry"]: - """List session files. + ) -> _models.PendingUploadResponse: + """Start a pending upload. - Returns files and directories at the specified path in the session sandbox. The response - includes only the immediate children of the target directory and defaults to the session home - directory when no path is supplied. + Initiates a new pending upload or retrieves an existing one for the specified dataset version. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param session_id: The session ID. Required. - :type session_id: str - :keyword path: The directory path to list, relative to the session home directory. Defaults to - the home directory if not provided. Default value is None. - :paramtype path: 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 SessionDirectoryEntry - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.SessionDirectoryEntry] + :param name: The name of the resource. Required. + :type name: str + :param version: The specific version id of the DatasetVersion to operate on. Required. + :type version: str + :param pending_upload_request: The pending upload request parameters. Required. + :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.SessionDirectoryEntry]] = kwargs.pop("cls", None) + @overload + def pending_upload( + self, + name: str, + version: str, + pending_upload_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PendingUploadResponse: + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified dataset version. + :param name: The name of the resource. Required. + :type name: str + :param version: The specific version id of the DatasetVersion to operate on. Required. + :type version: str + :param pending_upload_request: The pending upload request parameters. Required. + :type pending_upload_request: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.PendingUploadResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def pending_upload( + self, + name: str, + version: str, + pending_upload_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PendingUploadResponse: + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified dataset version. + + :param name: The name of the resource. Required. + :type name: str + :param version: The specific version id of the DatasetVersion to operate on. Required. + :type version: str + :param pending_upload_request: The pending upload request parameters. Required. + :type pending_upload_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.PendingUploadResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def pending_upload( + self, + name: str, + version: str, + pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.PendingUploadResponse: + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified dataset version. + + :param name: The name of the resource. Required. + :type name: str + :param version: The specific version id of the DatasetVersion to operate on. Required. + :type version: str + :param pending_upload_request: The pending upload request parameters. Is one of the following + types: PendingUploadRequest, JSON, IO[bytes] Required. + :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or JSON or + IO[bytes] + :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.PendingUploadResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -6409,78 +9041,72 @@ def list_session_files( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(_continuation_token=None): + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - _request = build_agents_list_session_files_request( - agent_name=agent_name, - session_id=session_id, - path=path, - 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 + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PendingUploadResponse] = kwargs.pop("cls", None) - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.SessionDirectoryEntry], - deserialized.get("entries", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("last_id") or None, iter(list_of_elem) + content_type = content_type or "application/json" + _content = None + if isinstance(pending_upload_request, (IOBase, bytes)): + _content = pending_upload_request + else: + _content = json.dumps(pending_upload_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) + _request = build_datasets_pending_upload_request( + name=name, + version=version, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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 + _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 + ) - 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) + response = pipeline_response.http_response - return pipeline_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) + raise HttpResponseError(response=response) - return ItemPaged(get_next, extract_data) + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.PendingUploadResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore @distributed_trace - def delete_session_file( # pylint: disable=inconsistent-return-statements - self, agent_name: str, session_id: str, *, path: str, recursive: Optional[bool] = None, **kwargs: Any - ) -> None: - """Delete a session file. + def get_credentials(self, name: str, version: str, **kwargs: Any) -> _models.DatasetCredential: + """Get dataset credentials. - Deletes the specified file or directory from the session sandbox. When ``recursive`` is false, - deleting a non-empty directory returns 409 Conflict. + Retrieves the SAS credential to access the storage account associated with a dataset version. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param session_id: The session ID. Required. - :type session_id: str - :keyword path: The file or directory path to delete, relative to the session home directory. - Required. - :paramtype path: str - :keyword recursive: Whether to recursively delete directory contents. The service defaults to - ``false`` if a value is not specified by the caller. Default value is None. - :paramtype recursive: bool - :return: None - :rtype: None + :param name: The name of the resource. Required. + :type name: str + :param version: The specific version id of the DatasetVersion to operate on. Required. + :type version: str + :return: DatasetCredential. The DatasetCredential is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.DatasetCredential :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6494,13 +9120,11 @@ def delete_session_file( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[_models.DatasetCredential] = kwargs.pop("cls", None) - _request = build_agents_delete_session_file_request( - agent_name=agent_name, - session_id=session_id, - path=path, - recursive=recursive, + _request = build_datasets_get_credentials_request( + name=name, + version=version, api_version=self._config.api_version, headers=_headers, params=_params, @@ -6510,33 +9134,42 @@ def delete_session_file( # pylint: disable=inconsistent-return-statements } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _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 [204]: + 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) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatasetCredential, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore -class VoiceAgentWebSocketOperations: # pylint: disable=docstring-missing-param +class DeploymentsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.ai.projects.AIProjectClient`'s - :attr:`voice_agent_web_socket` attribute. + :attr:`deployments` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -6547,65 +9180,104 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def connect_voice_agent( # pylint: disable=inconsistent-return-statements + def get(self, name: str, **kwargs: Any) -> _models.Deployment: + """Get a deployment. + + Retrieves a deployed model. + + :param name: Name of the deployment. Required. + :type name: str + :return: Deployment. The Deployment is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.Deployment + :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.Deployment] = kwargs.pop("cls", None) + + _request = build_deployments_get_request( + name=name, + 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) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["x-ms-client-request-id"] = self._deserialize( + "str", response.headers.get("x-ms-client-request-id") + ) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Deployment, response.json()) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list( self, - agent_name: str, *, - foundry_features_query: Optional[Literal[_AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW]] = None, - agent_session_id: Optional[str] = None, - store: Optional[bool] = None, - agent_version_override: Optional[str] = None, - websocket_subprotocol: Optional[Union[str, _models.VoiceAgentWebSocketSubprotocol]] = None, - structured_inputs: Optional[str] = None, + model_publisher: Optional[str] = None, + model_name: Optional[str] = None, + deployment_type: Optional[Union[str, _models.DeploymentType]] = None, **kwargs: Any - ) -> None: - """Connect to a voice agent. - - Connects to a voice agent over WebSocket. The client must send an HTTP GET with ``Upgrade: - websocket`` - headers. The optional ``realtime`` subprotocol is the only accepted subprotocol value. Supply - the - ``VoiceAgents=V1Preview`` opt-in through either the ``Foundry-Features`` header or the - ``foundry_features`` - query parameter. + ) -> ItemPaged["_models.Deployment"]: + """List deployments. - If the target agent is disabled, the HTTP WebSocket handshake fails before the ``101 Switching - Protocols`` - upgrade. The service returns ``409 Conflict`` using the shared Foundry ``ApiErrorResponse`` - shape with - ``error.code = agent_disabled``. This failure is terminal until the caller enables the agent. + Returns the deployed models available in the current project, optionally filtered by publisher, + model name, or deployment type. - :param agent_name: The name of the voice agent. Required. - :type agent_name: str - :keyword foundry_features_query: A query alternative to the ``Foundry-Features`` header for - clients that cannot set headers during a - WebSocket handshake. Set this to ``VoiceAgents=V1Preview``. Either this query parameter or the - header is - required. VOICE_AGENTS_V1_PREVIEW. Default value is None. - :paramtype foundry_features_query: str or ~azure.ai.projects.models.VOICE_AGENTS_V1_PREVIEW - :keyword agent_session_id: An optional identifier used to correlate the voice session. Default + :keyword model_publisher: Model publisher to filter models by. Default value is None. + :paramtype model_publisher: str + :keyword model_name: Model name (the publisher specific name) to filter models by. Default value is None. - :paramtype agent_session_id: str - :keyword store: Whether to persist the conversation created by this WebSocket session. If - omitted, the service honors the - persisted voice agent definition's configured ``store`` value. If supplied, this value - overrides the - definition's ``store`` setting for this session only. Default value is None. - :paramtype store: bool - :keyword agent_version_override: Selects a specific version of the voice agent for this - session. Default value is None. - :paramtype agent_version_override: str - :keyword websocket_subprotocol: The requested WebSocket subprotocol. Omit this header or - request exactly ``realtime``. "realtime" Default value is None. - :paramtype websocket_subprotocol: str or - ~azure.ai.projects.models.VoiceAgentWebSocketSubprotocol - :keyword structured_inputs: A JSON object that maps structured-input names to their values for - this session. Default value is None. - :paramtype structured_inputs: str - :return: None - :rtype: None + :paramtype model_name: str + :keyword deployment_type: Type of deployment to filter list by. "ModelDeployment" Default value + is None. + :paramtype deployment_type: str or ~azure.ai.projects.models.DeploymentType + :return: An iterator like instance of Deployment + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.Deployment] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Deployment]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -6614,60 +9286,85 @@ def connect_voice_agent( # pylint: disable=inconsistent-return-statements } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + def prepare_request(next_link=None): + if not next_link: - cls: ClsType[None] = kwargs.pop("cls", None) + _request = build_deployments_list_request( + model_publisher=model_publisher, + model_name=model_name, + deployment_type=deployment_type, + 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) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_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) - _request = build_voice_agent_web_socket_connect_voice_agent_request( - agent_name=agent_name, - foundry_features_query=foundry_features_query, - agent_session_id=agent_session_id, - store=store, - agent_version_override=agent_version_override, - websocket_subprotocol=websocket_subprotocol, - structured_inputs=structured_inputs, - 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 - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Deployment], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) - response = pipeline_response.http_response + def get_next(next_link=None): + _request = prepare_request(next_link) - if response.status_code not in [101]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ApiErrorResponse, - response, + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - raise HttpResponseError(response=response, model=error) + response = pipeline_response.http_response - response_headers = {} - response_headers["Sec-WebSocket-Protocol"] = self._deserialize( - "str", response.headers.get("Sec-WebSocket-Protocol") - ) + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore + return pipeline_response + + return ItemPaged(get_next, extract_data) -class AgentEndpointConversationsOperations: # pylint: disable=docstring-missing-param +class IndexesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.ai.projects.AIProjectClient`'s - :attr:`agent_endpoint_conversations` attribute. + :attr:`indexes` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -6678,44 +9375,21 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list_agent_conversations( - self, - agent_name: str, - *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.VoiceConversation"]: - """List voice agent conversations. + def list_versions(self, name: str, **kwargs: Any) -> ItemPaged["_models.Index"]: + """List versions. - Returns the conversations persisted for the specified voice agent endpoint. Conversations are - present only when the agent definition has ``store = true``. + List all versions of the given Index. - :param agent_name: The name of the 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 VoiceConversation - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.VoiceConversation] + :param name: The name of the resource. Required. + :type name: str + :return: An iterator like instance of Index + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.Index] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.VoiceConversation]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Index]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -6725,36 +9399,149 @@ def list_agent_conversations( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(_continuation_token=None): + def prepare_request(next_link=None): + if not next_link: - _request = build_agent_endpoint_conversations_list_agent_conversations_request( - agent_name=agent_name, - limit=limit, - order=order, - after=_continuation_token, - before=before, - api_version=self._config.api_version, - headers=_headers, - params=_params, + _request = build_indexes_list_versions_request( + name=name, + 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) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_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.Index], + deserialized.get("value", []), ) - 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) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _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) + raise HttpResponseError(response=response) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged["_models.Index"]: + """List latest versions. + + List the latest version of each Index. + + :return: An iterator like instance of Index + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.Index] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Index]] = 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(next_link=None): + if not next_link: + + _request = build_indexes_list_request( + 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) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_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.VoiceConversation], - deserialized.get("data", []), + List[_models.Index], + deserialized.get("value", []), ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("last_id") or None, iter(list_of_elem) + return deserialized.get("nextLink") or None, iter(list_of_elem) - def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) + def get_next(next_link=None): + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access @@ -6764,29 +9551,25 @@ def get_next(_continuation_token=None): 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) + raise HttpResponseError(response=response) return pipeline_response return ItemPaged(get_next, extract_data) @distributed_trace - def get_agent_conversation(self, agent_name: str, conversation_id: str, **kwargs: Any) -> _models.VoiceConversation: - """Get a voice agent conversation. + def get(self, name: str, version: str, **kwargs: Any) -> _models.Index: + """Get a version. - Retrieves a single conversation recorded for the specified voice agent endpoint by its id. - Returns ``404`` when the conversation was not persisted (``store = false``) or does not exist. + Get the specific version of the Index. The service returns 404 Not Found error if the Index + does not exist. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation to retrieve. Required. - :type conversation_id: str - :return: VoiceConversation. The VoiceConversation is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.VoiceConversation + :param name: The name of the resource. Required. + :type name: str + :param version: The specific version id of the Index to retrieve. Required. + :type version: str + :return: Index. The Index is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.Index :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6800,11 +9583,11 @@ def get_agent_conversation(self, agent_name: str, conversation_id: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.VoiceConversation] = kwargs.pop("cls", None) + cls: ClsType[_models.Index] = kwargs.pop("cls", None) - _request = build_agent_endpoint_conversations_get_agent_conversation_request( - agent_name=agent_name, - conversation_id=conversation_id, + _request = build_indexes_get_request( + name=name, + version=version, api_version=self._config.api_version, headers=_headers, params=_params, @@ -6829,16 +9612,12 @@ def get_agent_conversation(self, agent_name: str, conversation_id: str, **kwargs 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) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.VoiceConversation, response.json()) + deserialized = _deserialize(_models.Index, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -6846,18 +9625,16 @@ def get_agent_conversation(self, agent_name: str, conversation_id: str, **kwargs return deserialized # type: ignore @distributed_trace - def delete_agent_conversation( # pylint: disable=inconsistent-return-statements - self, agent_name: str, conversation_id: str, **kwargs: Any - ) -> None: - """Delete a voice agent conversation. + def delete(self, name: str, version: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """Delete a version. - Deletes a conversation and all of its stored data — responses, items, and any audio (cascade). - This is the customer's explicit data-deletion control for voice conversations. + Delete the specific version of the Index. The service returns 204 No Content if the Index was + deleted successfully or if the Index does not exist. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation to delete. Required. - :type conversation_id: str + :param name: The name of the resource. Required. + :type name: str + :param version: The version of the Index to delete. Required. + :type version: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -6875,9 +9652,9 @@ def delete_agent_conversation( # pylint: disable=inconsistent-return-statements cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_agent_endpoint_conversations_delete_agent_conversation_request( - agent_name=agent_name, - conversation_id=conversation_id, + _request = build_indexes_delete_request( + name=name, + version=version, api_version=self._config.api_version, headers=_headers, params=_params, @@ -6896,136 +9673,106 @@ def delete_agent_conversation( # pylint: disable=inconsistent-return-statements 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) + raise HttpResponseError(response=response) if cls: return cls(pipeline_response, None, {}) # type: ignore - @distributed_trace - def list_agent_conversation_responses( + @overload + def create_or_update( self, - agent_name: str, - conversation_id: str, + name: str, + version: str, + index: _models.Index, *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, + content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> ItemPaged["_models.VoiceResponse"]: - """List responses in a voice agent conversation. + ) -> _models.Index: + """Create or update a version. - Returns a paged collection of the responses (model inference turns) recorded for the specified - conversation. The per-response ``output`` projection may be omitted here; use the - response-items route for the canonical paged output. Returns ``404`` when the conversation was - not persisted (``store = false``). + Create a new or update an existing Index with the given version id. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation whose responses are listed. 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 VoiceResponse - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.VoiceResponse] + :param name: The name of the resource. Required. + :type name: str + :param version: The specific version id of the Index to create or update. Required. + :type version: str + :param index: The Index to create or update. Required. + :type index: ~azure.ai.projects.models.Index + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/merge-patch+json". + :paramtype content_type: str + :return: Index. The Index is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.Index :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.VoiceResponse]] = 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_agent_endpoint_conversations_list_agent_conversation_responses_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.VoiceResponse], - 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) + @overload + def create_or_update( + self, name: str, version: str, index: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any + ) -> _models.Index: + """Create or update a version. - def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) + Create a new or update an existing Index with the given version id. - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response + :param name: The name of the resource. Required. + :type name: str + :param version: The specific version id of the Index to create or update. Required. + :type version: str + :param index: The Index to create or update. Required. + :type index: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/merge-patch+json". + :paramtype content_type: str + :return: Index. The Index is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.Index + :raises ~azure.core.exceptions.HttpResponseError: + """ - 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) + @overload + def create_or_update( + self, + name: str, + version: str, + index: IO[bytes], + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> _models.Index: + """Create or update a version. - return pipeline_response + Create a new or update an existing Index with the given version id. - return ItemPaged(get_next, extract_data) + :param name: The name of the resource. Required. + :type name: str + :param version: The specific version id of the Index to create or update. Required. + :type version: str + :param index: The Index to create or update. Required. + :type index: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/merge-patch+json". + :paramtype content_type: str + :return: Index. The Index is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.Index + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace - def get_agent_conversation_response( - self, agent_name: str, conversation_id: str, response_id: str, **kwargs: Any - ) -> _models.VoiceResponse: - """Get a voice agent conversation response. + def create_or_update( + self, name: str, version: str, index: Union[_models.Index, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Index: + """Create or update a version. - Retrieves a single response from the specified conversation by its id, including its ``output`` - items, ``usage``, and status. Returns ``404`` when the conversation or response was not - persisted (``store = false``). + Create a new or update an existing Index with the given version id. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the response. Required. - :type conversation_id: str - :param response_id: The id of the response to retrieve. Required. - :type response_id: str - :return: VoiceResponse. The VoiceResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.VoiceResponse + :param name: The name of the resource. Required. + :type name: str + :param version: The specific version id of the Index to create or update. Required. + :type version: str + :param index: The Index to create or update. Is one of the following types: Index, JSON, + IO[bytes] Required. + :type index: ~azure.ai.projects.models.Index or JSON or IO[bytes] + :return: Index. The Index is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.Index :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -7036,16 +9783,25 @@ def get_agent_conversation_response( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.VoiceResponse] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Index] = kwargs.pop("cls", None) + + content_type = content_type or "application/merge-patch+json" + _content = None + if isinstance(index, (IOBase, bytes)): + _content = index + else: + _content = json.dumps(index, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_agent_endpoint_conversations_get_agent_conversation_response_request( - agent_name=agent_name, - conversation_id=conversation_id, - response_id=response_id, + _request = build_indexes_create_or_update_request( + name=name, + version=version, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -7062,287 +9818,163 @@ def get_agent_conversation_response( response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 201]: 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) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.VoiceResponse, response.json()) + deserialized = _deserialize(_models.Index, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace - def list_agent_conversation_response_items( - self, - agent_name: str, - conversation_id: str, - response_id: str, - *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_unions.VoiceConversationItem"]: - """List items produced by a voice agent conversation response. - - Returns a paged collection of the output items produced by a specific response (the response's - output projection). For the complete ordered conversation history — including user input and - client-created tool outputs — use the conversation items route instead. Returns ``404`` when - the conversation or response was not persisted (``store = false``). - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the response. Required. - :type conversation_id: str - :param response_id: The id of the response whose output items are listed. Required. - :type response_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 VoiceSystemMessageItem or VoiceUserMessageItem or - VoiceAssistantMessageItem or VoiceFunctionCallItem or VoiceFunctionCallOutputItem or - VoiceMcpListToolsItem or VoiceMcpCallItem or VoiceMcpApprovalRequestItem or - VoiceMcpApprovalResponseItem - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.VoiceSystemMessageItem or - ~azure.ai.projects.models.VoiceUserMessageItem or - ~azure.ai.projects.models.VoiceAssistantMessageItem or - ~azure.ai.projects.models.VoiceFunctionCallItem or - ~azure.ai.projects.models.VoiceFunctionCallOutputItem or - ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem - or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or - ~azure.ai.projects.models.VoiceMcpApprovalResponseItem] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List["_unions.VoiceConversationItem"]] = 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_agent_endpoint_conversations_list_agent_conversation_response_items_request( - agent_name=agent_name, - conversation_id=conversation_id, - response_id=response_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["_unions.VoiceConversationItem"], - 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) +class ToolboxesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. - return pipeline_response + Instead, you should access the following operations through + :class:`~azure.ai.projects.AIProjectClient`'s + :attr:`toolboxes` attribute. + """ - return ItemPaged(get_next, extract_data) + 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_agent_conversation_items( + @overload + def create_version( self, - agent_name: str, - conversation_id: str, + name: str, *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, + tools: List[_models.ToolboxTool], + content_type: str = "application/json", + description: Optional[str] = None, + metadata: Optional[dict[str, str]] = None, + skills: Optional[List[_models.ToolboxSkill]] = None, + policies: Optional[_models.ToolboxPolicies] = None, **kwargs: Any - ) -> ItemPaged["_unions.VoiceConversationItem"]: - """List items in a voice agent conversation. + ) -> _models.ToolboxVersionObject: + """Create a new version of a toolbox. - Returns a paged collection of items — the complete ordered conversation history, including user - input, assistant output, and client-created tool outputs (transcripts + tool events). Returns - ``404`` when the conversation was not persisted (``store = false``). + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation whose items are listed. 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 VoiceSystemMessageItem or VoiceUserMessageItem or - VoiceAssistantMessageItem or VoiceFunctionCallItem or VoiceFunctionCallOutputItem or - VoiceMcpListToolsItem or VoiceMcpCallItem or VoiceMcpApprovalRequestItem or - VoiceMcpApprovalResponseItem - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.VoiceSystemMessageItem or - ~azure.ai.projects.models.VoiceUserMessageItem or - ~azure.ai.projects.models.VoiceAssistantMessageItem or - ~azure.ai.projects.models.VoiceFunctionCallItem or - ~azure.ai.projects.models.VoiceFunctionCallOutputItem or - ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem - or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or - ~azure.ai.projects.models.VoiceMcpApprovalResponseItem] + :param name: The name of the toolbox. If the toolbox does not exist, it will be created. + Required. + :type name: str + :keyword tools: The list of tools to include in this version. Required. + :paramtype tools: list[~azure.ai.projects.models.ToolboxTool] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword description: A human-readable description of the toolbox. Default value is None. + :paramtype description: str + :keyword metadata: Arbitrary key-value metadata to associate with the toolbox. Default value is + None. + :paramtype metadata: dict[str, str] + :keyword skills: The list of skill sources to include in this version. A skill reference + specifies a skill name and optionally a version. If version is omitted, the skill's default + version is used. Default value is None. + :paramtype skills: list[~azure.ai.projects.models.ToolboxSkill] + :keyword policies: Policy configuration for this toolbox version. Default value is None. + :paramtype policies: ~azure.ai.projects.models.ToolboxPolicies + :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxVersionObject :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List["_unions.VoiceConversationItem"]] = 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_agent_endpoint_conversations_list_agent_conversation_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["_unions.VoiceConversationItem"], - 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) + @overload + def create_version( + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ToolboxVersionObject: + """Create a new version of a toolbox. - def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response + :param name: The name of the toolbox. If the toolbox does not exist, it will be created. + Required. + :type name: str + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxVersionObject + :raises ~azure.core.exceptions.HttpResponseError: + """ - 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) + @overload + def create_version( + self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ToolboxVersionObject: + """Create a new version of a toolbox. - return pipeline_response + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. - return ItemPaged(get_next, extract_data) + :param name: The name of the toolbox. If the toolbox does not exist, it will be created. + Required. + :type name: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxVersionObject + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace - def get_agent_conversation_item( - self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any - ) -> "_unions.VoiceConversationItem": - """Get a voice agent conversation item. + def create_version( + self, + name: str, + body: Union[JSON, IO[bytes]] = _Unset, + *, + tools: List[_models.ToolboxTool] = _Unset, + description: Optional[str] = None, + metadata: Optional[dict[str, str]] = None, + skills: Optional[List[_models.ToolboxSkill]] = None, + policies: Optional[_models.ToolboxPolicies] = None, + **kwargs: Any + ) -> _models.ToolboxVersionObject: + """Create a new version of a toolbox. - Retrieves a single item from the specified conversation by its id, including its transcript. An - ``input_audio``/``output_audio`` content part indicates that audio is available for the item; - the canonical per-item audio metadata is the ``/items/{item_id}/audio`` resource, and the bytes - are streamed by ``/items/{item_id}/audio/content``. Returns ``404`` when the conversation or - item was not persisted (``store = false``). + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the item. Required. - :type conversation_id: str - :param item_id: The id of the conversation item to retrieve. Required. - :type item_id: str - :return: VoiceSystemMessageItem or VoiceUserMessageItem or VoiceAssistantMessageItem or - VoiceFunctionCallItem or VoiceFunctionCallOutputItem or VoiceMcpListToolsItem or - VoiceMcpCallItem or VoiceMcpApprovalRequestItem or VoiceMcpApprovalResponseItem - :rtype: ~azure.ai.projects.models.VoiceSystemMessageItem or - ~azure.ai.projects.models.VoiceUserMessageItem or - ~azure.ai.projects.models.VoiceAssistantMessageItem or - ~azure.ai.projects.models.VoiceFunctionCallItem or - ~azure.ai.projects.models.VoiceFunctionCallOutputItem or - ~azure.ai.projects.models.VoiceMcpListToolsItem or ~azure.ai.projects.models.VoiceMcpCallItem - or ~azure.ai.projects.models.VoiceMcpApprovalRequestItem or - ~azure.ai.projects.models.VoiceMcpApprovalResponseItem + :param name: The name of the toolbox. If the toolbox does not exist, it will be created. + Required. + :type name: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword tools: The list of tools to include in this version. Required. + :paramtype tools: list[~azure.ai.projects.models.ToolboxTool] + :keyword description: A human-readable description of the toolbox. Default value is None. + :paramtype description: str + :keyword metadata: Arbitrary key-value metadata to associate with the toolbox. Default value is + None. + :paramtype metadata: dict[str, str] + :keyword skills: The list of skill sources to include in this version. A skill reference + specifies a skill name and optionally a version. If version is omitted, the skill's default + version is used. Default value is None. + :paramtype skills: list[~azure.ai.projects.models.ToolboxSkill] + :keyword policies: Policy configuration for this toolbox version. Default value is None. + :paramtype policies: ~azure.ai.projects.models.ToolboxPolicies + :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxVersionObject :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -7353,16 +9985,35 @@ def get_agent_conversation_item( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType["_unions.VoiceConversationItem"] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ToolboxVersionObject] = kwargs.pop("cls", None) - _request = build_agent_endpoint_conversations_get_agent_conversation_item_request( - agent_name=agent_name, - conversation_id=conversation_id, - item_id=item_id, + if body is _Unset: + if tools is _Unset: + raise TypeError("missing required argument: tools") + body = { + "description": description, + "metadata": metadata, + "policies": policies, + "skills": skills, + "tools": tools, + } + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_toolboxes_create_version_request( + name=name, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -7395,7 +10046,7 @@ def get_agent_conversation_item( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize("_unions.VoiceConversationItem", response.json()) + deserialized = _deserialize(_models.ToolboxVersionObject, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -7403,27 +10054,15 @@ def get_agent_conversation_item( return deserialized # type: ignore @distributed_trace - def get_agent_conversation_item_audio( - self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any - ) -> _models.VoiceItemAudioResponse: - """Get a voice agent conversation item's audio metadata. + def get(self, name: str, **kwargs: Any) -> _models.ToolboxObject: + """Retrieve a toolbox. - Returns metadata for a single conversation item's audio segment, including the common playback - facts (role, format/codec, sample rate, channels, offset, duration) for both Foundry-managed - and bring-your-own-storage (BYOS) recordings; for BYOS the response additionally includes - ``blob_uri``, the URI of the recording in the customer's own storage (no SAS) that the customer - downloads with their own credentials. Requires the conversation to have persisted audio - (``store = true``); returns ``404`` when the conversation, item, or its audio was not - persisted. + Retrieves the specified toolbox and its current configuration. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the item. Required. - :type conversation_id: str - :param item_id: The id of the conversation item whose audio metadata is retrieved. Required. - :type item_id: str - :return: VoiceItemAudioResponse. The VoiceItemAudioResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.VoiceItemAudioResponse + :param name: The name of the toolbox to retrieve. Required. + :type name: str + :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxObject :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -7437,12 +10076,10 @@ def get_agent_conversation_item_audio( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.VoiceItemAudioResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.ToolboxObject] = kwargs.pop("cls", None) - _request = build_agent_endpoint_conversations_get_agent_conversation_item_audio_request( - agent_name=agent_name, - conversation_id=conversation_id, - item_id=item_id, + _request = build_toolboxes_get_request( + name=name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -7476,7 +10113,7 @@ def get_agent_conversation_item_audio( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.VoiceItemAudioResponse, response.json()) + deserialized = _deserialize(_models.ToolboxObject, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -7484,28 +10121,136 @@ def get_agent_conversation_item_audio( return deserialized # type: ignore @distributed_trace - def get_agent_conversation_item_audio_content( # pylint: disable=name-too-long - self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any - ) -> Iterator[bytes]: - """Stream a voice agent conversation item's audio. + def list( + self, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.ToolboxObject"]: + """List toolboxes. - Streams a single conversation item's audio as a WAV (``audio/wav``) byte stream through the - service (no SAS URL). This route serves Foundry-managed storage only. For - bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download - directly from customer storage using the ``blob_uri`` returned by the item's ``/audio`` - metadata route — so this route returns ``409 Conflict`` for BYOS recordings. Returns ``404`` - when the conversation, item, or its audio was not persisted (``store = false``). + Returns the toolboxes available in the current project. + + :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 ToolboxObject + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.ToolboxObject] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ToolboxObject]] = 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_toolboxes_list_request( + 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.ToolboxObject], + 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 list_versions( + self, + name: str, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.ToolboxVersionObject"]: + """List toolbox versions. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the item. Required. - :type conversation_id: str - :param item_id: The id of the conversation item whose audio is streamed. Required. - :type item_id: str - :return: Iterator[bytes] - :rtype: Iterator[bytes] + Returns the available versions for the specified toolbox. + + :param name: The name of the toolbox to list versions for. Required. + :type 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 ToolboxVersionObject + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.ToolboxVersionObject] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ToolboxVersionObject]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -7514,81 +10259,67 @@ def get_agent_conversation_item_audio_content( # pylint: disable=name-too-long } 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) + def prepare_request(_continuation_token=None): - _request = build_agent_endpoint_conversations_get_agent_conversation_item_audio_content_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) + _request = build_toolboxes_list_versions_request( + name=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 - _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 - ) + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ToolboxVersionObject], + 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) - response = pipeline_response.http_response + def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) - 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, + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - raise HttpResponseError(response=response, model=error) - - response_headers = {} - response_headers["Content-Type"] = self._deserialize("str", response.headers.get("Content-Type")) + response = pipeline_response.http_response - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + 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) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return pipeline_response - return deserialized # type: ignore + return ItemPaged(get_next, extract_data) @distributed_trace - def get_agent_conversation_audio( - self, agent_name: str, conversation_id: str, **kwargs: Any - ) -> _models.VoiceRecordingResponse: - """Get a voice agent conversation's merged recording metadata. + def get_version(self, name: str, version: str, **kwargs: Any) -> _models.ToolboxVersionObject: + """Retrieve a specific version of a toolbox. - Returns metadata for the whole-call merged stereo recording (user audio on the left channel, - agent audio on the right). The common metadata (format, sample rate, channels, channel layout, - duration) is returned for both Foundry-managed and bring-your-own-storage (BYOS) recordings; - for BYOS the response additionally includes ``blob_uri``, the URI of the recording in the - customer's own storage (no SAS) that the customer downloads with their own credentials. The - recording is built once from the per-turn segments after persistence finalization succeeds. - While the conversation is ``in_progress``, this route returns retriable ``409 Conflict`` with - ``error.code = recording_not_ready`` and a ``Retry-After`` header when retry guidance is - available. When the conversation is ``failed``, it returns terminal ``409 Conflict`` with - ``error.code = recording_unavailable``. For a ``completed`` conversation, metadata is available - subject to the existing BYOS behavior. Requires the conversation to have persisted audio - (``store = true``); otherwise returns ``404``. + Retrieves the specified version of a toolbox by name and version identifier. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation whose merged recording metadata is - retrieved. Required. - :type conversation_id: str - :return: VoiceRecordingResponse. The VoiceRecordingResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.VoiceRecordingResponse + :param name: The name of the toolbox. Required. + :type name: str + :param version: The version identifier to retrieve. Required. + :type version: str + :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxVersionObject :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -7602,11 +10333,11 @@ def get_agent_conversation_audio( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.VoiceRecordingResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.ToolboxVersionObject] = kwargs.pop("cls", None) - _request = build_agent_endpoint_conversations_get_agent_conversation_audio_request( - agent_name=agent_name, - conversation_id=conversation_id, + _request = build_toolboxes_get_version_request( + name=name, + version=version, api_version=self._config.api_version, headers=_headers, params=_params, @@ -7640,37 +10371,91 @@ def get_agent_conversation_audio( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.VoiceRecordingResponse, response.json()) + deserialized = _deserialize(_models.ToolboxVersionObject, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + @overload + def update( + self, name: str, *, default_version: str, content_type: str = "application/json", **kwargs: Any + ) -> _models.ToolboxObject: + """Update a toolbox to point to a specific version. + + Updates the toolbox's default version pointer to the specified version. + + :param name: The name of the toolbox to update. Required. + :type name: str + :keyword 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. + :paramtype default_version: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ToolboxObject: + """Update a toolbox to point to a specific version. + + Updates the toolbox's default version pointer to the specified version. + + :param name: The name of the toolbox to update. Required. + :type name: str + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ToolboxObject: + """Update a toolbox to point to a specific version. + + Updates the toolbox's default version pointer to the specified version. + + :param name: The name of the toolbox to update. Required. + :type name: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace - def get_agent_conversation_audio_content( - self, agent_name: str, conversation_id: str, **kwargs: Any - ) -> Iterator[bytes]: - """Stream a voice agent conversation's merged recording. + def update( + self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, default_version: str = _Unset, **kwargs: Any + ) -> _models.ToolboxObject: + """Update a toolbox to point to a specific version. - Streams the whole-call merged stereo recording as a WAV (``audio/wav``) byte stream through the - service (no SAS URL). This route serves Foundry-managed storage only. For - bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download - directly from customer storage using the ``blob_uri`` returned by the metadata route — so this - route returns ``409 Conflict`` for BYOS recordings. While the conversation is ``in_progress``, - this route returns retriable ``409 Conflict`` with ``error.code = recording_not_ready`` and a - ``Retry-After`` header when retry guidance is available. When the conversation is ``failed``, - it returns terminal ``409 Conflict`` with ``error.code = recording_unavailable``. For a - ``completed`` conversation, content is available subject to the existing BYOS behavior. A - conversation without persisted audio (``store = false``) returns ``404``. + Updates the toolbox's default version pointer to the specified version. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation whose merged recording is streamed. - Required. - :type conversation_id: str - :return: Iterator[bytes] - :rtype: Iterator[bytes] + :param name: The name of the toolbox to update. Required. + :type name: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword 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. + :paramtype default_version: str + :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxObject :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -7681,15 +10466,29 @@ def get_agent_conversation_audio_content( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ToolboxObject] = kwargs.pop("cls", None) + + if body is _Unset: + if default_version is _Unset: + raise TypeError("missing required argument: default_version") + body = {"default_version": default_version} + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_agent_endpoint_conversations_get_agent_conversation_audio_content_request( - agent_name=agent_name, - conversation_id=conversation_id, + _request = build_toolboxes_update_request( + name=name, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -7699,7 +10498,7 @@ def get_agent_conversation_audio_content( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", True) + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -7719,44 +10518,26 @@ def get_agent_conversation_audio_content( ) 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 _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ToolboxObject, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - -class EvaluationRulesOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.projects.AIProjectClient`'s - :attr:`evaluation_rules` 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 get(self, id: str, **kwargs: Any) -> _models.EvaluationRule: - """Get an evaluation rule. + def delete(self, name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """Delete a toolbox. - Retrieves the specified evaluation rule and its configuration. + Removes the specified toolbox along with all of its versions. - :param id: Unique identifier for the evaluation rule. Required. - :type id: str - :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationRule + :param name: The name of the toolbox to delete. Required. + :type name: str + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -7770,10 +10551,10 @@ def get(self, id: str, **kwargs: Any) -> _models.EvaluationRule: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.EvaluationRule] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_evaluation_rules_get_request( - id=id, + _request = build_toolboxes_delete_request( + name=name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -7783,41 +10564,36 @@ def get(self, id: str, **kwargs: Any) -> _models.EvaluationRule: } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _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 + if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EvaluationRule, response.json()) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace - def delete(self, id: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """Delete an evaluation rule. + def delete_version( # pylint: disable=inconsistent-return-statements + self, name: str, version: str, **kwargs: Any + ) -> None: + """Delete a specific version of a toolbox. - Removes the specified evaluation rule from the project. + Removes the specified version of a toolbox. - :param id: Unique identifier for the evaluation rule. Required. - :type id: str + :param name: The name of the toolbox. Required. + :type name: str + :param version: The version identifier to delete. Required. + :type version: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -7835,8 +10611,9 @@ def delete(self, id: str, **kwargs: Any) -> None: # pylint: disable=inconsisten cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_evaluation_rules_delete_request( - id=id, + _request = build_toolboxes_delete_version_request( + name=name, + version=version, api_version=self._config.api_version, headers=_headers, params=_params, @@ -7855,86 +10632,83 @@ def delete(self, id: str, **kwargs: Any) -> None: # pylint: disable=inconsisten if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) if cls: return cls(pipeline_response, None, {}) # type: ignore - @overload - def create_or_update( - self, id: str, evaluation_rule: _models.EvaluationRule, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluationRule: - """Create or update an evaluation rule. - - Creates a new evaluation rule, or replaces the existing rule when the identifier matches. - - :param id: Unique identifier for the evaluation rule. Required. - :type id: str - :param evaluation_rule: Evaluation rule resource. Required. - :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, id: str, evaluation_rule: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluationRule: - """Create or update an evaluation rule. - - Creates a new evaluation rule, or replaces the existing rule when the identifier matches. - - :param id: Unique identifier for the evaluation rule. Required. - :type id: str - :param evaluation_rule: Evaluation rule resource. Required. - :type evaluation_rule: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - @overload - def create_or_update( - self, id: str, evaluation_rule: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluationRule: - """Create or update an evaluation rule. +class BetaVoiceAgentWebSocketOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. - Creates a new evaluation rule, or replaces the existing rule when the identifier matches. + Instead, you should access the following operations through + :class:`~azure.ai.projects.AIProjectClient`'s + :attr:`voice_agent_web_socket` attribute. + """ - :param id: Unique identifier for the evaluation rule. Required. - :type id: str - :param evaluation_rule: Evaluation rule resource. Required. - :type evaluation_rule: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationRule - :raises ~azure.core.exceptions.HttpResponseError: - """ + 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 create_or_update( - self, id: str, evaluation_rule: Union[_models.EvaluationRule, JSON, IO[bytes]], **kwargs: Any - ) -> _models.EvaluationRule: - """Create or update an evaluation rule. + def connect_voice_agent( # pylint: disable=inconsistent-return-statements + self, + agent_name: str, + *, + foundry_features_query: Optional[Literal[_AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW]] = None, + store: Optional[bool] = None, + agent_version_override: Optional[str] = None, + websocket_subprotocol: Optional[Union[str, _models.VoiceAgentWebSocketSubprotocol]] = None, + **kwargs: Any + ) -> None: + """Connect to a voice agent. - Creates a new evaluation rule, or replaces the existing rule when the identifier matches. + Connects to a voice agent over WebSocket. The client must send an HTTP GET with ``Upgrade: + websocket`` + headers. The optional ``realtime`` subprotocol is the only accepted subprotocol value. Supply + the + ``VoiceAgents=V1Preview`` opt-in through either the ``Foundry-Features`` header or the + ``foundry_features`` + query parameter. - :param id: Unique identifier for the evaluation rule. Required. - :type id: str - :param evaluation_rule: Evaluation rule resource. Is one of the following types: - EvaluationRule, JSON, IO[bytes] Required. - :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule or JSON or IO[bytes] - :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationRule + If the target agent is disabled, the HTTP WebSocket handshake fails before the ``101 Switching + Protocols`` + upgrade. The service returns ``409 Conflict`` using the shared Foundry ``ApiErrorResponse`` + shape with + ``error.code = agent_disabled``. This failure is terminal until the caller enables the agent. + + :param agent_name: The name of the voice agent. Required. + :type agent_name: str + :keyword foundry_features_query: A query alternative to the ``Foundry-Features`` header for + clients that cannot set headers during a + WebSocket handshake. Set this to ``VoiceAgents=V1Preview``. Either this query parameter or the + header is + required. VOICE_AGENTS_V1_PREVIEW. Default value is None. + :paramtype foundry_features_query: str or ~azure.ai.projects.models.VOICE_AGENTS_V1_PREVIEW + :keyword store: Whether to persist the conversation created by this WebSocket session. If + omitted, the service honors the + persisted voice agent definition's configured ``store`` value. If supplied, this value + overrides the + definition's ``store`` setting for this session only. Default value is None. + :paramtype store: bool + :keyword agent_version_override: Selects a specific version of the voice agent for this + session. Default value is None. + :paramtype agent_version_override: str + :keyword websocket_subprotocol: The requested WebSocket subprotocol. Omit this header or + request exactly ``realtime``. "realtime" Default value is None. + :paramtype websocket_subprotocol: str or + ~azure.ai.projects.models.VoiceAgentWebSocketSubprotocol + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -7945,24 +10719,18 @@ def create_or_update( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EvaluationRule] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(evaluation_rule, (IOBase, bytes)): - _content = evaluation_rule - else: - _content = json.dumps(evaluation_rule, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_evaluation_rules_create_or_update_request( - id=id, - content_type=content_type, + _request = build_beta_voice_agent_web_socket_connect_voice_agent_request( + agent_name=agent_name, + foundry_features_query=foundry_features_query, + store=store, + agent_version_override=agent_version_override, + websocket_subprotocol=websocket_subprotocol, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -7971,62 +10739,87 @@ def create_or_update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _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, 201]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [101]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + 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.EvaluationRule, response.json()) + response_headers = {} + response_headers["Sec-WebSocket-Protocol"] = self._deserialize( + "str", response.headers.get("Sec-WebSocket-Protocol") + ) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, None, response_headers) # type: ignore - return deserialized # type: ignore + +class BetaAgentEndpointConversationsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.AIProjectClient`'s + :attr:`agent_endpoint_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( + def list_agent_conversations( self, + agent_name: str, *, - action_type: Optional[Union[str, _models.EvaluationRuleActionType]] = None, - agent_name: Optional[str] = None, - enabled: Optional[bool] = None, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.EvaluationRule"]: - """List evaluation rules. + ) -> ItemPaged["_models.VoiceConversation"]: + """List voice agent conversations. - Returns the evaluation rules configured for the project, optionally filtered by action type, - agent name, or enabled state. + Returns the conversations persisted for the specified voice agent endpoint. Conversations are + present when the session's effective ``store`` setting is ``true``, whether inherited from the + agent definition or enabled by the WebSocket session override. - :keyword action_type: Filter by the type of evaluation rule. Known values are: - "continuousEvaluation" and "humanEvaluationPreview". Default value is None. - :paramtype action_type: str or ~azure.ai.projects.models.EvaluationRuleActionType - :keyword agent_name: Filter by the agent name. Default value is None. - :paramtype agent_name: str - :keyword enabled: Filter by the enabled status. Default value is None. - :paramtype enabled: bool - :return: An iterator like instance of EvaluationRule - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.EvaluationRule] + :param agent_name: The name of the 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 VoiceConversation + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.VoiceConversation] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.EvaluationRule]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.VoiceConversation]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -8036,61 +10829,36 @@ def list( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_evaluation_rules_list_request( - action_type=action_type, - agent_name=agent_name, - enabled=enabled, - 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) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_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) + def prepare_request(_continuation_token=None): + _request = build_beta_agent_endpoint_conversations_list_agent_conversations_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.EvaluationRule], - deserialized.get("value", []), + List[_models.VoiceConversation], + deserialized.get("data", []), ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) + return deserialized.get("last_id") or None, iter(list_of_elem) - def get_next(next_link=None): - _request = prepare_request(next_link) + def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access @@ -8100,109 +10868,29 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) return pipeline_response return ItemPaged(get_next, extract_data) - -class ConnectionsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.projects.AIProjectClient`'s - :attr:`connections` 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 _get(self, name: str, **kwargs: Any) -> _models.Connection: - """Get a connection. - - Retrieves the specified connection and its configuration details without including credential - values. - - :param name: The friendly name of the connection, provided by the user. Required. - :type name: str - :return: Connection. The Connection is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Connection - :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.Connection] = kwargs.pop("cls", None) - - _request = build_connections_get_request( - name=name, - 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) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["x-ms-client-request-id"] = self._deserialize( - "str", response.headers.get("x-ms-client-request-id") - ) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Connection, response.json()) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - @distributed_trace - def _get_with_credentials(self, name: str, **kwargs: Any) -> _models.Connection: - """Get a connection with credentials. + def get_agent_conversation(self, agent_name: str, conversation_id: str, **kwargs: Any) -> _models.VoiceConversation: + """Get a voice agent conversation. - Retrieves the specified connection together with its credential values. + Retrieves a single conversation recorded for the specified voice agent endpoint by its id. + Returns ``404`` when the conversation was not persisted (``store = false``) or does not exist. - :param name: The friendly name of the connection, provided by the user. Required. - :type name: str - :return: Connection. The Connection is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Connection + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation to retrieve. Required. + :type conversation_id: str + :return: VoiceConversation. The VoiceConversation is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceConversation :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -8216,10 +10904,11 @@ def _get_with_credentials(self, name: str, **kwargs: Any) -> _models.Connection: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Connection] = kwargs.pop("cls", None) + cls: ClsType[_models.VoiceConversation] = kwargs.pop("cls", None) - _request = build_connections_get_with_credentials_request( - name=name, + _request = build_beta_agent_endpoint_conversations_get_agent_conversation_request( + agent_name=agent_name, + conversation_id=conversation_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -8244,52 +10933,39 @@ def _get_with_credentials(self, name: str, **kwargs: Any) -> _models.Connection: except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["x-ms-client-request-id"] = self._deserialize( - "str", response.headers.get("x-ms-client-request-id") - ) + 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.Connection, response.json()) + deserialized = _deserialize(_models.VoiceConversation, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace - def list( - self, - *, - connection_type: Optional[Union[str, _models.ConnectionType]] = None, - default_connection: Optional[bool] = None, - **kwargs: Any - ) -> ItemPaged["_models.Connection"]: - """List connections. + def delete_agent_conversation( # pylint: disable=inconsistent-return-statements + self, agent_name: str, conversation_id: str, **kwargs: Any + ) -> None: + """Delete a voice agent conversation. - Returns the connections available in the current project, optionally filtered by type or - default status. + Deletes a conversation and all of its stored data — responses, items, and any audio (cascade). + This is the customer's explicit data-deletion control for voice conversations. - :keyword connection_type: Lists connections of this specific type. Known values are: - "AzureOpenAI", "AzureBlob", "AzureStorageAccount", "CognitiveSearch", "CosmosDB", "ApiKey", - "AppConfig", "AppInsights", "CustomKeys", and "RemoteTool_Preview". Default value is None. - :paramtype connection_type: str or ~azure.ai.projects.models.ConnectionType - :keyword default_connection: Lists connections that are default connections. Default value is - None. - :paramtype default_connection: bool - :return: An iterator like instance of Connection - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.Connection] + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation to delete. Required. + :type conversation_id: str + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Connection]] = kwargs.pop("cls", None) - error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -8298,200 +10974,85 @@ def list( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_connections_list_request( - connection_type=connection_type, - default_connection=default_connection, - 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) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_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.Connection], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _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) - raise HttpResponseError(response=response) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class DatasetsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.projects.AIProjectClient`'s - :attr:`datasets` 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_versions(self, name: str, **kwargs: Any) -> ItemPaged["_models.DatasetVersion"]: - """List versions. - - List all versions of the given DatasetVersion. - - :param name: The name of the resource. Required. - :type name: str - :return: An iterator like instance of DatasetVersion - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.DatasetVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.DatasetVersion]] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, + _request = build_beta_agent_endpoint_conversations_delete_agent_conversation_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), } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_datasets_list_versions_request( - name=name, - 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) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_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.DatasetVersion], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) + _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 + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + response = pipeline_response.http_response - return pipeline_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) - return ItemPaged(get_next, extract_data) + if cls: + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged["_models.DatasetVersion"]: - """List latest versions. + def list_agent_conversation_responses( + 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.VoiceResponse"]: + """List responses in a voice agent conversation. - List the latest version of each DatasetVersion. + Returns a paged collection of the responses (model inference turns) recorded for the specified + conversation. The per-response ``output`` projection may be omitted here; use the + response-items route for the canonical paged output. Returns ``404`` when the conversation was + not persisted (``store = false``). - :return: An iterator like instance of DatasetVersion - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.DatasetVersion] + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose responses are listed. 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 VoiceResponse + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.VoiceResponse] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.DatasetVersion]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.VoiceResponse]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -8501,58 +11062,37 @@ def list(self, **kwargs: Any) -> ItemPaged["_models.DatasetVersion"]: } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_datasets_list_request( - 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) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_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) + def prepare_request(_continuation_token=None): + _request = build_beta_agent_endpoint_conversations_list_agent_conversation_responses_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.DatasetVersion], - deserialized.get("value", []), + List[_models.VoiceResponse], + deserialized.get("data", []), ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) + return deserialized.get("last_id") or None, iter(list_of_elem) - def get_next(next_link=None): - _request = prepare_request(next_link) + def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access @@ -8562,25 +11102,34 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + 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, name: str, version: str, **kwargs: Any) -> _models.DatasetVersion: - """Get a version. + def get_agent_conversation_response( + self, agent_name: str, conversation_id: str, response_id: str, **kwargs: Any + ) -> _models.VoiceResponse: + """Get a voice agent conversation response. - Get the specific version of the DatasetVersion. The service returns 404 Not Found error if the - DatasetVersion does not exist. + Retrieves a single response from the specified conversation by its id, including its ``output`` + items, ``usage``, and status. Returns ``404`` when the conversation or response was not + persisted (``store = false``). - :param name: The name of the resource. Required. - :type name: str - :param version: The specific version id of the DatasetVersion to retrieve. Required. - :type version: str - :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetVersion + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the response. Required. + :type conversation_id: str + :param response_id: The id of the response to retrieve. Required. + :type response_id: str + :return: VoiceResponse. The VoiceResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -8594,11 +11143,12 @@ def get(self, name: str, version: str, **kwargs: Any) -> _models.DatasetVersion: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DatasetVersion] = kwargs.pop("cls", None) + cls: ClsType[_models.VoiceResponse] = kwargs.pop("cls", None) - _request = build_datasets_get_request( - name=name, - version=version, + _request = build_beta_agent_endpoint_conversations_get_agent_conversation_response_request( + agent_name=agent_name, + conversation_id=conversation_id, + response_id=response_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -8623,33 +11173,173 @@ def get(self, name: str, version: str, **kwargs: Any) -> _models.DatasetVersion: except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + 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.VoiceResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_agent_conversation_response_items( + self, + agent_name: str, + conversation_id: str, + response_id: str, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.RealtimeConversationItem"]: + """List items produced by a voice agent conversation response. + + Returns a paged collection of the output items produced by a specific response (the response's + output projection). For the complete ordered conversation history — including user input and + client-created tool outputs — use the conversation items route instead. Returns ``404`` when + the conversation or response was not persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the response. Required. + :type conversation_id: str + :param response_id: The id of the response whose output items are listed. Required. + :type response_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 RealtimeConversationItem + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.RealtimeConversationItem] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.RealtimeConversationItem]] = 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_agent_endpoint_conversations_list_agent_conversation_response_items_request( + agent_name=agent_name, + conversation_id=conversation_id, + response_id=response_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.RealtimeConversationItem], + 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 _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.DatasetVersion, response.json()) + 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) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return pipeline_response - return deserialized # type: ignore + return ItemPaged(get_next, extract_data) @distributed_trace - def delete(self, name: str, version: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """Delete a version. + def list_agent_conversation_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.RealtimeConversationItem"]: + """List items in a voice agent conversation. - Delete the specific version of the DatasetVersion. The service returns 204 No Content if the - DatasetVersion was deleted successfully or if the DatasetVersion does not exist. + Returns a paged collection of items — the complete ordered conversation history, including user + input, assistant output, and client-created tool outputs (transcripts + tool events). Returns + ``404`` when the conversation was not persisted (``store = false``). - :param name: The name of the resource. Required. - :type name: str - :param version: The version of the DatasetVersion to delete. Required. - :type version: str - :return: None - :rtype: None + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose items are listed. 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 RealtimeConversationItem + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.RealtimeConversationItem] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.RealtimeConversationItem]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -8658,138 +11348,77 @@ def delete(self, name: str, version: str, **kwargs: Any) -> None: # pylint: dis } 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_datasets_delete_request( - name=name, - version=version, - 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) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def create_or_update( - self, - name: str, - version: str, - dataset_version: _models.DatasetVersion, - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> _models.DatasetVersion: - """Create or update a version. - - Create a new or update an existing DatasetVersion with the given version id. + def prepare_request(_continuation_token=None): - :param name: The name of the resource. Required. - :type name: str - :param version: The specific version id of the DatasetVersion to create or update. Required. - :type version: str - :param dataset_version: The DatasetVersion to create or update. Required. - :type dataset_version: ~azure.ai.projects.models.DatasetVersion - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/merge-patch+json". - :paramtype content_type: str - :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ + _request = build_beta_agent_endpoint_conversations_list_agent_conversation_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 - @overload - def create_or_update( - self, - name: str, - version: str, - dataset_version: JSON, - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> _models.DatasetVersion: - """Create or update a version. + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.RealtimeConversationItem], + 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) - Create a new or update an existing DatasetVersion with the given version id. + def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) - :param name: The name of the resource. Required. - :type name: str - :param version: The specific version id of the DatasetVersion to create or update. Required. - :type version: str - :param dataset_version: The DatasetVersion to create or update. Required. - :type dataset_version: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/merge-patch+json". - :paramtype content_type: str - :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response - @overload - def create_or_update( - self, - name: str, - version: str, - dataset_version: IO[bytes], - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> _models.DatasetVersion: - """Create or update a version. + 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) - Create a new or update an existing DatasetVersion with the given version id. + return pipeline_response - :param name: The name of the resource. Required. - :type name: str - :param version: The specific version id of the DatasetVersion to create or update. Required. - :type version: str - :param dataset_version: The DatasetVersion to create or update. Required. - :type dataset_version: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/merge-patch+json". - :paramtype content_type: str - :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ + return ItemPaged(get_next, extract_data) @distributed_trace - def create_or_update( - self, name: str, version: str, dataset_version: Union[_models.DatasetVersion, JSON, IO[bytes]], **kwargs: Any - ) -> _models.DatasetVersion: - """Create or update a version. + def get_agent_conversation_item( + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.RealtimeConversationItem: + """Get a voice agent conversation item. - Create a new or update an existing DatasetVersion with the given version id. + Retrieves a single item from the specified conversation by its id, including its transcript. An + ``input_audio``/``output_audio`` content part indicates that audio is available for the item; + the canonical per-item audio metadata is the ``/items/{item_id}/audio`` resource, and the bytes + are streamed by ``/items/{item_id}/audio/content``. Returns ``404`` when the conversation or + item was not persisted (``store = false``). - :param name: The name of the resource. Required. - :type name: str - :param version: The specific version id of the DatasetVersion to create or update. Required. - :type version: str - :param dataset_version: The DatasetVersion to create or update. Is one of the following types: - DatasetVersion, JSON, IO[bytes] Required. - :type dataset_version: ~azure.ai.projects.models.DatasetVersion or JSON or IO[bytes] - :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetVersion + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item to retrieve. Required. + :type item_id: str + :return: RealtimeConversationItem. The RealtimeConversationItem is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.RealtimeConversationItem :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -8800,25 +11429,16 @@ def create_or_update( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DatasetVersion] = kwargs.pop("cls", None) - - content_type = content_type or "application/merge-patch+json" - _content = None - if isinstance(dataset_version, (IOBase, bytes)): - _content = dataset_version - else: - _content = json.dumps(dataset_version, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.RealtimeConversationItem] = kwargs.pop("cls", None) - _request = build_datasets_create_or_update_request( - name=name, - version=version, - content_type=content_type, + _request = build_beta_agent_endpoint_conversations_get_agent_conversation_item_request( + agent_name=agent_name, + conversation_id=conversation_id, + item_id=item_id, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -8835,131 +11455,51 @@ def create_or_update( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + 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) - raise HttpResponseError(response=response) + 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.DatasetVersion, response.json()) + deserialized = _deserialize(_models.RealtimeConversationItem, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @overload - def pending_upload( - self, - name: str, - version: str, - pending_upload_request: _models.PendingUploadRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PendingUploadResponse: - """Start a pending upload. - - Initiates a new pending upload or retrieves an existing one for the specified dataset version. - - :param name: The name of the resource. Required. - :type name: str - :param version: The specific version id of the DatasetVersion to operate on. Required. - :type version: str - :param pending_upload_request: The pending upload request parameters. Required. - :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def pending_upload( - self, - name: str, - version: str, - pending_upload_request: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PendingUploadResponse: - """Start a pending upload. - - Initiates a new pending upload or retrieves an existing one for the specified dataset version. - - :param name: The name of the resource. Required. - :type name: str - :param version: The specific version id of the DatasetVersion to operate on. Required. - :type version: str - :param pending_upload_request: The pending upload request parameters. Required. - :type pending_upload_request: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def pending_upload( - self, - name: str, - version: str, - pending_upload_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PendingUploadResponse: - """Start a pending upload. - - Initiates a new pending upload or retrieves an existing one for the specified dataset version. - - :param name: The name of the resource. Required. - :type name: str - :param version: The specific version id of the DatasetVersion to operate on. Required. - :type version: str - :param pending_upload_request: The pending upload request parameters. Required. - :type pending_upload_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace - def pending_upload( - self, - name: str, - version: str, - pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.PendingUploadResponse: - """Start a pending upload. + def get_agent_conversation_item_audio( + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.VoiceItemAudioResponse: + """Get a voice agent conversation item's audio metadata. - Initiates a new pending upload or retrieves an existing one for the specified dataset version. + Returns metadata for a single conversation item's audio segment, including the common playback + facts (role, format/codec, sample rate, channels, offset, duration) for both Foundry-managed + and bring-your-own-storage (BYOS) recordings; for BYOS the response additionally includes + ``blob_uri``, the URI of the recording in the customer's own storage (no SAS) that the customer + downloads with their own credentials. Requires the conversation to have persisted audio + (``store = true``); returns ``404`` when the conversation, item, or its audio was not + persisted. - :param name: The name of the resource. Required. - :type name: str - :param version: The specific version id of the DatasetVersion to operate on. Required. - :type version: str - :param pending_upload_request: The pending upload request parameters. Is one of the following - types: PendingUploadRequest, JSON, IO[bytes] Required. - :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or JSON or - IO[bytes] - :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose audio metadata is retrieved. Required. + :type item_id: str + :return: VoiceItemAudioResponse. The VoiceItemAudioResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceItemAudioResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -8970,25 +11510,16 @@ def pending_upload( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PendingUploadResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(pending_upload_request, (IOBase, bytes)): - _content = pending_upload_request - else: - _content = json.dumps(pending_upload_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.VoiceItemAudioResponse] = kwargs.pop("cls", None) - _request = build_datasets_pending_upload_request( - name=name, - version=version, - content_type=content_type, + _request = build_beta_agent_endpoint_conversations_get_agent_conversation_item_audio_request( + agent_name=agent_name, + conversation_id=conversation_id, + item_id=item_id, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -9012,12 +11543,16 @@ def pending_upload( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + 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.PendingUploadResponse, response.json()) + deserialized = _deserialize(_models.VoiceItemAudioResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -9025,17 +11560,26 @@ def pending_upload( return deserialized # type: ignore @distributed_trace - def get_credentials(self, name: str, version: str, **kwargs: Any) -> _models.DatasetCredential: - """Get dataset credentials. + def get_agent_conversation_item_audio_content( # pylint: disable=name-too-long + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> Iterator[bytes]: + """Stream a voice agent conversation item's audio. - Retrieves the SAS credential to access the storage account associated with a dataset version. + Streams a single conversation item's audio as a WAV (``audio/wav``) byte stream through the + service (no SAS URL). This route serves Foundry-managed storage only. For + bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download + directly from customer storage using the ``blob_uri`` returned by the item's ``/audio`` + metadata route — so this route returns ``409 Conflict`` for BYOS recordings. Returns ``404`` + when the conversation, item, or its audio was not persisted (``store = false``). - :param name: The name of the resource. Required. - :type name: str - :param version: The specific version id of the DatasetVersion to operate on. Required. - :type version: str - :return: DatasetCredential. The DatasetCredential is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetCredential + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose audio is streamed. Required. + :type item_id: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -9049,11 +11593,12 @@ def get_credentials(self, name: str, version: str, **kwargs: Any) -> _models.Dat _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DatasetCredential] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_datasets_get_credentials_request( - name=name, - version=version, + _request = build_beta_agent_endpoint_conversations_get_agent_conversation_item_audio_content_request( + agent_name=agent_name, + conversation_id=conversation_id, + item_id=item_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -9064,7 +11609,7 @@ def get_credentials(self, name: str, version: str, **kwargs: Any) -> _models.Dat _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = kwargs.pop("stream", True) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -9078,46 +11623,48 @@ def get_credentials(self, name: str, version: str, **kwargs: Any) -> _models.Dat except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + 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.DatasetCredential, response.json()) + 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, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - -class DeploymentsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.projects.AIProjectClient`'s - :attr:`deployments` 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 get(self, name: str, **kwargs: Any) -> _models.Deployment: - """Get a deployment. - - Retrieves a deployed model. + def get_agent_conversation_audio( + self, agent_name: str, conversation_id: str, **kwargs: Any + ) -> _models.VoiceRecordingResponse: + """Get a voice agent conversation's merged recording metadata. - :param name: Name of the deployment. Required. - :type name: str - :return: Deployment. The Deployment is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Deployment + Returns metadata for the whole-call merged stereo recording (user audio on the left channel, + agent audio on the right). The common metadata (format, sample rate, channels, channel layout, + duration) is returned for both Foundry-managed and bring-your-own-storage (BYOS) recordings; + for BYOS the response additionally includes ``blob_uri``, the URI of the recording in the + customer's own storage (no SAS) that the customer downloads with their own credentials. The + recording is built once from the per-turn segments after persistence finalization succeeds. + While the conversation is ``in_progress``, this route returns retriable ``409 Conflict`` with + ``error.code = recording_not_ready`` and a ``Retry-After`` header when retry guidance is + available. When the conversation is ``failed``, it returns terminal ``409 Conflict`` with + ``error.code = recording_unavailable``. For a ``completed`` conversation, metadata is available + subject to the existing BYOS behavior. Requires the conversation to have persisted audio + (``store = true``); otherwise returns ``404``. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose merged recording metadata is + retrieved. Required. + :type conversation_id: str + :return: VoiceRecordingResponse. The VoiceRecordingResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceRecordingResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -9131,10 +11678,11 @@ def get(self, name: str, **kwargs: Any) -> _models.Deployment: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Deployment] = kwargs.pop("cls", None) + cls: ClsType[_models.VoiceRecordingResponse] = kwargs.pop("cls", None) - _request = build_deployments_get_request( - name=name, + _request = build_beta_agent_endpoint_conversations_get_agent_conversation_audio_request( + agent_name=agent_name, + conversation_id=conversation_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -9159,54 +11707,48 @@ def get(self, name: str, **kwargs: Any) -> _models.Deployment: except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["x-ms-client-request-id"] = self._deserialize( - "str", response.headers.get("x-ms-client-request-id") - ) + 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.Deployment, response.json()) + deserialized = _deserialize(_models.VoiceRecordingResponse, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace - def list( - self, - *, - model_publisher: Optional[str] = None, - model_name: Optional[str] = None, - deployment_type: Optional[Union[str, _models.DeploymentType]] = None, - **kwargs: Any - ) -> ItemPaged["_models.Deployment"]: - """List deployments. + def get_agent_conversation_audio_content( + self, agent_name: str, conversation_id: str, **kwargs: Any + ) -> Iterator[bytes]: + """Stream a voice agent conversation's merged recording. - Returns the deployed models available in the current project, optionally filtered by publisher, - model name, or deployment type. + Streams the whole-call merged stereo recording as a WAV (``audio/wav``) byte stream through the + service (no SAS URL). This route serves Foundry-managed storage only. For + bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download + directly from customer storage using the ``blob_uri`` returned by the metadata route — so this + route returns ``409 Conflict`` for BYOS recordings. While the conversation is ``in_progress``, + this route returns retriable ``409 Conflict`` with ``error.code = recording_not_ready`` and a + ``Retry-After`` header when retry guidance is available. When the conversation is ``failed``, + it returns terminal ``409 Conflict`` with ``error.code = recording_unavailable``. For a + ``completed`` conversation, content is available subject to the existing BYOS behavior. A + conversation without persisted audio (``store = false``) returns ``404``. - :keyword model_publisher: Model publisher to filter models by. Default value is None. - :paramtype model_publisher: str - :keyword model_name: Model name (the publisher specific name) to filter models by. Default - value is None. - :paramtype model_name: str - :keyword deployment_type: Type of deployment to filter list by. "ModelDeployment" Default value - is None. - :paramtype deployment_type: str or ~azure.ai.projects.models.DeploymentType - :return: An iterator like instance of Deployment - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.Deployment] + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose merged recording is streamed. + Required. + :type conversation_id: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Deployment]] = kwargs.pop("cls", None) - error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -9215,85 +11757,63 @@ def list( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_deployments_list_request( - model_publisher=model_publisher, - model_name=model_name, - deployment_type=deployment_type, - 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) + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_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) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - return _request + _request = build_beta_agent_endpoint_conversations_get_agent_conversation_audio_content_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) - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Deployment], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) + _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 + ) - def get_next(next_link=None): - _request = prepare_request(next_link) + response = pipeline_response.http_response - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + 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, ) - response = pipeline_response.http_response + raise HttpResponseError(response=response, model=error) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + response_headers = {} + response_headers["Content-Type"] = self._deserialize("str", response.headers.get("Content-Type")) - return pipeline_response + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - return ItemPaged(get_next, extract_data) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore -class IndexesOperations: # pylint: disable=docstring-missing-param +class BetaAgentInsightMonitorsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.ai.projects.AIProjectClient`'s - :attr:`indexes` attribute. + :attr:`agent_insight_monitors` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -9304,21 +11824,35 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list_versions(self, name: str, **kwargs: Any) -> ItemPaged["_models.Index"]: - """List versions. - - List all versions of the given Index. + def list( + self, + *, + before: Optional[str] = None, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + agent_name: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.AgentInsightMonitorListItem"]: + """List Agent Insights monitors, optionally filtered by agent name. - :param name: The name of the resource. Required. - :type name: str - :return: An iterator like instance of Index - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.Index] + :keyword before: A cursor that identifies the first item in the next page. Default value is + None. + :paramtype before: str + :keyword limit: The maximum number of items to return. Defaults to 20. Default value is None. + :paramtype limit: int + :keyword order: Sort order by creation time. Defaults to descending. Known values are: "asc" + and "desc". Default value is None. + :paramtype order: str or ~azure.ai.projects.models.PageOrder + :keyword agent_name: Filter monitors by agent name. Default value is None. + :paramtype agent_name: str + :return: An iterator like instance of AgentInsightMonitorListItem + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.AgentInsightMonitorListItem] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Index]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.AgentInsightMonitorListItem]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -9328,59 +11862,36 @@ def list_versions(self, name: str, **kwargs: Any) -> ItemPaged["_models.Index"]: } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_indexes_list_versions_request( - name=name, - 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) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_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) + def prepare_request(_continuation_token=None): + _request = build_beta_agent_insight_monitors_list_request( + after=_continuation_token, + before=before, + limit=limit, + order=order, + agent_name=agent_name, + 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.Index], - deserialized.get("value", []), + List[_models.AgentInsightMonitorListItem], + deserialized.get("data", []), ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) + return deserialized.get("last_id") or None, iter(list_of_elem) - def get_next(next_link=None): - _request = prepare_request(next_link) + def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access @@ -9390,27 +11901,77 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) return pipeline_response return ItemPaged(get_next, extract_data) - @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged["_models.Index"]: - """List latest versions. + @overload + def create( + self, monitor: _models.AgentInsightMonitorCreate, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AgentInsightMonitor: + """Create an Agent Insights monitor for an agent. - List the latest version of each Index. + :param monitor: The monitor to create. Required. + :type monitor: ~azure.ai.projects.models.AgentInsightMonitorCreate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AgentInsightMonitor. The AgentInsightMonitor is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsightMonitor + :raises ~azure.core.exceptions.HttpResponseError: + """ - :return: An iterator like instance of Index - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.Index] + @overload + def create( + self, monitor: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AgentInsightMonitor: + """Create an Agent Insights monitor for an agent. + + :param monitor: The monitor to create. Required. + :type monitor: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AgentInsightMonitor. The AgentInsightMonitor is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsightMonitor :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Index]] = kwargs.pop("cls", None) + @overload + def create( + self, monitor: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AgentInsightMonitor: + """Create an Agent Insights monitor for an agent. + :param monitor: The monitor to create. Required. + :type monitor: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AgentInsightMonitor. The AgentInsightMonitor is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsightMonitor + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create( + self, monitor: Union[_models.AgentInsightMonitorCreate, JSON, IO[bytes]], **kwargs: Any + ) -> _models.AgentInsightMonitor: + """Create an Agent Insights monitor for an agent. + + :param monitor: The monitor to create. Is one of the following types: + AgentInsightMonitorCreate, JSON, IO[bytes] Required. + :type monitor: ~azure.ai.projects.models.AgentInsightMonitorCreate or JSON or IO[bytes] + :return: AgentInsightMonitor. The AgentInsightMonitor is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsightMonitor + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -9419,86 +11980,73 @@ def list(self, **kwargs: Any) -> ItemPaged["_models.Index"]: } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - _request = build_indexes_list_request( - 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) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AgentInsightMonitor] = kwargs.pop("cls", None) - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_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) + content_type = content_type or "application/json" + _content = None + if isinstance(monitor, (IOBase, bytes)): + _content = monitor + else: + _content = json.dumps(monitor, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - return _request + _request = build_beta_agent_insight_monitors_create_request( + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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) - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Index], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) + _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 + ) - def get_next(next_link=None): - _request = prepare_request(next_link) + response = pipeline_response.http_response - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + if response.status_code not in [201]: + 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, ) - response = pipeline_response.http_response + raise HttpResponseError(response=response, model=error) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - return pipeline_response + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.AgentInsightMonitor, response.json()) - return ItemPaged(get_next, extract_data) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore - @distributed_trace - def get(self, name: str, version: str, **kwargs: Any) -> _models.Index: - """Get a version. + return deserialized # type: ignore - Get the specific version of the Index. The service returns 404 Not Found error if the Index - does not exist. + @distributed_trace + def get(self, monitor_id: str, **kwargs: Any) -> _models.AgentInsightMonitor: + """Get an Agent Insights monitor. - :param name: The name of the resource. Required. - :type name: str - :param version: The specific version id of the Index to retrieve. Required. - :type version: str - :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :return: AgentInsightMonitor. The AgentInsightMonitor is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsightMonitor :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -9512,11 +12060,10 @@ def get(self, name: str, version: str, **kwargs: Any) -> _models.Index: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Index] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentInsightMonitor] = kwargs.pop("cls", None) - _request = build_indexes_get_request( - name=name, - version=version, + _request = build_beta_agent_insight_monitors_get_request( + monitor_id=monitor_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -9541,12 +12088,16 @@ def get(self, name: str, version: str, **kwargs: Any) -> _models.Index: except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + 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.Index, response.json()) + deserialized = _deserialize(_models.AgentInsightMonitor, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -9554,16 +12105,11 @@ def get(self, name: str, version: str, **kwargs: Any) -> _models.Index: return deserialized # type: ignore @distributed_trace - def delete(self, name: str, version: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """Delete a version. - - Delete the specific version of the Index. The service returns 204 No Content if the Index was - deleted successfully or if the Index does not exist. + def delete(self, monitor_id: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """Delete an Agent Insights monitor and all of its runs, insights, and state. - :param name: The name of the resource. Required. - :type name: str - :param version: The version of the Index to delete. Required. - :type version: str + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -9581,9 +12127,8 @@ def delete(self, name: str, version: str, **kwargs: Any) -> None: # pylint: dis cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_indexes_delete_request( - name=name, - version=version, + _request = build_beta_agent_insight_monitors_delete_request( + monitor_id=monitor_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -9602,106 +12147,87 @@ def delete(self, name: str, version: str, **kwargs: Any) -> None: # pylint: dis if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) if cls: return cls(pipeline_response, None, {}) # type: ignore @overload - def create_or_update( + def update( self, - name: str, - version: str, - index: _models.Index, + monitor_id: str, + monitor: _models.AgentInsightMonitorUpdate, *, content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> _models.Index: - """Create or update a version. + ) -> _models.AgentInsightMonitor: + """Update an Agent Insights monitor. - Create a new or update an existing Index with the given version id. - - :param name: The name of the resource. Required. - :type name: str - :param version: The specific version id of the Index to create or update. Required. - :type version: str - :param index: The Index to create or update. Required. - :type index: ~azure.ai.projects.models.Index + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :param monitor: The monitor fields to update. Required. + :type monitor: ~azure.ai.projects.models.AgentInsightMonitorUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str - :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :return: AgentInsightMonitor. The AgentInsightMonitor is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsightMonitor :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_or_update( - self, name: str, version: str, index: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> _models.Index: - """Create or update a version. - - Create a new or update an existing Index with the given version id. - - :param name: The name of the resource. Required. - :type name: str - :param version: The specific version id of the Index to create or update. Required. - :type version: str - :param index: The Index to create or update. Required. - :type index: JSON + def update( + self, monitor_id: str, monitor: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any + ) -> _models.AgentInsightMonitor: + """Update an Agent Insights monitor. + + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :param monitor: The monitor fields to update. Required. + :type monitor: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str - :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :return: AgentInsightMonitor. The AgentInsightMonitor is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsightMonitor :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_or_update( - self, - name: str, - version: str, - index: IO[bytes], - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> _models.Index: - """Create or update a version. - - Create a new or update an existing Index with the given version id. - - :param name: The name of the resource. Required. - :type name: str - :param version: The specific version id of the Index to create or update. Required. - :type version: str - :param index: The Index to create or update. Required. - :type index: IO[bytes] + def update( + self, monitor_id: str, monitor: IO[bytes], *, content_type: str = "application/merge-patch+json", **kwargs: Any + ) -> _models.AgentInsightMonitor: + """Update an Agent Insights monitor. + + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :param monitor: The monitor fields to update. Required. + :type monitor: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/merge-patch+json". :paramtype content_type: str - :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, name: str, version: str, index: Union[_models.Index, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Index: - """Create or update a version. - - Create a new or update an existing Index with the given version id. - - :param name: The name of the resource. Required. - :type name: str - :param version: The specific version id of the Index to create or update. Required. - :type version: str - :param index: The Index to create or update. Is one of the following types: Index, JSON, - IO[bytes] Required. - :type index: ~azure.ai.projects.models.Index or JSON or IO[bytes] - :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :return: AgentInsightMonitor. The AgentInsightMonitor is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsightMonitor + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, monitor_id: str, monitor: Union[_models.AgentInsightMonitorUpdate, JSON, IO[bytes]], **kwargs: Any + ) -> _models.AgentInsightMonitor: + """Update an Agent Insights monitor. + + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :param monitor: The monitor fields to update. Is one of the following types: + AgentInsightMonitorUpdate, JSON, IO[bytes] Required. + :type monitor: ~azure.ai.projects.models.AgentInsightMonitorUpdate or JSON or IO[bytes] + :return: AgentInsightMonitor. The AgentInsightMonitor is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsightMonitor :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -9716,18 +12242,17 @@ def create_or_update( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Index] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentInsightMonitor] = kwargs.pop("cls", None) content_type = content_type or "application/merge-patch+json" _content = None - if isinstance(index, (IOBase, bytes)): - _content = index + if isinstance(monitor, (IOBase, bytes)): + _content = monitor else: - _content = json.dumps(index, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(monitor, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_indexes_create_or_update_request( - name=name, - version=version, + _request = build_beta_agent_insight_monitors_update_request( + monitor_id=monitor_id, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -9747,163 +12272,395 @@ def create_or_update( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + 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) - raise HttpResponseError(response=response) + 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.Index, response.json()) + deserialized = _deserialize(_models.AgentInsightMonitor, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + @distributed_trace + def reset(self, monitor_id: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """Reset an Agent Insights monitor's overview, checkpoint, and active insight state. -class ToolboxesOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. + :param monitor_id: The identifier of the monitor. Required. + :type monitor_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 {}) - Instead, you should access the following operations through - :class:`~azure.ai.projects.AIProjectClient`'s - :attr:`toolboxes` attribute. - """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - 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") + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_beta_agent_insight_monitors_reset_request( + monitor_id=monitor_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 + + def _create_run_initial( + self, monitor_id: str, run: Union[_models.AgentInsightRunCreate, JSON, IO[bytes]], **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(run, (IOBase, bytes)): + _content = run + else: + _content = json.dumps(run, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_beta_agent_insight_monitors_create_run_request( + monitor_id=monitor_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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 = 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 [201]: + 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["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + 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 @overload - def create_version( + def begin_create_run( self, - name: str, + monitor_id: str, + run: _models.AgentInsightRunCreate, *, - tools: List[_models.ToolboxTool], content_type: str = "application/json", - description: Optional[str] = None, - metadata: Optional[dict[str, str]] = None, - skills: Optional[List[_models.ToolboxSkill]] = None, - policies: Optional[_models.ToolboxPolicies] = None, **kwargs: Any - ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. + ) -> LROPoller[_models.AgentInsightRunResult]: + """Start an Agent Insights run for a monitor. - Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :param run: Run inputs. Send an empty object to use the default 168-hour lookback window. + Required. + :type run: ~azure.ai.projects.models.AgentInsightRunCreate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns AgentInsightRunResult. The AgentInsightRunResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.AgentInsightRunResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ - :param name: The name of the toolbox. If the toolbox does not exist, it will be created. + @overload + def begin_create_run( + self, monitor_id: str, run: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[_models.AgentInsightRunResult]: + """Start an Agent Insights run for a monitor. + + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :param run: Run inputs. Send an empty object to use the default 168-hour lookback window. Required. - :type name: str - :keyword tools: The list of tools to include in this version. Required. - :paramtype tools: list[~azure.ai.projects.models.ToolboxTool] + :type run: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword description: A human-readable description of the toolbox. Default value is None. - :paramtype description: str - :keyword metadata: Arbitrary key-value metadata to associate with the toolbox. Default value is + :return: An instance of LROPoller that returns AgentInsightRunResult. The AgentInsightRunResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.AgentInsightRunResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_run( + self, monitor_id: str, run: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[_models.AgentInsightRunResult]: + """Start an Agent Insights run for a monitor. + + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :param run: Run inputs. Send an empty object to use the default 168-hour lookback window. + Required. + :type run: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns AgentInsightRunResult. The AgentInsightRunResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.AgentInsightRunResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_run( + self, monitor_id: str, run: Union[_models.AgentInsightRunCreate, JSON, IO[bytes]], **kwargs: Any + ) -> LROPoller[_models.AgentInsightRunResult]: + """Start an Agent Insights run for a monitor. + + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :param run: Run inputs. Send an empty object to use the default 168-hour lookback window. Is + one of the following types: AgentInsightRunCreate, JSON, IO[bytes] Required. + :type run: ~azure.ai.projects.models.AgentInsightRunCreate or JSON or IO[bytes] + :return: An instance of LROPoller that returns AgentInsightRunResult. The AgentInsightRunResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.AgentInsightRunResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AgentInsightRunResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_run_initial( + monitor_id=monitor_id, + run=run, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Operation-Location"] = self._deserialize( + "str", response.headers.get("Operation-Location") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = _deserialize(_models.AgentInsightRunResult, response.json().get("result", {})) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.AgentInsightRunResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AgentInsightRunResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_runs( + self, + monitor_id: str, + *, + before: Optional[str] = None, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + status: Optional[Union[str, _models.JobStatus]] = None, + trigger: Optional[Union[str, _models.AgentInsightRunTrigger]] = None, + **kwargs: Any + ) -> ItemPaged["_models.AgentInsightRun"]: + """List Agent Insights runs for a monitor. + + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :keyword before: A cursor that identifies the first item in the next page. Default value is None. - :paramtype metadata: dict[str, str] - :keyword skills: The list of skill sources to include in this version. A skill reference - specifies a skill name and optionally a version. If version is omitted, the skill's default - version is used. Default value is None. - :paramtype skills: list[~azure.ai.projects.models.ToolboxSkill] - :keyword policies: Policy configuration for this toolbox version. Default value is None. - :paramtype policies: ~azure.ai.projects.models.ToolboxPolicies - :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxVersionObject + :paramtype before: str + :keyword limit: The maximum number of items to return. Defaults to 20. Default value is None. + :paramtype limit: int + :keyword order: Sort order by creation time. Defaults to descending. Known values are: "asc" + and "desc". Default value is None. + :paramtype order: str or ~azure.ai.projects.models.PageOrder + :keyword status: Filter runs by status. Known values are: "queued", "in_progress", "succeeded", + "failed", and "cancelled". Default value is None. + :paramtype status: str or ~azure.ai.projects.models.JobStatus + :keyword trigger: Filter runs by trigger. Known values are: "on_demand" and "scheduled". + Default value is None. + :paramtype trigger: str or ~azure.ai.projects.models.AgentInsightRunTrigger + :return: An iterator like instance of AgentInsightRun + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.AgentInsightRun] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AgentInsightRun]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - @overload - def create_version( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. + def prepare_request(_continuation_token=None): - Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. + _request = build_beta_agent_insight_monitors_list_runs_request( + monitor_id=monitor_id, + after=_continuation_token, + before=before, + limit=limit, + order=order, + status=status, + trigger=trigger, + 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 - :param name: The name of the toolbox. If the toolbox does not exist, it will be created. - Required. - :type name: str - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxVersionObject - :raises ~azure.core.exceptions.HttpResponseError: - """ + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.AgentInsightRun], + 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) - @overload - def create_version( - self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. + def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) - Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response - :param name: The name of the toolbox. If the toolbox does not exist, it will be created. - Required. - :type name: str - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxVersionObject - :raises ~azure.core.exceptions.HttpResponseError: - """ + 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) - @distributed_trace - def create_version( - self, - name: str, - body: Union[JSON, IO[bytes]] = _Unset, - *, - tools: List[_models.ToolboxTool] = _Unset, - description: Optional[str] = None, - metadata: Optional[dict[str, str]] = None, - skills: Optional[List[_models.ToolboxSkill]] = None, - policies: Optional[_models.ToolboxPolicies] = None, - **kwargs: Any - ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. + return pipeline_response - Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. + return ItemPaged(get_next, extract_data) - :param name: The name of the toolbox. If the toolbox does not exist, it will be created. - Required. - :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword tools: The list of tools to include in this version. Required. - :paramtype tools: list[~azure.ai.projects.models.ToolboxTool] - :keyword description: A human-readable description of the toolbox. Default value is None. - :paramtype description: str - :keyword metadata: Arbitrary key-value metadata to associate with the toolbox. Default value is - None. - :paramtype metadata: dict[str, str] - :keyword skills: The list of skill sources to include in this version. A skill reference - specifies a skill name and optionally a version. If version is omitted, the skill's default - version is used. Default value is None. - :paramtype skills: list[~azure.ai.projects.models.ToolboxSkill] - :keyword policies: Policy configuration for this toolbox version. Default value is None. - :paramtype policies: ~azure.ai.projects.models.ToolboxPolicies - :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxVersionObject + @distributed_trace + def get_run(self, monitor_id: str, run_id: str, **kwargs: Any) -> _models.AgentInsightRun: + """Get an Agent Insights run. + + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :param run_id: The identifier of the run. Required. + :type run_id: str + :return: AgentInsightRun. The AgentInsightRun is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsightRun :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -9914,35 +12671,15 @@ def create_version( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ToolboxVersionObject] = kwargs.pop("cls", None) - - if body is _Unset: - if tools is _Unset: - raise TypeError("missing required argument: tools") - body = { - "description": description, - "metadata": metadata, - "policies": policies, - "skills": skills, - "tools": tools, - } - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.AgentInsightRun] = kwargs.pop("cls", None) - _request = build_toolboxes_create_version_request( - name=name, - content_type=content_type, + _request = build_beta_agent_insight_monitors_get_run_request( + monitor_id=monitor_id, + run_id=run_id, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -9975,7 +12712,7 @@ def create_version( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ToolboxVersionObject, response.json()) + deserialized = _deserialize(_models.AgentInsightRun, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -9983,15 +12720,15 @@ def create_version( return deserialized # type: ignore @distributed_trace - def get(self, name: str, **kwargs: Any) -> _models.ToolboxObject: - """Retrieve a toolbox. - - Retrieves the specified toolbox and its current configuration. + def cancel_run(self, monitor_id: str, run_id: str, **kwargs: Any) -> _models.AgentInsightRun: + """Cancel an Agent Insights run. - :param name: The name of the toolbox to retrieve. Required. - :type name: str - :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxObject + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :param run_id: The identifier of the run. Required. + :type run_id: str + :return: AgentInsightRun. The AgentInsightRun is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsightRun :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -10005,10 +12742,11 @@ def get(self, name: str, **kwargs: Any) -> _models.ToolboxObject: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ToolboxObject] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentInsightRun] = kwargs.pop("cls", None) - _request = build_toolboxes_get_request( - name=name, + _request = build_beta_agent_insight_monitors_cancel_run_request( + monitor_id=monitor_id, + run_id=run_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -10042,7 +12780,7 @@ def get(self, name: str, **kwargs: Any) -> _models.ToolboxObject: if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ToolboxObject, response.json()) + deserialized = _deserialize(_models.AgentInsightRun, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -10050,135 +12788,50 @@ def get(self, name: str, **kwargs: Any) -> _models.ToolboxObject: return deserialized # type: ignore @distributed_trace - def list( + def list_insights( self, + monitor_id: str, *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, before: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.ToolboxObject"]: - """List toolboxes. - - Returns the toolboxes available in the current project. - - :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 ToolboxObject - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.ToolboxObject] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ToolboxObject]] = 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_toolboxes_list_request( - 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.ToolboxObject], - 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 list_versions( - self, - name: str, - *, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, + category: Optional[str] = None, + severity: Optional[Union[str, _models.AgentInsightSeverity]] = None, + status: Optional[Union[str, _models.AgentInsightStatus]] = None, + include_details: Optional[bool] = None, **kwargs: Any - ) -> ItemPaged["_models.ToolboxVersionObject"]: - """List toolbox versions. - - Returns the available versions for the specified toolbox. + ) -> ItemPaged["_models.AgentInsight"]: + """List current insights for an Agent Insights monitor. - :param name: The name of the toolbox to list versions for. Required. - :type 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. + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :keyword before: A cursor that identifies the first item in the next page. Default value is + None. + :paramtype before: str + :keyword limit: The maximum number of items to return. Defaults to 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. + :keyword order: Sort order by creation time. Defaults to descending. 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. + :keyword category: Filter insights by category. Default value is None. + :paramtype category: str + :keyword severity: Filter insights by severity. Known values are: "high", "medium", and "low". Default value is None. - :paramtype before: str - :return: An iterator like instance of ToolboxVersionObject - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.ToolboxVersionObject] + :paramtype severity: str or ~azure.ai.projects.models.AgentInsightSeverity + :keyword status: Filter insights by lifecycle status. Known values are: "active", "resolved", + and "ignored". Default value is None. + :paramtype status: str or ~azure.ai.projects.models.AgentInsightStatus + :keyword include_details: Whether to include expanded insight details such as evidence and run + links in the response. Defaults to false. Default value is None. + :paramtype include_details: bool + :return: An iterator like instance of AgentInsight + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.AgentInsight] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ToolboxVersionObject]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.AgentInsight]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -10190,12 +12843,16 @@ def list_versions( def prepare_request(_continuation_token=None): - _request = build_toolboxes_list_versions_request( - name=name, - limit=limit, - order=order, + _request = build_beta_agent_insight_monitors_list_insights_request( + monitor_id=monitor_id, after=_continuation_token, before=before, + limit=limit, + order=order, + category=category, + severity=severity, + status=status, + include_details=include_details, api_version=self._config.api_version, headers=_headers, params=_params, @@ -10209,7 +12866,7 @@ def prepare_request(_continuation_token=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.ToolboxVersionObject], + List[_models.AgentInsight], deserialized.get("data", []), ) if cls: @@ -10238,17 +12895,20 @@ def get_next(_continuation_token=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_version(self, name: str, version: str, **kwargs: Any) -> _models.ToolboxVersionObject: - """Retrieve a specific version of a toolbox. - - Retrieves the specified version of a toolbox by name and version identifier. - - :param name: The name of the toolbox. Required. - :type name: str - :param version: The version identifier to retrieve. Required. - :type version: str - :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxVersionObject + def get_insight( + self, monitor_id: str, insight_id: str, *, include_details: Optional[bool] = None, **kwargs: Any + ) -> _models.AgentInsight: + """Get a full insight for an Agent Insights monitor. + + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :param insight_id: The identifier of the insight. Required. + :type insight_id: str + :keyword include_details: Whether to include expanded insight details such as evidence and run + links in the response. Defaults to false. Default value is None. + :paramtype include_details: bool + :return: AgentInsight. The AgentInsight is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsight :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -10262,11 +12922,12 @@ def get_version(self, name: str, version: str, **kwargs: Any) -> _models.Toolbox _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ToolboxVersionObject] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentInsight] = kwargs.pop("cls", None) - _request = build_toolboxes_get_version_request( - name=name, - version=version, + _request = build_beta_agent_insight_monitors_get_insight_request( + monitor_id=monitor_id, + insight_id=insight_id, + include_details=include_details, api_version=self._config.api_version, headers=_headers, params=_params, @@ -10300,7 +12961,7 @@ def get_version(self, name: str, version: str, **kwargs: Any) -> _models.Toolbox if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ToolboxVersionObject, response.json()) + deserialized = _deserialize(_models.AgentInsight, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -10308,83 +12969,102 @@ def get_version(self, name: str, version: str, **kwargs: Any) -> _models.Toolbox return deserialized # type: ignore @overload - def update( - self, name: str, *, default_version: str, content_type: str = "application/json", **kwargs: Any - ) -> _models.ToolboxObject: - """Update a toolbox to point to a specific version. - - Updates the toolbox's default version pointer to the specified version. + def update_insight( + self, + monitor_id: str, + insight_id: str, + update: _models.AgentInsightUpdate, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> _models.AgentInsight: + """Update the lifecycle status of an insight. - :param name: The name of the toolbox to update. Required. - :type name: str - :keyword 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. - :paramtype default_version: str + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :param insight_id: The identifier of the insight. Required. + :type insight_id: str + :param update: The insight fields to update. Required. + :type update: ~azure.ai.projects.models.AgentInsightUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". + Default value is "application/merge-patch+json". :paramtype content_type: str - :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxObject + :return: AgentInsight. The AgentInsight is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsight :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def update( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ToolboxObject: - """Update a toolbox to point to a specific version. - - Updates the toolbox's default version pointer to the specified version. + def update_insight( + self, + monitor_id: str, + insight_id: str, + update: JSON, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> _models.AgentInsight: + """Update the lifecycle status of an insight. - :param name: The name of the toolbox to update. Required. - :type name: str - :param body: Required. - :type body: JSON + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :param insight_id: The identifier of the insight. Required. + :type insight_id: str + :param update: The insight fields to update. Required. + :type update: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". + Default value is "application/merge-patch+json". :paramtype content_type: str - :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxObject + :return: AgentInsight. The AgentInsight is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsight :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def update( - self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ToolboxObject: - """Update a toolbox to point to a specific version. - - Updates the toolbox's default version pointer to the specified version. + def update_insight( + self, + monitor_id: str, + insight_id: str, + update: IO[bytes], + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> _models.AgentInsight: + """Update the lifecycle status of an insight. - :param name: The name of the toolbox to update. Required. - :type name: str - :param body: Required. - :type body: IO[bytes] + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :param insight_id: The identifier of the insight. Required. + :type insight_id: str + :param update: The insight fields to update. Required. + :type update: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". + Default value is "application/merge-patch+json". :paramtype content_type: str - :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxObject + :return: AgentInsight. The AgentInsight is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsight :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def update( - self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, default_version: str = _Unset, **kwargs: Any - ) -> _models.ToolboxObject: - """Update a toolbox to point to a specific version. - - Updates the toolbox's default version pointer to the specified version. + def update_insight( + self, + monitor_id: str, + insight_id: str, + update: Union[_models.AgentInsightUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.AgentInsight: + """Update the lifecycle status of an insight. - :param name: The name of the toolbox to update. Required. - :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword 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. - :paramtype default_version: str - :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxObject + :param monitor_id: The identifier of the monitor. Required. + :type monitor_id: str + :param insight_id: The identifier of the insight. Required. + :type insight_id: str + :param update: The insight fields to update. Is one of the following types: AgentInsightUpdate, + JSON, IO[bytes] Required. + :type update: ~azure.ai.projects.models.AgentInsightUpdate or JSON or IO[bytes] + :return: AgentInsight. The AgentInsight is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentInsight :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -10399,22 +13079,18 @@ def update( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ToolboxObject] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentInsight] = kwargs.pop("cls", None) - if body is _Unset: - if default_version is _Unset: - raise TypeError("missing required argument: default_version") - body = {"default_version": default_version} - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" + content_type = content_type or "application/merge-patch+json" _content = None - if isinstance(body, (IOBase, bytes)): - _content = body + if isinstance(update, (IOBase, bytes)): + _content = update else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(update, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_toolboxes_update_request( - name=name, + _request = build_beta_agent_insight_monitors_update_insight_request( + monitor_id=monitor_id, + insight_id=insight_id, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -10450,126 +13126,13 @@ def update( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ToolboxObject, response.json()) + deserialized = _deserialize(_models.AgentInsight, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace - def delete(self, name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """Delete a toolbox. - - Removes the specified toolbox along with all of its versions. - - :param name: The name of the toolbox to delete. Required. - :type name: 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_toolboxes_delete_request( - name=name, - 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 delete_version( # pylint: disable=inconsistent-return-statements - self, name: str, version: str, **kwargs: Any - ) -> None: - """Delete a specific version of a toolbox. - - Removes the specified version of a toolbox. - - :param name: The name of the toolbox. Required. - :type name: str - :param version: The version identifier to delete. Required. - :type version: 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_toolboxes_delete_version_request( - name=name, - version=version, - 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 - class BetaEvaluationTaxonomiesOperations: # pylint: disable=docstring-missing-param """ @@ -16078,6 +18641,7 @@ def create_or_update( enabled: Optional[bool] = None, triggers: Optional[dict[str, _models.RoutineTrigger]] = None, action: Optional[_models.RoutineAction] = None, + authorization: Optional[_models.RoutineAuthorization] = None, **kwargs: Any ) -> _models.Routine: """Create or update a routine. @@ -16098,6 +18662,9 @@ def create_or_update( :paramtype triggers: dict[str, ~azure.ai.projects.models.RoutineTrigger] :keyword action: The action executed when the routine fires. Default value is None. :paramtype action: ~azure.ai.projects.models.RoutineAction + :keyword authorization: Optional authorization configuration for dispatching a newly created + routine. Ignored when updating an existing routine. Default value is None. + :paramtype authorization: ~azure.ai.projects.models.RoutineAuthorization :return: Routine. The Routine is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Routine :raises ~azure.core.exceptions.HttpResponseError: @@ -16153,6 +18720,7 @@ def create_or_update( enabled: Optional[bool] = None, triggers: Optional[dict[str, _models.RoutineTrigger]] = None, action: Optional[_models.RoutineAction] = None, + authorization: Optional[_models.RoutineAuthorization] = None, **kwargs: Any ) -> _models.Routine: """Create or update a routine. @@ -16172,6 +18740,9 @@ def create_or_update( :paramtype triggers: dict[str, ~azure.ai.projects.models.RoutineTrigger] :keyword action: The action executed when the routine fires. Default value is None. :paramtype action: ~azure.ai.projects.models.RoutineAction + :keyword authorization: Optional authorization configuration for dispatching a newly created + routine. Ignored when updating an existing routine. Default value is None. + :paramtype authorization: ~azure.ai.projects.models.RoutineAuthorization :return: Routine. The Routine is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Routine :raises ~azure.core.exceptions.HttpResponseError: @@ -16191,7 +18762,13 @@ def create_or_update( cls: ClsType[_models.Routine] = kwargs.pop("cls", None) if body is _Unset: - body = {"action": action, "description": description, "enabled": enabled, "triggers": triggers} + body = { + "action": action, + "authorization": authorization, + "description": description, + "enabled": enabled, + "triggers": triggers, + } body = {k: v for k, v in body.items() if v is not None} content_type = content_type or "application/json" _content = None diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch.py index 3970566daddf..3b72ba8d198c 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch.py @@ -21,6 +21,8 @@ from ._patch_memories import BetaMemoryStoresOperations from ._patch_models import BetaModelsOperations from ._operations import ( + BetaAgentEndpointConversationsOperations, + BetaAgentInsightMonitorsOperations, BetaEvaluationTaxonomiesOperations, BetaInsightsOperations, BetaOperations as GeneratedBetaOperations, @@ -96,6 +98,10 @@ class BetaOperations(GeneratedBetaOperations): agents: BetaAgentsOperations """:class:`~azure.ai.projects.operations.BetaAgentsOperations` operations""" + agent_endpoint_conversations: BetaAgentEndpointConversationsOperations + """:class:`~azure.ai.projects.operations.BetaAgentEndpointConversationsOperations` operations""" + agent_insight_monitors: BetaAgentInsightMonitorsOperations + """:class:`~azure.ai.projects.operations.BetaAgentInsightMonitorsOperations` operations""" evaluation_taxonomies: BetaEvaluationTaxonomiesOperations """:class:`~azure.ai.projects.operations.BetaEvaluationTaxonomiesOperations` operations""" evaluators: BetaEvaluatorsOperations diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py index 61650e1b1bfc..6408d1b899ca 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py @@ -22,7 +22,7 @@ JSON, _Unset, ) -from .. import models as _models, types as _types +from .. import models as _models from .._utils.model_base import _deserialize from ..models import AgentOptimizationLROPoller from ..models._patch import ( @@ -421,7 +421,7 @@ def begin_create_optimization_job( @overload def begin_create_optimization_job( self, - job: _types.AgentOptimizationJob, + job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", @@ -441,7 +441,7 @@ def begin_create_optimization_job( @distributed_trace def begin_create_optimization_job( # type: ignore[reportIncompatibleMethodOverride, override] self, - job: Union[_models.AgentOptimizationJob, _types.AgentOptimizationJob, IO[bytes]], + job: Union[_models.AgentOptimizationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any, @@ -449,7 +449,7 @@ def begin_create_optimization_job( # type: ignore[reportIncompatibleMethodOverr """Create an agent optimization job. :param job: The job to create. Required. - :type job: ~azure.ai.projects.models.AgentOptimizationJob or ~azure.ai.projects.types.AgentOptimizationJob or IO[bytes] + :type job: ~azure.ai.projects.models.AgentOptimizationJob or JSON or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_datasets.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_datasets.py index c4abadc89b48..ba17a78777d7 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_datasets.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_datasets.py @@ -22,8 +22,9 @@ from ._operations import ( BetaDatasetsOperations as BetaDatasetsOperationsGenerated, DatasetsOperations as DatasetsOperationsGenerated, + JSON, ) -from .. import models as _models, types as _types +from .. import models as _models from .._utils.model_base import _deserialize from ..models import DatasetGenerationLROPoller from ..models._models import ( @@ -53,7 +54,7 @@ def begin_create_generation_job( @overload def begin_create_generation_job( self, - job: _types.DataGenerationJob, + job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", @@ -73,7 +74,7 @@ def begin_create_generation_job( @distributed_trace def begin_create_generation_job( # type: ignore[reportIncompatibleMethodOverride, override] self, - job: Union[_models.DataGenerationJob, _types.DataGenerationJob, IO[bytes]], + job: Union[_models.DataGenerationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any, @@ -81,7 +82,7 @@ def begin_create_generation_job( # type: ignore[reportIncompatibleMethodOverrid """Create a data generation job. :param job: The job to create. Required. - :type job: ~azure.ai.projects.models.DataGenerationJob or ~azure.ai.projects.types.DataGenerationJob or IO[bytes] + :type job: ~azure.ai.projects.models.DataGenerationJob or JSON or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_evaluators.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_evaluators.py index 843c34e9caf2..3e79ef035f1f 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_evaluators.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_evaluators.py @@ -12,8 +12,8 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from ._operations import BetaEvaluatorsOperations as BetaEvaluatorsOperationsGenerated -from .. import models as _models, types as _types +from ._operations import BetaEvaluatorsOperations as BetaEvaluatorsOperationsGenerated, JSON +from .. import models as _models from .._utils.model_base import _deserialize from ..models import EvaluatorGenerationLROPoller @@ -34,7 +34,7 @@ def begin_create_generation_job( @overload def begin_create_generation_job( self, - job: _types.EvaluatorGenerationJob, + job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", @@ -54,7 +54,7 @@ def begin_create_generation_job( @distributed_trace def begin_create_generation_job( # type: ignore[reportIncompatibleMethodOverride, override] self, - job: Union[_models.EvaluatorGenerationJob, _types.EvaluatorGenerationJob, IO[bytes]], + job: Union[_models.EvaluatorGenerationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any, @@ -62,7 +62,7 @@ def begin_create_generation_job( # type: ignore[reportIncompatibleMethodOverrid """Create an evaluator generation job. :param job: The job to create. Required. - :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or ~azure.ai.projects.types.EvaluatorGenerationJob or IO[bytes] + :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or JSON or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/types.py b/sdk/ai/azure-ai-projects/azure/ai/projects/types.py deleted file mode 100644 index 1bf3a9856939..000000000000 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/types.py +++ /dev/null @@ -1,12282 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, Literal, Optional, TYPE_CHECKING, Union -from typing_extensions import Required, TypedDict - -from ._utils.utils import FileType -from .models._enums import ( - AgentBlueprintReferenceType, - AgentEndpointAuthorizationSchemeType, - AgentKind, - AgentOptimizationDatasetInputType, - ContainerNetworkPolicyParamType, - ContainerSkillType, - CreateTranscriptionResponseJsonUsageType, - CustomToolParamFormatType, - DataGenerationJobOutputType, - DataGenerationJobSourceType, - DataGenerationJobType, - DatasetType, - EvaluationRuleActionType, - EvaluationTaxonomyInputType, - EvaluatorDefinitionType, - EvaluatorGenerationJobSourceType, - FunctionShellToolParamEnvironmentType, - IndexType, - InsightType, - MemoryStoreKind, - OpenApiAuthType, - PendingUploadType, - RealtimeAudioFormatsType, - RealtimeClientEventType, - RealtimeConversationItemMessageType, - RealtimeConversationItemType, - RealtimeMcpErrorType, - RealtimeServerEventType, - RecurrenceType, - RoutineActionType, - RoutineDispatchPayloadType, - RoutineTriggerType, - SampleType, - ScheduleTaskType, - TelemetryEndpointAuthType, - TelemetryEndpointKind, - TextResponseFormatConfigurationType, - ToolChoiceParamType, - ToolType, - ToolboxToolType, - TriggerType, - VersionIndicatorType, - VersionSelectorType, - VoiceTurnDetectionType, -) - -if TYPE_CHECKING: - from . import _unions - from .models import ( - A2AProtocolVersion, - AgentEndpointProtocol, - AttackStrategy, - AzureAISearchQueryType, - CallableToolAllowedCaller, - CodeDependencyResolution, - ComputerEnvironment, - ContainerMemoryLimit, - DataGenerationJobScenario, - DayOfWeek, - EvaluationLevel, - EvaluationRuleEventType, - EvaluatorCategory, - EvaluatorMetricDirection, - EvaluatorMetricType, - EvaluatorType, - FoundryModelArtifactProfileCategory, - FoundryModelArtifactProfileSignal, - FoundryModelSourceType, - FoundryModelWarningCode, - FoundryModelWeightType, - GenerationWarningType, - GitHubIssueEvent, - GrammarSyntax1, - ImageGenAction, - InputFidelity, - JobStatus, - MemoryItemKind, - OperationState, - RankerVersionType, - RealtimeReasoningEffort, - ReasoningEffort, - ReasoningModeEnum, - RiskCategory, - RubricGenerationInputQualityWarningCode, - RubricGenerationInputQualityWarningSeverity, - RubricGenerationInputQualityWarningSource, - ScheduleProvisioningStatus, - SearchContentType, - SearchContextSize, - SimpleQnAFineTuningQuestionType, - TelemetryDataKind, - TelemetryTransportProtocol, - ToolChoiceOptions, - ToolSearchExecutionType, - TreatmentEffectType, - VoiceAgentAnimationOutputType, - VoiceAgentEchoCancellationReferenceSource, - VoiceAgentInterimResponseTrigger, - VoiceAgentSessionIncludeOption, - VoiceAgentToolResponseScheduling, - VoiceAudioFormatType, - VoiceAudioTimestampType, - VoiceAvatarOutputProtocol, - VoiceAvatarType, - VoiceEndOfUtteranceDetectionModel, - VoiceEndOfUtteranceThresholdLevel, - VoiceInputTranscriptionModel, - VoiceModelType, - VoiceNoiseReductionType, - VoiceOutputModality, - VoiceSystemToolName, - VoiceType, - ) - - -class _CreateAgentVersionFromCodeContent(TypedDict, total=False): - """Multipart request body for updating or versioning a code-based agent (POST /agents/{name} and - POST /agents/{name}/versions). - - :ivar metadata: JSON metadata including description and hosted definition. Required. - :vartype metadata: "_CreateAgentVersionFromCodeMetadata" - :ivar code: The code zip file (max 250 MB). Required. - :vartype code: FileType - """ - - metadata: Required["_CreateAgentVersionFromCodeMetadata"] - """JSON metadata including description and hosted definition. Required.""" - code: Required[FileType] - """The code zip file (max 250 MB). Required.""" - - -class _CreateAgentVersionFromCodeMetadata(TypedDict, total=False): - """JSON metadata for code-based agent operations (create, update, create version). The agent name - comes from the URL path parameter or the ``x-ms-agent-name`` header, so it is not included in - this model. The content hash (SHA-256 of the zip) is carried in the ``x-ms-code-zip-sha256`` - header. - - :ivar description: A human-readable description of the agent. - :vartype description: str - :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. - :vartype metadata: dict[str, str] - :ivar definition: The hosted agent definition including code_configuration (runtime, - entry_point), cpu, memory, and protocol_versions. Required. - :vartype definition: "HostedAgentDefinition" - """ - - description: str - """A human-readable description of the agent.""" - metadata: dict[str, str] - """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.""" - definition: Required["HostedAgentDefinition"] - """The hosted agent definition including code_configuration (runtime, entry_point), cpu, memory, - and protocol_versions. Required.""" - - -class A2APreviewTool(TypedDict, total=False): - """An agent implementing the A2A protocol. - - :ivar type: The type of the tool. Always ``"a2a_preview``. Required. A2A_PREVIEW. - :vartype type: Literal[ToolType.A2A_PREVIEW] - :ivar base_url: Base URL of the agent. - :vartype base_url: str - :ivar agent_card_path: The path to the agent card relative to the ``base_url``. If not - provided, defaults to ``/.well-known/agent-card.json``. - :vartype agent_card_path: str - :ivar project_connection_id: The connection ID in the project for the A2A server. The - connection stores authentication and other connection details needed to connect to the A2A - server. - :vartype project_connection_id: str - :ivar send_credentials_for_agent_card: When ``true``, Foundry sends its credentials when - fetching the remote agent's Agent Card. The service defaults to ``false`` if a value is not - specified by the caller (anonymous fetch). - :vartype send_credentials_for_agent_card: bool - """ - - type: Required[Literal[ToolType.A2A_PREVIEW]] - """The type of the tool. Always ``\"a2a_preview``. Required. A2A_PREVIEW.""" - base_url: str - """Base URL of the agent.""" - agent_card_path: str - """The path to the agent card relative to the ``base_url``. If not provided, defaults to - ``/.well-known/agent-card.json``.""" - project_connection_id: str - """The connection ID in the project for the A2A server. The connection stores authentication and - other connection details needed to connect to the A2A server.""" - send_credentials_for_agent_card: bool - """When ``true``, Foundry sends its credentials when fetching the remote agent's Agent Card. The - service defaults to ``false`` if a value is not specified by the caller (anonymous fetch).""" - - -class A2APreviewToolboxTool(TypedDict, total=False): - """An A2A 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, "ToolConfig"] - :ivar type: Required. A2A_PREVIEW. - :vartype type: Literal[ToolboxToolType.A2A_PREVIEW] - :ivar base_url: Base URL of the agent. - :vartype base_url: str - :ivar agent_card_path: The path to the agent card relative to the ``base_url``. If not - provided, defaults to ``/.well-known/agent-card.json``. - :vartype agent_card_path: str - :ivar project_connection_id: The connection ID in the project for the A2A server. The - connection stores authentication and other connection details needed to connect to the A2A - server. - :vartype project_connection_id: str - :ivar send_credentials_for_agent_card: When ``true``, Foundry sends its credentials when - fetching the remote agent's Agent Card. The service defaults to ``false`` if a value is not - specified by the caller (anonymous fetch). - :vartype send_credentials_for_agent_card: bool - """ - - name: str - """Optional user-defined name for this tool or configuration.""" - description: str - """Optional user-defined description for this tool or configuration.""" - tool_configs: dict[str, "ToolConfig"] - """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.""" - type: Required[Literal[ToolboxToolType.A2A_PREVIEW]] - """Required. A2A_PREVIEW.""" - base_url: str - """Base URL of the agent.""" - agent_card_path: str - """The path to the agent card relative to the ``base_url``. If not provided, defaults to - ``/.well-known/agent-card.json``.""" - project_connection_id: str - """The connection ID in the project for the A2A server. The connection stores authentication and - other connection details needed to connect to the A2A server.""" - send_credentials_for_agent_card: bool - """When ``true``, Foundry sends its credentials when fetching the remote agent's Agent Card. The - service defaults to ``false`` if a value is not specified by the caller (anonymous fetch).""" - - -class A2AProtocolConfiguration(TypedDict, total=False): - """Configuration specific to the A2A protocol.""" - - -class A2ATool(TypedDict, total=False): - """An agent implementing the A2A protocol. - - :ivar type: The type of the tool. Always ``"a2a"``. Required. A2_A. - :vartype type: Literal[ToolType.A2_A] - :ivar base_url: Base URL of the agent. - :vartype base_url: str - :ivar agent_card_path: The path to the agent card relative to the ``base_url``. If not - provided, defaults to ``/.well-known/agent-card.json``. - :vartype agent_card_path: str - :ivar project_connection_id: The connection ID in the project for the A2A server. The - connection stores authentication and other connection details needed to connect to the A2A - server. - :vartype project_connection_id: str - :ivar send_credentials_for_agent_card: When ``true``, Foundry sends its credentials when - fetching the remote agent's Agent Card. The service defaults to ``false`` if a value is not - specified by the caller (anonymous fetch). - :vartype send_credentials_for_agent_card: bool - :ivar a2a_version: The A2A protocol version supported by the agent. Required. "1.0" - :vartype a2a_version: Union[str, "A2AProtocolVersion"] - """ - - type: Required[Literal[ToolType.A2_A]] - """The type of the tool. Always ``\"a2a\"``. Required. A2_A.""" - base_url: str - """Base URL of the agent.""" - agent_card_path: str - """The path to the agent card relative to the ``base_url``. If not provided, defaults to - ``/.well-known/agent-card.json``.""" - project_connection_id: str - """The connection ID in the project for the A2A server. The connection stores authentication and - other connection details needed to connect to the A2A server.""" - send_credentials_for_agent_card: bool - """When ``true``, Foundry sends its credentials when fetching the remote agent's Agent Card. The - service defaults to ``false`` if a value is not specified by the caller (anonymous fetch).""" - a2a_version: Required[Union[str, "A2AProtocolVersion"]] - """The A2A protocol version supported by the agent. Required. \"1.0\"""" - - -class A2AToolboxTool(TypedDict, total=False): - """An A2A 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, "ToolConfig"] - :ivar type: Required. A2_A. - :vartype type: Literal[ToolboxToolType.A2_A] - :ivar base_url: Base URL of the agent. - :vartype base_url: str - :ivar agent_card_path: The path to the agent card relative to the ``base_url``. If not - provided, defaults to ``/.well-known/agent-card.json``. - :vartype agent_card_path: str - :ivar project_connection_id: The connection ID in the project for the A2A server. The - connection stores authentication and other connection details needed to connect to the A2A - server. - :vartype project_connection_id: str - :ivar send_credentials_for_agent_card: When ``true``, Foundry sends its credentials when - fetching the remote agent's Agent Card. The service defaults to ``false`` if a value is not - specified by the caller (anonymous fetch). - :vartype send_credentials_for_agent_card: bool - :ivar a2a_version: The A2A protocol version supported by the agent. Required. "1.0" - :vartype a2a_version: Union[str, "A2AProtocolVersion"] - """ - - name: str - """Optional user-defined name for this tool or configuration.""" - description: str - """Optional user-defined description for this tool or configuration.""" - tool_configs: dict[str, "ToolConfig"] - """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.""" - type: Required[Literal[ToolboxToolType.A2_A]] - """Required. A2_A.""" - base_url: str - """Base URL of the agent.""" - agent_card_path: str - """The path to the agent card relative to the ``base_url``. If not provided, defaults to - ``/.well-known/agent-card.json``.""" - project_connection_id: str - """The connection ID in the project for the A2A server. The connection stores authentication and - other connection details needed to connect to the A2A server.""" - send_credentials_for_agent_card: bool - """When ``true``, Foundry sends its credentials when fetching the remote agent's Agent Card. The - service defaults to ``false`` if a value is not specified by the caller (anonymous fetch).""" - a2a_version: Required[Union[str, "A2AProtocolVersion"]] - """The A2A protocol version supported by the agent. Required. \"1.0\"""" - - -class ActivityProtocolConfiguration(TypedDict, total=False): - """Configuration specific to the activity protocol. - - :ivar enable_m365_public_endpoint: Whether to enable the M365 public endpoint for the activity - protocol. - :vartype enable_m365_public_endpoint: bool - """ - - enable_m365_public_endpoint: bool - """Whether to enable the M365 public endpoint for the activity protocol.""" - - -class AgentCard(TypedDict, total=False): - """AgentCard. - - :ivar version: The version of the agent card. Required. - :vartype version: str - :ivar description: The description of the agent card. - :vartype description: str - :ivar skills: The set of skills that an agent can perform. Required. - :vartype skills: list["AgentCardSkill"] - """ - - version: Required[str] - """The version of the agent card. Required.""" - description: str - """The description of the agent card.""" - skills: Required[list["AgentCardSkill"]] - """The set of skills that an agent can perform. Required.""" - - -class AgentCardSkill(TypedDict, total=False): - """AgentCardSkill. - - :ivar id: a unique identifier for the skill. Required. - :vartype id: str - :ivar name: The name of the skill. Required. - :vartype name: str - :ivar description: A description of the skill. - :vartype description: str - :ivar tags: set of tagwords describing classes of capabilities for the skill. - :vartype tags: list[str] - :ivar examples: A list of example scenarios that the skill can perform. - :vartype examples: list[str] - """ - - id: Required[str] - """a unique identifier for the skill. Required.""" - name: Required[str] - """The name of the skill. Required.""" - description: str - """A description of the skill.""" - tags: list[str] - """set of tagwords describing classes of capabilities for the skill.""" - examples: list[str] - """A list of example scenarios that the skill can perform.""" - - -class AgentClusterInsightRequest(TypedDict, total=False): - """Insights on set of Agent Evaluation Results. - - :ivar type: The type of request. Required. Cluster Insight on an Agent. - :vartype type: Literal[InsightType.AGENT_CLUSTER_INSIGHT] - :ivar agent_name: Identifier for the agent. Required. - :vartype agent_name: str - :ivar model_configuration: Configuration of the model used in the insight generation. - :vartype model_configuration: "InsightModelConfiguration" - """ - - type: Required[Literal[InsightType.AGENT_CLUSTER_INSIGHT]] - """The type of request. Required. Cluster Insight on an Agent.""" - agentName: Required[str] - """Identifier for the agent. Required.""" - modelConfiguration: "InsightModelConfiguration" - """Configuration of the model used in the insight generation.""" - - -class AgentClusterInsightResult(TypedDict, total=False): - """Insights from the agent cluster analysis. - - :ivar type: The type of insights result. Required. Cluster Insight on an Agent. - :vartype type: Literal[InsightType.AGENT_CLUSTER_INSIGHT] - :ivar cluster_insight: Required. - :vartype cluster_insight: "ClusterInsightResult" - """ - - type: Required[Literal[InsightType.AGENT_CLUSTER_INSIGHT]] - """The type of insights result. Required. Cluster Insight on an Agent.""" - clusterInsight: Required["ClusterInsightResult"] - """Required.""" - - -class AgentDataGenerationJobSource(TypedDict, total=False): - """Agent source for data generation jobs — references an agent to fetch instructions and metadata - from. - - :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 Agent. Required. Agent source — - references an agent. - :vartype type: Literal[DataGenerationJobSourceType.AGENT] - :ivar agent_name: The agent name to fetch instructions from. Required. - :vartype agent_name: str - :ivar agent_version: The agent version. If not specified, the latest version is used. - :vartype agent_version: str - """ - - description: str - """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: Required[Literal[DataGenerationJobSourceType.AGENT]] - """The source type for this source, which is Agent. Required. Agent source — references an agent.""" - agent_name: Required[str] - """The agent name to fetch instructions from. Required.""" - agent_version: str - """The agent version. If not specified, the latest version is used.""" - - -class AgentEndpointConfig(TypedDict, total=False): - """AgentEndpointConfig. - - :ivar version_selector: The version selector of the agent endpoint determines how traffic is - routed to different versions of the agent. - :vartype version_selector: "VersionSelector" - :ivar protocol_configuration: Per-protocol configuration for the agent endpoint. - :vartype protocol_configuration: "ProtocolConfiguration" - :ivar authorization_schemes: The authorization schemes supported by the agent endpoint. - :vartype authorization_schemes: list["AgentEndpointAuthorizationScheme"] - """ - - version_selector: "VersionSelector" - """The version selector of the agent endpoint determines how traffic is routed to different - versions of the agent.""" - protocol_configuration: "ProtocolConfiguration" - """Per-protocol configuration for the agent endpoint.""" - authorization_schemes: list["AgentEndpointAuthorizationScheme"] - """The authorization schemes supported by the agent endpoint.""" - - -class AgentEvaluatorGenerationJobSource(TypedDict, total=False): - """Agent source for evaluator generation jobs — references an agent to fetch instructions and - metadata from. - - :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 Agent. Required. Agent source — - references an agent to fetch instructions and metadata from. - :vartype type: Literal[EvaluatorGenerationJobSourceType.AGENT] - :ivar agent_name: The agent name to fetch instructions from. Required. - :vartype agent_name: str - :ivar agent_version: The agent version. If not specified, the latest version is used. - :vartype agent_version: str - """ - - description: str - """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: Required[Literal[EvaluatorGenerationJobSourceType.AGENT]] - """The source type for this source, which is Agent. Required. Agent source — references an agent - to fetch instructions and metadata from.""" - agent_name: Required[str] - """The agent name to fetch instructions from. Required.""" - agent_version: str - """The agent version. If not specified, the latest version is used.""" - - -class AgentOptimizationCandidate(TypedDict, total=False): - """Aggregated evaluation result for a single candidate agent configuration across all tasks. - - :ivar candidate_id: Server-assigned candidate identifier. Use with GET /candidates/{id} - sub-endpoints. - :vartype candidate_id: str - :ivar name: Display name of the candidate (e.g., 'baseline', 'instruction-v2'). Required. - :vartype name: str - :ivar mutations: What was mutated from the baseline (e.g., {system_prompt: 'new prompt'}). - :vartype mutations: dict[str, Any] - :ivar avg_score: Average composite score across all tasks. Required. - :vartype avg_score: float - :ivar avg_tokens: Average token usage across all tasks. Required. - :vartype avg_tokens: float - :ivar eval_id: Foundry evaluation identifier used to score this candidate. - :vartype eval_id: str - :ivar eval_run_id: Foundry evaluation run identifier for this candidate's scoring run. - :vartype eval_run_id: str - :ivar promotion: Promotion metadata. Null if the candidate has not been promoted. - :vartype promotion: "PromotionInfo" - """ - - candidate_id: str - """Server-assigned candidate identifier. Use with GET /candidates/{id} sub-endpoints.""" - name: Required[str] - """Display name of the candidate (e.g., 'baseline', 'instruction-v2'). Required.""" - mutations: dict[str, Any] - """What was mutated from the baseline (e.g., {system_prompt: 'new prompt'}).""" - avg_score: Required[float] - """Average composite score across all tasks. Required.""" - avg_tokens: Required[float] - """Average token usage across all tasks. Required.""" - eval_id: str - """Foundry evaluation identifier used to score this candidate.""" - eval_run_id: str - """Foundry evaluation run identifier for this candidate's scoring run.""" - promotion: "PromotionInfo" - """Promotion metadata. Null if the candidate has not been promoted.""" - - -class AgentOptimizationDatasetCriterion(TypedDict, total=False): - """Evaluation criterion: a name + instruction pair used for per-item scoring. - - :ivar name: Criterion name. Required. - :vartype name: str - :ivar instruction: Criterion instruction / description. Required. - :vartype instruction: str - """ - - name: Required[str] - """Criterion name. Required.""" - instruction: Required[str] - """Criterion instruction / description. Required.""" - - -class AgentOptimizationDatasetItem(TypedDict, total=False): - """A single item in an inline dataset. - - :ivar query: The user query / prompt. - :vartype query: str - :ivar ground_truth: Expected ground truth answer. - :vartype ground_truth: str - :ivar desired_num_turns: Desired number of conversation turns for simulation mode (1-20). - :vartype desired_num_turns: int - :ivar criteria: Per-item evaluation criteria. - :vartype criteria: list["AgentOptimizationDatasetCriterion"] - """ - - query: str - """The user query / prompt.""" - ground_truth: str - """Expected ground truth answer.""" - desired_num_turns: int - """Desired number of conversation turns for simulation mode (1-20).""" - criteria: list["AgentOptimizationDatasetCriterion"] - """Per-item evaluation criteria.""" - - -class AgentOptimizationEvaluatorRef(TypedDict, total=False): - """Reference to a named evaluator, optionally pinned to a version. - - :ivar name: Evaluator name. Required. - :vartype name: str - :ivar version: Evaluator version. If not specified, the latest version is used. - :vartype version: str - """ - - name: Required[str] - """Evaluator name. Required.""" - version: str - """Evaluator version. If not specified, the latest version is used.""" - - -class AgentOptimizationInlineDatasetInput(TypedDict, total=False): - """Inline dataset — items supplied directly in the request body. - - :ivar type: Dataset input type discriminator. Required. Inline dataset — items are provided - directly in the request body. - :vartype type: Literal[AgentOptimizationDatasetInputType.INLINE] - :ivar dataset_items: Dataset items. Required. - :vartype dataset_items: list["AgentOptimizationDatasetItem"] - """ - - type: Required[Literal[AgentOptimizationDatasetInputType.INLINE]] - """Dataset input type discriminator. Required. Inline dataset — items are provided directly in the - request body.""" - items: Required[list["AgentOptimizationDatasetItem"]] - """Dataset items. Required.""" - - -class AgentOptimizationJob(TypedDict, total=False): - """Agent optimization job resource — a long-running job that optimizes an agent's configuration - (instructions, model, skills, tools) to maximize evaluation scores. On success, the result - contains scored candidates. - - :ivar id: Server-assigned unique identifier. Required. - :vartype id: str - :ivar inputs: Caller-supplied inputs. - :vartype inputs: "AgentOptimizationJobInputs" - :ivar result: Result produced on success. - :vartype result: "AgentOptimizationJobResult" - :ivar status: Current lifecycle status. Required. Known values are: "queued", "in_progress", - "succeeded", "failed", and "cancelled". - :vartype status: Union[str, "JobStatus"] - :ivar error: Error details — populated only on failure. - :vartype error: "ApiError" - :ivar created_at: The timestamp when the job was created, represented in Unix time. Required. - :vartype created_at: int - :ivar updated_at: The timestamp when the job was last updated, represented in Unix time. - Required. - :vartype updated_at: int - :ivar progress: Progress snapshot. May be present in terminal states reflecting last-known - progress. - :vartype progress: "AgentOptimizationJobProgress" - :ivar warnings: Non-fatal warnings emitted at any point during optimization. - :vartype warnings: list[str] - """ - - id: Required[str] - """Server-assigned unique identifier. Required.""" - inputs: "AgentOptimizationJobInputs" - """Caller-supplied inputs.""" - result: "AgentOptimizationJobResult" - """Result produced on success.""" - status: Required[Union[str, "JobStatus"]] - """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", - \"succeeded\", \"failed\", and \"cancelled\".""" - error: "ApiError" - """Error details — populated only on failure.""" - created_at: Required[int] - """The timestamp when the job was created, represented in Unix time. Required.""" - updated_at: Required[int] - """The timestamp when the job was last updated, represented in Unix time. Required.""" - progress: "AgentOptimizationJobProgress" - """Progress snapshot. May be present in terminal states reflecting last-known progress.""" - warnings: list[str] - """Non-fatal warnings emitted at any point during optimization.""" - - -class AgentOptimizationJobInputs(TypedDict, total=False): - """Caller-supplied inputs for an optimization job. - - :ivar agent: The agent (and pinned version) being optimized. Required. - :vartype agent: "OptimizedAgentIdentifier" - :ivar train_dataset: Training dataset — either inline items or a reference to a registered - dataset. Required. Required. - :vartype train_dataset: "AgentOptimizationDatasetInput" - :ivar validation_dataset: Optional held-out validation dataset for measuring generalization of - the final candidate. - :vartype validation_dataset: "AgentOptimizationDatasetInput" - :ivar evaluators: Job-level evaluators referenced by name and optional version. Required; at - least one must be provided. Required. - :vartype evaluators: list["AgentOptimizationEvaluatorRef"] - :ivar options: Tuning knobs and run-mode. - :vartype options: "AgentOptimizationOptions" - """ - - agent: Required["OptimizedAgentIdentifier"] - """The agent (and pinned version) being optimized. Required.""" - train_dataset: Required["AgentOptimizationDatasetInput"] - """Training dataset — either inline items or a reference to a registered dataset. Required. - Required.""" - validation_dataset: "AgentOptimizationDatasetInput" - """Optional held-out validation dataset for measuring generalization of the final candidate.""" - evaluators: Required[list["AgentOptimizationEvaluatorRef"]] - """Job-level evaluators referenced by name and optional version. Required; at least one must be - provided. Required.""" - options: "AgentOptimizationOptions" - """Tuning knobs and run-mode.""" - - -class AgentOptimizationJobProgress(TypedDict, total=False): - """In-flight progress; only populated while status is queued or in_progress. - - :ivar candidates_completed: Number of candidates whose evaluation has completed so far. - Required. - :vartype candidates_completed: int - :ivar best_score: Best score observed so far across all candidates. Required. - :vartype best_score: float - :ivar elapsed_seconds: Wall-clock time elapsed in seconds since the job began executing. - Required. - :vartype elapsed_seconds: float - """ - - candidates_completed: Required[int] - """Number of candidates whose evaluation has completed so far. Required.""" - best_score: Required[float] - """Best score observed so far across all candidates. Required.""" - elapsed_seconds: Required[float] - """Wall-clock time elapsed in seconds since the job began executing. Required.""" - - -class AgentOptimizationJobResult(TypedDict, total=False): - """Terminal-state result body. Populated when status is succeeded or failed. - - :ivar baseline: Candidate ID of the original (un-optimized) baseline evaluation. - :vartype baseline: str - :ivar best: Candidate ID of the highest-scoring candidate found during optimization. - :vartype best: str - :ivar candidates: All evaluated candidates including baseline. - :vartype candidates: list["AgentOptimizationCandidate"] - """ - - baseline: str - """Candidate ID of the original (un-optimized) baseline evaluation.""" - best: str - """Candidate ID of the highest-scoring candidate found during optimization.""" - candidates: list["AgentOptimizationCandidate"] - """All evaluated candidates including baseline.""" - - -class AgentOptimizationOptions(TypedDict, total=False): - """Tuning knobs and run-mode for an optimization job. - - :ivar max_candidates: Maximum number of optimization candidates to generate. Must be >= 1. - Default: 5. - :vartype max_candidates: int - :ivar optimization_config: Per-target-attribute configuration overrides. Contains skills, - tools, system_prompt for the agent, plus model space for model optimization. - :vartype optimization_config: dict[str, Any] - :ivar eval_model: Model deployment used for evaluation. Defaults to server config (typically - 'gpt-4o'). - :vartype eval_model: str - :ivar optimization_model: Model deployment for optimization reasoning (must be gpt-5 family). - Falls back to the default eval model when not set. - :vartype optimization_model: str - :ivar evaluation_level: Evaluation granularity. Null/omitted means per-item single-turn. Set to - 'conversation' for per-conversation multi-turn simulation scoring. Known values are: "turn" and - "conversation". - :vartype evaluation_level: Union[str, "EvaluationLevel"] - :ivar max_stalls: Maximum number of consecutive reflective minibatch rejections before stopping - early. A 'stall' occurs when the optimizer proposes a prompt change, evaluates it on a small - subset, and the score does not improve — so no full validation-set evaluation is triggered. The - counter resets whenever a minibatch passes and its full-validation score beats the current - best. Only a sustained plateau of ``max_stalls`` consecutive minibatch failures triggers the - stop. The service defaults to 5 if a value is not specified by the caller. Must be >= 1 when - set. - :vartype max_stalls: int - """ - - max_candidates: int - """Maximum number of optimization candidates to generate. Must be >= 1. Default: 5.""" - optimization_config: dict[str, Any] - """Per-target-attribute configuration overrides. Contains skills, tools, system_prompt for the - agent, plus model space for model optimization.""" - eval_model: str - """Model deployment used for evaluation. Defaults to server config (typically 'gpt-4o').""" - optimization_model: str - """Model deployment for optimization reasoning (must be gpt-5 family). Falls back to the default - eval model when not set.""" - evaluation_level: Union[str, "EvaluationLevel"] - """Evaluation granularity. Null/omitted means per-item single-turn. Set to 'conversation' for - per-conversation multi-turn simulation scoring. Known values are: \"turn\" and - \"conversation\".""" - max_stalls: int - """Maximum number of consecutive reflective minibatch rejections before stopping early. A 'stall' - occurs when the optimizer proposes a prompt change, evaluates it on a small subset, and the - score does not improve — so no full validation-set evaluation is triggered. The counter resets - whenever a minibatch passes and its full-validation score beats the current best. Only a - sustained plateau of ``max_stalls`` consecutive minibatch failures triggers the stop. The - service defaults to 5 if a value is not specified by the caller. Must be >= 1 when set.""" - - -class AgentOptimizationReferenceDatasetInput(TypedDict, total=False): - """Reference to a registered Foundry dataset. - - :ivar type: Dataset input type discriminator. Required. Reference to a registered Foundry - dataset by name and version. - :vartype type: Literal[AgentOptimizationDatasetInputType.REFERENCE] - :ivar name: Registered dataset name. Required. - :vartype name: str - :ivar version: Dataset version. If not specified, the latest version is used. - :vartype version: str - """ - - type: Required[Literal[AgentOptimizationDatasetInputType.REFERENCE]] - """Dataset input type discriminator. Required. Reference to a registered Foundry dataset by name - and version.""" - name: Required[str] - """Registered dataset name. Required.""" - version: str - """Dataset version. If not specified, the latest version is used.""" - - -class AgentTaxonomyInput(TypedDict, total=False): - """Input configuration for the evaluation taxonomy when the input type is agent. - - :ivar type: Input type of the evaluation taxonomy. Required. Agent. - :vartype type: Literal[EvaluationTaxonomyInputType.AGENT] - :ivar target: Target configuration for the agent. Required. - :vartype target: "EvaluationTarget" - :ivar risk_categories: List of risk categories to evaluate against. Required. - :vartype risk_categories: list[Union[str, "RiskCategory"]] - """ - - type: Required[Literal[EvaluationTaxonomyInputType.AGENT]] - """Input type of the evaluation taxonomy. Required. Agent.""" - target: Required["EvaluationTarget"] - """Target configuration for the agent. Required.""" - riskCategories: Required[list[Union[str, "RiskCategory"]]] - """List of risk categories to evaluate against. Required.""" - - -class AISearchIndexResource(TypedDict, total=False): - """A AI Search Index resource. - - :ivar project_connection_id: An index connection ID in an IndexResource attached to this agent. - :vartype project_connection_id: str - :ivar index_name: The name of an index in an IndexResource attached to this agent. - :vartype index_name: str - :ivar query_type: Type of query in an AIIndexResource attached to this agent. Known values are: - "simple", "semantic", "vector", "vector_simple_hybrid", and "vector_semantic_hybrid". - :vartype query_type: Union[str, "AzureAISearchQueryType"] - :ivar top_k: Number of documents to retrieve from search and present to the model. - :vartype top_k: int - :ivar filter: filter string for search resource. `Learn more here - `_. - :vartype filter: str - :ivar index_asset_id: Index asset id for search resource. - :vartype index_asset_id: str - """ - - project_connection_id: str - """An index connection ID in an IndexResource attached to this agent.""" - index_name: str - """The name of an index in an IndexResource attached to this agent.""" - query_type: Union[str, "AzureAISearchQueryType"] - """Type of query in an AIIndexResource attached to this agent. Known values are: \"simple\", - \"semantic\", \"vector\", \"vector_simple_hybrid\", and \"vector_semantic_hybrid\".""" - top_k: int - """Number of documents to retrieve from search and present to the model.""" - filter: str - """filter string for search resource. `Learn more here - `_.""" - index_asset_id: str - """Index asset id for search resource.""" - - -class ApiError(TypedDict, total=False): - """ApiError. - - :ivar code: Required. - :vartype code: str - :ivar message: Required. - :vartype message: str - :ivar param: - :vartype param: str - :ivar type: - :vartype type: str - :ivar details: - :vartype details: list["ApiError"] - :ivar additional_info: - :vartype additional_info: dict[str, Any] - :ivar debug_info: - :vartype debug_info: dict[str, Any] - """ - - code: Required[Optional[str]] - """Required.""" - message: Required[str] - """Required.""" - param: Optional[str] - type: str - details: list["ApiError"] - additionalInfo: dict[str, Any] - debugInfo: dict[str, Any] - - -class ApplyPatchToolParam(TypedDict, total=False): - """Apply patch tool. - - :ivar type: The type of the tool. Always ``apply_patch``. Required. APPLY_PATCH. - :vartype type: Literal[ToolType.APPLY_PATCH] - :ivar allowed_callers: - :vartype allowed_callers: list[Union[str, "CallableToolAllowedCaller"]] - """ - - type: Required[Literal[ToolType.APPLY_PATCH]] - """The type of the tool. Always ``apply_patch``. Required. APPLY_PATCH.""" - allowed_callers: Optional[list[Union[str, "CallableToolAllowedCaller"]]] - - -class ApproximateLocation(TypedDict, total=False): - """ApproximateLocation. - - :ivar type: The type of location approximation. Always ``approximate``. Required. Default value - is "approximate". - :vartype type: Literal["approximate"] - :ivar country: - :vartype country: str - :ivar region: - :vartype region: str - :ivar city: - :vartype city: str - :ivar timezone: - :vartype timezone: str - """ - - type: Required[Literal["approximate"]] - """The type of location approximation. Always ``approximate``. Required. Default value is - \"approximate\".""" - country: Optional[str] - region: Optional[str] - city: Optional[str] - timezone: Optional[str] - - -class ArtifactProfile(TypedDict, total=False): - """Artifact profile of the model. - - :ivar category: The category of the artifact profile. Required. Known values are: "DataOnly", - "RuntimeDependent", and "Unknown". - :vartype category: Union[str, "FoundryModelArtifactProfileCategory"] - :ivar signals: Signals detected in the model artifact. - :vartype signals: list[Union[str, "FoundryModelArtifactProfileSignal"]] - """ - - category: Required[Union[str, "FoundryModelArtifactProfileCategory"]] - """The category of the artifact profile. Required. Known values are: \"DataOnly\", - \"RuntimeDependent\", and \"Unknown\".""" - signals: list[Union[str, "FoundryModelArtifactProfileSignal"]] - """Signals detected in the model artifact.""" - - -class AutoCodeInterpreterToolParam(TypedDict, total=False): - """Automatic Code Interpreter Tool Parameters. - - :ivar type: Always ``auto``. Required. Default value is "auto". - :vartype type: Literal["auto"] - :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: Union[str, "ContainerMemoryLimit"] - :ivar network_policy: - :vartype network_policy: "ContainerNetworkPolicyParam" - """ - - type: Required[Literal["auto"]] - """Always ``auto``. Required. Default value is \"auto\".""" - file_ids: list[str] - """An optional list of uploaded files to make available to your code.""" - memory_limit: Optional[Union[str, "ContainerMemoryLimit"]] - """Known values are: \"1g\", \"4g\", \"16g\", and \"64g\".""" - network_policy: "ContainerNetworkPolicyParam" - - -class AzureAIAgentTarget(TypedDict, total=False): - """Represents a target specifying an Azure AI agent. - - :ivar type: The type of target, always ``azure_ai_agent``. Required. Default value is - "azure_ai_agent". - :vartype type: Literal["azure_ai_agent"] - :ivar name: The unique identifier of the Azure AI agent. Required. - :vartype name: str - :ivar version: The version of the Azure AI agent. - :vartype version: str - :ivar tool_descriptions: The parameters used to control the sampling behavior of the agent - during text generation. - :vartype tool_descriptions: list["ToolDescription"] - :ivar tools: - :vartype tools: list["Tool"] - """ - - type: Required[Literal["azure_ai_agent"]] - """The type of target, always ``azure_ai_agent``. Required. Default value is \"azure_ai_agent\".""" - name: Required[str] - """The unique identifier of the Azure AI agent. Required.""" - version: str - """The version of the Azure AI agent.""" - tool_descriptions: list["ToolDescription"] - """The parameters used to control the sampling behavior of the agent during text generation.""" - tools: list["Tool"] - - -class AzureAIModelTarget(TypedDict, total=False): - """Represents a target specifying an Azure AI model for operations requiring model selection. - - :ivar type: The type of target, always ``azure_ai_model``. Required. Default value is - "azure_ai_model". - :vartype type: Literal["azure_ai_model"] - :ivar model: The unique identifier of the Azure AI model. - :vartype model: str - :ivar sampling_params: The parameters used to control the sampling behavior of the model during - text generation. - :vartype sampling_params: "ModelSamplingParams" - """ - - type: Required[Literal["azure_ai_model"]] - """The type of target, always ``azure_ai_model``. Required. Default value is \"azure_ai_model\".""" - model: str - """The unique identifier of the Azure AI model.""" - sampling_params: "ModelSamplingParams" - """The parameters used to control the sampling behavior of the model during text generation.""" - - -class AzureAISearchIndex(TypedDict, total=False): - """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. Azure search. - :vartype type: Literal[IndexType.AZURE_SEARCH] - :ivar connection_name: Name of connection to Azure AI Search. Required. - :vartype connection_name: str - :ivar index_name: Name of index in Azure AI Search resource to attach. Required. - :vartype index_name: str - :ivar field_mapping: Field mapping configuration. - :vartype field_mapping: "FieldMapping" - """ - - id: str - """Asset ID, a unique identifier for the asset.""" - name: Required[str] - """The name of the resource. Required.""" - version: Required[str] - """The version of the resource. Required.""" - description: str - """The asset description text.""" - tags: dict[str, str] - """Tag dictionary. Tags can be added, removed, and updated.""" - type: Required[Literal[IndexType.AZURE_SEARCH]] - """Type of index. Required. Azure search.""" - connectionName: Required[str] - """Name of connection to Azure AI Search. Required.""" - indexName: Required[str] - """Name of index in Azure AI Search resource to attach. Required.""" - fieldMapping: "FieldMapping" - """Field mapping configuration.""" - - -class AzureAISearchTool(TypedDict, total=False): - """The input definition information for an Azure AI search tool as used to configure an agent. - - :ivar type: The object type, which is always 'azure_ai_search'. Required. AZURE_AI_SEARCH. - :vartype type: Literal[ToolType.AZURE_AI_SEARCH] - :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, "ToolConfig"] - :ivar azure_ai_search: The azure ai search index resource. Required. - :vartype azure_ai_search: "AzureAISearchToolResource" - """ - - type: Required[Literal[ToolType.AZURE_AI_SEARCH]] - """The object type, which is always 'azure_ai_search'. Required. AZURE_AI_SEARCH.""" - name: str - """Deprecated. This property is deprecated and will be removed in a future version.""" - description: str - """Deprecated. This property is deprecated and will be removed in a future version.""" - tool_configs: dict[str, "ToolConfig"] - """Deprecated. This property is deprecated and will be removed in a future version.""" - azure_ai_search: Required["AzureAISearchToolResource"] - """The azure ai search index resource. Required.""" - - -class AzureAISearchToolboxTool(TypedDict, total=False): - """An Azure AI 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, "ToolConfig"] - :ivar type: Required. AZURE_AI_SEARCH. - :vartype type: Literal[ToolboxToolType.AZURE_AI_SEARCH] - :ivar azure_ai_search: The azure ai search index resource. Required. - :vartype azure_ai_search: "AzureAISearchToolResource" - """ - - name: str - """Optional user-defined name for this tool or configuration.""" - description: str - """Optional user-defined description for this tool or configuration.""" - tool_configs: dict[str, "ToolConfig"] - """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.""" - type: Required[Literal[ToolboxToolType.AZURE_AI_SEARCH]] - """Required. AZURE_AI_SEARCH.""" - azure_ai_search: Required["AzureAISearchToolResource"] - """The azure ai search index resource. Required.""" - - -class AzureAISearchToolResource(TypedDict, total=False): - """A set of index resources used by the ``azure_ai_search`` tool. - - :ivar indexes: The indices attached to this agent. There can be a maximum of 1 index resource - attached to the agent. Required. - :vartype indexes: list["AISearchIndexResource"] - """ - - indexes: Required[list["AISearchIndexResource"]] - """The indices attached to this agent. There can be a maximum of 1 index resource attached to the - agent. Required.""" - - -class AzureFunctionBinding(TypedDict, total=False): - """The structure for keeping storage queue name and URI. - - :ivar type: The type of binding, which is always 'storage_queue'. Required. Default value is - "storage_queue". - :vartype type: Literal["storage_queue"] - :ivar storage_queue: Storage queue. Required. - :vartype storage_queue: "AzureFunctionStorageQueue" - """ - - type: Required[Literal["storage_queue"]] - """The type of binding, which is always 'storage_queue'. Required. Default value is - \"storage_queue\".""" - storage_queue: Required["AzureFunctionStorageQueue"] - """Storage queue. Required.""" - - -class AzureFunctionDefinition(TypedDict, total=False): - """The definition of Azure function. - - :ivar function: The definition of azure function and its parameters. Required. - :vartype function: "AzureFunctionDefinitionFunction" - :ivar input_binding: Input storage queue. The queue storage trigger runs a function as messages - are added to it. Required. - :vartype input_binding: "AzureFunctionBinding" - :ivar output_binding: Output storage queue. The function writes output to this queue when the - input items are processed. Required. - :vartype output_binding: "AzureFunctionBinding" - """ - - function: Required["AzureFunctionDefinitionFunction"] - """The definition of azure function and its parameters. Required.""" - input_binding: Required["AzureFunctionBinding"] - """Input storage queue. The queue storage trigger runs a function as messages are added to it. - Required.""" - output_binding: Required["AzureFunctionBinding"] - """Output storage queue. The function writes output to this queue when the input items are - processed. Required.""" - - -class AzureFunctionDefinitionFunction(TypedDict, total=False): - """AzureFunctionDefinitionFunction. - - :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] - """ - - name: Required[str] - """The name of the function to be called. Required.""" - description: str - """A description of what the function does, used by the model to choose when and how to call the - function.""" - parameters: Required[dict[str, Any]] - """The parameters the functions accepts, described as a JSON Schema object. Required.""" - - -class AzureFunctionStorageQueue(TypedDict, total=False): - """The structure for keeping storage queue name and URI. - - :ivar queue_service_endpoint: URI to the Azure Storage Queue service allowing you to manipulate - a queue. Required. - :vartype queue_service_endpoint: str - :ivar queue_name: The name of an Azure function storage queue. Required. - :vartype queue_name: str - """ - - queue_service_endpoint: Required[str] - """URI to the Azure Storage Queue service allowing you to manipulate a queue. Required.""" - queue_name: Required[str] - """The name of an Azure function storage queue. Required.""" - - -class AzureFunctionTool(TypedDict, total=False): - """The input definition information for an Azure Function Tool, as used to configure an Agent. - - :ivar type: The object type, which is always 'browser_automation'. Required. AZURE_FUNCTION. - :vartype type: Literal[ToolType.AZURE_FUNCTION] - :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype tool_configs: dict[str, "ToolConfig"] - :ivar azure_function: The Azure Function Tool definition. Required. - :vartype azure_function: "AzureFunctionDefinition" - """ - - type: Required[Literal[ToolType.AZURE_FUNCTION]] - """The object type, which is always 'browser_automation'. Required. AZURE_FUNCTION.""" - tool_configs: dict[str, "ToolConfig"] - """Deprecated. This property is deprecated and will be removed in a future version.""" - azure_function: Required["AzureFunctionDefinition"] - """The Azure Function Tool definition. Required.""" - - -class AzureOpenAIModelConfiguration(TypedDict, total=False): - """Azure OpenAI model configuration. The API version would be selected by the service for querying - the model. - - :ivar type: Required. Default value is "AzureOpenAIModel". - :vartype type: Literal["AzureOpenAIModel"] - :ivar model_deployment_name: Deployment name for AOAI model. Example: gpt-4o if in AIServices - or connection based ``connection_name/deployment_name`` (e.g. ``my-aoai-connection/gpt-4o``). - Required. - :vartype model_deployment_name: str - """ - - type: Required[Literal["AzureOpenAIModel"]] - """Required. Default value is \"AzureOpenAIModel\".""" - modelDeploymentName: Required[str] - """Deployment name for AOAI model. Example: gpt-4o if in AIServices or connection based - ``connection_name/deployment_name`` (e.g. ``my-aoai-connection/gpt-4o``). Required.""" - - -class BingCustomSearchConfiguration(TypedDict, total=False): - """A bing custom search configuration. - - :ivar project_connection_id: Project connection id for grounding with bing search. Required. - :vartype project_connection_id: str - :ivar instance_name: Name of the custom configuration instance given to config. Required. - :vartype instance_name: str - :ivar market: The market where the results come from. - :vartype market: str - :ivar set_lang: The language to use for user interface strings when calling Bing API. - :vartype set_lang: str - :ivar count: The number of search results to return in the bing api response. - :vartype count: int - :ivar freshness: Filter search results by a specific time range. See `accepted values here - `_. - :vartype freshness: str - """ - - project_connection_id: Required[str] - """Project connection id for grounding with bing search. Required.""" - instance_name: Required[str] - """Name of the custom configuration instance given to config. Required.""" - market: str - """The market where the results come from.""" - set_lang: str - """The language to use for user interface strings when calling Bing API.""" - count: int - """The number of search results to return in the bing api response.""" - freshness: str - """Filter search results by a specific time range. See `accepted values here - `_.""" - - -class BingCustomSearchPreviewTool(TypedDict, total=False): - """The input definition information for a Bing custom search tool as used to configure an agent. - - :ivar type: The object type, which is always 'bing_custom_search_preview'. Required. - BING_CUSTOM_SEARCH_PREVIEW. - :vartype type: Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW] - :ivar bing_custom_search_preview: The bing custom search tool parameters. Required. - :vartype bing_custom_search_preview: "BingCustomSearchToolParameters" - """ - - type: Required[Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW]] - """The object type, which is always 'bing_custom_search_preview'. Required. - BING_CUSTOM_SEARCH_PREVIEW.""" - bing_custom_search_preview: Required["BingCustomSearchToolParameters"] - """The bing custom search tool parameters. Required.""" - - -class BingCustomSearchToolParameters(TypedDict, total=False): - """The bing custom search tool parameters. - - :ivar search_configurations: The project connections attached to this tool. There can be a - maximum of 1 connection resource attached to the tool. Required. - :vartype search_configurations: list["BingCustomSearchConfiguration"] - """ - - search_configurations: Required[list["BingCustomSearchConfiguration"]] - """The project connections attached to this tool. There can be a maximum of 1 connection resource - attached to the tool. Required.""" - - -class BingGroundingSearchConfiguration(TypedDict, total=False): - """Search configuration for Bing Grounding. - - :ivar project_connection_id: Project connection id for grounding with bing search. Required. - :vartype project_connection_id: str - :ivar market: The market where the results come from. - :vartype market: str - :ivar set_lang: The language to use for user interface strings when calling Bing API. - :vartype set_lang: str - :ivar count: The number of search results to return in the bing api response. - :vartype count: int - :ivar freshness: Filter search results by a specific time range. See `accepted values here - `_. - :vartype freshness: str - """ - - project_connection_id: Required[str] - """Project connection id for grounding with bing search. Required.""" - market: str - """The market where the results come from.""" - set_lang: str - """The language to use for user interface strings when calling Bing API.""" - count: int - """The number of search results to return in the bing api response.""" - freshness: str - """Filter search results by a specific time range. See `accepted values here - `_.""" - - -class BingGroundingSearchToolParameters(TypedDict, total=False): - """The bing grounding search tool parameters. - - :ivar search_configurations: The search configurations attached to this tool. There can be a - maximum of 1 search configuration resource attached to the tool. Required. - :vartype search_configurations: list["BingGroundingSearchConfiguration"] - """ - - search_configurations: Required[list["BingGroundingSearchConfiguration"]] - """The search configurations attached to this tool. There can be a maximum of 1 search - configuration resource attached to the tool. Required.""" - - -class BingGroundingTool(TypedDict, total=False): - """The input definition information for a bing grounding search tool as used to configure an - agent. - - :ivar type: The object type, which is always 'bing_grounding'. Required. BING_GROUNDING. - :vartype type: Literal[ToolType.BING_GROUNDING] - :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, "ToolConfig"] - :ivar bing_grounding: The bing grounding search tool parameters. Required. - :vartype bing_grounding: "BingGroundingSearchToolParameters" - """ - - type: Required[Literal[ToolType.BING_GROUNDING]] - """The object type, which is always 'bing_grounding'. Required. BING_GROUNDING.""" - name: str - """Deprecated. This property is deprecated and will be removed in a future version.""" - description: str - """Deprecated. This property is deprecated and will be removed in a future version.""" - tool_configs: dict[str, "ToolConfig"] - """Deprecated. This property is deprecated and will be removed in a future version.""" - bing_grounding: Required["BingGroundingSearchToolParameters"] - """The bing grounding search tool parameters. Required.""" - - -class BotServiceAuthorizationScheme(TypedDict, total=False): - """BotServiceAuthorizationScheme. - - :ivar type: Required. BOT_SERVICE. - :vartype type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE] - """ - - type: Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE]] - """Required. BOT_SERVICE.""" - - -class BotServiceRbacAuthorizationScheme(TypedDict, total=False): - """BotServiceRbacAuthorizationScheme. - - :ivar type: Required. BOT_SERVICE_RBAC. - :vartype type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC] - """ - - type: Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC]] - """Required. BOT_SERVICE_RBAC.""" - - -class BotServiceTenantAuthorizationScheme(TypedDict, total=False): - """BotServiceTenantAuthorizationScheme. - - :ivar type: Required. BOT_SERVICE_TENANT. - :vartype type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT] - """ - - type: Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT]] - """Required. BOT_SERVICE_TENANT.""" - - -class BrowserAutomationPreviewTool(TypedDict, total=False): - """The input definition information for a Browser Automation Tool, as used to configure an Agent. - - :ivar type: The object type, which is always 'browser_automation_preview'. Required. - BROWSER_AUTOMATION_PREVIEW. - :vartype type: Literal[ToolType.BROWSER_AUTOMATION_PREVIEW] - :ivar browser_automation_preview: The Browser Automation Tool parameters. Required. - :vartype browser_automation_preview: "BrowserAutomationToolParameters" - """ - - type: Required[Literal[ToolType.BROWSER_AUTOMATION_PREVIEW]] - """The object type, which is always 'browser_automation_preview'. Required. - BROWSER_AUTOMATION_PREVIEW.""" - browser_automation_preview: Required["BrowserAutomationToolParameters"] - """The Browser Automation Tool parameters. Required.""" - - -class BrowserAutomationPreviewToolboxTool(TypedDict, total=False): - """A browser automation 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, "ToolConfig"] - :ivar type: Required. BROWSER_AUTOMATION_PREVIEW. - :vartype type: Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW] - :ivar browser_automation_preview: The Browser Automation Tool parameters. Required. - :vartype browser_automation_preview: "BrowserAutomationToolParameters" - """ - - name: str - """Optional user-defined name for this tool or configuration.""" - description: str - """Optional user-defined description for this tool or configuration.""" - tool_configs: dict[str, "ToolConfig"] - """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.""" - type: Required[Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW]] - """Required. BROWSER_AUTOMATION_PREVIEW.""" - browser_automation_preview: Required["BrowserAutomationToolParameters"] - """The Browser Automation Tool parameters. Required.""" - - -class BrowserAutomationToolConnectionParameters(TypedDict, total=False): # pylint: disable=name-too-long - """Definition of input parameters for the connection used by the Browser Automation Tool. - - :ivar project_connection_id: The ID of the project connection to your Azure Playwright - resource. Required. - :vartype project_connection_id: str - """ - - project_connection_id: Required[str] - """The ID of the project connection to your Azure Playwright resource. Required.""" - - -class BrowserAutomationToolParameters(TypedDict, total=False): - """Definition of input parameters for the Browser Automation Tool. - - :ivar connection: The project connection parameters associated with the Browser Automation - Tool. Required. - :vartype connection: "BrowserAutomationToolConnectionParameters" - """ - - connection: Required["BrowserAutomationToolConnectionParameters"] - """The project connection parameters associated with the Browser Automation Tool. Required.""" - - -class CaptureStructuredOutputsTool(TypedDict, total=False): - """A tool for capturing structured outputs. - - :ivar type: The type of the tool. Always ``capture_structured_outputs``. Required. - CAPTURE_STRUCTURED_OUTPUTS. - :vartype type: Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS] - :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, "ToolConfig"] - :ivar outputs: The structured outputs to capture from the model. Required. - :vartype outputs: "StructuredOutputDefinition" - """ - - type: Required[Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS]] - """The type of the tool. Always ``capture_structured_outputs``. Required. - CAPTURE_STRUCTURED_OUTPUTS.""" - name: str - """Deprecated. This property is deprecated and will be removed in a future version.""" - description: str - """Deprecated. This property is deprecated and will be removed in a future version.""" - tool_configs: dict[str, "ToolConfig"] - """Deprecated. This property is deprecated and will be removed in a future version.""" - outputs: Required["StructuredOutputDefinition"] - """The structured outputs to capture from the model. Required.""" - - -class ChartCoordinate(TypedDict, total=False): - """Coordinates for the analysis chart. - - :ivar x: X-axis coordinate. Required. - :vartype x: int - :ivar y: Y-axis coordinate. Required. - :vartype y: int - :ivar size: Size of the chart element. Required. - :vartype size: int - """ - - x: Required[int] - """X-axis coordinate. Required.""" - y: Required[int] - """Y-axis coordinate. Required.""" - size: Required[int] - """Size of the chart element. Required.""" - - -class ClusterInsightResult(TypedDict, total=False): - """Insights from the cluster analysis. - - :ivar summary: Summary of the insights report. Required. - :vartype summary: "InsightSummary" - :ivar clusters: List of clusters identified in the insights. Required. - :vartype clusters: list["InsightCluster"] - :ivar coordinates: Optional mapping of IDs to 2D coordinates used by the UX for - visualization. - - The map keys are string identifiers (for example, a cluster id or a sample id) - and the values are the coordinates and visual size for rendering on a 2D chart. - - This property is omitted unless the client requests coordinates (for example, - by passing ``includeCoordinates=true`` as a query parameter). - - Example: - - .. code-block:: - - { - "cluster-1": { "x": 12, "y": 34, "size": 8 }, - "sample-123": { "x": 18, "y": 22, "size": 4 } - } - - Coordinates are intended only for client-side visualization and do not - modify the canonical insights results. - :vartype coordinates: dict[str, "ChartCoordinate"] - """ - - summary: Required["InsightSummary"] - """Summary of the insights report. Required.""" - clusters: Required[list["InsightCluster"]] - """List of clusters identified in the insights. Required.""" - coordinates: dict[str, "ChartCoordinate"] - """ Optional mapping of IDs to 2D coordinates used by the UX for visualization. - - The map keys are string identifiers (for example, a cluster id or a sample id) - and the values are the coordinates and visual size for rendering on a 2D chart. - - This property is omitted unless the client requests coordinates (for example, - by passing ``includeCoordinates=true`` as a query parameter). - - Example: - - .. code-block:: - - { - \"cluster-1\": { \"x\": 12, \"y\": 34, \"size\": 8 }, - \"sample-123\": { \"x\": 18, \"y\": 22, \"size\": 4 } - } - - Coordinates are intended only for client-side visualization and do not - modify the canonical insights results.""" - - -class ClusterTokenUsage(TypedDict, total=False): - """Token usage for cluster analysis. - - :ivar input_token_usage: input token usage. Required. - :vartype input_token_usage: int - :ivar output_token_usage: output token usage. Required. - :vartype output_token_usage: int - :ivar total_token_usage: total token usage. Required. - :vartype total_token_usage: int - """ - - inputTokenUsage: Required[int] - """input token usage. Required.""" - outputTokenUsage: Required[int] - """output token usage. Required.""" - totalTokenUsage: Required[int] - """total token usage. Required.""" - - -class CodeBasedEvaluatorDefinition(TypedDict, total=False): - """Code-based evaluator definition using python code. - - :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, "EvaluatorMetric"] - :ivar type: Required. Code-based definition. - :vartype type: Literal[EvaluatorDefinitionType.CODE] - :ivar code_text: Inline code text for the evaluator. - :vartype code_text: str - :ivar entry_point: The entry point Python file name for the uploaded evaluator code (e.g. - 'answer_length_evaluator.py'). - :vartype entry_point: str - :ivar image_tag: The container image tag to use for evaluator code execution. - :vartype image_tag: str - :ivar blob_uri: The blob URI for the evaluator storage. - :vartype blob_uri: str - """ - - init_parameters: dict[str, Any] - """The JSON schema (Draft 2020-12) for the evaluator's input parameters. This includes parameters - like type, properties, required.""" - data_schema: dict[str, Any] - """The JSON schema (Draft 2020-12) for the evaluator's input data. This includes parameters like - type, properties, required.""" - metrics: dict[str, "EvaluatorMetric"] - """List of output metrics produced by this evaluator.""" - type: Required[Literal[EvaluatorDefinitionType.CODE]] - """Required. Code-based definition.""" - code_text: str - """Inline code text for the evaluator.""" - entry_point: str - """The entry point Python file name for the uploaded evaluator code (e.g. - 'answer_length_evaluator.py').""" - image_tag: str - """The container image tag to use for evaluator code execution.""" - blob_uri: str - """The blob URI for the evaluator storage.""" - - -class CodeConfiguration(TypedDict, total=False): - """Code-based deployment configuration for a hosted agent. - - :ivar runtime: The runtime identifier for code execution (e.g., 'python_3_11', 'python_3_12', - 'python_3_13'). Required. - :vartype runtime: str - :ivar entry_point: The entry point command and arguments for the code execution. Required. - :vartype entry_point: list[str] - :ivar dependency_resolution: How package dependencies are resolved at deployment time. Defaults - to ``bundled``, where the caller bundles all dependencies into the uploaded zip and the service - performs no remote build. ``remote_build`` instructs the service to build dependencies remotely - from the manifest included in the uploaded zip. Required. Known values are: "bundled" and - "remote_build". - :vartype dependency_resolution: Union[str, "CodeDependencyResolution"] - :ivar content_hash: The SHA-256 hex digest of the uploaded code zip. Set by the service from - the ``x-ms-code-zip-sha256`` request header; read-only in responses and never accepted in - request payloads. - :vartype content_hash: str - """ - - runtime: Required[str] - """The runtime identifier for code execution (e.g., 'python_3_11', 'python_3_12', 'python_3_13'). - Required.""" - entry_point: Required[list[str]] - """The entry point command and arguments for the code execution. Required.""" - dependency_resolution: Required[Union[str, "CodeDependencyResolution"]] - """How package dependencies are resolved at deployment time. Defaults to ``bundled``, where the - caller bundles all dependencies into the uploaded zip and the service performs no remote build. - ``remote_build`` instructs the service to build dependencies remotely from the manifest - included in the uploaded zip. Required. Known values are: \"bundled\" and \"remote_build\".""" - content_hash: str - """The SHA-256 hex digest of the uploaded code zip. Set by the service from the - ``x-ms-code-zip-sha256`` request header; read-only in responses and never accepted in request - payloads.""" - - -class CodeInterpreterTool(TypedDict, total=False): - """Code interpreter. - - :ivar type: The type of the code interpreter tool. Always ``code_interpreter``. Required. - CODE_INTERPRETER. - :vartype type: Literal[ToolType.CODE_INTERPRETER] - :ivar allowed_callers: - :vartype allowed_callers: list[Union[str, "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, "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: Union[str, "AutoCodeInterpreterToolParam"] - """ - - type: Required[Literal[ToolType.CODE_INTERPRETER]] - """The type of the code interpreter tool. Always ``code_interpreter``. Required. CODE_INTERPRETER.""" - allowed_callers: Optional[list[Union[str, "CallableToolAllowedCaller"]]] - name: str - """Deprecated. This property is deprecated and will be removed in a future version.""" - description: str - """Deprecated. This property is deprecated and will be removed in a future version.""" - tool_configs: dict[str, "ToolConfig"] - """Deprecated. This property is deprecated and will be removed in a future version.""" - container: Union[str, "AutoCodeInterpreterToolParam"] - """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.""" - - -class CodeInterpreterToolboxTool(TypedDict, total=False): - """A code interpreter 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, "ToolConfig"] - :ivar type: Required. CODE_INTERPRETER. - :vartype type: Literal[ToolboxToolType.CODE_INTERPRETER] - :ivar allowed_callers: - :vartype allowed_callers: list[Union[str, "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: Union[str, "AutoCodeInterpreterToolParam"] - """ - - name: str - """Optional user-defined name for this tool or configuration.""" - description: str - """Optional user-defined description for this tool or configuration.""" - tool_configs: dict[str, "ToolConfig"] - """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.""" - type: Required[Literal[ToolboxToolType.CODE_INTERPRETER]] - """Required. CODE_INTERPRETER.""" - allowed_callers: Optional[list[Union[str, "CallableToolAllowedCaller"]]] - container: Union[str, "AutoCodeInterpreterToolParam"] - """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.""" - - -class ComparisonFilter(TypedDict, total=False): - """Comparison Filter. - - :ivar type: Specifies the comparison operator: ``eq``, ``ne``, ``gt``, ``gte``, ``lt``, - ``lte``, ``in``, ``nin``. - - * `eq`: equals - * `ne`: not equal - * `gt`: greater than - * `gte`: greater than or equal - * `lt`: less than - * `lte`: less than or equal - * `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: Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"] - :ivar key: The key to compare against the value. Required. - :vartype key: str - :ivar value: The value to compare against the attribute key; supports string, number, or - boolean types. Required. Is one of the following types: str, float, bool, [Union[str, float]] - :vartype value: Union[str, float, bool, list[Union[str, float]]] - """ - - type: Required[Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]] - """Specifies the comparison operator: ``eq``, ``ne``, ``gt``, ``gte``, ``lt``, ``lte``, ``in``, - ``nin``. - - * `eq`: equals - * `ne`: not equal - * `gt`: greater than - * `gte`: greater than or equal - * `lt`: less than - * `lte`: less than or equal - * `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\"]""" - key: Required[str] - """The key to compare against the value. Required.""" - value: Required[Union[str, float, bool, list[Union[str, float]]]] - """The value to compare against the attribute key; supports string, number, or boolean types. - Required. Is one of the following types: str, float, bool, [Union[str, float]]""" - - -class CompoundFilter(TypedDict, total=False): - """Compound Filter. - - :ivar type: Type of operation: ``and`` or ``or``. Required. Is either a Literal["and"] type or - a Literal["or"] type. - :vartype type: Literal["and", "or"] - :ivar filters: Array of filters to combine. Items can be ``ComparisonFilter`` or - ``CompoundFilter``. Required. - :vartype filters: list[Union["ComparisonFilter", Any]] - """ - - type: Required[Literal["and", "or"]] - """Type of operation: ``and`` or ``or``. Required. Is either a Literal[\"and\"] type or a - Literal[\"or\"] type.""" - filters: Required[list[Union["ComparisonFilter", Any]]] - """Array of filters to combine. Items can be ``ComparisonFilter`` or ``CompoundFilter``. Required.""" - - -class ComputerTool(TypedDict, total=False): - """Computer. - - :ivar type: The type of the computer tool. Always ``computer``. Required. COMPUTER. - :vartype type: Literal[ToolType.COMPUTER] - """ - - type: Required[Literal[ToolType.COMPUTER]] - """The type of the computer tool. Always ``computer``. Required. COMPUTER.""" - - -class ComputerUsePreviewTool(TypedDict, total=False): - """Computer use preview. - - :ivar type: The type of the computer use tool. Always ``computer_use_preview``. Required. - COMPUTER_USE_PREVIEW. - :vartype type: Literal[ToolType.COMPUTER_USE_PREVIEW] - :ivar environment: The type of computer environment to control. Required. Known values are: - "windows", "mac", "linux", "ubuntu", and "browser". - :vartype environment: Union[str, "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: Required[Literal[ToolType.COMPUTER_USE_PREVIEW]] - """The type of the computer use tool. Always ``computer_use_preview``. Required. - COMPUTER_USE_PREVIEW.""" - environment: Required[Union[str, "ComputerEnvironment"]] - """The type of computer environment to control. Required. Known values are: \"windows\", \"mac\", - \"linux\", \"ubuntu\", and \"browser\".""" - display_width: Required[int] - """The width of the computer display. Required.""" - display_height: Required[int] - """The height of the computer display. Required.""" - - -class ContainerAutoParam(TypedDict, total=False): - """ContainerAutoParam. - - :ivar type: Automatically creates a container for this request. Required. CONTAINER_AUTO. - :vartype type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO] - :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: Union[str, "ContainerMemoryLimit"] - :ivar skills: An optional list of skills referenced by id or inline data. - :vartype skills: list["ContainerSkill"] - :ivar network_policy: - :vartype network_policy: "ContainerNetworkPolicyParam" - """ - - type: Required[Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO]] - """Automatically creates a container for this request. Required. CONTAINER_AUTO.""" - file_ids: list[str] - """An optional list of uploaded files to make available to your code.""" - memory_limit: Optional[Union[str, "ContainerMemoryLimit"]] - """Known values are: \"1g\", \"4g\", \"16g\", and \"64g\".""" - skills: list["ContainerSkill"] - """An optional list of skills referenced by id or inline data.""" - network_policy: "ContainerNetworkPolicyParam" - - -class ContainerConfiguration(TypedDict, total=False): - """Container-based deployment configuration for a hosted agent. - - :ivar image: The container image for the hosted agent. Required. - :vartype image: str - :ivar registry_connection_id: The id (or name) of the Foundry project connection that provides - the credentials used to authenticate to the private container registry hosting ``image``. The - connection abstracts the auth mechanism — for example a managed-identity-federated token - exchange, or a username/token secret — so registry credentials are never part of the agent - definition. Omit for public images or registries already reachable by the platform's default - identity (for example, Azure Container Registry). - :vartype registry_connection_id: str - """ - - image: Required[str] - """The container image for the hosted agent. Required.""" - registry_connection_id: str - """The id (or name) of the Foundry project connection that provides the credentials used to - authenticate to the private container registry hosting ``image``. The connection abstracts the - auth mechanism — for example a managed-identity-federated token exchange, or a username/token - secret — so registry credentials are never part of the agent definition. Omit for public images - or registries already reachable by the platform's default identity (for example, Azure - Container Registry).""" - - -class ContainerNetworkPolicyAllowlistParam(TypedDict, total=False): - """ContainerNetworkPolicyAllowlistParam. - - :ivar type: Allow outbound network access only to specified domains. Always ``allowlist``. - Required. ALLOWLIST. - :vartype type: Literal[ContainerNetworkPolicyParamType.ALLOWLIST] - :ivar allowed_domains: A list of allowed domains when type is ``allowlist``. Required. - :vartype allowed_domains: list[str] - :ivar domain_secrets: Optional domain-scoped secrets for allowlisted domains. - :vartype domain_secrets: list["ContainerNetworkPolicyDomainSecretParam"] - """ - - type: Required[Literal[ContainerNetworkPolicyParamType.ALLOWLIST]] - """Allow outbound network access only to specified domains. Always ``allowlist``. Required. - ALLOWLIST.""" - allowed_domains: Required[list[str]] - """A list of allowed domains when type is ``allowlist``. Required.""" - domain_secrets: list["ContainerNetworkPolicyDomainSecretParam"] - """Optional domain-scoped secrets for allowlisted domains.""" - - -class ContainerNetworkPolicyDisabledParam(TypedDict, total=False): - """ContainerNetworkPolicyDisabledParam. - - :ivar type: Disable outbound network access. Always ``disabled``. Required. DISABLED. - :vartype type: Literal[ContainerNetworkPolicyParamType.DISABLED] - """ - - type: Required[Literal[ContainerNetworkPolicyParamType.DISABLED]] - """Disable outbound network access. Always ``disabled``. Required. DISABLED.""" - - -class ContainerNetworkPolicyDomainSecretParam(TypedDict, total=False): - """ContainerNetworkPolicyDomainSecretParam. - - :ivar domain: The domain associated with the secret. Required. - :vartype domain: str - :ivar name: The name of the secret to inject for the domain. Required. - :vartype name: str - :ivar value: The secret value to inject for the domain. Required. - :vartype value: str - """ - - domain: Required[str] - """The domain associated with the secret. Required.""" - name: Required[str] - """The name of the secret to inject for the domain. Required.""" - value: Required[str] - """The secret value to inject for the domain. Required.""" - - -class ContinuousEvaluationRuleAction(TypedDict, total=False): - """Evaluation rule action for continuous evaluation. - - :ivar type: Required. Continuous evaluation. - :vartype type: Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION] - :ivar eval_id: Eval Id to add continuous evaluation runs to. Required. - :vartype eval_id: str - :ivar max_hourly_runs: Maximum number of evaluation runs allowed per hour. - :vartype max_hourly_runs: int - :ivar sampling_rate: Percentage (0-100] chance that a matching event triggers an evaluation. - When omitted, the service-default is to evaluate every event, which is equivalent to setting a - sampling rate of 100. - :vartype sampling_rate: float - """ - - type: Required[Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION]] - """Required. Continuous evaluation.""" - evalId: Required[str] - """Eval Id to add continuous evaluation runs to. Required.""" - maxHourlyRuns: int - """Maximum number of evaluation runs allowed per hour.""" - samplingRate: float - """Percentage (0-100] chance that a matching event triggers an evaluation. When omitted, the - service-default is to evaluate every event, which is equivalent to setting a sampling rate of - 100.""" - - -class CosmosDBIndex(TypedDict, total=False): - """CosmosDB Vector Store 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. CosmosDB. - :vartype type: Literal[IndexType.COSMOS_DB] - :ivar connection_name: Name of connection to CosmosDB. Required. - :vartype connection_name: str - :ivar database_name: Name of the CosmosDB Database. Required. - :vartype database_name: str - :ivar container_name: Name of CosmosDB Container. Required. - :vartype container_name: str - :ivar embedding_configuration: Embedding model configuration. Required. - :vartype embedding_configuration: "EmbeddingConfiguration" - :ivar field_mapping: Field mapping configuration. Required. - :vartype field_mapping: "FieldMapping" - """ - - id: str - """Asset ID, a unique identifier for the asset.""" - name: Required[str] - """The name of the resource. Required.""" - version: Required[str] - """The version of the resource. Required.""" - description: str - """The asset description text.""" - tags: dict[str, str] - """Tag dictionary. Tags can be added, removed, and updated.""" - type: Required[Literal[IndexType.COSMOS_DB]] - """Type of index. Required. CosmosDB.""" - connectionName: Required[str] - """Name of connection to CosmosDB. Required.""" - databaseName: Required[str] - """Name of the CosmosDB Database. Required.""" - containerName: Required[str] - """Name of CosmosDB Container. Required.""" - embeddingConfiguration: Required["EmbeddingConfiguration"] - """Embedding model configuration. Required.""" - fieldMapping: Required["FieldMapping"] - """Field mapping configuration. Required.""" - - -class CreateSkillVersionFromFilesBody(TypedDict, total=False): - """Multipart request body for creating a skill version from files. Accepts either a single zip - file or multiple individual skill files (directory upload). For zip uploads, the server - extracts and validates contents. For directory uploads, files are validated as-is. - - :ivar files: Skill files to upload. Upload a single zip file or multiple individual files with - relative paths. Required. - :vartype files: list[FileType] - :ivar default: Whether to set this version as the default. Defaults to false. - :vartype default: bool - """ - - files: Required[list[FileType]] - """Skill files to upload. Upload a single zip file or multiple individual files with relative - paths. Required.""" - default: bool - """Whether to set this version as the default. Defaults to false.""" - - -class CronTrigger(TypedDict, total=False): - """Cron based trigger. - - :ivar type: Required. Cron based trigger. - :vartype type: Literal[TriggerType.CRON] - :ivar expression: Cron expression that defines the schedule frequency. Required. - :vartype expression: str - :ivar time_zone: Time zone for the cron schedule. Defaults to ``UTC``. - :vartype time_zone: str - :ivar start_time: Start time for the cron schedule in ISO 8601 format. - :vartype start_time: str - :ivar end_time: End time for the cron schedule in ISO 8601 format. - :vartype end_time: str - """ - - type: Required[Literal[TriggerType.CRON]] - """Required. Cron based trigger.""" - expression: Required[str] - """Cron expression that defines the schedule frequency. Required.""" - timeZone: str - """Time zone for the cron schedule. Defaults to ``UTC``.""" - startTime: str - """Start time for the cron schedule in ISO 8601 format.""" - endTime: str - """End time for the cron schedule in ISO 8601 format.""" - - -class CustomGrammarFormatParam(TypedDict, total=False): - """Grammar format. - - :ivar type: Grammar format. Always ``grammar``. Required. GRAMMAR. - :vartype type: Literal[CustomToolParamFormatType.GRAMMAR] - :ivar syntax: The syntax of the grammar definition. One of ``lark`` or ``regex``. Required. - Known values are: "lark" and "regex". - :vartype syntax: Union[str, "GrammarSyntax1"] - :ivar definition: The grammar definition. Required. - :vartype definition: str - """ - - type: Required[Literal[CustomToolParamFormatType.GRAMMAR]] - """Grammar format. Always ``grammar``. Required. GRAMMAR.""" - syntax: Required[Union[str, "GrammarSyntax1"]] - """The syntax of the grammar definition. One of ``lark`` or ``regex``. Required. Known values are: - \"lark\" and \"regex\".""" - definition: Required[str] - """The grammar definition. Required.""" - - -class CustomRoutineTrigger(TypedDict, total=False): - """A custom event routine trigger. - - :ivar type: The trigger type. Required. A custom event trigger. - :vartype type: Literal[RoutineTriggerType.CUSTOM] - :ivar provider: The external provider that emits the custom event. Required. - :vartype provider: str - :ivar event_name: The provider-specific event name that fires the routine. - :vartype event_name: str - :ivar parameters: Provider-specific trigger parameters. Required. - :vartype parameters: dict[str, Any] - """ - - type: Required[Literal[RoutineTriggerType.CUSTOM]] - """The trigger type. Required. A custom event trigger.""" - provider: Required[str] - """The external provider that emits the custom event. Required.""" - event_name: str - """The provider-specific event name that fires the routine.""" - parameters: Required[dict[str, Any]] - """Provider-specific trigger parameters. Required.""" - - -class CustomTextFormatParam(TypedDict, total=False): - """Text format. - - :ivar type: Unconstrained text format. Always ``text``. Required. TEXT. - :vartype type: Literal[CustomToolParamFormatType.TEXT] - """ - - type: Required[Literal[CustomToolParamFormatType.TEXT]] - """Unconstrained text format. Always ``text``. Required. TEXT.""" - - -class CustomToolParam(TypedDict, total=False): - """Custom tool. - - :ivar type: The type of the custom tool. Always ``custom``. Required. CUSTOM. - :vartype type: Literal[ToolType.CUSTOM] - :ivar name: The name of the custom tool, used to identify it in tool calls. Required. - :vartype name: str - :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: "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[Union[str, "CallableToolAllowedCaller"]] - """ - - type: Required[Literal[ToolType.CUSTOM]] - """The type of the custom tool. Always ``custom``. Required. CUSTOM.""" - name: Required[str] - """The name of the custom tool, used to identify it in tool calls. Required.""" - description: str - """Optional description of the custom tool, used to provide more context.""" - format: "CustomToolParamFormat" - """The input format for the custom tool. Default is unconstrained text.""" - defer_loading: bool - """Whether this tool should be deferred and discovered via tool search.""" - allowed_callers: Optional[list[Union[str, "CallableToolAllowedCaller"]]] - - -class DailyRecurrenceSchedule(TypedDict, total=False): - """Daily recurrence schedule. - - :ivar type: Daily recurrence type. Required. Daily recurrence pattern. - :vartype type: Literal[RecurrenceType.DAILY] - :ivar hours: Hours for the recurrence schedule. Required. - :vartype hours: list[int] - """ - - type: Required[Literal[RecurrenceType.DAILY]] - """Daily recurrence type. Required. Daily recurrence pattern.""" - hours: Required[list[int]] - """Hours for the recurrence schedule. Required.""" - - -class DataGenerationJob(TypedDict, total=False): - """Data Generation Job resource. - - :ivar id: Server-assigned unique identifier. Required. - :vartype id: str - :ivar inputs: Caller-supplied inputs. - :vartype inputs: "DataGenerationJobInputs" - :ivar result: Result produced on success. - :vartype result: "DataGenerationJobResult" - :ivar status: Current lifecycle status. Required. Known values are: "queued", "in_progress", - "succeeded", "failed", and "cancelled". - :vartype status: Union[str, "JobStatus"] - :ivar error: Error details — populated only on failure. - :vartype error: "ApiError" - :ivar created_at: The timestamp when the job was created, represented in Unix time (seconds - since January 1, 1970). Required. - :vartype created_at: int - :ivar finished_at: The timestamp when the job was finished, represented in Unix time (seconds - since January 1, 1970). - :vartype finished_at: int - """ - - id: Required[str] - """Server-assigned unique identifier. Required.""" - inputs: "DataGenerationJobInputs" - """Caller-supplied inputs.""" - result: "DataGenerationJobResult" - """Result produced on success.""" - status: Required[Union[str, "JobStatus"]] - """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", - \"succeeded\", \"failed\", and \"cancelled\".""" - error: "ApiError" - """Error details — populated only on failure.""" - created_at: Required[int] - """The timestamp when the job was created, represented in Unix time (seconds since January 1, - 1970). Required.""" - finished_at: int - """The timestamp when the job was finished, represented in Unix time (seconds since January 1, - 1970).""" - - -class DataGenerationJobInputs(TypedDict, total=False): - """Caller-supplied inputs for a data generation job. - - :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["DataGenerationJobSource"] - :ivar options: The options for the data generation job. Required. - :vartype options: "DataGenerationJobOptions" - :ivar scenario: The scenario of the data generation job. Either for fine-tuning or evaluation. - Required. Known values are: "supervised_finetuning", "reinforcement_finetuning", and - "evaluation". - :vartype scenario: Union[str, "DataGenerationJobScenario"] - :ivar output_options: Optional caller-supplied metadata for the job's output. See individual - fields for whether they apply to file outputs (fine-tuning scenarios), dataset outputs - (evaluation scenario), or both. - :vartype output_options: "DataGenerationJobOutputOptions" - """ - - name: Required[str] - """The display name of the data generation job. Required.""" - sources: Required[list["DataGenerationJobSource"]] - """The sources used for the data generation job. Required.""" - options: Required["DataGenerationJobOptions"] - """The options for the data generation job. Required.""" - scenario: Required[Union[str, "DataGenerationJobScenario"]] - """The scenario of the data generation job. Either for fine-tuning or evaluation. Required. Known - values are: \"supervised_finetuning\", \"reinforcement_finetuning\", and \"evaluation\".""" - output_options: "DataGenerationJobOutputOptions" - """Optional caller-supplied metadata for the job's output. See individual fields for whether they - apply to file outputs (fine-tuning scenarios), dataset outputs (evaluation scenario), or both.""" - - -class DataGenerationJobOutputOptions(TypedDict, total=False): - """Output options for data generation job. - - :ivar name: Name to assign to the output. Used as the filename for Azure OpenAI file outputs - (fine-tuning scenarios) and as the dataset name for dataset outputs (evaluation scenario). - :vartype name: str - :ivar description: Description to assign to the output. Applies only to dataset outputs - (evaluation scenario); ignored for Azure OpenAI file outputs. - :vartype description: str - :ivar tags: Tags to assign to the output. Applies only to dataset outputs (evaluation - scenario); ignored for Azure OpenAI file outputs. - :vartype tags: dict[str, str] - """ - - name: str - """Name to assign to the output. Used as the filename for Azure OpenAI file outputs (fine-tuning - scenarios) and as the dataset name for dataset outputs (evaluation scenario).""" - description: str - """Description to assign to the output. Applies only to dataset outputs (evaluation scenario); - ignored for Azure OpenAI file outputs.""" - tags: dict[str, str] - """Tags to assign to the output. Applies only to dataset outputs (evaluation scenario); ignored - for Azure OpenAI file outputs.""" - - -class DataGenerationJobResult(TypedDict, total=False): - """Result produced by a successful data generation job. - - :ivar outputs: The final job outputs: Azure OpenAI files for fine-tuning, or datasets for - evaluation. - :vartype outputs: list["DataGenerationJobOutput"] - :ivar generated_samples: The number of samples actually generated. Required. - :vartype generated_samples: int - :ivar token_usage: The token usage information for the data generation job. - :vartype token_usage: "DataGenerationTokenUsage" - """ - - outputs: list["DataGenerationJobOutput"] - """The final job outputs: Azure OpenAI files for fine-tuning, or datasets for evaluation.""" - generated_samples: Required[int] - """The number of samples actually generated. Required.""" - token_usage: "DataGenerationTokenUsage" - """The token usage information for the data generation job.""" - - -class DataGenerationModelOptions(TypedDict, total=False): - """LLM model options for data generation jobs. - - :ivar model: Base model name used to generate data. Required. - :vartype model: str - """ - - model: Required[str] - """Base model name used to generate data. Required.""" - - -class DataGenerationTokenUsage(TypedDict, total=False): - """Token usage information for a data generation job. - - :ivar prompt_tokens: The number of prompt tokens used. Required. - :vartype prompt_tokens: int - :ivar completion_tokens: The number of completion tokens generated. Required. - :vartype completion_tokens: int - :ivar total_tokens: Total number of tokens used. Required. - :vartype total_tokens: int - """ - - prompt_tokens: Required[int] - """The number of prompt tokens used. Required.""" - completion_tokens: Required[int] - """The number of completion tokens generated. Required.""" - total_tokens: Required[int] - """Total number of tokens used. Required.""" - - -class DatasetDataGenerationJobOutput(TypedDict, total=False): - """Dataset output for a data generation job. - - :ivar type: Dataset output. Required. The generated data is a Dataset. - :vartype type: Literal[DataGenerationJobOutputType.DATASET] - :ivar id: The id of the output dataset created. - :vartype id: str - :ivar name: The name of the output dataset. - :vartype name: str - :ivar version: The version of the output dataset. - :vartype version: str - :ivar description: Description of the output dataset. - :vartype description: str - :ivar tags: Tag dictionary of the output dataset. - :vartype tags: dict[str, str] - """ - - type: Required[Literal[DataGenerationJobOutputType.DATASET]] - """Dataset output. Required. The generated data is a Dataset.""" - id: str - """The id of the output dataset created.""" - name: str - """The name of the output dataset.""" - version: str - """The version of the output dataset.""" - description: str - """Description of the output dataset.""" - tags: dict[str, str] - """Tag dictionary of the output dataset.""" - - -class DatasetEvaluatorGenerationJobSource(TypedDict, total=False): - """Dataset source for evaluator generation jobs — reference to a dataset. - - :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 Dataset. Required. Dataset source — - reference to a dataset. - :vartype type: Literal[EvaluatorGenerationJobSourceType.DATASET] - :ivar name: The name of the dataset. Required. - :vartype name: str - :ivar version: The version of the dataset. If not specified, the latest version is used. - :vartype version: str - """ - - description: str - """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: Required[Literal[EvaluatorGenerationJobSourceType.DATASET]] - """The source type for this source, which is Dataset. Required. Dataset source — reference to a - dataset.""" - name: Required[str] - """The name of the dataset. Required.""" - version: str - """The version of the dataset. If not specified, the latest version is used.""" - - -class DatasetReference(TypedDict, total=False): - """Reference to a versioned Foundry Dataset. - - :ivar name: Dataset name. Required. - :vartype name: str - :ivar version: Dataset version. Required. - :vartype version: str - """ - - name: Required[str] - """Dataset name. Required.""" - version: Required[str] - """Dataset version. Required.""" - - -class Dimension(TypedDict, total=False): - """A single dimension — one independent, measurable quality dimension within a rubric evaluator's - scoring blueprint. - - :ivar id: Stable identifier for this dimension (snake_case, e.g., ``correct_resolution``). - Required. Provided by the user when manually creating a rubric evaluator or during - human-in-the-loop review of a generated set; the generation pipeline produces an initial value - the user can edit. Editable when saving new versions. Required. - :vartype id: str - :ivar description: What this dimension measures (e.g., 'Correctly identifies the user's - reservation intent and pursues the appropriate workflow'). Required. - :vartype description: str - :ivar weight: Relative weight of this dimension (1-10). The generation pipeline assigns exactly - one dimension weight 8-10; all others use 1-6. User edits are not constrained by this - heuristic. Required. - :vartype weight: int - :ivar always_applicable: When true, the LLM judge always scores this dimension regardless of - relevance (skips applicability assessment). The service-generated general quality/policy - dimension has this set to true and is non-editable. Users may set this on their own custom - dimensions. The service defaults to ``false`` if a value is not specified by the caller. - :vartype always_applicable: bool - """ - - id: Required[str] - """Stable identifier for this dimension (snake_case, e.g., ``correct_resolution``). Required. - Provided by the user when manually creating a rubric evaluator or during human-in-the-loop - review of a generated set; the generation pipeline produces an initial value the user can edit. - Editable when saving new versions. Required.""" - description: Required[str] - """What this dimension measures (e.g., 'Correctly identifies the user's reservation intent and - pursues the appropriate workflow'). Required.""" - weight: Required[int] - """Relative weight of this dimension (1-10). The generation pipeline assigns exactly one dimension - weight 8-10; all others use 1-6. User edits are not constrained by this heuristic. Required.""" - always_applicable: bool - """When true, the LLM judge always scores this dimension regardless of relevance (skips - applicability assessment). The service-generated general quality/policy dimension has this set - to true and is non-editable. Users may set this on their own custom dimensions. The service - defaults to ``false`` if a value is not specified by the caller.""" - - -class EmbeddingConfiguration(TypedDict, total=False): - """Embedding configuration class. - - :ivar model_deployment_name: Deployment name of embedding model. It can point to a model - deployment either in the parent AIServices or a connection. Required. - :vartype model_deployment_name: str - :ivar embedding_field: Embedding field. Required. - :vartype embedding_field: str - """ - - modelDeploymentName: Required[str] - """Deployment name of embedding model. It can point to a model deployment either in the parent - AIServices or a connection. Required.""" - embeddingField: Required[str] - """Embedding field. Required.""" - - -class EmptyModelParam(TypedDict, total=False): - """EmptyModelParam.""" - - -class EndpointBasedEvaluatorDefinition(TypedDict, total=False): - """Endpoint-based evaluator definition. The customer owns and hosts an HTTP endpoint that - implements the evaluation contract. The evaluator references a Project Connection by name; the - connection stores the endpoint URL and credentials (API Key or Entra ID). At execution time, - the service resolves the connection to obtain the endpoint URL and authentication details, then - calls the endpoint for each evaluation row. - - :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, "EvaluatorMetric"] - :ivar type: Required. Endpoint-based evaluator definition. References a customer-owned HTTP - endpoint via a Project Connection. - :vartype type: Literal[EvaluatorDefinitionType.ENDPOINT] - :ivar connection_name: Name of the Project Connection that stores the endpoint URL and - credentials. The connection must exist on the project and have a non-empty target URL. - Supported auth types: ApiKey (sends ``api-key`` header) and AAD/Entra ID (acquires a bearer - token via the project's Managed Identity). Required. - :vartype connection_name: str - """ - - init_parameters: dict[str, Any] - """The JSON schema (Draft 2020-12) for the evaluator's input parameters. This includes parameters - like type, properties, required.""" - data_schema: dict[str, Any] - """The JSON schema (Draft 2020-12) for the evaluator's input data. This includes parameters like - type, properties, required.""" - metrics: dict[str, "EvaluatorMetric"] - """List of output metrics produced by this evaluator.""" - type: Required[Literal[EvaluatorDefinitionType.ENDPOINT]] - """Required. Endpoint-based evaluator definition. References a customer-owned HTTP endpoint via a - Project Connection.""" - connection_name: Required[str] - """Name of the Project Connection that stores the endpoint URL and credentials. The connection - must exist on the project and have a non-empty target URL. Supported auth types: ApiKey (sends - ``api-key`` header) and AAD/Entra ID (acquires a bearer token via the project's Managed - Identity). Required.""" - - -class EntraAuthorizationScheme(TypedDict, total=False): - """EntraAuthorizationScheme. - - :ivar type: Required. ENTRA. - :vartype type: Literal[AgentEndpointAuthorizationSchemeType.ENTRA] - """ - - type: Required[Literal[AgentEndpointAuthorizationSchemeType.ENTRA]] - """Required. ENTRA.""" - - -class EvalResult(TypedDict, total=False): - """Result of the evaluation. - - :ivar name: name of the check. Required. - :vartype name: str - :ivar type: type of the check. Required. - :vartype type: str - :ivar score: score. Required. - :vartype score: float - :ivar passed: indicates if the check passed or failed. Required. - :vartype passed: bool - """ - - name: Required[str] - """name of the check. Required.""" - type: Required[str] - """type of the check. Required.""" - score: Required[float] - """score. Required.""" - passed: Required[bool] - """indicates if the check passed or failed. Required.""" - - -class EvalRunResultCompareItem(TypedDict, total=False): - """Metric comparison for a treatment against the baseline. - - :ivar treatment_run_id: The treatment run ID. Required. - :vartype treatment_run_id: str - :ivar treatment_run_summary: Summary statistics of the treatment run. Required. - :vartype treatment_run_summary: "EvalRunResultSummary" - :ivar delta_estimate: Estimated difference between treatment and baseline. Required. - :vartype delta_estimate: float - :ivar p_value: P-value for the treatment effect. Required. - :vartype p_value: float - :ivar treatment_effect: Type of treatment effect. Required. Known values are: "TooFewSamples", - "Inconclusive", "Changed", "Improved", and "Degraded". - :vartype treatment_effect: Union[str, "TreatmentEffectType"] - """ - - treatmentRunId: Required[str] - """The treatment run ID. Required.""" - treatmentRunSummary: Required["EvalRunResultSummary"] - """Summary statistics of the treatment run. Required.""" - deltaEstimate: Required[float] - """Estimated difference between treatment and baseline. Required.""" - pValue: Required[float] - """P-value for the treatment effect. Required.""" - treatmentEffect: Required[Union[str, "TreatmentEffectType"]] - """Type of treatment effect. Required. Known values are: \"TooFewSamples\", \"Inconclusive\", - \"Changed\", \"Improved\", and \"Degraded\".""" - - -class EvalRunResultComparison(TypedDict, total=False): - """Comparison results for treatment runs against the baseline. - - :ivar testing_criteria: Name of the testing criteria. Required. - :vartype testing_criteria: str - :ivar metric: Metric being evaluated. Required. - :vartype metric: str - :ivar evaluator: Name of the evaluator for this testing criteria. Required. - :vartype evaluator: str - :ivar baseline_run_summary: Summary statistics of the baseline run. Required. - :vartype baseline_run_summary: "EvalRunResultSummary" - :ivar compare_items: List of comparison results for each treatment run. Required. - :vartype compare_items: list["EvalRunResultCompareItem"] - """ - - testingCriteria: Required[str] - """Name of the testing criteria. Required.""" - metric: Required[str] - """Metric being evaluated. Required.""" - evaluator: Required[str] - """Name of the evaluator for this testing criteria. Required.""" - baselineRunSummary: Required["EvalRunResultSummary"] - """Summary statistics of the baseline run. Required.""" - compareItems: Required[list["EvalRunResultCompareItem"]] - """List of comparison results for each treatment run. Required.""" - - -class EvalRunResultSummary(TypedDict, total=False): - """Summary statistics of a metric in an evaluation run. - - :ivar run_id: The evaluation run ID. Required. - :vartype run_id: str - :ivar sample_count: Number of samples in the evaluation run. Required. - :vartype sample_count: int - :ivar average: Average value of the metric in the evaluation run. Required. - :vartype average: float - :ivar standard_deviation: Standard deviation of the metric in the evaluation run. Required. - :vartype standard_deviation: float - """ - - runId: Required[str] - """The evaluation run ID. Required.""" - sampleCount: Required[int] - """Number of samples in the evaluation run. Required.""" - average: Required[float] - """Average value of the metric in the evaluation run. Required.""" - standardDeviation: Required[float] - """Standard deviation of the metric in the evaluation run. Required.""" - - -class EvaluationComparisonInsightRequest(TypedDict, total=False): - """Evaluation Comparison Request. - - :ivar type: The type of request. Required. Evaluation Comparison. - :vartype type: Literal[InsightType.EVALUATION_COMPARISON] - :ivar eval_id: Identifier for the evaluation. Required. - :vartype eval_id: str - :ivar baseline_run_id: The baseline run ID for comparison. Required. - :vartype baseline_run_id: str - :ivar treatment_run_ids: List of treatment run IDs for comparison. Required. - :vartype treatment_run_ids: list[str] - """ - - type: Required[Literal[InsightType.EVALUATION_COMPARISON]] - """The type of request. Required. Evaluation Comparison.""" - evalId: Required[str] - """Identifier for the evaluation. Required.""" - baselineRunId: Required[str] - """The baseline run ID for comparison. Required.""" - treatmentRunIds: Required[list[str]] - """List of treatment run IDs for comparison. Required.""" - - -class EvaluationComparisonInsightResult(TypedDict, total=False): - """Insights from the evaluation comparison. - - :ivar type: The type of insights result. Required. Evaluation Comparison. - :vartype type: Literal[InsightType.EVALUATION_COMPARISON] - :ivar comparisons: Comparison results for each treatment run against the baseline. Required. - :vartype comparisons: list["EvalRunResultComparison"] - :ivar method: The statistical method used for comparison. Required. - :vartype method: str - """ - - type: Required[Literal[InsightType.EVALUATION_COMPARISON]] - """The type of insights result. Required. Evaluation Comparison.""" - comparisons: Required[list["EvalRunResultComparison"]] - """Comparison results for each treatment run against the baseline. Required.""" - method: Required[str] - """The statistical method used for comparison. Required.""" - - -class EvaluationResultSample(TypedDict, total=False): - """A sample from the evaluation result. - - :ivar id: The unique identifier for the analysis sample. Required. - :vartype id: str - :ivar features: Features to help with additional filtering of data in UX. Required. - :vartype features: dict[str, Any] - :ivar correlation_info: Info about the correlation for the analysis sample. Required. - :vartype correlation_info: dict[str, Any] - :ivar type: Evaluation Result Sample Type. Required. A sample from the evaluation result. - :vartype type: Literal[SampleType.EVALUATION_RESULT_SAMPLE] - :ivar evaluation_result: Evaluation result for the analysis sample. Required. - :vartype evaluation_result: "EvalResult" - """ - - id: Required[str] - """The unique identifier for the analysis sample. Required.""" - features: Required[dict[str, Any]] - """Features to help with additional filtering of data in UX. Required.""" - correlationInfo: Required[dict[str, Any]] - """Info about the correlation for the analysis sample. Required.""" - type: Required[Literal[SampleType.EVALUATION_RESULT_SAMPLE]] - """Evaluation Result Sample Type. Required. A sample from the evaluation result.""" - evaluationResult: Required["EvalResult"] - """Evaluation result for the analysis sample. Required.""" - - -class EvaluationRule(TypedDict, total=False): - """Evaluation rule model. - - :ivar id: Unique identifier for the evaluation rule. Required. - :vartype id: str - :ivar display_name: Display Name for the evaluation rule. - :vartype display_name: str - :ivar description: Description for the evaluation rule. - :vartype description: str - :ivar action: Definition of the evaluation rule action. Required. - :vartype action: "EvaluationRuleAction" - :ivar filter: Filter condition of the evaluation rule. - :vartype filter: "EvaluationRuleFilter" - :ivar event_type: Event type that the evaluation rule applies to. Required. Known values are: - "responseCompleted" and "manual". - :vartype event_type: Union[str, "EvaluationRuleEventType"] - :ivar enabled: Indicates whether the evaluation rule is enabled. Default is true. Required. - :vartype enabled: bool - :ivar system_data: System metadata for the evaluation rule. Required. - :vartype system_data: dict[str, str] - """ - - id: Required[str] - """Unique identifier for the evaluation rule. Required.""" - displayName: str - """Display Name for the evaluation rule.""" - description: str - """Description for the evaluation rule.""" - action: Required["EvaluationRuleAction"] - """Definition of the evaluation rule action. Required.""" - filter: "EvaluationRuleFilter" - """Filter condition of the evaluation rule.""" - eventType: Required[Union[str, "EvaluationRuleEventType"]] - """Event type that the evaluation rule applies to. Required. Known values are: - \"responseCompleted\" and \"manual\".""" - enabled: Required[bool] - """Indicates whether the evaluation rule is enabled. Default is true. Required.""" - systemData: Required[dict[str, str]] - """System metadata for the evaluation rule. Required.""" - - -class EvaluationRuleFilter(TypedDict, total=False): - """Evaluation filter model. - - :ivar agent_name: Filter by agent name. Required. - :vartype agent_name: str - """ - - agentName: Required[str] - """Filter by agent name. Required.""" - - -class EvaluationRunClusterInsightRequest(TypedDict, total=False): - """Insights on set of Evaluation Results. - - :ivar type: The type of insights request. Required. Insights on an Evaluation run result. - :vartype type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] - :ivar eval_id: Evaluation Id for the insights. Required. - :vartype eval_id: str - :ivar run_ids: List of evaluation run IDs for the insights. Required. - :vartype run_ids: list[str] - :ivar model_configuration: Configuration of the model used in the insight generation. - :vartype model_configuration: "InsightModelConfiguration" - """ - - type: Required[Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT]] - """The type of insights request. Required. Insights on an Evaluation run result.""" - evalId: Required[str] - """Evaluation Id for the insights. Required.""" - runIds: Required[list[str]] - """List of evaluation run IDs for the insights. Required.""" - modelConfiguration: "InsightModelConfiguration" - """Configuration of the model used in the insight generation.""" - - -class EvaluationRunClusterInsightResult(TypedDict, total=False): - """Insights from the evaluation run cluster analysis. - - :ivar type: The type of insights result. Required. Insights on an Evaluation run result. - :vartype type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] - :ivar cluster_insight: Required. - :vartype cluster_insight: "ClusterInsightResult" - """ - - type: Required[Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT]] - """The type of insights result. Required. Insights on an Evaluation run result.""" - clusterInsight: Required["ClusterInsightResult"] - """Required.""" - - -class EvaluationScheduleTask(TypedDict, total=False): - """Evaluation task for the schedule. - - :ivar configuration: Configuration for the task. - :vartype configuration: dict[str, str] - :ivar type: Required. Evaluation task. - :vartype type: Literal[ScheduleTaskType.EVALUATION] - :ivar eval_id: Identifier of the evaluation group. Required. - :vartype eval_id: str - :ivar eval_run: The evaluation run payload. Required. - :vartype eval_run: dict[str, Any] - """ - - configuration: dict[str, str] - """Configuration for the task.""" - type: Required[Literal[ScheduleTaskType.EVALUATION]] - """Required. Evaluation task.""" - evalId: Required[str] - """Identifier of the evaluation group. Required.""" - evalRun: Required[dict[str, Any]] - """The evaluation run payload. Required.""" - - -class EvaluationTaxonomy(TypedDict, total=False): - """Evaluation Taxonomy 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 taxonomy_input: Input configuration for the evaluation taxonomy. Required. - :vartype taxonomy_input: "EvaluationTaxonomyInput" - :ivar taxonomy_categories: List of taxonomy categories. - :vartype taxonomy_categories: list["TaxonomyCategory"] - :ivar properties: Additional properties for the evaluation taxonomy. - :vartype properties: dict[str, str] - """ - - id: str - """Asset ID, a unique identifier for the asset.""" - name: Required[str] - """The name of the resource. Required.""" - version: Required[str] - """The version of the resource. Required.""" - description: str - """The asset description text.""" - tags: dict[str, str] - """Tag dictionary. Tags can be added, removed, and updated.""" - taxonomyInput: Required["EvaluationTaxonomyInput"] - """Input configuration for the evaluation taxonomy. Required.""" - taxonomyCategories: list["TaxonomyCategory"] - """List of taxonomy categories.""" - properties: dict[str, str] - """Additional properties for the evaluation taxonomy.""" - - -class EvaluatorCredentialRequest(TypedDict, total=False): - """Request body for getting evaluator credentials. - - :ivar blob_uri: The blob URI for the evaluator storage. Example: - ``https://account.blob.core.windows.net:443/container``. Required. - :vartype blob_uri: str - """ - - blob_uri: Required[str] - """The blob URI for the evaluator storage. Example: - ``https://account.blob.core.windows.net:443/container``. Required.""" - - -class EvaluatorGenerationArtifacts(TypedDict, total=False): - """Service-managed provenance artifacts produced by an evaluator generation job. Present only on - EvaluatorVersion resources created via the generation pipeline. The combined-JSONL Foundry - Dataset is read-only and resolves to a versioned dataset in a service-reserved namespace. - - :ivar dataset: Reference to the single Foundry Dataset (one combined JSONL file, - version-aligned to ``EvaluatorVersion.version``) holding all artifacts produced by the - generation pipeline. Each row in the JSONL carries a ``kind`` field discriminating its content - (e.g. ``spec``, ``tools``, ``context``). Required. - :vartype dataset: "DatasetReference" - :ivar kinds: The kinds of rows present in ``dataset``. Always contains ``"spec"`` (the - generated evaluation specification, a Markdown document describing what the evaluator - measures). May additionally contain ``"tools"`` (when the generation pipeline produced or - inferred OpenAI tool schemas) and/or ``"context"`` (when supplementary materials such as file - uploads or trace samples were used during generation). Required. - :vartype kinds: list[str] - """ - - dataset: Required["DatasetReference"] - """Reference to the single Foundry Dataset (one combined JSONL file, version-aligned to - ``EvaluatorVersion.version``) holding all artifacts produced by the generation pipeline. Each - row in the JSONL carries a ``kind`` field discriminating its content (e.g. ``spec``, ``tools``, - ``context``). Required.""" - kinds: Required[list[str]] - """The kinds of rows present in ``dataset``. Always contains ``\"spec\"`` (the generated - evaluation specification, a Markdown document describing what the evaluator measures). May - additionally contain ``\"tools\"`` (when the generation pipeline produced or inferred OpenAI - tool schemas) and/or ``\"context\"`` (when supplementary materials such as file uploads or - trace samples were used during generation). Required.""" - - -class EvaluatorGenerationInputs(TypedDict, total=False): - """Caller-supplied inputs for an evaluator generation job. - - :ivar sources: Source materials for generation — agent descriptions, prompts, traces, or - datasets. Each entry is an ``EvaluatorGenerationJobSource`` variant discriminated by ``type``. - Required. - :vartype sources: list["EvaluatorGenerationJobSource"] - :ivar model: The LLM model to use for rubric generation (e.g., 'gpt-4o'). Required — users must - provide their own model rather than relying on service-owned capacity. Required. - :vartype model: str - :ivar evaluator_name: The evaluator name (immutable identifier). 1-256 characters; allowed - characters are ASCII letters, digits, underscore (``_``), period (``.``), tilde (``~``), and - hyphen (``-``). The prefix ``builtin.`` is reserved for system-managed evaluators and is - rejected by the service. If an evaluator with this name already exists in the project (and is - rubric-subtype), the service creates a new version under the same name and uses the prior - version's ``dimensions`` as context for incremental improvement (foundation of the post-//build - adaptive loop). Old versions remain queryable via ``get_version(name, version)``. If the - existing evaluator is not a rubric-subtype evaluator (built-in, prompt-based, code-based), the - request is rejected with ``400 Bad Request``. Required. - :vartype evaluator_name: str - :ivar evaluator_display_name: Optional human-friendly display name for the resulting evaluator. - Surfaced as ``EvaluatorVersion.display_name`` on the persisted evaluator. When omitted, the - service uses ``evaluator_name`` as the display name. The ``evaluator_`` prefix disambiguates - this from the immutable ``evaluator_name`` identifier. - :vartype evaluator_display_name: str - :ivar evaluator_description: Optional human-friendly description for the resulting evaluator. - Surfaced as ``EvaluatorVersion.description`` on the persisted evaluator. Typically collected - from the UI alongside ``evaluator_display_name``. The ``evaluator_`` prefix disambiguates this - from any other description fields on related models. - :vartype evaluator_description: str - """ - - sources: Required[list["EvaluatorGenerationJobSource"]] - """Source materials for generation — agent descriptions, prompts, traces, or datasets. Each entry - is an ``EvaluatorGenerationJobSource`` variant discriminated by ``type``. Required.""" - model: Required[str] - """The LLM model to use for rubric generation (e.g., 'gpt-4o'). Required — users must provide - their own model rather than relying on service-owned capacity. Required.""" - evaluator_name: Required[str] - """The evaluator name (immutable identifier). 1-256 characters; allowed characters are ASCII - letters, digits, underscore (``_``), period (``.``), tilde (``~``), and hyphen (``-``). The - prefix ``builtin.`` is reserved for system-managed evaluators and is rejected by the service. - If an evaluator with this name already exists in the project (and is rubric-subtype), the - service creates a new version under the same name and uses the prior version's ``dimensions`` - as context for incremental improvement (foundation of the post-//build adaptive loop). Old - versions remain queryable via ``get_version(name, version)``. If the existing evaluator is not - a rubric-subtype evaluator (built-in, prompt-based, code-based), the request is rejected with - ``400 Bad Request``. Required.""" - evaluator_display_name: str - """Optional human-friendly display name for the resulting evaluator. Surfaced as - ``EvaluatorVersion.display_name`` on the persisted evaluator. When omitted, the service uses - ``evaluator_name`` as the display name. The ``evaluator_`` prefix disambiguates this from the - immutable ``evaluator_name`` identifier.""" - evaluator_description: str - """Optional human-friendly description for the resulting evaluator. Surfaced as - ``EvaluatorVersion.description`` on the persisted evaluator. Typically collected from the UI - alongside ``evaluator_display_name``. The ``evaluator_`` prefix disambiguates this from any - other description fields on related models.""" - - -class EvaluatorGenerationJob(TypedDict, total=False): - """Evaluator Generation Job resource — a long-running job that generates rubric-based evaluator - definitions from source materials. On success, the result is the persisted EvaluatorVersion. - - :ivar id: Server-assigned unique identifier. Required. - :vartype id: str - :ivar inputs: Caller-supplied inputs. - :vartype inputs: "EvaluatorGenerationInputs" - :ivar result: Result produced on success. - :vartype result: "EvaluatorVersion" - :ivar status: Current lifecycle status. Required. Known values are: "queued", "in_progress", - "succeeded", "failed", and "cancelled". - :vartype status: Union[str, "JobStatus"] - :ivar error: Error details — populated only on failure. - :vartype error: "ApiError" - :ivar created_at: The timestamp when the job was created, represented in Unix time (seconds - since January 1, 1970). Required. - :vartype created_at: int - :ivar finished_at: The timestamp when the job finished, represented in Unix time (seconds since - January 1, 1970). - :vartype finished_at: int - :ivar usage: Token consumption summary. Populated when the job reaches a terminal state. - :vartype usage: "EvaluatorGenerationTokenUsage" - :ivar input_quality_warnings: Non-fatal input-quality advisories produced by the generation - pipeline. Read-only; service-generated; populated only on terminal jobs when advisories fired. - Omitted when generation was clean. Cleared when a subsequent ``PATCH`` to the paired - ``EvaluatorVersion.definition`` invalidates the advisories. - :vartype input_quality_warnings: list["RubricGenerationInputQualityWarning"] - """ - - id: Required[str] - """Server-assigned unique identifier. Required.""" - inputs: "EvaluatorGenerationInputs" - """Caller-supplied inputs.""" - result: "EvaluatorVersion" - """Result produced on success.""" - status: Required[Union[str, "JobStatus"]] - """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", - \"succeeded\", \"failed\", and \"cancelled\".""" - error: "ApiError" - """Error details — populated only on failure.""" - created_at: Required[int] - """The timestamp when the job was created, represented in Unix time (seconds since January 1, - 1970). Required.""" - finished_at: int - """The timestamp when the job finished, represented in Unix time (seconds since January 1, 1970).""" - usage: "EvaluatorGenerationTokenUsage" - """Token consumption summary. Populated when the job reaches a terminal state.""" - input_quality_warnings: list["RubricGenerationInputQualityWarning"] - """Non-fatal input-quality advisories produced by the generation pipeline. Read-only; - service-generated; populated only on terminal jobs when advisories fired. Omitted when - generation was clean. Cleared when a subsequent ``PATCH`` to the paired - ``EvaluatorVersion.definition`` invalidates the advisories.""" - - -class EvaluatorGenerationTokenUsage(TypedDict, total=False): - """Token consumption summary for an evaluator generation job. Populated when the job reaches a - terminal state. - - :ivar input_tokens: Number of input (prompt) tokens consumed. Required. - :vartype input_tokens: int - :ivar output_tokens: Number of output (completion) tokens generated. Required. - :vartype output_tokens: int - :ivar total_tokens: Total tokens consumed (input + output). Required. - :vartype total_tokens: int - """ - - input_tokens: Required[int] - """Number of input (prompt) tokens consumed. Required.""" - output_tokens: Required[int] - """Number of output (completion) tokens generated. Required.""" - total_tokens: Required[int] - """Total tokens consumed (input + output). Required.""" - - -class EvaluatorMetric(TypedDict, total=False): - """Evaluator Metric. - - :ivar type: Type of the metric. Known values are: "ordinal", "continuous", and "boolean". - :vartype type: Union[str, "EvaluatorMetricType"] - :ivar desirable_direction: It indicates whether a higher value is better or a lower value is - better for this metric. Known values are: "increase", "decrease", and "neutral". - :vartype desirable_direction: Union[str, "EvaluatorMetricDirection"] - :ivar min_value: Minimum value for the metric. - :vartype min_value: float - :ivar max_value: Maximum value for the metric. If not specified, it is assumed to be unbounded. - :vartype max_value: float - :ivar threshold: Default pass/fail threshold for this metric. - :vartype threshold: float - :ivar is_primary: Indicates if this metric is primary when there are multiple metrics. - :vartype is_primary: bool - """ - - type: Union[str, "EvaluatorMetricType"] - """Type of the metric. Known values are: \"ordinal\", \"continuous\", and \"boolean\".""" - desirable_direction: Union[str, "EvaluatorMetricDirection"] - """It indicates whether a higher value is better or a lower value is better for this metric. Known - values are: \"increase\", \"decrease\", and \"neutral\".""" - min_value: float - """Minimum value for the metric.""" - max_value: float - """Maximum value for the metric. If not specified, it is assumed to be unbounded.""" - threshold: float - """Default pass/fail threshold for this metric.""" - is_primary: bool - """Indicates if this metric is primary when there are multiple metrics.""" - - -class EvaluatorVersion(TypedDict, total=False): - """Evaluator Definition. - - :ivar display_name: Display Name for evaluator. It helps to find the evaluator easily in AI - Foundry. It does not need to be unique. - :vartype display_name: str - :ivar metadata: Metadata about the evaluator. - :vartype metadata: dict[str, str] - :ivar evaluator_type: The type of the evaluator. Required. Known values are: "builtin" and - "custom". - :vartype evaluator_type: Union[str, "EvaluatorType"] - :ivar categories: The categories of the evaluator. Required. - :vartype categories: list[Union[str, "EvaluatorCategory"]] - :ivar supported_evaluation_levels: Evaluation levels this evaluator supports (e.g., ``turn``, - ``conversation``). When omitted on create, the service defaults to ``["turn"]``. On update, - omitting this field leaves it unchanged; an empty list is rejected. Custom code-based - evaluators support only ``turn``; custom prompt-based evaluators support exactly one level - (``turn`` or ``conversation``). - :vartype supported_evaluation_levels: list[Union[str, "EvaluationLevel"]] - :ivar definition: Definition of the evaluator. Required. - :vartype definition: "EvaluatorDefinition" - :ivar generation_artifacts: Provenance artifacts from the generation pipeline. Read-only; - present only on evaluator versions created via an EvaluatorGenerationJob. Each artifact - resolves to a versioned Foundry Dataset. - :vartype generation_artifacts: "EvaluatorGenerationArtifacts" - :ivar generation_job_id: Read-only provenance link back to the EvaluatorGenerationJob that - produced this version. Present only on evaluator versions created via the generation pipeline; - absent for manually-created versions and unaffected by subsequent ``PATCH`` calls. - :vartype generation_job_id: str - :ivar warnings: Categories of warnings surfaced on this generated evaluator version. Present - only on versions created via an EvaluatorGenerationJob when the paired job produced non-empty - warnings. Absent (treat as no warnings) when the version is not from generation, when the - paired job was clean, or when a subsequent ``PATCH`` to ``definition`` cleared the paired job's - advisories. Follow ``generation_job_id`` to fetch the detailed warning payloads. - :vartype warnings: list[Union[str, "GenerationWarningType"]] - :ivar created_by: Creator of the evaluator. Required. - :vartype created_by: str - :ivar created_at: Creation date/time of the evaluator. Required. - :vartype created_at: str - :ivar modified_at: Last modified date/time of the evaluator. Required. - :vartype modified_at: str - :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] - """ - - display_name: str - """Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not - need to be unique.""" - metadata: dict[str, str] - """Metadata about the evaluator.""" - evaluator_type: Required[Union[str, "EvaluatorType"]] - """The type of the evaluator. Required. Known values are: \"builtin\" and \"custom\".""" - categories: Required[list[Union[str, "EvaluatorCategory"]]] - """The categories of the evaluator. Required.""" - supported_evaluation_levels: list[Union[str, "EvaluationLevel"]] - """Evaluation levels this evaluator supports (e.g., ``turn``, ``conversation``). When omitted on - create, the service defaults to ``[\"turn\"]``. On update, omitting this field leaves it - unchanged; an empty list is rejected. Custom code-based evaluators support only ``turn``; - custom prompt-based evaluators support exactly one level (``turn`` or ``conversation``).""" - definition: Required["EvaluatorDefinition"] - """Definition of the evaluator. Required.""" - generation_artifacts: "EvaluatorGenerationArtifacts" - """Provenance artifacts from the generation pipeline. Read-only; present only on evaluator - versions created via an EvaluatorGenerationJob. Each artifact resolves to a versioned Foundry - Dataset.""" - generation_job_id: str - """Read-only provenance link back to the EvaluatorGenerationJob that produced this version. - Present only on evaluator versions created via the generation pipeline; absent for - manually-created versions and unaffected by subsequent ``PATCH`` calls.""" - warnings: list[Union[str, "GenerationWarningType"]] - """Categories of warnings surfaced on this generated evaluator version. Present only on versions - created via an EvaluatorGenerationJob when the paired job produced non-empty warnings. Absent - (treat as no warnings) when the version is not from generation, when the paired job was clean, - or when a subsequent ``PATCH`` to ``definition`` cleared the paired job's advisories. Follow - ``generation_job_id`` to fetch the detailed warning payloads.""" - created_by: Required[str] - """Creator of the evaluator. Required.""" - created_at: Required[str] - """Creation date/time of the evaluator. Required.""" - modified_at: Required[str] - """Last modified date/time of the evaluator. Required.""" - id: str - """Asset ID, a unique identifier for the asset.""" - name: Required[str] - """The name of the resource. Required.""" - version: Required[str] - """The version of the resource. Required.""" - description: str - """The asset description text.""" - tags: dict[str, str] - """Tag dictionary. Tags can be added, removed, and updated.""" - - -class ExternalAgentDefinition(TypedDict, total=False): - """The external agent definition. Represents a third-party agent hosted outside Foundry (for - example, on GCP or AWS). Registration is metadata-only: Foundry records the agent definition to - light up observability experiences (traces, evaluations) over customer-emitted OpenTelemetry - data. - - :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. - :vartype rai_config: "RaiConfig" - :ivar kind: Required. EXTERNAL. - :vartype kind: Literal[AgentKind.EXTERNAL] - :ivar otel_agent_id: The OpenTelemetry agent identifier used to attribute customer-emitted - spans to this Foundry agent. Spans must include the attribute ``gen_ai.agent.id = - `` to appear under this registration. Defaults to the top-level agent name when - omitted. Provide an explicit value only for migration scenarios where the running external - agent already emits a stable id that differs from the Foundry agent name. The resolved value is - always echoed on read. - :vartype otel_agent_id: str - """ - - rai_config: "RaiConfig" - """Configuration for Responsible AI (RAI) content filtering and safety features.""" - kind: Required[Literal[AgentKind.EXTERNAL]] - """Required. EXTERNAL.""" - otel_agent_id: str - """The OpenTelemetry agent identifier used to attribute customer-emitted spans to this Foundry - agent. Spans must include the attribute ``gen_ai.agent.id = `` to appear under - this registration. Defaults to the top-level agent name when omitted. Provide an explicit value - only for migration scenarios where the running external agent already emits a stable id that - differs from the Foundry agent name. The resolved value is always echoed on read.""" - - -class FabricDataAgentToolParameters(TypedDict, total=False): - """The fabric data agent 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["ToolProjectConnection"] - """ - - project_connections: list["ToolProjectConnection"] - """The project connections attached to this tool. There can be a maximum of 1 connection resource - attached to the tool.""" - - -class FabricIQPreviewTool(TypedDict, total=False): - """A FabricIQ server-side tool. - - :ivar type: The object type, which is always 'fabric_iq_preview'. Required. FABRIC_IQ_PREVIEW. - :vartype type: Literal[ToolType.FABRIC_IQ_PREVIEW] - :ivar project_connection_id: The ID of the FabricIQ project connection. Required. - :vartype project_connection_id: str - :ivar server_label: (Optional) The label of the FabricIQ MCP server to connect to. - :vartype server_label: str - :ivar server_url: (Optional) The URL of the FabricIQ MCP server. If not provided, the URL from - the project connection will be used. - :vartype server_url: str - :ivar require_approval: (Optional) Whether the agent requires approval before executing - actions. Default is always. Is either a MCPToolRequireApproval type or a str type. - :vartype require_approval: Union["MCPToolRequireApproval", str] - """ - - type: Required[Literal[ToolType.FABRIC_IQ_PREVIEW]] - """The object type, which is always 'fabric_iq_preview'. Required. FABRIC_IQ_PREVIEW.""" - project_connection_id: Required[str] - """The ID of the FabricIQ project connection. Required.""" - server_label: str - """(Optional) The label of the FabricIQ MCP server to connect to.""" - server_url: str - """(Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project - connection will be used.""" - require_approval: Optional[Union["MCPToolRequireApproval", str]] - """(Optional) Whether the agent requires approval before executing actions. Default is always. Is - either a MCPToolRequireApproval type or a str type.""" - - -class FabricIQPreviewToolboxTool(TypedDict, total=False): - """A FabricIQ 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, "ToolConfig"] - :ivar type: Required. FABRIC_IQ_PREVIEW. - :vartype type: Literal[ToolboxToolType.FABRIC_IQ_PREVIEW] - :ivar project_connection_id: The ID of the FabricIQ project connection. Required. - :vartype project_connection_id: str - :ivar server_label: (Optional) The label of the FabricIQ MCP server to connect to. - :vartype server_label: str - :ivar server_url: (Optional) The URL of the FabricIQ MCP server. If not provided, the URL from - the project connection will be used. - :vartype server_url: str - :ivar require_approval: (Optional) Whether the agent requires approval before executing - actions. Default is always. Is either a MCPToolRequireApproval type or a str type. - :vartype require_approval: Union["MCPToolRequireApproval", str] - """ - - name: str - """Optional user-defined name for this tool or configuration.""" - description: str - """Optional user-defined description for this tool or configuration.""" - tool_configs: dict[str, "ToolConfig"] - """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.""" - type: Required[Literal[ToolboxToolType.FABRIC_IQ_PREVIEW]] - """Required. FABRIC_IQ_PREVIEW.""" - project_connection_id: Required[str] - """The ID of the FabricIQ project connection. Required.""" - server_label: str - """(Optional) The label of the FabricIQ MCP server to connect to.""" - server_url: str - """(Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project - connection will be used.""" - require_approval: Optional[Union["MCPToolRequireApproval", str]] - """(Optional) Whether the agent requires approval before executing actions. Default is always. Is - either a MCPToolRequireApproval type or a str type.""" - - -class FieldMapping(TypedDict, total=False): - """Field mapping configuration class. - - :ivar content_fields: List of fields with text content. Required. - :vartype content_fields: list[str] - :ivar filepath_field: Path of file to be used as a source of text content. - :vartype filepath_field: str - :ivar title_field: Field containing the title of the document. - :vartype title_field: str - :ivar url_field: Field containing the url of the document. - :vartype url_field: str - :ivar vector_fields: List of fields with vector content. - :vartype vector_fields: list[str] - :ivar metadata_fields: List of fields with metadata content. - :vartype metadata_fields: list[str] - """ - - contentFields: Required[list[str]] - """List of fields with text content. Required.""" - filepathField: str - """Path of file to be used as a source of text content.""" - titleField: str - """Field containing the title of the document.""" - urlField: str - """Field containing the url of the document.""" - vectorFields: list[str] - """List of fields with vector content.""" - metadataFields: list[str] - """List of fields with metadata content.""" - - -class FileDataGenerationJobOutput(TypedDict, total=False): - """Azure OpenAI file output for a data generation job. - - :ivar type: Azure OpenAI file output. Required. The generated data is an Azure OpenAI File. - :vartype type: Literal[DataGenerationJobOutputType.FILE] - :ivar id: The id of the output Azure OpenAI file. Required. - :vartype id: str - :ivar filename: The filename of the output Azure OpenAI file. Required. - :vartype filename: str - """ - - type: Required[Literal[DataGenerationJobOutputType.FILE]] - """Azure OpenAI file output. Required. The generated data is an Azure OpenAI File.""" - id: Required[str] - """The id of the output Azure OpenAI file. Required.""" - filename: Required[str] - """The filename of the output Azure OpenAI file. Required.""" - - -class FileDataGenerationJobSource(TypedDict, total=False): - """File source for data generation jobs — Azure OpenAI file input. - - :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 job, which is File. Required. File source — Azure OpenAI - file. - :vartype type: Literal[DataGenerationJobSourceType.FILE] - :ivar id: Input Azure Open AI file id used for data generation. Required. - :vartype id: str - """ - - description: str - """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: Required[Literal[DataGenerationJobSourceType.FILE]] - """The source type for this job, which is File. Required. File source — Azure OpenAI file.""" - id: Required[str] - """Input Azure Open AI file id used for data generation. Required.""" - - -class FileDatasetVersion(TypedDict, total=False): - """FileDatasetVersion Definition. - - :ivar data_uri: URI of the data (`example `_). - Required. - :vartype data_uri: str - :ivar is_reference: Indicates if the dataset holds a reference to the storage, or the dataset - manages storage itself. If true, the underlying data will not be deleted when the dataset - version is deleted. - :vartype is_reference: bool - :ivar connection_name: The Azure Storage Account connection name. Required if - startPendingUploadVersion was not called before creating the Dataset. - :vartype connection_name: str - :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: Dataset type. Required. URI file. - :vartype type: Literal[DatasetType.URI_FILE] - """ - - dataUri: Required[str] - """URI of the data (`example `_). Required.""" - isReference: bool - """Indicates if the dataset holds a reference to the storage, or the dataset manages storage - itself. If true, the underlying data will not be deleted when the dataset version is deleted.""" - connectionName: str - """The Azure Storage Account connection name. Required if startPendingUploadVersion was not called - before creating the Dataset.""" - id: str - """Asset ID, a unique identifier for the asset.""" - name: Required[str] - """The name of the resource. Required.""" - version: Required[str] - """The version of the resource. Required.""" - description: str - """The asset description text.""" - tags: dict[str, str] - """Tag dictionary. Tags can be added, removed, and updated.""" - type: Required[Literal[DatasetType.URI_FILE]] - """Dataset type. Required. URI file.""" - - -class FileSearchTool(TypedDict, total=False): - """File search. - - :ivar type: The type of the file search tool. Always ``file_search``. Required. FILE_SEARCH. - :vartype type: Literal[ToolType.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: "RankingOptions" - :ivar filters: Is either a ComparisonFilter type or a CompoundFilter type. - :vartype filters: "_unions.Filters" - :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, "ToolConfig"] - """ - - type: Required[Literal[ToolType.FILE_SEARCH]] - """The type of the file search tool. Always ``file_search``. Required. FILE_SEARCH.""" - vector_store_ids: Required[list[str]] - """The IDs of the vector stores to search. Required.""" - max_num_results: int - """The maximum number of results to return. This number should be between 1 and 50 inclusive.""" - ranking_options: "RankingOptions" - """Ranking options for search.""" - filters: Optional["_unions.Filters"] - """Is either a ComparisonFilter type or a CompoundFilter type.""" - name: str - """Deprecated. This property is deprecated and will be removed in a future version.""" - description: str - """Deprecated. This property is deprecated and will be removed in a future version.""" - tool_configs: dict[str, "ToolConfig"] - """Deprecated. This property is deprecated and will be removed in a future version.""" - - -class FileSearchToolboxTool(TypedDict, total=False): - """A file 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, "ToolConfig"] - :ivar type: Required. FILE_SEARCH. - :vartype type: Literal[ToolboxToolType.FILE_SEARCH] - :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: "RankingOptions" - :ivar filters: Is either a ComparisonFilter type or a CompoundFilter type. - :vartype filters: "_unions.Filters" - :ivar vector_store_ids: The IDs of the vector stores to search. - :vartype vector_store_ids: list[str] - """ - - name: str - """Optional user-defined name for this tool or configuration.""" - description: str - """Optional user-defined description for this tool or configuration.""" - tool_configs: dict[str, "ToolConfig"] - """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.""" - type: Required[Literal[ToolboxToolType.FILE_SEARCH]] - """Required. FILE_SEARCH.""" - max_num_results: int - """The maximum number of results to return. This number should be between 1 and 50 inclusive.""" - ranking_options: "RankingOptions" - """Ranking options for search.""" - filters: Optional["_unions.Filters"] - """Is either a ComparisonFilter type or a CompoundFilter type.""" - vector_store_ids: list[str] - """The IDs of the vector stores to search.""" - - -class FixedRatioVersionSelectionRule(TypedDict, total=False): - """FixedRatioVersionSelectionRule. - - :ivar agent_version: The agent version to route traffic to. Required. - :vartype agent_version: str - :ivar type: Required. FIXED_RATIO. - :vartype type: Literal[VersionSelectorType.FIXED_RATIO] - :ivar traffic_percentage: The percentage of traffic to route to the version. Must be between 0 - and 100. Required. - :vartype traffic_percentage: int - """ - - agent_version: Required[str] - """The agent version to route traffic to. Required.""" - type: Required[Literal[VersionSelectorType.FIXED_RATIO]] - """Required. FIXED_RATIO.""" - traffic_percentage: Required[int] - """The percentage of traffic to route to the version. Must be between 0 and 100. Required.""" - - -class FolderDatasetVersion(TypedDict, total=False): - """FileDatasetVersion Definition. - - :ivar data_uri: URI of the data (`example `_). - Required. - :vartype data_uri: str - :ivar is_reference: Indicates if the dataset holds a reference to the storage, or the dataset - manages storage itself. If true, the underlying data will not be deleted when the dataset - version is deleted. - :vartype is_reference: bool - :ivar connection_name: The Azure Storage Account connection name. Required if - startPendingUploadVersion was not called before creating the Dataset. - :vartype connection_name: str - :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: Dataset type. Required. URI folder. - :vartype type: Literal[DatasetType.URI_FOLDER] - """ - - dataUri: Required[str] - """URI of the data (`example `_). Required.""" - isReference: bool - """Indicates if the dataset holds a reference to the storage, or the dataset manages storage - itself. If true, the underlying data will not be deleted when the dataset version is deleted.""" - connectionName: str - """The Azure Storage Account connection name. Required if startPendingUploadVersion was not called - before creating the Dataset.""" - id: str - """Asset ID, a unique identifier for the asset.""" - name: Required[str] - """The name of the resource. Required.""" - version: Required[str] - """The version of the resource. Required.""" - description: str - """The asset description text.""" - tags: dict[str, str] - """Tag dictionary. Tags can be added, removed, and updated.""" - type: Required[Literal[DatasetType.URI_FOLDER]] - """Dataset type. Required. URI folder.""" - - -class FoundryModelWarning(TypedDict, total=False): - """A warning associated with a model. - - :ivar code: The warning code. Known values are: "RuntimeDependentArtifact" and - "UnclassifiedArtifact". - :vartype code: Union[str, "FoundryModelWarningCode"] - :ivar message: The warning message. - :vartype message: str - """ - - code: Union[str, "FoundryModelWarningCode"] - """The warning code. Known values are: \"RuntimeDependentArtifact\" and \"UnclassifiedArtifact\".""" - message: str - """The warning message.""" - - -class FunctionShellToolParam(TypedDict, total=False): - """Shell tool. - - :ivar type: The type of the shell tool. Always ``shell``. Required. SHELL. - :vartype type: Literal[ToolType.SHELL] - :ivar environment: - :vartype environment: "FunctionShellToolParamEnvironment" - :ivar allowed_callers: - :vartype allowed_callers: list[Union[str, "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, "ToolConfig"] - """ - - type: Required[Literal[ToolType.SHELL]] - """The type of the shell tool. Always ``shell``. Required. SHELL.""" - environment: Optional["FunctionShellToolParamEnvironment"] - allowed_callers: Optional[list[Union[str, "CallableToolAllowedCaller"]]] - name: str - """Deprecated. This property is deprecated and will be removed in a future version.""" - description: str - """Deprecated. This property is deprecated and will be removed in a future version.""" - tool_configs: dict[str, "ToolConfig"] - """Deprecated. This property is deprecated and will be removed in a future version.""" - - -class FunctionShellToolParamEnvironmentContainerReferenceParam(TypedDict, total=False): # pylint: disable=name-too-long - """FunctionShellToolParamEnvironmentContainerReferenceParam. - - :ivar type: References a container created with the /v1/containers endpoint. Required. - CONTAINER_REFERENCE. - :vartype type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE] - :ivar container_id: The ID of the referenced container. Required. - :vartype container_id: str - """ - - type: Required[Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE]] - """References a container created with the /v1/containers endpoint. Required. CONTAINER_REFERENCE.""" - container_id: Required[str] - """The ID of the referenced container. Required.""" - - -class FunctionShellToolParamEnvironmentLocalEnvironmentParam(TypedDict, total=False): # pylint: disable=name-too-long - """FunctionShellToolParamEnvironmentLocalEnvironmentParam. - - :ivar type: Use a local computer environment. Required. LOCAL. - :vartype type: Literal[FunctionShellToolParamEnvironmentType.LOCAL] - :ivar skills: An optional list of skills. - :vartype skills: list["LocalSkillParam"] - """ - - type: Required[Literal[FunctionShellToolParamEnvironmentType.LOCAL]] - """Use a local computer environment. Required. LOCAL.""" - skills: list["LocalSkillParam"] - """An optional list of skills.""" - - -class FunctionTool(TypedDict, total=False): - """Function. - - :ivar type: The type of the function tool. Always ``function``. Required. FUNCTION. - :vartype type: Literal[ToolType.FUNCTION] - :ivar name: The name of the function to call. Required. - :vartype name: str - :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[Union[str, "CallableToolAllowedCaller"]] - """ - - type: Required[Literal[ToolType.FUNCTION]] - """The type of the function tool. Always ``function``. Required. FUNCTION.""" - name: Required[str] - """The name of the function to call. Required.""" - description: Optional[str] - parameters: Required[Optional[dict[str, Any]]] - """Required.""" - output_schema: Optional[dict[str, Any]] - strict: Required[Optional[bool]] - """Required.""" - defer_loading: bool - """Whether this function is deferred and loaded via tool search.""" - allowed_callers: Optional[list[Union[str, "CallableToolAllowedCaller"]]] - - -class FunctionToolParam(TypedDict, total=False): - """FunctionToolParam. - - :ivar name: Required. - :vartype name: str - :ivar description: - :vartype description: str - :ivar parameters: - :vartype parameters: "EmptyModelParam" - :ivar strict: - :vartype strict: bool - :ivar type: Required. Default value is "function". - :vartype type: Literal["function"] - :ivar output_schema: - :vartype output_schema: dict[str, Any] - :ivar defer_loading: Whether this function should be deferred and discovered via tool search. - :vartype defer_loading: bool - :ivar allowed_callers: - :vartype allowed_callers: list[Union[str, "CallableToolAllowedCaller"]] - """ - - name: Required[str] - """Required.""" - description: Optional[str] - parameters: Optional["EmptyModelParam"] - strict: Optional[bool] - type: Required[Literal["function"]] - """Required. Default value is \"function\".""" - output_schema: Optional[dict[str, Any]] - defer_loading: bool - """Whether this function should be deferred and discovered via tool search.""" - allowed_callers: Optional[list[Union[str, "CallableToolAllowedCaller"]]] - - -class GenerateVoiceAgentRequest(TypedDict, total=False): - """The inputs for generating a voice agent. Only ``kind`` and ``name`` are always required. The - authoring service expands these inputs into a full, editable ``VoiceAgentDefinition``, which is - then created through ``POST /agents``. The generated ``instructions`` and audio/voice settings - are stored as separate fields on the resulting agent definition, so the caller can edit or - override any of them afterward via standard agent versioning. - - :ivar kind: The agent kind. Always ``voice``. Required. VOICE. - :vartype kind: Literal[AgentKind.VOICE] - :ivar name: The unique name for the agent to create. Must be a non-empty DNS-like agent name. - Required. - :vartype name: str - :ivar model_type: Optional inference mode. When omitted, the authoring service uses - ``managed``. When supplied, use ``managed`` or ``self_deployed``. Known values are: "managed" - and "self_deployed". - :vartype model_type: Union[str, "VoiceModelType"] - :ivar model: Optional model identifier. Required when ``model_type`` is ``self_deployed``; - optional when ``model_type`` is ``managed`` or omitted. The service never invents a customer - deployment name. - :vartype model: str - :ivar use_case: An optional authoring use case. An empty string is accepted. - :vartype use_case: str - :ivar goal: An optional natural-language description of what the agent should do. When - supplied, it seeds the generated instructions. - :vartype goal: str - :ivar description: An optional agent description. The authoring service resolves its fallback - when omitted. - :vartype description: str - :ivar tools: Optional tools carried through verbatim onto the generated agent (see - ``VoiceAgentTool``). - :vartype tools: list["VoiceAgentTool"] - :ivar draft: (Preview) When ``true``, the generated voice agent is created as a draft — an - editable, unpublished version the caller can review and refine before publishing it via the - standard create/version path. The service defaults to ``false`` if a value is not specified by - the caller, in which case the agent is created and published normally. - :vartype draft: bool - """ - - kind: Required[Literal[AgentKind.VOICE]] - """The agent kind. Always ``voice``. Required. VOICE.""" - name: Required[str] - """The unique name for the agent to create. Must be a non-empty DNS-like agent name. Required.""" - model_type: Union[str, "VoiceModelType"] - """Optional inference mode. When omitted, the authoring service uses ``managed``. When supplied, - use ``managed`` or ``self_deployed``. Known values are: \"managed\" and \"self_deployed\".""" - model: str - """Optional model identifier. Required when ``model_type`` is ``self_deployed``; optional when - ``model_type`` is ``managed`` or omitted. The service never invents a customer deployment name.""" - use_case: str - """An optional authoring use case. An empty string is accepted.""" - goal: str - """An optional natural-language description of what the agent should do. When supplied, it seeds - the generated instructions.""" - description: str - """An optional agent description. The authoring service resolves its fallback when omitted.""" - tools: list["VoiceAgentTool"] - """Optional tools carried through verbatim onto the generated agent (see ``VoiceAgentTool``).""" - draft: bool - """(Preview) When ``true``, the generated voice agent is created as a draft — an editable, - unpublished version the caller can review and refine before publishing it via the standard - create/version path. The service defaults to ``false`` if a value is not specified by the - caller, in which case the agent is created and published normally.""" - - -class GitHubIssueRoutineTrigger(TypedDict, total=False): - """A GitHub issue routine trigger. - - :ivar type: The trigger type. Required. A GitHub issue trigger. - :vartype type: Literal[RoutineTriggerType.GITHUB_ISSUE] - :ivar connection_id: The workspace connection identifier that resolves the GitHub configuration - for the trigger. Required. - :vartype connection_id: str - :ivar owner: The GitHub owner or organization that scopes which issues can fire the trigger. - Required. - :vartype owner: str - :ivar repository: The GitHub repository filter that scopes which issues can fire the trigger. - Required. - :vartype repository: str - :ivar issue_event: The GitHub issue event that fires the routine. Required. Known values are: - "opened" and "closed". - :vartype issue_event: Union[str, "GitHubIssueEvent"] - """ - - type: Required[Literal[RoutineTriggerType.GITHUB_ISSUE]] - """The trigger type. Required. A GitHub issue trigger.""" - connection_id: Required[str] - """The workspace connection identifier that resolves the GitHub configuration for the trigger. - Required.""" - owner: Required[str] - """The GitHub owner or organization that scopes which issues can fire the trigger. Required.""" - repository: Required[str] - """The GitHub repository filter that scopes which issues can fire the trigger. Required.""" - issue_event: Required[Union[str, "GitHubIssueEvent"]] - """The GitHub issue event that fires the routine. Required. Known values are: \"opened\" and - \"closed\".""" - - -class HeaderTelemetryEndpointAuth(TypedDict, total=False): - """Header-based secret authentication for a telemetry endpoint. The resolved secret value is - injected as an HTTP header. - - :ivar type: The authentication type, always 'header' for header-based secret authentication. - Required. Header-based secret authentication. - :vartype type: Literal[TelemetryEndpointAuthType.HEADER] - :ivar header_name: The name of the HTTP header to inject the secret value into. Required. - :vartype header_name: str - :ivar secret_id: The identifier of the secret store or connection. Required. - :vartype secret_id: str - :ivar secret_key: The key within the secret to retrieve the authentication value. Required. - :vartype secret_key: str - """ - - type: Required[Literal[TelemetryEndpointAuthType.HEADER]] - """The authentication type, always 'header' for header-based secret authentication. Required. - Header-based secret authentication.""" - header_name: Required[str] - """The name of the HTTP header to inject the secret value into. Required.""" - secret_id: Required[str] - """The identifier of the secret store or connection. Required.""" - secret_key: Required[str] - """The key within the secret to retrieve the authentication value. Required.""" - - -class HostedAgentDefinition(TypedDict, total=False): - """The hosted agent definition. - - :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. - :vartype rai_config: "RaiConfig" - :ivar kind: Required. HOSTED. - :vartype kind: Literal[AgentKind.HOSTED] - :ivar cpu: The CPU configuration for the hosted agent. Required. - :vartype cpu: str - :ivar memory: The memory configuration for the hosted agent. Required. - :vartype memory: str - :ivar environment_variables: Environment variables to set in the hosted agent container. - :vartype environment_variables: dict[str, str] - :ivar container_configuration: Container-based deployment configuration. Provide this for - image-based deployments. Mutually exclusive with code_configuration — the service validates - that exactly one is set. - :vartype container_configuration: "ContainerConfiguration" - :ivar protocol_versions: The protocols that the agent supports for ingress communication. - :vartype protocol_versions: list["ProtocolVersionRecord"] - :ivar code_configuration: Code-based deployment configuration. Provide this for code-based - deployments. Mutually exclusive with container_configuration — the service validates that - exactly one is set. - :vartype code_configuration: "CodeConfiguration" - :ivar telemetry_config: Optional customer-supplied telemetry configuration for exporting - container logs, traces, and metrics. - :vartype telemetry_config: "TelemetryConfig" - :ivar session_configuration: Optional session defaults (for example, the idle timeout) applied - to sessions created for this agent version. - :vartype session_configuration: "SessionConfiguration" - """ - - rai_config: "RaiConfig" - """Configuration for Responsible AI (RAI) content filtering and safety features.""" - kind: Required[Literal[AgentKind.HOSTED]] - """Required. HOSTED.""" - cpu: Required[str] - """The CPU configuration for the hosted agent. Required.""" - memory: Required[str] - """The memory configuration for the hosted agent. Required.""" - environment_variables: dict[str, str] - """Environment variables to set in the hosted agent container.""" - container_configuration: "ContainerConfiguration" - """Container-based deployment configuration. Provide this for image-based deployments. Mutually - exclusive with code_configuration — the service validates that exactly one is set.""" - protocol_versions: list["ProtocolVersionRecord"] - """The protocols that the agent supports for ingress communication.""" - code_configuration: "CodeConfiguration" - """Code-based deployment configuration. Provide this for code-based deployments. Mutually - exclusive with container_configuration — the service validates that exactly one is set.""" - telemetry_config: "TelemetryConfig" - """Optional customer-supplied telemetry configuration for exporting container logs, traces, and - metrics.""" - session_configuration: "SessionConfiguration" - """Optional session defaults (for example, the idle timeout) applied to sessions created for this - agent version.""" - - -class HourlyRecurrenceSchedule(TypedDict, total=False): - """Hourly recurrence schedule. - - :ivar type: Required. Hourly recurrence pattern. - :vartype type: Literal[RecurrenceType.HOURLY] - """ - - type: Required[Literal[RecurrenceType.HOURLY]] - """Required. Hourly recurrence pattern.""" - - -class HumanEvaluationPreviewRuleAction(TypedDict, total=False): - """Evaluation rule action for human evaluation. - - :ivar type: Required. Human evaluation preview. - :vartype type: Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW] - :ivar template_id: Human evaluation template Id. Required. - :vartype template_id: str - """ - - type: Required[Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW]] - """Required. Human evaluation preview.""" - templateId: Required[str] - """Human evaluation template Id. Required.""" - - -class HybridSearchOptions(TypedDict, total=False): - """HybridSearchOptions. - - :ivar embedding_weight: The weight of the embedding in the reciprocal ranking fusion. Required. - :vartype embedding_weight: float - :ivar text_weight: The weight of the text in the reciprocal ranking fusion. Required. - :vartype text_weight: float - """ - - embedding_weight: Required[float] - """The weight of the embedding in the reciprocal ranking fusion. Required.""" - text_weight: Required[float] - """The weight of the text in the reciprocal ranking fusion. Required.""" - - -class ImageGenTool(TypedDict, total=False): - """Image generation tool. - - :ivar type: The type of the image generation tool. Always ``image_generation``. Required. - IMAGE_GENERATION. - :vartype type: Literal[ToolType.IMAGE_GENERATION] - :ivar model: Is one of the following types: Literal["gpt-image-1"], - Literal["gpt-image-1-mini"], Literal["gpt-image-1.5"], str - :vartype model: Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], - Literal["gpt-image-1.5"], 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: Literal["low", "medium", "high", "auto"] - :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: Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], - Literal["auto"], 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: Literal["png", "webp", "jpeg"] - :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: Literal["auto", "low"] - :ivar background: Background type for the generated image. One of ``transparent``, ``opaque``, - or ``auto``. Default: ``auto``. Is one of the following types: Literal["transparent"], - Literal["opaque"], Literal["auto"] - :vartype background: Literal["transparent", "opaque", "auto"] - :ivar input_fidelity: Known values are: "high" and "low". - :vartype input_fidelity: Union[str, "InputFidelity"] - :ivar input_image_mask: Optional mask for inpainting. Contains ``image_url`` (string, optional) - and ``file_id`` (string, optional). - :vartype input_image_mask: "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: Union[str, "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, "ToolConfig"] - """ - - type: Required[Literal[ToolType.IMAGE_GENERATION]] - """The type of the image generation tool. Always ``image_generation``. Required. IMAGE_GENERATION.""" - model: Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], Literal["gpt-image-1.5"], str] - """Is one of the following types: Literal[\"gpt-image-1\"], Literal[\"gpt-image-1-mini\"], - Literal[\"gpt-image-1.5\"], str""" - quality: Literal["low", "medium", "high", "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: Union[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: Literal["png", "webp", "jpeg"] - """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: int - """Compression level for the output image. Default: 100.""" - moderation: Literal["auto", "low"] - """Moderation level for the generated image. Default: ``auto``. Is either a Literal[\"auto\"] type - or a Literal[\"low\"] type.""" - background: Literal["transparent", "opaque", "auto"] - """Background type for the generated image. One of ``transparent``, ``opaque``, or ``auto``. - Default: ``auto``. Is one of the following types: Literal[\"transparent\"], - Literal[\"opaque\"], Literal[\"auto\"]""" - input_fidelity: Optional[Union[str, "InputFidelity"]] - """Known values are: \"high\" and \"low\".""" - input_image_mask: "ImageGenToolInputImageMask" - """Optional mask for inpainting. Contains ``image_url`` (string, optional) and ``file_id`` - (string, optional).""" - partial_images: int - """Number of partial images to generate in streaming mode, from 0 (default value) to 3.""" - action: Union[str, "ImageGenAction"] - """Whether to generate a new image or edit an existing image. Default: ``auto``. Known values are: - \"generate\", \"edit\", and \"auto\".""" - name: str - """Deprecated. This property is deprecated and will be removed in a future version.""" - description: str - """Deprecated. This property is deprecated and will be removed in a future version.""" - tool_configs: dict[str, "ToolConfig"] - """Deprecated. This property is deprecated and will be removed in a future version.""" - - -class ImageGenToolInputImageMask(TypedDict, total=False): - """ImageGenToolInputImageMask. - - :ivar image_url: - :vartype image_url: str - :ivar file_id: - :vartype file_id: str - """ - - image_url: str - file_id: str - - -class InlineSkillParam(TypedDict, total=False): - """InlineSkillParam. - - :ivar type: Defines an inline skill for this request. Required. INLINE. - :vartype type: Literal[ContainerSkillType.INLINE] - :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: "InlineSkillSourceParam" - """ - - type: Required[Literal[ContainerSkillType.INLINE]] - """Defines an inline skill for this request. Required. INLINE.""" - name: Required[str] - """The name of the skill. Required.""" - description: Required[str] - """The description of the skill. Required.""" - source: Required["InlineSkillSourceParam"] - """Inline skill payload. Required.""" - - -class InlineSkillSourceParam(TypedDict, total=False): - """Inline skill payload. - - :ivar type: The type of the inline skill source. Must be ``base64``. Required. Default value is - "base64". - :vartype type: Literal["base64"] - :ivar media_type: The media type of the inline skill payload. Must be ``application/zip``. - Required. Default value is "application/zip". - :vartype media_type: Literal["application/zip"] - :ivar data: Base64-encoded skill zip bundle. Required. - :vartype data: str - """ - - type: Required[Literal["base64"]] - """The type of the inline skill source. Must be ``base64``. Required. Default value is \"base64\".""" - media_type: Required[Literal["application/zip"]] - """The media type of the inline skill payload. Must be ``application/zip``. Required. Default - value is \"application/zip\".""" - data: Required[str] - """Base64-encoded skill zip bundle. Required.""" - - -class Insight(TypedDict, total=False): - """The response body for cluster insights. - - :ivar insight_id: The unique identifier for the insights report. Required. - :vartype insight_id: str - :ivar metadata: Metadata about the insights report. Required. - :vartype metadata: "InsightsMetadata" - :ivar state: The current state of the insights. Required. Known values are: "NotStarted", - "Running", "Succeeded", "Failed", and "Canceled". - :vartype state: Union[str, "OperationState"] - :ivar display_name: User friendly display name for the insight. Required. - :vartype display_name: str - :ivar request: Request for the insights analysis. Required. - :vartype request: "InsightRequest" - :ivar result: The result of the insights report. - :vartype result: "InsightResult" - """ - - id: Required[str] - """The unique identifier for the insights report. Required.""" - metadata: Required["InsightsMetadata"] - """Metadata about the insights report. Required.""" - state: Required[Union[str, "OperationState"]] - """The current state of the insights. Required. Known values are: \"NotStarted\", \"Running\", - \"Succeeded\", \"Failed\", and \"Canceled\".""" - displayName: Required[str] - """User friendly display name for the insight. Required.""" - request: Required["InsightRequest"] - """Request for the insights analysis. Required.""" - result: "InsightResult" - """The result of the insights report.""" - - -class InsightCluster(TypedDict, total=False): - """A cluster of analysis samples. - - :ivar id: The id of the analysis cluster. Required. - :vartype id: str - :ivar label: Label for the cluster. Required. - :vartype label: str - :ivar suggestion: Suggestion for the cluster. Required. - :vartype suggestion: str - :ivar suggestion_title: The title of the suggestion for the cluster. Required. - :vartype suggestion_title: str - :ivar description: Description of the analysis cluster. Required. - :vartype description: str - :ivar weight: The weight of the analysis cluster. This indicate number of samples in the - cluster. Required. - :vartype weight: int - :ivar sub_clusters: List of subclusters within this cluster. Empty if no subclusters exist. - :vartype sub_clusters: list["InsightCluster"] - :ivar samples: List of samples that belong to this cluster. Empty if samples are part of - subclusters. - :vartype samples: list["InsightSample"] - """ - - id: Required[str] - """The id of the analysis cluster. Required.""" - label: Required[str] - """Label for the cluster. Required.""" - suggestion: Required[str] - """Suggestion for the cluster. Required.""" - suggestionTitle: Required[str] - """The title of the suggestion for the cluster. Required.""" - description: Required[str] - """Description of the analysis cluster. Required.""" - weight: Required[int] - """The weight of the analysis cluster. This indicate number of samples in the cluster. Required.""" - subClusters: list["InsightCluster"] - """List of subclusters within this cluster. Empty if no subclusters exist.""" - samples: list["InsightSample"] - """List of samples that belong to this cluster. Empty if samples are part of subclusters.""" - - -class InsightModelConfiguration(TypedDict, total=False): - """Configuration of the model used in the insight generation. - - :ivar model_deployment_name: The model deployment to be evaluated. Accepts either the - deployment name alone or with the connection name as '{connectionName}/'. - Required. - :vartype model_deployment_name: str - """ - - modelDeploymentName: Required[str] - """The model deployment to be evaluated. Accepts either the deployment name alone or with the - connection name as '{connectionName}/'. Required.""" - - -class InsightScheduleTask(TypedDict, total=False): - """Insight task for the schedule. - - :ivar configuration: Configuration for the task. - :vartype configuration: dict[str, str] - :ivar type: Required. Insight task. - :vartype type: Literal[ScheduleTaskType.INSIGHT] - :ivar insight: The insight payload. Required. - :vartype insight: "Insight" - """ - - configuration: dict[str, str] - """Configuration for the task.""" - type: Required[Literal[ScheduleTaskType.INSIGHT]] - """Required. Insight task.""" - insight: Required["Insight"] - """The insight payload. Required.""" - - -class InsightsMetadata(TypedDict, total=False): - """Metadata about the insights. - - :ivar created_at: The timestamp when the insights were created. Required. - :vartype created_at: str - :ivar completed_at: The timestamp when the insights were completed. - :vartype completed_at: str - """ - - createdAt: Required[str] - """The timestamp when the insights were created. Required.""" - completedAt: str - """The timestamp when the insights were completed.""" - - -class InsightSummary(TypedDict, total=False): - """Summary of the error cluster analysis. - - :ivar sample_count: Total number of samples analyzed. Required. - :vartype sample_count: int - :ivar unique_subcluster_count: Total number of unique subcluster labels. Required. - :vartype unique_subcluster_count: int - :ivar unique_cluster_count: Total number of unique clusters. Required. - :vartype unique_cluster_count: int - :ivar method: Method used for clustering. Required. - :vartype method: str - :ivar usage: Token usage while performing clustering analysis. Required. - :vartype usage: "ClusterTokenUsage" - """ - - sampleCount: Required[int] - """Total number of samples analyzed. Required.""" - uniqueSubclusterCount: Required[int] - """Total number of unique subcluster labels. Required.""" - uniqueClusterCount: Required[int] - """Total number of unique clusters. Required.""" - method: Required[str] - """Method used for clustering. Required.""" - usage: Required["ClusterTokenUsage"] - """Token usage while performing clustering analysis. Required.""" - - -class InvocationsProtocolConfiguration(TypedDict, total=False): - """Configuration specific to the invocations protocol.""" - - -class InvocationsWsProtocolConfiguration(TypedDict, total=False): - """Configuration specific to the WebSocket-based invocations protocol.""" - - -class InvokeAgentInvocationsApiDispatchPayload(TypedDict, total=False): - """A manual payload used to test an invocations API routine dispatch. - - :ivar type: The manual dispatch payload type. Required. A manual payload for an invocations API - routine dispatch. - :vartype type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API] - :ivar input: The JSON value sent as the complete downstream invocations input. The value is - passed through as-is and can be an object, string, number, boolean, array, or null. Required. - :vartype input: Any - """ - - type: Required[Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API]] - """The manual dispatch payload type. Required. A manual payload for an invocations API routine - dispatch.""" - input: Required[Any] - """The JSON value sent as the complete downstream invocations input. The value is passed through - as-is and can be an object, string, number, boolean, array, or null. Required.""" - - -class InvokeAgentInvocationsApiRoutineAction(TypedDict, total=False): - """Dispatches a routine through the raw invocations API. Exactly one of agent_name or - agent_endpoint_id must be provided. - - :ivar type: The action type. Required. Dispatches through the raw invocations API. - :vartype type: Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API] - :ivar agent_name: The project-scoped agent name for routine dispatch. - :vartype agent_name: str - :ivar agent_endpoint_id: Legacy endpoint-scoped agent identifier for routine dispatch. - :vartype agent_endpoint_id: str - :ivar input: Static JSON value sent as the complete downstream input when the routine fires. - The value is passed through as-is; no templating is applied. - :vartype input: Any - :ivar session_id: An optional existing hosted-agent session identifier to continue during the - downstream dispatch. - :vartype session_id: str - """ - - type: Required[Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API]] - """The action type. Required. Dispatches through the raw invocations API.""" - agent_name: str - """The project-scoped agent name for routine dispatch.""" - agent_endpoint_id: str - """Legacy endpoint-scoped agent identifier for routine dispatch.""" - input: Any - """Static JSON value sent as the complete downstream input when the routine fires. The value is - passed through as-is; no templating is applied.""" - session_id: str - """An optional existing hosted-agent session identifier to continue during the downstream - dispatch.""" - - -class InvokeAgentResponsesApiDispatchPayload(TypedDict, total=False): - """A manual payload used to test a responses API routine dispatch. - - :ivar type: The manual dispatch payload type. Required. A manual payload for a responses API - routine dispatch. - :vartype type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API] - :ivar input: The JSON value sent as the complete downstream responses input. The value is - passed through as-is and can be an object, string, number, boolean, array, or null. Required. - :vartype input: Any - """ - - type: Required[Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API]] - """The manual dispatch payload type. Required. A manual payload for a responses API routine - dispatch.""" - input: Required[Any] - """The JSON value sent as the complete downstream responses input. The value is passed through - as-is and can be an object, string, number, boolean, array, or null. Required.""" - - -class InvokeAgentResponsesApiRoutineAction(TypedDict, total=False): - """Dispatches a routine through the responses API. Exactly one of agent_name or agent_endpoint_id - must be provided. - - :ivar type: The action type. Required. Dispatches through the responses API. - :vartype type: Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API] - :ivar agent_name: The project-scoped agent name for routine dispatch. - :vartype agent_name: str - :ivar agent_endpoint_id: Legacy endpoint-scoped agent identifier for routine dispatch. - :vartype agent_endpoint_id: str - :ivar input: Static JSON value sent as the complete downstream input when the routine fires. - The value is passed through as-is; no templating is applied. - :vartype input: Any - :ivar conversation: An optional existing conversation identifier to continue during the - downstream dispatch. - :vartype conversation: str - """ - - type: Required[Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API]] - """The action type. Required. Dispatches through the responses API.""" - agent_name: str - """The project-scoped agent name for routine dispatch.""" - agent_endpoint_id: str - """Legacy endpoint-scoped agent identifier for routine dispatch.""" - input: Any - """Static JSON value sent as the complete downstream input when the routine fires. The value is - passed through as-is; no templating is applied.""" - conversation: str - """An optional existing conversation identifier to continue during the downstream dispatch.""" - - -class LlmGeneratedVoiceGreetingConfig(TypedDict, total=False): - """A greeting authored by the session model from a scoped opening-turn prompt. - - :ivar type: Required. Default value is "llm_generated". - :vartype type: Literal["llm_generated"] - :ivar prompt: The Handlebars prompt that guides the opening turn. Required. - :vartype prompt: str - :ivar tool_choice: The tool-selection policy for the opening response. Defaults to ``none``. Is - one of the following types: Literal["none"], Literal["auto"], Literal["required"], - ToolChoiceFunction, ToolChoiceMCP - :vartype tool_choice: "_unions.VoiceAgentToolChoice" - """ - - type: Required[Literal["llm_generated"]] - """Required. Default value is \"llm_generated\".""" - prompt: Required[str] - """The Handlebars prompt that guides the opening turn. Required.""" - tool_choice: "_unions.VoiceAgentToolChoice" - """The tool-selection policy for the opening response. Defaults to ``none``. Is one of the - following types: Literal[\"none\"], Literal[\"auto\"], Literal[\"required\"], - ToolChoiceFunction, ToolChoiceMCP""" - - -class LocalShellToolParam(TypedDict, total=False): - """Local shell tool. - - :ivar type: The type of the local shell tool. Always ``local_shell``. Required. LOCAL_SHELL. - :vartype type: Literal[ToolType.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, "ToolConfig"] - """ - - type: Required[Literal[ToolType.LOCAL_SHELL]] - """The type of the local shell tool. Always ``local_shell``. Required. LOCAL_SHELL.""" - name: str - """Deprecated. This property is deprecated and will be removed in a future version.""" - description: str - """Deprecated. This property is deprecated and will be removed in a future version.""" - tool_configs: dict[str, "ToolConfig"] - """Deprecated. This property is deprecated and will be removed in a future version.""" - - -class LocalSkillParam(TypedDict, total=False): - """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: Required[str] - """The name of the skill. Required.""" - description: Required[str] - """The description of the skill. Required.""" - path: Required[str] - """The path to the directory containing the skill. Required.""" - - -class LogProbProperties(TypedDict, total=False): - """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: Required[str] - """The token that was used to generate the log probability. Required.""" - logprob: Required[float] - """The log probability of the token. Required.""" - bytes: Required[list[int]] - """The bytes that were used to generate the log probability. Required.""" - - -class LoraConfig(TypedDict, total=False): - """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: int - """LoRA rank (r). Positive integer. Common values: 8, 16, 32, 64.""" - alpha: int - """LoRA scaling factor (α). Positive integer; typically 2× the rank.""" - targetModules: list[str] - """Model layers modified by the adapter (e.g., q_proj, v_proj). Auto-detected from - adapter_config.json if omitted.""" - dropout: float - """Dropout rate used during training. Informational — not used at serving time.""" - - -class ManagedAgentIdentityBlueprintReference(TypedDict, total=False): - """ManagedAgentIdentityBlueprintReference. - - :ivar type: Required. MANAGED_AGENT_IDENTITY_BLUEPRINT. - :vartype type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] - :ivar blueprint_id: The ID of the managed blueprint. Required. - :vartype blueprint_id: str - """ - - type: Required[Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT]] - """Required. MANAGED_AGENT_IDENTITY_BLUEPRINT.""" - blueprint_id: Required[str] - """The ID of the managed blueprint. Required.""" - - -class ManagedAzureAISearchIndex(TypedDict, total=False): - """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: Literal[IndexType.MANAGED_AZURE_SEARCH] - :ivar vector_store_id: Vector store id of managed index. Required. - :vartype vector_store_id: str - """ - - id: str - """Asset ID, a unique identifier for the asset.""" - name: Required[str] - """The name of the resource. Required.""" - version: Required[str] - """The version of the resource. Required.""" - description: str - """The asset description text.""" - tags: dict[str, str] - """Tag dictionary. Tags can be added, removed, and updated.""" - type: Required[Literal[IndexType.MANAGED_AZURE_SEARCH]] - """Type of index. Required. Managed Azure Search.""" - vectorStoreId: Required[str] - """Vector store id of managed index. Required.""" - - -class MCPListToolsTool(TypedDict, total=False): - """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: "MCPListToolsToolInputSchema" - :ivar annotations: - :vartype annotations: "MCPListToolsToolAnnotations" - """ - - name: Required[str] - """The name of the tool. Required.""" - description: Optional[str] - input_schema: Required["MCPListToolsToolInputSchema"] - """The JSON schema describing the tool's input. Required.""" - annotations: Optional["MCPListToolsToolAnnotations"] - - -class MCPListToolsToolAnnotations(TypedDict, total=False): - """MCPListToolsToolAnnotations.""" - - -class MCPListToolsToolInputSchema(TypedDict, total=False): - """MCPListToolsToolInputSchema.""" - - -class McpProtocolConfiguration(TypedDict, total=False): - """Configuration specific to the MCP protocol.""" - - -class MCPTool(TypedDict, total=False): - """MCP tool. - - :ivar type: The type of the MCP tool. Always ``mcp``. Required. MCP. - :vartype type: Literal[ToolType.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: - - * 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: Literal["connector_dropbox", "connector_gmail", - "connector_googlecalendar", "connector_googledrive", "connector_microsoftteams", - "connector_outlookcalendar", "connector_outlookemail", "connector_sharepoint"] - :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: Union[list[str], "MCPToolFilter"] - :ivar allowed_callers: - :vartype allowed_callers: list[Union[str, "CallableToolAllowedCaller"]] - :ivar require_approval: Is one of the following types: MCPToolRequireApproval, - Literal["always"], Literal["never"] - :vartype require_approval: Union["MCPToolRequireApproval", Literal["always"], Literal["never"]] - :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, "ToolConfig"] - """ - - type: Required[Literal[ToolType.MCP]] - """The type of the MCP tool. Always ``mcp``. Required. MCP.""" - server_label: Required[str] - """A label for this MCP server, used to identify it in tool calls. Required.""" - server_url: str - """The URL for the MCP server. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be - provided.""" - connector_id: Literal[ - "connector_dropbox", - "connector_gmail", - "connector_googlecalendar", - "connector_googledrive", - "connector_microsoftteams", - "connector_outlookcalendar", - "connector_outlookemail", - "connector_sharepoint", - ] - """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: - - * 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: str - """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: str - """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: str - """Optional description of the MCP server, used to provide more context.""" - headers: Optional[dict[str, str]] - allowed_tools: Optional[Union[list[str], "MCPToolFilter"]] - """Is either a [str] type or a MCPToolFilter type.""" - allowed_callers: Optional[list[Union[str, "CallableToolAllowedCaller"]]] - require_approval: Optional[Union["MCPToolRequireApproval", Literal["always"], Literal["never"]]] - """Is one of the following types: MCPToolRequireApproval, Literal[\"always\"], Literal[\"never\"]""" - defer_loading: bool - """Whether this MCP tool is deferred and discovered via tool search.""" - project_connection_id: str - """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: dict[str, "ToolConfig"] - """Deprecated. This property is deprecated and will be removed in a future version.""" - - -class MCPToolboxTool(TypedDict, total=False): - """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, "ToolConfig"] - :ivar type: Required. MCP. - :vartype type: Literal[ToolboxToolType.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: - - * 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: Literal["connector_dropbox", "connector_gmail", - "connector_googlecalendar", "connector_googledrive", "connector_microsoftteams", - "connector_outlookcalendar", "connector_outlookemail", "connector_sharepoint"] - :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: Union[list[str], "MCPToolFilter"] - :ivar allowed_callers: - :vartype allowed_callers: list[Union[str, "CallableToolAllowedCaller"]] - :ivar require_approval: Is one of the following types: MCPToolRequireApproval, - Literal["always"], Literal["never"] - :vartype require_approval: Union["MCPToolRequireApproval", Literal["always"], Literal["never"]] - :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 - """ - - name: str - """Optional user-defined name for this tool or configuration.""" - description: str - """Optional user-defined description for this tool or configuration.""" - tool_configs: dict[str, "ToolConfig"] - """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.""" - type: Required[Literal[ToolboxToolType.MCP]] - """Required. MCP.""" - server_label: Required[str] - """A label for this MCP server, used to identify it in tool calls. Required.""" - server_url: str - """The URL for the MCP server. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be - provided.""" - connector_id: Literal[ - "connector_dropbox", - "connector_gmail", - "connector_googlecalendar", - "connector_googledrive", - "connector_microsoftteams", - "connector_outlookcalendar", - "connector_outlookemail", - "connector_sharepoint", - ] - """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: - - * 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: str - """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: str - """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: str - """Optional description of the MCP server, used to provide more context.""" - headers: Optional[dict[str, str]] - allowed_tools: Optional[Union[list[str], "MCPToolFilter"]] - """Is either a [str] type or a MCPToolFilter type.""" - allowed_callers: Optional[list[Union[str, "CallableToolAllowedCaller"]]] - require_approval: Optional[Union["MCPToolRequireApproval", Literal["always"], Literal["never"]]] - """Is one of the following types: MCPToolRequireApproval, Literal[\"always\"], Literal[\"never\"]""" - defer_loading: bool - """Whether this MCP tool is deferred and discovered via tool search.""" - project_connection_id: str - """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.""" - - -class MCPToolFilter(TypedDict, total=False): - """MCP tool filter. - - :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 - """ - - tool_names: list[str] - """MCP allowed tools.""" - read_only: bool - """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.""" - - -class MCPToolRequireApproval(TypedDict, total=False): - """MCPToolRequireApproval. - - :ivar always: - :vartype always: "MCPToolFilter" - :ivar never: - :vartype never: "MCPToolFilter" - """ - - always: "MCPToolFilter" - never: "MCPToolFilter" - - -class MemorySearchOptions(TypedDict, total=False): - """Memory search options. - - :ivar max_memories: Maximum number of memory items to return. - :vartype max_memories: int - """ - - max_memories: int - """Maximum number of memory items to return.""" - - -class MemorySearchPreviewTool(TypedDict, total=False): - """A tool for integrating memories into the agent. - - :ivar type: The type of the tool. Always ``memory_search_preview``. Required. - MEMORY_SEARCH_PREVIEW. - :vartype type: Literal[ToolType.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: "MemorySearchOptions" - :ivar update_delay: Time to wait before updating memories after inactivity (seconds). Default - 300. - :vartype update_delay: int - """ - - type: Required[Literal[ToolType.MEMORY_SEARCH_PREVIEW]] - """The type of the tool. Always ``memory_search_preview``. Required. MEMORY_SEARCH_PREVIEW.""" - memory_store_name: Required[str] - """The name of the memory store to use. Required.""" - scope: Required[str] - """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: "MemorySearchOptions" - """Options for searching the memory store.""" - update_delay: int - """Time to wait before updating memories after inactivity (seconds). Default 300.""" - - -class MemoryStoreDefaultDefinition(TypedDict, total=False): - """Default memory store implementation. - - :ivar kind: The kind of the memory store. Required. The default memory store implementation. - :vartype kind: Literal[MemoryStoreKind.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: "MemoryStoreDefaultOptions" - """ - - kind: Required[Literal[MemoryStoreKind.DEFAULT]] - """The kind of the memory store. Required. The default memory store implementation.""" - chat_model: Required[str] - """The name or identifier of the chat completion model deployment used for memory processing. - Required.""" - embedding_model: Required[str] - """The name or identifier of the embedding model deployment used for memory processing. Required.""" - options: "MemoryStoreDefaultOptions" - """Default memory store options.""" - - -class MemoryStoreDefaultOptions(TypedDict, total=False): - """Default memory store configurations. - - :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: str - """ - - user_profile_enabled: Required[bool] - """Whether to enable user profile extraction and storage. Default is true. Required.""" - user_profile_details: str - """Specific categories or types of user profile information to extract and store.""" - chat_summary_enabled: Required[bool] - """Whether to enable chat summary extraction and storage. Defaults to ``true``. Required.""" - procedural_memory_enabled: bool - """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: str - """The default time-to-live for memories in seconds. A value of ``0`` indicates that memories do - not expire. Defaults to ``0``.""" - - -class Metadata(TypedDict, total=False): - """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 MicrosoftFabricPreviewTool(TypedDict, total=False): - """The input definition information for a Microsoft Fabric tool as used to configure an agent. - - :ivar type: The object type, which is always 'fabric_dataagent_preview'. Required. - FABRIC_DATAAGENT_PREVIEW. - :vartype type: Literal[ToolType.FABRIC_DATAAGENT_PREVIEW] - :ivar fabric_dataagent_preview: The fabric data agent tool parameters. Required. - :vartype fabric_dataagent_preview: "FabricDataAgentToolParameters" - """ - - type: Required[Literal[ToolType.FABRIC_DATAAGENT_PREVIEW]] - """The object type, which is always 'fabric_dataagent_preview'. Required. - FABRIC_DATAAGENT_PREVIEW.""" - fabric_dataagent_preview: Required["FabricDataAgentToolParameters"] - """The fabric data agent tool parameters. Required.""" - - -class ModelCredentialRequest(TypedDict, total=False): - """Request to fetch credentials for a model asset. - - :ivar blob_uri: Blob URI of the model asset to fetch credentials for. Required. - :vartype blob_uri: str - """ - - blobUri: Required[str] - """Blob URI of the model asset to fetch credentials for. Required.""" - - -class ModelPendingUploadRequest(TypedDict, total=False): - """Represents a request for a pending upload of a model version. - - :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: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] - """ - - pendingUploadId: str - """If PendingUploadId is not provided, a random GUID will be used.""" - connectionName: str - """Azure Storage Account connection name to use for generating temporary SAS token.""" - pendingUploadType: Required[Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE]] - """The type of pending upload. Only TemporaryBlobReference is supported for models. Required. - Temporary blob reference.""" - - -class ModelSamplingParams(TypedDict, total=False): - """Represents a set of parameters used to control the sampling behavior of a language model during - text generation. - - :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 - """ - - temperature: float - """The temperature parameter for sampling. Defaults to 1.0.""" - top_p: float - """The top-p parameter for nucleus sampling. Defaults to 1.0.""" - seed: int - """The random seed for reproducibility. Defaults to 42.""" - max_completion_tokens: int - """The maximum number of tokens allowed in the completion.""" - - -class ModelSourceData(TypedDict, total=False): - """Source information for the model. - - :ivar source_type: The source type of the model. Known values are: "LocalUpload" and - "TrainingJob". - :vartype source_type: Union[str, "FoundryModelSourceType"] - :ivar job_id: The job ID that produced this model. - :vartype job_id: str - """ - - sourceType: Union[str, "FoundryModelSourceType"] - """The source type of the model. Known values are: \"LocalUpload\" and \"TrainingJob\".""" - jobId: str - """The job ID that produced this model.""" - - -class ModelVersion(TypedDict, total=False): - """Model Version Definition. - - :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: Union[str, "FoundryModelWeightType"] - :ivar base_model: Base model asset ID. - :vartype base_model: str - :ivar source: The source of the model. - :vartype source: "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: "LoraConfig" - :ivar artifact_profile: The artifact profile of the model. - :vartype artifact_profile: "ArtifactProfile" - :ivar warnings: Service-computed advisory warnings derived from the artifact profile. - :vartype warnings: list["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] - """ - - blobUri: Required[str] - """URI of the model artifact in blob storage. Required.""" - weightType: Union[str, "FoundryModelWeightType"] - """The weight type of the model. Known values are: \"FullWeight\", \"LoRA\", and \"DraftModel\".""" - baseModel: str - """Base model asset ID.""" - source: "ModelSourceData" - """The source of the model.""" - loraConfig: "LoraConfig" - """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.""" - artifactProfile: "ArtifactProfile" - """The artifact profile of the model.""" - warnings: list["FoundryModelWarning"] - """Service-computed advisory warnings derived from the artifact profile.""" - id: str - """Asset ID, a unique identifier for the asset.""" - name: Required[str] - """The name of the resource. Required.""" - version: Required[str] - """The version of the resource. Required.""" - description: str - """The asset description text.""" - tags: dict[str, str] - """Tag dictionary. Tags can be added, removed, and updated.""" - - -class MonthlyRecurrenceSchedule(TypedDict, total=False): - """Monthly recurrence schedule. - - :ivar type: Monthly recurrence type. Required. Monthly recurrence pattern. - :vartype type: Literal[RecurrenceType.MONTHLY] - :ivar days_of_month: Days of the month for the recurrence schedule. Required. - :vartype days_of_month: list[int] - """ - - type: Required[Literal[RecurrenceType.MONTHLY]] - """Monthly recurrence type. Required. Monthly recurrence pattern.""" - daysOfMonth: Required[list[int]] - """Days of the month for the recurrence schedule. Required.""" - - -class NamespaceToolParam(TypedDict, total=False): - """Namespace. - - :ivar type: The type of the tool. Always ``namespace``. Required. NAMESPACE. - :vartype type: Literal[ToolType.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[Union["FunctionToolParam", "CustomToolParam"]] - """ - - type: Required[Literal[ToolType.NAMESPACE]] - """The type of the tool. Always ``namespace``. Required. NAMESPACE.""" - name: Required[str] - """The namespace name used in tool calls (for example, ``crm``). Required.""" - description: Required[str] - """A description of the namespace shown to the model. Required.""" - tools: Required[list[Union["FunctionToolParam", "CustomToolParam"]]] - """The function/custom tools available inside this namespace. Required.""" - - -class OmitPropertiesRealtimeResponse1(TypedDict, total=False): - """The template for omitting properties. - - :ivar id: The unique ID of the response, will look like ``resp_1234``. - :vartype id: str - :ivar object: The object type, must be ``realtime.response``. Default value is - "realtime.response". - :vartype object: Literal["realtime.response"] - :ivar status: The final status of the response (``completed``, ``cancelled``, ``failed``, or - ``incomplete``, ``in_progress``). Is one of the following types: Literal["completed"], - Literal["cancelled"], Literal["failed"], Literal["incomplete"], Literal["in_progress"] - :vartype status: Literal["completed", "cancelled", "failed", "incomplete", "in_progress"] - :ivar status_details: Additional details about the status. - :vartype status_details: "RealtimeResponseStatusDetails" - :ivar metadata: - :vartype metadata: "Metadata" - :ivar usage: Usage statistics for the Response, this will correspond to billing. A Realtime API - session will maintain a conversation context and append new Items to the Conversation, thus - output from previous turns (text and audio tokens) will become the input for later turns. - :vartype usage: "RealtimeResponseUsage" - :ivar conversation_id: Which conversation the response is added to, determined by the - ``conversation`` field in the ``response.create`` event. If ``auto``, the response will be - added to the default conversation and the value of ``conversation_id`` will be an id like - ``conv_1234``. If ``none``, the response will not be added to any conversation and the value of - ``conversation_id`` will be ``null``. If responses are being triggered automatically by VAD the - response will be added to the default conversation. - :vartype conversation_id: str - :ivar output_modalities: The set of modalities the model used to respond, currently the only - possible values are ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text - transcript. Setting the output to mode ``text`` will disable audio output from the model. - :vartype output_modalities: list[Literal["text", "audio"]] - :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, - inclusive of tool calls, that was used in this response. Is either a int type or a - Literal["inf"] type. - :vartype max_output_tokens: Union[int, Literal["inf"]] - """ - - id: str - """The unique ID of the response, will look like ``resp_1234``.""" - object: Literal["realtime.response"] - """The object type, must be ``realtime.response``. Default value is \"realtime.response\".""" - status: Literal["completed", "cancelled", "failed", "incomplete", "in_progress"] - """The final status of the response (``completed``, ``cancelled``, ``failed``, or ``incomplete``, - ``in_progress``). Is one of the following types: Literal[\"completed\"], - Literal[\"cancelled\"], Literal[\"failed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" - status_details: "RealtimeResponseStatusDetails" - """Additional details about the status.""" - metadata: Optional["Metadata"] - usage: "RealtimeResponseUsage" - """Usage statistics for the Response, this will correspond to billing. A Realtime API session will - maintain a conversation context and append new Items to the Conversation, thus output from - previous turns (text and audio tokens) will become the input for later turns.""" - conversation_id: str - """Which conversation the response is added to, determined by the ``conversation`` field in the - ``response.create`` event. If ``auto``, the response will be added to the default conversation - and the value of ``conversation_id`` will be an id like ``conv_1234``. If ``none``, the - response will not be added to any conversation and the value of ``conversation_id`` will be - ``null``. If responses are being triggered automatically by VAD the response will be added to - the default conversation.""" - output_modalities: list[Literal["text", "audio"]] - """The set of modalities the model used to respond, currently the only possible values are - ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text transcript. Setting the - output to mode ``text`` will disable audio output from the model.""" - max_output_tokens: Union[int, Literal["inf"]] - """Maximum number of output tokens for a single assistant response, inclusive of tool calls, that - was used in this response. Is either a int type or a Literal[\"inf\"] type.""" - - -class OneTimeTrigger(TypedDict, total=False): - """One-time trigger. - - :ivar type: Required. One-time trigger. - :vartype type: Literal[TriggerType.ONE_TIME] - :ivar trigger_at: Date and time for the one-time trigger in ISO 8601 format. Required. - :vartype trigger_at: str - :ivar time_zone: Time zone for the one-time trigger. Defaults to ``UTC``. - :vartype time_zone: str - """ - - type: Required[Literal[TriggerType.ONE_TIME]] - """Required. One-time trigger.""" - triggerAt: Required[str] - """Date and time for the one-time trigger in ISO 8601 format. Required.""" - timeZone: str - """Time zone for the one-time trigger. Defaults to ``UTC``.""" - - -class OpenApiAnonymousAuthDetails(TypedDict, total=False): - """Security details for OpenApi anonymous authentication. - - :ivar type: The object type, which is always 'anonymous'. Required. ANONYMOUS. - :vartype type: Literal[OpenApiAuthType.ANONYMOUS] - """ - - type: Required[Literal[OpenApiAuthType.ANONYMOUS]] - """The object type, which is always 'anonymous'. Required. ANONYMOUS.""" - - -class OpenApiFunctionDefinition(TypedDict, total=False): - """The input definition information for an openapi function. - - :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: "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["OpenApiFunctionDefinitionFunction"] - """ - - name: Required[str] - """The name of the function to be called. Required.""" - description: str - """A description of what the function does, used by the model to choose when and how to call the - function.""" - spec: Required[dict[str, Any]] - """The openapi function shape, described as a JSON Schema object. Required.""" - auth: Required["OpenApiAuthDetails"] - """Open API authentication details. Required.""" - default_params: list[str] - """List of OpenAPI spec parameters that will use user-provided defaults.""" - functions: list["OpenApiFunctionDefinitionFunction"] - """List of function definitions used by OpenApi tool.""" - - -class OpenApiFunctionDefinitionFunction(TypedDict, total=False): - """OpenApiFunctionDefinitionFunction. - - :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] - """ - - name: Required[str] - """The name of the function to be called. Required.""" - description: str - """A description of what the function does, used by the model to choose when and how to call the - function.""" - parameters: Required[dict[str, Any]] - """The parameters the functions accepts, described as a JSON Schema object. Required.""" - - -class OpenApiManagedAuthDetails(TypedDict, total=False): - """Security details for OpenApi managed_identity authentication. - - :ivar type: The object type, which is always 'managed_identity'. Required. MANAGED_IDENTITY. - :vartype type: Literal[OpenApiAuthType.MANAGED_IDENTITY] - :ivar security_scheme: Connection auth security details. Required. - :vartype security_scheme: "OpenApiManagedSecurityScheme" - """ - - type: Required[Literal[OpenApiAuthType.MANAGED_IDENTITY]] - """The object type, which is always 'managed_identity'. Required. MANAGED_IDENTITY.""" - security_scheme: Required["OpenApiManagedSecurityScheme"] - """Connection auth security details. Required.""" - - -class OpenApiManagedSecurityScheme(TypedDict, total=False): - """Security scheme for OpenApi managed_identity authentication. - - :ivar audience: Authentication scope for managed_identity auth type. Required. - :vartype audience: str - """ - - audience: Required[str] - """Authentication scope for managed_identity auth type. Required.""" - - -class OpenApiProjectConnectionAuthDetails(TypedDict, total=False): - """Security details for OpenApi project connection authentication. - - :ivar type: The object type, which is always 'project_connection'. Required. - PROJECT_CONNECTION. - :vartype type: Literal[OpenApiAuthType.PROJECT_CONNECTION] - :ivar security_scheme: Project connection auth security details. Required. - :vartype security_scheme: "OpenApiProjectConnectionSecurityScheme" - """ - - type: Required[Literal[OpenApiAuthType.PROJECT_CONNECTION]] - """The object type, which is always 'project_connection'. Required. PROJECT_CONNECTION.""" - security_scheme: Required["OpenApiProjectConnectionSecurityScheme"] - """Project connection auth security details. Required.""" - - -class OpenApiProjectConnectionSecurityScheme(TypedDict, total=False): - """Security scheme for OpenApi managed_identity authentication. - - :ivar project_connection_id: Project connection id for Project Connection auth type. Required. - :vartype project_connection_id: str - """ - - project_connection_id: Required[str] - """Project connection id for Project Connection auth type. Required.""" - - -class OpenApiTool(TypedDict, total=False): - """The input definition information for an OpenAPI tool as used to configure an agent. - - :ivar type: The object type, which is always 'openapi'. Required. OPENAPI. - :vartype type: Literal[ToolType.OPENAPI] - :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype tool_configs: dict[str, "ToolConfig"] - :ivar openapi: The openapi function definition. Required. - :vartype openapi: "OpenApiFunctionDefinition" - """ - - type: Required[Literal[ToolType.OPENAPI]] - """The object type, which is always 'openapi'. Required. OPENAPI.""" - tool_configs: dict[str, "ToolConfig"] - """Deprecated. This property is deprecated and will be removed in a future version.""" - openapi: Required["OpenApiFunctionDefinition"] - """The openapi function definition. Required.""" - - -class OpenApiToolboxTool(TypedDict, total=False): - """An OpenAPI 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, "ToolConfig"] - :ivar type: Required. OPENAPI. - :vartype type: Literal[ToolboxToolType.OPENAPI] - :ivar openapi: The openapi function definition. Required. - :vartype openapi: "OpenApiFunctionDefinition" - """ - - name: str - """Optional user-defined name for this tool or configuration.""" - description: str - """Optional user-defined description for this tool or configuration.""" - tool_configs: dict[str, "ToolConfig"] - """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.""" - type: Required[Literal[ToolboxToolType.OPENAPI]] - """Required. OPENAPI.""" - openapi: Required["OpenApiFunctionDefinition"] - """The openapi function definition. Required.""" - - -class OptimizedAgentIdentifier(TypedDict, total=False): - """Identifies the registered Foundry agent to optimize (request-only). Skills, tools, and - system_prompt are specified in options.optimization_config. - - :ivar agent_name: Registered Foundry agent name (required). Required. - :vartype agent_name: str - :ivar agent_version: Pinned agent version. Defaults to latest if omitted. - :vartype agent_version: str - """ - - agent_name: Required[str] - """Registered Foundry agent name (required). Required.""" - agent_version: str - """Pinned agent version. Defaults to latest if omitted.""" - - -class OtlpTelemetryEndpoint(TypedDict, total=False): - """An OTLP (OpenTelemetry Protocol) telemetry export endpoint. - - :ivar data: Data types to export to this endpoint. Use an empty array to export no data. - Required. - :vartype data: list[Union[str, "TelemetryDataKind"]] - :ivar auth: Optional authentication configuration. - :vartype auth: "TelemetryEndpointAuth" - :ivar kind: The endpoint kind, always 'OTLP' for OpenTelemetry Protocol endpoints. Required. - OpenTelemetry Protocol (OTLP) endpoint. - :vartype kind: Literal[TelemetryEndpointKind.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: Union[str, "TelemetryTransportProtocol"] - """ - - data: Required[list[Union[str, "TelemetryDataKind"]]] - """Data types to export to this endpoint. Use an empty array to export no data. Required.""" - auth: "TelemetryEndpointAuth" - """Optional authentication configuration.""" - kind: Required[Literal[TelemetryEndpointKind.OTLP]] - """The endpoint kind, always 'OTLP' for OpenTelemetry Protocol endpoints. Required. OpenTelemetry - Protocol (OTLP) endpoint.""" - endpoint: Required[str] - """The OTLP collector endpoint URL. Required.""" - protocol: Required[Union[str, "TelemetryTransportProtocol"]] - """The transport protocol for the OTLP endpoint. Required. Known values are: \"Http\" and - \"Grpc\".""" - - -class PendingUploadRequest(TypedDict, total=False): - """Represents a request for a pending upload. - - :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: Literal[PendingUploadType.BLOB_REFERENCE] - """ - - pendingUploadId: str - """If PendingUploadId is not provided, a random GUID will be used.""" - connectionName: str - """Azure Storage Account connection name to use for generating temporary SAS token.""" - pendingUploadType: Required[Literal[PendingUploadType.BLOB_REFERENCE]] - """The type of pending upload. Required. Deprecated: the service never read this value and - silently ignored it. Use TemporaryBlobReference instead.""" - - -class PickPropertiesVoiceAudioConfig(TypedDict, total=False): - """The template for picking properties. - - :ivar output: Output (agent speech) audio configuration. - :vartype output: "VoiceAudioOutputConfig" - """ - - output: "VoiceAudioOutputConfig" - """Output (agent speech) audio configuration.""" - - -class ProgrammaticToolCallingParam(TypedDict, total=False): - """ProgrammaticToolCallingParam. - - :ivar type: The type of the tool. Always ``programmatic_tool_calling``. Required. - PROGRAMMATIC_TOOL_CALLING. - :vartype type: Literal[ToolType.PROGRAMMATIC_TOOL_CALLING] - """ - - type: Required[Literal[ToolType.PROGRAMMATIC_TOOL_CALLING]] - """The type of the tool. Always ``programmatic_tool_calling``. Required. - PROGRAMMATIC_TOOL_CALLING.""" - - -class PromotionInfo(TypedDict, total=False): - """Promotion metadata recorded when a candidate is deployed to a Foundry agent. - - :ivar promoted_at: Timestamp when promotion occurred, represented in Unix time. Required. - :vartype promoted_at: int - :ivar agent_name: Name of the Foundry agent this candidate was promoted to. Required. - :vartype agent_name: str - :ivar agent_version: Version of the Foundry agent this candidate was promoted to. Required. - :vartype agent_version: str - """ - - promoted_at: Required[int] - """Timestamp when promotion occurred, represented in Unix time. Required.""" - agent_name: Required[str] - """Name of the Foundry agent this candidate was promoted to. Required.""" - agent_version: Required[str] - """Version of the Foundry agent this candidate was promoted to. Required.""" - - -class PromptAgentDefinition(TypedDict, total=False): - """The prompt agent definition. - - :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. - :vartype rai_config: "RaiConfig" - :ivar kind: Required. PROMPT. - :vartype kind: Literal[AgentKind.PROMPT] - :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 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: "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["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: Union[str, "ToolChoiceParam"] - :ivar text: Configuration options for a text response from the model. Can be plain text or - structured JSON data. - :vartype text: "PromptAgentDefinitionTextOptions" - :ivar structured_inputs: Set of structured inputs that can participate in prompt template - substitution or tool argument bindings. - :vartype structured_inputs: dict[str, "StructuredInputDefinition"] - """ - - rai_config: "RaiConfig" - """Configuration for Responsible AI (RAI) content filtering and safety features.""" - kind: Required[Literal[AgentKind.PROMPT]] - """Required. PROMPT.""" - model: Required[str] - """The model deployment to use for this agent. Required.""" - instructions: Optional[str] - """A system (or developer) message inserted into the model's context.""" - temperature: Optional[float] - """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] - """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["Reasoning"] - tools: list["Tool"] - """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: Union[str, "ToolChoiceParam"] - """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: "PromptAgentDefinitionTextOptions" - """Configuration options for a text response from the model. Can be plain text or structured JSON - data.""" - structured_inputs: dict[str, "StructuredInputDefinition"] - """Set of structured inputs that can participate in prompt template substitution or tool argument - bindings.""" - - -class PromptAgentDefinitionTextOptions(TypedDict, total=False): - """Configuration options for a text response from the model. Can be plain text or structured JSON - data. - - :ivar format: - :vartype format: "TextResponseFormat" - """ - - format: "TextResponseFormat" - - -class PromptBasedEvaluatorDefinition(TypedDict, total=False): - """Prompt-based evaluator. - - :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, "EvaluatorMetric"] - :ivar type: Required. Prompt-based definition. - :vartype type: Literal[EvaluatorDefinitionType.PROMPT] - :ivar prompt_text: The prompt text used for evaluation. Required. - :vartype prompt_text: str - """ - - init_parameters: dict[str, Any] - """The JSON schema (Draft 2020-12) for the evaluator's input parameters. This includes parameters - like type, properties, required.""" - data_schema: dict[str, Any] - """The JSON schema (Draft 2020-12) for the evaluator's input data. This includes parameters like - type, properties, required.""" - metrics: dict[str, "EvaluatorMetric"] - """List of output metrics produced by this evaluator.""" - type: Required[Literal[EvaluatorDefinitionType.PROMPT]] - """Required. Prompt-based definition.""" - prompt_text: Required[str] - """The prompt text used for evaluation. Required.""" - - -class PromptDataGenerationJobSource(TypedDict, total=False): - """Prompt source for data 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: Literal[DataGenerationJobSourceType.PROMPT] - :ivar prompt: Inline prompt text (e.g., agent description, policy text, supplementary context). - Required. - :vartype prompt: str - """ - - description: str - """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: Required[Literal[DataGenerationJobSourceType.PROMPT]] - """The source type for this source, which is Prompt. Required. Prompt source — inline text - provided by the user.""" - prompt: Required[str] - """Inline prompt text (e.g., agent description, policy text, supplementary context). Required.""" - - -class PromptEvaluatorGenerationJobSource(TypedDict, total=False): - """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: Literal[EvaluatorGenerationJobSourceType.PROMPT] - :ivar prompt: Inline prompt text (e.g., agent description, policy text, supplementary context). - Required. - :vartype prompt: str - """ - - description: str - """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: Required[Literal[EvaluatorGenerationJobSourceType.PROMPT]] - """The source type for this source, which is Prompt. Required. Prompt source — inline text - provided by the user.""" - prompt: Required[str] - """Inline prompt text (e.g., agent description, policy text, supplementary context). Required.""" - - -class ProtocolConfiguration(TypedDict, total=False): - """Per-protocol configuration for the agent endpoint. - - :ivar activity: Configuration for the activity protocol. - :vartype activity: "ActivityProtocolConfiguration" - :ivar responses: Configuration for the responses protocol. - :vartype responses: "ResponsesProtocolConfiguration" - :ivar a2a: Configuration for the A2A protocol. - :vartype a2a: "A2AProtocolConfiguration" - :ivar mcp: Configuration for the MCP protocol. - :vartype mcp: "McpProtocolConfiguration" - :ivar invocations: Configuration for the invocations protocol. - :vartype invocations: "InvocationsProtocolConfiguration" - :ivar invocations_ws: Configuration for the WebSocket-based invocations protocol. - :vartype invocations_ws: "InvocationsWsProtocolConfiguration" - """ - - activity: "ActivityProtocolConfiguration" - """Configuration for the activity protocol.""" - responses: "ResponsesProtocolConfiguration" - """Configuration for the responses protocol.""" - a2a: "A2AProtocolConfiguration" - """Configuration for the A2A protocol.""" - mcp: "McpProtocolConfiguration" - """Configuration for the MCP protocol.""" - invocations: "InvocationsProtocolConfiguration" - """Configuration for the invocations protocol.""" - invocations_ws: "InvocationsWsProtocolConfiguration" - """Configuration for the WebSocket-based invocations protocol.""" - - -class ProtocolVersionRecord(TypedDict, total=False): - """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". - :vartype protocol: Union[str, "AgentEndpointProtocol"] - :ivar version: The version string for the protocol, e.g. 'v0.1.1'. Required. - :vartype version: str - """ - - protocol: Required[Union[str, "AgentEndpointProtocol"]] - """The protocol type. Required. Known values are: \"activity\", \"responses\", \"a2a\", \"mcp\", - \"invocations\", \"voice\", and \"invocations_ws\".""" - version: Required[str] - """The version string for the protocol, e.g. 'v0.1.1'. Required.""" - - -class RaiConfig(TypedDict, total=False): - """Configuration for Responsible AI (RAI) content filtering and safety features. - - :ivar rai_policy_name: The name of the RAI policy to apply. Required. - :vartype rai_policy_name: str - """ - - rai_policy_name: Required[str] - """The name of the RAI policy to apply. Required.""" - - -class RankingOptions(TypedDict, total=False): - """RankingOptions. - - :ivar ranker: The ranker to use for the file search. Known values are: "auto" and - "default-2024-11-15". - :vartype ranker: Union[str, "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: "HybridSearchOptions" - """ - - ranker: Union[str, "RankerVersionType"] - """The ranker to use for the file search. Known values are: \"auto\" and \"default-2024-11-15\".""" - score_threshold: float - """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: "HybridSearchOptions" - """Weights that control how reciprocal rank fusion balances semantic embedding matches versus - sparse keyword matches when hybrid search is enabled.""" - - -class RealtimeAudioFormatsAudioPcm(TypedDict, total=False): - """RealtimeAudioFormatsAudioPcm. - - :ivar type: Required. AUDIO_PCM. - :vartype type: Literal[RealtimeAudioFormatsType.AUDIO_PCM] - :ivar rate: Default value is 24000. - :vartype rate: Literal[24000] - """ - - type: Required[Literal[RealtimeAudioFormatsType.AUDIO_PCM]] - """Required. AUDIO_PCM.""" - rate: Literal[24000] - """Default value is 24000.""" - - -class RealtimeAudioFormatsAudioPcma(TypedDict, total=False): - """RealtimeAudioFormatsAudioPcma. - - :ivar type: Required. AUDIO_PCMA. - :vartype type: Literal[RealtimeAudioFormatsType.AUDIO_PCMA] - """ - - type: Required[Literal[RealtimeAudioFormatsType.AUDIO_PCMA]] - """Required. AUDIO_PCMA.""" - - -class RealtimeAudioFormatsAudioPcmu(TypedDict, total=False): - """RealtimeAudioFormatsAudioPcmu. - - :ivar type: Required. AUDIO_PCMU. - :vartype type: Literal[RealtimeAudioFormatsType.AUDIO_PCMU] - """ - - type: Required[Literal[RealtimeAudioFormatsType.AUDIO_PCMU]] - """Required. AUDIO_PCMU.""" - - -class RealtimeConversationItemFunctionCall(TypedDict, total=False): - """Realtime function call item. - - :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: Literal["realtime.item"] - :ivar type: The type of the item. Always ``function_call``. Required. FUNCTION_CALL. - :vartype type: Literal[RealtimeConversationItemType.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: Literal["completed", "incomplete", "in_progress"] - :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 - """ - - id: str - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Literal["realtime.item"] - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - type: Required[Literal[RealtimeConversationItemType.FUNCTION_CALL]] - """The type of the item. Always ``function_call``. Required. FUNCTION_CALL.""" - status: Literal["completed", "incomplete", "in_progress"] - """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 - """The ID of the function call.""" - name: Required[str] - """The name of the function being called. Required.""" - arguments: Required[str] - """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.""" - - -class RealtimeConversationItemFunctionCallOutput(TypedDict, total=False): # pylint: disable=name-too-long - """Realtime function call output item. - - :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: Literal["realtime.item"] - :ivar type: The type of the item. Always ``function_call_output``. Required. - FUNCTION_CALL_OUTPUT. - :vartype type: Literal[RealtimeConversationItemType.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: Literal["completed", "incomplete", "in_progress"] - :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 - """ - - id: str - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Literal["realtime.item"] - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - type: Required[Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT]] - """The type of the item. Always ``function_call_output``. Required. FUNCTION_CALL_OUTPUT.""" - status: Literal["completed", "incomplete", "in_progress"] - """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: Required[str] - """The ID of the function call this output is for. Required.""" - output: Required[str] - """The output of the function call, this is free text and can contain any information or simply be - empty. Required.""" - - -class RealtimeConversationItemMessageAssistant(TypedDict, total=False): - """Realtime assistant message item. - - :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: Literal["realtime.item"] - :ivar type: The type of the item. Always ``message``. Required. Default value is "message". - :vartype type: Literal["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: Literal["completed", "incomplete", "in_progress"] - :ivar role: The role of the message sender. Always ``assistant``. Required. ASSISTANT. - :vartype role: Literal[RealtimeConversationItemMessageType.ASSISTANT] - :ivar content: The content of the message. Required. - :vartype content: list["RealtimeConversationItemMessageAssistantContent"] - """ - - id: str - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Literal["realtime.item"] - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - type: Required[Literal["message"]] - """The type of the item. Always ``message``. Required. Default value is \"message\".""" - status: Literal["completed", "incomplete", "in_progress"] - """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: Required[Literal[RealtimeConversationItemMessageType.ASSISTANT]] - """The role of the message sender. Always ``assistant``. Required. ASSISTANT.""" - content: Required[list["RealtimeConversationItemMessageAssistantContent"]] - """The content of the message. Required.""" - - -class RealtimeConversationItemMessageAssistantContent(TypedDict, total=False): # pylint: disable=name-too-long - """RealtimeConversationItemMessageAssistantContent. - - :ivar type: Is either a Literal["output_text"] type or a Literal["output_audio"] type. - :vartype type: Literal["output_text", "output_audio"] - :ivar text: - :vartype text: str - :ivar audio: - :vartype audio: str - :ivar transcript: - :vartype transcript: str - """ - - type: Literal["output_text", "output_audio"] - """Is either a Literal[\"output_text\"] type or a Literal[\"output_audio\"] type.""" - text: str - audio: str - transcript: str - - -class RealtimeConversationItemMessageSystem(TypedDict, total=False): - """Realtime system message item. - - :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: Literal["realtime.item"] - :ivar type: The type of the item. Always ``message``. Required. Default value is "message". - :vartype type: Literal["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: Literal["completed", "incomplete", "in_progress"] - :ivar role: The role of the message sender. Always ``system``. Required. SYSTEM. - :vartype role: Literal[RealtimeConversationItemMessageType.SYSTEM] - :ivar content: The content of the message. Required. - :vartype content: list["RealtimeConversationItemMessageSystemContent"] - """ - - id: str - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Literal["realtime.item"] - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - type: Required[Literal["message"]] - """The type of the item. Always ``message``. Required. Default value is \"message\".""" - status: Literal["completed", "incomplete", "in_progress"] - """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: Required[Literal[RealtimeConversationItemMessageType.SYSTEM]] - """The role of the message sender. Always ``system``. Required. SYSTEM.""" - content: Required[list["RealtimeConversationItemMessageSystemContent"]] - """The content of the message. Required.""" - - -class RealtimeConversationItemMessageSystemContent(TypedDict, total=False): # pylint: disable=name-too-long - """RealtimeConversationItemMessageSystemContent. - - :ivar type: Default value is "input_text". - :vartype type: Literal["input_text"] - :ivar text: - :vartype text: str - """ - - type: Literal["input_text"] - """Default value is \"input_text\".""" - text: str - - -class RealtimeConversationItemMessageUser(TypedDict, total=False): - """Realtime user message item. - - :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: Literal["realtime.item"] - :ivar type: The type of the item. Always ``message``. Required. Default value is "message". - :vartype type: Literal["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: Literal["completed", "incomplete", "in_progress"] - :ivar role: The role of the message sender. Always ``user``. Required. USER. - :vartype role: Literal[RealtimeConversationItemMessageType.USER] - :ivar content: The content of the message. Required. - :vartype content: list["RealtimeConversationItemMessageUserContent"] - """ - - id: str - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Literal["realtime.item"] - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - type: Required[Literal["message"]] - """The type of the item. Always ``message``. Required. Default value is \"message\".""" - status: Literal["completed", "incomplete", "in_progress"] - """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: Required[Literal[RealtimeConversationItemMessageType.USER]] - """The role of the message sender. Always ``user``. Required. USER.""" - content: Required[list["RealtimeConversationItemMessageUserContent"]] - """The content of the message. Required.""" - - -class RealtimeConversationItemMessageUserContent(TypedDict, total=False): # pylint: disable=name-too-long - """RealtimeConversationItemMessageUserContent. - - :ivar type: Is one of the following types: Literal["input_text"], Literal["input_audio"], - Literal["input_image"] - :vartype type: Literal["input_text", "input_audio", "input_image"] - :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: Literal["auto", "low", "high"] - :ivar transcript: - :vartype transcript: str - """ - - type: Literal["input_text", "input_audio", "input_image"] - """Is one of the following types: Literal[\"input_text\"], Literal[\"input_audio\"], - Literal[\"input_image\"]""" - text: str - audio: str - image_url: str - detail: Literal["auto", "low", "high"] - """Is one of the following types: Literal[\"auto\"], Literal[\"low\"], Literal[\"high\"]""" - transcript: str - - -class RealtimeFunctionTool(TypedDict, total=False): - """Function tool. - - :ivar type: The type of the tool, i.e. ``function``. Default value is "function". - :vartype type: Literal["function"] - :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: "RealtimeFunctionToolParameters" - """ - - type: Literal["function"] - """The type of the tool, i.e. ``function``. Default value is \"function\".""" - name: str - """The name of the function.""" - description: str - """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: "RealtimeFunctionToolParameters" - """Parameters of the function in JSON Schema.""" - - -class RealtimeFunctionToolParameters(TypedDict, total=False): - """RealtimeFunctionToolParameters.""" - - -class RealtimeMCPApprovalRequest(TypedDict, total=False): - """Realtime MCP approval request. - - :ivar type: The type of the item. Always ``mcp_approval_request``. Required. - MCP_APPROVAL_REQUEST. - :vartype type: Literal[RealtimeConversationItemType.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 - """ - - type: Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST]] - """The type of the item. Always ``mcp_approval_request``. Required. MCP_APPROVAL_REQUEST.""" - id: Required[str] - """The unique ID of the approval request. Required.""" - server_label: Required[str] - """The label of the MCP server making the request. Required.""" - name: Required[str] - """The name of the tool to run. Required.""" - arguments: Required[str] - """A JSON string of arguments for the tool. Required.""" - - -class RealtimeMCPApprovalResponse(TypedDict, total=False): - """Realtime MCP approval response. - - :ivar type: The type of the item. Always ``mcp_approval_response``. Required. - MCP_APPROVAL_RESPONSE. - :vartype type: Literal[RealtimeConversationItemType.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 - """ - - type: Required[Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE]] - """The type of the item. Always ``mcp_approval_response``. Required. MCP_APPROVAL_RESPONSE.""" - id: Required[str] - """The unique ID of the approval response. Required.""" - approval_request_id: Required[str] - """The ID of the approval request being answered. Required.""" - approve: Required[bool] - """Whether the request was approved. Required.""" - reason: Optional[str] - - -class RealtimeMCPHTTPError(TypedDict, total=False): - """Realtime MCP HTTP error. - - :ivar type: Required. HTTP_ERROR. - :vartype type: Literal[RealtimeMcpErrorType.HTTP_ERROR] - :ivar code: Required. - :vartype code: int - :ivar message: Required. - :vartype message: str - """ - - type: Required[Literal[RealtimeMcpErrorType.HTTP_ERROR]] - """Required. HTTP_ERROR.""" - code: Required[int] - """Required.""" - message: Required[str] - """Required.""" - - -class RealtimeMCPListTools(TypedDict, total=False): - """Realtime MCP list tools. - - :ivar type: The type of the item. Always ``mcp_list_tools``. Required. MCP_LIST_TOOLS. - :vartype type: Literal[RealtimeConversationItemType.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["MCPListToolsTool"] - """ - - type: Required[Literal[RealtimeConversationItemType.MCP_LIST_TOOLS]] - """The type of the item. Always ``mcp_list_tools``. Required. MCP_LIST_TOOLS.""" - id: str - """The unique ID of the list.""" - server_label: Required[str] - """The label of the MCP server. Required.""" - tools: Required[list["MCPListToolsTool"]] - """The tools available on the server. Required.""" - - -class RealtimeMCPProtocolError(TypedDict, total=False): - """Realtime MCP protocol error. - - :ivar type: Required. PROTOCOL_ERROR. - :vartype type: Literal[RealtimeMcpErrorType.PROTOCOL_ERROR] - :ivar code: Required. - :vartype code: int - :ivar message: Required. - :vartype message: str - """ - - type: Required[Literal[RealtimeMcpErrorType.PROTOCOL_ERROR]] - """Required. PROTOCOL_ERROR.""" - code: Required[int] - """Required.""" - message: Required[str] - """Required.""" - - -class RealtimeMCPToolCall(TypedDict, total=False): - """Realtime MCP tool call. - - :ivar type: The type of the item. Always ``mcp_call``. Required. MCP_CALL. - :vartype type: Literal[RealtimeConversationItemType.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: "RealtimeMCPError" - """ - - type: Required[Literal[RealtimeConversationItemType.MCP_CALL]] - """The type of the item. Always ``mcp_call``. Required. MCP_CALL.""" - id: Required[str] - """The unique ID of the tool call. Required.""" - server_label: Required[str] - """The label of the MCP server running the tool. Required.""" - name: Required[str] - """The name of the tool that was run. Required.""" - arguments: Required[str] - """A JSON string of the arguments passed to the tool. Required.""" - approval_request_id: Optional[str] - output: Optional[str] - error: "RealtimeMCPError" - - -class RealtimeMCPToolExecutionError(TypedDict, total=False): - """Realtime MCP tool execution error. - - :ivar type: Required. TOOL_EXECUTION_ERROR. - :vartype type: Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR] - :ivar message: Required. - :vartype message: str - """ - - type: Required[Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR]] - """Required. TOOL_EXECUTION_ERROR.""" - message: Required[str] - """Required.""" - - -class RealtimeReasoning(TypedDict, total=False): - """Realtime reasoning configuration. - - :ivar effort: Known values are: "minimal", "low", "medium", "high", and "xhigh". - :vartype effort: Union[str, "RealtimeReasoningEffort"] - """ - - effort: Union[str, "RealtimeReasoningEffort"] - """Known values are: \"minimal\", \"low\", \"medium\", \"high\", and \"xhigh\".""" - - -class RealtimeResponseStatusDetails(TypedDict, total=False): - """RealtimeResponseStatusDetails. - - :ivar type: Is one of the following types: Literal["completed"], Literal["cancelled"], - Literal["failed"], Literal["incomplete"] - :vartype type: Literal["completed", "cancelled", "failed", "incomplete"] - :ivar reason: Is one of the following types: Literal["turn_detected"], - Literal["client_cancelled"], Literal["max_output_tokens"], Literal["content_filter"] - :vartype reason: Literal["turn_detected", "client_cancelled", "max_output_tokens", - "content_filter"] - :ivar error: - :vartype error: "RealtimeResponseStatusDetailsError" - """ - - type: Literal["completed", "cancelled", "failed", "incomplete"] - """Is one of the following types: Literal[\"completed\"], Literal[\"cancelled\"], - Literal[\"failed\"], Literal[\"incomplete\"]""" - reason: Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"] - """Is one of the following types: Literal[\"turn_detected\"], Literal[\"client_cancelled\"], - Literal[\"max_output_tokens\"], Literal[\"content_filter\"]""" - error: "RealtimeResponseStatusDetailsError" - - -class RealtimeResponseStatusDetailsError(TypedDict, total=False): - """RealtimeResponseStatusDetailsError. - - :ivar type: - :vartype type: str - :ivar code: - :vartype code: str - """ - - type: str - code: str - - -class RealtimeResponseUsage(TypedDict, total=False): - """RealtimeResponseUsage. - - :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: "RealtimeResponseUsageInputTokenDetails" - :ivar output_token_details: - :vartype output_token_details: "RealtimeResponseUsageOutputTokenDetails" - """ - - total_tokens: int - input_tokens: int - output_tokens: int - input_token_details: "RealtimeResponseUsageInputTokenDetails" - output_token_details: "RealtimeResponseUsageOutputTokenDetails" - - -class RealtimeResponseUsageInputTokenDetails(TypedDict, total=False): - """RealtimeResponseUsageInputTokenDetails. - - :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: "RealtimeResponseUsageInputTokenDetailsCachedTokensDetails" - """ - - cached_tokens: int - text_tokens: int - image_tokens: int - audio_tokens: int - cached_tokens_details: "RealtimeResponseUsageInputTokenDetailsCachedTokensDetails" - - -class RealtimeResponseUsageInputTokenDetailsCachedTokensDetails( - TypedDict, total=False -): # pylint: disable=name-too-long - """RealtimeResponseUsageInputTokenDetailsCachedTokensDetails. - - :ivar text_tokens: - :vartype text_tokens: int - :ivar image_tokens: - :vartype image_tokens: int - :ivar audio_tokens: - :vartype audio_tokens: int - """ - - text_tokens: int - image_tokens: int - audio_tokens: int - - -class RealtimeResponseUsageOutputTokenDetails(TypedDict, total=False): - """RealtimeResponseUsageOutputTokenDetails. - - :ivar text_tokens: - :vartype text_tokens: int - :ivar audio_tokens: - :vartype audio_tokens: int - """ - - text_tokens: int - audio_tokens: int - - -class RealtimeServerEventConversationItemInputAudioTranscriptionFailedError( - TypedDict, total=False -): # pylint: disable=name-too-long - """RealtimeServerEventConversationItemInputAudioTranscriptionFailedError. - - :ivar type: - :vartype type: str - :ivar code: - :vartype code: str - :ivar message: - :vartype message: str - :ivar param: - :vartype param: str - """ - - type: str - code: str - message: str - param: str - - -class RealtimeServerEventError(TypedDict, total=False): - """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 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: Literal["error"] - :ivar error: Details of the error. Required. - :vartype error: "RealtimeServerEventErrorError" - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal["error"]] - """The event type, must be ``error``. Required. Default value is \"error\".""" - error: Required["RealtimeServerEventErrorError"] - """Details of the error. Required.""" - - -class RealtimeServerEventErrorError(TypedDict, total=False): - """RealtimeServerEventErrorError. - - :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 - """ - - type: Required[str] - """Required.""" - code: Optional[str] - message: Required[str] - """Required.""" - param: Optional[str] - event_id: Optional[str] - - -class RealtimeServerEventRateLimitsUpdatedRateLimits(TypedDict, total=False): # pylint: disable=name-too-long - """RealtimeServerEventRateLimitsUpdatedRateLimits. - - :ivar name: Is either a Literal["requests"] type or a Literal["tokens"] type. - :vartype name: Literal["requests", "tokens"] - :ivar limit: - :vartype limit: int - :ivar remaining: - :vartype remaining: int - :ivar reset_seconds: - :vartype reset_seconds: float - """ - - name: Literal["requests", "tokens"] - """Is either a Literal[\"requests\"] type or a Literal[\"tokens\"] type.""" - limit: int - remaining: int - reset_seconds: float - - -class RealtimeServerEventResponseContentPartAdded(TypedDict, total=False): # pylint: disable=name-too-long - """Returned when a new content part is added to an assistant message item 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.content_part.added``. Required. - RESPONSE_CONTENT_PART_ADDED. - :vartype type: Literal[RealtimeServerEventType.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: "RealtimeServerEventResponseContentPartAddedPart" - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED]] - """The event type, must be ``response.content_part.added``. Required. RESPONSE_CONTENT_PART_ADDED.""" - response_id: Required[str] - """The ID of the response. Required.""" - item_id: Required[str] - """The ID of the item to which the content part was added. Required.""" - output_index: Required[int] - """The index of the output item in the response. Required.""" - content_index: Required[int] - """The index of the content part in the item's content array. Required.""" - part: Required["RealtimeServerEventResponseContentPartAddedPart"] - """The content part that was added. Required.""" - - -class RealtimeServerEventResponseContentPartAddedPart(TypedDict, total=False): # pylint: disable=name-too-long - """RealtimeServerEventResponseContentPartAddedPart. - - :ivar type: Is either a Literal["audio"] type or a Literal["text"] type. - :vartype type: Literal["audio", "text"] - :ivar text: - :vartype text: str - :ivar audio: - :vartype audio: str - :ivar transcript: - :vartype transcript: str - """ - - type: Literal["audio", "text"] - """Is either a Literal[\"audio\"] type or a Literal[\"text\"] type.""" - text: str - audio: str - transcript: str - - -class Reasoning(TypedDict, total=False): - """Reasoning. - - :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: Union[str, "ReasoningModeEnum"] - :ivar effort: Known values are: "none", "minimal", "low", "medium", "high", "xhigh", and "max". - :vartype effort: Union[str, "ReasoningEffort"] - :ivar summary: Is one of the following types: Literal["auto"], Literal["concise"], - Literal["detailed"] - :vartype summary: Literal["auto", "concise", "detailed"] - :ivar context: Is one of the following types: Literal["auto"], Literal["current_turn"], - Literal["all_turns"] - :vartype context: Literal["auto", "current_turn", "all_turns"] - :ivar generate_summary: Is one of the following types: Literal["auto"], Literal["concise"], - Literal["detailed"] - :vartype generate_summary: Literal["auto", "concise", "detailed"] - """ - - mode: Union[str, "ReasoningModeEnum"] - """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, "ReasoningEffort"]] - """Known values are: \"none\", \"minimal\", \"low\", \"medium\", \"high\", \"xhigh\", and \"max\".""" - summary: Optional[Literal["auto", "concise", "detailed"]] - """Is one of the following types: Literal[\"auto\"], Literal[\"concise\"], Literal[\"detailed\"]""" - context: Optional[Literal["auto", "current_turn", "all_turns"]] - """Is one of the following types: Literal[\"auto\"], Literal[\"current_turn\"], - Literal[\"all_turns\"]""" - generate_summary: Optional[Literal["auto", "concise", "detailed"]] - """Is one of the following types: Literal[\"auto\"], Literal[\"concise\"], Literal[\"detailed\"]""" - - -class RecurrenceTrigger(TypedDict, total=False): - """Recurrence based trigger. - - :ivar type: Type of the trigger. Required. Recurrence based trigger. - :vartype type: Literal[TriggerType.RECURRENCE] - :ivar start_time: Start time for the recurrence schedule in ISO 8601 format. - :vartype start_time: str - :ivar end_time: End time for the recurrence schedule in ISO 8601 format. - :vartype end_time: str - :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: "RecurrenceSchedule" - """ - - type: Required[Literal[TriggerType.RECURRENCE]] - """Type of the trigger. Required. Recurrence based trigger.""" - startTime: str - """Start time for the recurrence schedule in ISO 8601 format.""" - endTime: str - """End time for the recurrence schedule in ISO 8601 format.""" - timeZone: str - """Time zone for the recurrence schedule. Defaults to ``UTC``.""" - interval: Required[int] - """Interval for the recurrence schedule. Required.""" - schedule: Required["RecurrenceSchedule"] - """Recurrence schedule for the recurrence trigger. Required.""" - - -class RedTeam(TypedDict, total=False): - """Red team details. - - :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[Union[str, "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[Union[str, "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: "RedTeamTargetConfig" - """ - - id: Required[str] - """Identifier of the red team run. Required.""" - displayName: str - """Name of the red-team run.""" - numTurns: int - """Number of simulation rounds.""" - attackStrategies: list[Union[str, "AttackStrategy"]] - """List of attack strategies or nested lists of attack strategies.""" - simulationOnly: bool - """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.""" - riskCategories: list[Union[str, "RiskCategory"]] - """List of risk categories to generate attack objectives for.""" - applicationScenario: str - """Application scenario for the red team operation, to generate scenario specific attacks.""" - tags: dict[str, str] - """Red team's tags. Unlike properties, tags are fully mutable.""" - properties: dict[str, str] - """Red team's properties. Unlike tags, properties are add-only. Once added, a property cannot be - removed.""" - status: str - """Status of the red-team. It is set by service and is read-only.""" - target: Required["RedTeamTargetConfig"] - """Target configuration for the red-team run. Required.""" - - -class ReminderPreviewToolboxTool(TypedDict, total=False): - """A reminder 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, "ToolConfig"] - :ivar type: Required. REMINDER_PREVIEW. - :vartype type: Literal[ToolboxToolType.REMINDER_PREVIEW] - """ - - name: str - """Optional user-defined name for this tool or configuration.""" - description: str - """Optional user-defined description for this tool or configuration.""" - tool_configs: dict[str, "ToolConfig"] - """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.""" - type: Required[Literal[ToolboxToolType.REMINDER_PREVIEW]] - """Required. REMINDER_PREVIEW.""" - - -class ResponsesProtocolConfiguration(TypedDict, total=False): - """Configuration specific to the responses protocol.""" - - -class RubricBasedEvaluatorDefinition(TypedDict, total=False): - """Rubric-based evaluator definition — stores dimensions produced by the generate API. Used for - both quality and safety evaluators. - - :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, "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: Literal[EvaluatorDefinitionType.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["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 - """ - - init_parameters: dict[str, Any] - """The JSON schema (Draft 2020-12) for the evaluator's input parameters. This includes parameters - like type, properties, required.""" - data_schema: dict[str, Any] - """The JSON schema (Draft 2020-12) for the evaluator's input data. This includes parameters like - type, properties, required.""" - metrics: dict[str, "EvaluatorMetric"] - """List of output metrics produced by this evaluator.""" - type: Required[Literal[EvaluatorDefinitionType.RUBRIC]] - """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: Required[list["Dimension"]] - """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: float - """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.""" - - -class RubricGenerationInputQualityWarning(TypedDict, total=False): - """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 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: Union[str, "RubricGenerationInputQualityWarningCode"] - :ivar severity: Advisory severity. Initial values: ``warning``. Required. "warning" - :vartype severity: Union[str, "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: Union[str, "RubricGenerationInputQualityWarningSource"] - :ivar source_index: Zero-based index into ``EvaluatorGenerationJob.inputs.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 - """ - - code: Required[Union[str, "RubricGenerationInputQualityWarningCode"]] - """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: Required[Union[str, "RubricGenerationInputQualityWarningSeverity"]] - """Advisory severity. Initial values: ``warning``. Required. \"warning\"""" - message: Required[str] - """Human-readable message suitable for direct SDK/CLI/UI display. Must not include raw prompt, - instruction, dataset, or trace text. Required.""" - source: Required[Union[str, "RubricGenerationInputQualityWarningSource"]] - """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: int - """Zero-based index into ``EvaluatorGenerationJob.inputs.sources`` when the warning applies to a - specific source. Omitted for aggregate warnings and for warnings not tied to one source.""" - - -class Schedule(TypedDict, total=False): - """Schedule model. - - :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: Union[str, "ScheduleProvisioningStatus"] - :ivar trigger: Trigger for the schedule. Required. - :vartype trigger: "Trigger" - :ivar task: Task for the schedule. Required. - :vartype task: "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] - """ - - id: Required[str] - """Identifier of the schedule. Required.""" - displayName: str - """Name of the schedule.""" - description: str - """Description of the schedule.""" - enabled: Required[bool] - """Enabled status of the schedule. Required.""" - provisioningStatus: Union[str, "ScheduleProvisioningStatus"] - """Provisioning status of the schedule. Known values are: \"Creating\", \"Updating\", - \"Deleting\", \"Succeeded\", and \"Failed\".""" - trigger: Required["Trigger"] - """Trigger for the schedule. Required.""" - task: Required["ScheduleTask"] - """Task for the schedule. Required.""" - tags: dict[str, str] - """Schedule's tags. Unlike properties, tags are fully mutable.""" - properties: dict[str, str] - """Schedule's properties. Unlike tags, properties are add-only. Once added, a property cannot be - removed.""" - systemData: Required[dict[str, str]] - """System metadata for the resource. Required.""" - - -class ScheduleRoutineTrigger(TypedDict, total=False): - """A recurring cron-based routine trigger. - - :ivar type: The trigger type. Required. A recurring cron-based trigger. - :vartype type: Literal[RoutineTriggerType.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: Required[Literal[RoutineTriggerType.SCHEDULE]] - """The trigger type. Required. A recurring cron-based trigger.""" - cron_expression: Required[str] - """A 5-field cron expression. The service enforces a minimum interval of five minutes by default. - Required.""" - time_zone: Required[str] - """An IANA or Windows time zone identifier for the schedule. Required.""" - - -class SessionConfiguration(TypedDict, total=False): - """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. Optional — when unset, the server default of 900 seconds is used. Must be between - 300 and 3600 seconds (inclusive). - :vartype idle_timeout_seconds: str - """ - - idle_timeout_seconds: str - """The idle duration, in seconds, before a session's sandbox is suspended. Optional — when unset, - the server default of 900 seconds is used. Must be between 300 and 3600 seconds (inclusive).""" - - -class SharepointGroundingToolParameters(TypedDict, total=False): - """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["ToolProjectConnection"] - """ - - project_connections: list["ToolProjectConnection"] - """The project connections attached to this tool. There can be a maximum of 1 connection resource - attached to the tool.""" - - -class SharepointPreviewTool(TypedDict, total=False): - """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: Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW] - :ivar sharepoint_grounding_preview: The sharepoint grounding tool parameters. Required. - :vartype sharepoint_grounding_preview: "SharepointGroundingToolParameters" - """ - - type: Required[Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW]] - """The object type, which is always 'sharepoint_grounding_preview'. Required. - SHAREPOINT_GROUNDING_PREVIEW.""" - sharepoint_grounding_preview: Required["SharepointGroundingToolParameters"] - """The sharepoint grounding tool parameters. Required.""" - - -class SimpleQnADataGenerationJobOptions(TypedDict, total=False): - """The options for a data generation job with SimpleQnA type. - - :ivar max_samples: Maximum number of samples to generate. Required. - :vartype max_samples: int - :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: "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: Literal[DataGenerationJobType.SIMPLE_QNA] - :ivar question_types: The question types to generate. Used only for fine-tuning scenarios. - :vartype question_types: list[Union[str, "SimpleQnAFineTuningQuestionType"]] - """ - - max_samples: Required[int] - """Maximum number of samples to generate. Required.""" - train_split: float - """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.""" - model_options: "DataGenerationModelOptions" - """The LLM model options.""" - type: Required[Literal[DataGenerationJobType.SIMPLE_QNA]] - """The data generation job type, which is SimpleQnA for this model. Required. Simple question and - answers between user and agent.""" - question_types: list[Union[str, "SimpleQnAFineTuningQuestionType"]] - """The question types to generate. Used only for fine-tuning scenarios.""" - - -class SimulationSeedDataGenerationJobOptions(TypedDict, total=False): - """The options for a simulation seed 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 max_samples: Maximum number of samples to generate. Required. - :vartype max_samples: int - :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: "DataGenerationModelOptions" - :ivar type: The data generation job type, which is SimulationSeed for this model. Required. - Simulation seed for evaluation scenarios. - :vartype type: Literal[DataGenerationJobType.SIMULATION_SEED] - """ - - max_samples: Required[int] - """Maximum number of samples to generate. Required.""" - train_split: float - """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.""" - model_options: "DataGenerationModelOptions" - """The LLM model options.""" - type: Required[Literal[DataGenerationJobType.SIMULATION_SEED]] - """The data generation job type, which is SimulationSeed for this model. Required. Simulation seed - for evaluation scenarios.""" - - -class SkillInlineContent(TypedDict, total=False): - """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: Required[str] - """A human-readable description of what the skill does and when to use it. Required.""" - instructions: Required[str] - """The skill instructions in markdown format. This is the body content of the SKILL.md file. - Required.""" - license: str - """License name or reference to a bundled license file.""" - compatibility: str - """Environment requirements or compatibility notes for the skill.""" - metadata: dict[str, str] - """Arbitrary key-value metadata for additional properties.""" - allowed_tools: list[str] - """List of pre-approved tools the skill may use. Experimental.""" - - -class SkillReferenceParam(TypedDict, total=False): - """SkillReferenceParam. - - :ivar type: References a skill created with the /v1/skills endpoint. Required. SKILL_REFERENCE. - :vartype type: Literal[ContainerSkillType.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: Required[Literal[ContainerSkillType.SKILL_REFERENCE]] - """References a skill created with the /v1/skills endpoint. Required. SKILL_REFERENCE.""" - skill_id: Required[str] - """The ID of the referenced skill. Required.""" - version: str - """Optional skill version. Use a positive integer or 'latest'. Omit for default.""" - - -class SpecificApplyPatchParam(TypedDict, total=False): - """Specific apply patch tool choice. - - :ivar type: The tool to call. Always ``apply_patch``. Required. APPLY_PATCH. - :vartype type: Literal[ToolChoiceParamType.APPLY_PATCH] - """ - - type: Required[Literal[ToolChoiceParamType.APPLY_PATCH]] - """The tool to call. Always ``apply_patch``. Required. APPLY_PATCH.""" - - -class SpecificFunctionShellParam(TypedDict, total=False): - """Specific shell tool choice. - - :ivar type: The tool to call. Always ``shell``. Required. SHELL. - :vartype type: Literal[ToolChoiceParamType.SHELL] - """ - - type: Required[Literal[ToolChoiceParamType.SHELL]] - """The tool to call. Always ``shell``. Required. SHELL.""" - - -class SpecificProgrammaticToolCallingParam(TypedDict, total=False): - """SpecificProgrammaticToolCallingParam. - - :ivar type: The tool to call. Always ``programmatic_tool_calling``. Required. - PROGRAMMATIC_TOOL_CALLING. - :vartype type: Literal[ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING] - """ - - type: Required[Literal[ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING]] - """The tool to call. Always ``programmatic_tool_calling``. Required. PROGRAMMATIC_TOOL_CALLING.""" - - -class StructuredInputDefinition(TypedDict, total=False): - """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: str - """A human-readable description of the input.""" - default_value: Any - """The default value for the input if no run-time value is provided.""" - schema: dict[str, Any] - """The JSON schema for the structured input (optional).""" - required: bool - """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.""" - - -class StructuredOutputDefinition(TypedDict, total=False): - """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: Required[str] - """The name of the structured output. Required.""" - description: Required[str] - """A description of the output to emit. Used by the model to determine when to emit the output. - Required.""" - schema: Required[dict[str, Any]] - """The JSON schema for the structured output. Required.""" - strict: Required[Optional[bool]] - """Whether to enforce strict validation. Default ``true``. Required.""" - - -class TaxonomyCategory(TypedDict, total=False): - """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: Union[str, "RiskCategory"] - :ivar sub_categories: List of taxonomy sub categories. Required. - :vartype sub_categories: list["TaxonomySubCategory"] - :ivar properties: Additional properties for the taxonomy category. - :vartype properties: dict[str, str] - """ - - id: Required[str] - """Unique identifier of the taxonomy category. Required.""" - name: Required[str] - """Name of the taxonomy category. Required.""" - description: str - """Description of the taxonomy category.""" - riskCategory: Required[Union[str, "RiskCategory"]] - """Risk category associated with this taxonomy category. Required. Known values are: - \"HateUnfairness\", \"Violence\", \"Sexual\", \"SelfHarm\", \"ProtectedMaterial\", - \"CodeVulnerability\", \"UngroundedAttributes\", \"ProhibitedActions\", - \"SensitiveDataLeakage\", and \"TaskAdherence\".""" - subCategories: Required[list["TaxonomySubCategory"]] - """List of taxonomy sub categories. Required.""" - properties: dict[str, str] - """Additional properties for the taxonomy category.""" - - -class TaxonomySubCategory(TypedDict, total=False): - """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: Required[str] - """Unique identifier of the taxonomy sub-category. Required.""" - name: Required[str] - """Name of the taxonomy sub-category. Required.""" - description: str - """Description of the taxonomy sub-category.""" - enabled: Required[bool] - """List of taxonomy items under this sub-category. Required.""" - properties: dict[str, str] - """Additional properties for the taxonomy sub-category.""" - - -class TelemetryConfig(TypedDict, total=False): - """Customer-supplied telemetry configuration for exporting container logs, traces, and metrics. - - :ivar endpoints: Customer-supplied telemetry export endpoint configurations. Required. - :vartype endpoints: list["TelemetryEndpoint"] - """ - - endpoints: Required[list["TelemetryEndpoint"]] - """Customer-supplied telemetry export endpoint configurations. Required.""" - - -class TemplateVoiceGreetingConfig(TypedDict, total=False): - """A deterministic greeting rendered with the voice agent's structured inputs and synthesized - without model-authored generation. - - :ivar type: Required. Default value is "template". - :vartype type: Literal["template"] - :ivar text: The Handlebars text template spoken at session start. Required. - :vartype text: str - """ - - type: Required[Literal["template"]] - """Required. Default value is \"template\".""" - text: Required[str] - """The Handlebars text template spoken at session start. Required.""" - - -class TextResponseFormatJsonObject(TypedDict, total=False): - """JSON object. - - :ivar type: The type of response format being defined. Always ``json_object``. Required. - JSON_OBJECT. - :vartype type: Literal[TextResponseFormatConfigurationType.JSON_OBJECT] - """ - - type: Required[Literal[TextResponseFormatConfigurationType.JSON_OBJECT]] - """The type of response format being defined. Always ``json_object``. Required. JSON_OBJECT.""" - - -class TextResponseFormatJsonSchema(TypedDict, total=False): - """JSON schema. - - :ivar type: The type of response format being defined. Always ``json_schema``. Required. - JSON_SCHEMA. - :vartype type: Literal[TextResponseFormatConfigurationType.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: Required[Literal[TextResponseFormatConfigurationType.JSON_SCHEMA]] - """The type of response format being defined. Always ``json_schema``. Required. JSON_SCHEMA.""" - description: str - """A description of what the response format is for, used by the model to determine how to respond - in the format.""" - name: Required[str] - """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: Required[dict[str, Any]] - """Required.""" - strict: Optional[bool] - - -class TextResponseFormatText(TypedDict, total=False): - """Text. - - :ivar type: The type of response format being defined. Always ``text``. Required. TEXT. - :vartype type: Literal[TextResponseFormatConfigurationType.TEXT] - """ - - type: Required[Literal[TextResponseFormatConfigurationType.TEXT]] - """The type of response format being defined. Always ``text``. Required. TEXT.""" - - -class TimerRoutineTrigger(TypedDict, total=False): - """A one-shot timer routine trigger. - - :ivar type: The trigger type. Required. A one-shot timer trigger. - :vartype type: Literal[RoutineTriggerType.TIMER] - :ivar at: The UTC date and time at which the timer fires. - :vartype at: int - """ - - type: Required[Literal[RoutineTriggerType.TIMER]] - """The trigger type. Required. A one-shot timer trigger.""" - at: int - """The UTC date and time at which the timer fires.""" - - -class ToolboxPolicies(TypedDict, total=False): - """Policy configuration for a toolbox, including content safety and other governance settings. - - :ivar rai_config: Responsible AI content filtering configuration. - :vartype rai_config: "RaiConfig" - """ - - rai_config: "RaiConfig" - """Responsible AI content filtering configuration.""" - - -class ToolboxSearchPreviewToolboxTool(TypedDict, total=False): - """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, "ToolConfig"] - :ivar type: The type of the tool. Always ``toolbox_search_preview``. Required. - TOOLBOX_SEARCH_PREVIEW. - :vartype type: Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW] - """ - - name: str - """Optional user-defined name for this tool or configuration.""" - description: str - """Optional user-defined description for this tool or configuration.""" - tool_configs: dict[str, "ToolConfig"] - """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.""" - type: Required[Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW]] - """The type of the tool. Always ``toolbox_search_preview``. Required. TOOLBOX_SEARCH_PREVIEW.""" - - -class ToolboxSkillReference(TypedDict, total=False): - """A reference to an existing skill to include in a toolbox. - - :ivar type: The type of skill source. Required. Default value is "skill_reference". - :vartype type: Literal["skill_reference"] - :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: Required[Literal["skill_reference"]] - """The type of skill source. Required. Default value is \"skill_reference\".""" - name: Required[str] - """The name of the skill. Required.""" - version: str - """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.""" - - -class ToolChoiceAllowed(TypedDict, total=False): - """Allowed tools. - - :ivar type: Allowed tool configuration type. Always ``allowed_tools``. Required. ALLOWED_TOOLS. - :vartype type: Literal[ToolChoiceParamType.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: Literal["auto", "required"] - :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: Required[Literal[ToolChoiceParamType.ALLOWED_TOOLS]] - """Allowed tool configuration type. Always ``allowed_tools``. Required. ALLOWED_TOOLS.""" - mode: Required[Literal["auto", "required"]] - """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: Required[list[dict[str, Any]]] - """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\" } - ]""" - - -class ToolChoiceCodeInterpreter(TypedDict, total=False): - """Indicates that the model should use a built-in tool to generate a response. `Learn more about - built-in tools `_. - - :ivar type: Required. CODE_INTERPRETER. - :vartype type: Literal[ToolChoiceParamType.CODE_INTERPRETER] - """ - - type: Required[Literal[ToolChoiceParamType.CODE_INTERPRETER]] - """Required. CODE_INTERPRETER.""" - - -class ToolChoiceComputer(TypedDict, total=False): - """Indicates that the model should use a built-in tool to generate a response. `Learn more about - built-in tools `_. - - :ivar type: Required. COMPUTER. - :vartype type: Literal[ToolChoiceParamType.COMPUTER] - """ - - type: Required[Literal[ToolChoiceParamType.COMPUTER]] - """Required. COMPUTER.""" - - -class ToolChoiceComputerUse(TypedDict, total=False): - """Indicates that the model should use a built-in tool to generate a response. `Learn more about - built-in tools `_. - - :ivar type: Required. COMPUTER_USE. - :vartype type: Literal[ToolChoiceParamType.COMPUTER_USE] - """ - - type: Required[Literal[ToolChoiceParamType.COMPUTER_USE]] - """Required. COMPUTER_USE.""" - - -class ToolChoiceComputerUsePreview(TypedDict, total=False): - """Indicates that the model should use a built-in tool to generate a response. `Learn more about - built-in tools `_. - - :ivar type: Required. COMPUTER_USE_PREVIEW. - :vartype type: Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW] - """ - - type: Required[Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW]] - """Required. COMPUTER_USE_PREVIEW.""" - - -class ToolChoiceCustom(TypedDict, total=False): - """Custom tool. - - :ivar type: For custom tool calling, the type is always ``custom``. Required. CUSTOM. - :vartype type: Literal[ToolChoiceParamType.CUSTOM] - :ivar name: The name of the custom tool to call. Required. - :vartype name: str - """ - - type: Required[Literal[ToolChoiceParamType.CUSTOM]] - """For custom tool calling, the type is always ``custom``. Required. CUSTOM.""" - name: Required[str] - """The name of the custom tool to call. Required.""" - - -class ToolChoiceFileSearch(TypedDict, total=False): - """Indicates that the model should use a built-in tool to generate a response. `Learn more about - built-in tools `_. - - :ivar type: Required. FILE_SEARCH. - :vartype type: Literal[ToolChoiceParamType.FILE_SEARCH] - """ - - type: Required[Literal[ToolChoiceParamType.FILE_SEARCH]] - """Required. FILE_SEARCH.""" - - -class ToolChoiceFunction(TypedDict, total=False): - """Function tool. - - :ivar type: For function calling, the type is always ``function``. Required. FUNCTION. - :vartype type: Literal[ToolChoiceParamType.FUNCTION] - :ivar name: The name of the function to call. Required. - :vartype name: str - """ - - type: Required[Literal[ToolChoiceParamType.FUNCTION]] - """For function calling, the type is always ``function``. Required. FUNCTION.""" - name: Required[str] - """The name of the function to call. Required.""" - - -class ToolChoiceImageGeneration(TypedDict, total=False): - """Indicates that the model should use a built-in tool to generate a response. `Learn more about - built-in tools `_. - - :ivar type: Required. IMAGE_GENERATION. - :vartype type: Literal[ToolChoiceParamType.IMAGE_GENERATION] - """ - - type: Required[Literal[ToolChoiceParamType.IMAGE_GENERATION]] - """Required. IMAGE_GENERATION.""" - - -class ToolChoiceMCP(TypedDict, total=False): - """MCP tool. - - :ivar type: For MCP tools, the type is always ``mcp``. Required. MCP. - :vartype type: Literal[ToolChoiceParamType.MCP] - :ivar server_label: The label of the MCP server to use. Required. - :vartype server_label: str - :ivar name: - :vartype name: str - """ - - type: Required[Literal[ToolChoiceParamType.MCP]] - """For MCP tools, the type is always ``mcp``. Required. MCP.""" - server_label: Required[str] - """The label of the MCP server to use. Required.""" - name: Optional[str] - - -class ToolChoiceWebSearchPreview(TypedDict, total=False): - """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: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW] - """ - - type: Required[Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW]] - """Required. WEB_SEARCH_PREVIEW.""" - - -class ToolChoiceWebSearchPreview20250311(TypedDict, total=False): - """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: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11] - """ - - type: Required[Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11]] - """Required. WEB_SEARCH_PREVIEW_2025_03_11.""" - - -class ToolConfig(TypedDict, total=False): - """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: bool - """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: str - """Additional text indexed for tool_search. Supplements the native tool description to improve - discoverability. Does not alter ``tools/list`` output.""" - - -class ToolDescription(TypedDict, total=False): - """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: str - """The name of the tool.""" - description: str - """A brief description of the tool's purpose.""" - - -class ToolProjectConnection(TypedDict, total=False): - """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: Required[str] - """A project connection in a ToolProjectConnectionList attached to this tool. Required.""" - - -class ToolSearchToolboxTool(TypedDict, total=False): - """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, "ToolConfig"] - :ivar type: The type of the tool. Always ``toolbox_search``. Required. TOOLBOX_SEARCH. - :vartype type: Literal[ToolboxToolType.TOOLBOX_SEARCH] - """ - - name: str - """Optional user-defined name for this tool or configuration.""" - description: str - """Optional user-defined description for this tool or configuration.""" - tool_configs: dict[str, "ToolConfig"] - """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.""" - type: Required[Literal[ToolboxToolType.TOOLBOX_SEARCH]] - """The type of the tool. Always ``toolbox_search``. Required. TOOLBOX_SEARCH.""" - - -class ToolSearchToolParam(TypedDict, total=False): - """Tool search tool. - - :ivar type: The type of the tool. Always ``tool_search``. Required. TOOL_SEARCH. - :vartype type: Literal[ToolType.TOOL_SEARCH] - :ivar execution: Whether tool search is executed by the server or by the client. Known values - are: "server" and "client". - :vartype execution: Union[str, "ToolSearchExecutionType"] - :ivar description: - :vartype description: str - :ivar parameters: - :vartype parameters: "EmptyModelParam" - """ - - type: Required[Literal[ToolType.TOOL_SEARCH]] - """The type of the tool. Always ``tool_search``. Required. TOOL_SEARCH.""" - execution: Union[str, "ToolSearchExecutionType"] - """Whether tool search is executed by the server or by the client. Known values are: \"server\" - and \"client\".""" - description: Optional[str] - parameters: Optional["EmptyModelParam"] - - -class ToolUseFineTuningDataGenerationJobOptions(TypedDict, total=False): # pylint: disable=name-too-long - """The options for a data generation job with ToolUse type. Used only for fine-tuning scenarios. - - :ivar max_samples: Maximum number of samples to generate. Required. - :vartype max_samples: int - :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: "DataGenerationModelOptions" - :ivar type: The data generation job type, which is ToolUse for this model. Required. Tool - calling conversation between user and agent. - :vartype type: Literal[DataGenerationJobType.TOOL_USE] - """ - - max_samples: Required[int] - """Maximum number of samples to generate. Required.""" - train_split: float - """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.""" - model_options: "DataGenerationModelOptions" - """The LLM model options.""" - type: Required[Literal[DataGenerationJobType.TOOL_USE]] - """The data generation job type, which is ToolUse for this model. Required. Tool calling - conversation between user and agent.""" - - -class TracesDataGenerationJobOptions(TypedDict, total=False): - """The options for a data generation job with Traces type. - - :ivar max_samples: Maximum number of samples to generate. Required. - :vartype max_samples: int - :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: "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: Literal[DataGenerationJobType.TRACES] - :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 - """ - - max_samples: Required[int] - """Maximum number of samples to generate. Required.""" - train_split: float - """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.""" - model_options: "DataGenerationModelOptions" - """The LLM model options.""" - type: Required[Literal[DataGenerationJobType.TRACES]] - """The data generation job type, which is Traces for this model. Required. Single turn query and - response from agent traces.""" - redact_private_content: bool - """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.""" - - -class TracesDataGenerationJobSource(TypedDict, total=False): - """Traces source for data generation jobs — conversation traces from Application Insights. - - :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: Literal[DataGenerationJobSourceType.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: int - :ivar end_time: End of the time window (Unix timestamp in seconds). Defaults to current time. - :vartype end_time: int - """ - - description: str - """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: Required[Literal[DataGenerationJobSourceType.TRACES]] - """The source type for this source, which is Traces. Required. Traces source — conversation traces - from Application Insights.""" - agent_id: str - """The unique agent ID used to filter traces. Provide either ``agent_id`` or ``agent_name`` — at - least one is required.""" - agent_name: str - """The agent name to fetch traces for. Provide either ``agent_id`` or ``agent_name`` — at least - one is required.""" - agent_version: str - """The agent version. If not specified, traces for ALL versions of the agent are included within - the time window.""" - start_time: Required[int] - """Start of the time window (Unix timestamp in seconds) for fetching traces. Required.""" - end_time: int - """End of the time window (Unix timestamp in seconds). Defaults to current time.""" - - -class TracesEvaluatorGenerationJobSource(TypedDict, total=False): - """Traces source for evaluator generation jobs — conversation traces from Application Insights. - - :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: Literal[EvaluatorGenerationJobSourceType.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: int - :ivar end_time: End of the time window (Unix timestamp in seconds). Defaults to current time. - :vartype end_time: int - """ - - description: str - """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: Required[Literal[EvaluatorGenerationJobSourceType.TRACES]] - """The source type for this source, which is Traces. Required. Traces source — conversation traces - from Application Insights.""" - agent_id: str - """The unique agent ID used to filter traces. Provide either ``agent_id`` or ``agent_name`` — at - least one is required.""" - agent_name: str - """The agent name to fetch traces for. Provide either ``agent_id`` or ``agent_name`` — at least - one is required.""" - agent_version: str - """The agent version. If not specified, traces for ALL versions of the agent are included within - the time window.""" - start_time: Required[int] - """Start of the time window (Unix timestamp in seconds) for fetching traces. Required.""" - end_time: int - """End of the time window (Unix timestamp in seconds). Defaults to current time.""" - - -class TranscriptTextUsageDuration(TypedDict, total=False): - """Duration Usage. - - :ivar type: The type of the usage object. Always ``duration`` for this variant. Required. - DURATION. - :vartype type: Literal[CreateTranscriptionResponseJsonUsageType.DURATION] - :ivar seconds: Duration of the input audio in seconds. Required. - :vartype seconds: str - """ - - type: Required[Literal[CreateTranscriptionResponseJsonUsageType.DURATION]] - """The type of the usage object. Always ``duration`` for this variant. Required. DURATION.""" - seconds: Required[str] - """Duration of the input audio in seconds. Required.""" - - -class TranscriptTextUsageTokens(TypedDict, total=False): - """Token Usage. - - :ivar type: The type of the usage object. Always ``tokens`` for this variant. Required. TOKENS. - :vartype type: Literal[CreateTranscriptionResponseJsonUsageType.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: "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: Required[Literal[CreateTranscriptionResponseJsonUsageType.TOKENS]] - """The type of the usage object. Always ``tokens`` for this variant. Required. TOKENS.""" - input_tokens: Required[int] - """Number of input tokens billed for this request. Required.""" - input_token_details: "TranscriptTextUsageTokensInputTokenDetails" - """Details about the input tokens billed for this request.""" - output_tokens: Required[int] - """Number of output tokens generated. Required.""" - total_tokens: Required[int] - """Total number of tokens used (input + output). Required.""" - - -class TranscriptTextUsageTokensInputTokenDetails(TypedDict, total=False): # pylint: disable=name-too-long - """TranscriptTextUsageTokensInputTokenDetails. - - :ivar text_tokens: - :vartype text_tokens: int - :ivar audio_tokens: - :vartype audio_tokens: int - """ - - text_tokens: int - audio_tokens: int - - -class UpdateModelVersionRequest(TypedDict, total=False): - """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: str - """The asset description text.""" - tags: dict[str, str] - """Tag dictionary. Tags can be added, removed, and updated.""" - - -class UpdateToolboxRequest(TypedDict, total=False): - """UpdateToolboxRequest. - - :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 - """ - - default_version: Required[str] - """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.""" - - -class VersionRefIndicator(TypedDict, total=False): - """Version indicator that references a specific agent version by name. - - :ivar type: Discriminator value for version_ref. Required. Direct reference to a specific agent - version. - :vartype type: Literal[VersionIndicatorType.VERSION_REF] - :ivar agent_version: The agent version identifier returned by the agent version APIs. Required. - :vartype agent_version: str - """ - - type: Required[Literal[VersionIndicatorType.VERSION_REF]] - """Discriminator value for version_ref. Required. Direct reference to a specific agent version.""" - agent_version: Required[str] - """The agent version identifier returned by the agent version APIs. Required.""" - - -class VersionSelector(TypedDict, total=False): - """VersionSelector. - - :ivar version_selection_rules: Required. - :vartype version_selection_rules: list["VersionSelectionRule"] - """ - - version_selection_rules: Required[list["VersionSelectionRule"]] - """Required.""" - - -class VoiceAgentAnimationConfig(TypedDict, total=False): - """Animation settings for a voice-agent session. - - :ivar model_name: The animation model name. - :vartype model_name: str - :ivar outputs: The requested animation output kinds. - :vartype outputs: list[Union[str, "VoiceAgentAnimationOutputType"]] - """ - - model_name: str - """The animation model name.""" - outputs: list[Union[str, "VoiceAgentAnimationOutputType"]] - """The requested animation output kinds.""" - - -class VoiceAgentAvatarIceServer(TypedDict, total=False): - """An ICE server used for avatar WebRTC negotiation. - - :ivar urls: Required. - :vartype urls: list[str] - :ivar username: - :vartype username: str - :ivar credential: - :vartype credential: str - """ - - urls: Required[list[str]] - """Required.""" - username: Optional[str] - credential: Optional[str] - - -class VoiceAgentAvatarScene(TypedDict, total=False): - """Avatar placement and motion settings. - - :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 - """ - - zoom: float - position_x: float - position_y: float - rotation_x: float - rotation_y: float - rotation_z: float - amplitude: float - - -class VoiceAgentAvatarVideoBackground(TypedDict, total=False): - """The avatar video background. - - :ivar image_url: - :vartype image_url: str - :ivar color: - :vartype color: str - """ - - image_url: str - color: str - - -class VoiceAgentAvatarVideoCrop(TypedDict, total=False): - """The rectangular crop applied to avatar video. - - :ivar bottom_right: Required. - :vartype bottom_right: list[int] - :ivar top_left: Required. - :vartype top_left: list[int] - """ - - bottom_right: Required[list[int]] - """Required.""" - top_left: Required[list[int]] - """Required.""" - - -class VoiceAgentAvatarVideoParams(TypedDict, total=False): - """Avatar video encoder and presentation settings. - - :ivar bitrate: - :vartype bitrate: int - :ivar crop: - :vartype crop: "VoiceAgentAvatarVideoCrop" - :ivar resolution: - :vartype resolution: "VoiceAgentAvatarVideoResolution" - :ivar background: - :vartype background: "VoiceAgentAvatarVideoBackground" - :ivar gop_size: - :vartype gop_size: int - """ - - bitrate: int - crop: "VoiceAgentAvatarVideoCrop" - resolution: "VoiceAgentAvatarVideoResolution" - background: "VoiceAgentAvatarVideoBackground" - gop_size: int - - -class VoiceAgentAvatarVideoResolution(TypedDict, total=False): - """The avatar video resolution. - - :ivar width: Required. - :vartype width: int - :ivar height: Required. - :vartype height: int - """ - - width: Required[int] - """Required.""" - height: Required[int] - """Required.""" - - -class VoiceAgentClientEventConversationItemCreate(TypedDict, total=False): # pylint: disable=name-too-long - """The ``conversation.item.create`` client event. - - :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: Literal[RealtimeClientEventType.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: The conversation item to create. Required. Is one of the following types: - VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, - VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem - :vartype item: "_unions.VoiceConversationItem" - """ - - event_id: str - """Optional client-generated ID used to identify this event.""" - type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE]] - """The event type, must be ``conversation.item.create``. Required. CONVERSATION_ITEM_CREATE.""" - previous_item_id: str - """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: Required["_unions.VoiceConversationItem"] - """The conversation item to create. Required. Is one of the following types: - VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, - VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem""" - - -class VoiceAgentClientEventConversationItemDelete(TypedDict, total=False): # pylint: disable=name-too-long - """The ``conversation.item.delete`` client event. - - :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: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE] - :ivar item_id: The ID of the item to delete. Required. - :vartype item_id: str - """ - - event_id: str - """Optional client-generated ID used to identify this event.""" - type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE]] - """The event type, must be ``conversation.item.delete``. Required. CONVERSATION_ITEM_DELETE.""" - item_id: Required[str] - """The ID of the item to delete. Required.""" - - -class VoiceAgentClientEventConversationItemRetrieve(TypedDict, total=False): # pylint: disable=name-too-long - """The ``conversation.item.retrieve`` client event. - - :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: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE] - :ivar item_id: The ID of the item to retrieve. Required. - :vartype item_id: str - """ - - event_id: str - """Optional client-generated ID used to identify this event.""" - type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE]] - """The event type, must be ``conversation.item.retrieve``. Required. CONVERSATION_ITEM_RETRIEVE.""" - item_id: Required[str] - """The ID of the item to retrieve. Required.""" - - -class VoiceAgentClientEventConversationItemTruncate(TypedDict, total=False): # pylint: disable=name-too-long - """The ``conversation.item.truncate`` client event. - - :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: Literal[RealtimeClientEventType.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 - """Optional client-generated ID used to identify this event.""" - type: Required[Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE]] - """The event type, must be ``conversation.item.truncate``. Required. CONVERSATION_ITEM_TRUNCATE.""" - item_id: Required[str] - """The ID of the assistant message item to truncate. Only assistant message items can be - truncated. Required.""" - content_index: Required[int] - """The index of the content part to truncate. Set this to ``0``. Required.""" - audio_end_ms: Required[int] - """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.""" - - -class VoiceAgentClientEventInputAudioBufferAppend(TypedDict, total=False): # pylint: disable=name-too-long - """The ``input_audio_buffer.append`` client event. - - :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: Literal[RealtimeClientEventType.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 - """Optional client-generated ID used to identify this event.""" - type: Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND]] - """The event type, must be ``input_audio_buffer.append``. Required. INPUT_AUDIO_BUFFER_APPEND.""" - audio: Required[str] - """Base64-encoded audio bytes. This must be in the format specified by the ``input_audio_format`` - field in the session configuration. Required.""" - - -class VoiceAgentClientEventInputAudioBufferClear(TypedDict, total=False): # pylint: disable=name-too-long - """The ``input_audio_buffer.clear`` client event. - - :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: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR] - """ - - event_id: str - """Optional client-generated ID used to identify this event.""" - type: Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR]] - """The event type, must be ``input_audio_buffer.clear``. Required. INPUT_AUDIO_BUFFER_CLEAR.""" - - -class VoiceAgentClientEventInputAudioBufferCommit(TypedDict, total=False): # pylint: disable=name-too-long - """The ``input_audio_buffer.commit`` client event. - - :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: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT] - """ - - event_id: str - """Optional client-generated ID used to identify this event.""" - type: Required[Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT]] - """The event type, must be ``input_audio_buffer.commit``. Required. INPUT_AUDIO_BUFFER_COMMIT.""" - - -class VoiceAgentClientEventOutputAudioBufferClear(TypedDict, total=False): # pylint: disable=name-too-long - """The ``output_audio_buffer.clear`` client event. - - :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: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR] - """ - - event_id: str - """The unique ID of the client event used for error handling.""" - type: Required[Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR]] - """The event type, must be ``output_audio_buffer.clear``. Required. OUTPUT_AUDIO_BUFFER_CLEAR.""" - - -class VoiceAgentClientEventResponseCancel(TypedDict, total=False): - """The ``response.cancel`` client event. - - :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: Literal[RealtimeClientEventType.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 - """Optional client-generated ID used to identify this event.""" - type: Required[Literal[RealtimeClientEventType.RESPONSE_CANCEL]] - """The event type, must be ``response.cancel``. Required. RESPONSE_CANCEL.""" - response_id: str - """A specific response ID to cancel - if not provided, will cancel an in-progress response in the - default conversation.""" - - -class VoiceAgentClientEventResponseCreate(TypedDict, total=False): - """The ``response.create`` client event. - - :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: Literal[RealtimeClientEventType.RESPONSE_CREATE] - :ivar response: Parameters for the new response. - :vartype response: "VoiceAgentResponseCreateParams" - """ - - event_id: str - """Optional client-generated ID used to identify this event.""" - type: Required[Literal[RealtimeClientEventType.RESPONSE_CREATE]] - """The event type, must be ``response.create``. Required. RESPONSE_CREATE.""" - response: "VoiceAgentResponseCreateParams" - """Parameters for the new response.""" - - -class VoiceAgentClientEventSessionAvatarConnect(TypedDict, total=False): # pylint: disable=name-too-long - """The ``session.avatar.connect`` client event. - - :ivar type: The event type. Always ``session.avatar.connect``. Required. Default value is - "session.avatar.connect". - :vartype type: Literal["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 - """ - - type: Required[Literal["session.avatar.connect"]] - """The event type. Always ``session.avatar.connect``. Required. Default value is - \"session.avatar.connect\".""" - event_id: str - """An optional client-generated event identifier.""" - client_sdp: Required[str] - """The client's SDP offer for avatar media negotiation. Required.""" - - -class VoiceAgentClientEventSessionUpdate(TypedDict, total=False): - """The ``session.update`` client event. - - :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: Literal[RealtimeClientEventType.SESSION_UPDATE] - :ivar session: The stable realtime session fields to update. Required. - :vartype session: "VoiceAgentSessionUpdateConfig" - """ - - event_id: str - """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: Required[Literal[RealtimeClientEventType.SESSION_UPDATE]] - """The event type, must be ``session.update``. Required. SESSION_UPDATE.""" - session: Required["VoiceAgentSessionUpdateConfig"] - """The stable realtime session fields to update. Required.""" - - -class VoiceAgentDefinition(TypedDict, total=False): - """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 rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. - :vartype rai_config: "RaiConfig" - :ivar kind: The kind discriminator for a voice agent definition. Always ``voice``. Required. - VOICE. - :vartype kind: Literal[AgentKind.VOICE] - :ivar model_type: How the model backing this agent is served. Together with ``model``, this - selects the model up front. ``managed`` uses a service-managed model; ``self_deployed`` uses - the customer's own Foundry deployment. This is independent of the architecture (realtime or - cascaded), which the service derives from the selected model. Required. Known values are: - "managed" and "self_deployed". - :vartype model_type: Union[str, "VoiceModelType"] - :ivar model: The model to use for this agent, paired with ``model_type``: the service-managed - model name when ``model_type`` is ``managed``, or the customer's Foundry deployment name when - ``model_type`` is ``self_deployed``. The model must support realtime or cascaded voice. The - service derives the architecture from the selected model. Required. - :vartype model: str - :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: "VoiceGreetingConfig" - :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: "VoiceAudioConfig" - :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[Union[str, "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: "_unions.VoiceAgentMaxOutputTokens" - :ivar include: Additional fields to include in service outputs. - :vartype include: list[Union[str, "VoiceAgentSessionIncludeOption"]] - :ivar interim_response: Interim-response settings for latency and tool execution. Is either a - VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. - :vartype interim_response: "_unions.VoiceAgentInterimResponse" - :ivar avatar: Optional avatar configuration. These values are session defaults and may be - overridden when connecting. - :vartype avatar: "VoiceAvatarConfig" - :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["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: "_unions.VoiceAgentToolChoice" - :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, "StructuredInputDefinition"] - :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 - """ - - rai_config: "RaiConfig" - """Configuration for Responsible AI (RAI) content filtering and safety features.""" - kind: Required[Literal[AgentKind.VOICE]] - """The kind discriminator for a voice agent definition. Always ``voice``. Required. VOICE.""" - model_type: Required[Union[str, "VoiceModelType"]] - """How the model backing this agent is served. Together with ``model``, this selects the model up - front. ``managed`` uses a service-managed model; ``self_deployed`` uses the customer's own - Foundry deployment. This is independent of the architecture (realtime or cascaded), which the - service derives from the selected model. Required. Known values are: \"managed\" and - \"self_deployed\".""" - model: Required[str] - """The model to use for this agent, paired with ``model_type``: the service-managed model name - when ``model_type`` is ``managed``, or the customer's Foundry deployment name when - ``model_type`` is ``self_deployed``. The model must support realtime or cascaded voice. The - service derives the architecture from the selected model. Required.""" - instructions: str - """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: "VoiceGreetingConfig" - """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: "VoiceAudioConfig" - """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: list[Union[str, "VoiceOutputModality"]] - """The output modalities the agent produces. Defaults to ``[\"audio\"]``. ``animation`` and - ``avatar`` are available when an avatar is configured.""" - max_output_tokens: "_unions.VoiceAgentMaxOutputTokens" - """The maximum output-token count for one response. Is either a int type or a Literal[\"inf\"] - type.""" - include: list[Union[str, "VoiceAgentSessionIncludeOption"]] - """Additional fields to include in service outputs.""" - interim_response: "_unions.VoiceAgentInterimResponse" - """Interim-response settings for latency and tool execution. Is either a - VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type.""" - avatar: "VoiceAvatarConfig" - """Optional avatar configuration. These values are session defaults and may be overridden when - connecting.""" - tools: list["VoiceAgentTool"] - """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: "_unions.VoiceAgentToolChoice" - """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: bool - """Whether the model may call multiple tools in parallel.""" - structured_inputs: dict[str, "StructuredInputDefinition"] - """Set of structured inputs that participate in prompt template substitution, rendered per session - before the live session starts.""" - store: bool - """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.""" - - -class VoiceAgentEchoCancellation(TypedDict, total=False): - """Server-side echo cancellation settings for input audio. - - :ivar type: The echo cancellation implementation. Always ``server_echo_cancellation``. - Required. Default value is "server_echo_cancellation". - :vartype type: Literal["server_echo_cancellation"] - :ivar reference_source: Whether reference audio comes from server playback or a client-provided - channel. Known values are: "server" and "client". - :vartype reference_source: Union[str, "VoiceAgentEchoCancellationReferenceSource"] - :ivar channels: The number of input channels. Use two interleaved channels when - ``reference_source`` is ``client``. - :vartype channels: int - """ - - type: Required[Literal["server_echo_cancellation"]] - """The echo cancellation implementation. Always ``server_echo_cancellation``. Required. Default - value is \"server_echo_cancellation\".""" - reference_source: Union[str, "VoiceAgentEchoCancellationReferenceSource"] - """Whether reference audio comes from server playback or a client-provided channel. Known values - are: \"server\" and \"client\".""" - channels: int - """The number of input channels. Use two interleaved channels when ``reference_source`` is - ``client``.""" - - -class VoiceAgentFunctionTool(TypedDict, total=False): - """A native function tool executed by the client. - - :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: "RealtimeFunctionToolParameters" - :ivar type: Required. Default value is "function". - :vartype type: Literal["function"] - :ivar name: The function name. Required. - :vartype name: str - """ - - description: str - """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: "RealtimeFunctionToolParameters" - """Parameters of the function in JSON Schema.""" - type: Required[Literal["function"]] - """Required. Default value is \"function\".""" - name: Required[str] - """The function name. Required.""" - - -class VoiceAgentLlmInterimResponseConfig(TypedDict, total=False): - """An interim response generated by a language model. - - :ivar triggers: Conditions that may trigger one interim response. - :vartype triggers: list[Union[str, "VoiceAgentInterimResponseTrigger"]] - :ivar latency_threshold_ms: The latency threshold in milliseconds. - :vartype latency_threshold_ms: str - :ivar type: Required. Default value is "llm_interim_response". - :vartype type: Literal["llm_interim_response"] - :ivar model: The model used to generate interim responses. - :vartype model: str - :ivar instructions: Optional instructions for generating interim responses. - :vartype instructions: str - :ivar max_completion_tokens: The maximum completion-token count for an interim response. - :vartype max_completion_tokens: int - """ - - triggers: list[Union[str, "VoiceAgentInterimResponseTrigger"]] - """Conditions that may trigger one interim response.""" - latency_threshold_ms: str - """The latency threshold in milliseconds.""" - type: Required[Literal["llm_interim_response"]] - """Required. Default value is \"llm_interim_response\".""" - model: str - """The model used to generate interim responses.""" - instructions: str - """Optional instructions for generating interim responses.""" - max_completion_tokens: int - """The maximum completion-token count for an interim response.""" - - -class VoiceAgentMcpTool(TypedDict, total=False): - """An MCP tool available to a voice agent. - - :ivar server_label: A label for this MCP server, used to identify it in tool calls. Required. - :vartype server_label: 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: Union[list[str], "MCPToolFilter"] - :ivar allowed_callers: - :vartype allowed_callers: list[Union[str, "CallableToolAllowedCaller"]] - :ivar require_approval: Is one of the following types: MCPToolRequireApproval, - Literal["always"], Literal["never"] - :vartype require_approval: Union["MCPToolRequireApproval", Literal["always"], Literal["never"]] - :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, "ToolConfig"] - :ivar type: Required. Default value is "mcp". - :vartype type: Literal["mcp"] - :ivar server_url: The URL for the MCP server. - :vartype server_url: str - :ivar response_scheduling: When the MCP invocation creates a follow-up response. Defaults to - ``when_idle``. Known values are: "silent", "when_idle", "interrupt", and "skip_if_busy". - :vartype response_scheduling: Union[str, "VoiceAgentToolResponseScheduling"] - """ - - server_label: Required[str] - """A label for this MCP server, used to identify it in tool calls. Required.""" - authorization: str - """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: str - """Optional description of the MCP server, used to provide more context.""" - headers: Optional[dict[str, str]] - allowed_tools: Optional[Union[list[str], "MCPToolFilter"]] - """Is either a [str] type or a MCPToolFilter type.""" - allowed_callers: Optional[list[Union[str, "CallableToolAllowedCaller"]]] - require_approval: Optional[Union["MCPToolRequireApproval", Literal["always"], Literal["never"]]] - """Is one of the following types: MCPToolRequireApproval, Literal[\"always\"], Literal[\"never\"]""" - defer_loading: bool - """Whether this MCP tool is deferred and discovered via tool search.""" - project_connection_id: str - """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: dict[str, "ToolConfig"] - """Deprecated. This property is deprecated and will be removed in a future version.""" - type: Required[Literal["mcp"]] - """Required. Default value is \"mcp\".""" - server_url: str - """The URL for the MCP server.""" - response_scheduling: Union[str, "VoiceAgentToolResponseScheduling"] - """When the MCP invocation creates a follow-up response. Defaults to ``when_idle``. Known values - are: \"silent\", \"when_idle\", \"interrupt\", and \"skip_if_busy\".""" - - -class VoiceAgentRealtimeResponse(OmitPropertiesRealtimeResponse1): - """A live realtime response returned by the voice-agent service in both ``response.created`` and - ``response.done`` events. - - :ivar id: The unique ID of the response, will look like ``resp_1234``. - :vartype id: str - :ivar object: The object type, must be ``realtime.response``. Default value is - "realtime.response". - :vartype object: Literal["realtime.response"] - :ivar status: The final status of the response (``completed``, ``cancelled``, ``failed``, or - ``incomplete``, ``in_progress``). Is one of the following types: Literal["completed"], - Literal["cancelled"], Literal["failed"], Literal["incomplete"], Literal["in_progress"] - :vartype status: Literal["completed", "cancelled", "failed", "incomplete", "in_progress"] - :ivar status_details: Additional details about the status. - :vartype status_details: "RealtimeResponseStatusDetails" - :ivar metadata: - :vartype metadata: "Metadata" - :ivar usage: Usage statistics for the Response, this will correspond to billing. A Realtime API - session will maintain a conversation context and append new Items to the Conversation, thus - output from previous turns (text and audio tokens) will become the input for later turns. - :vartype usage: "RealtimeResponseUsage" - :ivar conversation_id: Which conversation the response is added to, determined by the - ``conversation`` field in the ``response.create`` event. If ``auto``, the response will be - added to the default conversation and the value of ``conversation_id`` will be an id like - ``conv_1234``. If ``none``, the response will not be added to any conversation and the value of - ``conversation_id`` will be ``null``. If responses are being triggered automatically by VAD the - response will be added to the default conversation. - :vartype conversation_id: str - :ivar output_modalities: The set of modalities the model used to respond, currently the only - possible values are ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text - transcript. Setting the output to mode ``text`` will disable audio output from the model. - :vartype output_modalities: list[Literal["text", "audio"]] - :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, - inclusive of tool calls, that was used in this response. Is either a int type or a - Literal["inf"] type. - :vartype max_output_tokens: Union[int, Literal["inf"]] - :ivar audio: The audio configuration used by the live response, including flat voice provider, - locale, and format fields under ``output``. - :vartype audio: "VoiceResponseAudio" - :ivar output: The items produced by the live response. - :vartype output: list["_unions.VoiceConversationItem"] - """ - - audio: "VoiceResponseAudio" - """The audio configuration used by the live response, including flat voice provider, locale, and - format fields under ``output``.""" - output: list["_unions.VoiceConversationItem"] - """The items produced by the live response.""" - - -class VoiceAgentResponseCreateParams(TypedDict, total=False): - """Parameters accepted by a voice-agent ``response.create`` event. - - :ivar instructions: The default system instructions (i.e. system message) prepended to model - calls. This field allows the client to guide the model on desired responses. The model can be - instructed on response content and format, (e.g. "be extremely succinct", "act friendly", "here - are examples of good responses") and on audio behavior (e.g. "talk quickly", "inject emotion - into your voice", "laugh frequently"). The instructions are not guaranteed to be followed by - the model, but they provide guidance to the model on the desired behavior. Note that the server - sets default instructions which will be used if this field is not set and are visible in the - ``session.created`` event at the start of the session. - :vartype instructions: str - :ivar tools: Tools available to the model. - :vartype tools: list[Union["RealtimeFunctionTool", "MCPTool"]] - :ivar tool_choice: How the model chooses tools. Provide one of the string modes or force a - specific function/MCP tool. Is one of the following types: Union[str, - "_models.ToolChoiceOptions"], ToolChoiceFunction, ToolChoiceMCP - :vartype tool_choice: Union[str, "ToolChoiceOptions", "ToolChoiceFunction", "ToolChoiceMCP"] - :ivar parallel_tool_calls: Whether the model may call multiple tools in parallel. Only - supported by reasoning Realtime models such as ``gpt-realtime-2``. - :vartype parallel_tool_calls: bool - :ivar reasoning: - :vartype reasoning: "RealtimeReasoning" - :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, - inclusive of tool calls. Provide an integer between 1 and 4096 to limit output tokens, or - ``inf`` for the maximum available tokens for a given model. Defaults to ``inf``. Is either a - int type or a Literal["inf"] type. - :vartype max_output_tokens: Union[int, Literal["inf"]] - :ivar conversation: Controls which conversation the response is added to. Currently supports - ``auto`` and ``none``, with ``auto`` as the default value. The ``auto`` value means that the - contents of the response will be added to the default conversation. Set this to ``none`` to - create an out-of-band response which will not add items to default conversation. Is one of the - following types: Literal["auto"], Literal["none"], str - :vartype conversation: Union[Literal["auto"], Literal["none"], str] - :ivar metadata: - :vartype metadata: "Metadata" - :ivar output_modalities: Modalities that the response may return. - :vartype output_modalities: list[Union[str, "VoiceOutputModality"]] - :ivar audio: Response-specific audio settings. - :vartype audio: "PickPropertiesVoiceAudioConfig" - :ivar input: Conversation items used as inline response input. - :vartype input: list["_unions.VoiceConversationItem"] - :ivar pre_generated_assistant_message: A pre-generated assistant message used to begin the - response. - :vartype pre_generated_assistant_message: "VoiceAssistantMessageItem" - :ivar interim_response: Interim-response settings for this response. Is either a - VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. - :vartype interim_response: "_unions.VoiceAgentInterimResponse" - """ - - instructions: str - """The default system instructions (i.e. system message) prepended to model calls. This field - allows the client to guide the model on desired responses. The model can be instructed on - response content and format, (e.g. \"be extremely succinct\", \"act friendly\", \"here are - examples of good responses\") and on audio behavior (e.g. \"talk quickly\", \"inject emotion - into your voice\", \"laugh frequently\"). The instructions are not guaranteed to be followed by - the model, but they provide guidance to the model on the desired behavior. Note that the server - sets default instructions which will be used if this field is not set and are visible in the - ``session.created`` event at the start of the session.""" - tools: list[Union["RealtimeFunctionTool", "MCPTool"]] - """Tools available to the model.""" - tool_choice: Union[str, "ToolChoiceOptions", "ToolChoiceFunction", "ToolChoiceMCP"] - """How the model chooses tools. Provide one of the string modes or force a specific function/MCP - tool. Is one of the following types: Union[str, \"_models.ToolChoiceOptions\"], - ToolChoiceFunction, ToolChoiceMCP""" - parallel_tool_calls: bool - """Whether the model may call multiple tools in parallel. Only supported by reasoning Realtime - models such as ``gpt-realtime-2``.""" - reasoning: "RealtimeReasoning" - max_output_tokens: Union[int, Literal["inf"]] - """Maximum number of output tokens for a single assistant response, inclusive of tool calls. - Provide an integer between 1 and 4096 to limit output tokens, or ``inf`` for the maximum - available tokens for a given model. Defaults to ``inf``. Is either a int type or a - Literal[\"inf\"] type.""" - conversation: Union[Literal["auto"], Literal["none"], str] - """Controls which conversation the response is added to. Currently supports ``auto`` and ``none``, - with ``auto`` as the default value. The ``auto`` value means that the contents of the response - will be added to the default conversation. Set this to ``none`` to create an out-of-band - response which will not add items to default conversation. Is one of the following types: - Literal[\"auto\"], Literal[\"none\"], str""" - metadata: Optional["Metadata"] - output_modalities: list[Union[str, "VoiceOutputModality"]] - """Modalities that the response may return.""" - audio: "PickPropertiesVoiceAudioConfig" - """Response-specific audio settings.""" - input: list["_unions.VoiceConversationItem"] - """Conversation items used as inline response input.""" - pre_generated_assistant_message: Optional["VoiceAssistantMessageItem"] - """A pre-generated assistant message used to begin the response.""" - interim_response: Optional["_unions.VoiceAgentInterimResponse"] - """Interim-response settings for this response. Is either a VoiceAgentStaticInterimResponseConfig - type or a VoiceAgentLlmInterimResponseConfig type.""" - - -class VoiceAgentResponseEventContentPart(TypedDict, total=False): - """A content part carried by a ``response.content_part.*`` server event. - - :ivar type: Is either a Literal["audio"] type or a Literal["text"] type. - :vartype type: Literal["audio", "text"] - :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: "VoiceAudioFormat" - """ - - type: Literal["audio", "text"] - """Is either a Literal[\"audio\"] type or a Literal[\"text\"] type.""" - text: str - audio: str - transcript: str - format: "VoiceAudioFormat" - """The audio format, when this is an audio content part.""" - - -class VoiceAgentSemanticVadTurnDetection(TypedDict, total=False): - """OpenAI semantic VAD turn-detection settings. - - :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech - stops. - :vartype auto_truncate: bool - :ivar eagerness: Is one of the following types: Literal["low"], Literal["medium"], - Literal["high"], Literal["auto"] - :vartype eagerness: Literal["low", "medium", "high", "auto"] - :ivar create_response: - :vartype create_response: bool - :ivar interrupt_response: - :vartype interrupt_response: bool - :ivar type: Required. Semantic voice activity detection. - :vartype type: Literal[VoiceTurnDetectionType.SEMANTIC_VAD] - """ - - auto_truncate: bool - """Whether the input audio buffer is truncated automatically when speech stops.""" - eagerness: Literal["low", "medium", "high", "auto"] - """Is one of the following types: Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"], - Literal[\"auto\"]""" - create_response: bool - interrupt_response: bool - type: Required[Literal[VoiceTurnDetectionType.SEMANTIC_VAD]] - """Required. Semantic voice activity detection.""" - - -class VoiceAgentServerEventConversationItemAdded(TypedDict, total=False): # pylint: disable=name-too-long - """The ``conversation.item.added`` server event. - - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.added``. Required. - CONVERSATION_ITEM_ADDED. - :vartype type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED] - :ivar previous_item_id: - :vartype previous_item_id: str - :ivar item: The item added to the conversation. Required. Is one of the following types: - VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, - VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem - :vartype item: "_unions.VoiceConversationItem" - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED]] - """The event type, must be ``conversation.item.added``. Required. CONVERSATION_ITEM_ADDED.""" - previous_item_id: Optional[str] - item: Required["_unions.VoiceConversationItem"] - """The item added to the conversation. Required. Is one of the following types: - VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, - VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem""" - - -class VoiceAgentServerEventConversationItemCreated(TypedDict, total=False): # pylint: disable=name-too-long - """The ``conversation.item.created`` server event. - - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.created``. Required. - CONVERSATION_ITEM_CREATED. - :vartype type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED] - :ivar previous_item_id: - :vartype previous_item_id: str - :ivar item: The created conversation item. Required. Is one of the following types: - VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, - VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem - :vartype item: "_unions.VoiceConversationItem" - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED]] - """The event type, must be ``conversation.item.created``. Required. CONVERSATION_ITEM_CREATED.""" - previous_item_id: Optional[str] - item: Required["_unions.VoiceConversationItem"] - """The created conversation item. Required. Is one of the following types: VoiceSystemMessageItem, - VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, - VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem""" - - -class VoiceAgentServerEventConversationItemDeleted(TypedDict, total=False): # pylint: disable=name-too-long - """The ``conversation.item.deleted`` server event. - - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.deleted``. Required. - CONVERSATION_ITEM_DELETED. - :vartype type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED] - :ivar item_id: The ID of the item that was deleted. Required. - :vartype item_id: str - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED]] - """The event type, must be ``conversation.item.deleted``. Required. CONVERSATION_ITEM_DELETED.""" - item_id: Required[str] - """The ID of the item that was deleted. Required.""" - - -class VoiceAgentServerEventConversationItemDone(TypedDict, total=False): # pylint: disable=name-too-long - """The ``conversation.item.done`` server event. - - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.done``. Required. - CONVERSATION_ITEM_DONE. - :vartype type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE] - :ivar previous_item_id: - :vartype previous_item_id: str - :ivar item: The completed conversation item. Required. Is one of the following types: - VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, - VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem - :vartype item: "_unions.VoiceConversationItem" - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE]] - """The event type, must be ``conversation.item.done``. Required. CONVERSATION_ITEM_DONE.""" - previous_item_id: Optional[str] - item: Required["_unions.VoiceConversationItem"] - """The completed conversation item. Required. Is one of the following types: - VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, - VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem""" - - -class VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted( - TypedDict, total=False -): # pylint: disable=name-too-long - """The ``conversation.item.input_audio_transcription.completed`` server event. - - :ivar event_id: The unique ID of the server event. Required. - :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: - Literal[RealtimeServerEventType.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 logprobs: - :vartype logprobs: list["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: Union["TranscriptTextUsageTokens", "TranscriptTextUsageDuration"] - :ivar phrases: Phrase-level transcription timing and confidence details. - :vartype phrases: list["VoiceAgentTranscriptionPhrase"] - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED]] - """The event type, must be ``conversation.item.input_audio_transcription.completed``. Required. - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED.""" - item_id: Required[str] - """The ID of the item containing the audio that is being transcribed. Required.""" - content_index: Required[int] - """The index of the content part containing the audio. Required.""" - transcript: Required[str] - """The transcribed text. Required.""" - logprobs: Optional[list["LogProbProperties"]] - usage: Required[Union["TranscriptTextUsageTokens", "TranscriptTextUsageDuration"]] - """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["VoiceAgentTranscriptionPhrase"]] - """Phrase-level transcription timing and confidence details.""" - - -class VoiceAgentServerEventConversationItemInputAudioTranscriptionDelta( - TypedDict, total=False -): # pylint: disable=name-too-long - """The ``conversation.item.input_audio_transcription.delta`` server event. - - :ivar event_id: The unique ID of the server event. Required. - :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: - Literal[RealtimeServerEventType.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["LogProbProperties"] - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA]] - """The event type, must be ``conversation.item.input_audio_transcription.delta``. Required. - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA.""" - item_id: Required[str] - """The ID of the item containing the audio that is being transcribed. Required.""" - content_index: int - """The index of the content part in the item's content array.""" - delta: str - """The text delta.""" - logprobs: Optional[list["LogProbProperties"]] - - -class VoiceAgentServerEventConversationItemInputAudioTranscriptionFailed( - TypedDict, total=False -): # pylint: disable=name-too-long - """The ``conversation.item.input_audio_transcription.failed`` server event. - - :ivar event_id: The unique ID of the server event. Required. - :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: - Literal[RealtimeServerEventType.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: "RealtimeServerEventConversationItemInputAudioTranscriptionFailedError" - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED]] - """The event type, must be ``conversation.item.input_audio_transcription.failed``. Required. - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED.""" - item_id: Required[str] - """The ID of the user message item. Required.""" - content_index: Required[int] - """The index of the content part containing the audio. Required.""" - error: Required["RealtimeServerEventConversationItemInputAudioTranscriptionFailedError"] - """Details of the transcription error. Required.""" - - -class VoiceAgentServerEventConversationItemInputAudioTranscriptionSegment( - TypedDict, total=False -): # pylint: disable=name-too-long - """The ``conversation.item.input_audio_transcription.segment`` server event. - - :ivar event_id: The unique ID of the server event. Required. - :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: - Literal[RealtimeServerEventType.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: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT]] - """The event type, must be ``conversation.item.input_audio_transcription.segment``. Required. - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT.""" - item_id: Required[str] - """The ID of the item containing the input audio content. Required.""" - content_index: Required[int] - """The index of the input audio content part within the item. Required.""" - text: Required[str] - """The text for this segment. Required.""" - id: Required[str] - """The segment identifier. Required.""" - speaker: Required[str] - """The detected speaker label for this segment. Required.""" - start: Required[float] - """Start time of the segment in seconds. Required.""" - end: Required[float] - """End time of the segment in seconds. Required.""" - - -class VoiceAgentServerEventConversationItemRetrieved(TypedDict, total=False): # pylint: disable=name-too-long - """The ``conversation.item.retrieved`` server event. - - :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: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED] - :ivar item: The retrieved conversation item. Required. Is one of the following types: - VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, - VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem - :vartype item: "_unions.VoiceConversationItem" - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED]] - """The event type, must be ``conversation.item.retrieved``. Required. CONVERSATION_ITEM_RETRIEVED.""" - item: Required["_unions.VoiceConversationItem"] - """The retrieved conversation item. Required. Is one of the following types: - VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, - VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem""" - - -class VoiceAgentServerEventConversationItemTruncated(TypedDict, total=False): # pylint: disable=name-too-long - """The ``conversation.item.truncated`` server event. - - :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: Literal[RealtimeServerEventType.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: "VoiceAssistantMessageItem" - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED]] - """The event type, must be ``conversation.item.truncated``. Required. CONVERSATION_ITEM_TRUNCATED.""" - item_id: Required[str] - """The ID of the assistant message item that was truncated. Required.""" - content_index: Required[int] - """The index of the content part that was truncated. Required.""" - audio_end_ms: Required[int] - """The duration up to which the audio was truncated, in milliseconds. Required.""" - item: "VoiceAssistantMessageItem" - """The assistant message after truncation, when the service returns the updated item.""" - - -class VoiceAgentServerEventInputAudioBufferCleared(TypedDict, total=False): # pylint: disable=name-too-long - """The ``input_audio_buffer.cleared`` server event. - - :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: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED] - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED]] - """The event type, must be ``input_audio_buffer.cleared``. Required. INPUT_AUDIO_BUFFER_CLEARED.""" - - -class VoiceAgentServerEventInputAudioBufferCommitted(TypedDict, total=False): # pylint: disable=name-too-long - """The ``input_audio_buffer.committed`` server event. - - :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: Literal[RealtimeServerEventType.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 - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED]] - """The event type, must be ``input_audio_buffer.committed``. Required. - INPUT_AUDIO_BUFFER_COMMITTED.""" - previous_item_id: Optional[str] - item_id: Required[str] - """The ID of the user message item that will be created. Required.""" - - -class VoiceAgentServerEventInputAudioBufferSpeechStarted(TypedDict, total=False): # pylint: disable=name-too-long - """The ``input_audio_buffer.speech_started`` server event. - - :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: Literal[RealtimeServerEventType.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 - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED]] - """The event type, must be ``input_audio_buffer.speech_started``. Required. - INPUT_AUDIO_BUFFER_SPEECH_STARTED.""" - audio_start_ms: Required[int] - """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: Required[str] - """The ID of the user message item that will be created when speech stops. Required.""" - - -class VoiceAgentServerEventInputAudioBufferSpeechStopped(TypedDict, total=False): # pylint: disable=name-too-long - """The ``input_audio_buffer.speech_stopped`` server event. - - :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: Literal[RealtimeServerEventType.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 - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED]] - """The event type, must be ``input_audio_buffer.speech_stopped``. Required. - INPUT_AUDIO_BUFFER_SPEECH_STOPPED.""" - audio_end_ms: Required[int] - """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: Required[str] - """The ID of the user message item that will be created. Required.""" - - -class VoiceAgentServerEventInputAudioBufferTimeoutTriggered(TypedDict, total=False): # pylint: disable=name-too-long - """The ``input_audio_buffer.timeout_triggered`` server event. - - :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: Literal[RealtimeServerEventType.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 - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED]] - """The event type, must be ``input_audio_buffer.timeout_triggered``. Required. - INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED.""" - audio_start_ms: Required[int] - """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: Required[int] - """Millisecond offset of audio written to the input audio buffer at the time the timeout was - triggered. Required.""" - item_id: Required[str] - """The ID of the item associated with this segment. Required.""" - - -class VoiceAgentServerEventMcpListToolsCompleted(TypedDict, total=False): # pylint: disable=name-too-long - """The ``mcp_list_tools.completed`` server event. - - :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: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED] - :ivar item_id: The ID of the MCP list tools item. Required. - :vartype item_id: str - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED]] - """The event type, must be ``mcp_list_tools.completed``. Required. MCP_LIST_TOOLS_COMPLETED.""" - item_id: Required[str] - """The ID of the MCP list tools item. Required.""" - - -class VoiceAgentServerEventMcpListToolsFailed(TypedDict, total=False): - """The ``mcp_list_tools.failed`` server event. - - :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: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED] - :ivar item_id: The ID of the MCP list tools item. Required. - :vartype item_id: str - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED]] - """The event type, must be ``mcp_list_tools.failed``. Required. MCP_LIST_TOOLS_FAILED.""" - item_id: Required[str] - """The ID of the MCP list tools item. Required.""" - - -class VoiceAgentServerEventMcpListToolsInProgress(TypedDict, total=False): # pylint: disable=name-too-long - """The ``mcp_list_tools.in_progress`` server event. - - :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: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS] - :ivar item_id: The ID of the MCP list tools item. Required. - :vartype item_id: str - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS]] - """The event type, must be ``mcp_list_tools.in_progress``. Required. MCP_LIST_TOOLS_IN_PROGRESS.""" - item_id: Required[str] - """The ID of the MCP list tools item. Required.""" - - -class VoiceAgentServerEventOutputAudioBufferCleared(TypedDict, total=False): # pylint: disable=name-too-long - """The ``output_audio_buffer.cleared`` server event. - - :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: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED] - :ivar response_id: The unique ID of the response that produced the audio. Required. - :vartype response_id: str - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED]] - """The event type, must be ``output_audio_buffer.cleared``. Required. OUTPUT_AUDIO_BUFFER_CLEARED.""" - response_id: Required[str] - """The unique ID of the response that produced the audio. Required.""" - - -class VoiceAgentServerEventRateLimitsUpdated(TypedDict, total=False): - """The ``rate_limits.updated`` server event. - - :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: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED] - :ivar rate_limits: List of rate limit information. Required. - :vartype rate_limits: list["RealtimeServerEventRateLimitsUpdatedRateLimits"] - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED]] - """The event type, must be ``rate_limits.updated``. Required. RATE_LIMITS_UPDATED.""" - rate_limits: Required[list["RealtimeServerEventRateLimitsUpdatedRateLimits"]] - """List of rate limit information. Required.""" - - -class VoiceAgentServerEventResponseAnimationBlendshapesDelta(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.animation_blendshapes.delta`` server event. - - :ivar type: Required. Default value is "response.animation_blendshapes.delta". - :vartype type: Literal["response.animation_blendshapes.delta"] - :ivar event_id: Required. - :vartype event_id: str - :ivar response_id: Required. - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar content_index: Required. - :vartype content_index: int - :ivar frames: Animation frames as numeric blendshape weights. Required. - :vartype frames: list[list[float]] - :ivar frame_index: The index of the first frame in this delta. Required. - :vartype frame_index: int - """ - - type: Required[Literal["response.animation_blendshapes.delta"]] - """Required. Default value is \"response.animation_blendshapes.delta\".""" - event_id: Required[str] - """Required.""" - response_id: Required[str] - """Required.""" - item_id: Required[str] - """Required.""" - output_index: Required[int] - """Required.""" - content_index: Required[int] - """Required.""" - frames: Required[list[list[float]]] - """Animation frames as numeric blendshape weights. Required.""" - frame_index: Required[int] - """The index of the first frame in this delta. Required.""" - - -class VoiceAgentServerEventResponseAnimationBlendshapesDone(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.animation_blendshapes.done`` server event. - - :ivar type: Required. Default value is "response.animation_blendshapes.done". - :vartype type: Literal["response.animation_blendshapes.done"] - :ivar event_id: Required. - :vartype event_id: str - :ivar response_id: Required. - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - """ - - type: Required[Literal["response.animation_blendshapes.done"]] - """Required. Default value is \"response.animation_blendshapes.done\".""" - event_id: Required[str] - """Required.""" - response_id: Required[str] - """Required.""" - item_id: Required[str] - """Required.""" - output_index: Required[int] - """Required.""" - - -class VoiceAgentServerEventResponseAnimationVisemeDelta(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.animation_viseme.delta`` server event. - - :ivar type: Required. Default value is "response.animation_viseme.delta". - :vartype type: Literal["response.animation_viseme.delta"] - :ivar event_id: Required. - :vartype event_id: str - :ivar response_id: Required. - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar content_index: Required. - :vartype content_index: int - :ivar audio_offset_ms: Required. - :vartype audio_offset_ms: str - :ivar viseme_id: Required. - :vartype viseme_id: int - """ - - type: Required[Literal["response.animation_viseme.delta"]] - """Required. Default value is \"response.animation_viseme.delta\".""" - event_id: Required[str] - """Required.""" - response_id: Required[str] - """Required.""" - item_id: Required[str] - """Required.""" - output_index: Required[int] - """Required.""" - content_index: Required[int] - """Required.""" - audio_offset_ms: Required[str] - """Required.""" - viseme_id: Required[int] - """Required.""" - - -class VoiceAgentServerEventResponseAnimationVisemeDone(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.animation_viseme.done`` server event. - - :ivar type: Required. Default value is "response.animation_viseme.done". - :vartype type: Literal["response.animation_viseme.done"] - :ivar event_id: Required. - :vartype event_id: str - :ivar response_id: Required. - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar content_index: Required. - :vartype content_index: int - """ - - type: Required[Literal["response.animation_viseme.done"]] - """Required. Default value is \"response.animation_viseme.done\".""" - event_id: Required[str] - """Required.""" - response_id: Required[str] - """Required.""" - item_id: Required[str] - """Required.""" - output_index: Required[int] - """Required.""" - content_index: Required[int] - """Required.""" - - -class VoiceAgentServerEventResponseAudioDelta(TypedDict, total=False): - """The ``response.output_audio.delta`` server event. - - :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: Literal[RealtimeServerEventType.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: str - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA]] - """The event type, must be ``response.output_audio.delta``. Required. RESPONSE_OUTPUT_AUDIO_DELTA.""" - response_id: Required[str] - """The ID of the response. Required.""" - item_id: Required[str] - """The ID of the item. Required.""" - output_index: Required[int] - """The index of the output item in the response. Required.""" - content_index: Required[int] - """The index of the content part in the item's content array. Required.""" - delta: Required[str] - """Base64-encoded audio data delta. Required.""" - - -class VoiceAgentServerEventResponseAudioDone(TypedDict, total=False): - """The ``response.output_audio.done`` server event. - - :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: Literal[RealtimeServerEventType.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 - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE]] - """The event type, must be ``response.output_audio.done``. Required. RESPONSE_OUTPUT_AUDIO_DONE.""" - response_id: Required[str] - """The ID of the response. Required.""" - item_id: Required[str] - """The ID of the item. Required.""" - output_index: Required[int] - """The index of the output item in the response. Required.""" - content_index: Required[int] - """The index of the content part in the item's content array. Required.""" - - -class VoiceAgentServerEventResponseAudioTimestampDelta(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.audio_timestamp.delta`` server event. - - :ivar type: Required. Default value is "response.audio_timestamp.delta". - :vartype type: Literal["response.audio_timestamp.delta"] - :ivar event_id: Required. - :vartype event_id: str - :ivar response_id: Required. - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar content_index: Required. - :vartype content_index: int - :ivar audio_offset_ms: Required. - :vartype audio_offset_ms: str - :ivar audio_duration_ms: Required. - :vartype audio_duration_ms: str - :ivar text: Required. - :vartype text: str - :ivar timestamp_type: Required. Default value is "word". - :vartype timestamp_type: Literal["word"] - """ - - type: Required[Literal["response.audio_timestamp.delta"]] - """Required. Default value is \"response.audio_timestamp.delta\".""" - event_id: Required[str] - """Required.""" - response_id: Required[str] - """Required.""" - item_id: Required[str] - """Required.""" - output_index: Required[int] - """Required.""" - content_index: Required[int] - """Required.""" - audio_offset_ms: Required[str] - """Required.""" - audio_duration_ms: Required[str] - """Required.""" - text: Required[str] - """Required.""" - timestamp_type: Required[Literal["word"]] - """Required. Default value is \"word\".""" - - -class VoiceAgentServerEventResponseAudioTimestampDone(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.audio_timestamp.done`` server event. - - :ivar type: Required. Default value is "response.audio_timestamp.done". - :vartype type: Literal["response.audio_timestamp.done"] - :ivar event_id: Required. - :vartype event_id: str - :ivar response_id: Required. - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar content_index: Required. - :vartype content_index: int - """ - - type: Required[Literal["response.audio_timestamp.done"]] - """Required. Default value is \"response.audio_timestamp.done\".""" - event_id: Required[str] - """Required.""" - response_id: Required[str] - """Required.""" - item_id: Required[str] - """Required.""" - output_index: Required[int] - """Required.""" - content_index: Required[int] - """Required.""" - - -class VoiceAgentServerEventResponseAudioTranscriptDelta(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.output_audio_transcript.delta`` server event. - - :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: Literal[RealtimeServerEventType.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 - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA]] - """The event type, must be ``response.output_audio_transcript.delta``. Required. - RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA.""" - response_id: Required[str] - """The ID of the response. Required.""" - item_id: Required[str] - """The ID of the item. Required.""" - output_index: Required[int] - """The index of the output item in the response. Required.""" - content_index: Required[int] - """The index of the content part in the item's content array. Required.""" - delta: Required[str] - """The transcript delta. Required.""" - - -class VoiceAgentServerEventResponseAudioTranscriptDone(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.output_audio_transcript.done`` server event. - - :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: Literal[RealtimeServerEventType.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 - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE]] - """The event type, must be ``response.output_audio_transcript.done``. Required. - RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE.""" - response_id: Required[str] - """The ID of the response. Required.""" - item_id: Required[str] - """The ID of the item. Required.""" - output_index: Required[int] - """The index of the output item in the response. Required.""" - content_index: Required[int] - """The index of the content part in the item's content array. Required.""" - transcript: Required[str] - """The final transcript of the audio. Required.""" - - -class VoiceAgentServerEventResponseContentPartDone(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.content_part.done`` server event. - - :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: Literal[RealtimeServerEventType.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 finished streaming. Required. - :vartype part: "VoiceAgentResponseEventContentPart" - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE]] - """The event type, must be ``response.content_part.done``. Required. RESPONSE_CONTENT_PART_DONE.""" - response_id: Required[str] - """The ID of the response. Required.""" - item_id: Required[str] - """The ID of the item. Required.""" - output_index: Required[int] - """The index of the output item in the response. Required.""" - content_index: Required[int] - """The index of the content part in the item's content array. Required.""" - part: Required["VoiceAgentResponseEventContentPart"] - """The content part that finished streaming. Required.""" - - -class VoiceAgentServerEventResponseCreated(TypedDict, total=False): - """The ``response.created`` server event. - - :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: Literal[RealtimeServerEventType.RESPONSE_CREATED] - :ivar response: The created voice-agent response. Required. - :vartype response: "VoiceAgentRealtimeResponse" - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_CREATED]] - """The event type, must be ``response.created``. Required. RESPONSE_CREATED.""" - response: Required["VoiceAgentRealtimeResponse"] - """The created voice-agent response. Required.""" - - -class VoiceAgentServerEventResponseDone(TypedDict, total=False): - """The ``response.done`` server event. - - :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: Literal[RealtimeServerEventType.RESPONSE_DONE] - :ivar response: The completed voice-agent response. Required. - :vartype response: "VoiceAgentRealtimeResponse" - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_DONE]] - """The event type, must be ``response.done``. Required. RESPONSE_DONE.""" - response: Required["VoiceAgentRealtimeResponse"] - """The completed voice-agent response. Required.""" - - -class VoiceAgentServerEventResponseFunctionCallArgumentsDelta(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.function_call_arguments.delta`` server event. - - :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: Literal[RealtimeServerEventType.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 - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA]] - """The event type, must be ``response.function_call_arguments.delta``. Required. - RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA.""" - response_id: Required[str] - """The ID of the response. Required.""" - item_id: Required[str] - """The ID of the function call item. Required.""" - output_index: Required[int] - """The index of the output item in the response. Required.""" - call_id: Required[str] - """The ID of the function call. Required.""" - delta: Required[str] - """The arguments delta as a JSON string. Required.""" - - -class VoiceAgentServerEventResponseFunctionCallArgumentsDone(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.function_call_arguments.done`` server event. - - :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: Literal[RealtimeServerEventType.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 - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE]] - """The event type, must be ``response.function_call_arguments.done``. Required. - RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE.""" - response_id: Required[str] - """The ID of the response. Required.""" - item_id: Required[str] - """The ID of the function call item. Required.""" - output_index: Required[int] - """The index of the output item in the response. Required.""" - call_id: Required[str] - """The ID of the function call. Required.""" - name: Required[str] - """The name of the function that was called. Required.""" - arguments: Required[str] - """The final arguments as a JSON string. Required.""" - - -class VoiceAgentServerEventResponseMcpCallArgumentsDelta(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.mcp_call_arguments.delta`` server event. - - :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: Literal[RealtimeServerEventType.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: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA]] - """The event type, must be ``response.mcp_call_arguments.delta``. Required. - RESPONSE_MCP_CALL_ARGUMENTS_DELTA.""" - response_id: Required[str] - """The ID of the response. Required.""" - item_id: Required[str] - """The ID of the MCP tool call item. Required.""" - output_index: Required[int] - """The index of the output item in the response. Required.""" - delta: Required[str] - """The JSON-encoded arguments delta. Required.""" - obfuscation: Optional[str] - - -class VoiceAgentServerEventResponseMcpCallArgumentsDone(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.mcp_call_arguments.done`` server event. - - :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: Literal[RealtimeServerEventType.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 - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE]] - """The event type, must be ``response.mcp_call_arguments.done``. Required. - RESPONSE_MCP_CALL_ARGUMENTS_DONE.""" - response_id: Required[str] - """The ID of the response. Required.""" - item_id: Required[str] - """The ID of the MCP tool call item. Required.""" - output_index: Required[int] - """The index of the output item in the response. Required.""" - arguments: Required[str] - """The final JSON-encoded arguments string. Required.""" - - -class VoiceAgentServerEventResponseMcpCallCompleted(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.mcp_call.completed`` server event. - - :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: Literal[RealtimeServerEventType.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 - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED]] - """The event type, must be ``response.mcp_call.completed``. Required. RESPONSE_MCP_CALL_COMPLETED.""" - output_index: Required[int] - """The index of the output item in the response. Required.""" - item_id: Required[str] - """The ID of the MCP tool call item. Required.""" - - -class VoiceAgentServerEventResponseMcpCallFailed(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.mcp_call.failed`` server event. - - :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: Literal[RealtimeServerEventType.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 - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED]] - """The event type, must be ``response.mcp_call.failed``. Required. RESPONSE_MCP_CALL_FAILED.""" - output_index: Required[int] - """The index of the output item in the response. Required.""" - item_id: Required[str] - """The ID of the MCP tool call item. Required.""" - - -class VoiceAgentServerEventResponseMcpCallInProgress(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.mcp_call.in_progress`` server event. - - :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: Literal[RealtimeServerEventType.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 - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS]] - """The event type, must be ``response.mcp_call.in_progress``. Required. - RESPONSE_MCP_CALL_IN_PROGRESS.""" - output_index: Required[int] - """The index of the output item in the response. Required.""" - item_id: Required[str] - """The ID of the MCP tool call item. Required.""" - - -class VoiceAgentServerEventResponseOutputItemAdded(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.output_item.added`` server event. - - :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: Literal[RealtimeServerEventType.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: The output item that was added. Required. Is one of the following types: - VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, - VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem - :vartype item: "_unions.VoiceConversationItem" - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED]] - """The event type, must be ``response.output_item.added``. Required. RESPONSE_OUTPUT_ITEM_ADDED.""" - response_id: Required[str] - """The ID of the Response to which the item belongs. Required.""" - output_index: Required[int] - """The index of the output item in the Response. Required.""" - item: Required["_unions.VoiceConversationItem"] - """The output item that was added. Required. Is one of the following types: - VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, - VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem""" - - -class VoiceAgentServerEventResponseOutputItemDone(TypedDict, total=False): # pylint: disable=name-too-long - """The ``response.output_item.done`` server event. - - :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: Literal[RealtimeServerEventType.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: The output item that finished streaming. Required. Is one of the following types: - VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, - VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem - :vartype item: "_unions.VoiceConversationItem" - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE]] - """The event type, must be ``response.output_item.done``. Required. RESPONSE_OUTPUT_ITEM_DONE.""" - response_id: Required[str] - """The ID of the Response to which the item belongs. Required.""" - output_index: Required[int] - """The index of the output item in the Response. Required.""" - item: Required["_unions.VoiceConversationItem"] - """The output item that finished streaming. Required. Is one of the following types: - VoiceSystemMessageItem, VoiceUserMessageItem, VoiceAssistantMessageItem, VoiceFunctionCallItem, - VoiceFunctionCallOutputItem, VoiceMcpListToolsItem, VoiceMcpCallItem, - VoiceMcpApprovalRequestItem, VoiceMcpApprovalResponseItem""" - - -class VoiceAgentServerEventResponseTextDelta(TypedDict, total=False): - """The ``response.output_text.delta`` server event. - - :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: Literal[RealtimeServerEventType.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 - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA]] - """The event type, must be ``response.output_text.delta``. Required. RESPONSE_OUTPUT_TEXT_DELTA.""" - response_id: Required[str] - """The ID of the response. Required.""" - item_id: Required[str] - """The ID of the item. Required.""" - output_index: Required[int] - """The index of the output item in the response. Required.""" - content_index: Required[int] - """The index of the content part in the item's content array. Required.""" - delta: Required[str] - """The text delta. Required.""" - - -class VoiceAgentServerEventResponseTextDone(TypedDict, total=False): - """The ``response.output_text.done`` server event. - - :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: Literal[RealtimeServerEventType.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 - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE]] - """The event type, must be ``response.output_text.done``. Required. RESPONSE_OUTPUT_TEXT_DONE.""" - response_id: Required[str] - """The ID of the response. Required.""" - item_id: Required[str] - """The ID of the item. Required.""" - output_index: Required[int] - """The index of the output item in the response. Required.""" - content_index: Required[int] - """The index of the content part in the item's content array. Required.""" - text: Required[str] - """The final text content. Required.""" - - -class VoiceAgentServerEventResponseVideoDelta(TypedDict, total=False): - """The ``response.video.delta`` server event. - - :ivar type: Required. Default value is "response.video.delta". - :vartype type: Literal["response.video.delta"] - :ivar event_id: Required. - :vartype event_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar codec: Required. - :vartype codec: str - :ivar delta: The base64-encoded video frame data. Required. - :vartype delta: str - """ - - type: Required[Literal["response.video.delta"]] - """Required. Default value is \"response.video.delta\".""" - event_id: Required[str] - """Required.""" - output_index: Required[int] - """Required.""" - codec: Required[str] - """Required.""" - delta: Required[str] - """The base64-encoded video frame data. Required.""" - - -class VoiceAgentServerEventSessionAvatarConnecting(TypedDict, total=False): # pylint: disable=name-too-long - """The ``session.avatar.connecting`` server event. - - :ivar type: Required. Default value is "session.avatar.connecting". - :vartype type: Literal["session.avatar.connecting"] - :ivar event_id: Required. - :vartype event_id: str - :ivar server_sdp: The server's SDP answer for avatar media negotiation. Required. - :vartype server_sdp: str - """ - - type: Required[Literal["session.avatar.connecting"]] - """Required. Default value is \"session.avatar.connecting\".""" - event_id: Required[str] - """Required.""" - server_sdp: Required[str] - """The server's SDP answer for avatar media negotiation. Required.""" - - -class VoiceAgentServerEventSessionAvatarSwitchToIdle(TypedDict, total=False): # pylint: disable=name-too-long - """The ``session.avatar.switch_to_idle`` server event. - - :ivar type: Required. Default value is "session.avatar.switch_to_idle". - :vartype type: Literal["session.avatar.switch_to_idle"] - :ivar event_id: Required. - :vartype event_id: str - :ivar turn_id: - :vartype turn_id: str - """ - - type: Required[Literal["session.avatar.switch_to_idle"]] - """Required. Default value is \"session.avatar.switch_to_idle\".""" - event_id: Required[str] - """Required.""" - turn_id: str - - -class VoiceAgentServerEventSessionAvatarSwitchToSpeaking(TypedDict, total=False): # pylint: disable=name-too-long - """The ``session.avatar.switch_to_speaking`` server event. - - :ivar type: Required. Default value is "session.avatar.switch_to_speaking". - :vartype type: Literal["session.avatar.switch_to_speaking"] - :ivar event_id: Required. - :vartype event_id: str - :ivar turn_id: - :vartype turn_id: str - """ - - type: Required[Literal["session.avatar.switch_to_speaking"]] - """Required. Default value is \"session.avatar.switch_to_speaking\".""" - event_id: Required[str] - """Required.""" - turn_id: str - - -class VoiceAgentServerEventSessionCreated(TypedDict, total=False): - """The ``session.created`` server event. - - :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: Literal[RealtimeServerEventType.SESSION_CREATED] - :ivar conversation_id: The id of the persisted conversation. Only present when conversation - persistence is enabled for the session. - :vartype conversation_id: str - :ivar session: The initial effective voice-agent session configuration. Required. - :vartype session: "VoiceAgentSessionResponseConfig" - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.SESSION_CREATED]] - """The event type, must be ``session.created``. Required. SESSION_CREATED.""" - conversation_id: str - """The id of the persisted conversation. Only present when conversation persistence is enabled for - the session.""" - session: Required["VoiceAgentSessionResponseConfig"] - """The initial effective voice-agent session configuration. Required.""" - - -class VoiceAgentServerEventSessionUpdated(TypedDict, total=False): - """The ``session.updated`` server event. - - :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: Literal[RealtimeServerEventType.SESSION_UPDATED] - :ivar session: The effective voice-agent session configuration after the update. Required. - :vartype session: "VoiceAgentSessionResponseConfig" - """ - - event_id: Required[str] - """The unique ID of the server event. Required.""" - type: Required[Literal[RealtimeServerEventType.SESSION_UPDATED]] - """The event type, must be ``session.updated``. Required. SESSION_UPDATED.""" - session: Required["VoiceAgentSessionResponseConfig"] - """The effective voice-agent session configuration after the update. Required.""" - - -class VoiceAgentServerEventWarning(TypedDict, total=False): - """The ``warning`` server event. - - :ivar type: Required. Default value is "warning". - :vartype type: Literal["warning"] - :ivar event_id: Required. - :vartype event_id: str - :ivar warning: Required. - :vartype warning: "VoiceAgentServerEventWarningDetails" - """ - - type: Required[Literal["warning"]] - """Required. Default value is \"warning\".""" - event_id: Required[str] - """Required.""" - warning: Required["VoiceAgentServerEventWarningDetails"] - """Required.""" - - -class VoiceAgentServerEventWarningDetails(TypedDict, total=False): - """Details of a non-fatal warning. - - :ivar message: Required. - :vartype message: str - :ivar code: - :vartype code: str - :ivar param: - :vartype param: str - """ - - message: Required[str] - """Required.""" - code: str - param: str - - -class VoiceAvatarConfig(TypedDict, total=False): - """Avatar configuration for a voice agent. These values are session defaults and may be overridden - when connecting. - - :ivar type: The avatar type. Required. Known values are: "video_avatar" and "photo_avatar". - :vartype type: Union[str, "VoiceAvatarType"] - :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", "websocket", and "websocket-binary". - :vartype output_protocol: Union[str, "VoiceAvatarOutputProtocol"] - :ivar model: The avatar model identifier. - :vartype model: str - :ivar video: Avatar video encoder and presentation settings. - :vartype video: "VoiceAgentAvatarVideoParams" - :ivar scene: Avatar placement and motion settings. - :vartype scene: "VoiceAgentAvatarScene" - :ivar output_audit_audio: Whether audit audio is emitted with avatar output. Defaults to false. - :vartype output_audit_audio: bool - """ - - type: Required[Union[str, "VoiceAvatarType"]] - """The avatar type. Required. Known values are: \"video_avatar\" and \"photo_avatar\".""" - character: Required[str] - """The avatar character identifier, e.g. 'lisa'. Required.""" - style: str - """The avatar style, e.g. 'casual-sitting'.""" - customized: bool - """Whether the avatar is a customer-customized avatar. Defaults to false.""" - output_protocol: Union[str, "VoiceAvatarOutputProtocol"] - """The transport used to deliver the avatar video stream. Known values are: \"webrtc\", - \"websocket\", and \"websocket-binary\".""" - model: str - """The avatar model identifier.""" - video: "VoiceAgentAvatarVideoParams" - """Avatar video encoder and presentation settings.""" - scene: "VoiceAgentAvatarScene" - """Avatar placement and motion settings.""" - output_audit_audio: bool - """Whether audit audio is emitted with avatar output. Defaults to false.""" - - -class VoiceAgentSessionAvatarConfig(VoiceAvatarConfig): - """Avatar settings accepted by the stable voice-agent WebSocket contract. - - :ivar type: The avatar type. Required. Known values are: "video_avatar" and "photo_avatar". - :vartype type: Union[str, "VoiceAvatarType"] - :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", "websocket", and "websocket-binary". - :vartype output_protocol: Union[str, "VoiceAvatarOutputProtocol"] - :ivar model: The avatar model identifier. - :vartype model: str - :ivar video: Avatar video encoder and presentation settings. - :vartype video: "VoiceAgentAvatarVideoParams" - :ivar scene: Avatar placement and motion settings. - :vartype scene: "VoiceAgentAvatarScene" - :ivar output_audit_audio: Whether audit audio is emitted with avatar output. Defaults to false. - :vartype output_audit_audio: bool - :ivar ice_servers: - :vartype ice_servers: list["VoiceAgentAvatarIceServer"] - """ - - ice_servers: Optional[list["VoiceAgentAvatarIceServer"]] - - -class VoiceAgentSessionResponseConfig(TypedDict, total=False): - """The effective stable realtime session settings returned by the voice-agent service. - - :ivar type: The session type. Always ``realtime``. Required. Default value is "realtime". - :vartype type: Literal["realtime"] - :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: "_unions.VoiceAgentMaxOutputTokens" - :ivar output_modalities: The output modalities enabled for the session. - :vartype output_modalities: list[Union[str, "VoiceOutputModality"]] - :ivar audio: The input- and output-audio settings for the session. - :vartype audio: "VoiceAudioConfig" - :ivar avatar: The avatar settings for the session. - :vartype avatar: "VoiceAgentSessionAvatarConfig" - :ivar animation: Animation settings for the session. - :vartype animation: "VoiceAgentAnimationConfig" - :ivar tools: Tools available to the session. - :vartype tools: list["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: "_unions.VoiceAgentToolChoice" - :ivar reasoning: Reasoning settings for compatible realtime models. - :vartype reasoning: "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[Union[str, "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. Is either a - VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. - :vartype interim_response: "_unions.VoiceAgentInterimResponse" - :ivar greeting: A proactive assistant greeting started after session configuration. - :vartype greeting: "VoiceGreetingConfig" - :ivar object: The object type. Always ``realtime.session``. Required. Default value is - "realtime.session". - :vartype object: Literal["realtime.session"] - :ivar id: The session identifier. Required. - :vartype id: str - :ivar model: The selected model. Required. - :vartype model: str - :ivar expires_at: The session expiration time as a Unix timestamp in seconds. - :vartype expires_at: int - """ - - type: Required[Literal["realtime"]] - """The session type. Always ``realtime``. Required. Default value is \"realtime\".""" - instructions: str - """Instructions applied throughout the session.""" - temperature: float - """The sampling temperature for compatible cascaded pipelines.""" - max_output_tokens: "_unions.VoiceAgentMaxOutputTokens" - """The maximum output-token count for one response. Is either a int type or a Literal[\"inf\"] - type.""" - output_modalities: list[Union[str, "VoiceOutputModality"]] - """The output modalities enabled for the session.""" - audio: "VoiceAudioConfig" - """The input- and output-audio settings for the session.""" - avatar: "VoiceAgentSessionAvatarConfig" - """The avatar settings for the session.""" - animation: "VoiceAgentAnimationConfig" - """Animation settings for the session.""" - tools: list["VoiceAgentTool"] - """Tools available to the session.""" - tool_choice: "_unions.VoiceAgentToolChoice" - """Tool-selection behavior for the session. Is one of the following types: Literal[\"none\"], - Literal[\"auto\"], Literal[\"required\"], ToolChoiceFunction, ToolChoiceMCP""" - reasoning: "RealtimeReasoning" - """Reasoning settings for compatible realtime models.""" - parallel_tool_calls: bool - """Whether the model may call multiple tools in parallel.""" - include: list[Union[str, "VoiceAgentSessionIncludeOption"]] - """Additional fields to include in service outputs.""" - metadata: dict[str, str] - """Up to 16 string key-value pairs attached to the session.""" - interim_response: "_unions.VoiceAgentInterimResponse" - """Interim-response settings for latency and tool execution. Is either a - VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type.""" - greeting: "VoiceGreetingConfig" - """A proactive assistant greeting started after session configuration.""" - object: Required[Literal["realtime.session"]] - """The object type. Always ``realtime.session``. Required. Default value is \"realtime.session\".""" - id: Required[str] - """The session identifier. Required.""" - model: Required[str] - """The selected model. Required.""" - expires_at: Optional[int] - """The session expiration time as a Unix timestamp in seconds.""" - - -class VoiceAgentSessionUpdateConfig(TypedDict, total=False): - """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: Literal["realtime"] - :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: "_unions.VoiceAgentMaxOutputTokens" - :ivar output_modalities: The output modalities enabled for the session. - :vartype output_modalities: list[Union[str, "VoiceOutputModality"]] - :ivar audio: The input- and output-audio settings for the session. - :vartype audio: "VoiceAudioConfig" - :ivar avatar: The avatar settings for the session. - :vartype avatar: "VoiceAgentSessionAvatarConfig" - :ivar animation: Animation settings for the session. - :vartype animation: "VoiceAgentAnimationConfig" - :ivar tools: Tools available to the session. - :vartype tools: list["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: "_unions.VoiceAgentToolChoice" - :ivar reasoning: Reasoning settings for compatible realtime models. - :vartype reasoning: "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[Union[str, "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. Is either a - VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type. - :vartype interim_response: "_unions.VoiceAgentInterimResponse" - :ivar greeting: A proactive assistant greeting started after session configuration. - :vartype greeting: "VoiceGreetingConfig" - """ - - type: Required[Literal["realtime"]] - """The session type. Always ``realtime``. Required. Default value is \"realtime\".""" - instructions: str - """Instructions applied throughout the session.""" - temperature: float - """The sampling temperature for compatible cascaded pipelines.""" - max_output_tokens: "_unions.VoiceAgentMaxOutputTokens" - """The maximum output-token count for one response. Is either a int type or a Literal[\"inf\"] - type.""" - output_modalities: list[Union[str, "VoiceOutputModality"]] - """The output modalities enabled for the session.""" - audio: "VoiceAudioConfig" - """The input- and output-audio settings for the session.""" - avatar: "VoiceAgentSessionAvatarConfig" - """The avatar settings for the session.""" - animation: "VoiceAgentAnimationConfig" - """Animation settings for the session.""" - tools: list["VoiceAgentTool"] - """Tools available to the session.""" - tool_choice: "_unions.VoiceAgentToolChoice" - """Tool-selection behavior for the session. Is one of the following types: Literal[\"none\"], - Literal[\"auto\"], Literal[\"required\"], ToolChoiceFunction, ToolChoiceMCP""" - reasoning: "RealtimeReasoning" - """Reasoning settings for compatible realtime models.""" - parallel_tool_calls: bool - """Whether the model may call multiple tools in parallel.""" - include: list[Union[str, "VoiceAgentSessionIncludeOption"]] - """Additional fields to include in service outputs.""" - metadata: dict[str, str] - """Up to 16 string key-value pairs attached to the session.""" - interim_response: "_unions.VoiceAgentInterimResponse" - """Interim-response settings for latency and tool execution. Is either a - VoiceAgentStaticInterimResponseConfig type or a VoiceAgentLlmInterimResponseConfig type.""" - greeting: "VoiceGreetingConfig" - """A proactive assistant greeting started after session configuration.""" - - -class VoiceAgentStaticInterimResponseConfig(TypedDict, total=False): - """A static interim response selected from configured text. - - :ivar triggers: Conditions that may trigger one interim response. - :vartype triggers: list[Union[str, "VoiceAgentInterimResponseTrigger"]] - :ivar latency_threshold_ms: The latency threshold in milliseconds. - :vartype latency_threshold_ms: str - :ivar type: Required. Default value is "static_interim_response". - :vartype type: Literal["static_interim_response"] - :ivar texts: Candidate text values for the interim response. - :vartype texts: list[str] - """ - - triggers: list[Union[str, "VoiceAgentInterimResponseTrigger"]] - """Conditions that may trigger one interim response.""" - latency_threshold_ms: str - """The latency threshold in milliseconds.""" - type: Required[Literal["static_interim_response"]] - """Required. Default value is \"static_interim_response\".""" - texts: list[str] - """Candidate text values for the interim response.""" - - -class VoiceAgentTranscriptionPhrase(TypedDict, total=False): - """A transcribed phrase with timing information. - - :ivar offset_milliseconds: The phrase offset from the beginning of the audio, in milliseconds. - Required. - :vartype offset_milliseconds: str - :ivar duration_milliseconds: The phrase duration in milliseconds. Required. - :vartype duration_milliseconds: str - :ivar text: The transcribed phrase text. Required. - :vartype text: str - :ivar words: Word-level timing details, when available. - :vartype words: list["VoiceAgentTranscriptionWord"] - :ivar locale: The detected locale. - :vartype locale: str - :ivar confidence: The transcription confidence score. - :vartype confidence: float - """ - - offset_milliseconds: Required[str] - """The phrase offset from the beginning of the audio, in milliseconds. Required.""" - duration_milliseconds: Required[str] - """The phrase duration in milliseconds. Required.""" - text: Required[str] - """The transcribed phrase text. Required.""" - words: Optional[list["VoiceAgentTranscriptionWord"]] - """Word-level timing details, when available.""" - locale: Optional[str] - """The detected locale.""" - confidence: Optional[float] - """The transcription confidence score.""" - - -class VoiceAgentTranscriptionWord(TypedDict, total=False): - """A time-stamped word in an input-audio transcription. - - :ivar text: The transcribed word text. Required. - :vartype text: str - :ivar offset_milliseconds: The word offset from the beginning of the audio, in milliseconds. - Required. - :vartype offset_milliseconds: str - :ivar duration_milliseconds: The word duration in milliseconds. Required. - :vartype duration_milliseconds: str - """ - - text: Required[str] - """The transcribed word text. Required.""" - offset_milliseconds: Required[str] - """The word offset from the beginning of the audio, in milliseconds. Required.""" - duration_milliseconds: Required[str] - """The word duration in milliseconds. Required.""" - - -class VoiceAssistantMessageItem(RealtimeConversationItemMessageAssistant): - """An assistant message item. Only ``output_text`` and ``output_audio`` content are valid for - assistant messages. - - :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: Literal["realtime.item"] - :ivar type: The type of the item. Always ``message``. Required. Default value is "message". - :vartype type: Literal["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: Literal["completed", "incomplete", "in_progress"] - :ivar role: The role of the message sender. Always ``assistant``. Required. ASSISTANT. - :vartype role: Literal[RealtimeConversationItemMessageType.ASSISTANT] - :ivar content: The content of the message. Required. - :vartype content: list["RealtimeConversationItemMessageAssistantContent"] - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: int - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str - """ - - created_at: int - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: str - """The id of the response that produced this item, when applicable.""" - - -class VoiceAudioConfig(TypedDict, total=False): - """The audio configuration for a voice agent. These values are session defaults and may be - overridden when connecting. - - :ivar input: Input (microphone) audio configuration. - :vartype input: "VoiceAudioInputConfig" - :ivar output: Output (agent speech) audio configuration. - :vartype output: "VoiceAudioOutputConfig" - """ - - input: "VoiceAudioInputConfig" - """Input (microphone) audio configuration.""" - output: "VoiceAudioOutputConfig" - """Output (agent speech) audio configuration.""" - - -class VoiceAudioFormat(TypedDict, total=False): - """An audio format. Follows the OpenAI Realtime session schema; ``type`` carries the media - subtype. - - :ivar type: The audio format type, e.g. 'audio/pcm' (16-bit PCM), 'audio/pcmu' (G.711 mu-law), - or 'audio/pcma' (G.711 A-law). Required. Known values are: "audio/pcm", "audio/pcmu", and - "audio/pcma". - :vartype type: Union[str, "VoiceAudioFormatType"] - :ivar rate: The sample rate in Hz. Applies to 'audio/pcm' (e.g. 24000); omit for telephony - G.711 formats (8 kHz). - :vartype rate: int - """ - - type: Required[Union[str, "VoiceAudioFormatType"]] - """The audio format type, e.g. 'audio/pcm' (16-bit PCM), 'audio/pcmu' (G.711 mu-law), or - 'audio/pcma' (G.711 A-law). Required. Known values are: \"audio/pcm\", \"audio/pcmu\", and - \"audio/pcma\".""" - rate: int - """The sample rate in Hz. Applies to 'audio/pcm' (e.g. 24000); omit for telephony G.711 formats (8 - kHz).""" - - -class VoiceAudioInputConfig(TypedDict, total=False): - """Input audio configuration for a voice agent. - - :ivar format: The input audio format. - :vartype format: "VoiceAudioFormat" - :ivar noise_reduction: Input noise reduction. Set to null to disable. - :vartype noise_reduction: "VoiceNoiseReduction" - :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. - Is one of the following types: VoiceServerVadTurnDetection, VoiceAgentSemanticVadTurnDetection, - VoiceAzureSemanticVadTurnDetection, VoiceAzureSemanticVadEnTurnDetection, - VoiceAzureSemanticVadMultilingualTurnDetection - :vartype turn_detection: "_unions.VoiceAgentTurnDetection" - :ivar echo_cancellation: Optional server-side echo cancellation settings. - :vartype echo_cancellation: "VoiceAgentEchoCancellation" - :ivar transcription: Asynchronous input-audio transcription. Set to null to disable - transcription. - :vartype transcription: "VoiceInputTranscription" - """ - - format: "VoiceAudioFormat" - """The input audio format.""" - noise_reduction: Optional["VoiceNoiseReduction"] - """Input noise reduction. Set to null to disable.""" - turn_detection: Optional["_unions.VoiceAgentTurnDetection"] - """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. Is one of the - following types: VoiceServerVadTurnDetection, VoiceAgentSemanticVadTurnDetection, - VoiceAzureSemanticVadTurnDetection, VoiceAzureSemanticVadEnTurnDetection, - VoiceAzureSemanticVadMultilingualTurnDetection""" - echo_cancellation: Optional["VoiceAgentEchoCancellation"] - """Optional server-side echo cancellation settings.""" - transcription: Optional["VoiceInputTranscription"] - """Asynchronous input-audio transcription. Set to null to disable transcription.""" - - -class VoiceAudioOutputConfig(TypedDict, total=False): - """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. - - :ivar format: The output audio format. Applies to every ``voice_type`` and defaults to 24 kHz - PCM. - :vartype format: "VoiceAudioFormat" - :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: Union[str, "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[Union[str, "VoiceAudioTimestampType"]] - """ - - format: "VoiceAudioFormat" - """The output audio format. Applies to every ``voice_type`` and defaults to 24 kHz PCM.""" - voice: str - """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: Union[str, "VoiceType"] - """The voice implementation. Known values are: \"openai\", \"azure-standard\", \"azure-custom\", - \"azure-personal\", \"avatar-voice-sync\", and \"azure-realtime-native\".""" - voice_locale: str - """The enforced BCP-47 output locale. Applies to ``azure-standard``, ``azure-custom``, - ``azure-personal``, and ``avatar-voice-sync``.""" - speed: float - """The numeric output speed multiplier. Applies to all known ``voice_type`` values and defaults to - 1.""" - voice_temperature: float - """The voice variation temperature. Applies to ``azure-standard``, ``azure-custom``, - ``azure-personal``, and ``avatar-voice-sync``.""" - custom_lexicon_url: str - """The URL of a custom pronunciation lexicon. Applies to ``azure-standard``, ``azure-custom``, - ``azure-personal``, and ``avatar-voice-sync``.""" - custom_text_normalization_url: str - """The URL of a custom text-normalization configuration. Applies to ``azure-standard``, - ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``.""" - prefer_locales: list[str] - """Preferred BCP-47 locales for multilingual synthesis. Applies to ``azure-standard``, - ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``.""" - style: str - """The voice speaking style. Applies only when ``voice_type`` is ``azure-standard``.""" - pitch: str - """The voice pitch adjustment. Applies to ``azure-standard``, ``azure-custom``, - ``azure-personal``, and ``avatar-voice-sync``.""" - volume: str - """The voice volume adjustment. Applies to ``azure-standard``, ``azure-custom``, - ``azure-personal``, and ``avatar-voice-sync``.""" - custom_voice_endpoint_id: str - """The Azure custom-voice deployment endpoint identifier. Applies only when ``voice_type`` is - ``azure-custom``.""" - personal_voice_model: str - """The Azure personal or avatar voice model. Applies only when ``voice_type`` is - ``azure-personal`` or ``avatar-voice-sync``.""" - output_audio_timestamp_types: list[Union[str, "VoiceAudioTimestampType"]] - """Timestamp kinds to include with output audio. Applies to every ``voice_type``.""" - - -class VoiceAzureSemanticVadEnTurnDetection(TypedDict, total=False): - """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: Literal[VoiceTurnDetectionType.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: str - :ivar silence_duration_ms: Silence required to end speech detection, in milliseconds. - :vartype silence_duration_ms: str - :ivar idle_timeout_ms: Maximum idle time before the detector ends the turn, in milliseconds. - :vartype idle_timeout_ms: str - :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. Set to - null to disable it. - :vartype end_of_utterance_detection: "VoiceEndOfUtteranceDetection" - :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in - milliseconds. - :vartype speech_duration_ms: str - :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 - """ - - auto_truncate: bool - """Whether the input audio buffer is truncated automatically when speech stops.""" - type: Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_EN]] - """Required. English-optimized Azure semantic voice activity detection.""" - threshold: float - """Activation threshold for voice activity detection, from 0 to 1.""" - prefix_padding_ms: str - """Audio to include before detected speech, in milliseconds.""" - silence_duration_ms: str - """Silence required to end speech detection, in milliseconds.""" - idle_timeout_ms: str - """Maximum idle time before the detector ends the turn, in milliseconds.""" - end_of_utterance_detection: Optional["VoiceEndOfUtteranceDetection"] - """Semantic end-of-utterance detection configuration. Set to null to disable it.""" - speech_duration_ms: str - """Minimum speech duration required to trigger detection, in milliseconds.""" - remove_filler_words: bool - """Whether filler words are removed from transcription.""" - create_response: bool - """Whether a response is created automatically when speech stops.""" - interrupt_response: bool - """Whether user speech may interrupt the agent's response.""" - - -class VoiceAzureSemanticVadMultilingualTurnDetection(TypedDict, total=False): # pylint: disable=name-too-long - """Multilingual 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. Multilingual Azure semantic voice activity detection. - :vartype type: Literal[VoiceTurnDetectionType.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: str - :ivar silence_duration_ms: Silence required to end speech detection, in milliseconds. - :vartype silence_duration_ms: str - :ivar idle_timeout_ms: Maximum idle time before the detector ends the turn, in milliseconds. - :vartype idle_timeout_ms: str - :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. Set to - null to disable it. - :vartype end_of_utterance_detection: "VoiceEndOfUtteranceDetection" - :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in - milliseconds. - :vartype speech_duration_ms: str - :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] - """ - - auto_truncate: bool - """Whether the input audio buffer is truncated automatically when speech stops.""" - type: Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL]] - """Required. Multilingual Azure semantic voice activity detection.""" - threshold: float - """Activation threshold for voice activity detection, from 0 to 1.""" - prefix_padding_ms: str - """Audio to include before detected speech, in milliseconds.""" - silence_duration_ms: str - """Silence required to end speech detection, in milliseconds.""" - idle_timeout_ms: str - """Maximum idle time before the detector ends the turn, in milliseconds.""" - end_of_utterance_detection: Optional["VoiceEndOfUtteranceDetection"] - """Semantic end-of-utterance detection configuration. Set to null to disable it.""" - speech_duration_ms: str - """Minimum speech duration required to trigger detection, in milliseconds.""" - remove_filler_words: bool - """Whether filler words are removed from transcription.""" - create_response: bool - """Whether a response is created automatically when speech stops.""" - interrupt_response: bool - """Whether user speech may interrupt the agent's response.""" - languages: list[str] - """BCP-47 language codes used for speech detection.""" - - -class VoiceAzureSemanticVadTurnDetection(TypedDict, total=False): - """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: Literal[VoiceTurnDetectionType.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: str - :ivar silence_duration_ms: Silence required to end speech detection, in milliseconds. - :vartype silence_duration_ms: str - :ivar idle_timeout_ms: Maximum idle time before the detector ends the turn, in milliseconds. - :vartype idle_timeout_ms: str - :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. Set to - null to disable it. - :vartype end_of_utterance_detection: "VoiceEndOfUtteranceDetection" - :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in - milliseconds. - :vartype speech_duration_ms: str - :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] - """ - - auto_truncate: bool - """Whether the input audio buffer is truncated automatically when speech stops.""" - type: Required[Literal[VoiceTurnDetectionType.AZURE_SEMANTIC_VAD]] - """Required. Azure semantic voice activity detection.""" - threshold: float - """Activation threshold for voice activity detection, from 0 to 1.""" - prefix_padding_ms: str - """Audio to include before detected speech, in milliseconds.""" - silence_duration_ms: str - """Silence required to end speech detection, in milliseconds.""" - idle_timeout_ms: str - """Maximum idle time before the detector ends the turn, in milliseconds.""" - end_of_utterance_detection: Optional["VoiceEndOfUtteranceDetection"] - """Semantic end-of-utterance detection configuration. Set to null to disable it.""" - speech_duration_ms: str - """Minimum speech duration required to trigger detection, in milliseconds.""" - remove_filler_words: bool - """Whether filler words are removed from transcription.""" - create_response: bool - """Whether a response is created automatically when speech stops.""" - interrupt_response: bool - """Whether user speech may interrupt the agent's response.""" - languages: list[str] - """BCP-47 language codes used for speech detection.""" - - -class VoiceEndOfUtteranceDetection(TypedDict, total=False): - """Semantic end-of-utterance detection configuration. - - :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: Union[str, "VoiceEndOfUtteranceDetectionModel"] - :ivar threshold_level: The sensitivity threshold. Known values are: "low", "medium", "high", - and "default". - :vartype threshold_level: Union[str, "VoiceEndOfUtteranceThresholdLevel"] - :ivar timeout_ms: The detection timeout in milliseconds. - :vartype timeout_ms: str - """ - - model: Required[Union[str, "VoiceEndOfUtteranceDetectionModel"]] - """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: Union[str, "VoiceEndOfUtteranceThresholdLevel"] - """The sensitivity threshold. Known values are: \"low\", \"medium\", \"high\", and \"default\".""" - timeout_ms: str - """The detection timeout in milliseconds.""" - - -class VoiceFunctionCallItem(RealtimeConversationItemFunctionCall): - """A function call request item. - - :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: Literal["realtime.item"] - :ivar type: The type of the item. Always ``function_call``. Required. FUNCTION_CALL. - :vartype type: Literal[RealtimeConversationItemType.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: Literal["completed", "incomplete", "in_progress"] - :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: int - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str - """ - - created_at: int - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: str - """The id of the response that produced this item, when applicable.""" - - -class VoiceFunctionCallOutputItem(RealtimeConversationItemFunctionCallOutput): - """A function call output item. - - :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: Literal["realtime.item"] - :ivar type: The type of the item. Always ``function_call_output``. Required. - FUNCTION_CALL_OUTPUT. - :vartype type: Literal[RealtimeConversationItemType.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: Literal["completed", "incomplete", "in_progress"] - :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: int - :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 - """ - - created_at: int - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: str - """The id of the response that produced this item, when applicable.""" - name: str - """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``.""" - - -class VoiceInputTranscription(TypedDict, total=False): - """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 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 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: Literal["minimal", "low", "medium", "high", "xhigh"] - :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: Union[str, "VoiceInputTranscriptionModel"] - :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] - """ - - language: str - """The language of the input audio. Supplying the input language in `ISO-639-1 - `_ (e.g. ``en``) format will improve - accuracy and latency.""" - prompt: str - """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: Literal["minimal", "low", "medium", "high", "xhigh"] - """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: Required[Union[str, "VoiceInputTranscriptionModel"]] - """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: dict[str, str] - """Optional customer custom speech deployment configuration, keyed by locale.""" - phrase_list: list[str] - """Optional phrase hints that bias recognition toward domain terms.""" - - -class VoiceMcpApprovalRequestItem(RealtimeMCPApprovalRequest): - """An MCP approval request item. - - :ivar type: The type of the item. Always ``mcp_approval_request``. Required. - MCP_APPROVAL_REQUEST. - :vartype type: Literal[RealtimeConversationItemType.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: int - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str - """ - - created_at: int - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: str - """The id of the response that produced this item, when applicable.""" - - -class VoiceMcpApprovalResponseItem(RealtimeMCPApprovalResponse): - """An MCP approval response item (client-created). - - :ivar type: The type of the item. Always ``mcp_approval_response``. Required. - MCP_APPROVAL_RESPONSE. - :vartype type: Literal[RealtimeConversationItemType.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: int - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str - """ - - created_at: int - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: str - """The id of the response that produced this item, when applicable.""" - - -class VoiceMcpCallItem(RealtimeMCPToolCall): - """An MCP call item. - - :ivar type: The type of the item. Always ``mcp_call``. Required. MCP_CALL. - :vartype type: Literal[RealtimeConversationItemType.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: "RealtimeMCPError" - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: int - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str - """ - - created_at: int - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: str - """The id of the response that produced this item, when applicable.""" - - -class VoiceMcpListToolsItem(RealtimeMCPListTools): - """An MCP list-tools item. - - :ivar type: The type of the item. Always ``mcp_list_tools``. Required. MCP_LIST_TOOLS. - :vartype type: Literal[RealtimeConversationItemType.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["MCPListToolsTool"] - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: int - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str - """ - - created_at: int - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: str - """The id of the response that produced this item, when applicable.""" - - -class VoiceNoiseReduction(TypedDict, total=False): - """Input audio noise reduction configuration. - - :ivar type: The noise reduction mode. Required. Known values are: "near_field", "far_field", - and "azure_deep_noise_suppression". - :vartype type: Union[str, "VoiceNoiseReductionType"] - """ - - type: Required[Union[str, "VoiceNoiseReductionType"]] - """The noise reduction mode. Required. Known values are: \"near_field\", \"far_field\", and - \"azure_deep_noise_suppression\".""" - - -class VoiceResponseAudio(TypedDict, total=False): - """Audio configuration for a response. Follows the OpenAI Realtime GA ``audio`` object shape. - - :ivar output: The audio output configuration used for the response. - :vartype output: "VoiceResponseAudioOutput" - """ - - output: "VoiceResponseAudioOutput" - """The audio output configuration used for the response.""" - - -class VoiceResponseAudioOutput(TypedDict, total=False): - """The flat response audio-output projection, with optional ``voice``, ``voice_type``, - ``voice_locale``, and ``format`` fields. - - :ivar voice: The voice name used for the response's audio output. - :vartype voice: str - :ivar voice_type: The extensible provider/type of the voice used for the response's audio - output. Known values are: "openai", "azure-standard", "azure-custom", "azure-personal", - "avatar-voice-sync", and "azure-realtime-native". - :vartype voice_type: Union[str, "VoiceType"] - :ivar voice_locale: The BCP-47 locale of the voice used for the response's audio output. - :vartype voice_locale: str - :ivar format: The audio format used for the response's audio output. - :vartype format: "RealtimeAudioFormats" - """ - - voice: str - """The voice name used for the response's audio output.""" - voice_type: Union[str, "VoiceType"] - """The extensible provider/type of the voice used for the response's audio output. Known values - are: \"openai\", \"azure-standard\", \"azure-custom\", \"azure-personal\", - \"avatar-voice-sync\", and \"azure-realtime-native\".""" - voice_locale: str - """The BCP-47 locale of the voice used for the response's audio output.""" - format: "RealtimeAudioFormats" - """The audio format used for the response's audio output.""" - - -class VoiceServerVadTurnDetection(TypedDict, total=False): - """Server-side voice activity detection. - - :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech - stops. - :vartype auto_truncate: bool - :ivar threshold: - :vartype threshold: float - :ivar prefix_padding_ms: - :vartype prefix_padding_ms: int - :ivar silence_duration_ms: - :vartype silence_duration_ms: int - :ivar create_response: - :vartype create_response: bool - :ivar interrupt_response: - :vartype interrupt_response: bool - :ivar idle_timeout_ms: - :vartype idle_timeout_ms: int - :ivar type: Required. Server-side voice activity detection. - :vartype type: Literal[VoiceTurnDetectionType.SERVER_VAD] - :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in - milliseconds. - :vartype speech_duration_ms: str - :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. Set to - null to disable it. - :vartype end_of_utterance_detection: "VoiceEndOfUtteranceDetection" - """ - - auto_truncate: bool - """Whether the input audio buffer is truncated automatically when speech stops.""" - threshold: float - prefix_padding_ms: int - silence_duration_ms: int - create_response: bool - interrupt_response: bool - idle_timeout_ms: Optional[int] - type: Required[Literal[VoiceTurnDetectionType.SERVER_VAD]] - """Required. Server-side voice activity detection.""" - speech_duration_ms: str - """Minimum speech duration required to trigger detection, in milliseconds.""" - end_of_utterance_detection: Optional["VoiceEndOfUtteranceDetection"] - """Semantic end-of-utterance detection configuration. Set to null to disable it.""" - - -class VoiceSystemMessageItem(RealtimeConversationItemMessageSystem): - """A system message item. Only ``input_text`` content is valid for system messages. - - :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: Literal["realtime.item"] - :ivar type: The type of the item. Always ``message``. Required. Default value is "message". - :vartype type: Literal["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: Literal["completed", "incomplete", "in_progress"] - :ivar role: The role of the message sender. Always ``system``. Required. SYSTEM. - :vartype role: Literal[RealtimeConversationItemMessageType.SYSTEM] - :ivar content: The content of the message. Required. - :vartype content: list["RealtimeConversationItemMessageSystemContent"] - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: int - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str - """ - - created_at: int - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: str - """The id of the response that produced this item, when applicable.""" - - -class VoiceSystemTool(TypedDict, total=False): - """A service-managed control that acts on the active voice session without customer code or - external authentication. - - :ivar type: The type of the tool. Always ``system``. Required. Default value is "system". - :vartype type: Literal["system"] - :ivar name: The service-managed control action. Known values are stable; additional values may - be added over time. Required. "end_conversation" - :vartype name: Union[str, "VoiceSystemToolName"] - :ivar description: An optional description of the system tool. - :vartype description: str - """ - - type: Required[Literal["system"]] - """The type of the tool. Always ``system``. Required. Default value is \"system\".""" - name: Required[Union[str, "VoiceSystemToolName"]] - """The service-managed control action. Known values are stable; additional values may be added - over time. Required. \"end_conversation\"""" - description: str - """An optional description of the system tool.""" - - -class VoiceToolboxTool(TypedDict, total=False): - """A reference to a Foundry toolbox, which is a versioned bundle of tools executed through its MCP - endpoint. - - :ivar type: The type of the tool. Always ``toolbox``. Required. Default value is "toolbox". - :vartype type: Literal["toolbox"] - :ivar toolbox_name: The name of the toolbox to attach. Required. - :vartype toolbox_name: str - :ivar toolbox_version: The immutable version of the toolbox to attach. Required. - :vartype toolbox_version: str - :ivar response_scheduling: When the toolbox invocation creates a follow-up response. Defaults - to ``when_idle``. Known values are: "silent", "when_idle", "interrupt", and "skip_if_busy". - :vartype response_scheduling: Union[str, "VoiceAgentToolResponseScheduling"] - """ - - type: Required[Literal["toolbox"]] - """The type of the tool. Always ``toolbox``. Required. Default value is \"toolbox\".""" - toolbox_name: Required[str] - """The name of the toolbox to attach. Required.""" - toolbox_version: Required[str] - """The immutable version of the toolbox to attach. Required.""" - response_scheduling: Union[str, "VoiceAgentToolResponseScheduling"] - """When the toolbox invocation creates a follow-up response. Defaults to ``when_idle``. Known - values are: \"silent\", \"when_idle\", \"interrupt\", and \"skip_if_busy\".""" - - -class VoiceUserMessageItem(RealtimeConversationItemMessageUser): - """A user message item. ``input_text``, ``input_audio``, and ``input_image`` content are valid for - user messages. - - :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: Literal["realtime.item"] - :ivar type: The type of the item. Always ``message``. Required. Default value is "message". - :vartype type: Literal["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: Literal["completed", "incomplete", "in_progress"] - :ivar role: The role of the message sender. Always ``user``. Required. USER. - :vartype role: Literal[RealtimeConversationItemMessageType.USER] - :ivar content: The content of the message. Required. - :vartype content: list["RealtimeConversationItemMessageUserContent"] - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: int - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str - """ - - created_at: int - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: str - """The id of the response that produced this item, when applicable.""" - - -class WebIQPreviewTool(TypedDict, total=False): - """A WebIQ server-side tool. - - :ivar type: The object type, which is always 'web_iq_preview'. Required. WEB_IQ_PREVIEW. - :vartype type: Literal[ToolType.WEB_IQ_PREVIEW] - :ivar project_connection_id: The ID of the WebIQ project connection. Required. - :vartype project_connection_id: str - :ivar server_label: The label of the WebIQ MCP server to connect to. When omitted, the service - defaults to connection name extracted from project_connection_id. - :vartype server_label: str - :ivar require_approval: Whether the agent requires approval before executing actions. When - omitted, the service defaults to "always". Is either a MCPToolRequireApproval type or a str - type. - :vartype require_approval: Union["MCPToolRequireApproval", str] - """ - - type: Required[Literal[ToolType.WEB_IQ_PREVIEW]] - """The object type, which is always 'web_iq_preview'. Required. WEB_IQ_PREVIEW.""" - project_connection_id: Required[str] - """The ID of the WebIQ project connection. Required.""" - server_label: str - """The label of the WebIQ MCP server to connect to. When omitted, the service defaults to - connection name extracted from project_connection_id.""" - require_approval: Optional[Union["MCPToolRequireApproval", str]] - """Whether the agent requires approval before executing actions. When omitted, the service - defaults to \"always\". Is either a MCPToolRequireApproval type or a str type.""" - - -class WebIQPreviewToolboxTool(TypedDict, total=False): - """A WebIQ 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, "ToolConfig"] - :ivar type: Required. WEB_IQ_PREVIEW. - :vartype type: Literal[ToolboxToolType.WEB_IQ_PREVIEW] - :ivar project_connection_id: The ID of the WebIQ project connection. Required. - :vartype project_connection_id: str - :ivar server_label: The label of the WebIQ MCP server to connect to. When omitted, the service - defaults to connection name extracted from project_connection_id. - :vartype server_label: str - :ivar require_approval: Whether the agent requires approval before executing actions. When - omitted, the service defaults to "always". Is either a MCPToolRequireApproval type or a str - type. - :vartype require_approval: Union["MCPToolRequireApproval", str] - """ - - name: str - """Optional user-defined name for this tool or configuration.""" - description: str - """Optional user-defined description for this tool or configuration.""" - tool_configs: dict[str, "ToolConfig"] - """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.""" - type: Required[Literal[ToolboxToolType.WEB_IQ_PREVIEW]] - """Required. WEB_IQ_PREVIEW.""" - project_connection_id: Required[str] - """The ID of the WebIQ project connection. Required.""" - server_label: str - """The label of the WebIQ MCP server to connect to. When omitted, the service defaults to - connection name extracted from project_connection_id.""" - require_approval: Optional[Union["MCPToolRequireApproval", str]] - """Whether the agent requires approval before executing actions. When omitted, the service - defaults to \"always\". Is either a MCPToolRequireApproval type or a str type.""" - - -class WebSearchApproximateLocation(TypedDict, total=False): - """Web search approximate location. - - :ivar type: The type of location approximation. Always ``approximate``. Required. Default value - is "approximate". - :vartype type: Literal["approximate"] - :ivar country: - :vartype country: str - :ivar region: - :vartype region: str - :ivar city: - :vartype city: str - :ivar timezone: - :vartype timezone: str - """ - - type: Required[Literal["approximate"]] - """The type of location approximation. Always ``approximate``. Required. Default value is - \"approximate\".""" - country: Optional[str] - region: Optional[str] - city: Optional[str] - timezone: Optional[str] - - -class WebSearchConfiguration(TypedDict, total=False): - """A web search configuration for bing custom search. - - :ivar project_connection_id: Project connection id for grounding with bing custom search. - Required. - :vartype project_connection_id: str - :ivar instance_name: Name of the custom configuration instance given to config. Required. - :vartype instance_name: str - """ - - project_connection_id: Required[str] - """Project connection id for grounding with bing custom search. Required.""" - instance_name: Required[str] - """Name of the custom configuration instance given to config. Required.""" - - -class WebSearchPreviewTool(TypedDict, total=False): - """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: Literal[ToolType.WEB_SEARCH_PREVIEW] - :ivar user_location: - :vartype user_location: "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: Union[str, "SearchContextSize"] - :ivar search_content_types: - :vartype search_content_types: list[Union[str, "SearchContentType"]] - """ - - type: Required[Literal[ToolType.WEB_SEARCH_PREVIEW]] - """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["ApproximateLocation"] - search_context_size: Union[str, "SearchContextSize"] - """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: list[Union[str, "SearchContentType"]] - - -class WebSearchTool(TypedDict, total=False): - """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: Literal[ToolType.WEB_SEARCH] - :ivar filters: - :vartype filters: "WebSearchToolFilters" - :ivar user_location: - :vartype user_location: "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: Literal["low", "medium", "high"] - :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, "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: "WebSearchConfiguration" - """ - - type: Required[Literal[ToolType.WEB_SEARCH]] - """The type of the web search tool. One of ``web_search`` or ``web_search_2025_08_26``. Required. - WEB_SEARCH.""" - filters: Optional["WebSearchToolFilters"] - user_location: Optional["WebSearchApproximateLocation"] - search_context_size: Literal["low", "medium", "high"] - """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: str - """Deprecated. This property is deprecated and will be removed in a future version.""" - description: str - """Deprecated. This property is deprecated and will be removed in a future version.""" - tool_configs: dict[str, "ToolConfig"] - """Deprecated. This property is deprecated and will be removed in a future version.""" - custom_search_configuration: "WebSearchConfiguration" - """The project connections attached to this tool. There can be a maximum of 1 connection resource - attached to the tool.""" - - -class WebSearchToolboxTool(TypedDict, total=False): - """A web 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, "ToolConfig"] - :ivar type: Required. WEB_SEARCH. - :vartype type: Literal[ToolboxToolType.WEB_SEARCH] - :ivar filters: - :vartype filters: "WebSearchToolFilters" - :ivar user_location: - :vartype user_location: "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: Literal["low", "medium", "high"] - :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: "WebSearchConfiguration" - """ - - name: str - """Optional user-defined name for this tool or configuration.""" - description: str - """Optional user-defined description for this tool or configuration.""" - tool_configs: dict[str, "ToolConfig"] - """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.""" - type: Required[Literal[ToolboxToolType.WEB_SEARCH]] - """Required. WEB_SEARCH.""" - filters: Optional["WebSearchToolFilters"] - user_location: Optional["WebSearchApproximateLocation"] - search_context_size: Literal["low", "medium", "high"] - """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\"]""" - custom_search_configuration: "WebSearchConfiguration" - """The project connections attached to this tool. There can be a maximum of 1 connection resource - attached to the tool.""" - - -class WebSearchToolFilters(TypedDict, total=False): - """WebSearchToolFilters. - - :ivar allowed_domains: - :vartype allowed_domains: list[str] - """ - - allowed_domains: Optional[list[str]] - - -class WeeklyRecurrenceSchedule(TypedDict, total=False): - """Weekly recurrence schedule. - - :ivar type: Weekly recurrence type. Required. Weekly recurrence pattern. - :vartype type: Literal[RecurrenceType.WEEKLY] - :ivar days_of_week: Days of the week for the recurrence schedule. Required. - :vartype days_of_week: list[Union[str, "DayOfWeek"]] - """ - - type: Required[Literal[RecurrenceType.WEEKLY]] - """Weekly recurrence type. Required. Weekly recurrence pattern.""" - daysOfWeek: Required[list[Union[str, "DayOfWeek"]]] - """Days of the week for the recurrence schedule. Required.""" - - -class WorkflowAgentDefinition(TypedDict, total=False): - """The workflow agent definition. Microsoft Foundry is retiring workflows on December 1, 2026. If - you're looking to build new workflows, use Microsoft Agent Framework. To migrate existing - workflows, see the `Migration guide - `_. - - :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. - :vartype rai_config: "RaiConfig" - :ivar kind: Required. WORKFLOW. - :vartype kind: Literal[AgentKind.WORKFLOW] - :ivar workflow: The CSDL YAML definition of the workflow. - :vartype workflow: str - """ - - rai_config: "RaiConfig" - """Configuration for Responsible AI (RAI) content filtering and safety features.""" - kind: Required[Literal[AgentKind.WORKFLOW]] - """Required. WORKFLOW.""" - workflow: str - """The CSDL YAML definition of the workflow.""" - - -class WorkIQPreviewTool(TypedDict, total=False): - """A WorkIQ server-side tool. - - :ivar type: The object type, which is always 'work_iq_preview'. Required. WORK_IQ_PREVIEW. - :vartype type: Literal[ToolType.WORK_IQ_PREVIEW] - :ivar project_connection_id: The ID of the WorkIQ project connection. Required. - :vartype project_connection_id: str - """ - - type: Required[Literal[ToolType.WORK_IQ_PREVIEW]] - """The object type, which is always 'work_iq_preview'. Required. WORK_IQ_PREVIEW.""" - project_connection_id: Required[str] - """The ID of the WorkIQ project connection. Required.""" - - -class WorkIQPreviewToolboxTool(TypedDict, total=False): - """A WorkIQ 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, "ToolConfig"] - :ivar type: Required. WORK_IQ_PREVIEW. - :vartype type: Literal[ToolboxToolType.WORK_IQ_PREVIEW] - :ivar project_connection_id: The ID of the WorkIQ project connection. Required. - :vartype project_connection_id: str - """ - - name: str - """Optional user-defined name for this tool or configuration.""" - description: str - """Optional user-defined description for this tool or configuration.""" - tool_configs: dict[str, "ToolConfig"] - """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.""" - type: Required[Literal[ToolboxToolType.WORK_IQ_PREVIEW]] - """Required. WORK_IQ_PREVIEW.""" - project_connection_id: Required[str] - """The ID of the WorkIQ project connection. Required.""" - - -class CreateMemoryStoreRequest(TypedDict, total=False): - """CreateMemoryStoreRequest. - - :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 memory store definition. Required. - :vartype definition: "MemoryStoreDefinition" - """ - - name: Required[str] - """The name of the memory store. Required.""" - description: str - """A human-readable description of the memory store.""" - metadata: dict[str, str] - """Arbitrary key-value metadata to associate with the memory store.""" - definition: Required["MemoryStoreDefinition"] - """The memory store definition. Required.""" - - -class UpdateMemoryStoreRequest(TypedDict, total=False): - """UpdateMemoryStoreRequest. - - :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] - """ - - description: str - """A human-readable description of the memory store.""" - metadata: dict[str, str] - """Arbitrary key-value metadata to associate with the memory store.""" - - -class SearchMemoriesRequest(TypedDict, total=False): - """SearchMemoriesRequest. - - :ivar scope: The namespace that logically groups and isolates memories, such as a user ID. - Required. - :vartype scope: str - :ivar items: Items for which to search for relevant memories. - :vartype items: list[dict[str, Any]] - :ivar previous_search_id: The unique ID of the previous search request, enabling incremental - memory search from where the last operation left off. - :vartype previous_search_id: str - :ivar options: Memory search options. - :vartype options: "MemorySearchOptions" - """ - - scope: Required[str] - """The namespace that logically groups and isolates memories, such as a user ID. Required.""" - items: list[dict[str, Any]] - """Items for which to search for relevant memories.""" - previous_search_id: str - """The unique ID of the previous search request, enabling incremental memory search from where the - last operation left off.""" - options: "MemorySearchOptions" - """Memory search options.""" - - -class UpdateMemoriesRequest(TypedDict, total=False): - """UpdateMemoriesRequest. - - :ivar scope: The namespace that logically groups and isolates memories, such as a user ID. - Required. - :vartype scope: str - :ivar items_property: Conversation items to be stored in memory. - :vartype items_property: list[dict[str, Any]] - :ivar previous_update_id: The unique ID of the previous update request, enabling incremental - memory updates from where the last operation left off. - :vartype previous_update_id: str - :ivar update_delay: Timeout period before processing the memory update in seconds. If a new - update request is received during this period, it will cancel the current request and reset the - timeout. Set to 0 to immediately trigger the update without delay. Defaults to 300 (5 minutes). - :vartype update_delay: int - """ - - scope: Required[str] - """The namespace that logically groups and isolates memories, such as a user ID. Required.""" - items: list[dict[str, Any]] - """Conversation items to be stored in memory.""" - previous_update_id: str - """The unique ID of the previous update request, enabling incremental memory updates from where - the last operation left off.""" - update_delay: int - """Timeout period before processing the memory update in seconds. If a new update request is - received during this period, it will cancel the current request and reset the timeout. Set to 0 - to immediately trigger the update without delay. Defaults to 300 (5 minutes).""" - - -class DeleteScopeRequest(TypedDict, total=False): - """DeleteScopeRequest. - - :ivar scope: The namespace that logically groups and isolates memories to delete, such as a - user ID. Required. - :vartype scope: str - """ - - scope: Required[str] - """The namespace that logically groups and isolates memories to delete, such as a user ID. - Required.""" - - -class CreateMemoryRequest(TypedDict, total=False): - """CreateMemoryRequest. - - :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. Known values are: "user_profile", - "chat_summary", and "procedural". - :vartype kind: Union[str, "MemoryItemKind"] - """ - - scope: Required[str] - """The namespace that logically groups and isolates memories, such as a user ID. Required.""" - content: Required[str] - """The content of the memory. Required.""" - kind: Required[Union[str, "MemoryItemKind"]] - """The kind of the memory item. Required. Known values are: \"user_profile\", \"chat_summary\", - and \"procedural\".""" - - -class UpdateMemoryRequest(TypedDict, total=False): - """UpdateMemoryRequest. - - :ivar content: The updated content of the memory. Required. - :vartype content: str - """ - - content: Required[str] - """The updated content of the memory. Required.""" - - -class ListMemoriesRequest(TypedDict, total=False): - """ListMemoriesRequest. - - :ivar scope: The namespace that logically groups and isolates memories, such as a user ID. - Required. - :vartype scope: str - """ - - scope: Required[str] - """The namespace that logically groups and isolates memories, such as a user ID. Required.""" - - -class CreateOrUpdateRoutineRequest(TypedDict, total=False): - """CreateOrUpdateRoutineRequest. - - :ivar description: A human-readable description of the routine. - :vartype description: str - :ivar enabled: Whether the routine is enabled. - :vartype enabled: bool - :ivar triggers: The triggers configured for the routine. In v1, exactly one trigger entry is - supported. - :vartype triggers: dict[str, "RoutineTrigger"] - :ivar action: The action executed when the routine fires. - :vartype action: "RoutineAction" - """ - - description: str - """A human-readable description of the routine.""" - enabled: bool - """Whether the routine is enabled.""" - triggers: dict[str, "RoutineTrigger"] - """The triggers configured for the routine. In v1, exactly one trigger entry is supported.""" - action: "RoutineAction" - """The action executed when the routine fires.""" - - -class DispatchRoutineAsyncRequest(TypedDict, total=False): - """DispatchRoutineAsyncRequest. - - :ivar payload: A direct action-input override sent downstream when testing a routine. - :vartype payload: "RoutineDispatchPayload" - """ - - payload: "RoutineDispatchPayload" - """A direct action-input override sent downstream when testing a routine.""" - - -class UpdateSkillRequest(TypedDict, total=False): - """UpdateSkillRequest. - - :ivar default_version: The version identifier that the skill should point to. When set, the - skill's default version will resolve to this version instead of the latest. Required. - :vartype default_version: str - """ - - default_version: Required[str] - """The version identifier that the skill should point to. When set, the skill's default version - will resolve to this version instead of the latest. Required.""" - - -class CreateSkillVersionRequest(TypedDict, total=False): - """CreateSkillVersionRequest. - - :ivar inline_content: Inline skill content for simple skills without file uploads. - Foundry-specific extension. - :vartype inline_content: "SkillInlineContent" - :ivar default: Whether to set this version as the default. - :vartype default: bool - """ - - inline_content: "SkillInlineContent" - """Inline skill content for simple skills without file uploads. Foundry-specific extension.""" - default: bool - """Whether to set this version as the default.""" - - -class CreateAgentVersionRequest(TypedDict, total=False): - """CreateAgentVersionRequest. - - :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. - :vartype metadata: dict[str, str] - :ivar description: A human-readable description of the agent. - :vartype description: str - :ivar definition: The agent definition. This can be a prompt, workflow, hosted, external, or - voice agent definition. Required. - :vartype definition: "AgentDefinition" - :ivar blueprint_reference: The blueprint reference for the agent. - :vartype blueprint_reference: "AgentBlueprintReference" - :ivar draft: (Preview) Whether this agent version is a draft (candidate) rather than a release. - The service defaults to ``false`` if a value is not specified by the caller. Draft versions are - recorded but excluded from default 'latest' resolution and are not auto-promoted. - :vartype draft: bool - """ - - metadata: dict[str, str] - """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.""" - description: str - """A human-readable description of the agent.""" - definition: Required["AgentDefinition"] - """The agent definition. This can be a prompt, workflow, hosted, external, or voice agent - definition. Required.""" - blueprint_reference: "AgentBlueprintReference" - """The blueprint reference for the agent.""" - draft: bool - """(Preview) Whether this agent version is a draft (candidate) rather than a release. The service - defaults to ``false`` if a value is not specified by the caller. Draft versions are recorded - but excluded from default 'latest' resolution and are not auto-promoted.""" - - -class CreateAgentVersionFromManifestRequest(TypedDict, total=False): - """CreateAgentVersionFromManifestRequest. - - :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. - :vartype metadata: dict[str, str] - :ivar description: A human-readable description of the agent. - :vartype description: str - :ivar manifest_id: The manifest ID to import the agent version from. Required. - :vartype manifest_id: str - :ivar parameter_values: The inputs to the manifest that will result in a fully materialized - Agent. Required. - :vartype parameter_values: dict[str, Any] - """ - - metadata: dict[str, str] - """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.""" - description: str - """A human-readable description of the agent.""" - manifest_id: Required[str] - """The manifest ID to import the agent version from. Required.""" - parameter_values: Required[dict[str, Any]] - """The inputs to the manifest that will result in a fully materialized Agent. Required.""" - - -class PatchAgentObjectRequest(TypedDict, total=False): - """PatchAgentObjectRequest. - - :ivar agent_endpoint: The endpoint configuration for the agent. - :vartype agent_endpoint: "AgentEndpointConfig" - :ivar agent_card: Optional agent card for the agent. - :vartype agent_card: "AgentCard" - """ - - agent_endpoint: "AgentEndpointConfig" - """The endpoint configuration for the agent.""" - agent_card: "AgentCard" - """Optional agent card for the agent.""" - - -class CreateSessionRequest(TypedDict, total=False): - """CreateSessionRequest. - - :ivar agent_session_id: Optional caller-provided session ID. If specified, it must be unique - within the agent endpoint. Auto-generated if omitted. - :vartype agent_session_id: str - :ivar version_indicator: Determines which agent version backs the session. Required. - :vartype version_indicator: "VersionIndicator" - """ - - agent_session_id: str - """Optional caller-provided session ID. If specified, it must be unique within the agent endpoint. - Auto-generated if omitted.""" - version_indicator: Required["VersionIndicator"] - """Determines which agent version backs the session. Required.""" - - -class CreateToolboxVersionRequest(TypedDict, total=False): - """CreateToolboxVersionRequest. - - :ivar description: A human-readable description of the toolbox. - :vartype description: str - :ivar metadata: Arbitrary key-value metadata to associate with the toolbox. - :vartype metadata: dict[str, str] - :ivar tools: The list of tools to include in this version. Required. - :vartype tools: list["ToolboxTool"] - :ivar skills: The list of skill sources to include in this version. A skill reference specifies - a skill name and optionally a version. If version is omitted, the skill's default version is - used. - :vartype skills: list["ToolboxSkill"] - :ivar policies: Policy configuration for this toolbox version. - :vartype policies: "ToolboxPolicies" - """ - - description: str - """A human-readable description of the toolbox.""" - metadata: dict[str, str] - """Arbitrary key-value metadata to associate with the toolbox.""" - tools: Required[list["ToolboxTool"]] - """The list of tools to include in this version. Required.""" - skills: list["ToolboxSkill"] - """The list of skill sources to include in this version. A skill reference specifies a skill name - and optionally a version. If version is omitted, the skill's default version is used.""" - policies: "ToolboxPolicies" - """Policy configuration for this toolbox version.""" - - -class UpdateToolboxRequest1(TypedDict, total=False): - """UpdateToolboxRequest1. - - :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 - """ - - default_version: Required[str] - """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.""" - - -Tool = Union[ - A2ATool, - A2APreviewTool, - ApplyPatchToolParam, - AzureAISearchTool, - AzureFunctionTool, - BingCustomSearchPreviewTool, - BingGroundingTool, - BrowserAutomationPreviewTool, - CaptureStructuredOutputsTool, - CodeInterpreterTool, - ComputerTool, - ComputerUsePreviewTool, - CustomToolParam, - MicrosoftFabricPreviewTool, - FabricIQPreviewTool, - FileSearchTool, - FunctionTool, - ImageGenTool, - LocalShellToolParam, - MCPTool, - MemorySearchPreviewTool, - NamespaceToolParam, - OpenApiTool, - ProgrammaticToolCallingParam, - SharepointPreviewTool, - FunctionShellToolParam, - ToolSearchToolParam, - WebIQPreviewTool, - WebSearchTool, - WebSearchPreviewTool, - WorkIQPreviewTool, -] -ToolboxTool = Union[ - A2AToolboxTool, - A2APreviewToolboxTool, - AzureAISearchToolboxTool, - BrowserAutomationPreviewToolboxTool, - CodeInterpreterToolboxTool, - FabricIQPreviewToolboxTool, - FileSearchToolboxTool, - MCPToolboxTool, - OpenApiToolboxTool, - ReminderPreviewToolboxTool, - ToolSearchToolboxTool, - ToolboxSearchPreviewToolboxTool, - WebIQPreviewToolboxTool, - WebSearchToolboxTool, - WorkIQPreviewToolboxTool, -] -AgentBlueprintReference = Union[ManagedAgentIdentityBlueprintReference] -InsightRequest = Union[ - AgentClusterInsightRequest, EvaluationComparisonInsightRequest, EvaluationRunClusterInsightRequest -] -InsightResult = Union[AgentClusterInsightResult, EvaluationComparisonInsightResult, EvaluationRunClusterInsightResult] -DataGenerationJobSource = Union[ - AgentDataGenerationJobSource, - FileDataGenerationJobSource, - PromptDataGenerationJobSource, - TracesDataGenerationJobSource, -] -AgentDefinition = Union[ - ExternalAgentDefinition, HostedAgentDefinition, PromptAgentDefinition, VoiceAgentDefinition, WorkflowAgentDefinition -] -AgentEndpointAuthorizationScheme = Union[ - BotServiceAuthorizationScheme, - BotServiceRbacAuthorizationScheme, - BotServiceTenantAuthorizationScheme, - EntraAuthorizationScheme, -] -EvaluatorGenerationJobSource = Union[ - AgentEvaluatorGenerationJobSource, - DatasetEvaluatorGenerationJobSource, - PromptEvaluatorGenerationJobSource, - TracesEvaluatorGenerationJobSource, -] -AgentOptimizationDatasetInput = Union[AgentOptimizationInlineDatasetInput, AgentOptimizationReferenceDatasetInput] -EvaluationTaxonomyInput = Union[AgentTaxonomyInput] -EvaluationTarget = Union[AzureAIAgentTarget, AzureAIModelTarget] -Index = Union[AzureAISearchIndex, CosmosDBIndex, ManagedAzureAISearchIndex] -RedTeamTargetConfig = Union[AzureOpenAIModelConfiguration] -EvaluatorDefinition = Union[ - CodeBasedEvaluatorDefinition, - EndpointBasedEvaluatorDefinition, - PromptBasedEvaluatorDefinition, - RubricBasedEvaluatorDefinition, -] -FunctionShellToolParamEnvironment = Union[ - ContainerAutoParam, - FunctionShellToolParamEnvironmentContainerReferenceParam, - FunctionShellToolParamEnvironmentLocalEnvironmentParam, -] -ContainerNetworkPolicyParam = Union[ContainerNetworkPolicyAllowlistParam, ContainerNetworkPolicyDisabledParam] -ContainerSkill = Union[InlineSkillParam, SkillReferenceParam] -EvaluationRuleAction = Union[ContinuousEvaluationRuleAction, HumanEvaluationPreviewRuleAction] -CreateTranscriptionResponseJsonUsage = Union[TranscriptTextUsageDuration, TranscriptTextUsageTokens] -Trigger = Union[CronTrigger, OneTimeTrigger, RecurrenceTrigger] -CustomToolParamFormat = Union[CustomGrammarFormatParam, CustomTextFormatParam] -RoutineTrigger = Union[CustomRoutineTrigger, GitHubIssueRoutineTrigger, ScheduleRoutineTrigger, TimerRoutineTrigger] -RecurrenceSchedule = Union[ - DailyRecurrenceSchedule, HourlyRecurrenceSchedule, MonthlyRecurrenceSchedule, WeeklyRecurrenceSchedule -] -DataGenerationJobOptions = Union[ - SimpleQnADataGenerationJobOptions, - SimulationSeedDataGenerationJobOptions, - ToolUseFineTuningDataGenerationJobOptions, - TracesDataGenerationJobOptions, -] -DataGenerationJobOutput = Union[DatasetDataGenerationJobOutput, FileDataGenerationJobOutput] -DatasetVersion = Union[FileDatasetVersion, FolderDatasetVersion] -InsightSample = Union[EvaluationResultSample] -ScheduleTask = Union[EvaluationScheduleTask, InsightScheduleTask] -VersionSelectionRule = Union[FixedRatioVersionSelectionRule] -TelemetryEndpointAuth = Union[HeaderTelemetryEndpointAuth] -RoutineDispatchPayload = Union[InvokeAgentInvocationsApiDispatchPayload, InvokeAgentResponsesApiDispatchPayload] -RoutineAction = Union[InvokeAgentInvocationsApiRoutineAction, InvokeAgentResponsesApiRoutineAction] -VoiceGreetingConfig = Union[LlmGeneratedVoiceGreetingConfig, TemplateVoiceGreetingConfig] -MemoryStoreDefinition = Union[MemoryStoreDefaultDefinition] -OpenApiAuthDetails = Union[OpenApiAnonymousAuthDetails, OpenApiManagedAuthDetails, OpenApiProjectConnectionAuthDetails] -TelemetryEndpoint = Union[OtlpTelemetryEndpoint] -RealtimeAudioFormats = Union[RealtimeAudioFormatsAudioPcm, RealtimeAudioFormatsAudioPcma, RealtimeAudioFormatsAudioPcmu] -RealtimeConversationItem = Union[ - RealtimeConversationItemFunctionCall, - RealtimeConversationItemFunctionCallOutput, - RealtimeMCPApprovalRequest, - RealtimeMCPApprovalResponse, - RealtimeMCPToolCall, - RealtimeMCPListTools, -] -RealtimeConversationItemMessage = Union[ - RealtimeConversationItemMessageAssistant, RealtimeConversationItemMessageSystem, RealtimeConversationItemMessageUser -] -RealtimeMCPError = Union[RealtimeMCPHTTPError, RealtimeMCPProtocolError, RealtimeMCPToolExecutionError] -RealtimeServerEvent = Union[RealtimeServerEventResponseContentPartAdded] -ToolChoiceParam = Union[ - ToolChoiceAllowed, - SpecificApplyPatchParam, - ToolChoiceCodeInterpreter, - ToolChoiceComputer, - ToolChoiceComputerUse, - ToolChoiceComputerUsePreview, - ToolChoiceCustom, - ToolChoiceFileSearch, - ToolChoiceFunction, - ToolChoiceImageGeneration, - ToolChoiceMCP, - SpecificProgrammaticToolCallingParam, - SpecificFunctionShellParam, - ToolChoiceWebSearchPreview, - ToolChoiceWebSearchPreview20250311, -] -TextResponseFormat = Union[TextResponseFormatJsonObject, TextResponseFormatJsonSchema, TextResponseFormatText] -ToolboxSkill = Union[ToolboxSkillReference] -VersionIndicator = Union[VersionRefIndicator] -VoiceAgentTool = Union[VoiceAgentFunctionTool, VoiceAgentMcpTool, VoiceSystemTool, VoiceToolboxTool] -VoiceAgentInterimResponseConfig = Union[VoiceAgentLlmInterimResponseConfig, VoiceAgentStaticInterimResponseConfig] -VoiceTurnDetection = Union[ - VoiceAzureSemanticVadTurnDetection, - VoiceAzureSemanticVadEnTurnDetection, - VoiceAzureSemanticVadMultilingualTurnDetection, - VoiceAgentSemanticVadTurnDetection, - VoiceServerVadTurnDetection, -] diff --git a/sdk/ai/azure-ai-projects/docs/public-methods.md b/sdk/ai/azure-ai-projects/docs/public-methods.md index c97415c1f34d..646731b69f07 100644 --- a/sdk/ai/azure-ai-projects/docs/public-methods.md +++ b/sdk/ai/azure-ai-projects/docs/public-methods.md @@ -4,17 +4,16 @@ This document lists all public methods available on `AIProjectClient` and its su ## Summary -There are a total of 154 unique public methods: +There are a total of 170 unique public methods: - 5 stable methods on the client -- 68 stable methods on top-level sub-clients -- 81 beta methods on nested beta sub-clients +- 59 stable methods on top-level sub-clients +- 106 beta methods on nested beta sub-clients ### Top-level sub-clients (stable operations) | Subclient | Class Name | Methods Count | |-----------|------------|----------------| -| `agents` | AgentsOperations | 24 | -| `agent_endpoint_conversations` | AgentEndpointConversationsOperations | 12 | +| `agents` | AgentsOperations | 27 | | `connections` | ConnectionsOperations | 3 | | `datasets` | DatasetsOperations | 9 | | `deployments` | DeploymentsOperations | 2 | @@ -27,6 +26,8 @@ There are a total of 154 unique public methods: | Subclient | Class Name | Methods Count | |-----------|------------|----------------| +| `beta.agent_endpoint_conversations` | BetaAgentEndpointConversationsOperations | 12 | +| `beta.agent_insight_monitors` | BetaAgentInsightMonitorsOperations | 13 | | `beta.agents` | BetaAgentsOperations | 5 | | `beta.datasets` | BetaDatasetsOperations | 5 | | `beta.evaluation_taxonomies` | BetaEvaluationTaxonomiesOperations | 5 | @@ -71,6 +72,8 @@ Alphabetically sorted. An asterisk at the end of the method name means is a hand .agents.enable .agents.generate_agent* .agents.get +.agents.get_microsoft365_package +.agents.get_microsoft365_publish_defaults .agents.get_session .agents.get_session_log_stream .agents.get_version @@ -78,23 +81,11 @@ Alphabetically sorted. An asterisk at the end of the method name means is a hand .agents.list_session_files .agents.list_sessions .agents.list_versions +.agents.publish_to_microsoft365 .agents.stop_session .agents.update_details .agents.upload_session_file -.agent_endpoint_conversations.delete_agent_conversation -.agent_endpoint_conversations.get_agent_conversation -.agent_endpoint_conversations.get_agent_conversation_audio -.agent_endpoint_conversations.get_agent_conversation_audio_content -.agent_endpoint_conversations.get_agent_conversation_item -.agent_endpoint_conversations.get_agent_conversation_item_audio -.agent_endpoint_conversations.get_agent_conversation_item_audio_content -.agent_endpoint_conversations.get_agent_conversation_response -.agent_endpoint_conversations.list_agent_conversation_items -.agent_endpoint_conversations.list_agent_conversation_response_items -.agent_endpoint_conversations.list_agent_conversation_responses -.agent_endpoint_conversations.list_agent_conversations - .connections.get* .connections.get_default* .connections.list @@ -140,6 +131,33 @@ Alphabetically sorted. An asterisk at the end of the method name means is a hand Alphabetically sorted. An asterisk at the end of the method name means is a hand-written method. ``` +.beta.agent_endpoint_conversations.delete_agent_conversation +.beta.agent_endpoint_conversations.get_agent_conversation +.beta.agent_endpoint_conversations.get_agent_conversation_audio +.beta.agent_endpoint_conversations.get_agent_conversation_audio_content +.beta.agent_endpoint_conversations.get_agent_conversation_item +.beta.agent_endpoint_conversations.get_agent_conversation_item_audio +.beta.agent_endpoint_conversations.get_agent_conversation_item_audio_content +.beta.agent_endpoint_conversations.get_agent_conversation_response +.beta.agent_endpoint_conversations.list_agent_conversation_items +.beta.agent_endpoint_conversations.list_agent_conversation_response_items +.beta.agent_endpoint_conversations.list_agent_conversation_responses +.beta.agent_endpoint_conversations.list_agent_conversations + +.beta.agent_insight_monitors.begin_create_run +.beta.agent_insight_monitors.cancel_run +.beta.agent_insight_monitors.create +.beta.agent_insight_monitors.delete +.beta.agent_insight_monitors.get +.beta.agent_insight_monitors.get_insight +.beta.agent_insight_monitors.get_run +.beta.agent_insight_monitors.list +.beta.agent_insight_monitors.list_insights +.beta.agent_insight_monitors.list_runs +.beta.agent_insight_monitors.reset +.beta.agent_insight_monitors.update +.beta.agent_insight_monitors.update_insight + .beta.agents.cancel_optimization_job .beta.agents.begin_create_optimization_job* .beta.agents.delete_optimization_job diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_basic.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_basic.py index 06eea164ba76..165e0c86d6a5 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_basic.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_basic.py @@ -39,8 +39,8 @@ from azure.ai.projects.models import ( AgentKind, VoiceAgentDefinition, - VoiceAudioConfig, - VoiceAudioOutputConfig, + VoiceAgentAudioConfig, + VoiceAgentAudioOutputConfig, VoiceModelType, VoiceOutputModality, VoiceType, @@ -63,8 +63,8 @@ model_type=VoiceModelType.MANAGED, model=model, instructions="You are a friendly voice assistant. Keep replies short and natural.", - audio=VoiceAudioConfig( - output=VoiceAudioOutputConfig(voice="en-US-AvaNeural", voice_type=VoiceType.AZURE_STANDARD), + audio=VoiceAgentAudioConfig( + output=VoiceAgentAudioOutputConfig(voice="en-US-AvaNeural", voice_type=VoiceType.AZURE_STANDARD), ), output_modalities=[VoiceOutputModality.AUDIO], # Persist conversations so the transcript and audio can be read back later diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py index 6fc4a7fd8c68..f8fbe62babe9 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py @@ -60,12 +60,12 @@ AgentKind, GenerateVoiceAgentRequest, VoiceAgentDefinition, - VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted, - VoiceAgentServerEventInputAudioBufferSpeechStarted, - VoiceAgentServerEventResponseAudioDelta, - VoiceAgentServerEventResponseAudioTranscriptDone, - VoiceAgentServerEventResponseDone, - VoiceAgentServerEventSessionCreated, + RealtimeServerEventConversationItemInputAudioTranscriptionCompleted, + RealtimeServerEventInputAudioBufferSpeechStarted, + RealtimeServerEventResponseAudioDelta, + RealtimeServerEventResponseAudioTranscriptDone, + RealtimeServerEventResponseDone, + RealtimeServerEventSessionCreated, RealtimeServerEventError, ) @@ -241,28 +241,28 @@ async def _run_audio_conversation(client: AIProjectClient, agent_name: str) -> O try: async for event in conn: - if isinstance(event, VoiceAgentServerEventSessionCreated): + if isinstance(event, RealtimeServerEventSessionCreated): # The persisted conversation id (only present when conversation # persistence is enabled) is set here, not on response.done. conversation_id = event.conversation_id or conversation_id - elif isinstance(event, VoiceAgentServerEventInputAudioBufferSpeechStarted): + elif isinstance(event, RealtimeServerEventInputAudioBufferSpeechStarted): # Barge-in: stop the active response and drop whatever reply # audio is still queued locally. The service only supports # output_audio_buffer.clear in avatar mode. await conn.response.cancel() ap.skip_pending_audio() print("(listening...)") - elif isinstance(event, VoiceAgentServerEventConversationItemInputAudioTranscriptionCompleted): + elif isinstance(event, RealtimeServerEventConversationItemInputAudioTranscriptionCompleted): print(f"You: {event.transcript.strip()}") elif isinstance(event, RealtimeServerEventError): # Non-fatal errors are reported; a fatal one closes the socket. print(f"Session error: {event.error.message}") - elif isinstance(event, VoiceAgentServerEventResponseAudioDelta): + elif isinstance(event, RealtimeServerEventResponseAudioDelta): # Each delta is a decoded PCM16 chunk; queue it. ap.queue_audio(event.delta) - elif isinstance(event, VoiceAgentServerEventResponseAudioTranscriptDone): + elif isinstance(event, RealtimeServerEventResponseAudioTranscriptDone): print(f"Agent: {event.transcript}") - elif isinstance(event, VoiceAgentServerEventResponseDone): + elif isinstance(event, RealtimeServerEventResponseDone): pass except (KeyboardInterrupt, asyncio.CancelledError): # Ctrl-C ends the session; read back whatever was persisted so far. @@ -284,7 +284,7 @@ async def _read_conversation(client: AIProjectClient, agent_name: str, conversat :type agent_name: str :type conversation_id: str """ - conversations = client.agent_endpoint_conversations + conversations = client.beta.agent_endpoint_conversations conversation = await conversations.get_agent_conversation(agent_name, conversation_id) print(f"Conversation {conversation.id}: status={conversation.status}, created_at={conversation.created_at}") @@ -339,7 +339,7 @@ async def audio_conversation() -> None: except HttpResponseError as e: print(f"Could not read conversation: {e.status_code} {e.reason}") # To fetch this session's audio afterward, use - # `project_client.agent_endpoint_conversations`: + # `project_client.beta.agent_endpoint_conversations`: # - get_agent_conversation_audio(agent_name, conversation_id) for the merged # whole-call stereo recording's metadata, then # get_agent_conversation_audio_content(agent_name, conversation_id) to stream diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_function_tool.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_function_tool.py index 7ddd33c51127..ab9cb2050f81 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_function_tool.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_function_tool.py @@ -37,17 +37,15 @@ from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( - RealtimeConversationItemMessageUserContent, + RealtimeConversationItemFunctionCallOutput, RealtimeFunctionTool, RealtimeServerEventError, VoiceAgentDefinition, - VoiceAgentServerEventResponseDone, - VoiceAgentServerEventResponseFunctionCallArgumentsDone, - VoiceAgentServerEventResponseTextDone, - VoiceFunctionCallOutputItem, + RealtimeServerEventResponseDone, + RealtimeServerEventResponseFunctionCallArgumentsDone, + RealtimeServerEventResponseTextDone, VoiceModelType, VoiceOutputModality, - VoiceUserMessageItem, ) load_dotenv() @@ -78,15 +76,15 @@ def _run_turn_with_tool_support(client: AIProjectClient, agent_name: str, prompt :type prompt: str """ with client.realtime.connect(agent_name=agent_name) as conn: + # Message-type conversation items (system/user/assistant) don't have dedicated generated + # models in this API version, so they're sent as a raw mapping matching the wire schema. conn.conversation.item.create( - item=VoiceUserMessageItem( - content=[RealtimeConversationItemMessageUserContent(type="input_text", text=prompt)] - ) + item={"type": "message", "role": "user", "content": [{"type": "input_text", "text": prompt}]} ) conn.response.create() for event in conn: - if isinstance(event, VoiceAgentServerEventResponseFunctionCallArgumentsDone): + if isinstance(event, RealtimeServerEventResponseFunctionCallArgumentsDone): # The service forwards the call to us; execute it locally and # send the result back so the agent can use it in its reply. args = json.loads(event.arguments) @@ -96,13 +94,15 @@ def _run_turn_with_tool_support(client: AIProjectClient, agent_name: str, prompt else: result = json.dumps({"error": f"Unknown tool: {event.name}"}) - conn.conversation.item.create(item=VoiceFunctionCallOutputItem(call_id=event.call_id, output=result)) + conn.conversation.item.create( + item=RealtimeConversationItemFunctionCallOutput(call_id=event.call_id, output=result) + ) conn.response.create() - elif isinstance(event, VoiceAgentServerEventResponseTextDone): + elif isinstance(event, RealtimeServerEventResponseTextDone): # The sample agent uses a text-only output modality, so the # reply arrives as output text rather than an audio transcript. print(f"Agent: {event.text}") - elif isinstance(event, VoiceAgentServerEventResponseDone): + elif isinstance(event, RealtimeServerEventResponseDone): # A response.done that isn't a function call is the final answer for this turn. # Output items surface as plain mappings (open union), so use dict-style access. if not any( diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py index c246be042c50..289978bc4920 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py @@ -14,9 +14,10 @@ then publish a version with `store=True` so the conversation can be read back afterward. 2. Hold a typed, multi-turn conversation: each prompt is sent as a - ``VoiceUserMessageItem`` and the reply streams back as - typed audio and transcript events. Blank line (or ``exit`` / ``quit``) - ends it. + raw ``conversation.item.create`` message item (message-type items no + longer have a dedicated generated model in this API version) and the + reply streams back as typed audio and transcript events. Blank line + (or ``exit`` / ``quit``) ends it. 3. Fetch the persisted conversation back by id. 4. Delete the agent created for this sample. @@ -51,14 +52,12 @@ from azure.ai.projects.models import ( AgentKind, GenerateVoiceAgentRequest, - RealtimeConversationItemMessageUserContent, VoiceAgentDefinition, - VoiceAgentServerEventResponseAudioDelta, - VoiceAgentServerEventResponseAudioTranscriptDone, - VoiceAgentServerEventResponseDone, - VoiceAgentServerEventSessionCreated, + RealtimeServerEventResponseAudioDelta, + RealtimeServerEventResponseAudioTranscriptDone, + RealtimeServerEventResponseDone, + RealtimeServerEventSessionCreated, RealtimeServerEventError, - VoiceUserMessageItem, ) load_dotenv() @@ -151,20 +150,20 @@ def _run_text_conversation(client: AIProjectClient, agent_name: str) -> Optional def pump() -> None: nonlocal conversation_id, audio_delta_count for event in conn: - if isinstance(event, VoiceAgentServerEventSessionCreated): + if isinstance(event, RealtimeServerEventSessionCreated): # The persisted conversation id (only present when conversation # persistence is enabled) is set here, not on response.done. conversation_id = event.conversation_id or conversation_id - if isinstance(event, VoiceAgentServerEventResponseDone): + if isinstance(event, RealtimeServerEventResponseDone): return if isinstance(event, RealtimeServerEventError): print(f"Session error: {event.error.message}") return - if isinstance(event, VoiceAgentServerEventResponseAudioDelta): + if isinstance(event, RealtimeServerEventResponseAudioDelta): # Each delta is a decoded PCM16 chunk; play it. audio_delta_count += 1 player.play(event.delta) - elif isinstance(event, VoiceAgentServerEventResponseAudioTranscriptDone): + elif isinstance(event, RealtimeServerEventResponseAudioTranscriptDone): print(f"Agent: {event.transcript}") while True: @@ -172,11 +171,11 @@ def pump() -> None: if not prompt or prompt.lower() in ("exit", "quit"): break - # Send the turn and ask the agent to respond. + # Send the turn and ask the agent to respond. Message-type conversation items + # (system/user/assistant) don't have dedicated generated models in this API + # version, so they're sent as a raw mapping matching the wire schema. conn.conversation.item.create( - item=VoiceUserMessageItem( - content=[RealtimeConversationItemMessageUserContent(type="input_text", text=prompt)] - ) + item={"type": "message", "role": "user", "content": [{"type": "input_text", "text": prompt}]} ) conn.response.create() pump() @@ -203,7 +202,7 @@ def _read_conversation(client: AIProjectClient, agent_name: str, conversation_id :type agent_name: str :type conversation_id: str """ - conversations = client.agent_endpoint_conversations + conversations = client.beta.agent_endpoint_conversations conversation = conversations.get_agent_conversation(agent_name, conversation_id) print(f"Conversation {conversation.id}: status={conversation.status}, created_at={conversation.created_at}") @@ -258,7 +257,7 @@ def text_conversation() -> None: except HttpResponseError as e: print(f"Could not read conversation: {e.status_code} {e.reason}") # To fetch this session's audio afterward, use - # `project_client.agent_endpoint_conversations`: + # `project_client.beta.agent_endpoint_conversations`: # - get_agent_conversation_audio(agent_name, conversation_id) for the merged # whole-call stereo recording's metadata, then # get_agent_conversation_audio_content(agent_name, conversation_id) to stream diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py index 882cde958ff4..66d2fe157149 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py @@ -14,9 +14,10 @@ then publish a version with `store=True` so the conversation can be read back afterward. 2. Hold a typed, multi-turn conversation: each prompt is sent as a - ``VoiceUserMessageItem`` and the reply streams back as - typed audio and transcript events. Blank line (or ``exit`` / ``quit``) - ends it. + raw ``conversation.item.create`` message item (message-type items no + longer have a dedicated generated model in this API version) and the + reply streams back as typed audio and transcript events. Blank line + (or ``exit`` / ``quit``) ends it. 3. Fetch the persisted conversation back by id. 4. Delete the agent created for this sample. @@ -49,14 +50,12 @@ from azure.ai.projects.models import ( AgentKind, GenerateVoiceAgentRequest, - RealtimeConversationItemMessageUserContent, VoiceAgentDefinition, - VoiceAgentServerEventResponseAudioDelta, - VoiceAgentServerEventResponseAudioTranscriptDone, - VoiceAgentServerEventResponseDone, - VoiceAgentServerEventSessionCreated, + RealtimeServerEventResponseAudioDelta, + RealtimeServerEventResponseAudioTranscriptDone, + RealtimeServerEventResponseDone, + RealtimeServerEventSessionCreated, RealtimeServerEventError, - VoiceUserMessageItem, ) load_dotenv() @@ -148,20 +147,20 @@ async def _run_text_conversation(client: AIProjectClient, agent_name: str) -> Op async def pump() -> None: nonlocal conversation_id, audio_delta_count async for event in conn: - if isinstance(event, VoiceAgentServerEventSessionCreated): + if isinstance(event, RealtimeServerEventSessionCreated): # The persisted conversation id (only present when conversation # persistence is enabled) is set here, not on response.done. conversation_id = event.conversation_id or conversation_id - if isinstance(event, VoiceAgentServerEventResponseDone): + if isinstance(event, RealtimeServerEventResponseDone): return if isinstance(event, RealtimeServerEventError): print(f"Session error: {event.error.message}") return - if isinstance(event, VoiceAgentServerEventResponseAudioDelta): + if isinstance(event, RealtimeServerEventResponseAudioDelta): # Each delta is a decoded PCM16 chunk; play it. audio_delta_count += 1 player.play(event.delta) - elif isinstance(event, VoiceAgentServerEventResponseAudioTranscriptDone): + elif isinstance(event, RealtimeServerEventResponseAudioTranscriptDone): print(f"Agent: {event.transcript}") while True: @@ -170,11 +169,11 @@ async def pump() -> None: if not prompt or prompt.lower() in ("exit", "quit"): break - # Send the turn and ask the agent to respond. + # Send the turn and ask the agent to respond. Message-type conversation items + # (system/user/assistant) don't have dedicated generated models in this API + # version, so they're sent as a raw mapping matching the wire schema. await conn.conversation.item.create( - item=VoiceUserMessageItem( - content=[RealtimeConversationItemMessageUserContent(type="input_text", text=prompt)] - ) + item={"type": "message", "role": "user", "content": [{"type": "input_text", "text": prompt}]} ) await conn.response.create() @@ -205,7 +204,7 @@ async def _read_conversation(client: AIProjectClient, agent_name: str, conversat :type agent_name: str :type conversation_id: str """ - conversations = client.agent_endpoint_conversations + conversations = client.beta.agent_endpoint_conversations conversation = await conversations.get_agent_conversation(agent_name, conversation_id) print(f"Conversation {conversation.id}: status={conversation.status}, created_at={conversation.created_at}") @@ -260,7 +259,7 @@ async def text_conversation() -> None: except HttpResponseError as e: print(f"Could not read conversation: {e.status_code} {e.reason}") # To fetch this session's audio afterward, use - # `project_client.agent_endpoint_conversations`: + # `project_client.beta.agent_endpoint_conversations`: # - get_agent_conversation_audio(agent_name, conversation_id) for the merged # whole-call stereo recording's metadata, then # get_agent_conversation_audio_content(agent_name, conversation_id) to stream diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_read_conversation.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_read_conversation.py index 5ac675d7c7e1..d7930b1dfe89 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_read_conversation.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_read_conversation.py @@ -7,7 +7,7 @@ """ DESCRIPTION: This sample demonstrates reading a persisted voice conversation back over - the read-only conversation API exposed by `project_client.agent_endpoint_conversations`: + the read-only conversation API exposed by `project_client.beta.agent_endpoint_conversations`: the conversation envelope, its responses (model inference turns), and its ordered items (the transcript). Conversations are created and written by the voice orchestrator during a live session; this client can only read @@ -45,7 +45,7 @@ DefaultAzureCredential() as credential, AIProjectClient(endpoint=endpoint, credential=credential) as project_client, ): - conversations = project_client.agent_endpoint_conversations + conversations = project_client.beta.agent_endpoint_conversations try: # The conversation envelope: status, timestamps, aggregate usage. conversation = conversations.get_agent_conversation(agent_name, conversation_id) diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_read_conversation_audio.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_read_conversation_audio.py index cc5d8eacca10..ab4e8010658a 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_read_conversation_audio.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_read_conversation_audio.py @@ -7,7 +7,7 @@ """ DESCRIPTION: This sample demonstrates reading the persisted audio of a voice - conversation via `project_client.agent_endpoint_conversations`, both the + conversation via `project_client.beta.agent_endpoint_conversations`, both the merged whole-call recording and a single turn's audio segment. For each it reads the metadata first, then streams the WAV bytes to a local file. The merged recording is stereo: the caller on the left channel and the agent @@ -60,7 +60,7 @@ def read_merged_recording(conversations, agent_name, conversation_id) -> None: :param conversations: The conversation operations client. :param agent_name: The voice agent name. :param conversation_id: The persisted conversation id. - :type conversations: azure.ai.projects.operations.AgentEndpointConversationsOperations + :type conversations: azure.ai.projects.operations.BetaAgentEndpointConversationsOperations :type agent_name: str :type conversation_id: str """ @@ -86,7 +86,7 @@ def read_first_item_audio(conversations, agent_name, conversation_id) -> None: :param conversations: The conversation operations client. :param agent_name: The voice agent name. :param conversation_id: The persisted conversation id. - :type conversations: azure.ai.projects.operations.AgentEndpointConversationsOperations + :type conversations: azure.ai.projects.operations.BetaAgentEndpointConversationsOperations :type agent_name: str :type conversation_id: str """ @@ -123,7 +123,7 @@ def main() -> None: DefaultAzureCredential() as credential, AIProjectClient(endpoint=endpoint, credential=credential) as project_client, ): - conversations = project_client.agent_endpoint_conversations + conversations = project_client.beta.agent_endpoint_conversations try: read_merged_recording(conversations, agent_name, conversation_id) read_first_item_audio(conversations, agent_name, conversation_id) diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_with_tools.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_with_tools.py index aba853d4c383..7c507bbda0fd 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_with_tools.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_with_tools.py @@ -39,23 +39,22 @@ from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( + RealtimeAudioFormatsAudioPcm, RealtimeFunctionTool, ToolType, VoiceAgentDefinition, VoiceAgentMcpTool, - VoiceAudioConfig, - VoiceAudioFormat, - VoiceAudioFormatType, - VoiceAudioInputConfig, - VoiceAudioOutputConfig, - VoiceInputTranscription, - VoiceInputTranscriptionModel, + VoiceAgentAudioConfig, + VoiceAgentAudioInputConfig, + VoiceAgentAudioOutputConfig, + VoiceAgentInputTranscription, + VoiceAgentInputTranscriptionModel, VoiceModelType, VoiceOutputModality, - VoiceServerVadTurnDetection, - VoiceSystemTool, - VoiceSystemToolName, - VoiceToolboxTool, + VoiceAgentServerVadTurnDetection, + VoiceAgentSystemTool, + VoiceAgentSystemToolName, + VoiceAgentToolboxTool, VoiceType, ) @@ -86,7 +85,7 @@ ) # A service-managed control tool: the platform can end the call on the agent's behalf. -end_call = VoiceSystemTool(name=VoiceSystemToolName.END_CONVERSATION) +end_call = VoiceAgentSystemTool(name=VoiceAgentSystemToolName.END_CONVERSATION) # An MCP tool is executed by the service against a remote MCP server you own. # It references an external server, so it is constructed here for illustration @@ -100,27 +99,27 @@ # A toolbox tool references a versioned Foundry toolbox you have created. It is # constructed here for illustration; attach it only if the toolbox exists. -_example_toolbox_tool = VoiceToolboxTool(toolbox_name="my-toolbox", toolbox_version="1") +_example_toolbox_tool = VoiceAgentToolboxTool(toolbox_name="my-toolbox", toolbox_version="1") definition = VoiceAgentDefinition( model_type=model_type, model=model, instructions="You are a helpful voice assistant. Use tools when they help answer the caller.", - audio=VoiceAudioConfig( + audio=VoiceAgentAudioConfig( # Input (microphone) side: 24 kHz PCM, server-side VAD so the agent # auto-responds when the caller stops speaking, plus input-audio # transcription so user speech is transcribed. - input=VoiceAudioInputConfig( - format=VoiceAudioFormat(type=VoiceAudioFormatType.PCM, rate=24000), - turn_detection=VoiceServerVadTurnDetection( + input=VoiceAgentAudioInputConfig( + format=RealtimeAudioFormatsAudioPcm(rate=24000), + turn_detection=VoiceAgentServerVadTurnDetection( threshold=0.5, prefix_padding_ms=300, silence_duration_ms=500, ), - transcription=VoiceInputTranscription(model=VoiceInputTranscriptionModel.WHISPER1), + transcription=VoiceAgentInputTranscription(model=VoiceAgentInputTranscriptionModel.WHISPER1), ), # Output (agent speech) side: the voice the agent speaks with. - output=VoiceAudioOutputConfig(voice="en-US-AvaNeural", voice_type=VoiceType.AZURE_STANDARD), + output=VoiceAgentAudioOutputConfig(voice="en-US-AvaNeural", voice_type=VoiceType.AZURE_STANDARD), ), output_modalities=[VoiceOutputModality.AUDIO], # Attach the self-contained tools. `_example_mcp_tool` and `_example_toolbox_tool` diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_raw_response.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_raw_response.py index 116775781e49..82f41657e481 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_raw_response.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_raw_response.py @@ -27,7 +27,6 @@ from azure.ai.projects.telemetry import AIProjectInstrumentor from openai import AsyncOpenAI, AsyncStream, OpenAI, Stream - CONTENT_TRACING_ENV_VARIABLE = "OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT" EXPERIMENTAL_ENABLE_GENAI_TRACING_ENV_VARIABLE = "AZURE_EXPERIMENTAL_ENABLE_GENAI_TRACING" diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud.py b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud.py index da3eb74b5ac6..b648f281fe28 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud.py @@ -11,8 +11,8 @@ AgentDetails, AgentVersionDetails, VoiceAgentDefinition, - VoiceAudioConfig, - VoiceAudioOutputConfig, + VoiceAgentAudioConfig, + VoiceAgentAudioOutputConfig, VoiceOutputModality, ) @@ -24,7 +24,7 @@ class TestVoiceAgentCrud(TestBase): NOTE: Some voice-agent REST APIs are intentionally NOT covered here because they are currently blocked by known service-side bugs (see this package's engineering notes): - - Reading back a conversation (`project_client.agent_endpoint_conversations.*`) using a + - Reading back a conversation (`project_client.beta.agent_endpoint_conversations.*`) using a `conversation_id` produced by a live realtime WebSocket session - the service's REST conversation-ID validator rejects the ID format generated by the realtime WS subsystem. This is also not practical to cover with HTTP-only recorded tests since it requires an @@ -69,8 +69,8 @@ def make_definition(instructions: str) -> VoiceAgentDefinition: model_type="managed", model=model, instructions=instructions, - audio=VoiceAudioConfig( - output=VoiceAudioOutputConfig(voice="en-US-AvaNeural", voice_type="azure-standard") + audio=VoiceAgentAudioConfig( + output=VoiceAgentAudioOutputConfig(voice="en-US-AvaNeural", voice_type="azure-standard") ), output_modalities=[VoiceOutputModality.AUDIO], ) @@ -148,8 +148,8 @@ def test_voice_agent_disable_enable(self, **kwargs): model_type="managed", model=model, instructions="You are a helpful voice assistant.", - audio=VoiceAudioConfig( - output=VoiceAudioOutputConfig(voice="en-US-AvaNeural", voice_type="azure-standard") + audio=VoiceAgentAudioConfig( + output=VoiceAgentAudioOutputConfig(voice="en-US-AvaNeural", voice_type="azure-standard") ), output_modalities=[VoiceOutputModality.AUDIO], ), diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud_async.py b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud_async.py index 9a1bb3c41e49..5864efa4b062 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud_async.py @@ -12,8 +12,8 @@ AgentDetails, AgentVersionDetails, VoiceAgentDefinition, - VoiceAudioConfig, - VoiceAudioOutputConfig, + VoiceAgentAudioConfig, + VoiceAgentAudioOutputConfig, VoiceOutputModality, ) @@ -25,7 +25,7 @@ class TestVoiceAgentCrudAsync(TestBase): NOTE: Some voice-agent REST APIs are intentionally NOT covered here because they are currently blocked by known service-side bugs (see this package's engineering notes): - - Reading back a conversation (`project_client.agent_endpoint_conversations.*`) using a + - Reading back a conversation (`project_client.beta.agent_endpoint_conversations.*`) using a `conversation_id` produced by a live realtime WebSocket session - the service's REST conversation-ID validator rejects the ID format generated by the realtime WS subsystem. This is also not practical to cover with HTTP-only recorded tests since it requires an @@ -70,8 +70,8 @@ def make_definition(instructions: str) -> VoiceAgentDefinition: model_type="managed", model=model, instructions=instructions, - audio=VoiceAudioConfig( - output=VoiceAudioOutputConfig(voice="en-US-AvaNeural", voice_type="azure-standard") + audio=VoiceAgentAudioConfig( + output=VoiceAgentAudioOutputConfig(voice="en-US-AvaNeural", voice_type="azure-standard") ), output_modalities=[VoiceOutputModality.AUDIO], ) @@ -153,8 +153,8 @@ async def test_voice_agent_disable_enable_async(self, **kwargs): model_type="managed", model=model, instructions="You are a helpful voice assistant.", - audio=VoiceAudioConfig( - output=VoiceAudioOutputConfig(voice="en-US-AvaNeural", voice_type="azure-standard") + audio=VoiceAgentAudioConfig( + output=VoiceAgentAudioOutputConfig(voice="en-US-AvaNeural", voice_type="azure-standard") ), output_modalities=[VoiceOutputModality.AUDIO], ), diff --git a/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py b/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py index 2f2692095394..3b504216bfbe 100644 --- a/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py +++ b/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py @@ -38,6 +38,7 @@ "evaluation_taxonomies": "Evaluations=V1Preview", "evaluators": "Evaluations=V1Preview", "insights": "Insights=V1Preview", + "agent_insight_monitors": "AgentInsights=V1Preview", "memory_stores": "MemoryStores=V1Preview", "models": "Models=V1Preview", "red_teams": "RedTeams=V1Preview", @@ -46,6 +47,10 @@ "skills": "Skills=V1Preview", "datasets": "DataGenerationJobs=V1Preview", "agents": "WorkflowAgents=V1Preview,ExternalAgents=V1Preview,VoiceAgents=V1Preview,DraftAgents=V1Preview,AgentsOptimization=V2Preview", + # agent_endpoint_conversations moved from a top-level client attribute to a nested `.beta` + # sub-client upstream; it always requires the VoiceAgents=V1Preview opt-in (voice-agent + # conversation reads), regardless of `allow_preview` -- same as every other entry here. + "agent_endpoint_conversations": "VoiceAgents=V1Preview", } # Methods on .beta sub-clients that are NOT simple one-HTTP-call wrappers and @@ -95,24 +100,13 @@ ), ] -# Methods on `agent_endpoint_conversations` that always send the Foundry-Features header, -# unconditionally, regardless of `allow_preview`. Unlike _NON_BETA_OPTIONAL_TEST_CASES above, -# this sub-client is wrapped with `_OperationMethodHeaderProxy` directly in `_patch.py` (not -# gated behind `allow_preview`), because voice-agent conversation reads require the -# VoiceAgents=V1Preview opt-in header even when the caller hasn't requested other preview -# features. Used by test_foundry_features_header_on_agent_endpoint_conversations.py (sync) and -# its async counterpart. -_AGENT_ENDPOINT_CONVERSATIONS_TEST_CASES = [ - # Each pytest.param entry has the following positional argument: - # 1. method_name (str) – "agent_endpoint_conversations." on AIProjectClient. - # The expected header value is always "VoiceAgents=V1Preview" for all of these. - pytest.param("agent_endpoint_conversations.list_agent_conversations"), - pytest.param("agent_endpoint_conversations.get_agent_conversation"), - pytest.param("agent_endpoint_conversations.delete_agent_conversation"), - pytest.param("agent_endpoint_conversations.list_agent_conversation_responses"), -] - -_AGENT_ENDPOINT_CONVERSATIONS_EXPECTED_HEADER_VALUE = "VoiceAgents=V1Preview" +# NOTE: `agent_endpoint_conversations` used to need its own dedicated test cases here (it was +# wrapped with `_OperationMethodHeaderProxy` directly in `_patch.py`, unconditionally regardless +# of `allow_preview`, since it lived as a top-level client attribute rather than a `.beta` +# sub-client). It has since moved under `.beta` upstream and is now a normal entry in +# EXPECTED_FOUNDRY_FEATURES above, using the exact same unconditional generic mechanism as every +# other `.beta` sub-client -- so it's now covered automatically (and more thoroughly: all of its +# methods, not just 4) by the dynamic discovery in test_foundry_features_header_on_beta_operations.py. # Both sentinel values – used by _make_fake_call to detect required parameters # whose defaults are the internal _Unset object (rather than inspect.Parameter.empty). diff --git a/sdk/ai/azure-ai-projects/tests/foundry_features_header/test_foundry_features_header_on_agent_endpoint_conversations.py b/sdk/ai/azure-ai-projects/tests/foundry_features_header/test_foundry_features_header_on_agent_endpoint_conversations.py deleted file mode 100644 index a3d6bd502f88..000000000000 --- a/sdk/ai/azure-ai-projects/tests/foundry_features_header/test_foundry_features_header_on_agent_endpoint_conversations.py +++ /dev/null @@ -1,136 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Tests unconditional Foundry-Features header behavior on sync `agent_endpoint_conversations` methods. - -Unlike the optional-header methods covered in test_foundry_features_header_on_ga_operations.py, -`agent_endpoint_conversations` is wrapped with `_OperationMethodHeaderProxy` directly in -`_patch.py`, so it always sends `Foundry-Features: VoiceAgents=V1Preview` regardless of whether -`allow_preview` was set on the `AIProjectClient` constructor. -""" - -from typing import Any, ClassVar, Iterator, List, Tuple - -import pytest -from azure.core.pipeline.transport import HttpTransport -from azure.ai.projects import AIProjectClient - -from foundry_features_header_test_base import ( - FAKE_ENDPOINT, - FakeCredential, - FoundryFeaturesHeaderTestBase, - _AGENT_ENDPOINT_CONVERSATIONS_EXPECTED_HEADER_VALUE, - _AGENT_ENDPOINT_CONVERSATIONS_TEST_CASES, - _RequestCaptured, -) - - -class CapturingTransport(HttpTransport): - """Sync transport that captures the outgoing request and raises _RequestCaptured.""" - - def send(self, request: Any, **kwargs: Any) -> Any: # type: ignore[override] - raise _RequestCaptured(request) - - def open(self) -> None: - pass - - def close(self) -> None: - pass - - def __enter__(self) -> "CapturingTransport": - return self - - def __exit__(self, *args: Any) -> None: - pass - - -@pytest.fixture(scope="module") -def client_preview_enabled() -> Iterator[AIProjectClient]: - with AIProjectClient( - endpoint=FAKE_ENDPOINT, - credential=FakeCredential(), # type: ignore[arg-type] - allow_preview=True, - transport=CapturingTransport(), - ) as c: - yield c - - -@pytest.fixture(scope="module") -def client_preview_disabled() -> Iterator[AIProjectClient]: - with AIProjectClient( - endpoint=FAKE_ENDPOINT, - credential=FakeCredential(), # type: ignore[arg-type] - transport=CapturingTransport(), - ) as c: - yield c - - -@pytest.fixture(scope="module", autouse=True) -def _print_report_agent_endpoint_conversations() -> Iterator[None]: - """Print a Foundry-Features report after all sync agent_endpoint_conversations tests finish.""" - yield - report = TestFoundryFeaturesHeaderOnAgentEndpointConversations._report - if report: - max_len = TestFoundryFeaturesHeaderOnAgentEndpointConversations._report_max_label_len - print( - "\n\nFoundry-Features header report on agent_endpoint_conversations (sync) — " - "always present regardless of allow_preview:" - ) - for label, header_value in sorted(report): - print(f'{label:<{max_len}} | "{header_value}"') - - -class TestFoundryFeaturesHeaderOnAgentEndpointConversations(FoundryFeaturesHeaderTestBase): - """Sync tests verifying the Foundry-Features header is always sent on - `agent_endpoint_conversations` methods, whether or not `allow_preview` was set. - """ - - _report: ClassVar[List[Tuple[str, str]]] = [] - _report_max_label_len: ClassVar[int] = 0 - - @staticmethod - def _capture(call: Any) -> Any: - """Call *call()* and return the captured HttpRequest.""" - try: - result = call() - except _RequestCaptured as exc: - return exc.request - - try: - next(iter(result)) - except _RequestCaptured as exc: - return exc.request - except StopIteration: - raise AssertionError("Iterator exhausted without the transport being called") from None - - raise AssertionError("Transport was never called") - - @classmethod - def _assert_header_present(cls, label: str, call: Any) -> None: - request = cls._capture(call) - cls._record_header_assertion(label, request, _AGENT_ENDPOINT_CONVERSATIONS_EXPECTED_HEADER_VALUE) - - @pytest.mark.parametrize("method_name", _AGENT_ENDPOINT_CONVERSATIONS_TEST_CASES) - def test_foundry_features_header_present_on_agent_endpoint_conversations_when_preview_enabled( - self, - client_preview_enabled: AIProjectClient, - method_name: str, - ) -> None: - subclient_name, method_attr = method_name.split(".") - sc = getattr(client_preview_enabled, subclient_name) - method = getattr(sc, method_attr) - self._assert_header_present(f"{method_name} (allow_preview=True)", self._make_fake_call(method)) - - @pytest.mark.parametrize("method_name", _AGENT_ENDPOINT_CONVERSATIONS_TEST_CASES) - def test_foundry_features_header_present_on_agent_endpoint_conversations_when_preview_not_enabled( - self, - client_preview_disabled: AIProjectClient, - method_name: str, - ) -> None: - """Even without `allow_preview`, agent_endpoint_conversations methods always send the header.""" - subclient_name, method_attr = method_name.split(".") - sc = getattr(client_preview_disabled, subclient_name) - method = getattr(sc, method_attr) - self._assert_header_present(f"{method_name} (allow_preview unset)", self._make_fake_call(method)) diff --git a/sdk/ai/azure-ai-projects/tests/foundry_features_header/test_foundry_features_header_on_agent_endpoint_conversations_async.py b/sdk/ai/azure-ai-projects/tests/foundry_features_header/test_foundry_features_header_on_agent_endpoint_conversations_async.py deleted file mode 100644 index 9609c04e8106..000000000000 --- a/sdk/ai/azure-ai-projects/tests/foundry_features_header/test_foundry_features_header_on_agent_endpoint_conversations_async.py +++ /dev/null @@ -1,142 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Tests unconditional Foundry-Features header behavior on async `agent_endpoint_conversations` methods. - -Unlike the optional-header methods covered in test_foundry_features_header_on_ga_operations_async.py, -`agent_endpoint_conversations` is wrapped with `_OperationMethodHeaderProxy` directly in -`aio/_patch.py`, so it always sends `Foundry-Features: VoiceAgents=V1Preview` regardless of whether -`allow_preview` was set on the `AIProjectClient` constructor. -""" - -import inspect -from typing import Any, ClassVar, Iterator, List, Tuple - -import pytest -from azure.core.pipeline.transport import AsyncHttpTransport -from azure.ai.projects.aio import AIProjectClient as AsyncAIProjectClient - -from foundry_features_header_test_base import ( - FAKE_ENDPOINT, - AsyncFakeCredential, - FoundryFeaturesHeaderTestBase, - _AGENT_ENDPOINT_CONVERSATIONS_EXPECTED_HEADER_VALUE, - _AGENT_ENDPOINT_CONVERSATIONS_TEST_CASES, - _RequestCaptured, -) - - -class CapturingAsyncTransport(AsyncHttpTransport): - """Async transport that captures the outgoing request and raises _RequestCaptured.""" - - async def send(self, request: Any, **kwargs: Any) -> Any: # type: ignore[override] - raise _RequestCaptured(request) - - async def open(self) -> None: - pass - - async def close(self) -> None: - pass - - async def __aenter__(self) -> "CapturingAsyncTransport": - return self - - async def __aexit__(self, *args: Any) -> None: - pass - - -@pytest.fixture(scope="module") -def async_client_preview_enabled() -> Iterator[AsyncAIProjectClient]: - yield AsyncAIProjectClient( - endpoint=FAKE_ENDPOINT, - credential=AsyncFakeCredential(), # type: ignore[arg-type] - allow_preview=True, - transport=CapturingAsyncTransport(), - ) - - -@pytest.fixture(scope="module") -def async_client_preview_disabled() -> Iterator[AsyncAIProjectClient]: - yield AsyncAIProjectClient( - endpoint=FAKE_ENDPOINT, - credential=AsyncFakeCredential(), # type: ignore[arg-type] - transport=CapturingAsyncTransport(), - ) - - -@pytest.fixture(scope="module", autouse=True) -def _print_report_agent_endpoint_conversations_async() -> Iterator[None]: - """Print a Foundry-Features report after all async agent_endpoint_conversations tests finish.""" - yield - report = TestFoundryFeaturesHeaderOnAgentEndpointConversationsAsync._report - if report: - max_len = TestFoundryFeaturesHeaderOnAgentEndpointConversationsAsync._report_max_label_len - print( - "\n\nFoundry-Features header report on agent_endpoint_conversations (async) — " - "always present regardless of allow_preview:" - ) - for label, header_value in sorted(report): - print(f'{label:<{max_len}} | "{header_value}"') - - -class TestFoundryFeaturesHeaderOnAgentEndpointConversationsAsync(FoundryFeaturesHeaderTestBase): - """Async tests verifying the Foundry-Features header is always sent on - `agent_endpoint_conversations` methods, whether or not `allow_preview` was set. - """ - - _report: ClassVar[List[Tuple[str, str]]] = [] - _report_max_label_len: ClassVar[int] = 0 - - @staticmethod - async def _capture_async(call: Any) -> Any: - """Invoke *call()* and return the captured HttpRequest.""" - result = call() - - if inspect.isawaitable(result): - try: - await result - except _RequestCaptured as exc: - return exc.request - raise AssertionError("Transport was never called (awaitable completed without raising)") - - ai = result.__aiter__() - try: - await ai.__anext__() - except _RequestCaptured as exc: - return exc.request - except StopAsyncIteration: - raise AssertionError("Iterator exhausted without the transport being called") from None - - raise AssertionError("Transport was never called") - - @classmethod - async def _assert_header_present_async(cls, label: str, call: Any) -> None: - request = await cls._capture_async(call) - cls._record_header_assertion(label, request, _AGENT_ENDPOINT_CONVERSATIONS_EXPECTED_HEADER_VALUE) - - @pytest.mark.asyncio - @pytest.mark.parametrize("method_name", _AGENT_ENDPOINT_CONVERSATIONS_TEST_CASES) - async def test_foundry_features_header_present_on_agent_endpoint_conversations_when_preview_enabled_async( - self, - async_client_preview_enabled: AsyncAIProjectClient, - method_name: str, - ) -> None: - subclient_name, method_attr = method_name.split(".") - sc = getattr(async_client_preview_enabled, subclient_name) - method = getattr(sc, method_attr) - await self._assert_header_present_async(f"{method_name} (allow_preview=True)", self._make_fake_call(method)) - - @pytest.mark.asyncio - @pytest.mark.parametrize("method_name", _AGENT_ENDPOINT_CONVERSATIONS_TEST_CASES) - async def test_foundry_features_header_present_on_agent_endpoint_conversations_when_preview_not_enabled_async( - self, - async_client_preview_disabled: AsyncAIProjectClient, - method_name: str, - ) -> None: - """Even without `allow_preview`, agent_endpoint_conversations methods always send the header.""" - subclient_name, method_attr = method_name.split(".") - sc = getattr(async_client_preview_disabled, subclient_name) - method = getattr(sc, method_attr) - await self._assert_header_present_async(f"{method_name} (allow_preview unset)", self._make_fake_call(method)) diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml.saved b/sdk/ai/azure-ai-projects/tsp-location.yaml.saved index 23af9b82b830..1d0fdbcec72b 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml.saved +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml.saved @@ -1,10 +1,12 @@ directory: specification/ai-foundry/data-plane/Foundry/src/sdk-python-js-azure-ai-projects -commit: 8692ffec0e4da99a2a8697f6394e321e07b1ec8b +commit: 2e1e4f1d8a43ce114b3a3532d25a34fe1c2fa915 repo: Azure/azure-rest-api-specs additionalDirectories: - specification/ai-foundry/data-plane/Foundry/src/agents +- specification/ai-foundry/data-plane/Foundry/src/agent-insights - specification/ai-foundry/data-plane/Foundry/src/agents-optimization - specification/ai-foundry/data-plane/Foundry/src/agents-session-files +- specification/ai-foundry/data-plane/Foundry/src/agents-microsoft365 - specification/ai-foundry/data-plane/Foundry/src/common - specification/ai-foundry/data-plane/Foundry/src/connections - specification/ai-foundry/data-plane/Foundry/src/data_generation_jobs From 40fe677845eb1006b5c09b13fde06eeda81f890d Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Tue, 1 Sep 2026 14:49:45 -0700 Subject: [PATCH 42/56] Regenerate azure-ai-projects from TypeSpec commit 3fe1059c, restore RealtimeConversationItemMessage* classes, fix RecordedTransport.HTTPX2 rename, add voice-agent CRUD recordings - Regenerated from TypeSpec commit 3fe1059cb3bb4d6dc5cf62910c09c47b64a092ad (purely additive vs prior round) - Restored RealtimeConversationItemMessageSystem/User/Assistant classes (previously removed upstream, now reinstated) to the ConversationItem union in _realtime.py/aio/_realtime.py and 3 samples, replacing the raw-dict construction workaround with typed construction - Fixed RecordedTransport.HTTPX -> HTTPX2 in test_voice_agent_crud.py/_async.py (unrelated shared-tooling rename from an upstream merge that broke test collection) - Updated CHANGELOG.md wording and regenerated api.md/api.metadata.yml - Updated tsp-location.yaml.saved to the new commit hash (tsp-location.yaml itself is a transient, untracked local file used only to drive generation, not committed) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- sdk/ai/azure-ai-projects/CHANGELOG.md | 2 +- sdk/ai/azure-ai-projects/api.md | 181 +++++++ sdk/ai/azure-ai-projects/api.metadata.yml | 3 +- .../azure-ai-projects/apiview-properties.json | 11 +- .../azure/ai/projects/_realtime.py | 12 +- .../azure/ai/projects/aio/_realtime.py | 12 +- .../azure/ai/projects/models/__init__.py | 18 + .../azure/ai/projects/models/_enums.py | 13 + .../azure/ai/projects/models/_models.py | 463 +++++++++++++++++- .../sample_voice_agent_live_function_tool.py | 10 +- ...mple_voice_agent_live_text_conversation.py | 19 +- ...oice_agent_live_text_conversation_async.py | 19 +- .../sample_synthetic_multiturn_evaluation.py | 39 +- .../tests/agents/test_voice_agent_crud.py | 2 +- .../agents/test_voice_agent_crud_async.py | 2 +- .../azure-ai-projects/tsp-location.yaml.saved | 2 +- 16 files changed, 742 insertions(+), 66 deletions(-) diff --git a/sdk/ai/azure-ai-projects/CHANGELOG.md b/sdk/ai/azure-ai-projects/CHANGELOG.md index a254291146eb..02859c6a4353 100644 --- a/sdk/ai/azure-ai-projects/CHANGELOG.md +++ b/sdk/ai/azure-ai-projects/CHANGELOG.md @@ -7,7 +7,7 @@ * Added voice agents, unified with the rest of the Agents API as a new `kind="voice"` on `AgentDefinition`: * Define a voice agent with `VoiceAgentDefinition`, configuring its model (`VoiceModelType`), audio input/output (`VoiceAgentAudioConfig`, `VoiceAgentAudioInputConfig`, `VoiceAgentAudioOutputConfig`), turn detection (`VoiceAgentTurnDetectionConfig` and its `VoiceAgentServerVadTurnDetection` / `VoiceAgentAzureSemanticVadTurnDetection` / `VoiceAgentAzureSemanticVadEnTurnDetection` / `VoiceAgentAzureSemanticVadMultilingualTurnDetection` variants), greeting (`VoiceAgentGreetingConfig` and its `VoiceAgentTemplateGreetingConfig` / `VoiceAgentLlmGeneratedGreetingConfig` variants), tools (`VoiceAgentTool`, `VoiceAgentFunctionTool`, `VoiceAgentMcpTool`, `VoiceAgentSystemTool`, `VoiceAgentToolboxTool`), and avatar (`VoiceAgentAvatarConfig`). Manage it like any other agent through `project_client.agents` (`create_version`, `get`, `list`, `disable`/`enable`, `delete`). * Added guided authoring via `project_client.agents.generate_agent(GenerateVoiceAgentRequest(kind=AgentKind.VOICE, ...))`, which returns a service-generated starter definition that can be edited afterward through the standard `create_version`/`update` flow. - * Added a new `client.realtime` / `async_client.realtime` entry point for realtime speech-to-speech streaming. Use `with client.realtime.connect(agent_name=...) as connection:` to open a WebSocket connection, `connection.send(...)` to send strongly-typed client events (or use the `connection.response`, `connection.item`, and `connection.session` helpers), and iterate over `connection` to receive strongly-typed server events (`RealtimeServerEvent*`). Conversation items exchanged with `connection.conversation.item.create(...)` are `RealtimeConversationItemFunctionCall`, `RealtimeConversationItemFunctionCallOutput`, `RealtimeMCPApprovalResponse`, or a raw `Mapping[str, Any]` for message-type (system/user/assistant) items, which do not have dedicated generated models in this API version. The new types `Realtime`, `RealtimeConnection`, and `RealtimeConnectionManager` (and their async equivalents `AsyncRealtime`, `AsyncRealtimeConnection`, `AsyncRealtimeConnectionManager`) are exported from `azure.ai.projects` / `azure.ai.projects.aio`. Requires the optional `websockets` package. + * Added a new `client.realtime` / `async_client.realtime` entry point for realtime speech-to-speech streaming. Use `with client.realtime.connect(agent_name=...) as connection:` to open a WebSocket connection, `connection.send(...)` to send strongly-typed client events (or use the `connection.response`, `connection.item`, and `connection.session` helpers), and iterate over `connection` to receive strongly-typed server events (`RealtimeServerEvent*`). Conversation items exchanged with `connection.conversation.item.create(...)` are `RealtimeConversationItemMessageSystem`, `RealtimeConversationItemMessageUser`, `RealtimeConversationItemMessageAssistant`, `RealtimeConversationItemFunctionCall`, `RealtimeConversationItemFunctionCallOutput`, `RealtimeMCPApprovalResponse`, or a raw `Mapping[str, Any]`. The new types `Realtime`, `RealtimeConnection`, and `RealtimeConnectionManager` (and their async equivalents `AsyncRealtime`, `AsyncRealtimeConnection`, `AsyncRealtimeConnectionManager`) are exported from `azure.ai.projects` / `azure.ai.projects.aio`. Requires the optional `websockets` package. * Added the `beta.agent_endpoint_conversations` operation group for reading back persisted voice-agent conversation transcripts and audio, for agents created with `store=True`. * Added the underlying `RealtimeConversationItem*`, `RealtimeMCP*`, `RealtimeResponseUsage`, and related realtime event/session models used by the voice agent WebSocket protocol. * Added 11 new samples under `samples/agents/voice/`, covering basic agent lifecycle, guided generation, live audio and text conversations (sync and async), function tools, versioning, and reading back conversation transcripts and audio. diff --git a/sdk/ai/azure-ai-projects/api.md b/sdk/ai/azure-ai-projects/api.md index 6a3dd90670ea..29572a4b8f86 100644 --- a/sdk/ai/azure-ai-projects/api.md +++ b/sdk/ai/azure-ai-projects/api.md @@ -8972,6 +8972,162 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.RealtimeConversationItemMessage(RealtimeConversationItem, discriminator='message'): + role: str + type: Literal[RealtimeConversationItemType.MESSAGE] + + @overload + def __init__( + self, + *, + role: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeConversationItemMessageAssistant(RealtimeConversationItemMessage, discriminator='assistant'): + content: list[RealtimeConversationItemMessageAssistantContent] + created_at: Optional[datetime] + id: Optional[str] + object: Optional[Literal["item"]] + response_id: Optional[str] + role: Literal[RealtimeConversationItemMessageType.ASSISTANT] + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Union[str, azure.ai.projects.models.MESSAGE] + + @overload + def __init__( + self, + *, + content: list[RealtimeConversationItemMessageAssistantContent], + id: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + status: Optional[Literal[completed, incomplete, in_progress]] = ..., + type: Literal[RealtimeConversationItemType.MESSAGE] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeConversationItemMessageAssistantContent(_Model): + audio: Optional[str] + text: Optional[str] + transcript: Optional[str] + type: Optional[Literal["output_text", "output_audio"]] + + @overload + def __init__( + self, + *, + audio: Optional[str] = ..., + text: Optional[str] = ..., + transcript: Optional[str] = ..., + type: Optional[Literal[output_text, output_audio]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeConversationItemMessageSystem(RealtimeConversationItemMessage, discriminator='system'): + content: list[RealtimeConversationItemMessageSystemContent] + created_at: Optional[datetime] + id: Optional[str] + object: Optional[Literal["item"]] + response_id: Optional[str] + role: Literal[RealtimeConversationItemMessageType.SYSTEM] + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Union[str, azure.ai.projects.models.MESSAGE] + + @overload + def __init__( + self, + *, + content: list[RealtimeConversationItemMessageSystemContent], + id: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + status: Optional[Literal[completed, incomplete, in_progress]] = ..., + type: Literal[RealtimeConversationItemType.MESSAGE] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeConversationItemMessageSystemContent(_Model): + text: Optional[str] + type: Optional[Literal["input_text"]] + + @overload + def __init__( + self, + *, + text: Optional[str] = ..., + type: Optional[Literal[input_text]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeConversationItemMessageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ASSISTANT = "assistant" + SYSTEM = "system" + USER = "user" + + + class azure.ai.projects.models.RealtimeConversationItemMessageUser(RealtimeConversationItemMessage, discriminator='user'): + content: list[RealtimeConversationItemMessageUserContent] + created_at: Optional[datetime] + id: Optional[str] + object: Optional[Literal["item"]] + response_id: Optional[str] + role: Literal[RealtimeConversationItemMessageType.USER] + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Union[str, azure.ai.projects.models.MESSAGE] + + @overload + def __init__( + self, + *, + content: list[RealtimeConversationItemMessageUserContent], + id: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + status: Optional[Literal[completed, incomplete, in_progress]] = ..., + type: Literal[RealtimeConversationItemType.MESSAGE] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeConversationItemMessageUserContent(_Model): + audio: Optional[str] + detail: Optional[Literal["auto", "low", "high"]] + image_url: Optional[str] + text: Optional[str] + transcript: Optional[str] + type: Optional[Literal["input_text", "input_audio", "input_image"]] + + @overload + def __init__( + self, + *, + audio: Optional[str] = ..., + detail: Optional[Literal[auto, low, high]] = ..., + image_url: Optional[str] = ..., + text: Optional[str] = ..., + transcript: Optional[str] = ..., + type: Optional[Literal[input_text, input_audio, input_image]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.RealtimeConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): FUNCTION_CALL = "function_call" FUNCTION_CALL_OUTPUT = "function_call_output" @@ -8979,6 +9135,7 @@ namespace azure.ai.projects.models MCP_APPROVAL_RESPONSE = "mcp_approval_response" MCP_CALL = "mcp_call" MCP_LIST_TOOLS = "mcp_list_tools" + MESSAGE = "message" class azure.ai.projects.models.RealtimeFunctionTool(_Model): @@ -9395,6 +9552,7 @@ namespace azure.ai.projects.models content_index: int event_id: str item_id: str + languages: Optional[list[TranscriptionLanguage]] logprobs: Optional[list[LogProbProperties]] phrases: Optional[list[VoiceAgentTranscriptionPhrase]] transcript: str @@ -9408,6 +9566,7 @@ namespace azure.ai.projects.models content_index: int, event_id: str, item_id: str, + languages: Optional[list[TranscriptionLanguage]] = ..., logprobs: Optional[list[LogProbProperties]] = ..., phrases: Optional[list[VoiceAgentTranscriptionPhrase]] = ..., transcript: str, @@ -12158,6 +12317,20 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.TranscriptionLanguage(_Model): + code: str + + @overload + def __init__( + self, + *, + code: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.TreatmentEffectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): CHANGED = "Changed" DEGRADED = "Degraded" @@ -12850,7 +13023,9 @@ namespace azure.ai.projects.models class azure.ai.projects.models.VoiceAgentInputTranscription(_Model): custom_speech: Optional[dict[str, str]] delay: Optional[Literal["minimal", "low", "medium", "high", "xhigh"]] + keywords: Optional[list[str]] language: Optional[str] + languages: Optional[list[str]] model: Union[str, VoiceAgentInputTranscriptionModel] phrase_list: Optional[list[str]] prompt: Optional[str] @@ -12861,7 +13036,9 @@ namespace azure.ai.projects.models *, custom_speech: Optional[dict[str, str]] = ..., delay: Optional[Literal[minimal, low, medium, high, xhigh]] = ..., + keywords: Optional[list[str]] = ..., language: Optional[str] = ..., + languages: Optional[list[str]] = ..., model: Union[str, VoiceAgentInputTranscriptionModel], phrase_list: Optional[list[str]] = ..., prompt: Optional[str] = ... @@ -14054,6 +14231,7 @@ namespace azure.ai.projects.models 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"]] @@ -14067,6 +14245,7 @@ namespace azure.ai.projects.models *, 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]] = ..., @@ -14095,6 +14274,7 @@ namespace azure.ai.projects.models class azure.ai.projects.models.WebSearchToolboxTool(ToolboxTool, discriminator='web_search'): custom_search_configuration: Optional[WebSearchConfiguration] description: str + external_web_access: Optional[bool] filters: Optional[WebSearchToolFilters] name: str search_context_size: Optional[Literal["low", "medium", "high"]] @@ -14108,6 +14288,7 @@ namespace azure.ai.projects.models *, 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]] = ..., diff --git a/sdk/ai/azure-ai-projects/api.metadata.yml b/sdk/ai/azure-ai-projects/api.metadata.yml index 5e272b63910b..50b6e2c6bc4a 100644 --- a/sdk/ai/azure-ai-projects/api.metadata.yml +++ b/sdk/ai/azure-ai-projects/api.metadata.yml @@ -1,3 +1,4 @@ -apiMdSha256: 0e81f337eff9e8deff3910dfbe15c9091e0bbb2975f6b633e6a9fbddc1a80279 +apiMdSha256: b6b083ddf874aed0a93697454da22e333061e7bb447f9f6b6846d93d32eb53d6 +packageVersion: 2.6.0 parserVersion: 0.3.30 pythonVersion: 3.13.2 diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index 822d48028682..67ede6a88020 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -328,6 +328,13 @@ "azure.ai.projects.models.RealtimeConversationItem": "OpenAI.RealtimeConversationItem", "azure.ai.projects.models.RealtimeConversationItemFunctionCall": "OpenAI.RealtimeConversationItemFunctionCall", "azure.ai.projects.models.RealtimeConversationItemFunctionCallOutput": "OpenAI.RealtimeConversationItemFunctionCallOutput", + "azure.ai.projects.models.RealtimeConversationItemMessage": "OpenAI.RealtimeConversationItemMessage", + "azure.ai.projects.models.RealtimeConversationItemMessageAssistant": "OpenAI.RealtimeConversationItemMessageAssistant", + "azure.ai.projects.models.RealtimeConversationItemMessageAssistantContent": "OpenAI.RealtimeConversationItemMessageAssistantContent", + "azure.ai.projects.models.RealtimeConversationItemMessageSystem": "OpenAI.RealtimeConversationItemMessageSystem", + "azure.ai.projects.models.RealtimeConversationItemMessageSystemContent": "OpenAI.RealtimeConversationItemMessageSystemContent", + "azure.ai.projects.models.RealtimeConversationItemMessageUser": "OpenAI.RealtimeConversationItemMessageUser", + "azure.ai.projects.models.RealtimeConversationItemMessageUserContent": "OpenAI.RealtimeConversationItemMessageUserContent", "azure.ai.projects.models.RealtimeFunctionTool": "OpenAI.RealtimeFunctionTool", "azure.ai.projects.models.RealtimeFunctionToolParameters": "OpenAI.RealtimeFunctionToolParameters", "azure.ai.projects.models.RealtimeMCPApprovalRequest": "OpenAI.RealtimeMCPApprovalRequest", @@ -468,6 +475,7 @@ "azure.ai.projects.models.TracesDataGenerationJobOptions": "Azure.AI.Projects.TracesDataGenerationJobOptions", "azure.ai.projects.models.TracesDataGenerationJobSource": "Azure.AI.Projects.TracesDataGenerationJobSource", "azure.ai.projects.models.TracesEvaluatorGenerationJobSource": "Azure.AI.Projects.TracesEvaluatorGenerationJobSource", + "azure.ai.projects.models.TranscriptionLanguage": "OpenAI.TranscriptionLanguage", "azure.ai.projects.models.TranscriptTextUsageDuration": "OpenAI.TranscriptTextUsageDuration", "azure.ai.projects.models.TranscriptTextUsageTokens": "OpenAI.TranscriptTextUsageTokens", "azure.ai.projects.models.TranscriptTextUsageTokensInputTokenDetails": "OpenAI.TranscriptTextUsageTokensInputTokenDetails", @@ -558,6 +566,7 @@ "azure.ai.projects.models.PageOrder": "Azure.AI.Projects.PageOrder", "azure.ai.projects.models.RealtimeConversationItemType": "OpenAI.RealtimeConversationItemType", "azure.ai.projects.models.RealtimeMcpErrorType": "OpenAI.RealtimeMcpErrorType", + "azure.ai.projects.models.RealtimeConversationItemMessageType": "OpenAI.RealtimeConversationItemMessageType", "azure.ai.projects.models.VoiceType": "Azure.AI.Projects.VoiceType", "azure.ai.projects.models.RealtimeAudioFormatsType": "OpenAI.RealtimeAudioFormatsType", "azure.ai.projects.models.VoiceAudioRole": "Azure.AI.Projects.VoiceAudioRole", @@ -797,5 +806,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": "7e0039cfc367" + "CrossLanguageVersion": "39f992f697cf" } \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py index 4871bcf07bda..430f116b9f27 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py @@ -77,10 +77,11 @@ Mapping[str, Any], ] -# The conversation item variants accepted by ``conversation.item.create``. Message-type items -# (system/user/assistant) no longer have dedicated generated models in this API version and -# must be passed as a raw mapping. +# The conversation item variants accepted by ``conversation.item.create``. ConversationItem = Union[ + _models.RealtimeConversationItemMessageSystem, + _models.RealtimeConversationItemMessageUser, + _models.RealtimeConversationItemMessageAssistant, _models.RealtimeConversationItemFunctionCall, _models.RealtimeConversationItemFunctionCallOutput, _models.RealtimeMCPApprovalResponse, @@ -366,7 +367,10 @@ def create( """Insert an item into the conversation. :keyword item: The conversation item to create. - :paramtype item: ~azure.ai.projects.models.RealtimeConversationItemFunctionCall or + :paramtype item: ~azure.ai.projects.models.RealtimeConversationItemMessageSystem or + ~azure.ai.projects.models.RealtimeConversationItemMessageUser or + ~azure.ai.projects.models.RealtimeConversationItemMessageAssistant or + ~azure.ai.projects.models.RealtimeConversationItemFunctionCall or ~azure.ai.projects.models.RealtimeConversationItemFunctionCallOutput or ~azure.ai.projects.models.RealtimeMCPApprovalResponse or Mapping[str, Any] :keyword previous_item_id: The ID of the preceding item after which the new item will be diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py index fcd117e635a3..b204b9b1f4d4 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py @@ -91,10 +91,11 @@ Mapping[str, Any], ] -# The conversation item variants accepted by ``conversation.item.create``. Message-type items -# (system/user/assistant) no longer have dedicated generated models in this API version and -# must be passed as a raw mapping. +# The conversation item variants accepted by ``conversation.item.create``. ConversationItem = Union[ + _models.RealtimeConversationItemMessageSystem, + _models.RealtimeConversationItemMessageUser, + _models.RealtimeConversationItemMessageAssistant, _models.RealtimeConversationItemFunctionCall, _models.RealtimeConversationItemFunctionCallOutput, _models.RealtimeMCPApprovalResponse, @@ -380,7 +381,10 @@ async def create( """Insert an item into the conversation. :keyword item: The conversation item to create. - :paramtype item: ~azure.ai.projects.models.RealtimeConversationItemFunctionCall or + :paramtype item: ~azure.ai.projects.models.RealtimeConversationItemMessageSystem or + ~azure.ai.projects.models.RealtimeConversationItemMessageUser or + ~azure.ai.projects.models.RealtimeConversationItemMessageAssistant or + ~azure.ai.projects.models.RealtimeConversationItemFunctionCall or ~azure.ai.projects.models.RealtimeConversationItemFunctionCallOutput or ~azure.ai.projects.models.RealtimeMCPApprovalResponse or Mapping[str, Any] :keyword previous_item_id: The ID of the preceding item after which the new item will be 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 d85cbcf22377..eece26fb1455 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 @@ -330,6 +330,13 @@ RealtimeConversationItem, RealtimeConversationItemFunctionCall, RealtimeConversationItemFunctionCallOutput, + RealtimeConversationItemMessage, + RealtimeConversationItemMessageAssistant, + RealtimeConversationItemMessageAssistantContent, + RealtimeConversationItemMessageSystem, + RealtimeConversationItemMessageSystemContent, + RealtimeConversationItemMessageUser, + RealtimeConversationItemMessageUserContent, RealtimeFunctionTool, RealtimeFunctionToolParameters, RealtimeMCPApprovalRequest, @@ -483,6 +490,7 @@ TranscriptTextUsageDuration, TranscriptTextUsageTokens, TranscriptTextUsageTokensInputTokenDetails, + TranscriptionLanguage, Trigger, UpdateModelVersionRequest, UpdateToolboxRequest, @@ -646,6 +654,7 @@ RankerVersionType, RealtimeAudioFormatsType, RealtimeClientEventType, + RealtimeConversationItemMessageType, RealtimeConversationItemType, RealtimeMcpErrorType, RealtimeReasoningEffort, @@ -1028,6 +1037,13 @@ "RealtimeConversationItem", "RealtimeConversationItemFunctionCall", "RealtimeConversationItemFunctionCallOutput", + "RealtimeConversationItemMessage", + "RealtimeConversationItemMessageAssistant", + "RealtimeConversationItemMessageAssistantContent", + "RealtimeConversationItemMessageSystem", + "RealtimeConversationItemMessageSystemContent", + "RealtimeConversationItemMessageUser", + "RealtimeConversationItemMessageUserContent", "RealtimeFunctionTool", "RealtimeFunctionToolParameters", "RealtimeMCPApprovalRequest", @@ -1181,6 +1197,7 @@ "TranscriptTextUsageDuration", "TranscriptTextUsageTokens", "TranscriptTextUsageTokensInputTokenDetails", + "TranscriptionLanguage", "Trigger", "UpdateModelVersionRequest", "UpdateToolboxRequest", @@ -1341,6 +1358,7 @@ "RankerVersionType", "RealtimeAudioFormatsType", "RealtimeClientEventType", + "RealtimeConversationItemMessageType", "RealtimeConversationItemType", "RealtimeMcpErrorType", "RealtimeReasoningEffort", 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 322a9e120d91..5a1571689af9 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 @@ -1063,6 +1063,17 @@ class RealtimeClientEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """SESSION_AVATAR_CONNECT.""" +class RealtimeConversationItemMessageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of RealtimeConversationItemMessageType.""" + + SYSTEM = "system" + """SYSTEM.""" + USER = "user" + """USER.""" + ASSISTANT = "assistant" + """ASSISTANT.""" + + class RealtimeConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of RealtimeConversationItemType.""" @@ -1078,6 +1089,8 @@ class RealtimeConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta) """MCP_CALL.""" MCP_APPROVAL_REQUEST = "mcp_approval_request" """MCP_APPROVAL_REQUEST.""" + MESSAGE = "message" + """MESSAGE.""" class RealtimeMcpErrorType(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 530228b75695..8126a726f14f 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 @@ -43,6 +43,7 @@ PendingUploadType, RealtimeAudioFormatsType, RealtimeClientEventType, + RealtimeConversationItemMessageType, RealtimeConversationItemType, RealtimeMcpErrorType, RealtimeServerEventType, @@ -14995,17 +14996,18 @@ class RealtimeConversationItem(_Model): # pylint: disable=docstring-keyword-sho You probably want to use the sub-classes and not this class directly. Known sub-classes are: RealtimeConversationItemFunctionCall, RealtimeConversationItemFunctionCallOutput, RealtimeMCPApprovalRequest, RealtimeMCPApprovalResponse, RealtimeMCPToolCall, - RealtimeMCPListTools + RealtimeMCPListTools, RealtimeConversationItemMessage :ivar type: Required. Known values are: "function_call", "function_call_output", - "mcp_approval_response", "mcp_list_tools", "mcp_call", and "mcp_approval_request". + "mcp_approval_response", "mcp_list_tools", "mcp_call", "mcp_approval_request", and "message". :vartype type: str or ~azure.ai.projects.models.RealtimeConversationItemType """ __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\", and \"mcp_approval_request\".""" + \"mcp_approval_response\", \"mcp_list_tools\", \"mcp_call\", \"mcp_approval_request\", and + \"message\".""" @overload def __init__( @@ -15182,6 +15184,392 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RealtimeConversationItemType.FUNCTION_CALL_OUTPUT # type: ignore +class RealtimeConversationItemMessage( + RealtimeConversationItem, discriminator="message" +): # 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 + + :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 + """ + + __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, + *, + 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) + self.type = RealtimeConversationItemType.MESSAGE # type: ignore + + +class RealtimeConversationItemMessageAssistant( + RealtimeConversationItemMessage, discriminator="assistant" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime assistant message item. + + :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 + """ + + 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, + *, + 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 + 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 = RealtimeConversationItemMessageType.ASSISTANT # type: ignore + + +class RealtimeConversationItemMessageAssistantContent( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeConversationItemMessageAssistantContent. + + :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 + """ + + 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, + *, + type: Optional[Literal["output_text", "output_audio"]] = None, + text: Optional[str] = None, + audio: Optional[str] = None, + transcript: 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 RealtimeConversationItemMessageSystem( + RealtimeConversationItemMessage, discriminator="system" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime system message item. + + :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 + """ + + 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, + *, + 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 + 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 = RealtimeConversationItemMessageType.SYSTEM # type: ignore + + +class RealtimeConversationItemMessageSystemContent( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeConversationItemMessageSystemContent. + + :ivar type: Default value is "input_text". + :vartype type: str + :ivar text: + :vartype text: 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"]) + + @overload + def __init__( + self, + *, + type: Optional[Literal["input_text"]] = None, + 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 RealtimeConversationItemMessageUser( + RealtimeConversationItemMessage, discriminator="user" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime user message item. + + :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 + 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 = RealtimeConversationItemMessageType.USER # type: ignore + + +class RealtimeConversationItemMessageUserContent( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeConversationItemMessageUserContent. + + :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 + """ + + 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, + *, + 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 + 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 RealtimeFunctionTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Function tool. @@ -16226,6 +16614,9 @@ class RealtimeServerEventConversationItemInputAudioTranscriptionCompleted( :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 @@ -16248,6 +16639,11 @@ class RealtimeServerEventConversationItemInputAudioTranscriptionCompleted( """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"] ) @@ -16271,6 +16667,7 @@ def __init__( 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: ... @@ -21852,6 +22249,34 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = EvaluatorGenerationJobSourceType.TRACES # type: ignore +class TranscriptionLanguage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A language detected in transcribed audio. + + :ivar code: The code of a language detected in the audio. Required. + :vartype code: str + """ + + code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The code of a language detected in the audio. Required.""" + + @overload + def __init__( + self, + *, + code: 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 TranscriptTextUsageDuration( CreateTranscriptionResponseJsonUsage, discriminator="duration" ): # pylint: disable=docstring-keyword-should-match-keyword-only @@ -23605,6 +24030,13 @@ class VoiceAgentInputTranscription(_Model): # pylint: disable=docstring-keyword `_ (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 @@ -23631,6 +24063,13 @@ class VoiceAgentInputTranscription(_Model): # pylint: disable=docstring-keyword """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 @@ -23662,6 +24101,8 @@ def __init__( *, 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, @@ -26486,6 +26927,10 @@ class WebSearchTool(Tool, discriminator="web_search"): # pylint: disable=docstr :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: @@ -26510,6 +26955,9 @@ class WebSearchTool(Tool, discriminator="web_search"): # pylint: disable=docstr 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"] ) @@ -26540,6 +26988,7 @@ class WebSearchTool(Tool, discriminator="web_search"): # pylint: disable=docstr 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, @@ -26576,6 +27025,10 @@ class WebSearchToolboxTool( :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] :ivar type: 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: @@ -26591,6 +27044,9 @@ class WebSearchToolboxTool( type: Literal[ToolboxToolType.WEB_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """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"] ) @@ -26616,6 +27072,7 @@ def __init__( name: Optional[str] = None, description: Optional[str] = None, tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + 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, diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_function_tool.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_function_tool.py index ab9cb2050f81..ea45ee5832be 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_function_tool.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_function_tool.py @@ -38,6 +38,9 @@ from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( RealtimeConversationItemFunctionCallOutput, + RealtimeConversationItemMessageUser, + RealtimeConversationItemMessageUserContent, + RealtimeConversationItemType, RealtimeFunctionTool, RealtimeServerEventError, VoiceAgentDefinition, @@ -76,10 +79,11 @@ def _run_turn_with_tool_support(client: AIProjectClient, agent_name: str, prompt :type prompt: str """ with client.realtime.connect(agent_name=agent_name) as conn: - # Message-type conversation items (system/user/assistant) don't have dedicated generated - # models in this API version, so they're sent as a raw mapping matching the wire schema. conn.conversation.item.create( - item={"type": "message", "role": "user", "content": [{"type": "input_text", "text": prompt}]} + item=RealtimeConversationItemMessageUser( + type=RealtimeConversationItemType.MESSAGE, + content=[RealtimeConversationItemMessageUserContent(type="input_text", text=prompt)], + ) ) conn.response.create() diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py index 289978bc4920..3f0e2e79ab13 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py @@ -14,10 +14,9 @@ then publish a version with `store=True` so the conversation can be read back afterward. 2. Hold a typed, multi-turn conversation: each prompt is sent as a - raw ``conversation.item.create`` message item (message-type items no - longer have a dedicated generated model in this API version) and the - reply streams back as typed audio and transcript events. Blank line - (or ``exit`` / ``quit``) ends it. + ``RealtimeConversationItemMessageUser`` and the reply streams back as + typed audio and transcript events. Blank line (or ``exit`` / ``quit``) + ends it. 3. Fetch the persisted conversation back by id. 4. Delete the agent created for this sample. @@ -53,6 +52,9 @@ AgentKind, GenerateVoiceAgentRequest, VoiceAgentDefinition, + RealtimeConversationItemMessageUser, + RealtimeConversationItemMessageUserContent, + RealtimeConversationItemType, RealtimeServerEventResponseAudioDelta, RealtimeServerEventResponseAudioTranscriptDone, RealtimeServerEventResponseDone, @@ -171,11 +173,12 @@ def pump() -> None: if not prompt or prompt.lower() in ("exit", "quit"): break - # Send the turn and ask the agent to respond. Message-type conversation items - # (system/user/assistant) don't have dedicated generated models in this API - # version, so they're sent as a raw mapping matching the wire schema. + # Send the turn and ask the agent to respond. conn.conversation.item.create( - item={"type": "message", "role": "user", "content": [{"type": "input_text", "text": prompt}]} + item=RealtimeConversationItemMessageUser( + type=RealtimeConversationItemType.MESSAGE, + content=[RealtimeConversationItemMessageUserContent(type="input_text", text=prompt)], + ) ) conn.response.create() pump() diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py index 66d2fe157149..c905b7650cba 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py @@ -14,10 +14,9 @@ then publish a version with `store=True` so the conversation can be read back afterward. 2. Hold a typed, multi-turn conversation: each prompt is sent as a - raw ``conversation.item.create`` message item (message-type items no - longer have a dedicated generated model in this API version) and the - reply streams back as typed audio and transcript events. Blank line - (or ``exit`` / ``quit``) ends it. + ``RealtimeConversationItemMessageUser`` and the reply streams back as + typed audio and transcript events. Blank line (or ``exit`` / ``quit``) + ends it. 3. Fetch the persisted conversation back by id. 4. Delete the agent created for this sample. @@ -51,6 +50,9 @@ AgentKind, GenerateVoiceAgentRequest, VoiceAgentDefinition, + RealtimeConversationItemMessageUser, + RealtimeConversationItemMessageUserContent, + RealtimeConversationItemType, RealtimeServerEventResponseAudioDelta, RealtimeServerEventResponseAudioTranscriptDone, RealtimeServerEventResponseDone, @@ -169,11 +171,12 @@ async def pump() -> None: if not prompt or prompt.lower() in ("exit", "quit"): break - # Send the turn and ask the agent to respond. Message-type conversation items - # (system/user/assistant) don't have dedicated generated models in this API - # version, so they're sent as a raw mapping matching the wire schema. + # Send the turn and ask the agent to respond. await conn.conversation.item.create( - item={"type": "message", "role": "user", "content": [{"type": "input_text", "text": prompt}]} + item=RealtimeConversationItemMessageUser( + type=RealtimeConversationItemType.MESSAGE, + content=[RealtimeConversationItemMessageUserContent(type="input_text", text=prompt)], + ) ) await conn.response.create() diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_synthetic_multiturn_evaluation.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_synthetic_multiturn_evaluation.py index e4c8ad60b306..84ba4efebef4 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_synthetic_multiturn_evaluation.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_synthetic_multiturn_evaluation.py @@ -108,13 +108,9 @@ def main() -> None: ], options=SimulationSeedDataGenerationJobOptions( max_samples=SEED_COUNT, - model_options=DataGenerationModelOptions( - model=model_deployment_name - ), - ), - output_options=DataGenerationJobOutputOptions( - name=f"{agent_name}-simulation-seeds" + model_options=DataGenerationModelOptions(model=model_deployment_name), ), + output_options=DataGenerationJobOutputOptions(name=f"{agent_name}-simulation-seeds"), ), ), polling_interval=10, @@ -122,9 +118,7 @@ def main() -> None: generation_result = poller.result() seeds = generation_result.outputs[0] if generation_result.outputs else None - assert isinstance( - seeds, DatasetDataGenerationJobOutput - ), "Expected a dataset output from the generation job" + assert isinstance(seeds, DatasetDataGenerationJobOutput), "Expected a dataset output from the generation job" assert seeds.id is not None, "Generation job returned a dataset without an id" print(f"Generated {generation_result.generated_samples} seed scenarios") @@ -205,14 +199,10 @@ def main() -> None: print("Simulation runs can take several minutes. Polling...") while True: - run = client.evals.runs.retrieve( - run_id=eval_run.id, eval_id=eval_object.id - ) + run = client.evals.runs.retrieve(run_id=eval_run.id, eval_id=eval_object.id) if run.status in ("completed", "failed", "canceled"): break - print( - f"Waiting for simulation to complete... current status: {run.status}" - ) + print(f"Waiting for simulation to complete... current status: {run.status}") time.sleep(10) if run.status != "completed": @@ -221,28 +211,17 @@ def main() -> None: print("\nSynthetic multi-turn evaluation completed successfully.") print(f"Result Counts: {run.result_counts}") if run.result_counts.errored: - raise RuntimeError( - f"{run.result_counts.errored} evaluation item(s) errored" - ) + raise RuntimeError(f"{run.result_counts.errored} evaluation item(s) errored") - expected_conversations = ( - generation_result.generated_samples * CONVERSATIONS_PER_SEED - ) + expected_conversations = generation_result.generated_samples * CONVERSATIONS_PER_SEED print( f"Expected: {expected_conversations} conversations " f"({generation_result.generated_samples} generated scenarios x " f"{CONVERSATIONS_PER_SEED} per scenario)" ) - output_items = list( - client.evals.runs.output_items.list( - run_id=run.id, eval_id=eval_object.id - ) - ) - if ( - run.result_counts.total != expected_conversations - or len(output_items) != expected_conversations - ): + output_items = list(client.evals.runs.output_items.list(run_id=run.id, eval_id=eval_object.id)) + if run.result_counts.total != expected_conversations or len(output_items) != expected_conversations: raise RuntimeError( f"Expected {expected_conversations} conversations, got " f"{run.result_counts.total} results and {len(output_items)} output items" diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud.py b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud.py index b648f281fe28..ec65e24f9b76 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud.py @@ -116,7 +116,7 @@ def make_definition(instructions: str) -> VoiceAgentDefinition: # To run only this test: # pytest tests\agents\test_voice_agent_crud.py::TestVoiceAgentCrud::test_voice_agent_disable_enable -s @servicePreparer() - @recorded_by_proxy(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX) + @recorded_by_proxy(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX2) def test_voice_agent_disable_enable(self, **kwargs): """ Test disable and enable operations for a voice Agent. diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud_async.py b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud_async.py index 5864efa4b062..94720cdf133d 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud_async.py @@ -120,7 +120,7 @@ def make_definition(instructions: str) -> VoiceAgentDefinition: # To run only this test: # pytest tests\agents\test_voice_agent_crud_async.py::TestVoiceAgentCrudAsync::test_voice_agent_disable_enable_async -s @servicePreparer() - @recorded_by_proxy_async(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX) + @recorded_by_proxy_async(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX2) async def test_voice_agent_disable_enable_async(self, **kwargs): """ Test disable and enable operations for a voice Agent. diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml.saved b/sdk/ai/azure-ai-projects/tsp-location.yaml.saved index 1d0fdbcec72b..fef0a3f81375 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml.saved +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml.saved @@ -1,5 +1,5 @@ directory: specification/ai-foundry/data-plane/Foundry/src/sdk-python-js-azure-ai-projects -commit: 2e1e4f1d8a43ce114b3a3532d25a34fe1c2fa915 +commit: 3fe1059cb3bb4d6dc5cf62910c09c47b64a092ad repo: Azure/azure-rest-api-specs additionalDirectories: - specification/ai-foundry/data-plane/Foundry/src/agents From 5565656941123997965b6cbab7d190822d60aa65 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Wed, 2 Sep 2026 11:21:04 -0700 Subject: [PATCH 43/56] Fix PR #48484 review comments, docs generation failure, and recording asset gaps - Fixed genuine bugs found in review: immutable-headers fallback dropping caller headers (aio/_patch.py), connection_url query-delimiter corruption, stream=False defeating a hard-SSE-only operation (PostEmitter.ps1 + regenerated files), audio barge-in not discarding stale buffered chunks, missing aiohttp dependency in the [realtime] extra, missing __all__ exports for beta operation classes, _AgentDefinitionOptInKeys leaking as public API, wrong tool type in 2 samples (RealtimeFunctionTool -> VoiceAgentFunctionTool), 2 samples with interactive input() causing EOFError in the non-interactive sample-check runner (added to IGNORED_SAMPLES in both copies), unused _RESPONSE_TIMEOUT in 2 samples (added real recv(timeout=...) support to the SDK), async sample not cancelling the stale server response after a client-side timeout. - Corrected several stale/inaccurate CHANGELOG.md statements (connection.item -> connection.conversation.item, async transport is aiohttp not websockets). - Added test_generate_agent/_async (recorded) and 37 new transport-mocked unit tests across tests/agents/test_realtime_client.py/_async.py covering URL construction, auth headers, event serialization/dispatch, timeouts, and connection cleanup for the hand-written realtime WebSocket clients. - Fixed a docs generation (sphinx) failure: two docstrings in models/_models.py had un-indented bullet-list continuation lines that docutils flags as warnings-as-errors. Fixed directly and via a new PostEmitter.ps1 fixup so future regenerations don't reintroduce it. - Generated, verified, and pushed recordings for the 4 previously-failing voice-agent CRUD tests plus 2 new generate_agent tests to azure-sdk-assets; updated assets.json's Tag accordingly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/tools/azure-sdk-tools/azpysdk/samples.py | 6 + scripts/devops_tasks/test_run_samples.py | 6 + sdk/ai/azure-ai-projects/.env.template | 7 + sdk/ai/azure-ai-projects/CHANGELOG.md | 4 +- sdk/ai/azure-ai-projects/PostEmitter.ps1 | 113 ++++++- sdk/ai/azure-ai-projects/assets.json | 2 +- .../azure/ai/projects/_realtime.py | 17 +- .../azure/ai/projects/aio/_patch.py | 4 +- .../ai/projects/aio/operations/_operations.py | 3 +- .../ai/projects/aio/operations/_patch.py | 2 + .../azure/ai/projects/models/__init__.py | 2 - .../azure/ai/projects/models/_models.py | 17 +- .../ai/projects/operations/_operations.py | 3 +- .../azure/ai/projects/operations/_patch.py | 2 + sdk/ai/azure-ai-projects/pyproject.toml | 1 + ...ice_agent_live_audio_conversation_async.py | 9 +- .../sample_voice_agent_live_function_tool.py | 17 +- ...mple_voice_agent_live_text_conversation.py | 8 +- ...oice_agent_live_text_conversation_async.py | 3 + .../voice/sample_voice_agent_with_tools.py | 7 +- .../tests/agents/test_realtime_client.py | 276 ++++++++++++++++++ .../agents/test_realtime_client_async.py | 268 +++++++++++++++++ .../tests/agents/test_voice_agent_crud.py | 36 ++- .../agents/test_voice_agent_crud_async.py | 37 ++- 24 files changed, 798 insertions(+), 52 deletions(-) create mode 100644 sdk/ai/azure-ai-projects/tests/agents/test_realtime_client.py create mode 100644 sdk/ai/azure-ai-projects/tests/agents/test_realtime_client_async.py diff --git a/eng/tools/azure-sdk-tools/azpysdk/samples.py b/eng/tools/azure-sdk-tools/azpysdk/samples.py index a7f7b83e229e..38bee23d1e4c 100644 --- a/eng/tools/azure-sdk-tools/azpysdk/samples.py +++ b/eng/tools/azure-sdk-tools/azpysdk/samples.py @@ -84,6 +84,12 @@ "hello_world_sample_entra_id_and_bleu.py", ], "azure-ai-ml": ["ml_samples_authentication_sovereign_cloud.py"], + "azure-ai-projects": [ + # These interactively read from stdin via input(), which raises EOFError when this + # runner executes the file non-interactively. + "sample_voice_agent_live_text_conversation.py", + "sample_voice_agent_live_text_conversation_async.py", + ], "azure-eventgrid": [ "__init__.py", "consume_cloud_events_from_eventhub.py", diff --git a/scripts/devops_tasks/test_run_samples.py b/scripts/devops_tasks/test_run_samples.py index 2d7b44c9c366..8e033f04599b 100644 --- a/scripts/devops_tasks/test_run_samples.py +++ b/scripts/devops_tasks/test_run_samples.py @@ -88,6 +88,12 @@ "azure-ai-ml": [ "ml_samples_authentication_sovereign_cloud.py" ], + "azure-ai-projects": [ + # These interactively read from stdin via input(), which raises EOFError when this + # runner executes the file non-interactively. + "sample_voice_agent_live_text_conversation.py", + "sample_voice_agent_live_text_conversation_async.py", + ], "azure-eventgrid": [ "__init__.py", "consume_cloud_events_from_eventhub.py", diff --git a/sdk/ai/azure-ai-projects/.env.template b/sdk/ai/azure-ai-projects/.env.template index b4716440a60c..d9da54546934 100644 --- a/sdk/ai/azure-ai-projects/.env.template +++ b/sdk/ai/azure-ai-projects/.env.template @@ -23,7 +23,14 @@ AZURE_AI_PROJECTS_CONSOLE_LOGGING= FOUNDRY_PROJECT_ENDPOINT= FOUNDRY_PROJECT_API_KEY= FOUNDRY_MODEL_NAME= +# Read by the recorded voice-agent CRUD tests only (tests/test_base.py), not by any sample. FOUNDRY_VOICE_MODEL_NAME= +# Read by the samples under samples/agents/voice/ (model deployment name, agent name, model type, +# and a conversation ID for the read-conversation samples). Distinct from FOUNDRY_VOICE_MODEL_NAME above. +FOUNDRY_VOICE_MODEL= +FOUNDRY_VOICE_MODEL_TYPE= +FOUNDRY_VOICE_AGENT_NAME= +FOUNDRY_VOICE_CONVERSATION_ID= FOUNDRY_AGENT_NAME= FOUNDRY_AGENT_CONTAINER_IMAGE= CONVERSATION_ID= diff --git a/sdk/ai/azure-ai-projects/CHANGELOG.md b/sdk/ai/azure-ai-projects/CHANGELOG.md index 02859c6a4353..5f6f42a19fbb 100644 --- a/sdk/ai/azure-ai-projects/CHANGELOG.md +++ b/sdk/ai/azure-ai-projects/CHANGELOG.md @@ -7,7 +7,7 @@ * Added voice agents, unified with the rest of the Agents API as a new `kind="voice"` on `AgentDefinition`: * Define a voice agent with `VoiceAgentDefinition`, configuring its model (`VoiceModelType`), audio input/output (`VoiceAgentAudioConfig`, `VoiceAgentAudioInputConfig`, `VoiceAgentAudioOutputConfig`), turn detection (`VoiceAgentTurnDetectionConfig` and its `VoiceAgentServerVadTurnDetection` / `VoiceAgentAzureSemanticVadTurnDetection` / `VoiceAgentAzureSemanticVadEnTurnDetection` / `VoiceAgentAzureSemanticVadMultilingualTurnDetection` variants), greeting (`VoiceAgentGreetingConfig` and its `VoiceAgentTemplateGreetingConfig` / `VoiceAgentLlmGeneratedGreetingConfig` variants), tools (`VoiceAgentTool`, `VoiceAgentFunctionTool`, `VoiceAgentMcpTool`, `VoiceAgentSystemTool`, `VoiceAgentToolboxTool`), and avatar (`VoiceAgentAvatarConfig`). Manage it like any other agent through `project_client.agents` (`create_version`, `get`, `list`, `disable`/`enable`, `delete`). * Added guided authoring via `project_client.agents.generate_agent(GenerateVoiceAgentRequest(kind=AgentKind.VOICE, ...))`, which returns a service-generated starter definition that can be edited afterward through the standard `create_version`/`update` flow. - * Added a new `client.realtime` / `async_client.realtime` entry point for realtime speech-to-speech streaming. Use `with client.realtime.connect(agent_name=...) as connection:` to open a WebSocket connection, `connection.send(...)` to send strongly-typed client events (or use the `connection.response`, `connection.item`, and `connection.session` helpers), and iterate over `connection` to receive strongly-typed server events (`RealtimeServerEvent*`). Conversation items exchanged with `connection.conversation.item.create(...)` are `RealtimeConversationItemMessageSystem`, `RealtimeConversationItemMessageUser`, `RealtimeConversationItemMessageAssistant`, `RealtimeConversationItemFunctionCall`, `RealtimeConversationItemFunctionCallOutput`, `RealtimeMCPApprovalResponse`, or a raw `Mapping[str, Any]`. The new types `Realtime`, `RealtimeConnection`, and `RealtimeConnectionManager` (and their async equivalents `AsyncRealtime`, `AsyncRealtimeConnection`, `AsyncRealtimeConnectionManager`) are exported from `azure.ai.projects` / `azure.ai.projects.aio`. Requires the optional `websockets` package. + * Added a new `client.realtime` / `async_client.realtime` entry point for realtime speech-to-speech streaming. Use `with client.realtime.connect(agent_name=...) as connection:` to open a WebSocket connection, `connection.send(...)` to send strongly-typed client events (or use the `connection.response`, `connection.conversation.item`, and `connection.session` helpers), and iterate over `connection` to receive strongly-typed server events (`RealtimeServerEvent*`). Conversation items exchanged with `connection.conversation.item.create(...)` are `RealtimeConversationItemMessageSystem`, `RealtimeConversationItemMessageUser`, `RealtimeConversationItemMessageAssistant`, `RealtimeConversationItemFunctionCall`, `RealtimeConversationItemFunctionCallOutput`, `RealtimeMCPApprovalResponse`, or a raw `Mapping[str, Any]`. The new types `Realtime`, `RealtimeConnection`, and `RealtimeConnectionManager` (and their async equivalents `AsyncRealtime`, `AsyncRealtimeConnection`, `AsyncRealtimeConnectionManager`) are exported from `azure.ai.projects` / `azure.ai.projects.aio`. Requires the optional `websockets` package for the sync client, or `aiohttp` for the async client. * Added the `beta.agent_endpoint_conversations` operation group for reading back persisted voice-agent conversation transcripts and audio, for agents created with `store=True`. * Added the underlying `RealtimeConversationItem*`, `RealtimeMCP*`, `RealtimeResponseUsage`, and related realtime event/session models used by the voice agent WebSocket protocol. * Added 11 new samples under `samples/agents/voice/`, covering basic agent lifecycle, guided generation, live audio and text conversations (sync and async), function tools, versioning, and reading back conversation transcripts and audio. @@ -21,7 +21,7 @@ ### Dependency update -* Added an optional dependency on `websockets`, required only when using the new `client.realtime` / `async_client.realtime` voice agent streaming APIs. +* Added an optional dependency on `websockets` (sync `client.realtime`) and `aiohttp` (async `async_client.realtime`), required only when using the new voice agent realtime streaming APIs. ### Bugs Fixed diff --git a/sdk/ai/azure-ai-projects/PostEmitter.ps1 b/sdk/ai/azure-ai-projects/PostEmitter.ps1 index 62ebc99f8f95..664a86d2be5b 100644 --- a/sdk/ai/azure-ai-projects/PostEmitter.ps1 +++ b/sdk/ai/azure-ai-projects/PostEmitter.ps1 @@ -40,6 +40,22 @@ if (Test-Path $typesFile) { Remove-Item $typesFile -Force } +# `_AgentDefinitionOptInKeys` is an internal implementation-detail enum (leading underscore) used +# only to build the `Foundry-Features` opt-in header value in hand-written `_patch.py`/`_realtime.py` +# customization code, which always imports it directly from `.models._enums` (or `..models._enums`) - +# never through the `models` package's public re-export. The emitter nonetheless includes it in +# `models/__init__.py`'s import list and `__all__`, which makes it part of the public API surface +# (and shows up in APIView) even though nothing needs it there. Strip it from both places. +$f = 'azure\ai\projects\models\__init__.py' +$lines = Get-Content $f +$out = New-Object System.Collections.Generic.List[string] +foreach ($line in $lines) { + if ($line -match '^\s*_AgentDefinitionOptInKeys,\s*$') { continue } + if ($line -match '^\s*"_AgentDefinitionOptInKeys",\s*$') { continue } + $out.Add($line) +} +Set-Content $f $out + # Remove the generated `voice_agent_web_socket` operation group from the public surface entirely. # The generated operation only performs a plain HTTP GET (no WebSocket upgrade handshake) and # discards the connection - it's not a usable client and was never meant to be public (the real @@ -73,25 +89,33 @@ foreach ($f in $files) { # get_session_log_stream must always treat the response as an SSE stream, but must still pop any # caller-supplied stream= kwarg first -- otherwise it collides with the explicit stream=_stream # argument passed to self._client._pipeline.run(), raising "got multiple values for keyword -# argument 'stream'" (hit by samples calling get_session_log_stream(..., stream=True)). +# argument 'stream'" (hit by samples calling get_session_log_stream(..., stream=True)). The popped +# value is discarded (not used to set _stream): this operation must always stream regardless of +# what the caller passes, otherwise a caller-supplied stream=False would make the generated method +# attempt normal deserialization of an open SSE response, which is invalid per its SSE contract. $files = 'azure\ai\projects\operations\_operations.py', 'azure\ai\projects\aio\operations\_operations.py' foreach ($f in $files) { $lines = Get-Content $f + $out = New-Object System.Collections.Generic.List[string] $inFunc = $false - for ($i = 0; $i -lt $lines.Length; $i++) { - if ($lines[$i] -match '^\s*(async\s+)?def\s+get_session_log_stream\(') { + foreach ($line in $lines) { + if ($line -match '^\s*(async\s+)?def\s+get_session_log_stream\(') { $inFunc = $true + $out.Add($line) continue } - if ($inFunc -and $lines[$i] -match '^\s*(async\s+)?def\s+\w+\(') { + if ($inFunc -and $line -match '^\s*(async\s+)?def\s+\w+\(') { $inFunc = $false } - if ($inFunc -and $lines[$i] -match '^\s*_stream = (True|kwargs\.pop\(.+\))\s*$') { - $indent = ([regex]::Match($lines[$i], '^\s*')).Value - $lines[$i] = $indent + '_stream = kwargs.pop("stream", True)' + if ($inFunc -and $line -match '^\s*_stream = (True|kwargs\.pop\(.+\))\s*$') { + $indent = ([regex]::Match($line, '^\s*')).Value + $out.Add($indent + 'kwargs.pop("stream", None) # must always stream; discard any caller override') + $out.Add($indent + '_stream = True') + continue } + $out.Add($line) } - Set-Content $f $lines + Set-Content $f $out } # Fix Sphinx docutils warnings in class SessionLogEvent: the generated docstring wraps two long @@ -205,6 +229,65 @@ $c = $c.Replace( ) Set-Content $f $c -NoNewline +# Fix Sphinx docutils "Bullet list ends without a blank line; unexpected unindent" warnings in +# RealtimeServerEventConversationItemAdded and RealtimeServerEventConversationItemCreated +# (models/_models.py). Same root cause and fix pattern as the VoiceAudioOutputConfig/ +# VoiceConversationStatus fixup above: the emitter wraps long bullet-item lines without +# indenting the continuation lines to align with the bullet's text, and (for +# ConversationItemAdded) runs the trailing summary sentence straight into the last bullet with +# no blank line to end the list. See the NOTE above the VoiceAudioOutputConfig fix for why these +# use single-quoted @'...'@ here-strings (this text is full of literal Markdown backticks). +$f = 'azure\ai\projects\models\_models.py' +$c = Get-Content $f -Raw +$c = $c.Replace( +@' + * 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 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. +'@ +) +$c = $c.Replace( +@' + * 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. +'@ +) +Set-Content $f $c -NoNewline + # A block of code in the implementation of "list_memories", in both sync # and async _operations.py files, needs to be moved up. It's emitted in the wrong place, # in the inline function named "prepare_request". Instead it should be moved up into the @@ -258,9 +341,11 @@ foreach ($f in $files) { $c = Get-Content $f -Raw # Find all occurrences of "def list_memories(" and get the index of the last one $methodMatches = [regex]::Matches($c, 'def list_memories\(') - if ($methodMatches.Count -eq 0) { continue } + if ($methodMatches.Count -eq 0) { + throw "PostEmitter.ps1: expected to find at least one 'def list_memories(' in $f, but found none. The emitter output has likely changed shape; update this fixup instead of silently skipping it (it exists to avoid an unbound-'body' pyright/runtime failure)." + } $lastMethodStart = $methodMatches[$methodMatches.Count - 1].Index - + # Find the pattern to replace - first occurrence after the last list_memories method $patternEscaped = [regex]::Escape($oldPattern) $patternMatches = [regex]::Matches($c, $patternEscaped) @@ -271,11 +356,13 @@ foreach ($f in $files) { break } } - if ($matchToReplace -eq $null) { continue } - + if ($matchToReplace -eq $null) { + throw "PostEmitter.ps1: expected list_memories() body in $f to match the known emitter shape (the unbound-'body'-in-prepare_request pattern), but no match was found after the last 'def list_memories(' occurrence. The emitter output has likely changed shape; update `$oldPattern/`$newPattern instead of silently skipping this fixup, otherwise the regenerated package would ship with the unbound-variable bug this fixup exists to prevent." + } + # Replace only that specific occurrence $c = $c.Substring(0, $matchToReplace.Index) + $newPattern + $c.Substring($matchToReplace.Index + $matchToReplace.Length) - + Set-Content $f $c -NoNewline } diff --git a/sdk/ai/azure-ai-projects/assets.json b/sdk/ai/azure-ai-projects/assets.json index a752858f6c47..40aa879ee385 100644 --- a/sdk/ai/azure-ai-projects/assets.json +++ b/sdk/ai/azure-ai-projects/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "python", "TagPrefix": "python/ai/azure-ai-projects", - "Tag": "python/ai/azure-ai-projects_87c1bbe525" + "Tag": "python/ai/azure-ai-projects_111cb1312b" } diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py index 430f116b9f27..a0e54f73ae92 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py @@ -535,21 +535,26 @@ def _iter(self) -> Iterator[ServerEvent]: except ConnectionResetError: return - def recv(self) -> ServerEvent: + def recv(self, *, timeout: Optional[float] = None) -> ServerEvent: """Receive and parse the next server event. Known event types are returned as their strongly-typed ``VoiceAgentServerEventXxx`` model. Event types not (yet) represented by a generated model are returned as a plain ``dict`` for forward compatibility. + :keyword timeout: Maximum time in seconds to wait for the next event. If ``None`` + (the default), block until an event is received. If no event arrives within + ``timeout`` seconds, raise :exc:`TimeoutError`. + :paramtype timeout: float or None :return: The parsed server event. :rtype: ~azure.ai.projects.ServerEvent :raises ConnectionResetError: If the connection was closed by the server. + :raises TimeoutError: If ``timeout`` elapses before an event is received. """ from websockets.exceptions import ConnectionClosed # pylint: disable=import-outside-toplevel try: - raw = self._connection.recv() + raw = self._connection.recv(timeout=timeout) except ConnectionClosed as exc: self._closed = True raise ConnectionResetError("The realtime connection was closed.") from exc @@ -669,7 +674,13 @@ def enter(self) -> RealtimeConnection: # pylint: disable=too-many-locals params["x-agent-version-override"] = self._agent_version_override params.update(self._extra_query) - full_url = f"{url}?{urlencode(params)}" if params else url + if params: + # Preserve an existing query string on a `connection_url` override (for example a + # SAS-style `?sig=...`) instead of unconditionally appending a second `?`. + delimiter = "&" if urlparse(url).query else "?" + full_url = f"{url}{delimiter}{urlencode(params)}" + else: + full_url = url token = self._credential.get_token(*self._credential_scopes) headers: Dict[str, str] = { diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py index 32b6bc9c1e08..a541f3aab9ad 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py @@ -80,7 +80,9 @@ def _wrapped(*args: Any, **kwargs: Any) -> Any: try: headers[_ACCEPT_ENCODING_HEADER_NAME] = _ACCEPT_ENCODING_IDENTITY_VALUE except Exception: # pylint: disable=broad-except - kwargs["headers"] = {_ACCEPT_ENCODING_HEADER_NAME: _ACCEPT_ENCODING_IDENTITY_VALUE} + # `headers` may be an immutable mapping; merge into a fresh mutable dict + # instead of discarding the caller-supplied entries. + kwargs["headers"] = {**headers, _ACCEPT_ENCODING_HEADER_NAME: _ACCEPT_ENCODING_IDENTITY_VALUE} return attribute(*args, **kwargs) 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 f019050110f0..b16240b80260 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 @@ -2276,7 +2276,8 @@ 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", True) + kwargs.pop("stream", None) # must always stream; discard any caller override + _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/aio/operations/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch.py index 3c765532b1af..c7920de4adbb 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch.py @@ -91,6 +91,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: __all__: List[str] = [ "AgentsOperations", + "BetaAgentEndpointConversationsOperations", + "BetaAgentInsightMonitorsOperations", "BetaAgentsOperations", "BetaDatasetsOperations", "BetaEvaluationTaxonomiesOperations", 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 eece26fb1455..d11874d721d9 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 @@ -715,7 +715,6 @@ VoiceModelType, VoiceOutputModality, VoiceType, - _AgentDefinitionOptInKeys, ) from ._patch import __all__ as _patch_all from ._patch import * @@ -1419,7 +1418,6 @@ "VoiceModelType", "VoiceOutputModality", "VoiceType", - "_AgentDefinitionOptInKeys", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() 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 8126a726f14f..1c44f2ad1d21 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 @@ -16398,10 +16398,11 @@ class RealtimeServerEventConversationItemAdded( * 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. + 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`). + 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. @@ -16453,13 +16454,13 @@ class RealtimeServerEventConversationItemCreated( 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`. + 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. + 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. + to the Conversation. :ivar event_id: The unique ID of the server event. Required. :vartype event_id: str 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 3b8cf9330b4e..8a0e81c55805 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 @@ -6588,7 +6588,8 @@ 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", True) + kwargs.pop("stream", None) # must always stream; discard any caller override + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch.py index 3b72ba8d198c..fe39cec6850f 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch.py @@ -146,6 +146,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: __all__: List[str] = [ "AgentsOperations", + "BetaAgentEndpointConversationsOperations", + "BetaAgentInsightMonitorsOperations", "BetaAgentsOperations", "BetaDatasetsOperations", "BetaEvaluationTaxonomiesOperations", diff --git a/sdk/ai/azure-ai-projects/pyproject.toml b/sdk/ai/azure-ai-projects/pyproject.toml index 0e5df821066d..494cef1bf4ba 100644 --- a/sdk/ai/azure-ai-projects/pyproject.toml +++ b/sdk/ai/azure-ai-projects/pyproject.toml @@ -45,6 +45,7 @@ dynamic = [ [project.optional-dependencies] realtime = [ "websockets>=13.0", + "aiohttp>=3.9.0,<4.0.0", ] [project.urls] diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py index f8fbe62babe9..4e6e86aeb74c 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py @@ -138,9 +138,15 @@ def start_playback(self) -> None: if self._output_stream is not None: return remaining = b"" + # The sequence number the currently-buffered `remaining` bytes were dequeued from, so a + # barge-in that lands *between* callback invocations can still discard them below. + remaining_seq = -1 def _playback_callback(_in_data, frame_count, _time_info, _status): - nonlocal remaining + nonlocal remaining, remaining_seq + if remaining and remaining_seq < self._playback_base: + remaining = b"" # a barge-in advanced the base since this chunk was dequeued + wanted = frame_count * pyaudio.get_sample_size(pyaudio.paInt16) out = remaining[:wanted] remaining = remaining[wanted:] @@ -159,6 +165,7 @@ def _playback_callback(_in_data, frame_count, _time_info, _status): take = wanted - len(out) out = out + data[:take] remaining = data[take:] + remaining_seq = seq return (out, pyaudio.paContinue) diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_function_tool.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_function_tool.py index ea45ee5832be..cad26e7f1cb9 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_function_tool.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_function_tool.py @@ -20,7 +20,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0" python-dotenv + pip install "azure-ai-projects[realtime]>=2.0.0" azure-identity python-dotenv Set these environment variables with your own values: 1) FOUNDRY_PROJECT_ENDPOINT - The Azure AI Project endpoint. @@ -41,9 +41,9 @@ RealtimeConversationItemMessageUser, RealtimeConversationItemMessageUserContent, RealtimeConversationItemType, - RealtimeFunctionTool, RealtimeServerEventError, VoiceAgentDefinition, + VoiceAgentFunctionTool, RealtimeServerEventResponseDone, RealtimeServerEventResponseFunctionCallArgumentsDone, RealtimeServerEventResponseTextDone, @@ -87,7 +87,13 @@ def _run_turn_with_tool_support(client: AIProjectClient, agent_name: str, prompt ) conn.response.create() - for event in conn: + while True: + try: + event = conn.recv(timeout=_RESPONSE_TIMEOUT) + except TimeoutError: + print("Timed out waiting for the agent's reply.") + conn.response.cancel() + return if isinstance(event, RealtimeServerEventResponseFunctionCallArgumentsDone): # The service forwards the call to us; execute it locally and # send the result back so the agent can use it in its reply. @@ -123,8 +129,7 @@ def main() -> None: endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] agent_name = os.environ.get("FOUNDRY_VOICE_AGENT_NAME") or "sample-voice-agent-function-tool" - get_weather_tool = RealtimeFunctionTool( - type="function", + get_weather_tool = VoiceAgentFunctionTool( name="get_weather", description="Get the current weather for a city.", parameters=cast( @@ -152,7 +157,7 @@ def main() -> None: "caller asks about the weather, then answer using its result." ), output_modalities=[VoiceOutputModality.TEXT], - tools=[get_weather_tool], # type: ignore[list-item] + tools=[get_weather_tool], ), ) print(f"Created voice agent: {agent_name}") diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py index 3f0e2e79ab13..8b650f4f9b57 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py @@ -151,7 +151,13 @@ def _run_text_conversation(client: AIProjectClient, agent_name: str) -> Optional def pump() -> None: nonlocal conversation_id, audio_delta_count - for event in conn: + while True: + try: + event = conn.recv(timeout=_RESPONSE_TIMEOUT) + except TimeoutError: + print("Timed out waiting for the agent's reply.") + conn.response.cancel() + return if isinstance(event, RealtimeServerEventSessionCreated): # The persisted conversation id (only present when conversation # persistence is enabled) is set here, not on response.done. diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py index c905b7650cba..710158b0740b 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py @@ -184,6 +184,9 @@ async def pump() -> None: await asyncio.wait_for(pump(), timeout=_RESPONSE_TIMEOUT) except asyncio.TimeoutError: print("Timed out waiting for the agent's reply.") + # The server-side response is still active even though we stopped waiting + # locally; cancel it so the next turn's response.create() isn't rejected. + await conn.response.cancel() except (KeyboardInterrupt, asyncio.CancelledError): print("\n(ending session...)") finally: diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_with_tools.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_with_tools.py index 7c507bbda0fd..598c465d23d5 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_with_tools.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_with_tools.py @@ -40,9 +40,9 @@ from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( RealtimeAudioFormatsAudioPcm, - RealtimeFunctionTool, ToolType, VoiceAgentDefinition, + VoiceAgentFunctionTool, VoiceAgentMcpTool, VoiceAgentAudioConfig, VoiceAgentAudioInputConfig, @@ -70,8 +70,7 @@ # A client-executed tool: the service forwards the function call to your app, # and your app returns the result over the live session. -get_weather = RealtimeFunctionTool( - type="function", +get_weather = VoiceAgentFunctionTool( name="get_weather", description="Get the current weather for a city.", parameters=cast( @@ -124,7 +123,7 @@ output_modalities=[VoiceOutputModality.AUDIO], # Attach the self-contained tools. `_example_mcp_tool` and `_example_toolbox_tool` # reference external resources you must own, so they are left out here. - tools=[get_weather, end_call], # type: ignore[list-item] + tools=[get_weather, end_call], store=True, ) 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 new file mode 100644 index 000000000000..d691644701a9 --- /dev/null +++ b/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client.py @@ -0,0 +1,276 @@ +# pylint: disable=too-many-lines,line-too-long,useless-suppression,protected-access +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +# cSpell:disable +"""Transport-mocked unit tests for the hand-written sync realtime (WebSocket) client. + +Unlike ``test_voice_agent_crud.py``, these tests never make an HTTP/WS call: the underlying +``websockets.sync.client.connect`` is replaced with a fake so URL construction, header/auth +handling, event serialization/deserialization, connection cleanup, and dependency/error paths +can all be verified without a live service or a recorded transport. +""" + +import json +from unittest.mock import MagicMock, patch + +import pytest +from azure.core.credentials import AccessToken + +from azure.ai.projects._realtime import ( + RealtimeConnectionManager, + _assert_trusted_connection_url, + _to_ws_url, +) +from azure.ai.projects.models import ( + RealtimeClientEventResponseCreate, + RealtimeServerEventError, + RealtimeServerEventSessionCreated, +) + +_ENDPOINT = "https://my-account.services.ai.azure.com/api/projects/my-project" + + +class _FakeCredential: + """Sync stub credential that returns a never-expiring token.""" + + def __init__(self, token: str = "fake-token") -> None: + self._token = token + + def get_token(self, *args, **kwargs) -> AccessToken: # pylint: disable=unused-argument + return AccessToken(self._token, 9_999_999_999) + + +def _make_manager(**overrides) -> RealtimeConnectionManager: + kwargs = { + "endpoint": _ENDPOINT, + "credential": _FakeCredential(), + "credential_scopes": ["https://ai.azure.com/.default"], + "api_version": "v1", + "agent_name": "my-agent", + "foundry_features": "VoiceAgents=V1Preview", + } + kwargs.update(overrides) + return RealtimeConnectionManager(**kwargs) + + +class TestToWsUrl: + """Unit tests for the pure ``_to_ws_url`` URL-construction helper.""" + + def test_https_endpoint_becomes_wss(self): + url = _to_ws_url(_ENDPOINT, "my-agent") + assert url == "wss://my-account.services.ai.azure.com/api/projects/my-project/agents/my-agent/endpoint/protocols/voice" + + def test_http_endpoint_becomes_ws(self): + url = _to_ws_url("http://localhost:8080", "my-agent") + assert url == "ws://localhost:8080/agents/my-agent/endpoint/protocols/voice" + + def test_trailing_slash_is_stripped(self): + url = _to_ws_url(_ENDPOINT + "/", "my-agent") + assert url == "wss://my-account.services.ai.azure.com/api/projects/my-project/agents/my-agent/endpoint/protocols/voice" + + +class TestAssertTrustedConnectionUrl: + """Unit tests for the connection_url host allow-list guard (security fix).""" + + def test_matching_host_does_not_raise(self): + _assert_trusted_connection_url(f"wss://{'my-account.services.ai.azure.com'}/custom/path", _ENDPOINT) + + def test_mismatched_host_raises_value_error(self): + with pytest.raises(ValueError): + _assert_trusted_connection_url("wss://evil.example.com/steal-token", _ENDPOINT) + + def test_empty_host_raises_value_error(self): + with pytest.raises(ValueError): + _assert_trusted_connection_url("not-a-url", _ENDPOINT) + + +class TestRealtimeConnectionManagerEnter: + """Unit tests for ``RealtimeConnectionManager.enter()``: URL/header construction and errors.""" + + def test_enter_builds_bearer_auth_and_query(self): + fake_connection = MagicMock() + with patch("websockets.sync.client.connect", return_value=fake_connection) as mock_connect: + manager = _make_manager() + conn = manager.enter() + try: + assert conn is not None + finally: + manager.__exit__() + + assert mock_connect.call_count == 1 + _args, kwargs = mock_connect.call_args + called_url = _args[0] + assert called_url.startswith("wss://my-account.services.ai.azure.com") + assert "api-version=v1" in called_url + assert kwargs["additional_headers"]["Authorization"] == "Bearer fake-token" + assert kwargs["additional_headers"]["Foundry-Features"] == "VoiceAgents=V1Preview" + + def test_enter_appends_extra_query_and_headers(self): + fake_connection = MagicMock() + with patch("websockets.sync.client.connect", return_value=fake_connection) as mock_connect: + manager = _make_manager(extra_query={"foo": "bar"}, extra_headers={"X-Custom": "1"}) + manager.enter() + manager.__exit__() + + _args, kwargs = mock_connect.call_args + assert "foo=bar" in _args[0] + assert kwargs["additional_headers"]["X-Custom"] == "1" + + def test_enter_preserves_existing_query_on_connection_url_override(self): + # Regression test: the URL builder used to unconditionally append "?", corrupting an + # override URL that already has a query string (e.g. a SAS-style "?sig=..."). + fake_connection = MagicMock() + override = f"wss://{'my-account.services.ai.azure.com'}/custom?sig=abc" + with patch("websockets.sync.client.connect", return_value=fake_connection) as mock_connect: + manager = _make_manager(connection_url=override) + manager.enter() + manager.__exit__() + + called_url = mock_connect.call_args[0][0] + assert called_url.count("?") == 1 + assert "sig=abc&api-version=v1" in called_url + + def test_enter_rejects_untrusted_connection_url_host(self): + manager = _make_manager(connection_url="wss://evil.example.com/steal-token") + with pytest.raises(ValueError): + manager.enter() + + def test_enter_rejects_non_wss_url(self): + # A plain http(s) endpoint that somehow produced a non-ws(s) URL should never proceed. + manager = _make_manager(endpoint="ftp://not-http-or-https") + with pytest.raises(ValueError): + manager.enter() + + def test_enter_raises_runtime_error_when_websockets_missing(self): + manager = _make_manager() + with patch.dict("sys.modules", {"websockets.sync.client": None, "websockets.typing": None}): + with pytest.raises(RuntimeError, match="websockets"): + manager.enter() + + def test_context_manager_closes_connection_on_exit(self): + fake_connection = MagicMock() + with patch("websockets.sync.client.connect", return_value=fake_connection): + with _make_manager() as conn: + pass + fake_connection.close.assert_called_once() + + +class TestRealtimeConnectionRecv: + """Unit tests for ``RealtimeConnection.recv()``: event dispatch and error/timeout handling.""" + + def test_recv_dispatches_known_event_type(self, request): + fake_connection = MagicMock() + with patch("websockets.sync.client.connect", return_value=fake_connection): + manager = _make_manager() + conn = manager.enter() + request.addfinalizer(manager.__exit__) + + fake_connection.recv.return_value = json.dumps({"type": "session.created", "session": {}}) + event = conn.recv() + assert isinstance(event, RealtimeServerEventSessionCreated) + + def test_recv_unknown_event_type_returns_dict(self, request): + fake_connection = MagicMock() + with patch("websockets.sync.client.connect", return_value=fake_connection): + manager = _make_manager() + conn = manager.enter() + request.addfinalizer(manager.__exit__) + + fake_connection.recv.return_value = json.dumps({"type": "some.new.event", "foo": "bar"}) + event = conn.recv() + assert isinstance(event, dict) + assert event["foo"] == "bar" + + def test_recv_forwards_timeout_to_underlying_connection(self, request): + fake_connection = MagicMock() + with patch("websockets.sync.client.connect", return_value=fake_connection): + manager = _make_manager() + conn = manager.enter() + request.addfinalizer(manager.__exit__) + + fake_connection.recv.return_value = json.dumps({"type": "error", "error": {"message": "boom"}}) + conn.recv(timeout=5.0) + fake_connection.recv.assert_called_once_with(timeout=5.0) + + def test_recv_timeout_error_propagates(self, request): + fake_connection = MagicMock() + with patch("websockets.sync.client.connect", return_value=fake_connection): + manager = _make_manager() + conn = manager.enter() + request.addfinalizer(manager.__exit__) + + fake_connection.recv.side_effect = TimeoutError() + with pytest.raises(TimeoutError): + conn.recv(timeout=0.1) + + def test_recv_connection_closed_raises_connection_reset_error(self, request): + from websockets.exceptions import ConnectionClosedOK + + fake_connection = MagicMock() + with patch("websockets.sync.client.connect", return_value=fake_connection): + manager = _make_manager() + conn = manager.enter() + request.addfinalizer(manager.__exit__) + + fake_connection.recv.side_effect = ConnectionClosedOK(None, None) + with pytest.raises(ConnectionResetError): + conn.recv() + + def test_iteration_stops_cleanly_on_connection_reset(self, request): + fake_connection = MagicMock() + with patch("websockets.sync.client.connect", return_value=fake_connection): + manager = _make_manager() + conn = manager.enter() + request.addfinalizer(manager.__exit__) + + fake_connection.recv.side_effect = ConnectionResetError() + assert list(conn) == [] + + +class TestRealtimeConnectionSend: + """Unit tests for ``RealtimeConnection.send()``: model/str/mapping serialization.""" + + def test_send_serializes_typed_model(self, request): + fake_connection = MagicMock() + with patch("websockets.sync.client.connect", return_value=fake_connection): + manager = _make_manager() + conn = manager.enter() + request.addfinalizer(manager.__exit__) + + conn.send(RealtimeClientEventResponseCreate()) + sent_raw = fake_connection.send.call_args[0][0] + payload = json.loads(sent_raw) + assert payload["type"] == "response.create" + + def test_send_passes_through_valid_json_string(self, request): + fake_connection = MagicMock() + with patch("websockets.sync.client.connect", return_value=fake_connection): + manager = _make_manager() + conn = manager.enter() + request.addfinalizer(manager.__exit__) + + conn.send('{"type": "response.create"}') + fake_connection.send.assert_called_once_with('{"type": "response.create"}') + + def test_send_rejects_invalid_json_string(self, request): + fake_connection = MagicMock() + with patch("websockets.sync.client.connect", return_value=fake_connection): + manager = _make_manager() + conn = manager.enter() + request.addfinalizer(manager.__exit__) + + with pytest.raises(ValueError): + conn.send("not valid json") + + def test_send_serializes_mapping(self, request): + fake_connection = MagicMock() + with patch("websockets.sync.client.connect", return_value=fake_connection): + manager = _make_manager() + conn = manager.enter() + request.addfinalizer(manager.__exit__) + + conn.send({"type": "response.cancel"}) + sent_raw = fake_connection.send.call_args[0][0] + assert json.loads(sent_raw) == {"type": "response.cancel"} diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client_async.py b/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client_async.py new file mode 100644 index 000000000000..5ae0fc840d74 --- /dev/null +++ b/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client_async.py @@ -0,0 +1,268 @@ +# pylint: disable=too-many-lines,line-too-long,useless-suppression,protected-access +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +# cSpell:disable +"""Transport-mocked unit tests for the hand-written async realtime (WebSocket) client. + +Async counterpart of ``test_realtime_client.py``. The underlying ``aiohttp.ClientSession`` is +replaced with a fake so URL construction, header/auth handling, event serialization/ +deserialization, connection cleanup, and dependency/error paths can all be verified without a +live service or a recorded transport. +""" + +import json +from unittest.mock import AsyncMock, MagicMock, patch + +import pytest +from azure.core.credentials import AccessToken + +from azure.ai.projects.aio._realtime import AsyncRealtimeConnectionManager +from azure.ai.projects.models import ( + RealtimeClientEventResponseCreate, + RealtimeServerEventSessionCreated, +) + +_ENDPOINT = "https://my-account.services.ai.azure.com/api/projects/my-project" + +pytestmark = pytest.mark.asyncio + + +class _AsyncFakeCredential: + """Async stub credential that returns a never-expiring token.""" + + def __init__(self, token: str = "fake-token") -> None: + self._token = token + + async def get_token(self, *args, **kwargs) -> AccessToken: # pylint: disable=unused-argument + return AccessToken(self._token, 9_999_999_999) + + +def _make_manager(**overrides) -> AsyncRealtimeConnectionManager: + kwargs = { + "endpoint": _ENDPOINT, + "credential": _AsyncFakeCredential(), + "credential_scopes": ["https://ai.azure.com/.default"], + "api_version": "v1", + "agent_name": "my-agent", + "foundry_features": "VoiceAgents=V1Preview", + } + kwargs.update(overrides) + return AsyncRealtimeConnectionManager(**kwargs) + + +def _make_fake_msg(msg_type, data=None): + msg = MagicMock() + msg.type = msg_type + msg.data = data + return msg + + +def _make_fake_ws(): + """A fake aiohttp ClientWebSocketResponse with async close() (always awaited by __aexit__).""" + fake_ws = MagicMock() + fake_ws.close = AsyncMock() + return fake_ws + + +def _patch_client_session(fake_ws_connection): + """Patch aiohttp.ClientSession() to return a fake session whose ws_connect/close are async.""" + fake_session = MagicMock() + fake_session.ws_connect = AsyncMock(return_value=fake_ws_connection) + fake_session.close = AsyncMock() + return patch("aiohttp.ClientSession", return_value=fake_session), fake_session + + +class TestAsyncRealtimeConnectionManagerEnter: + """Unit tests for ``AsyncRealtimeConnectionManager.enter()``: URL/header construction and errors.""" + + async def test_enter_builds_bearer_auth_and_query(self): + fake_ws = _make_fake_ws() + patcher, fake_session = _patch_client_session(fake_ws) + with patcher: + manager = _make_manager() + await manager.enter() + await manager.__aexit__() + + assert fake_session.ws_connect.call_count == 1 + _args, kwargs = fake_session.ws_connect.call_args + assert _args[0].startswith("wss://my-account.services.ai.azure.com") + assert kwargs["params"]["api-version"] == "v1" + assert kwargs["headers"]["Authorization"] == "Bearer fake-token" + assert kwargs["headers"]["Foundry-Features"] == "VoiceAgents=V1Preview" + assert kwargs["headers"]["Sec-WebSocket-Protocol"] == "realtime" + + async def test_enter_rejects_untrusted_connection_url_host(self): + manager = _make_manager(connection_url="wss://evil.example.com/steal-token") + with pytest.raises(ValueError): + await manager.enter() + + async def test_enter_rejects_non_wss_url(self): + manager = _make_manager(endpoint="ftp://not-http-or-https") + with pytest.raises(ValueError): + await manager.enter() + + async def test_enter_raises_runtime_error_when_aiohttp_missing(self): + manager = _make_manager() + with patch.dict("sys.modules", {"aiohttp": None}): + with pytest.raises(RuntimeError, match="aiohttp"): + await manager.enter() + + async def test_enter_closes_session_on_connect_failure(self): + fake_session = MagicMock() + fake_session.ws_connect = AsyncMock(side_effect=OSError("connection refused")) + fake_session.close = AsyncMock() + with patch("aiohttp.ClientSession", return_value=fake_session): + manager = _make_manager() + with pytest.raises(ConnectionError): + await manager.enter() + fake_session.close.assert_awaited_once() + + async def test_context_manager_closes_connection_on_exit(self): + fake_ws = _make_fake_ws() + patcher, fake_session = _patch_client_session(fake_ws) + with patcher: + async with _make_manager(): + pass + fake_ws.close.assert_awaited_once() + fake_session.close.assert_awaited_once() + + +class TestAsyncRealtimeConnectionRecv: + """Unit tests for ``AsyncRealtimeConnection.recv()``: event dispatch and non-text frames.""" + + async def test_recv_dispatches_known_event_type(self): + import aiohttp + + fake_ws = _make_fake_ws() + fake_ws.receive = AsyncMock( + return_value=_make_fake_msg(aiohttp.WSMsgType.TEXT, json.dumps({"type": "session.created", "session": {}})) + ) + patcher, _ = _patch_client_session(fake_ws) + with patcher: + manager = _make_manager() + conn = await manager.enter() + try: + event = await conn.recv() + assert isinstance(event, RealtimeServerEventSessionCreated) + finally: + await manager.__aexit__() + + async def test_recv_skips_ping_pong_frames(self): + # Regression test locking in the existing PING/PONG handling. + import aiohttp + + fake_ws = _make_fake_ws() + fake_ws.receive = AsyncMock( + side_effect=[ + _make_fake_msg(aiohttp.WSMsgType.PING, b""), + _make_fake_msg(aiohttp.WSMsgType.PONG, b""), + _make_fake_msg(aiohttp.WSMsgType.TEXT, json.dumps({"type": "session.created", "session": {}})), + ] + ) + patcher, _ = _patch_client_session(fake_ws) + with patcher: + manager = _make_manager() + conn = await manager.enter() + try: + event = await conn.recv() + assert isinstance(event, RealtimeServerEventSessionCreated) + assert fake_ws.receive.await_count == 3 + finally: + await manager.__aexit__() + + async def test_recv_unknown_event_type_returns_dict(self): + import aiohttp + + fake_ws = _make_fake_ws() + fake_ws.receive = AsyncMock( + return_value=_make_fake_msg(aiohttp.WSMsgType.TEXT, json.dumps({"type": "some.new.event", "foo": "bar"})) + ) + patcher, _ = _patch_client_session(fake_ws) + with patcher: + manager = _make_manager() + conn = await manager.enter() + try: + event = await conn.recv() + assert isinstance(event, dict) + assert event["foo"] == "bar" + finally: + await manager.__aexit__() + + async def test_recv_close_frame_raises_connection_reset_error(self): + import aiohttp + + fake_ws = _make_fake_ws() + fake_ws.receive = AsyncMock(return_value=_make_fake_msg(aiohttp.WSMsgType.CLOSE)) + patcher, _ = _patch_client_session(fake_ws) + with patcher: + manager = _make_manager() + conn = await manager.enter() + try: + with pytest.raises(ConnectionResetError): + await conn.recv() + finally: + await manager.__aexit__() + + async def test_recv_error_frame_raises_connection_reset_error(self): + import aiohttp + + fake_ws = _make_fake_ws() + fake_ws.exception = MagicMock(return_value=RuntimeError("boom")) + fake_ws.receive = AsyncMock(return_value=_make_fake_msg(aiohttp.WSMsgType.ERROR)) + patcher, _ = _patch_client_session(fake_ws) + with patcher: + manager = _make_manager() + conn = await manager.enter() + try: + with pytest.raises(ConnectionResetError): + await conn.recv() + finally: + await manager.__aexit__() + + +class TestAsyncRealtimeConnectionSend: + """Unit tests for ``AsyncRealtimeConnection.send()``: model/str/mapping serialization.""" + + async def test_send_serializes_typed_model(self): + fake_ws = _make_fake_ws() + fake_ws.send_str = AsyncMock() + patcher, _ = _patch_client_session(fake_ws) + with patcher: + manager = _make_manager() + conn = await manager.enter() + try: + await conn.send(RealtimeClientEventResponseCreate()) + sent_raw = fake_ws.send_str.call_args[0][0] + payload = json.loads(sent_raw) + assert payload["type"] == "response.create" + finally: + await manager.__aexit__() + + async def test_send_rejects_invalid_json_string(self): + fake_ws = _make_fake_ws() + fake_ws.send_str = AsyncMock() + patcher, _ = _patch_client_session(fake_ws) + with patcher: + manager = _make_manager() + conn = await manager.enter() + try: + with pytest.raises(ValueError): + await conn.send("not valid json") + finally: + await manager.__aexit__() + + async def test_send_serializes_mapping(self): + fake_ws = _make_fake_ws() + fake_ws.send_str = AsyncMock() + patcher, _ = _patch_client_session(fake_ws) + with patcher: + manager = _make_manager() + conn = await manager.enter() + try: + await conn.send({"type": "response.cancel"}) + sent_raw = fake_ws.send_str.call_args[0][0] + assert json.loads(sent_raw) == {"type": "response.cancel"} + finally: + await manager.__aexit__() diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud.py b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud.py index ec65e24f9b76..594b4aade8d0 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud.py @@ -9,7 +9,9 @@ from devtools_testutils import recorded_by_proxy, RecordedTransport from azure.ai.projects.models import ( AgentDetails, + AgentKind, AgentVersionDetails, + GenerateVoiceAgentRequest, VoiceAgentDefinition, VoiceAgentAudioConfig, VoiceAgentAudioOutputConfig, @@ -30,10 +32,6 @@ class TestVoiceAgentCrud(TestBase): This is also not practical to cover with HTTP-only recorded tests since it requires an actual WebSocket session. Once these are fixed service-side, tests can be added for them. - - `agents.generate_agent(GenerateVoiceAgentRequest(kind="voice", name=...))` was previously - blocked by a service-side bug (missing required `name`); that has since been fixed upstream, - but no recorded test has been added for it yet. """ # To run only this test: @@ -169,3 +167,33 @@ def test_voice_agent_disable_enable(self, **kwargs): # Delete the voice agent. result = project_client.agents.delete(agent_name=agent_name) assert result.deleted + + # To run only this test: + # pytest tests\agents\test_voice_agent_crud.py::TestVoiceAgentCrud::test_generate_agent -s + @servicePreparer() + @recorded_by_proxy() + def test_generate_agent(self, **kwargs): + """ + Test guided authoring for a voice Agent via `agents.generate_agent()`. + + Routes used in this test: + + Action REST API Route Client Method + ------+----------------------------+----------------------------------- + POST /agents:generate project_client.agents.generate_agent() + DELETE /agents/{agent_name} project_client.agents.delete() + """ + print("\n") + project_client = self.create_client(operation_group="agents", allow_preview=True, **kwargs) + agent_name = "VoiceAgentGenerateTest" + + agent: AgentDetails = project_client.agents.generate_agent( + GenerateVoiceAgentRequest(kind=AgentKind.VOICE, name=agent_name) + ) + self._validate_agent(agent, expected_name=agent_name) + assert agent.versions.latest.definition.kind == "voice" # type: ignore[attr-defined] + assert agent.versions.latest.definition.instructions # type: ignore[attr-defined] + + # Delete the voice agent. + result = project_client.agents.delete(agent_name=agent_name) + assert result.deleted diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud_async.py b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud_async.py index 94720cdf133d..0006dfd81b89 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud_async.py @@ -10,7 +10,9 @@ from devtools_testutils import RecordedTransport from azure.ai.projects.models import ( AgentDetails, + AgentKind, AgentVersionDetails, + GenerateVoiceAgentRequest, VoiceAgentDefinition, VoiceAgentAudioConfig, VoiceAgentAudioOutputConfig, @@ -31,10 +33,6 @@ class TestVoiceAgentCrudAsync(TestBase): This is also not practical to cover with HTTP-only recorded tests since it requires an actual WebSocket session. Once these are fixed service-side, tests can be added for them. - - `agents.generate_agent(GenerateVoiceAgentRequest(kind="voice", name=...))` was previously - blocked by a service-side bug (missing required `name`); that has since been fixed upstream, - but no recorded test has been added for it yet. """ # To run only this test: @@ -174,3 +172,34 @@ async def test_voice_agent_disable_enable_async(self, **kwargs): # Delete the voice agent. result = await project_client.agents.delete(agent_name=agent_name) assert result.deleted + + # To run only this test: + # pytest tests\agents\test_voice_agent_crud_async.py::TestVoiceAgentCrudAsync::test_generate_agent_async -s + @servicePreparer() + @recorded_by_proxy_async() + async def test_generate_agent_async(self, **kwargs): + """ + Test guided authoring for a voice Agent via `agents.generate_agent()`. + + Routes used in this test: + + Action REST API Route Client Method + ------+----------------------------+----------------------------------- + POST /agents:generate project_client.agents.generate_agent() + DELETE /agents/{agent_name} project_client.agents.delete() + """ + print("\n") + project_client = self.create_async_client(operation_group="agents", allow_preview=True, **kwargs) + agent_name = "VoiceAgentGenerateTestAsync" + + async with project_client: + agent: AgentDetails = await project_client.agents.generate_agent( + GenerateVoiceAgentRequest(kind=AgentKind.VOICE, name=agent_name) + ) + self._validate_agent(agent, expected_name=agent_name) + assert agent.versions.latest.definition.kind == "voice" # type: ignore[attr-defined] + assert agent.versions.latest.definition.instructions # type: ignore[attr-defined] + + # Delete the voice agent. + result = await project_client.agents.delete(agent_name=agent_name) + assert result.deleted From 48bafa6e5dd77f1d2f1cda0fbde502dff34eca88 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Wed, 2 Sep 2026 17:08:30 -0700 Subject: [PATCH 44/56] Regenerate azure-ai-projects from TypeSpec commit 1070c74a, add telephony/WebRTC/sub-agent voice features, fix missing preview-header wiring - Regenerate SDK from azure-rest-api-specs commit 1070c74ae519b6f86540bbd44ea295ff12642e60; update tsp-location.yaml.saved accordingly. - New voice-agent features from this commit (purely additive, no removed/renamed classes): - Telephony bindings for Teams Phone/Twilio on gents.* (create/list/get/update/delete binding, list/get/transfer/end call, get/replace transfer targets - 11 new methods). - Optional WebRTC transport for realtime sessions (VoiceAgentTransport.WEBRTC) with SDP signaling events. - New top-level gent_endpoint_conversations operation group (generated-audio reads), distinct from the unchanged eta.agent_endpoint_conversations. - Sub-agent consultation (VoiceAgentDefinition.subagent_config) and conversation_engine delegation to a hosted agent. - list_memories() unbound-variable bug fixed upstream: verified the fix, removed the now-obsolete PostEmitter.ps1 fixup (kept an explanatory comment for future regression detection). - Fixed a real functional bug: the new telephony and agent_endpoint_conversations methods require the Foundry-Features: VoiceAgents=V1Preview opt-in header per TypeSpec, but had no header-injection wiring (would fail with preview_feature_required). Added header injection (gated on llow_preview, matching the existing generate_agent pattern) via 11 new method overrides in _patch_agents.py/_patch_agents_async.py and new _patch_agent_endpoint_conversations.py/_async.py files for the 2 new conversation methods. Also fixed a generator bug where replace_telephony_transfer_targets's 2nd/3rd @overload signatures had etag/match_condition types swapped. - Registered 6 new realtime event types (1 client + 5 server, for RTC signaling and sub-agent consultation) in _realtime.py/aio/_realtime.py. - Added 13 new unit tests in tests/foundry_features_header/ covering the header-injection fix for all new methods. - Added tests/agents/test_voice_agent_telephony.py/_async.py (6 methods) covering telephony bindings/calls/transfer-targets and generated-audio not-found paths. Currently skipped: the telephony routes are defined in TypeSpec but not yet deployed on the live test service (confirmed via empty-body 404s vs a real app-level 404's full JSON error body), and the generated-audio not-found path hits the same pre-existing conversation-ID validation quirk as the already-documented beta.agent_endpoint_conversations limitation. - Updated docs/public-methods.md (170->183 methods) and CHANGELOG.md. - Regenerated api.md/api.metadata.yml. - Validated: full test suite (1026 passed, 111 skipped, 0 failed) run fresh in one pass, plus live e2e validation of 10 of 11 voice-agent samples against the real service, including both live-streaming samples (text conversation sync+async, function tool) which exercise realtime WebSocket sessions, tool-calling, and conversation persistence/readback end-to-end. Confirmed the regeneration is reproducible by re-running tsp-client update + PostEmitter.ps1 from scratch and diffing against the working tree (identical result). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- sdk/ai/azure-ai-projects/CHANGELOG.md | 6 + sdk/ai/azure-ai-projects/PostEmitter.ps1 | 88 +- sdk/ai/azure-ai-projects/api.md | 16708 +++++++++------- sdk/ai/azure-ai-projects/api.metadata.yml | 2 +- .../azure-ai-projects/apiview-properties.json | 76 +- .../azure/ai/projects/_client.py | 7 + .../azure/ai/projects/_realtime.py | 11 + .../azure/ai/projects/_utils/utils.py | 33 + .../azure/ai/projects/aio/_client.py | 7 + .../azure/ai/projects/aio/_realtime.py | 11 + .../ai/projects/aio/operations/__init__.py | 2 + .../ai/projects/aio/operations/_operations.py | 1543 +- .../ai/projects/aio/operations/_patch.py | 2 + ...atch_agent_endpoint_conversations_async.py | 142 + .../aio/operations/_patch_agents_async.py | 924 +- .../azure/ai/projects/models/__init__.py | 96 + .../azure/ai/projects/models/_enums.py | 218 + .../azure/ai/projects/models/_models.py | 2350 ++- .../azure/ai/projects/operations/__init__.py | 2 + .../ai/projects/operations/_operations.py | 3428 +++- .../azure/ai/projects/operations/_patch.py | 2 + .../_patch_agent_endpoint_conversations.py | 140 + .../ai/projects/operations/_patch_agents.py | 923 +- .../azure-ai-projects/docs/public-methods.md | 21 +- .../tests/agents/test_realtime_client.py | 10 +- .../agents/test_voice_agent_telephony.py | 309 + .../test_voice_agent_telephony_async.py | 312 + .../foundry_features_header_test_base.py | 65 +- .../azure-ai-projects/tsp-location.yaml.saved | 2 +- 29 files changed, 19127 insertions(+), 8313 deletions(-) create mode 100644 sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agent_endpoint_conversations_async.py create mode 100644 sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agent_endpoint_conversations.py create mode 100644 sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_telephony.py create mode 100644 sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_telephony_async.py diff --git a/sdk/ai/azure-ai-projects/CHANGELOG.md b/sdk/ai/azure-ai-projects/CHANGELOG.md index 5f6f42a19fbb..c3d4e51956ef 100644 --- a/sdk/ai/azure-ai-projects/CHANGELOG.md +++ b/sdk/ai/azure-ai-projects/CHANGELOG.md @@ -11,6 +11,12 @@ * Added the `beta.agent_endpoint_conversations` operation group for reading back persisted voice-agent conversation transcripts and audio, for agents created with `store=True`. * Added the underlying `RealtimeConversationItem*`, `RealtimeMCP*`, `RealtimeResponseUsage`, and related realtime event/session models used by the voice agent WebSocket protocol. * Added 11 new samples under `samples/agents/voice/`, covering basic agent lifecycle, guided generation, live audio and text conversations (sync and async), function tools, versioning, and reading back conversation transcripts and audio. +* Extended voice agents with telephony, WebRTC, and sub-agent consultation: + * Added telephony bindings so a voice agent can receive calls through Teams Phone or Twilio. `project_client.agents.create_telephony_binding`/`get_telephony_binding`/`update_telephony_binding`/`delete_telephony_binding`/`list_telephony_bindings` manage the binding (`TelephonyBinding` and its `TeamsPhoneExtensionTelephonyBinding`/`TwilioTelephonyBinding` variants), and `list_telephony_calls`/`get_telephony_call`/`transfer_telephony_call`/`end_telephony_call`/`get_telephony_transfer_targets`/`replace_telephony_transfer_targets` manage in-progress and historical calls (`TelephonyCallRecord`, `TelephonyCallSummary`, `TelephonyCallTrace`, `TelephonyTransferTarget` and its `PSTNTelephonyTransferDestination`/`SipTelephonyTransferDestination`/`TeamsTelephonyTransferDestination` variants). + * Added an optional WebRTC transport for realtime voice sessions (`VoiceAgentTransport.WEBRTC`), where only SDP signaling travels over the WebSocket connection while media flows peer-to-peer. The new `VoiceAgentClientEventRtcCallSdpCreate`, `VoiceAgentServerEventRtcCallSdpCreated`, and `VoiceAgentServerEventRtcCallError` events carry the signaling exchange. + * Added the `agent_endpoint_conversations.get_agent_conversation_item_generated_audio`/`get_agent_conversation_item_generated_audio_content` methods for reading back a conversation item's *generated* audio, a subordinate artifact that can differ from what the listener heard when playback was interrupted, returning `VoiceGeneratedItemAudioResponse`. This is a new top-level operation group, distinct from `beta.agent_endpoint_conversations`. + * Added sub-agent consultation, letting a voice agent consult sibling Foundry text agents as background specialists mid-conversation, through the new `subagent_config` property on `VoiceAgentDefinition` (`VoiceAgentSubAgentConfig`, `VoiceAgentSubAgent`, `VoiceAgentSubagentResponsePolicy`), and the new `session.subagent.started`/`session.subagent.completed`/`session.subagent.aborted` realtime server events. + * Added an optional `conversation_engine` property on `VoiceAgentDefinition` (`VoiceConversationEngine`, `VoiceHostedAgentConversationEngine`) to delegate a voice agent's conversation handling to another hosted agent instead of configuring a model directly. * Added Microsoft 365 agent publishing: * `project_client.agents.publish_to_microsoft365(agent_name, publish_scope=...)` publishes a Foundry agent to Microsoft 365 / Microsoft Teams and returns a `Microsoft365PublishResult`. * `project_client.agents.get_microsoft365_publish_defaults(agent_name)` returns default and previously-published values (`Microsoft365PublishDefaults`) used to pre-populate a publish request. diff --git a/sdk/ai/azure-ai-projects/PostEmitter.ps1 b/sdk/ai/azure-ai-projects/PostEmitter.ps1 index 664a86d2be5b..d90bffaefecf 100644 --- a/sdk/ai/azure-ai-projects/PostEmitter.ps1 +++ b/sdk/ai/azure-ai-projects/PostEmitter.ps1 @@ -288,83 +288,17 @@ $c = $c.Replace( ) Set-Content $f $c -NoNewline -# A block of code in the implementation of "list_memories", in both sync -# and async _operations.py files, needs to be moved up. It's emitted in the wrong place, -# in the inline function named "prepare_request". Instead it should be moved up into the -# main body of the "list_memories" method, right after the line `error_map.update(kwargs.pop("error_map", {}) or {})`. -# If you don't do this, the PR pipeline will show failures in Pyright (`error: "body" is unbound (reportUnboundVariable)`) -# and some tests will fail. This is the block of code that needs to move up: -# if body is _Unset: -# if scope is _Unset: -# raise TypeError("missing required argument: scope") -# body = {"scope": scope} -# body = {k: v for k, v in body.items() if v is not None} -# The block inside prepare_request has 12-space indentation; after moving to the main function body it needs 8-space indentation. -# Strategy: Find the last list_memories method, then do a targeted string replacement that moves the block right after error_map.update. -$oldPattern = @" - error_map.update(kwargs.pop("error_map", {}) or {}) - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - def prepare_request(_continuation_token=None): - if body is _Unset: - if scope is _Unset: - raise TypeError("missing required argument: scope") - body = {"scope": scope} - body = {k: v for k, v in body.items() if v is not None} - - _request = build_beta_memory_stores_list_memories_request( -"@ -$newPattern = @" - error_map.update(kwargs.pop("error_map", {}) or {}) - if body is _Unset: - if scope is _Unset: - raise TypeError("missing required argument: scope") - body = {"scope": scope} - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - def prepare_request(_continuation_token=None): - _request = build_beta_memory_stores_list_memories_request( -"@ -$files = 'azure\ai\projects\operations\_operations.py', 'azure\ai\projects\aio\operations\_operations.py' -foreach ($f in $files) { - $c = Get-Content $f -Raw - # Find all occurrences of "def list_memories(" and get the index of the last one - $methodMatches = [regex]::Matches($c, 'def list_memories\(') - if ($methodMatches.Count -eq 0) { - throw "PostEmitter.ps1: expected to find at least one 'def list_memories(' in $f, but found none. The emitter output has likely changed shape; update this fixup instead of silently skipping it (it exists to avoid an unbound-'body' pyright/runtime failure)." - } - $lastMethodStart = $methodMatches[$methodMatches.Count - 1].Index - - # Find the pattern to replace - first occurrence after the last list_memories method - $patternEscaped = [regex]::Escape($oldPattern) - $patternMatches = [regex]::Matches($c, $patternEscaped) - $matchToReplace = $null - foreach ($m in $patternMatches) { - if ($m.Index -gt $lastMethodStart) { - $matchToReplace = $m - break - } - } - if ($matchToReplace -eq $null) { - throw "PostEmitter.ps1: expected list_memories() body in $f to match the known emitter shape (the unbound-'body'-in-prepare_request pattern), but no match was found after the last 'def list_memories(' occurrence. The emitter output has likely changed shape; update `$oldPattern/`$newPattern instead of silently skipping this fixup, otherwise the regenerated package would ship with the unbound-variable bug this fixup exists to prevent." - } - - # Replace only that specific occurrence - $c = $c.Substring(0, $matchToReplace.Index) + $newPattern + $c.Substring($matchToReplace.Index + $matchToReplace.Length) - - Set-Content $f $c -NoNewline -} +# NOTE: a block of code in the implementation of "list_memories", in both sync and async +# _operations.py files, used to be emitted in the wrong place (inside the nested +# "prepare_request" function instead of the main method body, right after +# `error_map.update(kwargs.pop("error_map", {}) or {})`), causing a Pyright +# `reportUnboundVariable` failure and test failures. As of TypeSpec commit +# 1070c74ae519b6f86540bbd44ea295ff12642e60, the emitter now produces the correct shape +# directly (verified: `if body is _Unset: ...` appears in the main method body, before +# `def prepare_request(...)`, in both sync and async list_memories() overloads). The fixup +# that used to correct this has been removed since it's no longer needed. If this +# regresses in a future TypeSpec update (Pyright reports "body" is unbound, or this fixup's +# safety check throws because the old broken pattern reappears), reinstate a fixup here. # GenerateAgentRequest is a single-member union in TypeSpec (only GenerateVoiceAgentRequest so diff --git a/sdk/ai/azure-ai-projects/api.md b/sdk/ai/azure-ai-projects/api.md index 29572a4b8f86..e40baa88a9fe 100644 --- a/sdk/ai/azure-ai-projects/api.md +++ b/sdk/ai/azure-ai-projects/api.md @@ -79,7 +79,11 @@ namespace azure.ai.projects reason: str = "" ) -> None: ... - def recv(self) -> ServerEvent: ... + def recv( + self, + *, + timeout: Optional[float] = ... + ) -> ServerEvent: ... def send(self, event: ClientEvent) -> None: ... @@ -221,6 +225,33 @@ namespace azure.ai.projects.aio namespace azure.ai.projects.aio.operations + class azure.ai.projects.aio.operations.AgentEndpointConversationsOperations(GeneratedAgentEndpointConversationsOperations): + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def get_agent_conversation_item_generated_audio( + self, + agent_name: str, + conversation_id: str, + item_id: str, + **kwargs: Any + ) -> VoiceGeneratedItemAudioResponse: ... + + @distributed_trace_async + async def get_agent_conversation_item_generated_audio_content( + self, + agent_name: str, + conversation_id: str, + item_id: str, + **kwargs: Any + ) -> AsyncIterator[bytes]: ... + + class azure.ai.projects.aio.operations.AgentsOperations(GeneratedAgentsOperations): def __init__( @@ -260,6 +291,36 @@ namespace azure.ai.projects.aio.operations **kwargs: Any ) -> AgentSessionResource: ... + @overload + async def create_telephony_binding( + self, + agent_name: str, + body: CreateTelephonyBindingRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> TelephonyBinding: ... + + @overload + async def create_telephony_binding( + self, + agent_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> TelephonyBinding: ... + + @overload + async def create_telephony_binding( + self, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> TelephonyBinding: ... + @overload async def create_version( self, @@ -368,6 +429,17 @@ namespace azure.ai.projects.aio.operations **kwargs: Any ) -> None: ... + @distributed_trace_async + async def delete_telephony_binding( + self, + agent_name: str, + binding_id: str, + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> None: ... + @distributed_trace_async async def delete_version( self, @@ -411,6 +483,14 @@ namespace azure.ai.projects.aio.operations **kwargs: Any ) -> None: ... + @distributed_trace_async + async def end_telephony_call( + self, + agent_name: str, + call_id: str, + **kwargs: Any + ) -> TelephonyCallRecord: ... + @distributed_trace_async async def generate_agent( self, @@ -496,6 +576,29 @@ namespace azure.ai.projects.aio.operations **kwargs: Any ) -> SessionLogEvent: ... + @distributed_trace_async + async def get_telephony_binding( + self, + agent_name: str, + binding_id: str, + **kwargs: Any + ) -> TelephonyBinding: ... + + @distributed_trace_async + async def get_telephony_call( + self, + agent_name: str, + call_id: str, + **kwargs: Any + ) -> TelephonyCallRecord: ... + + @distributed_trace_async + async def get_telephony_transfer_targets( + self, + agent_name: str, + **kwargs: Any + ) -> TelephonyTransferTargets: ... + @distributed_trace_async async def get_version( self, @@ -539,6 +642,34 @@ namespace azure.ai.projects.aio.operations **kwargs: Any ) -> AsyncItemPaged[AgentSessionResource]: ... + @distributed_trace + def list_telephony_bindings( + self, + agent_name: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + provider: Optional[Union[str, TelephonyProvider]] = ..., + status: Optional[Union[str, TelephonyBindingStatus]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[TelephonyBindingListItem]: ... + + @distributed_trace + def list_telephony_calls( + self, + agent_name: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + provider: Optional[Union[str, TelephonyProvider]] = ..., + started_after: Optional[datetime] = ..., + started_before: Optional[datetime] = ..., + status: Optional[Union[str, TelephonyCallStatus]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[TelephonyCallSummary]: ... + @distributed_trace def list_versions( self, @@ -596,6 +727,42 @@ namespace azure.ai.projects.aio.operations **kwargs: Any ) -> Microsoft365PublishResult: ... + @overload + async def replace_telephony_transfer_targets( + self, + agent_name: str, + *, + content_type: str = "application/json", + etag: str, + match_condition: MatchConditions, + transfer_targets: List[TelephonyTransferTarget], + **kwargs: Any + ) -> TelephonyTransferTargets: ... + + @overload + async def replace_telephony_transfer_targets( + self, + agent_name: str, + body: JSON, + *, + content_type: str = "application/json", + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> TelephonyTransferTargets: ... + + @overload + async def replace_telephony_transfer_targets( + self, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> TelephonyTransferTargets: ... + @distributed_trace_async async def stop_session( self, @@ -604,6 +771,39 @@ namespace azure.ai.projects.aio.operations **kwargs: Any ) -> None: ... + @overload + async def transfer_telephony_call( + self, + agent_name: str, + call_id: str, + *, + content_type: str = "application/json", + target: str, + **kwargs: Any + ) -> TelephonyCallRecord: ... + + @overload + async def transfer_telephony_call( + self, + agent_name: str, + call_id: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> TelephonyCallRecord: ... + + @overload + async def transfer_telephony_call( + self, + agent_name: str, + call_id: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> TelephonyCallRecord: ... + @overload async def update_details( self, @@ -635,6 +835,45 @@ namespace azure.ai.projects.aio.operations **kwargs: Any ) -> AgentDetails: ... + @overload + async def update_telephony_binding( + self, + agent_name: str, + binding_id: str, + body: UpdateTelephonyBindingRequest, + *, + content_type: str = "application/merge-patch+json", + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> TelephonyBinding: ... + + @overload + async def update_telephony_binding( + self, + agent_name: str, + binding_id: str, + body: JSON, + *, + content_type: str = "application/merge-patch+json", + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> TelephonyBinding: ... + + @overload + async def update_telephony_binding( + self, + agent_name: str, + binding_id: str, + body: IO[bytes], + *, + content_type: str = "application/merge-patch+json", + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> TelephonyBinding: ... + @overload async def upload_session_file( self, @@ -660,7 +899,7 @@ namespace azure.ai.projects.aio.operations ) -> SessionFileWriteResult: ... - class azure.ai.projects.aio.operations.BetaAgentsOperations(BetaAgentsOperationsGenerated): + class azure.ai.projects.aio.operations.BetaAgentEndpointConversationsOperations: def __init__( self, @@ -668,467 +907,481 @@ namespace azure.ai.projects.aio.operations **kwargs ) -> None: ... - @overload - async def begin_create_optimization_job( + @distributed_trace_async + async def delete_agent_conversation( self, - job: AgentOptimizationJob, - *, - content_type: str = "application/json", - operation_id: Optional[str] = ..., + agent_name: str, + conversation_id: str, **kwargs: Any - ) -> AsyncAgentOptimizationLROPoller: ... + ) -> None: ... - @overload - async def begin_create_optimization_job( + @distributed_trace_async + async def get_agent_conversation( self, - job: JSON, - *, - content_type: str = "application/json", - operation_id: Optional[str] = ..., + agent_name: str, + conversation_id: str, **kwargs: Any - ) -> AsyncAgentOptimizationLROPoller: ... + ) -> VoiceConversation: ... - @overload - async def begin_create_optimization_job( + @distributed_trace_async + async def get_agent_conversation_audio( self, - job: IO[bytes], - *, - content_type: str = "application/json", - operation_id: Optional[str] = ..., + agent_name: str, + conversation_id: str, **kwargs: Any - ) -> AsyncAgentOptimizationLROPoller: ... + ) -> VoiceRecordingResponse: ... @distributed_trace_async - async def cancel_optimization_job( + async def get_agent_conversation_audio_content( self, - job_id: str, + agent_name: str, + conversation_id: str, **kwargs: Any - ) -> AgentOptimizationJob: ... + ) -> AsyncIterator[bytes]: ... @distributed_trace_async - async def delete_optimization_job( + async def get_agent_conversation_item( self, - job_id: str, + agent_name: str, + conversation_id: str, + item_id: str, **kwargs: Any - ) -> None: ... + ) -> RealtimeConversationItem: ... @distributed_trace_async - async def get_optimization_job( + async def get_agent_conversation_item_audio( self, - job_id: str, + agent_name: str, + conversation_id: str, + item_id: str, **kwargs: Any - ) -> AgentOptimizationJob: ... + ) -> VoiceItemAudioResponse: ... + + @distributed_trace_async + async def get_agent_conversation_item_audio_content( + self, + agent_name: str, + conversation_id: str, + item_id: str, + **kwargs: Any + ) -> AsyncIterator[bytes]: ... + + @distributed_trace_async + async def get_agent_conversation_response( + self, + agent_name: str, + conversation_id: str, + response_id: str, + **kwargs: Any + ) -> VoiceResponse: ... @distributed_trace - def list_optimization_jobs( + def list_agent_conversation_items( self, + agent_name: str, + conversation_id: str, *, - agent_name: Optional[str] = ..., before: Optional[str] = ..., limit: Optional[int] = ..., order: Optional[Union[str, PageOrder]] = ..., - status: Optional[Union[str, JobStatus]] = ..., **kwargs: Any - ) -> AsyncItemPaged[AgentOptimizationJobListItem]: ... - - - class azure.ai.projects.aio.operations.BetaDatasetsOperations(BetaDatasetsOperationsGenerated): - - def __init__( - self, - *args, - **kwargs - ) -> None: ... + ) -> AsyncItemPaged[RealtimeConversationItem]: ... - @overload - async def begin_create_generation_job( + @distributed_trace + def list_agent_conversation_response_items( self, - job: DataGenerationJob, + agent_name: str, + conversation_id: str, + response_id: str, *, - content_type: str = "application/json", - operation_id: Optional[str] = ..., + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., **kwargs: Any - ) -> AsyncDatasetGenerationLROPoller: ... + ) -> AsyncItemPaged[RealtimeConversationItem]: ... - @overload - async def begin_create_generation_job( + @distributed_trace + def list_agent_conversation_responses( self, - job: JSON, + agent_name: str, + conversation_id: str, *, - content_type: str = "application/json", - operation_id: Optional[str] = ..., + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., **kwargs: Any - ) -> AsyncDatasetGenerationLROPoller: ... + ) -> AsyncItemPaged[VoiceResponse]: ... - @overload - async def begin_create_generation_job( + @distributed_trace + def list_agent_conversations( self, - job: IO[bytes], + agent_name: str, *, - content_type: str = "application/json", - operation_id: Optional[str] = ..., + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., **kwargs: Any - ) -> AsyncDatasetGenerationLROPoller: ... + ) -> AsyncItemPaged[VoiceConversation]: ... - @distributed_trace_async - async def cancel_generation_job( - self, - job_id: str, - **kwargs: Any - ) -> DataGenerationJob: ... - @distributed_trace_async - async def delete_generation_job( + class azure.ai.projects.aio.operations.BetaAgentInsightMonitorsOperations: + + def __init__( self, - job_id: str, - **kwargs: Any + *args, + **kwargs ) -> None: ... - @distributed_trace_async - async def get_generation_job( + @overload + async def begin_create_run( self, - job_id: str, + monitor_id: str, + run: AgentInsightRunCreate, + *, + content_type: str = "application/json", **kwargs: Any - ) -> DataGenerationJob: ... + ) -> AsyncLROPoller[AgentInsightRunResult]: ... - @distributed_trace - def list_generation_jobs( + @overload + async def begin_create_run( self, + monitor_id: str, + run: JSON, *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., + content_type: str = "application/json", **kwargs: Any - ) -> AsyncItemPaged[DataGenerationJob]: ... + ) -> AsyncLROPoller[AgentInsightRunResult]: ... + @overload + async def begin_create_run( + self, + monitor_id: str, + run: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[AgentInsightRunResult]: ... - class azure.ai.projects.aio.operations.BetaEvaluationTaxonomiesOperations: - - def __init__( + @distributed_trace_async + async def cancel_run( self, - *args, - **kwargs - ) -> None: ... + monitor_id: str, + run_id: str, + **kwargs: Any + ) -> AgentInsightRun: ... @overload async def create( self, - name: str, - taxonomy: EvaluationTaxonomy, + monitor: AgentInsightMonitorCreate, *, content_type: str = "application/json", **kwargs: Any - ) -> EvaluationTaxonomy: ... + ) -> AgentInsightMonitor: ... @overload async def create( self, - name: str, - taxonomy: JSON, + monitor: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> EvaluationTaxonomy: ... + ) -> AgentInsightMonitor: ... @overload async def create( self, - name: str, - taxonomy: IO[bytes], + monitor: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> EvaluationTaxonomy: ... + ) -> AgentInsightMonitor: ... @distributed_trace_async async def delete( self, - name: str, + monitor_id: str, **kwargs: Any ) -> None: ... @distributed_trace_async async def get( self, - name: str, + monitor_id: str, **kwargs: Any - ) -> EvaluationTaxonomy: ... + ) -> AgentInsightMonitor: ... - @distributed_trace - def list( + @distributed_trace_async + async def get_insight( self, + monitor_id: str, + insight_id: str, *, - input_name: Optional[str] = ..., - input_type: Optional[str] = ..., + include_details: Optional[bool] = ..., **kwargs: Any - ) -> AsyncItemPaged[EvaluationTaxonomy]: ... + ) -> AgentInsight: ... - @overload - async def update( + @distributed_trace_async + async def get_run( self, - name: str, - taxonomy: EvaluationTaxonomy, - *, - content_type: str = "application/json", + monitor_id: str, + run_id: str, **kwargs: Any - ) -> EvaluationTaxonomy: ... + ) -> AgentInsightRun: ... - @overload - async def update( + @distributed_trace + def list( self, - name: str, - taxonomy: JSON, *, - content_type: str = "application/json", + agent_name: Optional[str] = ..., + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., **kwargs: Any - ) -> EvaluationTaxonomy: ... + ) -> AsyncItemPaged[AgentInsightMonitorListItem]: ... - @overload - async def update( + @distributed_trace + def list_insights( self, - name: str, - taxonomy: IO[bytes], + monitor_id: str, *, - content_type: str = "application/json", + before: Optional[str] = ..., + category: Optional[str] = ..., + include_details: Optional[bool] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + severity: Optional[Union[str, AgentInsightSeverity]] = ..., + status: Optional[Union[str, AgentInsightStatus]] = ..., **kwargs: Any - ) -> EvaluationTaxonomy: ... - + ) -> AsyncItemPaged[AgentInsight]: ... - class azure.ai.projects.aio.operations.BetaEvaluatorsOperations(BetaEvaluatorsOperationsGenerated): + @distributed_trace + def list_runs( + self, + monitor_id: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + status: Optional[Union[str, JobStatus]] = ..., + trigger: Optional[Union[str, AgentInsightRunTrigger]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[AgentInsightRun]: ... - def __init__( + @distributed_trace_async + async def reset( self, - *args, - **kwargs + monitor_id: str, + **kwargs: Any ) -> None: ... @overload - async def begin_create_generation_job( + async def update( self, - job: EvaluatorGenerationJob, + monitor_id: str, + monitor: AgentInsightMonitorUpdate, *, - content_type: str = "application/json", - operation_id: Optional[str] = ..., + content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> AsyncEvaluatorGenerationLROPoller: ... + ) -> AgentInsightMonitor: ... @overload - async def begin_create_generation_job( + async def update( self, - job: JSON, + monitor_id: str, + monitor: JSON, *, - content_type: str = "application/json", - operation_id: Optional[str] = ..., + content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> AsyncEvaluatorGenerationLROPoller: ... + ) -> AgentInsightMonitor: ... @overload - async def begin_create_generation_job( + async def update( self, - job: IO[bytes], + monitor_id: str, + monitor: IO[bytes], *, - content_type: str = "application/json", - operation_id: Optional[str] = ..., - **kwargs: Any - ) -> AsyncEvaluatorGenerationLROPoller: ... - - @distributed_trace_async - async def cancel_generation_job( - self, - job_id: str, + content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> EvaluatorGenerationJob: ... + ) -> AgentInsightMonitor: ... @overload - async def create_version( + async def update_insight( self, - name: str, - evaluator_version: EvaluatorVersion, + monitor_id: str, + insight_id: str, + update: AgentInsightUpdate, *, - content_type: str = "application/json", + content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> EvaluatorVersion: ... + ) -> AgentInsight: ... @overload - async def create_version( + async def update_insight( self, - name: str, - evaluator_version: JSON, + monitor_id: str, + insight_id: str, + update: JSON, *, - content_type: str = "application/json", + content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> EvaluatorVersion: ... + ) -> AgentInsight: ... @overload - async def create_version( + async def update_insight( self, - name: str, - evaluator_version: IO[bytes], + monitor_id: str, + insight_id: str, + update: IO[bytes], *, - content_type: str = "application/json", + content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> EvaluatorVersion: ... + ) -> AgentInsight: ... - @distributed_trace_async - async def delete_generation_job( - self, - job_id: str, - **kwargs: Any - ) -> None: ... - @distributed_trace_async - async def delete_version( + class azure.ai.projects.aio.operations.BetaAgentsOperations(BetaAgentsOperationsGenerated): + + def __init__( self, - name: str, - version: str, - **kwargs: Any + *args, + **kwargs ) -> None: ... @overload - async def get_credentials( + async def begin_create_optimization_job( self, - name: str, - version: str, - credential_request: EvaluatorCredentialRequest, + job: AgentOptimizationJob, *, content_type: str = "application/json", + operation_id: Optional[str] = ..., **kwargs: Any - ) -> DatasetCredential: ... + ) -> AsyncAgentOptimizationLROPoller: ... @overload - async def get_credentials( + async def begin_create_optimization_job( self, - name: str, - version: str, - credential_request: JSON, + job: JSON, *, content_type: str = "application/json", + operation_id: Optional[str] = ..., **kwargs: Any - ) -> DatasetCredential: ... + ) -> AsyncAgentOptimizationLROPoller: ... @overload - async def get_credentials( + async def begin_create_optimization_job( self, - name: str, - version: str, - credential_request: IO[bytes], + job: IO[bytes], *, content_type: str = "application/json", + operation_id: Optional[str] = ..., **kwargs: Any - ) -> DatasetCredential: ... + ) -> AsyncAgentOptimizationLROPoller: ... @distributed_trace_async - async def get_generation_job( + async def cancel_optimization_job( self, job_id: str, **kwargs: Any - ) -> EvaluatorGenerationJob: ... + ) -> AgentOptimizationJob: ... @distributed_trace_async - async def get_version( + async def delete_optimization_job( self, - name: str, - version: str, + job_id: str, **kwargs: Any - ) -> EvaluatorVersion: ... + ) -> None: ... - @distributed_trace - def list( + @distributed_trace_async + async def get_optimization_job( self, - *, - limit: Optional[int] = ..., - type: Optional[Union[Literal[builtin], Literal[custom], Literal[all], str]] = ..., + job_id: str, **kwargs: Any - ) -> AsyncItemPaged[EvaluatorVersion]: ... + ) -> AgentOptimizationJob: ... @distributed_trace - def list_generation_jobs( + def list_optimization_jobs( self, *, + agent_name: Optional[str] = ..., before: Optional[str] = ..., limit: Optional[int] = ..., order: Optional[Union[str, PageOrder]] = ..., + status: Optional[Union[str, JobStatus]] = ..., **kwargs: Any - ) -> AsyncItemPaged[EvaluatorGenerationJob]: ... + ) -> AsyncItemPaged[AgentOptimizationJobListItem]: ... - @distributed_trace - def list_versions( + + class azure.ai.projects.aio.operations.BetaDatasetsOperations(BetaDatasetsOperationsGenerated): + + def __init__( self, - name: str, - *, - limit: Optional[int] = ..., - type: Optional[Union[Literal[builtin], Literal[custom], Literal[all], str]] = ..., - **kwargs: Any - ) -> AsyncItemPaged[EvaluatorVersion]: ... + *args, + **kwargs + ) -> None: ... @overload - async def pending_upload( + async def begin_create_generation_job( self, - name: str, - version: str, - pending_upload_request: PendingUploadRequest, + job: DataGenerationJob, *, content_type: str = "application/json", + operation_id: Optional[str] = ..., **kwargs: Any - ) -> PendingUploadResponse: ... + ) -> AsyncDatasetGenerationLROPoller: ... @overload - async def pending_upload( + async def begin_create_generation_job( self, - name: str, - version: str, - pending_upload_request: JSON, + job: JSON, *, content_type: str = "application/json", + operation_id: Optional[str] = ..., **kwargs: Any - ) -> PendingUploadResponse: ... + ) -> AsyncDatasetGenerationLROPoller: ... @overload - async def pending_upload( + async def begin_create_generation_job( self, - name: str, - version: str, - pending_upload_request: IO[bytes], + job: IO[bytes], *, content_type: str = "application/json", + operation_id: Optional[str] = ..., **kwargs: Any - ) -> PendingUploadResponse: ... + ) -> AsyncDatasetGenerationLROPoller: ... - @overload - async def update_version( + @distributed_trace_async + async def cancel_generation_job( self, - name: str, - version: str, - evaluator_version: EvaluatorVersion, - *, - content_type: str = "application/json", + job_id: str, **kwargs: Any - ) -> EvaluatorVersion: ... + ) -> DataGenerationJob: ... - @overload - async def update_version( + @distributed_trace_async + async def delete_generation_job( self, - name: str, - version: str, - evaluator_version: JSON, - *, - content_type: str = "application/json", + job_id: str, **kwargs: Any - ) -> EvaluatorVersion: ... + ) -> None: ... - @overload - async def update_version( + @distributed_trace_async + async def get_generation_job( + self, + job_id: str, + **kwargs: Any + ) -> DataGenerationJob: ... + + @distributed_trace + def list_generation_jobs( self, - name: str, - version: str, - evaluator_version: IO[bytes], *, - content_type: str = "application/json", + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., **kwargs: Any - ) -> EvaluatorVersion: ... + ) -> AsyncItemPaged[DataGenerationJob]: ... - class azure.ai.projects.aio.operations.BetaInsightsOperations: + class azure.ai.projects.aio.operations.BetaEvaluationTaxonomiesOperations: def __init__( self, @@ -1137,368 +1390,381 @@ namespace azure.ai.projects.aio.operations ) -> None: ... @overload - async def generate( + async def create( self, - insight: Insight, + name: str, + taxonomy: EvaluationTaxonomy, *, content_type: str = "application/json", **kwargs: Any - ) -> Insight: ... + ) -> EvaluationTaxonomy: ... @overload - async def generate( + async def create( self, - insight: JSON, + name: str, + taxonomy: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> Insight: ... + ) -> EvaluationTaxonomy: ... @overload - async def generate( + async def create( self, - insight: IO[bytes], + name: str, + taxonomy: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> Insight: ... + ) -> EvaluationTaxonomy: ... + + @distributed_trace_async + async def delete( + self, + name: str, + **kwargs: Any + ) -> None: ... @distributed_trace_async async def get( self, - insight_id: str, - *, - include_coordinates: Optional[bool] = ..., + name: str, **kwargs: Any - ) -> Insight: ... + ) -> EvaluationTaxonomy: ... @distributed_trace def list( self, *, - agent_name: Optional[str] = ..., - eval_id: Optional[str] = ..., - include_coordinates: Optional[bool] = ..., - run_id: Optional[str] = ..., - type: Optional[Union[str, InsightType]] = ..., + input_name: Optional[str] = ..., + input_type: Optional[str] = ..., **kwargs: Any - ) -> AsyncItemPaged[Insight]: ... - - - class azure.ai.projects.aio.operations.BetaMemoryStoresOperations(GenerateBetaMemoryStoresOperations): - - def __init__( - self, - *args, - **kwargs - ) -> None: ... + ) -> AsyncItemPaged[EvaluationTaxonomy]: ... @overload - async def begin_update_memories( + async def update( self, name: str, + taxonomy: EvaluationTaxonomy, *, content_type: str = "application/json", - items: Optional[Union[str, ResponseInputParam]] = ..., - previous_update_id: Optional[str] = ..., - scope: str, - update_delay: Optional[int] = ..., **kwargs: Any - ) -> AsyncUpdateMemoriesLROPoller: ... + ) -> EvaluationTaxonomy: ... @overload - async def begin_update_memories( + async def update( self, name: str, - body: JSON, + taxonomy: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncUpdateMemoriesLROPoller: ... + ) -> EvaluationTaxonomy: ... @overload - async def begin_update_memories( + async def update( self, name: str, - body: IO[bytes], + taxonomy: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncUpdateMemoriesLROPoller: ... + ) -> EvaluationTaxonomy: ... + + + class azure.ai.projects.aio.operations.BetaEvaluatorsOperations(BetaEvaluatorsOperationsGenerated): + + def __init__( + self, + *args, + **kwargs + ) -> None: ... @overload - async def create( + async def begin_create_generation_job( self, + job: EvaluatorGenerationJob, *, content_type: str = "application/json", - definition: MemoryStoreDefinition, - description: Optional[str] = ..., - metadata: Optional[dict[str, str]] = ..., - name: str, + operation_id: Optional[str] = ..., **kwargs: Any - ) -> MemoryStoreDetails: ... + ) -> AsyncEvaluatorGenerationLROPoller: ... @overload - async def create( + async def begin_create_generation_job( self, - body: JSON, + job: JSON, *, content_type: str = "application/json", + operation_id: Optional[str] = ..., **kwargs: Any - ) -> MemoryStoreDetails: ... + ) -> AsyncEvaluatorGenerationLROPoller: ... @overload - async def create( + async def begin_create_generation_job( self, - body: IO[bytes], + job: IO[bytes], *, content_type: str = "application/json", + operation_id: Optional[str] = ..., **kwargs: Any - ) -> MemoryStoreDetails: ... + ) -> AsyncEvaluatorGenerationLROPoller: ... + + @distributed_trace_async + async def cancel_generation_job( + self, + job_id: str, + **kwargs: Any + ) -> EvaluatorGenerationJob: ... @overload - async def create_memory( + async def create_version( self, name: str, + evaluator_version: EvaluatorVersion, *, - content: str, content_type: str = "application/json", - kind: Union[str, MemoryItemKind], - scope: str, **kwargs: Any - ) -> MemoryItem: ... + ) -> EvaluatorVersion: ... @overload - async def create_memory( + async def create_version( self, name: str, - body: JSON, + evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> MemoryItem: ... + ) -> EvaluatorVersion: ... @overload - async def create_memory( + async def create_version( self, name: str, - body: IO[bytes], + evaluator_version: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> MemoryItem: ... + ) -> EvaluatorVersion: ... @distributed_trace_async - async def delete( + async def delete_generation_job( self, - name: str, + job_id: str, **kwargs: Any - ) -> DeleteMemoryStoreResult: ... + ) -> None: ... @distributed_trace_async - async def delete_memory( + async def delete_version( self, name: str, - memory_id: str, + version: str, **kwargs: Any - ) -> DeleteMemoryResult: ... + ) -> None: ... @overload - async def delete_scope( + async def get_credentials( self, name: str, + version: str, + credential_request: EvaluatorCredentialRequest, *, content_type: str = "application/json", - scope: str, **kwargs: Any - ) -> MemoryStoreDeleteScopeResult: ... + ) -> DatasetCredential: ... @overload - async def delete_scope( + async def get_credentials( self, name: str, - body: JSON, + version: str, + credential_request: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> MemoryStoreDeleteScopeResult: ... + ) -> DatasetCredential: ... @overload - async def delete_scope( + async def get_credentials( self, name: str, - body: IO[bytes], + version: str, + credential_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> MemoryStoreDeleteScopeResult: ... + ) -> DatasetCredential: ... @distributed_trace_async - async def get( + async def get_generation_job( self, - name: str, + job_id: str, **kwargs: Any - ) -> MemoryStoreDetails: ... + ) -> EvaluatorGenerationJob: ... @distributed_trace_async - async def get_memory( + async def get_version( self, name: str, - memory_id: str, + version: str, **kwargs: Any - ) -> MemoryItem: ... + ) -> EvaluatorVersion: ... @distributed_trace def list( self, *, - before: Optional[str] = ..., limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., + type: Optional[Union[Literal[builtin], Literal[custom], Literal[all], str]] = ..., **kwargs: Any - ) -> AsyncItemPaged[MemoryStoreDetails]: ... + ) -> AsyncItemPaged[EvaluatorVersion]: ... - @overload - def list_memories( + @distributed_trace + def list_generation_jobs( self, - name: str, *, before: Optional[str] = ..., - content_type: str = "application/json", - kind: Optional[Union[str, MemoryItemKind]] = ..., limit: Optional[int] = ..., order: Optional[Union[str, PageOrder]] = ..., - scope: str, **kwargs: Any - ) -> AsyncItemPaged[MemoryItem]: ... + ) -> AsyncItemPaged[EvaluatorGenerationJob]: ... - @overload - def list_memories( + @distributed_trace + def list_versions( self, name: str, - body: JSON, *, - before: Optional[str] = ..., - content_type: str = "application/json", - kind: Optional[Union[str, MemoryItemKind]] = ..., limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., + type: Optional[Union[Literal[builtin], Literal[custom], Literal[all], str]] = ..., **kwargs: Any - ) -> AsyncItemPaged[MemoryItem]: ... + ) -> AsyncItemPaged[EvaluatorVersion]: ... @overload - def list_memories( + async def pending_upload( self, name: str, - body: IO[bytes], + version: str, + pending_upload_request: PendingUploadRequest, *, - before: Optional[str] = ..., content_type: str = "application/json", - kind: Optional[Union[str, MemoryItemKind]] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., **kwargs: Any - ) -> AsyncItemPaged[MemoryItem]: ... + ) -> PendingUploadResponse: ... @overload - async def search_memories( + async def pending_upload( self, name: str, + version: str, + pending_upload_request: JSON, *, content_type: str = "application/json", - items: Optional[Union[str, ResponseInputParam]] = ..., - options: Optional[MemorySearchOptions] = ..., - previous_search_id: Optional[str] = ..., - scope: str, **kwargs: Any - ) -> MemoryStoreSearchResult: ... + ) -> PendingUploadResponse: ... @overload - async def search_memories( + async def pending_upload( self, name: str, - body: JSON, + version: str, + pending_upload_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> MemoryStoreSearchResult: ... + ) -> PendingUploadResponse: ... @overload - async def search_memories( + async def update_version( self, name: str, - body: IO[bytes], + version: str, + evaluator_version: EvaluatorVersion, *, content_type: str = "application/json", **kwargs: Any - ) -> MemoryStoreSearchResult: ... + ) -> EvaluatorVersion: ... @overload - async def update( + async def update_version( self, name: str, + version: str, + evaluator_version: JSON, *, content_type: str = "application/json", - description: Optional[str] = ..., - metadata: Optional[dict[str, str]] = ..., **kwargs: Any - ) -> MemoryStoreDetails: ... + ) -> EvaluatorVersion: ... @overload - async def update( + async def update_version( self, name: str, - body: JSON, + version: str, + evaluator_version: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> MemoryStoreDetails: ... + ) -> EvaluatorVersion: ... + + + class azure.ai.projects.aio.operations.BetaInsightsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... @overload - async def update( + async def generate( self, - name: str, - body: IO[bytes], + insight: Insight, *, content_type: str = "application/json", **kwargs: Any - ) -> MemoryStoreDetails: ... + ) -> Insight: ... @overload - async def update_memory( + async def generate( self, - name: str, - memory_id: str, + insight: JSON, *, - content: str, content_type: str = "application/json", **kwargs: Any - ) -> MemoryItem: ... + ) -> Insight: ... @overload - async def update_memory( + async def generate( self, - name: str, - memory_id: str, - body: JSON, + insight: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> MemoryItem: ... + ) -> Insight: ... - @overload - async def update_memory( + @distributed_trace_async + async def get( self, - name: str, - memory_id: str, - body: IO[bytes], + insight_id: str, *, - content_type: str = "application/json", + include_coordinates: Optional[bool] = ..., **kwargs: Any - ) -> MemoryItem: ... + ) -> Insight: ... + + @distributed_trace + def list( + self, + *, + agent_name: Optional[str] = ..., + eval_id: Optional[str] = ..., + include_coordinates: Optional[bool] = ..., + run_id: Optional[str] = ..., + type: Optional[Union[str, InsightType]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[Insight]: ... - class azure.ai.projects.aio.operations.BetaModelsOperations(BetaModelsOperationsGenerated): + class azure.ai.projects.aio.operations.BetaMemoryStoresOperations(GenerateBetaMemoryStoresOperations): def __init__( self, @@ -1507,658 +1773,580 @@ namespace azure.ai.projects.aio.operations ) -> None: ... @overload - async def create( + async def begin_update_memories( self, - *, - base_model: Optional[str] = ..., - description: Optional[str] = ..., name: str, - polling_interval: float = 2.0, - polling_timeout: float = 300.0, - source: Union[str, PathLike[str]], - tags: Optional[dict[str, str]] = ..., - version: str, - wait_for_commit: Literal[True] = True, - weight_type: Optional[str] = ..., + *, + content_type: str = "application/json", + items: Optional[Union[str, ResponseInputParam]] = ..., + previous_update_id: Optional[str] = ..., + scope: str, + update_delay: Optional[int] = ..., **kwargs: Any - ) -> ModelVersion: ... + ) -> AsyncUpdateMemoriesLROPoller: ... @overload - async def create( + async def begin_update_memories( self, - *, - base_model: Optional[str] = ..., - description: Optional[str] = ..., name: str, - polling_interval: float = 2.0, - polling_timeout: float = 300.0, - source: Union[str, PathLike[str]], - tags: Optional[dict[str, str]] = ..., - version: str, - wait_for_commit: Literal[False], - weight_type: Optional[str] = ..., + body: JSON, + *, + content_type: str = "application/json", **kwargs: Any - ) -> None: ... + ) -> AsyncUpdateMemoriesLROPoller: ... - @distributed_trace_async - async def delete( + @overload + async def begin_update_memories( self, name: str, - version: str, + body: IO[bytes], + *, + content_type: str = "application/json", **kwargs: Any - ) -> None: ... + ) -> AsyncUpdateMemoriesLROPoller: ... - @distributed_trace_async - async def get( + @overload + async def create( self, + *, + content_type: str = "application/json", + definition: MemoryStoreDefinition, + description: Optional[str] = ..., + metadata: Optional[dict[str, str]] = ..., name: str, - version: str, **kwargs: Any - ) -> ModelVersion: ... + ) -> MemoryStoreDetails: ... @overload - async def get_credentials( + async def create( self, - name: str, - version: str, - credential_request: ModelCredentialRequest, + body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> DatasetCredential: ... + ) -> MemoryStoreDetails: ... @overload - async def get_credentials( + async def create( self, - name: str, - version: str, - credential_request: JSON, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> DatasetCredential: ... + ) -> MemoryStoreDetails: ... @overload - async def get_credentials( + async def create_memory( self, name: str, - version: str, - credential_request: IO[bytes], *, + content: str, content_type: str = "application/json", + kind: Union[str, MemoryItemKind], + scope: str, **kwargs: Any - ) -> DatasetCredential: ... - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncItemPaged[ModelVersion]: ... - - @distributed_trace - def list_versions( - self, - name: str, - **kwargs: Any - ) -> AsyncItemPaged[ModelVersion]: ... + ) -> MemoryItem: ... @overload - async def pending_create_version( + async def create_memory( self, name: str, - version: str, - model_version: ModelVersion, + body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> CreateAsyncResponse: ... + ) -> MemoryItem: ... @overload - async def pending_create_version( + async def create_memory( self, name: str, - version: str, - model_version: JSON, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> CreateAsyncResponse: ... + ) -> MemoryItem: ... - @overload - async def pending_create_version( - self, + @distributed_trace_async + async def delete( + self, name: str, - version: str, - model_version: IO[bytes], - *, - content_type: str = "application/json", **kwargs: Any - ) -> CreateAsyncResponse: ... + ) -> DeleteMemoryStoreResult: ... - @overload - async def pending_upload( + @distributed_trace_async + async def delete_memory( self, name: str, - version: str, - pending_upload_request: ModelPendingUploadRequest, - *, - content_type: str = "application/json", + memory_id: str, **kwargs: Any - ) -> ModelPendingUploadResponse: ... + ) -> DeleteMemoryResult: ... @overload - async def pending_upload( + async def delete_scope( self, name: str, - version: str, - pending_upload_request: JSON, *, content_type: str = "application/json", + scope: str, **kwargs: Any - ) -> ModelPendingUploadResponse: ... + ) -> MemoryStoreDeleteScopeResult: ... @overload - async def pending_upload( + async def delete_scope( self, name: str, - version: str, - pending_upload_request: IO[bytes], + body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> ModelPendingUploadResponse: ... + ) -> MemoryStoreDeleteScopeResult: ... @overload - async def update( + async def delete_scope( self, name: str, - version: str, - model_version_update: UpdateModelVersionRequest, + body: IO[bytes], *, - content_type: str = "application/merge-patch+json", + content_type: str = "application/json", **kwargs: Any - ) -> ModelVersion: ... + ) -> MemoryStoreDeleteScopeResult: ... - @overload - async def update( + @distributed_trace_async + async def get( self, name: str, - version: str, - model_version_update: JSON, - *, - content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> ModelVersion: ... + ) -> MemoryStoreDetails: ... - @overload - async def update( + @distributed_trace_async + async def get_memory( self, name: str, - version: str, - model_version_update: IO[bytes], - *, - content_type: str = "application/merge-patch+json", + memory_id: str, **kwargs: Any - ) -> ModelVersion: ... - - - class azure.ai.projects.aio.operations.BetaOperations(GeneratedBetaOperations): - agent_endpoint_conversations: BetaAgentEndpointConversationsOperations - agent_insight_monitors: BetaAgentInsightMonitorsOperations - agents: BetaAgentsOperations - datasets: BetaDatasetsOperations - evaluation_taxonomies: BetaEvaluationTaxonomiesOperations - evaluators: BetaEvaluatorsOperations - insights: BetaInsightsOperations - memory_stores: BetaMemoryStoresOperations - models: BetaModelsOperations - red_teams: BetaRedTeamsOperations - routines: BetaRoutinesOperations - schedules: BetaSchedulesOperations - skills: BetaSkillsOperations + ) -> MemoryItem: ... - def __init__( + @distributed_trace + def list( self, - *args: Any, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., **kwargs: Any - ) -> None: ... - - - class azure.ai.projects.aio.operations.BetaRedTeamsOperations: + ) -> AsyncItemPaged[MemoryStoreDetails]: ... - def __init__( + @overload + def list_memories( self, - *args, - **kwargs - ) -> None: ... + name: str, + *, + before: Optional[str] = ..., + content_type: str = "application/json", + kind: Optional[Union[str, MemoryItemKind]] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + scope: str, + **kwargs: Any + ) -> AsyncItemPaged[MemoryItem]: ... @overload - async def create( + def list_memories( self, - red_team: RedTeam, + name: str, + body: JSON, *, + before: Optional[str] = ..., content_type: str = "application/json", + kind: Optional[Union[str, MemoryItemKind]] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., **kwargs: Any - ) -> RedTeam: ... + ) -> AsyncItemPaged[MemoryItem]: ... @overload - async def create( + def list_memories( self, - red_team: JSON, + name: str, + body: IO[bytes], *, + before: Optional[str] = ..., content_type: str = "application/json", + kind: Optional[Union[str, MemoryItemKind]] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., **kwargs: Any - ) -> RedTeam: ... + ) -> AsyncItemPaged[MemoryItem]: ... @overload - async def create( + async def search_memories( self, - red_team: IO[bytes], + name: str, *, content_type: str = "application/json", + items: Optional[Union[str, ResponseInputParam]] = ..., + options: Optional[MemorySearchOptions] = ..., + previous_search_id: Optional[str] = ..., + scope: str, **kwargs: Any - ) -> RedTeam: ... + ) -> MemoryStoreSearchResult: ... - @distributed_trace_async - async def get( + @overload + async def search_memories( self, name: str, + body: JSON, + *, + content_type: str = "application/json", **kwargs: Any - ) -> RedTeam: ... - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncItemPaged[RedTeam]: ... - - - class azure.ai.projects.aio.operations.BetaRoutinesOperations: + ) -> MemoryStoreSearchResult: ... - def __init__( + @overload + async def search_memories( self, - *args, - **kwargs - ) -> None: ... + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryStoreSearchResult: ... @overload - async def create_or_update( + async def update( self, - routine_name: str, + name: str, *, - action: Optional[RoutineAction] = ..., - authorization: Optional[RoutineAuthorization] = ..., content_type: str = "application/json", description: Optional[str] = ..., - enabled: Optional[bool] = ..., - triggers: Optional[dict[str, RoutineTrigger]] = ..., + metadata: Optional[dict[str, str]] = ..., **kwargs: Any - ) -> Routine: ... + ) -> MemoryStoreDetails: ... @overload - async def create_or_update( + async def update( self, - routine_name: str, + name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> Routine: ... + ) -> MemoryStoreDetails: ... @overload - async def create_or_update( + async def update( self, - routine_name: str, + name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> Routine: ... - - @distributed_trace_async - async def delete( - self, - routine_name: str, - **kwargs: Any - ) -> None: ... - - @distributed_trace_async - async def disable( - self, - routine_name: str, - **kwargs: Any - ) -> Routine: ... + ) -> MemoryStoreDetails: ... @overload - async def dispatch( + async def update_memory( self, - routine_name: str, + name: str, + memory_id: str, *, + content: str, content_type: str = "application/json", - payload: Optional[RoutineDispatchPayload] = ..., **kwargs: Any - ) -> DispatchRoutineResult: ... + ) -> MemoryItem: ... @overload - async def dispatch( + async def update_memory( self, - routine_name: str, + name: str, + memory_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> DispatchRoutineResult: ... + ) -> MemoryItem: ... @overload - async def dispatch( + async def update_memory( self, - routine_name: str, + name: str, + memory_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> DispatchRoutineResult: ... + ) -> MemoryItem: ... - @distributed_trace_async - async def enable( - self, - routine_name: str, - **kwargs: Any - ) -> Routine: ... - @distributed_trace_async - async def get( + class azure.ai.projects.aio.operations.BetaModelsOperations(BetaModelsOperationsGenerated): + + def __init__( self, - routine_name: str, - **kwargs: Any - ) -> Routine: ... + *args, + **kwargs + ) -> None: ... - @distributed_trace - def list( + @overload + async def create( self, *, - after: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> AsyncItemPaged[Routine]: ... - - @distributed_trace - def list_runs( - self, - routine_name: str, - *, - after: Optional[str] = ..., - filter: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> AsyncItemPaged[RoutineRun]: ... - - - class azure.ai.projects.aio.operations.BetaSchedulesOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - async def create_or_update( - self, - schedule_id: str, - schedule: Schedule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Schedule: ... - - @overload - async def create_or_update( - self, - schedule_id: str, - schedule: JSON, - *, - content_type: str = "application/json", + base_model: Optional[str] = ..., + description: Optional[str] = ..., + name: str, + polling_interval: float = 2.0, + polling_timeout: float = 300.0, + source: Union[str, PathLike[str]], + tags: Optional[dict[str, str]] = ..., + version: str, + wait_for_commit: Literal[True] = True, + weight_type: Optional[str] = ..., **kwargs: Any - ) -> Schedule: ... + ) -> ModelVersion: ... @overload - async def create_or_update( + async def create( self, - schedule_id: str, - schedule: IO[bytes], *, - content_type: str = "application/json", + base_model: Optional[str] = ..., + description: Optional[str] = ..., + name: str, + polling_interval: float = 2.0, + polling_timeout: float = 300.0, + source: Union[str, PathLike[str]], + tags: Optional[dict[str, str]] = ..., + version: str, + wait_for_commit: Literal[False], + weight_type: Optional[str] = ..., **kwargs: Any - ) -> Schedule: ... + ) -> None: ... @distributed_trace_async async def delete( self, - schedule_id: str, + name: str, + version: str, **kwargs: Any ) -> None: ... @distributed_trace_async async def get( self, - schedule_id: str, - **kwargs: Any - ) -> Schedule: ... - - @distributed_trace_async - async def get_run( - self, - schedule_id: str, - run_id: str, - **kwargs: Any - ) -> ScheduleRun: ... - - @distributed_trace - def list( - self, - *, - enabled: Optional[bool] = ..., - type: Optional[Union[str, ScheduleTaskType]] = ..., - **kwargs: Any - ) -> AsyncItemPaged[Schedule]: ... - - @distributed_trace - def list_runs( - self, - schedule_id: str, - *, - enabled: Optional[bool] = ..., - type: Optional[Union[str, ScheduleTaskType]] = ..., + name: str, + version: str, **kwargs: Any - ) -> AsyncItemPaged[ScheduleRun]: ... - - - class azure.ai.projects.aio.operations.BetaSkillsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... + ) -> ModelVersion: ... @overload - async def create( + async def get_credentials( self, name: str, + version: str, + credential_request: ModelCredentialRequest, *, content_type: str = "application/json", - default: Optional[bool] = ..., - inline_content: Optional[SkillInlineContent] = ..., **kwargs: Any - ) -> SkillVersion: ... + ) -> DatasetCredential: ... @overload - async def create( + async def get_credentials( self, name: str, - body: JSON, + version: str, + credential_request: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> SkillVersion: ... + ) -> DatasetCredential: ... @overload - async def create( + async def get_credentials( self, name: str, - body: IO[bytes], + version: str, + credential_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> SkillVersion: ... - - @overload - async def create_from_files( - self, - name: str, - content: CreateSkillVersionFromFilesBody, - **kwargs: Any - ) -> SkillVersion: ... + ) -> DatasetCredential: ... - @overload - async def create_from_files( - self, - name: str, - content: JSON, - **kwargs: Any - ) -> SkillVersion: ... + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[ModelVersion]: ... - @distributed_trace_async - async def delete( + @distributed_trace + def list_versions( self, name: str, **kwargs: Any - ) -> DeleteSkillResult: ... + ) -> AsyncItemPaged[ModelVersion]: ... - @distributed_trace_async - async def delete_version( + @overload + async def pending_create_version( self, name: str, version: str, + model_version: ModelVersion, + *, + content_type: str = "application/json", **kwargs: Any - ) -> DeleteSkillVersionResult: ... + ) -> CreateAsyncResponse: ... - @distributed_trace_async - async def download( + @overload + async def pending_create_version( self, name: str, + version: str, + model_version: JSON, + *, + content_type: str = "application/json", **kwargs: Any - ) -> AsyncIterator[bytes]: ... + ) -> CreateAsyncResponse: ... - @distributed_trace_async - async def download_version( + @overload + async def pending_create_version( self, name: str, version: str, + model_version: IO[bytes], + *, + content_type: str = "application/json", **kwargs: Any - ) -> AsyncIterator[bytes]: ... + ) -> CreateAsyncResponse: ... - @distributed_trace_async - async def get( + @overload + async def pending_upload( self, name: str, + version: str, + pending_upload_request: ModelPendingUploadRequest, + *, + content_type: str = "application/json", **kwargs: Any - ) -> SkillDetails: ... + ) -> ModelPendingUploadResponse: ... - @distributed_trace_async - async def get_version( + @overload + async def pending_upload( self, name: str, version: str, - **kwargs: Any - ) -> SkillVersion: ... - - @distributed_trace - def list( - self, + pending_upload_request: JSON, *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., + content_type: str = "application/json", **kwargs: Any - ) -> AsyncItemPaged[SkillDetails]: ... + ) -> ModelPendingUploadResponse: ... - @distributed_trace - def list_versions( + @overload + async def pending_upload( self, name: str, + version: str, + pending_upload_request: IO[bytes], *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., + content_type: str = "application/json", **kwargs: Any - ) -> AsyncItemPaged[SkillVersion]: ... + ) -> ModelPendingUploadResponse: ... @overload async def update( self, name: str, + version: str, + model_version_update: UpdateModelVersionRequest, *, - content_type: str = "application/json", - default_version: str, + content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> SkillDetails: ... + ) -> ModelVersion: ... @overload async def update( self, name: str, - body: JSON, + version: str, + model_version_update: JSON, *, - content_type: str = "application/json", + content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> SkillDetails: ... + ) -> ModelVersion: ... @overload async def update( self, name: str, - body: IO[bytes], + version: str, + model_version_update: IO[bytes], *, - content_type: str = "application/json", + content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> SkillDetails: ... - - - class azure.ai.projects.aio.operations.ConnectionsOperations(ConnectionsOperationsGenerated): + ) -> ModelVersion: ... - def __init__( - self, - *args, - **kwargs - ) -> None: ... - @distributed_trace_async - async def get( - self, - name: str, - *, - include_credentials: Optional[bool] = False, + class azure.ai.projects.aio.operations.BetaOperations(GeneratedBetaOperations): + agent_endpoint_conversations: BetaAgentEndpointConversationsOperations + agent_insight_monitors: BetaAgentInsightMonitorsOperations + agents: BetaAgentsOperations + datasets: BetaDatasetsOperations + evaluation_taxonomies: BetaEvaluationTaxonomiesOperations + evaluators: BetaEvaluatorsOperations + insights: BetaInsightsOperations + memory_stores: BetaMemoryStoresOperations + models: BetaModelsOperations + red_teams: BetaRedTeamsOperations + routines: BetaRoutinesOperations + schedules: BetaSchedulesOperations + skills: BetaSkillsOperations + + def __init__( + self, + *args: Any, **kwargs: Any - ) -> Connection: ... + ) -> None: ... - @distributed_trace_async - async def get_default( + + class azure.ai.projects.aio.operations.BetaRedTeamsOperations: + + def __init__( self, - connection_type: Union[str, ConnectionType], + *args, + **kwargs + ) -> None: ... + + @overload + async def create( + self, + red_team: RedTeam, *, - include_credentials: Optional[bool] = False, + content_type: str = "application/json", **kwargs: Any - ) -> Connection: ... + ) -> RedTeam: ... - @distributed_trace - def list( + @overload + async def create( self, + red_team: JSON, *, - connection_type: Optional[Union[str, ConnectionType]] = ..., - default_connection: Optional[bool] = ..., + content_type: str = "application/json", **kwargs: Any - ) -> AsyncItemPaged[Connection]: ... + ) -> RedTeam: ... + @overload + async def create( + self, + red_team: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> RedTeam: ... - class azure.ai.projects.aio.operations.DatasetsOperations(DatasetsOperationsGenerated): + @distributed_trace_async + async def get( + self, + name: str, + **kwargs: Any + ) -> RedTeam: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[RedTeam]: ... + + + class azure.ai.projects.aio.operations.BetaRoutinesOperations: def __init__( self, @@ -2169,154 +2357,119 @@ namespace azure.ai.projects.aio.operations @overload async def create_or_update( self, - name: str, - version: str, - dataset_version: DatasetVersion, + routine_name: str, *, - content_type: str = "application/merge-patch+json", + action: Optional[RoutineAction] = ..., + authorization: Optional[RoutineAuthorization] = ..., + content_type: str = "application/json", + description: Optional[str] = ..., + enabled: Optional[bool] = ..., + triggers: Optional[dict[str, RoutineTrigger]] = ..., **kwargs: Any - ) -> DatasetVersion: ... + ) -> Routine: ... @overload async def create_or_update( self, - name: str, - version: str, - dataset_version: JSON, + routine_name: str, + body: JSON, *, - content_type: str = "application/merge-patch+json", + content_type: str = "application/json", **kwargs: Any - ) -> DatasetVersion: ... + ) -> Routine: ... @overload async def create_or_update( self, - name: str, - version: str, - dataset_version: IO[bytes], + routine_name: str, + body: IO[bytes], *, - content_type: str = "application/merge-patch+json", + content_type: str = "application/json", **kwargs: Any - ) -> DatasetVersion: ... + ) -> Routine: ... @distributed_trace_async async def delete( self, - name: str, - version: str, + routine_name: str, **kwargs: Any ) -> None: ... @distributed_trace_async - async def get( - self, - name: str, - version: str, - **kwargs: Any - ) -> DatasetVersion: ... - - @distributed_trace_async - async def get_credentials( - self, - name: str, - version: str, - **kwargs: Any - ) -> DatasetCredential: ... - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncItemPaged[DatasetVersion]: ... - - @distributed_trace - def list_versions( + async def disable( self, - name: str, + routine_name: str, **kwargs: Any - ) -> AsyncItemPaged[DatasetVersion]: ... + ) -> Routine: ... @overload - async def pending_upload( + async def dispatch( self, - name: str, - version: str, - pending_upload_request: PendingUploadRequest, + routine_name: str, *, content_type: str = "application/json", + payload: Optional[RoutineDispatchPayload] = ..., **kwargs: Any - ) -> PendingUploadResponse: ... + ) -> DispatchRoutineResult: ... @overload - async def pending_upload( + async def dispatch( self, - name: str, - version: str, - pending_upload_request: JSON, + routine_name: str, + body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> PendingUploadResponse: ... + ) -> DispatchRoutineResult: ... @overload - async def pending_upload( + async def dispatch( self, - name: str, - version: str, - pending_upload_request: IO[bytes], + routine_name: str, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> PendingUploadResponse: ... + ) -> DispatchRoutineResult: ... @distributed_trace_async - async def upload_file( + async def enable( self, - *, - connection_name: Optional[str] = ..., - file_path: str, - name: str, - version: str, + routine_name: str, **kwargs: Any - ) -> FileDatasetVersion: ... + ) -> Routine: ... @distributed_trace_async - async def upload_folder( + async def get( self, - *, - connection_name: Optional[str] = ..., - file_pattern: Optional[Pattern] = ..., - folder: str, - name: str, - version: str, + routine_name: str, **kwargs: Any - ) -> FolderDatasetVersion: ... - - - class azure.ai.projects.aio.operations.DeploymentsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... + ) -> Routine: ... - @distributed_trace_async - async def get( + @distributed_trace + def list( self, - name: str, + *, + after: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., **kwargs: Any - ) -> Deployment: ... + ) -> AsyncItemPaged[Routine]: ... @distributed_trace - def list( + def list_runs( self, + routine_name: str, *, - deployment_type: Optional[Union[str, DeploymentType]] = ..., - model_name: Optional[str] = ..., - model_publisher: Optional[str] = ..., + after: Optional[str] = ..., + filter: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., **kwargs: Any - ) -> AsyncItemPaged[Deployment]: ... + ) -> AsyncItemPaged[RoutineRun]: ... - class azure.ai.projects.aio.operations.EvaluationRulesOperations(GeneratedEvaluationRulesOperations): + class azure.ai.projects.aio.operations.BetaSchedulesOperations: def __init__( self, @@ -2327,197 +2480,166 @@ namespace azure.ai.projects.aio.operations @overload async def create_or_update( self, - id: str, - evaluation_rule: EvaluationRule, + schedule_id: str, + schedule: Schedule, *, content_type: str = "application/json", **kwargs: Any - ) -> EvaluationRule: ... + ) -> Schedule: ... @overload async def create_or_update( self, - id: str, - evaluation_rule: JSON, + schedule_id: str, + schedule: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> EvaluationRule: ... + ) -> Schedule: ... @overload async def create_or_update( self, - id: str, - evaluation_rule: IO[bytes], + schedule_id: str, + schedule: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> EvaluationRule: ... + ) -> Schedule: ... @distributed_trace_async async def delete( self, - id: str, + schedule_id: str, **kwargs: Any ) -> None: ... @distributed_trace_async async def get( self, - id: str, + schedule_id: str, **kwargs: Any - ) -> EvaluationRule: ... + ) -> Schedule: ... + + @distributed_trace_async + async def get_run( + self, + schedule_id: str, + run_id: str, + **kwargs: Any + ) -> ScheduleRun: ... @distributed_trace def list( self, *, - action_type: Optional[Union[str, EvaluationRuleActionType]] = ..., - agent_name: Optional[str] = ..., enabled: Optional[bool] = ..., + type: Optional[Union[str, ScheduleTaskType]] = ..., **kwargs: Any - ) -> AsyncItemPaged[EvaluationRule]: ... - - - class azure.ai.projects.aio.operations.IndexesOperations: + ) -> AsyncItemPaged[Schedule]: ... - def __init__( + @distributed_trace + def list_runs( self, - *args, + schedule_id: str, + *, + enabled: Optional[bool] = ..., + type: Optional[Union[str, ScheduleTaskType]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[ScheduleRun]: ... + + + class azure.ai.projects.aio.operations.BetaSkillsOperations: + + def __init__( + self, + *args, **kwargs ) -> None: ... @overload - async def create_or_update( + async def create( self, name: str, - version: str, - index: Index, *, - content_type: str = "application/merge-patch+json", + content_type: str = "application/json", + default: Optional[bool] = ..., + inline_content: Optional[SkillInlineContent] = ..., **kwargs: Any - ) -> Index: ... + ) -> SkillVersion: ... @overload - async def create_or_update( + async def create( self, name: str, - version: str, - index: JSON, + body: JSON, *, - content_type: str = "application/merge-patch+json", + content_type: str = "application/json", **kwargs: Any - ) -> Index: ... + ) -> SkillVersion: ... @overload - async def create_or_update( + async def create( self, name: str, - version: str, - index: IO[bytes], + body: IO[bytes], *, - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> Index: ... - - @distributed_trace_async - async def delete( - self, - name: str, - version: str, - **kwargs: Any - ) -> None: ... - - @distributed_trace_async - async def get( - self, - name: str, - version: str, + content_type: str = "application/json", **kwargs: Any - ) -> Index: ... - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncItemPaged[Index]: ... + ) -> SkillVersion: ... - @distributed_trace - def list_versions( + @overload + async def create_from_files( self, name: str, + content: CreateSkillVersionFromFilesBody, **kwargs: Any - ) -> AsyncItemPaged[Index]: ... - - - class azure.ai.projects.aio.operations.TelemetryOperations: - - def __init__(self, outer_instance: AIProjectClient) -> None: ... - - @distributed_trace_async - async def get_application_insights_connection_string(self) -> str: ... - - - class azure.ai.projects.aio.operations.ToolboxesOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... + ) -> SkillVersion: ... @overload - async def create_version( + async def create_from_files( self, name: str, - *, - content_type: str = "application/json", - description: Optional[str] = ..., - metadata: Optional[dict[str, str]] = ..., - policies: Optional[ToolboxPolicies] = ..., - skills: Optional[List[ToolboxSkill]] = ..., - tools: List[ToolboxTool], + content: JSON, **kwargs: Any - ) -> ToolboxVersionObject: ... + ) -> SkillVersion: ... - @overload - async def create_version( + @distributed_trace_async + async def delete( self, name: str, - body: JSON, - *, - content_type: str = "application/json", **kwargs: Any - ) -> ToolboxVersionObject: ... + ) -> DeleteSkillResult: ... - @overload - async def create_version( + @distributed_trace_async + async def delete_version( self, name: str, - body: IO[bytes], - *, - content_type: str = "application/json", + version: str, **kwargs: Any - ) -> ToolboxVersionObject: ... + ) -> DeleteSkillVersionResult: ... @distributed_trace_async - async def delete( + async def download( self, name: str, **kwargs: Any - ) -> None: ... + ) -> AsyncIterator[bytes]: ... @distributed_trace_async - async def delete_version( + async def download_version( self, name: str, version: str, **kwargs: Any - ) -> None: ... + ) -> AsyncIterator[bytes]: ... @distributed_trace_async async def get( self, name: str, **kwargs: Any - ) -> ToolboxObject: ... + ) -> SkillDetails: ... @distributed_trace_async async def get_version( @@ -2525,7 +2647,7 @@ namespace azure.ai.projects.aio.operations name: str, version: str, **kwargs: Any - ) -> ToolboxVersionObject: ... + ) -> SkillVersion: ... @distributed_trace def list( @@ -2535,7 +2657,7 @@ namespace azure.ai.projects.aio.operations limit: Optional[int] = ..., order: Optional[Union[str, PageOrder]] = ..., **kwargs: Any - ) -> AsyncItemPaged[ToolboxObject]: ... + ) -> AsyncItemPaged[SkillDetails]: ... @distributed_trace def list_versions( @@ -2546,7 +2668,7 @@ namespace azure.ai.projects.aio.operations limit: Optional[int] = ..., order: Optional[Union[str, PageOrder]] = ..., **kwargs: Any - ) -> AsyncItemPaged[ToolboxVersionObject]: ... + ) -> AsyncItemPaged[SkillVersion]: ... @overload async def update( @@ -2556,7 +2678,7 @@ namespace azure.ai.projects.aio.operations content_type: str = "application/json", default_version: str, **kwargs: Any - ) -> ToolboxObject: ... + ) -> SkillDetails: ... @overload async def update( @@ -2566,7 +2688,7 @@ namespace azure.ai.projects.aio.operations *, content_type: str = "application/json", **kwargs: Any - ) -> ToolboxObject: ... + ) -> SkillDetails: ... @overload async def update( @@ -2576,884 +2698,792 @@ namespace azure.ai.projects.aio.operations *, content_type: str = "application/json", **kwargs: Any - ) -> ToolboxObject: ... - + ) -> SkillDetails: ... -namespace azure.ai.projects.models - class azure.ai.projects.models.A2APreviewTool(Tool, discriminator='a2a_preview'): - agent_card_path: Optional[str] - base_url: Optional[str] - project_connection_id: Optional[str] - send_credentials_for_agent_card: Optional[bool] - type: Literal[ToolType.A2A_PREVIEW] + class azure.ai.projects.aio.operations.ConnectionsOperations(ConnectionsOperationsGenerated): - @overload def __init__( self, - *, - agent_card_path: Optional[str] = ..., - base_url: Optional[str] = ..., - project_connection_id: Optional[str] = ..., - send_credentials_for_agent_card: Optional[bool] = ... + *args, + **kwargs ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.A2APreviewToolboxTool(ToolboxTool, discriminator='a2a_preview'): - agent_card_path: Optional[str] - base_url: Optional[str] - description: str - name: str - project_connection_id: Optional[str] - send_credentials_for_agent_card: Optional[bool] - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.A2A_PREVIEW] - - @overload - def __init__( + @distributed_trace_async + async def get( self, + name: str, *, - agent_card_path: Optional[str] = ..., - base_url: Optional[str] = ..., - description: Optional[str] = ..., - name: Optional[str] = ..., - project_connection_id: Optional[str] = ..., - send_credentials_for_agent_card: Optional[bool] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.A2AProtocolConfiguration(_Model): + include_credentials: Optional[bool] = False, + **kwargs: Any + ) -> Connection: ... + @distributed_trace_async + async def get_default( + self, + connection_type: Union[str, ConnectionType], + *, + include_credentials: Optional[bool] = False, + **kwargs: Any + ) -> Connection: ... - class azure.ai.projects.models.A2AProtocolVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): - V1_0 = "1.0" + @distributed_trace + def list( + self, + *, + connection_type: Optional[Union[str, ConnectionType]] = ..., + default_connection: Optional[bool] = ..., + **kwargs: Any + ) -> AsyncItemPaged[Connection]: ... - class azure.ai.projects.models.A2ATool(Tool, discriminator='a2a'): - a2a_version: Union[str, A2AProtocolVersion] - agent_card_path: Optional[str] - base_url: Optional[str] - project_connection_id: Optional[str] - send_credentials_for_agent_card: Optional[bool] - type: Literal[ToolType.A2_A] + class azure.ai.projects.aio.operations.DatasetsOperations(DatasetsOperationsGenerated): - @overload def __init__( self, - *, - a2a_version: Union[str, A2AProtocolVersion], - agent_card_path: Optional[str] = ..., - base_url: Optional[str] = ..., - project_connection_id: Optional[str] = ..., - send_credentials_for_agent_card: Optional[bool] = ... + *args, + **kwargs ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.A2AToolboxTool(ToolboxTool, discriminator='a2a'): - a2a_version: Union[str, A2AProtocolVersion] - agent_card_path: Optional[str] - base_url: Optional[str] - description: str - name: str - project_connection_id: Optional[str] - send_credentials_for_agent_card: Optional[bool] - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.A2_A] + async def create_or_update( + self, + name: str, + version: str, + dataset_version: DatasetVersion, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> DatasetVersion: ... @overload - def __init__( + async def create_or_update( self, + name: str, + version: str, + dataset_version: JSON, *, - a2a_version: Union[str, A2AProtocolVersion], - agent_card_path: Optional[str] = ..., - base_url: Optional[str] = ..., - description: Optional[str] = ..., - name: Optional[str] = ..., - project_connection_id: Optional[str] = ..., - send_credentials_for_agent_card: Optional[bool] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.AISearchIndexResource(_Model): - filter: Optional[str] - index_asset_id: Optional[str] - index_name: Optional[str] - project_connection_id: Optional[str] - query_type: Optional[Union[str, AzureAISearchQueryType]] - top_k: Optional[int] + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> DatasetVersion: ... @overload - def __init__( + async def create_or_update( self, + name: str, + version: str, + dataset_version: IO[bytes], *, - filter: Optional[str] = ..., - index_asset_id: Optional[str] = ..., - index_name: Optional[str] = ..., - project_connection_id: Optional[str] = ..., - query_type: Optional[Union[str, AzureAISearchQueryType]] = ..., - top_k: Optional[int] = ... - ) -> None: ... + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> DatasetVersion: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @distributed_trace_async + async def delete( + self, + name: str, + version: str, + **kwargs: Any + ) -> None: ... + @distributed_trace_async + async def get( + self, + name: str, + version: str, + **kwargs: Any + ) -> DatasetVersion: ... - class azure.ai.projects.models.ActivityProtocolAccessBoundary(str, Enum, metaclass=CaseInsensitiveEnumMeta): - READ1_ON1_ALLOWLISTED = "read.1on1.allowlisted" - READ1_ON1_DEVELOPERS = "read.1on1.developers" - READ1_ON1_MANAGER = "read.1on1.manager" - READ1_ON1_TENANT = "read.1on1.tenant" - READ_GROUP_ALLOWLISTED = "read.group.allowlisted" - READ_GROUP_DEVELOPERS = "read.group.developers" - READ_GROUP_MANAGER_INVITED = "read.group.manager-invited" - READ_GROUP_MANAGER_PRESENT = "read.group.manager-present" - READ_GROUP_TENANT = "read.group.tenant" - WRITE1_ON1_ALLOWLISTED = "write.1on1.allowlisted" - WRITE1_ON1_DEVELOPERS = "write.1on1.developers" - WRITE1_ON1_MANAGER = "write.1on1.manager" - WRITE1_ON1_TENANT = "write.1on1.tenant" - WRITE_GROUP_ALLOWLISTED = "write.group.allowlisted" - WRITE_GROUP_DEVELOPERS = "write.group.developers" - WRITE_GROUP_MANAGER_INVITED = "write.group.manager-invited" - WRITE_GROUP_MANAGER_PRESENT = "write.group.manager-present" - WRITE_GROUP_TENANT = "write.group.tenant" + @distributed_trace_async + async def get_credentials( + self, + name: str, + version: str, + **kwargs: Any + ) -> DatasetCredential: ... + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[DatasetVersion]: ... - class azure.ai.projects.models.ActivityProtocolConfiguration(_Model): - access_boundaries: Optional[list[Union[str, ActivityProtocolAccessBoundary]]] - enable_m365_public_endpoint: Optional[bool] + @distributed_trace + def list_versions( + self, + name: str, + **kwargs: Any + ) -> AsyncItemPaged[DatasetVersion]: ... @overload - def __init__( + async def pending_upload( self, + name: str, + version: str, + pending_upload_request: PendingUploadRequest, *, - enable_m365_public_endpoint: Optional[bool] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.AgentBlueprintReference(_Model): - type: str + content_type: str = "application/json", + **kwargs: Any + ) -> PendingUploadResponse: ... @overload - def __init__( + async def pending_upload( self, + name: str, + version: str, + pending_upload_request: JSON, *, - type: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.AgentBlueprintReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - MANAGED_AGENT_IDENTITY_BLUEPRINT = "ManagedAgentIdentityBlueprint" - - - class azure.ai.projects.models.AgentCard(_Model): - description: Optional[str] - skills: list[AgentCardSkill] - version: str + content_type: str = "application/json", + **kwargs: Any + ) -> PendingUploadResponse: ... @overload - def __init__( + async def pending_upload( self, + name: str, + version: str, + pending_upload_request: IO[bytes], *, - description: Optional[str] = ..., - skills: list[AgentCardSkill], - version: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.AgentCardSkill(_Model): - description: Optional[str] - examples: Optional[list[str]] - id: str - name: str - tags: Optional[list[str]] + content_type: str = "application/json", + **kwargs: Any + ) -> PendingUploadResponse: ... - @overload - def __init__( + @distributed_trace_async + async def upload_file( self, *, - description: Optional[str] = ..., - examples: Optional[list[str]] = ..., - id: str, + connection_name: Optional[str] = ..., + file_path: str, name: str, - tags: Optional[list[str]] = ... - ) -> None: ... + version: str, + **kwargs: Any + ) -> FileDatasetVersion: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @distributed_trace_async + async def upload_folder( + self, + *, + connection_name: Optional[str] = ..., + file_pattern: Optional[Pattern] = ..., + folder: str, + name: str, + version: str, + **kwargs: Any + ) -> FolderDatasetVersion: ... - class azure.ai.projects.models.AgentClusterInsightRequest(InsightRequest, discriminator='AgentClusterInsight'): - agent_name: str - model_configuration: Optional[InsightModelConfiguration] - type: Literal[InsightType.AGENT_CLUSTER_INSIGHT] + class azure.ai.projects.aio.operations.DeploymentsOperations: - @overload def __init__( self, - *, - agent_name: str, - model_configuration: Optional[InsightModelConfiguration] = ... + *args, + **kwargs ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.AgentClusterInsightResult(InsightResult, discriminator='AgentClusterInsight'): - cluster_insight: ClusterInsightResult - type: Literal[InsightType.AGENT_CLUSTER_INSIGHT] + @distributed_trace_async + async def get( + self, + name: str, + **kwargs: Any + ) -> Deployment: ... - @overload - def __init__( + @distributed_trace + def list( self, *, - cluster_insight: ClusterInsightResult - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + deployment_type: Optional[Union[str, DeploymentType]] = ..., + model_name: Optional[str] = ..., + model_publisher: Optional[str] = ..., + **kwargs: Any + ) -> AsyncItemPaged[Deployment]: ... - class azure.ai.projects.models.AgentDataGenerationJobSource(DataGenerationJobSource, discriminator='agent'): - agent_name: str - agent_version: Optional[str] - description: str - type: Literal[DataGenerationJobSourceType.AGENT] + class azure.ai.projects.aio.operations.EvaluationRulesOperations(GeneratedEvaluationRulesOperations): - @overload def __init__( self, - *, - agent_name: str, - agent_version: Optional[str] = ..., - description: Optional[str] = ... + *args, + **kwargs ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.AgentDefinition(_Model): - kind: str - rai_config: Optional[RaiConfig] + async def create_or_update( + self, + id: str, + evaluation_rule: EvaluationRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationRule: ... @overload - def __init__( + async def create_or_update( self, + id: str, + evaluation_rule: JSON, *, - kind: str, - rai_config: Optional[RaiConfig] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationRule: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.AgentDetails(_Model): - agent_card: Optional[AgentCard] - agent_endpoint: Optional[AgentEndpointConfig] - blueprint: Optional[AgentIdentity] - blueprint_reference: Optional[AgentBlueprintReference] - digital_worker_type: Optional[Union[str, DigitalWorkerType]] - id: str - instance_identity: Optional[AgentIdentity] - name: str - object: Literal[AgentObjectType.AGENT] - state: Union[str, AgentState] - state_source: Optional[Union[str, AgentStateSource]] - versions: AgentObjectVersions - - @overload - def __init__( + async def create_or_update( self, + id: str, + evaluation_rule: IO[bytes], *, - agent_card: Optional[AgentCard] = ..., - agent_endpoint: Optional[AgentEndpointConfig] = ..., - digital_worker_type: Optional[Union[str, DigitalWorkerType]] = ..., + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationRule: ... + + @distributed_trace_async + async def delete( + self, id: str, - name: str, - object: Literal[AgentObjectType.AGENT], - versions: AgentObjectVersions + **kwargs: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.AgentEndpointAuthorizationScheme(_Model): - type: str + @distributed_trace_async + async def get( + self, + id: str, + **kwargs: Any + ) -> EvaluationRule: ... - @overload - def __init__( + @distributed_trace + def list( self, *, - type: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.AgentEndpointAuthorizationSchemeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - BOT_SERVICE = "BotService" - BOT_SERVICE_RBAC = "BotServiceRbac" - BOT_SERVICE_TENANT = "BotServiceTenant" - ENTRA = "Entra" + action_type: Optional[Union[str, EvaluationRuleActionType]] = ..., + agent_name: Optional[str] = ..., + enabled: Optional[bool] = ..., + **kwargs: Any + ) -> AsyncItemPaged[EvaluationRule]: ... - class azure.ai.projects.models.AgentEndpointConfig(_Model): - authorization_schemes: Optional[list[AgentEndpointAuthorizationScheme]] - protocol_configuration: Optional[ProtocolConfiguration] - publish_approval_status: Optional[Union[str, PublishApprovalStatus]] - version_selector: Optional[VersionSelector] + class azure.ai.projects.aio.operations.IndexesOperations: - @overload def __init__( self, - *, - authorization_schemes: Optional[list[AgentEndpointAuthorizationScheme]] = ..., - protocol_configuration: Optional[ProtocolConfiguration] = ..., - version_selector: Optional[VersionSelector] = ... + *args, + **kwargs ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.AgentEndpointProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - A2A = "a2a" - ACTIVITY = "activity" - INVOCATIONS = "invocations" - INVOCATIONS_WS = "invocations_ws" - MCP = "mcp" - RESPONSES = "responses" - VOICE = "voice" - - - class azure.ai.projects.models.AgentEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator='agent'): - agent_name: str - agent_version: Optional[str] - description: Optional[str] - type: Literal[EvaluatorGenerationJobSourceType.AGENT] - - @overload - def __init__( + async def create_or_update( self, + name: str, + version: str, + index: Index, *, - agent_name: str, - agent_version: Optional[str] = ..., - description: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.AgentIdentity(_Model): - client_id: str - principal_id: str - status: Optional[Union[str, AgentIdentityStatus]] + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> Index: ... @overload - def __init__( + async def create_or_update( self, + name: str, + version: str, + index: JSON, *, - client_id: str, - principal_id: str, - status: Optional[Union[str, AgentIdentityStatus]] = ... - ) -> None: ... + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> Index: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + async def create_or_update( + self, + name: str, + version: str, + index: IO[bytes], + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> Index: ... + @distributed_trace_async + async def delete( + self, + name: str, + version: str, + **kwargs: Any + ) -> None: ... - class azure.ai.projects.models.AgentIdentityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ACTIVE = "active" - DISABLED = "disabled" + @distributed_trace_async + async def get( + self, + name: str, + version: str, + **kwargs: Any + ) -> Index: ... + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[Index]: ... - class azure.ai.projects.models.AgentInsight(_Model): - agent_name: str - agent_version: str - category: str - created_at: datetime - description: str - details: Optional[AgentInsightDetails] - id: str - monitor_id: str - severity: Union[str, AgentInsightSeverity] - status: Union[str, AgentInsightStatus] - title: str - trace_count: int - updated_at: datetime + @distributed_trace + def list_versions( + self, + name: str, + **kwargs: Any + ) -> AsyncItemPaged[Index]: ... - class azure.ai.projects.models.AgentInsightDetails(_Model): - highlighted_traces: list[AgentInsightHighlightedTrace] - linked_traces: list[AgentInsightLinkedTrace] - recommended_actions: AgentInsightRecommendedAction + class azure.ai.projects.aio.operations.TelemetryOperations: - @overload - def __init__( - self, - *, - highlighted_traces: list[AgentInsightHighlightedTrace], - linked_traces: list[AgentInsightLinkedTrace], - recommended_actions: AgentInsightRecommendedAction - ) -> None: ... + def __init__(self, outer_instance: AIProjectClient) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @distributed_trace_async + async def get_application_insights_connection_string(self) -> str: ... - class azure.ai.projects.models.AgentInsightEstimatedCost(_Model): - amount: float - currency: Literal["USD"] + class azure.ai.projects.aio.operations.ToolboxesOperations: - @overload def __init__( self, - *, - amount: float + *args, + **kwargs ) -> None: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.AgentInsightHighlightedTrace(_Model): - duration_ms: timedelta - summary: str - timestamp: datetime - total_tokens: Optional[int] - trace_id: str + async def create_version( + self, + name: str, + *, + content_type: str = "application/json", + description: Optional[str] = ..., + metadata: Optional[dict[str, str]] = ..., + policies: Optional[ToolboxPolicies] = ..., + skills: Optional[List[ToolboxSkill]] = ..., + tools: List[ToolboxTool], + **kwargs: Any + ) -> ToolboxVersionObject: ... @overload - def __init__( + async def create_version( self, + name: str, + body: JSON, *, - duration_ms: timedelta, - summary: str, - timestamp: datetime, - total_tokens: Optional[int] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> ToolboxVersionObject: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + async def create_version( + self, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ToolboxVersionObject: ... + @distributed_trace_async + async def delete( + self, + name: str, + **kwargs: Any + ) -> None: ... - class azure.ai.projects.models.AgentInsightLinkedTrace(_Model): - timestamp: datetime - trace_id: str - + @distributed_trace_async + async def delete_version( + self, + name: str, + version: str, + **kwargs: Any + ) -> None: ... - class azure.ai.projects.models.AgentInsightMonitor(_Model): - agent_name: str - enabled: bool - estimated_cost: Optional[AgentInsightEstimatedCost] - id: str - model_deployment_name: str - next_scheduled_run_at: Optional[datetime] - overview: AgentInsightsOverview - run_interval_hours: float - suspension: AgentInsightSuspension - updated_at: datetime + @distributed_trace_async + async def get( + self, + name: str, + **kwargs: Any + ) -> ToolboxObject: ... + @distributed_trace_async + async def get_version( + self, + name: str, + version: str, + **kwargs: Any + ) -> ToolboxVersionObject: ... - class azure.ai.projects.models.AgentInsightMonitorCreate(_Model): - agent_name: str - enabled: Optional[bool] - model_deployment_name: str - run_interval_hours: Optional[float] + @distributed_trace + def list( + self, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[ToolboxObject]: ... - @overload - def __init__( + @distributed_trace + def list_versions( self, + name: str, *, - agent_name: str, - enabled: Optional[bool] = ..., - model_deployment_name: str, - run_interval_hours: Optional[float] = ... - ) -> None: ... + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[ToolboxVersionObject]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.AgentInsightMonitorListItem(_Model): - agent_name: str - enabled: bool - estimated_cost: Optional[AgentInsightEstimatedCost] - id: str - model_deployment_name: str - next_scheduled_run_at: Optional[datetime] - run_interval_hours: float - suspension: AgentInsightSuspension - updated_at: datetime - - - class azure.ai.projects.models.AgentInsightMonitorUpdate(_Model): - enabled: Optional[bool] - model_deployment_name: Optional[str] - overview_override: Optional[AgentInsightsOverviewOverride] - run_interval_hours: Optional[float] + async def update( + self, + name: str, + *, + content_type: str = "application/json", + default_version: str, + **kwargs: Any + ) -> ToolboxObject: ... @overload - def __init__( + async def update( self, + name: str, + body: JSON, *, - enabled: Optional[bool] = ..., - model_deployment_name: Optional[str] = ..., - overview_override: Optional[AgentInsightsOverviewOverride] = ..., - run_interval_hours: Optional[float] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> ToolboxObject: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.AgentInsightOverviewSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): - GENERATED = "generated" - USER_OVERRIDE = "user_override" - + async def update( + self, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ToolboxObject: ... - class azure.ai.projects.models.AgentInsightPromptSurface(str, Enum, metaclass=CaseInsensitiveEnumMeta): - INSTRUCTIONS = "instructions" - TOOL = "tool" +namespace azure.ai.projects.models - class azure.ai.projects.models.AgentInsightProposedFix(_Model): - changes: Optional[list[AgentInsightProposedFixChange]] - kind: Union[str, AgentInsightProposedFixKind] - text: str + class azure.ai.projects.models.A2APreviewTool(Tool, discriminator='a2a_preview'): + agent_card_path: Optional[str] + base_url: Optional[str] + project_connection_id: Optional[str] + send_credentials_for_agent_card: Optional[bool] + type: Literal[ToolType.A2A_PREVIEW] @overload def __init__( self, *, - changes: Optional[list[AgentInsightProposedFixChange]] = ..., - kind: Union[str, AgentInsightProposedFixKind], - text: str + agent_card_path: Optional[str] = ..., + base_url: Optional[str] = ..., + project_connection_id: Optional[str] = ..., + send_credentials_for_agent_card: Optional[bool] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentInsightProposedFixChange(_Model): - diff: Optional[str] - language: Optional[str] - new_value: Optional[Any] - old_value: Optional[Any] - path: Optional[str] - surface: Optional[Union[str, AgentInsightPromptSurface]] - target: Optional[str] + class azure.ai.projects.models.A2APreviewToolboxTool(ToolboxTool, discriminator='a2a_preview'): + agent_card_path: Optional[str] + base_url: Optional[str] + description: str + name: str + project_connection_id: Optional[str] + send_credentials_for_agent_card: Optional[bool] + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.A2A_PREVIEW] @overload def __init__( self, *, - diff: Optional[str] = ..., - language: Optional[str] = ..., - new_value: Optional[Any] = ..., - old_value: Optional[Any] = ..., - path: Optional[str] = ..., - surface: Optional[Union[str, AgentInsightPromptSurface]] = ..., - target: Optional[str] = ... + agent_card_path: Optional[str] = ..., + base_url: Optional[str] = ..., + description: Optional[str] = ..., + name: Optional[str] = ..., + project_connection_id: Optional[str] = ..., + send_credentials_for_agent_card: Optional[bool] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentInsightProposedFixKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CODE_CHANGE = "code_change" - PROMPT_CHANGE = "prompt_change" - PROSE = "prose" + class azure.ai.projects.models.A2AProtocolConfiguration(_Model): - class azure.ai.projects.models.AgentInsightRecommendedAction(_Model): - proposed_fix: AgentInsightProposedFix + class azure.ai.projects.models.A2AProtocolVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): + V1_0 = "1.0" + + + class azure.ai.projects.models.A2ATool(Tool, discriminator='a2a'): + a2a_version: Union[str, A2AProtocolVersion] + agent_card_path: Optional[str] + base_url: Optional[str] + project_connection_id: Optional[str] + send_credentials_for_agent_card: Optional[bool] + type: Literal[ToolType.A2_A] @overload def __init__( self, *, - proposed_fix: AgentInsightProposedFix + a2a_version: Union[str, A2AProtocolVersion], + agent_card_path: Optional[str] = ..., + base_url: Optional[str] = ..., + project_connection_id: Optional[str] = ..., + send_credentials_for_agent_card: Optional[bool] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentInsightRun(_Model): - agent_name: str - completed_at: Optional[datetime] - created_at: datetime - error: Optional[ApiError] - id: str - inputs: Optional[AgentInsightRunCreate] - model_deployment_name: str - monitor_id: str - result: Optional[AgentInsightRunResult] - started_at: Optional[datetime] - status: Union[str, JobStatus] - trigger: Union[str, AgentInsightRunTrigger] - updated_at: datetime - window_end: datetime - window_start: datetime + class azure.ai.projects.models.A2AToolboxTool(ToolboxTool, discriminator='a2a'): + a2a_version: Union[str, A2AProtocolVersion] + agent_card_path: Optional[str] + base_url: Optional[str] + description: str + name: str + project_connection_id: Optional[str] + send_credentials_for_agent_card: Optional[bool] + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.A2_A] @overload def __init__( self, *, - inputs: Optional[AgentInsightRunCreate] = ... + a2a_version: Union[str, A2AProtocolVersion], + agent_card_path: Optional[str] = ..., + base_url: Optional[str] = ..., + description: Optional[str] = ..., + name: Optional[str] = ..., + project_connection_id: Optional[str] = ..., + send_credentials_for_agent_card: Optional[bool] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentInsightRunCreate(_Model): - lookback_hours: Optional[float] + class azure.ai.projects.models.AISearchIndexResource(_Model): + filter: Optional[str] + index_asset_id: Optional[str] + index_name: Optional[str] + project_connection_id: Optional[str] + query_type: Optional[Union[str, AzureAISearchQueryType]] + top_k: Optional[int] @overload def __init__( self, *, - lookback_hours: Optional[float] = ... + filter: Optional[str] = ..., + index_asset_id: Optional[str] = ..., + index_name: Optional[str] = ..., + project_connection_id: Optional[str] = ..., + query_type: Optional[Union[str, AzureAISearchQueryType]] = ..., + top_k: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentInsightRunResult(_Model): - insights_created: int - insights_reopened: int - insights_updated: int - token_usage: AgentInsightTokenUsage - traces_analyzed: int - traces_in_window: int - - @overload - def __init__( + class azure.ai.projects.models.ActivityProtocolAccessBoundary(str, Enum, metaclass=CaseInsensitiveEnumMeta): + READ1_ON1_ALLOWLISTED = "read.1on1.allowlisted" + READ1_ON1_DEVELOPERS = "read.1on1.developers" + READ1_ON1_MANAGER = "read.1on1.manager" + READ1_ON1_TENANT = "read.1on1.tenant" + READ_GROUP_ALLOWLISTED = "read.group.allowlisted" + READ_GROUP_DEVELOPERS = "read.group.developers" + READ_GROUP_MANAGER_INVITED = "read.group.manager-invited" + READ_GROUP_MANAGER_PRESENT = "read.group.manager-present" + READ_GROUP_TENANT = "read.group.tenant" + WRITE1_ON1_ALLOWLISTED = "write.1on1.allowlisted" + WRITE1_ON1_DEVELOPERS = "write.1on1.developers" + WRITE1_ON1_MANAGER = "write.1on1.manager" + WRITE1_ON1_TENANT = "write.1on1.tenant" + WRITE_GROUP_ALLOWLISTED = "write.group.allowlisted" + WRITE_GROUP_DEVELOPERS = "write.group.developers" + WRITE_GROUP_MANAGER_INVITED = "write.group.manager-invited" + WRITE_GROUP_MANAGER_PRESENT = "write.group.manager-present" + WRITE_GROUP_TENANT = "write.group.tenant" + + + class azure.ai.projects.models.ActivityProtocolConfiguration(_Model): + access_boundaries: Optional[list[Union[str, ActivityProtocolAccessBoundary]]] + enable_m365_public_endpoint: Optional[bool] + + @overload + def __init__( self, *, - insights_created: int, - insights_reopened: int, - insights_updated: int, - token_usage: AgentInsightTokenUsage, - traces_analyzed: int, - traces_in_window: int + enable_m365_public_endpoint: Optional[bool] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentInsightRunTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ON_DEMAND = "on_demand" - SCHEDULED = "scheduled" - - - class azure.ai.projects.models.AgentInsightSeverity(str, Enum, metaclass=CaseInsensitiveEnumMeta): - HIGH = "high" - LOW = "low" - MEDIUM = "medium" - - - class azure.ai.projects.models.AgentInsightStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ACTIVE = "active" - IGNORED = "ignored" - RESOLVED = "resolved" - - - class azure.ai.projects.models.AgentInsightSuspension(_Model): - code: str - details: Optional[dict[str, Any]] - message: str - occurred_at: datetime + class azure.ai.projects.models.AgentBlueprintReference(_Model): + type: str @overload def __init__( self, *, - code: str, - details: Optional[dict[str, Any]] = ..., - message: str, - occurred_at: datetime + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentInsightTokenUsage(_Model): - cached_tokens: Optional[int] - input_tokens: int - output_tokens: int - total_tokens: int + class azure.ai.projects.models.AgentBlueprintReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MANAGED_AGENT_IDENTITY_BLUEPRINT = "ManagedAgentIdentityBlueprint" + + + class azure.ai.projects.models.AgentCard(_Model): + description: Optional[str] + skills: list[AgentCardSkill] + version: str @overload def __init__( self, *, - cached_tokens: Optional[int] = ..., - input_tokens: int, - output_tokens: int, - total_tokens: int + description: Optional[str] = ..., + skills: list[AgentCardSkill], + version: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentInsightUpdate(_Model): - status: Optional[Union[str, AgentInsightStatus]] + class azure.ai.projects.models.AgentCardSkill(_Model): + description: Optional[str] + examples: Optional[list[str]] + id: str + name: str + tags: Optional[list[str]] @overload def __init__( self, *, - status: Optional[Union[str, AgentInsightStatus]] = ... + description: Optional[str] = ..., + examples: Optional[list[str]] = ..., + id: str, + name: str, + tags: Optional[list[str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentInsightsOverview(_Model): - content: str - source: Union[str, AgentInsightOverviewSource] - updated_at: datetime + class azure.ai.projects.models.AgentClusterInsightRequest(InsightRequest, discriminator='AgentClusterInsight'): + agent_name: str + model_configuration: Optional[InsightModelConfiguration] + type: Literal[InsightType.AGENT_CLUSTER_INSIGHT] @overload def __init__( self, *, - content: str, - source: Union[str, AgentInsightOverviewSource], - updated_at: datetime + agent_name: str, + model_configuration: Optional[InsightModelConfiguration] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentInsightsOverviewOverride(_Model): - content: str + class azure.ai.projects.models.AgentClusterInsightResult(InsightResult, discriminator='AgentClusterInsight'): + cluster_insight: ClusterInsightResult + type: Literal[InsightType.AGENT_CLUSTER_INSIGHT] @overload def __init__( self, *, - content: str + cluster_insight: ClusterInsightResult ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - EXTERNAL = "external" - HOSTED = "hosted" - PROMPT = "prompt" - VOICE = "voice" - WORKFLOW = "workflow" - - - class azure.ai.projects.models.AgentObjectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENT = "agent" - AGENT_CONTAINER = "agent.container" - AGENT_DELETED = "agent.deleted" - AGENT_VERSION = "agent.version" - AGENT_VERSION_DELETED = "agent.version.deleted" - - - class azure.ai.projects.models.AgentObjectVersions(_Model): - latest: AgentVersionDetails + class azure.ai.projects.models.AgentDataGenerationJobSource(DataGenerationJobSource, discriminator='agent'): + agent_name: str + agent_version: Optional[str] + description: str + type: Literal[DataGenerationJobSourceType.AGENT] @overload def __init__( self, *, - latest: AgentVersionDetails + agent_name: str, + agent_version: Optional[str] = ..., + description: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentOptimizationCandidate(_Model): - avg_score: float - avg_tokens: float - candidate_id: Optional[str] - eval_id: Optional[str] - eval_run_id: Optional[str] - mutations: Optional[dict[str, Any]] - name: str - promotion: Optional[PromotionInfo] + class azure.ai.projects.models.AgentDefinition(_Model): + kind: str + rai_config: Optional[RaiConfig] @overload def __init__( self, *, - avg_score: float, - avg_tokens: float, - candidate_id: Optional[str] = ..., - eval_id: Optional[str] = ..., - eval_run_id: Optional[str] = ..., - mutations: Optional[dict[str, Any]] = ..., - name: str, - promotion: Optional[PromotionInfo] = ... + kind: str, + rai_config: Optional[RaiConfig] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentOptimizationDatasetCriterion(_Model): - instruction: str + class azure.ai.projects.models.AgentDetails(_Model): + agent_card: Optional[AgentCard] + agent_endpoint: Optional[AgentEndpointConfig] + blueprint: Optional[AgentIdentity] + blueprint_reference: Optional[AgentBlueprintReference] + digital_worker_type: Optional[Union[str, DigitalWorkerType]] + id: str + instance_identity: Optional[AgentIdentity] name: str + object: Literal[AgentObjectType.AGENT] + state: Union[str, AgentState] + state_source: Optional[Union[str, AgentStateSource]] + versions: AgentObjectVersions @overload def __init__( self, *, - instruction: str, - name: str + agent_card: Optional[AgentCard] = ..., + agent_endpoint: Optional[AgentEndpointConfig] = ..., + digital_worker_type: Optional[Union[str, DigitalWorkerType]] = ..., + id: str, + name: str, + object: Literal[AgentObjectType.AGENT], + versions: AgentObjectVersions ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentOptimizationDatasetInput(_Model): + class azure.ai.projects.models.AgentEndpointAuthorizationScheme(_Model): type: str @overload @@ -3467,557 +3497,582 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentOptimizationDatasetInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - INLINE = "inline" - REFERENCE = "reference" + class azure.ai.projects.models.AgentEndpointAuthorizationSchemeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BOT_SERVICE = "BotService" + BOT_SERVICE_RBAC = "BotServiceRbac" + BOT_SERVICE_TENANT = "BotServiceTenant" + ENTRA = "Entra" - class azure.ai.projects.models.AgentOptimizationDatasetItem(_Model): - criteria: Optional[list[AgentOptimizationDatasetCriterion]] - desired_num_turns: Optional[int] - ground_truth: Optional[str] - query: Optional[str] + class azure.ai.projects.models.AgentEndpointConfig(_Model): + authorization_schemes: Optional[list[AgentEndpointAuthorizationScheme]] + protocol_configuration: Optional[ProtocolConfiguration] + publish_approval_status: Optional[Union[str, PublishApprovalStatus]] + version_selector: Optional[VersionSelector] @overload def __init__( self, *, - criteria: Optional[list[AgentOptimizationDatasetCriterion]] = ..., - desired_num_turns: Optional[int] = ..., - ground_truth: Optional[str] = ..., - query: Optional[str] = ... + authorization_schemes: Optional[list[AgentEndpointAuthorizationScheme]] = ..., + protocol_configuration: Optional[ProtocolConfiguration] = ..., + version_selector: Optional[VersionSelector] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentOptimizationEvaluatorRef(_Model): - name: str - version: Optional[str] + class azure.ai.projects.models.AgentEndpointProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + A2A = "a2a" + ACTIVITY = "activity" + INVOCATIONS = "invocations" + INVOCATIONS_WS = "invocations_ws" + MCP = "mcp" + RESPONSES = "responses" + VOICE = "voice" + + + class azure.ai.projects.models.AgentEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator='agent'): + agent_name: str + agent_version: Optional[str] + description: Optional[str] + type: Literal[EvaluatorGenerationJobSourceType.AGENT] @overload def __init__( self, *, - name: str, - version: Optional[str] = ... + agent_name: str, + agent_version: Optional[str] = ..., + description: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentOptimizationInlineDatasetInput(AgentOptimizationDatasetInput, discriminator='inline'): - dataset_items: list[AgentOptimizationDatasetItem] - type: Literal[AgentOptimizationDatasetInputType.INLINE] + class azure.ai.projects.models.AgentIdentity(_Model): + client_id: str + principal_id: str + status: Optional[Union[str, AgentIdentityStatus]] @overload def __init__( self, *, - dataset_items: list[AgentOptimizationDatasetItem] + client_id: str, + principal_id: str, + status: Optional[Union[str, AgentIdentityStatus]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentOptimizationJob(_Model): - created_at: datetime - error: Optional[ApiError] - id: str - inputs: Optional[AgentOptimizationJobInputs] - progress: Optional[AgentOptimizationJobProgress] - result: Optional[AgentOptimizationJobResult] - status: Union[str, JobStatus] + class azure.ai.projects.models.AgentIdentityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACTIVE = "active" + DISABLED = "disabled" + + + class azure.ai.projects.models.AgentInsight(_Model): + agent_name: str + agent_version: str + category: str + created_at: datetime + description: str + details: Optional[AgentInsightDetails] + id: str + monitor_id: str + severity: Union[str, AgentInsightSeverity] + status: Union[str, AgentInsightStatus] + title: str + trace_count: int updated_at: datetime - warnings: Optional[list[str]] + + + class azure.ai.projects.models.AgentInsightDetails(_Model): + highlighted_traces: list[AgentInsightHighlightedTrace] + linked_traces: list[AgentInsightLinkedTrace] + recommended_actions: AgentInsightRecommendedAction @overload def __init__( self, *, - inputs: Optional[AgentOptimizationJobInputs] = ... + highlighted_traces: list[AgentInsightHighlightedTrace], + linked_traces: list[AgentInsightLinkedTrace], + recommended_actions: AgentInsightRecommendedAction ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentOptimizationJobInputs(_Model): - agent: OptimizedAgentIdentifier - evaluators: list[AgentOptimizationEvaluatorRef] - options: Optional[AgentOptimizationOptions] - train_dataset: AgentOptimizationDatasetInput - validation_dataset: Optional[AgentOptimizationDatasetInput] + class azure.ai.projects.models.AgentInsightEstimatedCost(_Model): + amount: float + currency: Literal["USD"] @overload def __init__( self, *, - agent: OptimizedAgentIdentifier, - evaluators: list[AgentOptimizationEvaluatorRef], - options: Optional[AgentOptimizationOptions] = ..., - train_dataset: AgentOptimizationDatasetInput, - validation_dataset: Optional[AgentOptimizationDatasetInput] = ... + amount: float ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentOptimizationJobListItem(_Model): - agent: Optional[OptimizedAgentIdentifier] - created_at: datetime - error: Optional[ApiError] - id: str - progress: Optional[AgentOptimizationJobProgress] - status: Union[str, JobStatus] - updated_at: datetime - - - class azure.ai.projects.models.AgentOptimizationJobProgress(_Model): - best_score: float - candidates_completed: int - elapsed_seconds: float + class azure.ai.projects.models.AgentInsightHighlightedTrace(_Model): + duration_ms: timedelta + summary: str + timestamp: datetime + total_tokens: Optional[int] + trace_id: str @overload def __init__( self, *, - best_score: float, - candidates_completed: int, - elapsed_seconds: float + duration_ms: timedelta, + summary: str, + timestamp: datetime, + total_tokens: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentOptimizationJobResult(_Model): - baseline: Optional[str] - best: Optional[str] - candidates: Optional[list[AgentOptimizationCandidate]] + class azure.ai.projects.models.AgentInsightLinkedTrace(_Model): + timestamp: datetime + trace_id: str + + + class azure.ai.projects.models.AgentInsightMonitor(_Model): + agent_name: str + enabled: bool + estimated_cost: Optional[AgentInsightEstimatedCost] + id: str + model_deployment_name: str + next_scheduled_run_at: Optional[datetime] + overview: AgentInsightsOverview + run_interval_hours: float + suspension: AgentInsightSuspension + updated_at: datetime + + + class azure.ai.projects.models.AgentInsightMonitorCreate(_Model): + agent_name: str + enabled: Optional[bool] + model_deployment_name: str + run_interval_hours: Optional[float] @overload def __init__( self, *, - baseline: Optional[str] = ..., - best: Optional[str] = ..., - candidates: Optional[list[AgentOptimizationCandidate]] = ... + agent_name: str, + enabled: Optional[bool] = ..., + model_deployment_name: str, + run_interval_hours: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentOptimizationLROPoller(LROPoller[AgentOptimizationJobResult]): - property details: Mapping[str, Any] # Read-only - - def __init__( - self, - client: Any, - initial_response: Any, - deserialization_callback: Any, - polling_method: Any - ) -> None: ... - - @classmethod - def from_continuation_token( - cls, - polling_method: PollingMethod[AgentOptimizationJobResult], - continuation_token: str, - **kwargs: Any - ) -> AgentOptimizationLROPoller: ... + class azure.ai.projects.models.AgentInsightMonitorListItem(_Model): + agent_name: str + enabled: bool + estimated_cost: Optional[AgentInsightEstimatedCost] + id: str + model_deployment_name: str + next_scheduled_run_at: Optional[datetime] + run_interval_hours: float + suspension: AgentInsightSuspension + updated_at: datetime - class azure.ai.projects.models.AgentOptimizationOptions(_Model): - eval_model: Optional[str] - evaluation_level: Optional[Union[str, EvaluationLevel]] - max_candidates: Optional[int] - max_stalls: Optional[int] - optimization_config: Optional[dict[str, Any]] - optimization_model: Optional[str] + class azure.ai.projects.models.AgentInsightMonitorUpdate(_Model): + enabled: Optional[bool] + model_deployment_name: Optional[str] + overview_override: Optional[AgentInsightsOverviewOverride] + run_interval_hours: Optional[float] @overload def __init__( self, *, - eval_model: Optional[str] = ..., - evaluation_level: Optional[Union[str, EvaluationLevel]] = ..., - max_candidates: Optional[int] = ..., - max_stalls: Optional[int] = ..., - optimization_config: Optional[dict[str, Any]] = ..., - optimization_model: Optional[str] = ... + enabled: Optional[bool] = ..., + model_deployment_name: Optional[str] = ..., + overview_override: Optional[AgentInsightsOverviewOverride] = ..., + run_interval_hours: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentOptimizationReferenceDatasetInput(AgentOptimizationDatasetInput, discriminator='reference'): - name: str - type: Literal[AgentOptimizationDatasetInputType.REFERENCE] - version: Optional[str] + class azure.ai.projects.models.AgentInsightOverviewSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + GENERATED = "generated" + USER_OVERRIDE = "user_override" + + + class azure.ai.projects.models.AgentInsightPromptSurface(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INSTRUCTIONS = "instructions" + TOOL = "tool" + + + class azure.ai.projects.models.AgentInsightProposedFix(_Model): + changes: Optional[list[AgentInsightProposedFixChange]] + kind: Union[str, AgentInsightProposedFixKind] + text: str @overload def __init__( self, *, - name: str, - version: Optional[str] = ... + changes: Optional[list[AgentInsightProposedFixChange]] = ..., + kind: Union[str, AgentInsightProposedFixKind], + text: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentSessionResource(_Model): - agent_session_id: str - created_at: datetime - expires_at: datetime - last_accessed_at: datetime - status: Union[str, AgentSessionStatus] - version_indicator: VersionIndicator + class azure.ai.projects.models.AgentInsightProposedFixChange(_Model): + diff: Optional[str] + language: Optional[str] + new_value: Optional[Any] + old_value: Optional[Any] + path: Optional[str] + surface: Optional[Union[str, AgentInsightPromptSurface]] + target: Optional[str] @overload def __init__( self, *, - agent_session_id: str, - status: Union[str, AgentSessionStatus], - version_indicator: VersionIndicator + diff: Optional[str] = ..., + language: Optional[str] = ..., + new_value: Optional[Any] = ..., + old_value: Optional[Any] = ..., + path: Optional[str] = ..., + surface: Optional[Union[str, AgentInsightPromptSurface]] = ..., + target: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentSessionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ACTIVE = "active" - CREATING = "creating" - DELETED = "deleted" - DELETING = "deleting" - EXPIRED = "expired" - FAILED = "failed" - IDLE = "idle" - UPDATING = "updating" - - - class azure.ai.projects.models.AgentState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "disabled" - ENABLED = "enabled" - - - class azure.ai.projects.models.AgentStateSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENT_BLUEPRINT = "agent_blueprint" - AGENT_INSTANCE_IDENTITY = "agent_instance_identity" + class azure.ai.projects.models.AgentInsightProposedFixKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CODE_CHANGE = "code_change" + PROMPT_CHANGE = "prompt_change" + PROSE = "prose" - class azure.ai.projects.models.AgentTaxonomyInput(EvaluationTaxonomyInput, discriminator='agent'): - risk_categories: list[Union[str, RiskCategory]] - target: EvaluationTarget - type: Literal[EvaluationTaxonomyInputType.AGENT] + class azure.ai.projects.models.AgentInsightRecommendedAction(_Model): + proposed_fix: AgentInsightProposedFix @overload def __init__( self, *, - risk_categories: list[Union[str, RiskCategory]], - target: EvaluationTarget + proposed_fix: AgentInsightProposedFix ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentVersionDetails(_Model): - agent_guid: Optional[str] - blueprint: Optional[AgentIdentity] - blueprint_reference: Optional[AgentBlueprintReference] + class azure.ai.projects.models.AgentInsightRun(_Model): + agent_name: str + completed_at: Optional[datetime] created_at: datetime - definition: AgentDefinition - description: Optional[str] - draft: Optional[bool] + error: Optional[ApiError] id: str - instance_identity: Optional[AgentIdentity] - metadata: dict[str, str] - name: str - object: Literal[AgentObjectType.AGENT_VERSION] - status: Optional[Union[str, AgentVersionStatus]] - version: str - - @overload + inputs: Optional[AgentInsightRunCreate] + model_deployment_name: str + monitor_id: str + result: Optional[AgentInsightRunResult] + started_at: Optional[datetime] + status: Union[str, JobStatus] + trigger: Union[str, AgentInsightRunTrigger] + updated_at: datetime + window_end: datetime + window_start: datetime + + @overload def __init__( self, *, - created_at: datetime, - definition: AgentDefinition, - description: Optional[str] = ..., - draft: Optional[bool] = ..., - id: str, - metadata: dict[str, str], - name: str, - object: Literal[AgentObjectType.AGENT_VERSION], - status: Optional[Union[str, AgentVersionStatus]] = ..., - version: str + inputs: Optional[AgentInsightRunCreate] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgentVersionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ACTIVE = "active" - CREATING = "creating" - DELETED = "deleted" - DELETING = "deleting" - FAILED = "failed" + class azure.ai.projects.models.AgentInsightRunCreate(_Model): + lookback_hours: Optional[float] + + @overload + def __init__( + self, + *, + lookback_hours: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AgenticIdentityPreviewCredentials(BaseCredentials, discriminator='AgenticIdentityToken_Preview'): - type: Literal[CredentialType.AGENTIC_IDENTITY_PREVIEW] + class azure.ai.projects.models.AgentInsightRunResult(_Model): + insights_created: int + insights_reopened: int + insights_updated: int + token_usage: AgentInsightTokenUsage + traces_analyzed: int + traces_in_window: int @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + insights_created: int, + insights_reopened: int, + insights_updated: int, + token_usage: AgentInsightTokenUsage, + traces_analyzed: int, + traces_in_window: int + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ApiError(_Model): - additional_info: Optional[dict[str, Any]] + class azure.ai.projects.models.AgentInsightRunTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ON_DEMAND = "on_demand" + SCHEDULED = "scheduled" + + + class azure.ai.projects.models.AgentInsightSeverity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HIGH = "high" + LOW = "low" + MEDIUM = "medium" + + + class azure.ai.projects.models.AgentInsightStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACTIVE = "active" + IGNORED = "ignored" + RESOLVED = "resolved" + + + class azure.ai.projects.models.AgentInsightSuspension(_Model): code: str - debug_info: Optional[dict[str, Any]] - details: Optional[list[ApiError]] + details: Optional[dict[str, Any]] message: str - param: Optional[str] - type: Optional[str] + occurred_at: datetime @overload def __init__( self, *, - additional_info: Optional[dict[str, Any]] = ..., code: str, - debug_info: Optional[dict[str, Any]] = ..., - details: Optional[list[ApiError]] = ..., + details: Optional[dict[str, Any]] = ..., message: str, - param: Optional[str] = ..., - type: Optional[str] = ... + occurred_at: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ApiErrorResponse(_Model): - error: ApiError + class azure.ai.projects.models.AgentInsightTokenUsage(_Model): + cached_tokens: Optional[int] + input_tokens: int + output_tokens: int + total_tokens: int @overload def __init__( self, *, - error: ApiError + cached_tokens: Optional[int] = ..., + input_tokens: int, + output_tokens: int, + total_tokens: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ApiKeyCredentials(BaseCredentials, discriminator='ApiKey'): - api_key: Optional[str] - type: Literal[CredentialType.API_KEY] + class azure.ai.projects.models.AgentInsightUpdate(_Model): + status: Optional[Union[str, AgentInsightStatus]] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + status: Optional[Union[str, AgentInsightStatus]] = ... + ) -> None: ... @overload 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] + class azure.ai.projects.models.AgentInsightsOverview(_Model): + content: str + source: Union[str, AgentInsightOverviewSource] + updated_at: datetime @overload def __init__( self, *, - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ... + content: str, + source: Union[str, AgentInsightOverviewSource], + updated_at: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ApproximateLocation(_Model): - city: Optional[str] - country: Optional[str] - region: Optional[str] - timezone: Optional[str] - type: Literal["approximate"] + class azure.ai.projects.models.AgentInsightsOverviewOverride(_Model): + content: str @overload def __init__( self, *, - city: Optional[str] = ..., - country: Optional[str] = ..., - region: Optional[str] = ..., - timezone: Optional[str] = ... + content: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ArtifactProfile(_Model): - category: Union[str, FoundryModelArtifactProfileCategory] - signals: Optional[list[Union[str, FoundryModelArtifactProfileSignal]]] + class azure.ai.projects.models.AgentKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EXTERNAL = "external" + HOSTED = "hosted" + PROMPT = "prompt" + VOICE = "voice" + WORKFLOW = "workflow" + + + class azure.ai.projects.models.AgentObjectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT = "agent" + AGENT_CONTAINER = "agent.container" + AGENT_DELETED = "agent.deleted" + AGENT_VERSION = "agent.version" + AGENT_VERSION_DELETED = "agent.version.deleted" + + + class azure.ai.projects.models.AgentObjectVersions(_Model): + latest: AgentVersionDetails @overload def __init__( self, *, - category: Union[str, FoundryModelArtifactProfileCategory], - signals: Optional[list[Union[str, FoundryModelArtifactProfileSignal]]] = ... + latest: AgentVersionDetails ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AsyncAgentOptimizationLROPoller(AsyncLROPoller[AgentOptimizationJobResult]): - property details: Mapping[str, Any] # Read-only + class azure.ai.projects.models.AgentOptimizationCandidate(_Model): + avg_score: float + avg_tokens: float + candidate_id: Optional[str] + eval_id: Optional[str] + eval_run_id: Optional[str] + mutations: Optional[dict[str, Any]] + name: str + promotion: Optional[PromotionInfo] + @overload def __init__( self, - client: Any, - initial_response: Any, - deserialization_callback: Any, - polling_method: Any + *, + avg_score: float, + avg_tokens: float, + candidate_id: Optional[str] = ..., + eval_id: Optional[str] = ..., + eval_run_id: Optional[str] = ..., + mutations: Optional[dict[str, Any]] = ..., + name: str, + promotion: Optional[PromotionInfo] = ... ) -> None: ... - @classmethod - def from_continuation_token( - cls, - polling_method: AsyncPollingMethod[AgentOptimizationJobResult], - continuation_token: str, - **kwargs: Any - ) -> AsyncAgentOptimizationLROPoller: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AsyncDatasetGenerationLROPoller(AsyncLROPoller[DataGenerationJobResult]): - property details: Mapping[str, Any] # Read-only + class azure.ai.projects.models.AgentOptimizationDatasetCriterion(_Model): + instruction: str + name: str + @overload def __init__( self, - client: Any, - initial_response: Any, - deserialization_callback: Any, - polling_method: Any + *, + instruction: str, + name: str ) -> None: ... - @classmethod - def from_continuation_token( - cls, - polling_method: AsyncPollingMethod[DataGenerationJobResult], - continuation_token: str, - **kwargs: Any - ) -> AsyncDatasetGenerationLROPoller: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AsyncEvaluatorGenerationLROPoller(AsyncLROPoller[EvaluatorVersion]): - property details: Mapping[str, Any] # Read-only + class azure.ai.projects.models.AgentOptimizationDatasetInput(_Model): + type: str + @overload def __init__( self, - client: Any, - initial_response: Any, - deserialization_callback: Any, - polling_method: Any + *, + type: str ) -> None: ... - @classmethod - def from_continuation_token( - cls, - polling_method: AsyncPollingMethod[EvaluatorVersion], - continuation_token: str, - **kwargs: Any - ) -> AsyncEvaluatorGenerationLROPoller: ... - + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AsyncUpdateMemoriesLROPoller(AsyncLROPoller[MemoryStoreUpdateCompletedResult]): - property superseded_by: Optional[str] # Read-only - property update_id: str # Read-only - @classmethod - def from_continuation_token( - cls, - polling_method: AsyncPollingMethod[MemoryStoreUpdateCompletedResult], - continuation_token: str, - **kwargs: Any - ) -> AsyncUpdateMemoriesLROPoller: ... + class azure.ai.projects.models.AgentOptimizationDatasetInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INLINE = "inline" + REFERENCE = "reference" - class azure.ai.projects.models.AttackStrategy(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ANSI_ATTACK = "ansi_attack" - ASCII_ART = "ascii_art" - ASCII_SMUGGLER = "ascii_smuggler" - ATBASH = "atbash" - BASE64 = "base64" - BASELINE = "baseline" - BINARY = "binary" - CAESAR = "caesar" - CHARACTER_SPACE = "character_space" - CHARACTER_SWAP = "character_swap" - CRESCENDO = "crescendo" - DIACRITIC = "diacritic" - DIFFICULT = "difficult" - EASY = "easy" - FLIP = "flip" - INDIRECT_JAILBREAK = "indirect_jailbreak" - JAILBREAK = "jailbreak" - LEETSPEAK = "leetspeak" - MODERATE = "moderate" - MORSE = "morse" - MULTI_TURN = "multi_turn" - ROT13 = "rot13" - STRING_JOIN = "string_join" - SUFFIX_APPEND = "suffix_append" - TENSE = "tense" - UNICODE_CONFUSABLE = "unicode_confusable" - UNICODE_SUBSTITUTION = "unicode_substitution" - URL = "url" - - - class azure.ai.projects.models.AutoCodeInterpreterToolParam(_Model): - file_ids: Optional[list[str]] - memory_limit: Optional[Union[str, ContainerMemoryLimit]] - network_policy: Optional[ContainerNetworkPolicyParam] - type: Literal["auto"] + class azure.ai.projects.models.AgentOptimizationDatasetItem(_Model): + criteria: Optional[list[AgentOptimizationDatasetCriterion]] + desired_num_turns: Optional[int] + ground_truth: Optional[str] + query: Optional[str] @overload def __init__( self, *, - file_ids: Optional[list[str]] = ..., - memory_limit: Optional[Union[str, ContainerMemoryLimit]] = ..., - network_policy: Optional[ContainerNetworkPolicyParam] = ... + criteria: Optional[list[AgentOptimizationDatasetCriterion]] = ..., + desired_num_turns: Optional[int] = ..., + ground_truth: Optional[str] = ..., + query: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AzureAIAgentTarget(EvaluationTarget, discriminator='azure_ai_agent'): + class azure.ai.projects.models.AgentOptimizationEvaluatorRef(_Model): name: str - tool_descriptions: Optional[list[ToolDescription]] - tools: Optional[list[Tool]] - type: Literal["azure_ai_agent"] version: Optional[str] @overload @@ -4025,8 +4080,6 @@ namespace azure.ai.projects.models self, *, name: str, - tool_descriptions: Optional[list[ToolDescription]] = ..., - tools: Optional[list[Tool]] = ..., version: Optional[str] = ... ) -> None: ... @@ -4034,509 +4087,628 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AzureAIAgentTargetParam(TypedDict, total=False): - key "name": Required[str] - key "tool_descriptions": List[ToolDescriptionParam] - key "type": Required[Literal["azure_ai_agent"]] - key "version": str - - - class azure.ai.projects.models.AzureAIBenchmarkPreviewEvalRunDataSource(TypedDict, total=False): - key "input_messages": InputMessagesItemReference - key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] - key "type": Required[Literal["azure_ai_benchmark_preview"]] - - - class azure.ai.projects.models.AzureAIDataSourceConfig(TypedDict, total=False): - key "scenario": Required[str] - key "type": Required[Literal["azure_ai_source"]] - - - class azure.ai.projects.models.AzureAIModelTarget(EvaluationTarget, discriminator='azure_ai_model'): - model: Optional[str] - sampling_params: Optional[ModelSamplingParams] - type: Literal["azure_ai_model"] + class azure.ai.projects.models.AgentOptimizationInlineDatasetInput(AgentOptimizationDatasetInput, discriminator='inline'): + dataset_items: list[AgentOptimizationDatasetItem] + type: Literal[AgentOptimizationDatasetInputType.INLINE] @overload def __init__( self, *, - model: Optional[str] = ..., - sampling_params: Optional[ModelSamplingParams] = ... + dataset_items: list[AgentOptimizationDatasetItem] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AzureAIModelTargetParam(TypedDict, total=False): - key "model": str - key "sampling_params": ModelSamplingConfigParam - key "type": Required[Literal["azure_ai_model"]] - - - class azure.ai.projects.models.AzureAIResponsesEvalRunDataSource(TypedDict, total=False): - key "event_configuration_id": str - key "item_generation_params": Required[ResponseRetrievalItemGenerationParams] - key "max_runs_hourly": int - key "type": Required[Literal["azure_ai_responses"]] - - - class azure.ai.projects.models.AzureAISearchIndex(Index, discriminator='AzureSearch'): - connection_name: str - description: str - field_mapping: Optional[FieldMapping] + class azure.ai.projects.models.AgentOptimizationJob(_Model): + created_at: datetime + error: Optional[ApiError] id: str - index_name: str - name: str - tags: dict[str, str] - type: Literal[IndexType.AZURE_SEARCH] - version: str + inputs: Optional[AgentOptimizationJobInputs] + progress: Optional[AgentOptimizationJobProgress] + result: Optional[AgentOptimizationJobResult] + status: Union[str, JobStatus] + updated_at: datetime + warnings: Optional[list[str]] @overload def __init__( self, *, - connection_name: str, - description: Optional[str] = ..., - field_mapping: Optional[FieldMapping] = ..., - index_name: str, - tags: Optional[dict[str, str]] = ... + inputs: Optional[AgentOptimizationJobInputs] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AzureAISearchQueryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - SEMANTIC = "semantic" - SIMPLE = "simple" - VECTOR = "vector" - VECTOR_SEMANTIC_HYBRID = "vector_semantic_hybrid" - VECTOR_SIMPLE_HYBRID = "vector_simple_hybrid" - - - class azure.ai.projects.models.AzureAISearchTool(Tool, discriminator='azure_ai_search'): - azure_ai_search: AzureAISearchToolResource - description: Optional[str] - name: Optional[str] - tool_configs: Optional[dict[str, ToolConfig]] - type: Literal[ToolType.AZURE_AI_SEARCH] + class azure.ai.projects.models.AgentOptimizationJobInputs(_Model): + agent: OptimizedAgentIdentifier + evaluators: list[AgentOptimizationEvaluatorRef] + options: Optional[AgentOptimizationOptions] + train_dataset: AgentOptimizationDatasetInput + validation_dataset: Optional[AgentOptimizationDatasetInput] @overload def __init__( self, *, - azure_ai_search: AzureAISearchToolResource, - description: Optional[str] = ..., - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + agent: OptimizedAgentIdentifier, + evaluators: list[AgentOptimizationEvaluatorRef], + options: Optional[AgentOptimizationOptions] = ..., + train_dataset: AgentOptimizationDatasetInput, + validation_dataset: Optional[AgentOptimizationDatasetInput] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AzureAISearchToolResource(_Model): - indexes: list[AISearchIndexResource] + class azure.ai.projects.models.AgentOptimizationJobListItem(_Model): + agent: Optional[OptimizedAgentIdentifier] + created_at: datetime + error: Optional[ApiError] + id: str + progress: Optional[AgentOptimizationJobProgress] + status: Union[str, JobStatus] + updated_at: datetime + + + class azure.ai.projects.models.AgentOptimizationJobProgress(_Model): + best_score: float + candidates_completed: int + elapsed_seconds: float @overload def __init__( self, *, - indexes: list[AISearchIndexResource] + best_score: float, + candidates_completed: int, + elapsed_seconds: float ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AzureAISearchToolboxTool(ToolboxTool, discriminator='azure_ai_search'): - azure_ai_search: AzureAISearchToolResource - description: str - name: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.AZURE_AI_SEARCH] + class azure.ai.projects.models.AgentOptimizationJobResult(_Model): + baseline: Optional[str] + best: Optional[str] + candidates: Optional[list[AgentOptimizationCandidate]] @overload def __init__( self, *, - azure_ai_search: AzureAISearchToolResource, - description: Optional[str] = ..., - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + baseline: Optional[str] = ..., + best: Optional[str] = ..., + candidates: Optional[list[AgentOptimizationCandidate]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AzureFunctionBinding(_Model): - storage_queue: AzureFunctionStorageQueue - type: Literal["storage_queue"] + class azure.ai.projects.models.AgentOptimizationLROPoller(LROPoller[AgentOptimizationJobResult]): + property details: Mapping[str, Any] # Read-only - @overload def __init__( self, - *, - storage_queue: AzureFunctionStorageQueue + client: Any, + initial_response: Any, + deserialization_callback: Any, + polling_method: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @classmethod + def from_continuation_token( + cls, + polling_method: PollingMethod[AgentOptimizationJobResult], + continuation_token: str, + **kwargs: Any + ) -> AgentOptimizationLROPoller: ... - class azure.ai.projects.models.AzureFunctionDefinition(_Model): - function: AzureFunctionDefinitionFunction - input_binding: AzureFunctionBinding - output_binding: AzureFunctionBinding + class azure.ai.projects.models.AgentOptimizationOptions(_Model): + eval_model: Optional[str] + evaluation_level: Optional[Union[str, EvaluationLevel]] + max_candidates: Optional[int] + max_stalls: Optional[int] + optimization_config: Optional[dict[str, Any]] + optimization_model: Optional[str] @overload def __init__( self, *, - function: AzureFunctionDefinitionFunction, - input_binding: AzureFunctionBinding, - output_binding: AzureFunctionBinding + eval_model: Optional[str] = ..., + evaluation_level: Optional[Union[str, EvaluationLevel]] = ..., + max_candidates: Optional[int] = ..., + max_stalls: Optional[int] = ..., + optimization_config: Optional[dict[str, Any]] = ..., + optimization_model: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AzureFunctionDefinitionFunction(_Model): - description: Optional[str] + class azure.ai.projects.models.AgentOptimizationReferenceDatasetInput(AgentOptimizationDatasetInput, discriminator='reference'): name: str - parameters: dict[str, Any] + type: Literal[AgentOptimizationDatasetInputType.REFERENCE] + version: Optional[str] @overload def __init__( self, *, - description: Optional[str] = ..., name: str, - parameters: dict[str, Any] + version: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AzureFunctionStorageQueue(_Model): - queue_name: str - queue_service_endpoint: str + class azure.ai.projects.models.AgentSessionResource(_Model): + agent_session_id: str + created_at: datetime + expires_at: datetime + last_accessed_at: datetime + status: Union[str, AgentSessionStatus] + version_indicator: VersionIndicator @overload def __init__( self, *, - queue_name: str, - queue_service_endpoint: str + agent_session_id: str, + status: Union[str, AgentSessionStatus], + version_indicator: VersionIndicator ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.AzureFunctionTool(Tool, discriminator='azure_function'): - azure_function: AzureFunctionDefinition - tool_configs: Optional[dict[str, ToolConfig]] - type: Literal[ToolType.AZURE_FUNCTION] - - @overload - def __init__( - self, - *, - azure_function: AzureFunctionDefinition, - tool_configs: Optional[dict[str, ToolConfig]] = ... - ) -> None: ... + class azure.ai.projects.models.AgentSessionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACTIVE = "active" + CREATING = "creating" + DELETED = "deleted" + DELETING = "deleting" + EXPIRED = "expired" + FAILED = "failed" + IDLE = "idle" + UPDATING = "updating" - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.AgentState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "disabled" + ENABLED = "enabled" - class azure.ai.projects.models.AzureOpenAIModelConfiguration(RedTeamTargetConfig, discriminator='AzureOpenAIModel'): - model_deployment_name: str - type: Literal["AzureOpenAIModel"] + class azure.ai.projects.models.AgentStateSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT_BLUEPRINT = "agent_blueprint" + AGENT_INSTANCE_IDENTITY = "agent_instance_identity" + + + class azure.ai.projects.models.AgentTaxonomyInput(EvaluationTaxonomyInput, discriminator='agent'): + risk_categories: list[Union[str, RiskCategory]] + target: EvaluationTarget + type: Literal[EvaluationTaxonomyInputType.AGENT] @overload def __init__( self, *, - model_deployment_name: str + risk_categories: list[Union[str, RiskCategory]], + target: EvaluationTarget ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.BaseCredentials(_Model): - type: str + class azure.ai.projects.models.AgentVersionDetails(_Model): + agent_guid: Optional[str] + blueprint: Optional[AgentIdentity] + blueprint_reference: Optional[AgentBlueprintReference] + created_at: datetime + definition: AgentDefinition + description: Optional[str] + draft: Optional[bool] + id: str + instance_identity: Optional[AgentIdentity] + metadata: dict[str, str] + name: str + object: Literal[AgentObjectType.AGENT_VERSION] + status: Optional[Union[str, AgentVersionStatus]] + version: str @overload def __init__( self, *, - type: str + created_at: datetime, + definition: AgentDefinition, + description: Optional[str] = ..., + draft: Optional[bool] = ..., + id: str, + metadata: dict[str, str], + name: str, + object: Literal[AgentObjectType.AGENT_VERSION], + status: Optional[Union[str, AgentVersionStatus]] = ..., + version: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.BingCustomSearchConfiguration(_Model): - count: Optional[int] - freshness: Optional[str] - instance_name: str - market: Optional[str] - project_connection_id: str - set_lang: Optional[str] + class azure.ai.projects.models.AgentVersionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACTIVE = "active" + CREATING = "creating" + DELETED = "deleted" + DELETING = "deleting" + FAILED = "failed" + + + class azure.ai.projects.models.AgenticIdentityPreviewCredentials(BaseCredentials, discriminator='AgenticIdentityToken_Preview'): + type: Literal[CredentialType.AGENTIC_IDENTITY_PREVIEW] @overload - def __init__( - self, - *, - count: Optional[int] = ..., - freshness: Optional[str] = ..., - instance_name: str, - market: Optional[str] = ..., - project_connection_id: str, - set_lang: Optional[str] = ... - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.BingCustomSearchPreviewTool(Tool, discriminator='bing_custom_search_preview'): - bing_custom_search_preview: BingCustomSearchToolParameters - type: Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW] + class azure.ai.projects.models.ApiError(_Model): + additional_info: Optional[dict[str, Any]] + code: str + debug_info: Optional[dict[str, Any]] + details: Optional[list[ApiError]] + message: str + param: Optional[str] + type: Optional[str] @overload def __init__( self, *, - bing_custom_search_preview: BingCustomSearchToolParameters + additional_info: Optional[dict[str, Any]] = ..., + code: str, + debug_info: Optional[dict[str, Any]] = ..., + details: Optional[list[ApiError]] = ..., + message: str, + param: Optional[str] = ..., + type: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.BingCustomSearchToolParameters(_Model): - search_configurations: list[BingCustomSearchConfiguration] + class azure.ai.projects.models.ApiErrorResponse(_Model): + error: ApiError @overload def __init__( self, *, - search_configurations: list[BingCustomSearchConfiguration] + error: ApiError ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.BingGroundingSearchConfiguration(_Model): - count: Optional[int] - freshness: Optional[str] - market: Optional[str] - project_connection_id: str - set_lang: Optional[str] + class azure.ai.projects.models.ApiKeyCredentials(BaseCredentials, discriminator='ApiKey'): + api_key: Optional[str] + type: Literal[CredentialType.API_KEY] @overload - def __init__( - self, - *, - count: Optional[int] = ..., - freshness: Optional[str] = ..., - market: Optional[str] = ..., - project_connection_id: str, - set_lang: Optional[str] = ... - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.BingGroundingSearchToolParameters(_Model): - search_configurations: list[BingGroundingSearchConfiguration] + 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, *, - search_configurations: list[BingGroundingSearchConfiguration] + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.BingGroundingTool(Tool, discriminator='bing_grounding'): - bing_grounding: BingGroundingSearchToolParameters - description: Optional[str] - name: Optional[str] - tool_configs: Optional[dict[str, ToolConfig]] - type: Literal[ToolType.BING_GROUNDING] + class azure.ai.projects.models.ApproximateLocation(_Model): + city: Optional[str] + country: Optional[str] + region: Optional[str] + timezone: Optional[str] + type: Literal["approximate"] @overload def __init__( self, *, - bing_grounding: BingGroundingSearchToolParameters, - description: Optional[str] = ..., - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + city: Optional[str] = ..., + country: Optional[str] = ..., + region: Optional[str] = ..., + timezone: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.BlobReference(_Model): - blob_uri: str - credential: BlobReferenceSasCredential - storage_account_arm_id: str + class azure.ai.projects.models.ArtifactProfile(_Model): + category: Union[str, FoundryModelArtifactProfileCategory] + signals: Optional[list[Union[str, FoundryModelArtifactProfileSignal]]] @overload def __init__( self, *, - blob_uri: str, - credential: BlobReferenceSasCredential, - storage_account_arm_id: str + category: Union[str, FoundryModelArtifactProfileCategory], + signals: Optional[list[Union[str, FoundryModelArtifactProfileSignal]]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.BlobReferenceSasCredential(_Model): - sas_uri: str - type: Literal["SAS"] + class azure.ai.projects.models.AsyncAgentOptimizationLROPoller(AsyncLROPoller[AgentOptimizationJobResult]): + property details: Mapping[str, Any] # Read-only def __init__( self, - *args: Any, - **kwargs: Any + client: Any, + initial_response: Any, + deserialization_callback: Any, + polling_method: Any ) -> None: ... - - class azure.ai.projects.models.BotServiceAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator='BotService'): - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.BotServiceRbacAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator='BotServiceRbac'): - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @classmethod + def from_continuation_token( + cls, + polling_method: AsyncPollingMethod[AgentOptimizationJobResult], + continuation_token: str, + **kwargs: Any + ) -> AsyncAgentOptimizationLROPoller: ... - class azure.ai.projects.models.BotServiceTenantAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator='BotServiceTenant'): - type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT] + class azure.ai.projects.models.AsyncDatasetGenerationLROPoller(AsyncLROPoller[DataGenerationJobResult]): + property details: Mapping[str, Any] # Read-only - @overload - def __init__(self) -> None: ... + def __init__( + self, + client: Any, + initial_response: Any, + deserialization_callback: Any, + polling_method: Any + ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @classmethod + def from_continuation_token( + cls, + polling_method: AsyncPollingMethod[DataGenerationJobResult], + continuation_token: str, + **kwargs: Any + ) -> AsyncDatasetGenerationLROPoller: ... - class azure.ai.projects.models.BrowserAutomationPreviewTool(Tool, discriminator='browser_automation_preview'): - browser_automation_preview: BrowserAutomationToolParameters - type: Literal[ToolType.BROWSER_AUTOMATION_PREVIEW] + class azure.ai.projects.models.AsyncEvaluatorGenerationLROPoller(AsyncLROPoller[EvaluatorVersion]): + property details: Mapping[str, Any] # Read-only - @overload def __init__( self, - *, - browser_automation_preview: BrowserAutomationToolParameters + client: Any, + initial_response: Any, + deserialization_callback: Any, + polling_method: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @classmethod + def from_continuation_token( + cls, + polling_method: AsyncPollingMethod[EvaluatorVersion], + continuation_token: str, + **kwargs: Any + ) -> AsyncEvaluatorGenerationLROPoller: ... - class azure.ai.projects.models.BrowserAutomationPreviewToolboxTool(ToolboxTool, discriminator='browser_automation_preview'): - browser_automation_preview: BrowserAutomationToolParameters - description: str + class azure.ai.projects.models.AsyncUpdateMemoriesLROPoller(AsyncLROPoller[MemoryStoreUpdateCompletedResult]): + property superseded_by: Optional[str] # Read-only + property update_id: str # Read-only + + @classmethod + def from_continuation_token( + cls, + polling_method: AsyncPollingMethod[MemoryStoreUpdateCompletedResult], + continuation_token: str, + **kwargs: Any + ) -> AsyncUpdateMemoriesLROPoller: ... + + + class azure.ai.projects.models.AttackStrategy(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ANSI_ATTACK = "ansi_attack" + ASCII_ART = "ascii_art" + ASCII_SMUGGLER = "ascii_smuggler" + ATBASH = "atbash" + BASE64 = "base64" + BASELINE = "baseline" + BINARY = "binary" + CAESAR = "caesar" + CHARACTER_SPACE = "character_space" + CHARACTER_SWAP = "character_swap" + CRESCENDO = "crescendo" + DIACRITIC = "diacritic" + DIFFICULT = "difficult" + EASY = "easy" + FLIP = "flip" + INDIRECT_JAILBREAK = "indirect_jailbreak" + JAILBREAK = "jailbreak" + LEETSPEAK = "leetspeak" + MODERATE = "moderate" + MORSE = "morse" + MULTI_TURN = "multi_turn" + ROT13 = "rot13" + STRING_JOIN = "string_join" + SUFFIX_APPEND = "suffix_append" + TENSE = "tense" + UNICODE_CONFUSABLE = "unicode_confusable" + UNICODE_SUBSTITUTION = "unicode_substitution" + URL = "url" + + + class azure.ai.projects.models.AutoCodeInterpreterToolParam(_Model): + file_ids: Optional[list[str]] + memory_limit: Optional[Union[str, ContainerMemoryLimit]] + network_policy: Optional[ContainerNetworkPolicyParam] + type: Literal["auto"] + + @overload + def __init__( + self, + *, + file_ids: Optional[list[str]] = ..., + memory_limit: Optional[Union[str, ContainerMemoryLimit]] = ..., + network_policy: Optional[ContainerNetworkPolicyParam] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AzureAIAgentTarget(EvaluationTarget, discriminator='azure_ai_agent'): name: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW] + tool_descriptions: Optional[list[ToolDescription]] + tools: Optional[list[Tool]] + type: Literal["azure_ai_agent"] + version: Optional[str] @overload def __init__( self, *, - browser_automation_preview: BrowserAutomationToolParameters, - description: Optional[str] = ..., - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + name: str, + tool_descriptions: Optional[list[ToolDescription]] = ..., + tools: Optional[list[Tool]] = ..., + version: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.BrowserAutomationToolConnectionParameters(_Model): - project_connection_id: str + class azure.ai.projects.models.AzureAIAgentTargetParam(TypedDict, total=False): + key "name": Required[str] + key "tool_descriptions": List[ToolDescriptionParam] + key "type": Required[Literal["azure_ai_agent"]] + key "version": str + + + class azure.ai.projects.models.AzureAIBenchmarkPreviewEvalRunDataSource(TypedDict, total=False): + key "input_messages": InputMessagesItemReference + key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] + key "type": Required[Literal["azure_ai_benchmark_preview"]] + + + class azure.ai.projects.models.AzureAIDataSourceConfig(TypedDict, total=False): + key "scenario": Required[str] + key "type": Required[Literal["azure_ai_source"]] + + + class azure.ai.projects.models.AzureAIModelTarget(EvaluationTarget, discriminator='azure_ai_model'): + model: Optional[str] + sampling_params: Optional[ModelSamplingParams] + type: Literal["azure_ai_model"] @overload def __init__( self, *, - project_connection_id: str + model: Optional[str] = ..., + sampling_params: Optional[ModelSamplingParams] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.BrowserAutomationToolParameters(_Model): - connection: BrowserAutomationToolConnectionParameters + class azure.ai.projects.models.AzureAIModelTargetParam(TypedDict, total=False): + key "model": str + key "sampling_params": ModelSamplingConfigParam + key "type": Required[Literal["azure_ai_model"]] + + + class azure.ai.projects.models.AzureAIResponsesEvalRunDataSource(TypedDict, total=False): + key "event_configuration_id": str + key "item_generation_params": Required[ResponseRetrievalItemGenerationParams] + key "max_runs_hourly": int + key "type": Required[Literal["azure_ai_responses"]] + + + class azure.ai.projects.models.AzureAISearchIndex(Index, discriminator='AzureSearch'): + connection_name: str + description: str + field_mapping: Optional[FieldMapping] + id: str + index_name: str + name: str + tags: dict[str, str] + type: Literal[IndexType.AZURE_SEARCH] + version: str @overload def __init__( self, *, - connection: BrowserAutomationToolConnectionParameters + connection_name: str, + description: Optional[str] = ..., + field_mapping: Optional[FieldMapping] = ..., + index_name: str, + tags: Optional[dict[str, str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CallableToolAllowedCaller(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DIRECT = "direct" - PROGRAMMATIC = "programmatic" + class azure.ai.projects.models.AzureAISearchQueryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SEMANTIC = "semantic" + SIMPLE = "simple" + VECTOR = "vector" + VECTOR_SEMANTIC_HYBRID = "vector_semantic_hybrid" + VECTOR_SIMPLE_HYBRID = "vector_simple_hybrid" - class azure.ai.projects.models.CaptureStructuredOutputsTool(Tool, discriminator='capture_structured_outputs'): + class azure.ai.projects.models.AzureAISearchTool(Tool, discriminator='azure_ai_search'): + azure_ai_search: AzureAISearchToolResource description: Optional[str] name: Optional[str] - outputs: StructuredOutputDefinition tool_configs: Optional[dict[str, ToolConfig]] - type: Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS] + type: Literal[ToolType.AZURE_AI_SEARCH] @overload def __init__( self, *, + azure_ai_search: AzureAISearchToolResource, description: Optional[str] = ..., name: Optional[str] = ..., - outputs: StructuredOutputDefinition, tool_configs: Optional[dict[str, ToolConfig]] = ... ) -> None: ... @@ -4544,148 +4716,118 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ChartCoordinate(_Model): - size: int - x: int - y: int + class azure.ai.projects.models.AzureAISearchToolResource(_Model): + indexes: list[AISearchIndexResource] @overload def __init__( self, *, - size: int, - x: int, - y: int + indexes: list[AISearchIndexResource] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ChatSummaryMemoryItem(MemoryItem, discriminator='chat_summary'): - content: str - kind: Literal[MemoryItemKind.CHAT_SUMMARY] - memory_id: str - scope: str - updated_at: datetime + class azure.ai.projects.models.AzureAISearchToolboxTool(ToolboxTool, discriminator='azure_ai_search'): + azure_ai_search: AzureAISearchToolResource + description: str + name: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.AZURE_AI_SEARCH] @overload def __init__( self, *, - content: str, - memory_id: str, - scope: str, - updated_at: datetime + azure_ai_search: AzureAISearchToolResource, + 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]] - summary: InsightSummary + class azure.ai.projects.models.AzureFunctionBinding(_Model): + storage_queue: AzureFunctionStorageQueue + type: Literal["storage_queue"] @overload def __init__( self, *, - clusters: list[InsightCluster], - coordinates: Optional[dict[str, ChartCoordinate]] = ..., - summary: InsightSummary + storage_queue: AzureFunctionStorageQueue ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ClusterTokenUsage(_Model): - input_token_usage: int - output_token_usage: int - total_token_usage: int + class azure.ai.projects.models.AzureFunctionDefinition(_Model): + function: AzureFunctionDefinitionFunction + input_binding: AzureFunctionBinding + output_binding: AzureFunctionBinding @overload def __init__( self, *, - input_token_usage: int, - output_token_usage: int, - total_token_usage: int + function: AzureFunctionDefinitionFunction, + input_binding: AzureFunctionBinding, + output_binding: AzureFunctionBinding ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CodeBasedEvaluatorDefinition(EvaluatorDefinition, discriminator='code'): - blob_uri: Optional[str] - code_text: Optional[str] - data_schema: dict[str, any] - entry_point: Optional[str] - image_tag: Optional[str] - init_parameters: dict[str, any] - metrics: dict[str, EvaluatorMetric] - type: Literal[EvaluatorDefinitionType.CODE] + class azure.ai.projects.models.AzureFunctionDefinitionFunction(_Model): + description: Optional[str] + name: str + parameters: dict[str, Any] @overload def __init__( self, *, - blob_uri: Optional[str] = ..., - code_text: Optional[str] = ..., - data_schema: Optional[dict[str, Any]] = ..., - entry_point: Optional[str] = ..., - image_tag: Optional[str] = ..., - init_parameters: Optional[dict[str, Any]] = ..., - metrics: Optional[dict[str, EvaluatorMetric]] = ... + description: Optional[str] = ..., + name: str, + parameters: dict[str, Any] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CodeConfiguration(_Model): - content_hash: Optional[str] - dependency_resolution: Union[str, CodeDependencyResolution] - entry_point: list[str] - runtime: str + class azure.ai.projects.models.AzureFunctionStorageQueue(_Model): + queue_name: str + queue_service_endpoint: str @overload def __init__( self, *, - dependency_resolution: Union[str, CodeDependencyResolution], - entry_point: list[str], - runtime: str + queue_name: str, + queue_service_endpoint: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CodeDependencyResolution(str, Enum, metaclass=CaseInsensitiveEnumMeta): - BUNDLED = "bundled" - 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] + class azure.ai.projects.models.AzureFunctionTool(Tool, discriminator='azure_function'): + azure_function: AzureFunctionDefinition + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.AZURE_FUNCTION] @overload def __init__( self, *, - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., - container: Optional[Union[str, AutoCodeInterpreterToolParam]] = ..., - description: Optional[str] = ..., - name: Optional[str] = ..., + azure_function: AzureFunctionDefinition, tool_configs: Optional[dict[str, ToolConfig]] = ... ) -> None: ... @@ -4693,186 +4835,176 @@ namespace azure.ai.projects.models 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]] - description: str - name: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.CODE_INTERPRETER] + class azure.ai.projects.models.AzureOpenAIModelConfiguration(RedTeamTargetConfig, discriminator='AzureOpenAIModel'): + model_deployment_name: str + type: Literal["AzureOpenAIModel"] @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]] = ... + model_deployment_name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ComparisonFilter(_Model): - key: str - type: Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"] - value: Union[str, float, bool, list[Union[str, float]]] + class azure.ai.projects.models.BaseCredentials(_Model): + type: str @overload def __init__( self, *, - key: str, - type: Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"], - value: Union[str, float, bool, list[Union[str, float]]] + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CompoundFilter(_Model): - filters: list[Union[ComparisonFilter, Any]] - type: Literal["and", "or"] + class azure.ai.projects.models.BingCustomSearchConfiguration(_Model): + count: Optional[int] + freshness: Optional[str] + instance_name: str + market: Optional[str] + project_connection_id: str + set_lang: Optional[str] @overload def __init__( self, *, - filters: list[Union[ComparisonFilter, Any]], - type: Literal["and", "or"] + count: Optional[int] = ..., + freshness: Optional[str] = ..., + instance_name: str, + market: Optional[str] = ..., + project_connection_id: str, + set_lang: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ComputerEnvironment(str, Enum, metaclass=CaseInsensitiveEnumMeta): - BROWSER = "browser" - LINUX = "linux" - MAC = "mac" - UBUNTU = "ubuntu" - WINDOWS = "windows" - - - class azure.ai.projects.models.ComputerTool(Tool, discriminator='computer'): - type: Literal[ToolType.COMPUTER] + class azure.ai.projects.models.BingCustomSearchPreviewTool(Tool, discriminator='bing_custom_search_preview'): + bing_custom_search_preview: BingCustomSearchToolParameters + type: Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + bing_custom_search_preview: BingCustomSearchToolParameters + ) -> 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] + class azure.ai.projects.models.BingCustomSearchToolParameters(_Model): + search_configurations: list[BingCustomSearchConfiguration] @overload def __init__( self, *, - display_height: int, - display_width: int, - environment: Union[str, ComputerEnvironment] + search_configurations: list[BingCustomSearchConfiguration] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.Connection(_Model): - credentials: BaseCredentials - id: str - is_default: bool - metadata: dict[str, str] - name: str - target: str - type: Union[str, ConnectionType] + class azure.ai.projects.models.BingGroundingSearchConfiguration(_Model): + count: Optional[int] + freshness: Optional[str] + market: Optional[str] + project_connection_id: str + set_lang: Optional[str] + @overload + def __init__( + self, + *, + count: Optional[int] = ..., + freshness: Optional[str] = ..., + market: Optional[str] = ..., + project_connection_id: str, + set_lang: Optional[str] = ... + ) -> None: ... - class azure.ai.projects.models.ConnectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - API_KEY = "ApiKey" - APPLICATION_CONFIGURATION = "AppConfig" - APPLICATION_INSIGHTS = "AppInsights" - AZURE_AI_SEARCH = "CognitiveSearch" - AZURE_BLOB_STORAGE = "AzureBlob" - AZURE_OPEN_AI = "AzureOpenAI" - AZURE_STORAGE_ACCOUNT = "AzureStorageAccount" - COSMOS_DB = "CosmosDB" - CUSTOM = "CustomKeys" - REMOTE_TOOL = "RemoteTool_Preview" + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ContainerAutoParam(FunctionShellToolParamEnvironment, discriminator='container_auto'): - file_ids: Optional[list[str]] - memory_limit: Optional[Union[str, ContainerMemoryLimit]] - network_policy: Optional[ContainerNetworkPolicyParam] - skills: Optional[list[ContainerSkill]] - type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO] + class azure.ai.projects.models.BingGroundingSearchToolParameters(_Model): + search_configurations: list[BingGroundingSearchConfiguration] @overload def __init__( self, *, - file_ids: Optional[list[str]] = ..., - memory_limit: Optional[Union[str, ContainerMemoryLimit]] = ..., - network_policy: Optional[ContainerNetworkPolicyParam] = ..., - skills: Optional[list[ContainerSkill]] = ... + search_configurations: list[BingGroundingSearchConfiguration] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ContainerConfiguration(_Model): - image: str - registry_connection_id: Optional[str] + class azure.ai.projects.models.BingGroundingTool(Tool, discriminator='bing_grounding'): + bing_grounding: BingGroundingSearchToolParameters + description: Optional[str] + name: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.BING_GROUNDING] @overload def __init__( self, *, - image: str, - registry_connection_id: Optional[str] = ... + bing_grounding: BingGroundingSearchToolParameters, + 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.ContainerMemoryLimit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - MEMORY_16GB = "16g" - MEMORY_1GB = "1g" - MEMORY_4GB = "4g" - MEMORY_64GB = "64g" - - - class azure.ai.projects.models.ContainerNetworkPolicyAllowlistParam(ContainerNetworkPolicyParam, discriminator='allowlist'): - allowed_domains: list[str] - domain_secrets: Optional[list[ContainerNetworkPolicyDomainSecretParam]] - type: Literal[ContainerNetworkPolicyParamType.ALLOWLIST] + class azure.ai.projects.models.BlobReference(_Model): + blob_uri: str + credential: BlobReferenceSasCredential + storage_account_arm_id: str @overload def __init__( self, *, - allowed_domains: list[str], - domain_secrets: Optional[list[ContainerNetworkPolicyDomainSecretParam]] = ... + blob_uri: str, + credential: BlobReferenceSasCredential, + storage_account_arm_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ContainerNetworkPolicyDisabledParam(ContainerNetworkPolicyParam, discriminator='disabled'): - type: Literal[ContainerNetworkPolicyParamType.DISABLED] + class azure.ai.projects.models.BlobReferenceSasCredential(_Model): + sas_uri: str + type: Literal["SAS"] + + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... + + + class azure.ai.projects.models.BotServiceAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator='BotService'): + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE] @overload def __init__(self) -> None: ... @@ -4881,438 +5013,478 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ContainerNetworkPolicyDomainSecretParam(_Model): - domain: str - name: str - value: str + class azure.ai.projects.models.BotServiceRbacAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator='BotServiceRbac'): + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.BotServiceTenantAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator='BotServiceTenant'): + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.BrowserAutomationPreviewTool(Tool, discriminator='browser_automation_preview'): + browser_automation_preview: BrowserAutomationToolParameters + type: Literal[ToolType.BROWSER_AUTOMATION_PREVIEW] @overload def __init__( self, *, - domain: str, - name: str, - value: str + browser_automation_preview: BrowserAutomationToolParameters ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ContainerNetworkPolicyParam(_Model): - type: str + class azure.ai.projects.models.BrowserAutomationPreviewToolboxTool(ToolboxTool, discriminator='browser_automation_preview'): + browser_automation_preview: BrowserAutomationToolParameters + description: str + name: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW] @overload def __init__( self, *, - type: str + browser_automation_preview: BrowserAutomationToolParameters, + 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.ContainerNetworkPolicyParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ALLOWLIST = "allowlist" - DISABLED = "disabled" - - - class azure.ai.projects.models.ContainerSkill(_Model): - type: str + class azure.ai.projects.models.BrowserAutomationToolConnectionParameters(_Model): + project_connection_id: str @overload def __init__( self, *, - type: str + project_connection_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ContainerSkillType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - INLINE = "inline" - SKILL_REFERENCE = "skill_reference" - - - class azure.ai.projects.models.ContinuousEvaluationRuleAction(EvaluationRuleAction, discriminator='continuousEvaluation'): - eval_id: str - max_hourly_runs: Optional[int] - sampling_rate: Optional[float] - type: Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION] + class azure.ai.projects.models.BrowserAutomationToolParameters(_Model): + connection: BrowserAutomationToolConnectionParameters @overload def __init__( self, *, - eval_id: str, - max_hourly_runs: Optional[int] = ..., - sampling_rate: Optional[float] = ... + connection: BrowserAutomationToolConnectionParameters ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CosmosDBIndex(Index, discriminator='CosmosDBNoSqlVectorStore'): - connection_name: str - container_name: str - database_name: str - description: str - embedding_configuration: EmbeddingConfiguration - field_mapping: FieldMapping - id: str - name: str - tags: dict[str, str] - type: Literal[IndexType.COSMOS_DB] - version: str + class azure.ai.projects.models.CallableToolAllowedCaller(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DIRECT = "direct" + PROGRAMMATIC = "programmatic" + + + class azure.ai.projects.models.CaptureStructuredOutputsTool(Tool, discriminator='capture_structured_outputs'): + description: Optional[str] + name: Optional[str] + outputs: StructuredOutputDefinition + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS] @overload def __init__( self, *, - connection_name: str, - container_name: str, - database_name: str, description: Optional[str] = ..., - embedding_configuration: EmbeddingConfiguration, - field_mapping: FieldMapping, - tags: Optional[dict[str, str]] = ... + name: Optional[str] = ..., + outputs: StructuredOutputDefinition, + tool_configs: Optional[dict[str, ToolConfig]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CreateAsyncResponse(_Model): - location: Optional[str] - operation_result: Optional[str] + class azure.ai.projects.models.ChartCoordinate(_Model): + size: int + x: int + y: int @overload def __init__( self, *, - location: Optional[str] = ..., - operation_result: Optional[str] = ... + size: int, + x: int, + y: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CreateSkillVersionFromFilesBody(_Model): - default: Optional[bool] - files: list[Union[str, bytes, IO[str], IO[bytes], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]]], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]], Optional[str]]]] + class azure.ai.projects.models.ChatSummaryMemoryItem(MemoryItem, discriminator='chat_summary'): + content: str + kind: Literal[MemoryItemKind.CHAT_SUMMARY] + memory_id: str + scope: str + updated_at: datetime @overload def __init__( self, *, - default: Optional[bool] = ..., - files: list[FileType] + content: str, + memory_id: str, + scope: str, + updated_at: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CreateTranscriptionResponseJsonUsage(_Model): - type: str + class azure.ai.projects.models.ClusterInsightResult(_Model): + clusters: list[InsightCluster] + coordinates: Optional[dict[str, ChartCoordinate]] + summary: InsightSummary @overload def __init__( self, *, - type: str + clusters: list[InsightCluster], + coordinates: Optional[dict[str, ChartCoordinate]] = ..., + summary: InsightSummary ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CreateTranscriptionResponseJsonUsageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DURATION = "duration" - TOKENS = "tokens" - - - class azure.ai.projects.models.CredentialType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENTIC_IDENTITY_PREVIEW = "AgenticIdentityToken_Preview" - API_KEY = "ApiKey" - CUSTOM = "CustomKeys" - ENTRA_ID = "AAD" - NONE = "None" - SAS = "SAS" - - - class azure.ai.projects.models.CronTrigger(Trigger, discriminator='Cron'): - end_time: Optional[datetime] - expression: str - start_time: Optional[datetime] - time_zone: Optional[str] - type: Literal[TriggerType.CRON] + class azure.ai.projects.models.ClusterTokenUsage(_Model): + input_token_usage: int + output_token_usage: int + total_token_usage: int @overload def __init__( self, *, - end_time: Optional[datetime] = ..., - expression: str, - start_time: Optional[datetime] = ..., - time_zone: Optional[str] = ... + input_token_usage: int, + output_token_usage: int, + total_token_usage: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CustomCredential(CustomCredentialGenerated, discriminator='CustomKeys'): - credential_keys: Dict[str, str] - type: Union[str, CredentialType] - - def __init__( - self, - *args: Any, - **kwargs: Any - ) -> None: ... - - - class azure.ai.projects.models.CustomGrammarFormatParam(CustomToolParamFormat, discriminator='grammar'): - definition: str - syntax: Union[str, GrammarSyntax1] - type: Literal[CustomToolParamFormatType.GRAMMAR] + class azure.ai.projects.models.CodeBasedEvaluatorDefinition(EvaluatorDefinition, discriminator='code'): + blob_uri: Optional[str] + code_text: Optional[str] + data_schema: dict[str, any] + entry_point: Optional[str] + image_tag: Optional[str] + init_parameters: dict[str, any] + metrics: dict[str, EvaluatorMetric] + type: Literal[EvaluatorDefinitionType.CODE] @overload def __init__( self, *, - definition: str, - syntax: Union[str, GrammarSyntax1] + blob_uri: Optional[str] = ..., + code_text: Optional[str] = ..., + data_schema: Optional[dict[str, Any]] = ..., + entry_point: Optional[str] = ..., + image_tag: Optional[str] = ..., + init_parameters: Optional[dict[str, Any]] = ..., + metrics: Optional[dict[str, EvaluatorMetric]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CustomRoutineTrigger(RoutineTrigger, discriminator='custom'): - event_name: Optional[str] - parameters: dict[str, Any] - provider: str - type: Literal[RoutineTriggerType.CUSTOM] + class azure.ai.projects.models.CodeConfiguration(_Model): + content_hash: Optional[str] + dependency_resolution: Union[str, CodeDependencyResolution] + entry_point: list[str] + runtime: str @overload def __init__( self, *, - event_name: Optional[str] = ..., - parameters: dict[str, Any], - provider: str + dependency_resolution: Union[str, CodeDependencyResolution], + entry_point: list[str], + runtime: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CustomTextFormatParam(CustomToolParamFormat, discriminator='text'): - type: Literal[CustomToolParamFormatType.TEXT] + class azure.ai.projects.models.CodeDependencyResolution(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BUNDLED = "bundled" + 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) -> None: ... + 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.CustomToolParam(Tool, discriminator='custom'): + class azure.ai.projects.models.CodeInterpreterToolboxTool(ToolboxTool, discriminator='code_interpreter'): allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] - defer_loading: Optional[bool] - description: Optional[str] - format: Optional[CustomToolParamFormat] + container: Optional[Union[str, AutoCodeInterpreterToolParam]] + description: str name: str - type: Literal[ToolType.CUSTOM] + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.CODE_INTERPRETER] @overload def __init__( self, *, allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., - defer_loading: Optional[bool] = ..., + container: Optional[Union[str, AutoCodeInterpreterToolParam]] = ..., description: Optional[str] = ..., - format: Optional[CustomToolParamFormat] = ..., - name: 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.CustomToolParamFormat(_Model): - type: str + class azure.ai.projects.models.ComparisonFilter(_Model): + key: str + type: Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"] + value: Union[str, float, bool, list[Union[str, float]]] @overload def __init__( self, *, - type: str + key: str, + type: Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"], + value: Union[str, float, bool, list[Union[str, float]]] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CustomToolParamFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - GRAMMAR = "grammar" - TEXT = "text" - - - class azure.ai.projects.models.DailyRecurrenceSchedule(RecurrenceSchedule, discriminator='Daily'): - hours: list[int] - type: Literal[RecurrenceType.DAILY] + class azure.ai.projects.models.CompoundFilter(_Model): + filters: list[Union[ComparisonFilter, Any]] + type: Literal["and", "or"] @overload def __init__( self, *, - hours: list[int] + filters: list[Union[ComparisonFilter, Any]], + type: Literal["and", "or"] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DataGenerationJob(_Model): - created_at: datetime - error: Optional[ApiError] - finished_at: Optional[datetime] - id: str - inputs: Optional[DataGenerationJobInputs] - result: Optional[DataGenerationJobResult] - status: Union[str, JobStatus] + class azure.ai.projects.models.ComputerEnvironment(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BROWSER = "browser" + LINUX = "linux" + MAC = "mac" + UBUNTU = "ubuntu" + WINDOWS = "windows" + + + class azure.ai.projects.models.ComputerTool(Tool, discriminator='computer'): + type: Literal[ToolType.COMPUTER] @overload - def __init__( - self, - *, - inputs: Optional[DataGenerationJobInputs] = ... - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DataGenerationJobInputs(_Model): - name: str - options: DataGenerationJobOptions - output_options: Optional[DataGenerationJobOutputOptions] - scenario: Union[str, DataGenerationJobScenario] - sources: list[DataGenerationJobSource] + 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, *, - name: str, - options: DataGenerationJobOptions, - output_options: Optional[DataGenerationJobOutputOptions] = ..., - scenario: Union[str, DataGenerationJobScenario], - sources: list[DataGenerationJobSource] + 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.DataGenerationJobOptions(_Model): - max_samples: int - model_options: Optional[DataGenerationModelOptions] - train_split: Optional[float] - type: str + class azure.ai.projects.models.Connection(_Model): + credentials: BaseCredentials + id: str + is_default: bool + metadata: dict[str, str] + name: str + target: str + type: Union[str, ConnectionType] + + + class azure.ai.projects.models.ConnectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + API_KEY = "ApiKey" + APPLICATION_CONFIGURATION = "AppConfig" + APPLICATION_INSIGHTS = "AppInsights" + AZURE_AI_SEARCH = "CognitiveSearch" + AZURE_BLOB_STORAGE = "AzureBlob" + AZURE_OPEN_AI = "AzureOpenAI" + AZURE_STORAGE_ACCOUNT = "AzureStorageAccount" + COSMOS_DB = "CosmosDB" + CUSTOM = "CustomKeys" + REMOTE_TOOL = "RemoteTool_Preview" + + + class azure.ai.projects.models.ContainerAutoParam(FunctionShellToolParamEnvironment, discriminator='container_auto'): + file_ids: Optional[list[str]] + memory_limit: Optional[Union[str, ContainerMemoryLimit]] + network_policy: Optional[ContainerNetworkPolicyParam] + skills: Optional[list[ContainerSkill]] + type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO] @overload def __init__( self, *, - max_samples: int, - model_options: Optional[DataGenerationModelOptions] = ..., - train_split: Optional[float] = ..., - type: str + file_ids: Optional[list[str]] = ..., + memory_limit: Optional[Union[str, ContainerMemoryLimit]] = ..., + network_policy: Optional[ContainerNetworkPolicyParam] = ..., + skills: Optional[list[ContainerSkill]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DataGenerationJobOutput(_Model): - type: str + class azure.ai.projects.models.ContainerConfiguration(_Model): + image: str + registry_connection_id: Optional[str] @overload def __init__( self, *, - type: str + image: str, + registry_connection_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DataGenerationJobOutputOptions(_Model): - description: Optional[str] - name: Optional[str] - tags: Optional[dict[str, str]] + class azure.ai.projects.models.ContainerMemoryLimit(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MEMORY_16GB = "16g" + MEMORY_1GB = "1g" + MEMORY_4GB = "4g" + MEMORY_64GB = "64g" + + + class azure.ai.projects.models.ContainerNetworkPolicyAllowlistParam(ContainerNetworkPolicyParam, discriminator='allowlist'): + allowed_domains: list[str] + domain_secrets: Optional[list[ContainerNetworkPolicyDomainSecretParam]] + type: Literal[ContainerNetworkPolicyParamType.ALLOWLIST] @overload def __init__( self, *, - description: Optional[str] = ..., - name: Optional[str] = ..., - tags: Optional[dict[str, str]] = ... + allowed_domains: list[str], + domain_secrets: Optional[list[ContainerNetworkPolicyDomainSecretParam]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DataGenerationJobOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DATASET = "dataset" - FILE = "file" + class azure.ai.projects.models.ContainerNetworkPolicyDisabledParam(ContainerNetworkPolicyParam, discriminator='disabled'): + type: Literal[ContainerNetworkPolicyParamType.DISABLED] + @overload + def __init__(self) -> None: ... - class azure.ai.projects.models.DataGenerationJobResult(_Model): - generated_samples: int - outputs: Optional[list[DataGenerationJobOutput]] - token_usage: Optional[DataGenerationTokenUsage] + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ContainerNetworkPolicyDomainSecretParam(_Model): + domain: str + name: str + value: str @overload def __init__( self, *, - generated_samples: int, - outputs: Optional[list[DataGenerationJobOutput]] = ..., - token_usage: Optional[DataGenerationTokenUsage] = ... + domain: str, + name: str, + value: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DataGenerationJobScenario(str, Enum, metaclass=CaseInsensitiveEnumMeta): - EVALUATION = "evaluation" - REINFORCEMENT_FINETUNING = "reinforcement_finetuning" - SUPERVISED_FINETUNING = "supervised_finetuning" - - - class azure.ai.projects.models.DataGenerationJobSource(_Model): - description: Optional[str] + class azure.ai.projects.models.ContainerNetworkPolicyParam(_Model): type: str @overload def __init__( self, *, - description: Optional[str] = ..., type: str ) -> None: ... @@ -5320,421 +5492,387 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DataGenerationJobSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENT = "agent" - FILE = "file" - PROMPT = "prompt" - TRACES = "traces" - - - class azure.ai.projects.models.DataGenerationJobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - SIMPLE_QNA = "simple_qna" - SIMULATION_SEED = "simulation_seed" - TOOL_USE = "tool_use" - TRACES = "traces" + class azure.ai.projects.models.ContainerNetworkPolicyParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ALLOWLIST = "allowlist" + DISABLED = "disabled" - class azure.ai.projects.models.DataGenerationModelOptions(_Model): - model: str + class azure.ai.projects.models.ContainerSkill(_Model): + type: str @overload def __init__( self, *, - model: str + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DataGenerationTokenUsage(_Model): - completion_tokens: int - prompt_tokens: int - total_tokens: int + class azure.ai.projects.models.ContainerSkillType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INLINE = "inline" + SKILL_REFERENCE = "skill_reference" - class azure.ai.projects.models.DatasetCredential(_Model): - blob_reference: BlobReference + class azure.ai.projects.models.ContinuousEvaluationRuleAction(EvaluationRuleAction, discriminator='continuousEvaluation'): + eval_id: str + max_hourly_runs: Optional[int] + sampling_rate: Optional[float] + type: Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION] @overload def __init__( self, *, - blob_reference: BlobReference + eval_id: str, + max_hourly_runs: Optional[int] = ..., + sampling_rate: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DatasetDataGenerationJobOutput(DataGenerationJobOutput, discriminator='dataset'): - description: Optional[str] - id: Optional[str] - name: Optional[str] - tags: Optional[dict[str, str]] - type: Literal[DataGenerationJobOutputType.DATASET] - version: Optional[str] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.DatasetEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator='dataset'): - description: Optional[str] + class azure.ai.projects.models.CosmosDBIndex(Index, discriminator='CosmosDBNoSqlVectorStore'): + connection_name: str + container_name: str + database_name: str + description: str + embedding_configuration: EmbeddingConfiguration + field_mapping: FieldMapping + id: str name: str - type: Literal[EvaluatorGenerationJobSourceType.DATASET] - version: Optional[str] + tags: dict[str, str] + type: Literal[IndexType.COSMOS_DB] + version: str @overload def __init__( self, *, + connection_name: str, + container_name: str, + database_name: str, description: Optional[str] = ..., - name: str, - version: Optional[str] = ... + embedding_configuration: EmbeddingConfiguration, + field_mapping: FieldMapping, + tags: Optional[dict[str, str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DatasetGenerationLROPoller(LROPoller[DataGenerationJobResult]): - property details: Mapping[str, Any] # Read-only + class azure.ai.projects.models.CreateAsyncResponse(_Model): + location: Optional[str] + operation_result: Optional[str] + @overload def __init__( self, - client: Any, - initial_response: Any, - deserialization_callback: Any, - polling_method: Any + *, + location: Optional[str] = ..., + operation_result: Optional[str] = ... ) -> None: ... - @classmethod - def from_continuation_token( - cls, - polling_method: PollingMethod[DataGenerationJobResult], - continuation_token: str, - **kwargs: Any - ) -> DatasetGenerationLROPoller: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DatasetReference(_Model): - name: str - version: str + class azure.ai.projects.models.CreateSkillVersionFromFilesBody(_Model): + default: Optional[bool] + files: list[Union[str, bytes, IO[str], IO[bytes], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]]], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]], Optional[str]]]] @overload def __init__( self, *, - name: str, - version: str + default: Optional[bool] = ..., + files: list[FileType] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DatasetType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - URI_FILE = "uri_file" - URI_FOLDER = "uri_folder" - - - class azure.ai.projects.models.DatasetVersion(_Model): - connection_name: Optional[str] - data_uri: str - description: Optional[str] - id: Optional[str] - is_reference: Optional[bool] - name: str - tags: Optional[dict[str, str]] - type: str - version: str + class azure.ai.projects.models.CreateTeamsPhoneExtensionTelephonyBindingRequest(CreateTelephonyBindingRequest, discriminator='teams_phone_extension'): + connection: str + label: str + phone_number: Optional[str] + provider: Literal[TelephonyProvider.TEAMS_PHONE_EXTENSION] + resource_account_object_id: str @overload def __init__( self, *, - connection_name: Optional[str] = ..., - data_uri: str, - description: Optional[str] = ..., - tags: Optional[dict[str, str]] = ..., - type: str + connection: str, + label: Optional[str] = ..., + phone_number: Optional[str] = ..., + resource_account_object_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DayOfWeek(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FRIDAY = "Friday" - MONDAY = "Monday" - SATURDAY = "Saturday" - SUNDAY = "Sunday" - THURSDAY = "Thursday" - TUESDAY = "Tuesday" - WEDNESDAY = "Wednesday" - - - class azure.ai.projects.models.DeleteAgentResponse(_Model): - deleted: bool - name: str - object: Literal[AgentObjectType.AGENT_DELETED] + class azure.ai.projects.models.CreateTelephonyBindingRequest(_Model): + connection: str + label: Optional[str] + provider: str @overload def __init__( self, *, - deleted: bool, - name: str, - object: Literal[AgentObjectType.AGENT_DELETED] + connection: str, + label: Optional[str] = ..., + provider: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DeleteAgentVersionResponse(_Model): - deleted: bool - name: str - object: Literal[AgentObjectType.AGENT_VERSION_DELETED] - version: str + class azure.ai.projects.models.CreateTranscriptionResponseJsonUsage(_Model): + type: str @overload def __init__( self, *, - deleted: bool, - name: str, - object: Literal[AgentObjectType.AGENT_VERSION_DELETED], - version: str + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DeleteMemoryResult(_Model): - deleted: bool - memory_id: str - object: Literal[MemoryStoreObjectType.MEMORY_DELETED] + class azure.ai.projects.models.CreateTranscriptionResponseJsonUsageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DURATION = "duration" + TOKENS = "tokens" + + + class azure.ai.projects.models.CreateTwilioTelephonyBindingRequest(CreateTelephonyBindingRequest, discriminator='twilio'): + connection: str + label: str + phone_number: str + provider: Literal[TelephonyProvider.TWILIO] @overload def __init__( self, *, - deleted: bool, - memory_id: str, - object: Literal[MemoryStoreObjectType.MEMORY_DELETED] + connection: str, + label: Optional[str] = ..., + phone_number: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DeleteMemoryStoreResult(_Model): - deleted: bool - name: str - object: Literal[MemoryStoreObjectType.MEMORY_STORE_DELETED] + class azure.ai.projects.models.CredentialType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENTIC_IDENTITY_PREVIEW = "AgenticIdentityToken_Preview" + API_KEY = "ApiKey" + CUSTOM = "CustomKeys" + ENTRA_ID = "AAD" + NONE = "None" + SAS = "SAS" + + + class azure.ai.projects.models.CronTrigger(Trigger, discriminator='Cron'): + end_time: Optional[datetime] + expression: str + start_time: Optional[datetime] + time_zone: Optional[str] + type: Literal[TriggerType.CRON] @overload def __init__( self, *, - deleted: bool, - name: str, - object: Literal[MemoryStoreObjectType.MEMORY_STORE_DELETED] + end_time: Optional[datetime] = ..., + expression: str, + start_time: Optional[datetime] = ..., + time_zone: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DeleteSkillResult(_Model): - deleted: bool - id: str - name: str + class azure.ai.projects.models.CustomCredential(CustomCredentialGenerated, discriminator='CustomKeys'): + credential_keys: Dict[str, str] + type: Union[str, CredentialType] - @overload def __init__( self, - *, - deleted: bool, - id: str, - name: str + *args: Any, + **kwargs: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.DeleteSkillVersionResult(_Model): - deleted: bool - id: str - name: str - version: str + class azure.ai.projects.models.CustomGrammarFormatParam(CustomToolParamFormat, discriminator='grammar'): + definition: str + syntax: Union[str, GrammarSyntax1] + type: Literal[CustomToolParamFormatType.GRAMMAR] @overload def __init__( self, *, - deleted: bool, - id: str, - name: str, - version: str + definition: str, + syntax: Union[str, GrammarSyntax1] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.Deployment(_Model): - name: str - type: str + class azure.ai.projects.models.CustomRoutineTrigger(RoutineTrigger, discriminator='custom'): + event_name: Optional[str] + parameters: dict[str, Any] + provider: str + type: Literal[RoutineTriggerType.CUSTOM] @overload def __init__( self, *, - type: str + event_name: Optional[str] = ..., + parameters: dict[str, Any], + provider: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DeploymentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - MODEL_DEPLOYMENT = "ModelDeployment" - - - class azure.ai.projects.models.DigitalWorkerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - M365 = "m365" - - - class azure.ai.projects.models.Dimension(_Model): - always_applicable: Optional[bool] - description: str - id: str - weight: int + class azure.ai.projects.models.CustomTextFormatParam(CustomToolParamFormat, discriminator='text'): + type: Literal[CustomToolParamFormatType.TEXT] @overload - def __init__( - self, - *, - always_applicable: Optional[bool] = ..., - description: str, - id: str, - weight: int - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.DispatchRoutineResult(_Model): - action_correlation_id: Optional[str] - dispatch_id: Optional[str] - task_id: Optional[str] + class azure.ai.projects.models.CustomToolParam(Tool, discriminator='custom'): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] + defer_loading: Optional[bool] + description: Optional[str] + format: Optional[CustomToolParamFormat] + name: str + type: Literal[ToolType.CUSTOM] @overload def __init__( self, *, - action_correlation_id: Optional[str] = ..., - dispatch_id: Optional[str] = ..., - task_id: Optional[str] = ... + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., + 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.EmbeddingConfiguration(_Model): - embedding_field: str - model_deployment_name: str + class azure.ai.projects.models.CustomToolParamFormat(_Model): + type: str @overload def __init__( self, *, - embedding_field: str, - model_deployment_name: str + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EmptyModelParam(_Model): + class azure.ai.projects.models.CustomToolParamFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + GRAMMAR = "grammar" + TEXT = "text" - class azure.ai.projects.models.EndpointBasedEvaluatorDefinition(EvaluatorDefinition, discriminator='endpoint'): - connection_name: str - data_schema: dict[str, any] - init_parameters: dict[str, any] - metrics: dict[str, EvaluatorMetric] - type: Literal[EvaluatorDefinitionType.ENDPOINT] + class azure.ai.projects.models.DailyRecurrenceSchedule(RecurrenceSchedule, discriminator='Daily'): + hours: list[int] + type: Literal[RecurrenceType.DAILY] @overload def __init__( self, *, - connection_name: str, - data_schema: Optional[dict[str, Any]] = ..., - init_parameters: Optional[dict[str, Any]] = ..., - metrics: Optional[dict[str, EvaluatorMetric]] = ... + hours: list[int] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EntraAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator='Entra'): - type: Literal[AgentEndpointAuthorizationSchemeType.ENTRA] + class azure.ai.projects.models.DataGenerationJob(_Model): + created_at: datetime + error: Optional[ApiError] + finished_at: Optional[datetime] + id: str + inputs: Optional[DataGenerationJobInputs] + result: Optional[DataGenerationJobResult] + status: Union[str, JobStatus] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + inputs: Optional[DataGenerationJobInputs] = ... + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EntraIDCredentials(BaseCredentials, discriminator='AAD'): - type: Literal[CredentialType.ENTRA_ID] + class azure.ai.projects.models.DataGenerationJobInputs(_Model): + name: str + options: DataGenerationJobOptions + output_options: Optional[DataGenerationJobOutputOptions] + scenario: Union[str, DataGenerationJobScenario] + sources: list[DataGenerationJobSource] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + name: str, + options: DataGenerationJobOptions, + output_options: Optional[DataGenerationJobOutputOptions] = ..., + scenario: Union[str, DataGenerationJobScenario], + sources: list[DataGenerationJobSource] + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvalCsvFileIdSource(TypedDict, total=False): - key "id": Required[str] - key "type": Required[Literal["file_id"]] - - - class azure.ai.projects.models.EvalCsvRunDataSource(TypedDict, total=False): - key "source": Required[EvalCsvFileIdSource] - key "type": Required[Literal["csv"]] - - - class azure.ai.projects.models.EvalResult(_Model): - name: str - passed: bool - score: float + class azure.ai.projects.models.DataGenerationJobOptions(_Model): + max_samples: int + model_options: Optional[DataGenerationModelOptions] + train_split: Optional[float] type: str @overload def __init__( self, *, - name: str, - passed: bool, - score: float, + max_samples: int, + model_options: Optional[DataGenerationModelOptions] = ..., + train_split: Optional[float] = ..., type: str ) -> None: ... @@ -5742,340 +5880,362 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvalRunResultCompareItem(_Model): - delta_estimate: float - p_value: float - treatment_effect: Union[str, TreatmentEffectType] - treatment_run_id: str - treatment_run_summary: EvalRunResultSummary + class azure.ai.projects.models.DataGenerationJobOutput(_Model): + type: str @overload def __init__( self, *, - delta_estimate: float, - p_value: float, - treatment_effect: Union[str, TreatmentEffectType], - treatment_run_id: str, - treatment_run_summary: EvalRunResultSummary + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvalRunResultComparison(_Model): - baseline_run_summary: EvalRunResultSummary - compare_items: list[EvalRunResultCompareItem] - evaluator: str - metric: str - testing_criteria: str + class azure.ai.projects.models.DataGenerationJobOutputOptions(_Model): + description: Optional[str] + name: Optional[str] + tags: Optional[dict[str, str]] @overload def __init__( self, *, - baseline_run_summary: EvalRunResultSummary, - compare_items: list[EvalRunResultCompareItem], - evaluator: str, - metric: str, - testing_criteria: str + description: Optional[str] = ..., + name: Optional[str] = ..., + tags: Optional[dict[str, str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvalRunResultSummary(_Model): - average: float - run_id: str - sample_count: int - standard_deviation: float + class azure.ai.projects.models.DataGenerationJobOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DATASET = "dataset" + FILE = "file" + + + class azure.ai.projects.models.DataGenerationJobResult(_Model): + generated_samples: int + outputs: Optional[list[DataGenerationJobOutput]] + token_usage: Optional[DataGenerationTokenUsage] @overload def __init__( self, *, - average: float, - run_id: str, - sample_count: int, - standard_deviation: float + generated_samples: int, + outputs: Optional[list[DataGenerationJobOutput]] = ..., + token_usage: Optional[DataGenerationTokenUsage] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluationComparisonInsightRequest(InsightRequest, discriminator='EvaluationComparison'): - baseline_run_id: str - eval_id: str - treatment_run_ids: list[str] - type: Literal[InsightType.EVALUATION_COMPARISON] + class azure.ai.projects.models.DataGenerationJobScenario(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EVALUATION = "evaluation" + REINFORCEMENT_FINETUNING = "reinforcement_finetuning" + SUPERVISED_FINETUNING = "supervised_finetuning" + + + class azure.ai.projects.models.DataGenerationJobSource(_Model): + description: Optional[str] + type: str @overload def __init__( self, *, - baseline_run_id: str, - eval_id: str, - treatment_run_ids: list[str] + description: Optional[str] = ..., + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluationComparisonInsightResult(InsightResult, discriminator='EvaluationComparison'): - comparisons: list[EvalRunResultComparison] - method: str - type: Literal[InsightType.EVALUATION_COMPARISON] + class azure.ai.projects.models.DataGenerationJobSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT = "agent" + FILE = "file" + PROMPT = "prompt" + TRACES = "traces" + + + class azure.ai.projects.models.DataGenerationJobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SIMPLE_QNA = "simple_qna" + SIMULATION_SEED = "simulation_seed" + TOOL_USE = "tool_use" + TRACES = "traces" + + + class azure.ai.projects.models.DataGenerationModelOptions(_Model): + model: str @overload def __init__( self, *, - comparisons: list[EvalRunResultComparison], - method: str + model: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluationLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CONVERSATION = "conversation" - TURN = "turn" + class azure.ai.projects.models.DataGenerationTokenUsage(_Model): + completion_tokens: int + prompt_tokens: int + total_tokens: int - class azure.ai.projects.models.EvaluationResultSample(InsightSample, discriminator='EvaluationResultSample'): - correlation_info: dict[str, any] - evaluation_result: EvalResult - features: dict[str, any] - id: str - type: Literal[SampleType.EVALUATION_RESULT_SAMPLE] + class azure.ai.projects.models.DatasetCredential(_Model): + blob_reference: BlobReference @overload def __init__( self, *, - correlation_info: dict[str, Any], - evaluation_result: EvalResult, - features: dict[str, Any], - id: str + blob_reference: BlobReference ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluationRule(_Model): - action: EvaluationRuleAction + class azure.ai.projects.models.DatasetDataGenerationJobOutput(DataGenerationJobOutput, discriminator='dataset'): description: Optional[str] - display_name: Optional[str] - enabled: bool - event_type: Union[str, EvaluationRuleEventType] - filter: Optional[EvaluationRuleFilter] - id: str - system_data: dict[str, str] + id: Optional[str] + name: Optional[str] + tags: Optional[dict[str, str]] + type: Literal[DataGenerationJobOutputType.DATASET] + version: Optional[str] @overload - def __init__( - self, - *, - action: EvaluationRuleAction, - description: Optional[str] = ..., - display_name: Optional[str] = ..., - enabled: bool, - event_type: Union[str, EvaluationRuleEventType], - filter: Optional[EvaluationRuleFilter] = ... - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluationRuleAction(_Model): - type: str + class azure.ai.projects.models.DatasetEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator='dataset'): + description: Optional[str] + name: str + type: Literal[EvaluatorGenerationJobSourceType.DATASET] + version: Optional[str] @overload def __init__( self, *, - type: str + description: Optional[str] = ..., + name: str, + version: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluationRuleActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CONTINUOUS_EVALUATION = "continuousEvaluation" - HUMAN_EVALUATION_PREVIEW = "humanEvaluationPreview" + class azure.ai.projects.models.DatasetGenerationLROPoller(LROPoller[DataGenerationJobResult]): + property details: Mapping[str, Any] # Read-only + def __init__( + self, + client: Any, + initial_response: Any, + deserialization_callback: Any, + polling_method: Any + ) -> None: ... - class azure.ai.projects.models.EvaluationRuleEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - MANUAL = "manual" - RESPONSE_COMPLETED = "responseCompleted" + @classmethod + def from_continuation_token( + cls, + polling_method: PollingMethod[DataGenerationJobResult], + continuation_token: str, + **kwargs: Any + ) -> DatasetGenerationLROPoller: ... - class azure.ai.projects.models.EvaluationRuleFilter(_Model): - agent_name: str + class azure.ai.projects.models.DatasetReference(_Model): + name: str + version: str @overload def __init__( self, *, - agent_name: str + name: str, + version: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluationRunClusterInsightRequest(InsightRequest, discriminator='EvaluationRunClusterInsight'): - eval_id: str - model_configuration: Optional[InsightModelConfiguration] - run_ids: list[str] - type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] + class azure.ai.projects.models.DatasetType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + URI_FILE = "uri_file" + URI_FOLDER = "uri_folder" + + + class azure.ai.projects.models.DatasetVersion(_Model): + connection_name: Optional[str] + data_uri: str + description: Optional[str] + id: Optional[str] + is_reference: Optional[bool] + name: str + tags: Optional[dict[str, str]] + type: str + version: str @overload def __init__( self, *, - eval_id: str, - model_configuration: Optional[InsightModelConfiguration] = ..., - run_ids: list[str] + connection_name: Optional[str] = ..., + data_uri: str, + description: Optional[str] = ..., + tags: Optional[dict[str, str]] = ..., + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluationRunClusterInsightResult(InsightResult, discriminator='EvaluationRunClusterInsight'): - cluster_insight: ClusterInsightResult - type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] + class azure.ai.projects.models.DayOfWeek(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FRIDAY = "Friday" + MONDAY = "Monday" + SATURDAY = "Saturday" + SUNDAY = "Sunday" + THURSDAY = "Thursday" + TUESDAY = "Tuesday" + WEDNESDAY = "Wednesday" + + + class azure.ai.projects.models.DeleteAgentResponse(_Model): + deleted: bool + name: str + object: Literal[AgentObjectType.AGENT_DELETED] @overload def __init__( self, *, - cluster_insight: ClusterInsightResult + deleted: bool, + name: str, + object: Literal[AgentObjectType.AGENT_DELETED] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluationScheduleTask(ScheduleTask, discriminator='Evaluation'): - configuration: dict[str, str] - eval_id: str - eval_run: dict[str, Any] - type: Literal[ScheduleTaskType.EVALUATION] + class azure.ai.projects.models.DeleteAgentVersionResponse(_Model): + deleted: bool + name: str + object: Literal[AgentObjectType.AGENT_VERSION_DELETED] + version: str @overload def __init__( self, *, - configuration: Optional[dict[str, str]] = ..., - eval_id: str, - eval_run: dict[str, Any] + deleted: bool, + name: str, + object: Literal[AgentObjectType.AGENT_VERSION_DELETED], + version: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluationTarget(_Model): - type: str + class azure.ai.projects.models.DeleteMemoryResult(_Model): + deleted: bool + memory_id: str + object: Literal[MemoryStoreObjectType.MEMORY_DELETED] @overload def __init__( self, *, - type: str + deleted: bool, + memory_id: str, + object: Literal[MemoryStoreObjectType.MEMORY_DELETED] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluationTaxonomy(_Model): - description: Optional[str] - id: Optional[str] + class azure.ai.projects.models.DeleteMemoryStoreResult(_Model): + deleted: bool name: str - properties: Optional[dict[str, str]] - tags: Optional[dict[str, str]] - taxonomy_categories: Optional[list[TaxonomyCategory]] - taxonomy_input: EvaluationTaxonomyInput - version: str + object: Literal[MemoryStoreObjectType.MEMORY_STORE_DELETED] @overload def __init__( self, *, - description: Optional[str] = ..., - properties: Optional[dict[str, str]] = ..., - tags: Optional[dict[str, str]] = ..., - taxonomy_categories: Optional[list[TaxonomyCategory]] = ..., - taxonomy_input: EvaluationTaxonomyInput + deleted: bool, + name: str, + object: Literal[MemoryStoreObjectType.MEMORY_STORE_DELETED] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluationTaxonomyInput(_Model): - type: str + class azure.ai.projects.models.DeleteSkillResult(_Model): + deleted: bool + id: str + name: str @overload def __init__( self, *, - type: str + deleted: bool, + id: str, + name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluationTaxonomyInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENT = "agent" - POLICY = "policy" - - - class azure.ai.projects.models.EvaluatorCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENTS = "agents" - QUALITY = "quality" - SAFETY = "safety" - - - class azure.ai.projects.models.EvaluatorCredentialRequest(_Model): - blob_uri: str + class azure.ai.projects.models.DeleteSkillVersionResult(_Model): + deleted: bool + id: str + name: str + version: str @overload def __init__( self, *, - blob_uri: str + deleted: bool, + id: str, + name: str, + version: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluatorDefinition(_Model): - data_schema: Optional[dict[str, Any]] - init_parameters: Optional[dict[str, Any]] - metrics: Optional[dict[str, EvaluatorMetric]] + class azure.ai.projects.models.Deployment(_Model): + name: str type: str @overload def __init__( self, *, - data_schema: Optional[dict[str, Any]] = ..., - init_parameters: Optional[dict[str, Any]] = ..., - metrics: Optional[dict[str, EvaluatorMetric]] = ..., type: str ) -> None: ... @@ -6083,338 +6243,261 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluatorDefinitionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CODE = "code" - ENDPOINT = "endpoint" - OPENAI_GRADERS = "openai_graders" - PROMPT = "prompt" - PROMPT_AND_CODE = "prompt_and_code" - RUBRIC = "rubric" - SERVICE = "service" - - - class azure.ai.projects.models.EvaluatorGenerationArtifacts(_Model): - dataset: DatasetReference - kinds: list[str] + class azure.ai.projects.models.DeploymentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MODEL_DEPLOYMENT = "ModelDeployment" - @overload - def __init__( - self, - *, - dataset: DatasetReference, - kinds: list[str] - ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.DigitalWorkerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + M365 = "m365" - class azure.ai.projects.models.EvaluatorGenerationInputs(_Model): - evaluator_description: Optional[str] - evaluator_display_name: Optional[str] - evaluator_name: str - model: str - sources: list[EvaluatorGenerationJobSource] + class azure.ai.projects.models.Dimension(_Model): + always_applicable: Optional[bool] + description: str + id: str + weight: int @overload def __init__( self, *, - evaluator_description: Optional[str] = ..., - evaluator_display_name: Optional[str] = ..., - evaluator_name: str, - model: str, - sources: list[EvaluatorGenerationJobSource] + always_applicable: Optional[bool] = ..., + description: str, + id: str, + weight: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluatorGenerationJob(_Model): - created_at: datetime - error: Optional[ApiError] - finished_at: Optional[datetime] - id: str - input_quality_warnings: Optional[list[RubricGenerationInputQualityWarning]] - inputs: Optional[EvaluatorGenerationInputs] - result: Optional[EvaluatorVersion] - status: Union[str, JobStatus] - usage: Optional[EvaluatorGenerationTokenUsage] + class azure.ai.projects.models.DispatchRoutineResult(_Model): + action_correlation_id: Optional[str] + dispatch_id: Optional[str] + task_id: Optional[str] @overload def __init__( self, *, - inputs: Optional[EvaluatorGenerationInputs] = ... + action_correlation_id: Optional[str] = ..., + dispatch_id: Optional[str] = ..., + task_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluatorGenerationJobSource(_Model): - type: str + class azure.ai.projects.models.EmbeddingConfiguration(_Model): + embedding_field: str + model_deployment_name: str @overload def __init__( self, *, - type: str + embedding_field: str, + model_deployment_name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluatorGenerationJobSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENT = "agent" - DATASET = "dataset" - PROMPT = "prompt" - TRACES = "traces" + class azure.ai.projects.models.EmptyModelParam(_Model): - class azure.ai.projects.models.EvaluatorGenerationLROPoller(LROPoller[EvaluatorVersion]): - property details: Mapping[str, Any] # Read-only + class azure.ai.projects.models.EndpointBasedEvaluatorDefinition(EvaluatorDefinition, discriminator='endpoint'): + connection_name: str + data_schema: dict[str, any] + init_parameters: dict[str, any] + metrics: dict[str, EvaluatorMetric] + type: Literal[EvaluatorDefinitionType.ENDPOINT] + @overload def __init__( self, - client: Any, - initial_response: Any, - deserialization_callback: Any, - polling_method: Any + *, + connection_name: str, + data_schema: Optional[dict[str, Any]] = ..., + init_parameters: Optional[dict[str, Any]] = ..., + metrics: Optional[dict[str, EvaluatorMetric]] = ... ) -> None: ... - @classmethod - def from_continuation_token( - cls, - polling_method: PollingMethod[EvaluatorVersion], - continuation_token: str, - **kwargs: Any - ) -> EvaluatorGenerationLROPoller: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluatorGenerationTokenUsage(_Model): - input_tokens: int - output_tokens: int - total_tokens: int + class azure.ai.projects.models.EntraAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator='Entra'): + type: Literal[AgentEndpointAuthorizationSchemeType.ENTRA] @overload - def __init__( - self, - *, - input_tokens: int, - output_tokens: int, - total_tokens: int - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluatorMetric(_Model): - desirable_direction: Optional[Union[str, EvaluatorMetricDirection]] - is_primary: Optional[bool] - max_value: Optional[float] - min_value: Optional[float] - threshold: Optional[float] - type: Optional[Union[str, EvaluatorMetricType]] + class azure.ai.projects.models.EntraIDCredentials(BaseCredentials, discriminator='AAD'): + type: Literal[CredentialType.ENTRA_ID] @overload - def __init__( - self, - *, - desirable_direction: Optional[Union[str, EvaluatorMetricDirection]] = ..., - is_primary: Optional[bool] = ..., - max_value: Optional[float] = ..., - min_value: Optional[float] = ..., - threshold: Optional[float] = ..., - type: Optional[Union[str, EvaluatorMetricType]] = ... - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.EvaluatorMetricDirection(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DECREASE = "decrease" - INCREASE = "increase" - NEUTRAL = "neutral" - - - class azure.ai.projects.models.EvaluatorMetricType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - BOOLEAN = "boolean" - CONTINUOUS = "continuous" - ORDINAL = "ordinal" + class azure.ai.projects.models.EvalCsvFileIdSource(TypedDict, total=False): + key "id": Required[str] + key "type": Required[Literal["file_id"]] - class azure.ai.projects.models.EvaluatorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - BUILT_IN = "builtin" - CUSTOM = "custom" + class azure.ai.projects.models.EvalCsvRunDataSource(TypedDict, total=False): + key "source": Required[EvalCsvFileIdSource] + key "type": Required[Literal["csv"]] - class azure.ai.projects.models.EvaluatorVersion(_Model): - categories: list[Union[str, EvaluatorCategory]] - created_at: datetime - created_by: str - definition: EvaluatorDefinition - description: Optional[str] - display_name: Optional[str] - evaluator_type: Union[str, EvaluatorType] - generation_artifacts: Optional[EvaluatorGenerationArtifacts] - generation_job_id: Optional[str] - id: Optional[str] - metadata: Optional[dict[str, str]] - modified_at: datetime + class azure.ai.projects.models.EvalResult(_Model): name: str - supported_evaluation_levels: Optional[list[Union[str, EvaluationLevel]]] - tags: Optional[dict[str, str]] - version: str - warnings: Optional[list[Union[str, GenerationWarningType]]] + passed: bool + score: float + type: str @overload def __init__( self, *, - categories: list[Union[str, EvaluatorCategory]], - definition: EvaluatorDefinition, - description: Optional[str] = ..., - display_name: Optional[str] = ..., - evaluator_type: Union[str, EvaluatorType], - metadata: Optional[dict[str, str]] = ..., - supported_evaluation_levels: Optional[list[Union[str, EvaluationLevel]]] = ..., - tags: Optional[dict[str, str]] = ... + name: str, + passed: bool, + score: float, + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ExternalAgentDefinition(AgentDefinition, discriminator='external'): - kind: Literal[AgentKind.EXTERNAL] - otel_agent_id: Optional[str] - rai_config: RaiConfig + class azure.ai.projects.models.EvalRunResultCompareItem(_Model): + delta_estimate: float + p_value: float + treatment_effect: Union[str, TreatmentEffectType] + treatment_run_id: str + treatment_run_summary: EvalRunResultSummary @overload def __init__( self, *, - otel_agent_id: Optional[str] = ..., - rai_config: Optional[RaiConfig] = ... + delta_estimate: float, + p_value: float, + treatment_effect: Union[str, TreatmentEffectType], + treatment_run_id: str, + treatment_run_summary: EvalRunResultSummary ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FabricDataAgentToolParameters(_Model): - project_connections: Optional[list[ToolProjectConnection]] + class azure.ai.projects.models.EvalRunResultComparison(_Model): + baseline_run_summary: EvalRunResultSummary + compare_items: list[EvalRunResultCompareItem] + evaluator: str + metric: str + testing_criteria: str @overload def __init__( self, *, - project_connections: Optional[list[ToolProjectConnection]] = ... + baseline_run_summary: EvalRunResultSummary, + compare_items: list[EvalRunResultCompareItem], + evaluator: str, + metric: str, + testing_criteria: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FabricIQPreviewTool(Tool, discriminator='fabric_iq_preview'): - project_connection_id: str - require_approval: Optional[Union[MCPToolRequireApproval, str]] - server_label: Optional[str] - server_url: Optional[str] - type: Literal[ToolType.FABRIC_IQ_PREVIEW] - - @overload + class azure.ai.projects.models.EvalRunResultSummary(_Model): + average: float + run_id: str + sample_count: int + standard_deviation: float + + @overload def __init__( self, *, - project_connection_id: str, - require_approval: Optional[Union[MCPToolRequireApproval, str]] = ..., - server_label: Optional[str] = ..., - server_url: Optional[str] = ... + average: float, + run_id: str, + sample_count: int, + standard_deviation: float ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FabricIQPreviewToolboxTool(ToolboxTool, discriminator='fabric_iq_preview'): - description: str - name: str - project_connection_id: str - require_approval: Optional[Union[MCPToolRequireApproval, str]] - server_label: Optional[str] - server_url: Optional[str] - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.FABRIC_IQ_PREVIEW] + class azure.ai.projects.models.EvaluationComparisonInsightRequest(InsightRequest, discriminator='EvaluationComparison'): + baseline_run_id: str + eval_id: str + treatment_run_ids: list[str] + type: Literal[InsightType.EVALUATION_COMPARISON] @overload def __init__( self, *, - description: Optional[str] = ..., - name: Optional[str] = ..., - project_connection_id: str, - require_approval: Optional[Union[MCPToolRequireApproval, str]] = ..., - server_label: Optional[str] = ..., - server_url: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + baseline_run_id: str, + eval_id: str, + treatment_run_ids: list[str] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FieldMapping(_Model): - content_fields: list[str] - filepath_field: Optional[str] - metadata_fields: Optional[list[str]] - title_field: Optional[str] - url_field: Optional[str] - vector_fields: Optional[list[str]] + class azure.ai.projects.models.EvaluationComparisonInsightResult(InsightResult, discriminator='EvaluationComparison'): + comparisons: list[EvalRunResultComparison] + method: str + type: Literal[InsightType.EVALUATION_COMPARISON] @overload def __init__( self, *, - content_fields: list[str], - filepath_field: Optional[str] = ..., - metadata_fields: Optional[list[str]] = ..., - title_field: Optional[str] = ..., - url_field: Optional[str] = ..., - vector_fields: Optional[list[str]] = ... + comparisons: list[EvalRunResultComparison], + method: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FileDataGenerationJobOutput(DataGenerationJobOutput, discriminator='file'): - filename: str - id: str - type: Literal[DataGenerationJobOutputType.FILE] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.EvaluationLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONVERSATION = "conversation" + TURN = "turn" - class azure.ai.projects.models.FileDataGenerationJobSource(DataGenerationJobSource, discriminator='file'): - description: str + class azure.ai.projects.models.EvaluationResultSample(InsightSample, discriminator='EvaluationResultSample'): + correlation_info: dict[str, any] + evaluation_result: EvalResult + features: dict[str, any] id: str - type: Literal[DataGenerationJobSourceType.FILE] + type: Literal[SampleType.EVALUATION_RESULT_SAMPLE] @overload def __init__( self, *, - description: Optional[str] = ..., + correlation_info: dict[str, Any], + evaluation_result: EvalResult, + features: dict[str, Any], id: str ) -> None: ... @@ -6422,197 +6505,124 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FileDatasetVersion(DatasetVersion, discriminator='uri_file'): - connection_name: str - data_uri: str - description: str + class azure.ai.projects.models.EvaluationRule(_Model): + action: EvaluationRuleAction + description: Optional[str] + display_name: Optional[str] + enabled: bool + event_type: Union[str, EvaluationRuleEventType] + filter: Optional[EvaluationRuleFilter] id: str - is_reference: bool - name: str - tags: dict[str, str] - type: Literal[DatasetType.URI_FILE] - version: str + system_data: dict[str, str] @overload def __init__( self, *, - connection_name: Optional[str] = ..., - data_uri: str, + action: EvaluationRuleAction, description: Optional[str] = ..., - tags: Optional[dict[str, str]] = ... + display_name: Optional[str] = ..., + enabled: bool, + event_type: Union[str, EvaluationRuleEventType], + filter: Optional[EvaluationRuleFilter] = ... ) -> None: ... @overload 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] + class azure.ai.projects.models.EvaluationRuleAction(_Model): + type: 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] + type: 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] - max_num_results: Optional[int] - name: str - ranking_options: Optional[RankingOptions] - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.FILE_SEARCH] - vector_store_ids: Optional[list[str]] + class azure.ai.projects.models.EvaluationRuleActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONTINUOUS_EVALUATION = "continuousEvaluation" + HUMAN_EVALUATION_PREVIEW = "humanEvaluationPreview" - @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: Optional[list[str]] = ... - ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.EvaluationRuleEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MANUAL = "manual" + RESPONSE_COMPLETED = "responseCompleted" - class azure.ai.projects.models.FixedRatioVersionSelectionRule(VersionSelectionRule, discriminator='FixedRatio'): - agent_version: str - traffic_percentage: int - type: Literal[VersionSelectorType.FIXED_RATIO] + class azure.ai.projects.models.EvaluationRuleFilter(_Model): + agent_name: str @overload def __init__( self, *, - agent_version: str, - traffic_percentage: int + agent_name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FolderDatasetVersion(DatasetVersion, discriminator='uri_folder'): - connection_name: str - data_uri: str - description: str - id: str - is_reference: bool - name: str - tags: dict[str, str] - type: Literal[DatasetType.URI_FOLDER] - version: str + class azure.ai.projects.models.EvaluationRunClusterInsightRequest(InsightRequest, discriminator='EvaluationRunClusterInsight'): + eval_id: str + model_configuration: Optional[InsightModelConfiguration] + run_ids: list[str] + type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] @overload def __init__( self, *, - connection_name: Optional[str] = ..., - data_uri: str, - description: Optional[str] = ..., - tags: Optional[dict[str, str]] = ... + eval_id: str, + model_configuration: Optional[InsightModelConfiguration] = ..., + run_ids: list[str] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FoundryModelArtifactProfileCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DATA_ONLY = "DataOnly" - RUNTIME_DEPENDENT = "RuntimeDependent" - UNKNOWN = "Unknown" - - - class azure.ai.projects.models.FoundryModelArtifactProfileSignal(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CUSTOM_PYTHON_CODE = "CustomPythonCode" - DYNAMIC_OPS = "DynamicOps" - NATIVE_BINARY = "NativeBinary" - PICKLE_DESERIALIZATION = "PickleDeserialization" - UNKNOWN_FORMAT = "UnknownFormat" - - - class azure.ai.projects.models.FoundryModelSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - LOCAL_UPLOAD = "LocalUpload" - TRAINING_JOB = "TrainingJob" - - - class azure.ai.projects.models.FoundryModelWarning(_Model): - code: Optional[Union[str, FoundryModelWarningCode]] - message: Optional[str] + class azure.ai.projects.models.EvaluationRunClusterInsightResult(InsightResult, discriminator='EvaluationRunClusterInsight'): + cluster_insight: ClusterInsightResult + type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] @overload def __init__( self, *, - code: Optional[Union[str, FoundryModelWarningCode]] = ..., - message: Optional[str] = ... + cluster_insight: ClusterInsightResult ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FoundryModelWarningCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - RUNTIME_DEPENDENT_ARTIFACT = "RuntimeDependentArtifact" - UNCLASSIFIED_ARTIFACT = "UnclassifiedArtifact" - - - class azure.ai.projects.models.FoundryModelWeightType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DRAFT_MODEL = "DraftModel" - FULL_WEIGHT = "FullWeight" - LO_RA = "LoRA" - - - 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] + class azure.ai.projects.models.EvaluationScheduleTask(ScheduleTask, discriminator='Evaluation'): + configuration: dict[str, str] + eval_id: str + eval_run: dict[str, Any] + type: Literal[ScheduleTaskType.EVALUATION] @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]] = ... + configuration: Optional[dict[str, str]] = ..., + eval_id: str, + eval_run: dict[str, Any] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FunctionShellToolParamEnvironment(_Model): + class azure.ai.projects.models.EvaluationTarget(_Model): type: str @overload @@ -6626,876 +6636,948 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FunctionShellToolParamEnvironmentContainerReferenceParam(FunctionShellToolParamEnvironment, discriminator='container_reference'): - container_id: str - type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE] - - @overload - def __init__( - self, - *, - container_id: str + class azure.ai.projects.models.EvaluationTaxonomy(_Model): + description: Optional[str] + id: Optional[str] + name: str + properties: Optional[dict[str, str]] + tags: Optional[dict[str, str]] + taxonomy_categories: Optional[list[TaxonomyCategory]] + taxonomy_input: EvaluationTaxonomyInput + version: str + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + properties: Optional[dict[str, str]] = ..., + tags: Optional[dict[str, str]] = ..., + taxonomy_categories: Optional[list[TaxonomyCategory]] = ..., + taxonomy_input: EvaluationTaxonomyInput ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FunctionShellToolParamEnvironmentLocalEnvironmentParam(FunctionShellToolParamEnvironment, discriminator='local'): - skills: Optional[list[LocalSkillParam]] - type: Literal[FunctionShellToolParamEnvironmentType.LOCAL] + class azure.ai.projects.models.EvaluationTaxonomyInput(_Model): + type: str @overload def __init__( self, *, - skills: Optional[list[LocalSkillParam]] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FunctionShellToolParamEnvironmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CONTAINER_AUTO = "container_auto" - CONTAINER_REFERENCE = "container_reference" - LOCAL = "local" + class azure.ai.projects.models.EvaluationTaxonomyInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT = "agent" + POLICY = "policy" - class azure.ai.projects.models.FunctionTool(Tool, discriminator='function'): - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] - 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] + class azure.ai.projects.models.EvaluatorCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENTS = "agents" + QUALITY = "quality" + SAFETY = "safety" + + + class azure.ai.projects.models.EvaluatorCredentialRequest(_Model): + blob_uri: str @overload def __init__( self, *, - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., - defer_loading: Optional[bool] = ..., - description: Optional[str] = ..., - name: str, - output_schema: Optional[dict[str, Any]] = ..., - parameters: dict[str, Any], - strict: bool + blob_uri: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FunctionToolParam(_Model): - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] - defer_loading: Optional[bool] - description: Optional[str] - name: str - output_schema: Optional[dict[str, Any]] - parameters: Optional[EmptyModelParam] - strict: Optional[bool] - type: Literal["function"] + class azure.ai.projects.models.EvaluatorDefinition(_Model): + data_schema: Optional[dict[str, Any]] + init_parameters: Optional[dict[str, Any]] + metrics: Optional[dict[str, EvaluatorMetric]] + type: str @overload def __init__( self, *, - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., - defer_loading: Optional[bool] = ..., - description: Optional[str] = ..., - name: str, - output_schema: Optional[dict[str, Any]] = ..., - parameters: Optional[EmptyModelParam] = ..., - strict: Optional[bool] = ... + data_schema: Optional[dict[str, Any]] = ..., + init_parameters: Optional[dict[str, Any]] = ..., + metrics: Optional[dict[str, EvaluatorMetric]] = ..., + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.GenerateVoiceAgentRequest(_Model): - description: Optional[str] - draft: Optional[bool] - goal: Optional[str] - kind: Literal[AgentKind.VOICE] - model: Optional[str] - model_type: Optional[Union[str, VoiceModelType]] - name: str - tools: Optional[list[VoiceAgentTool]] - use_case: Optional[str] + class azure.ai.projects.models.EvaluatorDefinitionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CODE = "code" + ENDPOINT = "endpoint" + OPENAI_GRADERS = "openai_graders" + PROMPT = "prompt" + PROMPT_AND_CODE = "prompt_and_code" + RUBRIC = "rubric" + SERVICE = "service" + + + class azure.ai.projects.models.EvaluatorGenerationArtifacts(_Model): + dataset: DatasetReference + kinds: list[str] @overload def __init__( self, *, - description: Optional[str] = ..., - draft: Optional[bool] = ..., - goal: Optional[str] = ..., - kind: Literal[AgentKind.VOICE], - model: Optional[str] = ..., - model_type: Optional[Union[str, VoiceModelType]] = ..., - name: str, - tools: Optional[list[VoiceAgentTool]] = ..., - use_case: Optional[str] = ... + dataset: DatasetReference, + kinds: list[str] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.GenerationWarningType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - INPUT_QUALITY = "input_quality" - - - class azure.ai.projects.models.GitHubIssueEvent(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CLOSED = "closed" - OPENED = "opened" - - - class azure.ai.projects.models.GitHubIssueRoutineTrigger(RoutineTrigger, discriminator='github_issue'): - connection_id: str - issue_event: Union[str, GitHubIssueEvent] - owner: str - repository: str - type: Literal[RoutineTriggerType.GITHUB_ISSUE] + class azure.ai.projects.models.EvaluatorGenerationInputs(_Model): + evaluator_description: Optional[str] + evaluator_display_name: Optional[str] + evaluator_name: str + model: str + sources: list[EvaluatorGenerationJobSource] @overload def __init__( self, *, - connection_id: str, - issue_event: Union[str, GitHubIssueEvent], - owner: str, - repository: str + evaluator_description: Optional[str] = ..., + evaluator_display_name: Optional[str] = ..., + evaluator_name: str, + model: str, + sources: list[EvaluatorGenerationJobSource] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.GrammarSyntax1(str, Enum, metaclass=CaseInsensitiveEnumMeta): - LARK = "lark" - REGEX = "regex" - - - class azure.ai.projects.models.HeaderTelemetryEndpointAuth(TelemetryEndpointAuth, discriminator='header'): - header_name: str - secret_id: str - secret_key: str - type: Literal[TelemetryEndpointAuthType.HEADER] + class azure.ai.projects.models.EvaluatorGenerationJob(_Model): + created_at: datetime + error: Optional[ApiError] + finished_at: Optional[datetime] + id: str + input_quality_warnings: Optional[list[RubricGenerationInputQualityWarning]] + inputs: Optional[EvaluatorGenerationInputs] + result: Optional[EvaluatorVersion] + status: Union[str, JobStatus] + usage: Optional[EvaluatorGenerationTokenUsage] @overload def __init__( self, *, - header_name: str, - secret_id: str, - secret_key: str + inputs: Optional[EvaluatorGenerationInputs] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.HostedAgentDefinition(AgentDefinition, discriminator='hosted'): - code_configuration: Optional[CodeConfiguration] - container_configuration: Optional[ContainerConfiguration] - cpu: str - environment_variables: Optional[dict[str, str]] - kind: Literal[AgentKind.HOSTED] - memory: str - protocol_versions: Optional[list[ProtocolVersionRecord]] - rai_config: RaiConfig - session_configuration: Optional[SessionConfiguration] - telemetry_config: Optional[TelemetryConfig] + class azure.ai.projects.models.EvaluatorGenerationJobSource(_Model): + type: str @overload def __init__( self, *, - code_configuration: Optional[CodeConfiguration] = ..., - container_configuration: Optional[ContainerConfiguration] = ..., - cpu: str, - environment_variables: Optional[dict[str, str]] = ..., - memory: str, - protocol_versions: Optional[list[ProtocolVersionRecord]] = ..., - rai_config: Optional[RaiConfig] = ..., - session_configuration: Optional[SessionConfiguration] = ..., - telemetry_config: Optional[TelemetryConfig] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.HourlyRecurrenceSchedule(RecurrenceSchedule, discriminator='Hourly'): - type: Literal[RecurrenceType.HOURLY] + class azure.ai.projects.models.EvaluatorGenerationJobSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT = "agent" + DATASET = "dataset" + PROMPT = "prompt" + TRACES = "traces" - @overload - def __init__(self) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.EvaluatorGenerationLROPoller(LROPoller[EvaluatorVersion]): + property details: Mapping[str, Any] # Read-only + def __init__( + self, + client: Any, + initial_response: Any, + deserialization_callback: Any, + polling_method: Any + ) -> None: ... - class azure.ai.projects.models.HumanEvaluationPreviewRuleAction(EvaluationRuleAction, discriminator='humanEvaluationPreview'): - template_id: str - type: Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW] + @classmethod + def from_continuation_token( + cls, + polling_method: PollingMethod[EvaluatorVersion], + continuation_token: str, + **kwargs: Any + ) -> EvaluatorGenerationLROPoller: ... + + + class azure.ai.projects.models.EvaluatorGenerationTokenUsage(_Model): + input_tokens: int + output_tokens: int + total_tokens: int @overload def __init__( self, *, - template_id: str + input_tokens: int, + output_tokens: int, + total_tokens: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.HybridSearchOptions(_Model): - embedding_weight: float - text_weight: float + class azure.ai.projects.models.EvaluatorMetric(_Model): + desirable_direction: Optional[Union[str, EvaluatorMetricDirection]] + is_primary: Optional[bool] + max_value: Optional[float] + min_value: Optional[float] + threshold: Optional[float] + type: Optional[Union[str, EvaluatorMetricType]] @overload def __init__( self, *, - embedding_weight: float, - text_weight: float + desirable_direction: Optional[Union[str, EvaluatorMetricDirection]] = ..., + is_primary: Optional[bool] = ..., + max_value: Optional[float] = ..., + min_value: Optional[float] = ..., + threshold: Optional[float] = ..., + type: Optional[Union[str, EvaluatorMetricType]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ImageGenAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AUTO = "auto" - EDIT = "edit" - GENERATE = "generate" + class azure.ai.projects.models.EvaluatorMetricDirection(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DECREASE = "decrease" + INCREASE = "increase" + NEUTRAL = "neutral" - class azure.ai.projects.models.ImageGenTool(Tool, discriminator='image_generation'): - action: Optional[Union[str, ImageGenAction]] - background: Optional[Literal["transparent", "opaque", "auto"]] + class azure.ai.projects.models.EvaluatorMetricType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BOOLEAN = "boolean" + CONTINUOUS = "continuous" + ORDINAL = "ordinal" + + + class azure.ai.projects.models.EvaluatorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BUILT_IN = "builtin" + CUSTOM = "custom" + + + class azure.ai.projects.models.EvaluatorVersion(_Model): + categories: list[Union[str, EvaluatorCategory]] + created_at: datetime + created_by: str + definition: EvaluatorDefinition 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"], 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"]] - size: Optional[Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str]] - tool_configs: Optional[dict[str, ToolConfig]] - type: Literal[ToolType.IMAGE_GENERATION] + display_name: Optional[str] + evaluator_type: Union[str, EvaluatorType] + generation_artifacts: Optional[EvaluatorGenerationArtifacts] + generation_job_id: Optional[str] + id: Optional[str] + metadata: Optional[dict[str, str]] + modified_at: datetime + name: str + supported_evaluation_levels: Optional[list[Union[str, EvaluationLevel]]] + tags: Optional[dict[str, str]] + version: str + warnings: Optional[list[Union[str, GenerationWarningType]]] @overload def __init__( self, *, - action: Optional[Union[str, ImageGenAction]] = ..., - background: Optional[Literal[transparent, opaque, auto]] = ..., + categories: list[Union[str, EvaluatorCategory]], + definition: EvaluatorDefinition, 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], 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]] = ..., - size: Optional[Union[Literal[1024x1024], Literal[1024x1536], Literal[1536x1024], Literal[auto], str]] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + display_name: Optional[str] = ..., + evaluator_type: Union[str, EvaluatorType], + metadata: Optional[dict[str, str]] = ..., + supported_evaluation_levels: Optional[list[Union[str, EvaluationLevel]]] = ..., + tags: Optional[dict[str, str]] = ... ) -> 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] + class azure.ai.projects.models.ExternalAgentDefinition(AgentDefinition, discriminator='external'): + kind: Literal[AgentKind.EXTERNAL] + otel_agent_id: Optional[str] + rai_config: RaiConfig @overload def __init__( self, *, - file_id: Optional[str] = ..., - image_url: Optional[str] = ... + otel_agent_id: Optional[str] = ..., + rai_config: Optional[RaiConfig] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.Index(_Model): - description: Optional[str] - id: Optional[str] - name: str - tags: Optional[dict[str, str]] - type: str - version: str + class azure.ai.projects.models.FabricDataAgentToolParameters(_Model): + project_connections: Optional[list[ToolProjectConnection]] @overload def __init__( self, *, - description: Optional[str] = ..., - tags: Optional[dict[str, str]] = ..., - type: str + project_connections: Optional[list[ToolProjectConnection]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.IndexType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AZURE_SEARCH = "AzureSearch" - COSMOS_DB = "CosmosDBNoSqlVectorStore" - MANAGED_AZURE_SEARCH = "ManagedAzureSearch" + class azure.ai.projects.models.FabricIQPreviewTool(Tool, discriminator='fabric_iq_preview'): + project_connection_id: str + require_approval: Optional[Union[MCPToolRequireApproval, str]] + server_label: Optional[str] + server_url: Optional[str] + type: Literal[ToolType.FABRIC_IQ_PREVIEW] + @overload + def __init__( + self, + *, + project_connection_id: str, + require_approval: Optional[Union[MCPToolRequireApproval, str]] = ..., + server_label: Optional[str] = ..., + server_url: Optional[str] = ... + ) -> None: ... - class azure.ai.projects.models.InlineSkillParam(ContainerSkill, discriminator='inline'): + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.FabricIQPreviewToolboxTool(ToolboxTool, discriminator='fabric_iq_preview'): description: str name: str - source: InlineSkillSourceParam - type: Literal[ContainerSkillType.INLINE] + project_connection_id: str + require_approval: Optional[Union[MCPToolRequireApproval, str]] + server_label: Optional[str] + server_url: Optional[str] + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.FABRIC_IQ_PREVIEW] @overload def __init__( self, *, - description: str, - name: str, - source: InlineSkillSourceParam + description: Optional[str] = ..., + name: Optional[str] = ..., + project_connection_id: str, + require_approval: Optional[Union[MCPToolRequireApproval, str]] = ..., + server_label: Optional[str] = ..., + server_url: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.InlineSkillSourceParam(_Model): - data: str - media_type: Literal["application/zip"] - type: Literal["base64"] + class azure.ai.projects.models.FieldMapping(_Model): + content_fields: list[str] + filepath_field: Optional[str] + metadata_fields: Optional[list[str]] + title_field: Optional[str] + url_field: Optional[str] + vector_fields: Optional[list[str]] @overload def __init__( self, *, - data: str + content_fields: list[str], + filepath_field: Optional[str] = ..., + metadata_fields: Optional[list[str]] = ..., + title_field: Optional[str] = ..., + url_field: Optional[str] = ..., + vector_fields: Optional[list[str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.InputFidelity(str, Enum, metaclass=CaseInsensitiveEnumMeta): - HIGH = "high" - LOW = "low" + class azure.ai.projects.models.FileDataGenerationJobOutput(DataGenerationJobOutput, discriminator='file'): + filename: str + id: str + type: Literal[DataGenerationJobOutputType.FILE] + @overload + def __init__(self) -> None: ... - class azure.ai.projects.models.Insight(_Model): - display_name: str - insight_id: str - metadata: InsightsMetadata - request: InsightRequest - result: Optional[InsightResult] - state: Union[str, OperationState] + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.FileDataGenerationJobSource(DataGenerationJobSource, discriminator='file'): + description: str + id: str + type: Literal[DataGenerationJobSourceType.FILE] @overload def __init__( self, *, - display_name: str, - request: InsightRequest + description: Optional[str] = ..., + id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.InsightCluster(_Model): + class azure.ai.projects.models.FileDatasetVersion(DatasetVersion, discriminator='uri_file'): + connection_name: str + data_uri: str description: str id: str - label: str - samples: Optional[list[InsightSample]] - sub_clusters: Optional[list[InsightCluster]] - suggestion: str - suggestion_title: str - weight: int + is_reference: bool + name: str + tags: dict[str, str] + type: Literal[DatasetType.URI_FILE] + version: str @overload def __init__( self, *, - description: str, - id: str, - label: str, - samples: Optional[list[InsightSample]] = ..., - sub_clusters: Optional[list[InsightCluster]] = ..., - suggestion: str, - suggestion_title: str, - weight: int + connection_name: Optional[str] = ..., + data_uri: str, + description: Optional[str] = ..., + tags: Optional[dict[str, str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.InsightModelConfiguration(_Model): - model_deployment_name: str + 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, *, - model_deployment_name: str + 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.InsightRequest(_Model): - type: str + class azure.ai.projects.models.FileSearchToolboxTool(ToolboxTool, discriminator='file_search'): + description: str + filters: Optional[Filters] + max_num_results: Optional[int] + name: str + ranking_options: Optional[RankingOptions] + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.FILE_SEARCH] + vector_store_ids: Optional[list[str]] @overload def __init__( self, *, - type: str + 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: Optional[list[str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.InsightResult(_Model): - type: str + class azure.ai.projects.models.FixedRatioVersionSelectionRule(VersionSelectionRule, discriminator='FixedRatio'): + agent_version: str + traffic_percentage: int + type: Literal[VersionSelectorType.FIXED_RATIO] @overload def __init__( self, *, - type: str + agent_version: str, + traffic_percentage: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.InsightSample(_Model): - correlation_info: dict[str, Any] - features: dict[str, Any] + class azure.ai.projects.models.FolderDatasetVersion(DatasetVersion, discriminator='uri_folder'): + connection_name: str + data_uri: str + description: str id: str - type: str - - @overload - def __init__( - self, - *, - correlation_info: dict[str, Any], - features: dict[str, Any], - id: str, - type: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.InsightScheduleTask(ScheduleTask, discriminator='Insight'): - configuration: dict[str, str] - insight: Insight - type: Literal[ScheduleTaskType.INSIGHT] + is_reference: bool + name: str + tags: dict[str, str] + type: Literal[DatasetType.URI_FOLDER] + version: str @overload def __init__( self, *, - configuration: Optional[dict[str, str]] = ..., - insight: Insight + connection_name: Optional[str] = ..., + data_uri: str, + description: Optional[str] = ..., + tags: Optional[dict[str, str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.InsightSummary(_Model): - method: str - sample_count: int - unique_cluster_count: int - unique_subcluster_count: int - usage: ClusterTokenUsage + class azure.ai.projects.models.FoundryModelArtifactProfileCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DATA_ONLY = "DataOnly" + RUNTIME_DEPENDENT = "RuntimeDependent" + UNKNOWN = "Unknown" - @overload - def __init__( - self, - *, - method: str, - sample_count: int, - unique_cluster_count: int, - unique_subcluster_count: int, - usage: ClusterTokenUsage - ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.FoundryModelArtifactProfileSignal(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CUSTOM_PYTHON_CODE = "CustomPythonCode" + DYNAMIC_OPS = "DynamicOps" + NATIVE_BINARY = "NativeBinary" + PICKLE_DESERIALIZATION = "PickleDeserialization" + UNKNOWN_FORMAT = "UnknownFormat" - class azure.ai.projects.models.InsightType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENT_CLUSTER_INSIGHT = "AgentClusterInsight" - EVALUATION_COMPARISON = "EvaluationComparison" - EVALUATION_RUN_CLUSTER_INSIGHT = "EvaluationRunClusterInsight" + class azure.ai.projects.models.FoundryModelSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LOCAL_UPLOAD = "LocalUpload" + TRAINING_JOB = "TrainingJob" - class azure.ai.projects.models.InsightsMetadata(_Model): - completed_at: Optional[datetime] - created_at: datetime + class azure.ai.projects.models.FoundryModelWarning(_Model): + code: Optional[Union[str, FoundryModelWarningCode]] + message: Optional[str] @overload def __init__( self, *, - completed_at: Optional[datetime] = ..., - created_at: datetime + code: Optional[Union[str, FoundryModelWarningCode]] = ..., + message: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.InvocationsProtocolConfiguration(_Model): + class azure.ai.projects.models.FoundryModelWarningCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + RUNTIME_DEPENDENT_ARTIFACT = "RuntimeDependentArtifact" + UNCLASSIFIED_ARTIFACT = "UnclassifiedArtifact" - class azure.ai.projects.models.InvocationsWsProtocolConfiguration(_Model): + class azure.ai.projects.models.FoundryModelWeightType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DRAFT_MODEL = "DraftModel" + FULL_WEIGHT = "FullWeight" + LO_RA = "LoRA" - class azure.ai.projects.models.InvokeAgentInvocationsApiDispatchPayload(RoutineDispatchPayload, discriminator='invoke_agent_invocations_api'): - input: Any - type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API] + 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, *, - input: Any + 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.InvokeAgentInvocationsApiRoutineAction(RoutineAction, discriminator='invoke_agent_invocations_api'): - agent_endpoint_id: Optional[str] - agent_name: Optional[str] - input: Optional[Any] - session_id: Optional[str] - type: Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API] + class azure.ai.projects.models.FunctionShellToolParamEnvironment(_Model): + type: str @overload def __init__( self, *, - agent_endpoint_id: Optional[str] = ..., - agent_name: Optional[str] = ..., - input: Optional[Any] = ..., - session_id: Optional[str] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.InvokeAgentResponsesApiDispatchPayload(RoutineDispatchPayload, discriminator='invoke_agent_responses_api'): - input: Any - type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API] + class azure.ai.projects.models.FunctionShellToolParamEnvironmentContainerReferenceParam(FunctionShellToolParamEnvironment, discriminator='container_reference'): + container_id: str + type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE] @overload def __init__( self, *, - input: Any + container_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.InvokeAgentResponsesApiRoutineAction(RoutineAction, discriminator='invoke_agent_responses_api'): - agent_endpoint_id: Optional[str] - agent_name: Optional[str] - conversation: Optional[str] - input: Optional[Any] - type: Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API] + class azure.ai.projects.models.FunctionShellToolParamEnvironmentLocalEnvironmentParam(FunctionShellToolParamEnvironment, discriminator='local'): + skills: Optional[list[LocalSkillParam]] + type: Literal[FunctionShellToolParamEnvironmentType.LOCAL] @overload def __init__( self, *, - agent_endpoint_id: Optional[str] = ..., - agent_name: Optional[str] = ..., - conversation: Optional[str] = ..., - input: Optional[Any] = ... + skills: Optional[list[LocalSkillParam]] = ... ) -> 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.FunctionShellToolParamEnvironmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONTAINER_AUTO = "container_auto" + CONTAINER_REFERENCE = "container_reference" + LOCAL = "local" - class azure.ai.projects.models.LocalShellToolParam(Tool, discriminator='local_shell'): + class azure.ai.projects.models.FunctionTool(Tool, discriminator='function'): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] + defer_loading: Optional[bool] description: Optional[str] - name: Optional[str] - tool_configs: Optional[dict[str, ToolConfig]] - type: Literal[ToolType.LOCAL_SHELL] + 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]]] = ..., + defer_loading: Optional[bool] = ..., description: Optional[str] = ..., - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + 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.LocalSkillParam(_Model): - description: str + class azure.ai.projects.models.FunctionToolParam(_Model): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] + defer_loading: Optional[bool] + description: Optional[str] name: str - path: str + output_schema: Optional[dict[str, Any]] + parameters: Optional[EmptyModelParam] + strict: Optional[bool] + type: Literal["function"] @overload def __init__( self, *, - description: str, + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., + defer_loading: Optional[bool] = ..., + description: Optional[str] = ..., name: str, - path: str + output_schema: Optional[dict[str, Any]] = ..., + parameters: Optional[EmptyModelParam] = ..., + strict: Optional[bool] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.LogProbProperties(_Model): - bytes: list[int] - logprob: float - token: str + class azure.ai.projects.models.GenerateVoiceAgentRequest(_Model): + description: Optional[str] + draft: Optional[bool] + goal: Optional[str] + kind: Literal[AgentKind.VOICE] + model: Optional[str] + model_type: Optional[Union[str, VoiceModelType]] + name: str + tools: Optional[list[VoiceAgentTool]] + use_case: Optional[str] @overload def __init__( self, *, - bytes: list[int], - logprob: float, - token: str + description: Optional[str] = ..., + draft: Optional[bool] = ..., + goal: Optional[str] = ..., + kind: Literal[AgentKind.VOICE], + model: Optional[str] = ..., + model_type: Optional[Union[str, VoiceModelType]] = ..., + name: str, + tools: Optional[list[VoiceAgentTool]] = ..., + use_case: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.LoraConfig(_Model): - alpha: Optional[int] - dropout: Optional[float] - rank: Optional[int] - target_modules: Optional[list[str]] + class azure.ai.projects.models.GenerationWarningType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INPUT_QUALITY = "input_quality" + + + class azure.ai.projects.models.GitHubIssueEvent(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CLOSED = "closed" + OPENED = "opened" + + + class azure.ai.projects.models.GitHubIssueRoutineTrigger(RoutineTrigger, discriminator='github_issue'): + connection_id: str + issue_event: Union[str, GitHubIssueEvent] + owner: str + repository: str + type: Literal[RoutineTriggerType.GITHUB_ISSUE] @overload def __init__( self, *, - alpha: Optional[int] = ..., - dropout: Optional[float] = ..., - rank: Optional[int] = ..., - target_modules: Optional[list[str]] = ... + connection_id: str, + issue_event: Union[str, GitHubIssueEvent], + owner: str, + repository: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MCPListToolsTool(_Model): - annotations: Optional[MCPListToolsToolAnnotations] - description: Optional[str] - input_schema: MCPListToolsToolInputSchema - name: str + class azure.ai.projects.models.GrammarSyntax1(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LARK = "lark" + REGEX = "regex" - @overload - def __init__( - self, + + class azure.ai.projects.models.HeaderTelemetryEndpointAuth(TelemetryEndpointAuth, discriminator='header'): + header_name: str + secret_id: str + secret_key: str + type: Literal[TelemetryEndpointAuthType.HEADER] + + @overload + def __init__( + self, *, - annotations: Optional[MCPListToolsToolAnnotations] = ..., - description: Optional[str] = ..., - input_schema: MCPListToolsToolInputSchema, - name: str + header_name: str, + secret_id: str, + secret_key: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MCPListToolsToolAnnotations(_Model): - - - class azure.ai.projects.models.MCPListToolsToolInputSchema(_Model): - - - class azure.ai.projects.models.MCPTool(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] + class azure.ai.projects.models.HostedAgentDefinition(AgentDefinition, discriminator='hosted'): + code_configuration: Optional[CodeConfiguration] + container_configuration: Optional[ContainerConfiguration] + cpu: str + environment_variables: Optional[dict[str, str]] + kind: Literal[AgentKind.HOSTED] + memory: str + protocol_versions: Optional[list[ProtocolVersionRecord]] + rai_config: RaiConfig + session_configuration: Optional[SessionConfiguration] + telemetry_config: Optional[TelemetryConfig] @overload def __init__( self, *, - 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] = ... + code_configuration: Optional[CodeConfiguration] = ..., + container_configuration: Optional[ContainerConfiguration] = ..., + cpu: str, + environment_variables: Optional[dict[str, str]] = ..., + memory: str, + protocol_versions: Optional[list[ProtocolVersionRecord]] = ..., + rai_config: Optional[RaiConfig] = ..., + session_configuration: Optional[SessionConfiguration] = ..., + telemetry_config: Optional[TelemetryConfig] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MCPToolFilter(_Model): - read_only: Optional[bool] - tool_names: Optional[list[str]] + class azure.ai.projects.models.HourlyRecurrenceSchedule(RecurrenceSchedule, discriminator='Hourly'): + type: Literal[RecurrenceType.HOURLY] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.HumanEvaluationPreviewRuleAction(EvaluationRuleAction, discriminator='humanEvaluationPreview'): + template_id: str + type: Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW] @overload def __init__( self, *, - read_only: Optional[bool] = ..., - tool_names: Optional[list[str]] = ... + template_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MCPToolRequireApproval(_Model): - always: Optional[MCPToolFilter] - never: Optional[MCPToolFilter] + class azure.ai.projects.models.HybridSearchOptions(_Model): + embedding_weight: float + text_weight: float @overload def __init__( self, *, - always: Optional[MCPToolFilter] = ..., - never: Optional[MCPToolFilter] = ... + embedding_weight: float, + text_weight: float ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MCPToolboxTool(ToolboxTool, 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] - description: str - headers: Optional[dict[str, str]] - name: 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: dict[str, ToolConfig] - tunnel_id: Optional[str] - type: Literal[ToolboxToolType.MCP] + class azure.ai.projects.models.ImageGenAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "auto" + EDIT = "edit" + 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"], 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"]] + 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, *, - 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] = ..., + action: Optional[Union[str, ImageGenAction]] = ..., + background: Optional[Literal[transparent, opaque, auto]] = ..., description: Optional[str] = ..., - headers: Optional[dict[str, 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], str]] = ..., + moderation: Optional[Literal[auto, low]] = ..., name: Optional[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] = ... + output_compression: Optional[int] = ..., + output_format: Optional[Literal[png, webp, jpeg]] = ..., + partial_images: Optional[int] = ..., + 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: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ManagedAgentIdentityBlueprintReference(AgentBlueprintReference, discriminator='ManagedAgentIdentityBlueprint'): - blueprint_id: str - type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] + class azure.ai.projects.models.ImageGenToolInputImageMask(_Model): + file_id: Optional[str] + image_url: Optional[str] @overload def __init__( self, *, - blueprint_id: str + file_id: Optional[str] = ..., + image_url: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ManagedAzureAISearchIndex(Index, discriminator='ManagedAzureSearch'): - description: str - id: str + class azure.ai.projects.models.Index(_Model): + description: Optional[str] + id: Optional[str] name: str - tags: dict[str, str] - type: Literal[IndexType.MANAGED_AZURE_SEARCH] - vector_store_id: str + tags: Optional[dict[str, str]] + type: str version: str @overload @@ -7504,939 +7586,993 @@ namespace azure.ai.projects.models *, description: Optional[str] = ..., tags: Optional[dict[str, str]] = ..., - vector_store_id: str + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.McpProtocolConfiguration(_Model): + class azure.ai.projects.models.IndexType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_SEARCH = "AzureSearch" + COSMOS_DB = "CosmosDBNoSqlVectorStore" + MANAGED_AZURE_SEARCH = "ManagedAzureSearch" - class azure.ai.projects.models.MemoryItem(_Model): - content: str - kind: str - memory_id: str - scope: str - updated_at: datetime + class azure.ai.projects.models.InlineSkillParam(ContainerSkill, discriminator='inline'): + description: str + name: str + source: InlineSkillSourceParam + type: Literal[ContainerSkillType.INLINE] @overload def __init__( self, *, - content: str, - kind: str, - memory_id: str, - scope: str, - updated_at: datetime + description: str, + name: str, + source: InlineSkillSourceParam ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryItemKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CHAT_SUMMARY = "chat_summary" - PROCEDURAL = "procedural" - USER_PROFILE = "user_profile" - - - class azure.ai.projects.models.MemoryOperation(_Model): - kind: Union[str, MemoryOperationKind] - memory_item: MemoryItem + class azure.ai.projects.models.InlineSkillSourceParam(_Model): + data: str + media_type: Literal["application/zip"] + type: Literal["base64"] @overload def __init__( self, *, - kind: Union[str, MemoryOperationKind], - memory_item: MemoryItem + data: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryOperationKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CREATE = "create" - DELETE = "delete" - UPDATE = "update" + class azure.ai.projects.models.InputFidelity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HIGH = "high" + LOW = "low" - class azure.ai.projects.models.MemorySearchItem(_Model): - memory_item: MemoryItem + class azure.ai.projects.models.Insight(_Model): + display_name: str + insight_id: str + metadata: InsightsMetadata + request: InsightRequest + result: Optional[InsightResult] + state: Union[str, OperationState] @overload def __init__( self, *, - memory_item: MemoryItem + display_name: str, + request: InsightRequest ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemorySearchOptions(_Model): - max_memories: Optional[int] + class azure.ai.projects.models.InsightCluster(_Model): + description: str + id: str + label: str + samples: Optional[list[InsightSample]] + sub_clusters: Optional[list[InsightCluster]] + suggestion: str + suggestion_title: str + weight: int @overload def __init__( self, *, - max_memories: Optional[int] = ... + description: str, + id: str, + label: str, + samples: Optional[list[InsightSample]] = ..., + sub_clusters: Optional[list[InsightCluster]] = ..., + suggestion: str, + suggestion_title: str, + weight: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemorySearchPreviewTool(Tool, discriminator='memory_search_preview'): - memory_store_name: str - scope: str - search_options: Optional[MemorySearchOptions] - type: Literal[ToolType.MEMORY_SEARCH_PREVIEW] - update_delay: Optional[int] + class azure.ai.projects.models.InsightModelConfiguration(_Model): + model_deployment_name: str @overload def __init__( self, *, - memory_store_name: str, - scope: str, - search_options: Optional[MemorySearchOptions] = ..., - update_delay: Optional[int] = ... + model_deployment_name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryStoreDefaultDefinition(MemoryStoreDefinition, discriminator='default'): - chat_model: str - embedding_model: str - kind: Literal[MemoryStoreKind.DEFAULT] - options: Optional[MemoryStoreDefaultOptions] + class azure.ai.projects.models.InsightRequest(_Model): + type: str @overload def __init__( self, *, - chat_model: str, - embedding_model: str, - options: Optional[MemoryStoreDefaultOptions] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryStoreDefaultOptions(_Model): - chat_summary_enabled: bool - default_ttl_seconds: Optional[timedelta] - procedural_memory_enabled: Optional[bool] - user_profile_details: Optional[str] - user_profile_enabled: bool + class azure.ai.projects.models.InsightResult(_Model): + type: str @overload def __init__( self, *, - chat_summary_enabled: bool, - default_ttl_seconds: Optional[timedelta] = ..., - procedural_memory_enabled: Optional[bool] = ..., - user_profile_details: Optional[str] = ..., - user_profile_enabled: bool + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryStoreDefinition(_Model): - kind: str + class azure.ai.projects.models.InsightSample(_Model): + correlation_info: dict[str, Any] + features: dict[str, Any] + id: str + type: str @overload def __init__( self, *, - kind: str + correlation_info: dict[str, Any], + features: dict[str, Any], + id: str, + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryStoreDeleteScopeResult(_Model): - deleted: bool - name: str - object: Literal[MemoryStoreObjectType.MEMORY_STORE_SCOPE_DELETED] - scope: str + class azure.ai.projects.models.InsightScheduleTask(ScheduleTask, discriminator='Insight'): + configuration: dict[str, str] + insight: Insight + type: Literal[ScheduleTaskType.INSIGHT] @overload def __init__( self, *, - deleted: bool, - name: str, - object: Literal[MemoryStoreObjectType.MEMORY_STORE_SCOPE_DELETED], - scope: str + configuration: Optional[dict[str, str]] = ..., + insight: Insight ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryStoreDetails(_Model): + class azure.ai.projects.models.InsightSummary(_Model): + method: str + sample_count: int + unique_cluster_count: int + unique_subcluster_count: int + usage: ClusterTokenUsage + + @overload + def __init__( + self, + *, + method: str, + sample_count: int, + unique_cluster_count: int, + unique_subcluster_count: int, + usage: ClusterTokenUsage + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.InsightType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT_CLUSTER_INSIGHT = "AgentClusterInsight" + EVALUATION_COMPARISON = "EvaluationComparison" + EVALUATION_RUN_CLUSTER_INSIGHT = "EvaluationRunClusterInsight" + + + class azure.ai.projects.models.InsightsMetadata(_Model): + completed_at: Optional[datetime] created_at: datetime - definition: MemoryStoreDefinition - description: Optional[str] - id: str - metadata: Optional[dict[str, str]] - name: str - object: Literal[MemoryStoreObjectType.MEMORY_STORE] - updated_at: datetime @overload def __init__( self, *, - created_at: datetime, - definition: MemoryStoreDefinition, - description: Optional[str] = ..., - id: str, - metadata: Optional[dict[str, str]] = ..., - name: str, - object: Literal[MemoryStoreObjectType.MEMORY_STORE], - updated_at: datetime + completed_at: Optional[datetime] = ..., + created_at: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryStoreKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DEFAULT = "default" + class azure.ai.projects.models.InvocationsProtocolConfiguration(_Model): - class azure.ai.projects.models.MemoryStoreObjectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - MEMORY_DELETED = "memory_store.item.deleted" - MEMORY_STORE = "memory_store" - MEMORY_STORE_DELETED = "memory_store.deleted" - MEMORY_STORE_SCOPE_DELETED = "memory_store.scope.deleted" + class azure.ai.projects.models.InvocationsWsProtocolConfiguration(_Model): - class azure.ai.projects.models.MemoryStoreOperationUsage(_Model): - embedding_tokens: int - input_tokens: int - input_tokens_details: ResponseUsageInputTokensDetails - output_tokens: int - output_tokens_details: ResponseUsageOutputTokensDetails - total_tokens: int + class azure.ai.projects.models.InvokeAgentInvocationsApiDispatchPayload(RoutineDispatchPayload, discriminator='invoke_agent_invocations_api'): + input: Any + type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API] @overload def __init__( self, *, - embedding_tokens: int, - input_tokens: int, - input_tokens_details: ResponseUsageInputTokensDetails, - output_tokens: int, - output_tokens_details: ResponseUsageOutputTokensDetails, - total_tokens: int + input: Any ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryStoreSearchResult(_Model): - memories: list[MemorySearchItem] - search_id: str - usage: MemoryStoreOperationUsage + class azure.ai.projects.models.InvokeAgentInvocationsApiRoutineAction(RoutineAction, discriminator='invoke_agent_invocations_api'): + agent_endpoint_id: Optional[str] + agent_name: Optional[str] + input: Optional[Any] + session_id: Optional[str] + type: Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API] @overload def __init__( self, *, - memories: list[MemorySearchItem], - search_id: str, - usage: MemoryStoreOperationUsage + agent_endpoint_id: Optional[str] = ..., + agent_name: Optional[str] = ..., + input: Optional[Any] = ..., + session_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryStoreUpdateCompletedResult(_Model): - memory_operations: list[MemoryOperation] - usage: MemoryStoreOperationUsage + class azure.ai.projects.models.InvokeAgentResponsesApiDispatchPayload(RoutineDispatchPayload, discriminator='invoke_agent_responses_api'): + input: Any + type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API] @overload def __init__( self, *, - memory_operations: list[MemoryOperation], - usage: MemoryStoreOperationUsage + input: Any ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MemoryStoreUpdateResult(_Model): - error: Optional[ApiError] - result: Optional[MemoryStoreUpdateCompletedResult] - status: Union[str, MemoryStoreUpdateStatus] - superseded_by: Optional[str] - update_id: str + class azure.ai.projects.models.InvokeAgentResponsesApiRoutineAction(RoutineAction, discriminator='invoke_agent_responses_api'): + agent_endpoint_id: Optional[str] + agent_name: Optional[str] + conversation: Optional[str] + input: Optional[Any] + type: Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API] @overload def __init__( self, *, - error: Optional[ApiError] = ..., - result: Optional[MemoryStoreUpdateCompletedResult] = ..., - status: Union[str, MemoryStoreUpdateStatus], - superseded_by: Optional[str] = ..., - update_id: str + 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.MemoryStoreUpdateStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - COMPLETED = "completed" + class azure.ai.projects.models.JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELLED = "cancelled" FAILED = "failed" IN_PROGRESS = "in_progress" QUEUED = "queued" - SUPERSEDED = "superseded" - - - class azure.ai.projects.models.Metadata(_Model): + SUCCEEDED = "succeeded" - class azure.ai.projects.models.Microsoft365PermissionScopes(_Model): - resource_app_id: str - scopes: list[str] + 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, *, - resource_app_id: str, - scopes: list[str] + 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.Microsoft365PublishDefaults(_Model): - agent_display_name: Optional[str] - agent_name: Optional[str] - app_publish_scope: Optional[Union[str, Microsoft365PublishScope]] - app_registration_client_id: Optional[str] - app_version: Optional[str] - bot_service_arm_id: Optional[str] - developer_name: Optional[str] - developer_website_url: Optional[str] - full_description: Optional[str] - privacy_url: Optional[str] - recommended_next_app_version: Optional[str] - short_description: Optional[str] - teams_app_id: Optional[str] - terms_of_use_url: Optional[str] - title_id: Optional[str] + class azure.ai.projects.models.LocalSkillParam(_Model): + description: str + name: str + path: str @overload def __init__( self, *, - agent_display_name: Optional[str] = ..., - agent_name: Optional[str] = ..., - app_publish_scope: Optional[Union[str, Microsoft365PublishScope]] = ..., - app_registration_client_id: Optional[str] = ..., - app_version: Optional[str] = ..., - bot_service_arm_id: Optional[str] = ..., - developer_name: Optional[str] = ..., - developer_website_url: Optional[str] = ..., - full_description: Optional[str] = ..., - privacy_url: Optional[str] = ..., - recommended_next_app_version: Optional[str] = ..., - short_description: Optional[str] = ..., - teams_app_id: Optional[str] = ..., - terms_of_use_url: Optional[str] = ..., - title_id: Optional[str] = ... + description: str, + name: str, + path: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.Microsoft365PublishResult(_Model): - teams_app_id: Optional[str] - title_id: Optional[str] + class azure.ai.projects.models.LogProbProperties(_Model): + bytes: list[int] + logprob: float + token: str @overload def __init__( self, *, - teams_app_id: Optional[str] = ..., - title_id: Optional[str] = ... + bytes: list[int], + logprob: float, + token: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.Microsoft365PublishScope(str, Enum, metaclass=CaseInsensitiveEnumMeta): - PERSONAL = "Personal" - SHARED = "Shared" - TENANT = "Tenant" - - - class azure.ai.projects.models.MicrosoftFabricPreviewTool(Tool, discriminator='fabric_dataagent_preview'): - fabric_dataagent_preview: FabricDataAgentToolParameters - type: Literal[ToolType.FABRIC_DATAAGENT_PREVIEW] + class azure.ai.projects.models.LoraConfig(_Model): + alpha: Optional[int] + dropout: Optional[float] + rank: Optional[int] + target_modules: Optional[list[str]] @overload def __init__( self, *, - fabric_dataagent_preview: FabricDataAgentToolParameters + alpha: Optional[int] = ..., + dropout: Optional[float] = ..., + rank: Optional[int] = ..., + target_modules: Optional[list[str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ModelCredentialRequest(_Model): - blob_uri: str + class azure.ai.projects.models.MCPListToolsTool(_Model): + annotations: Optional[MCPListToolsToolAnnotations] + description: Optional[str] + input_schema: MCPListToolsToolInputSchema + name: str @overload def __init__( self, *, - blob_uri: str + annotations: Optional[MCPListToolsToolAnnotations] = ..., + description: Optional[str] = ..., + input_schema: MCPListToolsToolInputSchema, + name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ModelDeployment(Deployment, discriminator='ModelDeployment'): - capabilities: dict[str, str] - connection_name: Optional[str] - model_name: str - model_publisher: str - model_version: str - name: str - sku: ModelDeploymentSku - type: Literal[DeploymentType.MODEL_DEPLOYMENT] + class azure.ai.projects.models.MCPListToolsToolAnnotations(_Model): - @overload - def __init__(self) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.MCPListToolsToolInputSchema(_Model): - class azure.ai.projects.models.ModelDeploymentSku(_Model): - capacity: int - family: str - name: str - size: str - tier: str + class azure.ai.projects.models.MCPTool(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, *, - capacity: int, - family: str, - name: str, - size: str, - tier: 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.ModelPendingUploadRequest(_Model): - connection_name: Optional[str] - pending_upload_id: Optional[str] - pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] + class azure.ai.projects.models.MCPToolFilter(_Model): + read_only: Optional[bool] + tool_names: Optional[list[str]] @overload def __init__( self, *, - connection_name: Optional[str] = ..., - pending_upload_id: Optional[str] = ..., - pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] + read_only: Optional[bool] = ..., + tool_names: Optional[list[str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ModelPendingUploadResponse(_Model): - blob_reference: BlobReference - pending_upload_id: str - pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] - version: Optional[str] + class azure.ai.projects.models.MCPToolRequireApproval(_Model): + always: Optional[MCPToolFilter] + never: Optional[MCPToolFilter] @overload def __init__( self, *, - blob_reference: BlobReference, - pending_upload_id: str, - pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE], - version: Optional[str] = ... + always: Optional[MCPToolFilter] = ..., + never: Optional[MCPToolFilter] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ModelSamplingConfigParam(TypedDict, total=False): - key "max_completion_tokens": int - key "seed": int - key "temperature": float - key "top_p": float - - - class azure.ai.projects.models.ModelSamplingParams(_Model): - max_completion_tokens: Optional[int] - seed: Optional[int] - temperature: Optional[float] - top_p: Optional[float] + class azure.ai.projects.models.MCPToolboxTool(ToolboxTool, 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] + description: str + headers: Optional[dict[str, str]] + name: 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: dict[str, ToolConfig] + tunnel_id: Optional[str] + type: Literal[ToolboxToolType.MCP] @overload def __init__( self, *, - max_completion_tokens: Optional[int] = ..., - seed: Optional[int] = ..., - temperature: Optional[float] = ..., - top_p: Optional[float] = ... + 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] = ..., + description: Optional[str] = ..., + headers: Optional[dict[str, str]] = ..., + name: Optional[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.ModelSourceData(_Model): - job_id: Optional[str] - source_type: Optional[Union[str, FoundryModelSourceType]] + class azure.ai.projects.models.ManagedAgentIdentityBlueprintReference(AgentBlueprintReference, discriminator='ManagedAgentIdentityBlueprint'): + blueprint_id: str + type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] @overload def __init__( self, *, - job_id: Optional[str] = ..., - source_type: Optional[Union[str, FoundryModelSourceType]] = ... + blueprint_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ModelVersion(_Model): - artifact_profile: Optional[ArtifactProfile] - base_model: Optional[str] - blob_uri: str - description: Optional[str] - id: Optional[str] - lora_config: Optional[LoraConfig] + class azure.ai.projects.models.ManagedAzureAISearchIndex(Index, discriminator='ManagedAzureSearch'): + description: str + id: str name: str - source: Optional[ModelSourceData] - tags: Optional[dict[str, str]] + tags: dict[str, str] + type: Literal[IndexType.MANAGED_AZURE_SEARCH] + vector_store_id: str version: str - warnings: Optional[list[FoundryModelWarning]] - weight_type: Optional[Union[str, FoundryModelWeightType]] @overload def __init__( self, *, - base_model: Optional[str] = ..., - blob_uri: str, description: Optional[str] = ..., - lora_config: Optional[LoraConfig] = ..., - source: Optional[ModelSourceData] = ..., tags: Optional[dict[str, str]] = ..., - weight_type: Optional[Union[str, FoundryModelWeightType]] = ... + vector_store_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.MonthlyRecurrenceSchedule(RecurrenceSchedule, discriminator='Monthly'): - days_of_month: list[int] - type: Literal[RecurrenceType.MONTHLY] + class azure.ai.projects.models.McpProtocolConfiguration(_Model): + + + class azure.ai.projects.models.MemoryItem(_Model): + content: str + kind: str + memory_id: str + scope: str + updated_at: datetime @overload def __init__( self, *, - days_of_month: list[int] + content: str, + kind: str, + memory_id: str, + scope: str, + updated_at: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.NamespaceToolParam(Tool, discriminator='namespace'): - description: str - name: str - tools: list[Union[FunctionToolParam, CustomToolParam]] - type: Literal[ToolType.NAMESPACE] + class azure.ai.projects.models.MemoryItemKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CHAT_SUMMARY = "chat_summary" + PROCEDURAL = "procedural" + USER_PROFILE = "user_profile" + + + class azure.ai.projects.models.MemoryOperation(_Model): + kind: Union[str, MemoryOperationKind] + memory_item: MemoryItem @overload def __init__( self, *, - description: str, - name: str, - tools: list[Union[FunctionToolParam, CustomToolParam]] + kind: Union[str, MemoryOperationKind], + memory_item: MemoryItem ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.NoAuthenticationCredentials(BaseCredentials, discriminator='None'): - type: Literal[CredentialType.NONE] + class azure.ai.projects.models.MemoryOperationKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CREATE = "create" + DELETE = "delete" + UPDATE = "update" + + + class azure.ai.projects.models.MemorySearchItem(_Model): + memory_item: MemoryItem @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + memory_item: MemoryItem + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OneTimeTrigger(Trigger, discriminator='OneTime'): - time_zone: Optional[str] - trigger_at: datetime - type: Literal[TriggerType.ONE_TIME] + class azure.ai.projects.models.MemorySearchOptions(_Model): + max_memories: Optional[int] @overload def __init__( self, *, - time_zone: Optional[str] = ..., - trigger_at: datetime + max_memories: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OpenApiAnonymousAuthDetails(OpenApiAuthDetails, discriminator='anonymous'): - type: Literal[OpenApiAuthType.ANONYMOUS] + class azure.ai.projects.models.MemorySearchPreviewTool(Tool, discriminator='memory_search_preview'): + memory_store_name: str + scope: str + search_options: Optional[MemorySearchOptions] + type: Literal[ToolType.MEMORY_SEARCH_PREVIEW] + update_delay: Optional[int] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + memory_store_name: str, + scope: str, + search_options: Optional[MemorySearchOptions] = ..., + update_delay: Optional[int] = ... + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OpenApiAuthDetails(_Model): - type: str + class azure.ai.projects.models.MemoryStoreDefaultDefinition(MemoryStoreDefinition, discriminator='default'): + chat_model: str + embedding_model: str + kind: Literal[MemoryStoreKind.DEFAULT] + options: Optional[MemoryStoreDefaultOptions] @overload def __init__( self, *, - type: str + chat_model: str, + embedding_model: str, + options: Optional[MemoryStoreDefaultOptions] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OpenApiAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ANONYMOUS = "anonymous" - MANAGED_IDENTITY = "managed_identity" - PROJECT_CONNECTION = "project_connection" - - - class azure.ai.projects.models.OpenApiFunctionDefinition(_Model): - auth: OpenApiAuthDetails - default_params: Optional[list[str]] - description: Optional[str] - functions: Optional[list[OpenApiFunctionDefinitionFunction]] - name: str - spec: dict[str, Any] + class azure.ai.projects.models.MemoryStoreDefaultOptions(_Model): + chat_summary_enabled: bool + default_ttl_seconds: Optional[timedelta] + procedural_memory_enabled: Optional[bool] + user_profile_details: Optional[str] + user_profile_enabled: bool @overload def __init__( self, *, - auth: OpenApiAuthDetails, - default_params: Optional[list[str]] = ..., - description: Optional[str] = ..., - name: str, - spec: dict[str, Any] + chat_summary_enabled: bool, + default_ttl_seconds: Optional[timedelta] = ..., + procedural_memory_enabled: Optional[bool] = ..., + user_profile_details: Optional[str] = ..., + user_profile_enabled: bool ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OpenApiFunctionDefinitionFunction(_Model): - description: Optional[str] - name: str - parameters: dict[str, Any] + class azure.ai.projects.models.MemoryStoreDefinition(_Model): + kind: str @overload def __init__( self, *, - description: Optional[str] = ..., - name: str, - parameters: dict[str, Any] + kind: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OpenApiManagedAuthDetails(OpenApiAuthDetails, discriminator='managed_identity'): - security_scheme: OpenApiManagedSecurityScheme - type: Literal[OpenApiAuthType.MANAGED_IDENTITY] + class azure.ai.projects.models.MemoryStoreDeleteScopeResult(_Model): + deleted: bool + name: str + object: Literal[MemoryStoreObjectType.MEMORY_STORE_SCOPE_DELETED] + scope: str @overload def __init__( self, *, - security_scheme: OpenApiManagedSecurityScheme + deleted: bool, + name: str, + object: Literal[MemoryStoreObjectType.MEMORY_STORE_SCOPE_DELETED], + scope: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OpenApiManagedSecurityScheme(_Model): - audience: str + class azure.ai.projects.models.MemoryStoreDetails(_Model): + created_at: datetime + definition: MemoryStoreDefinition + description: Optional[str] + id: str + metadata: Optional[dict[str, str]] + name: str + object: Literal[MemoryStoreObjectType.MEMORY_STORE] + updated_at: datetime @overload def __init__( self, *, - audience: str + created_at: datetime, + definition: MemoryStoreDefinition, + description: Optional[str] = ..., + id: str, + metadata: Optional[dict[str, str]] = ..., + name: str, + object: Literal[MemoryStoreObjectType.MEMORY_STORE], + updated_at: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OpenApiProjectConnectionAuthDetails(OpenApiAuthDetails, discriminator='project_connection'): - security_scheme: OpenApiProjectConnectionSecurityScheme - type: Literal[OpenApiAuthType.PROJECT_CONNECTION] + class azure.ai.projects.models.MemoryStoreKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DEFAULT = "default" + + + class azure.ai.projects.models.MemoryStoreObjectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MEMORY_DELETED = "memory_store.item.deleted" + MEMORY_STORE = "memory_store" + MEMORY_STORE_DELETED = "memory_store.deleted" + MEMORY_STORE_SCOPE_DELETED = "memory_store.scope.deleted" + + + class azure.ai.projects.models.MemoryStoreOperationUsage(_Model): + embedding_tokens: int + input_tokens: int + input_tokens_details: ResponseUsageInputTokensDetails + output_tokens: int + output_tokens_details: ResponseUsageOutputTokensDetails + total_tokens: int @overload def __init__( self, *, - security_scheme: OpenApiProjectConnectionSecurityScheme + embedding_tokens: int, + input_tokens: int, + input_tokens_details: ResponseUsageInputTokensDetails, + output_tokens: int, + output_tokens_details: ResponseUsageOutputTokensDetails, + total_tokens: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OpenApiProjectConnectionSecurityScheme(_Model): - project_connection_id: str + class azure.ai.projects.models.MemoryStoreSearchResult(_Model): + memories: list[MemorySearchItem] + search_id: str + usage: MemoryStoreOperationUsage @overload def __init__( self, *, - project_connection_id: str + memories: list[MemorySearchItem], + search_id: str, + usage: MemoryStoreOperationUsage ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OpenApiTool(Tool, discriminator='openapi'): - openapi: OpenApiFunctionDefinition - tool_configs: Optional[dict[str, ToolConfig]] - type: Literal[ToolType.OPENAPI] + class azure.ai.projects.models.MemoryStoreUpdateCompletedResult(_Model): + memory_operations: list[MemoryOperation] + usage: MemoryStoreOperationUsage @overload def __init__( self, *, - openapi: OpenApiFunctionDefinition, - tool_configs: Optional[dict[str, ToolConfig]] = ... + memory_operations: list[MemoryOperation], + usage: MemoryStoreOperationUsage ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OpenApiToolboxTool(ToolboxTool, discriminator='openapi'): - description: str - name: str - openapi: OpenApiFunctionDefinition - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.OPENAPI] + class azure.ai.projects.models.MemoryStoreUpdateResult(_Model): + error: Optional[ApiError] + result: Optional[MemoryStoreUpdateCompletedResult] + status: Union[str, MemoryStoreUpdateStatus] + superseded_by: Optional[str] + update_id: str @overload def __init__( self, *, - description: Optional[str] = ..., - name: Optional[str] = ..., - openapi: OpenApiFunctionDefinition, - tool_configs: Optional[dict[str, ToolConfig]] = ... + error: Optional[ApiError] = ..., + result: Optional[MemoryStoreUpdateCompletedResult] = ..., + status: Union[str, MemoryStoreUpdateStatus], + superseded_by: Optional[str] = ..., + update_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OperationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CANCELED = "Canceled" - FAILED = "Failed" - NOT_STARTED = "NotStarted" - RUNNING = "Running" - SUCCEEDED = "Succeeded" + class azure.ai.projects.models.MemoryStoreUpdateStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMPLETED = "completed" + FAILED = "failed" + IN_PROGRESS = "in_progress" + QUEUED = "queued" + SUPERSEDED = "superseded" - class azure.ai.projects.models.OptimizedAgentIdentifier(_Model): - agent_name: str - agent_version: Optional[str] + class azure.ai.projects.models.Metadata(_Model): + + + class azure.ai.projects.models.Microsoft365PermissionScopes(_Model): + resource_app_id: str + scopes: list[str] @overload def __init__( self, *, - agent_name: str, - agent_version: Optional[str] = ... + resource_app_id: str, + scopes: list[str] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.OtlpTelemetryEndpoint(TelemetryEndpoint, discriminator='OTLP'): - auth: TelemetryEndpointAuth - data: Union[list[str, TelemetryDataKind]] - endpoint: str - kind: Literal[TelemetryEndpointKind.OTLP] - protocol: Union[str, TelemetryTransportProtocol] + class azure.ai.projects.models.Microsoft365PublishDefaults(_Model): + agent_display_name: Optional[str] + agent_name: Optional[str] + app_publish_scope: Optional[Union[str, Microsoft365PublishScope]] + app_registration_client_id: Optional[str] + app_version: Optional[str] + bot_service_arm_id: Optional[str] + developer_name: Optional[str] + developer_website_url: Optional[str] + full_description: Optional[str] + privacy_url: Optional[str] + recommended_next_app_version: Optional[str] + short_description: Optional[str] + teams_app_id: Optional[str] + terms_of_use_url: Optional[str] + title_id: Optional[str] @overload def __init__( self, *, - auth: Optional[TelemetryEndpointAuth] = ..., - data: list[Union[str, TelemetryDataKind]], - endpoint: str, - protocol: Union[str, TelemetryTransportProtocol] + agent_display_name: Optional[str] = ..., + agent_name: Optional[str] = ..., + app_publish_scope: Optional[Union[str, Microsoft365PublishScope]] = ..., + app_registration_client_id: Optional[str] = ..., + app_version: Optional[str] = ..., + bot_service_arm_id: Optional[str] = ..., + developer_name: Optional[str] = ..., + developer_website_url: Optional[str] = ..., + full_description: Optional[str] = ..., + privacy_url: Optional[str] = ..., + recommended_next_app_version: Optional[str] = ..., + short_description: Optional[str] = ..., + teams_app_id: Optional[str] = ..., + terms_of_use_url: Optional[str] = ..., + title_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PageOrder(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ASC = "asc" - DESC = "desc" - - - class azure.ai.projects.models.PendingUploadRequest(_Model): - connection_name: Optional[str] - pending_upload_id: Optional[str] - pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] + class azure.ai.projects.models.Microsoft365PublishResult(_Model): + teams_app_id: Optional[str] + title_id: Optional[str] @overload def __init__( self, *, - connection_name: Optional[str] = ..., - pending_upload_id: Optional[str] = ..., - pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.PendingUploadResponse(_Model): - blob_reference: BlobReference - pending_upload_id: str - pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] - version: Optional[str] - - @overload - def __init__( - self, - *, - blob_reference: BlobReference, - pending_upload_id: str, - pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE], - version: Optional[str] = ... + teams_app_id: Optional[str] = ..., + title_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PendingUploadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - BLOB_REFERENCE = "BlobReference" - NONE = "None" - TEMPORARY_BLOB_REFERENCE = "TemporaryBlobReference" + class azure.ai.projects.models.Microsoft365PublishScope(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PERSONAL = "Personal" + SHARED = "Shared" + TENANT = "Tenant" - class azure.ai.projects.models.PickPropertiesVoiceAgentAudioConfig(_Model): - output: Optional[VoiceAgentAudioOutputConfig] + class azure.ai.projects.models.MicrosoftFabricPreviewTool(Tool, discriminator='fabric_dataagent_preview'): + fabric_dataagent_preview: FabricDataAgentToolParameters + type: Literal[ToolType.FABRIC_DATAAGENT_PREVIEW] @overload def __init__( self, *, - output: Optional[VoiceAgentAudioOutputConfig] = ... + fabric_dataagent_preview: FabricDataAgentToolParameters ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ProceduralMemoryItem(MemoryItem, discriminator='procedural'): - content: str - kind: Literal[MemoryItemKind.PROCEDURAL] - memory_id: str - scope: str - updated_at: datetime + class azure.ai.projects.models.ModelCredentialRequest(_Model): + blob_uri: str @overload def __init__( self, *, - content: str, - memory_id: str, - scope: str, - updated_at: datetime + blob_uri: str ) -> None: ... @overload 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] + class azure.ai.projects.models.ModelDeployment(Deployment, discriminator='ModelDeployment'): + capabilities: dict[str, str] + connection_name: Optional[str] + model_name: str + model_publisher: str + model_version: str + name: str + sku: ModelDeploymentSku + type: Literal[DeploymentType.MODEL_DEPLOYMENT] @overload def __init__(self) -> None: ... @@ -8445,212 +8581,212 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PromotionInfo(_Model): - agent_name: str - agent_version: str - promoted_at: datetime + class azure.ai.projects.models.ModelDeploymentSku(_Model): + capacity: int + family: str + name: str + size: str + tier: str @overload def __init__( self, *, - agent_name: str, - agent_version: str, - promoted_at: datetime + capacity: int, + family: str, + name: str, + size: str, + tier: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PromptAgentDefinition(AgentDefinition, discriminator='prompt'): - instructions: Optional[str] - kind: Literal[AgentKind.PROMPT] - model: str - rai_config: RaiConfig - reasoning: Optional[Reasoning] - structured_inputs: Optional[dict[str, StructuredInputDefinition]] - temperature: Optional[float] - text: Optional[PromptAgentDefinitionTextOptions] - tool_choice: Optional[Union[str, ToolChoiceParam]] - tools: Optional[list[Tool]] - top_p: Optional[float] + class azure.ai.projects.models.ModelPendingUploadRequest(_Model): + connection_name: Optional[str] + pending_upload_id: Optional[str] + pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] @overload def __init__( self, *, - instructions: Optional[str] = ..., - model: str, - rai_config: Optional[RaiConfig] = ..., - reasoning: Optional[Reasoning] = ..., - structured_inputs: Optional[dict[str, StructuredInputDefinition]] = ..., - temperature: Optional[float] = ..., - text: Optional[PromptAgentDefinitionTextOptions] = ..., - tool_choice: Optional[Union[str, ToolChoiceParam]] = ..., - tools: Optional[list[Tool]] = ..., - top_p: Optional[float] = ... + connection_name: Optional[str] = ..., + pending_upload_id: Optional[str] = ..., + pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PromptAgentDefinitionTextOptions(_Model): - format: Optional[TextResponseFormat] + class azure.ai.projects.models.ModelPendingUploadResponse(_Model): + blob_reference: BlobReference + pending_upload_id: str + pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] + version: Optional[str] @overload def __init__( self, *, - format: Optional[TextResponseFormat] = ... + blob_reference: BlobReference, + pending_upload_id: str, + pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE], + version: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PromptBasedEvaluatorDefinition(EvaluatorDefinition, discriminator='prompt'): - data_schema: dict[str, any] - init_parameters: dict[str, any] - metrics: dict[str, EvaluatorMetric] - prompt_text: str - type: Literal[EvaluatorDefinitionType.PROMPT] + class azure.ai.projects.models.ModelSamplingConfigParam(TypedDict, total=False): + key "max_completion_tokens": int + key "seed": int + key "temperature": float + key "top_p": float + + + class azure.ai.projects.models.ModelSamplingParams(_Model): + max_completion_tokens: Optional[int] + seed: Optional[int] + temperature: Optional[float] + top_p: Optional[float] @overload def __init__( self, *, - data_schema: Optional[dict[str, Any]] = ..., - init_parameters: Optional[dict[str, Any]] = ..., - metrics: Optional[dict[str, EvaluatorMetric]] = ..., - prompt_text: str + max_completion_tokens: Optional[int] = ..., + seed: Optional[int] = ..., + temperature: Optional[float] = ..., + top_p: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PromptDataGenerationJobSource(DataGenerationJobSource, discriminator='prompt'): - description: str - prompt: str - type: Literal[DataGenerationJobSourceType.PROMPT] + class azure.ai.projects.models.ModelSourceData(_Model): + job_id: Optional[str] + source_type: Optional[Union[str, FoundryModelSourceType]] @overload def __init__( self, *, - description: Optional[str] = ..., - prompt: str + job_id: Optional[str] = ..., + source_type: Optional[Union[str, FoundryModelSourceType]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PromptEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator='prompt'): + class azure.ai.projects.models.ModelVersion(_Model): + artifact_profile: Optional[ArtifactProfile] + base_model: Optional[str] + blob_uri: str description: Optional[str] - prompt: str - type: Literal[EvaluatorGenerationJobSourceType.PROMPT] + id: Optional[str] + lora_config: Optional[LoraConfig] + name: str + source: Optional[ModelSourceData] + tags: Optional[dict[str, str]] + version: str + warnings: Optional[list[FoundryModelWarning]] + weight_type: Optional[Union[str, FoundryModelWeightType]] @overload def __init__( self, *, + base_model: Optional[str] = ..., + blob_uri: str, description: Optional[str] = ..., - prompt: str + lora_config: Optional[LoraConfig] = ..., + source: Optional[ModelSourceData] = ..., + tags: Optional[dict[str, str]] = ..., + weight_type: Optional[Union[str, FoundryModelWeightType]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ProtocolConfiguration(_Model): - a2a: Optional[A2AProtocolConfiguration] - activity: Optional[ActivityProtocolConfiguration] - invocations: Optional[InvocationsProtocolConfiguration] - invocations_ws: Optional[InvocationsWsProtocolConfiguration] - mcp: Optional[McpProtocolConfiguration] - responses: Optional[ResponsesProtocolConfiguration] + class azure.ai.projects.models.MonthlyRecurrenceSchedule(RecurrenceSchedule, discriminator='Monthly'): + days_of_month: list[int] + type: Literal[RecurrenceType.MONTHLY] @overload def __init__( self, *, - a2a: Optional[A2AProtocolConfiguration] = ..., - activity: Optional[ActivityProtocolConfiguration] = ..., - invocations: Optional[InvocationsProtocolConfiguration] = ..., - invocations_ws: Optional[InvocationsWsProtocolConfiguration] = ..., - mcp: Optional[McpProtocolConfiguration] = ..., - responses: Optional[ResponsesProtocolConfiguration] = ... + days_of_month: list[int] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ProtocolVersionRecord(_Model): - protocol: Union[str, AgentEndpointProtocol] - version: str + class azure.ai.projects.models.NamespaceToolParam(Tool, discriminator='namespace'): + description: str + name: str + tools: list[Union[FunctionToolParam, CustomToolParam]] + type: Literal[ToolType.NAMESPACE] @overload def __init__( self, *, - protocol: Union[str, AgentEndpointProtocol], - version: str + description: str, + name: str, + tools: list[Union[FunctionToolParam, CustomToolParam]] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.PublishApprovalStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - APPROVED = "approved" - NOT_PUBLISHED = "not_published" - NO_APPROVAL_NEEDED = "no_approval_needed" - PENDING = "pending" - REJECTED = "rejected" + class azure.ai.projects.models.NoAuthenticationCredentials(BaseCredentials, discriminator='None'): + type: Literal[CredentialType.NONE] + @overload + def __init__(self) -> None: ... - class azure.ai.projects.models.RaiConfig(_Model): - rai_policy_name: str + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.OneTimeTrigger(Trigger, discriminator='OneTime'): + time_zone: Optional[str] + trigger_at: datetime + type: Literal[TriggerType.ONE_TIME] @overload def __init__( self, *, - rai_policy_name: str + time_zone: Optional[str] = ..., + trigger_at: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RankerVersionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AUTO = "auto" - DEFAULT_2024_11_15 = "default-2024-11-15" - - - class azure.ai.projects.models.RankingOptions(_Model): - hybrid_search: Optional[HybridSearchOptions] - ranker: Optional[Union[str, RankerVersionType]] - score_threshold: Optional[float] + class azure.ai.projects.models.OpenApiAnonymousAuthDetails(OpenApiAuthDetails, discriminator='anonymous'): + type: Literal[OpenApiAuthType.ANONYMOUS] @overload - def __init__( - self, - *, - hybrid_search: Optional[HybridSearchOptions] = ..., - ranker: Optional[Union[str, RankerVersionType]] = ..., - score_threshold: Optional[float] = ... - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeAudioFormats(_Model): + class azure.ai.projects.models.OpenApiAuthDetails(_Model): type: str @overload @@ -8664,550 +8800,509 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeAudioFormatsAudioPcm(RealtimeAudioFormats, discriminator='audio/pcm'): - rate: Optional[Literal[24000]] - type: Literal[RealtimeAudioFormatsType.AUDIO_PCM] + class azure.ai.projects.models.OpenApiAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ANONYMOUS = "anonymous" + MANAGED_IDENTITY = "managed_identity" + PROJECT_CONNECTION = "project_connection" + + + class azure.ai.projects.models.OpenApiFunctionDefinition(_Model): + auth: OpenApiAuthDetails + default_params: Optional[list[str]] + description: Optional[str] + functions: Optional[list[OpenApiFunctionDefinitionFunction]] + name: str + spec: dict[str, Any] @overload def __init__( self, *, - rate: Optional[Literal[24000]] = ... + auth: OpenApiAuthDetails, + default_params: Optional[list[str]] = ..., + description: Optional[str] = ..., + name: str, + spec: dict[str, Any] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeAudioFormatsAudioPcma(RealtimeAudioFormats, discriminator='audio/pcma'): - type: Literal[RealtimeAudioFormatsType.AUDIO_PCMA] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.RealtimeAudioFormatsAudioPcmu(RealtimeAudioFormats, discriminator='audio/pcmu'): - type: Literal[RealtimeAudioFormatsType.AUDIO_PCMU] + class azure.ai.projects.models.OpenApiFunctionDefinitionFunction(_Model): + description: Optional[str] + name: str + parameters: dict[str, Any] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + description: Optional[str] = ..., + name: str, + parameters: dict[str, Any] + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeAudioFormatsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AUDIO_PCM = "audio/pcm" - AUDIO_PCMA = "audio/pcma" - AUDIO_PCMU = "audio/pcmu" - - - class azure.ai.projects.models.RealtimeClientEvent(_Model): - type: str + class azure.ai.projects.models.OpenApiManagedAuthDetails(OpenApiAuthDetails, discriminator='managed_identity'): + security_scheme: OpenApiManagedSecurityScheme + type: Literal[OpenApiAuthType.MANAGED_IDENTITY] @overload def __init__( self, *, - type: str + security_scheme: OpenApiManagedSecurityScheme ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeClientEventConversationItemCreate(RealtimeClientEvent, discriminator='conversation.item.create'): - event_id: Optional[str] - item: RealtimeConversationItem - previous_item_id: Optional[str] - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE] + class azure.ai.projects.models.OpenApiManagedSecurityScheme(_Model): + audience: str @overload def __init__( self, *, - event_id: Optional[str] = ..., - item: RealtimeConversationItem, - previous_item_id: Optional[str] = ... + audience: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeClientEventConversationItemDelete(RealtimeClientEvent, discriminator='conversation.item.delete'): - event_id: Optional[str] - item_id: str - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE] + class azure.ai.projects.models.OpenApiProjectConnectionAuthDetails(OpenApiAuthDetails, discriminator='project_connection'): + security_scheme: OpenApiProjectConnectionSecurityScheme + type: Literal[OpenApiAuthType.PROJECT_CONNECTION] @overload def __init__( self, *, - event_id: Optional[str] = ..., - item_id: str + security_scheme: OpenApiProjectConnectionSecurityScheme ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeClientEventConversationItemRetrieve(RealtimeClientEvent, discriminator='conversation.item.retrieve'): - event_id: Optional[str] - item_id: str - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE] + class azure.ai.projects.models.OpenApiProjectConnectionSecurityScheme(_Model): + project_connection_id: str @overload def __init__( self, *, - event_id: Optional[str] = ..., - item_id: str + project_connection_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeClientEventConversationItemTruncate(RealtimeClientEvent, discriminator='conversation.item.truncate'): - audio_end_ms: int - content_index: int - event_id: Optional[str] - item_id: str - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE] + class azure.ai.projects.models.OpenApiTool(Tool, discriminator='openapi'): + openapi: OpenApiFunctionDefinition + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.OPENAPI] @overload def __init__( self, *, - audio_end_ms: int, - content_index: int, - event_id: Optional[str] = ..., - item_id: str + openapi: OpenApiFunctionDefinition, + tool_configs: Optional[dict[str, ToolConfig]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeClientEventInputAudioBufferAppend(RealtimeClientEvent, discriminator='input_audio_buffer.append'): - audio: str - event_id: Optional[str] - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND] + class azure.ai.projects.models.OpenApiToolboxTool(ToolboxTool, discriminator='openapi'): + description: str + name: str + openapi: OpenApiFunctionDefinition + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.OPENAPI] @overload def __init__( self, *, - audio: str, - event_id: Optional[str] = ... + description: Optional[str] = ..., + name: Optional[str] = ..., + openapi: OpenApiFunctionDefinition, + tool_configs: Optional[dict[str, ToolConfig]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeClientEventInputAudioBufferClear(RealtimeClientEvent, discriminator='input_audio_buffer.clear'): - event_id: Optional[str] - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR] + class azure.ai.projects.models.OperationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELED = "Canceled" + FAILED = "Failed" + NOT_STARTED = "NotStarted" + RUNNING = "Running" + SUCCEEDED = "Succeeded" + + + class azure.ai.projects.models.OptimizedAgentIdentifier(_Model): + agent_name: str + agent_version: Optional[str] @overload def __init__( self, *, - event_id: Optional[str] = ... + agent_name: str, + agent_version: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeClientEventInputAudioBufferCommit(RealtimeClientEvent, discriminator='input_audio_buffer.commit'): - event_id: Optional[str] - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT] + class azure.ai.projects.models.OtlpTelemetryEndpoint(TelemetryEndpoint, discriminator='OTLP'): + auth: TelemetryEndpointAuth + data: Union[list[str, TelemetryDataKind]] + endpoint: str + kind: Literal[TelemetryEndpointKind.OTLP] + protocol: Union[str, TelemetryTransportProtocol] @overload def __init__( self, *, - event_id: Optional[str] = ... + auth: Optional[TelemetryEndpointAuth] = ..., + data: list[Union[str, TelemetryDataKind]], + endpoint: str, + protocol: Union[str, TelemetryTransportProtocol] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeClientEventOutputAudioBufferClear(RealtimeClientEvent, discriminator='output_audio_buffer.clear'): - event_id: Optional[str] - type: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR] + class azure.ai.projects.models.PSTNTelephonyTransferDestination(TelephonyTransferDestination, discriminator='pstn'): + kind: Literal[TelephonyTransferDestinationKind.PSTN] + value: str @overload def __init__( self, *, - event_id: Optional[str] = ... + value: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeClientEventResponseCancel(RealtimeClientEvent, discriminator='response.cancel'): - event_id: Optional[str] - response_id: Optional[str] - type: Literal[RealtimeClientEventType.RESPONSE_CANCEL] + class azure.ai.projects.models.PageOrder(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ASC = "asc" + DESC = "desc" + + + class azure.ai.projects.models.PendingUploadRequest(_Model): + connection_name: Optional[str] + pending_upload_id: Optional[str] + pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] @overload def __init__( self, *, - event_id: Optional[str] = ..., - response_id: Optional[str] = ... + connection_name: Optional[str] = ..., + pending_upload_id: Optional[str] = ..., + pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeClientEventResponseCreate(RealtimeClientEvent, discriminator='response.create'): - event_id: Optional[str] - response: Optional[VoiceAgentResponseCreateParams] - type: Literal[RealtimeClientEventType.RESPONSE_CREATE] + class azure.ai.projects.models.PendingUploadResponse(_Model): + blob_reference: BlobReference + pending_upload_id: str + pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] + version: Optional[str] @overload def __init__( self, *, - event_id: Optional[str] = ..., - response: Optional[VoiceAgentResponseCreateParams] = ... + blob_reference: BlobReference, + pending_upload_id: str, + pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE], + version: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeClientEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CONVERSATION_ITEM_CREATE = "conversation.item.create" - CONVERSATION_ITEM_DELETE = "conversation.item.delete" - CONVERSATION_ITEM_RETRIEVE = "conversation.item.retrieve" - CONVERSATION_ITEM_TRUNCATE = "conversation.item.truncate" - INPUT_AUDIO_BUFFER_APPEND = "input_audio_buffer.append" - INPUT_AUDIO_BUFFER_CLEAR = "input_audio_buffer.clear" - INPUT_AUDIO_BUFFER_COMMIT = "input_audio_buffer.commit" - OUTPUT_AUDIO_BUFFER_CLEAR = "output_audio_buffer.clear" - RESPONSE_CANCEL = "response.cancel" - RESPONSE_CREATE = "response.create" - SESSION_AVATAR_CONNECT = "session.avatar.connect" - SESSION_UPDATE = "session.update" + class azure.ai.projects.models.PendingUploadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BLOB_REFERENCE = "BlobReference" + NONE = "None" + TEMPORARY_BLOB_REFERENCE = "TemporaryBlobReference" - class azure.ai.projects.models.RealtimeConversationItem(_Model): - type: str + class azure.ai.projects.models.PickPropertiesVoiceAgentAudioConfig(_Model): + output: Optional[VoiceAgentAudioOutputConfig] @overload def __init__( self, *, - type: str + output: Optional[VoiceAgentAudioOutputConfig] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeConversationItemFunctionCall(RealtimeConversationItem, discriminator='function_call'): - arguments: str - call_id: Optional[str] - created_at: Optional[datetime] - id: Optional[str] - name: str - object: Optional[Literal["item"]] - response_id: Optional[str] - status: Optional[Literal["completed", "incomplete", "in_progress"]] - type: Literal[RealtimeConversationItemType.FUNCTION_CALL] + class azure.ai.projects.models.ProceduralMemoryItem(MemoryItem, discriminator='procedural'): + content: str + kind: Literal[MemoryItemKind.PROCEDURAL] + memory_id: str + scope: str + updated_at: datetime @overload def __init__( self, *, - arguments: str, - call_id: Optional[str] = ..., - id: Optional[str] = ..., - name: str, - object: Optional[Literal[item]] = ..., - status: Optional[Literal[completed, incomplete, in_progress]] = ... + content: str, + memory_id: str, + scope: str, + updated_at: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeConversationItemFunctionCallOutput(RealtimeConversationItem, discriminator='function_call_output'): - call_id: str - created_at: Optional[datetime] - id: Optional[str] - name: Optional[str] - object: Optional[Literal["item"]] - output: str - response_id: Optional[str] - status: Optional[Literal["completed", "incomplete", "in_progress"]] - type: Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT] + class azure.ai.projects.models.ProgrammaticToolCallingParam(Tool, discriminator='programmatic_tool_calling'): + type: Literal[ToolType.PROGRAMMATIC_TOOL_CALLING] @overload - def __init__( - self, - *, - call_id: str, - id: Optional[str] = ..., - name: Optional[str] = ..., - object: Optional[Literal[item]] = ..., - output: str, - status: Optional[Literal[completed, incomplete, in_progress]] = ... - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeConversationItemMessage(RealtimeConversationItem, discriminator='message'): - role: str - type: Literal[RealtimeConversationItemType.MESSAGE] + class azure.ai.projects.models.PromotionInfo(_Model): + agent_name: str + agent_version: str + promoted_at: datetime @overload def __init__( self, *, - role: str + agent_name: str, + agent_version: str, + promoted_at: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeConversationItemMessageAssistant(RealtimeConversationItemMessage, discriminator='assistant'): - content: list[RealtimeConversationItemMessageAssistantContent] - created_at: Optional[datetime] - id: Optional[str] - object: Optional[Literal["item"]] - response_id: Optional[str] - role: Literal[RealtimeConversationItemMessageType.ASSISTANT] - status: Optional[Literal["completed", "incomplete", "in_progress"]] - type: Union[str, azure.ai.projects.models.MESSAGE] + class azure.ai.projects.models.PromptAgentDefinition(AgentDefinition, discriminator='prompt'): + instructions: Optional[str] + kind: Literal[AgentKind.PROMPT] + model: str + rai_config: RaiConfig + reasoning: Optional[Reasoning] + structured_inputs: Optional[dict[str, StructuredInputDefinition]] + temperature: Optional[float] + text: Optional[PromptAgentDefinitionTextOptions] + tool_choice: Optional[Union[str, ToolChoiceParam]] + tools: Optional[list[Tool]] + top_p: Optional[float] @overload def __init__( self, *, - content: list[RealtimeConversationItemMessageAssistantContent], - id: Optional[str] = ..., - object: Optional[Literal[item]] = ..., - status: Optional[Literal[completed, incomplete, in_progress]] = ..., - type: Literal[RealtimeConversationItemType.MESSAGE] + instructions: Optional[str] = ..., + model: str, + rai_config: Optional[RaiConfig] = ..., + reasoning: Optional[Reasoning] = ..., + structured_inputs: Optional[dict[str, StructuredInputDefinition]] = ..., + temperature: Optional[float] = ..., + text: Optional[PromptAgentDefinitionTextOptions] = ..., + tool_choice: Optional[Union[str, ToolChoiceParam]] = ..., + tools: Optional[list[Tool]] = ..., + top_p: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeConversationItemMessageAssistantContent(_Model): - audio: Optional[str] - text: Optional[str] - transcript: Optional[str] - type: Optional[Literal["output_text", "output_audio"]] + class azure.ai.projects.models.PromptAgentDefinitionTextOptions(_Model): + format: Optional[TextResponseFormat] @overload def __init__( self, *, - audio: Optional[str] = ..., - text: Optional[str] = ..., - transcript: Optional[str] = ..., - type: Optional[Literal[output_text, output_audio]] = ... + format: Optional[TextResponseFormat] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeConversationItemMessageSystem(RealtimeConversationItemMessage, discriminator='system'): - content: list[RealtimeConversationItemMessageSystemContent] - created_at: Optional[datetime] - id: Optional[str] - object: Optional[Literal["item"]] - response_id: Optional[str] - role: Literal[RealtimeConversationItemMessageType.SYSTEM] - status: Optional[Literal["completed", "incomplete", "in_progress"]] - type: Union[str, azure.ai.projects.models.MESSAGE] + class azure.ai.projects.models.PromptBasedEvaluatorDefinition(EvaluatorDefinition, discriminator='prompt'): + data_schema: dict[str, any] + init_parameters: dict[str, any] + metrics: dict[str, EvaluatorMetric] + prompt_text: str + type: Literal[EvaluatorDefinitionType.PROMPT] @overload def __init__( self, *, - content: list[RealtimeConversationItemMessageSystemContent], - id: Optional[str] = ..., - object: Optional[Literal[item]] = ..., - status: Optional[Literal[completed, incomplete, in_progress]] = ..., - type: Literal[RealtimeConversationItemType.MESSAGE] + data_schema: Optional[dict[str, Any]] = ..., + init_parameters: Optional[dict[str, Any]] = ..., + metrics: Optional[dict[str, EvaluatorMetric]] = ..., + prompt_text: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeConversationItemMessageSystemContent(_Model): - text: Optional[str] - type: Optional[Literal["input_text"]] + class azure.ai.projects.models.PromptDataGenerationJobSource(DataGenerationJobSource, discriminator='prompt'): + description: str + prompt: str + type: Literal[DataGenerationJobSourceType.PROMPT] @overload def __init__( self, *, - text: Optional[str] = ..., - type: Optional[Literal[input_text]] = ... + description: Optional[str] = ..., + prompt: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeConversationItemMessageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ASSISTANT = "assistant" - SYSTEM = "system" - USER = "user" - - - class azure.ai.projects.models.RealtimeConversationItemMessageUser(RealtimeConversationItemMessage, discriminator='user'): - content: list[RealtimeConversationItemMessageUserContent] - created_at: Optional[datetime] - id: Optional[str] - object: Optional[Literal["item"]] - response_id: Optional[str] - role: Literal[RealtimeConversationItemMessageType.USER] - status: Optional[Literal["completed", "incomplete", "in_progress"]] - type: Union[str, azure.ai.projects.models.MESSAGE] + class azure.ai.projects.models.PromptEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator='prompt'): + description: Optional[str] + prompt: str + type: Literal[EvaluatorGenerationJobSourceType.PROMPT] @overload def __init__( self, *, - content: list[RealtimeConversationItemMessageUserContent], - id: Optional[str] = ..., - object: Optional[Literal[item]] = ..., - status: Optional[Literal[completed, incomplete, in_progress]] = ..., - type: Literal[RealtimeConversationItemType.MESSAGE] + description: Optional[str] = ..., + prompt: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeConversationItemMessageUserContent(_Model): - audio: Optional[str] - detail: Optional[Literal["auto", "low", "high"]] - image_url: Optional[str] - text: Optional[str] - transcript: Optional[str] - type: Optional[Literal["input_text", "input_audio", "input_image"]] + class azure.ai.projects.models.ProtocolConfiguration(_Model): + a2a: Optional[A2AProtocolConfiguration] + activity: Optional[ActivityProtocolConfiguration] + invocations: Optional[InvocationsProtocolConfiguration] + invocations_ws: Optional[InvocationsWsProtocolConfiguration] + mcp: Optional[McpProtocolConfiguration] + responses: Optional[ResponsesProtocolConfiguration] @overload def __init__( self, *, - audio: Optional[str] = ..., - detail: Optional[Literal[auto, low, high]] = ..., - image_url: Optional[str] = ..., - text: Optional[str] = ..., - transcript: Optional[str] = ..., - type: Optional[Literal[input_text, input_audio, input_image]] = ... + a2a: Optional[A2AProtocolConfiguration] = ..., + activity: Optional[ActivityProtocolConfiguration] = ..., + invocations: Optional[InvocationsProtocolConfiguration] = ..., + invocations_ws: Optional[InvocationsWsProtocolConfiguration] = ..., + mcp: Optional[McpProtocolConfiguration] = ..., + responses: Optional[ResponsesProtocolConfiguration] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FUNCTION_CALL = "function_call" - FUNCTION_CALL_OUTPUT = "function_call_output" - MCP_APPROVAL_REQUEST = "mcp_approval_request" - MCP_APPROVAL_RESPONSE = "mcp_approval_response" - MCP_CALL = "mcp_call" - MCP_LIST_TOOLS = "mcp_list_tools" - MESSAGE = "message" - - - class azure.ai.projects.models.RealtimeFunctionTool(_Model): - description: Optional[str] - name: Optional[str] - parameters: Optional[RealtimeFunctionToolParameters] - type: Optional[Literal["function"]] + class azure.ai.projects.models.ProtocolVersionRecord(_Model): + protocol: Union[str, AgentEndpointProtocol] + version: str @overload def __init__( self, *, - description: Optional[str] = ..., - name: Optional[str] = ..., - parameters: Optional[RealtimeFunctionToolParameters] = ..., - type: Optional[Literal[function]] = ... + protocol: Union[str, AgentEndpointProtocol], + version: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeFunctionToolParameters(_Model): + class azure.ai.projects.models.PublishApprovalStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + APPROVED = "approved" + NOT_PUBLISHED = "not_published" + NO_APPROVAL_NEEDED = "no_approval_needed" + PENDING = "pending" + REJECTED = "rejected" - class azure.ai.projects.models.RealtimeMCPApprovalRequest(RealtimeConversationItem, discriminator='mcp_approval_request'): - arguments: str - created_at: Optional[datetime] - id: str - name: str - response_id: Optional[str] - server_label: str - type: Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST] + class azure.ai.projects.models.RaiConfig(_Model): + rai_policy_name: str @overload def __init__( self, *, - arguments: str, - id: str, - name: str, - server_label: str + rai_policy_name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeMCPApprovalResponse(RealtimeConversationItem, discriminator='mcp_approval_response'): - approval_request_id: str - approve: bool - created_at: Optional[datetime] - id: str - reason: Optional[str] - response_id: Optional[str] - type: Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE] + class azure.ai.projects.models.RankerVersionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "auto" + DEFAULT_2024_11_15 = "default-2024-11-15" + + + class azure.ai.projects.models.RankingOptions(_Model): + hybrid_search: Optional[HybridSearchOptions] + ranker: Optional[Union[str, RankerVersionType]] + score_threshold: Optional[float] @overload def __init__( self, *, - approval_request_id: str, - approve: bool, - id: str, - reason: Optional[str] = ... + hybrid_search: Optional[HybridSearchOptions] = ..., + ranker: Optional[Union[str, RankerVersionType]] = ..., + score_threshold: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeMCPError(_Model): + class azure.ai.projects.models.RealtimeAudioFormats(_Model): type: str @overload @@ -9221,2288 +9316,2142 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeMCPHTTPError(RealtimeMCPError, discriminator='http_error'): - code: int - message: str - type: Literal[RealtimeMcpErrorType.HTTP_ERROR] + class azure.ai.projects.models.RealtimeAudioFormatsAudioPcm(RealtimeAudioFormats, discriminator='audio/pcm'): + rate: Optional[Literal[24000]] + type: Literal[RealtimeAudioFormatsType.AUDIO_PCM] @overload def __init__( self, *, - code: int, - message: str + rate: Optional[Literal[24000]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeMCPListTools(RealtimeConversationItem, discriminator='mcp_list_tools'): - created_at: Optional[datetime] - id: Optional[str] - response_id: Optional[str] - server_label: str - tools: list[MCPListToolsTool] - type: Literal[RealtimeConversationItemType.MCP_LIST_TOOLS] + class azure.ai.projects.models.RealtimeAudioFormatsAudioPcma(RealtimeAudioFormats, discriminator='audio/pcma'): + type: Literal[RealtimeAudioFormatsType.AUDIO_PCMA] @overload - def __init__( - self, - *, - id: Optional[str] = ..., - server_label: str, - tools: list[MCPListToolsTool] - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeMCPProtocolError(RealtimeMCPError, discriminator='protocol_error'): - code: int - message: str - type: Literal[RealtimeMcpErrorType.PROTOCOL_ERROR] + class azure.ai.projects.models.RealtimeAudioFormatsAudioPcmu(RealtimeAudioFormats, discriminator='audio/pcmu'): + type: Literal[RealtimeAudioFormatsType.AUDIO_PCMU] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RealtimeAudioFormatsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUDIO_PCM = "audio/pcm" + AUDIO_PCMA = "audio/pcma" + AUDIO_PCMU = "audio/pcmu" + + + class azure.ai.projects.models.RealtimeClientEvent(_Model): + type: str @overload def __init__( self, *, - code: int, - message: str + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeMCPToolCall(RealtimeConversationItem, discriminator='mcp_call'): - approval_request_id: Optional[str] - arguments: str - created_at: Optional[datetime] - error: Optional[RealtimeMCPError] - id: str - name: str - output: Optional[str] - response_id: Optional[str] - server_label: str - type: Literal[RealtimeConversationItemType.MCP_CALL] + class azure.ai.projects.models.RealtimeClientEventConversationItemCreate(RealtimeClientEvent, discriminator='conversation.item.create'): + event_id: Optional[str] + item: RealtimeConversationItem + previous_item_id: Optional[str] + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE] @overload def __init__( self, *, - approval_request_id: Optional[str] = ..., - arguments: str, - error: Optional[RealtimeMCPError] = ..., - id: str, - name: str, - output: Optional[str] = ..., - server_label: str + event_id: Optional[str] = ..., + item: RealtimeConversationItem, + previous_item_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeMCPToolExecutionError(RealtimeMCPError, discriminator='tool_execution_error'): - message: str - type: Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR] + class azure.ai.projects.models.RealtimeClientEventConversationItemDelete(RealtimeClientEvent, discriminator='conversation.item.delete'): + event_id: Optional[str] + item_id: str + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE] @overload def __init__( self, *, - message: str + event_id: Optional[str] = ..., + item_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeMcpErrorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - HTTP_ERROR = "http_error" - PROTOCOL_ERROR = "protocol_error" - TOOL_EXECUTION_ERROR = "tool_execution_error" - - - class azure.ai.projects.models.RealtimeReasoning(_Model): - effort: Optional[Union[str, RealtimeReasoningEffort]] + class azure.ai.projects.models.RealtimeClientEventConversationItemRetrieve(RealtimeClientEvent, discriminator='conversation.item.retrieve'): + event_id: Optional[str] + item_id: str + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE] @overload def __init__( self, *, - effort: Optional[Union[str, RealtimeReasoningEffort]] = ... + event_id: Optional[str] = ..., + item_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): - HIGH = "high" - LOW = "low" - MEDIUM = "medium" - MINIMAL = "minimal" - XHIGH = "xhigh" - - - class azure.ai.projects.models.RealtimeResponseStatusDetails(_Model): - error: Optional[RealtimeResponseStatusDetailsError] - reason: Optional[Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"]] - type: Optional[Literal["completed", "cancelled", "failed", "incomplete"]] + class azure.ai.projects.models.RealtimeClientEventConversationItemTruncate(RealtimeClientEvent, discriminator='conversation.item.truncate'): + audio_end_ms: int + content_index: int + event_id: Optional[str] + item_id: str + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE] @overload def __init__( self, *, - error: Optional[RealtimeResponseStatusDetailsError] = ..., - reason: Optional[Literal[turn_detected, client_cancelled, max_output_tokens, content_filter]] = ..., - type: Optional[Literal[completed, cancelled, failed, incomplete]] = ... + audio_end_ms: int, + content_index: int, + event_id: Optional[str] = ..., + item_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeResponseStatusDetailsError(_Model): - code: Optional[str] - type: Optional[str] + class azure.ai.projects.models.RealtimeClientEventInputAudioBufferAppend(RealtimeClientEvent, discriminator='input_audio_buffer.append'): + audio: str + event_id: Optional[str] + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND] @overload def __init__( self, *, - code: Optional[str] = ..., - type: Optional[str] = ... + audio: str, + event_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeResponseUsage(_Model): - input_token_details: Optional[RealtimeResponseUsageInputTokenDetails] - input_tokens: Optional[int] - output_token_details: Optional[RealtimeResponseUsageOutputTokenDetails] - output_tokens: Optional[int] - total_tokens: Optional[int] + class azure.ai.projects.models.RealtimeClientEventInputAudioBufferClear(RealtimeClientEvent, discriminator='input_audio_buffer.clear'): + event_id: Optional[str] + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR] @overload def __init__( self, *, - input_token_details: Optional[RealtimeResponseUsageInputTokenDetails] = ..., - input_tokens: Optional[int] = ..., - output_token_details: Optional[RealtimeResponseUsageOutputTokenDetails] = ..., - output_tokens: Optional[int] = ..., - total_tokens: Optional[int] = ... + event_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeResponseUsageInputTokenDetails(_Model): - audio_tokens: Optional[int] - cached_tokens: Optional[int] - cached_tokens_details: Optional[RealtimeResponseUsageInputTokenDetailsCachedTokensDetails] - image_tokens: Optional[int] - text_tokens: Optional[int] + class azure.ai.projects.models.RealtimeClientEventInputAudioBufferCommit(RealtimeClientEvent, discriminator='input_audio_buffer.commit'): + event_id: Optional[str] + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT] @overload def __init__( self, *, - audio_tokens: Optional[int] = ..., - cached_tokens: Optional[int] = ..., - cached_tokens_details: Optional[RealtimeResponseUsageInputTokenDetailsCachedTokensDetails] = ..., - image_tokens: Optional[int] = ..., - text_tokens: Optional[int] = ... + event_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails(_Model): - audio_tokens: Optional[int] - image_tokens: Optional[int] - text_tokens: Optional[int] + class azure.ai.projects.models.RealtimeClientEventOutputAudioBufferClear(RealtimeClientEvent, discriminator='output_audio_buffer.clear'): + event_id: Optional[str] + type: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR] @overload def __init__( self, *, - audio_tokens: Optional[int] = ..., - image_tokens: Optional[int] = ..., - text_tokens: Optional[int] = ... + event_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeResponseUsageOutputTokenDetails(_Model): - audio_tokens: Optional[int] - text_tokens: Optional[int] + class azure.ai.projects.models.RealtimeClientEventResponseCancel(RealtimeClientEvent, discriminator='response.cancel'): + event_id: Optional[str] + response_id: Optional[str] + type: Literal[RealtimeClientEventType.RESPONSE_CANCEL] @overload def __init__( self, *, - audio_tokens: Optional[int] = ..., - text_tokens: Optional[int] = ... + event_id: Optional[str] = ..., + response_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEvent(_Model): - type: str + class azure.ai.projects.models.RealtimeClientEventResponseCreate(RealtimeClientEvent, discriminator='response.create'): + event_id: Optional[str] + response: Optional[VoiceAgentResponseCreateParams] + type: Literal[RealtimeClientEventType.RESPONSE_CREATE] @overload def __init__( self, *, - type: str + event_id: Optional[str] = ..., + response: Optional[VoiceAgentResponseCreateParams] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventConversationItemAdded(RealtimeServerEvent, discriminator='conversation.item.added'): - event_id: str - item: RealtimeConversationItem - previous_item_id: Optional[str] - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED] + class azure.ai.projects.models.RealtimeClientEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONVERSATION_ITEM_CREATE = "conversation.item.create" + CONVERSATION_ITEM_DELETE = "conversation.item.delete" + CONVERSATION_ITEM_RETRIEVE = "conversation.item.retrieve" + CONVERSATION_ITEM_TRUNCATE = "conversation.item.truncate" + INPUT_AUDIO_BUFFER_APPEND = "input_audio_buffer.append" + INPUT_AUDIO_BUFFER_CLEAR = "input_audio_buffer.clear" + INPUT_AUDIO_BUFFER_COMMIT = "input_audio_buffer.commit" + OUTPUT_AUDIO_BUFFER_CLEAR = "output_audio_buffer.clear" + RESPONSE_CANCEL = "response.cancel" + RESPONSE_CREATE = "response.create" + RTC_CALL_SDP_CREATE = "rtc.call.sdp.create" + SESSION_AVATAR_CONNECT = "session.avatar.connect" + SESSION_UPDATE = "session.update" + + + class azure.ai.projects.models.RealtimeConversationItem(_Model): + type: str @overload def __init__( self, *, - event_id: str, - item: RealtimeConversationItem, - previous_item_id: Optional[str] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventConversationItemCreated(RealtimeServerEvent, discriminator='conversation.item.created'): - event_id: str - item: RealtimeConversationItem - previous_item_id: Optional[str] - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED] + class azure.ai.projects.models.RealtimeConversationItemFunctionCall(RealtimeConversationItem, discriminator='function_call'): + arguments: str + call_id: Optional[str] + created_at: Optional[datetime] + id: Optional[str] + name: str + object: Optional[Literal["item"]] + response_id: Optional[str] + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Literal[RealtimeConversationItemType.FUNCTION_CALL] @overload def __init__( self, *, - event_id: str, - item: RealtimeConversationItem, - previous_item_id: Optional[str] = ... + arguments: str, + call_id: Optional[str] = ..., + id: Optional[str] = ..., + name: str, + object: Optional[Literal[item]] = ..., + status: Optional[Literal[completed, incomplete, in_progress]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventConversationItemDeleted(RealtimeServerEvent, discriminator='conversation.item.deleted'): - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED] + class azure.ai.projects.models.RealtimeConversationItemFunctionCallOutput(RealtimeConversationItem, discriminator='function_call_output'): + call_id: str + created_at: Optional[datetime] + id: Optional[str] + name: Optional[str] + object: Optional[Literal["item"]] + output: str + response_id: Optional[str] + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT] @overload def __init__( self, *, - event_id: str, - item_id: str + call_id: str, + id: Optional[str] = ..., + name: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + output: str, + status: Optional[Literal[completed, incomplete, in_progress]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventConversationItemDone(RealtimeServerEvent, discriminator='conversation.item.done'): - event_id: str - item: RealtimeConversationItem - previous_item_id: Optional[str] - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE] + class azure.ai.projects.models.RealtimeConversationItemMessage(RealtimeConversationItem, discriminator='message'): + role: str + type: Literal[RealtimeConversationItemType.MESSAGE] @overload def __init__( self, *, - event_id: str, - item: RealtimeConversationItem, - previous_item_id: Optional[str] = ... + role: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionCompleted(RealtimeServerEvent, discriminator='conversation.item.input_audio_transcription.completed'): - content_index: int - event_id: str - item_id: str - languages: Optional[list[TranscriptionLanguage]] - logprobs: Optional[list[LogProbProperties]] - phrases: Optional[list[VoiceAgentTranscriptionPhrase]] - transcript: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED] - usage: Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration] + class azure.ai.projects.models.RealtimeConversationItemMessageAssistant(RealtimeConversationItemMessage, discriminator='assistant'): + content: list[RealtimeConversationItemMessageAssistantContent] + created_at: Optional[datetime] + id: Optional[str] + object: Optional[Literal["item"]] + response_id: Optional[str] + role: Literal[RealtimeConversationItemMessageType.ASSISTANT] + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Union[str, azure.ai.projects.models.MESSAGE] @overload def __init__( self, *, - content_index: int, - event_id: str, - item_id: str, - languages: Optional[list[TranscriptionLanguage]] = ..., - logprobs: Optional[list[LogProbProperties]] = ..., - phrases: Optional[list[VoiceAgentTranscriptionPhrase]] = ..., - transcript: str, - usage: Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration] + content: list[RealtimeConversationItemMessageAssistantContent], + id: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + status: Optional[Literal[completed, incomplete, in_progress]] = ..., + type: Literal[RealtimeConversationItemType.MESSAGE] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionDelta(RealtimeServerEvent, discriminator='conversation.item.input_audio_transcription.delta'): - content_index: Optional[int] - delta: Optional[str] - event_id: str - item_id: str - logprobs: Optional[list[LogProbProperties]] - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA] + class azure.ai.projects.models.RealtimeConversationItemMessageAssistantContent(_Model): + audio: Optional[str] + text: Optional[str] + transcript: Optional[str] + type: Optional[Literal["output_text", "output_audio"]] @overload def __init__( self, *, - content_index: Optional[int] = ..., - delta: Optional[str] = ..., - event_id: str, - item_id: str, - logprobs: Optional[list[LogProbProperties]] = ... + audio: Optional[str] = ..., + text: Optional[str] = ..., + transcript: Optional[str] = ..., + type: Optional[Literal[output_text, output_audio]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionFailed(RealtimeServerEvent, discriminator='conversation.item.input_audio_transcription.failed'): - content_index: int - error: RealtimeServerEventConversationItemInputAudioTranscriptionFailedError - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED] + class azure.ai.projects.models.RealtimeConversationItemMessageSystem(RealtimeConversationItemMessage, discriminator='system'): + content: list[RealtimeConversationItemMessageSystemContent] + created_at: Optional[datetime] + id: Optional[str] + object: Optional[Literal["item"]] + response_id: Optional[str] + role: Literal[RealtimeConversationItemMessageType.SYSTEM] + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Union[str, azure.ai.projects.models.MESSAGE] @overload def __init__( self, *, - content_index: int, - error: RealtimeServerEventConversationItemInputAudioTranscriptionFailedError, - event_id: str, - item_id: str + content: list[RealtimeConversationItemMessageSystemContent], + id: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + status: Optional[Literal[completed, incomplete, in_progress]] = ..., + type: Literal[RealtimeConversationItemType.MESSAGE] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError(_Model): - code: Optional[str] - message: Optional[str] - param: Optional[str] - type: Optional[str] + class azure.ai.projects.models.RealtimeConversationItemMessageSystemContent(_Model): + text: Optional[str] + type: Optional[Literal["input_text"]] @overload def __init__( self, *, - code: Optional[str] = ..., - message: Optional[str] = ..., - param: Optional[str] = ..., - type: Optional[str] = ... + text: Optional[str] = ..., + type: Optional[Literal[input_text]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionSegment(RealtimeServerEvent, discriminator='conversation.item.input_audio_transcription.segment'): - content_index: int - end: float - event_id: str - id: str - item_id: str - speaker: str - start: float - text: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT] + class azure.ai.projects.models.RealtimeConversationItemMessageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ASSISTANT = "assistant" + SYSTEM = "system" + USER = "user" + + + class azure.ai.projects.models.RealtimeConversationItemMessageUser(RealtimeConversationItemMessage, discriminator='user'): + content: list[RealtimeConversationItemMessageUserContent] + created_at: Optional[datetime] + id: Optional[str] + object: Optional[Literal["item"]] + response_id: Optional[str] + role: Literal[RealtimeConversationItemMessageType.USER] + status: Optional[Literal["completed", "incomplete", "in_progress"]] + type: Union[str, azure.ai.projects.models.MESSAGE] @overload def __init__( self, *, - content_index: int, - end: float, - event_id: str, - id: str, - item_id: str, - speaker: str, - start: float, - text: str + content: list[RealtimeConversationItemMessageUserContent], + id: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + status: Optional[Literal[completed, incomplete, in_progress]] = ..., + type: Literal[RealtimeConversationItemType.MESSAGE] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventConversationItemRetrieved(RealtimeServerEvent, discriminator='conversation.item.retrieved'): - event_id: str - item: RealtimeConversationItem - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED] + class azure.ai.projects.models.RealtimeConversationItemMessageUserContent(_Model): + audio: Optional[str] + detail: Optional[Literal["auto", "low", "high"]] + image_url: Optional[str] + text: Optional[str] + transcript: Optional[str] + type: Optional[Literal["input_text", "input_audio", "input_image"]] @overload def __init__( self, *, - event_id: str, - item: RealtimeConversationItem + audio: Optional[str] = ..., + detail: Optional[Literal[auto, low, high]] = ..., + image_url: Optional[str] = ..., + text: Optional[str] = ..., + transcript: Optional[str] = ..., + type: Optional[Literal[input_text, input_audio, input_image]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventConversationItemTruncated(RealtimeServerEvent, discriminator='conversation.item.truncated'): - audio_end_ms: int - content_index: int - event_id: str - item: Optional[RealtimeConversationItem] - item_id: str - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED] + class azure.ai.projects.models.RealtimeConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FUNCTION_CALL = "function_call" + FUNCTION_CALL_OUTPUT = "function_call_output" + MCP_APPROVAL_REQUEST = "mcp_approval_request" + MCP_APPROVAL_RESPONSE = "mcp_approval_response" + MCP_CALL = "mcp_call" + MCP_LIST_TOOLS = "mcp_list_tools" + MESSAGE = "message" + + + class azure.ai.projects.models.RealtimeFunctionTool(_Model): + description: Optional[str] + name: Optional[str] + parameters: Optional[RealtimeFunctionToolParameters] + type: Optional[Literal["function"]] @overload def __init__( self, *, - audio_end_ms: int, - content_index: int, - event_id: str, - item: Optional[RealtimeConversationItem] = ..., - item_id: str + description: Optional[str] = ..., + name: Optional[str] = ..., + parameters: Optional[RealtimeFunctionToolParameters] = ..., + type: Optional[Literal[function]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventError(_Model): - error: RealtimeServerEventErrorError - event_id: str - type: Literal["error"] + class azure.ai.projects.models.RealtimeFunctionToolParameters(_Model): + + + class azure.ai.projects.models.RealtimeMCPApprovalRequest(RealtimeConversationItem, discriminator='mcp_approval_request'): + arguments: str + created_at: Optional[datetime] + id: str + name: str + response_id: Optional[str] + server_label: str + type: Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST] @overload def __init__( self, *, - error: RealtimeServerEventErrorError, - event_id: str + arguments: str, + id: str, + name: str, + server_label: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventErrorError(_Model): - code: Optional[str] - event_id: Optional[str] - message: str - param: Optional[str] - type: str + class azure.ai.projects.models.RealtimeMCPApprovalResponse(RealtimeConversationItem, discriminator='mcp_approval_response'): + approval_request_id: str + approve: bool + created_at: Optional[datetime] + id: str + reason: Optional[str] + response_id: Optional[str] + type: Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE] @overload def __init__( self, *, - code: Optional[str] = ..., - event_id: Optional[str] = ..., - message: str, - param: Optional[str] = ..., - type: str + approval_request_id: str, + approve: bool, + id: str, + reason: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventInputAudioBufferCleared(RealtimeServerEvent, discriminator='input_audio_buffer.cleared'): - event_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED] + class azure.ai.projects.models.RealtimeMCPError(_Model): + type: str @overload def __init__( self, *, - event_id: str + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventInputAudioBufferCommitted(RealtimeServerEvent, discriminator='input_audio_buffer.committed'): - event_id: str - item_id: str - previous_item_id: Optional[str] - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED] + class azure.ai.projects.models.RealtimeMCPHTTPError(RealtimeMCPError, discriminator='http_error'): + code: int + message: str + type: Literal[RealtimeMcpErrorType.HTTP_ERROR] @overload def __init__( self, *, - event_id: str, - item_id: str, - previous_item_id: Optional[str] = ... + code: int, + message: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventInputAudioBufferSpeechStarted(RealtimeServerEvent, discriminator='input_audio_buffer.speech_started'): - audio_start_ms: int - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED] + class azure.ai.projects.models.RealtimeMCPListTools(RealtimeConversationItem, discriminator='mcp_list_tools'): + created_at: Optional[datetime] + id: Optional[str] + response_id: Optional[str] + server_label: str + tools: list[MCPListToolsTool] + type: Literal[RealtimeConversationItemType.MCP_LIST_TOOLS] @overload def __init__( self, *, - audio_start_ms: int, - event_id: str, - item_id: str + id: Optional[str] = ..., + server_label: str, + tools: list[MCPListToolsTool] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventInputAudioBufferSpeechStopped(RealtimeServerEvent, discriminator='input_audio_buffer.speech_stopped'): - audio_end_ms: int - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED] + class azure.ai.projects.models.RealtimeMCPProtocolError(RealtimeMCPError, discriminator='protocol_error'): + code: int + message: str + type: Literal[RealtimeMcpErrorType.PROTOCOL_ERROR] @overload def __init__( self, *, - audio_end_ms: int, - event_id: str, - item_id: str + code: int, + message: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventInputAudioBufferTimeoutTriggered(RealtimeServerEvent, discriminator='input_audio_buffer.timeout_triggered'): - audio_end_ms: int - audio_start_ms: int - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED] + class azure.ai.projects.models.RealtimeMCPToolCall(RealtimeConversationItem, discriminator='mcp_call'): + approval_request_id: Optional[str] + arguments: str + created_at: Optional[datetime] + error: Optional[RealtimeMCPError] + id: str + name: str + output: Optional[str] + response_id: Optional[str] + server_label: str + type: Literal[RealtimeConversationItemType.MCP_CALL] @overload def __init__( self, *, - audio_end_ms: int, - audio_start_ms: int, - event_id: str, - item_id: str + approval_request_id: Optional[str] = ..., + arguments: str, + error: Optional[RealtimeMCPError] = ..., + id: str, + name: str, + output: Optional[str] = ..., + server_label: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventMCPListToolsCompleted(RealtimeServerEvent, discriminator='mcp_list_tools.completed'): - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED] + class azure.ai.projects.models.RealtimeMCPToolExecutionError(RealtimeMCPError, discriminator='tool_execution_error'): + message: str + type: Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR] @overload def __init__( self, *, - event_id: str, - item_id: str + message: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventMCPListToolsFailed(RealtimeServerEvent, discriminator='mcp_list_tools.failed'): - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED] + class azure.ai.projects.models.RealtimeMcpErrorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HTTP_ERROR = "http_error" + PROTOCOL_ERROR = "protocol_error" + TOOL_EXECUTION_ERROR = "tool_execution_error" + + + class azure.ai.projects.models.RealtimeReasoning(_Model): + effort: Optional[Union[str, RealtimeReasoningEffort]] @overload def __init__( self, *, - event_id: str, - item_id: str + effort: Optional[Union[str, RealtimeReasoningEffort]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventMCPListToolsInProgress(RealtimeServerEvent, discriminator='mcp_list_tools.in_progress'): - event_id: str - item_id: str - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS] + class azure.ai.projects.models.RealtimeReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HIGH = "high" + LOW = "low" + MEDIUM = "medium" + MINIMAL = "minimal" + XHIGH = "xhigh" + + + class azure.ai.projects.models.RealtimeResponseStatusDetails(_Model): + error: Optional[RealtimeResponseStatusDetailsError] + reason: Optional[Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"]] + type: Optional[Literal["completed", "cancelled", "failed", "incomplete"]] @overload def __init__( self, *, - event_id: str, - item_id: str + error: Optional[RealtimeResponseStatusDetailsError] = ..., + reason: Optional[Literal[turn_detected, client_cancelled, max_output_tokens, content_filter]] = ..., + type: Optional[Literal[completed, cancelled, failed, incomplete]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventOutputAudioBufferCleared(RealtimeServerEvent, discriminator='output_audio_buffer.cleared'): - event_id: str - response_id: str - type: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED] + class azure.ai.projects.models.RealtimeResponseStatusDetailsError(_Model): + code: Optional[str] + type: Optional[str] @overload def __init__( self, *, - event_id: str, - response_id: str + code: Optional[str] = ..., + type: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventRateLimitsUpdated(RealtimeServerEvent, discriminator='rate_limits.updated'): - event_id: str - rate_limits: list[RealtimeServerEventRateLimitsUpdatedRateLimits] - type: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED] + class azure.ai.projects.models.RealtimeResponseUsage(_Model): + input_token_details: Optional[RealtimeResponseUsageInputTokenDetails] + input_tokens: Optional[int] + output_token_details: Optional[RealtimeResponseUsageOutputTokenDetails] + output_tokens: Optional[int] + total_tokens: Optional[int] @overload def __init__( self, *, - event_id: str, - rate_limits: list[RealtimeServerEventRateLimitsUpdatedRateLimits] + input_token_details: Optional[RealtimeResponseUsageInputTokenDetails] = ..., + input_tokens: Optional[int] = ..., + output_token_details: Optional[RealtimeResponseUsageOutputTokenDetails] = ..., + output_tokens: Optional[int] = ..., + total_tokens: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventRateLimitsUpdatedRateLimits(_Model): - limit: Optional[int] - name: Optional[Literal["requests", "tokens"]] - remaining: Optional[int] - reset_seconds: Optional[float] + class azure.ai.projects.models.RealtimeResponseUsageInputTokenDetails(_Model): + audio_tokens: Optional[int] + cached_tokens: Optional[int] + cached_tokens_details: Optional[RealtimeResponseUsageInputTokenDetailsCachedTokensDetails] + image_tokens: Optional[int] + text_tokens: Optional[int] @overload def __init__( self, *, - limit: Optional[int] = ..., - name: Optional[Literal[requests, tokens]] = ..., - remaining: Optional[int] = ..., - reset_seconds: Optional[float] = ... + audio_tokens: Optional[int] = ..., + cached_tokens: Optional[int] = ..., + cached_tokens_details: Optional[RealtimeResponseUsageInputTokenDetailsCachedTokensDetails] = ..., + image_tokens: Optional[int] = ..., + text_tokens: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseAudioDelta(RealtimeServerEvent, discriminator='response.output_audio.delta'): - content_index: int - delta: bytes - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA] + class azure.ai.projects.models.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails(_Model): + audio_tokens: Optional[int] + image_tokens: Optional[int] + text_tokens: Optional[int] @overload def __init__( self, *, - content_index: int, - delta: bytes, - event_id: str, - item_id: str, - output_index: int, - response_id: str + audio_tokens: Optional[int] = ..., + image_tokens: Optional[int] = ..., + text_tokens: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseAudioDone(RealtimeServerEvent, discriminator='response.output_audio.done'): - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE] + class azure.ai.projects.models.RealtimeResponseUsageOutputTokenDetails(_Model): + audio_tokens: Optional[int] + text_tokens: Optional[int] @overload def __init__( self, *, - content_index: int, - event_id: str, - item_id: str, - output_index: int, - response_id: str + audio_tokens: Optional[int] = ..., + text_tokens: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseAudioTranscriptDelta(RealtimeServerEvent, discriminator='response.output_audio_transcript.delta'): - content_index: int - delta: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA] + class azure.ai.projects.models.RealtimeServerEvent(_Model): + type: str @overload def __init__( self, *, - content_index: int, - delta: str, - event_id: str, - item_id: str, - output_index: int, - response_id: str + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseAudioTranscriptDone(RealtimeServerEvent, discriminator='response.output_audio_transcript.done'): - content_index: int + class azure.ai.projects.models.RealtimeServerEventConversationItemAdded(RealtimeServerEvent, discriminator='conversation.item.added'): event_id: str - item_id: str - output_index: int - response_id: str - transcript: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE] + item: RealtimeConversationItem + previous_item_id: Optional[str] + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED] @overload def __init__( self, *, - content_index: int, event_id: str, - item_id: str, - output_index: int, - response_id: str, - transcript: str + item: RealtimeConversationItem, + previous_item_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseContentPartAdded(RealtimeServerEvent, discriminator='response.content_part.added'): - content_index: int + class azure.ai.projects.models.RealtimeServerEventConversationItemCreated(RealtimeServerEvent, discriminator='conversation.item.created'): event_id: str - item_id: str - output_index: int - part: RealtimeServerEventResponseContentPartAddedPart - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED] + item: RealtimeConversationItem + previous_item_id: Optional[str] + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED] @overload def __init__( self, *, - content_index: int, event_id: str, - item_id: str, - output_index: int, - part: RealtimeServerEventResponseContentPartAddedPart, - response_id: str + item: RealtimeConversationItem, + previous_item_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseContentPartAddedPart(_Model): - audio: Optional[str] - text: Optional[str] - transcript: Optional[str] - type: Optional[Literal["audio", "text"]] + class azure.ai.projects.models.RealtimeServerEventConversationItemDeleted(RealtimeServerEvent, discriminator='conversation.item.deleted'): + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED] @overload def __init__( self, *, - audio: Optional[str] = ..., - text: Optional[str] = ..., - transcript: Optional[str] = ..., - type: Optional[Literal[audio, text]] = ... + event_id: str, + item_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseContentPartDone(RealtimeServerEvent, discriminator='response.content_part.done'): - content_index: int + class azure.ai.projects.models.RealtimeServerEventConversationItemDone(RealtimeServerEvent, discriminator='conversation.item.done'): event_id: str - item_id: str - output_index: int - part: RealtimeServerEventResponseContentPartDonePart - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE] + item: RealtimeConversationItem + previous_item_id: Optional[str] + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE] @overload def __init__( self, *, - content_index: int, event_id: str, - item_id: str, - output_index: int, - part: RealtimeServerEventResponseContentPartDonePart, - response_id: str + item: RealtimeConversationItem, + previous_item_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseContentPartDonePart(_Model): - audio: Optional[str] - format: Optional[RealtimeAudioFormats] - text: Optional[str] - transcript: Optional[str] - type: Optional[Literal["audio", "text"]] + class azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionCompleted(RealtimeServerEvent, discriminator='conversation.item.input_audio_transcription.completed'): + content_index: int + event_id: str + item_id: str + languages: Optional[list[TranscriptionLanguage]] + logprobs: Optional[list[LogProbProperties]] + phrases: Optional[list[VoiceAgentTranscriptionPhrase]] + transcript: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED] + usage: Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration] @overload def __init__( self, *, - audio: Optional[str] = ..., - format: Optional[RealtimeAudioFormats] = ..., - text: Optional[str] = ..., - transcript: Optional[str] = ..., - type: Optional[Literal[audio, text]] = ... + content_index: int, + event_id: str, + item_id: str, + languages: Optional[list[TranscriptionLanguage]] = ..., + logprobs: Optional[list[LogProbProperties]] = ..., + phrases: Optional[list[VoiceAgentTranscriptionPhrase]] = ..., + transcript: str, + usage: Union[TranscriptTextUsageTokens, TranscriptTextUsageDuration] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseCreated(RealtimeServerEvent, discriminator='response.created'): + class azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionDelta(RealtimeServerEvent, discriminator='conversation.item.input_audio_transcription.delta'): + content_index: Optional[int] + delta: Optional[str] event_id: str - response: VoiceAgentRealtimeResponse - type: Literal[RealtimeServerEventType.RESPONSE_CREATED] + item_id: str + logprobs: Optional[list[LogProbProperties]] + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA] @overload def __init__( self, *, + content_index: Optional[int] = ..., + delta: Optional[str] = ..., event_id: str, - response: VoiceAgentRealtimeResponse + item_id: str, + logprobs: Optional[list[LogProbProperties]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseDone(RealtimeServerEvent, discriminator='response.done'): + class azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionFailed(RealtimeServerEvent, discriminator='conversation.item.input_audio_transcription.failed'): + content_index: int + error: RealtimeServerEventConversationItemInputAudioTranscriptionFailedError event_id: str - response: VoiceAgentRealtimeResponse - type: Literal[RealtimeServerEventType.RESPONSE_DONE] + item_id: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED] @overload def __init__( self, *, + content_index: int, + error: RealtimeServerEventConversationItemInputAudioTranscriptionFailedError, event_id: str, - response: VoiceAgentRealtimeResponse + item_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseFunctionCallArgumentsDelta(RealtimeServerEvent, discriminator='response.function_call_arguments.delta'): - call_id: str - delta: str - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA] + class azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError(_Model): + code: Optional[str] + message: Optional[str] + param: Optional[str] + type: Optional[str] @overload def __init__( self, *, - call_id: str, - delta: str, - event_id: str, - item_id: str, - output_index: int, - response_id: str + code: Optional[str] = ..., + message: Optional[str] = ..., + param: Optional[str] = ..., + type: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseFunctionCallArgumentsDone(RealtimeServerEvent, discriminator='response.function_call_arguments.done'): - arguments: str - call_id: str + class azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionSegment(RealtimeServerEvent, discriminator='conversation.item.input_audio_transcription.segment'): + content_index: int + end: float event_id: str + id: str item_id: str - name: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE] + speaker: str + start: float + text: str + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT] @overload def __init__( self, *, - arguments: str, - call_id: str, + content_index: int, + end: float, event_id: str, + id: str, item_id: str, - name: str, - output_index: int, - response_id: str + speaker: str, + start: float, + text: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseMCPCallArgumentsDelta(RealtimeServerEvent, discriminator='response.mcp_call_arguments.delta'): - delta: str + class azure.ai.projects.models.RealtimeServerEventConversationItemRetrieved(RealtimeServerEvent, discriminator='conversation.item.retrieved'): event_id: str - item_id: str - obfuscation: Optional[str] - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA] + item: RealtimeConversationItem + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED] @overload def __init__( self, *, - delta: str, event_id: str, - item_id: str, - obfuscation: Optional[str] = ..., - output_index: int, - response_id: str + item: RealtimeConversationItem ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseMCPCallArgumentsDone(RealtimeServerEvent, discriminator='response.mcp_call_arguments.done'): - arguments: str + class azure.ai.projects.models.RealtimeServerEventConversationItemTruncated(RealtimeServerEvent, discriminator='conversation.item.truncated'): + audio_end_ms: int + content_index: int event_id: str + item: Optional[RealtimeConversationItem] item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE] + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED] @overload def __init__( self, *, - arguments: str, + audio_end_ms: int, + content_index: int, event_id: str, - item_id: str, - output_index: int, - response_id: str + item: Optional[RealtimeConversationItem] = ..., + item_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseMCPCallCompleted(RealtimeServerEvent, discriminator='response.mcp_call.completed'): + class azure.ai.projects.models.RealtimeServerEventError(_Model): + error: RealtimeServerEventErrorError event_id: str - item_id: str - output_index: int - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED] + type: Literal["error"] @overload def __init__( self, *, - event_id: str, - item_id: str, - output_index: int + error: RealtimeServerEventErrorError, + event_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseMCPCallFailed(RealtimeServerEvent, discriminator='response.mcp_call.failed'): - event_id: str - item_id: str - output_index: int - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED] + class azure.ai.projects.models.RealtimeServerEventErrorError(_Model): + code: Optional[str] + event_id: Optional[str] + message: str + param: Optional[str] + type: str @overload def __init__( self, *, - event_id: str, - item_id: str, - output_index: int + code: Optional[str] = ..., + event_id: Optional[str] = ..., + message: str, + param: Optional[str] = ..., + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseMCPCallInProgress(RealtimeServerEvent, discriminator='response.mcp_call.in_progress'): + class azure.ai.projects.models.RealtimeServerEventInputAudioBufferCleared(RealtimeServerEvent, discriminator='input_audio_buffer.cleared'): event_id: str - item_id: str - output_index: int - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS] + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED] @overload def __init__( self, *, - event_id: str, - item_id: str, - output_index: int + event_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseOutputItemAdded(RealtimeServerEvent, discriminator='response.output_item.added'): + class azure.ai.projects.models.RealtimeServerEventInputAudioBufferCommitted(RealtimeServerEvent, discriminator='input_audio_buffer.committed'): event_id: str - item: RealtimeConversationItem - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED] + item_id: str + previous_item_id: Optional[str] + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED] @overload def __init__( self, *, event_id: str, - item: RealtimeConversationItem, - output_index: int, - response_id: str + item_id: str, + previous_item_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseOutputItemDone(RealtimeServerEvent, discriminator='response.output_item.done'): + class azure.ai.projects.models.RealtimeServerEventInputAudioBufferSpeechStarted(RealtimeServerEvent, discriminator='input_audio_buffer.speech_started'): + audio_start_ms: int event_id: str - item: RealtimeConversationItem - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE] + item_id: str + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED] @overload def __init__( self, *, + audio_start_ms: int, event_id: str, - item: RealtimeConversationItem, - output_index: int, - response_id: str + item_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseTextDelta(RealtimeServerEvent, discriminator='response.output_text.delta'): - content_index: int - delta: str + class azure.ai.projects.models.RealtimeServerEventInputAudioBufferSpeechStopped(RealtimeServerEvent, discriminator='input_audio_buffer.speech_stopped'): + audio_end_ms: int event_id: str item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA] + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED] @overload def __init__( self, *, - content_index: int, - delta: str, + audio_end_ms: int, event_id: str, - item_id: str, - output_index: int, - response_id: str + item_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventResponseTextDone(RealtimeServerEvent, discriminator='response.output_text.done'): - content_index: int + class azure.ai.projects.models.RealtimeServerEventInputAudioBufferTimeoutTriggered(RealtimeServerEvent, discriminator='input_audio_buffer.timeout_triggered'): + audio_end_ms: int + audio_start_ms: int event_id: str item_id: str - output_index: int - response_id: str - text: str - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE] + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED] @overload def __init__( self, *, - content_index: int, + audio_end_ms: int, + audio_start_ms: int, event_id: str, - item_id: str, - output_index: int, - response_id: str, - text: str + item_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventSessionCreated(RealtimeServerEvent, discriminator='session.created'): - conversation_id: Optional[str] + class azure.ai.projects.models.RealtimeServerEventMCPListToolsCompleted(RealtimeServerEvent, discriminator='mcp_list_tools.completed'): event_id: str - session: VoiceAgentSessionResponseConfig - type: Literal[RealtimeServerEventType.SESSION_CREATED] + item_id: str + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED] @overload def __init__( self, *, - conversation_id: Optional[str] = ..., event_id: str, - session: VoiceAgentSessionResponseConfig + item_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventSessionUpdated(RealtimeServerEvent, discriminator='session.updated'): + class azure.ai.projects.models.RealtimeServerEventMCPListToolsFailed(RealtimeServerEvent, discriminator='mcp_list_tools.failed'): event_id: str - session: VoiceAgentSessionResponseConfig - type: Literal[RealtimeServerEventType.SESSION_UPDATED] + item_id: str + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED] @overload def __init__( self, *, event_id: str, - session: VoiceAgentSessionResponseConfig + item_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RealtimeServerEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CONVERSATION_CREATED = "conversation.created" - CONVERSATION_ITEM_ADDED = "conversation.item.added" - CONVERSATION_ITEM_CREATED = "conversation.item.created" - CONVERSATION_ITEM_DELETED = "conversation.item.deleted" - CONVERSATION_ITEM_DONE = "conversation.item.done" - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED = "conversation.item.input_audio_transcription.completed" - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA = "conversation.item.input_audio_transcription.delta" - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED = "conversation.item.input_audio_transcription.failed" - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT = "conversation.item.input_audio_transcription.segment" - CONVERSATION_ITEM_RETRIEVED = "conversation.item.retrieved" - CONVERSATION_ITEM_TRUNCATED = "conversation.item.truncated" - ERROR = "error" - INPUT_AUDIO_BUFFER_CLEARED = "input_audio_buffer.cleared" - INPUT_AUDIO_BUFFER_COMMITTED = "input_audio_buffer.committed" - INPUT_AUDIO_BUFFER_DTMF_EVENT_RECEIVED = "input_audio_buffer.dtmf_event_received" - INPUT_AUDIO_BUFFER_SPEECH_STARTED = "input_audio_buffer.speech_started" - INPUT_AUDIO_BUFFER_SPEECH_STOPPED = "input_audio_buffer.speech_stopped" - INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED = "input_audio_buffer.timeout_triggered" - MCP_LIST_TOOLS_COMPLETED = "mcp_list_tools.completed" - MCP_LIST_TOOLS_FAILED = "mcp_list_tools.failed" - MCP_LIST_TOOLS_IN_PROGRESS = "mcp_list_tools.in_progress" - OUTPUT_AUDIO_BUFFER_CLEARED = "output_audio_buffer.cleared" - OUTPUT_AUDIO_BUFFER_STARTED = "output_audio_buffer.started" - OUTPUT_AUDIO_BUFFER_STOPPED = "output_audio_buffer.stopped" - RATE_LIMITS_UPDATED = "rate_limits.updated" - RESPONSE_ANIMATION_BLENDSHAPES_DELTA = "response.animation_blendshapes.delta" - RESPONSE_ANIMATION_BLENDSHAPES_DONE = "response.animation_blendshapes.done" - RESPONSE_ANIMATION_VISEME_DELTA = "response.animation_viseme.delta" - RESPONSE_ANIMATION_VISEME_DONE = "response.animation_viseme.done" - RESPONSE_AUDIO_TIMESTAMP_DELTA = "response.audio_timestamp.delta" - RESPONSE_AUDIO_TIMESTAMP_DONE = "response.audio_timestamp.done" - RESPONSE_CONTENT_PART_ADDED = "response.content_part.added" - RESPONSE_CONTENT_PART_DONE = "response.content_part.done" - RESPONSE_CREATED = "response.created" - RESPONSE_DONE = "response.done" - RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA = "response.function_call_arguments.delta" - RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE = "response.function_call_arguments.done" - RESPONSE_MCP_CALL_ARGUMENTS_DELTA = "response.mcp_call_arguments.delta" - RESPONSE_MCP_CALL_ARGUMENTS_DONE = "response.mcp_call_arguments.done" - RESPONSE_MCP_CALL_COMPLETED = "response.mcp_call.completed" - RESPONSE_MCP_CALL_FAILED = "response.mcp_call.failed" - RESPONSE_MCP_CALL_IN_PROGRESS = "response.mcp_call.in_progress" - RESPONSE_OUTPUT_AUDIO_DELTA = "response.output_audio.delta" - RESPONSE_OUTPUT_AUDIO_DONE = "response.output_audio.done" - RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA = "response.output_audio_transcript.delta" - RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE = "response.output_audio_transcript.done" - RESPONSE_OUTPUT_ITEM_ADDED = "response.output_item.added" - RESPONSE_OUTPUT_ITEM_DONE = "response.output_item.done" - RESPONSE_OUTPUT_TEXT_DELTA = "response.output_text.delta" - RESPONSE_OUTPUT_TEXT_DONE = "response.output_text.done" - RESPONSE_VIDEO_DELTA = "response.video.delta" - SESSION_AVATAR_CONNECTING = "session.avatar.connecting" - SESSION_AVATAR_SWITCH_TO_IDLE = "session.avatar.switch_to_idle" - SESSION_AVATAR_SWITCH_TO_SPEAKING = "session.avatar.switch_to_speaking" - SESSION_CREATED = "session.created" - SESSION_UPDATED = "session.updated" - WARNING = "warning" - - - class azure.ai.projects.models.Reasoning(_Model): - context: Optional[Literal["auto", "current_turn", "all_turns"]] - effort: Optional[Union[str, ReasoningEffort]] - generate_summary: Optional[Literal["auto", "concise", "detailed"]] - mode: Optional[Union[str, ReasoningModeEnum]] - summary: Optional[Literal["auto", "concise", "detailed"]] + class azure.ai.projects.models.RealtimeServerEventMCPListToolsInProgress(RealtimeServerEvent, discriminator='mcp_list_tools.in_progress'): + event_id: str + item_id: str + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS] @overload def __init__( self, *, - context: Optional[Literal[auto, current_turn, all_turns]] = ..., - effort: Optional[Union[str, ReasoningEffort]] = ..., - generate_summary: Optional[Literal[auto, concise, detailed]] = ..., - mode: Optional[Union[str, ReasoningModeEnum]] = ..., - summary: Optional[Literal[auto, concise, detailed]] = ... + event_id: str, + item_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): - HIGH = "high" - LOW = "low" - MAX = "max" - MEDIUM = "medium" - MINIMAL = "minimal" - NONE = "none" - XHIGH = "xhigh" - - - class azure.ai.projects.models.ReasoningModeEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): - PRO = "pro" - STANDARD = "standard" - - - class azure.ai.projects.models.RecurrenceSchedule(_Model): - type: str + class azure.ai.projects.models.RealtimeServerEventOutputAudioBufferCleared(RealtimeServerEvent, discriminator='output_audio_buffer.cleared'): + event_id: str + response_id: str + type: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED] @overload def __init__( self, *, - type: str + event_id: str, + response_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RecurrenceTrigger(Trigger, discriminator='Recurrence'): - end_time: Optional[datetime] - interval: int - schedule: RecurrenceSchedule - start_time: Optional[datetime] - time_zone: Optional[str] - type: Literal[TriggerType.RECURRENCE] + class azure.ai.projects.models.RealtimeServerEventRateLimitsUpdated(RealtimeServerEvent, discriminator='rate_limits.updated'): + event_id: str + rate_limits: list[RealtimeServerEventRateLimitsUpdatedRateLimits] + type: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED] @overload def __init__( self, *, - end_time: Optional[datetime] = ..., - interval: int, - schedule: RecurrenceSchedule, - start_time: Optional[datetime] = ..., - time_zone: Optional[str] = ... + event_id: str, + rate_limits: list[RealtimeServerEventRateLimitsUpdatedRateLimits] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RecurrenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DAILY = "Daily" - HOURLY = "Hourly" - MONTHLY = "Monthly" - WEEKLY = "Weekly" - - - class azure.ai.projects.models.RedTeam(_Model): - application_scenario: Optional[str] - attack_strategies: Optional[list[Union[str, AttackStrategy]]] - display_name: Optional[str] - name: str - num_turns: Optional[int] - properties: Optional[dict[str, str]] - risk_categories: Optional[list[Union[str, RiskCategory]]] - simulation_only: Optional[bool] - status: Optional[str] - tags: Optional[dict[str, str]] - target: RedTeamTargetConfig + class azure.ai.projects.models.RealtimeServerEventRateLimitsUpdatedRateLimits(_Model): + limit: Optional[int] + name: Optional[Literal["requests", "tokens"]] + remaining: Optional[int] + reset_seconds: Optional[float] @overload def __init__( self, *, - application_scenario: Optional[str] = ..., - attack_strategies: Optional[list[Union[str, AttackStrategy]]] = ..., - display_name: Optional[str] = ..., - num_turns: Optional[int] = ..., - properties: Optional[dict[str, str]] = ..., - risk_categories: Optional[list[Union[str, RiskCategory]]] = ..., - simulation_only: Optional[bool] = ..., - tags: Optional[dict[str, str]] = ..., - target: RedTeamTargetConfig + limit: Optional[int] = ..., + name: Optional[Literal[requests, tokens]] = ..., + remaining: Optional[int] = ..., + reset_seconds: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RedTeamEvalRunDataSource(TypedDict, total=False): - key "item_generation_params": Required[Any] - key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] - key "type": Required[Literal["azure_ai_red_team"]] - - - class azure.ai.projects.models.RedTeamTargetConfig(_Model): - type: str + class azure.ai.projects.models.RealtimeServerEventResponseAudioDelta(RealtimeServerEvent, discriminator='response.output_audio.delta'): + content_index: int + delta: bytes + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA] @overload def __init__( self, *, - type: str + content_index: int, + delta: bytes, + event_id: str, + item_id: str, + output_index: int, + response_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ReminderPreviewToolboxTool(ToolboxTool, discriminator='reminder_preview'): - description: str - name: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.REMINDER_PREVIEW] + class azure.ai.projects.models.RealtimeServerEventResponseAudioDone(RealtimeServerEvent, discriminator='response.output_audio.done'): + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE] @overload def __init__( self, *, - description: Optional[str] = ..., - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + content_index: int, + event_id: str, + item_id: str, + output_index: int, + response_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ResponseRetrievalItemGenerationParams(TypedDict, total=False): - key "data_mapping": Required[Dict[str, str]] - key "max_num_turns": int - key "source": Required[Union[SourceFileContent, SourceFileID]] - key "type": Required[Literal["response_retrieval"]] - - - class azure.ai.projects.models.ResponseUsageInputTokensDetails(_Model): - cache_write_tokens: int - cached_tokens: int + class azure.ai.projects.models.RealtimeServerEventResponseAudioTranscriptDelta(RealtimeServerEvent, discriminator='response.output_audio_transcript.delta'): + content_index: int + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA] @overload def __init__( self, *, - cache_write_tokens: int, - cached_tokens: int + content_index: int, + delta: str, + event_id: str, + item_id: str, + output_index: int, + response_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ResponseUsageOutputTokensDetails(_Model): - reasoning_tokens: int + class azure.ai.projects.models.RealtimeServerEventResponseAudioTranscriptDone(RealtimeServerEvent, discriminator='response.output_audio_transcript.done'): + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + transcript: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE] @overload def __init__( self, *, - reasoning_tokens: int + content_index: int, + event_id: str, + item_id: str, + output_index: int, + response_id: str, + transcript: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ResponsesProtocolConfiguration(_Model): - - - class azure.ai.projects.models.RiskCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CODE_VULNERABILITY = "CodeVulnerability" - HATE_UNFAIRNESS = "HateUnfairness" - PROHIBITED_ACTIONS = "ProhibitedActions" - PROTECTED_MATERIAL = "ProtectedMaterial" - SELF_HARM = "SelfHarm" - SENSITIVE_DATA_LEAKAGE = "SensitiveDataLeakage" - SEXUAL = "Sexual" - TASK_ADHERENCE = "TaskAdherence" - UNGROUNDED_ATTRIBUTES = "UngroundedAttributes" - VIOLENCE = "Violence" - - - class azure.ai.projects.models.Routine(_Model): - action: Optional[RoutineAction] - created_at: Optional[datetime] - description: Optional[str] - enabled: bool - name: Optional[str] - triggers: Optional[dict[str, RoutineTrigger]] - updated_at: Optional[datetime] + class azure.ai.projects.models.RealtimeServerEventResponseContentPartAdded(RealtimeServerEvent, discriminator='response.content_part.added'): + content_index: int + event_id: str + item_id: str + output_index: int + part: RealtimeServerEventResponseContentPartAddedPart + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED] @overload def __init__( self, *, - action: Optional[RoutineAction] = ..., - created_at: Optional[datetime] = ..., - description: Optional[str] = ..., - enabled: bool, - name: Optional[str] = ..., - triggers: Optional[dict[str, RoutineTrigger]] = ..., - updated_at: Optional[datetime] = ... + content_index: int, + event_id: str, + item_id: str, + output_index: int, + part: RealtimeServerEventResponseContentPartAddedPart, + response_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RoutineAction(_Model): - type: str + class azure.ai.projects.models.RealtimeServerEventResponseContentPartAddedPart(_Model): + audio: Optional[str] + text: Optional[str] + transcript: Optional[str] + type: Optional[Literal["audio", "text"]] @overload def __init__( self, *, - type: str + audio: Optional[str] = ..., + text: Optional[str] = ..., + transcript: Optional[str] = ..., + type: Optional[Literal[audio, text]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RoutineActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - INVOKE_AGENT_INVOCATIONS_API = "invoke_agent_invocations_api" - INVOKE_AGENT_RESPONSES_API = "invoke_agent_responses_api" + class azure.ai.projects.models.RealtimeServerEventResponseContentPartDone(RealtimeServerEvent, discriminator='response.content_part.done'): + content_index: int + event_id: str + item_id: str + output_index: int + part: RealtimeServerEventResponseContentPartDonePart + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE] + @overload + def __init__( + self, + *, + content_index: int, + event_id: str, + item_id: str, + output_index: int, + part: RealtimeServerEventResponseContentPartDonePart, + response_id: str + ) -> None: ... - class azure.ai.projects.models.RoutineAttemptSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): - EVENT_FIRE = "event_fire" - MANUAL_DISPATCH = "manual_dispatch" - QUEUED_DISPATCH = "queued_dispatch" - SCHEDULE_DELIVERY = "schedule_delivery" - TIMER_DELIVERY = "timer_delivery" + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RoutineAuthorization(_Model): - identity: Optional[Union[str, RoutineDispatchIdentity]] + class azure.ai.projects.models.RealtimeServerEventResponseContentPartDonePart(_Model): + audio: Optional[str] + format: Optional[RealtimeAudioFormats] + text: Optional[str] + transcript: Optional[str] + type: Optional[Literal["audio", "text"]] @overload def __init__( self, *, - identity: Optional[Union[str, RoutineDispatchIdentity]] = ... + audio: Optional[str] = ..., + format: Optional[RealtimeAudioFormats] = ..., + text: Optional[str] = ..., + transcript: Optional[str] = ..., + type: Optional[Literal[audio, text]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RoutineDispatchIdentity(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENT = "agent" - CREATOR = "creator" - - - class azure.ai.projects.models.RoutineDispatchPayload(_Model): - type: str + class azure.ai.projects.models.RealtimeServerEventResponseCreated(RealtimeServerEvent, discriminator='response.created'): + event_id: str + response: VoiceAgentRealtimeResponse + type: Literal[RealtimeServerEventType.RESPONSE_CREATED] @overload def __init__( self, *, - type: str + event_id: str, + response: VoiceAgentRealtimeResponse ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RoutineDispatchPayloadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - INVOKE_AGENT_INVOCATIONS_API = "invoke_agent_invocations_api" - INVOKE_AGENT_RESPONSES_API = "invoke_agent_responses_api" - - - class azure.ai.projects.models.RoutineRun(_Model): - action_correlation_id: Optional[str] - action_type: Optional[Union[str, RoutineActionType]] - agent_endpoint_id: Optional[str] - agent_id: Optional[str] - attempt_source: Optional[Union[str, RoutineAttemptSource]] - conversation_id: Optional[str] - dispatch_id: Optional[str] - ended_at: Optional[datetime] - error_message: Optional[str] - error_status_code: Optional[int] - error_type: Optional[str] - id: str - phase: Optional[Union[str, RoutineRunPhase]] - response_id: Optional[str] - scheduled_fire_at: Optional[datetime] - session_id: Optional[str] - started_at: Optional[datetime] - status: Optional[RoutineRunStatus] - task_id: Optional[str] - trigger_event_payload: Optional[dict[str, Any]] - trigger_name: Optional[str] - trigger_type: Optional[Union[str, RoutineTriggerType]] - triggered_at: Optional[datetime] + class azure.ai.projects.models.RealtimeServerEventResponseDone(RealtimeServerEvent, discriminator='response.done'): + event_id: str + response: VoiceAgentRealtimeResponse + type: Literal[RealtimeServerEventType.RESPONSE_DONE] @overload def __init__( self, *, - action_correlation_id: Optional[str] = ..., - action_type: Optional[Union[str, RoutineActionType]] = ..., - agent_endpoint_id: Optional[str] = ..., - agent_id: Optional[str] = ..., - attempt_source: Optional[Union[str, RoutineAttemptSource]] = ..., - conversation_id: Optional[str] = ..., - dispatch_id: Optional[str] = ..., - ended_at: Optional[datetime] = ..., - error_message: Optional[str] = ..., - error_status_code: Optional[int] = ..., - error_type: Optional[str] = ..., - phase: Optional[Union[str, RoutineRunPhase]] = ..., - response_id: Optional[str] = ..., - scheduled_fire_at: Optional[datetime] = ..., - session_id: Optional[str] = ..., - started_at: Optional[datetime] = ..., - status: Optional[RoutineRunStatus] = ..., - task_id: Optional[str] = ..., - trigger_event_payload: Optional[dict[str, Any]] = ..., - trigger_name: Optional[str] = ..., - trigger_type: Optional[Union[str, RoutineTriggerType]] = ..., - triggered_at: Optional[datetime] = ... + event_id: str, + response: VoiceAgentRealtimeResponse ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RoutineRunPhase(str, Enum, metaclass=CaseInsensitiveEnumMeta): - COMPLETED = "completed" - DISPATCHING = "dispatching" - FAILED = "failed" - QUEUED = "queued" - - - class azure.ai.projects.models.RoutineTrigger(_Model): - type: str + class azure.ai.projects.models.RealtimeServerEventResponseFunctionCallArgumentsDelta(RealtimeServerEvent, discriminator='response.function_call_arguments.delta'): + call_id: str + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA] @overload def __init__( self, *, - type: str + call_id: str, + delta: str, + event_id: str, + item_id: str, + output_index: int, + response_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RoutineTriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CUSTOM = "custom" - GITHUB_ISSUE = "github_issue" - SCHEDULE = "schedule" - TIMER = "timer" - - - class azure.ai.projects.models.RubricBasedEvaluatorDefinition(EvaluatorDefinition, discriminator='rubric'): - data_schema: dict[str, any] - dimensions: list[Dimension] - init_parameters: dict[str, any] - metrics: dict[str, EvaluatorMetric] - pass_threshold: Optional[float] - type: Literal[EvaluatorDefinitionType.RUBRIC] + class azure.ai.projects.models.RealtimeServerEventResponseFunctionCallArgumentsDone(RealtimeServerEvent, discriminator='response.function_call_arguments.done'): + arguments: str + call_id: str + event_id: str + item_id: str + name: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE] @overload def __init__( self, *, - data_schema: Optional[dict[str, Any]] = ..., - dimensions: list[Dimension], - init_parameters: Optional[dict[str, Any]] = ..., - metrics: Optional[dict[str, EvaluatorMetric]] = ..., - pass_threshold: Optional[float] = ... + arguments: str, + call_id: str, + event_id: str, + item_id: str, + name: str, + output_index: int, + response_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RubricGenerationInputQualityWarning(_Model): - code: Union[str, RubricGenerationInputQualityWarningCode] - message: str - severity: Union[str, RubricGenerationInputQualityWarningSeverity] - source: Union[str, RubricGenerationInputQualityWarningSource] - source_index: Optional[int] + class azure.ai.projects.models.RealtimeServerEventResponseMCPCallArgumentsDelta(RealtimeServerEvent, discriminator='response.mcp_call_arguments.delta'): + delta: str + event_id: str + item_id: str + obfuscation: Optional[str] + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA] @overload def __init__( self, *, - code: Union[str, RubricGenerationInputQualityWarningCode], - message: str, - severity: Union[str, RubricGenerationInputQualityWarningSeverity], - source: Union[str, RubricGenerationInputQualityWarningSource], - source_index: Optional[int] = ... + delta: str, + event_id: str, + item_id: str, + obfuscation: Optional[str] = ..., + output_index: int, + response_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RubricGenerationInputQualityWarningCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - EMPTY_AGENT_INSTRUCTIONS = "empty_agent_instructions" - EMPTY_DATASET_CONTENT = "empty_dataset_content" - EMPTY_PROMPT = "empty_prompt" - INSUFFICIENT_TOTAL_INPUT = "insufficient_total_input" - LOW_TRACE_COUNT = "low_trace_count" - SHORT_AGENT_INSTRUCTIONS = "short_agent_instructions" - SHORT_DATASET_CONTENT = "short_dataset_content" - SHORT_PROMPT = "short_prompt" - - - class azure.ai.projects.models.RubricGenerationInputQualityWarningSeverity(str, Enum, metaclass=CaseInsensitiveEnumMeta): - WARNING = "warning" - - - class azure.ai.projects.models.RubricGenerationInputQualityWarningSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENT = "agent" - AGGREGATE = "aggregate" - DATASET = "dataset" - PROMPT = "prompt" - - - class azure.ai.projects.models.SASCredentials(BaseCredentials, discriminator='SAS'): - sas_token: Optional[str] - type: Literal[CredentialType.SAS] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.SampleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - EVALUATION_RESULT_SAMPLE = "EvaluationResultSample" - - - class azure.ai.projects.models.Schedule(_Model): - description: Optional[str] - display_name: Optional[str] - enabled: bool - properties: Optional[dict[str, str]] - provisioning_status: Optional[Union[str, ScheduleProvisioningStatus]] - schedule_id: str - system_data: dict[str, str] - tags: Optional[dict[str, str]] - task: ScheduleTask - trigger: Trigger - - @overload - def __init__( - self, - *, - description: Optional[str] = ..., - display_name: Optional[str] = ..., - enabled: bool, - properties: Optional[dict[str, str]] = ..., - tags: Optional[dict[str, str]] = ..., - task: ScheduleTask, - trigger: Trigger - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.ScheduleProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CREATING = "Creating" - DELETING = "Deleting" - FAILED = "Failed" - SUCCEEDED = "Succeeded" - UPDATING = "Updating" - - - class azure.ai.projects.models.ScheduleRoutineTrigger(RoutineTrigger, discriminator='schedule'): - cron_expression: str - time_zone: str - type: Literal[RoutineTriggerType.SCHEDULE] + class azure.ai.projects.models.RealtimeServerEventResponseMCPCallArgumentsDone(RealtimeServerEvent, discriminator='response.mcp_call_arguments.done'): + arguments: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE] @overload def __init__( self, *, - cron_expression: str, - time_zone: str + arguments: str, + event_id: str, + item_id: str, + output_index: int, + response_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ScheduleRun(_Model): - error: Optional[str] - properties: dict[str, str] - run_id: str - schedule_id: str - success: bool - trigger_time: Optional[datetime] + class azure.ai.projects.models.RealtimeServerEventResponseMCPCallCompleted(RealtimeServerEvent, discriminator='response.mcp_call.completed'): + event_id: str + item_id: str + output_index: int + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED] @overload def __init__( self, *, - schedule_id: str, - trigger_time: Optional[datetime] = ... + event_id: str, + item_id: str, + output_index: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ScheduleTask(_Model): - configuration: Optional[dict[str, str]] - type: str + class azure.ai.projects.models.RealtimeServerEventResponseMCPCallFailed(RealtimeServerEvent, discriminator='response.mcp_call.failed'): + event_id: str + item_id: str + output_index: int + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED] @overload def __init__( self, *, - configuration: Optional[dict[str, str]] = ..., - type: str + event_id: str, + item_id: str, + output_index: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ScheduleTaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - EVALUATION = "Evaluation" - INSIGHT = "Insight" - - - class azure.ai.projects.models.SearchContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - IMAGE = "image" - TEXT = "text" - - - class azure.ai.projects.models.SearchContextSize(str, Enum, metaclass=CaseInsensitiveEnumMeta): - HIGH = "high" - LOW = "low" - MEDIUM = "medium" - - - class azure.ai.projects.models.SessionConfiguration(_Model): - idle_timeout_seconds: Optional[timedelta] + class azure.ai.projects.models.RealtimeServerEventResponseMCPCallInProgress(RealtimeServerEvent, discriminator='response.mcp_call.in_progress'): + event_id: str + item_id: str + output_index: int + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS] @overload def __init__( self, *, - idle_timeout_seconds: Optional[timedelta] = ... + event_id: str, + item_id: str, + output_index: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SessionDirectoryEntry(_Model): - is_directory: bool - modified_time: datetime - name: str - size: int + class azure.ai.projects.models.RealtimeServerEventResponseOutputItemAdded(RealtimeServerEvent, discriminator='response.output_item.added'): + event_id: str + item: RealtimeConversationItem + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED] @overload def __init__( self, *, - is_directory: bool, - modified_time: datetime, - name: str, - size: int + event_id: str, + item: RealtimeConversationItem, + output_index: int, + response_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SessionFileWriteResult(_Model): - bytes_written: int - path: str + class azure.ai.projects.models.RealtimeServerEventResponseOutputItemDone(RealtimeServerEvent, discriminator='response.output_item.done'): + event_id: str + item: RealtimeConversationItem + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE] @overload def __init__( self, *, - bytes_written: int, - path: str + event_id: str, + item: RealtimeConversationItem, + output_index: int, + response_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SessionLogEvent(_Model): - data: str - event: Union[str, SessionLogEventType] + class azure.ai.projects.models.RealtimeServerEventResponseTextDelta(RealtimeServerEvent, discriminator='response.output_text.delta'): + content_index: int + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA] @overload def __init__( self, *, - data: str, - event: Union[str, SessionLogEventType] + content_index: int, + delta: str, + event_id: str, + item_id: str, + output_index: int, + response_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SessionLogEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - LOG = "log" - - - class azure.ai.projects.models.SharepointGroundingToolParameters(_Model): - project_connections: Optional[list[ToolProjectConnection]] + class azure.ai.projects.models.RealtimeServerEventResponseTextDone(RealtimeServerEvent, discriminator='response.output_text.done'): + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + text: str + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE] @overload def __init__( self, *, - project_connections: Optional[list[ToolProjectConnection]] = ... + content_index: int, + event_id: str, + item_id: str, + output_index: int, + response_id: str, + text: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SharepointPreviewTool(Tool, discriminator='sharepoint_grounding_preview'): - sharepoint_grounding_preview: SharepointGroundingToolParameters - type: Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW] + class azure.ai.projects.models.RealtimeServerEventSessionCreated(RealtimeServerEvent, discriminator='session.created'): + conversation_id: Optional[str] + event_id: str + session: VoiceAgentSessionResponseConfig + type: Literal[RealtimeServerEventType.SESSION_CREATED] @overload def __init__( self, *, - sharepoint_grounding_preview: SharepointGroundingToolParameters + conversation_id: Optional[str] = ..., + event_id: str, + session: VoiceAgentSessionResponseConfig ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ShellToolboxTool(ToolboxTool, discriminator='shell'): - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] - description: str - environment: ToolboxShellEnvironment - name: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.SHELL] + class azure.ai.projects.models.RealtimeServerEventSessionUpdated(RealtimeServerEvent, discriminator='session.updated'): + event_id: str + session: VoiceAgentSessionResponseConfig + type: Literal[RealtimeServerEventType.SESSION_UPDATED] @overload def __init__( self, *, - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., - description: Optional[str] = ..., - environment: ToolboxShellEnvironment, - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + event_id: str, + session: VoiceAgentSessionResponseConfig ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SimpleQnADataGenerationJobOptions(DataGenerationJobOptions, discriminator='simple_qna'): - max_samples: int - model_options: DataGenerationModelOptions - question_types: Optional[list[Union[str, SimpleQnAFineTuningQuestionType]]] - train_split: float - type: Literal[DataGenerationJobType.SIMPLE_QNA] - + class azure.ai.projects.models.RealtimeServerEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONVERSATION_CREATED = "conversation.created" + CONVERSATION_ITEM_ADDED = "conversation.item.added" + CONVERSATION_ITEM_CREATED = "conversation.item.created" + CONVERSATION_ITEM_DELETED = "conversation.item.deleted" + CONVERSATION_ITEM_DONE = "conversation.item.done" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED = "conversation.item.input_audio_transcription.completed" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA = "conversation.item.input_audio_transcription.delta" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED = "conversation.item.input_audio_transcription.failed" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT = "conversation.item.input_audio_transcription.segment" + CONVERSATION_ITEM_RETRIEVED = "conversation.item.retrieved" + CONVERSATION_ITEM_TRUNCATED = "conversation.item.truncated" + ERROR = "error" + INPUT_AUDIO_BUFFER_CLEARED = "input_audio_buffer.cleared" + INPUT_AUDIO_BUFFER_COMMITTED = "input_audio_buffer.committed" + INPUT_AUDIO_BUFFER_DTMF_EVENT_RECEIVED = "input_audio_buffer.dtmf_event_received" + INPUT_AUDIO_BUFFER_SPEECH_STARTED = "input_audio_buffer.speech_started" + INPUT_AUDIO_BUFFER_SPEECH_STOPPED = "input_audio_buffer.speech_stopped" + INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED = "input_audio_buffer.timeout_triggered" + MCP_LIST_TOOLS_COMPLETED = "mcp_list_tools.completed" + MCP_LIST_TOOLS_FAILED = "mcp_list_tools.failed" + MCP_LIST_TOOLS_IN_PROGRESS = "mcp_list_tools.in_progress" + OUTPUT_AUDIO_BUFFER_CLEARED = "output_audio_buffer.cleared" + OUTPUT_AUDIO_BUFFER_STARTED = "output_audio_buffer.started" + OUTPUT_AUDIO_BUFFER_STOPPED = "output_audio_buffer.stopped" + RATE_LIMITS_UPDATED = "rate_limits.updated" + RESPONSE_ANIMATION_BLENDSHAPES_DELTA = "response.animation_blendshapes.delta" + RESPONSE_ANIMATION_BLENDSHAPES_DONE = "response.animation_blendshapes.done" + RESPONSE_ANIMATION_VISEME_DELTA = "response.animation_viseme.delta" + RESPONSE_ANIMATION_VISEME_DONE = "response.animation_viseme.done" + RESPONSE_AUDIO_TIMESTAMP_DELTA = "response.audio_timestamp.delta" + RESPONSE_AUDIO_TIMESTAMP_DONE = "response.audio_timestamp.done" + RESPONSE_CONTENT_PART_ADDED = "response.content_part.added" + RESPONSE_CONTENT_PART_DONE = "response.content_part.done" + RESPONSE_CREATED = "response.created" + RESPONSE_DONE = "response.done" + RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA = "response.function_call_arguments.delta" + RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE = "response.function_call_arguments.done" + RESPONSE_MCP_CALL_ARGUMENTS_DELTA = "response.mcp_call_arguments.delta" + RESPONSE_MCP_CALL_ARGUMENTS_DONE = "response.mcp_call_arguments.done" + RESPONSE_MCP_CALL_COMPLETED = "response.mcp_call.completed" + RESPONSE_MCP_CALL_FAILED = "response.mcp_call.failed" + RESPONSE_MCP_CALL_IN_PROGRESS = "response.mcp_call.in_progress" + RESPONSE_OUTPUT_AUDIO_DELTA = "response.output_audio.delta" + RESPONSE_OUTPUT_AUDIO_DONE = "response.output_audio.done" + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA = "response.output_audio_transcript.delta" + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE = "response.output_audio_transcript.done" + RESPONSE_OUTPUT_ITEM_ADDED = "response.output_item.added" + RESPONSE_OUTPUT_ITEM_DONE = "response.output_item.done" + RESPONSE_OUTPUT_TEXT_DELTA = "response.output_text.delta" + RESPONSE_OUTPUT_TEXT_DONE = "response.output_text.done" + RESPONSE_VIDEO_DELTA = "response.video.delta" + RTC_CALL_ERROR = "rtc.call.error" + RTC_CALL_SDP_CREATED = "rtc.call.sdp.created" + SESSION_AVATAR_CONNECTING = "session.avatar.connecting" + SESSION_AVATAR_SWITCH_TO_IDLE = "session.avatar.switch_to_idle" + SESSION_AVATAR_SWITCH_TO_SPEAKING = "session.avatar.switch_to_speaking" + SESSION_CREATED = "session.created" + SESSION_SUBAGENT_ABORTED = "session.subagent.aborted" + SESSION_SUBAGENT_COMPLETED = "session.subagent.completed" + SESSION_SUBAGENT_STARTED = "session.subagent.started" + SESSION_UPDATED = "session.updated" + WARNING = "warning" + + + class azure.ai.projects.models.Reasoning(_Model): + context: Optional[Literal["auto", "current_turn", "all_turns"]] + effort: Optional[Union[str, ReasoningEffort]] + generate_summary: Optional[Literal["auto", "concise", "detailed"]] + mode: Optional[Union[str, ReasoningModeEnum]] + summary: Optional[Literal["auto", "concise", "detailed"]] + @overload def __init__( self, *, - max_samples: int, - model_options: Optional[DataGenerationModelOptions] = ..., - question_types: Optional[list[Union[str, SimpleQnAFineTuningQuestionType]]] = ..., - train_split: Optional[float] = ... + context: Optional[Literal[auto, current_turn, all_turns]] = ..., + effort: Optional[Union[str, ReasoningEffort]] = ..., + generate_summary: Optional[Literal[auto, concise, detailed]] = ..., + mode: Optional[Union[str, ReasoningModeEnum]] = ..., + summary: Optional[Literal[auto, concise, detailed]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SimpleQnAFineTuningQuestionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - LONG_ANSWER = "long_answer" - SHORT_ANSWER = "short_answer" + class azure.ai.projects.models.ReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HIGH = "high" + LOW = "low" + MAX = "max" + MEDIUM = "medium" + MINIMAL = "minimal" + NONE = "none" + XHIGH = "xhigh" - class azure.ai.projects.models.SimulationSeedDataGenerationJobOptions(DataGenerationJobOptions, discriminator='simulation_seed'): - max_samples: int - model_options: DataGenerationModelOptions - train_split: float - type: Literal[DataGenerationJobType.SIMULATION_SEED] + class azure.ai.projects.models.ReasoningModeEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PRO = "pro" + STANDARD = "standard" + + + class azure.ai.projects.models.RecurrenceSchedule(_Model): + type: str @overload def __init__( self, *, - max_samples: int, - model_options: Optional[DataGenerationModelOptions] = ..., - train_split: Optional[float] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SkillDetails(_Model): - created_at: datetime - default_version: str - description: str - id: str - latest_version: str - name: str + class azure.ai.projects.models.RecurrenceTrigger(Trigger, discriminator='Recurrence'): + end_time: Optional[datetime] + interval: int + schedule: RecurrenceSchedule + start_time: Optional[datetime] + time_zone: Optional[str] + type: Literal[TriggerType.RECURRENCE] @overload def __init__( self, *, - created_at: datetime, - default_version: str, - description: str, - id: str, - latest_version: str, - name: str + end_time: Optional[datetime] = ..., + interval: int, + schedule: RecurrenceSchedule, + start_time: Optional[datetime] = ..., + time_zone: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SkillInlineContent(_Model): - allowed_tools: Optional[list[str]] - compatibility: Optional[str] - description: str - instructions: str - license: Optional[str] - metadata: Optional[dict[str, str]] + class azure.ai.projects.models.RecurrenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DAILY = "Daily" + HOURLY = "Hourly" + MONTHLY = "Monthly" + WEEKLY = "Weekly" + + + class azure.ai.projects.models.RedTeam(_Model): + application_scenario: Optional[str] + attack_strategies: Optional[list[Union[str, AttackStrategy]]] + display_name: Optional[str] + name: str + num_turns: Optional[int] + properties: Optional[dict[str, str]] + risk_categories: Optional[list[Union[str, RiskCategory]]] + simulation_only: Optional[bool] + status: Optional[str] + tags: Optional[dict[str, str]] + target: RedTeamTargetConfig @overload def __init__( self, *, - allowed_tools: Optional[list[str]] = ..., - compatibility: Optional[str] = ..., - description: str, - instructions: str, - license: Optional[str] = ..., - metadata: Optional[dict[str, str]] = ... + application_scenario: Optional[str] = ..., + attack_strategies: Optional[list[Union[str, AttackStrategy]]] = ..., + display_name: Optional[str] = ..., + num_turns: Optional[int] = ..., + properties: Optional[dict[str, str]] = ..., + risk_categories: Optional[list[Union[str, RiskCategory]]] = ..., + simulation_only: Optional[bool] = ..., + tags: Optional[dict[str, str]] = ..., + target: RedTeamTargetConfig ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SkillReferenceParam(ContainerSkill, discriminator='skill_reference'): - skill_id: str - type: Literal[ContainerSkillType.SKILL_REFERENCE] - version: Optional[str] + class azure.ai.projects.models.RedTeamEvalRunDataSource(TypedDict, total=False): + key "item_generation_params": Required[Any] + key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] + key "type": Required[Literal["azure_ai_red_team"]] + + + class azure.ai.projects.models.RedTeamTargetConfig(_Model): + type: str @overload def __init__( self, *, - skill_id: str, - version: Optional[str] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.SkillVersion(_Model): - created_at: datetime + class azure.ai.projects.models.ReminderPreviewToolboxTool(ToolboxTool, discriminator='reminder_preview'): description: str - id: str name: str - skill_id: str - version: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.REMINDER_PREVIEW] @overload def __init__( self, *, - created_at: datetime, - description: str, - id: str, - name: str, - skill_id: str, - version: str + 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.SpecificApplyPatchParam(ToolChoiceParam, discriminator='apply_patch'): - type: Literal[ToolChoiceParamType.APPLY_PATCH] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.SpecificFunctionShellParam(ToolChoiceParam, discriminator='shell'): - type: Literal[ToolChoiceParamType.SHELL] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.ResponseRetrievalItemGenerationParams(TypedDict, total=False): + key "data_mapping": Required[Dict[str, str]] + key "max_num_turns": int + key "source": Required[Union[SourceFileContent, SourceFileID]] + key "type": Required[Literal["response_retrieval"]] - class azure.ai.projects.models.SpecificProgrammaticToolCallingParam(ToolChoiceParam, discriminator='programmatic_tool_calling'): - type: Literal[ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING] + class azure.ai.projects.models.ResponseUsageInputTokensDetails(_Model): + cache_write_tokens: int + cached_tokens: int @overload - def __init__(self) -> None: ... + 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.StructuredInputDefinition(_Model): - default_value: Optional[Any] - description: Optional[str] - required: Optional[bool] - schema: Optional[dict[str, Any]] + class azure.ai.projects.models.ResponseUsageOutputTokensDetails(_Model): + reasoning_tokens: int @overload def __init__( self, *, - default_value: Optional[Any] = ..., - description: Optional[str] = ..., - required: Optional[bool] = ..., - schema: Optional[dict[str, Any]] = ... + reasoning_tokens: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.StructuredOutputDefinition(_Model): - description: str - name: str - schema: dict[str, Any] - strict: bool + class azure.ai.projects.models.ResponsesProtocolConfiguration(_Model): - @overload - def __init__( - self, - *, - description: str, - name: str, - schema: dict[str, Any], - strict: bool - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.TargetCompletionEvalRunDataSource(TypedDict, total=False): - key "input_messages": Required[InputMessagesItemReference] - key "source": Required[Union[SourceFileContent, SourceFileID]] - key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] - key "type": Required[Literal["azure_ai_target_completions"]] - - - class azure.ai.projects.models.TaxonomyCategory(_Model): - description: Optional[str] - id: str - name: str - properties: Optional[dict[str, str]] - risk_category: Union[str, RiskCategory] - sub_categories: list[TaxonomySubCategory] - - @overload - def __init__( - self, - *, - description: Optional[str] = ..., - id: str, - name: str, - properties: Optional[dict[str, str]] = ..., - risk_category: Union[str, RiskCategory], - sub_categories: list[TaxonomySubCategory] - ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.RiskCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CODE_VULNERABILITY = "CodeVulnerability" + HATE_UNFAIRNESS = "HateUnfairness" + PROHIBITED_ACTIONS = "ProhibitedActions" + PROTECTED_MATERIAL = "ProtectedMaterial" + SELF_HARM = "SelfHarm" + SENSITIVE_DATA_LEAKAGE = "SensitiveDataLeakage" + SEXUAL = "Sexual" + TASK_ADHERENCE = "TaskAdherence" + UNGROUNDED_ATTRIBUTES = "UngroundedAttributes" + VIOLENCE = "Violence" - class azure.ai.projects.models.TaxonomySubCategory(_Model): + class azure.ai.projects.models.Routine(_Model): + action: Optional[RoutineAction] + created_at: Optional[datetime] description: Optional[str] enabled: bool - id: str - name: str - properties: Optional[dict[str, str]] + name: Optional[str] + triggers: Optional[dict[str, RoutineTrigger]] + updated_at: Optional[datetime] @overload def __init__( self, *, + action: Optional[RoutineAction] = ..., + created_at: Optional[datetime] = ..., description: Optional[str] = ..., enabled: bool, - id: str, - name: str, - properties: Optional[dict[str, str]] = ... + name: Optional[str] = ..., + triggers: Optional[dict[str, RoutineTrigger]] = ..., + updated_at: Optional[datetime] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelemetryConfig(_Model): - endpoints: list[TelemetryEndpoint] + class azure.ai.projects.models.RoutineAction(_Model): + type: str @overload def __init__( self, *, - endpoints: list[TelemetryEndpoint] + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelemetryDataKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CONTAINER_OTEL = "ContainerOtel" - CONTAINER_STDOUT_STDERR = "ContainerStdoutStderr" - METRICS = "Metrics" + class azure.ai.projects.models.RoutineActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INVOKE_AGENT_INVOCATIONS_API = "invoke_agent_invocations_api" + INVOKE_AGENT_RESPONSES_API = "invoke_agent_responses_api" - class azure.ai.projects.models.TelemetryEndpoint(_Model): - auth: Optional[TelemetryEndpointAuth] - data: list[Union[str, TelemetryDataKind]] - kind: str + class azure.ai.projects.models.RoutineAttemptSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EVENT_FIRE = "event_fire" + MANUAL_DISPATCH = "manual_dispatch" + QUEUED_DISPATCH = "queued_dispatch" + SCHEDULE_DELIVERY = "schedule_delivery" + TIMER_DELIVERY = "timer_delivery" + + + class azure.ai.projects.models.RoutineAuthorization(_Model): + identity: Optional[Union[str, RoutineDispatchIdentity]] @overload def __init__( self, *, - auth: Optional[TelemetryEndpointAuth] = ..., - data: list[Union[str, TelemetryDataKind]], - kind: str + identity: Optional[Union[str, RoutineDispatchIdentity]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelemetryEndpointAuth(_Model): + class azure.ai.projects.models.RoutineDispatchIdentity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT = "agent" + CREATOR = "creator" + + + class azure.ai.projects.models.RoutineDispatchPayload(_Model): type: str @overload @@ -11516,157 +11465,166 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TelemetryEndpointAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - HEADER = "header" - - - class azure.ai.projects.models.TelemetryEndpointKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - OTLP = "OTLP" - - - class azure.ai.projects.models.TelemetryTransportProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - GRPC = "Grpc" - HTTP = "Http" - - - class azure.ai.projects.models.TestingCriterionAzureAIEvaluator(TypedDict, total=False): - key "data_mapping": Dict[str, str] - key "evaluator_name": Required[str] - key "evaluator_version": str - key "initialization_parameters": Dict[str, Any] - key "name": Required[str] - key "type": Required[Literal["azure_ai_evaluator"]] + class azure.ai.projects.models.RoutineDispatchPayloadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INVOKE_AGENT_INVOCATIONS_API = "invoke_agent_invocations_api" + INVOKE_AGENT_RESPONSES_API = "invoke_agent_responses_api" - class azure.ai.projects.models.TextResponseFormat(_Model): - type: str + class azure.ai.projects.models.RoutineRun(_Model): + action_correlation_id: Optional[str] + action_type: Optional[Union[str, RoutineActionType]] + agent_endpoint_id: Optional[str] + agent_id: Optional[str] + attempt_source: Optional[Union[str, RoutineAttemptSource]] + conversation_id: Optional[str] + dispatch_id: Optional[str] + ended_at: Optional[datetime] + error_message: Optional[str] + error_status_code: Optional[int] + error_type: Optional[str] + id: str + phase: Optional[Union[str, RoutineRunPhase]] + response_id: Optional[str] + scheduled_fire_at: Optional[datetime] + session_id: Optional[str] + started_at: Optional[datetime] + status: Optional[RoutineRunStatus] + task_id: Optional[str] + trigger_event_payload: Optional[dict[str, Any]] + trigger_name: Optional[str] + trigger_type: Optional[Union[str, RoutineTriggerType]] + triggered_at: Optional[datetime] @overload def __init__( self, *, - type: str + action_correlation_id: Optional[str] = ..., + action_type: Optional[Union[str, RoutineActionType]] = ..., + agent_endpoint_id: Optional[str] = ..., + agent_id: Optional[str] = ..., + attempt_source: Optional[Union[str, RoutineAttemptSource]] = ..., + conversation_id: Optional[str] = ..., + dispatch_id: Optional[str] = ..., + ended_at: Optional[datetime] = ..., + error_message: Optional[str] = ..., + error_status_code: Optional[int] = ..., + error_type: Optional[str] = ..., + phase: Optional[Union[str, RoutineRunPhase]] = ..., + response_id: Optional[str] = ..., + scheduled_fire_at: Optional[datetime] = ..., + session_id: Optional[str] = ..., + started_at: Optional[datetime] = ..., + status: Optional[RoutineRunStatus] = ..., + task_id: Optional[str] = ..., + trigger_event_payload: Optional[dict[str, Any]] = ..., + trigger_name: Optional[str] = ..., + trigger_type: Optional[Union[str, RoutineTriggerType]] = ..., + triggered_at: Optional[datetime] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TextResponseFormatConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - JSON_OBJECT = "json_object" - JSON_SCHEMA = "json_schema" - TEXT = "text" - - - class azure.ai.projects.models.TextResponseFormatJsonObject(TextResponseFormat, discriminator='json_object'): - type: Literal[TextResponseFormatConfigurationType.JSON_OBJECT] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.RoutineRunPhase(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMPLETED = "completed" + DISPATCHING = "dispatching" + FAILED = "failed" + QUEUED = "queued" - class azure.ai.projects.models.TextResponseFormatJsonSchema(TextResponseFormat, discriminator='json_schema'): - description: Optional[str] - name: str - schema: dict[str, Any] - strict: Optional[bool] - type: Literal[TextResponseFormatConfigurationType.JSON_SCHEMA] + class azure.ai.projects.models.RoutineTrigger(_Model): + type: str @overload def __init__( self, *, - description: Optional[str] = ..., - name: str, - schema: dict[str, Any], - strict: Optional[bool] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TextResponseFormatText(TextResponseFormat, discriminator='text'): - type: Literal[TextResponseFormatConfigurationType.TEXT] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.RoutineTriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CUSTOM = "custom" + GITHUB_ISSUE = "github_issue" + SCHEDULE = "schedule" + TIMER = "timer" - class azure.ai.projects.models.TimerRoutineTrigger(RoutineTrigger, discriminator='timer'): - at: Optional[datetime] - type: Literal[RoutineTriggerType.TIMER] + class azure.ai.projects.models.RubricBasedEvaluatorDefinition(EvaluatorDefinition, discriminator='rubric'): + data_schema: dict[str, any] + dimensions: list[Dimension] + init_parameters: dict[str, any] + metrics: dict[str, EvaluatorMetric] + pass_threshold: Optional[float] + type: Literal[EvaluatorDefinitionType.RUBRIC] @overload def __init__( self, *, - at: Optional[datetime] = ... + data_schema: Optional[dict[str, Any]] = ..., + dimensions: list[Dimension], + init_parameters: Optional[dict[str, Any]] = ..., + metrics: Optional[dict[str, EvaluatorMetric]] = ..., + pass_threshold: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.Tool(_Model): - type: str + class azure.ai.projects.models.RubricGenerationInputQualityWarning(_Model): + code: Union[str, RubricGenerationInputQualityWarningCode] + message: str + severity: Union[str, RubricGenerationInputQualityWarningSeverity] + source: Union[str, RubricGenerationInputQualityWarningSource] + source_index: Optional[int] @overload def __init__( self, *, - type: str + code: Union[str, RubricGenerationInputQualityWarningCode], + message: str, + severity: Union[str, RubricGenerationInputQualityWarningSeverity], + source: Union[str, RubricGenerationInputQualityWarningSource], + source_index: Optional[int] = ... ) -> 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]] - type: Literal[ToolChoiceParamType.ALLOWED_TOOLS] - - @overload - def __init__( - self, - *, - mode: Literal["auto", "required"], - tools: list[dict[str, Any]] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.ToolChoiceCodeInterpreter(ToolChoiceParam, discriminator='code_interpreter'): - type: Literal[ToolChoiceParamType.CODE_INTERPRETER] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.RubricGenerationInputQualityWarningCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EMPTY_AGENT_INSTRUCTIONS = "empty_agent_instructions" + EMPTY_DATASET_CONTENT = "empty_dataset_content" + EMPTY_PROMPT = "empty_prompt" + INSUFFICIENT_TOTAL_INPUT = "insufficient_total_input" + LOW_TRACE_COUNT = "low_trace_count" + SHORT_AGENT_INSTRUCTIONS = "short_agent_instructions" + SHORT_DATASET_CONTENT = "short_dataset_content" + SHORT_PROMPT = "short_prompt" - class azure.ai.projects.models.ToolChoiceComputer(ToolChoiceParam, discriminator='computer'): - type: Literal[ToolChoiceParamType.COMPUTER] + class azure.ai.projects.models.RubricGenerationInputQualityWarningSeverity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + WARNING = "warning" - @overload - def __init__(self) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.RubricGenerationInputQualityWarningSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT = "agent" + AGGREGATE = "aggregate" + DATASET = "dataset" + PROMPT = "prompt" - class azure.ai.projects.models.ToolChoiceComputerUse(ToolChoiceParam, discriminator='computer_use'): - type: Literal[ToolChoiceParamType.COMPUTER_USE] + class azure.ai.projects.models.SASCredentials(BaseCredentials, discriminator='SAS'): + sas_token: Optional[str] + type: Literal[CredentialType.SAS] @overload def __init__(self) -> None: ... @@ -11675,96 +11633,93 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceComputerUsePreview(ToolChoiceParam, discriminator='computer_use_preview'): - type: Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.SampleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EVALUATION_RESULT_SAMPLE = "EvaluationResultSample" - class azure.ai.projects.models.ToolChoiceCustom(ToolChoiceParam, discriminator='custom'): - name: str - type: Literal[ToolChoiceParamType.CUSTOM] + class azure.ai.projects.models.Schedule(_Model): + description: Optional[str] + display_name: Optional[str] + enabled: bool + properties: Optional[dict[str, str]] + provisioning_status: Optional[Union[str, ScheduleProvisioningStatus]] + schedule_id: str + system_data: dict[str, str] + tags: Optional[dict[str, str]] + task: ScheduleTask + trigger: Trigger @overload def __init__( self, *, - name: str + description: Optional[str] = ..., + display_name: Optional[str] = ..., + enabled: bool, + properties: Optional[dict[str, str]] = ..., + tags: Optional[dict[str, str]] = ..., + task: ScheduleTask, + trigger: Trigger ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceFileSearch(ToolChoiceParam, discriminator='file_search'): - type: Literal[ToolChoiceParamType.FILE_SEARCH] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.ScheduleProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + UPDATING = "Updating" - class azure.ai.projects.models.ToolChoiceFunction(ToolChoiceParam, discriminator='function'): - name: str - type: Literal[ToolChoiceParamType.FUNCTION] + class azure.ai.projects.models.ScheduleRoutineTrigger(RoutineTrigger, discriminator='schedule'): + cron_expression: str + time_zone: str + type: Literal[RoutineTriggerType.SCHEDULE] @overload def __init__( self, *, - name: str + cron_expression: str, + time_zone: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceImageGeneration(ToolChoiceParam, discriminator='image_generation'): - type: Literal[ToolChoiceParamType.IMAGE_GENERATION] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.ToolChoiceMCP(ToolChoiceParam, discriminator='mcp'): - name: Optional[str] - server_label: str - type: Literal[ToolChoiceParamType.MCP] + class azure.ai.projects.models.ScheduleRun(_Model): + error: Optional[str] + properties: dict[str, str] + run_id: str + schedule_id: str + success: bool + trigger_time: Optional[datetime] @overload def __init__( self, *, - name: Optional[str] = ..., - server_label: str + schedule_id: str, + trigger_time: Optional[datetime] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceOptions(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AUTO = "auto" - NONE = "none" - REQUIRED = "required" - - - class azure.ai.projects.models.ToolChoiceParam(_Model): + class azure.ai.projects.models.ScheduleTask(_Model): + configuration: Optional[dict[str, str]] type: str @overload def __init__( self, *, + configuration: Optional[dict[str, str]] = ..., type: str ) -> None: ... @@ -11772,130 +11727,136 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ALLOWED_TOOLS = "allowed_tools" - APPLY_PATCH = "apply_patch" - CODE_INTERPRETER = "code_interpreter" - COMPUTER = "computer" - COMPUTER_USE = "computer_use" - COMPUTER_USE_PREVIEW = "computer_use_preview" - CUSTOM = "custom" - FILE_SEARCH = "file_search" - FUNCTION = "function" - IMAGE_GENERATION = "image_generation" - MCP = "mcp" - PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" - SHELL = "shell" - WEB_SEARCH_PREVIEW = "web_search_preview" - WEB_SEARCH_PREVIEW_2025_03_11 = "web_search_preview_2025_03_11" + class azure.ai.projects.models.ScheduleTaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EVALUATION = "Evaluation" + INSIGHT = "Insight" - class azure.ai.projects.models.ToolChoiceWebSearchPreview(ToolChoiceParam, discriminator='web_search_preview'): - type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW] + class azure.ai.projects.models.SearchContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + IMAGE = "image" + TEXT = "text" + + + class azure.ai.projects.models.SearchContextSize(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HIGH = "high" + LOW = "low" + MEDIUM = "medium" + + + class azure.ai.projects.models.SessionConfiguration(_Model): + idle_timeout_seconds: Optional[timedelta] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + idle_timeout_seconds: Optional[timedelta] = ... + ) -> None: ... @overload 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.SessionDirectoryEntry(_Model): + is_directory: bool + modified_time: datetime + name: str + size: int @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + is_directory: bool, + modified_time: datetime, + name: str, + size: int + ) -> 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.SessionFileWriteResult(_Model): + bytes_written: int + path: str @overload def __init__( self, *, - additional_search_text: Optional[str] = ..., - pin: Optional[bool] = ... + bytes_written: int, + path: str ) -> 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.SessionLogEvent(_Model): + data: str + event: Union[str, SessionLogEventType] @overload def __init__( self, *, - description: Optional[str] = ..., - name: Optional[str] = ... + data: str, + event: Union[str, SessionLogEventType] ) -> 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.SessionLogEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LOG = "log" - class azure.ai.projects.models.ToolProjectConnection(_Model): - project_connection_id: str + class azure.ai.projects.models.SharepointGroundingToolParameters(_Model): + project_connections: Optional[list[ToolProjectConnection]] @overload def __init__( self, *, - project_connection_id: str + project_connections: Optional[list[ToolProjectConnection]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolSearchExecutionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CLIENT = "client" - 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.SharepointPreviewTool(Tool, discriminator='sharepoint_grounding_preview'): + sharepoint_grounding_preview: SharepointGroundingToolParameters + type: Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW] @overload def __init__( self, *, - description: Optional[str] = ..., - execution: Optional[Union[str, ToolSearchExecutionType]] = ..., - parameters: Optional[EmptyModelParam] = ... + sharepoint_grounding_preview: SharepointGroundingToolParameters ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolSearchToolboxTool(ToolboxTool, discriminator='toolbox_search'): + class azure.ai.projects.models.ShellToolboxTool(ToolboxTool, discriminator='shell'): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] description: str + environment: ToolboxShellEnvironment name: str tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.TOOLBOX_SEARCH] + type: Literal[ToolboxToolType.SHELL] @overload def __init__( self, *, + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., description: Optional[str] = ..., + environment: ToolboxShellEnvironment, name: Optional[str] = ..., tool_configs: Optional[dict[str, ToolConfig]] = ... ) -> None: ... @@ -11904,46 +11865,12 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - A2A_PREVIEW = "a2a_preview" - A2_A = "a2a" - APPLY_PATCH = "apply_patch" - AZURE_AI_SEARCH = "azure_ai_search" - AZURE_FUNCTION = "azure_function" - BING_CUSTOM_SEARCH_PREVIEW = "bing_custom_search_preview" - BING_GROUNDING = "bing_grounding" - BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" - CAPTURE_STRUCTURED_OUTPUTS = "capture_structured_outputs" - CODE_INTERPRETER = "code_interpreter" - COMPUTER = "computer" - COMPUTER_USE_PREVIEW = "computer_use_preview" - CUSTOM = "custom" - FABRIC_DATAAGENT_PREVIEW = "fabric_dataagent_preview" - FABRIC_IQ_PREVIEW = "fabric_iq_preview" - FILE_SEARCH = "file_search" - FUNCTION = "function" - IMAGE_GENERATION = "image_generation" - LOCAL_SHELL = "local_shell" - MCP = "mcp" - MEMORY_SEARCH_PREVIEW = "memory_search_preview" - NAMESPACE = "namespace" - OPENAPI = "openapi" - PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" - SHAREPOINT_GROUNDING_PREVIEW = "sharepoint_grounding_preview" - SHELL = "shell" - TOOLBOX_SEARCH_PREVIEW = "toolbox_search_preview" - TOOL_SEARCH = "tool_search" - WEB_IQ_PREVIEW = "web_iq_preview" - WEB_SEARCH = "web_search" - WEB_SEARCH_PREVIEW = "web_search_preview" - WORK_IQ_PREVIEW = "work_iq_preview" - - - class azure.ai.projects.models.ToolUseFineTuningDataGenerationJobOptions(DataGenerationJobOptions, discriminator='tool_use'): + class azure.ai.projects.models.SimpleQnADataGenerationJobOptions(DataGenerationJobOptions, discriminator='simple_qna'): max_samples: int model_options: DataGenerationModelOptions + question_types: Optional[list[Union[str, SimpleQnAFineTuningQuestionType]]] train_split: float - type: Literal[DataGenerationJobType.TOOL_USE] + type: Literal[DataGenerationJobType.SIMPLE_QNA] @overload def __init__( @@ -11951,6 +11878,7 @@ namespace azure.ai.projects.models *, max_samples: int, model_options: Optional[DataGenerationModelOptions] = ..., + question_types: Optional[list[Union[str, SimpleQnAFineTuningQuestionType]]] = ..., train_split: Optional[float] = ... ) -> None: ... @@ -11958,123 +11886,146 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxObject(_Model): - default_version: str - id: str - name: str + class azure.ai.projects.models.SimpleQnAFineTuningQuestionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LONG_ANSWER = "long_answer" + SHORT_ANSWER = "short_answer" + + + class azure.ai.projects.models.SimulationSeedDataGenerationJobOptions(DataGenerationJobOptions, discriminator='simulation_seed'): + max_samples: int + model_options: DataGenerationModelOptions + train_split: float + type: Literal[DataGenerationJobType.SIMULATION_SEED] @overload def __init__( self, *, - default_version: str, - id: str, - name: str + max_samples: int, + model_options: Optional[DataGenerationModelOptions] = ..., + train_split: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxPolicies(_Model): - rai_config: Optional[RaiConfig] + class azure.ai.projects.models.SipTelephonyTransferDestination(TelephonyTransferDestination, discriminator='sip'): + kind: Literal[TelephonyTransferDestinationKind.SIP] + value: str @overload def __init__( self, *, - rai_config: Optional[RaiConfig] = ... + value: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxSearchPreviewToolboxTool(ToolboxTool, discriminator='toolbox_search_preview'): + class azure.ai.projects.models.SkillDetails(_Model): + created_at: datetime + default_version: str description: str + id: str + latest_version: str name: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW] @overload def __init__( self, *, - description: Optional[str] = ..., - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + created_at: datetime, + default_version: str, + description: str, + id: str, + latest_version: str, + name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxShellContainerAutoEnvironment(ToolboxShellEnvironment, discriminator='container_auto'): - file_ids: Optional[list[str]] - memory_limit: Optional[Union[str, ContainerMemoryLimit]] - network_policy: Optional[ToolboxShellNetworkPolicy] - skills: Optional[list[ContainerSkill]] - type: Literal["container_auto"] + class azure.ai.projects.models.SkillInlineContent(_Model): + allowed_tools: Optional[list[str]] + compatibility: Optional[str] + description: str + instructions: str + license: Optional[str] + metadata: Optional[dict[str, str]] @overload def __init__( self, *, - file_ids: Optional[list[str]] = ..., - memory_limit: Optional[Union[str, ContainerMemoryLimit]] = ..., - network_policy: Optional[ToolboxShellNetworkPolicy] = ..., - skills: Optional[list[ContainerSkill]] = ... + allowed_tools: Optional[list[str]] = ..., + compatibility: Optional[str] = ..., + description: str, + instructions: str, + license: Optional[str] = ..., + metadata: Optional[dict[str, str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxShellContainerReferenceEnvironment(ToolboxShellEnvironment, discriminator='container_reference'): - container_id: str - type: Literal["container_reference"] + class azure.ai.projects.models.SkillReferenceParam(ContainerSkill, discriminator='skill_reference'): + skill_id: str + type: Literal[ContainerSkillType.SKILL_REFERENCE] + version: Optional[str] @overload def __init__( self, *, - container_id: str + skill_id: str, + version: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxShellEnvironment(_Model): - type: str + class azure.ai.projects.models.SkillVersion(_Model): + created_at: datetime + description: str + id: str + name: str + skill_id: str + version: str @overload def __init__( self, *, - type: str + created_at: datetime, + description: str, + id: str, + name: str, + skill_id: str, + version: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxShellNetworkPolicy(_Model): - type: str + class azure.ai.projects.models.SpecificApplyPatchParam(ToolChoiceParam, discriminator='apply_patch'): + type: Literal[ToolChoiceParamType.APPLY_PATCH] @overload - def __init__( - self, - *, - type: str - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxShellNetworkPolicyDisabled(ToolboxShellNetworkPolicy, discriminator='disabled'): - type: Literal["disabled"] + class azure.ai.projects.models.SpecificFunctionShellParam(ToolChoiceParam, discriminator='shell'): + type: Literal[ToolChoiceParamType.SHELL] @overload def __init__(self) -> None: ... @@ -12083,2730 +12034,4833 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxSkill(_Model): - type: str + class azure.ai.projects.models.SpecificProgrammaticToolCallingParam(ToolChoiceParam, discriminator='programmatic_tool_calling'): + type: Literal[ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.StructuredInputDefinition(_Model): + default_value: Optional[Any] + description: Optional[str] + required: Optional[bool] + schema: Optional[dict[str, Any]] @overload def __init__( self, *, - type: str + default_value: Optional[Any] = ..., + description: Optional[str] = ..., + required: Optional[bool] = ..., + schema: Optional[dict[str, Any]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxSkillReference(ToolboxSkill, discriminator='skill_reference'): + class azure.ai.projects.models.StructuredOutputDefinition(_Model): + description: str name: str - type: Literal["skill_reference"] - version: Optional[str] + schema: dict[str, Any] + strict: bool @overload def __init__( self, *, + description: str, name: str, - version: Optional[str] = ... + schema: dict[str, Any], + strict: bool ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxTool(_Model): + class azure.ai.projects.models.TargetCompletionEvalRunDataSource(TypedDict, total=False): + key "input_messages": Required[InputMessagesItemReference] + key "source": Required[Union[SourceFileContent, SourceFileID]] + key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] + key "type": Required[Literal["azure_ai_target_completions"]] + + + class azure.ai.projects.models.TaxonomyCategory(_Model): description: Optional[str] - name: Optional[str] - tool_configs: Optional[dict[str, ToolConfig]] - type: str + id: str + name: str + properties: Optional[dict[str, str]] + risk_category: Union[str, RiskCategory] + sub_categories: list[TaxonomySubCategory] @overload def __init__( self, *, description: Optional[str] = ..., - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ..., - type: str + id: str, + name: str, + properties: Optional[dict[str, str]] = ..., + risk_category: Union[str, RiskCategory], + sub_categories: list[TaxonomySubCategory] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolboxToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - A2A_PREVIEW = "a2a_preview" - A2_A = "a2a" - AZURE_AI_SEARCH = "azure_ai_search" - BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" - CODE_INTERPRETER = "code_interpreter" - FABRIC_IQ_PREVIEW = "fabric_iq_preview" - FILE_SEARCH = "file_search" - MCP = "mcp" - OPENAPI = "openapi" - REMINDER_PREVIEW = "reminder_preview" - SHELL = "shell" - TOOLBOX_SEARCH = "toolbox_search" - TOOLBOX_SEARCH_PREVIEW = "toolbox_search_preview" - WEB_IQ_PREVIEW = "web_iq_preview" - WEB_SEARCH = "web_search" - WORK_IQ_PREVIEW = "work_iq_preview" - - - class azure.ai.projects.models.ToolboxVersionObject(_Model): - created_at: datetime + class azure.ai.projects.models.TaxonomySubCategory(_Model): description: Optional[str] + enabled: bool id: str - metadata: dict[str, str] name: str - policies: Optional[ToolboxPolicies] - skills: Optional[list[ToolboxSkill]] - tools: list[ToolboxTool] - version: str + properties: Optional[dict[str, str]] @overload def __init__( self, *, - created_at: datetime, description: Optional[str] = ..., + enabled: bool, id: str, - metadata: dict[str, str], name: str, - policies: Optional[ToolboxPolicies] = ..., - skills: Optional[list[ToolboxSkill]] = ..., - tools: list[ToolboxTool], - version: str + properties: Optional[dict[str, str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TracesDataGenerationJobOptions(DataGenerationJobOptions, discriminator='traces'): - max_samples: int - model_options: DataGenerationModelOptions - redact_private_content: Optional[bool] - train_split: float - type: Literal[DataGenerationJobType.TRACES] + class azure.ai.projects.models.TeamsPhoneExtensionTelephonyBinding(TelephonyBinding, discriminator='teams_phone_extension'): + connection: str + id: str + incoming_call_url: str + label: str + phone_number: Optional[str] + provider: Literal[TelephonyProvider.TEAMS_PHONE_EXTENSION] + resource_account_object_id: str + status: Union[str, TelephonyBindingStatus] @overload def __init__( self, *, - max_samples: int, - model_options: Optional[DataGenerationModelOptions] = ..., - redact_private_content: Optional[bool] = ..., - train_split: Optional[float] = ... + connection: str, + id: str, + incoming_call_url: str, + label: Optional[str] = ..., + phone_number: Optional[str] = ..., + resource_account_object_id: str, + status: Union[str, TelephonyBindingStatus] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TracesDataGenerationJobSource(DataGenerationJobSource, discriminator='traces'): - agent_id: Optional[str] - agent_name: Optional[str] - agent_version: Optional[str] - description: str - end_time: Optional[datetime] - start_time: datetime - type: Literal[DataGenerationJobSourceType.TRACES] + class azure.ai.projects.models.TeamsPhoneExtensionTelephonyBindingListItem(TelephonyBindingListItem, discriminator='teams_phone_extension'): + connection: str + etag: str + id: str + incoming_call_url: str + label: str + phone_number: Optional[str] + provider: Literal[TelephonyProvider.TEAMS_PHONE_EXTENSION] + resource_account_object_id: str + status: Union[str, TelephonyBindingStatus] @overload def __init__( self, *, - agent_id: Optional[str] = ..., - agent_name: Optional[str] = ..., - agent_version: Optional[str] = ..., - description: Optional[str] = ..., - end_time: Optional[datetime] = ..., - start_time: datetime + connection: str, + id: str, + incoming_call_url: str, + label: Optional[str] = ..., + phone_number: Optional[str] = ..., + resource_account_object_id: str, + status: Union[str, TelephonyBindingStatus] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TracesEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator='traces'): - agent_id: Optional[str] - agent_name: Optional[str] - agent_version: Optional[str] - description: Optional[str] - end_time: Optional[datetime] - start_time: datetime - type: Literal[EvaluatorGenerationJobSourceType.TRACES] + class azure.ai.projects.models.TeamsTelephonyTransferDestination(TelephonyTransferDestination, discriminator='teams'): + kind: Literal[TelephonyTransferDestinationKind.TEAMS] + value: str @overload def __init__( self, *, - agent_id: Optional[str] = ..., - agent_name: Optional[str] = ..., - agent_version: Optional[str] = ..., - description: Optional[str] = ..., - end_time: Optional[datetime] = ..., - start_time: datetime + value: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TracesPreviewEvalRunDataSource(TypedDict, total=False): - key "agent_id": str - key "agent_name": str - key "end_time": datetime - key "ingestion_delay_seconds": int - key "lookback_hours": int - key "max_traces": int - key "trace_ids": List[str] - key "type": Required[Literal["azure_ai_traces_preview"]] - - - class azure.ai.projects.models.TranscriptTextUsageDuration(CreateTranscriptionResponseJsonUsage, discriminator='duration'): - seconds: timedelta - type: Literal[CreateTranscriptionResponseJsonUsageType.DURATION] + class azure.ai.projects.models.TelemetryConfig(_Model): + endpoints: list[TelemetryEndpoint] @overload def __init__( self, *, - seconds: timedelta + endpoints: list[TelemetryEndpoint] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TranscriptTextUsageTokens(CreateTranscriptionResponseJsonUsage, discriminator='tokens'): - input_token_details: Optional[TranscriptTextUsageTokensInputTokenDetails] - input_tokens: int - output_tokens: int - total_tokens: int - type: Literal[CreateTranscriptionResponseJsonUsageType.TOKENS] + class azure.ai.projects.models.TelemetryDataKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONTAINER_OTEL = "ContainerOtel" + CONTAINER_STDOUT_STDERR = "ContainerStdoutStderr" + METRICS = "Metrics" + + + class azure.ai.projects.models.TelemetryEndpoint(_Model): + auth: Optional[TelemetryEndpointAuth] + data: list[Union[str, TelemetryDataKind]] + kind: str @overload def __init__( self, *, - input_token_details: Optional[TranscriptTextUsageTokensInputTokenDetails] = ..., - input_tokens: int, - output_tokens: int, - total_tokens: int + auth: Optional[TelemetryEndpointAuth] = ..., + data: list[Union[str, TelemetryDataKind]], + kind: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TranscriptTextUsageTokensInputTokenDetails(_Model): - audio_tokens: Optional[int] - text_tokens: Optional[int] + class azure.ai.projects.models.TelemetryEndpointAuth(_Model): + type: str @overload def __init__( self, *, - audio_tokens: Optional[int] = ..., - text_tokens: Optional[int] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TranscriptionLanguage(_Model): - code: str + class azure.ai.projects.models.TelemetryEndpointAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HEADER = "header" + + + class azure.ai.projects.models.TelemetryEndpointKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + OTLP = "OTLP" + + + class azure.ai.projects.models.TelemetryTransportProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + GRPC = "Grpc" + HTTP = "Http" + + + class azure.ai.projects.models.TelephonyBinding(_Model): + connection: str + id: str + incoming_call_url: str + label: Optional[str] + provider: str + status: Union[str, TelephonyBindingStatus] @overload def __init__( self, *, - code: str + connection: str, + id: str, + incoming_call_url: str, + label: Optional[str] = ..., + provider: str, + status: Union[str, TelephonyBindingStatus] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TreatmentEffectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CHANGED = "Changed" - DEGRADED = "Degraded" - IMPROVED = "Improved" - INCONCLUSIVE = "Inconclusive" - TOO_FEW_SAMPLES = "TooFewSamples" - - - class azure.ai.projects.models.Trigger(_Model): - type: str + class azure.ai.projects.models.TelephonyBindingListItem(_Model): + connection: str + etag: str + id: str + incoming_call_url: str + label: Optional[str] + provider: str + status: Union[str, TelephonyBindingStatus] @overload def __init__( self, *, - type: str + connection: str, + id: str, + incoming_call_url: str, + label: Optional[str] = ..., + provider: str, + status: Union[str, TelephonyBindingStatus] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.TriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CRON = "Cron" - ONE_TIME = "OneTime" - RECURRENCE = "Recurrence" - + class azure.ai.projects.models.TelephonyBindingStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACTIVE = "active" + SUSPENDED = "suspended" - class azure.ai.projects.models.UpdateMemoriesLROPoller(LROPoller[MemoryStoreUpdateCompletedResult]): - property superseded_by: Optional[str] # Read-only - property update_id: str # Read-only - @classmethod - def from_continuation_token( - cls, - polling_method: PollingMethod[MemoryStoreUpdateCompletedResult], - continuation_token: str, - **kwargs: Any - ) -> UpdateMemoriesLROPoller: ... + class azure.ai.projects.models.TelephonyCallDurationBasis(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ANSWERED = "answered" + RECEIVED = "received" - class azure.ai.projects.models.UpdateModelVersionRequest(_Model): - description: Optional[str] - tags: Optional[dict[str, str]] + class azure.ai.projects.models.TelephonyCallLifecycleEvent(_Model): + name: Union[str, TelephonyCallLifecycleEventName] + observed_at: datetime + occurred_at: Optional[datetime] + outcome: Union[str, TelephonyCallLifecycleEventOutcome] + provider_event_id: Optional[str] + provider_sequence: Optional[int] + provider_status_code: Optional[int] + provider_sub_code: Optional[int] + reason: Optional[str] + sequence: int + source: Union[str, TelephonyCallLifecycleEventSource] + timestamp_source: Union[str, TelephonyCallTimestampSource] @overload def __init__( self, *, - description: Optional[str] = ..., - tags: Optional[dict[str, str]] = ... + name: Union[str, TelephonyCallLifecycleEventName], + observed_at: datetime, + occurred_at: Optional[datetime] = ..., + outcome: Union[str, TelephonyCallLifecycleEventOutcome], + provider_event_id: Optional[str] = ..., + provider_sequence: Optional[int] = ..., + provider_status_code: Optional[int] = ..., + provider_sub_code: Optional[int] = ..., + reason: Optional[str] = ..., + source: Union[str, TelephonyCallLifecycleEventSource], + timestamp_source: Union[str, TelephonyCallTimestampSource] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.UpdateToolboxRequest(_Model): - default_version: str + class azure.ai.projects.models.TelephonyCallLifecycleEventName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT_SESSION_CONNECT = "telephony.agent_session.connect" + BINDING_RESOLVE = "telephony.binding.resolve" + CALL_DISCONNECT = "telephony.call.disconnect" + CALL_HANGUP = "telephony.call.hangup" + CALL_TRANSFER = "telephony.call.transfer" + FIRST_AGENT_AUDIO = "telephony.media.first_agent_audio" + FIRST_CALLER_AUDIO = "telephony.media.first_caller_audio" + MEDIA_CONNECT = "telephony.media.connect" + PROVIDER_ANSWER = "telephony.provider.answer" + WEBHOOK_RECEIVED = "telephony.webhook.received" + WEBHOOK_VALIDATION = "telephony.webhook.validation" - @overload - def __init__( - self, - *, - default_version: str - ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.TelephonyCallLifecycleEventOutcome(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELLED = "cancelled" + FAILED = "failed" + OBSERVED = "observed" + REJECTED = "rejected" + STARTED = "started" + SUCCEEDED = "succeeded" - class azure.ai.projects.models.UserProfileMemoryItem(MemoryItem, discriminator='user_profile'): - content: str - kind: Literal[MemoryItemKind.USER_PROFILE] - memory_id: str - scope: str - updated_at: datetime + class azure.ai.projects.models.TelephonyCallLifecycleEventSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + GATEWAY = "gateway" + TEAMS_PHONE_EXTENSION = "teams_phone_extension" + TWILIO = "twilio" + VOICE_AGENT = "voice_agent" + + + class azure.ai.projects.models.TelephonyCallPhase(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ADMITTED = "admitted" + AGENT_SESSION_READY = "agent_session_ready" + ANSWERED = "answered" + ANSWERING = "answering" + BRIDGING = "bridging" + COMPLETED = "completed" + FAILED = "failed" + MANAGING = "managing" + MEDIA_CONNECTED = "media_connected" + RECEIVED = "received" + REJECTED = "rejected" + VALIDATED = "validated" + + + class azure.ai.projects.models.TelephonyCallRecord(_Model): + agent_session_ready_at: Optional[datetime] + answered_at: Optional[datetime] + caller_number: Optional[str] + duration_ms: Optional[timedelta] + end_reason: Optional[str] + ended_at: Optional[datetime] + events: list[TelephonyCallLifecycleEvent] + events_truncated: bool + id: str + media_connected_at: Optional[datetime] + phase: Union[str, TelephonyCallPhase] + provider: Union[str, TelephonyProvider] + provider_call_id: Optional[str] + provider_message: Optional[str] + provider_number: Optional[str] + provider_status_code: Optional[int] + provider_sub_code: Optional[int] + started_at: datetime + status: Union[str, TelephonyCallStatus] + timing: TelephonyCallTiming + trace: Optional[TelephonyCallTrace] @overload def __init__( self, *, - content: str, - memory_id: str, - scope: str, - updated_at: datetime + agent_session_ready_at: Optional[datetime] = ..., + answered_at: Optional[datetime] = ..., + caller_number: Optional[str] = ..., + duration_ms: Optional[timedelta] = ..., + end_reason: Optional[str] = ..., + ended_at: Optional[datetime] = ..., + events: list[TelephonyCallLifecycleEvent], + events_truncated: bool, + id: str, + media_connected_at: Optional[datetime] = ..., + phase: Union[str, TelephonyCallPhase], + provider: Union[str, TelephonyProvider], + provider_call_id: Optional[str] = ..., + provider_message: Optional[str] = ..., + provider_number: Optional[str] = ..., + provider_status_code: Optional[int] = ..., + provider_sub_code: Optional[int] = ..., + started_at: datetime, + status: Union[str, TelephonyCallStatus], + timing: TelephonyCallTiming, + trace: Optional[TelephonyCallTrace] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VersionIndicator(_Model): - type: str + class azure.ai.projects.models.TelephonyCallStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FAILED = "failed" + IN_PROGRESS = "in_progress" + SUCCESS = "success" + + + class azure.ai.projects.models.TelephonyCallSummary(_Model): + agent_session_ready_at: Optional[datetime] + answered_at: Optional[datetime] + caller_number: Optional[str] + duration_ms: Optional[timedelta] + end_reason: Optional[str] + ended_at: Optional[datetime] + id: str + media_connected_at: Optional[datetime] + phase: Union[str, TelephonyCallPhase] + provider: Union[str, TelephonyProvider] + provider_call_id: Optional[str] + provider_message: Optional[str] + provider_number: Optional[str] + provider_status_code: Optional[int] + provider_sub_code: Optional[int] + started_at: datetime + status: Union[str, TelephonyCallStatus] @overload def __init__( self, *, - type: str + agent_session_ready_at: Optional[datetime] = ..., + answered_at: Optional[datetime] = ..., + caller_number: Optional[str] = ..., + duration_ms: Optional[timedelta] = ..., + end_reason: Optional[str] = ..., + ended_at: Optional[datetime] = ..., + id: str, + media_connected_at: Optional[datetime] = ..., + phase: Union[str, TelephonyCallPhase], + provider: Union[str, TelephonyProvider], + provider_call_id: Optional[str] = ..., + provider_message: Optional[str] = ..., + provider_number: Optional[str] = ..., + provider_status_code: Optional[int] = ..., + provider_sub_code: Optional[int] = ..., + started_at: datetime, + status: Union[str, TelephonyCallStatus] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VersionIndicatorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - VERSION_REF = "version_ref" + class azure.ai.projects.models.TelephonyCallTimestampSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DERIVED = "derived" + GATEWAY = "gateway" + PROVIDER = "provider" - class azure.ai.projects.models.VersionRefIndicator(VersionIndicator, discriminator='version_ref'): - agent_version: str - type: Literal[VersionIndicatorType.VERSION_REF] + class azure.ai.projects.models.TelephonyCallTiming(_Model): + admitted_at: Optional[datetime] + agent_session_ready_at: Optional[datetime] + answer_requested_at: Optional[datetime] + answered_at: Optional[datetime] + duration_basis: Optional[Union[str, TelephonyCallDurationBasis]] + ended_at: Optional[datetime] + first_agent_audio_at: Optional[datetime] + first_caller_audio_at: Optional[datetime] + media_connected_at: Optional[datetime] + received_at: Optional[datetime] + timestamp_source: Union[str, TelephonyCallTimestampSource] + validated_at: Optional[datetime] @overload def __init__( self, *, - agent_version: str + admitted_at: Optional[datetime] = ..., + agent_session_ready_at: Optional[datetime] = ..., + answer_requested_at: Optional[datetime] = ..., + answered_at: Optional[datetime] = ..., + duration_basis: Optional[Union[str, TelephonyCallDurationBasis]] = ..., + ended_at: Optional[datetime] = ..., + first_agent_audio_at: Optional[datetime] = ..., + first_caller_audio_at: Optional[datetime] = ..., + media_connected_at: Optional[datetime] = ..., + received_at: Optional[datetime] = ..., + timestamp_source: Union[str, TelephonyCallTimestampSource], + validated_at: Optional[datetime] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VersionSelectionRule(_Model): - agent_version: str - type: str + class azure.ai.projects.models.TelephonyCallTrace(_Model): + conversation_id: Optional[str] + mode: Optional[Union[str, TelephonyCallTraceMode]] + root_span_id: Optional[str] + status: Union[str, TelephonyCallTraceStatus] + trace_id: Optional[str] @overload def __init__( self, *, - agent_version: str, - type: str + conversation_id: Optional[str] = ..., + mode: Optional[Union[str, TelephonyCallTraceMode]] = ..., + root_span_id: Optional[str] = ..., + status: Union[str, TelephonyCallTraceStatus], + trace_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VersionSelector(_Model): - version_selection_rules: list[VersionSelectionRule] + class azure.ai.projects.models.TelephonyCallTraceMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LIVE = "live" + POST_CALL = "post_call" + + + class azure.ai.projects.models.TelephonyCallTraceStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AVAILABLE = "available" + EMITTING = "emitting" + FAILED = "failed" + NOT_APPLICABLE = "not_applicable" + NOT_RECORDED = "not_recorded" + PENDING = "pending" + + + class azure.ai.projects.models.TelephonyProvider(str, Enum, metaclass=CaseInsensitiveEnumMeta): + TEAMS_PHONE_EXTENSION = "teams_phone_extension" + TWILIO = "twilio" + + + class azure.ai.projects.models.TelephonyTransferDestination(_Model): + kind: str @overload def __init__( self, *, - version_selection_rules: list[VersionSelectionRule] + kind: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VersionSelectorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FIXED_RATIO = "FixedRatio" + class azure.ai.projects.models.TelephonyTransferDestinationKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PSTN = "pstn" + SIP = "sip" + TEAMS = "teams" - class azure.ai.projects.models.VoiceAgentAnimationConfig(_Model): - model_name: Optional[str] - outputs: Optional[list[Union[str, VoiceAgentAnimationOutputType]]] + class azure.ai.projects.models.TelephonyTransferTarget(_Model): + description: str + destination: TelephonyTransferDestination + name: str @overload def __init__( self, *, - model_name: Optional[str] = ..., - outputs: Optional[list[Union[str, VoiceAgentAnimationOutputType]]] = ... + description: str, + destination: TelephonyTransferDestination, + name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentAnimationOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - BLENDSHAPES = "blendshapes" - VISEME_ID = "viseme_id" - - - class azure.ai.projects.models.VoiceAgentAudioConfig(_Model): - input: Optional[VoiceAgentAudioInputConfig] - output: Optional[VoiceAgentAudioOutputConfig] + class azure.ai.projects.models.TelephonyTransferTargets(_Model): + transfer_targets: list[TelephonyTransferTarget] @overload def __init__( self, *, - input: Optional[VoiceAgentAudioInputConfig] = ..., - output: Optional[VoiceAgentAudioOutputConfig] = ... + transfer_targets: list[TelephonyTransferTarget] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentAudioInputConfig(_Model): - echo_cancellation: Optional[VoiceAgentEchoCancellation] - format: Optional[RealtimeAudioFormats] - noise_reduction: Optional[VoiceAgentNoiseReduction] - transcription: Optional[VoiceAgentInputTranscription] - turn_detection: Optional[VoiceAgentTurnDetectionConfig] + class azure.ai.projects.models.TestingCriterionAzureAIEvaluator(TypedDict, total=False): + key "data_mapping": Dict[str, str] + key "evaluator_name": Required[str] + key "evaluator_version": str + key "initialization_parameters": Dict[str, Any] + key "name": Required[str] + key "type": Required[Literal["azure_ai_evaluator"]] + + + class azure.ai.projects.models.TextResponseFormat(_Model): + type: str @overload def __init__( self, *, - echo_cancellation: Optional[VoiceAgentEchoCancellation] = ..., - format: Optional[RealtimeAudioFormats] = ..., - noise_reduction: Optional[VoiceAgentNoiseReduction] = ..., - transcription: Optional[VoiceAgentInputTranscription] = ..., - turn_detection: Optional[VoiceAgentTurnDetectionConfig] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentAudioOutputConfig(_Model): - custom_lexicon_url: Optional[str] - custom_text_normalization_url: Optional[str] - custom_voice_endpoint_id: Optional[str] - format: Optional[RealtimeAudioFormats] - output_audio_timestamp_types: Optional[list[Union[str, VoiceAgentAudioTimestampType]]] - personal_voice_model: Optional[str] - pitch: Optional[str] - prefer_locales: Optional[list[str]] - speed: Optional[float] - style: Optional[str] - voice: Optional[str] - voice_locale: Optional[str] - voice_temperature: Optional[float] - voice_type: Optional[Union[str, VoiceType]] - volume: Optional[str] + class azure.ai.projects.models.TextResponseFormatConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + JSON_OBJECT = "json_object" + JSON_SCHEMA = "json_schema" + TEXT = "text" + + + class azure.ai.projects.models.TextResponseFormatJsonObject(TextResponseFormat, discriminator='json_object'): + type: Literal[TextResponseFormatConfigurationType.JSON_OBJECT] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TextResponseFormatJsonSchema(TextResponseFormat, discriminator='json_schema'): + description: Optional[str] + name: str + schema: dict[str, Any] + strict: Optional[bool] + type: Literal[TextResponseFormatConfigurationType.JSON_SCHEMA] @overload def __init__( self, *, - custom_lexicon_url: Optional[str] = ..., - custom_text_normalization_url: Optional[str] = ..., - custom_voice_endpoint_id: Optional[str] = ..., - format: Optional[RealtimeAudioFormats] = ..., - output_audio_timestamp_types: Optional[list[Union[str, VoiceAgentAudioTimestampType]]] = ..., - personal_voice_model: Optional[str] = ..., - pitch: Optional[str] = ..., - prefer_locales: Optional[list[str]] = ..., - speed: Optional[float] = ..., - style: Optional[str] = ..., - voice: Optional[str] = ..., - voice_locale: Optional[str] = ..., - voice_temperature: Optional[float] = ..., - voice_type: Optional[Union[str, VoiceType]] = ..., - volume: Optional[str] = ... + description: Optional[str] = ..., + name: str, + schema: dict[str, Any], + strict: Optional[bool] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentAudioTimestampType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - WORD = "word" + class azure.ai.projects.models.TextResponseFormatText(TextResponseFormat, discriminator='text'): + type: Literal[TextResponseFormatConfigurationType.TEXT] + @overload + def __init__(self) -> None: ... - class azure.ai.projects.models.VoiceAgentAvatarConfig(_Model): - character: str - customized: Optional[bool] - model: Optional[str] - output_audit_audio: Optional[bool] - output_protocol: Optional[Union[str, VoiceAgentAvatarOutputProtocol]] - scene: Optional[VoiceAgentAvatarScene] - style: Optional[str] - type: Union[str, VoiceAgentAvatarType] - video: Optional[VoiceAgentAvatarVideoParams] + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TimerRoutineTrigger(RoutineTrigger, discriminator='timer'): + at: Optional[datetime] + type: Literal[RoutineTriggerType.TIMER] @overload def __init__( self, *, - character: str, - customized: Optional[bool] = ..., - model: Optional[str] = ..., - output_audit_audio: Optional[bool] = ..., - output_protocol: Optional[Union[str, VoiceAgentAvatarOutputProtocol]] = ..., - scene: Optional[VoiceAgentAvatarScene] = ..., - style: Optional[str] = ..., - type: Union[str, VoiceAgentAvatarType], - video: Optional[VoiceAgentAvatarVideoParams] = ... + at: Optional[datetime] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentAvatarIceServer(_Model): - credential: Optional[str] - urls: list[str] - username: Optional[str] + class azure.ai.projects.models.Tool(_Model): + type: str @overload def __init__( self, *, - credential: Optional[str] = ..., - urls: list[str], - username: Optional[str] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentAvatarOutputProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - WEBRTC = "webrtc" - WEBSOCKET = "websocket" - WEBSOCKET_BINARY = "websocket-binary" - - - class azure.ai.projects.models.VoiceAgentAvatarScene(_Model): - amplitude: Optional[float] - position_x: Optional[float] - position_y: Optional[float] - rotation_x: Optional[float] - rotation_y: Optional[float] - rotation_z: Optional[float] - zoom: Optional[float] + class azure.ai.projects.models.ToolChoiceAllowed(ToolChoiceParam, discriminator='allowed_tools'): + mode: Literal["auto", "required"] + tools: list[dict[str, Any]] + type: Literal[ToolChoiceParamType.ALLOWED_TOOLS] @overload def __init__( self, *, - amplitude: Optional[float] = ..., - position_x: Optional[float] = ..., - position_y: Optional[float] = ..., - rotation_x: Optional[float] = ..., - rotation_y: Optional[float] = ..., - rotation_z: Optional[float] = ..., - zoom: Optional[float] = ... + mode: Literal["auto", "required"], + tools: list[dict[str, Any]] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentAvatarType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - PHOTO_AVATAR = "photo_avatar" - VIDEO_AVATAR = "video_avatar" + class azure.ai.projects.models.ToolChoiceCodeInterpreter(ToolChoiceParam, discriminator='code_interpreter'): + type: Literal[ToolChoiceParamType.CODE_INTERPRETER] + @overload + def __init__(self) -> None: ... - class azure.ai.projects.models.VoiceAgentAvatarVideoBackground(_Model): - color: Optional[str] - image_url: Optional[str] + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceComputer(ToolChoiceParam, discriminator='computer'): + type: Literal[ToolChoiceParamType.COMPUTER] @overload - def __init__( - self, - *, - color: Optional[str] = ..., - image_url: Optional[str] = ... - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentAvatarVideoCrop(_Model): - bottom_right: list[int] - top_left: list[int] + class azure.ai.projects.models.ToolChoiceComputerUse(ToolChoiceParam, discriminator='computer_use'): + type: Literal[ToolChoiceParamType.COMPUTER_USE] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceComputerUsePreview(ToolChoiceParam, discriminator='computer_use_preview'): + type: Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceCustom(ToolChoiceParam, discriminator='custom'): + name: str + type: Literal[ToolChoiceParamType.CUSTOM] @overload def __init__( self, *, - bottom_right: list[int], - top_left: list[int] + name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentAvatarVideoParams(_Model): - background: Optional[VoiceAgentAvatarVideoBackground] - bitrate: Optional[int] - crop: Optional[VoiceAgentAvatarVideoCrop] - gop_size: Optional[int] - resolution: Optional[VoiceAgentAvatarVideoResolution] + class azure.ai.projects.models.ToolChoiceFileSearch(ToolChoiceParam, discriminator='file_search'): + type: Literal[ToolChoiceParamType.FILE_SEARCH] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceFunction(ToolChoiceParam, discriminator='function'): + name: str + type: Literal[ToolChoiceParamType.FUNCTION] @overload def __init__( self, *, - background: Optional[VoiceAgentAvatarVideoBackground] = ..., - bitrate: Optional[int] = ..., - crop: Optional[VoiceAgentAvatarVideoCrop] = ..., - gop_size: Optional[int] = ..., - resolution: Optional[VoiceAgentAvatarVideoResolution] = ... + name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentAvatarVideoResolution(_Model): - height: int - width: int + class azure.ai.projects.models.ToolChoiceImageGeneration(ToolChoiceParam, discriminator='image_generation'): + type: Literal[ToolChoiceParamType.IMAGE_GENERATION] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceMCP(ToolChoiceParam, discriminator='mcp'): + name: Optional[str] + server_label: str + type: Literal[ToolChoiceParamType.MCP] @overload def __init__( self, *, - height: int, - width: int + name: Optional[str] = ..., + server_label: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentAzureSemanticVadEnTurnDetection(VoiceAgentTurnDetectionConfig, discriminator='azure_semantic_vad_en'): - auto_truncate: bool - create_response: Optional[bool] - end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] - idle_timeout_ms: Optional[timedelta] - interrupt_response: Optional[bool] - prefix_padding_ms: Optional[timedelta] - remove_filler_words: Optional[bool] - silence_duration_ms: Optional[timedelta] - speech_duration_ms: Optional[timedelta] - threshold: Optional[float] - type: Literal[VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD_EN] + class azure.ai.projects.models.ToolChoiceOptions(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "auto" + NONE = "none" + REQUIRED = "required" + + + class azure.ai.projects.models.ToolChoiceParam(_Model): + type: str @overload def __init__( self, *, - auto_truncate: Optional[bool] = ..., - create_response: Optional[bool] = ..., - end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] = ..., - idle_timeout_ms: Optional[timedelta] = ..., - interrupt_response: Optional[bool] = ..., - prefix_padding_ms: Optional[timedelta] = ..., - remove_filler_words: Optional[bool] = ..., - silence_duration_ms: Optional[timedelta] = ..., - speech_duration_ms: Optional[timedelta] = ..., - threshold: Optional[float] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentAzureSemanticVadMultilingualTurnDetection(VoiceAgentTurnDetectionConfig, discriminator='azure_semantic_vad_multilingual'): - auto_truncate: bool - create_response: Optional[bool] - end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] - idle_timeout_ms: Optional[timedelta] - interrupt_response: Optional[bool] - languages: Optional[list[str]] - prefix_padding_ms: Optional[timedelta] - remove_filler_words: Optional[bool] - silence_duration_ms: Optional[timedelta] - speech_duration_ms: Optional[timedelta] - threshold: Optional[float] - type: Literal[VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] + class azure.ai.projects.models.ToolChoiceParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ALLOWED_TOOLS = "allowed_tools" + APPLY_PATCH = "apply_patch" + CODE_INTERPRETER = "code_interpreter" + COMPUTER = "computer" + COMPUTER_USE = "computer_use" + COMPUTER_USE_PREVIEW = "computer_use_preview" + CUSTOM = "custom" + FILE_SEARCH = "file_search" + FUNCTION = "function" + IMAGE_GENERATION = "image_generation" + MCP = "mcp" + PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" + SHELL = "shell" + WEB_SEARCH_PREVIEW = "web_search_preview" + WEB_SEARCH_PREVIEW_2025_03_11 = "web_search_preview_2025_03_11" + + + class azure.ai.projects.models.ToolChoiceWebSearchPreview(ToolChoiceParam, discriminator='web_search_preview'): + type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW] @overload - def __init__( - self, - *, - auto_truncate: Optional[bool] = ..., - create_response: Optional[bool] = ..., - end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] = ..., - idle_timeout_ms: Optional[timedelta] = ..., - interrupt_response: Optional[bool] = ..., - languages: Optional[list[str]] = ..., - prefix_padding_ms: Optional[timedelta] = ..., - remove_filler_words: Optional[bool] = ..., - silence_duration_ms: Optional[timedelta] = ..., - speech_duration_ms: Optional[timedelta] = ..., - threshold: Optional[float] = ... - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentAzureSemanticVadTurnDetection(VoiceAgentTurnDetectionConfig, discriminator='azure_semantic_vad'): - auto_truncate: bool - create_response: Optional[bool] - end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] - idle_timeout_ms: Optional[timedelta] - interrupt_response: Optional[bool] - languages: Optional[list[str]] - prefix_padding_ms: Optional[timedelta] - remove_filler_words: Optional[bool] - silence_duration_ms: Optional[timedelta] - speech_duration_ms: Optional[timedelta] - threshold: Optional[float] - type: Literal[VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD] + 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.ToolConfig(_Model): + additional_search_text: Optional[str] + pin: Optional[bool] @overload def __init__( self, *, - auto_truncate: Optional[bool] = ..., - create_response: Optional[bool] = ..., - end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] = ..., - idle_timeout_ms: Optional[timedelta] = ..., - interrupt_response: Optional[bool] = ..., - languages: Optional[list[str]] = ..., - prefix_padding_ms: Optional[timedelta] = ..., - remove_filler_words: Optional[bool] = ..., - silence_duration_ms: Optional[timedelta] = ..., - speech_duration_ms: Optional[timedelta] = ..., - threshold: Optional[float] = ... + additional_search_text: Optional[str] = ..., + pin: Optional[bool] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentClientEventSessionAvatarConnect(RealtimeClientEvent, discriminator='session.avatar.connect'): - client_sdp: str - event_id: Optional[str] - type: Literal[RealtimeClientEventType.SESSION_AVATAR_CONNECT] + class azure.ai.projects.models.ToolDescription(_Model): + description: Optional[str] + name: Optional[str] @overload def __init__( self, *, - client_sdp: str, - event_id: Optional[str] = ... + description: Optional[str] = ..., + name: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentClientEventSessionUpdate(_Model): - event_id: Optional[str] - session: VoiceAgentSessionUpdateConfig - type: Literal[RealtimeClientEventType.SESSION_UPDATE] + class azure.ai.projects.models.ToolDescriptionParam(TypedDict, total=False): + key "description": str + key "name": str + + + class azure.ai.projects.models.ToolProjectConnection(_Model): + project_connection_id: str @overload def __init__( self, *, - event_id: Optional[str] = ..., - session: VoiceAgentSessionUpdateConfig, - type: Literal[RealtimeClientEventType.SESSION_UPDATE] + project_connection_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentDefinition(AgentDefinition, discriminator='voice'): - audio: Optional[VoiceAgentAudioConfig] - avatar: Optional[VoiceAgentAvatarConfig] - greeting: Optional[VoiceAgentGreetingConfig] - include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] - instructions: Optional[str] - interim_response: Optional[VoiceAgentInterimResponseConfig] - kind: Literal[AgentKind.VOICE] - max_output_tokens: Optional[VoiceAgentMaxOutputTokens] - model: str - model_type: 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]] - tool_choice: Optional[VoiceAgentToolChoice] - tools: Optional[list[VoiceAgentTool]] + class azure.ai.projects.models.ToolSearchExecutionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CLIENT = "client" + 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] @overload def __init__( self, *, - audio: Optional[VoiceAgentAudioConfig] = ..., - avatar: Optional[VoiceAgentAvatarConfig] = ..., - greeting: Optional[VoiceAgentGreetingConfig] = ..., - include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] = ..., - instructions: Optional[str] = ..., - interim_response: Optional[VoiceAgentInterimResponseConfig] = ..., - max_output_tokens: Optional[VoiceAgentMaxOutputTokens] = ..., - model: str, - model_type: Union[str, VoiceModelType], - output_modalities: Optional[list[Union[str, VoiceOutputModality]]] = ..., - parallel_tool_calls: Optional[bool] = ..., - rai_config: Optional[RaiConfig] = ..., - store: Optional[bool] = ..., - structured_inputs: Optional[dict[str, StructuredInputDefinition]] = ..., - tool_choice: Optional[VoiceAgentToolChoice] = ..., - tools: Optional[list[VoiceAgentTool]] = ... + description: Optional[str] = ..., + execution: Optional[Union[str, ToolSearchExecutionType]] = ..., + parameters: Optional[EmptyModelParam] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentEchoCancellation(_Model): - channels: Optional[int] - reference_source: Optional[Union[str, VoiceAgentEchoCancellationReferenceSource]] - type: Literal["server_echo_cancellation"] + 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, *, - channels: Optional[int] = ..., - reference_source: Optional[Union[str, VoiceAgentEchoCancellationReferenceSource]] = ... + 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.VoiceAgentEchoCancellationReferenceSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CLIENT = "client" - SERVER = "server" + class azure.ai.projects.models.ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + A2A_PREVIEW = "a2a_preview" + A2_A = "a2a" + APPLY_PATCH = "apply_patch" + AZURE_AI_SEARCH = "azure_ai_search" + AZURE_FUNCTION = "azure_function" + BING_CUSTOM_SEARCH_PREVIEW = "bing_custom_search_preview" + BING_GROUNDING = "bing_grounding" + BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" + CAPTURE_STRUCTURED_OUTPUTS = "capture_structured_outputs" + CODE_INTERPRETER = "code_interpreter" + COMPUTER = "computer" + COMPUTER_USE_PREVIEW = "computer_use_preview" + CUSTOM = "custom" + FABRIC_DATAAGENT_PREVIEW = "fabric_dataagent_preview" + FABRIC_IQ_PREVIEW = "fabric_iq_preview" + FILE_SEARCH = "file_search" + FUNCTION = "function" + IMAGE_GENERATION = "image_generation" + LOCAL_SHELL = "local_shell" + MCP = "mcp" + MEMORY_SEARCH_PREVIEW = "memory_search_preview" + NAMESPACE = "namespace" + OPENAPI = "openapi" + PROGRAMMATIC_TOOL_CALLING = "programmatic_tool_calling" + SHAREPOINT_GROUNDING_PREVIEW = "sharepoint_grounding_preview" + SHELL = "shell" + TOOLBOX_SEARCH_PREVIEW = "toolbox_search_preview" + TOOL_SEARCH = "tool_search" + WEB_IQ_PREVIEW = "web_iq_preview" + WEB_SEARCH = "web_search" + WEB_SEARCH_PREVIEW = "web_search_preview" + WORK_IQ_PREVIEW = "work_iq_preview" - class azure.ai.projects.models.VoiceAgentEndOfUtteranceDetection(_Model): - model: Union[str, VoiceAgentEndOfUtteranceDetectionModel] - threshold_level: Optional[Union[str, VoiceAgentEndOfUtteranceThresholdLevel]] - timeout_ms: Optional[timedelta] + class azure.ai.projects.models.ToolUseFineTuningDataGenerationJobOptions(DataGenerationJobOptions, discriminator='tool_use'): + max_samples: int + model_options: DataGenerationModelOptions + train_split: float + type: Literal[DataGenerationJobType.TOOL_USE] @overload def __init__( self, *, - model: Union[str, VoiceAgentEndOfUtteranceDetectionModel], - threshold_level: Optional[Union[str, VoiceAgentEndOfUtteranceThresholdLevel]] = ..., - timeout_ms: Optional[timedelta] = ... + max_samples: int, + model_options: Optional[DataGenerationModelOptions] = ..., + train_split: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentEndOfUtteranceDetectionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - SEMANTIC_DETECTION_V1 = "semantic_detection_v1" - SEMANTIC_DETECTION_V1_EN = "semantic_detection_v1_en" - SEMANTIC_DETECTION_V1_MULTILINGUAL = "semantic_detection_v1_multilingual" - SMART_END_OF_TURN_DETECTION = "smart_end_of_turn_detection" - - - class azure.ai.projects.models.VoiceAgentEndOfUtteranceThresholdLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DEFAULT = "default" - HIGH = "high" - LOW = "low" - MEDIUM = "medium" - - - class azure.ai.projects.models.VoiceAgentFunctionTool(VoiceAgentTool, discriminator='function'): - description: Optional[str] + class azure.ai.projects.models.ToolboxObject(_Model): + default_version: str + id: str name: str - parameters: Optional[RealtimeFunctionToolParameters] - type: Literal["function"] @overload def __init__( self, *, - description: Optional[str] = ..., - name: str, - parameters: Optional[RealtimeFunctionToolParameters] = ... + default_version: str, + id: str, + name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentGreetingConfig(_Model): - type: str + class azure.ai.projects.models.ToolboxPolicies(_Model): + rai_config: Optional[RaiConfig] @overload def __init__( self, *, - type: str + rai_config: Optional[RaiConfig] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentInputTranscription(_Model): - custom_speech: Optional[dict[str, str]] - delay: Optional[Literal["minimal", "low", "medium", "high", "xhigh"]] - keywords: Optional[list[str]] - language: Optional[str] - languages: Optional[list[str]] - model: Union[str, VoiceAgentInputTranscriptionModel] - phrase_list: Optional[list[str]] - prompt: Optional[str] + class azure.ai.projects.models.ToolboxSearchPreviewToolboxTool(ToolboxTool, discriminator='toolbox_search_preview'): + description: str + name: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW] @overload def __init__( self, *, - custom_speech: Optional[dict[str, str]] = ..., - delay: Optional[Literal[minimal, low, medium, high, xhigh]] = ..., - keywords: Optional[list[str]] = ..., - language: Optional[str] = ..., - languages: Optional[list[str]] = ..., - model: Union[str, VoiceAgentInputTranscriptionModel], - phrase_list: Optional[list[str]] = ..., - prompt: Optional[str] = ... + 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.VoiceAgentInputTranscriptionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AZURE_SPEECH = "azure-speech" - GPT4_O_MINI_TRANSCRIBE = "gpt-4o-mini-transcribe" - GPT4_O_TRANSCRIBE = "gpt-4o-transcribe" - GPT4_O_TRANSCRIBE_DIARIZE = "gpt-4o-transcribe-diarize" - GPT_LIVE_TRANSCRIBE = "gpt-live-transcribe" - GPT_REALTIME_WHISPER = "gpt-realtime-whisper" - GPT_TRANSCRIBE = "gpt-transcribe" - MAI_TRANSCRIBE = "mai-transcribe" - WHISPER1 = "whisper-1" - - - class azure.ai.projects.models.VoiceAgentInterimResponseConfig(_Model): - latency_threshold_ms: Optional[timedelta] - triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] - type: str + class azure.ai.projects.models.ToolboxShellContainerAutoEnvironment(ToolboxShellEnvironment, discriminator='container_auto'): + file_ids: Optional[list[str]] + memory_limit: Optional[Union[str, ContainerMemoryLimit]] + network_policy: Optional[ToolboxShellNetworkPolicy] + skills: Optional[list[ContainerSkill]] + type: Literal["container_auto"] @overload def __init__( self, *, - latency_threshold_ms: Optional[timedelta] = ..., - triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] = ..., - type: str + file_ids: Optional[list[str]] = ..., + memory_limit: Optional[Union[str, ContainerMemoryLimit]] = ..., + network_policy: Optional[ToolboxShellNetworkPolicy] = ..., + skills: Optional[list[ContainerSkill]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentInterimResponseTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): - LATENCY = "latency" - TOOL = "tool" - - - class azure.ai.projects.models.VoiceAgentLlmGeneratedGreetingConfig(VoiceAgentGreetingConfig, discriminator='llm_generated'): - prompt: str - tool_choice: Optional[VoiceAgentToolChoice] - type: Literal["llm_generated"] + class azure.ai.projects.models.ToolboxShellContainerReferenceEnvironment(ToolboxShellEnvironment, discriminator='container_reference'): + container_id: str + type: Literal["container_reference"] @overload def __init__( self, *, - prompt: str, - tool_choice: Optional[VoiceAgentToolChoice] = ... + container_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentLlmInterimResponseConfig(VoiceAgentInterimResponseConfig, discriminator='llm_interim_response'): - instructions: Optional[str] - latency_threshold_ms: timedelta - max_completion_tokens: Optional[int] - model: Optional[str] - triggers: Union[list[str, VoiceAgentInterimResponseTrigger]] - type: Literal["llm_interim_response"] + class azure.ai.projects.models.ToolboxShellEnvironment(_Model): + type: str @overload def __init__( self, *, - instructions: Optional[str] = ..., - latency_threshold_ms: Optional[timedelta] = ..., - max_completion_tokens: Optional[int] = ..., - model: Optional[str] = ..., - triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentMcpTool(VoiceAgentTool, discriminator='mcp'): - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] - allowed_tools: Optional[Union[list[str], MCPToolFilter]] - authorization: Optional[str] - defer_loading: Optional[bool] - headers: Optional[dict[str, str]] - project_connection_id: Optional[str] - require_approval: Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] - response_scheduling: Optional[Union[str, VoiceAgentToolResponseScheduling]] - server_description: Optional[str] - server_label: str - server_url: Optional[str] - tool_configs: Optional[dict[str, ToolConfig]] - type: Literal["mcp"] + class azure.ai.projects.models.ToolboxShellNetworkPolicy(_Model): + type: str @overload def __init__( self, *, - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., - allowed_tools: Optional[Union[list[str], MCPToolFilter]] = ..., - authorization: Optional[str] = ..., - defer_loading: Optional[bool] = ..., - headers: Optional[dict[str, str]] = ..., - project_connection_id: Optional[str] = ..., - require_approval: Optional[Union[MCPToolRequireApproval, Literal[always], Literal[never]]] = ..., - response_scheduling: Optional[Union[str, VoiceAgentToolResponseScheduling]] = ..., - server_description: Optional[str] = ..., - server_label: str, - server_url: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentNoiseReduction(_Model): - type: Union[str, VoiceAgentNoiseReductionType] + class azure.ai.projects.models.ToolboxShellNetworkPolicyDisabled(ToolboxShellNetworkPolicy, discriminator='disabled'): + type: Literal["disabled"] @overload - def __init__( - self, - *, - type: Union[str, VoiceAgentNoiseReductionType] - ) -> None: ... + def __init__(self) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentNoiseReductionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AZURE_DEEP_NOISE_SUPPRESSION = "azure_deep_noise_suppression" - FAR_FIELD = "far_field" - NEAR_FIELD = "near_field" - - - class azure.ai.projects.models.VoiceAgentRealtimeResponse(VoiceAgentRealtimeResponseBase): - audio: Optional[VoiceResponseAudio] - conversation_id: str - id: str - max_output_tokens: Union[int, str] - metadata: Metadata - object: str - output: Optional[list[RealtimeConversationItem]] - output_modalities: Union[list[str, str]] - status: Union[str, str, str, str, str] - status_details: RealtimeResponseStatusDetails - usage: RealtimeResponseUsage + class azure.ai.projects.models.ToolboxSkill(_Model): + type: str @overload def __init__( self, *, - audio: Optional[VoiceResponseAudio] = ..., - conversation_id: Optional[str] = ..., - id: Optional[str] = ..., - max_output_tokens: Optional[Union[int, Literal[inf]]] = ..., - metadata: Optional[Metadata] = ..., - object: Optional[Literal[response]] = ..., - output: Optional[list[RealtimeConversationItem]] = ..., - output_modalities: Optional[list[Literal[text, audio]]] = ..., - status: Optional[Literal[completed, cancelled, failed, incomplete, in_progress]] = ..., - status_details: Optional[RealtimeResponseStatusDetails] = ..., - usage: Optional[RealtimeResponseUsage] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentRealtimeResponseBase(_Model): - conversation_id: Optional[str] - id: Optional[str] - max_output_tokens: Optional[Union[int, Literal["inf"]]] - metadata: Optional[Metadata] - object: Optional[Literal["response"]] - output_modalities: Optional[list[Literal["text", "audio"]]] - status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] - status_details: Optional[RealtimeResponseStatusDetails] - usage: Optional[RealtimeResponseUsage] + class azure.ai.projects.models.ToolboxSkillReference(ToolboxSkill, discriminator='skill_reference'): + name: str + type: Literal["skill_reference"] + version: Optional[str] @overload def __init__( self, *, - conversation_id: Optional[str] = ..., - id: Optional[str] = ..., - max_output_tokens: Optional[Union[int, Literal[inf]]] = ..., - metadata: Optional[Metadata] = ..., - object: Optional[Literal[response]] = ..., - output_modalities: Optional[list[Literal[text, audio]]] = ..., - status: Optional[Literal[completed, cancelled, failed, incomplete, in_progress]] = ..., - status_details: Optional[RealtimeResponseStatusDetails] = ..., - usage: Optional[RealtimeResponseUsage] = ... + name: str, + version: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentResponseCreateParams(_Model): - audio: Optional[PickPropertiesVoiceAgentAudioConfig] - conversation: Optional[Union[Literal["auto"], Literal["none"], str]] - input: Optional[list[RealtimeConversationItem]] - instructions: Optional[str] - interim_response: Optional[VoiceAgentInterimResponseConfig] - max_output_tokens: Optional[Union[int, Literal["inf"]]] - metadata: Optional[Metadata] - output_modalities: Optional[list[Union[str, VoiceOutputModality]]] - parallel_tool_calls: Optional[bool] - pre_generated_assistant_message: Optional[RealtimeConversationItem] - reasoning: Optional[RealtimeReasoning] - tool_choice: Optional[Union[str, ToolChoiceOptions, ToolChoiceFunction, ToolChoiceMCP]] - tools: Optional[list[Union[RealtimeFunctionTool, MCPTool]]] + class azure.ai.projects.models.ToolboxTool(_Model): + description: Optional[str] + name: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] + type: str @overload def __init__( self, *, - audio: Optional[PickPropertiesVoiceAgentAudioConfig] = ..., - conversation: Optional[Union[Literal[auto], Literal[none], str]] = ..., - input: Optional[list[RealtimeConversationItem]] = ..., - instructions: Optional[str] = ..., - interim_response: Optional[VoiceAgentInterimResponseConfig] = ..., - max_output_tokens: Optional[Union[int, Literal[inf]]] = ..., - metadata: Optional[Metadata] = ..., - output_modalities: Optional[list[Union[str, VoiceOutputModality]]] = ..., - parallel_tool_calls: Optional[bool] = ..., - pre_generated_assistant_message: Optional[RealtimeConversationItem] = ..., - reasoning: Optional[RealtimeReasoning] = ..., - tool_choice: Optional[Union[str, ToolChoiceOptions, ToolChoiceFunction, ToolChoiceMCP]] = ..., - tools: Optional[list[Union[RealtimeFunctionTool, MCPTool]]] = ... + description: Optional[str] = ..., + name: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ..., + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentSemanticVadTurnDetection(VoiceAgentTurnDetectionConfig, discriminator='semantic_vad'): - auto_truncate: bool - create_response: Optional[bool] - eagerness: Optional[Literal["low", "medium", "high", "auto"]] - interrupt_response: Optional[bool] - type: Literal[VoiceAgentTurnDetectionType.SEMANTIC_VAD] + class azure.ai.projects.models.ToolboxToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + A2A_PREVIEW = "a2a_preview" + A2_A = "a2a" + AZURE_AI_SEARCH = "azure_ai_search" + BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" + CODE_INTERPRETER = "code_interpreter" + FABRIC_IQ_PREVIEW = "fabric_iq_preview" + FILE_SEARCH = "file_search" + MCP = "mcp" + OPENAPI = "openapi" + REMINDER_PREVIEW = "reminder_preview" + SHELL = "shell" + TOOLBOX_SEARCH = "toolbox_search" + TOOLBOX_SEARCH_PREVIEW = "toolbox_search_preview" + WEB_IQ_PREVIEW = "web_iq_preview" + WEB_SEARCH = "web_search" + WORK_IQ_PREVIEW = "work_iq_preview" + + + class azure.ai.projects.models.ToolboxVersionObject(_Model): + created_at: datetime + description: Optional[str] + id: str + metadata: dict[str, str] + name: str + policies: Optional[ToolboxPolicies] + skills: Optional[list[ToolboxSkill]] + tools: list[ToolboxTool] + version: str @overload def __init__( self, *, - auto_truncate: Optional[bool] = ..., - create_response: Optional[bool] = ..., - eagerness: Optional[Literal[low, medium, high, auto]] = ..., - interrupt_response: Optional[bool] = ... - ) -> None: ... - + created_at: datetime, + description: Optional[str] = ..., + id: str, + metadata: dict[str, str], + name: str, + policies: Optional[ToolboxPolicies] = ..., + skills: Optional[list[ToolboxSkill]] = ..., + tools: list[ToolboxTool], + version: str + ) -> None: ... + @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventResponseAnimationBlendshapesDelta(RealtimeServerEvent, discriminator='response.animation_blendshapes.delta'): - content_index: int - event_id: str - frame_index: int - frames: list[list[float]] - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_ANIMATION_BLENDSHAPES_DELTA] + class azure.ai.projects.models.TracesDataGenerationJobOptions(DataGenerationJobOptions, discriminator='traces'): + max_samples: int + model_options: DataGenerationModelOptions + redact_private_content: Optional[bool] + train_split: float + type: Literal[DataGenerationJobType.TRACES] @overload def __init__( self, *, - content_index: int, - event_id: str, - frame_index: int, - frames: list[list[float]], - item_id: str, - output_index: int, - response_id: str + max_samples: int, + model_options: Optional[DataGenerationModelOptions] = ..., + redact_private_content: Optional[bool] = ..., + train_split: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventResponseAnimationBlendshapesDone(RealtimeServerEvent, discriminator='response.animation_blendshapes.done'): - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_ANIMATION_BLENDSHAPES_DONE] + class azure.ai.projects.models.TracesDataGenerationJobSource(DataGenerationJobSource, discriminator='traces'): + agent_id: Optional[str] + agent_name: Optional[str] + agent_version: Optional[str] + description: str + end_time: Optional[datetime] + start_time: datetime + type: Literal[DataGenerationJobSourceType.TRACES] @overload def __init__( self, *, - event_id: str, - item_id: str, - output_index: int, - response_id: str + agent_id: Optional[str] = ..., + agent_name: Optional[str] = ..., + agent_version: Optional[str] = ..., + description: Optional[str] = ..., + end_time: Optional[datetime] = ..., + start_time: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventResponseAnimationVisemeDelta(RealtimeServerEvent, discriminator='response.animation_viseme.delta'): - audio_offset_ms: timedelta - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_ANIMATION_VISEME_DELTA] - viseme_id: int + class azure.ai.projects.models.TracesEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator='traces'): + agent_id: Optional[str] + agent_name: Optional[str] + agent_version: Optional[str] + description: Optional[str] + end_time: Optional[datetime] + start_time: datetime + type: Literal[EvaluatorGenerationJobSourceType.TRACES] @overload def __init__( self, *, - audio_offset_ms: timedelta, - content_index: int, - event_id: str, - item_id: str, - output_index: int, - response_id: str, - viseme_id: int + agent_id: Optional[str] = ..., + agent_name: Optional[str] = ..., + agent_version: Optional[str] = ..., + description: Optional[str] = ..., + end_time: Optional[datetime] = ..., + start_time: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventResponseAnimationVisemeDone(RealtimeServerEvent, discriminator='response.animation_viseme.done'): - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_ANIMATION_VISEME_DONE] + class azure.ai.projects.models.TracesPreviewEvalRunDataSource(TypedDict, total=False): + key "agent_id": str + key "agent_name": str + key "end_time": datetime + key "ingestion_delay_seconds": int + key "lookback_hours": int + key "max_traces": int + key "trace_ids": List[str] + key "type": Required[Literal["azure_ai_traces_preview"]] + + + class azure.ai.projects.models.TranscriptTextUsageDuration(CreateTranscriptionResponseJsonUsage, discriminator='duration'): + seconds: timedelta + type: Literal[CreateTranscriptionResponseJsonUsageType.DURATION] @overload def __init__( self, *, - content_index: int, - event_id: str, - item_id: str, - output_index: int, - response_id: str + seconds: timedelta ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventResponseAudioTimestampDelta(RealtimeServerEvent, discriminator='response.audio_timestamp.delta'): - audio_duration_ms: timedelta - audio_offset_ms: timedelta - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - text: str - timestamp_type: Literal["word"] - type: Literal[RealtimeServerEventType.RESPONSE_AUDIO_TIMESTAMP_DELTA] + class azure.ai.projects.models.TranscriptTextUsageTokens(CreateTranscriptionResponseJsonUsage, discriminator='tokens'): + input_token_details: Optional[TranscriptTextUsageTokensInputTokenDetails] + input_tokens: int + output_tokens: int + total_tokens: int + type: Literal[CreateTranscriptionResponseJsonUsageType.TOKENS] @overload def __init__( self, *, - audio_duration_ms: timedelta, - audio_offset_ms: timedelta, - content_index: int, - event_id: str, - item_id: str, - output_index: int, - response_id: str, - text: str + input_token_details: Optional[TranscriptTextUsageTokensInputTokenDetails] = ..., + input_tokens: int, + output_tokens: int, + total_tokens: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventResponseAudioTimestampDone(RealtimeServerEvent, discriminator='response.audio_timestamp.done'): - content_index: int - event_id: str - item_id: str - output_index: int - response_id: str - type: Literal[RealtimeServerEventType.RESPONSE_AUDIO_TIMESTAMP_DONE] + class azure.ai.projects.models.TranscriptTextUsageTokensInputTokenDetails(_Model): + audio_tokens: Optional[int] + text_tokens: Optional[int] @overload def __init__( self, *, - content_index: int, - event_id: str, - item_id: str, - output_index: int, - response_id: str + audio_tokens: Optional[int] = ..., + text_tokens: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventResponseVideoDelta(RealtimeServerEvent, discriminator='response.video.delta'): - codec: str - delta: str - event_id: str - output_index: int - type: Literal[RealtimeServerEventType.RESPONSE_VIDEO_DELTA] + class azure.ai.projects.models.TranscriptionLanguage(_Model): + code: str @overload def __init__( self, *, - codec: str, - delta: str, - event_id: str, - output_index: int + code: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventSessionAvatarConnecting(RealtimeServerEvent, discriminator='session.avatar.connecting'): - event_id: str - server_sdp: str - type: Literal[RealtimeServerEventType.SESSION_AVATAR_CONNECTING] + class azure.ai.projects.models.TreatmentEffectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CHANGED = "Changed" + DEGRADED = "Degraded" + IMPROVED = "Improved" + INCONCLUSIVE = "Inconclusive" + TOO_FEW_SAMPLES = "TooFewSamples" + + + class azure.ai.projects.models.Trigger(_Model): + type: str @overload def __init__( self, *, - event_id: str, - server_sdp: str + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventSessionAvatarSwitchToIdle(RealtimeServerEvent, discriminator='session.avatar.switch_to_idle'): - event_id: str - turn_id: Optional[str] - type: Literal[RealtimeServerEventType.SESSION_AVATAR_SWITCH_TO_IDLE] + class azure.ai.projects.models.TriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CRON = "Cron" + ONE_TIME = "OneTime" + RECURRENCE = "Recurrence" + + + class azure.ai.projects.models.TwilioTelephonyBinding(TelephonyBinding, discriminator='twilio'): + connection: str + id: str + incoming_call_url: str + label: str + phone_number: str + provider: Literal[TelephonyProvider.TWILIO] + status: Union[str, TelephonyBindingStatus] @overload def __init__( self, *, - event_id: str, - turn_id: Optional[str] = ... + connection: str, + id: str, + incoming_call_url: str, + label: Optional[str] = ..., + phone_number: str, + status: Union[str, TelephonyBindingStatus] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventSessionAvatarSwitchToSpeaking(RealtimeServerEvent, discriminator='session.avatar.switch_to_speaking'): - event_id: str - turn_id: Optional[str] - type: Literal[RealtimeServerEventType.SESSION_AVATAR_SWITCH_TO_SPEAKING] + class azure.ai.projects.models.TwilioTelephonyBindingListItem(TelephonyBindingListItem, discriminator='twilio'): + connection: str + etag: str + id: str + incoming_call_url: str + label: str + phone_number: str + provider: Literal[TelephonyProvider.TWILIO] + status: Union[str, TelephonyBindingStatus] @overload def __init__( self, *, - event_id: str, - turn_id: Optional[str] = ... + connection: str, + id: str, + incoming_call_url: str, + label: Optional[str] = ..., + phone_number: str, + status: Union[str, TelephonyBindingStatus] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventWarning(RealtimeServerEvent, discriminator='warning'): - event_id: str - type: Literal[RealtimeServerEventType.WARNING] - warning: VoiceAgentServerEventWarningDetails + class azure.ai.projects.models.UpdateMemoriesLROPoller(LROPoller[MemoryStoreUpdateCompletedResult]): + property superseded_by: Optional[str] # Read-only + property update_id: str # Read-only + + @classmethod + def from_continuation_token( + cls, + polling_method: PollingMethod[MemoryStoreUpdateCompletedResult], + continuation_token: str, + **kwargs: Any + ) -> UpdateMemoriesLROPoller: ... + + + class azure.ai.projects.models.UpdateModelVersionRequest(_Model): + description: Optional[str] + tags: Optional[dict[str, str]] @overload def __init__( self, *, - event_id: str, - warning: VoiceAgentServerEventWarningDetails + description: Optional[str] = ..., + tags: Optional[dict[str, str]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerEventWarningDetails(_Model): - code: Optional[str] - message: str - param: Optional[str] + class azure.ai.projects.models.UpdateTelephonyBindingRequest(_Model): + connection: Optional[str] + label: Optional[str] + phone_number: Optional[str] + status: Optional[Union[str, TelephonyBindingStatus]] @overload def __init__( self, *, - code: Optional[str] = ..., - message: str, - param: Optional[str] = ... + connection: Optional[str] = ..., + label: Optional[str] = ..., + phone_number: Optional[str] = ..., + status: Optional[Union[str, TelephonyBindingStatus]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentServerVadTurnDetection(VoiceAgentTurnDetectionConfig, discriminator='server_vad'): - auto_truncate: bool - create_response: Optional[bool] - end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] - idle_timeout_ms: Optional[int] - interrupt_response: Optional[bool] - prefix_padding_ms: Optional[int] - silence_duration_ms: Optional[int] - speech_duration_ms: Optional[timedelta] - threshold: Optional[float] - type: Literal[VoiceAgentTurnDetectionType.SERVER_VAD] + class azure.ai.projects.models.UpdateToolboxRequest(_Model): + default_version: str @overload def __init__( self, *, - auto_truncate: Optional[bool] = ..., - create_response: Optional[bool] = ..., - end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] = ..., - idle_timeout_ms: Optional[int] = ..., - interrupt_response: Optional[bool] = ..., - prefix_padding_ms: Optional[int] = ..., - silence_duration_ms: Optional[int] = ..., - speech_duration_ms: Optional[timedelta] = ..., - threshold: Optional[float] = ... + default_version: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentSessionAvatarConfig(VoiceAgentAvatarConfig): - character: str - customized: bool - ice_servers: Optional[list[VoiceAgentAvatarIceServer]] - model: str - output_audit_audio: bool - output_protocol: Union[str, VoiceAgentAvatarOutputProtocol] - scene: VoiceAgentAvatarScene - style: str - type: Union[str, VoiceAgentAvatarType] - video: VoiceAgentAvatarVideoParams + class azure.ai.projects.models.UserProfileMemoryItem(MemoryItem, discriminator='user_profile'): + content: str + kind: Literal[MemoryItemKind.USER_PROFILE] + memory_id: str + scope: str + updated_at: datetime @overload def __init__( self, *, - character: str, - customized: Optional[bool] = ..., - ice_servers: Optional[list[VoiceAgentAvatarIceServer]] = ..., - model: Optional[str] = ..., - output_audit_audio: Optional[bool] = ..., - output_protocol: Optional[Union[str, VoiceAgentAvatarOutputProtocol]] = ..., - scene: Optional[VoiceAgentAvatarScene] = ..., - style: Optional[str] = ..., - type: Union[str, VoiceAgentAvatarType], - video: Optional[VoiceAgentAvatarVideoParams] = ... + content: str, + memory_id: str, + scope: str, + updated_at: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentSessionIncludeOption(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FILE_SEARCH_CALL_RESULTS = "file_search_call.results" - INPUT_AUDIO_TRANSCRIPTION_LOGPROBS = "item.input_audio_transcription.logprobs" - INPUT_AUDIO_TRANSCRIPTION_PHRASES = "item.input_audio_transcription.phrases" - - - class azure.ai.projects.models.VoiceAgentSessionResponseConfig(_Model): - animation: Optional[VoiceAgentAnimationConfig] - audio: Optional[VoiceAgentAudioConfig] - avatar: Optional[VoiceAgentSessionAvatarConfig] - expires_at: Optional[datetime] - greeting: Optional[VoiceAgentGreetingConfig] - id: str - include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] - instructions: Optional[str] - interim_response: Optional[VoiceAgentInterimResponseConfig] - max_output_tokens: Optional[VoiceAgentMaxOutputTokens] - metadata: Optional[dict[str, str]] - model: str - object: Literal["session"] - output_modalities: Optional[list[Union[str, VoiceOutputModality]]] - parallel_tool_calls: Optional[bool] - reasoning: Optional[RealtimeReasoning] - temperature: Optional[float] - tool_choice: Optional[VoiceAgentToolChoice] - tools: Optional[list[VoiceAgentTool]] - type: Literal["realtime"] + class azure.ai.projects.models.VersionIndicator(_Model): + type: str @overload def __init__( self, *, - animation: Optional[VoiceAgentAnimationConfig] = ..., - audio: Optional[VoiceAgentAudioConfig] = ..., - avatar: Optional[VoiceAgentSessionAvatarConfig] = ..., - expires_at: Optional[datetime] = ..., - greeting: Optional[VoiceAgentGreetingConfig] = ..., - id: str, - include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] = ..., - instructions: Optional[str] = ..., - interim_response: Optional[VoiceAgentInterimResponseConfig] = ..., - max_output_tokens: Optional[VoiceAgentMaxOutputTokens] = ..., - metadata: Optional[dict[str, str]] = ..., - model: str, - output_modalities: Optional[list[Union[str, VoiceOutputModality]]] = ..., - parallel_tool_calls: Optional[bool] = ..., - reasoning: Optional[RealtimeReasoning] = ..., - temperature: Optional[float] = ..., - tool_choice: Optional[VoiceAgentToolChoice] = ..., - tools: Optional[list[VoiceAgentTool]] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentSessionUpdateConfig(_Model): - animation: Optional[VoiceAgentAnimationConfig] - audio: Optional[VoiceAgentAudioConfig] - avatar: Optional[VoiceAgentSessionAvatarConfig] - greeting: Optional[VoiceAgentGreetingConfig] - include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] - instructions: Optional[str] - interim_response: Optional[VoiceAgentInterimResponseConfig] - max_output_tokens: Optional[VoiceAgentMaxOutputTokens] - metadata: Optional[dict[str, str]] - output_modalities: Optional[list[Union[str, VoiceOutputModality]]] - parallel_tool_calls: Optional[bool] - reasoning: Optional[RealtimeReasoning] - temperature: Optional[float] - tool_choice: Optional[VoiceAgentToolChoice] - tools: Optional[list[VoiceAgentTool]] - type: Literal["realtime"] + class azure.ai.projects.models.VersionIndicatorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + VERSION_REF = "version_ref" + + + class azure.ai.projects.models.VersionRefIndicator(VersionIndicator, discriminator='version_ref'): + agent_version: str + type: Literal[VersionIndicatorType.VERSION_REF] @overload def __init__( self, *, - animation: Optional[VoiceAgentAnimationConfig] = ..., - audio: Optional[VoiceAgentAudioConfig] = ..., - avatar: Optional[VoiceAgentSessionAvatarConfig] = ..., - greeting: Optional[VoiceAgentGreetingConfig] = ..., - include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] = ..., - instructions: Optional[str] = ..., - interim_response: Optional[VoiceAgentInterimResponseConfig] = ..., - max_output_tokens: Optional[VoiceAgentMaxOutputTokens] = ..., - metadata: Optional[dict[str, str]] = ..., - output_modalities: Optional[list[Union[str, VoiceOutputModality]]] = ..., - parallel_tool_calls: Optional[bool] = ..., - reasoning: Optional[RealtimeReasoning] = ..., - temperature: Optional[float] = ..., - tool_choice: Optional[VoiceAgentToolChoice] = ..., - tools: Optional[list[VoiceAgentTool]] = ... + agent_version: str ) -> 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]] - triggers: Union[list[str, VoiceAgentInterimResponseTrigger]] - type: Literal["static_interim_response"] + class azure.ai.projects.models.VersionSelectionRule(_Model): + agent_version: str + type: str @overload def __init__( self, *, - latency_threshold_ms: Optional[timedelta] = ..., - texts: Optional[list[str]] = ..., - triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] = ... + agent_version: str, + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentSystemTool(VoiceAgentTool, discriminator='system'): - description: Optional[str] - name: Union[str, VoiceAgentSystemToolName] - type: Literal["system"] + class azure.ai.projects.models.VersionSelector(_Model): + version_selection_rules: list[VersionSelectionRule] @overload def __init__( self, *, - description: Optional[str] = ..., - name: Union[str, VoiceAgentSystemToolName] + version_selection_rules: list[VersionSelectionRule] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentSystemToolName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - END_CONVERSATION = "end_conversation" + class azure.ai.projects.models.VersionSelectorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FIXED_RATIO = "FixedRatio" - class azure.ai.projects.models.VoiceAgentTemplateGreetingConfig(VoiceAgentGreetingConfig, discriminator='template'): - text: str - type: Literal["template"] + class azure.ai.projects.models.VoiceAgentAnimationConfig(_Model): + model_name: Optional[str] + outputs: Optional[list[Union[str, VoiceAgentAnimationOutputType]]] @overload def __init__( self, *, - text: str + model_name: Optional[str] = ..., + outputs: Optional[list[Union[str, VoiceAgentAnimationOutputType]]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentTool(_Model): - type: str + class azure.ai.projects.models.VoiceAgentAnimationOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BLENDSHAPES = "blendshapes" + VISEME_ID = "viseme_id" + + + class azure.ai.projects.models.VoiceAgentAudioConfig(_Model): + input: Optional[VoiceAgentAudioInputConfig] + output: Optional[VoiceAgentAudioOutputConfig] @overload def __init__( self, *, - type: str + input: Optional[VoiceAgentAudioInputConfig] = ..., + output: Optional[VoiceAgentAudioOutputConfig] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentToolResponseScheduling(str, Enum, metaclass=CaseInsensitiveEnumMeta): - INTERRUPT = "interrupt" - SILENT = "silent" - SKIP_IF_BUSY = "skip_if_busy" - WHEN_IDLE = "when_idle" - - - class azure.ai.projects.models.VoiceAgentToolboxTool(VoiceAgentTool, discriminator='toolbox'): - response_scheduling: Optional[Union[str, VoiceAgentToolResponseScheduling]] - toolbox_name: str - toolbox_version: str - type: Literal["toolbox"] + class azure.ai.projects.models.VoiceAgentAudioInputConfig(_Model): + echo_cancellation: Optional[VoiceAgentEchoCancellation] + format: Optional[RealtimeAudioFormats] + noise_reduction: Optional[VoiceAgentNoiseReduction] + transcription: Optional[VoiceAgentInputTranscription] + turn_detection: Optional[VoiceAgentTurnDetectionConfig] @overload def __init__( self, *, - response_scheduling: Optional[Union[str, VoiceAgentToolResponseScheduling]] = ..., - toolbox_name: str, - toolbox_version: str + echo_cancellation: Optional[VoiceAgentEchoCancellation] = ..., + format: Optional[RealtimeAudioFormats] = ..., + noise_reduction: Optional[VoiceAgentNoiseReduction] = ..., + transcription: Optional[VoiceAgentInputTranscription] = ..., + turn_detection: Optional[VoiceAgentTurnDetectionConfig] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentTranscriptionPhrase(_Model): - confidence: Optional[float] - duration_milliseconds: timedelta - locale: Optional[str] - offset_milliseconds: timedelta - text: str - words: Optional[list[VoiceAgentTranscriptionWord]] + class azure.ai.projects.models.VoiceAgentAudioOutputConfig(_Model): + custom_lexicon_url: Optional[str] + custom_text_normalization_url: Optional[str] + custom_voice_endpoint_id: Optional[str] + format: Optional[RealtimeAudioFormats] + output_audio_timestamp_types: Optional[list[Union[str, VoiceAgentAudioTimestampType]]] + personal_voice_model: Optional[str] + pitch: Optional[str] + prefer_locales: Optional[list[str]] + speed: Optional[float] + style: Optional[str] + voice: Optional[str] + voice_locale: Optional[str] + voice_temperature: Optional[float] + voice_type: Optional[Union[str, VoiceType]] + volume: Optional[str] @overload def __init__( self, *, - confidence: Optional[float] = ..., - duration_milliseconds: timedelta, - locale: Optional[str] = ..., - offset_milliseconds: timedelta, - text: str, - words: Optional[list[VoiceAgentTranscriptionWord]] = ... + custom_lexicon_url: Optional[str] = ..., + custom_text_normalization_url: Optional[str] = ..., + custom_voice_endpoint_id: Optional[str] = ..., + format: Optional[RealtimeAudioFormats] = ..., + output_audio_timestamp_types: Optional[list[Union[str, VoiceAgentAudioTimestampType]]] = ..., + personal_voice_model: Optional[str] = ..., + pitch: Optional[str] = ..., + prefer_locales: Optional[list[str]] = ..., + speed: Optional[float] = ..., + style: Optional[str] = ..., + voice: Optional[str] = ..., + voice_locale: Optional[str] = ..., + voice_temperature: Optional[float] = ..., + voice_type: Optional[Union[str, VoiceType]] = ..., + volume: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentTranscriptionWord(_Model): - duration_milliseconds: timedelta - offset_milliseconds: timedelta - text: str + class azure.ai.projects.models.VoiceAgentAudioTimestampType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + WORD = "word" + + + class azure.ai.projects.models.VoiceAgentAvatarConfig(_Model): + character: str + customized: Optional[bool] + model: Optional[str] + output_audit_audio: Optional[bool] + output_protocol: Optional[Union[str, VoiceAgentAvatarOutputProtocol]] + scene: Optional[VoiceAgentAvatarScene] + style: Optional[str] + type: Union[str, VoiceAgentAvatarType] + video: Optional[VoiceAgentAvatarVideoParams] @overload def __init__( self, *, - duration_milliseconds: timedelta, - offset_milliseconds: timedelta, - text: str + character: str, + customized: Optional[bool] = ..., + model: Optional[str] = ..., + output_audit_audio: Optional[bool] = ..., + output_protocol: Optional[Union[str, VoiceAgentAvatarOutputProtocol]] = ..., + scene: Optional[VoiceAgentAvatarScene] = ..., + style: Optional[str] = ..., + type: Union[str, VoiceAgentAvatarType], + video: Optional[VoiceAgentAvatarVideoParams] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentTurnDetectionConfig(_Model): - auto_truncate: Optional[bool] - type: str + class azure.ai.projects.models.VoiceAgentAvatarIceServer(_Model): + credential: Optional[str] + urls: list[str] + username: Optional[str] @overload def __init__( self, *, - auto_truncate: Optional[bool] = ..., - type: str + credential: Optional[str] = ..., + urls: list[str], + username: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentTurnDetectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AZURE_SEMANTIC_VAD = "azure_semantic_vad" - AZURE_SEMANTIC_VAD_EN = "azure_semantic_vad_en" - AZURE_SEMANTIC_VAD_MULTILINGUAL = "azure_semantic_vad_multilingual" - SEMANTIC_VAD = "semantic_vad" - SERVER_VAD = "server_vad" - - - class azure.ai.projects.models.VoiceAgentWebSocketSubprotocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - REALTIME = "realtime" - - - class azure.ai.projects.models.VoiceAudioCodec(str, Enum, metaclass=CaseInsensitiveEnumMeta): - PCM16 = "pcm16" - PCMA = "pcma" - PCMU = "pcmu" - - - class azure.ai.projects.models.VoiceAudioContainerFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): - WAV = "wav" - - - class azure.ai.projects.models.VoiceAudioRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AGENT = "agent" - USER = "user" + class azure.ai.projects.models.VoiceAgentAvatarOutputProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + WEBRTC = "webrtc" + WEBSOCKET = "websocket" + WEBSOCKET_BINARY = "websocket-binary" - class azure.ai.projects.models.VoiceConversation(_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[RealtimeResponseUsage] + class azure.ai.projects.models.VoiceAgentAvatarScene(_Model): + amplitude: Optional[float] + position_x: Optional[float] + position_y: Optional[float] + rotation_x: Optional[float] + rotation_y: Optional[float] + rotation_z: Optional[float] + zoom: Optional[float] @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[RealtimeResponseUsage] = ... + amplitude: Optional[float] = ..., + position_x: Optional[float] = ..., + position_y: Optional[float] = ..., + rotation_x: Optional[float] = ..., + rotation_y: Optional[float] = ..., + rotation_z: Optional[float] = ..., + zoom: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceConversationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - COMPLETED = "completed" - FAILED = "failed" - IN_PROGRESS = "in_progress" + class azure.ai.projects.models.VoiceAgentAvatarType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PHOTO_AVATAR = "photo_avatar" + VIDEO_AVATAR = "video_avatar" - class azure.ai.projects.models.VoiceItemAudioResponse(_Model): - blob_uri: Optional[str] - channels: Optional[int] - codec: Optional[Union[str, VoiceAudioCodec]] - conversation_id: str - duration_ms: Optional[timedelta] - format: Optional[Union[str, VoiceAudioContainerFormat]] - item_id: str - role: Optional[Union[str, VoiceAudioRole]] - sample_rate: Optional[int] - start_offset_ms: Optional[timedelta] + class azure.ai.projects.models.VoiceAgentAvatarVideoBackground(_Model): + color: Optional[str] + image_url: Optional[str] @overload def __init__( self, *, - blob_uri: Optional[str] = ..., - channels: Optional[int] = ..., - codec: Optional[Union[str, VoiceAudioCodec]] = ..., - conversation_id: str, - duration_ms: Optional[timedelta] = ..., - format: Optional[Union[str, VoiceAudioContainerFormat]] = ..., - item_id: str, - role: Optional[Union[str, VoiceAudioRole]] = ..., - sample_rate: Optional[int] = ..., - start_offset_ms: Optional[timedelta] = ... + color: Optional[str] = ..., + image_url: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceModelType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - MANAGED = "managed" - SELF_DEPLOYED = "self_deployed" - - - class azure.ai.projects.models.VoiceOutputModality(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ANIMATION = "animation" - AUDIO = "audio" - AVATAR = "avatar" - TEXT = "text" - - - class azure.ai.projects.models.VoiceRecordingChannelLayout(_Model): - left: Literal["user"] - right: Literal["agent"] - - def __init__( - self, - *args: Any, - **kwargs: Any - ) -> None: ... - - - class azure.ai.projects.models.VoiceRecordingResponse(_Model): - blob_uri: Optional[str] - channel_layout: VoiceRecordingChannelLayout - channels: int - conversation_id: str - duration_ms: timedelta - format: Union[str, VoiceAudioContainerFormat] - sample_rate: int + class azure.ai.projects.models.VoiceAgentAvatarVideoCrop(_Model): + bottom_right: list[int] + top_left: list[int] @overload def __init__( self, *, - blob_uri: Optional[str] = ..., - channel_layout: VoiceRecordingChannelLayout, - channels: int, - conversation_id: str, - duration_ms: timedelta, - format: Union[str, VoiceAudioContainerFormat], - sample_rate: int + bottom_right: list[int], + top_left: list[int] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceResponse(VoiceResponseBase): - audio: Optional[VoiceResponseAudio] - completed_at: Optional[datetime] - conversation_id: str - created_at: Optional[datetime] - id: str - max_output_tokens: Union[int, str] - metadata: Optional[dict[str, str]] - object: str - output: Optional[list[RealtimeConversationItem]] - output_modalities: Union[list[str, str]] - status: Union[str, str, str, str, str] - status_details: RealtimeResponseStatusDetails - temperature: Optional[float] - usage: RealtimeResponseUsage + class azure.ai.projects.models.VoiceAgentAvatarVideoParams(_Model): + background: Optional[VoiceAgentAvatarVideoBackground] + bitrate: Optional[int] + crop: Optional[VoiceAgentAvatarVideoCrop] + gop_size: Optional[int] + resolution: Optional[VoiceAgentAvatarVideoResolution] @overload def __init__( self, *, - audio: Optional[VoiceResponseAudio] = ..., - completed_at: Optional[datetime] = ..., - conversation_id: str, - created_at: Optional[datetime] = ..., - id: str, - max_output_tokens: Optional[Union[int, Literal[inf]]] = ..., - metadata: Optional[dict[str, str]] = ..., - object: Optional[Literal[response]] = ..., - output: Optional[list[RealtimeConversationItem]] = ..., - output_modalities: Optional[list[Literal[text, audio]]] = ..., - status: Optional[Literal[completed, cancelled, failed, incomplete, in_progress]] = ..., - status_details: Optional[RealtimeResponseStatusDetails] = ..., - temperature: Optional[float] = ..., - usage: Optional[RealtimeResponseUsage] = ... + background: Optional[VoiceAgentAvatarVideoBackground] = ..., + bitrate: Optional[int] = ..., + crop: Optional[VoiceAgentAvatarVideoCrop] = ..., + gop_size: Optional[int] = ..., + resolution: Optional[VoiceAgentAvatarVideoResolution] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceResponseAudio(_Model): - output: Optional[VoiceResponseAudioOutput] + class azure.ai.projects.models.VoiceAgentAvatarVideoResolution(_Model): + height: int + width: int @overload def __init__( self, *, - output: Optional[VoiceResponseAudioOutput] = ... + height: int, + width: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceResponseAudioOutput(_Model): - format: Optional[RealtimeAudioFormats] - voice: Optional[str] - voice_locale: Optional[str] - voice_type: Optional[Union[str, VoiceType]] + class azure.ai.projects.models.VoiceAgentAzureSemanticVadEnTurnDetection(VoiceAgentTurnDetectionConfig, discriminator='azure_semantic_vad_en'): + auto_truncate: bool + create_response: Optional[bool] + end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] + idle_timeout_ms: Optional[timedelta] + interrupt_response: Optional[bool] + prefix_padding_ms: Optional[timedelta] + remove_filler_words: Optional[bool] + silence_duration_ms: Optional[timedelta] + speech_duration_ms: Optional[timedelta] + threshold: Optional[float] + type: Literal[VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD_EN] @overload def __init__( self, *, - format: Optional[RealtimeAudioFormats] = ..., - voice: Optional[str] = ..., - voice_locale: Optional[str] = ..., - voice_type: Optional[Union[str, VoiceType]] = ... + auto_truncate: Optional[bool] = ..., + create_response: Optional[bool] = ..., + end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] = ..., + idle_timeout_ms: Optional[timedelta] = ..., + interrupt_response: Optional[bool] = ..., + prefix_padding_ms: Optional[timedelta] = ..., + remove_filler_words: Optional[bool] = ..., + silence_duration_ms: Optional[timedelta] = ..., + speech_duration_ms: Optional[timedelta] = ..., + threshold: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceResponseBase(_Model): - conversation_id: Optional[str] - id: Optional[str] - max_output_tokens: Optional[Union[int, Literal["inf"]]] - object: Optional[Literal["response"]] - output_modalities: Optional[list[Literal["text", "audio"]]] - status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] - status_details: Optional[RealtimeResponseStatusDetails] - usage: Optional[RealtimeResponseUsage] + class azure.ai.projects.models.VoiceAgentAzureSemanticVadMultilingualTurnDetection(VoiceAgentTurnDetectionConfig, discriminator='azure_semantic_vad_multilingual'): + auto_truncate: bool + create_response: Optional[bool] + end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] + idle_timeout_ms: Optional[timedelta] + interrupt_response: Optional[bool] + languages: Optional[list[str]] + prefix_padding_ms: Optional[timedelta] + remove_filler_words: Optional[bool] + silence_duration_ms: Optional[timedelta] + speech_duration_ms: Optional[timedelta] + threshold: Optional[float] + type: Literal[VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] @overload def __init__( self, *, - conversation_id: Optional[str] = ..., - id: Optional[str] = ..., - max_output_tokens: Optional[Union[int, Literal[inf]]] = ..., - object: Optional[Literal[response]] = ..., - output_modalities: Optional[list[Literal[text, audio]]] = ..., - status: Optional[Literal[completed, cancelled, failed, incomplete, in_progress]] = ..., - status_details: Optional[RealtimeResponseStatusDetails] = ..., - usage: Optional[RealtimeResponseUsage] = ... + auto_truncate: Optional[bool] = ..., + create_response: Optional[bool] = ..., + end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] = ..., + idle_timeout_ms: Optional[timedelta] = ..., + interrupt_response: Optional[bool] = ..., + languages: Optional[list[str]] = ..., + prefix_padding_ms: Optional[timedelta] = ..., + remove_filler_words: Optional[bool] = ..., + silence_duration_ms: Optional[timedelta] = ..., + speech_duration_ms: Optional[timedelta] = ..., + threshold: Optional[float] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AVATAR_VOICE_SYNC = "avatar-voice-sync" - AZURE_CUSTOM = "azure-custom" - AZURE_PERSONAL = "azure-personal" - AZURE_REALTIME_NATIVE = "azure-realtime-native" - AZURE_STANDARD = "azure-standard" - OPENAI = "openai" + class azure.ai.projects.models.VoiceAgentAzureSemanticVadTurnDetection(VoiceAgentTurnDetectionConfig, discriminator='azure_semantic_vad'): + auto_truncate: bool + create_response: Optional[bool] + end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] + idle_timeout_ms: Optional[timedelta] + interrupt_response: Optional[bool] + languages: Optional[list[str]] + prefix_padding_ms: Optional[timedelta] + remove_filler_words: Optional[bool] + silence_duration_ms: Optional[timedelta] + speech_duration_ms: Optional[timedelta] + threshold: Optional[float] + type: Literal[VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD] + + @overload + def __init__( + self, + *, + auto_truncate: Optional[bool] = ..., + create_response: Optional[bool] = ..., + end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] = ..., + idle_timeout_ms: Optional[timedelta] = ..., + interrupt_response: Optional[bool] = ..., + languages: Optional[list[str]] = ..., + prefix_padding_ms: Optional[timedelta] = ..., + remove_filler_words: Optional[bool] = ..., + silence_duration_ms: Optional[timedelta] = ..., + speech_duration_ms: Optional[timedelta] = ..., + threshold: Optional[float] = ... + ) -> None: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.WebIQPreviewTool(Tool, discriminator='web_iq_preview'): - project_connection_id: str - require_approval: Optional[Union[MCPToolRequireApproval, str]] - server_label: Optional[str] - type: Literal[ToolType.WEB_IQ_PREVIEW] + + class azure.ai.projects.models.VoiceAgentClientEventRtcCallSdpCreate(RealtimeClientEvent, discriminator='rtc.call.sdp.create'): + event_id: Optional[str] + sdp_offer: str + session: Optional[VoiceAgentSessionUpdateConfig] + type: Literal[RealtimeClientEventType.RTC_CALL_SDP_CREATE] @overload def __init__( self, *, - project_connection_id: str, - require_approval: Optional[Union[MCPToolRequireApproval, str]] = ..., - server_label: Optional[str] = ... + event_id: Optional[str] = ..., + sdp_offer: str, + session: Optional[VoiceAgentSessionUpdateConfig] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.WebIQPreviewToolboxTool(ToolboxTool, discriminator='web_iq_preview'): - description: str - name: str - project_connection_id: str - require_approval: Optional[Union[MCPToolRequireApproval, str]] - server_label: Optional[str] - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.WEB_IQ_PREVIEW] + class azure.ai.projects.models.VoiceAgentClientEventSessionAvatarConnect(RealtimeClientEvent, discriminator='session.avatar.connect'): + client_sdp: str + event_id: Optional[str] + type: Literal[RealtimeClientEventType.SESSION_AVATAR_CONNECT] @overload def __init__( self, *, - description: Optional[str] = ..., - name: Optional[str] = ..., - project_connection_id: str, - require_approval: Optional[Union[MCPToolRequireApproval, str]] = ..., - server_label: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + client_sdp: str, + event_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.WebSearchApproximateLocation(_Model): - city: Optional[str] - country: Optional[str] - region: Optional[str] - timezone: Optional[str] - type: Literal["approximate"] + class azure.ai.projects.models.VoiceAgentClientEventSessionUpdate(_Model): + event_id: Optional[str] + session: VoiceAgentSessionUpdateConfig + type: Literal[RealtimeClientEventType.SESSION_UPDATE] @overload def __init__( self, *, - city: Optional[str] = ..., - country: Optional[str] = ..., - region: Optional[str] = ..., - timezone: Optional[str] = ... + event_id: Optional[str] = ..., + session: VoiceAgentSessionUpdateConfig, + type: Literal[RealtimeClientEventType.SESSION_UPDATE] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.WebSearchConfiguration(_Model): - instance_name: str - project_connection_id: str + class azure.ai.projects.models.VoiceAgentDefinition(AgentDefinition, discriminator='voice'): + audio: Optional[VoiceAgentAudioConfig] + avatar: Optional[VoiceAgentAvatarConfig] + conversation_engine: Optional[VoiceConversationEngine] + greeting: Optional[VoiceAgentGreetingConfig] + include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] + instructions: Optional[str] + interim_response: Optional[VoiceAgentInterimResponseConfig] + kind: Literal[AgentKind.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]] + subagent_config: Optional[VoiceAgentSubAgentConfig] + tool_choice: Optional[VoiceAgentToolChoice] + tools: Optional[list[VoiceAgentTool]] @overload def __init__( self, *, - instance_name: str, - project_connection_id: str + audio: Optional[VoiceAgentAudioConfig] = ..., + avatar: Optional[VoiceAgentAvatarConfig] = ..., + conversation_engine: Optional[VoiceConversationEngine] = ..., + greeting: Optional[VoiceAgentGreetingConfig] = ..., + include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] = ..., + instructions: Optional[str] = ..., + interim_response: Optional[VoiceAgentInterimResponseConfig] = ..., + 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: Optional[RaiConfig] = ..., + store: Optional[bool] = ..., + structured_inputs: Optional[dict[str, StructuredInputDefinition]] = ..., + subagent_config: Optional[VoiceAgentSubAgentConfig] = ..., + tool_choice: Optional[VoiceAgentToolChoice] = ..., + tools: Optional[list[VoiceAgentTool]] = ... ) -> None: ... @overload 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] + class azure.ai.projects.models.VoiceAgentEchoCancellation(_Model): + channels: Optional[int] + reference_source: Optional[Union[str, VoiceAgentEchoCancellationReferenceSource]] + type: Literal["server_echo_cancellation"] @overload def __init__( self, *, - search_content_types: Optional[list[Union[str, SearchContentType]]] = ..., - search_context_size: Optional[Union[str, SearchContextSize]] = ..., - user_location: Optional[ApproximateLocation] = ... + channels: Optional[int] = ..., + reference_source: Optional[Union[str, VoiceAgentEchoCancellationReferenceSource]] = ... ) -> 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] + class azure.ai.projects.models.VoiceAgentEchoCancellationReferenceSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CLIENT = "client" + SERVER = "server" + + + class azure.ai.projects.models.VoiceAgentEndOfUtteranceDetection(_Model): + model: Union[str, VoiceAgentEndOfUtteranceDetectionModel] + threshold_level: Optional[Union[str, VoiceAgentEndOfUtteranceThresholdLevel]] + timeout_ms: Optional[timedelta] + + @overload + def __init__( + self, + *, + model: Union[str, VoiceAgentEndOfUtteranceDetectionModel], + threshold_level: Optional[Union[str, VoiceAgentEndOfUtteranceThresholdLevel]] = ..., + timeout_ms: Optional[timedelta] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentEndOfUtteranceDetectionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SEMANTIC_DETECTION_V1 = "semantic_detection_v1" + SEMANTIC_DETECTION_V1_EN = "semantic_detection_v1_en" + SEMANTIC_DETECTION_V1_MULTILINGUAL = "semantic_detection_v1_multilingual" + SMART_END_OF_TURN_DETECTION = "smart_end_of_turn_detection" + + + class azure.ai.projects.models.VoiceAgentEndOfUtteranceThresholdLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DEFAULT = "default" + HIGH = "high" + LOW = "low" + MEDIUM = "medium" + + + class azure.ai.projects.models.VoiceAgentFunctionTool(VoiceAgentTool, discriminator='function'): 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] + name: str + parameters: Optional[RealtimeFunctionToolParameters] + type: Literal["function"] @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] = ... + name: str, + parameters: Optional[RealtimeFunctionToolParameters] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.WebSearchToolFilters(_Model): - allowed_domains: Optional[list[str]] + class azure.ai.projects.models.VoiceAgentGreetingConfig(_Model): + type: str @overload def __init__( self, *, - allowed_domains: Optional[list[str]] = ... + type: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.WebSearchToolboxTool(ToolboxTool, discriminator='web_search'): - custom_search_configuration: Optional[WebSearchConfiguration] - description: str - external_web_access: Optional[bool] - filters: Optional[WebSearchToolFilters] - name: str - search_context_size: Optional[Literal["low", "medium", "high"]] - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.WEB_SEARCH] - user_location: Optional[WebSearchApproximateLocation] + class azure.ai.projects.models.VoiceAgentInputTranscription(_Model): + custom_speech: Optional[dict[str, str]] + delay: Optional[Literal["minimal", "low", "medium", "high", "xhigh"]] + keywords: Optional[list[str]] + language: Optional[str] + languages: Optional[list[str]] + model: Union[str, VoiceAgentInputTranscriptionModel] + phrase_list: Optional[list[str]] + prompt: Optional[str] + + @overload + def __init__( + self, + *, + custom_speech: Optional[dict[str, str]] = ..., + delay: Optional[Literal[minimal, low, medium, high, xhigh]] = ..., + keywords: Optional[list[str]] = ..., + language: Optional[str] = ..., + languages: Optional[list[str]] = ..., + model: Union[str, VoiceAgentInputTranscriptionModel], + phrase_list: Optional[list[str]] = ..., + prompt: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentInputTranscriptionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_SPEECH = "azure-speech" + GPT4_O_MINI_TRANSCRIBE = "gpt-4o-mini-transcribe" + GPT4_O_TRANSCRIBE = "gpt-4o-transcribe" + GPT4_O_TRANSCRIBE_DIARIZE = "gpt-4o-transcribe-diarize" + GPT_LIVE_TRANSCRIBE = "gpt-live-transcribe" + GPT_REALTIME_WHISPER = "gpt-realtime-whisper" + GPT_TRANSCRIBE = "gpt-transcribe" + MAI_TRANSCRIBE = "mai-transcribe" + WHISPER1 = "whisper-1" + + + class azure.ai.projects.models.VoiceAgentInterimResponseConfig(_Model): + latency_threshold_ms: Optional[timedelta] + triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] + type: str + + @overload + def __init__( + self, + *, + latency_threshold_ms: Optional[timedelta] = ..., + triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] = ..., + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentInterimResponseTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LATENCY = "latency" + TOOL = "tool" + + + class azure.ai.projects.models.VoiceAgentLlmGeneratedGreetingConfig(VoiceAgentGreetingConfig, discriminator='llm_generated'): + prompt: str + tool_choice: Optional[VoiceAgentToolChoice] + type: Literal["llm_generated"] + + @overload + def __init__( + self, + *, + prompt: str, + tool_choice: Optional[VoiceAgentToolChoice] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentLlmInterimResponseConfig(VoiceAgentInterimResponseConfig, discriminator='llm_interim_response'): + instructions: Optional[str] + latency_threshold_ms: timedelta + max_completion_tokens: Optional[int] + model: Optional[str] + triggers: Union[list[str, VoiceAgentInterimResponseTrigger]] + type: Literal["llm_interim_response"] + + @overload + def __init__( + self, + *, + instructions: Optional[str] = ..., + latency_threshold_ms: Optional[timedelta] = ..., + max_completion_tokens: Optional[int] = ..., + model: Optional[str] = ..., + triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentMcpTool(VoiceAgentTool, discriminator='mcp'): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] + allowed_tools: Optional[Union[list[str], MCPToolFilter]] + authorization: Optional[str] + defer_loading: Optional[bool] + headers: Optional[dict[str, str]] + project_connection_id: Optional[str] + require_approval: Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] + response_scheduling: Optional[Union[str, VoiceAgentToolResponseScheduling]] + server_description: Optional[str] + server_label: str + server_url: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal["mcp"] + + @overload + def __init__( + self, + *, + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., + allowed_tools: Optional[Union[list[str], MCPToolFilter]] = ..., + authorization: Optional[str] = ..., + defer_loading: Optional[bool] = ..., + headers: Optional[dict[str, str]] = ..., + project_connection_id: Optional[str] = ..., + require_approval: Optional[Union[MCPToolRequireApproval, Literal[always], Literal[never]]] = ..., + response_scheduling: Optional[Union[str, VoiceAgentToolResponseScheduling]] = ..., + server_description: Optional[str] = ..., + server_label: str, + server_url: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentNoiseReduction(_Model): + type: Union[str, VoiceAgentNoiseReductionType] + + @overload + def __init__( + self, + *, + type: Union[str, VoiceAgentNoiseReductionType] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentNoiseReductionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_DEEP_NOISE_SUPPRESSION = "azure_deep_noise_suppression" + FAR_FIELD = "far_field" + NEAR_FIELD = "near_field" + + + class azure.ai.projects.models.VoiceAgentRealtimeResponse(VoiceAgentRealtimeResponseBase): + audio: Optional[VoiceResponseAudio] + conversation_id: str + id: str + max_output_tokens: Union[int, str] + metadata: Metadata + object: str + output: Optional[list[RealtimeConversationItem]] + output_modalities: Union[list[str, str]] + status: Union[str, str, str, str, str] + status_details: RealtimeResponseStatusDetails + usage: RealtimeResponseUsage + + @overload + def __init__( + self, + *, + audio: Optional[VoiceResponseAudio] = ..., + conversation_id: Optional[str] = ..., + id: Optional[str] = ..., + max_output_tokens: Optional[Union[int, Literal[inf]]] = ..., + metadata: Optional[Metadata] = ..., + object: Optional[Literal[response]] = ..., + output: Optional[list[RealtimeConversationItem]] = ..., + output_modalities: Optional[list[Literal[text, audio]]] = ..., + status: Optional[Literal[completed, cancelled, failed, incomplete, in_progress]] = ..., + status_details: Optional[RealtimeResponseStatusDetails] = ..., + usage: Optional[RealtimeResponseUsage] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentRealtimeResponseBase(_Model): + conversation_id: Optional[str] + id: Optional[str] + max_output_tokens: Optional[Union[int, Literal["inf"]]] + metadata: Optional[Metadata] + object: Optional[Literal["response"]] + output_modalities: Optional[list[Literal["text", "audio"]]] + status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] + status_details: Optional[RealtimeResponseStatusDetails] + usage: Optional[RealtimeResponseUsage] + + @overload + def __init__( + self, + *, + conversation_id: Optional[str] = ..., + id: Optional[str] = ..., + max_output_tokens: Optional[Union[int, Literal[inf]]] = ..., + metadata: Optional[Metadata] = ..., + object: Optional[Literal[response]] = ..., + output_modalities: Optional[list[Literal[text, audio]]] = ..., + status: Optional[Literal[completed, cancelled, failed, incomplete, in_progress]] = ..., + status_details: Optional[RealtimeResponseStatusDetails] = ..., + usage: Optional[RealtimeResponseUsage] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentResponseCreateParams(_Model): + audio: Optional[PickPropertiesVoiceAgentAudioConfig] + conversation: Optional[Union[Literal["auto"], Literal["none"], str]] + input: Optional[list[RealtimeConversationItem]] + instructions: Optional[str] + interim_response: Optional[VoiceAgentInterimResponseConfig] + max_output_tokens: Optional[Union[int, Literal["inf"]]] + metadata: Optional[Metadata] + output_modalities: Optional[list[Union[str, VoiceOutputModality]]] + parallel_tool_calls: Optional[bool] + pre_generated_assistant_message: Optional[RealtimeConversationItem] + reasoning: Optional[RealtimeReasoning] + tool_choice: Optional[Union[str, ToolChoiceOptions, ToolChoiceFunction, ToolChoiceMCP]] + tools: Optional[list[Union[RealtimeFunctionTool, MCPTool]]] + + @overload + def __init__( + self, + *, + audio: Optional[PickPropertiesVoiceAgentAudioConfig] = ..., + conversation: Optional[Union[Literal[auto], Literal[none], str]] = ..., + input: Optional[list[RealtimeConversationItem]] = ..., + instructions: Optional[str] = ..., + interim_response: Optional[VoiceAgentInterimResponseConfig] = ..., + max_output_tokens: Optional[Union[int, Literal[inf]]] = ..., + metadata: Optional[Metadata] = ..., + output_modalities: Optional[list[Union[str, VoiceOutputModality]]] = ..., + parallel_tool_calls: Optional[bool] = ..., + pre_generated_assistant_message: Optional[RealtimeConversationItem] = ..., + reasoning: Optional[RealtimeReasoning] = ..., + tool_choice: Optional[Union[str, ToolChoiceOptions, ToolChoiceFunction, ToolChoiceMCP]] = ..., + tools: Optional[list[Union[RealtimeFunctionTool, MCPTool]]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentRtcCallErrorDetails(_Model): + code: Optional[str] + message: str + type: str + + @overload + def __init__( + self, + *, + code: Optional[str] = ..., + message: str, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentSemanticVadTurnDetection(VoiceAgentTurnDetectionConfig, discriminator='semantic_vad'): + auto_truncate: bool + create_response: Optional[bool] + eagerness: Optional[Literal["low", "medium", "high", "auto"]] + interrupt_response: Optional[bool] + type: Literal[VoiceAgentTurnDetectionType.SEMANTIC_VAD] + + @overload + def __init__( + self, + *, + auto_truncate: Optional[bool] = ..., + create_response: Optional[bool] = ..., + eagerness: Optional[Literal[low, medium, high, auto]] = ..., + interrupt_response: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventResponseAnimationBlendshapesDelta(RealtimeServerEvent, discriminator='response.animation_blendshapes.delta'): + content_index: int + event_id: str + frame_index: int + frames: list[list[float]] + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_ANIMATION_BLENDSHAPES_DELTA] + + @overload + def __init__( + self, + *, + content_index: int, + event_id: str, + frame_index: int, + frames: list[list[float]], + item_id: str, + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventResponseAnimationBlendshapesDone(RealtimeServerEvent, discriminator='response.animation_blendshapes.done'): + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_ANIMATION_BLENDSHAPES_DONE] + + @overload + def __init__( + self, + *, + event_id: str, + item_id: str, + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventResponseAnimationVisemeDelta(RealtimeServerEvent, discriminator='response.animation_viseme.delta'): + audio_offset_ms: timedelta + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_ANIMATION_VISEME_DELTA] + viseme_id: int + + @overload + def __init__( + self, + *, + audio_offset_ms: timedelta, + content_index: int, + event_id: str, + item_id: str, + output_index: int, + response_id: str, + viseme_id: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventResponseAnimationVisemeDone(RealtimeServerEvent, discriminator='response.animation_viseme.done'): + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_ANIMATION_VISEME_DONE] + + @overload + def __init__( + self, + *, + content_index: int, + event_id: str, + item_id: str, + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventResponseAudioTimestampDelta(RealtimeServerEvent, discriminator='response.audio_timestamp.delta'): + audio_duration_ms: timedelta + audio_offset_ms: timedelta + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + text: str + timestamp_type: Literal["word"] + type: Literal[RealtimeServerEventType.RESPONSE_AUDIO_TIMESTAMP_DELTA] + + @overload + def __init__( + self, + *, + audio_duration_ms: timedelta, + audio_offset_ms: timedelta, + content_index: int, + event_id: str, + item_id: str, + output_index: int, + response_id: str, + text: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventResponseAudioTimestampDone(RealtimeServerEvent, discriminator='response.audio_timestamp.done'): + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[RealtimeServerEventType.RESPONSE_AUDIO_TIMESTAMP_DONE] + + @overload + def __init__( + self, + *, + content_index: int, + event_id: str, + item_id: str, + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventResponseVideoDelta(RealtimeServerEvent, discriminator='response.video.delta'): + codec: str + delta: str + event_id: str + output_index: int + type: Literal[RealtimeServerEventType.RESPONSE_VIDEO_DELTA] + + @overload + def __init__( + self, + *, + codec: str, + delta: str, + event_id: str, + output_index: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventRtcCallError(RealtimeServerEvent, discriminator='rtc.call.error'): + error: VoiceAgentRtcCallErrorDetails + event_id: Optional[str] + operation: Optional[str] + rtc_call_id: Optional[str] + type: Literal[RealtimeServerEventType.RTC_CALL_ERROR] + + @overload + def __init__( + self, + *, + error: VoiceAgentRtcCallErrorDetails, + event_id: Optional[str] = ..., + operation: Optional[str] = ..., + rtc_call_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventRtcCallSdpCreated(RealtimeServerEvent, discriminator='rtc.call.sdp.created'): + event_id: str + rtc_call_id: str + sdp_answer: str + type: Literal[RealtimeServerEventType.RTC_CALL_SDP_CREATED] + + @overload + def __init__( + self, + *, + event_id: str, + rtc_call_id: str, + sdp_answer: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventSessionAvatarConnecting(RealtimeServerEvent, discriminator='session.avatar.connecting'): + event_id: str + server_sdp: str + type: Literal[RealtimeServerEventType.SESSION_AVATAR_CONNECTING] + + @overload + def __init__( + self, + *, + event_id: str, + server_sdp: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventSessionAvatarSwitchToIdle(RealtimeServerEvent, discriminator='session.avatar.switch_to_idle'): + event_id: str + turn_id: Optional[str] + type: Literal[RealtimeServerEventType.SESSION_AVATAR_SWITCH_TO_IDLE] + + @overload + def __init__( + self, + *, + event_id: str, + turn_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventSessionAvatarSwitchToSpeaking(RealtimeServerEvent, discriminator='session.avatar.switch_to_speaking'): + event_id: str + turn_id: Optional[str] + type: Literal[RealtimeServerEventType.SESSION_AVATAR_SWITCH_TO_SPEAKING] + + @overload + def __init__( + self, + *, + event_id: str, + turn_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventSessionSubagentAborted(RealtimeServerEvent, discriminator='session.subagent.aborted'): + call_id: str + consultation_id: str + event_id: str + reason: Union[str, VoiceAgentSubagentAbortReason] + subagent_name: str + type: Literal[RealtimeServerEventType.SESSION_SUBAGENT_ABORTED] + + @overload + def __init__( + self, + *, + call_id: str, + consultation_id: str, + event_id: str, + reason: Union[str, VoiceAgentSubagentAbortReason], + subagent_name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventSessionSubagentCompleted(RealtimeServerEvent, discriminator='session.subagent.completed'): + call_id: str + consultation_id: str + event_id: str + subagent_name: str + type: Literal[RealtimeServerEventType.SESSION_SUBAGENT_COMPLETED] + + @overload + def __init__( + self, + *, + call_id: str, + consultation_id: str, + event_id: str, + subagent_name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventSessionSubagentStarted(RealtimeServerEvent, discriminator='session.subagent.started'): + call_id: str + consultation_id: str + event_id: str + subagent_name: str + type: Literal[RealtimeServerEventType.SESSION_SUBAGENT_STARTED] + + @overload + def __init__( + self, + *, + call_id: str, + consultation_id: str, + event_id: str, + subagent_name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventWarning(RealtimeServerEvent, discriminator='warning'): + event_id: str + type: Literal[RealtimeServerEventType.WARNING] + warning: VoiceAgentServerEventWarningDetails + + @overload + def __init__( + self, + *, + event_id: str, + warning: VoiceAgentServerEventWarningDetails + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerEventWarningDetails(_Model): + code: Optional[str] + message: str + param: Optional[str] + + @overload + def __init__( + self, + *, + code: Optional[str] = ..., + message: str, + param: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentServerVadTurnDetection(VoiceAgentTurnDetectionConfig, discriminator='server_vad'): + auto_truncate: bool + create_response: Optional[bool] + end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] + idle_timeout_ms: Optional[int] + interrupt_response: Optional[bool] + prefix_padding_ms: Optional[int] + silence_duration_ms: Optional[int] + speech_duration_ms: Optional[timedelta] + threshold: Optional[float] + type: Literal[VoiceAgentTurnDetectionType.SERVER_VAD] + + @overload + def __init__( + self, + *, + auto_truncate: Optional[bool] = ..., + create_response: Optional[bool] = ..., + end_of_utterance_detection: Optional[VoiceAgentEndOfUtteranceDetection] = ..., + idle_timeout_ms: Optional[int] = ..., + interrupt_response: Optional[bool] = ..., + prefix_padding_ms: Optional[int] = ..., + silence_duration_ms: Optional[int] = ..., + speech_duration_ms: Optional[timedelta] = ..., + threshold: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentSessionAvatarConfig(VoiceAgentAvatarConfig): + character: str + customized: bool + ice_servers: Optional[list[VoiceAgentAvatarIceServer]] + model: str + output_audit_audio: bool + output_protocol: Union[str, VoiceAgentAvatarOutputProtocol] + scene: VoiceAgentAvatarScene + style: str + type: Union[str, VoiceAgentAvatarType] + video: VoiceAgentAvatarVideoParams + + @overload + def __init__( + self, + *, + character: str, + customized: Optional[bool] = ..., + ice_servers: Optional[list[VoiceAgentAvatarIceServer]] = ..., + model: Optional[str] = ..., + output_audit_audio: Optional[bool] = ..., + output_protocol: Optional[Union[str, VoiceAgentAvatarOutputProtocol]] = ..., + scene: Optional[VoiceAgentAvatarScene] = ..., + style: Optional[str] = ..., + type: Union[str, VoiceAgentAvatarType], + video: Optional[VoiceAgentAvatarVideoParams] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentSessionIncludeOption(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FILE_SEARCH_CALL_RESULTS = "file_search_call.results" + INPUT_AUDIO_TRANSCRIPTION_LOGPROBS = "item.input_audio_transcription.logprobs" + INPUT_AUDIO_TRANSCRIPTION_PHRASES = "item.input_audio_transcription.phrases" + + + class azure.ai.projects.models.VoiceAgentSessionResponseConfig(_Model): + animation: Optional[VoiceAgentAnimationConfig] + audio: Optional[VoiceAgentAudioConfig] + avatar: Optional[VoiceAgentSessionAvatarConfig] + expires_at: Optional[datetime] + greeting: Optional[VoiceAgentGreetingConfig] + id: str + include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] + instructions: Optional[str] + interim_response: Optional[VoiceAgentInterimResponseConfig] + max_output_tokens: Optional[VoiceAgentMaxOutputTokens] + metadata: Optional[dict[str, str]] + model: str + object: Literal["session"] + output_modalities: Optional[list[Union[str, VoiceOutputModality]]] + parallel_tool_calls: Optional[bool] + reasoning: Optional[RealtimeReasoning] + temperature: Optional[float] + tool_choice: Optional[VoiceAgentToolChoice] + tools: Optional[list[VoiceAgentTool]] + type: Literal["realtime"] + + @overload + def __init__( + self, + *, + animation: Optional[VoiceAgentAnimationConfig] = ..., + audio: Optional[VoiceAgentAudioConfig] = ..., + avatar: Optional[VoiceAgentSessionAvatarConfig] = ..., + expires_at: Optional[datetime] = ..., + greeting: Optional[VoiceAgentGreetingConfig] = ..., + id: str, + include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] = ..., + instructions: Optional[str] = ..., + interim_response: Optional[VoiceAgentInterimResponseConfig] = ..., + max_output_tokens: Optional[VoiceAgentMaxOutputTokens] = ..., + metadata: Optional[dict[str, str]] = ..., + model: str, + output_modalities: Optional[list[Union[str, VoiceOutputModality]]] = ..., + parallel_tool_calls: Optional[bool] = ..., + reasoning: Optional[RealtimeReasoning] = ..., + temperature: Optional[float] = ..., + tool_choice: Optional[VoiceAgentToolChoice] = ..., + tools: Optional[list[VoiceAgentTool]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentSessionUpdateConfig(_Model): + animation: Optional[VoiceAgentAnimationConfig] + audio: Optional[VoiceAgentAudioConfig] + avatar: Optional[VoiceAgentSessionAvatarConfig] + greeting: Optional[VoiceAgentGreetingConfig] + include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] + instructions: Optional[str] + interim_response: Optional[VoiceAgentInterimResponseConfig] + max_output_tokens: Optional[VoiceAgentMaxOutputTokens] + metadata: Optional[dict[str, str]] + output_modalities: Optional[list[Union[str, VoiceOutputModality]]] + parallel_tool_calls: Optional[bool] + reasoning: Optional[RealtimeReasoning] + temperature: Optional[float] + tool_choice: Optional[VoiceAgentToolChoice] + tools: Optional[list[VoiceAgentTool]] + type: Literal["realtime"] + + @overload + def __init__( + self, + *, + animation: Optional[VoiceAgentAnimationConfig] = ..., + audio: Optional[VoiceAgentAudioConfig] = ..., + avatar: Optional[VoiceAgentSessionAvatarConfig] = ..., + greeting: Optional[VoiceAgentGreetingConfig] = ..., + include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] = ..., + instructions: Optional[str] = ..., + interim_response: Optional[VoiceAgentInterimResponseConfig] = ..., + max_output_tokens: Optional[VoiceAgentMaxOutputTokens] = ..., + metadata: Optional[dict[str, str]] = ..., + output_modalities: Optional[list[Union[str, VoiceOutputModality]]] = ..., + parallel_tool_calls: Optional[bool] = ..., + reasoning: Optional[RealtimeReasoning] = ..., + temperature: Optional[float] = ..., + tool_choice: Optional[VoiceAgentToolChoice] = ..., + tools: Optional[list[VoiceAgentTool]] = ... + ) -> 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]] + triggers: Union[list[str, VoiceAgentInterimResponseTrigger]] + type: Literal["static_interim_response"] + + @overload + def __init__( + self, + *, + latency_threshold_ms: Optional[timedelta] = ..., + texts: Optional[list[str]] = ..., + triggers: Optional[list[Union[str, VoiceAgentInterimResponseTrigger]]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentSubAgent(_Model): + agent_capabilities: str + agent_name: str + agent_version: Optional[str] + invoke_timeout_seconds: Optional[timedelta] + response_policy: Optional[VoiceAgentSubagentResponsePolicy] + + @overload + def __init__( + self, + *, + agent_capabilities: str, + agent_name: str, + agent_version: Optional[str] = ..., + invoke_timeout_seconds: Optional[timedelta] = ..., + response_policy: Optional[VoiceAgentSubagentResponsePolicy] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentSubAgentConfig(_Model): + subagents: list[VoiceAgentSubAgent] + + @overload + def __init__( + self, + *, + subagents: list[VoiceAgentSubAgent] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentSubagentAbortReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELLED = "cancelled" + FAILED = "failed" + STOPPED_BY_USER = "stopped_by_user" + SUPERSEDED = "superseded" + TIMEOUT = "timeout" + UNKNOWN_TARGET = "unknown_target" + + + class azure.ai.projects.models.VoiceAgentSubagentResponsePolicy(_Model): + ack_instructions: Optional[str] + enable_delta_progress: Optional[bool] + gap_filling_instructions: Optional[str] + gap_filling_interval: Optional[timedelta] + immediate_ack: Optional[bool] + progress_instructions: Optional[str] + progress_update_interval: Optional[timedelta] + + @overload + def __init__( + self, + *, + ack_instructions: Optional[str] = ..., + enable_delta_progress: Optional[bool] = ..., + gap_filling_instructions: Optional[str] = ..., + gap_filling_interval: Optional[timedelta] = ..., + immediate_ack: Optional[bool] = ..., + progress_instructions: Optional[str] = ..., + progress_update_interval: Optional[timedelta] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentSystemTool(VoiceAgentTool, discriminator='system'): + description: Optional[str] + name: Union[str, VoiceAgentSystemToolName] + type: Literal["system"] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + name: Union[str, VoiceAgentSystemToolName] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentSystemToolName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + END_CONVERSATION = "end_conversation" + + + class azure.ai.projects.models.VoiceAgentTemplateGreetingConfig(VoiceAgentGreetingConfig, discriminator='template'): + text: str + type: Literal["template"] + + @overload + def __init__( + self, + *, + text: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentTool(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentToolResponseScheduling(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INTERRUPT = "interrupt" + SILENT = "silent" + SKIP_IF_BUSY = "skip_if_busy" + WHEN_IDLE = "when_idle" + + + class azure.ai.projects.models.VoiceAgentToolboxTool(VoiceAgentTool, discriminator='toolbox'): + response_scheduling: Optional[Union[str, VoiceAgentToolResponseScheduling]] + toolbox_name: str + toolbox_version: str + type: Literal["toolbox"] + + @overload + def __init__( + self, + *, + response_scheduling: Optional[Union[str, VoiceAgentToolResponseScheduling]] = ..., + toolbox_name: str, + toolbox_version: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentTranscriptionPhrase(_Model): + confidence: Optional[float] + duration_milliseconds: timedelta + locale: Optional[str] + offset_milliseconds: timedelta + text: str + words: Optional[list[VoiceAgentTranscriptionWord]] + + @overload + def __init__( + self, + *, + confidence: Optional[float] = ..., + duration_milliseconds: timedelta, + locale: Optional[str] = ..., + offset_milliseconds: timedelta, + text: str, + words: Optional[list[VoiceAgentTranscriptionWord]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentTranscriptionWord(_Model): + duration_milliseconds: timedelta + offset_milliseconds: timedelta + text: str + + @overload + def __init__( + self, + *, + duration_milliseconds: timedelta, + offset_milliseconds: timedelta, + text: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentTransport(str, Enum, metaclass=CaseInsensitiveEnumMeta): + WEBRTC = "webrtc" + WEBSOCKET = "websocket" + + + class azure.ai.projects.models.VoiceAgentTurnDetectionConfig(_Model): + auto_truncate: Optional[bool] + type: str + + @overload + def __init__( + self, + *, + auto_truncate: Optional[bool] = ..., + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentTurnDetectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_SEMANTIC_VAD = "azure_semantic_vad" + AZURE_SEMANTIC_VAD_EN = "azure_semantic_vad_en" + AZURE_SEMANTIC_VAD_MULTILINGUAL = "azure_semantic_vad_multilingual" + SEMANTIC_VAD = "semantic_vad" + SERVER_VAD = "server_vad" + + + class azure.ai.projects.models.VoiceAgentWebSocketSubprotocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + REALTIME = "realtime" + + + class azure.ai.projects.models.VoiceAudioCodec(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PCM16 = "pcm16" + PCMA = "pcma" + PCMU = "pcmu" + + + class azure.ai.projects.models.VoiceAudioContainerFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): + WAV = "wav" + + + class azure.ai.projects.models.VoiceAudioRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT = "agent" + USER = "user" + + + class azure.ai.projects.models.VoiceConversation(_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[RealtimeResponseUsage] + + @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[RealtimeResponseUsage] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceConversationEngine(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceConversationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMPLETED = "completed" + FAILED = "failed" + IN_PROGRESS = "in_progress" + + + class azure.ai.projects.models.VoiceGeneratedItemAudioResponse(_Model): + blob_uri: Optional[str] + channels: Optional[int] + codec: Optional[Union[str, VoiceAudioCodec]] + conversation_id: str + duration_ms: Optional[timedelta] + format: Optional[Union[str, VoiceAudioContainerFormat]] + item_id: str + role: Optional[Union[str, VoiceAudioRole]] + sample_rate: Optional[int] + start_offset_ms: Optional[timedelta] + + @overload + def __init__( + self, + *, + blob_uri: Optional[str] = ..., + channels: Optional[int] = ..., + codec: Optional[Union[str, VoiceAudioCodec]] = ..., + conversation_id: str, + duration_ms: Optional[timedelta] = ..., + format: Optional[Union[str, VoiceAudioContainerFormat]] = ..., + item_id: str, + role: Optional[Union[str, VoiceAudioRole]] = ..., + sample_rate: Optional[int] = ..., + start_offset_ms: Optional[timedelta] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceHostedAgentConversationEngine(VoiceConversationEngine, discriminator='hosted_agent'): + name: str + type: Literal["hosted_agent"] + version: Optional[str] + + @overload + def __init__( + self, + *, + name: str, + version: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceItemAudioResponse(_Model): + blob_uri: Optional[str] + channels: Optional[int] + codec: Optional[Union[str, VoiceAudioCodec]] + conversation_id: str + duration_ms: Optional[timedelta] + format: Optional[Union[str, VoiceAudioContainerFormat]] + item_id: str + role: Optional[Union[str, VoiceAudioRole]] + sample_rate: Optional[int] + start_offset_ms: Optional[timedelta] + + @overload + def __init__( + self, + *, + blob_uri: Optional[str] = ..., + channels: Optional[int] = ..., + codec: Optional[Union[str, VoiceAudioCodec]] = ..., + conversation_id: str, + duration_ms: Optional[timedelta] = ..., + format: Optional[Union[str, VoiceAudioContainerFormat]] = ..., + item_id: str, + role: Optional[Union[str, VoiceAudioRole]] = ..., + sample_rate: Optional[int] = ..., + start_offset_ms: Optional[timedelta] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceModelType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MANAGED = "managed" + SELF_DEPLOYED = "self_deployed" + + + class azure.ai.projects.models.VoiceOutputModality(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ANIMATION = "animation" + AUDIO = "audio" + AVATAR = "avatar" + TEXT = "text" + + + class azure.ai.projects.models.VoiceRecordingChannelLayout(_Model): + left: Literal["user"] + right: Literal["agent"] + + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... + + + class azure.ai.projects.models.VoiceRecordingResponse(_Model): + blob_uri: Optional[str] + channel_layout: VoiceRecordingChannelLayout + channels: int + conversation_id: str + duration_ms: timedelta + format: Union[str, VoiceAudioContainerFormat] + sample_rate: int + + @overload + def __init__( + self, + *, + blob_uri: Optional[str] = ..., + channel_layout: VoiceRecordingChannelLayout, + channels: int, + conversation_id: str, + duration_ms: timedelta, + format: Union[str, VoiceAudioContainerFormat], + sample_rate: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceResponse(VoiceResponseBase): + audio: Optional[VoiceResponseAudio] + completed_at: Optional[datetime] + conversation_id: str + created_at: Optional[datetime] + id: str + max_output_tokens: Union[int, str] + metadata: Optional[dict[str, str]] + object: str + output: Optional[list[RealtimeConversationItem]] + output_modalities: Union[list[str, str]] + status: Union[str, str, str, str, str] + status_details: RealtimeResponseStatusDetails + temperature: Optional[float] + usage: RealtimeResponseUsage + + @overload + def __init__( + self, + *, + audio: Optional[VoiceResponseAudio] = ..., + completed_at: Optional[datetime] = ..., + conversation_id: str, + created_at: Optional[datetime] = ..., + id: str, + max_output_tokens: Optional[Union[int, Literal[inf]]] = ..., + metadata: Optional[dict[str, str]] = ..., + object: Optional[Literal[response]] = ..., + output: Optional[list[RealtimeConversationItem]] = ..., + output_modalities: Optional[list[Literal[text, audio]]] = ..., + status: Optional[Literal[completed, cancelled, failed, incomplete, in_progress]] = ..., + status_details: Optional[RealtimeResponseStatusDetails] = ..., + temperature: Optional[float] = ..., + usage: Optional[RealtimeResponseUsage] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceResponseAudio(_Model): + output: Optional[VoiceResponseAudioOutput] + + @overload + def __init__( + self, + *, + output: Optional[VoiceResponseAudioOutput] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceResponseAudioOutput(_Model): + format: Optional[RealtimeAudioFormats] + voice: Optional[str] + voice_locale: Optional[str] + voice_type: Optional[Union[str, VoiceType]] + + @overload + def __init__( + self, + *, + format: Optional[RealtimeAudioFormats] = ..., + voice: Optional[str] = ..., + voice_locale: Optional[str] = ..., + voice_type: Optional[Union[str, VoiceType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceResponseBase(_Model): + conversation_id: Optional[str] + id: Optional[str] + max_output_tokens: Optional[Union[int, Literal["inf"]]] + object: Optional[Literal["response"]] + output_modalities: Optional[list[Literal["text", "audio"]]] + status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] + status_details: Optional[RealtimeResponseStatusDetails] + usage: Optional[RealtimeResponseUsage] + + @overload + def __init__( + self, + *, + conversation_id: Optional[str] = ..., + id: Optional[str] = ..., + max_output_tokens: Optional[Union[int, Literal[inf]]] = ..., + object: Optional[Literal[response]] = ..., + output_modalities: Optional[list[Literal[text, audio]]] = ..., + status: Optional[Literal[completed, cancelled, failed, incomplete, in_progress]] = ..., + status_details: Optional[RealtimeResponseStatusDetails] = ..., + usage: Optional[RealtimeResponseUsage] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AVATAR_VOICE_SYNC = "avatar-voice-sync" + AZURE_CUSTOM = "azure-custom" + AZURE_PERSONAL = "azure-personal" + AZURE_REALTIME_NATIVE = "azure-realtime-native" + AZURE_STANDARD = "azure-standard" + OPENAI = "openai" + + + class azure.ai.projects.models.WebIQPreviewTool(Tool, discriminator='web_iq_preview'): + project_connection_id: str + require_approval: Optional[Union[MCPToolRequireApproval, str]] + server_label: Optional[str] + type: Literal[ToolType.WEB_IQ_PREVIEW] + + @overload + def __init__( + self, + *, + project_connection_id: str, + require_approval: Optional[Union[MCPToolRequireApproval, str]] = ..., + server_label: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.WebIQPreviewToolboxTool(ToolboxTool, discriminator='web_iq_preview'): + description: str + name: str + project_connection_id: str + require_approval: Optional[Union[MCPToolRequireApproval, str]] + server_label: Optional[str] + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.WEB_IQ_PREVIEW] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + name: Optional[str] = ..., + project_connection_id: str, + require_approval: Optional[Union[MCPToolRequireApproval, str]] = ..., + server_label: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.WebSearchApproximateLocation(_Model): + city: Optional[str] + country: Optional[str] + region: Optional[str] + timezone: Optional[str] + type: Literal["approximate"] + + @overload + def __init__( + self, + *, + city: Optional[str] = ..., + country: Optional[str] = ..., + region: Optional[str] = ..., + timezone: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.WebSearchConfiguration(_Model): + instance_name: str + project_connection_id: str + + @overload + def __init__( + self, + *, + instance_name: str, + project_connection_id: str + ) -> None: ... + + @overload + 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]] + + @overload + def __init__( + self, + *, + allowed_domains: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.WebSearchToolboxTool(ToolboxTool, discriminator='web_search'): + custom_search_configuration: Optional[WebSearchConfiguration] + description: str + external_web_access: Optional[bool] + filters: Optional[WebSearchToolFilters] + name: str + search_context_size: Optional[Literal["low", "medium", "high"]] + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.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.WeeklyRecurrenceSchedule(RecurrenceSchedule, discriminator='Weekly'): + days_of_week: list[Union[str, DayOfWeek]] + type: Literal[RecurrenceType.WEEKLY] + + @overload + def __init__( + self, + *, + days_of_week: list[Union[str, DayOfWeek]] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.WorkIQPreviewTool(Tool, discriminator='work_iq_preview'): + project_connection_id: str + type: Literal[ToolType.WORK_IQ_PREVIEW] + + @overload + def __init__( + self, + *, + project_connection_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.WorkIQPreviewToolboxTool(ToolboxTool, discriminator='work_iq_preview'): + description: str + name: str + project_connection_id: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.WORK_IQ_PREVIEW] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + name: Optional[str] = ..., + project_connection_id: str, + tool_configs: Optional[dict[str, ToolConfig]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.WorkflowAgentDefinition(AgentDefinition, discriminator='workflow'): + kind: Literal[AgentKind.WORKFLOW] + rai_config: RaiConfig + workflow: Optional[str] + + @overload + def __init__( + self, + *, + rai_config: Optional[RaiConfig] = ..., + workflow: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + +namespace azure.ai.projects.operations + + class azure.ai.projects.operations.AgentEndpointConversationsOperations(GeneratedAgentEndpointConversationsOperations): + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def get_agent_conversation_item_generated_audio( + self, + agent_name: str, + conversation_id: str, + item_id: str, + **kwargs: Any + ) -> VoiceGeneratedItemAudioResponse: ... + + @distributed_trace + def get_agent_conversation_item_generated_audio_content( + self, + agent_name: str, + conversation_id: str, + item_id: str, + **kwargs: Any + ) -> Iterator[bytes]: ... + + + class azure.ai.projects.operations.AgentsOperations(GeneratedAgentsOperations): + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create_session( + self, + agent_name: str, + *, + agent_session_id: Optional[str] = ..., + content_type: str = "application/json", + version_indicator: VersionIndicator, + **kwargs: Any + ) -> AgentSessionResource: ... + + @overload + def create_session( + self, + agent_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AgentSessionResource: ... + + @overload + def create_session( + self, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AgentSessionResource: ... + + @overload + def create_telephony_binding( + self, + agent_name: str, + body: CreateTelephonyBindingRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> TelephonyBinding: ... + + @overload + def create_telephony_binding( + self, + agent_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> TelephonyBinding: ... + + @overload + def create_telephony_binding( + self, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> TelephonyBinding: ... + + @overload + def create_version( + self, + agent_name: str, + *, + blueprint_reference: Optional[AgentBlueprintReference] = ..., + content_type: str = "application/json", + definition: AgentDefinition, + description: Optional[str] = ..., + draft: Optional[bool] = ..., + metadata: Optional[dict[str, str]] = ..., + **kwargs: Any + ) -> AgentVersionDetails: ... + + @overload + def create_version( + self, + agent_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AgentVersionDetails: ... + + @overload + def create_version( + self, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AgentVersionDetails: ... + + @distributed_trace + def create_version_from_code( + self, + agent_name: str, + *, + code: IO[bytes], + code_zip_sha256: Optional[str] = ..., + definition: HostedAgentDefinition, + description: Optional[str] = ..., + metadata: Optional[dict[str, str]] = ..., + **kwargs: Any + ) -> AgentVersionDetails: ... + + @overload + def create_version_from_manifest( + self, + agent_name: str, + *, + content_type: str = "application/json", + description: Optional[str] = ..., + manifest_id: str, + metadata: Optional[dict[str, str]] = ..., + parameter_values: dict[str, Any], + **kwargs: Any + ) -> AgentVersionDetails: ... + + @overload + def create_version_from_manifest( + self, + agent_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AgentVersionDetails: ... + + @overload + def create_version_from_manifest( + self, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AgentVersionDetails: ... + + @distributed_trace + def delete( + self, + agent_name: str, + *, + force: Optional[bool] = ..., + **kwargs: Any + ) -> DeleteAgentResponse: ... + + @distributed_trace + def delete_session( + self, + agent_name: str, + session_id: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def delete_session_file( + self, + agent_name: str, + session_id: str, + *, + path: str, + recursive: Optional[bool] = ..., + **kwargs: Any + ) -> None: ... + + @distributed_trace + def delete_telephony_binding( + self, + agent_name: str, + binding_id: str, + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def delete_version( + self, + agent_name: str, + agent_version: str, + *, + force: Optional[bool] = ..., + **kwargs: Any + ) -> DeleteAgentVersionResponse: ... + + @distributed_trace + def disable( + self, + agent_name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def download_code( + self, + agent_name: str, + *, + agent_version: Optional[str] = ..., + **kwargs: Any + ) -> Iterator[bytes]: ... + + @distributed_trace + def download_session_file( + self, + agent_name: str, + session_id: str, + *, + path: str, + **kwargs: Any + ) -> Iterator[bytes]: ... + + @distributed_trace + def enable( + self, + agent_name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def end_telephony_call( + self, + agent_name: str, + call_id: str, + **kwargs: Any + ) -> TelephonyCallRecord: ... + + @distributed_trace + def generate_agent( + self, + body: GenerateVoiceAgentRequest, + **kwargs: Any + ) -> AgentDetails: ... + + @distributed_trace + def get( + self, + agent_name: str, + **kwargs: Any + ) -> AgentDetails: ... + + @overload + def get_microsoft365_package( + self, + agent_name: str, + *, + access_boundaries: Optional[List[Union[str, ActivityProtocolAccessBoundary]]] = ..., + agent_display_name: Optional[str] = ..., + app_version: Optional[str] = ..., + bot_service_arm_id: Optional[str] = ..., + can_respond_without_mention: Optional[bool] = ..., + color_icon_base64: Optional[str] = ..., + content_type: str = "application/json", + developer_name: Optional[str] = ..., + developer_website_url: Optional[str] = ..., + full_description: Optional[str] = ..., + optional_permission_scopes: Optional[List[Microsoft365PermissionScopes]] = ..., + outline_icon_base64: Optional[str] = ..., + privacy_url: Optional[str] = ..., + publish_as_autopilot: Optional[bool] = ..., + publish_scope: Union[str, Microsoft365PublishScope], + short_description: Optional[str] = ..., + terms_of_use_url: Optional[str] = ..., + **kwargs: Any + ) -> Iterator[bytes]: ... + + @overload + def get_microsoft365_package( + self, + agent_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterator[bytes]: ... + + @overload + def get_microsoft365_package( + self, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterator[bytes]: ... + + @distributed_trace + def get_microsoft365_publish_defaults( + self, + agent_name: str, + *, + publish_as_digital_worker: Optional[bool] = ..., + **kwargs: Any + ) -> Microsoft365PublishDefaults: ... + + @distributed_trace + def get_session( + self, + agent_name: str, + session_id: str, + **kwargs: Any + ) -> AgentSessionResource: ... + + @distributed_trace + def get_session_log_stream( + self, + agent_name: str, + agent_version: str, + session_id: str, + **kwargs: Any + ) -> SessionLogEvent: ... + + @distributed_trace + def get_telephony_binding( + self, + agent_name: str, + binding_id: str, + **kwargs: Any + ) -> TelephonyBinding: ... + + @distributed_trace + def get_telephony_call( + self, + agent_name: str, + call_id: str, + **kwargs: Any + ) -> TelephonyCallRecord: ... + + @distributed_trace + def get_telephony_transfer_targets( + self, + agent_name: str, + **kwargs: Any + ) -> TelephonyTransferTargets: ... + + @distributed_trace + def get_version( + self, + agent_name: str, + agent_version: str, + **kwargs: Any + ) -> AgentVersionDetails: ... + + @distributed_trace + def list( + self, + *, + before: Optional[str] = ..., + kind: Optional[Union[str, AgentKind]] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[AgentDetails]: ... + + @distributed_trace + def list_session_files( + self, + agent_name: str, + session_id: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + path: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[SessionDirectoryEntry]: ... + + @distributed_trace + def list_sessions( + self, + agent_name: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[AgentSessionResource]: ... - @overload - def __init__( + @distributed_trace + def list_telephony_bindings( self, + agent_name: str, *, - 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.WeeklyRecurrenceSchedule(RecurrenceSchedule, discriminator='Weekly'): - days_of_week: list[Union[str, DayOfWeek]] - type: Literal[RecurrenceType.WEEKLY] + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + provider: Optional[Union[str, TelephonyProvider]] = ..., + status: Optional[Union[str, TelephonyBindingStatus]] = ..., + **kwargs: Any + ) -> ItemPaged[TelephonyBindingListItem]: ... - @overload - def __init__( + @distributed_trace + def list_telephony_calls( self, + agent_name: str, *, - days_of_week: list[Union[str, DayOfWeek]] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + provider: Optional[Union[str, TelephonyProvider]] = ..., + started_after: Optional[datetime] = ..., + started_before: Optional[datetime] = ..., + status: Optional[Union[str, TelephonyCallStatus]] = ..., + **kwargs: Any + ) -> ItemPaged[TelephonyCallSummary]: ... - class azure.ai.projects.models.WorkIQPreviewTool(Tool, discriminator='work_iq_preview'): - project_connection_id: str - type: Literal[ToolType.WORK_IQ_PREVIEW] + @distributed_trace + def list_versions( + self, + agent_name: str, + *, + before: Optional[str] = ..., + include_drafts: Optional[bool] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[AgentVersionDetails]: ... @overload - def __init__( + def publish_to_microsoft365( self, + agent_name: str, *, - project_connection_id: str - ) -> None: ... + access_boundaries: Optional[List[Union[str, ActivityProtocolAccessBoundary]]] = ..., + agent_display_name: Optional[str] = ..., + app_version: Optional[str] = ..., + bot_service_arm_id: Optional[str] = ..., + can_respond_without_mention: Optional[bool] = ..., + color_icon_base64: Optional[str] = ..., + content_type: str = "application/json", + developer_name: Optional[str] = ..., + developer_website_url: Optional[str] = ..., + full_description: Optional[str] = ..., + optional_permission_scopes: Optional[List[Microsoft365PermissionScopes]] = ..., + outline_icon_base64: Optional[str] = ..., + privacy_url: Optional[str] = ..., + publish_as_autopilot: Optional[bool] = ..., + publish_scope: Union[str, Microsoft365PublishScope], + short_description: Optional[str] = ..., + terms_of_use_url: Optional[str] = ..., + **kwargs: Any + ) -> Microsoft365PublishResult: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.WorkIQPreviewToolboxTool(ToolboxTool, discriminator='work_iq_preview'): - description: str - name: str - project_connection_id: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.WORK_IQ_PREVIEW] + def publish_to_microsoft365( + self, + agent_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Microsoft365PublishResult: ... @overload - def __init__( + def publish_to_microsoft365( self, + agent_name: str, + body: IO[bytes], *, - description: Optional[str] = ..., - name: Optional[str] = ..., - project_connection_id: str, - tool_configs: Optional[dict[str, ToolConfig]] = ... - ) -> None: ... + content_type: str = "application/json", + **kwargs: Any + ) -> Microsoft365PublishResult: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.WorkflowAgentDefinition(AgentDefinition, discriminator='workflow'): - kind: Literal[AgentKind.WORKFLOW] - rai_config: RaiConfig - workflow: Optional[str] + def replace_telephony_transfer_targets( + self, + agent_name: str, + *, + content_type: str = "application/json", + etag: str, + match_condition: MatchConditions, + transfer_targets: List[TelephonyTransferTarget], + **kwargs: Any + ) -> TelephonyTransferTargets: ... @overload - def __init__( + def replace_telephony_transfer_targets( self, + agent_name: str, + body: JSON, *, - rai_config: Optional[RaiConfig] = ..., - workflow: Optional[str] = ... - ) -> None: ... + content_type: str = "application/json", + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> TelephonyTransferTargets: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - -namespace azure.ai.projects.operations - - class azure.ai.projects.operations.AgentsOperations(GeneratedAgentsOperations): + def replace_telephony_transfer_targets( + self, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> TelephonyTransferTargets: ... - def __init__( + @distributed_trace + def stop_session( self, - *args, - **kwargs + agent_name: str, + session_id: str, + **kwargs: Any ) -> None: ... @overload - def create_session( + def transfer_telephony_call( self, agent_name: str, + call_id: str, *, - agent_session_id: Optional[str] = ..., content_type: str = "application/json", - version_indicator: VersionIndicator, + target: str, **kwargs: Any - ) -> AgentSessionResource: ... + ) -> TelephonyCallRecord: ... @overload - def create_session( + def transfer_telephony_call( self, agent_name: str, + call_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AgentSessionResource: ... + ) -> TelephonyCallRecord: ... @overload - def create_session( + def transfer_telephony_call( self, agent_name: str, + call_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AgentSessionResource: ... + ) -> TelephonyCallRecord: ... @overload - def create_version( + def update_details( self, agent_name: str, *, - blueprint_reference: Optional[AgentBlueprintReference] = ..., - content_type: str = "application/json", - definition: AgentDefinition, - description: Optional[str] = ..., - draft: Optional[bool] = ..., - metadata: Optional[dict[str, str]] = ..., + agent_card: Optional[AgentCard] = ..., + agent_endpoint: Optional[AgentEndpointConfig] = ..., + content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> AgentVersionDetails: ... + ) -> AgentDetails: ... @overload - def create_version( + def update_details( self, agent_name: str, body: JSON, *, - content_type: str = "application/json", + content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> AgentVersionDetails: ... + ) -> AgentDetails: ... @overload - def create_version( + def update_details( self, agent_name: str, body: IO[bytes], *, - content_type: str = "application/json", + content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> AgentVersionDetails: ... + ) -> AgentDetails: ... - @distributed_trace - def create_version_from_code( + @overload + def update_telephony_binding( self, agent_name: str, + binding_id: str, + body: UpdateTelephonyBindingRequest, *, - code: IO[bytes], - code_zip_sha256: Optional[str] = ..., - definition: HostedAgentDefinition, - description: Optional[str] = ..., - metadata: Optional[dict[str, str]] = ..., + content_type: str = "application/merge-patch+json", + etag: str, + match_condition: MatchConditions, **kwargs: Any - ) -> AgentVersionDetails: ... + ) -> TelephonyBinding: ... @overload - def create_version_from_manifest( + def update_telephony_binding( self, agent_name: str, + binding_id: str, + body: JSON, *, - content_type: str = "application/json", - description: Optional[str] = ..., - manifest_id: str, - metadata: Optional[dict[str, str]] = ..., - parameter_values: dict[str, Any], + content_type: str = "application/merge-patch+json", + etag: str, + match_condition: MatchConditions, **kwargs: Any - ) -> AgentVersionDetails: ... + ) -> TelephonyBinding: ... @overload - def create_version_from_manifest( + def update_telephony_binding( self, agent_name: str, - body: JSON, + binding_id: str, + body: IO[bytes], *, - content_type: str = "application/json", + content_type: str = "application/merge-patch+json", + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> TelephonyBinding: ... + + @overload + def upload_session_file( + self, + agent_name: str, + session_id: str, + content: bytes, + *, + content_type: str = "application/octet-stream", + path: str, + **kwargs: Any + ) -> SessionFileWriteResult: ... + + @overload + def upload_session_file( + self, + agent_name: str, + session_id: str, + content: IO[bytes], + *, + content_type: str = "application/octet-stream", + path: str, + **kwargs: Any + ) -> SessionFileWriteResult: ... + + + class azure.ai.projects.operations.BetaAgentEndpointConversationsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def delete_agent_conversation( + self, + agent_name: str, + conversation_id: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get_agent_conversation( + self, + agent_name: str, + conversation_id: str, + **kwargs: Any + ) -> VoiceConversation: ... + + @distributed_trace + def get_agent_conversation_audio( + self, + agent_name: str, + conversation_id: str, **kwargs: Any - ) -> AgentVersionDetails: ... + ) -> VoiceRecordingResponse: ... - @overload - def create_version_from_manifest( + @distributed_trace + def get_agent_conversation_audio_content( self, agent_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", + conversation_id: str, **kwargs: Any - ) -> AgentVersionDetails: ... + ) -> Iterator[bytes]: ... @distributed_trace - def delete( + def get_agent_conversation_item( self, agent_name: str, - *, - force: Optional[bool] = ..., + conversation_id: str, + item_id: str, **kwargs: Any - ) -> DeleteAgentResponse: ... + ) -> RealtimeConversationItem: ... @distributed_trace - def delete_session( + def get_agent_conversation_item_audio( self, agent_name: str, - session_id: str, + conversation_id: str, + item_id: str, **kwargs: Any - ) -> None: ... + ) -> VoiceItemAudioResponse: ... @distributed_trace - def delete_session_file( + def get_agent_conversation_item_audio_content( self, agent_name: str, - session_id: str, - *, - path: str, - recursive: Optional[bool] = ..., + conversation_id: str, + item_id: str, **kwargs: Any - ) -> None: ... + ) -> Iterator[bytes]: ... @distributed_trace - def delete_version( + def get_agent_conversation_response( self, agent_name: str, - agent_version: str, - *, - force: Optional[bool] = ..., + conversation_id: str, + response_id: str, **kwargs: Any - ) -> DeleteAgentVersionResponse: ... + ) -> VoiceResponse: ... @distributed_trace - def disable( + def list_agent_conversation_items( self, agent_name: str, + conversation_id: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., **kwargs: Any - ) -> None: ... + ) -> ItemPaged[RealtimeConversationItem]: ... @distributed_trace - def download_code( + def list_agent_conversation_response_items( self, agent_name: str, + conversation_id: str, + response_id: str, *, - agent_version: Optional[str] = ..., + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., **kwargs: Any - ) -> Iterator[bytes]: ... + ) -> ItemPaged[RealtimeConversationItem]: ... @distributed_trace - def download_session_file( + def list_agent_conversation_responses( self, agent_name: str, - session_id: str, + conversation_id: str, *, - path: str, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., **kwargs: Any - ) -> Iterator[bytes]: ... + ) -> ItemPaged[VoiceResponse]: ... @distributed_trace - def enable( + def list_agent_conversations( self, agent_name: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., **kwargs: Any + ) -> ItemPaged[VoiceConversation]: ... + + + class azure.ai.projects.operations.BetaAgentInsightMonitorsOperations: + + def __init__( + self, + *args, + **kwargs ) -> None: ... - @distributed_trace - def generate_agent( + @overload + def begin_create_run( self, - body: GenerateVoiceAgentRequest, + monitor_id: str, + run: AgentInsightRunCreate, + *, + content_type: str = "application/json", **kwargs: Any - ) -> AgentDetails: ... + ) -> LROPoller[AgentInsightRunResult]: ... - @distributed_trace - def get( + @overload + def begin_create_run( self, - agent_name: str, + monitor_id: str, + run: JSON, + *, + content_type: str = "application/json", **kwargs: Any - ) -> AgentDetails: ... + ) -> LROPoller[AgentInsightRunResult]: ... @overload - def get_microsoft365_package( + def begin_create_run( self, - agent_name: str, + monitor_id: str, + run: IO[bytes], *, - access_boundaries: Optional[List[Union[str, ActivityProtocolAccessBoundary]]] = ..., - agent_display_name: Optional[str] = ..., - app_version: Optional[str] = ..., - bot_service_arm_id: Optional[str] = ..., - can_respond_without_mention: Optional[bool] = ..., - color_icon_base64: Optional[str] = ..., content_type: str = "application/json", - developer_name: Optional[str] = ..., - developer_website_url: Optional[str] = ..., - full_description: Optional[str] = ..., - optional_permission_scopes: Optional[List[Microsoft365PermissionScopes]] = ..., - outline_icon_base64: Optional[str] = ..., - privacy_url: Optional[str] = ..., - publish_as_autopilot: Optional[bool] = ..., - publish_scope: Union[str, Microsoft365PublishScope], - short_description: Optional[str] = ..., - terms_of_use_url: Optional[str] = ..., **kwargs: Any - ) -> Iterator[bytes]: ... + ) -> LROPoller[AgentInsightRunResult]: ... + + @distributed_trace + def cancel_run( + self, + monitor_id: str, + run_id: str, + **kwargs: Any + ) -> AgentInsightRun: ... @overload - def get_microsoft365_package( + def create( self, - agent_name: str, - body: JSON, + monitor: AgentInsightMonitorCreate, *, content_type: str = "application/json", **kwargs: Any - ) -> Iterator[bytes]: ... + ) -> AgentInsightMonitor: ... @overload - def get_microsoft365_package( + def create( self, - agent_name: str, - body: IO[bytes], + monitor: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> Iterator[bytes]: ... + ) -> AgentInsightMonitor: ... - @distributed_trace - def get_microsoft365_publish_defaults( + @overload + def create( self, - agent_name: str, + monitor: IO[bytes], *, - publish_as_digital_worker: Optional[bool] = ..., + content_type: str = "application/json", **kwargs: Any - ) -> Microsoft365PublishDefaults: ... + ) -> AgentInsightMonitor: ... @distributed_trace - def get_session( + def delete( self, - agent_name: str, - session_id: str, + monitor_id: str, **kwargs: Any - ) -> AgentSessionResource: ... + ) -> None: ... @distributed_trace - def get_session_log_stream( + def get( self, - agent_name: str, - agent_version: str, - session_id: str, + monitor_id: str, **kwargs: Any - ) -> SessionLogEvent: ... + ) -> AgentInsightMonitor: ... @distributed_trace - def get_version( + def get_insight( self, - agent_name: str, - agent_version: str, + monitor_id: str, + insight_id: str, + *, + include_details: Optional[bool] = ..., **kwargs: Any - ) -> AgentVersionDetails: ... + ) -> AgentInsight: ... @distributed_trace - def list( + def get_run( self, - *, - before: Optional[str] = ..., - kind: Optional[Union[str, AgentKind]] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., + monitor_id: str, + run_id: str, **kwargs: Any - ) -> ItemPaged[AgentDetails]: ... + ) -> AgentInsightRun: ... @distributed_trace - def list_session_files( + def list( self, - agent_name: str, - session_id: str, *, + agent_name: Optional[str] = ..., before: Optional[str] = ..., limit: Optional[int] = ..., order: Optional[Union[str, PageOrder]] = ..., - path: Optional[str] = ..., **kwargs: Any - ) -> ItemPaged[SessionDirectoryEntry]: ... + ) -> ItemPaged[AgentInsightMonitorListItem]: ... @distributed_trace - def list_sessions( + def list_insights( self, - agent_name: str, + monitor_id: str, *, before: Optional[str] = ..., + category: Optional[str] = ..., + include_details: Optional[bool] = ..., limit: Optional[int] = ..., order: Optional[Union[str, PageOrder]] = ..., + severity: Optional[Union[str, AgentInsightSeverity]] = ..., + status: Optional[Union[str, AgentInsightStatus]] = ..., **kwargs: Any - ) -> ItemPaged[AgentSessionResource]: ... + ) -> ItemPaged[AgentInsight]: ... @distributed_trace - def list_versions( + def list_runs( self, - agent_name: str, + monitor_id: str, *, before: Optional[str] = ..., - include_drafts: Optional[bool] = ..., limit: Optional[int] = ..., order: Optional[Union[str, PageOrder]] = ..., + status: Optional[Union[str, JobStatus]] = ..., + trigger: Optional[Union[str, AgentInsightRunTrigger]] = ..., **kwargs: Any - ) -> ItemPaged[AgentVersionDetails]: ... - - @overload - def publish_to_microsoft365( - self, - agent_name: str, - *, - access_boundaries: Optional[List[Union[str, ActivityProtocolAccessBoundary]]] = ..., - agent_display_name: Optional[str] = ..., - app_version: Optional[str] = ..., - bot_service_arm_id: Optional[str] = ..., - can_respond_without_mention: Optional[bool] = ..., - color_icon_base64: Optional[str] = ..., - content_type: str = "application/json", - developer_name: Optional[str] = ..., - developer_website_url: Optional[str] = ..., - full_description: Optional[str] = ..., - optional_permission_scopes: Optional[List[Microsoft365PermissionScopes]] = ..., - outline_icon_base64: Optional[str] = ..., - privacy_url: Optional[str] = ..., - publish_as_autopilot: Optional[bool] = ..., - publish_scope: Union[str, Microsoft365PublishScope], - short_description: Optional[str] = ..., - terms_of_use_url: Optional[str] = ..., - **kwargs: Any - ) -> Microsoft365PublishResult: ... + ) -> ItemPaged[AgentInsightRun]: ... - @overload - def publish_to_microsoft365( + @distributed_trace + def reset( self, - agent_name: str, - body: JSON, - *, - content_type: str = "application/json", + monitor_id: str, **kwargs: Any - ) -> Microsoft365PublishResult: ... + ) -> None: ... @overload - def publish_to_microsoft365( + def update( self, - agent_name: str, - body: IO[bytes], + monitor_id: str, + monitor: AgentInsightMonitorUpdate, *, - content_type: str = "application/json", - **kwargs: Any - ) -> Microsoft365PublishResult: ... - - @distributed_trace - def stop_session( - self, - agent_name: str, - session_id: str, + content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> None: ... + ) -> AgentInsightMonitor: ... @overload - def update_details( + def update( self, - agent_name: str, + monitor_id: str, + monitor: JSON, *, - agent_card: Optional[AgentCard] = ..., - agent_endpoint: Optional[AgentEndpointConfig] = ..., content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> AgentDetails: ... + ) -> AgentInsightMonitor: ... @overload - def update_details( + def update( self, - agent_name: str, - body: JSON, + monitor_id: str, + monitor: IO[bytes], *, content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> AgentDetails: ... + ) -> AgentInsightMonitor: ... @overload - def update_details( + def update_insight( self, - agent_name: str, - body: IO[bytes], + monitor_id: str, + insight_id: str, + update: AgentInsightUpdate, *, content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> AgentDetails: ... + ) -> AgentInsight: ... @overload - def upload_session_file( + def update_insight( self, - agent_name: str, - session_id: str, - content: bytes, + monitor_id: str, + insight_id: str, + update: JSON, *, - content_type: str = "application/octet-stream", - path: str, + content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> SessionFileWriteResult: ... + ) -> AgentInsight: ... @overload - def upload_session_file( + def update_insight( self, - agent_name: str, - session_id: str, - content: IO[bytes], + monitor_id: str, + insight_id: str, + update: IO[bytes], *, - content_type: str = "application/octet-stream", - path: str, + content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> SessionFileWriteResult: ... + ) -> AgentInsight: ... class azure.ai.projects.operations.BetaAgentsOperations(BetaAgentsOperationsGenerated): diff --git a/sdk/ai/azure-ai-projects/api.metadata.yml b/sdk/ai/azure-ai-projects/api.metadata.yml index 50b6e2c6bc4a..7d655a96962e 100644 --- a/sdk/ai/azure-ai-projects/api.metadata.yml +++ b/sdk/ai/azure-ai-projects/api.metadata.yml @@ -1,4 +1,4 @@ -apiMdSha256: b6b083ddf874aed0a93697454da22e333061e7bb447f9f6b6846d93d32eb53d6 +apiMdSha256: 25fc69b3779f434662cb375de31c13b962d9ddc10dfc17882fa14c9866318d25 packageVersion: 2.6.0 parserVersion: 0.3.30 pythonVersion: 3.13.2 diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index 67ede6a88020..e49566ae652f 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -132,7 +132,10 @@ "azure.ai.projects.models.CosmosDBIndex": "Azure.AI.Projects.CosmosDBIndex", "azure.ai.projects.models.CreateAsyncResponse": "Azure.AI.Projects.createAsync.Response.anonymous", "azure.ai.projects.models.CreateSkillVersionFromFilesBody": "Azure.AI.Projects.CreateSkillVersionFromFilesBody", + "azure.ai.projects.models.CreateTelephonyBindingRequest": "Azure.AI.Projects.CreateTelephonyBindingRequest", + "azure.ai.projects.models.CreateTeamsPhoneExtensionTelephonyBindingRequest": "Azure.AI.Projects.CreateTeamsPhoneExtensionTelephonyBindingRequest", "azure.ai.projects.models.CreateTranscriptionResponseJsonUsage": "OpenAI.CreateTranscriptionResponseJsonUsage", + "azure.ai.projects.models.CreateTwilioTelephonyBindingRequest": "Azure.AI.Projects.CreateTwilioTelephonyBindingRequest", "azure.ai.projects.models.Trigger": "Azure.AI.Projects.Trigger", "azure.ai.projects.models.CronTrigger": "Azure.AI.Projects.CronTrigger", "azure.ai.projects.models.CustomCredential": "Azure.AI.Projects.CustomCredential", @@ -308,6 +311,8 @@ "azure.ai.projects.models.PromptEvaluatorGenerationJobSource": "Azure.AI.Projects.PromptEvaluatorGenerationJobSource", "azure.ai.projects.models.ProtocolConfiguration": "Azure.AI.Projects.ProtocolConfiguration", "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.RaiConfig": "Azure.AI.Projects.RaiConfig", "azure.ai.projects.models.RankingOptions": "OpenAI.RankingOptions", "azure.ai.projects.models.RealtimeAudioFormats": "OpenAI.RealtimeAudioFormats", @@ -425,6 +430,7 @@ "azure.ai.projects.models.ShellToolboxTool": "Azure.AI.Projects.ShellToolboxTool", "azure.ai.projects.models.SimpleQnADataGenerationJobOptions": "Azure.AI.Projects.SimpleQnADataGenerationJobOptions", "azure.ai.projects.models.SimulationSeedDataGenerationJobOptions": "Azure.AI.Projects.SimulationSeedDataGenerationJobOptions", + "azure.ai.projects.models.SipTelephonyTransferDestination": "Azure.AI.Projects.SipTelephonyTransferDestination", "azure.ai.projects.models.SkillDetails": "Azure.AI.Projects.Skill", "azure.ai.projects.models.SkillInlineContent": "Azure.AI.Projects.SkillInlineContent", "azure.ai.projects.models.SkillReferenceParam": "OpenAI.SkillReferenceParam", @@ -437,7 +443,19 @@ "azure.ai.projects.models.StructuredOutputDefinition": "Azure.AI.Projects.StructuredOutputDefinition", "azure.ai.projects.models.TaxonomyCategory": "Azure.AI.Projects.TaxonomyCategory", "azure.ai.projects.models.TaxonomySubCategory": "Azure.AI.Projects.TaxonomySubCategory", + "azure.ai.projects.models.TelephonyBinding": "Azure.AI.Projects.TelephonyBinding", + "azure.ai.projects.models.TeamsPhoneExtensionTelephonyBinding": "Azure.AI.Projects.TeamsPhoneExtensionTelephonyBinding", + "azure.ai.projects.models.TelephonyBindingListItem": "Azure.AI.Projects.TelephonyBindingListItem", + "azure.ai.projects.models.TeamsPhoneExtensionTelephonyBindingListItem": "Azure.AI.Projects.TeamsPhoneExtensionTelephonyBindingListItem", + "azure.ai.projects.models.TeamsTelephonyTransferDestination": "Azure.AI.Projects.TeamsTelephonyTransferDestination", "azure.ai.projects.models.TelemetryConfig": "Azure.AI.Projects.TelemetryConfig", + "azure.ai.projects.models.TelephonyCallLifecycleEvent": "Azure.AI.Projects.TelephonyCallLifecycleEvent", + "azure.ai.projects.models.TelephonyCallRecord": "Azure.AI.Projects.TelephonyCallRecord", + "azure.ai.projects.models.TelephonyCallSummary": "Azure.AI.Projects.TelephonyCallSummary", + "azure.ai.projects.models.TelephonyCallTiming": "Azure.AI.Projects.TelephonyCallTiming", + "azure.ai.projects.models.TelephonyCallTrace": "Azure.AI.Projects.TelephonyCallTrace", + "azure.ai.projects.models.TelephonyTransferTarget": "Azure.AI.Projects.TelephonyTransferTarget", + "azure.ai.projects.models.TelephonyTransferTargets": "Azure.AI.Projects.TelephonyTransferTargets", "azure.ai.projects.models.TextResponseFormat": "OpenAI.TextResponseFormatConfiguration", "azure.ai.projects.models.TextResponseFormatJsonObject": "OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject", "azure.ai.projects.models.TextResponseFormatJsonSchema": "OpenAI.TextResponseFormatJsonSchema", @@ -479,7 +497,10 @@ "azure.ai.projects.models.TranscriptTextUsageDuration": "OpenAI.TranscriptTextUsageDuration", "azure.ai.projects.models.TranscriptTextUsageTokens": "OpenAI.TranscriptTextUsageTokens", "azure.ai.projects.models.TranscriptTextUsageTokensInputTokenDetails": "OpenAI.TranscriptTextUsageTokensInputTokenDetails", + "azure.ai.projects.models.TwilioTelephonyBinding": "Azure.AI.Projects.TwilioTelephonyBinding", + "azure.ai.projects.models.TwilioTelephonyBindingListItem": "Azure.AI.Projects.TwilioTelephonyBindingListItem", "azure.ai.projects.models.UpdateModelVersionRequest": "Azure.AI.Projects.UpdateModelVersionRequest", + "azure.ai.projects.models.UpdateTelephonyBindingRequest": "Azure.AI.Projects.UpdateTelephonyBindingRequest", "azure.ai.projects.models.UpdateToolboxRequest": "Azure.AI.Projects.UpdateToolboxRequest", "azure.ai.projects.models.UserProfileMemoryItem": "Azure.AI.Projects.UserProfileMemoryItem", "azure.ai.projects.models.VersionIndicator": "Azure.AI.Projects.VersionIndicator", @@ -500,6 +521,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.VoiceAgentClientEventRtcCallSdpCreate": "Azure.AI.Projects.VoiceAgentClientEventRtcCallSdpCreate", "azure.ai.projects.models.VoiceAgentClientEventSessionAvatarConnect": "Azure.AI.Projects.VoiceAgentClientEventSessionAvatarConnect", "azure.ai.projects.models.VoiceAgentClientEventSessionUpdate": "Azure.AI.Projects.VoiceAgentClientEventSessionUpdate", "azure.ai.projects.models.VoiceAgentDefinition": "Azure.AI.Projects.VoiceAgentDefinition", @@ -517,6 +539,7 @@ "azure.ai.projects.models.VoiceAgentRealtimeResponseBase": "Azure.AI.Projects.VoiceAgentRealtimeResponseBase", "azure.ai.projects.models.VoiceAgentRealtimeResponse": "Azure.AI.Projects.VoiceAgentRealtimeResponse", "azure.ai.projects.models.VoiceAgentResponseCreateParams": "Azure.AI.Projects.VoiceAgentResponseCreateParams", + "azure.ai.projects.models.VoiceAgentRtcCallErrorDetails": "Azure.AI.Projects.VoiceAgentRtcCallErrorDetails", "azure.ai.projects.models.VoiceAgentSemanticVadTurnDetection": "Azure.AI.Projects.VoiceAgentSemanticVadTurnDetection", "azure.ai.projects.models.VoiceAgentServerEventResponseAnimationBlendshapesDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseAnimationBlendshapesDelta", "azure.ai.projects.models.VoiceAgentServerEventResponseAnimationBlendshapesDone": "Azure.AI.Projects.VoiceAgentServerEventResponseAnimationBlendshapesDone", @@ -525,9 +548,14 @@ "azure.ai.projects.models.VoiceAgentServerEventResponseAudioTimestampDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseAudioTimestampDelta", "azure.ai.projects.models.VoiceAgentServerEventResponseAudioTimestampDone": "Azure.AI.Projects.VoiceAgentServerEventResponseAudioTimestampDone", "azure.ai.projects.models.VoiceAgentServerEventResponseVideoDelta": "Azure.AI.Projects.VoiceAgentServerEventResponseVideoDelta", + "azure.ai.projects.models.VoiceAgentServerEventRtcCallError": "Azure.AI.Projects.VoiceAgentServerEventRtcCallError", + "azure.ai.projects.models.VoiceAgentServerEventRtcCallSdpCreated": "Azure.AI.Projects.VoiceAgentServerEventRtcCallSdpCreated", "azure.ai.projects.models.VoiceAgentServerEventSessionAvatarConnecting": "Azure.AI.Projects.VoiceAgentServerEventSessionAvatarConnecting", "azure.ai.projects.models.VoiceAgentServerEventSessionAvatarSwitchToIdle": "Azure.AI.Projects.VoiceAgentServerEventSessionAvatarSwitchToIdle", "azure.ai.projects.models.VoiceAgentServerEventSessionAvatarSwitchToSpeaking": "Azure.AI.Projects.VoiceAgentServerEventSessionAvatarSwitchToSpeaking", + "azure.ai.projects.models.VoiceAgentServerEventSessionSubagentAborted": "Azure.AI.Projects.VoiceAgentServerEventSessionSubagentAborted", + "azure.ai.projects.models.VoiceAgentServerEventSessionSubagentCompleted": "Azure.AI.Projects.VoiceAgentServerEventSessionSubagentCompleted", + "azure.ai.projects.models.VoiceAgentServerEventSessionSubagentStarted": "Azure.AI.Projects.VoiceAgentServerEventSessionSubagentStarted", "azure.ai.projects.models.VoiceAgentServerEventWarning": "Azure.AI.Projects.VoiceAgentServerEventWarning", "azure.ai.projects.models.VoiceAgentServerEventWarningDetails": "Azure.AI.Projects.VoiceAgentServerEventWarningDetails", "azure.ai.projects.models.VoiceAgentServerVadTurnDetection": "Azure.AI.Projects.VoiceAgentServerVadTurnDetection", @@ -535,12 +563,18 @@ "azure.ai.projects.models.VoiceAgentSessionResponseConfig": "Azure.AI.Projects.VoiceAgentSessionResponseConfig", "azure.ai.projects.models.VoiceAgentSessionUpdateConfig": "Azure.AI.Projects.VoiceAgentSessionUpdateConfig", "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", + "azure.ai.projects.models.VoiceAgentSubagentResponsePolicy": "Azure.AI.Projects.VoiceAgentSubagentResponsePolicy", "azure.ai.projects.models.VoiceAgentSystemTool": "Azure.AI.Projects.VoiceAgentSystemTool", "azure.ai.projects.models.VoiceAgentTemplateGreetingConfig": "Azure.AI.Projects.VoiceAgentTemplateGreetingConfig", "azure.ai.projects.models.VoiceAgentToolboxTool": "Azure.AI.Projects.VoiceAgentToolboxTool", "azure.ai.projects.models.VoiceAgentTranscriptionPhrase": "Azure.AI.Projects.VoiceAgentTranscriptionPhrase", "azure.ai.projects.models.VoiceAgentTranscriptionWord": "Azure.AI.Projects.VoiceAgentTranscriptionWord", "azure.ai.projects.models.VoiceConversation": "Azure.AI.Projects.VoiceConversation", + "azure.ai.projects.models.VoiceConversationEngine": "Azure.AI.Projects.VoiceConversationEngine", + "azure.ai.projects.models.VoiceGeneratedItemAudioResponse": "Azure.AI.Projects.VoiceGeneratedItemAudioResponse", + "azure.ai.projects.models.VoiceHostedAgentConversationEngine": "Azure.AI.Projects.VoiceHostedAgentConversationEngine", "azure.ai.projects.models.VoiceItemAudioResponse": "Azure.AI.Projects.VoiceItemAudioResponse", "azure.ai.projects.models.VoiceRecordingChannelLayout": "Azure.AI.Projects.VoiceRecordingChannelLayout", "azure.ai.projects.models.VoiceRecordingResponse": "Azure.AI.Projects.VoiceRecordingResponse", @@ -562,6 +596,7 @@ "azure.ai.projects.models.WorkIQPreviewToolboxTool": "Azure.AI.Projects.WorkIQPreviewToolboxTool", "azure.ai.projects.models.VoiceAgentWebSocketSubprotocol": "Azure.AI.Projects.VoiceAgentWebSocketSubprotocol", "azure.ai.projects.models._AgentDefinitionOptInKeys": "Azure.AI.Projects.AgentDefinitionOptInKeys", + "azure.ai.projects.models.VoiceAgentTransport": "Azure.AI.Projects.VoiceAgentTransport", "azure.ai.projects.models.VoiceConversationStatus": "Azure.AI.Projects.VoiceConversationStatus", "azure.ai.projects.models.PageOrder": "Azure.AI.Projects.PageOrder", "azure.ai.projects.models.RealtimeConversationItemType": "OpenAI.RealtimeConversationItemType", @@ -684,6 +719,18 @@ "azure.ai.projects.models.AgentSessionStatus": "Azure.AI.Projects.AgentSessionStatus", "azure.ai.projects.models.SessionLogEventType": "Azure.AI.Projects.SessionLogEventType", "azure.ai.projects.models.Microsoft365PublishScope": "Azure.AI.Projects.Microsoft365PublishScope", + "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", + "azure.ai.projects.models.TelephonyCallPhase": "Azure.AI.Projects.TelephonyCallPhase", + "azure.ai.projects.models.TelephonyCallDurationBasis": "Azure.AI.Projects.TelephonyCallDurationBasis", + "azure.ai.projects.models.TelephonyCallTimestampSource": "Azure.AI.Projects.TelephonyCallTimestampSource", + "azure.ai.projects.models.TelephonyCallTraceStatus": "Azure.AI.Projects.TelephonyCallTraceStatus", + "azure.ai.projects.models.TelephonyCallTraceMode": "Azure.AI.Projects.TelephonyCallTraceMode", + "azure.ai.projects.models.TelephonyCallLifecycleEventName": "Azure.AI.Projects.TelephonyCallLifecycleEventName", + "azure.ai.projects.models.TelephonyCallLifecycleEventSource": "Azure.AI.Projects.TelephonyCallLifecycleEventSource", + "azure.ai.projects.models.TelephonyCallLifecycleEventOutcome": "Azure.AI.Projects.TelephonyCallLifecycleEventOutcome", + "azure.ai.projects.models.TelephonyTransferDestinationKind": "Azure.AI.Projects.TelephonyTransferDestinationKind", "azure.ai.projects.models.EvaluationRuleActionType": "Azure.AI.Projects.EvaluationRuleActionType", "azure.ai.projects.models.EvaluationRuleEventType": "Azure.AI.Projects.EvaluationRuleEventType", "azure.ai.projects.models.ConnectionType": "Azure.AI.Projects.ConnectionType", @@ -699,6 +746,7 @@ "azure.ai.projects.models.ToolChoiceOptions": "OpenAI.ToolChoiceOptions", "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.operations.AgentsOperations.get": "Azure.AI.Projects.Agents.getAgent", "azure.ai.projects.aio.operations.AgentsOperations.get": "Azure.AI.Projects.Agents.getAgent", "azure.ai.projects.operations.AgentsOperations.generate_agent": "Azure.AI.Projects.Agents.generateAgent", @@ -743,6 +791,28 @@ "azure.ai.projects.aio.operations.AgentsOperations.get_microsoft365_package": "Azure.AI.Projects.Microsoft365Publishing.getMicrosoft365AppPackage", "azure.ai.projects.operations.AgentsOperations.get_microsoft365_publish_defaults": "Azure.AI.Projects.Microsoft365Publishing.getMicrosoft365PublishDefaults", "azure.ai.projects.aio.operations.AgentsOperations.get_microsoft365_publish_defaults": "Azure.AI.Projects.Microsoft365Publishing.getMicrosoft365PublishDefaults", + "azure.ai.projects.operations.AgentsOperations.create_telephony_binding": "Azure.AI.Projects.AgentTelephony.createTelephonyBinding", + "azure.ai.projects.aio.operations.AgentsOperations.create_telephony_binding": "Azure.AI.Projects.AgentTelephony.createTelephonyBinding", + "azure.ai.projects.operations.AgentsOperations.list_telephony_bindings": "Azure.AI.Projects.AgentTelephony.listTelephonyBindings", + "azure.ai.projects.aio.operations.AgentsOperations.list_telephony_bindings": "Azure.AI.Projects.AgentTelephony.listTelephonyBindings", + "azure.ai.projects.operations.AgentsOperations.get_telephony_binding": "Azure.AI.Projects.AgentTelephony.getTelephonyBinding", + "azure.ai.projects.aio.operations.AgentsOperations.get_telephony_binding": "Azure.AI.Projects.AgentTelephony.getTelephonyBinding", + "azure.ai.projects.operations.AgentsOperations.update_telephony_binding": "Azure.AI.Projects.AgentTelephony.updateTelephonyBinding", + "azure.ai.projects.aio.operations.AgentsOperations.update_telephony_binding": "Azure.AI.Projects.AgentTelephony.updateTelephonyBinding", + "azure.ai.projects.operations.AgentsOperations.delete_telephony_binding": "Azure.AI.Projects.AgentTelephony.deleteTelephonyBinding", + "azure.ai.projects.aio.operations.AgentsOperations.delete_telephony_binding": "Azure.AI.Projects.AgentTelephony.deleteTelephonyBinding", + "azure.ai.projects.operations.AgentsOperations.list_telephony_calls": "Azure.AI.Projects.AgentTelephony.listTelephonyCalls", + "azure.ai.projects.aio.operations.AgentsOperations.list_telephony_calls": "Azure.AI.Projects.AgentTelephony.listTelephonyCalls", + "azure.ai.projects.operations.AgentsOperations.get_telephony_call": "Azure.AI.Projects.AgentTelephony.getTelephonyCall", + "azure.ai.projects.aio.operations.AgentsOperations.get_telephony_call": "Azure.AI.Projects.AgentTelephony.getTelephonyCall", + "azure.ai.projects.operations.AgentsOperations.transfer_telephony_call": "Azure.AI.Projects.AgentTelephony.transferTelephonyCall", + "azure.ai.projects.aio.operations.AgentsOperations.transfer_telephony_call": "Azure.AI.Projects.AgentTelephony.transferTelephonyCall", + "azure.ai.projects.operations.AgentsOperations.end_telephony_call": "Azure.AI.Projects.AgentTelephony.endTelephonyCall", + "azure.ai.projects.aio.operations.AgentsOperations.end_telephony_call": "Azure.AI.Projects.AgentTelephony.endTelephonyCall", + "azure.ai.projects.operations.AgentsOperations.get_telephony_transfer_targets": "Azure.AI.Projects.AgentTelephony.getTelephonyTransferTargets", + "azure.ai.projects.aio.operations.AgentsOperations.get_telephony_transfer_targets": "Azure.AI.Projects.AgentTelephony.getTelephonyTransferTargets", + "azure.ai.projects.operations.AgentsOperations.replace_telephony_transfer_targets": "Azure.AI.Projects.AgentTelephony.replaceTelephonyTransferTargets", + "azure.ai.projects.aio.operations.AgentsOperations.replace_telephony_transfer_targets": "Azure.AI.Projects.AgentTelephony.replaceTelephonyTransferTargets", "azure.ai.projects.operations.AgentsOperations.upload_session_file": "Azure.AI.Projects.AgentSessionFiles.uploadSessionFile", "azure.ai.projects.aio.operations.AgentsOperations.upload_session_file": "Azure.AI.Projects.AgentSessionFiles.uploadSessionFile", "azure.ai.projects.operations.AgentsOperations.download_session_file": "Azure.AI.Projects.AgentSessionFiles.downloadSessionFile", @@ -789,6 +859,10 @@ "azure.ai.projects.aio.operations.IndexesOperations.delete": "Azure.AI.Projects.Indexes.deleteVersion", "azure.ai.projects.operations.IndexesOperations.create_or_update": "Azure.AI.Projects.Indexes.createOrUpdateVersion", "azure.ai.projects.aio.operations.IndexesOperations.create_or_update": "Azure.AI.Projects.Indexes.createOrUpdateVersion", + "azure.ai.projects.operations.AgentEndpointConversationsOperations.get_agent_conversation_item_generated_audio": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItemGeneratedAudio", + "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_item_generated_audio": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItemGeneratedAudio", + "azure.ai.projects.operations.AgentEndpointConversationsOperations.get_agent_conversation_item_generated_audio_content": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItemGeneratedAudioContent", + "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_item_generated_audio_content": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItemGeneratedAudioContent", "azure.ai.projects.operations.ToolboxesOperations.create_version": "Azure.AI.Projects.Toolboxes.createToolboxVersion", "azure.ai.projects.aio.operations.ToolboxesOperations.create_version": "Azure.AI.Projects.Toolboxes.createToolboxVersion", "azure.ai.projects.operations.ToolboxesOperations.get": "Azure.AI.Projects.Toolboxes.getToolbox", @@ -806,5 +880,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": "39f992f697cf" + "CrossLanguageVersion": "7b61074c22c0" } \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py index 7052e3b647c9..9c1e0f4dfd89 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py @@ -17,6 +17,7 @@ from ._configuration import AIProjectClientConfiguration from ._utils.serialization import Deserializer, Serializer from .operations import ( + AgentEndpointConversationsOperations, AgentsOperations, BetaOperations, ConnectionsOperations, @@ -53,6 +54,9 @@ class AIProjectClient: # pylint: disable=too-many-instance-attributes,docstring :vartype deployments: azure.ai.projects.operations.DeploymentsOperations :ivar indexes: IndexesOperations operations :vartype indexes: azure.ai.projects.operations.IndexesOperations + :ivar agent_endpoint_conversations: AgentEndpointConversationsOperations operations + :vartype agent_endpoint_conversations: + azure.ai.projects.operations.AgentEndpointConversationsOperations :ivar toolboxes: ToolboxesOperations operations :vartype toolboxes: azure.ai.projects.operations.ToolboxesOperations :param endpoint: Foundry Project endpoint in the form @@ -113,6 +117,9 @@ def __init__( self.datasets = DatasetsOperations(self._client, self._config, self._serialize, self._deserialize) self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) self.indexes = IndexesOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_endpoint_conversations = AgentEndpointConversationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.toolboxes = ToolboxesOperations(self._client, self._config, self._serialize, self._deserialize) def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py index a0e54f73ae92..dfc0df5333fd 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py @@ -71,6 +71,7 @@ _models.RealtimeClientEventOutputAudioBufferClear, _models.RealtimeClientEventResponseCancel, _models.RealtimeClientEventResponseCreate, + _models.VoiceAgentClientEventRtcCallSdpCreate, _models.VoiceAgentClientEventSessionAvatarConnect, _models.VoiceAgentClientEventSessionUpdate, str, @@ -149,10 +150,15 @@ "response.output_text.delta": _models.RealtimeServerEventResponseTextDelta, "response.output_text.done": _models.RealtimeServerEventResponseTextDone, "response.video.delta": _models.VoiceAgentServerEventResponseVideoDelta, + "rtc.call.error": _models.VoiceAgentServerEventRtcCallError, + "rtc.call.sdp.created": _models.VoiceAgentServerEventRtcCallSdpCreated, "session.avatar.connecting": _models.VoiceAgentServerEventSessionAvatarConnecting, "session.avatar.switch_to_idle": _models.VoiceAgentServerEventSessionAvatarSwitchToIdle, "session.avatar.switch_to_speaking": _models.VoiceAgentServerEventSessionAvatarSwitchToSpeaking, "session.created": _models.RealtimeServerEventSessionCreated, + "session.subagent.aborted": _models.VoiceAgentServerEventSessionSubagentAborted, + "session.subagent.completed": _models.VoiceAgentServerEventSessionSubagentCompleted, + "session.subagent.started": _models.VoiceAgentServerEventSessionSubagentStarted, "session.updated": _models.RealtimeServerEventSessionUpdated, "warning": _models.VoiceAgentServerEventWarning, } @@ -206,10 +212,15 @@ _models.RealtimeServerEventResponseTextDelta, _models.RealtimeServerEventResponseTextDone, _models.VoiceAgentServerEventResponseVideoDelta, + _models.VoiceAgentServerEventRtcCallError, + _models.VoiceAgentServerEventRtcCallSdpCreated, _models.VoiceAgentServerEventSessionAvatarConnecting, _models.VoiceAgentServerEventSessionAvatarSwitchToIdle, _models.VoiceAgentServerEventSessionAvatarSwitchToSpeaking, _models.RealtimeServerEventSessionCreated, + _models.VoiceAgentServerEventSessionSubagentAborted, + _models.VoiceAgentServerEventSessionSubagentCompleted, + _models.VoiceAgentServerEventSessionSubagentStarted, _models.RealtimeServerEventSessionUpdated, _models.VoiceAgentServerEventWarning, Mapping[str, Any], diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/utils.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/utils.py index c91d6470e2bf..13edbaf420db 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/utils.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/utils.py @@ -9,8 +9,41 @@ import os from typing import Any, IO, Mapping, Optional, Union +from azure.core import MatchConditions + from .._utils.model_base import Model, SdkJSONEncoder + +def quote_etag(etag: Optional[str]) -> Optional[str]: + if not etag or etag == "*": + return etag + if etag.startswith("W/"): + return etag + if etag.startswith('"') and etag.endswith('"'): + return etag + if etag.startswith("'") and etag.endswith("'"): + return etag + return '"' + etag + '"' + + +def prep_if_match(etag: Optional[str], match_condition: Optional[MatchConditions]) -> Optional[str]: + if match_condition == MatchConditions.IfNotModified: + if_match = quote_etag(etag) if etag else None + return if_match + if match_condition == MatchConditions.IfPresent: + return "*" + return None + + +def prep_if_none_match(etag: Optional[str], match_condition: Optional[MatchConditions]) -> Optional[str]: + if match_condition == MatchConditions.IfModified: + if_none_match = quote_etag(etag) if etag else None + return if_none_match + if match_condition == MatchConditions.IfMissing: + return "*" + return None + + # file-like tuple could be `(filename, IO (or bytes))` or `(filename, IO (or bytes), content_type)` FileContent = Union[str, bytes, IO[str], IO[bytes]] diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py index dd68e26b6d8a..fd5065a3aa8a 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py @@ -17,6 +17,7 @@ from .._utils.serialization import Deserializer, Serializer from ._configuration import AIProjectClientConfiguration from .operations import ( + AgentEndpointConversationsOperations, AgentsOperations, BetaOperations, ConnectionsOperations, @@ -53,6 +54,9 @@ class AIProjectClient: # pylint: disable=too-many-instance-attributes,docstring :vartype deployments: azure.ai.projects.aio.operations.DeploymentsOperations :ivar indexes: IndexesOperations operations :vartype indexes: azure.ai.projects.aio.operations.IndexesOperations + :ivar agent_endpoint_conversations: AgentEndpointConversationsOperations operations + :vartype agent_endpoint_conversations: + azure.ai.projects.aio.operations.AgentEndpointConversationsOperations :ivar toolboxes: ToolboxesOperations operations :vartype toolboxes: azure.ai.projects.aio.operations.ToolboxesOperations :param endpoint: Foundry Project endpoint in the form @@ -113,6 +117,9 @@ def __init__( self.datasets = DatasetsOperations(self._client, self._config, self._serialize, self._deserialize) self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) self.indexes = IndexesOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_endpoint_conversations = AgentEndpointConversationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.toolboxes = ToolboxesOperations(self._client, self._config, self._serialize, self._deserialize) def send_request( diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py index b204b9b1f4d4..47a336bbcfd8 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py @@ -85,6 +85,7 @@ _models.RealtimeClientEventOutputAudioBufferClear, _models.RealtimeClientEventResponseCancel, _models.RealtimeClientEventResponseCreate, + _models.VoiceAgentClientEventRtcCallSdpCreate, _models.VoiceAgentClientEventSessionAvatarConnect, _models.VoiceAgentClientEventSessionUpdate, str, @@ -163,10 +164,15 @@ "response.output_text.delta": _models.RealtimeServerEventResponseTextDelta, "response.output_text.done": _models.RealtimeServerEventResponseTextDone, "response.video.delta": _models.VoiceAgentServerEventResponseVideoDelta, + "rtc.call.error": _models.VoiceAgentServerEventRtcCallError, + "rtc.call.sdp.created": _models.VoiceAgentServerEventRtcCallSdpCreated, "session.avatar.connecting": _models.VoiceAgentServerEventSessionAvatarConnecting, "session.avatar.switch_to_idle": _models.VoiceAgentServerEventSessionAvatarSwitchToIdle, "session.avatar.switch_to_speaking": _models.VoiceAgentServerEventSessionAvatarSwitchToSpeaking, "session.created": _models.RealtimeServerEventSessionCreated, + "session.subagent.aborted": _models.VoiceAgentServerEventSessionSubagentAborted, + "session.subagent.completed": _models.VoiceAgentServerEventSessionSubagentCompleted, + "session.subagent.started": _models.VoiceAgentServerEventSessionSubagentStarted, "session.updated": _models.RealtimeServerEventSessionUpdated, "warning": _models.VoiceAgentServerEventWarning, } @@ -220,10 +226,15 @@ _models.RealtimeServerEventResponseTextDelta, _models.RealtimeServerEventResponseTextDone, _models.VoiceAgentServerEventResponseVideoDelta, + _models.VoiceAgentServerEventRtcCallError, + _models.VoiceAgentServerEventRtcCallSdpCreated, _models.VoiceAgentServerEventSessionAvatarConnecting, _models.VoiceAgentServerEventSessionAvatarSwitchToIdle, _models.VoiceAgentServerEventSessionAvatarSwitchToSpeaking, _models.RealtimeServerEventSessionCreated, + _models.VoiceAgentServerEventSessionSubagentAborted, + _models.VoiceAgentServerEventSessionSubagentCompleted, + _models.VoiceAgentServerEventSessionSubagentStarted, _models.RealtimeServerEventSessionUpdated, _models.VoiceAgentServerEventWarning, Mapping[str, Any], diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/__init__.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/__init__.py index d6cf67b4d8cf..bab1be543cc5 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/__init__.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/__init__.py @@ -19,6 +19,7 @@ from ._operations import DatasetsOperations # type: ignore from ._operations import DeploymentsOperations # type: ignore from ._operations import IndexesOperations # type: ignore +from ._operations import AgentEndpointConversationsOperations # type: ignore from ._operations import ToolboxesOperations # type: ignore from ._patch import __all__ as _patch_all @@ -33,6 +34,7 @@ "DatasetsOperations", "DeploymentsOperations", "IndexesOperations", + "AgentEndpointConversationsOperations", "ToolboxesOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore 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 b16240b80260..9aebe211f6ec 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 @@ -7,17 +7,19 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping +import datetime from io import IOBase import json from typing import Any, AsyncIterator, Callable, IO, Literal, Optional, TYPE_CHECKING, TypeVar, Union, cast, overload import urllib.parse -from azure.core import AsyncPipelineClient +from azure.core import AsyncPipelineClient, MatchConditions from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, + ResourceModifiedError, ResourceNotFoundError, ResourceNotModifiedError, StreamClosedError, @@ -38,32 +40,45 @@ from ..._utils.utils import prepare_multipart_form_data from ...models._enums import _AgentDefinitionOptInKeys from ...operations._operations import ( + build_agent_endpoint_conversations_get_agent_conversation_item_generated_audio_content_request, + build_agent_endpoint_conversations_get_agent_conversation_item_generated_audio_request, build_agents_create_session_request, + build_agents_create_telephony_binding_request, build_agents_create_version_from_code_request, build_agents_create_version_from_manifest_request, build_agents_create_version_request, build_agents_delete_request, build_agents_delete_session_file_request, build_agents_delete_session_request, + build_agents_delete_telephony_binding_request, build_agents_delete_version_request, build_agents_disable_request, build_agents_download_code_request, build_agents_download_session_file_request, build_agents_enable_request, + build_agents_end_telephony_call_request, build_agents_generate_agent_request, build_agents_get_microsoft365_package_request, build_agents_get_microsoft365_publish_defaults_request, build_agents_get_request, build_agents_get_session_log_stream_request, build_agents_get_session_request, + build_agents_get_telephony_binding_request, + build_agents_get_telephony_call_request, + build_agents_get_telephony_transfer_targets_request, build_agents_get_version_request, build_agents_list_request, build_agents_list_session_files_request, build_agents_list_sessions_request, + build_agents_list_telephony_bindings_request, + build_agents_list_telephony_calls_request, build_agents_list_versions_request, build_agents_publish_to_microsoft365_request, + build_agents_replace_telephony_transfer_targets_request, build_agents_stop_session_request, + build_agents_transfer_telephony_call_request, build_agents_update_details_request, + build_agents_update_telephony_binding_request, build_agents_upload_session_file_request, build_beta_agent_endpoint_conversations_delete_agent_conversation_request, build_beta_agent_endpoint_conversations_get_agent_conversation_audio_content_request, @@ -3091,6 +3106,1315 @@ async def get_microsoft365_publish_defaults( return deserialized # type: ignore + @overload + async def create_telephony_binding( + self, + agent_name: str, + body: _models.CreateTelephonyBindingRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TelephonyBinding: + """Create an agent telephony binding. + + Creates a telephony binding for the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param body: The provider-specific binding to create. Required. + :type body: ~azure.ai.projects.models.CreateTelephonyBindingRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_telephony_binding( + self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.TelephonyBinding: + """Create an agent telephony binding. + + Creates a telephony binding for the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param body: The provider-specific binding to create. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_telephony_binding( + self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.TelephonyBinding: + """Create an agent telephony binding. + + Creates a telephony binding for the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param body: The provider-specific binding to create. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_telephony_binding( + self, agent_name: str, body: Union[_models.CreateTelephonyBindingRequest, JSON, IO[bytes]], **kwargs: Any + ) -> _models.TelephonyBinding: + """Create an agent telephony binding. + + Creates a telephony binding for the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param body: The provider-specific binding to create. Is one of the following types: + CreateTelephonyBindingRequest, JSON, IO[bytes] Required. + :type body: ~azure.ai.projects.models.CreateTelephonyBindingRequest or JSON or IO[bytes] + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TelephonyBinding] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_agents_create_telephony_binding_request( + agent_name=agent_name, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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 [201]: + 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["ETag"] = self._deserialize("str", response.headers.get("ETag")) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TelephonyBinding, response.json()) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_telephony_bindings( + self, + agent_name: str, + *, + provider: Optional[Union[str, _models.TelephonyProvider]] = None, + status: Optional[Union[str, _models.TelephonyBindingStatus]] = None, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.TelephonyBindingListItem"]: + """List agent telephony bindings. + + Returns the telephony bindings owned by the voice agent named in the path. + + :param agent_name: The name of the voice agent whose bindings are listed. Required. + :type agent_name: str + :keyword provider: Filters bindings by provider. Known values are: "teams_phone_extension" and + "twilio". Default value is None. + :paramtype provider: str or ~azure.ai.projects.models.TelephonyProvider + :keyword status: Filters bindings by lifecycle status. Known values are: "active" and + "suspended". Default value is None. + :paramtype status: str or ~azure.ai.projects.models.TelephonyBindingStatus + :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 TelephonyBindingListItem + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.TelephonyBindingListItem] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.TelephonyBindingListItem]] = 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_agents_list_telephony_bindings_request( + agent_name=agent_name, + provider=provider, + status=status, + 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.TelephonyBindingListItem], + 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_telephony_binding(self, agent_name: str, binding_id: str, **kwargs: Any) -> _models.TelephonyBinding: + """Get an agent telephony binding. + + Retrieves a telephony binding owned by the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param binding_id: The service-generated binding identifier. Required. + :type binding_id: str + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :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.TelephonyBinding] = kwargs.pop("cls", None) + + _request = build_agents_get_telephony_binding_request( + agent_name=agent_name, + binding_id=binding_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) + + response_headers = {} + response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TelephonyBinding, response.json()) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def update_telephony_binding( + self, + agent_name: str, + binding_id: str, + body: _models.UpdateTelephonyBindingRequest, + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> _models.TelephonyBinding: + """Update an agent telephony binding. + + Updates a telephony binding owned by the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param binding_id: The service-generated binding identifier. Required. + :type binding_id: str + :param body: The binding properties to update. Required. + :type body: ~azure.ai.projects.models.UpdateTelephonyBindingRequest + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/merge-patch+json". + :paramtype content_type: str + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_telephony_binding( + self, + agent_name: str, + binding_id: str, + body: JSON, + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> _models.TelephonyBinding: + """Update an agent telephony binding. + + Updates a telephony binding owned by the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param binding_id: The service-generated binding identifier. Required. + :type binding_id: str + :param body: The binding properties to update. Required. + :type body: JSON + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/merge-patch+json". + :paramtype content_type: str + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_telephony_binding( + self, + agent_name: str, + binding_id: str, + body: IO[bytes], + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> _models.TelephonyBinding: + """Update an agent telephony binding. + + Updates a telephony binding owned by the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param binding_id: The service-generated binding identifier. Required. + :type binding_id: str + :param body: The binding properties to update. Required. + :type body: IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/merge-patch+json". + :paramtype content_type: str + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_telephony_binding( + self, + agent_name: str, + binding_id: str, + body: Union[_models.UpdateTelephonyBindingRequest, JSON, IO[bytes]], + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> _models.TelephonyBinding: + """Update an agent telephony binding. + + Updates a telephony binding owned by the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param binding_id: The service-generated binding identifier. Required. + :type binding_id: str + :param body: The binding properties to update. Is one of the following types: + UpdateTelephonyBindingRequest, JSON, IO[bytes] Required. + :type body: ~azure.ai.projects.models.UpdateTelephonyBindingRequest or JSON or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TelephonyBinding] = kwargs.pop("cls", None) + + content_type = content_type or "application/merge-patch+json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_agents_update_telephony_binding_request( + agent_name=agent_name, + binding_id=binding_id, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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) + + response_headers = {} + response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TelephonyBinding, response.json()) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete_telephony_binding( + self, agent_name: str, binding_id: str, *, etag: str, match_condition: MatchConditions, **kwargs: Any + ) -> None: + """Delete an agent telephony binding. + + Deletes a telephony binding owned by the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param binding_id: The service-generated binding identifier. Required. + :type binding_id: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + 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_agents_delete_telephony_binding_request( + agent_name=agent_name, + binding_id=binding_id, + etag=etag, + match_condition=match_condition, + 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_telephony_calls( + self, + agent_name: str, + *, + provider: Optional[Union[str, _models.TelephonyProvider]] = None, + status: Optional[Union[str, _models.TelephonyCallStatus]] = None, + started_after: Optional[datetime.datetime] = None, + started_before: Optional[datetime.datetime] = None, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.TelephonyCallSummary"]: + """List agent telephony calls. + + Returns the durable inbound call history for the voice agent named in the path. + + :param agent_name: The name of the voice agent whose calls are listed. Required. + :type agent_name: str + :keyword provider: Filters calls by provider. Known values are: "teams_phone_extension" and + "twilio". Default value is None. + :paramtype provider: str or ~azure.ai.projects.models.TelephonyProvider + :keyword status: Filters calls by lifecycle status. Known values are: "in_progress", "success", + and "failed". Default value is None. + :paramtype status: str or ~azure.ai.projects.models.TelephonyCallStatus + :keyword started_after: Includes calls that started at or after this Unix timestamp in seconds. + Default value is None. + :paramtype started_after: ~datetime.datetime + :keyword started_before: Includes calls that started at or before this Unix timestamp in + seconds. Default value is None. + :paramtype started_before: ~datetime.datetime + :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 TelephonyCallSummary + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.TelephonyCallSummary] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.TelephonyCallSummary]] = 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_agents_list_telephony_calls_request( + agent_name=agent_name, + provider=provider, + status=status, + started_after=started_after, + started_before=started_before, + 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.TelephonyCallSummary], + 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_telephony_call(self, agent_name: str, call_id: str, **kwargs: Any) -> _models.TelephonyCallRecord: + """Get an agent telephony call. + + Retrieves a durable inbound call record owned by the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the call record. Required. + :type agent_name: str + :param call_id: The service-generated call identifier. Required. + :type call_id: str + :return: TelephonyCallRecord. The TelephonyCallRecord is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallRecord + :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.TelephonyCallRecord] = kwargs.pop("cls", None) + + _request = build_agents_get_telephony_call_request( + agent_name=agent_name, + call_id=call_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.TelephonyCallRecord, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def transfer_telephony_call( + self, agent_name: str, call_id: str, *, target: str, content_type: str = "application/json", **kwargs: Any + ) -> _models.TelephonyCallRecord: + """Transfer an active agent telephony call. + + Transfers an active inbound call to a configured target for the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the active call. Required. + :type agent_name: str + :param call_id: The service-generated call identifier. Required. + :type call_id: str + :keyword target: The name of a transfer target configured for the voice agent. Required. + :paramtype target: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyCallRecord. The TelephonyCallRecord is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def transfer_telephony_call( + self, agent_name: str, call_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.TelephonyCallRecord: + """Transfer an active agent telephony call. + + Transfers an active inbound call to a configured target for the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the active call. Required. + :type agent_name: str + :param call_id: The service-generated call identifier. Required. + :type call_id: str + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyCallRecord. The TelephonyCallRecord is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def transfer_telephony_call( + self, agent_name: str, call_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.TelephonyCallRecord: + """Transfer an active agent telephony call. + + Transfers an active inbound call to a configured target for the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the active call. Required. + :type agent_name: str + :param call_id: The service-generated call identifier. Required. + :type call_id: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyCallRecord. The TelephonyCallRecord is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def transfer_telephony_call( + self, + agent_name: str, + call_id: str, + body: Union[JSON, IO[bytes]] = _Unset, + *, + target: str = _Unset, + **kwargs: Any + ) -> _models.TelephonyCallRecord: + """Transfer an active agent telephony call. + + Transfers an active inbound call to a configured target for the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the active call. Required. + :type agent_name: str + :param call_id: The service-generated call identifier. Required. + :type call_id: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword target: The name of a transfer target configured for the voice agent. Required. + :paramtype target: str + :return: TelephonyCallRecord. The TelephonyCallRecord is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallRecord + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TelephonyCallRecord] = kwargs.pop("cls", None) + + if body is _Unset: + if target is _Unset: + raise TypeError("missing required argument: target") + body = {"target": target} + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_agents_transfer_telephony_call_request( + agent_name=agent_name, + call_id=call_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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.TelephonyCallRecord, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def end_telephony_call(self, agent_name: str, call_id: str, **kwargs: Any) -> _models.TelephonyCallRecord: + """End an active agent telephony call. + + Ends an active inbound call owned by the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the active call. Required. + :type agent_name: str + :param call_id: The service-generated call identifier. Required. + :type call_id: str + :return: TelephonyCallRecord. The TelephonyCallRecord is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallRecord + :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.TelephonyCallRecord] = kwargs.pop("cls", None) + + _request = build_agents_end_telephony_call_request( + agent_name=agent_name, + call_id=call_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.TelephonyCallRecord, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_telephony_transfer_targets(self, agent_name: str, **kwargs: Any) -> _models.TelephonyTransferTargets: + """Get agent telephony transfer targets. + + Returns all transfer targets configured for the voice agent named in the path. + + :param agent_name: The name of the voice agent whose transfer targets are retrieved. Required. + :type agent_name: str + :return: TelephonyTransferTargets. The TelephonyTransferTargets is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyTransferTargets + :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.TelephonyTransferTargets] = kwargs.pop("cls", None) + + _request = build_agents_get_telephony_transfer_targets_request( + agent_name=agent_name, + 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) + + response_headers = {} + response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TelephonyTransferTargets, response.json()) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def replace_telephony_transfer_targets( + self, + agent_name: str, + *, + transfer_targets: List[_models.TelephonyTransferTarget], + etag: str, + match_condition: MatchConditions, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TelephonyTransferTargets: + """Replace agent telephony transfer targets. + + Replaces all transfer targets configured for the voice agent named in the path. + + :param agent_name: The name of the voice agent whose transfer targets are replaced. Required. + :type agent_name: str + :keyword 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. + :paramtype transfer_targets: list[~azure.ai.projects.models.TelephonyTransferTarget] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyTransferTargets. The TelephonyTransferTargets is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyTransferTargets + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def replace_telephony_transfer_targets( + self, + agent_name: str, + body: JSON, + *, + etag: List[_models.TelephonyTransferTarget], + match_condition: str, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TelephonyTransferTargets: + """Replace agent telephony transfer targets. + + Replaces all transfer targets configured for the voice agent named in the path. + + :param agent_name: The name of the voice agent whose transfer targets are replaced. Required. + :type agent_name: str + :param body: Required. + :type body: JSON + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: list[~azure.ai.projects.models.TelephonyTransferTarget] + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyTransferTargets. The TelephonyTransferTargets is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyTransferTargets + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def replace_telephony_transfer_targets( + self, + agent_name: str, + body: IO[bytes], + *, + etag: List[_models.TelephonyTransferTarget], + match_condition: str, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TelephonyTransferTargets: + """Replace agent telephony transfer targets. + + Replaces all transfer targets configured for the voice agent named in the path. + + :param agent_name: The name of the voice agent whose transfer targets are replaced. Required. + :type agent_name: str + :param body: Required. + :type body: IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: list[~azure.ai.projects.models.TelephonyTransferTarget] + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyTransferTargets. The TelephonyTransferTargets is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyTransferTargets + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def replace_telephony_transfer_targets( + self, + agent_name: str, + body: Union[JSON, IO[bytes]] = _Unset, + *, + transfer_targets: List[_models.TelephonyTransferTarget] = _Unset, + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> _models.TelephonyTransferTargets: + """Replace agent telephony transfer targets. + + Replaces all transfer targets configured for the voice agent named in the path. + + :param agent_name: The name of the voice agent whose transfer targets are replaced. Required. + :type agent_name: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword 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. + :paramtype transfer_targets: list[~azure.ai.projects.models.TelephonyTransferTarget] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :return: TelephonyTransferTargets. The TelephonyTransferTargets is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyTransferTargets + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TelephonyTransferTargets] = kwargs.pop("cls", None) + + if body is _Unset: + if transfer_targets is _Unset: + raise TypeError("missing required argument: transfer_targets") + body = {"transfer_targets": transfer_targets} + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_agents_replace_telephony_transfer_targets_request( + agent_name=agent_name, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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) + + response_headers = {} + response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TelephonyTransferTargets, response.json()) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + @overload async def upload_session_file( self, @@ -5530,6 +6854,186 @@ async def create_or_update( return deserialized # type: ignore +class AgentEndpointConversationsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.aio.AIProjectClient`'s + :attr:`agent_endpoint_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_async + async def get_agent_conversation_item_generated_audio( # pylint: disable=name-too-long + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.VoiceGeneratedItemAudioResponse: + """Get a voice agent conversation item's generated audio metadata. + + Returns metadata for a conversation item's generated audio. This subordinate artifact is + separate from the canonical heard-audio segment and exists only when playback was interrupted + and the service rendered more audio than the listener heard, including when the response ends + as cancelled. Returns ``404`` when the conversation or item was not persisted, or when no + generated audio exists beyond the heard segment. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose generated audio metadata is retrieved. + Required. + :type item_id: str + :return: VoiceGeneratedItemAudioResponse. The VoiceGeneratedItemAudioResponse is compatible + with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceGeneratedItemAudioResponse + :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.VoiceGeneratedItemAudioResponse] = kwargs.pop("cls", None) + + _request = build_agent_endpoint_conversations_get_agent_conversation_item_generated_audio_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.VoiceGeneratedItemAudioResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_agent_conversation_item_generated_audio_content( # pylint: disable=name-too-long + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + """Stream a voice agent conversation item's generated audio. + + Streams a conversation item's generated audio as a WAV (``audio/wav``) byte stream through the + service. This subordinate artifact exists only when playback was interrupted and the service + rendered more audio than the listener heard, including when the response ends as cancelled. + This route serves Foundry-managed storage only. For bring-your-own-storage (BYOS) recordings + the bytes are not proxied, so this route returns ``409 Conflict``. Returns ``404`` when the + conversation or item was not persisted, or when no generated audio exists beyond the heard + segment. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose generated audio is streamed. 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_agent_endpoint_conversations_get_agent_conversation_item_generated_audio_content_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 + + class ToolboxesOperations: # pylint: disable=docstring-missing-param """ .. warning:: @@ -6355,6 +7859,7 @@ async def connect_voice_agent( agent_name: str, *, foundry_features_query: Optional[Literal[_AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW]] = None, + transport: Optional[Union[str, _models.VoiceAgentTransport]] = None, store: Optional[bool] = None, agent_version_override: Optional[str] = None, websocket_subprotocol: Optional[Union[str, _models.VoiceAgentWebSocketSubprotocol]] = None, @@ -6370,11 +7875,28 @@ async def connect_voice_agent( ``foundry_features`` query parameter. - If the target agent is disabled, the HTTP WebSocket handshake fails before the ``101 Switching - Protocols`` - upgrade. The service returns ``409 Conflict`` using the shared Foundry ``ApiErrorResponse`` - shape with - ``error.code = agent_disabled``. This failure is terminal until the caller enables the agent. + Handshake failures are evaluated in the following order, independent of the requested + ``transport``: + + + + 1. Agent enablement (any transport): if the target agent is disabled, the handshake fails + before the + `101 Switching Protocols` upgrade with `409 Conflict`, using the shared Foundry + `ApiErrorResponse` shape + with `error.code = agent_disabled`. This failure is terminal until the caller enables the + agent, and it + takes precedence over the WebRTC-specific checks below. + 2. WebRTC availability (only when `transport=webrtc`, and only once the agent itself is + enabled): the agent + must have the WebRTC transport capability configured. If the agent is enabled but WebRTC is not + available + for it, the handshake fails with `404 Not Found`. This is distinct from the `409 + agent_disabled` case + above, which concerns the agent itself rather than its WebRTC capability. + 3. WebRTC compatibility (only when `transport=webrtc`): WebRTC does not support + bring-your-own-model (BYOM) + or hosted-agent voice agents; those requests fail with `400 Bad Request`. :param agent_name: The name of the voice agent. Required. :type agent_name: str @@ -6384,6 +7906,14 @@ async def connect_voice_agent( header is required. VOICE_AGENTS_V1_PREVIEW. Default value is None. :paramtype foundry_features_query: str or ~azure.ai.projects.models.VOICE_AGENTS_V1_PREVIEW + :keyword transport: Selects the connection transport. Omit or send ``websocket`` for the + default, where signaling and audio are + exchanged as JSON events over this WebSocket. Send ``webrtc`` to negotiate a WebRTC + connection: the WebSocket + then carries only SDP signaling (``rtc.call.sdp.create`` / ``rtc.call.sdp.created``) while + media and the data + channel are peer-to-peer. Known values are: "websocket" and "webrtc". Default value is None. + :paramtype transport: str or ~azure.ai.projects.models.VoiceAgentTransport :keyword store: Whether to persist the conversation created by this WebSocket session. If omitted, the service honors the persisted voice agent definition's configured ``store`` value. If supplied, this value @@ -6417,6 +7947,7 @@ async def connect_voice_agent( _request = build_beta_voice_agent_web_socket_connect_voice_agent_request( agent_name=agent_name, foundry_features_query=foundry_features_query, + transport=transport, store=store, agent_version_override=agent_version_override, websocket_subprotocol=websocket_subprotocol, diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch.py index c7920de4adbb..fc8e01edd00a 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch.py @@ -10,6 +10,7 @@ from typing import Any, List from ._patch_agents_async import AgentsOperations, BetaAgentsOperations +from ._patch_agent_endpoint_conversations_async import AgentEndpointConversationsOperations from ._patch_datasets_async import BetaDatasetsOperations, DatasetsOperations from ._patch_evaluators_async import BetaEvaluatorsOperations from ._patch_evaluation_rules_async import EvaluationRulesOperations @@ -91,6 +92,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: __all__: List[str] = [ "AgentsOperations", + "AgentEndpointConversationsOperations", "BetaAgentEndpointConversationsOperations", "BetaAgentInsightMonitorsOperations", "BetaAgentsOperations", diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agent_endpoint_conversations_async.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agent_endpoint_conversations_async.py new file mode 100644 index 000000000000..3e5e97a620de --- /dev/null +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agent_endpoint_conversations_async.py @@ -0,0 +1,142 @@ +# pylint: disable=line-too-long,useless-suppression +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" + +from typing import Any, AsyncIterator +from azure.core.exceptions import HttpResponseError +from azure.core.tracing.decorator_async import distributed_trace_async +from ._operations import AgentEndpointConversationsOperations as GeneratedAgentEndpointConversationsOperations +from ... import models as _models +from ...models._enums import _AgentDefinitionOptInKeys +from ...models._patch import ( + _FOUNDRY_FEATURES_HEADER_NAME, + _has_header_case_insensitive, + _PREVIEW_FEATURE_REQUIRED_CODE, + _PREVIEW_FEATURE_ADDED_ERROR_MESSAGE, +) + + +class AgentEndpointConversationsOperations(GeneratedAgentEndpointConversationsOperations): + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.aio.AIProjectClient`'s + :attr:`agent_endpoint_conversations` attribute. + """ + + @distributed_trace_async + async def get_agent_conversation_item_generated_audio( # pylint: disable=name-too-long # type: ignore[override] + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.VoiceGeneratedItemAudioResponse: + """Get a voice agent conversation item's generated audio metadata. + + Returns metadata for a conversation item's generated audio. This subordinate artifact is + separate from the canonical heard-audio segment and exists only when playback was interrupted + and the service rendered more audio than the listener heard, including when the response ends + as cancelled. Returns ``404`` when the conversation or item was not persisted, or when no + generated audio exists beyond the heard segment. When the client is constructed with + ``allow_preview=True``, the required preview opt-in header is added automatically. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose generated audio metadata is retrieved. + Required. + :type item_id: str + :return: VoiceGeneratedItemAudioResponse. The VoiceGeneratedItemAudioResponse is compatible + with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceGeneratedItemAudioResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + # Add Foundry-Features header if not already present + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = { + _FOUNDRY_FEATURES_HEADER_NAME: _AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.value + } + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.value + kwargs["headers"] = headers + + try: + return await super().get_agent_conversation_item_generated_audio( + agent_name, conversation_id, item_id, **kwargs + ) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + + @distributed_trace_async + async def get_agent_conversation_item_generated_audio_content( # pylint: disable=name-too-long # type: ignore[override] + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + """Stream a voice agent conversation item's generated audio. + + Streams a conversation item's generated audio as a WAV (``audio/wav``) byte stream through the + service. This subordinate artifact exists only when playback was interrupted and the service + rendered more audio than the listener heard, including when the response ends as cancelled. + This route serves Foundry-managed storage only. For bring-your-own-storage (BYOS) recordings + the bytes are not proxied, so this route returns ``409 Conflict``. Returns ``404`` when the + conversation or item was not persisted, or when no generated audio exists beyond the heard + segment. When the client is constructed with ``allow_preview=True``, the required preview + opt-in header is added automatically. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose generated audio is streamed. Required. + :type item_id: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = { + _FOUNDRY_FEATURES_HEADER_NAME: _AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.value + } + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.value + kwargs["headers"] = headers + + try: + return await super().get_agent_conversation_item_generated_audio_content( + agent_name, conversation_id, item_id, **kwargs + ) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py index 1e6210e482b1..70138de44d37 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py @@ -1,4 +1,4 @@ -# pylint: disable=line-too-long,useless-suppression +# pylint: disable=line-too-long,useless-suppression,too-many-lines # ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. @@ -8,10 +8,14 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import Union, Optional, Any, IO, cast, overload, TYPE_CHECKING +import datetime +from typing import Union, Optional, Any, IO, List, cast, overload, TYPE_CHECKING +from azure.core import MatchConditions +from azure.core.async_paging import AsyncItemPaged from azure.core.exceptions import HttpResponseError from azure.core.polling import AsyncNoPolling, AsyncPollingMethod from azure.core.polling.async_base_polling import AsyncLROBasePolling +from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict from ._operations import ( @@ -370,6 +374,922 @@ async def generate_agent(self, body: _models.GenerateVoiceAgentRequest, **kwargs raise new_exc from exc raise + @overload # type: ignore[override] + async def create_telephony_binding( + self, + agent_name: str, + body: _models.CreateTelephonyBindingRequest, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> _models.TelephonyBinding: + """Create an agent telephony binding. + + Creates a telephony binding for the voice agent named in the path. When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param body: The provider-specific binding to create. Required. + :type body: ~azure.ai.projects.models.CreateTelephonyBindingRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_telephony_binding( + self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.TelephonyBinding: + """Create an agent telephony binding. + + Creates a telephony binding for the voice agent named in the path. When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param body: The provider-specific binding to create. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_telephony_binding( + self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.TelephonyBinding: + """Create an agent telephony binding. + + Creates a telephony binding for the voice agent named in the path. When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param body: The provider-specific binding to create. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_telephony_binding( # type: ignore[override] + self, agent_name: str, body: Union[_models.CreateTelephonyBindingRequest, JSON, IO[bytes]], **kwargs: Any + ) -> _models.TelephonyBinding: + """Create an agent telephony binding. + + Creates a telephony binding for the voice agent named in the path. When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param body: The provider-specific binding to create. Is one of the following types: + CreateTelephonyBindingRequest, JSON, IO[bytes] Required. + :type body: ~azure.ai.projects.models.CreateTelephonyBindingRequest or JSON or IO[bytes] + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + + if getattr(self._config, "allow_preview", False): + # Add Foundry-Features header if not already present + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS + kwargs["headers"] = headers + + try: + return await super().create_telephony_binding(agent_name, body, **kwargs) # type: ignore[arg-type] + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + + @distributed_trace + def list_telephony_bindings( # type: ignore[override] + self, + agent_name: str, + *, + provider: Optional[Union[str, _models.TelephonyProvider]] = None, + status: Optional[Union[str, _models.TelephonyBindingStatus]] = None, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any, + ) -> AsyncItemPaged["_models.TelephonyBindingListItem"]: + """List agent telephony bindings. + + Returns the telephony bindings owned by the voice agent named in the path. When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the voice agent whose bindings are listed. Required. + :type agent_name: str + :keyword provider: Filters bindings by provider. Known values are: "teams_phone_extension" and + "twilio". Default value is None. + :paramtype provider: str or ~azure.ai.projects.models.TelephonyProvider + :keyword status: Filters bindings by lifecycle status. Known values are: "active" and + "suspended". Default value is None. + :paramtype status: str or ~azure.ai.projects.models.TelephonyBindingStatus + :keyword limit: A limit on the number of objects to be returned. Default value is None. + :paramtype limit: int + :keyword order: Sort order by the ``created_at`` timestamp of the objects. 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. Default value is None. + :paramtype before: str + :return: An iterator like instance of TelephonyBindingListItem + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.TelephonyBindingListItem] + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + # Add Foundry-Features header if not already present + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS + kwargs["headers"] = headers + + return super().list_telephony_bindings( + agent_name, provider=provider, status=status, limit=limit, order=order, before=before, **kwargs + ) + + @distributed_trace_async + async def get_telephony_binding( # type: ignore[override] + self, agent_name: str, binding_id: str, **kwargs: Any + ) -> _models.TelephonyBinding: + """Get an agent telephony binding. + + Retrieves a telephony binding owned by the voice agent named in the path. When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param binding_id: The service-generated binding identifier. Required. + :type binding_id: str + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS + kwargs["headers"] = headers + + try: + return await super().get_telephony_binding(agent_name, binding_id, **kwargs) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + + @overload # type: ignore[override] + async def update_telephony_binding( + self, + agent_name: str, + binding_id: str, + body: _models.UpdateTelephonyBindingRequest, + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/merge-patch+json", + **kwargs: Any, + ) -> _models.TelephonyBinding: + """Update an agent telephony binding. + + Updates a telephony binding owned by the voice agent named in the path. When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param binding_id: The service-generated binding identifier. Required. + :type binding_id: str + :param body: The binding properties to update. Required. + :type body: ~azure.ai.projects.models.UpdateTelephonyBindingRequest + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/merge-patch+json". + :paramtype content_type: str + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_telephony_binding( + self, + agent_name: str, + binding_id: str, + body: JSON, + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/merge-patch+json", + **kwargs: Any, + ) -> _models.TelephonyBinding: + """Update an agent telephony binding. + + Updates a telephony binding owned by the voice agent named in the path. When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param binding_id: The service-generated binding identifier. Required. + :type binding_id: str + :param body: The binding properties to update. Required. + :type body: JSON + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/merge-patch+json". + :paramtype content_type: str + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_telephony_binding( + self, + agent_name: str, + binding_id: str, + body: IO[bytes], + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/merge-patch+json", + **kwargs: Any, + ) -> _models.TelephonyBinding: + """Update an agent telephony binding. + + Updates a telephony binding owned by the voice agent named in the path. When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param binding_id: The service-generated binding identifier. Required. + :type binding_id: str + :param body: The binding properties to update. Required. + :type body: IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/merge-patch+json". + :paramtype content_type: str + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_telephony_binding( # type: ignore[override] + self, + agent_name: str, + binding_id: str, + body: Union[_models.UpdateTelephonyBindingRequest, JSON, IO[bytes]], + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any, + ) -> _models.TelephonyBinding: + """Update an agent telephony binding. + + Updates a telephony binding owned by the voice agent named in the path. When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param binding_id: The service-generated binding identifier. Required. + :type binding_id: str + :param body: The binding properties to update. Is one of the following types: + UpdateTelephonyBindingRequest, JSON, IO[bytes] Required. + :type body: ~azure.ai.projects.models.UpdateTelephonyBindingRequest or JSON or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS + kwargs["headers"] = headers + + try: + return await super().update_telephony_binding( # type: ignore[arg-type] + agent_name, binding_id, body, etag=etag, match_condition=match_condition, **kwargs + ) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + + @distributed_trace_async + async def delete_telephony_binding( # type: ignore[override] # pylint: disable=inconsistent-return-statements + self, agent_name: str, binding_id: str, *, etag: str, match_condition: MatchConditions, **kwargs: Any + ) -> None: + """Delete an agent telephony binding. + + Deletes a telephony binding owned by the voice agent named in the path. When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param binding_id: The service-generated binding identifier. Required. + :type binding_id: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS + kwargs["headers"] = headers + + try: + return await super().delete_telephony_binding(agent_name, binding_id, etag=etag, match_condition=match_condition, **kwargs) # type: ignore[misc] + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + + @distributed_trace + def list_telephony_calls( # type: ignore[override] + self, + agent_name: str, + *, + provider: Optional[Union[str, _models.TelephonyProvider]] = None, + status: Optional[Union[str, _models.TelephonyCallStatus]] = None, + started_after: Optional[datetime.datetime] = None, + started_before: Optional[datetime.datetime] = None, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any, + ) -> AsyncItemPaged["_models.TelephonyCallSummary"]: + """List agent telephony calls. + + Returns the durable inbound call history for the voice agent named in the path. When the + client is constructed with ``allow_preview=True``, the required preview opt-in header is + added automatically. + + :param agent_name: The name of the voice agent whose calls are listed. Required. + :type agent_name: str + :keyword provider: Filters calls by provider. Known values are: "teams_phone_extension" and + "twilio". Default value is None. + :paramtype provider: str or ~azure.ai.projects.models.TelephonyProvider + :keyword status: Filters calls by lifecycle status. Known values are: "in_progress", + "success", and "failed". Default value is None. + :paramtype status: str or ~azure.ai.projects.models.TelephonyCallStatus + :keyword started_after: Includes calls that started at or after this Unix timestamp in + seconds. Default value is None. + :paramtype started_after: ~datetime.datetime + :keyword started_before: Includes calls that started at or before this Unix timestamp in + seconds. Default value is None. + :paramtype started_before: ~datetime.datetime + :keyword limit: A limit on the number of objects to be returned. Default value is None. + :paramtype limit: int + :keyword order: Sort order by the ``created_at`` timestamp of the objects. 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. Default value is None. + :paramtype before: str + :return: An iterator like instance of TelephonyCallSummary + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.TelephonyCallSummary] + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS + kwargs["headers"] = headers + + return super().list_telephony_calls( + agent_name, + provider=provider, + status=status, + started_after=started_after, + started_before=started_before, + limit=limit, + order=order, + before=before, + **kwargs, + ) + + @distributed_trace_async + async def get_telephony_call( # type: ignore[override] + self, agent_name: str, call_id: str, **kwargs: Any + ) -> _models.TelephonyCallRecord: + """Get an agent telephony call. + + Retrieves a durable inbound call record owned by the voice agent named in the path. When the + client is constructed with ``allow_preview=True``, the required preview opt-in header is + added automatically. + + :param agent_name: The name of the voice agent that owns the call record. Required. + :type agent_name: str + :param call_id: The service-generated call identifier. Required. + :type call_id: str + :return: TelephonyCallRecord. The TelephonyCallRecord is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS + kwargs["headers"] = headers + + try: + return await super().get_telephony_call(agent_name, call_id, **kwargs) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + + @overload # type: ignore[override] + async def transfer_telephony_call( + self, agent_name: str, call_id: str, *, target: str, content_type: str = "application/json", **kwargs: Any + ) -> _models.TelephonyCallRecord: + """Transfer an active agent telephony call. + + Transfers an active inbound call to a configured target for the voice agent named in the + path. When the client is constructed with ``allow_preview=True``, the required preview opt-in + header is added automatically. + + :param agent_name: The name of the voice agent that owns the active call. Required. + :type agent_name: str + :param call_id: The service-generated call identifier. Required. + :type call_id: str + :keyword target: The name of a transfer target configured for the voice agent. Required. + :paramtype target: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyCallRecord. The TelephonyCallRecord is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def transfer_telephony_call( + self, agent_name: str, call_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.TelephonyCallRecord: + """Transfer an active agent telephony call. + + Transfers an active inbound call to a configured target for the voice agent named in the + path. When the client is constructed with ``allow_preview=True``, the required preview opt-in + header is added automatically. + + :param agent_name: The name of the voice agent that owns the active call. Required. + :type agent_name: str + :param call_id: The service-generated call identifier. Required. + :type call_id: str + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyCallRecord. The TelephonyCallRecord is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def transfer_telephony_call( + self, + agent_name: str, + call_id: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> _models.TelephonyCallRecord: + """Transfer an active agent telephony call. + + Transfers an active inbound call to a configured target for the voice agent named in the + path. When the client is constructed with ``allow_preview=True``, the required preview opt-in + header is added automatically. + + :param agent_name: The name of the voice agent that owns the active call. Required. + :type agent_name: str + :param call_id: The service-generated call identifier. Required. + :type call_id: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyCallRecord. The TelephonyCallRecord is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def transfer_telephony_call( # type: ignore[override] + self, + agent_name: str, + call_id: str, + body: Union[JSON, IO[bytes]] = _Unset, + *, + target: str = _Unset, + **kwargs: Any, + ) -> _models.TelephonyCallRecord: + """Transfer an active agent telephony call. + + Transfers an active inbound call to a configured target for the voice agent named in the + path. When the client is constructed with ``allow_preview=True``, the required preview opt-in + header is added automatically. + + :param agent_name: The name of the voice agent that owns the active call. Required. + :type agent_name: str + :param call_id: The service-generated call identifier. Required. + :type call_id: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword target: The name of a transfer target configured for the voice agent. Required. + :paramtype target: str + :return: TelephonyCallRecord. The TelephonyCallRecord is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS + kwargs["headers"] = headers + + try: + return await super().transfer_telephony_call(agent_name, call_id, body, target=target, **kwargs) # type: ignore[misc] + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + + @distributed_trace_async + async def end_telephony_call( # type: ignore[override] + self, agent_name: str, call_id: str, **kwargs: Any + ) -> _models.TelephonyCallRecord: + """End an active agent telephony call. + + Ends an active inbound call owned by the voice agent named in the path. When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the voice agent that owns the active call. Required. + :type agent_name: str + :param call_id: The service-generated call identifier. Required. + :type call_id: str + :return: TelephonyCallRecord. The TelephonyCallRecord is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS + kwargs["headers"] = headers + + try: + return await super().end_telephony_call(agent_name, call_id, **kwargs) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + + @distributed_trace_async + async def get_telephony_transfer_targets( # type: ignore[override] + self, agent_name: str, **kwargs: Any + ) -> _models.TelephonyTransferTargets: + """Get agent telephony transfer targets. + + Returns all transfer targets configured for the voice agent named in the path. When the + client is constructed with ``allow_preview=True``, the required preview opt-in header is + added automatically. + + :param agent_name: The name of the voice agent whose transfer targets are retrieved. Required. + :type agent_name: str + :return: TelephonyTransferTargets. The TelephonyTransferTargets is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyTransferTargets + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS + kwargs["headers"] = headers + + try: + return await super().get_telephony_transfer_targets(agent_name, **kwargs) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + + @overload # type: ignore[override] + async def replace_telephony_transfer_targets( + self, + agent_name: str, + *, + transfer_targets: List[_models.TelephonyTransferTarget], + etag: str, + match_condition: MatchConditions, + content_type: str = "application/json", + **kwargs: Any, + ) -> _models.TelephonyTransferTargets: + """Replace agent telephony transfer targets. + + Replaces all transfer targets configured for the voice agent named in the path. When the + client is constructed with ``allow_preview=True``, the required preview opt-in header is + added automatically. + + :param agent_name: The name of the voice agent whose transfer targets are replaced. Required. + :type agent_name: str + :keyword 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. + :paramtype transfer_targets: list[~azure.ai.projects.models.TelephonyTransferTarget] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyTransferTargets. The TelephonyTransferTargets is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyTransferTargets + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def replace_telephony_transfer_targets( + self, + agent_name: str, + body: JSON, + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/json", + **kwargs: Any, + ) -> _models.TelephonyTransferTargets: + """Replace agent telephony transfer targets. + + Replaces all transfer targets configured for the voice agent named in the path. When the + client is constructed with ``allow_preview=True``, the required preview opt-in header is + added automatically. + + :param agent_name: The name of the voice agent whose transfer targets are replaced. Required. + :type agent_name: str + :param body: Required. + :type body: JSON + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyTransferTargets. The TelephonyTransferTargets is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyTransferTargets + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def replace_telephony_transfer_targets( + self, + agent_name: str, + body: IO[bytes], + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/json", + **kwargs: Any, + ) -> _models.TelephonyTransferTargets: + """Replace agent telephony transfer targets. + + Replaces all transfer targets configured for the voice agent named in the path. When the + client is constructed with ``allow_preview=True``, the required preview opt-in header is + added automatically. + + :param agent_name: The name of the voice agent whose transfer targets are replaced. Required. + :type agent_name: str + :param body: Required. + :type body: IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyTransferTargets. The TelephonyTransferTargets is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyTransferTargets + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def replace_telephony_transfer_targets( # type: ignore[override] + self, + agent_name: str, + body: Union[JSON, IO[bytes]] = _Unset, + *, + transfer_targets: List[_models.TelephonyTransferTarget] = _Unset, + etag: str, + match_condition: MatchConditions, + **kwargs: Any, + ) -> _models.TelephonyTransferTargets: + """Replace agent telephony transfer targets. + + Replaces all transfer targets configured for the voice agent named in the path. When the + client is constructed with ``allow_preview=True``, the required preview opt-in header is + added automatically. + + :param agent_name: The name of the voice agent whose transfer targets are replaced. Required. + :type agent_name: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword 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. + :paramtype transfer_targets: list[~azure.ai.projects.models.TelephonyTransferTarget] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :return: TelephonyTransferTargets. The TelephonyTransferTargets is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyTransferTargets + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS + kwargs["headers"] = headers + + try: + return await super().replace_telephony_transfer_targets( # type: ignore[arg-type] + agent_name, + body, + transfer_targets=transfer_targets, + etag=etag, + match_condition=match_condition, + **kwargs, + ) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + class BetaAgentsOperations(BetaAgentsOperationsGenerated): """Custom async operations for beta agent optimization jobs.""" 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 d11874d721d9..e28dadacee0a 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 @@ -132,7 +132,10 @@ CosmosDBIndex, CreateAsyncResponse, CreateSkillVersionFromFilesBody, + CreateTeamsPhoneExtensionTelephonyBindingRequest, + CreateTelephonyBindingRequest, CreateTranscriptionResponseJsonUsage, + CreateTwilioTelephonyBindingRequest, CronTrigger, CustomCredential, CustomGrammarFormatParam, @@ -297,6 +300,7 @@ OpenApiToolboxTool, OptimizedAgentIdentifier, OtlpTelemetryEndpoint, + PSTNTelephonyTransferDestination, PendingUploadRequest, PendingUploadResponse, PickPropertiesVoiceAgentAudioConfig, @@ -433,6 +437,7 @@ ShellToolboxTool, SimpleQnADataGenerationJobOptions, SimulationSeedDataGenerationJobOptions, + SipTelephonyTransferDestination, SkillDetails, SkillInlineContent, SkillReferenceParam, @@ -444,9 +449,22 @@ StructuredOutputDefinition, TaxonomyCategory, TaxonomySubCategory, + TeamsPhoneExtensionTelephonyBinding, + TeamsPhoneExtensionTelephonyBindingListItem, + TeamsTelephonyTransferDestination, TelemetryConfig, TelemetryEndpoint, TelemetryEndpointAuth, + TelephonyBinding, + TelephonyBindingListItem, + TelephonyCallLifecycleEvent, + TelephonyCallRecord, + TelephonyCallSummary, + TelephonyCallTiming, + TelephonyCallTrace, + TelephonyTransferDestination, + TelephonyTransferTarget, + TelephonyTransferTargets, TextResponseFormat, TextResponseFormatJsonObject, TextResponseFormatJsonSchema, @@ -492,7 +510,10 @@ TranscriptTextUsageTokensInputTokenDetails, TranscriptionLanguage, Trigger, + TwilioTelephonyBinding, + TwilioTelephonyBindingListItem, UpdateModelVersionRequest, + UpdateTelephonyBindingRequest, UpdateToolboxRequest, UserProfileMemoryItem, VersionIndicator, @@ -513,6 +534,7 @@ VoiceAgentAzureSemanticVadEnTurnDetection, VoiceAgentAzureSemanticVadMultilingualTurnDetection, VoiceAgentAzureSemanticVadTurnDetection, + VoiceAgentClientEventRtcCallSdpCreate, VoiceAgentClientEventSessionAvatarConnect, VoiceAgentClientEventSessionUpdate, VoiceAgentDefinition, @@ -529,6 +551,7 @@ VoiceAgentRealtimeResponse, VoiceAgentRealtimeResponseBase, VoiceAgentResponseCreateParams, + VoiceAgentRtcCallErrorDetails, VoiceAgentSemanticVadTurnDetection, VoiceAgentServerEventResponseAnimationBlendshapesDelta, VoiceAgentServerEventResponseAnimationBlendshapesDone, @@ -537,9 +560,14 @@ VoiceAgentServerEventResponseAudioTimestampDelta, VoiceAgentServerEventResponseAudioTimestampDone, VoiceAgentServerEventResponseVideoDelta, + VoiceAgentServerEventRtcCallError, + VoiceAgentServerEventRtcCallSdpCreated, VoiceAgentServerEventSessionAvatarConnecting, VoiceAgentServerEventSessionAvatarSwitchToIdle, VoiceAgentServerEventSessionAvatarSwitchToSpeaking, + VoiceAgentServerEventSessionSubagentAborted, + VoiceAgentServerEventSessionSubagentCompleted, + VoiceAgentServerEventSessionSubagentStarted, VoiceAgentServerEventWarning, VoiceAgentServerEventWarningDetails, VoiceAgentServerVadTurnDetection, @@ -547,6 +575,9 @@ VoiceAgentSessionResponseConfig, VoiceAgentSessionUpdateConfig, VoiceAgentStaticInterimResponseConfig, + VoiceAgentSubAgent, + VoiceAgentSubAgentConfig, + VoiceAgentSubagentResponsePolicy, VoiceAgentSystemTool, VoiceAgentTemplateGreetingConfig, VoiceAgentTool, @@ -555,6 +586,9 @@ VoiceAgentTranscriptionWord, VoiceAgentTurnDetectionConfig, VoiceConversation, + VoiceConversationEngine, + VoiceGeneratedItemAudioResponse, + VoiceHostedAgentConversationEngine, VoiceItemAudioResponse, VoiceRecordingChannelLayout, VoiceRecordingResponse, @@ -683,6 +717,18 @@ TelemetryEndpointAuthType, TelemetryEndpointKind, TelemetryTransportProtocol, + TelephonyBindingStatus, + TelephonyCallDurationBasis, + TelephonyCallLifecycleEventName, + TelephonyCallLifecycleEventOutcome, + TelephonyCallLifecycleEventSource, + TelephonyCallPhase, + TelephonyCallStatus, + TelephonyCallTimestampSource, + TelephonyCallTraceMode, + TelephonyCallTraceStatus, + TelephonyProvider, + TelephonyTransferDestinationKind, TextResponseFormatConfigurationType, ToolChoiceOptions, ToolChoiceParamType, @@ -704,8 +750,10 @@ VoiceAgentInterimResponseTrigger, VoiceAgentNoiseReductionType, VoiceAgentSessionIncludeOption, + VoiceAgentSubagentAbortReason, VoiceAgentSystemToolName, VoiceAgentToolResponseScheduling, + VoiceAgentTransport, VoiceAgentTurnDetectionType, VoiceAgentWebSocketSubprotocol, VoiceAudioCodec, @@ -838,7 +886,10 @@ "CosmosDBIndex", "CreateAsyncResponse", "CreateSkillVersionFromFilesBody", + "CreateTeamsPhoneExtensionTelephonyBindingRequest", + "CreateTelephonyBindingRequest", "CreateTranscriptionResponseJsonUsage", + "CreateTwilioTelephonyBindingRequest", "CronTrigger", "CustomCredential", "CustomGrammarFormatParam", @@ -1003,6 +1054,7 @@ "OpenApiToolboxTool", "OptimizedAgentIdentifier", "OtlpTelemetryEndpoint", + "PSTNTelephonyTransferDestination", "PendingUploadRequest", "PendingUploadResponse", "PickPropertiesVoiceAgentAudioConfig", @@ -1139,6 +1191,7 @@ "ShellToolboxTool", "SimpleQnADataGenerationJobOptions", "SimulationSeedDataGenerationJobOptions", + "SipTelephonyTransferDestination", "SkillDetails", "SkillInlineContent", "SkillReferenceParam", @@ -1150,9 +1203,22 @@ "StructuredOutputDefinition", "TaxonomyCategory", "TaxonomySubCategory", + "TeamsPhoneExtensionTelephonyBinding", + "TeamsPhoneExtensionTelephonyBindingListItem", + "TeamsTelephonyTransferDestination", "TelemetryConfig", "TelemetryEndpoint", "TelemetryEndpointAuth", + "TelephonyBinding", + "TelephonyBindingListItem", + "TelephonyCallLifecycleEvent", + "TelephonyCallRecord", + "TelephonyCallSummary", + "TelephonyCallTiming", + "TelephonyCallTrace", + "TelephonyTransferDestination", + "TelephonyTransferTarget", + "TelephonyTransferTargets", "TextResponseFormat", "TextResponseFormatJsonObject", "TextResponseFormatJsonSchema", @@ -1198,7 +1264,10 @@ "TranscriptTextUsageTokensInputTokenDetails", "TranscriptionLanguage", "Trigger", + "TwilioTelephonyBinding", + "TwilioTelephonyBindingListItem", "UpdateModelVersionRequest", + "UpdateTelephonyBindingRequest", "UpdateToolboxRequest", "UserProfileMemoryItem", "VersionIndicator", @@ -1219,6 +1288,7 @@ "VoiceAgentAzureSemanticVadEnTurnDetection", "VoiceAgentAzureSemanticVadMultilingualTurnDetection", "VoiceAgentAzureSemanticVadTurnDetection", + "VoiceAgentClientEventRtcCallSdpCreate", "VoiceAgentClientEventSessionAvatarConnect", "VoiceAgentClientEventSessionUpdate", "VoiceAgentDefinition", @@ -1235,6 +1305,7 @@ "VoiceAgentRealtimeResponse", "VoiceAgentRealtimeResponseBase", "VoiceAgentResponseCreateParams", + "VoiceAgentRtcCallErrorDetails", "VoiceAgentSemanticVadTurnDetection", "VoiceAgentServerEventResponseAnimationBlendshapesDelta", "VoiceAgentServerEventResponseAnimationBlendshapesDone", @@ -1243,9 +1314,14 @@ "VoiceAgentServerEventResponseAudioTimestampDelta", "VoiceAgentServerEventResponseAudioTimestampDone", "VoiceAgentServerEventResponseVideoDelta", + "VoiceAgentServerEventRtcCallError", + "VoiceAgentServerEventRtcCallSdpCreated", "VoiceAgentServerEventSessionAvatarConnecting", "VoiceAgentServerEventSessionAvatarSwitchToIdle", "VoiceAgentServerEventSessionAvatarSwitchToSpeaking", + "VoiceAgentServerEventSessionSubagentAborted", + "VoiceAgentServerEventSessionSubagentCompleted", + "VoiceAgentServerEventSessionSubagentStarted", "VoiceAgentServerEventWarning", "VoiceAgentServerEventWarningDetails", "VoiceAgentServerVadTurnDetection", @@ -1253,6 +1329,9 @@ "VoiceAgentSessionResponseConfig", "VoiceAgentSessionUpdateConfig", "VoiceAgentStaticInterimResponseConfig", + "VoiceAgentSubAgent", + "VoiceAgentSubAgentConfig", + "VoiceAgentSubagentResponsePolicy", "VoiceAgentSystemTool", "VoiceAgentTemplateGreetingConfig", "VoiceAgentTool", @@ -1261,6 +1340,9 @@ "VoiceAgentTranscriptionWord", "VoiceAgentTurnDetectionConfig", "VoiceConversation", + "VoiceConversationEngine", + "VoiceGeneratedItemAudioResponse", + "VoiceHostedAgentConversationEngine", "VoiceItemAudioResponse", "VoiceRecordingChannelLayout", "VoiceRecordingResponse", @@ -1386,6 +1468,18 @@ "TelemetryEndpointAuthType", "TelemetryEndpointKind", "TelemetryTransportProtocol", + "TelephonyBindingStatus", + "TelephonyCallDurationBasis", + "TelephonyCallLifecycleEventName", + "TelephonyCallLifecycleEventOutcome", + "TelephonyCallLifecycleEventSource", + "TelephonyCallPhase", + "TelephonyCallStatus", + "TelephonyCallTimestampSource", + "TelephonyCallTraceMode", + "TelephonyCallTraceStatus", + "TelephonyProvider", + "TelephonyTransferDestinationKind", "TextResponseFormatConfigurationType", "ToolChoiceOptions", "ToolChoiceParamType", @@ -1407,8 +1501,10 @@ "VoiceAgentInterimResponseTrigger", "VoiceAgentNoiseReductionType", "VoiceAgentSessionIncludeOption", + "VoiceAgentSubagentAbortReason", "VoiceAgentSystemToolName", "VoiceAgentToolResponseScheduling", + "VoiceAgentTransport", "VoiceAgentTurnDetectionType", "VoiceAgentWebSocketSubprotocol", "VoiceAudioCodec", 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 5a1571689af9..3fa58f3b8800 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 @@ -1061,6 +1061,8 @@ class RealtimeClientEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """SESSION_UPDATE.""" SESSION_AVATAR_CONNECT = "session.avatar.connect" """SESSION_AVATAR_CONNECT.""" + RTC_CALL_SDP_CREATE = "rtc.call.sdp.create" + """RTC_CALL_SDP_CREATE.""" class RealtimeConversationItemMessageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -1218,12 +1220,22 @@ class RealtimeServerEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """RESPONSE_MCP_CALL_FAILED.""" WARNING = "warning" """WARNING.""" + SESSION_SUBAGENT_STARTED = "session.subagent.started" + """SESSION_SUBAGENT_STARTED.""" + SESSION_SUBAGENT_COMPLETED = "session.subagent.completed" + """SESSION_SUBAGENT_COMPLETED.""" + SESSION_SUBAGENT_ABORTED = "session.subagent.aborted" + """SESSION_SUBAGENT_ABORTED.""" SESSION_AVATAR_CONNECTING = "session.avatar.connecting" """SESSION_AVATAR_CONNECTING.""" SESSION_AVATAR_SWITCH_TO_SPEAKING = "session.avatar.switch_to_speaking" """SESSION_AVATAR_SWITCH_TO_SPEAKING.""" SESSION_AVATAR_SWITCH_TO_IDLE = "session.avatar.switch_to_idle" """SESSION_AVATAR_SWITCH_TO_IDLE.""" + RTC_CALL_SDP_CREATED = "rtc.call.sdp.created" + """RTC_CALL_SDP_CREATED.""" + RTC_CALL_ERROR = "rtc.call.error" + """RTC_CALL_ERROR.""" RESPONSE_AUDIO_TIMESTAMP_DELTA = "response.audio_timestamp.delta" """RESPONSE_AUDIO_TIMESTAMP_DELTA.""" RESPONSE_AUDIO_TIMESTAMP_DONE = "response.audio_timestamp.done" @@ -1537,6 +1549,186 @@ class TelemetryTransportProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): """gRPC transport protocol.""" +class TelephonyBindingStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The lifecycle status of a telephony binding.""" + + ACTIVE = "active" + """The binding accepts new inbound calls.""" + SUSPENDED = "suspended" + """The binding remains configured but rejects new inbound calls.""" + + +class TelephonyCallDurationBasis(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The timestamp used as the basis for call duration.""" + + ANSWERED = "answered" + """Duration starts when the provider reports the call as answered.""" + RECEIVED = "received" + """Duration starts when the inbound webhook is received because no answered timestamp is + available.""" + + +class TelephonyCallLifecycleEventName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """A provider-neutral lifecycle event name. Known values are stable; additional values may be + added over time. + """ + + WEBHOOK_RECEIVED = "telephony.webhook.received" + """The provider webhook was received.""" + WEBHOOK_VALIDATION = "telephony.webhook.validation" + """The provider webhook was validated.""" + BINDING_RESOLVE = "telephony.binding.resolve" + """The service attempted to resolve the agent binding.""" + PROVIDER_ANSWER = "telephony.provider.answer" + """The service requested or observed provider answer state.""" + MEDIA_CONNECT = "telephony.media.connect" + """The provider media channel changed connection state.""" + AGENT_SESSION_CONNECT = "telephony.agent_session.connect" + """The voice-agent session changed connection state.""" + FIRST_CALLER_AUDIO = "telephony.media.first_caller_audio" + """The first caller audio was observed.""" + FIRST_AGENT_AUDIO = "telephony.media.first_agent_audio" + """The first agent audio was observed.""" + CALL_TRANSFER = "telephony.call.transfer" + """A call transfer changed state.""" + CALL_HANGUP = "telephony.call.hangup" + """A call hang-up changed state.""" + CALL_DISCONNECT = "telephony.call.disconnect" + """The call disconnected.""" + + +class TelephonyCallLifecycleEventOutcome(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The outcome of one telephony lifecycle observation.""" + + OBSERVED = "observed" + """The event was observed without a success or failure result.""" + STARTED = "started" + """The operation started.""" + SUCCEEDED = "succeeded" + """The operation succeeded.""" + FAILED = "failed" + """The operation failed.""" + REJECTED = "rejected" + """The operation or call was rejected.""" + CANCELLED = "cancelled" + """The operation was cancelled.""" + + +class TelephonyCallLifecycleEventSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The component that supplied a telephony lifecycle observation.""" + + GATEWAY = "gateway" + """The Foundry telephony gateway supplied the observation.""" + TEAMS_PHONE_EXTENSION = "teams_phone_extension" + """Microsoft Teams Phone Extension supplied the observation.""" + TWILIO = "twilio" + """Twilio supplied the observation.""" + VOICE_AGENT = "voice_agent" + """The voice-agent runtime supplied the observation.""" + + +class TelephonyCallPhase(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The provider-neutral phase reached by an inbound telephony call.""" + + RECEIVED = "received" + """The provider webhook was received.""" + VALIDATED = "validated" + """The provider webhook was validated.""" + ADMITTED = "admitted" + """The call was admitted to a configured agent binding.""" + ANSWERING = "answering" + """The provider was asked to answer the call.""" + ANSWERED = "answered" + """The provider reported that the call was answered.""" + MEDIA_CONNECTED = "media_connected" + """The provider media channel was connected.""" + AGENT_SESSION_READY = "agent_session_ready" + """The voice-agent session was ready.""" + BRIDGING = "bridging" + """Media was actively bridged between the caller and the voice agent.""" + MANAGING = "managing" + """A mid-call management command was in progress.""" + COMPLETED = "completed" + """The call completed.""" + REJECTED = "rejected" + """The call was rejected before admission or answer.""" + FAILED = "failed" + """The call failed.""" + + +class TelephonyCallStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The lifecycle status of an inbound telephony call.""" + + IN_PROGRESS = "in_progress" + """The call has started and has not reached a terminal state.""" + SUCCESS = "success" + """The call ended successfully.""" + FAILED = "failed" + """The call ended because of a provider or management failure.""" + + +class TelephonyCallTimestampSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The source of a telephony lifecycle timestamp.""" + + PROVIDER = "provider" + """The telephony provider supplied the timestamp.""" + GATEWAY = "gateway" + """The Foundry telephony gateway observed the event.""" + DERIVED = "derived" + """The service derived the timestamp from another observation.""" + + +class TelephonyCallTraceMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The mode used to expose a telephony call as a customer-facing Foundry trace.""" + + LIVE = "live" + """The trace was created while the voice-agent conversation was live.""" + POST_CALL = "post_call" + """The trace summarizes a validated, customer-owned call that ended before a live voice-agent + conversation was created.""" + + +class TelephonyCallTraceStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The availability status of a customer-facing telephony call trace.""" + + PENDING = "pending" + """Trace creation has not completed.""" + EMITTING = "emitting" + """Trace creation is in progress.""" + AVAILABLE = "available" + """The trace is available.""" + NOT_RECORDED = "not_recorded" + """Tracing was disabled or no trace listener recorded the call.""" + NOT_APPLICABLE = "not_applicable" + """The call was not eligible for a customer-facing trace.""" + FAILED = "failed" + """Trace creation failed.""" + + +class TelephonyProvider(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """A telephony provider supported by an agent binding. Known values are stable; additional values + may be added over time. + """ + + TEAMS_PHONE_EXTENSION = "teams_phone_extension" + """Microsoft Teams Phone Extension.""" + TWILIO = "twilio" + """Twilio Programmable Voice.""" + + +class TelephonyTransferDestinationKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The kind of telephony transfer destination. Known values are stable; additional values may be + added over time. + """ + + PSTN = "pstn" + """A public switched telephone network destination.""" + TEAMS = "teams" + """A Microsoft Teams user or resource-account destination.""" + SIP = "sip" + """A Session Initiation Protocol destination.""" + + class TextResponseFormatConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of TextResponseFormatConfigurationType.""" @@ -1880,6 +2072,23 @@ class VoiceAgentSessionIncludeOption(str, Enum, metaclass=CaseInsensitiveEnumMet """FILE_SEARCH_CALL_RESULTS.""" +class VoiceAgentSubagentAbortReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The reason a subagent consultation was aborted.""" + + UNKNOWN_TARGET = "unknown_target" + """The requested subagent was not configured for the voice agent.""" + TIMEOUT = "timeout" + """The subagent invocation exceeded its configured timeout.""" + CANCELLED = "cancelled" + """The consultation was cancelled because the voice session ended.""" + STOPPED_BY_USER = "stopped_by_user" + """The consultation was stopped at the user's request.""" + SUPERSEDED = "superseded" + """The consultation was replaced by a newer request.""" + FAILED = "failed" + """The consultation failed.""" + + class VoiceAgentSystemToolName(str, Enum, metaclass=CaseInsensitiveEnumMeta): """A service-managed voice-session control action. Known values are stable; additional values may be added over time. @@ -1902,6 +2111,15 @@ class VoiceAgentToolResponseScheduling(str, Enum, metaclass=CaseInsensitiveEnumM """Create a follow-up response only when no response is active.""" +class VoiceAgentTransport(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The transport used for a voice-agent connection.""" + + WEBSOCKET = "websocket" + """Signaling and audio are exchanged as JSON events over the WebSocket. This is the default.""" + WEBRTC = "webrtc" + """WebRTC: the WebSocket carries only SDP signaling; media and the data channel are peer-to-peer.""" + + class VoiceAgentTurnDetectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The turn-detection strategy. 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 1c44f2ad1d21..7fa1df6bde9c 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 @@ -55,6 +55,8 @@ ScheduleTaskType, TelemetryEndpointAuthType, TelemetryEndpointKind, + TelephonyProvider, + TelephonyTransferDestinationKind, TextResponseFormatConfigurationType, ToolChoiceParamType, ToolType, @@ -6116,6 +6118,97 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class CreateTelephonyBindingRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The request to create a telephony binding. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + CreateTeamsPhoneExtensionTelephonyBindingRequest, CreateTwilioTelephonyBindingRequest + + :ivar provider: The telephony provider. Required. Known values are: "teams_phone_extension" and + "twilio". + :vartype provider: str or ~azure.ai.projects.models.TelephonyProvider + :ivar connection: The Foundry connection name for the telephony provider. Required. + :vartype connection: str + :ivar label: An optional display label for the binding. + :vartype label: str + """ + + __mapping__: dict[str, _Model] = {} + provider: str = rest_discriminator(name="provider", visibility=["read", "create", "update", "delete", "query"]) + """The telephony provider. Required. Known values are: \"teams_phone_extension\" and \"twilio\".""" + connection: 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"]) + """An optional display label for the binding.""" + + @overload + def __init__( + self, + *, + provider: str, + connection: 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 CreateTeamsPhoneExtensionTelephonyBindingRequest( + CreateTelephonyBindingRequest, discriminator="teams_phone_extension" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The request to create a Microsoft Teams Phone Extension binding. + + :ivar connection: The Foundry connection name for the telephony provider. Required. + :vartype connection: str + :ivar label: An optional display label for the binding. + :vartype label: str + :ivar provider: The Microsoft Teams Phone Extension provider. Required. Microsoft Teams Phone + Extension. + :vartype provider: str or ~azure.ai.projects.models.TEAMS_PHONE_EXTENSION + :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_EXTENSION] = rest_discriminator(name="provider", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Microsoft Teams Phone Extension provider. Required. Microsoft Teams Phone Extension.""" + 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, + *, + connection: 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_EXTENSION # type: ignore + + class CreateTranscriptionResponseJsonUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Token usage statistics for the request. @@ -6148,6 +6241,47 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class CreateTwilioTelephonyBindingRequest( + CreateTelephonyBindingRequest, discriminator="twilio" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The request to create a Twilio binding. + + :ivar connection: The Foundry connection name for the telephony provider. Required. + :vartype connection: str + :ivar label: An optional display label for the binding. + :vartype label: 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 + """ + + 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, + *, + connection: 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 Trigger(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Base model for Trigger of the schedule. @@ -14272,6 +14406,77 @@ 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 + + :ivar kind: The telephony transfer destination type. Required. Known values are: "pstn", + "teams", and "sip". + :vartype kind: str or ~azure.ai.projects.models.TelephonyTransferDestinationKind + """ + + __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, + *, + kind: 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 PSTNTelephonyTransferDestination( + TelephonyTransferDestination, discriminator="pstn" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A PSTN destination for a telephony transfer target. + + :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 + """ + + 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, + *, + 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.PSTN # type: ignore + + class RaiConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Configuration for Responsible AI (RAI) content filtering and safety features. @@ -14478,12 +14683,13 @@ class RealtimeClientEvent(_Model): # pylint: disable=docstring-keyword-should-m RealtimeClientEventInputAudioBufferAppend, RealtimeClientEventInputAudioBufferClear, RealtimeClientEventInputAudioBufferCommit, RealtimeClientEventOutputAudioBufferClear, RealtimeClientEventResponseCancel, RealtimeClientEventResponseCreate, - VoiceAgentClientEventSessionAvatarConnect + VoiceAgentClientEventRtcCallSdpCreate, VoiceAgentClientEventSessionAvatarConnect :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", and "session.avatar.connect". + "response.cancel", "response.create", "session.update", "session.avatar.connect", and + "rtc.call.sdp.create". :vartype type: str or ~azure.ai.projects.models.RealtimeClientEventType """ @@ -14492,7 +14698,8 @@ class RealtimeClientEvent(_Model): # pylint: disable=docstring-keyword-should-m """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\", and \"session.avatar.connect\".""" + \"response.cancel\", \"response.create\", \"session.update\", \"session.avatar.connect\", and + \"rtc.call.sdp.create\".""" @overload def __init__( @@ -16312,9 +16519,12 @@ class RealtimeServerEvent(_Model): # pylint: disable=docstring-keyword-should-m RealtimeServerEventResponseAudioTranscriptDone, RealtimeServerEventResponseOutputItemAdded, RealtimeServerEventResponseOutputItemDone, RealtimeServerEventResponseTextDelta, RealtimeServerEventResponseTextDone, VoiceAgentServerEventResponseVideoDelta, + VoiceAgentServerEventRtcCallError, VoiceAgentServerEventRtcCallSdpCreated, VoiceAgentServerEventSessionAvatarConnecting, VoiceAgentServerEventSessionAvatarSwitchToIdle, VoiceAgentServerEventSessionAvatarSwitchToSpeaking, RealtimeServerEventSessionCreated, - RealtimeServerEventSessionUpdated, VoiceAgentServerEventWarning + VoiceAgentServerEventSessionSubagentAborted, VoiceAgentServerEventSessionSubagentCompleted, + VoiceAgentServerEventSessionSubagentStarted, RealtimeServerEventSessionUpdated, + VoiceAgentServerEventWarning :ivar type: Required. Known values are: "conversation.created", "conversation.item.created", "conversation.item.deleted", "conversation.item.input_audio_transcription.completed", @@ -16336,11 +16546,13 @@ class RealtimeServerEvent(_Model): # pylint: disable=docstring-keyword-should-m "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", "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". + "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 """ @@ -16366,11 +16578,13 @@ class RealtimeServerEvent(_Model): # pylint: disable=docstring-keyword-should-m \"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\", \"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\".""" + \"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__( @@ -18808,8 +19022,8 @@ class RealtimeServerEventSessionCreated( :ivar session: The session configuration. Required. Is one of the following types: VoiceAgentSessionResponseConfig :vartype session: ~azure.ai.projects.models.VoiceAgentSessionResponseConfig - :ivar conversation_id: The id of the persisted conversation. Only present when conversation - persistence is enabled for the session. + :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 """ @@ -18823,8 +19037,8 @@ class RealtimeServerEventSessionCreated( """The session configuration. Required. Is one of the following types: VoiceAgentSessionResponseConfig""" conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The id of the persisted conversation. Only present when conversation persistence is enabled for - the session.""" + """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__( @@ -20212,6 +20426,41 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: 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. @@ -20747,23 +20996,54 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TelemetryConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Customer-supplied telemetry configuration for exporting container logs, traces, and metrics. +class TelephonyBinding(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A telephony binding owned by a voice agent. - :ivar endpoints: Customer-supplied telemetry export endpoint configurations. Required. - :vartype endpoints: list[~azure.ai.projects.models.TelemetryEndpoint] + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + TeamsPhoneExtensionTelephonyBinding, TwilioTelephonyBinding + + :ivar id: The service-generated binding identifier. Required. + :vartype id: str + :ivar provider: The telephony provider. Required. Known values are: "teams_phone_extension" and + "twilio". + :vartype provider: str or ~azure.ai.projects.models.TelephonyProvider + :ivar connection: The Foundry connection name for the telephony provider. Required. + :vartype connection: 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 """ - endpoints: list["_models.TelemetryEndpoint"] = rest_field( + __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_extension\" and \"twilio\".""" + connection: 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"] ) - """Customer-supplied telemetry export endpoint configurations. Required.""" + """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, *, - endpoints: list["_models.TelemetryEndpoint"], + id: str, # pylint: disable=redefined-builtin + provider: str, + connection: str, + status: Union[str, "_models.TelephonyBindingStatus"], + incoming_call_url: str, + label: Optional[str] = None, ) -> None: ... @overload @@ -20777,31 +21057,50 @@ 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 +class TeamsPhoneExtensionTelephonyBinding( + TelephonyBinding, discriminator="teams_phone_extension" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A Microsoft Teams Phone Extension binding owned by a voice agent. - :ivar type: Required. Known values are: "text", "json_schema", and "json_object". - :vartype type: str or ~azure.ai.projects.models.TextResponseFormatConfigurationType + :ivar id: The service-generated binding identifier. Required. + :vartype id: str + :ivar connection: The Foundry connection name for the telephony provider. Required. + :vartype connection: 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 Extension provider. Required. Microsoft Teams Phone + Extension. + :vartype provider: str or ~azure.ai.projects.models.TEAMS_PHONE_EXTENSION + :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 """ - __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\".""" + provider: Literal[TelephonyProvider.TEAMS_PHONE_EXTENSION] = rest_discriminator(name="provider", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Microsoft Teams Phone Extension provider. Required. Microsoft Teams Phone Extension.""" + 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, *, - type: str, + id: str, # pylint: disable=redefined-builtin + connection: 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 @@ -20813,22 +21112,63 @@ 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_EXTENSION # type: ignore -class TextResponseFormatJsonObject(TextResponseFormat, discriminator="json_object"): - """JSON object. +class TelephonyBindingListItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A telephony binding returned in a list, including its entity tag. - :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 + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + TeamsPhoneExtensionTelephonyBindingListItem, TwilioTelephonyBindingListItem + + :ivar id: The service-generated binding identifier. Required. + :vartype id: str + :ivar provider: The telephony provider. Required. Known values are: "teams_phone_extension" and + "twilio". + :vartype provider: str or ~azure.ai.projects.models.TelephonyProvider + :ivar connection: The Foundry connection name for the telephony provider. Required. + :vartype connection: 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 """ - 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.""" + __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_extension\" and \"twilio\".""" + connection: 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: str, + status: Union[str, "_models.TelephonyBindingStatus"], + incoming_call_url: str, + label: Optional[str] = None, ) -> None: ... @overload @@ -20840,49 +21180,55 @@ 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 -class TextResponseFormatJsonSchema( - TextResponseFormat, discriminator="json_schema" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """JSON schema. +class TeamsPhoneExtensionTelephonyBindingListItem( + TelephonyBindingListItem, discriminator="teams_phone_extension" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """A Microsoft Teams Phone Extension binding returned in a list, including its entity tag. - :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 + :ivar id: The service-generated binding identifier. Required. + :vartype id: str + :ivar connection: The Foundry connection name for the telephony provider. Required. + :vartype connection: 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 Extension provider. Required. Microsoft Teams Phone + Extension. + :vartype provider: str or ~azure.ai.projects.models.TEAMS_PHONE_EXTENSION + :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 """ - 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"]) + provider: Literal[TelephonyProvider.TEAMS_PHONE_EXTENSION] = rest_discriminator(name="provider", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Microsoft Teams Phone Extension provider. Required. Microsoft Teams Phone Extension.""" + 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, *, - name: str, - schema: dict[str, Any], - description: Optional[str] = None, - strict: Optional[bool] = None, + id: str, # pylint: disable=redefined-builtin + connection: 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 @@ -20894,22 +21240,32 @@ 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 + self.provider = TelephonyProvider.TEAMS_PHONE_EXTENSION # type: ignore -class TextResponseFormatText(TextResponseFormat, discriminator="text"): - """Text. +class TeamsTelephonyTransferDestination( + TelephonyTransferDestination, discriminator="teams" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A Microsoft Teams destination for a telephony transfer target. - :ivar type: The type of response format being defined. Always ``text``. Required. TEXT. - :vartype type: str or ~azure.ai.projects.models.TEXT + :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 """ - 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.""" + 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 @@ -20921,13 +21277,852 @@ 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 + self.kind = TelephonyTransferDestinationKind.TEAMS # type: ignore -class TimerRoutineTrigger( - RoutineTrigger, discriminator="timer" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A one-shot timer routine trigger. +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 TelephonyCallLifecycleEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A bounded durable observation in the lifecycle of one telephony call. + + :ivar sequence: The service-assigned order of the event within the call record. Required. + :vartype sequence: int + :ivar name: The stable provider-neutral event name. Required. Known values are: + "telephony.webhook.received", "telephony.webhook.validation", "telephony.binding.resolve", + "telephony.provider.answer", "telephony.media.connect", "telephony.agent_session.connect", + "telephony.media.first_caller_audio", "telephony.media.first_agent_audio", + "telephony.call.transfer", "telephony.call.hangup", and "telephony.call.disconnect". + :vartype name: str or ~azure.ai.projects.models.TelephonyCallLifecycleEventName + :ivar source: The component that supplied the observation. Required. Known values are: + "gateway", "teams_phone_extension", "twilio", and "voice_agent". + :vartype source: str or ~azure.ai.projects.models.TelephonyCallLifecycleEventSource + :ivar outcome: The outcome of the observed lifecycle operation. Required. Known values are: + "observed", "started", "succeeded", "failed", "rejected", and "cancelled". + :vartype outcome: str or ~azure.ai.projects.models.TelephonyCallLifecycleEventOutcome + :ivar observed_at: The Unix timestamp (in seconds) for when the service observed the event. + Required. + :vartype observed_at: ~datetime.datetime + :ivar occurred_at: The Unix timestamp (in seconds) for when the event occurred according to the + provider. + :vartype occurred_at: ~datetime.datetime + :ivar timestamp_source: The source of the event timestamp. Required. Known values are: + "provider", "gateway", and "derived". + :vartype timestamp_source: str or ~azure.ai.projects.models.TelephonyCallTimestampSource + :ivar reason: A stable service-generated reason associated with the event. + :vartype reason: str + :ivar provider_event_id: The provider event identifier used for idempotency, when supplied. + :vartype provider_event_id: str + :ivar provider_sequence: The provider event sequence, when supplied. + :vartype provider_sequence: int + :ivar provider_status_code: The provider status code associated with the event. + :vartype provider_status_code: int + :ivar provider_sub_code: The provider subcode associated with the event. + :vartype provider_sub_code: int + """ + + sequence: int = rest_field(visibility=["read"]) + """The service-assigned order of the event within the call record. Required.""" + name: Union[str, "_models.TelephonyCallLifecycleEventName"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The stable provider-neutral event name. Required. Known values are: + \"telephony.webhook.received\", \"telephony.webhook.validation\", + \"telephony.binding.resolve\", \"telephony.provider.answer\", \"telephony.media.connect\", + \"telephony.agent_session.connect\", \"telephony.media.first_caller_audio\", + \"telephony.media.first_agent_audio\", \"telephony.call.transfer\", \"telephony.call.hangup\", + and \"telephony.call.disconnect\".""" + source: Union[str, "_models.TelephonyCallLifecycleEventSource"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The component that supplied the observation. Required. Known values are: \"gateway\", + \"teams_phone_extension\", \"twilio\", and \"voice_agent\".""" + outcome: Union[str, "_models.TelephonyCallLifecycleEventOutcome"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The outcome of the observed lifecycle operation. Required. Known values are: \"observed\", + \"started\", \"succeeded\", \"failed\", \"rejected\", and \"cancelled\".""" + observed_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the service observed the event. Required.""" + occurred_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the event occurred according to the provider.""" + timestamp_source: Union[str, "_models.TelephonyCallTimestampSource"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The source of the event timestamp. Required. Known values are: \"provider\", \"gateway\", and + \"derived\".""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A stable service-generated reason associated with the event.""" + provider_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The provider event identifier used for idempotency, when supplied.""" + provider_sequence: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The provider event sequence, when supplied.""" + provider_status_code: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The provider status code associated with the event.""" + provider_sub_code: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The provider subcode associated with the event.""" + + @overload + def __init__( + self, + *, + name: Union[str, "_models.TelephonyCallLifecycleEventName"], + source: Union[str, "_models.TelephonyCallLifecycleEventSource"], + outcome: Union[str, "_models.TelephonyCallLifecycleEventOutcome"], + observed_at: datetime.datetime, + timestamp_source: Union[str, "_models.TelephonyCallTimestampSource"], + occurred_at: Optional[datetime.datetime] = None, + reason: Optional[str] = None, + provider_event_id: Optional[str] = None, + provider_sequence: Optional[int] = None, + provider_status_code: Optional[int] = None, + provider_sub_code: 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 TelephonyCallRecord(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Detailed diagnostics for 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_extension" 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 Extension 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 the call ended. + :vartype end_reason: str + :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 timing: Detailed provider-neutral call timing. Required. + :vartype timing: ~azure.ai.projects.models.TelephonyCallTiming + :ivar trace: Correlation to the customer-facing Foundry trace. + :vartype trace: ~azure.ai.projects.models.TelephonyCallTrace + :ivar events: The lifecycle timeline. Required. + :vartype events: list[~azure.ai.projects.models.TelephonyCallLifecycleEvent] + :ivar events_truncated: Whether older lifecycle events were omitted from the timeline. + Required. + :vartype events_truncated: bool + """ + + 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_extension\" 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 Extension 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[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The service-generated reason that the call ended.""" + 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.""" + 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[str] = 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_extension" 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 Extension 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 the call ended. + :vartype end_reason: str + :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_extension\" 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 Extension 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[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The service-generated reason that the call ended.""" + 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[str] = 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"] + ) + """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\".""" + + @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 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, + *, + name: str, + schema: dict[str, Any], + description: Optional[str] = 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 = TextResponseFormatConfigurationType.JSON_SCHEMA # type: ignore + + +class TextResponseFormatText(TextResponseFormat, discriminator="text"): + """Text. + + :ivar type: The type of response format being defined. Always ``text``. Required. TEXT. + :vartype type: str or ~azure.ai.projects.models.TEXT + """ + + 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 @@ -22387,8 +23582,112 @@ class TranscriptTextUsageTokensInputTokenDetails( def __init__( self, *, - text_tokens: Optional[int] = None, - audio_tokens: Optional[int] = None, + text_tokens: Optional[int] = None, + audio_tokens: 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 TwilioTelephonyBinding( + TelephonyBinding, discriminator="twilio" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A Twilio binding owned by a voice agent. + + :ivar id: The service-generated binding identifier. Required. + :vartype id: str + :ivar connection: The Foundry connection name for the telephony provider. Required. + :vartype connection: 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 + """ + + 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: 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 TwilioTelephonyBindingListItem( + TelephonyBindingListItem, discriminator="twilio" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A Twilio binding returned in a list, including its entity tag. + + :ivar id: The service-generated binding identifier. Required. + :vartype id: str + :ivar connection: The Foundry connection name for the telephony provider. Required. + :vartype connection: 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 + """ + + 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: str, + status: Union[str, "_models.TelephonyBindingStatus"], + incoming_call_url: str, + phone_number: str, + label: Optional[str] = None, ) -> None: ... @overload @@ -22400,6 +23699,7 @@ 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 @@ -22435,6 +23735,58 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +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 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: The replacement Foundry connection name. This property is valid only for a + Teams Phone Extension binding; a Twilio binding's connection is immutable. + :vartype connection: str + :ivar phone_number: The replacement Teams Phone Extension display phone number. Omit it to + preserve the current value; use null to clear it. This property is valid only for a Teams Phone + Extension binding. + :vartype phone_number: str + """ + + 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: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The replacement Foundry connection name. This property is valid only for a Teams Phone + Extension binding; a Twilio binding's connection is immutable.""" + phone_number: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The replacement Teams Phone Extension display phone number. Omit it to preserve the current + value; use null to clear it. This property is valid only for a Teams Phone Extension binding.""" + + @overload + def __init__( + self, + *, + status: Optional[Union[str, "_models.TelephonyBindingStatus"]] = None, + label: Optional[str] = None, + connection: 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) + + class UpdateToolboxRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """UpdateToolboxRequest. @@ -23532,6 +24884,55 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD # 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. + + :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 + """ + + 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, + *, + sdp_offer: str, + event_id: Optional[str] = None, + session: Optional["_models.VoiceAgentSessionUpdateConfig"] = 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 = 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 @@ -23634,17 +25035,22 @@ class VoiceAgentDefinition( :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 agent is served. Together with ``model``, this - selects the model up front. ``managed`` uses a service-managed model; ``self_deployed`` uses - the customer's own Foundry deployment. This is independent of the architecture (realtime or - cascaded), which the service derives from the selected model. Required. Known values are: - "managed" and "self_deployed". + :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, paired with ``model_type``: the service-managed - model name when ``model_type`` is ``managed``, or the customer's Foundry deployment name when - ``model_type`` is ``self_deployed``. The model must support realtime or cascaded voice. The - service derives the architecture from the selected model. Required. + :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. @@ -23687,6 +25093,9 @@ class VoiceAgentDefinition( :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 @@ -23699,19 +25108,26 @@ class VoiceAgentDefinition( 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: Union[str, "_models.VoiceModelType"] = rest_field( + model_type: Optional[Union[str, "_models.VoiceModelType"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """How the model backing this agent is served. Together with ``model``, this selects the model up - front. ``managed`` uses a service-managed model; ``self_deployed`` uses the customer's own - Foundry deployment. This is independent of the architecture (realtime or cascaded), which the - service derives from the selected model. Required. Known values are: \"managed\" and - \"self_deployed\".""" - model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The model to use for this agent, paired with ``model_type``: the service-managed model name - when ``model_type`` is ``managed``, or the customer's Foundry deployment name when - ``model_type`` is ``self_deployed``. The model must support realtime or cascaded voice. The - service derives the architecture from the selected model. Required.""" + """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.""" @@ -23770,6 +25186,11 @@ class VoiceAgentDefinition( ) """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( + 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 @@ -23783,9 +25204,10 @@ class VoiceAgentDefinition( def __init__( self, *, - model_type: Union[str, "_models.VoiceModelType"], - model: str, 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, @@ -23798,6 +25220,7 @@ def __init__( 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, ) -> None: ... @@ -24739,6 +26162,49 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class VoiceAgentRtcCallErrorDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Details of a WebRTC signaling error. + + :ivar type: The error category, following the VoiceLive wire contract: + ``invalid_request_error`` for a client-side signaling fault (for example, a malformed SDP + offer) or ``server_error`` for a service-side failure. Additional categories may be added over + time. Required. + :vartype type: str + :ivar code: A machine-readable error code, when available. + :vartype code: str + :ivar message: A human-readable error message. Required. + :vartype message: str + """ + + type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The error category, following the VoiceLive wire contract: ``invalid_request_error`` for a + client-side signaling fault (for example, a malformed SDP offer) or ``server_error`` for a + service-side failure. Additional categories may be added over time. Required.""" + code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A machine-readable error code, when available.""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A human-readable error message. Required.""" + + @overload + def __init__( + self, + *, + type: str, + message: str, + 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 VoiceAgentSemanticVadTurnDetection( VoiceAgentTurnDetectionConfig, discriminator="semantic_vad" ): # pylint: disable=docstring-keyword-should-match-keyword-only @@ -25211,6 +26677,103 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RealtimeServerEventType.RESPONSE_VIDEO_DELTA # type: ignore +class VoiceAgentServerEventRtcCallError( + RealtimeServerEvent, discriminator="rtc.call.error" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``rtc.call.error`` server event: a WebRTC signaling failure. + + :ivar type: The event type. Always ``rtc.call.error``. Required. RTC_CALL_ERROR. + :vartype type: str or ~azure.ai.projects.models.RTC_CALL_ERROR + :ivar event_id: An optional server-generated event identifier. + :vartype event_id: str + :ivar operation: The signaling operation that failed, when known. + :vartype operation: str + :ivar rtc_call_id: The identifier of the WebRTC call, when known. + :vartype rtc_call_id: str + :ivar error: The error detail. Required. + :vartype error: ~azure.ai.projects.models.VoiceAgentRtcCallErrorDetails + """ + + type: Literal[RealtimeServerEventType.RTC_CALL_ERROR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type. Always ``rtc.call.error``. Required. RTC_CALL_ERROR.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional server-generated event identifier.""" + operation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The signaling operation that failed, when known.""" + rtc_call_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The identifier of the WebRTC call, when known.""" + error: "_models.VoiceAgentRtcCallErrorDetails" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The error detail. Required.""" + + @overload + def __init__( + self, + *, + error: "_models.VoiceAgentRtcCallErrorDetails", + event_id: Optional[str] = None, + operation: Optional[str] = None, + rtc_call_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 = RealtimeServerEventType.RTC_CALL_ERROR # type: ignore + + +class VoiceAgentServerEventRtcCallSdpCreated( + RealtimeServerEvent, discriminator="rtc.call.sdp.created" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``rtc.call.sdp.created`` server event: the SDP answer that completes WebRTC negotiation. + + :ivar type: The event type. Always ``rtc.call.sdp.created``. Required. RTC_CALL_SDP_CREATED. + :vartype type: str or ~azure.ai.projects.models.RTC_CALL_SDP_CREATED + :ivar event_id: The server-generated event identifier. Required. + :vartype event_id: str + :ivar rtc_call_id: The identifier of the established WebRTC call. Required. + :vartype rtc_call_id: str + :ivar sdp_answer: The server's SDP answer for the WebRTC connection. Required. + :vartype sdp_answer: str + """ + + type: Literal[RealtimeServerEventType.RTC_CALL_SDP_CREATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type. Always ``rtc.call.sdp.created``. Required. RTC_CALL_SDP_CREATED.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The server-generated event identifier. Required.""" + rtc_call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The identifier of the established WebRTC call. Required.""" + sdp_answer: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The server's SDP answer for the WebRTC connection. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + rtc_call_id: str, + sdp_answer: 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 = RealtimeServerEventType.RTC_CALL_SDP_CREATED # type: ignore + + class VoiceAgentServerEventSessionAvatarConnecting( RealtimeServerEvent, discriminator="session.avatar.connecting" ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only @@ -25248,34 +26811,184 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.SESSION_AVATAR_CONNECTING # type: ignore + self.type = RealtimeServerEventType.SESSION_AVATAR_CONNECTING # type: ignore + + +class VoiceAgentServerEventSessionAvatarSwitchToIdle( + RealtimeServerEvent, discriminator="session.avatar.switch_to_idle" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``session.avatar.switch_to_idle`` server event. + + :ivar type: Required. SESSION_AVATAR_SWITCH_TO_IDLE. + :vartype type: str or ~azure.ai.projects.models.SESSION_AVATAR_SWITCH_TO_IDLE + :ivar event_id: Required. + :vartype event_id: str + :ivar turn_id: + :vartype turn_id: str + """ + + type: Literal[RealtimeServerEventType.SESSION_AVATAR_SWITCH_TO_IDLE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. SESSION_AVATAR_SWITCH_TO_IDLE.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + turn_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + event_id: str, + turn_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 = RealtimeServerEventType.SESSION_AVATAR_SWITCH_TO_IDLE # type: ignore + + +class VoiceAgentServerEventSessionAvatarSwitchToSpeaking( + RealtimeServerEvent, discriminator="session.avatar.switch_to_speaking" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``session.avatar.switch_to_speaking`` server event. + + :ivar type: Required. SESSION_AVATAR_SWITCH_TO_SPEAKING. + :vartype type: str or ~azure.ai.projects.models.SESSION_AVATAR_SWITCH_TO_SPEAKING + :ivar event_id: Required. + :vartype event_id: str + :ivar turn_id: + :vartype turn_id: str + """ + + type: Literal[RealtimeServerEventType.SESSION_AVATAR_SWITCH_TO_SPEAKING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. SESSION_AVATAR_SWITCH_TO_SPEAKING.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + turn_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + event_id: str, + turn_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 = RealtimeServerEventType.SESSION_AVATAR_SWITCH_TO_SPEAKING # type: ignore + + +class VoiceAgentServerEventSessionSubagentAborted( + RealtimeServerEvent, discriminator="session.subagent.aborted" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``session.subagent.aborted`` server event. + + :ivar type: The event type. Always ``session.subagent.aborted``. Required. + SESSION_SUBAGENT_ABORTED. + :vartype type: str or ~azure.ai.projects.models.SESSION_SUBAGENT_ABORTED + :ivar event_id: The server-generated event identifier. Required. + :vartype event_id: str + :ivar consultation_id: The identifier of the subagent consultation. Required. + :vartype consultation_id: str + :ivar call_id: The identifier of the function call that initiated the consultation. Required. + :vartype call_id: str + :ivar subagent_name: The name of the consulted subagent. Required. + :vartype subagent_name: str + :ivar reason: The reason the consultation was aborted. Required. Known values are: + "unknown_target", "timeout", "cancelled", "stopped_by_user", "superseded", and "failed". + :vartype reason: str or ~azure.ai.projects.models.VoiceAgentSubagentAbortReason + """ + + type: Literal[RealtimeServerEventType.SESSION_SUBAGENT_ABORTED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type. Always ``session.subagent.aborted``. Required. SESSION_SUBAGENT_ABORTED.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The server-generated event identifier. Required.""" + consultation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The identifier of the subagent consultation. Required.""" + call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The identifier of the function call that initiated the consultation. Required.""" + subagent_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the consulted subagent. Required.""" + reason: Union[str, "_models.VoiceAgentSubagentAbortReason"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The reason the consultation was aborted. Required. Known values are: \"unknown_target\", + \"timeout\", \"cancelled\", \"stopped_by_user\", \"superseded\", and \"failed\".""" + + @overload + def __init__( + self, + *, + event_id: str, + consultation_id: str, + call_id: str, + subagent_name: str, + reason: Union[str, "_models.VoiceAgentSubagentAbortReason"], + ) -> 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.SESSION_SUBAGENT_ABORTED # type: ignore -class VoiceAgentServerEventSessionAvatarSwitchToIdle( - RealtimeServerEvent, discriminator="session.avatar.switch_to_idle" +class VoiceAgentServerEventSessionSubagentCompleted( + RealtimeServerEvent, discriminator="session.subagent.completed" ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``session.avatar.switch_to_idle`` server event. + """The ``session.subagent.completed`` server event. - :ivar type: Required. SESSION_AVATAR_SWITCH_TO_IDLE. - :vartype type: str or ~azure.ai.projects.models.SESSION_AVATAR_SWITCH_TO_IDLE - :ivar event_id: Required. + :ivar type: The event type. Always ``session.subagent.completed``. Required. + SESSION_SUBAGENT_COMPLETED. + :vartype type: str or ~azure.ai.projects.models.SESSION_SUBAGENT_COMPLETED + :ivar event_id: The server-generated event identifier. Required. :vartype event_id: str - :ivar turn_id: - :vartype turn_id: str + :ivar consultation_id: The identifier of the subagent consultation. Required. + :vartype consultation_id: str + :ivar call_id: The identifier of the function call that initiated the consultation. Required. + :vartype call_id: str + :ivar subagent_name: The name of the consulted subagent. Required. + :vartype subagent_name: str """ - type: Literal[RealtimeServerEventType.SESSION_AVATAR_SWITCH_TO_IDLE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. SESSION_AVATAR_SWITCH_TO_IDLE.""" + type: Literal[RealtimeServerEventType.SESSION_SUBAGENT_COMPLETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type. Always ``session.subagent.completed``. Required. SESSION_SUBAGENT_COMPLETED.""" event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - turn_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The server-generated event identifier. Required.""" + consultation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The identifier of the subagent consultation. Required.""" + call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The identifier of the function call that initiated the consultation. Required.""" + subagent_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the consulted subagent. Required.""" @overload def __init__( self, *, event_id: str, - turn_id: Optional[str] = None, + consultation_id: str, + call_id: str, + subagent_name: str, ) -> None: ... @overload @@ -25287,34 +27000,46 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.SESSION_AVATAR_SWITCH_TO_IDLE # type: ignore + self.type = RealtimeServerEventType.SESSION_SUBAGENT_COMPLETED # type: ignore -class VoiceAgentServerEventSessionAvatarSwitchToSpeaking( - RealtimeServerEvent, discriminator="session.avatar.switch_to_speaking" +class VoiceAgentServerEventSessionSubagentStarted( + RealtimeServerEvent, discriminator="session.subagent.started" ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``session.avatar.switch_to_speaking`` server event. + """The ``session.subagent.started`` server event. - :ivar type: Required. SESSION_AVATAR_SWITCH_TO_SPEAKING. - :vartype type: str or ~azure.ai.projects.models.SESSION_AVATAR_SWITCH_TO_SPEAKING - :ivar event_id: Required. + :ivar type: The event type. Always ``session.subagent.started``. Required. + SESSION_SUBAGENT_STARTED. + :vartype type: str or ~azure.ai.projects.models.SESSION_SUBAGENT_STARTED + :ivar event_id: The server-generated event identifier. Required. :vartype event_id: str - :ivar turn_id: - :vartype turn_id: str + :ivar consultation_id: The identifier of the subagent consultation. Required. + :vartype consultation_id: str + :ivar call_id: The identifier of the function call that initiated the consultation. Required. + :vartype call_id: str + :ivar subagent_name: The name of the consulted subagent. Required. + :vartype subagent_name: str """ - type: Literal[RealtimeServerEventType.SESSION_AVATAR_SWITCH_TO_SPEAKING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. SESSION_AVATAR_SWITCH_TO_SPEAKING.""" + type: Literal[RealtimeServerEventType.SESSION_SUBAGENT_STARTED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type. Always ``session.subagent.started``. Required. SESSION_SUBAGENT_STARTED.""" event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - turn_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The server-generated event identifier. Required.""" + consultation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The identifier of the subagent consultation. Required.""" + call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The identifier of the function call that initiated the consultation. Required.""" + subagent_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the consulted subagent. Required.""" @overload def __init__( self, *, event_id: str, - turn_id: Optional[str] = None, + consultation_id: str, + call_id: str, + subagent_name: str, ) -> None: ... @overload @@ -25326,7 +27051,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.SESSION_AVATAR_SWITCH_TO_SPEAKING # type: ignore + self.type = RealtimeServerEventType.SESSION_SUBAGENT_STARTED # type: ignore class VoiceAgentServerEventWarning( @@ -25865,6 +27590,168 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = "static_interim_response" # type: ignore +class VoiceAgentSubAgent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A sibling Foundry text agent that a voice agent may consult as a background specialist. + + :ivar agent_name: The name of the subagent. The subagent must be in the same project as the + voice agent. Required. + :vartype agent_name: str + :ivar agent_version: The version of the subagent. When omitted, the active version is used. + :vartype agent_version: str + :ivar agent_capabilities: A description of the subagent's capabilities, used by the voice agent + to decide whether to forward a query. Required. + :vartype agent_capabilities: str + :ivar response_policy: Policy for acknowledging forwarded requests and filling gaps while + waiting for this subagent's response. + :vartype response_policy: ~azure.ai.projects.models.VoiceAgentSubagentResponsePolicy + :ivar invoke_timeout_seconds: The wall-clock timeout, in seconds, for each invocation of this + subagent. When omitted, the service timeout is used. + :vartype invoke_timeout_seconds: ~datetime.timedelta + """ + + agent_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the subagent. The subagent must be in the same project as the voice agent. + Required.""" + agent_version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version of the subagent. When omitted, the active version is used.""" + agent_capabilities: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A description of the subagent's capabilities, used by the voice agent to decide whether to + forward a query. Required.""" + response_policy: Optional["_models.VoiceAgentSubagentResponsePolicy"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Policy for acknowledging forwarded requests and filling gaps while waiting for this subagent's + response.""" + invoke_timeout_seconds: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-seconds-int" + ) + """The wall-clock timeout, in seconds, for each invocation of this subagent. When omitted, the + service timeout is used.""" + + @overload + def __init__( + self, + *, + agent_name: str, + agent_capabilities: str, + agent_version: Optional[str] = None, + response_policy: Optional["_models.VoiceAgentSubagentResponsePolicy"] = None, + invoke_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 VoiceAgentSubAgentConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Configuration for sibling Foundry text agents that a voice agent may consult. + + :ivar subagents: The sibling Foundry text agents, in the same project, that this voice agent + may consult. Required. + :vartype subagents: list[~azure.ai.projects.models.VoiceAgentSubAgent] + """ + + subagents: list["_models.VoiceAgentSubAgent"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The sibling Foundry text agents, in the same project, that this voice agent may consult. + Required.""" + + @overload + def __init__( + self, + *, + subagents: list["_models.VoiceAgentSubAgent"], + ) -> 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 VoiceAgentSubagentResponsePolicy(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Policy for delivering responses while a voice agent waits for a subagent. + + :ivar immediate_ack: Whether the voice agent provides an immediate acknowledgement before + forwarding a request to a subagent. + :vartype immediate_ack: bool + :ivar gap_filling_interval: The number of seconds without subagent content or user input before + the voice agent provides a gap-filling response. + :vartype gap_filling_interval: ~datetime.timedelta + :ivar ack_instructions: Instructions used to generate the immediate acknowledgement. + :vartype ack_instructions: str + :ivar gap_filling_instructions: Instructions used to generate gap-filling speech while waiting + for progress. + :vartype gap_filling_instructions: str + :ivar enable_delta_progress: Whether progress updates are emitted incrementally instead of only + when the subagent invocation completes. Defaults to ``false``. + :vartype enable_delta_progress: bool + :ivar progress_instructions: Instructions used to summarize streamed subagent progress for + speech. + :vartype progress_instructions: str + :ivar progress_update_interval: The minimum number of seconds between spoken progress updates. + :vartype progress_update_interval: ~datetime.timedelta + """ + + immediate_ack: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the voice agent provides an immediate acknowledgement before forwarding a request to a + subagent.""" + gap_filling_interval: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-seconds-int" + ) + """The number of seconds without subagent content or user input before the voice agent provides a + gap-filling response.""" + ack_instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Instructions used to generate the immediate acknowledgement.""" + gap_filling_instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Instructions used to generate gap-filling speech while waiting for progress.""" + enable_delta_progress: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether progress updates are emitted incrementally instead of only when the subagent invocation + completes. Defaults to ``false``.""" + progress_instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Instructions used to summarize streamed subagent progress for speech.""" + progress_update_interval: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-seconds-int" + ) + """The minimum number of seconds between spoken progress updates.""" + + @overload + def __init__( + self, + *, + immediate_ack: Optional[bool] = None, + gap_filling_interval: Optional[datetime.timedelta] = None, + ack_instructions: Optional[str] = None, + gap_filling_instructions: Optional[str] = None, + enable_delta_progress: Optional[bool] = None, + progress_instructions: Optional[str] = None, + progress_update_interval: 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 VoiceAgentSystemTool( VoiceAgentTool, discriminator="system" ): # pylint: disable=docstring-keyword-should-match-keyword-only @@ -26188,6 +28075,179 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.object: Literal["voice.conversation"] = "voice.conversation" +class VoiceConversationEngine(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An engine that owns conversation handling for a voice agent. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + VoiceHostedAgentConversationEngine + + :ivar type: The conversation engine 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 conversation engine type. 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 VoiceGeneratedItemAudioResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Metadata for a conversation item's generated audio. For bring-your-own-storage (BYOS), the + response includes ``blob_uri``, a direct customer-storage URI without a SAS token, that the + customer accesses with their own credentials. For Foundry-managed storage, ``blob_uri`` is + absent and the bytes are streamed through the item's ``/audio/generated/content`` route. + + :ivar conversation_id: The id of the conversation the item belongs to. Required. + :vartype conversation_id: str + :ivar item_id: The id of the item this audio belongs to. Required. + :vartype item_id: str + :ivar role: The role the audio belongs to. Known values are: "user" and "agent". + :vartype role: str or ~azure.ai.projects.models.VoiceAudioRole + :ivar format: The container format of the audio. "wav" + :vartype format: str or ~azure.ai.projects.models.VoiceAudioContainerFormat + :ivar codec: The audio codec. Known values are: "pcm16", "pcmu", and "pcma". + :vartype codec: str or ~azure.ai.projects.models.VoiceAudioCodec + :ivar sample_rate: The sample rate in Hz. + :vartype sample_rate: int + :ivar channels: The number of audio channels. + :vartype channels: int + :ivar start_offset_ms: The offset from the session start at which this segment begins. + :vartype start_offset_ms: ~datetime.timedelta + :ivar duration_ms: The duration of the audio segment. + :vartype duration_ms: ~datetime.timedelta + :ivar blob_uri: For bring-your-own-storage (BYOS) recordings only: the URI of the generated + audio in the customer's own storage, without a SAS token. The customer downloads it using their + own storage credentials. Absent for Foundry-managed storage, where the bytes are streamed via + the item's ``/audio/generated/content`` route instead. + :vartype blob_uri: str + """ + + conversation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The id of the conversation the item belongs to. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The id of the item this audio belongs to. Required.""" + role: Optional[Union[str, "_models.VoiceAudioRole"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The role the audio belongs to. Known values are: \"user\" and \"agent\".""" + format: Optional[Union[str, "_models.VoiceAudioContainerFormat"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The container format of the audio. \"wav\"""" + codec: Optional[Union[str, "_models.VoiceAudioCodec"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The audio codec. Known values are: \"pcm16\", \"pcmu\", and \"pcma\".""" + sample_rate: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sample rate in Hz.""" + channels: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of audio channels.""" + start_offset_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """The offset from the session start at which this segment begins.""" + duration_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """The duration of the audio segment.""" + blob_uri: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """For bring-your-own-storage (BYOS) recordings only: the URI of the generated audio in the + customer's own storage, without a SAS token. The customer downloads it using their own storage + credentials. Absent for Foundry-managed storage, where the bytes are streamed via the item's + ``/audio/generated/content`` route instead.""" + + @overload + def __init__( + self, + *, + conversation_id: str, + item_id: str, + role: Optional[Union[str, "_models.VoiceAudioRole"]] = None, + format: Optional[Union[str, "_models.VoiceAudioContainerFormat"]] = None, + codec: Optional[Union[str, "_models.VoiceAudioCodec"]] = None, + sample_rate: Optional[int] = None, + channels: Optional[int] = None, + start_offset_ms: Optional[datetime.timedelta] = None, + duration_ms: Optional[datetime.timedelta] = None, + blob_uri: 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 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. + + :ivar type: Selects a hosted Foundry agent as the conversation engine. Required. Default value + is "hosted_agent". + :vartype type: str + :ivar name: The non-empty DNS-like name of the target hosted text agent in the same project. + Required. + :vartype name: str + :ivar version: The target agent version. Omit this property to select the latest version when + the voice session starts. When supplied, use a positive integer or + ``draft-{positive-unix-timestamp}`` whose numeric component fits in a signed 64-bit integer. + :vartype version: str + """ + + type: Literal["hosted_agent"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Selects a hosted Foundry agent as the conversation engine. Required. Default value is + \"hosted_agent\".""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The non-empty DNS-like name of the target hosted text agent in the same project. Required.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The target agent version. Omit this property to select the latest version when the voice + session starts. When supplied, use a positive integer or ``draft-{positive-unix-timestamp}`` + whose numeric component fits in a signed 64-bit integer.""" + + @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) + self.type = "hosted_agent" # type: ignore + + class VoiceItemAudioResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Metadata for a single conversation item's audio segment. For bring-your-own-storage (BYOS), the response includes ``blob_uri``, a direct customer-storage URI without a SAS token, that the diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/__init__.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/__init__.py index d6cf67b4d8cf..bab1be543cc5 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/__init__.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/__init__.py @@ -19,6 +19,7 @@ from ._operations import DatasetsOperations # type: ignore from ._operations import DeploymentsOperations # type: ignore from ._operations import IndexesOperations # type: ignore +from ._operations import AgentEndpointConversationsOperations # type: ignore from ._operations import ToolboxesOperations # type: ignore from ._patch import __all__ as _patch_all @@ -33,6 +34,7 @@ "DatasetsOperations", "DeploymentsOperations", "IndexesOperations", + "AgentEndpointConversationsOperations", "ToolboxesOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore 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 8a0e81c55805..a25792759c9d 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 @@ -14,11 +14,12 @@ import urllib.parse import uuid -from azure.core import PipelineClient +from azure.core import MatchConditions, PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, + ResourceModifiedError, ResourceNotFoundError, ResourceNotModifiedError, StreamClosedError, @@ -37,7 +38,7 @@ from .._configuration import AIProjectClientConfiguration from .._utils.model_base import Model as _Model, SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._utils.serialization import Deserializer, Serializer -from .._utils.utils import prepare_multipart_form_data +from .._utils.utils import prep_if_match, prep_if_none_match, prepare_multipart_form_data from ..models._enums import _AgentDefinitionOptInKeys if TYPE_CHECKING: @@ -678,8 +679,8 @@ def build_agents_get_microsoft365_publish_defaults_request( # pylint: disable=n return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_agents_upload_session_file_request( - agent_name: str, session_id: str, *, path: str, **kwargs: Any +def build_agents_create_telephony_binding_request( # pylint: disable=name-too-long + agent_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -689,59 +690,35 @@ def build_agents_upload_session_file_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/endpoint/sessions/{agent_session_id}/files/content" + _url = "/agents/{agent_name}/telephony_bindings" path_format_arguments = { "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "agent_session_id": _SERIALIZER.url("session_id", session_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - _params["path"] = _SERIALIZER.query("path", path, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if "Repeatability-Request-ID" not in _headers: + _headers["Repeatability-Request-ID"] = str(uuid.uuid4()) + if "Repeatability-First-Sent" not in _headers: + _headers["Repeatability-First-Sent"] = _SERIALIZER.serialize_data( + datetime.datetime.now(datetime.timezone.utc), "rfc-1123" + ) if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_agents_download_session_file_request( # pylint: disable=name-too-long - agent_name: str, session_id: str, *, path: 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/octet-stream") - - # Construct URL - _url = "/agents/{agent_name}/endpoint/sessions/{agent_session_id}/files/content" - path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "agent_session_id": _SERIALIZER.url("session_id", session_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["path"] = _SERIALIZER.query("path", path, "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) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_agents_list_session_files_request( +def build_agents_list_telephony_bindings_request( # pylint: disable=name-too-long agent_name: str, - session_id: str, *, - path: Optional[str] = None, + provider: Optional[Union[str, _models.TelephonyProvider]] = None, + status: Optional[Union[str, _models.TelephonyBindingStatus]] = None, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, after: Optional[str] = None, @@ -755,17 +732,18 @@ def build_agents_list_session_files_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/endpoint/sessions/{agent_session_id}/files" + _url = "/agents/{agent_name}/telephony_bindings" path_format_arguments = { "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "agent_session_id": _SERIALIZER.url("session_id", session_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - if path is not None: - _params["path"] = _SERIALIZER.query("path", path, "str") + if provider is not None: + _params["provider"] = _SERIALIZER.query("provider", provider, "str") + if status is not None: + _params["status"] = _SERIALIZER.query("status", status, "str") if limit is not None: _params["limit"] = _SERIALIZER.query("limit", limit, "int") if order is not None: @@ -782,41 +760,48 @@ def build_agents_list_session_files_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_agents_delete_session_file_request( - agent_name: str, session_id: str, *, path: str, recursive: Optional[bool] = None, **kwargs: Any +def build_agents_get_telephony_binding_request( # pylint: disable=name-too-long + agent_name: str, binding_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/sessions/{agent_session_id}/files" + _url = "/agents/{agent_name}/telephony_bindings/{binding_id}" path_format_arguments = { "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "agent_session_id": _SERIALIZER.url("session_id", session_id, "str"), + "binding_id": _SERIALIZER.url("binding_id", binding_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - _params["path"] = _SERIALIZER.query("path", path, "str") - if recursive is not None: - _params["recursive"] = _SERIALIZER.query("recursive", recursive, "bool") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_evaluation_rules_get_request(id: str, **kwargs: Any) -> HttpRequest: + +def build_agents_update_telephony_binding_request( # pylint: disable=name-too-long + agent_name: str, binding_id: str, *, etag: str, match_condition: MatchConditions, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluationrules/{id}" + _url = "/agents/{agent_name}/telephony_bindings/{binding_id}" path_format_arguments = { - "id": _SERIALIZER.url("id", id, "str"), + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "binding_id": _SERIALIZER.url("binding_id", binding_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -825,19 +810,31 @@ def build_evaluation_rules_get_request(id: str, **kwargs: Any) -> HttpRequest: _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["if-none-match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_evaluation_rules_delete_request(id: str, **kwargs: Any) -> HttpRequest: +def build_agents_delete_telephony_binding_request( # pylint: disable=name-too-long + agent_name: str, binding_id: str, *, etag: str, match_condition: MatchConditions, **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")) # Construct URL - _url = "/evaluationrules/{id}" + _url = "/agents/{agent_name}/telephony_bindings/{binding_id}" path_format_arguments = { - "id": _SERIALIZER.url("id", id, "str"), + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "binding_id": _SERIALIZER.url("binding_id", binding_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -845,45 +842,70 @@ def build_evaluation_rules_delete_request(id: str, **kwargs: Any) -> HttpRequest # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + if_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["if-none-match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -def build_evaluation_rules_create_or_update_request( # pylint: disable=name-too-long - id: str, **kwargs: Any + +def build_agents_list_telephony_calls_request( # pylint: disable=name-too-long + agent_name: str, + *, + provider: Optional[Union[str, _models.TelephonyProvider]] = None, + status: Optional[Union[str, _models.TelephonyCallStatus]] = None, + started_after: Optional[datetime.datetime] = None, + started_before: Optional[datetime.datetime] = None, + 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 {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluationrules/{id}" + _url = "/agents/{agent_name}/telephony_calls" path_format_arguments = { - "id": _SERIALIZER.url("id", id, "str"), + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + if provider is not None: + _params["provider"] = _SERIALIZER.query("provider", provider, "str") + if status is not None: + _params["status"] = _SERIALIZER.query("status", status, "str") + if started_after is not None: + _params["started_after"] = _SERIALIZER.query("started_after", started_after, "unix-time") + if started_before is not None: + _params["started_before"] = _SERIALIZER.query("started_before", started_before, "unix-time") + 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 - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_evaluation_rules_list_request( - *, - action_type: Optional[Union[str, _models.EvaluationRuleActionType]] = None, - agent_name: Optional[str] = None, - enabled: Optional[bool] = None, - **kwargs: Any -) -> HttpRequest: +def build_agents_get_telephony_call_request(agent_name: str, call_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -891,16 +913,16 @@ def build_evaluation_rules_list_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluationrules" + _url = "/agents/{agent_name}/telephony_calls/{call_id}" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "call_id": _SERIALIZER.url("call_id", call_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if action_type is not None: - _params["actionType"] = _SERIALIZER.query("action_type", action_type, "str") - if agent_name is not None: - _params["agentName"] = _SERIALIZER.query("agent_name", agent_name, "str") - if enabled is not None: - _params["enabled"] = _SERIALIZER.query("enabled", enabled, "bool") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -908,17 +930,21 @@ def build_evaluation_rules_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_connections_get_request(name: str, **kwargs: Any) -> HttpRequest: +def build_agents_transfer_telephony_call_request( # pylint: disable=name-too-long + agent_name: str, call_id: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/connections/{name}" + _url = "/agents/{agent_name}/telephony_calls/{call_id}:transfer" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "call_id": _SERIALIZER.url("call_id", call_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -927,14 +953,14 @@ def build_connections_get_request(name: str, **kwargs: Any) -> HttpRequest: _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_connections_get_with_credentials_request( # pylint: disable=name-too-long - name: str, **kwargs: Any -) -> HttpRequest: +def build_agents_end_telephony_call_request(agent_name: str, call_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -942,9 +968,10 @@ def build_connections_get_with_credentials_request( # pylint: disable=name-too- accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/connections/{name}/getConnectionWithCredentials" + _url = "/agents/{agent_name}/telephony_calls/{call_id}:end" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "call_id": _SERIALIZER.url("call_id", call_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -958,11 +985,8 @@ def build_connections_get_with_credentials_request( # pylint: disable=name-too- return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_connections_list_request( - *, - connection_type: Optional[Union[str, _models.ConnectionType]] = None, - default_connection: Optional[bool] = None, - **kwargs: Any +def build_agents_get_telephony_transfer_targets_request( # pylint: disable=name-too-long + agent_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -971,14 +995,15 @@ def build_connections_list_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/connections" + _url = "/agents/{agent_name}/telephony_transfer_targets" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if connection_type is not None: - _params["connectionType"] = _SERIALIZER.query("connection_type", connection_type, "str") - if default_connection is not None: - _params["defaultConnection"] = _SERIALIZER.query("default_connection", default_connection, "bool") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -986,17 +1011,20 @@ def build_connections_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_datasets_list_versions_request(name: str, **kwargs: Any) -> HttpRequest: +def build_agents_replace_telephony_transfer_targets_request( # pylint: disable=name-too-long + agent_name: str, *, etag: str, match_condition: MatchConditions, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/datasets/{name}/versions" + _url = "/agents/{agent_name}/telephony_transfer_targets" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1005,47 +1033,70 @@ def build_datasets_list_versions_request(name: str, **kwargs: Any) -> HttpReques _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["if-none-match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_datasets_list_request(**kwargs: Any) -> HttpRequest: +def build_agents_upload_session_file_request( + agent_name: str, session_id: str, *, path: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/datasets" + _url = "/agents/{agent_name}/endpoint/sessions/{agent_session_id}/files/content" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "agent_session_id": _SERIALIZER.url("session_id", session_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + _params["path"] = _SERIALIZER.query("path", path, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_datasets_get_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_agents_download_session_file_request( # pylint: disable=name-too-long + agent_name: str, session_id: str, *, path: 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") + accept = _headers.pop("Accept", "application/octet-stream") # Construct URL - _url = "/datasets/{name}/versions/{version}" + _url = "/agents/{agent_name}/endpoint/sessions/{agent_session_id}/files/content" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "agent_session_id": _SERIALIZER.url("session_id", session_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + _params["path"] = _SERIALIZER.query("path", path, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers @@ -1054,54 +1105,120 @@ def build_datasets_get_request(name: str, version: str, **kwargs: Any) -> HttpRe return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_datasets_delete_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_agents_list_session_files_request( + agent_name: str, + session_id: str, + *, + path: Optional[str] = None, + 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 = "/datasets/{name}/versions/{version}" + _url = "/agents/{agent_name}/endpoint/sessions/{agent_session_id}/files" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "agent_session_id": _SERIALIZER.url("session_id", session_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + if path is not None: + _params["path"] = _SERIALIZER.query("path", path, "str") + 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") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_datasets_create_or_update_request(name: str, version: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) +def build_agents_delete_session_file_request( + agent_name: str, session_id: str, *, path: str, recursive: Optional[bool] = None, **kwargs: Any +) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") - # Construct URL - _url = "/datasets/{name}/versions/{version}" + _url = "/agents/{agent_name}/endpoint/sessions/{agent_session_id}/files" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "agent_session_id": _SERIALIZER.url("session_id", session_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _params["path"] = _SERIALIZER.query("path", path, "str") + if recursive is not None: + _params["recursive"] = _SERIALIZER.query("recursive", recursive, "bool") + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_evaluation_rules_get_request(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 = "/evaluationrules/{id}" + path_format_arguments = { + "id": _SERIALIZER.url("id", 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 - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_datasets_pending_upload_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_evaluation_rules_delete_request(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 = "/evaluationrules/{id}" + path_format_arguments = { + "id": _SERIALIZER.url("id", 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_evaluation_rules_create_or_update_request( # pylint: disable=name-too-long + id: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1110,10 +1227,9 @@ def build_datasets_pending_upload_request(name: str, version: str, **kwargs: Any accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/datasets/{name}/versions/{version}/startPendingUpload" + _url = "/evaluationrules/{id}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "id": _SERIALIZER.url("id", id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1126,10 +1242,16 @@ def build_datasets_pending_upload_request(name: str, version: str, **kwargs: Any _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_datasets_get_credentials_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_evaluation_rules_list_request( + *, + action_type: Optional[Union[str, _models.EvaluationRuleActionType]] = None, + agent_name: Optional[str] = None, + enabled: Optional[bool] = None, + **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1137,10 +1259,34 @@ def build_datasets_get_credentials_request(name: str, version: str, **kwargs: An accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/datasets/{name}/versions/{version}/credentials" + _url = "/evaluationrules" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if action_type is not None: + _params["actionType"] = _SERIALIZER.query("action_type", action_type, "str") + if agent_name is not None: + _params["agentName"] = _SERIALIZER.query("agent_name", agent_name, "str") + if enabled is not None: + _params["enabled"] = _SERIALIZER.query("enabled", enabled, "bool") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_connections_get_request(name: 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 = "/connections/{name}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1151,10 +1297,12 @@ def build_datasets_get_credentials_request(name: str, version: str, **kwargs: An # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_deployments_get_request(name: str, **kwargs: Any) -> HttpRequest: +def build_connections_get_with_credentials_request( # pylint: disable=name-too-long + name: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1162,7 +1310,7 @@ def build_deployments_get_request(name: str, **kwargs: Any) -> HttpRequest: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/deployments/{name}" + _url = "/connections/{name}/getConnectionWithCredentials" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), } @@ -1175,14 +1323,13 @@ def build_deployments_get_request(name: str, **kwargs: Any) -> HttpRequest: # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_deployments_list_request( +def build_connections_list_request( *, - model_publisher: Optional[str] = None, - model_name: Optional[str] = None, - deployment_type: Optional[Union[str, _models.DeploymentType]] = None, + connection_type: Optional[Union[str, _models.ConnectionType]] = None, + default_connection: Optional[bool] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1192,16 +1339,14 @@ def build_deployments_list_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/deployments" + _url = "/connections" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if model_publisher is not None: - _params["modelPublisher"] = _SERIALIZER.query("model_publisher", model_publisher, "str") - if model_name is not None: - _params["modelName"] = _SERIALIZER.query("model_name", model_name, "str") - if deployment_type is not None: - _params["deploymentType"] = _SERIALIZER.query("deployment_type", deployment_type, "str") + if connection_type is not None: + _params["connectionType"] = _SERIALIZER.query("connection_type", connection_type, "str") + if default_connection is not None: + _params["defaultConnection"] = _SERIALIZER.query("default_connection", default_connection, "bool") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1209,7 +1354,7 @@ def build_deployments_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_indexes_list_versions_request(name: str, **kwargs: Any) -> HttpRequest: +def build_datasets_list_versions_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1217,7 +1362,7 @@ def build_indexes_list_versions_request(name: str, **kwargs: Any) -> HttpRequest accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/indexes/{name}/versions" + _url = "/datasets/{name}/versions" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), } @@ -1233,7 +1378,7 @@ def build_indexes_list_versions_request(name: str, **kwargs: Any) -> HttpRequest return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_indexes_list_request(**kwargs: Any) -> HttpRequest: +def build_datasets_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1241,7 +1386,7 @@ def build_indexes_list_request(**kwargs: Any) -> HttpRequest: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/indexes" + _url = "/datasets" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1252,7 +1397,7 @@ def build_indexes_list_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_indexes_get_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_datasets_get_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1260,7 +1405,7 @@ def build_indexes_get_request(name: str, version: str, **kwargs: Any) -> HttpReq accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/indexes/{name}/versions/{version}" + _url = "/datasets/{name}/versions/{version}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), "version": _SERIALIZER.url("version", version, "str"), @@ -1277,12 +1422,12 @@ def build_indexes_get_request(name: str, version: str, **kwargs: Any) -> HttpReq return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_indexes_delete_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_datasets_delete_request(name: str, version: 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 = "/indexes/{name}/versions/{version}" + _url = "/datasets/{name}/versions/{version}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), "version": _SERIALIZER.url("version", version, "str"), @@ -1296,7 +1441,7 @@ def build_indexes_delete_request(name: str, version: str, **kwargs: Any) -> Http return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_indexes_create_or_update_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_datasets_create_or_update_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1305,7 +1450,7 @@ def build_indexes_create_or_update_request(name: str, version: str, **kwargs: An accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/indexes/{name}/versions/{version}" + _url = "/datasets/{name}/versions/{version}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), "version": _SERIALIZER.url("version", version, "str"), @@ -1324,7 +1469,7 @@ def build_indexes_create_or_update_request(name: str, version: str, **kwargs: An return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_create_version_request(name: str, **kwargs: Any) -> HttpRequest: +def build_datasets_pending_upload_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1333,9 +1478,10 @@ def build_toolboxes_create_version_request(name: str, **kwargs: Any) -> HttpRequ accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/toolboxes/{name}/versions" + _url = "/datasets/{name}/versions/{version}/startPendingUpload" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1351,7 +1497,7 @@ def build_toolboxes_create_version_request(name: str, **kwargs: Any) -> HttpRequ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_get_request(name: str, **kwargs: Any) -> HttpRequest: +def build_datasets_get_credentials_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1359,7 +1505,32 @@ def build_toolboxes_get_request(name: str, **kwargs: Any) -> HttpRequest: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/toolboxes/{name}" + _url = "/datasets/{name}/versions/{version}/credentials" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_deployments_get_request(name: 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 = "/deployments/{name}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), } @@ -1375,12 +1546,11 @@ def build_toolboxes_get_request(name: str, **kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_list_request( +def build_deployments_list_request( *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - after: Optional[str] = None, - before: Optional[str] = None, + model_publisher: Optional[str] = None, + model_name: Optional[str] = None, + deployment_type: Optional[Union[str, _models.DeploymentType]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1390,18 +1560,16 @@ def build_toolboxes_list_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/toolboxes" + _url = "/deployments" # 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") + if model_publisher is not None: + _params["modelPublisher"] = _SERIALIZER.query("model_publisher", model_publisher, "str") + if model_name is not None: + _params["modelName"] = _SERIALIZER.query("model_name", model_name, "str") + if deployment_type is not None: + _params["deploymentType"] = _SERIALIZER.query("deployment_type", deployment_type, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1409,15 +1577,7 @@ def build_toolboxes_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_list_versions_request( - name: str, - *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - after: Optional[str] = None, - before: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: +def build_indexes_list_versions_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1425,7 +1585,7 @@ def build_toolboxes_list_versions_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/toolboxes/{name}/versions" + _url = "/indexes/{name}/versions" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), } @@ -1433,14 +1593,6 @@ def build_toolboxes_list_versions_request( _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 @@ -1449,7 +1601,7 @@ def build_toolboxes_list_versions_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_get_version_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_indexes_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1457,13 +1609,7 @@ def build_toolboxes_get_version_request(name: str, version: str, **kwargs: Any) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/toolboxes/{name}/versions/{version}" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore + _url = "/indexes" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1474,18 +1620,18 @@ def build_toolboxes_get_version_request(name: str, version: str, **kwargs: Any) return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_update_request(name: str, **kwargs: Any) -> HttpRequest: +def build_indexes_get_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/toolboxes/{name}" + _url = "/indexes/{name}/versions/{version}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1494,21 +1640,20 @@ def build_toolboxes_update_request(name: str, **kwargs: Any) -> HttpRequest: _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_delete_request(name: str, **kwargs: Any) -> HttpRequest: +def build_indexes_delete_request(name: str, version: 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 = "/toolboxes/{name}" + _url = "/indexes/{name}/versions/{version}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1519,12 +1664,16 @@ def build_toolboxes_delete_request(name: str, **kwargs: Any) -> HttpRequest: return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_toolboxes_delete_version_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_indexes_create_or_update_request(name: str, version: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + # Construct URL - _url = "/toolboxes/{name}/versions/{version}" + _url = "/indexes/{name}/versions/{version}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), "version": _SERIALIZER.url("version", version, "str"), @@ -1535,54 +1684,16 @@ def build_toolboxes_delete_version_request(name: str, version: str, **kwargs: An # 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_agent_web_socket_connect_voice_agent_request( # pylint: disable=name-too-long - agent_name: str, - *, - foundry_features_query: Optional[Literal[_AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW]] = None, - store: Optional[bool] = None, - agent_version_override: Optional[str] = None, - websocket_subprotocol: Optional[Union[str, _models.VoiceAgentWebSocketSubprotocol]] = 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")) - # Construct URL - _url = "/agents/{agent_name}/endpoint/protocols/voice" - path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if foundry_features_query is not None: - _params["foundry_features"] = _SERIALIZER.query("foundry_features_query", foundry_features_query, "str") - if store is not None: - _params["store"] = _SERIALIZER.query("store", store, "bool") - if agent_version_override is not None: - _params["x-agent-version-override"] = _SERIALIZER.query("agent_version_override", agent_version_override, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - if websocket_subprotocol is not None: - _headers["Sec-WebSocket-Protocol"] = _SERIALIZER.header("websocket_subprotocol", websocket_subprotocol, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_endpoint_conversations_list_agent_conversations_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 +def build_agent_endpoint_conversations_get_agent_conversation_item_generated_audio_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 {}) @@ -1591,22 +1702,18 @@ def build_beta_agent_endpoint_conversations_list_agent_conversations_request( # accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations" + _url = ( + "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/items/{item_id}/audio/generated" + ) 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 - 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 @@ -1615,20 +1722,21 @@ def build_beta_agent_endpoint_conversations_list_agent_conversations_request( # return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_endpoint_conversations_get_agent_conversation_request( # pylint: disable=name-too-long - agent_name: str, conversation_id: str, **kwargs: Any +def build_agent_endpoint_conversations_get_agent_conversation_item_generated_audio_content_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") + accept = _headers.pop("Accept", "audio/wav") # Construct URL - _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/items/{item_id}/audio/generated/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 @@ -1642,72 +1750,34 @@ def build_beta_agent_endpoint_conversations_get_agent_conversation_request( # p return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_endpoint_conversations_delete_agent_conversation_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/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_agent_endpoint_conversations_list_agent_conversation_responses_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: +def build_toolboxes_create_version_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) 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/conversations/{conversation_id}/responses" + _url = "/toolboxes/{name}/versions" path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + "name": _SERIALIZER.url("name", 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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_endpoint_conversations_get_agent_conversation_response_request( # pylint: disable=name-too-long - agent_name: str, conversation_id: str, response_id: str, **kwargs: Any -) -> HttpRequest: +def build_toolboxes_get_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1715,11 +1785,9 @@ def build_beta_agent_endpoint_conversations_get_agent_conversation_response_requ accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/responses/{response_id}" + _url = "/toolboxes/{name}" path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), - "response_id": _SERIALIZER.url("response_id", response_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1733,10 +1801,7 @@ def build_beta_agent_endpoint_conversations_get_agent_conversation_response_requ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_endpoint_conversations_list_agent_conversation_response_items_request( # pylint: disable=name-too-long - agent_name: str, - conversation_id: str, - response_id: str, +def build_toolboxes_list_request( *, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, @@ -1751,14 +1816,7 @@ def build_beta_agent_endpoint_conversations_list_agent_conversation_response_ite accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/responses/{response_id}/items" - path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), - "response_id": _SERIALIZER.url("response_id", response_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore + _url = "/toolboxes" # Construct parameters if limit is not None: @@ -1777,9 +1835,8 @@ def build_beta_agent_endpoint_conversations_list_agent_conversation_response_ite return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_endpoint_conversations_list_agent_conversation_items_request( # pylint: disable=name-too-long - agent_name: str, - conversation_id: str, +def build_toolboxes_list_versions_request( + name: str, *, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, @@ -1794,10 +1851,9 @@ def build_beta_agent_endpoint_conversations_list_agent_conversation_items_reques accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/items" + _url = "/toolboxes/{name}/versions" path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1819,9 +1875,7 @@ def build_beta_agent_endpoint_conversations_list_agent_conversation_items_reques return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_endpoint_conversations_get_agent_conversation_item_request( # pylint: disable=name-too-long - agent_name: str, conversation_id: str, item_id: str, **kwargs: Any -) -> HttpRequest: +def build_toolboxes_get_version_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1829,11 +1883,10 @@ def build_beta_agent_endpoint_conversations_get_agent_conversation_item_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/items/{item_id}" + _url = "/toolboxes/{name}/versions/{version}" 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"), + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1847,21 +1900,18 @@ def build_beta_agent_endpoint_conversations_get_agent_conversation_item_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_endpoint_conversations_get_agent_conversation_item_audio_request( # pylint: disable=name-too-long - agent_name: str, conversation_id: str, item_id: str, **kwargs: Any -) -> HttpRequest: +def build_toolboxes_update_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) 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/conversations/{conversation_id}/items/{item_id}/audio" + _url = "/toolboxes/{name}" 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"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1870,26 +1920,21 @@ def build_beta_agent_endpoint_conversations_get_agent_conversation_item_audio_re _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_endpoint_conversations_get_agent_conversation_item_audio_content_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 {}) +def build_toolboxes_delete_request(name: str, **kwargs: Any) -> HttpRequest: _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/conversations/{conversation_id}/items/{item_id}/audio/content" + _url = "/toolboxes/{name}" 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"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1897,26 +1942,18 @@ def build_beta_agent_endpoint_conversations_get_agent_conversation_item_audio_co # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_beta_agent_endpoint_conversations_get_agent_conversation_audio_request( # pylint: disable=name-too-long - agent_name: str, conversation_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) +def build_toolboxes_delete_version_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _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/conversations/{conversation_id}/audio" + _url = "/toolboxes/{name}/versions/{version}" path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1924,46 +1961,56 @@ def build_beta_agent_endpoint_conversations_get_agent_conversation_audio_request # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_beta_agent_endpoint_conversations_get_agent_conversation_audio_content_request( # pylint: disable=name-too-long - agent_name: str, conversation_id: str, **kwargs: Any +def build_beta_voice_agent_web_socket_connect_voice_agent_request( # pylint: disable=name-too-long + agent_name: str, + *, + foundry_features_query: Optional[Literal[_AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW]] = None, + transport: Optional[Union[str, _models.VoiceAgentTransport]] = None, + store: Optional[bool] = None, + agent_version_override: Optional[str] = None, + websocket_subprotocol: Optional[Union[str, _models.VoiceAgentWebSocketSubprotocol]] = 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", "audio/wav") - # Construct URL - _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/audio/content" + _url = "/agents/{agent_name}/endpoint/protocols/voice" 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 foundry_features_query is not None: + _params["foundry_features"] = _SERIALIZER.query("foundry_features_query", foundry_features_query, "str") + if transport is not None: + _params["transport"] = _SERIALIZER.query("transport", transport, "str") + if store is not None: + _params["store"] = _SERIALIZER.query("store", store, "bool") + if agent_version_override is not None: + _params["x-agent-version-override"] = _SERIALIZER.query("agent_version_override", agent_version_override, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if websocket_subprotocol is not None: + _headers["Sec-WebSocket-Protocol"] = _SERIALIZER.header("websocket_subprotocol", websocket_subprotocol, "str") return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_insight_monitors_list_request( # pylint: disable=name-too-long +def build_beta_agent_endpoint_conversations_list_agent_conversations_request( # pylint: disable=name-too-long + agent_name: str, *, - after: Optional[str] = None, - before: Optional[str] = None, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, - agent_name: Optional[str] = None, + after: Optional[str] = None, + before: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1973,19 +2020,22 @@ def build_beta_agent_insight_monitors_list_request( # pylint: disable=name-too- accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agent_insight_monitors" + _url = "/agents/{agent_name}/endpoint/protocols/voice/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 after is not None: - _params["after"] = _SERIALIZER.query("after", after, "str") - if before is not None: - _params["before"] = _SERIALIZER.query("before", before, "str") 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 agent_name is not None: - _params["agent_name"] = _SERIALIZER.query("agent_name", agent_name, "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 @@ -1994,30 +2044,8 @@ def build_beta_agent_insight_monitors_list_request( # pylint: disable=name-too- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_insight_monitors_create_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/agent_insight_monitors" - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_beta_agent_insight_monitors_get_request( # pylint: disable=name-too-long - monitor_id: str, **kwargs: Any +def build_beta_agent_endpoint_conversations_get_agent_conversation_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 {}) @@ -2026,9 +2054,10 @@ def build_beta_agent_insight_monitors_get_request( # pylint: disable=name-too-l accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agent_insight_monitors/{monitor_id}" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}" path_format_arguments = { - "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), + "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 @@ -2042,16 +2071,17 @@ def build_beta_agent_insight_monitors_get_request( # pylint: disable=name-too-l return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_insight_monitors_delete_request( # pylint: disable=name-too-long - monitor_id: str, **kwargs: Any +def build_beta_agent_endpoint_conversations_delete_agent_conversation_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 = "/agent_insight_monitors/{monitor_id}" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}" path_format_arguments = { - "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), + "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 @@ -2062,45 +2092,63 @@ def build_beta_agent_insight_monitors_delete_request( # pylint: disable=name-to return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_beta_agent_insight_monitors_update_request( # pylint: disable=name-too-long - monitor_id: str, **kwargs: Any +def build_beta_agent_endpoint_conversations_list_agent_conversation_responses_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 {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agent_insight_monitors/{monitor_id}" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/responses" path_format_arguments = { - "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), + "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 - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_insight_monitors_reset_request( # pylint: disable=name-too-long - monitor_id: str, **kwargs: Any +def build_beta_agent_endpoint_conversations_get_agent_conversation_response_request( # pylint: disable=name-too-long + agent_name: str, conversation_id: str, response_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 = "/agent_insight_monitors/{monitor_id}:reset" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/responses/{response_id}" path_format_arguments = { - "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + "response_id": _SERIALIZER.url("response_id", response_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2108,47 +2156,64 @@ def build_beta_agent_insight_monitors_reset_request( # pylint: disable=name-too # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_insight_monitors_create_run_request( # pylint: disable=name-too-long - monitor_id: str, **kwargs: Any + +def build_beta_agent_endpoint_conversations_list_agent_conversation_response_items_request( # pylint: disable=name-too-long + agent_name: str, + conversation_id: str, + response_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 {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agent_insight_monitors/{monitor_id}/runs" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/responses/{response_id}/items" path_format_arguments = { - "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + "response_id": _SERIALIZER.url("response_id", response_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 - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_insight_monitors_list_runs_request( # pylint: disable=name-too-long - monitor_id: str, +def build_beta_agent_endpoint_conversations_list_agent_conversation_items_request( # pylint: disable=name-too-long + agent_name: str, + conversation_id: str, *, - after: Optional[str] = None, - before: Optional[str] = None, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, - status: Optional[Union[str, _models.JobStatus]] = None, - trigger: Optional[Union[str, _models.AgentInsightRunTrigger]] = None, + after: Optional[str] = None, + before: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2158,26 +2223,23 @@ def build_beta_agent_insight_monitors_list_runs_request( # pylint: disable=name accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agent_insight_monitors/{monitor_id}/runs" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/items" path_format_arguments = { - "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), + "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 after is not None: - _params["after"] = _SERIALIZER.query("after", after, "str") - if before is not None: - _params["before"] = _SERIALIZER.query("before", before, "str") 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 status is not None: - _params["status"] = _SERIALIZER.query("status", status, "str") - if trigger is not None: - _params["trigger"] = _SERIALIZER.query("trigger", trigger, "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 @@ -2186,8 +2248,8 @@ def build_beta_agent_insight_monitors_list_runs_request( # pylint: disable=name return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_insight_monitors_get_run_request( # pylint: disable=name-too-long - monitor_id: str, run_id: str, **kwargs: Any +def build_beta_agent_endpoint_conversations_get_agent_conversation_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 {}) @@ -2196,10 +2258,11 @@ def build_beta_agent_insight_monitors_get_run_request( # pylint: disable=name-t accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agent_insight_monitors/{monitor_id}/runs/{run_id}" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/items/{item_id}" path_format_arguments = { - "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), - "run_id": _SERIALIZER.url("run_id", run_id, "str"), + "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 @@ -2213,8 +2276,8 @@ def build_beta_agent_insight_monitors_get_run_request( # pylint: disable=name-t return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_insight_monitors_cancel_run_request( # pylint: disable=name-too-long - monitor_id: str, run_id: str, **kwargs: Any +def build_beta_agent_endpoint_conversations_get_agent_conversation_item_audio_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 {}) @@ -2223,10 +2286,11 @@ def build_beta_agent_insight_monitors_cancel_run_request( # pylint: disable=nam accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agent_insight_monitors/{monitor_id}/runs/{run_id}:cancel" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/items/{item_id}/audio" path_format_arguments = { - "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), - "run_id": _SERIALIZER.url("run_id", run_id, "str"), + "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 @@ -2237,53 +2301,29 @@ def build_beta_agent_insight_monitors_cancel_run_request( # pylint: disable=nam # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_insight_monitors_list_insights_request( # pylint: disable=name-too-long - monitor_id: str, - *, - after: Optional[str] = None, - before: Optional[str] = None, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - category: Optional[str] = None, - severity: Optional[Union[str, _models.AgentInsightSeverity]] = None, - status: Optional[Union[str, _models.AgentInsightStatus]] = None, - include_details: Optional[bool] = None, - **kwargs: Any +def build_beta_agent_endpoint_conversations_get_agent_conversation_item_audio_content_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") + accept = _headers.pop("Accept", "audio/wav") # Construct URL - _url = "/agent_insight_monitors/{monitor_id}/insights" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/items/{item_id}/audio/content" path_format_arguments = { - "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), + "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 - if after is not None: - _params["after"] = _SERIALIZER.query("after", after, "str") - if before is not None: - _params["before"] = _SERIALIZER.query("before", before, "str") - 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 category is not None: - _params["category"] = _SERIALIZER.query("category", category, "str") - if severity is not None: - _params["severity"] = _SERIALIZER.query("severity", severity, "str") - if status is not None: - _params["status"] = _SERIALIZER.query("status", status, "str") - if include_details is not None: - _params["include_details"] = _SERIALIZER.query("include_details", include_details, "bool") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers @@ -2292,8 +2332,8 @@ def build_beta_agent_insight_monitors_list_insights_request( # pylint: disable= return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_insight_monitors_get_insight_request( # pylint: disable=name-too-long - monitor_id: str, insight_id: str, *, include_details: Optional[bool] = None, **kwargs: Any +def build_beta_agent_endpoint_conversations_get_agent_conversation_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 {}) @@ -2302,17 +2342,15 @@ def build_beta_agent_insight_monitors_get_insight_request( # pylint: disable=na accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agent_insight_monitors/{monitor_id}/insights/{insight_id}" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/audio" path_format_arguments = { - "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), - "insight_id": _SERIALIZER.url("insight_id", insight_id, "str"), + "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 include_details is not None: - _params["include_details"] = _SERIALIZER.query("include_details", include_details, "bool") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers @@ -2321,21 +2359,20 @@ def build_beta_agent_insight_monitors_get_insight_request( # pylint: disable=na return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_insight_monitors_update_insight_request( # pylint: disable=name-too-long - monitor_id: str, insight_id: str, **kwargs: Any +def build_beta_agent_endpoint_conversations_get_agent_conversation_audio_content_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 {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") + accept = _headers.pop("Accept", "audio/wav") # Construct URL - _url = "/agent_insight_monitors/{monitor_id}/insights/{insight_id}" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/audio/content" path_format_arguments = { - "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), - "insight_id": _SERIALIZER.url("insight_id", insight_id, "str"), + "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 @@ -2344,15 +2381,19 @@ def build_beta_agent_insight_monitors_update_insight_request( # pylint: disable _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluation_taxonomies_get_request( # pylint: disable=name-too-long - name: str, **kwargs: Any +def build_beta_agent_insight_monitors_list_request( # pylint: disable=name-too-long + *, + after: Optional[str] = None, + before: Optional[str] = None, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + agent_name: Optional[str] = None, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2361,14 +2402,19 @@ def build_beta_evaluation_taxonomies_get_request( # pylint: disable=name-too-lo accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluationtaxonomies/{name}" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore + _url = "/agent_insight_monitors" # Construct parameters + if after is not None: + _params["after"] = _SERIALIZER.query("after", after, "str") + if before is not None: + _params["before"] = _SERIALIZER.query("before", before, "str") + 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 agent_name is not None: + _params["agent_name"] = _SERIALIZER.query("agent_name", agent_name, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers @@ -2377,8 +2423,30 @@ def build_beta_evaluation_taxonomies_get_request( # pylint: disable=name-too-lo return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluation_taxonomies_list_request( # pylint: disable=name-too-long - *, input_name: Optional[str] = None, input_type: Optional[str] = None, **kwargs: Any +def build_beta_agent_insight_monitors_create_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/agent_insight_monitors" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_agent_insight_monitors_get_request( # pylint: disable=name-too-long + monitor_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2387,14 +2455,15 @@ def build_beta_evaluation_taxonomies_list_request( # pylint: disable=name-too-l accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluationtaxonomies" + _url = "/agent_insight_monitors/{monitor_id}" + path_format_arguments = { + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if input_name is not None: - _params["inputName"] = _SERIALIZER.query("input_name", input_name, "str") - if input_type is not None: - _params["inputType"] = _SERIALIZER.query("input_type", input_type, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2402,16 +2471,16 @@ def build_beta_evaluation_taxonomies_list_request( # pylint: disable=name-too-l return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluation_taxonomies_delete_request( # pylint: disable=name-too-long - name: str, **kwargs: Any +def build_beta_agent_insight_monitors_delete_request( # pylint: disable=name-too-long + monitor_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 = "/evaluationtaxonomies/{name}" + _url = "/agent_insight_monitors/{monitor_id}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2422,8 +2491,8 @@ def build_beta_evaluation_taxonomies_delete_request( # pylint: disable=name-too return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_beta_evaluation_taxonomies_create_request( # pylint: disable=name-too-long - name: str, **kwargs: Any +def build_beta_agent_insight_monitors_update_request( # pylint: disable=name-too-long + monitor_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2433,9 +2502,9 @@ def build_beta_evaluation_taxonomies_create_request( # pylint: disable=name-too accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluationtaxonomies/{name}" + _url = "/agent_insight_monitors/{monitor_id}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2448,23 +2517,19 @@ def build_beta_evaluation_taxonomies_create_request( # pylint: disable=name-too _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluation_taxonomies_update_request( # pylint: disable=name-too-long - name: str, **kwargs: Any +def build_beta_agent_insight_monitors_reset_request( # pylint: disable=name-too-long + monitor_id: str, **kwargs: Any ) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") - # Construct URL - _url = "/evaluationtaxonomies/{name}" + _url = "/agent_insight_monitors/{monitor_id}:reset" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2472,52 +2537,47 @@ def build_beta_evaluation_taxonomies_update_request( # pylint: disable=name-too # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) -def build_beta_evaluators_list_versions_request( # pylint: disable=name-too-long - name: str, - *, - type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, - limit: Optional[int] = None, - **kwargs: Any +def build_beta_agent_insight_monitors_create_run_request( # pylint: disable=name-too-long + monitor_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluators/{name}/versions" + _url = "/agent_insight_monitors/{monitor_id}/runs" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if type is not None: - _params["type"] = _SERIALIZER.query("type", type, "str") - if limit is not None: - _params["limit"] = _SERIALIZER.query("limit", limit, "int") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_list_request( +def build_beta_agent_insight_monitors_list_runs_request( # pylint: disable=name-too-long + monitor_id: str, *, - type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, + after: Optional[str] = None, + before: Optional[str] = None, limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + status: Optional[Union[str, _models.JobStatus]] = None, + trigger: Optional[Union[str, _models.AgentInsightRunTrigger]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2527,14 +2587,27 @@ def build_beta_evaluators_list_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluators" + _url = "/agent_insight_monitors/{monitor_id}/runs" + path_format_arguments = { + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if type is not None: - _params["type"] = _SERIALIZER.query("type", type, "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") 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 status is not None: + _params["status"] = _SERIALIZER.query("status", status, "str") + if trigger is not None: + _params["trigger"] = _SERIALIZER.query("trigger", trigger, "str") + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2542,8 +2615,8 @@ def build_beta_evaluators_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_get_version_request( # pylint: disable=name-too-long - name: str, version: str, **kwargs: Any +def build_beta_agent_insight_monitors_get_run_request( # pylint: disable=name-too-long + monitor_id: str, run_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2552,10 +2625,10 @@ def build_beta_evaluators_get_version_request( # pylint: disable=name-too-long accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluators/{name}/versions/{version}" + _url = "/agent_insight_monitors/{monitor_id}/runs/{run_id}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), + "run_id": _SERIALIZER.url("run_id", run_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2569,17 +2642,20 @@ def build_beta_evaluators_get_version_request( # pylint: disable=name-too-long return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_delete_version_request( # pylint: disable=name-too-long - name: str, version: str, **kwargs: Any +def build_beta_agent_insight_monitors_cancel_run_request( # pylint: disable=name-too-long + monitor_id: str, run_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 = "/evaluators/{name}/versions/{version}" + _url = "/agent_insight_monitors/{monitor_id}/runs/{run_id}:cancel" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), + "run_id": _SERIALIZER.url("run_id", run_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2587,70 +2663,95 @@ def build_beta_evaluators_delete_version_request( # pylint: disable=name-too-lo # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_create_version_request( # pylint: disable=name-too-long - name: str, **kwargs: Any + +def build_beta_agent_insight_monitors_list_insights_request( # pylint: disable=name-too-long + monitor_id: str, + *, + after: Optional[str] = None, + before: Optional[str] = None, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + category: Optional[str] = None, + severity: Optional[Union[str, _models.AgentInsightSeverity]] = None, + status: Optional[Union[str, _models.AgentInsightStatus]] = None, + include_details: Optional[bool] = None, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluators/{name}/versions" + _url = "/agent_insight_monitors/{monitor_id}/insights" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + if after is not None: + _params["after"] = _SERIALIZER.query("after", after, "str") + if before is not None: + _params["before"] = _SERIALIZER.query("before", before, "str") + 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 category is not None: + _params["category"] = _SERIALIZER.query("category", category, "str") + if severity is not None: + _params["severity"] = _SERIALIZER.query("severity", severity, "str") + if status is not None: + _params["status"] = _SERIALIZER.query("status", status, "str") + if include_details is not None: + _params["include_details"] = _SERIALIZER.query("include_details", include_details, "bool") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_update_version_request( # pylint: disable=name-too-long - name: str, version: str, **kwargs: Any +def build_beta_agent_insight_monitors_get_insight_request( # pylint: disable=name-too-long + monitor_id: str, insight_id: str, *, include_details: Optional[bool] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluators/{name}/versions/{version}" + _url = "/agent_insight_monitors/{monitor_id}/insights/{insight_id}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), + "insight_id": _SERIALIZER.url("insight_id", insight_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + if include_details is not None: + _params["include_details"] = _SERIALIZER.query("include_details", include_details, "bool") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_pending_upload_request( # pylint: disable=name-too-long - name: str, version: str, **kwargs: Any +def build_beta_agent_insight_monitors_update_insight_request( # pylint: disable=name-too-long + monitor_id: str, insight_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2660,10 +2761,10 @@ def build_beta_evaluators_pending_upload_request( # pylint: disable=name-too-lo accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluators/{name}/versions/{version}/startPendingUpload" + _url = "/agent_insight_monitors/{monitor_id}/insights/{insight_id}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), + "insight_id": _SERIALIZER.url("insight_id", insight_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2676,24 +2777,22 @@ def build_beta_evaluators_pending_upload_request( # pylint: disable=name-too-lo _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_get_credentials_request( # pylint: disable=name-too-long - name: str, version: str, **kwargs: Any +def build_beta_evaluation_taxonomies_get_request( # pylint: disable=name-too-long + name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluators/{name}/versions/{version}/credentials" + _url = "/evaluationtaxonomies/{name}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2702,52 +2801,99 @@ def build_beta_evaluators_get_credentials_request( # pylint: disable=name-too-l _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_create_generation_job_request( # pylint: disable=name-too-long - *, operation_id: Optional[str] = None, **kwargs: Any +def build_beta_evaluation_taxonomies_list_request( # pylint: disable=name-too-long + *, input_name: Optional[str] = None, input_type: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluator_generation_jobs" + _url = "/evaluationtaxonomies" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if operation_id is not None: - _headers["Operation-Id"] = _SERIALIZER.header("operation_id", operation_id, "str") + if input_name is not None: + _params["inputName"] = _SERIALIZER.query("input_name", input_name, "str") + if input_type is not None: + _params["inputType"] = _SERIALIZER.query("input_type", input_type, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_evaluation_taxonomies_delete_request( # pylint: disable=name-too-long + name: 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 = "/evaluationtaxonomies/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "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_evaluation_taxonomies_create_request( # pylint: disable=name-too-long + name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/evaluationtaxonomies/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_get_generation_job_request( # pylint: disable=name-too-long - job_id: str, **kwargs: Any +def build_beta_evaluation_taxonomies_update_request( # pylint: disable=name-too-long + name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluator_generation_jobs/{jobId}" + _url = "/evaluationtaxonomies/{name}" path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2756,17 +2902,18 @@ def build_beta_evaluators_get_generation_job_request( # pylint: disable=name-to _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_list_generation_jobs_request( # pylint: disable=name-too-long +def build_beta_evaluators_list_versions_request( # pylint: disable=name-too-long + name: str, *, + type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, 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 {}) @@ -2776,18 +2923,47 @@ def build_beta_evaluators_list_generation_jobs_request( # pylint: disable=name- accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluator_generation_jobs" + _url = "/evaluators/{name}/versions" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if type is not None: + _params["type"] = _SERIALIZER.query("type", type, "str") 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") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_evaluators_list_request( + *, + type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, + limit: Optional[int] = 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 = "/evaluators" + + # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if type is not None: + _params["type"] = _SERIALIZER.query("type", type, "str") + if limit is not None: + _params["limit"] = _SERIALIZER.query("limit", limit, "int") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2795,8 +2971,8 @@ def build_beta_evaluators_list_generation_jobs_request( # pylint: disable=name- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_cancel_generation_job_request( # pylint: disable=name-too-long - job_id: str, **kwargs: Any +def build_beta_evaluators_get_version_request( # pylint: disable=name-too-long + name: str, version: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2805,9 +2981,10 @@ def build_beta_evaluators_cancel_generation_job_request( # pylint: disable=name accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluator_generation_jobs/{jobId}:cancel" + _url = "/evaluators/{name}/versions/{version}" path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2818,19 +2995,20 @@ def build_beta_evaluators_cancel_generation_job_request( # pylint: disable=name # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_delete_generation_job_request( # pylint: disable=name-too-long - job_id: str, **kwargs: Any +def build_beta_evaluators_delete_version_request( # pylint: disable=name-too-long + name: str, version: 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 = "/evaluator_generation_jobs/{jobId}" + _url = "/evaluators/{name}/versions/{version}" path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2841,7 +3019,9 @@ def build_beta_evaluators_delete_generation_job_request( # pylint: disable=name return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_beta_insights_generate_request(**kwargs: Any) -> HttpRequest: +def build_beta_evaluators_create_version_request( # pylint: disable=name-too-long + name: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2850,18 +3030,17 @@ def build_beta_insights_generate_request(**kwargs: Any) -> HttpRequest: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/insights" + _url = "/evaluators/{name}/versions" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if "Repeatability-Request-ID" not in _headers: - _headers["Repeatability-Request-ID"] = str(uuid.uuid4()) - if "Repeatability-First-Sent" not in _headers: - _headers["Repeatability-First-Sent"] = _SERIALIZER.serialize_data( - datetime.datetime.now(datetime.timezone.utc), "rfc-1123" - ) if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2869,72 +3048,69 @@ def build_beta_insights_generate_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_insights_get_request( - insight_id: str, *, include_coordinates: Optional[bool] = None, **kwargs: Any +def build_beta_evaluators_update_version_request( # pylint: disable=name-too-long + name: str, version: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/insights/{id}" + _url = "/evaluators/{name}/versions/{version}" path_format_arguments = { - "id": _SERIALIZER.url("insight_id", insight_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - if include_coordinates is not None: - _params["includeCoordinates"] = _SERIALIZER.query("include_coordinates", include_coordinates, "bool") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_insights_list_request( - *, - type: Optional[Union[str, _models.InsightType]] = None, - eval_id: Optional[str] = None, - run_id: Optional[str] = None, - agent_name: Optional[str] = None, - include_coordinates: Optional[bool] = None, - **kwargs: Any +def build_beta_evaluators_pending_upload_request( # pylint: disable=name-too-long + name: str, version: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/insights" + _url = "/evaluators/{name}/versions/{version}/startPendingUpload" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - if type is not None: - _params["type"] = _SERIALIZER.query("type", type, "str") - if eval_id is not None: - _params["evalId"] = _SERIALIZER.query("eval_id", eval_id, "str") - if run_id is not None: - _params["runId"] = _SERIALIZER.query("run_id", run_id, "str") - if agent_name is not None: - _params["agentName"] = _SERIALIZER.query("agent_name", agent_name, "str") - if include_coordinates is not None: - _params["includeCoordinates"] = _SERIALIZER.query("include_coordinates", include_coordinates, "bool") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_memory_stores_create_request(**kwargs: Any) -> HttpRequest: +def build_beta_evaluators_get_credentials_request( # pylint: disable=name-too-long + name: str, version: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2943,7 +3119,13 @@ def build_beta_memory_stores_create_request(**kwargs: Any) -> HttpRequest: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores" + _url = "/evaluators/{name}/versions/{version}/credentials" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2956,7 +3138,9 @@ def build_beta_memory_stores_create_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_memory_stores_update_request(name: str, **kwargs: Any) -> HttpRequest: +def build_beta_evaluators_create_generation_job_request( # pylint: disable=name-too-long + *, operation_id: Optional[str] = None, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2965,17 +3149,14 @@ def build_beta_memory_stores_update_request(name: str, **kwargs: Any) -> HttpReq accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores/{name}" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore + _url = "/evaluator_generation_jobs" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if operation_id is not None: + _headers["Operation-Id"] = _SERIALIZER.header("operation_id", operation_id, "str") if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2983,7 +3164,9 @@ def build_beta_memory_stores_update_request(name: str, **kwargs: Any) -> HttpReq return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_memory_stores_get_request(name: str, **kwargs: Any) -> HttpRequest: +def build_beta_evaluators_get_generation_job_request( # pylint: disable=name-too-long + job_id: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2991,9 +3174,9 @@ def build_beta_memory_stores_get_request(name: str, **kwargs: Any) -> HttpReques accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores/{name}" + _url = "/evaluator_generation_jobs/{jobId}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "jobId": _SERIALIZER.url("job_id", job_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3007,7 +3190,7 @@ def build_beta_memory_stores_get_request(name: str, **kwargs: Any) -> HttpReques return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_memory_stores_list_request( +def build_beta_evaluators_list_generation_jobs_request( # pylint: disable=name-too-long *, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, @@ -3022,7 +3205,7 @@ def build_beta_memory_stores_list_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores" + _url = "/evaluator_generation_jobs" # Construct parameters if limit is not None: @@ -3041,7 +3224,9 @@ def build_beta_memory_stores_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_memory_stores_delete_request(name: str, **kwargs: Any) -> HttpRequest: +def build_beta_evaluators_cancel_generation_job_request( # pylint: disable=name-too-long + job_id: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3049,9 +3234,9 @@ def build_beta_memory_stores_delete_request(name: str, **kwargs: Any) -> HttpReq accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores/{name}" + _url = "/evaluator_generation_jobs/{jobId}:cancel" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "jobId": _SERIALIZER.url("job_id", job_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3062,11 +3247,255 @@ def build_beta_memory_stores_delete_request(name: str, **kwargs: Any) -> HttpReq # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_memory_stores_search_memories_request( # pylint: disable=name-too-long - name: str, **kwargs: Any +def build_beta_evaluators_delete_generation_job_request( # pylint: disable=name-too-long + job_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 = "/evaluator_generation_jobs/{jobId}" + path_format_arguments = { + "jobId": _SERIALIZER.url("job_id", job_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_insights_generate_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/insights" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if "Repeatability-Request-ID" not in _headers: + _headers["Repeatability-Request-ID"] = str(uuid.uuid4()) + if "Repeatability-First-Sent" not in _headers: + _headers["Repeatability-First-Sent"] = _SERIALIZER.serialize_data( + datetime.datetime.now(datetime.timezone.utc), "rfc-1123" + ) + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_insights_get_request( + insight_id: str, *, include_coordinates: Optional[bool] = 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 = "/insights/{id}" + path_format_arguments = { + "id": _SERIALIZER.url("insight_id", insight_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if include_coordinates is not None: + _params["includeCoordinates"] = _SERIALIZER.query("include_coordinates", include_coordinates, "bool") + _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_insights_list_request( + *, + type: Optional[Union[str, _models.InsightType]] = None, + eval_id: Optional[str] = None, + run_id: Optional[str] = None, + agent_name: Optional[str] = None, + include_coordinates: Optional[bool] = 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 = "/insights" + + # Construct parameters + if type is not None: + _params["type"] = _SERIALIZER.query("type", type, "str") + if eval_id is not None: + _params["evalId"] = _SERIALIZER.query("eval_id", eval_id, "str") + if run_id is not None: + _params["runId"] = _SERIALIZER.query("run_id", run_id, "str") + if agent_name is not None: + _params["agentName"] = _SERIALIZER.query("agent_name", agent_name, "str") + if include_coordinates is not None: + _params["includeCoordinates"] = _SERIALIZER.query("include_coordinates", include_coordinates, "bool") + _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_memory_stores_create_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/memory_stores" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_memory_stores_update_request(name: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/memory_stores/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_memory_stores_get_request(name: 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 = "/memory_stores/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "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_memory_stores_list_request( + *, + 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 = "/memory_stores" + + # 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_memory_stores_delete_request(name: 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 = "/memory_stores/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_memory_stores_search_memories_request( # pylint: disable=name-too-long + name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -7288,7 +7717,1178 @@ def get_microsoft365_package( # pylint: disable=too-many-locals agent_name=agent_name, content_type=content_type, api_version=self._config.api_version, - content=_content, + content=_content, + 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_microsoft365_publish_defaults( + self, agent_name: str, *, publish_as_digital_worker: Optional[bool] = None, **kwargs: Any + ) -> _models.Microsoft365PublishDefaults: + """Get Microsoft 365 publish defaults. + + Returns default and previously-published values used to pre-populate a Microsoft 365 publish + request for a Foundry agent. + + :param agent_name: The name of the agent to get publish defaults for. Required. + :type agent_name: str + :keyword publish_as_digital_worker: When true, returns defaults for publishing the agent as an + autopilot (digital worker) agent. Default value is None. + :paramtype publish_as_digital_worker: bool + :return: Microsoft365PublishDefaults. The Microsoft365PublishDefaults is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.Microsoft365PublishDefaults + :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.Microsoft365PublishDefaults] = kwargs.pop("cls", None) + + _request = build_agents_get_microsoft365_publish_defaults_request( + agent_name=agent_name, + publish_as_digital_worker=publish_as_digital_worker, + 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.Microsoft365PublishDefaults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_telephony_binding( + self, + agent_name: str, + body: _models.CreateTelephonyBindingRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TelephonyBinding: + """Create an agent telephony binding. + + Creates a telephony binding for the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param body: The provider-specific binding to create. Required. + :type body: ~azure.ai.projects.models.CreateTelephonyBindingRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_telephony_binding( + self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.TelephonyBinding: + """Create an agent telephony binding. + + Creates a telephony binding for the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param body: The provider-specific binding to create. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_telephony_binding( + self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.TelephonyBinding: + """Create an agent telephony binding. + + Creates a telephony binding for the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param body: The provider-specific binding to create. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_telephony_binding( + self, agent_name: str, body: Union[_models.CreateTelephonyBindingRequest, JSON, IO[bytes]], **kwargs: Any + ) -> _models.TelephonyBinding: + """Create an agent telephony binding. + + Creates a telephony binding for the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param body: The provider-specific binding to create. Is one of the following types: + CreateTelephonyBindingRequest, JSON, IO[bytes] Required. + :type body: ~azure.ai.projects.models.CreateTelephonyBindingRequest or JSON or IO[bytes] + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TelephonyBinding] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_agents_create_telephony_binding_request( + agent_name=agent_name, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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 [201]: + 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["ETag"] = self._deserialize("str", response.headers.get("ETag")) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TelephonyBinding, response.json()) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_telephony_bindings( + self, + agent_name: str, + *, + provider: Optional[Union[str, _models.TelephonyProvider]] = None, + status: Optional[Union[str, _models.TelephonyBindingStatus]] = None, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.TelephonyBindingListItem"]: + """List agent telephony bindings. + + Returns the telephony bindings owned by the voice agent named in the path. + + :param agent_name: The name of the voice agent whose bindings are listed. Required. + :type agent_name: str + :keyword provider: Filters bindings by provider. Known values are: "teams_phone_extension" and + "twilio". Default value is None. + :paramtype provider: str or ~azure.ai.projects.models.TelephonyProvider + :keyword status: Filters bindings by lifecycle status. Known values are: "active" and + "suspended". Default value is None. + :paramtype status: str or ~azure.ai.projects.models.TelephonyBindingStatus + :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 TelephonyBindingListItem + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.TelephonyBindingListItem] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.TelephonyBindingListItem]] = 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_agents_list_telephony_bindings_request( + agent_name=agent_name, + provider=provider, + status=status, + 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.TelephonyBindingListItem], + 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_telephony_binding(self, agent_name: str, binding_id: str, **kwargs: Any) -> _models.TelephonyBinding: + """Get an agent telephony binding. + + Retrieves a telephony binding owned by the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param binding_id: The service-generated binding identifier. Required. + :type binding_id: str + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :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.TelephonyBinding] = kwargs.pop("cls", None) + + _request = build_agents_get_telephony_binding_request( + agent_name=agent_name, + binding_id=binding_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) + + response_headers = {} + response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TelephonyBinding, response.json()) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def update_telephony_binding( + self, + agent_name: str, + binding_id: str, + body: _models.UpdateTelephonyBindingRequest, + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> _models.TelephonyBinding: + """Update an agent telephony binding. + + Updates a telephony binding owned by the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param binding_id: The service-generated binding identifier. Required. + :type binding_id: str + :param body: The binding properties to update. Required. + :type body: ~azure.ai.projects.models.UpdateTelephonyBindingRequest + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/merge-patch+json". + :paramtype content_type: str + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_telephony_binding( + self, + agent_name: str, + binding_id: str, + body: JSON, + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> _models.TelephonyBinding: + """Update an agent telephony binding. + + Updates a telephony binding owned by the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param binding_id: The service-generated binding identifier. Required. + :type binding_id: str + :param body: The binding properties to update. Required. + :type body: JSON + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/merge-patch+json". + :paramtype content_type: str + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_telephony_binding( + self, + agent_name: str, + binding_id: str, + body: IO[bytes], + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> _models.TelephonyBinding: + """Update an agent telephony binding. + + Updates a telephony binding owned by the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param binding_id: The service-generated binding identifier. Required. + :type binding_id: str + :param body: The binding properties to update. Required. + :type body: IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/merge-patch+json". + :paramtype content_type: str + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_telephony_binding( + self, + agent_name: str, + binding_id: str, + body: Union[_models.UpdateTelephonyBindingRequest, JSON, IO[bytes]], + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> _models.TelephonyBinding: + """Update an agent telephony binding. + + Updates a telephony binding owned by the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param binding_id: The service-generated binding identifier. Required. + :type binding_id: str + :param body: The binding properties to update. Is one of the following types: + UpdateTelephonyBindingRequest, JSON, IO[bytes] Required. + :type body: ~azure.ai.projects.models.UpdateTelephonyBindingRequest or JSON or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TelephonyBinding] = kwargs.pop("cls", None) + + content_type = content_type or "application/merge-patch+json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_agents_update_telephony_binding_request( + agent_name=agent_name, + binding_id=binding_id, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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) + + response_headers = {} + response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TelephonyBinding, response.json()) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete_telephony_binding( # pylint: disable=inconsistent-return-statements + self, agent_name: str, binding_id: str, *, etag: str, match_condition: MatchConditions, **kwargs: Any + ) -> None: + """Delete an agent telephony binding. + + Deletes a telephony binding owned by the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param binding_id: The service-generated binding identifier. Required. + :type binding_id: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + 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_agents_delete_telephony_binding_request( + agent_name=agent_name, + binding_id=binding_id, + etag=etag, + match_condition=match_condition, + 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_telephony_calls( + self, + agent_name: str, + *, + provider: Optional[Union[str, _models.TelephonyProvider]] = None, + status: Optional[Union[str, _models.TelephonyCallStatus]] = None, + started_after: Optional[datetime.datetime] = None, + started_before: Optional[datetime.datetime] = None, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.TelephonyCallSummary"]: + """List agent telephony calls. + + Returns the durable inbound call history for the voice agent named in the path. + + :param agent_name: The name of the voice agent whose calls are listed. Required. + :type agent_name: str + :keyword provider: Filters calls by provider. Known values are: "teams_phone_extension" and + "twilio". Default value is None. + :paramtype provider: str or ~azure.ai.projects.models.TelephonyProvider + :keyword status: Filters calls by lifecycle status. Known values are: "in_progress", "success", + and "failed". Default value is None. + :paramtype status: str or ~azure.ai.projects.models.TelephonyCallStatus + :keyword started_after: Includes calls that started at or after this Unix timestamp in seconds. + Default value is None. + :paramtype started_after: ~datetime.datetime + :keyword started_before: Includes calls that started at or before this Unix timestamp in + seconds. Default value is None. + :paramtype started_before: ~datetime.datetime + :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 TelephonyCallSummary + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.TelephonyCallSummary] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.TelephonyCallSummary]] = 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_agents_list_telephony_calls_request( + agent_name=agent_name, + provider=provider, + status=status, + started_after=started_after, + started_before=started_before, + 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.TelephonyCallSummary], + 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_telephony_call(self, agent_name: str, call_id: str, **kwargs: Any) -> _models.TelephonyCallRecord: + """Get an agent telephony call. + + Retrieves a durable inbound call record owned by the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the call record. Required. + :type agent_name: str + :param call_id: The service-generated call identifier. Required. + :type call_id: str + :return: TelephonyCallRecord. The TelephonyCallRecord is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallRecord + :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.TelephonyCallRecord] = kwargs.pop("cls", None) + + _request = build_agents_get_telephony_call_request( + agent_name=agent_name, + call_id=call_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.TelephonyCallRecord, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def transfer_telephony_call( + self, agent_name: str, call_id: str, *, target: str, content_type: str = "application/json", **kwargs: Any + ) -> _models.TelephonyCallRecord: + """Transfer an active agent telephony call. + + Transfers an active inbound call to a configured target for the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the active call. Required. + :type agent_name: str + :param call_id: The service-generated call identifier. Required. + :type call_id: str + :keyword target: The name of a transfer target configured for the voice agent. Required. + :paramtype target: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyCallRecord. The TelephonyCallRecord is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def transfer_telephony_call( + self, agent_name: str, call_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.TelephonyCallRecord: + """Transfer an active agent telephony call. + + Transfers an active inbound call to a configured target for the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the active call. Required. + :type agent_name: str + :param call_id: The service-generated call identifier. Required. + :type call_id: str + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyCallRecord. The TelephonyCallRecord is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def transfer_telephony_call( + self, agent_name: str, call_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.TelephonyCallRecord: + """Transfer an active agent telephony call. + + Transfers an active inbound call to a configured target for the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the active call. Required. + :type agent_name: str + :param call_id: The service-generated call identifier. Required. + :type call_id: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyCallRecord. The TelephonyCallRecord is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def transfer_telephony_call( + self, + agent_name: str, + call_id: str, + body: Union[JSON, IO[bytes]] = _Unset, + *, + target: str = _Unset, + **kwargs: Any + ) -> _models.TelephonyCallRecord: + """Transfer an active agent telephony call. + + Transfers an active inbound call to a configured target for the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the active call. Required. + :type agent_name: str + :param call_id: The service-generated call identifier. Required. + :type call_id: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword target: The name of a transfer target configured for the voice agent. Required. + :paramtype target: str + :return: TelephonyCallRecord. The TelephonyCallRecord is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallRecord + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TelephonyCallRecord] = kwargs.pop("cls", None) + + if body is _Unset: + if target is _Unset: + raise TypeError("missing required argument: target") + body = {"target": target} + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_agents_transfer_telephony_call_request( + agent_name=agent_name, + call_id=call_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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.TelephonyCallRecord, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def end_telephony_call(self, agent_name: str, call_id: str, **kwargs: Any) -> _models.TelephonyCallRecord: + """End an active agent telephony call. + + Ends an active inbound call owned by the voice agent named in the path. + + :param agent_name: The name of the voice agent that owns the active call. Required. + :type agent_name: str + :param call_id: The service-generated call identifier. Required. + :type call_id: str + :return: TelephonyCallRecord. The TelephonyCallRecord is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallRecord + :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.TelephonyCallRecord] = kwargs.pop("cls", None) + + _request = build_agents_end_telephony_call_request( + agent_name=agent_name, + call_id=call_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.TelephonyCallRecord, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_telephony_transfer_targets(self, agent_name: str, **kwargs: Any) -> _models.TelephonyTransferTargets: + """Get agent telephony transfer targets. + + Returns all transfer targets configured for the voice agent named in the path. + + :param agent_name: The name of the voice agent whose transfer targets are retrieved. Required. + :type agent_name: str + :return: TelephonyTransferTargets. The TelephonyTransferTargets is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyTransferTargets + :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.TelephonyTransferTargets] = kwargs.pop("cls", None) + + _request = build_agents_get_telephony_transfer_targets_request( + agent_name=agent_name, + api_version=self._config.api_version, headers=_headers, params=_params, ) @@ -7298,7 +8898,7 @@ def get_microsoft365_package( # pylint: disable=too-many-locals _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", True) + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -7319,32 +8919,144 @@ def get_microsoft365_package( # pylint: disable=too-many-locals raise HttpResponseError(response=response, model=error) response_headers = {} - response_headers["Content-Type"] = self._deserialize("str", response.headers.get("Content-Type")) + response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TelephonyTransferTargets, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore + @overload + def replace_telephony_transfer_targets( + self, + agent_name: str, + *, + transfer_targets: List[_models.TelephonyTransferTarget], + etag: str, + match_condition: MatchConditions, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TelephonyTransferTargets: + """Replace agent telephony transfer targets. + + Replaces all transfer targets configured for the voice agent named in the path. + + :param agent_name: The name of the voice agent whose transfer targets are replaced. Required. + :type agent_name: str + :keyword 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. + :paramtype transfer_targets: list[~azure.ai.projects.models.TelephonyTransferTarget] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyTransferTargets. The TelephonyTransferTargets is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyTransferTargets + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def replace_telephony_transfer_targets( + self, + agent_name: str, + body: JSON, + *, + etag: List[_models.TelephonyTransferTarget], + match_condition: str, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TelephonyTransferTargets: + """Replace agent telephony transfer targets. + + Replaces all transfer targets configured for the voice agent named in the path. + + :param agent_name: The name of the voice agent whose transfer targets are replaced. Required. + :type agent_name: str + :param body: Required. + :type body: JSON + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: list[~azure.ai.projects.models.TelephonyTransferTarget] + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyTransferTargets. The TelephonyTransferTargets is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyTransferTargets + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def replace_telephony_transfer_targets( + self, + agent_name: str, + body: IO[bytes], + *, + etag: List[_models.TelephonyTransferTarget], + match_condition: str, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TelephonyTransferTargets: + """Replace agent telephony transfer targets. + + Replaces all transfer targets configured for the voice agent named in the path. + + :param agent_name: The name of the voice agent whose transfer targets are replaced. Required. + :type agent_name: str + :param body: Required. + :type body: IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: list[~azure.ai.projects.models.TelephonyTransferTarget] + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyTransferTargets. The TelephonyTransferTargets is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyTransferTargets + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace - def get_microsoft365_publish_defaults( - self, agent_name: str, *, publish_as_digital_worker: Optional[bool] = None, **kwargs: Any - ) -> _models.Microsoft365PublishDefaults: - """Get Microsoft 365 publish defaults. + def replace_telephony_transfer_targets( + self, + agent_name: str, + body: Union[JSON, IO[bytes]] = _Unset, + *, + transfer_targets: List[_models.TelephonyTransferTarget] = _Unset, + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> _models.TelephonyTransferTargets: + """Replace agent telephony transfer targets. - Returns default and previously-published values used to pre-populate a Microsoft 365 publish - request for a Foundry agent. + Replaces all transfer targets configured for the voice agent named in the path. - :param agent_name: The name of the agent to get publish defaults for. Required. + :param agent_name: The name of the voice agent whose transfer targets are replaced. Required. :type agent_name: str - :keyword publish_as_digital_worker: When true, returns defaults for publishing the agent as an - autopilot (digital worker) agent. Default value is None. - :paramtype publish_as_digital_worker: bool - :return: Microsoft365PublishDefaults. The Microsoft365PublishDefaults is compatible with + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword 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. + :paramtype transfer_targets: list[~azure.ai.projects.models.TelephonyTransferTarget] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :return: TelephonyTransferTargets. The TelephonyTransferTargets is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Microsoft365PublishDefaults + :rtype: ~azure.ai.projects.models.TelephonyTransferTargets :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -7353,17 +9065,39 @@ def get_microsoft365_publish_defaults( 409: ResourceExistsError, 304: ResourceNotModifiedError, } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Microsoft365PublishDefaults] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TelephonyTransferTargets] = kwargs.pop("cls", None) - _request = build_agents_get_microsoft365_publish_defaults_request( + if body is _Unset: + if transfer_targets is _Unset: + raise TypeError("missing required argument: transfer_targets") + body = {"transfer_targets": transfer_targets} + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_agents_replace_telephony_transfer_targets_request( agent_name=agent_name, - publish_as_digital_worker=publish_as_digital_worker, + etag=etag, + match_condition=match_condition, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -7393,13 +9127,16 @@ def get_microsoft365_publish_defaults( ) raise HttpResponseError(response=response, model=error) + response_headers = {} + response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) + if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Microsoft365PublishDefaults, response.json()) + deserialized = _deserialize(_models.TelephonyTransferTargets, response.json()) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -9839,6 +11576,186 @@ def create_or_update( return deserialized # type: ignore +class AgentEndpointConversationsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.AIProjectClient`'s + :attr:`agent_endpoint_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 get_agent_conversation_item_generated_audio( # pylint: disable=name-too-long + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.VoiceGeneratedItemAudioResponse: + """Get a voice agent conversation item's generated audio metadata. + + Returns metadata for a conversation item's generated audio. This subordinate artifact is + separate from the canonical heard-audio segment and exists only when playback was interrupted + and the service rendered more audio than the listener heard, including when the response ends + as cancelled. Returns ``404`` when the conversation or item was not persisted, or when no + generated audio exists beyond the heard segment. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose generated audio metadata is retrieved. + Required. + :type item_id: str + :return: VoiceGeneratedItemAudioResponse. The VoiceGeneratedItemAudioResponse is compatible + with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceGeneratedItemAudioResponse + :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.VoiceGeneratedItemAudioResponse] = kwargs.pop("cls", None) + + _request = build_agent_endpoint_conversations_get_agent_conversation_item_generated_audio_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.VoiceGeneratedItemAudioResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_agent_conversation_item_generated_audio_content( # pylint: disable=name-too-long + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> Iterator[bytes]: + """Stream a voice agent conversation item's generated audio. + + Streams a conversation item's generated audio as a WAV (``audio/wav``) byte stream through the + service. This subordinate artifact exists only when playback was interrupted and the service + rendered more audio than the listener heard, including when the response ends as cancelled. + This route serves Foundry-managed storage only. For bring-your-own-storage (BYOS) recordings + the bytes are not proxied, so this route returns ``409 Conflict``. Returns ``404`` when the + conversation or item was not persisted, or when no generated audio exists beyond the heard + segment. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose generated audio is streamed. 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_agent_endpoint_conversations_get_agent_conversation_item_generated_audio_content_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 + + class ToolboxesOperations: # pylint: disable=docstring-missing-param """ .. warning:: @@ -10666,6 +12583,7 @@ def connect_voice_agent( # pylint: disable=inconsistent-return-statements agent_name: str, *, foundry_features_query: Optional[Literal[_AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW]] = None, + transport: Optional[Union[str, _models.VoiceAgentTransport]] = None, store: Optional[bool] = None, agent_version_override: Optional[str] = None, websocket_subprotocol: Optional[Union[str, _models.VoiceAgentWebSocketSubprotocol]] = None, @@ -10681,11 +12599,28 @@ def connect_voice_agent( # pylint: disable=inconsistent-return-statements ``foundry_features`` query parameter. - If the target agent is disabled, the HTTP WebSocket handshake fails before the ``101 Switching - Protocols`` - upgrade. The service returns ``409 Conflict`` using the shared Foundry ``ApiErrorResponse`` - shape with - ``error.code = agent_disabled``. This failure is terminal until the caller enables the agent. + Handshake failures are evaluated in the following order, independent of the requested + ``transport``: + + + + 1. Agent enablement (any transport): if the target agent is disabled, the handshake fails + before the + `101 Switching Protocols` upgrade with `409 Conflict`, using the shared Foundry + `ApiErrorResponse` shape + with `error.code = agent_disabled`. This failure is terminal until the caller enables the + agent, and it + takes precedence over the WebRTC-specific checks below. + 2. WebRTC availability (only when `transport=webrtc`, and only once the agent itself is + enabled): the agent + must have the WebRTC transport capability configured. If the agent is enabled but WebRTC is not + available + for it, the handshake fails with `404 Not Found`. This is distinct from the `409 + agent_disabled` case + above, which concerns the agent itself rather than its WebRTC capability. + 3. WebRTC compatibility (only when `transport=webrtc`): WebRTC does not support + bring-your-own-model (BYOM) + or hosted-agent voice agents; those requests fail with `400 Bad Request`. :param agent_name: The name of the voice agent. Required. :type agent_name: str @@ -10695,6 +12630,14 @@ def connect_voice_agent( # pylint: disable=inconsistent-return-statements header is required. VOICE_AGENTS_V1_PREVIEW. Default value is None. :paramtype foundry_features_query: str or ~azure.ai.projects.models.VOICE_AGENTS_V1_PREVIEW + :keyword transport: Selects the connection transport. Omit or send ``websocket`` for the + default, where signaling and audio are + exchanged as JSON events over this WebSocket. Send ``webrtc`` to negotiate a WebRTC + connection: the WebSocket + then carries only SDP signaling (``rtc.call.sdp.create`` / ``rtc.call.sdp.created``) while + media and the data + channel are peer-to-peer. Known values are: "websocket" and "webrtc". Default value is None. + :paramtype transport: str or ~azure.ai.projects.models.VoiceAgentTransport :keyword store: Whether to persist the conversation created by this WebSocket session. If omitted, the service honors the persisted voice agent definition's configured ``store`` value. If supplied, this value @@ -10728,6 +12671,7 @@ def connect_voice_agent( # pylint: disable=inconsistent-return-statements _request = build_beta_voice_agent_web_socket_connect_voice_agent_request( agent_name=agent_name, foundry_features_query=foundry_features_query, + transport=transport, store=store, agent_version_override=agent_version_override, websocket_subprotocol=websocket_subprotocol, diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch.py index fe39cec6850f..d881541529d8 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch.py @@ -13,6 +13,7 @@ from typing import Any, Callable, List from ..models._patch import _FOUNDRY_FEATURES_HEADER_NAME, _BETA_OPERATION_FEATURE_HEADERS, _has_header_case_insensitive from ._patch_agents import AgentsOperations, BetaAgentsOperations +from ._patch_agent_endpoint_conversations import AgentEndpointConversationsOperations from ._patch_datasets import BetaDatasetsOperations, DatasetsOperations from ._patch_evaluators import BetaEvaluatorsOperations from ._patch_evaluation_rules import EvaluationRulesOperations @@ -146,6 +147,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: __all__: List[str] = [ "AgentsOperations", + "AgentEndpointConversationsOperations", "BetaAgentEndpointConversationsOperations", "BetaAgentInsightMonitorsOperations", "BetaAgentsOperations", diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agent_endpoint_conversations.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agent_endpoint_conversations.py new file mode 100644 index 000000000000..33a2878aef12 --- /dev/null +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agent_endpoint_conversations.py @@ -0,0 +1,140 @@ +# pylint: disable=line-too-long,useless-suppression +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" + +from typing import Any, Iterator +from azure.core.exceptions import HttpResponseError +from azure.core.tracing.decorator import distributed_trace +from ._operations import AgentEndpointConversationsOperations as GeneratedAgentEndpointConversationsOperations +from .. import models as _models +from ..models._enums import _AgentDefinitionOptInKeys +from ..models._patch import ( + _FOUNDRY_FEATURES_HEADER_NAME, + _has_header_case_insensitive, + _PREVIEW_FEATURE_REQUIRED_CODE, + _PREVIEW_FEATURE_ADDED_ERROR_MESSAGE, +) + + +class AgentEndpointConversationsOperations(GeneratedAgentEndpointConversationsOperations): + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.AIProjectClient`'s + :attr:`agent_endpoint_conversations` attribute. + """ + + @distributed_trace + def get_agent_conversation_item_generated_audio( # pylint: disable=name-too-long # type: ignore[override] + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.VoiceGeneratedItemAudioResponse: + """Get a voice agent conversation item's generated audio metadata. + + Returns metadata for a conversation item's generated audio. This subordinate artifact is + separate from the canonical heard-audio segment and exists only when playback was interrupted + and the service rendered more audio than the listener heard, including when the response ends + as cancelled. Returns ``404`` when the conversation or item was not persisted, or when no + generated audio exists beyond the heard segment. When the client is constructed with + ``allow_preview=True``, the required preview opt-in header is added automatically. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose generated audio metadata is retrieved. + Required. + :type item_id: str + :return: VoiceGeneratedItemAudioResponse. The VoiceGeneratedItemAudioResponse is compatible + with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceGeneratedItemAudioResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + # Add Foundry-Features header if not already present + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = { + _FOUNDRY_FEATURES_HEADER_NAME: _AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.value + } + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.value + kwargs["headers"] = headers + + try: + return super().get_agent_conversation_item_generated_audio(agent_name, conversation_id, item_id, **kwargs) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + + @distributed_trace + def get_agent_conversation_item_generated_audio_content( # pylint: disable=name-too-long # type: ignore[override] + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> Iterator[bytes]: + """Stream a voice agent conversation item's generated audio. + + Streams a conversation item's generated audio as a WAV (``audio/wav``) byte stream through the + service. This subordinate artifact exists only when playback was interrupted and the service + rendered more audio than the listener heard, including when the response ends as cancelled. + This route serves Foundry-managed storage only. For bring-your-own-storage (BYOS) recordings + the bytes are not proxied, so this route returns ``409 Conflict``. Returns ``404`` when the + conversation or item was not persisted, or when no generated audio exists beyond the heard + segment. When the client is constructed with ``allow_preview=True``, the required preview + opt-in header is added automatically. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose generated audio is streamed. Required. + :type item_id: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = { + _FOUNDRY_FEATURES_HEADER_NAME: _AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.value + } + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.value + kwargs["headers"] = headers + + try: + return super().get_agent_conversation_item_generated_audio_content( + agent_name, conversation_id, item_id, **kwargs + ) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py index 6408d1b899ca..b901cb3143a9 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py @@ -1,4 +1,4 @@ -# pylint: disable=line-too-long,useless-suppression,pointless-string-statement +# pylint: disable=line-too-long,useless-suppression,pointless-string-statement,too-many-lines # ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. @@ -8,10 +8,13 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ +import datetime import hashlib from io import IOBase -from typing import Union, Optional, Any, IO, cast, overload, TYPE_CHECKING +from typing import Union, Optional, Any, IO, List, cast, overload, TYPE_CHECKING +from azure.core import MatchConditions from azure.core.exceptions import HttpResponseError +from azure.core.paging import ItemPaged from azure.core.polling import NoPolling, PollingMethod from azure.core.polling.base_polling import LROBasePolling from azure.core.tracing.decorator import distributed_trace @@ -404,6 +407,922 @@ def generate_agent(self, body: _models.GenerateVoiceAgentRequest, **kwargs: Any) raise new_exc from exc raise + @overload # type: ignore[override] + def create_telephony_binding( + self, + agent_name: str, + body: _models.CreateTelephonyBindingRequest, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> _models.TelephonyBinding: + """Create an agent telephony binding. + + Creates a telephony binding for the voice agent named in the path. When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param body: The provider-specific binding to create. Required. + :type body: ~azure.ai.projects.models.CreateTelephonyBindingRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_telephony_binding( + self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.TelephonyBinding: + """Create an agent telephony binding. + + Creates a telephony binding for the voice agent named in the path. When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param body: The provider-specific binding to create. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_telephony_binding( + self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.TelephonyBinding: + """Create an agent telephony binding. + + Creates a telephony binding for the voice agent named in the path. When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param body: The provider-specific binding to create. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_telephony_binding( # type: ignore[override] + self, agent_name: str, body: Union[_models.CreateTelephonyBindingRequest, JSON, IO[bytes]], **kwargs: Any + ) -> _models.TelephonyBinding: + """Create an agent telephony binding. + + Creates a telephony binding for the voice agent named in the path. When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param body: The provider-specific binding to create. Is one of the following types: + CreateTelephonyBindingRequest, JSON, IO[bytes] Required. + :type body: ~azure.ai.projects.models.CreateTelephonyBindingRequest or JSON or IO[bytes] + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + + if getattr(self._config, "allow_preview", False): + # Add Foundry-Features header if not already present + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS + kwargs["headers"] = headers + + try: + return super().create_telephony_binding(agent_name, body, **kwargs) # type: ignore[arg-type] + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + + @distributed_trace + def list_telephony_bindings( # type: ignore[override] + self, + agent_name: str, + *, + provider: Optional[Union[str, _models.TelephonyProvider]] = None, + status: Optional[Union[str, _models.TelephonyBindingStatus]] = None, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any, + ) -> ItemPaged["_models.TelephonyBindingListItem"]: + """List agent telephony bindings. + + Returns the telephony bindings owned by the voice agent named in the path. When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the voice agent whose bindings are listed. Required. + :type agent_name: str + :keyword provider: Filters bindings by provider. Known values are: "teams_phone_extension" and + "twilio". Default value is None. + :paramtype provider: str or ~azure.ai.projects.models.TelephonyProvider + :keyword status: Filters bindings by lifecycle status. Known values are: "active" and + "suspended". Default value is None. + :paramtype status: str or ~azure.ai.projects.models.TelephonyBindingStatus + :keyword limit: A limit on the number of objects to be returned. Default value is None. + :paramtype limit: int + :keyword order: Sort order by the ``created_at`` timestamp of the objects. 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. Default value is None. + :paramtype before: str + :return: An iterator like instance of TelephonyBindingListItem + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.TelephonyBindingListItem] + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + # Add Foundry-Features header if not already present + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS + kwargs["headers"] = headers + + return super().list_telephony_bindings( + agent_name, provider=provider, status=status, limit=limit, order=order, before=before, **kwargs + ) + + @distributed_trace + def get_telephony_binding( # type: ignore[override] + self, agent_name: str, binding_id: str, **kwargs: Any + ) -> _models.TelephonyBinding: + """Get an agent telephony binding. + + Retrieves a telephony binding owned by the voice agent named in the path. When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param binding_id: The service-generated binding identifier. Required. + :type binding_id: str + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS + kwargs["headers"] = headers + + try: + return super().get_telephony_binding(agent_name, binding_id, **kwargs) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + + @overload # type: ignore[override] + def update_telephony_binding( + self, + agent_name: str, + binding_id: str, + body: _models.UpdateTelephonyBindingRequest, + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/merge-patch+json", + **kwargs: Any, + ) -> _models.TelephonyBinding: + """Update an agent telephony binding. + + Updates a telephony binding owned by the voice agent named in the path. When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param binding_id: The service-generated binding identifier. Required. + :type binding_id: str + :param body: The binding properties to update. Required. + :type body: ~azure.ai.projects.models.UpdateTelephonyBindingRequest + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/merge-patch+json". + :paramtype content_type: str + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_telephony_binding( + self, + agent_name: str, + binding_id: str, + body: JSON, + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/merge-patch+json", + **kwargs: Any, + ) -> _models.TelephonyBinding: + """Update an agent telephony binding. + + Updates a telephony binding owned by the voice agent named in the path. When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param binding_id: The service-generated binding identifier. Required. + :type binding_id: str + :param body: The binding properties to update. Required. + :type body: JSON + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/merge-patch+json". + :paramtype content_type: str + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_telephony_binding( + self, + agent_name: str, + binding_id: str, + body: IO[bytes], + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/merge-patch+json", + **kwargs: Any, + ) -> _models.TelephonyBinding: + """Update an agent telephony binding. + + Updates a telephony binding owned by the voice agent named in the path. When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param binding_id: The service-generated binding identifier. Required. + :type binding_id: str + :param body: The binding properties to update. Required. + :type body: IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/merge-patch+json". + :paramtype content_type: str + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_telephony_binding( # type: ignore[override] + self, + agent_name: str, + binding_id: str, + body: Union[_models.UpdateTelephonyBindingRequest, JSON, IO[bytes]], + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any, + ) -> _models.TelephonyBinding: + """Update an agent telephony binding. + + Updates a telephony binding owned by the voice agent named in the path. When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param binding_id: The service-generated binding identifier. Required. + :type binding_id: str + :param body: The binding properties to update. Is one of the following types: + UpdateTelephonyBindingRequest, JSON, IO[bytes] Required. + :type body: ~azure.ai.projects.models.UpdateTelephonyBindingRequest or JSON or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :return: TelephonyBinding. The TelephonyBinding is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS + kwargs["headers"] = headers + + try: + return super().update_telephony_binding( # type: ignore[arg-type] + agent_name, binding_id, body, etag=etag, match_condition=match_condition, **kwargs + ) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + + @distributed_trace + def delete_telephony_binding( # type: ignore[override] # pylint: disable=inconsistent-return-statements + self, agent_name: str, binding_id: str, *, etag: str, match_condition: MatchConditions, **kwargs: Any + ) -> None: + """Delete an agent telephony binding. + + Deletes a telephony binding owned by the voice agent named in the path. When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the voice agent that owns the binding. Required. + :type agent_name: str + :param binding_id: The service-generated binding identifier. Required. + :type binding_id: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS + kwargs["headers"] = headers + + try: + return super().delete_telephony_binding(agent_name, binding_id, etag=etag, match_condition=match_condition, **kwargs) # type: ignore[misc] + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + + @distributed_trace + def list_telephony_calls( # type: ignore[override] + self, + agent_name: str, + *, + provider: Optional[Union[str, _models.TelephonyProvider]] = None, + status: Optional[Union[str, _models.TelephonyCallStatus]] = None, + started_after: Optional[datetime.datetime] = None, + started_before: Optional[datetime.datetime] = None, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any, + ) -> ItemPaged["_models.TelephonyCallSummary"]: + """List agent telephony calls. + + Returns the durable inbound call history for the voice agent named in the path. When the + client is constructed with ``allow_preview=True``, the required preview opt-in header is + added automatically. + + :param agent_name: The name of the voice agent whose calls are listed. Required. + :type agent_name: str + :keyword provider: Filters calls by provider. Known values are: "teams_phone_extension" and + "twilio". Default value is None. + :paramtype provider: str or ~azure.ai.projects.models.TelephonyProvider + :keyword status: Filters calls by lifecycle status. Known values are: "in_progress", + "success", and "failed". Default value is None. + :paramtype status: str or ~azure.ai.projects.models.TelephonyCallStatus + :keyword started_after: Includes calls that started at or after this Unix timestamp in + seconds. Default value is None. + :paramtype started_after: ~datetime.datetime + :keyword started_before: Includes calls that started at or before this Unix timestamp in + seconds. Default value is None. + :paramtype started_before: ~datetime.datetime + :keyword limit: A limit on the number of objects to be returned. Default value is None. + :paramtype limit: int + :keyword order: Sort order by the ``created_at`` timestamp of the objects. 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. Default value is None. + :paramtype before: str + :return: An iterator like instance of TelephonyCallSummary + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.TelephonyCallSummary] + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS + kwargs["headers"] = headers + + return super().list_telephony_calls( + agent_name, + provider=provider, + status=status, + started_after=started_after, + started_before=started_before, + limit=limit, + order=order, + before=before, + **kwargs, + ) + + @distributed_trace + def get_telephony_call( # type: ignore[override] + self, agent_name: str, call_id: str, **kwargs: Any + ) -> _models.TelephonyCallRecord: + """Get an agent telephony call. + + Retrieves a durable inbound call record owned by the voice agent named in the path. When the + client is constructed with ``allow_preview=True``, the required preview opt-in header is + added automatically. + + :param agent_name: The name of the voice agent that owns the call record. Required. + :type agent_name: str + :param call_id: The service-generated call identifier. Required. + :type call_id: str + :return: TelephonyCallRecord. The TelephonyCallRecord is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS + kwargs["headers"] = headers + + try: + return super().get_telephony_call(agent_name, call_id, **kwargs) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + + @overload # type: ignore[override] + def transfer_telephony_call( + self, agent_name: str, call_id: str, *, target: str, content_type: str = "application/json", **kwargs: Any + ) -> _models.TelephonyCallRecord: + """Transfer an active agent telephony call. + + Transfers an active inbound call to a configured target for the voice agent named in the + path. When the client is constructed with ``allow_preview=True``, the required preview opt-in + header is added automatically. + + :param agent_name: The name of the voice agent that owns the active call. Required. + :type agent_name: str + :param call_id: The service-generated call identifier. Required. + :type call_id: str + :keyword target: The name of a transfer target configured for the voice agent. Required. + :paramtype target: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyCallRecord. The TelephonyCallRecord is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def transfer_telephony_call( + self, agent_name: str, call_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.TelephonyCallRecord: + """Transfer an active agent telephony call. + + Transfers an active inbound call to a configured target for the voice agent named in the + path. When the client is constructed with ``allow_preview=True``, the required preview opt-in + header is added automatically. + + :param agent_name: The name of the voice agent that owns the active call. Required. + :type agent_name: str + :param call_id: The service-generated call identifier. Required. + :type call_id: str + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyCallRecord. The TelephonyCallRecord is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def transfer_telephony_call( + self, + agent_name: str, + call_id: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> _models.TelephonyCallRecord: + """Transfer an active agent telephony call. + + Transfers an active inbound call to a configured target for the voice agent named in the + path. When the client is constructed with ``allow_preview=True``, the required preview opt-in + header is added automatically. + + :param agent_name: The name of the voice agent that owns the active call. Required. + :type agent_name: str + :param call_id: The service-generated call identifier. Required. + :type call_id: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyCallRecord. The TelephonyCallRecord is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def transfer_telephony_call( # type: ignore[override] + self, + agent_name: str, + call_id: str, + body: Union[JSON, IO[bytes]] = _Unset, + *, + target: str = _Unset, + **kwargs: Any, + ) -> _models.TelephonyCallRecord: + """Transfer an active agent telephony call. + + Transfers an active inbound call to a configured target for the voice agent named in the + path. When the client is constructed with ``allow_preview=True``, the required preview opt-in + header is added automatically. + + :param agent_name: The name of the voice agent that owns the active call. Required. + :type agent_name: str + :param call_id: The service-generated call identifier. Required. + :type call_id: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword target: The name of a transfer target configured for the voice agent. Required. + :paramtype target: str + :return: TelephonyCallRecord. The TelephonyCallRecord is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS + kwargs["headers"] = headers + + try: + return super().transfer_telephony_call(agent_name, call_id, body, target=target, **kwargs) # type: ignore[misc] + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + + @distributed_trace + def end_telephony_call( # type: ignore[override] + self, agent_name: str, call_id: str, **kwargs: Any + ) -> _models.TelephonyCallRecord: + """End an active agent telephony call. + + Ends an active inbound call owned by the voice agent named in the path. When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the voice agent that owns the active call. Required. + :type agent_name: str + :param call_id: The service-generated call identifier. Required. + :type call_id: str + :return: TelephonyCallRecord. The TelephonyCallRecord is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS + kwargs["headers"] = headers + + try: + return super().end_telephony_call(agent_name, call_id, **kwargs) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + + @distributed_trace + def get_telephony_transfer_targets( # type: ignore[override] + self, agent_name: str, **kwargs: Any + ) -> _models.TelephonyTransferTargets: + """Get agent telephony transfer targets. + + Returns all transfer targets configured for the voice agent named in the path. When the + client is constructed with ``allow_preview=True``, the required preview opt-in header is + added automatically. + + :param agent_name: The name of the voice agent whose transfer targets are retrieved. Required. + :type agent_name: str + :return: TelephonyTransferTargets. The TelephonyTransferTargets is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyTransferTargets + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS + kwargs["headers"] = headers + + try: + return super().get_telephony_transfer_targets(agent_name, **kwargs) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + + @overload # type: ignore[override] + def replace_telephony_transfer_targets( + self, + agent_name: str, + *, + transfer_targets: List[_models.TelephonyTransferTarget], + etag: str, + match_condition: MatchConditions, + content_type: str = "application/json", + **kwargs: Any, + ) -> _models.TelephonyTransferTargets: + """Replace agent telephony transfer targets. + + Replaces all transfer targets configured for the voice agent named in the path. When the + client is constructed with ``allow_preview=True``, the required preview opt-in header is + added automatically. + + :param agent_name: The name of the voice agent whose transfer targets are replaced. Required. + :type agent_name: str + :keyword 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. + :paramtype transfer_targets: list[~azure.ai.projects.models.TelephonyTransferTarget] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyTransferTargets. The TelephonyTransferTargets is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyTransferTargets + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def replace_telephony_transfer_targets( + self, + agent_name: str, + body: JSON, + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/json", + **kwargs: Any, + ) -> _models.TelephonyTransferTargets: + """Replace agent telephony transfer targets. + + Replaces all transfer targets configured for the voice agent named in the path. When the + client is constructed with ``allow_preview=True``, the required preview opt-in header is + added automatically. + + :param agent_name: The name of the voice agent whose transfer targets are replaced. Required. + :type agent_name: str + :param body: Required. + :type body: JSON + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyTransferTargets. The TelephonyTransferTargets is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyTransferTargets + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def replace_telephony_transfer_targets( + self, + agent_name: str, + body: IO[bytes], + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/json", + **kwargs: Any, + ) -> _models.TelephonyTransferTargets: + """Replace agent telephony transfer targets. + + Replaces all transfer targets configured for the voice agent named in the path. When the + client is constructed with ``allow_preview=True``, the required preview opt-in header is + added automatically. + + :param agent_name: The name of the voice agent whose transfer targets are replaced. Required. + :type agent_name: str + :param body: Required. + :type body: IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyTransferTargets. The TelephonyTransferTargets is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyTransferTargets + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def replace_telephony_transfer_targets( # type: ignore[override] + self, + agent_name: str, + body: Union[JSON, IO[bytes]] = _Unset, + *, + transfer_targets: List[_models.TelephonyTransferTarget] = _Unset, + etag: str, + match_condition: MatchConditions, + **kwargs: Any, + ) -> _models.TelephonyTransferTargets: + """Replace agent telephony transfer targets. + + Replaces all transfer targets configured for the voice agent named in the path. When the + client is constructed with ``allow_preview=True``, the required preview opt-in header is + added automatically. + + :param agent_name: The name of the voice agent whose transfer targets are replaced. Required. + :type agent_name: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword 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. + :paramtype transfer_targets: list[~azure.ai.projects.models.TelephonyTransferTarget] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :return: TelephonyTransferTargets. The TelephonyTransferTargets is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyTransferTargets + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS + kwargs["headers"] = headers + + try: + return super().replace_telephony_transfer_targets( # type: ignore[arg-type] + agent_name, + body, + transfer_targets=transfer_targets, + etag=etag, + match_condition=match_condition, + **kwargs, + ) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + class BetaAgentsOperations(BetaAgentsOperationsGenerated): """Custom operations for beta agent optimization jobs.""" diff --git a/sdk/ai/azure-ai-projects/docs/public-methods.md b/sdk/ai/azure-ai-projects/docs/public-methods.md index 646731b69f07..fc7da6b1c2f9 100644 --- a/sdk/ai/azure-ai-projects/docs/public-methods.md +++ b/sdk/ai/azure-ai-projects/docs/public-methods.md @@ -4,16 +4,17 @@ This document lists all public methods available on `AIProjectClient` and its su ## Summary -There are a total of 170 unique public methods: +There are a total of 183 unique public methods: - 5 stable methods on the client -- 59 stable methods on top-level sub-clients +- 72 stable methods on top-level sub-clients - 106 beta methods on nested beta sub-clients ### Top-level sub-clients (stable operations) | Subclient | Class Name | Methods Count | |-----------|------------|----------------| -| `agents` | AgentsOperations | 27 | +| `agent_endpoint_conversations` | AgentEndpointConversationsOperations | 2 | +| `agents` | AgentsOperations | 38 | | `connections` | ConnectionsOperations | 3 | | `datasets` | DatasetsOperations | 9 | | `deployments` | DeploymentsOperations | 2 | @@ -58,32 +59,46 @@ Alphabetically sorted. An asterisk at the end of the method name means is a hand Alphabetically sorted. An asterisk at the end of the method name means is a hand-written method. ``` +.agent_endpoint_conversations.get_agent_conversation_item_generated_audio +.agent_endpoint_conversations.get_agent_conversation_item_generated_audio_content + .agents.create_session +.agents.create_telephony_binding* .agents.create_version* .agents.create_version_from_code* .agents.create_version_from_manifest .agents.delete .agents.delete_session .agents.delete_session_file +.agents.delete_telephony_binding* .agents.delete_version .agents.disable .agents.download_code .agents.download_session_file .agents.enable +.agents.end_telephony_call* .agents.generate_agent* .agents.get .agents.get_microsoft365_package .agents.get_microsoft365_publish_defaults .agents.get_session .agents.get_session_log_stream +.agents.get_telephony_binding* +.agents.get_telephony_call* +.agents.get_telephony_transfer_targets* .agents.get_version .agents.list .agents.list_session_files .agents.list_sessions +.agents.list_telephony_bindings* +.agents.list_telephony_calls* .agents.list_versions .agents.publish_to_microsoft365 +.agents.replace_telephony_transfer_targets* .agents.stop_session +.agents.transfer_telephony_call* .agents.update_details +.agents.update_telephony_binding* .agents.upload_session_file .connections.get* 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 d691644701a9..976be2957bae 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 @@ -60,7 +60,10 @@ class TestToWsUrl: def test_https_endpoint_becomes_wss(self): url = _to_ws_url(_ENDPOINT, "my-agent") - assert url == "wss://my-account.services.ai.azure.com/api/projects/my-project/agents/my-agent/endpoint/protocols/voice" + assert ( + url + == "wss://my-account.services.ai.azure.com/api/projects/my-project/agents/my-agent/endpoint/protocols/voice" + ) def test_http_endpoint_becomes_ws(self): url = _to_ws_url("http://localhost:8080", "my-agent") @@ -68,7 +71,10 @@ def test_http_endpoint_becomes_ws(self): def test_trailing_slash_is_stripped(self): url = _to_ws_url(_ENDPOINT + "/", "my-agent") - assert url == "wss://my-account.services.ai.azure.com/api/projects/my-project/agents/my-agent/endpoint/protocols/voice" + assert ( + url + == "wss://my-account.services.ai.azure.com/api/projects/my-project/agents/my-agent/endpoint/protocols/voice" + ) class TestAssertTrustedConnectionUrl: diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_telephony.py b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_telephony.py new file mode 100644 index 000000000000..1d6dec2af66c --- /dev/null +++ b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_telephony.py @@ -0,0 +1,309 @@ +# pylint: disable=too-many-lines,line-too-long,useless-suppression +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +# cSpell:disable + +from test_base import TestBase, servicePreparer +from devtools_testutils import recorded_by_proxy +import pytest +from azure.core import MatchConditions +from azure.core.exceptions import HttpResponseError, ResourceNotFoundError +from azure.ai.projects.models import ( + AgentVersionDetails, + PSTNTelephonyTransferDestination, + TelephonyBindingStatus, + TelephonyTransferTarget, + TelephonyTransferTargets, + UpdateTelephonyBindingRequest, + VoiceAgentAudioConfig, + VoiceAgentAudioOutputConfig, + VoiceAgentDefinition, + VoiceOutputModality, +) + + +class TestVoiceAgentTelephony(TestBase): + """ + Recorded tests covering the voice-agent telephony REST API surface exposed through + `project_client.agents.*` (telephony bindings, calls, and transfer targets), and the + top-level `project_client.agent_endpoint_conversations.*` generated-audio reads. + + NOTE: All tests in this file are currently marked `skip`: + - The telephony routes (`/agents/{agent_name}/telephony_bindings`, `/telephony_calls`, + `/telephony_transfer_targets`) are defined in the TypeSpec/SDK but not yet deployed to + the live test resource: every call returns an empty-body 404 (a routing-layer "no such + route" response from the service mesh, not an application-level not-found error - + confirmed by comparing against a known-working route's fully-populated JSON error body). + Un-skip `test_telephony_bindings_and_transfer_targets`/`test_telephony_calls_not_found` + once the service deploys these routes. + - `agent_endpoint_conversations.get_agent_conversation_item_generated_audio*` with a + made-up conversation/item ID hits the service's conversation-ID format validator and + returns an unhandled `500 server_error` instead of a clean `404` - the exact same + pre-existing behavior as the already-documented `beta.agent_endpoint_conversations` + limitation below. Testing the success path needs a live realtime session whose playback + was interrupted; testing the not-found path needs a validly-formatted but nonexistent ID + (the format isn't publicly documented). `test_generated_audio_not_found` is left in as a + placeholder and currently skipped. + + Further NOTE: the following are intentionally NOT covered here at all since they require real + infrastructure this test environment does not have: + - `create_telephony_binding` with a real Teams Phone Extension or Twilio provider account + (needs real provider credentials/connections). Its request/response wiring is still + exercised indirectly through the header-injection unit tests in + `tests/foundry_features_header/`. + - `list_telephony_calls`/`get_telephony_call`/`transfer_telephony_call`/`end_telephony_call` + against an actual in-progress or historical call (needs a real inbound telephony call). + - Reading back a conversation (`project_client.beta.agent_endpoint_conversations.*`) using a + `conversation_id` produced by a live realtime WebSocket session - the service's REST + conversation-ID validator rejects the ID format generated by the realtime WS subsystem. + This is also not practical to cover with HTTP-only recorded tests since it requires an + actual WebSocket session. + Once these are fixed/deployed service-side, tests can be added/enabled for them. + """ + + def _make_definition(self, model: str) -> VoiceAgentDefinition: + return VoiceAgentDefinition( + model_type="managed", + model=model, + instructions="You are a helpful voice assistant.", + audio=VoiceAgentAudioConfig( + output=VoiceAgentAudioOutputConfig(voice="en-US-AvaNeural", voice_type="azure-standard") + ), + output_modalities=[VoiceOutputModality.AUDIO], + ) + + # To run only this test: + # pytest tests\agents\test_voice_agent_telephony.py::TestVoiceAgentTelephony::test_telephony_bindings_and_transfer_targets -s + @pytest.mark.skip( + reason="Telephony routes are defined in the TypeSpec/SDK but not yet deployed on the live " + "test service (empty-body 404s at the routing layer). Un-skip once the service deploys them." + ) + @servicePreparer() + @recorded_by_proxy() + def test_telephony_bindings_and_transfer_targets(self, **kwargs): + """ + Test telephony bindings (list/get/update/delete against a nonexistent binding) and a + round-trip of the telephony transfer targets configured for a voice agent. + + Routes used in this test: + + Action REST API Route Client Method + ------+-------------------------------------------------------------+----------------------------------------------- + POST /agents/{agent_name}/versions project_client.agents.create_version() + GET /agents/{agent_name}/telephony_bindings project_client.agents.list_telephony_bindings() + GET /agents/{agent_name}/telephony_transfer_targets project_client.agents.get_telephony_transfer_targets() + PUT /agents/{agent_name}/telephony_transfer_targets project_client.agents.replace_telephony_transfer_targets() + GET /agents/{agent_name}/telephony_bindings/{binding_id} project_client.agents.get_telephony_binding() + PATCH /agents/{agent_name}/telephony_bindings/{binding_id} project_client.agents.update_telephony_binding() + DELETE /agents/{agent_name}/telephony_bindings/{binding_id} project_client.agents.delete_telephony_binding() + DELETE /agents/{agent_name} project_client.agents.delete() + """ + print("\n") + model = kwargs.get("foundry_voice_model_name") + assert model is not None + # Voice-agent operations require the preview opt-in. + project_client = self.create_client(allow_preview=True, **kwargs) + agent_name = "VoiceAgentTelephonyBindingsTest" + + # Delete any existing agent from previous test runs (ignore failures) + try: + project_client.agents.delete(agent_name=agent_name) + except Exception: # pylint: disable=broad-except + pass + + agent_version: AgentVersionDetails = project_client.agents.create_version( + agent_name=agent_name, + definition=self._make_definition(model), + ) + self._validate_agent_version(agent_version, expected_name=agent_name) + + # A freshly created agent has no telephony bindings. + bindings = list(project_client.agents.list_telephony_bindings(agent_name=agent_name)) + assert len(bindings) == 0 + + # A freshly created agent has no telephony transfer targets configured. + targets: TelephonyTransferTargets = project_client.agents.get_telephony_transfer_targets(agent_name=agent_name) + assert targets is not None + assert len(targets.transfer_targets) == 0 + + # Configure one PSTN transfer target. + new_target = TelephonyTransferTarget( + name="sales_desk", + description="Transfers to the sales desk for pricing questions.", + destination=PSTNTelephonyTransferDestination(value="+14255550123"), + ) + replaced_targets: TelephonyTransferTargets = project_client.agents.replace_telephony_transfer_targets( + agent_name=agent_name, + transfer_targets=[new_target], + etag=None, + match_condition=MatchConditions.Unconditionally, + ) + assert len(replaced_targets.transfer_targets) == 1 + assert replaced_targets.transfer_targets[0].name == "sales_desk" + assert replaced_targets.transfer_targets[0].destination.kind == "pstn" + + # Confirm the change persisted. + confirmed_targets: TelephonyTransferTargets = project_client.agents.get_telephony_transfer_targets( + agent_name=agent_name + ) + assert len(confirmed_targets.transfer_targets) == 1 + assert confirmed_targets.transfer_targets[0].name == "sales_desk" + + # Clear the transfer targets (empty array clears all targets). + cleared_targets: TelephonyTransferTargets = project_client.agents.replace_telephony_transfer_targets( + agent_name=agent_name, + transfer_targets=[], + etag=None, + match_condition=MatchConditions.Unconditionally, + ) + assert len(cleared_targets.transfer_targets) == 0 + + # A nonexistent telephony binding returns 404 on get/update/delete. + fake_binding_id = "nonexistent-binding-id" + with pytest.raises(ResourceNotFoundError): + project_client.agents.get_telephony_binding(agent_name=agent_name, binding_id=fake_binding_id) + with pytest.raises(ResourceNotFoundError): + project_client.agents.update_telephony_binding( + agent_name=agent_name, + binding_id=fake_binding_id, + body=UpdateTelephonyBindingRequest(status=TelephonyBindingStatus.SUSPENDED), + etag=None, + match_condition=MatchConditions.Unconditionally, + ) + with pytest.raises(ResourceNotFoundError): + project_client.agents.delete_telephony_binding( + agent_name=agent_name, + binding_id=fake_binding_id, + etag=None, + match_condition=MatchConditions.Unconditionally, + ) + + # Delete the voice agent. + result = project_client.agents.delete(agent_name=agent_name) + assert result.deleted + + # To run only this test: + # pytest tests\agents\test_voice_agent_telephony.py::TestVoiceAgentTelephony::test_telephony_calls_not_found -s + @pytest.mark.skip( + reason="Telephony routes are defined in the TypeSpec/SDK but not yet deployed on the live " + "test service (empty-body 404s at the routing layer). Un-skip once the service deploys them." + ) + @servicePreparer() + @recorded_by_proxy() + def test_telephony_calls_not_found(self, **kwargs): + """ + Test telephony calls: listing (empty on a fresh agent) and get/transfer/end against a + nonexistent call, which return 404. + + Routes used in this test: + + Action REST API Route Client Method + ------+-------------------------------------------------------------+----------------------------------------------- + POST /agents/{agent_name}/versions project_client.agents.create_version() + GET /agents/{agent_name}/telephony_calls project_client.agents.list_telephony_calls() + GET /agents/{agent_name}/telephony_calls/{call_id} project_client.agents.get_telephony_call() + POST /agents/{agent_name}/telephony_calls/{call_id}:transfer project_client.agents.transfer_telephony_call() + POST /agents/{agent_name}/telephony_calls/{call_id}:end project_client.agents.end_telephony_call() + DELETE /agents/{agent_name} project_client.agents.delete() + """ + print("\n") + model = kwargs.get("foundry_voice_model_name") + assert model is not None + project_client = self.create_client(allow_preview=True, **kwargs) + agent_name = "VoiceAgentTelephonyCallsTest" + + # Delete any existing agent from previous test runs (ignore failures) + try: + project_client.agents.delete(agent_name=agent_name) + except Exception: # pylint: disable=broad-except + pass + + agent_version: AgentVersionDetails = project_client.agents.create_version( + agent_name=agent_name, + definition=self._make_definition(model), + ) + self._validate_agent_version(agent_version, expected_name=agent_name) + + # A freshly created agent has no telephony call history. + calls = list(project_client.agents.list_telephony_calls(agent_name=agent_name)) + assert len(calls) == 0 + + fake_call_id = "nonexistent-call-id" + with pytest.raises(ResourceNotFoundError): + project_client.agents.get_telephony_call(agent_name=agent_name, call_id=fake_call_id) + with pytest.raises(HttpResponseError) as transfer_exc_info: + project_client.agents.transfer_telephony_call( + agent_name=agent_name, call_id=fake_call_id, target="nonexistent-target" + ) + assert transfer_exc_info.value.status_code == 404 + with pytest.raises(HttpResponseError) as end_exc_info: + project_client.agents.end_telephony_call(agent_name=agent_name, call_id=fake_call_id) + assert end_exc_info.value.status_code == 404 + + # Delete the voice agent. + result = project_client.agents.delete(agent_name=agent_name) + assert result.deleted + + # To run only this test: + # pytest tests\agents\test_voice_agent_telephony.py::TestVoiceAgentTelephony::test_generated_audio_not_found -s + @pytest.mark.skip( + reason="A made-up conversation/item ID hits the service's conversation-ID format validator " + "and returns an unhandled 500 instead of a clean 404 (same pre-existing behavior as " + "beta.agent_endpoint_conversations). Needs a validly-formatted but nonexistent ID, or a real " + "realtime session, to test properly." + ) + @servicePreparer() + @recorded_by_proxy() + def test_generated_audio_not_found(self, **kwargs): + """ + Test the top-level `agent_endpoint_conversations.get_agent_conversation_item_generated_audio`/ + `get_agent_conversation_item_generated_audio_content` methods against a nonexistent + conversation item, which return 404. This is a new, top-level operation group, distinct + from `beta.agent_endpoint_conversations`. + + Routes used in this test: + + Action REST API Route Client Method + ------+-----------------------------------------------------------------------------------------+----------------------------------------------------------------------------- + POST /agents/{agent_name}/versions project_client.agents.create_version() + GET /agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/items/{item_id}/audio/generated project_client.agent_endpoint_conversations.get_agent_conversation_item_generated_audio() + GET /agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/items/{item_id}/audio/generated/content project_client.agent_endpoint_conversations.get_agent_conversation_item_generated_audio_content() + DELETE /agents/{agent_name} project_client.agents.delete() + """ + print("\n") + model = kwargs.get("foundry_voice_model_name") + assert model is not None + project_client = self.create_client(allow_preview=True, **kwargs) + agent_name = "VoiceAgentGeneratedAudioTest" + + # Delete any existing agent from previous test runs (ignore failures) + try: + project_client.agents.delete(agent_name=agent_name) + except Exception: # pylint: disable=broad-except + pass + + agent_version: AgentVersionDetails = project_client.agents.create_version( + agent_name=agent_name, + definition=self._make_definition(model), + ) + self._validate_agent_version(agent_version, expected_name=agent_name) + + fake_conversation_id = "nonexistent-conversation-id" + fake_item_id = "nonexistent-item-id" + with pytest.raises(ResourceNotFoundError): + project_client.agent_endpoint_conversations.get_agent_conversation_item_generated_audio( + agent_name=agent_name, conversation_id=fake_conversation_id, item_id=fake_item_id + ) + with pytest.raises(HttpResponseError) as content_exc_info: + list( + project_client.agent_endpoint_conversations.get_agent_conversation_item_generated_audio_content( + agent_name=agent_name, conversation_id=fake_conversation_id, item_id=fake_item_id + ) + ) + assert content_exc_info.value.status_code == 404 + + # Delete the voice agent. + result = project_client.agents.delete(agent_name=agent_name) + assert result.deleted diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_telephony_async.py b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_telephony_async.py new file mode 100644 index 000000000000..4d2c1e719c13 --- /dev/null +++ b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_telephony_async.py @@ -0,0 +1,312 @@ +# pylint: disable=too-many-lines,line-too-long,useless-suppression +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +# cSpell:disable + +from test_base import TestBase, servicePreparer +from devtools_testutils.aio import recorded_by_proxy_async +import pytest +from azure.core import MatchConditions +from azure.core.exceptions import HttpResponseError, ResourceNotFoundError +from azure.ai.projects.models import ( + AgentVersionDetails, + PSTNTelephonyTransferDestination, + TelephonyBindingStatus, + TelephonyTransferTarget, + TelephonyTransferTargets, + UpdateTelephonyBindingRequest, + VoiceAgentAudioConfig, + VoiceAgentAudioOutputConfig, + VoiceAgentDefinition, + VoiceOutputModality, +) + + +class TestVoiceAgentTelephonyAsync(TestBase): + """ + Recorded tests covering the voice-agent telephony REST API surface exposed through + `project_client.agents.*` (telephony bindings, calls, and transfer targets), and the + top-level `project_client.agent_endpoint_conversations.*` generated-audio reads. + + NOTE: All tests in this file are currently marked `skip`: + - The telephony routes (`/agents/{agent_name}/telephony_bindings`, `/telephony_calls`, + `/telephony_transfer_targets`) are defined in the TypeSpec/SDK but not yet deployed to + the live test resource: every call returns an empty-body 404 (a routing-layer "no such + route" response from the service mesh, not an application-level not-found error - + confirmed by comparing against a known-working route's fully-populated JSON error body). + Un-skip `test_telephony_bindings_and_transfer_targets`/`test_telephony_calls_not_found` + once the service deploys these routes. + - `agent_endpoint_conversations.get_agent_conversation_item_generated_audio*` with a + made-up conversation/item ID hits the service's conversation-ID format validator and + returns an unhandled `500 server_error` instead of a clean `404` - the exact same + pre-existing behavior as the already-documented `beta.agent_endpoint_conversations` + limitation below. Testing the success path needs a live realtime session whose playback + was interrupted; testing the not-found path needs a validly-formatted but nonexistent ID + (the format isn't publicly documented). `test_generated_audio_not_found` is left in as a + placeholder and currently skipped. + + Further NOTE: the following are intentionally NOT covered here at all since they require real + infrastructure this test environment does not have: + - `create_telephony_binding` with a real Teams Phone Extension or Twilio provider account + (needs real provider credentials/connections). Its request/response wiring is still + exercised indirectly through the header-injection unit tests in + `tests/foundry_features_header/`. + - `list_telephony_calls`/`get_telephony_call`/`transfer_telephony_call`/`end_telephony_call` + against an actual in-progress or historical call (needs a real inbound telephony call). + - Reading back a conversation (`project_client.beta.agent_endpoint_conversations.*`) using a + `conversation_id` produced by a live realtime WebSocket session - the service's REST + conversation-ID validator rejects the ID format generated by the realtime WS subsystem. + This is also not practical to cover with HTTP-only recorded tests since it requires an + actual WebSocket session. + Once these are fixed/deployed service-side, tests can be added/enabled for them. + """ + + def _make_definition(self, model: str) -> VoiceAgentDefinition: + return VoiceAgentDefinition( + model_type="managed", + model=model, + instructions="You are a helpful voice assistant.", + audio=VoiceAgentAudioConfig( + output=VoiceAgentAudioOutputConfig(voice="en-US-AvaNeural", voice_type="azure-standard") + ), + output_modalities=[VoiceOutputModality.AUDIO], + ) + + # To run only this test: + # pytest tests\agents\test_voice_agent_telephony_async.py::TestVoiceAgentTelephonyAsync::test_telephony_bindings_and_transfer_targets -s + @pytest.mark.skip( + reason="Telephony routes are defined in the TypeSpec/SDK but not yet deployed on the live " + "test service (empty-body 404s at the routing layer). Un-skip once the service deploys them." + ) + @servicePreparer() + @recorded_by_proxy_async() + async def test_telephony_bindings_and_transfer_targets(self, **kwargs): + """ + Test telephony bindings (list/get/update/delete against a nonexistent binding) and a + round-trip of the telephony transfer targets configured for a voice agent. + + Routes used in this test: + + Action REST API Route Client Method + ------+-------------------------------------------------------------+----------------------------------------------- + POST /agents/{agent_name}/versions project_client.agents.create_version() + GET /agents/{agent_name}/telephony_bindings project_client.agents.list_telephony_bindings() + GET /agents/{agent_name}/telephony_transfer_targets project_client.agents.get_telephony_transfer_targets() + PUT /agents/{agent_name}/telephony_transfer_targets project_client.agents.replace_telephony_transfer_targets() + GET /agents/{agent_name}/telephony_bindings/{binding_id} project_client.agents.get_telephony_binding() + PATCH /agents/{agent_name}/telephony_bindings/{binding_id} project_client.agents.update_telephony_binding() + DELETE /agents/{agent_name}/telephony_bindings/{binding_id} project_client.agents.delete_telephony_binding() + DELETE /agents/{agent_name} project_client.agents.delete() + """ + print("\n") + model = kwargs.get("foundry_voice_model_name") + assert model is not None + # Voice-agent operations require the preview opt-in. + project_client = self.create_async_client(allow_preview=True, **kwargs) + agent_name = "VoiceAgentTelephonyBindingsTest" + + # Delete any existing agent from previous test runs (ignore failures) + try: + await project_client.agents.delete(agent_name=agent_name) + except Exception: # pylint: disable=broad-except + pass + + agent_version: AgentVersionDetails = await project_client.agents.create_version( + agent_name=agent_name, + definition=self._make_definition(model), + ) + self._validate_agent_version(agent_version, expected_name=agent_name) + + # A freshly created agent has no telephony bindings. + bindings = [b async for b in project_client.agents.list_telephony_bindings(agent_name=agent_name)] + assert len(bindings) == 0 + + # A freshly created agent has no telephony transfer targets configured. + targets: TelephonyTransferTargets = await project_client.agents.get_telephony_transfer_targets( + agent_name=agent_name + ) + assert targets is not None + assert len(targets.transfer_targets) == 0 + + # Configure one PSTN transfer target. + new_target = TelephonyTransferTarget( + name="sales_desk", + description="Transfers to the sales desk for pricing questions.", + destination=PSTNTelephonyTransferDestination(value="+14255550123"), + ) + replaced_targets: TelephonyTransferTargets = await project_client.agents.replace_telephony_transfer_targets( + agent_name=agent_name, + transfer_targets=[new_target], + etag=None, + match_condition=MatchConditions.Unconditionally, + ) + assert len(replaced_targets.transfer_targets) == 1 + assert replaced_targets.transfer_targets[0].name == "sales_desk" + assert replaced_targets.transfer_targets[0].destination.kind == "pstn" + + # Confirm the change persisted. + confirmed_targets: TelephonyTransferTargets = await project_client.agents.get_telephony_transfer_targets( + agent_name=agent_name + ) + assert len(confirmed_targets.transfer_targets) == 1 + assert confirmed_targets.transfer_targets[0].name == "sales_desk" + + # Clear the transfer targets (empty array clears all targets). + cleared_targets: TelephonyTransferTargets = await project_client.agents.replace_telephony_transfer_targets( + agent_name=agent_name, + transfer_targets=[], + etag=None, + match_condition=MatchConditions.Unconditionally, + ) + assert len(cleared_targets.transfer_targets) == 0 + + # A nonexistent telephony binding returns 404 on get/update/delete. + fake_binding_id = "nonexistent-binding-id" + with pytest.raises(ResourceNotFoundError): + await project_client.agents.get_telephony_binding(agent_name=agent_name, binding_id=fake_binding_id) + with pytest.raises(ResourceNotFoundError): + await project_client.agents.update_telephony_binding( + agent_name=agent_name, + binding_id=fake_binding_id, + body=UpdateTelephonyBindingRequest(status=TelephonyBindingStatus.SUSPENDED), + etag=None, + match_condition=MatchConditions.Unconditionally, + ) + with pytest.raises(ResourceNotFoundError): + await project_client.agents.delete_telephony_binding( + agent_name=agent_name, + binding_id=fake_binding_id, + etag=None, + match_condition=MatchConditions.Unconditionally, + ) + + # Delete the voice agent. + result = await project_client.agents.delete(agent_name=agent_name) + assert result.deleted + + # To run only this test: + # pytest tests\agents\test_voice_agent_telephony_async.py::TestVoiceAgentTelephonyAsync::test_telephony_calls_not_found -s + @pytest.mark.skip( + reason="Telephony routes are defined in the TypeSpec/SDK but not yet deployed on the live " + "test service (empty-body 404s at the routing layer). Un-skip once the service deploys them." + ) + @servicePreparer() + @recorded_by_proxy_async() + async def test_telephony_calls_not_found(self, **kwargs): + """ + Test telephony calls: listing (empty on a fresh agent) and get/transfer/end against a + nonexistent call, which return 404. + + Routes used in this test: + + Action REST API Route Client Method + ------+-------------------------------------------------------------+----------------------------------------------- + POST /agents/{agent_name}/versions project_client.agents.create_version() + GET /agents/{agent_name}/telephony_calls project_client.agents.list_telephony_calls() + GET /agents/{agent_name}/telephony_calls/{call_id} project_client.agents.get_telephony_call() + POST /agents/{agent_name}/telephony_calls/{call_id}:transfer project_client.agents.transfer_telephony_call() + POST /agents/{agent_name}/telephony_calls/{call_id}:end project_client.agents.end_telephony_call() + DELETE /agents/{agent_name} project_client.agents.delete() + """ + print("\n") + model = kwargs.get("foundry_voice_model_name") + assert model is not None + project_client = self.create_async_client(allow_preview=True, **kwargs) + agent_name = "VoiceAgentTelephonyCallsTest" + + # Delete any existing agent from previous test runs (ignore failures) + try: + await project_client.agents.delete(agent_name=agent_name) + except Exception: # pylint: disable=broad-except + pass + + agent_version: AgentVersionDetails = await project_client.agents.create_version( + agent_name=agent_name, + definition=self._make_definition(model), + ) + self._validate_agent_version(agent_version, expected_name=agent_name) + + # A freshly created agent has no telephony call history. + calls = [c async for c in project_client.agents.list_telephony_calls(agent_name=agent_name)] + assert len(calls) == 0 + + fake_call_id = "nonexistent-call-id" + with pytest.raises(ResourceNotFoundError): + await project_client.agents.get_telephony_call(agent_name=agent_name, call_id=fake_call_id) + with pytest.raises(HttpResponseError) as transfer_exc_info: + await project_client.agents.transfer_telephony_call( + agent_name=agent_name, call_id=fake_call_id, target="nonexistent-target" + ) + assert transfer_exc_info.value.status_code == 404 + with pytest.raises(HttpResponseError) as end_exc_info: + await project_client.agents.end_telephony_call(agent_name=agent_name, call_id=fake_call_id) + assert end_exc_info.value.status_code == 404 + + # Delete the voice agent. + result = await project_client.agents.delete(agent_name=agent_name) + assert result.deleted + + # To run only this test: + # pytest tests\agents\test_voice_agent_telephony_async.py::TestVoiceAgentTelephonyAsync::test_generated_audio_not_found -s + @pytest.mark.skip( + reason="A made-up conversation/item ID hits the service's conversation-ID format validator " + "and returns an unhandled 500 instead of a clean 404 (same pre-existing behavior as " + "beta.agent_endpoint_conversations). Needs a validly-formatted but nonexistent ID, or a real " + "realtime session, to test properly." + ) + @servicePreparer() + @recorded_by_proxy_async() + async def test_generated_audio_not_found(self, **kwargs): + """ + Test the top-level `agent_endpoint_conversations.get_agent_conversation_item_generated_audio`/ + `get_agent_conversation_item_generated_audio_content` methods against a nonexistent + conversation item, which return 404. This is a new, top-level operation group, distinct + from `beta.agent_endpoint_conversations`. + + Routes used in this test: + + Action REST API Route Client Method + ------+-----------------------------------------------------------------------------------------+----------------------------------------------------------------------------- + POST /agents/{agent_name}/versions project_client.agents.create_version() + GET /agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/items/{item_id}/audio/generated project_client.agent_endpoint_conversations.get_agent_conversation_item_generated_audio() + GET /agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/items/{item_id}/audio/generated/content project_client.agent_endpoint_conversations.get_agent_conversation_item_generated_audio_content() + DELETE /agents/{agent_name} project_client.agents.delete() + """ + print("\n") + model = kwargs.get("foundry_voice_model_name") + assert model is not None + project_client = self.create_async_client(allow_preview=True, **kwargs) + agent_name = "VoiceAgentGeneratedAudioTest" + + # Delete any existing agent from previous test runs (ignore failures) + try: + await project_client.agents.delete(agent_name=agent_name) + except Exception: # pylint: disable=broad-except + pass + + agent_version: AgentVersionDetails = await project_client.agents.create_version( + agent_name=agent_name, + definition=self._make_definition(model), + ) + self._validate_agent_version(agent_version, expected_name=agent_name) + + fake_conversation_id = "nonexistent-conversation-id" + fake_item_id = "nonexistent-item-id" + with pytest.raises(ResourceNotFoundError): + await project_client.agent_endpoint_conversations.get_agent_conversation_item_generated_audio( + agent_name=agent_name, conversation_id=fake_conversation_id, item_id=fake_item_id + ) + with pytest.raises(HttpResponseError) as content_exc_info: + [ + chunk + async for chunk in await project_client.agent_endpoint_conversations.get_agent_conversation_item_generated_audio_content( + agent_name=agent_name, conversation_id=fake_conversation_id, item_id=fake_item_id + ) + ] + assert content_exc_info.value.status_code == 404 + + # Delete the voice agent. + result = await project_client.agents.delete(agent_name=agent_name) + assert result.deleted diff --git a/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py b/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py index 3b504216bfbe..b0e2690bdbe3 100644 --- a/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py +++ b/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py @@ -94,19 +94,76 @@ "agents.generate_agent", "WorkflowAgents=V1Preview,ExternalAgents=V1Preview,VoiceAgents=V1Preview,DraftAgents=V1Preview,AgentsOptimization=V2Preview", ), + pytest.param( + "agents.create_telephony_binding", + "WorkflowAgents=V1Preview,ExternalAgents=V1Preview,VoiceAgents=V1Preview,DraftAgents=V1Preview,AgentsOptimization=V2Preview", + ), + pytest.param( + "agents.list_telephony_bindings", + "WorkflowAgents=V1Preview,ExternalAgents=V1Preview,VoiceAgents=V1Preview,DraftAgents=V1Preview,AgentsOptimization=V2Preview", + ), + pytest.param( + "agents.get_telephony_binding", + "WorkflowAgents=V1Preview,ExternalAgents=V1Preview,VoiceAgents=V1Preview,DraftAgents=V1Preview,AgentsOptimization=V2Preview", + ), + pytest.param( + "agents.update_telephony_binding", + "WorkflowAgents=V1Preview,ExternalAgents=V1Preview,VoiceAgents=V1Preview,DraftAgents=V1Preview,AgentsOptimization=V2Preview", + ), + pytest.param( + "agents.delete_telephony_binding", + "WorkflowAgents=V1Preview,ExternalAgents=V1Preview,VoiceAgents=V1Preview,DraftAgents=V1Preview,AgentsOptimization=V2Preview", + ), + pytest.param( + "agents.list_telephony_calls", + "WorkflowAgents=V1Preview,ExternalAgents=V1Preview,VoiceAgents=V1Preview,DraftAgents=V1Preview,AgentsOptimization=V2Preview", + ), + pytest.param( + "agents.get_telephony_call", + "WorkflowAgents=V1Preview,ExternalAgents=V1Preview,VoiceAgents=V1Preview,DraftAgents=V1Preview,AgentsOptimization=V2Preview", + ), + pytest.param( + "agents.transfer_telephony_call", + "WorkflowAgents=V1Preview,ExternalAgents=V1Preview,VoiceAgents=V1Preview,DraftAgents=V1Preview,AgentsOptimization=V2Preview", + ), + pytest.param( + "agents.end_telephony_call", + "WorkflowAgents=V1Preview,ExternalAgents=V1Preview,VoiceAgents=V1Preview,DraftAgents=V1Preview,AgentsOptimization=V2Preview", + ), + pytest.param( + "agents.get_telephony_transfer_targets", + "WorkflowAgents=V1Preview,ExternalAgents=V1Preview,VoiceAgents=V1Preview,DraftAgents=V1Preview,AgentsOptimization=V2Preview", + ), + pytest.param( + "agents.replace_telephony_transfer_targets", + "WorkflowAgents=V1Preview,ExternalAgents=V1Preview,VoiceAgents=V1Preview,DraftAgents=V1Preview,AgentsOptimization=V2Preview", + ), pytest.param( "evaluation_rules.create_or_update", "Evaluations=V1Preview", ), + # `agent_endpoint_conversations` is a top-level client attribute (distinct from the nested + # `.beta.agent_endpoint_conversations` sub-client) exposing only the "generated audio" reads; + # like `agents.generate_agent`, it optionally sends the Foundry-Features header gated behind + # `allow_preview`, so it belongs here rather than in EXPECTED_FOUNDRY_FEATURES below. + pytest.param( + "agent_endpoint_conversations.get_agent_conversation_item_generated_audio", + "VoiceAgents=V1Preview", + ), + pytest.param( + "agent_endpoint_conversations.get_agent_conversation_item_generated_audio_content", + "VoiceAgents=V1Preview", + ), ] # NOTE: `agent_endpoint_conversations` used to need its own dedicated test cases here (it was # wrapped with `_OperationMethodHeaderProxy` directly in `_patch.py`, unconditionally regardless # of `allow_preview`, since it lived as a top-level client attribute rather than a `.beta` -# sub-client). It has since moved under `.beta` upstream and is now a normal entry in -# EXPECTED_FOUNDRY_FEATURES above, using the exact same unconditional generic mechanism as every -# other `.beta` sub-client -- so it's now covered automatically (and more thoroughly: all of its -# methods, not just 4) by the dynamic discovery in test_foundry_features_header_on_beta_operations.py. +# sub-client). It then moved under `.beta` upstream and was covered automatically by the dynamic +# discovery in test_foundry_features_header_on_beta_operations.py. Upstream has since reintroduced +# a top-level `agent_endpoint_conversations` attribute (exposing only "generated audio" reads, +# distinct from the nested `.beta.agent_endpoint_conversations` sub-client, which still exists +# unchanged) that once again needs dedicated `allow_preview`-gated test cases -- see above. # Both sentinel values – used by _make_fake_call to detect required parameters # whose defaults are the internal _Unset object (rather than inspect.Parameter.empty). diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml.saved b/sdk/ai/azure-ai-projects/tsp-location.yaml.saved index fef0a3f81375..5167fc1fc595 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml.saved +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml.saved @@ -1,5 +1,5 @@ directory: specification/ai-foundry/data-plane/Foundry/src/sdk-python-js-azure-ai-projects -commit: 3fe1059cb3bb4d6dc5cf62910c09c47b64a092ad +commit: 1070c74ae519b6f86540bbd44ea295ff12642e60 repo: Azure/azure-rest-api-specs additionalDirectories: - specification/ai-foundry/data-plane/Foundry/src/agents From 9ab2ddf36c3a4c67255068700f078b178b7ec4f9 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Wed, 2 Sep 2026 19:54:41 -0700 Subject: [PATCH 45/56] Fix stale api.md from cached apistub wheel build (no source changes) The previous regeneration used a cached wheel in .venv_apistub/.staging predating some merge-resolution fixes, causing api.md to omit AgentInsightRunLROPoller/AsyncAgentInsightRunLROPoller and the base class of BetaAgentInsightMonitorsOperations, even though the actual source was always correct. Cleared the stale cache and regenerated fresh; verified a full line-by-line diff against main's api.md now shows zero API elements present in main but absent here. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- sdk/ai/azure-ai-projects/api.md | 56 +++++++++++++++++++---- sdk/ai/azure-ai-projects/api.metadata.yml | 2 +- 2 files changed, 49 insertions(+), 9 deletions(-) diff --git a/sdk/ai/azure-ai-projects/api.md b/sdk/ai/azure-ai-projects/api.md index e40baa88a9fe..999e494fe7b2 100644 --- a/sdk/ai/azure-ai-projects/api.md +++ b/sdk/ai/azure-ai-projects/api.md @@ -1024,7 +1024,7 @@ namespace azure.ai.projects.aio.operations ) -> AsyncItemPaged[VoiceConversation]: ... - class azure.ai.projects.aio.operations.BetaAgentInsightMonitorsOperations: + class azure.ai.projects.aio.operations.BetaAgentInsightMonitorsOperations(BetaAgentInsightMonitorsOperationsGenerated): def __init__( self, @@ -1040,7 +1040,7 @@ namespace azure.ai.projects.aio.operations *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[AgentInsightRunResult]: ... + ) -> AsyncAgentInsightRunLROPoller: ... @overload async def begin_create_run( @@ -1050,7 +1050,7 @@ namespace azure.ai.projects.aio.operations *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[AgentInsightRunResult]: ... + ) -> AsyncAgentInsightRunLROPoller: ... @overload async def begin_create_run( @@ -1060,7 +1060,7 @@ namespace azure.ai.projects.aio.operations *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[AgentInsightRunResult]: ... + ) -> AsyncAgentInsightRunLROPoller: ... @distributed_trace_async async def cancel_run( @@ -3831,6 +3831,26 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.AgentInsightRunLROPoller(LROPoller[AgentInsightRunResult]): + property details: Mapping[str, Any] # Read-only + + def __init__( + self, + client: Any, + initial_response: Any, + deserialization_callback: Any, + polling_method: Any + ) -> None: ... + + @classmethod + def from_continuation_token( + cls, + polling_method: PollingMethod[AgentInsightRunResult], + continuation_token: str, + **kwargs: Any + ) -> AgentInsightRunLROPoller: ... + + class azure.ai.projects.models.AgentInsightRunResult(_Model): insights_created: int insights_reopened: int @@ -4469,6 +4489,26 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.AsyncAgentInsightRunLROPoller(AsyncLROPoller[AgentInsightRunResult]): + property details: Mapping[str, Any] # Read-only + + def __init__( + self, + client: Any, + initial_response: Any, + deserialization_callback: Any, + polling_method: Any + ) -> None: ... + + @classmethod + def from_continuation_token( + cls, + polling_method: AsyncPollingMethod[AgentInsightRunResult], + continuation_token: str, + **kwargs: Any + ) -> AsyncAgentInsightRunLROPoller: ... + + class azure.ai.projects.models.AsyncAgentOptimizationLROPoller(AsyncLROPoller[AgentOptimizationJobResult]): property details: Mapping[str, Any] # Read-only @@ -16648,7 +16688,7 @@ namespace azure.ai.projects.operations ) -> ItemPaged[VoiceConversation]: ... - class azure.ai.projects.operations.BetaAgentInsightMonitorsOperations: + class azure.ai.projects.operations.BetaAgentInsightMonitorsOperations(BetaAgentInsightMonitorsOperationsGenerated): def __init__( self, @@ -16664,7 +16704,7 @@ namespace azure.ai.projects.operations *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[AgentInsightRunResult]: ... + ) -> AgentInsightRunLROPoller: ... @overload def begin_create_run( @@ -16674,7 +16714,7 @@ namespace azure.ai.projects.operations *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[AgentInsightRunResult]: ... + ) -> AgentInsightRunLROPoller: ... @overload def begin_create_run( @@ -16684,7 +16724,7 @@ namespace azure.ai.projects.operations *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[AgentInsightRunResult]: ... + ) -> AgentInsightRunLROPoller: ... @distributed_trace def cancel_run( diff --git a/sdk/ai/azure-ai-projects/api.metadata.yml b/sdk/ai/azure-ai-projects/api.metadata.yml index 7d655a96962e..9248a8ccc871 100644 --- a/sdk/ai/azure-ai-projects/api.metadata.yml +++ b/sdk/ai/azure-ai-projects/api.metadata.yml @@ -1,4 +1,4 @@ -apiMdSha256: 25fc69b3779f434662cb375de31c13b962d9ddc10dfc17882fa14c9866318d25 +apiMdSha256: a78edee1981891b9341579cacaf63d516141329aee147924c49854583e6ee974 packageVersion: 2.6.0 parserVersion: 0.3.30 pythonVersion: 3.13.2 From 3a36a74cbf668d3a07881a30f131a9aa17a0f243 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Wed, 2 Sep 2026 22:16:48 -0700 Subject: [PATCH 46/56] Fix PR #48484 review comments: security hardening, protocol bugs, sample/test fixes Security: - _assert_trusted_connection_url (sync + async _realtime.py) now compares normalized (host, port) tuples with scheme-default-port resolution instead of hostname alone, so a connection_url override targeting the same host on a different, non-default port (a different origin) is correctly rejected instead of receiving the live Authorization token. Protocol/correctness fixes: - Async realtime client now passes protocols=("realtime",) to aiohttp's ws_connect() instead of a raw Sec-WebSocket-Protocol header, which aiohttp never validates/negotiates on its own. Guarded against a caller-kwarg collision on "protocols". - Removed the dead/misleading http:// -> ws:// translation in _to_ws_url (both sync and async): enter() unconditionally rejects any non-wss:// URL, so that path could never actually be used to connect. - Live-audio sample (sample_voice_agent_live_audio_conversation_async.py): - End-of-stream playback callback branch now pads to the exact frame size pyaudio requested instead of returning a short buffer. - speech_started no longer calls response.cancel() when no response is active (fixes a false-positive service error on the very first user turn). - Mic capture callback now bounds concurrent in-flight sends to 1 and drops (rather than unboundedly scheduling) frames while a send is still in-flight, reporting the dropped-frame count at shutdown. Test/tooling/doc fixes: - Added test_voice_samples parametrization (tests/samples/test_samples.py, test_samples_async.py) so samples/agents/voice/ is discovered by the package's recorded sample tests (previously not wired up at all). - Added the live-audio sample to IGNORED_SAMPLES in both eng/tools/azure-sdk-tools/azpysdk/samples.py and scripts/devops_tasks/test_run_samples.py: it runs until Ctrl-C and would hang indefinitely under the non-interactive sample-runner. - Pinned dev_requirements.txt's websockets to >=13.0 to match the realtime extra's minimum version. - Regenerated api.metadata.yml with the pinned apiview-stub-generator==0.3.31 (was stale at 0.3.30 from a cached build). - Removed an unused RealtimeServerEventError import in test_realtime_client.py. - Added regression tests: port-mismatch trusted-connection-url rejection, explicit-default-port acceptance, protocols kwarg override, and non-https scheme left unchanged in _to_ws_url. Verified: full test suite passes (1029 passed, 113 skipped, 0 failed). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/tools/azure-sdk-tools/azpysdk/samples.py | 3 + scripts/devops_tasks/test_run_samples.py | 3 + sdk/ai/azure-ai-projects/api.metadata.yml | 2 +- .../azure/ai/projects/_realtime.py | 56 ++++++++++++---- .../azure/ai/projects/aio/_realtime.py | 67 ++++++++++++++----- sdk/ai/azure-ai-projects/dev_requirements.txt | 2 +- ...ice_agent_live_audio_conversation_async.py | 45 ++++++++++--- .../tests/agents/test_realtime_client.py | 22 +++++- .../agents/test_realtime_client_async.py | 18 ++++- .../tests/samples/test_samples.py | 36 ++++++++++ .../tests/samples/test_samples_async.py | 25 +++++++ 11 files changed, 235 insertions(+), 44 deletions(-) diff --git a/eng/tools/azure-sdk-tools/azpysdk/samples.py b/eng/tools/azure-sdk-tools/azpysdk/samples.py index 38bee23d1e4c..73d1b29a1d3f 100644 --- a/eng/tools/azure-sdk-tools/azpysdk/samples.py +++ b/eng/tools/azure-sdk-tools/azpysdk/samples.py @@ -89,6 +89,9 @@ # runner executes the file non-interactively. "sample_voice_agent_live_text_conversation.py", "sample_voice_agent_live_text_conversation_async.py", + # Runs until Ctrl-C (continuous microphone capture/playback); would hang indefinitely + # under this non-interactive runner whenever PyAudio and live credentials are available. + "sample_voice_agent_live_audio_conversation_async.py", ], "azure-eventgrid": [ "__init__.py", diff --git a/scripts/devops_tasks/test_run_samples.py b/scripts/devops_tasks/test_run_samples.py index 8e033f04599b..e726a9dd8a87 100644 --- a/scripts/devops_tasks/test_run_samples.py +++ b/scripts/devops_tasks/test_run_samples.py @@ -93,6 +93,9 @@ # runner executes the file non-interactively. "sample_voice_agent_live_text_conversation.py", "sample_voice_agent_live_text_conversation_async.py", + # Runs until Ctrl-C (continuous microphone capture/playback); would hang indefinitely + # under this non-interactive runner whenever PyAudio and live credentials are available. + "sample_voice_agent_live_audio_conversation_async.py", ], "azure-eventgrid": [ "__init__.py", diff --git a/sdk/ai/azure-ai-projects/api.metadata.yml b/sdk/ai/azure-ai-projects/api.metadata.yml index 9248a8ccc871..5c1b81491418 100644 --- a/sdk/ai/azure-ai-projects/api.metadata.yml +++ b/sdk/ai/azure-ai-projects/api.metadata.yml @@ -1,4 +1,4 @@ apiMdSha256: a78edee1981891b9341579cacaf63d516141329aee147924c49854583e6ee974 packageVersion: 2.6.0 -parserVersion: 0.3.30 +parserVersion: 0.3.31 pythonVersion: 3.13.2 diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py index dfc0df5333fd..1b11c34fa7af 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py @@ -27,6 +27,7 @@ List, Mapping, Optional, + Tuple, Type, TYPE_CHECKING, Union, @@ -228,21 +229,47 @@ def _to_ws_url(endpoint: str, agent_name: str) -> str: - """Build the realtime WebSocket URL from the HTTP project endpoint. + """Build the realtime WebSocket URL from the HTTPS project endpoint. + + Only the ``https://`` scheme is translated (to ``wss://``); any other scheme is left + unchanged so that :meth:`RealtimeConnectionManager.enter`'s ``wss://``-only check rejects + it with a clear error instead of silently producing an unencrypted ``ws://`` URL that would + also send the live Authorization token in plain text. :param str endpoint: The Foundry project endpoint (``https://.../api/projects/...``). :param str agent_name: The name of the voice agent to connect to. - :return: A ``wss://``/``ws://`` URL targeting the realtime route. + :return: A ``wss://`` URL targeting the realtime route. :rtype: str """ base = endpoint.rstrip("/") if base.startswith("https://"): base = "wss://" + base[len("https://") :] - elif base.startswith("http://"): - base = "ws://" + base[len("http://") :] return f"{base}/agents/{agent_name}/endpoint/protocols/voice" +_DEFAULT_PORT_BY_SCHEME = {"http": 80, "https": 443, "ws": 80, "wss": 443} + + +def _normalized_authority(url: str) -> Tuple[str, Optional[int]]: + """Return a ``(hostname, port)`` tuple with the scheme's default port filled in. + + ``urlparse(...).port`` is ``None`` when a URL omits an explicit port, which would make + ``https://host/...`` and ``https://host:8443/...`` compare as equal on hostname alone. + Resolving the scheme's default port here lets callers compare authorities (not just + hostnames) so a same-host override on a different, non-default port is correctly rejected. + + :param str url: The URL to parse. + :return: A tuple of the lower-cased hostname (or empty string) and the resolved port + (or ``None`` if the scheme has no known default and none was specified). + :rtype: tuple[str, Optional[int]] + """ + parsed = urlparse(url) + port = parsed.port + if port is None: + port = _DEFAULT_PORT_BY_SCHEME.get((parsed.scheme or "").lower()) + return (parsed.hostname or "").lower(), port + + def _assert_trusted_connection_url(connection_url: str, endpoint: str) -> None: """Guard against attaching the caller's Entra bearer token to an untrusted host. @@ -250,19 +277,22 @@ def _assert_trusted_connection_url(connection_url: str, endpoint: str) -> None: scheme/host/path, but the Authorization header carrying the live credential's token must never be sent to a host other than the configured Foundry project endpoint: a caller-controlled or compromised URL could otherwise be used to - exfiltrate the token to an arbitrary host. + exfiltrate the token to an arbitrary host or port. :param str connection_url: The caller-supplied override URL. :param str endpoint: The configured, trusted Foundry project endpoint. - :raises ValueError: If the override URL's host does not match the endpoint's host. + :raises ValueError: If the override URL's host or port does not match the endpoint's. """ - override_host = (urlparse(connection_url).hostname or "").lower() - trusted_host = (urlparse(endpoint).hostname or "").lower() - if not override_host or override_host != trusted_host: + override_host, override_port = _normalized_authority(connection_url) + trusted_host, trusted_port = _normalized_authority(endpoint) + if not override_host or (override_host, override_port) != (trusted_host, trusted_port): + got = override_host or connection_url + if override_host and override_port: + got = f"{override_host}:{override_port}" raise ValueError( - "The 'connection_url' override must target the same host as the configured Foundry " - f"project endpoint ('{trusted_host}') to avoid sending the Authorization token to an " - f"untrusted host; got host '{override_host or connection_url}'." + "The 'connection_url' override must target the same host and port as the configured " + f"Foundry project endpoint ('{trusted_host}:{trusted_port}') to avoid sending the " + f"Authorization token to an untrusted host; got '{got}'." ) @@ -782,7 +812,7 @@ def connect( # pylint: disable=too-many-arguments :keyword structured_inputs: A JSON object that maps structured-input names to their values for this session. Default value is None. :paramtype structured_inputs: str or None - :keyword connection_url: Full ``wss://``/``ws://`` URL that overrides the route computed + :keyword connection_url: Full ``wss://`` URL that overrides the route computed from the client endpoint. Query parameters are still appended. Default value is None. :paramtype connection_url: str or None :keyword api_version: Overrides the client's API version for the handshake. Default diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py index 47a336bbcfd8..a0de3291b620 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py @@ -42,6 +42,7 @@ List, Mapping, Optional, + Tuple, Type, TYPE_CHECKING, Union, @@ -242,21 +243,47 @@ def _to_ws_url(endpoint: str, agent_name: str) -> str: - """Build the realtime WebSocket URL from the HTTP project endpoint. + """Build the realtime WebSocket URL from the HTTPS project endpoint. + + Only the ``https://`` scheme is translated (to ``wss://``); any other scheme is left + unchanged so that :meth:`AsyncRealtimeConnectionManager.enter`'s ``wss://``-only check + rejects it with a clear error instead of silently producing an unencrypted ``ws://`` URL + that would also send the live Authorization token in plain text. :param str endpoint: The Foundry project endpoint (``https://.../api/projects/...``). :param str agent_name: The name of the voice agent to connect to. - :return: A ``wss://``/``ws://`` URL targeting the realtime route. + :return: A ``wss://`` URL targeting the realtime route. :rtype: str """ base = endpoint.rstrip("/") if base.startswith("https://"): base = "wss://" + base[len("https://") :] - elif base.startswith("http://"): - base = "ws://" + base[len("http://") :] return f"{base}/agents/{agent_name}/endpoint/protocols/voice" +_DEFAULT_PORT_BY_SCHEME = {"http": 80, "https": 443, "ws": 80, "wss": 443} + + +def _normalized_authority(url: str) -> Tuple[str, Optional[int]]: + """Return a ``(hostname, port)`` tuple with the scheme's default port filled in. + + ``urlparse(...).port`` is ``None`` when a URL omits an explicit port, which would make + ``https://host/...`` and ``https://host:8443/...`` compare as equal on hostname alone. + Resolving the scheme's default port here lets callers compare authorities (not just + hostnames) so a same-host override on a different, non-default port is correctly rejected. + + :param str url: The URL to parse. + :return: A tuple of the lower-cased hostname (or empty string) and the resolved port + (or ``None`` if the scheme has no known default and none was specified). + :rtype: tuple[str, Optional[int]] + """ + parsed = urlparse(url) + port = parsed.port + if port is None: + port = _DEFAULT_PORT_BY_SCHEME.get((parsed.scheme or "").lower()) + return (parsed.hostname or "").lower(), port + + def _assert_trusted_connection_url(connection_url: str, endpoint: str) -> None: """Guard against attaching the caller's Entra bearer token to an untrusted host. @@ -264,19 +291,22 @@ def _assert_trusted_connection_url(connection_url: str, endpoint: str) -> None: scheme/host/path, but the Authorization header carrying the live credential's token must never be sent to a host other than the configured Foundry project endpoint: a caller-controlled or compromised URL could otherwise be used to - exfiltrate the token to an arbitrary host. + exfiltrate the token to an arbitrary host or port. :param str connection_url: The caller-supplied override URL. :param str endpoint: The configured, trusted Foundry project endpoint. - :raises ValueError: If the override URL's host does not match the endpoint's host. + :raises ValueError: If the override URL's host or port does not match the endpoint's. """ - override_host = (urlparse(connection_url).hostname or "").lower() - trusted_host = (urlparse(endpoint).hostname or "").lower() - if not override_host or override_host != trusted_host: + override_host, override_port = _normalized_authority(connection_url) + trusted_host, trusted_port = _normalized_authority(endpoint) + if not override_host or (override_host, override_port) != (trusted_host, trusted_port): + got = override_host or connection_url + if override_host and override_port: + got = f"{override_host}:{override_port}" raise ValueError( - "The 'connection_url' override must target the same host as the configured Foundry " - f"project endpoint ('{trusted_host}') to avoid sending the Authorization token to an " - f"untrusted host; got host '{override_host or connection_url}'." + "The 'connection_url' override must target the same host and port as the configured " + f"Foundry project endpoint ('{trusted_host}:{trusted_port}') to avoid sending the " + f"Authorization token to an untrusted host; got '{got}'." ) @@ -705,7 +735,6 @@ async def enter(self) -> AsyncRealtimeConnection: # pylint: disable=too-many-lo headers: Dict[str, str] = { "Authorization": f"Bearer {token.token}", _FOUNDRY_FEATURES_HEADER_NAME: self._foundry_features, - "Sec-WebSocket-Protocol": "realtime", } if self._structured_inputs is not None: headers["x-ms-voice-structured-inputs"] = self._structured_inputs @@ -713,7 +742,15 @@ async def enter(self) -> AsyncRealtimeConnection: # pylint: disable=too-many-lo session = aiohttp.ClientSession() try: - connection = await session.ws_connect(url, headers=headers, params=params, **self._kwargs) + # Force the "realtime" WebSocket subprotocol regardless of any caller-supplied + # override in ``self._kwargs``: the service requires this exact subprotocol, so + # silently accepting a different one here would just move the failure to a less + # clear error inside aiohttp's handshake. + ws_connect_kwargs = dict(self._kwargs) + ws_connect_kwargs.pop("protocols", None) + connection = await session.ws_connect( + url, headers=headers, params=params, protocols=("realtime",), **ws_connect_kwargs + ) except BaseException as exc: await session.close() if not isinstance(exc, Exception) or isinstance(exc, (ValueError, RuntimeError)): @@ -788,7 +825,7 @@ def connect( # pylint: disable=too-many-arguments :keyword structured_inputs: A JSON object that maps structured-input names to their values for this session. Default value is None. :paramtype structured_inputs: str or None - :keyword connection_url: Full ``wss://``/``ws://`` URL that overrides the route computed + :keyword connection_url: Full ``wss://`` URL that overrides the route computed from the client endpoint. Query parameters are still appended. Default value is None. :paramtype connection_url: str or None :keyword api_version: Overrides the client's API version for the handshake. Default diff --git a/sdk/ai/azure-ai-projects/dev_requirements.txt b/sdk/ai/azure-ai-projects/dev_requirements.txt index db1490b46b48..a8928e8a7c9b 100644 --- a/sdk/ai/azure-ai-projects/dev_requirements.txt +++ b/sdk/ai/azure-ai-projects/dev_requirements.txt @@ -14,7 +14,7 @@ azure-monitor-query jsonref opentelemetry-sdk python-dotenv -websockets +websockets>=13.0 black # Can't include those, because they are not supported in Python 3.9. Samples that use these package # cannot be run as pytest, because the pipeline will fail on Python 3.9 jobs. diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py index 4e6e86aeb74c..016d49aa415e 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py @@ -45,6 +45,7 @@ """ import asyncio +import concurrent.futures import os import queue from typing import Any, Final, Optional @@ -64,6 +65,7 @@ RealtimeServerEventInputAudioBufferSpeechStarted, RealtimeServerEventResponseAudioDelta, RealtimeServerEventResponseAudioTranscriptDone, + RealtimeServerEventResponseCreated, RealtimeServerEventResponseDone, RealtimeServerEventSessionCreated, RealtimeServerEventError, @@ -105,6 +107,10 @@ def __init__(self, connection: "AsyncRealtimeConnection") -> None: self._next_seq = 0 self._bytes = 0 + # Bounds capture backpressure to a single in-flight send (see start_capture). + self._pending_send: "Optional[concurrent.futures.Future[None]]" = None + self._dropped_frames = 0 + self._input_stream = None self._output_stream = None @@ -117,9 +123,19 @@ def start_capture(self) -> None: self._loop = asyncio.get_running_loop() def _capture_callback(in_data, _frame_count, _time_info, _status): - # Runs on a pyaudio thread: hand the frame to the event loop to append. + # Runs on a pyaudio thread: hand the frame to the event loop to append. Each call + # schedules a coroutine on the loop via a thread-safe handoff; if sending falls + # behind real-time capture (for example, network backpressure on the WebSocket), + # unconditionally scheduling a new one every callback would let pending sends + # accumulate without bound. Instead, only keep at most one in flight and drop + # (skip sending) this frame if the previous send hasn't completed yet. assert self._loop is not None - asyncio.run_coroutine_threadsafe(self._conn.input_audio_buffer.append(audio=in_data), self._loop) + if self._pending_send is not None and not self._pending_send.done(): + self._dropped_frames += 1 + return (None, pyaudio.paContinue) + self._pending_send = asyncio.run_coroutine_threadsafe( + self._conn.input_audio_buffer.append(audio=in_data), self._loop + ) return (None, pyaudio.paContinue) self._input_stream = self._audio.open( @@ -158,7 +174,10 @@ def _playback_callback(_in_data, frame_count, _time_info, _status): out = out + bytes(wanted - len(out)) # pad with silence continue if not data: - break # end-of-stream marker + # end-of-stream marker: pad up to the exact frame size pyaudio asked for + # instead of returning a short buffer, which would corrupt playback on close. + out = out + bytes(wanted - len(out)) + break if seq < self._playback_base: remaining = b"" # skipped by a barge-in continue @@ -202,6 +221,8 @@ def shutdown(self) -> None: self._input_stream.stop_stream() self._input_stream.close() self._input_stream = None + if self._dropped_frames: + print(f"(dropped {self._dropped_frames} mic frame(s) while a send was still in flight)") if self._output_stream is not None: self.skip_pending_audio() self._playback_queue.put((self._next_seq_num(), None)) @@ -234,6 +255,7 @@ async def _run_audio_conversation(client: AIProjectClient, agent_name: str) -> O return None conversation_id: Optional[str] = None + response_active = False # Open the realtime session on the voice agent's dedicated route. async with client.realtime.connect(agent_name=agent_name) as conn: @@ -253,24 +275,27 @@ async def _run_audio_conversation(client: AIProjectClient, agent_name: str) -> O # persistence is enabled) is set here, not on response.done. conversation_id = event.conversation_id or conversation_id elif isinstance(event, RealtimeServerEventInputAudioBufferSpeechStarted): - # Barge-in: stop the active response and drop whatever reply - # audio is still queued locally. The service only supports - # output_audio_buffer.clear in avatar mode. - await conn.response.cancel() - ap.skip_pending_audio() - print("(listening...)") + # speech_started fires for every user turn, including the very first one, + # when no response is active yet. Only cancel (barge-in) if a response is + # actually in flight; canceling with none active is a service error. + if response_active: + await conn.response.cancel() + ap.skip_pending_audio() + print("(listening...)") elif isinstance(event, RealtimeServerEventConversationItemInputAudioTranscriptionCompleted): print(f"You: {event.transcript.strip()}") elif isinstance(event, RealtimeServerEventError): # Non-fatal errors are reported; a fatal one closes the socket. print(f"Session error: {event.error.message}") + elif isinstance(event, RealtimeServerEventResponseCreated): + response_active = True elif isinstance(event, RealtimeServerEventResponseAudioDelta): # Each delta is a decoded PCM16 chunk; queue it. ap.queue_audio(event.delta) elif isinstance(event, RealtimeServerEventResponseAudioTranscriptDone): print(f"Agent: {event.transcript}") elif isinstance(event, RealtimeServerEventResponseDone): - pass + response_active = False except (KeyboardInterrupt, asyncio.CancelledError): # Ctrl-C ends the session; read back whatever was persisted so far. print("\n(ending session...)") 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 976be2957bae..02e2dc12a42c 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 @@ -25,7 +25,6 @@ ) from azure.ai.projects.models import ( RealtimeClientEventResponseCreate, - RealtimeServerEventError, RealtimeServerEventSessionCreated, ) @@ -65,9 +64,14 @@ def test_https_endpoint_becomes_wss(self): == "wss://my-account.services.ai.azure.com/api/projects/my-project/agents/my-agent/endpoint/protocols/voice" ) - def test_http_endpoint_becomes_ws(self): + def test_non_https_endpoint_scheme_is_left_unchanged(self): + # Regression test: _to_ws_url used to translate "http://" to "ws://", but + # RealtimeConnectionManager.enter() unconditionally rejects any non-"wss://" URL to + # protect the live Authorization token in transit, so that translated "ws://" URL could + # never actually be used to connect. Leaving the scheme untouched here means the + # downstream "wss://" check surfaces a clear error instead of an unreachable "ws://" path. url = _to_ws_url("http://localhost:8080", "my-agent") - assert url == "ws://localhost:8080/agents/my-agent/endpoint/protocols/voice" + assert url == "http://localhost:8080/agents/my-agent/endpoint/protocols/voice" def test_trailing_slash_is_stripped(self): url = _to_ws_url(_ENDPOINT + "/", "my-agent") @@ -91,6 +95,18 @@ def test_empty_host_raises_value_error(self): with pytest.raises(ValueError): _assert_trusted_connection_url("not-a-url", _ENDPOINT) + def test_matching_host_explicit_default_port_does_not_raise(self): + # An explicit ":443" is the wss/https default, so this is the same origin as _ENDPOINT + # (which omits the port) and must be accepted. + _assert_trusted_connection_url("wss://my-account.services.ai.azure.com:443/custom/path", _ENDPOINT) + + def test_mismatched_port_raises_value_error(self): + # Regression test (security fix): comparing hostname alone let an override targeting the + # same host on a different, non-default port (a different origin) slip through and + # receive the live bearer token. + with pytest.raises(ValueError): + _assert_trusted_connection_url("wss://my-account.services.ai.azure.com:8443/steal-token", _ENDPOINT) + class TestRealtimeConnectionManagerEnter: """Unit tests for ``RealtimeConnectionManager.enter()``: URL/header construction and errors.""" diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client_async.py b/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client_async.py index 5ae0fc840d74..7cb186a240bb 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client_async.py @@ -91,13 +91,29 @@ async def test_enter_builds_bearer_auth_and_query(self): assert kwargs["params"]["api-version"] == "v1" assert kwargs["headers"]["Authorization"] == "Bearer fake-token" assert kwargs["headers"]["Foundry-Features"] == "VoiceAgents=V1Preview" - assert kwargs["headers"]["Sec-WebSocket-Protocol"] == "realtime" + assert "Sec-WebSocket-Protocol" not in kwargs["headers"] + assert kwargs["protocols"] == ("realtime",) async def test_enter_rejects_untrusted_connection_url_host(self): manager = _make_manager(connection_url="wss://evil.example.com/steal-token") with pytest.raises(ValueError): await manager.enter() + async def test_enter_overrides_caller_supplied_protocols_kwarg(self): + # Regression test: protocols=("realtime",) is now passed explicitly to ws_connect, so a + # caller-supplied protocols override forwarded through **kwargs would otherwise collide + # ("got multiple values for keyword argument 'protocols'"). The service requires the + # "realtime" subprotocol, so the override is dropped rather than honored. + fake_ws = _make_fake_ws() + patcher, fake_session = _patch_client_session(fake_ws) + with patcher: + manager = _make_manager(protocols=("other",)) + await manager.enter() + await manager.__aexit__() + + _args, kwargs = fake_session.ws_connect.call_args + assert kwargs["protocols"] == ("realtime",) + async def test_enter_rejects_non_wss_url(self): manager = _make_manager(endpoint="ftp://not-http-or-https") with pytest.raises(ValueError): diff --git a/sdk/ai/azure-ai-projects/tests/samples/test_samples.py b/sdk/ai/azure-ai-projects/tests/samples/test_samples.py index ee9d60f80fdd..3ac0ab775617 100644 --- a/sdk/ai/azure-ai-projects/tests/samples/test_samples.py +++ b/sdk/ai/azure-ai-projects/tests/samples/test_samples.py @@ -383,3 +383,39 @@ def test_finetuning_samples(self, sample_path: str, **kwargs) -> None: executor = SyncSampleExecutor(self, sample_path, env_vars=env_vars, **kwargs) executor.execute() executor.validate_print_calls_by_llm() + + @pytest.mark.parametrize( + "sample_path", + get_sample_paths( + "agents/voice", + samples_to_skip=[ + # These use client.realtime, a persistent WebSocket connection. recorded_by_proxy + # only supports the AZURE_CORE/HTTPX2 HTTP(S) transports used elsewhere in this + # file, so a WebSocket session can't be captured/replayed through this mechanism. + "sample_voice_agent_live_text_conversation.py", + "sample_voice_agent_live_text_conversation_async.py", + "sample_voice_agent_live_function_tool.py", + "sample_voice_agent_live_audio_conversation_async.py", + # These read back a conversation transcript/audio from a *pre-existing*, + # already-persisted voice session (FOUNDRY_VOICE_CONVERSATION_ID), which none of + # the runnable samples above create (they all use the skipped WebSocket path to + # do so). Needs a recorded conversation fixture before it can run here. + "sample_voice_agent_read_conversation.py", + "sample_voice_agent_read_conversation_audio.py", + # PR #48484: recording not yet available for these REST-only samples. + "sample_voice_agent_basic.py", + "sample_voice_agent_generate.py", + "sample_voice_agent_versions.py", + "sample_voice_agent_with_tools.py", + ], + ), + ) + @servicePreparer() + @SamplePathPasser() + @recorded_by_proxy(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX2) + def test_voice_samples(self, sample_path: str, **kwargs) -> None: + env_vars = get_sample_env_vars(kwargs) + executor = SyncSampleExecutor(self, sample_path, env_vars=env_vars, **kwargs) + executor.execute() + executor.validate_print_calls_by_llm() + diff --git a/sdk/ai/azure-ai-projects/tests/samples/test_samples_async.py b/sdk/ai/azure-ai-projects/tests/samples/test_samples_async.py index 7fdbe416f0d4..61aea2c6f90e 100644 --- a/sdk/ai/azure-ai-projects/tests/samples/test_samples_async.py +++ b/sdk/ai/azure-ai-projects/tests/samples/test_samples_async.py @@ -312,3 +312,28 @@ async def test_toolboxes_samples(self, sample_path: str, **kwargs) -> None: executor = AsyncSampleExecutor(self, sample_path, env_vars=env_vars, **kwargs) await executor.execute_async() await executor.validate_print_calls_by_llm_async() + + @pytest.mark.parametrize( + "sample_path", + get_async_sample_paths( + "agents/voice", + samples_to_skip=[ + # These use async_client.realtime, a persistent WebSocket connection. + # recorded_by_proxy_async only supports the AZURE_CORE/HTTPX2 HTTP(S) transports + # used elsewhere in this file, so a WebSocket session can't be captured/replayed + # through this mechanism. + "sample_voice_agent_live_text_conversation_async.py", + "sample_voice_agent_live_audio_conversation_async.py", + # PR #48484: recording not yet available for this REST-only sample. + "sample_voice_agent_basic_async.py", + ], + ), + ) + @servicePreparer() + @SamplePathPasser() + @recorded_by_proxy_async(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX2) + async def test_voice_samples(self, sample_path: str, **kwargs) -> None: + env_vars = get_sample_env_vars(kwargs) + executor = AsyncSampleExecutor(self, sample_path, env_vars=env_vars, **kwargs) + await executor.execute_async() + await executor.validate_print_calls_by_llm_async() From b9a2242b5285b80f797baf00efdadfb49f4d0e87 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Thu, 3 Sep 2026 13:06:11 -0700 Subject: [PATCH 47/56] Add voice agent realtime/conversation tests, live-test infra, and SDK identification fix - _realtime.py/aio: add User-Agent + x-ms-client-sdk identification (ports fix from azure-ai-voicelive PR #48848), with case-insensitive header collision guard so a caller-supplied extra_headers User-Agent (any casing) is not duplicated - test_realtime_client(_async).py: add regression tests for identification headers and case-insensitive override behavior - tests/agents/test_voice_agent_realtime_live(_async).py: new live-only tests for voice agent realtime session lifecycle, text-to-audio/transcript turns, and function tool-call round trip - tests/agents/test_voice_agent_conversations(_async).py: new recorded tests for beta.agent_endpoint_conversations REST surface, with a live-only setup step to obtain a sanitized conversation_id for playback - assets.json: pin new recordings via test-proxy push (tag ..._d354d861da) - test-resources.bicep/test-resources-post.ps1/tests.yml: new live-test CI infrastructure (Foundry account/project + gpt-realtime model deployment), following the azure-ai-voicelive package pattern - CHANGELOG.md: document the identification fix under Bugs Fixed Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- sdk/ai/azure-ai-projects/CHANGELOG.md | 1 + sdk/ai/azure-ai-projects/assets.json | 2 +- .../azure/ai/projects/_realtime.py | 19 +- .../azure/ai/projects/aio/_realtime.py | 19 +- .../azure-ai-projects/test-resources-post.ps1 | 183 +++++++++++ sdk/ai/azure-ai-projects/test-resources.bicep | 114 +++++++ sdk/ai/azure-ai-projects/tests.yml | 12 + .../tests/agents/test_realtime_client.py | 48 +++ .../agents/test_realtime_client_async.py | 50 ++- .../agents/test_voice_agent_conversations.py | 247 +++++++++++++++ .../test_voice_agent_conversations_async.py | 242 +++++++++++++++ .../agents/test_voice_agent_realtime_live.py | 285 ++++++++++++++++++ .../test_voice_agent_realtime_live_async.py | 284 +++++++++++++++++ 13 files changed, 1500 insertions(+), 6 deletions(-) create mode 100644 sdk/ai/azure-ai-projects/test-resources-post.ps1 create mode 100644 sdk/ai/azure-ai-projects/test-resources.bicep create mode 100644 sdk/ai/azure-ai-projects/tests.yml create mode 100644 sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_conversations.py create mode 100644 sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_conversations_async.py create mode 100644 sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_realtime_live.py create mode 100644 sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_realtime_live_async.py diff --git a/sdk/ai/azure-ai-projects/CHANGELOG.md b/sdk/ai/azure-ai-projects/CHANGELOG.md index 5f1801443f02..119f6f7d61df 100644 --- a/sdk/ai/azure-ai-projects/CHANGELOG.md +++ b/sdk/ai/azure-ai-projects/CHANGELOG.md @@ -34,6 +34,7 @@ ### Bugs Fixed +* The hand-written `client.realtime`/`async_client.realtime` WebSocket clients now identify themselves to the service the same way the generated HTTP surface already does: a standard Azure SDK `User-Agent` header (for example `azsdk-python-ai-projects/2.6.0 ...`) and an `x-ms-client-sdk` query parameter carrying the same value, for paths where the header isn't forwarded. Previously these connections fell back to the underlying `websockets`/`aiohttp` library's generic default, preventing service telemetry from attributing this traffic to the SDK. A caller-supplied `User-Agent` in `extra_headers` still takes precedence. ### Sample updates diff --git a/sdk/ai/azure-ai-projects/assets.json b/sdk/ai/azure-ai-projects/assets.json index 40aa879ee385..53185df2c5ef 100644 --- a/sdk/ai/azure-ai-projects/assets.json +++ b/sdk/ai/azure-ai-projects/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "python", "TagPrefix": "python/ai/azure-ai-projects", - "Tag": "python/ai/azure-ai-projects_111cb1312b" + "Tag": "python/ai/azure-ai-projects_d354d861da" } diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py index 1b11c34fa7af..657aa0ffbbb8 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py @@ -36,13 +36,22 @@ from . import models as _models from .models._enums import _AgentDefinitionOptInKeys -from .models._patch import _FOUNDRY_FEATURES_HEADER_NAME +from .models._patch import _FOUNDRY_FEATURES_HEADER_NAME, _has_header_case_insensitive from ._utils.model_base import Model as _Model, SdkJSONEncoder +from ._version import VERSION + +from azure.core.pipeline.policies import UserAgentPolicy # Scoped to just the voice-agent preview opt-in; callers connecting to other preview agent # kinds through this same route can pass a broader value explicitly via ``foundry_features``. _VOICE_AGENT_FEATURE_HEADER: str = _AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.value +# Identifies the SDK to the service on the WebSocket handshake, which otherwise falls back to +# the underlying `websockets` library's generic default (the generated HTTP surface gets this +# for free from the pipeline's own UserAgentPolicy; this hand-written client builds its own +# request instead, so it needs to opt in explicitly the same way). +_USER_AGENT: str = UserAgentPolicy(sdk_moniker=f"ai-projects/{VERSION}").user_agent + if TYPE_CHECKING: from websockets.sync.client import ClientConnection from azure.core.credentials import TokenCredential @@ -708,7 +717,7 @@ def enter(self) -> RealtimeConnection: # pylint: disable=too-many-locals if not url.startswith("wss://"): raise ValueError("The realtime WebSocket URL must use wss:// to protect credentials in transit.") - params: Dict[str, str] = {"api-version": self._api_version} + params: Dict[str, str] = {"api-version": self._api_version, "x-ms-client-sdk": _USER_AGENT} if self._agent_session_id is not None: params["agent_session_id"] = self._agent_session_id if self._agent_version_override is not None: @@ -731,6 +740,12 @@ def enter(self) -> RealtimeConnection: # pylint: disable=too-many-locals if self._structured_inputs is not None: headers["x-ms-voice-structured-inputs"] = self._structured_inputs headers.update(self._extra_headers) + if not _has_header_case_insensitive(headers, "User-Agent"): + # Only set our default if the caller didn't supply their own (in any casing) -- + # a plain dict merge would otherwise leave both as separate keys (HTTP header names + # are case-insensitive, but Python dict keys are not), sending two User-Agent-like + # headers instead of cleanly honoring the caller's override. + headers["User-Agent"] = _USER_AGENT try: connection = _ws_connect( diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py index a0de3291b620..dcea1132377e 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py @@ -50,13 +50,22 @@ from .. import models as _models from ..models._enums import _AgentDefinitionOptInKeys -from ..models._patch import _FOUNDRY_FEATURES_HEADER_NAME +from ..models._patch import _FOUNDRY_FEATURES_HEADER_NAME, _has_header_case_insensitive from .._utils.model_base import Model as _Model, SdkJSONEncoder +from .._version import VERSION + +from azure.core.pipeline.policies import UserAgentPolicy # Scoped to just the voice-agent preview opt-in; callers connecting to other preview agent # kinds through this same route can pass a broader value explicitly via ``foundry_features``. _VOICE_AGENT_FEATURE_HEADER: str = _AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.value +# Identifies the SDK to the service on the WebSocket handshake, which otherwise falls back to +# the underlying `aiohttp` library's generic default (the generated HTTP surface gets this for +# free from the pipeline's own UserAgentPolicy; this hand-written client builds its own request +# instead, so it needs to opt in explicitly the same way). +_USER_AGENT: str = UserAgentPolicy(sdk_moniker=f"ai-projects/{VERSION}").user_agent + if TYPE_CHECKING: from aiohttp import ClientSession, ClientWebSocketResponse from azure.core.credentials_async import AsyncTokenCredential @@ -724,7 +733,7 @@ async def enter(self) -> AsyncRealtimeConnection: # pylint: disable=too-many-lo if not url.startswith("wss://"): raise ValueError("The realtime WebSocket URL must use wss:// to protect credentials in transit.") - params: Dict[str, str] = {"api-version": self._api_version} + params: Dict[str, str] = {"api-version": self._api_version, "x-ms-client-sdk": _USER_AGENT} if self._agent_session_id is not None: params["agent_session_id"] = self._agent_session_id if self._agent_version_override is not None: @@ -739,6 +748,12 @@ async def enter(self) -> AsyncRealtimeConnection: # pylint: disable=too-many-lo if self._structured_inputs is not None: headers["x-ms-voice-structured-inputs"] = self._structured_inputs headers.update(self._extra_headers) + if not _has_header_case_insensitive(headers, "User-Agent"): + # Only set our default if the caller didn't supply their own (in any casing) -- + # a plain dict merge would otherwise leave both as separate keys (HTTP header names + # are case-insensitive, but Python dict keys are not), sending two User-Agent-like + # headers instead of cleanly honoring the caller's override. + headers["User-Agent"] = _USER_AGENT session = aiohttp.ClientSession() try: diff --git a/sdk/ai/azure-ai-projects/test-resources-post.ps1 b/sdk/ai/azure-ai-projects/test-resources-post.ps1 new file mode 100644 index 000000000000..ed35fb95c759 --- /dev/null +++ b/sdk/ai/azure-ai-projects/test-resources-post.ps1 @@ -0,0 +1,183 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +# This script deploys the gpt-realtime model to the Foundry account created by +# test-resources.bicep. It is invoked by the New-TestResources.ps1 script after the Bicep +# template finishes deploying. Model deployments are not expressed directly in the Bicep +# template because they can take several minutes and benefit from retry/wait logic that's +# awkward to express declaratively -- this mirrors the approach used by +# sdk/contentunderstanding/test-resources-post.ps1. +# +# SCOPE NOTE: This only deploys the realtime model needed by the voice-agent live tests +# (tests/agents/test_voice_agent_realtime_live*.py, test_voice_agent_conversations*.py). It does +# not provision anything for this package's broader (already-recorded, cassette-based) test +# suite. + +param ( + [hashtable] $DeploymentOutputs, + [string] $ResourceGroupName +) + +$accountName = $DeploymentOutputs['FOUNDRY_VOICE_TEST_ACCOUNT_NAME'] +$resourceGroup = $DeploymentOutputs['FOUNDRY_VOICE_TEST_RESOURCE_GROUP_NAME'] +$deploymentName = $DeploymentOutputs['FOUNDRY_VOICE_MODEL_NAME'] + +if (-not $accountName) { + Write-Error "FOUNDRY_VOICE_TEST_ACCOUNT_NAME (Foundry account name) not found in deployment outputs" + exit 1 +} + +if (-not $deploymentName) { + Write-Error "FOUNDRY_VOICE_MODEL_NAME (model deployment name) not found in deployment outputs" + exit 1 +} + +if (-not $resourceGroup) { + # Fall back to the resource group New-TestResources.ps1 is already operating in. + $resourceGroup = $ResourceGroupName +} + +Write-Host "Deploying model 'gpt-realtime' as deployment '$deploymentName' to account '$accountName' in resource group '$resourceGroup'..." + +# NOTE: the exact model version below is a best-effort default and may need to be updated -- +# gpt-realtime is a preview model with restricted regional/quota availability, and no other +# package in this repo currently automates its deployment (verified: no existing +# test-resources-post.ps1 anywhere deploys "gpt-realtime"). If this fails with a "model not +# found" or capacity error, check current availability with: +# az cognitiveservices account list-models --resource-group --name --output table +# and adjust -ModelVersion/-SkuCapacity/the Bicep template's location parameter accordingly. +$modelVersion = '2025-08-28' +$skuName = 'GlobalStandard' +$skuCapacity = 1 + +function Deploy-Model { + param ( + [string] $ResourceGroupName, + [string] $AccountName, + [string] $DeploymentName, + [string] $ModelName, + [string] $ModelVersion, + [string] $SkuName, + [int] $SkuCapacity + ) + + Write-Host "Checking for an existing deployment named '$DeploymentName'..." + $null = az cognitiveservices account deployment show ` + --resource-group $ResourceGroupName ` + --name $AccountName ` + --deployment-name $DeploymentName ` + 2>&1 + + if ($LASTEXITCODE -eq 0) { + Write-Host "Deployment '$DeploymentName' already exists, skipping creation." + return $true + } + + $azArgs = @( + 'cognitiveservices', 'account', 'deployment', 'create', + '--resource-group', $ResourceGroupName, + '--name', $AccountName, + '--deployment-name', $DeploymentName, + '--model-format', 'OpenAI', + '--model-name', $ModelName, + '--model-version', $ModelVersion, + '--output', 'json' + ) + if ($SkuName) { + $azArgs += '--sku-name', $SkuName + } + if ($SkuCapacity -gt 0) { + $azArgs += '--sku-capacity', $SkuCapacity.ToString() + } + + try { + $deploymentJson = & az $azArgs 2>&1 + if ($LASTEXITCODE -eq 0) { + $deployment = $deploymentJson | ConvertFrom-Json + Write-Host "Successfully created deployment '$DeploymentName' (status: $($deployment.properties.provisioningState))" -ForegroundColor Green + return $true + } + Write-Error "FAILED to deploy '$DeploymentName': $deploymentJson" -ErrorAction Continue + return $false + } + catch { + Write-Error "FAILED to deploy '$DeploymentName': $_" -ErrorAction Continue + return $false + } +} + +function Wait-ForDeployment { + param ( + [string] $ResourceGroupName, + [string] $AccountName, + [string] $DeploymentName, + [int] $MaxWaitMinutes = 15, + [int] $PollIntervalSeconds = 30 + ) + + Write-Host "Waiting for deployment '$DeploymentName' to be ready..." + $startTime = Get-Date + $maxWaitTime = $startTime.AddMinutes($MaxWaitMinutes) + + while ((Get-Date) -lt $maxWaitTime) { + try { + $deploymentJson = az cognitiveservices account deployment show ` + --resource-group $ResourceGroupName ` + --name $AccountName ` + --deployment-name $DeploymentName ` + --output json 2>&1 + + if ($LASTEXITCODE -eq 0) { + $deployment = $deploymentJson | ConvertFrom-Json + $provisioningState = $deployment.properties.provisioningState + + if ($provisioningState -eq 'Succeeded') { + Write-Host "Deployment '$DeploymentName' is ready (status: $provisioningState)" -ForegroundColor Green + return $true + } + if ($provisioningState -eq 'Failed') { + Write-Error "Deployment '$DeploymentName' failed" -ErrorAction Continue + return $false + } + Write-Host "Deployment '$DeploymentName' status: $provisioningState (waiting...)" + } + else { + Write-Host "Could not check deployment status, will retry..." + } + } + catch { + Write-Host "Error checking deployment status: $_, will retry..." + } + + Start-Sleep -Seconds $PollIntervalSeconds + } + + Write-Warning "Timeout waiting for deployment '$DeploymentName' to be ready after $MaxWaitMinutes minutes" + return $false +} + +$deployed = Deploy-Model ` + -ResourceGroupName $resourceGroup ` + -AccountName $accountName ` + -DeploymentName $deploymentName ` + -ModelName 'gpt-realtime' ` + -ModelVersion $modelVersion ` + -SkuName $skuName ` + -SkuCapacity $skuCapacity + +if ($deployed) { + $ready = Wait-ForDeployment ` + -ResourceGroupName $resourceGroup ` + -AccountName $accountName ` + -DeploymentName $deploymentName ` + -MaxWaitMinutes 15 ` + -PollIntervalSeconds 30 + + if (-not $ready) { + Write-Warning "The '$deploymentName' deployment did not finish provisioning in time. Live voice-agent tests may fail until it finishes." + } +} +else { + Write-Error "Could not create the '$deploymentName' model deployment. Live voice-agent tests will fail." -ErrorAction Continue + exit 1 +} diff --git a/sdk/ai/azure-ai-projects/test-resources.bicep b/sdk/ai/azure-ai-projects/test-resources.bicep new file mode 100644 index 000000000000..80d890a85b98 --- /dev/null +++ b/sdk/ai/azure-ai-projects/test-resources.bicep @@ -0,0 +1,114 @@ +// ============================================================================ +// Azure AI Projects SDK Test Resources -- Voice Agent Live-Test Support +// ============================================================================ +// This Bicep template provisions the Azure resources needed to run the +// live-only voice-agent realtime tests (tests/agents/test_voice_agent_realtime_live*.py) +// and to record/re-record the voice-agent conversation-read cassette +// (tests/agents/test_voice_agent_conversations*.py) against a real service. +// +// SCOPE NOTE: This intentionally covers only the voice-agent test surface, not +// the package's full recorded-test suite (datasets, evaluations, fine-tuning, +// memory search, etc.), which already runs entirely from committed cassettes +// and does not need a live resource. Provisioning a resource for that broader +// surface (additional model deployments, storage, connections, ...) is a +// separate, larger effort. +// +// Resources created: +// 1. Microsoft Foundry account (Microsoft.CognitiveServices/accounts, kind +// AIServices, SKU S0) with a nested Foundry project. +// 2. Role assignment granting the test application the "Azure AI User" role +// (matches the role this package's own samples/hosted_agents/rbac_util.py +// uses for agent operations) -- authentication is Entra ID via +// DefaultAzureCredential, no API keys. +// 3. A `gpt-realtime` model deployment, created separately by +// test-resources-post.ps1 (deployments can take several minutes and this +// lets the script retry/wait, which is awkward to express in Bicep). +// +// Outputs (become environment variables read by EnvironmentVariableLoader): +// - FOUNDRY_PROJECT_ENDPOINT: the Foundry project endpoint, in the +// `https://.services.ai.azure.com/api/projects/` form +// these tests expect (see .env.template). +// - FOUNDRY_VOICE_MODEL_NAME: the realtime model deployment name +// (`gpt-realtime`), matching what test-resources-post.ps1 deploys. +// ============================================================================ + +@description('The client OID to grant access to test resources.') +param testApplicationOid string + +@minLength(6) +@maxLength(50) +@description('The base resource name.') +param baseName string = resourceGroup().name + +@description('The location of the resource. By default, this is the same as the resource group. gpt-realtime has restricted regional availability -- override this if the default region does not support it.') +param location string = resourceGroup().location + +// Role definition ID for "Azure AI User" -- matches +// sdk/ai/azure-ai-projects/samples/hosted_agents/rbac_util.py's +// AZURE_AI_USER_ROLE_DEFINITION_GUID, the role this package's own samples use +// to grant an identity access to run agent operations against a Foundry +// project. +var azureAiUserRoleId = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '53ca6127-db72-4b80-b1b0-d745d6d5456d') + +// Resource names +var foundryAccountName = '${baseName}-voice-foundry' +var foundryProjectName = toLower(foundryAccountName) + +// The Foundry account. `defaultProjectName`/the nested `projects` sub-resource +// below follow the same shape used by sdk/voicelive's test-resources.json. +resource foundryAccount 'Microsoft.CognitiveServices/accounts@2025-04-01-preview' = { + name: foundryAccountName + location: location + kind: 'AIServices' + sku: { + name: 'S0' + } + identity: { + type: 'SystemAssigned' + } + properties: { + customSubDomainName: toLower(foundryAccountName) + publicNetworkAccess: 'Enabled' + allowProjectManagement: true + } +} + +resource foundryProject 'Microsoft.CognitiveServices/accounts/projects@2025-04-01-preview' = { + parent: foundryAccount + name: foundryProjectName + location: location + identity: { + type: 'SystemAssigned' + } + properties: { + displayName: foundryProjectName + description: 'Voice agent live-test project for azure-ai-projects' + } +} + +// Grants the test application access to run agent/voice-agent operations. +// principalType is omitted so Azure can infer it (works for both a user and a +// service principal), matching the pattern used in +// sdk/contentunderstanding/test-resources.bicep. +resource testAppRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = { + name: guid(resourceGroup().id, foundryAccount.id, azureAiUserRoleId) + scope: foundryAccount + properties: { + roleDefinitionId: azureAiUserRoleId + principalId: testApplicationOid + } +} + +// The gpt-realtime model deployment is created by test-resources-post.ps1 +// after this template finishes deploying (see that script for why: model +// deployments can take several minutes and need retry/wait logic that's +// awkward to express here, following the same approach as +// sdk/contentunderstanding/test-resources.bicep). + +output FOUNDRY_PROJECT_ENDPOINT string = 'https://${toLower(foundryAccountName)}.services.ai.azure.com/api/projects/${foundryProjectName}' +output FOUNDRY_VOICE_MODEL_NAME string = 'gpt-realtime' + +// Additional outputs consumed by test-resources-post.ps1 to locate the +// account when deploying the model. +output FOUNDRY_VOICE_TEST_ACCOUNT_NAME string = foundryAccountName +output FOUNDRY_VOICE_TEST_RESOURCE_GROUP_NAME string = resourceGroup().name diff --git a/sdk/ai/azure-ai-projects/tests.yml b/sdk/ai/azure-ai-projects/tests.yml new file mode 100644 index 000000000000..6bd82ae6c75a --- /dev/null +++ b/sdk/ai/azure-ai-projects/tests.yml @@ -0,0 +1,12 @@ +trigger: none + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml + parameters: + BuildTargetingString: 'azure-ai-projects' + ServiceDirectory: ai + TestResourceDirectories: + - ai/azure-ai-projects + EnvVars: + AZURE_TEST_RUN_LIVE: 'true' + AZURE_TEST_USE_CLI_AUTH: 'true' 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 02e2dc12a42c..2a4ff4b69248 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 @@ -14,6 +14,7 @@ import json from unittest.mock import MagicMock, patch +from urllib.parse import parse_qs, urlparse import pytest from azure.core.credentials import AccessToken @@ -22,7 +23,9 @@ RealtimeConnectionManager, _assert_trusted_connection_url, _to_ws_url, + _USER_AGENT, ) +from azure.ai.projects._version import VERSION from azure.ai.projects.models import ( RealtimeClientEventResponseCreate, RealtimeServerEventSessionCreated, @@ -129,6 +132,51 @@ def test_enter_builds_bearer_auth_and_query(self): assert kwargs["additional_headers"]["Authorization"] == "Bearer fake-token" assert kwargs["additional_headers"]["Foundry-Features"] == "VoiceAgents=V1Preview" + def test_enter_identifies_sdk_via_user_agent_and_query(self): + # The generated HTTP surface gets SDK identification for free from the core pipeline's + # UserAgentPolicy; this hand-written client builds its own request and must opt in + # explicitly, both as a User-Agent header and (since some proxies/paths don't forward + # WebSocket upgrade headers) as an x-ms-client-sdk query parameter. + fake_connection = MagicMock() + with patch("websockets.sync.client.connect", return_value=fake_connection) as mock_connect: + manager = _make_manager() + manager.enter() + manager.__exit__() + + _args, kwargs = mock_connect.call_args + assert kwargs["additional_headers"]["User-Agent"] == _USER_AGENT + assert "azsdk-python-ai-projects" in _USER_AGENT + assert VERSION in _USER_AGENT + + query = parse_qs(urlparse(_args[0]).query) + assert query["x-ms-client-sdk"] == [_USER_AGENT] + + def test_enter_caller_user_agent_overrides_default(self): + fake_connection = MagicMock() + with patch("websockets.sync.client.connect", return_value=fake_connection) as mock_connect: + manager = _make_manager(extra_headers={"User-Agent": "custom-user-agent"}) + manager.enter() + manager.__exit__() + + _args, kwargs = mock_connect.call_args + assert kwargs["additional_headers"]["User-Agent"] == "custom-user-agent" + + def test_enter_caller_user_agent_overrides_default_case_insensitive(self): + # Regression test: a plain dict merge of extra_headers would leave a differently-cased + # caller override (e.g. "user-agent") as a *separate* key alongside our own "User-Agent" + # default, since Python dict keys are case-sensitive but HTTP header names are not -- + # sending two User-Agent-like headers instead of cleanly honoring the caller's override. + fake_connection = MagicMock() + with patch("websockets.sync.client.connect", return_value=fake_connection) as mock_connect: + manager = _make_manager(extra_headers={"user-agent": "custom-user-agent"}) + manager.enter() + manager.__exit__() + + _args, kwargs = mock_connect.call_args + headers = kwargs["additional_headers"] + assert "User-Agent" not in headers + assert headers["user-agent"] == "custom-user-agent" + def test_enter_appends_extra_query_and_headers(self): fake_connection = MagicMock() with patch("websockets.sync.client.connect", return_value=fake_connection) as mock_connect: diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client_async.py b/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client_async.py index 7cb186a240bb..95413ee07612 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client_async.py @@ -14,11 +14,13 @@ import json from unittest.mock import AsyncMock, MagicMock, patch +from urllib.parse import parse_qs, urlparse import pytest from azure.core.credentials import AccessToken -from azure.ai.projects.aio._realtime import AsyncRealtimeConnectionManager +from azure.ai.projects.aio._realtime import AsyncRealtimeConnectionManager, _USER_AGENT +from azure.ai.projects._version import VERSION from azure.ai.projects.models import ( RealtimeClientEventResponseCreate, RealtimeServerEventSessionCreated, @@ -94,6 +96,52 @@ async def test_enter_builds_bearer_auth_and_query(self): assert "Sec-WebSocket-Protocol" not in kwargs["headers"] assert kwargs["protocols"] == ("realtime",) + async def test_enter_identifies_sdk_via_user_agent_and_query(self): + # The generated HTTP surface gets SDK identification for free from the core pipeline's + # UserAgentPolicy; this hand-written client builds its own request and must opt in + # explicitly, both as a User-Agent header and (since some proxies/paths don't forward + # WebSocket upgrade headers) as an x-ms-client-sdk query parameter. + fake_ws = _make_fake_ws() + patcher, fake_session = _patch_client_session(fake_ws) + with patcher: + manager = _make_manager() + await manager.enter() + await manager.__aexit__() + + _args, kwargs = fake_session.ws_connect.call_args + assert kwargs["headers"]["User-Agent"] == _USER_AGENT + assert "azsdk-python-ai-projects" in _USER_AGENT + assert VERSION in _USER_AGENT + assert kwargs["params"]["x-ms-client-sdk"] == _USER_AGENT + + async def test_enter_caller_user_agent_overrides_default(self): + fake_ws = _make_fake_ws() + patcher, fake_session = _patch_client_session(fake_ws) + with patcher: + manager = _make_manager(extra_headers={"User-Agent": "custom-user-agent"}) + await manager.enter() + await manager.__aexit__() + + _args, kwargs = fake_session.ws_connect.call_args + assert kwargs["headers"]["User-Agent"] == "custom-user-agent" + + async def test_enter_caller_user_agent_overrides_default_case_insensitive(self): + # Regression test: a plain dict merge of extra_headers would leave a differently-cased + # caller override (e.g. "user-agent") as a *separate* key alongside our own "User-Agent" + # default, since Python dict keys are case-sensitive but HTTP header names are not -- + # sending two User-Agent-like headers instead of cleanly honoring the caller's override. + fake_ws = _make_fake_ws() + patcher, fake_session = _patch_client_session(fake_ws) + with patcher: + manager = _make_manager(extra_headers={"user-agent": "custom-user-agent"}) + await manager.enter() + await manager.__aexit__() + + _args, kwargs = fake_session.ws_connect.call_args + headers = kwargs["headers"] + assert "User-Agent" not in headers + assert headers["user-agent"] == "custom-user-agent" + async def test_enter_rejects_untrusted_connection_url_host(self): manager = _make_manager(connection_url="wss://evil.example.com/steal-token") with pytest.raises(ValueError): diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_conversations.py b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_conversations.py new file mode 100644 index 000000000000..b19742c76db7 --- /dev/null +++ b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_conversations.py @@ -0,0 +1,247 @@ +# pylint: disable=too-many-lines,line-too-long,useless-suppression,too-many-statements,broad-exception-caught +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +# cSpell:disable + +""" +Recorded tests covering the read-only voice-agent conversation REST API surface exposed through +``project_client.beta.agent_endpoint_conversations``. + +Conversations, their responses/items, and audio are written by the realtime WebSocket subsystem +during a live session (see ``test_voice_agent_realtime_live.py``) and can only be *read* here -- +there is no REST way to create one. A real ``conversation_id`` can therefore only be obtained by +actually running a live session, which is not itself something the test proxy can capture or +replay (it is a raw WebSocket connection, not an HTTP call through the SDK pipeline). + +To get real recorded/replayable coverage of the REST read-back surface anyway, this test: + * When run live (``AZURE_TEST_RUN_LIVE=true``): creates a `store=True` voice agent, opens a + short-lived realtime session directly (bypassing the recorded pipeline, same as any other + live network call), sends one turn, and waits for the resulting conversation to finalize. + The dynamic conversation id is then sanitized to a fixed placeholder before any of the + REST calls below are made, so what gets written to the recording cassette is stable. + * When replayed from the recording (the normal case in CI): skips the live session entirely + and uses the same fixed placeholder conversation id the cassette already expects. +Either way, the REST calls themselves (list/get conversation, responses, items, audio) go +through ``recorded_by_proxy`` exactly like any other recorded test in this package. +""" + +import re +import time +from typing import Final, Optional + +from test_base import TestBase, servicePreparer +from devtools_testutils import recorded_by_proxy, is_live, add_general_regex_sanitizer +from azure.core.exceptions import HttpResponseError +from azure.ai.projects.models import ( + RealtimeConversationItemMessageUser, + RealtimeConversationItemMessageUserContent, + RealtimeConversationItemType, + RealtimeServerEventResponseDone, + RealtimeServerEventSessionCreated, + VoiceAgentAudioConfig, + VoiceAgentAudioOutputConfig, + VoiceAgentDefinition, + VoiceModelType, + VoiceOutputModality, +) + +# Fixed test-owned agent name: unlike conversation_id (server-generated, truly dynamic), this is +# our own choice and does not need is_live()/sanitizer handling -- it is identical in both modes. +_AGENT_NAME: Final = "test-conversations-read-agent" + +# Best-effort fixed wait (live only, seconds) after the realtime session ends, before reading the +# conversation back, so persistence finalization (items/audio) is more likely to have completed. +# This must be a single, fixed wait rather than a poll loop through the recorded client: repeated +# polling would record multiple cassette entries for the same "get conversation" request, but +# playback only ever issues that request once (polling itself is live-only), so a replay would +# incorrectly consume the *first* (possibly still "in_progress") recorded entry instead of the +# settled one. A single wait keeps exactly one logical call -- and therefore one cassette entry +# -- for both the live recording and the replay to agree on. +_FINALIZATION_WAIT_SECONDS: Final = 30 + + +def _create_live_conversation(project_client, model: str) -> str: + """Create a `store=True` voice agent, hold one turn over a live realtime session, and + return the resulting conversation id. Only ever called when ``is_live()``. + + :param project_client: The Foundry project client. + :param model: The realtime model deployment name. + :type project_client: ~azure.ai.projects.AIProjectClient + :type model: str + :return: The persisted conversation id. + :rtype: str + """ + try: + project_client.agents.delete(agent_name=_AGENT_NAME) + except Exception: # pylint: disable=broad-except + pass + + project_client.agents.create_version( + agent_name=_AGENT_NAME, + definition=VoiceAgentDefinition( + model_type=VoiceModelType.MANAGED, + model=model, + instructions="You are a helpful voice assistant. Keep replies short.", + audio=VoiceAgentAudioConfig( + output=VoiceAgentAudioOutputConfig(voice="en-US-AvaNeural", voice_type="azure-standard") + ), + output_modalities=[VoiceOutputModality.AUDIO], + store=True, + ), + ) + + conversation_id: Optional[str] = None + with project_client.realtime.connect(agent_name=_AGENT_NAME) as conn: + session_created = conn.recv(timeout=30) + assert isinstance(session_created, RealtimeServerEventSessionCreated) + conversation_id = session_created.conversation_id + + conn.conversation.item.create( + item=RealtimeConversationItemMessageUser( + type=RealtimeConversationItemType.MESSAGE, + content=[RealtimeConversationItemMessageUserContent(type="input_text", text="Say hello.")], + ) + ) + conn.response.create() + + deadline = time.monotonic() + 45 + while time.monotonic() < deadline: + event = conn.recv(timeout=30) + if isinstance(event, RealtimeServerEventResponseDone): + break + + assert conversation_id is not None, "Expected session.created to carry a conversation_id (store=True)" + time.sleep(_FINALIZATION_WAIT_SECONDS) + return conversation_id + + +class TestVoiceAgentConversations(TestBase): + """ + Recorded tests covering the read-only voice-agent conversation REST API surface exposed + through ``project_client.beta.agent_endpoint_conversations`` (conversation envelope, + responses, items, and audio). + + NOTE: The top-level (non-beta) ``agent_endpoint_conversations.get_agent_conversation_item_ + generated_audio*`` methods are intentionally NOT covered here: they return the played-back- + interrupted subordinate "generated" audio, which requires deliberately barging in mid-reply + during a live session to produce -- not exercised by the simple single-turn conversation + created here. See this package's engineering notes. + """ + + # To run only this test: + # pytest tests\agents\test_voice_agent_conversations.py::TestVoiceAgentConversations::test_read_conversation -s + @servicePreparer() + @recorded_by_proxy() + def test_read_conversation(self, **kwargs): # pylint: disable=too-many-locals + """ + Test reading back a persisted voice-agent conversation: the envelope, its responses + (with per-response output items), its ordered items (the transcript), the merged + whole-call audio recording, a single item's audio, and finally deleting the conversation. + + Routes used in this test: + + Action REST API Route Client Method + ------+-------------------------------------------------------------------------------+----------------------------------------------------------- + GET /agents/{agent_name}/endpoint/protocols/voice/conversations beta.agent_endpoint_conversations.list_agent_conversations() + GET /agents/{agent_name}/endpoint/protocols/voice/conversations/{id} beta.agent_endpoint_conversations.get_agent_conversation() + GET .../conversations/{id}/responses beta.agent_endpoint_conversations.list_agent_conversation_responses() + GET .../conversations/{id}/responses/{response_id} beta.agent_endpoint_conversations.get_agent_conversation_response() + GET .../conversations/{id}/responses/{response_id}/items beta.agent_endpoint_conversations.list_agent_conversation_response_items() + GET .../conversations/{id}/items beta.agent_endpoint_conversations.list_agent_conversation_items() + GET .../conversations/{id}/items/{item_id} beta.agent_endpoint_conversations.get_agent_conversation_item() + GET .../conversations/{id}/audio beta.agent_endpoint_conversations.get_agent_conversation_audio() + GET .../conversations/{id}/audio/content beta.agent_endpoint_conversations.get_agent_conversation_audio_content() + GET .../conversations/{id}/items/{item_id}/audio beta.agent_endpoint_conversations.get_agent_conversation_item_audio() + GET .../conversations/{id}/items/{item_id}/audio/content beta.agent_endpoint_conversations.get_agent_conversation_item_audio_content() + DELETE .../conversations/{id} beta.agent_endpoint_conversations.delete_agent_conversation() + """ + print("\n") + project_client = self.create_client(operation_group="agents", allow_preview=True, **kwargs) + conversations = project_client.beta.agent_endpoint_conversations + + if is_live(): + model = kwargs.get("foundry_voice_model_name") + assert model is not None + conversation_id = _create_live_conversation(project_client, model) + add_general_regex_sanitizer( + regex=re.escape(conversation_id), value="sanitized-conversation-id", function_scoped=True + ) + else: + conversation_id = "sanitized-conversation-id" + + try: + # The conversation should appear in the agent's conversation list. + found = any(c.id == conversation_id for c in conversations.list_agent_conversations(_AGENT_NAME)) + assert found, "Expected the new conversation to appear in list_agent_conversations" + + # The conversation envelope. + conversation = conversations.get_agent_conversation(_AGENT_NAME, conversation_id) + assert conversation.id == conversation_id + assert conversation.status in ("in_progress", "completed", "failed") + assert conversation.created_at is not None + + # The responses (model inference turns) in the conversation. + responses = list(conversations.list_agent_conversation_responses(_AGENT_NAME, conversation_id)) + assert len(responses) >= 1 + first_response = responses[0] + response_detail = conversations.get_agent_conversation_response( + _AGENT_NAME, conversation_id, first_response.id + ) + assert response_detail.id == first_response.id + + # The items produced by that response (does not raise; count may be 0 or more). + list( + conversations.list_agent_conversation_response_items( + _AGENT_NAME, conversation_id, first_response.id + ) + ) + + # The ordered conversation items -- the full transcript (user + assistant + tool events). + items = list(conversations.list_agent_conversation_items(_AGENT_NAME, conversation_id)) + assert len(items) >= 1 + first_item_id = items[0].get("id") + assert first_item_id + fetched_item = conversations.get_agent_conversation_item(_AGENT_NAME, conversation_id, first_item_id) + assert fetched_item.get("id") == first_item_id + + # The merged whole-call recording, if the session had time to finalize. + if str(conversation.status) == "completed" or conversation.status == "completed": + recording = conversations.get_agent_conversation_audio(_AGENT_NAME, conversation_id) + assert recording.format is not None + if not recording.blob_uri: + audio_bytes = b"".join( + conversations.get_agent_conversation_audio_content(_AGENT_NAME, conversation_id) + ) + assert len(audio_bytes) > 0 + + # A single item's audio, if any item has one. + for item in items: + item_id = item.get("id") + if not item_id: + continue + try: + item_audio = conversations.get_agent_conversation_item_audio( + _AGENT_NAME, conversation_id, item_id + ) + except HttpResponseError as e: + if e.status_code == 404: + continue + raise + assert item_audio.role is not None + if not item_audio.blob_uri: + item_audio_bytes = b"".join( + conversations.get_agent_conversation_item_audio_content( + _AGENT_NAME, conversation_id, item_id + ) + ) + assert len(item_audio_bytes) > 0 + break + else: + print(f"Conversation did not finalize in time (status={conversation.status}); skipping audio checks.") + finally: + # Deleting a conversation removes it and all of its responses, items, and audio. + conversations.delete_agent_conversation(_AGENT_NAME, conversation_id) + if is_live(): + project_client.agents.delete(agent_name=_AGENT_NAME) diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_conversations_async.py b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_conversations_async.py new file mode 100644 index 000000000000..f036ac5ba61b --- /dev/null +++ b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_conversations_async.py @@ -0,0 +1,242 @@ +# pylint: disable=too-many-lines,line-too-long,useless-suppression,too-many-statements,broad-exception-caught +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +# cSpell:disable + +""" +Recorded tests covering the read-only voice-agent conversation REST API surface exposed through +``project_client.beta.agent_endpoint_conversations`` (async client). + +Async counterpart of ``test_voice_agent_conversations.py``. See that module's docstring for the +overall rationale (live-only setup to obtain a real conversation id, sanitized to a fixed +placeholder so the recorded REST calls that follow can be replayed). +""" + +import re +import asyncio +import time +from typing import Final, Optional + +from test_base import TestBase, servicePreparer +from devtools_testutils import is_live, add_general_regex_sanitizer +from devtools_testutils.aio import recorded_by_proxy_async +from azure.core.exceptions import HttpResponseError +from azure.ai.projects.models import ( + RealtimeConversationItemMessageUser, + RealtimeConversationItemMessageUserContent, + RealtimeConversationItemType, + RealtimeServerEventResponseDone, + RealtimeServerEventSessionCreated, + VoiceAgentAudioConfig, + VoiceAgentAudioOutputConfig, + VoiceAgentDefinition, + VoiceModelType, + VoiceOutputModality, +) + +# Fixed test-owned agent name: unlike conversation_id (server-generated, truly dynamic), this is +# our own choice and does not need is_live()/sanitizer handling -- it is identical in both modes. +_AGENT_NAME: Final = "test-conversations-read-agent-async" + +# Best-effort fixed wait (live only, seconds) after the realtime session ends, before reading the +# conversation back, so persistence finalization (items/audio) is more likely to have completed. +# This must be a single, fixed wait rather than a poll loop through the recorded client: repeated +# polling would record multiple cassette entries for the same "get conversation" request, but +# playback only ever issues that request once (polling itself is live-only), so a replay would +# incorrectly consume the *first* (possibly still "in_progress") recorded entry instead of the +# settled one. A single wait keeps exactly one logical call -- and therefore one cassette entry +# -- for both the live recording and the replay to agree on. +_FINALIZATION_WAIT_SECONDS: Final = 30 + + +async def _create_live_conversation(project_client, model: str) -> str: + """Create a `store=True` voice agent, hold one turn over a live realtime session, and + return the resulting conversation id. Only ever called when ``is_live()``. + + :param project_client: The Foundry project client. + :param model: The realtime model deployment name. + :type project_client: ~azure.ai.projects.aio.AIProjectClient + :type model: str + :return: The persisted conversation id. + :rtype: str + """ + try: + await project_client.agents.delete(agent_name=_AGENT_NAME) + except Exception: # pylint: disable=broad-except + pass + + await project_client.agents.create_version( + agent_name=_AGENT_NAME, + definition=VoiceAgentDefinition( + model_type=VoiceModelType.MANAGED, + model=model, + instructions="You are a helpful voice assistant. Keep replies short.", + audio=VoiceAgentAudioConfig( + output=VoiceAgentAudioOutputConfig(voice="en-US-AvaNeural", voice_type="azure-standard") + ), + output_modalities=[VoiceOutputModality.AUDIO], + store=True, + ), + ) + + conversation_id: Optional[str] = None + async with project_client.realtime.connect(agent_name=_AGENT_NAME) as conn: + session_created = await asyncio.wait_for(conn.recv(), timeout=30) + assert isinstance(session_created, RealtimeServerEventSessionCreated) + conversation_id = session_created.conversation_id + + await conn.conversation.item.create( + item=RealtimeConversationItemMessageUser( + type=RealtimeConversationItemType.MESSAGE, + content=[RealtimeConversationItemMessageUserContent(type="input_text", text="Say hello.")], + ) + ) + await conn.response.create() + + got_response_done = False + deadline = time.monotonic() + 45 + while time.monotonic() < deadline and not got_response_done: + remaining = max(deadline - time.monotonic(), 0.1) + event = await asyncio.wait_for(conn.recv(), timeout=min(30, remaining)) + if isinstance(event, RealtimeServerEventResponseDone): + got_response_done = True + + assert conversation_id is not None, "Expected session.created to carry a conversation_id (store=True)" + await asyncio.sleep(_FINALIZATION_WAIT_SECONDS) + return conversation_id + + +class TestVoiceAgentConversationsAsync(TestBase): + """ + Recorded tests covering the read-only voice-agent conversation REST API surface exposed + through ``project_client.beta.agent_endpoint_conversations`` (conversation envelope, + responses, items, and audio), using the async client. + + NOTE: The top-level (non-beta) ``agent_endpoint_conversations.get_agent_conversation_item_ + generated_audio*`` methods are intentionally NOT covered here: they return the played-back- + interrupted subordinate "generated" audio, which requires deliberately barging in mid-reply + during a live session to produce -- not exercised by the simple single-turn conversation + created here. See this package's engineering notes. + """ + + # To run only this test: + # pytest tests\agents\test_voice_agent_conversations_async.py::TestVoiceAgentConversationsAsync::test_read_conversation_async -s + @servicePreparer() + @recorded_by_proxy_async() + async def test_read_conversation_async(self, **kwargs): # pylint: disable=too-many-locals + """ + Test reading back a persisted voice-agent conversation: the envelope, its responses + (with per-response output items), its ordered items (the transcript), the merged + whole-call audio recording, a single item's audio, and finally deleting the conversation. + + Routes used in this test: see the sync counterpart's docstring in + ``test_voice_agent_conversations.py`` for the full route table (identical here). + """ + print("\n") + project_client = self.create_async_client(operation_group="agents", allow_preview=True, **kwargs) + conversations = project_client.beta.agent_endpoint_conversations + + async with project_client: + if is_live(): + model = kwargs.get("foundry_voice_model_name") + assert model is not None + conversation_id = await _create_live_conversation(project_client, model) + add_general_regex_sanitizer( + regex=re.escape(conversation_id), value="sanitized-conversation-id", function_scoped=True + ) + else: + conversation_id = "sanitized-conversation-id" + + try: + # The conversation should appear in the agent's conversation list. + found = False + async for c in conversations.list_agent_conversations(_AGENT_NAME): + if c.id == conversation_id: + found = True + break + assert found, "Expected the new conversation to appear in list_agent_conversations" + + # The conversation envelope. + conversation = await conversations.get_agent_conversation(_AGENT_NAME, conversation_id) + assert conversation.id == conversation_id + assert conversation.status in ("in_progress", "completed", "failed") + assert conversation.created_at is not None + + # The responses (model inference turns) in the conversation. + responses = [ + r async for r in conversations.list_agent_conversation_responses(_AGENT_NAME, conversation_id) + ] + assert len(responses) >= 1 + first_response = responses[0] + response_detail = await conversations.get_agent_conversation_response( + _AGENT_NAME, conversation_id, first_response.id + ) + assert response_detail.id == first_response.id + + # The items produced by that response (does not raise; count may be 0 or more). + _ = [ + item + async for item in conversations.list_agent_conversation_response_items( + _AGENT_NAME, conversation_id, first_response.id + ) + ] + + # The ordered conversation items -- the full transcript (user + assistant + tool events). + items = [ + item async for item in conversations.list_agent_conversation_items(_AGENT_NAME, conversation_id) + ] + assert len(items) >= 1 + first_item_id = items[0].get("id") + assert first_item_id + fetched_item = await conversations.get_agent_conversation_item( + _AGENT_NAME, conversation_id, first_item_id + ) + assert fetched_item.get("id") == first_item_id + + # The merged whole-call recording, if the session had time to finalize. + if str(conversation.status) == "completed" or conversation.status == "completed": + recording = await conversations.get_agent_conversation_audio(_AGENT_NAME, conversation_id) + assert recording.format is not None + if not recording.blob_uri: + audio_chunks = [ + chunk + async for chunk in await conversations.get_agent_conversation_audio_content( + _AGENT_NAME, conversation_id + ) + ] + assert len(b"".join(audio_chunks)) > 0 + + # A single item's audio, if any item has one. + for item in items: + item_id = item.get("id") + if not item_id: + continue + try: + item_audio = await conversations.get_agent_conversation_item_audio( + _AGENT_NAME, conversation_id, item_id + ) + except HttpResponseError as e: + if e.status_code == 404: + continue + raise + assert item_audio.role is not None + if not item_audio.blob_uri: + item_audio_chunks = [ + chunk + async for chunk in await conversations.get_agent_conversation_item_audio_content( + _AGENT_NAME, conversation_id, item_id + ) + ] + assert len(b"".join(item_audio_chunks)) > 0 + break + else: + print( + f"Conversation did not finalize in time (status={conversation.status}); skipping audio checks." + ) + finally: + # Deleting a conversation removes it and all of its responses, items, and audio. + await conversations.delete_agent_conversation(_AGENT_NAME, conversation_id) + if is_live(): + await project_client.agents.delete(agent_name=_AGENT_NAME) diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_realtime_live.py b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_realtime_live.py new file mode 100644 index 000000000000..be1a3dcbf8d4 --- /dev/null +++ b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_realtime_live.py @@ -0,0 +1,285 @@ +# pylint: disable=too-many-lines,line-too-long,useless-suppression +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +# cSpell:disable + +""" +Live-only tests for the hand-written sync ``client.realtime`` WebSocket streaming client. + +Unlike ``tests/agents/test_realtime_client.py`` (which mocks the transport to unit-test URL +construction, auth, and error paths without a live service), these tests open a REAL WebSocket +connection to a live voice agent and assert on the actual streamed server events. They are +modeled on the live realtime test pattern used by the ``azure-ai-voicelive`` package +(``sdk/voicelive/azure-ai-voicelive/tests/live/``): skip entirely unless running live, use +generous per-event timeouts, and assert on event *types* and content presence/length rather than +exact audio bytes (the model's actual audio/text output is not deterministic). + +These tests do not use ``store=True`` / read back a persisted conversation -- that surface +(``project_client.beta.agent_endpoint_conversations.*``) is covered by the separate recorded +tests in ``test_voice_agent_conversations.py``, which need a real conversation id but replay +against a recorded cassette rather than opening a live WebSocket connection on every run. +""" + +import json +import time +from typing import Any, cast, Final + +import pytest +from test_base import TestBase, servicePreparer +from devtools_testutils import is_live +from azure.ai.projects.models import ( + RealtimeConversationItemFunctionCallOutput, + RealtimeConversationItemMessageUser, + RealtimeConversationItemMessageUserContent, + RealtimeConversationItemType, + RealtimeServerEventError, + RealtimeServerEventResponseAudioDelta, + RealtimeServerEventResponseAudioTranscriptDone, + RealtimeServerEventResponseDone, + RealtimeServerEventResponseFunctionCallArgumentsDone, + RealtimeServerEventResponseTextDone, + RealtimeServerEventSessionCreated, + VoiceAgentAudioConfig, + VoiceAgentAudioOutputConfig, + VoiceAgentDefinition, + VoiceAgentFunctionTool, + VoiceModelType, + VoiceOutputModality, +) + +# Seconds to wait for a single server event (session handshake, an audio delta, ...). +_EVENT_TIMEOUT: Final = 30 +# Seconds to wait for a full response turn to finish (may include a tool round-trip). +_RESPONSE_TIMEOUT: Final = 45 + + +def _get_weather(city: str) -> str: + """A trivial local "tool" implementation the agent can call. + + :param city: The city to look up. + :type city: str + :return: A canned weather report for the city. + :rtype: str + """ + return json.dumps({"city": city, "condition": "sunny", "temperature_f": 72}) + + +@pytest.mark.skipif( + not is_live(), + reason="Live-only: opens a real WebSocket connection to the realtime service, which cannot " + "be captured/replayed by the test proxy.", +) +class TestVoiceAgentRealtimeLive(TestBase): + """ + Live tests covering ``client.realtime.connect()`` (the hand-written sync WebSocket streaming + client) against a real voice agent and a real service connection. + """ + + def _make_agent_name(self, suffix: str) -> str: + return f"test-realtime-live-{suffix}" + + def _create_basic_agent(self, project_client, agent_name: str, model: str) -> None: + project_client.agents.create_version( + agent_name=agent_name, + definition=VoiceAgentDefinition( + model_type=VoiceModelType.MANAGED, + model=model, + instructions="You are a helpful voice assistant. Keep replies short.", + audio=VoiceAgentAudioConfig( + output=VoiceAgentAudioOutputConfig(voice="en-US-AvaNeural", voice_type="azure-standard") + ), + output_modalities=[VoiceOutputModality.AUDIO], + ), + ) + + # To run only this test: + # pytest tests\agents\test_voice_agent_realtime_live.py::TestVoiceAgentRealtimeLive::test_realtime_session_lifecycle -s + @servicePreparer() + def test_realtime_session_lifecycle(self, **kwargs): + """ + Test opening and cleanly closing a realtime WebSocket session, and receiving the initial + ``session.created`` handshake event. + """ + print("\n") + model = kwargs.get("foundry_voice_model_name") + assert model is not None + project_client = self.create_client(operation_group="agents", allow_preview=True, **kwargs) + agent_name = self._make_agent_name("lifecycle") + + try: + self._create_basic_agent(project_client, agent_name, model) + + with project_client.realtime.connect(agent_name=agent_name) as conn: + event = conn.recv(timeout=_EVENT_TIMEOUT) + assert isinstance(event, RealtimeServerEventSessionCreated) + assert event.type == "session.created" + # The `with` block above closes the connection; a second `recv()` after close + # would raise, so we don't attempt one -- clean exit from the block is the assertion. + finally: + project_client.agents.delete(agent_name=agent_name) + + # To run only this test: + # pytest tests\agents\test_voice_agent_realtime_live.py::TestVoiceAgentRealtimeLive::test_realtime_text_turn_produces_audio_and_transcript -s + @servicePreparer() + def test_realtime_text_turn_produces_audio_and_transcript(self, **kwargs): + """ + Test sending one typed user turn and receiving a streamed audio + transcript reply. + + Sends a ``RealtimeConversationItemMessageUser`` text turn and asserts that the service + streams back at least one non-empty audio delta, a transcript-done event with non-empty + text, and a final ``response.done``. Content is not asserted verbatim (the model's actual + wording is not deterministic); only event types, ordering-independent presence, and basic + size/non-emptiness are checked, matching the ``azure-ai-voicelive`` live test convention. + """ + print("\n") + model = kwargs.get("foundry_voice_model_name") + assert model is not None + project_client = self.create_client(operation_group="agents", allow_preview=True, **kwargs) + agent_name = self._make_agent_name("text-turn") + + try: + self._create_basic_agent(project_client, agent_name, model) + + with project_client.realtime.connect(agent_name=agent_name) as conn: + session_created = conn.recv(timeout=_EVENT_TIMEOUT) + assert isinstance(session_created, RealtimeServerEventSessionCreated) + + conn.conversation.item.create( + item=RealtimeConversationItemMessageUser( + type=RealtimeConversationItemType.MESSAGE, + content=[ + RealtimeConversationItemMessageUserContent( + type="input_text", text="Say the word 'hello' and nothing else." + ) + ], + ) + ) + conn.response.create() + + audio_delta_count = 0 + audio_bytes = 0 + transcript_done_count = 0 + got_response_done = False + deadline = time.monotonic() + _RESPONSE_TIMEOUT + + while time.monotonic() < deadline and not got_response_done: + event = conn.recv(timeout=_EVENT_TIMEOUT) + if isinstance(event, RealtimeServerEventResponseAudioDelta): + audio_delta_count += 1 + audio_bytes += len(event.delta) + elif isinstance(event, RealtimeServerEventResponseAudioTranscriptDone): + transcript_done_count += 1 + assert event.transcript is not None and len(event.transcript.strip()) > 0 + elif isinstance(event, RealtimeServerEventResponseDone): + got_response_done = True + elif isinstance(event, RealtimeServerEventError): + pytest.fail(f"Session error: {event.error.message}") + + assert got_response_done, "Did not receive response.done within the timeout" + assert audio_delta_count > 0, "Expected at least one response.audio.delta event" + assert audio_bytes > 0, "Expected non-empty streamed audio" + assert transcript_done_count == 1, "Expected exactly one audio-transcript-done event" + finally: + project_client.agents.delete(agent_name=agent_name) + + # To run only this test: + # pytest tests\agents\test_voice_agent_realtime_live.py::TestVoiceAgentRealtimeLive::test_realtime_function_tool_call -s + @servicePreparer() + def test_realtime_function_tool_call(self, **kwargs): + """ + Test a client-executed function-tool round trip during a live realtime session. + + Configures the agent with a ``get_weather`` function tool, sends a prompt that should + trigger it, executes the tool call locally when the service asks for it, and sends the + result back so the agent can finish its reply -- mirroring + ``samples/agents/voice/sample_voice_agent_live_function_tool.py``, which this test + adapts into an automated assertion-based form. + """ + print("\n") + project_client = self.create_client(operation_group="agents", allow_preview=True, **kwargs) + agent_name = self._make_agent_name("tool-call") + + get_weather_tool = VoiceAgentFunctionTool( + name="get_weather", + description="Get the current weather for a city.", + parameters=cast( + Any, + { + "type": "object", + "properties": {"city": {"type": "string", "description": "City name, e.g. Seattle."}}, + "required": ["city"], + }, + ), + ) + + try: + project_client.agents.create_version( + agent_name=agent_name, + definition=VoiceAgentDefinition( + model_type=VoiceModelType.MANAGED, + model="gpt-realtime", + instructions=( + "You are a helpful voice assistant. Use the get_weather tool when the " + "caller asks about the weather, then answer using its result." + ), + output_modalities=[VoiceOutputModality.TEXT], + tools=[get_weather_tool], + ), + ) + + with project_client.realtime.connect(agent_name=agent_name) as conn: + session_created = conn.recv(timeout=_EVENT_TIMEOUT) + assert isinstance(session_created, RealtimeServerEventSessionCreated) + + conn.conversation.item.create( + item=RealtimeConversationItemMessageUser( + type=RealtimeConversationItemType.MESSAGE, + content=[ + RealtimeConversationItemMessageUserContent( + type="input_text", text="What's the weather like in Seattle right now?" + ) + ], + ) + ) + conn.response.create() + + tool_call_count = 0 + final_text = "" + deadline = time.monotonic() + _RESPONSE_TIMEOUT + done = False + + while time.monotonic() < deadline and not done: + event = conn.recv(timeout=_EVENT_TIMEOUT) + if isinstance(event, RealtimeServerEventResponseFunctionCallArgumentsDone): + tool_call_count += 1 + assert event.name == "get_weather" + args = json.loads(event.arguments) + assert "city" in args + result = _get_weather(**args) + conn.conversation.item.create( + item=RealtimeConversationItemFunctionCallOutput(call_id=event.call_id, output=result) + ) + conn.response.create() + elif isinstance(event, RealtimeServerEventResponseTextDone): + final_text = event.text + elif isinstance(event, RealtimeServerEventResponseDone): + # A response.done that isn't itself a function call is the final answer. + # Output items surface as plain mappings (open union) or typed models. + output = event.response.output or [] + is_function_call = any( + (item.get("type") if isinstance(item, dict) else getattr(item, "type", None)) + == "function_call" + for item in output + ) + if not is_function_call: + done = True + elif isinstance(event, RealtimeServerEventError): + pytest.fail(f"Session error: {event.error.message}") + + assert done, "Did not receive a final (non-tool-call) response.done within the timeout" + assert tool_call_count >= 1, "Expected the agent to invoke the get_weather tool at least once" + assert final_text is not None and len(final_text.strip()) > 0 + finally: + project_client.agents.delete(agent_name=agent_name) diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_realtime_live_async.py b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_realtime_live_async.py new file mode 100644 index 000000000000..8a7a348f96d5 --- /dev/null +++ b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_realtime_live_async.py @@ -0,0 +1,284 @@ +# pylint: disable=too-many-lines,line-too-long,useless-suppression +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +# cSpell:disable + +""" +Live-only tests for the hand-written async ``async_client.realtime`` WebSocket streaming client. + +Async counterpart of ``test_voice_agent_realtime_live.py``. See that module's docstring for the +overall rationale (modeled on the ``azure-ai-voicelive`` package's live realtime test pattern: +skip entirely unless running live, generous per-event timeouts, assert on event types and +content presence/length rather than exact audio bytes). +""" + +import asyncio +import json +import time +from typing import Any, cast, Final + +import pytest +from test_base import TestBase, servicePreparer +from devtools_testutils import is_live +from azure.ai.projects.models import ( + RealtimeConversationItemFunctionCallOutput, + RealtimeConversationItemMessageUser, + RealtimeConversationItemMessageUserContent, + RealtimeConversationItemType, + RealtimeServerEventError, + RealtimeServerEventResponseAudioDelta, + RealtimeServerEventResponseAudioTranscriptDone, + RealtimeServerEventResponseDone, + RealtimeServerEventResponseFunctionCallArgumentsDone, + RealtimeServerEventResponseTextDone, + RealtimeServerEventSessionCreated, + VoiceAgentAudioConfig, + VoiceAgentAudioOutputConfig, + VoiceAgentDefinition, + VoiceAgentFunctionTool, + VoiceModelType, + VoiceOutputModality, +) + + +# Seconds to wait for a single server event (session handshake, an audio delta, ...). +_EVENT_TIMEOUT: Final = 30 +# Seconds to wait for a full response turn to finish (may include a tool round-trip). +_RESPONSE_TIMEOUT: Final = 45 + + +def _get_weather(city: str) -> str: + """A trivial local "tool" implementation the agent can call. + + :param city: The city to look up. + :type city: str + :return: A canned weather report for the city. + :rtype: str + """ + return json.dumps({"city": city, "condition": "sunny", "temperature_f": 72}) + + +@pytest.mark.skipif( + not is_live(), + reason="Live-only: opens a real WebSocket connection to the realtime service, which cannot " + "be captured/replayed by the test proxy.", +) +class TestVoiceAgentRealtimeLiveAsync(TestBase): + """ + Live tests covering ``async_client.realtime.connect()`` (the hand-written async WebSocket + streaming client) against a real voice agent and a real service connection. + """ + + def _make_agent_name(self, suffix: str) -> str: + return f"test-realtime-live-async-{suffix}" + + async def _create_basic_agent(self, project_client, agent_name: str, model: str) -> None: + await project_client.agents.create_version( + agent_name=agent_name, + definition=VoiceAgentDefinition( + model_type=VoiceModelType.MANAGED, + model=model, + instructions="You are a helpful voice assistant. Keep replies short.", + audio=VoiceAgentAudioConfig( + output=VoiceAgentAudioOutputConfig(voice="en-US-AvaNeural", voice_type="azure-standard") + ), + output_modalities=[VoiceOutputModality.AUDIO], + ), + ) + + # To run only this test: + # pytest tests\agents\test_voice_agent_realtime_live_async.py::TestVoiceAgentRealtimeLiveAsync::test_realtime_session_lifecycle_async -s + @servicePreparer() + async def test_realtime_session_lifecycle_async(self, **kwargs): + """ + Test opening and cleanly closing a realtime WebSocket session, and receiving the initial + ``session.created`` handshake event. + """ + print("\n") + model = kwargs.get("foundry_voice_model_name") + assert model is not None + project_client = self.create_async_client(operation_group="agents", allow_preview=True, **kwargs) + agent_name = self._make_agent_name("lifecycle") + + try: + await self._create_basic_agent(project_client, agent_name, model) + + async with project_client.realtime.connect(agent_name=agent_name) as conn: + event = await asyncio.wait_for(conn.recv(), timeout=_EVENT_TIMEOUT) + assert isinstance(event, RealtimeServerEventSessionCreated) + assert event.type == "session.created" + # The `async with` block above closes the connection; a second `recv()` after close + # would raise, so we don't attempt one -- clean exit from the block is the assertion. + finally: + await project_client.agents.delete(agent_name=agent_name) + await project_client.close() + + # To run only this test: + # pytest tests\agents\test_voice_agent_realtime_live_async.py::TestVoiceAgentRealtimeLiveAsync::test_realtime_text_turn_produces_audio_and_transcript_async -s + @servicePreparer() + async def test_realtime_text_turn_produces_audio_and_transcript_async(self, **kwargs): + """ + Test sending one typed user turn and receiving a streamed audio + transcript reply. + + Sends a ``RealtimeConversationItemMessageUser`` text turn and asserts that the service + streams back at least one non-empty audio delta, a transcript-done event with non-empty + text, and a final ``response.done``. Content is not asserted verbatim (the model's actual + wording is not deterministic); only event types, ordering-independent presence, and basic + size/non-emptiness are checked, matching the ``azure-ai-voicelive`` live test convention. + """ + print("\n") + model = kwargs.get("foundry_voice_model_name") + assert model is not None + project_client = self.create_async_client(operation_group="agents", allow_preview=True, **kwargs) + agent_name = self._make_agent_name("text-turn") + + try: + await self._create_basic_agent(project_client, agent_name, model) + + async with project_client.realtime.connect(agent_name=agent_name) as conn: + session_created = await asyncio.wait_for(conn.recv(), timeout=_EVENT_TIMEOUT) + assert isinstance(session_created, RealtimeServerEventSessionCreated) + + await conn.conversation.item.create( + item=RealtimeConversationItemMessageUser( + type=RealtimeConversationItemType.MESSAGE, + content=[ + RealtimeConversationItemMessageUserContent( + type="input_text", text="Say the word 'hello' and nothing else." + ) + ], + ) + ) + await conn.response.create() + + audio_delta_count = 0 + audio_bytes = 0 + transcript_done_count = 0 + got_response_done = False + deadline = time.monotonic() + _RESPONSE_TIMEOUT + + while time.monotonic() < deadline and not got_response_done: + remaining = max(deadline - time.monotonic(), 0.1) + event = await asyncio.wait_for(conn.recv(), timeout=min(_EVENT_TIMEOUT, remaining)) + if isinstance(event, RealtimeServerEventResponseAudioDelta): + audio_delta_count += 1 + audio_bytes += len(event.delta) + elif isinstance(event, RealtimeServerEventResponseAudioTranscriptDone): + transcript_done_count += 1 + assert event.transcript is not None and len(event.transcript.strip()) > 0 + elif isinstance(event, RealtimeServerEventResponseDone): + got_response_done = True + elif isinstance(event, RealtimeServerEventError): + pytest.fail(f"Session error: {event.error.message}") + + assert got_response_done, "Did not receive response.done within the timeout" + assert audio_delta_count > 0, "Expected at least one response.audio.delta event" + assert audio_bytes > 0, "Expected non-empty streamed audio" + assert transcript_done_count == 1, "Expected exactly one audio-transcript-done event" + finally: + await project_client.agents.delete(agent_name=agent_name) + await project_client.close() + + # To run only this test: + # pytest tests\agents\test_voice_agent_realtime_live_async.py::TestVoiceAgentRealtimeLiveAsync::test_realtime_function_tool_call_async -s + @servicePreparer() + async def test_realtime_function_tool_call_async(self, **kwargs): + """ + Test a client-executed function-tool round trip during a live realtime session. + + Configures the agent with a ``get_weather`` function tool, sends a prompt that should + trigger it, executes the tool call locally when the service asks for it, and sends the + result back so the agent can finish its reply -- the async counterpart of + ``sample_voice_agent_live_function_tool.py``'s pattern, adapted into an automated + assertion-based test. + """ + print("\n") + project_client = self.create_async_client(operation_group="agents", allow_preview=True, **kwargs) + agent_name = self._make_agent_name("tool-call") + + get_weather_tool = VoiceAgentFunctionTool( + name="get_weather", + description="Get the current weather for a city.", + parameters=cast( + Any, + { + "type": "object", + "properties": {"city": {"type": "string", "description": "City name, e.g. Seattle."}}, + "required": ["city"], + }, + ), + ) + + try: + await project_client.agents.create_version( + agent_name=agent_name, + definition=VoiceAgentDefinition( + model_type=VoiceModelType.MANAGED, + model="gpt-realtime", + instructions=( + "You are a helpful voice assistant. Use the get_weather tool when the " + "caller asks about the weather, then answer using its result." + ), + output_modalities=[VoiceOutputModality.TEXT], + tools=[get_weather_tool], + ), + ) + + async with project_client.realtime.connect(agent_name=agent_name) as conn: + session_created = await asyncio.wait_for(conn.recv(), timeout=_EVENT_TIMEOUT) + assert isinstance(session_created, RealtimeServerEventSessionCreated) + + await conn.conversation.item.create( + item=RealtimeConversationItemMessageUser( + type=RealtimeConversationItemType.MESSAGE, + content=[ + RealtimeConversationItemMessageUserContent( + type="input_text", text="What's the weather like in Seattle right now?" + ) + ], + ) + ) + await conn.response.create() + + tool_call_count = 0 + final_text = "" + deadline = time.monotonic() + _RESPONSE_TIMEOUT + done = False + + while time.monotonic() < deadline and not done: + remaining = max(deadline - time.monotonic(), 0.1) + event = await asyncio.wait_for(conn.recv(), timeout=min(_EVENT_TIMEOUT, remaining)) + if isinstance(event, RealtimeServerEventResponseFunctionCallArgumentsDone): + tool_call_count += 1 + assert event.name == "get_weather" + args = json.loads(event.arguments) + assert "city" in args + result = _get_weather(**args) + await conn.conversation.item.create( + item=RealtimeConversationItemFunctionCallOutput(call_id=event.call_id, output=result) + ) + await conn.response.create() + elif isinstance(event, RealtimeServerEventResponseTextDone): + final_text = event.text + elif isinstance(event, RealtimeServerEventResponseDone): + # A response.done that isn't itself a function call is the final answer. + # Output items surface as plain mappings (open union) or typed models. + output = event.response.output or [] + is_function_call = any( + (item.get("type") if isinstance(item, dict) else getattr(item, "type", None)) + == "function_call" + for item in output + ) + if not is_function_call: + done = True + elif isinstance(event, RealtimeServerEventError): + pytest.fail(f"Session error: {event.error.message}") + + assert done, "Did not receive a final (non-tool-call) response.done within the timeout" + assert tool_call_count >= 1, "Expected the agent to invoke the get_weather tool at least once" + assert final_text is not None and len(final_text.strip()) > 0 + finally: + await project_client.agents.delete(agent_name=agent_name) + await project_client.close() From d7c6a97eea19a16dd5d428fcb93d304570a7ac9d Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Thu, 3 Sep 2026 16:19:24 -0700 Subject: [PATCH 48/56] Regenerate api.md/api.metadata.yml/docs/public-methods.md after main merge Follow-up to the merge commit: these are generated artifacts that were resolved with a placeholder during conflict resolution. Regenerated via `azpysdk apistub .` (api.md, apiview-properties.json - unchanged) and via a fresh runtime introspection of AIProjectClient (docs/public-methods.md) so they correctly reflect the fully-merged API surface (voice agents + main's independent additions). Also corrected api.metadata.yml's apiMdSha256, which the apistub tool did not update to match the regenerated api.md. Verified: full test suite passes (1038 passed, 119 skipped, 0 failed), including the foundry_features_header tests and the recorded voice-agent conversation tests against the newly-combined assets recordings tag. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- sdk/ai/azure-ai-projects/api.md | 59 ------------------- sdk/ai/azure-ai-projects/api.metadata.yml | 2 +- .../azure-ai-projects/docs/public-methods.md | 12 ++-- 3 files changed, 7 insertions(+), 66 deletions(-) diff --git a/sdk/ai/azure-ai-projects/api.md b/sdk/ai/azure-ai-projects/api.md index 3cbc2d71cf99..999e494fe7b2 100644 --- a/sdk/ai/azure-ai-projects/api.md +++ b/sdk/ai/azure-ai-projects/api.md @@ -1039,7 +1039,6 @@ namespace azure.ai.projects.aio.operations run: AgentInsightRunCreate, *, content_type: str = "application/json", - operation_id: Optional[str] = ..., **kwargs: Any ) -> AsyncAgentInsightRunLROPoller: ... @@ -1050,7 +1049,6 @@ namespace azure.ai.projects.aio.operations run: JSON, *, content_type: str = "application/json", - operation_id: Optional[str] = ..., **kwargs: Any ) -> AsyncAgentInsightRunLROPoller: ... @@ -1061,7 +1059,6 @@ namespace azure.ai.projects.aio.operations run: IO[bytes], *, content_type: str = "application/json", - operation_id: Optional[str] = ..., **kwargs: Any ) -> AsyncAgentInsightRunLROPoller: ... @@ -9309,14 +9306,12 @@ namespace azure.ai.projects.models class azure.ai.projects.models.RaiConfig(_Model): - invocations_moderation: Optional[RaiInvocationModeration] rai_policy_name: str @overload def __init__( self, *, - invocations_moderation: Optional[RaiInvocationModeration] = ..., rai_policy_name: str ) -> None: ... @@ -9324,57 +9319,6 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.RaiInvocationContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - JSON = "json" - TEXT = "text" - - - class azure.ai.projects.models.RaiInvocationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - BOTH = "both" - NON_STREAMING = "non_streaming" - STREAMING = "streaming" - - - class azure.ai.projects.models.RaiInvocationModeration(_Model): - input_content_type: Optional[Union[str, RaiInvocationContentType]] - input_paths: Optional[list[str]] - output_content_type: Optional[Union[str, RaiInvocationContentType]] - output_paths: Optional[list[str]] - response_mode: Union[str, RaiInvocationMode] - stream_selectors: Optional[list[RaiSseTextSelector]] - - @overload - def __init__( - self, - *, - input_content_type: Optional[Union[str, RaiInvocationContentType]] = ..., - input_paths: Optional[list[str]] = ..., - output_content_type: Optional[Union[str, RaiInvocationContentType]] = ..., - output_paths: Optional[list[str]] = ..., - response_mode: Union[str, RaiInvocationMode], - stream_selectors: Optional[list[RaiSseTextSelector]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.RaiSseTextSelector(_Model): - event_type: str - text_field: Optional[str] - - @overload - def __init__( - self, - *, - event_type: str, - text_field: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.RankerVersionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): AUTO = "auto" DEFAULT_2024_11_15 = "default-2024-11-15" @@ -16759,7 +16703,6 @@ namespace azure.ai.projects.operations run: AgentInsightRunCreate, *, content_type: str = "application/json", - operation_id: Optional[str] = ..., **kwargs: Any ) -> AgentInsightRunLROPoller: ... @@ -16770,7 +16713,6 @@ namespace azure.ai.projects.operations run: JSON, *, content_type: str = "application/json", - operation_id: Optional[str] = ..., **kwargs: Any ) -> AgentInsightRunLROPoller: ... @@ -16781,7 +16723,6 @@ namespace azure.ai.projects.operations run: IO[bytes], *, content_type: str = "application/json", - operation_id: Optional[str] = ..., **kwargs: Any ) -> AgentInsightRunLROPoller: ... diff --git a/sdk/ai/azure-ai-projects/api.metadata.yml b/sdk/ai/azure-ai-projects/api.metadata.yml index 5c1b81491418..f3eabe2d568b 100644 --- a/sdk/ai/azure-ai-projects/api.metadata.yml +++ b/sdk/ai/azure-ai-projects/api.metadata.yml @@ -1,4 +1,4 @@ -apiMdSha256: a78edee1981891b9341579cacaf63d516141329aee147924c49854583e6ee974 +apiMdSha256: facabc91ae97258e9e1aa86660a5b2611026d364769207d0107256a109bdca89 packageVersion: 2.6.0 parserVersion: 0.3.31 pythonVersion: 3.13.2 diff --git a/sdk/ai/azure-ai-projects/docs/public-methods.md b/sdk/ai/azure-ai-projects/docs/public-methods.md index fc7da6b1c2f9..25ced475cbb2 100644 --- a/sdk/ai/azure-ai-projects/docs/public-methods.md +++ b/sdk/ai/azure-ai-projects/docs/public-methods.md @@ -59,8 +59,8 @@ Alphabetically sorted. An asterisk at the end of the method name means is a hand Alphabetically sorted. An asterisk at the end of the method name means is a hand-written method. ``` -.agent_endpoint_conversations.get_agent_conversation_item_generated_audio -.agent_endpoint_conversations.get_agent_conversation_item_generated_audio_content +.agent_endpoint_conversations.get_agent_conversation_item_generated_audio* +.agent_endpoint_conversations.get_agent_conversation_item_generated_audio_content* .agents.create_session .agents.create_telephony_binding* @@ -159,7 +159,7 @@ Alphabetically sorted. An asterisk at the end of the method name means is a hand .beta.agent_endpoint_conversations.list_agent_conversation_responses .beta.agent_endpoint_conversations.list_agent_conversations -.beta.agent_insight_monitors.begin_create_run +.beta.agent_insight_monitors.begin_create_run* .beta.agent_insight_monitors.cancel_run .beta.agent_insight_monitors.create .beta.agent_insight_monitors.delete @@ -173,14 +173,14 @@ Alphabetically sorted. An asterisk at the end of the method name means is a hand .beta.agent_insight_monitors.update .beta.agent_insight_monitors.update_insight -.beta.agents.cancel_optimization_job .beta.agents.begin_create_optimization_job* +.beta.agents.cancel_optimization_job .beta.agents.delete_optimization_job .beta.agents.get_optimization_job .beta.agents.list_optimization_jobs -.beta.datasets.cancel_generation_job .beta.datasets.begin_create_generation_job* +.beta.datasets.cancel_generation_job .beta.datasets.delete_generation_job .beta.datasets.get_generation_job .beta.datasets.list_generation_jobs @@ -191,8 +191,8 @@ Alphabetically sorted. An asterisk at the end of the method name means is a hand .beta.evaluation_taxonomies.list .beta.evaluation_taxonomies.update -.beta.evaluators.cancel_generation_job .beta.evaluators.begin_create_generation_job* +.beta.evaluators.cancel_generation_job .beta.evaluators.create_version .beta.evaluators.delete_generation_job .beta.evaluators.delete_version From c8ffb740ac437ef09c24d56fbe41f4df3c160990 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Thu, 3 Sep 2026 18:24:30 -0700 Subject: [PATCH 49/56] Fix Analyze-stage CI failures (cspell/mypy/pyright/pylint) and resolve PR review comments CI fixes (build 6787439 Analyze stage): - cspell: add PSTN/pstn (telephony acronym) to the allowed words list - mypy/pyright: fix a genuine TypeSpec-emitter bug where the generated replace_telephony_transfer_targets JSON/IO[bytes]-body @overload stubs had etag/match_condition types swapped vs. the real implementation, in both sync and async _operations.py; also add a PostEmitter.ps1 fixup so this self-heals on future regenerations - pylint: fix C0411 wrong-import-order in _realtime.py/aio/_realtime.py (the UserAgentPolicy import was placed after local imports) PR #48484 review comment fixes: - Add the two persisted-conversation voice samples to IGNORED_SAMPLES in both sample-runner copies (they require a pre-existing FOUNDRY_VOICE_CONVERSATION_ID that automation doesn't provide) - test-resources-post.ps1: fail resource provisioning immediately on a deployment-readiness timeout instead of warning and continuing into live tests against a not-ready model - tests.yml: restrict the live-test pipeline to voice-specific tests via a new live_test_only marker + TestMarkArgument, since this pipeline's Bicep only provisions the voice model, not the full package's resource set - test_voice_agent_realtime_live(_async).py: use the prepared foundry_voice_model_name instead of a hardcoded "gpt-realtime" deployment name - _realtime.py: fix a real bug in the sync WebSocket connect -- disable websockets' own default User-Agent (user_agent_header=None) and drop a caller-supplied subprotocols kwarg to prevent a collision with the fixed "realtime" subprotocol, matching the async implementation's existing handling; add 2 regression tests - test_voice_agent_conversations(_async).py: make conversation completion a hard requirement for the audio assertions instead of a silent skip, so a future re-recording can't hide a regression in all four audio methods Verified: 1042 passed, 119 skipped, 0 failed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .vscode/cspell.json | 2 + eng/tools/azure-sdk-tools/azpysdk/samples.py | 7 ++ scripts/devops_tasks/test_run_samples.py | 7 ++ sdk/ai/azure-ai-projects/PostEmitter.ps1 | 47 ++++++++++++ .../azure/ai/projects/_realtime.py | 17 ++++- .../azure/ai/projects/aio/_realtime.py | 4 +- .../ai/projects/aio/operations/_operations.py | 16 ++-- .../ai/projects/operations/_operations.py | 16 ++-- .../azure-ai-projects/test-resources-post.ps1 | 3 +- sdk/ai/azure-ai-projects/tests.yml | 1 + .../tests/agents/test_realtime_client.py | 49 ++++++++++++ .../agents/test_realtime_client_async.py | 17 +++++ .../agents/test_voice_agent_conversations.py | 64 ++++++++-------- .../test_voice_agent_conversations_async.py | 76 ++++++++++--------- .../agents/test_voice_agent_realtime_live.py | 5 +- .../test_voice_agent_realtime_live_async.py | 5 +- 16 files changed, 245 insertions(+), 91 deletions(-) diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 82ca0b271c71..240fd9351b4c 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -144,6 +144,8 @@ "sdk/ai/azure-ai-voicelive/samples/**" ], "words": [ + "PSTN", + "pstn", "vally", "regen", "pylintrc", diff --git a/eng/tools/azure-sdk-tools/azpysdk/samples.py b/eng/tools/azure-sdk-tools/azpysdk/samples.py index c53f779bfad7..2520244eb6ed 100644 --- a/eng/tools/azure-sdk-tools/azpysdk/samples.py +++ b/eng/tools/azure-sdk-tools/azpysdk/samples.py @@ -94,6 +94,13 @@ # Runs until Ctrl-C (continuous microphone capture/playback); would hang indefinitely # under this non-interactive runner whenever PyAudio and live credentials are available. "sample_voice_agent_live_audio_conversation_async.py", + # These read back a conversation transcript/audio from a *pre-existing*, already-persisted + # voice session via FOUNDRY_VOICE_CONVERSATION_ID, which no automation here provides (the + # package's own recorded sample suite skips them for the same reason -- see + # samples_to_skip in tests/samples/test_samples.py); running them raises a KeyError before + # exercising anything. + "sample_voice_agent_read_conversation.py", + "sample_voice_agent_read_conversation_audio.py", ], "azure-eventgrid": [ "__init__.py", diff --git a/scripts/devops_tasks/test_run_samples.py b/scripts/devops_tasks/test_run_samples.py index e726a9dd8a87..b65debfbb68d 100644 --- a/scripts/devops_tasks/test_run_samples.py +++ b/scripts/devops_tasks/test_run_samples.py @@ -96,6 +96,13 @@ # Runs until Ctrl-C (continuous microphone capture/playback); would hang indefinitely # under this non-interactive runner whenever PyAudio and live credentials are available. "sample_voice_agent_live_audio_conversation_async.py", + # These read back a conversation transcript/audio from a *pre-existing*, already-persisted + # voice session via FOUNDRY_VOICE_CONVERSATION_ID, which no automation here provides (the + # package's own recorded sample suite skips them for the same reason -- see + # samples_to_skip in tests/samples/test_samples.py); running them raises a KeyError before + # exercising anything. + "sample_voice_agent_read_conversation.py", + "sample_voice_agent_read_conversation_audio.py", ], "azure-eventgrid": [ "__init__.py", diff --git a/sdk/ai/azure-ai-projects/PostEmitter.ps1 b/sdk/ai/azure-ai-projects/PostEmitter.ps1 index d90bffaefecf..8cd12b11c69d 100644 --- a/sdk/ai/azure-ai-projects/PostEmitter.ps1 +++ b/sdk/ai/azure-ai-projects/PostEmitter.ps1 @@ -408,6 +408,53 @@ $c = $c.Replace('"_unions.VoiceAgentSessionResponse"', '"_models.VoiceAgentSessi $c = $c.Replace('"_unions.VoiceAgentSessionUpdate"', '"_models.VoiceAgentSessionUpdateConfig"') Set-Content $f $c -NoNewline +# `replace_telephony_transfer_targets`'s JSON-body and IO[bytes]-body @overload stubs mistype +# `etag`/`match_condition`: they declare `etag: List[_models.TelephonyTransferTarget]` and +# `match_condition: str`, but the real implementation (and the keyword-only overload) correctly +# type them as `etag: str` / `match_condition: MatchConditions` -- an internally-inconsistent +# emitter bug (mypy: "Overloaded function implementation does not accept all possible arguments of +# signature 2/3"; pyright: "Overloaded implementation is not consistent with signature of overload +# 2/3"). This also breaks the hand-written call in _patch_agents.py/_patch_agents_async.py, whose +# call no longer matches any overload once the impl's real parameter types are considered (pyright: +# "Argument of type ... cannot be assigned to parameter 'body'/'etag'"). Fix both overloads' +# signatures and docstrings in both sync and async _operations.py. +$files = 'azure\ai\projects\operations\_operations.py', 'azure\ai\projects\aio\operations\_operations.py' +foreach ($f in $files) { + $c = Get-Content $f -Raw + $c = $c -replace 'etag: List\[_models\.TelephonyTransferTarget\],(\r?\n\s+)match_condition: str,', 'etag: str,$1match_condition: MatchConditions,' + $c = $c -replace ':paramtype etag: list\[~azure\.ai\.projects\.models\.TelephonyTransferTarget\]', ':paramtype etag: str' + $c = $c -replace ':paramtype match_condition: str', ':paramtype match_condition: ~azure.core.MatchConditions' + Set-Content $f $c -NoNewline +} + +# Regression guard: `_realtime.py` and `aio\_realtime.py` are hand-written files that are NOT +# `_patch.py`-named, so they aren't covered by the emitter's own "never touch _patch.py" guarantee -- +# nothing in the TypeSpec emitter is aware these files exist. They carry the SDK client-identification +# fix ported from the azure-ai-voicelive PR #48848 (a User-Agent header and x-ms-client-sdk query +# parameter, both derived from `_USER_AGENT = UserAgentPolicy(sdk_moniker=...)`, with a case-insensitive +# guard so a caller-supplied extra_headers User-Agent of any casing is honored instead of duplicated). +# If a future `tsp-client update` ever starts generating (and thus silently overwriting) a file at either +# of these paths, this fix would be lost with no other signal until someone happens to run the realtime +# test suite. Fail the emit step immediately instead, right after regeneration, rather than relying on +# that eventual test run. +$realtimeFiles = @('azure\ai\projects\_realtime.py', 'azure\ai\projects\aio\_realtime.py') +foreach ($f in $realtimeFiles) { + if (-not (Test-Path $f)) { + throw "PostEmitter safety check failed: '$f' is missing. This hand-written file (not tracked by the TypeSpec emitter) carries the SDK client-identification fix from PR #48848; if the emitter deleted or renamed it, restore it from git history before continuing." + } + $c = Get-Content $f -Raw + if ($c -notmatch 'UserAgentPolicy\(sdk_moniker=') { + throw "PostEmitter safety check failed: '$f' no longer defines _USER_AGENT via UserAgentPolicy(sdk_moniker=...). The SDK client-identification fix from PR #48848 appears to have been overwritten -- reinstate the User-Agent header + x-ms-client-sdk query param wiring." + } + if ($c -notmatch '_has_header_case_insensitive') { + throw "PostEmitter safety check failed: '$f' no longer guards the User-Agent header with _has_header_case_insensitive. A caller-supplied extra_headers User-Agent (in any casing) would be duplicated instead of honored -- reinstate the case-insensitive check." + } + if ($c -notmatch 'x-ms-client-sdk') { + throw "PostEmitter safety check failed: '$f' no longer sends the x-ms-client-sdk query parameter alongside the User-Agent header -- reinstate it so service telemetry can still attribute traffic on paths that don't forward the header." + } +} +Write-Host "PostEmitter safety check passed: SDK client-identification fix (PR #48848) is intact in both _realtime.py files." + # Finishing by running 'black' tool to format code. pip install black black --config ../../../eng/black-pyproject.toml . diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py index 657aa0ffbbb8..ad7b8c335369 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_realtime.py @@ -34,14 +34,14 @@ cast, ) +from azure.core.pipeline.policies import UserAgentPolicy + from . import models as _models from .models._enums import _AgentDefinitionOptInKeys from .models._patch import _FOUNDRY_FEATURES_HEADER_NAME, _has_header_case_insensitive from ._utils.model_base import Model as _Model, SdkJSONEncoder from ._version import VERSION -from azure.core.pipeline.policies import UserAgentPolicy - # Scoped to just the voice-agent preview opt-in; callers connecting to other preview agent # kinds through this same route can pass a broader value explicitly via ``foundry_features``. _VOICE_AGENT_FEATURE_HEADER: str = _AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.value @@ -748,11 +748,22 @@ def enter(self) -> RealtimeConnection: # pylint: disable=too-many-locals headers["User-Agent"] = _USER_AGENT try: + # Force the "realtime" WebSocket subprotocol regardless of any caller-supplied + # override in ``self._kwargs``: the service requires this exact subprotocol, so + # silently accepting a different one here would just move the failure to a less + # clear error inside the handshake. Also disable ``websockets``' own + # ``user_agent_header`` default: unlike aiohttp, it is a wholly separate mechanism + # from ``additional_headers`` -- passing our own "User-Agent" there does not + # override it, so without this the connection would carry two distinct + # User-Agent-like values. + ws_connect_kwargs = dict(self._kwargs) + ws_connect_kwargs.pop("subprotocols", None) connection = _ws_connect( full_url, additional_headers=headers, subprotocols=[Subprotocol("realtime")], - **self._kwargs, + user_agent_header=None, + **ws_connect_kwargs, ) except BaseException as exc: if not isinstance(exc, Exception) or isinstance(exc, (ValueError, RuntimeError)): diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py index dcea1132377e..fe3826cb84db 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_realtime.py @@ -48,14 +48,14 @@ Union, ) +from azure.core.pipeline.policies import UserAgentPolicy + from .. import models as _models from ..models._enums import _AgentDefinitionOptInKeys from ..models._patch import _FOUNDRY_FEATURES_HEADER_NAME, _has_header_case_insensitive from .._utils.model_base import Model as _Model, SdkJSONEncoder from .._version import VERSION -from azure.core.pipeline.policies import UserAgentPolicy - # Scoped to just the voice-agent preview opt-in; callers connecting to other preview agent # kinds through this same route can pass a broader value explicitly via ``foundry_features``. _VOICE_AGENT_FEATURE_HEADER: str = _AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.value 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 f04e296cf9c4..ca9b4e11ff5c 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 @@ -4245,8 +4245,8 @@ async def replace_telephony_transfer_targets( agent_name: str, body: JSON, *, - etag: List[_models.TelephonyTransferTarget], - match_condition: str, + etag: str, + match_condition: MatchConditions, content_type: str = "application/json", **kwargs: Any ) -> _models.TelephonyTransferTargets: @@ -4259,9 +4259,9 @@ async def replace_telephony_transfer_targets( :param body: Required. :type body: JSON :keyword etag: check if resource is changed. Set None to skip checking etag. Required. - :paramtype etag: list[~azure.ai.projects.models.TelephonyTransferTarget] + :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Required. - :paramtype match_condition: str + :paramtype match_condition: ~azure.core.MatchConditions :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4277,8 +4277,8 @@ async def replace_telephony_transfer_targets( agent_name: str, body: IO[bytes], *, - etag: List[_models.TelephonyTransferTarget], - match_condition: str, + etag: str, + match_condition: MatchConditions, content_type: str = "application/json", **kwargs: Any ) -> _models.TelephonyTransferTargets: @@ -4291,9 +4291,9 @@ async def replace_telephony_transfer_targets( :param body: Required. :type body: IO[bytes] :keyword etag: check if resource is changed. Set None to skip checking etag. Required. - :paramtype etag: list[~azure.ai.projects.models.TelephonyTransferTarget] + :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Required. - :paramtype match_condition: str + :paramtype match_condition: ~azure.core.MatchConditions :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str 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 210bef517d8f..a935e879f5a9 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 @@ -8972,8 +8972,8 @@ def replace_telephony_transfer_targets( agent_name: str, body: JSON, *, - etag: List[_models.TelephonyTransferTarget], - match_condition: str, + etag: str, + match_condition: MatchConditions, content_type: str = "application/json", **kwargs: Any ) -> _models.TelephonyTransferTargets: @@ -8986,9 +8986,9 @@ def replace_telephony_transfer_targets( :param body: Required. :type body: JSON :keyword etag: check if resource is changed. Set None to skip checking etag. Required. - :paramtype etag: list[~azure.ai.projects.models.TelephonyTransferTarget] + :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Required. - :paramtype match_condition: str + :paramtype match_condition: ~azure.core.MatchConditions :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9004,8 +9004,8 @@ def replace_telephony_transfer_targets( agent_name: str, body: IO[bytes], *, - etag: List[_models.TelephonyTransferTarget], - match_condition: str, + etag: str, + match_condition: MatchConditions, content_type: str = "application/json", **kwargs: Any ) -> _models.TelephonyTransferTargets: @@ -9018,9 +9018,9 @@ def replace_telephony_transfer_targets( :param body: Required. :type body: IO[bytes] :keyword etag: check if resource is changed. Set None to skip checking etag. Required. - :paramtype etag: list[~azure.ai.projects.models.TelephonyTransferTarget] + :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Required. - :paramtype match_condition: str + :paramtype match_condition: ~azure.core.MatchConditions :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str diff --git a/sdk/ai/azure-ai-projects/test-resources-post.ps1 b/sdk/ai/azure-ai-projects/test-resources-post.ps1 index ed35fb95c759..0e0c82fab3d3 100644 --- a/sdk/ai/azure-ai-projects/test-resources-post.ps1 +++ b/sdk/ai/azure-ai-projects/test-resources-post.ps1 @@ -174,7 +174,8 @@ if ($deployed) { -PollIntervalSeconds 30 if (-not $ready) { - Write-Warning "The '$deploymentName' deployment did not finish provisioning in time. Live voice-agent tests may fail until it finishes." + Write-Error "The '$deploymentName' deployment did not finish provisioning in time. Live voice-agent tests would fail against a not-ready model." -ErrorAction Continue + exit 1 } } else { diff --git a/sdk/ai/azure-ai-projects/tests.yml b/sdk/ai/azure-ai-projects/tests.yml index 6bd82ae6c75a..d12e553de76d 100644 --- a/sdk/ai/azure-ai-projects/tests.yml +++ b/sdk/ai/azure-ai-projects/tests.yml @@ -10,3 +10,4 @@ extends: EnvVars: AZURE_TEST_RUN_LIVE: 'true' AZURE_TEST_USE_CLI_AUTH: 'true' + TestMarkArgument: 'live_test_only' 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 2a4ff4b69248..9d216a9ceed0 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 @@ -13,11 +13,13 @@ """ import json +import inspect from unittest.mock import MagicMock, patch from urllib.parse import parse_qs, urlparse import pytest from azure.core.credentials import AccessToken +from websockets.typing import Subprotocol from azure.ai.projects._realtime import ( RealtimeConnectionManager, @@ -177,6 +179,53 @@ def test_enter_caller_user_agent_overrides_default_case_insensitive(self): assert "User-Agent" not in headers assert headers["user-agent"] == "custom-user-agent" + def test_enter_source_retains_client_identification_wiring(self): + # Regression guard for the SDK client-identification fix (ported from azure-ai-voicelive + # PR #48848) surviving a future TypeSpec regeneration. `_realtime.py` is a hand-written + # file that is NOT `_patch.py`-named, so it isn't covered by the code generator's own + # "never touch _patch.py" guarantee -- nothing in the TypeSpec emitter is aware this file + # exists. The tests above already fail on a *behavioral* regression (wrong header/query + # value), but they exercise the code through mocks and could, in principle, still pass + # against a rewritten implementation that happens to produce the same observable values by + # a different (less safe) path. This inspects the actual source of `enter()` so a partial + # revert -- one that drops the case-insensitive guard, say, while keeping the header value + # correct for the common case -- is caught directly, independent of the tests above. + source = inspect.getsource(RealtimeConnectionManager.enter) + assert "_USER_AGENT" in source + assert "_has_header_case_insensitive" in source + assert "x-ms-client-sdk" in source + + def test_enter_disables_library_default_user_agent_header(self): + # Regression test: unlike aiohttp (where an explicit "User-Agent" in `headers` already + # takes precedence over its own default), `websockets.sync.client.connect`'s + # `user_agent_header` is a wholly separate mechanism from `additional_headers` -- passing + # our own "User-Agent" there does not suppress it. Without explicitly disabling it, the + # connection would carry two distinct User-Agent-like values. + fake_connection = MagicMock() + with patch("websockets.sync.client.connect", return_value=fake_connection) as mock_connect: + manager = _make_manager() + manager.enter() + manager.__exit__() + + _args, kwargs = mock_connect.call_args + assert kwargs["user_agent_header"] is None + + def test_enter_overrides_caller_supplied_subprotocols_kwarg(self): + # Regression test: subprotocols=[Subprotocol("realtime")] is passed explicitly to + # _ws_connect, so a caller-supplied subprotocols override forwarded through **kwargs would + # otherwise collide ("got multiple values for keyword argument 'subprotocols'"). The + # service requires the "realtime" subprotocol, so the override is dropped rather than + # honored -- matching the async implementation's handling of its equivalent `protocols` + # kwarg. + fake_connection = MagicMock() + with patch("websockets.sync.client.connect", return_value=fake_connection) as mock_connect: + manager = _make_manager(subprotocols=["other"]) + manager.enter() + manager.__exit__() + + _args, kwargs = mock_connect.call_args + assert kwargs["subprotocols"] == [Subprotocol("realtime")] + def test_enter_appends_extra_query_and_headers(self): fake_connection = MagicMock() with patch("websockets.sync.client.connect", return_value=fake_connection) as mock_connect: diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client_async.py b/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client_async.py index 95413ee07612..aa599ba87de8 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client_async.py @@ -13,6 +13,7 @@ """ import json +import inspect from unittest.mock import AsyncMock, MagicMock, patch from urllib.parse import parse_qs, urlparse @@ -142,6 +143,22 @@ async def test_enter_caller_user_agent_overrides_default_case_insensitive(self): assert "User-Agent" not in headers assert headers["user-agent"] == "custom-user-agent" + async def test_enter_source_retains_client_identification_wiring(self): + # Regression guard for the SDK client-identification fix (ported from azure-ai-voicelive + # PR #48848) surviving a future TypeSpec regeneration. `aio/_realtime.py` is a hand-written + # file that is NOT `_patch.py`-named, so it isn't covered by the code generator's own + # "never touch _patch.py" guarantee -- nothing in the TypeSpec emitter is aware this file + # exists. The tests above already fail on a *behavioral* regression (wrong header/query + # value), but they exercise the code through mocks and could, in principle, still pass + # against a rewritten implementation that happens to produce the same observable values by + # a different (less safe) path. This inspects the actual source of `enter()` so a partial + # revert -- one that drops the case-insensitive guard, say, while keeping the header value + # correct for the common case -- is caught directly, independent of the tests above. + source = inspect.getsource(AsyncRealtimeConnectionManager.enter) + assert "_USER_AGENT" in source + assert "_has_header_case_insensitive" in source + assert "x-ms-client-sdk" in source + async def test_enter_rejects_untrusted_connection_url_host(self): manager = _make_manager(connection_url="wss://evil.example.com/steal-token") with pytest.raises(ValueError): diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_conversations.py b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_conversations.py index b19742c76db7..8e70672a6422 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_conversations.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_conversations.py @@ -206,40 +206,44 @@ def test_read_conversation(self, **kwargs): # pylint: disable=too-many-locals fetched_item = conversations.get_agent_conversation_item(_AGENT_NAME, conversation_id, first_item_id) assert fetched_item.get("id") == first_item_id - # The merged whole-call recording, if the session had time to finalize. - if str(conversation.status) == "completed" or conversation.status == "completed": - recording = conversations.get_agent_conversation_audio(_AGENT_NAME, conversation_id) - assert recording.format is not None - if not recording.blob_uri: - audio_bytes = b"".join( - conversations.get_agent_conversation_audio_content(_AGENT_NAME, conversation_id) + # The merged whole-call recording and per-item audio. Completion is a hard requirement + # here (not a soft skip): a cassette recorded before the conversation finalized would + # otherwise let this test pass while silently never exercising any of the four audio + # methods below, hiding a regression in all of them (including permanently, if such a + # response were ever re-recorded). + assert ( + conversation.status == "completed" + ), f"Expected a completed conversation to exercise audio assertions, got {conversation.status!r}" + recording = conversations.get_agent_conversation_audio(_AGENT_NAME, conversation_id) + assert recording.format is not None + if not recording.blob_uri: + audio_bytes = b"".join( + conversations.get_agent_conversation_audio_content(_AGENT_NAME, conversation_id) + ) + assert len(audio_bytes) > 0 + + # A single item's audio, if any item has one. + for item in items: + item_id = item.get("id") + if not item_id: + continue + try: + item_audio = conversations.get_agent_conversation_item_audio( + _AGENT_NAME, conversation_id, item_id ) - assert len(audio_bytes) > 0 - - # A single item's audio, if any item has one. - for item in items: - item_id = item.get("id") - if not item_id: + except HttpResponseError as e: + if e.status_code == 404: continue - try: - item_audio = conversations.get_agent_conversation_item_audio( + raise + assert item_audio.role is not None + if not item_audio.blob_uri: + item_audio_bytes = b"".join( + conversations.get_agent_conversation_item_audio_content( _AGENT_NAME, conversation_id, item_id ) - except HttpResponseError as e: - if e.status_code == 404: - continue - raise - assert item_audio.role is not None - if not item_audio.blob_uri: - item_audio_bytes = b"".join( - conversations.get_agent_conversation_item_audio_content( - _AGENT_NAME, conversation_id, item_id - ) - ) - assert len(item_audio_bytes) > 0 - break - else: - print(f"Conversation did not finalize in time (status={conversation.status}); skipping audio checks.") + ) + assert len(item_audio_bytes) > 0 + break finally: # Deleting a conversation removes it and all of its responses, items, and audio. conversations.delete_agent_conversation(_AGENT_NAME, conversation_id) diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_conversations_async.py b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_conversations_async.py index f036ac5ba61b..7a0c0294f113 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_conversations_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_conversations_async.py @@ -195,46 +195,48 @@ async def test_read_conversation_async(self, **kwargs): # pylint: disable=too-m ) assert fetched_item.get("id") == first_item_id - # The merged whole-call recording, if the session had time to finalize. - if str(conversation.status) == "completed" or conversation.status == "completed": - recording = await conversations.get_agent_conversation_audio(_AGENT_NAME, conversation_id) - assert recording.format is not None - if not recording.blob_uri: - audio_chunks = [ - chunk - async for chunk in await conversations.get_agent_conversation_audio_content( - _AGENT_NAME, conversation_id - ) - ] - assert len(b"".join(audio_chunks)) > 0 - - # A single item's audio, if any item has one. - for item in items: - item_id = item.get("id") - if not item_id: + # The merged whole-call recording and per-item audio. Completion is a hard + # requirement here (not a soft skip): a cassette recorded before the conversation + # finalized would otherwise let this test pass while silently never exercising any + # of the four audio methods below, hiding a regression in all of them (including + # permanently, if such a response were ever re-recorded). + assert ( + conversation.status == "completed" + ), f"Expected a completed conversation to exercise audio assertions, got {conversation.status!r}" + recording = await conversations.get_agent_conversation_audio(_AGENT_NAME, conversation_id) + assert recording.format is not None + if not recording.blob_uri: + audio_chunks = [ + chunk + async for chunk in await conversations.get_agent_conversation_audio_content( + _AGENT_NAME, conversation_id + ) + ] + assert len(b"".join(audio_chunks)) > 0 + + # A single item's audio, if any item has one. + for item in items: + item_id = item.get("id") + if not item_id: + continue + try: + item_audio = await conversations.get_agent_conversation_item_audio( + _AGENT_NAME, conversation_id, item_id + ) + except HttpResponseError as e: + if e.status_code == 404: continue - try: - item_audio = await conversations.get_agent_conversation_item_audio( + raise + assert item_audio.role is not None + if not item_audio.blob_uri: + item_audio_chunks = [ + chunk + async for chunk in await conversations.get_agent_conversation_item_audio_content( _AGENT_NAME, conversation_id, item_id ) - except HttpResponseError as e: - if e.status_code == 404: - continue - raise - assert item_audio.role is not None - if not item_audio.blob_uri: - item_audio_chunks = [ - chunk - async for chunk in await conversations.get_agent_conversation_item_audio_content( - _AGENT_NAME, conversation_id, item_id - ) - ] - assert len(b"".join(item_audio_chunks)) > 0 - break - else: - print( - f"Conversation did not finalize in time (status={conversation.status}); skipping audio checks." - ) + ] + assert len(b"".join(item_audio_chunks)) > 0 + break finally: # Deleting a conversation removes it and all of its responses, items, and audio. await conversations.delete_agent_conversation(_AGENT_NAME, conversation_id) diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_realtime_live.py b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_realtime_live.py index be1a3dcbf8d4..ee4ecfa66052 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_realtime_live.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_realtime_live.py @@ -66,6 +66,7 @@ def _get_weather(city: str) -> str: return json.dumps({"city": city, "condition": "sunny", "temperature_f": 72}) +@pytest.mark.live_test_only @pytest.mark.skipif( not is_live(), reason="Live-only: opens a real WebSocket connection to the realtime service, which cannot " @@ -198,6 +199,8 @@ def test_realtime_function_tool_call(self, **kwargs): adapts into an automated assertion-based form. """ print("\n") + model = kwargs.get("foundry_voice_model_name") + assert model is not None project_client = self.create_client(operation_group="agents", allow_preview=True, **kwargs) agent_name = self._make_agent_name("tool-call") @@ -219,7 +222,7 @@ def test_realtime_function_tool_call(self, **kwargs): agent_name=agent_name, definition=VoiceAgentDefinition( model_type=VoiceModelType.MANAGED, - model="gpt-realtime", + model=model, instructions=( "You are a helpful voice assistant. Use the get_weather tool when the " "caller asks about the weather, then answer using its result." diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_realtime_live_async.py b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_realtime_live_async.py index 8a7a348f96d5..3cce3e057581 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_realtime_live_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_realtime_live_async.py @@ -60,6 +60,7 @@ def _get_weather(city: str) -> str: return json.dumps({"city": city, "condition": "sunny", "temperature_f": 72}) +@pytest.mark.live_test_only @pytest.mark.skipif( not is_live(), reason="Live-only: opens a real WebSocket connection to the realtime service, which cannot " @@ -195,6 +196,8 @@ async def test_realtime_function_tool_call_async(self, **kwargs): assertion-based test. """ print("\n") + model = kwargs.get("foundry_voice_model_name") + assert model is not None project_client = self.create_async_client(operation_group="agents", allow_preview=True, **kwargs) agent_name = self._make_agent_name("tool-call") @@ -216,7 +219,7 @@ async def test_realtime_function_tool_call_async(self, **kwargs): agent_name=agent_name, definition=VoiceAgentDefinition( model_type=VoiceModelType.MANAGED, - model="gpt-realtime", + model=model, instructions=( "You are a helpful voice assistant. Use the get_weather tool when the " "caller asks about the weather, then answer using its result." From 5cafb4ffda3c02cf5c29ceab70aae5c315472132 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Thu, 3 Sep 2026 19:49:36 -0700 Subject: [PATCH 50/56] Fix UnicodeEncodeError crash risk in voice agent samples that print model output sample_voice_agent_generate.py, sample_voice_agent_live_function_tool.py, sample_voice_agent_live_text_conversation(_async).py, and sample_voice_agent_live_audio_conversation_async.py print agent/LLM-generated text (instructions, transcripts) that can contain characters (curly quotes, em-dashes, etc.) outside some legacy, non-Unicode console encodings. When stdout isn't a real interactive console (for example piped or redirected on Windows, falling back to cp1252), a plain print() of that text can raise UnicodeEncodeError and crash the sample outright -- reproduced live in sample_voice_agent_live_audio_conversation_async.py. Fix is scoped locally to each risky print() call site via a small _safe_print helper (duplicated per file, matching this samples folder's existing convention of self-contained, standalone scripts): try a normal print() first, and only on UnicodeEncodeError fall back to replacing the unsupported characters. This is not a global sys.stdout.reconfigure(): this package's own sample_executor.py runs these samples in-process via exec_module() for tests/samples/test_samples.py, so any global stdout mutation at module level would leak into every other sample executed afterward in the same pytest worker. The local, per-call fallback has no effect outside its own print statement. Verified live against the real service, including re-running the exact sample/agent that originally crashed: no exception in any case, and zero data loss (verified via PYTHONUTF8=1, matching how a modern terminal behaves) when the console can actually represent the text; only the pathological legacy-codepage-without-a-real-console case substitutes a placeholder character instead of crashing. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../voice/sample_voice_agent_generate.py | 20 ++++++++++++++++- ...ice_agent_live_audio_conversation_async.py | 22 +++++++++++++++++-- .../sample_voice_agent_live_function_tool.py | 19 +++++++++++++++- ...mple_voice_agent_live_text_conversation.py | 22 +++++++++++++++++-- ...oice_agent_live_text_conversation_async.py | 22 +++++++++++++++++-- 5 files changed, 97 insertions(+), 8 deletions(-) diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_generate.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_generate.py index 24a5ed53261d..dcb3ec7e2ddb 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_generate.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_generate.py @@ -26,6 +26,7 @@ """ import os +import sys from dotenv import load_dotenv from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient @@ -33,6 +34,23 @@ load_dotenv() + +def _safe_print(text: str) -> None: + """Print text that may contain characters the current console can't display. + + The instructions below are model-generated and can contain characters (curly + quotes, em-dashes, etc.) outside some legacy, non-Unicode console encodings + (for example when stdout is piped/redirected on Windows). Rather than crashing + with UnicodeEncodeError, fall back to replacing just the unsupported characters; + a real interactive UTF-8 console prints unaffected. + """ + try: + print(text) + except UnicodeEncodeError: + encoding = sys.stdout.encoding or "ascii" + print(text.encode(encoding, errors="replace").decode(encoding)) + + endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] agent_name = os.environ.get("FOUNDRY_VOICE_AGENT_NAME") or "MyGeneratedVoiceAgent" @@ -42,7 +60,7 @@ ): agent = project_client.agents.generate_agent(GenerateVoiceAgentRequest(kind=AgentKind.VOICE, name=agent_name)) print(f"Generated voice agent: {agent.name}") - print(f"Instructions:\n{agent.versions.latest.definition.instructions}") # type: ignore[attr-defined] + _safe_print(f"Instructions:\n{agent.versions.latest.definition.instructions}") # type: ignore[attr-defined] project_client.agents.delete(agent_name=agent.name) print(f"Deleted voice agent: {agent.name}") diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py index 016d49aa415e..8e5c88a991f2 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py @@ -48,6 +48,7 @@ import concurrent.futures import os import queue +import sys from typing import Any, Final, Optional from dotenv import load_dotenv @@ -73,6 +74,23 @@ load_dotenv() + +def _safe_print(text: str) -> None: + """Print text that may contain characters the current console can't display. + + The agent's replies below are model-generated and can contain characters (curly + quotes, em-dashes, etc.) outside some legacy, non-Unicode console encodings + (for example when stdout is piped/redirected on Windows). Rather than crashing + with UnicodeEncodeError, fall back to replacing just the unsupported characters; + a real interactive UTF-8 console prints unaffected. + """ + try: + print(text) + except UnicodeEncodeError: + encoding = sys.stdout.encoding or "ascii" + print(text.encode(encoding, errors="replace").decode(encoding)) + + # Audio is streamed both ways as PCM16, mono, 24 kHz. _SAMPLE_RATE: Final = 24000 @@ -293,7 +311,7 @@ async def _run_audio_conversation(client: AIProjectClient, agent_name: str) -> O # Each delta is a decoded PCM16 chunk; queue it. ap.queue_audio(event.delta) elif isinstance(event, RealtimeServerEventResponseAudioTranscriptDone): - print(f"Agent: {event.transcript}") + _safe_print(f"Agent: {event.transcript}") elif isinstance(event, RealtimeServerEventResponseDone): response_active = False except (KeyboardInterrupt, asyncio.CancelledError): @@ -329,7 +347,7 @@ async def _read_conversation(client: AIProjectClient, agent_name: str, conversat transcript = " ".join(p for p in parts if p) print(f" - {role} id={item.get('id')}") if transcript: - print(f" {transcript}") + _safe_print(f" {transcript}") async def audio_conversation() -> None: diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_function_tool.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_function_tool.py index cad26e7f1cb9..6f841279e565 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_function_tool.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_function_tool.py @@ -31,6 +31,7 @@ import json import os +import sys from typing import Any, Final, cast from dotenv import load_dotenv @@ -68,6 +69,22 @@ def get_weather(city: str) -> str: return json.dumps({"city": city, "condition": "sunny", "temperature_f": 72}) +def _safe_print(text: str) -> None: + """Print text that may contain characters the current console can't display. + + The agent's reply below is model-generated and can contain characters (curly + quotes, em-dashes, etc.) outside some legacy, non-Unicode console encodings + (for example when stdout is piped/redirected on Windows). Rather than crashing + with UnicodeEncodeError, fall back to replacing just the unsupported characters; + a real interactive UTF-8 console prints unaffected. + """ + try: + print(text) + except UnicodeEncodeError: + encoding = sys.stdout.encoding or "ascii" + print(text.encode(encoding, errors="replace").decode(encoding)) + + def _run_turn_with_tool_support(client: AIProjectClient, agent_name: str, prompt: str) -> None: """Send one turn and resolve any function-call the agent makes before printing its reply. @@ -111,7 +128,7 @@ def _run_turn_with_tool_support(client: AIProjectClient, agent_name: str, prompt elif isinstance(event, RealtimeServerEventResponseTextDone): # The sample agent uses a text-only output modality, so the # reply arrives as output text rather than an audio transcript. - print(f"Agent: {event.text}") + _safe_print(f"Agent: {event.text}") elif isinstance(event, RealtimeServerEventResponseDone): # A response.done that isn't a function call is the final answer for this turn. # Output items surface as plain mappings (open union), so use dict-style access. diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py index 8b650f4f9b57..7433a68c5110 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py @@ -42,6 +42,7 @@ """ import os +import sys from typing import Final, Optional from dotenv import load_dotenv @@ -64,6 +65,23 @@ load_dotenv() + +def _safe_print(text: str) -> None: + """Print text that may contain characters the current console can't display. + + The agent's replies below are model-generated and can contain characters (curly + quotes, em-dashes, etc.) outside some legacy, non-Unicode console encodings + (for example when stdout is piped/redirected on Windows). Rather than crashing + with UnicodeEncodeError, fall back to replacing just the unsupported characters; + a real interactive UTF-8 console prints unaffected. + """ + try: + print(text) + except UnicodeEncodeError: + encoding = sys.stdout.encoding or "ascii" + print(text.encode(encoding, errors="replace").decode(encoding)) + + # Seconds to wait for the agent to finish its reply. _RESPONSE_TIMEOUT: Final = 45 @@ -172,7 +190,7 @@ def pump() -> None: audio_delta_count += 1 player.play(event.delta) elif isinstance(event, RealtimeServerEventResponseAudioTranscriptDone): - print(f"Agent: {event.transcript}") + _safe_print(f"Agent: {event.transcript}") while True: prompt = input("You: ").strip() @@ -224,7 +242,7 @@ def _read_conversation(client: AIProjectClient, agent_name: str, conversation_id transcript = " ".join(p for p in parts if p) print(f" - {role} id={item.get('id')}") if transcript: - print(f" {transcript}") + _safe_print(f" {transcript}") def text_conversation() -> None: diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py index 710158b0740b..aaa1b15b3f18 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py @@ -40,6 +40,7 @@ import asyncio import os +import sys from typing import Final, Optional from dotenv import load_dotenv @@ -62,6 +63,23 @@ load_dotenv() + +def _safe_print(text: str) -> None: + """Print text that may contain characters the current console can't display. + + The agent's replies below are model-generated and can contain characters (curly + quotes, em-dashes, etc.) outside some legacy, non-Unicode console encodings + (for example when stdout is piped/redirected on Windows). Rather than crashing + with UnicodeEncodeError, fall back to replacing just the unsupported characters; + a real interactive UTF-8 console prints unaffected. + """ + try: + print(text) + except UnicodeEncodeError: + encoding = sys.stdout.encoding or "ascii" + print(text.encode(encoding, errors="replace").decode(encoding)) + + # Seconds to wait for the agent to finish its reply. _RESPONSE_TIMEOUT: Final = 45 @@ -163,7 +181,7 @@ async def pump() -> None: audio_delta_count += 1 player.play(event.delta) elif isinstance(event, RealtimeServerEventResponseAudioTranscriptDone): - print(f"Agent: {event.transcript}") + _safe_print(f"Agent: {event.transcript}") while True: # input() blocks, so read it off the loop in a worker thread. @@ -223,7 +241,7 @@ async def _read_conversation(client: AIProjectClient, agent_name: str, conversat transcript = " ".join(p for p in parts if p) print(f" - {role} id={item.get('id')}") if transcript: - print(f" {transcript}") + _safe_print(f" {transcript}") async def text_conversation() -> None: From 954026dd77c066e1d5d012716a9968a88ada1805 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Thu, 3 Sep 2026 21:20:31 -0700 Subject: [PATCH 51/56] Improve voice agent sample code quality - Replace hardcoded agent names with FOUNDRY_VOICE_AGENT_NAME env var (sample_voice_agent_versions.py, sample_voice_agent_with_tools.py) - Use FOUNDRY_VOICE_MODEL env var instead of hardcoded model name (sample_voice_agent_live_function_tool.py) - Use typed isinstance checks instead of dict/getattr dual-path access for conversation items and tools, since the SDK deserializes these to real typed model instances, not raw mappings (sample_voice_agent_live_function_tool.py, sample_voice_agent_with_tools.py) - Remove unnecessary discriminator kwarg and its type: ignore suppression when constructing VoiceAgentMcpTool (sample_voice_agent_with_tools.py) - Update docstrings for the newly-documented environment variables All 3 changes verified end-to-end against the live service. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../voice/sample_voice_agent_live_function_tool.py | 12 +++++++----- .../agents/voice/sample_voice_agent_versions.py | 4 +++- .../agents/voice/sample_voice_agent_with_tools.py | 14 +++++++------- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_function_tool.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_function_tool.py index 6f841279e565..9ac75ba8e5ff 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_function_tool.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_function_tool.py @@ -24,7 +24,9 @@ Set these environment variables with your own values: 1) FOUNDRY_PROJECT_ENDPOINT - The Azure AI Project endpoint. - 2) FOUNDRY_VOICE_AGENT_NAME - Optional. Name for the sample voice agent + 2) FOUNDRY_VOICE_MODEL - Optional. The realtime model deployment name. + Defaults to "gpt-realtime". + 3) FOUNDRY_VOICE_AGENT_NAME - Optional. Name for the sample voice agent created and deleted by this script. Defaults to "sample-voice-agent-function-tool". """ @@ -38,6 +40,7 @@ from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( + RealtimeConversationItemFunctionCall, RealtimeConversationItemFunctionCallOutput, RealtimeConversationItemMessageUser, RealtimeConversationItemMessageUserContent, @@ -131,10 +134,8 @@ def _run_turn_with_tool_support(client: AIProjectClient, agent_name: str, prompt _safe_print(f"Agent: {event.text}") elif isinstance(event, RealtimeServerEventResponseDone): # A response.done that isn't a function call is the final answer for this turn. - # Output items surface as plain mappings (open union), so use dict-style access. if not any( - (item.get("type") if isinstance(item, dict) else getattr(item, "type", None)) == "function_call" - for item in (event.response.output or []) + isinstance(item, RealtimeConversationItemFunctionCall) for item in (event.response.output or []) ): return elif isinstance(event, RealtimeServerEventError): @@ -144,6 +145,7 @@ def _run_turn_with_tool_support(client: AIProjectClient, agent_name: str, prompt def main() -> None: endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] + model = os.environ.get("FOUNDRY_VOICE_MODEL") or "gpt-realtime" agent_name = os.environ.get("FOUNDRY_VOICE_AGENT_NAME") or "sample-voice-agent-function-tool" get_weather_tool = VoiceAgentFunctionTool( @@ -168,7 +170,7 @@ def main() -> None: agent_name=agent_name, definition=VoiceAgentDefinition( model_type=VoiceModelType.MANAGED, - model="gpt-realtime", + model=model, instructions=( "You are a helpful voice assistant. Use the get_weather tool when the " "caller asks about the weather, then answer using its result." diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_versions.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_versions.py index 7a381a837056..d2d6c05ada6b 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_versions.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_versions.py @@ -22,6 +22,8 @@ 1) FOUNDRY_PROJECT_ENDPOINT - The Azure AI Project endpoint. 2) FOUNDRY_VOICE_MODEL - Optional. The realtime model deployment name. Defaults to "gpt-realtime". + 3) FOUNDRY_VOICE_AGENT_NAME - Optional. The name of the voice agent. If not + set, defaults to "sample-versioned-voice-agent". """ import os @@ -34,7 +36,7 @@ endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] model = os.environ.get("FOUNDRY_VOICE_MODEL") or "gpt-realtime" -agent_name = "sample-versioned-voice-agent" +agent_name = os.environ.get("FOUNDRY_VOICE_AGENT_NAME") or "sample-versioned-voice-agent" def make_definition(instructions: str) -> VoiceAgentDefinition: diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_with_tools.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_with_tools.py index 598c465d23d5..02d923b02810 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_with_tools.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_with_tools.py @@ -30,6 +30,8 @@ Foundry deployment name (BYOM). Defaults to "gpt-realtime". 3) FOUNDRY_VOICE_MODEL_TYPE - Optional. "managed" (default) for a service-hosted model, or "self_deployed" to bring your own deployment. + 4) FOUNDRY_VOICE_AGENT_NAME - Optional. The name of the voice agent. If not + set, defaults to "sample-voice-agent-with-tools". """ import os @@ -40,7 +42,6 @@ from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( RealtimeAudioFormatsAudioPcm, - ToolType, VoiceAgentDefinition, VoiceAgentFunctionTool, VoiceAgentMcpTool, @@ -66,7 +67,7 @@ # Foundry deployment named by `model`. The service derives whether the model is # realtime or cascaded; you don't set that here. model_type = os.environ.get("FOUNDRY_VOICE_MODEL_TYPE") or VoiceModelType.MANAGED -agent_name = "sample-voice-agent-with-tools" +agent_name = os.environ.get("FOUNDRY_VOICE_AGENT_NAME") or "sample-voice-agent-with-tools" # A client-executed tool: the service forwards the function call to your app, # and your app returns the result over the live session. @@ -90,11 +91,10 @@ # It references an external server, so it is constructed here for illustration # and not attached below. Provide one of server_url, connector_id, or tunnel_id. _example_mcp_tool = VoiceAgentMcpTool( - type=ToolType.MCP, server_label="my-mcp-server", server_url="https://example.com/mcp", require_approval="never", -) # type: ignore[call-overload] +) # A toolbox tool references a versioned Foundry toolbox you have created. It is # constructed here for illustration; attach it only if the toolbox exists. @@ -139,9 +139,9 @@ tools = agent_version.definition.tools or [] # type: ignore[attr-defined] print(f"Configured {len(tools)} tool(s):") for tool in tools: - # Tools belong to an open union, so on read they surface as mappings - # keyed by their wire fields (``type`` and, for most kinds, ``name``). - print(f" - {tool['type']}: {tool.get('name', '(unnamed)')}") + # `name` isn't declared on every tool kind (e.g. MCP tools have no `name`), + # so fall back to a placeholder for kinds that don't define it. + print(f" - {tool.type}: {getattr(tool, 'name', '(unnamed)')}") finally: project_client.agents.delete(agent_name=agent_name) print(f"Deleted voice agent: {agent_name}") From 072d33d5fdae128a6526282cad5521cd442f602b Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Thu, 3 Sep 2026 23:20:56 -0700 Subject: [PATCH 52/56] Resolve PR review comments: pin live-test region, restore open-union safety check - tests.yml: add Location: eastus2. The shared archetype-sdk-tests template defaults this cloud's region to westus when unset, but gpt-realtime (GlobalStandard, 2025-08-28) is only deployable in eastus2/centralus/ canadacentral per the official Azure OpenAI region-availability docs, so resource provisioning was failing before any live test could run. - sample_voice_agent_live_function_tool.py: restore the dict/getattr dual-path check for identifying a function-call item in response.done's output list, in place of a pure isinstance() check introduced by an earlier cleanup pass. response.output is a documented open/extensible union; an item kind not yet mapped by this SDK version can surface as a plain mapping instead of a typed model, and the isinstance-only check would silently mistake the first tool-call turn for the final answer, closing the connection before the tool result is ever sent. Matches the same defensive pattern already used by the SDK's own test_voice_agent_realtime_live.py live test. Both changes verified: tests.yml against a live re-run of the affected pytest suite; the sample against a fresh live get_weather tool-call round-trip. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../agents/voice/sample_voice_agent_live_function_tool.py | 7 +++++-- sdk/ai/azure-ai-projects/tests.yml | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_function_tool.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_function_tool.py index 9ac75ba8e5ff..1386c85401a3 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_function_tool.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_function_tool.py @@ -40,7 +40,6 @@ from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( - RealtimeConversationItemFunctionCall, RealtimeConversationItemFunctionCallOutput, RealtimeConversationItemMessageUser, RealtimeConversationItemMessageUserContent, @@ -134,8 +133,12 @@ def _run_turn_with_tool_support(client: AIProjectClient, agent_name: str, prompt _safe_print(f"Agent: {event.text}") elif isinstance(event, RealtimeServerEventResponseDone): # A response.done that isn't a function call is the final answer for this turn. + # Output items are typed models in the tested scenarios here, but the underlying + # union is open (forward-compatible with item kinds this SDK doesn't map yet), so + # an unrecognized kind could still surface as a plain mapping; check both. if not any( - isinstance(item, RealtimeConversationItemFunctionCall) for item in (event.response.output or []) + (item.get("type") if isinstance(item, dict) else getattr(item, "type", None)) == "function_call" + for item in (event.response.output or []) ): return elif isinstance(event, RealtimeServerEventError): diff --git a/sdk/ai/azure-ai-projects/tests.yml b/sdk/ai/azure-ai-projects/tests.yml index d12e553de76d..ff842e5c9da1 100644 --- a/sdk/ai/azure-ai-projects/tests.yml +++ b/sdk/ai/azure-ai-projects/tests.yml @@ -7,6 +7,10 @@ extends: ServiceDirectory: ai TestResourceDirectories: - ai/azure-ai-projects + # gpt-realtime (GlobalStandard) is only deployable in a handful of regions (e.g. eastus2, + # centralus, canadacentral); the shared template's default region for this cloud (westus) + # does not support it, which would fail resource provisioning before any test runs. + Location: 'eastus2' EnvVars: AZURE_TEST_RUN_LIVE: 'true' AZURE_TEST_USE_CLI_AUTH: 'true' From 634ba125edeaf8621b0f7ab25552aee2e55490a6 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Fri, 4 Sep 2026 11:01:46 -0700 Subject: [PATCH 53/56] Part 1: Emit SDK from TypeSpec Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../azure-ai-projects/apiview-properties.json | 60 +- .../azure/ai/projects/_client.py | 6 + .../azure/ai/projects/aio/_client.py | 6 + .../ai/projects/aio/operations/__init__.py | 2 + .../ai/projects/aio/operations/_operations.py | 2167 ++++++------- .../azure/ai/projects/models/__init__.py | 18 +- .../azure/ai/projects/models/_enums.py | 32 +- .../azure/ai/projects/models/_models.py | 192 +- .../azure/ai/projects/operations/__init__.py | 2 + .../ai/projects/operations/_operations.py | 2684 +++++++++-------- .../agents/test_voice_agent_conversations.py | 18 +- .../test_voice_agent_realtime_live_async.py | 1 - .../tests/samples/test_samples.py | 1 - sdk/ai/azure-ai-projects/tsp-location.yaml | 30 + 14 files changed, 2730 insertions(+), 2489 deletions(-) create mode 100644 sdk/ai/azure-ai-projects/tsp-location.yaml diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index e49566ae652f..fad6f111ccdf 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -314,6 +314,8 @@ "azure.ai.projects.models.TelephonyTransferDestination": "Azure.AI.Projects.TelephonyTransferDestination", "azure.ai.projects.models.PSTNTelephonyTransferDestination": "Azure.AI.Projects.PSTNTelephonyTransferDestination", "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", "azure.ai.projects.models.RankingOptions": "OpenAI.RankingOptions", "azure.ai.projects.models.RealtimeAudioFormats": "OpenAI.RealtimeAudioFormats", "azure.ai.projects.models.RealtimeAudioFormatsAudioPcm": "OpenAI.RealtimeAudioFormatsAudioPcm", @@ -563,8 +565,8 @@ "azure.ai.projects.models.VoiceAgentSessionResponseConfig": "Azure.AI.Projects.VoiceAgentSessionResponseConfig", "azure.ai.projects.models.VoiceAgentSessionUpdateConfig": "Azure.AI.Projects.VoiceAgentSessionUpdateConfig", "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", + "azure.ai.projects.models.VoiceAgentSubagent": "Azure.AI.Projects.VoiceAgentSubagent", + "azure.ai.projects.models.VoiceAgentSubagentConfig": "Azure.AI.Projects.VoiceAgentSubagentConfig", "azure.ai.projects.models.VoiceAgentSubagentResponsePolicy": "Azure.AI.Projects.VoiceAgentSubagentResponsePolicy", "azure.ai.projects.models.VoiceAgentSystemTool": "Azure.AI.Projects.VoiceAgentSystemTool", "azure.ai.projects.models.VoiceAgentTemplateGreetingConfig": "Azure.AI.Projects.VoiceAgentTemplateGreetingConfig", @@ -594,19 +596,7 @@ "azure.ai.projects.models.WorkflowAgentDefinition": "Azure.AI.Projects.WorkflowAgentDefinition", "azure.ai.projects.models.WorkIQPreviewTool": "Azure.AI.Projects.WorkIQPreviewTool", "azure.ai.projects.models.WorkIQPreviewToolboxTool": "Azure.AI.Projects.WorkIQPreviewToolboxTool", - "azure.ai.projects.models.VoiceAgentWebSocketSubprotocol": "Azure.AI.Projects.VoiceAgentWebSocketSubprotocol", - "azure.ai.projects.models._AgentDefinitionOptInKeys": "Azure.AI.Projects.AgentDefinitionOptInKeys", - "azure.ai.projects.models.VoiceAgentTransport": "Azure.AI.Projects.VoiceAgentTransport", - "azure.ai.projects.models.VoiceConversationStatus": "Azure.AI.Projects.VoiceConversationStatus", "azure.ai.projects.models.PageOrder": "Azure.AI.Projects.PageOrder", - "azure.ai.projects.models.RealtimeConversationItemType": "OpenAI.RealtimeConversationItemType", - "azure.ai.projects.models.RealtimeMcpErrorType": "OpenAI.RealtimeMcpErrorType", - "azure.ai.projects.models.RealtimeConversationItemMessageType": "OpenAI.RealtimeConversationItemMessageType", - "azure.ai.projects.models.VoiceType": "Azure.AI.Projects.VoiceType", - "azure.ai.projects.models.RealtimeAudioFormatsType": "OpenAI.RealtimeAudioFormatsType", - "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.AgentInsightOverviewSource": "Azure.AI.Projects.AgentInsightOverviewSource", "azure.ai.projects.models.JobStatus": "Azure.AI.Projects.JobStatus", "azure.ai.projects.models.AgentInsightRunTrigger": "Azure.AI.Projects.AgentInsightRunTrigger", @@ -682,6 +672,8 @@ "azure.ai.projects.models.AgentState": "Azure.AI.Projects.AgentState", "azure.ai.projects.models.AgentStateSource": "Azure.AI.Projects.AgentStateSource", "azure.ai.projects.models.AgentKind": "Azure.AI.Projects.AgentKind", + "azure.ai.projects.models.RaiInvocationContentType": "Azure.AI.Projects.RaiInvocationContentType", + "azure.ai.projects.models.RaiInvocationMode": "Azure.AI.Projects.RaiInvocationMode", "azure.ai.projects.models.AgentEndpointProtocol": "Azure.AI.Projects.AgentEndpointProtocol", "azure.ai.projects.models.CodeDependencyResolution": "Azure.AI.Projects.CodeDependencyResolution", "azure.ai.projects.models.TelemetryEndpointKind": "Azure.AI.Projects.TelemetryEndpointKind", @@ -693,12 +685,14 @@ "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.RealtimeAudioFormatsType": "OpenAI.RealtimeAudioFormatsType", "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.VoiceType": "Azure.AI.Projects.VoiceType", "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", @@ -738,6 +732,16 @@ "azure.ai.projects.models.DatasetType": "Azure.AI.Projects.DatasetType", "azure.ai.projects.models.DeploymentType": "Azure.AI.Projects.DeploymentType", "azure.ai.projects.models.IndexType": "Azure.AI.Projects.IndexType", + "azure.ai.projects.models.VoiceAgentWebSocketSubprotocol": "Azure.AI.Projects.VoiceAgentWebSocketSubprotocol", + "azure.ai.projects.models._AgentDefinitionOptInKeys": "Azure.AI.Projects.AgentDefinitionOptInKeys", + "azure.ai.projects.models.VoiceAgentTransport": "Azure.AI.Projects.VoiceAgentTransport", + "azure.ai.projects.models.VoiceConversationStatus": "Azure.AI.Projects.VoiceConversationStatus", + "azure.ai.projects.models.RealtimeConversationItemType": "OpenAI.RealtimeConversationItemType", + "azure.ai.projects.models.RealtimeMcpErrorType": "OpenAI.RealtimeMcpErrorType", + "azure.ai.projects.models.RealtimeConversationItemMessageType": "OpenAI.RealtimeConversationItemMessageType", + "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.ToolboxToolType": "Azure.AI.Projects.ToolboxToolType", "azure.ai.projects.models.MemoryStoreUpdateStatus": "Azure.AI.Projects.MemoryStoreUpdateStatus", "azure.ai.projects.models.VoiceAgentAnimationOutputType": "Azure.AI.Projects.VoiceAgentAnimationOutputType", @@ -859,10 +863,36 @@ "azure.ai.projects.aio.operations.IndexesOperations.delete": "Azure.AI.Projects.Indexes.deleteVersion", "azure.ai.projects.operations.IndexesOperations.create_or_update": "Azure.AI.Projects.Indexes.createOrUpdateVersion", "azure.ai.projects.aio.operations.IndexesOperations.create_or_update": "Azure.AI.Projects.Indexes.createOrUpdateVersion", + "azure.ai.projects.operations.VoiceAgentWebSocketOperations.connect_voice_agent": "Azure.AI.Projects.VoiceAgentWebSocket.connectVoiceAgent", + "azure.ai.projects.aio.operations.VoiceAgentWebSocketOperations.connect_voice_agent": "Azure.AI.Projects.VoiceAgentWebSocket.connectVoiceAgent", + "azure.ai.projects.operations.AgentEndpointConversationsOperations.list_agent_conversations": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversations", + "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.list_agent_conversations": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversations", + "azure.ai.projects.operations.AgentEndpointConversationsOperations.get_agent_conversation": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversation", + "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversation", + "azure.ai.projects.operations.AgentEndpointConversationsOperations.delete_agent_conversation": "Azure.AI.Projects.AgentEndpointConversations.deleteAgentConversation", + "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.delete_agent_conversation": "Azure.AI.Projects.AgentEndpointConversations.deleteAgentConversation", + "azure.ai.projects.operations.AgentEndpointConversationsOperations.list_agent_conversation_responses": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversationResponses", + "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.list_agent_conversation_responses": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversationResponses", + "azure.ai.projects.operations.AgentEndpointConversationsOperations.get_agent_conversation_response": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationResponse", + "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_response": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationResponse", + "azure.ai.projects.operations.AgentEndpointConversationsOperations.list_agent_conversation_response_items": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversationResponseItems", + "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.list_agent_conversation_response_items": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversationResponseItems", + "azure.ai.projects.operations.AgentEndpointConversationsOperations.list_agent_conversation_items": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversationItems", + "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.list_agent_conversation_items": "Azure.AI.Projects.AgentEndpointConversations.listAgentConversationItems", + "azure.ai.projects.operations.AgentEndpointConversationsOperations.get_agent_conversation_item": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItem", + "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_item": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItem", + "azure.ai.projects.operations.AgentEndpointConversationsOperations.get_agent_conversation_item_audio": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItemAudio", + "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_item_audio": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItemAudio", + "azure.ai.projects.operations.AgentEndpointConversationsOperations.get_agent_conversation_item_audio_content": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItemAudioContent", + "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_item_audio_content": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItemAudioContent", "azure.ai.projects.operations.AgentEndpointConversationsOperations.get_agent_conversation_item_generated_audio": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItemGeneratedAudio", "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_item_generated_audio": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItemGeneratedAudio", "azure.ai.projects.operations.AgentEndpointConversationsOperations.get_agent_conversation_item_generated_audio_content": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItemGeneratedAudioContent", "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_item_generated_audio_content": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationItemGeneratedAudioContent", + "azure.ai.projects.operations.AgentEndpointConversationsOperations.get_agent_conversation_audio": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationAudio", + "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_audio": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationAudio", + "azure.ai.projects.operations.AgentEndpointConversationsOperations.get_agent_conversation_audio_content": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationAudioContent", + "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_audio_content": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationAudioContent", "azure.ai.projects.operations.ToolboxesOperations.create_version": "Azure.AI.Projects.Toolboxes.createToolboxVersion", "azure.ai.projects.aio.operations.ToolboxesOperations.create_version": "Azure.AI.Projects.Toolboxes.createToolboxVersion", "azure.ai.projects.operations.ToolboxesOperations.get": "Azure.AI.Projects.Toolboxes.getToolbox", @@ -880,5 +910,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": "7b61074c22c0" + "CrossLanguageVersion": "6af4ed96e11d" } \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py index 9c1e0f4dfd89..328fba1bb90c 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py @@ -26,6 +26,7 @@ EvaluationRulesOperations, IndexesOperations, ToolboxesOperations, + VoiceAgentWebSocketOperations, ) if sys.version_info >= (3, 11): @@ -54,6 +55,8 @@ class AIProjectClient: # pylint: disable=too-many-instance-attributes,docstring :vartype deployments: azure.ai.projects.operations.DeploymentsOperations :ivar indexes: IndexesOperations operations :vartype indexes: azure.ai.projects.operations.IndexesOperations + :ivar voice_agent_web_socket: VoiceAgentWebSocketOperations operations + :vartype voice_agent_web_socket: azure.ai.projects.operations.VoiceAgentWebSocketOperations :ivar agent_endpoint_conversations: AgentEndpointConversationsOperations operations :vartype agent_endpoint_conversations: azure.ai.projects.operations.AgentEndpointConversationsOperations @@ -117,6 +120,9 @@ def __init__( self.datasets = DatasetsOperations(self._client, self._config, self._serialize, self._deserialize) self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) self.indexes = IndexesOperations(self._client, self._config, self._serialize, self._deserialize) + self.voice_agent_web_socket = VoiceAgentWebSocketOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.agent_endpoint_conversations = AgentEndpointConversationsOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py index fd5065a3aa8a..f6b03dd7f446 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py @@ -26,6 +26,7 @@ EvaluationRulesOperations, IndexesOperations, ToolboxesOperations, + VoiceAgentWebSocketOperations, ) if sys.version_info >= (3, 11): @@ -54,6 +55,8 @@ class AIProjectClient: # pylint: disable=too-many-instance-attributes,docstring :vartype deployments: azure.ai.projects.aio.operations.DeploymentsOperations :ivar indexes: IndexesOperations operations :vartype indexes: azure.ai.projects.aio.operations.IndexesOperations + :ivar voice_agent_web_socket: VoiceAgentWebSocketOperations operations + :vartype voice_agent_web_socket: azure.ai.projects.aio.operations.VoiceAgentWebSocketOperations :ivar agent_endpoint_conversations: AgentEndpointConversationsOperations operations :vartype agent_endpoint_conversations: azure.ai.projects.aio.operations.AgentEndpointConversationsOperations @@ -117,6 +120,9 @@ def __init__( self.datasets = DatasetsOperations(self._client, self._config, self._serialize, self._deserialize) self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) self.indexes = IndexesOperations(self._client, self._config, self._serialize, self._deserialize) + self.voice_agent_web_socket = VoiceAgentWebSocketOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.agent_endpoint_conversations = AgentEndpointConversationsOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/__init__.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/__init__.py index bab1be543cc5..9a9972c6e723 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/__init__.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/__init__.py @@ -19,6 +19,7 @@ from ._operations import DatasetsOperations # type: ignore from ._operations import DeploymentsOperations # type: ignore from ._operations import IndexesOperations # type: ignore +from ._operations import VoiceAgentWebSocketOperations # type: ignore from ._operations import AgentEndpointConversationsOperations # type: ignore from ._operations import ToolboxesOperations # type: ignore @@ -34,6 +35,7 @@ "DatasetsOperations", "DeploymentsOperations", "IndexesOperations", + "VoiceAgentWebSocketOperations", "AgentEndpointConversationsOperations", "ToolboxesOperations", ] 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 ca9b4e11ff5c..0f8c4c284fc3 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 @@ -40,8 +40,20 @@ from ..._utils.utils import prepare_multipart_form_data from ...models._enums import _AgentDefinitionOptInKeys from ...operations._operations import ( + build_agent_endpoint_conversations_delete_agent_conversation_request, + build_agent_endpoint_conversations_get_agent_conversation_audio_content_request, + build_agent_endpoint_conversations_get_agent_conversation_audio_request, + build_agent_endpoint_conversations_get_agent_conversation_item_audio_content_request, + build_agent_endpoint_conversations_get_agent_conversation_item_audio_request, build_agent_endpoint_conversations_get_agent_conversation_item_generated_audio_content_request, build_agent_endpoint_conversations_get_agent_conversation_item_generated_audio_request, + build_agent_endpoint_conversations_get_agent_conversation_item_request, + build_agent_endpoint_conversations_get_agent_conversation_request, + build_agent_endpoint_conversations_get_agent_conversation_response_request, + build_agent_endpoint_conversations_list_agent_conversation_items_request, + build_agent_endpoint_conversations_list_agent_conversation_response_items_request, + build_agent_endpoint_conversations_list_agent_conversation_responses_request, + build_agent_endpoint_conversations_list_agent_conversations_request, build_agents_create_session_request, build_agents_create_telephony_binding_request, build_agents_create_version_from_code_request, @@ -80,18 +92,6 @@ build_agents_update_details_request, build_agents_update_telephony_binding_request, build_agents_upload_session_file_request, - build_beta_agent_endpoint_conversations_delete_agent_conversation_request, - build_beta_agent_endpoint_conversations_get_agent_conversation_audio_content_request, - build_beta_agent_endpoint_conversations_get_agent_conversation_audio_request, - build_beta_agent_endpoint_conversations_get_agent_conversation_item_audio_content_request, - build_beta_agent_endpoint_conversations_get_agent_conversation_item_audio_request, - build_beta_agent_endpoint_conversations_get_agent_conversation_item_request, - build_beta_agent_endpoint_conversations_get_agent_conversation_request, - build_beta_agent_endpoint_conversations_get_agent_conversation_response_request, - build_beta_agent_endpoint_conversations_list_agent_conversation_items_request, - build_beta_agent_endpoint_conversations_list_agent_conversation_response_items_request, - build_beta_agent_endpoint_conversations_list_agent_conversation_responses_request, - build_beta_agent_endpoint_conversations_list_agent_conversations_request, build_beta_agent_insight_monitors_cancel_run_request, build_beta_agent_insight_monitors_create_request, build_beta_agent_insight_monitors_create_run_request, @@ -185,7 +185,6 @@ build_beta_skills_list_request, build_beta_skills_list_versions_request, build_beta_skills_update_request, - build_beta_voice_agent_web_socket_connect_voice_agent_request, build_connections_get_request, build_connections_get_with_credentials_request, build_connections_list_request, @@ -215,6 +214,7 @@ build_toolboxes_list_request, build_toolboxes_list_versions_request, build_toolboxes_update_request, + build_voice_agent_web_socket_connect_voice_agent_request, ) from .._configuration import AIProjectClientConfiguration @@ -244,9 +244,6 @@ def __init__(self, *args, **kwargs) -> None: 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") - self.agent_endpoint_conversations = BetaAgentEndpointConversationsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.agent_insight_monitors = BetaAgentInsightMonitorsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -349,8 +346,27 @@ async def get(self, agent_name: str, **kwargs: Any) -> _models.AgentDetails: return deserialized # type: ignore + @overload + async def generate_agent( + self, body: _models.GenerateVoiceAgentRequest, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AgentDetails: + """Generate an agent. + + Generates and creates an agent from kind-specific high-level inputs. The generated definition + remains fully editable through the standard agent versioning operations. + + :param body: The kind-specific inputs for generating and creating an agent. Required. + :type body: ~azure.ai.projects.models.GenerateVoiceAgentRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AgentDetails. The AgentDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace_async - async def generate_agent(self, body: _models.GenerateVoiceAgentRequest, **kwargs: Any) -> _models.AgentDetails: + async def generate_agent(self, body: "_unions.GenerateAgentRequest", **kwargs: Any) -> _models.AgentDetails: """Generate an agent. Generates and creates an agent from kind-specific high-level inputs. The generated definition @@ -2233,23 +2249,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. @@ -2291,8 +2313,7 @@ async def get_session_log_stream( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - kwargs.pop("stream", None) # must always stream; discard any caller override - _stream = True + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -4245,8 +4266,8 @@ async def replace_telephony_transfer_targets( agent_name: str, body: JSON, *, - etag: str, - match_condition: MatchConditions, + etag: List[_models.TelephonyTransferTarget], + match_condition: str, content_type: str = "application/json", **kwargs: Any ) -> _models.TelephonyTransferTargets: @@ -4259,9 +4280,9 @@ async def replace_telephony_transfer_targets( :param body: Required. :type body: JSON :keyword etag: check if resource is changed. Set None to skip checking etag. Required. - :paramtype etag: str + :paramtype etag: list[~azure.ai.projects.models.TelephonyTransferTarget] :keyword match_condition: The match condition to use upon the etag. Required. - :paramtype match_condition: ~azure.core.MatchConditions + :paramtype match_condition: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4277,8 +4298,8 @@ async def replace_telephony_transfer_targets( agent_name: str, body: IO[bytes], *, - etag: str, - match_condition: MatchConditions, + etag: List[_models.TelephonyTransferTarget], + match_condition: str, content_type: str = "application/json", **kwargs: Any ) -> _models.TelephonyTransferTargets: @@ -4291,9 +4312,9 @@ async def replace_telephony_transfer_targets( :param body: Required. :type body: IO[bytes] :keyword etag: check if resource is changed. Set None to skip checking etag. Required. - :paramtype etag: str + :paramtype etag: list[~azure.ai.projects.models.TelephonyTransferTarget] :keyword match_condition: The match condition to use upon the etag. Required. - :paramtype match_condition: ~azure.core.MatchConditions + :paramtype match_condition: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -6854,14 +6875,14 @@ async def create_or_update( return deserialized # type: ignore -class AgentEndpointConversationsOperations: # pylint: disable=docstring-missing-param +class VoiceAgentWebSocketOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.ai.projects.aio.AIProjectClient`'s - :attr:`agent_endpoint_conversations` attribute. + :attr:`voice_agent_web_socket` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -6872,108 +6893,90 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get_agent_conversation_item_generated_audio( # pylint: disable=name-too-long - self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any - ) -> _models.VoiceGeneratedItemAudioResponse: - """Get a voice agent conversation item's generated audio metadata. - - Returns metadata for a conversation item's generated audio. This subordinate artifact is - separate from the canonical heard-audio segment and exists only when playback was interrupted - and the service rendered more audio than the listener heard, including when the response ends - as cancelled. Returns ``404`` when the conversation or item was not persisted, or when no - generated audio exists beyond the heard segment. - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the item. Required. - :type conversation_id: str - :param item_id: The id of the conversation item whose generated audio metadata is retrieved. - Required. - :type item_id: str - :return: VoiceGeneratedItemAudioResponse. The VoiceGeneratedItemAudioResponse is compatible - with MutableMapping - :rtype: ~azure.ai.projects.models.VoiceGeneratedItemAudioResponse - :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.VoiceGeneratedItemAudioResponse] = kwargs.pop("cls", None) - - _request = build_agent_endpoint_conversations_get_agent_conversation_item_generated_audio_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) + async def connect_voice_agent( + self, + agent_name: str, + *, + foundry_features_query: Optional[Literal[_AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW]] = None, + transport: Optional[Union[str, _models.VoiceAgentTransport]] = None, + store: Optional[bool] = None, + structured_input: Optional[str] = None, + agent_version_override: Optional[str] = None, + websocket_subprotocol: Optional[Union[str, _models.VoiceAgentWebSocketSubprotocol]] = None, + **kwargs: Any + ) -> None: + """Connect to a voice agent. - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.VoiceGeneratedItemAudioResponse, response.json()) + Connects to a voice agent over WebSocket. The client must send an HTTP GET with ``Upgrade: + websocket`` + headers. The optional ``realtime`` subprotocol is the only accepted subprotocol value. Supply + the + ``VoiceAgents=V1Preview`` opt-in through either the ``Foundry-Features`` header or the + ``foundry_features`` + query parameter. - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + Handshake failures are evaluated in the following order, independent of the requested + ``transport``: - return deserialized # type: ignore - @distributed_trace_async - async def get_agent_conversation_item_generated_audio_content( # pylint: disable=name-too-long - self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - """Stream a voice agent conversation item's generated audio. - Streams a conversation item's generated audio as a WAV (``audio/wav``) byte stream through the - service. This subordinate artifact exists only when playback was interrupted and the service - rendered more audio than the listener heard, including when the response ends as cancelled. - This route serves Foundry-managed storage only. For bring-your-own-storage (BYOS) recordings - the bytes are not proxied, so this route returns ``409 Conflict``. Returns ``404`` when the - conversation or item was not persisted, or when no generated audio exists beyond the heard - segment. + 1. Agent enablement (any transport): if the target agent is disabled, the handshake fails + before the + `101 Switching Protocols` upgrade with `409 Conflict`, using the shared Foundry + `ApiErrorResponse` shape + with `error.code = agent_disabled`. This failure is terminal until the caller enables the + agent, and it + takes precedence over the WebRTC-specific checks below. + 2. WebRTC availability (only when `transport=webrtc`, and only once the agent itself is + enabled): the agent + must have the WebRTC transport capability configured. If the agent is enabled but WebRTC is not + available + for it, the handshake fails with `404 Not Found`. This is distinct from the `409 + agent_disabled` case + above, which concerns the agent itself rather than its WebRTC capability. + 3. WebRTC compatibility (only when `transport=webrtc`): WebRTC does not support + bring-your-own-model (BYOM) + or hosted-agent voice agents; those requests fail with `400 Bad Request`. - :param agent_name: The name of the agent. Required. + :param agent_name: The name of the voice agent. Required. :type agent_name: str - :param conversation_id: The id of the conversation that contains the item. Required. - :type conversation_id: str - :param item_id: The id of the conversation item whose generated audio is streamed. Required. - :type item_id: str - :return: AsyncIterator[bytes] - :rtype: AsyncIterator[bytes] + :keyword foundry_features_query: A query alternative to the ``Foundry-Features`` header for + clients that cannot set headers during a + WebSocket handshake. Set this to ``VoiceAgents=V1Preview``. Either this query parameter or the + header is + required. VOICE_AGENTS_V1_PREVIEW. Default value is None. + :paramtype foundry_features_query: str or ~azure.ai.projects.models.VOICE_AGENTS_V1_PREVIEW + :keyword transport: Selects the connection transport. Omit or send ``websocket`` for the + default, where signaling and audio are + exchanged as JSON events over this WebSocket. Send ``webrtc`` to negotiate a WebRTC + connection: the WebSocket + then carries only SDP signaling (``rtc.call.sdp.create`` / ``rtc.call.sdp.created``) while + media and the data + channel are peer-to-peer. Known values are: "websocket" and "webrtc". Default value is None. + :paramtype transport: str or ~azure.ai.projects.models.VoiceAgentTransport + :keyword store: Whether to persist the conversation created by this WebSocket session. If + omitted, the service honors the + persisted voice agent definition's configured ``store`` value. If supplied, this value + overrides the + definition's ``store`` setting for this session only. Default value is None. + :paramtype store: bool + :keyword structured_input: Per-session values for the voice agent's declared + ``structured_inputs``, serialized as a JSON object and + URL-encoded as this query parameter. Supplied values override definition defaults when + rendering the + agent's instructions and session-start greeting for this session only. The decoded value must + be a JSON + object no larger than 32 KiB with a maximum nesting depth of 16. Default value is None. + :paramtype structured_input: str + :keyword agent_version_override: Selects a specific version of the voice agent for this + session. Default value is None. + :paramtype agent_version_override: str + :keyword websocket_subprotocol: The requested WebSocket subprotocol. Omit this header or + request exactly ``realtime``. "realtime" Default value is None. + :paramtype websocket_subprotocol: str or + ~azure.ai.projects.models.VoiceAgentWebSocketSubprotocol + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6987,12 +6990,16 @@ async def get_agent_conversation_item_generated_audio_content( # pylint: disabl _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_agent_endpoint_conversations_get_agent_conversation_item_generated_audio_content_request( + _request = build_voice_agent_web_socket_connect_voice_agent_request( agent_name=agent_name, - conversation_id=conversation_id, - item_id=item_id, + foundry_features_query=foundry_features_query, + transport=transport, + store=store, + structured_input=structured_input, + agent_version_override=agent_version_override, + websocket_subprotocol=websocket_subprotocol, api_version=self._config.api_version, headers=_headers, params=_params, @@ -7002,20 +7009,14 @@ async def get_agent_conversation_item_generated_audio_content( # pylint: disabl } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", True) + _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 + if response.status_code not in [101]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ApiErrorResponse, @@ -7024,24 +7025,22 @@ async def get_agent_conversation_item_generated_audio_content( # pylint: disabl 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() + response_headers["Sec-WebSocket-Protocol"] = self._deserialize( + "str", response.headers.get("Sec-WebSocket-Protocol") + ) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore + return cls(pipeline_response, None, response_headers) # type: ignore -class ToolboxesOperations: # pylint: disable=docstring-missing-param +class AgentEndpointConversationsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.ai.projects.aio.AIProjectClient`'s - :attr:`toolboxes` attribute. + :attr:`agent_endpoint_conversations` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -7051,126 +7050,119 @@ def __init__(self, *args, **kwargs) -> None: 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") - @overload - async def create_version( + @distributed_trace + def list_agent_conversations( self, - name: str, + agent_name: str, *, - tools: List[_models.ToolboxTool], - content_type: str = "application/json", - description: Optional[str] = None, - metadata: Optional[dict[str, str]] = None, - skills: Optional[List[_models.ToolboxSkill]] = None, - policies: Optional[_models.ToolboxPolicies] = None, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, **kwargs: Any - ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. + ) -> AsyncItemPaged["_models.VoiceConversation"]: + """List voice agent conversations. - Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. + Returns the conversations persisted for the specified voice agent endpoint. Conversations are + present when the session's effective ``store`` setting is ``true``, whether inherited from the + agent definition or enabled by the WebSocket session override. - :param name: The name of the toolbox. If the toolbox does not exist, it will be created. - Required. - :type name: str - :keyword tools: The list of tools to include in this version. Required. - :paramtype tools: list[~azure.ai.projects.models.ToolboxTool] - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword description: A human-readable description of the toolbox. Default value is None. - :paramtype description: str - :keyword metadata: Arbitrary key-value metadata to associate with the toolbox. Default value is - None. - :paramtype metadata: dict[str, str] - :keyword skills: The list of skill sources to include in this version. A skill reference - specifies a skill name and optionally a version. If version is omitted, the skill's default - version is used. Default value is None. - :paramtype skills: list[~azure.ai.projects.models.ToolboxSkill] - :keyword policies: Policy configuration for this toolbox version. Default value is None. - :paramtype policies: ~azure.ai.projects.models.ToolboxPolicies - :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxVersionObject + :param agent_name: The name of the 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 VoiceConversation + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.VoiceConversation] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - @overload - async def create_version( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. + cls: ClsType[List[_models.VoiceConversation]] = kwargs.pop("cls", None) - Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - :param name: The name of the toolbox. If the toolbox does not exist, it will be created. - Required. - :type name: str - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxVersionObject - :raises ~azure.core.exceptions.HttpResponseError: - """ + def prepare_request(_continuation_token=None): - @overload - async def create_version( - self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. + _request = build_agent_endpoint_conversations_list_agent_conversations_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 - Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.VoiceConversation], + 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) - :param name: The name of the toolbox. If the toolbox does not exist, it will be created. - Required. - :type name: str - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxVersionObject - :raises ~azure.core.exceptions.HttpResponseError: - """ + 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 create_version( - self, - name: str, - body: Union[JSON, IO[bytes]] = _Unset, - *, - tools: List[_models.ToolboxTool] = _Unset, - description: Optional[str] = None, - metadata: Optional[dict[str, str]] = None, - skills: Optional[List[_models.ToolboxSkill]] = None, - policies: Optional[_models.ToolboxPolicies] = None, - **kwargs: Any - ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. + async def get_agent_conversation( + self, agent_name: str, conversation_id: str, **kwargs: Any + ) -> _models.VoiceConversation: + """Get a voice agent conversation. - Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. + Retrieves a single conversation recorded for the specified voice agent endpoint by its id. + Returns ``404`` when the conversation was not persisted (``store = false``) or does not exist. - :param name: The name of the toolbox. If the toolbox does not exist, it will be created. - Required. - :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword tools: The list of tools to include in this version. Required. - :paramtype tools: list[~azure.ai.projects.models.ToolboxTool] - :keyword description: A human-readable description of the toolbox. Default value is None. - :paramtype description: str - :keyword metadata: Arbitrary key-value metadata to associate with the toolbox. Default value is - None. - :paramtype metadata: dict[str, str] - :keyword skills: The list of skill sources to include in this version. A skill reference - specifies a skill name and optionally a version. If version is omitted, the skill's default - version is used. Default value is None. - :paramtype skills: list[~azure.ai.projects.models.ToolboxSkill] - :keyword policies: Policy configuration for this toolbox version. Default value is None. - :paramtype policies: ~azure.ai.projects.models.ToolboxPolicies - :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxVersionObject + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation to retrieve. Required. + :type conversation_id: str + :return: VoiceConversation. The VoiceConversation is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceConversation :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -7181,35 +7173,15 @@ async def create_version( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ToolboxVersionObject] = kwargs.pop("cls", None) - - if body is _Unset: - if tools is _Unset: - raise TypeError("missing required argument: tools") - body = { - "description": description, - "metadata": metadata, - "policies": policies, - "skills": skills, - "tools": tools, - } - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.VoiceConversation] = kwargs.pop("cls", None) - _request = build_toolboxes_create_version_request( - name=name, - content_type=content_type, + _request = build_agent_endpoint_conversations_get_agent_conversation_request( + agent_name=agent_name, + conversation_id=conversation_id, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -7242,7 +7214,7 @@ async def create_version( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ToolboxVersionObject, response.json()) + deserialized = _deserialize(_models.VoiceConversation, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -7250,15 +7222,18 @@ async def create_version( return deserialized # type: ignore @distributed_trace_async - async def get(self, name: str, **kwargs: Any) -> _models.ToolboxObject: - """Retrieve a toolbox. + async def delete_agent_conversation(self, agent_name: str, conversation_id: str, **kwargs: Any) -> None: + """Delete a voice agent conversation. - Retrieves the specified toolbox and its current configuration. + Deletes a conversation and all of its stored data — responses, items, and any audio (cascade). + This is the customer's explicit data-deletion control for voice conversations. - :param name: The name of the toolbox to retrieve. Required. - :type name: str - :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxObject + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation to delete. Required. + :type conversation_id: str + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -7272,10 +7247,11 @@ async def get(self, name: str, **kwargs: Any) -> _models.ToolboxObject: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ToolboxObject] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_toolboxes_get_request( - name=name, + _request = build_agent_endpoint_conversations_delete_agent_conversation_request( + agent_name=agent_name, + conversation_id=conversation_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -7285,20 +7261,14 @@ async def get(self, name: str, **kwargs: Any) -> _models.ToolboxObject: } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _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 + 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, @@ -7306,29 +7276,31 @@ async def get(self, name: str, **kwargs: Any) -> _models.ToolboxObject: ) raise HttpResponseError(response=response, model=error) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ToolboxObject, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace - def list( + def list_agent_conversation_responses( 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.ToolboxObject"]: - """List toolboxes. + ) -> AsyncItemPaged["_models.VoiceResponse"]: + """List responses in a voice agent conversation. - Returns the toolboxes available in the current project. + Returns a paged collection of the responses (model inference turns) recorded for the specified + conversation. The per-response ``output`` projection may be omitted here; use the + response-items route for the canonical paged output. Returns ``404`` when the conversation was + not persisted (``store = false``). + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose responses are listed. 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. @@ -7343,14 +7315,14 @@ def list( 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 ToolboxObject - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.ToolboxObject] + :return: An iterator like instance of VoiceResponse + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.VoiceResponse] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ToolboxObject]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.VoiceResponse]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -7362,7 +7334,9 @@ def list( def prepare_request(_continuation_token=None): - _request = build_toolboxes_list_request( + _request = build_agent_endpoint_conversations_list_agent_conversation_responses_request( + agent_name=agent_name, + conversation_id=conversation_id, limit=limit, order=order, after=_continuation_token, @@ -7380,7 +7354,7 @@ def prepare_request(_continuation_token=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.ToolboxObject], + List[_models.VoiceResponse], deserialized.get("data", []), ) if cls: @@ -7408,22 +7382,108 @@ async def get_next(_continuation_token=None): return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async + async def get_agent_conversation_response( + self, agent_name: str, conversation_id: str, response_id: str, **kwargs: Any + ) -> _models.VoiceResponse: + """Get a voice agent conversation response. + + Retrieves a single response from the specified conversation by its id, including its ``output`` + items, ``usage``, and status. Returns ``404`` when the conversation or response was not + persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the response. Required. + :type conversation_id: str + :param response_id: The id of the response to retrieve. Required. + :type response_id: str + :return: VoiceResponse. The VoiceResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceResponse + :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.VoiceResponse] = kwargs.pop("cls", None) + + _request = build_agent_endpoint_conversations_get_agent_conversation_response_request( + agent_name=agent_name, + conversation_id=conversation_id, + response_id=response_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.VoiceResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + @distributed_trace - def list_versions( + def list_agent_conversation_response_items( self, - name: str, + agent_name: str, + conversation_id: str, + response_id: str, *, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, before: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.ToolboxVersionObject"]: - """List toolbox versions. + ) -> AsyncItemPaged["_models.RealtimeConversationItem"]: + """List items produced by a voice agent conversation response. - Returns the available versions for the specified toolbox. + Returns a paged collection of the output items produced by a specific response (the response's + output projection). For the complete ordered conversation history — including user input and + client-created tool outputs — use the conversation items route instead. Returns ``404`` when + the conversation or response was not persisted (``store = false``). - :param name: The name of the toolbox to list versions for. Required. - :type name: str + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the response. Required. + :type conversation_id: str + :param response_id: The id of the response whose output items are listed. Required. + :type response_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. @@ -7438,14 +7498,15 @@ def list_versions( 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 ToolboxVersionObject - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.ToolboxVersionObject] + :return: An iterator like instance of RealtimeConversationItem + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.RealtimeConversationItem] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ToolboxVersionObject]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.RealtimeConversationItem]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -7457,8 +7518,10 @@ def list_versions( def prepare_request(_continuation_token=None): - _request = build_toolboxes_list_versions_request( - name=name, + _request = build_agent_endpoint_conversations_list_agent_conversation_response_items_request( + agent_name=agent_name, + conversation_id=conversation_id, + response_id=response_id, limit=limit, order=order, after=_continuation_token, @@ -7476,7 +7539,7 @@ def prepare_request(_continuation_token=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.ToolboxVersionObject], + List[_models.RealtimeConversationItem], deserialized.get("data", []), ) if cls: @@ -7504,20 +7567,51 @@ async def get_next(_continuation_token=None): return AsyncItemPaged(get_next, extract_data) - @distributed_trace_async - async def get_version(self, name: str, version: str, **kwargs: Any) -> _models.ToolboxVersionObject: - """Retrieve a specific version of a toolbox. + @distributed_trace + def list_agent_conversation_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.RealtimeConversationItem"]: + """List items in a voice agent conversation. - Retrieves the specified version of a toolbox by name and version identifier. + Returns a paged collection of items — the complete ordered conversation history, including user + input, assistant output, and client-created tool outputs (transcripts + tool events). Returns + ``404`` when the conversation was not persisted (``store = false``). - :param name: The name of the toolbox. Required. - :type name: str - :param version: The version identifier to retrieve. Required. - :type version: str - :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxVersionObject + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose items are listed. 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 RealtimeConversationItem + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.RealtimeConversationItem] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.RealtimeConversationItem]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -7526,132 +7620,77 @@ async def get_version(self, name: str, version: str, **kwargs: Any) -> _models.T } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ToolboxVersionObject] = kwargs.pop("cls", None) + def prepare_request(_continuation_token=None): - _request = build_toolboxes_get_version_request( - name=name, - version=version, - 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) + _request = build_agent_endpoint_conversations_list_agent_conversation_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 - _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 - ) + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.RealtimeConversationItem], + 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) - response = pipeline_response.http_response + async def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) - 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, + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - raise HttpResponseError(response=response, model=error) + response = pipeline_response.http_response - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ToolboxVersionObject, response.json()) + 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) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return pipeline_response - return deserialized # type: ignore - - @overload - async def update( - self, name: str, *, default_version: str, content_type: str = "application/json", **kwargs: Any - ) -> _models.ToolboxObject: - """Update a toolbox to point to a specific version. - - Updates the toolbox's default version pointer to the specified version. - - :param name: The name of the toolbox to update. Required. - :type name: str - :keyword 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. - :paramtype default_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxObject - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ToolboxObject: - """Update a toolbox to point to a specific version. - - Updates the toolbox's default version pointer to the specified version. - - :param name: The name of the toolbox to update. Required. - :type name: str - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxObject - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ToolboxObject: - """Update a toolbox to point to a specific version. - - Updates the toolbox's default version pointer to the specified version. - - :param name: The name of the toolbox to update. Required. - :type name: str - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxObject - :raises ~azure.core.exceptions.HttpResponseError: - """ + return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def update( - self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, default_version: str = _Unset, **kwargs: Any - ) -> _models.ToolboxObject: - """Update a toolbox to point to a specific version. + async def get_agent_conversation_item( + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.RealtimeConversationItem: + """Get a voice agent conversation item. - Updates the toolbox's default version pointer to the specified version. + Retrieves a single item from the specified conversation by its id, including its transcript. An + ``input_audio``/``output_audio`` content part indicates that audio is available for the item; + the canonical per-item audio metadata is the ``/items/{item_id}/audio`` resource, and the bytes + are streamed by ``/items/{item_id}/audio/content``. Returns ``404`` when the conversation or + item was not persisted (``store = false``). - :param name: The name of the toolbox to update. Required. - :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword 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. - :paramtype default_version: str - :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxObject + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item to retrieve. Required. + :type item_id: str + :return: RealtimeConversationItem. The RealtimeConversationItem is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.RealtimeConversationItem :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -7662,29 +7701,16 @@ async def update( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ToolboxObject] = kwargs.pop("cls", None) - - if body is _Unset: - if default_version is _Unset: - raise TypeError("missing required argument: default_version") - body = {"default_version": default_version} - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.RealtimeConversationItem] = kwargs.pop("cls", None) - _request = build_toolboxes_update_request( - name=name, - content_type=content_type, + _request = build_agent_endpoint_conversations_get_agent_conversation_item_request( + agent_name=agent_name, + conversation_id=conversation_id, + item_id=item_id, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -7717,7 +7743,7 @@ async def update( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ToolboxObject, response.json()) + deserialized = _deserialize(_models.RealtimeConversationItem, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -7725,15 +7751,27 @@ async def update( return deserialized # type: ignore @distributed_trace_async - async def delete(self, name: str, **kwargs: Any) -> None: - """Delete a toolbox. + async def get_agent_conversation_item_audio( + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.VoiceItemAudioResponse: + """Get a voice agent conversation item's audio metadata. - Removes the specified toolbox along with all of its versions. + Returns metadata for a single conversation item's audio segment, including the common playback + facts (role, format/codec, sample rate, channels, offset, duration) for both Foundry-managed + and bring-your-own-storage (BYOS) recordings; for BYOS the response additionally includes + ``blob_uri``, the URI of the recording in the customer's own storage (no SAS) that the customer + downloads with their own credentials. Requires the conversation to have persisted audio + (``store = true``); returns ``404`` when the conversation, item, or its audio was not + persisted. - :param name: The name of the toolbox to delete. Required. - :type name: str - :return: None - :rtype: None + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose audio metadata is retrieved. Required. + :type item_id: str + :return: VoiceItemAudioResponse. The VoiceItemAudioResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceItemAudioResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -7747,10 +7785,12 @@ async def delete(self, name: str, **kwargs: Any) -> None: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[_models.VoiceItemAudioResponse] = kwargs.pop("cls", None) - _request = build_toolboxes_delete_request( - name=name, + _request = build_agent_endpoint_conversations_get_agent_conversation_item_audio_request( + agent_name=agent_name, + conversation_id=conversation_id, + item_id=item_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -7760,14 +7800,20 @@ async def delete(self, name: str, **kwargs: Any) -> None: } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _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 [204]: + 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, @@ -7775,21 +7821,37 @@ async def delete(self, name: str, **kwargs: Any) -> None: ) raise HttpResponseError(response=response, model=error) + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VoiceItemAudioResponse, response.json()) + if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore @distributed_trace_async - async def delete_version(self, name: str, version: str, **kwargs: Any) -> None: - """Delete a specific version of a toolbox. + async def get_agent_conversation_item_audio_content( # pylint: disable=name-too-long + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + """Stream a voice agent conversation item's audio. - Removes the specified version of a toolbox. + Streams a single conversation item's audio as a WAV (``audio/wav``) byte stream through the + service (no SAS URL). This route serves Foundry-managed storage only. For + bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download + directly from customer storage using the ``blob_uri`` returned by the item's ``/audio`` + metadata route — so this route returns ``409 Conflict`` for BYOS recordings. Returns ``404`` + when the conversation, item, or its audio was not persisted (``store = false``). - :param name: The name of the toolbox. Required. - :type name: str - :param version: The version identifier to delete. Required. - :type version: str - :return: None - :rtype: None + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose audio is streamed. Required. + :type item_id: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -7803,11 +7865,12 @@ async def delete_version(self, name: str, version: str, **kwargs: Any) -> None: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_toolboxes_delete_version_request( - name=name, - version=version, + _request = build_agent_endpoint_conversations_get_agent_conversation_item_audio_content_request( + agent_name=agent_name, + conversation_id=conversation_id, + item_id=item_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -7817,14 +7880,20 @@ async def delete_version(self, name: str, version: str, **kwargs: Any) -> None: } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _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 [204]: + 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, @@ -7832,103 +7901,38 @@ async def delete_version(self, name: str, version: str, **kwargs: Any) -> None: ) raise HttpResponseError(response=response, model=error) - if cls: - return cls(pipeline_response, None, {}) # type: ignore - + response_headers = {} + response_headers["Content-Type"] = self._deserialize("str", response.headers.get("Content-Type")) -class BetaVoiceAgentWebSocketOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - Instead, you should access the following operations through - :class:`~azure.ai.projects.aio.AIProjectClient`'s - :attr:`voice_agent_web_socket` attribute. - """ + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore - 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") + return deserialized # type: ignore @distributed_trace_async - async def connect_voice_agent( - self, - agent_name: str, - *, - foundry_features_query: Optional[Literal[_AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW]] = None, - transport: Optional[Union[str, _models.VoiceAgentTransport]] = None, - store: Optional[bool] = None, - agent_version_override: Optional[str] = None, - websocket_subprotocol: Optional[Union[str, _models.VoiceAgentWebSocketSubprotocol]] = None, - **kwargs: Any - ) -> None: - """Connect to a voice agent. + async def get_agent_conversation_item_generated_audio( # pylint: disable=name-too-long + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.VoiceGeneratedItemAudioResponse: + """Get a voice agent conversation item's generated audio metadata. - Connects to a voice agent over WebSocket. The client must send an HTTP GET with ``Upgrade: - websocket`` - headers. The optional ``realtime`` subprotocol is the only accepted subprotocol value. Supply - the - ``VoiceAgents=V1Preview`` opt-in through either the ``Foundry-Features`` header or the - ``foundry_features`` - query parameter. - - Handshake failures are evaluated in the following order, independent of the requested - ``transport``: - - - - 1. Agent enablement (any transport): if the target agent is disabled, the handshake fails - before the - `101 Switching Protocols` upgrade with `409 Conflict`, using the shared Foundry - `ApiErrorResponse` shape - with `error.code = agent_disabled`. This failure is terminal until the caller enables the - agent, and it - takes precedence over the WebRTC-specific checks below. - 2. WebRTC availability (only when `transport=webrtc`, and only once the agent itself is - enabled): the agent - must have the WebRTC transport capability configured. If the agent is enabled but WebRTC is not - available - for it, the handshake fails with `404 Not Found`. This is distinct from the `409 - agent_disabled` case - above, which concerns the agent itself rather than its WebRTC capability. - 3. WebRTC compatibility (only when `transport=webrtc`): WebRTC does not support - bring-your-own-model (BYOM) - or hosted-agent voice agents; those requests fail with `400 Bad Request`. + Returns metadata for a conversation item's generated audio. This subordinate artifact is + separate from the canonical heard-audio segment and exists only when playback was interrupted + and the service rendered more audio than the listener heard, including when the response ends + as cancelled. Returns ``404`` when the conversation or item was not persisted, or when no + generated audio exists beyond the heard segment. - :param agent_name: The name of the voice agent. Required. + :param agent_name: The name of the agent. Required. :type agent_name: str - :keyword foundry_features_query: A query alternative to the ``Foundry-Features`` header for - clients that cannot set headers during a - WebSocket handshake. Set this to ``VoiceAgents=V1Preview``. Either this query parameter or the - header is - required. VOICE_AGENTS_V1_PREVIEW. Default value is None. - :paramtype foundry_features_query: str or ~azure.ai.projects.models.VOICE_AGENTS_V1_PREVIEW - :keyword transport: Selects the connection transport. Omit or send ``websocket`` for the - default, where signaling and audio are - exchanged as JSON events over this WebSocket. Send ``webrtc`` to negotiate a WebRTC - connection: the WebSocket - then carries only SDP signaling (``rtc.call.sdp.create`` / ``rtc.call.sdp.created``) while - media and the data - channel are peer-to-peer. Known values are: "websocket" and "webrtc". Default value is None. - :paramtype transport: str or ~azure.ai.projects.models.VoiceAgentTransport - :keyword store: Whether to persist the conversation created by this WebSocket session. If - omitted, the service honors the - persisted voice agent definition's configured ``store`` value. If supplied, this value - overrides the - definition's ``store`` setting for this session only. Default value is None. - :paramtype store: bool - :keyword agent_version_override: Selects a specific version of the voice agent for this - session. Default value is None. - :paramtype agent_version_override: str - :keyword websocket_subprotocol: The requested WebSocket subprotocol. Omit this header or - request exactly ``realtime``. "realtime" Default value is None. - :paramtype websocket_subprotocol: str or - ~azure.ai.projects.models.VoiceAgentWebSocketSubprotocol - :return: None - :rtype: None + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose generated audio metadata is retrieved. + Required. + :type item_id: str + :return: VoiceGeneratedItemAudioResponse. The VoiceGeneratedItemAudioResponse is compatible + with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceGeneratedItemAudioResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -7942,15 +7946,12 @@ async def connect_voice_agent( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[_models.VoiceGeneratedItemAudioResponse] = kwargs.pop("cls", None) - _request = build_beta_voice_agent_web_socket_connect_voice_agent_request( + _request = build_agent_endpoint_conversations_get_agent_conversation_item_generated_audio_request( agent_name=agent_name, - foundry_features_query=foundry_features_query, - transport=transport, - store=store, - agent_version_override=agent_version_override, - websocket_subprotocol=websocket_subprotocol, + conversation_id=conversation_id, + item_id=item_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -7960,14 +7961,20 @@ async def connect_voice_agent( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _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 [101]: + 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, @@ -7975,73 +7982,40 @@ async def connect_voice_agent( ) raise HttpResponseError(response=response, model=error) - response_headers = {} - response_headers["Sec-WebSocket-Protocol"] = self._deserialize( - "str", response.headers.get("Sec-WebSocket-Protocol") - ) + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VoiceGeneratedItemAudioResponse, response.json()) if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - - -class BetaAgentEndpointConversationsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.projects.aio.AIProjectClient`'s - :attr:`agent_endpoint_conversations` attribute. - """ + return cls(pipeline_response, deserialized, {}) # type: ignore - 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") + return deserialized # type: ignore - @distributed_trace - def list_agent_conversations( - self, - agent_name: str, - *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.VoiceConversation"]: - """List voice agent conversations. + @distributed_trace_async + async def get_agent_conversation_item_generated_audio_content( # pylint: disable=name-too-long + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + """Stream a voice agent conversation item's generated audio. - Returns the conversations persisted for the specified voice agent endpoint. Conversations are - present when the session's effective ``store`` setting is ``true``, whether inherited from the - agent definition or enabled by the WebSocket session override. + Streams a conversation item's generated audio as a WAV (``audio/wav``) byte stream through the + service. This subordinate artifact exists only when playback was interrupted and the service + rendered more audio than the listener heard, including when the response ends as cancelled. + This route serves Foundry-managed storage only. For bring-your-own-storage (BYOS) recordings + the bytes are not proxied, so this route returns ``409 Conflict``. Returns ``404`` when the + conversation or item was not persisted, or when no generated audio exists beyond the heard + segment. :param agent_name: The name of the 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 VoiceConversation - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.VoiceConversation] + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose generated audio is streamed. Required. + :type item_id: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.VoiceConversation]] = kwargs.pop("cls", None) - error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -8050,70 +8024,81 @@ def list_agent_conversations( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(_continuation_token=None): + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - _request = build_beta_agent_endpoint_conversations_list_agent_conversations_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 + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.VoiceConversation], - 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) + _request = build_agent_endpoint_conversations_get_agent_conversation_item_generated_audio_content_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) - async def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) + _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 + ) - _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, ) - response = pipeline_response.http_response + raise HttpResponseError(response=response, model=error) - 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) + response_headers = {} + response_headers["Content-Type"] = self._deserialize("str", response.headers.get("Content-Type")) - return pipeline_response + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - return AsyncItemPaged(get_next, extract_data) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace_async - async def get_agent_conversation( + async def get_agent_conversation_audio( self, agent_name: str, conversation_id: str, **kwargs: Any - ) -> _models.VoiceConversation: - """Get a voice agent conversation. + ) -> _models.VoiceRecordingResponse: + """Get a voice agent conversation's merged recording metadata. - Retrieves a single conversation recorded for the specified voice agent endpoint by its id. - Returns ``404`` when the conversation was not persisted (``store = false``) or does not exist. + Returns metadata for the whole-call merged stereo recording (user audio on the left channel, + agent audio on the right). The common metadata (format, sample rate, channels, channel layout, + duration) is returned for both Foundry-managed and bring-your-own-storage (BYOS) recordings; + for BYOS the response additionally includes ``blob_uri``, the URI of the recording in the + customer's own storage (no SAS) that the customer downloads with their own credentials. The + recording is built once from the per-turn segments after persistence finalization succeeds. + While the conversation is ``in_progress``, this route returns retriable ``409 Conflict`` with + ``error.code = recording_not_ready`` and a ``Retry-After`` header when retry guidance is + available. When the conversation is ``failed``, it returns terminal ``409 Conflict`` with + ``error.code = recording_unavailable``. For a ``completed`` conversation, metadata is available + subject to the existing BYOS behavior. Requires the conversation to have persisted audio + (``store = true``); otherwise returns ``404``. :param agent_name: The name of the agent. Required. :type agent_name: str - :param conversation_id: The id of the conversation to retrieve. Required. + :param conversation_id: The id of the conversation whose merged recording metadata is + retrieved. Required. :type conversation_id: str - :return: VoiceConversation. The VoiceConversation is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.VoiceConversation + :return: VoiceRecordingResponse. The VoiceRecordingResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceRecordingResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -8127,9 +8112,9 @@ async def get_agent_conversation( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.VoiceConversation] = kwargs.pop("cls", None) + cls: ClsType[_models.VoiceRecordingResponse] = kwargs.pop("cls", None) - _request = build_beta_agent_endpoint_conversations_get_agent_conversation_request( + _request = build_agent_endpoint_conversations_get_agent_conversation_audio_request( agent_name=agent_name, conversation_id=conversation_id, api_version=self._config.api_version, @@ -8165,7 +8150,7 @@ async def get_agent_conversation( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.VoiceConversation, response.json()) + deserialized = _deserialize(_models.VoiceRecordingResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -8173,18 +8158,29 @@ async def get_agent_conversation( return deserialized # type: ignore @distributed_trace_async - async def delete_agent_conversation(self, agent_name: str, conversation_id: str, **kwargs: Any) -> None: - """Delete a voice agent conversation. + async def get_agent_conversation_audio_content( + self, agent_name: str, conversation_id: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + """Stream a voice agent conversation's merged recording. - Deletes a conversation and all of its stored data — responses, items, and any audio (cascade). - This is the customer's explicit data-deletion control for voice conversations. + Streams the whole-call merged stereo recording as a WAV (``audio/wav``) byte stream through the + service (no SAS URL). This route serves Foundry-managed storage only. For + bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download + directly from customer storage using the ``blob_uri`` returned by the metadata route — so this + route returns ``409 Conflict`` for BYOS recordings. While the conversation is ``in_progress``, + this route returns retriable ``409 Conflict`` with ``error.code = recording_not_ready`` and a + ``Retry-After`` header when retry guidance is available. When the conversation is ``failed``, + it returns terminal ``409 Conflict`` with ``error.code = recording_unavailable``. For a + ``completed`` conversation, content is available subject to the existing BYOS behavior. A + conversation without persisted audio (``store = false``) returns ``404``. :param agent_name: The name of the agent. Required. :type agent_name: str - :param conversation_id: The id of the conversation to delete. Required. + :param conversation_id: The id of the conversation whose merged recording is streamed. + Required. :type conversation_id: str - :return: None - :rtype: None + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -8198,9 +8194,9 @@ async def delete_agent_conversation(self, agent_name: str, conversation_id: str, _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_beta_agent_endpoint_conversations_delete_agent_conversation_request( + _request = build_agent_endpoint_conversations_get_agent_conversation_audio_content_request( agent_name=agent_name, conversation_id=conversation_id, api_version=self._config.api_version, @@ -8212,14 +8208,20 @@ async def delete_agent_conversation(self, agent_name: str, conversation_id: str, } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _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 [204]: + 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, @@ -8227,54 +8229,156 @@ async def delete_agent_conversation(self, agent_name: str, conversation_id: str, ) 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, None, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore - @distributed_trace - def list_agent_conversation_responses( + return deserialized # type: ignore + + +class ToolboxesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.aio.AIProjectClient`'s + :attr:`toolboxes` 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") + + @overload + async def create_version( self, - agent_name: str, - conversation_id: str, + name: str, *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, + tools: List[_models.ToolboxTool], + content_type: str = "application/json", + description: Optional[str] = None, + metadata: Optional[dict[str, str]] = None, + skills: Optional[List[_models.ToolboxSkill]] = None, + policies: Optional[_models.ToolboxPolicies] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.VoiceResponse"]: - """List responses in a voice agent conversation. + ) -> _models.ToolboxVersionObject: + """Create a new version of a toolbox. - Returns a paged collection of the responses (model inference turns) recorded for the specified - conversation. The per-response ``output`` projection may be omitted here; use the - response-items route for the canonical paged output. Returns ``404`` when the conversation was - not persisted (``store = false``). + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation whose responses are listed. 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 VoiceResponse - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.VoiceResponse] + :param name: The name of the toolbox. If the toolbox does not exist, it will be created. + Required. + :type name: str + :keyword tools: The list of tools to include in this version. Required. + :paramtype tools: list[~azure.ai.projects.models.ToolboxTool] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword description: A human-readable description of the toolbox. Default value is None. + :paramtype description: str + :keyword metadata: Arbitrary key-value metadata to associate with the toolbox. Default value is + None. + :paramtype metadata: dict[str, str] + :keyword skills: The list of skill sources to include in this version. A skill reference + specifies a skill name and optionally a version. If version is omitted, the skill's default + version is used. Default value is None. + :paramtype skills: list[~azure.ai.projects.models.ToolboxSkill] + :keyword policies: Policy configuration for this toolbox version. Default value is None. + :paramtype policies: ~azure.ai.projects.models.ToolboxPolicies + :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxVersionObject :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.VoiceResponse]] = kwargs.pop("cls", None) + @overload + async def create_version( + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ToolboxVersionObject: + """Create a new version of a toolbox. + + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. + + :param name: The name of the toolbox. If the toolbox does not exist, it will be created. + Required. + :type name: str + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxVersionObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_version( + self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ToolboxVersionObject: + """Create a new version of a toolbox. + + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. + + :param name: The name of the toolbox. If the toolbox does not exist, it will be created. + Required. + :type name: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxVersionObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_version( + self, + name: str, + body: Union[JSON, IO[bytes]] = _Unset, + *, + tools: List[_models.ToolboxTool] = _Unset, + description: Optional[str] = None, + metadata: Optional[dict[str, str]] = None, + skills: Optional[List[_models.ToolboxSkill]] = None, + policies: Optional[_models.ToolboxPolicies] = None, + **kwargs: Any + ) -> _models.ToolboxVersionObject: + """Create a new version of a toolbox. + + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. + :param name: The name of the toolbox. If the toolbox does not exist, it will be created. + Required. + :type name: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword tools: The list of tools to include in this version. Required. + :paramtype tools: list[~azure.ai.projects.models.ToolboxTool] + :keyword description: A human-readable description of the toolbox. Default value is None. + :paramtype description: str + :keyword metadata: Arbitrary key-value metadata to associate with the toolbox. Default value is + None. + :paramtype metadata: dict[str, str] + :keyword skills: The list of skill sources to include in this version. A skill reference + specifies a skill name and optionally a version. If version is omitted, the skill's default + version is used. Default value is None. + :paramtype skills: list[~azure.ai.projects.models.ToolboxSkill] + :keyword policies: Policy configuration for this toolbox version. Default value is None. + :paramtype policies: ~azure.ai.projects.models.ToolboxPolicies + :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxVersionObject + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -8283,74 +8387,84 @@ def list_agent_conversation_responses( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(_continuation_token=None): + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - _request = build_beta_agent_endpoint_conversations_list_agent_conversation_responses_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), + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ToolboxVersionObject] = kwargs.pop("cls", None) + + if body is _Unset: + if tools is _Unset: + raise TypeError("missing required argument: tools") + body = { + "description": description, + "metadata": metadata, + "policies": policies, + "skills": skills, + "tools": tools, } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - return _request + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_toolboxes_create_version_request( + name=name, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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) - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.VoiceResponse], - 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) + _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 + ) - async def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) + response = pipeline_response.http_response - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + 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, ) - response = pipeline_response.http_response + raise HttpResponseError(response=response, model=error) - 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) + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ToolboxVersionObject, response.json()) - return pipeline_response + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore - return AsyncItemPaged(get_next, extract_data) + return deserialized # type: ignore @distributed_trace_async - async def get_agent_conversation_response( - self, agent_name: str, conversation_id: str, response_id: str, **kwargs: Any - ) -> _models.VoiceResponse: - """Get a voice agent conversation response. + async def get(self, name: str, **kwargs: Any) -> _models.ToolboxObject: + """Retrieve a toolbox. - Retrieves a single response from the specified conversation by its id, including its ``output`` - items, ``usage``, and status. Returns ``404`` when the conversation or response was not - persisted (``store = false``). + Retrieves the specified toolbox and its current configuration. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the response. Required. - :type conversation_id: str - :param response_id: The id of the response to retrieve. Required. - :type response_id: str - :return: VoiceResponse. The VoiceResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.VoiceResponse + :param name: The name of the toolbox to retrieve. Required. + :type name: str + :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxObject :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -8364,12 +8478,10 @@ async def get_agent_conversation_response( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.VoiceResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.ToolboxObject] = kwargs.pop("cls", None) - _request = build_beta_agent_endpoint_conversations_get_agent_conversation_response_request( - agent_name=agent_name, - conversation_id=conversation_id, - response_id=response_id, + _request = build_toolboxes_get_request( + name=name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -8403,7 +8515,7 @@ async def get_agent_conversation_response( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.VoiceResponse, response.json()) + deserialized = _deserialize(_models.ToolboxObject, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -8411,30 +8523,18 @@ async def get_agent_conversation_response( return deserialized # type: ignore @distributed_trace - def list_agent_conversation_response_items( + def list( self, - agent_name: str, - conversation_id: str, - response_id: str, *, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, before: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.RealtimeConversationItem"]: - """List items produced by a voice agent conversation response. + ) -> AsyncItemPaged["_models.ToolboxObject"]: + """List toolboxes. - Returns a paged collection of the output items produced by a specific response (the response's - output projection). For the complete ordered conversation history — including user input and - client-created tool outputs — use the conversation items route instead. Returns ``404`` when - the conversation or response was not persisted (``store = false``). + Returns the toolboxes available in the current project. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the response. Required. - :type conversation_id: str - :param response_id: The id of the response whose output items are listed. Required. - :type response_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. @@ -8449,15 +8549,14 @@ def list_agent_conversation_response_items( 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 RealtimeConversationItem - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.RealtimeConversationItem] + :return: An iterator like instance of ToolboxObject + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.ToolboxObject] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.RealtimeConversationItem]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.ToolboxObject]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -8469,10 +8568,7 @@ def list_agent_conversation_response_items( def prepare_request(_continuation_token=None): - _request = build_beta_agent_endpoint_conversations_list_agent_conversation_response_items_request( - agent_name=agent_name, - conversation_id=conversation_id, - response_id=response_id, + _request = build_toolboxes_list_request( limit=limit, order=order, after=_continuation_token, @@ -8490,7 +8586,7 @@ def prepare_request(_continuation_token=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.RealtimeConversationItem], + List[_models.ToolboxObject], deserialized.get("data", []), ) if cls: @@ -8519,26 +8615,21 @@ async def get_next(_continuation_token=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def list_agent_conversation_items( + def list_versions( self, - agent_name: str, - conversation_id: str, + name: str, *, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, before: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.RealtimeConversationItem"]: - """List items in a voice agent conversation. + ) -> AsyncItemPaged["_models.ToolboxVersionObject"]: + """List toolbox versions. - Returns a paged collection of items — the complete ordered conversation history, including user - input, assistant output, and client-created tool outputs (transcripts + tool events). Returns - ``404`` when the conversation was not persisted (``store = false``). + Returns the available versions for the specified toolbox. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation whose items are listed. Required. - :type conversation_id: str + :param name: The name of the toolbox to list versions for. Required. + :type 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. @@ -8553,15 +8644,14 @@ def list_agent_conversation_items( 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 RealtimeConversationItem - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.RealtimeConversationItem] + :return: An iterator like instance of ToolboxVersionObject + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.ToolboxVersionObject] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.RealtimeConversationItem]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.ToolboxVersionObject]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -8573,9 +8663,8 @@ def list_agent_conversation_items( def prepare_request(_continuation_token=None): - _request = build_beta_agent_endpoint_conversations_list_agent_conversation_items_request( - agent_name=agent_name, - conversation_id=conversation_id, + _request = build_toolboxes_list_versions_request( + name=name, limit=limit, order=order, after=_continuation_token, @@ -8593,7 +8682,7 @@ def prepare_request(_continuation_token=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.RealtimeConversationItem], + List[_models.ToolboxVersionObject], deserialized.get("data", []), ) if cls: @@ -8622,107 +8711,17 @@ async def get_next(_continuation_token=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def get_agent_conversation_item( - self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any - ) -> _models.RealtimeConversationItem: - """Get a voice agent conversation item. - - Retrieves a single item from the specified conversation by its id, including its transcript. An - ``input_audio``/``output_audio`` content part indicates that audio is available for the item; - the canonical per-item audio metadata is the ``/items/{item_id}/audio`` resource, and the bytes - are streamed by ``/items/{item_id}/audio/content``. Returns ``404`` when the conversation or - item was not persisted (``store = false``). - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the item. Required. - :type conversation_id: str - :param item_id: The id of the conversation item to retrieve. Required. - :type item_id: str - :return: RealtimeConversationItem. The RealtimeConversationItem is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.RealtimeConversationItem - :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.RealtimeConversationItem] = kwargs.pop("cls", None) - - _request = build_beta_agent_endpoint_conversations_get_agent_conversation_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.RealtimeConversationItem, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get_agent_conversation_item_audio( - self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any - ) -> _models.VoiceItemAudioResponse: - """Get a voice agent conversation item's audio metadata. + async def get_version(self, name: str, version: str, **kwargs: Any) -> _models.ToolboxVersionObject: + """Retrieve a specific version of a toolbox. - Returns metadata for a single conversation item's audio segment, including the common playback - facts (role, format/codec, sample rate, channels, offset, duration) for both Foundry-managed - and bring-your-own-storage (BYOS) recordings; for BYOS the response additionally includes - ``blob_uri``, the URI of the recording in the customer's own storage (no SAS) that the customer - downloads with their own credentials. Requires the conversation to have persisted audio - (``store = true``); returns ``404`` when the conversation, item, or its audio was not - persisted. + Retrieves the specified version of a toolbox by name and version identifier. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the item. Required. - :type conversation_id: str - :param item_id: The id of the conversation item whose audio metadata is retrieved. Required. - :type item_id: str - :return: VoiceItemAudioResponse. The VoiceItemAudioResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.VoiceItemAudioResponse + :param name: The name of the toolbox. Required. + :type name: str + :param version: The version identifier to retrieve. Required. + :type version: str + :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxVersionObject :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -8736,12 +8735,11 @@ async def get_agent_conversation_item_audio( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.VoiceItemAudioResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.ToolboxVersionObject] = kwargs.pop("cls", None) - _request = build_beta_agent_endpoint_conversations_get_agent_conversation_item_audio_request( - agent_name=agent_name, - conversation_id=conversation_id, - item_id=item_id, + _request = build_toolboxes_get_version_request( + name=name, + version=version, api_version=self._config.api_version, headers=_headers, params=_params, @@ -8775,34 +8773,91 @@ async def get_agent_conversation_item_audio( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.VoiceItemAudioResponse, response.json()) + deserialized = _deserialize(_models.ToolboxVersionObject, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + @overload + async def update( + self, name: str, *, default_version: str, content_type: str = "application/json", **kwargs: Any + ) -> _models.ToolboxObject: + """Update a toolbox to point to a specific version. + + Updates the toolbox's default version pointer to the specified version. + + :param name: The name of the toolbox to update. Required. + :type name: str + :keyword 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. + :paramtype default_version: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ToolboxObject: + """Update a toolbox to point to a specific version. + + Updates the toolbox's default version pointer to the specified version. + + :param name: The name of the toolbox to update. Required. + :type name: str + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ToolboxObject: + """Update a toolbox to point to a specific version. + + Updates the toolbox's default version pointer to the specified version. + + :param name: The name of the toolbox to update. Required. + :type name: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace_async - async def get_agent_conversation_item_audio_content( # pylint: disable=name-too-long - self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - """Stream a voice agent conversation item's audio. + async def update( + self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, default_version: str = _Unset, **kwargs: Any + ) -> _models.ToolboxObject: + """Update a toolbox to point to a specific version. - Streams a single conversation item's audio as a WAV (``audio/wav``) byte stream through the - service (no SAS URL). This route serves Foundry-managed storage only. For - bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download - directly from customer storage using the ``blob_uri`` returned by the item's ``/audio`` - metadata route — so this route returns ``409 Conflict`` for BYOS recordings. Returns ``404`` - when the conversation, item, or its audio was not persisted (``store = false``). + Updates the toolbox's default version pointer to the specified version. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the item. Required. - :type conversation_id: str - :param item_id: The id of the conversation item whose audio is streamed. Required. - :type item_id: str - :return: AsyncIterator[bytes] - :rtype: AsyncIterator[bytes] + :param name: The name of the toolbox to update. Required. + :type name: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword 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. + :paramtype default_version: str + :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxObject :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -8813,16 +8868,29 @@ async def get_agent_conversation_item_audio_content( # pylint: disable=name-too } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ToolboxObject] = kwargs.pop("cls", None) - _request = build_beta_agent_endpoint_conversations_get_agent_conversation_item_audio_content_request( - agent_name=agent_name, - conversation_id=conversation_id, - item_id=item_id, + if body is _Unset: + if default_version is _Unset: + raise TypeError("missing required argument: default_version") + body = {"default_version": default_version} + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_toolboxes_update_request( + name=name, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -8832,7 +8900,7 @@ async def get_agent_conversation_item_audio_content( # pylint: disable=name-too _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", True) + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -8852,42 +8920,26 @@ async def get_agent_conversation_item_audio_content( # pylint: disable=name-too ) 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 _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ToolboxObject, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async - async def get_agent_conversation_audio( - self, agent_name: str, conversation_id: str, **kwargs: Any - ) -> _models.VoiceRecordingResponse: - """Get a voice agent conversation's merged recording metadata. + async def delete(self, name: str, **kwargs: Any) -> None: + """Delete a toolbox. - Returns metadata for the whole-call merged stereo recording (user audio on the left channel, - agent audio on the right). The common metadata (format, sample rate, channels, channel layout, - duration) is returned for both Foundry-managed and bring-your-own-storage (BYOS) recordings; - for BYOS the response additionally includes ``blob_uri``, the URI of the recording in the - customer's own storage (no SAS) that the customer downloads with their own credentials. The - recording is built once from the per-turn segments after persistence finalization succeeds. - While the conversation is ``in_progress``, this route returns retriable ``409 Conflict`` with - ``error.code = recording_not_ready`` and a ``Retry-After`` header when retry guidance is - available. When the conversation is ``failed``, it returns terminal ``409 Conflict`` with - ``error.code = recording_unavailable``. For a ``completed`` conversation, metadata is available - subject to the existing BYOS behavior. Requires the conversation to have persisted audio - (``store = true``); otherwise returns ``404``. + Removes the specified toolbox along with all of its versions. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation whose merged recording metadata is - retrieved. Required. - :type conversation_id: str - :return: VoiceRecordingResponse. The VoiceRecordingResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.VoiceRecordingResponse + :param name: The name of the toolbox to delete. Required. + :type name: str + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -8901,11 +8953,10 @@ async def get_agent_conversation_audio( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.VoiceRecordingResponse] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_beta_agent_endpoint_conversations_get_agent_conversation_audio_request( - agent_name=agent_name, - conversation_id=conversation_id, + _request = build_toolboxes_delete_request( + name=name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -8915,20 +8966,14 @@ async def get_agent_conversation_audio( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _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 + 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, @@ -8936,40 +8981,21 @@ async def get_agent_conversation_audio( ) raise HttpResponseError(response=response, model=error) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.VoiceRecordingResponse, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async - async def get_agent_conversation_audio_content( - self, agent_name: str, conversation_id: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - """Stream a voice agent conversation's merged recording. + async def delete_version(self, name: str, version: str, **kwargs: Any) -> None: + """Delete a specific version of a toolbox. - Streams the whole-call merged stereo recording as a WAV (``audio/wav``) byte stream through the - service (no SAS URL). This route serves Foundry-managed storage only. For - bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download - directly from customer storage using the ``blob_uri`` returned by the metadata route — so this - route returns ``409 Conflict`` for BYOS recordings. While the conversation is ``in_progress``, - this route returns retriable ``409 Conflict`` with ``error.code = recording_not_ready`` and a - ``Retry-After`` header when retry guidance is available. When the conversation is ``failed``, - it returns terminal ``409 Conflict`` with ``error.code = recording_unavailable``. For a - ``completed`` conversation, content is available subject to the existing BYOS behavior. A - conversation without persisted audio (``store = false``) returns ``404``. + Removes the specified version of a toolbox. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation whose merged recording is streamed. - Required. - :type conversation_id: str - :return: AsyncIterator[bytes] - :rtype: AsyncIterator[bytes] + :param name: The name of the toolbox. Required. + :type name: str + :param version: The version identifier to delete. Required. + :type version: str + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -8983,11 +9009,11 @@ async def get_agent_conversation_audio_content( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_beta_agent_endpoint_conversations_get_agent_conversation_audio_content_request( - agent_name=agent_name, - conversation_id=conversation_id, + _request = build_toolboxes_delete_version_request( + name=name, + version=version, api_version=self._config.api_version, headers=_headers, params=_params, @@ -8997,20 +9023,14 @@ async def get_agent_conversation_audio_content( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", True) + _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 + 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, @@ -9018,15 +9038,8 @@ async def get_agent_conversation_audio_content( ) 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 + return cls(pipeline_response, None, {}) # type: ignore class BetaAgentInsightMonitorsOperations: # pylint: disable=docstring-missing-param 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 e28dadacee0a..59099cc31f51 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 @@ -315,6 +315,8 @@ ProtocolConfiguration, ProtocolVersionRecord, RaiConfig, + RaiInvocationModeration, + RaiSseTextSelector, RankingOptions, RealtimeAudioFormats, RealtimeAudioFormatsAudioPcm, @@ -575,8 +577,8 @@ VoiceAgentSessionResponseConfig, VoiceAgentSessionUpdateConfig, VoiceAgentStaticInterimResponseConfig, - VoiceAgentSubAgent, - VoiceAgentSubAgentConfig, + VoiceAgentSubagent, + VoiceAgentSubagentConfig, VoiceAgentSubagentResponsePolicy, VoiceAgentSystemTool, VoiceAgentTemplateGreetingConfig, @@ -685,6 +687,8 @@ PageOrder, PendingUploadType, PublishApprovalStatus, + RaiInvocationContentType, + RaiInvocationMode, RankerVersionType, RealtimeAudioFormatsType, RealtimeClientEventType, @@ -763,6 +767,7 @@ VoiceModelType, VoiceOutputModality, VoiceType, + _AgentDefinitionOptInKeys, ) from ._patch import __all__ as _patch_all from ._patch import * @@ -1069,6 +1074,8 @@ "ProtocolConfiguration", "ProtocolVersionRecord", "RaiConfig", + "RaiInvocationModeration", + "RaiSseTextSelector", "RankingOptions", "RealtimeAudioFormats", "RealtimeAudioFormatsAudioPcm", @@ -1329,8 +1336,8 @@ "VoiceAgentSessionResponseConfig", "VoiceAgentSessionUpdateConfig", "VoiceAgentStaticInterimResponseConfig", - "VoiceAgentSubAgent", - "VoiceAgentSubAgentConfig", + "VoiceAgentSubagent", + "VoiceAgentSubagentConfig", "VoiceAgentSubagentResponsePolicy", "VoiceAgentSystemTool", "VoiceAgentTemplateGreetingConfig", @@ -1436,6 +1443,8 @@ "PageOrder", "PendingUploadType", "PublishApprovalStatus", + "RaiInvocationContentType", + "RaiInvocationMode", "RankerVersionType", "RealtimeAudioFormatsType", "RealtimeClientEventType", @@ -1514,6 +1523,7 @@ "VoiceModelType", "VoiceOutputModality", "VoiceType", + "_AgentDefinitionOptInKeys", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() 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 3fa58f3b8800..3bc39290533c 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 @@ -1014,6 +1014,28 @@ class PublishApprovalStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): tenant-scoped titles are reviewed.""" +class RaiInvocationContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """How an invocations request/response body is parsed to locate text for content-safety + moderation. + """ + + JSON = "json" + """Parse the body as JSON and evaluate the declared paths/selectors.""" + TEXT = "text" + """Treat the whole (size-capped) body as text; paths/selectors are ignored.""" + + +class RaiInvocationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Author-declared response shape for the invocations protocol.""" + + NON_STREAMING = "non_streaming" + """Non-streaming response body.""" + STREAMING = "streaming" + """Streaming response body.""" + BOTH = "both" + """Both non-streaming and streaming response bodies.""" + + class RankerVersionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of RankerVersionType.""" @@ -1964,8 +1986,6 @@ class VoiceAgentAvatarOutputProtocol(str, Enum, metaclass=CaseInsensitiveEnumMet """WEBRTC.""" WEBSOCKET = "websocket" """WEBSOCKET.""" - WEBSOCKET_BINARY = "websocket-binary" - """Binary WebSocket transport.""" class VoiceAgentAvatarType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -2173,12 +2193,12 @@ 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. + 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. + 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. + 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 7fa1df6bde9c..1244866c5205 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 @@ -14482,16 +14482,136 @@ class RaiConfig(_Model): # pylint: disable=docstring-keyword-should-match-keywo :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 """ 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, *, rai_policy_name: str, + invocations_moderation: Optional["_models.RaiInvocationModeration"] = 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 RaiInvocationModeration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Declares where request/response text lives so content-safety guardrails can extract it. + + :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] + """ + + 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, + *, + 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 + 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 RaiSseTextSelector(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An SSE event-type to text-field selector for streaming invocation output. + + :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 + """ + + 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, + *, + event_type: str, + text_field: Optional[str] = None, ) -> None: ... @overload @@ -16612,11 +16732,10 @@ class RealtimeServerEventConversationItemAdded( * 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. + 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`). - + 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. @@ -16668,13 +16787,13 @@ class RealtimeServerEventConversationItemCreated( 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`. + 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. + 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. + to the Conversation. :ivar event_id: The unique ID of the server event. Required. :vartype event_id: str @@ -19031,7 +19150,7 @@ class RealtimeServerEventSessionCreated( """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: "_models.VoiceAgentSessionResponseConfig" = rest_field( + session: "_unions.VoiceAgentSessionResponse" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The session configuration. Required. Is one of the following types: @@ -19045,7 +19164,7 @@ def __init__( self, *, event_id: str, - session: "_models.VoiceAgentSessionResponseConfig", + session: "_unions.VoiceAgentSessionResponse", conversation_id: Optional[str] = None, ) -> None: ... @@ -19079,7 +19198,7 @@ class RealtimeServerEventSessionUpdated( """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: "_models.VoiceAgentSessionResponseConfig" = rest_field( + session: "_unions.VoiceAgentSessionResponse" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The session configuration. Required. Is one of the following types: @@ -19090,7 +19209,7 @@ def __init__( self, *, event_id: str, - session: "_models.VoiceAgentSessionResponseConfig", + session: "_unions.VoiceAgentSessionResponse", ) -> None: ... @overload @@ -20163,10 +20282,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" @@ -24100,14 +24221,13 @@ class VoiceAgentAudioOutputConfig(_Model): # pylint: disable=docstring-keyword- * `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`. + `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. + `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 @@ -24255,7 +24375,7 @@ class VoiceAgentAvatarConfig(_Model): # pylint: disable=docstring-keyword-shoul :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", "websocket", and "websocket-binary". + "webrtc" and "websocket". :vartype output_protocol: str or ~azure.ai.projects.models.VoiceAgentAvatarOutputProtocol :ivar model: The avatar model identifier. :vartype model: str @@ -24280,8 +24400,8 @@ class VoiceAgentAvatarConfig(_Model): # pylint: disable=docstring-keyword-shoul 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\", - \"websocket\", and \"websocket-binary\".""" + """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( @@ -24996,9 +25116,7 @@ class VoiceAgentClientEventSessionUpdate(_Model): # pylint: disable=docstring-k visibility=["read", "create", "update", "delete", "query"] ) """The event type, must be ``session.update``. Required. SESSION_UPDATE.""" - session: "_models.VoiceAgentSessionUpdateConfig" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) + 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""" @@ -25007,7 +25125,7 @@ def __init__( self, *, type: Literal[RealtimeClientEventType.SESSION_UPDATE], - session: "_models.VoiceAgentSessionUpdateConfig", + session: "_unions.VoiceAgentSessionUpdate", event_id: Optional[str] = None, ) -> None: ... @@ -25095,7 +25213,7 @@ class VoiceAgentDefinition( :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 + :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 @@ -25186,7 +25304,7 @@ class VoiceAgentDefinition( ) """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( + 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 @@ -25220,7 +25338,7 @@ def __init__( 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, + subagent_config: Optional["_models.VoiceAgentSubagentConfig"] = None, store: Optional[bool] = None, ) -> None: ... @@ -27221,7 +27339,7 @@ class VoiceAgentSessionAvatarConfig( :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", "websocket", and "websocket-binary". + "webrtc" and "websocket". :vartype output_protocol: str or ~azure.ai.projects.models.VoiceAgentAvatarOutputProtocol :ivar model: The avatar model identifier. :vartype model: str @@ -27590,7 +27708,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = "static_interim_response" # type: ignore -class VoiceAgentSubAgent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class VoiceAgentSubagent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A sibling Foundry text agent that a voice agent may consult as a background specialist. :ivar agent_name: The name of the subagent. The subagent must be in the same project as the @@ -27650,15 +27768,15 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentSubAgentConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only +class VoiceAgentSubagentConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Configuration for sibling Foundry text agents that a voice agent may consult. :ivar subagents: The sibling Foundry text agents, in the same project, that this voice agent may consult. Required. - :vartype subagents: list[~azure.ai.projects.models.VoiceAgentSubAgent] + :vartype subagents: list[~azure.ai.projects.models.VoiceAgentSubagent] """ - subagents: list["_models.VoiceAgentSubAgent"] = rest_field( + subagents: list["_models.VoiceAgentSubagent"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The sibling Foundry text agents, in the same project, that this voice agent may consult. @@ -27668,7 +27786,7 @@ class VoiceAgentSubAgentConfig(_Model): # pylint: disable=docstring-keyword-sho def __init__( self, *, - subagents: list["_models.VoiceAgentSubAgent"], + subagents: list["_models.VoiceAgentSubagent"], ) -> None: ... @overload @@ -28590,7 +28708,7 @@ class VoiceResponse(VoiceResponseBase): # pylint: disable=docstring-keyword-sho :vartype completed_at: ~datetime.datetime """ - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) # type: ignore[reportIncompatibleVariableOverride] + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique id of the response. Required.""" output: Optional[list["_models.RealtimeConversationItem"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] @@ -28599,7 +28717,7 @@ class VoiceResponse(VoiceResponseBase): # pylint: disable=docstring-keyword-sho response (GET .../responses/{response_id}) or use the paged response-items route (GET .../responses/{response_id}/items) for its output items. Each item's ``response_id`` also links it back to this response in the conversation-level items list.""" - conversation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) # type: ignore[reportIncompatibleVariableOverride] + conversation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The id of the conversation this response belongs to. Required.""" audio: Optional["_models.VoiceResponseAudio"] = rest_field( visibility=["read", "create", "update", "delete", "query"] diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/__init__.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/__init__.py index bab1be543cc5..9a9972c6e723 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/__init__.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/__init__.py @@ -19,6 +19,7 @@ from ._operations import DatasetsOperations # type: ignore from ._operations import DeploymentsOperations # type: ignore from ._operations import IndexesOperations # type: ignore +from ._operations import VoiceAgentWebSocketOperations # type: ignore from ._operations import AgentEndpointConversationsOperations # type: ignore from ._operations import ToolboxesOperations # type: ignore @@ -34,6 +35,7 @@ "DatasetsOperations", "DeploymentsOperations", "IndexesOperations", + "VoiceAgentWebSocketOperations", "AgentEndpointConversationsOperations", "ToolboxesOperations", ] 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 a935e879f5a9..654ef6804690 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 @@ -690,7 +690,7 @@ def build_agents_create_telephony_binding_request( # pylint: disable=name-too-l accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/telephony_bindings" + _url = "/agents/{agent_name}/telephony/bindings" path_format_arguments = { "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), } @@ -732,7 +732,7 @@ def build_agents_list_telephony_bindings_request( # pylint: disable=name-too-lo accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/telephony_bindings" + _url = "/agents/{agent_name}/telephony/bindings" path_format_arguments = { "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), } @@ -770,7 +770,7 @@ def build_agents_get_telephony_binding_request( # pylint: disable=name-too-long accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/telephony_bindings/{binding_id}" + _url = "/agents/{agent_name}/telephony/bindings/{binding_id}" path_format_arguments = { "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), "binding_id": _SERIALIZER.url("binding_id", binding_id, "str"), @@ -798,7 +798,7 @@ def build_agents_update_telephony_binding_request( # pylint: disable=name-too-l accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/telephony_bindings/{binding_id}" + _url = "/agents/{agent_name}/telephony/bindings/{binding_id}" path_format_arguments = { "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), "binding_id": _SERIALIZER.url("binding_id", binding_id, "str"), @@ -831,7 +831,7 @@ def build_agents_delete_telephony_binding_request( # pylint: disable=name-too-l api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) # Construct URL - _url = "/agents/{agent_name}/telephony_bindings/{binding_id}" + _url = "/agents/{agent_name}/telephony/bindings/{binding_id}" path_format_arguments = { "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), "binding_id": _SERIALIZER.url("binding_id", binding_id, "str"), @@ -873,7 +873,7 @@ def build_agents_list_telephony_calls_request( # pylint: disable=name-too-long accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/telephony_calls" + _url = "/agents/{agent_name}/telephony/calls" path_format_arguments = { "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), } @@ -913,7 +913,7 @@ def build_agents_get_telephony_call_request(agent_name: str, call_id: str, **kwa accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/telephony_calls/{call_id}" + _url = "/agents/{agent_name}/telephony/calls/{call_id}" path_format_arguments = { "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), "call_id": _SERIALIZER.url("call_id", call_id, "str"), @@ -941,7 +941,7 @@ def build_agents_transfer_telephony_call_request( # pylint: disable=name-too-lo accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/telephony_calls/{call_id}:transfer" + _url = "/agents/{agent_name}/telephony/calls/{call_id}:transfer" path_format_arguments = { "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), "call_id": _SERIALIZER.url("call_id", call_id, "str"), @@ -968,7 +968,7 @@ def build_agents_end_telephony_call_request(agent_name: str, call_id: str, **kwa accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/telephony_calls/{call_id}:end" + _url = "/agents/{agent_name}/telephony/calls/{call_id}:end" path_format_arguments = { "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), "call_id": _SERIALIZER.url("call_id", call_id, "str"), @@ -995,7 +995,7 @@ def build_agents_get_telephony_transfer_targets_request( # pylint: disable=name accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/telephony_transfer_targets" + _url = "/agents/{agent_name}/telephony/transfer_targets" path_format_arguments = { "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), } @@ -1022,7 +1022,7 @@ def build_agents_replace_telephony_transfer_targets_request( # pylint: disable= accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/telephony_transfer_targets" + _url = "/agents/{agent_name}/telephony/transfer_targets" path_format_arguments = { "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), } @@ -1692,56 +1692,81 @@ def build_indexes_create_or_update_request(name: str, version: str, **kwargs: An return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_agent_endpoint_conversations_get_agent_conversation_item_generated_audio_request( # pylint: disable=name-too-long - agent_name: str, conversation_id: str, item_id: str, **kwargs: Any +def build_voice_agent_web_socket_connect_voice_agent_request( # pylint: disable=name-too-long + agent_name: str, + *, + foundry_features_query: Optional[Literal[_AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW]] = None, + transport: Optional[Union[str, _models.VoiceAgentTransport]] = None, + store: Optional[bool] = None, + structured_input: Optional[str] = None, + agent_version_override: Optional[str] = None, + websocket_subprotocol: Optional[Union[str, _models.VoiceAgentWebSocketSubprotocol]] = 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/conversations/{conversation_id}/items/{item_id}/audio/generated" - ) + _url = "/agents/{agent_name}/endpoint/protocols/voice" 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 + if foundry_features_query is not None: + _params["foundry_features"] = _SERIALIZER.query("foundry_features_query", foundry_features_query, "str") + if transport is not None: + _params["transport"] = _SERIALIZER.query("transport", transport, "str") + if store is not None: + _params["store"] = _SERIALIZER.query("store", store, "bool") + if structured_input is not None: + _params["structured_input"] = _SERIALIZER.query("structured_input", structured_input, "str") + if agent_version_override is not None: + _params["x-agent-version-override"] = _SERIALIZER.query("agent_version_override", agent_version_override, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if websocket_subprotocol is not None: + _headers["Sec-WebSocket-Protocol"] = _SERIALIZER.header("websocket_subprotocol", websocket_subprotocol, "str") return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_agent_endpoint_conversations_get_agent_conversation_item_generated_audio_content_request( # pylint: disable=name-too-long - agent_name: str, conversation_id: str, item_id: str, **kwargs: Any +def build_agent_endpoint_conversations_list_agent_conversations_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", "audio/wav") + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/items/{item_id}/audio/generated/content" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations" 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 + 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 @@ -1750,18 +1775,20 @@ def build_agent_endpoint_conversations_get_agent_conversation_item_generated_aud return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_create_version_request(name: str, **kwargs: Any) -> HttpRequest: +def build_agent_endpoint_conversations_get_agent_conversation_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 {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/toolboxes/{name}/versions" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "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 @@ -1770,24 +1797,22 @@ def build_toolboxes_create_version_request(name: str, **kwargs: Any) -> HttpRequ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_get_request(name: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) +def build_agent_endpoint_conversations_delete_agent_conversation_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")) - accept = _headers.pop("Accept", "application/json") - # Construct URL - _url = "/toolboxes/{name}" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "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 @@ -1795,13 +1820,12 @@ def build_toolboxes_get_request(name: str, **kwargs: Any) -> HttpRequest: # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_toolboxes_list_request( +def build_agent_endpoint_conversations_list_agent_conversation_responses_request( # pylint: disable=name-too-long + agent_name: str, + conversation_id: str, *, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, @@ -1816,7 +1840,13 @@ def build_toolboxes_list_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/toolboxes" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/responses" + 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: @@ -1835,8 +1865,38 @@ def build_toolboxes_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_list_versions_request( - name: str, +def build_agent_endpoint_conversations_get_agent_conversation_response_request( # pylint: disable=name-too-long + agent_name: str, conversation_id: str, response_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/conversations/{conversation_id}/responses/{response_id}" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + "response_id": _SERIALIZER.url("response_id", response_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_agent_endpoint_conversations_list_agent_conversation_response_items_request( # pylint: disable=name-too-long + agent_name: str, + conversation_id: str, + response_id: str, *, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, @@ -1851,9 +1911,11 @@ def build_toolboxes_list_versions_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/toolboxes/{name}/versions" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/responses/{response_id}/items" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + "response_id": _SERIALIZER.url("response_id", response_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1875,7 +1937,16 @@ def build_toolboxes_list_versions_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_get_version_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_agent_endpoint_conversations_list_agent_conversation_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 {}) @@ -1883,15 +1954,23 @@ def build_toolboxes_get_version_request(name: str, version: str, **kwargs: Any) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/toolboxes/{name}/versions/{version}" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/items" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "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 @@ -1900,18 +1979,21 @@ def build_toolboxes_get_version_request(name: str, version: str, **kwargs: Any) return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_update_request(name: str, **kwargs: Any) -> HttpRequest: +def build_agent_endpoint_conversations_get_agent_conversation_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 {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/toolboxes/{name}" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/items/{item_id}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "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 @@ -1920,21 +2002,26 @@ def build_toolboxes_update_request(name: str, **kwargs: Any) -> HttpRequest: _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_delete_request(name: str, **kwargs: Any) -> HttpRequest: +def build_agent_endpoint_conversations_get_agent_conversation_item_audio_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 = "/toolboxes/{name}" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/items/{item_id}/audio" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "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 @@ -1942,18 +2029,27 @@ def build_toolboxes_delete_request(name: str, **kwargs: Any) -> HttpRequest: # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_delete_version_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_agent_endpoint_conversations_get_agent_conversation_item_audio_content_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 = "/toolboxes/{name}/versions/{version}" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/items/{item_id}/audio/content" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "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 @@ -1961,81 +2057,62 @@ def build_toolboxes_delete_version_request(name: str, version: str, **kwargs: An # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_voice_agent_web_socket_connect_voice_agent_request( # pylint: disable=name-too-long - agent_name: str, - *, - foundry_features_query: Optional[Literal[_AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW]] = None, - transport: Optional[Union[str, _models.VoiceAgentTransport]] = None, - store: Optional[bool] = None, - agent_version_override: Optional[str] = None, - websocket_subprotocol: Optional[Union[str, _models.VoiceAgentWebSocketSubprotocol]] = None, - **kwargs: Any + +def build_agent_endpoint_conversations_get_agent_conversation_item_generated_audio_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" + _url = ( + "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/items/{item_id}/audio/generated" + ) 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 - if foundry_features_query is not None: - _params["foundry_features"] = _SERIALIZER.query("foundry_features_query", foundry_features_query, "str") - if transport is not None: - _params["transport"] = _SERIALIZER.query("transport", transport, "str") - if store is not None: - _params["store"] = _SERIALIZER.query("store", store, "bool") - if agent_version_override is not None: - _params["x-agent-version-override"] = _SERIALIZER.query("agent_version_override", agent_version_override, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if websocket_subprotocol is not None: - _headers["Sec-WebSocket-Protocol"] = _SERIALIZER.header("websocket_subprotocol", websocket_subprotocol, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_endpoint_conversations_list_agent_conversations_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 +def build_agent_endpoint_conversations_get_agent_conversation_item_generated_audio_content_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") + accept = _headers.pop("Accept", "audio/wav") # Construct URL - _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations" + _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/items/{item_id}/audio/generated/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 - 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 @@ -2044,7 +2121,7 @@ def build_beta_agent_endpoint_conversations_list_agent_conversations_request( # return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_endpoint_conversations_get_agent_conversation_request( # pylint: disable=name-too-long +def build_agent_endpoint_conversations_get_agent_conversation_audio_request( # pylint: disable=name-too-long agent_name: str, conversation_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2054,7 +2131,7 @@ def build_beta_agent_endpoint_conversations_get_agent_conversation_request( # p accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}" + _url = "/agents/{agent_name}/endpoint/protocols/voice/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"), @@ -2071,14 +2148,17 @@ def build_beta_agent_endpoint_conversations_get_agent_conversation_request( # p return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_endpoint_conversations_delete_agent_conversation_request( # pylint: disable=name-too-long +def build_agent_endpoint_conversations_get_agent_conversation_audio_content_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/conversations/{conversation_id}" + _url = "/agents/{agent_name}/endpoint/protocols/voice/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"), @@ -2089,54 +2169,40 @@ def build_beta_agent_endpoint_conversations_delete_agent_conversation_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_endpoint_conversations_list_agent_conversation_responses_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: + +def build_toolboxes_create_version_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) 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/conversations/{conversation_id}/responses" + _url = "/toolboxes/{name}/versions" path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + "name": _SERIALIZER.url("name", 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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_endpoint_conversations_get_agent_conversation_response_request( # pylint: disable=name-too-long - agent_name: str, conversation_id: str, response_id: str, **kwargs: Any -) -> HttpRequest: +def build_toolboxes_get_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2144,11 +2210,9 @@ def build_beta_agent_endpoint_conversations_get_agent_conversation_response_requ accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/responses/{response_id}" + _url = "/toolboxes/{name}" path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), - "response_id": _SERIALIZER.url("response_id", response_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2162,10 +2226,7 @@ def build_beta_agent_endpoint_conversations_get_agent_conversation_response_requ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_endpoint_conversations_list_agent_conversation_response_items_request( # pylint: disable=name-too-long - agent_name: str, - conversation_id: str, - response_id: str, +def build_toolboxes_list_request( *, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, @@ -2180,14 +2241,7 @@ def build_beta_agent_endpoint_conversations_list_agent_conversation_response_ite accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/responses/{response_id}/items" - path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), - "response_id": _SERIALIZER.url("response_id", response_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore + _url = "/toolboxes" # Construct parameters if limit is not None: @@ -2206,9 +2260,8 @@ def build_beta_agent_endpoint_conversations_list_agent_conversation_response_ite return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_endpoint_conversations_list_agent_conversation_items_request( # pylint: disable=name-too-long - agent_name: str, - conversation_id: str, +def build_toolboxes_list_versions_request( + name: str, *, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, @@ -2223,10 +2276,9 @@ def build_beta_agent_endpoint_conversations_list_agent_conversation_items_reques accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/items" + _url = "/toolboxes/{name}/versions" path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2248,9 +2300,7 @@ def build_beta_agent_endpoint_conversations_list_agent_conversation_items_reques return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_endpoint_conversations_get_agent_conversation_item_request( # pylint: disable=name-too-long - agent_name: str, conversation_id: str, item_id: str, **kwargs: Any -) -> HttpRequest: +def build_toolboxes_get_version_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2258,11 +2308,10 @@ def build_beta_agent_endpoint_conversations_get_agent_conversation_item_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agents/{agent_name}/endpoint/protocols/voice/conversations/{conversation_id}/items/{item_id}" + _url = "/toolboxes/{name}/versions/{version}" 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"), + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2276,49 +2325,18 @@ def build_beta_agent_endpoint_conversations_get_agent_conversation_item_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_endpoint_conversations_get_agent_conversation_item_audio_request( # pylint: disable=name-too-long - agent_name: str, conversation_id: str, item_id: str, **kwargs: Any -) -> HttpRequest: +def build_toolboxes_update_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) 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/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_agent_endpoint_conversations_get_agent_conversation_item_audio_content_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/conversations/{conversation_id}/items/{item_id}/audio/content" + _url = "/toolboxes/{name}" 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"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2327,25 +2345,21 @@ def build_beta_agent_endpoint_conversations_get_agent_conversation_item_audio_co _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_endpoint_conversations_get_agent_conversation_audio_request( # pylint: disable=name-too-long - agent_name: str, conversation_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) +def build_toolboxes_delete_request(name: str, **kwargs: Any) -> HttpRequest: _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/conversations/{conversation_id}/audio" + _url = "/toolboxes/{name}" path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2353,26 +2367,18 @@ def build_beta_agent_endpoint_conversations_get_agent_conversation_audio_request # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_beta_agent_endpoint_conversations_get_agent_conversation_audio_content_request( # pylint: disable=name-too-long - agent_name: str, conversation_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) +def build_toolboxes_delete_version_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _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/conversations/{conversation_id}/audio/content" + _url = "/toolboxes/{name}/versions/{version}" path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2380,10 +2386,7 @@ def build_beta_agent_endpoint_conversations_get_agent_conversation_audio_content # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_beta_agent_insight_monitors_list_request( # pylint: disable=name-too-long @@ -4972,9 +4975,6 @@ def __init__(self, *args, **kwargs) -> None: 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") - self.agent_endpoint_conversations = BetaAgentEndpointConversationsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.agent_insight_monitors = BetaAgentInsightMonitorsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -5077,8 +5077,27 @@ def get(self, agent_name: str, **kwargs: Any) -> _models.AgentDetails: return deserialized # type: ignore + @overload + def generate_agent( + self, body: _models.GenerateVoiceAgentRequest, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AgentDetails: + """Generate an agent. + + Generates and creates an agent from kind-specific high-level inputs. The generated definition + remains fully editable through the standard agent versioning operations. + + :param body: The kind-specific inputs for generating and creating an agent. Required. + :type body: ~azure.ai.projects.models.GenerateVoiceAgentRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AgentDetails. The AgentDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.AgentDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace - def generate_agent(self, body: _models.GenerateVoiceAgentRequest, **kwargs: Any) -> _models.AgentDetails: + def generate_agent(self, body: "_unions.GenerateAgentRequest", **kwargs: Any) -> _models.AgentDetails: """Generate an agent. Generates and creates an agent from kind-specific high-level inputs. The generated definition @@ -6961,23 +6980,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. @@ -7019,8 +7044,7 @@ def get_session_log_stream( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - kwargs.pop("stream", None) # must always stream; discard any caller override - _stream = True + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -8972,8 +8996,8 @@ def replace_telephony_transfer_targets( agent_name: str, body: JSON, *, - etag: str, - match_condition: MatchConditions, + etag: List[_models.TelephonyTransferTarget], + match_condition: str, content_type: str = "application/json", **kwargs: Any ) -> _models.TelephonyTransferTargets: @@ -8986,9 +9010,9 @@ def replace_telephony_transfer_targets( :param body: Required. :type body: JSON :keyword etag: check if resource is changed. Set None to skip checking etag. Required. - :paramtype etag: str + :paramtype etag: list[~azure.ai.projects.models.TelephonyTransferTarget] :keyword match_condition: The match condition to use upon the etag. Required. - :paramtype match_condition: ~azure.core.MatchConditions + :paramtype match_condition: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9004,8 +9028,8 @@ def replace_telephony_transfer_targets( agent_name: str, body: IO[bytes], *, - etag: str, - match_condition: MatchConditions, + etag: List[_models.TelephonyTransferTarget], + match_condition: str, content_type: str = "application/json", **kwargs: Any ) -> _models.TelephonyTransferTargets: @@ -9018,9 +9042,9 @@ def replace_telephony_transfer_targets( :param body: Required. :type body: IO[bytes] :keyword etag: check if resource is changed. Set None to skip checking etag. Required. - :paramtype etag: str + :paramtype etag: list[~azure.ai.projects.models.TelephonyTransferTarget] :keyword match_condition: The match condition to use upon the etag. Required. - :paramtype match_condition: ~azure.core.MatchConditions + :paramtype match_condition: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -11578,14 +11602,14 @@ def create_or_update( return deserialized # type: ignore -class AgentEndpointConversationsOperations: # pylint: disable=docstring-missing-param +class VoiceAgentWebSocketOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.ai.projects.AIProjectClient`'s - :attr:`agent_endpoint_conversations` attribute. + :attr:`voice_agent_web_socket` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -11596,108 +11620,90 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get_agent_conversation_item_generated_audio( # pylint: disable=name-too-long - self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any - ) -> _models.VoiceGeneratedItemAudioResponse: - """Get a voice agent conversation item's generated audio metadata. - - Returns metadata for a conversation item's generated audio. This subordinate artifact is - separate from the canonical heard-audio segment and exists only when playback was interrupted - and the service rendered more audio than the listener heard, including when the response ends - as cancelled. Returns ``404`` when the conversation or item was not persisted, or when no - generated audio exists beyond the heard segment. - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the item. Required. - :type conversation_id: str - :param item_id: The id of the conversation item whose generated audio metadata is retrieved. - Required. - :type item_id: str - :return: VoiceGeneratedItemAudioResponse. The VoiceGeneratedItemAudioResponse is compatible - with MutableMapping - :rtype: ~azure.ai.projects.models.VoiceGeneratedItemAudioResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) + def connect_voice_agent( # pylint: disable=inconsistent-return-statements + self, + agent_name: str, + *, + foundry_features_query: Optional[Literal[_AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW]] = None, + transport: Optional[Union[str, _models.VoiceAgentTransport]] = None, + store: Optional[bool] = None, + structured_input: Optional[str] = None, + agent_version_override: Optional[str] = None, + websocket_subprotocol: Optional[Union[str, _models.VoiceAgentWebSocketSubprotocol]] = None, + **kwargs: Any + ) -> None: + """Connect to a voice agent. - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + Connects to a voice agent over WebSocket. The client must send an HTTP GET with ``Upgrade: + websocket`` + headers. The optional ``realtime`` subprotocol is the only accepted subprotocol value. Supply + the + ``VoiceAgents=V1Preview`` opt-in through either the ``Foundry-Features`` header or the + ``foundry_features`` + query parameter. - cls: ClsType[_models.VoiceGeneratedItemAudioResponse] = kwargs.pop("cls", None) + Handshake failures are evaluated in the following order, independent of the requested + ``transport``: - _request = build_agent_endpoint_conversations_get_agent_conversation_item_generated_audio_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.VoiceGeneratedItemAudioResponse, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_agent_conversation_item_generated_audio_content( # pylint: disable=name-too-long - self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any - ) -> Iterator[bytes]: - """Stream a voice agent conversation item's generated audio. - - Streams a conversation item's generated audio as a WAV (``audio/wav``) byte stream through the - service. This subordinate artifact exists only when playback was interrupted and the service - rendered more audio than the listener heard, including when the response ends as cancelled. - This route serves Foundry-managed storage only. For bring-your-own-storage (BYOS) recordings - the bytes are not proxied, so this route returns ``409 Conflict``. Returns ``404`` when the - conversation or item was not persisted, or when no generated audio exists beyond the heard - segment. + 1. Agent enablement (any transport): if the target agent is disabled, the handshake fails + before the + `101 Switching Protocols` upgrade with `409 Conflict`, using the shared Foundry + `ApiErrorResponse` shape + with `error.code = agent_disabled`. This failure is terminal until the caller enables the + agent, and it + takes precedence over the WebRTC-specific checks below. + 2. WebRTC availability (only when `transport=webrtc`, and only once the agent itself is + enabled): the agent + must have the WebRTC transport capability configured. If the agent is enabled but WebRTC is not + available + for it, the handshake fails with `404 Not Found`. This is distinct from the `409 + agent_disabled` case + above, which concerns the agent itself rather than its WebRTC capability. + 3. WebRTC compatibility (only when `transport=webrtc`): WebRTC does not support + bring-your-own-model (BYOM) + or hosted-agent voice agents; those requests fail with `400 Bad Request`. - :param agent_name: The name of the agent. Required. + :param agent_name: The name of the voice agent. Required. :type agent_name: str - :param conversation_id: The id of the conversation that contains the item. Required. - :type conversation_id: str - :param item_id: The id of the conversation item whose generated audio is streamed. Required. - :type item_id: str - :return: Iterator[bytes] - :rtype: Iterator[bytes] + :keyword foundry_features_query: A query alternative to the ``Foundry-Features`` header for + clients that cannot set headers during a + WebSocket handshake. Set this to ``VoiceAgents=V1Preview``. Either this query parameter or the + header is + required. VOICE_AGENTS_V1_PREVIEW. Default value is None. + :paramtype foundry_features_query: str or ~azure.ai.projects.models.VOICE_AGENTS_V1_PREVIEW + :keyword transport: Selects the connection transport. Omit or send ``websocket`` for the + default, where signaling and audio are + exchanged as JSON events over this WebSocket. Send ``webrtc`` to negotiate a WebRTC + connection: the WebSocket + then carries only SDP signaling (``rtc.call.sdp.create`` / ``rtc.call.sdp.created``) while + media and the data + channel are peer-to-peer. Known values are: "websocket" and "webrtc". Default value is None. + :paramtype transport: str or ~azure.ai.projects.models.VoiceAgentTransport + :keyword store: Whether to persist the conversation created by this WebSocket session. If + omitted, the service honors the + persisted voice agent definition's configured ``store`` value. If supplied, this value + overrides the + definition's ``store`` setting for this session only. Default value is None. + :paramtype store: bool + :keyword structured_input: Per-session values for the voice agent's declared + ``structured_inputs``, serialized as a JSON object and + URL-encoded as this query parameter. Supplied values override definition defaults when + rendering the + agent's instructions and session-start greeting for this session only. The decoded value must + be a JSON + object no larger than 32 KiB with a maximum nesting depth of 16. Default value is None. + :paramtype structured_input: str + :keyword agent_version_override: Selects a specific version of the voice agent for this + session. Default value is None. + :paramtype agent_version_override: str + :keyword websocket_subprotocol: The requested WebSocket subprotocol. Omit this header or + request exactly ``realtime``. "realtime" Default value is None. + :paramtype websocket_subprotocol: str or + ~azure.ai.projects.models.VoiceAgentWebSocketSubprotocol + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -11711,12 +11717,16 @@ def get_agent_conversation_item_generated_audio_content( # pylint: disable=name _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_agent_endpoint_conversations_get_agent_conversation_item_generated_audio_content_request( + _request = build_voice_agent_web_socket_connect_voice_agent_request( agent_name=agent_name, - conversation_id=conversation_id, - item_id=item_id, + foundry_features_query=foundry_features_query, + transport=transport, + store=store, + structured_input=structured_input, + agent_version_override=agent_version_override, + websocket_subprotocol=websocket_subprotocol, api_version=self._config.api_version, headers=_headers, params=_params, @@ -11726,20 +11736,14 @@ def get_agent_conversation_item_generated_audio_content( # pylint: disable=name } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", True) + _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 + if response.status_code not in [101]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ApiErrorResponse, @@ -11748,24 +11752,22 @@ def get_agent_conversation_item_generated_audio_content( # pylint: disable=name 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() + response_headers["Sec-WebSocket-Protocol"] = self._deserialize( + "str", response.headers.get("Sec-WebSocket-Protocol") + ) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore + return cls(pipeline_response, None, response_headers) # type: ignore -class ToolboxesOperations: # pylint: disable=docstring-missing-param +class AgentEndpointConversationsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.ai.projects.AIProjectClient`'s - :attr:`toolboxes` attribute. + :attr:`agent_endpoint_conversations` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -11775,126 +11777,117 @@ def __init__(self, *args, **kwargs) -> None: 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") - @overload - def create_version( + @distributed_trace + def list_agent_conversations( self, - name: str, + agent_name: str, *, - tools: List[_models.ToolboxTool], - content_type: str = "application/json", - description: Optional[str] = None, - metadata: Optional[dict[str, str]] = None, - skills: Optional[List[_models.ToolboxSkill]] = None, - policies: Optional[_models.ToolboxPolicies] = None, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, **kwargs: Any - ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. + ) -> ItemPaged["_models.VoiceConversation"]: + """List voice agent conversations. - Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. + Returns the conversations persisted for the specified voice agent endpoint. Conversations are + present when the session's effective ``store`` setting is ``true``, whether inherited from the + agent definition or enabled by the WebSocket session override. - :param name: The name of the toolbox. If the toolbox does not exist, it will be created. - Required. - :type name: str - :keyword tools: The list of tools to include in this version. Required. - :paramtype tools: list[~azure.ai.projects.models.ToolboxTool] - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword description: A human-readable description of the toolbox. Default value is None. - :paramtype description: str - :keyword metadata: Arbitrary key-value metadata to associate with the toolbox. Default value is - None. - :paramtype metadata: dict[str, str] - :keyword skills: The list of skill sources to include in this version. A skill reference - specifies a skill name and optionally a version. If version is omitted, the skill's default - version is used. Default value is None. - :paramtype skills: list[~azure.ai.projects.models.ToolboxSkill] - :keyword policies: Policy configuration for this toolbox version. Default value is None. - :paramtype policies: ~azure.ai.projects.models.ToolboxPolicies - :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxVersionObject + :param agent_name: The name of the 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 VoiceConversation + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.VoiceConversation] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - @overload - def create_version( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. + cls: ClsType[List[_models.VoiceConversation]] = kwargs.pop("cls", None) - Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - :param name: The name of the toolbox. If the toolbox does not exist, it will be created. - Required. - :type name: str - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxVersionObject - :raises ~azure.core.exceptions.HttpResponseError: - """ + def prepare_request(_continuation_token=None): - @overload - def create_version( - self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. + _request = build_agent_endpoint_conversations_list_agent_conversations_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 - Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.VoiceConversation], + 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) - :param name: The name of the toolbox. If the toolbox does not exist, it will be created. - Required. - :type name: str - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxVersionObject - :raises ~azure.core.exceptions.HttpResponseError: - """ + 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 create_version( - self, - name: str, - body: Union[JSON, IO[bytes]] = _Unset, - *, - tools: List[_models.ToolboxTool] = _Unset, - description: Optional[str] = None, - metadata: Optional[dict[str, str]] = None, - skills: Optional[List[_models.ToolboxSkill]] = None, - policies: Optional[_models.ToolboxPolicies] = None, - **kwargs: Any - ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. + def get_agent_conversation(self, agent_name: str, conversation_id: str, **kwargs: Any) -> _models.VoiceConversation: + """Get a voice agent conversation. - Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. + Retrieves a single conversation recorded for the specified voice agent endpoint by its id. + Returns ``404`` when the conversation was not persisted (``store = false``) or does not exist. - :param name: The name of the toolbox. If the toolbox does not exist, it will be created. - Required. - :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword tools: The list of tools to include in this version. Required. - :paramtype tools: list[~azure.ai.projects.models.ToolboxTool] - :keyword description: A human-readable description of the toolbox. Default value is None. - :paramtype description: str - :keyword metadata: Arbitrary key-value metadata to associate with the toolbox. Default value is - None. - :paramtype metadata: dict[str, str] - :keyword skills: The list of skill sources to include in this version. A skill reference - specifies a skill name and optionally a version. If version is omitted, the skill's default - version is used. Default value is None. - :paramtype skills: list[~azure.ai.projects.models.ToolboxSkill] - :keyword policies: Policy configuration for this toolbox version. Default value is None. - :paramtype policies: ~azure.ai.projects.models.ToolboxPolicies - :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxVersionObject + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation to retrieve. Required. + :type conversation_id: str + :return: VoiceConversation. The VoiceConversation is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceConversation :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -11905,35 +11898,15 @@ def create_version( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ToolboxVersionObject] = kwargs.pop("cls", None) - - if body is _Unset: - if tools is _Unset: - raise TypeError("missing required argument: tools") - body = { - "description": description, - "metadata": metadata, - "policies": policies, - "skills": skills, - "tools": tools, - } - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.VoiceConversation] = kwargs.pop("cls", None) - _request = build_toolboxes_create_version_request( - name=name, - content_type=content_type, + _request = build_agent_endpoint_conversations_get_agent_conversation_request( + agent_name=agent_name, + conversation_id=conversation_id, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -11950,39 +11923,210 @@ def create_version( 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, + 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.VoiceConversation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete_agent_conversation( # pylint: disable=inconsistent-return-statements + self, agent_name: str, conversation_id: str, **kwargs: Any + ) -> None: + """Delete a voice agent conversation. + + Deletes a conversation and all of its stored data — responses, items, and any audio (cascade). + This is the customer's explicit data-deletion control for voice conversations. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation to delete. 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_agent_endpoint_conversations_delete_agent_conversation_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_agent_conversation_responses( + 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.VoiceResponse"]: + """List responses in a voice agent conversation. + + Returns a paged collection of the responses (model inference turns) recorded for the specified + conversation. The per-response ``output`` projection may be omitted here; use the + response-items route for the canonical paged output. Returns ``404`` when the conversation was + not persisted (``store = false``). + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose responses are listed. 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 VoiceResponse + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.VoiceResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VoiceResponse]] = 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_agent_endpoint_conversations_list_agent_conversation_responses_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.VoiceResponse], + 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 ) - raise HttpResponseError(response=response, model=error) + response = pipeline_response.http_response - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ToolboxVersionObject, response.json()) + 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) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return pipeline_response - return deserialized # type: ignore + return ItemPaged(get_next, extract_data) @distributed_trace - def get(self, name: str, **kwargs: Any) -> _models.ToolboxObject: - """Retrieve a toolbox. + def get_agent_conversation_response( + self, agent_name: str, conversation_id: str, response_id: str, **kwargs: Any + ) -> _models.VoiceResponse: + """Get a voice agent conversation response. - Retrieves the specified toolbox and its current configuration. + Retrieves a single response from the specified conversation by its id, including its ``output`` + items, ``usage``, and status. Returns ``404`` when the conversation or response was not + persisted (``store = false``). - :param name: The name of the toolbox to retrieve. Required. - :type name: str - :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxObject + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the response. Required. + :type conversation_id: str + :param response_id: The id of the response to retrieve. Required. + :type response_id: str + :return: VoiceResponse. The VoiceResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -11996,10 +12140,12 @@ def get(self, name: str, **kwargs: Any) -> _models.ToolboxObject: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ToolboxObject] = kwargs.pop("cls", None) + cls: ClsType[_models.VoiceResponse] = kwargs.pop("cls", None) - _request = build_toolboxes_get_request( - name=name, + _request = build_agent_endpoint_conversations_get_agent_conversation_response_request( + agent_name=agent_name, + conversation_id=conversation_id, + response_id=response_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -12033,7 +12179,7 @@ def get(self, name: str, **kwargs: Any) -> _models.ToolboxObject: if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ToolboxObject, response.json()) + deserialized = _deserialize(_models.VoiceResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -12041,18 +12187,30 @@ def get(self, name: str, **kwargs: Any) -> _models.ToolboxObject: return deserialized # type: ignore @distributed_trace - def list( + def list_agent_conversation_response_items( self, + agent_name: str, + conversation_id: str, + response_id: str, *, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, before: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.ToolboxObject"]: - """List toolboxes. + ) -> ItemPaged["_models.RealtimeConversationItem"]: + """List items produced by a voice agent conversation response. - Returns the toolboxes available in the current project. + Returns a paged collection of the output items produced by a specific response (the response's + output projection). For the complete ordered conversation history — including user input and + client-created tool outputs — use the conversation items route instead. Returns ``404`` when + the conversation or response was not persisted (``store = false``). + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the response. Required. + :type conversation_id: str + :param response_id: The id of the response whose output items are listed. Required. + :type response_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. @@ -12067,14 +12225,14 @@ def list( 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 ToolboxObject - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.ToolboxObject] + :return: An iterator like instance of RealtimeConversationItem + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.RealtimeConversationItem] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ToolboxObject]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.RealtimeConversationItem]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -12086,7 +12244,10 @@ def list( def prepare_request(_continuation_token=None): - _request = build_toolboxes_list_request( + _request = build_agent_endpoint_conversations_list_agent_conversation_response_items_request( + agent_name=agent_name, + conversation_id=conversation_id, + response_id=response_id, limit=limit, order=order, after=_continuation_token, @@ -12104,7 +12265,7 @@ def prepare_request(_continuation_token=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.ToolboxObject], + List[_models.RealtimeConversationItem], deserialized.get("data", []), ) if cls: @@ -12133,21 +12294,26 @@ def get_next(_continuation_token=None): return ItemPaged(get_next, extract_data) @distributed_trace - def list_versions( + def list_agent_conversation_items( self, - name: str, + 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.ToolboxVersionObject"]: - """List toolbox versions. + ) -> ItemPaged["_models.RealtimeConversationItem"]: + """List items in a voice agent conversation. - Returns the available versions for the specified toolbox. + Returns a paged collection of items — the complete ordered conversation history, including user + input, assistant output, and client-created tool outputs (transcripts + tool events). Returns + ``404`` when the conversation was not persisted (``store = false``). - :param name: The name of the toolbox to list versions for. Required. - :type name: str + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose items are listed. 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. @@ -12162,14 +12328,14 @@ def list_versions( 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 ToolboxVersionObject - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.ToolboxVersionObject] + :return: An iterator like instance of RealtimeConversationItem + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.RealtimeConversationItem] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ToolboxVersionObject]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.RealtimeConversationItem]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -12181,8 +12347,9 @@ def list_versions( def prepare_request(_continuation_token=None): - _request = build_toolboxes_list_versions_request( - name=name, + _request = build_agent_endpoint_conversations_list_agent_conversation_items_request( + agent_name=agent_name, + conversation_id=conversation_id, limit=limit, order=order, after=_continuation_token, @@ -12200,7 +12367,7 @@ def prepare_request(_continuation_token=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.ToolboxVersionObject], + List[_models.RealtimeConversationItem], deserialized.get("data", []), ) if cls: @@ -12210,172 +12377,45 @@ def extract_data(pipeline_response): 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_version(self, name: str, version: str, **kwargs: Any) -> _models.ToolboxVersionObject: - """Retrieve a specific version of a toolbox. - - Retrieves the specified version of a toolbox by name and version identifier. - - :param name: The name of the toolbox. Required. - :type name: str - :param version: The version identifier to retrieve. Required. - :type version: str - :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxVersionObject - :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.ToolboxVersionObject] = kwargs.pop("cls", None) - - _request = build_toolboxes_get_version_request( - name=name, - version=version, - 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.ToolboxVersionObject, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def update( - self, name: str, *, default_version: str, content_type: str = "application/json", **kwargs: Any - ) -> _models.ToolboxObject: - """Update a toolbox to point to a specific version. - - Updates the toolbox's default version pointer to the specified version. - - :param name: The name of the toolbox to update. Required. - :type name: str - :keyword 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. - :paramtype default_version: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxObject - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ToolboxObject: - """Update a toolbox to point to a specific version. - - Updates the toolbox's default version pointer to the specified version. - - :param name: The name of the toolbox to update. Required. - :type name: str - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxObject - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ToolboxObject: - """Update a toolbox to point to a specific version. + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response - Updates the toolbox's default version pointer to the specified version. + 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) - :param name: The name of the toolbox to update. Required. - :type name: str - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxObject - :raises ~azure.core.exceptions.HttpResponseError: - """ + return pipeline_response + + return ItemPaged(get_next, extract_data) @distributed_trace - def update( - self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, default_version: str = _Unset, **kwargs: Any - ) -> _models.ToolboxObject: - """Update a toolbox to point to a specific version. + def get_agent_conversation_item( + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.RealtimeConversationItem: + """Get a voice agent conversation item. - Updates the toolbox's default version pointer to the specified version. + Retrieves a single item from the specified conversation by its id, including its transcript. An + ``input_audio``/``output_audio`` content part indicates that audio is available for the item; + the canonical per-item audio metadata is the ``/items/{item_id}/audio`` resource, and the bytes + are streamed by ``/items/{item_id}/audio/content``. Returns ``404`` when the conversation or + item was not persisted (``store = false``). - :param name: The name of the toolbox to update. Required. - :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword 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. - :paramtype default_version: str - :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.ToolboxObject + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item to retrieve. Required. + :type item_id: str + :return: RealtimeConversationItem. The RealtimeConversationItem is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.RealtimeConversationItem :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -12386,29 +12426,16 @@ def update( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ToolboxObject] = kwargs.pop("cls", None) - - if body is _Unset: - if default_version is _Unset: - raise TypeError("missing required argument: default_version") - body = {"default_version": default_version} - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.RealtimeConversationItem] = kwargs.pop("cls", None) - _request = build_toolboxes_update_request( - name=name, - content_type=content_type, + _request = build_agent_endpoint_conversations_get_agent_conversation_item_request( + agent_name=agent_name, + conversation_id=conversation_id, + item_id=item_id, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -12441,7 +12468,7 @@ def update( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ToolboxObject, response.json()) + deserialized = _deserialize(_models.RealtimeConversationItem, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -12449,15 +12476,27 @@ def update( return deserialized # type: ignore @distributed_trace - def delete(self, name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """Delete a toolbox. + def get_agent_conversation_item_audio( + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.VoiceItemAudioResponse: + """Get a voice agent conversation item's audio metadata. - Removes the specified toolbox along with all of its versions. + Returns metadata for a single conversation item's audio segment, including the common playback + facts (role, format/codec, sample rate, channels, offset, duration) for both Foundry-managed + and bring-your-own-storage (BYOS) recordings; for BYOS the response additionally includes + ``blob_uri``, the URI of the recording in the customer's own storage (no SAS) that the customer + downloads with their own credentials. Requires the conversation to have persisted audio + (``store = true``); returns ``404`` when the conversation, item, or its audio was not + persisted. - :param name: The name of the toolbox to delete. Required. - :type name: str - :return: None - :rtype: None + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose audio metadata is retrieved. Required. + :type item_id: str + :return: VoiceItemAudioResponse. The VoiceItemAudioResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceItemAudioResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -12471,10 +12510,12 @@ def delete(self, name: str, **kwargs: Any) -> None: # pylint: disable=inconsist _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[_models.VoiceItemAudioResponse] = kwargs.pop("cls", None) - _request = build_toolboxes_delete_request( - name=name, + _request = build_agent_endpoint_conversations_get_agent_conversation_item_audio_request( + agent_name=agent_name, + conversation_id=conversation_id, + item_id=item_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -12484,14 +12525,20 @@ def delete(self, name: str, **kwargs: Any) -> None: # pylint: disable=inconsist } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _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 [204]: + 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, @@ -12499,23 +12546,37 @@ def delete(self, name: str, **kwargs: Any) -> None: # pylint: disable=inconsist ) raise HttpResponseError(response=response, model=error) + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VoiceItemAudioResponse, response.json()) + if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore @distributed_trace - def delete_version( # pylint: disable=inconsistent-return-statements - self, name: str, version: str, **kwargs: Any - ) -> None: - """Delete a specific version of a toolbox. + def get_agent_conversation_item_audio_content( # pylint: disable=name-too-long + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> Iterator[bytes]: + """Stream a voice agent conversation item's audio. - Removes the specified version of a toolbox. + Streams a single conversation item's audio as a WAV (``audio/wav``) byte stream through the + service (no SAS URL). This route serves Foundry-managed storage only. For + bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download + directly from customer storage using the ``blob_uri`` returned by the item's ``/audio`` + metadata route — so this route returns ``409 Conflict`` for BYOS recordings. Returns ``404`` + when the conversation, item, or its audio was not persisted (``store = false``). - :param name: The name of the toolbox. Required. - :type name: str - :param version: The version identifier to delete. Required. - :type version: str - :return: None - :rtype: None + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose audio is streamed. Required. + :type item_id: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -12529,11 +12590,12 @@ def delete_version( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_toolboxes_delete_version_request( - name=name, - version=version, + _request = build_agent_endpoint_conversations_get_agent_conversation_item_audio_content_request( + agent_name=agent_name, + conversation_id=conversation_id, + item_id=item_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -12543,14 +12605,20 @@ def delete_version( # pylint: disable=inconsistent-return-statements } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _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 [204]: + 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, @@ -12558,103 +12626,38 @@ def delete_version( # pylint: disable=inconsistent-return-statements ) raise HttpResponseError(response=response, model=error) - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class BetaVoiceAgentWebSocketOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.projects.AIProjectClient`'s - :attr:`voice_agent_web_socket` 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 connect_voice_agent( # pylint: disable=inconsistent-return-statements - self, - agent_name: str, - *, - foundry_features_query: Optional[Literal[_AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW]] = None, - transport: Optional[Union[str, _models.VoiceAgentTransport]] = None, - store: Optional[bool] = None, - agent_version_override: Optional[str] = None, - websocket_subprotocol: Optional[Union[str, _models.VoiceAgentWebSocketSubprotocol]] = None, - **kwargs: Any - ) -> None: - """Connect to a voice agent. - - Connects to a voice agent over WebSocket. The client must send an HTTP GET with ``Upgrade: - websocket`` - headers. The optional ``realtime`` subprotocol is the only accepted subprotocol value. Supply - the - ``VoiceAgents=V1Preview`` opt-in through either the ``Foundry-Features`` header or the - ``foundry_features`` - query parameter. - - Handshake failures are evaluated in the following order, independent of the requested - ``transport``: - + response_headers = {} + response_headers["Content-Type"] = self._deserialize("str", response.headers.get("Content-Type")) + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - 1. Agent enablement (any transport): if the target agent is disabled, the handshake fails - before the - `101 Switching Protocols` upgrade with `409 Conflict`, using the shared Foundry - `ApiErrorResponse` shape - with `error.code = agent_disabled`. This failure is terminal until the caller enables the - agent, and it - takes precedence over the WebRTC-specific checks below. - 2. WebRTC availability (only when `transport=webrtc`, and only once the agent itself is - enabled): the agent - must have the WebRTC transport capability configured. If the agent is enabled but WebRTC is not - available - for it, the handshake fails with `404 Not Found`. This is distinct from the `409 - agent_disabled` case - above, which concerns the agent itself rather than its WebRTC capability. - 3. WebRTC compatibility (only when `transport=webrtc`): WebRTC does not support - bring-your-own-model (BYOM) - or hosted-agent voice agents; those requests fail with `400 Bad Request`. + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore - :param agent_name: The name of the voice agent. Required. + return deserialized # type: ignore + + @distributed_trace + def get_agent_conversation_item_generated_audio( # pylint: disable=name-too-long + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.VoiceGeneratedItemAudioResponse: + """Get a voice agent conversation item's generated audio metadata. + + Returns metadata for a conversation item's generated audio. This subordinate artifact is + separate from the canonical heard-audio segment and exists only when playback was interrupted + and the service rendered more audio than the listener heard, including when the response ends + as cancelled. Returns ``404`` when the conversation or item was not persisted, or when no + generated audio exists beyond the heard segment. + + :param agent_name: The name of the agent. Required. :type agent_name: str - :keyword foundry_features_query: A query alternative to the ``Foundry-Features`` header for - clients that cannot set headers during a - WebSocket handshake. Set this to ``VoiceAgents=V1Preview``. Either this query parameter or the - header is - required. VOICE_AGENTS_V1_PREVIEW. Default value is None. - :paramtype foundry_features_query: str or ~azure.ai.projects.models.VOICE_AGENTS_V1_PREVIEW - :keyword transport: Selects the connection transport. Omit or send ``websocket`` for the - default, where signaling and audio are - exchanged as JSON events over this WebSocket. Send ``webrtc`` to negotiate a WebRTC - connection: the WebSocket - then carries only SDP signaling (``rtc.call.sdp.create`` / ``rtc.call.sdp.created``) while - media and the data - channel are peer-to-peer. Known values are: "websocket" and "webrtc". Default value is None. - :paramtype transport: str or ~azure.ai.projects.models.VoiceAgentTransport - :keyword store: Whether to persist the conversation created by this WebSocket session. If - omitted, the service honors the - persisted voice agent definition's configured ``store`` value. If supplied, this value - overrides the - definition's ``store`` setting for this session only. Default value is None. - :paramtype store: bool - :keyword agent_version_override: Selects a specific version of the voice agent for this - session. Default value is None. - :paramtype agent_version_override: str - :keyword websocket_subprotocol: The requested WebSocket subprotocol. Omit this header or - request exactly ``realtime``. "realtime" Default value is None. - :paramtype websocket_subprotocol: str or - ~azure.ai.projects.models.VoiceAgentWebSocketSubprotocol - :return: None - :rtype: None + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose generated audio metadata is retrieved. + Required. + :type item_id: str + :return: VoiceGeneratedItemAudioResponse. The VoiceGeneratedItemAudioResponse is compatible + with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceGeneratedItemAudioResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -12668,15 +12671,12 @@ def connect_voice_agent( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[_models.VoiceGeneratedItemAudioResponse] = kwargs.pop("cls", None) - _request = build_beta_voice_agent_web_socket_connect_voice_agent_request( + _request = build_agent_endpoint_conversations_get_agent_conversation_item_generated_audio_request( agent_name=agent_name, - foundry_features_query=foundry_features_query, - transport=transport, - store=store, - agent_version_override=agent_version_override, - websocket_subprotocol=websocket_subprotocol, + conversation_id=conversation_id, + item_id=item_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -12686,14 +12686,20 @@ def connect_voice_agent( # pylint: disable=inconsistent-return-statements } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _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 [101]: + 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, @@ -12701,73 +12707,40 @@ def connect_voice_agent( # pylint: disable=inconsistent-return-statements ) raise HttpResponseError(response=response, model=error) - response_headers = {} - response_headers["Sec-WebSocket-Protocol"] = self._deserialize( - "str", response.headers.get("Sec-WebSocket-Protocol") - ) + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VoiceGeneratedItemAudioResponse, response.json()) if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - - -class BetaAgentEndpointConversationsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.projects.AIProjectClient`'s - :attr:`agent_endpoint_conversations` attribute. - """ + return cls(pipeline_response, deserialized, {}) # type: ignore - 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") + return deserialized # type: ignore @distributed_trace - def list_agent_conversations( - self, - agent_name: str, - *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.VoiceConversation"]: - """List voice agent conversations. + def get_agent_conversation_item_generated_audio_content( # pylint: disable=name-too-long + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> Iterator[bytes]: + """Stream a voice agent conversation item's generated audio. - Returns the conversations persisted for the specified voice agent endpoint. Conversations are - present when the session's effective ``store`` setting is ``true``, whether inherited from the - agent definition or enabled by the WebSocket session override. + Streams a conversation item's generated audio as a WAV (``audio/wav``) byte stream through the + service. This subordinate artifact exists only when playback was interrupted and the service + rendered more audio than the listener heard, including when the response ends as cancelled. + This route serves Foundry-managed storage only. For bring-your-own-storage (BYOS) recordings + the bytes are not proxied, so this route returns ``409 Conflict``. Returns ``404`` when the + conversation or item was not persisted, or when no generated audio exists beyond the heard + segment. :param agent_name: The name of the 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 VoiceConversation - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.VoiceConversation] + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose generated audio is streamed. Required. + :type item_id: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.VoiceConversation]] = kwargs.pop("cls", None) - error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -12776,68 +12749,81 @@ def list_agent_conversations( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(_continuation_token=None): + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - _request = build_beta_agent_endpoint_conversations_list_agent_conversations_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 + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.VoiceConversation], - 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) + _request = build_agent_endpoint_conversations_get_agent_conversation_item_generated_audio_content_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) - def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) + _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 + ) - _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, ) - response = pipeline_response.http_response + raise HttpResponseError(response=response, model=error) - 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) + response_headers = {} + response_headers["Content-Type"] = self._deserialize("str", response.headers.get("Content-Type")) - return pipeline_response + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - return ItemPaged(get_next, extract_data) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace - def get_agent_conversation(self, agent_name: str, conversation_id: str, **kwargs: Any) -> _models.VoiceConversation: - """Get a voice agent conversation. + def get_agent_conversation_audio( + self, agent_name: str, conversation_id: str, **kwargs: Any + ) -> _models.VoiceRecordingResponse: + """Get a voice agent conversation's merged recording metadata. - Retrieves a single conversation recorded for the specified voice agent endpoint by its id. - Returns ``404`` when the conversation was not persisted (``store = false``) or does not exist. + Returns metadata for the whole-call merged stereo recording (user audio on the left channel, + agent audio on the right). The common metadata (format, sample rate, channels, channel layout, + duration) is returned for both Foundry-managed and bring-your-own-storage (BYOS) recordings; + for BYOS the response additionally includes ``blob_uri``, the URI of the recording in the + customer's own storage (no SAS) that the customer downloads with their own credentials. The + recording is built once from the per-turn segments after persistence finalization succeeds. + While the conversation is ``in_progress``, this route returns retriable ``409 Conflict`` with + ``error.code = recording_not_ready`` and a ``Retry-After`` header when retry guidance is + available. When the conversation is ``failed``, it returns terminal ``409 Conflict`` with + ``error.code = recording_unavailable``. For a ``completed`` conversation, metadata is available + subject to the existing BYOS behavior. Requires the conversation to have persisted audio + (``store = true``); otherwise returns ``404``. :param agent_name: The name of the agent. Required. :type agent_name: str - :param conversation_id: The id of the conversation to retrieve. Required. + :param conversation_id: The id of the conversation whose merged recording metadata is + retrieved. Required. :type conversation_id: str - :return: VoiceConversation. The VoiceConversation is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.VoiceConversation + :return: VoiceRecordingResponse. The VoiceRecordingResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceRecordingResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -12851,9 +12837,9 @@ def get_agent_conversation(self, agent_name: str, conversation_id: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.VoiceConversation] = kwargs.pop("cls", None) + cls: ClsType[_models.VoiceRecordingResponse] = kwargs.pop("cls", None) - _request = build_beta_agent_endpoint_conversations_get_agent_conversation_request( + _request = build_agent_endpoint_conversations_get_agent_conversation_audio_request( agent_name=agent_name, conversation_id=conversation_id, api_version=self._config.api_version, @@ -12889,7 +12875,7 @@ def get_agent_conversation(self, agent_name: str, conversation_id: str, **kwargs if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.VoiceConversation, response.json()) + deserialized = _deserialize(_models.VoiceRecordingResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -12897,20 +12883,29 @@ def get_agent_conversation(self, agent_name: str, conversation_id: str, **kwargs return deserialized # type: ignore @distributed_trace - def delete_agent_conversation( # pylint: disable=inconsistent-return-statements + def get_agent_conversation_audio_content( self, agent_name: str, conversation_id: str, **kwargs: Any - ) -> None: - """Delete a voice agent conversation. + ) -> Iterator[bytes]: + """Stream a voice agent conversation's merged recording. - Deletes a conversation and all of its stored data — responses, items, and any audio (cascade). - This is the customer's explicit data-deletion control for voice conversations. + Streams the whole-call merged stereo recording as a WAV (``audio/wav``) byte stream through the + service (no SAS URL). This route serves Foundry-managed storage only. For + bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download + directly from customer storage using the ``blob_uri`` returned by the metadata route — so this + route returns ``409 Conflict`` for BYOS recordings. While the conversation is ``in_progress``, + this route returns retriable ``409 Conflict`` with ``error.code = recording_not_ready`` and a + ``Retry-After`` header when retry guidance is available. When the conversation is ``failed``, + it returns terminal ``409 Conflict`` with ``error.code = recording_unavailable``. For a + ``completed`` conversation, content is available subject to the existing BYOS behavior. A + conversation without persisted audio (``store = false``) returns ``404``. :param agent_name: The name of the agent. Required. :type agent_name: str - :param conversation_id: The id of the conversation to delete. Required. + :param conversation_id: The id of the conversation whose merged recording is streamed. + Required. :type conversation_id: str - :return: None - :rtype: None + :return: Iterator[bytes] + :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -12924,9 +12919,9 @@ def delete_agent_conversation( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_beta_agent_endpoint_conversations_delete_agent_conversation_request( + _request = build_agent_endpoint_conversations_get_agent_conversation_audio_content_request( agent_name=agent_name, conversation_id=conversation_id, api_version=self._config.api_version, @@ -12938,14 +12933,20 @@ def delete_agent_conversation( # pylint: disable=inconsistent-return-statements } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _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 [204]: + 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, @@ -12953,54 +12954,156 @@ def delete_agent_conversation( # pylint: disable=inconsistent-return-statements ) 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, None, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore - @distributed_trace - def list_agent_conversation_responses( + return deserialized # type: ignore + + +class ToolboxesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.AIProjectClient`'s + :attr:`toolboxes` 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") + + @overload + def create_version( self, - agent_name: str, - conversation_id: str, + name: str, *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, + tools: List[_models.ToolboxTool], + content_type: str = "application/json", + description: Optional[str] = None, + metadata: Optional[dict[str, str]] = None, + skills: Optional[List[_models.ToolboxSkill]] = None, + policies: Optional[_models.ToolboxPolicies] = None, **kwargs: Any - ) -> ItemPaged["_models.VoiceResponse"]: - """List responses in a voice agent conversation. + ) -> _models.ToolboxVersionObject: + """Create a new version of a toolbox. - Returns a paged collection of the responses (model inference turns) recorded for the specified - conversation. The per-response ``output`` projection may be omitted here; use the - response-items route for the canonical paged output. Returns ``404`` when the conversation was - not persisted (``store = false``). + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation whose responses are listed. 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 VoiceResponse - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.VoiceResponse] + :param name: The name of the toolbox. If the toolbox does not exist, it will be created. + Required. + :type name: str + :keyword tools: The list of tools to include in this version. Required. + :paramtype tools: list[~azure.ai.projects.models.ToolboxTool] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword description: A human-readable description of the toolbox. Default value is None. + :paramtype description: str + :keyword metadata: Arbitrary key-value metadata to associate with the toolbox. Default value is + None. + :paramtype metadata: dict[str, str] + :keyword skills: The list of skill sources to include in this version. A skill reference + specifies a skill name and optionally a version. If version is omitted, the skill's default + version is used. Default value is None. + :paramtype skills: list[~azure.ai.projects.models.ToolboxSkill] + :keyword policies: Policy configuration for this toolbox version. Default value is None. + :paramtype policies: ~azure.ai.projects.models.ToolboxPolicies + :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxVersionObject :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.VoiceResponse]] = kwargs.pop("cls", None) + @overload + def create_version( + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ToolboxVersionObject: + """Create a new version of a toolbox. + + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. + + :param name: The name of the toolbox. If the toolbox does not exist, it will be created. + Required. + :type name: str + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxVersionObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_version( + self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ToolboxVersionObject: + """Create a new version of a toolbox. + + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. + + :param name: The name of the toolbox. If the toolbox does not exist, it will be created. + Required. + :type name: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxVersionObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_version( + self, + name: str, + body: Union[JSON, IO[bytes]] = _Unset, + *, + tools: List[_models.ToolboxTool] = _Unset, + description: Optional[str] = None, + metadata: Optional[dict[str, str]] = None, + skills: Optional[List[_models.ToolboxSkill]] = None, + policies: Optional[_models.ToolboxPolicies] = None, + **kwargs: Any + ) -> _models.ToolboxVersionObject: + """Create a new version of a toolbox. + + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. + :param name: The name of the toolbox. If the toolbox does not exist, it will be created. + Required. + :type name: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword tools: The list of tools to include in this version. Required. + :paramtype tools: list[~azure.ai.projects.models.ToolboxTool] + :keyword description: A human-readable description of the toolbox. Default value is None. + :paramtype description: str + :keyword metadata: Arbitrary key-value metadata to associate with the toolbox. Default value is + None. + :paramtype metadata: dict[str, str] + :keyword skills: The list of skill sources to include in this version. A skill reference + specifies a skill name and optionally a version. If version is omitted, the skill's default + version is used. Default value is None. + :paramtype skills: list[~azure.ai.projects.models.ToolboxSkill] + :keyword policies: Policy configuration for this toolbox version. Default value is None. + :paramtype policies: ~azure.ai.projects.models.ToolboxPolicies + :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxVersionObject + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -13009,74 +13112,84 @@ def list_agent_conversation_responses( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(_continuation_token=None): + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - _request = build_beta_agent_endpoint_conversations_list_agent_conversation_responses_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), + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ToolboxVersionObject] = kwargs.pop("cls", None) + + if body is _Unset: + if tools is _Unset: + raise TypeError("missing required argument: tools") + body = { + "description": description, + "metadata": metadata, + "policies": policies, + "skills": skills, + "tools": tools, } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - return _request + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_toolboxes_create_version_request( + name=name, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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) - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.VoiceResponse], - 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) + _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 + ) - def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) + response = pipeline_response.http_response - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + 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, ) - response = pipeline_response.http_response + raise HttpResponseError(response=response, model=error) - 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) + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ToolboxVersionObject, response.json()) - return pipeline_response + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore - return ItemPaged(get_next, extract_data) + return deserialized # type: ignore @distributed_trace - def get_agent_conversation_response( - self, agent_name: str, conversation_id: str, response_id: str, **kwargs: Any - ) -> _models.VoiceResponse: - """Get a voice agent conversation response. + def get(self, name: str, **kwargs: Any) -> _models.ToolboxObject: + """Retrieve a toolbox. - Retrieves a single response from the specified conversation by its id, including its ``output`` - items, ``usage``, and status. Returns ``404`` when the conversation or response was not - persisted (``store = false``). + Retrieves the specified toolbox and its current configuration. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the response. Required. - :type conversation_id: str - :param response_id: The id of the response to retrieve. Required. - :type response_id: str - :return: VoiceResponse. The VoiceResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.VoiceResponse + :param name: The name of the toolbox to retrieve. Required. + :type name: str + :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxObject :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -13090,12 +13203,10 @@ def get_agent_conversation_response( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.VoiceResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.ToolboxObject] = kwargs.pop("cls", None) - _request = build_beta_agent_endpoint_conversations_get_agent_conversation_response_request( - agent_name=agent_name, - conversation_id=conversation_id, - response_id=response_id, + _request = build_toolboxes_get_request( + name=name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -13129,7 +13240,7 @@ def get_agent_conversation_response( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.VoiceResponse, response.json()) + deserialized = _deserialize(_models.ToolboxObject, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -13137,30 +13248,18 @@ def get_agent_conversation_response( return deserialized # type: ignore @distributed_trace - def list_agent_conversation_response_items( + def list( self, - agent_name: str, - conversation_id: str, - response_id: str, *, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, before: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.RealtimeConversationItem"]: - """List items produced by a voice agent conversation response. + ) -> ItemPaged["_models.ToolboxObject"]: + """List toolboxes. - Returns a paged collection of the output items produced by a specific response (the response's - output projection). For the complete ordered conversation history — including user input and - client-created tool outputs — use the conversation items route instead. Returns ``404`` when - the conversation or response was not persisted (``store = false``). + Returns the toolboxes available in the current project. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the response. Required. - :type conversation_id: str - :param response_id: The id of the response whose output items are listed. Required. - :type response_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. @@ -13175,14 +13274,14 @@ def list_agent_conversation_response_items( 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 RealtimeConversationItem - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.RealtimeConversationItem] + :return: An iterator like instance of ToolboxObject + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.ToolboxObject] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.RealtimeConversationItem]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.ToolboxObject]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -13194,10 +13293,7 @@ def list_agent_conversation_response_items( def prepare_request(_continuation_token=None): - _request = build_beta_agent_endpoint_conversations_list_agent_conversation_response_items_request( - agent_name=agent_name, - conversation_id=conversation_id, - response_id=response_id, + _request = build_toolboxes_list_request( limit=limit, order=order, after=_continuation_token, @@ -13215,7 +13311,7 @@ def prepare_request(_continuation_token=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.RealtimeConversationItem], + List[_models.ToolboxObject], deserialized.get("data", []), ) if cls: @@ -13244,26 +13340,21 @@ def get_next(_continuation_token=None): return ItemPaged(get_next, extract_data) @distributed_trace - def list_agent_conversation_items( + def list_versions( self, - agent_name: str, - conversation_id: str, + name: str, *, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, before: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.RealtimeConversationItem"]: - """List items in a voice agent conversation. + ) -> ItemPaged["_models.ToolboxVersionObject"]: + """List toolbox versions. - Returns a paged collection of items — the complete ordered conversation history, including user - input, assistant output, and client-created tool outputs (transcripts + tool events). Returns - ``404`` when the conversation was not persisted (``store = false``). + Returns the available versions for the specified toolbox. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation whose items are listed. Required. - :type conversation_id: str + :param name: The name of the toolbox to list versions for. Required. + :type 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. @@ -13278,14 +13369,14 @@ def list_agent_conversation_items( 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 RealtimeConversationItem - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.RealtimeConversationItem] + :return: An iterator like instance of ToolboxVersionObject + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.ToolboxVersionObject] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.RealtimeConversationItem]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.ToolboxVersionObject]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -13297,9 +13388,8 @@ def list_agent_conversation_items( def prepare_request(_continuation_token=None): - _request = build_beta_agent_endpoint_conversations_list_agent_conversation_items_request( - agent_name=agent_name, - conversation_id=conversation_id, + _request = build_toolboxes_list_versions_request( + name=name, limit=limit, order=order, after=_continuation_token, @@ -13317,7 +13407,7 @@ def prepare_request(_continuation_token=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.RealtimeConversationItem], + List[_models.ToolboxVersionObject], deserialized.get("data", []), ) if cls: @@ -13346,107 +13436,17 @@ def get_next(_continuation_token=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_agent_conversation_item( - self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any - ) -> _models.RealtimeConversationItem: - """Get a voice agent conversation item. - - Retrieves a single item from the specified conversation by its id, including its transcript. An - ``input_audio``/``output_audio`` content part indicates that audio is available for the item; - the canonical per-item audio metadata is the ``/items/{item_id}/audio`` resource, and the bytes - are streamed by ``/items/{item_id}/audio/content``. Returns ``404`` when the conversation or - item was not persisted (``store = false``). - - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the item. Required. - :type conversation_id: str - :param item_id: The id of the conversation item to retrieve. Required. - :type item_id: str - :return: RealtimeConversationItem. The RealtimeConversationItem is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.RealtimeConversationItem - :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.RealtimeConversationItem] = kwargs.pop("cls", None) - - _request = build_beta_agent_endpoint_conversations_get_agent_conversation_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.RealtimeConversationItem, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_agent_conversation_item_audio( - self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any - ) -> _models.VoiceItemAudioResponse: - """Get a voice agent conversation item's audio metadata. + def get_version(self, name: str, version: str, **kwargs: Any) -> _models.ToolboxVersionObject: + """Retrieve a specific version of a toolbox. - Returns metadata for a single conversation item's audio segment, including the common playback - facts (role, format/codec, sample rate, channels, offset, duration) for both Foundry-managed - and bring-your-own-storage (BYOS) recordings; for BYOS the response additionally includes - ``blob_uri``, the URI of the recording in the customer's own storage (no SAS) that the customer - downloads with their own credentials. Requires the conversation to have persisted audio - (``store = true``); returns ``404`` when the conversation, item, or its audio was not - persisted. + Retrieves the specified version of a toolbox by name and version identifier. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the item. Required. - :type conversation_id: str - :param item_id: The id of the conversation item whose audio metadata is retrieved. Required. - :type item_id: str - :return: VoiceItemAudioResponse. The VoiceItemAudioResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.VoiceItemAudioResponse + :param name: The name of the toolbox. Required. + :type name: str + :param version: The version identifier to retrieve. Required. + :type version: str + :return: ToolboxVersionObject. The ToolboxVersionObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxVersionObject :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -13460,12 +13460,11 @@ def get_agent_conversation_item_audio( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.VoiceItemAudioResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.ToolboxVersionObject] = kwargs.pop("cls", None) - _request = build_beta_agent_endpoint_conversations_get_agent_conversation_item_audio_request( - agent_name=agent_name, - conversation_id=conversation_id, - item_id=item_id, + _request = build_toolboxes_get_version_request( + name=name, + version=version, api_version=self._config.api_version, headers=_headers, params=_params, @@ -13499,34 +13498,91 @@ def get_agent_conversation_item_audio( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.VoiceItemAudioResponse, response.json()) + deserialized = _deserialize(_models.ToolboxVersionObject, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + @overload + def update( + self, name: str, *, default_version: str, content_type: str = "application/json", **kwargs: Any + ) -> _models.ToolboxObject: + """Update a toolbox to point to a specific version. + + Updates the toolbox's default version pointer to the specified version. + + :param name: The name of the toolbox to update. Required. + :type name: str + :keyword 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. + :paramtype default_version: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ToolboxObject: + """Update a toolbox to point to a specific version. + + Updates the toolbox's default version pointer to the specified version. + + :param name: The name of the toolbox to update. Required. + :type name: str + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ToolboxObject: + """Update a toolbox to point to a specific version. + + Updates the toolbox's default version pointer to the specified version. + + :param name: The name of the toolbox to update. Required. + :type name: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxObject + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace - def get_agent_conversation_item_audio_content( # pylint: disable=name-too-long - self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any - ) -> Iterator[bytes]: - """Stream a voice agent conversation item's audio. + def update( + self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, default_version: str = _Unset, **kwargs: Any + ) -> _models.ToolboxObject: + """Update a toolbox to point to a specific version. - Streams a single conversation item's audio as a WAV (``audio/wav``) byte stream through the - service (no SAS URL). This route serves Foundry-managed storage only. For - bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download - directly from customer storage using the ``blob_uri`` returned by the item's ``/audio`` - metadata route — so this route returns ``409 Conflict`` for BYOS recordings. Returns ``404`` - when the conversation, item, or its audio was not persisted (``store = false``). + Updates the toolbox's default version pointer to the specified version. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation that contains the item. Required. - :type conversation_id: str - :param item_id: The id of the conversation item whose audio is streamed. Required. - :type item_id: str - :return: Iterator[bytes] - :rtype: Iterator[bytes] + :param name: The name of the toolbox to update. Required. + :type name: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword 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. + :paramtype default_version: str + :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.ToolboxObject :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -13537,16 +13593,29 @@ def get_agent_conversation_item_audio_content( # pylint: disable=name-too-long } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ToolboxObject] = kwargs.pop("cls", None) - _request = build_beta_agent_endpoint_conversations_get_agent_conversation_item_audio_content_request( - agent_name=agent_name, - conversation_id=conversation_id, - item_id=item_id, + if body is _Unset: + if default_version is _Unset: + raise TypeError("missing required argument: default_version") + body = {"default_version": default_version} + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_toolboxes_update_request( + name=name, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -13556,7 +13625,7 @@ def get_agent_conversation_item_audio_content( # pylint: disable=name-too-long _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", True) + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -13576,42 +13645,26 @@ def get_agent_conversation_item_audio_content( # pylint: disable=name-too-long ) 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 _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ToolboxObject, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace - def get_agent_conversation_audio( - self, agent_name: str, conversation_id: str, **kwargs: Any - ) -> _models.VoiceRecordingResponse: - """Get a voice agent conversation's merged recording metadata. + def delete(self, name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """Delete a toolbox. - Returns metadata for the whole-call merged stereo recording (user audio on the left channel, - agent audio on the right). The common metadata (format, sample rate, channels, channel layout, - duration) is returned for both Foundry-managed and bring-your-own-storage (BYOS) recordings; - for BYOS the response additionally includes ``blob_uri``, the URI of the recording in the - customer's own storage (no SAS) that the customer downloads with their own credentials. The - recording is built once from the per-turn segments after persistence finalization succeeds. - While the conversation is ``in_progress``, this route returns retriable ``409 Conflict`` with - ``error.code = recording_not_ready`` and a ``Retry-After`` header when retry guidance is - available. When the conversation is ``failed``, it returns terminal ``409 Conflict`` with - ``error.code = recording_unavailable``. For a ``completed`` conversation, metadata is available - subject to the existing BYOS behavior. Requires the conversation to have persisted audio - (``store = true``); otherwise returns ``404``. + Removes the specified toolbox along with all of its versions. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation whose merged recording metadata is - retrieved. Required. - :type conversation_id: str - :return: VoiceRecordingResponse. The VoiceRecordingResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.VoiceRecordingResponse + :param name: The name of the toolbox to delete. Required. + :type name: str + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -13625,11 +13678,10 @@ def get_agent_conversation_audio( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.VoiceRecordingResponse] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_beta_agent_endpoint_conversations_get_agent_conversation_audio_request( - agent_name=agent_name, - conversation_id=conversation_id, + _request = build_toolboxes_delete_request( + name=name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -13639,20 +13691,14 @@ def get_agent_conversation_audio( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _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 + 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, @@ -13660,40 +13706,23 @@ def get_agent_conversation_audio( ) raise HttpResponseError(response=response, model=error) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.VoiceRecordingResponse, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace - def get_agent_conversation_audio_content( - self, agent_name: str, conversation_id: str, **kwargs: Any - ) -> Iterator[bytes]: - """Stream a voice agent conversation's merged recording. + def delete_version( # pylint: disable=inconsistent-return-statements + self, name: str, version: str, **kwargs: Any + ) -> None: + """Delete a specific version of a toolbox. - Streams the whole-call merged stereo recording as a WAV (``audio/wav``) byte stream through the - service (no SAS URL). This route serves Foundry-managed storage only. For - bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download - directly from customer storage using the ``blob_uri`` returned by the metadata route — so this - route returns ``409 Conflict`` for BYOS recordings. While the conversation is ``in_progress``, - this route returns retriable ``409 Conflict`` with ``error.code = recording_not_ready`` and a - ``Retry-After`` header when retry guidance is available. When the conversation is ``failed``, - it returns terminal ``409 Conflict`` with ``error.code = recording_unavailable``. For a - ``completed`` conversation, content is available subject to the existing BYOS behavior. A - conversation without persisted audio (``store = false``) returns ``404``. + Removes the specified version of a toolbox. - :param agent_name: The name of the agent. Required. - :type agent_name: str - :param conversation_id: The id of the conversation whose merged recording is streamed. - Required. - :type conversation_id: str - :return: Iterator[bytes] - :rtype: Iterator[bytes] + :param name: The name of the toolbox. Required. + :type name: str + :param version: The version identifier to delete. Required. + :type version: str + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -13707,11 +13736,11 @@ def get_agent_conversation_audio_content( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_beta_agent_endpoint_conversations_get_agent_conversation_audio_content_request( - agent_name=agent_name, - conversation_id=conversation_id, + _request = build_toolboxes_delete_version_request( + name=name, + version=version, api_version=self._config.api_version, headers=_headers, params=_params, @@ -13721,20 +13750,14 @@ def get_agent_conversation_audio_content( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", True) + _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 + 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, @@ -13742,15 +13765,8 @@ def get_agent_conversation_audio_content( ) 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 + return cls(pipeline_response, None, {}) # type: ignore class BetaAgentInsightMonitorsOperations: # pylint: disable=docstring-missing-param diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_conversations.py b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_conversations.py index 8e70672a6422..4e887ab51bbf 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_conversations.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_conversations.py @@ -192,11 +192,7 @@ def test_read_conversation(self, **kwargs): # pylint: disable=too-many-locals assert response_detail.id == first_response.id # The items produced by that response (does not raise; count may be 0 or more). - list( - conversations.list_agent_conversation_response_items( - _AGENT_NAME, conversation_id, first_response.id - ) - ) + list(conversations.list_agent_conversation_response_items(_AGENT_NAME, conversation_id, first_response.id)) # The ordered conversation items -- the full transcript (user + assistant + tool events). items = list(conversations.list_agent_conversation_items(_AGENT_NAME, conversation_id)) @@ -217,9 +213,7 @@ def test_read_conversation(self, **kwargs): # pylint: disable=too-many-locals recording = conversations.get_agent_conversation_audio(_AGENT_NAME, conversation_id) assert recording.format is not None if not recording.blob_uri: - audio_bytes = b"".join( - conversations.get_agent_conversation_audio_content(_AGENT_NAME, conversation_id) - ) + audio_bytes = b"".join(conversations.get_agent_conversation_audio_content(_AGENT_NAME, conversation_id)) assert len(audio_bytes) > 0 # A single item's audio, if any item has one. @@ -228,9 +222,7 @@ def test_read_conversation(self, **kwargs): # pylint: disable=too-many-locals if not item_id: continue try: - item_audio = conversations.get_agent_conversation_item_audio( - _AGENT_NAME, conversation_id, item_id - ) + item_audio = conversations.get_agent_conversation_item_audio(_AGENT_NAME, conversation_id, item_id) except HttpResponseError as e: if e.status_code == 404: continue @@ -238,9 +230,7 @@ def test_read_conversation(self, **kwargs): # pylint: disable=too-many-locals assert item_audio.role is not None if not item_audio.blob_uri: item_audio_bytes = b"".join( - conversations.get_agent_conversation_item_audio_content( - _AGENT_NAME, conversation_id, item_id - ) + conversations.get_agent_conversation_item_audio_content(_AGENT_NAME, conversation_id, item_id) ) assert len(item_audio_bytes) > 0 break diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_realtime_live_async.py b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_realtime_live_async.py index 3cce3e057581..49501b7b772c 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_realtime_live_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_realtime_live_async.py @@ -42,7 +42,6 @@ VoiceOutputModality, ) - # Seconds to wait for a single server event (session handshake, an audio delta, ...). _EVENT_TIMEOUT: Final = 30 # Seconds to wait for a full response turn to finish (may include a tool round-trip). diff --git a/sdk/ai/azure-ai-projects/tests/samples/test_samples.py b/sdk/ai/azure-ai-projects/tests/samples/test_samples.py index 3ac0ab775617..f0721ef8a772 100644 --- a/sdk/ai/azure-ai-projects/tests/samples/test_samples.py +++ b/sdk/ai/azure-ai-projects/tests/samples/test_samples.py @@ -418,4 +418,3 @@ def test_voice_samples(self, sample_path: str, **kwargs) -> None: executor = SyncSampleExecutor(self, sample_path, env_vars=env_vars, **kwargs) executor.execute() executor.validate_print_calls_by_llm() - diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml b/sdk/ai/azure-ai-projects/tsp-location.yaml new file mode 100644 index 000000000000..1fd9745871f3 --- /dev/null +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml @@ -0,0 +1,30 @@ +directory: specification/ai-foundry/data-plane/Foundry/src/sdk-python-js-azure-ai-projects +commit: 16e19af7a5193435c71b3afbd3391bdf5db9010c +repo: Azure/azure-rest-api-specs +additionalDirectories: +- specification/ai-foundry/data-plane/Foundry/src/agents +- specification/ai-foundry/data-plane/Foundry/src/agent-insights +- specification/ai-foundry/data-plane/Foundry/src/agents-optimization +- specification/ai-foundry/data-plane/Foundry/src/agents-session-files +- specification/ai-foundry/data-plane/Foundry/src/agents-microsoft365 +- specification/ai-foundry/data-plane/Foundry/src/common +- specification/ai-foundry/data-plane/Foundry/src/connections +- specification/ai-foundry/data-plane/Foundry/src/data_generation_jobs +- specification/ai-foundry/data-plane/Foundry/src/datasets +- specification/ai-foundry/data-plane/Foundry/src/deployments +- specification/ai-foundry/data-plane/Foundry/src/evaluation-rules +- specification/ai-foundry/data-plane/Foundry/src/evaluation-taxonomies +- specification/ai-foundry/data-plane/Foundry/src/evaluators +- specification/ai-foundry/data-plane/Foundry/src/indexes +- specification/ai-foundry/data-plane/Foundry/src/insights +- specification/ai-foundry/data-plane/Foundry/src/memory-stores +- specification/ai-foundry/data-plane/Foundry/src/models +- specification/ai-foundry/data-plane/Foundry/src/openai +- specification/ai-foundry/data-plane/Foundry/src/red-teams +- specification/ai-foundry/data-plane/Foundry/src/routines +- specification/ai-foundry/data-plane/Foundry/src/schedules +- specification/ai-foundry/data-plane/Foundry/src/sdk-common +- specification/ai-foundry/data-plane/Foundry/src/skills +- specification/ai-foundry/data-plane/Foundry/src/toolboxes +- specification/ai-foundry/data-plane/Foundry/src/tools +- specification/ai-foundry/data-plane/Foundry/src/voice-agents From 87a4cac97a1a89ede7b582ba03c649cd3adebfeb Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Fri, 4 Sep 2026 11:08:10 -0700 Subject: [PATCH 54/56] Part 2: Apply post-emitter-fixes.cmd Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../azure/ai/projects/_client.py | 6 -- .../azure/ai/projects/aio/_client.py | 6 -- .../ai/projects/aio/operations/_operations.py | 57 ++++++------------- .../azure/ai/projects/models/__init__.py | 2 - .../azure/ai/projects/models/_enums.py | 8 +-- .../azure/ai/projects/models/_models.py | 48 ++++++++-------- .../ai/projects/operations/_operations.py | 57 ++++++------------- 7 files changed, 63 insertions(+), 121 deletions(-) diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py index 328fba1bb90c..9c1e0f4dfd89 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py @@ -26,7 +26,6 @@ EvaluationRulesOperations, IndexesOperations, ToolboxesOperations, - VoiceAgentWebSocketOperations, ) if sys.version_info >= (3, 11): @@ -55,8 +54,6 @@ class AIProjectClient: # pylint: disable=too-many-instance-attributes,docstring :vartype deployments: azure.ai.projects.operations.DeploymentsOperations :ivar indexes: IndexesOperations operations :vartype indexes: azure.ai.projects.operations.IndexesOperations - :ivar voice_agent_web_socket: VoiceAgentWebSocketOperations operations - :vartype voice_agent_web_socket: azure.ai.projects.operations.VoiceAgentWebSocketOperations :ivar agent_endpoint_conversations: AgentEndpointConversationsOperations operations :vartype agent_endpoint_conversations: azure.ai.projects.operations.AgentEndpointConversationsOperations @@ -120,9 +117,6 @@ def __init__( self.datasets = DatasetsOperations(self._client, self._config, self._serialize, self._deserialize) self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) self.indexes = IndexesOperations(self._client, self._config, self._serialize, self._deserialize) - self.voice_agent_web_socket = VoiceAgentWebSocketOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.agent_endpoint_conversations = AgentEndpointConversationsOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py index f6b03dd7f446..fd5065a3aa8a 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py @@ -26,7 +26,6 @@ EvaluationRulesOperations, IndexesOperations, ToolboxesOperations, - VoiceAgentWebSocketOperations, ) if sys.version_info >= (3, 11): @@ -55,8 +54,6 @@ class AIProjectClient: # pylint: disable=too-many-instance-attributes,docstring :vartype deployments: azure.ai.projects.aio.operations.DeploymentsOperations :ivar indexes: IndexesOperations operations :vartype indexes: azure.ai.projects.aio.operations.IndexesOperations - :ivar voice_agent_web_socket: VoiceAgentWebSocketOperations operations - :vartype voice_agent_web_socket: azure.ai.projects.aio.operations.VoiceAgentWebSocketOperations :ivar agent_endpoint_conversations: AgentEndpointConversationsOperations operations :vartype agent_endpoint_conversations: azure.ai.projects.aio.operations.AgentEndpointConversationsOperations @@ -120,9 +117,6 @@ def __init__( self.datasets = DatasetsOperations(self._client, self._config, self._serialize, self._deserialize) self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) self.indexes = IndexesOperations(self._client, self._config, self._serialize, self._deserialize) - self.voice_agent_web_socket = VoiceAgentWebSocketOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.agent_endpoint_conversations = AgentEndpointConversationsOperations( self._client, self._config, self._serialize, self._deserialize ) 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 0f8c4c284fc3..fce439a02f27 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 @@ -346,27 +346,8 @@ async def get(self, agent_name: str, **kwargs: Any) -> _models.AgentDetails: return deserialized # type: ignore - @overload - async def generate_agent( - self, body: _models.GenerateVoiceAgentRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.AgentDetails: - """Generate an agent. - - Generates and creates an agent from kind-specific high-level inputs. The generated definition - remains fully editable through the standard agent versioning operations. - - :param body: The kind-specific inputs for generating and creating an agent. Required. - :type body: ~azure.ai.projects.models.GenerateVoiceAgentRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: AgentDetails. The AgentDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace_async - async def generate_agent(self, body: "_unions.GenerateAgentRequest", **kwargs: Any) -> _models.AgentDetails: + async def generate_agent(self, body: _models.GenerateVoiceAgentRequest, **kwargs: Any) -> _models.AgentDetails: """Generate an agent. Generates and creates an agent from kind-specific high-level inputs. The generated definition @@ -2249,29 +2230,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. @@ -2313,7 +2288,9 @@ 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) + kwargs.pop("stream", None) # must always stream; discard any caller override + kwargs.pop("stream", None) # must always stream; discard any caller override + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -4266,8 +4243,8 @@ async def replace_telephony_transfer_targets( agent_name: str, body: JSON, *, - etag: List[_models.TelephonyTransferTarget], - match_condition: str, + etag: str, + match_condition: MatchConditions, content_type: str = "application/json", **kwargs: Any ) -> _models.TelephonyTransferTargets: @@ -4280,9 +4257,9 @@ async def replace_telephony_transfer_targets( :param body: Required. :type body: JSON :keyword etag: check if resource is changed. Set None to skip checking etag. Required. - :paramtype etag: list[~azure.ai.projects.models.TelephonyTransferTarget] + :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Required. - :paramtype match_condition: str + :paramtype match_condition: ~azure.core.MatchConditions :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4298,8 +4275,8 @@ async def replace_telephony_transfer_targets( agent_name: str, body: IO[bytes], *, - etag: List[_models.TelephonyTransferTarget], - match_condition: str, + etag: str, + match_condition: MatchConditions, content_type: str = "application/json", **kwargs: Any ) -> _models.TelephonyTransferTargets: @@ -4312,9 +4289,9 @@ async def replace_telephony_transfer_targets( :param body: Required. :type body: IO[bytes] :keyword etag: check if resource is changed. Set None to skip checking etag. Required. - :paramtype etag: list[~azure.ai.projects.models.TelephonyTransferTarget] + :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Required. - :paramtype match_condition: str + :paramtype match_condition: ~azure.core.MatchConditions :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str 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 59099cc31f51..ea25eb33ad75 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 @@ -767,7 +767,6 @@ VoiceModelType, VoiceOutputModality, VoiceType, - _AgentDefinitionOptInKeys, ) from ._patch import __all__ as _patch_all from ._patch import * @@ -1523,7 +1522,6 @@ "VoiceModelType", "VoiceOutputModality", "VoiceType", - "_AgentDefinitionOptInKeys", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() 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 3bc39290533c..f31f9254da78 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 @@ -2193,12 +2193,12 @@ 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. + 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. + 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. + 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 1244866c5205..575ae1bfccb6 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 @@ -16732,10 +16732,11 @@ class RealtimeServerEventConversationItemAdded( * 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. + 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`). + 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. @@ -16787,13 +16788,13 @@ class RealtimeServerEventConversationItemCreated( 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`. + 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. + 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. + to the Conversation. :ivar event_id: The unique ID of the server event. Required. :vartype event_id: str @@ -19150,7 +19151,7 @@ class RealtimeServerEventSessionCreated( """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( + session: "_models.VoiceAgentSessionResponseConfig" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The session configuration. Required. Is one of the following types: @@ -19164,7 +19165,7 @@ def __init__( self, *, event_id: str, - session: "_unions.VoiceAgentSessionResponse", + session: "_models.VoiceAgentSessionResponseConfig", conversation_id: Optional[str] = None, ) -> None: ... @@ -19198,7 +19199,7 @@ class RealtimeServerEventSessionUpdated( """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( + session: "_models.VoiceAgentSessionResponseConfig" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The session configuration. Required. Is one of the following types: @@ -19209,7 +19210,7 @@ def __init__( self, *, event_id: str, - session: "_unions.VoiceAgentSessionResponse", + session: "_models.VoiceAgentSessionResponseConfig", ) -> None: ... @overload @@ -20282,12 +20283,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" @@ -24221,13 +24220,14 @@ class VoiceAgentAudioOutputConfig(_Model): # pylint: disable=docstring-keyword- * `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`. + `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. + `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 @@ -25116,7 +25116,9 @@ class VoiceAgentClientEventSessionUpdate(_Model): # pylint: disable=docstring-k 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"]) + session: "_models.VoiceAgentSessionUpdateConfig" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The voice-agent session settings to update. Required. Is one of the following types: VoiceAgentSessionUpdateConfig""" @@ -25125,7 +25127,7 @@ def __init__( self, *, type: Literal[RealtimeClientEventType.SESSION_UPDATE], - session: "_unions.VoiceAgentSessionUpdate", + session: "_models.VoiceAgentSessionUpdateConfig", event_id: Optional[str] = None, ) -> None: ... @@ -28708,7 +28710,7 @@ class VoiceResponse(VoiceResponseBase): # pylint: disable=docstring-keyword-sho :vartype completed_at: ~datetime.datetime """ - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) # type: ignore[reportIncompatibleVariableOverride] """The unique id of the response. Required.""" output: Optional[list["_models.RealtimeConversationItem"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] @@ -28717,7 +28719,7 @@ class VoiceResponse(VoiceResponseBase): # pylint: disable=docstring-keyword-sho response (GET .../responses/{response_id}) or use the paged response-items route (GET .../responses/{response_id}/items) for its output items. Each item's ``response_id`` also links it back to this response in the conversation-level items list.""" - conversation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + conversation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) # type: ignore[reportIncompatibleVariableOverride] """The id of the conversation this response belongs to. Required.""" audio: Optional["_models.VoiceResponseAudio"] = rest_field( visibility=["read", "create", "update", "delete", "query"] 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 654ef6804690..ab39c33fc982 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 @@ -5077,27 +5077,8 @@ def get(self, agent_name: str, **kwargs: Any) -> _models.AgentDetails: return deserialized # type: ignore - @overload - def generate_agent( - self, body: _models.GenerateVoiceAgentRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.AgentDetails: - """Generate an agent. - - Generates and creates an agent from kind-specific high-level inputs. The generated definition - remains fully editable through the standard agent versioning operations. - - :param body: The kind-specific inputs for generating and creating an agent. Required. - :type body: ~azure.ai.projects.models.GenerateVoiceAgentRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: AgentDetails. The AgentDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace - def generate_agent(self, body: "_unions.GenerateAgentRequest", **kwargs: Any) -> _models.AgentDetails: + def generate_agent(self, body: _models.GenerateVoiceAgentRequest, **kwargs: Any) -> _models.AgentDetails: """Generate an agent. Generates and creates an agent from kind-specific high-level inputs. The generated definition @@ -6980,29 +6961,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. @@ -7044,7 +7019,9 @@ 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) + kwargs.pop("stream", None) # must always stream; discard any caller override + kwargs.pop("stream", None) # must always stream; discard any caller override + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -8996,8 +8973,8 @@ def replace_telephony_transfer_targets( agent_name: str, body: JSON, *, - etag: List[_models.TelephonyTransferTarget], - match_condition: str, + etag: str, + match_condition: MatchConditions, content_type: str = "application/json", **kwargs: Any ) -> _models.TelephonyTransferTargets: @@ -9010,9 +8987,9 @@ def replace_telephony_transfer_targets( :param body: Required. :type body: JSON :keyword etag: check if resource is changed. Set None to skip checking etag. Required. - :paramtype etag: list[~azure.ai.projects.models.TelephonyTransferTarget] + :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Required. - :paramtype match_condition: str + :paramtype match_condition: ~azure.core.MatchConditions :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9028,8 +9005,8 @@ def replace_telephony_transfer_targets( agent_name: str, body: IO[bytes], *, - etag: List[_models.TelephonyTransferTarget], - match_condition: str, + etag: str, + match_condition: MatchConditions, content_type: str = "application/json", **kwargs: Any ) -> _models.TelephonyTransferTargets: @@ -9042,9 +9019,9 @@ def replace_telephony_transfer_targets( :param body: Required. :type body: IO[bytes] :keyword etag: check if resource is changed. Set None to skip checking etag. Required. - :paramtype etag: list[~azure.ai.projects.models.TelephonyTransferTarget] + :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Required. - :paramtype match_condition: str + :paramtype match_condition: ~azure.core.MatchConditions :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str From 56bf71816107ab5c2c8d4640cef2993a69e29d1e Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Fri, 4 Sep 2026 14:01:15 -0700 Subject: [PATCH 55/56] Part 3: Additional edits Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- sdk/ai/azure-ai-projects/CHANGELOG.md | 8 +- sdk/ai/azure-ai-projects/api.md | 636 ++++++++++-------- sdk/ai/azure-ai-projects/api.metadata.yml | 2 +- .../azure/ai/projects/_patch.py | 13 +- .../azure/ai/projects/aio/_patch.py | 22 +- .../ai/projects/aio/operations/_patch.py | 4 - ...atch_agent_endpoint_conversations_async.py | 612 ++++++++++++++++- .../azure/ai/projects/models/_patch.py | 11 +- .../azure/ai/projects/operations/_patch.py | 4 - .../_patch_agent_endpoint_conversations.py | 617 ++++++++++++++++- .../azure-ai-projects/docs/public-methods.md | 32 +- ...ice_agent_live_audio_conversation_async.py | 4 +- ...mple_voice_agent_live_text_conversation.py | 4 +- ...oice_agent_live_text_conversation_async.py | 4 +- .../sample_voice_agent_read_conversation.py | 6 +- ...ple_voice_agent_read_conversation_audio.py | 10 +- .../agents/test_voice_agent_conversations.py | 40 +- .../test_voice_agent_conversations_async.py | 16 +- .../tests/agents/test_voice_agent_crud.py | 2 +- .../agents/test_voice_agent_crud_async.py | 2 +- .../agents/test_voice_agent_realtime_live.py | 2 +- .../agents/test_voice_agent_telephony.py | 11 +- .../test_voice_agent_telephony_async.py | 11 +- .../foundry_features_header_test_base.py | 80 ++- .../azure-ai-projects/tsp-location.yaml.saved | 2 +- 25 files changed, 1758 insertions(+), 397 deletions(-) diff --git a/sdk/ai/azure-ai-projects/CHANGELOG.md b/sdk/ai/azure-ai-projects/CHANGELOG.md index 6106234f47fd..5b8bd315ad40 100644 --- a/sdk/ai/azure-ai-projects/CHANGELOG.md +++ b/sdk/ai/azure-ai-projects/CHANGELOG.md @@ -8,14 +8,14 @@ * Define a voice agent with `VoiceAgentDefinition`, configuring its model (`VoiceModelType`), audio input/output (`VoiceAgentAudioConfig`, `VoiceAgentAudioInputConfig`, `VoiceAgentAudioOutputConfig`), turn detection (`VoiceAgentTurnDetectionConfig` and its `VoiceAgentServerVadTurnDetection` / `VoiceAgentAzureSemanticVadTurnDetection` / `VoiceAgentAzureSemanticVadEnTurnDetection` / `VoiceAgentAzureSemanticVadMultilingualTurnDetection` variants), greeting (`VoiceAgentGreetingConfig` and its `VoiceAgentTemplateGreetingConfig` / `VoiceAgentLlmGeneratedGreetingConfig` variants), tools (`VoiceAgentTool`, `VoiceAgentFunctionTool`, `VoiceAgentMcpTool`, `VoiceAgentSystemTool`, `VoiceAgentToolboxTool`), and avatar (`VoiceAgentAvatarConfig`). Manage it like any other agent through `project_client.agents` (`create_version`, `get`, `list`, `disable`/`enable`, `delete`). * Added guided authoring via `project_client.agents.generate_agent(GenerateVoiceAgentRequest(kind=AgentKind.VOICE, ...))`, which returns a service-generated starter definition that can be edited afterward through the standard `create_version`/`update` flow. * Added a new `client.realtime` / `async_client.realtime` entry point for realtime speech-to-speech streaming. Use `with client.realtime.connect(agent_name=...) as connection:` to open a WebSocket connection, `connection.send(...)` to send strongly-typed client events (or use the `connection.response`, `connection.conversation.item`, and `connection.session` helpers), and iterate over `connection` to receive strongly-typed server events (`RealtimeServerEvent*`). Conversation items exchanged with `connection.conversation.item.create(...)` are `RealtimeConversationItemMessageSystem`, `RealtimeConversationItemMessageUser`, `RealtimeConversationItemMessageAssistant`, `RealtimeConversationItemFunctionCall`, `RealtimeConversationItemFunctionCallOutput`, `RealtimeMCPApprovalResponse`, or a raw `Mapping[str, Any]`. The new types `Realtime`, `RealtimeConnection`, and `RealtimeConnectionManager` (and their async equivalents `AsyncRealtime`, `AsyncRealtimeConnection`, `AsyncRealtimeConnectionManager`) are exported from `azure.ai.projects` / `azure.ai.projects.aio`. Requires the optional `websockets` package for the sync client, or `aiohttp` for the async client. - * Added the `beta.agent_endpoint_conversations` operation group for reading back persisted voice-agent conversation transcripts and audio, for agents created with `store=True`. + * Added the `agent_endpoint_conversations` operation group for reading back persisted voice-agent conversation transcripts and audio, for agents created with `store=True`. * Added the underlying `RealtimeConversationItem*`, `RealtimeMCP*`, `RealtimeResponseUsage`, and related realtime event/session models used by the voice agent WebSocket protocol. * Added 11 new samples under `samples/agents/voice/`, covering basic agent lifecycle, guided generation, live audio and text conversations (sync and async), function tools, versioning, and reading back conversation transcripts and audio. * Extended voice agents with telephony, WebRTC, and sub-agent consultation: * Added telephony bindings so a voice agent can receive calls through Teams Phone or Twilio. `project_client.agents.create_telephony_binding`/`get_telephony_binding`/`update_telephony_binding`/`delete_telephony_binding`/`list_telephony_bindings` manage the binding (`TelephonyBinding` and its `TeamsPhoneExtensionTelephonyBinding`/`TwilioTelephonyBinding` variants), and `list_telephony_calls`/`get_telephony_call`/`transfer_telephony_call`/`end_telephony_call`/`get_telephony_transfer_targets`/`replace_telephony_transfer_targets` manage in-progress and historical calls (`TelephonyCallRecord`, `TelephonyCallSummary`, `TelephonyCallTrace`, `TelephonyTransferTarget` and its `PSTNTelephonyTransferDestination`/`SipTelephonyTransferDestination`/`TeamsTelephonyTransferDestination` variants). * Added an optional WebRTC transport for realtime voice sessions (`VoiceAgentTransport.WEBRTC`), where only SDP signaling travels over the WebSocket connection while media flows peer-to-peer. The new `VoiceAgentClientEventRtcCallSdpCreate`, `VoiceAgentServerEventRtcCallSdpCreated`, and `VoiceAgentServerEventRtcCallError` events carry the signaling exchange. - * Added the `agent_endpoint_conversations.get_agent_conversation_item_generated_audio`/`get_agent_conversation_item_generated_audio_content` methods for reading back a conversation item's *generated* audio, a subordinate artifact that can differ from what the listener heard when playback was interrupted, returning `VoiceGeneratedItemAudioResponse`. This is a new top-level operation group, distinct from `beta.agent_endpoint_conversations`. - * Added sub-agent consultation, letting a voice agent consult sibling Foundry text agents as background specialists mid-conversation, through the new `subagent_config` property on `VoiceAgentDefinition` (`VoiceAgentSubAgentConfig`, `VoiceAgentSubAgent`, `VoiceAgentSubagentResponsePolicy`), and the new `session.subagent.started`/`session.subagent.completed`/`session.subagent.aborted` realtime server events. + * Added the `agent_endpoint_conversations.get_agent_conversation_item_generated_audio`/`get_agent_conversation_item_generated_audio_content` methods for reading back a conversation item's *generated* audio, a subordinate artifact that can differ from what the listener heard when playback was interrupted, returning `VoiceGeneratedItemAudioResponse`. + * Added sub-agent consultation, letting a voice agent consult sibling Foundry text agents as background specialists mid-conversation, through the new `subagent_config` property on `VoiceAgentDefinition` (`VoiceAgentSubagentConfig`, `VoiceAgentSubagent`, `VoiceAgentSubagentResponsePolicy`), and the new `session.subagent.started`/`session.subagent.completed`/`session.subagent.aborted` realtime server events. * Added an optional `conversation_engine` property on `VoiceAgentDefinition` (`VoiceConversationEngine`, `VoiceHostedAgentConversationEngine`) to delegate a voice agent's conversation handling to another hosted agent instead of configuring a model directly. * Added Microsoft 365 agent publishing: * `project_client.agents.publish_to_microsoft365(agent_name, publish_scope=...)` publishes a Foundry agent to Microsoft 365 / Microsoft Teams and returns a `Microsoft365PublishResult`. @@ -25,7 +25,7 @@ * Added the `beta.agent_insight_monitors` operation group for creating and managing Agent Insights monitors and their runs (`create`/`get`/`update`/`delete`/`list`/`reset`, `begin_create_run`/`get_run`/`cancel_run`/`list_runs`, `get_insight`/`update_insight`/`list_insights`), along with the supporting `AgentInsightMonitor`, `AgentInsightMonitorCreate`, `AgentInsightMonitorUpdate`, `AgentInsightMonitorListItem`, `AgentInsightRun`, `AgentInsight`, and related models. * Added an optional `authorization` argument to `.beta.routines.create_or_update`, with `RoutineAuthorization` and `RoutineDispatchIdentity` for selecting the agent or routine creator identity. * Added optional Hosted Agent session defaults through `HostedAgentDefinition.session_configuration` and `SessionConfiguration`, including idle-timeout configuration. -* Added content-safety moderation support for custom request, response, and streaming invocation body formats. +* Added content-safety moderation support for custom request, response, and streaming invocation body formats, including the `RaiInvocationModeration` and `RaiSseTextSelector` models and the `RaiInvocationContentType`/`RaiInvocationMode` enums for describing where in a streamed response moderated text is located. * Added `ShellToolboxTool` and supporting container environment and network policy models, with the new `ToolboxToolType.SHELL` enum member. * Added `WebIQPreviewTool` and `WebIQPreviewToolboxTool`, with new `ToolType.WEB_IQ_PREVIEW` and `ToolboxToolType.WEB_IQ_PREVIEW` enum members. * Added the optional `external_web_access` property to `WebSearchTool` and `WebSearchToolboxTool` for disabling live internet access. diff --git a/sdk/ai/azure-ai-projects/api.md b/sdk/ai/azure-ai-projects/api.md index 999e494fe7b2..52ab326d1106 100644 --- a/sdk/ai/azure-ai-projects/api.md +++ b/sdk/ai/azure-ai-projects/api.md @@ -233,6 +233,65 @@ namespace azure.ai.projects.aio.operations **kwargs ) -> None: ... + @distributed_trace_async + async def delete_agent_conversation( + self, + agent_name: str, + conversation_id: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def get_agent_conversation( + self, + agent_name: str, + conversation_id: str, + **kwargs: Any + ) -> VoiceConversation: ... + + @distributed_trace_async + async def get_agent_conversation_audio( + self, + agent_name: str, + conversation_id: str, + **kwargs: Any + ) -> VoiceRecordingResponse: ... + + @distributed_trace_async + async def get_agent_conversation_audio_content( + self, + agent_name: str, + conversation_id: str, + **kwargs: Any + ) -> AsyncIterator[bytes]: ... + + @distributed_trace_async + async def get_agent_conversation_item( + self, + agent_name: str, + conversation_id: str, + item_id: str, + **kwargs: Any + ) -> RealtimeConversationItem: ... + + @distributed_trace_async + async def get_agent_conversation_item_audio( + self, + agent_name: str, + conversation_id: str, + item_id: str, + **kwargs: Any + ) -> VoiceItemAudioResponse: ... + + @distributed_trace_async + async def get_agent_conversation_item_audio_content( + self, + agent_name: str, + conversation_id: str, + item_id: str, + **kwargs: Any + ) -> AsyncIterator[bytes]: ... + @distributed_trace_async async def get_agent_conversation_item_generated_audio( self, @@ -251,6 +310,63 @@ namespace azure.ai.projects.aio.operations **kwargs: Any ) -> AsyncIterator[bytes]: ... + @distributed_trace_async + async def get_agent_conversation_response( + self, + agent_name: str, + conversation_id: str, + response_id: str, + **kwargs: Any + ) -> VoiceResponse: ... + + @distributed_trace + def list_agent_conversation_items( + self, + agent_name: str, + conversation_id: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[RealtimeConversationItem]: ... + + @distributed_trace + def list_agent_conversation_response_items( + self, + agent_name: str, + conversation_id: str, + response_id: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[RealtimeConversationItem]: ... + + @distributed_trace + def list_agent_conversation_responses( + self, + agent_name: str, + conversation_id: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[VoiceResponse]: ... + + @distributed_trace + def list_agent_conversations( + self, + agent_name: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[VoiceConversation]: ... + class azure.ai.projects.aio.operations.AgentsOperations(GeneratedAgentsOperations): @@ -899,131 +1015,6 @@ namespace azure.ai.projects.aio.operations ) -> SessionFileWriteResult: ... - class azure.ai.projects.aio.operations.BetaAgentEndpointConversationsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @distributed_trace_async - async def delete_agent_conversation( - self, - agent_name: str, - conversation_id: str, - **kwargs: Any - ) -> None: ... - - @distributed_trace_async - async def get_agent_conversation( - self, - agent_name: str, - conversation_id: str, - **kwargs: Any - ) -> VoiceConversation: ... - - @distributed_trace_async - async def get_agent_conversation_audio( - self, - agent_name: str, - conversation_id: str, - **kwargs: Any - ) -> VoiceRecordingResponse: ... - - @distributed_trace_async - async def get_agent_conversation_audio_content( - self, - agent_name: str, - conversation_id: str, - **kwargs: Any - ) -> AsyncIterator[bytes]: ... - - @distributed_trace_async - async def get_agent_conversation_item( - self, - agent_name: str, - conversation_id: str, - item_id: str, - **kwargs: Any - ) -> RealtimeConversationItem: ... - - @distributed_trace_async - async def get_agent_conversation_item_audio( - self, - agent_name: str, - conversation_id: str, - item_id: str, - **kwargs: Any - ) -> VoiceItemAudioResponse: ... - - @distributed_trace_async - async def get_agent_conversation_item_audio_content( - self, - agent_name: str, - conversation_id: str, - item_id: str, - **kwargs: Any - ) -> AsyncIterator[bytes]: ... - - @distributed_trace_async - async def get_agent_conversation_response( - self, - agent_name: str, - conversation_id: str, - response_id: str, - **kwargs: Any - ) -> VoiceResponse: ... - - @distributed_trace - def list_agent_conversation_items( - self, - agent_name: str, - conversation_id: str, - *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> AsyncItemPaged[RealtimeConversationItem]: ... - - @distributed_trace - def list_agent_conversation_response_items( - self, - agent_name: str, - conversation_id: str, - response_id: str, - *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> AsyncItemPaged[RealtimeConversationItem]: ... - - @distributed_trace - def list_agent_conversation_responses( - self, - agent_name: str, - conversation_id: str, - *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> AsyncItemPaged[VoiceResponse]: ... - - @distributed_trace - def list_agent_conversations( - self, - agent_name: str, - *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> AsyncItemPaged[VoiceConversation]: ... - - class azure.ai.projects.aio.operations.BetaAgentInsightMonitorsOperations(BetaAgentInsightMonitorsOperationsGenerated): def __init__( @@ -1039,6 +1030,7 @@ namespace azure.ai.projects.aio.operations run: AgentInsightRunCreate, *, content_type: str = "application/json", + operation_id: Optional[str] = ..., **kwargs: Any ) -> AsyncAgentInsightRunLROPoller: ... @@ -1049,6 +1041,7 @@ namespace azure.ai.projects.aio.operations run: JSON, *, content_type: str = "application/json", + operation_id: Optional[str] = ..., **kwargs: Any ) -> AsyncAgentInsightRunLROPoller: ... @@ -1059,6 +1052,7 @@ namespace azure.ai.projects.aio.operations run: IO[bytes], *, content_type: str = "application/json", + operation_id: Optional[str] = ..., **kwargs: Any ) -> AsyncAgentInsightRunLROPoller: ... @@ -2279,7 +2273,6 @@ namespace azure.ai.projects.aio.operations class azure.ai.projects.aio.operations.BetaOperations(GeneratedBetaOperations): - agent_endpoint_conversations: BetaAgentEndpointConversationsOperations agent_insight_monitors: BetaAgentInsightMonitorsOperations agents: BetaAgentsOperations datasets: BetaDatasetsOperations @@ -3158,6 +3151,29 @@ namespace azure.ai.projects.aio.operations ) -> ToolboxObject: ... + class azure.ai.projects.aio.operations.VoiceAgentWebSocketOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def connect_voice_agent( + self, + agent_name: str, + *, + agent_version_override: Optional[str] = ..., + foundry_features_query: Optional[Literal[_AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW]] = ..., + store: Optional[bool] = ..., + structured_input: Optional[str] = ..., + transport: Optional[Union[str, VoiceAgentTransport]] = ..., + websocket_subprotocol: Optional[Union[str, VoiceAgentWebSocketSubprotocol]] = ..., + **kwargs: Any + ) -> None: ... + + namespace azure.ai.projects.models class azure.ai.projects.models.A2APreviewTool(Tool, discriminator='a2a_preview'): @@ -9306,12 +9322,14 @@ namespace azure.ai.projects.models class azure.ai.projects.models.RaiConfig(_Model): + invocations_moderation: Optional[RaiInvocationModeration] rai_policy_name: str @overload def __init__( self, *, + invocations_moderation: Optional[RaiInvocationModeration] = ..., rai_policy_name: str ) -> None: ... @@ -9319,6 +9337,57 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.RaiInvocationContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + JSON = "json" + TEXT = "text" + + + class azure.ai.projects.models.RaiInvocationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BOTH = "both" + NON_STREAMING = "non_streaming" + STREAMING = "streaming" + + + class azure.ai.projects.models.RaiInvocationModeration(_Model): + input_content_type: Optional[Union[str, RaiInvocationContentType]] + input_paths: Optional[list[str]] + output_content_type: Optional[Union[str, RaiInvocationContentType]] + output_paths: Optional[list[str]] + response_mode: Union[str, RaiInvocationMode] + stream_selectors: Optional[list[RaiSseTextSelector]] + + @overload + def __init__( + self, + *, + input_content_type: Optional[Union[str, RaiInvocationContentType]] = ..., + input_paths: Optional[list[str]] = ..., + output_content_type: Optional[Union[str, RaiInvocationContentType]] = ..., + output_paths: Optional[list[str]] = ..., + response_mode: Union[str, RaiInvocationMode], + stream_selectors: Optional[list[RaiSseTextSelector]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RaiSseTextSelector(_Model): + event_type: str + text_field: Optional[str] + + @overload + def __init__( + self, + *, + event_type: str, + text_field: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.RankerVersionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): AUTO = "auto" DEFAULT_2024_11_15 = "default-2024-11-15" @@ -13880,7 +13949,6 @@ namespace azure.ai.projects.models class azure.ai.projects.models.VoiceAgentAvatarOutputProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): WEBRTC = "webrtc" WEBSOCKET = "websocket" - WEBSOCKET_BINARY = "websocket-binary" class azure.ai.projects.models.VoiceAgentAvatarScene(_Model): @@ -14158,7 +14226,7 @@ namespace azure.ai.projects.models rai_config: RaiConfig store: Optional[bool] structured_inputs: Optional[dict[str, StructuredInputDefinition]] - subagent_config: Optional[VoiceAgentSubAgentConfig] + subagent_config: Optional[VoiceAgentSubagentConfig] tool_choice: Optional[VoiceAgentToolChoice] tools: Optional[list[VoiceAgentTool]] @@ -14181,7 +14249,7 @@ namespace azure.ai.projects.models rai_config: Optional[RaiConfig] = ..., store: Optional[bool] = ..., structured_inputs: Optional[dict[str, StructuredInputDefinition]] = ..., - subagent_config: Optional[VoiceAgentSubAgentConfig] = ..., + subagent_config: Optional[VoiceAgentSubagentConfig] = ..., tool_choice: Optional[VoiceAgentToolChoice] = ..., tools: Optional[list[VoiceAgentTool]] = ... ) -> None: ... @@ -15122,7 +15190,7 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentSubAgent(_Model): + class azure.ai.projects.models.VoiceAgentSubagent(_Model): agent_capabilities: str agent_name: str agent_version: Optional[str] @@ -15144,29 +15212,29 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentSubAgentConfig(_Model): - subagents: list[VoiceAgentSubAgent] + class azure.ai.projects.models.VoiceAgentSubagentAbortReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELLED = "cancelled" + FAILED = "failed" + STOPPED_BY_USER = "stopped_by_user" + SUPERSEDED = "superseded" + TIMEOUT = "timeout" + UNKNOWN_TARGET = "unknown_target" + + + class azure.ai.projects.models.VoiceAgentSubagentConfig(_Model): + subagents: list[VoiceAgentSubagent] @overload def __init__( self, *, - subagents: list[VoiceAgentSubAgent] + subagents: list[VoiceAgentSubagent] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentSubagentAbortReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CANCELLED = "cancelled" - FAILED = "failed" - STOPPED_BY_USER = "stopped_by_user" - SUPERSEDED = "superseded" - TIMEOUT = "timeout" - UNKNOWN_TARGET = "unknown_target" - - class azure.ai.projects.models.VoiceAgentSubagentResponsePolicy(_Model): ack_instructions: Optional[str] enable_delta_progress: Optional[bool] @@ -15883,19 +15951,78 @@ namespace azure.ai.projects.models workflow: Optional[str] = ... ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + +namespace azure.ai.projects.operations + + class azure.ai.projects.operations.AgentEndpointConversationsOperations(GeneratedAgentEndpointConversationsOperations): + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def delete_agent_conversation( + self, + agent_name: str, + conversation_id: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get_agent_conversation( + self, + agent_name: str, + conversation_id: str, + **kwargs: Any + ) -> VoiceConversation: ... + @distributed_trace + def get_agent_conversation_audio( + self, + agent_name: str, + conversation_id: str, + **kwargs: Any + ) -> VoiceRecordingResponse: ... -namespace azure.ai.projects.operations + @distributed_trace + def get_agent_conversation_audio_content( + self, + agent_name: str, + conversation_id: str, + **kwargs: Any + ) -> Iterator[bytes]: ... - class azure.ai.projects.operations.AgentEndpointConversationsOperations(GeneratedAgentEndpointConversationsOperations): + @distributed_trace + def get_agent_conversation_item( + self, + agent_name: str, + conversation_id: str, + item_id: str, + **kwargs: Any + ) -> RealtimeConversationItem: ... - def __init__( + @distributed_trace + def get_agent_conversation_item_audio( self, - *args, - **kwargs - ) -> None: ... + agent_name: str, + conversation_id: str, + item_id: str, + **kwargs: Any + ) -> VoiceItemAudioResponse: ... + + @distributed_trace + def get_agent_conversation_item_audio_content( + self, + agent_name: str, + conversation_id: str, + item_id: str, + **kwargs: Any + ) -> Iterator[bytes]: ... @distributed_trace def get_agent_conversation_item_generated_audio( @@ -15915,6 +16042,63 @@ namespace azure.ai.projects.operations **kwargs: Any ) -> Iterator[bytes]: ... + @distributed_trace + def get_agent_conversation_response( + self, + agent_name: str, + conversation_id: str, + response_id: str, + **kwargs: Any + ) -> VoiceResponse: ... + + @distributed_trace + def list_agent_conversation_items( + self, + agent_name: str, + conversation_id: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[RealtimeConversationItem]: ... + + @distributed_trace + def list_agent_conversation_response_items( + self, + agent_name: str, + conversation_id: str, + response_id: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[RealtimeConversationItem]: ... + + @distributed_trace + def list_agent_conversation_responses( + self, + agent_name: str, + conversation_id: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[VoiceResponse]: ... + + @distributed_trace + def list_agent_conversations( + self, + agent_name: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[VoiceConversation]: ... + class azure.ai.projects.operations.AgentsOperations(GeneratedAgentsOperations): @@ -16563,131 +16747,6 @@ namespace azure.ai.projects.operations ) -> SessionFileWriteResult: ... - class azure.ai.projects.operations.BetaAgentEndpointConversationsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @distributed_trace - def delete_agent_conversation( - self, - agent_name: str, - conversation_id: str, - **kwargs: Any - ) -> None: ... - - @distributed_trace - def get_agent_conversation( - self, - agent_name: str, - conversation_id: str, - **kwargs: Any - ) -> VoiceConversation: ... - - @distributed_trace - def get_agent_conversation_audio( - self, - agent_name: str, - conversation_id: str, - **kwargs: Any - ) -> VoiceRecordingResponse: ... - - @distributed_trace - def get_agent_conversation_audio_content( - self, - agent_name: str, - conversation_id: str, - **kwargs: Any - ) -> Iterator[bytes]: ... - - @distributed_trace - def get_agent_conversation_item( - self, - agent_name: str, - conversation_id: str, - item_id: str, - **kwargs: Any - ) -> RealtimeConversationItem: ... - - @distributed_trace - def get_agent_conversation_item_audio( - self, - agent_name: str, - conversation_id: str, - item_id: str, - **kwargs: Any - ) -> VoiceItemAudioResponse: ... - - @distributed_trace - def get_agent_conversation_item_audio_content( - self, - agent_name: str, - conversation_id: str, - item_id: str, - **kwargs: Any - ) -> Iterator[bytes]: ... - - @distributed_trace - def get_agent_conversation_response( - self, - agent_name: str, - conversation_id: str, - response_id: str, - **kwargs: Any - ) -> VoiceResponse: ... - - @distributed_trace - def list_agent_conversation_items( - self, - agent_name: str, - conversation_id: str, - *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> ItemPaged[RealtimeConversationItem]: ... - - @distributed_trace - def list_agent_conversation_response_items( - self, - agent_name: str, - conversation_id: str, - response_id: str, - *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> ItemPaged[RealtimeConversationItem]: ... - - @distributed_trace - def list_agent_conversation_responses( - self, - agent_name: str, - conversation_id: str, - *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> ItemPaged[VoiceResponse]: ... - - @distributed_trace - def list_agent_conversations( - self, - agent_name: str, - *, - before: Optional[str] = ..., - limit: Optional[int] = ..., - order: Optional[Union[str, PageOrder]] = ..., - **kwargs: Any - ) -> ItemPaged[VoiceConversation]: ... - - class azure.ai.projects.operations.BetaAgentInsightMonitorsOperations(BetaAgentInsightMonitorsOperationsGenerated): def __init__( @@ -16703,6 +16762,7 @@ namespace azure.ai.projects.operations run: AgentInsightRunCreate, *, content_type: str = "application/json", + operation_id: Optional[str] = ..., **kwargs: Any ) -> AgentInsightRunLROPoller: ... @@ -16713,6 +16773,7 @@ namespace azure.ai.projects.operations run: JSON, *, content_type: str = "application/json", + operation_id: Optional[str] = ..., **kwargs: Any ) -> AgentInsightRunLROPoller: ... @@ -16723,6 +16784,7 @@ namespace azure.ai.projects.operations run: IO[bytes], *, content_type: str = "application/json", + operation_id: Optional[str] = ..., **kwargs: Any ) -> AgentInsightRunLROPoller: ... @@ -17945,7 +18007,6 @@ namespace azure.ai.projects.operations class azure.ai.projects.operations.BetaOperations(GeneratedBetaOperations): - agent_endpoint_conversations: BetaAgentEndpointConversationsOperations agent_insight_monitors: BetaAgentInsightMonitorsOperations agents: BetaAgentsOperations datasets: BetaDatasetsOperations @@ -18824,6 +18885,29 @@ namespace azure.ai.projects.operations ) -> ToolboxObject: ... + class azure.ai.projects.operations.VoiceAgentWebSocketOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def connect_voice_agent( + self, + agent_name: str, + *, + agent_version_override: Optional[str] = ..., + foundry_features_query: Optional[Literal[_AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW]] = ..., + store: Optional[bool] = ..., + structured_input: Optional[str] = ..., + transport: Optional[Union[str, VoiceAgentTransport]] = ..., + websocket_subprotocol: Optional[Union[str, VoiceAgentWebSocketSubprotocol]] = ..., + **kwargs: Any + ) -> None: ... + + namespace azure.ai.projects.telemetry def azure.ai.projects.telemetry.trace_function(span_name: Optional[str] = None) -> Callable: ... diff --git a/sdk/ai/azure-ai-projects/api.metadata.yml b/sdk/ai/azure-ai-projects/api.metadata.yml index f3eabe2d568b..43bde395b2f7 100644 --- a/sdk/ai/azure-ai-projects/api.metadata.yml +++ b/sdk/ai/azure-ai-projects/api.metadata.yml @@ -1,4 +1,4 @@ -apiMdSha256: facabc91ae97258e9e1aa86660a5b2611026d364769207d0107256a109bdca89 +apiMdSha256: 5955e866f2d81033ae0d647f5302da703f40bd2efd222650cd1555bf3d9286d7 packageVersion: 2.6.0 parserVersion: 0.3.31 pythonVersion: 3.13.2 diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py index a1bcb82067e9..6c95c39bec50 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py @@ -248,11 +248,14 @@ def __init__( self.telemetry = TelemetryOperations(self) # type: ignore self._realtime: Optional[Realtime] = None - # NOTE: voice-agent conversation reads (`agent_endpoint_conversations`) used to require - # hand-wiring the VoiceAgents=V1Preview opt-in header here, since that sub-client used to - # live directly on `self`. It has since moved under `self.beta` upstream, so its header - # injection is now handled generically by `_BETA_OPERATION_FEATURE_HEADERS` in - # `operations/_patch.py`'s `BetaOperations.__init__` -- see that file. + # NOTE: voice-agent conversation reads (`agent_endpoint_conversations`) have round-tripped + # between living directly on `self` (top-level) and being nested under `self.beta` across + # several upstream TypeSpec regenerations. It is currently back to being a top-level, + # stable client attribute again -- its VoiceAgents=V1Preview opt-in header injection is + # handled per-method (gated behind `allow_preview`) in + # `operations/_patch_agent_endpoint_conversations.py`, not by + # `_BETA_OPERATION_FEATURE_HEADERS`/`BetaOperations.__init__` (which only applies to + # `.beta`'s sub-clients). @property def realtime(self) -> Realtime: diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py index a541f3aab9ad..48ce766611e0 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py @@ -182,21 +182,25 @@ def __init__( self.telemetry = TelemetryOperations(self) # type: ignore self._realtime: Optional[AsyncRealtime] = None - # NOTE: voice-agent conversation reads (`agent_endpoint_conversations`) used to require - # hand-wiring the VoiceAgents=V1Preview opt-in header here, since that sub-client used to - # live directly on `self`. It has since moved under `self.beta` upstream, so its header - # injection is now handled generically by `_BETA_OPERATION_FEATURE_HEADERS` in - # `operations/_patch.py`'s `BetaOperations.__init__` -- see that file. + # NOTE: voice-agent conversation reads (`agent_endpoint_conversations`) have round-tripped + # between living directly on `self` (top-level) and being nested under `self.beta` across + # several upstream TypeSpec regenerations. It is currently back to being a top-level, + # stable client attribute again -- its VoiceAgents=V1Preview opt-in header injection is + # handled per-method (gated behind `allow_preview`) in + # `operations/_patch_agent_endpoint_conversations_async.py`, not by + # `_BETA_OPERATION_FEATURE_HEADERS`/`BetaOperations.__init__` (which only applies to + # `.beta`'s sub-clients). If this moves back under `.beta` in a future regeneration, update + # both that file and the `_AcceptEncodingIdentityProxy` wiring below together. # Work around a known async aiohttp transport issue (spurious UnicodeDecodeError caused by # compressed response bodies reaching text/JSON deserialization before decompression) by # disabling response compression for these two operation groups only. # Guarded with hasattr since some tests mock out the generated __init__ entirely, in which - # case none of the generated operation-group attributes (including `beta` itself) are set. + # case none of the generated operation-group attributes may be set. if hasattr(self, "agents"): self.agents = _AcceptEncodingIdentityProxy(self.agents) # type: ignore - if hasattr(self, "beta") and hasattr(self.beta, "agent_endpoint_conversations"): - self.beta.agent_endpoint_conversations = _AcceptEncodingIdentityProxy( # type: ignore - self.beta.agent_endpoint_conversations + if hasattr(self, "agent_endpoint_conversations"): + self.agent_endpoint_conversations = _AcceptEncodingIdentityProxy( # type: ignore + self.agent_endpoint_conversations ) @property diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch.py index 39701ab4cc32..c43045c8cdda 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch.py @@ -21,7 +21,6 @@ from ._patch_models_async import BetaModelsOperations from ...operations._patch import _BETA_OPERATION_FEATURE_HEADERS, _OperationMethodHeaderProxy from ._operations import ( - BetaAgentEndpointConversationsOperations, BetaEvaluationTaxonomiesOperations, BetaInsightsOperations, BetaOperations as GeneratedBetaOperations, @@ -44,8 +43,6 @@ class BetaOperations(GeneratedBetaOperations): agents: BetaAgentsOperations """:class:`~azure.ai.projects.aio.operations.BetaAgentsOperations` operations""" - agent_endpoint_conversations: BetaAgentEndpointConversationsOperations - """:class:`~azure.ai.projects.aio.operations.BetaAgentEndpointConversationsOperations` operations""" agent_insight_monitors: BetaAgentInsightMonitorsOperations """:class:`~azure.ai.projects.aio.operations.BetaAgentInsightMonitorsOperations` operations""" evaluation_taxonomies: BetaEvaluationTaxonomiesOperations @@ -97,7 +94,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: __all__: List[str] = [ "AgentsOperations", "AgentEndpointConversationsOperations", - "BetaAgentEndpointConversationsOperations", "BetaAgentInsightMonitorsOperations", "BetaAgentsOperations", "BetaDatasetsOperations", diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agent_endpoint_conversations_async.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agent_endpoint_conversations_async.py index 3e5e97a620de..563182dfee95 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agent_endpoint_conversations_async.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agent_endpoint_conversations_async.py @@ -8,8 +8,10 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import Any, AsyncIterator +from typing import Any, AsyncIterator, Optional, Union +from azure.core.async_paging import AsyncItemPaged from azure.core.exceptions import HttpResponseError +from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async from ._operations import AgentEndpointConversationsOperations as GeneratedAgentEndpointConversationsOperations from ... import models as _models @@ -21,6 +23,12 @@ _PREVIEW_FEATURE_ADDED_ERROR_MESSAGE, ) +# All methods on this class always require the VoiceAgents=V1Preview opt-in (voice-agent +# conversation reads), regardless of `allow_preview` -- see the matching NOTE in the sync +# `_patch_agent_endpoint_conversations.py` for the full explanation (confirmed empirically against +# the live service). +_VOICE_AGENTS_HEADER_VALUE = _AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.value + class AgentEndpointConversationsOperations(GeneratedAgentEndpointConversationsOperations): """ @@ -32,6 +40,501 @@ class AgentEndpointConversationsOperations(GeneratedAgentEndpointConversationsOp :attr:`agent_endpoint_conversations` attribute. """ + @distributed_trace + def list_agent_conversations( # type: ignore[override] + self, + agent_name: str, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any, + ) -> AsyncItemPaged["_models.VoiceConversation"]: + """List voice agent conversations. + + Returns the conversations persisted for the specified voice agent endpoint. Conversations are + present when the session's effective ``store`` setting is ``true``, whether inherited from the + agent definition or enabled by the WebSocket session override. When the client is constructed + with ``allow_preview=True``, the required preview opt-in header is added automatically. + + :param agent_name: The name of the 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 VoiceConversation + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.VoiceConversation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _VOICE_AGENTS_HEADER_VALUE} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _VOICE_AGENTS_HEADER_VALUE + kwargs["headers"] = headers + + return super().list_agent_conversations(agent_name, limit=limit, order=order, before=before, **kwargs) + + @distributed_trace_async + async def get_agent_conversation( # type: ignore[override] + self, agent_name: str, conversation_id: str, **kwargs: Any + ) -> _models.VoiceConversation: + """Get a voice agent conversation. + + Retrieves a single conversation recorded for the specified voice agent endpoint by its id. + Returns ``404`` when the conversation was not persisted (``store = false``) or does not exist. + When the client is constructed with ``allow_preview=True``, the required preview opt-in header + is added automatically. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation to retrieve. Required. + :type conversation_id: str + :return: VoiceConversation. The VoiceConversation is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceConversation + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _VOICE_AGENTS_HEADER_VALUE} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _VOICE_AGENTS_HEADER_VALUE + kwargs["headers"] = headers + + try: + return await super().get_agent_conversation(agent_name, conversation_id, **kwargs) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + + @distributed_trace_async + async def delete_agent_conversation( # pylint: disable=inconsistent-return-statements # type: ignore[override] + self, agent_name: str, conversation_id: str, **kwargs: Any + ) -> None: + """Delete a voice agent conversation. + + Deletes a conversation and all of its stored data — responses, items, and any audio (cascade). + This is the customer's explicit data-deletion control for voice conversations. When the client + is constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation to delete. Required. + :type conversation_id: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _VOICE_AGENTS_HEADER_VALUE} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _VOICE_AGENTS_HEADER_VALUE + kwargs["headers"] = headers + + try: + return await super().delete_agent_conversation(agent_name, conversation_id, **kwargs) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + + @distributed_trace + def list_agent_conversation_responses( # type: ignore[override] + 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.VoiceResponse"]: + """List responses in a voice agent conversation. + + Returns a paged collection of the responses (model inference turns) recorded for the specified + conversation. The per-response ``output`` projection may be omitted here; use the + response-items route for the canonical paged output. Returns ``404`` when the conversation was + not persisted (``store = false``). When the client is constructed with ``allow_preview=True``, + the required preview opt-in header is added automatically. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose responses are listed. 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 VoiceResponse + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.VoiceResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _VOICE_AGENTS_HEADER_VALUE} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _VOICE_AGENTS_HEADER_VALUE + kwargs["headers"] = headers + + return super().list_agent_conversation_responses( + agent_name, conversation_id, limit=limit, order=order, before=before, **kwargs + ) + + @distributed_trace_async + async def get_agent_conversation_response( # type: ignore[override] + self, agent_name: str, conversation_id: str, response_id: str, **kwargs: Any + ) -> _models.VoiceResponse: + """Get a voice agent conversation response. + + Retrieves a single response from the specified conversation by its id, including its ``output`` + items, ``usage``, and status. Returns ``404`` when the conversation or response was not + persisted (``store = false``). When the client is constructed with ``allow_preview=True``, the + required preview opt-in header is added automatically. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the response. Required. + :type conversation_id: str + :param response_id: The id of the response to retrieve. Required. + :type response_id: str + :return: VoiceResponse. The VoiceResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _VOICE_AGENTS_HEADER_VALUE} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _VOICE_AGENTS_HEADER_VALUE + kwargs["headers"] = headers + + try: + return await super().get_agent_conversation_response(agent_name, conversation_id, response_id, **kwargs) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + + @distributed_trace + def list_agent_conversation_response_items( # pylint: disable=name-too-long # type: ignore[override] + self, + agent_name: str, + conversation_id: str, + response_id: str, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any, + ) -> AsyncItemPaged["_models.RealtimeConversationItem"]: + """List items produced by a voice agent conversation response. + + Returns a paged collection of the output items produced by a specific response (the response's + output projection). For the complete ordered conversation history — including user input and + client-created tool outputs — use the conversation items route instead. Returns ``404`` when + the conversation or response was not persisted (``store = false``). When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the response. Required. + :type conversation_id: str + :param response_id: The id of the response whose output items are listed. Required. + :type response_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 RealtimeConversationItem + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.RealtimeConversationItem] + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _VOICE_AGENTS_HEADER_VALUE} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _VOICE_AGENTS_HEADER_VALUE + kwargs["headers"] = headers + + return super().list_agent_conversation_response_items( + agent_name, conversation_id, response_id, limit=limit, order=order, before=before, **kwargs + ) + + @distributed_trace + def list_agent_conversation_items( # type: ignore[override] + 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.RealtimeConversationItem"]: + """List items in a voice agent conversation. + + Returns a paged collection of items — the complete ordered conversation history, including user + input, assistant output, and client-created tool outputs (transcripts + tool events). Returns + ``404`` when the conversation was not persisted (``store = false``). When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose items are listed. 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 RealtimeConversationItem + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.RealtimeConversationItem] + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _VOICE_AGENTS_HEADER_VALUE} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _VOICE_AGENTS_HEADER_VALUE + kwargs["headers"] = headers + + return super().list_agent_conversation_items( + agent_name, conversation_id, limit=limit, order=order, before=before, **kwargs + ) + + @distributed_trace_async + async def get_agent_conversation_item( # type: ignore[override] + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.RealtimeConversationItem: + """Get a voice agent conversation item. + + Retrieves a single item from the specified conversation by its id, including its transcript. An + ``input_audio``/``output_audio`` content part indicates that audio is available for the item; + the canonical per-item audio metadata is the ``/items/{item_id}/audio`` resource, and the bytes + are streamed by ``/items/{item_id}/audio/content``. Returns ``404`` when the conversation or + item was not persisted (``store = false``). When the client is constructed with + ``allow_preview=True``, the required preview opt-in header is added automatically. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item to retrieve. Required. + :type item_id: str + :return: RealtimeConversationItem. The RealtimeConversationItem is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.RealtimeConversationItem + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _VOICE_AGENTS_HEADER_VALUE} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _VOICE_AGENTS_HEADER_VALUE + kwargs["headers"] = headers + + try: + return await super().get_agent_conversation_item(agent_name, conversation_id, item_id, **kwargs) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + + @distributed_trace_async + async def get_agent_conversation_item_audio( # pylint: disable=name-too-long # type: ignore[override] + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.VoiceItemAudioResponse: + """Get a voice agent conversation item's audio metadata. + + Returns metadata for a single conversation item's audio segment, including the common playback + facts (role, format/codec, sample rate, channels, offset, duration) for both Foundry-managed + and bring-your-own-storage (BYOS) recordings; for BYOS the response additionally includes + ``blob_uri``, the URI of the recording in the customer's own storage (no SAS) that the customer + downloads with their own credentials. Requires the conversation to have persisted audio + (``store = true``); returns ``404`` when the conversation, item, or its audio was not + persisted. When the client is constructed with ``allow_preview=True``, the required preview + opt-in header is added automatically. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose audio metadata is retrieved. Required. + :type item_id: str + :return: VoiceItemAudioResponse. The VoiceItemAudioResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceItemAudioResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _VOICE_AGENTS_HEADER_VALUE} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _VOICE_AGENTS_HEADER_VALUE + kwargs["headers"] = headers + + try: + return await super().get_agent_conversation_item_audio(agent_name, conversation_id, item_id, **kwargs) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + + @distributed_trace_async + async def get_agent_conversation_item_audio_content( # pylint: disable=name-too-long # type: ignore[override] + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + """Stream a voice agent conversation item's audio. + + Streams a single conversation item's audio as a WAV (``audio/wav``) byte stream through the + service (no SAS URL). This route serves Foundry-managed storage only. For + bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download + directly from customer storage using the ``blob_uri`` returned by the item's ``/audio`` + metadata route — so this route returns ``409 Conflict`` for BYOS recordings. Returns ``404`` + when the conversation, item, or its audio was not persisted (``store = false``). When the + client is constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose audio is streamed. Required. + :type item_id: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _VOICE_AGENTS_HEADER_VALUE} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _VOICE_AGENTS_HEADER_VALUE + kwargs["headers"] = headers + + try: + return await super().get_agent_conversation_item_audio_content( + agent_name, conversation_id, item_id, **kwargs + ) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + @distributed_trace_async async def get_agent_conversation_item_generated_audio( # pylint: disable=name-too-long # type: ignore[override] self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any @@ -140,3 +643,110 @@ async def get_agent_conversation_item_generated_audio_content( # pylint: disabl new_exc.model = exc.model raise new_exc from exc raise + + @distributed_trace_async + async def get_agent_conversation_audio( # type: ignore[override] + self, agent_name: str, conversation_id: str, **kwargs: Any + ) -> _models.VoiceRecordingResponse: + """Get a voice agent conversation's merged recording metadata. + + Returns metadata for the whole-call merged stereo recording (user audio on the left channel, + agent audio on the right). The common metadata (format, sample rate, channels, channel layout, + duration) is returned for both Foundry-managed and bring-your-own-storage (BYOS) recordings; + for BYOS the response additionally includes ``blob_uri``, the URI of the recording in the + customer's own storage (no SAS) that the customer downloads with their own credentials. The + recording is built once from the per-turn segments after persistence finalization succeeds. + While the conversation is ``in_progress``, this route returns retriable ``409 Conflict`` with + ``error.code = recording_not_ready`` and a ``Retry-After`` header when retry guidance is + available. When the conversation is ``failed``, it returns terminal ``409 Conflict`` with + ``error.code = recording_unavailable``. For a ``completed`` conversation, metadata is available + subject to the existing BYOS behavior. Requires the conversation to have persisted audio + (``store = true``); otherwise returns ``404``. When the client is constructed with + ``allow_preview=True``, the required preview opt-in header is added automatically. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose merged recording metadata is + retrieved. Required. + :type conversation_id: str + :return: VoiceRecordingResponse. The VoiceRecordingResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceRecordingResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _VOICE_AGENTS_HEADER_VALUE} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _VOICE_AGENTS_HEADER_VALUE + kwargs["headers"] = headers + + try: + return await super().get_agent_conversation_audio(agent_name, conversation_id, **kwargs) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + + @distributed_trace_async + async def get_agent_conversation_audio_content( # type: ignore[override] + self, agent_name: str, conversation_id: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + """Stream a voice agent conversation's merged recording. + + Streams the whole-call merged stereo recording as a WAV (``audio/wav``) byte stream through the + service (no SAS URL). This route serves Foundry-managed storage only. For + bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download + directly from customer storage using the ``blob_uri`` returned by the metadata route — so this + route returns ``409 Conflict`` for BYOS recordings. While the conversation is ``in_progress``, + this route returns retriable ``409 Conflict`` with ``error.code = recording_not_ready`` and a + ``Retry-After`` header when retry guidance is available. When the conversation is ``failed``, + it returns terminal ``409 Conflict`` with ``error.code = recording_unavailable``. For a + ``completed`` conversation, content is available subject to the existing BYOS behavior. A + conversation without persisted audio (``store = false``) returns ``404``. When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose merged recording is streamed. + Required. + :type conversation_id: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _VOICE_AGENTS_HEADER_VALUE} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _VOICE_AGENTS_HEADER_VALUE + kwargs["headers"] = headers + + try: + return await super().get_agent_conversation_audio_content(agent_name, conversation_id, **kwargs) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise 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 9d254620b1bc..c315c4298613 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 @@ -76,10 +76,13 @@ "skills": _FoundryFeaturesOptInKeys.SKILLS_V1_PREVIEW.value, "datasets": _FoundryFeaturesOptInKeys.DATA_GENERATION_JOBS_V1_PREVIEW.value, "agents": _AGENT_OPERATION_FEATURE_HEADERS, - # agent_endpoint_conversations moved from a top-level client attribute to a nested `.beta` - # sub-client upstream; it always requires the VoiceAgents=V1Preview opt-in (voice-agent - # conversation reads), matching the same requirement voice-agent definition operations have. - "agent_endpoint_conversations": _AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.value, + # NOTE: `agent_endpoint_conversations` used to need an entry here (it lived as a nested + # `.beta` sub-client). Upstream has since merged it entirely into the top-level, stable + # `agent_endpoint_conversations` client attribute (all methods that used to live under + # `.beta.agent_endpoint_conversations` moved there), so it's no longer part of `.beta` at + # all and must NOT have an entry in this dict -- `BetaOperations.__init__` would raise + # AttributeError trying to `getattr(self, "agent_endpoint_conversations")` otherwise, since + # that attribute no longer exists on the generated `BetaOperations` base class. } """Foundry-Features header values keyed by beta sub-client property name.""" diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch.py index bc217de3b292..624ebf36e119 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch.py @@ -23,7 +23,6 @@ from ._patch_memories import BetaMemoryStoresOperations from ._patch_models import BetaModelsOperations from ._operations import ( - BetaAgentEndpointConversationsOperations, BetaEvaluationTaxonomiesOperations, BetaInsightsOperations, BetaOperations as GeneratedBetaOperations, @@ -99,8 +98,6 @@ class BetaOperations(GeneratedBetaOperations): agents: BetaAgentsOperations """:class:`~azure.ai.projects.operations.BetaAgentsOperations` operations""" - agent_endpoint_conversations: BetaAgentEndpointConversationsOperations - """:class:`~azure.ai.projects.operations.BetaAgentEndpointConversationsOperations` operations""" agent_insight_monitors: BetaAgentInsightMonitorsOperations """:class:`~azure.ai.projects.operations.BetaAgentInsightMonitorsOperations` operations""" evaluation_taxonomies: BetaEvaluationTaxonomiesOperations @@ -152,7 +149,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: __all__: List[str] = [ "AgentsOperations", "AgentEndpointConversationsOperations", - "BetaAgentEndpointConversationsOperations", "BetaAgentInsightMonitorsOperations", "BetaAgentsOperations", "BetaDatasetsOperations", diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agent_endpoint_conversations.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agent_endpoint_conversations.py index 33a2878aef12..d336c3dedfd3 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agent_endpoint_conversations.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agent_endpoint_conversations.py @@ -8,8 +8,9 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import Any, Iterator +from typing import Any, Iterator, Optional, Union from azure.core.exceptions import HttpResponseError +from azure.core.paging import ItemPaged from azure.core.tracing.decorator import distributed_trace from ._operations import AgentEndpointConversationsOperations as GeneratedAgentEndpointConversationsOperations from .. import models as _models @@ -21,6 +22,20 @@ _PREVIEW_FEATURE_ADDED_ERROR_MESSAGE, ) +# All methods on this class always require the VoiceAgents=V1Preview opt-in (voice-agent +# conversation reads), regardless of `allow_preview` -- this class used to live entirely as a +# nested `.beta.agent_endpoint_conversations` sub-client (whose methods were unconditionally +# wrapped with this same header by `_OperationMethodHeaderProxy` in `operations/_patch.py`, since +# merely accessing `.beta` was itself the opt-in signal). Upstream has since merged it entirely +# into this top-level, stable client attribute, but the *service* still requires the same opt-in +# header for every one of these methods -- confirmed empirically: an unauthenticated (no header) +# call to `list_agent_conversations` returns 403 with error.code="preview_feature_required" even +# though the generated SDK surface no longer marks this class as beta. So every method here still +# needs the same `allow_preview`-gated header injection (and, for non-paged methods, the same +# friendlier error message on 403) as every other "optional preview feature on an otherwise-stable +# operation" elsewhere in this SDK (see e.g. `AgentsOperations.generate_agent`). +_VOICE_AGENTS_HEADER_VALUE = _AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.value + class AgentEndpointConversationsOperations(GeneratedAgentEndpointConversationsOperations): """ @@ -32,6 +47,499 @@ class AgentEndpointConversationsOperations(GeneratedAgentEndpointConversationsOp :attr:`agent_endpoint_conversations` attribute. """ + @distributed_trace + def list_agent_conversations( # type: ignore[override] + self, + agent_name: str, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any, + ) -> ItemPaged["_models.VoiceConversation"]: + """List voice agent conversations. + + Returns the conversations persisted for the specified voice agent endpoint. Conversations are + present when the session's effective ``store`` setting is ``true``, whether inherited from the + agent definition or enabled by the WebSocket session override. When the client is constructed + with ``allow_preview=True``, the required preview opt-in header is added automatically. + + :param agent_name: The name of the 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 VoiceConversation + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.VoiceConversation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _VOICE_AGENTS_HEADER_VALUE} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _VOICE_AGENTS_HEADER_VALUE + kwargs["headers"] = headers + + return super().list_agent_conversations(agent_name, limit=limit, order=order, before=before, **kwargs) + + @distributed_trace + def get_agent_conversation( # type: ignore[override] + self, agent_name: str, conversation_id: str, **kwargs: Any + ) -> _models.VoiceConversation: + """Get a voice agent conversation. + + Retrieves a single conversation recorded for the specified voice agent endpoint by its id. + Returns ``404`` when the conversation was not persisted (``store = false``) or does not exist. + When the client is constructed with ``allow_preview=True``, the required preview opt-in header + is added automatically. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation to retrieve. Required. + :type conversation_id: str + :return: VoiceConversation. The VoiceConversation is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceConversation + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _VOICE_AGENTS_HEADER_VALUE} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _VOICE_AGENTS_HEADER_VALUE + kwargs["headers"] = headers + + try: + return super().get_agent_conversation(agent_name, conversation_id, **kwargs) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + + @distributed_trace + def delete_agent_conversation( # pylint: disable=inconsistent-return-statements # type: ignore[override] + self, agent_name: str, conversation_id: str, **kwargs: Any + ) -> None: + """Delete a voice agent conversation. + + Deletes a conversation and all of its stored data — responses, items, and any audio (cascade). + This is the customer's explicit data-deletion control for voice conversations. When the client + is constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation to delete. Required. + :type conversation_id: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _VOICE_AGENTS_HEADER_VALUE} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _VOICE_AGENTS_HEADER_VALUE + kwargs["headers"] = headers + + try: + return super().delete_agent_conversation(agent_name, conversation_id, **kwargs) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + + @distributed_trace + def list_agent_conversation_responses( # type: ignore[override] + 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.VoiceResponse"]: + """List responses in a voice agent conversation. + + Returns a paged collection of the responses (model inference turns) recorded for the specified + conversation. The per-response ``output`` projection may be omitted here; use the + response-items route for the canonical paged output. Returns ``404`` when the conversation was + not persisted (``store = false``). When the client is constructed with ``allow_preview=True``, + the required preview opt-in header is added automatically. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose responses are listed. 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 VoiceResponse + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.VoiceResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _VOICE_AGENTS_HEADER_VALUE} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _VOICE_AGENTS_HEADER_VALUE + kwargs["headers"] = headers + + return super().list_agent_conversation_responses( + agent_name, conversation_id, limit=limit, order=order, before=before, **kwargs + ) + + @distributed_trace + def get_agent_conversation_response( # type: ignore[override] + self, agent_name: str, conversation_id: str, response_id: str, **kwargs: Any + ) -> _models.VoiceResponse: + """Get a voice agent conversation response. + + Retrieves a single response from the specified conversation by its id, including its ``output`` + items, ``usage``, and status. Returns ``404`` when the conversation or response was not + persisted (``store = false``). When the client is constructed with ``allow_preview=True``, the + required preview opt-in header is added automatically. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the response. Required. + :type conversation_id: str + :param response_id: The id of the response to retrieve. Required. + :type response_id: str + :return: VoiceResponse. The VoiceResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _VOICE_AGENTS_HEADER_VALUE} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _VOICE_AGENTS_HEADER_VALUE + kwargs["headers"] = headers + + try: + return super().get_agent_conversation_response(agent_name, conversation_id, response_id, **kwargs) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + + @distributed_trace + def list_agent_conversation_response_items( # pylint: disable=name-too-long # type: ignore[override] + self, + agent_name: str, + conversation_id: str, + response_id: str, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any, + ) -> ItemPaged["_models.RealtimeConversationItem"]: + """List items produced by a voice agent conversation response. + + Returns a paged collection of the output items produced by a specific response (the response's + output projection). For the complete ordered conversation history — including user input and + client-created tool outputs — use the conversation items route instead. Returns ``404`` when + the conversation or response was not persisted (``store = false``). When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the response. Required. + :type conversation_id: str + :param response_id: The id of the response whose output items are listed. Required. + :type response_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 RealtimeConversationItem + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.RealtimeConversationItem] + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _VOICE_AGENTS_HEADER_VALUE} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _VOICE_AGENTS_HEADER_VALUE + kwargs["headers"] = headers + + return super().list_agent_conversation_response_items( + agent_name, conversation_id, response_id, limit=limit, order=order, before=before, **kwargs + ) + + @distributed_trace + def list_agent_conversation_items( # type: ignore[override] + 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.RealtimeConversationItem"]: + """List items in a voice agent conversation. + + Returns a paged collection of items — the complete ordered conversation history, including user + input, assistant output, and client-created tool outputs (transcripts + tool events). Returns + ``404`` when the conversation was not persisted (``store = false``). When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose items are listed. 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 RealtimeConversationItem + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.RealtimeConversationItem] + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _VOICE_AGENTS_HEADER_VALUE} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _VOICE_AGENTS_HEADER_VALUE + kwargs["headers"] = headers + + return super().list_agent_conversation_items( + agent_name, conversation_id, limit=limit, order=order, before=before, **kwargs + ) + + @distributed_trace + def get_agent_conversation_item( # type: ignore[override] + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.RealtimeConversationItem: + """Get a voice agent conversation item. + + Retrieves a single item from the specified conversation by its id, including its transcript. An + ``input_audio``/``output_audio`` content part indicates that audio is available for the item; + the canonical per-item audio metadata is the ``/items/{item_id}/audio`` resource, and the bytes + are streamed by ``/items/{item_id}/audio/content``. Returns ``404`` when the conversation or + item was not persisted (``store = false``). When the client is constructed with + ``allow_preview=True``, the required preview opt-in header is added automatically. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item to retrieve. Required. + :type item_id: str + :return: RealtimeConversationItem. The RealtimeConversationItem is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.RealtimeConversationItem + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _VOICE_AGENTS_HEADER_VALUE} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _VOICE_AGENTS_HEADER_VALUE + kwargs["headers"] = headers + + try: + return super().get_agent_conversation_item(agent_name, conversation_id, item_id, **kwargs) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + + @distributed_trace + def get_agent_conversation_item_audio( # pylint: disable=name-too-long # type: ignore[override] + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.VoiceItemAudioResponse: + """Get a voice agent conversation item's audio metadata. + + Returns metadata for a single conversation item's audio segment, including the common playback + facts (role, format/codec, sample rate, channels, offset, duration) for both Foundry-managed + and bring-your-own-storage (BYOS) recordings; for BYOS the response additionally includes + ``blob_uri``, the URI of the recording in the customer's own storage (no SAS) that the customer + downloads with their own credentials. Requires the conversation to have persisted audio + (``store = true``); returns ``404`` when the conversation, item, or its audio was not + persisted. When the client is constructed with ``allow_preview=True``, the required preview + opt-in header is added automatically. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose audio metadata is retrieved. Required. + :type item_id: str + :return: VoiceItemAudioResponse. The VoiceItemAudioResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceItemAudioResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _VOICE_AGENTS_HEADER_VALUE} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _VOICE_AGENTS_HEADER_VALUE + kwargs["headers"] = headers + + try: + return super().get_agent_conversation_item_audio(agent_name, conversation_id, item_id, **kwargs) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + + @distributed_trace + def get_agent_conversation_item_audio_content( # pylint: disable=name-too-long # type: ignore[override] + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> Iterator[bytes]: + """Stream a voice agent conversation item's audio. + + Streams a single conversation item's audio as a WAV (``audio/wav``) byte stream through the + service (no SAS URL). This route serves Foundry-managed storage only. For + bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download + directly from customer storage using the ``blob_uri`` returned by the item's ``/audio`` + metadata route — so this route returns ``409 Conflict`` for BYOS recordings. Returns ``404`` + when the conversation, item, or its audio was not persisted (``store = false``). When the + client is constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose audio is streamed. Required. + :type item_id: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _VOICE_AGENTS_HEADER_VALUE} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _VOICE_AGENTS_HEADER_VALUE + kwargs["headers"] = headers + + try: + return super().get_agent_conversation_item_audio_content(agent_name, conversation_id, item_id, **kwargs) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + @distributed_trace def get_agent_conversation_item_generated_audio( # pylint: disable=name-too-long # type: ignore[override] self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any @@ -138,3 +646,110 @@ def get_agent_conversation_item_generated_audio_content( # pylint: disable=name new_exc.model = exc.model raise new_exc from exc raise + + @distributed_trace + def get_agent_conversation_audio( # type: ignore[override] + self, agent_name: str, conversation_id: str, **kwargs: Any + ) -> _models.VoiceRecordingResponse: + """Get a voice agent conversation's merged recording metadata. + + Returns metadata for the whole-call merged stereo recording (user audio on the left channel, + agent audio on the right). The common metadata (format, sample rate, channels, channel layout, + duration) is returned for both Foundry-managed and bring-your-own-storage (BYOS) recordings; + for BYOS the response additionally includes ``blob_uri``, the URI of the recording in the + customer's own storage (no SAS) that the customer downloads with their own credentials. The + recording is built once from the per-turn segments after persistence finalization succeeds. + While the conversation is ``in_progress``, this route returns retriable ``409 Conflict`` with + ``error.code = recording_not_ready`` and a ``Retry-After`` header when retry guidance is + available. When the conversation is ``failed``, it returns terminal ``409 Conflict`` with + ``error.code = recording_unavailable``. For a ``completed`` conversation, metadata is available + subject to the existing BYOS behavior. Requires the conversation to have persisted audio + (``store = true``); otherwise returns ``404``. When the client is constructed with + ``allow_preview=True``, the required preview opt-in header is added automatically. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose merged recording metadata is + retrieved. Required. + :type conversation_id: str + :return: VoiceRecordingResponse. The VoiceRecordingResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceRecordingResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _VOICE_AGENTS_HEADER_VALUE} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _VOICE_AGENTS_HEADER_VALUE + kwargs["headers"] = headers + + try: + return super().get_agent_conversation_audio(agent_name, conversation_id, **kwargs) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise + + @distributed_trace + def get_agent_conversation_audio_content( # type: ignore[override] + self, agent_name: str, conversation_id: str, **kwargs: Any + ) -> Iterator[bytes]: + """Stream a voice agent conversation's merged recording. + + Streams the whole-call merged stereo recording as a WAV (``audio/wav``) byte stream through the + service (no SAS URL). This route serves Foundry-managed storage only. For + bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download + directly from customer storage using the ``blob_uri`` returned by the metadata route — so this + route returns ``409 Conflict`` for BYOS recordings. While the conversation is ``in_progress``, + this route returns retriable ``409 Conflict`` with ``error.code = recording_not_ready`` and a + ``Retry-After`` header when retry guidance is available. When the conversation is ``failed``, + it returns terminal ``409 Conflict`` with ``error.code = recording_unavailable``. For a + ``completed`` conversation, content is available subject to the existing BYOS behavior. A + conversation without persisted audio (``store = false``) returns ``404``. When the client is + constructed with ``allow_preview=True``, the required preview opt-in header is added + automatically. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose merged recording is streamed. + Required. + :type conversation_id: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + if getattr(self._config, "allow_preview", False): + headers = kwargs.get("headers") + if headers is None: + kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _VOICE_AGENTS_HEADER_VALUE} + elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = _VOICE_AGENTS_HEADER_VALUE + kwargs["headers"] = headers + + try: + return super().get_agent_conversation_audio_content(agent_name, conversation_id, **kwargs) + except HttpResponseError as exc: + if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + api_error_response = exc.model + if hasattr(api_error_response, "error") and api_error_response.error is not None: + if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: + new_exc = HttpResponseError( + message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", + ) + new_exc.status_code = exc.status_code + new_exc.reason = exc.reason + new_exc.response = exc.response + new_exc.model = exc.model + raise new_exc from exc + raise diff --git a/sdk/ai/azure-ai-projects/docs/public-methods.md b/sdk/ai/azure-ai-projects/docs/public-methods.md index 25ced475cbb2..a274daef9603 100644 --- a/sdk/ai/azure-ai-projects/docs/public-methods.md +++ b/sdk/ai/azure-ai-projects/docs/public-methods.md @@ -6,14 +6,14 @@ This document lists all public methods available on `AIProjectClient` and its su There are a total of 183 unique public methods: - 5 stable methods on the client -- 72 stable methods on top-level sub-clients -- 106 beta methods on nested beta sub-clients +- 84 stable methods on top-level sub-clients +- 94 beta methods on nested beta sub-clients ### Top-level sub-clients (stable operations) | Subclient | Class Name | Methods Count | |-----------|------------|----------------| -| `agent_endpoint_conversations` | AgentEndpointConversationsOperations | 2 | +| `agent_endpoint_conversations` | AgentEndpointConversationsOperations | 14 | | `agents` | AgentsOperations | 38 | | `connections` | ConnectionsOperations | 3 | | `datasets` | DatasetsOperations | 9 | @@ -27,7 +27,6 @@ There are a total of 183 unique public methods: | Subclient | Class Name | Methods Count | |-----------|------------|----------------| -| `beta.agent_endpoint_conversations` | BetaAgentEndpointConversationsOperations | 12 | | `beta.agent_insight_monitors` | BetaAgentInsightMonitorsOperations | 13 | | `beta.agents` | BetaAgentsOperations | 5 | | `beta.datasets` | BetaDatasetsOperations | 5 | @@ -59,8 +58,20 @@ Alphabetically sorted. An asterisk at the end of the method name means is a hand Alphabetically sorted. An asterisk at the end of the method name means is a hand-written method. ``` +.agent_endpoint_conversations.delete_agent_conversation +.agent_endpoint_conversations.get_agent_conversation +.agent_endpoint_conversations.get_agent_conversation_audio +.agent_endpoint_conversations.get_agent_conversation_audio_content +.agent_endpoint_conversations.get_agent_conversation_item +.agent_endpoint_conversations.get_agent_conversation_item_audio +.agent_endpoint_conversations.get_agent_conversation_item_audio_content .agent_endpoint_conversations.get_agent_conversation_item_generated_audio* .agent_endpoint_conversations.get_agent_conversation_item_generated_audio_content* +.agent_endpoint_conversations.get_agent_conversation_response +.agent_endpoint_conversations.list_agent_conversation_items +.agent_endpoint_conversations.list_agent_conversation_response_items +.agent_endpoint_conversations.list_agent_conversation_responses +.agent_endpoint_conversations.list_agent_conversations .agents.create_session .agents.create_telephony_binding* @@ -146,19 +157,6 @@ Alphabetically sorted. An asterisk at the end of the method name means is a hand Alphabetically sorted. An asterisk at the end of the method name means is a hand-written method. ``` -.beta.agent_endpoint_conversations.delete_agent_conversation -.beta.agent_endpoint_conversations.get_agent_conversation -.beta.agent_endpoint_conversations.get_agent_conversation_audio -.beta.agent_endpoint_conversations.get_agent_conversation_audio_content -.beta.agent_endpoint_conversations.get_agent_conversation_item -.beta.agent_endpoint_conversations.get_agent_conversation_item_audio -.beta.agent_endpoint_conversations.get_agent_conversation_item_audio_content -.beta.agent_endpoint_conversations.get_agent_conversation_response -.beta.agent_endpoint_conversations.list_agent_conversation_items -.beta.agent_endpoint_conversations.list_agent_conversation_response_items -.beta.agent_endpoint_conversations.list_agent_conversation_responses -.beta.agent_endpoint_conversations.list_agent_conversations - .beta.agent_insight_monitors.begin_create_run* .beta.agent_insight_monitors.cancel_run .beta.agent_insight_monitors.create diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py index 8e5c88a991f2..f103671947ae 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_audio_conversation_async.py @@ -334,7 +334,7 @@ async def _read_conversation(client: AIProjectClient, agent_name: str, conversat :type agent_name: str :type conversation_id: str """ - conversations = client.beta.agent_endpoint_conversations + conversations = client.agent_endpoint_conversations conversation = await conversations.get_agent_conversation(agent_name, conversation_id) print(f"Conversation {conversation.id}: status={conversation.status}, created_at={conversation.created_at}") @@ -389,7 +389,7 @@ async def audio_conversation() -> None: except HttpResponseError as e: print(f"Could not read conversation: {e.status_code} {e.reason}") # To fetch this session's audio afterward, use - # `project_client.beta.agent_endpoint_conversations`: + # `project_client.agent_endpoint_conversations`: # - get_agent_conversation_audio(agent_name, conversation_id) for the merged # whole-call stereo recording's metadata, then # get_agent_conversation_audio_content(agent_name, conversation_id) to stream diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py index 7433a68c5110..b9c481e01ae6 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation.py @@ -229,7 +229,7 @@ def _read_conversation(client: AIProjectClient, agent_name: str, conversation_id :type agent_name: str :type conversation_id: str """ - conversations = client.beta.agent_endpoint_conversations + conversations = client.agent_endpoint_conversations conversation = conversations.get_agent_conversation(agent_name, conversation_id) print(f"Conversation {conversation.id}: status={conversation.status}, created_at={conversation.created_at}") @@ -284,7 +284,7 @@ def text_conversation() -> None: except HttpResponseError as e: print(f"Could not read conversation: {e.status_code} {e.reason}") # To fetch this session's audio afterward, use - # `project_client.beta.agent_endpoint_conversations`: + # `project_client.agent_endpoint_conversations`: # - get_agent_conversation_audio(agent_name, conversation_id) for the merged # whole-call stereo recording's metadata, then # get_agent_conversation_audio_content(agent_name, conversation_id) to stream diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py index aaa1b15b3f18..6a2244451b55 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_live_text_conversation_async.py @@ -228,7 +228,7 @@ async def _read_conversation(client: AIProjectClient, agent_name: str, conversat :type agent_name: str :type conversation_id: str """ - conversations = client.beta.agent_endpoint_conversations + conversations = client.agent_endpoint_conversations conversation = await conversations.get_agent_conversation(agent_name, conversation_id) print(f"Conversation {conversation.id}: status={conversation.status}, created_at={conversation.created_at}") @@ -283,7 +283,7 @@ async def text_conversation() -> None: except HttpResponseError as e: print(f"Could not read conversation: {e.status_code} {e.reason}") # To fetch this session's audio afterward, use - # `project_client.beta.agent_endpoint_conversations`: + # `project_client.agent_endpoint_conversations`: # - get_agent_conversation_audio(agent_name, conversation_id) for the merged # whole-call stereo recording's metadata, then # get_agent_conversation_audio_content(agent_name, conversation_id) to stream diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_read_conversation.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_read_conversation.py index d7930b1dfe89..0e77a4836b42 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_read_conversation.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_read_conversation.py @@ -7,7 +7,7 @@ """ DESCRIPTION: This sample demonstrates reading a persisted voice conversation back over - the read-only conversation API exposed by `project_client.beta.agent_endpoint_conversations`: + the read-only conversation API exposed by `project_client.agent_endpoint_conversations`: the conversation envelope, its responses (model inference turns), and its ordered items (the transcript). Conversations are created and written by the voice orchestrator during a live session; this client can only read @@ -43,9 +43,9 @@ with ( DefaultAzureCredential() as credential, - AIProjectClient(endpoint=endpoint, credential=credential) as project_client, + AIProjectClient(endpoint=endpoint, credential=credential, allow_preview=True) as project_client, ): - conversations = project_client.beta.agent_endpoint_conversations + conversations = project_client.agent_endpoint_conversations try: # The conversation envelope: status, timestamps, aggregate usage. conversation = conversations.get_agent_conversation(agent_name, conversation_id) diff --git a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_read_conversation_audio.py b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_read_conversation_audio.py index ab4e8010658a..c44f00090926 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_read_conversation_audio.py +++ b/sdk/ai/azure-ai-projects/samples/agents/voice/sample_voice_agent_read_conversation_audio.py @@ -7,7 +7,7 @@ """ DESCRIPTION: This sample demonstrates reading the persisted audio of a voice - conversation via `project_client.beta.agent_endpoint_conversations`, both the + conversation via `project_client.agent_endpoint_conversations`, both the merged whole-call recording and a single turn's audio segment. For each it reads the metadata first, then streams the WAV bytes to a local file. The merged recording is stereo: the caller on the left channel and the agent @@ -60,7 +60,7 @@ def read_merged_recording(conversations, agent_name, conversation_id) -> None: :param conversations: The conversation operations client. :param agent_name: The voice agent name. :param conversation_id: The persisted conversation id. - :type conversations: azure.ai.projects.operations.BetaAgentEndpointConversationsOperations + :type conversations: azure.ai.projects.operations.AgentEndpointConversationsOperations :type agent_name: str :type conversation_id: str """ @@ -86,7 +86,7 @@ def read_first_item_audio(conversations, agent_name, conversation_id) -> None: :param conversations: The conversation operations client. :param agent_name: The voice agent name. :param conversation_id: The persisted conversation id. - :type conversations: azure.ai.projects.operations.BetaAgentEndpointConversationsOperations + :type conversations: azure.ai.projects.operations.AgentEndpointConversationsOperations :type agent_name: str :type conversation_id: str """ @@ -121,9 +121,9 @@ def main() -> None: with ( DefaultAzureCredential() as credential, - AIProjectClient(endpoint=endpoint, credential=credential) as project_client, + AIProjectClient(endpoint=endpoint, credential=credential, allow_preview=True) as project_client, ): - conversations = project_client.beta.agent_endpoint_conversations + conversations = project_client.agent_endpoint_conversations try: read_merged_recording(conversations, agent_name, conversation_id) read_first_item_audio(conversations, agent_name, conversation_id) diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_conversations.py b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_conversations.py index 4e887ab51bbf..b45243faa549 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_conversations.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_conversations.py @@ -7,7 +7,7 @@ """ Recorded tests covering the read-only voice-agent conversation REST API surface exposed through -``project_client.beta.agent_endpoint_conversations``. +``project_client.agent_endpoint_conversations``. Conversations, their responses/items, and audio are written by the realtime WebSocket subsystem during a live session (see ``test_voice_agent_realtime_live.py``) and can only be *read* here -- @@ -120,14 +120,14 @@ def _create_live_conversation(project_client, model: str) -> str: class TestVoiceAgentConversations(TestBase): """ Recorded tests covering the read-only voice-agent conversation REST API surface exposed - through ``project_client.beta.agent_endpoint_conversations`` (conversation envelope, + through ``project_client.agent_endpoint_conversations`` (conversation envelope, responses, items, and audio). - NOTE: The top-level (non-beta) ``agent_endpoint_conversations.get_agent_conversation_item_ - generated_audio*`` methods are intentionally NOT covered here: they return the played-back- - interrupted subordinate "generated" audio, which requires deliberately barging in mid-reply - during a live session to produce -- not exercised by the simple single-turn conversation - created here. See this package's engineering notes. + NOTE: The ``agent_endpoint_conversations.get_agent_conversation_item_generated_audio*`` + methods are intentionally NOT covered here: they return the played-back-interrupted + subordinate "generated" audio, which requires deliberately barging in mid-reply during a + live session to produce -- not exercised by the simple single-turn conversation created + here. See this package's engineering notes. """ # To run only this test: @@ -144,22 +144,22 @@ def test_read_conversation(self, **kwargs): # pylint: disable=too-many-locals Action REST API Route Client Method ------+-------------------------------------------------------------------------------+----------------------------------------------------------- - GET /agents/{agent_name}/endpoint/protocols/voice/conversations beta.agent_endpoint_conversations.list_agent_conversations() - GET /agents/{agent_name}/endpoint/protocols/voice/conversations/{id} beta.agent_endpoint_conversations.get_agent_conversation() - GET .../conversations/{id}/responses beta.agent_endpoint_conversations.list_agent_conversation_responses() - GET .../conversations/{id}/responses/{response_id} beta.agent_endpoint_conversations.get_agent_conversation_response() - GET .../conversations/{id}/responses/{response_id}/items beta.agent_endpoint_conversations.list_agent_conversation_response_items() - GET .../conversations/{id}/items beta.agent_endpoint_conversations.list_agent_conversation_items() - GET .../conversations/{id}/items/{item_id} beta.agent_endpoint_conversations.get_agent_conversation_item() - GET .../conversations/{id}/audio beta.agent_endpoint_conversations.get_agent_conversation_audio() - GET .../conversations/{id}/audio/content beta.agent_endpoint_conversations.get_agent_conversation_audio_content() - GET .../conversations/{id}/items/{item_id}/audio beta.agent_endpoint_conversations.get_agent_conversation_item_audio() - GET .../conversations/{id}/items/{item_id}/audio/content beta.agent_endpoint_conversations.get_agent_conversation_item_audio_content() - DELETE .../conversations/{id} beta.agent_endpoint_conversations.delete_agent_conversation() + GET /agents/{agent_name}/endpoint/protocols/voice/conversations agent_endpoint_conversations.list_agent_conversations() + GET /agents/{agent_name}/endpoint/protocols/voice/conversations/{id} agent_endpoint_conversations.get_agent_conversation() + GET .../conversations/{id}/responses agent_endpoint_conversations.list_agent_conversation_responses() + GET .../conversations/{id}/responses/{response_id} agent_endpoint_conversations.get_agent_conversation_response() + GET .../conversations/{id}/responses/{response_id}/items agent_endpoint_conversations.list_agent_conversation_response_items() + GET .../conversations/{id}/items agent_endpoint_conversations.list_agent_conversation_items() + GET .../conversations/{id}/items/{item_id} agent_endpoint_conversations.get_agent_conversation_item() + GET .../conversations/{id}/audio agent_endpoint_conversations.get_agent_conversation_audio() + GET .../conversations/{id}/audio/content agent_endpoint_conversations.get_agent_conversation_audio_content() + GET .../conversations/{id}/items/{item_id}/audio agent_endpoint_conversations.get_agent_conversation_item_audio() + GET .../conversations/{id}/items/{item_id}/audio/content agent_endpoint_conversations.get_agent_conversation_item_audio_content() + DELETE .../conversations/{id} agent_endpoint_conversations.delete_agent_conversation() """ print("\n") project_client = self.create_client(operation_group="agents", allow_preview=True, **kwargs) - conversations = project_client.beta.agent_endpoint_conversations + conversations = project_client.agent_endpoint_conversations if is_live(): model = kwargs.get("foundry_voice_model_name") diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_conversations_async.py b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_conversations_async.py index 7a0c0294f113..d3a59fad6067 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_conversations_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_conversations_async.py @@ -7,7 +7,7 @@ """ Recorded tests covering the read-only voice-agent conversation REST API surface exposed through -``project_client.beta.agent_endpoint_conversations`` (async client). +``project_client.agent_endpoint_conversations`` (async client). Async counterpart of ``test_voice_agent_conversations.py``. See that module's docstring for the overall rationale (live-only setup to obtain a real conversation id, sanitized to a fixed @@ -111,14 +111,14 @@ async def _create_live_conversation(project_client, model: str) -> str: class TestVoiceAgentConversationsAsync(TestBase): """ Recorded tests covering the read-only voice-agent conversation REST API surface exposed - through ``project_client.beta.agent_endpoint_conversations`` (conversation envelope, + through ``project_client.agent_endpoint_conversations`` (conversation envelope, responses, items, and audio), using the async client. - NOTE: The top-level (non-beta) ``agent_endpoint_conversations.get_agent_conversation_item_ - generated_audio*`` methods are intentionally NOT covered here: they return the played-back- - interrupted subordinate "generated" audio, which requires deliberately barging in mid-reply - during a live session to produce -- not exercised by the simple single-turn conversation - created here. See this package's engineering notes. + NOTE: The ``agent_endpoint_conversations.get_agent_conversation_item_generated_audio*`` + methods are intentionally NOT covered here: they return the played-back-interrupted + subordinate "generated" audio, which requires deliberately barging in mid-reply during a + live session to produce -- not exercised by the simple single-turn conversation created + here. See this package's engineering notes. """ # To run only this test: @@ -136,7 +136,7 @@ async def test_read_conversation_async(self, **kwargs): # pylint: disable=too-m """ print("\n") project_client = self.create_async_client(operation_group="agents", allow_preview=True, **kwargs) - conversations = project_client.beta.agent_endpoint_conversations + conversations = project_client.agent_endpoint_conversations async with project_client: if is_live(): diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud.py b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud.py index 594b4aade8d0..d0a96e148356 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud.py @@ -26,7 +26,7 @@ class TestVoiceAgentCrud(TestBase): NOTE: Some voice-agent REST APIs are intentionally NOT covered here because they are currently blocked by known service-side bugs (see this package's engineering notes): - - Reading back a conversation (`project_client.beta.agent_endpoint_conversations.*`) using a + - Reading back a conversation (`project_client.agent_endpoint_conversations.*`) using a `conversation_id` produced by a live realtime WebSocket session - the service's REST conversation-ID validator rejects the ID format generated by the realtime WS subsystem. This is also not practical to cover with HTTP-only recorded tests since it requires an diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud_async.py b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud_async.py index 0006dfd81b89..b5ef9547b3b9 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_crud_async.py @@ -27,7 +27,7 @@ class TestVoiceAgentCrudAsync(TestBase): NOTE: Some voice-agent REST APIs are intentionally NOT covered here because they are currently blocked by known service-side bugs (see this package's engineering notes): - - Reading back a conversation (`project_client.beta.agent_endpoint_conversations.*`) using a + - Reading back a conversation (`project_client.agent_endpoint_conversations.*`) using a `conversation_id` produced by a live realtime WebSocket session - the service's REST conversation-ID validator rejects the ID format generated by the realtime WS subsystem. This is also not practical to cover with HTTP-only recorded tests since it requires an diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_realtime_live.py b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_realtime_live.py index ee4ecfa66052..f5b4d498b1e5 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_realtime_live.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_realtime_live.py @@ -17,7 +17,7 @@ exact audio bytes (the model's actual audio/text output is not deterministic). These tests do not use ``store=True`` / read back a persisted conversation -- that surface -(``project_client.beta.agent_endpoint_conversations.*``) is covered by the separate recorded +(``project_client.agent_endpoint_conversations.*``) is covered by the separate recorded tests in ``test_voice_agent_conversations.py``, which need a real conversation id but replay against a recorded cassette rather than opening a live WebSocket connection on every run. """ diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_telephony.py b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_telephony.py index 1d6dec2af66c..c9a904afb393 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_telephony.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_telephony.py @@ -41,7 +41,7 @@ class TestVoiceAgentTelephony(TestBase): - `agent_endpoint_conversations.get_agent_conversation_item_generated_audio*` with a made-up conversation/item ID hits the service's conversation-ID format validator and returns an unhandled `500 server_error` instead of a clean `404` - the exact same - pre-existing behavior as the already-documented `beta.agent_endpoint_conversations` + pre-existing behavior as the already-documented `agent_endpoint_conversations` limitation below. Testing the success path needs a live realtime session whose playback was interrupted; testing the not-found path needs a validly-formatted but nonexistent ID (the format isn't publicly documented). `test_generated_audio_not_found` is left in as a @@ -55,7 +55,7 @@ class TestVoiceAgentTelephony(TestBase): `tests/foundry_features_header/`. - `list_telephony_calls`/`get_telephony_call`/`transfer_telephony_call`/`end_telephony_call` against an actual in-progress or historical call (needs a real inbound telephony call). - - Reading back a conversation (`project_client.beta.agent_endpoint_conversations.*`) using a + - Reading back a conversation (`project_client.agent_endpoint_conversations.*`) using a `conversation_id` produced by a live realtime WebSocket session - the service's REST conversation-ID validator rejects the ID format generated by the realtime WS subsystem. This is also not practical to cover with HTTP-only recorded tests since it requires an @@ -251,17 +251,16 @@ def test_telephony_calls_not_found(self, **kwargs): @pytest.mark.skip( reason="A made-up conversation/item ID hits the service's conversation-ID format validator " "and returns an unhandled 500 instead of a clean 404 (same pre-existing behavior as " - "beta.agent_endpoint_conversations). Needs a validly-formatted but nonexistent ID, or a real " + "agent_endpoint_conversations). Needs a validly-formatted but nonexistent ID, or a real " "realtime session, to test properly." ) @servicePreparer() @recorded_by_proxy() def test_generated_audio_not_found(self, **kwargs): """ - Test the top-level `agent_endpoint_conversations.get_agent_conversation_item_generated_audio`/ + Test the `agent_endpoint_conversations.get_agent_conversation_item_generated_audio`/ `get_agent_conversation_item_generated_audio_content` methods against a nonexistent - conversation item, which return 404. This is a new, top-level operation group, distinct - from `beta.agent_endpoint_conversations`. + conversation item, which return 404. Routes used in this test: diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_telephony_async.py b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_telephony_async.py index 4d2c1e719c13..a815bf7a12ef 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_telephony_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_telephony_async.py @@ -41,7 +41,7 @@ class TestVoiceAgentTelephonyAsync(TestBase): - `agent_endpoint_conversations.get_agent_conversation_item_generated_audio*` with a made-up conversation/item ID hits the service's conversation-ID format validator and returns an unhandled `500 server_error` instead of a clean `404` - the exact same - pre-existing behavior as the already-documented `beta.agent_endpoint_conversations` + pre-existing behavior as the already-documented `agent_endpoint_conversations` limitation below. Testing the success path needs a live realtime session whose playback was interrupted; testing the not-found path needs a validly-formatted but nonexistent ID (the format isn't publicly documented). `test_generated_audio_not_found` is left in as a @@ -55,7 +55,7 @@ class TestVoiceAgentTelephonyAsync(TestBase): `tests/foundry_features_header/`. - `list_telephony_calls`/`get_telephony_call`/`transfer_telephony_call`/`end_telephony_call` against an actual in-progress or historical call (needs a real inbound telephony call). - - Reading back a conversation (`project_client.beta.agent_endpoint_conversations.*`) using a + - Reading back a conversation (`project_client.agent_endpoint_conversations.*`) using a `conversation_id` produced by a live realtime WebSocket session - the service's REST conversation-ID validator rejects the ID format generated by the realtime WS subsystem. This is also not practical to cover with HTTP-only recorded tests since it requires an @@ -253,17 +253,16 @@ async def test_telephony_calls_not_found(self, **kwargs): @pytest.mark.skip( reason="A made-up conversation/item ID hits the service's conversation-ID format validator " "and returns an unhandled 500 instead of a clean 404 (same pre-existing behavior as " - "beta.agent_endpoint_conversations). Needs a validly-formatted but nonexistent ID, or a real " + "agent_endpoint_conversations). Needs a validly-formatted but nonexistent ID, or a real " "realtime session, to test properly." ) @servicePreparer() @recorded_by_proxy_async() async def test_generated_audio_not_found(self, **kwargs): """ - Test the top-level `agent_endpoint_conversations.get_agent_conversation_item_generated_audio`/ + Test the `agent_endpoint_conversations.get_agent_conversation_item_generated_audio`/ `get_agent_conversation_item_generated_audio_content` methods against a nonexistent - conversation item, which return 404. This is a new, top-level operation group, distinct - from `beta.agent_endpoint_conversations`. + conversation item, which return 404. Routes used in this test: diff --git a/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py b/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py index e0a393decea1..1e38e6ec2abb 100644 --- a/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py +++ b/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py @@ -47,10 +47,11 @@ "skills": "Skills=V1Preview", "datasets": "DataGenerationJobs=V1Preview", "agents": "WorkflowAgents=V1Preview,ExternalAgents=V1Preview,VoiceAgents=V1Preview,DraftAgents=V1Preview,AgentsOptimization=V2Preview,ModelRouterControls=V1Preview", - # agent_endpoint_conversations moved from a top-level client attribute to a nested `.beta` - # sub-client upstream; it always requires the VoiceAgents=V1Preview opt-in (voice-agent - # conversation reads), regardless of `allow_preview` -- same as every other entry here. - "agent_endpoint_conversations": "VoiceAgents=V1Preview", + # NOTE: `agent_endpoint_conversations` used to need an entry here (it lived as a nested + # `.beta` sub-client). Upstream has since merged it entirely into the top-level, stable + # `agent_endpoint_conversations` client attribute (see the dedicated + # `_NON_BETA_OPTIONAL_TEST_CASES` entries below), so it must NOT have an entry in this dict -- + # it's no longer part of `.beta` at all. } # Methods on .beta sub-clients that are NOT simple one-HTTP-call wrappers and @@ -142,10 +143,52 @@ "evaluation_rules.create_or_update", "Evaluations=V1Preview", ), - # `agent_endpoint_conversations` is a top-level client attribute (distinct from the nested - # `.beta.agent_endpoint_conversations` sub-client) exposing only the "generated audio" reads; - # like `agents.generate_agent`, it optionally sends the Foundry-Features header gated behind - # `allow_preview`, so it belongs here rather than in EXPECTED_FOUNDRY_FEATURES below. + # `agent_endpoint_conversations` is a top-level client attribute. Like `agents.generate_agent`, + # every one of its methods optionally sends the Foundry-Features header gated behind + # `allow_preview`, so they belong here rather than in EXPECTED_FOUNDRY_FEATURES above. Upstream + # merged what used to be the separate, always-on `.beta.agent_endpoint_conversations` sub-client + # (12 methods) entirely into this top-level attribute (see the NOTE below), so all 14 methods are + # now covered here uniformly. + pytest.param( + "agent_endpoint_conversations.list_agent_conversations", + "VoiceAgents=V1Preview", + ), + pytest.param( + "agent_endpoint_conversations.get_agent_conversation", + "VoiceAgents=V1Preview", + ), + pytest.param( + "agent_endpoint_conversations.delete_agent_conversation", + "VoiceAgents=V1Preview", + ), + pytest.param( + "agent_endpoint_conversations.list_agent_conversation_responses", + "VoiceAgents=V1Preview", + ), + pytest.param( + "agent_endpoint_conversations.get_agent_conversation_response", + "VoiceAgents=V1Preview", + ), + pytest.param( + "agent_endpoint_conversations.list_agent_conversation_response_items", + "VoiceAgents=V1Preview", + ), + pytest.param( + "agent_endpoint_conversations.list_agent_conversation_items", + "VoiceAgents=V1Preview", + ), + pytest.param( + "agent_endpoint_conversations.get_agent_conversation_item", + "VoiceAgents=V1Preview", + ), + pytest.param( + "agent_endpoint_conversations.get_agent_conversation_item_audio", + "VoiceAgents=V1Preview", + ), + pytest.param( + "agent_endpoint_conversations.get_agent_conversation_item_audio_content", + "VoiceAgents=V1Preview", + ), pytest.param( "agent_endpoint_conversations.get_agent_conversation_item_generated_audio", "VoiceAgents=V1Preview", @@ -154,16 +197,27 @@ "agent_endpoint_conversations.get_agent_conversation_item_generated_audio_content", "VoiceAgents=V1Preview", ), + pytest.param( + "agent_endpoint_conversations.get_agent_conversation_audio", + "VoiceAgents=V1Preview", + ), + pytest.param( + "agent_endpoint_conversations.get_agent_conversation_audio_content", + "VoiceAgents=V1Preview", + ), ] # NOTE: `agent_endpoint_conversations` used to need its own dedicated test cases here (it was # wrapped with `_OperationMethodHeaderProxy` directly in `_patch.py`, unconditionally regardless # of `allow_preview`, since it lived as a top-level client attribute rather than a `.beta` -# sub-client). It then moved under `.beta` upstream and was covered automatically by the dynamic -# discovery in test_foundry_features_header_on_beta_operations.py. Upstream has since reintroduced -# a top-level `agent_endpoint_conversations` attribute (exposing only "generated audio" reads, -# distinct from the nested `.beta.agent_endpoint_conversations` sub-client, which still exists -# unchanged) that once again needs dedicated `allow_preview`-gated test cases -- see above. +# sub-client). It then moved under `.beta` upstream (all methods together) and was covered +# automatically by the dynamic discovery in test_foundry_features_header_on_beta_operations.py. +# Upstream has since merged the entire `.beta.agent_endpoint_conversations` sub-client back into a +# single top-level `agent_endpoint_conversations` attribute (all 14 methods, no `.beta` variant +# left at all) that once again needs dedicated `allow_preview`-gated test cases -- see above. This +# operation group has now round-tripped between "top-level" and "nested under .beta" more than +# once across TypeSpec regenerations; if it moves again, update both this list and +# EXPECTED_FOUNDRY_FEATURES above together. # Both sentinel values – used by _make_fake_call to detect required parameters # whose defaults are the internal _Unset object (rather than inspect.Parameter.empty). diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml.saved b/sdk/ai/azure-ai-projects/tsp-location.yaml.saved index 615a7cd64457..1fd9745871f3 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml.saved +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml.saved @@ -1,5 +1,5 @@ directory: specification/ai-foundry/data-plane/Foundry/src/sdk-python-js-azure-ai-projects -commit: 675e111febec298cdc8e640d9f8653cc287c5dd1 +commit: 16e19af7a5193435c71b3afbd3391bdf5db9010c repo: Azure/azure-rest-api-specs additionalDirectories: - specification/ai-foundry/data-plane/Foundry/src/agents From 4ad1e6d5ed5918d63b6f3603b72110e692bab745 Mon Sep 17 00:00:00 2001 From: Yulin Li Date: Sat, 5 Sep 2026 20:25:38 +0800 Subject: [PATCH 56/56] Regenerate azure-ai-projects voice agent SDK Regenerate from azure-rest-api-specs commit b538ac90619e094630e3c773d5231070809caf48 and wire preview headers for sync and async agent telephony operations. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- sdk/ai/azure-ai-projects/api.md | 991 +++++- sdk/ai/azure-ai-projects/api.metadata.yml | 4 +- .../azure-ai-projects/apiview-properties.json | 59 +- .../azure/ai/projects/_client.py | 4 + .../azure/ai/projects/_patch.py | 12 + .../azure/ai/projects/aio/_client.py | 4 + .../azure/ai/projects/aio/_patch.py | 13 +- .../ai/projects/aio/operations/__init__.py | 2 + .../ai/projects/aio/operations/_operations.py | 1633 +++++++++- .../azure/ai/projects/models/__init__.py | 62 + .../azure/ai/projects/models/_enums.py | 138 + .../azure/ai/projects/models/_models.py | 1229 +++++++ .../azure/ai/projects/operations/__init__.py | 2 + .../ai/projects/operations/_operations.py | 2896 ++++++++++++++--- .../azure-ai-projects/docs/public-methods.md | 19 +- .../foundry_features_header_test_base.py | 52 + ...oundry_features_header_on_ga_operations.py | 4 +- ..._features_header_on_ga_operations_async.py | 4 +- sdk/ai/azure-ai-projects/tsp-location.yaml | 2 +- 19 files changed, 6648 insertions(+), 482 deletions(-) diff --git a/sdk/ai/azure-ai-projects/api.md b/sdk/ai/azure-ai-projects/api.md index 52ab326d1106..da2ff279db6a 100644 --- a/sdk/ai/azure-ai-projects/api.md +++ b/sdk/ai/azure-ai-projects/api.md @@ -368,6 +368,223 @@ namespace azure.ai.projects.aio.operations ) -> AsyncItemPaged[VoiceConversation]: ... + class azure.ai.projects.aio.operations.AgentTelephonyOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_import_telephony_campaign_recipients( + self, + agent_name: str, + campaign_id: str, + body: ImportTelephonyCampaignRecipientsRequest, + *, + content_type: str = "application/json", + idempotency_key: str, + **kwargs: Any + ) -> AsyncLROPoller[TelephonyOperationResource]: ... + + @overload + async def begin_import_telephony_campaign_recipients( + self, + agent_name: str, + campaign_id: str, + body: JSON, + *, + content_type: str = "application/json", + idempotency_key: str, + **kwargs: Any + ) -> AsyncLROPoller[TelephonyOperationResource]: ... + + @overload + async def begin_import_telephony_campaign_recipients( + self, + agent_name: str, + campaign_id: str, + body: IO[bytes], + *, + content_type: str = "application/json", + idempotency_key: str, + **kwargs: Any + ) -> AsyncLROPoller[TelephonyOperationResource]: ... + + @overload + async def begin_publish_telephony_campaign( + self, + agent_name: str, + campaign_id: str, + body: PublishTelephonyCampaignRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[TelephonyOperationResource]: ... + + @overload + async def begin_publish_telephony_campaign( + self, + agent_name: str, + campaign_id: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[TelephonyOperationResource]: ... + + @overload + async def begin_publish_telephony_campaign( + self, + agent_name: str, + campaign_id: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[TelephonyOperationResource]: ... + + @distributed_trace_async + async def begin_validate_telephony_campaign( + self, + agent_name: str, + campaign_id: str, + **kwargs: Any + ) -> AsyncLROPoller[TelephonyOperationResource]: ... + + @distributed_trace_async + async def cancel_telephony_call_job( + self, + agent_name: str, + call_job_id: str, + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> TelephonyCallJob: ... + + @distributed_trace_async + async def cancel_telephony_campaign( + self, + agent_name: str, + campaign_id: str, + **kwargs: Any + ) -> TelephonyCampaign: ... + + @overload + async def create_telephony_call_job( + self, + agent_name: str, + body: CreateTelephonyCallJobRequest, + *, + content_type: str = "application/json", + idempotency_key: str, + **kwargs: Any + ) -> TelephonyCallJob: ... + + @overload + async def create_telephony_call_job( + self, + agent_name: str, + body: JSON, + *, + content_type: str = "application/json", + idempotency_key: str, + **kwargs: Any + ) -> TelephonyCallJob: ... + + @overload + async def create_telephony_call_job( + self, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + idempotency_key: str, + **kwargs: Any + ) -> TelephonyCallJob: ... + + @overload + async def create_telephony_campaign( + self, + agent_name: str, + body: CreateTelephonyCampaignRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> TelephonyCampaign: ... + + @overload + async def create_telephony_campaign( + self, + agent_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> TelephonyCampaign: ... + + @overload + async def create_telephony_campaign( + self, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> TelephonyCampaign: ... + + @distributed_trace_async + async def get_telephony_call_job( + self, + agent_name: str, + call_job_id: str, + **kwargs: Any + ) -> TelephonyCallJob: ... + + @distributed_trace_async + async def get_telephony_campaign( + self, + agent_name: str, + campaign_id: str, + **kwargs: Any + ) -> TelephonyCampaign: ... + + @distributed_trace_async + async def get_telephony_campaign_recipient_import( + self, + agent_name: str, + campaign_id: str, + import_id: str, + **kwargs: Any + ) -> TelephonyCampaignRecipientImport: ... + + @distributed_trace_async + async def get_telephony_operation( + self, + agent_name: str, + operation_id: str, + **kwargs: Any + ) -> TelephonyOperation: ... + + @distributed_trace_async + async def pause_telephony_campaign( + self, + agent_name: str, + campaign_id: str, + **kwargs: Any + ) -> TelephonyCampaign: ... + + @distributed_trace_async + async def resume_telephony_campaign( + self, + agent_name: str, + campaign_id: str, + **kwargs: Any + ) -> TelephonyCampaign: ... + + class azure.ai.projects.aio.operations.AgentsOperations(GeneratedAgentsOperations): def __init__( @@ -5692,6 +5909,52 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.CreateTelephonyCallJobRequest(_Model): + destination: TelephonyOutboundDestination + purpose: Optional[str] + retry_policy: Optional[TelephonyOutboundRetryPolicy] + schedule: Optional[TelephonyCallJobSchedule] + structured_inputs: Optional[dict[str, Any]] + telephony_binding_id: str + + @overload + def __init__( + self, + *, + destination: TelephonyOutboundDestination, + purpose: Optional[str] = ..., + retry_policy: Optional[TelephonyOutboundRetryPolicy] = ..., + schedule: Optional[TelephonyCallJobSchedule] = ..., + structured_inputs: Optional[dict[str, Any]] = ..., + telephony_binding_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.CreateTelephonyCampaignRequest(_Model): + display_name: str + purpose: Optional[str] + retry_policy: Optional[TelephonyOutboundRetryPolicy] + schedule: Optional[TelephonyCampaignSchedule] + telephony_binding_id: str + + @overload + def __init__( + self, + *, + display_name: str, + purpose: Optional[str] = ..., + retry_policy: Optional[TelephonyOutboundRetryPolicy] = ..., + schedule: Optional[TelephonyCampaignSchedule] = ..., + telephony_binding_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.CreateTranscriptionResponseJsonUsage(_Model): type: str @@ -7628,6 +7891,24 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.ImportTelephonyCampaignRecipientsRequest(_Model): + duplicate_handling: Optional[Union[str, TelephonyCampaignDuplicateHandling]] + mapping: Optional[TelephonyCampaignRecipientMappingRequest] + source: TelephonyCampaignRecipientImportSource + + @overload + def __init__( + self, + *, + duplicate_handling: Optional[Union[str, TelephonyCampaignDuplicateHandling]] = ..., + mapping: Optional[TelephonyCampaignRecipientMappingRequest] = ..., + source: TelephonyCampaignRecipientImportSource + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.Index(_Model): description: Optional[str] id: Optional[str] @@ -9321,6 +9602,20 @@ namespace azure.ai.projects.models REJECTED = "rejected" + class azure.ai.projects.models.PublishTelephonyCampaignRequest(_Model): + validation_id: str + + @overload + def __init__( + self, + *, + validation_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.RaiConfig(_Model): invocations_moderation: Optional[RaiInvocationModeration] rai_policy_name: str @@ -12440,6 +12735,102 @@ namespace azure.ai.projects.models RECEIVED = "received" + class azure.ai.projects.models.TelephonyCallJob(_Model): + agent_name: str + attempt_count: int + cancellation: Optional[TelephonyCallJobCancellation] + created_at: datetime + destination: TelephonyOutboundDestination + id: str + next_attempt_at: Optional[datetime] + object: Literal["call_job"] + purpose: Optional[str] + retry_policy: TelephonyOutboundRetryPolicyResponse + revision: int + schedule: Optional[TelephonyCallJobSchedule] + status: Union[str, TelephonyCallJobStatus] + structured_inputs: Optional[dict[str, Any]] + telephony_binding_id: str + terminal_reason: Optional[str] + updated_at: datetime + + @overload + def __init__( + self, + *, + agent_name: str, + attempt_count: int, + cancellation: Optional[TelephonyCallJobCancellation] = ..., + created_at: datetime, + destination: TelephonyOutboundDestination, + id: str, + next_attempt_at: Optional[datetime] = ..., + purpose: Optional[str] = ..., + retry_policy: TelephonyOutboundRetryPolicyResponse, + revision: int, + schedule: Optional[TelephonyCallJobSchedule] = ..., + status: Union[str, TelephonyCallJobStatus], + structured_inputs: Optional[dict[str, Any]] = ..., + telephony_binding_id: str, + terminal_reason: Optional[str] = ..., + updated_at: datetime + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelephonyCallJobCancellation(_Model): + mode: str + requested_at: datetime + requested_by: str + revision: int + + @overload + def __init__( + self, + *, + mode: str, + requested_at: datetime, + requested_by: str, + revision: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelephonyCallJobSchedule(_Model): + expires_at: Optional[datetime] + not_before: Optional[datetime] + + @overload + def __init__( + self, + *, + expires_at: Optional[datetime] = ..., + not_before: Optional[datetime] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelephonyCallJobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACCEPTED = "accepted" + BLOCKED = "blocked" + CANCELLATION_REQUESTED = "cancellation_requested" + CANCELLED = "cancelled" + COMPLETED = "completed" + DISPATCHING = "dispatching" + EXPIRED = "expired" + FAILED = "failed" + IN_PROGRESS = "in_progress" + QUEUED = "queued" + WAITING_FOR_RETRY = "waiting_for_retry" + WAITING_FOR_SCHEDULE = "waiting_for_schedule" + + class azure.ai.projects.models.TelephonyCallLifecycleEvent(_Model): name: Union[str, TelephonyCallLifecycleEventName] observed_at: datetime @@ -12704,12 +13095,385 @@ namespace azure.ai.projects.models PENDING = "pending" - class azure.ai.projects.models.TelephonyProvider(str, Enum, metaclass=CaseInsensitiveEnumMeta): - TEAMS_PHONE_EXTENSION = "teams_phone_extension" - TWILIO = "twilio" - + class azure.ai.projects.models.TelephonyCampaign(_Model): + active_recipient_import_id: Optional[str] + active_validation_id: Optional[str] + agent_name: str + call_job_counts: TelephonyCampaignCallJobCounts + configuration_status: Union[str, TelephonyCampaignConfigurationStatus] + created_at: datetime + display_name: str + execution_status: Union[str, TelephonyCampaignExecutionStatus] + id: str + latest_successful_validation_id: Optional[str] + object: Literal["campaign"] + published_at: Optional[datetime] + purpose: Optional[str] + retry_policy: TelephonyOutboundRetryPolicyResponse + schedule: Optional[TelephonyCampaignSchedule] + telephony_binding_id: str + updated_at: datetime - class azure.ai.projects.models.TelephonyTransferDestination(_Model): + @overload + def __init__( + self, + *, + active_recipient_import_id: Optional[str] = ..., + active_validation_id: Optional[str] = ..., + agent_name: str, + call_job_counts: TelephonyCampaignCallJobCounts, + configuration_status: Union[str, TelephonyCampaignConfigurationStatus], + created_at: datetime, + display_name: str, + execution_status: Union[str, TelephonyCampaignExecutionStatus], + id: str, + latest_successful_validation_id: Optional[str] = ..., + published_at: Optional[datetime] = ..., + purpose: Optional[str] = ..., + retry_policy: TelephonyOutboundRetryPolicyResponse, + schedule: Optional[TelephonyCampaignSchedule] = ..., + telephony_binding_id: str, + updated_at: datetime + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelephonyCampaignCallJobCounts(_Model): + blocked: int + cancelled: int + completed: int + expired: int + failed: int + in_progress: int + pending: int + total: int + + @overload + def __init__( + self, + *, + blocked: int, + cancelled: int, + completed: int, + expired: int, + failed: int, + in_progress: int, + pending: int, + total: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelephonyCampaignConfigurationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DRAFT = "draft" + IMPORTING = "importing" + PUBLISHED = "published" + PUBLISHING = "publishing" + PUBLISH_FAILED = "publish_failed" + VALIDATING = "validating" + + + class azure.ai.projects.models.TelephonyCampaignDuplicateHandling(str, Enum, metaclass=CaseInsensitiveEnumMeta): + KEEP_EACH = "keep_each" + MERGE = "merge" + REJECT = "reject" + + + class azure.ai.projects.models.TelephonyCampaignExecutionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELLED = "cancelled" + COMPLETED = "completed" + FAILED = "failed" + NONE = "none" + PAUSED = "paused" + RUNNING = "running" + SCHEDULED = "scheduled" + + + class azure.ai.projects.models.TelephonyCampaignRecipientImport(_Model): + campaign_id: str + created_at: datetime + duplicate_handling: Union[str, TelephonyCampaignDuplicateHandling] + eligible_recipient_count: int + error_code: Optional[str] + error_message: Optional[str] + id: str + invalid_recipient_count: int + mapping: Optional[TelephonyCampaignRecipientMapping] + object: Literal["recipient_import"] + rows_processed: int + source: TelephonyCampaignRecipientImportSource + status: Union[str, TelephonyCampaignRecipientImportStatus] + updated_at: datetime + + @overload + def __init__( + self, + *, + campaign_id: str, + created_at: datetime, + duplicate_handling: Union[str, TelephonyCampaignDuplicateHandling], + eligible_recipient_count: int, + error_code: Optional[str] = ..., + error_message: Optional[str] = ..., + id: str, + invalid_recipient_count: int, + mapping: Optional[TelephonyCampaignRecipientMapping] = ..., + rows_processed: int, + source: TelephonyCampaignRecipientImportSource, + status: Union[str, TelephonyCampaignRecipientImportStatus], + updated_at: datetime + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelephonyCampaignRecipientImportFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CSV = "csv" + JSON = "json" + JSONL = "jsonl" + + + class azure.ai.projects.models.TelephonyCampaignRecipientImportSource(_Model): + dataset_name: str + dataset_version: str + file_name: str + format: Union[str, TelephonyCampaignRecipientImportFormat] + type: Literal["dataset"] + + @overload + def __init__( + self, + *, + dataset_name: str, + dataset_version: str, + file_name: str, + format: Union[str, TelephonyCampaignRecipientImportFormat] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelephonyCampaignRecipientImportStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FAILED = "failed" + RUNNING = "running" + SUCCEEDED = "succeeded" + + + class azure.ai.projects.models.TelephonyCampaignRecipientMapping(_Model): + destination: str + expires_at: Optional[str] + not_before: Optional[str] + recipient_item_key: Optional[str] + recipient_key: str + + @overload + def __init__( + self, + *, + destination: str, + expires_at: Optional[str] = ..., + not_before: Optional[str] = ..., + recipient_item_key: Optional[str] = ..., + recipient_key: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelephonyCampaignRecipientMappingRequest(_Model): + destination: Optional[str] + expires_at: Optional[str] + not_before: Optional[str] + recipient_item_key: Optional[str] + recipient_key: Optional[str] + + @overload + def __init__( + self, + *, + destination: Optional[str] = ..., + expires_at: Optional[str] = ..., + not_before: Optional[str] = ..., + recipient_item_key: Optional[str] = ..., + recipient_key: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelephonyCampaignSchedule(_Model): + start_at: Optional[datetime] + type: Union[str, TelephonyCampaignScheduleType] + + @overload + def __init__( + self, + *, + start_at: Optional[datetime] = ..., + type: Union[str, TelephonyCampaignScheduleType] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelephonyCampaignScheduleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + IMMEDIATE = "immediate" + SCHEDULED = "scheduled" + + + class azure.ai.projects.models.TelephonyOperation(_Model): + created_at: Optional[datetime] + error: Optional[ApiError] + id: str + object: Literal["operation"] + resource: Optional[TelephonyOperationResource] + status: Union[str, TelephonyOperationStatus] + + @overload + def __init__( + self, + *, + created_at: Optional[datetime] = ..., + error: Optional[ApiError] = ..., + id: str, + resource: Optional[TelephonyOperationResource] = ..., + status: Union[str, TelephonyOperationStatus] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelephonyOperationResource(_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.TelephonyOperationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELLED = "cancelled" + FAILED = "failed" + NOT_STARTED = "not_started" + RUNNING = "running" + SUCCEEDED = "succeeded" + UNKNOWN_STATUS = "unknown" + + + class azure.ai.projects.models.TelephonyOutboundDestination(_Model): + type: Union[str, TelephonyOutboundDestinationType] + value: str + + @overload + def __init__( + self, + *, + type: Union[str, TelephonyOutboundDestinationType], + value: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelephonyOutboundDestinationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PHONE_NUMBER = "phone_number" + + + class azure.ai.projects.models.TelephonyOutboundFixedIntervalRetryPolicy(TelephonyOutboundRetryPolicy, discriminator='fixed_interval'): + interval: Optional[timedelta] + max_attempts: int + type: Literal[TelephonyOutboundRetryPolicyType.FIXED_INTERVAL] + + @overload + def __init__( + self, + *, + interval: Optional[timedelta] = ..., + max_attempts: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelephonyOutboundFixedIntervalRetryPolicyResponse(TelephonyOutboundRetryPolicyResponse, discriminator='fixed_interval'): + interval: timedelta + max_attempts: int + type: Literal[TelephonyOutboundRetryPolicyType.FIXED_INTERVAL] + + @overload + def __init__( + self, + *, + interval: timedelta, + max_attempts: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelephonyOutboundRetryPolicy(_Model): + max_attempts: Optional[int] + type: str + + @overload + def __init__( + self, + *, + max_attempts: Optional[int] = ..., + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelephonyOutboundRetryPolicyResponse(_Model): + max_attempts: int + type: str + + @overload + def __init__( + self, + *, + max_attempts: int, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelephonyOutboundRetryPolicyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FIXED_INTERVAL = "fixed_interval" + + + class azure.ai.projects.models.TelephonyProvider(str, Enum, metaclass=CaseInsensitiveEnumMeta): + TEAMS_PHONE_EXTENSION = "teams_phone_extension" + TWILIO = "twilio" + + + class azure.ai.projects.models.TelephonyTransferDestination(_Model): kind: str @overload @@ -16100,6 +16864,223 @@ namespace azure.ai.projects.operations ) -> ItemPaged[VoiceConversation]: ... + class azure.ai.projects.operations.AgentTelephonyOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_import_telephony_campaign_recipients( + self, + agent_name: str, + campaign_id: str, + body: ImportTelephonyCampaignRecipientsRequest, + *, + content_type: str = "application/json", + idempotency_key: str, + **kwargs: Any + ) -> LROPoller[TelephonyOperationResource]: ... + + @overload + def begin_import_telephony_campaign_recipients( + self, + agent_name: str, + campaign_id: str, + body: JSON, + *, + content_type: str = "application/json", + idempotency_key: str, + **kwargs: Any + ) -> LROPoller[TelephonyOperationResource]: ... + + @overload + def begin_import_telephony_campaign_recipients( + self, + agent_name: str, + campaign_id: str, + body: IO[bytes], + *, + content_type: str = "application/json", + idempotency_key: str, + **kwargs: Any + ) -> LROPoller[TelephonyOperationResource]: ... + + @overload + def begin_publish_telephony_campaign( + self, + agent_name: str, + campaign_id: str, + body: PublishTelephonyCampaignRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[TelephonyOperationResource]: ... + + @overload + def begin_publish_telephony_campaign( + self, + agent_name: str, + campaign_id: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[TelephonyOperationResource]: ... + + @overload + def begin_publish_telephony_campaign( + self, + agent_name: str, + campaign_id: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[TelephonyOperationResource]: ... + + @distributed_trace + def begin_validate_telephony_campaign( + self, + agent_name: str, + campaign_id: str, + **kwargs: Any + ) -> LROPoller[TelephonyOperationResource]: ... + + @distributed_trace + def cancel_telephony_call_job( + self, + agent_name: str, + call_job_id: str, + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> TelephonyCallJob: ... + + @distributed_trace + def cancel_telephony_campaign( + self, + agent_name: str, + campaign_id: str, + **kwargs: Any + ) -> TelephonyCampaign: ... + + @overload + def create_telephony_call_job( + self, + agent_name: str, + body: CreateTelephonyCallJobRequest, + *, + content_type: str = "application/json", + idempotency_key: str, + **kwargs: Any + ) -> TelephonyCallJob: ... + + @overload + def create_telephony_call_job( + self, + agent_name: str, + body: JSON, + *, + content_type: str = "application/json", + idempotency_key: str, + **kwargs: Any + ) -> TelephonyCallJob: ... + + @overload + def create_telephony_call_job( + self, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + idempotency_key: str, + **kwargs: Any + ) -> TelephonyCallJob: ... + + @overload + def create_telephony_campaign( + self, + agent_name: str, + body: CreateTelephonyCampaignRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> TelephonyCampaign: ... + + @overload + def create_telephony_campaign( + self, + agent_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> TelephonyCampaign: ... + + @overload + def create_telephony_campaign( + self, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> TelephonyCampaign: ... + + @distributed_trace + def get_telephony_call_job( + self, + agent_name: str, + call_job_id: str, + **kwargs: Any + ) -> TelephonyCallJob: ... + + @distributed_trace + def get_telephony_campaign( + self, + agent_name: str, + campaign_id: str, + **kwargs: Any + ) -> TelephonyCampaign: ... + + @distributed_trace + def get_telephony_campaign_recipient_import( + self, + agent_name: str, + campaign_id: str, + import_id: str, + **kwargs: Any + ) -> TelephonyCampaignRecipientImport: ... + + @distributed_trace + def get_telephony_operation( + self, + agent_name: str, + operation_id: str, + **kwargs: Any + ) -> TelephonyOperation: ... + + @distributed_trace + def pause_telephony_campaign( + self, + agent_name: str, + campaign_id: str, + **kwargs: Any + ) -> TelephonyCampaign: ... + + @distributed_trace + def resume_telephony_campaign( + self, + agent_name: str, + campaign_id: str, + **kwargs: Any + ) -> TelephonyCampaign: ... + + class azure.ai.projects.operations.AgentsOperations(GeneratedAgentsOperations): def __init__( diff --git a/sdk/ai/azure-ai-projects/api.metadata.yml b/sdk/ai/azure-ai-projects/api.metadata.yml index fedaee57cbf6..59500e0cdda0 100644 --- a/sdk/ai/azure-ai-projects/api.metadata.yml +++ b/sdk/ai/azure-ai-projects/api.metadata.yml @@ -1,4 +1,4 @@ -apiMdSha256: 5955e866f2d81033ae0d647f5302da703f40bd2efd222650cd1555bf3d9286d7 +apiMdSha256: 6800ab7a923e43603098be740db58aa7722b5ce824b52a34dd16cbf5f4c13801 packageVersion: 2.7.0b1 parserVersion: 0.3.31 -pythonVersion: 3.13.2 +pythonVersion: 3.12.14 diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index fad6f111ccdf..010b2e52b06b 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -134,6 +134,8 @@ "azure.ai.projects.models.CreateSkillVersionFromFilesBody": "Azure.AI.Projects.CreateSkillVersionFromFilesBody", "azure.ai.projects.models.CreateTelephonyBindingRequest": "Azure.AI.Projects.CreateTelephonyBindingRequest", "azure.ai.projects.models.CreateTeamsPhoneExtensionTelephonyBindingRequest": "Azure.AI.Projects.CreateTeamsPhoneExtensionTelephonyBindingRequest", + "azure.ai.projects.models.CreateTelephonyCallJobRequest": "Azure.AI.Projects.CreateTelephonyCallJobRequest", + "azure.ai.projects.models.CreateTelephonyCampaignRequest": "Azure.AI.Projects.CreateTelephonyCampaignRequest", "azure.ai.projects.models.CreateTranscriptionResponseJsonUsage": "OpenAI.CreateTranscriptionResponseJsonUsage", "azure.ai.projects.models.CreateTwilioTelephonyBindingRequest": "Azure.AI.Projects.CreateTwilioTelephonyBindingRequest", "azure.ai.projects.models.Trigger": "Azure.AI.Projects.Trigger", @@ -225,6 +227,7 @@ "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.ImportTelephonyCampaignRecipientsRequest": "Azure.AI.Projects.ImportTelephonyCampaignRecipientsRequest", "azure.ai.projects.models.InlineSkillParam": "OpenAI.InlineSkillParam", "azure.ai.projects.models.InlineSkillSourceParam": "OpenAI.InlineSkillSourceParam", "azure.ai.projects.models.Insight": "Azure.AI.Projects.Insight", @@ -313,6 +316,7 @@ "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.PublishTelephonyCampaignRequest": "Azure.AI.Projects.PublishTelephonyCampaignRequest", "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", @@ -451,11 +455,28 @@ "azure.ai.projects.models.TeamsPhoneExtensionTelephonyBindingListItem": "Azure.AI.Projects.TeamsPhoneExtensionTelephonyBindingListItem", "azure.ai.projects.models.TeamsTelephonyTransferDestination": "Azure.AI.Projects.TeamsTelephonyTransferDestination", "azure.ai.projects.models.TelemetryConfig": "Azure.AI.Projects.TelemetryConfig", + "azure.ai.projects.models.TelephonyCallJob": "Azure.AI.Projects.TelephonyCallJob", + "azure.ai.projects.models.TelephonyCallJobCancellation": "Azure.AI.Projects.TelephonyCallJobCancellation", + "azure.ai.projects.models.TelephonyCallJobSchedule": "Azure.AI.Projects.TelephonyCallJobSchedule", "azure.ai.projects.models.TelephonyCallLifecycleEvent": "Azure.AI.Projects.TelephonyCallLifecycleEvent", "azure.ai.projects.models.TelephonyCallRecord": "Azure.AI.Projects.TelephonyCallRecord", "azure.ai.projects.models.TelephonyCallSummary": "Azure.AI.Projects.TelephonyCallSummary", "azure.ai.projects.models.TelephonyCallTiming": "Azure.AI.Projects.TelephonyCallTiming", "azure.ai.projects.models.TelephonyCallTrace": "Azure.AI.Projects.TelephonyCallTrace", + "azure.ai.projects.models.TelephonyCampaign": "Azure.AI.Projects.TelephonyCampaign", + "azure.ai.projects.models.TelephonyCampaignCallJobCounts": "Azure.AI.Projects.TelephonyCampaignCallJobCounts", + "azure.ai.projects.models.TelephonyCampaignRecipientImport": "Azure.AI.Projects.TelephonyCampaignRecipientImport", + "azure.ai.projects.models.TelephonyCampaignRecipientImportSource": "Azure.AI.Projects.TelephonyCampaignRecipientImportSource", + "azure.ai.projects.models.TelephonyCampaignRecipientMapping": "Azure.AI.Projects.TelephonyCampaignRecipientMapping", + "azure.ai.projects.models.TelephonyCampaignRecipientMappingRequest": "Azure.AI.Projects.TelephonyCampaignRecipientMappingRequest", + "azure.ai.projects.models.TelephonyCampaignSchedule": "Azure.AI.Projects.TelephonyCampaignSchedule", + "azure.ai.projects.models.TelephonyOperation": "Azure.AI.Projects.TelephonyOperation", + "azure.ai.projects.models.TelephonyOperationResource": "Azure.AI.Projects.TelephonyOperationResource", + "azure.ai.projects.models.TelephonyOutboundDestination": "Azure.AI.Projects.TelephonyOutboundDestination", + "azure.ai.projects.models.TelephonyOutboundRetryPolicy": "Azure.AI.Projects.TelephonyOutboundRetryPolicy", + "azure.ai.projects.models.TelephonyOutboundFixedIntervalRetryPolicy": "Azure.AI.Projects.TelephonyOutboundFixedIntervalRetryPolicy", + "azure.ai.projects.models.TelephonyOutboundRetryPolicyResponse": "Azure.AI.Projects.TelephonyOutboundRetryPolicyResponse", + "azure.ai.projects.models.TelephonyOutboundFixedIntervalRetryPolicyResponse": "Azure.AI.Projects.TelephonyOutboundFixedIntervalRetryPolicyResponse", "azure.ai.projects.models.TelephonyTransferTarget": "Azure.AI.Projects.TelephonyTransferTarget", "azure.ai.projects.models.TelephonyTransferTargets": "Azure.AI.Projects.TelephonyTransferTargets", "azure.ai.projects.models.TextResponseFormat": "OpenAI.TextResponseFormatConfiguration", @@ -742,6 +763,16 @@ "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.TelephonyOutboundDestinationType": "Azure.AI.Projects.TelephonyOutboundDestinationType", + "azure.ai.projects.models.TelephonyCallJobStatus": "Azure.AI.Projects.TelephonyCallJobStatus", + "azure.ai.projects.models.TelephonyOutboundRetryPolicyType": "Azure.AI.Projects.TelephonyOutboundRetryPolicyType", + "azure.ai.projects.models.TelephonyCampaignScheduleType": "Azure.AI.Projects.TelephonyCampaignScheduleType", + "azure.ai.projects.models.TelephonyCampaignConfigurationStatus": "Azure.AI.Projects.TelephonyCampaignConfigurationStatus", + "azure.ai.projects.models.TelephonyCampaignExecutionStatus": "Azure.AI.Projects.TelephonyCampaignExecutionStatus", + "azure.ai.projects.models.TelephonyCampaignRecipientImportFormat": "Azure.AI.Projects.TelephonyCampaignRecipientImportFormat", + "azure.ai.projects.models.TelephonyCampaignDuplicateHandling": "Azure.AI.Projects.TelephonyCampaignDuplicateHandling", + "azure.ai.projects.models.TelephonyCampaignRecipientImportStatus": "Azure.AI.Projects.TelephonyCampaignRecipientImportStatus", + "azure.ai.projects.models.TelephonyOperationStatus": "Azure.AI.Projects.TelephonyOperationStatus", "azure.ai.projects.models.ToolboxToolType": "Azure.AI.Projects.ToolboxToolType", "azure.ai.projects.models.MemoryStoreUpdateStatus": "Azure.AI.Projects.MemoryStoreUpdateStatus", "azure.ai.projects.models.VoiceAgentAnimationOutputType": "Azure.AI.Projects.VoiceAgentAnimationOutputType", @@ -893,6 +924,32 @@ "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_audio": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationAudio", "azure.ai.projects.operations.AgentEndpointConversationsOperations.get_agent_conversation_audio_content": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationAudioContent", "azure.ai.projects.aio.operations.AgentEndpointConversationsOperations.get_agent_conversation_audio_content": "Azure.AI.Projects.AgentEndpointConversations.getAgentConversationAudioContent", + "azure.ai.projects.operations.AgentTelephonyOperations.create_telephony_call_job": "Azure.AI.Projects.AgentTelephony.createTelephonyCallJob", + "azure.ai.projects.aio.operations.AgentTelephonyOperations.create_telephony_call_job": "Azure.AI.Projects.AgentTelephony.createTelephonyCallJob", + "azure.ai.projects.operations.AgentTelephonyOperations.get_telephony_call_job": "Azure.AI.Projects.AgentTelephony.getTelephonyCallJob", + "azure.ai.projects.aio.operations.AgentTelephonyOperations.get_telephony_call_job": "Azure.AI.Projects.AgentTelephony.getTelephonyCallJob", + "azure.ai.projects.operations.AgentTelephonyOperations.cancel_telephony_call_job": "Azure.AI.Projects.AgentTelephony.cancelTelephonyCallJob", + "azure.ai.projects.aio.operations.AgentTelephonyOperations.cancel_telephony_call_job": "Azure.AI.Projects.AgentTelephony.cancelTelephonyCallJob", + "azure.ai.projects.operations.AgentTelephonyOperations.create_telephony_campaign": "Azure.AI.Projects.AgentTelephony.createTelephonyCampaign", + "azure.ai.projects.aio.operations.AgentTelephonyOperations.create_telephony_campaign": "Azure.AI.Projects.AgentTelephony.createTelephonyCampaign", + "azure.ai.projects.operations.AgentTelephonyOperations.get_telephony_campaign": "Azure.AI.Projects.AgentTelephony.getTelephonyCampaign", + "azure.ai.projects.aio.operations.AgentTelephonyOperations.get_telephony_campaign": "Azure.AI.Projects.AgentTelephony.getTelephonyCampaign", + "azure.ai.projects.operations.AgentTelephonyOperations.begin_import_telephony_campaign_recipients": "Azure.AI.Projects.AgentTelephony.importTelephonyCampaignRecipients", + "azure.ai.projects.aio.operations.AgentTelephonyOperations.begin_import_telephony_campaign_recipients": "Azure.AI.Projects.AgentTelephony.importTelephonyCampaignRecipients", + "azure.ai.projects.operations.AgentTelephonyOperations.get_telephony_campaign_recipient_import": "Azure.AI.Projects.AgentTelephony.getTelephonyCampaignRecipientImport", + "azure.ai.projects.aio.operations.AgentTelephonyOperations.get_telephony_campaign_recipient_import": "Azure.AI.Projects.AgentTelephony.getTelephonyCampaignRecipientImport", + "azure.ai.projects.operations.AgentTelephonyOperations.begin_validate_telephony_campaign": "Azure.AI.Projects.AgentTelephony.validateTelephonyCampaign", + "azure.ai.projects.aio.operations.AgentTelephonyOperations.begin_validate_telephony_campaign": "Azure.AI.Projects.AgentTelephony.validateTelephonyCampaign", + "azure.ai.projects.operations.AgentTelephonyOperations.begin_publish_telephony_campaign": "Azure.AI.Projects.AgentTelephony.publishTelephonyCampaign", + "azure.ai.projects.aio.operations.AgentTelephonyOperations.begin_publish_telephony_campaign": "Azure.AI.Projects.AgentTelephony.publishTelephonyCampaign", + "azure.ai.projects.operations.AgentTelephonyOperations.pause_telephony_campaign": "Azure.AI.Projects.AgentTelephony.pauseTelephonyCampaign", + "azure.ai.projects.aio.operations.AgentTelephonyOperations.pause_telephony_campaign": "Azure.AI.Projects.AgentTelephony.pauseTelephonyCampaign", + "azure.ai.projects.operations.AgentTelephonyOperations.resume_telephony_campaign": "Azure.AI.Projects.AgentTelephony.resumeTelephonyCampaign", + "azure.ai.projects.aio.operations.AgentTelephonyOperations.resume_telephony_campaign": "Azure.AI.Projects.AgentTelephony.resumeTelephonyCampaign", + "azure.ai.projects.operations.AgentTelephonyOperations.cancel_telephony_campaign": "Azure.AI.Projects.AgentTelephony.cancelTelephonyCampaign", + "azure.ai.projects.aio.operations.AgentTelephonyOperations.cancel_telephony_campaign": "Azure.AI.Projects.AgentTelephony.cancelTelephonyCampaign", + "azure.ai.projects.operations.AgentTelephonyOperations.get_telephony_operation": "Azure.AI.Projects.AgentTelephony.getTelephonyOperation", + "azure.ai.projects.aio.operations.AgentTelephonyOperations.get_telephony_operation": "Azure.AI.Projects.AgentTelephony.getTelephonyOperation", "azure.ai.projects.operations.ToolboxesOperations.create_version": "Azure.AI.Projects.Toolboxes.createToolboxVersion", "azure.ai.projects.aio.operations.ToolboxesOperations.create_version": "Azure.AI.Projects.Toolboxes.createToolboxVersion", "azure.ai.projects.operations.ToolboxesOperations.get": "Azure.AI.Projects.Toolboxes.getToolbox", @@ -910,5 +967,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": "6af4ed96e11d" + "CrossLanguageVersion": "d6ddc3e85c2a" } \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py index 9c1e0f4dfd89..433a5a41ddd8 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py @@ -18,6 +18,7 @@ from ._utils.serialization import Deserializer, Serializer from .operations import ( AgentEndpointConversationsOperations, + AgentTelephonyOperations, AgentsOperations, BetaOperations, ConnectionsOperations, @@ -57,6 +58,8 @@ class AIProjectClient: # pylint: disable=too-many-instance-attributes,docstring :ivar agent_endpoint_conversations: AgentEndpointConversationsOperations operations :vartype agent_endpoint_conversations: azure.ai.projects.operations.AgentEndpointConversationsOperations + :ivar agent_telephony: AgentTelephonyOperations operations + :vartype agent_telephony: azure.ai.projects.operations.AgentTelephonyOperations :ivar toolboxes: ToolboxesOperations operations :vartype toolboxes: azure.ai.projects.operations.ToolboxesOperations :param endpoint: Foundry Project endpoint in the form @@ -120,6 +123,7 @@ def __init__( self.agent_endpoint_conversations = AgentEndpointConversationsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.agent_telephony = AgentTelephonyOperations(self._client, self._config, self._serialize, self._deserialize) self.toolboxes = ToolboxesOperations(self._client, self._config, self._serialize, self._deserialize) def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py index 6c95c39bec50..742e58e3bc3c 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py @@ -19,6 +19,8 @@ from azure.identity import get_bearer_token_provider from ._client import AIProjectClient as AIProjectClientGenerated from .operations import TelemetryOperations +from .operations._patch import _OperationMethodHeaderProxy +from .models._enums import _AgentDefinitionOptInKeys from .models._patch import _BETA_OPERATION_FEATURE_HEADERS, _FOUNDRY_FEATURES_HEADER_NAME, _has_header_case_insensitive from ._realtime import ( Realtime, @@ -246,6 +248,16 @@ def __init__( super().__init__(endpoint=endpoint, credential=credential, allow_preview=allow_preview, **kwargs) + if allow_preview: + setattr( + self, + "agent_telephony", + _OperationMethodHeaderProxy( + self.agent_telephony, + _AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.value, + ), + ) + self.telemetry = TelemetryOperations(self) # type: ignore self._realtime: Optional[Realtime] = None # NOTE: voice-agent conversation reads (`agent_endpoint_conversations`) have round-tripped diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py index fd5065a3aa8a..0cccce387126 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py @@ -18,6 +18,7 @@ from ._configuration import AIProjectClientConfiguration from .operations import ( AgentEndpointConversationsOperations, + AgentTelephonyOperations, AgentsOperations, BetaOperations, ConnectionsOperations, @@ -57,6 +58,8 @@ class AIProjectClient: # pylint: disable=too-many-instance-attributes,docstring :ivar agent_endpoint_conversations: AgentEndpointConversationsOperations operations :vartype agent_endpoint_conversations: azure.ai.projects.aio.operations.AgentEndpointConversationsOperations + :ivar agent_telephony: AgentTelephonyOperations operations + :vartype agent_telephony: azure.ai.projects.aio.operations.AgentTelephonyOperations :ivar toolboxes: ToolboxesOperations operations :vartype toolboxes: azure.ai.projects.aio.operations.ToolboxesOperations :param endpoint: Foundry Project endpoint in the form @@ -120,6 +123,7 @@ def __init__( self.agent_endpoint_conversations = AgentEndpointConversationsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.agent_telephony = AgentTelephonyOperations(self._client, self._config, self._serialize, self._deserialize) self.toolboxes = ToolboxesOperations(self._client, self._config, self._serialize, self._deserialize) def send_request( diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py index 48ce766611e0..abca972d0e61 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py @@ -29,7 +29,8 @@ ) from ._client import AIProjectClient as AIProjectClientGenerated from .operations import TelemetryOperations -from ..operations._patch import _method_accepts_keyword_headers +from ..operations._patch import _OperationMethodHeaderProxy, _method_accepts_keyword_headers +from ..models._enums import _AgentDefinitionOptInKeys from ..models._patch import _has_header_case_insensitive from ._realtime import ( AsyncRealtime, @@ -180,6 +181,16 @@ def __init__( super().__init__(endpoint=endpoint, credential=credential, allow_preview=allow_preview, **kwargs) + if allow_preview: + setattr( + self, + "agent_telephony", + _OperationMethodHeaderProxy( + self.agent_telephony, + _AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.value, + ), + ) + self.telemetry = TelemetryOperations(self) # type: ignore self._realtime: Optional[AsyncRealtime] = None # NOTE: voice-agent conversation reads (`agent_endpoint_conversations`) have round-tripped diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/__init__.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/__init__.py index 9a9972c6e723..19d6ddc7b035 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/__init__.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/__init__.py @@ -21,6 +21,7 @@ from ._operations import IndexesOperations # type: ignore from ._operations import VoiceAgentWebSocketOperations # type: ignore from ._operations import AgentEndpointConversationsOperations # type: ignore +from ._operations import AgentTelephonyOperations # type: ignore from ._operations import ToolboxesOperations # type: ignore from ._patch import __all__ as _patch_all @@ -37,6 +38,7 @@ "IndexesOperations", "VoiceAgentWebSocketOperations", "AgentEndpointConversationsOperations", + "AgentTelephonyOperations", "ToolboxesOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore 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 fce439a02f27..e88db5a34c3f 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 @@ -54,6 +54,19 @@ build_agent_endpoint_conversations_list_agent_conversation_response_items_request, build_agent_endpoint_conversations_list_agent_conversation_responses_request, build_agent_endpoint_conversations_list_agent_conversations_request, + build_agent_telephony_cancel_telephony_call_job_request, + build_agent_telephony_cancel_telephony_campaign_request, + build_agent_telephony_create_telephony_call_job_request, + build_agent_telephony_create_telephony_campaign_request, + build_agent_telephony_get_telephony_call_job_request, + build_agent_telephony_get_telephony_campaign_recipient_import_request, + build_agent_telephony_get_telephony_campaign_request, + build_agent_telephony_get_telephony_operation_request, + build_agent_telephony_import_telephony_campaign_recipients_request, + build_agent_telephony_pause_telephony_campaign_request, + build_agent_telephony_publish_telephony_campaign_request, + build_agent_telephony_resume_telephony_campaign_request, + build_agent_telephony_validate_telephony_campaign_request, build_agents_create_session_request, build_agents_create_telephony_binding_request, build_agents_create_version_from_code_request, @@ -2289,7 +2302,6 @@ async def get_session_log_stream( _decompress = kwargs.pop("decompress", True) kwargs.pop("stream", None) # must always stream; discard any caller override - kwargs.pop("stream", None) # must always stream; discard any caller override _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -8217,6 +8229,1625 @@ async def get_agent_conversation_audio_content( return deserialized # type: ignore +class AgentTelephonyOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.aio.AIProjectClient`'s + :attr:`agent_telephony` 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") + + @overload + async def create_telephony_call_job( + self, + agent_name: str, + body: _models.CreateTelephonyCallJobRequest, + *, + idempotency_key: str, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TelephonyCallJob: + """Create an outbound telephony call job. + + Creates one durable direct outbound call job. The latest agent definition is resolved when each + attempt executes. + + :param agent_name: The name of the voice agent that executes the call. Required. + :type agent_name: str + :param body: The direct outbound call to create. Required. + :type body: ~azure.ai.projects.models.CreateTelephonyCallJobRequest + :keyword idempotency_key: A customer-generated idempotency key. Reusing it with an equivalent + request returns the same call job. Required. + :paramtype idempotency_key: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyCallJob. The TelephonyCallJob is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallJob + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_telephony_call_job( + self, + agent_name: str, + body: JSON, + *, + idempotency_key: str, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TelephonyCallJob: + """Create an outbound telephony call job. + + Creates one durable direct outbound call job. The latest agent definition is resolved when each + attempt executes. + + :param agent_name: The name of the voice agent that executes the call. Required. + :type agent_name: str + :param body: The direct outbound call to create. Required. + :type body: JSON + :keyword idempotency_key: A customer-generated idempotency key. Reusing it with an equivalent + request returns the same call job. Required. + :paramtype idempotency_key: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyCallJob. The TelephonyCallJob is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallJob + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_telephony_call_job( + self, + agent_name: str, + body: IO[bytes], + *, + idempotency_key: str, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TelephonyCallJob: + """Create an outbound telephony call job. + + Creates one durable direct outbound call job. The latest agent definition is resolved when each + attempt executes. + + :param agent_name: The name of the voice agent that executes the call. Required. + :type agent_name: str + :param body: The direct outbound call to create. Required. + :type body: IO[bytes] + :keyword idempotency_key: A customer-generated idempotency key. Reusing it with an equivalent + request returns the same call job. Required. + :paramtype idempotency_key: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyCallJob. The TelephonyCallJob is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallJob + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_telephony_call_job( + self, + agent_name: str, + body: Union[_models.CreateTelephonyCallJobRequest, JSON, IO[bytes]], + *, + idempotency_key: str, + **kwargs: Any + ) -> _models.TelephonyCallJob: + """Create an outbound telephony call job. + + Creates one durable direct outbound call job. The latest agent definition is resolved when each + attempt executes. + + :param agent_name: The name of the voice agent that executes the call. Required. + :type agent_name: str + :param body: The direct outbound call to create. Is one of the following types: + CreateTelephonyCallJobRequest, JSON, IO[bytes] Required. + :type body: ~azure.ai.projects.models.CreateTelephonyCallJobRequest or JSON or IO[bytes] + :keyword idempotency_key: A customer-generated idempotency key. Reusing it with an equivalent + request returns the same call job. Required. + :paramtype idempotency_key: str + :return: TelephonyCallJob. The TelephonyCallJob is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallJob + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TelephonyCallJob] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_agent_telephony_create_telephony_call_job_request( + agent_name=agent_name, + idempotency_key=idempotency_key, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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 [202]: + 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["ETag"] = self._deserialize("str", response.headers.get("ETag")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("duration-seconds-int", response.headers.get("Retry-After")) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TelephonyCallJob, response.json()) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_telephony_call_job( + self, agent_name: str, call_job_id: str, **kwargs: Any + ) -> _models.TelephonyCallJob: + """Get an outbound telephony call job. + + Retrieves a durable direct or campaign-created outbound call job. + + :param agent_name: Required. + :type agent_name: str + :param call_job_id: Required. + :type call_job_id: str + :return: TelephonyCallJob. The TelephonyCallJob is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallJob + :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.TelephonyCallJob] = kwargs.pop("cls", None) + + _request = build_agent_telephony_get_telephony_call_job_request( + agent_name=agent_name, + call_job_id=call_job_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) + + response_headers = {} + response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TelephonyCallJob, response.json()) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def cancel_telephony_call_job( + self, agent_name: str, call_job_id: str, *, etag: str, match_condition: MatchConditions, **kwargs: Any + ) -> _models.TelephonyCallJob: + """Cancel an outbound telephony call job. + + Requests cancellation of a durable outbound call job. A connected call is allowed to finish. + + :param agent_name: Required. + :type agent_name: str + :param call_job_id: Required. + :type call_job_id: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :return: TelephonyCallJob. The TelephonyCallJob is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallJob + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TelephonyCallJob] = kwargs.pop("cls", None) + + _request = build_agent_telephony_cancel_telephony_call_job_request( + agent_name=agent_name, + call_job_id=call_job_id, + etag=etag, + match_condition=match_condition, + 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, 202]: + 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 = {} + if response.status_code == 200: + response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) + + if response.status_code == 202: + response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize( + "duration-seconds-int", response.headers.get("Retry-After") + ) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TelephonyCallJob, response.json()) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_telephony_campaign( + self, + agent_name: str, + body: _models.CreateTelephonyCampaignRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TelephonyCampaign: + """Create an outbound telephony campaign. + + Creates a draft outbound campaign. Recipients are imported and validated before the campaign + can be published. + + :param agent_name: Required. + :type agent_name: str + :param body: Required. + :type body: ~azure.ai.projects.models.CreateTelephonyCampaignRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCampaign + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_telephony_campaign( + self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.TelephonyCampaign: + """Create an outbound telephony campaign. + + Creates a draft outbound campaign. Recipients are imported and validated before the campaign + can be published. + + :param agent_name: Required. + :type agent_name: str + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCampaign + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_telephony_campaign( + self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.TelephonyCampaign: + """Create an outbound telephony campaign. + + Creates a draft outbound campaign. Recipients are imported and validated before the campaign + can be published. + + :param agent_name: Required. + :type agent_name: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCampaign + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_telephony_campaign( + self, agent_name: str, body: Union[_models.CreateTelephonyCampaignRequest, JSON, IO[bytes]], **kwargs: Any + ) -> _models.TelephonyCampaign: + """Create an outbound telephony campaign. + + Creates a draft outbound campaign. Recipients are imported and validated before the campaign + can be published. + + :param agent_name: Required. + :type agent_name: str + :param body: Is one of the following types: CreateTelephonyCampaignRequest, JSON, IO[bytes] + Required. + :type body: ~azure.ai.projects.models.CreateTelephonyCampaignRequest or JSON or IO[bytes] + :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCampaign + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TelephonyCampaign] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_agent_telephony_create_telephony_campaign_request( + agent_name=agent_name, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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 [201]: + 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["Location"] = self._deserialize("str", response.headers.get("Location")) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TelephonyCampaign, response.json()) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_telephony_campaign( + self, agent_name: str, campaign_id: str, **kwargs: Any + ) -> _models.TelephonyCampaign: + """Get an outbound telephony campaign. + + Retrieves an outbound campaign, including configuration, execution state, and aggregate + call-job counts. + + :param agent_name: Required. + :type agent_name: str + :param campaign_id: Required. + :type campaign_id: str + :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCampaign + :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.TelephonyCampaign] = kwargs.pop("cls", None) + + _request = build_agent_telephony_get_telephony_campaign_request( + agent_name=agent_name, + campaign_id=campaign_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.TelephonyCampaign, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _import_telephony_campaign_recipients_initial( # pylint: disable=name-too-long + self, + agent_name: str, + campaign_id: str, + body: Union[_models.ImportTelephonyCampaignRecipientsRequest, JSON, IO[bytes]], + *, + idempotency_key: str, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_agent_telephony_import_telephony_campaign_recipients_request( + agent_name=agent_name, + campaign_id=campaign_id, + idempotency_key=idempotency_key, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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 = 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 [202]: + 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["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) + response_headers["Retry-After"] = self._deserialize("duration-seconds-int", response.headers.get("Retry-After")) + + 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 + + @overload + async def begin_import_telephony_campaign_recipients( # pylint: disable=name-too-long + self, + agent_name: str, + campaign_id: str, + body: _models.ImportTelephonyCampaignRecipientsRequest, + *, + idempotency_key: str, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.TelephonyOperationResource]: + """Import outbound telephony campaign recipients. + + Starts an asynchronous import of campaign recipients from a Dataset CSV, JSON array, or JSONL + file. + + :param agent_name: Required. + :type agent_name: str + :param campaign_id: Required. + :type campaign_id: str + :param body: Required. + :type body: ~azure.ai.projects.models.ImportTelephonyCampaignRecipientsRequest + :keyword idempotency_key: Required. + :paramtype idempotency_key: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns TelephonyOperationResource. The + TelephonyOperationResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.TelephonyOperationResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_import_telephony_campaign_recipients( # pylint: disable=name-too-long + self, + agent_name: str, + campaign_id: str, + body: JSON, + *, + idempotency_key: str, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.TelephonyOperationResource]: + """Import outbound telephony campaign recipients. + + Starts an asynchronous import of campaign recipients from a Dataset CSV, JSON array, or JSONL + file. + + :param agent_name: Required. + :type agent_name: str + :param campaign_id: Required. + :type campaign_id: str + :param body: Required. + :type body: JSON + :keyword idempotency_key: Required. + :paramtype idempotency_key: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns TelephonyOperationResource. The + TelephonyOperationResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.TelephonyOperationResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_import_telephony_campaign_recipients( # pylint: disable=name-too-long + self, + agent_name: str, + campaign_id: str, + body: IO[bytes], + *, + idempotency_key: str, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.TelephonyOperationResource]: + """Import outbound telephony campaign recipients. + + Starts an asynchronous import of campaign recipients from a Dataset CSV, JSON array, or JSONL + file. + + :param agent_name: Required. + :type agent_name: str + :param campaign_id: Required. + :type campaign_id: str + :param body: Required. + :type body: IO[bytes] + :keyword idempotency_key: Required. + :paramtype idempotency_key: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns TelephonyOperationResource. The + TelephonyOperationResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.TelephonyOperationResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_import_telephony_campaign_recipients( # pylint: disable=name-too-long + self, + agent_name: str, + campaign_id: str, + body: Union[_models.ImportTelephonyCampaignRecipientsRequest, JSON, IO[bytes]], + *, + idempotency_key: str, + **kwargs: Any + ) -> AsyncLROPoller[_models.TelephonyOperationResource]: + """Import outbound telephony campaign recipients. + + Starts an asynchronous import of campaign recipients from a Dataset CSV, JSON array, or JSONL + file. + + :param agent_name: Required. + :type agent_name: str + :param campaign_id: Required. + :type campaign_id: str + :param body: Is one of the following types: ImportTelephonyCampaignRecipientsRequest, JSON, + IO[bytes] Required. + :type body: ~azure.ai.projects.models.ImportTelephonyCampaignRecipientsRequest or JSON or + IO[bytes] + :keyword idempotency_key: Required. + :paramtype idempotency_key: str + :return: An instance of AsyncLROPoller that returns TelephonyOperationResource. The + TelephonyOperationResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.TelephonyOperationResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TelephonyOperationResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._import_telephony_campaign_recipients_initial( + agent_name=agent_name, + campaign_id=campaign_id, + body=body, + idempotency_key=idempotency_key, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Operation-Location"] = self._deserialize( + "str", response.headers.get("Operation-Location") + ) + response_headers["Retry-After"] = self._deserialize( + "duration-seconds-int", response.headers.get("Retry-After") + ) + + deserialized = _deserialize(_models.TelephonyOperationResource, response.json().get("resource", {})) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.TelephonyOperationResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.TelephonyOperationResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def get_telephony_campaign_recipient_import( + self, agent_name: str, campaign_id: str, import_id: str, **kwargs: Any + ) -> _models.TelephonyCampaignRecipientImport: + """Get an outbound telephony campaign recipient import. + + Retrieves the durable status and counters for a campaign recipient import. + + :param agent_name: Required. + :type agent_name: str + :param campaign_id: Required. + :type campaign_id: str + :param import_id: Required. + :type import_id: str + :return: TelephonyCampaignRecipientImport. The TelephonyCampaignRecipientImport is compatible + with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCampaignRecipientImport + :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.TelephonyCampaignRecipientImport] = kwargs.pop("cls", None) + + _request = build_agent_telephony_get_telephony_campaign_recipient_import_request( + agent_name=agent_name, + campaign_id=campaign_id, + import_id=import_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.TelephonyCampaignRecipientImport, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _validate_telephony_campaign_initial( + self, agent_name: str, campaign_id: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + 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_agent_telephony_validate_telephony_campaign_request( + agent_name=agent_name, + campaign_id=campaign_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 = 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 [202]: + 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["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) + response_headers["Retry-After"] = self._deserialize("duration-seconds-int", response.headers.get("Retry-After")) + + 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 begin_validate_telephony_campaign( + self, agent_name: str, campaign_id: str, **kwargs: Any + ) -> AsyncLROPoller[_models.TelephonyOperationResource]: + """Validate an outbound telephony campaign. + + Starts asynchronous validation of the current campaign draft and imported recipient snapshot. + + :param agent_name: Required. + :type agent_name: str + :param campaign_id: Required. + :type campaign_id: str + :return: An instance of AsyncLROPoller that returns TelephonyOperationResource. The + TelephonyOperationResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.TelephonyOperationResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TelephonyOperationResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._validate_telephony_campaign_initial( + agent_name=agent_name, + campaign_id=campaign_id, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Operation-Location"] = self._deserialize( + "str", response.headers.get("Operation-Location") + ) + response_headers["Retry-After"] = self._deserialize( + "duration-seconds-int", response.headers.get("Retry-After") + ) + + deserialized = _deserialize(_models.TelephonyOperationResource, response.json().get("resource", {})) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.TelephonyOperationResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.TelephonyOperationResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _publish_telephony_campaign_initial( + self, + agent_name: str, + campaign_id: str, + body: Union[_models.PublishTelephonyCampaignRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_agent_telephony_publish_telephony_campaign_request( + agent_name=agent_name, + campaign_id=campaign_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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 = 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 [202]: + 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["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) + response_headers["Retry-After"] = self._deserialize("duration-seconds-int", response.headers.get("Retry-After")) + + 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 + + @overload + async def begin_publish_telephony_campaign( + self, + agent_name: str, + campaign_id: str, + body: _models.PublishTelephonyCampaignRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.TelephonyOperationResource]: + """Publish an outbound telephony campaign. + + Permanently locks the validated campaign draft and starts asynchronous call-job + materialization. + + :param agent_name: Required. + :type agent_name: str + :param campaign_id: Required. + :type campaign_id: str + :param body: Required. + :type body: ~azure.ai.projects.models.PublishTelephonyCampaignRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns TelephonyOperationResource. The + TelephonyOperationResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.TelephonyOperationResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_publish_telephony_campaign( + self, agent_name: str, campaign_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> AsyncLROPoller[_models.TelephonyOperationResource]: + """Publish an outbound telephony campaign. + + Permanently locks the validated campaign draft and starts asynchronous call-job + materialization. + + :param agent_name: Required. + :type agent_name: str + :param campaign_id: Required. + :type campaign_id: str + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns TelephonyOperationResource. The + TelephonyOperationResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.TelephonyOperationResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_publish_telephony_campaign( + self, + agent_name: str, + campaign_id: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.TelephonyOperationResource]: + """Publish an outbound telephony campaign. + + Permanently locks the validated campaign draft and starts asynchronous call-job + materialization. + + :param agent_name: Required. + :type agent_name: str + :param campaign_id: Required. + :type campaign_id: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns TelephonyOperationResource. The + TelephonyOperationResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.TelephonyOperationResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_publish_telephony_campaign( + self, + agent_name: str, + campaign_id: str, + body: Union[_models.PublishTelephonyCampaignRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.TelephonyOperationResource]: + """Publish an outbound telephony campaign. + + Permanently locks the validated campaign draft and starts asynchronous call-job + materialization. + + :param agent_name: Required. + :type agent_name: str + :param campaign_id: Required. + :type campaign_id: str + :param body: Is one of the following types: PublishTelephonyCampaignRequest, JSON, IO[bytes] + Required. + :type body: ~azure.ai.projects.models.PublishTelephonyCampaignRequest or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns TelephonyOperationResource. The + TelephonyOperationResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.TelephonyOperationResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TelephonyOperationResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._publish_telephony_campaign_initial( + agent_name=agent_name, + campaign_id=campaign_id, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Operation-Location"] = self._deserialize( + "str", response.headers.get("Operation-Location") + ) + response_headers["Retry-After"] = self._deserialize( + "duration-seconds-int", response.headers.get("Retry-After") + ) + + deserialized = _deserialize(_models.TelephonyOperationResource, response.json().get("resource", {})) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.TelephonyOperationResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.TelephonyOperationResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def pause_telephony_campaign( + self, agent_name: str, campaign_id: str, **kwargs: Any + ) -> _models.TelephonyCampaign: + """Pause an outbound telephony campaign. + + Pauses dispatch of call jobs owned by a published campaign. + + :param agent_name: Required. + :type agent_name: str + :param campaign_id: Required. + :type campaign_id: str + :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCampaign + :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.TelephonyCampaign] = kwargs.pop("cls", None) + + _request = build_agent_telephony_pause_telephony_campaign_request( + agent_name=agent_name, + campaign_id=campaign_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.TelephonyCampaign, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def resume_telephony_campaign( + self, agent_name: str, campaign_id: str, **kwargs: Any + ) -> _models.TelephonyCampaign: + """Resume an outbound telephony campaign. + + Resumes dispatch of call jobs owned by a paused campaign. + + :param agent_name: Required. + :type agent_name: str + :param campaign_id: Required. + :type campaign_id: str + :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCampaign + :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.TelephonyCampaign] = kwargs.pop("cls", None) + + _request = build_agent_telephony_resume_telephony_campaign_request( + agent_name=agent_name, + campaign_id=campaign_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.TelephonyCampaign, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def cancel_telephony_campaign( + self, agent_name: str, campaign_id: str, **kwargs: Any + ) -> _models.TelephonyCampaign: + """Cancel an outbound telephony campaign. + + Cancels a campaign and prevents any further call-job dispatch. + + :param agent_name: Required. + :type agent_name: str + :param campaign_id: Required. + :type campaign_id: str + :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCampaign + :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.TelephonyCampaign] = kwargs.pop("cls", None) + + _request = build_agent_telephony_cancel_telephony_campaign_request( + agent_name=agent_name, + campaign_id=campaign_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.TelephonyCampaign, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_telephony_operation( + self, agent_name: str, operation_id: str, **kwargs: Any + ) -> _models.TelephonyOperation: + """Get an outbound telephony operation. + + Retrieves an asynchronous outbound campaign operation. + + :param agent_name: Required. + :type agent_name: str + :param operation_id: Required. + :type operation_id: str + :return: TelephonyOperation. The TelephonyOperation is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyOperation + :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.TelephonyOperation] = kwargs.pop("cls", None) + + _request = build_agent_telephony_get_telephony_operation_request( + agent_name=agent_name, + operation_id=operation_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.TelephonyOperation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + class ToolboxesOperations: # 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 ea25eb33ad75..2e575d8b21b4 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 @@ -134,6 +134,8 @@ CreateSkillVersionFromFilesBody, CreateTeamsPhoneExtensionTelephonyBindingRequest, CreateTelephonyBindingRequest, + CreateTelephonyCallJobRequest, + CreateTelephonyCampaignRequest, CreateTranscriptionResponseJsonUsage, CreateTwilioTelephonyBindingRequest, CronTrigger, @@ -225,6 +227,7 @@ HybridSearchOptions, ImageGenTool, ImageGenToolInputImageMask, + ImportTelephonyCampaignRecipientsRequest, Index, InlineSkillParam, InlineSkillSourceParam, @@ -314,6 +317,7 @@ PromptEvaluatorGenerationJobSource, ProtocolConfiguration, ProtocolVersionRecord, + PublishTelephonyCampaignRequest, RaiConfig, RaiInvocationModeration, RaiSseTextSelector, @@ -459,11 +463,28 @@ TelemetryEndpointAuth, TelephonyBinding, TelephonyBindingListItem, + TelephonyCallJob, + TelephonyCallJobCancellation, + TelephonyCallJobSchedule, TelephonyCallLifecycleEvent, TelephonyCallRecord, TelephonyCallSummary, TelephonyCallTiming, TelephonyCallTrace, + TelephonyCampaign, + TelephonyCampaignCallJobCounts, + TelephonyCampaignRecipientImport, + TelephonyCampaignRecipientImportSource, + TelephonyCampaignRecipientMapping, + TelephonyCampaignRecipientMappingRequest, + TelephonyCampaignSchedule, + TelephonyOperation, + TelephonyOperationResource, + TelephonyOutboundDestination, + TelephonyOutboundFixedIntervalRetryPolicy, + TelephonyOutboundFixedIntervalRetryPolicyResponse, + TelephonyOutboundRetryPolicy, + TelephonyOutboundRetryPolicyResponse, TelephonyTransferDestination, TelephonyTransferTarget, TelephonyTransferTargets, @@ -723,6 +744,7 @@ TelemetryTransportProtocol, TelephonyBindingStatus, TelephonyCallDurationBasis, + TelephonyCallJobStatus, TelephonyCallLifecycleEventName, TelephonyCallLifecycleEventOutcome, TelephonyCallLifecycleEventSource, @@ -731,6 +753,15 @@ TelephonyCallTimestampSource, TelephonyCallTraceMode, TelephonyCallTraceStatus, + TelephonyCampaignConfigurationStatus, + TelephonyCampaignDuplicateHandling, + TelephonyCampaignExecutionStatus, + TelephonyCampaignRecipientImportFormat, + TelephonyCampaignRecipientImportStatus, + TelephonyCampaignScheduleType, + TelephonyOperationStatus, + TelephonyOutboundDestinationType, + TelephonyOutboundRetryPolicyType, TelephonyProvider, TelephonyTransferDestinationKind, TextResponseFormatConfigurationType, @@ -892,6 +923,8 @@ "CreateSkillVersionFromFilesBody", "CreateTeamsPhoneExtensionTelephonyBindingRequest", "CreateTelephonyBindingRequest", + "CreateTelephonyCallJobRequest", + "CreateTelephonyCampaignRequest", "CreateTranscriptionResponseJsonUsage", "CreateTwilioTelephonyBindingRequest", "CronTrigger", @@ -983,6 +1016,7 @@ "HybridSearchOptions", "ImageGenTool", "ImageGenToolInputImageMask", + "ImportTelephonyCampaignRecipientsRequest", "Index", "InlineSkillParam", "InlineSkillSourceParam", @@ -1072,6 +1106,7 @@ "PromptEvaluatorGenerationJobSource", "ProtocolConfiguration", "ProtocolVersionRecord", + "PublishTelephonyCampaignRequest", "RaiConfig", "RaiInvocationModeration", "RaiSseTextSelector", @@ -1217,11 +1252,28 @@ "TelemetryEndpointAuth", "TelephonyBinding", "TelephonyBindingListItem", + "TelephonyCallJob", + "TelephonyCallJobCancellation", + "TelephonyCallJobSchedule", "TelephonyCallLifecycleEvent", "TelephonyCallRecord", "TelephonyCallSummary", "TelephonyCallTiming", "TelephonyCallTrace", + "TelephonyCampaign", + "TelephonyCampaignCallJobCounts", + "TelephonyCampaignRecipientImport", + "TelephonyCampaignRecipientImportSource", + "TelephonyCampaignRecipientMapping", + "TelephonyCampaignRecipientMappingRequest", + "TelephonyCampaignSchedule", + "TelephonyOperation", + "TelephonyOperationResource", + "TelephonyOutboundDestination", + "TelephonyOutboundFixedIntervalRetryPolicy", + "TelephonyOutboundFixedIntervalRetryPolicyResponse", + "TelephonyOutboundRetryPolicy", + "TelephonyOutboundRetryPolicyResponse", "TelephonyTransferDestination", "TelephonyTransferTarget", "TelephonyTransferTargets", @@ -1478,6 +1530,7 @@ "TelemetryTransportProtocol", "TelephonyBindingStatus", "TelephonyCallDurationBasis", + "TelephonyCallJobStatus", "TelephonyCallLifecycleEventName", "TelephonyCallLifecycleEventOutcome", "TelephonyCallLifecycleEventSource", @@ -1486,6 +1539,15 @@ "TelephonyCallTimestampSource", "TelephonyCallTraceMode", "TelephonyCallTraceStatus", + "TelephonyCampaignConfigurationStatus", + "TelephonyCampaignDuplicateHandling", + "TelephonyCampaignExecutionStatus", + "TelephonyCampaignRecipientImportFormat", + "TelephonyCampaignRecipientImportStatus", + "TelephonyCampaignScheduleType", + "TelephonyOperationStatus", + "TelephonyOutboundDestinationType", + "TelephonyOutboundRetryPolicyType", "TelephonyProvider", "TelephonyTransferDestinationKind", "TextResponseFormatConfigurationType", 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 f31f9254da78..3ac7592c3bd4 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 @@ -1590,6 +1590,35 @@ class TelephonyCallDurationBasis(str, Enum, metaclass=CaseInsensitiveEnumMeta): available.""" +class TelephonyCallJobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The lifecycle status of a durable outbound call job.""" + + ACCEPTED = "accepted" + """ACCEPTED.""" + WAITING_FOR_SCHEDULE = "waiting_for_schedule" + """WAITING_FOR_SCHEDULE.""" + QUEUED = "queued" + """QUEUED.""" + DISPATCHING = "dispatching" + """DISPATCHING.""" + IN_PROGRESS = "in_progress" + """IN_PROGRESS.""" + WAITING_FOR_RETRY = "waiting_for_retry" + """WAITING_FOR_RETRY.""" + CANCELLATION_REQUESTED = "cancellation_requested" + """CANCELLATION_REQUESTED.""" + COMPLETED = "completed" + """COMPLETED.""" + BLOCKED = "blocked" + """BLOCKED.""" + EXPIRED = "expired" + """EXPIRED.""" + FAILED = "failed" + """FAILED.""" + CANCELLED = "cancelled" + """CANCELLED.""" + + class TelephonyCallLifecycleEventName(str, Enum, metaclass=CaseInsensitiveEnumMeta): """A provider-neutral lifecycle event name. Known values are stable; additional values may be added over time. @@ -1727,6 +1756,115 @@ class TelephonyCallTraceStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Trace creation failed.""" +class TelephonyCampaignConfigurationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The immutable-configuration lifecycle status of an outbound campaign.""" + + DRAFT = "draft" + """DRAFT.""" + IMPORTING = "importing" + """IMPORTING.""" + VALIDATING = "validating" + """VALIDATING.""" + PUBLISHING = "publishing" + """PUBLISHING.""" + PUBLISHED = "published" + """PUBLISHED.""" + PUBLISH_FAILED = "publish_failed" + """PUBLISH_FAILED.""" + + +class TelephonyCampaignDuplicateHandling(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """How duplicate recipient keys in an import are handled.""" + + REJECT = "reject" + """Reject duplicate recipient keys.""" + KEEP_EACH = "keep_each" + """Keep each recipient entry, distinguishing duplicates by recipient item key.""" + MERGE = "merge" + """Merge entries with the same recipient key.""" + + +class TelephonyCampaignExecutionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The execution lifecycle status of a published outbound campaign.""" + + NONE = "none" + """NONE.""" + SCHEDULED = "scheduled" + """SCHEDULED.""" + RUNNING = "running" + """RUNNING.""" + PAUSED = "paused" + """PAUSED.""" + COMPLETED = "completed" + """COMPLETED.""" + FAILED = "failed" + """FAILED.""" + CANCELLED = "cancelled" + """CANCELLED.""" + + +class TelephonyCampaignRecipientImportFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """A supported Dataset recipient file format.""" + + CSV = "csv" + """A comma-separated values file.""" + JSON = "json" + """A JSON file containing an array of recipient objects.""" + JSONL = "jsonl" + """A JSON Lines file containing one recipient object per line.""" + + +class TelephonyCampaignRecipientImportStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The lifecycle status of a campaign recipient import.""" + + RUNNING = "running" + """RUNNING.""" + SUCCEEDED = "succeeded" + """SUCCEEDED.""" + FAILED = "failed" + """FAILED.""" + + +class TelephonyCampaignScheduleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """When a published outbound campaign becomes eligible to dispatch calls.""" + + IMMEDIATE = "immediate" + """Calls are eligible immediately after publication.""" + SCHEDULED = "scheduled" + """Calls are eligible at the scheduled start instant.""" + + +class TelephonyOperationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The lifecycle status of an outbound telephony operation.""" + + NOT_STARTED = "not_started" + """NOT_STARTED.""" + RUNNING = "running" + """RUNNING.""" + SUCCEEDED = "succeeded" + """SUCCEEDED.""" + FAILED = "failed" + """FAILED.""" + CANCELLED = "cancelled" + """CANCELLED.""" + UNKNOWN_STATUS = "unknown" + """UNKNOWN_STATUS.""" + + +class TelephonyOutboundDestinationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of destination for an outbound call.""" + + PHONE_NUMBER = "phone_number" + """An E.164 phone number.""" + + +class TelephonyOutboundRetryPolicyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The retry strategy for an outbound call.""" + + FIXED_INTERVAL = "fixed_interval" + """Retry after a fixed interval between attempts.""" + + class TelephonyProvider(str, Enum, metaclass=CaseInsensitiveEnumMeta): """A telephony provider supported by an agent binding. 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 575ae1bfccb6..aa536dbc4f30 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 @@ -55,6 +55,7 @@ ScheduleTaskType, TelemetryEndpointAuthType, TelemetryEndpointKind, + TelephonyOutboundRetryPolicyType, TelephonyProvider, TelephonyTransferDestinationKind, TextResponseFormatConfigurationType, @@ -6209,6 +6210,126 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.provider = TelephonyProvider.TEAMS_PHONE_EXTENSION # type: ignore +class CreateTelephonyCallJobRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A request to create one durable direct outbound call job. + + :ivar destination: The phone destination to call. Required. + :vartype destination: ~azure.ai.projects.models.TelephonyOutboundDestination + :ivar telephony_binding_id: The active agent telephony binding used to originate the call. + Required. + :vartype telephony_binding_id: 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 retry_policy: The provider-attempt retry policy. Omit it for one attempt with no retry + delay. + :vartype retry_policy: ~azure.ai.projects.models.TelephonyOutboundRetryPolicy + """ + + destination: "_models.TelephonyOutboundDestination" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The phone destination to call. Required.""" + telephony_binding_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The active agent telephony binding used to originate the call. 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.""" + retry_policy: Optional["_models.TelephonyOutboundRetryPolicy"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The provider-attempt retry policy. Omit it for one attempt with no retry delay.""" + + @overload + def __init__( + self, + *, + destination: "_models.TelephonyOutboundDestination", + telephony_binding_id: str, + purpose: Optional[str] = None, + structured_inputs: Optional[dict[str, Any]] = None, + schedule: Optional["_models.TelephonyCallJobSchedule"] = None, + retry_policy: Optional["_models.TelephonyOutboundRetryPolicy"] = 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 CreateTelephonyCampaignRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A request to create a draft outbound campaign. + + :ivar display_name: A customer-visible name for the campaign. Required. + :vartype display_name: str + :ivar telephony_binding_id: The active agent telephony binding used to originate campaign + calls. Required. + :vartype telephony_binding_id: str + :ivar purpose: An optional customer-declared purpose for campaign calls. + :vartype purpose: str + :ivar schedule: When the published campaign becomes eligible to dispatch calls. + :vartype schedule: ~azure.ai.projects.models.TelephonyCampaignSchedule + :ivar retry_policy: The provider-attempt retry policy inherited by every materialized call job. + :vartype retry_policy: ~azure.ai.projects.models.TelephonyOutboundRetryPolicy + """ + + display_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A customer-visible name for the campaign. Required.""" + telephony_binding_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The active agent telephony binding used to originate campaign calls. Required.""" + purpose: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional customer-declared purpose for campaign calls.""" + schedule: Optional["_models.TelephonyCampaignSchedule"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """When the published campaign becomes eligible to dispatch calls.""" + retry_policy: Optional["_models.TelephonyOutboundRetryPolicy"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The provider-attempt retry policy inherited by every materialized call job.""" + + @overload + def __init__( + self, + *, + display_name: str, + telephony_binding_id: str, + purpose: Optional[str] = None, + schedule: Optional["_models.TelephonyCampaignSchedule"] = None, + retry_policy: Optional["_models.TelephonyOutboundRetryPolicy"] = 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 CreateTranscriptionResponseJsonUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Token usage statistics for the request. @@ -10547,6 +10668,59 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class ImportTelephonyCampaignRecipientsRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A request to import campaign recipients from a Dataset CSV, JSON array, or JSONL file. Imported + Agent-declared structured inputs follow the Agent definition's schema, required, and + default-value semantics. + + :ivar source: Required. + :vartype source: ~azure.ai.projects.models.TelephonyCampaignRecipientImportSource + :ivar mapping: Mappings from recipient properties to source fields or columns. Omit this + property or an individual entry to use same-named source fields. Destination and recipient-key + source fields are required. Optional source fields may be absent, except the recipient item key + when ``duplicate_handling`` is ``keep_each``. + :vartype mapping: ~azure.ai.projects.models.TelephonyCampaignRecipientMappingRequest + :ivar duplicate_handling: Known values are: "reject", "keep_each", and "merge". + :vartype duplicate_handling: str or + ~azure.ai.projects.models.TelephonyCampaignDuplicateHandling + """ + + source: "_models.TelephonyCampaignRecipientImportSource" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required.""" + mapping: Optional["_models.TelephonyCampaignRecipientMappingRequest"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Mappings from recipient properties to source fields or columns. Omit this property or an + individual entry to use same-named source fields. Destination and recipient-key source fields + are required. Optional source fields may be absent, except the recipient item key when + ``duplicate_handling`` is ``keep_each``.""" + duplicate_handling: Optional[Union[str, "_models.TelephonyCampaignDuplicateHandling"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"reject\", \"keep_each\", and \"merge\".""" + + @overload + def __init__( + self, + *, + source: "_models.TelephonyCampaignRecipientImportSource", + mapping: Optional["_models.TelephonyCampaignRecipientMappingRequest"] = None, + duplicate_handling: Optional[Union[str, "_models.TelephonyCampaignDuplicateHandling"]] = 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 InlineSkillParam( ContainerSkill, discriminator="inline" ): # pylint: disable=docstring-keyword-should-match-keyword-only @@ -14477,6 +14651,34 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = TelephonyTransferDestinationKind.PSTN # type: ignore +class PublishTelephonyCampaignRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A request to publish a validated outbound campaign draft. + + :ivar validation_id: Required. + :vartype validation_id: str + """ + + validation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + validation_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 RaiConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Configuration for Responsible AI (RAI) content filtering and safety features. @@ -21430,6 +21632,226 @@ 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 telephony_binding_id: The active agent telephony binding used to originate the call. + Required. + :vartype telephony_binding_id: 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.TelephonyOutboundRetryPolicyResponse + :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 reason for the terminal status, when available. + :vartype terminal_reason: str + :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.""" + telephony_binding_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The active agent telephony binding used to originate the call. 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.TelephonyOutboundRetryPolicyResponse" = 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[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The stable reason for the terminal status, when available.""" + 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", + telephony_binding_id: str, + id: str, # pylint: disable=redefined-builtin + agent_name: str, + status: Union[str, "_models.TelephonyCallJobStatus"], + retry_policy: "_models.TelephonyOutboundRetryPolicyResponse", + 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[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.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__( + self, + *, + not_before: Optional[datetime.datetime] = 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) + + class TelephonyCallLifecycleEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A bounded durable observation in the lifecycle of one telephony call. @@ -22019,6 +22441,813 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class TelephonyCampaign(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A durable outbound campaign owned by a voice agent. + + :ivar display_name: A customer-visible name for the campaign. Required. + :vartype display_name: str + :ivar telephony_binding_id: The active agent telephony binding used to originate campaign + calls. Required. + :vartype telephony_binding_id: str + :ivar purpose: An optional customer-declared purpose for campaign calls. + :vartype purpose: str + :ivar schedule: When the published campaign becomes eligible to dispatch calls. + :vartype schedule: ~azure.ai.projects.models.TelephonyCampaignSchedule + :ivar id: Required. + :vartype id: str + :ivar object: Required. Default value is "telephony.campaign". + :vartype object: str + :ivar agent_name: Required. + :vartype agent_name: str + :ivar configuration_status: Required. Known values are: "draft", "importing", "validating", + "publishing", "published", and "publish_failed". + :vartype configuration_status: str or + ~azure.ai.projects.models.TelephonyCampaignConfigurationStatus + :ivar execution_status: Required. Known values are: "none", "scheduled", "running", "paused", + "completed", "failed", and "cancelled". + :vartype execution_status: str or ~azure.ai.projects.models.TelephonyCampaignExecutionStatus + :ivar retry_policy: Required. + :vartype retry_policy: ~azure.ai.projects.models.TelephonyOutboundRetryPolicyResponse + :ivar latest_successful_validation_id: + :vartype latest_successful_validation_id: str + :ivar active_validation_id: + :vartype active_validation_id: str + :ivar active_recipient_import_id: + :vartype active_recipient_import_id: str + :ivar published_at: + :vartype published_at: ~datetime.datetime + :ivar call_job_counts: Required. + :vartype call_job_counts: ~azure.ai.projects.models.TelephonyCampaignCallJobCounts + :ivar created_at: Required. + :vartype created_at: ~datetime.datetime + :ivar updated_at: Required. + :vartype updated_at: ~datetime.datetime + """ + + display_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A customer-visible name for the campaign. Required.""" + telephony_binding_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The active agent telephony binding used to originate campaign calls. Required.""" + purpose: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional customer-declared purpose for campaign calls.""" + schedule: Optional["_models.TelephonyCampaignSchedule"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """When the published campaign becomes eligible to dispatch calls.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + object: Literal["telephony.campaign"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"telephony.campaign\".""" + agent_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + configuration_status: Union[str, "_models.TelephonyCampaignConfigurationStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Known values are: \"draft\", \"importing\", \"validating\", \"publishing\", + \"published\", and \"publish_failed\".""" + execution_status: Union[str, "_models.TelephonyCampaignExecutionStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Known values are: \"none\", \"scheduled\", \"running\", \"paused\", \"completed\", + \"failed\", and \"cancelled\".""" + retry_policy: "_models.TelephonyOutboundRetryPolicyResponse" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required.""" + latest_successful_validation_id: Optional[str] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + active_validation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + active_recipient_import_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + published_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + call_job_counts: "_models.TelephonyCampaignCallJobCounts" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required.""" + created_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """Required.""" + updated_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """Required.""" + + @overload + def __init__( + self, + *, + display_name: str, + telephony_binding_id: str, + id: str, # pylint: disable=redefined-builtin + agent_name: str, + configuration_status: Union[str, "_models.TelephonyCampaignConfigurationStatus"], + execution_status: Union[str, "_models.TelephonyCampaignExecutionStatus"], + retry_policy: "_models.TelephonyOutboundRetryPolicyResponse", + call_job_counts: "_models.TelephonyCampaignCallJobCounts", + created_at: datetime.datetime, + updated_at: datetime.datetime, + purpose: Optional[str] = None, + schedule: Optional["_models.TelephonyCampaignSchedule"] = None, + latest_successful_validation_id: Optional[str] = None, + active_validation_id: Optional[str] = None, + active_recipient_import_id: Optional[str] = None, + published_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.object: Literal["telephony.campaign"] = "telephony.campaign" + + +class TelephonyCampaignCallJobCounts(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Aggregate call-job counts for an outbound campaign. + + :ivar total: Required. + :vartype total: int + :ivar pending: Required. + :vartype pending: int + :ivar in_progress: Required. + :vartype in_progress: int + :ivar completed: Required. + :vartype completed: int + :ivar failed: Required. + :vartype failed: int + :ivar blocked: Required. + :vartype blocked: int + :ivar cancelled: Required. + :vartype cancelled: int + :ivar expired: Required. + :vartype expired: int + """ + + total: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + pending: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + in_progress: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + completed: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + failed: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + blocked: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + cancelled: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + expired: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + total: int, + pending: int, + in_progress: int, + completed: int, + failed: int, + blocked: int, + cancelled: int, + expired: 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 TelephonyCampaignRecipientImport(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A durable campaign recipient-import record. + + :ivar id: Required. + :vartype id: str + :ivar object: Required. Default value is "telephony.campaign.recipient_import". + :vartype object: str + :ivar campaign_id: Required. + :vartype campaign_id: str + :ivar status: Required. Known values are: "running", "succeeded", and "failed". + :vartype status: str or ~azure.ai.projects.models.TelephonyCampaignRecipientImportStatus + :ivar source: Required. + :vartype source: ~azure.ai.projects.models.TelephonyCampaignRecipientImportSource + :ivar mapping: + :vartype mapping: ~azure.ai.projects.models.TelephonyCampaignRecipientMapping + :ivar duplicate_handling: Required. Known values are: "reject", "keep_each", and "merge". + :vartype duplicate_handling: str or + ~azure.ai.projects.models.TelephonyCampaignDuplicateHandling + :ivar rows_processed: Required. + :vartype rows_processed: int + :ivar eligible_recipient_count: Required. + :vartype eligible_recipient_count: int + :ivar invalid_recipient_count: Required. + :vartype invalid_recipient_count: int + :ivar error_code: + :vartype error_code: str + :ivar error_message: + :vartype error_message: str + :ivar created_at: Required. + :vartype created_at: ~datetime.datetime + :ivar updated_at: Required. + :vartype updated_at: ~datetime.datetime + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + object: Literal["telephony.campaign.recipient_import"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Default value is \"telephony.campaign.recipient_import\".""" + campaign_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + status: Union[str, "_models.TelephonyCampaignRecipientImportStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Known values are: \"running\", \"succeeded\", and \"failed\".""" + source: "_models.TelephonyCampaignRecipientImportSource" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required.""" + mapping: Optional["_models.TelephonyCampaignRecipientMapping"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + duplicate_handling: Union[str, "_models.TelephonyCampaignDuplicateHandling"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Known values are: \"reject\", \"keep_each\", and \"merge\".""" + rows_processed: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + eligible_recipient_count: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + invalid_recipient_count: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + error_code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + error_message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + created_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """Required.""" + updated_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + campaign_id: str, + status: Union[str, "_models.TelephonyCampaignRecipientImportStatus"], + source: "_models.TelephonyCampaignRecipientImportSource", + duplicate_handling: Union[str, "_models.TelephonyCampaignDuplicateHandling"], + rows_processed: int, + eligible_recipient_count: int, + invalid_recipient_count: int, + created_at: datetime.datetime, + updated_at: datetime.datetime, + mapping: Optional["_models.TelephonyCampaignRecipientMapping"] = None, + error_code: Optional[str] = None, + error_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) + self.object: Literal["telephony.campaign.recipient_import"] = "telephony.campaign.recipient_import" + + +class TelephonyCampaignRecipientImportSource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A Dataset source for campaign recipient import. + + :ivar type: Required. Default value is "dataset". + :vartype type: str + :ivar dataset_name: Required. + :vartype dataset_name: str + :ivar dataset_version: Required. + :vartype dataset_version: str + :ivar file_name: A relative path to a CSV, JSON array, or JSONL file in the Dataset version. + Required. + :vartype file_name: str + :ivar format: Required. Known values are: "csv", "json", and "jsonl". + :vartype format: str or ~azure.ai.projects.models.TelephonyCampaignRecipientImportFormat + """ + + type: Literal["dataset"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"dataset\".""" + dataset_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + dataset_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + file_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A relative path to a CSV, JSON array, or JSONL file in the Dataset version. Required.""" + format: Union[str, "_models.TelephonyCampaignRecipientImportFormat"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Known values are: \"csv\", \"json\", and \"jsonl\".""" + + @overload + def __init__( + self, + *, + dataset_name: str, + dataset_version: str, + file_name: str, + format: Union[str, "_models.TelephonyCampaignRecipientImportFormat"], + ) -> 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["dataset"] = "dataset" + + +class TelephonyCampaignRecipientMapping(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Source fields or CSV columns mapped into each campaign recipient. Every unmapped CSV column or + JSON/JSONL top-level property becomes a same-named structured input. CSV cells are preserved as + strings until Agent-declared inputs are parsed according to their schemas; additional inputs + remain strings. + + :ivar destination: The source field containing the destination E.164 phone number. Defaults to + ``destination``. The source field is required for each recipient. Required. + :vartype destination: str + :ivar recipient_key: The source field containing the recipient key. Defaults to + ``recipient_key``. The source field is required for each recipient. Required. + :vartype recipient_key: str + :ivar recipient_item_key: The source field containing the recipient item key. Defaults to + ``recipient_item_key``. The source field is required when ``duplicate_handling`` is + ``keep_each``; otherwise it may be absent. + :vartype recipient_item_key: str + :ivar not_before: The source field containing the earliest dispatch time as a Unix timestamp in + seconds. Defaults to ``not_before``. If the source field is absent, no per-recipient start + bound is applied. + :vartype not_before: str + :ivar expires_at: The source field containing the expiry time as a Unix timestamp in seconds. + Defaults to ``expires_at``. If the source field is absent, no per-recipient expiry bound is + applied. + :vartype expires_at: str + """ + + destination: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The source field containing the destination E.164 phone number. Defaults to ``destination``. + The source field is required for each recipient. Required.""" + recipient_key: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The source field containing the recipient key. Defaults to ``recipient_key``. The source field + is required for each recipient. Required.""" + recipient_item_key: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The source field containing the recipient item key. Defaults to ``recipient_item_key``. The + source field is required when ``duplicate_handling`` is ``keep_each``; otherwise it may be + absent.""" + not_before: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The source field containing the earliest dispatch time as a Unix timestamp in seconds. Defaults + to ``not_before``. If the source field is absent, no per-recipient start bound is applied.""" + expires_at: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The source field containing the expiry time as a Unix timestamp in seconds. Defaults to + ``expires_at``. If the source field is absent, no per-recipient expiry bound is applied.""" + + @overload + def __init__( + self, + *, + destination: str, + recipient_key: str, + recipient_item_key: Optional[str] = None, + not_before: Optional[str] = None, + expires_at: 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 TelephonyCampaignRecipientMappingRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Optional source-field mappings for a recipient import. Each omitted entry uses its same-named + source field. + + :ivar destination: The source field containing the destination E.164 phone number. Defaults to + ``destination``. The source field is required for each recipient. + :vartype destination: str + :ivar recipient_key: The source field containing the recipient key. Defaults to + ``recipient_key``. The source field is required for each recipient. + :vartype recipient_key: str + :ivar recipient_item_key: The source field containing the recipient item key. Defaults to + ``recipient_item_key``. The source field is required when ``duplicate_handling`` is + ``keep_each``; otherwise it may be absent. + :vartype recipient_item_key: str + :ivar not_before: The source field containing the earliest dispatch time as a Unix timestamp in + seconds. Defaults to ``not_before``. If the source field is absent, no per-recipient start + bound is applied. + :vartype not_before: str + :ivar expires_at: The source field containing the expiry time as a Unix timestamp in seconds. + Defaults to ``expires_at``. If the source field is absent, no per-recipient expiry bound is + applied. + :vartype expires_at: str + """ + + destination: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The source field containing the destination E.164 phone number. Defaults to ``destination``. + The source field is required for each recipient.""" + recipient_key: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The source field containing the recipient key. Defaults to ``recipient_key``. The source field + is required for each recipient.""" + recipient_item_key: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The source field containing the recipient item key. Defaults to ``recipient_item_key``. The + source field is required when ``duplicate_handling`` is ``keep_each``; otherwise it may be + absent.""" + not_before: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The source field containing the earliest dispatch time as a Unix timestamp in seconds. Defaults + to ``not_before``. If the source field is absent, no per-recipient start bound is applied.""" + expires_at: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The source field containing the expiry time as a Unix timestamp in seconds. Defaults to + ``expires_at``. If the source field is absent, no per-recipient expiry bound is applied.""" + + @overload + def __init__( + self, + *, + destination: Optional[str] = None, + recipient_key: Optional[str] = None, + recipient_item_key: Optional[str] = None, + not_before: Optional[str] = None, + expires_at: 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 TelephonyCampaignSchedule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The schedule for an outbound campaign. + + :ivar type: Whether calls are eligible immediately after publication or at a future instant. + Required. Known values are: "immediate" and "scheduled". + :vartype type: str or ~azure.ai.projects.models.TelephonyCampaignScheduleType + :ivar start_at: The scheduled start instant. Required only when ``type`` is ``scheduled``. + :vartype start_at: ~datetime.datetime + """ + + type: Union[str, "_models.TelephonyCampaignScheduleType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Whether calls are eligible immediately after publication or at a future instant. Required. + Known values are: \"immediate\" and \"scheduled\".""" + start_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The scheduled start instant. Required only when ``type`` is ``scheduled``.""" + + @overload + def __init__( + self, + *, + type: Union[str, "_models.TelephonyCampaignScheduleType"], + start_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) + + +class TelephonyOperation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An asynchronous outbound telephony operation. + + :ivar id: Required. + :vartype id: str + :ivar object: Required. Default value is "telephony.operation". + :vartype object: str + :ivar status: Required. Known values are: "not_started", "running", "succeeded", "failed", + "cancelled", and "unknown". + :vartype status: str or ~azure.ai.projects.models.TelephonyOperationStatus + :ivar created_at: + :vartype created_at: ~datetime.datetime + :ivar error: + :vartype error: ~azure.ai.projects.models.ApiError + :ivar resource: + :vartype resource: ~azure.ai.projects.models.TelephonyOperationResource + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + object: Literal["telephony.operation"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"telephony.operation\".""" + status: Union[str, "_models.TelephonyOperationStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Known values are: \"not_started\", \"running\", \"succeeded\", \"failed\", + \"cancelled\", and \"unknown\".""" + created_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + error: Optional["_models.ApiError"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + resource: Optional["_models.TelephonyOperationResource"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + status: Union[str, "_models.TelephonyOperationStatus"], + created_at: Optional[datetime.datetime] = None, + error: Optional["_models.ApiError"] = None, + resource: Optional["_models.TelephonyOperationResource"] = 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.operation"] = "telephony.operation" + + +class TelephonyOperationResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A resource produced by a successful outbound telephony operation. + + :ivar id: Required. + :vartype id: str + :ivar type: Required. + :vartype type: str + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + 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 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 + """A retry policy with a fixed interval between outbound call attempts. + + :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. It must be 0 when ``max_attempts`` + is 1, and from 60 through 86400 when retries are enabled. + :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: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-seconds-int" + ) + """The fixed delay in seconds between attempts. It must be 0 when ``max_attempts`` is 1, and from + 60 through 86400 when retries are enabled.""" + + @overload + def __init__( + self, + *, + max_attempts: Optional[int] = None, + interval: 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) + self.type = TelephonyOutboundRetryPolicyType.FIXED_INTERVAL # type: ignore + + +class TelephonyOutboundRetryPolicyResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The frozen retry policy returned for an outbound call or campaign. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + TelephonyOutboundFixedIntervalRetryPolicyResponse + + :ivar type: The retry strategy. 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. + Required. + :vartype max_attempts: int + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The retry strategy. Required. \"fixed_interval\"""" + max_attempts: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The maximum number of provider attempts, including the first attempt. Required.""" + + @overload + def __init__( + self, + *, + type: str, + max_attempts: 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 TelephonyOutboundFixedIntervalRetryPolicyResponse( + TelephonyOutboundRetryPolicyResponse, 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. + Required. + :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, + *, + max_attempts: int, + interval: datetime.timedelta, + ) -> 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. diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/__init__.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/__init__.py index 9a9972c6e723..19d6ddc7b035 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/__init__.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/__init__.py @@ -21,6 +21,7 @@ from ._operations import IndexesOperations # type: ignore from ._operations import VoiceAgentWebSocketOperations # type: ignore from ._operations import AgentEndpointConversationsOperations # type: ignore +from ._operations import AgentTelephonyOperations # type: ignore from ._operations import ToolboxesOperations # type: ignore from ._patch import __all__ as _patch_all @@ -37,6 +38,7 @@ "IndexesOperations", "VoiceAgentWebSocketOperations", "AgentEndpointConversationsOperations", + "AgentTelephonyOperations", "ToolboxesOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore 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 ab39c33fc982..cadba5320db1 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 @@ -2175,7 +2175,9 @@ def build_agent_endpoint_conversations_get_agent_conversation_audio_content_requ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_create_version_request(name: str, **kwargs: Any) -> HttpRequest: +def build_agent_telephony_create_telephony_call_job_request( # pylint: disable=name-too-long + agent_name: str, *, idempotency_key: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2184,9 +2186,9 @@ def build_toolboxes_create_version_request(name: str, **kwargs: Any) -> HttpRequ accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/toolboxes/{name}/versions" + _url = "/agents/{agent_name}/telephony/call_jobs" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2195,6 +2197,7 @@ def build_toolboxes_create_version_request(name: str, **kwargs: Any) -> HttpRequ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + _headers["Idempotency-Key"] = _SERIALIZER.header("idempotency_key", idempotency_key, "str") if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2202,7 +2205,9 @@ def build_toolboxes_create_version_request(name: str, **kwargs: Any) -> HttpRequ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_get_request(name: str, **kwargs: Any) -> HttpRequest: +def build_agent_telephony_get_telephony_call_job_request( # pylint: disable=name-too-long + agent_name: str, call_job_id: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2210,9 +2215,10 @@ def build_toolboxes_get_request(name: str, **kwargs: Any) -> HttpRequest: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/toolboxes/{name}" + _url = "/agents/{agent_name}/telephony/call_jobs/{call_job_id}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "call_job_id": _SERIALIZER.url("call_job_id", call_job_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2226,13 +2232,8 @@ def build_toolboxes_get_request(name: str, **kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_list_request( - *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - after: Optional[str] = None, - before: Optional[str] = None, - **kwargs: Any +def build_agent_telephony_cancel_telephony_call_job_request( # pylint: disable=name-too-long + agent_name: str, call_job_id: str, *, etag: str, match_condition: MatchConditions, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2241,66 +2242,61 @@ def build_toolboxes_list_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/toolboxes" + _url = "/agents/{agent_name}/telephony/call_jobs/{call_job_id}:cancel" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "call_job_id": _SERIALIZER.url("call_job_id", call_job_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") + if_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["if-none-match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_list_versions_request( - name: str, - *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - after: Optional[str] = None, - before: Optional[str] = None, - **kwargs: Any +def build_agent_telephony_create_telephony_campaign_request( # pylint: disable=name-too-long + agent_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/toolboxes/{name}/versions" + _url = "/agents/{agent_name}/telephony/campaigns" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_get_version_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_agent_telephony_get_telephony_campaign_request( # pylint: disable=name-too-long + agent_name: str, campaign_id: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2308,10 +2304,10 @@ def build_toolboxes_get_version_request(name: str, version: str, **kwargs: Any) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/toolboxes/{name}/versions/{version}" + _url = "/agents/{agent_name}/telephony/campaigns/{campaign_id}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "campaign_id": _SERIALIZER.url("campaign_id", campaign_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2325,7 +2321,9 @@ def build_toolboxes_get_version_request(name: str, version: str, **kwargs: Any) return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_update_request(name: str, **kwargs: Any) -> HttpRequest: +def build_agent_telephony_import_telephony_campaign_recipients_request( # pylint: disable=name-too-long + agent_name: str, campaign_id: str, *, idempotency_key: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2334,9 +2332,10 @@ def build_toolboxes_update_request(name: str, **kwargs: Any) -> HttpRequest: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/toolboxes/{name}" + _url = "/agents/{agent_name}/telephony/campaigns/{campaign_id}/recipients:import" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "campaign_id": _SERIALIZER.url("campaign_id", campaign_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2345,21 +2344,29 @@ def build_toolboxes_update_request(name: str, **kwargs: Any) -> HttpRequest: _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + _headers["Idempotency-Key"] = _SERIALIZER.header("idempotency_key", idempotency_key, "str") if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_delete_request(name: str, **kwargs: Any) -> HttpRequest: +def build_agent_telephony_get_telephony_campaign_recipient_import_request( # pylint: disable=name-too-long + agent_name: str, campaign_id: str, import_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 = "/toolboxes/{name}" + _url = "/agents/{agent_name}/telephony/campaigns/{campaign_id}/recipient_imports/{import_id}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "campaign_id": _SERIALIZER.url("campaign_id", campaign_id, "str"), + "import_id": _SERIALIZER.url("import_id", import_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2367,18 +2374,26 @@ def build_toolboxes_delete_request(name: str, **kwargs: Any) -> HttpRequest: # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_toolboxes_delete_version_request(name: str, version: str, **kwargs: Any) -> HttpRequest: + +def build_agent_telephony_validate_telephony_campaign_request( # pylint: disable=name-too-long + agent_name: str, campaign_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 = "/toolboxes/{name}/versions/{version}" + _url = "/agents/{agent_name}/telephony/campaigns/{campaign_id}:validate" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "campaign_id": _SERIALIZER.url("campaign_id", campaign_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2386,70 +2401,71 @@ def build_toolboxes_delete_version_request(name: str, version: str, **kwargs: An # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_insight_monitors_list_request( # pylint: disable=name-too-long - *, - after: Optional[str] = None, - before: Optional[str] = None, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - agent_name: Optional[str] = None, - **kwargs: Any + +def build_agent_telephony_publish_telephony_campaign_request( # pylint: disable=name-too-long + agent_name: str, campaign_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agent_insight_monitors" + _url = "/agents/{agent_name}/telephony/campaigns/{campaign_id}:publish" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "campaign_id": _SERIALIZER.url("campaign_id", campaign_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - if after is not None: - _params["after"] = _SERIALIZER.query("after", after, "str") - if before is not None: - _params["before"] = _SERIALIZER.query("before", before, "str") - 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 agent_name is not None: - _params["agent_name"] = _SERIALIZER.query("agent_name", agent_name, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_insight_monitors_create_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long +def build_agent_telephony_pause_telephony_campaign_request( # pylint: disable=name-too-long + agent_name: str, campaign_id: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agent_insight_monitors" + _url = "/agents/{agent_name}/telephony/campaigns/{campaign_id}:pause" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "campaign_id": _SERIALIZER.url("campaign_id", campaign_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 - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_insight_monitors_get_request( # pylint: disable=name-too-long - monitor_id: str, **kwargs: Any +def build_agent_telephony_resume_telephony_campaign_request( # pylint: disable=name-too-long + agent_name: str, campaign_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2458,9 +2474,10 @@ def build_beta_agent_insight_monitors_get_request( # pylint: disable=name-too-l accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agent_insight_monitors/{monitor_id}" + _url = "/agents/{agent_name}/telephony/campaigns/{campaign_id}:resume" path_format_arguments = { - "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "campaign_id": _SERIALIZER.url("campaign_id", campaign_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2471,19 +2488,23 @@ def build_beta_agent_insight_monitors_get_request( # pylint: disable=name-too-l # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_insight_monitors_delete_request( # pylint: disable=name-too-long - monitor_id: str, **kwargs: Any +def build_agent_telephony_cancel_telephony_campaign_request( # pylint: disable=name-too-long + agent_name: str, campaign_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 = "/agent_insight_monitors/{monitor_id}" + _url = "/agents/{agent_name}/telephony/campaigns/{campaign_id}:cancel" path_format_arguments = { - "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "campaign_id": _SERIALIZER.url("campaign_id", campaign_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2491,23 +2512,26 @@ def build_beta_agent_insight_monitors_delete_request( # pylint: disable=name-to # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_insight_monitors_update_request( # pylint: disable=name-too-long - monitor_id: str, **kwargs: Any + +def build_agent_telephony_get_telephony_operation_request( # pylint: disable=name-too-long + agent_name: str, operation_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agent_insight_monitors/{monitor_id}" + _url = "/agents/{agent_name}/telephony/operations/{operation_id}" path_format_arguments = { - "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "operation_id": _SERIALIZER.url("operation_id", operation_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2516,23 +2540,23 @@ def build_beta_agent_insight_monitors_update_request( # pylint: disable=name-to _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_insight_monitors_reset_request( # pylint: disable=name-too-long - monitor_id: str, **kwargs: Any -) -> HttpRequest: +def build_toolboxes_create_version_request(name: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + # Construct URL - _url = "/agent_insight_monitors/{monitor_id}:reset" + _url = "/toolboxes/{name}/versions" path_format_arguments = { - "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2540,23 +2564,25 @@ def build_beta_agent_insight_monitors_reset_request( # pylint: disable=name-too # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_insight_monitors_create_run_request( # pylint: disable=name-too-long - monitor_id: str, *, operation_id: Optional[str] = None, **kwargs: Any -) -> HttpRequest: +def build_toolboxes_get_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agent_insight_monitors/{monitor_id}/runs" + _url = "/toolboxes/{name}" path_format_arguments = { - "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2565,24 +2591,17 @@ def build_beta_agent_insight_monitors_create_run_request( # pylint: disable=nam _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if operation_id is not None: - _headers["Operation-Id"] = _SERIALIZER.header("operation_id", operation_id, "str") - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_insight_monitors_list_runs_request( # pylint: disable=name-too-long - monitor_id: str, +def build_toolboxes_list_request( *, - after: Optional[str] = None, - before: Optional[str] = None, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, - status: Optional[Union[str, _models.JobStatus]] = None, - trigger: Optional[Union[str, _models.AgentInsightRunTrigger]] = None, + after: Optional[str] = None, + before: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2592,26 +2611,17 @@ def build_beta_agent_insight_monitors_list_runs_request( # pylint: disable=name accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agent_insight_monitors/{monitor_id}/runs" - path_format_arguments = { - "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore + _url = "/toolboxes" # Construct parameters - if after is not None: - _params["after"] = _SERIALIZER.query("after", after, "str") - if before is not None: - _params["before"] = _SERIALIZER.query("before", before, "str") 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 status is not None: - _params["status"] = _SERIALIZER.query("status", status, "str") - if trigger is not None: - _params["trigger"] = _SERIALIZER.query("trigger", trigger, "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 @@ -2620,8 +2630,14 @@ def build_beta_agent_insight_monitors_list_runs_request( # pylint: disable=name return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_insight_monitors_get_run_request( # pylint: disable=name-too-long - monitor_id: str, run_id: str, **kwargs: Any +def build_toolboxes_list_versions_request( + 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 {}) @@ -2630,26 +2646,31 @@ def build_beta_agent_insight_monitors_get_run_request( # pylint: disable=name-t accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agent_insight_monitors/{monitor_id}/runs/{run_id}" + _url = "/toolboxes/{name}/versions" path_format_arguments = { - "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), - "run_id": _SERIALIZER.url("run_id", run_id, "str"), + "name": _SERIALIZER.url("name", name, "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") - + 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_agent_insight_monitors_cancel_run_request( # pylint: disable=name-too-long - monitor_id: str, run_id: str, **kwargs: Any -) -> HttpRequest: +def build_toolboxes_get_version_request(name: str, version: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2657,10 +2678,10 @@ def build_beta_agent_insight_monitors_cancel_run_request( # pylint: disable=nam accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agent_insight_monitors/{monitor_id}/runs/{run_id}:cancel" + _url = "/toolboxes/{name}/versions/{version}" path_format_arguments = { - "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), - "run_id": _SERIALIZER.url("run_id", run_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2671,148 +2692,134 @@ def build_beta_agent_insight_monitors_cancel_run_request( # pylint: disable=nam # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_insight_monitors_list_insights_request( # pylint: disable=name-too-long - monitor_id: str, - *, - after: Optional[str] = None, - before: Optional[str] = None, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - category: Optional[str] = None, - severity: Optional[Union[str, _models.AgentInsightSeverity]] = None, - status: Optional[Union[str, _models.AgentInsightStatus]] = None, - include_details: Optional[bool] = None, - **kwargs: Any -) -> HttpRequest: +def build_toolboxes_update_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agent_insight_monitors/{monitor_id}/insights" + _url = "/toolboxes/{name}" path_format_arguments = { - "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - if after is not None: - _params["after"] = _SERIALIZER.query("after", after, "str") - if before is not None: - _params["before"] = _SERIALIZER.query("before", before, "str") - 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 category is not None: - _params["category"] = _SERIALIZER.query("category", category, "str") - if severity is not None: - _params["severity"] = _SERIALIZER.query("severity", severity, "str") - if status is not None: - _params["status"] = _SERIALIZER.query("status", status, "str") - if include_details is not None: - _params["include_details"] = _SERIALIZER.query("include_details", include_details, "bool") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agent_insight_monitors_get_insight_request( # pylint: disable=name-too-long - monitor_id: str, insight_id: str, *, include_details: Optional[bool] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) +def build_toolboxes_delete_request(name: str, **kwargs: Any) -> HttpRequest: _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 = "/agent_insight_monitors/{monitor_id}/insights/{insight_id}" + _url = "/toolboxes/{name}" path_format_arguments = { - "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), - "insight_id": _SERIALIZER.url("insight_id", insight_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - if include_details is not None: - _params["include_details"] = _SERIALIZER.query("include_details", include_details, "bool") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_toolboxes_delete_version_request(name: str, version: str, **kwargs: Any) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) -def build_beta_agent_insight_monitors_update_insight_request( # pylint: disable=name-too-long - monitor_id: str, insight_id: str, **kwargs: Any + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + # Construct URL + _url = "/toolboxes/{name}/versions/{version}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "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_agent_insight_monitors_list_request( # pylint: disable=name-too-long + *, + after: Optional[str] = None, + before: Optional[str] = None, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + agent_name: Optional[str] = None, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/agent_insight_monitors/{monitor_id}/insights/{insight_id}" - path_format_arguments = { - "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), - "insight_id": _SERIALIZER.url("insight_id", insight_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore + _url = "/agent_insight_monitors" # Construct parameters + if after is not None: + _params["after"] = _SERIALIZER.query("after", after, "str") + if before is not None: + _params["before"] = _SERIALIZER.query("before", before, "str") + 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 agent_name is not None: + _params["agent_name"] = _SERIALIZER.query("agent_name", agent_name, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluation_taxonomies_get_request( # pylint: disable=name-too-long - name: str, **kwargs: Any -) -> HttpRequest: +def build_beta_agent_insight_monitors_create_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluationtaxonomies/{name}" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore + _url = "/agent_insight_monitors" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluation_taxonomies_list_request( # pylint: disable=name-too-long - *, input_name: Optional[str] = None, input_type: Optional[str] = None, **kwargs: Any +def build_beta_agent_insight_monitors_get_request( # pylint: disable=name-too-long + monitor_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2821,14 +2828,15 @@ def build_beta_evaluation_taxonomies_list_request( # pylint: disable=name-too-l accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluationtaxonomies" + _url = "/agent_insight_monitors/{monitor_id}" + path_format_arguments = { + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if input_name is not None: - _params["inputName"] = _SERIALIZER.query("input_name", input_name, "str") - if input_type is not None: - _params["inputType"] = _SERIALIZER.query("input_type", input_type, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2836,16 +2844,16 @@ def build_beta_evaluation_taxonomies_list_request( # pylint: disable=name-too-l return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluation_taxonomies_delete_request( # pylint: disable=name-too-long - name: str, **kwargs: Any +def build_beta_agent_insight_monitors_delete_request( # pylint: disable=name-too-long + monitor_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 = "/evaluationtaxonomies/{name}" + _url = "/agent_insight_monitors/{monitor_id}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2856,8 +2864,8 @@ def build_beta_evaluation_taxonomies_delete_request( # pylint: disable=name-too return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_beta_evaluation_taxonomies_create_request( # pylint: disable=name-too-long - name: str, **kwargs: Any +def build_beta_agent_insight_monitors_update_request( # pylint: disable=name-too-long + monitor_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2867,9 +2875,9 @@ def build_beta_evaluation_taxonomies_create_request( # pylint: disable=name-too accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluationtaxonomies/{name}" + _url = "/agent_insight_monitors/{monitor_id}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2882,11 +2890,31 @@ def build_beta_evaluation_taxonomies_create_request( # pylint: disable=name-too _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluation_taxonomies_update_request( # pylint: disable=name-too-long - name: str, **kwargs: Any +def build_beta_agent_insight_monitors_reset_request( # pylint: disable=name-too-long + monitor_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 = "/agent_insight_monitors/{monitor_id}:reset" + path_format_arguments = { + "monitor_id": _SERIALIZER.url("monitor_id", monitor_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="POST", url=_url, params=_params, **kwargs) + + +def build_beta_agent_insight_monitors_create_run_request( # pylint: disable=name-too-long + monitor_id: str, *, operation_id: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2896,9 +2924,9 @@ def build_beta_evaluation_taxonomies_update_request( # pylint: disable=name-too accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluationtaxonomies/{name}" + _url = "/agent_insight_monitors/{monitor_id}/runs" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2907,18 +2935,24 @@ def build_beta_evaluation_taxonomies_update_request( # pylint: disable=name-too _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if operation_id is not None: + _headers["Operation-Id"] = _SERIALIZER.header("operation_id", operation_id, "str") if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_list_versions_request( # pylint: disable=name-too-long - name: str, +def build_beta_agent_insight_monitors_list_runs_request( # pylint: disable=name-too-long + monitor_id: str, *, - type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, + after: Optional[str] = None, + before: Optional[str] = None, limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + status: Optional[Union[str, _models.JobStatus]] = None, + trigger: Optional[Union[str, _models.AgentInsightRunTrigger]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2928,19 +2962,27 @@ def build_beta_evaluators_list_versions_request( # pylint: disable=name-too-lon accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluators/{name}/versions" + _url = "/agent_insight_monitors/{monitor_id}/runs" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if type is not None: - _params["type"] = _SERIALIZER.query("type", type, "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") 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 status is not None: + _params["status"] = _SERIALIZER.query("status", status, "str") + if trigger is not None: + _params["trigger"] = _SERIALIZER.query("trigger", trigger, "str") + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2948,11 +2990,8 @@ def build_beta_evaluators_list_versions_request( # pylint: disable=name-too-lon return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_list_request( - *, - type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, - limit: Optional[int] = None, - **kwargs: Any +def build_beta_agent_insight_monitors_get_run_request( # pylint: disable=name-too-long + monitor_id: str, run_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2961,14 +3000,16 @@ def build_beta_evaluators_list_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluators" + _url = "/agent_insight_monitors/{monitor_id}/runs/{run_id}" + path_format_arguments = { + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), + "run_id": _SERIALIZER.url("run_id", run_id, "str"), + } - # Construct parameters + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if type is not None: - _params["type"] = _SERIALIZER.query("type", type, "str") - if limit is not None: - _params["limit"] = _SERIALIZER.query("limit", limit, "int") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2976,8 +3017,8 @@ def build_beta_evaluators_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_get_version_request( # pylint: disable=name-too-long - name: str, version: str, **kwargs: Any +def build_beta_agent_insight_monitors_cancel_run_request( # pylint: disable=name-too-long + monitor_id: str, run_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2986,10 +3027,10 @@ def build_beta_evaluators_get_version_request( # pylint: disable=name-too-long accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluators/{name}/versions/{version}" + _url = "/agent_insight_monitors/{monitor_id}/runs/{run_id}:cancel" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), + "run_id": _SERIALIZER.url("run_id", run_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3000,61 +3041,92 @@ def build_beta_evaluators_get_version_request( # pylint: disable=name-too-long # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_delete_version_request( # pylint: disable=name-too-long - name: str, version: str, **kwargs: Any +def build_beta_agent_insight_monitors_list_insights_request( # pylint: disable=name-too-long + monitor_id: str, + *, + after: Optional[str] = None, + before: Optional[str] = None, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + category: Optional[str] = None, + severity: Optional[Union[str, _models.AgentInsightSeverity]] = None, + status: Optional[Union[str, _models.AgentInsightStatus]] = None, + include_details: Optional[bool] = 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 = "/evaluators/{name}/versions/{version}" + _url = "/agent_insight_monitors/{monitor_id}/insights" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + if after is not None: + _params["after"] = _SERIALIZER.query("after", after, "str") + if before is not None: + _params["before"] = _SERIALIZER.query("before", before, "str") + 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 category is not None: + _params["category"] = _SERIALIZER.query("category", category, "str") + if severity is not None: + _params["severity"] = _SERIALIZER.query("severity", severity, "str") + if status is not None: + _params["status"] = _SERIALIZER.query("status", status, "str") + if include_details is not None: + _params["include_details"] = _SERIALIZER.query("include_details", include_details, "bool") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_create_version_request( # pylint: disable=name-too-long - name: str, **kwargs: Any + +def build_beta_agent_insight_monitors_get_insight_request( # pylint: disable=name-too-long + monitor_id: str, insight_id: str, *, include_details: Optional[bool] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluators/{name}/versions" + _url = "/agent_insight_monitors/{monitor_id}/insights/{insight_id}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), + "insight_id": _SERIALIZER.url("insight_id", insight_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + if include_details is not None: + _params["include_details"] = _SERIALIZER.query("include_details", include_details, "bool") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_update_version_request( # pylint: disable=name-too-long - name: str, version: str, **kwargs: Any +def build_beta_agent_insight_monitors_update_insight_request( # pylint: disable=name-too-long + monitor_id: str, insight_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3064,10 +3136,10 @@ def build_beta_evaluators_update_version_request( # pylint: disable=name-too-lo accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluators/{name}/versions/{version}" + _url = "/agent_insight_monitors/{monitor_id}/insights/{insight_id}" path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), + "monitor_id": _SERIALIZER.url("monitor_id", monitor_id, "str"), + "insight_id": _SERIALIZER.url("insight_id", insight_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3083,21 +3155,19 @@ def build_beta_evaluators_update_version_request( # pylint: disable=name-too-lo return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_pending_upload_request( # pylint: disable=name-too-long - name: str, version: str, **kwargs: Any +def build_beta_evaluation_taxonomies_get_request( # pylint: disable=name-too-long + name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluators/{name}/versions/{version}/startPendingUpload" + _url = "/evaluationtaxonomies/{name}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3106,15 +3176,58 @@ def build_beta_evaluators_pending_upload_request( # pylint: disable=name-too-lo _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_get_credentials_request( # pylint: disable=name-too-long - name: str, version: str, **kwargs: Any +def build_beta_evaluation_taxonomies_list_request( # pylint: disable=name-too-long + *, input_name: Optional[str] = None, input_type: 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 = "/evaluationtaxonomies" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if input_name is not None: + _params["inputName"] = _SERIALIZER.query("input_name", input_name, "str") + if input_type is not None: + _params["inputType"] = _SERIALIZER.query("input_type", input_type, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_evaluation_taxonomies_delete_request( # pylint: disable=name-too-long + name: 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 = "/evaluationtaxonomies/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "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_evaluation_taxonomies_create_request( # pylint: disable=name-too-long + name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3124,10 +3237,9 @@ def build_beta_evaluators_get_credentials_request( # pylint: disable=name-too-l accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluators/{name}/versions/{version}/credentials" + _url = "/evaluationtaxonomies/{name}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3140,11 +3252,11 @@ def build_beta_evaluators_get_credentials_request( # pylint: disable=name-too-l _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_create_generation_job_request( # pylint: disable=name-too-long - *, operation_id: Optional[str] = None, **kwargs: Any +def build_beta_evaluation_taxonomies_update_request( # pylint: disable=name-too-long + name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3154,23 +3266,30 @@ def build_beta_evaluators_create_generation_job_request( # pylint: disable=name accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluator_generation_jobs" + _url = "/evaluationtaxonomies/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if operation_id is not None: - _headers["Operation-Id"] = _SERIALIZER.header("operation_id", operation_id, "str") if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_get_generation_job_request( # pylint: disable=name-too-long - job_id: str, **kwargs: Any +def build_beta_evaluators_list_versions_request( # pylint: disable=name-too-long + name: str, + *, + type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, + limit: Optional[int] = None, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3179,15 +3298,19 @@ def build_beta_evaluators_get_generation_job_request( # pylint: disable=name-to accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluator_generation_jobs/{jobId}" + _url = "/evaluators/{name}/versions" path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if type is not None: + _params["type"] = _SERIALIZER.query("type", type, "str") + if limit is not None: + _params["limit"] = _SERIALIZER.query("limit", limit, "int") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -3195,12 +3318,10 @@ def build_beta_evaluators_get_generation_job_request( # pylint: disable=name-to return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_list_generation_jobs_request( # pylint: disable=name-too-long +def build_beta_evaluators_list_request( *, + type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, 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 {}) @@ -3210,18 +3331,14 @@ def build_beta_evaluators_list_generation_jobs_request( # pylint: disable=name- accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluator_generation_jobs" + _url = "/evaluators" # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if type is not None: + _params["type"] = _SERIALIZER.query("type", type, "str") 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") @@ -3229,8 +3346,8 @@ def build_beta_evaluators_list_generation_jobs_request( # pylint: disable=name- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_cancel_generation_job_request( # pylint: disable=name-too-long - job_id: str, **kwargs: Any +def build_beta_evaluators_get_version_request( # pylint: disable=name-too-long + name: str, version: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3239,9 +3356,10 @@ def build_beta_evaluators_cancel_generation_job_request( # pylint: disable=name accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluator_generation_jobs/{jobId}:cancel" + _url = "/evaluators/{name}/versions/{version}" path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3252,19 +3370,20 @@ def build_beta_evaluators_cancel_generation_job_request( # pylint: disable=name # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_evaluators_delete_generation_job_request( # pylint: disable=name-too-long - job_id: str, **kwargs: Any +def build_beta_evaluators_delete_version_request( # pylint: disable=name-too-long + name: str, version: 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 = "/evaluator_generation_jobs/{jobId}" + _url = "/evaluators/{name}/versions/{version}" path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3275,7 +3394,9 @@ def build_beta_evaluators_delete_generation_job_request( # pylint: disable=name return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_beta_insights_generate_request(**kwargs: Any) -> HttpRequest: +def build_beta_evaluators_create_version_request( # pylint: disable=name-too-long + name: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3284,18 +3405,17 @@ def build_beta_insights_generate_request(**kwargs: Any) -> HttpRequest: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/insights" + _url = "/evaluators/{name}/versions" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if "Repeatability-Request-ID" not in _headers: - _headers["Repeatability-Request-ID"] = str(uuid.uuid4()) - if "Repeatability-First-Sent" not in _headers: - _headers["Repeatability-First-Sent"] = _SERIALIZER.serialize_data( - datetime.datetime.now(datetime.timezone.utc), "rfc-1123" - ) if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -3303,32 +3423,282 @@ def build_beta_insights_generate_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_insights_get_request( - insight_id: str, *, include_coordinates: Optional[bool] = None, **kwargs: Any +def build_beta_evaluators_update_version_request( # pylint: disable=name-too-long + name: str, version: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/insights/{id}" + _url = "/evaluators/{name}/versions/{version}" path_format_arguments = { - "id": _SERIALIZER.url("insight_id", insight_id, "str"), + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - if include_coordinates is not None: - _params["includeCoordinates"] = _SERIALIZER.query("include_coordinates", include_coordinates, "bool") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_evaluators_pending_upload_request( # pylint: disable=name-too-long + name: str, version: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/evaluators/{name}/versions/{version}/startPendingUpload" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_evaluators_get_credentials_request( # pylint: disable=name-too-long + name: str, version: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/evaluators/{name}/versions/{version}/credentials" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + "version": _SERIALIZER.url("version", version, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_evaluators_create_generation_job_request( # pylint: disable=name-too-long + *, operation_id: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/evaluator_generation_jobs" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if operation_id is not None: + _headers["Operation-Id"] = _SERIALIZER.header("operation_id", operation_id, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_evaluators_get_generation_job_request( # pylint: disable=name-too-long + job_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 = "/evaluator_generation_jobs/{jobId}" + path_format_arguments = { + "jobId": _SERIALIZER.url("job_id", job_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_evaluators_list_generation_jobs_request( # pylint: disable=name-too-long + *, + 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 = "/evaluator_generation_jobs" + + # 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_evaluators_cancel_generation_job_request( # pylint: disable=name-too-long + job_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 = "/evaluator_generation_jobs/{jobId}:cancel" + path_format_arguments = { + "jobId": _SERIALIZER.url("job_id", job_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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_evaluators_delete_generation_job_request( # pylint: disable=name-too-long + job_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 = "/evaluator_generation_jobs/{jobId}" + path_format_arguments = { + "jobId": _SERIALIZER.url("job_id", job_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_insights_generate_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/insights" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if "Repeatability-Request-ID" not in _headers: + _headers["Repeatability-Request-ID"] = str(uuid.uuid4()) + if "Repeatability-First-Sent" not in _headers: + _headers["Repeatability-First-Sent"] = _SERIALIZER.serialize_data( + datetime.datetime.now(datetime.timezone.utc), "rfc-1123" + ) + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_insights_get_request( + insight_id: str, *, include_coordinates: Optional[bool] = 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 = "/insights/{id}" + path_format_arguments = { + "id": _SERIALIZER.url("insight_id", insight_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if include_coordinates is not None: + _params["includeCoordinates"] = _SERIALIZER.query("include_coordinates", include_coordinates, "bool") + _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_insights_list_request( @@ -7020,7 +7390,6 @@ def get_session_log_stream( _decompress = kwargs.pop("decompress", True) kwargs.pop("stream", None) # must always stream; discard any caller override - kwargs.pop("stream", None) # must always stream; discard any caller override _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -12564,16 +12933,1488 @@ def get_agent_conversation_item_audio_content( # pylint: disable=name-too-long } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_agent_endpoint_conversations_get_agent_conversation_item_audio_content_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_agent_conversation_item_generated_audio( # pylint: disable=name-too-long + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.VoiceGeneratedItemAudioResponse: + """Get a voice agent conversation item's generated audio metadata. + + Returns metadata for a conversation item's generated audio. This subordinate artifact is + separate from the canonical heard-audio segment and exists only when playback was interrupted + and the service rendered more audio than the listener heard, including when the response ends + as cancelled. Returns ``404`` when the conversation or item was not persisted, or when no + generated audio exists beyond the heard segment. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose generated audio metadata is retrieved. + Required. + :type item_id: str + :return: VoiceGeneratedItemAudioResponse. The VoiceGeneratedItemAudioResponse is compatible + with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceGeneratedItemAudioResponse + :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.VoiceGeneratedItemAudioResponse] = kwargs.pop("cls", None) + + _request = build_agent_endpoint_conversations_get_agent_conversation_item_generated_audio_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.VoiceGeneratedItemAudioResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_agent_conversation_item_generated_audio_content( # pylint: disable=name-too-long + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> Iterator[bytes]: + """Stream a voice agent conversation item's generated audio. + + Streams a conversation item's generated audio as a WAV (``audio/wav``) byte stream through the + service. This subordinate artifact exists only when playback was interrupted and the service + rendered more audio than the listener heard, including when the response ends as cancelled. + This route serves Foundry-managed storage only. For bring-your-own-storage (BYOS) recordings + the bytes are not proxied, so this route returns ``409 Conflict``. Returns ``404`` when the + conversation or item was not persisted, or when no generated audio exists beyond the heard + segment. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation that contains the item. Required. + :type conversation_id: str + :param item_id: The id of the conversation item whose generated audio is streamed. 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_agent_endpoint_conversations_get_agent_conversation_item_generated_audio_content_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_agent_conversation_audio( + self, agent_name: str, conversation_id: str, **kwargs: Any + ) -> _models.VoiceRecordingResponse: + """Get a voice agent conversation's merged recording metadata. + + Returns metadata for the whole-call merged stereo recording (user audio on the left channel, + agent audio on the right). The common metadata (format, sample rate, channels, channel layout, + duration) is returned for both Foundry-managed and bring-your-own-storage (BYOS) recordings; + for BYOS the response additionally includes ``blob_uri``, the URI of the recording in the + customer's own storage (no SAS) that the customer downloads with their own credentials. The + recording is built once from the per-turn segments after persistence finalization succeeds. + While the conversation is ``in_progress``, this route returns retriable ``409 Conflict`` with + ``error.code = recording_not_ready`` and a ``Retry-After`` header when retry guidance is + available. When the conversation is ``failed``, it returns terminal ``409 Conflict`` with + ``error.code = recording_unavailable``. For a ``completed`` conversation, metadata is available + subject to the existing BYOS behavior. Requires the conversation to have persisted audio + (``store = true``); otherwise returns ``404``. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose merged recording metadata is + retrieved. Required. + :type conversation_id: str + :return: VoiceRecordingResponse. The VoiceRecordingResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceRecordingResponse + :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.VoiceRecordingResponse] = kwargs.pop("cls", None) + + _request = build_agent_endpoint_conversations_get_agent_conversation_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.VoiceRecordingResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_agent_conversation_audio_content( + self, agent_name: str, conversation_id: str, **kwargs: Any + ) -> Iterator[bytes]: + """Stream a voice agent conversation's merged recording. + + Streams the whole-call merged stereo recording as a WAV (``audio/wav``) byte stream through the + service (no SAS URL). This route serves Foundry-managed storage only. For + bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download + directly from customer storage using the ``blob_uri`` returned by the metadata route — so this + route returns ``409 Conflict`` for BYOS recordings. While the conversation is ``in_progress``, + this route returns retriable ``409 Conflict`` with ``error.code = recording_not_ready`` and a + ``Retry-After`` header when retry guidance is available. When the conversation is ``failed``, + it returns terminal ``409 Conflict`` with ``error.code = recording_unavailable``. For a + ``completed`` conversation, content is available subject to the existing BYOS behavior. A + conversation without persisted audio (``store = false``) returns ``404``. + + :param agent_name: The name of the agent. Required. + :type agent_name: str + :param conversation_id: The id of the conversation whose merged recording is streamed. + 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_agent_endpoint_conversations_get_agent_conversation_audio_content_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 AgentTelephonyOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.AIProjectClient`'s + :attr:`agent_telephony` 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") + + @overload + def create_telephony_call_job( + self, + agent_name: str, + body: _models.CreateTelephonyCallJobRequest, + *, + idempotency_key: str, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TelephonyCallJob: + """Create an outbound telephony call job. + + Creates one durable direct outbound call job. The latest agent definition is resolved when each + attempt executes. + + :param agent_name: The name of the voice agent that executes the call. Required. + :type agent_name: str + :param body: The direct outbound call to create. Required. + :type body: ~azure.ai.projects.models.CreateTelephonyCallJobRequest + :keyword idempotency_key: A customer-generated idempotency key. Reusing it with an equivalent + request returns the same call job. Required. + :paramtype idempotency_key: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyCallJob. The TelephonyCallJob is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallJob + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_telephony_call_job( + self, + agent_name: str, + body: JSON, + *, + idempotency_key: str, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TelephonyCallJob: + """Create an outbound telephony call job. + + Creates one durable direct outbound call job. The latest agent definition is resolved when each + attempt executes. + + :param agent_name: The name of the voice agent that executes the call. Required. + :type agent_name: str + :param body: The direct outbound call to create. Required. + :type body: JSON + :keyword idempotency_key: A customer-generated idempotency key. Reusing it with an equivalent + request returns the same call job. Required. + :paramtype idempotency_key: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyCallJob. The TelephonyCallJob is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallJob + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_telephony_call_job( + self, + agent_name: str, + body: IO[bytes], + *, + idempotency_key: str, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TelephonyCallJob: + """Create an outbound telephony call job. + + Creates one durable direct outbound call job. The latest agent definition is resolved when each + attempt executes. + + :param agent_name: The name of the voice agent that executes the call. Required. + :type agent_name: str + :param body: The direct outbound call to create. Required. + :type body: IO[bytes] + :keyword idempotency_key: A customer-generated idempotency key. Reusing it with an equivalent + request returns the same call job. Required. + :paramtype idempotency_key: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyCallJob. The TelephonyCallJob is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallJob + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_telephony_call_job( + self, + agent_name: str, + body: Union[_models.CreateTelephonyCallJobRequest, JSON, IO[bytes]], + *, + idempotency_key: str, + **kwargs: Any + ) -> _models.TelephonyCallJob: + """Create an outbound telephony call job. + + Creates one durable direct outbound call job. The latest agent definition is resolved when each + attempt executes. + + :param agent_name: The name of the voice agent that executes the call. Required. + :type agent_name: str + :param body: The direct outbound call to create. Is one of the following types: + CreateTelephonyCallJobRequest, JSON, IO[bytes] Required. + :type body: ~azure.ai.projects.models.CreateTelephonyCallJobRequest or JSON or IO[bytes] + :keyword idempotency_key: A customer-generated idempotency key. Reusing it with an equivalent + request returns the same call job. Required. + :paramtype idempotency_key: str + :return: TelephonyCallJob. The TelephonyCallJob is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallJob + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TelephonyCallJob] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_agent_telephony_create_telephony_call_job_request( + agent_name=agent_name, + idempotency_key=idempotency_key, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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 [202]: + 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["ETag"] = self._deserialize("str", response.headers.get("ETag")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("duration-seconds-int", response.headers.get("Retry-After")) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TelephonyCallJob, response.json()) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_telephony_call_job(self, agent_name: str, call_job_id: str, **kwargs: Any) -> _models.TelephonyCallJob: + """Get an outbound telephony call job. + + Retrieves a durable direct or campaign-created outbound call job. + + :param agent_name: Required. + :type agent_name: str + :param call_job_id: Required. + :type call_job_id: str + :return: TelephonyCallJob. The TelephonyCallJob is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallJob + :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.TelephonyCallJob] = kwargs.pop("cls", None) + + _request = build_agent_telephony_get_telephony_call_job_request( + agent_name=agent_name, + call_job_id=call_job_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) + + response_headers = {} + response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TelephonyCallJob, response.json()) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def cancel_telephony_call_job( + self, agent_name: str, call_job_id: str, *, etag: str, match_condition: MatchConditions, **kwargs: Any + ) -> _models.TelephonyCallJob: + """Cancel an outbound telephony call job. + + Requests cancellation of a durable outbound call job. A connected call is allowed to finish. + + :param agent_name: Required. + :type agent_name: str + :param call_job_id: Required. + :type call_job_id: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :return: TelephonyCallJob. The TelephonyCallJob is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCallJob + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TelephonyCallJob] = kwargs.pop("cls", None) + + _request = build_agent_telephony_cancel_telephony_call_job_request( + agent_name=agent_name, + call_job_id=call_job_id, + etag=etag, + match_condition=match_condition, + 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, 202]: + 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 = {} + if response.status_code == 200: + response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) + + if response.status_code == 202: + response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize( + "duration-seconds-int", response.headers.get("Retry-After") + ) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TelephonyCallJob, response.json()) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def create_telephony_campaign( + self, + agent_name: str, + body: _models.CreateTelephonyCampaignRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TelephonyCampaign: + """Create an outbound telephony campaign. + + Creates a draft outbound campaign. Recipients are imported and validated before the campaign + can be published. + + :param agent_name: Required. + :type agent_name: str + :param body: Required. + :type body: ~azure.ai.projects.models.CreateTelephonyCampaignRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCampaign + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_telephony_campaign( + self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.TelephonyCampaign: + """Create an outbound telephony campaign. + + Creates a draft outbound campaign. Recipients are imported and validated before the campaign + can be published. + + :param agent_name: Required. + :type agent_name: str + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCampaign + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_telephony_campaign( + self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.TelephonyCampaign: + """Create an outbound telephony campaign. + + Creates a draft outbound campaign. Recipients are imported and validated before the campaign + can be published. + + :param agent_name: Required. + :type agent_name: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCampaign + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_telephony_campaign( + self, agent_name: str, body: Union[_models.CreateTelephonyCampaignRequest, JSON, IO[bytes]], **kwargs: Any + ) -> _models.TelephonyCampaign: + """Create an outbound telephony campaign. + + Creates a draft outbound campaign. Recipients are imported and validated before the campaign + can be published. + + :param agent_name: Required. + :type agent_name: str + :param body: Is one of the following types: CreateTelephonyCampaignRequest, JSON, IO[bytes] + Required. + :type body: ~azure.ai.projects.models.CreateTelephonyCampaignRequest or JSON or IO[bytes] + :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCampaign + :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 = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TelephonyCampaign] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_agent_telephony_create_telephony_campaign_request( + agent_name=agent_name, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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 [201]: + 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["Location"] = self._deserialize("str", response.headers.get("Location")) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TelephonyCampaign, response.json()) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_telephony_campaign(self, agent_name: str, campaign_id: str, **kwargs: Any) -> _models.TelephonyCampaign: + """Get an outbound telephony campaign. + + Retrieves an outbound campaign, including configuration, execution state, and aggregate + call-job counts. + + :param agent_name: Required. + :type agent_name: str + :param campaign_id: Required. + :type campaign_id: str + :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCampaign + :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.TelephonyCampaign] = kwargs.pop("cls", None) + + _request = build_agent_telephony_get_telephony_campaign_request( + agent_name=agent_name, + campaign_id=campaign_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.TelephonyCampaign, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _import_telephony_campaign_recipients_initial( # pylint: disable=name-too-long + self, + agent_name: str, + campaign_id: str, + body: Union[_models.ImportTelephonyCampaignRecipientsRequest, JSON, IO[bytes]], + *, + idempotency_key: str, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_agent_telephony_import_telephony_campaign_recipients_request( + agent_name=agent_name, + campaign_id=campaign_id, + idempotency_key=idempotency_key, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + 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 = 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 [202]: + 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["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) + response_headers["Retry-After"] = self._deserialize("duration-seconds-int", response.headers.get("Retry-After")) + + 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 + + @overload + def begin_import_telephony_campaign_recipients( # pylint: disable=name-too-long + self, + agent_name: str, + campaign_id: str, + body: _models.ImportTelephonyCampaignRecipientsRequest, + *, + idempotency_key: str, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TelephonyOperationResource]: + """Import outbound telephony campaign recipients. + + Starts an asynchronous import of campaign recipients from a Dataset CSV, JSON array, or JSONL + file. + + :param agent_name: Required. + :type agent_name: str + :param campaign_id: Required. + :type campaign_id: str + :param body: Required. + :type body: ~azure.ai.projects.models.ImportTelephonyCampaignRecipientsRequest + :keyword idempotency_key: Required. + :paramtype idempotency_key: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns TelephonyOperationResource. The + TelephonyOperationResource is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.TelephonyOperationResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_import_telephony_campaign_recipients( # pylint: disable=name-too-long + self, + agent_name: str, + campaign_id: str, + body: JSON, + *, + idempotency_key: str, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TelephonyOperationResource]: + """Import outbound telephony campaign recipients. + + Starts an asynchronous import of campaign recipients from a Dataset CSV, JSON array, or JSONL + file. + + :param agent_name: Required. + :type agent_name: str + :param campaign_id: Required. + :type campaign_id: str + :param body: Required. + :type body: JSON + :keyword idempotency_key: Required. + :paramtype idempotency_key: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns TelephonyOperationResource. The + TelephonyOperationResource is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.TelephonyOperationResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_import_telephony_campaign_recipients( # pylint: disable=name-too-long + self, + agent_name: str, + campaign_id: str, + body: IO[bytes], + *, + idempotency_key: str, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TelephonyOperationResource]: + """Import outbound telephony campaign recipients. + + Starts an asynchronous import of campaign recipients from a Dataset CSV, JSON array, or JSONL + file. + + :param agent_name: Required. + :type agent_name: str + :param campaign_id: Required. + :type campaign_id: str + :param body: Required. + :type body: IO[bytes] + :keyword idempotency_key: Required. + :paramtype idempotency_key: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns TelephonyOperationResource. The + TelephonyOperationResource is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.TelephonyOperationResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_import_telephony_campaign_recipients( # pylint: disable=name-too-long + self, + agent_name: str, + campaign_id: str, + body: Union[_models.ImportTelephonyCampaignRecipientsRequest, JSON, IO[bytes]], + *, + idempotency_key: str, + **kwargs: Any + ) -> LROPoller[_models.TelephonyOperationResource]: + """Import outbound telephony campaign recipients. + + Starts an asynchronous import of campaign recipients from a Dataset CSV, JSON array, or JSONL + file. + + :param agent_name: Required. + :type agent_name: str + :param campaign_id: Required. + :type campaign_id: str + :param body: Is one of the following types: ImportTelephonyCampaignRecipientsRequest, JSON, + IO[bytes] Required. + :type body: ~azure.ai.projects.models.ImportTelephonyCampaignRecipientsRequest or JSON or + IO[bytes] + :keyword idempotency_key: Required. + :paramtype idempotency_key: str + :return: An instance of LROPoller that returns TelephonyOperationResource. The + TelephonyOperationResource is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.TelephonyOperationResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TelephonyOperationResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._import_telephony_campaign_recipients_initial( + agent_name=agent_name, + campaign_id=campaign_id, + body=body, + idempotency_key=idempotency_key, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Operation-Location"] = self._deserialize( + "str", response.headers.get("Operation-Location") + ) + response_headers["Retry-After"] = self._deserialize( + "duration-seconds-int", response.headers.get("Retry-After") + ) + + deserialized = _deserialize(_models.TelephonyOperationResource, response.json().get("resource", {})) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.TelephonyOperationResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.TelephonyOperationResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def get_telephony_campaign_recipient_import( + self, agent_name: str, campaign_id: str, import_id: str, **kwargs: Any + ) -> _models.TelephonyCampaignRecipientImport: + """Get an outbound telephony campaign recipient import. + + Retrieves the durable status and counters for a campaign recipient import. + + :param agent_name: Required. + :type agent_name: str + :param campaign_id: Required. + :type campaign_id: str + :param import_id: Required. + :type import_id: str + :return: TelephonyCampaignRecipientImport. The TelephonyCampaignRecipientImport is compatible + with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCampaignRecipientImport + :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.TelephonyCampaignRecipientImport] = kwargs.pop("cls", None) + + _request = build_agent_telephony_get_telephony_campaign_recipient_import_request( + agent_name=agent_name, + campaign_id=campaign_id, + import_id=import_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.TelephonyCampaignRecipientImport, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _validate_telephony_campaign_initial(self, agent_name: str, campaign_id: str, **kwargs: Any) -> Iterator[bytes]: + 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_agent_telephony_validate_telephony_campaign_request( + agent_name=agent_name, + campaign_id=campaign_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 = 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 [202]: + 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["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) + response_headers["Retry-After"] = self._deserialize("duration-seconds-int", response.headers.get("Retry-After")) + + 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 begin_validate_telephony_campaign( + self, agent_name: str, campaign_id: str, **kwargs: Any + ) -> LROPoller[_models.TelephonyOperationResource]: + """Validate an outbound telephony campaign. + + Starts asynchronous validation of the current campaign draft and imported recipient snapshot. + + :param agent_name: Required. + :type agent_name: str + :param campaign_id: Required. + :type campaign_id: str + :return: An instance of LROPoller that returns TelephonyOperationResource. The + TelephonyOperationResource is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.TelephonyOperationResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TelephonyOperationResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._validate_telephony_campaign_initial( + agent_name=agent_name, + campaign_id=campaign_id, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Operation-Location"] = self._deserialize( + "str", response.headers.get("Operation-Location") + ) + response_headers["Retry-After"] = self._deserialize( + "duration-seconds-int", response.headers.get("Retry-After") + ) + + deserialized = _deserialize(_models.TelephonyOperationResource, response.json().get("resource", {})) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.TelephonyOperationResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.TelephonyOperationResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _publish_telephony_campaign_initial( + self, + agent_name: str, + campaign_id: str, + body: Union[_models.PublishTelephonyCampaignRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_agent_endpoint_conversations_get_agent_conversation_item_audio_content_request( + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_agent_telephony_publish_telephony_campaign_request( agent_name=agent_name, - conversation_id=conversation_id, - item_id=item_id, + campaign_id=campaign_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -12583,19 +14424,18 @@ def get_agent_conversation_item_audio_content( # pylint: disable=name-too-long _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", True) + _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 + if response.status_code not in [202]: + 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, @@ -12604,7 +14444,8 @@ def get_agent_conversation_item_audio_content( # pylint: disable=name-too-long raise HttpResponseError(response=response, model=error) response_headers = {} - response_headers["Content-Type"] = self._deserialize("str", response.headers.get("Content-Type")) + response_headers["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) + response_headers["Retry-After"] = self._deserialize("duration-seconds-int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -12613,28 +14454,187 @@ def get_agent_conversation_item_audio_content( # pylint: disable=name-too-long return deserialized # type: ignore + @overload + def begin_publish_telephony_campaign( + self, + agent_name: str, + campaign_id: str, + body: _models.PublishTelephonyCampaignRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TelephonyOperationResource]: + """Publish an outbound telephony campaign. + + Permanently locks the validated campaign draft and starts asynchronous call-job + materialization. + + :param agent_name: Required. + :type agent_name: str + :param campaign_id: Required. + :type campaign_id: str + :param body: Required. + :type body: ~azure.ai.projects.models.PublishTelephonyCampaignRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns TelephonyOperationResource. The + TelephonyOperationResource is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.TelephonyOperationResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_publish_telephony_campaign( + self, agent_name: str, campaign_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[_models.TelephonyOperationResource]: + """Publish an outbound telephony campaign. + + Permanently locks the validated campaign draft and starts asynchronous call-job + materialization. + + :param agent_name: Required. + :type agent_name: str + :param campaign_id: Required. + :type campaign_id: str + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns TelephonyOperationResource. The + TelephonyOperationResource is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.TelephonyOperationResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_publish_telephony_campaign( + self, + agent_name: str, + campaign_id: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TelephonyOperationResource]: + """Publish an outbound telephony campaign. + + Permanently locks the validated campaign draft and starts asynchronous call-job + materialization. + + :param agent_name: Required. + :type agent_name: str + :param campaign_id: Required. + :type campaign_id: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns TelephonyOperationResource. The + TelephonyOperationResource is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.TelephonyOperationResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace - def get_agent_conversation_item_generated_audio( # pylint: disable=name-too-long - self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any - ) -> _models.VoiceGeneratedItemAudioResponse: - """Get a voice agent conversation item's generated audio metadata. + def begin_publish_telephony_campaign( + self, + agent_name: str, + campaign_id: str, + body: Union[_models.PublishTelephonyCampaignRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.TelephonyOperationResource]: + """Publish an outbound telephony campaign. - Returns metadata for a conversation item's generated audio. This subordinate artifact is - separate from the canonical heard-audio segment and exists only when playback was interrupted - and the service rendered more audio than the listener heard, including when the response ends - as cancelled. Returns ``404`` when the conversation or item was not persisted, or when no - generated audio exists beyond the heard segment. + Permanently locks the validated campaign draft and starts asynchronous call-job + materialization. - :param agent_name: The name of the agent. Required. + :param agent_name: Required. :type agent_name: str - :param conversation_id: The id of the conversation that contains the item. Required. - :type conversation_id: str - :param item_id: The id of the conversation item whose generated audio metadata is retrieved. + :param campaign_id: Required. + :type campaign_id: str + :param body: Is one of the following types: PublishTelephonyCampaignRequest, JSON, IO[bytes] Required. - :type item_id: str - :return: VoiceGeneratedItemAudioResponse. The VoiceGeneratedItemAudioResponse is compatible - with MutableMapping - :rtype: ~azure.ai.projects.models.VoiceGeneratedItemAudioResponse + :type body: ~azure.ai.projects.models.PublishTelephonyCampaignRequest or JSON or IO[bytes] + :return: An instance of LROPoller that returns TelephonyOperationResource. The + TelephonyOperationResource is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.TelephonyOperationResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TelephonyOperationResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._publish_telephony_campaign_initial( + agent_name=agent_name, + campaign_id=campaign_id, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Operation-Location"] = self._deserialize( + "str", response.headers.get("Operation-Location") + ) + response_headers["Retry-After"] = self._deserialize( + "duration-seconds-int", response.headers.get("Retry-After") + ) + + deserialized = _deserialize(_models.TelephonyOperationResource, response.json().get("resource", {})) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.TelephonyOperationResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.TelephonyOperationResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def pause_telephony_campaign(self, agent_name: str, campaign_id: str, **kwargs: Any) -> _models.TelephonyCampaign: + """Pause an outbound telephony campaign. + + Pauses dispatch of call jobs owned by a published campaign. + + :param agent_name: Required. + :type agent_name: str + :param campaign_id: Required. + :type campaign_id: str + :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCampaign :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -12648,12 +14648,11 @@ def get_agent_conversation_item_generated_audio( # pylint: disable=name-too-lon _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.VoiceGeneratedItemAudioResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.TelephonyCampaign] = kwargs.pop("cls", None) - _request = build_agent_endpoint_conversations_get_agent_conversation_item_generated_audio_request( + _request = build_agent_telephony_pause_telephony_campaign_request( agent_name=agent_name, - conversation_id=conversation_id, - item_id=item_id, + campaign_id=campaign_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -12687,7 +14686,7 @@ def get_agent_conversation_item_generated_audio( # pylint: disable=name-too-lon if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.VoiceGeneratedItemAudioResponse, response.json()) + deserialized = _deserialize(_models.TelephonyCampaign, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -12695,27 +14694,17 @@ def get_agent_conversation_item_generated_audio( # pylint: disable=name-too-lon return deserialized # type: ignore @distributed_trace - def get_agent_conversation_item_generated_audio_content( # pylint: disable=name-too-long - self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any - ) -> Iterator[bytes]: - """Stream a voice agent conversation item's generated audio. + def resume_telephony_campaign(self, agent_name: str, campaign_id: str, **kwargs: Any) -> _models.TelephonyCampaign: + """Resume an outbound telephony campaign. - Streams a conversation item's generated audio as a WAV (``audio/wav``) byte stream through the - service. This subordinate artifact exists only when playback was interrupted and the service - rendered more audio than the listener heard, including when the response ends as cancelled. - This route serves Foundry-managed storage only. For bring-your-own-storage (BYOS) recordings - the bytes are not proxied, so this route returns ``409 Conflict``. Returns ``404`` when the - conversation or item was not persisted, or when no generated audio exists beyond the heard - segment. + Resumes dispatch of call jobs owned by a paused campaign. - :param agent_name: The name of the agent. Required. + :param agent_name: Required. :type agent_name: str - :param conversation_id: The id of the conversation that contains the item. Required. - :type conversation_id: str - :param item_id: The id of the conversation item whose generated audio is streamed. Required. - :type item_id: str - :return: Iterator[bytes] - :rtype: Iterator[bytes] + :param campaign_id: Required. + :type campaign_id: str + :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCampaign :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -12729,12 +14718,11 @@ def get_agent_conversation_item_generated_audio_content( # pylint: disable=name _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.TelephonyCampaign] = kwargs.pop("cls", None) - _request = build_agent_endpoint_conversations_get_agent_conversation_item_generated_audio_content_request( + _request = build_agent_telephony_resume_telephony_campaign_request( agent_name=agent_name, - conversation_id=conversation_id, - item_id=item_id, + campaign_id=campaign_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -12745,7 +14733,7 @@ def get_agent_conversation_item_generated_audio_content( # pylint: disable=name _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", True) + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -12765,42 +14753,28 @@ def get_agent_conversation_item_generated_audio_content( # pylint: disable=name ) 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 _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TelephonyCampaign, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace - def get_agent_conversation_audio( - self, agent_name: str, conversation_id: str, **kwargs: Any - ) -> _models.VoiceRecordingResponse: - """Get a voice agent conversation's merged recording metadata. + def cancel_telephony_campaign(self, agent_name: str, campaign_id: str, **kwargs: Any) -> _models.TelephonyCampaign: + """Cancel an outbound telephony campaign. - Returns metadata for the whole-call merged stereo recording (user audio on the left channel, - agent audio on the right). The common metadata (format, sample rate, channels, channel layout, - duration) is returned for both Foundry-managed and bring-your-own-storage (BYOS) recordings; - for BYOS the response additionally includes ``blob_uri``, the URI of the recording in the - customer's own storage (no SAS) that the customer downloads with their own credentials. The - recording is built once from the per-turn segments after persistence finalization succeeds. - While the conversation is ``in_progress``, this route returns retriable ``409 Conflict`` with - ``error.code = recording_not_ready`` and a ``Retry-After`` header when retry guidance is - available. When the conversation is ``failed``, it returns terminal ``409 Conflict`` with - ``error.code = recording_unavailable``. For a ``completed`` conversation, metadata is available - subject to the existing BYOS behavior. Requires the conversation to have persisted audio - (``store = true``); otherwise returns ``404``. + Cancels a campaign and prevents any further call-job dispatch. - :param agent_name: The name of the agent. Required. + :param agent_name: Required. :type agent_name: str - :param conversation_id: The id of the conversation whose merged recording metadata is - retrieved. Required. - :type conversation_id: str - :return: VoiceRecordingResponse. The VoiceRecordingResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.VoiceRecordingResponse + :param campaign_id: Required. + :type campaign_id: str + :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyCampaign :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -12814,11 +14788,11 @@ def get_agent_conversation_audio( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.VoiceRecordingResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.TelephonyCampaign] = kwargs.pop("cls", None) - _request = build_agent_endpoint_conversations_get_agent_conversation_audio_request( + _request = build_agent_telephony_cancel_telephony_campaign_request( agent_name=agent_name, - conversation_id=conversation_id, + campaign_id=campaign_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -12852,7 +14826,7 @@ def get_agent_conversation_audio( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.VoiceRecordingResponse, response.json()) + deserialized = _deserialize(_models.TelephonyCampaign, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -12860,29 +14834,17 @@ def get_agent_conversation_audio( return deserialized # type: ignore @distributed_trace - def get_agent_conversation_audio_content( - self, agent_name: str, conversation_id: str, **kwargs: Any - ) -> Iterator[bytes]: - """Stream a voice agent conversation's merged recording. + def get_telephony_operation(self, agent_name: str, operation_id: str, **kwargs: Any) -> _models.TelephonyOperation: + """Get an outbound telephony operation. - Streams the whole-call merged stereo recording as a WAV (``audio/wav``) byte stream through the - service (no SAS URL). This route serves Foundry-managed storage only. For - bring-your-own-storage (BYOS) recordings the bytes are not proxied — the caller must download - directly from customer storage using the ``blob_uri`` returned by the metadata route — so this - route returns ``409 Conflict`` for BYOS recordings. While the conversation is ``in_progress``, - this route returns retriable ``409 Conflict`` with ``error.code = recording_not_ready`` and a - ``Retry-After`` header when retry guidance is available. When the conversation is ``failed``, - it returns terminal ``409 Conflict`` with ``error.code = recording_unavailable``. For a - ``completed`` conversation, content is available subject to the existing BYOS behavior. A - conversation without persisted audio (``store = false``) returns ``404``. + Retrieves an asynchronous outbound campaign operation. - :param agent_name: The name of the agent. Required. + :param agent_name: Required. :type agent_name: str - :param conversation_id: The id of the conversation whose merged recording is streamed. - Required. - :type conversation_id: str - :return: Iterator[bytes] - :rtype: Iterator[bytes] + :param operation_id: Required. + :type operation_id: str + :return: TelephonyOperation. The TelephonyOperation is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.TelephonyOperation :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -12896,11 +14858,11 @@ def get_agent_conversation_audio_content( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.TelephonyOperation] = kwargs.pop("cls", None) - _request = build_agent_endpoint_conversations_get_agent_conversation_audio_content_request( + _request = build_agent_telephony_get_telephony_operation_request( agent_name=agent_name, - conversation_id=conversation_id, + operation_id=operation_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -12911,7 +14873,7 @@ def get_agent_conversation_audio_content( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", True) + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -12931,13 +14893,13 @@ def get_agent_conversation_audio_content( ) 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 _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TelephonyOperation, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore diff --git a/sdk/ai/azure-ai-projects/docs/public-methods.md b/sdk/ai/azure-ai-projects/docs/public-methods.md index d683e4db9620..31296cc83ea0 100644 --- a/sdk/ai/azure-ai-projects/docs/public-methods.md +++ b/sdk/ai/azure-ai-projects/docs/public-methods.md @@ -6,10 +6,10 @@ This document lists all public methods available on `AIProjectClient` and its su ## Summary -There are a total of 183 unique public methods: +There are a total of 196 unique public methods: - 5 stable methods on the client -- 84 stable methods on top-level sub-clients +- 97 stable methods on top-level sub-clients - 94 beta methods on nested beta sub-clients ### Top-level sub-clients (stable operations) @@ -17,6 +17,7 @@ There are a total of 183 unique public methods: | Subclient | Class Name | Methods Count | | --- | --- | --- | | `agent_endpoint_conversations` | AgentEndpointConversationsOperations | 14 | +| `agent_telephony` | AgentTelephonyOperations | 13 | | `agents` | AgentsOperations | 38 | | `connections` | ConnectionsOperations | 3 | | `datasets` | DatasetsOperations | 9 | @@ -75,6 +76,20 @@ Alphabetically sorted. An asterisk at the end of the method name means it is a h .agent_endpoint_conversations.list_agent_conversation_responses* .agent_endpoint_conversations.list_agent_conversations* +.agent_telephony.begin_import_telephony_campaign_recipients +.agent_telephony.begin_publish_telephony_campaign +.agent_telephony.begin_validate_telephony_campaign +.agent_telephony.cancel_telephony_call_job +.agent_telephony.cancel_telephony_campaign +.agent_telephony.create_telephony_call_job +.agent_telephony.create_telephony_campaign +.agent_telephony.get_telephony_call_job +.agent_telephony.get_telephony_campaign +.agent_telephony.get_telephony_campaign_recipient_import +.agent_telephony.get_telephony_operation +.agent_telephony.pause_telephony_campaign +.agent_telephony.resume_telephony_campaign + .agents.create_session .agents.create_telephony_binding* .agents.create_version* diff --git a/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py b/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py index 1e38e6ec2abb..9b27960efc15 100644 --- a/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py +++ b/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py @@ -139,6 +139,58 @@ "agents.replace_telephony_transfer_targets", "WorkflowAgents=V1Preview,ExternalAgents=V1Preview,VoiceAgents=V1Preview,DraftAgents=V1Preview,AgentsOptimization=V2Preview,ModelRouterControls=V1Preview", ), + pytest.param( + "agent_telephony.create_telephony_call_job", + "VoiceAgents=V1Preview", + ), + pytest.param( + "agent_telephony.get_telephony_call_job", + "VoiceAgents=V1Preview", + ), + pytest.param( + "agent_telephony.cancel_telephony_call_job", + "VoiceAgents=V1Preview", + ), + pytest.param( + "agent_telephony.create_telephony_campaign", + "VoiceAgents=V1Preview", + ), + pytest.param( + "agent_telephony.get_telephony_campaign", + "VoiceAgents=V1Preview", + ), + pytest.param( + "agent_telephony.begin_import_telephony_campaign_recipients", + "VoiceAgents=V1Preview", + ), + pytest.param( + "agent_telephony.get_telephony_campaign_recipient_import", + "VoiceAgents=V1Preview", + ), + pytest.param( + "agent_telephony.begin_validate_telephony_campaign", + "VoiceAgents=V1Preview", + ), + pytest.param( + "agent_telephony.begin_publish_telephony_campaign", + "VoiceAgents=V1Preview", + ), + pytest.param( + "agent_telephony.pause_telephony_campaign", + "VoiceAgents=V1Preview", + ), + pytest.param( + "agent_telephony.resume_telephony_campaign", + "VoiceAgents=V1Preview", + ), + pytest.param( + "agent_telephony.cancel_telephony_campaign", + "VoiceAgents=V1Preview", + ), + pytest.param( + "agent_telephony.get_telephony_operation", + "VoiceAgents=V1Preview", + ), pytest.param( "evaluation_rules.create_or_update", "Evaluations=V1Preview", diff --git a/sdk/ai/azure-ai-projects/tests/foundry_features_header/test_foundry_features_header_on_ga_operations.py b/sdk/ai/azure-ai-projects/tests/foundry_features_header/test_foundry_features_header_on_ga_operations.py index bc11af8db927..fc89b11cd972 100644 --- a/sdk/ai/azure-ai-projects/tests/foundry_features_header/test_foundry_features_header_on_ga_operations.py +++ b/sdk/ai/azure-ai-projects/tests/foundry_features_header/test_foundry_features_header_on_ga_operations.py @@ -213,18 +213,20 @@ def _make_fake_call_with_headers(method: Any, headers: dict) -> Any: return lambda: method(*args, **kwargs) @pytest.mark.parametrize("method_name,_expected_header_value", _NON_BETA_OPTIONAL_TEST_CASES) + @pytest.mark.parametrize("header_name", [FOUNDRY_FEATURES_HEADER, "foundry-features", "FoUnDrY-FeAtUrEs"]) def test_foundry_features_header_override_on_ga_operations( self, client_preview_enabled: AIProjectClient, method_name: str, _expected_header_value: str, + header_name: str, ) -> None: """Caller-supplied headers={"Foundry-Features": "CustomValue"} must reach the transport instead of the internally-set default value (allow_preview=True).""" subclient_name, method_attr = method_name.split(".") sc = getattr(client_preview_enabled, subclient_name) method = getattr(sc, method_attr) - custom_headers = {FOUNDRY_FEATURES_HEADER: "CustomValue"} + custom_headers = {header_name: "CustomValue"} request = self._capture(self._make_fake_call_with_headers(method, custom_headers)) assert ( request.headers.get(FOUNDRY_FEATURES_HEADER) == "CustomValue" diff --git a/sdk/ai/azure-ai-projects/tests/foundry_features_header/test_foundry_features_header_on_ga_operations_async.py b/sdk/ai/azure-ai-projects/tests/foundry_features_header/test_foundry_features_header_on_ga_operations_async.py index 05fa75a2dca6..2d117f288d74 100644 --- a/sdk/ai/azure-ai-projects/tests/foundry_features_header/test_foundry_features_header_on_ga_operations_async.py +++ b/sdk/ai/azure-ai-projects/tests/foundry_features_header/test_foundry_features_header_on_ga_operations_async.py @@ -222,18 +222,20 @@ def _make_fake_call_with_headers(method: Any, headers: dict) -> Any: @pytest.mark.asyncio @pytest.mark.parametrize("method_name,_expected_header_value", _NON_BETA_OPTIONAL_TEST_CASES) + @pytest.mark.parametrize("header_name", [FOUNDRY_FEATURES_HEADER, "foundry-features", "FoUnDrY-FeAtUrEs"]) async def test_foundry_features_header_override_on_ga_operations_async( self, async_client_preview_enabled: AsyncAIProjectClient, method_name: str, _expected_header_value: str, + header_name: str, ) -> None: """Caller-supplied headers={"Foundry-Features": "CustomValue"} must reach the transport instead of the internally-set default value (allow_preview=True).""" subclient_name, method_attr = method_name.split(".") sc = getattr(async_client_preview_enabled, subclient_name) method = getattr(sc, method_attr) - custom_headers = {FOUNDRY_FEATURES_HEADER: "CustomValue"} + custom_headers = {header_name: "CustomValue"} request = await self._capture_async(self._make_fake_call_with_headers(method, custom_headers)) assert ( request.headers.get(FOUNDRY_FEATURES_HEADER) == "CustomValue" diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml b/sdk/ai/azure-ai-projects/tsp-location.yaml index 1fd9745871f3..1da98888dc38 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: 16e19af7a5193435c71b3afbd3391bdf5db9010c +commit: b538ac90619e094630e3c773d5231070809caf48 repo: Azure/azure-rest-api-specs additionalDirectories: - specification/ai-foundry/data-plane/Foundry/src/agents